2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2015-05-09 01:28:35 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Gateworks Corporation
|
|
|
|
*
|
|
|
|
* Author: Tim Harvey <tharvey@gateworks.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GWVENTANA_COMMON_H_
|
|
|
|
#define _GWVENTANA_COMMON_H_
|
|
|
|
|
|
|
|
#include "ventana_eeprom.h"
|
|
|
|
|
|
|
|
/* GPIO's common to all baseboards */
|
|
|
|
#define GP_PHY_RST IMX_GPIO_NR(1, 30)
|
|
|
|
#define GP_RS232_EN IMX_GPIO_NR(2, 11)
|
|
|
|
#define GP_MSATA_SEL IMX_GPIO_NR(2, 8)
|
|
|
|
|
|
|
|
#define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
|
|
|
|
PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
|
|
|
|
PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
|
|
|
|
|
|
|
|
#define USDHC_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
|
|
|
|
PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_LOW | \
|
|
|
|
PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
|
|
|
|
|
|
|
|
#define ENET_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
|
|
|
|
PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
|
|
|
|
PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
|
|
|
|
|
|
|
|
#define SPI_PAD_CTRL (PAD_CTL_HYS | \
|
|
|
|
PAD_CTL_PUS_100K_DOWN | PAD_CTL_SPEED_MED | \
|
|
|
|
PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
|
|
|
|
|
|
|
|
#define I2C_PAD_CTRL (PAD_CTL_PUS_100K_UP | \
|
|
|
|
PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \
|
|
|
|
PAD_CTL_ODE | PAD_CTL_SRE_FAST)
|
|
|
|
|
|
|
|
#define IRQ_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
|
|
|
|
PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
|
|
|
|
PAD_CTL_DSE_34ohm | PAD_CTL_HYS | PAD_CTL_SRE_FAST)
|
|
|
|
|
2015-05-26 18:04:54 +00:00
|
|
|
#define DIO_PAD_CFG (MUX_PAD_CTRL(IRQ_PAD_CTRL) | MUX_MODE_SION)
|
2015-05-09 01:28:35 +00:00
|
|
|
|
|
|
|
#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
|
|
|
|
|
|
|
|
/*
|
2016-07-15 14:14:23 +00:00
|
|
|
* each baseboard has an optional set user configurable Digital IO lines which
|
|
|
|
* can be pinmuxed as a GPIO or in some cases a PWM
|
2015-05-09 01:28:35 +00:00
|
|
|
*/
|
|
|
|
struct dio_cfg {
|
|
|
|
iomux_v3_cfg_t gpio_padmux[2];
|
|
|
|
unsigned gpio_param;
|
|
|
|
iomux_v3_cfg_t pwm_padmux[2];
|
|
|
|
unsigned pwm_param;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ventana {
|
|
|
|
/* pinmux */
|
|
|
|
iomux_v3_cfg_t const *gpio_pads;
|
|
|
|
int num_pads;
|
|
|
|
/* DIO pinmux/val */
|
2016-07-15 14:14:23 +00:00
|
|
|
struct dio_cfg *dio_cfg;
|
|
|
|
int dio_num;
|
2015-05-09 01:28:35 +00:00
|
|
|
/* various gpios (0 if non-existent) */
|
|
|
|
int leds[3];
|
|
|
|
int pcie_rst;
|
|
|
|
int mezz_pwren;
|
|
|
|
int mezz_irq;
|
|
|
|
int rs485en;
|
|
|
|
int gps_shdn;
|
|
|
|
int vidin_en;
|
|
|
|
int dioi2c_en;
|
|
|
|
int pcie_sson;
|
|
|
|
int usb_sel;
|
|
|
|
int wdis;
|
2016-05-24 18:03:56 +00:00
|
|
|
int msata_en;
|
2016-07-15 14:14:22 +00:00
|
|
|
int rs232_en;
|
2017-03-13 15:51:07 +00:00
|
|
|
int otgpwr_en;
|
2017-03-13 15:51:08 +00:00
|
|
|
int vsel_pin;
|
2017-03-17 14:30:38 +00:00
|
|
|
int mmc_cd;
|
2016-07-15 14:14:22 +00:00
|
|
|
/* various features */
|
2016-05-24 18:03:59 +00:00
|
|
|
bool usd_vsel;
|
2015-05-09 01:28:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct ventana gpio_cfg[GW_UNKNOWN];
|
|
|
|
|
|
|
|
/* configure i2c iomux */
|
|
|
|
void setup_ventana_i2c(void);
|
|
|
|
/* configure uart iomux */
|
|
|
|
void setup_iomux_uart(void);
|
|
|
|
/* conifgure PMIC */
|
2015-05-09 01:28:37 +00:00
|
|
|
void setup_pmic(void);
|
2015-05-09 01:28:35 +00:00
|
|
|
/* configure gpio iomux/defaults */
|
|
|
|
void setup_iomux_gpio(int board, struct ventana_board_info *);
|
|
|
|
/* late setup of GPIO (configuration per baseboard and env) */
|
|
|
|
void setup_board_gpio(int board, struct ventana_board_info *);
|
|
|
|
|
|
|
|
#endif /* #ifndef _GWVENTANA_COMMON_H_ */
|