Skip to contentSkip to conversation

C6X: New architecture

PATCH In review Mark Salter 3 participants 41 messages Oct 4, 2011 – Oct 5, 2011

Subsystems (7)
lore
Share & tools
lore
#1 lore raw

PATCH v4 1/24 fix default __strnlen_user macro

In reply to Mark Salter

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
index ac68c99..9788568 100644
@@ -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
#3 lore raw

PATCH v4 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
index 18bea78..8e2b7ba 100644
@@ -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
#4 lore raw

PATCH v4 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
index 9120887..c2cf2ed 100644
@@ -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
#5 lore raw

PATCH v4 5/24 C6X: build infrastructure

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

---
 arch/c6x/Kconfig                    |  174 +++++++++++++++++++++++++++++++++++
 arch/c6x/Makefile                   |   60 ++++++++++++
 arch/c6x/boot/Makefile              |   30 ++++++
 arch/c6x/configs/dsk6455_defconfig  |   44 +++++++++
 arch/c6x/configs/evmc6457_defconfig |   41 ++++++++
 arch/c6x/configs/evmc6472_defconfig |   42 +++++++++
 arch/c6x/configs/evmc6474_defconfig |   42 +++++++++
 arch/c6x/include/asm/Kbuild         |   54 +++++++++++
 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          |   16 +++
 arch/c6x/platforms/Makefile         |   12 +++
 14 files changed, 701 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 +174 -0
new file mode 100644
index 0000000..26e67f0
@@ -0,0 +1,174 @@
+#
+# 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_ARCH_TRACEHOOK
+	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 +60 -0

60 lines not on this page · raw message

