Tim Harvey | d4daeaa | 2022-04-13 08:56:40 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright 2021 Gateworks Corporation |
| 4 | */ |
| 5 | |
| 6 | #ifndef _VENICE_EEPROM_H_ |
| 7 | #define _VENICE_EEPROM_H_ |
| 8 | |
| 9 | struct venice_board_info { |
| 10 | u8 mac[6]; /* 0x00: MAC base */ |
| 11 | char equiv_dts[16]; /* 0x06: equivalent device-tree */ |
| 12 | u8 res0[2]; /* 0x16: reserved */ |
| 13 | u32 serial; /* 0x18: Serial Number */ |
| 14 | u8 res1[4]; /* 0x1C: reserved */ |
| 15 | u8 mfgdate[4]; /* 0x20: MFG date */ |
| 16 | u8 macno; /* 0x24: number of mac addrs */ |
| 17 | u8 res2[6]; /* 0x25 */ |
| 18 | u8 sdram_size; /* 0x2B: (16 << n) MB */ |
| 19 | u8 sdram_speed; /* 0x2C: (33.333 * n) MHz */ |
| 20 | u8 sdram_width; /* 0x2D: (8 << n) bit */ |
| 21 | u8 res3[2]; /* 0x2E */ |
| 22 | char model[16]; /* 0x30: model string */ |
| 23 | u8 res4[14]; /* 0x40 */ |
| 24 | u8 chksum[2]; /* 0x4E */ |
| 25 | }; |
| 26 | |
Tim Harvey | 1fec182 | 2022-08-11 12:04:01 -0700 | [diff] [blame] | 27 | int venice_eeprom_init(int quiet); |
Tim Harvey | d4daeaa | 2022-04-13 08:56:40 -0700 | [diff] [blame] | 28 | const char *eeprom_get_model(void); |
Tim Harvey | a6614bb | 2022-08-11 11:55:38 -0700 | [diff] [blame] | 29 | const char *eeprom_get_baseboard_model(void); |
Tim Harvey | d4daeaa | 2022-04-13 08:56:40 -0700 | [diff] [blame] | 30 | const char *eeprom_get_dtb_name(int level, char *buf, int len); |
| 31 | int eeprom_getmac(int index, uint8_t *enetaddr); |
| 32 | uint32_t eeprom_get_serial(void); |
Tim Harvey | a6614bb | 2022-08-11 11:55:38 -0700 | [diff] [blame] | 33 | int get_bom_rev(const char *str); |
| 34 | char get_pcb_rev(const char *str); |
Tim Harvey | d4daeaa | 2022-04-13 08:56:40 -0700 | [diff] [blame] | 35 | |
| 36 | #endif |