[PATCH 8/6] net/e1000: log flash/invm status at probe time

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Thu Nov 23 03:12:34 PST 2017


Provide some info about flash/eeprom state at boot up

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
 drivers/net/e1000/eeprom.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c
index e5f8c9e271e0..cb92deee3b44 100644
--- a/drivers/net/e1000/eeprom.c
+++ b/drivers/net/e1000/eeprom.c
@@ -1472,6 +1472,24 @@ int e1000_register_eeprom(struct e1000_hw *hw)
 		if (ret < 0)
 			return ret;
 
+		if (eecd & E1000_EECD_AUTO_RD) {
+			if (eecd & E1000_EECD_EE_PRES) {
+				if (eecd & E1000_EECD_FLASH_IN_USE)
+					dev_info(hw->dev, "Hardware programmed from flash\n");
+				else
+					dev_info(hw->dev, "Hardware programmed from iNVM\n");
+			} else {
+				dev_warn(hw->dev, "Shadow RAM invalid\n");
+			}
+		} else {
+			/*
+			 * I never saw this case in practise and I'm unsure how
+			 * to handle that. Maybe just wait until the hardware is
+			 * up enough that this bit is set?
+			 */
+			dev_err(hw->dev, "Flash Auto-Read not done\n");
+		}
+
 		if (eecd & E1000_EECD_I210_FLASH_DETECTED) {
 			hw->mtd.parent = hw->dev;
 			hw->mtd.read = e1000_mtd_read;
-- 
2.11.0




More information about the barebox mailing list