arch/c6x/boot/Makefile new file +30 -0
new file mode 100644
index 0000000..ecca820
@@ -0,0 +1,30 @@
+#
+# Makefile for bootable kernel images
+#
+
+OBJCOPYFLAGS_vmlinux.bin := -O binary
+$(obj)/vmlinux.bin: vmlinux FORCE
+	$(call if_changed,objcopy)
+
+DTC_FLAGS ?= -p 1024
+
+ifneq ($(DTB),)
+obj-y += linked_dtb.o
+endif
+
+$(obj)/%.dtb: $(src)/dts/%.dts FORCE
+	$(call cmd,dtc)
+
+quiet_cmd_cp = CP      $< $@$2
+	cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
+
+# Generate builtin.dtb from $(DTB).dtb
+$(obj)/builtin.dtb: $(obj)/$(DTB).dtb
+	$(call if_changed,cp)
+
+$(obj)/linked_dtb.o: $(obj)/builtin.dtb
+
+$(obj)/dtbImage.%: vmlinux
+	$(call if_changed,objcopy)
+
+clean-files := $(obj)/*.dtb
arch/c6x/configs/dsk6455_defconfig new file +44 -0

44 lines not on this page · raw message

arch/c6x/configs/evmc6457_defconfig new file +41 -0

41 lines not on this page · raw message

arch/c6x/configs/evmc6472_defconfig new file +42 -0

42 lines not on this page · raw message

arch/c6x/configs/evmc6474_defconfig new file +42 -0

42 lines not on this page · raw message

arch/c6x/include/asm/Kbuild new file +54 -0

54 lines not on this page · raw message

arch/c6x/kernel/Makefile new file +12 -0
new file mode 100644
index 0000000..580a515
@@ -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
new file mode 100644
index 0000000..ffd3c65
@@ -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 += checksum.o csum_64plus.o memcpy_64plus.o strasgi_64plus.o
arch/c6x/mm/Makefile new file +5 -0
new file mode 100644
index 0000000..136a975
@@ -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 +16 -0
new file mode 100644
index 0000000..401ee67
@@ -0,0 +1,16 @@
+
+config SOC_TMS320C6455
+	bool "TMS320C6455"
+	default n
+
+config SOC_TMS320C6457
+	bool "TMS320C6457"
+	default n
+
+config SOC_TMS320C6472
+	bool "TMS320C6472"
+	default n
+
+config SOC_TMS320C6474
+	bool "TMS320C6474"
+	default n
arch/c6x/platforms/Makefile new file +12 -0
new file mode 100644
index 0000000..9a95b9b
@@ -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
#7 lore raw

PATCH v4 6/24 C6X: early boot code

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

This 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   |  498 +++++++++++++++++++++++++++++++++++++++++++++
 arch/c6x/kernel/vectors.S |   81 ++++++++
 3 files changed, 663 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
new file mode 100644
index 0000000..133eab6
@@ -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 +498 -0

498 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
#9 lore raw

PATCH v4 7/24 C6X: devicetree support

In reply to Mark Salter

This 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.

CC devicetree-discuss-uLR06cmDAlY/[email protected]
CC Grant Likely <grant.likely-s3s/[email protected]>
CC Arnd Bergmann <[email protected]>
---
 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/linked_dtb.S                         |    2 +
 arch/c6x/kernel/devicetree.c                       |   53 ++++++++
 arch/c6x/platforms/platform.c                      |   17 +++
 17 files changed, 1087 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/linked_dtb.S
 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
new file mode 100644
index 0000000..a04f5fd
@@ -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
new file mode 100644
index 0000000..b1e4973
@@ -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
new file mode 100644
index 0000000..95911fe
@@ -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/linked_dtb.S new file +2 -0
new file mode 100644
index 0000000..57a4454
@@ -0,0 +1,2 @@
+.section __fdt_blob,"a"
+.incbin "arch/c6x/boot/builtin.dtb"
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
new file mode 100644
index 0000000..26c1a35
@@ -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_populate(NULL, of_default_bus_match_table, NULL, NULL);
+	return 0;
+}
+core_initcall(c6x_device_probe);
Signature · 1 line
1.7.6.2
#11 lore raw

PATCH v4 8/24 C6X: memory management and DMA support

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

The 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              |  153 ++++++++++++++++++++++++++++++++++++
 arch/c6x/mm/dma-coherent.c         |  143 +++++++++++++++++++++++++++++++++
 arch/c6x/mm/init.c                 |  113 ++++++++++++++++++++++++++
 4 files changed, 500 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
new file mode 100644
index 0000000..03579fd
@@ -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 +153 -0

153 lines not on this page · raw message

arch/c6x/mm/dma-coherent.c new file +143 -0

143 lines not on this page · raw message

arch/c6x/mm/init.c new file +113 -0

113 lines not on this page · raw message

Signature · 1 line
1.7.6.2
#13 lore raw

PATCH v4 9/24 C6X: process management

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date 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
arch/c6x/include/asm/processor.h new file +132 -0
new file mode 100644
index 0000000..8154c4e
@@ -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
#15 lore raw

PATCH v4 11/24 C6X: time management

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

---
 arch/c6x/include/asm/timer64.h |    6 +
 arch/c6x/include/asm/timex.h   |   33 ++++++
 arch/c6x/kernel/time.c         |   65 +++++++++++
 arch/c6x/platforms/timer64.c   |  236 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 340 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
new file mode 100644
index 0000000..bbe27bb
@@ -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 +33 -0
new file mode 100644
index 0000000..508c3ec
@@ -0,0 +1,33 @@
+/*
+ *  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
+
+#define CLOCK_TICK_RATE ((1000 * 1000000UL) / 6)
+
+/* 64-bit timestamp */
+typedef unsigned long long cycles_t;
+
+static inline cycles_t get_cycles(void)
+{
+	unsigned l, h;
+
+	asm volatile (" 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 +236 -0

236 lines not on this page · raw message

Signature · 1 line
1.7.6.2
#22 lore raw

PATCH v4 14/24 C6X: build infrastructure

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

---
 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
new file mode 100644
index 0000000..62124d7
@@ -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
#23 lore raw

PATCH v4 15/24 C6X: clocks

In reply to 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.

---
 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
new file mode 100644
index 0000000..76a070b
@@ -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
#24 lore raw

PATCH v4 16/24 C6X: cache control

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date 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
arch/c6x/include/asm/cache.h new file +90 -0
new file mode 100644
index 0000000..6d521d9
@@ -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
#25 lore raw

PATCH v4 17/24 C6X: loadable module support

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

---
 arch/c6x/include/asm/module.h |   33 +++++++++++
 arch/c6x/kernel/c6x_ksyms.c   |   66 ++++++++++++++++++++++
 arch/c6x/kernel/module.c      |  123 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 222 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
new file mode 100644
index 0000000..a453f97
@@ -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 +66 -0

66 lines not on this page · raw message

arch/c6x/kernel/module.c new file +123 -0

123 lines not on this page · raw message

Signature · 1 line
1.7.6.2
#29 lore raw

PATCH v4 19/24 C6X: headers

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

---
 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/swab.h        |   54 +++++++++++
 arch/c6x/include/asm/syscall.h     |  123 ++++++++++++++++++++++++++
 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   |  170 ++++++++++++++++++++++++++++++++++++
 23 files changed, 1178 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/swab.h
 create mode 100644 arch/c6x/include/asm/syscall.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
new file mode 100644
index 0000000..d370ee3
@@ -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
new file mode 100644
index 0000000..166038d
@@ -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
new file mode 100644
index 0000000..3701958
@@ -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
new file mode 100644
index 0000000..376925c
@@ -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
new file mode 100644
index 0000000..1181a97
@@ -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
new file mode 100644
index 0000000..41592bf
@@ -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
new file mode 100644
index 0000000..7a7248e
@@ -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
new file mode 100644
index 0000000..d18e2b0
@@ -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
new file mode 100644
index 0000000..c139d1e
@@ -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
new file mode 100644
index 0000000..b4ec95f
@@ -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
new file mode 100644
index 0000000..f703989
@@ -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
new file mode 100644
index 0000000..1808f27
@@ -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
new file mode 100644
index 0000000..b21517c
@@ -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/swab.h new file +54 -0

54 lines not on this page · raw message

arch/c6x/include/asm/syscall.h new file +123 -0

123 lines not on this page · raw message

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
new file mode 100644
index 0000000..8709e5e
@@ -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 +170 -0

170 lines not on this page · raw message

Signature · 1 line
1.7.6.2
#31 lore raw

PATCH v4 20/24 C6X: library code

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

---
 arch/c6x/include/asm/checksum.h |   34 ++++
 arch/c6x/lib/checksum.c         |   36 ++++
 arch/c6x/lib/csum_64plus.S      |  419 +++++++++++++++++++++++++++++++++++++++
 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 ++++
 19 files changed, 1349 insertions(+), 0 deletions(-)
 create mode 100644 arch/c6x/include/asm/checksum.h
 create mode 100644 arch/c6x/lib/checksum.c
 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 +34 -0
new file mode 100644
index 0000000..7246816
@@ -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_CHECKSUM_H
+#define _ASM_C6X_CHECKSUM_H
+
+static inline __wsum
+csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
+		   unsigned short proto, __wsum sum)
+{
+	unsigned long long tmp;
+
+	asm ("add     .d1   %1,%5,%1\n"
+	     "|| addu .l1   %3,%4,%0\n"
+	     "addu    .l1   %2,%0,%0\n"
+#ifndef CONFIG_CPU_BIG_ENDIAN
+	     "|| shl  .s1   %1,8,%1\n"
+#endif
+	     "addu    .l1   %1,%0,%0\n"
+	     "add     .l1   %P0,%p0,%2\n"
+	     : "=&a"(tmp), "+a"(len), "+a"(sum)
+	     : "a" (saddr), "a" (daddr), "a" (proto));
+	return sum;
+}
+#define csum_tcpudp_nofold csum_tcpudp_nofold
+
+#include <asm-generic/checksum.h>
+
+#endif /* _ASM_C6X_CHECKSUM_H */
arch/c6x/lib/checksum.c new file +36 -0
new file mode 100644
index 0000000..67cc93b
@@ -0,0 +1,36 @@
+/*
+ *		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.
+ */
+#include <linux/module.h>
+#include <net/checksum.h>
+
+#include <asm/byteorder.h>
+
+/*
+ * copy from fs while checksumming, otherwise like csum_partial
+ */
+__wsum
+csum_partial_copy_from_user(const void __user *src, void *dst, int len,
+			    __wsum sum, int *csum_err)
+{
+	int missing;
+
+	missing = __copy_from_user(dst, src, len);
+	if (missing) {
+		memset(dst + len - missing, 0, missing);
+		*csum_err = -EFAULT;
+	} else
+		*csum_err = 0;
+
+	return csum_partial(dst, len, sum);
+}
+EXPORT_SYMBOL(csum_partial_copy_from_user);
+
+/* These are from csum_64plus.S */
+EXPORT_SYMBOL(csum_partial);
+EXPORT_SYMBOL(csum_partial_copy);
+EXPORT_SYMBOL(ip_compute_csum);
+EXPORT_SYMBOL(ip_fast_csum);
arch/c6x/lib/csum_64plus.S new file +419 -0

419 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
new file mode 100644
index 0000000..7b105e2
@@ -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
new file mode 100644
index 0000000..fde1bec
@@ -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
new file mode 100644
index 0000000..596ae3f
@@ -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
new file mode 100644
index 0000000..82f4bce
@@ -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
new file mode 100644
index 0000000..d7d96c7
@@ -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
new file mode 100644
index 0000000..f6e3db3
@@ -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
new file mode 100644
index 0000000..c9fd159
@@ -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
#33 lore raw

PATCH v4 21/24 C6X: general SoC support

In reply to Mark Salter

This 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      |   91 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 126 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
new file mode 100644
index 0000000..43f5015
@@ -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 +91 -0

91 lines not on this page · raw message

Signature · 1 line
1.7.6.2
#35 lore raw

PATCH v4 22/24 C6X: EMIF - External Memory Interface

In reply to 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.

---
 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
new file mode 100644
index 0000000..6a0d4ff
@@ -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]), &regs->cecfg[i]);
+	}
+
+	err = of_property_read_u32_array(node, "ti,emifa-burst-priority", &val, 1);
+	if (!err)
+		soc_writel(val, &regs->bprio);
+
+	err = of_property_read_u32_array(node, "ti,emifa-async-wait-control", &val, 1);
+	if (!err)
+		soc_writel(val, &regs->awcc);
+
+	iounmap(regs);
+	of_node_put(node);
+	return 0;
+}
+pure_initcall(c6x_emifa_init);
Signature · 1 line
1.7.6.2
#37 lore raw

