]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/syteco/zmx25/zmx25.c
Merge branch 'master' of git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / board / syteco / zmx25 / zmx25.c
index 893adc6bd58d5242c0c85abfd078248cc366cc99..4f37c59d807011a73177594df805e98eaf47a90d 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/imx25-pinmux.h>
+#include <asm/arch/sys_proto.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -56,7 +57,7 @@ int board_init()
 
        /* Setup of core volatage selection pin to run at 1.4V */
        writel(gpio_mux_mode5, &muxctl->pad_ext_armclk); /* VCORE GPIO3[15] */
-       gpio_direction_output(MXC_GPIO_PORT_TO_NUM(3, 15), 1);
+       gpio_direction_output(IMX_GPIO_NR(3, 15), 1);
 
        /* Setup of input daisy chains for SD card pins*/
        writel(gpio_mux_mode0_sion, &muxctl->pad_sd1_cmd);
@@ -68,10 +69,10 @@ int board_init()
 
        /* Setup of digital output for USB power and OC */
        writel(gpio_mux_mode5, &muxctl->pad_csi_d3); /* USB Power GPIO1[28] */
-       gpio_direction_output(MXC_GPIO_PORT_TO_NUM(1, 28), 1);
+       gpio_direction_output(IMX_GPIO_NR(1, 28), 1);
 
        writel(gpio_mux_mode5, &muxctl->pad_csi_d2); /* USB OC GPIO1[27] */
-       gpio_direction_input(MXC_GPIO_PORT_TO_NUM(1, 18));
+       gpio_direction_input(IMX_GPIO_NR(1, 18));
 
        /* Setup of digital output control pins */
        writel(gpio_mux_mode5, &muxctl->pad_csi_d8); /* Ouput 1 Ctrl GPIO1[7] */
@@ -83,21 +84,21 @@ int board_init()
        writel(0, &padctl->pad_csi_d5); /* Ouput 2 Stat pull up off */
 
        /* Switch both output drivers off */
-       gpio_direction_output(MXC_GPIO_PORT_TO_NUM(1, 7), 0);
-       gpio_direction_output(MXC_GPIO_PORT_TO_NUM(1, 6), 0);
+       gpio_direction_output(IMX_GPIO_NR(1, 7), 0);
+       gpio_direction_output(IMX_GPIO_NR(1, 6), 0);
 
        /* Setup of key input pin GPIO2[29]*/
        writel(gpio_mux_mode5 | MX25_PIN_MUX_SION, &muxctl->pad_kpp_row0);
        writel(0, &padctl->pad_kpp_row0); /* Key pull up off */
-       gpio_direction_input(MXC_GPIO_PORT_TO_NUM(2, 29));
+       gpio_direction_input(IMX_GPIO_NR(2, 29));
 
        /* Setup of status LED outputs */
        writel(gpio_mux_mode5, &muxctl->pad_csi_d9);    /* GPIO4[21] */
        writel(gpio_mux_mode5, &muxctl->pad_csi_d4);    /* GPIO1[29] */
 
        /* Switch both LEDs off */
-       gpio_direction_output(MXC_GPIO_PORT_TO_NUM(4, 21), 0);
-       gpio_direction_output(MXC_GPIO_PORT_TO_NUM(1, 29), 0);
+       gpio_direction_output(IMX_GPIO_NR(4, 21), 0);
+       gpio_direction_output(IMX_GPIO_NR(1, 29), 0);
 
        /* Setup of CAN1 and CAN2 signals */
        writel(gpio_mux_mode6, &muxctl->pad_gpio_a);    /* CAN1 TX */
@@ -117,8 +118,6 @@ int board_init()
        writel(input_select1, &inputselect->i2c3_ipp_sda_in);   /* I2C3 SDA */
        writel(input_select2, &inputselect->i2c3_ipp_scl_in);   /* I2C3 SCL */
 
-       /* board id for linux */
-       gd->bd->bi_arch_number = MACH_TYPE_ZMX25;
        gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
        return 0;
@@ -130,7 +129,6 @@ int board_late_init(void)
 
 #ifdef CONFIG_FEC_MXC
        struct iomuxc_mux_ctl *muxctl;
-       struct iomuxc_pad_ctl *padctl;
        u32 gpio_mux_mode2 = MX25_PIN_MUX_MODE(2);
        u32 gpio_mux_mode5 = MX25_PIN_MUX_MODE(5);
 
@@ -146,18 +144,17 @@ int board_late_init(void)
         * FEC_RX_ERR: FEC_RX_ERR is ALT 2 mode of pin R2
         */
        muxctl = (struct iomuxc_mux_ctl *)IMX_IOPADMUX_BASE;
-       padctl = (struct iomuxc_pad_ctl *)IMX_IOPADCTL_BASE;
 
        writel(gpio_mux_mode5, &muxctl->pad_upll_bypclk);
        writel(gpio_mux_mode2, &muxctl->pad_uart2_cts);
 
        /* assert PHY reset (low) */
-       gpio_direction_output(MXC_GPIO_PORT_TO_NUM(3, 16), 0);
+       gpio_direction_output(IMX_GPIO_NR(3, 16), 0);
 
        udelay(5000);
 
        /* deassert PHY reset */
-       gpio_set_value(MXC_GPIO_PORT_TO_NUM(3, 16), 1);
+       gpio_set_value(IMX_GPIO_NR(3, 16), 1);
 
        udelay(5000);
 #endif
@@ -165,12 +162,12 @@ int board_late_init(void)
        e = getenv("gs_base_board");
        if (e != NULL) {
                if (strcmp(e, "G283") == 0) {
-                       int key = gpio_get_value(MXC_GPIO_PORT_TO_NUM(2, 29));
+                       int key = gpio_get_value(IMX_GPIO_NR(2, 29));
 
                        if (key) {
                                /* Switch on both LEDs to inidcate boot mode */
-                               gpio_set_value(MXC_GPIO_PORT_TO_NUM(1, 29), 0);
-                               gpio_set_value(MXC_GPIO_PORT_TO_NUM(4, 21), 0);
+                               gpio_set_value(IMX_GPIO_NR(1, 29), 0);
+                               gpio_set_value(IMX_GPIO_NR(4, 21), 0);
 
                                setenv("preboot", "run gs_slow_boot");
                        } else
@@ -188,9 +185,3 @@ int dram_init(void)
                                PHYS_SDRAM_SIZE);
        return 0;
 }
-
-void dram_init_banksize(void)
-{
-       gd->bd->bi_dram[0].start = PHYS_SDRAM;
-       gd->bd->bi_dram[0].size = gd->ram_size;
-}