Skip to contentSkip to conversation

nds32: add header files support for nds32

PATCH Superseded Macpaul Lin 6 participants 146 messages Apr 7, 2011 – Oct 22, 2011 1 message not in the archive Page 2 of 2

Subsystems (4)
lore
Share & tools
lore
#109 lore raw

PATCH v17 2/9 nds32: add NDS32 support into common header file

In reply to Macpaul Lin

Dear Macpaul Lin,

Quoted 13 lines · In message <[email protected]> you wrote:

Add NDS32 support into common header file.

---
Changes for v1-v7:
- No change
Changes for v8:
- Fix the patch according to dependency of x86's Fix
Changes for v9-v16:
- No change
Changes for v17:
- Fix for arch Sandbox has been committed.

Quoted 2 lines
 include/common.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Tactical? TACTICAL!?!? Hey, buddy, we went from kilotons to  megatons
several  minutes  ago.  We don't need no stinkin' tactical nukes. (By
the way, do you have change for 10 million people?)           - lwall
#110 lore raw

PATCH v17 3/9 nds32/core N1213: NDS32 N12 core family N1213

In reply to Wolfgang Denk

Add N1213 cpu core (N12 Core family) support for NDS32 arch. This patch includes start.S for the initialize procedure of N1213.

Start procedure:
start.S will start up the N1213 CPU core at first, then jump to SoC dependent "lowlevel_init.S" and "watchdog.S" to configure peripheral devices.

---
Changes for v1 to v6:
- Style clean up and reorganize code
Changes for v7-v9:
- No Change.
Changes for v10:
- start.S of N1213 CPU has been rewrote for relocation support.
- u-boot.lds:
- Add got and *(.got.plt) section for support GCC 4 toolchain
- Modified for relocation implementation.
Changes for v11:
- arch/nds32/cpu/n1213/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes for v12:
- u-boot.lds
- Remove the 0x00000000 base address in linker script.
The base address of the binary will be determined by CONFIG_SYS_TEXT_BASE
- Remove the CPU features in commit log and add to README in later patches.
Changes for v13-v14:
- No change.
Changes for v15:
- start.S: fix exception vector aligment (add setivb in reset vector).
Changes for v16:
- start.S: remove lines over 80 characters.
Changes for v17:
- Fix a space ident warning which checkpatch doesn't found.

 arch/nds32/cpu/n1213/Makefile   |   50 ++++
 arch/nds32/cpu/n1213/start.S    |  529 +++++++++++++++++++++++++++++++++++++++
 arch/nds32/cpu/n1213/u-boot.lds |   70 +++++
 3 files changed, 649 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/cpu/n1213/Makefile
 create mode 100644 arch/nds32/cpu/n1213/start.S
 create mode 100644 arch/nds32/cpu/n1213/u-boot.lds
arch/nds32/cpu/n1213/Makefile new file +50 -0
new file mode 100644
index 0000000..da15574
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# Copyright (C) 2011 Andes Technology Corporation
+# Shawn Lin, Andes Technology Corporation <[email protected]>
+# Macpaul Lin, Andes Technology Corporation <[email protected]>
+#
+# 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(CPU).o
+
+START	= start.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
+
+#########################################################################
arch/nds32/cpu/n1213/start.S new file +529 -0

529 lines not on this page · raw message

arch/nds32/cpu/n1213/u-boot.lds new file +70 -0

70 lines not on this page · raw message

Signature · 1 line
1.7.3.5
#111 lore raw

PATCH v17 3/9 nds32/core N1213: NDS32 N12 core family N1213

Dear Macpaul Lin,

Quoted 37 lines · In message <[email protected]> you wrote:

Add N1213 cpu core (N12 Core family) support for NDS32 arch. This patch includes start.S for the initialize procedure of N1213.

Start procedure:
start.S will start up the N1213 CPU core at first, then jump to SoC dependent "lowlevel_init.S" and "watchdog.S" to configure peripheral devices.

---
Changes for v1 to v6:
- Style clean up and reorganize code
Changes for v7-v9:
- No Change.
Changes for v10:
- start.S of N1213 CPU has been rewrote for relocation support.
- u-boot.lds:
- Add got and *(.got.plt) section for support GCC 4 toolchain
- Modified for relocation implementation.
Changes for v11:
- arch/nds32/cpu/n1213/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes for v12:
- u-boot.lds
- Remove the 0x00000000 base address in linker script.
The base address of the binary will be determined by CONFIG_SYS_TEXT_BASE
- Remove the CPU features in commit log and add to README in later patches.
Changes for v13-v14:
- No change.
Changes for v15:
- start.S: fix exception vector aligment (add setivb in reset vector).
Changes for v16:
- start.S: remove lines over 80 characters.
Changes for v17:
- Fix a space ident warning which checkpatch doesn't found.

Quoted 7 lines
 arch/nds32/cpu/n1213/Makefile   |   50 ++++
 arch/nds32/cpu/n1213/start.S    |  529 +++++++++++++++++++++++++++++++++++++++
 arch/nds32/cpu/n1213/u-boot.lds |   70 +++++
 3 files changed, 649 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/cpu/n1213/Makefile
 create mode 100644 arch/nds32/cpu/n1213/start.S
 create mode 100644 arch/nds32/cpu/n1213/u-boot.lds

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
All he had was nothing, but that was something, and now it  had  been
taken away.                             - Terry Pratchett, _Sourcery_
#112 lore raw

PATCH v17 4/9 nds32/ag101: cpu and init funcs of SoC ag101

In reply to Wolfgang Denk

SoC ag101 is the first chip using NDS32 N1213 cpu core. Add header file of device offset support for SoC ag101. Add main function of SoC ag101 based on NDS32 n1213 core. Add lowlevel_init.S and other periphal related code.

This version of lowlevel_init.S also replace hardcode value by MARCO defines from the GPL version andesboot for better code quality.

---
Changes for v1-v4:
- Code clean up.
Changes for v5-v6:
- Split watchdog.S from lowlevel_init.S.
- Fix hardware reset by using watchdog reset in do_reset() in cpu.c.
- reset_cpu was remove inside do_reset().
- lowlevel_init.S
- Change hard code value into MARCO definitions.
- ftsmc010
- Fix FTSMC020_TPR_AT2 from 1 to 3 (0xff3ff)
- ftsdmc021
- Fix hardcoded address of CR1, CR2, TR1, TR2, BANK0 registers.
- Fix the default configuration value of FTSDMC and FTSMC controller.
- Remove some ftpmu010 and flash probe code to C functions.
Changes for v7:
- clean up.
Changes for v8-v9:
- No change.
Changes for v10:
- asm-offset.c: file added for ag101 use only.
- ag101/Makefile: add gen-asm-offset support to ag101 for lowlevel_init.S.
- Makefile: add gen-asm-offset support for NDS32 based core and SoCs.
- cpu.c: remove unused cpu_init().
- lowlevel_init.S
- Introduce SoC specific gen-asm-offset.h to lowlevel_init.S
- Replace routings by macros to made code much easier to understand.
- Add debug LED support.
- Add CONFIG_MEM_REMAP for those boards must do memort remapping.
Changes for v11:
- arch/nds32/cpu/n1213/ag101/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes for v12:
- Simplify the commit log about the part of lowlevel_init.S.
Changes for v13:
- arch/nds32/cpu/n1213/ag101/Makefile: remove unused gen-asm-offset.
- Makefile: remove unused gen-asm-offset because merged asm-offsets.
Changes for v14:
- lowlevel_init.S: fix include path of <generated/asm-offsets.h>
Changes for v15:
- fix sleep delay.
Changes for v16:
- arch/nds32/include/asm/arch-ag101/ag101.h: fix lines over 80 characters
- arch/nds32/cpu/n1213/ag101/lowlevel_init.S: fix lines over 80 characters
- arch/nds32/cpu/n1213/ag101/timer.c: fix line over 80 characters
Changes for v17:
- No changes.

 arch/nds32/cpu/n1213/ag101/Makefile        |   58 +++++++
 arch/nds32/cpu/n1213/ag101/asm-offsets.c   |   43 +++++
 arch/nds32/cpu/n1213/ag101/cpu.c           |  200 +++++++++++++++++++++++
 arch/nds32/cpu/n1213/ag101/lowlevel_init.S |  238 ++++++++++++++++++++++++++++
 arch/nds32/cpu/n1213/ag101/timer.c         |  205 ++++++++++++++++++++++++
 arch/nds32/cpu/n1213/ag101/watchdog.S      |   48 ++++++
 arch/nds32/include/asm/arch-ag101/ag101.h  |  103 ++++++++++++
 7 files changed, 895 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/cpu/n1213/ag101/Makefile
 create mode 100644 arch/nds32/cpu/n1213/ag101/asm-offsets.c
 create mode 100644 arch/nds32/cpu/n1213/ag101/cpu.c
 create mode 100644 arch/nds32/cpu/n1213/ag101/lowlevel_init.S
 create mode 100644 arch/nds32/cpu/n1213/ag101/timer.c
 create mode 100644 arch/nds32/cpu/n1213/ag101/watchdog.S
 create mode 100644 arch/nds32/include/asm/arch-ag101/ag101.h