PATCH v4 24/24 C6X: MAINTAINERS

In reply to Mark Salter
---
 MAINTAINERS |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
MAINTAINERS +8 -0
index cfc062e..ccc9eba 100644
@@ -1650,6 +1650,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
#0 lore raw

v4 cover C6X: New architecture

Here is v4 of the C6X architecture patch series. Patches are available in 'for-linux-next' branch at:

http://linux-c6x.org/git/projects/linux-c6x-upstreaming.git

A prebuilt GNU toolchain can be found at:

    http://www.codesourcery.com/sgpp/lite/c6000/portal/release1882

Changes from the previous (v3) patchset are:

* Removed board-specific config options

* Implemented suggested cleanups to interrupt code

* Added support for periodic mode and shutdown mode to timer code

* Added HAVE_ARCH_TRACEHOOK support so generic ptrace can handle PTRACE_GETREGS/SETREGS

* Add optimized asm/swab.h

* Cleaned up asm/unaligned.h

* Fixed cache handling in dma api

* Allow device tree MAC address to override fused address

* Changed some exported symbols to EXPORT_SYMBOL_GPL

* Removed dtb-install tool and instead link DTB into kernel

* Use of_platform_populate and run it at core_initcall time

* Make use of generic asm/checksum.h

* Cleaned up compile warnings.

