Skip to contentSkip to conversation

V4 S3C64XX: Switch all I/O to use readl/writel functio and Clear SMDK64XX

U-Boot New Zhong Hongbo 2 participants 19 messages Aug 15, 2012 – Dec 7, 2012

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

V4:
1. Adjust SPL patch order
2. seperate the patch of "arm1176: Fixed No relocation.", It is a common issue for arm platform. I sent it for other thread.

V3:
1. Replace ELFIN with S3C64XX for all the variable of cpu.h.
2. Change __S3C6400_H__ into __CPU__H__.
3. Use C language to implement memory initialization.
4. Use C language to re-write reset function.
5. Delete u-boot-nand.lds.

V2:
1. Modify the type of return for s3c64xx_get_base_nand
2. Add patch 0014 to support s3c6410 board
3. Adjust patch for mix content.

V1:
This serial patch intent to:
1. Switch all I/O to use readl/writel function
2. Change nand_spl to use SPL framework
3. S3C64XX serial includes s3c6400 and s3c6410,
Here seprate cpu and board file to support to board's of s3c6410.

I test this patch on my s3c6410 development board. the log as following:

U-Boot 2012.07-rc3-00016-g351ea73 (Jul 28 2012 - 16:55:32) for DMATEK6410

CPU: S3C64XX at 532MHz

         Fclk = 532MHz, Hclk = 133MHz, Pclk = 66MHz (ASYNC Mode)
Board:   DMATEK6410
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  128 MiB

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dm9000

Zhong Hongbo (14):
smdk6400: Move smdk6400 board from Makefile to boards.cfg
S3C64XX: Switch to use readl/writel to operate nand flash
S3C64XX: Use readl/writel to operate uart
S3C64XX: add pwm for s3c64xx support
S3C64XX: reference s5p cpu time system for s3c64xx timer
S3C64xx: mov cpu_init.S to the board directory
S3C6400: Adopt SPL framwork to support spl for nand flash
S3C6400: Delete nand_spl for S3C6400
S3C64XX: Change SROM init to use read/write operation
S3C64XX: Switch to use read/writel to operation clock system
S3c64xx: clear GPIO, Interrupt, Watchdog variable.
S3C6400: clear memory init variable
S3C64XX: Move s3c6400.h to cpu.h to support s3c6410 board
S3C6400: Remove the unused variable for S3C6400

 Makefile                                        |   20 -
 arch/arm/cpu/arm1176/s3c64xx/Makefile           |    7 +-
 arch/arm/cpu/arm1176/s3c64xx/cpu_init.S         |  135 ----
 arch/arm/cpu/arm1176/s3c64xx/pwm.c              |  188 +++++
 arch/arm/cpu/arm1176/s3c64xx/reset.S            |   34 -
 arch/arm/cpu/arm1176/s3c64xx/reset.c            |   39 +
 arch/arm/cpu/arm1176/s3c64xx/speed.c            |   52 +-
 arch/arm/cpu/arm1176/s3c64xx/srom.c             |   51 ++
 arch/arm/cpu/arm1176/s3c64xx/timer.c            |  195 +++---
 arch/arm/cpu/arm1176/start.S                    |   16 +-
 arch/arm/include/asm/arch-s3c64xx/clock.h       |  163 ++++
 arch/arm/include/asm/arch-s3c64xx/cpu.h         |   89 +++
 arch/arm/include/asm/arch-s3c64xx/dmc.h         |   62 ++
 arch/arm/include/asm/arch-s3c64xx/gpio.h        |   38 +
 arch/arm/include/asm/arch-s3c64xx/interrupt.h   |   31 +
 arch/arm/include/asm/arch-s3c64xx/nand.h        |   72 ++
 arch/arm/include/asm/arch-s3c64xx/pwm.h         |   70 ++
 arch/arm/include/asm/arch-s3c64xx/s3c6400.h     |  895 -----------------------
 arch/arm/include/asm/arch-s3c64xx/s3c64x0.h     |   90 ---
 arch/arm/include/asm/arch-s3c64xx/sromc.h       |   49 ++
 arch/arm/include/asm/arch-s3c64xx/uart.h        |   54 ++
 board/samsung/smdk6400/Makefile                 |   30 +-
 board/samsung/smdk6400/config.mk                |   30 -
 board/samsung/smdk6400/dmc_init.c               |  110 +++
 board/samsung/smdk6400/lowlevel_init.S          |   76 +-
 board/samsung/smdk6400/setup.h                  |  137 ++++
 board/samsung/smdk6400/smdk6400.c               |   40 +-
 board/samsung/smdk6400/smdk6400_nand_spl.c      |   61 ++-
 board/samsung/smdk6400/tools/mksmdk6400_image.c |  117 +++
 board/samsung/smdk6400/u-boot-nand.lds          |   84 ---
 boards.cfg                                      |    2 +
 drivers/mtd/nand/s3c64xx.c                      |   64 +-
 drivers/serial/s3c64xx.c                        |   52 +-
 drivers/usb/host/s3c64xx-hcd.c                  |   32 +-
 include/configs/smdk6400.h                      |   40 +-
 nand_spl/board/samsung/smdk6400/Makefile        |  117 ---
 nand_spl/board/samsung/smdk6400/config.mk       |   40 -
 nand_spl/board/samsung/smdk6400/u-boot.lds      |   78 --
 38 files changed, 1667 insertions(+), 1793 deletions(-)
 delete mode 100644 arch/arm/cpu/arm1176/s3c64xx/cpu_init.S
 create mode 100644 arch/arm/cpu/arm1176/s3c64xx/pwm.c
 delete mode 100644 arch/arm/cpu/arm1176/s3c64xx/reset.S
 create mode 100644 arch/arm/cpu/arm1176/s3c64xx/reset.c
 create mode 100644 arch/arm/cpu/arm1176/s3c64xx/srom.c
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/clock.h
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/cpu.h
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/dmc.h
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/gpio.h
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/interrupt.h
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/nand.h
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/pwm.h
 delete mode 100644 arch/arm/include/asm/arch-s3c64xx/s3c6400.h
 delete mode 100644 arch/arm/include/asm/arch-s3c64xx/s3c64x0.h
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/sromc.h
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/uart.h
 delete mode 100644 board/samsung/smdk6400/config.mk
 create mode 100644 board/samsung/smdk6400/dmc_init.c
 create mode 100644 board/samsung/smdk6400/setup.h
 create mode 100644 board/samsung/smdk6400/tools/mksmdk6400_image.c
 delete mode 100644 board/samsung/smdk6400/u-boot-nand.lds
 delete mode 100644 nand_spl/board/samsung/smdk6400/Makefile
 delete mode 100644 nand_spl/board/samsung/smdk6400/config.mk
 delete mode 100644 nand_spl/board/samsung/smdk6400/u-boot.lds
#1 lore raw

PATCH 1/14 smdk6400: Move smdk6400 board from Makefile to boards.cfg

From: Zhong Hongbo <[email protected]>

---
Change for V4:
- None.
Change for V3:
- None.
Change for V2:
- None.

---
 Makefile                         |   20 --------------------
 board/samsung/smdk6400/config.mk |    4 +---
 boards.cfg                       |    2 ++
 include/configs/smdk6400.h       |    2 +-
 4 files changed, 4 insertions(+), 24 deletions(-)
Makefile +0 -20
index d57c15e..8af1d5d 100644
@@ -711,26 +711,6 @@ SX1_config:		unconfig
 	fi;
 	@$(MKCONFIG) -n $@ SX1 arm arm925t sx1
 
-#########################################################################
-## ARM1176 Systems
-#########################################################################
-smdk6400_noUSB_config	\
-smdk6400_config	:	unconfig
-	@mkdir -p $(obj)include $(obj)board/samsung/smdk6400
-	@mkdir -p $(obj)nand_spl/board/samsung/smdk6400
-	@echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
-	@echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
-	@if [ -z "$(findstring smdk6400_noUSB_config,$@)" ]; then			\
-		echo "RAM_TEXT = 0x57e00000" >> $(obj)board/samsung/smdk6400/config.tmp;\
-	else										\
-		echo "RAM_TEXT = 0xc7e00000" >> $(obj)board/samsung/smdk6400/config.tmp;\
-	fi
-	@$(MKCONFIG) smdk6400 arm arm1176 smdk6400 samsung s3c64xx
-	@echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
-
-#########################################################################
-#########################################################################
-
 clean:
 	@rm -f $(obj)examples/standalone/82559_eeprom			  \
 	       $(obj)examples/standalone/atmel_df_pow2			  \
board/samsung/smdk6400/config.mk +1 -3
index 6f04c2f..93a1a0d 100644
@@ -21,10 +21,8 @@
 #
 # download area is 0x5000c000
 
-sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
-
 ifndef CONFIG_NAND_SPL
-CONFIG_SYS_TEXT_BASE = $(RAM_TEXT)
+CONFIG_SYS_TEXT_BASE = $(CONFIG_RAM_TEXT)
 else
 CONFIG_SYS_TEXT_BASE = 0
 endif
boards.cfg +2 -0
index 2d36d83..0363b41 100644
@@ -47,6 +47,8 @@ flea3                        arm         arm1136     -                   CarMedi
 mx35pdk                      arm         arm1136     -                   freescale      mx35
 apollon			     arm	 arm1136     apollon		 -	        omap24xx
 omap2420h4                   arm         arm1136     -                   ti             omap24xx
+smdk6400                     arm         arm1176     smdk6400            samsung        s3c64xx      smdk6400:NAND_U_BOOT,RAM_TEXT=0xc7e00000
+smdk6400_nousb               arm         arm1176     smdk6400            samsung        s3c64xx      smdk6400:NAND_U_BOOT,RAM_TEXT=0x57e00000
 tnetv107x_evm                arm         arm1176     tnetv107xevm        ti             tnetv107x
 integratorap_cm720t          arm         arm720t     integrator          armltd         -           integratorap:CM720T
 integratorap_cm920t          arm         arm920t     integrator          armltd         -           integratorap:CM920T
include/configs/smdk6400.h +1 -1
index 04caeef..47326d6 100644
@@ -54,7 +54,7 @@
 /* input clock of PLL: SMDK6400 has 12MHz input clock */
 #define CONFIG_SYS_CLK_FREQ	12000000
 
-#if !defined(CONFIG_NAND_SPL) && (CONFIG_SYS_TEXT_BASE >= 0xc0000000)
+#if !defined(CONFIG_NAND_U_BOOT) && (CONFIG_SYS_TEXT_BASE >= 0xc0000000)
 #define CONFIG_ENABLE_MMU
 #endif
 
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 1/14 smdk6400: Move smdk6400 board from Makefile to boards.cfg

Quoted 10 lines · Zhong Hongbo

From: Zhong Hongbo <[email protected]>

---
Change for V4:
- None.
Change for V3:
- None.
Change for V2:
- None.

Quoted 7 lines
---
 Makefile                         |   20 --------------------
 board/samsung/smdk6400/config.mk |    4 +---
 boards.cfg                       |    2 ++
 include/configs/smdk6400.h       |    2 +-
 4 files changed, 4 insertions(+), 24 deletions(-)

Sorry to late review..
Please rebase this patch.

Thanks.
Minkyu Kang.

#3 lore raw

PATCH 2/14 S3C64XX: Switch to use readl/writel to operate nand flash

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

---
Change for V4:
- None.
Change for V3:
- Replace the magic numbers with variable name.
Change for V2:
- Change the type of the return value from unsinged int to unsinged long for s3c64xx_get_base_uart function.
- Delete const for the local variable.

---
 arch/arm/include/asm/arch-s3c64xx/nand.h    |   72 ++++++++++++++++++++++++
 arch/arm/include/asm/arch-s3c64xx/s3c6400.h |   79 ++-------------------------
 board/samsung/smdk6400/lowlevel_init.S      |    1 +
 drivers/mtd/nand/s3c64xx.c                  |   58 +++++++++++++-------
 4 files changed, 116 insertions(+), 94 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/nand.h
