Skip to contentSkip to conversation

Add support for the s3c2440 cpu excluding nand driver

PATCH New kevin.morfitt at fearnside-systems.co.uk 3 participants 4 messages Nov 1, 2009 – Nov 2, 2009

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

PATCH 1/3 Add support for the s3c2440 cpu excluding nand driver

This patch adds support for the s3c2440 cpu, excluding the nand driver.

Tested on an Embest SBC2440-II Board with local u-boot patches as I don't have any s3c2400 or s3c2410 boards but need this patch applying before I can submit patches for the SBC2440-II Board. Also, ran MAKEALL for all ARM9 targets and no new warnings or errors were found.

Note that checkpatch.pl shows one error:

ERROR: Invalid UTF-8, patch and commit message should be encoded in UTF-8 #656: FILE: include/s3c2440.h:3:
+ * David M?ller ELSOFT AG Switzerland. d.mueller at elsoft.ch

           ^

As David's name correctly contains a non-UTF-8 character I've ignored this error.

---
 common/serial.c                              |    4 +-
 cpu/arm920t/s3c24x0/Makefile                 |    6 +-
 cpu/arm920t/s3c24x0/arch_pre_lowlevel_init.S |   81 +++++++++++++
 cpu/arm920t/s3c24x0/speed.c                  |   41 +++++--
 cpu/arm920t/s3c24x0/timer.c                  |   19 +---
 cpu/arm920t/s3c24x0/usb.c                    |   17 +--
 cpu/arm920t/s3c24x0/usb_ohci.c               |   11 +--
 cpu/arm920t/start.S                          |   39 +------
 drivers/i2c/s3c24x0_i2c.c                    |   18 ++--
 drivers/mtd/nand/s3c2410_nand.c              |    2 +-
 drivers/rtc/s3c24x0_rtc.c                    |    7 +-
 drivers/serial/serial_s3c24x0.c              |    6 +-
 drivers/usb/host/ohci-hcd.c                  |    3 +-
 include/common.h                             |    5 +-
 include/configs/VCMA9.h                      |    4 +-
 include/configs/sbc2410x.h                   |    4 +-
 include/configs/smdk2400.h                   |    4 +-
 include/configs/smdk2410.h                   |    4 +-
 include/configs/trab.h                       |    4 +-
 include/s3c2410.h                            |   25 ++++
 include/s3c2440.h                            |  163 ++++++++++++++++++++++++++
 include/s3c24x0.h                            |   94 ++++++++++++++-
 include/s3c24x0_cpu.h                        |   29 +++++
 23 files changed, 471 insertions(+), 119 deletions(-)
 create mode 100644 cpu/arm920t/s3c24x0/arch_pre_lowlevel_init.S
 create mode 100644 include/s3c2440.h
 create mode 100644 include/s3c24x0_cpu.h
common/serial.c +2 -2
index 5f9ffd7..52b3055 100644
@@ -59,7 +59,7 @@ struct serial_device *__default_serial_console (void)
 #else
 		return &serial0_device;
 #endif
-#elif defined(CONFIG_S3C2410)
+#elif defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
 #if defined(CONFIG_SERIAL1)
 	return &s3c24xx_serial0_device;
 #elif defined(CONFIG_SERIAL2)
@@ -148,7 +148,7 @@ void serial_initialize (void)
 #if defined (CONFIG_STUART)
 	serial_register(&serial_stuart_device);
 #endif
-#if defined(CONFIG_S3C2410)
+#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
 	serial_register(&s3c24xx_serial0_device);
 	serial_register(&s3c24xx_serial1_device);
 	serial_register(&s3c24xx_serial2_device);
cpu/arm920t/s3c24x0/Makefile +4 -2
index 7e8d6ed..406f881 100644
@@ -25,6 +25,8 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).a
 
+SOBJS-$(CONFIG_DO_ARCH_PRE_LOWLEVEL_INIT) += arch_pre_lowlevel_init.o
+
 COBJS-$(CONFIG_USE_IRQ) += interrupts.o
 COBJS-y	+= speed.o
 COBJS-y	+= timer.o
@@ -32,8 +34,8 @@ COBJS-y	+= usb.o
 COBJS-y	+= usb_ohci.o
 
 
-SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+SRCS	:= $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 all:	$(obj).depend $(LIB)
 
cpu/arm920t/s3c24x0/arch_pre_lowlevel_init.S new file +81 -0

