diff options
author | Stefano Babic <sbabic@denx.de> | 2012-08-19 21:33:50 +0000 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2012-09-01 14:58:27 +0200 |
commit | 5fecb36ca0c5642259227bba9aed94727e084c17 (patch) | |
tree | a32cab7f29101204db24d9c8f962a9a30071e8c3 /board/syteco/zmx25/zmx25.c | |
parent | c55068e5b86b2fac47a20d8d4ab2c877d9702bda (diff) |
MX: Set a common gpio.h for all i.MX
Each i.MX has its own gpio.h, defining the same structure.
The internal GPIO controller has the same layout
(at least for the register used by u-boot) and can be shared.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Tested-by: Matt Sealey <matt@genesi-usa.com>
Diffstat (limited to 'board/syteco/zmx25/zmx25.c')
-rw-r--r-- | board/syteco/zmx25/zmx25.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/board/syteco/zmx25/zmx25.c b/board/syteco/zmx25/zmx25.c index c56b195ae1..fe5589d931 100644 --- a/board/syteco/zmx25/zmx25.c +++ b/board/syteco/zmx25/zmx25.c @@ -56,7 +56,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 +68,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 +83,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 */ @@ -148,12 +148,12 @@ int board_late_init(void) 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 @@ -161,12 +161,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 |