arch/arm/include/asm/arch-s3c64xx/nand.h new file +72 -0
new file mode 100644
index 0000000..a1bf3ab
@@ -0,0 +1,72 @@
+/*
+ * (C) Copyright 2012
+ * Zhong Hongbo <[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
+ */
+
+#ifndef __ASM_ARCH_NAND_H__
+#define __ASM_ARCH_NAND_H__
+
+#define NFCONF_OFFSET		0x00
+#define NFCONT_OFFSET		0x04
+
+#define NFCONF_ECC_4BIT		(1<<24)
+
+#define NFCONT_ECC_ENC		(1<<18)
+#define NFCONT_WP		(1<<16)
+#define NFCONT_MECCLOCK		(1<<7)
+#define NFCONT_SECCLOCK		(1<<6)
+#define NFCONT_INITMECC		(1<<5)
+#define NFCONT_INITSECC		(1<<4)
+#define NFCONT_INITECC		(NFCONT_INITMECC | NFCONT_INITSECC)
+#define NFCONT_CS_ALT		(1<<2)
+#define NFCONT_CS		(1<<1)
+#define NFCONT_ENABLE		(1<<0)
+
+#define NFSTAT_ECCENCDONE	(1<<7)
+#define NFSTAT_ECCDECDONE	(1<<6)
+#define NFSTAT_RnB		(1<<0)
+
+#define NFESTAT0_ECCBUSY	(1<<31)
+
+#ifndef __ASSEMBLY__
+/* NAND FLASH */
+struct s3c64xx_nand {
+	u32	nfconf;
+	u32	nfcont;
+	u32	nfcmmd;
+	u32	nfaddr;
+	u32	nfdata;
+	u32	nfmeccdata0;
+	u32	nfmeccdata1;
+	u32	nfseccdata0;
+	u32	nfsblk;
+	u32	nfeblk;
+	u32	nfstat;
+	u32	nfestat0;
+	u32	nfestat1;
+	u32	nfmecc0;
+	u32	nfmecc1;
+	u32	nfsecc;
+	u32	nfmlcbitpt;
+};
+#endif
+
+#endif
arch/arm/include/asm/arch-s3c64xx/s3c6400.h +5 -74

91 lines not on this page · raw message

board/samsung/smdk6400/lowlevel_init.S +1 -0
index f7ce176..8bded44 100644
@@ -34,6 +34,7 @@
 #include <config.h>
 #include <version.h>
 
+#include <asm/arch/nand.h>
 #include <asm/arch/s3c6400.h>
 
 #ifdef CONFIG_SERIAL1
drivers/mtd/nand/s3c64xx.c +38 -20

158 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#4 lore raw

PATCH 3/14 S3C64XX: Use readl/writel to operate uart

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

---
Change for V4:
- None.
Change for v3:
- None.
Change for V2:
- Change the type of the return value from unsinged int to unsinged long for s3c64xx_get_base_uart function.
- Delete const for the local variable.

---
 arch/arm/include/asm/arch-s3c64xx/s3c6400.h |   65 +--------------------------
 arch/arm/include/asm/arch-s3c64xx/s3c64x0.h |   31 -------------
 arch/arm/include/asm/arch-s3c64xx/uart.h    |   54 ++++++++++++++++++++++
 board/samsung/smdk6400/lowlevel_init.S      |    8 ---
 drivers/serial/s3c64xx.c                    |   50 +++++++++++++--------
 5 files changed, 87 insertions(+), 121 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/uart.h
arch/arm/include/asm/arch-s3c64xx/s3c6400.h +2 -63
index d6c5dd9..77b9509 100644
@@ -582,62 +582,6 @@
  */
 #define ELFIN_UART_BASE		0x7F005000
 
-#define ELFIN_UART0_OFFSET	0x0000
-#define ELFIN_UART1_OFFSET	0x0400
-#define ELFIN_UART2_OFFSET	0x0800
-
-#define ULCON_OFFSET		0x00
-#define UCON_OFFSET		0x04
-#define UFCON_OFFSET		0x08
-#define UMCON_OFFSET		0x0C
-#define UTRSTAT_OFFSET		0x10
-#define UERSTAT_OFFSET		0x14
-#define UFSTAT_OFFSET		0x18
-#define UMSTAT_OFFSET		0x1C
-#define UTXH_OFFSET		0x20
-#define URXH_OFFSET		0x24
-#define UBRDIV_OFFSET		0x28
-#define UDIVSLOT_OFFSET		0x2C
-#define UINTP_OFFSET		0x30
-#define UINTSP_OFFSET		0x34
-#define UINTM_OFFSET		0x38
-
-#define ULCON0_REG		__REG(0x7F005000)
-#define UCON0_REG		__REG(0x7F005004)
-#define UFCON0_REG		__REG(0x7F005008)
-#define UMCON0_REG		__REG(0x7F00500C)
-#define UTRSTAT0_REG		__REG(0x7F005010)
-#define UERSTAT0_REG		__REG(0x7F005014)
-#define UFSTAT0_REG		__REG(0x7F005018)
-#define UMSTAT0_REG		__REG(0x7F00501c)
-#define UTXH0_REG		__REG(0x7F005020)
-#define URXH0_REG		__REG(0x7F005024)
-#define UBRDIV0_REG		__REG(0x7F005028)
-#define UDIVSLOT0_REG		__REG(0x7F00502c)
-#define UINTP0_REG		__REG(0x7F005030)
-#define UINTSP0_REG		__REG(0x7F005034)
-#define UINTM0_REG		__REG(0x7F005038)
-
-#define ULCON1_REG		__REG(0x7F005400)
-#define UCON1_REG		__REG(0x7F005404)
-#define UFCON1_REG		__REG(0x7F005408)
-#define UMCON1_REG		__REG(0x7F00540C)
-#define UTRSTAT1_REG		__REG(0x7F005410)
-#define UERSTAT1_REG		__REG(0x7F005414)
-#define UFSTAT1_REG		__REG(0x7F005418)
-#define UMSTAT1_REG		__REG(0x7F00541c)
-#define UTXH1_REG		__REG(0x7F005420)
-#define URXH1_REG		__REG(0x7F005424)
-#define UBRDIV1_REG		__REG(0x7F005428)
-#define UDIVSLOT1_REG		__REG(0x7F00542c)
-#define UINTP1_REG		__REG(0x7F005430)
-#define UINTSP1_REG		__REG(0x7F005434)
-#define UINTM1_REG		__REG(0x7F005438)
-
-#define UTRSTAT_TX_EMPTY	(1 << 2)
-#define UTRSTAT_RX_READY	(1 << 0)
-#define UART_ERR_MASK		0xF
-
 /*
  * PWM timer
  */
@@ -804,17 +748,12 @@
 #define DMC_DDR_USER_CONFIG	1
 
 #ifndef __ASSEMBLY__
-enum s3c64xx_uarts_nr {
-	S3C64XX_UART0,
-	S3C64XX_UART1,
-	S3C64XX_UART2,
-};
 
 #include "s3c64x0.h"
 
-static inline s3c64xx_uart *s3c64xx_get_base_uart(enum s3c64xx_uarts_nr nr)
+static inline unsigned long s3c64xx_get_base_uart(void)
 {
-	return (s3c64xx_uart *)(ELFIN_UART_BASE + (nr * 0x400));
+	return ELFIN_UART_BASE;
 }
 
 static inline unsigned long s3c64xx_get_base_nand(void)
arch/arm/include/asm/arch-s3c64xx/s3c64x0.h +0 -31
index 0bbf1d0..7add68c 100644
@@ -40,37 +40,6 @@
 
 #include <asm/types.h>
 