Aurelien Jacquiot (14):
C6X: build infrastructure
C6X: early boot code
C6X: memory management and DMA support
C6X: process management
C6X: signal management
C6X: time management
C6X: interrupt handling
C6X: syscalls
C6X: build infrastructure
C6X: cache control
C6X: loadable module support
C6X: ptrace support
C6X: headers
C6X: library code

Mark Salter (10):
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: devicetree support
C6X: clocks
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                                   |  174 +++++
 arch/c6x/Makefile                                  |   60 ++
 arch/c6x/boot/Makefile                             |   30 +
 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/linked_dtb.S                         |    2 +
 arch/c6x/configs/dsk6455_defconfig                 |   44 ++
 arch/c6x/configs/evmc6457_defconfig                |   41 +
 arch/c6x/configs/evmc6472_defconfig                |   42 +
 arch/c6x/configs/evmc6474_defconfig                |   42 +
 arch/c6x/include/asm/Kbuild                        |   54 ++
 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                    |   34 +
 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                      |  174 +++++
 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/swab.h                        |   54 ++
 arch/c6x/include/asm/syscall.h                     |  123 +++
 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                       |   33 +
 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                   |  170 +++++
 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                        |   66 ++
 arch/c6x/kernel/devicetree.c                       |   53 ++
 arch/c6x/kernel/dma.c                              |  153 ++++
 arch/c6x/kernel/entry.S                            |  803 ++++++++++++++++++++
 arch/c6x/kernel/head.S                             |   84 ++
 arch/c6x/kernel/irq.c                              |  728 ++++++++++++++++++
 arch/c6x/kernel/module.c                           |  123 +++
 arch/c6x/kernel/process.c                          |  263 +++++++
 arch/c6x/kernel/ptrace.c                           |  187 +++++
 arch/c6x/kernel/setup.c                            |  498 ++++++++++++
 arch/c6x/kernel/signal.c                           |  377 +++++++++
 arch/c6x/kernel/soc.c                              |   91 +++
 arch/c6x/kernel/switch_to.S                        |   74 ++
 arch/c6x/kernel/sys_c6x.c                          |   74 ++
 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/checksum.c                            |   36 +
 arch/c6x/lib/csum_64plus.S                         |  419 ++++++++++
 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                         |  143 ++++
 arch/c6x/mm/init.c                                 |  113 +++
 arch/c6x/platforms/Kconfig                         |   16 +
 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                       |  236 ++++++
 include/asm-generic/io.h                           |    2 +-
 include/asm-generic/page.h                         |   10 +-
 include/asm-generic/uaccess.h                      |    7 +-
 include/linux/elf-em.h                             |    1 +
 126 files changed, 12972 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/linked_dtb.S
 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/swab.h
 create mode 100644 arch/c6x/include/asm/syscall.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/checksum.c
 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
