From 9a0f3b73601a146998236237d82b55ae80337f10 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Fri, 13 Jul 2007 16:36:57 +0900 Subject: [PATCH 01/10] [MIPS] MIPSsim: Fix cflags Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- arch/mips/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 20d19c9b776..a9a987a06da 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -328,7 +328,7 @@ load-$(CONFIG_MIPS_SEAD) += 0xffffffff80100000 # MIPS SIM # core-$(CONFIG_MIPS_SIM) += arch/mips/mipssim/ -cflags-$(CONFIG_MIPS_SIM) += -Iinclude/asm-mips/mach-sim +cflags-$(CONFIG_MIPS_SIM) += -Iinclude/asm-mips/mach-mipssim load-$(CONFIG_MIPS_SIM) += 0x80100000 # From fb4bb133ada7423b2504bb64bb6cc95c079a7d9d Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Sun, 22 Jul 2007 23:44:20 +0900 Subject: [PATCH 02/10] [MIPS] Mark prom_free_prom_memory as __init_refok > WARNING: vmlinux.o(.text+0xbf20): Section mismatch: reference to > .init.text:prom_free_prom_memory (between 'free_initmem' and 'copy_from_user_page') prom_free_prom_memory() is called _before_ freeing init sections, so it is false positive. __init_refok can be used for such cases. Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- arch/mips/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 4c80528dead..b8cb0dde3af 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c @@ -484,7 +484,7 @@ void free_initrd_mem(unsigned long start, unsigned long end) } #endif -void free_initmem(void) +void __init_refok free_initmem(void) { prom_free_prom_memory(); free_init_pages("unused kernel memory", From fce2303166a8f214a890bd405e0088febdce765f Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Sun, 22 Jul 2007 13:03:37 +0900 Subject: [PATCH 03/10] [MIPS] Jazz: Remove unused arch/mips/jazz/io.c Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- arch/mips/jazz/io.c | 135 -------------------------------------------- 1 file changed, 135 deletions(-) delete mode 100644 arch/mips/jazz/io.c diff --git a/arch/mips/jazz/io.c b/arch/mips/jazz/io.c deleted file mode 100644 index e86904454c8..00000000000 --- a/arch/mips/jazz/io.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Low level I/O functions for Jazz family machines. - * - * Copyright (C) 1997 by Ralf Baechle. - */ -#include -#include -#include -#include -#include - -/* - * Map an 16mb segment of the EISA address space to 0xe3000000; - */ -static inline void map_eisa_address(unsigned long address) -{ - /* XXX */ - /* We've got an wired entry in the TLB. We just need to modify it. - fast and clean. But since we want to get rid of wired entries - things are a little bit more complicated ... */ -} - -static unsigned char jazz_readb(unsigned long addr) -{ - unsigned char res; - - map_eisa_address(addr); - addr &= 0xffffff; - res = *(volatile unsigned char *) (JAZZ_EISA_BASE + addr); - - return res; -} - -static unsigned short jazz_readw(unsigned long addr) -{ - unsigned short res; - - map_eisa_address(addr); - addr &= 0xffffff; - res = *(volatile unsigned char *) (JAZZ_EISA_BASE + addr); - - return res; -} - -static unsigned int jazz_readl(unsigned long addr) -{ - unsigned int res; - - map_eisa_address(addr); - addr &= 0xffffff; - res = *(volatile unsigned char *) (JAZZ_EISA_BASE + addr); - - return res; -} - -static void jazz_writeb(unsigned char val, unsigned long addr) -{ - map_eisa_address(addr); - addr &= 0xffffff; - *(volatile unsigned char *) (JAZZ_EISA_BASE + addr) = val; -} - -static void jazz_writew(unsigned short val, unsigned long addr) -{ - map_eisa_address(addr); - addr &= 0xffffff; - *(volatile unsigned char *) (JAZZ_EISA_BASE + addr) = val; -} - -static void jazz_writel(unsigned int val, unsigned long addr) -{ - map_eisa_address(addr); - addr &= 0xffffff; - *(volatile unsigned char *) (JAZZ_EISA_BASE + addr) = val; -} - -static void jazz_memset_io(unsigned long addr, int val, unsigned long len) -{ - unsigned long waddr; - - waddr = JAZZ_EISA_BASE | (addr & 0xffffff); - while(len) { - unsigned long fraglen; - - fraglen = (~addr + 1) & 0xffffff; - fraglen = (fraglen < len) ? fraglen : len; - map_eisa_address(addr); - memset((char *)waddr, val, fraglen); - addr += fraglen; - waddr = waddr + fraglen - 0x1000000; - len -= fraglen; - } -} - -static void jazz_memcpy_fromio(unsigned long to, unsigned long from, unsigned long len) -{ - unsigned long waddr; - - waddr = JAZZ_EISA_BASE | (from & 0xffffff); - while(len) { - unsigned long fraglen; - - fraglen = (~from + 1) & 0xffffff; - fraglen = (fraglen < len) ? fraglen : len; - map_eisa_address(from); - memcpy((void *)to, (void *)waddr, fraglen); - to += fraglen; - from += fraglen; - waddr = waddr + fraglen - 0x1000000; - len -= fraglen; - } -} - -static void jazz_memcpy_toio(unsigned long to, unsigned long from, unsigned long len) -{ - unsigned long waddr; - - waddr = JAZZ_EISA_BASE | (to & 0xffffff); - while(len) { - unsigned long fraglen; - - fraglen = (~to + 1) & 0xffffff; - fraglen = (fraglen < len) ? fraglen : len; - map_eisa_address(to); - memcpy((char *)to + JAZZ_EISA_BASE, (void *)from, fraglen); - to += fraglen; - from += fraglen; - waddr = waddr + fraglen - 0x1000000; - len -= fraglen; - } -} From f5dbeaf5ed3938beea8e58ee473982a4bcadc172 Mon Sep 17 00:00:00 2001 From: David Rientjes Date: Sun, 22 Jul 2007 01:01:39 -0700 Subject: [PATCH 04/10] [MIPS] Replace __attribute_used__ with __used Replaces the deprecated __attribute_used__ with __used. Also makes some style adjustments to abide by the kernel coding conventions. Cc: Ralf Baechle Signed-off-by: David Rientjes Signed-off-by: Ralf Baechle --- arch/mips/kernel/gdb-stub.c | 4 ++-- arch/mips/kernel/linux32.c | 2 +- arch/mips/kernel/rtlx.c | 2 +- arch/mips/kernel/syscall.c | 4 ++-- arch/mips/kernel/vpe.c | 3 +-- arch/mips/mm/c-sb1.c | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c index 7bc88204926..cb5623aad55 100644 --- a/arch/mips/kernel/gdb-stub.c +++ b/arch/mips/kernel/gdb-stub.c @@ -1099,12 +1099,12 @@ void adel(void) * malloc is needed by gdb client in "call func()", even a private one * will make gdb happy */ -static void * __attribute_used__ malloc(size_t size) +static void __used *malloc(size_t size) { return kmalloc(size, GFP_ATOMIC); } -static void __attribute_used__ free (void *where) +static void __used free(void *where) { kfree(where); } diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index 06e04da211d..c37568d6fb5 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c @@ -567,7 +567,7 @@ asmlinkage long sys32_fadvise64_64(int fd, int __pad, } save_static_function(sys32_clone); -__attribute_used__ noinline static int +static int noinline __used _sys32_clone(nabi_no_regargs struct pt_regs regs) { unsigned long clone_flags; diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index bfc8ca168f8..8cf24d716d4 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c @@ -85,7 +85,7 @@ static irqreturn_t rtlx_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static __attribute_used__ void dump_rtlx(void) +static void __used dump_rtlx(void) { int i; diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index b947c61c0cc..b53f7edbc15 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -167,14 +167,14 @@ sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, } save_static_function(sys_fork); -__attribute_used__ noinline static int +static int __used noinline _sys_fork(nabi_no_regargs struct pt_regs regs) { return do_fork(SIGCHLD, regs.regs[29], ®s, 0, NULL, NULL); } save_static_function(sys_clone); -__attribute_used__ noinline static int +static int __used noinline _sys_clone(nabi_no_regargs struct pt_regs regs) { unsigned long clone_flags; diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 9e66354dee8..a2bee10f04c 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c @@ -154,7 +154,6 @@ struct { }; static void release_progmem(void *ptr); -/* static __attribute_used__ void dump_vpe(struct vpe * v); */ extern void save_gp_address(unsigned int secbase, unsigned int rel); /* get the vpe associated with this minor */ @@ -1024,7 +1023,7 @@ static int vpe_elfload(struct vpe * v) return 0; } -__attribute_used__ void dump_vpe(struct vpe * v) +void __used dump_vpe(struct vpe * v) { struct tc *t; diff --git a/arch/mips/mm/c-sb1.c b/arch/mips/mm/c-sb1.c index 6f9bd7fbd48..85ce2842d0d 100644 --- a/arch/mips/mm/c-sb1.c +++ b/arch/mips/mm/c-sb1.c @@ -272,7 +272,7 @@ void sb1_flush_cache_data_page(unsigned long) /* * Invalidate all caches on this CPU */ -static void __attribute_used__ local_sb1___flush_cache_all(void) +static void __used local_sb1___flush_cache_all(void) { __sb1_writeback_inv_dcache_all(); __sb1_flush_icache_all(); From 4614c32645c536e30eaf895c7e0cd42dfb145634 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Tue, 1 May 2007 01:49:20 +0900 Subject: [PATCH 05/10] [MIPS] Make resources for ds1742 "static __initdata" We can make resources for platform_device_register_simple() "static __initdata". Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- arch/mips/jmr3927/rbhma3100/setup.c | 2 +- arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/jmr3927/rbhma3100/setup.c b/arch/mips/jmr3927/rbhma3100/setup.c index d1ef2895d56..8303001516d 100644 --- a/arch/mips/jmr3927/rbhma3100/setup.c +++ b/arch/mips/jmr3927/rbhma3100/setup.c @@ -434,7 +434,7 @@ EXPORT_SYMBOL(__swizzle_addr_b); static int __init jmr3927_rtc_init(void) { - struct resource res = { + static struct resource __initdata res = { .start = JMR3927_IOC_NVRAMB_ADDR - IO_BASE, .end = JMR3927_IOC_NVRAMB_ADDR - IO_BASE + 0x800 - 1, .flags = IORESOURCE_MEM, diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c index 40c7c3eeafa..ab72292a172 100644 --- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c +++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c @@ -1020,7 +1020,7 @@ void __init toshiba_rbtx4927_timer_setup(struct irqaction *irq) static int __init toshiba_rbtx4927_rtc_init(void) { - struct resource res = { + static struct resource __initdata res = { .start = 0x1c010000, .end = 0x1c010000 + 0x800 - 1, .flags = IORESOURCE_MEM, From eeea55163dac3e891558253751fcbfa0815a2e1a Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 24 Jul 2007 16:02:47 +0100 Subject: [PATCH 06/10] [MIPS] Whitespace cleanup. Signed-off-by: Ralf Baechle --- include/asm-mips/war.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h index 9de52a5b0f3..2883ccc69ed 100644 --- a/include/asm-mips/war.h +++ b/include/asm-mips/war.h @@ -188,7 +188,6 @@ #define ICACHE_REFILLS_WORKAROUND_WAR 1 #endif - /* * On the R10000 upto version 2.6 (not sure about 2.7) there is a bug that * may cause ll / sc and lld / scd sequences to execute non-atomically. From 34ec6e76a6354b04df3d2e94cd34d27af76a07bc Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Sun, 22 Jul 2007 13:06:49 +0900 Subject: [PATCH 07/10] [MIPS] Jazz: remove unneeded reset functions Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- arch/mips/jazz/reset.c | 13 ------------- arch/mips/jazz/setup.c | 4 ---- 2 files changed, 17 deletions(-) diff --git a/arch/mips/jazz/reset.c b/arch/mips/jazz/reset.c index 2a9754750bc..d8ade85060b 100644 --- a/arch/mips/jazz/reset.c +++ b/arch/mips/jazz/reset.c @@ -6,10 +6,6 @@ */ #include #include -#include -#include -#include -#include #define KBD_STAT_IBF 0x02 /* Keyboard input buffer full */ @@ -58,12 +54,3 @@ void jazz_machine_restart(char *command) jazz_write_output (0x00); } } - -void jazz_machine_halt(void) -{ -} - -void jazz_machine_power_off(void) -{ - /* Jazz machines don't have a software power switch */ -} diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c index 81ec559a1c2..798279e0669 100644 --- a/arch/mips/jazz/setup.c +++ b/arch/mips/jazz/setup.c @@ -34,8 +34,6 @@ extern asmlinkage void jazz_handle_int(void); extern void jazz_machine_restart(char *command); -extern void jazz_machine_halt(void); -extern void jazz_machine_power_off(void); void __init plat_timer_setup(struct irqaction *irq) { @@ -95,8 +93,6 @@ void __init plat_mem_setup(void) /* The RTC is outside the port address space */ _machine_restart = jazz_machine_restart; - _machine_halt = jazz_machine_halt; - pm_power_off = jazz_machine_power_off; screen_info = (struct screen_info) { 0, 0, /* orig-x, orig-y */ From cbe7b45c1d0fbf51eea19452ffb56aa3002fe90c Mon Sep 17 00:00:00 2001 From: Thomas Bogendoerfer Date: Tue, 24 Jul 2007 03:49:27 +0200 Subject: [PATCH 08/10] [MIPS] SNI: sniprom - fix compile error due to missing #include - fix section mismatch warning Signed-off-by: Thomas Bogendoerfer Signed-off-by: Ralf Baechle --- arch/mips/sni/sniprom.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/mips/sni/sniprom.c b/arch/mips/sni/sniprom.c index 00a03a6e8f5..db544a6e23f 100644 --- a/arch/mips/sni/sniprom.c +++ b/arch/mips/sni/sniprom.c @@ -19,6 +19,7 @@ #include #include #include +#include #include /* special SNI prom calls */ @@ -71,7 +72,7 @@ const char *get_system_type(void) #define SNI_IDPROM_SIZE 0x1000 #ifdef DEBUG -static void sni_idprom_dump(void) +static void __init sni_idprom_dump(void) { int i; @@ -88,7 +89,7 @@ static void sni_idprom_dump(void) } #endif -static void sni_mem_init(void ) +static void __init sni_mem_init(void ) { int i, memsize; struct membank { From 18d0e9b4799ff6e43613a068eba289ba4e002535 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Tue, 24 Jul 2007 16:38:04 +0900 Subject: [PATCH 09/10] [MIPS] ARC: Remove unused arch/mips/arc/console.c Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- arch/mips/arc/console.c | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 arch/mips/arc/console.c diff --git a/arch/mips/arc/console.c b/arch/mips/arc/console.c deleted file mode 100644 index 0fe6032999c..00000000000 --- a/arch/mips/arc/console.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1996 David S. Miller (dm@sgi.com) - * Compability with board caches, Ulf Carlsson - */ -#include -#include -#include - -/* - * IP22 boardcache is not compatible with board caches. Thus we disable it - * during romvec action. Since r4xx0.c is always compiled and linked with your - * kernel, this shouldn't cause any harm regardless what MIPS processor you - * have. - * - * The ARC write and read functions seem to interfere with the serial lines - * in some way. You should be careful with them. - */ - -void prom_putchar(char c) -{ - ULONG cnt; - CHAR it = c; - - bc_disable(); - ArcWrite(1, &it, 1, &cnt); - bc_enable(); -} From cdcc9eb5e014a58aba047193a73a0de8b61b988d Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Mon, 23 Jul 2007 00:07:34 +0900 Subject: [PATCH 10/10] [MIPS] Fix marge error due to conflict in arch/mips/kernel/head.S __INIT directive just before kernel_entry was ignored for most platforms. This patch fixes it and get rid of this warning: WARNING: vmlinux.o(.text+0x478): Section mismatch: reference to .init.text:start_kernel (between '_stext' and 'run_init_process') Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- arch/mips/kernel/head.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index f78538eceef..c15bbc436bb 100644 --- a/arch/mips/kernel/head.S +++ b/arch/mips/kernel/head.S @@ -141,7 +141,7 @@ EXPORT(stext) # used for profiling EXPORT(_stext) -#ifdef CONFIG_BOOT_RAW +#ifndef CONFIG_BOOT_RAW /* * Give us a fighting chance of running if execution beings at the * kernel load address. This is needed because this platform does