Skip to contentSkip to conversation

omap3: zoom1: long pending cleanups :(

PATCH New Nishanth Menon 2 participants 25 messages Apr 3, 2014 – Apr 18, 2014

lore
Share & tools
lore
#0 lore raw

cover omap3: zoom1: long pending cleanups :(

A series of patches to add in ethernet and bootz support.

baseline: v2014.04-rc3

Nishanth Menon (7):
omap3: zoom1: enable CONFIG_SYS_GENERIC_BOARD
OMAP3: zoom1: Configure GPMC for Ethernet
OMAP3: zoom1: enable LAN9211
omap3: zoom1: enable common network commands
omap3: zoom1: disable JFFS2 and enable FS_GENERIC
omap3: zoom1: enable bootz
omap3: zoom1: fix default console

 board/logicpd/zoom1/zoom1.c   |   38 ++++++++++++++++++++++++++++--
 board/logicpd/zoom1/zoom1.h   |   19 ++++++++++-----
 include/configs/omap3_zoom1.h |   52 ++++++++++++++++++++++++++++++-----------
 3 files changed, 87 insertions(+), 22 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/7 omap3: zoom1: enable CONFIG_SYS_GENERIC_BOARD

CONFIG_SYS_GENERIC_BOARD should now be enabled for generic functionality Further information in doc/README.generic-board

---

 include/configs/omap3_zoom1.h |    1 +
 1 file changed, 1 insertion(+)
include/configs/omap3_zoom1.h +1 -0
index f0fa96e..c4178d8 100644
@@ -20,6 +20,7 @@
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3_ZOOM1	1	/* working with Zoom MDK Rev1 */
 #define CONFIG_OMAP_COMMON
+#define CONFIG_SYS_GENERIC_BOARD
 
 #define CONFIG_SDRC	/* The chip has SDRC controller */
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/7 OMAP3: zoom1: Configure GPMC for Ethernet

In reply to Nishanth Menon

zoom1 uses LAN9211 configured over GPMC Chip Select 1.

---

 board/logicpd/zoom1/zoom1.c |   18 ++++++++++++++++++
 board/logicpd/zoom1/zoom1.h |   19 +++++++++++++------
 2 files changed, 31 insertions(+), 6 deletions(-)
board/logicpd/zoom1/zoom1.c +18 -0
index 9846f24..56e512f 100644
@@ -18,6 +18,7 @@
 #include <netdev.h>
 #include <twl4030.h>
 #include <asm/io.h>
+#include <asm/arch/mem.h>
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/sys_proto.h>
@@ -26,6 +27,20 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* gpmc_cfg is initialized by gpmc_init and we use it here */
+extern struct gpmc *gpmc_cfg;
+
+/* GPMC definitions for Ethenet Controller LAN9211 */
+static const u32 gpmc_lab_enet[] = {
+	ZOOM1_ENET_GPMC_CONF1,
+	ZOOM1_ENET_GPMC_CONF2,
+	ZOOM1_ENET_GPMC_CONF3,
+	ZOOM1_ENET_GPMC_CONF4,
+	ZOOM1_ENET_GPMC_CONF5,
+	ZOOM1_ENET_GPMC_CONF6,
+	/*CONF7- computed as params */
+};
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -33,6 +48,9 @@ DECLARE_GLOBAL_DATA_PTR;
 int board_init(void)
 {
 	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
+	/* CS1 is Ethernet LAN9211 */
+	enable_gpmc_cs_config(gpmc_lab_enet, &gpmc_cfg->cs[1],
+			      DEBUG_BASE, GPMC_SIZE_16M);
 	/* board id for Linux */
 	gd->bd->bi_arch_number = MACH_TYPE_OMAP_LDP;
 	/* boot param addr */
board/logicpd/zoom1/zoom1.h +13 -6
index 62ef94f..3a943df 100644
@@ -17,6 +17,13 @@ const omap3_sysinfo sysinfo = {
 	"NAND",
 };
 
+#define ZOOM1_ENET_GPMC_CONF1  0x00611000
+#define ZOOM1_ENET_GPMC_CONF2  0x001F1F01
+#define ZOOM1_ENET_GPMC_CONF3  0x00080803
+#define ZOOM1_ENET_GPMC_CONF4  0x1D091D09
+#define ZOOM1_ENET_GPMC_CONF5  0x041D1F1F
+#define ZOOM1_ENET_GPMC_CONF6  0x1D0904C4
+
 /*
  * IEN	- Input Enable
  * IDIS	- Input Disable
@@ -94,13 +101,13 @@ const omap3_sysinfo sysinfo = {
 	MUX_VAL(CP(GPMC_D14),		(IEN  | PTD | DIS | M0)) /*GPMC_D14*/\
 	MUX_VAL(CP(GPMC_D15),		(IEN  | PTD | DIS | M0)) /*GPMC_D15*/\
 	MUX_VAL(CP(GPMC_NCS0),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS0*/\
-	MUX_VAL(CP(GPMC_NCS1),		(IDIS | PTU | EN  | M7)) /*GPMC_nCS1*/\
-	MUX_VAL(CP(GPMC_NCS2),		(IDIS | PTU | EN  | M7)) /*GPMC_nCS2*/\
-	MUX_VAL(CP(GPMC_NCS3),		(IDIS | PTU | EN  | M7)) /*GPMC_nCS3*/\
-	MUX_VAL(CP(GPMC_NCS4),		(IDIS | PTU | EN  | M7)) /*GPMC_nCS4*/\
-	MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTD | DIS | M7)) /*GPMC_nCS5*/\
+	MUX_VAL(CP(GPMC_NCS1),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS1*/\
+	MUX_VAL(CP(GPMC_NCS2),		(IDIS | PTU | DIS | M7)) /*GPMC_nCS2*/\
+	MUX_VAL(CP(GPMC_NCS3),		(IEN  | PTU | DIS | M4)) /*GPMC_nCS3 -> GPIO54*/\
+	MUX_VAL(CP(GPMC_NCS4),		(IDIS | PTU | DIS | M4)) /*GPMC_nCS4 -> GPIO 55*/\
+	MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTD | DIS | M4)) /*GPMC_nCS5 -> GPIO 56*/\
 	MUX_VAL(CP(GPMC_NCS6),		(IEN  | PTD | DIS | M7)) /*GPMC_nCS6*/\
-	MUX_VAL(CP(GPMC_NCS7),		(IEN  | PTU | EN  | M7)) /*GPMC_nCS7*/\
+	MUX_VAL(CP(GPMC_NCS7),		(IEN  | PTU | EN  | M1)) /*GPMC_nCS7 -> GPMC_IO_DIR*/\
 	MUX_VAL(CP(GPMC_CLK),		(IDIS | PTD | DIS | M0)) /*GPMC_CLK*/\
 	MUX_VAL(CP(GPMC_NADV_ALE),	(IDIS | PTD | DIS | M0)) /*GPMC_nADV_ALE*/\
 	MUX_VAL(CP(GPMC_NOE),		(IDIS | PTD | DIS | M0)) /*GPMC_nOE*/\
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/7 OMAP3: zoom1: enable LAN9211

In reply to Nishanth Menon

Zoom1 was wrongly setup for LAN91C96. Fix it by enabling LAN9211.

---

 board/logicpd/zoom1/zoom1.c   |   20 ++++++++++++++++++--
 include/configs/omap3_zoom1.h |   10 +++++++++-
 2 files changed, 27 insertions(+), 3 deletions(-)
board/logicpd/zoom1/zoom1.c +18 -2
index 56e512f..461a852 100644
@@ -102,9 +102,25 @@ int board_mmc_init(bd_t *bis)
 int board_eth_init(bd_t *bis)
 {
 	int rc = 0;
-#ifdef CONFIG_LAN91C96
-	rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+
+#ifdef CONFIG_SMC911X
+#define STR_ENV_ETHADDR	"ethaddr"
+
+	struct eth_device *dev;
+	uchar eth_addr[6];
+
+	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+	if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) {
+		dev = eth_get_dev_by_index(0);
+		if (dev) {
+			eth_setenv_enetaddr(STR_ENV_ETHADDR, dev->enetaddr);
+		} else {
+			printf("zoom1: Couldn't get eth device\n");
+			rc = -1;
+		}
+	}
 #endif
+
 	return rc;
 }
 #endif
