blob: 3e24287fe71ad78b2dd3c5e6541459c55858a775 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Tim Harvey552c3582014-03-06 07:46:30 -08002/*
3 * Copyright (C) 2013 Gateworks Corporation
Tim Harvey552c3582014-03-06 07:46:30 -08004 */
5
6#ifndef _VENTANA_EEPROM_
7#define _VENTANA_EEPROM_
8
9struct ventana_board_info {
10 u8 mac0[6]; /* 0x00: MAC1 */
11 u8 mac1[6]; /* 0x06: MAC2 */
12 u8 res0[12]; /* 0x0C: reserved */
13 u32 serial; /* 0x18: Serial Number (read only) */
14 u8 res1[4]; /* 0x1C: reserved */
15 u8 mfgdate[4]; /* 0x20: MFG date (read only) */
16 u8 res2[7]; /* 0x24 */
17 /* sdram config */
Tim Harveya61d0212014-04-02 22:10:48 -070018 u8 sdram_size; /* 0x2B: (16 << n) MB */
19 u8 sdram_speed; /* 0x2C: (33.333 * n) MHz */
20 u8 sdram_width; /* 0x2D: (8 << n) bit */
Tim Harvey552c3582014-03-06 07:46:30 -080021 /* cpu config */
Tim Harveya61d0212014-04-02 22:10:48 -070022 u8 cpu_speed; /* 0x2E: (33.333 * n) MHz */
23 u8 cpu_type; /* 0x2F: 7=imx6q, 8=imx6dl */
Tim Harvey552c3582014-03-06 07:46:30 -080024 u8 model[16]; /* 0x30: model string */
25 /* FLASH config */
Tim Harveya61d0212014-04-02 22:10:48 -070026 u8 nand_flash_size; /* 0x40: (8 << (n-1)) MB */
27 u8 spi_flash_size; /* 0x41: (4 << (n-1)) MB */
Tim Harvey552c3582014-03-06 07:46:30 -080028
29 /* Config1: SoC Peripherals */
30 u8 config[8]; /* 0x42: loading options */
31
32 u8 res3[4]; /* 0x4A */
33
34 u8 chksum[2]; /* 0x4E */
35};
36
37/* config bits */
38enum {
39 EECONFIG_ETH0,
40 EECONFIG_ETH1,
41 EECONFIG_HDMI_OUT,
42 EECONFIG_SATA,
43 EECONFIG_PCIE,
44 EECONFIG_SSI0,
45 EECONFIG_SSI1,
46 EECONFIG_LCD,
47 EECONFIG_LVDS0,
48 EECONFIG_LVDS1,
49 EECONFIG_USB0,
50 EECONFIG_USB1,
51 EECONFIG_SD0,
52 EECONFIG_SD1,
53 EECONFIG_SD2,
54 EECONFIG_SD3,
55 EECONFIG_UART0,
56 EECONFIG_UART1,
57 EECONFIG_UART2,
58 EECONFIG_UART3,
59 EECONFIG_UART4,
60 EECONFIG_IPU0,
61 EECONFIG_IPU1,
62 EECONFIG_FLEXCAN,
63 EECONFIG_MIPI_DSI,
64 EECONFIG_MIPI_CSI,
65 EECONFIG_TZASC0,
66 EECONFIG_TZASC1,
67 EECONFIG_I2C0,
68 EECONFIG_I2C1,
69 EECONFIG_I2C2,
70 EECONFIG_VPU,
71 EECONFIG_CSI0,
72 EECONFIG_CSI1,
73 EECONFIG_CAAM,
74 EECONFIG_MEZZ,
75 EECONFIG_RES1,
76 EECONFIG_RES2,
77 EECONFIG_RES3,
78 EECONFIG_RES4,
79 EECONFIG_ESPCI0,
80 EECONFIG_ESPCI1,
81 EECONFIG_ESPCI2,
82 EECONFIG_ESPCI3,
83 EECONFIG_ESPCI4,
84 EECONFIG_ESPCI5,
85 EECONFIG_RES5,
86 EECONFIG_RES6,
87 EECONFIG_GPS,
88 EECONFIG_SPIFL0,
89 EECONFIG_SPIFL1,
90 EECONFIG_GSPBATT,
91 EECONFIG_HDMI_IN,
92 EECONFIG_VID_OUT,
93 EECONFIG_VID_IN,
94 EECONFIG_NAND,
95 EECONFIG_RES8,
96 EECONFIG_RES9,
97 EECONFIG_RES10,
98 EECONFIG_RES11,
99 EECONFIG_RES12,
100 EECONFIG_RES13,
101 EECONFIG_RES14,
102 EECONFIG_RES15,
103};
104
Tim Harvey0dccde72014-06-02 16:13:25 -0700105enum {
106 GW54proto, /* original GW5400-A prototype */
107 GW51xx,
108 GW52xx,
109 GW53xx,
110 GW54xx,
Tim Harveyb6de3b22015-04-08 12:54:45 -0700111 GW551x,
Tim Harvey50581832014-08-20 23:35:14 -0700112 GW552x,
Tim Harvey892068c2016-05-24 11:03:58 -0700113 GW553x,
Tim Harvey659441b2017-03-17 07:31:02 -0700114 GW560x,
Tim Harvey4533c902017-03-17 07:32:21 -0700115 GW5903,
Tim Harvey63537792017-03-17 07:30:38 -0700116 GW5904,
Tim Harveya2d24c92019-02-04 13:10:50 -0800117 GW5905,
Tim Harveyb7c48a92019-02-04 13:10:54 -0800118 GW5906,
Tim Harvey83cad802019-02-04 13:10:55 -0800119 GW5907,
Tim Harveyc2625402019-02-04 13:10:56 -0800120 GW5908,
Tim Harvey2df50462019-02-04 13:10:57 -0800121 GW5909,
Tim Harvey0dccde72014-06-02 16:13:25 -0700122 GW_UNKNOWN,
Tim Harvey0da2c522014-08-07 22:35:45 -0700123 GW_BADCRC,
124};
125
126/* config items */
127struct ventana_eeprom_config {
128 const char *name; /* name of item */
129 const char *dtalias; /* name of dt node to remove if not set */
130 int bit; /* bit within config */
Tim Harvey0dccde72014-06-02 16:13:25 -0700131};
132
Tim Harvey0da2c522014-08-07 22:35:45 -0700133extern struct ventana_eeprom_config econfig[];
134extern struct ventana_board_info ventana_info;
135
Tim Harvey0dccde72014-06-02 16:13:25 -0700136int read_eeprom(int bus, struct ventana_board_info *);
137
Tim Harvey552c3582014-03-06 07:46:30 -0800138#endif