81 lines not on this page · raw message

cpu/arm920t/s3c24x0/speed.c +31 -10

68 lines not on this page · raw message

cpu/arm920t/s3c24x0/timer.c +5 -14
index 20cedd4..2ee1518 100644
@@ -30,17 +30,10 @@
  */
 
 #include <common.h>
-#if defined(CONFIG_S3C2400) || \
-    defined(CONFIG_S3C2410) || \
-    defined(CONFIG_TRAB)
+#ifdef CONFIG_S3C24X0
 
 #include <asm/io.h>
-
-#if defined(CONFIG_S3C2400)
-#include <s3c2400.h>
-#elif defined(CONFIG_S3C2410)
-#include <s3c2410.h>
-#endif
+#include <s3c24x0_cpu.h>
 
 int timer_load_val = 0;
 static ulong timer_clk;
@@ -186,8 +179,8 @@ ulong get_tbclk(void)
 
 #if defined(CONFIG_SMDK2400) || defined(CONFIG_TRAB)
 	tbclk = timer_load_val * 100;
-#elif defined(CONFIG_SBC2410X) || \
-      defined(CONFIG_SMDK2410) || \
+#elif defined(CONFIG_SBC2410X)  || \
+      defined(CONFIG_SMDK2410)  || \
       defined(CONFIG_VCMA9)
 	tbclk = CONFIG_SYS_HZ;
 #else
@@ -225,6 +218,4 @@ void reset_cpu(ulong ignored)
 	/*NOTREACHED*/
 }
 
-#endif /* defined(CONFIG_S3C2400)  ||
-	  defined (CONFIG_S3C2410) ||
-	  defined (CONFIG_TRAB) */
+#endif /* CONFIG_S3C24X0 */
cpu/arm920t/s3c24x0/usb.c +7 -10
index b5ba8c4..c26b700 100644
@@ -23,15 +23,11 @@
 
 #include <common.h>
 
-#if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT)
-# if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410)
-
-#if defined(CONFIG_S3C2400)
-# include <s3c2400.h>
-#elif defined(CONFIG_S3C2410)
-# include <s3c2410.h>
-#endif
+#if defined(CONFIG_USB_OHCI_NEW) && \
+    defined(CONFIG_SYS_USB_OHCI_CPU_INIT) && \
+    defined(CONFIG_S3C24X0)
 
+#include <s3c24x0_cpu.h>
 #include <asm/io.h>
 
 int usb_cpu_init(void)
@@ -70,5 +66,6 @@ int usb_cpu_init_fail(void)
 	return 0;
 }
 
-# endif	/* defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) */
-#endif /* defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) */
+#endif /* defined(CONFIG_USB_OHCI_NEW) && \
+	  defined(CONFIG_SYS_USB_OHCI_CPU_INIT) && \
+	  defined(CONFIG_S3C24X0) */
cpu/arm920t/s3c24x0/usb_ohci.c +3 -8
index 7672e4c..c13cb7d 100644
@@ -36,14 +36,9 @@
 #include <common.h>
 /* #include <pci.h> no PCI on the S3C24X0 */
 
-#ifdef CONFIG_USB_OHCI
-
-#if defined(CONFIG_S3C2400)
-#include <s3c2400.h>
-#elif defined(CONFIG_S3C2410)
-#include <s3c2410.h>
-#endif
+#if defined(CONFIG_USB_OHCI) && defined(CONFIG_S3C24X0)
 
+#include <s3c24x0_cpu.h>
 #include <asm/io.h>
 #include <malloc.h>
 #include <usb.h>
@@ -1757,4 +1752,4 @@ int usb_lowlevel_stop(void)
 	return 0;
 }
 
-#endif /* CONFIG_USB_OHCI */
+#endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_S3C24X0) */
cpu/arm920t/start.S +3 -36
index 114427a..fcd2198 100644
@@ -131,42 +131,9 @@ copyex:
 	bne	copyex
 #endif
 
