const void *fdt;
static char soc_name[16];
-static char rtl83xx_system_type[32];
+static char rtl83xx_system_type[48];
#ifdef CONFIG_MIPS_MT_SMP
return rtl83xx_system_type;
}
+static void __init rtl838x_read_details(uint32_t model)
+{
+ uint32_t chip_info, ext_version, tmp;
+
+ sw_w32(0x3, RTL838X_INT_RW_CTRL);
+ sw_w32(0xa << 28, RTL838X_CHIP_INFO);
+
+ chip_info = sw_r32(RTL838X_CHIP_INFO);
+ soc_info.cpu = chip_info & 0xffff;
+
+ ext_version = sw_r32(RTL838X_EXT_VERSION);
+ tmp = ext_version & 0x1f;
+
+ if (tmp == 2) {
+ soc_info.revision = 1;
+ } else {
+ tmp = (chip_info >> 16) & 0x1f;
+ if (soc_info.cpu == 0x0477) {
+ soc_info.revision = tmp;
+ soc_info.testchip = true;
+ } else {
+ soc_info.revision = tmp - 1;
+ }
+ }
+}
+
+static void __init rtl839x_read_details(uint32_t model)
+{
+ uint32_t chip_info;
+
+ sw_w32(0xa << 28, RTL839X_CHIP_INFO);
+
+ chip_info = sw_r32(RTL839X_CHIP_INFO);
+ soc_info.cpu = chip_info & 0xffff;
+
+ soc_info.revision = (model >> 1) & 0x1f;
+
+ if (!(model & 0x3e))
+ soc_info.testchip = true;
+}
+
+static void __init rtl93xx_read_details(uint32_t model)
+{
+ uint32_t chip_info;
+
+ sw_w32(0xa << 16, RTL93XX_CHIP_INFO);
+
+ chip_info = sw_r32(RTL93XX_CHIP_INFO);
+ soc_info.cpu = chip_info & 0xffff;
+
+ soc_info.revision = model & 0xf;
+
+ if (model & 0x30)
+ soc_info.testchip = true;
+}
+
static uint32_t __init read_model(void)
{
uint32_t model, id;
if ((id >= 0x8380 && id <= 0x8382) || id == 0x8330 || id == 0x8332) {
soc_info.id = id;
soc_info.family = RTL8380_FAMILY_ID;
+ rtl838x_read_details(model);
return model;
}
if ((id >= 0x8391 && id <= 0x8396) || (id >= 0x8351 && id <= 0x8353)) {
soc_info.id = id;
soc_info.family = RTL8390_FAMILY_ID;
+ rtl839x_read_details(model);
return model;
}
if (id >= 0x9301 && id <= 0x9303) {
soc_info.id = id;
soc_info.family = RTL9300_FAMILY_ID;
+ rtl93xx_read_details(model);
return model;
} else if (id >= 0x9311 && id <= 0x9313) {
soc_info.id = id;
soc_info.family = RTL9310_FAMILY_ID;
+ rtl93xx_read_details(model);
return model;
}
}
static void __init rtl83xx_set_system_type(void) {
+ char revision = '?';
+ char *es = "";
+
+ if (soc_info.revision >= 0 && soc_info.revision < 26)
+ revision = 'A' + soc_info.revision;
+
+ if (soc_info.testchip)
+ es = " ES";
+
snprintf(rtl83xx_system_type, sizeof(rtl83xx_system_type),
- "Realtek %s", soc_info.name);
+ "Realtek %s%s rev %c (%04X)",
+ soc_info.name, es, revision, soc_info.cpu);
}
void __init prom_init(void)