Skip to contentSkip to conversation

arch/c6x: new architecture port for linux

PATCH In review Mark Salter 8 participants 33 messages May 11, 2011 – Jun 16, 2011

Subsystems (13)
lore
Share & tools
lore
#5 lore raw

PATCH 5/16 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.6.2.5
#6 lore raw

PATCH 6/16 add maintainers entry for C6X arch

---
 MAINTAINERS |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
MAINTAINERS +11 -0
index 16a5c5f..4da0c6d 100644
@@ -1601,6 +1601,17 @@ 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/
+F:	drivers/net/c6x_*
+F:	drivers/platforms/c6x/
+F:	drivers/tty/hvc/hvc_c6x.c
+
 CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS
 M:	David Howells <[email protected]>
 L:	[email protected]
Signature · 1 line
1.6.2.5
#2 lore raw

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

In reply to Mark Salter

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 75fec18..f376db2 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.6.2.5
#16 lore raw

PATCH 16/16 C6X: add support for DSBT binary format

In reply to Mark Salter

This patch adds the C6X-specifc bits to use the DSBT binary format.

---
 arch/c6x/configs/ti_dsk6455_defconfig       |    1 +
 arch/c6x/configs/ti_evmc6457_defconfig      |    1 +
 arch/c6x/configs/ti_evmc6472_defconfig      |    1 +
 arch/c6x/configs/ti_evmc6474_defconfig      |    1 +
 arch/c6x/configs/ti_evmc6474_lite_defconfig |    1 +
 arch/c6x/include/asm/elf.h                  |   14 ++++++++++++++
 arch/c6x/include/asm/mmu.h                  |    4 ++++
 arch/c6x/include/asm/ptrace.h               |   12 ++++++++++++
 arch/c6x/kernel/ptrace.c                    |   25 ++++++++++++++++++++++++-
 9 files changed, 59 insertions(+), 1 deletions(-)
arch/c6x/configs/ti_dsk6455_defconfig +1 -0
index 3487af4..8112a70 100644
@@ -229,6 +229,7 @@ CONFIG_HIGH_RES_TIMERS=y
 #
 # Executable file formats
 #
+CONFIG_BINFMT_ELF_DSBT=y
 # CONFIG_BINFMT_FLAT is not set
 # CONFIG_HAVE_AOUT is not set
 # CONFIG_BINFMT_MISC is not set
arch/c6x/configs/ti_evmc6457_defconfig +1 -0
index e18b095..841f15a 100644
@@ -229,6 +229,7 @@ CONFIG_HIGH_RES_TIMERS=y
 #
 # Executable file formats
 #
+CONFIG_BINFMT_ELF_DSBT=y
 # CONFIG_BINFMT_FLAT is not set
 # CONFIG_HAVE_AOUT is not set
 # CONFIG_BINFMT_MISC is not set
arch/c6x/configs/ti_evmc6472_defconfig +1 -0
index 14ae81b..b18e9ee 100644
@@ -231,6 +231,7 @@ CONFIG_HIGH_RES_TIMERS=y
 #
 # Executable file formats
 #
+CONFIG_BINFMT_ELF_DSBT=y
 # CONFIG_BINFMT_FLAT is not set
 # CONFIG_HAVE_AOUT is not set
 # CONFIG_BINFMT_MISC is not set
arch/c6x/configs/ti_evmc6474_defconfig +1 -0
index 472ad6b..12f1808 100644
@@ -229,6 +229,7 @@ CONFIG_HIGH_RES_TIMERS=y
 #
 # Executable file formats
 #
+CONFIG_BINFMT_ELF_DSBT=y
 # CONFIG_BINFMT_FLAT is not set
 # CONFIG_HAVE_AOUT is not set
 # CONFIG_BINFMT_MISC is not set
arch/c6x/configs/ti_evmc6474_lite_defconfig +1 -0
index e25e8ac..044cf47 100644
@@ -229,6 +229,7 @@ CONFIG_HIGH_RES_TIMERS=y
 #
 # Executable file formats
 #
+CONFIG_BINFMT_ELF_DSBT=y
 # CONFIG_BINFMT_FLAT is not set
 # CONFIG_HAVE_AOUT is not set
 # CONFIG_BINFMT_MISC is not set
arch/c6x/include/asm/elf.h +14 -0
index 272c3ae..d57bb17 100644
@@ -32,6 +32,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  */
 #define elf_check_arch(x) ((x)->e_machine == EM_TI_C6000)
 
+#define elf_check_dsbt(x) (1)
 #define elf_check_const_displacement(x) (1)
 
 /*
@@ -67,6 +68,14 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
 
 #define ELF_PLATFORM  (NULL)
 
+#define ELF_DSBT_PLAT_INIT(_regs, _exec_map, _interp_map, _dynamic_addr, _dsbt_table) \
+do {								\
+	_regs->b4	= (_exec_map);				\
+	_regs->a6	= (_interp_map);			\
+	_regs->b6	= (_dynamic_addr);			\
+	_regs->dp	= (_dsbt_table);			\
+} while (0)
+
 #define SET_PERSONALITY(ex) set_personality(PER_LINUX)
 
 /* C6X specific section types */
@@ -112,4 +121,9 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
 #define R_C6000_FPHEAD		254
 #define R_C6000_NOCMP		255
 
+/* for binfmt_elf_dsbt */
+#define DT_ARCH_DSBT_BASE  DT_C6000_DSBT_BASE
+#define DT_ARCH_DSBT_SIZE  DT_C6000_DSBT_SIZE
+#define DT_ARCH_DSBT_INDEX DT_C6000_DSBT_INDEX
+
 #endif /*_ASM_C6X_ELF_H */
arch/c6x/include/asm/mmu.h +4 -0
index 8d376e9..1d9e9c1 100644
@@ -15,6 +15,10 @@
 
 typedef struct {
 	unsigned long		end_brk;
+#ifdef CONFIG_BINFMT_ELF_DSBT
+	unsigned long	exec_dsbt_loadmap;
+	unsigned long	interp_dsbt_loadmap;
+#endif
 } mm_context_t;
 
 #endif /* _ASM_C6X_MMU_H */
arch/c6x/include/asm/ptrace.h +12 -0
index 7e94de8..437df6f 100644
@@ -162,11 +162,23 @@ struct pt_regs {
 	REG_PAIR(sp, dp);
 };
 
+/*
+ * These are 'magic' values for PTRACE_PEEKUSR that return info about where a
+ * process is located in memory.
+ */
+#define PT_TEXT_ADDR		  0x10000
+#define PT_DATA_ADDR		  0x10004
+#define PT_TEXT_END_ADDR	  0x10008
+
 #define PTRACE_GETREGS		  12
 #define PTRACE_SETREGS		  13
 #define PTRACE_GETFPREGS	  14
 #define PTRACE_SETFPREGS	  15
 
+#define PTRACE_GETDSBT		 31	/* get the ELF DSBT loadmap address */
+#define PTRACE_GETDSBT_EXEC	  0	/* [addr] request the executable loadmap */
+#define PTRACE_GETDSBT_INTERP	  1	/* [addr] request the interpreter loadmap */
+
 #ifdef __KERNEL__
 
 #define DEFAULT_CSR		  0x0001	/* interrupt enable by default */
arch/c6x/kernel/ptrace.c +24 -1
index fd38463..aa853e4 100644
@@ -167,7 +167,13 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off,
 
 
 	tmp = 0;
-	if (off < PT_REG_SIZE)
+	if (index == PT_TEXT_ADDR)
+		tmp = tsk->mm->start_code;
+	else if (index == PT_DATA_ADDR)
+		tmp = tsk->mm->start_data;
+	else if (index == PT_TEXT_END_ADDR)
+		tmp = tsk->mm->end_code;
+	else if (off < PT_REG_SIZE)
 		tmp = get_reg(tsk, index);
 	else
 		return -EIO;
@@ -250,6 +256,23 @@ long arch_ptrace(struct task_struct *child, long request,
 		}
 		break;
 
+	case PTRACE_GETDSBT: {
+		tmp = 0;
+		switch (addr) {
+		case PTRACE_GETDSBT_EXEC:
+			tmp = child->mm->context.exec_dsbt_loadmap;
+			break;
+		case PTRACE_GETDSBT_INTERP:
+			tmp = child->mm->context.interp_dsbt_loadmap;
+			break;
+		default:
+			break;
+		}
+
+		ret = put_user(tmp, (unsigned long __user *)data);
+		break;
+	}
+
 	default:
 		ret = ptrace_request(child, request, addr, data);
 		break;
Signature · 1 line
1.6.2.5
#13 lore raw

PATCH 13/16 C6X: add drivers/platform/c6x files

In reply to Mark Salter

This patch adds driver support for miscellaneous drivers for hardware found on C64x DSP chips but not really part of the CPU core. These could have been put under arch/c6x/kernel, but that would get cluttered pretty quickly as new SoC parts are supported.

---
 drivers/platform/Kconfig             |    4 +
 drivers/platform/Makefile            |    1 +
 drivers/platform/c6x/Kconfig         |   27 ++
 drivers/platform/c6x/Makefile        |    8 +
 drivers/platform/c6x/irq-c64xplus.c  |  583 ++++++++++++++++++++++++++++++++++
 drivers/platform/c6x/pll-tci648x.c   |  433 +++++++++++++++++++++++++
 drivers/platform/c6x/timer-tci648x.c |  121 +++++++
 drivers/platform/c6x/tsc-c64xplus.c  |   53 +++
 8 files changed, 1230 insertions(+), 0 deletions(-)
 create mode 100644 drivers/platform/c6x/Kconfig
 create mode 100644 drivers/platform/c6x/Makefile
 create mode 100644 drivers/platform/c6x/irq-c64xplus.c
 create mode 100644 drivers/platform/c6x/pll-tci648x.c
 create mode 100644 drivers/platform/c6x/timer-tci648x.c
 create mode 100644 drivers/platform/c6x/tsc-c64xplus.c
drivers/platform/Kconfig +4 -0
index 8390dca..df334ed 100644
@@ -1,3 +1,7 @@
 if X86
 source "drivers/platform/x86/Kconfig"
 endif
+
+if TMS320C6X
+source "drivers/platform/c6x/Kconfig"
+endif
drivers/platform/Makefile +1 -0
index 782953a..bd9e0e3 100644
@@ -3,3 +3,4 @@
 #
 
 obj-$(CONFIG_X86)		+= x86/
+obj-$(CONFIG_TMS320C6X)		+= c6x/
drivers/platform/c6x/Kconfig new file +27 -0
new file mode 100644
index 0000000..a950fb8
@@ -0,0 +1,27 @@
+#
+# C6X Platform Specific Drivers
+#
+
+menuconfig C6X_PLATFORM_DEVICES
+	bool "C6X Platform Specific Device Drivers"
+	default y
+	depends on TMS320C6X
+	---help---
+	  Say Y here to get to see options for device drivers for various
+	  c64x platforms. This option alone does not add any kernel code.
+
+	  If you say N, all options in this submenu will be skipped and disabled.
+
+if C6X_PLATFORM_DEVICES
+
+config PLL_TCI648X
+	bool "PLL_TCI648X"
+	depends on COMMON_CLKDEV
+
+config TIMER_TCI648X
+	bool "TIMER_TCI648X"
+
+config PIC_C64XPLUS
+	bool "C64X+ Megamodule Interrupt Controller"
+
+endif # C6X_PLATFORM_DEVICES
drivers/platform/c6x/Makefile new file +8 -0
new file mode 100644
index 0000000..2f9be75
@@ -0,0 +1,8 @@
+#
+# Makefile for drivers/platform/c6x
+#
+
+obj-$(CONFIG_PLL_TCI648X)      += pll-tci648x.o
+obj-$(CONFIG_TMS320C64XPLUS)   += tsc-c64xplus.o
+obj-$(CONFIG_TIMER_TCI648X)    += timer-tci648x.o
+obj-$(CONFIG_PIC_C64XPLUS)     += irq-c64xplus.o
drivers/platform/c6x/irq-c64xplus.c new file +583 -0

583 lines not on this page · raw message

drivers/platform/c6x/pll-tci648x.c new file +433 -0

433 lines not on this page · raw message

drivers/platform/c6x/timer-tci648x.c new file +121 -0

121 lines not on this page · raw message

drivers/platform/c6x/tsc-c64xplus.c new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
1.6.2.5
#11 lore raw

PATCH 11/16 C6X: add lib files

In reply to Mark Salter
---
 arch/c6x/lib/Makefile         |   10 +
 arch/c6x/lib/csum_64plus.S    |  408 +++++++++++++++++++++++++++++++++++++++++
 arch/c6x/lib/divi.S           |   51 +++++
 arch/c6x/lib/divremi.S        |   45 +++++
 arch/c6x/lib/divremu.S        |   86 +++++++++
 arch/c6x/lib/divu.S           |   97 ++++++++++
 arch/c6x/lib/divull.c         |  332 +++++++++++++++++++++++++++++++++
 arch/c6x/lib/llshl.S          |   36 ++++
 arch/c6x/lib/llshr.S          |   36 ++++
 arch/c6x/lib/llshru.S         |   36 ++++
 arch/c6x/lib/memcmp.c         |   26 +++
 arch/c6x/lib/memcpy_64plus.S  |   45 +++++
 arch/c6x/lib/memmove.c        |   32 ++++
 arch/c6x/lib/memset.c         |   25 +++
 arch/c6x/lib/mpyll.S          |   47 +++++
 arch/c6x/lib/negll.S          |   29 +++
 arch/c6x/lib/pop_rts.S        |   30 +++
 arch/c6x/lib/push_rts.S       |   28 +++
 arch/c6x/lib/remi.S           |   62 ++++++
 arch/c6x/lib/remu.S           |   81 ++++++++
 arch/c6x/lib/strasgi.S        |   88 +++++++++
 arch/c6x/lib/strasgi_64plus.S |   37 ++++
 22 files changed, 1667 insertions(+), 0 deletions(-)
 create mode 100644 arch/c6x/lib/Makefile
 create mode 100644 arch/c6x/lib/csum_64plus.S
 create mode 100644 arch/c6x/lib/divi.S
 create mode 100644 arch/c6x/lib/divremi.S
 create mode 100644 arch/c6x/lib/divremu.S
 create mode 100644 arch/c6x/lib/divu.S
 create mode 100644 arch/c6x/lib/divull.c
 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/memcmp.c
 create mode 100644 arch/c6x/lib/memcpy_64plus.S
 create mode 100644 arch/c6x/lib/memmove.c
 create mode 100644 arch/c6x/lib/memset.c
 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/lib/Makefile new file +10 -0
new file mode 100644
index 0000000..5c095e8
@@ -0,0 +1,10 @@
+#
+# Makefile for arch/c6x/lib/
+#
+
+lib-y  := memcmp.o memmove.o memset.o \
+          divu.o divi.o pop_rts.o push_rts.o remi.o remu.o \
+          strasgi.o llshru.o llshr.o llshl.o negll.o mpyll.o divull.o \
+	  divremi.o divremu.o
+
+lib-$(CONFIG_TMS320C64XPLUS) += csum_64plus.o memcpy_64plus.o strasgi_64plus.o
arch/c6x/lib/csum_64plus.S new file +408 -0

408 lines not on this page · raw message

arch/c6x/lib/divi.S new file +51 -0

51 lines not on this page · raw message

arch/c6x/lib/divremi.S new file +45 -0

45 lines not on this page · raw message

arch/c6x/lib/divremu.S new file +86 -0

86 lines not on this page · raw message

arch/c6x/lib/divu.S new file +97 -0

97 lines not on this page · raw message

arch/c6x/lib/divull.c new file +332 -0

332 lines not on this page · raw message

arch/c6x/lib/llshl.S new file +36 -0
new file mode 100644
index 0000000..99b739e
@@ -0,0 +1,36 @@
+;;  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)
+
+	.text
+	.global __c6xabi_llshl
+__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
+
arch/c6x/lib/llshr.S new file +36 -0
new file mode 100644
index 0000000..989feed
@@ -0,0 +1,36 @@
+;;  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)
+
+	.text
+	.global __c6xabi_llshr
+__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
arch/c6x/lib/llshru.S new file +36 -0
new file mode 100644
index 0000000..07a4631
@@ -0,0 +1,36 @@
+;;  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)
+
+	.text
+	.global __c6xabi_llshru
+__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
arch/c6x/lib/memcmp.c new file +26 -0
new file mode 100644
index 0000000..2393530
@@ -0,0 +1,26 @@
+/*
+ *  linux/arch/c6x/lib/memcmp.c
+ *
+ *  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.
+ */
+#include <linux/types.h>
+#include <linux/module.h>
+
+int memcmp(const void *cs, const void *ct, size_t count)
+{
+	const unsigned char *su1, *su2;
+
+	for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
+		if (*su1 != *su2)
+			return (*su1 < *su2) ? -1 : 1;
+	return 0;
+}
+EXPORT_SYMBOL(memcmp);
+
arch/c6x/lib/memcpy_64plus.S new file +45 -0

45 lines not on this page · raw message

arch/c6x/lib/memmove.c new file +32 -0
new file mode 100644
index 0000000..23b6a81
@@ -0,0 +1,32 @@
+/*
+ *  linux/arch/c6x/lib/memmove.c
+ *
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2005, 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.
+ */
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/string.h>
+
+void *memmove(void *s1, const void *s2, size_t n)
+{
+	register char *s = (char *) s1;
+	register const char *p = (const char *) s2;
+
+	if (p >= s) {
+		return memcpy(s, p, n);
+	} else {
+		while (n) {
+			--n;
+			s[n] = p[n];
+		}
+	}
+	return s1;
+}
+EXPORT_SYMBOL(memmove);
arch/c6x/lib/memset.c new file +25 -0
new file mode 100644
index 0000000..7fda20f
@@ -0,0 +1,25 @@
+/*
+ *  linux/arch/c6x/lib/memcmp.c
+ *
+ *  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.
+ */
+#include <linux/types.h>
+#include <linux/module.h>
+
+void *memset(void *mem, register int ch, register size_t length)
+{
+	register char *m = (char *)mem - 1;
+
+	while (length--)
+		*++m = ch;
+	return mem;
+}
+EXPORT_SYMBOL(memset);
+
arch/c6x/lib/mpyll.S new file +47 -0

47 lines not on this page · raw message

arch/c6x/lib/negll.S new file +29 -0
new file mode 100644
index 0000000..7747521
@@ -0,0 +1,29 @@
+;;  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)
+
+	.text
+	.global __c6xabi_negll
+__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
arch/c6x/lib/pop_rts.S new file +30 -0
new file mode 100644
index 0000000..e1847fb
@@ -0,0 +1,30 @@
+;;  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.
+
+	.text
+	.global __c6xabi_pop_rts
+
+__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
arch/c6x/lib/push_rts.S new file +28 -0
new file mode 100644
index 0000000..637d56a
@@ -0,0 +1,28 @@
+;;  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.
+
+	.text
+	.global __c6xabi_push_rts
+__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--
arch/c6x/lib/remi.S new file +62 -0

62 lines not on this page · raw message

arch/c6x/lib/remu.S new file +81 -0

81 lines not on this page · raw message

arch/c6x/lib/strasgi.S new file +88 -0

88 lines not on this page · raw message

arch/c6x/lib/strasgi_64plus.S new file +37 -0
new file mode 100644
index 0000000..cbeab22
@@ -0,0 +1,37 @@
+;;  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.
+
+	.text
+	.global __c6xabi_strasgi_64plus
+
+__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
Signature · 1 line
1.6.2.5
#9 lore raw

PATCH 9/16 C6X: add kernel files

In reply to Mark Salter
---
 arch/c6x/kernel/Makefile       |   13 +
 arch/c6x/kernel/asm-offsets.c  |  127 ++++++
 arch/c6x/kernel/c6x_ksyms.c    |   75 ++++
 arch/c6x/kernel/clkdev.c       |  192 +++++++++
 arch/c6x/kernel/early_printk.c |   81 ++++
 arch/c6x/kernel/entry.S        |  851 ++++++++++++++++++++++++++++++++++++++++
 arch/c6x/kernel/head.S         |  127 ++++++
 arch/c6x/kernel/irq.c          |  119 ++++++
 arch/c6x/kernel/module.c       |  249 ++++++++++++
 arch/c6x/kernel/process.c      |  349 ++++++++++++++++
 arch/c6x/kernel/ptrace.c       |  284 +++++++++++++
 arch/c6x/kernel/setup.c        |  550 ++++++++++++++++++++++++++
 arch/c6x/kernel/signal.c       |  384 ++++++++++++++++++
 arch/c6x/kernel/switch_to.S    |   67 ++++
 arch/c6x/kernel/sys_c6x.c      |  111 ++++++
 arch/c6x/kernel/tags.c         |   98 +++++
 arch/c6x/kernel/tags.h         |   82 ++++
 arch/c6x/kernel/time.c         |   55 +++
 arch/c6x/kernel/traps.c        |  416 ++++++++++++++++++++
 arch/c6x/kernel/vectors.S      |   81 ++++
 arch/c6x/kernel/vmlinux.lds.S  |  205 ++++++++++
 21 files changed, 4516 insertions(+), 0 deletions(-)
 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/clkdev.c
 create mode 100644 arch/c6x/kernel/early_printk.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/switch_to.S
 create mode 100644 arch/c6x/kernel/sys_c6x.c
 create mode 100644 arch/c6x/kernel/tags.c
 create mode 100644 arch/c6x/kernel/tags.h
 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
arch/c6x/kernel/Makefile new file +13 -0
new file mode 100644
index 0000000..25cdded
@@ -0,0 +1,13 @@
+#
+# Makefile for arch/c6x/kernel/
+#
+
+extra-y	 := head.o vmlinux.lds
+
+obj-y 	 := process.o traps.o irq.o signal.o ptrace.o \
+	    setup.o sys_c6x.o time.o \
+            switch_to.o entry.o vectors.o c6x_ksyms.o tags.o
+
+obj-$(CONFIG_MODULES)          += module.o
+obj-$(CONFIG_COMMON_CLKDEV)    += clkdev.o
+obj-$(CONFIG_EARLY_PRINTK)     += early_printk.o
arch/c6x/kernel/asm-offsets.c new file +127 -0

127 lines not on this page · raw message

arch/c6x/kernel/c6x_ksyms.c new file +75 -0

75 lines not on this page · raw message

arch/c6x/kernel/clkdev.c new file +192 -0

192 lines not on this page · raw message

arch/c6x/kernel/early_printk.c new file +81 -0

81 lines not on this page · raw message

arch/c6x/kernel/entry.S new file +851 -0

851 lines not on this page · raw message

arch/c6x/kernel/head.S new file +127 -0

127 lines not on this page · raw message

arch/c6x/kernel/irq.c new file +119 -0

119 lines not on this page · raw message

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

249 lines not on this page · raw message

arch/c6x/kernel/process.c new file +349 -0

349 lines not on this page · raw message

arch/c6x/kernel/ptrace.c new file +284 -0

284 lines not on this page · raw message

arch/c6x/kernel/setup.c new file +550 -0

533 lines not on this page · raw message

arch/c6x/kernel/signal.c new file +384 -0

384 lines not on this page · raw message

arch/c6x/kernel/switch_to.S new file +67 -0

67 lines not on this page · raw message

arch/c6x/kernel/sys_c6x.c new file +111 -0

111 lines not on this page · raw message

arch/c6x/kernel/tags.c new file +98 -0

98 lines not on this page · raw message

arch/c6x/kernel/tags.h new file +82 -0

82 lines not on this page · raw message

arch/c6x/kernel/time.c new file +55 -0

55 lines not on this page · raw message

arch/c6x/kernel/traps.c new file +416 -0

416 lines not on this page · raw message

arch/c6x/kernel/vectors.S new file +81 -0

81 lines not on this page · raw message

arch/c6x/kernel/vmlinux.lds.S new file +205 -0

205 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.2.5

Part of the diff is not shown here. View the raw message.

#8 lore raw

PATCH 8/16 C6X: add include files

