]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/mx53ard/mx53ard.c
powerpc/t4240qds: Print FPGA detail version
[u-boot] / board / freescale / mx53ard / mx53ard.c
index be32aee14f4adb1dc24a4ff52b1f62953e994881..2fc8570f23b5a1f496be27f114852260d7024f38 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/arch/mx5x_pins.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/crm_regs.h>
+#include <asm/arch/clock.h>
 #include <asm/arch/iomux.h>
 #include <asm/errno.h>
 #include <netdev.h>
@@ -33,7 +34,7 @@
 #include <fsl_esdhc.h>
 #include <asm/gpio.h>
 
-#define ETHERNET_INT           (1 * 32 + 31)  /* GPIO2_31 */
+#define ETHERNET_INT           IMX_GPIO_NR(2, 31)
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -79,20 +80,26 @@ static void setup_iomux_uart(void)
 
 #ifdef CONFIG_FSL_ESDHC
 struct fsl_esdhc_cfg esdhc_cfg[2] = {
-       {MMC_SDHC1_BASE_ADDR, 1 },
-       {MMC_SDHC2_BASE_ADDR, 1 },
+       {MMC_SDHC1_BASE_ADDR},
+       {MMC_SDHC2_BASE_ADDR},
 };
 
-int board_mmc_getcd(u8 *cd, struct mmc *mmc)
+int board_mmc_getcd(struct mmc *mmc)
 {
        struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
+       int ret;
+
+       mxc_request_iomux(MX53_PIN_GPIO_1, IOMUX_CONFIG_ALT1);
+       gpio_direction_input(IMX_GPIO_NR(1, 1));
+       mxc_request_iomux(MX53_PIN_GPIO_4, IOMUX_CONFIG_ALT1);
+       gpio_direction_input(IMX_GPIO_NR(1, 4));
 
        if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
-               *cd = gpio_get_value(1); /*GPIO1_1*/
+               ret = !gpio_get_value(IMX_GPIO_NR(1, 1));
        else
-               *cd = gpio_get_value(4); /*GPIO1_4*/
+               ret = !gpio_get_value(IMX_GPIO_NR(1, 4));
 
-       return 0;
+       return ret;
 }
 
 int board_mmc_init(bd_t *bis)
@@ -100,6 +107,9 @@ int board_mmc_init(bd_t *bis)
        u32 index;
        s32 status = 0;
 
+       esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
+       esdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
+
        for (index = 0; index < CONFIG_SYS_FSL_ESDHC_NUM; index++) {
                switch (index) {
                case 0:
@@ -281,7 +291,7 @@ int board_init(void)
 
 int board_eth_init(bd_t *bis)
 {
-       int rc = 0;
+       int rc = -ENODEV;
 
        weim_smc911x_iomux();
        weim_cs1_settings();