aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel
diff options
context:
space:
mode:
authorMike Frysinger <michael.frysinger@analog.com>2007-07-24 23:19:14 -0400
committerBryan Wu <bryan.wu@analog.com>2007-07-24 23:19:14 -0400
commit1aafd9091226a02b481298315f959f777294684e (patch)
treeb09e0aaabb6aacd882499a69b28638cbd669dbba /arch/blackfin/kernel
parent287050fe13bf34824f03b4351002b0e2db4ee5cb (diff)
Blackfin arch: revise anomaly handling by basing things on the compiler not the kconfig defines
revise anomaly handling by basing things on the compiler not the kconfig defines, so the header is stable and usable outside of the kernel. This also allows us to move some code from preprocessing to compiling (gcc culls dead code) which should help with code quality (readability, catch minor bugs, etc...). Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c10
-rw-r--r--arch/blackfin/kernel/cplbinit.c4
-rw-r--r--arch/blackfin/kernel/setup.c20
3 files changed, 17 insertions, 17 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 5d488ef965ce..b818a8da1215 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -330,7 +330,7 @@ EXPORT_SYMBOL(set_gpio_ ## name);
330SET_GPIO_SC(maska) 330SET_GPIO_SC(maska)
331SET_GPIO_SC(maskb) 331SET_GPIO_SC(maskb)
332 332
333#if defined(ANOMALY_05000311) 333#if ANOMALY_05000311
334void set_gpio_data(unsigned short gpio, unsigned short arg) 334void set_gpio_data(unsigned short gpio, unsigned short arg)
335{ 335{
336 unsigned long flags; 336 unsigned long flags;
@@ -349,7 +349,7 @@ SET_GPIO_SC(data)
349#endif 349#endif
350 350
351 351
352#if defined(ANOMALY_05000311) 352#if ANOMALY_05000311
353void set_gpio_toggle(unsigned short gpio) 353void set_gpio_toggle(unsigned short gpio)
354{ 354{
355 unsigned long flags; 355 unsigned long flags;
@@ -387,7 +387,7 @@ SET_GPIO_P(maska)
387SET_GPIO_P(maskb) 387SET_GPIO_P(maskb)
388 388
389 389
390#if defined(ANOMALY_05000311) 390#if ANOMALY_05000311
391void set_gpiop_data(unsigned short gpio, unsigned short arg) 391void set_gpiop_data(unsigned short gpio, unsigned short arg)
392{ 392{
393 unsigned long flags; 393 unsigned long flags;
@@ -421,7 +421,7 @@ GET_GPIO(maska)
421GET_GPIO(maskb) 421GET_GPIO(maskb)
422 422
423 423
424#if defined(ANOMALY_05000311) 424#if ANOMALY_05000311
425unsigned short get_gpio_data(unsigned short gpio) 425unsigned short get_gpio_data(unsigned short gpio)
426{ 426{
427 unsigned long flags; 427 unsigned long flags;
@@ -455,7 +455,7 @@ GET_GPIO_P(both)
455GET_GPIO_P(maska) 455GET_GPIO_P(maska)
456GET_GPIO_P(maskb) 456GET_GPIO_P(maskb)
457 457
458#if defined(ANOMALY_05000311) 458#if ANOMALY_05000311
459unsigned short get_gpiop_data(unsigned short gpio) 459unsigned short get_gpiop_data(unsigned short gpio)
460{ 460{
461 unsigned long flags; 461 unsigned long flags;
diff --git a/arch/blackfin/kernel/cplbinit.c b/arch/blackfin/kernel/cplbinit.c
index bbdb403fcb55..3b1c87c9fd51 100644
--- a/arch/blackfin/kernel/cplbinit.c
+++ b/arch/blackfin/kernel/cplbinit.c
@@ -230,8 +230,8 @@ static void __fill_code_cplbtab(struct cplb_tab *t, int i, u32 a_start, u32 a_en
230 cplb_data[i].psize, 230 cplb_data[i].psize,
231 cplb_data[i].i_conf); 231 cplb_data[i].i_conf);
232 } else { 232 } else {
233#if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263)) 233#if defined(CONFIG_BLKFIN_CACHE)
234 if (i == SDRAM_KERN) { 234 if (ANOMALY_05000263 && i == SDRAM_KERN) {
235 fill_cplbtab(t, 235 fill_cplbtab(t,
236 cplb_data[i].start, 236 cplb_data[i].start,
237 cplb_data[i].end, 237 cplb_data[i].end,
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 88f221b89b33..02c15272f8ef 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -179,14 +179,16 @@ void __init setup_arch(char **cmdline_p)
179 cclk = get_cclk(); 179 cclk = get_cclk();
180 sclk = get_sclk(); 180 sclk = get_sclk();
181 181
182#if !defined(CONFIG_BFIN_KERNEL_CLOCK) && defined(ANOMALY_05000273) 182#if !defined(CONFIG_BFIN_KERNEL_CLOCK)
183 if (cclk == sclk) 183 if (ANOMALY_05000273 && cclk == sclk)
184 panic("ANOMALY 05000273, SCLK can not be same as CCLK"); 184 panic("ANOMALY 05000273, SCLK can not be same as CCLK");
185#endif 185#endif
186 186
187#if defined(ANOMALY_05000266) 187#ifdef BF561_FAMILY
188 bfin_read_IMDMA_D0_IRQ_STATUS(); 188 if (ANOMALY_05000266) {
189 bfin_read_IMDMA_D1_IRQ_STATUS(); 189 bfin_read_IMDMA_D0_IRQ_STATUS();
190 bfin_read_IMDMA_D1_IRQ_STATUS();
191 }
190#endif 192#endif
191 193
192#ifdef DEBUG_SERIAL_EARLY_INIT 194#ifdef DEBUG_SERIAL_EARLY_INIT
@@ -260,7 +262,7 @@ void __init setup_arch(char **cmdline_p)
260 && ((unsigned long *)mtd_phys)[1] == ROMSB_WORD1) 262 && ((unsigned long *)mtd_phys)[1] == ROMSB_WORD1)
261 mtd_size = 263 mtd_size =
262 PAGE_ALIGN(be32_to_cpu(((unsigned long *)mtd_phys)[2])); 264 PAGE_ALIGN(be32_to_cpu(((unsigned long *)mtd_phys)[2]));
263# if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263)) 265# if (defined(CONFIG_BLKFIN_CACHE) && ANOMALY_05000263)
264 /* Due to a Hardware Anomaly we need to limit the size of usable 266 /* Due to a Hardware Anomaly we need to limit the size of usable
265 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on 267 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on
266 * 05000263 - Hardware loop corrupted when taking an ICPLB exception 268 * 05000263 - Hardware loop corrupted when taking an ICPLB exception
@@ -289,7 +291,7 @@ void __init setup_arch(char **cmdline_p)
289 _ebss = memory_mtd_start; /* define _ebss for compatible */ 291 _ebss = memory_mtd_start; /* define _ebss for compatible */
290#endif /* CONFIG_MTD_UCLINUX */ 292#endif /* CONFIG_MTD_UCLINUX */
291 293
292#if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263)) 294#if (defined(CONFIG_BLKFIN_CACHE) && ANOMALY_05000263)
293 /* Due to a Hardware Anomaly we need to limit the size of usable 295 /* Due to a Hardware Anomaly we need to limit the size of usable
294 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on 296 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on
295 * 05000263 - Hardware loop corrupted when taking an ICPLB exception 297 * 05000263 - Hardware loop corrupted when taking an ICPLB exception
@@ -337,10 +339,8 @@ void __init setup_arch(char **cmdline_p)
337 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu Mhz System Clock\n", 339 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu Mhz System Clock\n",
338 cclk / 1000000, sclk / 1000000); 340 cclk / 1000000, sclk / 1000000);
339 341
340#if defined(ANOMALY_05000273) 342 if (ANOMALY_05000273 && (cclk >> 1) <= sclk)
341 if ((cclk >> 1) <= sclk)
342 printk("\n\n\nANOMALY_05000273: CCLK must be >= 2*SCLK !!!\n\n\n"); 343 printk("\n\n\nANOMALY_05000273: CCLK must be >= 2*SCLK !!!\n\n\n");
343#endif
344 344
345 printk(KERN_INFO "Board Memory: %ldMB\n", physical_mem_end >> 20); 345 printk(KERN_INFO "Board Memory: %ldMB\n", physical_mem_end >> 20);
346 printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20); 346 printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20);