include/configs/omap3_zoom1.h +9 -1
index c4178d8..4a4dfd9 100644
@@ -115,7 +115,7 @@
 #undef CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
 #undef CONFIG_CMD_IMI		/* iminfo			*/
 #undef CONFIG_CMD_IMLS		/* List all found images	*/
-#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
+#define CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
 #undef CONFIG_CMD_NFS		/* NFS support			*/
 
 #define CONFIG_SYS_NO_FLASH
@@ -265,4 +265,12 @@
 
 #define CONFIG_SYS_CACHELINE_SIZE	64
 
+#ifdef CONFIG_CMD_NET
+/* Ethernet (LAN9211 from SMSC9118 family) */
+#define CONFIG_SMC911X
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE		DEBUG_BASE
+
+#endif
+
 #endif				/* __CONFIG_H */
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 4/7 omap3: zoom1: enable common network commands

In reply to Nishanth Menon

Basic networking commands for usability.

---

 include/configs/omap3_zoom1.h |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/configs/omap3_zoom1.h +3 -1
index 4a4dfd9..4fb3628 100644
@@ -116,7 +116,9 @@
 #undef CONFIG_CMD_IMI		/* iminfo			*/
 #undef CONFIG_CMD_IMLS		/* List all found images	*/
 #define CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
-#undef CONFIG_CMD_NFS		/* NFS support			*/
+#define CONFIG_CMD_NFS		/* NFS support			*/
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
 
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_SYS_I2C
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 5/7 omap3: zoom1: disable JFFS2 and enable FS_GENERIC

In reply to Nishanth Menon

This is more in line with commits 664979a2a9f764b63b8094458b87247d254b0cc1(omap3_beagle: remove JFFS2 support.) and 102ce9ea7afdda80fe25aa786975e1722196bdb9 (omap3_beagle:
enable CMD_FS_GENERIC and simplify load of image/ramdisk)