-#if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410)
-	/* turn off the watchdog */
-
-# if defined(CONFIG_S3C2400)
-#  define pWTCON	0x15300000
-#  define INTMSK	0x14400008	/* Interupt-Controller base addresses */
-#  define CLKDIVN	0x14800014	/* clock divisor register */
-#else
-#  define pWTCON	0x53000000
-#  define INTMSK	0x4A000008	/* Interupt-Controller base addresses */
-#  define INTSUBMSK	0x4A00001C
-#  define CLKDIVN	0x4C000014	/* clock divisor register */
-# endif
-
-	ldr	r0, =pWTCON
-	mov	r1, #0x0
-	str	r1, [r0]
-
-	/*
-	 * mask all IRQs by setting all bits in the INTMR - default
-	 */
-	mov	r1, #0xffffffff
-	ldr	r0, =INTMSK
-	str	r1, [r0]
-# if defined(CONFIG_S3C2410)
-	ldr	r1, =0x3ff
-	ldr	r0, =INTSUBMSK
-	str	r1, [r0]
-# endif
-
-	/* FCLK:HCLK:PCLK = 1:2:4 */
-	/* default FCLK is 120 MHz ! */
-	ldr	r0, =CLKDIVN
-	mov	r1, #3
-	str	r1, [r0]
-#endif	/* CONFIG_S3C2400 || CONFIG_S3C2410 */
+#ifdef CONFIG_DO_ARCH_PRE_LOWLEVEL_INIT
+	bl	arch_pre_lowlevel_init
+#endif
 
 	/*
 	 * we do sys-critical inits only at reboot,
drivers/i2c/s3c24x0_i2c.c +8 -10
index 55c6a12..28a6617 100644
@@ -27,12 +27,9 @@
  */
 
 #include <common.h>
-#if defined(CONFIG_S3C2400)
-#include <s3c2400.h>
-#elif defined(CONFIG_S3C2410)
-#include <s3c2410.h>
-#endif
+#ifdef CONFIG_S3C24X0
 
+#include <s3c24x0_cpu.h>
 #include <asm/io.h>
 #include <i2c.h>
 
@@ -61,7 +58,7 @@ static int GetI2CSDA(void)
 {
 	struct s3c24x0_gpio *gpio = s3c24x0_get_base_gpio();
 
-#ifdef CONFIG_S3C2410
+#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
 	return (readl(&gpio->GPEDAT) & 0x8000) >> 15;
 #endif
 #ifdef CONFIG_S3C2400
@@ -80,7 +77,7 @@ static void SetI2CSCL(int x)
 {
 	struct s3c24x0_gpio *gpio = s3c24x0_get_base_gpio();
 
-#ifdef CONFIG_S3C2410
+#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
 	writel((readl(&gpio->GPEDAT) & ~0x4000) | (x & 1) << 14, &gpio->GPEDAT);
 #endif
 #ifdef CONFIG_S3C2400
@@ -132,7 +129,7 @@ void i2c_init(int speed, int slaveadd)
 	}
 
 	if ((readl(&i2c->IICSTAT) & I2CSTAT_BSY) || GetI2CSDA() == 0) {
-#ifdef CONFIG_S3C2410
+#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
 		ulong old_gpecon = readl(&gpio->GPECON);
 #endif
 #ifdef CONFIG_S3C2400
@@ -141,7 +138,7 @@ void i2c_init(int speed, int slaveadd)
 		/* bus still busy probably by (most) previously interrupted
 		   transfer */
 
-#ifdef CONFIG_S3C2410
+#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
 		/* set I2CSDA and I2CSCL (GPE15, GPE14) to GPIO */
 		writel((readl(&gpio->GPECON) & ~0xF0000000) | 0x10000000,
 		       &gpio->GPECON);
@@ -167,7 +164,7 @@ void i2c_init(int speed, int slaveadd)
 		udelay(1000);
 
 		/* restore pin functions */
-#ifdef CONFIG_S3C2410
+#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
 		writel(old_gpecon, &gpio->GPECON);
 #endif
 #ifdef CONFIG_S3C2400
@@ -445,3 +442,4 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
 		 len) != 0);
 }
 #endif /* CONFIG_HARD_I2C */
+#endif	/* CONFIG_S3C24X0 */
drivers/mtd/nand/s3c2410_nand.c +1 -1
index f2f3e72..87d0bf6 100644
@@ -21,7 +21,7 @@
 #include <common.h>
 
 #include <nand.h>
-#include <s3c2410.h>
+#include <s3c24x0_cpu.h>
 #include <asm/io.h>
 
 #define S3C2410_NFCONF_EN          (1<<15)
drivers/rtc/s3c24x0_rtc.c +1 -6
index 1ce34e3..3f786e0 100644
@@ -30,12 +30,7 @@
 
 #if (defined(CONFIG_CMD_DATE))
 
