Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

OpenRISC: Build infrastructure

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>

+545
+207
arch/openrisc/Kconfig
··· 1 + # 2 + # For a description of the syntax of this configuration file, 3 + # see Documentation/kbuild/config-language.txt. 4 + # 5 + 6 + config OPENRISC 7 + def_bool y 8 + select OF 9 + select OF_EARLY_FLATTREE 10 + select HAVE_MEMBLOCK 11 + select ARCH_WANT_OPTIONAL_GPIOLIB 12 + select HAVE_ARCH_TRACEHOOK 13 + select HAVE_GENERIC_HARDIRQS 14 + select GENERIC_IRQ_CHIP 15 + select GENERIC_IRQ_PROBE 16 + select GENERIC_IRQ_SHOW 17 + select GENERIC_IOMAP 18 + 19 + config MMU 20 + def_bool y 21 + 22 + config WISHBONE_BUS_BIG_ENDIAN 23 + def_bool y 24 + 25 + config SYMBOL_PREFIX 26 + string 27 + default "" 28 + 29 + config HAVE_DMA_ATTRS 30 + def_bool y 31 + 32 + config UID16 33 + def_bool y 34 + 35 + config RWSEM_GENERIC_SPINLOCK 36 + def_bool y 37 + 38 + config RWSEM_XCHGADD_ALGORITHM 39 + def_bool n 40 + 41 + config GENERIC_HWEIGHT 42 + def_bool y 43 + 44 + config GENERIC_IOMAP 45 + def_bool y 46 + 47 + config NO_IOPORT 48 + def_bool y 49 + 50 + config GENERIC_GPIO 51 + def_bool y 52 + 53 + config GENERIC_CLOCKEVENTS 54 + def_bool y 55 + 56 + config TRACE_IRQFLAGS_SUPPORT 57 + def_bool y 58 + 59 + # For now, use generic checksum functions 60 + #These can be reimplemented in assembly later if so inclined 61 + config GENERIC_CSUM 62 + def_bool y 63 + 64 + config GENERIC_FIND_NEXT_BIT 65 + def_bool y 66 + 67 + source "init/Kconfig" 68 + 69 + 70 + menu "Processor type and features" 71 + 72 + choice 73 + prompt "Subarchitecture" 74 + default OR1K_1200 75 + 76 + config OR1K_1200 77 + bool "OR1200" 78 + help 79 + Generic OpenRISC 1200 architecture 80 + 81 + endchoice 82 + 83 + config OPENRISC_BUILTIN_DTB 84 + string "Builtin DTB" 85 + default "" 86 + 87 + menu "Class II Instructions" 88 + 89 + config OPENRISC_HAVE_INST_FF1 90 + bool "Have instruction l.ff1" 91 + default y 92 + help 93 + Select this if your implementation has the Class II instruction l.ff1 94 + 95 + config OPENRISC_HAVE_INST_FL1 96 + bool "Have instruction l.fl1" 97 + default y 98 + help 99 + Select this if your implementation has the Class II instruction l.fl1 100 + 101 + config OPENRISC_HAVE_INST_MUL 102 + bool "Have instruction l.mul for hardware multiply" 103 + default y 104 + help 105 + Select this if your implementation has a hardware multiply instruction 106 + 107 + config OPENRISC_HAVE_INST_DIV 108 + bool "Have instruction l.div for hardware divide" 109 + default y 110 + help 111 + Select this if your implementation has a hardware divide instruction 112 + endmenu 113 + 114 + 115 + source "kernel/time/Kconfig" 116 + source kernel/Kconfig.hz 117 + source kernel/Kconfig.preempt 118 + source "mm/Kconfig" 119 + 120 + config OPENRISC_NO_SPR_SR_DSX 121 + bool "use SPR_SR_DSX software emulation" if OR1K_1200 122 + default y 123 + help 124 + SPR_SR_DSX bit is status register bit indicating whether 125 + the last exception has happened in delay slot. 126 + 127 + OpenRISC architecture makes it optional to have it implemented 128 + in hardware and the OR1200 does not have it. 129 + 130 + Say N here if you know that your OpenRISC processor has 131 + SPR_SR_DSX bit implemented. Say Y if you are unsure. 132 + 133 + config CMDLINE 134 + string "Default kernel command string" 135 + default "" 136 + help 137 + On some architectures there is currently no way for the boot loader 138 + to pass arguments to the kernel. For these architectures, you should 139 + supply some command-line options at build time by entering them 140 + here. 141 + 142 + menu "Debugging options" 143 + 144 + config DEBUG_STACKOVERFLOW 145 + bool "Check for kernel stack overflow" 146 + default y 147 + help 148 + Make extra checks for space avaliable on stack in some 149 + critical functions. This will cause kernel to run a bit slower, 150 + but will catch most of kernel stack overruns and exit gracefuly. 151 + 152 + Say Y if you are unsure. 153 + 154 + config JUMP_UPON_UNHANDLED_EXCEPTION 155 + bool "Try to die gracefully" 156 + default y 157 + help 158 + Now this puts kernel into infinite loop after first oops. Till 159 + your kernel crashes this doesn't have any influence. 160 + 161 + Say Y if you are unsure. 162 + 163 + config OPENRISC_EXCEPTION_DEBUG 164 + bool "Print processor state at each exception" 165 + default n 166 + help 167 + This option will make your kernel unusable for all but kernel 168 + debugging. 169 + 170 + Say N if you are unsure. 171 + 172 + config OPENRISC_ESR_EXCEPTION_BUG_CHECK 173 + bool "Check for possible ESR exception bug" 174 + default n 175 + help 176 + This option enables some checks that might expose some problems 177 + in kernel. 178 + 179 + Say N if you are unsure. 180 + 181 + endmenu 182 + 183 + endmenu 184 + 185 + menu "Executable file formats" 186 + 187 + source "fs/Kconfig.binfmt" 188 + 189 + endmenu 190 + 191 + source "net/Kconfig" 192 + 193 + source "drivers/Kconfig" 194 + 195 + source "fs/Kconfig" 196 + 197 + source "security/Kconfig" 198 + 199 + source "crypto/Kconfig" 200 + 201 + source "lib/Kconfig" 202 + 203 + menu "Kernel hacking" 204 + 205 + source "lib/Kconfig.debug" 206 + 207 + endmenu
+55
arch/openrisc/Makefile
··· 1 + # BK Id: %F% %I% %G% %U% %#% 2 + # 3 + # This file is included by the global makefile so that you can add your own 4 + # architecture-specific flags and dependencies. Remember to do have actions 5 + # for "archclean" and "archdep" for cleaning up and making dependencies for 6 + # this architecture 7 + # 8 + # This file is subject to the terms and conditions of the GNU General Public 9 + # License. See the file "COPYING" in the main directory of this archive 10 + # for more details. 11 + # 12 + # Copyright (C) 1994 by Linus Torvalds 13 + # Modifications for the OpenRISC architecture: 14 + # Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com> 15 + # Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se> 16 + # 17 + # Based on: 18 + # arch/i386/Makefile 19 + 20 + KBUILD_DEFCONFIG := or1ksim_defconfig 21 + 22 + LDFLAGS := 23 + OBJCOPYFLAGS := -O binary -R .note -R .comment -S 24 + LDFLAGS_vmlinux := 25 + LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) 26 + 27 + KBUILD_CFLAGS += -pipe -ffixed-r10 28 + 29 + ifeq ($(CONFIG_OPENRISC_HAVE_INST_MUL),y) 30 + KBUILD_CFLAGS += $(call cc-option,-mhard-mul) 31 + else 32 + KBUILD_CFLAGS += $(call cc-option,-msoft-mul) 33 + endif 34 + 35 + ifeq ($(CONFIG_OPENRISC_HAVE_INST_DIV),y) 36 + KBUILD_CFLAGS += $(call cc-option,-mhard-div) 37 + else 38 + KBUILD_CFLAGS += $(call cc-option,-msoft-div) 39 + endif 40 + 41 + head-y := arch/openrisc/kernel/head.o arch/openrisc/kernel/init_task.o 42 + 43 + core-y += arch/openrisc/lib/ \ 44 + arch/openrisc/kernel/ \ 45 + arch/openrisc/mm/ 46 + libs-y += $(LIBGCC) 47 + 48 + ifneq '$(CONFIG_OPENRISC_BUILTIN_DTB)' '""' 49 + BUILTIN_DTB := y 50 + else 51 + BUILTIN_DTB := n 52 + endif 53 + core-$(BUILTIN_DTB) += arch/openrisc/boot/ 54 + 55 + all: vmlinux
+15
arch/openrisc/boot/Makefile
··· 1 + 2 + 3 + ifneq '$(CONFIG_OPENRISC_BUILTIN_DTB)' '""' 4 + BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_OPENRISC_BUILTIN_DTB)).dtb.o 5 + else 6 + BUILTIN_DTB := 7 + endif 8 + obj-y += $(BUILTIN_DTB) 9 + 10 + clean-files := *.dtb.S 11 + 12 + #DTC_FLAGS ?= -p 1024 13 + 14 + $(obj)/%.dtb: $(src)/dts/%.dts 15 + $(call cmd,dtc)
+65
arch/openrisc/configs/or1ksim_defconfig
··· 1 + CONFIG_CROSS_COMPILE="or32-linux-" 2 + CONFIG_LOG_BUF_SHIFT=14 3 + CONFIG_BLK_DEV_INITRD=y 4 + # CONFIG_RD_GZIP is not set 5 + CONFIG_EXPERT=y 6 + # CONFIG_SYSCTL_SYSCALL is not set 7 + # CONFIG_KALLSYMS is not set 8 + # CONFIG_EPOLL is not set 9 + # CONFIG_TIMERFD is not set 10 + # CONFIG_EVENTFD is not set 11 + # CONFIG_AIO is not set 12 + # CONFIG_VM_EVENT_COUNTERS is not set 13 + # CONFIG_COMPAT_BRK is not set 14 + CONFIG_SLOB=y 15 + CONFIG_MODULES=y 16 + # CONFIG_BLOCK is not set 17 + CONFIG_OPENRISC_BUILTIN_DTB="or1ksim" 18 + CONFIG_NO_HZ=y 19 + CONFIG_HZ_100=y 20 + CONFIG_NET=y 21 + CONFIG_PACKET=y 22 + CONFIG_UNIX=y 23 + CONFIG_INET=y 24 + # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 25 + # CONFIG_INET_XFRM_MODE_TUNNEL is not set 26 + # CONFIG_INET_XFRM_MODE_BEET is not set 27 + # CONFIG_INET_LRO is not set 28 + # CONFIG_INET_DIAG is not set 29 + CONFIG_TCP_CONG_ADVANCED=y 30 + # CONFIG_TCP_CONG_BIC is not set 31 + # CONFIG_TCP_CONG_CUBIC is not set 32 + # CONFIG_TCP_CONG_WESTWOOD is not set 33 + # CONFIG_TCP_CONG_HTCP is not set 34 + # CONFIG_IPV6 is not set 35 + # CONFIG_WIRELESS is not set 36 + CONFIG_DEVTMPFS=y 37 + CONFIG_DEVTMPFS_MOUNT=y 38 + # CONFIG_PREVENT_FIRMWARE_BUILD is not set 39 + # CONFIG_FW_LOADER is not set 40 + CONFIG_PROC_DEVICETREE=y 41 + CONFIG_NETDEVICES=y 42 + CONFIG_MICREL_PHY=y 43 + CONFIG_NET_ETHERNET=y 44 + CONFIG_ETHOC=y 45 + # CONFIG_NETDEV_1000 is not set 46 + # CONFIG_NETDEV_10000 is not set 47 + # CONFIG_WLAN is not set 48 + # CONFIG_INPUT is not set 49 + # CONFIG_SERIO is not set 50 + # CONFIG_VT is not set 51 + # CONFIG_LEGACY_PTYS is not set 52 + # CONFIG_DEVKMEM is not set 53 + CONFIG_SERIAL_8250=y 54 + CONFIG_SERIAL_8250_CONSOLE=y 55 + CONFIG_SERIAL_OF_PLATFORM=y 56 + # CONFIG_HW_RANDOM is not set 57 + # CONFIG_HWMON is not set 58 + # CONFIG_MFD_SUPPORT is not set 59 + # CONFIG_USB_SUPPORT is not set 60 + # CONFIG_DNOTIFY is not set 61 + CONFIG_TMPFS=y 62 + CONFIG_NFS_FS=y 63 + CONFIG_NFS_V3=y 64 + # CONFIG_ENABLE_WARN_DEPRECATED is not set 65 + # CONFIG_ENABLE_MUST_CHECK is not set
+64
arch/openrisc/include/asm/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm 2 + 3 + header-y += spr_defs.h 4 + 5 + generic-y += atomic.h 6 + generic-y += auxvec.h 7 + generic-y += bitsperlong.h 8 + generic-y += bug.h 9 + generic-y += bugs.h 10 + generic-y += cacheflush.h 11 + generic-y += checksum.h 12 + generic-y += cmpxchg.h 13 + generic-y += cmpxchg-local.h 14 + generic-y += cpumask.h 15 + generic-y += cputime.h 16 + generic-y += current.h 17 + generic-y += device.h 18 + generic-y += div64.h 19 + generic-y += dma.h 20 + generic-y += emergency-restart.h 21 + generic-y += errno.h 22 + generic-y += fb.h 23 + generic-y += fcntl.h 24 + generic-y += ftrace.h 25 + generic-y += futex.h 26 + generic-y += hardirq.h 27 + generic-y += hw_irq.h 28 + generic-y += ioctl.h 29 + generic-y += ioctls.h 30 + generic-y += ipcbuf.h 31 + generic-y += irq_regs.h 32 + generic-y += kdebug.h 33 + generic-y += kmap_types.h 34 + generic-y += local.h 35 + generic-y += mman.h 36 + generic-y += module.h 37 + generic-y += msgbuf.h 38 + generic-y += pci.h 39 + generic-y += percpu.h 40 + generic-y += poll.h 41 + generic-y += posix_types.h 42 + generic-y += resource.h 43 + generic-y += rmap.h 44 + generic-y += scatterlist.h 45 + generic-y += sections.h 46 + generic-y += segment.h 47 + generic-y += sembuf.h 48 + generic-y += setup.h 49 + generic-y += shmbuf.h 50 + generic-y += shmparam.h 51 + generic-y += siginfo.h 52 + generic-y += signal.h 53 + generic-y += socket.h 54 + generic-y += sockios.h 55 + generic-y += statfs.h 56 + generic-y += stat.h 57 + generic-y += string.h 58 + generic-y += swab.h 59 + generic-y += termbits.h 60 + generic-y += termios.h 61 + generic-y += topology.h 62 + generic-y += types.h 63 + generic-y += ucontext.h 64 + generic-y += user.h
+14
arch/openrisc/kernel/Makefile
··· 1 + # 2 + # Makefile for the linux kernel. 3 + # 4 + 5 + extra-y := head.o vmlinux.lds init_task.o 6 + 7 + obj-y := setup.o idle.o or32_ksyms.o process.o dma.o \ 8 + traps.o time.o irq.o entry.o ptrace.o signal.o sys_or32.o \ 9 + sys_call_table.o 10 + 11 + obj-$(CONFIG_MODULES) += module.o 12 + obj-$(CONFIG_OF) += prom.o 13 + 14 + clean:
+115
arch/openrisc/kernel/vmlinux.lds.S
··· 1 + /* 2 + * OpenRISC vmlinux.lds.S 3 + * 4 + * Linux architectural port borrowing liberally from similar works of 5 + * others. All original copyrights apply as per the original source 6 + * declaration. 7 + * 8 + * Modifications for the OpenRISC architecture: 9 + * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com> 10 + * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se> 11 + * 12 + * This program is free software; you can redistribute it and/or 13 + * modify it under the terms of the GNU General Public License 14 + * as published by the Free Software Foundation; either version 15 + * 2 of the License, or (at your option) any later version. 16 + * 17 + * ld script for OpenRISC architecture 18 + */ 19 + 20 + /* TODO 21 + * - clean up __offset & stuff 22 + * - change all 8192 aligment to PAGE !!! 23 + * - recheck if all aligments are really needed 24 + */ 25 + 26 + # define LOAD_OFFSET PAGE_OFFSET 27 + # define LOAD_BASE PAGE_OFFSET 28 + 29 + #include <asm/page.h> 30 + #include <asm/cache.h> 31 + #include <asm-generic/vmlinux.lds.h> 32 + 33 + OUTPUT_FORMAT("elf32-or32", "elf32-or32", "elf32-or32") 34 + jiffies = jiffies_64 + 4; 35 + 36 + SECTIONS 37 + { 38 + /* Read-only sections, merged into text segment: */ 39 + . = LOAD_BASE ; 40 + 41 + /* _s_kernel_ro must be page aligned */ 42 + . = ALIGN(PAGE_SIZE); 43 + _s_kernel_ro = .; 44 + 45 + .text : AT(ADDR(.text) - LOAD_OFFSET) 46 + { 47 + _stext = .; 48 + TEXT_TEXT 49 + SCHED_TEXT 50 + LOCK_TEXT 51 + KPROBES_TEXT 52 + IRQENTRY_TEXT 53 + *(.fixup) 54 + *(.text.__*) 55 + _etext = .; 56 + } 57 + /* TODO: Check if fixup and text.__* are really necessary 58 + * fixup is definitely necessary 59 + */ 60 + 61 + _sdata = .; 62 + 63 + /* Page alignment required for RO_DATA_SECTION */ 64 + RO_DATA_SECTION(PAGE_SIZE) 65 + _e_kernel_ro = .; 66 + 67 + /* Whatever comes after _e_kernel_ro had better be page-aligend, too */ 68 + 69 + /* 32 here is cacheline size... recheck this */ 70 + RW_DATA_SECTION(32, PAGE_SIZE, PAGE_SIZE) 71 + 72 + _edata = .; 73 + 74 + EXCEPTION_TABLE(4) 75 + NOTES 76 + 77 + /* Init code and data */ 78 + . = ALIGN(PAGE_SIZE); 79 + __init_begin = .; 80 + 81 + HEAD_TEXT_SECTION 82 + 83 + /* Page aligned */ 84 + INIT_TEXT_SECTION(PAGE_SIZE) 85 + 86 + /* Align __setup_start on 16 byte boundary */ 87 + INIT_DATA_SECTION(16) 88 + 89 + PERCPU_SECTION(L1_CACHE_BYTES) 90 + 91 + __init_end = .; 92 + 93 + . = ALIGN(PAGE_SIZE); 94 + .initrd : AT(ADDR(.initrd) - LOAD_OFFSET) 95 + { 96 + __initrd_start = .; 97 + *(.initrd) 98 + __initrd_end = .; 99 + FILL (0); 100 + . = ALIGN (PAGE_SIZE); 101 + } 102 + 103 + __vmlinux_end = .; /* last address of the physical file */ 104 + 105 + BSS_SECTION(0, 0, 0x20) 106 + 107 + _end = .; 108 + 109 + /* Throw in the debugging sections */ 110 + STABS_DEBUG 111 + DWARF_DEBUG 112 + 113 + /* Sections to be discarded -- must be last */ 114 + DISCARDS 115 + }
+5
arch/openrisc/lib/Makefile
··· 1 + # 2 + # Makefile for or32 specific library files.. 3 + # 4 + 5 + obj-y = string.o delay.o
+5
arch/openrisc/mm/Makefile
··· 1 + # 2 + # Makefile for the linux openrisc-specific parts of the memory manager. 3 + # 4 + 5 + obj-y := fault.o tlb.o init.o ioremap.o