SigMD_FS_GENERIC allows us to simplify where we load up our image from either from ext2/fat etc. So, lets use that instead of cumbersome options we'd have to use. Sticking with existing conventions, defaults will be:
bootfile=uImage
bootpart=0:1 (first partition)
bootdir=/ (/ in first partition)

---

 include/configs/omap3_zoom1.h |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
include/configs/omap3_zoom1.h +12 -10
index 4fb3628..110e3db 100644
@@ -104,7 +104,13 @@
 
 #define CONFIG_CMD_EXT2		/* EXT2 Support			*/
 #define CONFIG_CMD_FAT		/* FAT support			*/
-#define CONFIG_CMD_JFFS2	/* JFFS2 Support		*/
+#define CONFIG_CMD_FS_GENERIC	/* Generic FS support */
+#define CONFIG_CMD_MTDPARTS	/* Enable MTD parts commands */
+#define CONFIG_MTD_DEVICE	/* needed for mtdparts commands */
+#define MTDIDS_DEFAULT			"nand0=nand"
+#define MTDPARTS_DEFAULT		"mtdparts=nand:512k(x-loader),"\
+					"1920k(u-boot),128k(u-boot-env),"\
+					"4m(kernel),-(fs)"
 
 #define CONFIG_CMD_I2C		/* I2C serial bus support	*/
 #define CONFIG_CMD_MMC		/* MMC support			*/
@@ -143,19 +149,15 @@
 							/* CS0 */
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
 							/* devices */
-#define CONFIG_JFFS2_NAND
-/* nand device jffs2 lives on */
-#define CONFIG_JFFS2_DEV		"nand0"
-/* start of jffs2 partition */
-#define CONFIG_JFFS2_PART_OFFSET	0x680000
-#define CONFIG_JFFS2_PART_SIZE		0xf980000	/* size of jffs2 */
-							/* partition */
 
 /* Environment information */
 #define CONFIG_BOOTDELAY		10
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x82000000\0" \
+	"bootfile=uImage\0" \
+	"bootdir=/\0" \
+	"bootpart=0:1\0" \
 	"usbtty=cdc_acm\0" \
 	"console=ttyS2,115200n8\0" \
 	"mmcdev=0\0" \
@@ -172,7 +174,7 @@
 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
 	"bootscript=echo Running bootscript from mmc ...; " \
 		"source ${loadaddr}\0" \
-	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+	"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
 	"mmcboot=echo Booting from mmc ...; " \
 		"run mmcargs; " \
 		"bootm ${loadaddr}\0" \
@@ -186,7 +188,7 @@
 		"if run loadbootscript; then " \
 			"run bootscript; " \
 		"else " \
-			"if run loaduimage; then " \
+			"if run loadimage; then " \
 				"run mmcboot; " \
 			"else run nandboot; " \
 			"fi; " \
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH 5/7 omap3: zoom1: disable JFFS2 and enable FS_GENERIC

Quoted 6 lines · Nishanth Menon

This is more in line with commits 664979a2a9f764b63b8094458b87247d254b0cc1(omap3_beagle: remove JFFS2 support.) and 102ce9ea7afdda80fe25aa786975e1722196bdb9 (omap3_beagle:
enable CMD_FS_GENERIC and simplify load of image/ramdisk)

SigMD_FS_GENERIC allows us to simplify where we load up our image from

Regex gone awry, otherwise looks fine.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140407/f281e946/attachment.pgp>
#7 lore raw

PATCH 6/7 omap3: zoom1: enable bootz

In reply to Nishanth Menon

Boot from zImage and fdt_file if uImage is not available to maintain the legacy behavior.

---

 include/configs/omap3_zoom1.h |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
include/configs/omap3_zoom1.h +12 -1
index 110e3db..e0ab1db 100644
@@ -45,6 +45,7 @@
 #define CONFIG_REVISION_TAG		1
 
 #define CONFIG_OF_LIBFDT		1
