From f76b7ea48afb6daecbbc26f5408a75ac66b1cf23 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 4 Mar 2007 17:26:56 +0000 Subject: [MIPS] Atlas, Malta: Fix build warning. Signed-off-by: Ralf Baechle --- arch/mips/mips-boards/generic/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/mips') diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c index b11337600129..1acdf091c258 100644 --- a/arch/mips/mips-boards/generic/init.c +++ b/arch/mips/mips-boards/generic/init.c @@ -251,8 +251,6 @@ void __init mips_ejtag_setup (void) void __init prom_init(void) { - u32 start, map, mask, data; - prom_argc = fw_arg0; _prom_argv = (int *) fw_arg1; _prom_envp = (int *) fw_arg2; @@ -278,6 +276,8 @@ void __init prom_init(void) mips_revision_corid = MIPS_REVISION_CORID_CORE_EMUL_MSC; } switch(mips_revision_corid) { + u32 start, map, mask, data; + case MIPS_REVISION_CORID_QED_RM5261: case MIPS_REVISION_CORID_CORE_LV: case MIPS_REVISION_CORID_CORE_FPGA: -- cgit v1.2.3 From 57a2050c408620613c5715171364de2cc5566f22 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 4 Mar 2007 18:27:34 +0000 Subject: [MIPS] SMTC: De-obscure Malta hooks. Should now be understandable why the thing works ... Signed-off-by: Ralf Baechle --- arch/mips/mips-boards/malta/Makefile | 2 +- arch/mips/mips-boards/malta/malta_smp.c | 109 ------------------------------- arch/mips/mips-boards/malta/malta_smtc.c | 88 +++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 110 deletions(-) delete mode 100644 arch/mips/mips-boards/malta/malta_smp.c create mode 100644 arch/mips/mips-boards/malta/malta_smtc.c (limited to 'arch/mips') diff --git a/arch/mips/mips-boards/malta/Makefile b/arch/mips/mips-boards/malta/Makefile index cb7f349b0514..377d9e8f250a 100644 --- a/arch/mips/mips-boards/malta/Makefile +++ b/arch/mips/mips-boards/malta/Makefile @@ -21,4 +21,4 @@ obj-y := malta_int.o malta_setup.o obj-$(CONFIG_MTD) += malta_mtd.o -obj-$(CONFIG_SMP) += malta_smp.o +obj-$(CONFIG_MIPS_MT_SMTC) += malta_smtc.o diff --git a/arch/mips/mips-boards/malta/malta_smp.c b/arch/mips/mips-boards/malta/malta_smp.c deleted file mode 100644 index cf967170fe29..000000000000 --- a/arch/mips/mips-boards/malta/malta_smp.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Malta Platform-specific hooks for SMP operation - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#ifdef CONFIG_MIPS_MT_SMTC -#include -#endif /* CONFIG_MIPS_MT_SMTC */ - -/* VPE/SMP Prototype implements platform interfaces directly */ -#if !defined(CONFIG_MIPS_MT_SMP) - -/* - * Cause the specified action to be performed on a targeted "CPU" - */ - -void core_send_ipi(int cpu, unsigned int action) -{ -/* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */ -#ifdef CONFIG_MIPS_MT_SMTC - smtc_send_ipi(cpu, LINUX_SMP_IPI, action); -#endif /* CONFIG_MIPS_MT_SMTC */ -} - -/* - * Platform "CPU" startup hook - */ - -void prom_boot_secondary(int cpu, struct task_struct *idle) -{ -#ifdef CONFIG_MIPS_MT_SMTC - smtc_boot_secondary(cpu, idle); -#endif /* CONFIG_MIPS_MT_SMTC */ -} - -/* - * Post-config but pre-boot cleanup entry point - */ - -void prom_init_secondary(void) -{ -#ifdef CONFIG_MIPS_MT_SMTC - void smtc_init_secondary(void); - int myvpe; - - /* Don't enable Malta I/O interrupts (IP2) for secondary VPEs */ - myvpe = read_c0_tcbind() & TCBIND_CURVPE; - if (myvpe != 0) { - /* Ideally, this should be done only once per VPE, but... */ - clear_c0_status(STATUSF_IP2); - set_c0_status(STATUSF_IP0 | STATUSF_IP1 | STATUSF_IP3 - | STATUSF_IP4 | STATUSF_IP5 | STATUSF_IP6 - | STATUSF_IP7); - } - - smtc_init_secondary(); -#endif /* CONFIG_MIPS_MT_SMTC */ -} - -/* - * Platform SMP pre-initialization - * - * As noted above, we can assume a single CPU for now - * but it may be multithreaded. - */ - -void plat_smp_setup(void) -{ - if (read_c0_config3() & (1<<2)) - mipsmt_build_cpu_map(0); -} - -void __init plat_prepare_cpus(unsigned int max_cpus) -{ - if (read_c0_config3() & (1<<2)) - mipsmt_prepare_cpus(); -} - -/* - * SMP initialization finalization entry point - */ - -void prom_smp_finish(void) -{ -#ifdef CONFIG_MIPS_MT_SMTC - smtc_smp_finish(); -#endif /* CONFIG_MIPS_MT_SMTC */ -} - -/* - * Hook for after all CPUs are online - */ - -void prom_cpus_done(void) -{ -} - -#endif /* CONFIG_MIPS32R2_MT_SMP */ diff --git a/arch/mips/mips-boards/malta/malta_smtc.c b/arch/mips/mips-boards/malta/malta_smtc.c new file mode 100644 index 000000000000..d1c80f631100 --- /dev/null +++ b/arch/mips/mips-boards/malta/malta_smtc.c @@ -0,0 +1,88 @@ +/* + * Malta Platform-specific hooks for SMP operation + */ +#include + +#include +#include +#include +#include + +/* VPE/SMP Prototype implements platform interfaces directly */ + +/* + * Cause the specified action to be performed on a targeted "CPU" + */ + +void core_send_ipi(int cpu, unsigned int action) +{ + /* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */ + smtc_send_ipi(cpu, LINUX_SMP_IPI, action); +} + +/* + * Platform "CPU" startup hook + */ + +void prom_boot_secondary(int cpu, struct task_struct *idle) +{ + smtc_boot_secondary(cpu, idle); +} + +/* + * Post-config but pre-boot cleanup entry point + */ + +void prom_init_secondary(void) +{ + void smtc_init_secondary(void); + int myvpe; + + /* Don't enable Malta I/O interrupts (IP2) for secondary VPEs */ + myvpe = read_c0_tcbind() & TCBIND_CURVPE; + if (myvpe != 0) { + /* Ideally, this should be done only once per VPE, but... */ + clear_c0_status(STATUSF_IP2); + set_c0_status(STATUSF_IP0 | STATUSF_IP1 | STATUSF_IP3 + | STATUSF_IP4 | STATUSF_IP5 | STATUSF_IP6 + | STATUSF_IP7); + } + + smtc_init_secondary(); +} + +/* + * Platform SMP pre-initialization + * + * As noted above, we can assume a single CPU for now + * but it may be multithreaded. + */ + +void plat_smp_setup(void) +{ + if (read_c0_config3() & (1<<2)) + mipsmt_build_cpu_map(0); +} + +void __init plat_prepare_cpus(unsigned int max_cpus) +{ + if (read_c0_config3() & (1<<2)) + mipsmt_prepare_cpus(); +} + +/* + * SMP initialization finalization entry point + */ + +void prom_smp_finish(void) +{ + smtc_smp_finish(); +} + +/* + * Hook for after all CPUs are online + */ + +void prom_cpus_done(void) +{ +} -- cgit v1.2.3 From 0a22e0d43b6d6468544dd7559d5f3c4acb8b536e Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Fri, 2 Mar 2007 12:42:33 +0900 Subject: [MIPS] Cobalt: Fix early printk Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- arch/mips/Kconfig | 2 +- arch/mips/cobalt/Kconfig | 7 ------- arch/mips/cobalt/console.c | 5 +---- 3 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 arch/mips/cobalt/Kconfig (limited to 'arch/mips') diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 4ec2dd5455f3..a1cd84f9b3bc 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -167,6 +167,7 @@ config MIPS_COBALT select IRQ_CPU select MIPS_GT64111 select SYS_HAS_CPU_NEVADA + select SYS_HAS_EARLY_PRINTK select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL select SYS_SUPPORTS_LITTLE_ENDIAN @@ -837,7 +838,6 @@ source "arch/mips/tx4927/Kconfig" source "arch/mips/tx4938/Kconfig" source "arch/mips/vr41xx/Kconfig" source "arch/mips/philips/pnx8550/common/Kconfig" -source "arch/mips/cobalt/Kconfig" endmenu diff --git a/arch/mips/cobalt/Kconfig b/arch/mips/cobalt/Kconfig deleted file mode 100644 index 7c42b088d16c..000000000000 --- a/arch/mips/cobalt/Kconfig +++ /dev/null @@ -1,7 +0,0 @@ -config EARLY_PRINTK - bool "Early console support" - depends on MIPS_COBALT - help - Provide early console support by direct access to the - on board UART. The UART must have been previously - initialised by the boot loader. diff --git a/arch/mips/cobalt/console.c b/arch/mips/cobalt/console.c index fff20d28114f..ca56b415b8ac 100644 --- a/arch/mips/cobalt/console.c +++ b/arch/mips/cobalt/console.c @@ -9,11 +9,8 @@ #include #include -static void putchar(int c) +void prom_putchar(char c) { - if(c == '\n') - putchar('\r'); - while(!(COBALT_UART[UART_LSR] & UART_LSR_THRE)) ; -- cgit v1.2.3 From a5664c40750ce423f308dfd01ad4e82ecb7ac127 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Mon, 5 Mar 2007 00:41:39 +0900 Subject: [MIPS] TX39: Remove redundant tx39_blast_icache() calls Apply commit 0550d9d13e02b30efa117d47fcadea450bb23d23 to c-tx39.c too. And fix a warning in local_tx39_flush_data_cache_page(). Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- arch/mips/mm/c-tx39.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'arch/mips') diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c index f32ebde30ccf..560a6de96556 100644 --- a/arch/mips/mm/c-tx39.c +++ b/arch/mips/mm/c-tx39.c @@ -128,7 +128,6 @@ static inline void tx39_flush_cache_all(void) return; tx39_blast_dcache(); - tx39_blast_icache(); } static inline void tx39___flush_cache_all(void) @@ -142,24 +141,19 @@ static void tx39_flush_cache_mm(struct mm_struct *mm) if (!cpu_has_dc_aliases) return; - if (cpu_context(smp_processor_id(), mm) != 0) { - tx39_flush_cache_all(); - } + if (cpu_context(smp_processor_id(), mm) != 0) + tx39_blast_dcache(); } static void tx39_flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) { - int exec; - + if (!cpu_has_dc_aliases) + return; if (!(cpu_context(smp_processor_id(), vma->vm_mm))) return; - exec = vma->vm_flags & VM_EXEC; - if (cpu_has_dc_aliases || exec) - tx39_blast_dcache(); - if (exec) - tx39_blast_icache(); + tx39_blast_dcache(); } static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page, unsigned long pfn) @@ -218,7 +212,7 @@ static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page static void local_tx39_flush_data_cache_page(void * addr) { - tx39_blast_dcache_page(addr); + tx39_blast_dcache_page((unsigned long)addr); } static void tx39_flush_data_cache_page(unsigned long addr) -- cgit v1.2.3 From d0c91ae2bb3df9d7bef279d8f400e0c8ddde0b5e Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 5 Mar 2007 15:54:20 +0000 Subject: [MIPS] Export __copy_user_inatomic. Signed-off-by: Ralf Baechle --- arch/mips/kernel/mips_ksyms.c | 1 + include/asm-mips/uaccess.h | 2 ++ 2 files changed, 3 insertions(+) (limited to 'arch/mips') diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c index 2ef857c3ee53..225755d0c1f6 100644 --- a/arch/mips/kernel/mips_ksyms.c +++ b/arch/mips/kernel/mips_ksyms.c @@ -37,6 +37,7 @@ EXPORT_SYMBOL(kernel_thread); * Userspace access stuff. */ EXPORT_SYMBOL(__copy_user); +EXPORT_SYMBOL(__copy_user_inatomic); EXPORT_SYMBOL(__bzero); EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm); EXPORT_SYMBOL(__strncpy_from_user_asm); diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h index c62c20e7b5c6..b25511787ee0 100644 --- a/include/asm-mips/uaccess.h +++ b/include/asm-mips/uaccess.h @@ -435,6 +435,8 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); __cu_len; \ }) +extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n); + #define __copy_to_user_inatomic(to,from,n) \ ({ \ void __user *__cu_to; \ -- cgit v1.2.3 From 08253b39f861e6167aa3acbe155f304ee800ce5a Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 6 Mar 2007 17:04:49 +0000 Subject: [MIPS] Wire up ioprio_set and ioprio_get. Signed-off-by: Ralf Baechle --- arch/mips/kernel/scall32-o32.S | 2 ++ arch/mips/kernel/scall64-64.S | 3 +++ arch/mips/kernel/scall64-n32.S | 5 ++++- arch/mips/kernel/scall64-o32.S | 2 ++ include/asm-mips/unistd.h | 18 ++++++++++++------ 5 files changed, 23 insertions(+), 7 deletions(-) (limited to 'arch/mips') diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 7c0b3936ba44..0c9a9ff8cd25 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S @@ -656,6 +656,8 @@ einval: li v0, -EINVAL sys sys_kexec_load 4 sys sys_getcpu 3 sys sys_epoll_pwait 6 + sys sys_ioprio_set 3 + sys sys_ioprio_get 2 .endm /* We pre-compute the number of _instruction_ bytes needed to diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index e569b846e9a3..23f3b118f718 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S @@ -471,3 +471,6 @@ sys_call_table: PTR sys_kexec_load /* 5270 */ PTR sys_getcpu PTR sys_epoll_pwait + PTR sys_ioprio_set + PTR sys_ioprio_get + .size sys_call_table,.-sys_call_table diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index f17e31e3bff2..6eac28337423 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S @@ -395,5 +395,8 @@ EXPORT(sysn32_call_table) PTR compat_sys_set_robust_list PTR compat_sys_get_robust_list PTR compat_sys_kexec_load - PTR sys_getcpu + PTR sys_getcpu /* 6275 */ PTR compat_sys_epoll_pwait + PTR sys_ioprio_set + PTR sys_ioprio_get + .size sysn32_call_table,.-sysn32_call_table diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 142c9b70c026..7e74b412a782 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S @@ -519,4 +519,6 @@ sys_call_table: PTR compat_sys_kexec_load PTR sys_getcpu PTR compat_sys_epoll_pwait + PTR sys_ioprio_set + PTR sys_ioprio_get /* 4315 */ .size sys_call_table,.-sys_call_table diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index 696cff39a1d3..2f1087b3a202 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h @@ -334,16 +334,18 @@ #define __NR_kexec_load (__NR_Linux + 311) #define __NR_getcpu (__NR_Linux + 312) #define __NR_epoll_pwait (__NR_Linux + 313) +#define __NR_ioprio_set (__NR_Linux + 314) +#define __NR_ioprio_get (__NR_Linux + 315) /* * Offset of the last Linux o32 flavoured syscall */ -#define __NR_Linux_syscalls 313 +#define __NR_Linux_syscalls 315 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ #define __NR_O32_Linux 4000 -#define __NR_O32_Linux_syscalls 313 +#define __NR_O32_Linux_syscalls 315 #if _MIPS_SIM == _MIPS_SIM_ABI64 @@ -624,16 +626,18 @@ #define __NR_kexec_load (__NR_Linux + 270) #define __NR_getcpu (__NR_Linux + 271) #define __NR_epoll_pwait (__NR_Linux + 272) +#define __NR_ioprio_set (__NR_Linux + 273) +#define __NR_ioprio_get (__NR_Linux + 274) /* * Offset of the last Linux 64-bit flavoured syscall */ -#define __NR_Linux_syscalls 272 +#define __NR_Linux_syscalls 274 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ #define __NR_64_Linux 5000 -#define __NR_64_Linux_syscalls 272 +#define __NR_64_Linux_syscalls 274 #if _MIPS_SIM == _MIPS_SIM_NABI32 @@ -918,16 +922,18 @@ #define __NR_kexec_load (__NR_Linux + 274) #define __NR_getcpu (__NR_Linux + 275) #define __NR_epoll_pwait (__NR_Linux + 276) +#define __NR_ioprio_set (__NR_Linux + 277) +#define __NR_ioprio_get (__NR_Linux + 278) /* * Offset of the last N32 flavoured syscall */ -#define __NR_Linux_syscalls 276 +#define __NR_Linux_syscalls 278 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ #define __NR_N32_Linux 6000 -#define __NR_N32_Linux_syscalls 276 +#define __NR_N32_Linux_syscalls 278 #ifdef __KERNEL__ -- cgit v1.2.3 From 063ea774b021c70fa96139eb601f894aff8941c0 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 6 Mar 2007 20:28:02 +0000 Subject: [MIPS] IP27: Build fix Signed-off-by: Ralf Baechle --- arch/mips/sgi-ip27/ip27-init.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/mips') diff --git a/arch/mips/sgi-ip27/ip27-init.c b/arch/mips/sgi-ip27/ip27-init.c index 9094baf31d0e..74158d349630 100644 --- a/arch/mips/sgi-ip27/ip27-init.c +++ b/arch/mips/sgi-ip27/ip27-init.c @@ -191,7 +191,6 @@ static inline void ioc3_eth_init(void) ioc3->eier = 0; } -extern void ip27_setup_console(void); extern void ip27_time_init(void); extern void ip27_reboot_setup(void); @@ -200,7 +199,6 @@ void __init plat_mem_setup(void) hubreg_t p, e, n_mode; nasid_t nid; - ip27_setup_console(); ip27_reboot_setup(); /* -- cgit v1.2.3