arch/nds32/cpu/n1213/ag101/Makefile new file +58 -0
new file mode 100644
index 0000000..8716c4e
@@ -0,0 +1,58 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Written-by: Prafulla Wadaskar <[email protected]>
+#
+# Copyright (C) 2011 Andes Technology Corporation
+# Shawn Lin, Andes Technology Corporation <[email protected]>
+# Macpaul Lin, Andes Technology Corporation <[email protected]>
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(SOC).o
+
+COBJS-y	:= cpu.o timer.o
+
+ifndef CONFIG_SKIP_LOWLEVEL_INIT
+SOBJS	:= lowlevel_init.o
+endif
+
+ifndef CONFIG_SKIP_TRUNOFF_WATCHDOG
+SOBJS	+= watchdog.o
+endif
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+
+all:	$(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
arch/nds32/cpu/n1213/ag101/asm-offsets.c new file +43 -0

43 lines not on this page · raw message

arch/nds32/cpu/n1213/ag101/cpu.c new file +200 -0

200 lines not on this page · raw message

arch/nds32/cpu/n1213/ag101/lowlevel_init.S new file +238 -0

238 lines not on this page · raw message

arch/nds32/cpu/n1213/ag101/timer.c new file +205 -0

205 lines not on this page · raw message

arch/nds32/cpu/n1213/ag101/watchdog.S new file +48 -0

48 lines not on this page · raw message

arch/nds32/include/asm/arch-ag101/ag101.h new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
1.7.3.5
#113 lore raw

PATCH v17 4/9 nds32/ag101: cpu and init funcs of SoC ag101

Dear Macpaul Lin,

Quoted 58 lines · In message <[email protected]> you wrote:

SoC ag101 is the first chip using NDS32 N1213 cpu core. Add header file of device offset support for SoC ag101. Add main function of SoC ag101 based on NDS32 n1213 core. Add lowlevel_init.S and other periphal related code.

This version of lowlevel_init.S also replace hardcode value by MARCO defines from the GPL version andesboot for better code quality.

---
Changes for v1-v4:
- Code clean up.
Changes for v5-v6:
- Split watchdog.S from lowlevel_init.S.
- Fix hardware reset by using watchdog reset in do_reset() in cpu.c.
- reset_cpu was remove inside do_reset().
- lowlevel_init.S
- Change hard code value into MARCO definitions.
- ftsmc010
- Fix FTSMC020_TPR_AT2 from 1 to 3 (0xff3ff)
- ftsdmc021
- Fix hardcoded address of CR1, CR2, TR1, TR2, BANK0 registers.
- Fix the default configuration value of FTSDMC and FTSMC controller.
- Remove some ftpmu010 and flash probe code to C functions.
Changes for v7:
- clean up.
Changes for v8-v9:
- No change.
Changes for v10:
- asm-offset.c: file added for ag101 use only.
- ag101/Makefile: add gen-asm-offset support to ag101 for lowlevel_init.S.
- Makefile: add gen-asm-offset support for NDS32 based core and SoCs.
- cpu.c: remove unused cpu_init().
- lowlevel_init.S
- Introduce SoC specific gen-asm-offset.h to lowlevel_init.S
- Replace routings by macros to made code much easier to understand.
- Add debug LED support.
- Add CONFIG_MEM_REMAP for those boards must do memort remapping.
Changes for v11:
- arch/nds32/cpu/n1213/ag101/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes for v12:
- Simplify the commit log about the part of lowlevel_init.S.
Changes for v13:
- arch/nds32/cpu/n1213/ag101/Makefile: remove unused gen-asm-offset.
- Makefile: remove unused gen-asm-offset because merged asm-offsets.
Changes for v14:
- lowlevel_init.S: fix include path of <generated/asm-offsets.h>
Changes for v15:
- fix sleep delay.
Changes for v16:
- arch/nds32/include/asm/arch-ag101/ag101.h: fix lines over 80 characters
- arch/nds32/cpu/n1213/ag101/lowlevel_init.S: fix lines over 80 characters
- arch/nds32/cpu/n1213/ag101/timer.c: fix line over 80 characters
Changes for v17:
- No changes.

Quoted 15 lines
 arch/nds32/cpu/n1213/ag101/Makefile        |   58 +++++++
 arch/nds32/cpu/n1213/ag101/asm-offsets.c   |   43 +++++
 arch/nds32/cpu/n1213/ag101/cpu.c           |  200 +++++++++++++++++++++++
 arch/nds32/cpu/n1213/ag101/lowlevel_init.S |  238 ++++++++++++++++++++++++++++
 arch/nds32/cpu/n1213/ag101/timer.c         |  205 ++++++++++++++++++++++++
 arch/nds32/cpu/n1213/ag101/watchdog.S      |   48 ++++++
 arch/nds32/include/asm/arch-ag101/ag101.h  |  103 ++++++++++++
 7 files changed, 895 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/cpu/n1213/ag101/Makefile
 create mode 100644 arch/nds32/cpu/n1213/ag101/asm-offsets.c
 create mode 100644 arch/nds32/cpu/n1213/ag101/cpu.c
 create mode 100644 arch/nds32/cpu/n1213/ag101/lowlevel_init.S
 create mode 100644 arch/nds32/cpu/n1213/ag101/timer.c
 create mode 100644 arch/nds32/cpu/n1213/ag101/watchdog.S
 create mode 100644 arch/nds32/include/asm/arch-ag101/ag101.h

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I didn't know it was impossible when I did it."
#114 lore raw

PATCH v17 5/9 nds32/lib: add generic funcs in NDS32 lib

In reply to Wolfgang Denk

Add Makefile, board.c, interrupts.c and bootm.c functions to nds32 architecture.

---
Changes for v1-v4:
- code clean up and formatting style.
Changes for v5-v6:
- board.c
- Do some clean up and add code
- Remove display banner which hasn't support.
- Add ftpmu010 related power management unit code.
- Remove useless LED related code.
- Move SDRAM init to board sepecific files. (ex. adp-ag101.c)
- Remove CONFIG_SOFT_I2C which hasn't been support.
- Remove CONFIG_FSL_ESDHC which hasn't been support.
- clean up.
Changes for v7:
- clean up.
- move single file patch arch/nds32/config.mk to this commit.
- interrupts.c refine origin interrupt enable and disable.
Changes for v8:
- interrups.c: fix up for new ptraces.h.
Changes for v9:
- support CONFIG_STANDALONE_LOAD_ADDR in config.mk
Changes for v10:
- config.mk:
- add -fpie flag.
- replace -ffixed-8 to -ffixed-10.
- add -mrelax and --gc-sections to LDFLAG
- board.c:
- fix lib/board.c for relocation.
- fix dram init for relocation.
Changes for v11:
- arch/nds32/lib/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes for v12:
- config.mk
- remove $(SRCTREE)/$(CPUDIR)/u-boot.lds
- board.c:
- remove obsolelte version_string.
- remove declaration "extern __bss_end" which is not need.
- replace sizeof(gd_t) and sizeof(bd_t) to GENERATED_GBL_DATA_SIZE and GENERATED_BD_INFO_SIZE
- add memset to board info (bd)
- remove compiler optimization barrier which is not need.
Changes for v13:
- board.c: remove unused CONFIG_IDENT_STRING.
- arch/nds32/lib/Makefile: remove unused clean and distclean.
Changes for v14:
- No change.
Changes for v15:
- lib/board.c:
- remove duplicate pci init
- drop NET_MULTI
Changes for v16-v17:
- No changes.

 arch/nds32/config.mk        |   35 ++++
 arch/nds32/lib/Makefile     |   46 +++++
 arch/nds32/lib/board.c      |  439 +++++++++++++++++++++++++++++++++++++++++++
 arch/nds32/lib/bootm.c      |  241 ++++++++++++++++++++++++
 arch/nds32/lib/interrupts.c |  129 +++++++++++++
 5 files changed, 890 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/config.mk
 create mode 100644 arch/nds32/lib/Makefile
 create mode 100644 arch/nds32/lib/board.c
 create mode 100644 arch/nds32/lib/bootm.c
 create mode 100644 arch/nds32/lib/interrupts.c
arch/nds32/config.mk new file +35 -0
new file mode 100644
index 0000000..c589829
@@ -0,0 +1,35 @@
+#
+# (C) Copyright 2000-2002
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2011
+# Shawn Lin, Andes Technology Corporation <[email protected]>
+# Macpaul Lin, Andes Technology Corporation <[email protected]>
+#
+# 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
+
+CROSS_COMPILE ?= nds32le-linux-
+
+CONFIG_STANDALONE_LOAD_ADDR = 0x300000 -T nds32.lds
+
+PLATFORM_RELFLAGS	+= -fno-strict-aliasing -fno-common -mrelax
+PLATFORM_RELFLAGS	+= -gdwarf-2
+PLATFORM_CPPFLAGS	+= -DCONFIG_NDS32 -D__nds32__ -G0 -ffixed-10 -fpie
+
+LDFLAGS_u-boot		= --gc-sections --relax
arch/nds32/lib/Makefile new file +46 -0

46 lines not on this page · raw message

arch/nds32/lib/board.c new file +439 -0

439 lines not on this page · raw message

arch/nds32/lib/bootm.c new file +241 -0

241 lines not on this page · raw message

arch/nds32/lib/interrupts.c new file +129 -0

129 lines not on this page · raw message

Signature · 1 line
1.7.3.5
#115 lore raw

PATCH v17 5/9 nds32/lib: add generic funcs in NDS32 lib

Dear Macpaul Lin,

Quoted 58 lines · In message <[email protected]> you wrote:

Add Makefile, board.c, interrupts.c and bootm.c functions to nds32 architecture.

---
Changes for v1-v4:
- code clean up and formatting style.
Changes for v5-v6:
- board.c
- Do some clean up and add code
- Remove display banner which hasn't support.
- Add ftpmu010 related power management unit code.
- Remove useless LED related code.
- Move SDRAM init to board sepecific files. (ex. adp-ag101.c)
- Remove CONFIG_SOFT_I2C which hasn't been support.
- Remove CONFIG_FSL_ESDHC which hasn't been support.
- clean up.
Changes for v7:
- clean up.
- move single file patch arch/nds32/config.mk to this commit.
- interrupts.c refine origin interrupt enable and disable.
Changes for v8:
- interrups.c: fix up for new ptraces.h.
Changes for v9:
- support CONFIG_STANDALONE_LOAD_ADDR in config.mk
Changes for v10:
- config.mk:
- add -fpie flag.
- replace -ffixed-8 to -ffixed-10.
- add -mrelax and --gc-sections to LDFLAG
- board.c:
- fix lib/board.c for relocation.
- fix dram init for relocation.
Changes for v11:
- arch/nds32/lib/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes for v12:
- config.mk
- remove $(SRCTREE)/$(CPUDIR)/u-boot.lds
- board.c:
- remove obsolelte version_string.
- remove declaration "extern __bss_end" which is not need.
- replace sizeof(gd_t) and sizeof(bd_t) to GENERATED_GBL_DATA_SIZE and GENERATED_BD_INFO_SIZE
- add memset to board info (bd)
- remove compiler optimization barrier which is not need.
Changes for v13:
- board.c: remove unused CONFIG_IDENT_STRING.
- arch/nds32/lib/Makefile: remove unused clean and distclean.
Changes for v14:
- No change.
Changes for v15:
- lib/board.c:
- remove duplicate pci init
- drop NET_MULTI
Changes for v16-v17:
- No changes.

Quoted 11 lines
 arch/nds32/config.mk        |   35 ++++
 arch/nds32/lib/Makefile     |   46 +++++
 arch/nds32/lib/board.c      |  439 +++++++++++++++++++++++++++++++++++++++++++
 arch/nds32/lib/bootm.c      |  241 ++++++++++++++++++++++++
 arch/nds32/lib/interrupts.c |  129 +++++++++++++
 5 files changed, 890 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/config.mk
 create mode 100644 arch/nds32/lib/Makefile
 create mode 100644 arch/nds32/lib/board.c
 create mode 100644 arch/nds32/lib/bootm.c
 create mode 100644 arch/nds32/lib/interrupts.c

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
When all else fails, read the instructions.
#116 lore raw

PATCH v17 6/9 nds32: standalone support

In reply to Wolfgang Denk

Add standalone program related support for nds32 architecture.

---
Changes for v1-v6:
- code clean up.
Changes for v7-v11:
- No change.
Changes for v12:
- clean up for linker script.
Changes for v13-v15:
- No change.
Changes for v16:
- x86-testapp.c: fix line over 80 characters.
Changes for v17:
- No change.

 examples/standalone/nds32.lds     |   56 +++++++++++++++++++++++++++++++++++++
 examples/standalone/stubs.c       |   17 ++++++++++-
 examples/standalone/x86-testapp.c |   13 ++++++++
 3 files changed, 85 insertions(+), 1 deletions(-)
 create mode 100644 examples/standalone/nds32.lds
examples/standalone/nds32.lds new file +56 -0
new file mode 100644
index 0000000..50b4c4b
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2011 Andes Technology Corporation
+ * Shawn Lin, Andes Technology Corporation <[email protected]>
+ * Macpaul Lin, Andes Technology Corporation <[email protected]>
+ *
+ * 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-nds32", "elf32-nds32", "elf32-nds32")
+OUTPUT_ARCH(nds32)
+ENTRY(_start)
+SECTIONS
+{
+	. = ALIGN(4);
+	.text :
+	{
+		*(.text)
+	}
+
+	. = ALIGN(4);
+	.data : { *(.data) }
+
+	. = ALIGN(4);
+
+	.got : {
+		__got_start = .;
+		*(.got)
+		__got_end = .;
+	}
+
+	. = ALIGN(4);
+	__bss_start = .;
+	.bss : { *(.bss) }
+	__bss_end = .;
+
+	. = ALIGN(4);
+	.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+
+	_end = .;
+}
examples/standalone/stubs.c +16 -1
index 507d38c..11c7565 100644
@@ -167,8 +167,23 @@ gd_t *global_data;
 "	jmp %%g1\n"					\
 "	nop\n"						\
 	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "g1" );
-
+#elif defined(CONFIG_NDS32)
+/*
+ * r16 holds the pointer to the global_data. gp is call clobbered.
+ * not support reduced register (16 GPR).
+ */
+#define EXPORT_FUNC(x) \
+	asm volatile (			\
+"	.globl " #x "\n"		\
+#x ":\n"				\
+"	lwi	$r16, [$gp + (%0)]\n"	\
+"	lwi	$r16, [$r16 + (%1)]\n"	\
+"	jr	$r16\n"			\
+	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "$r16");
 #else
+/*"	addi	$sp, $sp, -24\n"	\
+"	br	$r16\n"			\*/
+
 #error stubs definition missing for this architecture
 #endif
 