In reply to Mark Salter
---
 arch/c6x/include/asm/Kbuild              |    2 +
 arch/c6x/include/asm/asm-offsets.h       |    1 +
 arch/c6x/include/asm/atomic.h            |    6 +
 arch/c6x/include/asm/auxvec.h            |    6 +
 arch/c6x/include/asm/bitops.h            |  181 +++++++++++++++
 arch/c6x/include/asm/bitsperlong.h       |    6 +
 arch/c6x/include/asm/bug.h               |    6 +
 arch/c6x/include/asm/bugs.h              |    6 +
 arch/c6x/include/asm/byteorder.h         |   12 +
 arch/c6x/include/asm/cache.h             |  373 ++++++++++++++++++++++++++++++
 arch/c6x/include/asm/cacheflush.h        |   67 ++++++
 arch/c6x/include/asm/checksum.h          |  116 +++++++++
 arch/c6x/include/asm/clkdev.h            |   45 ++++
 arch/c6x/include/asm/clock.h             |   73 ++++++
 arch/c6x/include/asm/cputime.h           |    6 +
 arch/c6x/include/asm/current.h           |    6 +
 arch/c6x/include/asm/delay.h             |   69 ++++++
 arch/c6x/include/asm/device.h            |    6 +
 arch/c6x/include/asm/div64.h             |    6 +
 arch/c6x/include/asm/dma-mapping.h       |  302 ++++++++++++++++++++++++
 arch/c6x/include/asm/dma.h               |   25 ++
 arch/c6x/include/asm/elf.h               |  115 +++++++++
 arch/c6x/include/asm/emergency-restart.h |    6 +
 arch/c6x/include/asm/errno.h             |    6 +
 arch/c6x/include/asm/fb.h                |    6 +
 arch/c6x/include/asm/fcntl.h             |    6 +
 arch/c6x/include/asm/ftrace.h            |    6 +
 arch/c6x/include/asm/futex.h             |    6 +
 arch/c6x/include/asm/gemac.h             |  146 ++++++++++++
 arch/c6x/include/asm/gmdio.h             |  217 +++++++++++++++++
 arch/c6x/include/asm/hardirq.h           |   22 ++
 arch/c6x/include/asm/hardware.h          |   21 ++
 arch/c6x/include/asm/hw_irq.h            |    6 +
 arch/c6x/include/asm/io.h                |    6 +
 arch/c6x/include/asm/ioctl.h             |    6 +
 arch/c6x/include/asm/ioctls.h            |    6 +
 arch/c6x/include/asm/ipcbuf.h            |    6 +
 arch/c6x/include/asm/irq.h               |  101 ++++++++
 arch/c6x/include/asm/irq_regs.h          |    6 +
 arch/c6x/include/asm/irqflags.h          |   71 ++++++
 arch/c6x/include/asm/kdebug.h            |    6 +
 arch/c6x/include/asm/kmap_types.h        |    6 +
 arch/c6x/include/asm/leds.h              |   22 ++
 arch/c6x/include/asm/linkage.h           |    6 +
 arch/c6x/include/asm/local.h             |    6 +
 arch/c6x/include/asm/mman.h              |    7 +
 arch/c6x/include/asm/mmu.h               |   20 ++
 arch/c6x/include/asm/mmu_context.h       |    6 +
 arch/c6x/include/asm/module.h            |   35 +++
 arch/c6x/include/asm/msgbuf.h            |    6 +
 arch/c6x/include/asm/mutex.h             |    6 +
 arch/c6x/include/asm/page.h              |   11 +
 arch/c6x/include/asm/param.h             |    6 +
 arch/c6x/include/asm/pci.h               |    6 +
 arch/c6x/include/asm/percpu.h            |    6 +
 arch/c6x/include/asm/pgalloc.h           |    6 +
 arch/c6x/include/asm/pgtable.h           |   83 +++++++
 arch/c6x/include/asm/pll.h               |   79 +++++++
 arch/c6x/include/asm/pm.h                |   48 ++++
 arch/c6x/include/asm/poll.h              |    6 +
 arch/c6x/include/asm/posix_types.h       |    6 +
 arch/c6x/include/asm/processor.h         |  118 ++++++++++
 arch/c6x/include/asm/procinfo.h          |   30 +++
 arch/c6x/include/asm/ptrace.h            |  186 +++++++++++++++
 arch/c6x/include/asm/resource.h          |    6 +
 arch/c6x/include/asm/scatterlist.h       |    6 +
 arch/c6x/include/asm/sections.h          |   17 ++
 arch/c6x/include/asm/segment.h           |    1 +
 arch/c6x/include/asm/sembuf.h            |    6 +
 arch/c6x/include/asm/serial.h            |   25 ++
 arch/c6x/include/asm/setup.h             |   49 ++++
 arch/c6x/include/asm/sgmii.h             |   53 +++++
 arch/c6x/include/asm/shmbuf.h            |    6 +
 arch/c6x/include/asm/shmparam.h          |    6 +
 arch/c6x/include/asm/sigcontext.h        |   83 +++++++
 arch/c6x/include/asm/siginfo.h           |    6 +
 arch/c6x/include/asm/signal.h            |   17 ++
 arch/c6x/include/asm/socket.h            |    6 +
 arch/c6x/include/asm/sockios.h           |    6 +
 arch/c6x/include/asm/stat.h              |    6 +
 arch/c6x/include/asm/statfs.h            |    6 +
 arch/c6x/include/asm/string.h            |   29 +++
 arch/c6x/include/asm/swab.h              |    6 +
 arch/c6x/include/asm/syscalls.h          |   58 +++++
 arch/c6x/include/asm/system.h            |  194 ++++++++++++++++
 arch/c6x/include/asm/termbits.h          |    6 +
 arch/c6x/include/asm/termios.h           |    6 +
 arch/c6x/include/asm/thread_info.h       |  123 ++++++++++
 arch/c6x/include/asm/timer.h             |   31 +++
 arch/c6x/include/asm/timex.h             |   43 ++++
 arch/c6x/include/asm/tlb.h               |    8 +
 arch/c6x/include/asm/tlbflush.h          |    6 +
 arch/c6x/include/asm/topology.h          |    6 +
 arch/c6x/include/asm/traps.h             |   39 +++
 arch/c6x/include/asm/types.h             |    6 +
 arch/c6x/include/asm/uaccess.h           |  103 ++++++++
 arch/c6x/include/asm/ucontext.h          |    6 +
 arch/c6x/include/asm/unaligned.h         |  290 +++++++++++++++++++++++
 arch/c6x/include/asm/unistd.h            |   32 +++
 arch/c6x/include/asm/user.h              |    1 +
 arch/c6x/include/asm/vga.h               |    6 +
 101 files changed, 4106 insertions(+), 0 deletions(-)
 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/atomic.h
 create mode 100644 arch/c6x/include/asm/auxvec.h
 create mode 100644 arch/c6x/include/asm/bitops.h
 create mode 100644 arch/c6x/include/asm/bitsperlong.h
 create mode 100644 arch/c6x/include/asm/bug.h
 create mode 100644 arch/c6x/include/asm/bugs.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/cputime.h
 create mode 100644 arch/c6x/include/asm/current.h
 create mode 100644 arch/c6x/include/asm/delay.h
 create mode 100644 arch/c6x/include/asm/device.h
 create mode 100644 arch/c6x/include/asm/div64.h
 create mode 100644 arch/c6x/include/asm/dma-mapping.h
 create mode 100644 arch/c6x/include/asm/dma.h
 create mode 100644 arch/c6x/include/asm/elf.h
 create mode 100644 arch/c6x/include/asm/emergency-restart.h
 create mode 100644 arch/c6x/include/asm/errno.h
 create mode 100644 arch/c6x/include/asm/fb.h
 create mode 100644 arch/c6x/include/asm/fcntl.h
 create mode 100644 arch/c6x/include/asm/ftrace.h
 create mode 100644 arch/c6x/include/asm/futex.h
 create mode 100644 arch/c6x/include/asm/gemac.h
 create mode 100644 arch/c6x/include/asm/gmdio.h
 create mode 100644 arch/c6x/include/asm/hardirq.h
 create mode 100644 arch/c6x/include/asm/hardware.h
 create mode 100644 arch/c6x/include/asm/hw_irq.h
 create mode 100644 arch/c6x/include/asm/io.h
 create mode 100644 arch/c6x/include/asm/ioctl.h
 create mode 100644 arch/c6x/include/asm/ioctls.h
 create mode 100644 arch/c6x/include/asm/ipcbuf.h
 create mode 100644 arch/c6x/include/asm/irq.h
 create mode 100644 arch/c6x/include/asm/irq_regs.h
 create mode 100644 arch/c6x/include/asm/irqflags.h
 create mode 100644 arch/c6x/include/asm/kdebug.h
 create mode 100644 arch/c6x/include/asm/kmap_types.h
 create mode 100644 arch/c6x/include/asm/leds.h
 create mode 100644 arch/c6x/include/asm/linkage.h
 create mode 100644 arch/c6x/include/asm/local.h
 create mode 100644 arch/c6x/include/asm/mman.h
 create mode 100644 arch/c6x/include/asm/mmu.h
 create mode 100644 arch/c6x/include/asm/mmu_context.h
 create mode 100644 arch/c6x/include/asm/module.h
 create mode 100644 arch/c6x/include/asm/msgbuf.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/param.h
 create mode 100644 arch/c6x/include/asm/pci.h
 create mode 100644 arch/c6x/include/asm/percpu.h
 create mode 100644 arch/c6x/include/asm/pgalloc.h
 create mode 100644 arch/c6x/include/asm/pgtable.h
 create mode 100644 arch/c6x/include/asm/pll.h
 create mode 100644 arch/c6x/include/asm/pm.h
 create mode 100644 arch/c6x/include/asm/poll.h
 create mode 100644 arch/c6x/include/asm/posix_types.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/ptrace.h
 create mode 100644 arch/c6x/include/asm/resource.h
 create mode 100644 arch/c6x/include/asm/scatterlist.h
 create mode 100644 arch/c6x/include/asm/sections.h
 create mode 100644 arch/c6x/include/asm/segment.h
 create mode 100644 arch/c6x/include/asm/sembuf.h
 create mode 100644 arch/c6x/include/asm/serial.h
 create mode 100644 arch/c6x/include/asm/setup.h
 create mode 100644 arch/c6x/include/asm/sgmii.h
 create mode 100644 arch/c6x/include/asm/shmbuf.h
 create mode 100644 arch/c6x/include/asm/shmparam.h
 create mode 100644 arch/c6x/include/asm/sigcontext.h
 create mode 100644 arch/c6x/include/asm/siginfo.h
 create mode 100644 arch/c6x/include/asm/signal.h
 create mode 100644 arch/c6x/include/asm/socket.h
 create mode 100644 arch/c6x/include/asm/sockios.h
 create mode 100644 arch/c6x/include/asm/stat.h
 create mode 100644 arch/c6x/include/asm/statfs.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/syscalls.h
 create mode 100644 arch/c6x/include/asm/system.h
 create mode 100644 arch/c6x/include/asm/termbits.h
 create mode 100644 arch/c6x/include/asm/termios.h
 create mode 100644 arch/c6x/include/asm/thread_info.h
 create mode 100644 arch/c6x/include/asm/timer.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/tlbflush.h
 create mode 100644 arch/c6x/include/asm/topology.h
 create mode 100644 arch/c6x/include/asm/traps.h
 create mode 100644 arch/c6x/include/asm/types.h
 create mode 100644 arch/c6x/include/asm/uaccess.h
 create mode 100644 arch/c6x/include/asm/ucontext.h
 create mode 100644 arch/c6x/include/asm/unaligned.h
 create mode 100644 arch/c6x/include/asm/unistd.h
 create mode 100644 arch/c6x/include/asm/user.h
 create mode 100644 arch/c6x/include/asm/vga.h
arch/c6x/include/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..b200fda
@@ -0,0 +1,2 @@
+include include/asm-generic/Kbuild.asm
+
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/atomic.h new file +6 -0
new file mode 100644
index 0000000..d995e0e
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_ATOMIC_H
+#define _ASM_C6X_ATOMIC_H
+
+#include <asm-generic/atomic.h>
+
+#endif /* _ASM_C6X_ATOMIC_H */
arch/c6x/include/asm/auxvec.h new file +6 -0
new file mode 100644
index 0000000..8d881e6
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_AUXVEC_H
+#define _ASM_C6X_AUXVEC_H
+
+#include <asm-generic/auxvec.h>
+
+#endif /* _ASM_C6X_AUXVEC_H */
arch/c6x/include/asm/bitops.h new file +181 -0

181 lines not on this page · raw message

arch/c6x/include/asm/bitsperlong.h new file +6 -0
new file mode 100644
index 0000000..2cd2b80
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_BITSPERLONG_H
+#define _ASM_C6X_BITSPERLONG_H
+
+#include <asm-generic/bitsperlong.h>
+
+#endif /* _ASM_C6X_BITSPERLONG_H */
arch/c6x/include/asm/bug.h new file +6 -0
new file mode 100644
index 0000000..6dbbb6e
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_BUG_H
+#define _ASM_C6X_BUG_H
+
+#include <asm-generic/bug.h>
+
+#endif /* _ASM_C6X_BUG_H */
arch/c6x/include/asm/bugs.h new file +6 -0
new file mode 100644
index 0000000..c810e54
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_BUGS_H
+#define _ASM_C6X_BUGS_H
+
+#include <asm-generic/bugs.h>
+
+#endif /* _ASM_C6X_BUGS_H */
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/cache.h new file +373 -0

373 lines not on this page · raw message

arch/c6x/include/asm/cacheflush.h new file +67 -0

67 lines not on this page · raw message

arch/c6x/include/asm/checksum.h new file +116 -0

116 lines not on this page · raw message

arch/c6x/include/asm/clkdev.h new file +45 -0

45 lines not on this page · raw message

arch/c6x/include/asm/clock.h new file +73 -0

73 lines not on this page · raw message

arch/c6x/include/asm/cputime.h new file +6 -0
new file mode 100644
index 0000000..e352391
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_CPUTIME_H
+#define _ASM_C6X_CPUTIME_H
+
+#include <asm-generic/cputime.h>
+
+#endif /* _ASM_C6X_CPUTIME_H */
arch/c6x/include/asm/current.h new file +6 -0
new file mode 100644
index 0000000..7841d42
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_CURRENT_H
+#define _ASM_C6X_CURRENT_H
+
+#include <asm-generic/current.h>
+
+#endif /* _ASM_C6X_CURRENT_H */
arch/c6x/include/asm/delay.h new file +69 -0

69 lines not on this page · raw message

arch/c6x/include/asm/device.h new file +6 -0
new file mode 100644
index 0000000..0313e82
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_DEVICE_H
+#define _ASM_C6X_DEVICE_H
+
+#include <asm-generic/device.h>
+
+#endif /* _ASM_C6X_DEVICE_H */
arch/c6x/include/asm/div64.h new file +6 -0
new file mode 100644
index 0000000..46943e6
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_DIV64_H
+#define _ASM_C6X_DIV64_H
+
+#include <asm-generic/div64.h>
+
+#endif /* _ASM_C6X_DIV64_H */
arch/c6x/include/asm/dma-mapping.h new file +302 -0

302 lines not on this page · raw message

arch/c6x/include/asm/dma.h new file +25 -0
new file mode 100644
index 0000000..0431395
@@ -0,0 +1,25 @@
+/*
+ *  linux/include/asm-c6x/dma.h
+ *
+ *  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_DMA_H
+#define _ASM_C6X_DMA_H
+
+#define MAX_DMA_ADDRESS  0xFFFFFFFF
+#define MAX_DMA_CHANNELS 64
+
+/* Reserve a DMA channel */
+extern int request_dma(unsigned int dmanr, const char *device_id);
+
+/* Release it again */
+extern void free_dma(unsigned int dmanr);
+
+#endif /* _ASM_C6X_DMA_H */
arch/c6x/include/asm/elf.h new file +115 -0

115 lines not on this page · raw message

arch/c6x/include/asm/emergency-restart.h new file +6 -0
new file mode 100644
index 0000000..6cc0cf1
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_EMERGENCY_RESTART_H
+#define _ASM_C6X_EMERGENCY_RESTART_H
+
+#include <asm-generic/emergency-restart.h>
+
+#endif /* _ASM_C6X_EMERGENCY_RESTART_H */
arch/c6x/include/asm/errno.h new file +6 -0
new file mode 100644
index 0000000..7f74f4a
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_ERRNO_H
+#define _ASM_C6X_ERRNO_H
+
+#include <asm-generic/errno.h>
+
+#endif /* _ASM_C6X_ERRNO_H */
arch/c6x/include/asm/fb.h new file +6 -0
new file mode 100644
index 0000000..392e52a
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_FB_H
+#define _ASM_C6X_FB_H
+
+#include <asm-generic/fb.h>
+
+#endif /* _ASM_C6X_FB_H */
arch/c6x/include/asm/fcntl.h new file +6 -0
new file mode 100644
index 0000000..7a8f9eb
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_FCNTL_H
+#define _ASM_C6X_FCNTL_H
+
+#include <asm-generic/fcntl.h>
+
+#endif /* _ASM_C6X_FCNTL_H */
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/futex.h new file +6 -0
new file mode 100644
index 0000000..d492f20
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_FUTEX_H
+#define _ASM_C6X_FUTEX_H
+
+#include <asm-generic/futex.h>
+
+#endif /* _ASM_C6X_FUTEX_H */
arch/c6x/include/asm/gemac.h new file +146 -0

146 lines not on this page · raw message

arch/c6x/include/asm/gmdio.h new file +217 -0

217 lines not on this page · raw message

arch/c6x/include/asm/hardirq.h new file +22 -0
new file mode 100644
index 0000000..19c4a56
@@ -0,0 +1,22 @@
+/*
+ *  linux/include/asm-c6x/hardirq.h
+ *
+ *  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/hardware.h new file +21 -0
new file mode 100644
index 0000000..69db640
@@ -0,0 +1,21 @@
+/*
+ *  linux/include/asm-c6x/hardware.h
+ *
+ *  Port on Texas Instruments TMS320C6x/C6x+ 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_HARDWARE_H
+#define _ASM_C6X_HARDWARE_H
+
+#define __SYSREG(ADDR, TYPE) (*(volatile TYPE*)(ADDR))
+#define __SYSREGA(ADDR, TYPE) ((volatile TYPE*)(ADDR))
+
+#include <mach/hardware.h>
+
+#endif /* _ASM_C6X_HARDWARE_H */
arch/c6x/include/asm/hw_irq.h new file +6 -0
new file mode 100644
index 0000000..7c159eb
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_HW_IRQ_H
+#define _ASM_C6X_HW_IRQ_H
+
+#include <asm-generic/hw_irq.h>
+
+#endif /* _ASM_C6X_HW_IRQ_H */
arch/c6x/include/asm/io.h new file +6 -0
new file mode 100644
index 0000000..e7a0353
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_IO_H
+#define _ASM_C6X_IO_H
+
+#include <asm-generic/io.h>
+
+#endif /* _ASM_C6X_IO_H */
arch/c6x/include/asm/ioctl.h new file +6 -0
new file mode 100644
index 0000000..53fd15e
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_IOCTL_H
+#define _ASM_C6X_IOCTL_H
+
+#include <asm-generic/ioctl.h>
+
+#endif /* _ASM_C6X_IOCTL_H */
arch/c6x/include/asm/ioctls.h new file +6 -0
new file mode 100644
index 0000000..fd43676
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_IOCTLS_H
+#define _ASM_C6X_IOCTLS_H
+
+#include <asm-generic/ioctls.h>
+
+#endif /* _ASM_C6X_IOCTLS_H */
arch/c6x/include/asm/ipcbuf.h new file +6 -0
new file mode 100644
index 0000000..9f2d5f0
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_IPCBUF_H
+#define _ASM_C6X_IPCBUF_H
+
+#include <asm-generic/ipcbuf.h>
+
+#endif /* _ASM_C6X_IPCBUF_H */
arch/c6x/include/asm/irq.h new file +101 -0

101 lines not on this page · raw message

arch/c6x/include/asm/irq_regs.h new file +6 -0
new file mode 100644
index 0000000..143adfe
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_IRQ_REGS_H
+#define _ASM_C6X_IRQ_REGS_H
+
+#include <asm-generic/irq_regs.h>
+
+#endif /* _ASM_C6X_IRQ_REGS_H */
arch/c6x/include/asm/irqflags.h new file +71 -0

71 lines not on this page · raw message

arch/c6x/include/asm/kdebug.h new file +6 -0
new file mode 100644
index 0000000..d2c70ad
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_KDEBUG_H
+#define _ASM_C6X_KDEBUG_H
+
+#include <asm-generic/kdebug.h>
+
+#endif /* _ASM_C6X_KDEBUG_H */
arch/c6x/include/asm/kmap_types.h new file +6 -0
new file mode 100644
index 0000000..696057f
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_KMAP_TYPES_H
+#define _ASM_C6X_KMAP_TYPES_H
+
+#include <asm-generic/kmap_types.h>
+
+#endif /* _ASM_C6X_KMAP_TYPES_H */
arch/c6x/include/asm/leds.h new file +22 -0
new file mode 100644
index 0000000..bdd17da
@@ -0,0 +1,22 @@
+/*
+ *  arch/c6x/include/asm/leds.h
+ *
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  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_LEDS_H
+#define _ASM_C6X_LEDS_H
+
+#include <mach/board.h>
+
+#ifndef __ASSEMBLY__
+extern void c6x_arch_idle_led(int state);
+#endif
+
+#endif /* _ASM_C6X_LEDS_H */
arch/c6x/include/asm/linkage.h new file +6 -0
new file mode 100644
index 0000000..d6807e9
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_LINKAGE_H
+#define _ASM_C6X_LINKAGE_H
+
+#include <asm-generic/linkage.h>
+
+#endif /* _ASM_C6X_LINKAGE_H */
arch/c6x/include/asm/local.h new file +6 -0
new file mode 100644
index 0000000..17a94b4
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_LOCAL_H
+#define _ASM_C6X_LOCAL_H
+
+#include <asm-generic/local.h>
+
+#endif /* _ASM_C6X_LOCAL_H */
arch/c6x/include/asm/mman.h new file +7 -0
new file mode 100644
index 0000000..8234838
@@ -0,0 +1,7 @@
+#ifndef _ASM_C6X_MMAN_H
+#define _ASM_C6X_MMAN_H
+
+#include <asm-generic/mman.h>
+
+#endif /* _ASM_C6X_MMAN_H */
+
arch/c6x/include/asm/mmu.h new file +20 -0
new file mode 100644
index 0000000..8d376e9
@@ -0,0 +1,20 @@
+/*
+ *  linux/include/asm-c6x/mmu.h
+ *
+ *  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/mmu_context.h new file +6 -0
new file mode 100644
index 0000000..7b222ba
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_MMU_CONTEXT_H
+#define _ASM_C6X_MMU_CONTEXT_H
+
+#include <asm-generic/mmu_context.h>
+
+#endif /* _ASM_C6X_MMU_CONTEXT_H */
arch/c6x/include/asm/module.h new file +35 -0
new file mode 100644
index 0000000..d76d106
@@ -0,0 +1,35 @@
+/*
+ *  arch/c6x/include/asm/module.h
+ *
+ *  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/include/asm/msgbuf.h new file +6 -0
new file mode 100644
index 0000000..14f063e
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_MSGBUF_H
+#define _ASM_C6X_MSGBUF_H
+
+#include <asm-generic/msgbuf.h>
+
+#endif /* _ASM_C6X_MSGBUF_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/param.h new file +6 -0
new file mode 100644
index 0000000..986e6c5
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_PARAM_H
+#define _ASM_C6X_PARAM_H
+
+#include <asm-generic/param.h>
+
+#endif /* _ASM_C6X_PARAM_H */
arch/c6x/include/asm/pci.h new file +6 -0
new file mode 100644
index 0000000..d7da231
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_PCI_H
+#define _ASM_C6X_PCI_H
+
+#include <asm-generic/pci.h>
+
+#endif /* _ASM_C6X_PCI_H */
arch/c6x/include/asm/percpu.h new file +6 -0
new file mode 100644
index 0000000..dbb7dc5
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_PERCPU_H
+#define _ASM_C6X_PERCPU_H
+
+#include <asm-generic/percpu.h>
+
+#endif /* _ASM_C6X_PERCPU_H */
arch/c6x/include/asm/pgalloc.h new file +6 -0
new file mode 100644
index 0000000..aff53f7
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_PGALLOC_H
+#define _ASM_C6X_PGALLOC_H
+
+#include <asm-generic/pgalloc.h>
+
+#endif /* _ASM_C6X_PGALLOC_H */
arch/c6x/include/asm/pgtable.h new file +83 -0

83 lines not on this page · raw message

arch/c6x/include/asm/pll.h new file +79 -0

79 lines not on this page · raw message

arch/c6x/include/asm/pm.h new file +48 -0

48 lines not on this page · raw message

arch/c6x/include/asm/poll.h new file +6 -0
new file mode 100644
index 0000000..2d5834e
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_POLL_H
+#define _ASM_C6X_POLL_H
+
+#include <asm-generic/poll.h>
+
+#endif /* _ASM_C6X_POLL_H */
arch/c6x/include/asm/posix_types.h new file +6 -0
new file mode 100644
index 0000000..3585157
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_POSIX_TYPES_H
+#define _ASM_C6X_POSIX_TYPES_H
+
+#include <asm-generic/posix_types.h>
+
+#endif /* _ASM_C6X_POSIX_TYPES_H */
arch/c6x/include/asm/processor.h new file +118 -0

118 lines not on this page · raw message

arch/c6x/include/asm/procinfo.h new file +30 -0
new file mode 100644
index 0000000..b9937ef
@@ -0,0 +1,30 @@
+/*
+ *  arch/c6x/include/asm/procinfo.h
+ *
+ *  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/ptrace.h new file +186 -0

186 lines not on this page · raw message

arch/c6x/include/asm/resource.h new file +6 -0
new file mode 100644
index 0000000..5c18fea
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_RESOURCE_H
+#define _ASM_C6X_RESOURCE_H
+
+#include <asm-generic/resource.h>
+
+#endif /* _ASM_C6X_RESOURCE_H */
arch/c6x/include/asm/scatterlist.h new file +6 -0
new file mode 100644
index 0000000..f4a0622
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_SCATTERLIST_H
+#define _ASM_C6X_SCATTERLIST_H
+
+#include <asm-generic/scatterlist.h>
+
+#endif /* _ASM_C6X_SCATTERLIST_H */
arch/c6x/include/asm/sections.h new file +17 -0
new file mode 100644
index 0000000..d26cc45
@@ -0,0 +1,17 @@
+#ifndef _ASM_C6X_SECTIONS_H
+#define _ASM_C6X_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+extern char _vectors_start[];
+extern char _vectors_end[];
+
+#ifdef CONFIG_MTD_UCLINUX
+extern char _ebss[];
+#endif
+
+#ifdef CONFIG_XIP_KERNEL
+extern char _data_lma[];
+#endif
+
+#endif /* _ASM_C6X_SECTIONS_H */
arch/c6x/include/asm/segment.h new file +1 -0
new file mode 100644
index 0000000..f1b81e5
@@ -0,0 +1 @@
+#include <asm-generic/segment.h>
arch/c6x/include/asm/sembuf.h new file +6 -0
new file mode 100644
index 0000000..77a6b25
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_SEMBUF_H
+#define _ASM_C6X_SEMBUF_H
+
+#include <asm-generic/sembuf.h>
+
+#endif /* _ASM_C6X_SEMBUF_H */
arch/c6x/include/asm/serial.h new file +25 -0
new file mode 100644
index 0000000..47bc618
@@ -0,0 +1,25 @@
+/*
+ *  linux/include/asm-c6x/serial.h
+ *
+ *  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_SERIAL_H
+#define _ASM_C6X_SERIAL_H
+
+#include <mach/board.h>
+
+#ifndef BASE_BAUD
+/*
+ * This assumes you have a 1.8432 MHz clock for your UART.
+ */
+#define BASE_BAUD (1843200 / 16)
+#endif
+
+#endif /* _ASM_C6X_SERIAL_H */
arch/c6x/include/asm/setup.h new file +49 -0

49 lines not on this page · raw message

arch/c6x/include/asm/sgmii.h new file +53 -0

53 lines not on this page · raw message

arch/c6x/include/asm/shmbuf.h new file +6 -0
new file mode 100644
index 0000000..9e677aa
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_SHMBUF_H
+#define _ASM_C6X_SHMBUF_H
+
+#include <asm-generic/shmbuf.h>
+
+#endif /* _ASM_C6X_SHMBUF_H */
arch/c6x/include/asm/shmparam.h new file +6 -0
new file mode 100644
index 0000000..0e06c26
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_SHMPARAM_H
+#define _ASM_C6X_SHMPARAM_H
+
+#include <asm-generic/shmparam.h>
+
+#endif /* _ASM_C6X_SHMPARAM_H */
arch/c6x/include/asm/sigcontext.h new file +83 -0

23 lines not on this page · raw message

arch/c6x/include/asm/siginfo.h new file +6 -0
new file mode 100644
index 0000000..01ce660

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/signal.h new file +17 -0
new file mode 100644
index 0000000..f1cd870

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/socket.h new file +6 -0
new file mode 100644
index 0000000..dc28af3

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/sockios.h new file +6 -0
new file mode 100644
index 0000000..fd7ebd9

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/stat.h new file +6 -0
new file mode 100644
index 0000000..8aafa67

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/statfs.h new file +6 -0
new file mode 100644
index 0000000..b111ba0

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/string.h new file +29 -0
new file mode 100644
index 0000000..bfdabde

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/swab.h new file +6 -0
new file mode 100644
index 0000000..909986f

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/syscalls.h new file +58 -0

58 lines not on this page · raw message

arch/c6x/include/asm/system.h new file +194 -0

194 lines not on this page · raw message

arch/c6x/include/asm/termbits.h new file +6 -0
new file mode 100644
index 0000000..146dfad

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/termios.h new file +6 -0
new file mode 100644
index 0000000..77fd1da

