diff options
| author | Hal Feng <[email protected]> | 2025-10-24 16:59:27 +0800 |
|---|---|---|
| committer | Leo Yu-Chi Liang <[email protected]> | 2026-03-17 01:36:57 +0800 |
| commit | 78253aeeecdfea4c71779905ff2b400fa7400b1c (patch) | |
| tree | 60c02a55e2ccf0f4b97f0381a315cbe18e1bfe81 | |
| parent | 6015c98be50f2fc571c294d2f2b0768212fb7e99 (diff) | |
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 <[email protected]>
Fixes: aea1bd95b61e ("eeprom: starfive: Enable ID EEPROM configuration")
Signed-off-by: Hal Feng <[email protected]>
| -rw-r--r-- | arch/riscv/include/asm/arch-jh7110/eeprom.h | 5 | ||||
| -rw-r--r-- | board/starfive/visionfive2/visionfive2-i2c-eeprom.c | 11 |
2 files changed, 7 insertions, 9 deletions
diff --git a/arch/riscv/include/asm/arch-jh7110/eeprom.h b/arch/riscv/include/asm/arch-jh7110/eeprom.h index 1ae9f2b840a..8b689a75013 100644 --- a/arch/riscv/include/asm/arch-jh7110/eeprom.h +++ b/arch/riscv/include/asm/arch-jh7110/eeprom.h @@ -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); /** diff --git a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c index ca5039ee433..986dcc94992 100644 --- a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c +++ b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c @@ -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) |
