From c350af5c23326d408047966fae453fa709bf2be4 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 22 Jun 2025 03:21:15 -0400 Subject: kernel: e1000: Read MAC address into `netif' This commit implements EEPROM reading logic as well as some code to read the ethernet address into a `netif' structure. Signed-off-by: Ian Moffett --- sys/include/dev/phy/e1000regs.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'sys/include/dev/phy/e1000regs.h') diff --git a/sys/include/dev/phy/e1000regs.h b/sys/include/dev/phy/e1000regs.h index 907996d..7caceee 100644 --- a/sys/include/dev/phy/e1000regs.h +++ b/sys/include/dev/phy/e1000regs.h @@ -100,4 +100,20 @@ #define E1000_EECD_SIZE BIT(9) /* EEPROM size (1024-bit [0], 4096-bit [1]) */ #define E1000_EECD_TYPE BIT(13) /* EEPROM type (microwire [0], SPI [1]) */ +/* + * EEPROM read (`eerd') register bits + * + * See section 13.4.4 of the PCI/PCI-X Intel Gigabit + * Ethernet controller spec + */ +#define E1000_EERD_START BIT(0) /* Start read */ +#define E1000_EERD_DONE BIT(4) /* EEPROM read finished */ + +/* + * EEPROM word addresses + */ +#define E1000_HWADDR0 0x00 /* Word 0 */ +#define E1000_HWADDR1 0x01 /* Word 1 */ +#define E1000_HWADDR2 0x02 /* Word 2 */ + #endif /* !_PHY_E1000_REGS_H_ */ -- cgit v1.2.3