C6X: New architecture
Subsystems (7)
PATCH v3 2/24 fixed generic page.h for non-zero PAGE_OFFSET
In reply to Mark Salterasm-generic/page.h had several problems when used with a non-zero PAGE_OFFSET. This patch adds a default ARCH_PFN_OFFSET and fixes the __va, __pa, and pfn_valid macros to work with non-zero PAGE_OFFSETs.
--- include/asm-generic/page.h | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
include/asm-generic/page.h +7 -3
@@ -71,10 +71,14 @@ extern unsigned long memory_end;#define PAGE_OFFSET (0)#endif +#ifndef ARCH_PFN_OFFSET +#define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) +#endif +#ifndef __ASSEMBLY__ -#define __va (x) ((void *)((unsigned long)(x) + PAGE_OFFSET)) -#define __pa (x) ((unsigned long) (x) - PAGE_OFFSET) +#define __va (x) ((void *)((unsigned long) (x))) +#define __pa (x) ((unsigned long) (x))#define virt_to_pfn (kaddr) (__pa(kaddr) >> PAGE_SHIFT)#define pfn_to_virt (pfn) __va((pfn) << PAGE_SHIFT)
@@ -86,7 +90,7 @@ extern unsigned long memory_end;#define page_to_phys (page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)#endif -#define pfn_valid (pfn) ((pfn) < max_mapnr) +#define pfn_valid (pfn) ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)#define virt_addr_valid (kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ ((void *)(kaddr) < (void *)memory_end))
Signature · 1 line
1.7.6.2
PATCH v3 4/24 add missing __iomem to generic iounmap declaration
In reply to Mark Salter--- include/asm-generic/io.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/asm-generic/io.h +1 -1
@@ -327,7 +327,7 @@ static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)#define ioremap_wc ioremap_nocache#endif -static inline void iounmap (void *addr) +static inline void iounmap (void __iomem *addr) { }#endif /* CONFIG_MMU */
Signature · 1 line
1.7.6.2
PATCH v3 5/24 C6X: build infrastructure
In reply to Mark Salter--- arch/c6x/Kconfig | 173 +++++++++++++++++++++++++++++++++++ arch/c6x/Makefile | 52 +++++++++++ arch/c6x/boot/Makefile | 22 +++++ arch/c6x/configs/dsk6455_defconfig | 43 +++++++++ arch/c6x/configs/evmc6457_defconfig | 40 ++++++++ arch/c6x/configs/evmc6472_defconfig | 41 ++++++++ arch/c6x/configs/evmc6474_defconfig | 41 ++++++++ arch/c6x/include/asm/Kbuild | 55 +++++++++++ arch/c6x/kernel/Makefile | 12 +++ arch/c6x/kernel/vmlinux.lds.S | 162 ++++++++++++++++++++++++++++++++ arch/c6x/lib/Makefile | 7 ++ arch/c6x/mm/Makefile | 5 + arch/c6x/platforms/Kconfig | 41 ++++++++ arch/c6x/platforms/Makefile | 12 +++ 14 files changed, 706 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/Kconfig create mode 100644 arch/c6x/Makefile create mode 100644 arch/c6x/boot/Makefile create mode 100644 arch/c6x/configs/dsk6455_defconfig create mode 100644 arch/c6x/configs/evmc6457_defconfig create mode 100644 arch/c6x/configs/evmc6472_defconfig create mode 100644 arch/c6x/configs/evmc6474_defconfig create mode 100644 arch/c6x/include/asm/Kbuild create mode 100644 arch/c6x/kernel/Makefile create mode 100644 arch/c6x/kernel/vmlinux.lds.S create mode 100644 arch/c6x/lib/Makefile create mode 100644 arch/c6x/mm/Makefile create mode 100644 arch/c6x/platforms/Kconfig create mode 100644 arch/c6x/platforms/Makefile
arch/c6x/Kconfig new file +173 -0
@@ -0,0 +1,173 @@ +# +# For a description of the syntax of this configuration file, +# see Documentation/kbuild/kconfig-language.txt. +# + +config TMS320C6X + def_bool y + select CLKDEV_LOOKUP + select GENERIC_IRQ_SHOW + select HAVE_DMA_API_DEBUG + select HAVE_GENERIC_HARDIRQS + select HAVE_MEMBLOCK + select HAVE_SPARSE_IRQ + select OF + select OF_EARLY_FLATTREE + +config MMU + def_bool n + +config ZONE_DMA + def_bool y + +config FPU + def_bool n + +config HIGHMEM + def_bool n + +config NUMA + def_bool n + +config RWSEM_GENERIC_SPINLOCK + def_bool y + +config RWSEM_XCHGADD_ALGORITHM + def_bool n + +config GENERIC_CALIBRATE_DELAY + def_bool y + +config GENERIC_HWEIGHT + def_bool y + +config GENERIC_CLOCKEVENTS + def_bool y + +config GENERIC_CLOCKEVENTS_BROADCAST + bool + +config GENERIC_BUG + def_bool y + +config COMMON_CLKDEV + def_bool y + +config C6X_BIG_KERNEL + bool "Build a big kernel" + help + The C6X function call instruction has a limited range of +/- 2MiB. + This is sufficient for most kernels, but some kernel configurations + with lots of compiled-in functionality may require a larger range + for function calls. Use this option to have the compiler generate + function calls with 32-bit range. This will make the kernel both + larger and slower. + + If unsure, say N. + +source "init/Kconfig" + +# Use the generic interrupt handling code in kernel/irq/ + +source "kernel/Kconfig.freezer" + +config CMDLINE_BOOL + bool "Default bootloader kernel arguments" + +config CMDLINE + string "Kernel command line" + depends on CMDLINE_BOOL + default "console=ttyS0,57600" + help + On some architectures there is currently no way for the boot loader + to pass arguments to the kernel. For these architectures, you should + supply some command-line options at build time by entering them + here. + +config CMDLINE_FORCE + bool "Force default kernel command string" + depends on CMDLINE_BOOL + default n + help + Set this to have arguments from the default kernel command string + override those passed by the boot loader. + +config CPU_BIG_ENDIAN + bool "Build big-endian kernel" + default n + help + Say Y if you plan on running a kernel in big-endian mode. + Note that your board must be properly built and your board + port must properly enable any big-endian related features + of your chipset/board/processor. + +config FORCE_MAX_ZONEORDER + int "Maximum zone order" + default "13" + help + The kernel memory allocator divides physically contiguous memory + blocks into "zones", where each zone is a power of two number of + pages. This option selects the largest power of two that the kernel + keeps in the memory allocator. If you need to allocate very large + blocks of physically contiguous memory, then you may need to + increase this value. + + This config option is actually maximum order plus one. For example, + a value of 11 means that the largest free memory block is 2^10 pages. + +menu "Processor type and features" + +source "arch/c6x/platforms/Kconfig" + +config TMS320C6X_CACHES_ON + bool "L2 cache support" + default y + +config KERNEL_RAM_BASE_ADDRESS + hex "Virtual address of memory base" + default 0xe0000000 if SOC_TMS320C6455 + default 0xe0000000 if SOC_TMS320C6457 + default 0xe0000000 if SOC_TMS320C6472 + default 0x80000000 + +source "mm/Kconfig" + +source "kernel/Kconfig.preempt" + +source "kernel/Kconfig.hz" +source "kernel/time/Kconfig" + +endmenu + +menu "Executable file formats" + +source "fs/Kconfig.binfmt" + +endmenu + +source "net/Kconfig" + +source "drivers/Kconfig" + +source "fs/Kconfig" + +source "security/Kconfig" + +source "crypto/Kconfig" + +source "lib/Kconfig" + +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config ACCESS_CHECK + bool "Check the user pointer address" + default y + help + Usually the pointer transfer from user space is checked to see if its + address is in the kernel space. + + Say N here to disable that check to improve the performance. + +endmenu
arch/c6x/Makefile new file +52 -0
52 lines not on this page · raw message
arch/c6x/boot/Makefile new file +22 -0
@@ -0,0 +1,22 @@ +# +# Makefile for bootable kernel images +# + +hostprogs-y := install-dtb + +OBJCOPYFLAGS_vmlinux.bin := -O binary +$(obj)/vmlinux.bin: vmlinux FORCE + $(call if_changed,objcopy) + +quiet_cmd_install_dtb = INSTALL_DTB $@ +cmd_install_dtb = $(obj)/install-dtb $(obj)/$*.dtb vmlinux $@ + +$(obj)/dtbImage.%: vmlinux $(obj)/install-dtb $(obj)/%.dtb + $(call cmd,install_dtb) + +clean-files := $(obj)/*.dtb + +DTC_FLAGS ?= -p 1024 + +$(obj)/%.dtb: $(src)/dts/%.dts FORCE + $(call cmd,dtc)
arch/c6x/configs/dsk6455_defconfig new file +43 -0
43 lines not on this page · raw message
arch/c6x/configs/evmc6457_defconfig new file +40 -0
@@ -0,0 +1,40 @@ +CONFIG_EXPERIMENTAL=y +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_SYSVIPC=y +CONFIG_SPARSE_IRQ=y +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_NAMESPACES=y +# CONFIG_UTS_NS is not set +# CONFIG_USER_NS is not set +# CONFIG_PID_NS is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_EXPERT=y +# CONFIG_FUTEX is not set +# CONFIG_SLUB_DEBUG is not set +CONFIG_MODULES=y +CONFIG_MODULE_FORCE_LOAD=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="" +CONFIG_BOARD_EVM6457=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=2 +CONFIG_BLK_DEV_RAM_SIZE=17000 +CONFIG_MISC_DEVICES=y +# CONFIG_INPUT is not set +# CONFIG_SERIO is not set +# CONFIG_VT is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_HWMON is not set +# CONFIG_USB_SUPPORT is not set +# CONFIG_IOMMU_SUPPORT is not set +# CONFIG_MISC_FILESYSTEMS is not set +CONFIG_CRC16=y +# CONFIG_ENABLE_MUST_CHECK is not set +# CONFIG_SCHED_DEBUG is not set +# CONFIG_DEBUG_BUGVERBOSE is not set
arch/c6x/configs/evmc6472_defconfig new file +41 -0
41 lines not on this page · raw message
arch/c6x/configs/evmc6474_defconfig new file +41 -0
41 lines not on this page · raw message
arch/c6x/include/asm/Kbuild new file +55 -0
55 lines not on this page · raw message
arch/c6x/kernel/Makefile new file +12 -0
@@ -0,0 +1,12 @@ +# +# Makefile for arch/c6x/kernel/ +# + +extra-y := head.o vmlinux.lds + +obj-y := process.o traps.o irq.o signal.o ptrace.o +obj-y += setup.o sys_c6x.o time.o devicetree.o +obj-y += switch_to.o entry.o vectors.o c6x_ksyms.o +obj-y += soc.o dma.o + +obj-$(CONFIG_MODULES) += module.o
arch/c6x/kernel/vmlinux.lds.S new file +162 -0
162 lines not on this page · raw message
arch/c6x/lib/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# Makefile for arch/c6x/lib/ +# + +lib-y := divu.o divi.o pop_rts.o push_rts.o remi.o remu.o strasgi.o llshru.o +lib-y += llshr.o llshl.o negll.o mpyll.o divremi.o divremu.o +lib-y += csum_64plus.o memcpy_64plus.o strasgi_64plus.o
arch/c6x/mm/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for the linux c6x-specific parts of the memory manager. +# + +obj-y := init.o dma-coherent.o
arch/c6x/platforms/Kconfig new file +41 -0
41 lines not on this page · raw message
arch/c6x/platforms/Makefile new file +12 -0
@@ -0,0 +1,12 @@ +# +# Makefile for arch/c6x/platforms +# +# Copyright 2010, 2011 Texas Instruments Incorporated +# + +obj-y = platform.o cache.o megamod-pic.o pll.o plldata.o timer64.o +obj-y += dscr.o + +# SoC objects +obj-$(CONFIG_SOC_TMS320C6455) += emif.o +obj-$(CONFIG_SOC_TMS320C6457) += emif.o
Signature · 1 line
1.7.6.2
PATCH v3 6/24 C6X: early boot code
In reply to Mark SalterThis patch provides the early boot code for C6X architecture. There is a 16 entry vector table which is used to direct reset and interrupt events. The vector table entries contain a small amount of code (maximum of 8 opcodes) which simply branches to the actual event handling code.
The head.S code simply clears BSS, setups up a few control registers, and calls machine_init followed by start_kernel. The machine_init code in setup.c does the early flat tree parsing (memory, commandline, etc). At setup_arch time, the code does the usual memory setup and minimally scans the devicetree for any needed information.
--- arch/c6x/kernel/head.S | 84 ++++++++ arch/c6x/kernel/setup.c | 499 +++++++++++++++++++++++++++++++++++++++++++++ arch/c6x/kernel/vectors.S | 81 ++++++++ 3 files changed, 664 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/kernel/head.S create mode 100644 arch/c6x/kernel/setup.c create mode 100644 arch/c6x/kernel/vectors.S
arch/c6x/kernel/head.S new file +84 -0
@@ -0,0 +1,84 @@ +; +; Port on Texas Instruments TMS320C6x architecture +; +; Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated +; Author: Aurelien Jacquiot ([email protected]) +; +; 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 <linux/linkage.h> +#include <linux/of_fdt.h> +#include <asm/asm-offsets.h> + + __HEAD +ENTRY(_c_int00) + ;; Save magic and pointer + MV .S1 A4,A10 + MV .S2 B4,B10 + MVKL .S2 __bss_start,B5 + MVKH .S2 __bss_start,B5 + MVKL .S2 __bss_stop,B6 + MVKH .S2 __bss_stop,B6 + SUB .L2 B6,B5,B6 ; bss size + + ;; Set the stack pointer + MVKL .S2 current_ksp,B0 + MVKH .S2 current_ksp,B0 + LDW .D2T2 *B0,B15 + + ;; clear bss + SHR .S2 B6,3,B0 ; number of dwords to clear + ZERO .L2 B13 + ZERO .L2 B12 +bss_loop: + BDEC .S2 bss_loop,B0 + NOP 3 + CMPLT .L2 B0,0,B1 + [!B1] STDW .D2T2 B13:B12,*B5++[1] + + NOP 4 + AND .D2 ~7,B15,B15 + + ;; Clear GIE and PGIE + MVC .S2 CSR,B2 + CLR .S2 B2,0,1,B2 + MVC .S2 B2,CSR + MVC .S2 TSR,B2 + CLR .S2 B2,0,1,B2 + MVC .S2 B2,TSR + MVC .S2 ITSR,B2 + CLR .S2 B2,0,1,B2 + MVC .S2 B2,ITSR + MVC .S2 NTSR,B2 + CLR .S2 B2,0,1,B2 + MVC .S2 B2,NTSR + + ;; pass DTB pointer to machine_init (or zero if none) + MVKL .S1 OF_DT_HEADER,A0 + MVKH .S1 OF_DT_HEADER,A0 + CMPEQ .L1 A10,A0,A0 + [A0] MV .S1X B10,A4 + [!A0] MVK .S1 0,A4 + +#ifdef CONFIG_C6X_BIG_KERNEL + MVKL .S1 machine_init,A0 + MVKH .S1 machine_init,A0 + B .S2X A0 + ADDKPC .S2 0f,B3,4 +0: +#else + CALLP .S2 machine_init,B3 +#endif + + ;; Jump to Linux init +#ifdef CONFIG_C6X_BIG_KERNEL + MVKL .S1 start_kernel,A0 + MVKH .S1 start_kernel,A0 + B .S2X A0 +#else + B .S2 start_kernel +#endif + NOP 5 +L1: BNOP .S2 L1,5
arch/c6x/kernel/setup.c new file +499 -0
499 lines not on this page · raw message
arch/c6x/kernel/vectors.S new file +81 -0
81 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 7/24 C6X: devicetree support
In reply to Mark SalterThis is the basic devicetree support for C6X. Currently, four boards are supported. Each one uses a different SoC part. Two of the four supported SoCs are multicore. One with 3 cores and the other with 6 cores. There is no coherency between the core-level caches, so SMP is not an option. It is possible to run separate kernel instances on the various cores. There is currently no C6X bootloader support for device trees so we build in the DTB for now.
There are some interesting twists to the hardware which are of note for device tree support. Each core has its own interrupt controller which is controlled by special purpose core registers. This core controller provides 12 general purpose prioritized interrupt sources. Each core is contained within a hardware "module" which provides L1 and L2 caches, power control, and another interrupt controller which cascades into the core interrupt controller. These core module functions are controlled by memory mapped registers. The addresses for these registers are the same for each core. That is, when coreN accesses a module-level MMIO register at a given address, it accesses the register for coreN even though other cores would use the same address to access the register in the module containing those cores. Other hardware modules (timers, enet, etc) which are memory mapped can be accessed by all cores.
The timers need some further explanation for multicore SoCs. Even though all timer control registers are visible to all cores, interrupt routing or other considerations may make a given timer more suitable for use by a core than some other timer. Because of this and the desire to have the same image run on more than one core, the timer nodes have a "ti,core-mask" property which is used by the driver to scan for a suitable timer to use.
--- Documentation/devicetree/bindings/c6x/clocks.txt | 40 +++ Documentation/devicetree/bindings/c6x/dscr.txt | 127 ++++++++ Documentation/devicetree/bindings/c6x/emifa.txt | 62 ++++ .../devicetree/bindings/c6x/interrupt.txt | 104 ++++++ Documentation/devicetree/bindings/c6x/soc.txt | 28 ++ Documentation/devicetree/bindings/c6x/timer64.txt | 26 ++ arch/c6x/boot/dts/dsk6455.dts | 62 ++++ arch/c6x/boot/dts/evmc6457.dts | 48 +++ arch/c6x/boot/dts/evmc6472.dts | 73 +++++ arch/c6x/boot/dts/evmc6474.dts | 58 ++++ arch/c6x/boot/dts/tms320c6455.dtsi | 96 ++++++ arch/c6x/boot/dts/tms320c6457.dtsi | 68 ++++ arch/c6x/boot/dts/tms320c6472.dtsi | 134 ++++++++ arch/c6x/boot/dts/tms320c6474.dtsi | 89 ++++++ arch/c6x/boot/install-dtb.c | 333 ++++++++++++++++++++ arch/c6x/kernel/devicetree.c | 53 +++ arch/c6x/platforms/platform.c | 17 + 17 files changed, 1418 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/c6x/clocks.txt create mode 100644 Documentation/devicetree/bindings/c6x/dscr.txt create mode 100644 Documentation/devicetree/bindings/c6x/emifa.txt create mode 100644 Documentation/devicetree/bindings/c6x/interrupt.txt create mode 100644 Documentation/devicetree/bindings/c6x/soc.txt create mode 100644 Documentation/devicetree/bindings/c6x/timer64.txt create mode 100644 arch/c6x/boot/dts/dsk6455.dts create mode 100644 arch/c6x/boot/dts/evmc6457.dts create mode 100644 arch/c6x/boot/dts/evmc6472.dts create mode 100644 arch/c6x/boot/dts/evmc6474.dts create mode 100644 arch/c6x/boot/dts/tms320c6455.dtsi create mode 100644 arch/c6x/boot/dts/tms320c6457.dtsi create mode 100644 arch/c6x/boot/dts/tms320c6472.dtsi create mode 100644 arch/c6x/boot/dts/tms320c6474.dtsi create mode 100644 arch/c6x/boot/install-dtb.c create mode 100644 arch/c6x/kernel/devicetree.c create mode 100644 arch/c6x/platforms/platform.c
Documentation/devicetree/bindings/c6x/clocks.txt new file +40 -0
@@ -0,0 +1,40 @@ +C6X PLL Clock Controllers +------------------------- + +This is a first-cut support for the SoC clock controllers. This is still +under development and will probably change as the common device tree +clock support is added to the kernel. + +Required properties: + +- compatible: "ti,c64x+pll" + May also have SoC-specific value to support SoC-specific initialization + in the driver. One of: + "ti,c6455-pll" + "ti,c6457-pll" + "ti,c6472-pll" + "ti,c6474-pll" + +- reg: base address and size of register area +- clock-frequency: input clock frequency in hz + + +Optional properties: + +- ti,c64x+pll-bypass-delay: CPU cycles to delay when entering bypass mode + +- ti,c64x+pll-reset-delay: CPU cycles to delay after PLL reset + +- ti,c64x+pll-lock-delay: CPU cycles to delay after PLL frequency change + +Example: + + clock-controller@29a0000 { + compatible = "ti,c6472-pll", "ti,c64x+pll"; + reg = <0x029a0000 0x200>; + clock-frequency = <25000000>; + + ti,c64x+pll-bypass-delay = <200>; + ti,c64x+pll-reset-delay = <12000>; + ti,c64x+pll-lock-delay = <80000>; + };
Documentation/devicetree/bindings/c6x/dscr.txt new file +127 -0
127 lines not on this page · raw message
Documentation/devicetree/bindings/c6x/emifa.txt new file +62 -0
62 lines not on this page · raw message
Documentation/devicetree/bindings/c6x/interrupt.txt new file +104 -0
104 lines not on this page · raw message
Documentation/devicetree/bindings/c6x/soc.txt new file +28 -0
@@ -0,0 +1,28 @@ +C6X System-on-Chip +------------------ + +Required properties: + +- compatible: "simple-bus" +- #address-cells: must be 1 +- #size-cells: must be 1 +- ranges + +Optional properties: + +- model: specific SoC model + +- nodes for IP blocks within SoC + + +Example: + + soc { + compatible = "simple-bus"; + model = "tms320c6455"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ... + };
Documentation/devicetree/bindings/c6x/timer64.txt new file +26 -0
@@ -0,0 +1,26 @@ +Timer64 +------- + +The timer64 node describes C6X event timers. + +Required properties: + +- compatible: must be "ti,c64x+timer64" +- reg: base address and size of register region +- interrupt-parent: interrupt controller +- interrupts: interrupt id + +Optional properties: + +- ti,dscr-dev-enable: Device ID used to enable timer IP through DSCR interface. + +- ti,core-mask: on multi-core SoCs, bitmask of cores allowed to use this timer. + +Example: + timer0: timer@25e0000 { + compatible = "ti,c64x+timer64"; + ti,core-mask = < 0x01 >; + reg = <0x25e0000 0x40>; + interrupt-parent = <&megamod_pic>; + interrupts = < 16 >; + };
arch/c6x/boot/dts/dsk6455.dts new file +62 -0
62 lines not on this page · raw message
arch/c6x/boot/dts/evmc6457.dts new file +48 -0
48 lines not on this page · raw message
arch/c6x/boot/dts/evmc6472.dts new file +73 -0
73 lines not on this page · raw message
arch/c6x/boot/dts/evmc6474.dts new file +58 -0
58 lines not on this page · raw message
arch/c6x/boot/dts/tms320c6455.dtsi new file +96 -0
96 lines not on this page · raw message
arch/c6x/boot/dts/tms320c6457.dtsi new file +68 -0
68 lines not on this page · raw message
arch/c6x/boot/dts/tms320c6472.dtsi new file +134 -0
134 lines not on this page · raw message
arch/c6x/boot/dts/tms320c6474.dtsi new file +89 -0
89 lines not on this page · raw message
arch/c6x/boot/install-dtb.c new file +333 -0
333 lines not on this page · raw message
arch/c6x/kernel/devicetree.c new file +53 -0
53 lines not on this page · raw message
arch/c6x/platforms/platform.c new file +17 -0
@@ -0,0 +1,17 @@ +/* +* Copyright 2011 Texas Instruments Incorporated +* +* 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 <linux/init.h> +#include <linux/of_platform.h> + +static int __init c6x_device_probe (void ) +{ +of_platform_bus_probe (NULL , of_default_bus_match_table,NULL ); +return 0 ; +} +device_initcall (c6x_device_probe);
Signature · 1 line
1.7.6.2
PATCH v3 8/24 C6X: memory management and DMA support
In reply to Mark SalterThe C6X architecture currently lacks an MMU so memory management is relatively simple. There is no bus snooping between L2 and main memory but coherent DMA memory is supported by making regions of main memory uncached. If such a region is desired, it can be specified on the commandline with a "memdma=" argument.
--- arch/c6x/include/asm/dma-mapping.h | 91 +++++++++++++++++++ arch/c6x/kernel/dma.c | 168 ++++++++++++++++++++++++++++++++++++ arch/c6x/mm/dma-coherent.c | 142 ++++++++++++++++++++++++++++++ arch/c6x/mm/init.c | 112 ++++++++++++++++++++++++ 4 files changed, 513 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/dma-mapping.h create mode 100644 arch/c6x/kernel/dma.c create mode 100644 arch/c6x/mm/dma-coherent.c create mode 100644 arch/c6x/mm/init.c
arch/c6x/include/asm/dma-mapping.h new file +91 -0
@@ -0,0 +1,91 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated +* Author: Aurelien Jacquiot <[email protected]> +* +* 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. +* +*/ +#ifndef _ASM_C6X_DMA_MAPPING_H +#define _ASM_C6X_DMA_MAPPING_H + +#include <linux/dma-debug.h> +#include <asm-generic/dma-coherent.h> + +#define dma_supported (d, m) 1 + +static inline int dma_set_mask (struct device *dev,u64 dma_mask) +{ +if (!dev->dma_mask || !dma_supported (dev, dma_mask)) +return -EIO ; + + *dev->dma_mask = dma_mask; + +return 0 ; +} + +/* +* DMA errors are defined by all-bits-set in the DMA address. +*/ +static inline int dma_mapping_error (struct device *dev,dma_addr_t dma_addr) +{ +return dma_addr == ~0 ; +} + +extern dma_addr_t dma_map_single (struct device *dev,void *cpu_addr, +size_t size,enum dma_data_direction dir); + +extern void dma_unmap_single (struct device *dev,dma_addr_t handle, +size_t size,enum dma_data_direction dir); + +extern int dma_map_sg (struct device *dev,struct scatterlist *sglist, +int nents,enum dma_data_direction direction); + +extern void dma_unmap_sg (struct device *dev,struct scatterlist *sglist, +int nents,enum dma_data_direction direction); + +static inline dma_addr_t dma_map_page (struct device *dev,struct page *page, +unsigned long offset,size_t size, +enum dma_data_direction dir) +{ +dma_addr_t handle; + + handle =dma_map_single (dev,page_address (page) + offset, size, dir); + +debug_dma_map_page (dev, page, offset, size, dir, handle, false); + +return handle; +} + +static inline void dma_unmap_page (struct device *dev,dma_addr_t handle, +size_t size,enum dma_data_direction dir) +{ +dma_unmap_single (dev, handle, size, dir); + +debug_dma_unmap_page (dev, handle, size, dir, false); +} + +extern void dma_sync_single_for_cpu (struct device *dev,dma_addr_t handle, +size_t size,enum dma_data_direction dir); + +extern void dma_sync_single_for_device (struct device *dev,dma_addr_t handle, +size_t size, +enum dma_data_direction dir); + +extern void dma_sync_sg_for_cpu (struct device *dev,struct scatterlist *sg, +int nents,enum dma_data_direction dir); + +extern void dma_sync_sg_for_device (struct device *dev,struct scatterlist *sg, +int nents,enum dma_data_direction dir); + +extern void coherent_mem_init (u32 start,u32 size); +extern void *dma_alloc_coherent (struct device *,size_t ,dma_addr_t *,gfp_t ); +extern void dma_free_coherent (struct device *,size_t ,void *,dma_addr_t ); + +#define dma_alloc_noncoherent (d, s, h, f) dma_alloc_coherent((d), (s), (h), (f)) +#define dma_free_noncoherent (d, s, v, h) dma_free_coherent((d), (s), (v), (h)) + +#endif /* _ASM_C6X_DMA_MAPPING_H */
arch/c6x/kernel/dma.c new file +168 -0
168 lines not on this page · raw message
arch/c6x/mm/dma-coherent.c new file +142 -0
142 lines not on this page · raw message
arch/c6x/mm/init.c new file +112 -0
112 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 9/24 C6X: process management
In reply to Mark Salter--- arch/c6x/include/asm/processor.h | 132 ++++++++++++++++++ arch/c6x/include/asm/thread_info.h | 121 +++++++++++++++++ arch/c6x/kernel/process.c | 263 ++++++++++++++++++++++++++++++++++++ arch/c6x/kernel/switch_to.S | 74 ++++++++++ 4 files changed, 590 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/processor.h create mode 100644 arch/c6x/include/asm/thread_info.h create mode 100644 arch/c6x/kernel/process.c create mode 100644 arch/c6x/kernel/switch_to.S
arch/c6x/include/asm/processor.h new file +132 -0
@@ -0,0 +1,132 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated +* Author: Aurelien Jacquiot ([email protected]) +* +* Updated for 2.6.34: Mark Salter <[email protected]> +* +* 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. +*/ +#ifndef _ASM_C6X_PROCESSOR_H +#define _ASM_C6X_PROCESSOR_H + +#include <asm/ptrace.h> +#include <asm/page.h> +#include <asm/current.h> + +/* +* Default implementation of macro that returns current +* instruction pointer ("program counter"). +*/ +#define current_text_addr () \ +({ \ + void *__pc; \ + asm("mvc .S2 pce1,%0\n" : "=b"(__pc)); \ + __pc; \ +}) + +/* +* User space process size. This is mostly meaningless for NOMMU +* but some C6X processors may have RAM addresses up to 0xFFFFFFFF. +* Since calls like mmap() can return an address or an error, we +* have to allow room for error returns when code does something +* like: +* +* addr = do_mmap(...) +* if ((unsigned long)addr >= TASK_SIZE) +* ... its an error code, not an address ... +* +* Here, we allow for 4096 error codes which means we really can't +* use the last 4K page on systems with RAM extending all the way +* to the end of the 32-bit address space. +*/ +#define TASK_SIZE 0xFFFFF000 + +/* +* This decides where the kernel will search for a free chunk of vm +* space during mmap's. We won't be using it +*/ +#define TASK_UNMAPPED_BASE 0 + +struct thread_struct { +unsigned long long b15_14; +unsigned long long a15_14; +unsigned long long b13_12; +unsigned long long a13_12; +unsigned long long b11_10; +unsigned long long a11_10; +unsigned long long ricl_icl; +unsigned long usp;/* user stack pointer */ +unsigned long pc;/* kernel pc */ +unsigned long wchan; +}; + +#define INIT_THREAD \ +{ \ + .usp = 0, \ + .wchan = 0, \ +} + +#define INIT_MMAP { \ + &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, \ + NULL, NULL } + +#define task_pt_regs (task) \ + ((struct pt_regs *)(THREAD_START_SP + task_stack_page(task)) - 1) + +#define alloc_kernel_stack () __get_free_page(GFP_KERNEL) +#define free_kernel_stack (page) free_page((page)) + + +/* Forward declaration, a strange C thing */ +struct task_struct ; + +extern void start_thread (struct pt_regs *regs,unsigned int pc, +unsigned long usp); + +/* Free all resources held by a thread. */ +static inline void release_thread (struct task_struct *dead_task) +{ +} + +/* Prepare to copy thread state - unlazy all lazy status */ +#define prepare_to_copy (tsk) do { } while (0) + +extern int kernel_thread (int (*fn)(void *),void * arg,unsigned long flags); + +#define copy_segments (tsk, mm) do { } while (0) +#define release_segments (mm) do { } while (0) + +/* +* saved PC of a blocked thread. +*/ +#define thread_saved_pc (tsk) (task_pt_regs(tsk)->pc) + +/* +* saved kernel SP and DP of a blocked thread. +*/ +#ifdef _BIG_ENDIAN +#define thread_saved_ksp (tsk) \ + (*(unsigned long *)&(tsk)->thread.b15_14) +#define thread_saved_dp (tsk) \ + (*(((unsigned long *)&(tsk)->thread.b15_14) + 1)) +#else +#define thread_saved_ksp (tsk) \ + (*(((unsigned long *)&(tsk)->thread.b15_14) + 1)) +#define thread_saved_dp (tsk) \ + (*(unsigned long *)&(tsk)->thread.b15_14) +#endif + +extern unsigned long get_wchan (struct task_struct *p); + +#define KSTK_EIP (tsk) (task_pt_regs(task)->pc) +#define KSTK_ESP (tsk) (task_pt_regs(task)->sp) + +#define cpu_relax () do { } while (0) + +extern const struct seq_operations cpuinfo_op; + +#endif /* ASM_C6X_PROCESSOR_H */
arch/c6x/include/asm/thread_info.h new file +121 -0
121 lines not on this page · raw message
arch/c6x/kernel/process.c new file +263 -0
263 lines not on this page · raw message
arch/c6x/kernel/switch_to.S new file +74 -0
74 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 10/24 C6X: signal management
In reply to Mark Salter--- arch/c6x/include/asm/sigcontext.h | 80 ++++++++ arch/c6x/include/asm/signal.h | 17 ++ arch/c6x/kernel/signal.c | 377 +++++++++++++++++++++++++++++++++++++ 3 files changed, 474 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/sigcontext.h create mode 100644 arch/c6x/include/asm/signal.h create mode 100644 arch/c6x/kernel/signal.c
arch/c6x/include/asm/sigcontext.h new file +80 -0
@@ -0,0 +1,80 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2004, 2009 Texas Instruments Incorporated +* Author: Aurelien Jacquiot ([email protected]) +* +* 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. +*/ +#ifndef _ASM_C6X_SIGCONTEXT_H +#define _ASM_C6X_SIGCONTEXT_H + + +struct sigcontext { +unsigned long sc_mask;/* old sigmask */ +unsigned long sc_sp;/* old user stack pointer */ + +unsigned long sc_a4; +unsigned long sc_b4; +unsigned long sc_a6; +unsigned long sc_b6; +unsigned long sc_a8; +unsigned long sc_b8; + +unsigned long sc_a0; +unsigned long sc_a1; +unsigned long sc_a2; +unsigned long sc_a3; +unsigned long sc_a5; +unsigned long sc_a7; +unsigned long sc_a9; + +unsigned long sc_b0; +unsigned long sc_b1; +unsigned long sc_b2; +unsigned long sc_b3; +unsigned long sc_b5; +unsigned long sc_b7; +unsigned long sc_b9; + +unsigned long sc_a16; +unsigned long sc_a17; +unsigned long sc_a18; +unsigned long sc_a19; +unsigned long sc_a20; +unsigned long sc_a21; +unsigned long sc_a22; +unsigned long sc_a23; +unsigned long sc_a24; +unsigned long sc_a25; +unsigned long sc_a26; +unsigned long sc_a27; +unsigned long sc_a28; +unsigned long sc_a29; +unsigned long sc_a30; +unsigned long sc_a31; + +unsigned long sc_b16; +unsigned long sc_b17; +unsigned long sc_b18; +unsigned long sc_b19; +unsigned long sc_b20; +unsigned long sc_b21; +unsigned long sc_b22; +unsigned long sc_b23; +unsigned long sc_b24; +unsigned long sc_b25; +unsigned long sc_b26; +unsigned long sc_b27; +unsigned long sc_b28; +unsigned long sc_b29; +unsigned long sc_b30; +unsigned long sc_b31; + +unsigned long sc_csr; +unsigned long sc_pc; +}; + +#endif /* _ASM_C6X_SIGCONTEXT_H */
arch/c6x/include/asm/signal.h new file +17 -0
@@ -0,0 +1,17 @@ +#ifndef _ASM_C6X_SIGNAL_H +#define _ASM_C6X_SIGNAL_H + +#include <asm-generic/signal.h> + +#ifndef __ASSEMBLY__ +#include <linux/linkage.h> + +struct pt_regs ; + +extern asmlinkage int do_rt_sigreturn(struct pt_regs *regs); +extern asmlinkage void do_notify_resume(struct pt_regs *regs, +u32 thread_info_flags, +int syscall); +#endif + +#endif /* _ASM_C6X_SIGNAL_H */
arch/c6x/kernel/signal.c new file +377 -0
377 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 12/24 C6X: interrupt handling
In reply to Mark SalterThe C6X core includes an interrupt controller with 12 inputs of fixed priority. Each core is contained within a core "megamodule" which includes another interrupt controller which cascades into the prioritized core controller. The megamodule PIC has four interrupt combiners; each with up to 32 inputs which are combined into one interrupt. The megamodule contains a set of MUX registers which are used map megamodule interrupt sources to one of 12 core interrupts. Any one of these 12 MUX outputs feeding into the core interrupt controller may be the output from one of the four interrupt combiners or an individual megamodule interrupt source. An individual megamodule interrupt source will bypass the combiners if the MUX registers are set up such that the individual interrupt feeds directly to one of the 12 core interrupts. This priority mapping of interrupts is supported in the devicetree. For details, see
Documentation/devicetree/bindings/c6x/interrupt.txt
The code in arch/c6x/kernel/irq.c which supports mapping of hardware to virtual interrupts was taken as-is from powerpc. There is ongoing work to generalize the virtual to hardware mapping and plans are to convert powerpc to use this. C6X will also need to be converted over when the generic code is ready.
--- arch/c6x/include/asm/hardirq.h | 20 + arch/c6x/include/asm/irq.h | 302 +++++++++++++++ arch/c6x/include/asm/irqflags.h | 72 ++++ arch/c6x/include/asm/megamod-pic.h | 9 + arch/c6x/kernel/irq.c | 730 ++++++++++++++++++++++++++++++++++++ arch/c6x/platforms/megamod-pic.c | 349 +++++++++++++++++ 6 files changed, 1482 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/hardirq.h create mode 100644 arch/c6x/include/asm/irq.h create mode 100644 arch/c6x/include/asm/irqflags.h create mode 100644 arch/c6x/include/asm/megamod-pic.h create mode 100644 arch/c6x/kernel/irq.c create mode 100644 arch/c6x/platforms/megamod-pic.c
arch/c6x/include/asm/hardirq.h new file +20 -0
@@ -0,0 +1,20 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated +* Author: Aurelien Jacquiot ([email protected]) +* +* 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. +*/ + +#ifndef _ASM_C6X_HARDIRQ_H +#define _ASM_C6X_HARDIRQ_H + +extern void ack_bad_irq (int irq); +#define ack_bad_irq ack_bad_irq + +#include <asm-generic/hardirq.h> + +#endif /* _ASM_C6X_HARDIRQ_H */
arch/c6x/include/asm/irq.h new file +302 -0
302 lines not on this page · raw message
arch/c6x/include/asm/irqflags.h new file +72 -0
72 lines not on this page · raw message
arch/c6x/include/asm/megamod-pic.h new file +9 -0
@@ -0,0 +1,9 @@ +#ifndef _C6X_MEGAMOD_PIC_H +#define _C6X_MEGAMOD_PIC_H + +#ifdef __KERNEL__ + +extern void __init megamod_pic_init (void ); + +#endif /* __KERNEL__ */ +#endif /* _C6X_MEGAMOD_PIC_H */
arch/c6x/kernel/irq.c new file +730 -0
730 lines not on this page · raw message
arch/c6x/platforms/megamod-pic.c new file +349 -0
349 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 13/24 C6X: syscalls
In reply to Mark Salter--- arch/c6x/include/asm/syscalls.h | 55 +++++++++++++++++++++++++++++ arch/c6x/include/asm/unistd.h | 26 ++++++++++++++ arch/c6x/kernel/sys_c6x.c | 73 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/syscalls.h create mode 100644 arch/c6x/include/asm/unistd.h create mode 100644 arch/c6x/kernel/sys_c6x.c
arch/c6x/include/asm/syscalls.h new file +55 -0
@@ -0,0 +1,55 @@ +/* +* Copyright (C) 2011 Texas Instruments Incorporated +* Author: Mark Salter <[email protected]> +* +* 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, version 2. +* +* 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, GOOD TITLE or +* NON INFRINGEMENT. See the GNU General Public License for +* more details. +*/ + +#ifndef __ASM_C6X_SYSCALLS_H +#define __ASM_C6X_SYSCALLS_H + +#include <linux/compiler.h> +#include <linux/linkage.h> +#include <linux/types.h> + +/* The array of function pointers for syscalls. */ +extern void *sys_call_table[]; + +/* The following are trampolines in entry.S to handle 64-bit arguments */ +extern long sys_pread_c6x (unsigned int fd,char __user *buf, +size_t count,off_t pos_low,off_t pos_high); +extern long sys_pwrite_c6x (unsigned int fd,const char __user *buf, +size_t count,off_t pos_low,off_t pos_high); +extern long sys_truncate64_c6x (const char __user *path, +off_t length_low,off_t length_high); +extern long sys_ftruncate64_c6x (unsigned int fd, +off_t length_low,off_t length_high); +extern long sys_fadvise64_c6x (int fd,u32 offset_lo,u32 offset_hi, +u32 len,int advice); +extern long sys_fadvise64_64_c6x (int fd,u32 offset_lo,u32 offset_hi, +u32 len_lo,u32 len_hi,int advice); +extern long sys_fallocate_c6x (int fd,int mode, +u32 offset_lo,u32 offset_hi, +u32 len_lo,u32 len_hi); +extern int sys_cache_sync (unsigned long s,unsigned long e); + +struct pt_regs ; + +extern asmlinkage long sys_c6x_clone (struct pt_regs *regs); +extern asmlinkage long sys_c6x_execve (const char __user *name, +const char __user *const __user *argv, +const char __user *const __user *envp, +struct pt_regs *regs); + + +#include <asm-generic/syscalls.h> + +#endif /* __ASM_C6X_SYSCALLS_H */
arch/c6x/include/asm/unistd.h new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (C) 2011 Texas Instruments Incorporated +* +* Based on arch/tile version. +* +* 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, version 2. +* +* 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, GOOD TITLE or +* NON INFRINGEMENT. See the GNU General Public License for +* more details. +*/ +#if !defined(_ASM_C6X_UNISTD_H) || defined(__SYSCALL) +#define _ASM_C6X_UNISTD_H + +/* Use the standard ABI for syscalls. */ +#include <asm-generic/unistd.h> + +/* C6X-specific syscalls. */ +#define __NR_cache_sync (__NR_arch_specific_syscall + 0) +__SYSCALL(__NR_cache_sync, sys_cache_sync) + +#endif /* _ASM_C6X_UNISTD_H */
arch/c6x/kernel/sys_c6x.c new file +73 -0
73 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 14/24 C6X: traps
In reply to Mark SalterThis patch provides the kernel entry points for traps, syscalls and interrupts.
--- arch/c6x/include/asm/traps.h | 36 ++ arch/c6x/kernel/asm-offsets.c | 123 +++++++ arch/c6x/kernel/entry.S | 803 +++++++++++++++++++++++++++++++++++++++++ arch/c6x/kernel/traps.c | 423 ++++++++++++++++++++++ 4 files changed, 1385 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/traps.h create mode 100644 arch/c6x/kernel/asm-offsets.c create mode 100644 arch/c6x/kernel/entry.S create mode 100644 arch/c6x/kernel/traps.c
arch/c6x/include/asm/traps.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2004, 2009, 2011 Texas Instruments Incorporated +* Author: Aurelien Jacquiot ([email protected]) +* +* 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. +*/ +#ifndef _ASM_C6X_TRAPS_H +#define _ASM_C6X_TRAPS_H + +#define EXCEPT_TYPE_NXF 31/* NMI */ +#define EXCEPT_TYPE_EXC 30/* external exception */ +#define EXCEPT_TYPE_IXF 1/* internal exception */ +#define EXCEPT_TYPE_SXF 0/* software exception */ + +#define EXCEPT_CAUSE_LBX (1 << 7)/* loop buffer exception */ +#define EXCEPT_CAUSE_PRX (1 << 6)/* privilege exception */ +#define EXCEPT_CAUSE_RAX (1 << 5)/* resource access exception */ +#define EXCEPT_CAUSE_RCX (1 << 4)/* resource conflict exception */ +#define EXCEPT_CAUSE_OPX (1 << 3)/* opcode exception */ +#define EXCEPT_CAUSE_EPX (1 << 2)/* execute packet exception */ +#define EXCEPT_CAUSE_FPX (1 << 1)/* fetch packet exception */ +#define EXCEPT_CAUSE_IFX (1 << 0)/* instruction fetch exception */ + +struct exception_info { +char *kernel_str; +int signo; +int code; +}; + +extern int (*c6x_nmi_handler)(struct pt_regs *regs); + +#endif /* _ASM_C6X_TRAPS_H */
arch/c6x/kernel/asm-offsets.c new file +123 -0
123 lines not on this page · raw message
arch/c6x/kernel/entry.S new file +803 -0
803 lines not on this page · raw message
arch/c6x/kernel/traps.c new file +423 -0
423 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 15/24 C6X: clocks
In reply to Mark SalterThe C6X SoCs contain several PLL controllers each with up to 16 clock outputs feeding into the cores or peripheral clock domains. The hardware is very similar to arm/mach-davinci clocks. This is still a work in progress which needs to be updated once device tree clock binding changes shake out.
--- arch/c6x/include/asm/clkdev.h | 22 ++ arch/c6x/include/asm/clock.h | 148 ++++++++++++++ arch/c6x/platforms/pll.c | 444 +++++++++++++++++++++++++++++++++++++++++ arch/c6x/platforms/plldata.c | 404 +++++++++++++++++++++++++++++++++++++ 4 files changed, 1018 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/clkdev.h create mode 100644 arch/c6x/include/asm/clock.h create mode 100644 arch/c6x/platforms/pll.c create mode 100644 arch/c6x/platforms/plldata.c
arch/c6x/include/asm/clkdev.h new file +22 -0
@@ -0,0 +1,22 @@ +#ifndef _ASM_CLKDEV_H +#define _ASM_CLKDEV_H + +#include <linux/slab.h> + +struct clk ; + +static inline int __clk_get (struct clk *clk) +{ +return 1 ; +} + +static inline void __clk_put (struct clk *clk) +{ +} + +static inline struct clk_lookup_alloc *__clkdev_alloc (size_t size) +{ +return kzalloc (size,GFP_KERNEL ); +} + +#endif /* _ASM_CLKDEV_H */
arch/c6x/include/asm/clock.h new file +148 -0
148 lines not on this page · raw message
arch/c6x/platforms/pll.c new file +444 -0
444 lines not on this page · raw message
arch/c6x/platforms/plldata.c new file +404 -0
404 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 16/24 C6X: cache control
In reply to Mark Salter--- arch/c6x/include/asm/cache.h | 90 ++++++++ arch/c6x/include/asm/cacheflush.h | 65 ++++++ arch/c6x/platforms/cache.c | 445 +++++++++++++++++++++++++++++++++++++ 3 files changed, 600 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/cache.h create mode 100644 arch/c6x/include/asm/cacheflush.h create mode 100644 arch/c6x/platforms/cache.c
arch/c6x/include/asm/cache.h new file +90 -0
@@ -0,0 +1,90 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2005, 2006, 2009, 2010 Texas Instruments Incorporated +* Author: Aurelien Jacquiot ([email protected]) +* +* 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. +*/ +#ifndef _ASM_C6X_CACHE_H +#define _ASM_C6X_CACHE_H + +#include <linux/irqflags.h> + +/* +* Cache line size +*/ +#define L1D_CACHE_BYTES 64 +#define L1P_CACHE_BYTES 32 +#define L2_CACHE_BYTES 128 + +/* +* L2 used as cache +*/ +#define L2MODE_SIZE L2MODE_256K_CACHE + +/* +* For practical reasons the L1_CACHE_BYTES defines should not be smaller than +* the L2 line size +*/ +#define L1_CACHE_BYTES L2_CACHE_BYTES + +#define L2_CACHE_ALIGN_LOW (x) \ + (((x) & ~(L2_CACHE_BYTES - 1))) +#define L2_CACHE_ALIGN_UP (x) \ + (((x) + (L2_CACHE_BYTES - 1)) & ~(L2_CACHE_BYTES - 1)) +#define L2_CACHE_ALIGN_CNT (x) \ + (((x) + (sizeof(int) - 1)) & ~(sizeof(int) - 1)) + +#define ARCH_DMA_MINALIGN L1_CACHE_BYTES +#define ARCH_SLAB_MINALIGN L1_CACHE_BYTES + +/* +* This is the granularity of hardware cacheability control. +*/ +#define CACHEABILITY_ALIGN 0x01000000 + +/* +* Align a physical address to MAR regions +*/ +#define CACHE_REGION_START (v) \ + (((u32) (v)) & ~(CACHEABILITY_ALIGN - 1)) +#define CACHE_REGION_END (v) \ + (((u32) (v) + (CACHEABILITY_ALIGN - 1)) & ~(CACHEABILITY_ALIGN - 1)) + +extern void __init c6x_cache_init (void ); + +extern void enable_caching (unsigned long start,unsigned long end); +extern void disable_caching (unsigned long start,unsigned long end); + +extern void L1_cache_off (void ); +extern void L1_cache_on (void ); + +extern void L1P_cache_global_invalidate (void ); +extern void L1D_cache_global_invalidate (void ); +extern void L1D_cache_global_writeback (void ); +extern void L1D_cache_global_writeback_invalidate (void ); +extern void L2_cache_set_mode (unsigned int mode); +extern void L2_cache_global_writeback_invalidate (void ); +extern void L2_cache_global_writeback (void ); + +extern void L1P_cache_block_invalidate (unsigned int start,unsigned int end); +extern void L1D_cache_block_invalidate (unsigned int start,unsigned int end); +extern void L1D_cache_block_writeback_invalidate (unsigned int start, +unsigned int end); +extern void L1D_cache_block_writeback (unsigned int start,unsigned int end); +extern void L2_cache_block_invalidate (unsigned int start,unsigned int end); +extern void L2_cache_block_writeback (unsigned int start,unsigned int end); +extern void L2_cache_block_writeback_invalidate (unsigned int start, +unsigned int end); +extern void L2_cache_block_invalidate_nowait (unsigned int start, +unsigned int end); +extern void L2_cache_block_writeback_nowait (unsigned int start, +unsigned int end); + +extern void L2_cache_block_writeback_invalidate_nowait (unsigned int start, +unsigned int end); + +#endif /* _ASM_C6X_CACHE_H */
arch/c6x/include/asm/cacheflush.h new file +65 -0
65 lines not on this page · raw message
arch/c6x/platforms/cache.c new file +445 -0
445 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 17/24 C6X: loadable module support
In reply to Mark Salter--- arch/c6x/include/asm/module.h | 33 +++++++++++ arch/c6x/kernel/c6x_ksyms.c | 68 +++++++++++++++++++++ arch/c6x/kernel/module.c | 129 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 230 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/module.h create mode 100644 arch/c6x/kernel/c6x_ksyms.c create mode 100644 arch/c6x/kernel/module.c
arch/c6x/include/asm/module.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated +* Author: Aurelien Jacquiot ([email protected]) +* +* Updated for 2.6.34 by: Mark Salter ([email protected]) +* +* 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. +*/ +#ifndef _ASM_C6X_MODULE_H +#define _ASM_C6X_MODULE_H + +#define Elf_Shdr Elf32_Shdr +#define Elf_Sym Elf32_Sym +#define Elf_Ehdr Elf32_Ehdr +#define Elf_Addr Elf32_Addr +#define Elf_Word Elf32_Word + +/* +* This file contains the C6x architecture specific module code. +*/ +struct mod_arch_specific { +}; + +struct loaded_sections { +unsigned int new_vaddr; +unsigned int loaded; +}; + +#endif /* _ASM_C6X_MODULE_H */
arch/c6x/kernel/c6x_ksyms.c new file +68 -0
68 lines not on this page · raw message
arch/c6x/kernel/module.c new file +129 -0
129 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 19/24 C6X: headers
In reply to Mark Salter--- arch/c6x/include/asm/asm-offsets.h | 1 + arch/c6x/include/asm/bitops.h | 105 +++++++++++++ arch/c6x/include/asm/byteorder.h | 12 ++ arch/c6x/include/asm/delay.h | 67 +++++++++ arch/c6x/include/asm/elf.h | 113 ++++++++++++++ arch/c6x/include/asm/ftrace.h | 6 + arch/c6x/include/asm/linkage.h | 30 ++++ arch/c6x/include/asm/memblock.h | 4 + arch/c6x/include/asm/mmu.h | 18 +++ arch/c6x/include/asm/mutex.h | 6 + arch/c6x/include/asm/page.h | 11 ++ arch/c6x/include/asm/pgtable.h | 81 ++++++++++ arch/c6x/include/asm/procinfo.h | 28 ++++ arch/c6x/include/asm/prom.h | 1 + arch/c6x/include/asm/sections.h | 12 ++ arch/c6x/include/asm/setup.h | 32 ++++ arch/c6x/include/asm/string.h | 21 +++ arch/c6x/include/asm/system.h | 168 +++++++++++++++++++++ arch/c6x/include/asm/tlb.h | 8 + arch/c6x/include/asm/uaccess.h | 107 +++++++++++++ arch/c6x/include/asm/unaligned.h | 288 ++++++++++++++++++++++++++++++++++++ 21 files changed, 1119 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/asm-offsets.h create mode 100644 arch/c6x/include/asm/bitops.h create mode 100644 arch/c6x/include/asm/byteorder.h create mode 100644 arch/c6x/include/asm/delay.h create mode 100644 arch/c6x/include/asm/elf.h create mode 100644 arch/c6x/include/asm/ftrace.h create mode 100644 arch/c6x/include/asm/linkage.h create mode 100644 arch/c6x/include/asm/memblock.h create mode 100644 arch/c6x/include/asm/mmu.h create mode 100644 arch/c6x/include/asm/mutex.h create mode 100644 arch/c6x/include/asm/page.h create mode 100644 arch/c6x/include/asm/pgtable.h create mode 100644 arch/c6x/include/asm/procinfo.h create mode 100644 arch/c6x/include/asm/prom.h create mode 100644 arch/c6x/include/asm/sections.h create mode 100644 arch/c6x/include/asm/setup.h create mode 100644 arch/c6x/include/asm/string.h create mode 100644 arch/c6x/include/asm/system.h create mode 100644 arch/c6x/include/asm/tlb.h create mode 100644 arch/c6x/include/asm/uaccess.h create mode 100644 arch/c6x/include/asm/unaligned.h
arch/c6x/include/asm/asm-offsets.h new file +1 -0
@@ -0,0 +1 @@ +#include <generated/asm-offsets.h>
arch/c6x/include/asm/bitops.h new file +105 -0
105 lines not on this page · raw message
arch/c6x/include/asm/byteorder.h new file +12 -0
@@ -0,0 +1,12 @@ +#ifndef _ASM_C6X_BYTEORDER_H +#define _ASM_C6X_BYTEORDER_H + +#include <asm/types.h> + +#ifdef _BIG_ENDIAN +#include <linux/byteorder/big_endian.h> +#else /* _BIG_ENDIAN */ +#include <linux/byteorder/little_endian.h> +#endif /* _BIG_ENDIAN */ + +#endif /* _ASM_BYTEORDER_H */
arch/c6x/include/asm/delay.h new file +67 -0
67 lines not on this page · raw message
arch/c6x/include/asm/elf.h new file +113 -0
113 lines not on this page · raw message
arch/c6x/include/asm/ftrace.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef _ASM_C6X_FTRACE_H +#define _ASM_C6X_FTRACE_H + +/* empty */ + +#endif /* _ASM_C6X_FTRACE_H */
arch/c6x/include/asm/linkage.h new file +30 -0
@@ -0,0 +1,30 @@ +#ifndef _ASM_C6X_LINKAGE_H +#define _ASM_C6X_LINKAGE_H + +#ifdef __ASSEMBLER__ + +#define __ALIGN .align 2 +#define __ALIGN_STR ".align 2" + +#ifndef __DSBT__ +#define ENTRY (name) \ + .global name @ \ + __ALIGN @ \ +name: +#else +#define ENTRY (name) \ + .global name @ \ + .hidden name @ \ + __ALIGN @ \ +name: +#endif + +#define ENDPROC (name) \ + .type name, @function @ \ + .size name, . - name + +#endif + +#include <asm-generic/linkage.h> + +#endif /* _ASM_C6X_LINKAGE_H */
arch/c6x/include/asm/memblock.h new file +4 -0
@@ -0,0 +1,4 @@ +#ifndef _ASM_C6X_MEMBLOCK_H +#define _ASM_C6X_MEMBLOCK_H + +#endif /* _ASM_C6X_MEMBLOCK_H */
arch/c6x/include/asm/mmu.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated +* Author: Aurelien Jacquiot ([email protected]) +* +* 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. +*/ +#ifndef _ASM_C6X_MMU_H +#define _ASM_C6X_MMU_H + +typedef struct { +unsigned long end_brk; +}mm_context_t ; + +#endif /* _ASM_C6X_MMU_H */
arch/c6x/include/asm/mutex.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef _ASM_C6X_MUTEX_H +#define _ASM_C6X_MUTEX_H + +#include <asm-generic/mutex-null.h> + +#endif /* _ASM_C6X_MUTEX_H */
arch/c6x/include/asm/page.h new file +11 -0
@@ -0,0 +1,11 @@ +#ifndef _ASM_C6X_PAGE_H +#define _ASM_C6X_PAGE_H + +#define VM_DATA_DEFAULT_FLAGS \ + (VM_READ | VM_WRITE | \ + ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + +#include <asm-generic/page.h> + +#endif /* _ASM_C6X_PAGE_H */
arch/c6x/include/asm/pgtable.h new file +81 -0
81 lines not on this page · raw message
arch/c6x/include/asm/procinfo.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* Copyright (C) 2010 Texas Instruments Incorporated +* Author: Mark Salter ([email protected]) +* +* +* 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. +*/ +#ifndef _ASM_C6X_PROCINFO_H +#define _ASM_C6X_PROCINFO_H + +#ifdef __KERNEL__ + +struct proc_info_list { +unsigned int cpu_val; +unsigned int cpu_mask; +const char *arch_name; +const char *elf_name; +unsigned int elf_hwcap; +}; + +#else /* __KERNEL__ */ +#include <asm/elf.h> +#warning "Please include asm/elf.h instead" +#endif /* __KERNEL__ */ + +#endif /* _ASM_C6X_PROCINFO_H */
arch/c6x/include/asm/prom.h new file +1 -0
@@ -0,0 +1 @@ +/* dummy prom.h; here to make linux/of.h's #includes happy */
arch/c6x/include/asm/sections.h new file +12 -0
@@ -0,0 +1,12 @@ +#ifndef _ASM_C6X_SECTIONS_H +#define _ASM_C6X_SECTIONS_H + +#include <asm-generic/sections.h> + +extern char _vectors_start[]; +extern char _vectors_end[]; + +extern char _data_lma[]; +extern char _fdt_start[], _fdt_end[]; + +#endif /* _ASM_C6X_SECTIONS_H */
arch/c6x/include/asm/setup.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2004, 2009, 2010 2011 Texas Instruments Incorporated +* Author: Aurelien Jacquiot ([email protected]) +* +* 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. +*/ +#ifndef _ASM_C6X_SETUP_H +#define _ASM_C6X_SETUP_H + +#define COMMAND_LINE_SIZE 1024 + +#ifndef __ASSEMBLY__ +extern char c6x_command_line[COMMAND_LINE_SIZE ]; + +extern int c6x_add_memory (phys_addr_t start,unsigned long size); + +extern unsigned long ram_start; +extern unsigned long ram_end; + +extern int c6x_num_cores; +extern unsigned int c6x_silicon_rev; +extern unsigned int c6x_devstat; +extern unsigned char c6x_fuse_mac[6 ]; + +extern void machine_init (unsigned long dt_ptr); + +#endif /* !__ASSEMBLY__ */ +#endif /* _ASM_C6X_SETUP_H */
arch/c6x/include/asm/string.h new file +21 -0
@@ -0,0 +1,21 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2004, 2009, 2011 Texas Instruments Incorporated +* Author: Aurelien Jacquiot ([email protected]) +* +* 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. +*/ +#ifndef _ASM_C6X_STRING_H +#define _ASM_C6X_STRING_H + +#include <asm/page.h> +#include <linux/linkage.h> + +asmlinkage extern void *memcpy(void *to, const void *from, size_t n); + +#define __HAVE_ARCH_MEMCPY + +#endif /* _ASM_C6X_STRING_H */
arch/c6x/include/asm/system.h new file +168 -0
168 lines not on this page · raw message
arch/c6x/include/asm/tlb.h new file +8 -0
@@ -0,0 +1,8 @@ +#ifndef _ASM_C6X_TLB_H +#define _ASM_C6X_TLB_H + +#define tlb_flush (tlb) flush_tlb_mm((tlb)->mm) + +#include <asm-generic/tlb.h> + +#endif /* _ASM_C6X_TLB_H */
arch/c6x/include/asm/uaccess.h new file +107 -0
107 lines not on this page · raw message
arch/c6x/include/asm/unaligned.h new file +288 -0
288 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 20/24 C6X: library code
In reply to Mark Salter--- arch/c6x/include/asm/checksum.h | 115 +++++++++++ arch/c6x/lib/csum_64plus.S | 404 +++++++++++++++++++++++++++++++++++++++ arch/c6x/lib/divi.S | 53 +++++ arch/c6x/lib/divremi.S | 46 +++++ arch/c6x/lib/divremu.S | 87 +++++++++ arch/c6x/lib/divu.S | 98 ++++++++++ arch/c6x/lib/llshl.S | 37 ++++ arch/c6x/lib/llshr.S | 38 ++++ arch/c6x/lib/llshru.S | 38 ++++ arch/c6x/lib/memcpy_64plus.S | 46 +++++ arch/c6x/lib/mpyll.S | 49 +++++ arch/c6x/lib/negll.S | 31 +++ arch/c6x/lib/pop_rts.S | 32 +++ arch/c6x/lib/push_rts.S | 31 +++ arch/c6x/lib/remi.S | 64 ++++++ arch/c6x/lib/remu.S | 82 ++++++++ arch/c6x/lib/strasgi.S | 89 +++++++++ arch/c6x/lib/strasgi_64plus.S | 39 ++++ 18 files changed, 1379 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/checksum.h create mode 100644 arch/c6x/lib/csum_64plus.S create mode 100644 arch/c6x/lib/divi.S create mode 100644 arch/c6x/lib/divremi.S create mode 100644 arch/c6x/lib/divremu.S create mode 100644 arch/c6x/lib/divu.S create mode 100644 arch/c6x/lib/llshl.S create mode 100644 arch/c6x/lib/llshr.S create mode 100644 arch/c6x/lib/llshru.S create mode 100644 arch/c6x/lib/memcpy_64plus.S create mode 100644 arch/c6x/lib/mpyll.S create mode 100644 arch/c6x/lib/negll.S create mode 100644 arch/c6x/lib/pop_rts.S create mode 100644 arch/c6x/lib/push_rts.S create mode 100644 arch/c6x/lib/remi.S create mode 100644 arch/c6x/lib/remu.S create mode 100644 arch/c6x/lib/strasgi.S create mode 100644 arch/c6x/lib/strasgi_64plus.S
arch/c6x/include/asm/checksum.h new file +115 -0
@@ -0,0 +1,115 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated +* Author: Aurelien Jacquiot ([email protected]) +* +* 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. +*/ +#ifndef _ASM_C6X_CHECKSUM_H +#define _ASM_C6X_CHECKSUM_H + +#include <asm/byteorder.h> + +/* +* Computes the checksum of a memory block at buff, length len, +* and adds in "sum" (32-bit) +* +* returns a 32-bit number suitable for feeding into itself +* or csum_tcpudp_magic +* +* this function must be called with even lengths, except +* for the last fragment, which may be odd +* +* it's best to have buff aligned on a 32-bit boundary +*/ +extern __wsum csum_partial (const void *buff,int len,__wsum sum); + +/* +* The same as csum_partial, but copies from src while it checksums +* +* here even more important to align src and dst on a 32-bit (or even +* better 64-bit) boundary +*/ +extern __wsum csum_partial_copy (const void *src,void *dst, +int len,__wsum sum); + +/* +* This is a new version of the above that records errors it finds in *errp, +* but continues and zeros the rest of the buffer. +*/ +#define csum_partial_copy_nocheck csum_partial_copy + +/* +* The same as csum_partial_copy, but copies from user space. +* +* here even more important to align src and dst on a 32-bit (or even +* better 64-bit) boundary +*/ +#define csum_partial_copy_from_user (src, dst, len, sum, err_ptr) \ + csum_partial_copy(src, dst, len, sum) + +/* +* This is a version of ip_compute_csum() optimized for IP headers, +* which always checksum on 4 octet boundaries. +* +*/ +extern __sum16 ip_fast_csum (const void *iph,unsigned int ihl); + +/* +* Fold a partial checksum +*/ +static inline __sum16 csum_fold (__wsum csum) +{ +u32 sum = (u32 )csum; + sum = (sum &0xffff ) + (sum >>16 ); + sum = (sum &0xffff ) + (sum >>16 ); +return (__sum16 )~sum; +} + +/* +* Computes the checksum of the TCP/UDP pseudo-header +*/ +static inline __wsum +csum_tcpudp_nofold (__be32 saddr,__be32 daddr,unsigned short len, +unsigned short proto,__wsum sum) +{ +unsigned long long s = (__force u32 )sum; + + s += (__force u32 )saddr; + s += (__force u32 )daddr; +#ifdef _BIG_ENDIAN + s += proto + len; +#else + s += (proto + len) <<8 ; +#endif + s += (s >>32 ); + +return (__force __wsum )s; +} + +/* +* Computes the checksum of the TCP/UDP pseudo-header +* returns a 16-bit checksum, already complemented +*/ +static inline __sum16 +csum_tcpudp_magic (__be32 saddr,__be32 daddr,unsigned short len, +unsigned short proto,__wsum sum) +{ +return csum_fold (csum_tcpudp_nofold (saddr, daddr, len, proto, sum)); +} + +/* +* This routine is used for miscellaneous IP-like checksums, mainly +* in icmp.c +*/ +static inline __sum16 +ip_compute_csum (const void *buff,int len) +{ +extern unsigned int do_csum (const unsigned char *,size_t ); +return (__force __sum16 )~do_csum (buff, len); +} + +#endif /* _ASM_C6X_CHECKSUM_H */
arch/c6x/lib/csum_64plus.S new file +404 -0
404 lines not on this page · raw message
arch/c6x/lib/divi.S new file +53 -0
53 lines not on this page · raw message
arch/c6x/lib/divremi.S new file +46 -0
46 lines not on this page · raw message
arch/c6x/lib/divremu.S new file +87 -0
87 lines not on this page · raw message
arch/c6x/lib/divu.S new file +98 -0
98 lines not on this page · raw message
arch/c6x/lib/llshl.S new file +37 -0
@@ -0,0 +1,37 @@ +;; Copyright (C) 2010 Texas Instruments Incorporated +;; Contributed by Mark Salter <[email protected]>. +;; +;; 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +;; uint64_t __c6xabi_llshl(uint64_t val, uint shift) + +#include <linux/linkage.h> + + .text +ENTRY(__c6xabi_llshl) + mv .l1x B4,A1 + [!A1] b .s2 B3 ; just return if zero shift + mvk .s1 32,A0 + sub .d1 A0,A1,A0 + cmplt .l1 0,A0,A2 + [A2] shru .s1 A4,A0,A0 + [!A2] neg .l1 A0,A5 +|| [A2] shl .s1 A5,A1,A5 + [!A2] shl .s1 A4,A5,A5 +|| [A2] or .d1 A5,A0,A5 +|| [!A2] mvk .l1 0,A4 + [A2] shl .s1 A4,A1,A4 + bnop .s2 B3,5 +ENDPROC(__c6xabi_llshl)
arch/c6x/lib/llshr.S new file +38 -0
@@ -0,0 +1,38 @@ +;; Copyright (C) 2010 Texas Instruments Incorporated +;; Contributed by Mark Salter <[email protected]>. +;; +;; 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +;; uint64_t __c6xabi_llshr(uint64_t val, uint shift) + +#include <linux/linkage.h> + + .text +ENTRY(__c6xabi_llshr) + mv .l1x B4,A1 + [!A1] b .s2 B3 ; return if zero shift count + mvk .s1 32,A0 + sub .d1 A0,A1,A0 + cmplt .l1 0,A0,A2 + [A2] shl .s1 A5,A0,A0 + nop + [!A2] neg .l1 A0,A4 +|| [A2] shru .s1 A4,A1,A4 + [!A2] shr .s1 A5,A4,A4 +|| [A2] or .d1 A4,A0,A4 + [!A2] shr .s1 A5,0x1f,A5 + [A2] shr .s1 A5,A1,A5 + bnop .s2 B3,5 +ENDPROC(__c6xabi_llshr)
arch/c6x/lib/llshru.S new file +38 -0
@@ -0,0 +1,38 @@ +;; Copyright (C) 2010 Texas Instruments Incorporated +;; Contributed by Mark Salter <[email protected]>. +;; +;; 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +;; uint64_t __c6xabi_llshru(uint64_t val, uint shift) + +#include <linux/linkage.h> + + .text +ENTRY(__c6xabi_llshru) + mv .l1x B4,A1 + [!A1] b .s2 B3 ; return if zero shift count + mvk .s1 32,A0 + sub .d1 A0,A1,A0 + cmplt .l1 0,A0,A2 + [A2] shl .s1 A5,A0,A0 + nop + [!A2] neg .l1 A0,A4 +|| [A2] shru .s1 A4,A1,A4 + [!A2] shru .s1 A5,A4,A4 +|| [A2] or .d1 A4,A0,A4 +|| [!A2] mvk .l1 0,A5 + [A2] shru .s1 A5,A1,A5 + bnop .s2 B3,5 +ENDPROC(__c6xabi_llshru)
arch/c6x/lib/memcpy_64plus.S new file +46 -0
46 lines not on this page · raw message
arch/c6x/lib/mpyll.S new file +49 -0
49 lines not on this page · raw message
arch/c6x/lib/negll.S new file +31 -0
@@ -0,0 +1,31 @@ +;; Copyright (C) 2010 Texas Instruments Incorporated +;; Contributed by Mark Salter <[email protected]>. +;; +;; 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +;; int64_t __c6xabi_negll(int64_t val) + +#include <linux/linkage.h> + + .text +ENTRY(__c6xabi_negll) + b .s2 B3 + mvk .l1 0,A0 + subu .l1 A0,A4,A3:A2 + sub .l1 A0,A5,A0 +|| ext .s1 A3,24,24,A5 + add .l1 A5,A0,A5 + mv .s1 A2,A4 +ENDPROC(__c6xabi_negll)
arch/c6x/lib/pop_rts.S new file +32 -0
@@ -0,0 +1,32 @@ +;; Copyright 2010 Free Software Foundation, Inc. +;; Contributed by Bernd Schmidt <[email protected]>. +;; +;; 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#include <linux/linkage.h> + + .text + +ENTRY(__c6xabi_pop_rts) + lddw .d2t2 *++B15, B3:B2 + lddw .d2t1 *++B15, A11:A10 + lddw .d2t2 *++B15, B11:B10 + lddw .d2t1 *++B15, A13:A12 + lddw .d2t2 *++B15, B13:B12 + lddw .d2t1 *++B15, A15:A14 +|| b .s2 B3 + ldw .d2t2 *++B15[2], B14 + nop 4 +ENDPROC(__c6xabi_pop_rts)
arch/c6x/lib/push_rts.S new file +31 -0
@@ -0,0 +1,31 @@ +;; Copyright 2010 Free Software Foundation, Inc. +;; Contributed by Bernd Schmidt <[email protected]>. +;; +;; 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#include <linux/linkage.h> + + .text + +ENTRY(__c6xabi_push_rts) + stw .d2t2 B14, *B15--[2] + stdw .d2t1 A15:A14, *B15-- +|| b .s2x A3 + stdw .d2t2 B13:B12, *B15-- + stdw .d2t1 A13:A12, *B15-- + stdw .d2t2 B11:B10, *B15-- + stdw .d2t1 A11:A10, *B15-- + stdw .d2t2 B3:B2, *B15-- +ENDPROC(__c6xabi_push_rts)
arch/c6x/lib/remi.S new file +64 -0
64 lines not on this page · raw message
arch/c6x/lib/remu.S new file +82 -0
82 lines not on this page · raw message
arch/c6x/lib/strasgi.S new file +89 -0
89 lines not on this page · raw message
arch/c6x/lib/strasgi_64plus.S new file +39 -0
@@ -0,0 +1,39 @@ +;; Copyright 2010 Free Software Foundation, Inc. +;; Contributed by Bernd Schmidt <[email protected]>. +;; +;; 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#include <linux/linkage.h> + + .text + +ENTRY(__c6xabi_strasgi_64plus) + shru .s2x a6, 2, b31 +|| mv .s1 a4, a30 +|| mv .d2 b4, b30 + + add .s2 -4, b31, b31 + + sploopd 1 +|| mvc .s2 b31, ilc + ldw .d2t2 *b30++, b31 + nop 4 + mv .s1x b31,a31 + spkernel 6, 0 +|| stw .d1t1 a31, *a30++ + + ret .s2 b3 + nop 5 +ENDPROC(__c6xabi_strasgi_64plus)
Signature · 1 line
1.7.6.2
PATCH v3 23/24 C6X: DSCR - Device State Configuration Registers
In reply to Mark SalterAll SoCs provide an area of device configuration registers called the DSCR. The location of specific registers as well as their use varies considerably from implementation to implementation. Rather than having to rely on additional SoC-specific DSCR code for each new supported SoC, this code generalize things as much as possible using device tree properties. Initialization must take place early on (setup_arch time) in case the event timer device needs to be enable via the DSCR.
--- arch/c6x/include/asm/dscr.h | 34 +++ arch/c6x/platforms/dscr.c | 598 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 632 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/dscr.h create mode 100644 arch/c6x/platforms/dscr.c
arch/c6x/include/asm/dscr.h new file +34 -0
@@ -0,0 +1,34 @@ +/* +* Copyright (C) 2011 Texas Instruments Incorporated +* Author: Mark Salter <[email protected]> +* +* 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. +* +*/ +#ifndef _ASM_C6X_DSCR_H +#define _ASM_C6X_DSCR_H + +enum dscr_devstate_t { +DSCR_DEVSTATE_ENABLED , +DSCR_DEVSTATE_DISABLED , +}; + +/* +* Set the device state of the device with the given ID. +* +* Individual drivers should use this to enable or disable the +* hardware device. The devid used to identify the device being +* controlled should be a property in the device's tree node. +*/ +extern void dscr_set_devstate (int devid,enum dscr_devstate_t state); + +/* +* Assert or de-assert an RMII reset. +*/ +extern void dscr_rmii_reset (int id,int assert); + +extern void dscr_probe (void ); + +#endif /* _ASM_C6X_DSCR_H */
arch/c6x/platforms/dscr.c new file +598 -0
598 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 24/24 C6X: MAINTAINERS
In reply to Mark Salter--- MAINTAINERS | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
MAINTAINERS +8 -0
@@ -1626,6 +1626,14 @@ T: git git://git.alsa-project.org/alsa-kernel.git S: Maintained F: sound/pci/oxygen/ +C6X ARCHITECTURE +M: Mark Salter <[email protected]> +M: Aurelien Jacquiot <[email protected]> +L: [email protected] +W: http://www.linux-c6x.org/wiki/index.php/Main_Page +S: Maintained +F: arch/c6x/ + CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS M: David Howells <[email protected]> L: [email protected]
Signature · 1 line
1.7.6.2
v3 cover C6X: New architecture
Here is v3 of the C6X architecture patch series. Patches are available in 'upstream-v3' branch at:
[email protected]:/git/projects/linux-c6x-upstreaming
A prebuilt GNU toolchain can be found at:
http://www.codesourcery.com/sgpp/lite/c6000/portal/release1882
The toolchain bits have also been contributed upstream.
This architecture supports members of the Texas Instruments family of C6x single and multicore DSPs. The multicore DSPs do not support cache coherancy, so are not suitable for SMP. Also, these are no-mmu processors. This core architecture is VLIW with an instruction set optimized for DSP applications (lots of registers, bit manipulation instructions, fast multiply, no divide). For details see:
http://processors.wiki.ti.com/index.php/Main_Page
Changes from the previous patchset are:
* Added a patch for asm-generic/io.h to fix iounmap decl.
* Removed the soc-64xx.c files and soc probe code. The only remaining code that makes decisions based on SoC-model is the clkdev code. That should go away once generic clock binding is available and clock code makes better use of devicetree.
* Split out SoC-specific DTSI files from the platform DTS files
* Added device tree binding documentation
* Other device tree cleanups per feedback from Grant
* Cleaned up timer and interrupt code per feedback from tglx
* Created a generalized Device State Config (DSCR) driver with SoC-specific details moved into the device tree
* Removed obsolete IRQF_DISABLED
* Removed Power State Controller (PSC) code for now. Will reintroduce it when needed by drivers.
* Add missing iounmap to EMIF driver
* Removed unneeded (by GCC) apply_relocate() from module support
* Removed deprecated sys_mmap
* Fixed race to idle in cpu_idle loop
* Removed superfluous c6x_power_off
* Cleaned up Kconfig/Makefile issues pointed out by Sam
* Use force_sigsegv to avoid SIGSEGV loops
* Added additional comment to generic strnlen_user patch
Mark Salter (24):
fix default __strnlen_user macro
fixed generic page.h for non-zero PAGE_OFFSET add ELF machine define for TI C6X DSPs
add missing __iomem to generic iounmap declaration
C6X: build infrastructure
C6X: early boot code
C6X: devicetree support
C6X: memory management and DMA support
C6X: process management
C6X: signal management
C6X: time management
C6X: interrupt handling
C6X: syscalls
C6X: traps
C6X: clocks
C6X: cache control
C6X: loadable module support
C6X: ptrace support
C6X: headers
C6X: library code
C6X: general SoC support
C6X: EMIF - External Memory Interface
C6X: DSCR - Device State Configuration Registers
C6X: MAINTAINERS
Documentation/devicetree/bindings/c6x/clocks.txt | 40 + Documentation/devicetree/bindings/c6x/dscr.txt | 127 +++ Documentation/devicetree/bindings/c6x/emifa.txt | 62 ++ .../devicetree/bindings/c6x/interrupt.txt | 104 +++ Documentation/devicetree/bindings/c6x/soc.txt | 28 + Documentation/devicetree/bindings/c6x/timer64.txt | 26 + MAINTAINERS | 8 + arch/c6x/Kconfig | 173 +++++ arch/c6x/Makefile | 52 ++ arch/c6x/boot/Makefile | 22 + arch/c6x/boot/dts/dsk6455.dts | 62 ++ arch/c6x/boot/dts/evmc6457.dts | 48 ++ arch/c6x/boot/dts/evmc6472.dts | 73 ++ arch/c6x/boot/dts/evmc6474.dts | 58 ++ arch/c6x/boot/dts/tms320c6455.dtsi | 96 +++ arch/c6x/boot/dts/tms320c6457.dtsi | 68 ++ arch/c6x/boot/dts/tms320c6472.dtsi | 134 ++++ arch/c6x/boot/dts/tms320c6474.dtsi | 89 +++ arch/c6x/boot/install-dtb.c | 333 ++++++++ arch/c6x/configs/dsk6455_defconfig | 43 + arch/c6x/configs/evmc6457_defconfig | 40 + arch/c6x/configs/evmc6472_defconfig | 41 + arch/c6x/configs/evmc6474_defconfig | 41 + arch/c6x/include/asm/Kbuild | 55 ++ arch/c6x/include/asm/asm-offsets.h | 1 + arch/c6x/include/asm/bitops.h | 105 +++ arch/c6x/include/asm/byteorder.h | 12 + arch/c6x/include/asm/cache.h | 90 +++ arch/c6x/include/asm/cacheflush.h | 65 ++ arch/c6x/include/asm/checksum.h | 115 +++ arch/c6x/include/asm/clkdev.h | 22 + arch/c6x/include/asm/clock.h | 148 ++++ arch/c6x/include/asm/delay.h | 67 ++ arch/c6x/include/asm/dma-mapping.h | 91 +++ arch/c6x/include/asm/dscr.h | 34 + arch/c6x/include/asm/elf.h | 113 +++ arch/c6x/include/asm/ftrace.h | 6 + arch/c6x/include/asm/hardirq.h | 20 + arch/c6x/include/asm/irq.h | 302 ++++++++ arch/c6x/include/asm/irqflags.h | 72 ++ arch/c6x/include/asm/linkage.h | 30 + arch/c6x/include/asm/megamod-pic.h | 9 + arch/c6x/include/asm/memblock.h | 4 + arch/c6x/include/asm/mmu.h | 18 + arch/c6x/include/asm/module.h | 33 + arch/c6x/include/asm/mutex.h | 6 + arch/c6x/include/asm/page.h | 11 + arch/c6x/include/asm/pgtable.h | 81 ++ arch/c6x/include/asm/processor.h | 132 ++++ arch/c6x/include/asm/procinfo.h | 28 + arch/c6x/include/asm/prom.h | 1 + arch/c6x/include/asm/ptrace.h | 177 +++++ arch/c6x/include/asm/sections.h | 12 + arch/c6x/include/asm/setup.h | 32 + arch/c6x/include/asm/sigcontext.h | 80 ++ arch/c6x/include/asm/signal.h | 17 + arch/c6x/include/asm/soc.h | 35 + arch/c6x/include/asm/string.h | 21 + arch/c6x/include/asm/syscalls.h | 55 ++ arch/c6x/include/asm/system.h | 168 ++++ arch/c6x/include/asm/thread_info.h | 121 +++ arch/c6x/include/asm/timer64.h | 6 + arch/c6x/include/asm/timex.h | 38 + arch/c6x/include/asm/tlb.h | 8 + arch/c6x/include/asm/traps.h | 36 + arch/c6x/include/asm/uaccess.h | 107 +++ arch/c6x/include/asm/unaligned.h | 288 +++++++ arch/c6x/include/asm/unistd.h | 26 + arch/c6x/kernel/Makefile | 12 + arch/c6x/kernel/asm-offsets.c | 123 +++ arch/c6x/kernel/c6x_ksyms.c | 68 ++ arch/c6x/kernel/devicetree.c | 53 ++ arch/c6x/kernel/dma.c | 168 ++++ arch/c6x/kernel/entry.S | 803 ++++++++++++++++++++ arch/c6x/kernel/head.S | 84 ++ arch/c6x/kernel/irq.c | 730 ++++++++++++++++++ arch/c6x/kernel/module.c | 129 ++++ arch/c6x/kernel/process.c | 263 +++++++ arch/c6x/kernel/ptrace.c | 207 +++++ arch/c6x/kernel/setup.c | 499 ++++++++++++ arch/c6x/kernel/signal.c | 377 +++++++++ arch/c6x/kernel/soc.c | 78 ++ arch/c6x/kernel/switch_to.S | 74 ++ arch/c6x/kernel/sys_c6x.c | 73 ++ arch/c6x/kernel/time.c | 65 ++ arch/c6x/kernel/traps.c | 423 ++++++++++ arch/c6x/kernel/vectors.S | 81 ++ arch/c6x/kernel/vmlinux.lds.S | 162 ++++ arch/c6x/lib/Makefile | 7 + arch/c6x/lib/csum_64plus.S | 404 ++++++++++ arch/c6x/lib/divi.S | 53 ++ arch/c6x/lib/divremi.S | 46 ++ arch/c6x/lib/divremu.S | 87 +++ arch/c6x/lib/divu.S | 98 +++ arch/c6x/lib/llshl.S | 37 + arch/c6x/lib/llshr.S | 38 + arch/c6x/lib/llshru.S | 38 + arch/c6x/lib/memcpy_64plus.S | 46 ++ arch/c6x/lib/mpyll.S | 49 ++ arch/c6x/lib/negll.S | 31 + arch/c6x/lib/pop_rts.S | 32 + arch/c6x/lib/push_rts.S | 31 + arch/c6x/lib/remi.S | 64 ++ arch/c6x/lib/remu.S | 82 ++ arch/c6x/lib/strasgi.S | 89 +++ arch/c6x/lib/strasgi_64plus.S | 39 + arch/c6x/mm/Makefile | 5 + arch/c6x/mm/dma-coherent.c | 142 ++++ arch/c6x/mm/init.c | 112 +++ arch/c6x/platforms/Kconfig | 41 + arch/c6x/platforms/Makefile | 12 + arch/c6x/platforms/cache.c | 445 +++++++++++ arch/c6x/platforms/dscr.c | 598 +++++++++++++++ arch/c6x/platforms/emif.c | 88 +++ arch/c6x/platforms/megamod-pic.c | 349 +++++++++ arch/c6x/platforms/platform.c | 17 + arch/c6x/platforms/pll.c | 444 +++++++++++ arch/c6x/platforms/plldata.c | 404 ++++++++++ arch/c6x/platforms/timer64.c | 188 +++++ include/asm-generic/io.h | 2 +- include/asm-generic/page.h | 10 +- include/asm-generic/uaccess.h | 7 +- include/linux/elf-em.h | 1 + 123 files changed, 13269 insertions(+), 5 deletions(-) create mode 100644 Documentation/devicetree/bindings/c6x/clocks.txt create mode 100644 Documentation/devicetree/bindings/c6x/dscr.txt create mode 100644 Documentation/devicetree/bindings/c6x/emifa.txt create mode 100644 Documentation/devicetree/bindings/c6x/interrupt.txt create mode 100644 Documentation/devicetree/bindings/c6x/soc.txt create mode 100644 Documentation/devicetree/bindings/c6x/timer64.txt create mode 100644 arch/c6x/Kconfig create mode 100644 arch/c6x/Makefile create mode 100644 arch/c6x/boot/Makefile create mode 100644 arch/c6x/boot/dts/dsk6455.dts create mode 100644 arch/c6x/boot/dts/evmc6457.dts create mode 100644 arch/c6x/boot/dts/evmc6472.dts create mode 100644 arch/c6x/boot/dts/evmc6474.dts create mode 100644 arch/c6x/boot/dts/tms320c6455.dtsi create mode 100644 arch/c6x/boot/dts/tms320c6457.dtsi create mode 100644 arch/c6x/boot/dts/tms320c6472.dtsi create mode 100644 arch/c6x/boot/dts/tms320c6474.dtsi create mode 100644 arch/c6x/boot/install-dtb.c create mode 100644 arch/c6x/configs/dsk6455_defconfig create mode 100644 arch/c6x/configs/evmc6457_defconfig create mode 100644 arch/c6x/configs/evmc6472_defconfig create mode 100644 arch/c6x/configs/evmc6474_defconfig create mode 100644 arch/c6x/include/asm/Kbuild create mode 100644 arch/c6x/include/asm/asm-offsets.h create mode 100644 arch/c6x/include/asm/bitops.h create mode 100644 arch/c6x/include/asm/byteorder.h create mode 100644 arch/c6x/include/asm/cache.h create mode 100644 arch/c6x/include/asm/cacheflush.h create mode 100644 arch/c6x/include/asm/checksum.h create mode 100644 arch/c6x/include/asm/clkdev.h create mode 100644 arch/c6x/include/asm/clock.h create mode 100644 arch/c6x/include/asm/delay.h create mode 100644 arch/c6x/include/asm/dma-mapping.h create mode 100644 arch/c6x/include/asm/dscr.h create mode 100644 arch/c6x/include/asm/elf.h create mode 100644 arch/c6x/include/asm/ftrace.h create mode 100644 arch/c6x/include/asm/hardirq.h create mode 100644 arch/c6x/include/asm/irq.h create mode 100644 arch/c6x/include/asm/irqflags.h create mode 100644 arch/c6x/include/asm/linkage.h create mode 100644 arch/c6x/include/asm/megamod-pic.h create mode 100644 arch/c6x/include/asm/memblock.h create mode 100644 arch/c6x/include/asm/mmu.h create mode 100644 arch/c6x/include/asm/module.h create mode 100644 arch/c6x/include/asm/mutex.h create mode 100644 arch/c6x/include/asm/page.h create mode 100644 arch/c6x/include/asm/pgtable.h create mode 100644 arch/c6x/include/asm/processor.h create mode 100644 arch/c6x/include/asm/procinfo.h create mode 100644 arch/c6x/include/asm/prom.h create mode 100644 arch/c6x/include/asm/ptrace.h create mode 100644 arch/c6x/include/asm/sections.h create mode 100644 arch/c6x/include/asm/setup.h create mode 100644 arch/c6x/include/asm/sigcontext.h create mode 100644 arch/c6x/include/asm/signal.h create mode 100644 arch/c6x/include/asm/soc.h create mode 100644 arch/c6x/include/asm/string.h create mode 100644 arch/c6x/include/asm/syscalls.h create mode 100644 arch/c6x/include/asm/system.h create mode 100644 arch/c6x/include/asm/thread_info.h create mode 100644 arch/c6x/include/asm/timer64.h create mode 100644 arch/c6x/include/asm/timex.h create mode 100644 arch/c6x/include/asm/tlb.h create mode 100644 arch/c6x/include/asm/traps.h create mode 100644 arch/c6x/include/asm/uaccess.h create mode 100644 arch/c6x/include/asm/unaligned.h create mode 100644 arch/c6x/include/asm/unistd.h create mode 100644 arch/c6x/kernel/Makefile create mode 100644 arch/c6x/kernel/asm-offsets.c create mode 100644 arch/c6x/kernel/c6x_ksyms.c create mode 100644 arch/c6x/kernel/devicetree.c create mode 100644 arch/c6x/kernel/dma.c create mode 100644 arch/c6x/kernel/entry.S create mode 100644 arch/c6x/kernel/head.S create mode 100644 arch/c6x/kernel/irq.c create mode 100644 arch/c6x/kernel/module.c create mode 100644 arch/c6x/kernel/process.c create mode 100644 arch/c6x/kernel/ptrace.c create mode 100644 arch/c6x/kernel/setup.c create mode 100644 arch/c6x/kernel/signal.c create mode 100644 arch/c6x/kernel/soc.c create mode 100644 arch/c6x/kernel/switch_to.S create mode 100644 arch/c6x/kernel/sys_c6x.c create mode 100644 arch/c6x/kernel/time.c create mode 100644 arch/c6x/kernel/traps.c create mode 100644 arch/c6x/kernel/vectors.S create mode 100644 arch/c6x/kernel/vmlinux.lds.S create mode 100644 arch/c6x/lib/Makefile create mode 100644 arch/c6x/lib/csum_64plus.S create mode 100644 arch/c6x/lib/divi.S create mode 100644 arch/c6x/lib/divremi.S create mode 100644 arch/c6x/lib/divremu.S create mode 100644 arch/c6x/lib/divu.S create mode 100644 arch/c6x/lib/llshl.S create mode 100644 arch/c6x/lib/llshr.S create mode 100644 arch/c6x/lib/llshru.S create mode 100644 arch/c6x/lib/memcpy_64plus.S create mode 100644 arch/c6x/lib/mpyll.S create mode 100644 arch/c6x/lib/negll.S create mode 100644 arch/c6x/lib/pop_rts.S create mode 100644 arch/c6x/lib/push_rts.S create mode 100644 arch/c6x/lib/remi.S create mode 100644 arch/c6x/lib/remu.S create mode 100644 arch/c6x/lib/strasgi.S create mode 100644 arch/c6x/lib/strasgi_64plus.S create mode 100644 arch/c6x/mm/Makefile create mode 100644 arch/c6x/mm/dma-coherent.c create mode 100644 arch/c6x/mm/init.c create mode 100644 arch/c6x/platforms/Kconfig create mode 100644 arch/c6x/platforms/Makefile create mode 100644 arch/c6x/platforms/cache.c create mode 100644 arch/c6x/platforms/dscr.c create mode 100644 arch/c6x/platforms/emif.c create mode 100644 arch/c6x/platforms/megamod-pic.c create mode 100644 arch/c6x/platforms/platform.c create mode 100644 arch/c6x/platforms/pll.c create mode 100644 arch/c6x/platforms/plldata.c create mode 100644 arch/c6x/platforms/timer64.c
Signature · 1 line
1.7.6.2
PATCH v3 1/24 fix default __strnlen_user macro
The existing __strnlen_user macro simply resolved to strnlen. However, the count returned by strnlen_user should include the NULL byte. This patch fixes the __strnlen_user macro to include the NULL byte in the count.
--- include/asm-generic/uaccess.h | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
include/asm-generic/uaccess.h +6 -1
@@ -289,9 +289,14 @@ strncpy_from_user(char *dst, const char __user *src, long count)* Return 0 on exception, a value greater than N if too long */ #ifndef __strnlen_user -#define __strnlen_user strnlen +#define __strnlen_user (s, n) (strnlen((s), (n)) + 1)#endif +/* +* Unlike strnlen, strnlen_user includes the nul terminator in +* its returned count. Callers should check for a returned value +* greater than N as an indication the string is too long. +*/ static inline long strnlen_user (const char __user *src,long n) {if (!access_ok (VERIFY_READ , src,1 ))
Signature · 1 line
1.7.6.2
PATCH v3 3/24 add ELF machine define for TI C6X DSPs
In reply to Mark Salter--- include/linux/elf-em.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
include/linux/elf-em.h +1 -0
@@ -33,6 +33,7 @@#define EM_H8_300 46/* Renesas H8/300,300H,H8S */ #define EM_MN10300 89/* Panasonic/MEI MN10300, AM33 */ #define EM_BLACKFIN 106/* ADI Blackfin Processor */ +#define EM_TI_C6000 140/* TI C6X DSPs */ #define EM_FRV 0x5441/* Fujitsu FR-V */ #define EM_AVR32 0x18ad/* Atmel AVR32 */
Signature · 1 line
1.7.6.2
PATCH v3 11/24 C6X: time management
In reply to Mark SalterThe C6X architecture includes a 64-bit free running core clock counter which is used as the clocksource. The SoCs have a number of 64-bit programmable timers. One of these is used as the clockevent timer.
--- arch/c6x/include/asm/timer64.h | 6 ++ arch/c6x/include/asm/timex.h | 38 ++++++++ arch/c6x/kernel/time.c | 65 ++++++++++++++ arch/c6x/platforms/timer64.c | 188 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 297 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/timer64.h create mode 100644 arch/c6x/include/asm/timex.h create mode 100644 arch/c6x/kernel/time.c create mode 100644 arch/c6x/platforms/timer64.c
arch/c6x/include/asm/timer64.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef _C6X_TIMER64_H +#define _C6X_TIMER64_H + +extern void __init timer64_init (void ); + +#endif /* _C6X_TIMER64_H */
arch/c6x/include/asm/timex.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated +* Author: Aurelien Jacquiot ([email protected]) +* +* Modified for 2.6.34: Mark Salter <[email protected]> +* +* 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. +*/ +#ifndef _ASM_C6X_TIMEX_H +#define _ASM_C6X_TIMEX_H + +/* +* This should be close enough... +*/ +#define CLOCK_TICK_RATE ((1000 * 1000000UL) / 6) + +/* 64-bit timestamp */ +typedef unsigned long long cycles_t ; + +extern cycles_t cacheflush_time; + +static inline cycles_t get_cycles (void ) +{ +unsigned l, h; + + asmvolatile (" dint\n" +" mvc .s2 TSCL,%0\n" +" mvc .s2 TSCH,%1\n" +" rint\n" + :"=b" (l),"=b" (h)); +return ((cycles_t )h <<32 ) | l; +} + +#endif /* _ASM_C6X_TIMEX_H */
arch/c6x/kernel/time.c new file +65 -0
65 lines not on this page · raw message
arch/c6x/platforms/timer64.c new file +188 -0
188 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 18/24 C6X: ptrace support
In reply to Mark Salter--- arch/c6x/include/asm/ptrace.h | 177 +++++++++++++++++++++++++++++++++++ arch/c6x/kernel/ptrace.c | 207 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 384 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/ptrace.h create mode 100644 arch/c6x/kernel/ptrace.c
arch/c6x/include/asm/ptrace.h new file +177 -0
@@ -0,0 +1,177 @@ +/* +* Copyright (C) 2004, 2006, 2009, 2010 Texas Instruments Incorporated +* Author: Aurelien Jacquiot ([email protected]) +* +* Updated for 2.6.34: Mark Salter <[email protected]> +* +* 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. +*/ +#ifndef _ASM_C6X_PTRACE_H +#define _ASM_C6X_PTRACE_H + +#define BKPT_OPCODE 0x56454314/* illegal opcode */ + +#ifdef _BIG_ENDIAN +#define PT_LO (odd, even) odd +#define PT_HI (odd, even) even +#else +#define PT_LO (odd, even) even +#define PT_HI (odd, even) odd +#endif + +#define PT_A4_ORG PT_LO(1, 0) +#define PT_TSR PT_HI(1, 0) +#define PT_ILC PT_LO(3, 2) +#define PT_RILC PT_HI(3, 2) +#define PT_CSR PT_LO(5, 4) +#define PT_PC PT_HI(5, 4) +#define PT_B16 PT_LO(7, 6) +#define PT_B17 PT_HI(7, 6) +#define PT_B18 PT_LO(9, 8) +#define PT_B19 PT_HI(9, 8) +#define PT_B20 PT_LO(11, 10) +#define PT_B21 PT_HI(11, 10) +#define PT_B22 PT_LO(13, 12) +#define PT_B23 PT_HI(13, 12) +#define PT_B24 PT_LO(15, 14) +#define PT_B25 PT_HI(15, 14) +#define PT_B26 PT_LO(17, 16) +#define PT_B27 PT_HI(17, 16) +#define PT_B28 PT_LO(19, 18) +#define PT_B29 PT_HI(19, 18) +#define PT_B30 PT_LO(21, 20) +#define PT_B31 PT_HI(21, 20) +#define PT_B0 PT_LO(23, 22) +#define PT_B1 PT_HI(23, 22) +#define PT_B2 PT_LO(25, 24) +#define PT_B3 PT_HI(25, 24) +#define PT_B4 PT_LO(27, 26) +#define PT_B5 PT_HI(27, 26) +#define PT_B6 PT_LO(29, 28) +#define PT_B7 PT_HI(29, 28) +#define PT_B8 PT_LO(31, 30) +#define PT_B9 PT_HI(31, 30) +#define PT_B10 PT_LO(33, 32) +#define PT_B11 PT_HI(33, 32) +#define PT_B12 PT_LO(35, 34) +#define PT_B13 PT_HI(35, 34) +#define PT_A16 PT_LO(37, 36) +#define PT_A17 PT_HI(37, 36) +#define PT_A18 PT_LO(39, 38) +#define PT_A19 PT_HI(39, 38) +#define PT_A20 PT_LO(41, 40) +#define PT_A21 PT_HI(41, 40) +#define PT_A22 PT_LO(43, 42) +#define PT_A23 PT_HI(43, 42) +#define PT_A24 PT_LO(45, 44) +#define PT_A25 PT_HI(45, 44) +#define PT_A26 PT_LO(47, 46) +#define PT_A27 PT_HI(47, 46) +#define PT_A28 PT_LO(49, 48) +#define PT_A29 PT_HI(49, 48) +#define PT_A30 PT_LO(51, 50) +#define PT_A31 PT_HI(51, 50) +#define PT_A0 PT_LO(53, 52) +#define PT_A1 PT_HI(53, 52) +#define PT_A2 PT_LO(55, 54) +#define PT_A3 PT_HI(55, 54) +#define PT_A4 PT_LO(57, 56) +#define PT_A5 PT_HI(57, 56) +#define PT_A6 PT_LO(59, 58) +#define PT_A7 PT_HI(59, 58) +#define PT_A8 PT_LO(61, 60) +#define PT_A9 PT_HI(61, 60) +#define PT_A10 PT_LO(63, 62) +#define PT_A11 PT_HI(63, 62) +#define PT_A12 PT_LO(65, 64) +#define PT_A13 PT_HI(65, 64) +#define PT_A14 PT_LO(67, 66) +#define PT_A15 PT_HI(67, 66) +#define PT_B14 PT_LO(69, 68) +#define PT_B15 PT_HI(69, 68) + +#define NR_PTREGS 70 + +#define PT_DP PT_B14/* Data Segment Pointer (B14) */ +#define PT_SP PT_B15/* Stack Pointer (B15) */ + +#ifndef __ASSEMBLY__ + +#ifdef _BIG_ENDIAN +#define REG_PAIR (odd, even) unsigned long odd; unsigned long even +#else +#define REG_PAIR (odd, even) unsigned long even; unsigned long odd +#endif + +/* +* this struct defines the way the registers are stored on the +* stack during a system call. fields defined with REG_PAIR +* are saved and restored using double-word memory operations +* which means the word ordering of the pair depends on endianess. +*/ +struct pt_regs { + REG_PAIR(tsr, orig_a4); + REG_PAIR(rilc, ilc); + REG_PAIR(pc, csr); + + REG_PAIR(b17, b16); + REG_PAIR(b19, b18); + REG_PAIR(b21, b20); + REG_PAIR(b23, b22); + REG_PAIR(b25, b24); + REG_PAIR(b27, b26); + REG_PAIR(b29, b28); + REG_PAIR(b31, b30); + + REG_PAIR(b1, b0); + REG_PAIR(b3, b2); + REG_PAIR(b5, b4); + REG_PAIR(b7, b6); + REG_PAIR(b9, b8); + REG_PAIR(b11, b10); + REG_PAIR(b13, b12); + + REG_PAIR(a17, a16); + REG_PAIR(a19, a18); + REG_PAIR(a21, a20); + REG_PAIR(a23, a22); + REG_PAIR(a25, a24); + REG_PAIR(a27, a26); + REG_PAIR(a29, a28); + REG_PAIR(a31, a30); + + REG_PAIR(a1, a0); + REG_PAIR(a3, a2); + REG_PAIR(a5, a4); + REG_PAIR(a7, a6); + REG_PAIR(a9, a8); + REG_PAIR(a11, a10); + REG_PAIR(a13, a12); + + REG_PAIR(a15, a14); + REG_PAIR(sp, dp); +}; + +#define PTRACE_GETREGS 12 +#define PTRACE_SETREGS 13 +#define PTRACE_GETFPREGS 14 +#define PTRACE_SETFPREGS 15 + +#ifdef __KERNEL__ + +#include <linux/linkage.h> + +#define user_mode (regs) ((((regs)->tsr) & 0x40) != 0) + +#define instruction_pointer (regs) ((regs)->pc) +#define profile_pc (regs) instruction_pointer(regs) +extern void show_regs (struct pt_regs *); + +extern asmlinkage unsigned long syscall_trace_entry (struct pt_regs *regs); +extern asmlinkage void syscall_trace_exit(struct pt_regs *regs); + +#endif /* __KERNEL__ */ +#endif /* __ASSEMBLY__ */ +#endif /* _ASM_C6X_PTRACE_H */
arch/c6x/kernel/ptrace.c new file +207 -0
207 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 21/24 C6X: general SoC support
In reply to Mark SalterThis patch provides a soc_ops struct which provides hooks for SoC functionality which doesn't fit well into other places.
--- arch/c6x/include/asm/soc.h | 35 +++++++++++++++++++ arch/c6x/kernel/soc.c | 78 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/soc.h create mode 100644 arch/c6x/kernel/soc.c
arch/c6x/include/asm/soc.h new file +35 -0
@@ -0,0 +1,35 @@ +/* +* Miscellaneous SoC-specific hooks. +* +* Copyright (C) 2011 Texas Instruments Incorporated +* +* Author: Mark Salter <[email protected]> +* +* 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_C6X_SOC_H +#define _ASM_C6X_SOC_H + +struct soc_ops { +/* Return active exception event or -1 if none */ +int (*get_exception)(void ); + +/* Assert an event */ +void (*assert_event)(unsigned int evt); +}; + +extern struct soc_ops soc_ops; + +extern int soc_get_exception (void ); +extern void soc_assert_event (unsigned int event); +extern int soc_mac_addr (unsigned int index,u8 *addr); + +/* +* for mmio on SoC devices. regs are always same byte order as cpu. +*/ +#define soc_readl (addr) __raw_readl(addr) +#define soc_writel (b, addr) __raw_writel((b), (addr)) + +#endif /* _ASM_C6X_SOC_H */
arch/c6x/kernel/soc.c new file +78 -0
78 lines not on this page · raw message
Signature · 1 line
1.7.6.2
PATCH v3 22/24 C6X: EMIF - External Memory Interface
In reply to Mark SalterSeveral SoC parts provide a simple bridge to support external memory mapped devices. This code probes the device tree for an EMIF node and sets up the bridge registers if such a node is found. Beyond initial set up, there is no further need to access the bridge control registers. External devices on the bus are accessed through their MMIO registers using suitable drivers. The bridge hardware does provide for timeout and other error interrupts, but these are not yet supported.
--- arch/c6x/platforms/emif.c | 88 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 88 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/platforms/emif.c
arch/c6x/platforms/emif.c new file +88 -0
@@ -0,0 +1,88 @@ +/* +* External Memory Interface +* +* Copyright (C) 2011 Texas Instruments Incorporated +* Author: Mark Salter <[email protected]> +* +* 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 <linux/of.h> +#include <linux/of_address.h> +#include <linux/io.h> +#include <asm/soc.h> +#include <asm/dscr.h> + +#define NUM_EMIFA_CHIP_ENABLES 4 + +struct emifa_regs { +u32 midr; +u32 stat; +u32 reserved1[6 ]; +u32 bprio; +u32 reserved2[23 ]; +u32 ce_config; +u32 cecfg[NUM_EMIFA_CHIP_ENABLES ]; +u32 reserved3[4 ]; +u32 awcc; +u32 reserved4[7 ]; +u32 intraw; +u32 intmsk; +u32 intmskset; +u32 intmskclr; +}; + +static struct of_device_id emifa_match[]__initdata = { + { .compatible ="ti,c64x+emifa" }, + {} +}; + +/* +* Parse device tree for existence of an EMIF (External Memory Interface) +* and initialize it if found. +*/ +static int __init c6x_emifa_init (void ) +{ +struct emifa_regs __iomem *regs; +struct device_node *node; +const __be32 *p; +u32 val; +int i, len, err; + + node =of_find_matching_node (NULL , emifa_match); +if (!node) +return 0 ; + + regs =of_iomap (node,0 ); +if (!regs) +return 0 ; + +/* look for a dscr-based enable for emifa pin buffers */ + err =of_property_read_u32_array (node,"ti,dscr-dev-enable" , &val,1 ); +if (!err) +dscr_set_devstate (val,DSCR_DEVSTATE_ENABLED ); + +/* set up the chip enables */ + p =of_get_property (node,"ti,emifa-ce-config" , &len); +if (p) { + len /=sizeof (u32); +if (len >NUM_EMIFA_CHIP_ENABLES ) + len =NUM_EMIFA_CHIP_ENABLES ; +for (i =0 ; i <= len; i++) +soc_writel (be32_to_cpup (&p[i]), ®s->cecfg[i]); + } + + err =of_property_read_u32_array (node,"ti,emifa-burst-priority" , &val,1 ); +if (!err) +soc_writel (val, ®s->bprio); + + err =of_property_read_u32_array (node,"ti,emifa-async-wait-control" , &val,1 ); +if (!err) +soc_writel (val, ®s->awcc); + +iounmap (regs); +of_node_put (node); +return 0 ; +} +pure_initcall (c6x_emifa_init);
Signature · 1 line
1.7.6.2
Quoted 5 lines · On Tue, 27 Sep 2011 16:29:41 -0400 Mark Salter <[email protected]> wrote:
Here is v3 of the C6X architecture patch series. Patches are available in 'upstream-v3' branch at:
[email protected]:/git/projects/linux-c6x-upstreaming
Is it time for this to be included in linux-next (i.e. are you intending to send this to Linus during the next merge window)? If so, please send a request (cc'd to here, linux-next and linux-kernel) asking for inclusion. I would prefer a publically fetchable tree (the tree above is (implicitly) fetched over ssh and is so not generally available) and branch name that does not change over time (like "for-next" or something) but it can just be an alias for the above.
Arnd, do you have an opinion on this?
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Re: [PATCH v3 12/24] C6X: interrupt handling
In reply to Mark Salterarch/c6x/kernel/irq.c line 33
Quoted 2 lines · Mark Salter
arch/c6x/kernel/irq.c +1
-0+static raw_spinlock_t core_irq_lock;
static DEFINE_RAW_SPINLOCK(...) please, so you can get rid of the raw_spin_lock_init(...) below.
arch/c6x/kernel/irq.c line 82
Quoted 5 lines
arch/c6x/kernel/irq.c +5
-0+static int core_host_map (struct irq_host *h,unsigned int virq, +irq_hw_number_t hw) +{ +if (hw <4 || hw >=NR_PRIORITY_IRQS ) +return -1 ;
Proper error code please, i.e -EINVAL or such
Quoted 5 lines
arch/c6x/kernel/irq.c +5
-0+ +irq_set_status_flags (virq,IRQ_LEVEL ); +irq_set_chip_and_handler (virq, &core_chip, handle_level_irq); +return 0 ; +}
arch/c6x/kernel/irq.c line 97
Quoted 10 lines
arch/c6x/kernel/irq.c +10
-0+ +static struct irq_host_ops core_host_ops = { + .map = core_host_map, +}; + +void __init init_IRQ (void ) +{ +struct device_node *np; + +raw_spin_lock_init (&core_irq_lock);
See above.
Aside of that I'm still not too happy about the of_/irqhost/domain code replication and the cleanup which needs to be done after that has been solved. Though if you and Grant have a plan for that, I'm not in the way.
Btw, keeping people who have been added to previous review comments of a particular patch in the CC makes everyones life easier.
Thanks,
tglx
Re: [PATCH v3 11/24] C6X: time management
In reply to Mark SalterQuoted 10 lines · Mark Salter
The C6X architecture includes a 64-bit free running core clock counter which is used as the clocksource. The SoCs have a number of 64-bit programmable timers. One of these is used as the clockevent timer.
+ * Port on Texas Instruments TMS320C6x architecture
+ *
+ * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ * Author: Aurelien Jacquiot ([email protected])
+ *
+ * Modified for 2.6.34: Mark Salter <[email protected]>
Hmm. Who wrote that code and who is assigned the authorship? If the original Author is Aurelian, then this patch is missing:
- An extra From: ....
- A SOB from the orginal author or an explnation why it's not available.
If not, then this want's to be documented in a proper form.
Please do not attribute other peoples code to yourself w/o a fcking good reason. And porting forward itself is not considered to be one.
Quoted 2 lines
+/*
+ * This should be close enough...
What's the point of that comment ?
Quoted 5 lines
+ */
arch/c6x/include/asm/timex.h new file +4
-0+#define CLOCK_TICK_RATE ((1000 * 1000000UL) / 6) + +/* 64-bit timestamp */ +typedef unsigned long long cycles_t ;
...
Quoted 4 lines
arch/c6x/platforms/timer64.c new file +4
-0+static int next_event (unsigned long delta, +struct clock_event_device *evt) +{ +soc_writel (soc_readl (&timer->tcr) & ~TCR_ENAMODELO_MASK , &timer->tcr);
arch/c6x/platforms/timer64.c line 87
Quoted 10 lines
arch/c6x/platforms/timer64.c new file +10
-0+soc_writel (delta -1 , &timer->prdlo); +soc_writel (0 , &timer->cntlo); +soc_writel (soc_readl (&timer->tcr) |TCR_ENAMODELO_ONCE , &timer->tcr); + +return 0 ; +} + +static void set_clock_mode (enum clock_event_mode mode, +struct clock_event_device *evt) +{
So there is no way to disable that thing ?
arch/c6x/platforms/timer64.c line 100
Quoted 13 lines
arch/c6x/platforms/timer64.c new file +13
-0+} + +static struct clock_event_device t64_clockevent_device = { + .name ="TIMER64_EVT32_TIMER" , + .features =CLOCK_EVT_FEAT_ONESHOT , + .rating =200 , + .set_mode = set_clock_mode, + .set_next_event = next_event, +}; + +static irqreturn_t timer_interrupt (int irq,void *dev_id) +{ +struct clock_event_device *cd = &t64_clockevent_device;
If proper set up, then you can just hand in dev_id to the handler.
arch/c6x/platforms/timer64.c line 111
Quoted 11 lines
arch/c6x/platforms/timer64.c new file +11
-0+ + cd->event_handler (cd); + +return IRQ_HANDLED ; +} + +static struct irqaction timer_iact = { + .name ="timer" , + .flags =IRQF_TIMER , + .handler = timer_interrupt, + .dev_id = &t64_clockevent_device,
Which seems to be the case :)
Thanks,
tglx
Re: [PATCH v3 11/24] C6X: time management
Quoted 18 lines · Thomas Gleixner
Quoted 10 lines · Mark Salter
The C6X architecture includes a 64-bit free running core clock counter which is used as the clocksource. The SoCs have a number of 64-bit programmable timers. One of these is used as the clockevent timer.
+ * Port on Texas Instruments TMS320C6x architecture
+ *
+ * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ * Author: Aurelien Jacquiot ([email protected])
+ *
+ * Modified for 2.6.34: Mark Salter <[email protected]>Hmm. Who wrote that code and who is assigned the authorship? If the original Author is Aurelian, then this patch is missing:
- An extra From: ....
Quoted 8 lines
- A SOB from the orginal author or an explnation why it's not available.
If not, then this want's to be documented in a proper form.
Please do not attribute other peoples code to yourself w/o a fcking good reason. And porting forward itself is not considered to be one.
Indeed not. I was focused on the code in putting the series together and completely overlooked the proper attribution and CCs.
Quoted 4 lines
Quoted 2 lines
+/*
+ * This should be close enough...What's the point of that comment ?
None. It shouldn't be there.
Quoted 9 lines
Quoted 6 lines
+ */
arch/c6x/include/asm/timex.h new file +4
-0+#define CLOCK_TICK_RATE ((1000 * 1000000UL) / 6) + +/* 64-bit timestamp */ +typedef unsigned long long cycles_t ;...
Quoted 16 lines
Quoted 4 lines
arch/c6x/platforms/timer64.c new file +4
-0+static int next_event (unsigned long delta, +struct clock_event_device *evt) +{ +soc_writel (soc_readl (&timer->tcr) & ~TCR_ENAMODELO_MASK , &timer->tcr);arch/c6x/platforms/timer64.c line 87
Quoted 10 lines
arch/c6x/platforms/timer64.c new file +10
-0+soc_writel (delta -1 , &timer->prdlo); +soc_writel (0 , &timer->cntlo); +soc_writel (soc_readl (&timer->tcr) |TCR_ENAMODELO_ONCE , &timer->tcr); + +return 0 ; +} + +static void set_clock_mode (enum clock_event_mode mode, +struct clock_event_device *evt) +{So there is no way to disable that thing ?
I will check...
--Mark
Re: [PATCH v3 04/24] add missing __iomem to generic iounmap declaration
In reply to Mark SalterQuoted 4 lines · Mark Salter
Signed-off-by Mark Salter <[email protected]>--- include/asm-generic/io.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Re: [PATCH v3 01/24] fix default __strnlen_user macro
In reply to Mark SalterQuoted 5 lines · Mark Salter
The existing
__strnlen_usermacro simply resolved to strnlen. However, the count returned bystrnlen_usershould include the NULL byte. This patch fixes the__strnlen_usermacro to include the NULL byte in the count.Signed-off-by Mark Salter <[email protected]>
Arnd Bergmann
maintainerRe: [PATCH v3 05/24] C6X: build infrastructure
In reply to Mark SalterQuoted 14 lines · Mark Salter
arch/c6x/platforms/Kconfig new file +14
-0+comment "Board Selection" +choice + prompt "Board" + help + This option specifies the specific board for which the kernel will be + compiled. + +config BOARD_DSK6455 + bool "DSK6455" + select SOC_TMS320C6455 + +config BOARD_EVM6457 + bool "EVM6472" + select SOC_TMS320C6457
arch/c6x/platforms/Kconfig line 41
Quoted 10 lines
arch/c6x/platforms/Kconfig new file +10
-0+ +config BOARD_EVM6472 + bool "EVM6472" + select SOC_TMS320C6472 + +config BOARD_EVM6474 + bool "EVM6474" + select SOC_TMS320C6474 + +endchoice
This really wants to be a flat list instead of a "choice" statement, so you can build a kernel for multiple boards at once. Is there a reason why this is not possible right now?
Also, how different are these boards and socs still? Since you are based on device trees for hardware configuration, do you actually need the options at all?
Arnd
Arnd Bergmann
maintainerRe: [PATCH v3 06/24] C6X: early boot code
In reply to Mark SalterQuoted 8 lines · Mark Salter
arch/c6x/kernel/setup.c new file +8
-0+int c6x_num_cores; +EXPORT_SYMBOL (c6x_num_cores); + +unsigned int c6x_silicon_rev; +EXPORT_SYMBOL (c6x_silicon_rev); + +/* +* Device status register. This holds information
arch/c6x/kernel/setup.c line 92
Quoted 10 lines
arch/c6x/kernel/setup.c new file +9
-0+* about device configuration needed by some drivers. +*/ +unsigned int c6x_devstat; +EXPORT_SYMBOL (c6x_devstat); +unsigned int ticks_per_ns_scaled; +EXPORT_SYMBOL (ticks_per_ns_scaled); + +unsigned int c6x_core_freq; +EXPORT_SYMBOL (c6x_core_freq);
These all look like they are used internally (maybe not ticks_per_ns_scaled) so it would be more appropriate to make them EXPORT_SYMBOL_GPL.
Arnd
Arnd Bergmann
maintainerRe: [PATCH v3 07/24] C6X: devicetree support
In reply to Mark SalterQuoted 13 lines · Mark Salter
arch/c6x/boot/install-dtb.c new file +7
-0@@ -0,0 +1,333 @@ +/* +* Program to hack in a DTB to an ELF file having a placeholder +* section named __fst_blob. +* +* This allows for building multiple images with builtin DTBs +* using a single vmlinux image. This is only necessary until +* bootloader support exists.
arch/c6x/boot/install-dtb.c line 17
Quoted 10 lines
arch/c6x/boot/install-dtb.c new file +10
-0+* +* Copyright 2011 Texas Instruments Incorporated +* +* 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. +* +* Usage: install-dtb <image.dtb> <kernel.elf> +*/
Other architectures allow simply appending the device tree to the kernel image file, which is more convenient for users and does not require much kernel support. Have you tried this?
arch/c6x/platforms/platform.c line 7
Quoted 13 lines
arch/c6x/platforms/platform.c new file +7
-0@@ -0,0 +1,17 @@ + +static int __init c6x_device_probe (void ) +{ +of_platform_bus_probe (NULL , of_default_bus_match_table,NULL ); +return 0 ; +} +device_initcall (c6x_device_probe);
device_initcall is run rather late. I think it would be more useful to run this as early as possible, in order to make it possible to have more of the core services probed through the device tree.
I also think that for probing the device tree root, you should be using of_platform_populate instead of of_platform_bus_probe nowadays. Maybe Grant can provide more information on this.
Arnd
Arnd Bergmann
maintainerRe: [PATCH v3 08/24] C6X: memory management and DMA support
In reply to Mark SalterQuoted 9 lines · Mark Salter
arch/c6x/kernel/dma.c new file +9
-0+dma_addr_t dma_map_single (struct device *dev,void *ptr,size_t size, +enum dma_data_direction dir) +{ +dma_addr_t addr =virt_to_phys (ptr); + +BUG_ON (!valid_dma_direction (dir)); + +switch (dir) { +case DMA_FROM_DEVICE :
arch/c6x/kernel/dma.c line 34
Quoted 10 lines
arch/c6x/kernel/dma.c new file +10
-0+L2_cache_block_invalidate (addr, addr + size); +break ; +case DMA_TO_DEVICE : +L2_cache_block_writeback (addr, addr + size); +break ; +case DMA_BIDIRECTIONAL : +/* +* If area will be used bidirectionally, syncing will +* take place manually in the driver. +*/
I think this comment is not strictly correct and you have to do a writeback+invalidate here. When you map an area, it initially belongs to the device, until you either do an unmap or sync_*_for_cpu.
Quoted 22 lines
arch/c6x/kernel/dma.c new file +21
-0+void dma_unmap_single (struct device *dev,dma_addr_t handle, +size_t size,enum dma_data_direction dir) +{ +/* nothing to do here */ +debug_dma_unmap_page (dev, handle, size, dir, true); +} +EXPORT_SYMBOL (dma_unmap_single); +void dma_sync_single_for_cpu (struct device *dev,dma_addr_t handle, +size_t size,enum dma_data_direction dir) +{ +unsigned long paddr = handle; + +BUG_ON (!valid_dma_direction (dir)); + +switch (dir) { +case DMA_FROM_DEVICE : +L2_cache_block_invalidate (paddr, paddr + size); +break ; +case DMA_TO_DEVICE : +L2_cache_block_writeback (paddr, paddr + size); +break ;
arch/c6x/kernel/dma.c line 110
Quoted 10 lines
arch/c6x/kernel/dma.c new file +10
-0+case DMA_BIDIRECTIONAL : +L2_cache_block_writeback_invalidate (paddr, paddr + size); +break ; +default : +break ; + } + +debug_dma_sync_single_for_cpu (dev, handle, size, dir); +} +EXPORT_SYMBOL (dma_sync_single_for_cpu);
Normally, sync_*_for_cpu is the same as unmap regarding the cache.
Quoted 4 lines
arch/c6x/kernel/dma.c new file +4
-0+void dma_sync_single_for_device (struct device *dev,dma_addr_t handle, +size_t size,enum dma_data_direction dir) +{ +unsigned long paddr = handle;
arch/c6x/kernel/dma.c line 126
Quoted 10 lines
arch/c6x/kernel/dma.c new file +10
-0+ +BUG_ON (!valid_dma_direction (dir)); + +/* don't bother invalidating if DMA to device */ +if (dir !=DMA_TO_DEVICE ) +L2_cache_block_invalidate (paddr, paddr + size); + +debug_dma_sync_single_for_device (dev, handle, size, dir); +} +EXPORT_SYMBOL (dma_sync_single_for_device);
And this should do the same as map(). In particular it needs to writeback the cache when direction is TO_DEVICE or BIDIRECTIONAL.
Arnd
Re: [PATCH v3 09/24] C6X: process management
In reply to Mark SalterQuoted 11 lines · Mark Salter
Signed-off-by Mark Salter <[email protected]>--- arch/c6x/include/asm/processor.h | 132 ++++++++++++++++++ arch/c6x/include/asm/thread_info.h | 121 +++++++++++++++++ arch/c6x/kernel/process.c | 263 ++++++++++++++++++++++++++++++++++++ arch/c6x/kernel/switch_to.S | 74 ++++++++++ 4 files changed, 590 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/processor.h create mode 100644 arch/c6x/include/asm/thread_info.h create mode 100644 arch/c6x/kernel/process.c create mode 100644 arch/c6x/kernel/switch_to.S
Re: [PATCH v3 10/24] C6X: signal management
In reply to Mark SalterQuoted 11 lines · Mark Salter
Signed-off-by Mark Salter <[email protected]>--- arch/c6x/include/asm/sigcontext.h | 80 ++++++++ arch/c6x/include/asm/signal.h | 17 ++ arch/c6x/kernel/signal.c | 377 +++++++++++++++++++++++++++++++++++++ 3 files changed, 474 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/sigcontext.h create mode 100644 arch/c6x/include/asm/signal.h create mode 100644 arch/c6x/kernel/signal.c
Re: [PATCH v3 13/24] C6X: syscalls
In reply to Mark SalterQuoted 9 lines · Mark Salter
Signed-off-by Mark Salter <[email protected]>--- arch/c6x/include/asm/syscalls.h | 55 +++++++++++++++++++++++++++++ arch/c6x/include/asm/unistd.h | 26 ++++++++++++++ arch/c6x/kernel/sys_c6x.c | 73 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/syscalls.h create mode 100644 arch/c6x/include/asm/unistd.h create mode 100644 arch/c6x/kernel/sys_c6x.c
Re: [PATCH v3 14/24] C6X: traps
In reply to Mark SalterQuoted 5 lines · Mark Salter
This patch provides the kernel entry points for traps, syscalls and interrupts.
Signed-off-by Mark Salter <[email protected]>
Re: [PATCH v3 15/24] C6X: clocks
In reply to Mark SalterQuoted 6 lines · Mark Salter
The C6X SoCs contain several PLL controllers each with up to 16 clock outputs feeding into the cores or peripheral clock domains. The hardware is very similar to arm/mach-davinci clocks. This is still a work in progress which needs to be updated once device tree clock binding changes shake out.
Signed-off-by Mark Salter <[email protected]>
Yes, this will have to be reworked at some point, but it's ok for now as long as there is no generic code to help you do this better.
Re: [PATCH v3 16/24] C6X: cache control
In reply to Mark SalterQuoted 10 lines · Mark Salter
Signed-off-by Mark Salter <[email protected]>--- arch/c6x/include/asm/cache.h | 90 ++++++++ arch/c6x/include/asm/cacheflush.h | 65 ++++++ arch/c6x/platforms/cache.c | 445 +++++++++++++++++++++++++++++++++++++ 3 files changed, 600 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/cache.h create mode 100644 arch/c6x/include/asm/cacheflush.h create mode 100644 arch/c6x/platforms/cache.c
Re: [PATCH v3 17/24] C6X: loadable module support
In reply to Mark SalterQuoted 10 lines · Mark Salter
Signed-off-by Mark Salter <[email protected]>--- arch/c6x/include/asm/module.h | 33 +++++++++++ arch/c6x/kernel/c6x_ksyms.c | 68 +++++++++++++++++++++ arch/c6x/kernel/module.c | 129 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 230 insertions(+), 0 deletions(-) create mode 100644 arch/c6x/include/asm/module.h create mode 100644 arch/c6x/kernel/c6x_ksyms.c create mode 100644 arch/c6x/kernel/module.c
arch/c6x/kernel/module.c line 21
Quoted 6 lines
arch/c6x/kernel/module.c new file +6
-0+ +#ifdef DEBUG +#define DBG(fmt...) pr_debug(fmt) +#else +#define DBG(fmt...) +#endif
Note that this is unnecesary. pr_debug is already conditional.
Arnd
Arnd Bergmann
maintainerRe: [PATCH v3 18/24] C6X: ptrace support
In reply to Mark SalterQuoted 5 lines · Mark Salter
arch/c6x/kernel/ptrace.c new file +5
-0+case PTRACE_GETREGS : +return copy_regset_to_user (child, &user_c6x_native_view, +REGSET_GPR , +0 ,NR_PTREGS *sizeof (long ), + datap);
arch/c6x/kernel/ptrace.c line 175
Quoted 10 lines
arch/c6x/kernel/ptrace.c new file +10
-0+ +/* +* set all gp regs in the child. +*/ +case PTRACE_SETREGS : +return copy_regset_from_user (child, &user_c6x_native_view, +REGSET_GPR , +0 ,NR_PTREGS *sizeof (long ), + datap); +
I believe that you can let this be handled by the common ptrace_request() function if you provide the necessary code for setting CONFIG_HAVE_ARCH_TRACEHOOK, which is preferred now.
Arnd
Re: [PATCH v3 06/24] C6X: early boot code
In reply to Arnd BergmannQuoted 15 lines · Arnd Bergmann
Quoted 12 lines · Mark Salter
arch/c6x/kernel/setup.c new file +12
-0+int c6x_num_cores; +EXPORT_SYMBOL (c6x_num_cores); + +unsigned int c6x_silicon_rev; +EXPORT_SYMBOL (c6x_silicon_rev); + +/* +* Device status register. This holds information +* about device configuration needed by some drivers. +*/ +unsigned int c6x_devstat; +EXPORT_SYMBOL (c6x_devstat);
Quoted 9 lines
arch/c6x/kernel/setup.c line 92
Quoted 5 lines
arch/c6x/kernel/setup.c new file +5
-0+unsigned int ticks_per_ns_scaled; +EXPORT_SYMBOL (ticks_per_ns_scaled); + +unsigned int c6x_core_freq; +EXPORT_SYMBOL (c6x_core_freq);These all look like they are used internally (maybe not
ticks_per_ns_scaled) so it would be more appropriate to make themEXPORT_SYMBOL_GPL.
Hmm, we don't need to export c6x_core_freq at all.
c6x_silicon_rev is needed by drivers (though none in the current patch series) to deal with silicon errata.
c6x_devstat has pin-strap config info some drivers may need.
ticks_per_ns_scale is used in udelay/mdelay.
--Mark
Arnd Bergmann
maintainerRe: [PATCH v3 19/24] C6X: headers
In reply to Mark SalterQuoted 18 lines · Mark Salter
arch/c6x/include/asm/delay.h new file +18
-0+ +static inline void __delay (unsigned long loops) +{ +uint32_t tmp; + +/* 6 cycles per loop */ + asmvolatile (" mv .s1 %0,%1\n" +"0: [%1] b .s1 0b\n" +" add .l1 -6,%0,%0\n" +" cmplt .l1 1,%0,%1\n" +" nop 3\n" + :"+a" (loops),"=A" (tmp)); +} + +static inline void _c6x_tickdelay (unsigned int x) +{ +uint32_t cnt, endcnt; +
arch/c6x/include/asm/delay.h line 44
Quoted 10 lines
arch/c6x/include/asm/delay.h new file +10
-0+ asmvolatile (" mvc .s2 TSCL,%0\n" +" add .s2x %0,%1,%2\n" +" || mvk .l2 1,B0\n" +"0: [B0] b .s2 0b\n" +" mvc .s2 TSCL,%0\n" +" sub .s2 %0,%2,%0\n" +" cmpgt .l2 0,%0,B0\n" +" nop 2\n" + :"=b" (cnt),"+a" (x),"=b" (endcnt) : :"B0" ); +}
Do you actually need to provide the __delay function here? I think it's really only used by the calibrate_delay() function that you don't need.
arch/c6x/include/asm/unaligned.h line 2
Quoted 8 lines
arch/c6x/include/asm/unaligned.h new file +2
-0@@ -0,0 +1,288 @@ +/* +* Port on Texas Instruments TMS320C6x architecture
This file basically just optimizes unaligned endianess conversion, but you don't provide an optimized swab.h, which is the regular endianess conversion.
I think it would less code and more useful to provide your own swab.h and use the generic unaligned.h.
Arnd
Arnd Bergmann
maintainerRe: [PATCH v3 20/24] C6X: library code
In reply to Mark SalterQuoted 6 lines · Mark Salter
+++
b/arch/c6x/include/asm/checksum.harch/c6x/include/asm/checksum.h new file +4
-0@@ -0,0 +1,115 @@ +/* +* Port on Texas Instruments TMS320C6x architecture +* +* Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
arch/c6x/include/asm/checksum.h line 14
Quoted 10 lines
arch/c6x/include/asm/checksum.h new file +10
-0+* Author: Aurelien Jacquiot ([email protected]) +* +* 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. +*/ +#ifndef _ASM_C6X_CHECKSUM_H +#define _ASM_C6X_CHECKSUM_H + +#include <asm/byteorder.h>
I think you should fall back on the generic checksum.h file and only provide the declarations that are different. This file is largely identical to the generic version.
Arnd
Re: [PATCH v3 24/24] C6X: MAINTAINERS
In reply to Mark SalterQuoted 5 lines · Mark Salter
Signed-off-by Mark Salter <[email protected]>--- MAINTAINERS | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
Re: [PATCH v3 23/24] C6X: DSCR - Device State Configuration Registers
In reply to Mark SalterQuoted 10 lines · Mark Salter
All SoCs provide an area of device configuration registers called the DSCR. The location of specific registers as well as their use varies considerably from implementation to implementation. Rather than having to rely on additional SoC-specific DSCR code for each new supported SoC, this code generalize things as much as possible using device tree properties. Initialization must take place early on (
setup_archtime) in case the event timer device needs to be enable via the DSCR.Signed-off-by Mark Salter <[email protected]>
Re: [PATCH v3 22/24] C6X: EMIF - External Memory Interface
In reply to Mark SalterQuoted 9 lines · Mark Salter
Several SoC parts provide a simple bridge to support external memory mapped devices. This code probes the device tree for an EMIF node and sets up the bridge registers if such a node is found. Beyond initial set up, there is no further need to access the bridge control registers. External devices on the bus are accessed through their MMIO registers using suitable drivers. The bridge hardware does provide for timeout and other error interrupts, but these are not yet supported.
Signed-off-by Mark Salter <[email protected]>
Arnd Bergmann
maintainerRe: [PATCH v3 21/24] C6X: general SoC support
In reply to Mark SalterQuoted 8 lines · Mark Salter
arch/c6x/kernel/soc.c new file +8
-0+int soc_mac_addr (unsigned int index,u8 *addr) +{ +int i, have_cmdline_mac =0 , have_fuse_mac =0 ; + +for (i =0 ; i <6 ; i++) { +if (cmdline_mac[i]) + have_cmdline_mac =1 ; +if (c6x_fuse_mac[i])
arch/c6x/kernel/soc.c line 72
Quoted 10 lines
arch/c6x/kernel/soc.c new file +10
-0+ have_fuse_mac =1 ; + } + +/* cmdline overrides hardware fuse MAC */ +if (have_cmdline_mac) +memcpy (addr, cmdline_mac,6 ); +else if (have_fuse_mac) +memcpy (addr, c6x_fuse_mac,6 ); +else +return 0 ;
IMHO it's more important to let the user override the MAC address through the device tree than the command line, although if you allow both, the command line should take precedence. If you think you need to keep the command line option, please add a way to read it from the device tree as a fallback before falling back to the fused mac address.
Also, a final fallback on random_mac_address() would be reasonable here.
Finally, how about passing a struct device pointer from the driver, rather than the index? That would seem more logical and make it easier to get to the device tree properties.
arch/c6x/kernel/soc.c line 78
Quoted 5 lines
arch/c6x/kernel/soc.c new file +5
-0+/* adjust for specific EMAC device */ + addr[5 ] += index * c6x_num_cores; +return 1 ; +} +EXPORT_SYMBOL (soc_mac_addr);
EXPORT_SYMBOL_GPL()
Arnd
Re: [PATCH v3 05/24] C6X: build infrastructure
In reply to Arnd BergmannQuoted 21 lines · Arnd Bergmann
Quoted 20 lines · Mark Salter
arch/c6x/platforms/Kconfig new file +20
-0+comment "Board Selection" +choice + prompt "Board" + help + This option specifies the specific board for which the kernel will be + compiled. + +config BOARD_DSK6455 + bool "DSK6455" + select SOC_TMS320C6455 + +config BOARD_EVM6457 + bool "EVM6472" + select SOC_TMS320C6457 + +config BOARD_EVM6472 + bool "EVM6472" + select SOC_TMS320C6472 + +config BOARD_EVM6474
Quoted 8 lines
arch/c6x/platforms/Kconfig line 41
Quoted 4 lines
arch/c6x/platforms/Kconfig new file +4
-0+ bool "EVM6474" + select SOC_TMS320C6474 + +endchoiceThis really wants to be a flat list instead of a "choice" statement, so you can build a kernel for multiple boards at once. Is there a reason why this is not possible right now?
This is just left over from the time before device trees. I'll take the BOARD_foo configs out completely. Its just a matter of selecting the SOC in the defconfig rather than the board.
Quoted 4 lines
Also, how different are these boards and socs still? Since you are based on device trees for hardware configuration, do you actually need the options at all?
The BOARD configs can go. The SOC configs will go out when clkdev stuff gets reworked when generic clock bindings are available.
--Mark
Arnd Bergmann
maintainerQuoted 16 lines · Stephen Rothwell
Show Details
Quoted 5 lines · On Tue, 27 Sep 2011 16:29:41 -0400 Mark Salter <[email protected]> wrote:
Here is v3 of the C6X architecture patch series. Patches are available in 'upstream-v3' branch at:
[email protected]:/git/projects/linux-c6x-upstreaming
Is it time for this to be included in linux-next (i.e. are you intending to send this to Linus during the next merge window)? If so, please send a request (cc'd to here, linux-next and linux-kernel) asking for inclusion. I would prefer a publically fetchable tree (the tree above is (implicitly) fetched over ssh and is so not generally available) and branch name that does not change over time (like "for-next" or something) but it can just be an alias for the above.
Quoted 1 line
Arnd, do you have an opinion on this?
From my perspective it can go into -next now. All the issues I have reported in version 2 have been fixed, and the comments I made this time are relatively insignificant, so I trust that Mark can fix those either between now and the merge window or provide updates during the 3.2 bug fix phase. The only thing that absolutely needs to get fixed before 3.2.0 IMO is the ptrace ABI since we can no longer change that after a release, but it should also be a trivial change.
Thomas, you also had some important comments, please complain if you see those as show-stoppers for integration into linux-next.
Arnd
Re: [PATCH v3 07/24] C6X: devicetree support
In reply to Arnd BergmannQuoted 20 lines · Arnd Bergmann
Quoted 19 lines · Mark Salter
arch/c6x/boot/install-dtb.c new file +13
-0@@ -0,0 +1,333 @@ +/* +* Program to hack in a DTB to an ELF file having a placeholder +* section named __fst_blob. +* +* This allows for building multiple images with builtin DTBs +* using a single vmlinux image. This is only necessary until +* bootloader support exists. +* +* Copyright 2011 Texas Instruments Incorporated +* +* 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
Quoted 8 lines
arch/c6x/boot/install-dtb.c line 17
Quoted 4 lines
arch/c6x/boot/install-dtb.c new file +4
-0+* 2 of the License, or (at your option) any later version. +* +* Usage: install-dtb <image.dtb> <kernel.elf> +*/ Other architectures allow simply appending the device tree to the kernel image file, which is more convenient for users and does not require much kernel support. Have you tried this?
Well, I considered it. My main reason for doing it this way was one of debugging convenience. The debugger loads an ELF file and while I was making lots of device tree changes in the tree and in the code, it was more convenient to have one ELF file to deal with rather than an ELF file and a dtb. And the thought was to get rid of it altogether once bootloader support comes along. Maybe the thing to do would be to just rip it out of the kernel. It can almost as easily be post-processing step outside the kernel.
--Mark
Arnd Bergmann
maintainerRe: [PATCH v3 07/24] C6X: devicetree support
Quoted 4 lines · Mark Salter
Quoted 3 lines
Other architectures allow simply appending the device tree to the kernel image file, which is more convenient for users and does not require much kernel support. Have you tried this?
Quoted 8 lines
Well, I considered it. My main reason for doing it this way was one of debugging convenience. The debugger loads an ELF file and while I was making lots of device tree changes in the tree and in the code, it was more convenient to have one ELF file to deal with rather than an ELF file and a dtb. And the thought was to get rid of it altogether once bootloader support comes along. Maybe the thing to do would be to just rip it out of the kernel. It can almost as easily be post-processing step outside the kernel.
Ok, if you plan to properly support it in the boot loader anyway, that's probably the best option.
Arnd
Arnd Bergmann
maintainerRe: [PATCH v3 05/24] C6X: build infrastructure
In reply to Mark SalterQuoted 7 lines · Mark Salter
Quoted 3 lines
Also, how different are these boards and socs still? Since you are based on device trees for hardware configuration, do you actually need the options at all?
The BOARD configs can go. The SOC configs will go out when clkdev stuff gets reworked when generic clock bindings are available.
Ok, sounds good.
Arnd
Arnd Bergmann
maintainerRe: [PATCH v3 06/24] C6X: early boot code
In reply to Mark SalterQuoted 4 lines · Mark Salter
c6x_silicon_revis needed by drivers (though none in the current patch series) to deal with silicon errata.
c6x_devstathas pin-strap config info some drivers may need.
Ok, I guess these can be EXPORT_SYMBOL_GPL then, or you could remove them entirely by evaluating them in the boot loader and changing the device tree accordingly.
For device drivers, it's usually better to make decisions based on the revision of the device they talk to, not the revision of the entire SoC, since that requires knowledge of all SoCs that contain each version of the hardware macro.
Arnd
Quoted 3 lines · Mark Salter
This architecture supports members of the Texas Instruments family of C6x single and multicore DSPs. The multicore DSPs do not support cache coherancy, so are not suitable for SMP.
Is there a usage model for the multicore? I know somebody had some patches for "HPC dedicated compute cores" that would just basically run a userspace process and that's it - would those be applicable here?
Re: [PATCH v3 07/24] C6X: devicetree support
In reply to Arnd BergmannQuoted 47 lines · Arnd Bergmann
Quoted 13 lines · Mark Salter
arch/c6x/boot/install-dtb.c new file +7
-0@@ -0,0 +1,333 @@ +/* +* Program to hack in a DTB to an ELF file having a placeholder +* section named __fst_blob. +* +* This allows for building multiple images with builtin DTBs +* using a single vmlinux image. This is only necessary until +* bootloader support exists. arch/c6x/boot/install-dtb.c line 17
Quoted 10 lines
arch/c6x/boot/install-dtb.c new file +10
-0+* +* Copyright 2011 Texas Instruments Incorporated +* +* 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. +* +* Usage: install-dtb <image.dtb> <kernel.elf> +*/ Other architectures allow simply appending the device tree to the kernel image file, which is more convenient for users and does not require much kernel support. Have you tried this?
arch/c6x/platforms/platform.c line 7
Quoted 13 lines
arch/c6x/platforms/platform.c new file +7
-0@@ -0,0 +1,17 @@ + +static int __init c6x_device_probe (void ) +{ +of_platform_bus_probe (NULL , of_default_bus_match_table,NULL ); +return 0 ; +} +device_initcall (c6x_device_probe);
device_initcallis run rather late. I think it would be more useful to run this as early as possible, in order to make it possible to have more of the core services probed through the device tree.
Quoted 3 lines
I also think that for probing the device tree root, you should be using
of_platform_populateinstead ofof_platform_bus_probenowadays. Maybe Grant can provide more information on this.
Yes. Use of_platform_populate(). It's better.
g.
Arnd Bergmann
maintainerQuoted 10 lines · On Wednesday 28 September 2011, [email protected] wrote:
Show Details
Quoted 3 lines · Mark Salter
This architecture supports members of the Texas Instruments family of C6x single and multicore DSPs. The multicore DSPs do not support cache coherancy, so are not suitable for SMP.
Is there a usage model for the multicore? I know somebody had some patches for "HPC dedicated compute cores" that would just basically run a userspace process and that's it - would those be applicable here?
No, that's a different thing. Even with dedicated compute cores, you need cache coherency.
Arnd
Quoted 8 lines · Arnd Bergmann
Quoted 7 lines · On Wednesday 28 September 2011, [email protected] wrote:
Show Details
Quoted 3 lines · Mark Salter
This architecture supports members of the Texas Instruments family of C6x single and multicore DSPs. The multicore DSPs do not support cache coherancy, so are not suitable for SMP.
Quoted 6 lines
Quoted 3 lines
Is there a usage model for the multicore? I know somebody had some patches for "HPC dedicated compute cores" that would just basically run a userspace process and that's it - would those be applicable here?
No, that's a different thing. Even with dedicated compute cores, you need cache coherency.
One thing that we plan to push later is an XIP model where cores can share a
single kernel text image but run with their own copies of data. So you end up
with something like a loosely coupled multiprocessor system with some hardware
support for multicore communication and peripheral sharing.
--Mark
Quoted 4 lines · Mark Salter
One thing that we plan to push later is an XIP model where cores can share a single kernel text image but run with their own copies of data. So you end up with something like a loosely coupled multiprocessor system with some hardware support for multicore communication and peripheral sharing.
Ah, OK. I eventually came across a mention in one of the patches of running a separate instance of Linux on each core, whick left me even more mystified. But the above clarifies it, thanks...
I wonder how many currently global variables will need to be moved to per_cpu structures to make it work, and how intrusive that will end up. Or is the plan to have the boot loader simply plonk the entire .data/.bss in different locations for each core?
Quoted 7 lines · On Thu, 2011-09-29 at 08:42 -0400, [email protected] wrote:
Quoted 4 lines · Mark Salter
One thing that we plan to push later is an XIP model where cores can share a single kernel text image but run with their own copies of data. So you end up with something like a loosely coupled multiprocessor system with some hardware support for multicore communication and peripheral sharing.
Quoted 9 lines
Ah, OK. I eventually came across a mention in one of the patches of running a separate instance of Linux on each core, whick left me even more mystified. But the above clarifies it, thanks...
I wonder how many currently global variables will need to be moved to
per_cpustructures to make it work, and how intrusive that will end up. Or is the plan to have the boot loader simply plonk the entire .data/.bss in different locations for each core?
What we have prototyped is more like the latter. The XIP image (binary kernel block) is in ROM. Bootloader boots the first core by jumping to kernel image. Kernel copies initialized data to its reserved chunk of RAM and runs from there. The other kernels can be started by the boot kernel and they too will jump to the ROM image and make their own copies of all data. Without cache coherency, sharing any cached data is problematic.
Other models are also possible. For instance, other cores could run dedicated DSP applications using some other minimal OS with HW supported communication with the Linux OS acting as the overall manager.
--Mark
Arnd Bergmann
maintainerQuoted 4 lines · On Thursday 29 September 2011 09:02:11 Mark Salter wrote:
Other models are also possible. For instance, other cores could run dedicated DSP applications using some other minimal OS with HW supported communication with the Linux OS acting as the overall manager.
Yes, that makes a lot of sense. I guess if you ever want to turn c6x into something more capable, adding an MMU would be higher on the priority list than proper SMP, which requires both cache coherency and atomic operations.
Arnd
Re: [PATCH v3 19/24] C6X: headers
In reply to Arnd BergmannQuoted 26 lines · Arnd Bergmann
Quoted 24 lines · Mark Salter
arch/c6x/include/asm/delay.h new file +24
-0+ +static inline void __delay (unsigned long loops) +{ +uint32_t tmp; + +/* 6 cycles per loop */ + asmvolatile (" mv .s1 %0,%1\n" +"0: [%1] b .s1 0b\n" +" add .l1 -6,%0,%0\n" +" cmplt .l1 1,%0,%1\n" +" nop 3\n" + :"+a" (loops),"=A" (tmp)); +} + +static inline void _c6x_tickdelay (unsigned int x) +{ +uint32_t cnt, endcnt; + + asmvolatile (" mvc .s2 TSCL,%0\n" +" add .s2x %0,%1,%2\n" +" || mvk .l2 1,B0\n" +"0: [B0] b .s2 0b\n" +" mvc .s2 TSCL,%0\n" + " sub .s2 %0,%2,%0\n"
Quoted 9 lines
arch/c6x/include/asm/delay.h line 44
Quoted 4 lines
arch/c6x/include/asm/delay.h new file +4
-0+ " cmpgt .l2 0,%0,B0\n" + " nop 2\n" + : "=b"(cnt), "+a"(x), "=b"(endcnt) : : "B0"); +}Do you actually need to provide the
__delayfunction here? I think it's really only used by thecalibrate_delay()function that you don't need.
It is still used in spinlock_debug.c and a few drivers.
--Mark
Re: [PATCH v3 19/24] C6X: headers
In reply to Arnd BergmannQuoted 14 lines · Arnd Bergmann
arch/c6x/include/asm/unaligned.h line 2
Quoted 8 lines · Mark Salter
arch/c6x/include/asm/unaligned.h new file +2
-0@@ -0,0 +1,288 @@ +/* +* Port on Texas Instruments TMS320C6x architecture This file basically just optimizes unaligned endianess conversion, but you don't provide an optimized
swab.h, which is the regular endianess conversion.
Quoted 3 lines
I think it would less code and more useful to provide your own
swab.hand use the genericunaligned.h.
Ah, I missed swab.h which is a trivial optimization. We can do 1 cycle swab16, 2 cycle swab32, and 3 cycle swab64.
I think we still want the c6x unaligned.h because the hardware can do unaligned 32 and 64 memory accesses with no performance penalty. There are some addressing mode limitations which is why the compiler doesn't use them generally.
--Mark
Arnd Bergmann
maintainerRe: [PATCH v3 19/24] C6X: headers
Quoted 4 lines · On Thursday 29 September 2011 10:24:43 Mark Salter wrote:
I think we still want the c6x
unaligned.hbecause the hardware can do unaligned 32 and 64 memory accesses with no performance penalty. There are some addressing mode limitations which is why the compiler doesn't use them generally.
Ok. I guess you still only need to override __cpu_to_{le,be}{16,32,64}p and __{le,be}{16,32,64}_to_cpup then and use include/linux/unaligned/access_ok.h.
Arnd