blob: 27b02117bb89b1f0a2231c60be90d18edfcd310f [file] [log] [blame]
Tim Harvey03bf8432021-03-02 14:00:21 -08001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright 2021 Gateworks Corporation
4 */
5
6#ifndef _GSC_H_
7#define _GSC_H_
8
9/* I2C slave addresses */
10#define GSC_SC_ADDR 0x20
11#define GSC_RTC_ADDR 0x68
12#define GSC_HWMON_ADDR 0x29
13#define GSC_EEPROM_ADDR 0x51
14
15struct venice_board_info {
16 u8 mac[6]; /* 0x00: MAC base */
17 char equiv_dts[16]; /* 0x06: equivalent device-tree */
18 u8 res0[2]; /* 0x16: reserved */
19 u32 serial; /* 0x18: Serial Number */
20 u8 res1[4]; /* 0x1C: reserved */
21 u8 mfgdate[4]; /* 0x20: MFG date */
22 u8 macno; /* 0x24: number of mac addrs */
23 u8 res2[6]; /* 0x25 */
24 u8 sdram_size; /* 0x2B: (16 << n) MB */
25 u8 sdram_speed; /* 0x2C: (33.333 * n) MHz */
26 u8 sdram_width; /* 0x2D: (8 << n) bit */
27 u8 res3[2]; /* 0x2E */
28 char model[16]; /* 0x30: model string */
29 u8 res4[14]; /* 0x40 */
30 u8 chksum[2]; /* 0x4E */
31};
32
33int gsc_init(int quiet);
34int gsc_hwmon(void);
35const char *gsc_get_model(void);
36const char *gsc_get_dtb_name(int level, char *buf, int len);
37int gsc_getmac(int index, uint8_t *enetaddr);
38
39#endif