summaryrefslogtreecommitdiff
path: root/board/beckhoff
diff options
context:
space:
mode:
authorSteffen Dirkwinkel <s.dirkwinkel@beckhoff.com>2019-04-17 13:57:14 +0200
committerAnatolij Gustschin <agust@denx.de>2019-05-20 11:57:12 +0200
commit08cc54f0719cccb27e18d4a09a64c52c84e1a72d (patch)
tree090d57ad477501514e2b29e88826df2a98c42fd8 /board/beckhoff
parentd5006836912e69ef2a0620ecdf1311dcd113a7d2 (diff)
downloadu-boot-08cc54f0719cccb27e18d4a09a64c52c84e1a72d.tar.gz
dm: arm: imx: cx9020: enable DM_GPIO
Switch to DM_GPIO and add gpio_request where necessary. This is needed for DM_VIDEO and fixes an issue with sd card detection which was introduced by the combination of these commits: commit 7a0425dd969c ("mmc: fsl_esdhc: make get_cd work well in dm_mmc_ops") commit 7e04b4c751a1 ("dm: arm: imx: migrate cx9020 to CONFIG_DM_MMC") Acked-by: Patrick Bruenn <p.bruenn@beckhoff.com> Signed-off-by: Steffen Dirkwinkel <s.dirkwinkel@beckhoff.com>
Diffstat (limited to 'board/beckhoff')
-rw-r--r--board/beckhoff/mx53cx9020/mx53cx9020.c25
-rw-r--r--board/beckhoff/mx53cx9020/mx53cx9020_video.c1
2 files changed, 22 insertions, 4 deletions
diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c b/board/beckhoff/mx53cx9020/mx53cx9020.c
index 79d8a62cf1..79ea456028 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -91,6 +91,9 @@ void weim_cs0_settings(u32 mode)
static void setup_gpio_eim(void)
{
+ gpio_request(GPIO_C3_STATUS, "GPIO_C3_STATUS");
+ gpio_request(GPIO_C3_DONE, "GPIO_C3_DONE");
+ gpio_request(GPIO_C3_CONFIG, "GPIO_C3_CONFIG");
gpio_direction_input(GPIO_C3_STATUS);
gpio_direction_input(GPIO_C3_DONE);
gpio_direction_output(GPIO_C3_CONFIG, 1);
@@ -100,6 +103,7 @@ static void setup_gpio_eim(void)
static void setup_gpio_sups(void)
{
+ gpio_request(GPIO_SUPS_INT, "GPIO_SUPS_INT");
gpio_direction_input(GPIO_SUPS_INT);
static const int BLINK_INTERVALL = 50000;
@@ -116,6 +120,16 @@ static void setup_gpio_sups(void)
static void setup_gpio_leds(void)
{
+ gpio_request(GPIO_LED_SD2_R, "GPIO_LED_SD2_R");
+ gpio_request(GPIO_LED_SD2_B, "GPIO_LED_SD2_B");
+ gpio_request(GPIO_LED_SD2_G, "GPIO_LED_SD2_G");
+ gpio_request(GPIO_LED_SD1_R, "GPIO_LED_SD1_R");
+ gpio_request(GPIO_LED_SD1_B, "GPIO_LED_SD1_B");
+ gpio_request(GPIO_LED_SD1_G, "GPIO_LED_SD1_G");
+ gpio_request(GPIO_LED_PWR_R, "GPIO_LED_PWR_R");
+ gpio_request(GPIO_LED_PWR_B, "GPIO_LED_PWR_B");
+ gpio_request(GPIO_LED_PWR_G, "GPIO_LED_PWR_G");
+
gpio_direction_output(GPIO_LED_SD2_R, 0);
gpio_direction_output(GPIO_LED_SD2_B, 0);
gpio_direction_output(GPIO_LED_SD2_G, 0);
@@ -147,6 +161,8 @@ int board_mmc_getcd(struct mmc *mmc)
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
int ret;
+ gpio_request(GPIO_SD1_CD, "GPIO_SD1_CD");
+ gpio_request(GPIO_SD2_CD, "GPIO_SD2_CD");
gpio_direction_input(GPIO_SD1_CD);
gpio_direction_input(GPIO_SD2_CD);
@@ -212,10 +228,6 @@ static void clock_1GHz(void)
int board_early_init_f(void)
{
- setup_gpio_leds();
- setup_gpio_sups();
- setup_gpio_eim();
- setup_iomux_lcd();
return 0;
}
@@ -235,6 +247,11 @@ int board_init(void)
mxc_set_sata_internal_clock();
+ setup_gpio_leds();
+ setup_gpio_sups();
+ setup_gpio_eim();
+ setup_iomux_lcd();
+
return 0;
}
diff --git a/board/beckhoff/mx53cx9020/mx53cx9020_video.c b/board/beckhoff/mx53cx9020/mx53cx9020_video.c
index 4055bccc2b..85f1cdae8a 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020_video.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020_video.c
@@ -36,6 +36,7 @@ void setup_iomux_lcd(void)
{
/* Turn on DVI_PWD */
imx_iomux_v3_setup_pad(MX53_PAD_CSI0_DAT15__GPIO6_1);
+ gpio_request(CX9020_DVI_PWD, "CX9020_DVI_PWD");
gpio_direction_output(CX9020_DVI_PWD, 1);
}