Skip to contentSkip to conversation

ARM:OMAP3:SDP3430 initial support

PATCH Superseded Nishanth Menon 5 participants 18 messages Sep 19, 2009 – Sep 24, 2009 Kbuild

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover ARM:OMAP3:SDP3430 initial support

Hi,
This series of patch provides minimal support for
OMAP3430 based OMAP3 platform

Ref: http://focus.ti.com/general/docs/wtbu/wtbugencontent.tsp?templateId=6123&navigationId=12013&contentId=28741

David Brownell (1):
ARM:OMAP3:SDP3430: initial support

Nishanth Menon (5):
OMAP3: Fix SDRC init
OMAP3: export enable_gpmc_cs_config to board files
OMAP3: make gpmc_config as const
OMAP3: fix warnings when NAND/ONENAND is not used DLMALLOC:!X86: add av_ initialization

 MAINTAINERS                            |    1 +
 MAKEALL                                |    1 +
 Makefile                               |    3 +
 board/ti/sdp3430/Makefile              |   49 ++++
 board/ti/sdp3430/config.mk             |   33 +++
 board/ti/sdp3430/sdp.c                 |  194 ++++++++++++++++
 board/ti/sdp3430/sdp.h                 |  376 ++++++++++++++++++++++++++++++++
 board/ti/sdp3430/u-boot.lds            |   63 ++++++
 common/dlmalloc.c                      |    5 +
 cpu/arm_cortexa8/omap3/mem.c           |   15 +-
 include/asm-arm/arch-omap3/cpu.h       |    1 +
 include/asm-arm/arch-omap3/mem.h       |    8 +-
 include/asm-arm/arch-omap3/sys_proto.h |    2 +
 include/configs/omap3_sdp.h            |  367 +++++++++++++++++++++++++++++++
 14 files changed, 1109 insertions(+), 9 deletions(-)
 create mode 100644 board/ti/sdp3430/Makefile
 create mode 100644 board/ti/sdp3430/config.mk
 create mode 100644 board/ti/sdp3430/sdp.c
 create mode 100644 board/ti/sdp3430/sdp.h
 create mode 100644 board/ti/sdp3430/u-boot.lds
 create mode 100644 include/configs/omap3_sdp.h

Regards,
Nishanth Menon

#1 lore raw

PATCH 1/6 OMAP3: Fix SDRC init

Defaults are for infenion DDR timings. Since none of the supported boards currently do XIP boot, these seem to be faulty. fix the values as per the calculations(ACTIMA,B), conf the sdrc power with pwdnen and wakeupproc bits

---
 cpu/arm_cortexa8/omap3/mem.c     |    3 ++-
 include/asm-arm/arch-omap3/cpu.h |    1 +
 include/asm-arm/arch-omap3/mem.h |    8 ++++----
 3 files changed, 7 insertions(+), 5 deletions(-)
cpu/arm_cortexa8/omap3/mem.c +2 -1
index 079c848..8731c9d 100644
@@ -164,7 +164,8 @@ void do_sdrc_init(u32 cs, u32 early)
 		writel(SDP_SDRC_SHARING, &sdrc_base->sharing);
 
 		/* Disable Power Down of CKE cuz of 1 CKE on combo part */
-		writel(SRFRONRESET | PAGEPOLICY_HIGH, &sdrc_base->power);
+		writel(WAKEUPPROC | PWDNEN | SRFRONRESET | PAGEPOLICY_HIGH,
+				&sdrc_base->power);
 
 		writel(ENADLL | DLLPHASE_90, &sdrc_base->dlla_ctrl);
 		sdelay(0x20000);
include/asm-arm/arch-omap3/cpu.h +1 -0
index 8ab2e39..e51c4f3 100644
@@ -222,6 +222,7 @@ struct sdrc {
 
 #define PAGEPOLICY_HIGH		(0x1 << 0)
 #define SRFRONRESET		(0x1 << 7)
+#define PWDNEN			(0x1 << 2)
 #define WAKEUPPROC		(0x1 << 26)
 
 #define DDR_SDRAM		(0x1 << 0)
include/asm-arm/arch-omap3/mem.h +4 -4
index 5b9ac75..31cbdef 100644
@@ -78,16 +78,16 @@ enum {
 #define TRP_165		3
 #define TRAS_165	7
 #define TRC_165		10
-#define TRFC_165	21
+#define TRFC_165	12
 #define V_ACTIMA_165	((TRFC_165 << 27) | (TRC_165 << 22) | \
 			(TRAS_165 << 18) | (TRP_165 << 15) |  \
 			(TRCD_165 << 12) | (TRRD_165 << 9) |  \
 			(TDPL_165 << 6) | (TDAL_165))
 
 #define TWTR_165	1
-#define TCKE_165	1
-#define TXP_165		5
-#define XSR_165		23
+#define TCKE_165	2
+#define TXP_165		2
+#define XSR_165		20
 #define V_ACTIMB_165	(((TCKE_165 << 12) | (XSR_165 << 0)) |	\
 			(TXP_165 << 8) | (TWTR_165 << 16))
 
Signature · 1 line
1.6.0.4
#2 lore raw

PATCH 2/6 OMAP3: export enable_gpmc_cs_config to board files

Export enable_gpmc_cs_config into common header to prevent warning:
warning: implicit declaration of function 'enable_gpmc_cs_config'

---
 include/asm-arm/arch-omap3/sys_proto.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/asm-arm/arch-omap3/sys_proto.h +2 -0
index 2246f80..e59021e 100644
@@ -34,6 +34,8 @@ void memif_init(void);
 void sdrc_init(void);
 void do_sdrc_init(u32, u32);
 void gpmc_init(void);
+void enable_gpmc_cs_config(u32 *gpmc_config, struct gpmc_cs *cs, u32 base,
+			u32 size);
 
 void watchdog_init(void);
 void set_muxconf_regs(void);