-#if defined(CONFIG_S3C2400)
-#include <s3c2400.h>
-#elif defined(CONFIG_S3C2410)
-#include <s3c2410.h>
-#endif
-
+#include <s3c24x0_cpu.h>
 #include <rtc.h>
 #include <asm/io.h>
 
drivers/serial/serial_s3c24x0.c +1 -5
index c2c72e4..e975428 100644
@@ -19,11 +19,7 @@
  */
 
 #include <common.h>
-#if defined(CONFIG_S3C2400) || defined(CONFIG_TRAB)
-#include <s3c2400.h>
-#elif defined(CONFIG_S3C2410)
-#include <s3c2410.h>
-#endif
+#include <s3c24x0_cpu.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/usb/host/ohci-hcd.c +1 -2
index 67d478f..b03a600 100644
@@ -65,8 +65,7 @@
 #endif
 
 #if defined(CONFIG_ARM920T) || \
-    defined(CONFIG_S3C2400) || \
-    defined(CONFIG_S3C2410) || \
+    defined(CONFIG_S3C24X0) || \
     defined(CONFIG_S3C6400) || \
     defined(CONFIG_440EP) || \
     defined(CONFIG_PCI_OHCI) || \
include/common.h +3 -2
index f7c93bf..8ee80c1 100644
@@ -495,8 +495,9 @@ int	prt_mpc8220_clks (void);
 ulong	get_OPB_freq (void);
 ulong	get_PCI_freq (void);
 #endif
-#if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) || \
-	defined(CONFIG_LH7A40X) || defined(CONFIG_S3C6400)
+#if defined(CONFIG_S3C24X0) || \
+    defined(CONFIG_LH7A40X) || \
+    defined(CONFIG_S3C6400)
 ulong	get_FCLK (void);
 ulong	get_HCLK (void);
 ulong	get_PCLK (void);
include/configs/VCMA9.h +3 -1
index 618b7f0..aedc59d 100644
@@ -34,8 +34,10 @@
  * (easy to change)
  */
 #define CONFIG_ARM920T		1	/* This is an ARM920T Core	*/
-#define	CONFIG_S3C2410		1	/* in a SAMSUNG S3C2410 SoC     */
+#define	CONFIG_S3C24X0		1	/* in a SAMSUNG S3C24x0-type SoC     */
+#define	CONFIG_S3C2410		1	/* specifically a SAMSUNG S3C2410 SoC */
 #define CONFIG_VCMA9		1	/* on a MPL VCMA9 Board  */
+#define CONFIG_DO_ARCH_PRE_LOWLEVEL_INIT
 
 /* input clock of PLL */
 #define CONFIG_SYS_CLK_FREQ	12000000/* VCMA9 has 12MHz input clock	*/
include/configs/sbc2410x.h +3 -1
index e6886cf..492fe1a 100644
@@ -44,8 +44,10 @@
  * (easy to change)
  */
 #define CONFIG_ARM920T		1	/* This is an ARM920T Core	*/
-#define	CONFIG_S3C2410		1	/* in a SAMSUNG S3C2410 SoC     */
+#define	CONFIG_S3C24X0		1	/* in a SAMSUNG S3C24x0-type SoC     */
+#define	CONFIG_S3C2410		1	/* specifically a SAMSUNG S3C2410 SoC */
 #define CONFIG_SBC2410X		1	/* on a friendly-arm SBC-2410X Board  */
+#define CONFIG_DO_ARCH_PRE_LOWLEVEL_INIT
 
 /* input clock of PLL */
 #define CONFIG_SYS_CLK_FREQ	12000000/* the SBC2410X has 12MHz input clock */
include/configs/smdk2400.h +3 -1
index a1beb65..3cbe072 100644
@@ -35,8 +35,10 @@
  * (easy to change)
  */
 #define CONFIG_ARM920T		1	/* This is an ARM920T core	*/
-#define CONFIG_S3C2400		1	/* in a SAMSUNG S3C2400 SoC	*/
+#define	CONFIG_S3C24X0		1	/* in a SAMSUNG S3C24x0-type SoC     */
+#define	CONFIG_S3C2400		1	/* specifically a SAMSUNG S3C2400 SoC */
 #define CONFIG_SMDK2400		1	/* on an SAMSUNG SMDK2400 Board */
+#define CONFIG_DO_ARCH_PRE_LOWLEVEL_INIT
 
 /* input clock of PLL */
 #define CONFIG_SYS_CLK_FREQ	12000000 /* SMDK2400 has 12 MHz input clock */