Lines of this file are not shown. View the raw message.

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

123 lines not on this page · raw message

arch/c6x/include/asm/timer.h new file +31 -0
new file mode 100644
index 0000000..8127a63

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/timex.h new file +43 -0

43 lines not on this page · raw message

arch/c6x/include/asm/tlb.h new file +8 -0
new file mode 100644
index 0000000..8709e5e

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/tlbflush.h new file +6 -0
new file mode 100644
index 0000000..e00f0b9

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/topology.h new file +6 -0
new file mode 100644
index 0000000..30767fd

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/traps.h new file +39 -0
new file mode 100644
index 0000000..d2ab603

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/types.h new file +6 -0
new file mode 100644
index 0000000..c2fe78b

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/uaccess.h new file +103 -0

103 lines not on this page · raw message

arch/c6x/include/asm/ucontext.h new file +6 -0
new file mode 100644
index 0000000..026bc0a

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/unaligned.h new file +290 -0

290 lines not on this page · raw message

arch/c6x/include/asm/unistd.h new file +32 -0
new file mode 100644
index 0000000..9064c6b

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/user.h new file +1 -0
new file mode 100644
index 0000000..4792a60

Lines of this file are not shown. View the raw message.

arch/c6x/include/asm/vga.h new file +6 -0
new file mode 100644
index 0000000..d924655

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.2.5

Part of the diff is not shown here. View the raw message.

#12 lore raw

PATCH 12/16 C6X: add platform files

In reply to Mark Salter
---
 arch/c6x/platforms/Kconfig                       |   63 ++
 arch/c6x/platforms/Makefile                      |   16 +
 arch/c6x/platforms/board-dsk6455.c               |  227 +++++++
 arch/c6x/platforms/board-evm6457.c               |  101 +++
 arch/c6x/platforms/board-evm6472.c               |  144 ++++
 arch/c6x/platforms/board-evm6474.c               |  112 ++++
 arch/c6x/platforms/board-evm6474lite.c           |  110 ++++
 arch/c6x/platforms/include/mach/board-dsk6455.h  |   53 ++
 arch/c6x/platforms/include/mach/board-evm6457.h  |   25 +
 arch/c6x/platforms/include/mach/board-evm6472.h  |   23 +
 arch/c6x/platforms/include/mach/board-evm6474.h  |   23 +
 arch/c6x/platforms/include/mach/board-evm6474l.h |   23 +
 arch/c6x/platforms/include/mach/board.h          |   32 +
 arch/c6x/platforms/include/mach/cache.h          |  104 +++
 arch/c6x/platforms/include/mach/dscr.h           |  184 ++++++
 arch/c6x/platforms/include/mach/emif.h           |   63 ++
 arch/c6x/platforms/include/mach/gemac.h          |  763 ++++++++++++++++++++++
 arch/c6x/platforms/include/mach/gmdio.h          |   18 +
 arch/c6x/platforms/include/mach/hardware.h       |  194 ++++++
 arch/c6x/platforms/include/mach/irq-c645x.h      |  131 ++++
 arch/c6x/platforms/include/mach/irq-c6472.h      |  138 ++++
 arch/c6x/platforms/include/mach/irq-c6474.h      |  323 +++++++++
 arch/c6x/platforms/include/mach/irq.h            |   52 ++
 arch/c6x/platforms/include/mach/pll.h            |  134 ++++
 arch/c6x/platforms/include/mach/timer.h          |  104 +++
 arch/c6x/platforms/phy.c                         |  141 ++++
 arch/c6x/platforms/platform-c64xx.c              |  439 +++++++++++++
 arch/c6x/platforms/sgmii.c                       |   83 +++
 28 files changed, 3823 insertions(+), 0 deletions(-)
 create mode 100644 arch/c6x/platforms/Kconfig
 create mode 100644 arch/c6x/platforms/Makefile
 create mode 100644 arch/c6x/platforms/board-dsk6455.c
 create mode 100644 arch/c6x/platforms/board-evm6457.c
 create mode 100644 arch/c6x/platforms/board-evm6472.c
 create mode 100644 arch/c6x/platforms/board-evm6474.c
 create mode 100644 arch/c6x/platforms/board-evm6474lite.c
 create mode 100644 arch/c6x/platforms/include/mach/board-dsk6455.h
 create mode 100644 arch/c6x/platforms/include/mach/board-evm6457.h
 create mode 100644 arch/c6x/platforms/include/mach/board-evm6472.h
 create mode 100644 arch/c6x/platforms/include/mach/board-evm6474.h
 create mode 100644 arch/c6x/platforms/include/mach/board-evm6474l.h
 create mode 100644 arch/c6x/platforms/include/mach/board.h
 create mode 100644 arch/c6x/platforms/include/mach/cache.h
 create mode 100644 arch/c6x/platforms/include/mach/dscr.h
 create mode 100644 arch/c6x/platforms/include/mach/emif.h
 create mode 100644 arch/c6x/platforms/include/mach/gemac.h
 create mode 100644 arch/c6x/platforms/include/mach/gmdio.h
 create mode 100644 arch/c6x/platforms/include/mach/hardware.h
 create mode 100644 arch/c6x/platforms/include/mach/irq-c645x.h
 create mode 100644 arch/c6x/platforms/include/mach/irq-c6472.h
 create mode 100644 arch/c6x/platforms/include/mach/irq-c6474.h
 create mode 100644 arch/c6x/platforms/include/mach/irq.h
 create mode 100644 arch/c6x/platforms/include/mach/pll.h
 create mode 100644 arch/c6x/platforms/include/mach/timer.h
 create mode 100644 arch/c6x/platforms/phy.c
 create mode 100644 arch/c6x/platforms/platform-c64xx.c
 create mode 100644 arch/c6x/platforms/sgmii.c
arch/c6x/platforms/Kconfig new file +63 -0
new file mode 100644
index 0000000..a271f0f
@@ -0,0 +1,63 @@
+
+config SOC_TMS320C6455
+	bool "TMS320C6455"
+	default n
+	select TMS320C64XPLUS
+	select PLL_TCI648X
+	select TIMER_TCI648X
+	select PIC_C64XPLUS
+
+config SOC_TMS320C6457
+	bool "TMS320C6457"
+	default n
+	select TMS320C64XPLUS
+	select PLL_TCI648X
+	select TIMER_TCI648X
+	select PIC_C64XPLUS
+	select SGMII
+
+config SOC_TMS320C6472
+	bool "TMS320C6472"
+	default n
+	select TMS320C64XPLUS
+	select PLL_TCI648X
+	select TIMER_TCI648X
+	select PIC_C64XPLUS
+
+config SOC_TMS320C6474
+	bool "TMS320C6474"
+	default n
+	select TMS320C64XPLUS
+	select PLL_TCI648X
+	select TIMER_TCI648X
+	select PIC_C64XPLUS
+	select SGMII
+
+comment "Board Selection"
+choice
+	prompt "Board"
+	help
+	  This option specifies the specific board for which the kernel will be
+	  compiled.
+
+config ARCH_BOARD_DSK6455
+	bool "DSK6455"
+	select SOC_TMS320C6455
+
+config ARCH_BOARD_EVM6457
+	bool "EVM6472"
+	select SOC_TMS320C6457
+
+config ARCH_BOARD_EVM6472
+	bool "EVM6472"
+	select SOC_TMS320C6472
+
+config ARCH_BOARD_EVM6474
+	bool "EVM6474"
+	select SOC_TMS320C6474
+
+config ARCH_BOARD_EVM6474L
+	bool "EVM6474L"
+	select SOC_TMS320C6474
+
+endchoice
arch/c6x/platforms/Makefile new file +16 -0
new file mode 100644
index 0000000..da0f247
@@ -0,0 +1,16 @@
+#
+# Makefile for arch/c6x/platforms
+#
+# Copyright 2010, 2011 Texas Instruments Incorporated
+#
+
+obj-$(CONFIG_TMS320C6X) += platform-c64xx.o
+
+obj-$(CONFIG_SGMII)		+= sgmii.o
+
+# Board objects
+obj-$(CONFIG_ARCH_BOARD_DSK6455)  += board-dsk6455.o
+obj-$(CONFIG_ARCH_BOARD_EVM6457)  += board-evm6457.o phy.o
+obj-$(CONFIG_ARCH_BOARD_EVM6472)  += board-evm6472.o phy.o
+obj-$(CONFIG_ARCH_BOARD_EVM6474)  += board-evm6474.o phy.o
+obj-$(CONFIG_ARCH_BOARD_EVM6474L) += board-evm6474lite.o phy.o
arch/c6x/platforms/board-dsk6455.c new file +227 -0

227 lines not on this page · raw message

arch/c6x/platforms/board-evm6457.c new file +101 -0

101 lines not on this page · raw message

arch/c6x/platforms/board-evm6472.c new file +144 -0

144 lines not on this page · raw message

arch/c6x/platforms/board-evm6474.c new file +112 -0

112 lines not on this page · raw message

arch/c6x/platforms/board-evm6474lite.c new file +110 -0

110 lines not on this page · raw message

arch/c6x/platforms/include/mach/board-dsk6455.h new file +53 -0

53 lines not on this page · raw message

arch/c6x/platforms/include/mach/board-evm6457.h new file +25 -0
new file mode 100644
index 0000000..cc6006c
@@ -0,0 +1,25 @@
+/*
+ *  linux/arch/c6x/platforms/mach/board-evm6457.h
+ *
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2010, 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.
+ */
+
+/*
+ * Board memory
+ */
+#define BOARD_RAM_SIZE	0x10000000
+
+/*
+ * Timer definitions
+ */
+#define LINUX_TIMER_SRC TIMER_1
+#define LINUX_TIMER_IRQ IRQ_TINT1
+
+
arch/c6x/platforms/include/mach/board-evm6472.h new file +23 -0
new file mode 100644
index 0000000..5e33d30
@@ -0,0 +1,23 @@
+/*
+ *  linux/arch/c6x/platforms/mach/board-evm6472.h
+ *
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2010, 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.
+ */
+
+/*
+ * Board memory
+ */
+#define BOARD_RAM_SIZE	0x10000000
+
+/*
+ * Timer definitions
+ */
+#define LINUX_TIMER_SRC (TIMER_0 + get_coreid())
+#define LINUX_TIMER_IRQ IRQ_TINT
arch/c6x/platforms/include/mach/board-evm6474.h new file +23 -0
new file mode 100644
index 0000000..a5f8f94
@@ -0,0 +1,23 @@
+/*
+ *  linux/arch/c6x/platforms/mach/board-evm6474.h
+ *
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2010, 2011 Texas Instruments Incorporated
+ *  Author: Sandeep Paulraj <[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.
+ */
+
+/*
+ * Board memory
+ */
+#define BOARD_RAM_SIZE	0x08000000
+
+/*
+ * Timer definitions
+ */
+#define LINUX_TIMER_SRC (TIMER_5 - get_coreid())
+#define LINUX_TIMER_IRQ (IRQ_TINT5 - (get_coreid() << 1))
arch/c6x/platforms/include/mach/board-evm6474l.h new file +23 -0
new file mode 100644
index 0000000..a5f8f94
@@ -0,0 +1,23 @@
+/*
+ *  linux/arch/c6x/platforms/mach/board-evm6474.h
+ *
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2010, 2011 Texas Instruments Incorporated
+ *  Author: Sandeep Paulraj <[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.
+ */
+
+/*
+ * Board memory
+ */
+#define BOARD_RAM_SIZE	0x08000000
+
+/*
+ * Timer definitions
+ */
+#define LINUX_TIMER_SRC (TIMER_5 - get_coreid())
+#define LINUX_TIMER_IRQ (IRQ_TINT5 - (get_coreid() << 1))
arch/c6x/platforms/include/mach/board.h new file +32 -0
new file mode 100644
index 0000000..a03dd27
@@ -0,0 +1,32 @@
+/*
+ *  linux/arch/c6x/platforms/mach/board.h
+ *
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  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_BOARD_H
+#define __ASM_C6X_BOARD_H
+
+#ifdef CONFIG_ARCH_BOARD_DSK6455
+#include <mach/board-dsk6455.h>
+#endif
+#ifdef CONFIG_ARCH_BOARD_EVM6457
+#include <mach/board-evm6457.h>
+#endif
+#ifdef CONFIG_ARCH_BOARD_EVM6472
+#include <mach/board-evm6472.h>
+#endif
+#ifdef CONFIG_ARCH_BOARD_EVM6474
+#include <mach/board-evm6474.h>
+#endif
+#ifdef CONFIG_ARCH_BOARD_EVM6474L
+#include <mach/board-evm6474l.h>
+#endif
+
+#endif
arch/c6x/platforms/include/mach/cache.h new file +104 -0

104 lines not on this page · raw message

arch/c6x/platforms/include/mach/dscr.h new file +184 -0

184 lines not on this page · raw message

arch/c6x/platforms/include/mach/emif.h new file +63 -0

63 lines not on this page · raw message

arch/c6x/platforms/include/mach/gemac.h new file +763 -0

763 lines not on this page · raw message

arch/c6x/platforms/include/mach/gmdio.h new file +18 -0
new file mode 100644
index 0000000..aad05ee
@@ -0,0 +1,18 @@
+/*
+ *  linux/arch/c6x/platforms/include/mach/gmdio.h
+ *
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  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 __MACH_C6X_GMDIO_H
+#define __MACH_C6X_GMDIO_H
+
+#define MDIO_REG_BASE	  0x02c81800
+
+#endif	/* __MACH_C6X_GMDIO_H */
arch/c6x/platforms/include/mach/hardware.h new file +194 -0

194 lines not on this page · raw message

arch/c6x/platforms/include/mach/irq-c645x.h new file +131 -0

131 lines not on this page · raw message

arch/c6x/platforms/include/mach/irq-c6472.h new file +138 -0

138 lines not on this page · raw message

arch/c6x/platforms/include/mach/irq-c6474.h new file +323 -0

323 lines not on this page · raw message

arch/c6x/platforms/include/mach/irq.h new file +52 -0

52 lines not on this page · raw message

arch/c6x/platforms/include/mach/pll.h new file +134 -0

78 lines not on this page · raw message

arch/c6x/platforms/include/mach/timer.h new file +104 -0

104 lines not on this page · raw message

arch/c6x/platforms/phy.c new file +141 -0

141 lines not on this page · raw message

arch/c6x/platforms/platform-c64xx.c new file +439 -0

439 lines not on this page · raw message

arch/c6x/platforms/sgmii.c new file +83 -0

83 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.2.5

Part of the diff is not shown here. View the raw message.

#14 lore raw

PATCH 14/16 C6X: add default configs

In reply to Mark Salter
---
 arch/c6x/configs/ti_dsk6455_defconfig       |  970 ++++++++++++++++++++++++++
 arch/c6x/configs/ti_evmc6457_defconfig      |  980 ++++++++++++++++++++++++++
 arch/c6x/configs/ti_evmc6472_defconfig      |  982 +++++++++++++++++++++++++++
 arch/c6x/configs/ti_evmc6474_defconfig      |  966 ++++++++++++++++++++++++++
 arch/c6x/configs/ti_evmc6474_lite_defconfig |  980 ++++++++++++++++++++++++++
 5 files changed, 4878 insertions(+), 0 deletions(-)
 create mode 100644 arch/c6x/configs/ti_dsk6455_defconfig
 create mode 100644 arch/c6x/configs/ti_evmc6457_defconfig
 create mode 100644 arch/c6x/configs/ti_evmc6472_defconfig
 create mode 100644 arch/c6x/configs/ti_evmc6474_defconfig
 create mode 100644 arch/c6x/configs/ti_evmc6474_lite_defconfig
arch/c6x/configs/ti_dsk6455_defconfig new file +970 -0
new file mode 100644
index 0000000..3487af4
@@ -0,0 +1,970 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.34
+# Fri Jul 30 07:41:30 2010
+#
+CONFIG_TMS320C6X=y
+# CONFIG_MMU is not set
+CONFIG_ZONE_DMA=y
+# CONFIG_SBUS is not set
+# CONFIG_FPU is not set
+# CONFIG_HIGHMEM is not set
+# CONFIG_NUMA is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_BUG=y
+CONFIG_COMMON_CLKDEV=y
+# CONFIG_BIG_KERNEL is not set
+# CONFIG_XIP_KERNEL is not set
+CONFIG_XIP_KERNEL_TEXT_ADDR=0xE0000000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_POSIX_MQUEUE_SYSCTL=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_FHANDLE is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_HARDIRQS=y
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+CONFIG_IPC_NS=y
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_NET_NS is not set
+# CONFIG_SCHED_AUTOGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_INITRAMFS_ROOT_UID=0
+CONFIG_INITRAMFS_ROOT_GID=0
+CONFIG_RD_GZIP=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+# CONFIG_RD_XZ is not set
+CONFIG_RD_LZO=y
+# CONFIG_INITRAMFS_COMPRESSION_NONE is not set
+# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set
+# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
+# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
+# CONFIG_INITRAMFS_COMPRESSION_LZO is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EXPERT=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_AIO=y
+CONFIG_EMBEDDED=y
+
+#
+# Kernel Performance Events And Counters
+#
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_SLUB_DEBUG is not set
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+# CONFIG_MMAP_ALLOW_UNINITIALIZED is not set
+# CONFIG_PROFILING is not set
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+CONFIG_BLK_DEV_BSG=y
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+# CONFIG_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+CONFIG_INLINE_SPIN_UNLOCK=y
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_READ_TRYLOCK is not set
+# CONFIG_INLINE_READ_LOCK is not set
+# CONFIG_INLINE_READ_LOCK_BH is not set
+# CONFIG_INLINE_READ_LOCK_IRQ is not set
+# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
+CONFIG_INLINE_READ_UNLOCK=y
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_WRITE_TRYLOCK is not set
+# CONFIG_INLINE_WRITE_LOCK is not set
+# CONFIG_INLINE_WRITE_LOCK_BH is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
+CONFIG_INLINE_WRITE_UNLOCK=y
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
+# CONFIG_MUTEX_SPIN_ON_OWNER is not set
+# CONFIG_FREEZER is not set
+CONFIG_CMDLINE="console=hvc rw ip=dhcp"
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_FORCE_MAX_ZONEORDER=13
+
+#
+# Processor type and features
+#
+CONFIG_TMS320C64XPLUS=y
+CONFIG_HVC_C6X=y
+CONFIG_SOC_TMS320C6455=y
+# CONFIG_SOC_TMS320C6457 is not set
+# CONFIG_SOC_TMS320C6472 is not set
+# CONFIG_SOC_TMS320C6474 is not set
+
+#
+# Board Selection
+#
+CONFIG_ARCH_BOARD_DSK6455=y
+# CONFIG_ARCH_BOARD_EVM6457 is not set
+# CONFIG_ARCH_BOARD_EVM6472 is not set
+# CONFIG_ARCH_BOARD_EVM6474 is not set
+# CONFIG_ARCH_BOARD_EVM6474L is not set
+# CONFIG_USE_RT_TIMER is not set
+# CONFIG_SGMII is not set
+CONFIG_TMS320C6X_CACHES_ON=y
+CONFIG_KERNEL_RAM_BASE_ADDRESS=0xe0000000
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_VIRT_TO_BUS=y
+CONFIG_NOMMU_INITIAL_TRIM_EXCESS=1
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_SCHED_HRTICK=y
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+# CONFIG_PCI is not set
+
+#
+# Executable file formats
+#
+# CONFIG_BINFMT_FLAT is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE_DEMUX is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+CONFIG_INET_LRO=y
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_RDS is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_L2TP is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+# CONFIG_BATMAN_ADV is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+CONFIG_WIRELESS=y
+# CONFIG_CFG80211 is not set
+# CONFIG_LIB80211 is not set
+
+#
+# CFG80211 needs to be enabled for MAC80211
+#
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
+# CONFIG_CEPH_LIB is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH=""
+# CONFIG_DEVTMPFS is not set
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_TESTS is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_SM_FTL is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+CONFIG_MTD_RAM=y
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=m
+# CONFIG_MTD_PHYSMAP_COMPAT is not set
+CONFIG_MTD_UCLINUX=y
+CONFIG_MTD_PLATRAM=y
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=16384
+CONFIG_MTDRAM_ERASE_SIZE=128
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND_ECC=y
+# CONFIG_MTD_NAND_ECC_SMC is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_BCH is not set
+# CONFIG_MTD_SM_COMMON is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+
+#
+# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
+#
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=2
+CONFIG_BLK_DEV_RAM_SIZE=17000
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_RBD is not set
+# CONFIG_SENSORS_LIS3LV02D is not set
+# CONFIG_MISC_DEVICES is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_MII is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_ETHOC is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+# CONFIG_KS8851_MLL is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_STMMAC_ETH is not set
+CONFIG_NETDEV_10000=y
+CONFIG_TMS320C64X_GEMAC=y
+CONFIG_WLAN=y
+# CONFIG_HOSTAP is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+
+#
+# CAIF transport drivers
+#
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+CONFIG_NETCONSOLE=y
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
+CONFIG_DEVKMEM=y
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_CORE is not set
+# CONFIG_SERIAL_CORE_CONSOLE is not set
+# CONFIG_SERIAL_TIMBERDALE is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_TTY_PRINTK is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM_TIMERIOMEM is not set
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_R3964 is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_RAMOOPS is not set
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+CONFIG_MFD_SUPPORT=y
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_REGULATOR is not set
+# CONFIG_MEDIA_SUPPORT is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_NFC_DEVICES is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_C6X_PLATFORM_DEVICES=y
+CONFIG_PLL_TCI648X=y
+CONFIG_TIMER_TCI648X=y
+CONFIG_PIC_C64XPLUS=y
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+CONFIG_EXT3_FS=m
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=m
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_FANOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_QUOTACTL is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+# CONFIG_MSDOS_FS is not set
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_LOGFS is not set
+CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+CONFIG_ROMFS_FS=y
+# CONFIG_ROMFS_BACKED_BY_BLOCK is not set
+CONFIG_ROMFS_BACKED_BY_MTD=y
+# CONFIG_ROMFS_BACKED_BY_BOTH is not set
+# CONFIG_ROMFS_ON_BLOCK is not set
+# CONFIG_PSTORE is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_CEPH_FS is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_NLS=m
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=m
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY_DMESG_RESTRICT is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+CONFIG_DEFAULT_SECURITY_DAC=y
+CONFIG_DEFAULT_SECURITY=""
+CONFIG_CRYPTO=m
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_ALGAPI=m
+CONFIG_CRYPTO_ALGAPI2=m
+CONFIG_CRYPTO_AEAD2=m
+CONFIG_CRYPTO_BLKCIPHER2=m
+CONFIG_CRYPTO_HASH=m
+CONFIG_CRYPTO_HASH2=m
+CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG2=m
+CONFIG_CRYPTO_PCOMP2=m
+CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=m
+CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_WORKQUEUE=m
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=m
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_GHASH is not set
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=m
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=m
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_ARC4=m
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_ZLIB is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+CONFIG_CRYPTO_ANSI_CPRNG=m
+# CONFIG_CRYPTO_USER_API_HASH is not set
+# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
+# CONFIG_CRYPTO_HW is not set
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+CONFIG_CRC16=y
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_LZO_DECOMPRESS=y
+# CONFIG_XZ_DEC is not set
+# CONFIG_XZ_DEC_BCJ is not set
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_BZIP2=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DECOMPRESS_LZO=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
+# CONFIG_AVERAGE is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
+CONFIG_ENABLE_WARN_DEPRECATED=y
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_STRIP_ASM_SYMS is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_SECTION_MISMATCH is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_HARDLOCKUP_DETECTOR is not set
+# CONFIG_SLUB_STATS is not set
+# CONFIG_SPARSE_RCU_POINTER is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_SAMPLES is not set
+# CONFIG_TEST_KSTRTOX is not set
+CONFIG_EARLY_PRINTK=y
+CONFIG_ACCESS_CHECK=y
arch/c6x/configs/ti_evmc6457_defconfig new file +980 -0

980 lines not on this page · raw message

arch/c6x/configs/ti_evmc6472_defconfig new file +982 -0

982 lines not on this page · raw message

arch/c6x/configs/ti_evmc6474_defconfig new file +966 -0

68 lines not on this page · raw message

arch/c6x/configs/ti_evmc6474_lite_defconfig new file +980 -0

980 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.2.5

Part of the diff is not shown here. View the raw message.

#3 lore raw

PATCH 3/16 add driver for C64x+ ethernet driver

In reply to Mark Salter

From: Aurelien Jacquiot <[email protected]>

This patch adds a network driver to support the ethernet interface found on several Texas Instruments C64X+ based System on Chips. In particular, this driver has been tested on the TMS320C6455, TMS320C6457, TMS320C6472, and TMS320C6474 parts.

---
 drivers/net/Kconfig     |    8 +
 drivers/net/Makefile    |    2 +
 drivers/net/c6x_gemac.c | 1582 +++++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/c6x_gmdio.c |  514 +++++++++++++++
 4 files changed, 2106 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/c6x_gemac.c
 create mode 100644 drivers/net/c6x_gmdio.c
drivers/net/Kconfig +8 -0
index dc280bc..5eb46a1 100644
@@ -2910,6 +2910,14 @@ config BNA
 
 	  <http://support.brocade.com>
 
+config TMS320C64X_GEMAC
+	tristate "TMS320C64X GEMAC Ethernet Driver Support"
+	depends on TMS320C64XPLUS
+	default n
+	help
+	  This driver supports the C64X+ SoC family ethernet
+	  interface.
+
 source "drivers/net/sfc/Kconfig"
 
 source "drivers/net/benet/Kconfig"
drivers/net/Makefile +2 -0
index 01b604a..d768fde 100644
@@ -259,6 +259,8 @@ obj-$(CONFIG_MLX4_CORE) += mlx4/
 obj-$(CONFIG_ENC28J60) += enc28j60.o
 obj-$(CONFIG_ETHOC) += ethoc.o
 obj-$(CONFIG_GRETH) += greth.o
+obj-$(CONFIG_TMS320C64X_GEMAC) += gemac.o
+gemac-objs := c6x_gemac.o c6x_gmdio.o
 
 obj-$(CONFIG_XTENSA_XT2000_SONIC) += xtsonic.o
 
drivers/net/c6x_gemac.c new file +1582 -0

1,582 lines not on this page · raw message

drivers/net/c6x_gmdio.c new file +514 -0

514 lines not on this page · raw message

Signature · 1 line
1.6.2.5
#15 lore raw

PATCH 15/16 Add new elf binfmt support for DSBT

In reply to Mark Salter

This patch adds support for a new ELF-based binary format for systems without an MMU. DSBT stands for Data Segment Base Table and supports shared text segments while allowing for non-shared data. In this regard, it is similar to FDPIC, but differs in approach. FDPIC ties data segment references to function pointers and doubles the size of function pointers in doing so. DSBT handles function pointers in the normal way, but data accesses are performed relative to a dedicated register pointing to the correct data segment. FDPIC callers are responsible for setting up the correct data reference before calling a function in another DSO. With DSBT, the callee is responsible for setting up the correct data segment pointer.

