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