#2 lore raw

PATCH v4 2/24 fixed generic page.h for non-zero PAGE_OFFSET

asm-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
index 351889d..37d1fe2 100644
@@ -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
#14 lore raw

PATCH v4 10/24 C6X: signal management

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date 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
arch/c6x/include/asm/sigcontext.h new file +80 -0
new file mode 100644
index 0000000..eb702f3
@@ -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
new file mode 100644
index 0000000..f1cd870
@@ -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
#21 lore raw

PATCH v4 13/24 C6X: syscalls

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date 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       |   74 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 155 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
new file mode 100644
index 0000000..aed53da
@@ -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
new file mode 100644
index 0000000..6d54ea4
@@ -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 +74 -0

74 lines not on this page · raw message

Signature · 1 line
1.7.6.2
#27 lore raw

PATCH v4 18/24 C6X: ptrace support

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

---
 arch/c6x/include/asm/ptrace.h |  174 ++++++++++++++++++++++++++++++++++++++
 arch/c6x/kernel/ptrace.c      |  187 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 361 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 +174 -0
new file mode 100644
index 0000000..21e8d79
@@ -0,0 +1,174 @@
+/*
+ *  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);
+};
+
+#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)
+#define user_stack_pointer(regs) ((regs)->sp)
+
+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 +187 -0

187 lines not on this page · raw message

Signature · 1 line
1.7.6.2
#36 lore raw

PATCH v4 23/24 C6X: DSCR - Device State Configuration Registers

In reply to 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_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
new file mode 100644
index 0000000..561ba83
@@ -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
#18 lore raw

PATCH v4 12/24 C6X: interrupt handling

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

---
 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              |  728 ++++++++++++++++++++++++++++++++++++
 arch/c6x/platforms/megamod-pic.c   |  349 +++++++++++++++++
 6 files changed, 1480 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
new file mode 100644
index 0000000..9621954
@@ -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
new file mode 100644
index 0000000..eca0a86
@@ -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 +728 -0

728 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
maintainer Acked-by on v4 20/24
#32 lore raw

Re: [PATCH v4 20/24] C6X: library code

In reply to Mark Salter
Quoted 8 lines · On Tuesday 04 October 2011 12:43:57 Mark Salter wrote:

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

maintainer Acked-by on v4 19/24
#30 lore raw

Re: [PATCH v4 19/24] C6X: headers

In reply to Mark Salter
Quoted 8 lines · On Tuesday 04 October 2011 12:43:56 Mark Salter wrote:

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

Reviewed-by on v4 12/24
#19 lore raw

Re: [PATCH v4 12/24] C6X: interrupt handling

In reply to Mark Salter
Quoted 7 lines · Mark Salter

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

can get rid of that copied around code ASAP

maintainer Acked-by on v4 18/24
#28 lore raw

Re: [PATCH v4 18/24] C6X: ptrace support

In reply to Mark Salter
Quoted 8 lines · On Tuesday 04 October 2011 12:43:55 Mark Salter wrote:

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

maintainer Acked-by on v4 17/24
#26 lore raw

Re: [PATCH v4 17/24] C6X: loadable module support

In reply to Mark Salter
Quoted 8 lines · On Tuesday 04 October 2011 12:43:54 Mark Salter wrote:

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

maintainer Acked-by on v4 8/24
#12 lore raw

Re: [PATCH v4 08/24] C6X: memory management and DMA support

In reply to Mark Salter
Quoted 5 lines · On Tuesday 04 October 2011 12:43:45 Mark Salter wrote:

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

Quoted 8 lines

The 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.

maintainer Acked-by on v4 6/24
#8 lore raw

Re: [PATCH v4 06/24] C6X: early boot code

In reply to Mark Salter
Quoted 16 lines · On Tuesday 04 October 2011 12:43:43 Mark Salter wrote:

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

This 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.

Quoted 3 lines
maintainer Acked-by on v4 5/24
#6 lore raw

Re: [PATCH v4 05/24] C6X: build infrastructure

In reply to Mark Salter
Quoted 9 lines · On Tuesday 04 October 2011 12:43:42 Mark Salter wrote:

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

maintainer Acked-by on v4 12/24
#20 lore raw

Re: [PATCH v4 12/24] C6X: interrupt handling

In reply to Mark Salter
Quoted 9 lines · On Tuesday 04 October 2011 12:43:49 Mark Salter wrote:

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

maintainer Acked-by on v4 11/24
#17 lore raw

Re: [PATCH v4 11/24] C6X: time management

In reply to Mark Salter
Quoted 8 lines · On Tuesday 04 October 2011 12:43:48 Mark Salter wrote:

From: Aurelien Jacquiot <[email protected]>

Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <[email protected]>

maintainer Acked-by on v4 21/24
#34 lore raw

Re: [PATCH v4 21/24] C6X: general SoC support

In reply to Mark Salter
Quoted 6 lines · On Tuesday 04 October 2011 12:43:58 Mark Salter wrote:

This patch provides a soc_ops struct which provides hooks for SoC functionality which doesn't fit well into other places.

maintainer Acked-by on v4 7/24
#10 lore raw

Re: [PATCH v4 07/24] C6X: devicetree support

In reply to Mark Salter
Quoted 28 lines · On Tuesday 04 October 2011 12:43:44 Mark Salter wrote:

This 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.

Quoted 5 lines
#39 lore raw
Quoted 11 lines · Arnd Bergmann
Quoted 4 lines · On Tuesday 04 October 2011 12:43:37 Mark Salter wrote:

Here is v4 of the C6X architecture patch series. Patches are available in 'for-linux-next' branch at:

http://linux-c6x.org/git/projects/linux-c6x-upstreaming.git

Hi Mark,

This looks all good to me, great work!

Arnd

Thanks! So what is the next step?

--Mark

maintainer
#40 lore raw
Quoted 7 lines · Mark Salter
Quoted 6 lines · Arnd Bergmann
Quoted 4 lines · On Tuesday 04 October 2011 12:43:37 Mark Salter wrote:

Here is v4 of the C6X architecture patch series. Patches are available in 'for-linux-next' branch at:

http://linux-c6x.org/git/projects/linux-c6x-upstreaming.git

Quoted 7 lines
Quoted 5 lines

Hi Mark,

This looks all good to me, great work!

Arnd

Thanks! So what is the next step?

Easy:
* Make sure the code is in linux-next
* Make sure that linux-next actually still works for you, with everything else that went in
* Wait for Linus to open the merge window, then send him a pull request, with the same Cc list as this review.

Once everything is merged, you are alone responsible for deciding what goes in, but we will be there to give advice when needed.

Arnd