pcb_revision is stored in the pcb_revision field of ATOM4. Correct it.
Move the function description to the header file.
Return 0 instead of 0xFF if read_eeprom() fails.
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fixes: aea1bd95b61e ("eeprom: starfive: Enable ID EEPROM configuration")
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
#include <linux/types.h>
+/**
+ * get_pcb_revision_from_eeprom() - get the PCB revision
+ *
+ * @return: the PCB revision or 0 on error.
+ */
u8 get_pcb_revision_from_eeprom(void);
/**
return 0;
}
-/**
- * get_pcb_revision_from_eeprom - get the PCB revision
- *
- * 1.2A return 'A'/'a', 1.3B return 'B'/'b',other values are illegal
- */
u8 get_pcb_revision_from_eeprom(void)
{
- u8 pv = 0xFF;
-
if (read_eeprom())
- return pv;
+ return 0;
- return pbuf.eeprom.atom1.data.pstr[6];
+ return pbuf.eeprom.atom4.data.pcb_revision;
}
u8 get_ddr_size_from_eeprom(void)