include/configs/smdk2410.h +3 -1
index c57751b..c0dfb9e 100644
@@ -34,8 +34,10 @@
  * (easy to change)
  */
 #define CONFIG_ARM920T		1	/* This is an ARM920T Core	*/
-#define	CONFIG_S3C2410		1	/* in a SAMSUNG S3C2410 SoC     */
+#define	CONFIG_S3C24X0		1	/* in a SAMSUNG S3C24x0-type SoC     */
+#define	CONFIG_S3C2410		1	/* specifically a SAMSUNG S3C2410 SoC */
 #define CONFIG_SMDK2410		1	/* on a SAMSUNG SMDK2410 Board  */
+#define CONFIG_DO_ARCH_PRE_LOWLEVEL_INIT
 
 /* input clock of PLL */
 #define CONFIG_SYS_CLK_FREQ	12000000/* the SMDK2410 has 12MHz input clock */
include/configs/trab.h +3 -1
index 97f30ce..2ad65be 100644
@@ -41,9 +41,11 @@
  * (easy to change)
  */
 #define CONFIG_ARM920T		1	/* This is an arm920t CPU	*/
-#define CONFIG_S3C2400		1	/* in a SAMSUNG S3C2400 SoC	*/
+#define	CONFIG_S3C24X0		1	/* in a SAMSUNG S3C24x0-type SoC     */
+#define	CONFIG_S3C2400		1	/* specifically a SAMSUNG S3C2400 SoC */
 #define CONFIG_TRAB		1	/* on a TRAB Board		*/
 #undef CONFIG_TRAB_50MHZ		/* run the CPU at 50 MHz	*/
+#define CONFIG_DO_ARCH_PRE_LOWLEVEL_INIT
 
 /* automatic software updates (see board/trab/auto_update.c) */
 #define CONFIG_AUTO_UPDATE	1
include/s3c2410.h +25 -0
index 03b33b4..c2a53de 100644
@@ -143,4 +143,29 @@ static inline struct s3c2410_sdi *s3c2410_get_base_sdi(void)
 	return (struct s3c2410_sdi *)S3C2410_SDI_BASE;
 }
 
+/* Define the registers and bits to use to operate the NAND flash controller. */
+
+/* The NAND control register, */
+#define S3C24X0_NAND_CTRL_REG		NFCONF
+/* NAND Enable/disable bit. */
+#define S3C24X0_NAND_EN_BIT		(1 << 15)
+/* NAND CE enable/disable bit, */
+#define S3C24X0_NAND_nFCE_BIT		(1 << 11)
+/* NAND init ECC bit. */
+#define S3C24X0_NAND_INITECC_BIT	(1 << 12)
+
+/* The NAND timimg register. */
+#define S3C24X0_NAND_TIMING_REG		NFCONF
+/* NAND TACLS field. */
+#define S3C24X0_NAND_TACLS_BITS(x)	((x) << 8)
+/* NAND TWRPH0 field. */
+#define S3C24X0_NAND_TWRPH0_BITS(x)	((x) << 4)
+/* NAND TWRPH1 field. */
+#define S3C24X0_NAND_TWRPH1_BITS(x)	((x) << 0)
+
+/* The NAND ECC register. */
+#define S3C24X0_NAND_ECC_REG		NFECC
+/* NAND INIT ECC bit. */
+#define S3C24X0_NAND_INITECC_BIT	(1 << 12)
+
 #endif /*__S3C2410_H__*/
include/s3c2440.h new file +163 -0

163 lines not on this page · raw message

include/s3c24x0.h +88 -6

152 lines not on this page · raw message

include/s3c24x0_cpu.h new file +29 -0
new file mode 100644
index 0000000..cade11b
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2009
+ * Kevin Morfitt, Fearnside Systems Ltd, <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifdef CONFIG_S3C2400
+	#include <s3c2400.h>
+#elif defined CONFIG_S3C2410
+	#include <s3c2410.h>
+#elif defined CONFIG_S3C2440
+	#include <s3c2440.h>
+#else
+	#error Please define the s3c24x0 cpu type
+#endif
Signature · 1 line
1.6.0.6
#1 lore raw

PATCH 1/3 Add support for the s3c2440 cpu excluding nand driver

Quoted 8 lines · kevin.morfitt at fearnside-systems.co.uk

This patch adds support for the s3c2440 cpu, excluding the nand driver.