examples/standalone/x86-testapp.c +13 -0
index e8603d9..1e16ec7 100644
@@ -52,6 +52,17 @@ asm volatile (						\
 "	lw	$25, %1($25)\n"				\
 "	jr	$25\n"					\
 	: : "i"(offsetof(xxx_t, pfunc)), "i"(XF_ ## x * sizeof(void *)) : "t9");
+#elif defined(__nds32__)
+#define EXPORT_FUNC(x)					\
+asm volatile (						\
+"	.globl mon_" #x "\n"				\
+"mon_" #x ":\n"						\
+"	lwi	$r16, [$gp + (%0)]\n"			\
+"	lwi	$r16, [$r16 + (%1)]\n"			\
+"	jr	$r16\n"					\
+: : "i"(offsetof(xxx_t, pfunc)),			\
+"i"(XF_ ## x * sizeof(void *)) : "$r16");
+
 #else
 #error [No stub code for this arch]
 #endif
@@ -72,6 +83,8 @@ int main(void)
 	register volatile xxx_t *pq asm("r8");
 #elif defined(__mips__)
 	register volatile xxx_t *pq asm("k0");
+#elif defined(__nds32__)
+	register volatile xxx_t *pq asm("$r16");
 #endif
 	char buf[32];
 
Signature · 1 line
1.7.3.5
#117 lore raw

PATCH v17 6/9 nds32: standalone support

Dear Macpaul Lin,

Quoted 17 lines · In message <[email protected]> you wrote:

Add standalone program related support for nds32 architecture.

---
Changes for v1-v6:
- code clean up.
Changes for v7-v11:
- No change.
Changes for v12:
- clean up for linker script.
Changes for v13-v15:
- No change.
Changes for v16:
- x86-testapp.c: fix line over 80 characters.
Changes for v17:
- No change.

Quoted 5 lines
 examples/standalone/nds32.lds     |   56 +++++++++++++++++++++++++++++++++++++
 examples/standalone/stubs.c       |   17 ++++++++++-
 examples/standalone/x86-testapp.c |   13 ++++++++
 3 files changed, 85 insertions(+), 1 deletions(-)
 create mode 100644 examples/standalone/nds32.lds

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
He'd been wrong, there _was_ a light at the end of the tunnel, and it
was a flamethrower.                         - Terry Pratchett, _Mort_
#118 lore raw

PATCH v17 7/9 nds32: common bdinfo, bootm, image support

In reply to Wolfgang Denk

Add support of NDS32 to common commands bdinfo, bootm, and image format.

---
Changes for v1-v6:
- Code clean up
Changes for v7-v9:
- No Change.
Changes for v10:
- fix up according to the changes in master tree.
Changes for v11:
- No Change.
Changes for v12:
- remove seldom used bi_env parameter.
Changes for v13-v14:
- No change.
Changes for v15:
- cmd_bootm.c and image.h
- Fix for new image.h according to Mike's Contribute.
Changes for v16:
- No change.
Changes for v17:
- Fix for Sandbox added in.

 common/cmd_bdinfo.c |   25 +++++++++++++++++++++++++
 common/image.c      |    1 +
 include/image.h     |    1 +
 3 files changed, 27 insertions(+), 0 deletions(-)
common/cmd_bdinfo.c +25 -0
index 9c1d7d0..122729d 100644
@@ -439,6 +439,31 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return 0;
 }
 
+#elif defined(CONFIG_NDS32)
+
+int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	int i;
+	bd_t *bd = gd->bd;
+
+	print_num("arch_number",	bd->bi_arch_number);
+	print_num("boot_params",	(ulong)bd->bi_boot_params);
+
+	for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
+		print_num("DRAM bank",	i);
+		print_num("-> start",	bd->bi_dram[i].start);
+		print_num("-> size",	bd->bi_dram[i].size);
+	}
+
+#if defined(CONFIG_CMD_NET)
+	print_eth(0);
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+#endif
+	printf("baudrate    = %d bps\n", bd->bi_baudrate);
+
+	return 0;
+}
+
 #else
  #error "a case for this architecture does not exist!"
 #endif
common/image.c +1 -0
index 32ad4da..1538256 100644
@@ -93,6 +93,7 @@ static const table_entry_t uimage_arch[] = {
 	{	IH_ARCH_SPARC64,	"sparc64",	"SPARC 64 Bit",	},
 	{	IH_ARCH_BLACKFIN,	"blackfin",	"Blackfin",	},
 	{	IH_ARCH_AVR32,		"avr32",	"AVR32",	},
+	{	IH_ARCH_NDS32,		"nds32",	"NDS32",	},
 	{	-1,			"",		"",		},
 };
 
include/image.h +1 -0
index b7caaa6..2ec31bd 100644
@@ -107,6 +107,7 @@
 #define IH_ARCH_AVR32		17	/* AVR32	*/
 #define IH_ARCH_ST200	        18	/* STMicroelectronics ST200  */
 #define IH_ARCH_SANDBOX		19	/* Sandbox architecture (test only) */
+#define IH_ARCH_NDS32	        19	/* ANDES Technology - NDS32  */
 
 /*
  * Image Types
Signature · 1 line
1.7.3.5
#119 lore raw

PATCH v17 7/9 nds32: common bdinfo, bootm, image support

Dear Macpaul Lin,

Quoted 24 lines · In message <[email protected]> you wrote:

Add support of NDS32 to common commands bdinfo, bootm, and image format.

---
Changes for v1-v6:
- Code clean up
Changes for v7-v9:
- No Change.
Changes for v10:
- fix up according to the changes in master tree.
Changes for v11:
- No Change.
Changes for v12:
- remove seldom used bi_env parameter.
Changes for v13-v14:
- No change.
Changes for v15:
- cmd_bootm.c and image.h
- Fix for new image.h according to Mike's Contribute.
Changes for v16:
- No change.
Changes for v17:
- Fix for Sandbox added in.

Quoted 4 lines
 common/cmd_bdinfo.c |   25 +++++++++++++++++++++++++
 common/image.c      |    1 +
 include/image.h     |    1 +
 3 files changed, 27 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"There is nothing  so  deadly  as  not  to  hold  up  to  people  the
opportunity to do great and wonderful things, if we wish to stimulate
them in an active way."
- Dr. Harold Urey, Nobel Laureate in chemistry
#120 lore raw

PATCH v17 8/9 adp-ag101: add board adp-ag101 support

In reply to Wolfgang Denk

Add evaluation board "adp-ag101" configuration file adp-ag101.h. Add adp-ag101.c board config and related settings.
Add board adp-ag101 into boards.cfg

---
Changes for v1-v4:
- code clean up
Changes for v5-v6:
- Refine the definitions and parameters about CLK,
AHB controller, SDRAM controller, Static memory controllers.
- Add APB_CLK, AHB_CLK, SYS_CLK definitions for backward compatible.
- ftahbc010:
- Update include path of ftahbc010.
- ftsdmc021:
- Update include path of ftsdmc021.
- ftsmc020:
- Update include path of ftsmc020.
- ftwdt010:
- Fix WDT define and update include path.
- Fix ftwdt010 for hardware reset.
- ftpmu010:
- Remove duplicate PMU definitions.
- Add related configurations.
- Fix MAX malloc len and fix saveenv.
- clean up.
Changes for v7:
- clean up.
- Move CONFIG_SYS_TEXT_BASE from board/config.mk.
- Fix Makefile and remove config.mk
Changes for v8:
- No change.
Changes for v9:
- Fix because other boards has been added into boards.cfg and broken this patch.
Changes for v10:
- adp-ag101.h
- Fix lines over 80 characters.
- Fix for introducing gen-asm-offset.
- Add mmc support for FTSDC010 SD/MMC Controller.
- fix flash init.
- fix ftsmc010 configuraion for flash probing.
- Add SP_INIT related configurations for supporting relocation.
- Fix CONFIG_TEXT_BASE for relocation.
- Add CONFIG_MEM_REMAP for some hardware boards and non-OS application.
- adp-ag101.c
- Clean up for braces according to Wolfgang's suggestion.
- Add mmc support for FTSDC010 SD/MMC Controller.
- fix dram init(), made this more simpler.
Changes for v11:
- No change.
Changes for v12:
- adp-ag101.h
- fix address when enable CONFIG_SKIP_LOWLEVEL_INIT
Changes for v13:
- board/AndesTech/adp-ag101/Makefile: remove unused clean and distclean.
Changes for v14:
- No change.
Changes for v15:
- adp-ag101.h: drop NET_MULTI
- Makefile: clean up Makefile
Changes for v16:
- No change.
Changes for v17:
- Fix boards.cfg (update only).

 MAINTAINERS                           |   11 +
 MAKEALL                               |    6 +
 board/AndesTech/adp-ag101/Makefile    |   44 ++++
 board/AndesTech/adp-ag101/adp-ag101.c |   89 +++++++
 boards.cfg                            |    1 +
 include/configs/adp-ag101.h           |  406 +++++++++++++++++++++++++++++++++
 6 files changed, 557 insertions(+), 0 deletions(-)
 create mode 100644 board/AndesTech/adp-ag101/Makefile
 create mode 100644 board/AndesTech/adp-ag101/adp-ag101.c
 create mode 100644 include/configs/adp-ag101.h
MAINTAINERS +11 -0
index bb95e6d..e648ccf 100644
@@ -1124,5 +1124,16 @@ Chong Huang <[email protected]>
 	bf525-ucr2	BF525
 
 #########################################################################
+# NDS32 Systems:							#
+#									#
+# Maintainer Name, Email Address					#
+#	Board		CPU						#
+#########################################################################
+
+Macpaul Lin <[email protected]>
+
+	ADP-AG101	N1213 (AG101 SoC)
+
+#########################################################################
 # End of MAINTAINERS list						#
 #########################################################################
MAKEALL +6 -0
index f582f8b..7b3a75d 100755
@@ -483,6 +483,12 @@ LIST_sh="$(boards_by_arch sh)"
 
 LIST_sparc="$(boards_by_arch sparc)"
 
+#########################################################################
+## NDS32 Systems
+#########################################################################
+
+LIST_nds32="$(boards_by_arch nds32)"
+
 #-----------------------------------------------------------------------
 
 build_target() {
board/AndesTech/adp-ag101/Makefile new file +44 -0

44 lines not on this page · raw message

board/AndesTech/adp-ag101/adp-ag101.c new file +89 -0

89 lines not on this page · raw message

boards.cfg +1 -0
index 1e3bfdc..049fcb4 100644
@@ -305,6 +305,7 @@ vct_platinumavc_onenand      mips        mips32      vct                 microna
 vct_platinumavc_onenand_small mips       mips32      vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_ONENAND,VCT_SMALL_IMAGE
 qi_lb60                      mips        xburst      qi_lb60             qi
 nios2-generic                nios2       nios2       nios2-generic       altera
+adp-ag101                    nds32       n1213       adp-ag101           AndesTech      ag101
 PCI5441                      nios2       nios2       pci5441             psyent
 PK1C20                       nios2       nios2       pk1c20              psyent
 EVB64260                     powerpc     74xx_7xx    evb64260            -              -           EVB64260
include/configs/adp-ag101.h new file +406 -0

406 lines not on this page · raw message

Signature · 1 line
1.7.3.5
#121 lore raw

PATCH v17 8/9 adp-ag101: add board adp-ag101 support

Dear Macpaul Lin,

Quoted 66 lines · In message <[email protected]> you wrote:

Add evaluation board "adp-ag101" configuration file adp-ag101.h. Add adp-ag101.c board config and related settings.
Add board adp-ag101 into boards.cfg

---
Changes for v1-v4:
- code clean up
Changes for v5-v6:
- Refine the definitions and parameters about CLK,
AHB controller, SDRAM controller, Static memory controllers.
- Add APB_CLK, AHB_CLK, SYS_CLK definitions for backward compatible.
- ftahbc010:
- Update include path of ftahbc010.
- ftsdmc021:
- Update include path of ftsdmc021.
- ftsmc020:
- Update include path of ftsmc020.
- ftwdt010:
- Fix WDT define and update include path.
- Fix ftwdt010 for hardware reset.
- ftpmu010:
- Remove duplicate PMU definitions.
- Add related configurations.
- Fix MAX malloc len and fix saveenv.
- clean up.
Changes for v7:
- clean up.
- Move CONFIG_SYS_TEXT_BASE from board/config.mk.
- Fix Makefile and remove config.mk
Changes for v8:
- No change.
Changes for v9:
- Fix because other boards has been added into boards.cfg and broken this patch.
Changes for v10:
- adp-ag101.h
- Fix lines over 80 characters.
- Fix for introducing gen-asm-offset.
- Add mmc support for FTSDC010 SD/MMC Controller.
- fix flash init.
- fix ftsmc010 configuraion for flash probing.
- Add SP_INIT related configurations for supporting relocation.
- Fix CONFIG_TEXT_BASE for relocation.
- Add CONFIG_MEM_REMAP for some hardware boards and non-OS application.
- adp-ag101.c
- Clean up for braces according to Wolfgang's suggestion.
- Add mmc support for FTSDC010 SD/MMC Controller.
- fix dram init(), made this more simpler.
Changes for v11:
- No change.
Changes for v12:
- adp-ag101.h
- fix address when enable CONFIG_SKIP_LOWLEVEL_INIT
Changes for v13:
- board/AndesTech/adp-ag101/Makefile: remove unused clean and distclean.
Changes for v14:
- No change.
Changes for v15:
- adp-ag101.h: drop NET_MULTI
- Makefile: clean up Makefile
Changes for v16:
- No change.
Changes for v17:
- Fix boards.cfg (update only).

Quoted 10 lines
 MAINTAINERS                           |   11 +
 MAKEALL                               |    6 +
 board/AndesTech/adp-ag101/Makefile    |   44 ++++
 board/AndesTech/adp-ag101/adp-ag101.c |   89 +++++++
 boards.cfg                            |    1 +
 include/configs/adp-ag101.h           |  406 +++++++++++++++++++++++++++++++++
 6 files changed, 557 insertions(+), 0 deletions(-)
 create mode 100644 board/AndesTech/adp-ag101/Makefile
 create mode 100644 board/AndesTech/adp-ag101/adp-ag101.c
 create mode 100644 include/configs/adp-ag101.h

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"'Tis true, 'tis pity, and pity 'tis 'tis true."
    - Poloniouius, in Willie the Shake's _Hamlet, Prince of Darkness_
#122 lore raw

PATCH v17 9/9 doc/README: documents and readme for NDS32 arch

In reply to Wolfgang Denk

Documents and READMEs for NDS32 architecture.
It patch also provides usage of SoC AG101 and board ADP-AG101.

---
Changes for v1-v10:
- The patch of documentation was not included.
Changes for v11:
- Add the documents of NDS32, ag101, N1213.
Changes for v12-v16:
- No change.
Changes for v17:
- Fix README (update only).

 README                |   24 ++++++++++++++--
 doc/README.N1213      |   55 ++++++++++++++++++++++++++++++++++++
 doc/README.NDS32      |   41 +++++++++++++++++++++++++++
 doc/README.ag101      |   74 +++++++++++++++++++++++++++++++++++++++++++++++++
 doc/README.standalone |    1 +
 5 files changed, 192 insertions(+), 3 deletions(-)
 create mode 100644 doc/README.N1213
 create mode 100644 doc/README.NDS32
 create mode 100644 doc/README.ag101
README +21 -3
index eb9ade9..c6b179c 100644
@@ -183,6 +183,10 @@ Directory Hierarchy:
       /mips32		Files specific to MIPS32 CPUs
       /xburst		Files specific to Ingenic XBurst CPUs
     /lib		Architecture specific library files
+  /nds32		Files generic to NDS32 architecture
+    /cpu		CPU specific files
+      /n1213		Files specific to Andes Technology N1213 CPUs
+    /lib		Architecture specific library files
   /nios2		Files generic to Altera NIOS2 architecture
     /cpu		CPU specific files
     /lib		Architecture specific library files
@@ -3156,7 +3160,7 @@ Low Level (hardware related) configuration options:
 		globally (CONFIG_CMD_MEM).
 
 - CONFIG_SKIP_LOWLEVEL_INIT
-		[ARM, MIPS only] If this variable is defined, then certain
+		[ARM, NDS32, MIPS only] If this variable is defined, then certain
 		low level initializations (like setting up the memory
 		controller) are omitted and/or U-Boot does not
 		relocate itself into RAM.
@@ -3723,8 +3727,8 @@ details; basically, the header defines the following image properties:
   Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, LynxOS,
   INTEGRITY).
 * Target CPU Architecture (Provisions for Alpha, ARM, AVR32, Intel x86,
-  IA64, MIPS, Nios II, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
-  Currently supported: ARM, AVR32, Intel x86, MIPS, Nios II, PowerPC).
+  IA64, MIPS, NDS32, Nios II, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
+  Currently supported: ARM, AVR32, Intel x86, MIPS, NDS32, Nios II, PowerPC).
 * Compression Type (uncompressed, gzip, bzip2)
 * Load Address
 * Entry Point
@@ -4417,6 +4421,20 @@ On Nios II, the ABI is documented here:
     Note: on Nios II, we give "-G0" option to gcc and don't use gp
     to access small data sections, so gp is free.
 
+On NDS32, the following registers are used:
+
+	R0-R1:	argument/return
+	R2-R5:	argument
+	R15:	temporary register for assembler
+	R16:	trampoline register
+	R28:	frame pointer (FP)
+	R29:	global pointer (GP)
+	R30:	link register (LP)
+	R31:	stack pointer (SP)
+	PC:	program counter (PC)
+
+    ==> U-Boot will use R10 to hold a pointer to the global data
+
 NOTE: DECLARE_GLOBAL_DATA_PTR must be used with file-global scope,
 or current versions of GCC may "optimize" the code too much.
 
doc/README.N1213 new file +55 -0

55 lines not on this page · raw message

doc/README.NDS32 new file +41 -0

41 lines not on this page · raw message

doc/README.ag101 new file +74 -0

74 lines not on this page · raw message

doc/README.standalone +1 -0
index 6e6b65f..2be5f27 100644
@@ -56,6 +56,7 @@ Design Notes on Exporting U-Boot Functions to Standalone Applications:
 	ARM		0x0c100000	0x0c100000
 	MIPS		0x80200000	0x80200000
 	Blackfin	0x00001000	0x00001000
+	NDS32		0x00300000	0x00300000
 	Nios II		0x02000000	0x02000000
 
    For example, the "hello world" application may be loaded and
Signature · 1 line
1.7.3.5
#123 lore raw

PATCH v17 9/9 doc/README: documents and readme for NDS32 arch

Dear Macpaul Lin,

Quoted 14 lines · In message <[email protected]> you wrote:

Documents and READMEs for NDS32 architecture.
It patch also provides usage of SoC AG101 and board ADP-AG101.

---
Changes for v1-v10:
- The patch of documentation was not included.
Changes for v11:
- Add the documents of NDS32, ag101, N1213.
Changes for v12-v16:
- No change.
Changes for v17:
- Fix README (update only).

Quoted 9 lines
 README                |   24 ++++++++++++++--
 doc/README.N1213      |   55 ++++++++++++++++++++++++++++++++++++
 doc/README.NDS32      |   41 +++++++++++++++++++++++++++
 doc/README.ag101      |   74 +++++++++++++++++++++++++++++++++++++++++++++++++
 doc/README.standalone |    1 +
 5 files changed, 192 insertions(+), 3 deletions(-)
 create mode 100644 doc/README.N1213
 create mode 100644 doc/README.NDS32
 create mode 100644 doc/README.ag101

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is more rational to sacrifice one life than six.
	-- Spock, "The Galileo Seven", stardate 2822.3
#124 lore raw

PATCH v15 2/9 nds32: add NDS32 support into common header file

In reply to Macpaul Lin

Add NDS32 support into common header file.

---
Changes for v1-v7:
- No change
Changes for v8:
- Fix the patch according to dependency of x86's Fix
Changes for v9-v15:
- No change

 include/common.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/common.h +4 -0
index bcc00e8..42b00a0 100644
@@ -302,6 +302,10 @@ int	setenv	     (const char *, const char *);
 #ifdef CONFIG_X86		/* x86 version to be fixed! */
 # include <asm/u-boot-x86.h>
 #endif /* CONFIG_X86 */
+#ifdef CONFIG_NDS32
+# include <asm/mach-types.h>
+# include <asm/u-boot-nds32.h>	/* NDS32 version to be fixed! */
+#endif /* CONFIG_NDS32 */
 
 #ifdef CONFIG_AUTO_COMPLETE
 int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf);
Signature · 1 line
1.7.3.5
#125 lore raw

PATCH v15 3/9 nds32/core N1213: NDS32 N12 core family N1213

In reply to Macpaul Lin

Add N1213 cpu core (N12 Core family) support for NDS32 arch. This patch includes start.S for the initialize procedure of N1213.