This format was developed by Texas Instruments for use by their C6X family of DSPs. However, this patch is not specific to TI DSPs and could be supported by other architectures.

---
 fs/Kconfig.binfmt        |   10 +
 fs/Makefile              |    1 +
 fs/binfmt_elf_dsbt.c     | 1035 ++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/elf-dsbt.h |   88 ++++
 4 files changed, 1134 insertions(+), 0 deletions(-)
 create mode 100644 fs/binfmt_elf_dsbt.c
 create mode 100644 include/linux/elf-dsbt.h
fs/Kconfig.binfmt +10 -0
index 79e2ca7..8fc5337 100644
@@ -40,6 +40,16 @@ config BINFMT_ELF_FDPIC
 
 	  It is also possible to run FDPIC ELF binaries on MMU linux also.
 
+config BINFMT_ELF_DSBT
+	bool "Kernel support for DSBT ELF binaries"
+	default y
+	depends on (TMS320C6X && !MMU)
+	help
+	  ELF DSBT binaries are based on ELF and are similar to FDPIC in that
+	  individual load segments can be placed independently of each other.
+	  Also like FDPIC, DSBT is designed to allow systems with no MMU to
+	  share text segments while data segments are not.
+
 config CORE_DUMP_DEFAULT_ELF_HEADERS
 	bool "Write ELF core dumps with partial segments"
 	default y
fs/Makefile +1 -0
index fb68c2b..95c500b 100644
@@ -40,6 +40,7 @@ obj-y				+= binfmt_script.o
 obj-$(CONFIG_BINFMT_ELF)	+= binfmt_elf.o
 obj-$(CONFIG_COMPAT_BINFMT_ELF)	+= compat_binfmt_elf.o
 obj-$(CONFIG_BINFMT_ELF_FDPIC)	+= binfmt_elf_fdpic.o
+obj-$(CONFIG_BINFMT_ELF_DSBT)	+= binfmt_elf_dsbt.o
 obj-$(CONFIG_BINFMT_SOM)	+= binfmt_som.o
 obj-$(CONFIG_BINFMT_FLAT)	+= binfmt_flat.o
 
fs/binfmt_elf_dsbt.c new file +1035 -0

1,035 lines not on this page · raw message

include/linux/elf-dsbt.h new file +88 -0

88 lines not on this page · raw message

Signature · 1 line
1.6.2.5
#10 lore raw

PATCH 10/16 C6X: add mm files

In reply to Mark Salter
---
 arch/c6x/mm/Makefile       |   10 ++
 arch/c6x/mm/dma-coherent.c |  342 ++++++++++++++++++++++++++++++++++++++++++++
 arch/c6x/mm/init.c         |  115 +++++++++++++++
 3 files changed, 467 insertions(+), 0 deletions(-)
 create mode 100644 arch/c6x/mm/Makefile
 create mode 100644 arch/c6x/mm/dma-coherent.c
 create mode 100644 arch/c6x/mm/init.c
arch/c6x/mm/Makefile new file +10 -0
new file mode 100644
index 0000000..75bf2af
@@ -0,0 +1,10 @@
+#
+# Makefile for the linux c6x-specific parts of the memory manager.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+# Note 2! The CFLAGS definition is now in the main makefile...
+
+obj-y	 := init.o dma-coherent.o
arch/c6x/mm/dma-coherent.c new file +342 -0

342 lines not on this page · raw message

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

115 lines not on this page · raw message

Signature · 1 line
1.6.2.5
#7 lore raw

PATCH 7/16 C6X: add toplevel configury and makefile

In reply to Mark Salter
---
 arch/c6x/Kconfig       |  213 ++++++++++++++++++++++++++++++++++++++++++++++++
 arch/c6x/Kconfig.debug |   25 ++++++
 arch/c6x/Makefile      |   33 ++++++++
 3 files changed, 271 insertions(+), 0 deletions(-)
 create mode 100644 arch/c6x/Kconfig
 create mode 100644 arch/c6x/Kconfig.debug
 create mode 100644 arch/c6x/Makefile
arch/c6x/Kconfig new file +213 -0
new file mode 100644
index 0000000..d4881c1
@@ -0,0 +1,213 @@
+#
+# For a description of the syntax of this configuration file,
+# see Documentation/kbuild/kconfig-language.txt.
+#
+
+config TMS320C6X
+	def_bool y
+	select GENERIC_IRQ_SHOW
+	select HAVE_GENERIC_HARDIRQS
+	select GENERIC_FIND_FIRST_BIT
+	select GENERIC_FIND_NEXT_BIT
+	select GENERIC_FIND_LAST_BIT
+	select GENERIC_FIND_BIT_LE
+
+config MMU
+	def_bool n
+
+config ZONE_DMA
+	def_bool y
+
+config SBUS
+	def_bool n
+
+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_FIND_NEXT_BIT
+	def_bool y
+
+config GENERIC_HWEIGHT
+	def_bool y
+
+config GENERIC_TIME
+	def_bool y
+
+config GENERIC_CLOCKEVENTS
+	def_bool y
+
+config GENERIC_CLOCKEVENTS_BUILD
+	def_bool y
+	depends on GENERIC_CLOCKEVENTS
+
+config GENERIC_CLOCKEVENTS_BROADCAST
+	bool
+
+config GENERIC_BUG
+	def_bool y
+
+config COMMON_CLKDEV
+	def_bool y
+
+config 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.
+
+config XIP_KERNEL
+	bool "Kernel Execute-In-Place"
+	help
+	  Execute-In-Place allows the kernel to run from non-volatile storage
+	  directly addressable by the CPU, such as NOR flash. This saves RAM
+	  space since the text section of the kernel is not loaded from flash
+	  to RAM.  Read-write sections, such as the data section and stack,
+	  are still copied to RAM.  The XIP kernel is not compressed since
+	  it has to run directly from flash, so it will take more space to
+	  store it.  The flash address used to link the kernel object files,
+	  and for storing it, is configuration dependent. Therefore, if you
+	  say Y here, you must know the proper physical address where to
+	  store the kernel image depending on your own flash memory usage.
+
+	  If unsure, say N.
+
+config XIP_KERNEL_TEXT_ADDR
+	hex "XIP Kernel Physical Location"
+	depends on XIP_KERNEL
+	default "0xB0000000"
+	help
+	  This is the physical address where the kernel image will be
+	  stored.  This address is dependent on your own platform
+	  device constraints.
+
+source "init/Kconfig"
+
+# Use the generic interrupt handling code in kernel/irq/
+
+source "kernel/Kconfig.freezer"
+
+config CMDLINE
+	string "Kernel command line"
+	default "console=ttyS0,57600"
+
+config CPU_BIG_ENDIAN
+	bool "Build big-endian kernel"
+	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
+	default "13"
+
+menu "Processor type and features"
+
+config TMS320C64XPLUS
+	bool "TMS320C64X+"
+	select SERIAL_CORE
+
+config HVC_C6X
+	bool "HVC console (CIO)"
+	select HVC_DRIVER
+	def_bool y
+
+source "arch/c6x/platforms/Kconfig"
+
+config USE_RT_TIMER
+	bool "Compensate for lost ticks"
+	default n
+
+config SGMII
+	bool "Ethernet SGMII support"
+	default n
+
+config TMS320C64X_GEMAC_0
+	bool "First Ethernet interface"
+	depends on TMS320C64X_GEMAC && SOC_TMS320C6472
+	default y
+
+config TMS320C64X_GEMAC_1
+	bool "Second Ethernet interface"
+	depends on TMS320C64X_GEMAC && SOC_TMS320C6472
+	default n
+
+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 "Bus options (PCI, PCMCIA, EISA, MCA, ISA)"
+
+config PCI
+	bool "PCI support"
+	help
+	  Support for PCI bus.
+endmenu
+
+menu "Executable file formats"
+
+source "fs/Kconfig.binfmt"
+
+endmenu
+
+menu "Power management options"
+
+config PM
+	bool "Power Management support"
+	help
+	  Support processor power management modes
+
+endmenu
+
+source "net/Kconfig"
+
+source "drivers/Kconfig"
+
+source "fs/Kconfig"
+
+source "security/Kconfig"
+
+source "crypto/Kconfig"
+
+source "lib/Kconfig"
+
+source "arch/c6x/Kconfig.debug"
+
arch/c6x/Kconfig.debug new file +25 -0
new file mode 100644
index 0000000..49b18b2
@@ -0,0 +1,25 @@
+menu "Kernel hacking"
+
+source "lib/Kconfig.debug"
+
+config EARLY_PRINTK
+	bool "Early printk"
+	default n
+	help
+	  This option enables special console drivers which allow the kernel
+	  to print messages very early in the bootup process.
+
+	  This is useful for kernel debugging when your machine crashes very
+	  early before the console code is initialized. After enabling this
+	  feature, you must add "earlyprintk=hvc" to the command line (bootargs).
+
+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 +33 -0
new file mode 100644
index 0000000..3561875
@@ -0,0 +1,33 @@
+#
+# linux/arch/c6x/Makefile
+#
+# This file is subject to the terms and conditions of the GNU General Public
+# License.  See the file "COPYING" in the main directory of this archive
+# for more details.
+#
+
+cflags-y := -D__linux__ -D__TMS320C6X__
+
+cflags-$(CONFIG_TMS320C64XPLUS) += -D__TMS320C6XPLUS__ -march=c64x+ -msdata=none -mno-dsbt
+
+cflags-$(CONFIG_BIG_KERNEL) += -mlong-calls
+
+CFLAGS_MODULE   += -mlong-calls
+
+KBUILD_CPPFLAGS += -I$(srctree)/arch/c6x/platforms/include -I$(obj)/arch/c6x/kernel
+
+KBUILD_CFLAGS   += $(cflags-y)
+KBUILD_AFLAGS   += $(cflags-y)
+
+ifdef CONFIG_CPU_BIG_ENDIAN
+KBUILD_CFLAGS   += -mbig-endian
+KBUILD_AFLAGS	+= -mbig-endian
+LINKFLAGS	+= -mbig-endian
+KBUILD_LDFLAGS	+= -mbig-endian
+LDFLAGS	+= -EB
+endif
+
+head-y		:= arch/c6x/kernel/head.o
+core-y		+= arch/c6x/kernel/ arch/c6x/mm/ arch/c6x/platforms/
+libs-y		+= arch/c6x/lib/
+
Signature · 1 line
1.6.2.5
#4 lore raw

PATCH 4/16 add support for C64x+ debugger based console

In reply to Mark Salter

Texas Instruments debugger support for the C64X+ family of DSPs includes a console for the unit under test. This patch adds write-only console support to send kernel output to the debugger. It is safe to have this driver in place even if the system is not being run under the debugger.

---
 drivers/tty/hvc/Makefile  |    1 +
 drivers/tty/hvc/hvc_c6x.c |  125 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 126 insertions(+), 0 deletions(-)
 create mode 100644 drivers/tty/hvc/hvc_c6x.c
drivers/tty/hvc/Makefile +1 -0
index 40a25d9..02e08cb 100644
@@ -11,3 +11,4 @@ obj-$(CONFIG_HVC_IUCV)		+= hvc_iucv.o
 obj-$(CONFIG_HVC_UDBG)		+= hvc_udbg.o
 obj-$(CONFIG_HVC_BFIN_JTAG)	+= hvc_bfin_jtag.o
 obj-$(CONFIG_HVCS)		+= hvcs.o
+obj-$(CONFIG_HVC_C6X)		+= hvc_c6x.o
drivers/tty/hvc/hvc_c6x.c new file +125 -0

125 lines not on this page · raw message

Signature · 1 line
1.6.2.5
#0 lore raw

PATCH 1/1 arch/c6x: new architecture port for linux

This patch series adds support for a new architecture (arch/c6x) to Linux. This architecture supports members of the Texas Instruments family of C64x single and multicore DSPs. The multicore DSPs do not support cache coherancy, so are not suitable for SMP. Also, these are no-mmu processors. This core architecture is VLIW with an instruction set optimized for DSP applications. For details on the processors:

http://processors.wiki.ti.com/index.php/Main_Page

This port has a long history going back at least as far as 2.6.13 but was never a good candidate for upstreaming due to lack of a gcc port. These previous kernels were built with proprietary TI tools using COFF. However, a gcc port now exists:

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

Along with supporting the GNU toolchain work, Texas Instruments has also been working on bringing the kernel port up to date and suitable for contribution to the community. This is the start of that process and hopefully we can quickly make whatever changes are necessary to get this port included in the upstream kernel.

There are a few small patches to generic parts of the kernel including bug fixes for a few generic headers. The most significant patch for the generic kernel is the support for a new ELF based binary format called DSBT. DSBT stands for Data Segment Base Table and provides a mechanism for dynamic shared objects for systems without an MMU. In this regard it is similar to the existing FDPIC support in the kernel but it uses a very different approach. Whereas FDPIC ties data segment pointers to function pointers, DSBT uses data accesses relativer to a dedicated data pointer (DP) register. Each data segment in a DSO starts with a table of DP values for each DSO linked into the process. Each DSO has a unique index into that table. When a function call is made to another DSO, the callee will save the current DP and retrieve its own DP from the table indexed on the callee's known index. The advantage of this over FDPIC is that function pointers require no special handling. The main disadvantage is that DSOs in a system must have unique indices to access their DP. These indices can be assigned at static link time when the DSOs are built or later with a prelink-like tool when the rootfs is composed.

The project wiki for linux-c6x is at:

http://www.linux-c6x.org

and the GIT tree holding the attached patches is at:

[email protected]:/git/projects/linux-c6x-upstreaming.git

TIA for any feedback and/or guidance on this port.

#1 lore raw

PATCH 1/16 fix default __strnlen_user macro

The existing __strnlen_user macro simply resolved to strnlen. However, the count returned by strnlen_user should include the NULL byte. This patch fixes the __strnlen_user macro to include the NULL byte in the count.

---
 include/asm-generic/uaccess.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/asm-generic/uaccess.h +1 -1
index ac68c99..1d0fdf8 100644
@@ -289,7 +289,7 @@ 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
 
 static inline long strnlen_user(const char __user *src, long n)
Signature · 1 line
1.6.2.5
#23 lore raw
In reply to Mark Salter
Quoted 9 lines · On Wed, 11 May 2011 16:13:47 -0400 Mark Salter wrote:

The project wiki for linux-c6x is at:

http://www.linux-c6x.org

and the GIT tree holding the attached patches is at:

[email protected]:/git/projects/linux-c6x-upstreaming.git

TIA for any feedback and/or guidance on this port.

Hi,

Please run the patches thru checkpatch.pl. You don't have to fix everything that it whines about, just use good judgment.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#19 lore raw

Re: [PATCH 03/16] add driver for C64x+ ethernet driver

In reply to Mark Salter
Quoted 6 lines · Mark Salter

From: Aurelien Jacquiot <[email protected]>

This patch adds a network driver to support the ethernet interface found on several Texas Instruments C64X+ based System on Chips. In particular, this driver has been tested on the TMS320C6455, TMS320C6457, TMS320C6472, and TMS320C6474 parts.

I'd rather you put this in a new ti_c6x subdirectory in drivers/net/ Please CC network drivers to [email protected] (added)

And some comments below.

Quoted 50 lines
---
 drivers/net/Kconfig     |    8 +
 drivers/net/Makefile    |    2 +
 drivers/net/c6x_gemac.c | 1582 +++++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/c6x_gmdio.c |  514 +++++++++++++++
 4 files changed, 2106 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/c6x_gemac.c
 create mode 100644 drivers/net/c6x_gmdio.c
drivers/net/Kconfig +8 -0
index dc280bc..5eb46a1 100644
@@ -2910,6 +2910,14 @@ config BNA
 
 	  <http://support.brocade.com>
 
+config TMS320C64X_GEMAC
+	tristate "TMS320C64X GEMAC Ethernet Driver Support"
+	depends on TMS320C64XPLUS
+	default n
+	help
+	  This driver supports the C64X+ SoC family ethernet
+	  interface.
+
 source "drivers/net/sfc/Kconfig"
 
 source "drivers/net/benet/Kconfig"
drivers/net/Makefile +2 -0
index 01b604a..d768fde 100644
@@ -259,6 +259,8 @@ obj-$(CONFIG_MLX4_CORE) += mlx4/
 obj-$(CONFIG_ENC28J60) += enc28j60.o
 obj-$(CONFIG_ETHOC) += ethoc.o
 obj-$(CONFIG_GRETH) += greth.o
+obj-$(CONFIG_TMS320C64X_GEMAC) += gemac.o
+gemac-objs := c6x_gemac.o c6x_gmdio.o
 
 obj-$(CONFIG_XTENSA_XT2000_SONIC) += xtsonic.o
 
drivers/net/c6x_gemac.c new file +1 -0
new file mode 100644
index 0000000..40124df
@@ -0,0 +1,1582 @@
+/*

drivers/net/c6x_gemac.c line 11

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2006, 2007, 2008, 2009, 2010 Texas Instruments Incorporated
+ *  Authors: Nicolas Videau ([email protected])
+ *	     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.
+ */

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

Quoted 13 lines
drivers/net/c6x_gemac.c new file +13 -0
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+#include <linux/spinlock.h>
+#include <linux/timer.h>
+#include <linux/platform_device.h>
+#include <linux/io.h>

drivers/net/c6x_gemac.c line 34

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+
+#include <asm/setup.h>
+#include <asm/irq.h>
+#include <asm/gmdio.h>
+#include <asm/gemac.h>
+
+#undef EMAC_DEBUG
+
+#ifdef EMAC_DEBUG
+#define DPRINTK(fmt, args...) printk(KERN_DEBUG "GEMAC: [%s] " fmt, __func__, ## args)

pr_debug(foo)

Quoted 27 lines
drivers/net/c6x_gemac.c new file +27 -0
+#define ASSERT(cond)	      if (!(cond)) DPRINTK("ASSERT %s FAILURE\n", # cond)
+#else
+#define ASSERT(cond)
+#define DPRINTK(fmt, args...)
+#endif
+
+static int emac_open(struct net_device *dev);
+static int emac_close(struct net_device *dev);
+static int emac_reset(struct net_device *dev, int reset_mode);
+static void emac_set_modes(struct net_device *dev);
+static void emac_fixup_modes(struct net_device *dev);
+static void emac_reset_filter(struct net_device *dev,
+			      int channel,
+			      int reset_mode);
+static void emac_set_filter(struct net_device *dev, int channel);
+static int emac_reconfigure_device(struct net_device *dev);
+
+#ifdef EMAC_TIMER_TICK_MDIO
+static struct timer_list  emac_timer;
+#endif
+
+static struct emac_config config = { 0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } };
+
+static int emac_shared;
+static int emac_idx;
+
+inline long _hex_chartol(char c)

drivers/net/c6x_gemac.c line 71

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+{
+	if (c >= '0' && c <= '9')
+		return c - '0';
+	if (c >= 'A' && c <= 'F')
+		return c - 'A' + 10;
+	if (c >= 'a' && c <= 'f')
+		return c - 'a' + 10;
+
+	return -1;
+}

kstrtol

drivers/net/c6x_gemac.c line 83

Quoted 12 lines
drivers/net/c6x_gemac.c new file +12 -0
+
+static unsigned long _hex_strtoul(const char *str, const char **end)
+{
+	unsigned long ul = 0;
+	long	      ud;
+	while ((ud = _hex_chartol(*str)) >= 0) {
+		ul = (ul << 4) | ud;
+		str++;
+	}
+	*end = str;
+	return ul;
+}

kstrtoul

Quoted 63 lines
drivers/net/c6x_gemac.c new file +63 -0
+
+static int __init get_mac_addr_from_cmdline(char *str)
+{
+	const char *start = (const char *) str;
+	const char *end;
+	int count;
+
+	for (count = 0; count < 6; count++) {
+		config.enetaddr[count] = _hex_strtoul(start, &end);
+		if (end == start)
+			return 0;
+		if ((*end != ':') && (count != 5))
+			return 0;
+		start = end + 1;
+	}
+	return 1;
+}
+
+__setup("emac_addr=", get_mac_addr_from_cmdline);
+
+static int __init set_emac_shared(char *str)
+{
+	emac_shared = 1;
+	return 1;
+}
+
+__setup("emac_shared", set_emac_shared);
+
+/*
+ * Get the device statistic
+ */
+static struct net_device_stats *emac_get_stats(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+	unsigned int reg;
+	unsigned int dummy;
+	int i;
+
+	emac_set_stat(dev->stats.multicast,	    EMAC_RXMCASTFRAMES);
+	emac_set_stat(dev->stats.collisions,	    EMAC_TXCOLLISION);
+	emac_set_stat(dev->stats.rx_length_errors,  EMAC_RXOVERSIZED);
+	emac_set_stat(dev->stats.rx_length_errors,  EMAC_RXUNDERSIZED);
+	emac_set_stat(dev->stats.rx_crc_errors,     EMAC_RXCRCERRORS);
+	emac_set_stat(dev->stats.rx_frame_errors,   EMAC_RXALIGNCODEERRORS);
+	emac_set_stat(dev->stats.tx_carrier_errors, EMAC_TXCARRIERSLOSS);
+	emac_set_stat(dev->stats.tx_fifo_errors,    EMAC_TXUNDERRUN);
+	emac_set_stat(dev->stats.tx_window_errors,  EMAC_TXLATECOLL);
+
+	/* ACK statistic by write-to-decrement */
+	reg = EMAC_RXGOODFRAMES;
+	for (i = 0; i < EMAC_NUM_STATREGS; i++) {
+		dummy = emac_get_reg(reg);
+		emac_set_reg(reg, dummy);
+		reg += 4;
+	}
+
+	return &dev->stats;
+}
+
+/*
+ * Receive packets
+ */
+static int emac_rx(struct net_device *dev, struct emac_desc *desc_ack)

