Commit 1aafd909 authored by Mike Frysinger's avatar Mike Frysinger Committed by Bryan Wu
Browse files

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: default avatarMike Frysinger <michael.frysinger@analog.com>
Signed-off-by: default avatarBryan Wu <bryan.wu@analog.com>
parent 287050fe
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -330,7 +330,7 @@ EXPORT_SYMBOL(set_gpio_ ## name);
SET_GPIO_SC(maska)
SET_GPIO_SC(maskb)

#if defined(ANOMALY_05000311)
#if ANOMALY_05000311
void set_gpio_data(unsigned short gpio, unsigned short arg)
{
	unsigned long flags;
@@ -349,7 +349,7 @@ SET_GPIO_SC(data)
#endif


#if defined(ANOMALY_05000311)
#if ANOMALY_05000311
void set_gpio_toggle(unsigned short gpio)
{
	unsigned long flags;
@@ -387,7 +387,7 @@ SET_GPIO_P(maska)
SET_GPIO_P(maskb)


#if defined(ANOMALY_05000311)
#if ANOMALY_05000311
void set_gpiop_data(unsigned short gpio, unsigned short arg)
{
	unsigned long flags;
@@ -421,7 +421,7 @@ GET_GPIO(maska)
GET_GPIO(maskb)


#if defined(ANOMALY_05000311)
#if ANOMALY_05000311
unsigned short get_gpio_data(unsigned short gpio)
{
	unsigned long flags;
@@ -455,7 +455,7 @@ GET_GPIO_P(both)
GET_GPIO_P(maska)
GET_GPIO_P(maskb)

#if defined(ANOMALY_05000311)
#if ANOMALY_05000311
unsigned short get_gpiop_data(unsigned short gpio)
{
	unsigned long flags;
+2 −2
Original line number Diff line number Diff line
@@ -230,8 +230,8 @@ static void __fill_code_cplbtab(struct cplb_tab *t, int i, u32 a_start, u32 a_en
				cplb_data[i].psize,
				cplb_data[i].i_conf);
	} else {
#if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263))
		if (i == SDRAM_KERN) {
#if defined(CONFIG_BLKFIN_CACHE)
		if (ANOMALY_05000263 && i == SDRAM_KERN) {
			fill_cplbtab(t,
					cplb_data[i].start,
					cplb_data[i].end,
+10 −10
Original line number Diff line number Diff line
@@ -179,14 +179,16 @@ void __init setup_arch(char **cmdline_p)
	cclk = get_cclk();
	sclk = get_sclk();

#if !defined(CONFIG_BFIN_KERNEL_CLOCK) && defined(ANOMALY_05000273)
	if (cclk == sclk)
#if !defined(CONFIG_BFIN_KERNEL_CLOCK)
	if (ANOMALY_05000273 && cclk == sclk)
		panic("ANOMALY 05000273, SCLK can not be same as CCLK");
#endif

#if defined(ANOMALY_05000266)
#ifdef BF561_FAMILY
	if (ANOMALY_05000266) {
		bfin_read_IMDMA_D0_IRQ_STATUS();
		bfin_read_IMDMA_D1_IRQ_STATUS();
	}
#endif

#ifdef DEBUG_SERIAL_EARLY_INIT
@@ -260,7 +262,7 @@ void __init setup_arch(char **cmdline_p)
	    && ((unsigned long *)mtd_phys)[1] == ROMSB_WORD1)
		mtd_size =
		    PAGE_ALIGN(be32_to_cpu(((unsigned long *)mtd_phys)[2]));
#  if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263))
#  if (defined(CONFIG_BLKFIN_CACHE) && ANOMALY_05000263)
	/* Due to a Hardware Anomaly we need to limit the size of usable
	 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on
	 * 05000263 - Hardware loop corrupted when taking an ICPLB exception
@@ -289,7 +291,7 @@ void __init setup_arch(char **cmdline_p)
	_ebss = memory_mtd_start;	/* define _ebss for compatible */
#endif				/* CONFIG_MTD_UCLINUX */

#if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263))
#if (defined(CONFIG_BLKFIN_CACHE) && ANOMALY_05000263)
	/* Due to a Hardware Anomaly we need to limit the size of usable
	 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on
	 * 05000263 - Hardware loop corrupted when taking an ICPLB exception
@@ -337,10 +339,8 @@ void __init setup_arch(char **cmdline_p)
	printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu Mhz System Clock\n",
	       cclk / 1000000,  sclk / 1000000);

#if defined(ANOMALY_05000273)
	if ((cclk >> 1) <= sclk)
	if (ANOMALY_05000273 && (cclk >> 1) <= sclk)
		printk("\n\n\nANOMALY_05000273: CCLK must be >= 2*SCLK !!!\n\n\n");
#endif

	printk(KERN_INFO "Board Memory: %ldMB\n", physical_mem_end >> 20);
	printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20);
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ ENTRY(_memcmp)

	LSETUP (.Lquad_loop_s, .Lquad_loop_e) LC0=P1;
.Lquad_loop_s:
#ifdef ANOMALY_05000202
#if ANOMALY_05000202
	R0 = [P0++];
	R1 = [I0++];
#else
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ ENTRY(_memcpy)
	R0 = R1;
	I1 = P1;
	R3 = [I1++];
#ifdef ANOMALY_05000202
#if ANOMALY_05000202
.Lword_loops:
	[P0++] = R3;
.Lword_loope:
Loading