Start procedure:
start.S will start up the N1213 CPU core at first, then jump to SoC dependent "lowlevel_init.S" and "watchdog.S" to configure peripheral devices.

---
Changes v1 to v6:
- Style clean up and reorganize code
Changes v7-v9:
- No Change.
Changes v10:
- start.S of N1213 CPU has been rewrote for relocation support.
- u-boot.lds:
- Add got and *(.got.plt) section for support GCC 4 toolchain
- Modified for relocation implementation.
Changes v11:
- arch/nds32/cpu/n1213/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes v12:
- u-boot.lds
- Remove the 0x00000000 base address in linker script.
The base address of the binary will be determined by CONFIG_SYS_TEXT_BASE
- Remove the CPU features in commit log and add to README in later patches.
Changes v13-v14:
- No change.
Changes v15:
- start.S: fix exception vector aligment (add setivb in reset vector).

 arch/nds32/cpu/n1213/Makefile   |   50 ++++
 arch/nds32/cpu/n1213/start.S    |  509 +++++++++++++++++++++++++++++++++++++++
 arch/nds32/cpu/n1213/u-boot.lds |   70 ++++++
 3 files changed, 629 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/cpu/n1213/Makefile
 create mode 100644 arch/nds32/cpu/n1213/start.S
 create mode 100644 arch/nds32/cpu/n1213/u-boot.lds
arch/nds32/cpu/n1213/Makefile new file +50 -0
new file mode 100644
index 0000000..da15574
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# Copyright (C) 2011 Andes Technology Corporation
+# Shawn Lin, Andes Technology Corporation <[email protected]>
+# Macpaul Lin, Andes Technology Corporation <[email protected]>
+#
+# 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(CPU).o
+
+START	= start.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
+
+#########################################################################
arch/nds32/cpu/n1213/start.S new file +509 -0

509 lines not on this page · raw message

arch/nds32/cpu/n1213/u-boot.lds new file +70 -0

70 lines not on this page · raw message

Signature · 1 line
1.7.3.5
#126 lore raw

PATCH v15 3/9 nds32/core N1213: NDS32 N12 core family N1213

Dear Macpaul Lin,

Quoted 33 lines · In message <[email protected]> you wrote:

Add N1213 cpu core (N12 Core family) support for NDS32 arch. This patch includes start.S for the initialize procedure of N1213.

Start procedure:
start.S will start up the N1213 CPU core at first, then jump to SoC dependent "lowlevel_init.S" and "watchdog.S" to configure peripheral devices.

---
Changes v1 to v6:
- Style clean up and reorganize code
Changes v7-v9:
- No Change.
Changes v10:
- start.S of N1213 CPU has been rewrote for relocation support.
- u-boot.lds:
- Add got and *(.got.plt) section for support GCC 4 toolchain
- Modified for relocation implementation.
Changes v11:
- arch/nds32/cpu/n1213/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes v12:
- u-boot.lds
- Remove the 0x00000000 base address in linker script.
The base address of the binary will be determined by CONFIG_SYS_TEXT_BASE
- Remove the CPU features in commit log and add to README in later patches.
Changes v13-v14:
- No change.
Changes v15:
- start.S: fix exception vector aligment (add setivb in reset vector).

Quoted 7 lines
 arch/nds32/cpu/n1213/Makefile   |   50 ++++
 arch/nds32/cpu/n1213/start.S    |  509 +++++++++++++++++++++++++++++++++++++++
 arch/nds32/cpu/n1213/u-boot.lds |   70 ++++++
 3 files changed, 629 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/cpu/n1213/Makefile
 create mode 100644 arch/nds32/cpu/n1213/start.S
 create mode 100644 arch/nds32/cpu/n1213/u-boot.lds

Checkpatch says:

total: 0 errors, 7 warnings, 629 lines checked

Please clean up and resubmit. Thanks.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I knew then (in 1970) that a 4-kbyte minicomputer would cost as much
as a house. So I reasoned  that  after  college,  I'd  have  to  live
cheaply in an apartment and put all my money into owning a computer."
      - Apple co-founder Steve Wozniak, EE Times, June 6, 1988, pg 45
#127 lore raw

PATCH v15 4/9 nds32/ag101: cpu and init funcs of SoC ag101

In reply to Macpaul Lin

SoC ag101 is the first chip using NDS32 N1213 cpu core. Add header file of device offset support for SoC ag101. Add main function of SoC ag101 based on NDS32 n1213 core. Add lowlevel_init.S and other periphal related code.

This version of lowlevel_init.S also replace hardcode value by MARCO defines from the GPL version andesboot for better code quality.

---
Changes for v1-v4:
- Code clean up.
Changes for v5-v6:
- Split watchdog.S from lowlevel_init.S.
- Fix hardware reset by using watchdog reset in do_reset() in cpu.c.
- reset_cpu was remove inside do_reset().
- lowlevel_init.S
- Change hard code value into MARCO definitions.
- ftsmc010
- Fix FTSMC020_TPR_AT2 from 1 to 3 (0xff3ff)
- ftsdmc021
- Fix hardcoded address of CR1, CR2, TR1, TR2, BANK0 registers.
- Fix the default configuration value of FTSDMC and FTSMC controller.
- Remove some ftpmu010 and flash probe code to C functions.
Changes for v7:
- clean up.
Changes for v8-v9:
- No change.
Changes for v10:
- asm-offset.c: file added for ag101 use only.
- ag101/Makefile: add gen-asm-offset support to ag101 for lowlevel_init.S.
- Makefile: add gen-asm-offset support for NDS32 based core and SoCs.
- cpu.c: remove unused cpu_init().
- lowlevel_init.S
- Introduce SoC specific gen-asm-offset.h to lowlevel_init.S
- Replace routings by macros to made code much easier to understand.
- Add debug LED support.
- Add CONFIG_MEM_REMAP for those boards must do memort remapping.
Changes for v11:
- arch/nds32/cpu/n1213/ag101/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes for v12:
- Simplify the commit log about the part of lowlevel_init.S.
Changes for v13:
- arch/nds32/cpu/n1213/ag101/Makefile: remove unused gen-asm-offset.
- Makefile: remove unused gen-asm-offset because merged asm-offsets.
Changes for v14:
- lowlevel_init.S: fix include path of <generated/asm-offsets.h>
Changes for v15:
- fix sleep delay.

 arch/nds32/cpu/n1213/ag101/Makefile        |   58 +++++++
 arch/nds32/cpu/n1213/ag101/asm-offsets.c   |   43 +++++
 arch/nds32/cpu/n1213/ag101/cpu.c           |  200 +++++++++++++++++++++++
 arch/nds32/cpu/n1213/ag101/lowlevel_init.S |  238 ++++++++++++++++++++++++++++
 arch/nds32/cpu/n1213/ag101/timer.c         |  204 ++++++++++++++++++++++++
 arch/nds32/cpu/n1213/ag101/watchdog.S      |   48 ++++++
 arch/nds32/include/asm/arch-ag101/ag101.h  |   68 ++++++++
 7 files changed, 859 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/cpu/n1213/ag101/Makefile
 create mode 100644 arch/nds32/cpu/n1213/ag101/asm-offsets.c
 create mode 100644 arch/nds32/cpu/n1213/ag101/cpu.c
 create mode 100644 arch/nds32/cpu/n1213/ag101/lowlevel_init.S
 create mode 100644 arch/nds32/cpu/n1213/ag101/timer.c
 create mode 100644 arch/nds32/cpu/n1213/ag101/watchdog.S
 create mode 100644 arch/nds32/include/asm/arch-ag101/ag101.h
arch/nds32/cpu/n1213/ag101/Makefile new file +58 -0
new file mode 100644
index 0000000..8716c4e
@@ -0,0 +1,58 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Written-by: Prafulla Wadaskar <[email protected]>
+#
+# Copyright (C) 2011 Andes Technology Corporation
+# Shawn Lin, Andes Technology Corporation <[email protected]>
+# Macpaul Lin, Andes Technology Corporation <[email protected]>
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(SOC).o
+
+COBJS-y	:= cpu.o timer.o
+
+ifndef CONFIG_SKIP_LOWLEVEL_INIT
+SOBJS	:= lowlevel_init.o
+endif
+
+ifndef CONFIG_SKIP_TRUNOFF_WATCHDOG
+SOBJS	+= watchdog.o
+endif
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+
+all:	$(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
arch/nds32/cpu/n1213/ag101/asm-offsets.c new file +43 -0

43 lines not on this page · raw message

arch/nds32/cpu/n1213/ag101/cpu.c new file +200 -0

200 lines not on this page · raw message

arch/nds32/cpu/n1213/ag101/lowlevel_init.S new file +238 -0

238 lines not on this page · raw message

arch/nds32/cpu/n1213/ag101/timer.c new file +204 -0

204 lines not on this page · raw message

arch/nds32/cpu/n1213/ag101/watchdog.S new file +48 -0

48 lines not on this page · raw message

arch/nds32/include/asm/arch-ag101/ag101.h new file +68 -0

68 lines not on this page · raw message

Signature · 1 line
1.7.3.5
#128 lore raw

PATCH v15 4/9 nds32/ag101: cpu and init funcs of SoC ag101

Dear Macpaul Lin,

Quoted 52 lines · In message <[email protected]> you wrote:

SoC ag101 is the first chip using NDS32 N1213 cpu core. Add header file of device offset support for SoC ag101. Add main function of SoC ag101 based on NDS32 n1213 core. Add lowlevel_init.S and other periphal related code.

This version of lowlevel_init.S also replace hardcode value by MARCO defines from the GPL version andesboot for better code quality.

---
Changes for v1-v4:
- Code clean up.
Changes for v5-v6:
- Split watchdog.S from lowlevel_init.S.
- Fix hardware reset by using watchdog reset in do_reset() in cpu.c.
- reset_cpu was remove inside do_reset().
- lowlevel_init.S
- Change hard code value into MARCO definitions.
- ftsmc010
- Fix FTSMC020_TPR_AT2 from 1 to 3 (0xff3ff)
- ftsdmc021
- Fix hardcoded address of CR1, CR2, TR1, TR2, BANK0 registers.
- Fix the default configuration value of FTSDMC and FTSMC controller.
- Remove some ftpmu010 and flash probe code to C functions.
Changes for v7:
- clean up.
Changes for v8-v9:
- No change.
Changes for v10:
- asm-offset.c: file added for ag101 use only.
- ag101/Makefile: add gen-asm-offset support to ag101 for lowlevel_init.S.
- Makefile: add gen-asm-offset support for NDS32 based core and SoCs.
- cpu.c: remove unused cpu_init().
- lowlevel_init.S
- Introduce SoC specific gen-asm-offset.h to lowlevel_init.S
- Replace routings by macros to made code much easier to understand.
- Add debug LED support.
- Add CONFIG_MEM_REMAP for those boards must do memort remapping.
Changes for v11:
- arch/nds32/cpu/n1213/ag101/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes for v12:
- Simplify the commit log about the part of lowlevel_init.S.
Changes for v13:
- arch/nds32/cpu/n1213/ag101/Makefile: remove unused gen-asm-offset.
- Makefile: remove unused gen-asm-offset because merged asm-offsets.
Changes for v14:
- lowlevel_init.S: fix include path of <generated/asm-offsets.h>
Changes for v15:
- fix sleep delay.

Quoted 15 lines
 arch/nds32/cpu/n1213/ag101/Makefile        |   58 +++++++
 arch/nds32/cpu/n1213/ag101/asm-offsets.c   |   43 +++++
 arch/nds32/cpu/n1213/ag101/cpu.c           |  200 +++++++++++++++++++++++
 arch/nds32/cpu/n1213/ag101/lowlevel_init.S |  238 ++++++++++++++++++++++++++++
 arch/nds32/cpu/n1213/ag101/timer.c         |  204 ++++++++++++++++++++++++
 arch/nds32/cpu/n1213/ag101/watchdog.S      |   48 ++++++
 arch/nds32/include/asm/arch-ag101/ag101.h  |   68 ++++++++
 7 files changed, 859 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/cpu/n1213/ag101/Makefile
 create mode 100644 arch/nds32/cpu/n1213/ag101/asm-offsets.c
 create mode 100644 arch/nds32/cpu/n1213/ag101/cpu.c
 create mode 100644 arch/nds32/cpu/n1213/ag101/lowlevel_init.S
 create mode 100644 arch/nds32/cpu/n1213/ag101/timer.c
 create mode 100644 arch/nds32/cpu/n1213/ag101/watchdog.S
 create mode 100644 arch/nds32/include/asm/arch-ag101/ag101.h

Checkpatch says:

total: 0 errors, 16 warnings, 859 lines checked

Please clean up and resubmit. Thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You don't have to worry about me. I might have been born yesterday...
but I stayed up all night.
#129 lore raw

PATCH v15 5/9 nds32/lib: add generic funcs in NDS32 lib

In reply to Macpaul Lin

Add Makefile, board.c, interrupts.c and bootm.c functions to nds32 architecture.

---
Changes for v1-v4:
- code clean up and formatting style.
Changes for v5-v6:
- board.c
- Do some clean up and add code
- Remove display banner which hasn't support.
- Add ftpmu010 related power management unit code.
- Remove useless LED related code.
- Move SDRAM init to board sepecific files. (ex. adp-ag101.c)
- Remove CONFIG_SOFT_I2C which hasn't been support.
- Remove CONFIG_FSL_ESDHC which hasn't been support.
- clean up.
Changes for v7:
- clean up.
- move single file patch arch/nds32/config.mk to this commit.
- interrupts.c refine origin interrupt enable and disable.
Changes for v8:
- interrups.c: fix up for new ptraces.h.
Changes for v9:
- support CONFIG_STANDALONE_LOAD_ADDR in config.mk
Changes for v10:
- config.mk:
- add -fpie flag.
- replace -ffixed-8 to -ffixed-10.
- add -mrelax and --gc-sections to LDFLAG
- board.c:
- fix lib/board.c for relocation.
- fix dram init for relocation.
Changes for v11:
- arch/nds32/lib/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes for v12:
- config.mk
- remove $(SRCTREE)/$(CPUDIR)/u-boot.lds
- board.c:
- remove obsolelte version_string.
- remove declaration "extern __bss_end" which is not need.
- replace sizeof(gd_t) and sizeof(bd_t) to GENERATED_GBL_DATA_SIZE and GENERATED_BD_INFO_SIZE
- add memset to board info (bd)
- remove compiler optimization barrier which is not need.
Changes for v13:
- board.c: remove unused CONFIG_IDENT_STRING.
- arch/nds32/lib/Makefile: remove unused clean and distclean.
Changes for v14:
- No change.
Changes for v15:
- lib/board.c:
- remove duplicate pci init
- drop NET_MULTI

 arch/nds32/config.mk        |   35 ++++
 arch/nds32/lib/Makefile     |   46 +++++
 arch/nds32/lib/board.c      |  439 +++++++++++++++++++++++++++++++++++++++++++
 arch/nds32/lib/bootm.c      |  241 ++++++++++++++++++++++++
 arch/nds32/lib/interrupts.c |  131 +++++++++++++
 5 files changed, 892 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/config.mk
 create mode 100644 arch/nds32/lib/Makefile
 create mode 100644 arch/nds32/lib/board.c
 create mode 100644 arch/nds32/lib/bootm.c
 create mode 100644 arch/nds32/lib/interrupts.c
arch/nds32/config.mk new file +35 -0
new file mode 100644
index 0000000..c589829
@@ -0,0 +1,35 @@
+#
+# (C) Copyright 2000-2002
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2011
+# Shawn Lin, Andes Technology Corporation <[email protected]>
+# Macpaul Lin, Andes Technology Corporation <[email protected]>
+#
+# 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
+
+CROSS_COMPILE ?= nds32le-linux-
+
+CONFIG_STANDALONE_LOAD_ADDR = 0x300000 -T nds32.lds
+
+PLATFORM_RELFLAGS	+= -fno-strict-aliasing -fno-common -mrelax
+PLATFORM_RELFLAGS	+= -gdwarf-2
+PLATFORM_CPPFLAGS	+= -DCONFIG_NDS32 -D__nds32__ -G0 -ffixed-10 -fpie
+
+LDFLAGS_u-boot		= --gc-sections --relax
arch/nds32/lib/Makefile new file +46 -0

46 lines not on this page · raw message

arch/nds32/lib/board.c new file +439 -0

439 lines not on this page · raw message

arch/nds32/lib/bootm.c new file +241 -0

241 lines not on this page · raw message

arch/nds32/lib/interrupts.c new file +131 -0

131 lines not on this page · raw message

Signature · 1 line
1.7.3.5
#130 lore raw

PATCH v15 5/9 nds32/lib: add generic funcs in NDS32 lib

Dear Macpaul Lin,

Quoted 56 lines · In message <[email protected]> you wrote:

Add Makefile, board.c, interrupts.c and bootm.c functions to nds32 architecture.

---
Changes for v1-v4:
- code clean up and formatting style.
Changes for v5-v6:
- board.c
- Do some clean up and add code
- Remove display banner which hasn't support.
- Add ftpmu010 related power management unit code.
- Remove useless LED related code.
- Move SDRAM init to board sepecific files. (ex. adp-ag101.c)
- Remove CONFIG_SOFT_I2C which hasn't been support.
- Remove CONFIG_FSL_ESDHC which hasn't been support.
- clean up.
Changes for v7:
- clean up.
- move single file patch arch/nds32/config.mk to this commit.
- interrupts.c refine origin interrupt enable and disable.
Changes for v8:
- interrups.c: fix up for new ptraces.h.
Changes for v9:
- support CONFIG_STANDALONE_LOAD_ADDR in config.mk
Changes for v10:
- config.mk:
- add -fpie flag.
- replace -ffixed-8 to -ffixed-10.
- add -mrelax and --gc-sections to LDFLAG
- board.c:
- fix lib/board.c for relocation.
- fix dram init for relocation.
Changes for v11:
- arch/nds32/lib/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes for v12:
- config.mk
- remove $(SRCTREE)/$(CPUDIR)/u-boot.lds
- board.c:
- remove obsolelte version_string.
- remove declaration "extern __bss_end" which is not need.
- replace sizeof(gd_t) and sizeof(bd_t) to GENERATED_GBL_DATA_SIZE and GENERATED_BD_INFO_SIZE
- add memset to board info (bd)
- remove compiler optimization barrier which is not need.
Changes for v13:
- board.c: remove unused CONFIG_IDENT_STRING.
- arch/nds32/lib/Makefile: remove unused clean and distclean.
Changes for v14:
- No change.
Changes for v15:
- lib/board.c:
- remove duplicate pci init
- drop NET_MULTI

Quoted 11 lines
 arch/nds32/config.mk        |   35 ++++
 arch/nds32/lib/Makefile     |   46 +++++
 arch/nds32/lib/board.c      |  439 +++++++++++++++++++++++++++++++++++++++++++
 arch/nds32/lib/bootm.c      |  241 ++++++++++++++++++++++++
 arch/nds32/lib/interrupts.c |  131 +++++++++++++
 5 files changed, 892 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/config.mk
 create mode 100644 arch/nds32/lib/Makefile
 create mode 100644 arch/nds32/lib/board.c
 create mode 100644 arch/nds32/lib/bootm.c
 create mode 100644 arch/nds32/lib/interrupts.c

Checkpatch says:

total: 0 errors, 8 warnings, 892 lines checked

Please clean up and resubmit. Thanks.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Anyone who knows history, particularly the history of Europe, will, I
think, recognize that the domination of education or of government by
any one particular religious faith is never a happy  arrangement  for
the people.                                       - Eleanor Roosevelt
#131 lore raw

PATCH v15 6/9 nds32: standalone support

In reply to Macpaul Lin

Add standalone program related support for nds32 architecture.

---
Changes for v1-v6:
- code clean up.
Changes for v7-v11:
- No change.
Changes for v12:
- clean up for linker script.
Changes for v13-v15:
- No change.

 examples/standalone/nds32.lds     |   56 +++++++++++++++++++++++++++++++++++++
 examples/standalone/stubs.c       |   17 ++++++++++-
 examples/standalone/x86-testapp.c |   12 ++++++++
 3 files changed, 84 insertions(+), 1 deletions(-)
 create mode 100644 examples/standalone/nds32.lds
examples/standalone/nds32.lds new file +56 -0
new file mode 100644
index 0000000..50b4c4b
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2011 Andes Technology Corporation
+ * Shawn Lin, Andes Technology Corporation <[email protected]>
+ * Macpaul Lin, Andes Technology Corporation <[email protected]>
+ *
+ * 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-nds32", "elf32-nds32", "elf32-nds32")
+OUTPUT_ARCH(nds32)
+ENTRY(_start)
+SECTIONS
+{
+	. = ALIGN(4);
+	.text :
+	{
+		*(.text)
+	}
+
+	. = ALIGN(4);
+	.data : { *(.data) }
+
+	. = ALIGN(4);
+
+	.got : {
+		__got_start = .;
+		*(.got)
+		__got_end = .;
+	}
+
+	. = ALIGN(4);
+	__bss_start = .;
+	.bss : { *(.bss) }
+	__bss_end = .;
+
+	. = ALIGN(4);
+	.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+
+	_end = .;
+}
examples/standalone/stubs.c +16 -1
index 507d38c..11c7565 100644
@@ -167,8 +167,23 @@ gd_t *global_data;
 "	jmp %%g1\n"					\
 "	nop\n"						\
 	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "g1" );
