Blackfin arch: SMP supporting patchset: some other misc code
authorGraf Yang <graf.yang@analog.com>
Wed, 7 Jan 2009 15:14:39 +0000 (23:14 +0800)
committerBryan Wu <cooloney@kernel.org>
Wed, 7 Jan 2009 15:14:39 +0000 (23:14 +0800)
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 <graf.yang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
arch/blackfin/Kconfig
arch/blackfin/kernel/vmlinux.lds.S
arch/blackfin/mach-bf518/include/mach/mem_map.h
arch/blackfin/mach-bf527/include/mach/mem_map.h
arch/blackfin/mach-bf533/include/mach/mem_map.h
arch/blackfin/mach-bf537/include/mach/mem_map.h
arch/blackfin/mach-bf538/include/mach/mem_map.h
arch/blackfin/mach-bf548/include/mach/mem_map.h

index 004c06ce3198c8a645b2d87bda5e174a2cd00c26..3a468436258dce2bf5b4528cafb5f021c4369d53 100644 (file)
@@ -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.
index 7d12c6692a65a1d2d8e2de17049fb541b61df9c3..2a485352ec14680553de6f925a0a00281ae782c5 100644 (file)
@@ -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.
         */
index 10f678f3c5c07fc790eb3c9625e0ec336a326ce8..ac95d334d08298edcfe808081a8fd449b8a63f68 100644 (file)
 #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_ */
index ef46dc991cd447d0a7f33b3baee6f63e515b16fd..bd7fe0fda9e8c7a7a7553d9d31f2af0f05b27f2b 100644 (file)
 #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_ */
index 581fc6eea789b189a31743d8f2ce90832fba053f..d5eaef21edb7d6dd0fbcb208dbe8ae895da34078 100644 (file)
 #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_ */
index 5078b669431f72204cb780d144167606192ec558..be4de761be96ee2a2630c171fb5d8e7836768847 100644 (file)
 #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_ */
index d65d4301615aa56c704e019abf56b80de6530364..c134057c91ff33d9edf15cfa5aaf9041d00ff112 100644 (file)
 #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_ */
index a2228428dc065e11cc5fc6df3674fadbb5933147..361eb0e85bc062174236653cefe2cd7a5b03a76d 100644 (file)
 #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_ */