Tested on an Embest SBC2440-II Board with local u-boot patches as I don't have any s3c2400 or s3c2410 boards but need this patch applying before I can submit patches for the SBC2440-II Board. Also, ran MAKEALL for all ARM9 targets and no new warnings or errors were found.

Note that checkpatch.pl shows one error:

Thank you for using checkpatch.

Quoted 4 lines

ERROR: Invalid UTF-8, patch and commit message should be encoded in UTF-8 #656: FILE: include/s3c2440.h:3:
+ * David M?ller ELSOFT AG Switzerland. d.mueller at elsoft.ch

Quoted 8 lines
           ^

As David's name correctly contains a non-UTF-8 character I've ignored this error.

---
 common/serial.c                              |    4 +-
 cpu/arm920t/s3c24x0/Makefile                 |    6 +-
 cpu/arm920t/s3c24x0/arch_pre_lowlevel_init.S |   81 +++++++++++++

Why not just lowlevel_init.S ?
It looks like this is a common lowlevel_init but this looks like a mistake since the other s3c34x0 boards have not used it up to to this point. Since it looks like this option is being enabled in the other boards, this change must be broken out at its own patch.

Quoted 12 lines
 cpu/arm920t/s3c24x0/speed.c                  |   41 +++++--
 cpu/arm920t/s3c24x0/timer.c                  |   19 +---
 cpu/arm920t/s3c24x0/usb.c                    |   17 +--
 cpu/arm920t/s3c24x0/usb_ohci.c               |   11 +--
 cpu/arm920t/start.S                          |   39 +------
 drivers/i2c/s3c24x0_i2c.c                    |   18 ++--
 drivers/mtd/nand/s3c2410_nand.c              |    2 +-
 drivers/rtc/s3c24x0_rtc.c                    |    7 +-
 drivers/serial/serial_s3c24x0.c              |    6 +-
 drivers/usb/host/ohci-hcd.c                  |    3 +-
 include/common.h                             |    5 +-
Quoted 5 lines
 include/configs/VCMA9.h                      |    4 +-
 include/configs/sbc2410x.h                   |    4 +-
 include/configs/smdk2400.h                   |    4 +-
 include/configs/smdk2410.h                   |    4 +-
 include/configs/trab.h                       |    4 +-

This is typical of what you are doing with the config files.

Review

Quoted 2 lines
(quoted diff) +2 -0
+#define	CONFIG_S3C24X0		1	/* in a SAMSUNG S3C24x0-type SoC     */
+#define	CONFIG_S3C2410		1	/* specifically a SAMSUNG S3C2410 SoC */

It is good that you are trying to generalize the boards, but this separate change and must be split. This new patch should come first.

Quoted 4 lines
 include/s3c2410.h                            |   25 ++++
 include/s3c2440.h                            |  163 ++++++++++++++++++++++++++
 include/s3c24x0.h                            |   94 ++++++++++++++-
 include/s3c24x0_cpu.h                        |   29 +++++

These 4 files belong in include/asm-arch/arch-s3c24x0 or where Minkyu thinks is appropriate.

On your include file s3c2440.h

For your #defines, the whitespace between the identifier and the value must be tabs. You have spaces.

The static inline functions need space beween one function definition and the next. They also need to use tabs

Quoted 5 lines
 23 files changed, 471 insertions(+), 119 deletions(-)
 create mode 100644 cpu/arm920t/s3c24x0/arch_pre_lowlevel_init.S
 create mode 100644 include/s3c2440.h
 create mode 100644 include/s3c24x0_cpu.h

Tom

#2 lore raw

PATCH 1/3 Add support for the s3c2440 cpu excluding nand driver

Dear kevin.morfitt and Tom

2009/11/2 Tom <[email protected]>:

Quoted 56 lines
Quoted 8 lines · kevin.morfitt at fearnside-systems.co.uk

This patch adds support for the s3c2440 cpu, excluding the nand driver.

Tested on an Embest SBC2440-II Board with local u-boot patches as I don't have any s3c2400 or s3c2410 boards but need this patch applying before I can submit patches for the SBC2440-II Board. Also, ran MAKEALL for all ARM9 targets and no new warnings or errors were found.

Note that checkpatch.pl shows one error:

Thank you for using checkpatch.

Quoted 7 lines

