Skip to contentSkip to conversation

Reintegration of ns9750

U-Boot soderstrom.rikard at gmail.com 3 participants 6 messages Mar 21, 2014 – Jun 8, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

From: Rikard S?derstr?m <[email protected]>

This patch is an RFC.

ns9750 was removed in commit 4cfc611b4a4ce009cfad46804bec2a1caad8e329, this is an attempt to make it work again. Comparing the files from removal revision and current, there are changes made
in board/ns9750dev/ns9750dev.c and in include/configs/ns9750dev.h
Currently this fails at linkage stage.

---
 arch/arm/cpu/arm926ejs/ns9750/Makefile |   8 +
 arch/arm/cpu/arm926ejs/ns9750/reset.S  |  29 ++
 arch/arm/cpu/arm926ejs/ns9750/timer.c  |  16 ++
 board/ns9750dev/Makefile               |   9 +
 board/ns9750dev/flash.c                | 474 +++++++++++++++++++++++++++++++++
 board/ns9750dev/led.c                  |  46 ++++
 board/ns9750dev/lowlevel_init.S        | 298 +++++++++++++++++++++
 board/ns9750dev/ns9750dev.c            | 127 +++++++++
 boards.cfg                             |   1 +
 doc/README.ns9750dev                   |  36 +++
 drivers/serial/Makefile                |   1 +
 drivers/serial/ns9750_serial.c         | 219 +++++++++++++++
 drivers/serial/serial.c                |   2 +
 include/configs/ns9750dev.h            | 201 ++++++++++++++
 include/ns9750_bbus.h                  | 125 +++++++++
 include/ns9750_mem.h                   | 172 ++++++++++++
 include/ns9750_ser.h                   | 202 ++++++++++++++
 include/ns9750_sys.h                   | 215 +++++++++++++++
 18 files changed, 2181 insertions(+)
 create mode 100644 arch/arm/cpu/arm926ejs/ns9750/Makefile
 create mode 100644 arch/arm/cpu/arm926ejs/ns9750/reset.S
 create mode 100644 arch/arm/cpu/arm926ejs/ns9750/timer.c
 create mode 100644 board/ns9750dev/Makefile
 create mode 100644 board/ns9750dev/flash.c
 create mode 100644 board/ns9750dev/led.c
 create mode 100644 board/ns9750dev/lowlevel_init.S
 create mode 100644 board/ns9750dev/ns9750dev.c
 create mode 100644 doc/README.ns9750dev
 create mode 100644 drivers/serial/ns9750_serial.c
 create mode 100644 include/configs/ns9750dev.h
 create mode 100644 include/ns9750_bbus.h
 create mode 100644 include/ns9750_mem.h
 create mode 100644 include/ns9750_ser.h
 create mode 100644 include/ns9750_sys.h
arch/arm/cpu/arm926ejs/ns9750/Makefile new file +8 -0
new file mode 100644
index 0000000..5a1f05c
@@ -0,0 +1,8 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	+= reset.o timer.o
arch/arm/cpu/arm926ejs/ns9750/reset.S new file +29 -0
new file mode 100644
index 0000000..1c557b0
@@ -0,0 +1,29 @@
+/*
+ *  armboot - Startup Code for ARM926EJS CPU-core
+ *
+ *  Copyright (c) 2003  Texas Instruments
+ *
+ *  ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------
+ *
+ *  Copyright (c) 2001	Marius Gr?ger <[email protected]>
+ *  Copyright (c) 2002	Alex Z?pke <[email protected]>
+ *  Copyright (c) 2002	Gary Jennejohn <[email protected]>
+ *  Copyright (c) 2003	Richard Woodruff <[email protected]>
+ *  Copyright (c) 2003	Kshitij <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+	.align	5
+.globl reset_cpu
+reset_cpu:
+	ldr	r1, rstctl1	/* get clkm1 reset ctl */
+	mov	r3, #0x0
+	strh	r3, [r1]	/* clear it */
+	mov	r3, #0x8
+	strh	r3, [r1]	/* force dsp+arm reset */
+_loop_forever:
+	b	_loop_forever
+
+rstctl1:
+	.word	0xfffece10
arch/arm/cpu/arm926ejs/ns9750/timer.c new file +16 -0
new file mode 100644
index 0000000..00e6c1e
@@ -0,0 +1,16 @@
+/*
+ * (C) Copyright 2014
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+
+/*
+ * This function is derived from PowerPC code (timebase clock frequency).
+ * On ARM it returns the number of timer ticks per second.
+ */
+ulong get_tbclk (void)
+{
+	return CONFIG_SYS_HZ;
+}
board/ns9750dev/Makefile new file +9 -0
new file mode 100644
index 0000000..bc8c08c
@@ -0,0 +1,9 @@
+#
+# (C) Copyright 2003-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	= ns9750dev.o flash.o led.o
+obj-y	+= lowlevel_init.o
board/ns9750dev/flash.c new file +474 -0

