diff --git a/README.openrisc b/README.openrisc new file mode 100644 index 00000000000000..fc62eb8038f27d --- /dev/null +++ b/README.openrisc @@ -0,0 +1,15 @@ +Initramfs +========= + +In order to have the initramfs built into your kernel you need to have the following +options set: + +CONFIG_INITRAMFS_SOURCE="arch/or32/support/initramfs arch/or32/support/initramfs.devnodes" +CONFIG_DEVTMPFS=y + +This builds the initramfs from the directory initramfs and adds some extra +directories and device nodes from the file initramfs. + +There is not a hard dependency on devtmpfs, but it makes life easier and the initramfs +is configured to use it! + diff --git a/TODO.openrisc b/TODO.openrisc new file mode 100644 index 00000000000000..87fb942e6b9087 --- /dev/null +++ b/TODO.openrisc @@ -0,0 +1,5 @@ +LOAD_CURRENT_THREAD_INFO is not used anywhere + +Implement memcpy and memset (string.h) + +switch bootmem allocation over to memblock diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index 443f44de102093..96b99cb4825c46 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -22,9 +22,11 @@ config OPENRISC select GENERIC_CLOCKEVENTS select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER + select GENERIC_SMP_IDLE_THREAD select MODULES_USE_ELF_RELA select HAVE_DEBUG_STACKOVERFLOW select OR1K_PIC + select OMPIC if SMP config MMU def_bool y @@ -47,6 +49,9 @@ config NO_IOPORT_MAP config TRACE_IRQFLAGS_SUPPORT def_bool y +config WISHBONE_BUS_BIG_ENDIAN + def_bool y + # For now, use generic checksum functions #These can be reimplemented in assembly later if so inclined config GENERIC_CSUM @@ -98,8 +103,30 @@ config OPENRISC_HAVE_INST_DIV default y help Select this if your implementation has a hardware divide instruction + +config OPENRISC_HAVE_INST_LWA_SWA + bool "Have instruction l.lwa and l.swa" + help + Select this if your implementation have l.lwa and l.swa atomic + instructions. + endmenu +config NR_CPUS + int "Maximum number of CPUs (2-32)" + range 2 32 + depends on SMP + default "2" + +config SMP + bool "Symmetric Multi-Processing support" + depends on OPENRISC_HAVE_INST_LWA_SWA + help + This enables support for systems with more than one CPU. 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. source kernel/Kconfig.hz source kernel/Kconfig.preempt @@ -118,6 +145,16 @@ config OPENRISC_NO_SPR_SR_DSX Say N here if you know that your OpenRISC processor has SPR_SR_DSX bit implemented. Say Y if you are unsure. +config OPENRISC_HAVE_SHADOW_GPRS + bool "Support for shadow gpr files" + help + Say Y here if your OpenRISC processor features shadowed + register files. They will in such case be used as a + scratch reg storage on exception entry. + + On SMP systems, this feature is mandatory. + On a unicore system it's safe to say N here if you are unsure. + config CMDLINE string "Default kernel command string" default "" diff --git a/arch/openrisc/boot/dts/de0_nano.dts b/arch/openrisc/boot/dts/de0_nano.dts new file mode 100644 index 00000000000000..42f91b5184d91a --- /dev/null +++ b/arch/openrisc/boot/dts/de0_nano.dts @@ -0,0 +1,158 @@ +/dts-v1/; +/ { + compatible = "opencores,de0_nano"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&pic>; + + chosen { + bootargs = "console=uart,mmio,0x90000000,115200"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x02000000>; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu@0 { + compatible = "opencores,or1200-rtlsvn481"; + reg = <0>; + clock-frequency = <50000000>; + }; + }; + + /* + * OR1K PIC is built into CPU and accessed via special purpose + * registers. It is not addressable and, hence, has no 'reg' + * property. + */ + pic: pic { + compatible = "opencores,or1k-pic"; + #interrupt-cells = <1>; + interrupt-controller; + }; + + serial0: serial@90000000 { + compatible = "opencores,uart16550-rtlsvn105", "ns16550a"; + reg = <0x90000000 0x100>; + interrupts = <2>; + clock-frequency = <50000000>; + }; + + i2c0: ocores@a0000000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "opencores,i2c-ocores"; + reg = <0xa0000000 0x8>; + interrupts = <10>; + clock-frequency = <50000000>; + + reg-shift = <0>; /* 8 bit registers */ + reg-io-width = <1>; /* 8 bit read/write */ + + adxl34x@1d { + compatible = "adxl34x"; + reg = <0x1d>; + interrupts = <26>; + }; + eeprom@50 { + compatible = "at24,24c02"; + reg = <0x50>; + pagesize = <8>; + }; + }; + + spi0: spi0@b0000000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "opencores,spi-simple"; + reg = <0xb0000000 0x5>; + + flash0: mtd@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spansion,s25sl064p"; + reg = <0>; + spi-max-frequency = <40000000>; + m25p,fast-read; + + partition@0 { + label = "FPGA image"; + reg = <0x00000000 0x000b0000>; + read-only; + }; + partition@b0000 { + label = "bootloader"; + reg = <0x000b0000 0x00050000>; + read-only; + }; + partition@100000 { + label = "free space"; + reg = <0x00100000 0x00700000>; + }; + }; + }; + + spi1: spi1@b1000000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "opencores,spi-simple"; + reg = <0xb1000000 0x5>; + + adc@0 { + compatible = "adcxx,adcxx8s"; + reg = <0>; + spi-max-frequency = <1000000>; + }; + }; + + gpio0: gpio@91000000 { + compatible = "opencores,jbtrivial"; + reg = <0x91000000 0x2>; + #gpio-cells = <2>; + gpio-controller; + xlnx,data-offset = <0>; + xlnx,tri-offset = <1>; + xlnx,gpio-width = <8>; + }; + + gpio-leds { + compatible = "gpio-leds"; + heartbeat { + label = "Heartbeat"; + gpios = <&gpio0 0 0x0>; + linux,default-trigger = "heartbeat"; + }; + led1 { + label = "led1"; + gpios = <&gpio0 1 0>; + }; + led2 { + label = "led2"; + gpios = <&gpio0 2 0>; + }; + led3 { + label = "led3"; + gpios = <&gpio0 3 0>; + }; + led4 { + label = "led4"; + gpios = <&gpio0 4 0>; + }; + led5 { + label = "led5"; + gpios = <&gpio0 5 0>; + }; + led6 { + label = "led6"; + gpios = <&gpio0 6 0>; + }; + led7 { + label = "led7"; + gpios = <&gpio0 7 0>; + }; + }; +}; diff --git a/arch/openrisc/boot/dts/simple_smp.dts b/arch/openrisc/boot/dts/simple_smp.dts new file mode 100644 index 00000000000000..575530551a5f8e --- /dev/null +++ b/arch/openrisc/boot/dts/simple_smp.dts @@ -0,0 +1,74 @@ +/dts-v1/; +/ { + compatible = "opencores,or1ksim"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&pic>; + + chosen { + bootargs = "console=uart,mmio,0x90000000,115200"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x02000000>; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu@0 { + compatible = "opencores,or1200-rtlsvn481"; + reg = <0>; + clock-frequency = <50000000>; + }; + cpu@1 { + compatible = "opencores,or1200-rtlsvn481"; + reg = <1>; + clock-frequency = <50000000>; + }; + }; + + ompic: ompic { + compatible = "ompic"; + reg = <0x98000000 0x100>; + #interrupt-cells = <1>; + interrupt-controller; + interrupts = <1>; + }; + + /* + * OR1K PIC is built into CPU and accessed via special purpose + * registers. It is not addressable and, hence, has no 'reg' + * property. + */ + pic: pic { + compatible = "opencores,or1k-pic"; + #interrupt-cells = <1>; + interrupt-controller; + }; + + serial0: serial@90000000 { + compatible = "opencores,uart16550-rtlsvn105", "ns16550a"; + reg = <0x90000000 0x100>; + interrupts = <2>; + clock-frequency = <50000000>; + }; + +/* + enet0: ethoc@92000000 { + compatible = "opencores,ethmac-rtlsvn338"; + reg = <0x92000000 0x100>; + interrupts = <4>; + }; + ata@9e000000 { + compatible = "ata-generic"; + reg = <0x9e000040 0x30 + 0x9e000078 0x10>; + pio-mode = <4>; + reg-shift = <2>; + interrupts = <15>; + }; +*/ + +}; diff --git a/arch/openrisc/boot/dts/sockit_smp.dts b/arch/openrisc/boot/dts/sockit_smp.dts new file mode 100644 index 00000000000000..17e0b082e134b9 --- /dev/null +++ b/arch/openrisc/boot/dts/sockit_smp.dts @@ -0,0 +1,136 @@ +/dts-v1/; +/ { + compatible = "fusesoc,sockit"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&pic>; + + chosen { +/* bootargs = "console=uart,mmio,0x90000000,115200 video=ocfb:640x480-16@60";*/ +/* bootargs = "console=uart,mmio,0x90000000,115200 root=/dev/nfs nfsroot=192.168.255.100:/home/stefan/openrisc/debian/initramfs,nolock ip=dhcp rootwait rw nfsrootdebug debug video=ocfb:640x480-8@60";*/ +/* bootargs = "console=uart,mmio,0x90000000,115200 root=/dev/nfs nfsroot=192.168.255.100:/home/stefan/openrisc/rootfs/musl-root,nolock ip=dhcp rootwait rw nfsrootdebug debug video=ocfb:640x480-8@60";*/ + bootargs = "console=tty0 console=uart,mmio,0x90000000,115200 root=/dev/nfs nfsroot=192.168.255.100:/home/stefan/openrisc/rootfs/build/or1k-toolchain/sysroot,nolock ip=dhcp rootwait rw nfsrootdebug debug video=ocfb:640x480-8@60"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x3fffc000>; +/* reg = <0x00000000 0x40000000>;*/ + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu@0 { + compatible = "openrisc,mor1kx-v3"; + reg = <0>; + clock-frequency = <100000000>; + }; + cpu@1 { + compatible = "openrisc,mor1kx-v3"; + reg = <1>; + clock-frequency = <100000000>; + }; + cpu@2 { + compatible = "openrisc,mor1kx-v3"; + reg = <2>; + clock-frequency = <100000000>; + }; + cpu@3 { + compatible = "openrisc,mor1kx-v3"; + reg = <3>; + clock-frequency = <100000000>; + }; + }; + + ompic: ompic { + compatible = "ompic"; + reg = <0x98000000 0x100>; + #interrupt-cells = <1>; + interrupt-controller; + interrupts = <1>; + }; + + /* + * OR1K PIC is built into CPU and accessed via special purpose + * registers. It is not addressable and, hence, has no 'reg' + * property. + */ + pic: pic { + compatible = "opencores,or1k-pic-level"; + #interrupt-cells = <1>; + interrupt-controller; + }; + + serial0: serial@90000000 { + compatible = "opencores,uart16550-rtlsvn105", "ns16550a"; + reg = <0x90000000 0x20>; + interrupts = <2>; + clock-frequency = <100000000>; + }; + + + i2c0: ocores@a0000000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "opencores,i2c-ocores"; + reg = <0xa0000000 0x8>; + interrupts = <10>; + clock-frequency = <100000000>; + + reg-shift = <0>; /* 8 bit registers */ + reg-io-width = <1>; /* 8 bit read/write */ + + ssm2603: ssm2603@1a { + #sound-dai-cells = <0>; + compatible = "adi,ssm2603"; + reg = <0x1a>; + }; + }; + + wb_dma0: wb_streamer@95000000 { + compatible = "wb-streamer-dma"; + reg = <0x95000000 0x100>; + interrupts = <11>; + #dma-cells = <1>; + #dma-channels = <1>; + }; + + wb_i2s: wb_i2s@95000100 { + #sound-dai-cells = <0>; + compatible = "wb-i2s"; + reg = <0x95000100 0x100>; + dmas = <&wb_dma0 0>; + dma-names = "tx"; +/* + dmas = <&wb_dma 0 &wb_dma 1>; + dma-names = "tx", "rx"; +*/ + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + + simple-audio-card,cpu { + sound-dai = <&wb_i2s>; + }; + + simple-audio-card,codec { + sound-dai = <&ssm2603>; + /*system-clock-frequency = <12288000>;*/ + system-clock-frequency = <11289600>; + }; + }; + + enet0: ethoc@92000000 { + compatible = "opencores,ethmac-rtlsvn338"; + reg = <0x92000000 0x100>; + interrupts = <4>; + }; + + fb0: ocfb@97000000 { + compatible = "opencores,ocfb"; + reg = <0x97000000 0x1000>; + }; +}; diff --git a/arch/openrisc/configs/de0_nano_defconfig b/arch/openrisc/configs/de0_nano_defconfig new file mode 100644 index 00000000000000..71a191c7a7fff5 --- /dev/null +++ b/arch/openrisc/configs/de0_nano_defconfig @@ -0,0 +1,87 @@ +CONFIG_CROSS_COMPILE="or32-linux-" +CONFIG_LOCALVERSION="-de0_nano" +CONFIG_NO_HZ=y +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="arch/openrisc/support/initramfs arch/openrisc/support/initramfs.devnodes" +# CONFIG_RD_GZIP is not set +CONFIG_EXPERT=y +# CONFIG_KALLSYMS is not set +# CONFIG_EPOLL is not set +# CONFIG_TIMERFD is not set +# CONFIG_EVENTFD is not set +# CONFIG_AIO is not set +# CONFIG_VM_EVENT_COUNTERS is not set +# CONFIG_COMPAT_BRK is not set +CONFIG_SLOB=y +CONFIG_MODULES=y +# CONFIG_BLOCK is not set +CONFIG_OPENRISC_BUILTIN_DTB="de0_nano" +CONFIG_HZ_100=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +# CONFIG_INET_DIAG is not set +CONFIG_TCP_CONG_ADVANCED=y +# CONFIG_TCP_CONG_BIC is not set +# CONFIG_TCP_CONG_CUBIC is not set +# CONFIG_TCP_CONG_WESTWOOD is not set +# CONFIG_TCP_CONG_HTCP is not set +# CONFIG_IPV6 is not set +# CONFIG_WIRELESS is not set +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +# CONFIG_FW_LOADER is not set +CONFIG_MTD=y +CONFIG_MTD_M25P80=y +# CONFIG_M25PXX_USE_FAST_READ is not set +CONFIG_PROC_DEVICETREE=y +CONFIG_EEPROM_AT24=y +CONFIG_NETDEVICES=y +# CONFIG_ETHERNET is not set +# CONFIG_WLAN is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +CONFIG_INPUT_MISC=y +CONFIG_INPUT_ADXL34X=y +# CONFIG_INPUT_ADXL34X_SPI is not set +# CONFIG_SERIO is not set +# CONFIG_VT is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_DEVKMEM is not set +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_OF_PLATFORM=y +# CONFIG_HW_RANDOM is not set +CONFIG_I2C=y +# CONFIG_I2C_COMPAT is not set +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_OCORES=y +CONFIG_SPI=y +CONFIG_SPI_OCSIMPLE=y +CONFIG_GPIO_JBTRIVIAL=y +CONFIG_SENSORS_ADCXX=y +# CONFIG_HID is not set +# CONFIG_USB_SUPPORT is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=y +CONFIG_LEDS_TRIGGER_ONESHOT=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_GPIO=y +CONFIG_LEDS_TRIGGER_DEFAULT_ON=y +CONFIG_LEDS_TRIGGER_TRANSIENT=y +# CONFIG_DNOTIFY is not set +CONFIG_TMPFS=y +CONFIG_NFS_FS=y +# CONFIG_ENABLE_WARN_DEPRECATED is not set +# CONFIG_ENABLE_MUST_CHECK is not set diff --git a/arch/openrisc/configs/musl_defconfig b/arch/openrisc/configs/musl_defconfig new file mode 100644 index 00000000000000..c73e6357b35e36 --- /dev/null +++ b/arch/openrisc/configs/musl_defconfig @@ -0,0 +1,62 @@ +CONFIG_CROSS_COMPILE="or1k-linux-musl-" +CONFIG_LOCALVERSION="-or1ksim" +CONFIG_NO_HZ=y +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="arch/openrisc/support/initramfs arch/openrisc/support/initramfs.devnodes" +# CONFIG_RD_GZIP is not set +CONFIG_EXPERT=y +# CONFIG_KALLSYMS is not set +# CONFIG_EPOLL is not set +# CONFIG_TIMERFD is not set +# CONFIG_EVENTFD is not set +# CONFIG_AIO is not set +# CONFIG_VM_EVENT_COUNTERS is not set +# CONFIG_COMPAT_BRK is not set +CONFIG_SLOB=y +CONFIG_MODULES=y +# CONFIG_BLOCK is not set +CONFIG_OPENRISC_BUILTIN_DTB="or1ksim" +CONFIG_HZ_100=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +# CONFIG_INET_DIAG is not set +CONFIG_TCP_CONG_ADVANCED=y +# CONFIG_TCP_CONG_BIC is not set +# CONFIG_TCP_CONG_CUBIC is not set +# CONFIG_TCP_CONG_WESTWOOD is not set +# CONFIG_TCP_CONG_HTCP is not set +# CONFIG_IPV6 is not set +# CONFIG_WIRELESS is not set +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +# CONFIG_FW_LOADER is not set +CONFIG_PROC_DEVICETREE=y +CONFIG_NETDEVICES=y +CONFIG_ETHOC=y +CONFIG_MICREL_PHY=y +# CONFIG_WLAN is not set +# CONFIG_INPUT is not set +# CONFIG_SERIO is not set +# CONFIG_VT is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_DEVKMEM is not set +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_OF_PLATFORM=y +# CONFIG_HW_RANDOM is not set +# CONFIG_HWMON is not set +# CONFIG_USB_SUPPORT is not set +# CONFIG_DNOTIFY is not set +CONFIG_TMPFS=y +CONFIG_NFS_FS=y +# CONFIG_ENABLE_WARN_DEPRECATED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_OPENRISC_HAVE_INST_LWA_SWA=y diff --git a/arch/openrisc/configs/or1ksim_defconfig b/arch/openrisc/configs/or1ksim_defconfig index 42fe5303a37008..a931c8fe20bd78 100644 --- a/arch/openrisc/configs/or1ksim_defconfig +++ b/arch/openrisc/configs/or1ksim_defconfig @@ -1,8 +1,15 @@ CONFIG_CROSS_COMPILE="or32-linux-" +CONFIG_LOCALVERSION="-or1ksim" CONFIG_NO_HZ=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="arch/openrisc/support/initramfs arch/openrisc/support/initramfs.devnodes" # CONFIG_RD_GZIP is not set +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_XZ is not set +# CONFIG_RD_LZO is not set +# CONFIG_RD_LZ4 is not set CONFIG_EXPERT=y # CONFIG_KALLSYMS is not set # CONFIG_EPOLL is not set diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild index 2832f031fb11d0..a669c141436e0b 100644 --- a/arch/openrisc/include/asm/Kbuild +++ b/arch/openrisc/include/asm/Kbuild @@ -1,7 +1,6 @@ header-y += ucontext.h -generic-y += atomic.h generic-y += auxvec.h generic-y += barrier.h generic-y += bitsperlong.h @@ -10,8 +9,6 @@ generic-y += bugs.h generic-y += cacheflush.h generic-y += checksum.h generic-y += clkdev.h -generic-y += cmpxchg-local.h -generic-y += cmpxchg.h generic-y += cputime.h generic-y += current.h generic-y += device.h @@ -23,12 +20,12 @@ generic-y += exec.h generic-y += fb.h generic-y += fcntl.h generic-y += ftrace.h -generic-y += futex.h generic-y += hardirq.h generic-y += hw_irq.h generic-y += ioctl.h generic-y += ioctls.h generic-y += ipcbuf.h +generic-y += irq.h generic-y += irq_regs.h generic-y += irq_work.h generic-y += kdebug.h diff --git a/arch/openrisc/include/asm/atomic.h b/arch/openrisc/include/asm/atomic.h new file mode 100644 index 00000000000000..253edcc1c279c0 --- /dev/null +++ b/arch/openrisc/include/asm/atomic.h @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2014 Stefan Kristiansson + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#ifndef __ASM_OPENRISC_ATOMIC_H +#define __ASM_OPENRISC_ATOMIC_H + +#include + +#ifdef CONFIG_OPENRISC_HAVE_INST_LWA_SWA + +static inline int atomic_add_return(int i, atomic_t *v) +{ + int tmp; + + __asm__ __volatile__( + "1: l.lwa %0,0(%1) \n" + " l.add %0,%0,%2 \n" + " l.swa 0(%1),%0 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r"(tmp) + : "r"(&v->counter), "r"(i) + : "cc", "memory"); + + return tmp; +} + +static inline int atomic_sub_return(int i, atomic_t *v) +{ + int tmp; + + __asm__ __volatile__( + "1: l.lwa %0,0(%1) \n" + " l.sub %0,%0,%2 \n" + " l.swa 0(%1),%0 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r"(tmp) + : "r"(&v->counter), "r"(i) + : "cc", "memory"); + + return tmp; +} + +static inline void atomic_clear_mask(unsigned long mask, atomic_t *v) +{ + unsigned long tmp; + + __asm__ __volatile__( + "1: l.lwa %0,0(%1) \n" + " l.and %0,%0,%2 \n" + " l.swa 0(%1),%0 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r"(tmp) + : "r"(&v->counter), "r"(mask) + : "cc", "memory"); +} + +static inline void atomic_set_mask(unsigned long mask, atomic_t *v) +{ + unsigned long tmp; + + __asm__ __volatile__( + "1: l.lwa %0,0(%1) \n" + " l.or %0,%0,%2 \n" + " l.swa 0(%1),%0 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r"(tmp) + : "r"(&v->counter), "r"(mask) + : "cc", "memory"); +} + +#define atomic_add_return atomic_add_return +#define atomic_sub_return atomic_sub_return +#define atomic_clear_mask atomic_clear_mask +#define atomic_set_mask atomic_set_mask + +#endif +#include + +#endif /* __ASM_OPENRISC_ATOMIC_H */ diff --git a/arch/openrisc/include/asm/bitops.h b/arch/openrisc/include/asm/bitops.h index 3003cdad561bda..689f56819d53b3 100644 --- a/arch/openrisc/include/asm/bitops.h +++ b/arch/openrisc/include/asm/bitops.h @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include #include diff --git a/arch/openrisc/include/asm/bitops/atomic.h b/arch/openrisc/include/asm/bitops/atomic.h new file mode 100644 index 00000000000000..ef25cffc91d0b0 --- /dev/null +++ b/arch/openrisc/include/asm/bitops/atomic.h @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2014 Stefan Kristiansson + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#ifndef __ASM_OPENRISC_BITOPS_ATOMIC_H +#define __ASM_OPENRISC_BITOPS_ATOMIC_H + +#ifdef CONFIG_OPENRISC_HAVE_INST_LWA_SWA + +static inline void set_bit(int nr, volatile unsigned long *addr) +{ + unsigned long mask = BIT_MASK(nr); + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); + unsigned long tmp; + + __asm__ __volatile__( + "1: l.lwa %0,0(%1) \n" + " l.or %0,%0,%2 \n" + " l.swa 0(%1),%0 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r"(tmp) + : "r"(p), "r"(mask) + : "cc", "memory"); +} + +static inline void clear_bit(int nr, volatile unsigned long *addr) +{ + unsigned long mask = BIT_MASK(nr); + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); + unsigned long tmp; + + __asm__ __volatile__( + "1: l.lwa %0,0(%1) \n" + " l.and %0,%0,%2 \n" + " l.swa 0(%1),%0 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r"(tmp) + : "r"(p), "r"(~mask) + : "cc", "memory"); +} + +static inline void change_bit(int nr, volatile unsigned long *addr) +{ + unsigned long mask = BIT_MASK(nr); + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); + unsigned long tmp; + + __asm__ __volatile__( + "1: l.lwa %0,0(%1) \n" + " l.xor %0,%0,%2 \n" + " l.swa 0(%1),%0 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r"(tmp) + : "r"(p), "r"(mask) + : "cc", "memory"); +} + +static inline int test_and_set_bit(int nr, volatile unsigned long *addr) +{ + unsigned long mask = BIT_MASK(nr); + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); + unsigned long old; + unsigned long tmp; + + __asm__ __volatile__( + "1: l.lwa %0,0(%2) \n" + " l.or %1,%0,%3 \n" + " l.swa 0(%2),%1 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r"(old), "=&r"(tmp) + : "r"(p), "r"(mask) + : "cc", "memory"); + + return (old & mask) != 0; +} + +static inline int test_and_clear_bit(int nr, volatile unsigned long *addr) +{ + unsigned long mask = BIT_MASK(nr); + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); + unsigned long old; + unsigned long tmp; + + __asm__ __volatile__( + "1: l.lwa %0,0(%2) \n" + " l.and %1,%0,%3 \n" + " l.swa 0(%2),%1 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r"(old), "=&r"(tmp) + : "r"(p), "r"(~mask) + : "cc", "memory"); + + return (old & mask) != 0; +} + +#else +#include +#endif + +#endif /* __ASM_OPENRISC_BITOPS_ATOMIC_H */ diff --git a/arch/openrisc/include/asm/cmpxchg.h b/arch/openrisc/include/asm/cmpxchg.h new file mode 100644 index 00000000000000..4e40411dfcf7c7 --- /dev/null +++ b/arch/openrisc/include/asm/cmpxchg.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2014 Stefan Kristiansson + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#ifndef __ASM_OPENRISC_CMPXCHG_H +#define __ASM_OPENRISC_CMPXCHG_H + +#include + +#ifdef CONFIG_OPENRISC_HAVE_INST_LWA_SWA + +/* + * This function doesn't exist, so you'll get a linker error + * if something tries to do an invalid cmpxchg(). + */ +extern void __cmpxchg_called_with_bad_pointer(void); + +#define __HAVE_ARCH_CMPXCHG 1 + +static inline unsigned long +__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) +{ + if (size != 4) { + __cmpxchg_called_with_bad_pointer(); + return old; + } + + __asm__ __volatile__( + "1: l.lwa %0, 0(%1) \n" + " l.sfeq %0, %2 \n" + " l.bnf 1f \n" + " l.nop \n" + " l.swa 0(%1), %3 \n" + " l.bnf 1b \n" + "1: l.nop \n" + : "=&r"(old) + : "r"(ptr), "r"(old), "r"(new) + : "cc", "memory"); + + return old; +} + +#define cmpxchg(ptr, o, n) ((typeof(*(ptr)))__cmpxchg((ptr), \ + (unsigned long)(o), (unsigned long)(n), sizeof(*(ptr)))) + +/* + * This function doesn't exist, so you'll get a linker error if + * something tries to do an invalidly-sized xchg(). + */ +extern void __xchg_called_with_bad_pointer(void); + +static inline unsigned long __xchg(unsigned long val, volatile void *ptr, + int size) +{ + if (size != 4) { + __xchg_called_with_bad_pointer(); + return val; + } + + __asm__ __volatile__( + "1: l.lwa %0, 0(%1) \n" + " l.swa 0(%1), %2 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r"(val) + : "r"(ptr), "r"(val) + : "cc", "memory"); + + return val; +} + +#define xchg(ptr, with) \ + ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), sizeof(*(ptr)))) + +#else +#include +#endif + +#endif /* __ASM_OPENRISC_CMPXCHG_H */ diff --git a/arch/openrisc/include/asm/cpuinfo.h b/arch/openrisc/include/asm/cpuinfo.h index 917318b6a970f5..1bcf29072973e7 100644 --- a/arch/openrisc/include/asm/cpuinfo.h +++ b/arch/openrisc/include/asm/cpuinfo.h @@ -19,16 +19,19 @@ #ifndef __ASM_OPENRISC_CPUINFO_H #define __ASM_OPENRISC_CPUINFO_H -struct cpuinfo { +struct cpuinfo_or1k { u32 clock_frequency; u32 icache_size; u32 icache_block_size; + u32 icache_ways; u32 dcache_size; u32 dcache_block_size; + u32 dcache_ways; }; -extern struct cpuinfo cpuinfo; +extern struct cpuinfo_or1k cpuinfo_or1k[NR_CPUS]; +extern void setup_cpuinfo(void); #endif /* __ASM_OPENRISC_CPUINFO_H */ diff --git a/arch/openrisc/include/asm/futex.h b/arch/openrisc/include/asm/futex.h new file mode 100644 index 00000000000000..f4b654f5b6c1c1 --- /dev/null +++ b/arch/openrisc/include/asm/futex.h @@ -0,0 +1,140 @@ +#ifndef __ASM_OPENRISC_FUTEX_H +#define __ASM_OPENRISC_FUTEX_H + +#ifdef CONFIG_OPENRISC_HAVE_INST_LWA_SWA +#ifdef __KERNEL__ + +#include +#include +#include + +#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ +({ \ + __asm__ __volatile__ ( \ + "1: l.lwa %0, %2 \n" \ + insn "\n" \ + "2: l.swa %2, %1 \n" \ + " l.bnf 1b \n" \ + " l.ori %1, r0, 0 \n" \ + "3: \n" \ + ".section .fixup,\"ax\" \n" \ + "4: l.j 3b \n" \ + " l.addi %1, r0, %3 \n" \ + ".previous \n" \ + ".section __ex_table,\"a\" \n" \ + ".word 1b,4b,2b,4b \n" \ + ".previous \n" \ + : "=&r" (oldval), "=&r" (ret), "+m" (*uaddr) \ + : "i" (-EFAULT), "r" (oparg) \ + : "cc", "memory" \ + ); \ +}) + +static inline int +futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret; + + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) + return -EFAULT; + + pagefault_disable(); + + switch (op) { + case FUTEX_OP_SET: + __futex_atomic_op("l.or %1,%4,%4", ret, oldval, uaddr, oparg); + break; + case FUTEX_OP_ADD: + __futex_atomic_op("l.add %1,%0,%4", ret, oldval, uaddr, oparg); + break; + case FUTEX_OP_OR: + __futex_atomic_op("l.or %1,%0,%4", ret, oldval, uaddr, oparg); + break; + case FUTEX_OP_ANDN: + __futex_atomic_op("l.and %1,%0,%4", ret, oldval, uaddr, ~oparg); + break; + case FUTEX_OP_XOR: + __futex_atomic_op("l.xor %1,%0,%4", ret, oldval, uaddr, oparg); + break; + default: + ret = -ENOSYS; + } + + pagefault_enable(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: + ret = (oldval == cmparg); + break; + case FUTEX_OP_CMP_NE: + ret = (oldval != cmparg); + break; + case FUTEX_OP_CMP_LT: + ret = (oldval < cmparg); + break; + case FUTEX_OP_CMP_GE: + ret = (oldval >= cmparg); + break; + case FUTEX_OP_CMP_LE: + ret = (oldval <= cmparg); + break; + case FUTEX_OP_CMP_GT: + ret = (oldval > cmparg); + break; + default: + ret = -ENOSYS; + } + } + return ret; +} + +static inline int +futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, + u32 oldval, u32 newval) +{ + int ret = 0; + u32 prev; + + if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) + return -EFAULT; + + __asm__ __volatile__ ( \ + "1: l.lwa %1, %2 \n" \ + " l.sfeq %1, %3 \n" \ + " l.bnf 3f \n" \ + " l.nop \n" \ + "2: l.swa %2, %4 \n" \ + " l.bnf 1b \n" \ + " l.nop \n" \ + "3: \n" \ + ".section .fixup,\"ax\" \n" \ + "4: l.j 3b \n" \ + " l.addi %0, r0, %5 \n" \ + ".previous \n" \ + ".section __ex_table,\"a\" \n" \ + ".word 1b,4b,2b,4b \n" \ + ".previous \n" \ + : "+r" (ret), "=&r" (prev), "+m" (*uaddr) \ + : "r" (oldval), "r" (newval), "i" (-EFAULT) \ + : "cc", "memory" \ + ); + + *uval = prev; + return ret; +} + +#endif /* __KERNEL__ */ + +#else +#include +#endif + +#endif /* __ASM_OPENRISC_FUTEX_H */ diff --git a/arch/openrisc/include/asm/mmu_context.h b/arch/openrisc/include/asm/mmu_context.h index e94b814d2e3c41..c380d8caf84f6f 100644 --- a/arch/openrisc/include/asm/mmu_context.h +++ b/arch/openrisc/include/asm/mmu_context.h @@ -34,7 +34,7 @@ extern void switch_mm(struct mm_struct *prev, struct mm_struct *next, * registers like cr3 on the i386 */ -extern volatile pgd_t *current_pgd; /* defined in arch/openrisc/mm/fault.c */ +extern volatile pgd_t *current_pgd[]; /* defined in arch/openrisc/mm/fault.c */ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) { diff --git a/arch/openrisc/include/asm/pgtable.h b/arch/openrisc/include/asm/pgtable.h index 69c7df0e142047..3567aa7be55504 100644 --- a/arch/openrisc/include/asm/pgtable.h +++ b/arch/openrisc/include/asm/pgtable.h @@ -69,7 +69,7 @@ extern void paging_init(void); */ #define PTRS_PER_PTE (1UL << (PAGE_SHIFT-2)) -#define PTRS_PER_PGD (1UL << (PAGE_SHIFT-2)) +#define PTRS_PER_PGD (1UL << (32-PGDIR_SHIFT)) /* calculate how many PGD entries a user-level program can use * the first mappable virtual address is 0 diff --git a/arch/openrisc/include/asm/serial.h b/arch/openrisc/include/asm/serial.h index 270a45241639c6..cb5932f5447a2c 100644 --- a/arch/openrisc/include/asm/serial.h +++ b/arch/openrisc/include/asm/serial.h @@ -29,7 +29,7 @@ * it needs to be correct to get the early console working. */ -#define BASE_BAUD (cpuinfo.clock_frequency/16) +#define BASE_BAUD (cpuinfo_or1k[smp_processor_id()].clock_frequency/16) #endif /* __KERNEL__ */ diff --git a/arch/openrisc/include/asm/smp.h b/arch/openrisc/include/asm/smp.h new file mode 100644 index 00000000000000..d25ca0952f5218 --- /dev/null +++ b/arch/openrisc/include/asm/smp.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2014 Stefan Kristiansson + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#ifndef __ASM_OPENRISC_SMP_H +#define __ASM_OPENRISC_SMP_H + +#include +#include + +#define raw_smp_processor_id() (current_thread_info()->cpu) +#define hard_smp_processor_id() mfspr(SPR_COREID) + +extern void smp_init_cpus(void); + +extern void arch_send_call_function_single_ipi(int cpu); +extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); + +extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int)); +extern void handle_IPI(int ipinr); + +#endif /* __ASM_OPENRISC_SMP_H */ diff --git a/arch/openrisc/include/asm/spinlock.h b/arch/openrisc/include/asm/spinlock.h index fd00a3a24123e7..ac75bfec5ffd9f 100644 --- a/arch/openrisc/include/asm/spinlock.h +++ b/arch/openrisc/include/asm/spinlock.h @@ -9,6 +9,9 @@ * Copyright (C) 2003 Matjaz Breskvar * Copyright (C) 2010-2011 Jonas Bonn * et al. + * Copyright (C) 2014 Stefan Kristiansson + * + * Ticket spinlocks, based on the ARM implementation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +22,232 @@ #ifndef __ASM_OPENRISC_SPINLOCK_H #define __ASM_OPENRISC_SPINLOCK_H -#error "or32 doesn't do SMP yet" +#include + +#define arch_spin_unlock_wait(lock) \ + do { while (arch_spin_is_locked(lock)) cpu_relax(); } while (0) + +#define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock) + +static inline void arch_spin_lock(arch_spinlock_t *lock) +{ + u32 newval; + arch_spinlock_t lockval; + + __asm__ __volatile__( + "1: l.lwa %0, 0(%2) \n" + " l.add %1, %0, %3 \n" + " l.swa 0(%2), %1 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r" (lockval), "=&r" (newval) + : "r" (&lock->slock), "r" (1 << TICKET_SHIFT) + : "cc", "memory"); + + while (lockval.tickets.next != lockval.tickets.owner) + lockval.tickets.owner = ACCESS_ONCE(lock->tickets.owner); + + smp_mb(); +} + +static inline int arch_spin_trylock(arch_spinlock_t *lock) +{ + unsigned long contended, tmp; + u32 slock; + + /* contended = (lock->tickets.owner != lock->tickets.next) */ + __asm__ __volatile__( + "1: l.lwa %0, 0(%3) \n" + " l.srli %1, %0, 16 \n" + " l.andi %2, %0, 0xffff \n" + " l.sfeq %1, %2 \n" + " l.bnf 1f \n" + " l.ori %1, r0, 1 \n" + " l.add %0, %0, %4 \n" + " l.swa 0(%3), %0 \n" + " l.bnf 1b \n" + " l.ori %1, r0, 0 \n" + "1: \n" + : "=&r" (slock), "=&r" (contended), "=&r" (tmp) + : "r" (&lock->slock), "r" (1 << TICKET_SHIFT) + : "cc", "memory"); + + if (!contended) { + smp_mb(); + return 1; + } else { + return 0; + } +} + +static inline void arch_spin_unlock(arch_spinlock_t *lock) +{ + smp_mb(); + lock->tickets.owner++; +} + +static inline int arch_spin_value_unlocked(arch_spinlock_t lock) +{ + return lock.tickets.owner == lock.tickets.next; +} + +static inline int arch_spin_is_locked(arch_spinlock_t *lock) +{ + return !arch_spin_value_unlocked(ACCESS_ONCE(*lock)); +} + +static inline int arch_spin_is_contended(arch_spinlock_t *lock) +{ + struct __raw_tickets tickets = ACCESS_ONCE(lock->tickets); + return (tickets.next - tickets.owner) > 1; +} +#define arch_spin_is_contended arch_spin_is_contended + +/* + * RWLOCKS + * + * + * Write locks are easy - we just set bit 31. When unlocking, we can + * just write zero since the lock is exclusively held. + */ + +static inline void arch_write_lock(arch_rwlock_t *rw) +{ + unsigned long tmp; + + __asm__ __volatile__( + "1: l.lwa %0, 0(%1) \n" + " l.sfeqi %0, 0 \n" + " l.bnf 1f \n" + " l.nop \n" + " l.swa 0(%1), %2 \n" + " l.bnf 1b \n" + " l.nop \n" + "1: \n" + : "=&r" (tmp) + : "r" (&rw->lock), "r" (0x80000000) + : "cc", "memory"); + + smp_mb(); +} + +static inline int arch_write_trylock(arch_rwlock_t *rw) +{ + unsigned long contended; + + __asm__ __volatile__( + "1: l.lwa %0, 0(%1) \n" + " l.sfeqi %0, 0 \n" + " l.bnf 1f \n" + " l.nop \n" + " l.swa 0(%1), %2 \n" + " l.bnf 1b \n" + " l.nop \n" + "1: \n" + : "=&r" (contended) + : "r" (&rw->lock), "r" (0x80000000) + : "cc", "memory"); + + if (!contended) { + smp_mb(); + return 1; + } else { + return 0; + } +} + +static inline void arch_write_unlock(arch_rwlock_t *rw) +{ + smp_mb(); + rw->lock = 0; +} + +/* write_can_lock - would write_trylock() succeed? */ +#define arch_write_can_lock(x) (ACCESS_ONCE((x)->lock) == 0) + +/* + * Read locks are a bit more hairy: + * - Exclusively load the lock value. + * - Increment it. + * - Store new lock value if positive, and we still own this location. + * If the value is negative, we've already failed. + * - If we failed to store the value, we want a negative result. + * - If we failed, try again. + * Unlocking is similarly hairy. We may have multiple read locks + * currently active. However, we know we won't have any write + * locks. + */ +static inline void arch_read_lock(arch_rwlock_t *rw) +{ + unsigned long tmp; + + __asm__ __volatile__( + "1: l.lwa %0, 0(%1) \n" + " l.sfltsi %0, -1 \n" + " l.bf 1b \n" + " l.addi %0, %0, 1 \n" + " l.swa 0(%1), %0 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r" (tmp) + : "r" (&rw->lock) + : "cc", "memory"); + + smp_mb(); +} + +static inline void arch_read_unlock(arch_rwlock_t *rw) +{ + unsigned long tmp; + + smp_mb(); + + __asm__ __volatile__( + "1: l.lwa %0, 0(%1) \n" + " l.addi %0, %0, -1 \n" + " l.swa 0(%1), %0 \n" + " l.bnf 1b \n" + " l.nop \n" + : "=&r" (tmp) + : "r" (&rw->lock) + : "cc", "memory"); + +} + +static inline int arch_read_trylock(arch_rwlock_t *rw) +{ + unsigned long contended; + + __asm__ __volatile__( + "1: l.lwa %0, 0(%1) \n" + " l.sfltsi %0, -1 \n" + " l.bf 1f \n" + " l.addi %0, %0, 1 \n" + " l.swa 0(%1), %0 \n" + " l.bnf 1b \n" + " l.nop \n" + "1: \n" + : "=&r" (contended) + : "r" (&rw->lock) + : "cc", "memory"); + + /* If the lock is negative, then it is already held for write. */ + if (contended < 0x80000000) { + smp_mb(); + return 1; + } else { + return 0; + } +} + +/* read_can_lock - would read_trylock() succeed? */ +#define arch_read_can_lock(x) (ACCESS_ONCE((x)->lock) < 0x80000000) + +#define arch_read_lock_flags(lock, flags) arch_read_lock(lock) +#define arch_write_lock_flags(lock, flags) arch_write_lock(lock) + +#define arch_spin_relax(lock) cpu_relax() +#define arch_read_relax(lock) cpu_relax() +#define arch_write_relax(lock) cpu_relax() #endif diff --git a/arch/openrisc/include/asm/spinlock_types.h b/arch/openrisc/include/asm/spinlock_types.h new file mode 100644 index 00000000000000..bc0de4804d113d --- /dev/null +++ b/arch/openrisc/include/asm/spinlock_types.h @@ -0,0 +1,28 @@ +#ifndef __ASM_SPINLOCK_TYPES_H +#define __ASM_SPINLOCK_TYPES_H + +#ifndef __LINUX_SPINLOCK_TYPES_H +# error "please don't include this file directly" +#endif + +#define TICKET_SHIFT 16 + +typedef struct { + union { + u32 slock; + struct __raw_tickets { + u16 next; + u16 owner; + } tickets; + }; +} arch_spinlock_t; + +#define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } } + +typedef struct { + u32 lock; +} arch_rwlock_t; + +#define __ARCH_RW_LOCK_UNLOCKED { 0 } + +#endif diff --git a/arch/openrisc/include/asm/spr_defs.h b/arch/openrisc/include/asm/spr_defs.h index 5dbc668865c48f..154b5a1ee579ae 100644 --- a/arch/openrisc/include/asm/spr_defs.h +++ b/arch/openrisc/include/asm/spr_defs.h @@ -51,6 +51,11 @@ #define SPR_ICCFGR (SPRGROUP_SYS + 6) #define SPR_DCFGR (SPRGROUP_SYS + 7) #define SPR_PCCFGR (SPRGROUP_SYS + 8) +#define SPR_VR2 (SPRGROUP_SYS + 9) +#define SPR_AVR (SPRGROUP_SYS + 10) +#define SPR_EVBAR (SPRGROUP_SYS + 11) +#define SPR_AECR (SPRGROUP_SYS + 12) +#define SPR_AESR (SPRGROUP_SYS + 13) #define SPR_NPC (SPRGROUP_SYS + 16) /* CZ 21/06/01 */ #define SPR_SR (SPRGROUP_SYS + 17) /* CZ 21/06/01 */ #define SPR_PPC (SPRGROUP_SYS + 18) /* CZ 21/06/01 */ @@ -61,6 +66,8 @@ #define SPR_EEAR_LAST (SPRGROUP_SYS + 63) #define SPR_ESR_BASE (SPRGROUP_SYS + 64) #define SPR_ESR_LAST (SPRGROUP_SYS + 79) +#define SPR_COREID (SPRGROUP_SYS + 128) +#define SPR_NUMCORES (SPRGROUP_SYS + 129) #define SPR_GPR_BASE (SPRGROUP_SYS + 1024) /* Data MMU group */ @@ -135,11 +142,18 @@ #define SPR_VR_CFG 0x00ff0000 /* Processor configuration */ #define SPR_VR_RES 0x0000ffc0 /* Reserved */ #define SPR_VR_REV 0x0000003f /* Processor revision */ +#define SPR_VR_UVRP 0x00000040 /* Updated Version Registers Present */ #define SPR_VR_VER_OFF 24 #define SPR_VR_CFG_OFF 16 #define SPR_VR_REV_OFF 0 +/* + * Bit definitions for the Version Register 2 + */ +#define SPR_VR2_CPUID 0xff000000 /* Processor ID */ +#define SPR_VR2_VER 0x00ffffff /* Processor version */ + /* * Bit definitions for the Unit Present Register * @@ -152,8 +166,8 @@ #define SPR_UPR_MP 0x00000020 /* MAC present */ #define SPR_UPR_DUP 0x00000040 /* Debug unit present */ #define SPR_UPR_PCUP 0x00000080 /* Performance counters unit present */ -#define SPR_UPR_PMP 0x00000100 /* Power management present */ -#define SPR_UPR_PICP 0x00000200 /* PIC present */ +#define SPR_UPR_PICP 0x00000100 /* PIC present */ +#define SPR_UPR_PMP 0x00000200 /* Power management present */ #define SPR_UPR_TTP 0x00000400 /* Tick timer present */ #define SPR_UPR_RES 0x00fe0000 /* Reserved */ #define SPR_UPR_CUP 0xff000000 /* Context units present */ diff --git a/arch/openrisc/include/asm/string.h b/arch/openrisc/include/asm/string.h new file mode 100644 index 00000000000000..33470d4d6948d4 --- /dev/null +++ b/arch/openrisc/include/asm/string.h @@ -0,0 +1,7 @@ +#ifndef __ASM_OPENRISC_STRING_H +#define __ASM_OPENRISC_STRING_H + +#define __HAVE_ARCH_MEMSET +extern void *memset(void *s, int c, __kernel_size_t n); + +#endif /* __ASM_OPENRISC_STRING_H */ diff --git a/arch/openrisc/include/asm/tlbflush.h b/arch/openrisc/include/asm/tlbflush.h index 6a2accd6cb6735..94227f0eaf6da5 100644 --- a/arch/openrisc/include/asm/tlbflush.h +++ b/arch/openrisc/include/asm/tlbflush.h @@ -33,13 +33,26 @@ * - flush_tlb_page(vma, vmaddr) flushes one page * - flush_tlb_range(mm, start, end) flushes a range of pages */ +extern void local_flush_tlb_all(void); +extern void local_flush_tlb_mm(struct mm_struct *mm); +extern void local_flush_tlb_page(struct vm_area_struct *vma, + unsigned long addr); +extern void local_flush_tlb_range(struct vm_area_struct *vma, + unsigned long start, + unsigned long end); -void flush_tlb_all(void); -void flush_tlb_mm(struct mm_struct *mm); -void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr); -void flush_tlb_range(struct vm_area_struct *vma, - unsigned long start, - unsigned long end); +#ifndef CONFIG_SMP +#define flush_tlb_all local_flush_tlb_all +#define flush_tlb_mm local_flush_tlb_mm +#define flush_tlb_page local_flush_tlb_page +#define flush_tlb_range local_flush_tlb_range +#else +extern void flush_tlb_all(void); +extern void flush_tlb_mm(struct mm_struct *mm); +extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr); +extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, + unsigned long end); +#endif static inline void flush_tlb(void) { diff --git a/arch/openrisc/kernel/Makefile b/arch/openrisc/kernel/Makefile index ec6d9d37cefddb..7d94643c878d86 100644 --- a/arch/openrisc/kernel/Makefile +++ b/arch/openrisc/kernel/Makefile @@ -8,6 +8,7 @@ obj-y := setup.o or32_ksyms.o process.o dma.o \ traps.o time.o irq.o entry.o ptrace.o signal.o \ sys_call_table.o +obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_MODULES) += module.o obj-$(CONFIG_OF) += prom.o diff --git a/arch/openrisc/kernel/dma.c b/arch/openrisc/kernel/dma.c index 0b77ddb1ee079a..c777b4f3748d33 100644 --- a/arch/openrisc/kernel/dma.c +++ b/arch/openrisc/kernel/dma.c @@ -33,6 +33,7 @@ page_set_nocache(pte_t *pte, unsigned long addr, unsigned long next, struct mm_walk *walk) { unsigned long cl; + struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[smp_processor_id()]; pte_val(*pte) |= _PAGE_CI; @@ -43,7 +44,7 @@ page_set_nocache(pte_t *pte, unsigned long addr, flush_tlb_page(NULL, addr); /* Flush page out of dcache */ - for (cl = __pa(addr); cl < __pa(next); cl += cpuinfo.dcache_block_size) + for (cl = __pa(addr); cl < __pa(next); cl += cpuinfo->dcache_block_size) mtspr(SPR_DCBFR, cl); return 0; @@ -141,18 +142,19 @@ or1k_map_page(struct device *dev, struct page *page, { unsigned long cl; dma_addr_t addr = page_to_phys(page) + offset; + struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[smp_processor_id()]; switch (dir) { case DMA_TO_DEVICE: /* Flush the dcache for the requested range */ for (cl = addr; cl < addr + size; - cl += cpuinfo.dcache_block_size) + cl += cpuinfo->dcache_block_size) mtspr(SPR_DCBFR, cl); break; case DMA_FROM_DEVICE: /* Invalidate the dcache for the requested range */ for (cl = addr; cl < addr + size; - cl += cpuinfo.dcache_block_size) + cl += cpuinfo->dcache_block_size) mtspr(SPR_DCBIR, cl); break; default: @@ -211,9 +213,10 @@ or1k_sync_single_for_cpu(struct device *dev, { unsigned long cl; dma_addr_t addr = dma_handle; + struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[smp_processor_id()]; /* Invalidate the dcache for the requested range */ - for (cl = addr; cl < addr + size; cl += cpuinfo.dcache_block_size) + for (cl = addr; cl < addr + size; cl += cpuinfo->dcache_block_size) mtspr(SPR_DCBIR, cl); } @@ -224,9 +227,10 @@ or1k_sync_single_for_device(struct device *dev, { unsigned long cl; dma_addr_t addr = dma_handle; + struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[smp_processor_id()]; /* Flush the dcache for the requested range */ - for (cl = addr; cl < addr + size; cl += cpuinfo.dcache_block_size) + for (cl = addr; cl < addr + size; cl += cpuinfo->dcache_block_size) mtspr(SPR_DCBFR, cl); } diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S index fec8bf97d80642..ba1a361c9a1ef9 100644 --- a/arch/openrisc/kernel/entry.S +++ b/arch/openrisc/kernel/entry.S @@ -173,6 +173,11 @@ handler: ;\ l.j _ret_from_exception ;\ l.nop +/* clobbers 'reg' */ +#define CLEAR_LWA_FLAG(reg) \ + l.movhi reg,hi(lwa_flag) ;\ + l.ori reg,reg,lo(lwa_flag) ;\ + l.sw 0(reg),r0 /* * NOTE: one should never assume that SPR_EPC, SPR_ESR, SPR_EEAR * contain the same values as when exception we're handling @@ -193,6 +198,7 @@ EXCEPTION_ENTRY(_tng_kernel_start) /* ---[ 0x200: BUS exception ]------------------------------------------- */ EXCEPTION_ENTRY(_bus_fault_handler) + CLEAR_LWA_FLAG(r3) /* r4: EA of fault (set by EXCEPTION_HANDLE) */ l.jal do_bus_fault l.addi r3,r1,0 /* pt_regs */ @@ -202,11 +208,13 @@ EXCEPTION_ENTRY(_bus_fault_handler) /* ---[ 0x300: Data Page Fault exception ]------------------------------- */ EXCEPTION_ENTRY(_dtlb_miss_page_fault_handler) + CLEAR_LWA_FLAG(r3) l.and r5,r5,r0 l.j 1f l.nop EXCEPTION_ENTRY(_data_page_fault_handler) + CLEAR_LWA_FLAG(r3) /* set up parameters for do_page_fault */ l.ori r5,r0,0x300 // exception vector 1: @@ -264,7 +272,7 @@ EXCEPTION_ENTRY(_data_page_fault_handler) l.srli r6,r6,26 // check opcode for write access #endif - l.sfgeui r6,0x34 // check opcode for write access + l.sfgeui r6,0x33 // check opcode for write access l.bnf 1f l.sfleui r6,0x37 l.bnf 1f @@ -282,11 +290,13 @@ EXCEPTION_ENTRY(_data_page_fault_handler) /* ---[ 0x400: Insn Page Fault exception ]------------------------------- */ EXCEPTION_ENTRY(_itlb_miss_page_fault_handler) + CLEAR_LWA_FLAG(r3) l.and r5,r5,r0 l.j 1f l.nop EXCEPTION_ENTRY(_insn_page_fault_handler) + CLEAR_LWA_FLAG(r3) /* set up parameters for do_page_fault */ l.ori r5,r0,0x400 // exception vector 1: @@ -304,6 +314,7 @@ EXCEPTION_ENTRY(_insn_page_fault_handler) /* ---[ 0x500: Timer exception ]----------------------------------------- */ EXCEPTION_ENTRY(_timer_handler) + CLEAR_LWA_FLAG(r3) l.jal timer_interrupt l.addi r3,r1,0 /* pt_regs */ @@ -313,6 +324,7 @@ EXCEPTION_ENTRY(_timer_handler) /* ---[ 0x600: Aligment exception ]-------------------------------------- */ EXCEPTION_ENTRY(_alignment_handler) + CLEAR_LWA_FLAG(r3) /* r4: EA of fault (set by EXCEPTION_HANDLE) */ l.jal do_unaligned_access l.addi r3,r1,0 /* pt_regs */ @@ -509,6 +521,7 @@ EXCEPTION_ENTRY(_external_irq_handler) // l.sw PT_SR(r1),r4 1: #endif + CLEAR_LWA_FLAG(r3) l.addi r3,r1,0 l.movhi r8,hi(do_IRQ) l.ori r8,r8,lo(do_IRQ) @@ -556,8 +569,12 @@ ENTRY(_sys_call_handler) * they should be clobbered, otherwise */ l.sw PT_GPR3(r1),r3 - /* r4 already saved */ - /* r4 holds the EEAR address of the fault, load the original r4 */ + /* + * r4 already saved + * r4 holds the EEAR address of the fault, use it as screatch reg and + * then load the original r4 + */ + CLEAR_LWA_FLAG(r4) l.lwz r4,PT_GPR4(r1) l.sw PT_GPR5(r1),r5 l.sw PT_GPR6(r1),r6 @@ -776,6 +793,7 @@ UNHANDLED_EXCEPTION(_vector_0xd00,0xd00) /* ---[ 0xe00: Trap exception ]------------------------------------------ */ EXCEPTION_ENTRY(_trap_handler) + CLEAR_LWA_FLAG(r3) /* r4: EA of fault (set by EXCEPTION_HANDLE) */ l.jal do_trap l.addi r3,r1,0 /* pt_regs */ @@ -1101,8 +1119,16 @@ ENTRY(__sys_fork) l.addi r3,r1,0 ENTRY(sys_rt_sigreturn) - l.j _sys_rt_sigreturn + l.jal _sys_rt_sigreturn + l.addi r3,r1,0 + l.sfne r30,r0 + l.bnf _no_syscall_trace + l.nop + l.jal do_syscall_trace_leave l.addi r3,r1,0 +_no_syscall_trace: + l.j _resume_userspace + l.nop /* This is a catch-all syscall for atomic instructions for the OpenRISC 1000. * The functions takes a variable number of parameters depending on which diff --git a/arch/openrisc/kernel/head.S b/arch/openrisc/kernel/head.S index f14793306b03f3..ecf324a97d6005 100644 --- a/arch/openrisc/kernel/head.S +++ b/arch/openrisc/kernel/head.S @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -48,9 +49,31 @@ /* ============================================[ tmp store locations ]=== */ +#define SPR_SHADOW_GPR(x) ((x) + SPR_GPR_BASE + 32) + /* * emergency_print temporary stores */ +#ifdef CONFIG_OPENRISC_HAVE_SHADOW_GPRS +#define EMERGENCY_PRINT_STORE_GPR4 l.mtspr r0,r4,SPR_SHADOW_GPR(14) +#define EMERGENCY_PRINT_LOAD_GPR4 l.mfspr r4,r0,SPR_SHADOW_GPR(14) + +#define EMERGENCY_PRINT_STORE_GPR5 l.mtspr r0,r5,SPR_SHADOW_GPR(15) +#define EMERGENCY_PRINT_LOAD_GPR5 l.mfspr r5,r0,SPR_SHADOW_GPR(15) + +#define EMERGENCY_PRINT_STORE_GPR6 l.mtspr r0,r6,SPR_SHADOW_GPR(16) +#define EMERGENCY_PRINT_LOAD_GPR6 l.mfspr r6,r0,SPR_SHADOW_GPR(16) + +#define EMERGENCY_PRINT_STORE_GPR7 l.mtspr r0,r7,SPR_SHADOW_GPR(7) +#define EMERGENCY_PRINT_LOAD_GPR7 l.mfspr r7,r0,SPR_SHADOW_GPR(7) + +#define EMERGENCY_PRINT_STORE_GPR8 l.mtspr r0,r8,SPR_SHADOW_GPR(8) +#define EMERGENCY_PRINT_LOAD_GPR8 l.mfspr r8,r0,SPR_SHADOW_GPR(8) + +#define EMERGENCY_PRINT_STORE_GPR9 l.mtspr r0,r9,SPR_SHADOW_GPR(9) +#define EMERGENCY_PRINT_LOAD_GPR9 l.mfspr r9,r0,SPR_SHADOW_GPR(9) + +#else /* !CONFIG_OPENRISC_HAVE_SHADOW_GPRS */ #define EMERGENCY_PRINT_STORE_GPR4 l.sw 0x20(r0),r4 #define EMERGENCY_PRINT_LOAD_GPR4 l.lwz r4,0x20(r0) @@ -69,13 +92,28 @@ #define EMERGENCY_PRINT_STORE_GPR9 l.sw 0x34(r0),r9 #define EMERGENCY_PRINT_LOAD_GPR9 l.lwz r9,0x34(r0) +#endif /* * TLB miss handlers temorary stores */ -#define EXCEPTION_STORE_GPR9 l.sw 0x10(r0),r9 -#define EXCEPTION_LOAD_GPR9 l.lwz r9,0x10(r0) +#ifdef CONFIG_OPENRISC_HAVE_SHADOW_GPRS +#define EXCEPTION_STORE_GPR2 l.mtspr r0,r2,SPR_SHADOW_GPR(2) +#define EXCEPTION_LOAD_GPR2 l.mfspr r2,r0,SPR_SHADOW_GPR(2) + +#define EXCEPTION_STORE_GPR3 l.mtspr r0,r3,SPR_SHADOW_GPR(3) +#define EXCEPTION_LOAD_GPR3 l.mfspr r3,r0,SPR_SHADOW_GPR(3) + +#define EXCEPTION_STORE_GPR4 l.mtspr r0,r4,SPR_SHADOW_GPR(4) +#define EXCEPTION_LOAD_GPR4 l.mfspr r4,r0,SPR_SHADOW_GPR(4) +#define EXCEPTION_STORE_GPR5 l.mtspr r0,r5,SPR_SHADOW_GPR(5) +#define EXCEPTION_LOAD_GPR5 l.mfspr r5,r0,SPR_SHADOW_GPR(5) + +#define EXCEPTION_STORE_GPR6 l.mtspr r0,r6,SPR_SHADOW_GPR(6) +#define EXCEPTION_LOAD_GPR6 l.mfspr r6,r0,SPR_SHADOW_GPR(6) + +#else /* !CONFIG_OPENRISC_HAVE_SHADOW_GPRS */ #define EXCEPTION_STORE_GPR2 l.sw 0x64(r0),r2 #define EXCEPTION_LOAD_GPR2 l.lwz r2,0x64(r0) @@ -91,35 +129,67 @@ #define EXCEPTION_STORE_GPR6 l.sw 0x74(r0),r6 #define EXCEPTION_LOAD_GPR6 l.lwz r6,0x74(r0) +#endif /* * EXCEPTION_HANDLE temporary stores */ +#ifdef CONFIG_OPENRISC_HAVE_SHADOW_GPRS +#define EXCEPTION_T_STORE_GPR30 l.mtspr r0,r30,SPR_SHADOW_GPR(30) +#define EXCEPTION_T_LOAD_GPR30(reg) l.mfspr reg,r0,SPR_SHADOW_GPR(30) + +#define EXCEPTION_T_STORE_GPR10 l.mtspr r0,r10,SPR_SHADOW_GPR(10) +#define EXCEPTION_T_LOAD_GPR10(reg) l.mfspr reg,r0,SPR_SHADOW_GPR(10) + +#define EXCEPTION_T_STORE_SP l.mtspr r0,r1,SPR_SHADOW_GPR(1) +#define EXCEPTION_T_LOAD_SP(reg) l.mfspr reg,r0,SPR_SHADOW_GPR(1) + +#else /* !CONFIG_OPENRISC_HAVE_SHADOW_GPRS */ #define EXCEPTION_T_STORE_GPR30 l.sw 0x78(r0),r30 #define EXCEPTION_T_LOAD_GPR30(reg) l.lwz reg,0x78(r0) #define EXCEPTION_T_STORE_GPR10 l.sw 0x7c(r0),r10 #define EXCEPTION_T_LOAD_GPR10(reg) l.lwz reg,0x7c(r0) -#define EXCEPTION_T_STORE_SP l.sw 0x80(r0),r1 +#define EXCEPTION_T_STORE_SP l.sw 0x80(r0),r1 #define EXCEPTION_T_LOAD_SP(reg) l.lwz reg,0x80(r0) - -/* - * For UNHANLDED_EXCEPTION - */ - -#define EXCEPTION_T_STORE_GPR31 l.sw 0x84(r0),r31 -#define EXCEPTION_T_LOAD_GPR31(reg) l.lwz reg,0x84(r0) +#endif /* =========================================================[ macros ]=== */ - +#ifdef CONFIG_SMP +#define GET_CURRENT_PGD(reg,t1) \ + LOAD_SYMBOL_2_GPR(reg,current_pgd) ;\ + l.mfspr t1,r0,SPR_COREID ;\ + l.slli t1,t1,2 ;\ + l.add reg,reg,t1 ;\ + tophys (t1,reg) ;\ + l.lwz reg,0(t1) +#else #define GET_CURRENT_PGD(reg,t1) \ LOAD_SYMBOL_2_GPR(reg,current_pgd) ;\ tophys (t1,reg) ;\ l.lwz reg,0(t1) +#endif +/* Load r10 from current_thread_info_set - clobbers r1 and r30 */ +#ifdef CONFIG_SMP +#define GET_CURRENT_THREAD_INFO \ + LOAD_SYMBOL_2_GPR(r1,current_thread_info_set) ;\ + tophys (r30,r1) ;\ + l.mfspr r10,r0,SPR_COREID ;\ + l.slli r10,r10,2 ;\ + l.add r30,r30,r10 ;\ + /* r10: current_thread_info */ ;\ + l.lwz r10,0(r30) +#else +#define GET_CURRENT_THREAD_INFO \ + LOAD_SYMBOL_2_GPR(r1,current_thread_info_set) ;\ + tophys (r30,r1) ;\ + /* r10: current_thread_info */ ;\ + l.lwz r10,0(r30) +#endif /* * DSCR: this is a common hook for handling exceptions. it will save @@ -162,10 +232,7 @@ l.bnf 2f /* kernel_mode */ ;\ EXCEPTION_T_STORE_SP /* delay slot */ ;\ 1: /* user_mode: */ ;\ - LOAD_SYMBOL_2_GPR(r1,current_thread_info_set) ;\ - tophys (r30,r1) ;\ - /* r10: current_thread_info */ ;\ - l.lwz r10,0(r30) ;\ + GET_CURRENT_THREAD_INFO ;\ tophys (r30,r10) ;\ l.lwz r1,(TI_KSP)(r30) ;\ /* fall through */ ;\ @@ -225,7 +292,7 @@ * */ #define UNHANDLED_EXCEPTION(handler) \ - EXCEPTION_T_STORE_GPR31 ;\ + EXCEPTION_T_STORE_GPR30 ;\ EXCEPTION_T_STORE_GPR10 ;\ EXCEPTION_T_STORE_SP ;\ /* temporary store r3, r9 into r1, r10 */ ;\ @@ -254,35 +321,35 @@ /* r1: KSP, r10: current, r31: __pa(KSP) */ ;\ /* r12: temp, syscall indicator, r13 temp */ ;\ l.addi r1,r1,-(INT_FRAME_SIZE) ;\ - /* r1 is KSP, r31 is __pa(KSP) */ ;\ - tophys (r31,r1) ;\ - l.sw PT_GPR12(r31),r12 ;\ + /* r1 is KSP, r30 is __pa(KSP) */ ;\ + tophys (r30,r1) ;\ + l.sw PT_GPR12(r30),r12 ;\ l.mfspr r12,r0,SPR_EPCR_BASE ;\ - l.sw PT_PC(r31),r12 ;\ + l.sw PT_PC(r30),r12 ;\ l.mfspr r12,r0,SPR_ESR_BASE ;\ - l.sw PT_SR(r31),r12 ;\ + l.sw PT_SR(r30),r12 ;\ /* save r31 */ ;\ - EXCEPTION_T_LOAD_GPR31(r12) ;\ - l.sw PT_GPR31(r31),r12 ;\ + EXCEPTION_T_LOAD_GPR30(r12) ;\ + l.sw PT_GPR30(r30),r12 ;\ /* save r10 as was prior to exception */ ;\ EXCEPTION_T_LOAD_GPR10(r12) ;\ - l.sw PT_GPR10(r31),r12 ;\ + l.sw PT_GPR10(r30),r12 ;\ /* save PT_SP as was prior to exception */ ;\ EXCEPTION_T_LOAD_SP(r12) ;\ - l.sw PT_SP(r31),r12 ;\ - l.sw PT_GPR13(r31),r13 ;\ + l.sw PT_SP(r30),r12 ;\ + l.sw PT_GPR13(r30),r13 ;\ /* --> */ ;\ /* save exception r4, set r4 = EA */ ;\ - l.sw PT_GPR4(r31),r4 ;\ + l.sw PT_GPR4(r30),r4 ;\ l.mfspr r4,r0,SPR_EEAR_BASE ;\ /* r12 == 1 if we come from syscall */ ;\ CLEAR_GPR(r12) ;\ /* ----- play a MMU trick ----- */ ;\ - l.ori r31,r0,(EXCEPTION_SR) ;\ - l.mtspr r0,r31,SPR_ESR_BASE ;\ + l.ori r30,r0,(EXCEPTION_SR) ;\ + l.mtspr r0,r30,SPR_ESR_BASE ;\ /* r31: EA address of handler */ ;\ - LOAD_SYMBOL_2_GPR(r31,handler) ;\ - l.mtspr r0,r31,SPR_EPCR_BASE ;\ + LOAD_SYMBOL_2_GPR(r30,handler) ;\ + l.mtspr r0,r30,SPR_EPCR_BASE ;\ l.rfe /* =====================================================[ exceptions] === */ @@ -483,10 +550,17 @@ _start: CLEAR_GPR(r30) CLEAR_GPR(r31) +#ifdef CONFIG_SMP + l.mfspr r25,r0,SPR_COREID + l.sfeq r25,r0 + l.bnf secondary_wait + l.nop +#endif /* * set up initial ksp and current */ - LOAD_SYMBOL_2_GPR(r1,init_thread_union+0x2000) // setup kernel stack + /* setup kernel stack */ + LOAD_SYMBOL_2_GPR(r1,init_thread_union + THREAD_SIZE) LOAD_SYMBOL_2_GPR(r10,init_thread_union) // setup current tophys (r31,r10) l.sw TI_KSP(r31), r1 @@ -520,22 +594,8 @@ enable_dc: l.nop flush_tlb: - /* - * I N V A L I D A T E T L B e n t r i e s - */ - LOAD_SYMBOL_2_GPR(r5,SPR_DTLBMR_BASE(0)) - LOAD_SYMBOL_2_GPR(r6,SPR_ITLBMR_BASE(0)) - l.addi r7,r0,128 /* Maximum number of sets */ -1: - l.mtspr r5,r0,0x0 - l.mtspr r6,r0,0x0 - - l.addi r5,r5,1 - l.addi r6,r6,1 - l.sfeq r7,r0 - l.bnf 1b - l.addi r7,r7,-1 - + l.jal _flush_tlb + l.nop /* The MMU needs to be enabled before or32_early_setup is called */ @@ -627,6 +687,84 @@ jump_start_kernel: l.jr r30 l.nop +_flush_tlb: + /* + * I N V A L I D A T E T L B e n t r i e s + */ + LOAD_SYMBOL_2_GPR(r5,SPR_DTLBMR_BASE(0)) + LOAD_SYMBOL_2_GPR(r6,SPR_ITLBMR_BASE(0)) + l.addi r7,r0,128 /* Maximum number of sets */ +1: + l.mtspr r5,r0,0x0 + l.mtspr r6,r0,0x0 + + l.addi r5,r5,1 + l.addi r6,r6,1 + l.sfeq r7,r0 + l.bnf 1b + l.addi r7,r7,-1 + + l.jr r9 + l.nop + +#ifdef CONFIG_SMP +secondary_wait: + l.mfspr r25,r0,SPR_COREID + l.movhi r3,hi(secondary_release) + l.ori r3,r3,lo(secondary_release) + tophys(r4, r3) + l.lwz r3,0(r4) + l.sfeq r25,r3 + l.bnf secondary_wait + l.nop + /* fall through to secondary_init */ + +secondary_init: + /* + * set up initial ksp and current + */ + LOAD_SYMBOL_2_GPR(r10, secondary_thread_info) + tophys (r30,r10) + l.lwz r10,0(r30) + l.addi r1,r10,THREAD_SIZE + tophys (r30,r10) + l.sw TI_KSP(r30),r1 + + l.jal _ic_enable + l.nop + + l.jal _dc_enable + l.nop + + l.jal _flush_tlb + l.nop + + /* + * enable dmmu & immu + */ + l.mfspr r30,r0,SPR_SR + l.movhi r28,hi(SPR_SR_DME | SPR_SR_IME) + l.ori r28,r28,lo(SPR_SR_DME | SPR_SR_IME) + l.or r30,r30,r28 + /* + * This is a bit tricky, we need to switch over from physical addresses + * to virtual addresses on the fly. + * To do that, we first set up ESR with the IME and DME bits set. + * Then EPCR is set to secondary_start and then a l.rfe is issued to + * "jump" to that. + */ + l.mtspr r0,r30,SPR_ESR_BASE + LOAD_SYMBOL_2_GPR(r30, secondary_start) + l.mtspr r0,r30,SPR_EPCR_BASE + l.rfe + +secondary_start: + LOAD_SYMBOL_2_GPR(r30, secondary_start_kernel) + l.jr r30 + l.nop + +#endif + /* ========================================[ cache ]=== */ /* aligment here so we don't change memory offsets with @@ -971,8 +1109,6 @@ ENTRY(dtlb_miss_handler) EXCEPTION_STORE_GPR2 EXCEPTION_STORE_GPR3 EXCEPTION_STORE_GPR4 - EXCEPTION_STORE_GPR5 - EXCEPTION_STORE_GPR6 /* * get EA of the miss */ @@ -980,91 +1116,70 @@ ENTRY(dtlb_miss_handler) /* * pmd = (pmd_t *)(current_pgd + pgd_index(daddr)); */ - GET_CURRENT_PGD(r3,r5) // r3 is current_pgd, r5 is temp + GET_CURRENT_PGD(r3,r4) // r3 is current_pgd, r4 is temp l.srli r4,r2,0x18 // >> PAGE_SHIFT + (PAGE_SHIFT - 2) l.slli r4,r4,0x2 // to get address << 2 - l.add r5,r4,r3 // r4 is pgd_index(daddr) + l.add r3,r4,r3 // r4 is pgd_index(daddr) /* * if (pmd_none(*pmd)) * goto pmd_none: */ - tophys (r4,r5) + tophys (r4,r3) l.lwz r3,0x0(r4) // get *pmd value l.sfne r3,r0 l.bnf d_pmd_none - l.andi r3,r3,~PAGE_MASK //0x1fff // ~PAGE_MASK - /* - * if (pmd_bad(*pmd)) - * pmd_clear(pmd) - * goto pmd_bad: - */ -// l.sfeq r3,r0 // check *pmd value -// l.bf d_pmd_good - l.addi r3,r0,0xffffe000 // PAGE_MASK -// l.j d_pmd_bad -// l.sw 0x0(r4),r0 // clear pmd + l.addi r3,r0,0xffffe000 // PAGE_MASK + d_pmd_good: /* * pte = *pte_offset(pmd, daddr); */ l.lwz r4,0x0(r4) // get **pmd value l.and r4,r4,r3 // & PAGE_MASK - l.srli r5,r2,0xd // >> PAGE_SHIFT, r2 == EEAR - l.andi r3,r5,0x7ff // (1UL << PAGE_SHIFT - 2) - 1 + l.srli r2,r2,0xd // >> PAGE_SHIFT, r2 == EEAR + l.andi r3,r2,0x7ff // (1UL << PAGE_SHIFT - 2) - 1 l.slli r3,r3,0x2 // to get address << 2 l.add r3,r3,r4 - l.lwz r2,0x0(r3) // this is pte at last + l.lwz r3,0x0(r3) // this is pte at last /* * if (!pte_present(pte)) */ - l.andi r4,r2,0x1 + l.andi r4,r3,0x1 l.sfne r4,r0 // is pte present l.bnf d_pte_not_present - l.addi r3,r0,0xffffe3fa // PAGE_MASK | DTLB_UP_CONVERT_MASK + l.addi r4,r0,0xffffe3fa // PAGE_MASK | DTLB_UP_CONVERT_MASK /* * fill DTLB TR register */ - l.and r4,r2,r3 // apply the mask + l.and r4,r3,r4 // apply the mask // Determine number of DMMU sets - l.mfspr r6, r0, SPR_DMMUCFGR - l.andi r6, r6, SPR_DMMUCFGR_NTS - l.srli r6, r6, SPR_DMMUCFGR_NTS_OFF + l.mfspr r2, r0, SPR_DMMUCFGR + l.andi r2, r2, SPR_DMMUCFGR_NTS + l.srli r2, r2, SPR_DMMUCFGR_NTS_OFF l.ori r3, r0, 0x1 - l.sll r3, r3, r6 // r3 = number DMMU sets DMMUCFGR - l.addi r6, r3, -1 // r6 = nsets mask - l.and r5, r5, r6 // calc offset: & (NUM_TLB_ENTRIES-1) + l.sll r3, r3, r2 // r3 = number DMMU sets DMMUCFGR + l.addi r2, r3, -1 // r2 = nsets mask + l.mfspr r3, r0, SPR_EEAR_BASE + l.srli r3, r3, 0xd // >> PAGE_SHIFT + l.and r2, r3, r2 // calc offset: & (NUM_TLB_ENTRIES-1) //NUM_TLB_ENTRIES - l.mtspr r5,r4,SPR_DTLBTR_BASE(0) + l.mtspr r2,r4,SPR_DTLBTR_BASE(0) /* * fill DTLB MR register */ - l.mfspr r2,r0,SPR_EEAR_BASE - l.addi r3,r0,0xffffe000 // PAGE_MASK - l.and r4,r2,r3 // apply PAGE_MASK to EA (__PHX__ do we really need this?) - l.ori r4,r4,0x1 // set hardware valid bit: DTBL_MR entry - l.mtspr r5,r4,SPR_DTLBMR_BASE(0) + l.slli r3, r3, 0xd /* << PAGE_SHIFT => EA & PAGE_MASK */ + l.ori r4,r3,0x1 // set hardware valid bit: DTBL_MR entry + l.mtspr r2,r4,SPR_DTLBMR_BASE(0) EXCEPTION_LOAD_GPR2 EXCEPTION_LOAD_GPR3 EXCEPTION_LOAD_GPR4 - EXCEPTION_LOAD_GPR5 - EXCEPTION_LOAD_GPR6 - l.rfe -d_pmd_bad: - l.nop 1 - EXCEPTION_LOAD_GPR2 - EXCEPTION_LOAD_GPR3 - EXCEPTION_LOAD_GPR4 - EXCEPTION_LOAD_GPR5 - EXCEPTION_LOAD_GPR6 l.rfe d_pmd_none: d_pte_not_present: EXCEPTION_LOAD_GPR2 EXCEPTION_LOAD_GPR3 EXCEPTION_LOAD_GPR4 - EXCEPTION_LOAD_GPR5 - EXCEPTION_LOAD_GPR6 EXCEPTION_HANDLE(_dtlb_miss_page_fault_handler) /* ==============================================[ ITLB miss handler ]=== */ @@ -1072,8 +1187,6 @@ ENTRY(itlb_miss_handler) EXCEPTION_STORE_GPR2 EXCEPTION_STORE_GPR3 EXCEPTION_STORE_GPR4 - EXCEPTION_STORE_GPR5 - EXCEPTION_STORE_GPR6 /* * get EA of the miss */ @@ -1083,30 +1196,19 @@ ENTRY(itlb_miss_handler) * pmd = (pmd_t *)(current_pgd + pgd_index(daddr)); * */ - GET_CURRENT_PGD(r3,r5) // r3 is current_pgd, r5 is temp + GET_CURRENT_PGD(r3,r4) // r3 is current_pgd, r5 is temp l.srli r4,r2,0x18 // >> PAGE_SHIFT + (PAGE_SHIFT - 2) l.slli r4,r4,0x2 // to get address << 2 - l.add r5,r4,r3 // r4 is pgd_index(daddr) + l.add r3,r4,r3 // r4 is pgd_index(daddr) /* * if (pmd_none(*pmd)) * goto pmd_none: */ - tophys (r4,r5) + tophys (r4,r3) l.lwz r3,0x0(r4) // get *pmd value l.sfne r3,r0 l.bnf i_pmd_none - l.andi r3,r3,0x1fff // ~PAGE_MASK - /* - * if (pmd_bad(*pmd)) - * pmd_clear(pmd) - * goto pmd_bad: - */ - -// l.sfeq r3,r0 // check *pmd value -// l.bf i_pmd_good - l.addi r3,r0,0xffffe000 // PAGE_MASK -// l.j i_pmd_bad -// l.sw 0x0(r4),r0 // clear pmd + l.addi r3,r0,0xffffe000 // PAGE_MASK i_pmd_good: /* @@ -1115,35 +1217,36 @@ i_pmd_good: */ l.lwz r4,0x0(r4) // get **pmd value l.and r4,r4,r3 // & PAGE_MASK - l.srli r5,r2,0xd // >> PAGE_SHIFT, r2 == EEAR - l.andi r3,r5,0x7ff // (1UL << PAGE_SHIFT - 2) - 1 + l.srli r2,r2,0xd // >> PAGE_SHIFT, r2 == EEAR + l.andi r3,r2,0x7ff // (1UL << PAGE_SHIFT - 2) - 1 l.slli r3,r3,0x2 // to get address << 2 l.add r3,r3,r4 - l.lwz r2,0x0(r3) // this is pte at last + l.lwz r3,0x0(r3) // this is pte at last /* * if (!pte_present(pte)) * */ - l.andi r4,r2,0x1 + l.andi r4,r3,0x1 l.sfne r4,r0 // is pte present l.bnf i_pte_not_present - l.addi r3,r0,0xffffe03a // PAGE_MASK | ITLB_UP_CONVERT_MASK + l.addi r4,r0,0xffffe03a // PAGE_MASK | ITLB_UP_CONVERT_MASK /* * fill ITLB TR register */ - l.and r4,r2,r3 // apply the mask - l.andi r3,r2,0x7c0 // _PAGE_EXEC | _PAGE_SRE | _PAGE_SWE | _PAGE_URE | _PAGE_UWE -// l.andi r3,r2,0x400 // _PAGE_EXEC + l.and r4,r3,r4 // apply the mask + l.andi r3,r3,0x7c0 // _PAGE_EXEC | _PAGE_SRE | _PAGE_SWE | _PAGE_URE | _PAGE_UWE l.sfeq r3,r0 l.bf itlb_tr_fill //_workaround // Determine number of IMMU sets - l.mfspr r6, r0, SPR_IMMUCFGR - l.andi r6, r6, SPR_IMMUCFGR_NTS - l.srli r6, r6, SPR_IMMUCFGR_NTS_OFF + l.mfspr r2, r0, SPR_IMMUCFGR + l.andi r2, r2, SPR_IMMUCFGR_NTS + l.srli r2, r2, SPR_IMMUCFGR_NTS_OFF l.ori r3, r0, 0x1 - l.sll r3, r3, r6 // r3 = number IMMU sets IMMUCFGR - l.addi r6, r3, -1 // r6 = nsets mask - l.and r5, r5, r6 // calc offset: & (NUM_TLB_ENTRIES-1) + l.sll r3, r3, r2 // r3 = number IMMU sets IMMUCFGR + l.addi r2, r3, -1 // r2 = nsets mask + l.mfspr r3, r0, SPR_EEAR_BASE + l.srli r3, r3, 0xd // >> PAGE_SHIFT + l.and r2, r3, r2 // calc offset: & (NUM_TLB_ENTRIES-1) /* * __PHX__ :: fixme @@ -1155,38 +1258,24 @@ i_pmd_good: itlb_tr_fill_workaround: l.ori r4,r4,0xc0 // | (SPR_ITLBTR_UXE | ITLBTR_SXE) itlb_tr_fill: - l.mtspr r5,r4,SPR_ITLBTR_BASE(0) + l.mtspr r2,r4,SPR_ITLBTR_BASE(0) /* * fill DTLB MR register */ - l.mfspr r2,r0,SPR_EEAR_BASE - l.addi r3,r0,0xffffe000 // PAGE_MASK - l.and r4,r2,r3 // apply PAGE_MASK to EA (__PHX__ do we really need this?) - l.ori r4,r4,0x1 // set hardware valid bit: DTBL_MR entry - l.mtspr r5,r4,SPR_ITLBMR_BASE(0) + l.slli r3, r3, 0xd /* << PAGE_SHIFT => EA & PAGE_MASK */ + l.ori r4,r3,0x1 // set hardware valid bit: ITBL_MR entry + l.mtspr r2,r4,SPR_ITLBMR_BASE(0) EXCEPTION_LOAD_GPR2 EXCEPTION_LOAD_GPR3 EXCEPTION_LOAD_GPR4 - EXCEPTION_LOAD_GPR5 - EXCEPTION_LOAD_GPR6 l.rfe -i_pmd_bad: - l.nop 1 - EXCEPTION_LOAD_GPR2 - EXCEPTION_LOAD_GPR3 - EXCEPTION_LOAD_GPR4 - EXCEPTION_LOAD_GPR5 - EXCEPTION_LOAD_GPR6 - l.rfe i_pmd_none: i_pte_not_present: EXCEPTION_LOAD_GPR2 EXCEPTION_LOAD_GPR3 EXCEPTION_LOAD_GPR4 - EXCEPTION_LOAD_GPR5 - EXCEPTION_LOAD_GPR6 EXCEPTION_HANDLE(_itlb_miss_page_fault_handler) /* ==============================================[ boot tlb handlers ]=== */ diff --git a/arch/openrisc/kernel/or32_ksyms.c b/arch/openrisc/kernel/or32_ksyms.c index 83ccf7c0c58d2d..48030f01cac787 100644 --- a/arch/openrisc/kernel/or32_ksyms.c +++ b/arch/openrisc/kernel/or32_ksyms.c @@ -44,3 +44,4 @@ DECLARE_EXPORT(__ashldi3); DECLARE_EXPORT(__lshrdi3); EXPORT_SYMBOL(__copy_tofrom_user); +EXPORT_SYMBOL(memset); diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c index 7095dfe7666ba3..e027f603e9335b 100644 --- a/arch/openrisc/kernel/process.c +++ b/arch/openrisc/kernel/process.c @@ -75,6 +75,19 @@ void machine_power_off(void) __asm__("l.nop 1"); } +/* + * Send the doze signal to the cpu if available. + * Make sure, that all interrupts are enabled + */ +void arch_cpu_idle(void) +{ + unsigned long upr; + local_irq_enable(); + upr = mfspr(SPR_UPR); + if (upr & SPR_UPR_PMP) + mtspr(SPR_PMR, mfspr(SPR_PMR) | SPR_PMR_DME); +} + void (*pm_power_off) (void) = machine_power_off; /* @@ -173,6 +186,19 @@ copy_thread(unsigned long clone_flags, unsigned long usp, if (usp) userregs->sp = usp; + + /* + * For CLONE_SETTLS set "tp" (r10) to the TLS pointer passed to sys_clone. + * + * The kernel entry is: + * int clone (long flags, void *child_stack, int *parent_tid, + * int *child_tid, struct void *tls) + * + * This makes the source r7 in the kernel registers. + */ + if (clone_flags & CLONE_SETTLS) + userregs->gpr[10] = userregs->gpr[7]; + userregs->gpr[11] = 0; /* Result from fork() */ kregs->gpr[20] = 0; /* Userspace thread */ @@ -213,6 +239,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t * fpu) extern struct thread_info *_switch(struct thread_info *old_ti, struct thread_info *new_ti); +extern int lwa_flag; struct task_struct *__switch_to(struct task_struct *old, struct task_struct *new) @@ -230,6 +257,8 @@ struct task_struct *__switch_to(struct task_struct *old, new_ti = new->stack; old_ti = old->stack; + lwa_flag = 0; + current_thread_info_set[smp_processor_id()] = new_ti; last = (_switch(old_ti, new_ti))->task; diff --git a/arch/openrisc/kernel/ptrace.c b/arch/openrisc/kernel/ptrace.c index 4f59fa4e34e5f2..228288887d74fa 100644 --- a/arch/openrisc/kernel/ptrace.c +++ b/arch/openrisc/kernel/ptrace.c @@ -16,7 +16,6 @@ * 2 of the License, or (at your option) any later version. */ -#include #include #include #include diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index b4ed8b36e078df..04c0d1ebc9a459 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -104,7 +105,11 @@ static unsigned long __init setup_memory(void) return ram_end_pfn; } -struct cpuinfo cpuinfo; +struct cpuinfo_or1k cpuinfo_or1k[NR_CPUS]; + +#ifdef CONFIG_VGA_CONSOLE +struct screen_info screen_info; +#endif static void print_cpuinfo(void) { @@ -112,12 +117,13 @@ static void print_cpuinfo(void) unsigned long vr = mfspr(SPR_VR); unsigned int version; unsigned int revision; + struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[smp_processor_id()]; version = (vr & SPR_VR_VER) >> 24; revision = (vr & SPR_VR_REV); printk(KERN_INFO "CPU: OpenRISC-%x (revision %d) @%d MHz\n", - version, revision, cpuinfo.clock_frequency / 1000000); + version, revision, cpuinfo->clock_frequency / 1000000); if (!(upr & SPR_UPR_UP)) { printk(KERN_INFO @@ -128,13 +134,15 @@ static void print_cpuinfo(void) if (upr & SPR_UPR_DCP) printk(KERN_INFO "-- dcache: %4d bytes total, %2d bytes/line, %d way(s)\n", - cpuinfo.dcache_size, cpuinfo.dcache_block_size, 1); + cpuinfo->dcache_size, cpuinfo->dcache_block_size, + cpuinfo->dcache_ways); else printk(KERN_INFO "-- dcache disabled\n"); if (upr & SPR_UPR_ICP) printk(KERN_INFO "-- icache: %4d bytes total, %2d bytes/line, %d way(s)\n", - cpuinfo.icache_size, cpuinfo.icache_block_size, 1); + cpuinfo->icache_size, cpuinfo->icache_block_size, + cpuinfo->icache_ways); else printk(KERN_INFO "-- icache disabled\n"); @@ -162,32 +170,50 @@ static void print_cpuinfo(void) printk(KERN_INFO "-- custom unit(s)\n"); } +static struct device_node *setup_find_cpu_node(int cpu) +{ + u32 hwid; + struct device_node *cpun; + struct device_node *cpus = of_find_node_by_path("/cpus"); + + for_each_available_child_of_node(cpus, cpun) { + if (of_property_read_u32(cpun, "reg", &hwid)) + continue; + if (hwid == cpu) + return cpun; + } + + return NULL; +} + void __init setup_cpuinfo(void) { struct device_node *cpu; unsigned long iccfgr, dccfgr; - unsigned long cache_set_size, cache_ways; + unsigned long cache_set_size; + int cpu_id = smp_processor_id(); + struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[cpu_id]; - cpu = of_find_compatible_node(NULL, NULL, "opencores,or1200-rtlsvn481"); + cpu = setup_find_cpu_node(cpu_id); if (!cpu) - panic("No compatible CPU found in device tree...\n"); + panic("Couldn't find CPU%d in device tree...\n", cpu_id); iccfgr = mfspr(SPR_ICCFGR); - cache_ways = 1 << (iccfgr & SPR_ICCFGR_NCW); + cpuinfo->icache_ways = 1 << (iccfgr & SPR_ICCFGR_NCW); cache_set_size = 1 << ((iccfgr & SPR_ICCFGR_NCS) >> 3); - cpuinfo.icache_block_size = 16 << ((iccfgr & SPR_ICCFGR_CBS) >> 7); - cpuinfo.icache_size = - cache_set_size * cache_ways * cpuinfo.icache_block_size; + cpuinfo->icache_block_size = 16 << ((iccfgr & SPR_ICCFGR_CBS) >> 7); + cpuinfo->icache_size = + cache_set_size * cpuinfo->icache_ways * cpuinfo->icache_block_size; dccfgr = mfspr(SPR_DCCFGR); - cache_ways = 1 << (dccfgr & SPR_DCCFGR_NCW); + cpuinfo->dcache_ways = 1 << (dccfgr & SPR_DCCFGR_NCW); cache_set_size = 1 << ((dccfgr & SPR_DCCFGR_NCS) >> 3); - cpuinfo.dcache_block_size = 16 << ((dccfgr & SPR_DCCFGR_CBS) >> 7); - cpuinfo.dcache_size = - cache_set_size * cache_ways * cpuinfo.dcache_block_size; + cpuinfo->dcache_block_size = 16 << ((dccfgr & SPR_DCCFGR_CBS) >> 7); + cpuinfo->dcache_size = + cache_set_size * cpuinfo->dcache_ways * cpuinfo->dcache_block_size; if (of_property_read_u32(cpu, "clock-frequency", - &cpuinfo.clock_frequency)) { + &cpuinfo->clock_frequency)) { printk(KERN_WARNING "Device tree missing CPU 'clock-frequency' parameter." "Assuming frequency 25MHZ" @@ -269,8 +295,8 @@ void __init detect_unit_config(unsigned long upr, unsigned long mask, void calibrate_delay(void) { const int *val; - struct device_node *cpu = NULL; - cpu = of_find_compatible_node(NULL, NULL, "opencores,or1200-rtlsvn481"); + struct device_node *cpu = setup_find_cpu_node(smp_processor_id()); + val = of_get_property(cpu, "clock-frequency", NULL); if (!val) panic("no cpu 'clock-frequency' parameter in device tree"); @@ -282,12 +308,14 @@ void calibrate_delay(void) void __init setup_arch(char **cmdline_p) { - unsigned long max_low_pfn; - unflatten_and_copy_device_tree(); setup_cpuinfo(); +#ifdef CONFIG_SMP + smp_init_cpus(); +#endif + /* 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; @@ -322,45 +350,71 @@ void __init setup_arch(char **cmdline_p) static int show_cpuinfo(struct seq_file *m, void *v) { - unsigned long vr; - int version, revision; + unsigned int vr, cpucfgr; + unsigned int avr; + unsigned int version; + unsigned long n = (unsigned long) v - 1; + struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[n]; vr = mfspr(SPR_VR); - version = (vr & SPR_VR_VER) >> 24; - revision = vr & SPR_VR_REV; - - seq_printf(m, - "cpu\t\t: OpenRISC-%x\n" - "revision\t: %d\n" - "frequency\t: %ld\n" - "dcache size\t: %d bytes\n" - "dcache block size\t: %d bytes\n" - "icache size\t: %d bytes\n" - "icache block size\t: %d bytes\n" - "immu\t\t: %d entries, %lu ways\n" - "dmmu\t\t: %d entries, %lu ways\n" - "bogomips\t: %lu.%02lu\n", - version, - revision, - loops_per_jiffy * HZ, - cpuinfo.dcache_size, - cpuinfo.dcache_block_size, - cpuinfo.icache_size, - cpuinfo.icache_block_size, + cpucfgr = mfspr(SPR_CPUCFGR); + +#ifdef CONFIG_SMP + seq_printf(m, "processor\t\t: %ld\n", n); +#endif + if (vr & SPR_VR_UVRP) { + vr = mfspr(SPR_VR2); + version = vr & SPR_VR2_VER; + avr = mfspr(SPR_AVR); + seq_printf(m, "cpu architecture\t: " + "OpenRISC 1000 (%d.%d-rev%d)\n", + (avr >> 24) & 0xff, + (avr >> 16) & 0xff, + (avr >> 8) & 0xff); + seq_printf(m, "cpu implementation id\t: 0x%x\n", + (vr & SPR_VR2_CPUID) >> 24); + seq_printf(m, "cpu version\t\t: 0x%x\n", version); + } else { + version = (vr & SPR_VR_VER) >> 24; + seq_printf(m, "cpu\t\t\t: OpenRISC-%x\n", version); + seq_printf(m, "revision\t\t: %d\n", vr & SPR_VR_REV); + } + seq_printf(m, "frequency\t\t: %ld\n", loops_per_jiffy * HZ); + seq_printf(m, "dcache size\t\t: %d bytes\n", cpuinfo->dcache_size); + seq_printf(m, "dcache block size\t: %d bytes\n", + cpuinfo->dcache_block_size); + seq_printf(m, "dcache ways\t\t: %d\n", cpuinfo->dcache_ways); + seq_printf(m, "icache size\t\t: %d bytes\n", cpuinfo->icache_size); + seq_printf(m, "icache block size\t: %d bytes\n", + cpuinfo->icache_block_size); + seq_printf(m, "icache ways\t\t: %d\n", cpuinfo->icache_ways); + seq_printf(m, "immu\t\t\t: %d entries, %lu ways\n", 1 << ((mfspr(SPR_DMMUCFGR) & SPR_DMMUCFGR_NTS) >> 2), - 1 + (mfspr(SPR_DMMUCFGR) & SPR_DMMUCFGR_NTW), + 1 + (mfspr(SPR_DMMUCFGR) & SPR_DMMUCFGR_NTW)); + seq_printf(m, "dmmu\t\t\t: %d entries, %lu ways\n", 1 << ((mfspr(SPR_IMMUCFGR) & SPR_IMMUCFGR_NTS) >> 2), - 1 + (mfspr(SPR_IMMUCFGR) & SPR_IMMUCFGR_NTW), + 1 + (mfspr(SPR_IMMUCFGR) & SPR_IMMUCFGR_NTW)); + seq_printf(m, "bogomips\t\t: %lu.%02lu\n", (loops_per_jiffy * HZ) / 500000, ((loops_per_jiffy * HZ) / 5000) % 100); + seq_printf(m, "features\t\t: "); + seq_printf(m, "%s ", cpucfgr & SPR_CPUCFGR_OB32S ? "orbis32" : ""); + seq_printf(m, "%s ", cpucfgr & SPR_CPUCFGR_OB64S ? "orbis64" : ""); + seq_printf(m, "%s ", cpucfgr & SPR_CPUCFGR_OF32S ? "orfpx32" : ""); + seq_printf(m, "%s ", cpucfgr & SPR_CPUCFGR_OF64S ? "orfpx64" : ""); + seq_printf(m, "%s ", cpucfgr & SPR_CPUCFGR_OV64S ? "orvdx64" : ""); + seq_printf(m, "\n"); + + seq_printf(m, "\n"); + return 0; } static void *c_start(struct seq_file *m, loff_t * pos) { - /* We only have one CPU... */ - return *pos < 1 ? (void *)1 : NULL; + unsigned long i = *pos; + return i < NR_CPUS ? (void *) (i + 1) : NULL; } static void *c_next(struct seq_file *m, void *v, loff_t * pos) diff --git a/arch/openrisc/kernel/smp.c b/arch/openrisc/kernel/smp.c new file mode 100644 index 00000000000000..789a07482b0c17 --- /dev/null +++ b/arch/openrisc/kernel/smp.c @@ -0,0 +1,225 @@ +/* + * Copyright (C) 2014 Stefan Kristiansson + * + * Based on arm64 and arc implementations + * Copyright (C) 2013 ARM Ltd. + * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include + +volatile unsigned long secondary_release = -1; +struct thread_info *secondary_thread_info; + +enum ipi_msg_type { + IPI_RESCHEDULE, + IPI_CALL_FUNC, + IPI_CALL_FUNC_SINGLE, + IPI_CPU_STOP, + IPI_TIMER, +}; + +static phys_addr_t cpu_release_addr[NR_CPUS]; +static DEFINE_SPINLOCK(boot_lock); + +static int boot_secondary(unsigned int cpu, struct task_struct *idle) +{ + /* + * set synchronisation state between this boot processor + * and the secondary one + */ + spin_lock(&boot_lock); + + secondary_release = cpu; + + /* + * now the secondary core is starting up let it run its + * calibrations, then wait for it to finish + */ + spin_unlock(&boot_lock); + + return 0; +} + +void __init smp_prepare_boot_cpu(void) +{ +} + +void __init smp_init_cpus(void) +{ + int i; + + for (i = 0; i < NR_CPUS; i++) + set_cpu_possible(i, true); +} + +void __init smp_prepare_cpus(unsigned int max_cpus) +{ + int i; + + /* + * Initialise the present map, which describes the set of CPUs + * actually populated at the present time. + */ + for (i = 0; i < max_cpus; i++) + set_cpu_present(i, true); +} + +void __init smp_cpus_done(unsigned int max_cpus) +{ + +} + +static DECLARE_COMPLETION(cpu_running); + +int __cpu_up(unsigned int cpu, struct task_struct *idle) +{ + int ret; + + secondary_thread_info = task_thread_info(idle); + current_pgd[cpu] = init_mm.pgd; + + ret = boot_secondary(cpu, idle); + if (ret == 0) { + wait_for_completion_timeout(&cpu_running, + msecs_to_jiffies(1000)); + if (!cpu_online(cpu)) + ret = -EIO; + } + + return ret; +} + +extern void openrisc_clockevent_init(void); + +asmlinkage void secondary_start_kernel(void) +{ + struct mm_struct *mm = &init_mm; + unsigned int cpu = smp_processor_id(); + /* + * All kernel threads share the same mm context; grab a + * reference and switch to it. + */ + atomic_inc(&mm->mm_count); + current->active_mm = mm; + cpumask_set_cpu(cpu, mm_cpumask(mm)); + + printk("CPU%u: Booted secondary processor\n", cpu); + + setup_cpuinfo(); + openrisc_clockevent_init(); + + notify_cpu_starting(cpu); + + /* + * OK, now it's safe to let the boot CPU continue + */ + set_cpu_online(cpu, true); + complete(&cpu_running); + + local_irq_enable(); + + /* + * OK, it's off to the idle thread for us + */ + cpu_startup_entry(CPUHP_ONLINE); +} + +void handle_IPI(int ipinr) +{ + unsigned int cpu = smp_processor_id(); + + switch (ipinr) { + case IPI_RESCHEDULE: + scheduler_ipi(); + break; + + case IPI_CALL_FUNC: + generic_smp_call_function_interrupt(); + break; + + case IPI_CALL_FUNC_SINGLE: + generic_smp_call_function_single_interrupt(); + break; + + default: + pr_crit("CPU%u: Unknown IPI message 0x%x\n", cpu, ipinr); + BUG(); + break; + } +} + +static void (*smp_cross_call)(const struct cpumask *, unsigned int); + +#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST +void tick_broadcast(const struct cpumask *mask) +{ + smp_cross_call(mask, IPI_TIMER); +} +#endif + +void smp_send_reschedule(int cpu) +{ + smp_cross_call(cpumask_of(cpu), IPI_RESCHEDULE); +} + +void smp_send_stop(void) +{ + BUG(); /* SJK TODO */ +} + +void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned int)) +{ + smp_cross_call = fn; +} + +void arch_send_call_function_single_ipi(int cpu) +{ + smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); +} + +void arch_send_call_function_ipi_mask(const struct cpumask *mask) +{ + smp_cross_call(mask, IPI_CALL_FUNC); +} + +/* TLB flush operations - Performed on each CPU*/ +static inline void ipi_flush_tlb_all(void *ignored) +{ + local_flush_tlb_all(); +} + +void flush_tlb_all(void) +{ + on_each_cpu(ipi_flush_tlb_all, NULL, 1); +} + +/* + * FIXME: implement proper functionality instead of flush_tlb_all. + * *But*, as things currently stands, the local_tlb_flush_* functions will + * all boil down to local_tlb_flush_all anyway. + */ +void flush_tlb_mm(struct mm_struct *mm) +{ + on_each_cpu(ipi_flush_tlb_all, NULL, 1); +} + +void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) +{ + on_each_cpu(ipi_flush_tlb_all, NULL, 1); +} + +void flush_tlb_range(struct vm_area_struct *vma, + unsigned long start, unsigned long end) +{ + on_each_cpu(ipi_flush_tlb_all, NULL, 1); +} diff --git a/arch/openrisc/kernel/time.c b/arch/openrisc/kernel/time.c index 7c52e9494a8de0..03fcdb9582727b 100644 --- a/arch/openrisc/kernel/time.c +++ b/arch/openrisc/kernel/time.c @@ -71,19 +71,47 @@ static void openrisc_timer_set_mode(enum clock_event_mode mode, } } +void *tc_base; + /* This is the clock event device based on the OR1K tick timer. * As the timer is being used as a continuous clock-source (required for HR * timers) we cannot enable the PERIODIC feature. The tick timer can run using * one-shot events, so no problem. */ +DEFINE_PER_CPU(struct clock_event_device, clockevent_openrisc_timer); -static struct clock_event_device clockevent_openrisc_timer = { - .name = "openrisc_timer_clockevent", - .features = CLOCK_EVT_FEAT_ONESHOT, - .rating = 300, - .set_next_event = openrisc_timer_set_next_event, - .set_mode = openrisc_timer_set_mode, -}; +void openrisc_clockevent_init(void) +{ + unsigned int cpu = smp_processor_id(); + struct clock_event_device *evt = + &per_cpu(clockevent_openrisc_timer, cpu); + struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[cpu]; + + mtspr(SPR_TTMR, SPR_TTMR_CR); + +#ifdef CONFIG_SMP + /* HACK: Synchronize local timer to global timer... */ + u32 c = ioread32be(tc_base); + mtspr(SPR_TTCR, c); + printk("SJK DEBUG: %s: c = %x\n", __func__, c); +#endif + +#ifdef CONFIG_SMP + evt->broadcast = tick_broadcast; +#endif + evt->name = "openrisc_timer_clockevent", + evt->features = CLOCK_EVT_FEAT_ONESHOT, + evt->rating = 300, + evt->set_next_event = openrisc_timer_set_next_event, + evt->set_mode = openrisc_timer_set_mode, + + evt->cpumask = cpumask_of(cpu); + + /* We only have 28 bits */ + clockevents_config_and_register(evt, cpuinfo->clock_frequency, + 100, 0x0fffffff); + +} static inline void timer_ack(void) { @@ -107,7 +135,9 @@ static inline void timer_ack(void) irqreturn_t __irq_entry timer_interrupt(struct pt_regs *regs) { struct pt_regs *old_regs = set_irq_regs(regs); - struct clock_event_device *evt = &clockevent_openrisc_timer; + unsigned int cpu = smp_processor_id(); + struct clock_event_device *evt = + &per_cpu(clockevent_openrisc_timer, cpu); timer_ack(); @@ -123,24 +153,12 @@ irqreturn_t __irq_entry timer_interrupt(struct pt_regs *regs) return IRQ_HANDLED; } -static __init void openrisc_clockevent_init(void) -{ - clockevent_openrisc_timer.cpumask = cpumask_of(0); - - /* We only have 28 bits */ - clockevents_config_and_register(&clockevent_openrisc_timer, - cpuinfo.clock_frequency, - 100, 0x0fffffff); - -} - /** * Clocksource: Based on OpenRISC timer/counter * * This sets up the OpenRISC Tick Timer as a clock source. The tick timer * is 32 bits wide and runs at the CPU clock frequency. */ - static cycle_t openrisc_timer_read(struct clocksource *cs) { return (cycle_t) mfspr(SPR_TTCR); @@ -156,12 +174,22 @@ static struct clocksource openrisc_timer = { static int __init openrisc_timer_init(void) { - if (clocksource_register_hz(&openrisc_timer, cpuinfo.clock_frequency)) + struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[smp_processor_id()]; + + if (clocksource_register_hz(&openrisc_timer, cpuinfo->clock_frequency)) panic("failed to register clocksource"); /* Enable the incrementer: 'continuous' mode with interrupt disabled */ mtspr(SPR_TTMR, SPR_TTMR_CR); +#ifdef CONFIG_SMP + tc_base = ioremap_nocache(0x99000000, 4); + + /* HACK: Synchronize local timer to global timer... */ + u32 c = ioread32be(tc_base); + mtspr(SPR_TTCR, c); + printk("SJK DEBUG: %s: c = %x\n", __func__, c); +#endif return 0; } diff --git a/arch/openrisc/kernel/traps.c b/arch/openrisc/kernel/traps.c index 3d3f6062f49cce..2afdc1c6484d08 100644 --- a/arch/openrisc/kernel/traps.c +++ b/arch/openrisc/kernel/traps.c @@ -40,6 +40,8 @@ extern char _etext, _stext; int kstack_depth_to_print = 0x180; +int lwa_flag; +unsigned long __user *lwa_addr; static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) { @@ -334,10 +336,125 @@ asmlinkage void do_bus_fault(struct pt_regs *regs, unsigned long address) } } +static inline void adjust_pc(struct pt_regs *regs, unsigned long address) +{ + /* FIXME: check for delay slot... */ + regs->pc += 4; +} + +static inline void simulate_lwa(struct pt_regs *regs, unsigned long address, + unsigned int insn) +{ + unsigned int ra, rd; + unsigned long value; + unsigned long orig_pc; + long imm; + + const struct exception_table_entry *entry; + + orig_pc = regs->pc; + adjust_pc(regs, address); + + ra = (insn >> 16) & 0x1f; + rd = (insn >> 21) & 0x1f; + imm = (short)insn; + lwa_addr = (unsigned long __user *)(regs->gpr[ra] + imm); + + if ((unsigned long)lwa_addr & 0x3) { + do_unaligned_access(regs, address); + return; + } + + if (get_user(value, lwa_addr)) { + if (user_mode(regs)) { + force_sig(SIGSEGV, current); + return; + } + + if ((entry = search_exception_tables(orig_pc))) { + regs->pc = entry->fixup; + return; + } + + /* kernel access in kernel space, load it directly */ + value = *((unsigned long *)lwa_addr); + } + + lwa_flag = 1; + regs->gpr[rd] = value; +} + +static inline void simulate_swa(struct pt_regs *regs, unsigned long address, + unsigned int insn) +{ + unsigned long __user *vaddr; + unsigned long orig_pc; + unsigned int ra, rb; + long imm; + + const struct exception_table_entry *entry; + + orig_pc = regs->pc; + adjust_pc(regs, address); + + ra = (insn >> 16) & 0x1f; + rb = (insn >> 11) & 0x1f; + imm = (short)(((insn & 0x2200000) >> 10) | (insn & 0x7ff)); + vaddr = (unsigned long __user *)(regs->gpr[ra] + imm); + + if (!lwa_flag || vaddr != lwa_addr) { + regs->sr &= ~SPR_SR_F; + return; + } + + if ((unsigned long)vaddr & 0x3) { + do_unaligned_access(regs, address); + return; + } + + if (put_user(regs->gpr[rb], vaddr)) { + if (user_mode(regs)) { + force_sig(SIGSEGV, current); + return; + } + + if ((entry = search_exception_tables(orig_pc))) { + regs->pc = entry->fixup; + return; + } + + /* kernel access in kernel space, store it directly */ + *((unsigned long *)vaddr) = regs->gpr[rb]; + } + + lwa_flag = 0; + regs->sr |= SPR_SR_F; +} + +#define INSN_LWA 0x1b +#define INSN_SWA 0x33 + asmlinkage void do_illegal_instruction(struct pt_regs *regs, unsigned long address) { siginfo_t info; + unsigned int op; + unsigned int insn = *((unsigned int *)address); + + op = insn >> 26; + + switch (op) { + case INSN_LWA: + simulate_lwa(regs, address, insn); + return; + + case INSN_SWA: + simulate_swa(regs, address, insn); + return; + + default: + break; + } if (user_mode(regs)) { /* Send a SIGILL */ diff --git a/arch/openrisc/kernel/vmlinux.lds.S b/arch/openrisc/kernel/vmlinux.lds.S index 2d69a853b742e9..7875f454bee42d 100644 --- a/arch/openrisc/kernel/vmlinux.lds.S +++ b/arch/openrisc/kernel/vmlinux.lds.S @@ -30,7 +30,13 @@ #include #include -OUTPUT_FORMAT("elf32-or32", "elf32-or32", "elf32-or32") +#ifdef __OR1K__ +#define __OUTPUT_FORMAT "elf32-or1k" +#else +#define __OUTPUT_FORMAT "elf32-or32" +#endif + +OUTPUT_FORMAT(__OUTPUT_FORMAT, __OUTPUT_FORMAT, __OUTPUT_FORMAT) jiffies = jiffies_64 + 4; SECTIONS diff --git a/arch/openrisc/lib/Makefile b/arch/openrisc/lib/Makefile index 966f65dbc6f013..67c583e0617f3a 100644 --- a/arch/openrisc/lib/Makefile +++ b/arch/openrisc/lib/Makefile @@ -2,4 +2,4 @@ # Makefile for or32 specific library files.. # -obj-y = string.o delay.o +obj-y = memset.o string.o delay.o diff --git a/arch/openrisc/lib/delay.c b/arch/openrisc/lib/delay.c index c82b09f4a106ce..2208010811a50c 100644 --- a/arch/openrisc/lib/delay.c +++ b/arch/openrisc/lib/delay.c @@ -24,7 +24,7 @@ int read_current_timer(unsigned long *timer_value) { - *timer_value = mfspr(SPR_TTCR); + *timer_value = get_cycles(); return 0; } diff --git a/arch/openrisc/lib/memset.S b/arch/openrisc/lib/memset.S new file mode 100644 index 00000000000000..92cc2eac26fa2d --- /dev/null +++ b/arch/openrisc/lib/memset.S @@ -0,0 +1,98 @@ +/* + * OpenRISC memset.S + * + * Hand-optimized assembler version of memset for OpenRISC. + * Algorithm inspired by several other arch-specific memset routines + * in the kernel tree + * + * Copyright (C) 2015 Olof Kindgren + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + + .global memset + .type memset, @function +memset: + /* arguments: + * r3 = *s + * r4 = c + * r5 = n + * r13, r15, r17, r19 used as temp regs + */ + + /* Exit if n == 0 */ + l.sfeqi r5, 0 + l.bf 4f + + /* Truncate c to char */ + l.andi r13, r4, 0xff + + /* Skip word extension if c is 0 */ + l.sfeqi r13, 0 + l.bf 1f + /* Check for at least two whole words (8 bytes) */ + l.sfleui r5, 7 + + /* Extend char c to 32-bit word cccc in r13 */ + l.slli r15, r13, 16 // r13 = 000c, r15 = 0c00 + l.or r13, r13, r15 // r13 = 0c0c, r15 = 0c00 + l.slli r15, r13, 8 // r13 = 0c0c, r15 = c0c0 + l.or r13, r13, r15 // r13 = cccc, r15 = c0c0 + +1: l.addi r19, r3, 0 // Set r19 = src + /* Jump to byte copy loop if less than two words */ + l.bf 3f + l.or r17, r5, r0 // Set r17 = n + + /* Mask out two LSBs to check alignment */ + l.andi r15, r3, 0x3 + + /* lsb == 00, jump to word copy loop */ + l.sfeqi r15, 0 + l.bf 2f + l.addi r19, r3, 0 // Set r19 = src + + /* lsb == 01,10 or 11 */ + l.sb 0(r3), r13 // *src = c + l.addi r17, r17, -1 // Decrease n + + l.sfeqi r15, 3 + l.bf 2f + l.addi r19, r3, 1 // src += 1 + + /* lsb == 01 or 10 */ + l.sb 1(r3), r13 // *(src+1) = c + l.addi r17, r17, -1 // Decrease n + + l.sfeqi r15, 2 + l.bf 2f + l.addi r19, r3, 2 // src += 2 + + /* lsb == 01 */ + l.sb 2(r3), r13 // *(src+2) = c + l.addi r17, r17, -1 // Decrease n + l.addi r19, r3, 3 // src += 3 + + /* Word copy loop */ +2: l.sw 0(r19), r13 // *src = cccc + l.addi r17, r17, -4 // Decrease n + l.sfgeui r17, 4 + l.bf 2b + l.addi r19, r19, 4 // Increase src + + /* When n > 0, copy the remaining bytes, otherwise jump to exit */ + l.sfeqi r17, 0 + l.bf 4f + + /* Byte copy loop */ +3: l.addi r17, r17, -1 // Decrease n + l.sb 0(r19), r13 // *src = cccc + l.sfnei r17, 0 + l.bf 3b + l.addi r19, r19, 1 // Increase src + +4: l.jr r9 + l.ori r11, r3, 0 diff --git a/arch/openrisc/mm/fault.c b/arch/openrisc/mm/fault.c index 230ac20ae7944f..cd37f0fd875bd2 100644 --- a/arch/openrisc/mm/fault.c +++ b/arch/openrisc/mm/fault.c @@ -33,7 +33,7 @@ unsigned long pte_errors; /* updated by do_page_fault() */ /* __PHX__ :: - check the vmalloc_fault in do_page_fault() * - also look into include/asm-or32/mmu_context.h */ -volatile pgd_t *current_pgd; +volatile pgd_t *current_pgd[NR_CPUS]; extern void die(char *, struct pt_regs *, long); @@ -319,7 +319,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long address, phx_mmu("vmalloc_fault"); */ - pgd = (pgd_t *)current_pgd + offset; + pgd = (pgd_t *)current_pgd[smp_processor_id()] + offset; pgd_k = init_mm.pgd + offset; /* Since we're two-level, we don't need to do both diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c index 7f94652311d745..f85b73dcebfbff 100644 --- a/arch/openrisc/mm/init.c +++ b/arch/openrisc/mm/init.c @@ -110,7 +110,7 @@ static void __init map_ram(void) set_pmd(pme, __pmd(_KERNPG_TABLE + __pa(pte))); /* Fill the newly allocated page with PTE'S */ - for (j = 0; p < e && j < PTRS_PER_PGD; + for (j = 0; p < e && j < PTRS_PER_PTE; v += PAGE_SIZE, p += PAGE_SIZE, j++, pte++) { if (v >= (u32) _e_kernel_ro || v < (u32) _s_kernel_ro) @@ -147,7 +147,7 @@ void __init paging_init(void) * (even if it is most probably not used until the next * switch_mm) */ - current_pgd = init_mm.pgd; + current_pgd[smp_processor_id()] = init_mm.pgd; end = (unsigned long)__va(max_low_pfn * PAGE_SIZE); diff --git a/arch/openrisc/mm/tlb.c b/arch/openrisc/mm/tlb.c index 683bd4d31c7cb0..6c253a2e86bc4e 100644 --- a/arch/openrisc/mm/tlb.c +++ b/arch/openrisc/mm/tlb.c @@ -49,7 +49,7 @@ * */ -void flush_tlb_all(void) +void local_flush_tlb_all(void) { int i; unsigned long num_tlb_sets; @@ -86,7 +86,7 @@ void flush_tlb_all(void) #define flush_itlb_page_no_eir(addr) \ mtspr_off(SPR_ITLBMR_BASE(0), ITLB_OFFSET(addr), 0); -void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) +void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) { if (have_dtlbeir) flush_dtlb_page_eir(addr); @@ -99,8 +99,8 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) flush_itlb_page_no_eir(addr); } -void flush_tlb_range(struct vm_area_struct *vma, - unsigned long start, unsigned long end) +void local_flush_tlb_range(struct vm_area_struct *vma, + unsigned long start, unsigned long end) { int addr; bool dtlbeir; @@ -129,13 +129,13 @@ void flush_tlb_range(struct vm_area_struct *vma, * This should be changed to loop over over mm and call flush_tlb_range. */ -void flush_tlb_mm(struct mm_struct *mm) +void local_flush_tlb_mm(struct mm_struct *mm) { /* Was seeing bugs with the mm struct passed to us. Scrapped most of this function. */ /* Several architctures do this */ - flush_tlb_all(); + local_flush_tlb_all(); } /* called in schedule() just before actually doing the switch_to */ @@ -149,14 +149,14 @@ void switch_mm(struct mm_struct *prev, struct mm_struct *next, * might be invalid at points where we still need to derefer * the pgd. */ - current_pgd = next->pgd; + current_pgd[smp_processor_id()] = next->pgd; /* We don't have context support implemented, so flush all * entries belonging to previous map */ if (prev != next) - flush_tlb_mm(prev); + local_flush_tlb_mm(prev); } diff --git a/arch/openrisc/or1ksim.cfg b/arch/openrisc/or1ksim.cfg new file mode 100644 index 00000000000000..65f5e87d1576ff --- /dev/null +++ b/arch/openrisc/or1ksim.cfg @@ -0,0 +1,888 @@ +/* sim.cfg -- Simulator configuration script file + Copyright (C) 2001-2002, Marko Mlinar, markom@opencores.org + +This file is part of OpenRISC 1000 Architectural Simulator. +It contains the default configuration and help about configuring +the simulator. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +/* INTRODUCTION + + The ork1sim has various parameters, that are set in configuration files + like this one. The user can switch between configurations at startup by + specifying the required configuration file with the -f option. + If no configuration file is specified or1ksim searches for the default + configuration file sim.cfg. First it searches for './sim.cfg'. If this + file is not found, it searches for '~/or1k/sim.cfg'. If this file is + not found too, it reverts to the built-in default configuration. + + NOTE: Users should not rely on the built-in configuration, since the + default configuration may differ between version. + Rather create a configuration file that sets all critical values. + + This file may contain (standard C) comments only - no // support. + + Configure files may be be included, using: + include "file_name_to_include" + + Like normal configuration files, the included file is divided into + sections. Each section is described in detail also. + + Some section have subsections. One example of such a subsection is: + + device + instance specific parameters... + enddevice + + which creates a device instance. +*/ + + +/* MEMORY SECTION + + This section specifies how the memory is generated and the blocks + it consists of. + + type = random/unknown/pattern + Specifies the initial memory values. + 'random' generates random memory using seed 'random_seed'. + 'pattern' fills memory with 'pattern'. + 'unknown' does not specify how memory should be generated, + leaving the memory in a undefined state. This is the fastest + option. + + random_seed = + random seed for randomizer, used if type = 'random'. + + pattern = + pattern to fill memory, used if type = 'pattern'. + + nmemories = + number of memory instances connected + + baseaddr = + memory start address + + size = + memory size + + name = "" + memory block name + + ce = + chip enable index of the memory instance + + mc = + memory controller this memory is connected to + + delayr = + cycles, required for read access, -1 if instance does not support reading + + delayw = + cycles, required for write access, -1 if instance does not support writing + + log = "" + filename, where to log memory accesses to, no log, if log command is not specified +*/ + + +section memory + /*random_seed = 12345 + type = random*/ + pattern = 0x00 + type = unknown /* Fastest */ + + name = "FLASH" + ce = 0 + mc = 0 + baseaddr = 0xf0000000 + size = 0x01000000 + delayr = 1 + delayw = -1 +end + +section memory + /*random_seed = 12345 + type = random*/ + pattern = 0x00 + type = unknown /* Fastest */ + + name = "RAM" + ce = 1 + mc = 0 + baseaddr = 0x00000000 + size = 0x02000000 + delayr = 1 + delayw = 1 +end + +section memory + /*random_seed = 12345 + type = random*/ + pattern = 0x00 + type = unknown /* Fastest */ + + name = "SRAM" + mc = 0 + ce = 2 + baseaddr = 0xa4000000 + size = 0x00100000 + delayr = 1 + delayw = 2 +end + + +/* IMMU SECTION + + This section configures the Instruction Memory Manangement Unit + + enabled = 0/1 + '0': disabled + '1': enabled + (NOTE: UPR bit is set) + + nsets = + number of ITLB sets; must be power of two + + nways = + number of ITLB ways + + pagesize = + instruction page size; must be power of two + + entrysize = + instruction entry size in bytes + + ustates = + number of ITLB usage states (2, 3, 4 etc., max is 4) + + hitdelay = + number of cycles immu hit costs + + missdelay = + number of cycles immu miss costs +*/ + +section immu + enabled = 1 + nsets = 64 + nways = 1 + pagesize = 8192 + hitdelay = 0 + missdelay = 0 +end + + +/* DMMU SECTION + + This section configures the Data Memory Manangement Unit + + enabled = 0/1 + '0': disabled + '1': enabled + (NOTE: UPR bit is set) + + nsets = + number of DTLB sets; must be power of two + + nways = + number of DTLB ways + + pagesize = + data page size; must be power of two + + entrysize = + data entry size in bytes + + ustates = + number of DTLB usage states (2, 3, 4 etc., max is 4) + + hitdelay = + number of cycles dmmu hit costs + + missdelay = + number of cycles dmmu miss costs +*/ + +section dmmu + enabled = 1 + nsets = 64 + nways = 1 + pagesize = 8192 + hitdelay = 0 + missdelay = 0 +end + + +/* IC SECTION + + This section configures the Instruction Cache + + enabled = 0/1 + '0': disabled + '1': enabled + (NOTE: UPR bit is set) + + nsets = + number of IC sets; must be power of two + + nways = + number of IC ways + + blocksize = + IC block size in bytes; must be power of two + + ustates = + number of IC usage states (2, 3, 4 etc., max is 4) + + hitdelay = + number of cycles ic hit costs + + missdelay = + number of cycles ic miss costs +*/ + +section ic + enabled = 0 + nsets = 512 + nways = 1 + blocksize = 16 + hitdelay = 1 + missdelay = 1 +end + + +/* DC SECTION + + This section configures the Data Cache + + enabled = 0/1 + '0': disabled + '1': enabled + (NOTE: UPR bit is set) + + nsets = + number of DC sets; must be power of two + + nways = + number of DC ways + + blocksize = + DC block size in bytes; must be power of two + + ustates = + number of DC usage states (2, 3, 4 etc., max is 4) + + load_hitdelay = + number of cycles dc load hit costs + + load_missdelay = + number of cycles dc load miss costs + + store_hitdelay = + number of cycles dc load hit costs + + store_missdelay = + number of cycles dc load miss costs +*/ + +section dc + enabled = 0 + nsets = 512 + nways = 1 + blocksize = 16 + load_hitdelay = 1 + load_missdelay = 1 + store_hitdelay = 1 + store_missdelay = 1 +end + + +/* SIM SECTION + + This section specifies how or1ksim should behave. + + verbose = 0/1 + '0': don't print extra messages + '1': print extra messages + + debug = 0-9 + 0 : no debug messages + 1-9: debug message level. + higher numbers produce more messages + + profile = 0/1 + '0': don't generate profiling file 'sim.profile' + '1': don't generate profiling file 'sim.profile' + + prof_fn = "" + optional filename for the profiling file. + valid only if 'profile' is set + + mprofile = 0/1 + '0': don't generate memory profiling file 'sim.mprofile' + '1': generate memory profiling file 'sim.mprofile' + + mprof_fn = "" + optional filename for the memory profiling file. + valid only if 'mprofile' is set + + history = 0/1 + '0': don't track execution flow + '1': track execution flow + Execution flow can be tracked for the simulator's + 'hist' command. Useful for back-trace debugging. + + iprompt = 0/1 + '0': start in (so what do we start in ???) + '1': start in interactive prompt. + + exe_log = 0/1 + '0': don't generate execution log. + '1': generate execution log. + + exe_log = default/hardware/simple/software + type of execution log, default is used when not specified + + exe_log_start = + index of first instruction to start logging, default = 0 + + exe_log_end = + index of last instruction to end logging; not limited, if omitted + + exe_log_marker = + specifies number of instructions before horizontal marker is + printed; if zero, markers are disabled (default) + + exe_log_fn = "" + filename for the exection log file. + valid only if 'exe_log' is set + + clkcycle = [ps|ns|us|ms] + specifies time measurement for one cycle +*/ + +section sim + verbose = 1 + debug = 0 + profile = 0 + history = 0 + + clkcycle = 10ns +end + + +/* SECTION VAPI + + This section configures the Verification API, used for Advanced + Core Verification. + + enabled = 0/1 + '0': disbable VAPI server + '1': enable/start VAPI server + + server_port = + TCP/IP port to start VAPI server on + + log_enabled = 0/1 + '0': disable VAPI requests logging + '1': enable VAPI requests logging + + hide_device_id = 0/1 + '0': don't log device id (for compatability with old version) + '1': log device id + + + vapi_fn = + filename for the log file. + valid only if log_enabled is set +*/ + +section VAPI + enabled = 0 + server_port = 9998 + log_enabled = 0 + vapi_log_fn = "vapi.log" +end + + +/* CPU SECTION + + This section specifies various CPU parameters. + + ver = + rev = + specifies version and revision of the CPU used + + upr = + changes the upr register + + sr = + sets the initial Supervision Register value + supervisor mode (SM) and fixed one (FO) set = 0x8001 + exception prefix high (EPH, vectors@0xf0000000) = 0x4000 + together, (SM | FO | EPH) = 0xc001 + superscalar = 0/1 + '0': CPU is scalar + '1': CPU is superscalar + (modify cpu/or32/execute.c to tune superscalar model) + + hazards = 0/1 + '0': don't track data hazards in superscalar CPU + '1': track data hazards in superscalar CPU + If tracked, data hazards can be displayed using the + simulator's 'r' command. + + dependstats = 0/1 + '0': don't calculate inter-instruction dependencies. + '1': calculate inter-instruction dependencies. + If calculated, inter-instruction dependencies can be + displayed using the simulator's 'stat' command. + + sbuf_len = + length of store buffer (<= 256), 0 = disabled +*/ + +section cpu + ver = 0x12 + cfg = 0x00 + rev = 0x01 + sr = 0x8001 /*SPR_SR_FO | SPR_SR_SM | SPR_SR_EPH */ + /* upr = */ + superscalar = 0 + hazards = 0 + dependstats = 0 + sbuf_len = 0 +end + + +/* PM SECTION + + This section specifies Power Management parameters + + enabled = 0/1 + '0': disable power management + '1': enable power management +*/ + +section pm + enabled = 0 +end + + +/* BPB SECTION + + This section specifies how branch prediction should behave. + + enabled = 0/1 + '0': disable branch prediction + '1': enable branch prediction + + btic = 0/1 + '0': disable branch target instruction cache model + '1': enable branch target instruction cache model + + sbp_bf_fwd = 0/1 + Static branch prediction for 'l.bf' + '0': don't use forward prediction + '1': use forward prediction + + sbp_bnf_fwd = 0/1 + Static branch prediction for 'l.bnf' + '0': don't use forward prediction + '1': use forward prediction + + hitdelay = + number of cycles bpb hit costs + + missdelay = + number of cycles bpb miss costs +*/ + +section bpb + enabled = 0 + btic = 0 + sbp_bf_fwd = 0 + sbp_bnf_fwd = 0 + hitdelay = 0 + missdelay = 0 +end + + +/* DEBUG SECTION + + This sections specifies how the debug unit should behave. + + enabled = 0/1 + '0': disable debug unit + '1': enable debug unit + + gdb_enabled = 0/1 + '0': don't start gdb server + '1': start gdb server at port 'server_port' + + server_port = + TCP/IP port to start gdb server on + valid only if gdb_enabled is set + + vapi_id = + Used to create "fake" vapi log file containing the JTAG proxy messages. +*/ +section debug + enabled = 0 +/* gdb_enabled = 0 */ +/* server_port = 9999*/ + rsp_enabled = 1 + rsp_port = 50001 +end + + +/* MC SECTION + + This section configures the memory controller + + enabled = 0/1 + '0': disable memory controller + '1': enable memory controller + + baseaddr = + address of first MC register + + POC = + Power On Configuration register + + index = + Index of this memory controller amongst all the memory controllers +*/ + +section mc + enabled = 0 + baseaddr = 0x93000000 + POC = 0x00000008 /* Power on configuration register */ + index = 0 +end + + +/* UART SECTION + + This section configures the UARTs + + enabled = <0|1> + Enable/disable the peripheral. By default if it is enabled. + + baseaddr = + address of first UART register for this device + + + channel = : + + The channel parameter indicates the source of received UART characters + and the sink for transmitted UART characters. + + The can be either "file", "xterm", "tcp", "fd", or "tty" + (without quotes). + + A) To send/receive characters from a pair of files, use a file + channel: + + channel=file:, + + B) To create an interactive terminal window, use an xterm channel: + + channel=xterm:[]* + + C) To create a bidirectional tcp socket which one could, for example, + access via telnet, use a tcp channel: + + channel=tcp: + + D) To cause the UART to read/write from existing numeric file + descriptors, use an fd channel: + + channel=fd:, + + E) To connect the UART to a physical serial port, create a tty + channel: + + channel=tty:device=/dev/ttyS0,baud=9600 + + irq = + irq number for this device + + 16550 = 0/1 + '0': this device is a UART16450 + '1': this device is a UART16550 + + jitter = + in msecs... time to block, -1 to disable it + + vapi_id = + VAPI id of this instance +*/ + +section uart + enabled = 1 + baseaddr = 0x90000000 + irq = 2 + /* channel = "file:uart0.rx,uart0.tx" */ + channel = "tcp:10084" +/* channel = "xterm:" */ + jitter = -1 /* async behaviour */ + 16550 = 1 +end + + +/* DMA SECTION + + This section configures the DMAs + + enabled = <0|1> + Enable/disable the peripheral. By default if it is enabled. + + baseaddr = + address of first DMA register for this device + + irq = + irq number for this device + + vapi_id = + VAPI id of this instance +*/ + +section dma + enabled = 1 + baseaddr = 0x9a000000 + irq = 11 +end + + +/* ETHERNET SECTION + + This section configures the ETHERNETs + + enabled = <0|1> + Enable/disable the peripheral. By default if it is enabled. + + baseaddr = + address of first ethernet register for this device + + dma = + which controller is this ethernet "connected" to + + irq = + ethernet mac IRQ level + + rtx_type = + use 0 - file interface, 1 - socket interface + + rx_channel = + DMA channel used for RX + + tx_channel = + DMA channel used for TX + + rxfile = "" + filename, where to read data from + + txfile = "" + filename, where to write data to + + sockif = "" + interface name of ethernet socket + + vapi_id = + VAPI id of this instance +*/ + +section ethernet + enabled = 1 + baseaddr = 0x92000000 + /* dma = 0 */ + irq = 4 + rtx_type = "tap" + tap_dev = "tap0" + /* tx_channel = 0 */ + /* rx_channel = 1 */ + rxfile = "eth0.rx" + txfile = "eth0.tx" + sockif = "eth0" +end + + +/* GPIO SECTION + + This section configures the GPIOs + + enabled = <0|1> + Enable/disable the peripheral. By default if it is enabled. + + baseaddr = + address of first GPIO register for this device + + irq = + irq number for this device + + base_vapi_id = + first VAPI id of this instance + GPIO uses 8 consecutive VAPI IDs +*/ + +section gpio + enabled = 0 + baseaddr = 0x91000000 + irq = 3 + base_vapi_id = 0x0200 +end + +/* VGA SECTION + + This section configures the VGA/LCD controller + + enabled = <0|1> + Enable/disable the peripheral. By default if it is enabled. + + baseaddr = + address of first VGA register + + irq = + irq number for this device + + refresh_rate = + number of cycles between screen dumps + + filename = "" + template name for generated names (e.g. "primary" produces "primary0023.bmp") +*/ + +section vga + enabled = 0 + baseaddr = 0x97100000 + irq = 8 + refresh_rate = 100000 + filename = "primary" +end + + +/* TICK TIMER SECTION + + This section configures tick timer + + enabled = 0/1 + whether tick timer is enabled +*/ + +section pic + enabled = 1 + edge_trigger = 1 +end + +/* FB SECTION + + This section configures the frame buffer + + enabled = <0|1> + Enable/disable the peripheral. By default if it is enabled. + + baseaddr = + base address of frame buffer + + paladdr = + base address of first palette entry + + refresh_rate = + number of cycles between screen dumps + + filename = "" + template name for generated names (e.g. "primary" produces "primary0023.bmp") +*/ + +section fb + enabled = 0 + baseaddr = 0x97000000 + refresh_rate = 1000000 + filename = "primary" +end + + +/* KBD SECTION + + This section configures the PS/2 compatible keyboard + + baseaddr = + base address of the keyboard device + + rxfile = "" + filename, where to read data from +*/ + +section kbd + enabled = 0 + irq = 5 + baseaddr = 0x94000000 + rxfile = "kbd.rx" +end + + +/* ATA SECTION + + This section configures the ATA/ATAPI host controller + + baseaddr = + address of first ATA register + + enabled = <0|1> + Enable/disable the peripheral. By default if it is enabled. + + irq = + irq number for this device + + debug = + debug level for ata models. + 0: no debug messages + 1: verbose messages + 3: normal messages (more messages than verbose) + 5: debug messages (normal debug messages) + 7: flow control messages (debug statemachine flows) + 9: low priority message (display everything the code does) + + dev_type0/1 = + ata device 0 type + 0: NO_CONNeCT: none (not connected) + 1: FILE : simulated harddisk + 2: LOCAL : local system harddisk + + dev_file0/1 = "" + filename for simulated ATA device + valid only if dev_type0 == 1 + + dev_size0/1 = + size of simulated hard-disk (in MBytes) + valid only if dev_type0 == 1 + + dev_packet0/1 = + 0: simulated ATA device does NOT implement PACKET command feature set + 1: simulated ATA device does implement PACKET command feature set + + FIXME: irq number +*/ + +section ata + enabled = 0 + baseaddr = 0x9e000000 + irq = 15 + +end diff --git a/arch/openrisc/support/initramfs.devnodes b/arch/openrisc/support/initramfs.devnodes new file mode 100644 index 00000000000000..f2051c8665c928 --- /dev/null +++ b/arch/openrisc/support/initramfs.devnodes @@ -0,0 +1,6 @@ +dir /dev 755 0 0 +nod /dev/console 644 0 0 c 5 1 +dir /proc 755 0 0 +dir /sys 755 0 0 +dir /mnt 755 0 0 +dir /dev/shm 755 0 0 diff --git a/arch/openrisc/support/initramfs/bin/addgroup b/arch/openrisc/support/initramfs/bin/addgroup new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/addgroup @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/adduser b/arch/openrisc/support/initramfs/bin/adduser new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/adduser @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/ash b/arch/openrisc/support/initramfs/bin/ash new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/ash @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/busybox b/arch/openrisc/support/initramfs/bin/busybox new file mode 100755 index 00000000000000..c8d764f27ae131 Binary files /dev/null and b/arch/openrisc/support/initramfs/bin/busybox differ diff --git a/arch/openrisc/support/initramfs/bin/cat b/arch/openrisc/support/initramfs/bin/cat new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/cat @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/catv b/arch/openrisc/support/initramfs/bin/catv new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/catv @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/chattr b/arch/openrisc/support/initramfs/bin/chattr new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/chattr @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/chgrp b/arch/openrisc/support/initramfs/bin/chgrp new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/chgrp @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/chmod b/arch/openrisc/support/initramfs/bin/chmod new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/chmod @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/chown b/arch/openrisc/support/initramfs/bin/chown new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/chown @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/cp b/arch/openrisc/support/initramfs/bin/cp new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/cp @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/cpio b/arch/openrisc/support/initramfs/bin/cpio new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/cpio @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/cttyhack b/arch/openrisc/support/initramfs/bin/cttyhack new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/cttyhack @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/date b/arch/openrisc/support/initramfs/bin/date new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/date @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/dd b/arch/openrisc/support/initramfs/bin/dd new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/dd @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/delgroup b/arch/openrisc/support/initramfs/bin/delgroup new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/delgroup @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/deluser b/arch/openrisc/support/initramfs/bin/deluser new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/deluser @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/df b/arch/openrisc/support/initramfs/bin/df new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/df @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/dmesg b/arch/openrisc/support/initramfs/bin/dmesg new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/dmesg @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/dnsdomainname b/arch/openrisc/support/initramfs/bin/dnsdomainname new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/dnsdomainname @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/dumpkmap b/arch/openrisc/support/initramfs/bin/dumpkmap new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/dumpkmap @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/echo b/arch/openrisc/support/initramfs/bin/echo new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/echo @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/ed b/arch/openrisc/support/initramfs/bin/ed new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/ed @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/egrep b/arch/openrisc/support/initramfs/bin/egrep new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/egrep @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/false b/arch/openrisc/support/initramfs/bin/false new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/false @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/fdflush b/arch/openrisc/support/initramfs/bin/fdflush new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/fdflush @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/fgrep b/arch/openrisc/support/initramfs/bin/fgrep new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/fgrep @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/fsync b/arch/openrisc/support/initramfs/bin/fsync new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/fsync @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/getopt b/arch/openrisc/support/initramfs/bin/getopt new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/getopt @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/grep b/arch/openrisc/support/initramfs/bin/grep new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/grep @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/gunzip b/arch/openrisc/support/initramfs/bin/gunzip new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/gunzip @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/gzip b/arch/openrisc/support/initramfs/bin/gzip new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/gzip @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/hostname b/arch/openrisc/support/initramfs/bin/hostname new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/hostname @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/hush b/arch/openrisc/support/initramfs/bin/hush new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/hush @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/ionice b/arch/openrisc/support/initramfs/bin/ionice new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/ionice @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/iostat b/arch/openrisc/support/initramfs/bin/iostat new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/iostat @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/ip b/arch/openrisc/support/initramfs/bin/ip new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/ip @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/ipaddr b/arch/openrisc/support/initramfs/bin/ipaddr new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/ipaddr @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/ipcalc b/arch/openrisc/support/initramfs/bin/ipcalc new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/ipcalc @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/iplink b/arch/openrisc/support/initramfs/bin/iplink new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/iplink @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/iproute b/arch/openrisc/support/initramfs/bin/iproute new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/iproute @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/iprule b/arch/openrisc/support/initramfs/bin/iprule new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/iprule @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/iptunnel b/arch/openrisc/support/initramfs/bin/iptunnel new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/iptunnel @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/kill b/arch/openrisc/support/initramfs/bin/kill new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/kill @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/linux32 b/arch/openrisc/support/initramfs/bin/linux32 new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/linux32 @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/linux64 b/arch/openrisc/support/initramfs/bin/linux64 new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/linux64 @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/ln b/arch/openrisc/support/initramfs/bin/ln new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/ln @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/login b/arch/openrisc/support/initramfs/bin/login new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/login @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/ls b/arch/openrisc/support/initramfs/bin/ls new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/ls @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/lsattr b/arch/openrisc/support/initramfs/bin/lsattr new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/lsattr @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/lzop b/arch/openrisc/support/initramfs/bin/lzop new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/lzop @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/makemime b/arch/openrisc/support/initramfs/bin/makemime new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/makemime @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/mkdir b/arch/openrisc/support/initramfs/bin/mkdir new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/mkdir @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/mknod b/arch/openrisc/support/initramfs/bin/mknod new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/mknod @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/mktemp b/arch/openrisc/support/initramfs/bin/mktemp new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/mktemp @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/more b/arch/openrisc/support/initramfs/bin/more new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/more @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/mount b/arch/openrisc/support/initramfs/bin/mount new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/mount @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/mountpoint b/arch/openrisc/support/initramfs/bin/mountpoint new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/mountpoint @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/mpstat b/arch/openrisc/support/initramfs/bin/mpstat new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/mpstat @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/msh b/arch/openrisc/support/initramfs/bin/msh new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/msh @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/mt b/arch/openrisc/support/initramfs/bin/mt new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/mt @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/mv b/arch/openrisc/support/initramfs/bin/mv new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/mv @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/netstat b/arch/openrisc/support/initramfs/bin/netstat new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/netstat @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/nice b/arch/openrisc/support/initramfs/bin/nice new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/nice @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/pidof b/arch/openrisc/support/initramfs/bin/pidof new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/pidof @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/ping b/arch/openrisc/support/initramfs/bin/ping new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/ping @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/ping6 b/arch/openrisc/support/initramfs/bin/ping6 new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/ping6 @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/pipe_progress b/arch/openrisc/support/initramfs/bin/pipe_progress new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/pipe_progress @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/printenv b/arch/openrisc/support/initramfs/bin/printenv new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/printenv @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/ps b/arch/openrisc/support/initramfs/bin/ps new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/ps @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/pwd b/arch/openrisc/support/initramfs/bin/pwd new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/pwd @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/reformime b/arch/openrisc/support/initramfs/bin/reformime new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/reformime @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/rev b/arch/openrisc/support/initramfs/bin/rev new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/rev @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/rm b/arch/openrisc/support/initramfs/bin/rm new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/rm @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/rmdir b/arch/openrisc/support/initramfs/bin/rmdir new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/rmdir @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/rpm b/arch/openrisc/support/initramfs/bin/rpm new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/rpm @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/run-parts b/arch/openrisc/support/initramfs/bin/run-parts new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/run-parts @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/scriptreplay b/arch/openrisc/support/initramfs/bin/scriptreplay new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/scriptreplay @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/sed b/arch/openrisc/support/initramfs/bin/sed new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/sed @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/setarch b/arch/openrisc/support/initramfs/bin/setarch new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/setarch @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/sh b/arch/openrisc/support/initramfs/bin/sh new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/sh @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/sleep b/arch/openrisc/support/initramfs/bin/sleep new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/sleep @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/stat b/arch/openrisc/support/initramfs/bin/stat new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/stat @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/stty b/arch/openrisc/support/initramfs/bin/stty new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/stty @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/su b/arch/openrisc/support/initramfs/bin/su new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/su @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/sync b/arch/openrisc/support/initramfs/bin/sync new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/sync @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/tar b/arch/openrisc/support/initramfs/bin/tar new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/tar @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/touch b/arch/openrisc/support/initramfs/bin/touch new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/touch @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/true b/arch/openrisc/support/initramfs/bin/true new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/true @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/umount b/arch/openrisc/support/initramfs/bin/umount new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/umount @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/uname b/arch/openrisc/support/initramfs/bin/uname new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/uname @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/uncompress b/arch/openrisc/support/initramfs/bin/uncompress new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/uncompress @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/usleep b/arch/openrisc/support/initramfs/bin/usleep new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/usleep @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/vi b/arch/openrisc/support/initramfs/bin/vi new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/vi @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/watch b/arch/openrisc/support/initramfs/bin/watch new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/watch @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/bin/zcat b/arch/openrisc/support/initramfs/bin/zcat new file mode 120000 index 00000000000000..c3fa810285e014 --- /dev/null +++ b/arch/openrisc/support/initramfs/bin/zcat @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/etc/fstab b/arch/openrisc/support/initramfs/etc/fstab new file mode 100755 index 00000000000000..b262b332cb0615 --- /dev/null +++ b/arch/openrisc/support/initramfs/etc/fstab @@ -0,0 +1,4 @@ +proc /proc proc defaults 0 0 +devtmpfs /dev devtmpfs defaults 0 0 +sysfs /sys sysfs defaults 0 0 +none /dev/shm tmpfs defaults,noexec,nodev,nosuid 0 0 \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/etc/host.conf b/arch/openrisc/support/initramfs/etc/host.conf new file mode 100644 index 00000000000000..ca6e7627c3ac78 --- /dev/null +++ b/arch/openrisc/support/initramfs/etc/host.conf @@ -0,0 +1,3 @@ +order hosts,bind +multi on + diff --git a/arch/openrisc/support/initramfs/etc/inetd.conf b/arch/openrisc/support/initramfs/etc/inetd.conf new file mode 100644 index 00000000000000..1dd0b69d7708b9 --- /dev/null +++ b/arch/openrisc/support/initramfs/etc/inetd.conf @@ -0,0 +1 @@ +telnet stream tcp nowait root /usr/sbin/telnetd telnetd -i diff --git a/arch/openrisc/support/initramfs/etc/init.d/rcS b/arch/openrisc/support/initramfs/etc/init.d/rcS new file mode 100755 index 00000000000000..9969ffff5aede7 --- /dev/null +++ b/arch/openrisc/support/initramfs/etc/init.d/rcS @@ -0,0 +1,44 @@ +#! /bin/sh + +mount -a + +# set hostname +#echo "Setting hostname" & +hostname openrisc & + +#remount everything, read/write +#echo "Remounting root" & +mount -o remount,rw / + +# clear ethernet's IP +#echo "Bringing up eth0" +#ifconfig eth0 10.1.1.3 +#ifconfig eth0 up + +#setup dhcp +#echo "Launching udhcpc" +#/sbin/udhcpc -n -q -s /usr/share/udhcpc/default.script + +# create some dirs to avoid warning messages +mkdir -p /var/run && \ + mkdir -p /etc/network/if-up.d && \ + mkdir -p /etc/network/if-pre-up.d & + +# make home directory for root user +mkdir -p /root & + +# telnetd requires this +mkdir -p /dev/pts && \ + mount -t devpts none /dev/pts & + +mkdir -p /dev/shm && \ + mount -t tmpfs none /dev/shm & + +echo "Configuring loopback device" +#ifconfig lo 127.0.0.1 +ifup lo & +ifconfig eth0 192.168.1.100 & + +# inetd startup +inetd & + diff --git a/arch/openrisc/support/initramfs/etc/inittab b/arch/openrisc/support/initramfs/etc/inittab new file mode 100755 index 00000000000000..4251b0219c20ab --- /dev/null +++ b/arch/openrisc/support/initramfs/etc/inittab @@ -0,0 +1,10 @@ +::sysinit:/etc/init.d/rcS +::askfirst:-/bin/sh + +# Stuff to do when restarting the init process +::restart:/sbin/init + +# Stuff to do before rebooting +::ctrlaltdel:/sbin/reboot +::shutdown:/etc/shutdown + diff --git a/arch/openrisc/support/initramfs/etc/network/interfaces b/arch/openrisc/support/initramfs/etc/network/interfaces new file mode 100644 index 00000000000000..ddae99c1f3d1f3 --- /dev/null +++ b/arch/openrisc/support/initramfs/etc/network/interfaces @@ -0,0 +1,6 @@ +auto lo +iface lo inet loopback + +auto eth0 +iface eth0 inet dhcp + diff --git a/arch/openrisc/support/initramfs/etc/nsswitch.conf b/arch/openrisc/support/initramfs/etc/nsswitch.conf new file mode 100644 index 00000000000000..5477636c09c85a --- /dev/null +++ b/arch/openrisc/support/initramfs/etc/nsswitch.conf @@ -0,0 +1,11 @@ +passwd: files +shadow: files +group: files + +hosts: files dns + +protocols: files +rpc: files +services: files + + diff --git a/arch/openrisc/support/initramfs/etc/passwd b/arch/openrisc/support/initramfs/etc/passwd new file mode 100644 index 00000000000000..a880bd497f910f --- /dev/null +++ b/arch/openrisc/support/initramfs/etc/passwd @@ -0,0 +1 @@ +root::0:0::/root:/bin/sh diff --git a/arch/openrisc/support/initramfs/etc/services b/arch/openrisc/support/initramfs/etc/services new file mode 100644 index 00000000000000..c95b1bf774fd1b --- /dev/null +++ b/arch/openrisc/support/initramfs/etc/services @@ -0,0 +1,576 @@ +# Network services, Internet style +# +# Note that it is presently the policy of IANA to assign a single well-known +# port number for both TCP and UDP; hence, officially ports have two entries +# even if the protocol doesn't support UDP operations. +# +# Updated from http://www.iana.org/assignments/port-numbers and other +# sources like http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/services . +# New ports will be added on request if they have been officially assigned +# by IANA and used in the real-world or are needed by a debian package. +# If you need a huge list of used numbers please install the nmap package. + +tcpmux 1/tcp # TCP port service multiplexer +echo 7/tcp +echo 7/udp +discard 9/tcp sink null +discard 9/udp sink null +systat 11/tcp users +daytime 13/tcp +daytime 13/udp +netstat 15/tcp +qotd 17/tcp quote +msp 18/tcp # message send protocol +msp 18/udp +chargen 19/tcp ttytst source +chargen 19/udp ttytst source +ftp-data 20/tcp +ftp 21/tcp +fsp 21/udp fspd +ssh 22/tcp # SSH Remote Login Protocol +ssh 22/udp +telnet 23/tcp +smtp 25/tcp mail +time 37/tcp timserver +time 37/udp timserver +rlp 39/udp resource # resource location +nameserver 42/tcp name # IEN 116 +whois 43/tcp nicname +tacacs 49/tcp # Login Host Protocol (TACACS) +tacacs 49/udp +re-mail-ck 50/tcp # Remote Mail Checking Protocol +re-mail-ck 50/udp +domain 53/tcp # name-domain server +domain 53/udp +mtp 57/tcp # deprecated +tacacs-ds 65/tcp # TACACS-Database Service +tacacs-ds 65/udp +bootps 67/tcp # BOOTP server +bootps 67/udp +bootpc 68/tcp # BOOTP client +bootpc 68/udp +tftp 69/udp +gopher 70/tcp # Internet Gopher +gopher 70/udp +rje 77/tcp netrjs +finger 79/tcp +www 80/tcp http # WorldWideWeb HTTP +www 80/udp # HyperText Transfer Protocol +link 87/tcp ttylink +kerberos 88/tcp kerberos5 krb5 kerberos-sec # Kerberos v5 +kerberos 88/udp kerberos5 krb5 kerberos-sec # Kerberos v5 +supdup 95/tcp +hostnames 101/tcp hostname # usually from sri-nic +iso-tsap 102/tcp tsap # part of ISODE +acr-nema 104/tcp dicom # Digital Imag. & Comm. 300 +acr-nema 104/udp dicom # Digital Imag. & Comm. 300 +csnet-ns 105/tcp cso-ns # also used by CSO name server +csnet-ns 105/udp cso-ns +rtelnet 107/tcp # Remote Telnet +rtelnet 107/udp +pop2 109/tcp postoffice pop-2 # POP version 2 +pop2 109/udp pop-2 +pop3 110/tcp pop-3 # POP version 3 +pop3 110/udp pop-3 +sunrpc 111/tcp portmapper # RPC 4.0 portmapper +sunrpc 111/udp portmapper +auth 113/tcp authentication tap ident +sftp 115/tcp +uucp-path 117/tcp +nntp 119/tcp readnews untp # USENET News Transfer Protocol +ntp 123/tcp +ntp 123/udp # Network Time Protocol +pwdgen 129/tcp # PWDGEN service +pwdgen 129/udp # PWDGEN service +loc-srv 135/tcp epmap # Location Service +loc-srv 135/udp epmap +netbios-ns 137/tcp # NETBIOS Name Service +netbios-ns 137/udp +netbios-dgm 138/tcp # NETBIOS Datagram Service +netbios-dgm 138/udp +netbios-ssn 139/tcp # NETBIOS session service +netbios-ssn 139/udp +imap2 143/tcp imap # Interim Mail Access P 2 and 4 +imap2 143/udp imap +snmp 161/tcp # Simple Net Mgmt Protocol +snmp 161/udp # Simple Net Mgmt Protocol +snmp-trap 162/tcp snmptrap # Traps for SNMP +snmp-trap 162/udp snmptrap # Traps for SNMP +cmip-man 163/tcp # ISO mgmt over IP (CMOT) +cmip-man 163/udp +cmip-agent 164/tcp +cmip-agent 164/udp +mailq 174/tcp # Mailer transport queue for Zmailer +mailq 174/udp # Mailer transport queue for Zmailer +xdmcp 177/tcp # X Display Mgr. Control Proto +xdmcp 177/udp +nextstep 178/tcp NeXTStep NextStep # NeXTStep window +nextstep 178/udp NeXTStep NextStep # server +bgp 179/tcp # Border Gateway Protocol +bgp 179/udp +prospero 191/tcp # Cliff Neuman's Prospero +prospero 191/udp +irc 194/tcp # Internet Relay Chat +irc 194/udp +smux 199/tcp # SNMP Unix Multiplexer +smux 199/udp +at-rtmp 201/tcp # AppleTalk routing +at-rtmp 201/udp +at-nbp 202/tcp # AppleTalk name binding +at-nbp 202/udp +at-echo 204/tcp # AppleTalk echo +at-echo 204/udp +at-zis 206/tcp # AppleTalk zone information +at-zis 206/udp +qmtp 209/tcp # Quick Mail Transfer Protocol +qmtp 209/udp # Quick Mail Transfer Protocol +z3950 210/tcp wais # NISO Z39.50 database +z3950 210/udp wais +ipx 213/tcp # IPX +ipx 213/udp +imap3 220/tcp # Interactive Mail Access +imap3 220/udp # Protocol v3 +pawserv 345/tcp # Perf Analysis Workbench +pawserv 345/udp +zserv 346/tcp # Zebra server +zserv 346/udp +fatserv 347/tcp # Fatmen Server +fatserv 347/udp +rpc2portmap 369/tcp +rpc2portmap 369/udp # Coda portmapper +codaauth2 370/tcp +codaauth2 370/udp # Coda authentication server +clearcase 371/tcp Clearcase +clearcase 371/udp Clearcase +ulistserv 372/tcp # UNIX Listserv +ulistserv 372/udp +ldap 389/tcp # Lightweight Directory Access Protocol +ldap 389/udp +imsp 406/tcp # Interactive Mail Support Protocol +imsp 406/udp +https 443/tcp # http protocol over TLS/SSL +https 443/udp +snpp 444/tcp # Simple Network Paging Protocol +snpp 444/udp +microsoft-ds 445/tcp # Microsoft Naked CIFS +microsoft-ds 445/udp +kpasswd 464/tcp +kpasswd 464/udp +saft 487/tcp # Simple Asynchronous File Transfer +saft 487/udp +isakmp 500/tcp # IPsec - Internet Security Association +isakmp 500/udp # and Key Management Protocol +rtsp 554/tcp # Real Time Stream Control Protocol +rtsp 554/udp # Real Time Stream Control Protocol +nqs 607/tcp # Network Queuing system +nqs 607/udp +npmp-local 610/tcp dqs313_qmaster # npmp-local / DQS +npmp-local 610/udp dqs313_qmaster +npmp-gui 611/tcp dqs313_execd # npmp-gui / DQS +npmp-gui 611/udp dqs313_execd +hmmp-ind 612/tcp dqs313_intercell # HMMP Indication / DQS +hmmp-ind 612/udp dqs313_intercell +qmqp 628/tcp +qmqp 628/udp +ipp 631/tcp # Internet Printing Protocol +ipp 631/udp +# +# UNIX specific services +# +exec 512/tcp +biff 512/udp comsat +login 513/tcp +who 513/udp whod +shell 514/tcp cmd # no passwords used +syslog 514/udp +printer 515/tcp spooler # line printer spooler +talk 517/udp +ntalk 518/udp +route 520/udp router routed # RIP +timed 525/udp timeserver +tempo 526/tcp newdate +courier 530/tcp rpc +conference 531/tcp chat +netnews 532/tcp readnews +netwall 533/udp # for emergency broadcasts +gdomap 538/tcp # GNUstep distributed objects +gdomap 538/udp +uucp 540/tcp uucpd # uucp daemon +klogin 543/tcp # Kerberized `rlogin' (v5) +kshell 544/tcp krcmd # Kerberized `rsh' (v5) +afpovertcp 548/tcp # AFP over TCP +afpovertcp 548/udp +remotefs 556/tcp rfs_server rfs # Brunhoff remote filesystem +nntps 563/tcp snntp # NNTP over SSL +nntps 563/udp snntp +submission 587/tcp # Submission [RFC4409] +submission 587/udp +ldaps 636/tcp # LDAP over SSL +ldaps 636/udp +tinc 655/tcp # tinc control port +tinc 655/udp +silc 706/tcp +silc 706/udp +kerberos-adm 749/tcp # Kerberos `kadmin' (v5) +# +webster 765/tcp # Network dictionary +webster 765/udp +rsync 873/tcp +rsync 873/udp +ftps-data 989/tcp # FTP over SSL (data) +ftps 990/tcp +telnets 992/tcp # Telnet over SSL +telnets 992/udp +imaps 993/tcp # IMAP over SSL +imaps 993/udp +ircs 994/tcp # IRC over SSL +ircs 994/udp +pop3s 995/tcp # POP-3 over SSL +pop3s 995/udp +# +# From ``Assigned Numbers'': +# +#> The Registered Ports are not controlled by the IANA and on most systems +#> can be used by ordinary user processes or programs executed by ordinary +#> users. +# +#> Ports are used in the TCP [45,106] to name the ends of logical +#> connections which carry long term conversations. For the purpose of +#> providing services to unknown callers, a service contact port is +#> defined. This list specifies the port used by the server process as its +#> contact port. While the IANA can not control uses of these ports it +#> does register or list uses of these ports as a convienence to the +#> community. +# +socks 1080/tcp # socks proxy server +socks 1080/udp +proofd 1093/tcp +proofd 1093/udp +rootd 1094/tcp +rootd 1094/udp +openvpn 1194/tcp +openvpn 1194/udp +rmiregistry 1099/tcp # Java RMI Registry +rmiregistry 1099/udp +kazaa 1214/tcp +kazaa 1214/udp +nessus 1241/tcp # Nessus vulnerability +nessus 1241/udp # assessment scanner +lotusnote 1352/tcp lotusnotes # Lotus Note +lotusnote 1352/udp lotusnotes +ms-sql-s 1433/tcp # Microsoft SQL Server +ms-sql-s 1433/udp +ms-sql-m 1434/tcp # Microsoft SQL Monitor +ms-sql-m 1434/udp +ingreslock 1524/tcp +ingreslock 1524/udp +prospero-np 1525/tcp # Prospero non-privileged +prospero-np 1525/udp +datametrics 1645/tcp old-radius +datametrics 1645/udp old-radius +sa-msg-port 1646/tcp old-radacct +sa-msg-port 1646/udp old-radacct +kermit 1649/tcp +kermit 1649/udp +l2f 1701/tcp l2tp +l2f 1701/udp l2tp +radius 1812/tcp +radius 1812/udp +radius-acct 1813/tcp radacct # Radius Accounting +radius-acct 1813/udp radacct +msnp 1863/tcp # MSN Messenger +msnp 1863/udp +unix-status 1957/tcp # remstats unix-status server +log-server 1958/tcp # remstats log server +remoteping 1959/tcp # remstats remoteping server +cisco-sccp 2000/tcp sieve # Cisco SCCP +cisco-sccp 2000/udp +search 2010/tcp ndtp +pipe_server 2010/tcp +nfs 2049/tcp # Network File System +nfs 2049/udp # Network File System +gnunet 2086/tcp +gnunet 2086/udp +rtcm-sc104 2101/tcp # RTCM SC-104 IANA 1/29/99 +rtcm-sc104 2101/udp +gsigatekeeper 2119/tcp +gsigatekeeper 2119/udp +gris 2135/tcp # Grid Resource Information Server +gris 2135/udp # Grid Resource Information Server +cvspserver 2401/tcp # CVS client/server operations +cvspserver 2401/udp +venus 2430/tcp # codacon port +venus 2430/udp # Venus callback/wbc interface +venus-se 2431/tcp # tcp side effects +venus-se 2431/udp # udp sftp side effect +codasrv 2432/tcp # not used +codasrv 2432/udp # server port +codasrv-se 2433/tcp # tcp side effects +codasrv-se 2433/udp # udp sftp side effect +mon 2583/tcp # MON traps +mon 2583/udp +dict 2628/tcp # Dictionary server +dict 2628/udp +gsiftp 2811/tcp +gsiftp 2811/udp +gpsd 2947/tcp +gpsd 2947/udp +gds_db 3050/tcp # InterBase server +gds_db 3050/udp +icpv2 3130/tcp icp # Internet Cache Protocol +icpv2 3130/udp icp +mysql 3306/tcp +mysql 3306/udp +nut 3493/tcp # Network UPS Tools +nut 3493/udp +distcc 3632/tcp # distributed compiler +distcc 3632/udp +daap 3689/tcp # Digital Audio Access Protocol +daap 3689/udp +svn 3690/tcp subversion # Subversion protocol +svn 3690/udp subversion +suucp 4031/tcp # UUCP over SSL +suucp 4031/udp # UUCP over SSL +sysrqd 4094/tcp # sysrq daemon +sysrqd 4094/udp # sysrq daemon +remctl 4373/tcp # Remote Authenticated Command Service +remctl 4373/udp # Remote Authenticated Command Service +iax 4569/tcp # Inter-Asterisk eXchange +iax 4569/udp +radmin-port 4899/tcp # RAdmin Port +radmin-port 4899/udp +rfe 5002/udp # Radio Free Ethernet +rfe 5002/tcp +mmcc 5050/tcp # multimedia conference control tool (Yahoo IM) +mmcc 5050/udp +sip 5060/tcp # Session Initiation Protocol +sip 5060/udp +sip-tls 5061/tcp +sip-tls 5061/udp +aol 5190/tcp # AIM +aol 5190/udp +xmpp-client 5222/tcp jabber-client # Jabber Client Connection +xmpp-client 5222/udp jabber-client +xmpp-server 5269/tcp jabber-server # Jabber Server Connection +xmpp-server 5269/udp jabber-server +cfengine 5308/tcp +cfengine 5308/udp +mdns 5353/tcp # Multicast DNS +mdns 5353/udp # Multicast DNS +postgresql 5432/tcp postgres # PostgreSQL Database +postgresql 5432/udp postgres +freeciv 5556/tcp rptp # Freeciv gameplay +freeciv 5556/udp +amqp 5672/tcp +amqp 5672/udp +amqp 5672/sctp +ggz 5688/tcp # GGZ Gaming Zone +ggz 5688/udp # GGZ Gaming Zone +x11 6000/tcp x11-0 # X Window System +x11 6000/udp x11-0 +x11-1 6001/tcp +x11-1 6001/udp +x11-2 6002/tcp +x11-2 6002/udp +x11-3 6003/tcp +x11-3 6003/udp +x11-4 6004/tcp +x11-4 6004/udp +x11-5 6005/tcp +x11-5 6005/udp +x11-6 6006/tcp +x11-6 6006/udp +x11-7 6007/tcp +x11-7 6007/udp +gnutella-svc 6346/tcp # gnutella +gnutella-svc 6346/udp +gnutella-rtr 6347/tcp # gnutella +gnutella-rtr 6347/udp +sge_qmaster 6444/tcp # Grid Engine Qmaster Service +sge_qmaster 6444/udp # Grid Engine Qmaster Service +sge_execd 6445/tcp # Grid Engine Execution Service +sge_execd 6445/udp # Grid Engine Execution Service +afs3-fileserver 7000/tcp bbs # file server itself +afs3-fileserver 7000/udp bbs +afs3-callback 7001/tcp # callbacks to cache managers +afs3-callback 7001/udp +afs3-prserver 7002/tcp # users & groups database +afs3-prserver 7002/udp +afs3-vlserver 7003/tcp # volume location database +afs3-vlserver 7003/udp +afs3-kaserver 7004/tcp # AFS/Kerberos authentication +afs3-kaserver 7004/udp +afs3-volser 7005/tcp # volume managment server +afs3-volser 7005/udp +afs3-errors 7006/tcp # error interpretation service +afs3-errors 7006/udp +afs3-bos 7007/tcp # basic overseer process +afs3-bos 7007/udp +afs3-update 7008/tcp # server-to-server updater +afs3-update 7008/udp +afs3-rmtsys 7009/tcp # remote cache manager service +afs3-rmtsys 7009/udp +font-service 7100/tcp xfs # X Font Service +font-service 7100/udp xfs +http-alt 8080/tcp webcache # WWW caching service +http-alt 8080/udp # WWW caching service +bacula-dir 9101/tcp # Bacula Director +bacula-dir 9101/udp +bacula-fd 9102/tcp # Bacula File Daemon +bacula-fd 9102/udp +bacula-sd 9103/tcp # Bacula Storage Daemon +bacula-sd 9103/udp +xmms2 9667/tcp # Cross-platform Music Multiplexing System +xmms2 9667/udp # Cross-platform Music Multiplexing System +amanda 10080/tcp # amanda backup services +amanda 10080/udp +hkp 11371/tcp # OpenPGP HTTP Keyserver +hkp 11371/udp # OpenPGP HTTP Keyserver +bprd 13720/tcp # VERITAS NetBackup +bprd 13720/udp +bpdbm 13721/tcp # VERITAS NetBackup +bpdbm 13721/udp +bpjava-msvc 13722/tcp # BP Java MSVC Protocol +bpjava-msvc 13722/udp +vnetd 13724/tcp # Veritas Network Utility +vnetd 13724/udp +bpcd 13782/tcp # VERITAS NetBackup +bpcd 13782/udp +vopied 13783/tcp # VERITAS NetBackup +vopied 13783/udp +wnn6 22273/tcp # wnn6 +wnn6 22273/udp + +# +# Datagram Delivery Protocol services +# +rtmp 1/ddp # Routing Table Maintenance Protocol +nbp 2/ddp # Name Binding Protocol +echo 4/ddp # AppleTalk Echo Protocol +zip 6/ddp # Zone Information Protocol + +#========================================================================= +# The remaining port numbers are not as allocated by IANA. +#========================================================================= + +# Kerberos (Project Athena/MIT) services +# Note that these are for Kerberos v4, and are unofficial. Sites running +# v4 should uncomment these and comment out the v5 entries above. +# +kerberos4 750/udp kerberos-iv kdc # Kerberos (server) +kerberos4 750/tcp kerberos-iv kdc +kerberos_master 751/udp # Kerberos authentication +kerberos_master 751/tcp +passwd_server 752/udp # Kerberos passwd server +krb_prop 754/tcp krb5_prop hprop # Kerberos slave propagation +krbupdate 760/tcp kreg # Kerberos registration +swat 901/tcp # swat +kpop 1109/tcp # Pop with Kerberos +knetd 2053/tcp # Kerberos de-multiplexor +zephyr-srv 2102/udp # Zephyr server +zephyr-clt 2103/udp # Zephyr serv-hm connection +zephyr-hm 2104/udp # Zephyr hostmanager +eklogin 2105/tcp # Kerberos encrypted rlogin +# Hmmm. Are we using Kv4 or Kv5 now? Worrying. +# The following is probably Kerberos v5 --- ajt@debian.org (11/02/2000) +kx 2111/tcp # X over Kerberos +iprop 2121/tcp # incremental propagation +# +# Unofficial but necessary (for NetBSD) services +# +supfilesrv 871/tcp # SUP server +supfiledbg 1127/tcp # SUP debugging + +# +# Services added for the Debian GNU/Linux distribution +# +linuxconf 98/tcp # LinuxConf +poppassd 106/tcp # Eudora +poppassd 106/udp +ssmtp 465/tcp smtps # SMTP over SSL +moira_db 775/tcp # Moira database +moira_update 777/tcp # Moira update protocol +moira_ureg 779/udp # Moira user registration +spamd 783/tcp # spamassassin daemon +omirr 808/tcp omirrd # online mirror +omirr 808/udp omirrd +customs 1001/tcp # pmake customs server +customs 1001/udp +skkserv 1178/tcp # skk jisho server port +predict 1210/udp # predict -- satellite tracking +rmtcfg 1236/tcp # Gracilis Packeten remote config server +wipld 1300/tcp # Wipl network monitor +xtel 1313/tcp # french minitel +xtelw 1314/tcp # french minitel +support 1529/tcp # GNATS +cfinger 2003/tcp # GNU Finger +frox 2121/tcp # frox: caching ftp proxy +ninstall 2150/tcp # ninstall service +ninstall 2150/udp +zebrasrv 2600/tcp # zebra service +zebra 2601/tcp # zebra vty +ripd 2602/tcp # ripd vty (zebra) +ripngd 2603/tcp # ripngd vty (zebra) +ospfd 2604/tcp # ospfd vty (zebra) +bgpd 2605/tcp # bgpd vty (zebra) +ospf6d 2606/tcp # ospf6d vty (zebra) +ospfapi 2607/tcp # OSPF-API +isisd 2608/tcp # ISISd vty (zebra) +afbackup 2988/tcp # Afbackup system +afbackup 2988/udp +afmbackup 2989/tcp # Afmbackup system +afmbackup 2989/udp +xtell 4224/tcp # xtell server +fax 4557/tcp # FAX transmission service (old) +hylafax 4559/tcp # HylaFAX client-server protocol (new) +distmp3 4600/tcp # distmp3host daemon +munin 4949/tcp lrrd # Munin +enbd-cstatd 5051/tcp # ENBD client statd +enbd-sstatd 5052/tcp # ENBD server statd +pcrd 5151/tcp # PCR-1000 Daemon +noclog 5354/tcp # noclogd with TCP (nocol) +noclog 5354/udp # noclogd with UDP (nocol) +hostmon 5355/tcp # hostmon uses TCP (nocol) +hostmon 5355/udp # hostmon uses UDP (nocol) +rplay 5555/udp # RPlay audio service +nsca 5667/tcp # Nagios Agent - NSCA +mrtd 5674/tcp # MRT Routing Daemon +bgpsim 5675/tcp # MRT Routing Simulator +canna 5680/tcp # cannaserver +sane-port 6566/tcp sane saned # SANE network scanner daemon +ircd 6667/tcp # Internet Relay Chat +zope-ftp 8021/tcp # zope management by ftp +tproxy 8081/tcp # Transparent Proxy +omniorb 8088/tcp # OmniORB +omniorb 8088/udp +clc-build-daemon 8990/tcp # Common lisp build daemon +xinetd 9098/tcp +mandelspawn 9359/udp mandelbrot # network mandelbrot +git 9418/tcp # Git Version Control System +zope 9673/tcp # zope server +webmin 10000/tcp +kamanda 10081/tcp # amanda backup services (Kerberos) +kamanda 10081/udp +amandaidx 10082/tcp # amanda backup services +amidxtape 10083/tcp # amanda backup services +smsqp 11201/tcp # Alamin SMS gateway +smsqp 11201/udp +xpilot 15345/tcp # XPilot Contact Port +xpilot 15345/udp +sgi-cmsd 17001/udp # Cluster membership services daemon +sgi-crsd 17002/udp +sgi-gcd 17003/udp # SGI Group membership daemon +sgi-cad 17004/tcp # Cluster Admin daemon +isdnlog 20011/tcp # isdn logging system +isdnlog 20011/udp +vboxd 20012/tcp # voice box system +vboxd 20012/udp +binkp 24554/tcp # binkp fidonet protocol +asp 27374/tcp # Address Search Protocol +asp 27374/udp +csync2 30865/tcp # cluster synchronization tool +dircproxy 57000/tcp # Detachable IRC Proxy +tfido 60177/tcp # fidonet EMSI over telnet +fido 60179/tcp # fidonet EMSI over TCP + +# Local services diff --git a/arch/openrisc/support/initramfs/init b/arch/openrisc/support/initramfs/init new file mode 120000 index 00000000000000..ebb2a55dd92929 --- /dev/null +++ b/arch/openrisc/support/initramfs/init @@ -0,0 +1 @@ +sbin/init \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/lib/ld-musl-or1k.so.1 b/arch/openrisc/support/initramfs/lib/ld-musl-or1k.so.1 new file mode 120000 index 00000000000000..79ae2d5ac5e287 --- /dev/null +++ b/arch/openrisc/support/initramfs/lib/ld-musl-or1k.so.1 @@ -0,0 +1 @@ +libc.so \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/lib/libatomic.so b/arch/openrisc/support/initramfs/lib/libatomic.so new file mode 120000 index 00000000000000..0ff10a72132b56 --- /dev/null +++ b/arch/openrisc/support/initramfs/lib/libatomic.so @@ -0,0 +1 @@ +libatomic.so.1.1.0 \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/lib/libatomic.so.1 b/arch/openrisc/support/initramfs/lib/libatomic.so.1 new file mode 120000 index 00000000000000..0ff10a72132b56 --- /dev/null +++ b/arch/openrisc/support/initramfs/lib/libatomic.so.1 @@ -0,0 +1 @@ +libatomic.so.1.1.0 \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/lib/libatomic.so.1.1.0 b/arch/openrisc/support/initramfs/lib/libatomic.so.1.1.0 new file mode 100755 index 00000000000000..ca876abaebfa51 Binary files /dev/null and b/arch/openrisc/support/initramfs/lib/libatomic.so.1.1.0 differ diff --git a/arch/openrisc/support/initramfs/lib/libc.so b/arch/openrisc/support/initramfs/lib/libc.so new file mode 100755 index 00000000000000..ebb19aa8ff6798 Binary files /dev/null and b/arch/openrisc/support/initramfs/lib/libc.so differ diff --git a/arch/openrisc/support/initramfs/lib/libgcc_s.so b/arch/openrisc/support/initramfs/lib/libgcc_s.so new file mode 120000 index 00000000000000..83033f74cf9a95 --- /dev/null +++ b/arch/openrisc/support/initramfs/lib/libgcc_s.so @@ -0,0 +1 @@ +libgcc_s.so.1 \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/lib/libgcc_s.so.1 b/arch/openrisc/support/initramfs/lib/libgcc_s.so.1 new file mode 100644 index 00000000000000..734188a05d07c7 Binary files /dev/null and b/arch/openrisc/support/initramfs/lib/libgcc_s.so.1 differ diff --git a/arch/openrisc/support/initramfs/lib/libgomp.so b/arch/openrisc/support/initramfs/lib/libgomp.so new file mode 120000 index 00000000000000..c5be39e6ceb512 --- /dev/null +++ b/arch/openrisc/support/initramfs/lib/libgomp.so @@ -0,0 +1 @@ +libgomp.so.1.0.0 \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/lib/libgomp.so.1 b/arch/openrisc/support/initramfs/lib/libgomp.so.1 new file mode 120000 index 00000000000000..c5be39e6ceb512 --- /dev/null +++ b/arch/openrisc/support/initramfs/lib/libgomp.so.1 @@ -0,0 +1 @@ +libgomp.so.1.0.0 \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/lib/libgomp.so.1.0.0 b/arch/openrisc/support/initramfs/lib/libgomp.so.1.0.0 new file mode 100755 index 00000000000000..57be184db61f2c Binary files /dev/null and b/arch/openrisc/support/initramfs/lib/libgomp.so.1.0.0 differ diff --git a/arch/openrisc/support/initramfs/lib/libssp.so b/arch/openrisc/support/initramfs/lib/libssp.so new file mode 120000 index 00000000000000..67650848ff7d33 --- /dev/null +++ b/arch/openrisc/support/initramfs/lib/libssp.so @@ -0,0 +1 @@ +libssp.so.0.0.0 \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/lib/libssp.so.0 b/arch/openrisc/support/initramfs/lib/libssp.so.0 new file mode 120000 index 00000000000000..67650848ff7d33 --- /dev/null +++ b/arch/openrisc/support/initramfs/lib/libssp.so.0 @@ -0,0 +1 @@ +libssp.so.0.0.0 \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/lib/libssp.so.0.0.0 b/arch/openrisc/support/initramfs/lib/libssp.so.0.0.0 new file mode 100755 index 00000000000000..7c4fb72c48f6d5 Binary files /dev/null and b/arch/openrisc/support/initramfs/lib/libssp.so.0.0.0 differ diff --git a/arch/openrisc/support/initramfs/lib/libstdc++.so b/arch/openrisc/support/initramfs/lib/libstdc++.so new file mode 120000 index 00000000000000..db90f975854c47 --- /dev/null +++ b/arch/openrisc/support/initramfs/lib/libstdc++.so @@ -0,0 +1 @@ +libstdc++.so.6.0.20 \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/lib/libstdc++.so.6 b/arch/openrisc/support/initramfs/lib/libstdc++.so.6 new file mode 120000 index 00000000000000..db90f975854c47 --- /dev/null +++ b/arch/openrisc/support/initramfs/lib/libstdc++.so.6 @@ -0,0 +1 @@ +libstdc++.so.6.0.20 \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/lib/libstdc++.so.6.0.20 b/arch/openrisc/support/initramfs/lib/libstdc++.so.6.0.20 new file mode 100755 index 00000000000000..9a866fef73b491 Binary files /dev/null and b/arch/openrisc/support/initramfs/lib/libstdc++.so.6.0.20 differ diff --git a/arch/openrisc/support/initramfs/lib/libstdc++.so.6.0.20-gdb.py b/arch/openrisc/support/initramfs/lib/libstdc++.so.6.0.20-gdb.py new file mode 100644 index 00000000000000..fa599f3d45d222 --- /dev/null +++ b/arch/openrisc/support/initramfs/lib/libstdc++.so.6.0.20-gdb.py @@ -0,0 +1,60 @@ +# -*- python -*- +# Copyright (C) 2009-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import sys +import gdb +import os +import os.path + +pythondir = '/opt/cross/or1k-linux-musl/share/gcc-4.9.2/python' +libdir = '/opt/cross/or1k-linux-musl/or1k-linux-musl/lib' + +# This file might be loaded when there is no current objfile. This +# can happen if the user loads it manually. In this case we don't +# update sys.path; instead we just hope the user managed to do that +# beforehand. +if gdb.current_objfile () is not None: + # Update module path. We want to find the relative path from libdir + # to pythondir, and then we want to apply that relative path to the + # directory holding the objfile with which this file is associated. + # This preserves relocatability of the gcc tree. + + # Do a simple normalization that removes duplicate separators. + pythondir = os.path.normpath (pythondir) + libdir = os.path.normpath (libdir) + + prefix = os.path.commonprefix ([libdir, pythondir]) + # In some bizarre configuration we might have found a match in the + # middle of a directory name. + if prefix[-1] != '/': + prefix = os.path.dirname (prefix) + '/' + + # Strip off the prefix. + pythondir = pythondir[len (prefix):] + libdir = libdir[len (prefix):] + + # Compute the ".."s needed to get from libdir to the prefix. + dotdots = ('..' + os.sep) * len (libdir.split (os.sep)) + + objfile = gdb.current_objfile ().filename + dir_ = os.path.join (os.path.dirname (objfile), dotdots, pythondir) + + if not dir_ in sys.path: + sys.path.insert(0, dir_) + +# Load the pretty-printers. +from libstdcxx.v6.printers import register_libstdcxx_printers +register_libstdcxx_printers (gdb.current_objfile ()) diff --git a/arch/openrisc/support/initramfs/sbin/acpid b/arch/openrisc/support/initramfs/sbin/acpid new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/acpid @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/adjtimex b/arch/openrisc/support/initramfs/sbin/adjtimex new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/adjtimex @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/arp b/arch/openrisc/support/initramfs/sbin/arp new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/arp @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/blkid b/arch/openrisc/support/initramfs/sbin/blkid new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/blkid @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/bootchartd b/arch/openrisc/support/initramfs/sbin/bootchartd new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/bootchartd @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/depmod b/arch/openrisc/support/initramfs/sbin/depmod new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/depmod @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/devmem b/arch/openrisc/support/initramfs/sbin/devmem new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/devmem @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/fbsplash b/arch/openrisc/support/initramfs/sbin/fbsplash new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/fbsplash @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/fdisk b/arch/openrisc/support/initramfs/sbin/fdisk new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/fdisk @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/findfs b/arch/openrisc/support/initramfs/sbin/findfs new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/findfs @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/freeramdisk b/arch/openrisc/support/initramfs/sbin/freeramdisk new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/freeramdisk @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/fsck b/arch/openrisc/support/initramfs/sbin/fsck new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/fsck @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/fsck.minix b/arch/openrisc/support/initramfs/sbin/fsck.minix new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/fsck.minix @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/getty b/arch/openrisc/support/initramfs/sbin/getty new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/getty @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/halt b/arch/openrisc/support/initramfs/sbin/halt new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/halt @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/hdparm b/arch/openrisc/support/initramfs/sbin/hdparm new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/hdparm @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/hwclock b/arch/openrisc/support/initramfs/sbin/hwclock new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/hwclock @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/ifconfig b/arch/openrisc/support/initramfs/sbin/ifconfig new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/ifconfig @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/ifdown b/arch/openrisc/support/initramfs/sbin/ifdown new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/ifdown @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/ifenslave b/arch/openrisc/support/initramfs/sbin/ifenslave new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/ifenslave @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/ifup b/arch/openrisc/support/initramfs/sbin/ifup new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/ifup @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/init b/arch/openrisc/support/initramfs/sbin/init new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/init @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/inotifyd b/arch/openrisc/support/initramfs/sbin/inotifyd new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/inotifyd @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/insmod b/arch/openrisc/support/initramfs/sbin/insmod new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/insmod @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/klogd b/arch/openrisc/support/initramfs/sbin/klogd new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/klogd @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/loadkmap b/arch/openrisc/support/initramfs/sbin/loadkmap new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/loadkmap @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/logread b/arch/openrisc/support/initramfs/sbin/logread new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/logread @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/losetup b/arch/openrisc/support/initramfs/sbin/losetup new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/losetup @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/lsmod b/arch/openrisc/support/initramfs/sbin/lsmod new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/lsmod @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/lspci b/arch/openrisc/support/initramfs/sbin/lspci new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/lspci @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/lsusb b/arch/openrisc/support/initramfs/sbin/lsusb new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/lsusb @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/makedevs b/arch/openrisc/support/initramfs/sbin/makedevs new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/makedevs @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/man b/arch/openrisc/support/initramfs/sbin/man new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/man @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/mdev b/arch/openrisc/support/initramfs/sbin/mdev new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/mdev @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/mkdosfs b/arch/openrisc/support/initramfs/sbin/mkdosfs new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/mkdosfs @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/mke2fs b/arch/openrisc/support/initramfs/sbin/mke2fs new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/mke2fs @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/mkfs.ext2 b/arch/openrisc/support/initramfs/sbin/mkfs.ext2 new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/mkfs.ext2 @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/mkfs.minix b/arch/openrisc/support/initramfs/sbin/mkfs.minix new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/mkfs.minix @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/mkfs.vfat b/arch/openrisc/support/initramfs/sbin/mkfs.vfat new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/mkfs.vfat @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/mkswap b/arch/openrisc/support/initramfs/sbin/mkswap new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/mkswap @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/modinfo b/arch/openrisc/support/initramfs/sbin/modinfo new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/modinfo @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/modprobe b/arch/openrisc/support/initramfs/sbin/modprobe new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/modprobe @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/nameif b/arch/openrisc/support/initramfs/sbin/nameif new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/nameif @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/pivot_root b/arch/openrisc/support/initramfs/sbin/pivot_root new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/pivot_root @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/poweroff b/arch/openrisc/support/initramfs/sbin/poweroff new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/poweroff @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/raidautorun b/arch/openrisc/support/initramfs/sbin/raidautorun new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/raidautorun @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/reboot b/arch/openrisc/support/initramfs/sbin/reboot new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/reboot @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/rmmod b/arch/openrisc/support/initramfs/sbin/rmmod new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/rmmod @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/route b/arch/openrisc/support/initramfs/sbin/route new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/route @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/runlevel b/arch/openrisc/support/initramfs/sbin/runlevel new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/runlevel @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/setconsole b/arch/openrisc/support/initramfs/sbin/setconsole new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/setconsole @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/slattach b/arch/openrisc/support/initramfs/sbin/slattach new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/slattach @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/start-stop-daemon b/arch/openrisc/support/initramfs/sbin/start-stop-daemon new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/start-stop-daemon @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/sulogin b/arch/openrisc/support/initramfs/sbin/sulogin new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/sulogin @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/swapoff b/arch/openrisc/support/initramfs/sbin/swapoff new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/swapoff @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/swapon b/arch/openrisc/support/initramfs/sbin/swapon new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/swapon @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/switch_root b/arch/openrisc/support/initramfs/sbin/switch_root new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/switch_root @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/sysctl b/arch/openrisc/support/initramfs/sbin/sysctl new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/sysctl @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/syslogd b/arch/openrisc/support/initramfs/sbin/syslogd new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/syslogd @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/tunctl b/arch/openrisc/support/initramfs/sbin/tunctl new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/tunctl @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/tune2fs b/arch/openrisc/support/initramfs/sbin/tune2fs new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/tune2fs @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/udhcpc b/arch/openrisc/support/initramfs/sbin/udhcpc new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/udhcpc @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/vconfig b/arch/openrisc/support/initramfs/sbin/vconfig new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/vconfig @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/watchdog b/arch/openrisc/support/initramfs/sbin/watchdog new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/watchdog @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/sbin/zcip b/arch/openrisc/support/initramfs/sbin/zcip new file mode 120000 index 00000000000000..71259713ee8dc4 --- /dev/null +++ b/arch/openrisc/support/initramfs/sbin/zcip @@ -0,0 +1 @@ +../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/[ b/arch/openrisc/support/initramfs/usr/bin/[ new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/[ @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/[[ b/arch/openrisc/support/initramfs/usr/bin/[[ new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/[[ @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/ar b/arch/openrisc/support/initramfs/usr/bin/ar new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/ar @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/arping b/arch/openrisc/support/initramfs/usr/bin/arping new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/arping @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/awk b/arch/openrisc/support/initramfs/usr/bin/awk new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/awk @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/basename b/arch/openrisc/support/initramfs/usr/bin/basename new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/basename @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/beep b/arch/openrisc/support/initramfs/usr/bin/beep new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/beep @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/bunzip2 b/arch/openrisc/support/initramfs/usr/bin/bunzip2 new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/bunzip2 @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/bzcat b/arch/openrisc/support/initramfs/usr/bin/bzcat new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/bzcat @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/bzip2 b/arch/openrisc/support/initramfs/usr/bin/bzip2 new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/bzip2 @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/cal b/arch/openrisc/support/initramfs/usr/bin/cal new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/cal @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/chat b/arch/openrisc/support/initramfs/usr/bin/chat new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/chat @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/chpst b/arch/openrisc/support/initramfs/usr/bin/chpst new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/chpst @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/chrt b/arch/openrisc/support/initramfs/usr/bin/chrt new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/chrt @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/chvt b/arch/openrisc/support/initramfs/usr/bin/chvt new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/chvt @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/cksum b/arch/openrisc/support/initramfs/usr/bin/cksum new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/cksum @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/clear b/arch/openrisc/support/initramfs/usr/bin/clear new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/clear @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/cmp b/arch/openrisc/support/initramfs/usr/bin/cmp new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/cmp @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/comm b/arch/openrisc/support/initramfs/usr/bin/comm new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/comm @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/crontab b/arch/openrisc/support/initramfs/usr/bin/crontab new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/crontab @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/cryptpw b/arch/openrisc/support/initramfs/usr/bin/cryptpw new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/cryptpw @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/cut b/arch/openrisc/support/initramfs/usr/bin/cut new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/cut @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/dc b/arch/openrisc/support/initramfs/usr/bin/dc new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/dc @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/deallocvt b/arch/openrisc/support/initramfs/usr/bin/deallocvt new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/deallocvt @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/diff b/arch/openrisc/support/initramfs/usr/bin/diff new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/diff @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/dirname b/arch/openrisc/support/initramfs/usr/bin/dirname new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/dirname @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/dos2unix b/arch/openrisc/support/initramfs/usr/bin/dos2unix new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/dos2unix @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/du b/arch/openrisc/support/initramfs/usr/bin/du new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/du @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/dumpleases b/arch/openrisc/support/initramfs/usr/bin/dumpleases new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/dumpleases @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/eject b/arch/openrisc/support/initramfs/usr/bin/eject new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/eject @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/env b/arch/openrisc/support/initramfs/usr/bin/env new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/env @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/envdir b/arch/openrisc/support/initramfs/usr/bin/envdir new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/envdir @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/envuidgid b/arch/openrisc/support/initramfs/usr/bin/envuidgid new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/envuidgid @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/ether-wake b/arch/openrisc/support/initramfs/usr/bin/ether-wake new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/ether-wake @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/expand b/arch/openrisc/support/initramfs/usr/bin/expand new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/expand @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/expr b/arch/openrisc/support/initramfs/usr/bin/expr new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/expr @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/fdformat b/arch/openrisc/support/initramfs/usr/bin/fdformat new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/fdformat @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/fgconsole b/arch/openrisc/support/initramfs/usr/bin/fgconsole new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/fgconsole @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/find b/arch/openrisc/support/initramfs/usr/bin/find new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/find @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/flock b/arch/openrisc/support/initramfs/usr/bin/flock new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/flock @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/fold b/arch/openrisc/support/initramfs/usr/bin/fold new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/fold @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/free b/arch/openrisc/support/initramfs/usr/bin/free new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/free @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/ftpget b/arch/openrisc/support/initramfs/usr/bin/ftpget new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/ftpget @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/ftpput b/arch/openrisc/support/initramfs/usr/bin/ftpput new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/ftpput @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/fuser b/arch/openrisc/support/initramfs/usr/bin/fuser new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/fuser @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/hd b/arch/openrisc/support/initramfs/usr/bin/hd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/hd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/head b/arch/openrisc/support/initramfs/usr/bin/head new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/head @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/hexdump b/arch/openrisc/support/initramfs/usr/bin/hexdump new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/hexdump @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/hostid b/arch/openrisc/support/initramfs/usr/bin/hostid new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/hostid @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/id b/arch/openrisc/support/initramfs/usr/bin/id new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/id @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/ifplugd b/arch/openrisc/support/initramfs/usr/bin/ifplugd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/ifplugd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/install b/arch/openrisc/support/initramfs/usr/bin/install new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/install @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/ipcrm b/arch/openrisc/support/initramfs/usr/bin/ipcrm new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/ipcrm @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/ipcs b/arch/openrisc/support/initramfs/usr/bin/ipcs new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/ipcs @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/kbd_mode b/arch/openrisc/support/initramfs/usr/bin/kbd_mode new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/kbd_mode @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/killall b/arch/openrisc/support/initramfs/usr/bin/killall new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/killall @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/killall5 b/arch/openrisc/support/initramfs/usr/bin/killall5 new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/killall5 @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/last b/arch/openrisc/support/initramfs/usr/bin/last new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/last @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/length b/arch/openrisc/support/initramfs/usr/bin/length new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/length @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/less b/arch/openrisc/support/initramfs/usr/bin/less new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/less @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/logger b/arch/openrisc/support/initramfs/usr/bin/logger new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/logger @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/logname b/arch/openrisc/support/initramfs/usr/bin/logname new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/logname @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/lpq b/arch/openrisc/support/initramfs/usr/bin/lpq new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/lpq @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/lpr b/arch/openrisc/support/initramfs/usr/bin/lpr new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/lpr @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/lspci b/arch/openrisc/support/initramfs/usr/bin/lspci new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/lspci @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/lsusb b/arch/openrisc/support/initramfs/usr/bin/lsusb new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/lsusb @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/lzcat b/arch/openrisc/support/initramfs/usr/bin/lzcat new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/lzcat @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/lzma b/arch/openrisc/support/initramfs/usr/bin/lzma new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/lzma @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/lzmacat b/arch/openrisc/support/initramfs/usr/bin/lzmacat new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/lzmacat @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/lzopcat b/arch/openrisc/support/initramfs/usr/bin/lzopcat new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/lzopcat @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/md5sum b/arch/openrisc/support/initramfs/usr/bin/md5sum new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/md5sum @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/mesg b/arch/openrisc/support/initramfs/usr/bin/mesg new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/mesg @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/microcom b/arch/openrisc/support/initramfs/usr/bin/microcom new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/microcom @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/mkfifo b/arch/openrisc/support/initramfs/usr/bin/mkfifo new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/mkfifo @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/mkpasswd b/arch/openrisc/support/initramfs/usr/bin/mkpasswd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/mkpasswd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/nc b/arch/openrisc/support/initramfs/usr/bin/nc new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/nc @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/nmeter b/arch/openrisc/support/initramfs/usr/bin/nmeter new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/nmeter @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/nohup b/arch/openrisc/support/initramfs/usr/bin/nohup new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/nohup @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/nslookup b/arch/openrisc/support/initramfs/usr/bin/nslookup new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/nslookup @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/od b/arch/openrisc/support/initramfs/usr/bin/od new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/od @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/openvt b/arch/openrisc/support/initramfs/usr/bin/openvt new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/openvt @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/passwd b/arch/openrisc/support/initramfs/usr/bin/passwd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/passwd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/patch b/arch/openrisc/support/initramfs/usr/bin/patch new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/patch @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/pgrep b/arch/openrisc/support/initramfs/usr/bin/pgrep new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/pgrep @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/pkill b/arch/openrisc/support/initramfs/usr/bin/pkill new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/pkill @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/printf b/arch/openrisc/support/initramfs/usr/bin/printf new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/printf @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/pscan b/arch/openrisc/support/initramfs/usr/bin/pscan new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/pscan @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/pstree b/arch/openrisc/support/initramfs/usr/bin/pstree new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/pstree @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/readahead b/arch/openrisc/support/initramfs/usr/bin/readahead new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/readahead @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/readlink b/arch/openrisc/support/initramfs/usr/bin/readlink new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/readlink @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/realpath b/arch/openrisc/support/initramfs/usr/bin/realpath new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/realpath @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/renice b/arch/openrisc/support/initramfs/usr/bin/renice new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/renice @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/reset b/arch/openrisc/support/initramfs/usr/bin/reset new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/reset @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/resize b/arch/openrisc/support/initramfs/usr/bin/resize new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/resize @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/rpm2cpio b/arch/openrisc/support/initramfs/usr/bin/rpm2cpio new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/rpm2cpio @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/rtcwake b/arch/openrisc/support/initramfs/usr/bin/rtcwake new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/rtcwake @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/runsv b/arch/openrisc/support/initramfs/usr/bin/runsv new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/runsv @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/runsvdir b/arch/openrisc/support/initramfs/usr/bin/runsvdir new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/runsvdir @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/rx b/arch/openrisc/support/initramfs/usr/bin/rx new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/rx @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/script b/arch/openrisc/support/initramfs/usr/bin/script new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/script @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/seq b/arch/openrisc/support/initramfs/usr/bin/seq new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/seq @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/setkeycodes b/arch/openrisc/support/initramfs/usr/bin/setkeycodes new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/setkeycodes @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/setsid b/arch/openrisc/support/initramfs/usr/bin/setsid new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/setsid @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/setuidgid b/arch/openrisc/support/initramfs/usr/bin/setuidgid new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/setuidgid @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/sha1sum b/arch/openrisc/support/initramfs/usr/bin/sha1sum new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/sha1sum @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/sha256sum b/arch/openrisc/support/initramfs/usr/bin/sha256sum new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/sha256sum @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/sha512sum b/arch/openrisc/support/initramfs/usr/bin/sha512sum new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/sha512sum @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/showkey b/arch/openrisc/support/initramfs/usr/bin/showkey new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/showkey @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/smemcap b/arch/openrisc/support/initramfs/usr/bin/smemcap new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/smemcap @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/softlimit b/arch/openrisc/support/initramfs/usr/bin/softlimit new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/softlimit @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/sort b/arch/openrisc/support/initramfs/usr/bin/sort new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/sort @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/split b/arch/openrisc/support/initramfs/usr/bin/split new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/split @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/strings b/arch/openrisc/support/initramfs/usr/bin/strings new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/strings @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/sum b/arch/openrisc/support/initramfs/usr/bin/sum new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/sum @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/sv b/arch/openrisc/support/initramfs/usr/bin/sv new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/sv @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/tac b/arch/openrisc/support/initramfs/usr/bin/tac new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/tac @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/tail b/arch/openrisc/support/initramfs/usr/bin/tail new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/tail @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/taskset b/arch/openrisc/support/initramfs/usr/bin/taskset new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/taskset @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/tcpsvd b/arch/openrisc/support/initramfs/usr/bin/tcpsvd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/tcpsvd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/tee b/arch/openrisc/support/initramfs/usr/bin/tee new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/tee @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/telnet b/arch/openrisc/support/initramfs/usr/bin/telnet new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/telnet @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/test b/arch/openrisc/support/initramfs/usr/bin/test new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/test @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/tftp b/arch/openrisc/support/initramfs/usr/bin/tftp new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/tftp @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/tftpd b/arch/openrisc/support/initramfs/usr/bin/tftpd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/tftpd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/time b/arch/openrisc/support/initramfs/usr/bin/time new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/time @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/timeout b/arch/openrisc/support/initramfs/usr/bin/timeout new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/timeout @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/top b/arch/openrisc/support/initramfs/usr/bin/top new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/top @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/tr b/arch/openrisc/support/initramfs/usr/bin/tr new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/tr @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/traceroute b/arch/openrisc/support/initramfs/usr/bin/traceroute new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/traceroute @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/traceroute6 b/arch/openrisc/support/initramfs/usr/bin/traceroute6 new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/traceroute6 @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/tty b/arch/openrisc/support/initramfs/usr/bin/tty new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/tty @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/ttysize b/arch/openrisc/support/initramfs/usr/bin/ttysize new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/ttysize @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/udpsvd b/arch/openrisc/support/initramfs/usr/bin/udpsvd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/udpsvd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/unexpand b/arch/openrisc/support/initramfs/usr/bin/unexpand new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/unexpand @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/uniq b/arch/openrisc/support/initramfs/usr/bin/uniq new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/uniq @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/unix2dos b/arch/openrisc/support/initramfs/usr/bin/unix2dos new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/unix2dos @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/unlzma b/arch/openrisc/support/initramfs/usr/bin/unlzma new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/unlzma @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/unlzop b/arch/openrisc/support/initramfs/usr/bin/unlzop new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/unlzop @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/unxz b/arch/openrisc/support/initramfs/usr/bin/unxz new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/unxz @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/unzip b/arch/openrisc/support/initramfs/usr/bin/unzip new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/unzip @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/uptime b/arch/openrisc/support/initramfs/usr/bin/uptime new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/uptime @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/uudecode b/arch/openrisc/support/initramfs/usr/bin/uudecode new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/uudecode @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/uuencode b/arch/openrisc/support/initramfs/usr/bin/uuencode new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/uuencode @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/vlock b/arch/openrisc/support/initramfs/usr/bin/vlock new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/vlock @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/volname b/arch/openrisc/support/initramfs/usr/bin/volname new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/volname @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/wall b/arch/openrisc/support/initramfs/usr/bin/wall new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/wall @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/wc b/arch/openrisc/support/initramfs/usr/bin/wc new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/wc @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/wget b/arch/openrisc/support/initramfs/usr/bin/wget new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/wget @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/which b/arch/openrisc/support/initramfs/usr/bin/which new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/which @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/who b/arch/openrisc/support/initramfs/usr/bin/who new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/who @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/whoami b/arch/openrisc/support/initramfs/usr/bin/whoami new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/whoami @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/xargs b/arch/openrisc/support/initramfs/usr/bin/xargs new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/xargs @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/xz b/arch/openrisc/support/initramfs/usr/bin/xz new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/xz @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/xzcat b/arch/openrisc/support/initramfs/usr/bin/xzcat new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/xzcat @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/bin/yes b/arch/openrisc/support/initramfs/usr/bin/yes new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/bin/yes @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/brctl b/arch/openrisc/support/initramfs/usr/sbin/brctl new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/brctl @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/chpasswd b/arch/openrisc/support/initramfs/usr/sbin/chpasswd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/chpasswd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/chroot b/arch/openrisc/support/initramfs/usr/sbin/chroot new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/chroot @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/crond b/arch/openrisc/support/initramfs/usr/sbin/crond new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/crond @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/dhcprelay b/arch/openrisc/support/initramfs/usr/sbin/dhcprelay new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/dhcprelay @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/dnsd b/arch/openrisc/support/initramfs/usr/sbin/dnsd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/dnsd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/fakeidentd b/arch/openrisc/support/initramfs/usr/sbin/fakeidentd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/fakeidentd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/fbset b/arch/openrisc/support/initramfs/usr/sbin/fbset new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/fbset @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/flash_eraseall b/arch/openrisc/support/initramfs/usr/sbin/flash_eraseall new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/flash_eraseall @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/flash_lock b/arch/openrisc/support/initramfs/usr/sbin/flash_lock new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/flash_lock @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/flash_unlock b/arch/openrisc/support/initramfs/usr/sbin/flash_unlock new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/flash_unlock @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/flashcp b/arch/openrisc/support/initramfs/usr/sbin/flashcp new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/flashcp @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/ftpd b/arch/openrisc/support/initramfs/usr/sbin/ftpd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/ftpd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/httpd b/arch/openrisc/support/initramfs/usr/sbin/httpd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/httpd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/inetd b/arch/openrisc/support/initramfs/usr/sbin/inetd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/inetd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/loadfont b/arch/openrisc/support/initramfs/usr/sbin/loadfont new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/loadfont @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/lpd b/arch/openrisc/support/initramfs/usr/sbin/lpd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/lpd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/ntpd b/arch/openrisc/support/initramfs/usr/sbin/ntpd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/ntpd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/popmaildir b/arch/openrisc/support/initramfs/usr/sbin/popmaildir new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/popmaildir @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/rdate b/arch/openrisc/support/initramfs/usr/sbin/rdate new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/rdate @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/rdev b/arch/openrisc/support/initramfs/usr/sbin/rdev new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/rdev @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/readprofile b/arch/openrisc/support/initramfs/usr/sbin/readprofile new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/readprofile @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/sendmail b/arch/openrisc/support/initramfs/usr/sbin/sendmail new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/sendmail @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/setfont b/arch/openrisc/support/initramfs/usr/sbin/setfont new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/setfont @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/setlogcons b/arch/openrisc/support/initramfs/usr/sbin/setlogcons new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/setlogcons @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/svlogd b/arch/openrisc/support/initramfs/usr/sbin/svlogd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/svlogd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/telnetd b/arch/openrisc/support/initramfs/usr/sbin/telnetd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/telnetd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/sbin/udhcpd b/arch/openrisc/support/initramfs/usr/sbin/udhcpd new file mode 120000 index 00000000000000..f948f1a72d09c7 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/sbin/udhcpd @@ -0,0 +1 @@ +../../bin/busybox \ No newline at end of file diff --git a/arch/openrisc/support/initramfs/usr/share/udhcpc/default.script b/arch/openrisc/support/initramfs/usr/share/udhcpc/default.script new file mode 100755 index 00000000000000..00ee7ef9002b10 --- /dev/null +++ b/arch/openrisc/support/initramfs/usr/share/udhcpc/default.script @@ -0,0 +1,27 @@ +#!/bin/sh + +case "$1" in + deconfig) + /sbin/ifconfig $interface 0.0.0.0 + ;; + + renew|bound) + /sbin/ifconfig $interface $ip $BROADCAST $NETMASK + + if [ -n "$router" ] ; then + echo "deleting routers" + while route del default gw 0.0.0.0 dev $interface ; do + : + done + + metric=0 + for i in $router ; do + route add default gw $i dev $interface metric $((metric++)) + done + fi + ;; + + default) + ;; +esac + diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index a043107da2af77..ca371560ae733a 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -601,6 +601,12 @@ config TILE_SROM device appear much like a simple EEPROM, and knows how to partition a single ROM for multiple purposes. +config ARC_SCET +default n + bool "Enable SCET timer" + ---help--- + This enables SCET timer as a char device. + source "drivers/char/xillybus/Kconfig" endmenu diff --git a/drivers/char/Makefile b/drivers/char/Makefile index d8a7579300d2df..a36fc239256990 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -5,6 +5,8 @@ obj-y += mem.o random.o obj-$(CONFIG_TTY_PRINTK) += ttyprintk.o obj-y += misc.o + +obj-$(CONFIG_ARC_SCET) += scet.o obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o obj-$(CONFIG_VIRTIO_CONSOLE) += virtio_console.o obj-$(CONFIG_RAW_DRIVER) += raw.o diff --git a/drivers/char/scet.c b/drivers/char/scet.c new file mode 100644 index 00000000000000..b18ec6ce244d08 --- /dev/null +++ b/drivers/char/scet.c @@ -0,0 +1,371 @@ +/* + * scet.c - Create an input/output device driver for scet timer + */ + +#define DEBUG + +#include /* We're doing kernel work */ +#include /* Specifically, a module */ +#include +#include +#include /* for get_user and put_user */ +#include +#include + +#include "scet.h" + +#define DEVICE_NAME "scet_dev" +#define BUF_LEN TIMER_WIDTH //We never read/write more then 6 bytes of data + +/* + * Is the device open right now? Used to prevent + * concurent access into the same device + */ +static int Device_Open = 0; + +static struct scet_cd *scd; + +//0 to SCET_TCTRL will, stop the counter +//1 the counter will run +//2 value freeze and counter is counting +//3 value freeze but counter running +static void stop_timer(struct scet_cd *s_scet_cd) +{ + s_scet_cd->timer_run = 0; + pr_debug("sct STOP run:%d, freeze: %d ctrl: %d \n", + s_scet_cd->timer_run, + s_scet_cd->timer_freeze, + s_scet_cd->timer_run | (s_scet_cd->timer_freeze << 1)); + scet_write(s_scet_cd, SCET_TCTRL, + (s_scet_cd->timer_run | (s_scet_cd->timer_freeze << 1))); + +} + +static void start_timer(struct scet_cd *s_scet_cd) +{ + s_scet_cd->timer_run = 1; + pr_debug("sct START run:%d, freeze: %d ctrl: %d \n", + s_scet_cd->timer_run, + s_scet_cd->timer_freeze, + s_scet_cd->timer_run | (s_scet_cd->timer_freeze << 1)); + scet_write(s_scet_cd, SCET_TCTRL, + s_scet_cd->timer_run | (s_scet_cd->timer_freeze << 1)); + +} + +static void freeze_timer(struct scet_cd *s_scet_cd) +{ + s_scet_cd->timer_freeze = 1; + pr_debug("sct FREEZE run:%d, freeze:%d, ctrl: %d \n", + s_scet_cd->timer_run, + s_scet_cd->timer_freeze, + s_scet_cd->timer_run | (s_scet_cd->timer_freeze << 1)); + scet_write(s_scet_cd, SCET_TCTRL, + s_scet_cd->timer_run | (s_scet_cd->timer_freeze << 1)); + +} + +static void ufreeze_timer(struct scet_cd *s_scet_cd) +{ + s_scet_cd->timer_freeze = 0; + pr_debug("sct UFREEZE run:%d, freeze: %d, ctrl: %d \n", + s_scet_cd->timer_run, s_scet_cd->timer_freeze, + s_scet_cd->timer_run | (s_scet_cd->timer_freeze << 1)); + scet_write(s_scet_cd, SCET_TCTRL, + s_scet_cd->timer_run | (s_scet_cd->timer_freeze << 1)); + +} + +static void reset_timer(struct scet_cd *s_scet_cd) +{ + scet_write(s_scet_cd, SCET_TB0, 0); + scet_write(s_scet_cd, SCET_TB1, 0); + scet_write(s_scet_cd, SCET_TB2, 0); + scet_write(s_scet_cd, SCET_TB3, 0); + scet_write(s_scet_cd, SCET_TB4, 0); + scet_write(s_scet_cd, SCET_TB5, 0); +} + +#if 0 +static void read_timer(struct scet_cd *s_scet_cd) +{ + int i = 0; + + freeze_timer(s_scet_cd); + + for (i = 0; i < TIMER_WIDTH; i++) { + s_scet_cd->current_time[i] = scet_read(s_scet_cd, i); + } + + ufreeze_timer(s_scet_cd); + +} +#endif + +/* + * This is called whenever a process attempts to open the device file + */ +static int device_open(struct inode *inode, struct file *file) +{ + pr_debug("\n SCET device_open(%p)\n", file); + /* + * We don't want to talk to two processes at the same time + */ + if (Device_Open) + return -EBUSY; + + Device_Open++; + + try_module_get(THIS_MODULE); + + return 0; +} + +static int device_release(struct inode *inode, struct file *file) +{ + + pr_debug("device_release(%p,%p)\n", inode, file); + + /* + * We're now ready for our next caller + */ + Device_Open--; + + module_put(THIS_MODULE); + + return 0; +} + +static ssize_t device_read(struct file *file, /* see include/linux/fs.h */ + char __user * buffer, /* buffer to be + * filled with data */ + size_t length, /* length of the buffer */ + loff_t * offset) +{ + + int bytes_read = 0; + u8 next_out; + pr_debug("device_read(%p,%p,%d)\n", file, buffer, length); + + freeze_timer(scd); + while (bytes_read < TIMER_WIDTH || length < 0) { + next_out = scet_read(scd, bytes_read); + pr_debug("next out: %d\n", next_out); + put_user(next_out, buffer++); + length--; + bytes_read++; + } + ufreeze_timer(scd); + + pr_debug("Read %d bytes\n", bytes_read); + return bytes_read; +} + +static ssize_t +device_write(struct file *file, + const char __user * buffer, size_t length, loff_t * offset) +{ + int i; + u8 next_out; + + pr_debug("SCET_write(%p,%p,%d)", file, buffer, length); + + for (i = 0; i < TIMER_WIDTH && i < BUF_LEN; i++) { + get_user(next_out, buffer + i); + pr_debug("Write %d to, i %d \n", next_out, i); + scet_write(scd, i, next_out); + } + pr_debug("SCET byte writen to timer %d", i); + return i; +} + +/* + * This function is called whenever a process tries to do an ioctl on our + * device file. We get two extra parameters (additional to the inode and file + * structures, which all device functions get): the number of the ioctl called + * and the parameter given to the ioctl function. + * + * If the ioctl is write or read/write (meaning output is returned to the + * calling process), the ioctl call returns the output of this function. + * + */ + +/* +int device_ioctl(struct inode *inode, /see include/linux/fs.h + struct file *file, ditto + unsigned int ioctl_num, number and param for ioctl + unsigned long arg) */ +long device_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + + int i; + unsigned char *temp; + unsigned char ch; + + /* + * Switch according to the ioctl called + */ + switch (cmd) { + + pr_debug("cmd %u \n", cmd); + + case IOCTL_SET_SCET_TIME: + temp = (unsigned char *)arg; + + /* + * Find the length of the message + */ + get_user(ch, temp); + for (i = 0; ch && i < BUF_LEN; i++, temp++) + get_user(ch, temp); + + device_write(file, (unsigned char *)arg, i, 0); + break; + + case IOCTL_GET_SCET_TIME: + + i = device_read(file, (unsigned char *)arg, 6, 0); + break; + + case IOCTL_SET_SCET_OPERATION: + + pr_debug("Set SCET timer mode to %u \n", (unsigned int)arg); + if (arg == 0) + stop_timer(scd); + else + start_timer(scd); + + /* + * This ioctl is both input (ioctl_param) and + * output (the return value of this function) + */ + return (scd->timer_run | (scd->timer_freeze << 1)); + break; + + case IOCTL_GET_SCET_STATUS: + + put_user((scd->timer_run | (scd->timer_freeze << 1)), + (int *)arg); + break; + } + + return 0; +} + +static int scet_probe(struct platform_device *pdev) +{ + + int retval = 0; + struct resource *r; + + pr_debug("Probing SCET device\n"); + + scd = devm_kzalloc(&pdev->dev, sizeof(struct scet_cd), GFP_KERNEL); + + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (r == NULL) { + dev_dbg(&pdev->dev, "No resource\n"); + retval = -ENODEV; + goto out; + } + + if (!devm_request_mem_region(&pdev->dev, r->start, resource_size(r), + dev_name(&pdev->dev))) { + dev_dbg(&pdev->dev, "Resource not available\n"); + retval = -EBUSY; + goto out; + } + + scd->addr_reg = devm_ioremap_nocache(&pdev->dev, r->start, + resource_size(r)); + if (!scd->addr_reg) { + retval = -ENOMEM; + goto out; + } + + scd->timer_freeze = 0; + scd->timer_run = 0; + + pr_debug("Probed and resources allocated\n"); + + stop_timer(scd); + reset_timer(scd); + +out: + return retval; +} + +static int scet_remove(struct platform_device *dev) +{ + /* Nothing to do... + * 'devres' device management takes cares of freeing + * resources for us + */ + + return 0; +} + +static struct of_device_id scet_match[] = { + { + .compatible = "opencores,scet", + }, + {}, +}; + +MODULE_DEVICE_TABLE(of, scet_match); +MODULE_ALIAS("platform:" DEVICE_NAME); + +static struct platform_driver scet_driver = { + .probe = scet_probe, + .remove = scet_remove, + .driver = { + .name = DEVICE_NAME, + .owner = THIS_MODULE, + .of_match_table = scet_match, + }, +}; + +static const struct file_operations scet_fops = { + .read = device_read, + .write = device_write, + .unlocked_ioctl = device_ioctl, + .open = device_open, + .release = device_release, /* a.k.a. close */ +}; + +static int __init scet_init(void) +{ + int status = 0; + + if (register_chrdev(MAJOR_NUM, DEVICE_NAME, &scet_fops)) { + return -EIO; + } + + status = platform_driver_register(&scet_driver); + if (status) + goto err_out; + + pr_debug("ARC-SCET driver\n"); + + return status; + +err_out: + unregister_chrdev(MAJOR_NUM, DEVICE_NAME); + return status; +} +module_init(scet_init); + +static void __exit scet_cleanup(void) +{ + platform_driver_unregister(&scet_driver); + unregister_chrdev(MAJOR_NUM, DEVICE_NAME); +} +module_exit(scet_cleanup); + +static const struct file_operations Fops = { + .read = device_read, + .write = device_write, + .unlocked_ioctl = device_ioctl, + .open = device_open, + .release = device_release, /* a.k.a. close */ +}; diff --git a/drivers/char/scet.h b/drivers/char/scet.h new file mode 100644 index 00000000000000..443925b2cb9b40 --- /dev/null +++ b/drivers/char/scet.h @@ -0,0 +1,86 @@ + +#ifndef SCET_H +#define SCET_H + +#include + +#define DEVELOP 1 +/* + * The major device number. We can't rely on dynamic + * registration any more, because ioctls need to know + * it. + */ +#define MAJOR_NUM 100 +#define TIMER_WIDTH 0x06 + +/* + * Set the time of the SCET + */ +#define IOCTL_SET_SCET_TIME _IOR(MAJOR_NUM, 0, unsigned char *) + +/* + * Get the time of the SCET + * This always return 6 unsigned char + * Note: prepare enought bufferspace in userspace before calling. + */ +#define IOCTL_GET_SCET_TIME _IOR(MAJOR_NUM, 1, unsigned char *) + +/* + * Set the run status of the SCET + * 0 for stop the timer + * 1 to start the timer + */ +#define IOCTL_SET_SCET_OPERATION _IOWR(MAJOR_NUM, 2, int) + +/* + * Get the run status of the SCET + * 0 = Stoped + * 1 = Running + * 2 = Freezing + Stoped + * 3 = Freezing + Running + */ +#define IOCTL_GET_SCET_STATUS _IOR(MAJOR_NUM, 3, int *) + +/* + * The name of the device file + */ +#define DEVICE_FILE_NAME "scet_dev" + +// Register offsets +#define SCET_TB0 0x0 // Timer byte 0 +#define SCET_TB1 0x1 // Timer byte 1 +#define SCET_TB2 0x2 // Timer byte 2 +#define SCET_TB3 0x3 // Timer byte 3 +#define SCET_TB4 0x4 // Timer byte 4 +#define SCET_TB5 0x5 // Timer byte 5 +#define SCET_TCTRL 0x6 // Timer control + +// Timer control bit masks +#define SCET_TCTRL_TIMER_RUNNING 0x1 +#define SCET_TCTRL_OUTPUT_FROZEN 0x2 +#define SCET_TCTRL_TIMER_STOP 0x0 + +struct scet_cd { + void __iomem *addr_reg; + u8 timer_freeze; + u8 timer_run; + u8 current_time[TIMER_WIDTH]; +}; + +static inline void scet_write(struct scet_cd *s_scet_cd, int reg, u8 val) +{ + void __iomem *addr_reg = s_scet_cd->addr_reg; + + ((volatile unsigned char *)addr_reg)[reg] = val; +} + +static inline u8 scet_read(struct scet_cd *s_scet_cd, int reg) +{ + u8 temp; + void __iomem *addr_reg = s_scet_cd->addr_reg; + + temp = ((volatile unsigned char *)addr_reg)[reg]; + return temp; +} + +#endif diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index 88d474b780766a..0b7ba140b6aa45 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -459,6 +459,13 @@ config XGENE_DMA help Enable support for the APM X-Gene SoC DMA engine. +config WISHBONE_STREAMER_DMA + bool "Wishbone streamer DMA" + select DMA_ENGINE + select DMA_VIRTUAL_CHANNELS + help + Enable support for Wishbone streamer DMA softcore + config DMA_ENGINE bool diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile index 6a4d6f2827da49..7b406a7b578955 100644 --- a/drivers/dma/Makefile +++ b/drivers/dma/Makefile @@ -56,3 +56,4 @@ obj-$(CONFIG_NBPFAXI_DMA) += nbpfaxi.o obj-$(CONFIG_DMA_SUN6I) += sun6i-dma.o obj-$(CONFIG_IMG_MDC_DMA) += img-mdc-dma.o obj-$(CONFIG_XGENE_DMA) += xgene-dma.o +obj-$(CONFIG_WISHBONE_STREAMER_DMA) += wb_streamer-dma.o diff --git a/drivers/dma/wb_streamer-dma.c b/drivers/dma/wb_streamer-dma.c new file mode 100644 index 00000000000000..d33637fa59e479 --- /dev/null +++ b/drivers/dma/wb_streamer-dma.c @@ -0,0 +1,418 @@ +/* + * DMA driver for the Wishbone Streamer softcore + * (https://github.com/olofk/wb_streamer) + * + * Copyright (C) 2014 Stefan Kristiansson + * + * Based on dma-jz4740 + * Copyright (C) 2013, Lars-Peter Clausen + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#include +#include +#include +#include +#include + +#include "virt-dma.h" + +#define WBSTREAMER_CSR 0x00 +#define WBSTREAMER_START_ADDR 0x04 +#define WBSTREAMER_BUF_SIZE 0x08 +#define WBSTREAMER_BURST_SIZE 0x0c +#define WBSTREAMER_TRANSFERRED 0x10 + +#define WBSTREAMER_CSR_ENABLE (1 << 0) +#define WBSTREAMER_CSR_IRQ (1 << 1) + +struct wbstream_dma_sg { + dma_addr_t addr; + unsigned int len; +}; + +struct wbstream_dma_desc { + struct virt_dma_desc vdesc; + + enum dma_transfer_direction direction; + bool cyclic; + + unsigned int num_sgs; + struct wbstream_dma_sg sg[]; +}; + +struct wbstream_dma; + +struct wbstream_chan { + struct virt_dma_chan vchan; + unsigned int slave_id; + struct wbstream_dma_desc *desc; + unsigned int next_sg; +}; + +struct wbstream_dma { + struct dma_device dma_dev; + void __iomem *regs; + struct wbstream_chan chan; +}; + +static void wbstream_write_reg(struct wbstream_dma *wdma, loff_t offset, + u32 value) +{ + iowrite32be(value, wdma->regs + offset); +} + +static u32 wbstream_read_reg(struct wbstream_dma *wdma, loff_t offset) +{ + return ioread32be(wdma->regs + offset); +} + +static struct wbstream_dma_desc *wbstream_dma_alloc_desc(unsigned int num_sgs) +{ + return kzalloc(sizeof(struct wbstream_dma_desc) + + sizeof(struct wbstream_dma_sg) * num_sgs, GFP_ATOMIC); +} + +static struct wbstream_chan *to_wbstream_chan(struct dma_chan *chan) +{ + return container_of(chan, struct wbstream_chan, vchan.chan); +} + +static struct wbstream_dma *to_wbstream_dma(struct dma_device *device) +{ + return container_of(device, struct wbstream_dma, dma_dev); +} + +static struct wbstream_dma_desc +*to_wbstream_dma_desc(struct virt_dma_desc *vdesc) +{ + return container_of(vdesc, struct wbstream_dma_desc, vdesc); +} + +static struct dma_chan *wbstream_dma_of_xlate(struct of_phandle_args *dma_spec, + struct of_dma *ofdma) +{ + struct wbstream_dma *wdma = ofdma->of_dma_data; + struct dma_chan *chan; + struct wbstream_chan *wchan; + + chan = dma_get_any_slave_channel(&wdma->dma_dev); + + if (chan) { + wchan = to_wbstream_chan(chan); + wchan->slave_id = dma_spec->args[0]; + } + + return chan; +} + +static int wbstream_dma_alloc_chan_resources(struct dma_chan *dc) +{ + return 0; +} + +static void wbstream_dma_free_chan_resources(struct dma_chan *dc) +{ + vchan_free_chan_resources(to_virt_chan(dc)); +} + +static size_t wbstream_dma_desc_residue(struct wbstream_chan *chan, + struct wbstream_dma_desc *desc, unsigned int next_sg) +{ + struct wbstream_dma *wdma = to_wbstream_dma(chan->vchan.chan.device); + unsigned int residue; + unsigned int i; + + residue = 0; + + for (i = next_sg; i < desc->num_sgs; i++) + residue += desc->sg[i].len; + + if (next_sg != 0) { + residue += wbstream_read_reg(wdma, WBSTREAMER_BUF_SIZE) - + wbstream_read_reg(wdma, WBSTREAMER_TRANSFERRED); + } + + return residue; +} + +static enum dma_status wbstream_dma_tx_status(struct dma_chan *dc, + dma_cookie_t cookie, struct dma_tx_state *txstate) +{ + struct wbstream_chan *chan = to_wbstream_chan(dc); + struct virt_dma_desc *vdesc; + enum dma_status status; + unsigned long flags; + + status = dma_cookie_status(dc, cookie, txstate); + if (status == DMA_COMPLETE || !txstate) + return status; + + spin_lock_irqsave(&chan->vchan.lock, flags); + vdesc = vchan_find_desc(&chan->vchan, cookie); + if (cookie == chan->desc->vdesc.tx.cookie) { + txstate->residue = wbstream_dma_desc_residue(chan, chan->desc, + chan->next_sg); + } else if (vdesc) { + txstate->residue = wbstream_dma_desc_residue(chan, + to_wbstream_dma_desc(vdesc), 0); + } else { + txstate->residue = 0; + } + spin_unlock_irqrestore(&chan->vchan.lock, flags); + + return status; +} + +static struct dma_async_tx_descriptor *wbstream_dma_prep_slave_sg( + struct dma_chan *dc, struct scatterlist *sgl, unsigned int sg_len, + enum dma_transfer_direction direction, unsigned long flags, + void *context) +{ + struct wbstream_chan *chan = to_wbstream_chan(dc); + struct wbstream_dma_desc *desc; + struct scatterlist *sg; + unsigned int i; + + desc = wbstream_dma_alloc_desc(sg_len); + if (!desc) + return NULL; + + for_each_sg(sgl, sg, sg_len, i) { + desc->sg[i].addr = sg_dma_address(sg); + desc->sg[i].len = sg_dma_len(sg); + } + + desc->num_sgs = sg_len; + desc->direction = direction; + desc->cyclic = false; + + return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags); +} + +static struct dma_async_tx_descriptor *wbstream_dma_prep_dma_cyclic( + struct dma_chan *dc, dma_addr_t buf_addr, size_t buf_len, + size_t period_len, enum dma_transfer_direction direction, + unsigned long flags, void *context) +{ + struct wbstream_chan *chan = to_wbstream_chan(dc); + struct wbstream_dma_desc *desc; + unsigned int num_periods, i; + + if (buf_len % period_len) + return NULL; + + num_periods = buf_len / period_len; + + desc = wbstream_dma_alloc_desc(num_periods); + if (!desc) + return NULL; + + for (i = 0; i < num_periods; i++) { + desc->sg[i].addr = buf_addr; + desc->sg[i].len = period_len; + buf_addr += period_len; + } + + desc->num_sgs = num_periods; + desc->direction = direction; + desc->cyclic = true; + + return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags); +} + +static int wbstream_dma_terminate_all(struct dma_chan *dc) +{ + struct wbstream_chan *chan = to_wbstream_chan(dc); + unsigned long flags; + LIST_HEAD(head); + + spin_lock_irqsave(&chan->vchan.lock, flags); + chan->desc = NULL; + vchan_get_all_descriptors(&chan->vchan, &head); + spin_unlock_irqrestore(&chan->vchan.lock, flags); + + vchan_dma_desc_free_list(&chan->vchan, &head); + + return 0; +} + +static int wbstream_dma_control(struct dma_chan *dc, enum dma_ctrl_cmd cmd, + unsigned long arg) +{ + switch (cmd) { + case DMA_TERMINATE_ALL: + return wbstream_dma_terminate_all(dc); + case DMA_SLAVE_CONFIG: + /* Nothing to be done(?) */ + return 0; + default: + return -ENOSYS; + } + + return -EINVAL; +} + +static int wbstream_dma_start_transfer(struct wbstream_chan *chan) +{ + struct wbstream_dma *wdma = to_wbstream_dma(chan->vchan.chan.device); + struct virt_dma_desc *vdesc; + struct wbstream_dma_sg *sg; + + if (!chan->desc) { + vdesc = vchan_next_desc(&chan->vchan); + if (!vdesc) + return 0; + chan->desc = to_wbstream_dma_desc(vdesc); + chan->next_sg = 0; + } + + if (chan->next_sg == chan->desc->num_sgs) + chan->next_sg = 0; + + sg = &chan->desc->sg[chan->next_sg]; + + wbstream_write_reg(wdma, WBSTREAMER_START_ADDR, sg->addr); + wbstream_write_reg(wdma, WBSTREAMER_BUF_SIZE, sg->len); + wbstream_write_reg(wdma, WBSTREAMER_BURST_SIZE, 8); + + chan->next_sg++; + wbstream_write_reg(wdma, WBSTREAMER_CSR, WBSTREAMER_CSR_ENABLE); + + return 0; +} + +static irqreturn_t wbstream_irq_handler(int irq, void *dev_id) +{ + struct wbstream_dma *wdma = dev_id; + struct wbstream_chan *chan = &wdma->chan; + + wbstream_write_reg(wdma, WBSTREAMER_CSR, WBSTREAMER_CSR_IRQ); + + spin_lock(&chan->vchan.lock); + if (chan->desc) { + if (chan->desc->cyclic) { + vchan_cyclic_callback(&chan->desc->vdesc); + } else { + if (chan->next_sg == chan->desc->num_sgs) { + chan->desc = NULL; + vchan_cookie_complete(&chan->desc->vdesc); + } + } + } + wbstream_dma_start_transfer(chan); + spin_unlock(&chan->vchan.lock); + + return IRQ_HANDLED; +} + +static void wbstream_dma_issue_pending(struct dma_chan *dc) +{ + struct wbstream_chan *chan = to_wbstream_chan(dc); + unsigned long flags; + + spin_lock_irqsave(&chan->vchan.lock, flags); + if (vchan_issue_pending(&chan->vchan) && !chan->desc) + wbstream_dma_start_transfer(chan); + spin_unlock_irqrestore(&chan->vchan.lock, flags); + +} + +static void wbstream_dma_desc_free(struct virt_dma_desc *vdesc) +{ + kfree(container_of(vdesc, struct wbstream_dma_desc, vdesc)); +} + +static int wbstream_dma_probe(struct platform_device *pdev) +{ + struct resource *res; + struct wbstream_dma *wdma; + int irq; + int ret; + + wdma = devm_kzalloc(&pdev->dev, sizeof(*wdma), GFP_KERNEL); + if (!wdma) + return -EINVAL; + + platform_set_drvdata(pdev, wdma); + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + wdma->regs = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(wdma->regs)) + return PTR_ERR(wdma->regs); + + irq = platform_get_irq(pdev, 0); + ret = devm_request_irq(&pdev->dev, irq, wbstream_irq_handler, 0, + pdev->name, wdma); + if (ret) { + dev_err(&pdev->dev, "Cannot claim IRQ\n"); + return ret; + } + + dma_cap_set(DMA_SLAVE, wdma->dma_dev.cap_mask); + dma_cap_set(DMA_PRIVATE, wdma->dma_dev.cap_mask); + + wdma->dma_dev.device_alloc_chan_resources = + wbstream_dma_alloc_chan_resources; + wdma->dma_dev.device_free_chan_resources = + wbstream_dma_free_chan_resources; + wdma->dma_dev.device_prep_slave_sg = wbstream_dma_prep_slave_sg; + wdma->dma_dev.device_prep_dma_cyclic = wbstream_dma_prep_dma_cyclic; + wdma->dma_dev.device_control = wbstream_dma_control; + wdma->dma_dev.device_tx_status = wbstream_dma_tx_status; + wdma->dma_dev.device_issue_pending = wbstream_dma_issue_pending; + + wdma->dma_dev.dev = &pdev->dev; + INIT_LIST_HEAD(&wdma->dma_dev.channels); + + wdma->chan.vchan.desc_free = wbstream_dma_desc_free; + vchan_init(&wdma->chan.vchan, &wdma->dma_dev); + + ret = dma_async_device_register(&wdma->dma_dev); + if (ret < 0) { + dev_err(&pdev->dev, + "Wishbone streamer DMA driver registration failed %d\n", + ret); + return ret; + } + + ret = of_dma_controller_register(pdev->dev.of_node, + wbstream_dma_of_xlate, wdma); + if (ret < 0) { + dev_err(&pdev->dev, + "Wishbone streamer DMA OF registration failed %d\n", + ret); + return ret; + } + + return 0; +} + +static int wbstream_dma_remove(struct platform_device *pdev) +{ + return 0; +} + +static const struct of_device_id wbstream_dma_of_match[] = { + { .compatible = "wb-streamer-dma", }, +} +MODULE_DEVICE_TABLE(of, wbstream_dma_of_match); + +static struct platform_driver wbstream_dma_driver = { + .driver = { + .name = "wb-streamer-dma", + .owner = THIS_MODULE, + .of_match_table = wbstream_dma_of_match, + }, + .probe = wbstream_dma_probe, + .remove = wbstream_dma_remove, +}; +module_platform_driver(wbstream_dma_driver); + +MODULE_ALIAS("platform:wbstream-dma"); +MODULE_DESCRIPTION("Wishbone streamer DMA Controller driver"); +MODULE_AUTHOR("Stefan Kristiansson "); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 8f1fe739c985ef..282482904d32f5 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -523,6 +523,12 @@ config GPIO_XLP If unsure, say N. +config GPIO_JBTRIVIAL + bool "OpenCores JB-Trivial MM GPIO support" + depends on OPENRISC + help + Say yes here to support the JB-Trivial FPGA GPIO device + config GPIO_XTENSA bool "Xtensa GPIO32 support" depends on XTENSA diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index f82cd678ce086e..f4506c637c25da 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -116,3 +116,4 @@ obj-$(CONFIG_GPIO_XLP) += gpio-xlp.o obj-$(CONFIG_GPIO_XTENSA) += gpio-xtensa.o obj-$(CONFIG_GPIO_ZEVIO) += gpio-zevio.o obj-$(CONFIG_GPIO_ZYNQ) += gpio-zynq.o +obj-$(CONFIG_GPIO_JBTRIVIAL) += jbtrivial.o diff --git a/drivers/gpio/jbtrivial.c b/drivers/gpio/jbtrivial.c new file mode 100644 index 00000000000000..79923e8fdcacaf --- /dev/null +++ b/drivers/gpio/jbtrivial.c @@ -0,0 +1,276 @@ +/* + * JB-Trivial gpio driver + * + * Copyright 2010 Jonas Bonn + * + * Based on Xilinx GPIO driver + * Copyright 2008 Xilinx, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct jbgpio_instance { + struct of_mm_gpio_chip mmchip; + u8 gpio_state[4]; /* GPIO state shadow register */ + u8 gpio_dir[4]; /* GPIO direction shadow register */ + u32 data_offset; /* Data register offset */ + u32 tri_offset; /* I/O direction register offset */ + spinlock_t gpio_lock; /* Lock used for synchronization */ +}; + +/** + * jbgpio_get - Read the specified signal of the GPIO device. + * @gc: Pointer to gpio_chip device structure. + * @gpio: GPIO signal number. + * + * This function reads the specified signal of the GPIO device. It returns 0 if + * the signal clear, 1 if signal is set or negative value on error. + */ +static int jbgpio_get(struct gpio_chip *gc, unsigned int gpio) +{ + int bank; + int g; + + struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); + struct jbgpio_instance *chip = + container_of(mm_gc, struct jbgpio_instance, mmchip); + + bank = gpio >> 3; + g = gpio%8; + + return (ioread8(mm_gc->regs + chip->data_offset + bank) >> g) & 1; +} + +/** + * jbgpio_set - Write the specified signal of the GPIO device. + * @gc: Pointer to gpio_chip device structure. + * @gpio: GPIO signal number. + * @val: Value to be written to specified signal. + * + * This function writes the specified value in to the specified signal of the + * GPIO device. + */ +static void jbgpio_set(struct gpio_chip *gc, unsigned int gpio, int val) +{ + unsigned long flags; + struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); + struct jbgpio_instance *chip = + container_of(mm_gc, struct jbgpio_instance, mmchip); + int bank; + int g; + + bank = gpio >> 3; + g = gpio%8; + + + spin_lock_irqsave(&chip->gpio_lock, flags); + + /* Write to GPIO signal and set its direction to output */ + if (val) + chip->gpio_state[bank] |= 1 << g; + else + chip->gpio_state[bank] &= ~(1 << g); + iowrite8(chip->gpio_state[bank], mm_gc->regs + chip->data_offset + bank); + + spin_unlock_irqrestore(&chip->gpio_lock, flags); +} + +/** + * jbgpio_dir_in - Set the direction of the specified GPIO signal as input. + * @gc: Pointer to gpio_chip device structure. + * @gpio: GPIO signal number. + * + * This function sets the direction of specified GPIO signal as input. + * It returns 0 if direction of GPIO signals is set as input otherwise it + * returns negative error value. + */ +static int jbgpio_dir_in(struct gpio_chip *gc, unsigned int gpio) +{ + unsigned long flags; + struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); + struct jbgpio_instance *chip = + container_of(mm_gc, struct jbgpio_instance, mmchip); + int bank; + int g; + + bank = gpio >> 3; + g = gpio%8; + + spin_lock_irqsave(&chip->gpio_lock, flags); + + /* Clear the GPIO bit in shadow register and set direction as input */ + chip->gpio_dir[bank] &= ~(1 << g); + iowrite8(chip->gpio_dir[bank], mm_gc->regs + chip->tri_offset + bank); + + spin_unlock_irqrestore(&chip->gpio_lock, flags); + + return 0; +} + +/** + * jbgpio_dir_out - Set the direction of the specified GPIO signal as output. + * @gc: Pointer to gpio_chip device structure. + * @gpio: GPIO signal number. + * @val: Value to be written to specified signal. + * + * This function sets the direction of specified GPIO signal as output. If all + * GPIO signals of GPIO chip is configured as input then it returns + * error otherwise it returns 0. + */ +static int jbgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) +{ + unsigned long flags; + struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); + struct jbgpio_instance *chip = + container_of(mm_gc, struct jbgpio_instance, mmchip); + int bank; + int g; + + bank = gpio >> 3; + g = gpio%8; + + spin_lock_irqsave(&chip->gpio_lock, flags); + + /* Write state of GPIO signal */ + if (val) + chip->gpio_state[bank] |= 1 << g; + else + chip->gpio_state[bank] &= ~(1 << g); + iowrite8(chip->gpio_state[bank], mm_gc->regs + chip->data_offset + bank); + + /* Set the GPIO bit in shadow register and set direction as output */ + chip->gpio_dir[bank] |= (1 << g); + iowrite8(chip->gpio_dir[bank], mm_gc->regs + chip->tri_offset + bank); + + spin_unlock_irqrestore(&chip->gpio_lock, flags); + + return 0; +} + +/** + * jbgpio_save_regs - Set initial values of GPIO pins + * @mm_gc: pointer to memory mapped GPIO chip structure + */ +static void jbgpio_save_regs(struct of_mm_gpio_chip *mm_gc) +{ + struct jbgpio_instance *chip = + container_of(mm_gc, struct jbgpio_instance, mmchip); + int i; + + for (i = 0; i < 3; i++) { + iowrite8(chip->gpio_state[i], mm_gc->regs + chip->data_offset + i); + iowrite8(chip->gpio_dir[i], mm_gc->regs + chip->tri_offset + i); + } +} + +/** + * jbgpio_of_probe - Probe method for the GPIO device. + * @np: pointer to device tree node + * + * This function probes the GPIO device in the device tree. It initializes the + * driver data structure. It returns 0, if the driver is bound to the GPIO + * device, or a negative value if there is an error. + */ +static int jbgpio_of_probe(struct device_node *np) +{ + struct jbgpio_instance *chip; + int status = 0; + const u32 *tree_info; + int i; + + chip = kzalloc(sizeof(*chip), GFP_KERNEL); + if (!chip) + return -ENOMEM; + + /* Set defaults values */ + chip->data_offset = 0x0; + chip->tri_offset = 0x4; + + /* Update register offsets */ + tree_info = of_get_property(np, "xlnx,data-offset", NULL); + if (tree_info) + chip->data_offset = *tree_info; + tree_info = of_get_property(np, "xlnx,tri-offset", NULL); + if (tree_info) + chip->tri_offset = *tree_info; + + /* Update GPIO state shadow register with default value */ +/* tree_info = of_get_property(np, "xlnx,dout-default", NULL); + if (tree_info) + chip->gpio_state = *tree_info; +*/ + /* Update GPIO direction shadow register with default value */ + for (i=0; i<3; i++) + chip->gpio_dir[i] = 0x00; /* By default, all pins are inputs */ +/* tree_info = of_get_property(np, "xlnx,tri-default", NULL); + if (tree_info) + chip->gpio_dir = *tree_info; +*/ + /* Check device node and parent device node for device width */ + chip->mmchip.gc.ngpio = 32; /* By default assume full GPIO controller */ + tree_info = of_get_property(np, "xlnx,gpio-width", NULL); + if (!tree_info) + tree_info = of_get_property(np->parent, + "xlnx,gpio-width", NULL); + if (tree_info) + chip->mmchip.gc.ngpio = *tree_info; + + spin_lock_init(&chip->gpio_lock); + + chip->mmchip.gc.direction_input = jbgpio_dir_in; + chip->mmchip.gc.direction_output = jbgpio_dir_out; + chip->mmchip.gc.get = jbgpio_get; + chip->mmchip.gc.set = jbgpio_set; + + chip->mmchip.save_regs = jbgpio_save_regs; + + /* Call the OF gpio helper to setup and register the GPIO device */ + status = of_mm_gpiochip_add(np, &chip->mmchip); + if (status) { + kfree(chip); + pr_err("%s: error in probe function with status %d\n", + np->full_name, status); + return status; + } + pr_info("XGpio: %s: registered\n", np->full_name); + return 0; +} + +static struct of_device_id jbgpio_of_match[] = { + { .compatible = "opencores,jbtrivial" }, + { /* end of list */ }, +}; + +static int __init jbgpio_init(void) +{ + struct device_node *np; + + for_each_matching_node(np, jbgpio_of_match) + jbgpio_of_probe(np); + + return 0; +} + +/* Make sure we get initialized before anyone else tries to use us */ +subsys_initcall(jbgpio_init); +/* No exit call at the moment as we cannot unregister of GPIO chips */ + +MODULE_AUTHOR("Jonas Bonn"); +MODULE_DESCRIPTION("OpenCores JB-Trivial MM-GPIO driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig index 200841b77edb85..8ad08ae2247472 100644 --- a/drivers/input/serio/Kconfig +++ b/drivers/input/serio/Kconfig @@ -242,6 +242,14 @@ config SERIO_PS2MULT To compile this driver as a module, choose M here: the module will be called ps2mult. +config SERIO_OPENCORES_PS2 + tristate "OpenCores PS/2 controller" + help + Say Y here if you have OpenCores PS/2 ports. + + To compile this driver as a module, choose M here: the + module will be called opencores_ps2. + config SERIO_ARC_PS2 tristate "ARC PS/2 support" depends on HAS_IOMEM diff --git a/drivers/input/serio/Makefile b/drivers/input/serio/Makefile index c600089b7a349f..6009c4ccef4fa8 100644 --- a/drivers/input/serio/Makefile +++ b/drivers/input/serio/Makefile @@ -25,6 +25,7 @@ obj-$(CONFIG_SERIO_RAW) += serio_raw.o obj-$(CONFIG_SERIO_AMS_DELTA) += ams_delta_serio.o obj-$(CONFIG_SERIO_XILINX_XPS_PS2) += xilinx_ps2.o obj-$(CONFIG_SERIO_ALTERA_PS2) += altera_ps2.o +obj-$(CONFIG_SERIO_OPENCORES_PS2) += opencores_ps2.o obj-$(CONFIG_SERIO_ARC_PS2) += arc_ps2.o obj-$(CONFIG_SERIO_APBPS2) += apbps2.o obj-$(CONFIG_SERIO_OLPC_APSP) += olpc_apsp.o diff --git a/drivers/input/serio/opencores_ps2.c b/drivers/input/serio/opencores_ps2.c new file mode 100644 index 00000000000000..e7e24c80da297a --- /dev/null +++ b/drivers/input/serio/opencores_ps2.c @@ -0,0 +1,220 @@ +/* + * OpenCores PS/2 core driver + * http://opencores.org/project,ps2core + * + * Author: Stefan Kristiansson, stefan.kristiansson@saunalahti.fi + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Register defines */ +#define OCPS2_DATA 0x00 +#define OCPS2_CTRSTS 0x01 + +/* Control/Status bit masks */ +#define OCPS2_BUSY 0x01 /* Busy */ +#define OCPS2_IBF 0x02 /* Input Buffer Full */ +#define OCPS2_OBF 0x04 /* Output Buffer Full */ +#define OCPS2_ERR 0x08 /* Parity or Frame Error */ +#define OCPS2_RX_IRQ_EN 0x40 /* Rx interrupt enable */ +#define OCPS2_TX_IRQ_EN 0x80 /* Tx interrupt enable */ + +struct ocps2_data { + struct serio serio; + int irq; + void __iomem *base; + phys_addr_t base_phys; + int reg_size; +}; + +static inline u8 ocps2_readreg(void __iomem *base, loff_t offset) +{ + return ioread8(base + offset); +} + +static inline void ocps2_writereg(void __iomem *base, loff_t offset, u8 data) +{ + iowrite8(data, base + offset); +} + +static irqreturn_t ocps2_interrupt(int irq, void *dev_id) +{ + struct ocps2_data *drvdata = dev_id; + unsigned char data; + unsigned int io_flags = 0; + + if (ocps2_readreg(drvdata->base, OCPS2_CTRSTS) & OCPS2_ERR) + dev_warn(drvdata->serio.dev.parent, "frame/parity error\n"); + + if (ocps2_readreg(drvdata->base, OCPS2_CTRSTS) & OCPS2_IBF) { + /* Clear interrupt and error bits */ + ocps2_writereg(drvdata->base, OCPS2_CTRSTS, OCPS2_RX_IRQ_EN); + data = ocps2_readreg(drvdata->base, OCPS2_DATA); + serio_interrupt(&drvdata->serio, data, io_flags); + } + return IRQ_HANDLED; +} + +/* + * serio callbacks + */ +static int ocps2_serio_write(struct serio *io, unsigned char val) +{ + struct ocps2_data *drvdata = io->port_data; + + ocps2_writereg(drvdata->base, OCPS2_DATA, val); + return 0; +} + +static int ocps2_serio_open(struct serio *io) +{ + struct ocps2_data *drvdata = io->port_data; + + /* + * enable rx interrupt + * (this will also clear IBF and ERR) + */ + ocps2_writereg(drvdata->base, OCPS2_CTRSTS, OCPS2_RX_IRQ_EN); + return 0; +} + +static void ocps2_serio_close(struct serio *io) +{ + struct ocps2_data *drvdata = io->port_data; + + /* disable rx interrupt */ + ocps2_writereg(drvdata->base, OCPS2_CTRSTS, 0); +} + +static int ocps2_probe(struct platform_device *pdev) +{ + struct resource *res_iomem; + struct ocps2_data *drvdata; + int err; + + drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); + if (!drvdata) { + err = -ENOMEM; + goto err_free; + } + + res_iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res_iomem) { + err = -ENXIO; + goto err_free; + } + + drvdata->irq = platform_get_irq(pdev, 0); + if (drvdata->irq < 0) { + err = -ENXIO; + goto err_free; + } + + if (!request_mem_region(res_iomem->start, + resource_size(res_iomem), pdev->name)) { + err = -ENXIO; + goto err_free; + } + + drvdata->base = ioremap_nocache(res_iomem->start, + resource_size(res_iomem)); + drvdata->base_phys = res_iomem->start; + drvdata->reg_size = resource_size(res_iomem); + + if (!drvdata->base) { + err = -ENXIO; + goto err_release; + } + + err = request_irq(drvdata->irq, ocps2_interrupt, 0, + pdev->name, drvdata); + if (err) + goto err_unmap; + + dev_info(&pdev->dev, "OpenCores PS/2 at 0x%08x, irq=%d\n", + (u32)res_iomem->start, drvdata->irq); + + drvdata->serio.id.type = SERIO_8042; + drvdata->serio.write = ocps2_serio_write; + drvdata->serio.open = ocps2_serio_open; + drvdata->serio.close = ocps2_serio_close; + drvdata->serio.port_data = drvdata; + drvdata->serio.dev.parent = &pdev->dev; + strlcpy(drvdata->serio.name, dev_name(&pdev->dev), + sizeof(drvdata->serio.name)); + strlcpy(drvdata->serio.phys, dev_name(&pdev->dev), + sizeof(drvdata->serio.phys)); + + serio_register_port(&drvdata->serio); + platform_set_drvdata(pdev, drvdata); + + /* disable interrupts and clear ERR and IBF */ + ocps2_writereg(drvdata->base, OCPS2_CTRSTS, 0); + + return 0; +err_unmap: + iounmap(drvdata->base); +err_release: + release_mem_region(res_iomem->start, resource_size(res_iomem)); +err_free: + kfree(drvdata); + return err; +} + +static int ocps2_remove(struct platform_device *pdev) +{ + struct ocps2_data *drvdata = platform_get_drvdata(pdev); + + platform_set_drvdata(pdev, NULL); + serio_unregister_port(&drvdata->serio); + free_irq(drvdata->irq, drvdata); + iounmap(drvdata->base); + release_mem_region(drvdata->base_phys, drvdata->reg_size); + kfree(drvdata); + return 0; +} + +static const struct of_device_id ocps2_of_match[] = { + { .compatible = "opencores,ocps2",}, + { /* end of list*/}, +}; + +static struct platform_driver ocps2_driver = { + .probe = ocps2_probe, + .remove = ocps2_remove, + .driver = { + .name = "opencores_ps2", + .owner = THIS_MODULE, + .of_match_table = ocps2_of_match + } +}; + +static int __init ocps2_init(void) +{ + return platform_driver_register(&ocps2_driver); +} + +static void __exit ocps2_exit(void) +{ + platform_driver_unregister(&ocps2_driver); +} + +module_init(ocps2_init); +module_exit(ocps2_exit); + +MODULE_AUTHOR("(c) 2011 Stefan Kristiansson "); +MODULE_DESCRIPTION("OpenCores PS/2 driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index 120d81543e5325..f48319f404f08f 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig @@ -99,6 +99,10 @@ config CLPS711X_IRQCHIP select SPARSE_IRQ default y +config OMPIC + bool + select IRQ_DOMAIN + config OR1K_PIC bool select IRQ_DOMAIN diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index b8d4e9691890ec..df35dfdcaf57db 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_METAG) += irq-metag-ext.o obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o obj-$(CONFIG_ARCH_MOXART) += irq-moxart.o obj-$(CONFIG_CLPS711X_IRQCHIP) += irq-clps711x.o +obj-$(CONFIG_OMPIC) += irq-ompic.o obj-$(CONFIG_OR1K_PIC) += irq-or1k-pic.o obj-$(CONFIG_ORION_IRQCHIP) += irq-orion.o obj-$(CONFIG_OMAP_IRQCHIP) += irq-omap-intc.o diff --git a/drivers/irqchip/irq-ompic.c b/drivers/irqchip/irq-ompic.c new file mode 100644 index 00000000000000..37d060c02823f6 --- /dev/null +++ b/drivers/irqchip/irq-ompic.c @@ -0,0 +1,115 @@ +/* + * Open Multi-Processor Interrupt Controller driver + * + * Copyright (C) 2014 Stefan Kristiansson + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "irqchip.h" + +#define OMPIC_IPI_BASE 0x0 +#define OMPIC_IPI_CTRL(cpu) (OMPIC_IPI_BASE + 0x0 + (cpu)*8) +#define OMPIC_IPI_STAT(cpu) (OMPIC_IPI_BASE + 0x4 + (cpu)*8) + +#define OMPIC_IPI_CTRL_IRQ_ACK (1 << 31) +#define OMPIC_IPI_CTRL_IRQ_GEN (1 << 30) +#define OMPIC_IPI_CTRL_DST(cpu) (((cpu) & 0x3fff) << 16) + +#define OMPIC_IPI_STAT_IRQ_PENDING (1 << 30) + +#define OMPIC_IPI_DATA(x) ((x) & 0xffff) + +DEFINE_RAW_SPINLOCK(ompic_ipi_lock); + +static void __iomem *ompic_base; + +static inline u32 ompic_readreg(void __iomem *base, loff_t offset) +{ + return ioread32be(base + offset); +} + +static void ompic_writereg(void __iomem *base, loff_t offset, u32 data) +{ + iowrite32be(data, base + offset); +} + +#ifdef CONFIG_SMP +void ompic_raise_softirq(const struct cpumask *mask, unsigned int irq) +{ + unsigned int dst_cpu; + unsigned int src_cpu = smp_processor_id(); + int retry = 10000; + unsigned long flags; + + raw_spin_lock_irqsave(&ompic_ipi_lock, flags); + for_each_cpu(dst_cpu, mask) { + while (--retry && + ompic_readreg(ompic_base, OMPIC_IPI_STAT(dst_cpu)) & + OMPIC_IPI_STAT_IRQ_PENDING) { + udelay(1); + } + + ompic_writereg(ompic_base, OMPIC_IPI_CTRL(src_cpu), + OMPIC_IPI_CTRL_IRQ_GEN | + OMPIC_IPI_CTRL_DST(dst_cpu) | + OMPIC_IPI_DATA(irq)); + + if (!retry) + pr_crit("OMPIC softirq timed out"); + } + raw_spin_unlock_irqrestore(&ompic_ipi_lock, flags); +} +#endif + +irqreturn_t ompic_ipi_handler(int irq, void *dev_id) +{ + u32 status; + unsigned int cpu = smp_processor_id(); + + status = ompic_readreg(ompic_base, OMPIC_IPI_STAT(cpu)); + ompic_writereg(ompic_base, OMPIC_IPI_CTRL(cpu), OMPIC_IPI_CTRL_IRQ_ACK); + + handle_IPI(OMPIC_IPI_DATA(status)); + + return IRQ_HANDLED; +} + +static struct irqaction ompi_ipi_irqaction = { + .handler = ompic_ipi_handler, + .flags = IRQF_PERCPU, + .name = "ompic_ipi", +}; + +#ifdef CONFIG_OF +int __init ompic_of_init(struct device_node *node, struct device_node *parent) +{ + int irq; + + if (WARN_ON(!node)) + return -ENODEV; + + ompic_base = of_iomap(node, 0); + + irq = irq_of_parse_and_map(node, 0); + setup_irq(irq, &ompi_ipi_irqaction); + +#ifdef CONFIG_SMP + set_smp_cross_call(ompic_raise_softirq); +#endif + + return 0; +} +IRQCHIP_DECLARE(ompic, "ompic", ompic_of_init); +#endif diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c index 442410cd2ca4b1..0bfe0ca3527314 100644 --- a/drivers/net/ethernet/ethoc.c +++ b/drivers/net/ethernet/ethoc.c @@ -26,7 +26,7 @@ #include #include -static int buffer_size = 0x8000; /* 32 KBytes */ +static int buffer_size = 0x20000; /* 128 KBytes */ module_param(buffer_size, int, 0); MODULE_PARM_DESC(buffer_size, "DMA buffer allocation size"); @@ -236,12 +236,20 @@ struct ethoc_bd { static inline u32 ethoc_read(struct ethoc *dev, loff_t offset) { +#ifdef CONFIG_WISHBONE_BUS_BIG_ENDIAN + return ioread32be(dev->iobase + offset); +#else return ioread32(dev->iobase + offset); +#endif } static inline void ethoc_write(struct ethoc *dev, loff_t offset, u32 data) { +#ifdef CONFIG_WISHBONE_BUS_BIG_ENDIAN + iowrite32be(data, dev->iobase + offset); +#else iowrite32(data, dev->iobase + offset); +#endif } static inline void ethoc_read_bd(struct ethoc *dev, int index, @@ -1301,6 +1309,7 @@ static int ethoc_resume(struct platform_device *pdev) static const struct of_device_id ethoc_match[] = { { .compatible = "opencores,ethoc", }, + { .compatible = "opencores,ethmac-rtlsvn338" }, {}, }; MODULE_DEVICE_TABLE(of, ethoc_match); diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index b0f30fb6891422..b787b515bd7332 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -326,6 +326,12 @@ config SPI_MESON_SPIFC This enables master mode support for the SPIFC (SPI flash controller) available in Amlogic Meson SoCs. +config SPI_OCSIMPLE + tristate "OpenCores Simple SPI Controller" + depends on OPENRISC + help + Driver for Simple SPI core from OpenCores.org + config SPI_OC_TINY tristate "OpenCores tiny SPI" depends on GPIOLIB || COMPILE_TEST diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index 1154dbac8f2c18..87110d835096de 100644 --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_SPI_MPC52xx_PSC) += spi-mpc52xx-psc.o obj-$(CONFIG_SPI_MPC52xx) += spi-mpc52xx.o obj-$(CONFIG_SPI_MXS) += spi-mxs.o obj-$(CONFIG_SPI_NUC900) += spi-nuc900.o +obj-$(CONFIG_SPI_OCSIMPLE) += spi-oc-simple.o obj-$(CONFIG_SPI_OC_TINY) += spi-oc-tiny.o obj-$(CONFIG_SPI_OCTEON) += spi-octeon.o obj-$(CONFIG_SPI_OMAP_UWIRE) += spi-omap-uwire.o diff --git a/drivers/spi/spi-oc-simple.c b/drivers/spi/spi-oc-simple.c new file mode 100644 index 00000000000000..794bd53da1385a --- /dev/null +++ b/drivers/spi/spi-oc-simple.c @@ -0,0 +1,477 @@ +/* + * spi-oc-simple.c -- OpenCores SPI controller driver + * + * Author: Jonas Bonn + * Copyright (C) 2010 South Pole AB + * + * Derived from spi-orion.c + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DRIVER_NAME "oc_spi_simple" + +#define OCSPI_NUM_CHIPSELECTS 8 +#define OCSPI_WAIT_RDY_MAX_LOOP 2000 /* in usec */ + +#define OCSPI_REG_SPCR 0x0 +#define OCSPI_REG_SPSR 0x1 +#define OCSPI_REG_SPDR 0x2 +#define OCSPI_REG_SPER 0x3 +#define OCSPI_REG_SSR 0x4 + +#define OCSPI_SPCR_SPIE (1 << 7) +#define OCSPI_SPCR_SPE (1 << 6) +#define OCSPI_SPCR_MSTR (1 << 4) +#define OCSPI_SPCR_CPOL (1 << 3) +#define OCSPI_SPCR_CPHA (1 << 2) +#define OCSPI_SPCR_SPR 0x03 + +#define OCSPI_SPSR_SPIF (1 << 7) +#define OCSPI_SPSR_WCOL (1 << 6) +#define OCSPI_SPSR_WFFULL (1 << 3) +#define OCSPI_SPSR_WFEMPTY (1 << 2) +#define OCSPI_SPSR_RFFUL (1 << 1) +#define OCSPI_SPSR_RFEMPTY (1 << 0) + +#define OCSPI_SPER_ICNT 0xc0 +#define OCSPI_SPER_ESPR 0x03 + +struct ocspi { + struct spi_master *master; + void __iomem *base; + unsigned int max_speed; + unsigned int min_speed; +}; + +static inline u8 +ocspi_read(struct ocspi* ocspi, unsigned int reg) { + return ioread8(ocspi->base + reg); +} + +static inline void +ocspi_write(struct ocspi* ocspi, unsigned int reg, u8 value) { + iowrite8(value, ocspi->base + reg); +} + +static int +ocspi_set_transfer_size(struct ocspi *ocspi, unsigned int size) +{ + if (size != 8 && size != 16 && size != 24 && size != 32) { + printk("Bad transfer size: %d\n", size); + return -EINVAL; + } + + /* + * Nothing to do + * If we were using interrupts we would probably set the + * ICNT bits of the SPER register here... but we're not! + */ + + return 0; +} + +static inline void +ocspi_set_baudrate_bits(u8* spcr, u8* sper, unsigned int speed) +{ + int i; + + struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[smp_processor_id()]; + + for (i = 0; i <= 11; i++) { + if ((cpuinfo->clock_frequency >> (1+i)) <= speed) + break; + } + + pr_debug("Established baudrate %d, wanted %d (i=%d)", + cpuinfo->clock_frequency >> (1+i), speed, i); + + /* The register values for some cases are weird... fix here */ + switch (i) { + case 2: + i = 4; + break; + case 3: + i = 2; + break; + case 4: + i = 3; + break; + default: + break; + } + + pr_debug(" (new i=%d)\n", i); + + *spcr |= (i & OCSPI_SPCR_SPR); + *sper |= ((i >> 2) & OCSPI_SPER_ESPR); +} + +static inline void +ocspi_set_mode_bits(u8* spcr, int mode) +{ + if (mode & SPI_CPHA) { + *spcr |= OCSPI_SPCR_CPHA; + } else { + *spcr &= ~OCSPI_SPCR_CPHA; + } + + if (mode & SPI_CPOL) { + *spcr |= OCSPI_SPCR_CPOL; + } else { + *spcr &= ~OCSPI_SPCR_CPOL; + } +} + +/* + * Called only when no transfer is active on the bus... this may + * touch registers. + */ +static int +ocspi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) +{ + struct ocspi *ocspi; + unsigned int speed = spi->max_speed_hz; + unsigned int bits_per_word = spi->bits_per_word; + u8 spcr, sper; + + ocspi = spi_master_get_devdata(spi->master); + + if ((t != NULL) && t->speed_hz) + speed = t->speed_hz; + + if ((t != NULL) && t->bits_per_word) + bits_per_word = t->bits_per_word; + + spcr = ocspi_read(ocspi, OCSPI_REG_SPCR); + sper = ocspi_read(ocspi, OCSPI_REG_SPER); + + ocspi_set_baudrate_bits(&spcr, &sper, speed); + ocspi_set_mode_bits(&spcr, spi->mode); + + ocspi_write(ocspi, OCSPI_REG_SPCR, spcr); + ocspi_write(ocspi, OCSPI_REG_SPER, sper); + + return ocspi_set_transfer_size(ocspi, bits_per_word); +} + +static inline void +ocspi_set_cs(struct ocspi *ocspi, int mask) +{ + ocspi_write(ocspi, OCSPI_REG_SSR, mask); +} + +static inline int +ocspi_wait_till_ready(struct ocspi *ocspi) +{ + int i; + u8 reg; + + for (i = 0; i < OCSPI_WAIT_RDY_MAX_LOOP; i++) { + reg = ocspi_read(ocspi, OCSPI_REG_SPSR); + if (!(reg & OCSPI_SPSR_RFEMPTY)) + return 1; + else + usleep_range(1,1); + } + + return -1; +} + +static inline int +ocspi_write_read_8bit(struct spi_device *spi, + const u8 **tx_buf, u8 **rx_buf) +{ + struct ocspi *ocspi; + + ocspi = spi_master_get_devdata(spi->master); + + if (tx_buf && *tx_buf) { + ocspi_write(ocspi, OCSPI_REG_SPDR, *(*tx_buf)++); + } else { + ocspi_write(ocspi, OCSPI_REG_SPDR, 0); + } + + if (ocspi_wait_till_ready(ocspi) < 0) { + dev_err(&spi->dev, "TXS timed out\n"); + return -1; + } + + if (rx_buf && *rx_buf) { + *(*rx_buf)++ = ocspi_read(ocspi, OCSPI_REG_SPDR); + } else { + ocspi_read(ocspi, OCSPI_REG_SPDR); + } + + return 1; +} + +static unsigned int +ocspi_write_read(struct spi_device *spi, struct spi_transfer *xfer) +{ + struct ocspi *ocspi; + unsigned int count; + int word_len; + + ocspi = spi_master_get_devdata(spi->master); + word_len = spi->bits_per_word; + count = xfer->len; + + if (word_len == 8) { + const u8 *tx = xfer->tx_buf; + u8 *rx = xfer->rx_buf; + + do { + if (ocspi_write_read_8bit(spi, &tx, &rx) < 0) + goto out; + count--; + } while (count); + } + +out: + return xfer->len - count; +} + +static int ocspi_transfer_one_message(struct spi_master *master, + struct spi_message *m) +{ + struct ocspi *ocspi = spi_master_get_devdata(master); + struct spi_device *spi = m->spi; + struct spi_transfer *t = NULL; + int par_override = 0; + int status = 0; + int cs_active = 0; + + + /* Load defaults */ + status = ocspi_setup_transfer(spi, NULL); + + if (status < 0) + goto msg_done; + + list_for_each_entry(t, &m->transfers, transfer_list) { + unsigned int bits_per_word = spi->bits_per_word; + + if (t->tx_buf == NULL && t->rx_buf == NULL && t->len) { + dev_err(&spi->dev, + "message rejected : " + "invalid transfer data buffers\n"); + status = -EIO; + goto msg_done; + } + + if ((t != NULL) && t->bits_per_word) + bits_per_word = t->bits_per_word; + + if ((bits_per_word != 8)) { + dev_err(&spi->dev, + "message rejected : " + "invalid transfer bits_per_word (%d bits)\n", + bits_per_word); + status = -EIO; + goto msg_done; + } + + if (t->speed_hz && t->speed_hz < ocspi->min_speed) { + dev_err(&spi->dev, + "message rejected : " + "device min speed (%d Hz) exceeds " + "required transfer speed (%d Hz)\n", + ocspi->min_speed, t->speed_hz); + status = -EIO; + goto msg_done; + } + + if (par_override || t->speed_hz || t->bits_per_word) { + par_override = 1; + status = ocspi_setup_transfer(spi, t); + if (status < 0) + break; + if (!t->speed_hz && !t->bits_per_word) + par_override = 0; + } + + if (!cs_active) { + ocspi_set_cs(ocspi, (1 << spi->chip_select)); + cs_active = 1; + } + + if (t->len) + m->actual_length += ocspi_write_read(spi, t); + + if (t->delay_usecs) + udelay(t->delay_usecs); + + if (t->cs_change) { + ocspi_set_cs(ocspi, 0); + cs_active = 0; + } + } + +msg_done: + if (cs_active) + ocspi_set_cs(ocspi, 0); + + m->status = status; + spi_finalize_current_message(master); + + return 0; +} + +static int ocspi_reset(struct ocspi *ocspi) +{ + /* Verify that the CS is deasserted */ + ocspi_set_cs(ocspi, 0); + + /* Disable controller */ + ocspi_write(ocspi, OCSPI_REG_SPCR, OCSPI_SPCR_MSTR); + /* Enable controller */ + ocspi_write(ocspi, OCSPI_REG_SPCR, OCSPI_SPCR_SPE | OCSPI_SPCR_MSTR); + + return 0; +} + +/* + * The setup function configures the spi_device for communcation via + * this controller. This function may be called at any time and should + * not touch registers. + */ +static int ocspi_setup(struct spi_device *spi) +{ + struct ocspi *ocspi; + + ocspi = spi_master_get_devdata(spi->master); + + if ((spi->max_speed_hz == 0) + || (spi->max_speed_hz > ocspi->max_speed)) + spi->max_speed_hz = ocspi->max_speed; + + if (spi->max_speed_hz < ocspi->min_speed) { + dev_err(&spi->dev, "setup: requested speed too low %d Hz\n", + spi->max_speed_hz); + return -EINVAL; + } + + /* + * baudrate & width will be set by ocspi_setup_transfer + */ + return 0; +} + +static int ocspi_probe(struct platform_device *pdev) +{ + struct spi_master *master; + struct ocspi *spi; + struct resource *r; + int status = 0; + struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[smp_processor_id()]; + + master = spi_alloc_master(&pdev->dev, sizeof *spi); + if (master == NULL) { + dev_dbg(&pdev->dev, "master allocation failed\n"); + return -ENOMEM; + } + + if (pdev->id != -1) + master->bus_num = pdev->id; + + master->bus_num = -1; + + /* + * we support only mode 0 for now, and no options... + * but we can support CPHA setting -- to be implemented + */ + master->mode_bits = SPI_MODE_3; + + master->setup = ocspi_setup; + master->transfer_one_message = ocspi_transfer_one_message; + master->num_chipselect = OCSPI_NUM_CHIPSELECTS; +#ifdef CONFIG_OF + master->dev.of_node = pdev->dev.of_node; +#endif + + platform_set_drvdata(pdev, master); + + spi = spi_master_get_devdata(master); + spi->master = master; + + spi->max_speed = cpuinfo->clock_frequency >> 1; + spi->min_speed = cpuinfo->clock_frequency >> 12; + + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (r == NULL) { + status = -ENODEV; + goto out; + } + + if (!devm_request_mem_region(&pdev->dev, r->start, resource_size(r), + dev_name(&pdev->dev))) { + status = -EBUSY; + goto out; + } + spi->base = devm_ioremap_nocache(&pdev->dev, r->start, + resource_size(r)); + + ocspi_reset(spi); + + status = spi_register_master(master); + + printk(KERN_INFO "OpenCores Simple SPI controller (c) 2010 South Pole AB\n"); + + return status; + +out: + spi_master_put(master); + return status; +} + +static int ocspi_remove(struct platform_device *pdev) +{ + struct spi_master *master; + struct ocspi *spi; + + master = platform_get_drvdata(pdev); + spi = spi_master_get_devdata(master); + + spi_unregister_master(master); + + return 0; +} + +static struct of_device_id ocspi_match[] = { + { + .compatible = "opencores,spi-simple", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, ocspi_match); + +MODULE_ALIAS("platform:" DRIVER_NAME); + +static struct platform_driver ocspi_driver = { + .probe = ocspi_probe, + .remove = ocspi_remove, + .driver = { + .name = DRIVER_NAME, + .owner = THIS_MODULE, + .of_match_table = ocspi_match + } +}; +module_platform_driver(ocspi_driver); + +MODULE_DESCRIPTION("OpenCores Simple SPI driver"); +MODULE_AUTHOR("Jonas Bonn "); +MODULE_LICENSE("GPL"); diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile index d8926c6cd2a8ea..b54c0c9ecafb6e 100644 --- a/drivers/usb/Makefile +++ b/drivers/usb/Makefile @@ -12,7 +12,7 @@ obj-$(CONFIG_USB_DWC2) += dwc2/ obj-$(CONFIG_USB_ISP1760) += isp1760/ obj-$(CONFIG_USB_MON) += mon/ - +obj-$(CONFIG_USB_OHS900_HCD) += host/ obj-$(CONFIG_PCI) += host/ obj-$(CONFIG_USB_EHCI_HCD) += host/ obj-$(CONFIG_USB_ISP116X_HCD) += host/ diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 8afc3c1efdab10..b945f526592083 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -3,6 +3,7 @@ # comment "USB Host Controller Drivers" + config USB_C67X00_HCD tristate "Cypress C67x00 HCD support" help @@ -748,6 +749,18 @@ config USB_IMX21_HCD To compile this driver as a module, choose M here: the module will be called "imx21-hcd". +config USB_OHS900_HCD + tristate "OHS900 HCD support" + depends on USB + help + The OHS900 is a single-port USB controller that supports either + host side or peripheral side roles. Enable this option if your + board has this core, and you want to use it as a host controller. + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called ohs900-hcd. + config USB_HCD_BCMA tristate "BCMA usb host driver" depends on BCMA diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index 754efaa8ccf8fb..00e51a9a12df53 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -22,6 +22,8 @@ ifneq ($(CONFIG_USB_XHCI_RCAR), ) xhci-plat-hcd-y += xhci-rcar.o endif +obj-$(CONFIG_USB_OHS900_HCD) += ohs900-hcd.o + obj-$(CONFIG_USB_WHCI_HCD) += whci/ ifneq ($(CONFIG_USB), ) diff --git a/drivers/usb/host/ohs900-hcd.c b/drivers/usb/host/ohs900-hcd.c new file mode 100644 index 00000000000000..2ec53aa0e46cc5 --- /dev/null +++ b/drivers/usb/host/ohs900-hcd.c @@ -0,0 +1,1817 @@ +/* + * OHS900 HCD (Host Controller Driver) for USB. + * + * Based on David Brownell's SL811 HCD + * + * Copyright (C) 2005 Steve Fielding + * Copyright (C) 2004 Psion Teklogix (for NetBook PRO) + * Copyright (C) 2004-2005 David Brownell + * + * Periodic scheduling is based on Roman's OHCI code + * Copyright (C) 1999 Roman Weissgaerber + * + * The OHS900 controller handles host side USB + * as well as peripheral side USB + * This driver version doesn't implement the Gadget API + * for the peripheral role. + * + * For documentation, see the OHS900 spec. + * + * Further changes for 2.6.22.1 kernel by Mario Becroft and Bryce Smith + */ + +/* + * Status: Passed basic testing, works with usb-storage. + * + * TODO: + * + * - various issues noted in the code + * - use urb->iso_frame_desc[] with ISO transfers + +Changelog: +//2010-09-26 +//Updated to work with version 2.6.34 kernel running below 20MHz + Tested with USB-storage, USB HID and USB-Hub. + Note:Issues when low speed device is connected to a HUB with high-speed connection, seems like a hardware issue. + Fixed: direct memory accesses replaced with ioremap_nocache. + +2010-10-21 + Problem description: Unplugging the hub from the board has no effect, the de-registration seems not to work. The device is still listed in "lsusb". + Fix: The timer functions i now queued to run from the interrupt routine after an insertion/removal event occurs. Thereby the port status is updated and the kernel + detect the device as disconnected when checking port status. +*/ + +//#undef VERBOSE +//#undef PACKET_TRACE + +/*#define DEBUG*/ +#undef DEBUG + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "ohs900-hcd.h" + +MODULE_DESCRIPTION("OHS900 USB Host Controller Driver"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:ohs900-hcd"); + +#define DRIVER_VERSION "19 Sep 2007" + +#ifndef DEBUG +# define STUB_DEBUG_FILE +#endif + +/* Disable the debug file since it broken at present */ +//#define STUB_DEBUG_FILE + +/* for now, use only one transfer register bank */ +#undef USE_B + +/* this doesn't understand urb->iso_frame_desc[], but if you had a driver + * that just queued one ISO frame per URB then iso transfers "should" work + * using the normal urb status fields. + */ +#define DISABLE_ISO + +#define QUIRK2 +#define QUIRK3 + +static const char hcd_name[] = "ohs900-hcd"; + +/*-------------------------------------------------------------------------*/ + +static irqreturn_t ohs900h_irq(struct usb_hcd *hcd); + +static void port_power(struct ohs900 *s_ohs900, int is_on) +{ + struct usb_hcd *hcd = ohs900_to_hcd(s_ohs900); + u8 tmp; + + tmp = ohs900_read(s_ohs900, OHS900_HWREVREG); + + /* hub is inactive unless the port is powered */ + if (is_on) { + if (s_ohs900->port1 & (1 << USB_PORT_FEAT_POWER)) + return; + + s_ohs900->port1 = (1 << USB_PORT_FEAT_POWER); + s_ohs900->irq_enable = OHS900_INTMASK_INSRMV; + } else { + s_ohs900->port1 = 0; + s_ohs900->irq_enable = 0; + hcd->state = HC_STATE_HALT; + } + + tmp = ohs900_read(s_ohs900, OHS900_HWREVREG); + + /* hub is inactive unless the port is powered */ + if (is_on) { + if (s_ohs900->port1 & (1 << USB_PORT_FEAT_POWER)) + return; + + s_ohs900->port1 = (1 << USB_PORT_FEAT_POWER); + s_ohs900->irq_enable = OHS900_INTMASK_INSRMV; + } else { + s_ohs900->port1 = 0; + s_ohs900->irq_enable = 0; + hcd->state = HC_STATE_HALT; + } + + s_ohs900->ctrl1 = + OHS900_TXLCTL_MASK_FS_RATE & OHS900_TXLCTL_MASK_FS_POL; + + ohs900_write(s_ohs900, OHS900_IRQ_ENABLE, 0); + ohs900_write(s_ohs900, OHS900_IRQ_STATUS, ~0); + + if (s_ohs900->board && s_ohs900->board->port_power) { + /* switch VBUS, at 500mA unless hub power budget gets set */ + pr_debug("power %s\n", is_on ? "on" : "off"); + s_ohs900->board->port_power(hcd->self.controller, is_on); + } + + /* reset as thoroughly as we can */ + //if (s_ohs900->board && s_ohs900->board->reset) + // s_ohs900->board->reset(hcd->self.controller); + ohs900_write(s_ohs900, OHS900_HOSTSLAVECTLREG, + OHS900_HSCTLREG_RESET_CORE); + + ohs900_write(s_ohs900, OHS900_IRQ_ENABLE, 0); + ohs900_write(s_ohs900, OHS900_TXLINECTLREG, s_ohs900->ctrl1); + + ohs900_write(s_ohs900, OHS900_SOFENREG, 0); + ohs900_write(s_ohs900, OHS900_HOSTSLAVECTLREG, OHS900_HS_CTL_INIT); + + ohs900_write(s_ohs900, OHS900_IRQ_ENABLE, s_ohs900->irq_enable); + + // if !is_on, put into lowpower mode now +} + +/*-------------------------------------------------------------------------*/ + +/* This is a PIO-only HCD. Queueing appends URBs to the endpoint's queue, + * and may start I/O. Endpoint queues are scanned during completion irq + * handlers (one per packet: ACK, NAK, faults, etc) and urb cancelation. + * + * Using an external DMA engine to copy a packet at a time could work, + * though setup/teardown costs may be too big to make it worthwhile. + */ + +/* SETUP starts a new control request. Devices are not allowed to + * STALL or NAK these; they must cancel any pending control requests. + */ +static void setup_packet(struct ohs900 *ohs900, + struct ohs900h_ep *ep, struct urb *urb, u8 control) +{ + + u8 addr; + u8 len; + + ohs900_write(ohs900, OHS900_TXFIFOCONTROLREG, OHS900_FIFO_FORCE_EMPTY); + addr = OHS900_HOST_TXFIFO_DATA; + len = sizeof(struct usb_ctrlrequest); + ohs900->setup_len = len; + + ohs900_write_buf(ohs900, addr, urb->setup_packet, len); + ohs900_write(ohs900, OHS900_TXTRANSTYPEREG, OHS900_SETUP); + ohs900_write(ohs900, OHS900_TXENDPREG, ep->epnum); + ohs900_write(ohs900, OHS900_TXADDRREG, usb_pipedevice(urb->pipe)); + + wmb(); + + ohs900_write(ohs900, OHS900_HOST_TX_CTLREG, control); + ep->length = 0; + +} + +/* STATUS finishes control requests, often after IN or OUT data packets */ +static void status_packet(struct ohs900 *ohs900, + struct ohs900h_ep *ep, struct urb *urb, u8 control) +{ + int do_out; + do_out = urb->transfer_buffer_length && usb_pipein(urb->pipe); + + ohs900_write(ohs900, OHS900_TXTRANSTYPEREG, + (do_out ? OHS900_OUT_DATA1 : OHS900_IN)); + ohs900_write(ohs900, OHS900_TXENDPREG, ep->epnum); + ohs900_write(ohs900, OHS900_TXADDRREG, usb_pipedevice(urb->pipe)); + wmb(); + + ohs900_write(ohs900, OHS900_HOST_TX_CTLREG, control); + ep->length = 0; + +} + +/* IN packets can be used with any type of endpoint. here we just + * start the transfer, data from the peripheral may arrive later. + * urb->iso_frame_desc is currently ignored here... + */ +static void in_packet(struct ohs900 *ohs900, + struct ohs900h_ep *ep, struct urb *urb, u8 control) +{ + u8 len; + len = ep->maxpacket; + ep->length = min_t(int, len, + urb->transfer_buffer_length - urb->actual_length); + + ohs900_write(ohs900, OHS900_RXFIFOCONTROLREG, OHS900_FIFO_FORCE_EMPTY); + ohs900_write(ohs900, OHS900_TXTRANSTYPEREG, OHS900_IN); + ohs900_write(ohs900, OHS900_TXADDRREG, usb_pipedevice(urb->pipe)); + ohs900_write(ohs900, OHS900_TXENDPREG, ep->epnum); + ohs900_write(ohs900, OHS900_HOST_TX_CTLREG, control); + +} + +/* OUT packets can be used with any type of endpoint. + * urb->iso_frame_desc is currently ignored here... + */ +static void out_packet(struct ohs900 *ohs900, + struct ohs900h_ep *ep, struct urb *urb, u8 control) +{ + void *buf; + u8 len; + + buf = urb->transfer_buffer + urb->actual_length; + prefetch(buf); + + len = min_t(int, ep->maxpacket, + urb->transfer_buffer_length - urb->actual_length); + + ohs900_write(ohs900, OHS900_TXFIFOCONTROLREG, OHS900_FIFO_FORCE_EMPTY); + if (!(control & OHS900_HCTLMASK_ISO_EN) + && usb_gettoggle(urb->dev, ep->epnum, 1)) + ohs900_write(ohs900, OHS900_TXTRANSTYPEREG, OHS900_OUT_DATA1); + else + ohs900_write(ohs900, OHS900_TXTRANSTYPEREG, OHS900_OUT_DATA0); + + ohs900_write_buf(ohs900, OHS900_HOST_TXFIFO_DATA, buf, len); + + ohs900_write(ohs900, OHS900_TXADDRREG, usb_pipedevice(urb->pipe)); + ohs900_write(ohs900, OHS900_TXENDPREG, ep->epnum); + ohs900_write(ohs900, OHS900_HOST_TX_CTLREG, control); + + ep->length = len; + +} + +/*-------------------------------------------------------------------------*/ + +/* caller updates on-chip enables later */ + +static inline void sofirq_on(struct ohs900 *ohs900) +{ + if (ohs900->irq_enable & OHS900_INTMASK_SOFINTR) + return; + pr_debug("sof irq on\n"); + ohs900->irq_enable |= OHS900_INTMASK_SOFINTR; +} + +static inline void sofirq_off(struct ohs900 *ohs900) +{ + if (!(ohs900->irq_enable & OHS900_INTMASK_SOFINTR)) + return; + pr_debug("sof irq off\n"); + ohs900->irq_enable &= ~OHS900_INTMASK_SOFINTR; +} + +/*-------------------------------------------------------------------------*/ + +/* pick the next endpoint for a transaction, and issue it. + * frames start with periodic transfers (after whatever is pending + * from the previous frame), and the rest of the time is async + * transfers, scheduled round-robin. + */ +static struct ohs900h_ep *start(struct ohs900 *ohs900) +{ + struct ohs900h_ep *ep; + struct urb *urb; + int fclock; + u8 control; + + /* use endpoint at schedule head */ + if (ohs900->next_periodic) { + ep = ohs900->next_periodic; + ohs900->next_periodic = ep->next; + } else { + if (ohs900->next_async) + ep = ohs900->next_async; + else if (!list_empty(&ohs900->async)) + ep = container_of(ohs900->async.next, + struct ohs900h_ep, schedule); + else { + /* could set up the first fullspeed periodic + * transfer for the next frame ... + */ + return NULL; + } + + if (ep->schedule.next == &ohs900->async) + ohs900->next_async = NULL; + else + ohs900->next_async = container_of(ep->schedule.next, + struct ohs900h_ep, + schedule); + } + + if (unlikely(list_empty(&ep->hep->urb_list))) { + pr_debug("empty %p queue?\n", ep); + return NULL; + } + + urb = container_of(ep->hep->urb_list.next, struct urb, urb_list); + control = ep->defctrl; + + /* if this frame doesn't have enough time left to transfer this + * packet, wait till the next frame. too-simple algorithm... + */ + fclock = 12000 - (ohs900_read(ohs900, OHS900_SOFTMRREG) << 6); + fclock -= 100; /* setup takes not much time */ + fclock -= 1500; /* Margin to workaround too-long-frame bug */ + if (urb->dev->speed == USB_SPEED_LOW) { + if (control & OHS900_HCTLMASK_PREAMBLE_EN) { + /* also note erratum 1: some hubs won't work */ + fclock -= 800; + } + fclock -= ep->maxpacket << 8; + + /* erratum 2: AFTERSOF only works for fullspeed */ + if (fclock < 0) { + if (ep->period) + ohs900->stat_overrun++; + sofirq_on(ohs900); + return NULL; + } + } else { + fclock -= 12000 / 19; /* 19 64byte packets/msec */ + if (fclock < 0) { + if (ep->period) + ohs900->stat_overrun++; + control |= OHS900_HCTLMASK_SOF_SYNC; + + /* throttle bulk/control irq noise */ + } else if (ep->nak_count) + control |= OHS900_HCTLMASK_SOF_SYNC; + } + + switch (ep->nextpid) { + case USB_PID_IN: + in_packet(ohs900, ep, urb, control); + break; + case USB_PID_OUT: + out_packet(ohs900, ep, urb, control); + break; + case USB_PID_SETUP: + setup_packet(ohs900, ep, urb, control); + break; + case USB_PID_ACK: /* for control status */ + status_packet(ohs900, ep, urb, control); + break; + default: + pr_debug("bad ep%p pid %02x\n", ep, ep->nextpid); + ep = NULL; + } + return ep; +} + +#define MIN_JIFFIES ((msecs_to_jiffies(2) > 1) ? msecs_to_jiffies(2) : 2) + +static inline void start_transfer(struct ohs900 *ohs900) +{ + if (ohs900->port1 & (1 << USB_PORT_FEAT_SUSPEND)) + return; + if (ohs900->active_a == NULL) { + ohs900->active_a = start(ohs900); + if (ohs900->active_a != NULL) + ohs900->jiffies_a = jiffies + MIN_JIFFIES; + } +} + +static void finish_request(struct ohs900 *ohs900, + struct ohs900h_ep *ep, + struct urb *urb, int status) __releases(ohs900->lock) +{ + unsigned i; + + urb->hcpriv = NULL; + + if (usb_pipecontrol(urb->pipe)) + ep->nextpid = USB_PID_SETUP; + + usb_hcd_unlink_urb_from_ep(ohs900_to_hcd(ohs900), urb); + spin_lock(&ohs900->lock); + usb_hcd_giveback_urb(ohs900_to_hcd(ohs900), urb, status); + spin_unlock(&ohs900->lock); + + /* leave active endpoints in the schedule */ + if (!list_empty(&ep->hep->urb_list)) { + + return; + } + /* async deschedule? */ + if (!list_empty(&ep->schedule)) { + + list_del_init(&ep->schedule); + if (ep == ohs900->next_async) + ohs900->next_async = NULL; + + return; + } + + /* periodic deschedule */ + for (i = ep->branch; i < PERIODIC_SIZE; i += ep->period) { + struct ohs900h_ep *temp; + struct ohs900h_ep **prev = &ohs900->periodic[i]; + + while (*prev && ((temp = *prev) != ep)) + prev = &temp->next; + if (*prev) + *prev = ep->next; + ohs900->load[i] -= ep->load; + } + + ep->branch = PERIODIC_SIZE; + ohs900->periodic_count--; + ohs900_to_hcd(ohs900)->self.bandwidth_allocated + -= ep->load / ep->period; + if (ep == ohs900->next_periodic) + ohs900->next_periodic = ep->next; + + /* we might turn SOFs back on again for the async schedule */ + if (ohs900->periodic_count == 0) + sofirq_off(ohs900); + +} + +static void done(struct ohs900 *ohs900, struct ohs900h_ep *ep) +{ + u8 status; + struct urb *urb; + int urbstat = -EINPROGRESS; + + if (unlikely(!ep)) + return; + + status = ohs900_read(ohs900, OHS900_HRXSTATREG); + + ohs900_write(ohs900, OHS900_HOST_TX_CTLREG, 0); + urb = container_of(ep->hep->urb_list.next, struct urb, urb_list); + + /* we can safely ignore NAKs */ + if (status & OHS900_STATMASK_NAK_RXED) { + + if (!ep->period) + ep->nak_count++; + ep->error_count = 0; + + /* ACK, or IN with no errors, advances transfer, toggle, and maybe queue */ + } else if (status & OHS900_STATMASK_ACK_RXED + || ((status & ~OHS900_STATMASK_DATA_SEQ) == 0)) { + struct usb_device *udev = urb->dev; + int len; + unsigned char *buf; + + /* urb->iso_frame_desc is currently ignored here... */ + + ep->nak_count = ep->error_count = 0; + switch (ep->nextpid) { + case USB_PID_OUT: + + urb->actual_length += ep->length; + usb_dotoggle(udev, ep->epnum, 1); + if (urb->actual_length == urb->transfer_buffer_length) { + if (usb_pipecontrol(urb->pipe)) + ep->nextpid = USB_PID_ACK; + + /* some bulk protocols terminate OUT transfers + * by a short packet, using ZLPs not padding. + */ + else if (ep->length < ep->maxpacket + || !(urb->transfer_flags + & URB_ZERO_PACKET)) + urbstat = 0; + } + break; + case USB_PID_IN: + //pr_debug("ACK/in qh%p\n", ep); + buf = urb->transfer_buffer + urb->actual_length; + //prefetchw(buf); + len = ohs900_read(ohs900, OHS900_RXFIFOCNTLSBREG) + + (ohs900_read(ohs900, + OHS900_RXFIFOCNTMSBREG) << 8); + + if (len > ep->length) { + len = ep->length; + urbstat = -EOVERFLOW; + pr_debug("EOVERFLOW\n"); + } + urb->actual_length += len; + ohs900_read_buf(ohs900, OHS900_HOST_RXFIFO_DATA, + buf, len, urb->actual_length); + + if (urb->actual_length > urb->transfer_buffer_length) + pr_debug("Actual len %d > buff len %d, ERROR\n", + urb->actual_length, + urb->transfer_buffer_length); + usb_dotoggle(udev, ep->epnum, 0); + if (urbstat == -EINPROGRESS + && (len < ep->maxpacket + || urb->actual_length == + urb->transfer_buffer_length)) { + + if (usb_pipecontrol(urb->pipe)) + ep->nextpid = USB_PID_ACK; + else + urbstat = 0; + } + + break; + + case USB_PID_SETUP: + if (urb->transfer_buffer_length == urb->actual_length) + ep->nextpid = USB_PID_ACK; + else if (usb_pipeout(urb->pipe)) { + usb_settoggle(udev, 0, 1, 1); + ep->nextpid = USB_PID_OUT; + } else { + usb_settoggle(udev, 0, 0, 1); + ep->nextpid = USB_PID_IN; + } + break; + case USB_PID_ACK: + ohs900->setup_stage = 0; + urbstat = 0; + break; + } + + /* STALL stops all transfers */ + } else if (status & OHS900_STATMASK_STALL_RXED) { + PACKET("...STALL qh%p\n", ep); + ep->nak_count = ep->error_count = 0; + urbstat = -EPIPE; + + /* error? retry, until "3 strikes" */ + } else if (++ep->error_count >= 5) { + if (status & OHS900_STATMASK_RX_TMOUT) + urbstat = -ETIME; + else if (status & OHS900_STATMASK_RX_OVF) + urbstat = -EOVERFLOW; + else + urbstat = -EPROTO; + ep->error_count = 0; + pr_debug("...5STRIKES %02x qh%p stat %d\n", status, ep, urbstat); + } + + if (urbstat != -EINPROGRESS || urb->unlinked) { + finish_request(ohs900, ep, urb, urbstat); + } +} + +static inline u8 checkdone(struct ohs900 *ohs900) +{ + u8 ctl; + u8 irqstat = 0; + + if (ohs900->active_a && time_before_eq(ohs900->jiffies_a, jiffies)) { + ctl = ohs900_read(ohs900, OHS900_HOST_TX_CTLREG); + if (ctl & OHS900_HCTLMASK_TRANS_REQ) + ohs900_write(ohs900, OHS900_HOST_TX_CTLREG, 0); + pr_debug("%s DONE_A: ctrl %02x sts %02x\n", + (ctl & OHS900_HCTLMASK_TRANS_REQ) ? "timeout" : "lost", + ctl, ohs900_read(ohs900, OHS900_HRXSTATREG)); + irqstat |= OHS900_INTMASK_TRANS_DONE; + } + return irqstat; +} + +static irqreturn_t ohs900h_irq(struct usb_hcd *hcd) +{ + struct ohs900 *ohs900 = hcd_to_ohs900(hcd); + u8 irqstat; + irqreturn_t ret = IRQ_NONE; + unsigned retries = 5; + + spin_lock(&ohs900->lock); + +retry: + irqstat = ohs900_read(ohs900, OHS900_IRQ_STATUS); + + if (irqstat) { + ohs900_write(ohs900, OHS900_IRQ_STATUS, irqstat); + irqstat &= ohs900->irq_enable; + } +#ifdef QUIRK2 + /* this may no longer be necessary ... */ + if (irqstat == 0) { + irqstat = checkdone(ohs900); + if (irqstat) + ohs900->stat_lost++; + } +#endif + + /* USB packets, not necessarily handled in the order they're + * issued ... that's fine if they're different endpoints. + */ + if (irqstat & OHS900_INTMASK_TRANS_DONE) { + done(ohs900, ohs900->active_a); + ohs900->active_a = NULL; + ohs900->stat_a++; + } + + if (irqstat & OHS900_INTMASK_SOFINTR) { + unsigned index; + + index = ohs900->frame++ % (PERIODIC_SIZE - 1); + ohs900->stat_sof++; + + /* be graceful about almost-inevitable periodic schedule + * overruns: continue the previous frame's transfers iff + * this one has nothing scheduled. + */ + if (ohs900->next_periodic) { + // ERR("overrun to slot %d\n", index); + ohs900->stat_overrun++; + } + if (ohs900->periodic[index]) + ohs900->next_periodic = ohs900->periodic[index]; + } + + /* khubd manages debouncing and wakeup */ + if (irqstat & OHS900_INTMASK_INSRMV) { + ohs900->stat_insrmv++; + + /* most stats are reset for each VBUS session */ + ohs900->stat_wake = 0; + ohs900->stat_sof = 0; + ohs900->stat_a = 0; + ohs900->stat_b = 0; + ohs900->stat_lost = 0; + + ohs900->ctrl1 = 0; + ohs900_write(ohs900, OHS900_TXLINECTLREG, ohs900->ctrl1); + + ohs900->irq_enable = OHS900_INTMASK_INSRMV; + ohs900_write(ohs900, OHS900_IRQ_ENABLE, ohs900->irq_enable); + + /* usbcore nukes other pending transactions on disconnect */ + if (ohs900->active_a) { + ohs900_write(ohs900, OHS900_HOST_TX_CTLREG, 0); + finish_request(ohs900, ohs900->active_a, + container_of(ohs900->active_a->hep-> + urb_list.next, struct urb, + urb_list), -ESHUTDOWN); + ohs900->active_a = NULL; + } + + /* port status seems wierd until after reset, so + * force the reset and make khubd clean up later. + */ + ohs900->port1 |= (1 << USB_PORT_FEAT_C_CONNECTION) + | (1 << USB_PORT_FEAT_CONNECTION); + + mod_timer(&ohs900->timer, jiffies + msecs_to_jiffies(1800)); + + } else if (irqstat & OHS900_INTMASK_RESUME_DET) { + if (ohs900->port1 & (1 << USB_PORT_FEAT_SUSPEND)) { + pr_debug("wakeup\n"); + ohs900->port1 |= 1 << USB_PORT_FEAT_C_SUSPEND; + ohs900->stat_wake++; + } else + irqstat &= ~OHS900_INTMASK_RESUME_DET; + } + + if (irqstat) { + if (ohs900->port1 & (1 << USB_PORT_FEAT_ENABLE)) + start_transfer(ohs900); + ret = IRQ_HANDLED; + if (retries--) + goto retry; + } + + if (ohs900->periodic_count == 0 && list_empty(&ohs900->async)) + sofirq_off(ohs900); + ohs900_write(ohs900, OHS900_IRQ_ENABLE, ohs900->irq_enable); + + spin_unlock(&ohs900->lock); + + return ret; +} + +/*-------------------------------------------------------------------------*/ + +/* usb 1.1 says max 90% of a frame is available for periodic transfers. + * this driver doesn't promise that much since it's got to handle an + * IRQ per packet; irq handling latencies also use up that time. + */ +#define MAX_PERIODIC_LOAD 500 /* out of 1000 usec */ + +static int balance(struct ohs900 *ohs900, u16 period, u16 load) +{ + int i, branch = -ENOSPC; + /* search for the least loaded schedule branch of that period + * which has enough bandwidth left unreserved. + */ + for (i = 0; i < period; i++) { + if (branch < 0 || ohs900->load[branch] > ohs900->load[i]) { + int j; + + for (j = i; j < PERIODIC_SIZE; j += period) { + if ((ohs900->load[j] + load) + > MAX_PERIODIC_LOAD) + break; + } + if (j < PERIODIC_SIZE) + continue; + branch = i; + } + } + return branch; +} + +/*-------------------------------------------------------------------------*/ + +static int ohs900h_urb_enqueue(struct usb_hcd *hcd, + struct urb *urb, gfp_t mem_flags) +{ + struct ohs900 *ohs900a = hcd_to_ohs900(hcd); + struct usb_device *udev = urb->dev; + unsigned int pipe = urb->pipe; + int is_out = !usb_pipein(pipe); + int type = usb_pipetype(pipe); + int epnum = usb_pipeendpoint(pipe); + struct ohs900h_ep *ep = NULL; + unsigned long flags; + int i; + int retval; + struct usb_host_endpoint *hep = urb->ep; + +#ifdef DISABLE_ISO + if (type == PIPE_ISOCHRONOUS) + return -ENOSPC; +#endif + + /* avoid all allocations within spinlocks */ + if (!hep->hcpriv) + ep = kzalloc(sizeof *ep, mem_flags); + + spin_lock_irqsave(&ohs900a->lock, flags); + + /* don't submit to a dead or disabled port */ + if (!(ohs900a->port1 & (1 << USB_PORT_FEAT_ENABLE)) + || !HC_IS_RUNNING(hcd->state)) { + retval = -ENODEV; + kfree(ep); + goto fail_not_linked; + } + retval = usb_hcd_link_urb_to_ep(hcd, urb); + if (retval) { + kfree(ep); + goto fail_not_linked; + } + + if (hep->hcpriv) { + ep = hep->hcpriv; + } else if (!ep) { + retval = -ENOMEM; + goto fail; + + } else { + INIT_LIST_HEAD(&ep->schedule); + ep->udev = udev; + ep->epnum = epnum; + ep->maxpacket = usb_maxpacket(udev, urb->pipe, is_out); + ep->defctrl = OHS900_HCTLMASK_TRANS_REQ; + usb_settoggle(udev, epnum, is_out, 0); + + if (type == PIPE_CONTROL) + ep->nextpid = USB_PID_SETUP; + else if (is_out) + ep->nextpid = USB_PID_OUT; + else + ep->nextpid = USB_PID_IN; + + if (ep->maxpacket > H_MAXPACKET) { + /* iso packets up to 64 bytes could work... */ + pr_debug("dev %d ep%d maxpacket %d\n", + udev->devnum, epnum, ep->maxpacket); + retval = -EINVAL; + goto fail; + } + + if (udev->speed == USB_SPEED_LOW) { + /* send preamble for external hub? */ + if (ohs900a->ctrl1 & OHS900_TXLCTL_MASK_FS_RATE) + ep->defctrl |= OHS900_HCTLMASK_PREAMBLE_EN; + } + switch (type) { + case PIPE_ISOCHRONOUS: + case PIPE_INTERRUPT: + if (urb->interval > PERIODIC_SIZE) + urb->interval = PERIODIC_SIZE; + ep->period = urb->interval; + ep->branch = PERIODIC_SIZE; + if (type == PIPE_ISOCHRONOUS) + ep->defctrl |= OHS900_HCTLMASK_ISO_EN; + ep->load = usb_calc_bus_time(udev->speed, !is_out, + (type == PIPE_ISOCHRONOUS), + usb_maxpacket(udev, pipe, + is_out)) + / 1000; + break; + } + + hep->hcpriv = ep; + ep->hep = hep; + } + + /* maybe put endpoint into schedule */ + switch (type) { + case PIPE_CONTROL: + case PIPE_BULK: + if (list_empty(&ep->schedule)) + list_add_tail(&ep->schedule, &ohs900a->async); + break; + case PIPE_ISOCHRONOUS: + case PIPE_INTERRUPT: + urb->interval = ep->period; + if (ep->branch < PERIODIC_SIZE) + break; + + retval = balance(ohs900a, ep->period, ep->load); + if (retval < 0) + goto fail; + ep->branch = retval; + retval = 0; + urb->start_frame = (ohs900a->frame & (PERIODIC_SIZE - 1)) + + ep->branch; + + /* sort each schedule branch by period (slow before fast) + * to share the faster parts of the tree without needing + * dummy/placeholder nodes + */ + pr_debug("schedule qh%d/%p branch %d\n", ep->period, ep, ep->branch); + for (i = ep->branch; i < PERIODIC_SIZE; i += ep->period) { + struct ohs900h_ep **prev = &ohs900a->periodic[i]; + struct ohs900h_ep *here = *prev; + + while (here && ep != here) { + if (ep->period > here->period) + break; + prev = &here->next; + here = *prev; + } + if (ep != here) { + ep->next = here; + *prev = ep; + } + ohs900a->load[i] += ep->load; + } + ohs900a->periodic_count++; + hcd->self.bandwidth_allocated += ep->load / ep->period; + sofirq_on(ohs900a); + } + + urb->hcpriv = hep; + + start_transfer(ohs900a); + //printk("IRQ ENA:: %d\n", ohs900a->irq_enable); + ohs900_write(ohs900a, OHS900_IRQ_ENABLE, ohs900a->irq_enable); + if (retval) + usb_hcd_unlink_urb_from_ep(hcd, urb); + spin_unlock_irqrestore(&ohs900a->lock, flags); + return retval; + +fail: pr_debug("FAIL URB ENQUE"); + if (retval) + usb_hcd_unlink_urb_from_ep(hcd, urb); +fail_not_linked:pr_debug("FAIL URB ENQUE - not_linked"); + spin_unlock_irqrestore(&ohs900a->lock, flags); + return retval; +} + +static int ohs900h_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) +{ + struct ohs900 *ohs900 = hcd_to_ohs900(hcd); + struct usb_host_endpoint *hep = urb->hcpriv; + unsigned long flags; + struct ohs900h_ep *ep; + int retval; + + if (!hep) + return -EINVAL; + + spin_lock_irqsave(&ohs900->lock, flags); + retval = usb_hcd_check_unlink_urb(hcd, urb, status); + ep = hep->hcpriv; + if (retval) + goto fail; + + hep = hep->hcpriv; + if (ep) { + /* finish right away if this urb can't be active ... + * note that some drivers wrongly expect delays + */ + if (ep->hep->urb_list.next != &urb->urb_list) { + /* not front of queue? never active */ + + /* for active transfers, we expect an IRQ */ + } else if (ohs900->active_a == ep) { + if (time_before_eq(ohs900->jiffies_a, jiffies)) { + /* happens a lot with lowspeed?? */ + pr_debug("giveup on DONE_A: ctrl %02x sts %02x\n", + ohs900_read(ohs900, OHS900_HOST_TX_CTLREG), + ohs900_read(ohs900, OHS900_HRXSTATREG)); + ohs900_write(ohs900, OHS900_HOST_TX_CTLREG, 0); + ohs900->active_a = NULL; + } else + urb = NULL; + + } else { + /* front of queue for inactive endpoint */ + } + + if (urb) + finish_request(ohs900, ep, urb, 0); + else + pr_debug("dequeue, urb %p active %s; wait4irq\n", urb, + (ohs900->active_a == ep) ? "A" : "B"); + } + +fail: + spin_unlock_irqrestore(&ohs900->lock, flags); + return retval; +} + +static void +ohs900h_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep) +{ + struct ohs900h_ep *ep = hep->hcpriv; + + if (!ep) + return; + + /* assume we'd just wait for the irq */ + if (!list_empty(&hep->urb_list)) + msleep(3); + if (!list_empty(&hep->urb_list)) + WARNING("ep %p not empty?\n", ep); + + kfree(ep); + hep->hcpriv = NULL; +} + +static int ohs900h_get_frame(struct usb_hcd *hcd) +{ + struct ohs900 *ohs900 = hcd_to_ohs900(hcd); + + /* wrong except while periodic transfers are scheduled; + * never matches the on-the-wire frame; + * subject to overruns. + */ + return ohs900->frame; +} + +/*-------------------------------------------------------------------------*/ + +/* the virtual root hub timer IRQ checks for hub status */ +static int ohs900h_hub_status_data(struct usb_hcd *hcd, char *buf) +{ + struct ohs900 *ohs900 = hcd_to_ohs900(hcd); +#ifdef QUIRK3 + unsigned long flags; + //pr_debug("Enters ohs900h_hub_status_data xxx"); + /* non-SMP HACK: use root hub timer as i/o watchdog + * this seems essential when SOF IRQs aren't in use... + */ + local_irq_save(flags); + if (!timer_pending(&ohs900->timer)) { + if (ohs900h_irq( /* ~0, */ hcd) != IRQ_NONE) + ohs900->stat_lost++; + } + local_irq_restore(flags); +#endif + + if (!(ohs900->port1 & (0xffff << 16))) + return 0; + + /* tell khubd port 1 changed */ + *buf = (1 << 1); + return 1; +} + +static void +ohs900h_hub_descriptor(struct ohs900 *ohs900, struct usb_hub_descriptor *desc) +{ + u16 temp; + + desc->bDescriptorType = 0x29; + desc->bHubContrCurrent = 0; + + desc->bNbrPorts = 1; + desc->bDescLength = 7 + 2 * desc->bNbrPorts; + + temp = 1 + (desc->bNbrPorts / 8); + /* two bitmaps: ports removable, and usb 1.0 legacy PortPwrCtrlMask */ + memset(&desc->u.hs.DeviceRemovable[0], 0, temp); + memset(&desc->u.hs.DeviceRemovable[temp], 0xff, temp); + + /* per-port power switching (gang of one!), or none */ + desc->bPwrOn2PwrGood = 0; + if (ohs900->board && ohs900->board->port_power) { + desc->bPwrOn2PwrGood = ohs900->board->potpg; + if (!desc->bPwrOn2PwrGood) + desc->bPwrOn2PwrGood = 10; + temp = 0x0001; /* per-port power control */ + } else + temp = 0x0002; /* no power switching */ + + /* no overcurrent errors detection/handling */ + temp |= 0x0010; + + desc->wHubCharacteristics = cpu_to_le16(temp); +} + +static void ohs900h_timer(unsigned long _ohs900) +{ + struct ohs900 *ohs900 = (void *)_ohs900; + unsigned long flags; + u8 irqstat; + u8 signaling = ohs900->ctrl1 & OHS900_TXLCTL_MASK_LINE_CTRL_BITS; + const u32 mask = (1 << USB_PORT_FEAT_CONNECTION) + | (1 << USB_PORT_FEAT_ENABLE) + | (1 << USB_PORT_FEAT_LOWSPEED); + u8 sofEnReg = 0; + + spin_lock_irqsave(&ohs900->lock, flags); + + /* stop special signaling */ + ohs900->ctrl1 &= ~OHS900_TXLCTL_MASK_FORCE; + ohs900_write(ohs900, OHS900_TXLINECTLREG, ohs900->ctrl1); + udelay(3); + + irqstat = ohs900_read(ohs900, OHS900_IRQ_STATUS); + + switch (signaling) { + case OHS900_TXLCTL_MASK_SE0: + pr_debug("end reset\n"); + ohs900->port1 = (1 << USB_PORT_FEAT_C_RESET) + | (1 << USB_PORT_FEAT_POWER); + ohs900->ctrl1 = 0; + /* don't wrongly ack RD */ + if (irqstat & OHS900_INTMASK_INSRMV) + irqstat &= ~OHS900_INTMASK_RESUME_DET; + break; + case OHS900_TXLCTL_MASK_FS_K: + pr_debug("end resume\n"); + ohs900->port1 &= ~(1 << USB_PORT_FEAT_SUSPEND); + break; + default: + pr_debug("odd timer signaling: %02x\n", signaling); + break; + } + ohs900_write(ohs900, OHS900_IRQ_STATUS, irqstat); + + //if (irqstat & OHS900_INTMASK_RESUME_DET) {... + if (ohs900_read(ohs900, OHS900_RXCONNSTATEREG) == + OHS900_DISCONNECT_STATE) { + /* usbcore nukes all pending transactions on disconnect */ + if (ohs900->port1 & (1 << USB_PORT_FEAT_CONNECTION)) + ohs900->port1 |= (1 << USB_PORT_FEAT_C_CONNECTION) + | (1 << USB_PORT_FEAT_C_ENABLE); + ohs900->port1 &= ~mask; + ohs900->irq_enable = OHS900_INTMASK_INSRMV; + } else { + ohs900->port1 |= mask; + if (ohs900_read(ohs900, OHS900_RXCONNSTATEREG) & + OHS900_FS_CONN_STATE) + ohs900->port1 &= ~(1 << USB_PORT_FEAT_LOWSPEED); + ohs900->irq_enable = + OHS900_INTMASK_INSRMV | OHS900_INTMASK_RESUME_DET; + } + //...presumably ?...} + if (ohs900->port1 & (1 << USB_PORT_FEAT_CONNECTION)) { + + ohs900->irq_enable |= OHS900_INTMASK_TRANS_DONE; + if (ohs900->port1 & (1 << USB_PORT_FEAT_LOWSPEED)) { + ohs900->ctrl1 &= ~OHS900_TXLCTL_MASK_FS_POL; + ohs900->ctrl1 &= ~OHS900_TXLCTL_MASK_FS_RATE; + } else { + ohs900->ctrl1 |= OHS900_TXLCTL_MASK_FS_POL; + ohs900->ctrl1 |= OHS900_TXLCTL_MASK_FS_RATE; + } + + /* start SOFs flowing, kickstarting with A registers */ + sofEnReg = OHS900_MASK_SOF_ENA; + + /* Set default device address */ + ohs900_write(ohs900, OHS900_TXADDRREG, 0); + + /* khubd provides debounce delay */ + } else { + ohs900->ctrl1 = 0; + } + ohs900_write(ohs900, OHS900_TXLINECTLREG, ohs900->ctrl1); + ohs900_write(ohs900, OHS900_SOFENREG, sofEnReg); + + /* reenable irqs */ + + ohs900_write(ohs900, OHS900_IRQ_ENABLE, ohs900->irq_enable); + spin_unlock_irqrestore(&ohs900->lock, flags); +} + +static int +ohs900h_hub_control(struct usb_hcd *hcd, + u16 typeReq, u16 wValue, u16 wIndex, char *buf, u16 wLength) +{ + struct ohs900 *ohs900 = hcd_to_ohs900(hcd); + int retval = 0; + unsigned long flags; + + spin_lock_irqsave(&ohs900->lock, flags); + + switch (typeReq) { + case ClearHubFeature: + case SetHubFeature: + switch (wValue) { + case C_HUB_OVER_CURRENT: + case C_HUB_LOCAL_POWER: + break; + default: + goto error; + } + break; + case ClearPortFeature: + if (wIndex != 1 || wLength != 0) + goto error; + + switch (wValue) { + case USB_PORT_FEAT_ENABLE: + ohs900->port1 &= (1 << USB_PORT_FEAT_POWER); + ohs900->ctrl1 = 0; + ohs900_write(ohs900, OHS900_SOFENREG, 0); + ohs900_write(ohs900, OHS900_TXLINECTLREG, + ohs900->ctrl1); + ohs900->irq_enable = OHS900_INTMASK_INSRMV; + ohs900_write(ohs900, OHS900_IRQ_ENABLE, + ohs900->irq_enable); + break; + case USB_PORT_FEAT_SUSPEND: + if (!(ohs900->port1 & (1 << USB_PORT_FEAT_SUSPEND))) + break; + + /* 20 msec of resume/K signaling, other irqs blocked */ + pr_debug("start resume...\n"); + ohs900->irq_enable = 0; + ohs900_write(ohs900, OHS900_IRQ_ENABLE, + ohs900->irq_enable); + ohs900->ctrl1 |= OHS900_TXLCTL_MASK_FS_K; + ohs900_write(ohs900, OHS900_TXLINECTLREG, + ohs900->ctrl1); + + mod_timer(&ohs900->timer, jiffies + + msecs_to_jiffies(20)); + break; + case USB_PORT_FEAT_POWER: + port_power(ohs900, 0); + break; + case USB_PORT_FEAT_C_ENABLE: + case USB_PORT_FEAT_C_SUSPEND: + case USB_PORT_FEAT_C_CONNECTION: + case USB_PORT_FEAT_C_OVER_CURRENT: + case USB_PORT_FEAT_C_RESET: + break; + default: + goto error; + } + ohs900->port1 &= ~(1 << wValue); + break; + case GetHubDescriptor: + ohs900h_hub_descriptor(ohs900, + (struct usb_hub_descriptor *)buf); + break; + case GetHubStatus: + *(__le32 *) buf = cpu_to_le32(0); + break; + case GetPortStatus: + if (wIndex != 1) + goto error; + *(__le32 *) buf = cpu_to_le32(ohs900->port1); + +#ifndef VERBOSE + if (*(u16 *) (buf + 2)) /* only if wPortChange is interesting */ +#endif + +#ifdef CONFIG_USB_SUSPEND + pr_debug("\n USB_SUSPEND ENABLED!!!"); + +#endif + + pr_debug("GetPortStatus %08x\n", ohs900->port1); + break; + case SetPortFeature: + if (wIndex != 1 || wLength != 0) + goto error; + switch (wValue) { + case USB_PORT_FEAT_SUSPEND: + if (ohs900->port1 & (1 << USB_PORT_FEAT_RESET)) + goto error; + if (!(ohs900->port1 & (1 << USB_PORT_FEAT_ENABLE))) + goto error; + + pr_debug("suspend...\n"); + ohs900_write(ohs900, OHS900_SOFENREG, 0); + break; + case USB_PORT_FEAT_POWER: + port_power(ohs900, 1); + break; + case USB_PORT_FEAT_RESET: + if (ohs900->port1 & (1 << USB_PORT_FEAT_SUSPEND)) + goto error; + if (!(ohs900->port1 & (1 << USB_PORT_FEAT_POWER))) + break; + + /* 50 msec of reset/SE0 signaling, irqs blocked */ + ohs900->irq_enable = 0; + ohs900_write(ohs900, OHS900_IRQ_ENABLE, + ohs900->irq_enable); + ohs900_write(ohs900, OHS900_SOFENREG, 0); + ohs900->ctrl1 = OHS900_TXLCTL_MASK_SE0; + ohs900_write(ohs900, OHS900_TXLINECTLREG, + ohs900->ctrl1); + ohs900->port1 |= (1 << USB_PORT_FEAT_RESET); + mod_timer(&ohs900->timer, jiffies + + msecs_to_jiffies(50)); + break; + default: + goto error; + } + ohs900->port1 |= 1 << wValue; + break; + + default: +error: + + retval = -EPIPE; + } + + spin_unlock_irqrestore(&ohs900->lock, flags); + return retval; +} + +#ifdef CONFIG_PM + +static int ohs900h_bus_suspend(struct usb_hcd *hcd) +{ + // SOFs off + pr_debug("%s\n", __func__); + return 0; +} + +static int ohs900h_bus_resume(struct usb_hcd *hcd) +{ + // SOFs on + pr_debug("%s\n", __func__); + return 0; +} + +#else + +#define ohs900h_bus_suspend NULL +#define ohs900h_bus_resume NULL + +#endif + +/*-------------------------------------------------------------------------*/ + +#ifdef STUB_DEBUG_FILE + +static inline void create_debug_file(struct ohs900 *ohs900) +{ +} + +static inline void remove_debug_file(struct ohs900 *ohs900) +{ +} + +#else + +#include +#include + +static void dump_irq(struct seq_file *s, char *label, u8 mask) +{ + seq_printf(s, "%s %02x%s%s%s%s\n", label, mask, + (mask & OHS900_INTMASK_TRANS_DONE) ? " done" : "", + (mask & OHS900_INTMASK_SOFINTR) ? " sof" : "", + (mask & OHS900_INTMASK_INSRMV) ? " ins/rmv" : "", + (mask & OHS900_INTMASK_RESUME_DET) ? " rd" : ""); +} + +static int proc_ohs900h_show(struct seq_file *s, void *unused) +{ + struct ohs900 *ohs900 = s->private; + struct ohs900h_ep *ep; + unsigned i; + u8 t; + pr_debug("Enter static int proc_ohs900h_show(struct seq_file *s, void *unused)"); + seq_printf(s, "%s\n%s version %s\nportstatus[1] = %08x\n", + ohs900_to_hcd(ohs900)->product_desc, + hcd_name, DRIVER_VERSION, ohs900->port1); + + seq_printf(s, "insert/remove: %ld\n", ohs900->stat_insrmv); + seq_printf(s, "current session: done_a %ld done_b %ld " + "wake %ld sof %ld overrun %ld lost %ld\n\n", + ohs900->stat_a, ohs900->stat_b, + ohs900->stat_wake, ohs900->stat_sof, + ohs900->stat_overrun, ohs900->stat_lost); + + spin_lock_irq(&ohs900->lock); + + t = ohs900_read(ohs900, OHS900_TXLINECTLREG); + + seq_printf(s, "ctrl1 %02x%s%s%s%s\n", t, + (ohs900_read(ohs900, OHS900_SOFENREG)) ? " sofgen" : "", ( { + char + *s; + switch + (t + & + OHS900_TXLCTL_MASK_LINE_CTRL_BITS) + { +case OHS900_TXLCTL_MASK_NORMAL: +s = ""; break; case OHS900_TXLCTL_MASK_SE0: +s = " se0/reset"; break; case OHS900_TXLCTL_MASK_FS_K: +s = " FS k/resume"; break; case OHS900_TXLCTL_MASK_FS_J: +s = " FS J/resume"; break; default: + s = + " not valid ?"; + break;}; + s;} + ), + (t & OHS900_TXLCTL_MASK_FS_POL) ? " fs pol" : " ls pol ", + (t & OHS900_TXLCTL_MASK_FS_RATE) ? " fs rate" : + " ls rate ") ; + + dump_irq(s, "irq_enable", ohs900_read(ohs900, OHS900_IRQ_ENABLE)); + dump_irq(s, "irq_status", ohs900_read(ohs900, OHS900_IRQ_STATUS)); + seq_printf(s, "frame clocks remaining: %d\n", + ohs900_read(ohs900, OHS900_SOFTMRREG) << 6); + + seq_printf(s, "A: qh%p ctl %02x sts %02x\n", ohs900->active_a, + ohs900_read(ohs900, OHS900_HOST_TX_CTLREG), + ohs900_read(ohs900, OHS900_HRXSTATREG)); + seq_printf(s, "\n"); + list_for_each_entry(ep, &ohs900->async, schedule) { + struct urb *urb; + + seq_printf(s, "%s%sqh%p, ep%d%s, maxpacket %d" + " nak %d err %d\n", + (ep == ohs900->active_a) ? "(A) " : "", + (ep == ohs900->active_b) ? "(B) " : "", + ep, ep->epnum, ( { + char *s; + switch (ep->nextpid) { +case USB_PID_IN: +s = "in"; break; case USB_PID_OUT: +s = "out"; break; case USB_PID_SETUP: +s = "setup"; break; case USB_PID_ACK: +s = "status"; break; default: + s = "?"; break;}; + s;} + ), ep->maxpacket, ep->nak_count, ep->error_count) ; + list_for_each_entry(urb, &ep->hep->urb_list, urb_list) { + seq_printf(s, " urb%p, %d/%d\n", urb, + urb->actual_length, + urb->transfer_buffer_length); + } + } + if (!list_empty(&ohs900->async)) + seq_printf(s, "\n"); + + seq_printf(s, "periodic size= %d\n", PERIODIC_SIZE); + + for (i = 0; i < PERIODIC_SIZE; i++) { + ep = ohs900->periodic[i]; + if (!ep) + continue; + seq_printf(s, "%2d [%3d]:\n", i, ohs900->load[i]); + + /* DUMB: prints shared entries multiple times */ + do { + seq_printf(s, + " %s%sqh%d/%p (%sdev%d ep%d%s max %d) " + "err %d\n", + (ep == ohs900->active_a) ? "(A) " : "", + (ep == ohs900->active_b) ? "(B) " : "", + ep->period, ep, + (ep->udev->speed == USB_SPEED_FULL) + ? "" : "ls ", + ep->udev->devnum, ep->epnum, + (ep->epnum == 0) ? "" + : ((ep->nextpid == USB_PID_IN) + ? "in" + : "out"), ep->maxpacket, ep->error_count); + ep = ep->next; + } while (ep); + } + + spin_unlock_irq(&ohs900->lock); + seq_printf(s, "\n"); + + return 0; +} + +static int proc_ohs900h_open(struct inode *inode, struct file *file) +{ + return single_open(file, proc_ohs900h_show, PDE(inode)->data); +} + +static const file_operations proc_ops = { + .open = proc_ohs900h_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +/* expect just one ohs900 per system */ +static const char proc_filename[] = "driver/ohs900"; + +static void create_debug_file(struct ohs900 *ohs900) +{ + ohs900->pde = + proc_create_data(proc_filename, 0, NULL, &proc_ops, ohs900) +} + +static void remove_debug_file(struct ohs900 *ohs900) +{ + if (ohs900->pde) + remove_proc_entry(proc_filename, NULL); +} + +#endif + +/*-------------------------------------------------------------------------*/ + +static void ohs900h_stop(struct usb_hcd *hcd) +{ + struct ohs900 *ohs900 = hcd_to_ohs900(hcd); + unsigned long flags; + pr_debug("Enter ohs900h_stop(struct usb_hcd *hcd)"); + del_timer_sync(&hcd->rh_timer); + + spin_lock_irqsave(&ohs900->lock, flags); + port_power(ohs900, 0); + spin_unlock_irqrestore(&ohs900->lock, flags); +} + +static int ohs900h_start(struct usb_hcd *hcd) +{ + struct ohs900 *s_ohs900 = hcd_to_ohs900(hcd); + + /* chip has been reset, VBUS power is off */ + // pr_debug("START to urb_enqueue %p", hcd->driver->urb_enqueue); + // pr_debug("START to ohs900h_endpoint_disable %p", hcd->driver->endpoint_disable); + + hcd->state = HC_STATE_RUNNING; + + if (s_ohs900->board) { + if (!device_can_wakeup(hcd->self.controller)) + device_init_wakeup(hcd->self.controller, + s_ohs900->board->can_wakeup); + hcd->power_budget = s_ohs900->board->power * 2; + } + + /* enable power and interrupts */ + port_power(s_ohs900, 1); + + /* This is necessary to make the controller detect devices + * that are already plugged in during initialisation. It + * causes the hub driver to do a reset, which triggers + * checking for an attached device. */ + s_ohs900->port1 |= (1 << USB_PORT_FEAT_C_CONNECTION) + | (1 << USB_PORT_FEAT_CONNECTION); + + return 0; +} + +/*-------------------------------------------------------------------------*/ + +static struct hc_driver ohs900h_hc_driver = { + .description = hcd_name, + .hcd_priv_size = sizeof(struct ohs900), + + /* + * generic hardware linkage + */ + .irq = ohs900h_irq, + .flags = HCD_USB11, + + .start = ohs900h_start, + .stop = ohs900h_stop, + + /* + * managing i/o requests and associated device resources + */ + .urb_enqueue = ohs900h_urb_enqueue, + .urb_dequeue = ohs900h_urb_dequeue, + .endpoint_disable = ohs900h_endpoint_disable, + + /* + * periodic schedule support + */ + .get_frame_number = ohs900h_get_frame, + + /* + * root hub support + */ + .hub_status_data = ohs900h_hub_status_data, + .hub_control = ohs900h_hub_control, +#ifdef CONFIG_PM + .bus_suspend = ohs900h_bus_suspend, + .bus_resume = ohs900h_bus_resume, +#endif +}; + +/*-------------------------------------------------------------------------*/ + +static int ohs900h_remove(struct platform_device *dev) +{ + struct usb_hcd *hcd = platform_get_drvdata(dev); + struct ohs900 *ohs900 = hcd_to_ohs900(hcd); + struct resource *res; + pr_debug("Enter ohs900h_remove(struct platform_device *dev)"); + remove_debug_file(ohs900); + usb_remove_hcd(hcd); + + res = platform_get_resource(dev, IORESOURCE_MEM, 0); + if (res) + iounmap(ohs900->addr_reg); + + usb_put_hcd(hcd); + return 0; +} + +static int ohs900h_probe(struct platform_device *pdev) +{ + + struct usb_hcd *hcd; + struct ohs900 *s_ohs900; + struct resource *res, *ires; + struct ohs900_platform_data *pdata; + + int irq; + void __iomem *addr_reg; + int retval; + u8 tmp; + unsigned long irqflags; + + /* basic sanity checks first. board-specific init logic should + * have initialized these three resources and probably board + * specific platform_data. we don't probe for IRQs, and do only + * minimal sanity checking. + */ + + dev_dbg(&pdev->dev, "driver %s, starting ohs900h_probe\n", hcd_name); + ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + if (pdev->num_resources < 3 || !ires) + return -ENODEV; + + irq = ires->start; + irqflags = ires->flags & IRQF_TRIGGER_MASK; + + /* refuse to confuse usbcore */ + if (pdev->dev.dma_mask) { + dev_dbg(&pdev->dev, "no we won't dma\n"); + return -EINVAL; + } + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!devm_request_mem_region(&pdev->dev, res->start, + resource_size(res), + dev_name(&pdev->dev))) { + dev_err(&pdev->dev, "Resource not available\n"); + return -EBUSY; + } + + addr_reg = devm_ioremap_nocache(&pdev->dev, res->start, resource_size(res)); + if (addr_reg == NULL) { + return -ENOMEM; + } + + pdata = (struct ohs900_platform_data *)pdev->dev.platform_data; + if (!pdata) { + int* val; + + pdata = devm_kzalloc(&pdev->dev, + sizeof(struct ohs900_platform_data), + GFP_KERNEL); + if (!pdata) + return -ENOMEM; + + val = (int*)of_get_property(pdev->dev.of_node, "can_wakeup", + NULL); + if (!val) { + dev_err(&pdev->dev, + "Missing required paramter 'can_wakeup'"); + return -ENODEV; + } + pdata->can_wakeup = *val; + + val = (int*)of_get_property(pdev->dev.of_node, "potpg", NULL); + if (!val) { + dev_err(&pdev->dev, "Missing required paramter 'potpg'"); + return -ENODEV; + } + pdata->potpg = *val; + + val = (int*)of_get_property(pdev->dev.of_node, "power", NULL); + if (!val) { + dev_err(&pdev->dev, "Missing required paramter 'power'"); + return -ENODEV; + } + pdata->power = *val; + } + + /* allocate and initialize hcd */ + hcd = usb_create_hcd(&ohs900h_hc_driver, &pdev->dev, pdev->name); + + if (!hcd) { + return -ENOMEM; + } + hcd->rsrc_start = res->start; + + s_ohs900 = hcd_to_ohs900(hcd); + + pr_debug("driver %s, spin_lock_init\n", hcd_name); + spin_lock_init(&s_ohs900->lock); + INIT_LIST_HEAD(&s_ohs900->async); + + init_timer(&s_ohs900->timer); + s_ohs900->timer.function = ohs900h_timer; + s_ohs900->timer.data = (unsigned long)s_ohs900; + s_ohs900->addr_reg = addr_reg; + s_ohs900->board = pdata; + + spin_lock_irq(&s_ohs900->lock); + port_power(s_ohs900, 0); + spin_unlock_irq(&s_ohs900->lock); + + msleep(200); + + tmp = ohs900_read(s_ohs900, 0xe0); + + pr_debug("driver %s, getting hw version\n", hcd_name); + tmp = ohs900_read(s_ohs900, OHS900_HWREVREG); + + switch (tmp) { + case 0x7: + hcd->product_desc = "OHS900 v0.7"; + break; + case 0x8: + hcd->product_desc = "OHS900 v0.8"; + break; + case 0x10: + hcd->product_desc = "OHS900 v1.0"; + break; + case 0x11: + hcd->product_desc = "OHS900 v1.1"; + break; + case 0x12: + hcd->product_desc = "OHS900 v1.2"; + break; + case 0x20: + hcd->product_desc = "OHS900 v1.3"; + break; + default: + /* reject other chip revisions */ + retval = -ENODEV; + goto err_out; + } + pr_debug("driver %s, hw version = %d\n", hcd_name, tmp); + + //irqflags |= IRQF_SHARED; + retval = usb_add_hcd(hcd, irq, IRQF_DISABLED); // | irqflags); + if (retval != 0) + goto err_out; + + dev_dbg(&pdev->dev, "%s, irq %d\n", hcd->product_desc, irq); + + create_debug_file(s_ohs900); + return 0; + +err_out: + pr_debug("init error, %d\n", retval); + usb_put_hcd(hcd); + return retval; +} + +#ifdef CONFIG_PM + +/* for this device there's no useful distinction between the controller + * and its root hub, except that the root hub only gets direct PM calls + * when CONFIG_USB_SUSPEND is enabled. + */ + +static int ohs900h_suspend(struct platform_device *dev) +{ + struct ohs900 *ohs900 = dev_get_drvdata(dev); + int retval = 0; + pr_debug("Enter ohs900h_suspend(struct platform_device *dev)"); + if (phase != SUSPEND_POWER_DOWN) + return retval; + + if (state <= PM_SUSPEND_MEM) + retval = ohs900h_bus_suspend(ohs900_to_hcd(ohs900)); + else + port_power(ohs900, 0); + if (retval == 0) + dev->power.power_state = state; + return retval; +} + +static int ohs900h_resume(struct platform_device *dev) +{ + struct ohs900 *ohs900 = dev_get_drvdata(dev); + pr_debug("Enter ohs900h_resume(struct platform_device *dev)"); + if (phase != RESUME_POWER_ON) + return 0; + + /* with no "check to see if VBUS is still powered" board hook, + * let's assume it'd only be powered to enable remote wakeup. + */ + if (!ohs900->port1 || !ohs900_to_hcd(ohs900)->can_wakeup) { + ohs900->port1 = 0; + port_power(ohs900, 1); + return 0; + } + + return ohs900h_bus_resume(ohs900_to_hcd(ohs900)); +} + +#else + +#define ohs900h_suspend NULL +#define ohs900h_resume NULL + +#endif + +static struct of_device_id ocores_ohs900_match[] = { + { + .compatible = "opencores,ohs900-ocores", + }, + {}, +}; + +MODULE_DEVICE_TABLE(of, ocores_ohs900_match); + +/* work with hotplug and coldplug */ +MODULE_ALIAS("platform:ohs900"); +struct platform_driver ohs900h_driver = { + .probe = ohs900h_probe, + .remove = ohs900h_remove, + .suspend = ohs900h_suspend, + .resume = ohs900h_resume, + .driver = { + .name = hcd_name, + .owner = THIS_MODULE, + .of_match_table = ocores_ohs900_match, + }, +}; + +/*-------------------------------------------------------------------------*/ + +static int __init ohs900h_init(void) +{ + if (usb_disabled()) + return -ENODEV; + + pr_debug("driver %s, %s\n", hcd_name, DRIVER_VERSION); + return platform_driver_register(&ohs900h_driver); +} + +module_init(ohs900h_init); + +static void __exit ohs900h_cleanup(void) +{ + platform_driver_unregister(&ohs900h_driver); + +} + +module_exit(ohs900h_cleanup); diff --git a/drivers/usb/host/ohs900-hcd.h b/drivers/usb/host/ohs900-hcd.h new file mode 100644 index 00000000000000..8ec6d3f2075f81 --- /dev/null +++ b/drivers/usb/host/ohs900-hcd.h @@ -0,0 +1,275 @@ +/* + * OHS900 register declarations and HCD data structures + * + * Copyright (C) 2005 Steve Fielding + * Copyright (C) 2004 Psion Teklogix + * Copyright (C) 2004 David Brownell + */ +#include +//#include + +#define DEVELOP +#define DEBUGING +// base address of OHS900 + +#define OHS900_BASE 0x9c000000 //(DIMI_USB_HOST_PHYS) +#define OHS900_IRQ 20 //(SAM255_INTERRUPT_USB_HOST) +#define OHS900SLAVE_BASE 0x9c000000 //(DIMI_USB_HOST_PHYS) +#define OHS900SLAVE_IRQ 21 //(SAM255_INTERRUPT_USB_HOST) +#define OHS900_IO_EXTENT 0x100 +#define OHS900_SLAVE_ADDRESS 0x54 + +/* + * OHS900 has transfer registers, and control registers. In host/master + * mode one set of registers is used; in peripheral/slave mode, another. + */ + +/* TRANSFER REGISTERS + */ +#define OHS900_HOST_TX_CTLREG 0x00 +# define OHS900_HCTLMASK_TRANS_REQ 0x01 +# define OHS900_HCTLMASK_SOF_SYNC 0x02 +# define OHS900_HCTLMASK_PREAMBLE_EN 0x04 +# define OHS900_HCTLMASK_ISO_EN 0x08 + +#define OHS900_HRXSTATREG 0x0a /* read */ +# define OHS900_STATMASK_CRC_ERROR 0x01 +# define OHS900_STATMASK_BS_ERROR 0x02 +# define OHS900_STATMASK_RX_OVF 0x04 +# define OHS900_STATMASK_RX_TMOUT 0x08 +# define OHS900_STATMASK_NAK_RXED 0x10 +# define OHS900_STATMASK_STALL_RXED 0x20 +# define OHS900_STATMASK_ACK_RXED 0x40 +# define OHS900_STATMASK_DATA_SEQ 0x80 + +#define OHS900_TXTRANSTYPEREG 0x01 /* write */ +# define OHS900_SETUP 0x00 +# define OHS900_IN 0x01 +# define OHS900_OUT_DATA0 0x02 +# define OHS900_OUT_DATA1 0x03 + +#define OHS900_TXADDRREG 0x04 +#define OHS900_TXENDPREG 0x05 + +/* CONTROL REGISTERS: + */ +#define OHS900_SOFENREG 0x03 +#define OHS900_MASK_SOF_ENA 0x01 + +#define OHS900_TXLINECTLREG 0x02 +#define OHS900_TXLCTL_MASK_FORCE 0x4 +#define OHS900_TXLCTL_MASK_LINE_CTRL_BITS 0x7 +#define OHS900_TXLCTL_MASK_NORMAL 0x00 +#define OHS900_TXLCTL_MASK_SE0 0x04 +#define OHS900_TXLCTL_MASK_FS_J 0x06 +#define OHS900_TXLCTL_MASK_FS_K 0x05 +#define OHS900_TXLCTL_MASK_LSPD 0x00 +#define OHS900_TXLCTL_MASK_FSPD 0x18 +#define OHS900_TXLCTL_MASK_FS_POL 0x08 +#define OHS900_TXLCTL_MASK_FS_RATE 0x10 + +#define OHS900_IRQ_ENABLE 0x09 +#define OHS900_INTMASK_TRANS_DONE 0x01 +#define OHS900_INTMASK_SOFINTR 0x08 +#define OHS900_INTMASK_INSRMV 0x04 +#define OHS900_INTMASK_RESUME_DET 0x02 + +#define OHS900_RXCONNSTATEREG 0x0e +#define OHS900_DISCONNECT_STATE 0x00 +#define OHS900_LS_CONN_STATE 0x01 +#define OHS900_FS_CONN_STATE 0x02 + +#define OHS900_SLAVE_ADDRESS 0x54 + +#define OHS900_IRQ_STATUS 0x08 /* write to ack */ +#define OHS900_HWREVREG 0xe1 /* read */ + +#define OHS900_SOFTMRREG 0x0F + +#define OHS900_HOSTSLAVECTLREG 0xe0 +#define OHS900_HSCTLREG_HOST_EN_MASK 0x01 +#define OHS900_HSCTLREG_RESET_CORE 0x02 + +#define OHS900_HS_CTL_INIT OHS900_HSCTLREG_HOST_EN_MASK + +/* 64-byte FIFO control and status + */ +#define H_MAXPACKET 64 /* bytes in fifos */ + +#define OHS900_HOST_TXFIFO_DATA 0x30 +#define OHS900_TXFIFOCNTMSBREG 0x32 +#define OHS900_TXFIFOCNTLSBREG 0x33 +#define OHS900_TXFIFOCONTROLREG 0x34 +#define OHS900_HOST_RXFIFO_DATA 0x20 +#define OHS900_RXFIFOCNTMSBREG 0x22 +#define OHS900_RXFIFOCNTLSBREG 0x23 +#define OHS900_RXFIFOCONTROLREG 0x24 +#define OHS900_FIFO_FORCE_EMPTY 0x01 + +#define OHS900_IO_EXTENT 0x100 + +/*-------------------------------------------------------------------------*/ + +#define LOG2_PERIODIC_SIZE 5 /* arbitrary; this matches OHCI */ +#define PERIODIC_SIZE (1 << LOG2_PERIODIC_SIZE) + +struct ohs900 { + spinlock_t lock; + void __iomem *addr_reg; + + struct ohs900_platform_data *board; + struct proc_dir_entry *pde; + + unsigned long stat_insrmv; + unsigned long stat_wake; + unsigned long stat_sof; + unsigned long stat_a; + unsigned long stat_b; + unsigned long stat_lost; + unsigned long stat_overrun; + unsigned int setup_stage; + unsigned int setup_len; + /* sw model */ + struct timer_list timer; + int debug_timer; + int fifo_op; + + struct ohs900h_ep *next_periodic; + struct ohs900h_ep *next_async; + + struct ohs900h_ep *active_a; + unsigned long jiffies_a; + struct ohs900h_ep *active_b; + unsigned long jiffies_b; + unsigned int irq_stat; + u32 port1; + u8 ctrl1, ctrl2, irq_enable; + u16 frame; + + /* async schedule: control, bulk */ + struct list_head async; + + /* periodic schedule: interrupt, iso */ + u16 load[PERIODIC_SIZE]; + struct ohs900h_ep *periodic[PERIODIC_SIZE]; + unsigned periodic_count; +}; + +static inline struct ohs900 *hcd_to_ohs900(struct usb_hcd *hcd) +{ + return (struct ohs900 *)(hcd->hcd_priv); +} + +static inline struct usb_hcd *ohs900_to_hcd(struct ohs900 *s_ohs900) +{ + return container_of((void *)s_ohs900, struct usb_hcd, hcd_priv); +} + +struct ohs900h_ep { + struct usb_host_endpoint *hep; + struct usb_device *udev; + + u8 defctrl; + u8 maxpacket; + u8 epnum; + u8 nextpid; + + u16 error_count; + u16 nak_count; + u16 length; /* of current packet */ + + /* periodic schedule */ + u16 period; + u16 branch; + u16 load; + struct ohs900h_ep *next; + + /* async schedule */ + struct list_head schedule; +}; + +/*-------------------------------------------------------------------------*/ + +/* Register utilities + * NOTE: caller must hold ohs900->lock. + */ + +static inline u8 ohs900_read(struct ohs900 *s_ohs900, int reg) +{ + u8 temp; + + temp = ((volatile unsigned char *)s_ohs900->addr_reg)[reg]; + + return temp; +} + +static inline void ohs900_write(struct ohs900 *s_ohs900, int reg, u8 val) +{ + ((volatile unsigned char *)s_ohs900->addr_reg)[reg] = val; + +} + +static inline void +ohs900_write_buf(struct ohs900 *s_ohs900, int addr, const void *buf, + size_t count) +{ + void __iomem *addr_reg = s_ohs900->addr_reg; + const u8 *data; + + if (!count) + return; + + data = buf; + do { + ((volatile unsigned char *)addr_reg)[addr] = *data++; + } while (--count); + +} + +static inline void +ohs900_read_buf(struct ohs900 *s_ohs900, int addr, void *buf, size_t count, + unsigned long urb_tot) +{ + void __iomem *addr_reg = s_ohs900->addr_reg; + + u8 *data; + + if (!count) + return; + data = buf; + + do { + + *data++ = ((volatile unsigned char *)addr_reg)[addr]; + } while (--count); + +} + +/*-------------------------------------------------------------------------*/ + +#ifdef DEBUGING +#define DBG(stuff...) printk(KERN_DEBUG "ohs900: " stuff) +#else +#define DBG(stuff...) do{}while(0) +#endif + +#ifdef DEVELOP +#define INFO(stuff...) printk(KERN_INFO "ohs900: " stuff) +#else +#define INFO(stuff...) do{}while(0) +#endif + +#ifdef VERBOSE +# define VDBG DBG +#else +# define VDBG(stuff...) do{}while(0) +#endif + +#ifdef PACKET_TRACE +# define PACKET VDBG +#else +# define PACKET(stuff...) do{}while(0) +#endif + +#define ERR(stuff...) printk(KERN_ERR "ohs900: " stuff) +#define WARNING(stuff...) printk(KERN_WARNING "ohs900: " stuff) diff --git a/include/linux/ohs900.h b/include/linux/ohs900.h new file mode 100644 index 00000000000000..c4978e49f8cd95 --- /dev/null +++ b/include/linux/ohs900.h @@ -0,0 +1,14 @@ +#ifndef _LINUX_OHS900_HCD_H +#define _LINUX_OHS900_HCD_H + + +struct ohs900_platform_data { + unsigned can_wakeup:1; + u8 potpg; + u8 power; + void (*port_power)(struct device *dev, int is_on); + void (*reset) (struct device *dev); +}; + + +#endif /* _LINUX_OHS900_HCD */ diff --git a/include/linux/wishbone.h b/include/linux/wishbone.h new file mode 100644 index 00000000000000..05c5f57d799782 --- /dev/null +++ b/include/linux/wishbone.h @@ -0,0 +1,44 @@ +/* + * Copyright 2010 South Pole AB. All Rights Reserved. + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include + +#ifndef _LINUX_WISHBONE_H +#define _LINUX_WISHBONE_H + +#ifdef CONFIG_WISHBONE_BIG_ENDIAN +#define wb_ioread8(p) ioread8(p) +#define wb_ioread16(p) ioread16be(p) +#define wb_ioread32(p) ioread32be(p) + +#define wb_iowrite8(p) iowrite8(p) +#define wb_iowrite16(p) iowrite16be(p) +#define wb_iowrite32(p) iowrite32be(p) + +#else + +#define wb_ioread8(p) ioread8(p) +#define wb_ioread16(p) ioread16(p) +#define wb_ioread32(p) ioread32(p) + +#define wb_iowrite8(p) iowrite8(p) +#define wb_iowrite16(p) iowrite16(p) +#define wb_iowrite32(p) iowrite32(p) + +#endif /* CONFIG_WISHBONE_BIG_ENDIAN */ + +#endif /* _LINUX_WISHBONE_H */ diff --git a/include/uapi/linux/sem.h b/include/uapi/linux/sem.h index dd73b908b2f322..aabe50f6deab6d 100644 --- a/include/uapi/linux/sem.h +++ b/include/uapi/linux/sem.h @@ -48,7 +48,7 @@ union semun { unsigned short __user *array; /* array for GETALL & SETALL */ struct seminfo __user *__buf; /* buffer for IPC_INFO */ void __user *__pad; -}; +} __attribute__ ((transparent_union)); struct seminfo { int semmap;