ERROR: Invalid UTF-8, patch and commit message should be encoded in UTF-8 #656: FILE: include/s3c2440.h:3:
+ * David M?ller ELSOFT AG Switzerland. d.mueller at elsoft.ch
? ? ? ? ? ?^
As David's name correctly contains a non-UTF-8 character I've ignored this error.

Quoted 5 lines

---

?common/serial.c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? ?4 +-
?cpu/arm920t/s3c24x0/Makefile ? ? ? ? ? ? ? ? | ? ?6 +-
?cpu/arm920t/s3c24x0/arch_pre_lowlevel_init.S | ? 81 +++++++++++++

Why not just lowlevel_init.S ?
It looks like this is a common lowlevel_init but this looks like a mistake since the other s3c34x0 boards have not used it up to to this point. ?Since it looks like this option is being enabled in the other boards, this change must be broken out at its own patch.

Quoted 12 lines
?cpu/arm920t/s3c24x0/speed.c ? ? ? ? ? ? ? ? ?| ? 41 +++++--
?cpu/arm920t/s3c24x0/timer.c ? ? ? ? ? ? ? ? ?| ? 19 +---
?cpu/arm920t/s3c24x0/usb.c ? ? ? ? ? ? ? ? ? ?| ? 17 +--
?cpu/arm920t/s3c24x0/usb_ohci.c ? ? ? ? ? ? ? | ? 11 +--
?cpu/arm920t/start.S ? ? ? ? ? ? ? ? ? ? ? ? ?| ? 39 +------
?drivers/i2c/s3c24x0_i2c.c ? ? ? ? ? ? ? ? ? ?| ? 18 ++--
?drivers/mtd/nand/s3c2410_nand.c ? ? ? ? ? ? ?| ? ?2 +-
?drivers/rtc/s3c24x0_rtc.c ? ? ? ? ? ? ? ? ? ?| ? ?7 +-
?drivers/serial/serial_s3c24x0.c ? ? ? ? ? ? ?| ? ?6 +-
?drivers/usb/host/ohci-hcd.c ? ? ? ? ? ? ? ? ?| ? ?3 +-
?include/common.h ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ?5 +-
Quoted 5 lines
?include/configs/VCMA9.h ? ? ? ? ? ? ? ? ? ? ?| ? ?4 +-
?include/configs/sbc2410x.h ? ? ? ? ? ? ? ? ? | ? ?4 +-
?include/configs/smdk2400.h ? ? ? ? ? ? ? ? ? | ? ?4 +-
?include/configs/smdk2410.h ? ? ? ? ? ? ? ? ? | ? ?4 +-
?include/configs/trab.h ? ? ? ? ? ? ? ? ? ? ? | ? ?4 +-

This is typical of what you are doing with the config files.

Review

Quoted 2 lines
(quoted diff) +2 -0
+#define ? ? ?CONFIG_S3C24X0 ? ? ? ? ?1 ? ? ? /* in a SAMSUNG S3C24x0-type SoC ? ? */
+#define ? ? ?CONFIG_S3C2410 ? ? ? ? ?1 ? ? ? /* specifically a SAMSUNG S3C2410 SoC */

It is good that you are trying to generalize the boards, but this separate change and must be split. ?This new patch should come first.

Quoted 7 lines
Quoted 4 lines
?include/s3c2410.h ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? 25 ++++
?include/s3c2440.h ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ?163 ++++++++++++++++++++++++++
?include/s3c24x0.h ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? 94 ++++++++++++++-
?include/s3c24x0_cpu.h ? ? ? ? ? ? ? ? ? ? ? ?| ? 29 +++++

These 4 files belong in include/asm-arch/arch-s3c24x0 or where Minkyu thinks is appropriate.

yes right,
I think these file must be move to include/asm-arch/arch-s3c24x0 kevin, could you please make the patch about this also? It seems to be another patch.
If you busy, I'll do it :)

Quoted 15 lines

On your include file s3c2440.h

For your #defines, the whitespace between the identifier and the value must be tabs. ?You have spaces.

The static inline functions need space beween one function definition and the next. ?They also need to use tabs

Quoted 5 lines

?23 files changed, 471 insertions(+), 119 deletions(-) ?create mode 100644 cpu/arm920t/s3c24x0/arch_pre_lowlevel_init.S ?create mode 100644 include/s3c2440.h
?create mode 100644 include/s3c24x0_cpu.h

Quoted 6 lines

Tom
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Thanks
Minkyu Kang

Signature · 2 lines
from. prom.
www.promsoft.net
#3 lore raw