474 lines not on this page · raw message

board/ns9750dev/led.c new file +46 -0

46 lines not on this page · raw message

board/ns9750dev/lowlevel_init.S new file +298 -0

298 lines not on this page · raw message

board/ns9750dev/ns9750dev.c new file +127 -0

127 lines not on this page · raw message

boards.cfg +1 -0
index 69c8936..f51df51 100644
@@ -323,6 +323,7 @@ Active  arm         armv7          mx6         freescale       mx6sabresd
 Active  arm         armv7          mx6         freescale       mx6sabresd          mx6qsabresd                          mx6sabresd:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q                                                           Fabio Estevam <[email protected]>
 Active  arm         armv7          mx6         freescale       mx6slevk            mx6slevk                             mx6slevk:IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL                                                                   Fabio Estevam <[email protected]>
 Active  arm         armv7          mx6         solidrun        hummingboard        hummingboard_solo                    hummingboard:IMX_CONFIG=board/solidrun/hummingboard/solo.cfg,MX6S,DDR_MB=512                                                      Jon Nettleton <[email protected]>
+Active  arm         arm926ejs      ns9750      -               ns9750dev           ns9750dev                            -                                                                                                                                 -
 Active  arm         armv7          omap3       -               overo               omap3_overo                          -                                                                                                                                 Steve Sakoman <[email protected]>
 Active  arm         armv7          omap3       -               pandora             omap3_pandora                        -                                                                                                                                 Grazvydas Ignotas <[email protected]>
 Active  arm         armv7          omap3       8dtech          eco5pk              eco5pk                               -                                                                                                                                 Raphael Assenat <[email protected]>
doc/README.ns9750dev new file +36 -0
new file mode 100644
index 0000000..2991440
@@ -0,0 +1,36 @@
+U-Boot Port to the NS9750 DevKit from NetSilicon
+
+1 Overview
+2 Board Configuration
+3 Installation
+
+
+1 Overview
+----------
+
+This port supports these NS9750 features.
+
+o one UART
+
+2 Board Configuration
+---------------------
+
+Switches:
+SW10: 4
+SW11: 6,7
+SW16: 6,7,8
+SW17-SW20: 1
+SW4: 3, 6
+SW 1: 1
+SW2: 4
+SW3: 3
+SW8: 3 (rotated by 180 degree!!!!)
+
+Serial Console is Port B (bottom right port)
+
+3 Installation
+--------------
+
+Have fun,
+--
+Markus Pietrek <[email protected]>
drivers/serial/Makefile +1 -0
index 571c18f..6d75745 100644
@@ -13,6 +13,7 @@ obj-$(CONFIG_ARM_DCC) += arm_dcc.o
 obj-$(CONFIG_ATMEL_USART) += atmel_usart.o
 obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o
 obj-$(CONFIG_MCFUART) += mcfuart.o
+obj-$(CONFIG_NS9750_UART) += ns9750_serial.o
 obj-$(CONFIG_OPENCORES_YANU) += opencores_yanu.o
 obj-$(CONFIG_SYS_NS16550) += ns16550.o
 obj-$(CONFIG_S5P) += serial_s5p.o
drivers/serial/ns9750_serial.c new file +219 -0

219 lines not on this page · raw message

drivers/serial/serial.c +2 -0
index df05bde..c9c10c5 100644
@@ -160,6 +160,7 @@ serial_initfunc(sh_serial_initialize);
 serial_initfunc(arm_dcc_initialize);
 serial_initfunc(mxs_auart_initialize);
 serial_initfunc(arc_serial_initialize);
