From dc26aec25d1a4e2690df166dbe843344728994ce Mon Sep 17 00:00:00 2001 From: Michael Hennerich Date: Tue, 18 Nov 2008 17:48:22 +0800 Subject: Blackfin arch: BF538/9 Linux kernel Support Add supporing for Blackfin BF538 and BF539 processors. Signed-off-by: Michael Hennerich Signed-off-by: Bryan Wu --- arch/blackfin/mach-bf538/include/mach/mem_map.h | 107 ++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 arch/blackfin/mach-bf538/include/mach/mem_map.h (limited to 'arch/blackfin/mach-bf538/include/mach/mem_map.h') diff --git a/arch/blackfin/mach-bf538/include/mach/mem_map.h b/arch/blackfin/mach-bf538/include/mach/mem_map.h new file mode 100644 index 00000000000..d65d4301615 --- /dev/null +++ b/arch/blackfin/mach-bf538/include/mach/mem_map.h @@ -0,0 +1,107 @@ +/* + * File: include/asm-blackfin/mach-bf538/mem_map.h + * Based on: + * Author: + * + * Created: + * Description: + * + * Rev: + * + * Modified: + * + * Bugs: Enter bugs at http://blackfin.uclinux.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. + * If not, write to the Free Software Foundation, + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _MEM_MAP_538_H_ +#define _MEM_MAP_538_H_ + +#define COREMMR_BASE 0xFFE00000 /* Core MMRs */ +#define SYSMMR_BASE 0xFFC00000 /* System MMRs */ + +/* Async Memory Banks */ +#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */ +#define ASYNC_BANK3_SIZE 0x00100000 /* 1M */ +#define ASYNC_BANK2_BASE 0x20200000 /* Async Bank 2 */ +#define ASYNC_BANK2_SIZE 0x00100000 /* 1M */ +#define ASYNC_BANK1_BASE 0x20100000 /* Async Bank 1 */ +#define ASYNC_BANK1_SIZE 0x00100000 /* 1M */ +#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */ +#define ASYNC_BANK0_SIZE 0x00100000 /* 1M */ + +/* Boot ROM Memory */ + +#define BOOT_ROM_START 0xEF000000 +#define BOOT_ROM_LENGTH 0x400 + +/* Level 1 Memory */ + +#ifdef CONFIG_BFIN_ICACHE +#define BFIN_ICACHESIZE (16*1024) +#else +#define BFIN_ICACHESIZE (0*1024) +#endif + +/* Memory Map for ADSP-BF538/9 processors */ + +#define L1_CODE_START 0xFFA00000 +#define L1_DATA_A_START 0xFF800000 +#define L1_DATA_B_START 0xFF900000 + +#ifdef CONFIG_BFIN_ICACHE +#define L1_CODE_LENGTH (0x14000 - 0x4000) +#else +#define L1_CODE_LENGTH 0x14000 +#endif + +#ifdef CONFIG_BFIN_DCACHE + +#ifdef CONFIG_BFIN_DCACHE_BANKA +#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0) +#define L1_DATA_A_LENGTH (0x8000 - 0x4000) +#define L1_DATA_B_LENGTH 0x8000 +#define BFIN_DCACHESIZE (16*1024) +#define BFIN_DSUPBANKS 1 +#else +#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0) +#define L1_DATA_A_LENGTH (0x8000 - 0x4000) +#define L1_DATA_B_LENGTH (0x8000 - 0x4000) +#define BFIN_DCACHESIZE (32*1024) +#define BFIN_DSUPBANKS 2 +#endif + +#else +#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0) +#define L1_DATA_A_LENGTH 0x8000 +#define L1_DATA_B_LENGTH 0x8000 +#define BFIN_DCACHESIZE (0*1024) +#define BFIN_DSUPBANKS 0 +#endif /*CONFIG_BFIN_DCACHE*/ + + +/* Level 2 Memory - none */ + +#define L2_START 0 +#define L2_LENGTH 0 + +/* Scratch Pad Memory */ + +#define L1_SCRATCH_START 0xFFB00000 +#define L1_SCRATCH_LENGTH 0x1000 + +#endif /* _MEM_MAP_538_H_ */ -- cgit v1.2.3-70-g09d2 From 46fa5eecec58934902ea4a65d9c7b7a486ac6f6b Mon Sep 17 00:00:00 2001 From: Graf Yang Date: Wed, 7 Jan 2009 23:14:39 +0800 Subject: Blackfin arch: SMP supporting patchset: some other misc code Blackfin dual core BF561 processor can support SMP like features. https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:smp-like In this patch, we provide SMP extend to some other misc code Singed-off-by: Graf Yang Signed-off-by: Bryan Wu --- arch/blackfin/Kconfig | 33 +++++++++++++++++++++++-- arch/blackfin/kernel/vmlinux.lds.S | 4 +-- arch/blackfin/mach-bf518/include/mach/mem_map.h | 15 +++++++++++ arch/blackfin/mach-bf527/include/mach/mem_map.h | 15 +++++++++++ arch/blackfin/mach-bf533/include/mach/mem_map.h | 15 +++++++++++ arch/blackfin/mach-bf537/include/mach/mem_map.h | 15 +++++++++++ arch/blackfin/mach-bf538/include/mach/mem_map.h | 15 +++++++++++ arch/blackfin/mach-bf548/include/mach/mem_map.h | 15 +++++++++++ 8 files changed, 123 insertions(+), 4 deletions(-) (limited to 'arch/blackfin/mach-bf538/include/mach/mem_map.h') diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index 004c06ce319..3a468436258 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig @@ -200,6 +200,32 @@ config BF561 endchoice +config SMP + depends on BF561 + bool "Symmetric multi-processing support" + ---help--- + This enables support for systems with more than one CPU, + like the dual core BF561. If you have a system with only one + CPU, say N. If you have a system with more than one CPU, say Y. + + If you don't know what to do here, say N. + +config NR_CPUS + int + depends on SMP + default 2 if BF561 + +config IRQ_PER_CPU + bool + depends on SMP + default y + +config TICK_SOURCE_SYSTMR0 + bool + select BFIN_GPTIMERS + depends on SMP + default y + config BF_REV_MIN int default 0 if (BF51x || BF52x || BF54x) @@ -502,6 +528,7 @@ source kernel/Kconfig.hz config GENERIC_TIME bool "Generic time" + depends on !SMP default y config GENERIC_CLOCKEVENTS @@ -576,6 +603,7 @@ endmenu menu "Blackfin Kernel Optimizations" + depends on !SMP comment "Memory Optimizations" @@ -738,7 +766,6 @@ config BFIN_INS_LOWOVERHEAD endmenu - choice prompt "Kernel executes from" help @@ -804,9 +831,11 @@ config BFIN_ICACHE_LOCK choice prompt "Policy" depends on BFIN_DCACHE - default BFIN_WB + default BFIN_WB if !SMP + default BFIN_WT if SMP config BFIN_WB bool "Write back" + depends on !SMP help Write Back Policy: Cached data will be written back to SDRAM only when needed. diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S index 7d12c6692a6..2a485352ec1 100644 --- a/arch/blackfin/kernel/vmlinux.lds.S +++ b/arch/blackfin/kernel/vmlinux.lds.S @@ -109,7 +109,7 @@ SECTIONS #endif DATA_DATA - *(.data.*) + *(.data) CONSTRUCTORS /* make sure the init_task is aligned to the @@ -161,6 +161,7 @@ SECTIONS *(.con_initcall.init) ___con_initcall_end = .; } + PERCPU(4) SECURITY_INIT .init.ramfs : { @@ -236,7 +237,6 @@ SECTIONS . = ALIGN(4); __ebss_l2 = .; } - /* Force trailing alignment of our init section so that when we * free our init memory, we don't leave behind a partial page. */ diff --git a/arch/blackfin/mach-bf518/include/mach/mem_map.h b/arch/blackfin/mach-bf518/include/mach/mem_map.h index 10f678f3c5c..ac95d334d08 100644 --- a/arch/blackfin/mach-bf518/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf518/include/mach/mem_map.h @@ -99,4 +99,19 @@ #define L1_SCRATCH_START 0xFFB00000 #define L1_SCRATCH_LENGTH 0x1000 +#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START +#define get_l1_code_start_cpu(cpu) L1_CODE_START +#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START +#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START +#define get_l1_scratch_start() L1_SCRATCH_START +#define get_l1_code_start() L1_CODE_START +#define get_l1_data_a_start() L1_DATA_A_START +#define get_l1_data_b_start() L1_DATA_B_START + +#define GET_PDA_SAFE(preg) \ + preg.l = _cpu_pda; \ + preg.h = _cpu_pda; + +#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg) + #endif /* _MEM_MAP_518_H_ */ diff --git a/arch/blackfin/mach-bf527/include/mach/mem_map.h b/arch/blackfin/mach-bf527/include/mach/mem_map.h index ef46dc991cd..bd7fe0fda9e 100644 --- a/arch/blackfin/mach-bf527/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf527/include/mach/mem_map.h @@ -99,4 +99,19 @@ #define L1_SCRATCH_START 0xFFB00000 #define L1_SCRATCH_LENGTH 0x1000 +#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START +#define get_l1_code_start_cpu(cpu) L1_CODE_START +#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START +#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START +#define get_l1_scratch_start() L1_SCRATCH_START +#define get_l1_code_start() L1_CODE_START +#define get_l1_data_a_start() L1_DATA_A_START +#define get_l1_data_b_start() L1_DATA_B_START + +#define GET_PDA_SAFE(preg) \ + preg.l = _cpu_pda; \ + preg.h = _cpu_pda; + +#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg) + #endif /* _MEM_MAP_527_H_ */ diff --git a/arch/blackfin/mach-bf533/include/mach/mem_map.h b/arch/blackfin/mach-bf533/include/mach/mem_map.h index 581fc6eea78..d5eaef21edb 100644 --- a/arch/blackfin/mach-bf533/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf533/include/mach/mem_map.h @@ -168,4 +168,19 @@ #define L1_SCRATCH_START 0xFFB00000 #define L1_SCRATCH_LENGTH 0x1000 +#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START +#define get_l1_code_start_cpu(cpu) L1_CODE_START +#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START +#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START +#define get_l1_scratch_start() L1_SCRATCH_START +#define get_l1_code_start() L1_CODE_START +#define get_l1_data_a_start() L1_DATA_A_START +#define get_l1_data_b_start() L1_DATA_B_START + +#define GET_PDA_SAFE(preg) \ + preg.l = _cpu_pda; \ + preg.h = _cpu_pda; + +#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg) + #endif /* _MEM_MAP_533_H_ */ diff --git a/arch/blackfin/mach-bf537/include/mach/mem_map.h b/arch/blackfin/mach-bf537/include/mach/mem_map.h index 5078b669431..be4de761be9 100644 --- a/arch/blackfin/mach-bf537/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf537/include/mach/mem_map.h @@ -176,4 +176,19 @@ #define L1_SCRATCH_START 0xFFB00000 #define L1_SCRATCH_LENGTH 0x1000 +#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START +#define get_l1_code_start_cpu(cpu) L1_CODE_START +#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START +#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START +#define get_l1_scratch_start() L1_SCRATCH_START +#define get_l1_code_start() L1_CODE_START +#define get_l1_data_a_start() L1_DATA_A_START +#define get_l1_data_b_start() L1_DATA_B_START + +#define GET_PDA_SAFE(preg) \ + preg.l = _cpu_pda; \ + preg.h = _cpu_pda; + +#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg) + #endif /* _MEM_MAP_537_H_ */ diff --git a/arch/blackfin/mach-bf538/include/mach/mem_map.h b/arch/blackfin/mach-bf538/include/mach/mem_map.h index d65d4301615..c134057c91f 100644 --- a/arch/blackfin/mach-bf538/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf538/include/mach/mem_map.h @@ -104,4 +104,19 @@ #define L1_SCRATCH_START 0xFFB00000 #define L1_SCRATCH_LENGTH 0x1000 +#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START +#define get_l1_code_start_cpu(cpu) L1_CODE_START +#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START +#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START +#define get_l1_scratch_start() L1_SCRATCH_START +#define get_l1_code_start() L1_CODE_START +#define get_l1_data_a_start() L1_DATA_A_START +#define get_l1_data_b_start() L1_DATA_B_START + +#define GET_PDA_SAFE(preg) \ + preg.l = _cpu_pda; \ + preg.h = _cpu_pda; + +#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg) + #endif /* _MEM_MAP_538_H_ */ diff --git a/arch/blackfin/mach-bf548/include/mach/mem_map.h b/arch/blackfin/mach-bf548/include/mach/mem_map.h index a2228428dc0..361eb0e85bc 100644 --- a/arch/blackfin/mach-bf548/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf548/include/mach/mem_map.h @@ -108,4 +108,19 @@ #define L1_SCRATCH_START 0xFFB00000 #define L1_SCRATCH_LENGTH 0x1000 +#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START +#define get_l1_code_start_cpu(cpu) L1_CODE_START +#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START +#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START +#define get_l1_scratch_start() L1_SCRATCH_START +#define get_l1_code_start() L1_CODE_START +#define get_l1_data_a_start() L1_DATA_A_START +#define get_l1_data_b_start() L1_DATA_B_START + +#define GET_PDA_SAFE(preg) \ + preg.l = _cpu_pda; \ + preg.h = _cpu_pda; + +#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg) + #endif/* _MEM_MAP_548_H_ */ -- cgit v1.2.3-70-g09d2 From dbc895f95500a73ebf1ff12fe85f2e2b3790f52f Mon Sep 17 00:00:00 2001 From: Graf Yang Date: Wed, 7 Jan 2009 23:14:39 +0800 Subject: Blackfin arch: smp patch cleanup from LKML review 1. Use inline get_l1_... functions instead of macro 2. Fix compile issue about smp barrier functions Signed-off-by: Graf Yang Signed-off-by: Bryan Wu --- arch/blackfin/include/asm/mem_map.h | 75 +++++++++++++++++++++++++ arch/blackfin/include/asm/smp.h | 2 + arch/blackfin/include/asm/system.h | 6 +- arch/blackfin/kernel/bfin_ksyms.c | 2 + arch/blackfin/kernel/cplb-mpu/cplbinit.c | 1 + arch/blackfin/kernel/cplb-nompu/cplbinit.c | 1 + arch/blackfin/kernel/process.c | 1 + arch/blackfin/kernel/ptrace.c | 1 + arch/blackfin/mach-bf518/include/mach/mem_map.h | 9 --- arch/blackfin/mach-bf527/include/mach/mem_map.h | 9 --- arch/blackfin/mach-bf533/include/mach/mem_map.h | 9 --- arch/blackfin/mach-bf537/include/mach/mem_map.h | 9 --- arch/blackfin/mach-bf538/include/mach/mem_map.h | 9 --- arch/blackfin/mach-bf548/include/mach/mem_map.h | 9 --- arch/blackfin/mach-bf561/include/mach/mem_map.h | 42 +------------- arch/blackfin/mach-bf561/smp.c | 11 +--- arch/blackfin/mm/sram-alloc.c | 1 + 17 files changed, 92 insertions(+), 105 deletions(-) (limited to 'arch/blackfin/mach-bf538/include/mach/mem_map.h') diff --git a/arch/blackfin/include/asm/mem_map.h b/arch/blackfin/include/asm/mem_map.h index 88d04a70770..e92b31051bb 100644 --- a/arch/blackfin/include/asm/mem_map.h +++ b/arch/blackfin/include/asm/mem_map.h @@ -9,4 +9,79 @@ #include +#ifndef __ASSEMBLY__ + +#ifdef CONFIG_SMP +static inline ulong get_l1_scratch_start_cpu(int cpu) +{ + return (cpu) ? COREB_L1_SCRATCH_START : COREA_L1_SCRATCH_START; +} +static inline ulong get_l1_code_start_cpu(int cpu) +{ + return (cpu) ? COREB_L1_CODE_START : COREA_L1_CODE_START; +} +static inline ulong get_l1_data_a_start_cpu(int cpu) +{ + return (cpu) ? COREB_L1_DATA_A_START : COREA_L1_DATA_A_START; +} +static inline ulong get_l1_data_b_start_cpu(int cpu) +{ + return (cpu) ? COREB_L1_DATA_B_START : COREA_L1_DATA_B_START; +} + +static inline ulong get_l1_scratch_start(void) +{ + return get_l1_scratch_start_cpu(blackfin_core_id()); +} +static inline ulong get_l1_code_start(void) +{ + return get_l1_code_start_cpu(blackfin_core_id()); +} +static inline ulong get_l1_data_a_start(void) +{ + return get_l1_data_a_start_cpu(blackfin_core_id()); +} +static inline ulong get_l1_data_b_start(void) +{ + return get_l1_data_b_start_cpu(blackfin_core_id()); +} + +#else /* !CONFIG_SMP */ + +static inline ulong get_l1_scratch_start_cpu(int cpu) +{ + return L1_SCRATCH_START; +} +static inline ulong get_l1_code_start_cpu(int cpu) +{ + return L1_CODE_START; +} +static inline ulong get_l1_data_a_start_cpu(int cpu) +{ + return L1_DATA_A_START; +} +static inline ulong get_l1_data_b_start_cpu(int cpu) +{ + return L1_DATA_B_START; +} +static inline ulong get_l1_scratch_start(void) +{ + return get_l1_scratch_start_cpu(0); +} +static inline ulong get_l1_code_start(void) +{ + return get_l1_code_start_cpu(0); +} +static inline ulong get_l1_data_a_start(void) +{ + return get_l1_data_a_start_cpu(0); +} +static inline ulong get_l1_data_b_start(void) +{ + return get_l1_data_b_start_cpu(0); +} + +#endif /* CONFIG_SMP */ +#endif /* __ASSEMBLY__ */ + #endif /* _MEM_MAP_H_ */ diff --git a/arch/blackfin/include/asm/smp.h b/arch/blackfin/include/asm/smp.h index 233cb8c3cfb..118deeeae7c 100644 --- a/arch/blackfin/include/asm/smp.h +++ b/arch/blackfin/include/asm/smp.h @@ -32,6 +32,8 @@ #define raw_smp_processor_id() blackfin_core_id() +extern char coreb_trampoline_start, coreb_trampoline_end; + struct corelock_slot { int lock; }; diff --git a/arch/blackfin/include/asm/system.h b/arch/blackfin/include/asm/system.h index e8bcfa4ee5c..dea92037dff 100644 --- a/arch/blackfin/include/asm/system.h +++ b/arch/blackfin/include/asm/system.h @@ -66,10 +66,13 @@ asmlinkage unsigned long __raw_cmpxchg_4_asm(volatile void *ptr, # define smp_mb() do { barrier(); smp_check_barrier(); smp_mark_barrier(); } while (0) # define smp_rmb() do { barrier(); smp_check_barrier(); } while (0) # define smp_wmb() do { barrier(); smp_mark_barrier(); } while (0) +#define smp_read_barrier_depends() do { barrier(); smp_check_barrier(); } while (0) + #else # define smp_mb() barrier() # define smp_rmb() barrier() # define smp_wmb() barrier() +#define smp_read_barrier_depends() barrier() #endif static inline unsigned long __xchg(unsigned long x, volatile void *ptr, @@ -120,8 +123,6 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \ (unsigned long)(n), sizeof(*(ptr)))) -#define smp_read_barrier_depends() smp_check_barrier() - #else /* !CONFIG_SMP */ #define smp_mb() barrier() @@ -192,6 +193,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, */ #include +#include asmlinkage struct task_struct *resume(struct task_struct *prev, struct task_struct *next); diff --git a/arch/blackfin/kernel/bfin_ksyms.c b/arch/blackfin/kernel/bfin_ksyms.c index 763c31531e9..01f917d58b5 100644 --- a/arch/blackfin/kernel/bfin_ksyms.c +++ b/arch/blackfin/kernel/bfin_ksyms.c @@ -99,6 +99,8 @@ EXPORT_SYMBOL(__raw_bit_test_set_asm); EXPORT_SYMBOL(__raw_bit_test_clear_asm); EXPORT_SYMBOL(__raw_bit_test_toggle_asm); EXPORT_SYMBOL(__raw_uncached_fetch_asm); +#ifdef __ARCH_SYNC_CORE_DCACHE EXPORT_SYMBOL(__raw_smp_mark_barrier_asm); EXPORT_SYMBOL(__raw_smp_check_barrier_asm); #endif +#endif diff --git a/arch/blackfin/kernel/cplb-mpu/cplbinit.c b/arch/blackfin/kernel/cplb-mpu/cplbinit.c index 269d2a3530a..1ea7c18435a 100644 --- a/arch/blackfin/kernel/cplb-mpu/cplbinit.c +++ b/arch/blackfin/kernel/cplb-mpu/cplbinit.c @@ -25,6 +25,7 @@ #include #include #include +#include #if ANOMALY_05000263 # error the MPU will not function safely while Anomaly 05000263 applies diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c index 735413d2c22..4c010ba50a8 100644 --- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c +++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c @@ -27,6 +27,7 @@ #include #include #include +#include u_long icplb_tables[NR_CPUS][CPLB_TBL_ENTRIES+1]; u_long dcplb_tables[NR_CPUS][CPLB_TBL_ENTRIES+1]; diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c index 4359ea25301..1ec0faa8c68 100644 --- a/arch/blackfin/kernel/process.c +++ b/arch/blackfin/kernel/process.c @@ -39,6 +39,7 @@ #include #include +#include asmlinkage void ret_from_fork(void); diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c index d5e6be2d5ed..d2d38853663 100644 --- a/arch/blackfin/kernel/ptrace.c +++ b/arch/blackfin/kernel/ptrace.c @@ -45,6 +45,7 @@ #include #include #include +#include #define TEXT_OFFSET 0 /* diff --git a/arch/blackfin/mach-bf518/include/mach/mem_map.h b/arch/blackfin/mach-bf518/include/mach/mem_map.h index ac95d334d08..62bcc781bfa 100644 --- a/arch/blackfin/mach-bf518/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf518/include/mach/mem_map.h @@ -99,15 +99,6 @@ #define L1_SCRATCH_START 0xFFB00000 #define L1_SCRATCH_LENGTH 0x1000 -#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START -#define get_l1_code_start_cpu(cpu) L1_CODE_START -#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START -#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START -#define get_l1_scratch_start() L1_SCRATCH_START -#define get_l1_code_start() L1_CODE_START -#define get_l1_data_a_start() L1_DATA_A_START -#define get_l1_data_b_start() L1_DATA_B_START - #define GET_PDA_SAFE(preg) \ preg.l = _cpu_pda; \ preg.h = _cpu_pda; diff --git a/arch/blackfin/mach-bf527/include/mach/mem_map.h b/arch/blackfin/mach-bf527/include/mach/mem_map.h index bd7fe0fda9e..019e0017ad8 100644 --- a/arch/blackfin/mach-bf527/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf527/include/mach/mem_map.h @@ -99,15 +99,6 @@ #define L1_SCRATCH_START 0xFFB00000 #define L1_SCRATCH_LENGTH 0x1000 -#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START -#define get_l1_code_start_cpu(cpu) L1_CODE_START -#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START -#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START -#define get_l1_scratch_start() L1_SCRATCH_START -#define get_l1_code_start() L1_CODE_START -#define get_l1_data_a_start() L1_DATA_A_START -#define get_l1_data_b_start() L1_DATA_B_START - #define GET_PDA_SAFE(preg) \ preg.l = _cpu_pda; \ preg.h = _cpu_pda; diff --git a/arch/blackfin/mach-bf533/include/mach/mem_map.h b/arch/blackfin/mach-bf533/include/mach/mem_map.h index d5eaef21edb..fc33b7cb993 100644 --- a/arch/blackfin/mach-bf533/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf533/include/mach/mem_map.h @@ -168,15 +168,6 @@ #define L1_SCRATCH_START 0xFFB00000 #define L1_SCRATCH_LENGTH 0x1000 -#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START -#define get_l1_code_start_cpu(cpu) L1_CODE_START -#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START -#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START -#define get_l1_scratch_start() L1_SCRATCH_START -#define get_l1_code_start() L1_CODE_START -#define get_l1_data_a_start() L1_DATA_A_START -#define get_l1_data_b_start() L1_DATA_B_START - #define GET_PDA_SAFE(preg) \ preg.l = _cpu_pda; \ preg.h = _cpu_pda; diff --git a/arch/blackfin/mach-bf537/include/mach/mem_map.h b/arch/blackfin/mach-bf537/include/mach/mem_map.h index be4de761be9..f9010c4b4bf 100644 --- a/arch/blackfin/mach-bf537/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf537/include/mach/mem_map.h @@ -176,15 +176,6 @@ #define L1_SCRATCH_START 0xFFB00000 #define L1_SCRATCH_LENGTH 0x1000 -#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START -#define get_l1_code_start_cpu(cpu) L1_CODE_START -#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START -#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START -#define get_l1_scratch_start() L1_SCRATCH_START -#define get_l1_code_start() L1_CODE_START -#define get_l1_data_a_start() L1_DATA_A_START -#define get_l1_data_b_start() L1_DATA_B_START - #define GET_PDA_SAFE(preg) \ preg.l = _cpu_pda; \ preg.h = _cpu_pda; diff --git a/arch/blackfin/mach-bf538/include/mach/mem_map.h b/arch/blackfin/mach-bf538/include/mach/mem_map.h index c134057c91f..76811966690 100644 --- a/arch/blackfin/mach-bf538/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf538/include/mach/mem_map.h @@ -104,15 +104,6 @@ #define L1_SCRATCH_START 0xFFB00000 #define L1_SCRATCH_LENGTH 0x1000 -#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START -#define get_l1_code_start_cpu(cpu) L1_CODE_START -#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START -#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START -#define get_l1_scratch_start() L1_SCRATCH_START -#define get_l1_code_start() L1_CODE_START -#define get_l1_data_a_start() L1_DATA_A_START -#define get_l1_data_b_start() L1_DATA_B_START - #define GET_PDA_SAFE(preg) \ preg.l = _cpu_pda; \ preg.h = _cpu_pda; diff --git a/arch/blackfin/mach-bf548/include/mach/mem_map.h b/arch/blackfin/mach-bf548/include/mach/mem_map.h index 361eb0e85bc..70b9c119402 100644 --- a/arch/blackfin/mach-bf548/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf548/include/mach/mem_map.h @@ -108,15 +108,6 @@ #define L1_SCRATCH_START 0xFFB00000 #define L1_SCRATCH_LENGTH 0x1000 -#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START -#define get_l1_code_start_cpu(cpu) L1_CODE_START -#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START -#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START -#define get_l1_scratch_start() L1_SCRATCH_START -#define get_l1_code_start() L1_CODE_START -#define get_l1_data_a_start() L1_DATA_A_START -#define get_l1_data_b_start() L1_DATA_B_START - #define GET_PDA_SAFE(preg) \ preg.l = _cpu_pda; \ preg.h = _cpu_pda; diff --git a/arch/blackfin/mach-bf561/include/mach/mem_map.h b/arch/blackfin/mach-bf561/include/mach/mem_map.h index 488c3bda65b..419dffdc96e 100644 --- a/arch/blackfin/mach-bf561/include/mach/mem_map.h +++ b/arch/blackfin/mach-bf561/include/mach/mem_map.h @@ -85,47 +85,7 @@ #define L1_SCRATCH_START COREA_L1_SCRATCH_START #define L1_SCRATCH_LENGTH 0x1000 -#ifndef __ASSEMBLY__ - -#ifdef CONFIG_SMP - -#define get_l1_scratch_start_cpu(cpu) \ - ({ unsigned long __addr; \ - __addr = (cpu) ? COREB_L1_SCRATCH_START : COREA_L1_SCRATCH_START;\ - __addr; }) - -#define get_l1_code_start_cpu(cpu) \ - ({ unsigned long __addr; \ - __addr = (cpu) ? COREB_L1_CODE_START : COREA_L1_CODE_START; \ - __addr; }) - -#define get_l1_data_a_start_cpu(cpu) \ - ({ unsigned long __addr; \ - __addr = (cpu) ? COREB_L1_DATA_A_START : COREA_L1_DATA_A_START;\ - __addr; }) - -#define get_l1_data_b_start_cpu(cpu) \ - ({ unsigned long __addr; \ - __addr = (cpu) ? COREB_L1_DATA_B_START : COREA_L1_DATA_B_START;\ - __addr; }) - -#define get_l1_scratch_start() get_l1_scratch_start_cpu(blackfin_core_id()) -#define get_l1_code_start() get_l1_code_start_cpu(blackfin_core_id()) -#define get_l1_data_a_start() get_l1_data_a_start_cpu(blackfin_core_id()) -#define get_l1_data_b_start() get_l1_data_b_start_cpu(blackfin_core_id()) - -#else /* !CONFIG_SMP */ -#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START -#define get_l1_code_start_cpu(cpu) L1_CODE_START -#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START -#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START -#define get_l1_scratch_start() L1_SCRATCH_START -#define get_l1_code_start() L1_CODE_START -#define get_l1_data_a_start() L1_DATA_A_START -#define get_l1_data_b_start() L1_DATA_B_START -#endif /* !CONFIG_SMP */ - -#else /* __ASSEMBLY__ */ +#ifdef __ASSEMBLY__ /* * The following macros both return the address of the PDA for the diff --git a/arch/blackfin/mach-bf561/smp.c b/arch/blackfin/mach-bf561/smp.c index 23fd4c13897..9b27e698c0b 100644 --- a/arch/blackfin/mach-bf561/smp.c +++ b/arch/blackfin/mach-bf561/smp.c @@ -27,11 +27,6 @@ #include #include -#define COREB_SRAM_BASE 0xff600000 -#define COREB_SRAM_SIZE 0x4000 - -extern char coreb_trampoline_start, coreb_trampoline_end; - static DEFINE_SPINLOCK(boot_lock); static cpumask_t cpu_callin_map; @@ -54,15 +49,15 @@ void __init platform_prepare_cpus(unsigned int max_cpus) int len; len = &coreb_trampoline_end - &coreb_trampoline_start + 1; - BUG_ON(len > COREB_SRAM_SIZE); + BUG_ON(len > L1_CODE_LENGTH); - dma_memcpy((void *)COREB_SRAM_BASE, &coreb_trampoline_start, len); + dma_memcpy((void *)COREB_L1_CODE_START, &coreb_trampoline_start, len); /* Both cores ought to be present on a bf561! */ cpu_set(0, cpu_present_map); /* CoreA */ cpu_set(1, cpu_present_map); /* CoreB */ - printk(KERN_INFO "CoreB bootstrap code to SRAM %p via DMA.\n", (void *)COREB_SRAM_BASE); + printk(KERN_INFO "CoreB bootstrap code to SRAM %p via DMA.\n", (void *)COREB_L1_CODE_START); } int __init setup_profiling_timer(unsigned int multiplier) /* not supported */ diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c index 1ca5deb7934..834cab7438a 100644 --- a/arch/blackfin/mm/sram-alloc.c +++ b/arch/blackfin/mm/sram-alloc.c @@ -39,6 +39,7 @@ #include #include #include +#include #include "blackfin_sram.h" static DEFINE_PER_CPU(spinlock_t, l1sram_lock) ____cacheline_aligned_in_smp; -- cgit v1.2.3-70-g09d2