Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Peter Senna Tschudin | 56d9692 | 2017-11-06 19:14:11 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2015 General Electric Company |
Peter Senna Tschudin | 56d9692 | 2017-11-06 19:14:11 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __PPD_GPIO_H_ |
| 7 | #define __PPD_GPIO_H_ |
| 8 | |
| 9 | #include <asm/arch/iomux-mx53.h> |
| 10 | #include <asm/gpio.h> |
| 11 | |
| 12 | #define PPD_UART_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_DSE_HIGH | \ |
| 13 | PAD_CTL_PUS_100K_UP) |
| 14 | |
| 15 | static const iomux_v3_cfg_t ppd_pads[] = { |
| 16 | /* FEC */ |
| 17 | MX53_PAD_EIM_A22__GPIO2_16, |
| 18 | /* UART */ |
| 19 | NEW_PAD_CTRL(MX53_PAD_PATA_DMACK__UART1_RXD_MUX, PPD_UART_PAD_CTRL), |
| 20 | NEW_PAD_CTRL(MX53_PAD_PATA_DIOW__UART1_TXD_MUX, PPD_UART_PAD_CTRL), |
| 21 | /* Video */ |
| 22 | MX53_PAD_CSI0_DATA_EN__GPIO5_20, /* LR_SCAN_CTRL */ |
| 23 | MX53_PAD_CSI0_VSYNC__GPIO5_21, /* UD_SCAN_CTRL */ |
| 24 | MX53_PAD_CSI0_DAT10__GPIO5_28, /* DATA_WIDTH_CTRL */ |
| 25 | MX53_PAD_CSI0_PIXCLK__GPIO5_18, /* HOST_CONTROLLED_RESET_TO_LCD_N */ |
| 26 | MX53_PAD_EIM_DA2__GPIO3_2, /* LVDS1_MUX_CTRL */ |
| 27 | MX53_PAD_EIM_DA3__GPIO3_3, /* LVDS0_MUX_CTRL */ |
| 28 | MX53_PAD_EIM_A21__GPIO2_17, /* ENABLE_PWR_TO_LCD_AND_UI_INTERFACE */ |
| 29 | MX53_PAD_CSI0_DAT11__GPIO5_29, /* BACKLIGHT_ENABLE */ |
| 30 | MX53_PAD_DISP0_DAT9__PWM2_PWMO, /* IMX535_PWM2_TO_LCD_CONNECTOR */ |
| 31 | /* I2C */ |
| 32 | MX53_PAD_EIM_A20__GPIO2_18, /* RESET_I2C1_BUS_SEGMENT_MUX_N */ |
| 33 | |
| 34 | /* SPI */ |
| 35 | MX53_PAD_DISP0_DAT23__GPIO5_17, |
| 36 | MX53_PAD_KEY_COL2__GPIO4_10, |
| 37 | MX53_PAD_KEY_ROW2__GPIO4_11, |
| 38 | MX53_PAD_KEY_COL3__GPIO4_12, |
Ian Ray | b28fbe4 | 2019-01-31 16:21:21 +0200 | [diff] [blame] | 39 | |
| 40 | MX53_PAD_PATA_DATA7__GPIO2_7, /* BUFFERED_HOST_CONTROLLED_RESET_TO_DOCKING_CONNECTOR_N */ |
Peter Senna Tschudin | 56d9692 | 2017-11-06 19:14:11 +0000 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | struct gpio_cfg { |
| 44 | unsigned int gpio; |
| 45 | int value; |
| 46 | }; |
| 47 | |
| 48 | #define RESET_IMX535_ETHERNET_PHY_N IMX_GPIO_NR(2, 16) |
| 49 | #define UD_SCAN_CTRL IMX_GPIO_NR(5, 21) |
| 50 | #define LR_SCAN_CTRL IMX_GPIO_NR(5, 20) |
| 51 | #define LVDS0_MUX_CTRL IMX_GPIO_NR(3, 3) |
| 52 | #define LVDS1_MUX_CTRL IMX_GPIO_NR(3, 2) |
| 53 | #define HOST_CONTROLLED_RESET_TO_LCD_N IMX_GPIO_NR(5, 18) |
| 54 | #define DATA_WIDTH_CTRL IMX_GPIO_NR(5, 28) |
| 55 | #define RESET_DP0_TRANSMITTER_N IMX_GPIO_NR(2, 28) |
| 56 | #define RESET_DP1_TRANSMITTER_N IMX_GPIO_NR(2, 29) |
| 57 | #define POWER_DOWN_LVDS0_DESERIALIZER_N IMX_GPIO_NR(2, 22) |
| 58 | #define POWER_DOWN_LVDS1_DESERIALIZER_N IMX_GPIO_NR(2, 27) |
| 59 | #define ENABLE_PWR_TO_LCD_AND_UI_INTERFACE IMX_GPIO_NR(2, 17) |
| 60 | #define BACKLIGHT_ENABLE IMX_GPIO_NR(5, 29) |
| 61 | #define RESET_I2C1_BUS_SEGMENT_MUX_N IMX_GPIO_NR(2, 18) |
| 62 | #define ECSPI1_CS0 IMX_GPIO_NR(5, 17) |
| 63 | #define ECSPI1_CS1 IMX_GPIO_NR(4, 10) |
| 64 | #define ECSPI1_CS2 IMX_GPIO_NR(4, 11) |
| 65 | #define ECSPI1_CS3 IMX_GPIO_NR(4, 12) |
Ian Ray | b28fbe4 | 2019-01-31 16:21:21 +0200 | [diff] [blame] | 66 | #define BUFFERED_HOST_CONTROLLED_RESET_TO_DOCKING_CONNECTOR_N IMX_GPIO_NR(2, 7) |
Peter Senna Tschudin | 56d9692 | 2017-11-06 19:14:11 +0000 | [diff] [blame] | 67 | |
| 68 | static const struct gpio_cfg ppd_gpios[] = { |
| 69 | /* FEC */ |
| 70 | /* Drive Low as GPIO output for 25ms per Eth Phy IX spec */ |
| 71 | /* Then Drive High as GPIO output to bring Eth Phy IC out of reset */ |
| 72 | { RESET_IMX535_ETHERNET_PHY_N, 0 }, |
| 73 | { RESET_IMX535_ETHERNET_PHY_N, 1 }, |
| 74 | /* Video */ |
| 75 | { UD_SCAN_CTRL, 0 }, |
| 76 | { LR_SCAN_CTRL, 1 }, |
| 77 | #ifdef PROPRIETARY_CHANGES |
| 78 | { LVDS0_MUX_CTRL, 1 }, |
| 79 | #else |
| 80 | { LVDS0_MUX_CTRL, 0 }, |
| 81 | #endif |
| 82 | { LVDS1_MUX_CTRL, 1 }, |
| 83 | { HOST_CONTROLLED_RESET_TO_LCD_N, 1 }, |
| 84 | { DATA_WIDTH_CTRL, 0 }, |
| 85 | { RESET_DP0_TRANSMITTER_N, 1 }, |
| 86 | { RESET_DP1_TRANSMITTER_N, 1 }, |
| 87 | { POWER_DOWN_LVDS0_DESERIALIZER_N, 1 }, |
| 88 | { POWER_DOWN_LVDS1_DESERIALIZER_N, 1 }, |
| 89 | { ENABLE_PWR_TO_LCD_AND_UI_INTERFACE, 1 }, |
| 90 | { BACKLIGHT_ENABLE, 0 }, |
| 91 | { RESET_I2C1_BUS_SEGMENT_MUX_N, 1 }, |
| 92 | { ECSPI1_CS0, 1 }, |
| 93 | { ECSPI1_CS1, 1 }, |
| 94 | { ECSPI1_CS2, 1 }, |
| 95 | { ECSPI1_CS3, 1 }, |
Ian Ray | b28fbe4 | 2019-01-31 16:21:21 +0200 | [diff] [blame] | 96 | { BUFFERED_HOST_CONTROLLED_RESET_TO_DOCKING_CONNECTOR_N, 1 }, |
Peter Senna Tschudin | 56d9692 | 2017-11-06 19:14:11 +0000 | [diff] [blame] | 97 | }; |
| 98 | |
| 99 | #endif /* __PPD_GPIO_H_ */ |