-
+#elif defined(CONFIG_NDS32)
+/*
+ * r16 holds the pointer to the global_data. gp is call clobbered.
+ * not support reduced register (16 GPR).
+ */
+#define EXPORT_FUNC(x) \
+	asm volatile (			\
+"	.globl " #x "\n"		\
+#x ":\n"				\
+"	lwi	$r16, [$gp + (%0)]\n"	\
+"	lwi	$r16, [$r16 + (%1)]\n"	\
+"	jr	$r16\n"			\
+	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "$r16");
 #else
+/*"	addi	$sp, $sp, -24\n"	\
+"	br	$r16\n"			\*/
+
 #error stubs definition missing for this architecture
 #endif
 
examples/standalone/x86-testapp.c +12 -0
index e8603d9..a4ac6f8 100644
@@ -52,6 +52,16 @@ asm volatile (						\
 "	lw	$25, %1($25)\n"				\
 "	jr	$25\n"					\
 	: : "i"(offsetof(xxx_t, pfunc)), "i"(XF_ ## x * sizeof(void *)) : "t9");
+#elif defined(__nds32__)
+#define EXPORT_FUNC(x)					\
+asm volatile (						\
+"	.globl mon_" #x "\n"				\
+"mon_" #x ":\n"						\
+"	lwi	$r16, [$gp + (%0)]\n"			\
+"	lwi	$r16, [$r16 + (%1)]\n"			\
+"	jr	$r16\n"					\
+	: : "i"(offsetof(xxx_t, pfunc)), "i"(XF_ ## x * sizeof(void *)) : "$r16");
+
 #else
 #error [No stub code for this arch]
 #endif
@@ -72,6 +82,8 @@ int main(void)
 	register volatile xxx_t *pq asm("r8");
 #elif defined(__mips__)
 	register volatile xxx_t *pq asm("k0");
+#elif defined(__nds32__)
+	register volatile xxx_t *pq asm("$r16");
 #endif
 	char buf[32];
 
Signature · 1 line
1.7.3.5
#132 lore raw

PATCH v15 6/9 nds32: standalone support

Dear Macpaul Lin,

Quoted 13 lines · In message <[email protected]> you wrote:

Add standalone program related support for nds32 architecture.

---
Changes for v1-v6:
- code clean up.
Changes for v7-v11:
- No change.
Changes for v12:
- clean up for linker script.
Changes for v13-v15:
- No change.

Quoted 5 lines
 examples/standalone/nds32.lds     |   56 +++++++++++++++++++++++++++++++++++++
 examples/standalone/stubs.c       |   17 ++++++++++-
 examples/standalone/x86-testapp.c |   12 ++++++++
 3 files changed, 84 insertions(+), 1 deletions(-)
 create mode 100644 examples/standalone/nds32.lds

Checkpatch says:

total: 0 errors, 2 warnings, 104 lines checked

Please fix and resubmit.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
ATTENTION: Despite Any Other Listing of Product Contents Found  Here-
on, the Consumer is Advised That, in Actuality, This Product Consists
Of 99.9999999999% Empty Space.
#133 lore raw

PATCH v15 7/9 nds32: common bdinfo, bootm, image support

In reply to Macpaul Lin

Add support of NDS32 to common commands bdinfo, bootm, and image format.

---
Changes for v1-v6:
- Code clean up
Changes for v7-v9:
- No Change.
Changes for v10:
- fix up according to the changes in master tree.
Changes for v11:
- No Change.
Changes for v12:
- remove seldom used bi_env parameter.
Changes for v13-v14:
- No change.
Changes for v15:
- cmd_bootm.c and image.h
- Fix for new image.h according to Mike's Contribute.

 common/cmd_bdinfo.c |   25 +++++++++++++++++++++++++
 common/image.c      |    1 +
 include/image.h     |    1 +
 3 files changed, 27 insertions(+), 0 deletions(-)
common/cmd_bdinfo.c +25 -0
index 6051120..b3e506f 100644
@@ -413,6 +413,31 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return 0;
 }
 
+#elif defined(CONFIG_NDS32)
+
+int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	int i;
+	bd_t *bd = gd->bd;
+
+	print_num("arch_number",	bd->bi_arch_number);
+	print_num("boot_params",	(ulong)bd->bi_boot_params);
+
+	for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
+		print_num("DRAM bank",	i);
+		print_num("-> start",	bd->bi_dram[i].start);
+		print_num("-> size",	bd->bi_dram[i].size);
+	}
+
+#if defined(CONFIG_CMD_NET)
+	print_eth(0);
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+#endif
+	printf("baudrate    = %d bps\n", bd->bi_baudrate);
+
+	return 0;
+}
+
 #else
  #error "a case for this architecture does not exist!"
 #endif
common/image.c +1 -0
index d38ce4a..d620b85 100644
@@ -93,6 +93,7 @@ static const table_entry_t uimage_arch[] = {
 	{	IH_ARCH_SPARC64,	"sparc64",	"SPARC 64 Bit",	},
 	{	IH_ARCH_BLACKFIN,	"blackfin",	"Blackfin",	},
 	{	IH_ARCH_AVR32,		"avr32",	"AVR32",	},
+	{	IH_ARCH_NDS32,		"nds32",	"NDS32",	},
 	{	-1,			"",		"",		},
 };
 
include/image.h +1 -0
index cca1cc5..e4c7ab9 100644
@@ -106,6 +106,7 @@
 #define IH_ARCH_BLACKFIN	16	/* Blackfin	*/
 #define IH_ARCH_AVR32		17	/* AVR32	*/
 #define IH_ARCH_ST200	        18	/* STMicroelectronics ST200  */
+#define IH_ARCH_NDS32	        19	/* ANDES Technology - NDS32  */
 
 /*
  * Image Types
Signature · 1 line
1.7.3.5
#134 lore raw

PATCH v15 8/9 adp-ag101: add board adp-ag101 support

In reply to Macpaul Lin

Add evaluation board "adp-ag101" configuration file adp-ag101.h. Add adp-ag101.c board config and related settings.
Add board adp-ag101 into boards.cfg

---
Changes for v1-v4:
- code clean up
Changes for v5-v6:
- Refine the definitions and parameters about CLK,
AHB controller, SDRAM controller, Static memory controllers.
- Add APB_CLK, AHB_CLK, SYS_CLK definitions for backward compatible.
- ftahbc010:
- Update include path of ftahbc010.
- ftsdmc021:
- Update include path of ftsdmc021.
- ftsmc020:
- Update include path of ftsmc020.
- ftwdt010:
- Fix WDT define and update include path.
- Fix ftwdt010 for hardware reset.
- ftpmu010:
- Remove duplicate PMU definitions.
- Add related configurations.
- Fix MAX malloc len and fix saveenv.
- clean up.
Changes for v7:
- clean up.
- Move CONFIG_SYS_TEXT_BASE from board/config.mk.
- Fix Makefile and remove config.mk
Changes for v8:
- No change.
Changes for v9:
- Fix because other boards has been added into boards.cfg and broken this patch.
Changes for v10:
- adp-ag101.h
- Fix lines over 80 characters.
- Fix for introducing gen-asm-offset.
- Add mmc support for FTSDC010 SD/MMC Controller.
- fix flash init.
- fix ftsmc010 configuraion for flash probing.
- Add SP_INIT related configurations for supporting relocation.
- Fix CONFIG_TEXT_BASE for relocation.
- Add CONFIG_MEM_REMAP for some hardware boards and non-OS application.
- adp-ag101.c
- Clean up for braces according to Wolfgang's suggestion.
- Add mmc support for FTSDC010 SD/MMC Controller.
- fix dram init(), made this more simpler.
Changes for v11:
- No change.
Changes for v12:
- adp-ag101.h
- fix address when enable CONFIG_SKIP_LOWLEVEL_INIT
Changes for v13:
- board/AndesTech/adp-ag101/Makefile: remove unused clean and distclean.
Changes for v14:
- No change.
Changes for v15:
- adp-ag101.h: drop NET_MULTI
- Makefile: clean up Makefile

 MAINTAINERS                           |   11 +
 MAKEALL                               |    6 +
 board/AndesTech/adp-ag101/Makefile    |   44 ++++
 board/AndesTech/adp-ag101/adp-ag101.c |   89 +++++++
 boards.cfg                            |    1 +
 include/configs/adp-ag101.h           |  406 +++++++++++++++++++++++++++++++++
 6 files changed, 557 insertions(+), 0 deletions(-)
 create mode 100644 board/AndesTech/adp-ag101/Makefile
 create mode 100644 board/AndesTech/adp-ag101/adp-ag101.c
 create mode 100644 include/configs/adp-ag101.h
MAINTAINERS +11 -0
index 3ab38fa..7009e38 100644
@@ -1120,5 +1120,16 @@ Chong Huang <[email protected]>
 	bf525-ucr2	BF525
 
 #########################################################################
+# NDS32 Systems:							#
+#									#
+# Maintainer Name, Email Address					#
+#	Board		CPU						#
+#########################################################################
+
+Macpaul Lin <[email protected]>
+
+	ADP-AG101	N1213 (AG101 SoC)
+
+#########################################################################
 # End of MAINTAINERS list						#
 #########################################################################
MAKEALL +6 -0
index 52bc355..755e9b7 100755
@@ -481,6 +481,12 @@ LIST_sh="$(boards_by_arch sh)"
 
 LIST_sparc="$(boards_by_arch sparc)"
 
+#########################################################################
+## NDS32 Systems
+#########################################################################
+
+LIST_nds32="$(boards_by_arch nds32)"
+
 #-----------------------------------------------------------------------
 
 build_target() {
board/AndesTech/adp-ag101/Makefile new file +44 -0

44 lines not on this page · raw message

board/AndesTech/adp-ag101/adp-ag101.c new file +89 -0

89 lines not on this page · raw message

boards.cfg +1 -0
index 65482ac..f3685c5 100644
@@ -303,6 +303,7 @@ vct_platinumavc_small        mips        mips32      vct                 microna
 vct_platinumavc_onenand      mips        mips32      vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_ONENAND
 vct_platinumavc_onenand_small mips       mips32      vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_ONENAND,VCT_SMALL_IMAGE
 nios2-generic                nios2       nios2       nios2-generic       altera
+adp-ag101                    nds32       n1213       adp-ag101           AndesTech      ag101
 PCI5441                      nios2       nios2       pci5441             psyent
 PK1C20                       nios2       nios2       pk1c20              psyent
 EVB64260                     powerpc     74xx_7xx    evb64260            -              -           EVB64260
include/configs/adp-ag101.h new file +406 -0

406 lines not on this page · raw message

Signature · 1 line
1.7.3.5
#135 lore raw

PATCH v15 9/9 doc/README: documents and readme for NDS32 arch

In reply to Macpaul Lin

Documents and READMEs for NDS32 architecture.
It patch also provides usage of SoC AG101 and board ADP-AG101.

---
Changes for v1-v10:
- The patch of documentation was not included.
Changes for v11:
- Add the documents of NDS32, ag101, N1213.
Changes for v12-v15:
- No change.

 README                |   24 ++++++++++++++--
 doc/README.N1213      |   55 ++++++++++++++++++++++++++++++++++++
 doc/README.NDS32      |   41 +++++++++++++++++++++++++++
 doc/README.ag101      |   74 +++++++++++++++++++++++++++++++++++++++++++++++++
 doc/README.standalone |    1 +
 5 files changed, 192 insertions(+), 3 deletions(-)
 create mode 100644 doc/README.N1213
 create mode 100644 doc/README.NDS32
 create mode 100644 doc/README.ag101
README +21 -3
index 0868531..2fd7acc 100644
@@ -182,6 +182,10 @@ Directory Hierarchy:
     /cpu		CPU specific files
       /mips32		Files specific to MIPS32 CPUs
     /lib		Architecture specific library files
+  /nds32		Files generic to NDS32 architecture
+    /cpu		CPU specific files
+      /n1213		Files specific to Andes Technology N1213 CPUs
+    /lib		Architecture specific library files
   /nios2		Files generic to Altera NIOS2 architecture
     /cpu		CPU specific files
     /lib		Architecture specific library files
@@ -3154,7 +3158,7 @@ Low Level (hardware related) configuration options:
 		globally (CONFIG_CMD_MEM).
 
 - CONFIG_SKIP_LOWLEVEL_INIT
-		[ARM, MIPS only] If this variable is defined, then certain
+		[ARM, NDS32, MIPS only] If this variable is defined, then certain
 		low level initializations (like setting up the memory
 		controller) are omitted and/or U-Boot does not
 		relocate itself into RAM.
@@ -3702,8 +3706,8 @@ details; basically, the header defines the following image properties:
   Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, LynxOS,
   INTEGRITY).
 * Target CPU Architecture (Provisions for Alpha, ARM, AVR32, Intel x86,
-  IA64, MIPS, Nios II, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
-  Currently supported: ARM, AVR32, Intel x86, MIPS, Nios II, PowerPC).
+  IA64, MIPS, NDS32, Nios II, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
+  Currently supported: ARM, AVR32, Intel x86, MIPS, NDS32, Nios II, PowerPC).
 * Compression Type (uncompressed, gzip, bzip2)
 * Load Address
 * Entry Point
@@ -4396,6 +4400,20 @@ On Nios II, the ABI is documented here:
     Note: on Nios II, we give "-G0" option to gcc and don't use gp
     to access small data sections, so gp is free.
 
+On NDS32, the following registers are used:
+
+	R0-R1:	argument/return
+	R2-R5:	argument
+	R15:	temporary register for assembler
+	R16:	trampoline register
+	R28:	frame pointer (FP)
+	R29:	global pointer (GP)
+	R30:	link register (LP)
+	R31:	stack pointer (SP)
+	PC:	program counter (PC)
+
+    ==> U-Boot will use R10 to hold a pointer to the global data
+
 NOTE: DECLARE_GLOBAL_DATA_PTR must be used with file-global scope,
 or current versions of GCC may "optimize" the code too much.
 
doc/README.N1213 new file +55 -0

55 lines not on this page · raw message

doc/README.NDS32 new file +41 -0

41 lines not on this page · raw message

doc/README.ag101 new file +74 -0

74 lines not on this page · raw message

doc/README.standalone +1 -0
index 6e6b65f..2be5f27 100644
@@ -56,6 +56,7 @@ Design Notes on Exporting U-Boot Functions to Standalone Applications:
 	ARM		0x0c100000	0x0c100000
 	MIPS		0x80200000	0x80200000
 	Blackfin	0x00001000	0x00001000
+	NDS32		0x00300000	0x00300000
 	Nios II		0x02000000	0x02000000
 
    For example, the "hello world" application may be loaded and
Signature · 1 line
1.7.3.5
#136 lore raw

PATCH v12 5/9 nds32/lib: add generic funcs in NDS32 lib

In reply to 馬克泡

Add Makefile, board.c, interrupts.c and bootm.c functions to nds32 architecture.

---
Changes for v1-v4:
- code clean up and formatting style.
Changes for v5-v6:
- board.c
- Do some clean up and add code
- Remove display banner which hasn't support.
- Add ftpmu010 related power management unit code.
- Remove useless LED related code.
- Move SDRAM init to board sepecific files. (ex. adp-ag101.c)
- Remove CONFIG_SOFT_I2C which hasn't been support.
- Remove CONFIG_FSL_ESDHC which hasn't been support.
- clean up.
Changes for v7:
- clean up.
- move single file patch arch/nds32/config.mk to this commit.
- interrupts.c refine origin interrupt enable and disable.
Changes for v8:
- interrups.c: fix up for new ptraces.h.
Changes for v9:
- support CONFIG_STANDALONE_LOAD_ADDR in config.mk
Changes for v10:
- config.mk:
- add -fpie flag.
- replace -ffixed-8 to -ffixed-10.
- add -mrelax and --gc-sections to LDFLAG
- board.c:
- fix lib/board.c for relocation.
- fix dram init for relocation.
Changes for v11:
- arch/nds32/lib/Makefile
- replace $(AR) $(call cmd_link_o_target,...)
Changes for v12:
- config.mk
- remove $(SRCTREE)/$(CPUDIR)/u-boot.lds
- board.c:
- remove obsolelte version_string.
- remove declaration "extern __bss_end" which is not need.
- replace sizeof(gd_t) and sizeof(bd_t) to GENERATED_GBL_DATA_SIZE and GENERATED_BD_INFO_SIZE
- add memset to board info (bd)
- remove compiler optimization barrier which is not need.

 arch/nds32/config.mk        |   35 ++++
 arch/nds32/lib/Makefile     |   52 +++++
 arch/nds32/lib/board.c      |  447 +++++++++++++++++++++++++++++++++++++++++++
 arch/nds32/lib/bootm.c      |  241 +++++++++++++++++++++++
 arch/nds32/lib/interrupts.c |  131 +++++++++++++
 5 files changed, 906 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/config.mk
 create mode 100644 arch/nds32/lib/Makefile
 create mode 100644 arch/nds32/lib/board.c
 create mode 100644 arch/nds32/lib/bootm.c
 create mode 100644 arch/nds32/lib/interrupts.c
arch/nds32/config.mk new file +35 -0
new file mode 100644
index 0000000..c589829
@@ -0,0 +1,35 @@
+#
+# (C) Copyright 2000-2002
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2011
+# Shawn Lin, Andes Technology Corporation <[email protected]>
+# Macpaul Lin, Andes Technology Corporation <[email protected]>
+#
+# 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
+
+CROSS_COMPILE ?= nds32le-linux-
+
+CONFIG_STANDALONE_LOAD_ADDR = 0x300000 -T nds32.lds
+
+PLATFORM_RELFLAGS	+= -fno-strict-aliasing -fno-common -mrelax
+PLATFORM_RELFLAGS	+= -gdwarf-2
+PLATFORM_CPPFLAGS	+= -DCONFIG_NDS32 -D__nds32__ -G0 -ffixed-10 -fpie
+
+LDFLAGS_u-boot		= --gc-sections --relax
arch/nds32/lib/Makefile new file +52 -0

52 lines not on this page · raw message

arch/nds32/lib/board.c new file +447 -0

447 lines not on this page · raw message

arch/nds32/lib/bootm.c new file +241 -0

241 lines not on this page · raw message

arch/nds32/lib/interrupts.c new file +131 -0

131 lines not on this page · raw message

Signature · 1 line
1.7.3.5
#137 lore raw

PATCH v12 5/9 nds32/lib: add generic funcs in NDS32 lib

arch/nds32/lib/Makefile line 43

Quoted 8 lines · On Tuesday, September 06, 2011 22:27:16 Macpaul Lin wrote:
arch/nds32/lib/Makefile new file +5 -0
 
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak .depend

pretty sure neither of these get used, so you should punt both targets

arch/nds32/lib/board.c line 46

Quoted 6 lines
arch/nds32/lib/board.c new file +3 -0
 
+#ifndef CONFIG_IDENT_STRING
+#define CONFIG_IDENT_STRING ""
+#endif

you forgot to delete this too when removing the version_string :)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110908/b46fcea2/attachment-0001.pgp

#138 lore raw

PATCH v12 6/9 nds32: standalone support

In reply to 馬克泡

Add standalone program related support for nds32 architecture.

---
Changes for v1-v6:
- code clean up.
Changes for v7-v11:
- No change.
Changes for v12:
- clean up link script.

 examples/standalone/nds32.lds     |   56 +++++++++++++++++++++++++++++++++++++
 examples/standalone/stubs.c       |   17 ++++++++++-
 examples/standalone/x86-testapp.c |   12 ++++++++
 3 files changed, 84 insertions(+), 1 deletions(-)
 create mode 100644 examples/standalone/nds32.lds
examples/standalone/nds32.lds new file +56 -0
new file mode 100644
index 0000000..50b4c4b
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2011 Andes Technology Corporation
+ * Shawn Lin, Andes Technology Corporation <[email protected]>
+ * Macpaul Lin, Andes Technology Corporation <[email protected]>
+ *
+ * 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-nds32", "elf32-nds32", "elf32-nds32")
+OUTPUT_ARCH(nds32)
+ENTRY(_start)
+SECTIONS
+{
+	. = ALIGN(4);
+	.text :
+	{
+		*(.text)
+	}
+
+	. = ALIGN(4);
+	.data : { *(.data) }
+
+	. = ALIGN(4);
+
+	.got : {
+		__got_start = .;
+		*(.got)
+		__got_end = .;
+	}
+
+	. = ALIGN(4);
+	__bss_start = .;
+	.bss : { *(.bss) }
+	__bss_end = .;
+
+	. = ALIGN(4);
+	.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+
+	_end = .;
+}
examples/standalone/stubs.c +16 -1
index 507d38c..11c7565 100644
@@ -167,8 +167,23 @@ gd_t *global_data;
 "	jmp %%g1\n"					\
 "	nop\n"						\
 	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "g1" );
-
+#elif defined(CONFIG_NDS32)
+/*
+ * r16 holds the pointer to the global_data. gp is call clobbered.
+ * not support reduced register (16 GPR).
+ */
+#define EXPORT_FUNC(x) \
+	asm volatile (			\
+"	.globl " #x "\n"		\
+#x ":\n"				\
+"	lwi	$r16, [$gp + (%0)]\n"	\
+"	lwi	$r16, [$r16 + (%1)]\n"	\
+"	jr	$r16\n"			\
+	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "$r16");
 #else
+/*"	addi	$sp, $sp, -24\n"	\
+"	br	$r16\n"			\*/
+
 #error stubs definition missing for this architecture
 #endif
 
examples/standalone/x86-testapp.c +12 -0
index e8603d9..a4ac6f8 100644
@@ -52,6 +52,16 @@ asm volatile (						\
 "	lw	$25, %1($25)\n"				\
 "	jr	$25\n"					\
 	: : "i"(offsetof(xxx_t, pfunc)), "i"(XF_ ## x * sizeof(void *)) : "t9");
+#elif defined(__nds32__)
+#define EXPORT_FUNC(x)					\
+asm volatile (						\
+"	.globl mon_" #x "\n"				\
+"mon_" #x ":\n"						\
+"	lwi	$r16, [$gp + (%0)]\n"			\
+"	lwi	$r16, [$r16 + (%1)]\n"			\
+"	jr	$r16\n"					\
+	: : "i"(offsetof(xxx_t, pfunc)), "i"(XF_ ## x * sizeof(void *)) : "$r16");
+
 #else
 #error [No stub code for this arch]
 #endif
@@ -72,6 +82,8 @@ int main(void)
 	register volatile xxx_t *pq asm("r8");
 #elif defined(__mips__)
 	register volatile xxx_t *pq asm("k0");
+#elif defined(__nds32__)
+	register volatile xxx_t *pq asm("$r16");
 #endif
 	char buf[32];
 
Signature · 1 line
1.7.3.5
#139 lore raw

PATCH v12 7/9 nds32: common bdinfo, bootm, image support

In reply to 馬克泡

Add support of NDS32 to common commands bdinfo, bootm, and image format.

---
Changes for v1-v6:
- Code clean up
Changes for v7-v9:
- No Change.
Changes for v10:
- fix up according to the changes in master tree.
Changes for v11:
- No Change.
Changes for v12:
- remove seldom used bi_env parameter.

 common/cmd_bdinfo.c |   25 +++++++++++++++++++++++++
 common/cmd_bootm.c  |    2 ++
 common/image.c      |    1 +
 include/image.h     |    5 +++++
 4 files changed, 33 insertions(+), 0 deletions(-)
common/cmd_bdinfo.c +25 -0
index 6051120..b3e506f 100644
@@ -413,6 +413,31 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return 0;
 }
 
+#elif defined(CONFIG_NDS32)
+
+int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	int i;
+	bd_t *bd = gd->bd;
+
+	print_num("arch_number",	bd->bi_arch_number);
+	print_num("boot_params",	(ulong)bd->bi_boot_params);
+
+	for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
+		print_num("DRAM bank",	i);
+		print_num("-> start",	bd->bi_dram[i].start);
+		print_num("-> size",	bd->bi_dram[i].size);
+	}
+
+#if defined(CONFIG_CMD_NET)
+	print_eth(0);
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+#endif
+	printf("baudrate    = %d bps\n", bd->bi_baudrate);
+
+	return 0;
+}
+
 #else
  #error "a case for this architecture does not exist!"
 #endif
common/cmd_bootm.c +2 -0
index 8909ee7..844be80 100644
@@ -187,6 +187,8 @@ void arch_preboot_os(void) __attribute__((weak, alias("__arch_preboot_os")));
   #define IH_INITRD_ARCH IH_ARCH_SH
 #elif defined(__sparc__)
   #define IH_INITRD_ARCH IH_ARCH_SPARC
+#elif defined(__nds32__)
+  #define IH_INITRD_ARCH IH_ARCH_NDS32
 #else
 # error Unknown CPU type
 #endif
common/image.c +1 -0
index 5eea2a1..95e16b8 100644
@@ -93,6 +93,7 @@ static const table_entry_t uimage_arch[] = {
 	{	IH_ARCH_SPARC64,	"sparc64",	"SPARC 64 Bit",	},
 	{	IH_ARCH_BLACKFIN,	"blackfin",	"Blackfin",	},
 	{	IH_ARCH_AVR32,		"avr32",	"AVR32",	},
+	{	IH_ARCH_NDS32,		"nds32",	"NDS32",	},
 	{	-1,			"",		"",		},
 };
 
include/image.h +5 -0
index 352e4a0..dcbbc8b 100644
@@ -106,6 +106,7 @@
 #define IH_ARCH_BLACKFIN	16	/* Blackfin	*/
 #define IH_ARCH_AVR32		17	/* AVR32	*/
 #define IH_ARCH_ST200	        18	/* STMicroelectronics ST200  */
+#define IH_ARCH_NDS32	        19	/* ANDES Technology - NDS32  */
 
 /*
  * Image Types
@@ -506,6 +507,8 @@ static inline int image_check_target_arch (const image_header_t *hdr)
 	if (!image_check_arch (hdr, IH_ARCH_SH))
 #elif defined(__sparc__)
 	if (!image_check_arch (hdr, IH_ARCH_SPARC))
+#elif defined(__nds32__)
+	if (!image_check_arch(hdr, IH_ARCH_NDS32))
 #else
 # error Unknown CPU type
 #endif
@@ -658,6 +661,8 @@ static inline int fit_image_check_target_arch (const void *fdt, int node)
 	if (!fit_image_check_arch (fdt, node, IH_ARCH_SH))
 #elif defined(__sparc__)
 	if (!fit_image_check_arch (fdt, node, IH_ARCH_SPARC))
+#elif defined(__nds32__)
+	if (!fit_image_check_arch(fdt, node, IH_ARCH_NDS32))
 #else
 # error Unknown CPU type
 #endif
Signature · 1 line
1.7.3.5
#140 lore raw

PATCH v12 8/9 adp-ag101: add board adp-ag101 support

In reply to 馬克泡

Add evaluation board "adp-ag101" configuration file adp-ag101.h. Add adp-ag101.c board config and related settings.
Add board adp-ag101 into boards.cfg

---
Changes for v1-v4:
- code clean up
Changes for v5-v6:
- Refine the definitions and parameters about CLK,
AHB controller, SDRAM controller, Static memory controllers.
- Add APB_CLK, AHB_CLK, SYS_CLK definitions for backward compatible.
- ftahbc010:
- Update include path of ftahbc010.
- ftsdmc021:
- Update include path of ftsdmc021.
- ftsmc020:
- Update include path of ftsmc020.
- ftwdt010:
- Fix WDT define and update include path.
- Fix ftwdt010 for hardware reset.
- ftpmu010:
- Remove duplicate PMU definitions.
- Add related configurations.
- Fix MAX malloc len and fix saveenv.
- clean up.
Changes for v7:
- clean up.
- Move CONFIG_SYS_TEXT_BASE from board/config.mk.
- Fix Makefile and remove config.mk
Changes for v8:
- No change.
Changes for v9:
- Fix because other boards has been added into boards.cfg and broken this patch.
Changes for v10:
- adp-ag101.h
- Fix lines over 80 characters.
- Fix for introducing gen-asm-offset.
- Add mmc support for FTSDC010 SD/MMC Controller.
- fix flash init.
- fix ftsmc010 configuraion for flash probing.
- Add SP_INIT related configurations for supporting relocation.
- Fix CONFIG_TEXT_BASE for relocation.
- Add CONFIG_MEM_REMAP for some hardware boards and non-OS application.
- adp-ag101.c
- Clean up for braces according to Wolfgang's suggestion.
- Add mmc support for FTSDC010 SD/MMC Controller.
- fix dram init(), made this more simpler.
Changes for v11:
- No Change.
Changes for v12:
- adp-ag101.h
- fix address when enable CONFIG_SKIP_LOWLEVEL_INIT

 MAINTAINERS                           |   11 +
 MAKEALL                               |    6 +
 board/AndesTech/adp-ag101/Makefile    |   57 +++++
 board/AndesTech/adp-ag101/adp-ag101.c |   89 +++++++
 boards.cfg                            |    1 +
 include/configs/adp-ag101.h           |  407 +++++++++++++++++++++++++++++++++
 6 files changed, 571 insertions(+), 0 deletions(-)
 create mode 100644 board/AndesTech/adp-ag101/Makefile
 create mode 100644 board/AndesTech/adp-ag101/adp-ag101.c
 create mode 100644 include/configs/adp-ag101.h
MAINTAINERS +11 -0
index 3bfe3fb..fc84f1f 100644
@@ -1148,5 +1148,16 @@ Chong Huang <[email protected]>
 	bf525-ucr2	BF525
 
 #########################################################################
+# NDS32 Systems:							#
+#									#
+# Maintainer Name, Email Address					#
+#	Board		CPU						#
+#########################################################################
+
+Macpaul Lin <[email protected]>
+
+	ADP-AG101	N1213 (AG101 SoC)
+
+#########################################################################
 # End of MAINTAINERS list						#
 #########################################################################
MAKEALL +6 -0
index e72a019..6a3580b 100755
@@ -537,6 +537,12 @@ LIST_sh="$(boards_by_arch sh)"
 
 LIST_sparc="$(boards_by_arch sparc)"
 
+#########################################################################
+## NDS32 Systems
+#########################################################################
+
+LIST_nds32="$(boards_by_arch nds32)"
+
 #-----------------------------------------------------------------------
 
 build_target() {
board/AndesTech/adp-ag101/Makefile new file +57 -0

57 lines not on this page · raw message

board/AndesTech/adp-ag101/adp-ag101.c new file +89 -0

89 lines not on this page · raw message

boards.cfg +1 -0
index 60723d5..f70fd00 100644
@@ -309,6 +309,7 @@ vct_platinumavc_small        mips        mips32      vct                 microna
 vct_platinumavc_onenand      mips        mips32      vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_ONENAND
 vct_platinumavc_onenand_small mips       mips32      vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_ONENAND,VCT_SMALL_IMAGE
 nios2-generic                nios2       nios2       nios2-generic       altera
+adp-ag101                    nds32       n1213       adp-ag101           AndesTech      ag101
 PCI5441                      nios2       nios2       pci5441             psyent
 PK1C20                       nios2       nios2       pk1c20              psyent
 EVB64260                     powerpc     74xx_7xx    evb64260            -              -           EVB64260
include/configs/adp-ag101.h new file +407 -0

407 lines not on this page · raw message

Signature · 1 line
1.7.3.5
#141 lore raw

PATCH v12 8/9 adp-ag101: add board adp-ag101 support

board/AndesTech/adp-ag101/Makefile line 42

Quoted 8 lines · On Tuesday, September 06, 2011 22:27:19 Macpaul Lin wrote:
board/AndesTech/adp-ag101/Makefile new file +5 -0
 
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak $(obj).depend

i think both of these are unused, so punt them

board/AndesTech/adp-ag101/Makefile line 48

Quoted 5 lines
board/AndesTech/adp-ag101/Makefile new file +5 -0
+ifdef CONFIG_SYS_LDSCRIPT
+LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
+else
+LDSCRIPT := $(SRCTREE)/arch/$(ARCH)/cpu/$(CPU)/u-boot.lds
+endif

i dont think defining LDSCRIPT in the board Makefile does anything (would only really matter if it was in config.mk). so punt this.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110908/fc4644aa/attachment.pgp

#142 lore raw

PATCH v12 9/9 doc/README: documents and readme for NDS32 arch

In reply to 馬克泡

Documents and READMEs for NDS32 architecture.
It patch also provides usage of SoC AG101 and board ADP-AG101.

---
Changes for v1-v10:
- The patch of documentation was not included.
Changes for v11:
- Add the documents of NDS32, ag101, N1213.
Changes for v12:
- No change.

 README                |   24 ++++++++++++++--
 doc/README.N1213      |   55 ++++++++++++++++++++++++++++++++++++
 doc/README.NDS32      |   41 +++++++++++++++++++++++++++
 doc/README.ag101      |   74 +++++++++++++++++++++++++++++++++++++++++++++++++
 doc/README.standalone |    1 +
 5 files changed, 192 insertions(+), 3 deletions(-)
 create mode 100644 doc/README.N1213
 create mode 100644 doc/README.NDS32
 create mode 100644 doc/README.ag101
README +21 -3
index 0886987..381e1e2 100644
@@ -182,6 +182,10 @@ Directory Hierarchy:
     /cpu		CPU specific files
       /mips32		Files specific to MIPS32 CPUs
     /lib		Architecture specific library files
+  /nds32		Files generic to NDS32 architecture
+    /cpu		CPU specific files
+      /n1213		Files specific to Andes Technology N1213 CPUs
+    /lib		Architecture specific library files
   /nios2		Files generic to Altera NIOS2 architecture
     /cpu		CPU specific files
     /lib		Architecture specific library files
@@ -3103,7 +3107,7 @@ Low Level (hardware related) configuration options:
 		globally (CONFIG_CMD_MEM).
 
 - CONFIG_SKIP_LOWLEVEL_INIT
-		[ARM, MIPS only] If this variable is defined, then certain
+		[ARM, NDS32, MIPS only] If this variable is defined, then certain
 		low level initializations (like setting up the memory
 		controller) are omitted and/or U-Boot does not
 		relocate itself into RAM.
@@ -3653,8 +3657,8 @@ details; basically, the header defines the following image properties:
   Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, LynxOS,
   INTEGRITY).
 * Target CPU Architecture (Provisions for Alpha, ARM, AVR32, Intel x86,
-  IA64, MIPS, Nios II, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
-  Currently supported: ARM, AVR32, Intel x86, MIPS, Nios II, PowerPC).
+  IA64, MIPS, NDS32, Nios II, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
+  Currently supported: ARM, AVR32, Intel x86, MIPS, NDS32, Nios II, PowerPC).
 * Compression Type (uncompressed, gzip, bzip2)
 * Load Address
 * Entry Point
@@ -4347,6 +4351,20 @@ On Nios II, the ABI is documented here:
     Note: on Nios II, we give "-G0" option to gcc and don't use gp
     to access small data sections, so gp is free.
 
+On NDS32, the following registers are used:
+
+	R0-R1:	argument/return
+	R2-R5:	argument
+	R15:	temporary register for assembler
+	R16:	trampoline register
+	R28:	frame pointer (FP)
+	R29:	global pointer (GP)
+	R30:	link register (LP)
+	R31:	stack pointer (SP)
+	PC:	program counter (PC)
+
+    ==> U-Boot will use R10 to hold a pointer to the global data
+
 NOTE: DECLARE_GLOBAL_DATA_PTR must be used with file-global scope,
 or current versions of GCC may "optimize" the code too much.
 
doc/README.N1213 new file +55 -0

55 lines not on this page · raw message

doc/README.NDS32 new file +41 -0

41 lines not on this page · raw message

doc/README.ag101 new file +74 -0

74 lines not on this page · raw message

doc/README.standalone +1 -0
index 6e6b65f..2be5f27 100644
@@ -56,6 +56,7 @@ Design Notes on Exporting U-Boot Functions to Standalone Applications:
 	ARM		0x0c100000	0x0c100000
 	MIPS		0x80200000	0x80200000
 	Blackfin	0x00001000	0x00001000
+	NDS32		0x00300000	0x00300000
 	Nios II		0x02000000	0x02000000
 
    For example, the "hello world" application may be loaded and
Signature · 1 line
1.7.3.5
#143 lore raw

PATCH v11 6/9 nds32: standalone support

In reply to Macpaul Lin

Add standalone program related support for nds32 architecture.

---
Changes for v1-v6:
- code clean up.
Changes for v7-v11:
- No change.

 examples/standalone/nds32.lds     |   64 +++++++++++++++++++++++++++++++++++++
 examples/standalone/stubs.c       |   17 +++++++++-
 examples/standalone/x86-testapp.c |   12 +++++++
 3 files changed, 92 insertions(+), 1 deletions(-)
 create mode 100644 examples/standalone/nds32.lds
examples/standalone/nds32.lds new file +64 -0
new file mode 100644
index 0000000..c2ac107
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2011 Andes Technology Corporation
+ * Shawn Lin, Andes Technology Corporation <[email protected]>
+ * Macpaul Lin, Andes Technology Corporation <[email protected]>
+ *
+ * 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-nds32", "elf32-nds32", "elf32-nds32")
+OUTPUT_ARCH(nds32)
+ENTRY(_start)
+SECTIONS
+{
+	. = 0x00000000;
+
+	. = ALIGN(4);
+	.text :
+	{
+		*(.text)
+	}
+
+	. = ALIGN(4);
+	.data : { *(.data) }
+
+	. = ALIGN(4);
+	.data : { *(.data) }
+
+	. = ALIGN(4);
+
+	.got : {
+		__got_start = .;
+		*(.got)
+		__got_end = .;
+	}
+
+	. = ALIGN(4);
+	__bss_start = .;
+	.bss : { *(.bss) }
+	__bss_end = .;
+
+	. = ALIGN(4);
+	.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+
+	_end = .;
+
+	. = 0x02000000;
+	.u_boot_ohci_data_st : { *(.u_boot_ohci_data_st) }
+}
examples/standalone/stubs.c +16 -1
index 507d38c..11c7565 100644
@@ -167,8 +167,23 @@ gd_t *global_data;
 "	jmp %%g1\n"					\
 "	nop\n"						\
 	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "g1" );
-
+#elif defined(CONFIG_NDS32)
+/*
+ * r16 holds the pointer to the global_data. gp is call clobbered.
+ * not support reduced register (16 GPR).
+ */
+#define EXPORT_FUNC(x) \
+	asm volatile (			\
+"	.globl " #x "\n"		\
+#x ":\n"				\
+"	lwi	$r16, [$gp + (%0)]\n"	\
+"	lwi	$r16, [$r16 + (%1)]\n"	\
+"	jr	$r16\n"			\
+	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "$r16");
 #else
+/*"	addi	$sp, $sp, -24\n"	\
+"	br	$r16\n"			\*/
+
 #error stubs definition missing for this architecture
 #endif
 
examples/standalone/x86-testapp.c +12 -0
index e8603d9..a4ac6f8 100644
@@ -52,6 +52,16 @@ asm volatile (						\
 "	lw	$25, %1($25)\n"				\
 "	jr	$25\n"					\
 	: : "i"(offsetof(xxx_t, pfunc)), "i"(XF_ ## x * sizeof(void *)) : "t9");
+#elif defined(__nds32__)
+#define EXPORT_FUNC(x)					\
+asm volatile (						\
+"	.globl mon_" #x "\n"				\
+"mon_" #x ":\n"						\
+"	lwi	$r16, [$gp + (%0)]\n"			\
+"	lwi	$r16, [$r16 + (%1)]\n"			\
+"	jr	$r16\n"					\
+	: : "i"(offsetof(xxx_t, pfunc)), "i"(XF_ ## x * sizeof(void *)) : "$r16");
+
 #else
 #error [No stub code for this arch]
 #endif
@@ -72,6 +82,8 @@ int main(void)
 	register volatile xxx_t *pq asm("r8");
 #elif defined(__mips__)
 	register volatile xxx_t *pq asm("k0");
+#elif defined(__nds32__)
+	register volatile xxx_t *pq asm("$r16");
 #endif
 	char buf[32];
 
Signature · 1 line
1.7.3.5
#144 lore raw

PATCH v11 7/9 nds32: common bdinfo, bootm, image support

In reply to Macpaul Lin

Add support of NDS32 to common commands bdinfo, bootm, and image format.

---
Changes for v1-v6:
- Code clean up
Changes for v7-v9:
- No Change.
Changes for v10:
- fix up according to the changes in master tree.
Changes for v11:
- No Change.

 common/cmd_bdinfo.c |   26 ++++++++++++++++++++++++++
 common/cmd_bootm.c  |    2 ++
 common/image.c      |    1 +
 include/image.h     |    5 +++++
 4 files changed, 34 insertions(+), 0 deletions(-)
common/cmd_bdinfo.c +26 -0
index 6051120..52102db 100644
@@ -413,6 +413,32 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return 0;
 }
 
+#elif defined(CONFIG_NDS32)
+
+int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	int i;
+	bd_t *bd = gd->bd;
+
+	print_num("arch_number",	bd->bi_arch_number);
+	print_num("env_t",		(ulong)bd->bi_env);
+	print_num("boot_params",	(ulong)bd->bi_boot_params);
+
+	for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
+		print_num("DRAM bank",	i);
+		print_num("-> start",	bd->bi_dram[i].start);
+		print_num("-> size",	bd->bi_dram[i].size);
+	}
+
+#if defined(CONFIG_CMD_NET)
+	print_eth(0);
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+#endif
+	printf("baudrate    = %d bps\n", bd->bi_baudrate);
+
+	return 0;
+}
+
 #else
  #error "a case for this architecture does not exist!"
 #endif
common/cmd_bootm.c +2 -0
index 272d879..99ec547 100644
@@ -187,6 +187,8 @@ void arch_preboot_os(void) __attribute__((weak, alias("__arch_preboot_os")));
   #define IH_INITRD_ARCH IH_ARCH_SH
 #elif defined(__sparc__)
   #define IH_INITRD_ARCH IH_ARCH_SPARC
+#elif defined(__nds32__)
+  #define IH_INITRD_ARCH IH_ARCH_NDS32
 #else
 # error Unknown CPU type
 #endif
common/image.c +1 -0
index 5eea2a1..95e16b8 100644
@@ -93,6 +93,7 @@ static const table_entry_t uimage_arch[] = {
 	{	IH_ARCH_SPARC64,	"sparc64",	"SPARC 64 Bit",	},
 	{	IH_ARCH_BLACKFIN,	"blackfin",	"Blackfin",	},
 	{	IH_ARCH_AVR32,		"avr32",	"AVR32",	},
+	{	IH_ARCH_NDS32,		"nds32",	"NDS32",	},
 	{	-1,			"",		"",		},
 };
 
include/image.h +5 -0
index 352e4a0..dcbbc8b 100644
@@ -106,6 +106,7 @@
 #define IH_ARCH_BLACKFIN	16	/* Blackfin	*/
 #define IH_ARCH_AVR32		17	/* AVR32	*/
 #define IH_ARCH_ST200	        18	/* STMicroelectronics ST200  */
+#define IH_ARCH_NDS32	        19	/* ANDES Technology - NDS32  */
 
 /*
  * Image Types
@@ -506,6 +507,8 @@ static inline int image_check_target_arch (const image_header_t *hdr)
 	if (!image_check_arch (hdr, IH_ARCH_SH))
 #elif defined(__sparc__)
 	if (!image_check_arch (hdr, IH_ARCH_SPARC))
+#elif defined(__nds32__)
+	if (!image_check_arch(hdr, IH_ARCH_NDS32))
 #else
 # error Unknown CPU type
 #endif
@@ -658,6 +661,8 @@ static inline int fit_image_check_target_arch (const void *fdt, int node)
 	if (!fit_image_check_arch (fdt, node, IH_ARCH_SH))
 #elif defined(__sparc__)
 	if (!fit_image_check_arch (fdt, node, IH_ARCH_SPARC))
+#elif defined(__nds32__)
+	if (!fit_image_check_arch(fdt, node, IH_ARCH_NDS32))
 #else
 # error Unknown CPU type
 #endif
Signature · 1 line
1.7.3.5
#145 lore raw

PATCH v11 8/9 adp-ag101: add board adp-ag101 support

In reply to Macpaul Lin

Add evaluation board "adp-ag101" configuration file adp-ag101.h. Add adp-ag101.c board config and related settings.
Add board adp-ag101 into boards.cfg

---
Changes for v1-v4:
- code clean up
Changes for v5-v6:
- Refine the definitions and parameters about CLK,
AHB controller, SDRAM controller, Static memory controllers.
- Add APB_CLK, AHB_CLK, SYS_CLK definitions for backward compatible.
- ftahbc010:
- Update include path of ftahbc010.
- ftsdmc021:
- Update include path of ftsdmc021.
- ftsmc020:
- Update include path of ftsmc020.
- ftwdt010:
- Fix WDT define and update include path.
- Fix ftwdt010 for hardware reset.
- ftpmu010:
- Remove duplicate PMU definitions.
- Add related configurations.
- Fix MAX malloc len and fix saveenv.
- clean up.
Changes for v7:
- clean up.
- Move CONFIG_SYS_TEXT_BASE from board/config.mk.
- Fix Makefile and remove config.mk
Changes for v8:
- No change.
Changes for v9:
- Fix because other boards has been added into boards.cfg and broken this patch.
Changes for v10:
- adp-ag101.h
- Fix lines over 80 characters.
- Fix for introducing gen-asm-offset.
- Add mmc support for FTSDC010 SD/MMC Controller.
- fix flash init.
- fix ftsmc010 configuraion for flash probing.
- Add SP_INIT related configurations for supporting relocation.
- Fix CONFIG_TEXT_BASE for relocation.
- Add CONFIG_MEM_REMAP for some hardware boards and non-OS application.
- adp-ag101.c
- Clean up for braces according to Wolfgang's suggestion.
- Add mmc support for FTSDC010 SD/MMC Controller.
- fix dram init(), made this more simpler.
Changes for v11:
- No Change.

 MAINTAINERS                           |   11 +
 MAKEALL                               |    6 +
 board/AndesTech/adp-ag101/Makefile    |   57 +++++
 board/AndesTech/adp-ag101/adp-ag101.c |   89 +++++++
 boards.cfg                            |    1 +
 include/configs/adp-ag101.h           |  411 +++++++++++++++++++++++++++++++++
 6 files changed, 575 insertions(+), 0 deletions(-)
 create mode 100644 board/AndesTech/adp-ag101/Makefile
 create mode 100644 board/AndesTech/adp-ag101/adp-ag101.c
 create mode 100644 include/configs/adp-ag101.h
MAINTAINERS +11 -0
index 7982c36..6b7c664 100644
@@ -1162,5 +1162,16 @@ Chong Huang <[email protected]>
 	bf525-ucr2	BF525
 
 #########################################################################
+# NDS32 Systems:							#
+#									#
+# Maintainer Name, Email Address					#
+#	Board		CPU						#
+#########################################################################
+
+Macpaul Lin <[email protected]>
+
+	ADP-AG101	N1213 (AG101 SoC)
+
+#########################################################################
 # End of MAINTAINERS list						#
 #########################################################################
MAKEALL +6 -0
index 3b98f03..232ed3b 100755
@@ -600,6 +600,12 @@ LIST_sh="$(boards_by_arch sh)"
 
 LIST_sparc="$(boards_by_arch sparc)"
 
+#########################################################################
+## NDS32 Systems
+#########################################################################
+
+LIST_nds32="$(boards_by_arch nds32)"
+
 #-----------------------------------------------------------------------
 
 build_target() {
board/AndesTech/adp-ag101/Makefile new file +57 -0

57 lines not on this page · raw message

board/AndesTech/adp-ag101/adp-ag101.c new file +89 -0

89 lines not on this page · raw message

boards.cfg +1 -0
index c253f03..ce01cda 100644
@@ -308,6 +308,7 @@ vct_platinumavc_small        mips        mips32      vct                 microna
 vct_platinumavc_onenand      mips        mips32      vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_ONENAND
 vct_platinumavc_onenand_small mips       mips32      vct                 micronas       -           vct:VCT_PLATINUMAVC,VCT_ONENAND,VCT_SMALL_IMAGE
 nios2-generic                nios2       nios2       nios2-generic       altera
+adp-ag101                    nds32       n1213       adp-ag101           AndesTech      ag101
 PCI5441                      nios2       nios2       pci5441             psyent
 PK1C20                       nios2       nios2       pk1c20              psyent
 EVB64260                     powerpc     74xx_7xx    evb64260            -              -           EVB64260
include/configs/adp-ag101.h new file +411 -0

411 lines not on this page · raw message

Signature · 1 line
1.7.3.5
#146 lore raw

PATCH v11 9/9 doc/README: documents and readme for NDS32 arch

In reply to Macpaul Lin

Documents and READMEs for NDS32 architecture.
It patch also provides usage of SoC AG101 and board ADP-AG101.

---
Changes for v1-v10:
- The patch of documentation was not included.
Changes for v11:
- Add the documents of NDS32, ag101, N1213.

 README                |   24 ++++++++++++++--
 doc/README.N1213      |   55 ++++++++++++++++++++++++++++++++++++
 doc/README.NDS32      |   41 +++++++++++++++++++++++++++
 doc/README.ag101      |   74 +++++++++++++++++++++++++++++++++++++++++++++++++
 doc/README.standalone |    1 +
 5 files changed, 192 insertions(+), 3 deletions(-)
 create mode 100644 doc/README.N1213
 create mode 100644 doc/README.NDS32
 create mode 100644 doc/README.ag101
README +21 -3
index 0886987..381e1e2 100644
@@ -182,6 +182,10 @@ Directory Hierarchy:
     /cpu		CPU specific files
       /mips32		Files specific to MIPS32 CPUs
     /lib		Architecture specific library files
+  /nds32		Files generic to NDS32 architecture
+    /cpu		CPU specific files
+      /n1213		Files specific to Andes Technology N1213 CPUs
+    /lib		Architecture specific library files
   /nios2		Files generic to Altera NIOS2 architecture
     /cpu		CPU specific files
     /lib		Architecture specific library files
@@ -3103,7 +3107,7 @@ Low Level (hardware related) configuration options:
 		globally (CONFIG_CMD_MEM).
 
 - CONFIG_SKIP_LOWLEVEL_INIT
-		[ARM, MIPS only] If this variable is defined, then certain
+		[ARM, NDS32, MIPS only] If this variable is defined, then certain
 		low level initializations (like setting up the memory
 		controller) are omitted and/or U-Boot does not
 		relocate itself into RAM.
@@ -3653,8 +3657,8 @@ details; basically, the header defines the following image properties:
   Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, LynxOS,
   INTEGRITY).
 * Target CPU Architecture (Provisions for Alpha, ARM, AVR32, Intel x86,
-  IA64, MIPS, Nios II, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
-  Currently supported: ARM, AVR32, Intel x86, MIPS, Nios II, PowerPC).
+  IA64, MIPS, NDS32, Nios II, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
+  Currently supported: ARM, AVR32, Intel x86, MIPS, NDS32, Nios II, PowerPC).
 * Compression Type (uncompressed, gzip, bzip2)
 * Load Address
 * Entry Point
@@ -4347,6 +4351,20 @@ On Nios II, the ABI is documented here:
     Note: on Nios II, we give "-G0" option to gcc and don't use gp
     to access small data sections, so gp is free.
 
+On NDS32, the following registers are used:
+
+	R0-R1:	argument/return
+	R2-R5:	argument
+	R15:	temporary register for assembler
+	R16:	trampoline register
+	R28:	frame pointer (FP)
+	R29:	global pointer (GP)
+	R30:	link register (LP)
+	R31:	stack pointer (SP)
+	PC:	program counter (PC)
+
+    ==> U-Boot will use R10 to hold a pointer to the global data
+
 NOTE: DECLARE_GLOBAL_DATA_PTR must be used with file-global scope,
 or current versions of GCC may "optimize" the code too much.
 
doc/README.N1213 new file +55 -0

55 lines not on this page · raw message

doc/README.NDS32 new file +41 -0

41 lines not on this page · raw message

doc/README.ag101 new file +74 -0

74 lines not on this page · raw message

doc/README.standalone +1 -0
index 6e6b65f..2be5f27 100644
@@ -56,6 +56,7 @@ Design Notes on Exporting U-Boot Functions to Standalone Applications:
 	ARM		0x0c100000	0x0c100000
 	MIPS		0x80200000	0x80200000
 	Blackfin	0x00001000	0x00001000
+	NDS32		0x00300000	0x00300000
 	Nios II		0x02000000	0x02000000
 
    For example, the "hello world" application may be loaded and
Signature · 1 line
1.7.3.5