Skip to contentSkip to conversation

Add support for the Embest SBC2440-II Board

PATCH New kevin.morfitt at fearnside-systems.co.uk 2 participants 2 messages Jun 19, 2009

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

PATCH 2/2 Add support for the Embest SBC2440-II Board

This is the second of two patches that will add support for the Embest SBC2440-II Board. This one adds the new code for the Embest SBC2440-II Board. Tested on an Embest SBC2440-II Board with u-boot in NOR flash, using tftp to copy kernel and root file system images from a tftp server, programming them into NAND flash and ensuring the kernel boots correctly at re-start. Also, MAKEALL was run for all ARM9 boards and no new warnings or errors were found.

---
 MAINTAINERS                            |    4 +
 MAKEALL                                |    1 +
 Makefile                               |    3 +
 board/embest/sbc2440ii/Makefile        |   55 ++++++
 board/embest/sbc2440ii/config.mk       |   25 +++
 board/embest/sbc2440ii/lowlevel_init.S |  219 +++++++++++++++++++++++
 board/embest/sbc2440ii/sbc2440ii.c     |  109 ++++++++++++
 cpu/arm920t/s3c24x0/timer.c            |    1 +
 drivers/mtd/nand/s3c2440_nand.c        |    9 +-
 include/configs/sbc2440ii.h            |  299 ++++++++++++++++++++++++++++++++
 10 files changed, 722 insertions(+), 3 deletions(-)
 create mode 100644 board/embest/sbc2440ii/Makefile
 create mode 100644 board/embest/sbc2440ii/config.mk
 create mode 100644 board/embest/sbc2440ii/lowlevel_init.S
 create mode 100644 board/embest/sbc2440ii/sbc2440ii.c
 create mode 100644 include/configs/sbc2440ii.h
MAINTAINERS +4 -0
index 9379c7e..39c938e 100644
@@ -578,6 +578,10 @@ Nishanth Menon <[email protected]>
 
 	omap3_zoom1	ARM CORTEX-A8 (OMAP3xx SoC)
 
+Kevin Morfitt <[email protected]>
+
+	sbc2440ii	ARM920T
+
 David M?ller <[email protected]>
 
 	smdk2410	ARM920T
MAKEALL +1 -0
index f4599d6..ae95ffa 100755
@@ -519,6 +519,7 @@ LIST_ARM9="			\
 	omap5912osk		\
 	omap730p2		\
 	sbc2410x		\
+	sbc2440ii		\
 	scb9328			\
 	smdk2400		\
 	smdk2410		\
Makefile +3 -0
index acec1a0..ddcb1cc 100644
@@ -2900,6 +2900,9 @@ omap730p2_cs3boot_config :	unconfig
 sbc2410x_config: unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm920t sbc2410x NULL s3c24x0
 
+sbc2440ii_config: unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm920t sbc2440ii embest s3c24x0
+
 scb9328_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm920t scb9328 NULL imx
 
board/embest/sbc2440ii/Makefile new file +55 -0

55 lines not on this page · raw message

board/embest/sbc2440ii/config.mk new file +25 -0
new file mode 100644
index 0000000..def11d8
@@ -0,0 +1,25 @@
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <[email protected]>
+# David Mueller, ELSOFT AG, <[email protected]>
+#
+# SAMSUNG SMDK2410 board with S3C2410X (ARM920T) cpu
+#
+# see http://www.samsung.com/ for more information on SAMSUNG
+#
+# Modified for EMBEST SBC2440-II board with S3C2440 (ARM920T) cpu by:
+# (C) Copyright 2009
+# Kevin Morfitt, Fearnside Systems Ltd, <[email protected]>
+
+#
+# SBC2440-II has 1 bank of 64 MB DRAM
+#
+# 3000'0000 to 3800'0000
+#
+# Linux-Kernel is expected to be at 3000'8000, entry 3000'8000
+#
+# we load ourself to 33F8'0000
+#
+# download area is 3000'0000
+
+TEXT_BASE = 0x33F80000
board/embest/sbc2440ii/lowlevel_init.S new file +219 -0

219 lines not on this page · raw message

board/embest/sbc2440ii/sbc2440ii.c new file +109 -0

109 lines not on this page · raw message

cpu/arm920t/s3c24x0/timer.c +1 -0
index 0f6b580..9359f2b 100644
@@ -187,6 +187,7 @@ ulong get_tbclk(void)
 	tbclk = timer_load_val * 100;
 #elif defined(CONFIG_SBC2410X) || \
       defined(CONFIG_SMDK2410) || \
+      defined(CONFIG_SBC2440II) || \
       defined(CONFIG_VCMA9)
 	tbclk = CONFIG_SYS_HZ;
 #else
drivers/mtd/nand/s3c2440_nand.c +6 -3
index 3328da6..cc92401 100644
@@ -193,18 +193,21 @@ int board_nand_init(struct nand_chip *nand)
 	cfg = S3C2440_NFCONF_TACLS(tacls);
 	cfg |= S3C2440_NFCONF_TWRPH0(twrph0);
 	cfg |= S3C2440_NFCONF_TWRPH1(twrph1);