PATCH 1/3 Add support for the s3c2440 cpu excluding nand driver

In reply to Tom
Quoted 24 lines · Tom
Quoted 8 lines · kevin.morfitt at fearnside-systems.co.uk

This patch adds support for the s3c2440 cpu, excluding the nand driver.

Tested on an Embest SBC2440-II Board with local u-boot patches as I don't have any s3c2400 or s3c2410 boards but need this patch applying before I can submit patches for the SBC2440-II Board. Also, ran MAKEALL for all ARM9 targets and no new warnings or errors were found.

Note that checkpatch.pl shows one error:

Thank you for using checkpatch.

Quoted 11 lines

ERROR: Invalid UTF-8, patch and commit message should be encoded in UTF-8 #656: FILE: include/s3c2440.h:3:
+ * David M?ller ELSOFT AG Switzerland. d.mueller at elsoft.ch

           ^

As David's name correctly contains a non-UTF-8 character I've ignored this error.

---
 common/serial.c                              |    4 +-
 cpu/arm920t/s3c24x0/Makefile                 |    6 +-
 cpu/arm920t/s3c24x0/arch_pre_lowlevel_init.S |   81 +++++++++++++
Quoted 6 lines

Why not just lowlevel_init.S ?
It looks like this is a common lowlevel_init but this looks like a mistake since the other s3c34x0 boards have not used it up to to this point. Since it looks like this option is being enabled in the other boards, this change must be broken out at its own patch.

There already is a lowlevel_init.S that's used in the s3c24x0 board directories to configure the SDRAM controller specific to the board. arch_pre_lowlevel_init.S is intended to run first at start-up to let a board configure the PLL's in a board specific way so I should really have put arch_pre_lowlevel_init.S in the board directories and enabled or disabled it in the board config files.
As you suggested, I'll break it out into its own patch.

Quoted 19 lines
Quoted 13 lines
 cpu/arm920t/s3c24x0/speed.c                  |   41 +++++--
 cpu/arm920t/s3c24x0/timer.c                  |   19 +---
 cpu/arm920t/s3c24x0/usb.c                    |   17 +--
 cpu/arm920t/s3c24x0/usb_ohci.c               |   11 +--
 cpu/arm920t/start.S                          |   39 +------
 drivers/i2c/s3c24x0_i2c.c                    |   18 ++--
 drivers/mtd/nand/s3c2410_nand.c              |    2 +-
 drivers/rtc/s3c24x0_rtc.c                    |    7 +-
 drivers/serial/serial_s3c24x0.c              |    6 +-
 drivers/usb/host/ohci-hcd.c                  |    3 +-
 include/common.h                             |    5 +-
Quoted 5 lines
 include/configs/VCMA9.h                      |    4 +-
 include/configs/sbc2410x.h                   |    4 +-
 include/configs/smdk2400.h                   |    4 +-
 include/configs/smdk2410.h                   |    4 +-
 include/configs/trab.h                       |    4 +-
Quoted 5 lines

This is typical of what you are doing with the config files.

Review

Quoted 2 lines
(quoted diff) +2 -0
+#define	CONFIG_S3C24X0		1	/* in a SAMSUNG S3C24x0-type SoC     */
+#define	CONFIG_S3C2410		1	/* specifically a SAMSUNG S3C2410 SoC */

It is good that you are trying to generalize the boards, but this separate change and must be split. This new patch should come first.

OK - I'll do that in a separate patch.

Quoted 8 lines
Quoted 5 lines
 include/s3c2410.h                            |   25 ++++
 include/s3c2440.h                            |  163 ++++++++++++++++++++++++++
 include/s3c24x0.h                            |   94 ++++++++++++++-
 include/s3c24x0_cpu.h                        |   29 +++++

These 4 files belong in include/asm-arch/arch-s3c24x0 or where Minkyu thinks is appropriate.

I'll move these in a separate patch.

Quoted 17 lines

On your include file s3c2440.h

For your #defines, the whitespace between the identifier and the value must be tabs. You have spaces.

The static inline functions need space beween one function definition and the next. They also need to use tabs

Quoted 5 lines
 23 files changed, 471 insertions(+), 119 deletions(-)
 create mode 100644 cpu/arm920t/s3c24x0/arch_pre_lowlevel_init.S
 create mode 100644 include/s3c2440.h
 create mode 100644 include/s3c24x0_cpu.h

Tom