-/* UART (see manual chapter 11) */
-typedef struct {
-	volatile u32	ULCON;
-	volatile u32	UCON;
-	volatile u32	UFCON;
-	volatile u32	UMCON;
-	volatile u32	UTRSTAT;
-	volatile u32	UERSTAT;
-	volatile u32	UFSTAT;
-	volatile u32	UMSTAT;
-#ifdef __BIG_ENDIAN
-	volatile u8	res1[3];
-	volatile u8	UTXH;
-	volatile u8	res2[3];
-	volatile u8	URXH;
-#else /* Little Endian */
-	volatile u8	UTXH;
-	volatile u8	res1[3];
-	volatile u8	URXH;
-	volatile u8	res2[3];
-#endif
-	volatile u32	UBRDIV;
-#ifdef __BIG_ENDIAN
-	volatile u8	res3[2];
-	volatile u16	UDIVSLOT;
-#else
-	volatile u16	UDIVSLOT;
-	volatile u8	res3[2];
-#endif
-} s3c64xx_uart;
-
 /* PWM TIMER (see manual chapter 10) */
 typedef struct {
 	volatile u32	TCNTB;
arch/arm/include/asm/arch-s3c64xx/uart.h new file +54 -0

54 lines not on this page · raw message

board/samsung/smdk6400/lowlevel_init.S +0 -8
index 8bded44..45887f3 100644
@@ -37,14 +37,6 @@
 #include <asm/arch/nand.h>
 #include <asm/arch/s3c6400.h>
 
-#ifdef CONFIG_SERIAL1
-#define ELFIN_UART_CONSOLE_BASE (ELFIN_UART_BASE + ELFIN_UART0_OFFSET)
-#elif defined(CONFIG_SERIAL2)
-#define ELFIN_UART_CONSOLE_BASE (ELFIN_UART_BASE + ELFIN_UART1_OFFSET)
-#else
-#define ELFIN_UART_CONSOLE_BASE (ELFIN_UART_BASE + ELFIN_UART2_OFFSET)
-#endif
-
 _TEXT_BASE:
 	.word	CONFIG_SYS_TEXT_BASE
 
drivers/serial/s3c64xx.c +31 -19

113 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#5 lore raw

PATCH 3/14 S3C64XX: Use readl/writel to operate uart

Quoted 12 lines · Zhong Hongbo

From: Zhong Hongbo <[email protected]>

---
Change for V4:
- None.
Change for v3:
- None.
Change for V2:
- Change the type of the return value from unsinged int to unsinged long for s3c64xx_get_base_uart function.
- Delete const for the local variable.

Quoted 9 lines
---
 arch/arm/include/asm/arch-s3c64xx/s3c6400.h |   65 +--------------------------
 arch/arm/include/asm/arch-s3c64xx/s3c64x0.h |   31 -------------
 arch/arm/include/asm/arch-s3c64xx/uart.h    |   54 ++++++++++++++++++++++
 board/samsung/smdk6400/lowlevel_init.S      |    8 ---
 drivers/serial/s3c64xx.c                    |   50 +++++++++++++--------
 5 files changed, 87 insertions(+), 121 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/uart.h

Please rebase this patch.

Thanks.
Minkyu Kang.

#6 lore raw

PATCH 4/14 S3C64XX: add pwm for s3c64xx support

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

---
Change for V4:
- None.
Change for V3:
- None.
Change for V2:
- Change the type of the return value from unsinged int to unsinged long for s3c64xx_get_base_nand function.

---
 arch/arm/cpu/arm1176/s3c64xx/Makefile       |    1 +
 arch/arm/cpu/arm1176/s3c64xx/pwm.c          |  188 +++++++++++++++++++++++++++
 arch/arm/include/asm/arch-s3c64xx/pwm.h     |   70 ++++++++++
 arch/arm/include/asm/arch-s3c64xx/s3c6400.h |   56 ++-------
 arch/arm/include/asm/arch-s3c64xx/s3c64x0.h |   59 ---------
 include/configs/smdk6400.h                  |    3 +
 6 files changed, 271 insertions(+), 106 deletions(-)
 create mode 100644 arch/arm/cpu/arm1176/s3c64xx/pwm.c
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/pwm.h
 delete mode 100644 arch/arm/include/asm/arch-s3c64xx/s3c64x0.h
arch/arm/cpu/arm1176/s3c64xx/Makefile +1 -0
index 0785b19..966663f 100644
@@ -32,6 +32,7 @@ SOBJS	= reset.o
 
 COBJS-$(CONFIG_S3C6400)	+= cpu_init.o speed.o
 COBJS-y	+= timer.o
+COBJS-$(CONFIG_PWM) += pwm.o
 
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
 
arch/arm/cpu/arm1176/s3c64xx/pwm.c new file +188 -0

188 lines not on this page · raw message

arch/arm/include/asm/arch-s3c64xx/pwm.h new file +70 -0

70 lines not on this page · raw message

arch/arm/include/asm/arch-s3c64xx/s3c6400.h +9 -47

80 lines not on this page · raw message

arch/arm/include/asm/arch-s3c64xx/s3c64x0.h deleted +0 -59

59 lines not on this page · raw message

include/configs/smdk6400.h +3 -0
index 47326d6..d85ddeb 100644
@@ -141,6 +141,9 @@
 
 #define CONFIG_SYS_HZ			1000
 
+/* PWM */
+#define CONFIG_PWM			1
+
 /*-----------------------------------------------------------------------
  * Stack sizes
  *
Signature · 1 line
1.7.5.4
#7 lore raw

PATCH 5/14 S3C64XX: reference s5p cpu time system for s3c64xx timer

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

The old s3c64xx timer is not work normal, Adopt s5p time design, It work perfect.

---
Change for V4:
- None.
Change for V3:
- None.
Change for V2:
- Delete const key word for the variable of struct s3c_timer

---
 arch/arm/cpu/arm1176/s3c64xx/timer.c |  193 ++++++++++++++++------------------
 1 files changed, 93 insertions(+), 100 deletions(-)
arch/arm/cpu/arm1176/s3c64xx/timer.c +93 -100
index f16a37b..47d7731 100644
@@ -1,23 +1,8 @@
 /*
- * (C) Copyright 2003
- * Texas Instruments <www.ti.com>
+ * Copyright (C) 2012
+ * Zhong Hongbo <[email protected]>
  *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <[email protected]>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Alex Zuepke <[email protected]>
- *
- * (C) Copyright 2002-2004
- * Gary Jennejohn, DENX Software Engineering, <[email protected]>
- *
- * (C) Copyright 2004
- * Philippe Robin, ARM Ltd. <[email protected]>
- *
- * (C) Copyright 2008
- * Guennadi Liakhovetki, DENX Software Engineering, <[email protected]>
+ * based on arch/arm/cpu/armv7/s5p-common/timer.c
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -39,64 +24,29 @@
  */
 
 #include <common.h>
-#include <asm/proc-armv/ptrace.h>
+#include <asm/io.h>
 #include <asm/arch/s3c6400.h>
-#include <div64.h>
-
-static ulong timer_load_val;
+#include <asm/arch/pwm.h>
+#include <pwm.h>
 
-#define PRESCALER	167
+DECLARE_GLOBAL_DATA_PTR;
 
-static s3c64xx_timers *s3c64xx_get_base_timers(void)
-{
-	return (s3c64xx_timers *)ELFIN_TIMER_BASE;
-}
+static unsigned long get_current_tick(void);
 
 /* macro to read the 16 bit timer */
-static inline ulong read_timer(void)
+static inline struct s3c_timer *s3c_get_base_timer(void)
 {
-	s3c64xx_timers *const timers = s3c64xx_get_base_timers();
-
-	return timers->TCNTO4;
+	return (struct s3c_timer *)s3c64xx_get_base_timer();
 }
 
-/* Internal tick units */
-/* Last decremneter snapshot */
-static unsigned long lastdec;
-/* Monotonic incrementing timer */
-static unsigned long long timestamp;
-
 int timer_init(void)
 {
-	s3c64xx_timers *const timers = s3c64xx_get_base_timers();
-
-	/* use PWM Timer 4 because it has no output */
-	/*
-	 * We use the following scheme for the timer:
-	 * Prescaler is hard fixed at 167, divider at 1/4.
-	 * This gives at PCLK frequency 66MHz approx. 10us ticks
-	 * The timer is set to wrap after 100s, at 66MHz this obviously
-	 * happens after 10,000,000 ticks. A long variable can thus
-	 * keep values up to 40,000s, i.e., 11 hours. This should be
-	 * enough for most uses:-) Possible optimizations: select a
-	 * binary-friendly frequency, e.g., 1ms / 128. Also calculate
-	 * the prescaler automatically for other PCLK frequencies.
-	 */
-	timers->TCFG0 = PRESCALER << 8;
-	if (timer_load_val == 0) {
-		timer_load_val = get_PCLK() / PRESCALER * (100 / 4); /* 100s */
-		timers->TCFG1 = (timers->TCFG1 & ~0xf0000) | 0x20000;
-	}
-
-	/* load value for 10 ms timeout */
-	lastdec = timers->TCNTB4 = timer_load_val;
-	/* auto load, manual update of Timer 4 */
-	timers->TCON = (timers->TCON & ~0x00700000) | TCON_4_AUTO |
-		TCON_4_UPDATE;
+	/* PWM Timer 4 */
+	pwm_init(4, MUX_DIV_2, 0);
+	pwm_config(4, 0, 0);
+	pwm_enable(4);
 
-	/* auto load, start Timer 4 */
-	timers->TCON = (timers->TCON & ~0x00700000) | TCON_4_AUTO | COUNT_4_ON;
-	timestamp = 0;
+	reset_timer_masked();
 
 	return 0;
 }
@@ -104,57 +54,100 @@ int timer_init(void)
 /*
  * timer without interrupts
  */
-
-/*
- * This function is derived from PowerPC code (read timebase as long long).
- * On ARM it just returns the timer value.
- */
-unsigned long long get_ticks(void)
+unsigned long get_timer(unsigned long base)
 {
-	ulong now = read_timer();
+	return get_timer_masked() - base;
+}
 
-	if (lastdec >= now) {
-		/* normal mode */
-		timestamp += lastdec - now;
+/* delay x useconds */
+void __udelay(unsigned long usec)
+{
+	struct s3c_timer *timer = s3c_get_base_timer();
+	unsigned long tmo, tmp, count_value;
+
+	count_value = readl(&timer->tcntb4);
+
+	if (usec >= 1000) {
+		/*
+		 * if "big" number, spread normalization
+		 * to seconds
+		 * 1. start to normalize for usec to ticks per sec
+		 * 2. find number of "ticks" to wait to achieve target
+		 * 3. finish normalize.
+		 */
+		tmo = usec / 1000;
+		tmo *= (CONFIG_SYS_HZ * count_value);
+		tmo /= 1000;
 	} else {
-		/* we have an overflow ... */
-		timestamp += lastdec + timer_load_val - now;
+		/* else small number, don't kill it prior to HZ multiply */
+		tmo = usec * CONFIG_SYS_HZ * count_value;
+		tmo /= (1000 * 1000);
 	}
-	lastdec = now;
 
-	return timestamp;
+	/* get current timestamp */
+	tmp = get_current_tick();
+
+	/* if setting this fordward will roll time stamp */
+	/* reset "advancing" timestamp to 0, set lastinc value */
+	/* else, set advancing stamp wake up time */
+	if ((tmo + tmp + 1) < tmp)
+		reset_timer_masked();
+	else
+		tmo += tmp;
+
+	/* loop till event */
+	while (get_current_tick() < tmo)
+
+		;	/* nop */
 }
 
-/*
- * 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)
+void reset_timer_masked(void)
 {
-	/* We overrun in 100s */
-	return (ulong)(timer_load_val / 100);
+	struct s3c_timer *timer = s3c_get_base_timer();
+
+	/* reset time */
+	gd->lastinc = readl(&timer->tcnto4);
+	gd->tbl = 0;
 }
 
-ulong get_timer_masked(void)
+unsigned long get_timer_masked(void)
 {
-	unsigned long long res = get_ticks();
-	do_div (res, (timer_load_val / (100 * CONFIG_SYS_HZ)));
-	return res;
+	struct s3c_timer *timer = s3c_get_base_timer();
+	unsigned long count_value = readl(&timer->tcntb4);
+
+	return get_current_tick() / count_value;
 }
 
-ulong get_timer(ulong base)
+static unsigned long get_current_tick(void)
 {
-	return get_timer_masked() - base;
+	struct s3c_timer *timer = s3c_get_base_timer();
+	unsigned long now = readl(&timer->tcnto4);
+	unsigned long count_value = readl(&timer->tcntb4);
+
+	if (gd->lastinc >= now)
+		gd->tbl += gd->lastinc - now;
+	else
+		gd->tbl += gd->lastinc + count_value - now;
+
+	gd->lastinc = now;
+
+	return gd->tbl;
 }
 
-void __udelay(unsigned long usec)
+/*
+ * This function is derived from PowerPC code (read timebase as long long).
+ * On ARM it just returns the timer value.
+ */
+unsigned long long get_ticks(void)
 {
-	unsigned long long tmp;
-	ulong tmo;
-
-	tmo = (usec + 9) / 10;
-	tmp = get_ticks() + tmo;	/* get current timestamp */
+	return get_timer(0);
+}
 
-	while (get_ticks() < tmp)/* loop till event */
-		 /*NOP*/;
+/*
+ * This function is derived from PowerPC code (timebase clock frequency).
+ * On ARM it returns the number of timer ticks per second.
+ */
+unsigned long get_tbclk(void)
+{
+	return CONFIG_SYS_HZ;
 }
Signature · 1 line
1.7.5.4
#8 lore raw

PATCH 5/14 S3C64XX: reference s5p cpu time system for s3c64xx timer

Quoted 176 lines · Zhong Hongbo

From: Zhong Hongbo <[email protected]>

The old s3c64xx timer is not work normal, Adopt s5p time design, It work perfect.

---
Change for V4:
- None.
Change for V3:
- None.
Change for V2:
- Delete const key word for the variable of struct s3c_timer

---
 arch/arm/cpu/arm1176/s3c64xx/timer.c |  193 ++++++++++++++++------------------
 1 files changed, 93 insertions(+), 100 deletions(-)
arch/arm/cpu/arm1176/s3c64xx/timer.c +43 -79
index f16a37b..47d7731 100644
@@ -1,23 +1,8 @@
 /*
- * (C) Copyright 2003
- * Texas Instruments <www.ti.com>
+ * Copyright (C) 2012
+ * Zhong Hongbo <[email protected]>
  *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <[email protected]>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Alex Zuepke <[email protected]>
- *
- * (C) Copyright 2002-2004
- * Gary Jennejohn, DENX Software Engineering, <[email protected]>
- *
- * (C) Copyright 2004
- * Philippe Robin, ARM Ltd. <[email protected]>
- *
- * (C) Copyright 2008
- * Guennadi Liakhovetki, DENX Software Engineering, <[email protected]>
+ * based on arch/arm/cpu/armv7/s5p-common/timer.c
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -39,64 +24,29 @@
  */
 
 #include <common.h>
-#include <asm/proc-armv/ptrace.h>
+#include <asm/io.h>
 #include <asm/arch/s3c6400.h>
-#include <div64.h>
-
-static ulong timer_load_val;
+#include <asm/arch/pwm.h>
+#include <pwm.h>
 
-#define PRESCALER	167
+DECLARE_GLOBAL_DATA_PTR;
 
-static s3c64xx_timers *s3c64xx_get_base_timers(void)
-{
-	return (s3c64xx_timers *)ELFIN_TIMER_BASE;
-}
+static unsigned long get_current_tick(void);
 
 /* macro to read the 16 bit timer */
-static inline ulong read_timer(void)
+static inline struct s3c_timer *s3c_get_base_timer(void)
 {
-	s3c64xx_timers *const timers = s3c64xx_get_base_timers();
-
-	return timers->TCNTO4;
+	return (struct s3c_timer *)s3c64xx_get_base_timer();
 }
 
-/* Internal tick units */
-/* Last decremneter snapshot */
-static unsigned long lastdec;
-/* Monotonic incrementing timer */
-static unsigned long long timestamp;
-
 int timer_init(void)
 {
-	s3c64xx_timers *const timers = s3c64xx_get_base_timers();
-
-	/* use PWM Timer 4 because it has no output */
-	/*
-	 * We use the following scheme for the timer:
-	 * Prescaler is hard fixed at 167, divider at 1/4.
-	 * This gives at PCLK frequency 66MHz approx. 10us ticks
-	 * The timer is set to wrap after 100s, at 66MHz this obviously
-	 * happens after 10,000,000 ticks. A long variable can thus
-	 * keep values up to 40,000s, i.e., 11 hours. This should be
-	 * enough for most uses:-) Possible optimizations: select a
-	 * binary-friendly frequency, e.g., 1ms / 128. Also calculate
-	 * the prescaler automatically for other PCLK frequencies.
-	 */
-	timers->TCFG0 = PRESCALER << 8;
-	if (timer_load_val == 0) {
-		timer_load_val = get_PCLK() / PRESCALER * (100 / 4); /* 100s */
-		timers->TCFG1 = (timers->TCFG1 & ~0xf0000) | 0x20000;
-	}
-
-	/* load value for 10 ms timeout */
-	lastdec = timers->TCNTB4 = timer_load_val;
-	/* auto load, manual update of Timer 4 */
-	timers->TCON = (timers->TCON & ~0x00700000) | TCON_4_AUTO |
-		TCON_4_UPDATE;
+	/* PWM Timer 4 */
+	pwm_init(4, MUX_DIV_2, 0);
+	pwm_config(4, 0, 0);
+	pwm_enable(4);
 
-	/* auto load, start Timer 4 */
-	timers->TCON = (timers->TCON & ~0x00700000) | TCON_4_AUTO | COUNT_4_ON;
-	timestamp = 0;
+	reset_timer_masked();
 
 	return 0;
 }
@@ -104,57 +54,100 @@ int timer_init(void)
 /*
  * timer without interrupts
  */
-
-/*
- * This function is derived from PowerPC code (read timebase as long long).
- * On ARM it just returns the timer value.
- */
-unsigned long long get_ticks(void)
+unsigned long get_timer(unsigned long base)
 {
-	ulong now = read_timer();
+	return get_timer_masked() - base;
+}
 
-	if (lastdec >= now) {
-		/* normal mode */
-		timestamp += lastdec - now;
+/* delay x useconds */
+void __udelay(unsigned long usec)
+{
+	struct s3c_timer *timer = s3c_get_base_timer();
+	unsigned long tmo, tmp, count_value;
+
+	count_value = readl(&timer->tcntb4);
+
+	if (usec >= 1000) {
+		/*
+		 * if "big" number, spread normalization
+		 * to seconds
+		 * 1. start to normalize for usec to ticks per sec
+		 * 2. find number of "ticks" to wait to achieve target
+		 * 3. finish normalize.
+		 */
+		tmo = usec / 1000;
+		tmo *= (CONFIG_SYS_HZ * count_value);
+		tmo /= 1000;
 	} else {
-		/* we have an overflow ... */
-		timestamp += lastdec + timer_load_val - now;
+		/* else small number, don't kill it prior to HZ multiply */
+		tmo = usec * CONFIG_SYS_HZ * count_value;
+		tmo /= (1000 * 1000);
 	}
-	lastdec = now;
 
-	return timestamp;
+	/* get current timestamp */
+	tmp = get_current_tick();
+

arch/arm/cpu/arm1176/s3c64xx/timer.c int timer_init(void) · line 99

Quoted 10 lines
arch/arm/cpu/arm1176/s3c64xx/timer.c +10 -0
+	/* if setting this fordward will roll time stamp */
+	/* reset "advancing" timestamp to 0, set lastinc value */
+	/* else, set advancing stamp wake up time */
+	if ((tmo + tmp + 1) < tmp)
+		reset_timer_masked();
+	else
+		tmo += tmp;
+
+	/* loop till event */
+	while (get_current_tick() < tmo)

please remove this blank line

arch/arm/cpu/arm1176/s3c64xx/timer.c int timer_init(void) · line 103

Quoted 4 lines
arch/arm/cpu/arm1176/s3c64xx/timer.c +2 -0
+
+		;	/* nop */
 }
 

Thanks.
Minkyu Kang.

#9 lore raw

PATCH 6/14 S3C64xx: mov cpu_init.S to the board directory

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

It just only do the memory init. The memory depend on the design of board.

---
Change for V4:
- None.
Change for V3:
- None.
Change for V2:
- None.

---
 arch/arm/cpu/arm1176/s3c64xx/Makefile   |    2 +-
 arch/arm/cpu/arm1176/s3c64xx/cpu_init.S |  135 -------------------------------
 board/samsung/smdk6400/Makefile         |    2 +-
 board/samsung/smdk6400/mem_init.S       |  135 +++++++++++++++++++++++++++++++
 4 files changed, 137 insertions(+), 137 deletions(-)
 delete mode 100644 arch/arm/cpu/arm1176/s3c64xx/cpu_init.S
 create mode 100644 board/samsung/smdk6400/mem_init.S
arch/arm/cpu/arm1176/s3c64xx/Makefile +1 -1
index 966663f..2f37431 100644
@@ -30,7 +30,7 @@ LIB	= $(obj)lib$(SOC).o
 
 SOBJS	= reset.o
 
-COBJS-$(CONFIG_S3C6400)	+= cpu_init.o speed.o
+COBJS-$(CONFIG_S3C64XX)	+= speed.o
 COBJS-y	+= timer.o
 COBJS-$(CONFIG_PWM) += pwm.o
 
arch/arm/cpu/arm1176/s3c64xx/cpu_init.S deleted +0 -135

135 lines not on this page · raw message

board/samsung/smdk6400/Makefile +1 -1
index 0d3e63b..645c8e2 100644
@@ -29,7 +29,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(BOARD).o
 
 COBJS-y	:= smdk6400.o
-SOBJS	:= lowlevel_init.o
+SOBJS	:= lowlevel_init.o mem_init.o
 
 SRCS    := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS-y))
