summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorYe.Li <B37916@freescale.com>2014-10-20 11:14:58 +0800
committerYe.Li <B37916@freescale.com>2014-10-20 11:14:58 +0800
commit3f66148f3dc4ed3966e211e59bd864b955389706 (patch)
tree3ef78b5f9d5c8c7bb0c83801437bf2d865b07550 /board
parent0ae8c2c4f0fb7582a91be43a2ab8d0f68874e017 (diff)
downloadu-boot-imx-3f66148f3dc4ed3966e211e59bd864b955389706.zip
u-boot-imx-3f66148f3dc4ed3966e211e59bd864b955389706.tar.gz
u-boot-imx-3f66148f3dc4ed3966e211e59bd864b955389706.tar.bz2
MLK-9705 imx: mx6sxsabreauto: add MAX7310 support to reset peripherals
The MAX7310 uses I2C3 bus. At system initialization, enable the driver to: 1. Reset CPU_PER_RST_B signal 2. Set the steering for ENET 3. Enable the LVDS display Signed-off-by: Ye.Li <B37916@freescale.com>
Diffstat (limited to 'board')
-rw-r--r--board/freescale/mx6sxsabreauto/mx6sxsabreauto.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c b/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
index dc3295a..9a24c99 100644
--- a/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
+++ b/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
@@ -34,6 +34,10 @@
#include <mxsfb.h>
#endif
+#ifdef CONFIG_MAX7310_IOEXP
+#include <gpio_exp.h>
+#endif
+
#ifdef CONFIG_FASTBOOT
#include <fastboot.h>
#ifdef CONFIG_ANDROID_RECOVERY
@@ -200,6 +204,26 @@ static void setup_iomux_fec(int fec_id)
}
#endif
+#ifdef CONFIG_MAX7310_IOEXP
+
+#define CPU_PER_RST_B IOEXP_GPIO_NR(1, 4)
+#define LVDS_EN_PIN IOEXP_GPIO_NR(1, 7)
+#define STEER_ENET IOEXP_GPIO_NR(2, 2)
+
+int setup_max7310(void)
+{
+ /* Must call this function after i2c has setup */
+#ifdef CONFIG_SYS_I2C_MXC
+ gpio_exp_setup_port(1, 2, 0x30);
+ gpio_exp_setup_port(2, 2, 0x32);
+
+ return 0;
+#else
+ return -EPERM;
+#endif
+}
+#endif
+
static void setup_iomux_uart(void)
{
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
@@ -466,6 +490,11 @@ void do_enable_lvds(struct lcd_panel_info_t const *dev)
imx_iomux_v3_setup_multiple_pads(lvds_ctrl_pads,
ARRAY_SIZE(lvds_ctrl_pads));
+#ifdef CONFIG_MAX7310_IOEXP
+ /* LVDS Enable pin */
+ gpio_exp_direction_output(LVDS_EN_PIN , 1);
+#endif
+
/* Set Brightness to high */
gpio_direction_output(IMX_GPIO_NR(6, 3) , 1);
}
@@ -805,6 +834,18 @@ int board_init(void)
setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info3);
#endif
+#ifdef CONFIG_MAX7310_IOEXP
+ setup_max7310();
+
+ /* Reset CPU_PER_RST_B signal for enet phy and PCIE */
+ gpio_exp_direction_output(CPU_PER_RST_B, 0);
+ udelay(500);
+ gpio_exp_direction_output(CPU_PER_RST_B, 1);
+
+ /* Set steering signal to L for selecting B0 */
+ gpio_exp_direction_output(STEER_ENET, 0);
+#endif
+
#ifdef CONFIG_FEC_MXC
setup_fec(CONFIG_FEC_ENET_DEV);
#endif