drivers/net/c6x_gemac.c line 156

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+{
+	struct emac_private	    *ep = netdev_priv(dev);
+	volatile struct emac_desc *desc = ep->cur_rx;
+	ushort pkt_len;
+	u32 pkt_flags = desc->packet_flags_len & 0xffff0000;
+	int loop = 1;
+	struct sk_buff *skb, *skb_old;
+
+	DPRINTK("%s: RX desc_ack = 0x%x, cur_rx = 0x%x, num = %d\n",
+	       dev->name, desc_ack, desc, (desc_ack - desc));

netdev_dbg(dev, etc)

Quoted 28 lines
drivers/net/c6x_gemac.c new file +28 -0
+
+	if ((desc == desc_ack) && (desc->packet_flags_len == EMAC_DESC_FLAG_OWNER))
+		loop = 0;
+
+	while (loop) {
+		skb_old = ep->rx_skbuff[ep->skb_rx_dirty];
+
+		pkt_len   = desc->packet_flags_len & EMAC_PACKET_LEN_MASK;
+		pkt_flags = desc->packet_flags_len & 0xffff0000;
+
+		skb = netdev_alloc_skb_ip_align(dev, ep->packet_mtu);
+		if (skb != NULL) {
+			/* Prepare old sk_buff */
+			skb_old->dev = dev;
+			skb_put(skb_old, pkt_len);
+
+			/* No coherency is assumed between EDMA and L2 cache */
+			L2_cache_block_invalidate((u32) desc->buff,
+						  (u32) desc->buff + pkt_len);
+
+			skb_old->protocol = eth_type_trans(skb_old, dev);
+
+			/* Attach new sk_buff to RX ring */
+			desc->buff = (u8 *) skb->data;
+			ep->rx_skbuff[ep->skb_rx_dirty] = skb;
+
+			DPRINTK("%s: receiving packet of %d len, proto 0x%x\n",
+			       dev->name, pkt_len, skb->protocol);

drivers/net/c6x_gemac.c line 194

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+
+			/* Give back old sk_buff */
+			netif_rx(skb_old);
+			dev->last_rx = jiffies;
+
+			/* Fill statistic */
+			dev->stats.rx_packets++;
+			dev->stats.rx_bytes += pkt_len;
+		} else {
+			printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name);
	netdev_warn(dev, "Memory squeeze, dropping packet\n");

Maybe ratelimited too.

Quoted 36 lines
drivers/net/c6x_gemac.c new file +36 -0
+			dev->stats.rx_dropped++;
+		}
+
+		/* Update RX dirty */
+		if (ep->skb_rx_dirty >= RX_RING_MOD_MAX)
+			ep->skb_rx_dirty = 0;
+		else
+			ep->skb_rx_dirty = ep->skb_rx_dirty + 1;
+
+		/* Descriptor is now available */
+		desc->buff_offset_len = ep->packet_mtu;
+		desc->packet_flags_len = EMAC_DESC_FLAG_OWNER;
+
+		/* Check if it is the last descriptor which has been received */
+		if (desc == desc_ack)
+			loop = 0;
+
+		/* Loop in the ring */
+		desc = HW_TO_PTR(desc->next);
+	}
+	ep->cur_rx = (struct emac_desc *) desc;
+
+	/* Check if the receiver stopped */
+	if (pkt_flags & EMAC_DESC_FLAG_EOQ)
+		emac_set_reg(EMAC_RX0HDP + (IDX_TO_CHAN(emac_idx) << 2),
+			     PTR_TO_HW((u32) ep->cur_rx));
+
+	return 0;
+}
+
+/*
+ * Transmit packets ACK
+ */
+static int emac_tx(struct net_device *dev, struct emac_desc *desc_ack)
+{
+	struct emac_private	    *ep = netdev_priv(dev);

drivers/net/c6x_gemac.c line 240

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+	volatile struct emac_desc *desc = ep->dirty_tx;
+	int loop = 1;
+
+	while (loop) {
+		DPRINTK("%s: TX desc_ack = 0x%x, desc = 0x%x, num = %d\n",
+			dev->name, desc_ack, desc, (desc_ack - desc));
+
+		if (ep->tx_skbuff[ep->skb_tx_dirty] == NULL) {
+			printk(KERN_ERR "%s: SKB NULL desc =%p desc_ack =%p, skb_tx_dirty=%ld count=%ld\n",
+			       dev->name, desc, desc_ack, ep->skb_tx_dirty, ep->count_tx);

netdev_err("SKB NULL, etc...
Almost all of your printks should use netdev_<level>

Quoted 353 lines
drivers/net/c6x_gemac.c new file +353 -0
+			break;
+		}
+
+		/* Free the skbuff associated to this packet */
+		dev_kfree_skb_irq(ep->tx_skbuff[ep->skb_tx_dirty]);
+
+		ep->tx_skbuff[ep->skb_tx_dirty] = NULL;
+		ep->skb_tx_dirty = (ep->skb_tx_dirty + 1) & TX_RING_MOD_MASK;
+		ep->count_tx--;
+
+		/* Check if it is the last acknowledged descriptor */
+		if (desc++ == desc_ack)
+			loop = 0;
+
+		/* Check end of the ring */
+		if (desc > ep->tx_desc_base + (TX_RING_SIZE - 1))
+			desc = ep->tx_desc_base;
+	}
+
+	if (netif_running(dev))
+		netif_wake_queue(dev);
+
+	/* Since we have freed up a buffer, the ring is no longer full */
+	if (ep->tx_full) {
+		ep->tx_full = 0;
+
+		DPRINTK("%s: wake up queue count_tx = %d cur_tx = 0x%x head_tx\n",
+			dev->name, ep->count_tx, ep->cur_tx, ep->head_tx);
+
+		if (netif_queue_stopped(dev))
+			netif_wake_queue(dev);
+	}
+
+	/* If this is the end of the queue */
+	if (desc_ack->packet_flags_len & EMAC_DESC_FLAG_EOQ) {
+
+		/* If there are some waiting packets, start the new queue */
+		if (ep->count_tx > 0)
+			emac_set_reg(EMAC_TX0HDP + (IDX_TO_CHAN(emac_idx) << 2),
+				     PTR_TO_HW(ep->head_tx));
+
+		/* Set the new head */
+		ep->head_tx = ep->cur_tx;
+	}
+
+	/* Update dirty tx */
+	ep->dirty_tx = (struct emac_desc *) desc;
+
+	return NETDEV_TX_OK;
+}
+
+/*
+ * Transmit the content of a skbuff
+ */
+static int emac_start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+	struct emac_private	  *ep =  netdev_priv(dev);
+	volatile struct emac_desc *desc;
+	volatile struct emac_desc *prev_desc = NULL;
+	ushort pkt_len = skb->len;
+	unsigned long flags;
+
+	if (ep->tx_full) {
+		printk(KERN_WARNING "%s: tx queue full\n", dev->name);
+		dev->stats.tx_dropped++;
+		return NETDEV_TX_BUSY;
+	}
+
+	/* Pad short frame */
+	if (unlikely(pkt_len < ETH_ZLEN)) {
+		if (skb_padto(skb, ETH_ZLEN)) {
+			netif_wake_queue(dev);
+			return NETDEV_TX_OK;
+		}
+		pkt_len = ETH_ZLEN;
+	}
+
+	spin_lock_irqsave(&ep->lock, flags);
+
+	desc = ep->cur_tx;
+
+	/* Set buffer length and pointer */
+	desc->buff	       = skb->data;
+	desc->packet_flags_len = pkt_len;
+	desc->buff_offset_len  = pkt_len;
+	desc->next	       = NULL;	       /* close the queue*/
+
+	/* No coherency is assumed between EDMA and L2 cache */
+	L2_cache_block_writeback((u32) skb->data,
+				 (u32) skb->data + pkt_len);
+
+	DPRINTK("%s: sending packet of %d len, skb_cur = %x, buffer = 0x%x\n",
+		dev->name, pkt_len, ep->skb_cur, skb->data);
+
+	/* Save skb */
+	ep->tx_skbuff[ep->skb_cur] = skb;
+	ep->skb_cur = (ep->skb_cur + 1) & TX_RING_MOD_MASK;
+	dev->stats.tx_packets++;
+	dev->stats.tx_bytes += pkt_len;
+	dev->trans_start = jiffies;
+
+	desc->packet_flags_len |= EMAC_DESC_FLAG_SOP
+		| EMAC_DESC_FLAG_EOP
+		| EMAC_DESC_FLAG_OWNER;
+
+	/* Get the previous element of the ring if we are not the head */
+	if (desc != ep->head_tx) {
+		if (desc == ep->tx_desc_base)
+			prev_desc = ep->tx_desc_base + (TX_RING_SIZE - 1);
+		else
+			prev_desc = desc - 1;
+
+		/* Link the buffer to the previous one in the list */
+		prev_desc->next = (struct emac_desc *) PTR_TO_HW(desc);
+	}
+
+	ep->count_tx++;
+
+	/* Update current pointer */
+	ep->cur_tx = (struct emac_desc *) desc + 1;
+
+	/* Check end of ring */
+	if (ep->cur_tx > ep->tx_desc_base + (TX_RING_SIZE - 1))
+		ep->cur_tx = ep->tx_desc_base;
+
+	/*
+	 * If we are the new head and there is no descriptor to acknowledge, start
+	 * the new head.
+	 */
+	if ((desc == ep->head_tx) && (ep->count_tx == 1)) {
+		emac_set_reg(EMAC_TX0HDP + (IDX_TO_CHAN(emac_idx) << 2),
+			     PTR_TO_HW(ep->head_tx));
+		ep->head_tx = ep->cur_tx; /* set the new head */
+	}
+
+	/* Check ring oll over: do not reach the not yet acknowledged packets */
+	if (ep->count_tx == TX_RING_SIZE) {
+		ep->tx_full = 1;
+
+		DPRINTK("%s: tx queue full count_tx = %d cur_tx = 0x%x head_tx\n",
+			dev->name, ep->count_tx, ep->cur_tx, ep->head_tx);
+
+		netif_stop_queue(dev);
+	}
+	spin_unlock_irqrestore(&ep->lock, flags);
+
+	return NETDEV_TX_OK;
+}
+
+static void emac_handle_host_interrupt(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+	unsigned long	     status;
+
+	/* Handle host error */
+	status = emac_get_reg(EMAC_MACSTATUS);
+
+	/* Check if the problem occurs on our channel when we are slave */
+	if ((ep->slave)
+	    && (((status & EMAC_M_RXERRCH) >> EMAC_S_RXERRCH) != IDX_TO_CHAN(emac_idx))
+	    && (((status & EMAC_M_TXERRCH) >> EMAC_S_TXERRCH) != IDX_TO_CHAN(emac_idx)))
+		return;
+
+	if ((status & EMAC_M_RXERRCODE) == (EMAC_V_OWNERSHIP <<  EMAC_S_RXERRCODE)) {
+		printk(KERN_ERR "%s: EMAC rx ring full\n", dev->name);
+		dev->stats.rx_fifo_errors++;
+	} else
+		printk(KERN_ERR "%s: EMAC fatal host error 0x%lx\n",
+		       dev->name, status);
+
+	DPRINTK(KERN_ERR "%s: Error head=%p desc=%p dirty=%p skb_tx_dirty=%ld count=%ld\n",
+		dev->name, ep->head_tx, ep->cur_tx,
+		ep->dirty_tx, ep->skb_tx_dirty, ep->count_tx);
+
+	if (!ep->slave) {
+		/* Reconfigure the device */
+		ep->fatal_error = 1;
+		emac_reconfigure_device(dev);
+	}
+}
+
+/*
+ * Receive EMAC interrupt management
+ */
+
+#ifdef EMAC_HAS_SEPARATE_RXTX_IRQS
+
+static irqreturn_t emac_rx_interrupt(int irq, void *netdev_id)
+{
+	struct net_device *dev = netdev_id;
+	struct emac_private *ep = netdev_priv(dev);
+	struct emac_desc *desc;
+	unsigned long irq_flags;
+
+	ectl_arch_rx_irq_enter(IDX_TO_CHAN(emac_idx));
+
+	irq_flags = emac_arch_get_int_vector();
+
+	if (irq_flags & EMAC_B_STATPEND)
+		(void) emac_get_stats(dev);
+
+	if (irq_flags & EMAC_B_HOSTPEND)
+		emac_handle_host_interrupt(dev);
+
+	if (emac_arch_get_pending_irq(irq_flags,
+				      EMAC_B_RXPEND0,
+				      IDX_TO_CHAN(emac_idx))) {
+
+		/* ACK the interrupt */
+		desc = (struct emac_desc *) emac_get_reg(EMAC_RX0INTACK
+							 + (IDX_TO_CHAN(emac_idx) << 2));
+		emac_set_reg(EMAC_RX0INTACK + (IDX_TO_CHAN(emac_idx) << 2), desc);
+
+		/* Handle receive event */
+		emac_rx(netdev_id, HW_TO_PTR(desc));
+	}
+
+	ectl_arch_rx_irq_leave(IDX_TO_CHAN(emac_idx));
+
+	return IRQ_HANDLED;
+}
+
+/*
+ * Transmit EMAC interrupt management
+ */
+static irqreturn_t emac_tx_interrupt(int irq, void *netdev_id)
+{
+	struct net_device   *dev = netdev_id;
+	struct emac_private *ep  = netdev_priv(dev);
+	struct emac_desc    *desc;
+	unsigned long irq_flags;
+
+	ectl_arch_tx_irq_enter(IDX_TO_CHAN(emac_idx));
+
+	irq_flags = emac_arch_get_int_vector();
+
+	if (irq_flags & EMAC_B_STATPEND)
+		(void) emac_get_stats(dev);
+
+	if (irq_flags & EMAC_B_HOSTPEND)
+		emac_handle_host_interrupt(dev);
+
+	if (emac_arch_get_pending_irq(irq_flags,
+				      EMAC_B_TXPEND0,
+				      IDX_TO_CHAN(emac_idx))) {
+
+		/* ACK the interrupt */
+		desc = (struct emac_desc *) emac_get_reg(EMAC_TX0INTACK
+							 + (IDX_TO_CHAN(emac_idx) << 2));
+		emac_set_reg(EMAC_TX0INTACK + (IDX_TO_CHAN(emac_idx) << 2), desc);
+
+		/* Handle transmit ACK event */
+		emac_tx(netdev_id, HW_TO_PTR(desc));
+	}
+
+	ectl_arch_tx_irq_leave(IDX_TO_CHAN(emac_idx));
+
+	return IRQ_HANDLED;
+}
+
+#else
+
+/*
+ * Main EMAC interrupt management
+ */
+static irqreturn_t emac_interrupt(int irq, void *netdev_id)
+{
+	struct net_device   *dev = netdev_id;
+	struct emac_private *ep  = netdev_priv(dev);
+	struct emac_desc    *desc;
+	unsigned long irq_flags;
+
+	/* Disable EMAC/MDIO interrupts  */
+	emac_clearbit_reg(EMAC_EWCTL, EMAC_B_INTEN);
+
+	irq_flags = emac_get_reg(EMAC_MACINVECTOR);
+
+	if (irq_flags & EMAC_B_STATPEND)
+		(void) emac_get_stats(dev);
+
+	if (irq_flags & EMAC_B_HOSTPEND) {
+		emac_handle_host_interrupt(dev);
+
+		/* EMAC/MDIO interrupts already enabled by emac_open() */
+		return IRQ_HANDLED;
+	}
+
+	if (irq_flags & EMAC_B_TXPEND0) {
+		/* ACK the interrupt */
+		desc = (struct emac_desc *) emac_get_reg(EMAC_TX0INTACK);
+		emac_set_reg(EMAC_TX0INTACK, desc);
+
+		/* Handle transmit ACK event */
+		emac_tx(netdev_id, desc);
+	}
+
+	if (irq_flags & EMAC_B_RXPEND0) {
+		/* ACK the interrupt */
+		desc = (struct emac_desc *) emac_get_reg(EMAC_RX0INTACK);
+		emac_set_reg(EMAC_RX0INTACK, desc);
+
+		/* Handle receive event */
+		emac_rx(netdev_id, desc);
+	}
+
+	/* Enable EMAC/MDIO interrupts */
+	emac_setbit_reg(EMAC_EWCTL, EMAC_B_INTEN);
+
+	return IRQ_HANDLED;
+}
+#endif
+
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * EMAC poll
+ */
+static void emac_poll(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+
+	ectl_arch_disable_irq(IDX_TO_CHAN(emac_idx));
+
+#ifdef EMAC_HAS_SEPARATE_RXTX_IRQS
+	emac_tx_interrupt(dev->irq + 1, dev);
+	emac_rx_interrupt(dev->irq, dev);
+#else
+	emac_interrupt(dev->irq, dev);
+#endif
+
+	ectl_arch_enable_irq(IDX_TO_CHAN(emac_idx), !ep->slave);
+}
+#endif
+
+/*
+ * Register the MAC address
+ */
+
+static void emac_register_mac_addr(struct net_device *dev, int idx)
+{
+	struct emac_private *ep = netdev_priv(dev);
+	u32 val;
+	int i;
+
+	/* Copy the config MAC address to the dev_addr */
+	for (i = 4; i >= 0; i--)
+		dev->dev_addr[i] = config.enetaddr[i];
+	/*
+	 * Compute MAC addr low for all for the given EMAC instances if several.
+	 * Each device consume n MAC addresses where n is the number cores.
+	 * This value is for GEM0, this value + 2 is for GEM1, etc
+	 * The number programmed in this field will be incremented by n * 2 from
+	 * device to device
+	 */

drivers/net/c6x_gemac.c line 603

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+	dev->dev_addr[5] = (config.enetaddr[5] +
+			    (IDX_TO_MAC(idx)) + DEV_TO_MAC(dev->dev_id)) & 0xff;
+
+	/* Choose MAC address index between 0 and 31 */
+	emac_arch_set_mac_addr_index(idx);
+
+	/* Compute and store MAC addr high */
+	val = 0;
+	for (i = 3; i >= 0; i--)
+		val = (val << 8) | dev->dev_addr[i];

Inconsistent style with low portion below
and function emac_reset.

This might be better as:

	val = (dev->dev_addr[3] << 24) |
	      (dev->dev_addr[2] << 16) |
	      (dev->dev_addr[1] << 8) |
	      (dev->dev_addr[0] << 0);
Quoted 36 lines
drivers/net/c6x_gemac.c new file +34 -0
+	emac_arch_set_mac_addr_high(val);
+
+	val  = (dev->dev_addr[5] << 8) | dev->dev_addr[4];
 
 
+	val |= (1 << EMAC_S_VALID)
+		| (1 << EMAC_S_MATCHFILTER)
+		| (IDX_TO_CHAN(idx) << EMAC_S_CHANNEL);
+
+	emac_arch_set_mac_addr_low(val);
+}
+
+/*
+ * Reset the EMAC software ring.
+ */
+static void emac_reset_ring(struct emac_private *ep)
+{
+	struct emac_desc *desc;
+	int i;
+
+	desc = (struct emac_desc *) ep->emac_dsc_base;
+
+	/* Reset rx ring */
+	ep->cur_rx	 = desc;
+	ep->skb_rx_dirty = 0;
+
+	for (i = 0; i < RX_RING_SIZE; desc++, i++)
+		desc->packet_flags_len = EMAC_DESC_FLAG_OWNER;
+
+	/* Reset tx ring */
+	desc = (struct emac_desc *) (ep->emac_dsc_base + (RX_RING_SIZE << 4));
+	ep->cur_tx	 = desc;
+	ep->dirty_tx	 = desc;
+	ep->head_tx	 = desc;
+	ep->skb_cur	 = 0;
+	ep->skb_tx_dirty = 0;

drivers/net/c6x_gemac.c line 647

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+	ep->tx_full	 = 0;
+	ep->fatal_error  = 0;
+	ep->count_tx	 = 0;
+
+	for (i = 0; i < TX_RING_SIZE; i++) {
+		desc->buff	       = NULL;
+		desc->buff_offset_len  = 0;
+		desc->packet_flags_len = 0;
+		desc->next	       = NULL;
+		ep->tx_skbuff[i]       = NULL;

memset?

Quoted 70 lines
drivers/net/c6x_gemac.c new file +70 -0
+		desc++;
+	}
+}
+
+/*
+ * Reconfigure the EMAC device
+ */
+static int emac_reconfigure_device(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+
+	if (!ep->slave) {
+		unsigned int  hash1;
+		unsigned int  hash2;
+		unsigned int  promisc;
+		unsigned int  control;
+		unsigned int  rx_intmask;
+		unsigned int  tx_intmask;
+		unsigned int  unicast;
+		unsigned int *mac_ctx;
+		int	      i;
+
+		/* Get state */
+		hash1	= emac_arch_get_hash1();
+		hash2	= emac_arch_get_hash2();
+		promisc = emac_arch_get_promisc();
+		control = emac_arch_get_control();
+
+		unicast    = emac_get_reg(EMAC_RXUNICASTSET);
+		rx_intmask = emac_get_reg(EMAC_RXINTMASKSET);
+		tx_intmask = emac_get_reg(EMAC_TXINTMASKSET);
+
+		/* Save MAC addresses */
+		mac_ctx = kmalloc((sizeof(u32) << 1) * MAC_ADDR_NUM, GFP_KERNEL);
+		for (i = 0; i < MAC_ADDR_NUM; i++) {
+			emac_arch_set_mac_addr_index(i);
+			mac_ctx[i << 1]       = emac_arch_get_mac_addr_high();
+			mac_ctx[(i << 1) + 1] = emac_arch_get_mac_addr_low();
+		}
+
+		/* Reset the EMAC */
+		if (netif_running(dev)) {
+			emac_close(dev);
+			emac_reset(dev, GEMAC_RESET_WARM);
+			emac_open(dev);
+		} else {
+			emac_reset(dev, GEMAC_RESET_WARM);
+		}
+
+		/* Restore MAC addresses */
+		for (i = 0; i < MAC_ADDR_NUM; i++) {
+			emac_arch_set_mac_addr_index(i);
+			emac_arch_set_mac_addr_high(mac_ctx[i << 1]);
+			emac_arch_set_mac_addr_low(mac_ctx[(i << 1) + 1]);
+		}
+		kfree(mac_ctx);
+
+		/* Restore state */
+		emac_arch_set_hash1(hash1);
+		emac_arch_set_hash2(hash2);
+		emac_arch_set_promisc(hash2);
+		emac_arch_set_control(hash2);
+
+		emac_set_reg(EMAC_RXINTMASKSET, rx_intmask);
+		emac_set_reg(EMAC_TXINTMASKSET, tx_intmask);
+		emac_set_reg(EMAC_RXUNICASTSET, unicast);
+	} else
+		/* Only master core can reset the device */
+		return -EBUSY;
+

drivers/net/c6x_gemac.c line 727

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+	return 0;
+}
+
+/*
+ * Reset the EMAC hardware.
+ */
+static int emac_reset(struct net_device *dev, int reset_mode)
+{
+	struct emac_private *ep = netdev_priv(dev);
+	volatile u32	    *preg;

volatile?

Quoted 176 lines
drivers/net/c6x_gemac.c new file +176 -0
+	int		     i;
+
+	if (!ep->slave) {
+
+		if (reset_mode == GEMAC_RESET_COLD) {
+			/* Reset integrated switch if any */
+			emac_arch_reset_switch();
+
+			/* Reset EMAC control Module */
+			emac_arch_reset_ectl();
+		}
+
+		/* Reset EMAC */
+		emac_setbit_reg(EMAC_SOFTRESET, EMAC_B_SOFTRST);
+
+		/* Wait until reset has occured or timeout */
+		for (i = 0; i <= HZ / 2; i++) {
+			if (emac_get_reg(EMAC_SOFTRESET) == 0x0)
+				break;
+			if (i == HZ / 2)
+				return 1;
+			msleep_interruptible(1);
+		}
+	}
+
+	/* Set interrupt pacing */
+	emac_arch_set_pacing();
+
+	if (!ep->slave) {
+		/* Reset MAC, TX, RX Control */
+		emac_set_reg(EMAC_MACCONTROL, 0);
+		emac_set_reg(EMAC_TXCONTROL, 0);
+		emac_set_reg(EMAC_RXCONTROL, 0);
+
+		if (reset_mode == GEMAC_RESET_COLD) {
+#ifdef EMAC_DO_INIT_MDIO
+			/* MII/MDIO setup */
+			mdio_init(emac_get_reg(EMAC_TXIDVER));
+#endif
+
+			/* Init HDPs to NULL for all channels */
+			emac_set_reg(EMAC_TX0HDP, 0);
+			emac_set_reg(EMAC_TX1HDP, 0);
+			emac_set_reg(EMAC_TX2HDP, 0);
+			emac_set_reg(EMAC_TX3HDP, 0);
+			emac_set_reg(EMAC_TX4HDP, 0);
+			emac_set_reg(EMAC_TX5HDP, 0);
+			emac_set_reg(EMAC_TX6HDP, 0);
+			emac_set_reg(EMAC_TX7HDP, 0);
+			emac_set_reg(EMAC_RX0HDP, 0);
+			emac_set_reg(EMAC_RX1HDP, 0);
+			emac_set_reg(EMAC_RX2HDP, 0);
+			emac_set_reg(EMAC_RX3HDP, 0);
+			emac_set_reg(EMAC_RX4HDP, 0);
+			emac_set_reg(EMAC_RX5HDP, 0);
+			emac_set_reg(EMAC_RX6HDP, 0);
+			emac_set_reg(EMAC_RX7HDP, 0);
+
+			/* Clear statistic registers */
+			if (reset_mode == GEMAC_RESET_COLD) {
+				preg = emac_addr_reg(EMAC_RXGOODFRAMES);
+				for (i = 0; i < EMAC_NUM_STATREGS; i++)
+					*preg++ = 0;
+			}
+
+			/* Clear all MAC addresses */
+			emac_arch_clear_mac_addr();
+		}
+	}
+
+	/* Register my MAC address */
+	emac_register_mac_addr(dev, emac_idx);
+
+	if (!ep->slave) {
+
+		/* Used for pause frame (IEEE 802.3x) but not working for MC */
+		emac_set_reg(EMAC_MACSRCADDRLO,
+			     (dev->dev_addr[0] << 8) | dev->dev_addr[1]);
+		emac_set_reg(EMAC_MACSRCADDRHI,
+			     (dev->dev_addr[2] << 24) | (dev->dev_addr[3] << 16) |
+			     (dev->dev_addr[4] << 8)  | (dev->dev_addr[5]));
+
+		if (reset_mode == GEMAC_RESET_COLD) {
+
+			/* Init completion pointers to NULL */
+			emac_set_reg(EMAC_RX0INTACK, 0x0);
+			emac_set_reg(EMAC_RX1INTACK, 0x0);
+			emac_set_reg(EMAC_RX2INTACK, 0x0);
+			emac_set_reg(EMAC_RX3INTACK, 0x0);
+			emac_set_reg(EMAC_RX4INTACK, 0x0);
+			emac_set_reg(EMAC_RX5INTACK, 0x0);
+			emac_set_reg(EMAC_RX6INTACK, 0x0);
+			emac_set_reg(EMAC_RX7INTACK, 0x0);
+			emac_set_reg(EMAC_TX0INTACK, 0x0);
+			emac_set_reg(EMAC_TX1INTACK, 0x0);
+			emac_set_reg(EMAC_TX2INTACK, 0x0);
+			emac_set_reg(EMAC_TX3INTACK, 0x0);
+			emac_set_reg(EMAC_TX4INTACK, 0x0);
+			emac_set_reg(EMAC_TX5INTACK, 0x0);
+			emac_set_reg(EMAC_TX6INTACK, 0x0);
+			emac_set_reg(EMAC_TX7INTACK, 0x0);
+		}
+
+		/* Reset unicast, multicast, broadcast Rx */
+		emac_reset_filter(dev, IDX_TO_CHAN(emac_idx), reset_mode);
+
+		/* Set device modes */
+		emac_set_modes(dev);
+
+		/* Disable all channel interrupts */
+		if (reset_mode == GEMAC_RESET_COLD) {
+			emac_set_reg(EMAC_RXINTMASKCLEAR, 0xff);
+			emac_set_reg(EMAC_TXINTMASKCLEAR, 0xff);
+		}
+
+		/* Enable host and stat interrupts */
+		emac_set_reg(EMAC_MACINTMASKSET, EMAC_B_HOSTINT | EMAC_B_STATINT);
+	} else {
+		/* Fixup mode according to hw configuration */
+		emac_fixup_modes(dev);
+	}
+
+	/* Enable TX and RX interrupts for a given channel */
+	emac_arch_enable_irq(EMAC_TXINTMASKSET, IDX_TO_CHAN(emac_idx));
+	emac_arch_enable_irq(EMAC_RXINTMASKSET, IDX_TO_CHAN(emac_idx));
+
+	/* Reset transmit/receive buffers */
+	if (reset_mode == GEMAC_RESET_WARM)
+		(void) emac_reset_ring(ep);
+
+	/* Set default receive filter: unicast, multicast and broadcast */
+	emac_set_filter(dev, IDX_TO_CHAN(emac_idx));
+
+	return 0;
+}
+
+/*
+ * Open the device
+ */
+static int emac_open(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+
+	if (!ep->slave) {
+		/* Set MAC mode (Gigabyte, xxMII, pacing, etc) */
+		emac_arch_init_control(ep->mode_flags & EMAC_CONFIG_PACING);
+
+		/* Enable RX and TX */
+		emac_set_reg(EMAC_TXCONTROL, 1);
+		emac_set_reg(EMAC_RXCONTROL, 1);
+	}
+
+	/* Ready for RX */
+	emac_set_reg(EMAC_RX0HDP + (IDX_TO_CHAN(emac_idx) << 2),
+		     PTR_TO_HW(ep->cur_rx));
+
+	/* Enable interrupts at the ECTL level (misc int only for master) */
+	ectl_arch_enable_irq(IDX_TO_CHAN(emac_idx), !ep->slave);
+
+	netif_start_queue(dev);
+
+	return 0;
+}
+
+/*
+ * Close the device
+ */
+static int emac_close(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+
+	netif_stop_queue(dev);
+
+	/* Disable interrupt at the ECTL level */
+	ectl_arch_disable_irq(IDX_TO_CHAN(emac_idx));
+

drivers/net/c6x_gemac.c line 913

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+	/* Teardown RX and TX */
+	emac_set_reg(EMAC_RXTEARDOWN, IDX_TO_CHAN(emac_idx));
+	emac_set_reg(EMAC_TXTEARDOWN, IDX_TO_CHAN(emac_idx));
+
+	if (!ep->fatal_error) {
+		unsigned int tmp;
+
+		/* Wait for the teardown to complete */
+		for (tmp = 0; tmp != 0xfffffffc;
+		     tmp = emac_get_reg(EMAC_RX0INTACK +		\

Don't use line continuations unnecessarily please.

Quoted 369 lines
drivers/net/c6x_gemac.c new file +369 -0
+				       (IDX_TO_CHAN(emac_idx) << 2)))
+			emac_set_reg(EMAC_RX0INTACK + \
+				     (IDX_TO_CHAN(emac_idx) << 2), tmp);
+
+		for (tmp = 0; tmp != 0xfffffffc;
+		     tmp = emac_get_reg(EMAC_TX0INTACK +		\
+					(IDX_TO_CHAN(emac_idx) << 2)))
+			emac_set_reg(EMAC_TX0INTACK +			\
+				     (IDX_TO_CHAN(emac_idx) << 2), tmp);
+	}
+
+	if (!ep->slave) {
+		/* Disable Rx, Tx and MII */
+		emac_set_reg(EMAC_TXCONTROL, 0);
+		emac_set_reg(EMAC_RXCONTROL, 0);
+		emac_set_reg(EMAC_MACCONTROL, 0);
+	}
+
+	/* Clean up the software ring */
+	emac_reset_ring(ep);
+
+	return 0;
+}
+
+/*
+ * Initialize the EMAC software ring.
+ * For the rx ring, we initialize the packet descriptors with pre-allocated
+ * skbuff to the packet MTU size.
+ * For the tx ring, we only initialize it with NULL values.
+ */
+static int emac_setup_ring(struct emac_private *ep)
+{
+	struct emac_desc *desc;
+	int		  i;
+	struct sk_buff	 *skb;
+
+	/* Setup rx ring*/
+	desc = (struct emac_desc *) ep->emac_dsc_base;
+	ep->rx_desc_base = desc;
+	ep->cur_rx	 = desc;
+	ep->skb_rx_dirty = 0;
+
+	/* Allocate ring buffers via sk buffers */
+	for (i = 0; i < RX_RING_SIZE; i++) {
+		skb = netdev_alloc_skb_ip_align(ep->dev, ep->packet_mtu);
+		if (!skb)
+			return 1;
+
+		ep->rx_skbuff[i]       = skb;
+		desc->buff	       = (u8 *) skb->data;
+		desc->buff_offset_len  = ep->packet_mtu;
+		desc->packet_flags_len = EMAC_DESC_FLAG_OWNER;
+		desc->next	       = PTR_TO_HW(desc + 1);
+		desc++;
+	}
+
+	/* Loop the ring */
+	(desc - 1)->next = PTR_TO_HW(ep->rx_desc_base);
+
+	/* Setup tx ring */
+	desc = (struct emac_desc *) (ep->emac_dsc_base + (RX_RING_SIZE << 4));
+	ep->tx_desc_base = desc;
+	ep->cur_tx	 = desc;
+	ep->dirty_tx	 = desc;
+	ep->head_tx	 = desc;
+	ep->skb_cur	 = 0;
+	ep->skb_tx_dirty = 0;
+	ep->tx_full	 = 0;
+	ep->fatal_error  = 0;
+	ep->count_tx	 = 0;
+
+	for (i = 0; i < TX_RING_SIZE; i++) {
+		desc->buff	       = NULL;
+		desc->buff_offset_len  = 0;
+		desc->packet_flags_len = 0;
+		desc->next	       = NULL;
+		ep->tx_skbuff[i]       = NULL;
+		desc++;
+	}
+	return 0;
+}
+
+/*
+ * Called by the kernel to send a packet out into the void
+ * of the net.
+ */
+static void emac_timeout(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+
+	printk(KERN_WARNING "%s: transmit timed out\n", dev->name);
+	dev->stats.tx_errors++;
+	dev->trans_start = jiffies;
+	if (!ep->tx_full)
+		netif_wake_queue(dev);
+}
+
+/*
+ * Set or clear the multicast filter for this adaptor.
+ */
+#ifdef EMAC_HAS_ALE_SUPPORT
+static void emac_reset_filter(struct net_device *dev,
+			      int channel,
+			      int reset_mode)
+{
+	struct emac_private *ep = netdev_priv(dev);
+	int i;
+
+	if (reset_mode == GEMAC_RESET_COLD) {
+		/* Alloc mcast list */
+		ep->mcast_infos = kmalloc(3 * EMAC_V_ALE_MAX_MCAST, GFP_KERNEL);
+		/* Init mcast table */
+		if (ep->mcast_infos) {
+			memset(ep->mcast_infos, 0x0, 3 * EMAC_V_ALE_MAX_MCAST);
+			/* Clear device multicast list */
+			for (i = 0; i < EMAC_V_ALE_MAX_MCAST; i++) {
+				emac_set_reg(EMAC_ALETBLW0, 0);
+				emac_set_reg(EMAC_ALETBLW1, 0);
+				emac_set_reg(EMAC_ALETBLW2, 0);
+				emac_set_reg(EMAC_ALETBLCTL,
+					     i | EMAC_B_ALE_WRITE_RDZ);
+			}
+		}
+	}
+	if ((reset_mode == GEMAC_RESET_WARM) && (ep->mcast_infos)) {
+		/* Re-set device multicast list */
+		for (i = 0; i < ep->mcast_valid_len; i++) {
+			emac_set_reg(EMAC_ALETBLW0, ep->mcast_infos[3*i]);
+			emac_set_reg(EMAC_ALETBLW1, ep->mcast_infos[3*i+1]);
+			emac_set_reg(EMAC_ALETBLW2, ep->mcast_infos[3*i+2]);
+			emac_set_reg(EMAC_ALETBLCTL,
+				     i | EMAC_B_ALE_WRITE_RDZ);
+		}
+		/* Set mcast mode if needed */
+		if (ep->mcast_valid_len)
+			emac_setbit_reg(EMAC_ALEUNKNOWNVLAN,
+					EMAC_B_REG_MCAST_FLOOD_ON);
+	}
+}
+
+static void emac_set_modes(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+
+	if (ep->mode_flags & EMAC_CONFIG_RXCRC)
+		ep->packet_mtu = PKT_MTU_CRC;
+	else
+		ep->packet_mtu = PKT_MTU_NOCRC;
+
+	/* If PASSERROR is set, enable both ERROR and short frames */
+	if (ep->mode_flags & EMAC_CONFIG_PASSERROR)
+		emac_setbit_reg(EMAC_MACCONTROL,
+				EMAC_B_RXCEFEN | EMAC_B_RXCSFEN);
+
+	/* If PASSCONTROL is set, enable control frames */
+	if (ep->mode_flags & EMAC_CONFIG_PASSCONTROL)
+		emac_setbit_reg(EMAC_MACCONTROL, EMAC_B_RXCMFEN);
+
+	/* Set MAC loopback if requested */
+	if (ep->mode_flags & EMAC_CONFIG_MACLOOPBACK)
+		emac_setbit_reg(EMAC_MACCONTROL, EMAC_B_LOOPBACK);
+}
+
+static void emac_set_filter(struct net_device *dev, int channel)
+{
+	struct emac_private *ep = netdev_priv(dev);
+
+	emac_set_reg(CPSW_SW_CTL, 0x000000F4);	  /* Enable switch flow control */
+	emac_set_reg(CPSW_RX_CH_MAP, 0x11110000); /* RX switch priority */
+
+	emac_set_reg(EMAC_ALECONTROL, 0x80000004); /* ALE enable and bypass */
+	emac_set_reg(EMAC_ALEPRESCALE, 0x0); /* no mcat/broadcast limit */
+	emac_set_reg(EMAC_ALEUNKNOWNVLAN, 0x07030307); /* need it!!! */
+	emac_set_reg(EMAC_ALEPORTCTL0, 0x3); /* Port 0 in forward state */
+	emac_set_reg(EMAC_ALEPORTCTL1, 0x3); /* Port 1 in forward state */
+	emac_set_reg(EMAC_ALEPORTCTL2, 0x3); /* Port 2 in forward state */
+}
+
+static void emac_set_rx_mode(struct net_device *dev)
+{
+	struct emac_private *ep  = netdev_priv(dev);
+	struct dev_mc_list  *dmi = dev->mc_list;
+	u8     hashval, tmpval;
+	u32    info0, info1, info2;
+	int    i;
+
+	/* Only master can use promiscuous or multicast */
+	if (ep->slave)
+		return;
+
+	if (dev->flags & IFF_PROMISC)
+		/* Set promiscuous mode */
+		emac_setbit_reg(EMAC_ALECONTROL, EMAC_B_ALEBYPASS);
+	else
+		/* Reset promiscuous mode */
+		emac_clearbit_reg(EMAC_ALECONTROL, EMAC_B_ALEBYPASS);
+
+	/* Clear multicast config */
+	emac_clearbit_reg(EMAC_ALEUNKNOWNVLAN, EMAC_B_MCAST_FLOOD_ON |
+			  EMAC_B_REG_MCAST_FLOOD_ON);
+
+	/* Clear old multicast list that will not be reused */
+	for (i = dev->mc_count; i < ep->mcast_valid_len; i++) {
+		emac_setbit_reg(EMAC_ALETBLW0, 0);
+		emac_setbit_reg(EMAC_ALETBLW1, 0);
+		emac_setbit_reg(EMAC_ALETBLW2, 0);
+		emac_setbit_reg(EMAC_ALETBLCTL,
+				i | EMAC_B_ALE_WRITE_RDZ);
+	}
+
+	if ((dev->flags & IFF_ALLMULTI) ||
+	    (dev->mc_count > EMAC_V_ALE_MAX_MCAST)) {
+		/* Set all multicast */
+		emac_setbit_reg(EMAC_ALEUNKNOWNVLAN, EMAC_B_MCAST_FLOOD_ON |
+				EMAC_B_REG_MCAST_FLOOD_ON);
+	} else {
+		/* Set mcast from a list */
+		for (i = 0; i < dev->mc_count; i++, dmi = dmi->next) {
+			u8 *p_dmi = dmi->dmi_addr;
+
+			info0 = (((p_dmi[2]&0x0ff)<<24) |
+				 ((p_dmi[3]&0x0ff)<<16) |
+				 ((p_dmi[4]&0x0ff)<<8) | ((p_dmi[5]&0x0ff)<<0));
+			info1 = ((3<<30) | (0<<29) | (1<<28) |
+				 ((0&0x0fff)<<16) |
+				 ((p_dmi[0]&0x0ff)<<8) | ((p_dmi[1]&0x0ff)<<0));
+			info2 = (0 << 3) | (7 & 0x7);
+
+			/* Only support group multicast */
+			if (!(*p_dmi & 1)) {
+				/* don't use this entry */
+				info0 = 0;
+				info1 = 1;
+				info2 = 2;
+			}
+
+			emac_set_reg(EMAC_ALETBLW0, info0);
+			emac_set_reg(EMAC_ALETBLW1, info1);
+			emac_set_reg(EMAC_ALETBLW2, info2);
+			emac_set_reg(EMAC_ALETBLCTL,
+					i | EMAC_B_ALE_WRITE_RDZ);
+
+			/* Copy mcast list */
+			if (ep->mcast_infos) {
+				ep->mcast_infos[3*i]   = info0;
+				ep->mcast_infos[3*i+1] = info1;
+				ep->mcast_infos[3*i+2] = info2;
+			}
+		}
+
+		/* set multicast mode if needed */
+		if (dev->mc_count)
+			emac_setbit_reg(EMAC_ALEUNKNOWNVLAN,
+					EMAC_B_REG_MCAST_FLOOD_ON);
+
+		/* Remember mcast valid addrs count */
+		ep->mcast_valid_len = dev->mc_count;
+	}
+}
+
+#else /* !EMAC_HAS_ALE_SUPPORT */
+
+static void emac_reset_filter(struct net_device *dev,
+			      int channel,
+			      int reset_mode)
+{
+	struct emac_private *ep = netdev_priv(dev);
+
+	/* Reset multicast hash table */
+	emac_set_reg(EMAC_MACHASH1, 0);
+	emac_set_reg(EMAC_MACHASH2, 0);
+
+	/* Set buffer offset */
+	emac_set_reg(EMAC_RXBUFFEROFFSET, 0);
+
+	/* Reset RX (M)ulticast (B)roadcast (P)romiscuous Enable register */
+	emac_set_reg(EMAC_RXMBPENABLE, 0);
+
+	if (reset_mode == GEMAC_RESET_COLD) {
+		/* Clear unicast RX on channel 0-7 */
+		emac_set_reg(EMAC_RXUNICASTCLEAR, 0xff);
+	} else
+		emac_set_reg(EMAC_RXUNICASTCLEAR, (1 << channel));
+}
+
+static void emac_fixup_modes(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+
+	if (emac_get_reg(EMAC_RXMBPENABLE) & EMAC_B_RXPASSCRC)
+		ep->packet_mtu = PKT_MTU_CRC;
+	else
+		ep->packet_mtu = PKT_MTU_NOCRC;
+}
+
+static void emac_set_modes(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+
+	if (ep->slave)
+		return;
+
+	if (ep->mode_flags & EMAC_CONFIG_RXCRC) {
+		emac_setbit_reg(EMAC_RXMBPENABLE, EMAC_B_RXPASSCRC);
+		ep->packet_mtu = PKT_MTU_CRC;
+	} else
+		ep->packet_mtu = PKT_MTU_NOCRC;
+
+	/* If PASSERROR is set, enable both ERROR and short frames */
+	if (ep->mode_flags & EMAC_CONFIG_PASSERROR)
+		emac_setbit_reg(EMAC_RXMBPENABLE,
+				EMAC_B_RXCEFEN | EMAC_B_RXCSFEN);
+
+	/* If PASSCONTROL is set, enable control frames */
+	if (ep->mode_flags & EMAC_CONFIG_PASSCONTROL)
+		emac_setbit_reg(EMAC_RXMBPENABLE, EMAC_B_RXCMFEN);
+
+	/* Set the channel configuration to priority if requested */
+	if (ep->mode_flags & EMAC_CONFIG_CHPRIORITY)
+			emac_setbit_reg(EMAC_MACCONTROL, EMAC_B_TXPTYPE);
+
+	/* Set MAC loopback if requested */
+	if (ep->mode_flags & EMAC_CONFIG_MACLOOPBACK)
+		emac_setbit_reg(EMAC_MACCONTROL, EMAC_B_LOOPBACK);
+}
+
+static void emac_set_filter(struct net_device *dev, int channel)
+{
+	struct emac_private *ep = netdev_priv(dev);
+
+	/* Set unicast for the given channel */
+	emac_set_reg(EMAC_RXUNICASTSET, 1 << channel);
+
+	if (!ep->slave) {
+		emac_set_reg(EMAC_RXMBPENABLE, 0);
+		emac_setbit_reg(EMAC_RXMBPENABLE, EMAC_B_MULTEN);
+		emac_setbit_reg(EMAC_RXMBPENABLE, EMAC_B_BROADEN);
+		emac_setbit_reg(EMAC_RXMBPENABLE, (channel | (channel << 8)));
+	}
+}
+
+static void emac_set_rx_mode(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+	struct netdev_hw_addr *ha;
+	u8     hashval, tmpval;
+	u32    machash1, machash2;
+	int    i;
+
+	/* Only master can use promiscuous or multicast */
+	if (ep->slave)
+		return;
+
+	if (dev->flags & IFF_PROMISC) {
+		/* Set promiscuous mode */
+		emac_setbit_reg(EMAC_RXMBPENABLE, EMAC_B_RXCAFEN);
+	} else {
+		/* Reset promiscuous mode */
+		emac_clearbit_reg(EMAC_RXMBPENABLE, EMAC_B_RXCAFEN);
+	}
+
+	if (dev->flags & IFF_ALLMULTI) {
+
+		/* Set all multicast filter */
+		emac_setbit_reg(EMAC_MACHASH1, 0xffffffff);
+		emac_setbit_reg(EMAC_MACHASH2, 0xffffffff);
+
+	} else {
+

drivers/net/c6x_gemac.c line 1292

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+		hashval  = 0;
+		machash1 = 0;
+		machash2 = 0;
+
+		netdev_for_each_mc_addr(ha, dev) {
+			u8 *addr = ha->addr;
+
+			/* Only support group multicast */
+			if (!(*addr & 1))
+				continue;

I believe you don't need to test the multicast address again. If you _really_ do, is_multicast_ether_addr.

Quoted 73 lines
drivers/net/c6x_gemac.c new file +73 -0
+
+			for (i = 0; i < 2; i++) {
+				tmpval   = (u8) *addr++;
+				hashval ^= (u8) (tmpval >> 2) ^ (tmpval << 4);
+				tmpval   = (u8) *addr++;
+				hashval ^= (u8) (tmpval >> 4) ^ (tmpval << 2);
+				tmpval   = (u8) *addr++;
+				hashval ^= (u8) (tmpval >> 6) ^ (tmpval);
+			}
+
+			if (hashval & 0x20)
+				machash2 |= (1 << (hashval & 0x1f));
+			else
+				machash1 |= (1 << (hashval & 0x1f));
+		}
+
+		/* Set computed multicast filter */
+		emac_setbit_reg(EMAC_MACHASH1, machash1);
+		emac_setbit_reg(EMAC_MACHASH2, machash2);
+	}
+}
+#endif /* !EMAC_HAS_ALE_SUPPORT */
+
+#ifdef EMAC_TIMER_TICK_MDIO
+/*
+ * This function should be called for each device in the system on a
+ * periodic basis of 100mS (10 times a second). It is used to check the
+ * status of the EMAC and MDIO device.
+ */
+static void emac_timer_tick(unsigned long data)
+{
+	struct net_device   *dev = (struct net_device *)data;
+	struct emac_private *ep  = netdev_priv(dev);
+	unsigned int link_status;
+	unsigned int link_event = mdio_timer_tick();
+	unsigned int intfmacsel = mdio_get_macsel();
+
+	/*
+	 * Signal the MDIO
+	 */
+	if (link_event == MDIO_EVENT_LINKUP) {
+		link_status = mdio_get_status();
+		if (link_status == MDIO_LINKSTATUS_FD10 ||
+		    link_status == MDIO_LINKSTATUS_FD100 ||
+		    link_status == MDIO_LINKSTATUS_FD1000) {
+			emac_setbit_reg(EMAC_MACCONTROL, EMAC_B_FULLDUPLEX);
+			if (intfmacsel == DEVSTAT_MACSEL_RMII)
+				emac_setbit_reg(EMAC_MACCONTROL,
+						EMAC_B_RMIIDUPLEXMODE);
+		} else {
+			emac_clearbit_reg(EMAC_MACCONTROL, EMAC_B_FULLDUPLEX);
+			if (intfmacsel == DEVSTAT_MACSEL_RMII)
+				emac_clearbit_reg(EMAC_MACCONTROL,
+						  EMAC_B_RMIIDUPLEXMODE);
+		}
+
+		if (link_status == MDIO_LINKSTATUS_FD1000)
+			emac_setbit_reg(EMAC_MACCONTROL, EMAC_B_GIG);
+
+		if ((link_status == MDIO_LINKSTATUS_FD10 ||
+		     link_status == MDIO_LINKSTATUS_HD10) &&
+		    (intfmacsel == DEVSTAT_MACSEL_RMII))
+			/* Clear bit to set clock to 2.5 MHz */
+			emac_clearbit_reg(EMAC_MACCONTROL, EMAC_B_RMIISPEED);
+
+		if ((link_status == MDIO_LINKSTATUS_FD100 ||
+		     link_status == MDIO_LINKSTATUS_HD100) &&
+		    (intfmacsel == DEVSTAT_MACSEL_RMII))
+			/* Set bit to set clock to 25 MHz */
+			emac_setbit_reg(EMAC_MACCONTROL, EMAC_B_RMIISPEED);
+
+		/* eventually call platform hook for RMII out of reset */
+		rmii_arch_fix();

drivers/net/c6x_gemac.c line 1375

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+
+		/* Put RGMII in forced link mode */
+		if (intfmacsel == DEVSTAT_MACSEL_RGMII)
+			emac_clearbit_reg(EMAC_MACCONTROL, EMAC_B_RGMIIEN);
+	}
+	mod_timer(&emac_timer, jiffies + EMAC_TIMER_PERIOD);
+}
+#endif /* EMAC_TIMER_TICK_MDIO */
+
+static const char emac_driver_name[] = "EMAC";