board/samsung/smdk6400/mem_init.S new file +135 -0

135 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#10 lore raw

PATCH 7/14 S3C6400: Adopt SPL framwork to support spl for nand flash

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

Adopt the new SPL framework to implement the SPL booting of the nand flash for S3C6400.

---
Change for V4:
- Adjust the patch's order.
Change for V3:
- None.
Change for V2:
- seprate some code.

---
 arch/arm/cpu/arm1176/start.S                    |   16 +---
 board/samsung/smdk6400/Makefile                 |   29 +++++-
 board/samsung/smdk6400/lowlevel_init.S          |   22 ++--
 board/samsung/smdk6400/smdk6400_nand_spl.c      |   61 ++++++++++--
 board/samsung/smdk6400/tools/mksmdk6400_image.c |  117 +++++++++++++++++++++++
 drivers/mtd/nand/s3c64xx.c                      |    4 +-
 include/configs/smdk6400.h                      |   21 +++--
 7 files changed, 221 insertions(+), 49 deletions(-)
 create mode 100644 board/samsung/smdk6400/tools/mksmdk6400_image.c
arch/arm/cpu/arm1176/start.S +4 -12
index d613641..761b7fe 100644
@@ -51,7 +51,7 @@
 
 .globl _start
 _start: b	reset
-#ifndef CONFIG_NAND_SPL
+#ifndef CONFIG_SPL_BUILD
 	ldr	pc, _undefined_instruction
 	ldr	pc, _software_interrupt
 	ldr	pc, _prefetch_abort
@@ -164,7 +164,7 @@ cpu_init_crit:
 	 * When booting from NAND - it has definitely been a reset, so, no need
 	 * to flush caches and disable the MMU
 	 */
-#ifndef CONFIG_NAND_SPL
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * flush v4 I/D caches
 	 */
@@ -357,21 +357,14 @@ clbss_l:cmp	r0, r1			/* clear loop... */
 	add	r0, r0, #4
 	b	clbss_l
 clbss_e:
-#ifndef CONFIG_NAND_SPL
 	bl coloured_LED_init
 	bl red_led_on
 #endif
-#endif
 
 /*
  * We are done. Do not return, instead branch to second part of board
  * initialization, now running from RAM.
  */
-#ifdef CONFIG_NAND_SPL
-	ldr     pc, _nand_boot
-
-_nand_boot: .word nand_boot
-#else
 	ldr	r0, _board_init_r_ofs
 	adr	r1, _start
 	add	lr, r0, r1
@@ -384,7 +377,6 @@ _nand_boot: .word nand_boot
 
 _board_init_r_ofs:
 	.word board_init_r - _start
-#endif
 
 _rel_dyn_start_ofs:
 	.word __rel_dyn_start - _start
@@ -398,7 +390,7 @@ _mmu_table_base:
 	.word mmu_table
 #endif
 
-#ifndef CONFIG_NAND_SPL
+#ifndef CONFIG_SPL_BUILD
 /*
  * we assume that cache operation is done before. (eg. cleanup_before_linux())
  * actually, we don't need to do anything about cache if not use d-cache in
@@ -576,4 +568,4 @@ fiq:
 	get_bad_stack
 	bad_save_user_regs
 	bl	do_fiq
-#endif /* CONFIG_NAND_SPL */
+#endif /* CONFIG_SPL_BUILD */
board/samsung/smdk6400/Makefile +24 -5
index 645c8e2..f7fa667 100644
@@ -28,15 +28,34 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).o
 
+ifndef CONFIG_SPL_BUILD
 COBJS-y	:= smdk6400.o
+endif
+
 SOBJS	:= lowlevel_init.o mem_init.o
 
-SRCS    := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y))
-SOBJS	:= $(addprefix $(obj),$(SOBJS))
+ifdef CONFIG_SPL_BUILD
+COBJS-y += smdk6400_nand_spl.o
+endif
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS-y) $(SOBJS))
+
+ALL	:=	 $(obj).depend $(LIB)
+
+ifdef CONFIG_SPL_BUILD
+ALL	+= $(OBJTREE)/tools/mk$(BOARD)spl
+endif
+
+all:	$(ALL)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
 
-$(LIB):	$(obj).depend $(SOBJS) $(OBJS)
-	$(call cmd_link_o_target, $(SOBJS) $(OBJS))
+ifdef CONFIG_SPL_BUILD
+$(OBJTREE)/tools/mk$(BOARD)spl:	tools/mksmdk6400_image.c
+	$(HOSTCC) tools/mksmdk6400_image.c -o $(OBJTREE)/tools/mk$(BOARD)spl
+endif
 
 #########################################################################
 