+#define CONFIG_CMD_BOOTZ		1
 
 /*
  * Size of malloc() pool
@@ -155,7 +156,10 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x82000000\0" \
+	"fdt_high=0xffffffff\0" \
+	"fdtaddr=0x80f80000\0" \
 	"bootfile=uImage\0" \
+	"fdtfile=omap3-ldp.dtb\0" \
 	"bootdir=/\0" \
 	"bootpart=0:1\0" \
 	"usbtty=cdc_acm\0" \
@@ -175,9 +179,14 @@
 	"bootscript=echo Running bootscript from mmc ...; " \
 		"source ${loadaddr}\0" \
 	"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
+	"loadzimage=setenv bootfile zImage; if run loadimage; then run loadfdt;fi\0"\
 	"mmcboot=echo Booting from mmc ...; " \
 		"run mmcargs; " \
 		"bootm ${loadaddr}\0" \
+	"mmczboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"bootz ${loadaddr} - ${fdtaddr}\0" \
 	"nandboot=echo Booting from nand ...; " \
 		"run nandargs; " \
 		"nand read ${loadaddr} 280000 400000; " \
@@ -190,8 +199,10 @@
 		"else " \
 			"if run loadimage; then " \
 				"run mmcboot; " \
+			"else if run loadzimage; then " \
+				"run mmczboot; " \
 			"else run nandboot; " \
-			"fi; " \
+			"fi; fi;" \
 		"fi; " \
 	"else run nandboot; fi"
 
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH 6/7 omap3: zoom1: enable bootz

Quoted 2 lines · Nishanth Menon

Boot from zImage and fdt_file if uImage is not available to maintain the legacy behavior.

[snip]

include/configs/omap3_zoom1.h line 160

Quoted 4 lines

#define CONFIG_EXTRA_ENV_SETTINGS \

include/configs/omap3_zoom1.h +2 -0
 	"loadaddr=0x82000000\0" \
+	"fdt_high=0xffffffff\0" \
+	"fdtaddr=0x80f80000\0" \

OK, how much memory does this board ever have? If less than 512MB, don't do fdt_high. If 256MB or more, please put fdtaddr at base+128MB. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140407/66847343/attachment.pgp>
#9 lore raw

PATCH 6/7 omap3: zoom1: enable bootz

Quoted 5 lines · Tom Rini
Quoted 2 lines · Nishanth Menon

Boot from zImage and fdt_file if uImage is not available to maintain the legacy behavior.

[snip]

Quoted 8 lines

include/configs/omap3_zoom1.h line 160

Quoted 4 lines
 #define CONFIG_EXTRA_ENV_SETTINGS \
      "loadaddr=0x82000000\0" \
include/configs/omap3_zoom1.h +2 -0
+     "fdt_high=0xffffffff\0" \
+     "fdtaddr=0x80f80000\0" \

OK, how much memory does this board ever have? If less than 512MB, don't do fdt_high. If 256MB or more, please put fdtaddr at base+128MB. Thanks!

As per the board dts in kernel, this platform has 128MB. As per the configuration files, CS1 might not be populated on many boards as well. so 128MB seems to be the max memory available here.

just remove fdt_high?

Regards,
Nishanth Menon

#10 lore raw

PATCH 6/7 omap3: zoom1: enable bootz

Quoted 11 lines · Nishanth Menon
Quoted 10 lines · Tom Rini
Quoted 2 lines · Nishanth Menon

Boot from zImage and fdt_file if uImage is not available to maintain the legacy behavior.

[snip]

Quoted 4 lines
 #define CONFIG_EXTRA_ENV_SETTINGS \
      "loadaddr=0x82000000\0" \
include/configs/omap3_zoom1.h +2 -0
+     "fdt_high=0xffffffff\0" \
+     "fdtaddr=0x80f80000\0" \
Quoted 7 lines
Quoted 3 lines

OK, how much memory does this board ever have? If less than 512MB, don't do fdt_high. If 256MB or more, please put fdtaddr at base+128MB. Thanks!

As per the board dts in kernel, this platform has 128MB. As per the configuration files, CS1 might not be populated on many boards as well. so 128MB seems to be the max memory available here.

I never trust the dts in the kernel wrt memory size, at least for TI platforms as it's always 128MB and we've always gotten by with a run-time fixup (or people not noticing their board had less memory than it really does). And, aside, they ought to adapt the PowerPC convention of saying 0 for memory size so it's clear that the value is fixed up elsewhere.

Quoted 1 line

just remove fdt_high?

Yup.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140408/5ddd2f99/attachment.pgp>
#11 lore raw

PATCH 6/7 omap3: zoom1: enable bootz

Quoted 27 lines · Tom Rini
Quoted 11 lines · Nishanth Menon
Quoted 10 lines · Tom Rini
Quoted 2 lines · Nishanth Menon

Boot from zImage and fdt_file if uImage is not available to maintain the legacy behavior.

[snip]

Quoted 4 lines
 #define CONFIG_EXTRA_ENV_SETTINGS \
      "loadaddr=0x82000000\0" \
include/configs/omap3_zoom1.h +2 -0
+     "fdt_high=0xffffffff\0" \
+     "fdtaddr=0x80f80000\0" \
Quoted 7 lines
Quoted 3 lines

OK, how much memory does this board ever have? If less than 512MB, don't do fdt_high. If 256MB or more, please put fdtaddr at base+128MB. Thanks!

As per the board dts in kernel, this platform has 128MB. As per the configuration files, CS1 might not be populated on many boards as well. so 128MB seems to be the max memory available here.

I never trust the dts in the kernel wrt memory size, at least for TI platforms as it's always 128MB and we've always gotten by with a run-time fixup (or people not noticing their board had less memory than it really does). And, aside, they ought to adapt the PowerPC convention of saying 0 for memory size so it's clear that the value is fixed up elsewhere.

Quoted 3 lines
Quoted 1 line

just remove fdt_high?

Yup.

Done in v2.

#12 lore raw

PATCH 7/7 omap3: zoom1: fix default console

In reply to Nishanth Menon

We do not use ttyS2 anymore in Linux, it changed to ttyO2 a few years back. never too late to update.

---

 include/configs/omap3_zoom1.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/omap3_zoom1.h +1 -1
index e0ab1db..b06838c 100644
@@ -163,7 +163,7 @@
 	"bootdir=/\0" \
 	"bootpart=0:1\0" \
 	"usbtty=cdc_acm\0" \
-	"console=ttyS2,115200n8\0" \
+	"console=ttyO2,115200n8\0" \
 	"mmcdev=0\0" \
 	"videomode=1024x768 at 60,vxres=1024,vyres=768\0" \
 	"videospec=omapfb:vram:2M,vram:4M\0" \
Signature · 1 line
1.7.9.5
#13 lore raw

cover omap3: zoom1: long pending cleanups :(

In reply to Nishanth Menon
Quoted 14 lines · Nishanth Menon

A series of patches to add in ethernet and bootz support.

baseline: v2014.04-rc3

Nishanth Menon (7):
omap3: zoom1: enable CONFIG_SYS_GENERIC_BOARD
OMAP3: zoom1: Configure GPMC for Ethernet
OMAP3: zoom1: enable LAN9211
omap3: zoom1: enable common network commands
omap3: zoom1: disable JFFS2 and enable FS_GENERIC
omap3: zoom1: enable bootz
omap3: zoom1: fix default console

Quoted 3 lines
 board/logicpd/zoom1/zoom1.c   |   38 ++++++++++++++++++++++++++++--
 board/logicpd/zoom1/zoom1.h   |   19 ++++++++++-----
 include/configs/omap3_zoom1.h |   52 ++++++++++++++++++++++++++++++-----------

Can you switch over to include/configs/ti_omap3_common.h as well? I suspect you'll need some of the patches I posted for omap3_evm to do so tho. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140407/b8dcbef6/attachment.pgp>
#14 lore raw

cover omap3: zoom1: long pending cleanups :(

Quoted 16 lines · Tom Rini
Quoted 14 lines · Nishanth Menon

A series of patches to add in ethernet and bootz support.

baseline: v2014.04-rc3

Nishanth Menon (7):
omap3: zoom1: enable CONFIG_SYS_GENERIC_BOARD
OMAP3: zoom1: Configure GPMC for Ethernet
OMAP3: zoom1: enable LAN9211
omap3: zoom1: enable common network commands
omap3: zoom1: disable JFFS2 and enable FS_GENERIC
omap3: zoom1: enable bootz
omap3: zoom1: fix default console

Quoted 7 lines
Quoted 3 lines
 board/logicpd/zoom1/zoom1.c   |   38 ++++++++++++++++++++++++++++--
 board/logicpd/zoom1/zoom1.h   |   19 ++++++++++-----
 include/configs/omap3_zoom1.h |   52 ++++++++++++++++++++++++++++++-----------

Can you switch over to include/configs/ti_omap3_common.h as well? I suspect you'll need some of the patches I posted for omap3_evm to do so tho. Thanks!

Done as the last patch in the series based on v2014.04-rc3 -> I will repost the series in a few mins. lets see if you want further improvements.
Regards,
Nishanth Menon

#15 lore raw

v2 cover omap3: zoom1: long pending cleanups :(

In reply to Tom Rini

V1: http://lists.denx.de/pipermail/u-boot/2014-April/176867.html
changes since v1:
- use ti_omap3_common config header
- fix typo in commit message
- drop fdt_high
test log: http://hastebin.com/moqewevulu.xml

Nishanth Menon (8):
omap3: zoom1: enable CONFIG_SYS_GENERIC_BOARD
OMAP3: zoom1: Configure GPMC for Ethernet
OMAP3: zoom1: enable LAN9211
omap3: zoom1: enable common network commands
omap3: zoom1: disable JFFS2 and enable FS_GENERIC
omap3: zoom1: enable bootz
omap3: zoom1: fix default console
omap3: zoom1: switch to generic ti_omap3_common config header

 board/logicpd/zoom1/config.mk |    1 -
 board/logicpd/zoom1/zoom1.c   |   38 +++++++++-
 board/logicpd/zoom1/zoom1.h   |   19 +++--
 include/configs/omap3_zoom1.h |  167 ++++++++++++-----------------------------
 4 files changed, 98 insertions(+), 127 deletions(-)
Signature · 1 line
1.7.9.5
#16 lore raw

PATCH v2 1/8 omap3: zoom1: enable CONFIG_SYS_GENERIC_BOARD

CONFIG_SYS_GENERIC_BOARD should now be enabled for generic functionality Further information in doc/README.generic-board

---
 include/configs/omap3_zoom1.h |    1 +
 1 file changed, 1 insertion(+)
include/configs/omap3_zoom1.h +1 -0
index f0fa96e..c4178d8 100644
@@ -20,6 +20,7 @@
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3_ZOOM1	1	/* working with Zoom MDK Rev1 */
 #define CONFIG_OMAP_COMMON
