2018-05-07 05:58:06 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2014-03-06 23:46:30 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Gateworks Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _VENTANA_EEPROM_
|
|
|
|
#define _VENTANA_EEPROM_
|
|
|
|
|
|
|
|
struct ventana_board_info {
|
|
|
|
u8 mac0[6]; /* 0x00: MAC1 */
|
|
|
|
u8 mac1[6]; /* 0x06: MAC2 */
|
|
|
|
u8 res0[12]; /* 0x0C: reserved */
|
|
|
|
u32 serial; /* 0x18: Serial Number (read only) */
|
|
|
|
u8 res1[4]; /* 0x1C: reserved */
|
|
|
|
u8 mfgdate[4]; /* 0x20: MFG date (read only) */
|
|
|
|
u8 res2[7]; /* 0x24 */
|
|
|
|
/* sdram config */
|
2014-04-03 13:10:48 +08:00
|
|
|
u8 sdram_size; /* 0x2B: (16 << n) MB */
|
|
|
|
u8 sdram_speed; /* 0x2C: (33.333 * n) MHz */
|
|
|
|
u8 sdram_width; /* 0x2D: (8 << n) bit */
|
2014-03-06 23:46:30 +08:00
|
|
|
/* cpu config */
|
2014-04-03 13:10:48 +08:00
|
|
|
u8 cpu_speed; /* 0x2E: (33.333 * n) MHz */
|
|
|
|
u8 cpu_type; /* 0x2F: 7=imx6q, 8=imx6dl */
|
2014-03-06 23:46:30 +08:00
|
|
|
u8 model[16]; /* 0x30: model string */
|
|
|
|
/* FLASH config */
|
2014-04-03 13:10:48 +08:00
|
|
|
u8 nand_flash_size; /* 0x40: (8 << (n-1)) MB */
|
|
|
|
u8 spi_flash_size; /* 0x41: (4 << (n-1)) MB */
|
2014-03-06 23:46:30 +08:00
|
|
|
|
|
|
|
/* Config1: SoC Peripherals */
|
|
|
|
u8 config[8]; /* 0x42: loading options */
|
|
|
|
|
|
|
|
u8 res3[4]; /* 0x4A */
|
|
|
|
|
|
|
|
u8 chksum[2]; /* 0x4E */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* config bits */
|
|
|
|
enum {
|
|
|
|
EECONFIG_ETH0,
|
|
|
|
EECONFIG_ETH1,
|
|
|
|
EECONFIG_HDMI_OUT,
|
|
|
|
EECONFIG_SATA,
|
|
|
|
EECONFIG_PCIE,
|
|
|
|
EECONFIG_SSI0,
|
|
|
|
EECONFIG_SSI1,
|
|
|
|
EECONFIG_LCD,
|
|
|
|
EECONFIG_LVDS0,
|
|
|
|
EECONFIG_LVDS1,
|
|
|
|
EECONFIG_USB0,
|
|
|
|
EECONFIG_USB1,
|
|
|
|
EECONFIG_SD0,
|
|
|
|
EECONFIG_SD1,
|
|
|
|
EECONFIG_SD2,
|
|
|
|
EECONFIG_SD3,
|
|
|
|
EECONFIG_UART0,
|
|
|
|
EECONFIG_UART1,
|
|
|
|
EECONFIG_UART2,
|
|
|
|
EECONFIG_UART3,
|
|
|
|
EECONFIG_UART4,
|
|
|
|
EECONFIG_IPU0,
|
|
|
|
EECONFIG_IPU1,
|
|
|
|
EECONFIG_FLEXCAN,
|
|
|
|
EECONFIG_MIPI_DSI,
|
|
|
|
EECONFIG_MIPI_CSI,
|
|
|
|
EECONFIG_TZASC0,
|
|
|
|
EECONFIG_TZASC1,
|
|
|
|
EECONFIG_I2C0,
|
|
|
|
EECONFIG_I2C1,
|
|
|
|
EECONFIG_I2C2,
|
|
|
|
EECONFIG_VPU,
|
|
|
|
EECONFIG_CSI0,
|
|
|
|
EECONFIG_CSI1,
|
|
|
|
EECONFIG_CAAM,
|
|
|
|
EECONFIG_MEZZ,
|
|
|
|
EECONFIG_RES1,
|
|
|
|
EECONFIG_RES2,
|
|
|
|
EECONFIG_RES3,
|
|
|
|
EECONFIG_RES4,
|
|
|
|
EECONFIG_ESPCI0,
|
|
|
|
EECONFIG_ESPCI1,
|
|
|
|
EECONFIG_ESPCI2,
|
|
|
|
EECONFIG_ESPCI3,
|
|
|
|
EECONFIG_ESPCI4,
|
|
|
|
EECONFIG_ESPCI5,
|
|
|
|
EECONFIG_RES5,
|
|
|
|
EECONFIG_RES6,
|
|
|
|
EECONFIG_GPS,
|
|
|
|
EECONFIG_SPIFL0,
|
|
|
|
EECONFIG_SPIFL1,
|
|
|
|
EECONFIG_GSPBATT,
|
|
|
|
EECONFIG_HDMI_IN,
|
|
|
|
EECONFIG_VID_OUT,
|
|
|
|
EECONFIG_VID_IN,
|
|
|
|
EECONFIG_NAND,
|
|
|
|
EECONFIG_RES8,
|
|
|
|
EECONFIG_RES9,
|
|
|
|
EECONFIG_RES10,
|
|
|
|
EECONFIG_RES11,
|
|
|
|
EECONFIG_RES12,
|
|
|
|
EECONFIG_RES13,
|
|
|
|
EECONFIG_RES14,
|
|
|
|
EECONFIG_RES15,
|
|
|
|
};
|
|
|
|
|
2014-06-03 07:13:25 +08:00
|
|
|
enum {
|
|
|
|
GW54proto, /* original GW5400-A prototype */
|
|
|
|
GW51xx,
|
|
|
|
GW52xx,
|
|
|
|
GW53xx,
|
|
|
|
GW54xx,
|
2015-04-09 03:54:45 +08:00
|
|
|
GW551x,
|
2014-08-21 14:35:14 +08:00
|
|
|
GW552x,
|
2016-05-25 02:03:58 +08:00
|
|
|
GW553x,
|
2017-03-17 22:31:02 +08:00
|
|
|
GW560x,
|
2017-03-17 22:32:21 +08:00
|
|
|
GW5903,
|
2017-03-17 22:30:38 +08:00
|
|
|
GW5904,
|
2019-02-05 05:10:50 +08:00
|
|
|
GW5905,
|
2019-02-05 05:10:54 +08:00
|
|
|
GW5906,
|
2019-02-05 05:10:55 +08:00
|
|
|
GW5907,
|
2019-02-05 05:10:56 +08:00
|
|
|
GW5908,
|
2019-02-05 05:10:57 +08:00
|
|
|
GW5909,
|
2014-06-03 07:13:25 +08:00
|
|
|
GW_UNKNOWN,
|
2014-08-08 13:35:45 +08:00
|
|
|
GW_BADCRC,
|
2014-06-03 07:13:25 +08:00
|
|
|
};
|
|
|
|
|
2014-08-08 13:35:45 +08:00
|
|
|
/* config items */
|
|
|
|
struct ventana_eeprom_config {
|
|
|
|
const char *name; /* name of item */
|
|
|
|
const char *dtalias; /* name of dt node to remove if not set */
|
|
|
|
int bit; /* bit within config */
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct ventana_eeprom_config econfig[];
|
|
|
|
extern struct ventana_board_info ventana_info;
|
|
|
|
|
2014-06-03 07:13:25 +08:00
|
|
|
int read_eeprom(int bus, struct ventana_board_info *);
|
|
|
|
|
2014-03-06 23:46:30 +08:00
|
|
|
#endif
|