board/samsung/smdk6400/lowlevel_init.S +11 -11
index 45887f3..93172e7 100644
@@ -84,18 +84,12 @@ lowlevel_init:
 	str	r3, [r0, #oVECTADDR]
 	str	r3, [r1, #oVECTADDR]
 
+#ifdef CONFIG_SPL_BUILD
 	/* init system clock */
-	bl system_clock_init
+	bl	system_clock_init
 
-#ifndef CONFIG_NAND_SPL
-	/* for UART */
-	bl uart_asm_init
-#endif
-
-#ifdef CONFIG_BOOT_NAND
 	/* simple init for NAND */
-	bl nand_asm_init
-#endif
+	bl	nand_asm_init
 
 	/* Memory subsystem address 0x7e00f120 */
 	ldr	r0, =ELFIN_MEM_SYS_CFG
@@ -105,6 +99,12 @@ lowlevel_init:
 	str	r1, [r0]
 
 	bl	mem_ctrl_asm_init
+#endif
+
+#ifndef CONFIG_SPL_BUILD
+	/* for UART */
+	bl	uart_asm_init
+#endif
 
 /* Wakeup support. Don't know if it's going to be used, untested. */
 	ldr	r0, =(ELFIN_CLOCK_POWER_BASE + RST_STAT_OFFSET)
@@ -244,7 +244,7 @@ wait_for_async:
 	mov	pc, lr
 
 
-#ifndef CONFIG_NAND_SPL
+#ifndef CONFIG_SPL_BUILD
 /*
  * uart_asm_init: Initialize UART's pins
  */
@@ -256,7 +256,7 @@ uart_asm_init:
 	mov	pc, lr
 #endif
 
-#ifdef CONFIG_BOOT_NAND
+#ifdef CONFIG_SPL_BUILD
 /*
  * NAND Interface init for SMDK6400
  */
board/samsung/smdk6400/smdk6400_nand_spl.c +50 -11

72 lines not on this page · raw message

board/samsung/smdk6400/tools/mksmdk6400_image.c new file +117 -0

117 lines not on this page · raw message

drivers/mtd/nand/s3c64xx.c +2 -2
index 3199bf1..b85b641 100644
@@ -39,7 +39,7 @@
 #define MAX_CHIPS	2
 static int nand_cs[MAX_CHIPS] = {0, 1};
 
-#ifdef CONFIG_NAND_SPL
+#ifdef CONFIG_SPL_BUILD
 #define printf(arg...) do {} while (0)
 #endif
 
@@ -285,7 +285,7 @@ int board_nand_init(struct nand_chip *nand)
 	nand->dev_ready		= s3c_nand_device_ready;
 	nand->select_chip	= s3c_nand_select_chip;
 	nand->options		= 0;
-#ifdef CONFIG_NAND_SPL
+#ifdef CONFIG_SPL_BUILD
 	nand->read_byte		= nand_read_byte;
 	nand->write_buf		= nand_write_buf;
 	nand->read_buf		= nand_read_buf;
include/configs/smdk6400.h +13 -8
index d85ddeb..c63aef8 100644
@@ -238,11 +238,10 @@
 #define CONFIG_SYS_NAND_YAFFS_WRITE	1  /* support yaffs write		      */
 #define CONFIG_SYS_NAND_BBT_2NDPAGE	1  /* bad-block markers in 1st and 2nd pages  */
 
-#define CONFIG_SYS_NAND_U_BOOT_DST	CONFIG_SYS_PHY_UBOOT_BASE	/* NUB load-addr      */
-#define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_NAND_U_BOOT_DST	/* NUB start-addr     */
-
-#define CONFIG_SYS_NAND_U_BOOT_OFFS	(4 * 1024)	/* Offset to RAM U-Boot image */
-#define CONFIG_SYS_NAND_U_BOOT_SIZE	(252 * 1024)	/* Size of RAM U-Boot image   */
+/* Offset to RAM U-Boot image */
+#define CONFIG_SYS_NAND_U_BOOT_OFFS	(16 * 1024)
+/* Size of RAM U-Boot image   */
+#define CONFIG_SYS_NAND_U_BOOT_SIZE	(252 * 1024)
 
 /* NAND chip page size		*/
 #define CONFIG_SYS_NAND_PAGE_SIZE	2048
@@ -266,8 +265,6 @@
 				 48, 49, 50, 51, 52, 53, 54, 55, \
 				 56, 57, 58, 59, 60, 61, 62, 63}
 
-/* Boot configuration (define only one of next 3) */
-#define CONFIG_BOOT_NAND
 /* None of these are currently implemented. Left from the original Samsung
  * version for reference
 #define CONFIG_BOOT_NOR
@@ -275,7 +272,15 @@
 #define CONFIG_BOOT_ONENAND
 */
 
-#define CONFIG_NAND
+#define CONFIG_SPL
+#define CONFIG_SPL_NAND
+#define CONFIG_SPL_NAND_SIMPLE
+#define CONFIG_SPL_NAND_SUPPORT
+
+#define CONFIG_SPL_TEXT_BASE	0x0
+#define CONFIG_SPL_STACK  CONFIG_SYS_PHY_UBOOT_BASE - CONFIG_SYS_MALLOC_LEN
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+
 #define CONFIG_NAND_S3C64XX
 /* Unimplemented or unsupported. See comment above.
 #define CONFIG_ONENAND
Signature · 1 line
1.7.5.4
#11 lore raw

PATCH 8/14 S3C6400: Delete nand_spl for S3C6400

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

The old spl use nand_spl directory file to support nand flash boot. We will adopt the new SPL framework to implement it.

---
Change for V4:
- Adjust the patch's order.
Change for V3:
- Delete u-boot-nand.lds.
Change for V2:
- None.

---
 board/samsung/smdk6400/config.mk           |   28 -------
 board/samsung/smdk6400/u-boot-nand.lds     |   84 --------------------
 boards.cfg                                 |    4 +-
 include/configs/smdk6400.h                 |    2 +-
 nand_spl/board/samsung/smdk6400/Makefile   |  117 ----------------------------
 nand_spl/board/samsung/smdk6400/config.mk  |   40 ----------
 nand_spl/board/samsung/smdk6400/u-boot.lds |   78 ------------------
 7 files changed, 3 insertions(+), 350 deletions(-)
 delete mode 100644 board/samsung/smdk6400/config.mk
 delete mode 100644 board/samsung/smdk6400/u-boot-nand.lds
 delete mode 100644 nand_spl/board/samsung/smdk6400/Makefile
 delete mode 100644 nand_spl/board/samsung/smdk6400/config.mk
 delete mode 100644 nand_spl/board/samsung/smdk6400/u-boot.lds
board/samsung/smdk6400/config.mk deleted +0 -28
deleted file mode 100644
index 93a1a0d..0000000
@@ -1,28 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <[email protected]>
-# David Mueller, ELSOFT AG, <[email protected]>
-#
-# (C) Copyright 2008
-# Guennadi Liakhovetki, DENX Software Engineering, <[email protected]>
-#
-# SAMSUNG SMDK6400 board with mDirac3 (ARM1176) cpu
-#
-# see http://www.samsung.com/ for more information on SAMSUNG
-
-# On SMDK6400 we use the 64 MB SDRAM bank at
-#
-# 0x50000000 to 0x58000000
-#
-# Linux-Kernel is expected to be at 0x50008000, entry 0x50008000
-#
-# we load ourselves to 0x57e00000 without MMU
-# with MMU, load address is changed to 0xc7e00000
-#
-# download area is 0x5000c000
-
-ifndef CONFIG_NAND_SPL
-CONFIG_SYS_TEXT_BASE = $(CONFIG_RAM_TEXT)
-else
-CONFIG_SYS_TEXT_BASE = 0
-endif
board/samsung/smdk6400/u-boot-nand.lds deleted +0 -84

84 lines not on this page · raw message

boards.cfg +2 -2
index 0363b41..491459a 100644
@@ -47,8 +47,8 @@ flea3                        arm         arm1136     -                   CarMedi
 mx35pdk                      arm         arm1136     -                   freescale      mx35
 apollon			     arm	 arm1136     apollon		 -	        omap24xx
 omap2420h4                   arm         arm1136     -                   ti             omap24xx
-smdk6400                     arm         arm1176     smdk6400            samsung        s3c64xx      smdk6400:NAND_U_BOOT,RAM_TEXT=0xc7e00000
-smdk6400_nousb               arm         arm1176     smdk6400            samsung        s3c64xx      smdk6400:NAND_U_BOOT,RAM_TEXT=0x57e00000
+smdk6400                     arm         arm1176     smdk6400            samsung        s3c64xx      smdk6400:SYS_TEXT_BASE=0x57e00000
+smdk6400_nousb               arm         arm1176     smdk6400            samsung        s3c64xx      smdk6400:SYS_TEXT_BASE=0xc7e00000
 tnetv107x_evm                arm         arm1176     tnetv107xevm        ti             tnetv107x
 integratorap_cm720t          arm         arm720t     integrator          armltd         -           integratorap:CM720T
 integratorap_cm920t          arm         arm920t     integrator          armltd         -           integratorap:CM920T
include/configs/smdk6400.h +1 -1
index c63aef8..6ea587d 100644
@@ -54,7 +54,7 @@
 /* input clock of PLL: SMDK6400 has 12MHz input clock */
 #define CONFIG_SYS_CLK_FREQ	12000000
 
-#if !defined(CONFIG_NAND_U_BOOT) && (CONFIG_SYS_TEXT_BASE >= 0xc0000000)
+#if !defined(CONFIG_SPL_BUILD) && (CONFIG_SYS_TEXT_BASE >= 0xc0000000)
 #define CONFIG_ENABLE_MMU
 #endif
 
nand_spl/board/samsung/smdk6400/Makefile deleted +0 -117

117 lines not on this page · raw message

nand_spl/board/samsung/smdk6400/config.mk deleted +0 -40
deleted file mode 100644
index 8bea498..0000000
@@ -1,40 +0,0 @@
-#
-# (C) Copyright 2006
-# Stefan Roese, DENX Software Engineering, sr at denx.de.
-#
-# 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
-#
-#
-# Samsung S3C64xx Reference Platform (smdk6400) board
-
-# CONFIG_SYS_TEXT_BASE for SPL:
-#
-# On S3C64xx platforms the SPL is located in SRAM@0.
-#
-# CONFIG_SYS_TEXT_BASE = 0
-
-include $(TOPDIR)/board/$(BOARDDIR)/config.mk
-
-# PAD_TO used to generate a 4kByte binary needed for the combined image
-# -> PAD_TO = CONFIG_SYS_TEXT_BASE + 4096
-PAD_TO	:= $(shell expr $$[$(CONFIG_SYS_TEXT_BASE) + 4096])
-
-ifeq ($(debug),1)
-PLATFORM_CPPFLAGS += -DDEBUG
-endif
nand_spl/board/samsung/smdk6400/u-boot.lds deleted +0 -78

78 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#12 lore raw

PATCH 9/14 S3C64XX: Change SROM init to use read/write operation

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

---
Change for V4:
- None.
Change for V3:
- None.
Change for V2:
- Change the type of return for s3c64xx_get_base_sromc function.

---
 arch/arm/cpu/arm1176/s3c64xx/Makefile       |    2 +-
 arch/arm/cpu/arm1176/s3c64xx/srom.c         |   51 +++++++++++++++++++++++++++
 arch/arm/include/asm/arch-s3c64xx/s3c6400.h |   13 +++----
 arch/arm/include/asm/arch-s3c64xx/sromc.h   |   49 +++++++++++++++++++++++++
 board/samsung/smdk6400/smdk6400.c           |   38 ++++++++++++++------
 include/configs/smdk6400.h                  |    1 +
 6 files changed, 134 insertions(+), 20 deletions(-)
 create mode 100644 arch/arm/cpu/arm1176/s3c64xx/srom.c
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/sromc.h
arch/arm/cpu/arm1176/s3c64xx/Makefile +1 -1
index 2f37431..28786bf 100644
@@ -30,7 +30,7 @@ LIB	= $(obj)lib$(SOC).o
 
 SOBJS	= reset.o
 
-COBJS-$(CONFIG_S3C64XX)	+= speed.o
+COBJS-$(CONFIG_S3C64XX)	+= speed.o srom.o
 COBJS-y	+= timer.o
 COBJS-$(CONFIG_PWM) += pwm.o
 
arch/arm/cpu/arm1176/s3c64xx/srom.c new file +51 -0

51 lines not on this page · raw message

arch/arm/include/asm/arch-s3c64xx/s3c6400.h +5 -8
index b884763..d2ee9d2 100644
@@ -471,14 +471,6 @@
  */
 #define ELFIN_SROM_BASE		0x70000000
 
-#define SROM_BW_REG	__REG(ELFIN_SROM_BASE + 0x0)
-#define SROM_BC0_REG	__REG(ELFIN_SROM_BASE + 0x4)
-#define SROM_BC1_REG	__REG(ELFIN_SROM_BASE + 0x8)
-#define SROM_BC2_REG	__REG(ELFIN_SROM_BASE + 0xC)
-#define SROM_BC3_REG	__REG(ELFIN_SROM_BASE + 0x10)
-#define SROM_BC4_REG	__REG(ELFIN_SROM_BASE + 0x14)
-#define SROM_BC5_REG	__REG(ELFIN_SROM_BASE + 0x18)
-
 /*
  * SDRAM Controller
  */
@@ -722,6 +714,11 @@ static inline unsigned long s3c64xx_get_base_timer(void)
 {
 	return ELFIN_TIMER_BASE;
 }
+
+static inline unsigned long s3c64xx_get_base_sromc(void)
+{
+	return ELFIN_SROM_BASE;
+}
 #endif
 
 #endif /*__S3C6400_H__*/
arch/arm/include/asm/arch-s3c64xx/sromc.h new file +49 -0

49 lines not on this page · raw message

board/samsung/smdk6400/smdk6400.c +27 -11
index c40d1f9..be0e18b 100644
@@ -30,6 +30,7 @@
 
 #include <common.h>
 #include <netdev.h>
+#include <asm/arch/sromc.h>
 #include <asm/arch/s3c6400.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -53,25 +54,40 @@ static inline void delay(unsigned long loops)
 /*
  * Miscellaneous platform dependent initialisations
  */
-
+#ifdef CONFIG_CS8900
 static void cs8900_pre_init(void)
 {
-	SROM_BW_REG &= ~(0xf << 4);
-	SROM_BW_REG |= (1 << 7) | (1 << 6) | (1 << 4);
-	SROM_BC1_REG = ((CS8900_Tacs << 28) + (CS8900_Tcos << 24) +
-			(CS8900_Tacc << 16) + (CS8900_Tcoh << 12) +
-			(CS8900_Tah << 8) + (CS8900_Tacp << 4) + CS8900_PMC);
+	u32 smc_bw_conf, smc_bc_conf;
+
+	/* Ethernet needs bus width of 16 bits */
+	smc_bw_conf = SROMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK)
+			| SROMC_WAIT_ENABLE(CONFIG_ENV_SROM_BANK)
+			| SROMC_BYTE_ENABLE(CONFIG_ENV_SROM_BANK);
+	smc_bc_conf = SROMC_BC_TACS(CS8900_Tacs)
+			| SROMC_BC_TCOS(CS8900_Tcos)
+			| SROMC_BC_TACC(CS8900_Tacc)
+			| SROMC_BC_TCOH(CS8900_Tcoh)
+			| SROMC_BC_TAH(CS8900_Tah)
+			| SROMC_BC_TACP(CS8900_Tacp)
+			| SROMC_BC_PMC(CS8900_PMC);
+
+	/* Select and configure the SROMC bank */
+	s3c64xx_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
+
+}
+#else
+#define cs8900_pre_init() do {} while (0)
+#endif
+
+static void norflash_srom_init(void)
+{
+	u32 smc_bw_conf, smc_bc_conf;
 }
 
 int board_init(void)
 {
 	cs8900_pre_init();
 
-	/* NOR-flash in SROM0 */
-
-	/* Enable WAIT */
-	SROM_BW_REG |= 4 | 8 | 1;
-
 	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 
 	return 0;
include/configs/smdk6400.h +1 -0
index 6ea587d..b770463 100644
@@ -78,6 +78,7 @@
 /*
  * Hardware drivers
  */
+#define CONFIG_ENV_SROM_BANK		2 /* Select SROM Bank-2 for Ethernet*/
 #define CONFIG_CS8900			/* we have a CS8900 on-board	*/
 #define CONFIG_CS8900_BASE	  	0x18800300
 #define CONFIG_CS8900_BUS16		/* follow the Linux driver	*/
Signature · 1 line
1.7.5.4
#13 lore raw

PATCH 9/14 S3C64XX: Change SROM init to use read/write operation

Quoted 208 lines · Zhong Hongbo

From: Zhong Hongbo <[email protected]>

---
Change for V4:
- None.
Change for V3:
- None.
Change for V2:
- Change the type of return for s3c64xx_get_base_sromc function.

---
 arch/arm/cpu/arm1176/s3c64xx/Makefile       |    2 +-
 arch/arm/cpu/arm1176/s3c64xx/srom.c         |   51 +++++++++++++++++++++++++++
 arch/arm/include/asm/arch-s3c64xx/s3c6400.h |   13 +++----
 arch/arm/include/asm/arch-s3c64xx/sromc.h   |   49 +++++++++++++++++++++++++
 board/samsung/smdk6400/smdk6400.c           |   38 ++++++++++++++------
 include/configs/smdk6400.h                  |    1 +
 6 files changed, 134 insertions(+), 20 deletions(-)
 create mode 100644 arch/arm/cpu/arm1176/s3c64xx/srom.c
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/sromc.h
arch/arm/cpu/arm1176/s3c64xx/Makefile +1 -1
index 2f37431..28786bf 100644
@@ -30,7 +30,7 @@ LIB	= $(obj)lib$(SOC).o
 
 SOBJS	= reset.o
 
-COBJS-$(CONFIG_S3C64XX)	+= speed.o
+COBJS-$(CONFIG_S3C64XX)	+= speed.o srom.o
 COBJS-y	+= timer.o
 COBJS-$(CONFIG_PWM) += pwm.o
 
arch/arm/cpu/arm1176/s3c64xx/srom.c new file +51 -0
new file mode 100644
index 0000000..f1b2b34
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2012
+ * Zhong Hongbo <[email protected]>
+ * base on arch/arm/cpu/armv7/s5p-common/sromc.c
+ *
+ * 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 <common.h>
+#include <asm/io.h>
+#include <asm/arch/sromc.h>
+#include <asm/arch/s3c6400.h>
+/*
+ * s3c64xx_config_sromc() - select the proper SROMC Bank and configure the
+ * band width control and bank control registers
+ * srom_bank	- SROM
+ * srom_bw_conf  - SMC Band witdh reg configuration value
+ * srom_bc_conf  - SMC Bank Control reg configuration value
+ */
+void s3c64xx_config_sromc(u32 srom_bank, u32 srom_bw_conf, u32 srom_bc_conf)
+{
+	u32 tmp;
+	struct s3c64xx_sromc *srom =
+		(struct s3c64xx_sromc *)s3c64xx_get_base_sromc();
+
+	/* Configure SMC_BW register to handle proper SROMC bank */
+	tmp = srom->bw;
+	tmp &= ~(0xF << (srom_bank * 4));
+	tmp |= srom_bw_conf;
+
+	writel(tmp, &srom->bw);
+
+	/* Configure SMC_BC register */
+	writel(srom_bc_conf, &srom->bc[srom_bank]);
+}
arch/arm/include/asm/arch-s3c64xx/s3c6400.h +5 -8
index b884763..d2ee9d2 100644
@@ -471,14 +471,6 @@
  */
 #define ELFIN_SROM_BASE		0x70000000
 
-#define SROM_BW_REG	__REG(ELFIN_SROM_BASE + 0x0)
-#define SROM_BC0_REG	__REG(ELFIN_SROM_BASE + 0x4)
-#define SROM_BC1_REG	__REG(ELFIN_SROM_BASE + 0x8)
-#define SROM_BC2_REG	__REG(ELFIN_SROM_BASE + 0xC)
-#define SROM_BC3_REG	__REG(ELFIN_SROM_BASE + 0x10)
-#define SROM_BC4_REG	__REG(ELFIN_SROM_BASE + 0x14)
-#define SROM_BC5_REG	__REG(ELFIN_SROM_BASE + 0x18)
-
 /*
  * SDRAM Controller
  */
@@ -722,6 +714,11 @@ static inline unsigned long s3c64xx_get_base_timer(void)
 {
 	return ELFIN_TIMER_BASE;
 }
+
+static inline unsigned long s3c64xx_get_base_sromc(void)
+{
+	return ELFIN_SROM_BASE;
+}
 #endif
 
 #endif /*__S3C6400_H__*/
arch/arm/include/asm/arch-s3c64xx/sromc.h new file +49 -0
new file mode 100644
index 0000000..fcad635
@@ -0,0 +1,49 @@
+/*
+ * (C) Copyright 2012
+ * Zhong Hongbo <[email protected]>
+ *
+ * base on arch/arm/include/asm/arch-s5pc1xx/sromc.h
+ *
+ * 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
+ */
+
+#ifndef __ASM_ARCH_SROMC_H_
+#define __ASM_ARCH_SROMC_H_
+
+#define SROMC_DATA16_WIDTH(x)    (1 << ((x * 4) + 0))
+#define SROMC_BYTE_ADDR_MODE(x)  (1 << ((x * 4) + 1))
+#define SROMC_WAIT_ENABLE(x)     (1 << ((x * 4) + 2))
+#define SROMC_BYTE_ENABLE(x)     (1 << ((x * 4) + 3))
+
+#define SROMC_BC_TACS(x) (x << 28) /* 0clk     address set-up */
+#define SROMC_BC_TCOS(x) (x << 24) /* 4clk     chip selection set-up */
+#define SROMC_BC_TACC(x) (x << 16) /* 14clk    access cycle */
+#define SROMC_BC_TCOH(x) (x << 12) /* 1clk     chip selection hold */
+#define SROMC_BC_TAH(x)  (x << 8)  /* 4clk     address holding time */
+#define SROMC_BC_TACP(x) (x << 4)  /* 6clk     page mode access cycle */
+#define SROMC_BC_PMC(x)  (x << 0)  /* normal(1data)page mode configuration */
+
+#ifndef __ASSEMBLY__
+struct s3c64xx_sromc {
+	unsigned int	bw;
+	unsigned int	bc[6];
+};
+#endif	/* __ASSEMBLY__ */
+
+/* Configure the Band Width and Bank Control Regs for required SROMC Bank */
+void s3c64xx_config_sromc(u32 srom_bank, u32 srom_bw_conf, u32 srom_bc_conf);
+
+#endif /* __ASM_ARCH_SROMC_H_ */
board/samsung/smdk6400/smdk6400.c +8 -6
index c40d1f9..be0e18b 100644
@@ -30,6 +30,7 @@
 
 #include <common.h>
 #include <netdev.h>
+#include <asm/arch/sromc.h>
 #include <asm/arch/s3c6400.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -53,25 +54,40 @@ static inline void delay(unsigned long loops)
 /*
  * Miscellaneous platform dependent initialisations
  */
-
+#ifdef CONFIG_CS8900
 static void cs8900_pre_init(void)
 {
-	SROM_BW_REG &= ~(0xf << 4);
-	SROM_BW_REG |= (1 << 7) | (1 << 6) | (1 << 4);
-	SROM_BC1_REG = ((CS8900_Tacs << 28) + (CS8900_Tcos << 24) +
-			(CS8900_Tacc << 16) + (CS8900_Tcoh << 12) +
-			(CS8900_Tah << 8) + (CS8900_Tacp << 4) + CS8900_PMC);
+	u32 smc_bw_conf, smc_bc_conf;
+
+	/* Ethernet needs bus width of 16 bits */
+	smc_bw_conf = SROMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK)
+			| SROMC_WAIT_ENABLE(CONFIG_ENV_SROM_BANK)
+			| SROMC_BYTE_ENABLE(CONFIG_ENV_SROM_BANK);

board/samsung/smdk6400/smdk6400.c static inline void delay(unsigned long loops) · line 75

Quoted 10 lines
board/samsung/smdk6400/smdk6400.c +10 -0
+	smc_bc_conf = SROMC_BC_TACS(CS8900_Tacs)
+			| SROMC_BC_TCOS(CS8900_Tcos)
+			| SROMC_BC_TACC(CS8900_Tacc)
+			| SROMC_BC_TCOH(CS8900_Tcoh)
+			| SROMC_BC_TAH(CS8900_Tah)
+			| SROMC_BC_TACP(CS8900_Tacp)
+			| SROMC_BC_PMC(CS8900_PMC);
+
+	/* Select and configure the SROMC bank */
+	s3c64xx_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);

