From ee4f96d0f02cda38dd22538bbd595742b2bfd089 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Wed, 31 Jul 2013 11:34:27 +0800 Subject: [PATCH 1/7] openrisc: Makefile: append "-D__linux__" to KBUILD_CFLAGS Need append "_D__linux__" to KBUILD_CFLAGS, just like some of another architectures have done, or 'allmodconfig' can not pass compiling. The related error: CC [M] fs/coda/psdev.o In file included from include/linux/coda.h:65:0, from fs/coda/psdev.c:45: include/uapi/linux/coda.h:221:2: error: expected specifier-qualifier-list before 'u_quad_t' The related compiler information: [root@dhcp122 ~]# /usr/local/bin/or32-linux-gcc -v Using built-in specs. COLLECT_GCC=/usr/local/bin/or32-linux-gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/or32-linux/4.5.1-or32-1.0rc1/lto-wrapper Target: or32-linux Configured with: ../gcc-openrisc/configure --target=or32-linux --disable-nls --enable-languages=c --without-headers --disable-shared --disable-threads --enable-werror=no Thread model: single gcc version 4.5.1-or32-1.0rc1 (GCC) Signed-off-by: Chen Gang Signed-off-by: Jonas Bonn --- arch/openrisc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/openrisc/Makefile b/arch/openrisc/Makefile index 4739b8302a58..89076a66eee2 100644 --- a/arch/openrisc/Makefile +++ b/arch/openrisc/Makefile @@ -24,7 +24,7 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S LDFLAGS_vmlinux := LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) -KBUILD_CFLAGS += -pipe -ffixed-r10 +KBUILD_CFLAGS += -pipe -ffixed-r10 -D__linux__ ifeq ($(CONFIG_OPENRISC_HAVE_INST_MUL),y) KBUILD_CFLAGS += $(call cc-option,-mhard-mul) From f69405ce6c0fc9f4a039011007371b31f80b470d Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Tue, 30 Jul 2013 15:58:11 +0800 Subject: [PATCH 2/7] openrisc: include: asm: Kbuild: add default "vga.h" Add default "vga.h", or compiling fails with 'allmodconfig'. The related error: CC [M] drivers/gpu/drm/drm_irq.o In file included from include/linux/vgaarb.h:34:0, from drivers/gpu/drm/drm_irq.c:42: include/video/vga.h:22:21: fatal error: asm/vga.h: No such file or directory compilation terminated. make[3]: *** [drivers/gpu/drm/drm_irq.o] Error 1 make[2]: *** [drivers/gpu/drm] Error 2 make[1]: *** [drivers/gpu] Error 2 make: *** [drivers] Error 2 Signed-off-by: Chen Gang Signed-off-by: Jonas Bonn --- arch/openrisc/include/asm/Kbuild | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild index 195653e851da..6bdc2701f028 100644 --- a/arch/openrisc/include/asm/Kbuild +++ b/arch/openrisc/include/asm/Kbuild @@ -65,5 +65,6 @@ generic-y += trace_clock.h generic-y += types.h generic-y += ucontext.h generic-y += user.h +generic-y += vga.h generic-y += word-at-a-time.h generic-y += xor.h From 56aea88df7b3930b3010488bdf9d1796bb051fb1 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 25 Oct 2013 16:37:56 +0200 Subject: [PATCH 3/7] openrisc: Refactor 16-bit constant relocation arch/openrisc/kernel/module.c: In function 'apply_relocate_add': arch/openrisc/kernel/module.c:50:13: warning: assignment from incompatible pointer type arch/openrisc/kernel/module.c:54:13: warning: assignment from incompatible pointer type Move the pointer increments to the dereference statements to avoid incompatible pointer assignments, and remove superfluous casts. Signed-off-by: Geert Uytterhoeven Signed-off-by: Jonas Bonn --- arch/openrisc/kernel/module.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/openrisc/kernel/module.c b/arch/openrisc/kernel/module.c index 10ff50f0202a..ef872ae4c878 100644 --- a/arch/openrisc/kernel/module.c +++ b/arch/openrisc/kernel/module.c @@ -47,12 +47,10 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, *location = value; break; case R_OR32_CONST: - location = (uint16_t *)location + 1; - *((uint16_t *)location) = (uint16_t) (value); + *((uint16_t *)location + 1) = value; break; case R_OR32_CONSTH: - location = (uint16_t *)location + 1; - *((uint16_t *)location) = (uint16_t) (value >> 16); + *((uint16_t *)location + 1) = value >> 16; break; case R_OR32_JUMPTARG: value -= (uint32_t)location; From f38d45dd5a0c05b7ae9c0fc1c5b2e7f69b4bfcfb Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 14 Nov 2013 23:08:04 +0100 Subject: [PATCH 4/7] openrisc: Refresh or1ksim_defconfig for v3.12 Signed-off-by: Geert Uytterhoeven Signed-off-by: Jonas Bonn --- arch/openrisc/configs/or1ksim_defconfig | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/openrisc/configs/or1ksim_defconfig b/arch/openrisc/configs/or1ksim_defconfig index ea172bdfa36a..42fe5303a370 100644 --- a/arch/openrisc/configs/or1ksim_defconfig +++ b/arch/openrisc/configs/or1ksim_defconfig @@ -1,9 +1,9 @@ CONFIG_CROSS_COMPILE="or32-linux-" +CONFIG_NO_HZ=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_BLK_DEV_INITRD=y # CONFIG_RD_GZIP is not set CONFIG_EXPERT=y -# CONFIG_SYSCTL_SYSCALL is not set # CONFIG_KALLSYMS is not set # CONFIG_EPOLL is not set # CONFIG_TIMERFD is not set @@ -15,7 +15,6 @@ CONFIG_SLOB=y CONFIG_MODULES=y # CONFIG_BLOCK is not set CONFIG_OPENRISC_BUILTIN_DTB="or1ksim" -CONFIG_NO_HZ=y CONFIG_HZ_100=y CONFIG_NET=y CONFIG_PACKET=y @@ -39,11 +38,8 @@ CONFIG_DEVTMPFS_MOUNT=y # CONFIG_FW_LOADER is not set CONFIG_PROC_DEVICETREE=y CONFIG_NETDEVICES=y -CONFIG_MICREL_PHY=y -CONFIG_NET_ETHERNET=y CONFIG_ETHOC=y -# CONFIG_NETDEV_1000 is not set -# CONFIG_NETDEV_10000 is not set +CONFIG_MICREL_PHY=y # CONFIG_WLAN is not set # CONFIG_INPUT is not set # CONFIG_SERIO is not set @@ -55,11 +51,9 @@ CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y # CONFIG_HW_RANDOM is not set # CONFIG_HWMON is not set -# CONFIG_MFD_SUPPORT is not set # CONFIG_USB_SUPPORT is not set # CONFIG_DNOTIFY is not set CONFIG_TMPFS=y CONFIG_NFS_FS=y -CONFIG_NFS_V3=y # CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_MUST_CHECK is not set From be5940c9fd2fa1905fab4353bb9c7051d088d824 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 12 Nov 2013 20:56:20 +0100 Subject: [PATCH 5/7] openrisc: Use the declarations provided by Openrisc's private vmlinux.h duplicates a few definitions that are already provided by asm-generic/sections.h. The former is used by setup.c only, while the latter is already used everywhere else. Convert setup.c to use the generic version: - Include , - Remove the (slightly different) extern declarations, - Remove the no longer needed address-of ('&') operators. Signed-off-by: Geert Uytterhoeven Signed-off-by: Jonas Bonn --- arch/openrisc/kernel/setup.c | 11 ++++++----- arch/openrisc/kernel/vmlinux.h | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index d7359ffbcbdd..89c497813bab 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -77,7 +78,7 @@ static unsigned long __init setup_memory(void) ram_start_pfn = PFN_UP(memory_start); /* free_ram_start_pfn is first page after kernel */ - free_ram_start_pfn = PFN_UP(__pa(&_end)); + free_ram_start_pfn = PFN_UP(__pa(_end)); ram_end_pfn = PFN_DOWN(memblock_end_of_DRAM()); max_pfn = ram_end_pfn; @@ -290,10 +291,10 @@ void __init setup_arch(char **cmdline_p) setup_cpuinfo(); /* process 1's initial memory region is the kernel code/data */ - init_mm.start_code = (unsigned long)&_stext; - init_mm.end_code = (unsigned long)&_etext; - init_mm.end_data = (unsigned long)&_edata; - init_mm.brk = (unsigned long)&_end; + init_mm.start_code = (unsigned long)_stext; + init_mm.end_code = (unsigned long)_etext; + init_mm.end_data = (unsigned long)_edata; + init_mm.brk = (unsigned long)_end; #ifdef CONFIG_BLK_DEV_INITRD initrd_start = (unsigned long)&__initrd_start; diff --git a/arch/openrisc/kernel/vmlinux.h b/arch/openrisc/kernel/vmlinux.h index ee842a2d3f36..3f7b2b23a439 100644 --- a/arch/openrisc/kernel/vmlinux.h +++ b/arch/openrisc/kernel/vmlinux.h @@ -1,7 +1,6 @@ #ifndef __OPENRISC_VMLINUX_H_ #define __OPENRISC_VMLINUX_H_ -extern char _stext, _etext, _edata, _end; #ifdef CONFIG_BLK_DEV_INITRD extern char __initrd_start, __initrd_end; extern char __initramfs_start; From 0db041be3be9c84c2949a4f7eb9c3b6cd80ae97c Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 12 Nov 2013 20:56:21 +0100 Subject: [PATCH 6/7] openrisc: Remove unused declaration of __initramfs_start Signed-off-by: Geert Uytterhoeven Signed-off-by: Jonas Bonn --- arch/openrisc/kernel/vmlinux.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/openrisc/kernel/vmlinux.h b/arch/openrisc/kernel/vmlinux.h index 3f7b2b23a439..70b9ce41835c 100644 --- a/arch/openrisc/kernel/vmlinux.h +++ b/arch/openrisc/kernel/vmlinux.h @@ -3,7 +3,6 @@ #ifdef CONFIG_BLK_DEV_INITRD extern char __initrd_start, __initrd_end; -extern char __initramfs_start; #endif extern u32 __dtb_start[]; From 621c2cd853fca98258b720d9fe7e8c031ec7f96f Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 12 Nov 2013 20:42:23 +0100 Subject: [PATCH 7/7] openrisc: Refactor or32_early_setup() - Change fdt pointer (passed from head.S) from unsigned int to void *, which allows to kill a cast, and makes it compatible with __dtb_start. - Use pr_info(), - Extract common part. Signed-off-by: Geert Uytterhoeven Cc: linux@lists.openrisc.net Signed-off-by: Jonas Bonn --- arch/openrisc/kernel/setup.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index 89c497813bab..7d205be45913 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -210,15 +210,15 @@ void __init setup_cpuinfo(void) * Falls back on built-in device tree in case null pointer is passed. */ -void __init or32_early_setup(unsigned int fdt) +void __init or32_early_setup(void *fdt) { - if (fdt) { - early_init_devtree((void*) fdt); - printk(KERN_INFO "FDT at 0x%08x\n", fdt); - } else { - early_init_devtree(__dtb_start); - printk(KERN_INFO "Compiled-in FDT at %p\n", __dtb_start); + if (fdt) + pr_info("FDT at %p\n", fdt); + else { + fdt = __dtb_start; + pr_info("Compiled-in FDT at %p\n", fdt); } + early_init_devtree(fdt); } static int __init openrisc_device_probe(void)