+#define CONFIG_SYS_GENERIC_BOARD
 
 #define CONFIG_SDRC	/* The chip has SDRC controller */
 
Signature · 1 line
1.7.9.5
#17 lore raw

PATCH v2 2/8 OMAP3: zoom1: Configure GPMC for Ethernet

In reply to Nishanth Menon

zoom1 uses LAN9211 configured over GPMC Chip Select 1.

---
 board/logicpd/zoom1/zoom1.c |   18 ++++++++++++++++++
 board/logicpd/zoom1/zoom1.h |   19 +++++++++++++------
 2 files changed, 31 insertions(+), 6 deletions(-)
board/logicpd/zoom1/zoom1.c +18 -0
index 9846f24..56e512f 100644
@@ -18,6 +18,7 @@
 #include <netdev.h>
 #include <twl4030.h>
 #include <asm/io.h>
+#include <asm/arch/mem.h>
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/sys_proto.h>
@@ -26,6 +27,20 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* gpmc_cfg is initialized by gpmc_init and we use it here */
+extern struct gpmc *gpmc_cfg;
+
+/* GPMC definitions for Ethenet Controller LAN9211 */
+static const u32 gpmc_lab_enet[] = {
+	ZOOM1_ENET_GPMC_CONF1,
+	ZOOM1_ENET_GPMC_CONF2,
+	ZOOM1_ENET_GPMC_CONF3,
+	ZOOM1_ENET_GPMC_CONF4,
+	ZOOM1_ENET_GPMC_CONF5,
+	ZOOM1_ENET_GPMC_CONF6,
+	/*CONF7- computed as params */
+};
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -33,6 +48,9 @@ DECLARE_GLOBAL_DATA_PTR;
 int board_init(void)
 {
 	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
+	/* CS1 is Ethernet LAN9211 */
+	enable_gpmc_cs_config(gpmc_lab_enet, &gpmc_cfg->cs[1],
+			      DEBUG_BASE, GPMC_SIZE_16M);
 	/* board id for Linux */
 	gd->bd->bi_arch_number = MACH_TYPE_OMAP_LDP;
 	/* boot param addr */
board/logicpd/zoom1/zoom1.h +13 -6
index 62ef94f..3a943df 100644
@@ -17,6 +17,13 @@ const omap3_sysinfo sysinfo = {
 	"NAND",
 };
 
+#define ZOOM1_ENET_GPMC_CONF1  0x00611000
+#define ZOOM1_ENET_GPMC_CONF2  0x001F1F01
+#define ZOOM1_ENET_GPMC_CONF3  0x00080803
+#define ZOOM1_ENET_GPMC_CONF4  0x1D091D09
+#define ZOOM1_ENET_GPMC_CONF5  0x041D1F1F
+#define ZOOM1_ENET_GPMC_CONF6  0x1D0904C4
+
 /*
  * IEN	- Input Enable
  * IDIS	- Input Disable
@@ -94,13 +101,13 @@ const omap3_sysinfo sysinfo = {
 	MUX_VAL(CP(GPMC_D14),		(IEN  | PTD | DIS | M0)) /*GPMC_D14*/\
 	MUX_VAL(CP(GPMC_D15),		(IEN  | PTD | DIS | M0)) /*GPMC_D15*/\
 	MUX_VAL(CP(GPMC_NCS0),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS0*/\
-	MUX_VAL(CP(GPMC_NCS1),		(IDIS | PTU | EN  | M7)) /*GPMC_nCS1*/\
-	MUX_VAL(CP(GPMC_NCS2),		(IDIS | PTU | EN  | M7)) /*GPMC_nCS2*/\
-	MUX_VAL(CP(GPMC_NCS3),		(IDIS | PTU | EN  | M7)) /*GPMC_nCS3*/\
-	MUX_VAL(CP(GPMC_NCS4),		(IDIS | PTU | EN  | M7)) /*GPMC_nCS4*/\
-	MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTD | DIS | M7)) /*GPMC_nCS5*/\
+	MUX_VAL(CP(GPMC_NCS1),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS1*/\
+	MUX_VAL(CP(GPMC_NCS2),		(IDIS | PTU | DIS | M7)) /*GPMC_nCS2*/\
+	MUX_VAL(CP(GPMC_NCS3),		(IEN  | PTU | DIS | M4)) /*GPMC_nCS3 -> GPIO54*/\
+	MUX_VAL(CP(GPMC_NCS4),		(IDIS | PTU | DIS | M4)) /*GPMC_nCS4 -> GPIO 55*/\
+	MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTD | DIS | M4)) /*GPMC_nCS5 -> GPIO 56*/\
 	MUX_VAL(CP(GPMC_NCS6),		(IEN  | PTD | DIS | M7)) /*GPMC_nCS6*/\
