rockchip: rk3308: Implement checkboard() to print SoC variant

Implement checkboard() to print current SoC variant used by a board,
e.g. one of:

  SoC:   RK3308
  SoC:   RK3308B
  SoC:   RK3308B-S

when U-Boot proper is running.

  U-Boot 2025.01-rc1 (Nov 02 2024 - 20:26:25 +0000)

  Model: Radxa ROCK Pi S
  SoC:   RK3308B
  DRAM:  512 MiB (effective 510 MiB)

Information about the SoC variant is read from GRF.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
This commit is contained in:
Jonas Karlman
2024-11-10 00:56:17 +00:00
committed by Tom Rini
parent 1c2ffcd5e6
commit 39389cfb3d

View File

@@ -216,3 +216,19 @@ int arch_cpu_init(void)
return 0;
}
#endif
#define RK3308_GRF_CHIP_ID 0xFF000800
int checkboard(void)
{
u32 chip_id = readl(RK3308_GRF_CHIP_ID);
if (chip_id == 0x3308)
printf("SoC: RK3308B\n");
else if (chip_id == 0x3308c)
printf("SoC: RK3308B-S\n");
else
printf("SoC: RK3308\n");
return 0;
}