EMAC? Shouldn't this be c6x_gmac?

Quoted 26 lines
drivers/net/c6x_gemac.c new file +26 -0
+static const struct net_device_ops gemac_netdev_ops = {
+	.ndo_open		= emac_open,
+	.ndo_stop		= emac_close,
+	.ndo_start_xmit		= emac_start_xmit,
+	.ndo_tx_timeout		= emac_timeout,
+	.ndo_set_multicast_list	= emac_set_rx_mode,
+	.ndo_set_mac_address	= eth_mac_addr,
+	.ndo_get_stats		= emac_get_stats,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.ndo_poll_controller	= emac_poll,
+#endif
+	.ndo_change_mtu		= eth_change_mtu,
+	.ndo_validate_addr	= eth_validate_addr,
+};
+
+static const struct ethtool_ops gemac_ethtool_ops = {
+};
+
+static int __init emac_probe(struct platform_device *pdev)
+{
+	struct net_device      *netdev;
+	struct emac_private    *ep;
+	int			res = -EINVAL;
+	int			i;
+#ifdef EMAC_ARCH_HAS_MAC_ADDR
+	char			hw_emac_addr[6];

drivers/net/c6x_gemac.c line 1412

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+#endif
+	struct resource        *cur_res;
+	static int		ndevs;
+	int			irq   = 0;
+
+	emac_idx = get_emac_idx();
+
+	if (ndevs >= EMAC_MAX_INSTANCE) {
+		printk(KERN_ERR "gemac: Invalid instance: %d (max=%d)\n",
+		       ndevs, EMAC_MAX_INSTANCE);
		pr_err("Invalid instance: %d (max=%d)\n",
		       ndevs, EMAC_MAX_INSTANCE);
Quoted 690 lines
drivers/net/c6x_gemac.c new file +170 -0
+		return -EINVAL;
+	}
+
+	/* Allocate private information */
+	netdev = alloc_etherdev(sizeof(struct emac_private));
+	if (!netdev)
+		return -ENOMEM;
+
+	SET_NETDEV_DEV(netdev, &pdev->dev);
+
+	ep	= netdev_priv(netdev);
+	ep->dev = netdev;
+
+	spin_lock_init(&ep->lock);
+
+	/* Get irqs numbers */
+	cur_res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "IRQ_SRC");
+	if (cur_res)
+		irq = cur_res->start;
+
+	/* Get EMAC I/O addresses */
+	ep->emac_reg_base = 0;
+	ep->ectl_reg_base = 0;
+	ep->emac_dsc_base = 0;
+	ep->mdio_reg_base = 0;
+
+	cur_res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+					       "EMAC_REG_BASE");
+	if (cur_res)
+		ep->emac_reg_base = cur_res->start;
+
+	cur_res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+					       "ECTL_REG_BASE");
+	if (cur_res)
+		ep->ectl_reg_base = cur_res->start;
+
+	cur_res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+					       "EMAC_DSC_BASE");
+	if (cur_res)
+		ep->emac_dsc_base = cur_res->start
+			+ ((IDX_TO_CHAN(emac_idx) * QUEUE_DESC_NUM) << 4);
+
+#ifdef EMAC_DO_INIT_MDIO
+	cur_res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+					       "MDIO_REG_BASE");
+	if (cur_res)
+		ep->mdio_reg_base = cur_res->start;
+#endif
+
+	if (!irq || !ep->emac_reg_base || !ep->ectl_reg_base || !ep->emac_dsc_base) {
+		printk(KERN_ERR "%s: Unable to get hardware resources\n",
+		       netdev->name);
+		goto error;
+	}
+
+	ep->mode_flags = config.flags;
+
+	if (emac_check_shared_capability())
+		ep->slave = emac_shared;
+
+	netdev->base_addr = ep->emac_reg_base;
+	netdev->dev_id	  = pdev->id;
+
+#ifdef EMAC_ARCH_HAS_MAC_ADDR
+	/* SoC or board hw has MAC address */
+	if (config.enetaddr[0] == 0 && config.enetaddr[1] == 0 &&
+	    config.enetaddr[2] == 0 && config.enetaddr[3] == 0 &&
+	    config.enetaddr[4] == 0 && config.enetaddr[5] == 0) {
+		if (!emac_arch_get_mac_addr(hw_emac_addr))
+			for (i = 0; i <= 5; i++)
+				config.enetaddr[i] = hw_emac_addr[i] & 0xff;
+	}
+#endif
+	/* Setup the device */
+	res = emac_reset(netdev, GEMAC_RESET_COLD);
+	if (res) {
+		free_netdev(netdev);
+		goto error;
+	}
+
+	/* driver system function */
+	ether_setup(netdev);
+
+	/* Set generic Ethernet operations */
+	netdev->netdev_ops	= &gemac_netdev_ops;
+	netdev->watchdog_timeo	= TX_TIMEOUT;
+	netdev->ethtool_ops	= &gemac_ethtool_ops;
+
+	platform_set_drvdata(pdev, netdev);
+
+	/* Register Ethernet device */
+	res = register_netdev(netdev);
+	if (res) {
+		printk(KERN_ERR "%s: Unable to register netdev\n",
+		       netdev->name);
+		goto error;
+	}
+
+	/* Setup transmit/receive buffers */
+	res = emac_setup_ring(ep);
+	if (res) {
+		printk(KERN_ERR "%s: Unable to allocate memory\n",
+		       netdev->name);
+		goto error;
+	}
+
+#ifdef EMAC_TIMER_TICK_MDIO
+	/* Set EMAC timer */
+	init_timer(&emac_timer);
+	emac_timer.function = emac_timer_tick;
+	emac_timer.data = (unsigned long)netdev;
+	mod_timer(&emac_timer, jiffies + EMAC_TIMER_PERIOD);
+#endif
+
+	/* Install our interrupt handler(s) */
+#ifdef EMAC_HAS_SEPARATE_RXTX_IRQS
+	if ((request_irq(irq, emac_rx_interrupt, _INTFLAG, "GEMAC RX", netdev) == 0) &&
+	    (request_irq(irq + 1, emac_tx_interrupt, _INTFLAG, "GEMAC TX", netdev) == 0))
+		netdev->irq = irq;
+#else
+	if (request_irq(irq, emac_interrupt, 0, "GEMAC", netdev) == 0)
+		netdev->irq = irq;
+#endif
+
+	printk(KERN_INFO "%s: EMAC(%d) driver version 2.1 IRQ=%d queue=%d %s",
+	       netdev->name, pdev->id, netdev->irq, IDX_TO_CHAN(emac_idx),
+	       emac_shared ? "shared\n" : "\n");
+
+	printk(KERN_INFO "%s: MAC address=", netdev->name);
+	for (i = 0; i < 5; i++)
+		printk(KERN_CONT "%02x:", netdev->dev_addr[i]);
+#ifdef CONFIG_SGMII
+	printk(KERN_CONT "%02x PHY=SGMII\n", netdev->dev_addr[i]);
+#else
+	printk(KERN_CONT "%02x PHY=%s%sMII\n", netdev->dev_addr[i],
+	       ((mdio_get_macsel() & DEVSTAT_MACSEL_RMII) ? "R" : ""),
+	       ((mdio_get_macsel() & DEVSTAT_MACSEL_GMII) ? "G" : ""));
+#endif
+	++ndevs;
+	return 0;
+
+ error:
+	free_netdev(netdev);
+	return res;
+}
+
+static struct platform_driver emac_driver = {
+	.driver = {
+		.name	= (char *) emac_driver_name,
+		.owner	= THIS_MODULE,
+	},
+	.probe	= emac_probe,
+};
+
+static void __exit emac_cleanup(void)
+{
+	platform_driver_unregister(&emac_driver);
+}
+module_exit(emac_cleanup);
+
+/*
+ * Initialize GEMAC controller
+ */
+static int emac_init(void)
+{
+	return platform_driver_register(&emac_driver);
+}
+
+module_init(emac_init);
+
drivers/net/c6x_gmdio.c new file +514 -0
new file mode 100644
index 0000000..6a82519
@@ -0,0 +1,514 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2006, 2009, 2010 Texas Instruments Incorporated
+ *  Author: Nicolas Videau ([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/kernel.h>
+#include <linux/sched.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/io.h>
+
+#include <asm/setup.h>
+#include <asm/irq.h>
+#include <asm/gmdio.h>
+#include <asm/pll.h>
+
+static struct mdio_status mdios;
+
+/*
+ * Tick counts for timeout of each state
+ * Note that NWAYSTART falls through to NWAYWAIT which falls through
+ * to LINKWAIT. The timeout is not reset progressing from one state
+ * to the next, so the system has 5 seconds total to find a link.
+ */
+static unsigned int phy_timeout[] = { 2,  /* MDIO_PHY_MDIOINIT	- min-delay  */
+				      6,  /* MDIO_PHY_RESET	- .5 sec max */
+				      41, /* MDIO_PHY_NWAYSTART - 4 seconds  */
+				      41, /* MDIO_PHY_NWAYWAIT	- 4 seconds  */
+				      51, /* MDIO_PHY_LINKWAIT	- 5 seconds  */
+				      0 };/* MDIO_PHY_LINKED	- no timeout */
+
+static void mdio_init_state_machine(void)
+{
+	mdios.phy_addr	  = 0;
+	mdios.phy_state   = MDIO_PHY_MDIOINIT;
+	mdios.phy_ticks   = 0;
+	mdios.link_status = MDIO_LINKSTATUS_NOLINK;
+}
+
+/*
+ * Initialize the MDIO
+ */
+int mdio_init(unsigned int txid_version)
+{
+#ifdef CONFIG_SOC_TMS320C6455
+	/* Get MAC interface */
+	mdios.macsel = (DSCR_DEVSTAT >> DEVSTAT_MACSEL_OFFSET) &
+		DEVSTAT_MACSEL_MASK;
+#else
+	/* Default (no gigabit support) */
+	mdios.macsel = DEVSTAT_MACSEL_MII;
+#endif
+
+	/* Get Transmit identification and version */
+	mdios.emac_txidver = txid_version;
+
+	mdios.mode = MDIO_MODE_AUTONEG; /* autonegotiate */
+	mdio_init_state_machine();
+	mdio_set_reg(MDIO_CONTROL, EMAC_B_ENABLE | (VBUSCLK & EMAC_M_CLKDIV));
+	return 0;
+}
+
+/*
+ * Return the current MDIO/PHY status
+ */
+unsigned int mdio_get_status(void)
+{
+	return mdios.link_status;
+}
+
+/*
+ * Return the current MDIO/PHY interface
+ */
+unsigned int mdio_get_macsel(void)
+{
+	mdios.macsel = (DSCR_DEVSTAT >> DEVSTAT_MACSEL_OFFSET) &
+		DEVSTAT_MACSEL_MASK;
+
+	return mdios.macsel;
+}
+
+/*
+ * Force a switch to the specified PHY, and start the negotiation process
+ */
+static unsigned int mdio_init_phy_1(volatile unsigned int phy_addr)
+{
+	unsigned short	 val, ack;
+	unsigned int	 lval;
+	unsigned int	 i;
+
+	mdios.phy_addr	  = phy_addr;
+	mdios.link_status = MDIO_LINKSTATUS_NOLINK;
+
+	/* Shutdown all other PHYs */
+	lval = mdio_get_reg(MDIO_ALIVE);
+	for (i = 0; lval; i++, lval >>= 1)
+		if ((lval & 1) && (i != phy_addr)) {
+			mdio_phy_write(MDIO_PHY_REG_CONTROL,
+				       i,
+				       (MDIO_PHY_B_ISOLATE |
+					MDIO_PHY_B_POWERDOWN));
+			mdio_phy_wait();
+		}
+
+#ifdef CONFIG_ARCH_BOARD_DSK6455
+	/* Settings for Broadcom phys */
+	if (mdios.macsel == DEVSTAT_MACSEL_RGMII) {
+		/* Put phy in copper mode */
+		mdio_phy_write(MDIO_PHY_REG_ACCESS, phy_addr,
+			       MDIO_PHY_B_COPPER);
+		mdio_phy_wait_res_ack(val, ack);
+
+		/* If the PHY did not ACK the write, return zero */
+		if (!ack)
+			return 0;
+
+		mdio_phy_write(0x10, phy_addr, 0x0000);
+		mdio_phy_wait();
+
+		/* Put phy in RGMII mode/in-band status data for PG 2.0 */
+		if (mdios.emac_txidver != 0x000C1207) {
+			mdio_phy_write(MDIO_PHY_REG_SHADOW, phy_addr,
+				       MDIO_PHY_B_INBAND);
+			mdio_phy_wait_res_ack(val, ack);
+
+			/* If the PHY did not ACK the write, return zero */
+			if (!ack)
+				return 0;
+		}
+
+		/* Patch for (older) board revB with R822 soldered */
+		mdio_phy_write(MDIO_PHY_REG_ACCESS, phy_addr, 0x8C00);
+		mdio_phy_wait_res_ack(val, ack);
+		/* End of patch */
+	}
+#endif
+
+	if (mdios.macsel == DEVSTAT_MACSEL_GMII) {
+		/* Put phy in copper mode */
+		mdio_phy_write(MDIO_PHY_REG_ACCESS, phy_addr,
+			       MDIO_PHY_B_COPPER);
+		mdio_phy_wait_res_ack(val, ack);
+
+		/* If the PHY did not ACK the write, return zero */
+		if (!ack)
+			return 0;
+	}
+
+	/* Ready for next init step */
+	mdios.phy_state   = MDIO_PHY_RESET;
+	mdios.phy_ticks   = 0;
+
+	return 1;
+}
+
+static unsigned int mdio_init_phy_2(volatile unsigned int phy_addr)
+{
+	unsigned short	 val, val2, valgig = 0;
+
+	mdios.phy_addr	  = phy_addr;
+
+	/* Read the STATUS reg to check autonegotiation capability */
+	mdio_phy_read(MDIO_PHY_REG_STATUS, phy_addr);
+	mdio_phy_wait_res(val);
+
+	if ((mdios.macsel == DEVSTAT_MACSEL_GMII) ||
+	    (mdios.macsel == DEVSTAT_MACSEL_RGMII)) {
+		mdio_phy_read(MDIO_PHY_REG_EXTSTATUS, phy_addr);
+		mdio_phy_wait_res(valgig);
+	}
+
+	/* See if we auto-neg or not */
+	if ((mdios.mode & MDIO_MODE_AUTONEG) &&
+	    (val & MDIO_PHY_B_AUTOCAPABLE)) {
+		/* We will use NWAY */
+
+		/* Advertise 1000 for supported interfaces */
+		if ((mdios.macsel == DEVSTAT_MACSEL_GMII) ||
+		    (mdios.macsel == DEVSTAT_MACSEL_RGMII)) {
+			valgig >>= 4;
+			valgig &= MDIO_PHY_ADV_FD1000;
+
+			mdio_phy_write(MDIO_PHY_REG_1000CONTROL, phy_addr,
+				       valgig);
+			mdio_phy_wait();
+		}
+
+		/* Shift down the capability bits */
+		val >>= 6;
+
+		/* Mask with the capabilities */
+		val &= (MDIO_PHY_B_AFD100 | MDIO_PHY_B_AHD100 |
+			MDIO_PHY_B_AFD10 | MDIO_PHY_B_AHD10);
+
+		/* Set Ethernet message bit */
+		val |= MDIO_PHY_B_MSG;
+
+		/* Write out advertisement */
+		mdio_phy_write(MDIO_PHY_REG_ADVERTISE, phy_addr, val);
+		mdio_phy_wait();
+
+		/* Start NWAY */
+		mdio_phy_write(MDIO_PHY_REG_CONTROL,
+			       phy_addr,
+			       MDIO_PHY_B_AUTONEGEN);
+		mdio_phy_wait();
+
+		mdio_phy_write(MDIO_PHY_REG_CONTROL,
+			       phy_addr,
+			       (MDIO_PHY_B_AUTONEGEN | MDIO_PHY_B_AUTORESTART));
+		mdio_phy_wait();
+
+		/* Setup current state */
+		mdios.mode |= MDIO_MODE_NWAYACTIVE;
+		mdios.phy_state = MDIO_PHY_NWAYSTART;
+		mdios.phy_ticks = 0;
+
+	} else {
+		/* Otherwise use a fixed configuration */
+
+		/* Shift down the capability bits */
+		val >>= 10;
+
+		/* Mask with possible modes */
+		val &= (MDIO_MODE_HD10 | MDIO_MODE_FD10 |
+			MDIO_MODE_HD100 | MDIO_MODE_FD100);
+
+		if ((mdios.macsel == DEVSTAT_MACSEL_GMII) ||
+		    (mdios.macsel == DEVSTAT_MACSEL_RGMII)) {
+			valgig >>= 8;
+			valgig &= MDIO_MODE_FD1000;
+
+			valgig &= mdios.mode;
+		}
+
+		/* Mask with what the User wants to allow */
+		val &= mdios.mode;
+
+		/* If nothing if left, move on */
+		if ((!val) && (!valgig))
+			return 0;
+
+		/* Setup Control word and pending status */
+		if (valgig) {
+			val2 = MDIO_PHY_B_SPEEDMSB | MDIO_PHY_B_DUPLEXFULL;
+			mdios.pending_status = MDIO_LINKSTATUS_FD1000;
+		} else if (val & MDIO_MODE_FD100) {
+			val2 = MDIO_PHY_B_SPEEDLSB | MDIO_PHY_B_DUPLEXFULL;
+			mdios.pending_status = MDIO_LINKSTATUS_FD100;
+		} else if (val & MDIO_MODE_HD100) {
+			val2 = MDIO_PHY_B_SPEEDLSB;
+			mdios.pending_status = MDIO_LINKSTATUS_HD100;
+		} else if (val & MDIO_MODE_FD10) {
+			val2 = MDIO_PHY_B_DUPLEXFULL;
+			mdios.pending_status = MDIO_PHY_B_FD10;
+		} else {
+			val2 = 0;
+			mdios.pending_status = MDIO_LINKSTATUS_HD10;
+		}
+
+		/* Add in loopback if user wanted it */
+		if (mdios.mode & MDIO_MODE_LOOPBACK)
+			val2 |= MDIO_PHY_B_LOOPBACK;
+
+		/* Configure PHY */
+		mdio_phy_write(MDIO_PHY_REG_CONTROL, phy_addr,
+			       (val2 | MDIO_PHY_B_AUTORESTART));
+		mdio_phy_wait();
+
+		/* Add in external loopback with plug if user wanted it */
+		if (mdios.mode & MDIO_MODE_EXTLOOPBACK) {
+			mdio_phy_write(MDIO_PHY_REG_SHADOW, phy_addr,
+				       MDIO_PHY_B_EXTLOOPBACK);
+			mdio_phy_wait();
+		}
+
+		/* Setup current state */
+		mdios.mode &= ~MDIO_MODE_NWAYACTIVE;
+		mdios.phy_state = MDIO_PHY_LINKWAIT;
+		mdios.phy_ticks = 0;
+	}
+	return 1;
+}
+
+
+/*
+ * Called each 100mS to check if MDIO status has changed.
+ * A MDIO event is returned.
+ */
+unsigned int mdio_timer_tick(void)
+{
+	unsigned int res = MDIO_EVENT_NOCHANGE;
+	unsigned short val, val2, valgig = 0, valgig2 = 0, ack;
+	unsigned int lval;
+
+	if (mdios.phy_state == MDIO_PHY_LINKED) {
+		/*
+		 * Check for a "link-change" status indication or a link
+		 * down indication.
+		 */
+		lval = mdio_get_reg(MDIO_LINKINTRAW) & 1;
+		mdio_set_reg(MDIO_LINKINTRAW, lval);
+		if (lval || !(mdio_get_reg(MDIO_LINK) & (1 << mdios.phy_addr))) {
+
+			mdios.link_status = MDIO_LINKSTATUS_NOLINK;
+			mdios.phy_ticks = 0;
+			res = MDIO_EVENT_LINKDOWN;
+
+			/* If not NWAY, just wait for link */
+			if (!(mdios.mode & MDIO_MODE_NWAYACTIVE))
+				mdios.phy_state = MDIO_PHY_LINKWAIT;
+			else {
+				/* Handle NWAY condition */
+				mdio_phy_read(MDIO_PHY_REG_STATUS,
+					      mdios.phy_addr);
+				mdio_phy_wait();
+				mdio_phy_read(MDIO_PHY_REG_STATUS,
+					      mdios.phy_addr);
+				mdio_phy_wait_res_ack(val, ack);
+				if (!ack)
+					mdio_init_state_machine();
+
+				else if (!(val & MDIO_PHY_B_LINKSTATUS)) {
+					/* No Link - restart NWAY */
+					mdios.phy_state = MDIO_PHY_NWAYSTART;
+
+					mdio_phy_write(MDIO_PHY_REG_CONTROL,
+						       mdios.phy_addr,
+						       (MDIO_PHY_B_AUTONEGEN |
+							MDIO_PHY_B_AUTORESTART));
+					mdio_phy_wait();
+				} else
+					/* We have a Link - re-read NWAY params */
+					mdios.phy_state = MDIO_PHY_NWAYWAIT;
+			}
+		}
+	}
+
+	if (mdios.phy_state != MDIO_PHY_LINKED) {
+		/* Bump the time counter */
+		mdios.phy_ticks++;
+
+		/* Process differently based on state */
+		switch (mdios.phy_state) {
+#if !(defined(CONFIG_SOC_TMS3206472) || defined(CONFIG_SOC_TMS3206474)) && \
+	!defined(CONFIG_SOC_TMS3206457)
+		case MDIO_PHY_RESET:
+			/* Don't read reset status for the first 100 to 200 ms */
+			if (mdios.phy_ticks < 2)
+				break;
+
+			/* See if the PHY has come out of reset */
+			mdio_phy_read(MDIO_PHY_REG_CONTROL,
+				      mdios.phy_addr);
+			mdio_phy_wait_res_ack(val, ack);
+
+			if (ack && !(val & MDIO_PHY_B_RESET)) {
+				/* PHY is not reset.
+				 * If the PHY init is going well, break out */
+				if (mdio_init_phy_2(mdios.phy_addr))
+					break;
+				/* Else, this PHY is toast.
+				 * Manually trigger a timeout */
+				mdios.phy_ticks = phy_timeout[mdios.phy_state];
+			}
+
+			/* Fall through to timeout check */
+#endif
+		case MDIO_PHY_MDIOINIT:
+ check_timeout:
+			/* Here we just check timeout and try to find a PHY */
+			if (mdios.phy_ticks >= phy_timeout[mdios.phy_state]) {
+				/* Try the next PHY if anything but
+				 * a MDIOINIT condition */
+				if (mdios.phy_state != MDIO_PHY_MDIOINIT)
+					if (++mdios.phy_addr == 32)
+						mdios.phy_addr = 0;
+
+				lval = mdio_get_reg(MDIO_ALIVE);
+
+				for (val = 0; val < 32; val++) {
+
+					if ((lval & (1 << mdios.phy_addr)) &&
+					    (mdio_init_phy_1(mdios.phy_addr)))
+						break;
+
+					if (++mdios.phy_addr == 32)
+						mdios.phy_addr = 0;
+				}
+
+				/* If we didn't find a PHY, try again */
+				if (val == 32) {
+					mdios.phy_addr	  = 0;
+					mdios.phy_state   = MDIO_PHY_MDIOINIT;
+					mdios.phy_ticks   = 0;
+					res = MDIO_EVENT_PHYERROR;
+				}
+			}
+			break;
+
+		case MDIO_PHY_NWAYSTART:
+			/* Start NWAY */
+
+			/* Read the CONTROL reg to verify "restart" is not set */
+			mdio_phy_read(MDIO_PHY_REG_CONTROL, mdios.phy_addr);
+			mdio_phy_wait_res_ack(val, ack);
+			if (!ack) {
+				mdio_init_state_machine();
+				break;
+			}
+
+			if (val & MDIO_PHY_B_AUTORESTART)
+				goto check_timeout;
+
+			/* Flush latched "link status" from the STATUS reg */
+			mdio_phy_read(MDIO_PHY_REG_STATUS, mdios.phy_addr);
+			mdio_phy_wait();
+
+			mdios.phy_state = MDIO_PHY_NWAYWAIT;
+
+			/* Fallthrough */
+
+		case MDIO_PHY_NWAYWAIT:
+			/* Waiting NWAY to complete */
+
+			/* Read the STATUS reg to check for "complete" */
+			mdio_phy_read(MDIO_PHY_REG_STATUS, mdios.phy_addr);
+			mdio_phy_wait_res_ack(val, ack);
+			if (!ack) {
+				mdio_init_state_machine();
+				break;
+			}
+
+			if (!(val & MDIO_PHY_B_AUTOCOMPLETE))
+				goto check_timeout;
+#if !(defined(CONFIG_SOC_TMS3206472) || defined(CONFIG_SOC_TMS3206474)) && !defined(CONFIG_SOC_TMS3206457)
+			/* We can now check the negotiation results */
+			if ((mdios.macsel == DEVSTAT_MACSEL_GMII) ||
+			    (mdios.macsel == DEVSTAT_MACSEL_RGMII)) {
+				mdio_phy_read(MDIO_PHY_REG_1000CONTROL,
+					      mdios.phy_addr);
+				mdio_phy_wait_res(valgig);
+				mdio_phy_read(MDIO_PHY_REG_1000STATUS,
+					      mdios.phy_addr);
+				mdio_phy_wait_res(valgig2);
+			}
+#endif
+			mdio_phy_read(MDIO_PHY_REG_ADVERTISE, mdios.phy_addr);
+			mdio_phy_wait_res(val);
+			mdio_phy_read(MDIO_PHY_REG_PARTNER, mdios.phy_addr);
+			mdio_phy_wait_res(val2);
+
+			val2 &= val;
+#if !(defined(CONFIG_SOC_TMS3206472) || defined(CONFIG_SOC_TMS3206474)) && !defined(CONFIG_SOC_TMS3206457)
+			if ((valgig & MDIO_PHY_ADV_FD1000) &&
+			    (valgig2 & MDIO_PHY_PRT_FD1000))
+				mdios.pending_status = MDIO_LINKSTATUS_FD1000;
+			else if (val2 & MDIO_PHY_B_AFD100)
+				mdios.pending_status = MDIO_LINKSTATUS_FD100;
+#else
+			if (val2 & MDIO_PHY_B_AFD100)
+				mdios.pending_status = MDIO_LINKSTATUS_FD100;
+#endif
+			else if (val2 & MDIO_PHY_B_AHD100)
+				mdios.pending_status = MDIO_LINKSTATUS_HD100;
+			else if (val2 & MDIO_PHY_B_AFD10)
+				mdios.pending_status = MDIO_LINKSTATUS_FD10;
+			else if (val2 & MDIO_PHY_B_AHD10)
+				mdios.pending_status = MDIO_LINKSTATUS_HD10;
+			else if (val & MDIO_PHY_B_AHD100)
+				mdios.pending_status = MDIO_LINKSTATUS_HD100;
+			else
+				mdios.pending_status = MDIO_LINKSTATUS_HD10;
+
+			mdios.phy_state = MDIO_PHY_LINKWAIT;
+
+		case MDIO_PHY_LINKWAIT:
+			/* Waiting for LINK */
+			mdio_phy_read(MDIO_PHY_REG_STATUS, mdios.phy_addr);
+			mdio_phy_wait_res_ack(val, ack);
+			if (!ack) {
+				mdio_init_state_machine();
+				break;
+			}
+
+			if (!(val & MDIO_PHY_B_LINKSTATUS))
+				goto check_timeout;
+
+			/* Make sure we're linked in the MDIO module as well */
+			lval = mdio_get_reg(MDIO_LINK);
+			if (!(lval & (1 << mdios.phy_addr)))
+				goto check_timeout;
+
+			/* Start monitoring this PHY */
+			mdio_set_reg(MDIO_USERPHYSEL0, mdios.phy_addr);
+
+			/* Clear the link change flag so we can detect a "re-link" later */
+			mdio_set_reg(MDIO_LINKINTRAW, 1);
+
+			/* Setup our linked state */
+			mdios.phy_state   = MDIO_PHY_LINKED;
+			mdios.link_status = mdios.pending_status;
+			res = MDIO_EVENT_LINKUP;
+			break;
+		}
+	}
+	return res;
+}
#24 lore raw
In reply to Randy Dunlap
Quoted 2 lines · Randy Dunlap

Please run the patches thru checkpatch.pl. You don't have to fix everything that it whines about, just use good judgment.

Thanks Randy.

Was there anything particular that jumped out at you. I did run checkpatch and there were 7 seven errors but none seemed fixable to me (unless there really is a way to get rid of kernel_thread). The warnings were almost all about exceeded 80 char line width. I have been working on those for a while and there's a lot less than there used to be! :-)

--Mark

#25 lore raw
Quoted 4 lines · On Wed, 11 May 2011 20:57:53 -0400 Mark Salter wrote:
Quoted 2 lines · Randy Dunlap

Please run the patches thru checkpatch.pl. You don't have to fix everything that it whines about, just use good judgment.

Quoted 8 lines

Thanks Randy.

Was there anything particular that jumped out at you. I did run checkpatch and there were 7 seven errors but none seemed fixable to me (unless there really is a way to get rid of kernel_thread). The warnings were almost all about exceeded 80 char line width. I have been working on those for a while and there's a lot less than there used to be! :-)

There was one in drivers/platform/c6x/ where a driver included asm/timer.h instead of linux/timer.h (IIRC - I don't have the patch handy ATM to run it again). checkpatch said to use linux/ instead of asm/.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#26 lore raw
Quoted 3 lines · Randy Dunlap

There was one in drivers/platform/c6x/ where a driver included asm/timer.h instead of linux/timer.h (IIRC - I don't have the patch handy ATM to run it again). checkpatch said to use linux/ instead of asm/.

Ah, okay. Yeah, that's in a few places actually. Generally speaking, there is no asm/timer.h and linux/timer.h doesn't include it. Maybe I should just rename it or make it mach/timer.h which is probably more appropriate anyway.

--Mark

#27 lore raw
In reply to Mark Salter
Quoted 6 lines · Mark Salter

This patch series adds support for a new architecture (arch/c6x) to Linux. This architecture supports members of the Texas Instruments family of C64x single and multicore DSPs. The multicore DSPs do not support cache coherancy, so are not suitable for SMP. Also, these are no-mmu processors. This core architecture is VLIW with an instruction set optimized for DSP applications. For details on the processors:

So all the changelogs talk about C64x but the arch and all the configs
are called c6x? Is it that hard to type 2 digits? Or do you expect
an additional chip that breaks the C64 but would fit the C6x name?

Also, a couple of one liners while preparing my comments on hvc_c6x:

[09/16] C6X: add kernel files

in kernel/setup.c you include linux/delay.h multiple times

[11/16] C6X: add lib files

arch/c6x/lib/memset.c

(1) file header says linux/arch/c6x/lib/memcmp.c
(you should probably just delete such headers, they are just maintence errors)

(2) it appears to mach lib/string.c implementation except (1) register (2)
uses post-increment instead of pre-increment. Does it matter with gcc?

arch/c6x/lib/memcmp.c
your version returns -1 or 1 while string.c returns the difference
after promotion to int. man page for userspace says just integer less
than or greater, so I guess this is ok. But is this more efficient, or could you use the generic version?

milton

#17 lore raw

Re: [04/16] add support for C64x+ debugger based console

In reply to Mark Salter
Quoted 5 lines · Mark Salter

Texas Instruments debugger support for the C64X+ family of DSPs includes a console for the unit under test. This patch adds write-only console support to send kernel output to the debugger. It is safe to have this driver in place even if the system is not being run under the debugger.

Quoted 7 lines

---
drivers/tty/hvc/Makefile | 1 +

 drivers/tty/hvc/hvc_c6x.c |  125 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 126 insertions(+), 0 deletions(-)
 create mode 100644 drivers/tty/hvc/hvc_c6x.c

Hmm, no Kconfig? Oh, I see, you have a very minimal entry in
arch/c6x/Kconfig via "[07/16] C6X: add toplevel configury and makefile".

Except that is too minimal. It should give the user guidance like the changelog: it provides a hook for a that the debuger can set a breakpoint to know when to pick up the data, is safe when the debugger is not enabled, etc. Answer "why would a user want this?".

Also, I prefer it to be local with the driver and makefile even if it depends on your architecture. There is nothing processor architeture specific about this driver, even the asm is 2 nops and a label; so some other arch may want to reuse this driver.

Quoted 3 lines

+/*
+ * TI C6X Host Port hypervisor console
+ */

Nothing is really hypervisor, other than the name of the framework. More like debugger driver?

drivers/tty/hvc/hvc_c6x.c line 19

Quoted 3 lines
drivers/tty/hvc/hvc_c6x.c new file +3 -0
+
+#include <linux/console.h>
+#include <linux/delay.h>

Not sure you use anything from delay.h

Quoted 7 lines
drivers/tty/hvc/hvc_c6x.c new file +7 -0
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+
+#include "hvc_console.h"
+

drivers/tty/hvc/hvc_c6x.c line 36

Quoted 10 lines
drivers/tty/hvc/hvc_c6x.c new file +10 -0
+#define PARAMSIZE	8
+#define MSGSIZE		256
+
+#define CIO_READ	0xF2
+#define CIO_WRITE	0xF3
+
+#define CIO_STDIN	0
+#define CIO_STDOUT	1
+#define CIO_STDERR	2
+

So you probably have some method to read characters that could be added. No pressure, but that could be useful. Your raw transport also has multiple channels which could be used.

Quoted 53 lines
drivers/tty/hvc/hvc_c6x.c new file +53 -0
+struct c6x_msg {
+	unsigned int	length;
+	unsigned char	command;
+	unsigned char	params[PARAMSIZE];
+	unsigned char	msg[MSGSIZE];
+};
+
+union c6x_msgparam {
+	unsigned char	params[PARAMSIZE];
+	struct {
+		unsigned short fd;
+		unsigned short count;
+	} host_write;
+};
+
+/*
+ * __CIOBUF__ and C$$IO$$ are special symbols for debugger.
+ *
+ * If debugger is running kernel, it will set a breakpoint
+ * at C$$IO$$ which is hit when the kernel wants attention
+ * from the debugger. __CIOBUF__ is used to pass messages
+ * between debugger and kernel when the breakpoint is hit.
+ */
+struct c6x_msg _CIOBUF_;
+
+static noinline void notify_debugger(void)
+{
+	asm volatile (".global C$$IO$$\n"
+		      "nop\n"
+		      "C$$IO$$: nop\n");
+}
+
+static int hvc_c6x_put_chars(uint32_t vt, const char *buf, int count)
+{
+	union c6x_msgparam params;
+	int to_write, remaining;
+
+	remaining = count;
+	while (remaining > 0) {
+		to_write = (remaining > MSGSIZE) ? MSGSIZE : remaining;
+
+		_CIOBUF_.length = to_write;
+		_CIOBUF_.command = CIO_WRITE;
+
+		params.host_write.fd = cpu_to_le16(CIO_STDOUT);
+		params.host_write.count = cpu_to_le16(to_write);
+		memcpy(_CIOBUF_.params, &params, PARAMSIZE);
+
+		memcpy(_CIOBUF_.msg, buf, to_write);
+
+		notify_debugger();
+
+		remaining -= to_write;

drivers/tty/hvc/hvc_c6x.c line 99

Quoted 10 lines
drivers/tty/hvc/hvc_c6x.c new file +10 -0
+	}
+	return count;
+}
+
+#ifdef CONFIG_EARLY_PRINTK
+void hvc_c6x_early_puts(const char *buf, unsigned count)
+{
+	hvc_c6x_put_chars(0, buf, count);
+}
+#endif

Hmm, so you have

(1) early_printk only avail if CONFIG_EARLY_PRINTK (no #else nop), and this hook is protyped in include/early_printk under ifdef.

(2) arch/c6x/kernel/early_console.c implements a hook, with an explict ifdef for this driver to fill in the hook

So both files ifdef the config used to build the other file.

Do you have other hook implementations for your early_puts?

(3) the effect of doing the above gets a console that gets called with upto 512 characters per buffer (which would require 2 messages, but you handle that), instead of the hvc_console N_OUTBUF = 16 per loop.

The hvc console is supposed to auto-register the console either when the hvc_console console_initcall is made or when some sub driver calls hvc_instantiate. While its not as clear as it used to be that calling it early is safe, I think it stll is.

I can see how the early-printk console could be about 16x faster; maybe we should create a static buffer for console output. Its always filled under the console locks and drained under the same call. (The n_outbuf code was added to hvc later). Some drivers need the aligned to long of that buffer and we dont' want to
grow the stack too much. ... but I digress. I won't hold
the driver up for that, but could you take a look?

Quoted 5 lines
drivers/tty/hvc/hvc_c6x.c new file +5 -0
+
+static int hvc_c6x_get_chars(uint32_t vt, char *buf, int count)
+{
+	return 0;
+}

drivers/tty/hvc/hvc_c6x.c line 114

Quoted 10 lines
drivers/tty/hvc/hvc_c6x.c new file +10 -0
+
+static const struct hv_ops hvc_c6x_get_put_ops = {
+	.get_chars = hvc_c6x_get_chars,
+	.put_chars = hvc_c6x_put_chars,
+};
+
+static int __init hvc_c6x_console_init(void)
+{
+	hvc_instantiate(0, 0, &hvc_c6x_get_put_ops);
+	add_preferred_console("hvc", 0, NULL);

This (calling add_preferred_console from the drivers console_initcall)
is bad if you ever get an alternative console. It seems convinient
until then.

drivers/tty/hvc/hvc_c6x.c line 122

Quoted 8 lines
drivers/tty/hvc/hvc_c6x.c new file +8 -0
+	return 0;
+}
+console_initcall(hvc_c6x_console_init);
+
+static int __init hvc_c6x_init(void)
+{
+	struct hvc_struct *s;
+	s = hvc_alloc(0, 0, &hvc_c6x_get_put_ops, 128);

So you tell the hvc layer you want upto 128 bytes at a time, but
your driver can handle MSGSIZE = 256 ? Why would you not request
MSGSIZE at a time?

drivers/tty/hvc/hvc_c6x.c line 125

Quoted 3 lines
drivers/tty/hvc/hvc_c6x.c new file +3 -0
+	return IS_ERR(s) ? PTR_ERR(s) : 0;
+}
+device_initcall(hvc_c6x_init);

milton

#28 lore raw
In reply to Milton Miller
Quoted 8 lines · Milton Miller
Quoted 6 lines · Mark Salter

This patch series adds support for a new architecture (arch/c6x) to Linux. This architecture supports members of the Texas Instruments family of C64x single and multicore DSPs. The multicore DSPs do not support cache coherancy, so are not suitable for SMP. Also, these are no-mmu processors. This core architecture is VLIW with an instruction set optimized for DSP applications. For details on the processors:

Quoted 4 lines

So all the changelogs talk about C64x but the arch and all the configs
are called c6x? Is it that hard to type 2 digits? Or do you expect
an additional chip that breaks the C64 but would fit the C6x name?

The full DSP family is C6000. The current port supports C64xx processors within that family. There are also C67xx processors with floating point support. Future support for those seem likely as the instruction set is nearly identical.

Quoted 6 lines

Also, a couple of one liners while preparing my comments on hvc_c6x:

[09/16] C6X: add kernel files

in kernel/setup.c you include linux/delay.h multiple times

Okay, I'll get rid of it.

Quoted 8 lines

[11/16] C6X: add lib files

arch/c6x/lib/memset.c

(1) file header says linux/arch/c6x/lib/memcmp.c
(you should probably just delete such headers, they are just maintence errors)

Agreed. I've been removing these as I find them. I need to sweep the whole code base and get rid of them all.

Quoted 9 lines

(2) it appears to mach lib/string.c implementation except (1) register (2)
uses post-increment instead of pre-increment. Does it matter with gcc?

arch/c6x/lib/memcmp.c
your version returns -1 or 1 while string.c returns the difference
after promotion to int. man page for userspace says just integer less
than or greater, so I guess this is ok. But is this more efficient, or could you use the generic version?

I'm pretty sure the generic versions would be just fine using gcc. There may have been a reason for them when using the TI toolchain, but it makes sense to just ditch the c6x versions at this point.

--Mark

#18 lore raw

Re: [04/16] add support for C64x+ debugger based console

In reply to Milton Miller
Quoted 133 lines · Milton Miller
Quoted 5 lines · Mark Salter

Texas Instruments debugger support for the C64X+ family of DSPs includes a console for the unit under test. This patch adds write-only console support to send kernel output to the debugger. It is safe to have this driver in place even if the system is not being run under the debugger.

Quoted 7 lines

---
drivers/tty/hvc/Makefile | 1 +

 drivers/tty/hvc/hvc_c6x.c |  125 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 126 insertions(+), 0 deletions(-)
 create mode 100644 drivers/tty/hvc/hvc_c6x.c

Hmm, no Kconfig? Oh, I see, you have a very minimal entry in
arch/c6x/Kconfig via "[07/16] C6X: add toplevel configury and makefile".

Except that is too minimal. It should give the user guidance like the changelog: it provides a hook for a that the debuger can set a breakpoint to know when to pick up the data, is safe when the debugger is not enabled, etc. Answer "why would a user want this?".

Also, I prefer it to be local with the driver and makefile even if it depends on your architecture. There is nothing processor architeture specific about this driver, even the asm is 2 nops and a label; so some other arch may want to reuse this driver.

Quoted 3 lines

+/*
+ * TI C6X Host Port hypervisor console
+ */

Nothing is really hypervisor, other than the name of the framework. More like debugger driver?

drivers/tty/hvc/hvc_c6x.c line 19

Quoted 3 lines
drivers/tty/hvc/hvc_c6x.c new file +3 -0
+
+#include <linux/console.h>
+#include <linux/delay.h>

Not sure you use anything from delay.h

Quoted 7 lines
drivers/tty/hvc/hvc_c6x.c new file +7 -0
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+
+#include "hvc_console.h"
+

drivers/tty/hvc/hvc_c6x.c line 36

Quoted 10 lines
drivers/tty/hvc/hvc_c6x.c new file +10 -0
+#define PARAMSIZE	8
+#define MSGSIZE		256
+
+#define CIO_READ	0xF2
+#define CIO_WRITE	0xF3
+
+#define CIO_STDIN	0
+#define CIO_STDOUT	1
+#define CIO_STDERR	2
+

So you probably have some method to read characters that could be added. No pressure, but that could be useful. Your raw transport also has multiple channels which could be used.

Quoted 53 lines
drivers/tty/hvc/hvc_c6x.c new file +53 -0
+struct c6x_msg {
+	unsigned int	length;
+	unsigned char	command;
+	unsigned char	params[PARAMSIZE];
+	unsigned char	msg[MSGSIZE];
+};
+
+union c6x_msgparam {
+	unsigned char	params[PARAMSIZE];
+	struct {
+		unsigned short fd;
+		unsigned short count;
+	} host_write;
+};
+
+/*
+ * __CIOBUF__ and C$$IO$$ are special symbols for debugger.
+ *
+ * If debugger is running kernel, it will set a breakpoint
+ * at C$$IO$$ which is hit when the kernel wants attention
+ * from the debugger. __CIOBUF__ is used to pass messages
+ * between debugger and kernel when the breakpoint is hit.
+ */
+struct c6x_msg _CIOBUF_;
+
+static noinline void notify_debugger(void)
+{
+	asm volatile (".global C$$IO$$\n"
+		      "nop\n"
+		      "C$$IO$$: nop\n");
+}
+
+static int hvc_c6x_put_chars(uint32_t vt, const char *buf, int count)
+{
+	union c6x_msgparam params;
+	int to_write, remaining;
+
+	remaining = count;
+	while (remaining > 0) {
+		to_write = (remaining > MSGSIZE) ? MSGSIZE : remaining;
+
+		_CIOBUF_.length = to_write;
+		_CIOBUF_.command = CIO_WRITE;
+
+		params.host_write.fd = cpu_to_le16(CIO_STDOUT);
+		params.host_write.count = cpu_to_le16(to_write);
+		memcpy(_CIOBUF_.params, &params, PARAMSIZE);
+
+		memcpy(_CIOBUF_.msg, buf, to_write);
+
+		notify_debugger();
+
+		remaining -= to_write;

drivers/tty/hvc/hvc_c6x.c line 99

Quoted 10 lines
drivers/tty/hvc/hvc_c6x.c new file +10 -0
+	}
+	return count;
+}
+
+#ifdef CONFIG_EARLY_PRINTK
+void hvc_c6x_early_puts(const char *buf, unsigned count)
+{
+	hvc_c6x_put_chars(0, buf, count);
+}
+#endif

Hmm, so you have

(1) early_printk only avail if CONFIG_EARLY_PRINTK (no #else nop), and this hook is protyped in include/early_printk under ifdef.

Quoted 6 lines

(2) arch/c6x/kernel/early_console.c implements a hook, with an explict ifdef for this driver to fill in the hook

So both files ifdef the config used to build the other file.

Do you have other hook implementations for your early_puts?

No. None of the currently supported boards have a simple UART :( Several of the boards do have i2c-uart bridges but we don't have code to support those outside of the normal i2c driver which is too late for early_printk.

Quoted 12 lines

(3) the effect of doing the above gets a console that gets called with upto 512 characters per buffer (which would require 2 messages, but you handle that), instead of the hvc_console N_OUTBUF = 16 per loop.

The hvc console is supposed to auto-register the console either when the hvc_console console_initcall is made or when some sub driver calls hvc_instantiate. While its not as clear as it used to be that calling it early is safe, I think it stll is.

Quoted 7 lines

I can see how the early-printk console could be about 16x faster; maybe we should create a static buffer for console output. Its always filled under the console locks and drained under the same call. (The n_outbuf code was added to hvc later). Some drivers need the aligned to long of that buffer and we dont' want to
grow the stack too much. ... but I digress. I won't hold
the driver up for that, but could you take a look?

Yes I will. This debugger console support was originally done using the tty interface directly but it was suggested to use the HVC framework to simplify it (which it did). But we did notice it seemed somewhat slower than the direct tty driver, so this could use some investigation.

Quoted 21 lines
Quoted 6 lines
drivers/tty/hvc/hvc_c6x.c new file +5 -0
+
+static int hvc_c6x_get_chars(uint32_t vt, char *buf, int count)
+{
+	return 0;
+}

drivers/tty/hvc/hvc_c6x.c line 114

Quoted 10 lines
drivers/tty/hvc/hvc_c6x.c new file +10 -0
+
+static const struct hv_ops hvc_c6x_get_put_ops = {
+	.get_chars = hvc_c6x_get_chars,
+	.put_chars = hvc_c6x_put_chars,
+};
+
+static int __init hvc_c6x_console_init(void)
+{
+	hvc_instantiate(0, 0, &hvc_c6x_get_put_ops);
+	add_preferred_console("hvc", 0, NULL);

This (calling add_preferred_console from the drivers console_initcall)
is bad if you ever get an alternative console. It seems convinient
until then.

Quoted 13 lines

drivers/tty/hvc/hvc_c6x.c line 122

Quoted 8 lines
drivers/tty/hvc/hvc_c6x.c new file +8 -0
+	return 0;
+}
+console_initcall(hvc_c6x_console_init);
+
+static int __init hvc_c6x_init(void)
+{
+	struct hvc_struct *s;
+	s = hvc_alloc(0, 0, &hvc_c6x_get_put_ops, 128);

So you tell the hvc layer you want upto 128 bytes at a time, but
your driver can handle MSGSIZE = 256 ? Why would you not request
MSGSIZE at a time?

We should. I just copied the above from hvc_tile.c without giving the 128 a lot of thought.

Thanks for the great guidance. I'll rework the patch with above comments in mind.

--Mark

#21 lore raw

Re: [PATCH 01/16] fix default __strnlen_user macro

In reply to Mark Salter

Hi!

Quoted 3 lines

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.

Are you sure? Having strnlen and _foo_strnlen with different return values seems very very dangerous.

Quoted 8 lines
include/asm-generic/uaccess.h +1 -1
@@ -289,7 +289,7 @@ 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
 
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#22 lore raw

Re: [PATCH 01/16] fix default __strnlen_user macro

Quoted 7 lines · Pavel Machek
Quoted 3 lines

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.

Are you sure? Having strnlen and _foo_strnlen with different return values seems very very dangerous.

Yes. I am sure based on comments and usage elsewhere in the kernel. That difference certainly through me off track as I tried to figure out why my kernels failed to mount roots when I switched to the generic uaccess.h.

--Mark

#20 lore raw

Re: [PATCH 03/16] add driver for C64x+ ethernet driver

In reply to Mark Salter

Please send network drivers to netdev for review.

I haven't looked at this thoroughly, but I noticed a few things:

Quoted 6 lines · Mark Salter

From: Aurelien Jacquiot <[email protected]>

This patch adds a network driver to support the ethernet interface found on several Texas Instruments C64X+ based System on Chips. In particular, this driver has been tested on the TMS320C6455, TMS320C6457, TMS320C6472, and TMS320C6474 parts.

[...]

Quoted 2 lines
drivers/net/c6x_gemac.c new file +0 -0

[...]

Quoted 16 lines
drivers/net/c6x_gemac.c new file +16 -0
+static int __init get_mac_addr_from_cmdline(char *str)
+{
+	const char *start = (const char *) str;
+	const char *end;
+	int count;
+
+	for (count = 0; count < 6; count++) {
+		config.enetaddr[count] = _hex_strtoul(start, &end);
+		if (end == start)
+			return 0;
+		if ((*end != ':') && (count != 5))
+			return 0;
+		start = end + 1;
+	}
+	return 1;
+}

drivers/net/c6x_gemac.c line 110

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+
+__setup("emac_addr=", get_mac_addr_from_cmdline);
+
+static int __init set_emac_shared(char *str)
+{
+	emac_shared = 1;
+	return 1;
+}
+
+__setup("emac_shared", set_emac_shared);

These parameters should be provided by platform data.

Quoted 17 lines
drivers/net/c6x_gemac.c new file +17 -0
+/*
+ * Get the device statistic
+ */
+static struct net_device_stats *emac_get_stats(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+	unsigned int reg;
+	unsigned int dummy;
+	int i;
+
+	emac_set_stat(dev->stats.multicast,	    EMAC_RXMCASTFRAMES);
+	emac_set_stat(dev->stats.collisions,	    EMAC_TXCOLLISION);
+	emac_set_stat(dev->stats.rx_length_errors,  EMAC_RXOVERSIZED);
+	emac_set_stat(dev->stats.rx_length_errors,  EMAC_RXUNDERSIZED);
+	emac_set_stat(dev->stats.rx_crc_errors,     EMAC_RXCRCERRORS);
+	emac_set_stat(dev->stats.rx_frame_errors,   EMAC_RXALIGNCODEERRORS);
+	emac_set_stat(dev->stats.tx_carrier_errors, EMAC_TXCARRIERSLOSS);

drivers/net/c6x_gemac.c line 138

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+	emac_set_stat(dev->stats.tx_fifo_errors,    EMAC_TXUNDERRUN);
+	emac_set_stat(dev->stats.tx_window_errors,  EMAC_TXLATECOLL);
+
+	/* ACK statistic by write-to-decrement */
+	reg = EMAC_RXGOODFRAMES;
+	for (i = 0; i < EMAC_NUM_STATREGS; i++) {
+		dummy = emac_get_reg(reg);
+		emac_set_reg(reg, dummy);
+		reg += 4;
+	}

This looks wrong. Surely you should be decrementing stats by the values that were read above, not the 'dummy' value read later.

Quoted 8 lines
drivers/net/c6x_gemac.c new file +8 -0
+	return &dev->stats;
+}
+
+/*
+ * Receive packets
+ */
+static int emac_rx(struct net_device *dev, struct emac_desc *desc_ack)
+{

[...]

drivers/net/c6x_gemac.c line 188

Quoted 3 lines
drivers/net/c6x_gemac.c new file +3 -0
+			/* Give back old sk_buff */
+			netif_rx(skb_old);
+			dev->last_rx = jiffies;

No need to set last_rx; the networking core does it.

drivers/net/c6x_gemac.c line 194

Quoted 5 lines
drivers/net/c6x_gemac.c new file +5 -0
+			/* Fill statistic */
+			dev->stats.rx_packets++;
+			dev->stats.rx_bytes += pkt_len;
+		} else {
+			printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name);

Should be rate-limited or controlled by message-level (see netif_info() and related macros in netdevice.h).

[...]

drivers/net/c6x_gemac.c line 304

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+static int emac_start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+	struct emac_private	  *ep =  netdev_priv(dev);
+	volatile struct emac_desc *desc;
+	volatile struct emac_desc *prev_desc = NULL;
+	ushort pkt_len = skb->len;
+	unsigned long flags;
+
+	if (ep->tx_full) {
+		printk(KERN_WARNING "%s: tx queue full\n", dev->name);

Definitely don't log this by default.

drivers/net/c6x_gemac.c line 305

Quoted 1 line
drivers/net/c6x_gemac.c new file +1 -0
+		dev->stats.tx_dropped++;

No, the packet is not dropped in this case.

drivers/net/c6x_gemac.c line 312

Quoted 7 lines
drivers/net/c6x_gemac.c new file +7 -0
+		return NETDEV_TX_BUSY;
+	}
+
+	/* Pad short frame */
+	if (unlikely(pkt_len < ETH_ZLEN)) {
+		if (skb_padto(skb, ETH_ZLEN)) {
+			netif_wake_queue(dev);

The queue is already awake!

And in this case you *are* dropping the packet, so you could increment tx_dropped.

Quoted 4 lines
drivers/net/c6x_gemac.c new file +4 -0
+			return NETDEV_TX_OK;
+		}
+		pkt_len = ETH_ZLEN;
+	}

[...]

Quoted 6 lines
drivers/net/c6x_gemac.c new file +6 -0
+static void emac_handle_host_interrupt(struct net_device *dev)
+{
+	struct emac_private *ep = netdev_priv(dev);
+	unsigned long	     status;
+
+	/* Handle host error */

drivers/net/c6x_gemac.c line 405

Quoted 10 lines
drivers/net/c6x_gemac.c new file +10 -0
+	status = emac_get_reg(EMAC_MACSTATUS);
+
+	/* Check if the problem occurs on our channel when we are slave */
+	if ((ep->slave)
+	    && (((status & EMAC_M_RXERRCH) >> EMAC_S_RXERRCH) != IDX_TO_CHAN(emac_idx))
+	    && (((status & EMAC_M_TXERRCH) >> EMAC_S_TXERRCH) != IDX_TO_CHAN(emac_idx)))
+		return;
+
+	if ((status & EMAC_M_RXERRCODE) == (EMAC_V_OWNERSHIP <<  EMAC_S_RXERRCODE)) {
+		printk(KERN_ERR "%s: EMAC rx ring full\n", dev->name);

Should be rate-limited or controlled by message-level.

Quoted 15 lines
drivers/net/c6x_gemac.c new file +15 -0
+		dev->stats.rx_fifo_errors++;
+	} else
+		printk(KERN_ERR "%s: EMAC fatal host error 0x%lx\n",
+		       dev->name, status);
+
+	DPRINTK(KERN_ERR "%s: Error head=%p desc=%p dirty=%p skb_tx_dirty=%ld count=%ld\n",
+		dev->name, ep->head_tx, ep->cur_tx,
+		ep->dirty_tx, ep->skb_tx_dirty, ep->count_tx);
+
+	if (!ep->slave) {
+		/* Reconfigure the device */
+		ep->fatal_error = 1;
+		emac_reconfigure_device(dev);
+	}
+}

[...]

Quoted 1 line

+#ifdef EMAC_HAS_ALE_SUPPORT

[...]

Quoted 1 line

+static void emac_set_rx_mode(struct net_device *dev)

[...]

drivers/net/c6x_gemac.c line 1132

Quoted 3 lines
drivers/net/c6x_gemac.c new file +3 -0
+		/* Set mcast from a list */
+		for (i = 0; i < dev->mc_count; i++, dmi = dmi->next) {
+			u8 *p_dmi = dmi->dmi_addr;

This is the old multicast list format; the code won't even compile now.

It needs to be updated like the !EMAC_HAS_ALE_SUPPORT version has been.

[...]

drivers/net/c6x_gemac.c line 1322

Quoted 7 lines
drivers/net/c6x_gemac.c new file +7 -0
+#ifdef EMAC_TIMER_TICK_MDIO
+/*
+ * This function should be called for each device in the system on a
+ * periodic basis of 100mS (10 times a second). It is used to check the
+ * status of the EMAC and MDIO device.
+ */
+static void emac_timer_tick(unsigned long data)

That seems excessive! It might be worth checking whether this takes significant CPU time, and increasing the period when all links are in a steady state.

[...]

drivers/net/c6x_gemac.c line 1393

Quoted 2 lines
drivers/net/c6x_gemac.c new file +2 -0
+static const struct ethtool_ops gemac_ethtool_ops = {
+};

We (that is, netdev regulars) should make more of the default ethtool operations work without dev->ethtool_ops set, so you don't have to do this!

[...]

drivers/net/c6x_gemac.c line 1480

Quoted 5 lines
drivers/net/c6x_gemac.c new file +5 -0
+#ifdef EMAC_ARCH_HAS_MAC_ADDR
+	/* SoC or board hw has MAC address */
+	if (config.enetaddr[0] == 0 && config.enetaddr[1] == 0 &&
+	    config.enetaddr[2] == 0 && config.enetaddr[3] == 0 &&
+	    config.enetaddr[4] == 0 && config.enetaddr[5] == 0) {

[...]

is_zero_ether_addr(config.enetaddr)

Ben.

Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
maintainer
#29 lore raw
In reply to Mark Salter
Quoted 6 lines · On Wednesday 11 May 2011 22:13:47 Mark Salter wrote:

and the GIT tree holding the attached patches is at:

[email protected]:/git/projects/linux-c6x-upstreaming.git

TIA for any feedback and/or guidance on this port.

I've taken a very brief look at the repository. These are the things that stood out at first, in no particular order:

- You need to reduce the size of the defconfig files using 'make gendefconfig'

- arch/c6x/drivers/ should not exist, just move the drivers into the respective driver hierarchy (drivers/gpio, ...)

- Do not register static platform devices, they are deprecated. For devices that are always there, use platform_device_create_simple. For devices that depend on the specific SoC, use a flattened device tree to describe the hierarchy of devices.

- Replace your board files with device tree files written in DTS language as on powerpc, microblaze, etc. Hardcoding board stuff in the kernel is not the way to go for new architectures, as we are migrating the existing ones away from that.

- The CIO console driver should be coverted to use hvc_console.

- Any header file that only includes the asm-generic version can now use generic infrastructure to generate the header, so you can remove these files.

- arch/c6x/lib/misc.c appears to be misplaced. Why would you define abort(), exit() and alloca()? Leftover from the proprietary compiler?

- Do you really need a.out.h?

- your asm/atomic.h and asm/bitops.h look like they should use the generic version.

- struct clk support is currently undergoing a rewrite, you should use the new version once it shows up. If it doesn't work for you, complain now so we can fix it before it gets merged.

- I would guess that you don't support ISA dma, so don't try to use asm/dma.h.

- gemac.h and gmdio.h should probably live in the same directory as the driver using them, not in asm/.

- You are rather inconsistent using MMIO pointer access. You should always use proper accessors like readl/writel, and use sparse to check that all mmio pointers are marked as __iomem. Check all uses of 'volatile' in the code, most of them are wrong and should be '__iomem' instead. See Documentation/volatile-considered-harmful.txt

- Fix your readl/writel implementations to do the correct casts from __iomem pointers.

- Do not use __raw_readl/__raw_writel.

- Remove your IO_ADDRESS(), __REG, VULP, __SYSREG and __SYSREGA. Replace them with proper use of ioremap().

- Your inb/outb implementations are completely wrong. If you don't support PCI, best just replace them with BUG(). Set IO_SPACE_LIMIT to zero to enforce that no driver uses them.

- Go through your machdep.h and make sure that all pointers are actually used, e.g. mach_floppy_eject /sounds/ like you wouldn't need it in 2011.

- You have an asm/pci.h but no host implementation. Why is that?

- Why do you have both pll.h and clk.h? Don't they do the same thing?

- Use the common asm-generic/unistd.h instead of your own! A significant number of the syscalls you define are not needed at all. This will also simplify merging into glibc.

- Rewrite your ptrace.c to use regsets and the common infrastructure from kernel/ptrace.c.

- I recommend to split your device drivers into separate git branches in your repository, to make it easier to see what is coming up, and to allow merging branches at a time. Not required, but it will make your life easier.

That's all from me for now. When we have resolved these issues, the next step would be to create a multi-patch series (e.g. ~20 patches for arch/c6x/*) split into one patch per topic, and review them on the linux-arch and linux-kernel mailing lists.

Arnd

#30 lore raw
Quoted 2 lines · Arnd Bergmann

- Do not register static platform devices, they are deprecated. For devices that are always there, use platform_device_create_simple.

platform_device_register_simple.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds

#31 lore raw
In reply to Arnd Bergmann
Quoted 4 lines · Arnd Bergmann

- Do not use __raw_readl/__raw_writel.

- Remove your IO_ADDRESS(), __REG, VULP, __SYSREG and __SYSREGA. Replace them with proper use of ioremap().

If not __raw_readl/__raw_writel, what is the best way to access memory mapped device registers on a bus that does the endian conversion in hardware? I still need the endian conversion for devices on PCI bus.

--Mark

maintainer
#32 lore raw
Quoted 9 lines · Mark Salter
Quoted 4 lines · Arnd Bergmann

- Do not use __raw_readl/__raw_writel.

- Remove your IO_ADDRESS(), __REG, VULP, __SYSREG and __SYSREGA. Replace them with proper use of ioremap().

If not __raw_readl/__raw_writel, what is the best way to access memory mapped device registers on a bus that does the endian conversion in hardware? I still need the endian conversion for devices on PCI bus.

The best option is to define a bus specific set of accessors that you can use in the device drivers for that bus and that have well-defined semantics regarding ordering and endianess.

Typically what happens is that at some point some hardware developer decides to reuse a piece of logic with the opposite endianess (e.g. when the same logic is connected to multiple CPUs), so better define the endianess of the bus independent of the CPU and have a separate Kconfig option for that.

Arnd