remove blank line.

Quoted 29 lines
board/samsung/smdk6400/smdk6400.c +9 -5
+
+}
+#else
+#define cs8900_pre_init() do {} while (0)
+#endif
+
+static void norflash_srom_init(void)
+{
+	u32 smc_bw_conf, smc_bc_conf;
 }
 
 int board_init(void)
 {
 	cs8900_pre_init();
 
-	/* NOR-flash in SROM0 */
-
-	/* Enable WAIT */
-	SROM_BW_REG |= 4 | 8 | 1;
-
 	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 
 	return 0;
include/configs/smdk6400.h +0 -0
index 6ea587d..b770463 100644

include/configs/smdk6400.h line 84

Quoted 7 lines
include/configs/smdk6400.h +1 -0
@@ -78,6 +78,7 @@
 /*
  * Hardware drivers
  */
+#define CONFIG_ENV_SROM_BANK		2 /* Select SROM Bank-2 for Ethernet*/
 #define CONFIG_CS8900			/* we have a CS8900 on-board	*/
 #define CONFIG_CS8900_BASE	  	0x18800300
 #define CONFIG_CS8900_BUS16		/* follow the Linux driver	*/

Thanks.
Minkyu Kang.

#14 lore raw

PATCH 10/14 S3C64XX: Switch to use read/writel to operation clock system

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

Switch to use read/writel function and clear the relevant variable.

---
Change for V4:
- None.
Change for V3:
- Use C language to re-write reset function.
- Replace the magic numbers witch variale name.
Change for V2:
- merge clock patch.
- Change the type of return for s3c64xx_get_base_clock function.

---
 arch/arm/cpu/arm1176/s3c64xx/Makefile       |    6 +-
 arch/arm/cpu/arm1176/s3c64xx/reset.S        |   34 ----
 arch/arm/cpu/arm1176/s3c64xx/reset.c        |   39 +++++
 arch/arm/cpu/arm1176/s3c64xx/speed.c        |   50 +++++--
 arch/arm/include/asm/arch-s3c64xx/clock.h   |  163 ++++++++++++++++++++
 arch/arm/include/asm/arch-s3c64xx/s3c6400.h |  219 +--------------------------
 board/samsung/smdk6400/lowlevel_init.S      |    3 +
 board/samsung/smdk6400/setup.h              |   47 ++++++
 drivers/usb/host/s3c64xx-hcd.c              |   30 ++++-
 9 files changed, 321 insertions(+), 270 deletions(-)
 delete mode 100644 arch/arm/cpu/arm1176/s3c64xx/reset.S
 create mode 100644 arch/arm/cpu/arm1176/s3c64xx/reset.c
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/clock.h
 create mode 100644 board/samsung/smdk6400/setup.h
arch/arm/cpu/arm1176/s3c64xx/Makefile +2 -4
index 28786bf..16be887 100644
@@ -28,13 +28,11 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).o
 
-SOBJS	= reset.o
-
-COBJS-$(CONFIG_S3C64XX)	+= speed.o srom.o
+COBJS-$(CONFIG_S3C64XX)	+= speed.o srom.o reset.o
 COBJS-y	+= timer.o
 COBJS-$(CONFIG_PWM) += pwm.o
 
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+OBJS	:= $(addprefix $(obj), $(COBJS-y))
 
 all:	$(obj).depend $(START) $(LIB)
 