-	MUX_VAL(CP(GPMC_NCS7),		(IEN  | PTU | EN  | M7)) /*GPMC_nCS7*/\
+	MUX_VAL(CP(GPMC_NCS7),		(IEN  | PTU | EN  | M1)) /*GPMC_nCS7 -> GPMC_IO_DIR*/\
 	MUX_VAL(CP(GPMC_CLK),		(IDIS | PTD | DIS | M0)) /*GPMC_CLK*/\
 	MUX_VAL(CP(GPMC_NADV_ALE),	(IDIS | PTD | DIS | M0)) /*GPMC_nADV_ALE*/\
 	MUX_VAL(CP(GPMC_NOE),		(IDIS | PTD | DIS | M0)) /*GPMC_nOE*/\
Signature · 1 line
1.7.9.5
#18 lore raw

PATCH v2 3/8 OMAP3: zoom1: enable LAN9211

In reply to Nishanth Menon

Zoom1 was wrongly setup for LAN91C96. Fix it by enabling LAN9211.

---
 board/logicpd/zoom1/zoom1.c   |   20 ++++++++++++++++++--
 include/configs/omap3_zoom1.h |   10 +++++++++-
 2 files changed, 27 insertions(+), 3 deletions(-)
board/logicpd/zoom1/zoom1.c +18 -2
index 56e512f..461a852 100644
@@ -102,9 +102,25 @@ int board_mmc_init(bd_t *bis)
 int board_eth_init(bd_t *bis)
 {
 	int rc = 0;
-#ifdef CONFIG_LAN91C96
-	rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+
+#ifdef CONFIG_SMC911X
+#define STR_ENV_ETHADDR	"ethaddr"
+
+	struct eth_device *dev;
+	uchar eth_addr[6];
+
+	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+	if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) {
+		dev = eth_get_dev_by_index(0);
+		if (dev) {
+			eth_setenv_enetaddr(STR_ENV_ETHADDR, dev->enetaddr);
+		} else {
+			printf("zoom1: Couldn't get eth device\n");
+			rc = -1;
+		}
+	}
 #endif