+serial_initfunc(ns9750_serial_initialize);
 
 /**
  * serial_register() - Register serial driver with serial driver core
@@ -253,6 +254,7 @@ void serial_initialize(void)
 	arm_dcc_initialize();
 	mxs_auart_initialize();
 	arc_serial_initialize();
+	ns9750_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
include/configs/ns9750dev.h new file +201 -0

201 lines not on this page · raw message

include/ns9750_bbus.h new file +125 -0

125 lines not on this page · raw message

include/ns9750_mem.h new file +172 -0

172 lines not on this page · raw message

include/ns9750_ser.h new file +202 -0

202 lines not on this page · raw message

include/ns9750_sys.h new file +215 -0

215 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 11 lines · soderstrom.rikard at gmail.com

From: Rikard S?derstr?m <[email protected]>

This patch is an RFC.

ns9750 was removed in commit 4cfc611b4a4ce009cfad46804bec2a1caad8e329, this is an attempt to make it work again. Comparing the files from removal revision and current, there are changes made in board/ns9750dev/ns9750dev.c and in include/configs/ns9750dev.h Currently this fails at linkage stage.

Quoted 2 lines

+CC Albert , this one is quite nasty.

[...]

Best regards,
Marek Vasut

#2 lore raw

Hi Marex,

Are you referring to the code or the linkage issue as "nasty"?

2014-03-21 19:28 GMT+01:00 Marek Vasut <[email protected]>:

Quoted 8 lines

+CC Albert , this one is quite nasty.

[...]

Best regards,
Marek Vasut

Yours Sincerely,
Rikard S?derstr?m

#3 lore raw
Quoted 3 lines · Rikard S?derstr?m

Hi Marex,

Are you referring to the code or the linkage issue as "nasty"?

Actually, both. But more the linker issue this time ;-)

Best regards,
Marek Vasut

#4 lore raw

Hi Marek,

Sorry, I am slowly catching up.

Quoted 6 lines · Marek Vasut
Quoted 3 lines · Rikard S?derstr?m

Hi Marex,

Are you referring to the code or the linkage issue as "nasty"?

Actually, both. But more the linker issue this time ;-)

Phew. I though /I/ was the nasty one. :)

Will look at the patch ASAP.

Quoted 2 lines

Best regards,
Marek Vasut

Amicalement,

Signature · 1 line
Albert.
#5 lore raw
In reply to Marek Vasut

Hi Marek,

Quoted 6 lines · Marek Vasut
Quoted 3 lines · Rikard S?derstr?m

Hi Marex,

Are you referring to the code or the linkage issue as "nasty"?

Actually, both. But more the linker issue this time ;-)

Ok, here is my take on the issue(s), based on the build messages. First the compiler warnings:

Quoted 2 lines

/home/albert.u.boot/src/u-boot-arm/board/ns9750dev/ns9750dev.c: In function 'board_init':
/home/albert.u.boot/src/u-boot-arm/board/ns9750dev/ns9750dev.c:68:2: warning: #warning Please register your machine at http: [-Wcpp]

Hmm, apparently U-Boot targets now have to register to 'teh Internetz'. That, or the warning above is being cut down because of the '//' in the URL, which cpp sees as a comment-to-end-of-line. :)

Quoted 6 lines

/home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c: In function 'flash_get_offsets':
/home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c:122:10: warning: variable 'pOrgDef' set but not used [-Wunused-but-set-variable] /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c: In function 'flash_erase':
/home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c:263:6: warning: variable 'flag' set but not used [-Wunused-but-set-variable] /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c: In function 'write_data':
/home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c:439:6: warning: variable 'flag' set but not used [-Wunused-but-set-variable]

Those are trivial to solve. :)

Quoted 6 lines

/home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c: In function
'flash_init': /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c:132:16:
warning: array subscript is above array bounds
[-Warray-bounds] /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c:133:18:
warning: array subscript is above array bounds [-Warray-bounds]

Those, please investigate. I hate it when the compiler says indexes might be out of bounds, because it will invariably result in them *actually* getting out of bounds, in a manner which will make it really hard to realize they did.

Quoted 1 line

/home/albert.u.boot/src/u-boot-arm/lib/time.c:14:2: warning: #warning "CONFIG_SYS_HZ must be 1000 and should not be defined by platforms" [-Wcpp]

This one we have treated before.

Quoted 3 lines

arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696 arm-linux-gnueabi-ld.bfd: error: required section '.rel.plt' not found in the linker script arm-linux-gnueabi-ld.bfd: final link failed: Invalid operation

I've tried adding .rel.plt manually, but I got the same error. O_o

Then instead of using MAKEALL, I tried make clean && make ns9750dev_config && make V=1... And got linker errors that I didn't get with MAKEALL:

Quoted 7 lines

arch/arm/lib/built-in.o: In function `board_init_r':
/home/albert.u.boot/src/u-boot-arm/arch/arm/lib/board.c:662: undefined reference to eth_initialize' arch/arm/lib/built-in.o:(.data.init_sequence+0xc): undefined reference to env_init' common/built-in.o: In function `env_relocate':
/home/albert.u.boot/src/u-boot-arm/common/env_common.c:269: undefined reference to env_relocate_spec' drivers/serial/built-in.o: In function get_current':
/home/albert.u.boot/src/u-boot-arm/drivers/serial/serial.c:352: undefined reference to `default_serial_console'

Quoted 8 lines

drivers/serial/built-in.o: In function `serial_initialize':
/home/albert.u.boot/src/u-boot-arm/drivers/serial/serial.c:256: undefined reference to `default_serial_console' arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696 arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696 arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696 arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696 arm-linux-gnueabi-ld.bfd: error: required section '.rel.plt' not found in the linker script arm-linux-gnueabi-ld.bfd: final link failed: Invalid operation

So I wonder whether the linker error shown by MAKEALL is a rightful error or just the result of previous linker issues. I would suggest going after the undefined references then check again whether the message about .rel.plt still comes up.

Also: I wonder why building with make shows errors that MAKEALL doesn't.

Quoted 5 lines

make[1]: *** [u-boot] Error 1
make: *** [sub-make] Error 2

Best regards,
Marek Vasut

Amicalement,

Signature · 1 line
Albert.