1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2013 Gateworks Corporation
5 * Author: Tim Harvey <tharvey@gateworks.com>
8 #ifndef _GWVENTANA_COMMON_H_
9 #define _GWVENTANA_COMMON_H_
11 #include "ventana_eeprom.h"
13 /* GPIO's common to all baseboards */
14 #define GP_RS232_EN IMX_GPIO_NR(2, 11)
15 #define GP_MSATA_SEL IMX_GPIO_NR(2, 8)
17 #define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
18 PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
19 PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
21 #define USDHC_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
22 PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_LOW | \
23 PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
25 #define ENET_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
26 PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
27 PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
29 #define SPI_PAD_CTRL (PAD_CTL_HYS | \
30 PAD_CTL_PUS_100K_DOWN | PAD_CTL_SPEED_MED | \
31 PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
33 #define I2C_PAD_CTRL (PAD_CTL_PUS_100K_UP | \
34 PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \
35 PAD_CTL_ODE | PAD_CTL_SRE_FAST)
37 #define IRQ_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
38 PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
39 PAD_CTL_DSE_34ohm | PAD_CTL_HYS | PAD_CTL_SRE_FAST)
41 #define DIO_PAD_CFG (MUX_PAD_CTRL(IRQ_PAD_CTRL) | MUX_MODE_SION)
43 #define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
46 * each baseboard has an optional set user configurable Digital IO lines which
47 * can be pinmuxed as a GPIO or in some cases a PWM
50 iomux_v3_cfg_t gpio_padmux[2];
52 iomux_v3_cfg_t pwm_padmux[2];
58 iomux_v3_cfg_t const *gpio_pads;
61 struct dio_cfg *dio_cfg;
63 /* various gpios (0 if non-existent) */
76 /* various features */
80 extern struct ventana gpio_cfg[GW_UNKNOWN];
82 /* configure i2c iomux */
83 void setup_ventana_i2c(int);
84 /* configure uart iomux */
85 void setup_iomux_uart(void);
87 void setup_pmic(void);
88 /* configure gpio iomux/defaults */
89 void setup_iomux_gpio(int board, struct ventana_board_info *);
90 /* late setup of GPIO (configuration per baseboard and env) */
91 void setup_board_gpio(int board, struct ventana_board_info *);
92 /* early model/revision ft fixups */
93 void ft_early_fixup(void *fdt, int board_type);
95 #endif /* #ifndef _GWVENTANA_COMMON_H_ */