eeprom: starfive: Correct get_pcb_revision_from_eeprom()

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>
This commit is contained in:
Hal Feng 2025-10-24 16:59:27 +08:00 committed by Leo Yu-Chi Liang
parent 6015c98be5
commit 78253aeeec
2 changed files with 7 additions and 9 deletions

View File

@ -9,6 +9,11 @@
#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);
/**

View File

@ -535,19 +535,12 @@ int mac_read_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)