]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
64a93860 MV |
2 | /* |
3 | * Olimex MX23 Olinuxino board | |
4 | * | |
5 | * Copyright (C) 2013 Marek Vasut <[email protected]> | |
64a93860 MV |
6 | */ |
7 | ||
d678a59d | 8 | #include <common.h> |
691d719d | 9 | #include <init.h> |
401d1c4f | 10 | #include <asm/global_data.h> |
7315e3bf | 11 | #include <asm/gpio.h> |
13b1ebde MV |
12 | #include <asm/io.h> |
13 | #include <asm/arch/iomux-mx23.h> | |
64a93860 | 14 | #include <asm/arch/imx-regs.h> |
13b1ebde | 15 | #include <asm/arch/clock.h> |
64a93860 | 16 | #include <asm/arch/sys_proto.h> |
2d8d190c | 17 | #ifdef CONFIG_LED_STATUS |
36c7c925 OS |
18 | #include <status_led.h> |
19 | #endif | |
c05ed00a | 20 | #include <linux/delay.h> |
64a93860 MV |
21 | |
22 | DECLARE_GLOBAL_DATA_PTR; | |
23 | ||
24 | /* | |
25 | * Functions | |
26 | */ | |
27 | int board_early_init_f(void) | |
28 | { | |
13b1ebde MV |
29 | /* IO0 clock at 480MHz */ |
30 | mxs_set_ioclk(MXC_IOCLK0, 480000); | |
31 | ||
32 | /* SSP0 clock at 96MHz */ | |
33 | mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); | |
34 | ||
ca11db26 MV |
35 | return 0; |
36 | } | |
37 | ||
ebe1d170 | 38 | #ifdef CONFIG_CMD_USB |
ca11db26 MV |
39 | int board_ehci_hcd_init(int port) |
40 | { | |
41 | /* Enable LAN9512 (Maxi) or GL850G (Mini) USB HUB power. */ | |
ebe1d170 | 42 | gpio_direction_output(MX23_PAD_GPMI_ALE__GPIO_0_17, 1); |
ca11db26 MV |
43 | udelay(100); |
44 | return 0; | |
45 | } | |
ebe1d170 | 46 | |
ca11db26 MV |
47 | int board_ehci_hcd_exit(int port) |
48 | { | |
49 | /* Enable LAN9512 (Maxi) or GL850G (Mini) USB HUB power. */ | |
50 | gpio_direction_output(MX23_PAD_GPMI_ALE__GPIO_0_17, 0); | |
64a93860 MV |
51 | return 0; |
52 | } | |
ca11db26 | 53 | #endif |
64a93860 MV |
54 | |
55 | int dram_init(void) | |
56 | { | |
57 | return mxs_dram_init(); | |
58 | } | |
59 | ||
60 | int board_init(void) | |
61 | { | |
62 | /* Adress of boot parameters */ | |
63 | gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; | |
64 | ||
2d8d190c UM |
65 | #if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE) |
66 | status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_STATE); | |
36c7c925 OS |
67 | #endif |
68 | ||
64a93860 MV |
69 | return 0; |
70 | } |