+
 	return rc;
 }
 #endif
include/configs/omap3_zoom1.h +9 -1
index c4178d8..4a4dfd9 100644
@@ -115,7 +115,7 @@
 #undef CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
 #undef CONFIG_CMD_IMI		/* iminfo			*/
 #undef CONFIG_CMD_IMLS		/* List all found images	*/
-#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
+#define CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
 #undef CONFIG_CMD_NFS		/* NFS support			*/
 
 #define CONFIG_SYS_NO_FLASH
@@ -265,4 +265,12 @@
 
 #define CONFIG_SYS_CACHELINE_SIZE	64
 
+#ifdef CONFIG_CMD_NET
+/* Ethernet (LAN9211 from SMSC9118 family) */
+#define CONFIG_SMC911X
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE		DEBUG_BASE
+
+#endif
+
 #endif				/* __CONFIG_H */
Signature · 1 line
1.7.9.5
#19 lore raw

PATCH v2 4/8 omap3: zoom1: enable common network commands

In reply to Nishanth Menon

Basic networking commands for usability.

---
 include/configs/omap3_zoom1.h |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/configs/omap3_zoom1.h +3 -1
index 4a4dfd9..4fb3628 100644
@@ -116,7 +116,9 @@
 #undef CONFIG_CMD_IMI		/* iminfo			*/
 #undef CONFIG_CMD_IMLS		/* List all found images	*/
 #define CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
-#undef CONFIG_CMD_NFS		/* NFS support			*/
+#define CONFIG_CMD_NFS		/* NFS support			*/
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
 
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_SYS_I2C
Signature · 1 line
1.7.9.5
#20 lore raw

PATCH v2 5/8 omap3: zoom1: disable JFFS2 and enable FS_GENERIC

In reply to Nishanth Menon

This is more in line with commits 664979a2a9f764b63b8094458b87247d254b0cc1(omap3_beagle: remove JFFS2 support.) and 102ce9ea7afdda80fe25aa786975e1722196bdb9 (omap3_beagle:
enable CMD_FS_GENERIC and simplify load of image/ramdisk)

CMD_FS_GENERIC allows us to simplify where we load up our image from either from ext2/fat etc. So, lets use that instead of cumbersome options we'd have to use. Sticking with existing conventions, defaults will be:
bootfile=uImage
bootpart=0:1 (first partition)
bootdir=/ (/ in first partition)

---
 include/configs/omap3_zoom1.h |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
include/configs/omap3_zoom1.h +12 -10
index 4fb3628..110e3db 100644
@@ -104,7 +104,13 @@
 
 #define CONFIG_CMD_EXT2		/* EXT2 Support			*/
 #define CONFIG_CMD_FAT		/* FAT support			*/
-#define CONFIG_CMD_JFFS2	/* JFFS2 Support		*/
+#define CONFIG_CMD_FS_GENERIC	/* Generic FS support */
+#define CONFIG_CMD_MTDPARTS	/* Enable MTD parts commands */
+#define CONFIG_MTD_DEVICE	/* needed for mtdparts commands */
+#define MTDIDS_DEFAULT			"nand0=nand"
+#define MTDPARTS_DEFAULT		"mtdparts=nand:512k(x-loader),"\
+					"1920k(u-boot),128k(u-boot-env),"\
+					"4m(kernel),-(fs)"
 
 #define CONFIG_CMD_I2C		/* I2C serial bus support	*/
 #define CONFIG_CMD_MMC		/* MMC support			*/
@@ -143,19 +149,15 @@
 							/* CS0 */
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
 							/* devices */
-#define CONFIG_JFFS2_NAND
-/* nand device jffs2 lives on */
-#define CONFIG_JFFS2_DEV		"nand0"
-/* start of jffs2 partition */
-#define CONFIG_JFFS2_PART_OFFSET	0x680000
-#define CONFIG_JFFS2_PART_SIZE		0xf980000	/* size of jffs2 */
-							/* partition */
 
 /* Environment information */
 #define CONFIG_BOOTDELAY		10
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x82000000\0" \
+	"bootfile=uImage\0" \
+	"bootdir=/\0" \
+	"bootpart=0:1\0" \
 	"usbtty=cdc_acm\0" \
 	"console=ttyS2,115200n8\0" \
 	"mmcdev=0\0" \
@@ -172,7 +174,7 @@
 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
 	"bootscript=echo Running bootscript from mmc ...; " \
 		"source ${loadaddr}\0" \