arch/arm/cpu/arm1176/s3c64xx/reset.S deleted +0 -34
deleted file mode 100644
index eae572e..0000000
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2009 Samsung Electronics.
- * Minkyu Kang <[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 <asm/arch/s3c6400.h>
-
-.globl reset_cpu
-reset_cpu:
-	ldr	r1, =ELFIN_CLOCK_POWER_BASE
-	ldr	r2, [r1, #SYS_ID_OFFSET]
-	ldr	r3, =0xffff
-	and	r2, r3, r2, lsr #12
-	str	r2, [r1, #SW_RST_OFFSET]
-_loop_forever:
-	b	_loop_forever
arch/arm/cpu/arm1176/s3c64xx/reset.c new file +39 -0
new file mode 100644
index 0000000..773cffa
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2012
+ * Zhong Hongbo <[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 <common.h>
+#include <asm/io.h>
+#include <asm/arch/s3c6400.h>
+#include <asm/arch/clock.h>
+
+void reset_cpu(ulong addr)
+{
+	unsigned long sys_id;
+	struct s3c64xx_clock *clk =
+		(struct s3c64xx_clock *)s3c64xx_get_base_clock();
+
+	sys_id = readl(&clk->sys_id);
+	sys_id >>= 12;
+	sys_id &= 0xffff;
+	writel(sys_id, &clk->sw_rst);
+}
arch/arm/cpu/arm1176/s3c64xx/speed.c +35 -15

114 lines not on this page · raw message

arch/arm/include/asm/arch-s3c64xx/clock.h new file +163 -0

163 lines not on this page · raw message

arch/arm/include/asm/arch-s3c64xx/s3c6400.h +5 -214

237 lines not on this page · raw message

board/samsung/smdk6400/lowlevel_init.S +3 -0
index 93172e7..dbf12ef 100644
@@ -35,8 +35,11 @@
 #include <version.h>
 
 #include <asm/arch/nand.h>
+#include <asm/arch/clock.h>
 #include <asm/arch/s3c6400.h>
 
+#include "setup.h"
+
 _TEXT_BASE:
 	.word	CONFIG_SYS_TEXT_BASE
 
board/samsung/smdk6400/setup.h new file +47 -0

47 lines not on this page · raw message

drivers/usb/host/s3c64xx-hcd.c +27 -3
index cd295da..74b5951 100644
@@ -25,21 +25,45 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
 #include <asm/arch/s3c6400.h>
+#include <asm/arch/clock.h>
 
 int usb_cpu_init(void)
 {
-	OTHERS_REG |= 0x10000;
+	unsigned int val;
+	struct s3c64xx_clock *clk =
+			(struct s3c64xx_clock *)s3c64xx_get_base_clock();
+
+	val = readl(&clk->others);
+	val |= 0x10000;
+	writel(val, &clk->others);
+
 	return 0;
 }
 
 int usb_cpu_stop(void)
 {
-	OTHERS_REG &= ~0x10000;
+	unsigned int val;
+	struct s3c64xx_clock *clk =
+			(struct s3c64xx_clock *)s3c64xx_get_base_clock();
+
+	val = readl(&clk->others);
+	val &= ~0x10000;
+	writel(val, &clk->others);
+
 	return 0;
 }
 
 void usb_cpu_init_fail(void)
 {
-	OTHERS_REG &= ~0x10000;
+	unsigned int val;
+	struct s3c64xx_clock *clk =
+			(struct s3c64xx_clock *)s3c64xx_get_base_clock();
+
+	val = readl(&clk->others);
+	val &= ~0x10000;
+	writel(val, &clk->others);
+
+	return 0;
 }
Signature · 1 line
1.7.5.4
#15 lore raw

PATCH 11/14 S3c64xx: clear GPIO, Interrupt, Watchdog variable.

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

---
Change for V4:
- None.
Change for V3:
- Replace the magic numbers with the variable name.
Change for V2:
- None.

---
 arch/arm/include/asm/arch-s3c64xx/gpio.h      |   38 ++++
 arch/arm/include/asm/arch-s3c64xx/interrupt.h |   31 +++
 arch/arm/include/asm/arch-s3c64xx/s3c6400.h   |  258 -------------------------
 board/samsung/smdk6400/lowlevel_init.S        |   16 +-
 board/samsung/smdk6400/setup.h                |   11 +-
 5 files changed, 86 insertions(+), 268 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/gpio.h
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/interrupt.h
arch/arm/include/asm/arch-s3c64xx/gpio.h new file +38 -0
new file mode 100644
index 0000000..979173c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2012
+ * Zhong Hongbo <[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
+ *
+ */
+
+#ifndef __ASM_ARM_ARCH_GPIO_H_
+#define __ASM_ARM_ARCH_GPIO_H_
+
+#define GPACON_OFFSET		0x00
+#define GPADAT_OFFSET		0x04
+#define GPAPUD_OFFSET		0x08
+
+#define GPNCON_OFFSET		0x830
+#define GPNDAT_OFFSET		0x834
+#define GPNPUD_OFFSET		0x838
+
+#define GPKCON0_OFFSET		0x800
+#define GPKCON1_OFFSET		0x804
+#define GPKDAT_OFFSET		0x808
+#define GPKPUD_OFFSET		0x80C
+
+#endif
arch/arm/include/asm/arch-s3c64xx/interrupt.h new file +31 -0
new file mode 100644
index 0000000..49e3ae4
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2012
+ * Zhong Hongbo <[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
+ *
+ */
+
+#ifndef __ASM_ARM_ARCH_INTERRUPT_H_
+#define __ASM_ARM_ARCH_INTERRUPT_H_
+
+#define INTMOD		0x0C	/* VIC INT SELECT (IRQ or FIQ) */
+#define INTUNMSK	0x10	/* VIC INT EN (write 1 to unmask) */
+#define INTMSK		0x14	/* VIC INT EN CLEAR (write 1 to mask) */
+#define INTSUBMSK	0x1C	/* VIC SOFT INT CLEAR */
+#define VECTADDR	0xF00	/* VIC ADDRESS */
+#define EINTPEND_OFFSET	0x924
+#endif
arch/arm/include/asm/arch-s3c64xx/s3c6400.h +0 -258

282 lines not on this page · raw message

board/samsung/smdk6400/lowlevel_init.S +9 -7
index dbf12ef..57989bc 100644
@@ -36,6 +36,8 @@
 
 #include <asm/arch/nand.h>
 #include <asm/arch/clock.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/interrupt.h>
 #include <asm/arch/s3c6400.h>
 
 #include "setup.h"
@@ -65,7 +67,7 @@ lowlevel_init:
 	str	r1, [r0]
 
 	/* External interrupt pending clear */
-	ldr	r0, =(ELFIN_GPIO_BASE+EINTPEND_OFFSET)	/*EINTPEND*/
+	ldr	r0, =(ELFIN_GPIO_BASE + EINTPEND_OFFSET)  /*EINTPEND*/
 	ldr	r1, [r0]
 	str	r1, [r0]
 
@@ -74,18 +76,18 @@ lowlevel_init:
 
 	/* Disable all interrupts (VIC0 and VIC1) */
 	mvn	r3, #0x0
-	str	r3, [r0, #oINTMSK]
-	str	r3, [r1, #oINTMSK]
+	str	r3, [r0, #INTMSK]
+	str	r3, [r1, #INTMSK]
 
 	/* Set all interrupts as IRQ */
 	mov	r3, #0x0
-	str	r3, [r0, #oINTMOD]
-	str	r3, [r1, #oINTMOD]
+	str	r3, [r0, #INTMOD]
+	str	r3, [r1, #INTMOD]
 
 	/* Pending Interrupt Clear */
 	mov	r3, #0x0
-	str	r3, [r0, #oVECTADDR]
-	str	r3, [r1, #oVECTADDR]
+	str	r3, [r0, #VECTADDR]
+	str	r3, [r1, #VECTADDR]
 
 #ifdef CONFIG_SPL_BUILD
 	/* init system clock */
board/samsung/smdk6400/setup.h +8 -3
index 91b1c48..5e97b27 100644
@@ -36,12 +36,17 @@
 #define STARTUP_APLLDIV		0
 
 #define CLK_DIV_VAL ((STARTUP_PCLKDIV << 12) | (STARTUP_HCLKX2DIV << 9) | \
-	(STARTUP_HCLKDIV << 8) | (STARTUP_MPLLDIV<<4) | STARTUP_APLLDIV)
+		(STARTUP_HCLKDIV << 8) | (STARTUP_MPLLDIV<<4) | STARTUP_APLLDIV)
 
 #define MPLL_VAL ((1 << 31) | (STARTUP_MDIV << 16) | (STARTUP_PDIV << 8) | \
-	STARTUP_SDIV)
+		 STARTUP_SDIV)
 
 #define APLL_VAL ((1 << 31) | (STARTUP_AMDIV << 16) | (STARTUP_PDIV << 8) | \
-	STARTUP_SDIV)
+		 STARTUP_SDIV)
 
+#define STARTUP_MPLL (((CONFIG_SYS_CLK_FREQ >> STARTUP_SDIV) / \
+		     STARTUP_PDIV) * STARTUP_MDIV)
+
+#define STARTUP_HCLK (STARTUP_MPLL / (STARTUP_HCLKX2DIV + 1) / \
+		     (STARTUP_HCLKDIV + 1))
 #endif
Signature · 1 line
1.7.5.4
#16 lore raw

PATCH 12/14 S3C6400: clear memory init variable

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

---
Change for V4:
- None.
Change for V3:
- Replace the magic numbers with variable name.
- Use C language to implement memory initialization.
Change for V2:
- None.

---
 arch/arm/include/asm/arch-s3c64xx/dmc.h     |   62 +++++++++
 arch/arm/include/asm/arch-s3c64xx/s3c6400.h |  178 +--------------------------
 board/samsung/smdk6400/Makefile             |    3 +-
 board/samsung/smdk6400/dmc_init.c           |  110 +++++++++++++++++
 board/samsung/smdk6400/lowlevel_init.S      |    2 +-
 board/samsung/smdk6400/mem_init.S           |  135 --------------------
 board/samsung/smdk6400/setup.h              |   85 +++++++++++++
 7 files changed, 265 insertions(+), 310 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/dmc.h
 create mode 100644 board/samsung/smdk6400/dmc_init.c
 delete mode 100644 board/samsung/smdk6400/mem_init.S
arch/arm/include/asm/arch-s3c64xx/dmc.h new file +62 -0
new file mode 100644
index 0000000..758e750
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2012
+ * Zhong Hongbo <[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
+ *
+ */
+#ifndef __ASM_ARCH_DMC_H__
+#define __ASM_ARCH_DMC_H__
+
+#ifndef __ASSEMBLY__
+
+struct s3c64xx_dmc {
+	unsigned int	memstat;
+	unsigned int	memcmd;
+	unsigned int	directcmd;
+	unsigned int	memcfg;
+	unsigned int	refresh;
+	unsigned int	caslat;
+	unsigned int	t_dqss;
+	unsigned int	t_mrd;
+	unsigned int	t_ras;
+	unsigned int	t_rc;
+	unsigned int	t_rcd;
+	unsigned int	t_rfc;
+	unsigned int	t_rp;
+	unsigned int	t_rrd;
+	unsigned int	t_wr;
+	unsigned int	t_wtr;
+	unsigned int	t_xp;
+	unsigned int	t_xsr;
+	unsigned int	t_esr;
+	unsigned int	memcfg2;
+#if defined(CONFIG_S3C6410)
+	unsigned int	memcfg3;
+	unsigned char	res1[0xac];
+#else
+	unsigned char	res1[0xb0];
+#endif
+	unsigned int	id_0_cfg[16];
+	unsigned char	res2[0xc0];
+	unsigned int	chip_0_cfg;
+	unsigned int	chip_1_cfg;
+	unsigned char	res3[0xf8];
+	unsigned int	user_status;
+	unsigned int	user_config;
+};
+#endif
+#endif
arch/arm/include/asm/arch-s3c64xx/s3c6400.h +5 -173

202 lines not on this page · raw message

board/samsung/smdk6400/Makefile +2 -1
index f7fa667..e21a8c1 100644
@@ -31,8 +31,9 @@ LIB	= $(obj)lib$(BOARD).o
 ifndef CONFIG_SPL_BUILD
 COBJS-y	:= smdk6400.o
 endif
+COBJS-y += dmc_init.o
 
-SOBJS	:= lowlevel_init.o mem_init.o
+SOBJS	:= lowlevel_init.o
 
 ifdef CONFIG_SPL_BUILD
 COBJS-y += smdk6400_nand_spl.o
board/samsung/smdk6400/dmc_init.c new file +110 -0

110 lines not on this page · raw message

board/samsung/smdk6400/lowlevel_init.S +1 -1
index 57989bc..e142217 100644
@@ -103,7 +103,7 @@ lowlevel_init:
 	mov	r1, #S3C64XX_MEM_SYS_CFG_NAND
 	str	r1, [r0]
 
-	bl	mem_ctrl_asm_init
+	bl	mem_ctrl_init
 #endif
 
 #ifndef CONFIG_SPL_BUILD
board/samsung/smdk6400/mem_init.S deleted +0 -135

135 lines not on this page · raw message

board/samsung/smdk6400/setup.h +85 -0

89 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#17 lore raw

PATCH 13/14 S3C64XX: Move s3c6400.h to cpu.h to support s3c6410 board

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

---
Change for V4:
- None.
Change for V3:
- Replace ELFIN with S3C64XX for all the variable of cpu.h
- Change __S3C6400_H__ into __CPU__H__
Change for V2:
- New.

---
 arch/arm/cpu/arm1176/s3c64xx/pwm.c          |    2 +-
 arch/arm/cpu/arm1176/s3c64xx/reset.c        |    2 +-
 arch/arm/cpu/arm1176/s3c64xx/speed.c        |    2 +-
 arch/arm/cpu/arm1176/s3c64xx/srom.c         |    2 +-
 arch/arm/cpu/arm1176/s3c64xx/timer.c        |    2 +-
 arch/arm/include/asm/arch-s3c64xx/cpu.h     |   89 +++++++++++++++++++++++++++
 arch/arm/include/asm/arch-s3c64xx/s3c6400.h |   89 ---------------------------
 board/samsung/smdk6400/dmc_init.c           |    2 +-
 board/samsung/smdk6400/lowlevel_init.S      |   26 ++++----
 board/samsung/smdk6400/smdk6400.c           |    2 +-
 drivers/mtd/nand/s3c64xx.c                  |    2 +-
 drivers/serial/s3c64xx.c                    |    2 +-
 drivers/usb/host/s3c64xx-hcd.c              |    2 +-
 13 files changed, 112 insertions(+), 112 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-s3c64xx/cpu.h
 delete mode 100644 arch/arm/include/asm/arch-s3c64xx/s3c6400.h
arch/arm/cpu/arm1176/s3c64xx/pwm.c +1 -1
index fff2c68..534901a 100644
@@ -27,7 +27,7 @@
 #include <errno.h>
 #include <pwm.h>
 #include <asm/io.h>
-#include <asm/arch/s3c6400.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/pwm.h>
 
 int pwm_enable(int pwm_id)
arch/arm/cpu/arm1176/s3c64xx/reset.c +1 -1
index 773cffa..03cb306 100644
@@ -23,7 +23,7 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/s3c6400.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/clock.h>
 
 void reset_cpu(ulong addr)
arch/arm/cpu/arm1176/s3c64xx/speed.c +1 -1
index 05b44b9..5e68090 100644
@@ -32,7 +32,7 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/s3c6400.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/clock.h>
 
 #define APLL 0
arch/arm/cpu/arm1176/s3c64xx/srom.c +1 -1
index f1b2b34..92fb7af 100644
@@ -25,7 +25,7 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/sromc.h>
-#include <asm/arch/s3c6400.h>
+#include <asm/arch/cpu.h>
 /*
  * s3c64xx_config_sromc() - select the proper SROMC Bank and configure the
  * band width control and bank control registers
arch/arm/cpu/arm1176/s3c64xx/timer.c +1 -1
index 47d7731..eebd0c0 100644
@@ -25,7 +25,7 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/s3c6400.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/pwm.h>
 #include <pwm.h>
 
arch/arm/include/asm/arch-s3c64xx/cpu.h new file +89 -0

89 lines not on this page · raw message

arch/arm/include/asm/arch-s3c64xx/s3c6400.h deleted +0 -89

89 lines not on this page · raw message

board/samsung/smdk6400/dmc_init.c +1 -1
index 776536c..4d5deeb 100644
@@ -24,7 +24,7 @@
 #include <config.h>
 #include <asm/io.h>
 #include <asm/arch/dmc.h>
-#include <asm/arch/s3c6400.h>
+#include <asm/arch/cpu.h>
 #include "setup.h"
 
 void memory_timing_parameter(struct s3c64xx_dmc *dmc)
board/samsung/smdk6400/lowlevel_init.S +13 -13
index e142217..92ad287 100644
@@ -38,7 +38,7 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/interrupt.h>
-#include <asm/arch/s3c6400.h>
+#include <asm/arch/cpu.h>
 
 #include "setup.h"
 
@@ -50,7 +50,7 @@ lowlevel_init:
 	mov	r12, lr
 
 	/* LED on only #8 */
-	ldr	r0, =ELFIN_GPIO_BASE
+	ldr	r0, =S3C64XX_GPIO_BASE
 	ldr	r1, =0x55540000
 	str	r1, [r0, #GPNCON_OFFSET]
 
@@ -67,12 +67,12 @@ lowlevel_init:
 	str	r1, [r0]
 
 	/* External interrupt pending clear */
-	ldr	r0, =(ELFIN_GPIO_BASE + EINTPEND_OFFSET)  /*EINTPEND*/
+	ldr	r0, =(S3C64XX_GPIO_BASE + EINTPEND_OFFSET)  /*EINTPEND*/
 	ldr	r1, [r0]
 	str	r1, [r0]
 
-	ldr	r0, =ELFIN_VIC0_BASE_ADDR	@0x71200000
-	ldr	r1, =ELFIN_VIC1_BASE_ADDR	@0x71300000
+	ldr	r0, =S3C64XX_VIC0_BASE	@0x71200000
+	ldr	r1, =S3C64XX_VIC1_BASE	@0x71300000
 
 	/* Disable all interrupts (VIC0 and VIC1) */
 	mvn	r3, #0x0
@@ -97,7 +97,7 @@ lowlevel_init:
 	bl	nand_asm_init
 
 	/* Memory subsystem address 0x7e00f120 */
-	ldr	r0, =ELFIN_MEM_SYS_CFG
+	ldr	r0, =S3C64XX_MEM_SYS_CFG
 
 	/* Xm0CSn2 = NFCON CS0, Xm0CSn3 = NFCON CS1 */
 	mov	r1, #S3C64XX_MEM_SYS_CFG_NAND
@@ -112,7 +112,7 @@ lowlevel_init:
 #endif
 
 /* Wakeup support. Don't know if it's going to be used, untested. */
-	ldr	r0, =(ELFIN_CLOCK_POWER_BASE + RST_STAT_OFFSET)
+	ldr	r0, =(S3C64XX_CLOCK_POWER_BASE + RST_STAT_OFFSET)
 	ldr	r1, [r0]
 	bic	r1, r1, #0xfffffff7
 	cmp	r1, #0x8
@@ -125,17 +125,17 @@ lowlevel_init:
 wakeup_reset:
 
 	/* Clear wakeup status register */
-	ldr	r0, =(ELFIN_CLOCK_POWER_BASE + WAKEUP_STAT_OFFSET)
+	ldr	r0, =(S3C64XX_CLOCK_POWER_BASE + WAKEUP_STAT_OFFSET)
 	ldr	r1, [r0]
 	str	r1, [r0]
 
 	/* LED test */
-	ldr	r0, =ELFIN_GPIO_BASE
+	ldr	r0, =S3C64XX_GPIO_BASE
 	ldr	r1, =0x3000
 	str	r1, [r0, #GPNDAT_OFFSET]
 
 	/* Load return address and jump to kernel */
-	ldr	r0, =(ELFIN_CLOCK_POWER_BASE + INF_REG0_OFFSET)
+	ldr	r0, =(S3C64XX_CLOCK_POWER_BASE + INF_REG0_OFFSET)
 	/* r1 = physical address of s3c6400_cpu_resume function */
 	ldr	r1, [r0]
 	/* Jump to kernel (sleep-s3c6400.S) */
@@ -147,7 +147,7 @@ wakeup_reset:
  * void system_clock_init(void)
  */
 system_clock_init:
-	ldr	r0, =ELFIN_CLOCK_POWER_BASE	/* 0x7e00f000 */
+	ldr	r0, =S3C64XX_CLOCK_POWER_BASE	/* 0x7e00f000 */
 
 #ifdef CONFIG_SYNC_MODE
 	ldr	r1, [r0, #OTHERS_OFFSET]
@@ -255,7 +255,7 @@ wait_for_async:
  */
 uart_asm_init:
 	/* set GPIO to enable UART */
-	ldr	r0, =ELFIN_GPIO_BASE
+	ldr	r0, =S3C64XX_GPIO_BASE
 	ldr	r1, =0x220022
 	str	r1, [r0, #GPACON_OFFSET]
 	mov	pc, lr
@@ -266,7 +266,7 @@ uart_asm_init:
  * NAND Interface init for SMDK6400
  */
 nand_asm_init:
-	ldr	r0, =ELFIN_NAND_BASE
+	ldr	r0, =S3C64XX_NAND_BASE
 	ldr	r1, [r0, #NFCONF_OFFSET]
 	orr	r1, r1, #0x70
 	orr	r1, r1, #0x7700
board/samsung/smdk6400/smdk6400.c +1 -1
index be0e18b..3464b1f 100644
@@ -31,7 +31,7 @@
 #include <common.h>
 #include <netdev.h>
 #include <asm/arch/sromc.h>
-#include <asm/arch/s3c6400.h>
+#include <asm/arch/cpu.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/mtd/nand/s3c64xx.c +1 -1
index b85b641..44a6d79 100644
@@ -30,7 +30,7 @@
 #include <nand.h>
 #include <linux/mtd/nand.h>
 
-#include <asm/arch/s3c6400.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/nand.h>
 
 #include <asm/io.h>
drivers/serial/s3c64xx.c +1 -1
index e411085..5559441 100644
@@ -23,7 +23,7 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/s3c6400.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/uart.h>
 
 DECLARE_GLOBAL_DATA_PTR;
drivers/usb/host/s3c64xx-hcd.c +1 -1
index 74b5951..c193e81 100644
@@ -26,7 +26,7 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/s3c6400.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/clock.h>
 
 int usb_cpu_init(void)
Signature · 1 line
1.7.5.4
#18 lore raw

PATCH 14/14 S3C6400: Remove the unused variable for S3C6400

In reply to Zhong Hongbo

From: Zhong Hongbo <[email protected]>

---
Change for V4:
- None.
Change for V3:
- None.
Change for V2:
- None.

---
 include/configs/smdk6400.h |   15 ---------------
 1 files changed, 0 insertions(+), 15 deletions(-)
include/configs/smdk6400.h +0 -15
index b770463..e005be1 100644
@@ -108,9 +108,6 @@
 #define CONFIG_CMD_LOADB
 #define CONFIG_CMD_SAVEENV
 #define CONFIG_CMD_NAND
-#if defined(CONFIG_BOOT_ONENAND)
-#define CONFIG_CMD_ONENAND
-#endif
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_FAT
@@ -266,13 +263,6 @@
 				 48, 49, 50, 51, 52, 53, 54, 55, \
 				 56, 57, 58, 59, 60, 61, 62, 63}
 
-/* None of these are currently implemented. Left from the original Samsung
- * version for reference
-#define CONFIG_BOOT_NOR
-#define CONFIG_BOOT_MOVINAND
-#define CONFIG_BOOT_ONENAND
-*/
-
 #define CONFIG_SPL
 #define CONFIG_SPL_NAND
 #define CONFIG_SPL_NAND_SIMPLE
@@ -283,11 +273,6 @@
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
 
 #define CONFIG_NAND_S3C64XX
-/* Unimplemented or unsupported. See comment above.
-#define CONFIG_ONENAND
-#define CONFIG_MOVINAND
-*/
-
 /* Settings as above boot configuration */
 #define CONFIG_ENV_IS_IN_NAND
 #define CONFIG_BOOTARGS		"console=ttySAC,115200"
Signature · 1 line
1.7.5.4