[U-Boot] [PATCH v3 2/4] c6x: Add support c674x CPUs

Dmitry Bondar
2012-06-25T18:02:39Z

C6X has subfamilys: C62x C64x C66x C67x C645x C674x.
This patch add support of subfamily C674x (C6745/C6746/C6747 CPUs).

Signed-off-by: Dmitry Bondar <bond@inmys.ru>
Cc: Tom Rini <trini@ti.com>
---
arch/c6x/cpu/c674x/Makefile | 30 ++++++++++++++++
arch/c6x/cpu/c674x/cache.c | 17 +++++++++
arch/c6x/cpu/c674x/config.mk | 14 ++++++++
arch/c6x/cpu/c674x/start.S | 22 ++++++++++++
arch/c6x/cpu/u-boot.lds | 76 ++++++++++++++++++++++++++++++++++++++++++
5 files changed, 159 insertions(+), 0 deletions(-)
create mode 100644 arch/c6x/cpu/c674x/Makefile
create mode 100644 arch/c6x/cpu/c674x/cache.c
create mode 100644 arch/c6x/cpu/c674x/config.mk
create mode 100644 arch/c6x/cpu/c674x/start.S
create mode 100644 arch/c6x/cpu/u-boot.lds

diff --git a/arch/c6x/cpu/c674x/Makefile b/arch/c6x/cpu/c674x/Makefile
new file mode 100644
index 0000000..bfe0db6
--- /dev/null
+++ b/arch/c6x/cpu/c674x/Makefile
@@ -0,0 +1,30 @@
+# (C) Copyright 2012 Dmitry Bondar <bond@inmys.ru>
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+
+
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)lib$(CPU).o
+
+START = start.o
+COBJS = cache.o
+
+SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))
+START := $(addprefix $(obj),$(START))
+
+all: $(obj).depend $(START) $(LIB)
+
+$(LIB): $(OBJS)
+ $(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/arch/c6x/cpu/c674x/cache.c b/arch/c6x/cpu/c674x/cache.c
new file mode 100644
index 0000000..e2d6866
--- /dev/null
+++ b/arch/c6x/cpu/c674x/cache.c
@@ -0,0 +1,17 @@
+/* (C) Copyright 2012 Dmitry Bondar <bond@inmys.ru>
+ *
+ * This file is released under the terms of GPL v2 and any later version.
+ * See the file COPYING in the root directory of the source tree for details.
+*/
+
+void flush_cache(unsigned long addr, unsigned long len)
+{
+}
+
+void flush_dcache_range(unsigned long start, unsigned long stop)
+{
+}
+
+void invalidate_dcache_range(unsigned long start, unsigned long stop)
+{
+}
diff --git a/arch/c6x/cpu/c674x/config.mk b/arch/c6x/cpu/c674x/config.mk
new file mode 100644
index 0000000..8ee1325
--- /dev/null
+++ b/arch/c6x/cpu/c674x/config.mk
@@ -0,0 +1,14 @@
+# (C) Copyright 2012 Dmitry Bondar <bond@inmys.ru>
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+
+PLATFORM_RELFLAGS += -fno-common -ffixed-B31
+
+PLATFORM_CPPFLAGS += -march=c674x -msdata=none -mno-dsbt -DCONFIG_TMS320C64XPLUS
+# =========================================================================
+#
+# Supply options according to compiler version
+#
+# =========================================================================
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
diff --git a/arch/c6x/cpu/c674x/start.S b/arch/c6x/cpu/c674x/start.S
new file mode 100644
index 0000000..c144978
--- /dev/null
+++ b/arch/c6x/cpu/c674x/start.S
@@ -0,0 +1,22 @@
+; (C) Copyright 2012 Dmitry Bondar <bond@inmys.ru>
+;
+; This file is released under the terms of GPL v2 and any later version.
+; See the file COPYING in the root directory of the source tree for details.
+
+#include <config.h>
+#include <asm-offsets.h>
+
+ .global _start
+_start:
+ ;; Jump to u-boot
+ MVKL .S2 CONFIG_SYS_INIT_SP_ADDR,B15
+ MVKH .S2 CONFIG_SYS_INIT_SP_ADDR,B15
+ MVKL .S1 board_init_f,A0
+ MVKH .S1 board_init_f,A0
+ B .S2X A0
+ MVKL .S2 L1,B3
+ MVKH .S2 L1,B3
+ NOP 3
+L1: B .S2 B3
+ NOP 5
+
diff --git a/arch/c6x/cpu/u-boot.lds b/arch/c6x/cpu/u-boot.lds
new file mode 100644
index 0000000..a6d7c82
--- /dev/null
+++ b/arch/c6x/cpu/u-boot.lds
@@ -0,0 +1,76 @@
+/*
+ * (C) Copyright 2002-2004
+ * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
+ *
+ * (C) Copyright 2012 Dmitry Bondar <bond@inmys.ru>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+/*OUTPUT_FORMAT("elf32-littlec6x", "elf32-littlec6x", "elf32-littlec6x")*/
+/*OUTPUT_ARCH(c6x)*/
+ENTRY(_start)
+SECTIONS
+{
+ . = ALIGN(4);
+ .text :
+ {
+ CPUDIR/start.o (.text)
+ *(.text)
+ }
+
+ . = ALIGN(4);
+ .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
+
+ . = ALIGN(4);
+ .data : {
+ *(.data)
+ }
+ . = ALIGN(4);
+ .fardata : {
+ *(.data)
+ }
+ . = ALIGN(4);
+ .const : {
+ *(.const)
+ }
+
+ . = ALIGN(4);
+
+ . = .;
+ __u_boot_cmd_start = .;
+ .u_boot_cmd : { *(.u_boot_cmd) }
+ __u_boot_cmd_end = .;
+
+ . = ALIGN(4);
+
+ _end = .;
+
+ __bss_start = .;
+ . = ALIGN(32);
+ .far : { *(.far) }
+ . = ALIGN(32);
+ __bss_end__ = .;
+
+ /DISCARD/ : { *(.dynstr*) }
+ /DISCARD/ : { *(.dynamic*) }
+ /DISCARD/ : { *(.plt*) }
+ /DISCARD/ : { *(.interp*) }
+ /DISCARD/ : { *(.gnu*) }
+}
--
1.7.2.5