-	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+	"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
 	"mmcboot=echo Booting from mmc ...; " \
 		"run mmcargs; " \
 		"bootm ${loadaddr}\0" \
@@ -186,7 +188,7 @@
 		"if run loadbootscript; then " \
 			"run bootscript; " \
 		"else " \
-			"if run loaduimage; then " \
+			"if run loadimage; then " \
 				"run mmcboot; " \
 			"else run nandboot; " \
 			"fi; " \
Signature · 1 line
1.7.9.5
#21 lore raw

PATCH v2 6/8 omap3: zoom1: enable bootz

In reply to Nishanth Menon

Boot from zImage and fdt_file if uImage is not available to maintain the legacy behavior.

---
 include/configs/omap3_zoom1.h |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
include/configs/omap3_zoom1.h +11 -1
index 110e3db..477fb10 100644
@@ -45,6 +45,7 @@
 #define CONFIG_REVISION_TAG		1
 
 #define CONFIG_OF_LIBFDT		1
+#define CONFIG_CMD_BOOTZ		1
 
 /*
  * Size of malloc() pool
@@ -155,7 +156,9 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x82000000\0" \
+	"fdtaddr=0x80f80000\0" \
 	"bootfile=uImage\0" \
+	"fdtfile=omap3-ldp.dtb\0" \
 	"bootdir=/\0" \
 	"bootpart=0:1\0" \
 	"usbtty=cdc_acm\0" \
@@ -175,9 +178,14 @@
 	"bootscript=echo Running bootscript from mmc ...; " \
 		"source ${loadaddr}\0" \
 	"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
+	"loadzimage=setenv bootfile zImage; if run loadimage; then run loadfdt;fi\0"\
 	"mmcboot=echo Booting from mmc ...; " \
 		"run mmcargs; " \
 		"bootm ${loadaddr}\0" \
+	"mmczboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"bootz ${loadaddr} - ${fdtaddr}\0" \
 	"nandboot=echo Booting from nand ...; " \
 		"run nandargs; " \
 		"nand read ${loadaddr} 280000 400000; " \
@@ -190,8 +198,10 @@
 		"else " \
 			"if run loadimage; then " \
 				"run mmcboot; " \
+			"else if run loadzimage; then " \
+				"run mmczboot; " \
 			"else run nandboot; " \
-			"fi; " \
+			"fi; fi;" \
 		"fi; " \
 	"else run nandboot; fi"
 
Signature · 1 line
1.7.9.5
#22 lore raw

PATCH v2 7/8 omap3: zoom1: fix default console

In reply to Nishanth Menon

We do not use ttyS2 anymore in Linux, it changed to ttyO2 a few years back. never too late to update.

---
 include/configs/omap3_zoom1.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/omap3_zoom1.h +1 -1
index 477fb10..4f933d9 100644
@@ -162,7 +162,7 @@
 	"bootdir=/\0" \
 	"bootpart=0:1\0" \
 	"usbtty=cdc_acm\0" \
-	"console=ttyS2,115200n8\0" \
+	"console=ttyO2,115200n8\0" \
 	"mmcdev=0\0" \
 	"videomode=1024x768 at 60,vxres=1024,vyres=768\0" \
 	"videospec=omapfb:vram:2M,vram:4M\0" \
Signature · 1 line
1.7.9.5
#23 lore raw

PATCH v2 8/8 omap3: zoom1: switch to generic ti_omap3_common config header

In reply to Nishanth Menon

ti_omap3_common contains a lot of common header definitions that help reduce the size of the zoom1 config file. So, use the generic header and customize as needed for the platform (example: no spl).

---
 board/logicpd/zoom1/config.mk |    1 -
 include/configs/omap3_zoom1.h |  124 ++++++-----------------------------------
 2 files changed, 16 insertions(+), 109 deletions(-)
board/logicpd/zoom1/config.mk +0 -1
index f5a19ed..c7ebfd9 100644
@@ -14,4 +14,3 @@
 # (mem base + reserved)
 
 # For use with external or internal boots.
-CONFIG_SYS_TEXT_BASE = 0x80008000
include/configs/omap3_zoom1.h +16 -108

203 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#24 lore raw

v2 cover omap3: zoom1: long pending cleanups :(

In reply to Nishanth Menon
Quoted 7 lines · Nishanth Menon

V1: http://lists.denx.de/pipermail/u-boot/2014-April/176867.html
changes since v1:
- use ti_omap3_common config header
- fix typo in commit message
- drop fdt_high
test log: http://hastebin.com/moqewevulu.xml

Quoted 9 lines

Nishanth Menon (8):
omap3: zoom1: enable CONFIG_SYS_GENERIC_BOARD
OMAP3: zoom1: Configure GPMC for Ethernet
OMAP3: zoom1: enable LAN9211
omap3: zoom1: enable common network commands
omap3: zoom1: disable JFFS2 and enable FS_GENERIC
omap3: zoom1: enable bootz
omap3: zoom1: fix default console
omap3: zoom1: switch to generic ti_omap3_common config header

Applied to u-boot-ti/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140418/306c2dda/attachment.pgp>