aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2013-04-09 06:56:21 -0400
committerNicolas Ferre <nicolas.ferre@atmel.com>2013-04-09 08:26:56 -0400
commit13ab6aeb49663b0ca0f0eed3560fbaecacf4858f (patch)
tree8ae6851ef05db63a2a6657c48ef11929b5d43e1c /arch/arm/mach-at91
parent471c9e786596c4f028c67c7e9de0703b49cab2a9 (diff)
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: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/include/mach/cpu.h9
-rw-r--r--arch/arm/mach-at91/setup.c22
2 files changed, 21 insertions, 10 deletions
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index 0f3379fe645f..d3d7b993846b 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -86,7 +86,7 @@ enum at91_soc_type {
86 AT91_SOC_SAMA5D3, 86 AT91_SOC_SAMA5D3,
87 87
88 /* Unknown type */ 88 /* Unknown type */
89 AT91_SOC_NONE 89 AT91_SOC_UNKNOWN,
90}; 90};
91 91
92enum at91_soc_subtype { 92enum at91_soc_subtype {
@@ -107,8 +107,11 @@ enum at91_soc_subtype {
107 AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34, 107 AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34,
108 AT91_SOC_SAMA5D35, 108 AT91_SOC_SAMA5D35,
109 109
110 /* No subtype for this SoC */
111 AT91_SOC_SUBTYPE_NONE,
112
110 /* Unknown subtype */ 113 /* Unknown subtype */
111 AT91_SOC_SUBTYPE_NONE 114 AT91_SOC_SUBTYPE_UNKNOWN,
112}; 115};
113 116
114struct at91_socinfo { 117struct at91_socinfo {
@@ -122,7 +125,7 @@ const char *at91_get_soc_subtype(struct at91_socinfo *c);
122 125
123static inline int at91_soc_is_detected(void) 126static inline int at91_soc_is_detected(void)
124{ 127{
125 return at91_soc_initdata.type != AT91_SOC_NONE; 128 return at91_soc_initdata.type != AT91_SOC_UNKNOWN;
126} 129}
127 130
128#ifdef CONFIG_SOC_AT91RM9200 131#ifdef CONFIG_SOC_AT91RM9200
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 2ecd1693c804..fd00a09da86b 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -105,28 +105,32 @@ static void __init soc_detect(u32 dbgu_base)
105 switch (socid) { 105 switch (socid) {
106 case ARCH_ID_AT91RM9200: 106 case ARCH_ID_AT91RM9200:
107 at91_soc_initdata.type = AT91_SOC_RM9200; 107 at91_soc_initdata.type = AT91_SOC_RM9200;
108 if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_NONE) 108 if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
109 at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA; 109 at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
110 at91_boot_soc = at91rm9200_soc; 110 at91_boot_soc = at91rm9200_soc;
111 break; 111 break;
112 112
113 case ARCH_ID_AT91SAM9260: 113 case ARCH_ID_AT91SAM9260:
114 at91_soc_initdata.type = AT91_SOC_SAM9260; 114 at91_soc_initdata.type = AT91_SOC_SAM9260;
115 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
115 at91_boot_soc = at91sam9260_soc; 116 at91_boot_soc = at91sam9260_soc;
116 break; 117 break;
117 118
118 case ARCH_ID_AT91SAM9261: 119 case ARCH_ID_AT91SAM9261:
119 at91_soc_initdata.type = AT91_SOC_SAM9261; 120 at91_soc_initdata.type = AT91_SOC_SAM9261;
121 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
120 at91_boot_soc = at91sam9261_soc; 122 at91_boot_soc = at91sam9261_soc;
121 break; 123 break;
122 124
123 case ARCH_ID_AT91SAM9263: 125 case ARCH_ID_AT91SAM9263:
124 at91_soc_initdata.type = AT91_SOC_SAM9263; 126 at91_soc_initdata.type = AT91_SOC_SAM9263;
127 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
125 at91_boot_soc = at91sam9263_soc; 128 at91_boot_soc = at91sam9263_soc;
126 break; 129 break;
127 130
128 case ARCH_ID_AT91SAM9G20: 131 case ARCH_ID_AT91SAM9G20:
129 at91_soc_initdata.type = AT91_SOC_SAM9G20; 132 at91_soc_initdata.type = AT91_SOC_SAM9G20;
133 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
130 at91_boot_soc = at91sam9260_soc; 134 at91_boot_soc = at91sam9260_soc;
131 break; 135 break;
132 136
@@ -139,6 +143,7 @@ static void __init soc_detect(u32 dbgu_base)
139 143
140 case ARCH_ID_AT91SAM9RL64: 144 case ARCH_ID_AT91SAM9RL64:
141 at91_soc_initdata.type = AT91_SOC_SAM9RL; 145 at91_soc_initdata.type = AT91_SOC_SAM9RL;
146 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
142 at91_boot_soc = at91sam9rl_soc; 147 at91_boot_soc = at91sam9rl_soc;
143 break; 148 break;
144 149
@@ -161,6 +166,7 @@ static void __init soc_detect(u32 dbgu_base)
161 /* at91sam9g10 */ 166 /* at91sam9g10 */
162 if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { 167 if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
163 at91_soc_initdata.type = AT91_SOC_SAM9G10; 168 at91_soc_initdata.type = AT91_SOC_SAM9G10;
169 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
164 at91_boot_soc = at91sam9261_soc; 170 at91_boot_soc = at91sam9261_soc;
165 } 171 }
166 /* at91sam9xe */ 172 /* at91sam9xe */
@@ -242,7 +248,7 @@ static const char *soc_name[] = {
242 [AT91_SOC_SAM9X5] = "at91sam9x5", 248 [AT91_SOC_SAM9X5] = "at91sam9x5",
243 [AT91_SOC_SAM9N12] = "at91sam9n12", 249 [AT91_SOC_SAM9N12] = "at91sam9n12",
244 [AT91_SOC_SAMA5D3] = "sama5d3", 250 [AT91_SOC_SAMA5D3] = "sama5d3",
245 [AT91_SOC_NONE] = "Unknown" 251 [AT91_SOC_UNKNOWN] = "Unknown",
246}; 252};
247 253
248const char *at91_get_soc_type(struct at91_socinfo *c) 254const char *at91_get_soc_type(struct at91_socinfo *c)
@@ -268,7 +274,8 @@ static const char *soc_subtype_name[] = {
268 [AT91_SOC_SAMA5D33] = "sama5d33", 274 [AT91_SOC_SAMA5D33] = "sama5d33",
269 [AT91_SOC_SAMA5D34] = "sama5d34", 275 [AT91_SOC_SAMA5D34] = "sama5d34",
270 [AT91_SOC_SAMA5D35] = "sama5d35", 276 [AT91_SOC_SAMA5D35] = "sama5d35",
271 [AT91_SOC_SUBTYPE_NONE] = "Unknown" 277 [AT91_SOC_SUBTYPE_NONE] = "None",
278 [AT91_SOC_SUBTYPE_UNKNOWN] = "Unknown",
272}; 279};
273 280
274const char *at91_get_soc_subtype(struct at91_socinfo *c) 281const char *at91_get_soc_subtype(struct at91_socinfo *c)
@@ -282,8 +289,8 @@ void __init at91_map_io(void)
282 /* Map peripherals */ 289 /* Map peripherals */
283 iotable_init(&at91_io_desc, 1); 290 iotable_init(&at91_io_desc, 1);
284 291
285 at91_soc_initdata.type = AT91_SOC_NONE; 292 at91_soc_initdata.type = AT91_SOC_UNKNOWN;
286 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 293 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
287 294
288 soc_detect(AT91_BASE_DBGU0); 295 soc_detect(AT91_BASE_DBGU0);
289 if (!at91_soc_is_detected()) 296 if (!at91_soc_is_detected())
@@ -294,8 +301,9 @@ void __init at91_map_io(void)
294 301
295 pr_info("AT91: Detected soc type: %s\n", 302 pr_info("AT91: Detected soc type: %s\n",
296 at91_get_soc_type(&at91_soc_initdata)); 303 at91_get_soc_type(&at91_soc_initdata));
297 pr_info("AT91: Detected soc subtype: %s\n", 304 if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
298 at91_get_soc_subtype(&at91_soc_initdata)); 305 pr_info("AT91: Detected soc subtype: %s\n",
306 at91_get_soc_subtype(&at91_soc_initdata));
299 307
300 if (!at91_soc_is_enabled()) 308 if (!at91_soc_is_enabled())
301 panic("AT91: Soc not enabled"); 309 panic("AT91: Soc not enabled");