]>
Commit | Line | Data |
---|---|---|
64a93860 MV |
1 | /* |
2 | * Olimex MX23 Olinuxino board | |
3 | * | |
4 | * Copyright (C) 2013 Marek Vasut <marex@denx.de> | |
5 | * | |
1a459660 | 6 | * SPDX-License-Identifier: GPL-2.0+ |
64a93860 MV |
7 | */ |
8 | ||
9 | #include <common.h> | |
7315e3bf | 10 | #include <asm/gpio.h> |
13b1ebde MV |
11 | #include <asm/io.h> |
12 | #include <asm/arch/iomux-mx23.h> | |
64a93860 | 13 | #include <asm/arch/imx-regs.h> |
13b1ebde | 14 | #include <asm/arch/clock.h> |
64a93860 | 15 | #include <asm/arch/sys_proto.h> |
36c7c925 OS |
16 | #ifdef CONFIG_STATUS_LED |
17 | #include <status_led.h> | |
18 | #endif | |
64a93860 MV |
19 | |
20 | DECLARE_GLOBAL_DATA_PTR; | |
21 | ||
22 | /* | |
23 | * Functions | |
24 | */ | |
25 | int board_early_init_f(void) | |
26 | { | |
13b1ebde MV |
27 | /* IO0 clock at 480MHz */ |
28 | mxs_set_ioclk(MXC_IOCLK0, 480000); | |
29 | ||
30 | /* SSP0 clock at 96MHz */ | |
31 | mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); | |
32 | ||
ebe1d170 OS |
33 | #ifdef CONFIG_CMD_USB |
34 | /* Enable LAN9512 */ | |
35 | gpio_direction_output(MX23_PAD_GPMI_ALE__GPIO_0_17, 1); | |
36 | #endif | |
37 | ||
64a93860 MV |
38 | return 0; |
39 | } | |
40 | ||
41 | int dram_init(void) | |
42 | { | |
43 | return mxs_dram_init(); | |
44 | } | |
45 | ||
13b1ebde MV |
46 | #ifdef CONFIG_CMD_MMC |
47 | static int mx23_olx_mmc_cd(int id) | |
48 | { | |
49 | return 1; /* Card always present */ | |
50 | } | |
51 | ||
52 | int board_mmc_init(bd_t *bis) | |
53 | { | |
54 | return mxsmmc_initialize(bis, 0, NULL, mx23_olx_mmc_cd); | |
55 | } | |
56 | #endif | |
57 | ||
64a93860 MV |
58 | int board_init(void) |
59 | { | |
60 | /* Adress of boot parameters */ | |
61 | gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; | |
62 | ||
36c7c925 OS |
63 | #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) |
64 | status_led_set(STATUS_LED_BOOT, STATUS_LED_STATE); | |
65 | #endif | |
66 | ||
64a93860 MV |
67 | return 0; |
68 | } |