-	writel(cfg, &nand->NFCONF);
+	writel(cfg, &nand_reg->NFCONF);
 
 	cfg = S3C2440_NFCONT_EN;
 	cfg |= S3C2440_NFCONT_nFCE;
-	writel(cfg, &nand->NFCONT);
+	writel(cfg, &nand_reg->NFCONT);
 
 	/* initialize nand_chip data structure */
-	nand->IO_ADDR_R = nand->IO_ADDR_W = (void *)&nand->NFDATA;
+	nand->IO_ADDR_R = nand->IO_ADDR_W = (void *)&nand_reg->NFDATA;
 
 	/* read_buf and write_buf are default */
 	/* read_byte and write_byte are default */
 
+	nand->select_chip = s3c2440_nand_select_chip;
+	nand->chip_delay = 50;
+
 	/* hwcontrol always must be implemented */
 	nand->cmd_ctrl = s3c2440_hwcontrol;
 	nand->dev_ready = s3c2440_dev_ready;
include/configs/sbc2440ii.h new file +299 -0

299 lines not on this page · raw message

Signature · 1 line
1.6.0.6
#1 lore raw

PATCH 2/2 Add support for the Embest SBC2440-II Board

Dear "kevin.morfitt at fearnside-systems.co.uk",

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

This is the second of two patches that will add support for the Embest SBC2440-II Board. This one adds the new code for the Embest SBC2440-II Board. Tested on an Embest SBC2440-II Board with u-boot in NOR flash, using tftp to copy kernel and root file system images from a tftp server, programming them into NAND flash and ensuring the kernel boots correctly at re-start. Also, MAKEALL was run for all ARM9 boards and no new warnings or errors were found.

...

Quoted 6 lines
board/embest/sbc2440ii/lowlevel_init.S new file +0 -0
new file mode 100644
index 0000000..697c2a2
@@ -0,0 +1,219 @@

...

Quoted 11 lines
board/embest/sbc2440ii/lowlevel_init.S new file +11 -0
+_TEXT_BASE:
+  .word TEXT_BASE
+
+.globl lowlevel_init
+lowlevel_init:
+  /* memory control configuration */
+  /* make r0 relative the current location so that it */
+  /* reads SMRDATA out of FLASH rather than memory ! */
+  ldr     r0, =SMRDATA
+  ldr   r1, _TEXT_BASE
+  sub   r0, r0, r1

board/embest/sbc2440ii/lowlevel_init.S line 201

Quoted 10 lines
board/embest/sbc2440ii/lowlevel_init.S new file +10 -0
+  ldr   r1, =BWSCON /* Bus Width Status Controller */
+  add     r2, r0, #13*4
+0:
+  ldr     r3, [r0], #4
+  str     r3, [r1], #4
+  cmp     r2, r0
+  bne     0b
+
+  /* everything is fine now */
+  mov   pc, lr

Indentation by TAB, please.

Quoted 5 lines
include/configs/sbc2440ii.h new file +0 -0
new file mode 100644
index 0000000..26ad15d

...

Quoted 7 lines
include/configs/sbc2440ii.h new file +7 -0
+/*
+ * select serial console configuration
+ */
+#define CONFIG_S3C24X0_SERIAL
+#define CONFIG_SERIAL1	1	/* we use SERIAL 1 on SBC2440-II */
+
+/************************************************************

include/configs/sbc2440ii.h line 136

Quoted 10 lines
include/configs/sbc2440ii.h new file +10 -0
+ * RTC
+ ************************************************************/
+#define CONFIG_RTC_S3C24X0	1
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+
+#define CONFIG_BAUDRATE	115200
+
+

You may want to sort this file a bit; I wouyld expect to find CONFIG_BAUDRATE in the "serial console configuration" section, not in "RTC", etc.

Also, please avoid these multiple empty lines when they don't really make sense (like here).

include/configs/sbc2440ii.h line 146

Quoted 10 lines
include/configs/sbc2440ii.h new file +10 -0
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*

... or here.

include/configs/sbc2440ii.h line 173

Quoted 2 lines
include/configs/sbc2440ii.h new file +2 -0
+#define CONFIG_LOADADDR		30008000
+/*#define CONFIG_BOOTFILE	"elinos-lart" */

Please do not add dead code.

include/configs/sbc2440ii.h line 175

Quoted 2 lines
include/configs/sbc2440ii.h new file +2 -0
+#define CONFIG_BOOTCOMMAND	"nboot 30008000 0 0"
+/*#define CONFIG_NFSBOOTCOMMAND	NFS_BOOTARGS*/

Please do not add dead code.

include/configs/sbc2440ii.h line 207

Quoted 3 lines
include/configs/sbc2440ii.h new file +3 -0
+/* the PWM TImer 4 uses a counter of 15625 for 10 ms, so we need */
+/* it to wrap 100 times (total 1562500) to get 1 sec. */
+#define CONFIG_SYS_HZ	1562500

CONFIG_SYS_HZ *must* be set to 1000.

Full NAK because of that.

Please fix and resubmit.

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
Wenn Du ein' weise Antwort verlangst, Mu?t Du vern?nftig fragen.
                                                -- Goethe, Invektiven