Signature · 1 line
1.6.0.4
#3 lore raw

PATCH 3/6 OMAP3: make gpmc_config as const

gpmc_config should not be a variant as it is board specific hence make it a const parameter

---
 cpu/arm_cortexa8/omap3/mem.c           |    6 +++---
 include/asm-arm/arch-omap3/sys_proto.h |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
cpu/arm_cortexa8/omap3/mem.c +3 -3
index 8731c9d..8d64478 100644
@@ -44,7 +44,7 @@ volatile unsigned int boot_flash_env_addr;
 struct gpmc *gpmc_cfg;
 
 #if defined(CONFIG_CMD_NAND)
-static u32 gpmc_m_nand[GPMC_MAX_REG] = {
+static const u32 gpmc_m_nand[GPMC_MAX_REG] = {
 	M_NAND_GPMC_CONFIG1,
 	M_NAND_GPMC_CONFIG2,
 	M_NAND_GPMC_CONFIG3,
@@ -62,7 +62,7 @@ static u32 gpmc_m_nand[GPMC_MAX_REG] = {
 #endif
 
 #if defined(CONFIG_CMD_ONENAND)
-static u32 gpmc_onenand[GPMC_MAX_REG] = {
+static const u32 gpmc_onenand[GPMC_MAX_REG] = {
 	ONENAND_GPMC_CONFIG1,
 	ONENAND_GPMC_CONFIG2,
 	ONENAND_GPMC_CONFIG3,
@@ -193,7 +193,7 @@ void do_sdrc_init(u32 cs, u32 early)
 		writel(0, &sdrc_base->cs[cs].mcfg);
 }
 
-void enable_gpmc_cs_config(u32 *gpmc_config, struct gpmc_cs *cs, u32 base,
+void enable_gpmc_cs_config(const u32 *gpmc_config, struct gpmc_cs *cs, u32 base,
 			u32 size)
 {
 	writel(0, &cs->config7);
include/asm-arm/arch-omap3/sys_proto.h +1 -1
index e59021e..34bd515 100644
@@ -34,7 +34,7 @@ void memif_init(void);
 void sdrc_init(void);
 void do_sdrc_init(u32, u32);
 void gpmc_init(void);
-void enable_gpmc_cs_config(u32 *gpmc_config, struct gpmc_cs *cs, u32 base,
+void enable_gpmc_cs_config(const u32 *gpmc_config, struct gpmc_cs *cs, u32 base,
 			u32 size);
 
 void watchdog_init(void);
Signature · 1 line
1.6.0.4
#4 lore raw

PATCH 4/6 OMAP3: fix warnings when NAND/ONENAND is not used

Fix build warnings by putting specific used variables under required #ifdefs for removing:
mem.c:227: warning: unused variable 'f_sec' mem.c:226: warning: unused variable 'f_off' mem.c:225: warning: unused variable 'size' mem.c:224: warning: unused variable 'base' mem.c:222: warning: unused variable 'gpmc_config'

---
 cpu/arm_cortexa8/omap3/mem.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
cpu/arm_cortexa8/omap3/mem.c +5 -1
index 8d64478..e93343c 100644
@@ -219,12 +219,16 @@ void enable_gpmc_cs_config(const u32 *gpmc_config, struct gpmc_cs *cs, u32 base,
 void gpmc_init(void)
 {
 	/* putting a blanket check on GPMC based on ZeBu for now */
-	u32 *gpmc_config = NULL;
 	gpmc_cfg = (struct gpmc *)GPMC_BASE;
+#if defined(CONFIG_CMD_NAND) || defined(CONFIG_CMD_ONENAND)
+	u32 *gpmc_config = NULL;
 	u32 base = 0;
 	u32 size = 0;
+#if defined(CONFIG_ENV_IS_IN_NAND) || defined(CONFIG_ENV_IS_IN_ONENAND)
 	u32 f_off = CONFIG_SYS_MONITOR_LEN;
 	u32 f_sec = 0;
+#endif
+#endif
 	u32 config = 0;
 
 	/* global settings */
Signature · 1 line
1.6.0.4
#5 lore raw

PATCH 5/6 DLMALLOC:!X86: add av_ initialization

This is questionable if this is really required as the av_ static initalized values should have been loaded to sdram as part of the boot process and initialization should have been done.

---
 common/dlmalloc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
common/dlmalloc.c +5 -0
index 241db8c..bd509db 100644
@@ -1527,6 +1527,11 @@ void *sbrk(ptrdiff_t increment)
  */
 void mem_malloc_init(ulong start, ulong size)
 {
+	u8 i;
+	av_[0] = av_[1] = 0;
+	for (i = 0; i < 128; i++)
+		av_[2 + i * 2] = av_[2 + i * 2 + 1] = bin_at(i);
+
 	mem_malloc_start = start;
 	mem_malloc_end = start + size;
 	mem_malloc_brk = start;
Signature · 1 line
1.6.0.4
#6 lore raw

PATCH 6/6 ARM:OMAP3:SDP3430: initial support

From: David Brownell <[email protected]>

Start of SDP3430 support in "mainline"
u-boot mainline code

Original Patch written by David Brownell

Support default jumpering and:
- UART1/ttyS0 console(legacy sdp3430 u-boot)
- UART3/ttyS2 console (matching other boards,
and SDP HW docs)
- Ethernet
- mmc0
- NOR boot

TODO:
- mmc1
- NAND (boot or 128M storage)
- OneNAND (boot or 256M storage)
- Fix NOR env variable load
- Review SDRC timing configuration/DPLL
configuration
- Dynamically read FPGA dip switch settings and
map NOR/NAND/ONENAND devices to right
chipselects

Currently the UART1 is enabled by default. for
compatibility with other OMAP3 u-boot platforms,
enable the #define of CONSOLE_J9.

Ref: SDP3430:
http://focus.ti.com/general/docs/wtbu/wtbugencontent.tsp?templateId=6123&navigationId=12013&contentId=28741

---
 MAINTAINERS                 |    1 +
 MAKEALL                     |    1 +
 Makefile                    |    3 +
 board/ti/sdp3430/Makefile   |   49 ++++++
 board/ti/sdp3430/config.mk  |   33 ++++
 board/ti/sdp3430/sdp.c      |  194 ++++++++++++++++++++++
 board/ti/sdp3430/sdp.h      |  376 +++++++++++++++++++++++++++++++++++++++++++
 board/ti/sdp3430/u-boot.lds |   63 +++++++
 include/configs/omap3_sdp.h |  367 +++++++++++++++++++++++++++++++++++++++++
 9 files changed, 1087 insertions(+), 0 deletions(-)
 create mode 100644 board/ti/sdp3430/Makefile
 create mode 100644 board/ti/sdp3430/config.mk
 create mode 100644 board/ti/sdp3430/sdp.c
 create mode 100644 board/ti/sdp3430/sdp.h
 create mode 100644 board/ti/sdp3430/u-boot.lds
 create mode 100644 include/configs/omap3_sdp.h
MAINTAINERS +1 -0
index e9db278..adc8a63 100644
@@ -619,6 +619,7 @@ Guennadi Liakhovetski <[email protected]>
 Nishanth Menon <[email protected]>
 
 	omap3_zoom1	ARM CORTEX-A8 (OMAP3xx SoC)
+	omap3_sdp	ARM CORTEX-A8 (OMAP3xx SoC)
 
 David M?ller <[email protected]>
 
MAKEALL +1 -0
index f0ed8ea..53620eb 100755
@@ -588,6 +588,7 @@ LIST_ARM_CORTEX_A8="		\
 	omap3_pandora		\
 	omap3_zoom1		\
 	omap3_zoom2		\
+	omap3_sdp		\
 "
 
 #########################################################################
Makefile +3 -0
index 5a4a109..2626147 100644
@@ -3172,6 +3172,9 @@ omap3_zoom1_config :	unconfig
 omap3_zoom2_config :	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 zoom2 logicpd omap3
 
+omap3_sdp_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 sdp3430 ti omap3
+
 #########################################################################
 ## XScale Systems
 #########################################################################
board/ti/sdp3430/Makefile new file +49 -0

49 lines not on this page · raw message

board/ti/sdp3430/config.mk new file +33 -0
new file mode 100644
index 0000000..3726634
@@ -0,0 +1,33 @@
+#
+# (C) Copyright 2006-2009
+# Texas Instruments, <www.ti.com>
+#
+# OMAP 3430 SDP uses OMAP3 (ARM-CortexA8) cpu
+# see http://www.ti.com/ for more information on Texas Instruments
+#
+# 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
+#
+# Physical Address:
+# 8000'0000 (bank0)
+# A000/0000 (bank1)
+# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
+# (mem base + reserved)
+
+# For use with external or internal boots.
+TEXT_BASE = 0x80e80000
board/ti/sdp3430/sdp.c new file +194 -0

194 lines not on this page · raw message

board/ti/sdp3430/sdp.h new file +376 -0

376 lines not on this page · raw message

board/ti/sdp3430/u-boot.lds new file +63 -0

63 lines not on this page · raw message

include/configs/omap3_sdp.h new file +367 -0

367 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#7 lore raw

PATCH 6/6 ARM:OMAP3:SDP3430: initial support

Hi Nishanth,

Quoted 6 lines · Nishanth Menon

From: David Brownell <[email protected]>

Start of SDP3430 support in "mainline"
u-boot mainline code

Original Patch written by David Brownell

I don't think the above comments are necessary. David will be credited with authorship already, and the subject line and text below make it clear what this patch does.

Quoted 37 lines

Support default jumpering and:
- UART1/ttyS0 console(legacy sdp3430 u-boot)
- UART3/ttyS2 console (matching other boards, and SDP HW docs)
- Ethernet
- mmc0
- NOR boot

TODO:
- mmc1
- NAND (boot or 128M storage)
- OneNAND (boot or 256M storage)
- Fix NOR env variable load
- Review SDRC timing configuration/DPLL configuration
- Dynamically read FPGA dip switch settings and map NOR/NAND/ONENAND devices to right chipselects

Currently the UART1 is enabled by default. for compatibility with other OMAP3 u-boot platforms, enable the #define of CONSOLE_J9.

Ref: SDP3430:
http://focus.ti.com/general/docs/wtbu/wtbugencontent.tsp?templateId=6123&navigationId=12013&contentId=28741

---
 MAINTAINERS                 |    1 +
 MAKEALL                     |    1 +
 Makefile                    |    3 +
 board/ti/sdp3430/Makefile   |   49 ++++++
 board/ti/sdp3430/config.mk  |   33 ++++
 board/ti/sdp3430/sdp.c      |  194 ++++++++++++++++++++++
 board/ti/sdp3430/sdp.h      |  376 +++++++++++++++++++++++++++++++++++++++++++
 board/ti/sdp3430/u-boot.lds |   63 +++++++
Quoted 8 lines
 include/configs/omap3_sdp.h |  367 +++++++++++++++++++++++++++++++++++++++++
 9 files changed, 1087 insertions(+), 0 deletions(-)
 create mode 100644 board/ti/sdp3430/Makefile
 create mode 100644 board/ti/sdp3430/config.mk
 create mode 100644 board/ti/sdp3430/sdp.c
 create mode 100644 board/ti/sdp3430/sdp.h
 create mode 100644 board/ti/sdp3430/u-boot.lds
 create mode 100644 include/configs/omap3_sdp.h

The board config header file should be renamed to sdp.h from omap3_sdp.h. There was a recent thread discussing this convention "ARM Pull Request" around Sept 6.

MAINTAINERS Guennadi Liakhovetski <[email protected]> · line 622

Quoted 9 lines
MAINTAINERS +1 -0
index e9db278..adc8a63 100644
@@ -619,6 +619,7 @@ Guennadi Liakhovetski <[email protected]>
 Nishanth Menon <[email protected]>
 
 	omap3_zoom1	ARM CORTEX-A8 (OMAP3xx SoC)
+	omap3_sdp	ARM CORTEX-A8 (OMAP3xx SoC)

You may as well keep the boards ordered alphabetically (and remove the omap_ prefix from sdp).

MAKEALL LIST_ARM_CORTEX_A8=" \ · line 592

Quoted 12 lines
MAINTAINERS +0 -0
 David Mller <[email protected]>
 
MAKEALL +1 -0
index f0ed8ea..53620eb 100755
@@ -588,6 +588,7 @@ LIST_ARM_CORTEX_A8="		\
 	omap3_pandora		\
 	omap3_zoom1		\
 	omap3_zoom2		\
+	omap3_sdp		\
 "

Ditto.

Makefile omap3_zoom1_config : unconfig · line 3177

Quoted 12 lines
MAKEALL +0 -0
 #########################################################################
Makefile +3 -0
index 5a4a109..2626147 100644
@@ -3172,6 +3172,9 @@ omap3_zoom1_config :	unconfig
 omap3_zoom2_config :	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 zoom2 logicpd omap3
 
+omap3_sdp_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 sdp3430 ti omap3
+

Ditto.

<snip>

Makefile omap3_zoom1_config : unconfig

Quoted 8 lines
Makefile +8 -0
+/******************************************************************************
+ * Routine: board_init
+ * Description: Early hardware init.
+ *****************************************************************************/
+int board_init(void)
+{
+	DECLARE_GLOBAL_DATA_PTR;
+

I'd use the preferred multi-line comment style:
/*
*
*/

There are lots of other non-preferred multi-line comments throughout the patch as well.

I personally don't think its necessary to put "Routine: <name>" stuff for each function either. It doesn't add any benefit, adds cruft to grep output, and might get out of sync with the real function name at some point. If it were me, I would get rid of "Description: " text too. Its pretty obvious that the text "Early hardware init" is a description of the function.

Best,
Peter

#8 lore raw

PATCH 6/6 ARM:OMAP3:SDP3430: initial support

Peter Tyser said the following on 09/19/2009 09:34 AM:
thanks for your review

Quoted 9 lines

Hi Nishanth,

Quoted 5 lines · Nishanth Menon

From: David Brownell <[email protected]>

Start of SDP3430 support in "mainline"
u-boot mainline code

Quoted 8 lines
Quoted 2 lines

Original Patch written by David Brownell

I don't think the above comments are necessary. David will be credited with authorship already, and the subject line and text below make it clear what this patch does.

Ack..

Quoted 9 lines
Quoted 4 lines
 create mode 100644 board/ti/sdp3430/sdp.h
 create mode 100644 board/ti/sdp3430/u-boot.lds
 create mode 100644 include/configs/omap3_sdp.h

The board config header file should be renamed to sdp.h from omap3_sdp.h. There was a recent thread discussing this convention "ARM Pull Request" around Sept 6.

sdp3430 - there are many software development platforms -> omap2420 based, omap2430 based etc..
Thanks for pointing this chain out.. a specific link describing the thought will help and prevent me misunderstanding the intention here.

Quoted 8 lines
Quoted 8 lines
MAINTAINERS +0 -0
index e9db278..adc8a63 100644
@@ -619,6 +619,7 @@ Guennadi Liakhovetski <[email protected]>
 Nishanth Menon <[email protected]>
 
Quoted 7 lines

MAINTAINERS Guennadi Liakhovetski <[email protected]> · line 623

Quoted 3 lines
MAINTAINERS +1 -0
 	omap3_zoom1	ARM CORTEX-A8 (OMAP3xx SoC)
+	omap3_sdp	ARM CORTEX-A8 (OMAP3xx SoC)
 

You may as well keep the boards ordered alphabetically (and remove the omap_ prefix from sdp).

ack to alphabetical sort.

Quoted 16 lines

MAINTAINERS Guennadi Liakhovetski <[email protected]>

Quoted 9 lines
MAINTAINERS +8 -0
+/******************************************************************************
+ * Routine: board_init
+ * Description: Early hardware init.
+ *****************************************************************************/
+int board_init(void)
+{
+	DECLARE_GLOBAL_DATA_PTR;
+

I'd use the preferred multi-line comment style:
/*
*
*/

Quoted 3 lines

There are lots of other non-preferred multi-line comments throughout the patch as well.

ack.

Quoted 7 lines

I personally don't think its necessary to put "Routine: <name>" stuff for each function either. It doesn't add any benefit, adds cruft to grep output, and might get out of sync with the real function name at some point. If it were me, I would get rid of "Description: " text too. Its pretty obvious that the text "Early hardware init" is a description of the function.

not to all.. I dont like it either, I would rather go doxygen style.. will convert.

Regards,
Nishanth Menon

#9 lore raw

PATCH 6/6 ARM:OMAP3:SDP3430: initial support

In reply to Peter Tyser
Quoted 18 lines

---
 MAINTAINERS                 |    1 +
 MAKEALL                     |    1 +
 Makefile                    |    3 +
 board/ti/sdp3430/Makefile   |   49 ++++++
 board/ti/sdp3430/config.mk  |   33 ++++
 board/ti/sdp3430/sdp.c      |  194 ++++++++++++++++++++++
 board/ti/sdp3430/sdp.h      |  376 +++++++++++++++++++++++++++++++++++++++++++
 board/ti/sdp3430/u-boot.lds |   63 +++++++
 include/configs/omap3_sdp.h |  367 +++++++++++++++++++++++++++++++++++++++++
 9 files changed, 1087 insertions(+), 0 deletions(-)
 create mode 100644 board/ti/sdp3430/Makefile
 create mode 100644 board/ti/sdp3430/config.mk
 create mode 100644 board/ti/sdp3430/sdp.c
 create mode 100644 board/ti/sdp3430/sdp.h
 create mode 100644 board/ti/sdp3430/u-boot.lds

why is this u-boot.lds required here, when we already have it in /cpu/arm_cortexa8/

a diff between what is in the above location and what is in your patch suggests that they(u-boot.lds) are similar though not same.

Quoted 1 line
 create mode 100644 include/configs/omap3_sdp.h
#10 lore raw

PATCH 6/6 ARM:OMAP3:SDP3430: initial support

In reply to Nishanth Menon

Dear Nishanth Menon,

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

--===============1247028818==

From: David Brownell <[email protected]>

Start of SDP3430 support in "mainline"
u-boot mainline code

Original Patch written by David Brownell

Um... this seems redundant information to me (the "From:" line and the Signed-off-by: line already say that David Brownell is the author.

On the other hand, I'm missing explanations what SDP3430 might be?

MAINTAINERS Guennadi Liakhovetski <[email protected]> · line 622

Quoted 9 lines
MAINTAINERS +1 -0
index e9db278..adc8a63 100644
@@ -619,6 +619,7 @@ Guennadi Liakhovetski <[email protected]>
 Nishanth Menon <[email protected]>
 
 	omap3_zoom1	ARM CORTEX-A8 (OMAP3xx SoC)
+	omap3_sdp	ARM CORTEX-A8 (OMAP3xx SoC)

Please keep lists sorted.

General remark:

The board name is "SDP3430", right? The board directory name is board/ti/sdp3430/, which is ok. But then the configuration name should be "sdp3430", too.

MAKEALL LIST_ARM_CORTEX_A8=" \ · line 592

Quoted 10 lines
MAKEALL +1 -0
index f0ed8ea..53620eb 100755
@@ -588,6 +588,7 @@ LIST_ARM_CORTEX_A8="		\
 	omap3_pandora		\
 	omap3_zoom1		\
 	omap3_zoom2		\
+	omap3_sdp		\
 "

Ditto.

Makefile omap3_zoom1_config : unconfig · line 3176

Quoted 11 lines
MAKEALL +0 -0
 #########################################################################
Makefile +2 -0
index 5a4a109..2626147 100644
@@ -3172,6 +3172,9 @@ omap3_zoom1_config :	unconfig
 omap3_zoom2_config :	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 zoom2 logicpd omap3
 
+omap3_sdp_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 sdp3430 ti omap3

Here again. Please check all other similar places.

...

Quoted 27 lines
Makefile +27 -0
+static const u32 gpmc_sdp_nor[] = {
+    0x00001200,	/*CONF1 */
+    0x001F1F00,	/*CONF2 */
+    0x00080802,	/*CONF3 */
+    0x1C091C09,	/*CONF4 */
+    0x01131F1F,	/*CONF5 */
+    0x1F0F03C2,	/*CONF6 */
+    /*CONF7- computed as params */
+};
+static const u32 gpmc_sdp_debug[] = {
+    0x00611200,	/*CONF1 FPGA needs WAIT1 line-active Low to function now.. */
+    0x001F1F01,	/*CONF2 */
+    0x00080803,	/*CONF3 */
+    0x1D091D09,	/*CONF4 */
+    0x041D1F1F,	/*CONF5 */
+    0x1D0904C4,	/*CONF6 */
+    /*CONF7- computed as params */
+};
+static const u32 gpmc_sdp_onenand[] = {
+    0x00001200,	/*CONF1 */
+    0x000F0F01,	/*CONF2 */
+    0x00030301,	/*CONF3 */
+    0x0F040F04,	/*CONF4 */
+    0x010F1010,	/*CONF5 */
+    0x1F060000,	/*CONF6 */
+    /*CONF7- computed as params */
+};

Makefile omap3_zoom1_config : unconfig

Quoted 10 lines
Makefile +10 -0
+
+static const u32 gpmc_sdp_nand[] = {
+    0x00000800,	/*CONF1 */
+    0x00141400,	/*CONF2 */
+    0x00141400,	/*CONF3 */
+    0x0F010F01,	/*CONF4 */
+    0x010C1414,	/*CONF5 */
+    0x1F040A80,	/*CONF6 */
+    /*CONF7- computed as params */
+};

Please comment what all these magic numbers mean.

Quoted 4 lines

+/******************************************************************************
+ * Routine: board_init
+ * Description: Early hardware init.
+ *****************************************************************************/

Incorrect multiline comment style. Please fix globally.

...

Quoted 5 lines
board/ti/sdp3430/sdp.h new file +0 -0
new file mode 100644
index 0000000..5ad2920

...

Quoted 4 lines

+#define MUX_SDP3430()\
+ /*SDRC*/\

+ MUX_VAL(CP(SDRC_D0), (IEN | PTD | DIS | M0)) /*SDRC_D0*/\
+ MUX_VAL(CP(SDRC_D1), (IEN | PTD | DIS | M0)) /*SDRC_D1*/\

...

Incorrect indentation.

What exacty is the purpose of the comment? It does not carry any information. Seems just a waste of line length to me?

board/ti/sdp3430/u-boot.lds

Quoted 5 lines
board/ti/sdp3430/u-boot.lds new file +0 -0
new file mode 100644
index 0000000..4ecc6dd

Is it really necessary that this board uses a custom linke rscript? Cannot we use a generic one for several boards?

include/configs/omap3_sdp.h

Quoted 5 lines
include/configs/omap3_sdp.h new file +0 -0
new file mode 100644
index 0000000..176617a

This should be include/configs/sdp3430.h, accorsing to the board name.

...

include/configs/omap3_sdp.h line 72

Quoted 4 lines
include/configs/omap3_sdp.h new file +4 -0
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_ENV_SIZE			SZ_256K	/* Total Size Environment */

Please do not use any of these SZ_ defines; they will be removed soon.

include/configs/omap3_sdp.h line 111

Quoted 3 lines
include/configs/omap3_sdp.h new file +3 -0
+#if 0
+#define CONSOLE_J9			/* else J8/UART1 (innermost) */
+#endif

Please delete - don't add dead code.

include/configs/omap3_sdp.h line 157

Quoted 3 lines
include/configs/omap3_sdp.h new file +3 -0
+/* timeout values are in ticks */
+#define CONFIG_SYS_FLASH_ERASE_TOUT	(100 * CONFIG_SYS_HZ)
+#define CONFIG_SYS_FLASH_WRITE_TOUT	(100 * CONFIG_SYS_HZ)

Strictly speaking the comment is wrong. The timeouts are in milliseconds.

include/configs/omap3_sdp.h line 162

Quoted 3 lines
include/configs/omap3_sdp.h new file +3 -0
+/* OMITTED:  single 2 Gbit KFM2G16 OneNAND flash */
+
+

Only a single blank line in places like thsi, please.

include/configs/omap3_sdp.h line 178

Quoted 10 lines
include/configs/omap3_sdp.h new file +10 -0
+/* commands to include */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_DHCP		/* DHCP Support			*/
+#define CONFIG_CMD_I2C		/* I2C serial bus support	*/
+#define CONFIG_CMD_JFFS2	/* JFFS2 Support		*/
+#define CONFIG_CMD_MMC		/* MMC support			*/
+#define CONFIG_CMD_FAT		/* FAT support			*/
+#define CONFIG_CMD_EXT2		/* EXT2 Support			*/

We consider it good style to keep such lists sorted.

...

include/configs/omap3_sdp.h line 281

Quoted 4 lines
include/configs/omap3_sdp.h new file +4 -0
+#define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0)	/* memtest */
+								/* works on */
+#define CONFIG_SYS_MEMTEST_END		(OMAP34XX_SDRC_CS0 + \
+					0x01F00000) /* 31MB */

Has this been tested? Can you really overwrite low memory? No exception vectors needed there?

Quoted 1 line

+#undef CONFIG_SYS_CLKS_IN_HZ /* everything, incl board info, in Hz */

There is no need to undefine non-existent variables.

include/configs/omap3_sdp.h line 286

Quoted 2 lines
include/configs/omap3_sdp.h new file +2 -0
+#define CONFIG_SYS_LOAD_ADDR		(OMAP34XX_SDRC_CS0)	/* default */
+							/* load address */

Does this really work? Is low memory unused on this CPU? [Dorry for asking stupid questions, just want to be sure...]

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Everything should be made as simple as possible, but not simpler."
                                                    - Albert Einstein
#11 lore raw

PATCH 6/6 ARM:OMAP3:SDP3430: initial support

Wolfgang Denk said the following on 09/23/2009 10:51 PM:

Quoted 11 lines

Dear Nishanth Menon,

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

--===============1247028818==

From: David Brownell <[email protected]>

Start of SDP3430 support in "mainline"
u-boot mainline code

Quoted 7 lines
Quoted 2 lines

Original Patch written by David Brownell

Um... this seems redundant information to me (the "From:" line and the Signed-off-by: line already say that David Brownell is the author.

Acked as previously discussed.

Quoted 2 lines

On the other hand, I'm missing explanations what SDP3430 might be?

hmm.. my bad. will fix. I should really be adding a few more lines to README.omap3. I will do that along with this change.

Quoted 9 lines
Quoted 9 lines
MAINTAINERS +0 -0
index e9db278..adc8a63 100644
@@ -619,6 +619,7 @@ Guennadi Liakhovetski <[email protected]>
 Nishanth Menon <[email protected]>
 
Quoted 6 lines

MAINTAINERS Guennadi Liakhovetski <[email protected]> · line 623

Quoted 3 lines
MAINTAINERS +1 -0
 	omap3_zoom1	ARM CORTEX-A8 (OMAP3xx SoC)
+	omap3_sdp	ARM CORTEX-A8 (OMAP3xx SoC)
 

Please keep lists sorted.

Ack

Quoted 6 lines

General remark:

The board name is "SDP3430", right? The board directory name is board/ti/sdp3430/, which is ok. But then the configuration name should be "sdp3430", too.

Thanks.

Quoted 5 lines
Quoted 5 lines
MAINTAINERS +5 -0
+
+static const u32 gpmc_sdp_nand[] = {
+    0x00000800,	/*CONF1 */
+    0x00141400,	/*CONF2 */
+    0x00141400,	/*CONF3 */
Quoted 10 lines

MAINTAINERS

Quoted 6 lines
MAINTAINERS +5 -0
+    0x0F010F01,	/*CONF4 */
+    0x010C1414,	/*CONF5 */
+    0x1F040A80,	/*CONF6 */
+    /*CONF7- computed as params */
+};

Please comment what all these magic numbers mean.

these are configuration register values for GPMC (General Purpose Memory Controller)
I should be indeed adding proper comments here. will do.

Quoted 8 lines
Quoted 5 lines

+/******************************************************************************
+ * Routine: board_init
+ * Description: Early hardware init.
+ *****************************************************************************/

Incorrect multiline comment style. Please fix globally.

Ack

Quoted 10 lines

...

Quoted 6 lines
board/ti/sdp3430/sdp.h new file +0 -0
new file mode 100644
index 0000000..5ad2920

...

Quoted 9 lines
Quoted 5 lines

+#define MUX_SDP3430()\
+ /*SDRC*/\

+ MUX_VAL(CP(SDRC_D0), (IEN | PTD | DIS | M0)) /*SDRC_D0*/\
+ MUX_VAL(CP(SDRC_D1), (IEN | PTD | DIS | M0)) /*SDRC_D1*/\

...

Incorrect indentation.

(having spend almost an hr cleaning that piece of mux header up) groan.. any recommendations? is it because of the " "?

Quoted 3 lines

What exacty is the purpose of the comment? It does not carry any information. Seems just a waste of line length to me?

you mean /* SDRC_D0 */? hmmm.. might actually make sense if I am not using default mux mode 0 to note why I am using a new value.

Quoted 11 lines

board/ti/sdp3430/u-boot.lds

Quoted 7 lines
board/ti/sdp3430/u-boot.lds new file +0 -0
new file mode 100644
index 0000000..4ecc6dd

Is it really necessary that this board uses a custom linke rscript? Cannot we use a generic one for several boards?

Ack.

Quoted 10 lines

include/configs/omap3_sdp.h

Quoted 7 lines
include/configs/omap3_sdp.h new file +0 -0
new file mode 100644
index 0000000..176617a

This should be include/configs/sdp3430.h, accorsing to the board name.

Ack. I guess this is a hangover from the days where we wanted all omap3 boards to look similar.

Quoted 10 lines

...

include/configs/omap3_sdp.h line 72

Quoted 5 lines
include/configs/omap3_sdp.h new file +4 -0
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_ENV_SIZE			SZ_256K	/* Total Size Environment */

Please do not use any of these SZ_ defines; they will be removed soon.

Ack..

Quoted 8 lines

include/configs/omap3_sdp.h line 111

Quoted 5 lines
include/configs/omap3_sdp.h new file +3 -0
+#if 0
+#define CONSOLE_J9			/* else J8/UART1 (innermost) */
+#endif

Please delete - don't add dead code.

CONSOLE_J9 is really an option, but I get your point here I should be using #undef even if i wanted to allow folks to tweak around.. #if 0s are *evil*

Quoted 9 lines

include/configs/omap3_sdp.h line 157

Quoted 5 lines
include/configs/omap3_sdp.h new file +3 -0
+/* timeout values are in ticks */
+#define CONFIG_SYS_FLASH_ERASE_TOUT	(100 * CONFIG_SYS_HZ)
+#define CONFIG_SYS_FLASH_WRITE_TOUT	(100 * CONFIG_SYS_HZ)

Strictly speaking the comment is wrong. The timeouts are in milliseconds.

gotcha. Ack.

Quoted 8 lines

include/configs/omap3_sdp.h line 162

Quoted 5 lines
include/configs/omap3_sdp.h new file +3 -0
+/* OMITTED:  single 2 Gbit KFM2G16 OneNAND flash */
+
+

Only a single blank line in places like thsi, please.

ok ok.. though I think you are nit picking ;)..

Quoted 15 lines

include/configs/omap3_sdp.h line 178

Quoted 12 lines
include/configs/omap3_sdp.h new file +10 -0
+/* commands to include */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_DHCP		/* DHCP Support			*/
+#define CONFIG_CMD_I2C		/* I2C serial bus support	*/
+#define CONFIG_CMD_JFFS2	/* JFFS2 Support		*/
+#define CONFIG_CMD_MMC		/* MMC support			*/
+#define CONFIG_CMD_FAT		/* FAT support			*/
+#define CONFIG_CMD_EXT2		/* EXT2 Support			*/

We consider it good style to keep such lists sorted.

I suppose Alphabetical sort?

Quoted 11 lines

...

include/configs/omap3_sdp.h line 281

Quoted 5 lines
include/configs/omap3_sdp.h new file +4 -0
+#define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0)	/* memtest */
+								/* works on */
+#define CONFIG_SYS_MEMTEST_END		(OMAP34XX_SDRC_CS0 + \
+					0x01F00000) /* 31MB */

Has this been tested? Can you really overwrite low memory? No exception vectors needed there?

yep it does boot :D.. exception vectors are stored in SRAM(which is a different address range)..
but you have a point here -> will my sdram test actually overwrite my u-boot itself - heh heh, wont be much use then ..
will check and fix. thanks

Quoted 6 lines
Quoted 3 lines

+#undef CONFIG_SYS_CLKS_IN_HZ /* everything, incl board info, in Hz */

There is no need to undefine non-existent variables.

yep, will check

Quoted 9 lines

include/configs/omap3_sdp.h line 286

Quoted 4 lines
include/configs/omap3_sdp.h new file +2 -0
+#define CONFIG_SYS_LOAD_ADDR		(OMAP34XX_SDRC_CS0)	/* default */
+							/* load address */

Does this really work? Is low memory unused on this CPU? [Dorry for asking stupid questions, just want to be sure...]

yes, it does -> see previous comment.
Regards,
Nishanth Menon

#12 lore raw

PATCH 5/6 DLMALLOC:!X86: add av_ initialization

In reply to Nishanth Menon
Quoted 4 lines · Nishanth Menon

This is questionable if this is really required as the av_ static initalized values should have been loaded to sdram as part of the boot process and initialization should have been done.

Is there a reason you need to do this fixup? Based on your commit message its unclear if this patch is really needed...

common/dlmalloc.c void *sbrk(ptrdiff_t increment) · line 1537

Quoted 11 lines

Signed-off-by: Nishanth Menon <nm
void mem_malloc_init(ulong start, ulong size) {

common/dlmalloc.c +5 -0
+	u8 i;
+	av_[0] = av_[1] = 0;
+	for (i = 0; i < 128; i++)
+		av_[2 + i * 2] = av_[2 + i * 2 + 1] = bin_at(i);
+
 	mem_malloc_start = start;
 	mem_malloc_end = start + size;
 	mem_malloc_brk = start;

If you are going to do this fixup, av_ should not be initialized with values (you're currently doing the same initialization 2 times). In general, we could probably shave a bit off of U-Boot's size by leaving av_ uninitialized and implementing your manual calculation of av_ above, but I'm not sure why this change should be included in this patch series.

Best,
Peter

#13 lore raw

PATCH 5/6 DLMALLOC:!X86: add av_ initialization

Peter Tyser said the following on 09/19/2009 09:03 AM:

Quoted 12 lines · Nishanth Menon
Quoted 6 lines

This is questionable if this is really required as the av_ static initalized values should have been loaded to sdram as part of the boot process and initialization should have been done.

Is there a reason you need to do this fixup? Based on your commit message its unclear if this patch is really needed...

Essentially, the loaded memory from the NOR looks all corrupted. I am unable to convince myself why the SDRAM is not updated with the static default inits - SDRAM corruption would have cracked everything else and scope measurement looks good too.

Quoted 9 lines
Quoted 9 lines

Signed-off-by: Nishanth Menon <nm
void mem_malloc_init(ulong start, ulong size) {

common/dlmalloc.c +5 -0
+	u8 i;
+	av_[0] = av_[1] = 0;
+	for (i = 0; i < 128; i++)
+		av_[2 + i * 2] = av_[2 + i * 2 + 1] = bin_at(i);
+
 	mem_malloc_start = start;
Quoted 9 lines

common/dlmalloc.c void *sbrk(ptrdiff_t increment) · line 1537

Quoted 3 lines
common/dlmalloc.c +0 -0
 	mem_malloc_end = start + size;
 	mem_malloc_brk = start;

If you are going to do this fixup, av_ should not be initialized with values (you're currently doing the same initialization 2 times). In general, we could probably shave a bit off of U-Boot's size by leaving av_ uninitialized and implementing your manual calculation of av_ above,

yep.. missed finishing that out.. :(

Quoted 3 lines

but I'm not sure why this change should be included in this patch series.

This patch is need for booting SDP3430 from NOR flash.

Regards,
Nishanth Menon

#14 lore raw

PATCH 5/6 DLMALLOC:!X86: add av_ initialization

Quoted 35 lines · Nishanth Menon

Peter Tyser said the following on 09/19/2009 09:03 AM:

Quoted 12 lines · Nishanth Menon
Quoted 6 lines

This is questionable if this is really required as the av_ static initalized values should have been loaded to sdram as part of the boot process and initialization should have been done.

Is there a reason you need to do this fixup? Based on your commit message its unclear if this patch is really needed...

Essentially, the loaded memory from the NOR looks all corrupted. I am unable to convince myself why the SDRAM is not updated with the static default inits - SDRAM corruption would have cracked everything else and scope measurement looks good too.

Quoted 9 lines
Quoted 9 lines

Signed-off-by: Nishanth Menon <nm
void mem_malloc_init(ulong start, ulong size) {

common/dlmalloc.c +5 -0
+	u8 i;
+	av_[0] = av_[1] = 0;
+	for (i = 0; i < 128; i++)
+		av_[2 + i * 2] = av_[2 + i * 2 + 1] = bin_at(i);
+
 	mem_malloc_start = start;
Quoted 9 lines

common/dlmalloc.c void *sbrk(ptrdiff_t increment) · line 1537

Quoted 3 lines
common/dlmalloc.c +0 -0
 	mem_malloc_end = start + size;
 	mem_malloc_brk = start;

If you are going to do this fixup, av_ should not be initialized with values (you're currently doing the same initialization 2 times). In general, we could probably shave a bit off of U-Boot's size by leaving av_ uninitialized and implementing your manual calculation of av_ above,

Quoted 5 lines

yep.. missed finishing that out.. :(

Quoted 3 lines

but I'm not sure why this change should be included in this patch series.

This patch is need for booting SDP3430 from NOR flash.

Once the initialized values for av_ are removed, this patch would be useful for everyone. It looks like it removes a few hundred bytes of code size, so I'm all for it. I'd be a bit concerned about why your board wasn't loading the initialized av_ table though. Seems like it would be indicative of a larger problem...

So in any case, I like the patch because it reduces code size, but I don't think the explanation or commit message of "for an unknown reason it makes my board work" commit message is the best. Its affecting every board, so at a minimum it should describe how it benefits them - eg changing static initialization into dynamic initialization saves some space.

That's my $.02, feel free to proceed as you see fit as I don't have any real power here:)

Best,
Peter

#15 lore raw

PATCH 5/6 DLMALLOC:!X86: add av_ initialization

In reply to Nishanth Menon

Dear Nishanth Menon,

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

This patch is need for booting SDP3430 from NOR flash.

There must be some problem elsewhere. It's extremely unlikely that just a single board has this problem; it's much more likely that there is a bug in the board port, and/or it's linker script.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The universe is all a spin-off of the Big Bang.
#16 lore raw

PATCH 5/6 DLMALLOC:!X86: add av_ initialization

Wolfgang Denk said the following on 09/23/2009 11:04 PM:

Quoted 11 lines

Dear Nishanth Menon,

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

This patch is need for booting SDP3430 from NOR flash.

There must be some problem elsewhere. It's extremely unlikely that just a single board has this problem; it's much more likely that there is a bug in the board port, and/or it's linker script.

Yes, I tend to agree on this. but that said, as pointed out earlier in this thread by Peter Tyser,
it might actually save a few bytes of code.. but I need to really root cause this out before sending out patchset v2.
Regards,
Nishanth Menon

#17 lore raw

PATCH 1/6 OMAP3: Fix SDRC init

In reply to Nishanth Menon

Dear Nishanth Menon,

Quoted 1 line · In message <[email protected]> you wrote:

Defaults are for infenion DDR timings.

Typo: Infineon.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
An Ada exception is when a routine gets in trouble and says
'Beam me up, Scotty'.