2 * Freescale MX23EVK board
4 * (C) Copyright 2013 O.S. Systems Software LTDA.
6 * Author: Otavio Salvador <otavio@ossystems.com.br>
9 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
10 * on behalf of DENX Software Engineering GmbH
12 * SPDX-License-Identifier: GPL-2.0+
17 #include <asm/arch/imx-regs.h>
18 #include <asm/arch/clock.h>
19 #include <asm/arch/iomux-mx23.h>
20 #include <asm/arch/sys_proto.h>
22 DECLARE_GLOBAL_DATA_PTR;
27 int board_early_init_f(void)
29 /* IO0 clock at 480MHz */
30 mxs_set_ioclk(MXC_IOCLK0, 480000);
32 /* SSP0 clock at 96MHz */
33 mxs_set_sspclk(MXC_SSPCLK0, 96000, 0);
36 gpio_direction_output(MX23_PAD_LCD_RESET__GPIO_1_18, 1);
38 /* Set contrast to maximum */
39 gpio_direction_output(MX23_PAD_PWM2__GPIO_1_28, 1);
46 return mxs_dram_init();
51 /* Adress of boot parameters */
52 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
58 static int mx23evk_mmc_wp(int id)
61 printf("MXS MMC: Invalid card selected (card id = %d)\n", id);
65 return gpio_get_value(MX23_PAD_PWM4__GPIO_1_30);
68 int board_mmc_init(bd_t *bis)
70 /* Configure WP as input */
71 gpio_direction_input(MX23_PAD_PWM4__GPIO_1_30);
73 /* Configure MMC0 Power Enable */
74 gpio_direction_output(MX23_PAD_PWM3__GPIO_1_29, 0);
76 return mxsmmc_initialize(bis, 0, mx23evk_mmc_wp, NULL);