Angel Pons | 8a3453f | 2020-04-02 23:48:19 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Werner Zeh | 63693dc | 2015-02-13 12:18:58 +0100 | [diff] [blame] | 2 | |
| 3 | #ifndef _INTEL_I210_H_ |
| 4 | #define _INTEL_I210_H_ |
| 5 | |
Werner Zeh | e22d96c | 2016-06-29 07:53:47 +0200 | [diff] [blame] | 6 | #include <types.h> |
| 7 | #include <device/device.h> |
| 8 | |
Werner Zeh | 63693dc | 2015-02-13 12:18:58 +0100 | [diff] [blame] | 9 | #define I210_PCI_MEM_BAR_OFFSET 0x10 |
| 10 | #define I210_REG_EECTRL 0x12010 /* Offset for EEPROM control reg */ |
| 11 | #define I210_FLUPD 0x800000 /* Start flash update bit */ |
| 12 | #define I210_FLUDONE 0x4000000 /* Flash update done indicator */ |
| 13 | #define I210_REG_EEREAD 0x12014 /* Offset for EEPROM read reg */ |
| 14 | #define I210_REG_EEWRITE 0x12018 /* Offset for EEPROM write reg */ |
| 15 | #define I210_CMDV 0x01 /* command valid bit */ |
| 16 | #define I210_DONE 0x02 /* command done bit */ |
| 17 | #define I210_TARGET_CHECKSUM 0xBABA /* resulting checksum */ |
| 18 | |
Werner Zeh | 63693dc | 2015-02-13 12:18:58 +0100 | [diff] [blame] | 19 | /*define some other useful values here */ |
| 20 | #define I210_POLL_TIMEOUT_US 300000 /* 300 ms */ |
| 21 | /*Define some error states here*/ |
| 22 | #define I210_SUCCESS 0x00000000 |
| 23 | #define I210_INVALID_PARAM 0x00000001 |
| 24 | #define I210_NOT_READY 0x00000002 |
| 25 | #define I210_READ_ERROR 0x00000004 |
| 26 | #define I210_WRITE_ERROR 0x00000008 |
| 27 | #define I210_CHECKSUM_ERROR 0x00000010 |
| 28 | #define I210_FLASH_UPDATE_ERROR 0x00000020 |
| 29 | |
Angel Pons | c19a9a5 | 2020-11-10 17:08:11 +0100 | [diff] [blame^] | 30 | #define MAC_ADDR_LEN 6 |
| 31 | |
Werner Zeh | e22d96c | 2016-06-29 07:53:47 +0200 | [diff] [blame] | 32 | /* We need one function we can call to get a MAC address to use */ |
| 33 | /* This function can be coded somewhere else but must exist. */ |
Angel Pons | c19a9a5 | 2020-11-10 17:08:11 +0100 | [diff] [blame^] | 34 | extern enum cb_err mainboard_get_mac_address(struct device *dev, uint8_t mac[MAC_ADDR_LEN]); |
Werner Zeh | e22d96c | 2016-06-29 07:53:47 +0200 | [diff] [blame] | 35 | |
Werner Zeh | 63693dc | 2015-02-13 12:18:58 +0100 | [diff] [blame] | 36 | #endif /* _INTEL_I210_H_ */ |