Commit 13ab6aeb authored by Nicolas Ferre's avatar Nicolas Ferre

ARM: at91: change "Unknown" qualifier SoC subtype handling

An AT91 SoC that doesn't have a subtype is shown as "Unknown"
in the Linux log message which is not correct.
This was leading to confusion so, add a "none" qualifier to
the subtype property and set this one in the appropriate cases.
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
parent 471c9e78
...@@ -86,7 +86,7 @@ enum at91_soc_type { ...@@ -86,7 +86,7 @@ enum at91_soc_type {
AT91_SOC_SAMA5D3, AT91_SOC_SAMA5D3,
/* Unknown type */ /* Unknown type */
AT91_SOC_NONE AT91_SOC_UNKNOWN,
}; };
enum at91_soc_subtype { enum at91_soc_subtype {
...@@ -107,8 +107,11 @@ enum at91_soc_subtype { ...@@ -107,8 +107,11 @@ enum at91_soc_subtype {
AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34, AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34,
AT91_SOC_SAMA5D35, AT91_SOC_SAMA5D35,
/* No subtype for this SoC */
AT91_SOC_SUBTYPE_NONE,
/* Unknown subtype */ /* Unknown subtype */
AT91_SOC_SUBTYPE_NONE AT91_SOC_SUBTYPE_UNKNOWN,
}; };
struct at91_socinfo { struct at91_socinfo {
...@@ -122,7 +125,7 @@ const char *at91_get_soc_subtype(struct at91_socinfo *c); ...@@ -122,7 +125,7 @@ const char *at91_get_soc_subtype(struct at91_socinfo *c);
static inline int at91_soc_is_detected(void) static inline int at91_soc_is_detected(void)
{ {
return at91_soc_initdata.type != AT91_SOC_NONE; return at91_soc_initdata.type != AT91_SOC_UNKNOWN;
} }
#ifdef CONFIG_SOC_AT91RM9200 #ifdef CONFIG_SOC_AT91RM9200
......
...@@ -105,28 +105,32 @@ static void __init soc_detect(u32 dbgu_base) ...@@ -105,28 +105,32 @@ static void __init soc_detect(u32 dbgu_base)
switch (socid) { switch (socid) {
case ARCH_ID_AT91RM9200: case ARCH_ID_AT91RM9200:
at91_soc_initdata.type = AT91_SOC_RM9200; at91_soc_initdata.type = AT91_SOC_RM9200;
if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_NONE) if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA; at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
at91_boot_soc = at91rm9200_soc; at91_boot_soc = at91rm9200_soc;
break; break;
case ARCH_ID_AT91SAM9260: case ARCH_ID_AT91SAM9260:
at91_soc_initdata.type = AT91_SOC_SAM9260; at91_soc_initdata.type = AT91_SOC_SAM9260;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
at91_boot_soc = at91sam9260_soc; at91_boot_soc = at91sam9260_soc;
break; break;
case ARCH_ID_AT91SAM9261: case ARCH_ID_AT91SAM9261:
at91_soc_initdata.type = AT91_SOC_SAM9261; at91_soc_initdata.type = AT91_SOC_SAM9261;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
at91_boot_soc = at91sam9261_soc; at91_boot_soc = at91sam9261_soc;
break; break;
case ARCH_ID_AT91SAM9263: case ARCH_ID_AT91SAM9263:
at91_soc_initdata.type = AT91_SOC_SAM9263; at91_soc_initdata.type = AT91_SOC_SAM9263;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
at91_boot_soc = at91sam9263_soc; at91_boot_soc = at91sam9263_soc;
break; break;
case ARCH_ID_AT91SAM9G20: case ARCH_ID_AT91SAM9G20:
at91_soc_initdata.type = AT91_SOC_SAM9G20; at91_soc_initdata.type = AT91_SOC_SAM9G20;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
at91_boot_soc = at91sam9260_soc; at91_boot_soc = at91sam9260_soc;
break; break;
...@@ -139,6 +143,7 @@ static void __init soc_detect(u32 dbgu_base) ...@@ -139,6 +143,7 @@ static void __init soc_detect(u32 dbgu_base)
case ARCH_ID_AT91SAM9RL64: case ARCH_ID_AT91SAM9RL64:
at91_soc_initdata.type = AT91_SOC_SAM9RL; at91_soc_initdata.type = AT91_SOC_SAM9RL;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
at91_boot_soc = at91sam9rl_soc; at91_boot_soc = at91sam9rl_soc;
break; break;
...@@ -161,6 +166,7 @@ static void __init soc_detect(u32 dbgu_base) ...@@ -161,6 +166,7 @@ static void __init soc_detect(u32 dbgu_base)
/* at91sam9g10 */ /* at91sam9g10 */
if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
at91_soc_initdata.type = AT91_SOC_SAM9G10; at91_soc_initdata.type = AT91_SOC_SAM9G10;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
at91_boot_soc = at91sam9261_soc; at91_boot_soc = at91sam9261_soc;
} }
/* at91sam9xe */ /* at91sam9xe */
...@@ -242,7 +248,7 @@ static const char *soc_name[] = { ...@@ -242,7 +248,7 @@ static const char *soc_name[] = {
[AT91_SOC_SAM9X5] = "at91sam9x5", [AT91_SOC_SAM9X5] = "at91sam9x5",
[AT91_SOC_SAM9N12] = "at91sam9n12", [AT91_SOC_SAM9N12] = "at91sam9n12",
[AT91_SOC_SAMA5D3] = "sama5d3", [AT91_SOC_SAMA5D3] = "sama5d3",
[AT91_SOC_NONE] = "Unknown" [AT91_SOC_UNKNOWN] = "Unknown",
}; };
const char *at91_get_soc_type(struct at91_socinfo *c) const char *at91_get_soc_type(struct at91_socinfo *c)
...@@ -268,7 +274,8 @@ static const char *soc_subtype_name[] = { ...@@ -268,7 +274,8 @@ static const char *soc_subtype_name[] = {
[AT91_SOC_SAMA5D33] = "sama5d33", [AT91_SOC_SAMA5D33] = "sama5d33",
[AT91_SOC_SAMA5D34] = "sama5d34", [AT91_SOC_SAMA5D34] = "sama5d34",
[AT91_SOC_SAMA5D35] = "sama5d35", [AT91_SOC_SAMA5D35] = "sama5d35",
[AT91_SOC_SUBTYPE_NONE] = "Unknown" [AT91_SOC_SUBTYPE_NONE] = "None",
[AT91_SOC_SUBTYPE_UNKNOWN] = "Unknown",
}; };
const char *at91_get_soc_subtype(struct at91_socinfo *c) const char *at91_get_soc_subtype(struct at91_socinfo *c)
...@@ -282,8 +289,8 @@ void __init at91_map_io(void) ...@@ -282,8 +289,8 @@ void __init at91_map_io(void)
/* Map peripherals */ /* Map peripherals */
iotable_init(&at91_io_desc, 1); iotable_init(&at91_io_desc, 1);
at91_soc_initdata.type = AT91_SOC_NONE; at91_soc_initdata.type = AT91_SOC_UNKNOWN;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
soc_detect(AT91_BASE_DBGU0); soc_detect(AT91_BASE_DBGU0);
if (!at91_soc_is_detected()) if (!at91_soc_is_detected())
...@@ -294,8 +301,9 @@ void __init at91_map_io(void) ...@@ -294,8 +301,9 @@ void __init at91_map_io(void)
pr_info("AT91: Detected soc type: %s\n", pr_info("AT91: Detected soc type: %s\n",
at91_get_soc_type(&at91_soc_initdata)); at91_get_soc_type(&at91_soc_initdata));
pr_info("AT91: Detected soc subtype: %s\n", if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
at91_get_soc_subtype(&at91_soc_initdata)); pr_info("AT91: Detected soc subtype: %s\n",
at91_get_soc_subtype(&at91_soc_initdata));
if (!at91_soc_is_enabled()) if (!at91_soc_is_enabled())
panic("AT91: Soc not enabled"); panic("AT91: Soc not enabled");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment