Skip to contentSkip to conversation

ARMV7: Add support For Logic OMAP35x/DM37x modules

PATCH Superseded Peter Barada 4 participants 21 messages Dec 14, 2011 – Jan 3, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

From: Peter Barada <[email protected]>

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

---
 board/logicpd/omap3som/Makefile     |   48 +++
 board/logicpd/omap3som/config.mk    |   33 ++
 board/logicpd/omap3som/omap3logic.c |  566 +++++++++++++++++++++++++++++++++++
 board/logicpd/omap3som/omap3logic.h |   35 +++
 boards.cfg                          |    1 +
 include/configs/omap3_logic.h       |  356 ++++++++++++++++++++++
 6 files changed, 1039 insertions(+), 0 deletions(-)
 create mode 100644 board/logicpd/omap3som/Makefile
 create mode 100644 board/logicpd/omap3som/config.mk
 create mode 100644 board/logicpd/omap3som/omap3logic.c
 create mode 100644 board/logicpd/omap3som/omap3logic.h
 create mode 100644 include/configs/omap3_logic.h
board/logicpd/omap3som/Makefile new file +48 -0
new file mode 100644
index 0000000..ef0409f
@@ -0,0 +1,48 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS-y	:= omap3logic.o
+
+COBJS	:= $(sort $(COBJS-y))
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+clean:
+	rm -f $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
board/logicpd/omap3som/config.mk new file +33 -0
new file mode 100644
index 0000000..897b252
@@ -0,0 +1,33 @@
+#
+# (C) Copyright 2006 - 2008
+# Texas Instruments, <www.ti.com>
+#
+# EVM 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.
+CONFIG_SYS_TEXT_BASE = 0x80400000
board/logicpd/omap3som/omap3logic.c new file +566 -0

566 lines not on this page · raw message

board/logicpd/omap3som/omap3logic.h new file +35 -0
new file mode 100644
index 0000000..5b2ca66
@@ -0,0 +1,35 @@
+/*
+ * (C) Copyright 2011
+ * Logic Product Development <www.logicpd.com>
+ *
+ * Author:
+ * Peter Barada <[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 _OMAP3LOGIC_H_
+#define _OMAP3LOGIC_H_
+
+const omap3_sysinfo sysinfo = {
+	DDR_DISCRETE,
+	"Logic DM37x/OMAP35x reference board",
+	"NAND",
+};
+
+#endif
boards.cfg +1 -0
index 1e5b3e0..f07ae28 100644
@@ -202,6 +202,7 @@ igep0030                     arm         armv7       igep0030            isee
 am3517_evm                   arm         armv7       am3517evm           logicpd        omap3
 omap3_zoom1                  arm         armv7       zoom1               logicpd        omap3
 omap3_zoom2                  arm         armv7       zoom2               logicpd        omap3
+omap3_logic                  arm         armv7       omap3som            logicpd        omap3
 omap3_mvblx                  arm         armv7       mvblx               matrix_vision  omap3
 am3517_crane                 arm         armv7       am3517crane         ti             omap3
 omap3_beagle                 arm         armv7       beagle              ti             omap3
include/configs/omap3_logic.h new file +356 -0

356 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

Quoted 5 lines · Peter Barada

From: Peter Barada <[email protected]>

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

We can't merge this with the existing am3517evm support? Also, have you tried out SPL for this board yet? It'd probably be good to switch from x-loader.

[snip]

Quoted 2 lines

+++ b/board/logicpd/omap3som/config.mk
+CONFIG_SYS_TEXT_BASE = 0x80400000

This should be in the config file.

Quoted 1 line
board/logicpd/omap3som/omap3logic.c +0 -0

[snip]

Quoted 1 line

+unsigned int logic_identify(void)

Should be 'static'

Quoted 5 lines
board/logicpd/omap3som/omap3logic.c +5 -0
+{
+ ? ? ? unsigned int val = 0;
+ ? ? ? u32 cpu_family = get_cpu_family();
+ ? ? ? int i;
+

board/logicpd/omap3som/omap3logic.c

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c +10 -0
+ ? ? ? MUX_LOGIC_HSUSB0_DATA5_GPIO_MUX();
+
+ ? ? ? if (!gpio_request(189, "")) {
+
+ ? ? ? ? ? ? ? gpio_direction_output(189, 0);
+ ? ? ? ? ? ? ? gpio_set_value(189, 1);
+
+ ? ? ? ? ? ? ? /* Let it soak for a bit */
+ ? ? ? ? ? ? ? for (i = 0; i < 0x100; ++i)
+ ? ? ? ? ? ? ? ? ? ? ? asm("nop");

Just use one of the existing delay functions?

Quoted 13 lines

+ ? ? ? ? ? ? ? printf("Board:");
+ ? ? ? ? ? ? ? if (cpu_family == CPU_OMAP36XX) {
+ ? ? ? ? ? ? ? ? ? ? ? printf(" DM37xx");
+ ? ? ? ? ? ? ? ? ? ? ? if (val) {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? printf(" Torpedo\n");
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? val = MACH_TYPE_DM3730_TORPEDO;
+ ? ? ? ? ? ? ? ? ? ? ? } else {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? printf(" SOM LV\n");
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? val = MACH_TYPE_DM3730_SOM_LV;
+ ? ? ? ? ? ? ? ? ? ? ? }
+ ? ? ? ? ? ? ? } else {
+ ? ? ? ? ? ? ? ? ? ? ? printf(" OMAP35xx");
+ ? ? ? ? ? ? ? ? ? ? ? if (val) {

Quoted 8 lines

+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? printf(" Torpedo\n");
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? val = MACH_TYPE_OMAP3_TORPEDO;
+ ? ? ? ? ? ? ? ? ? ? ? } else {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? printf(" SOM LV\n");
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? val = MACH_TYPE_OMAP3530_LV_SOM;
+ ? ? ? ? ? ? ? ? ? ? ? }
+ ? ? ? ? ? ? ? }
+ ? ? ? }

This could be condensed into just two checks, cpu_family and then val.

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c +10 -0
+static void setup_net_chip(void)
+{
+ ? ? ? struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+ ? ? ? /* Configure GPMC registers */
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG1, &gpmc_cfg->cs[1].config1);
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG2, &gpmc_cfg->cs[1].config2);
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG3, &gpmc_cfg->cs[1].config3);
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG4, &gpmc_cfg->cs[1].config4);
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG5, &gpmc_cfg->cs[1].config5);

board/logicpd/omap3som/omap3logic.c

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c +10 -0
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG6, &gpmc_cfg->cs[1].config6);
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG7, &gpmc_cfg->cs[1].config7);
+
+ ? ? ? /* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+ ? ? ? writew(readw(&ctrl_base->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+ ? ? ? /* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+ ? ? ? writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+ ? ? ? /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+ ? ? ? writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+ ? ? ? ? ? ? ? &ctrl_base->gpmc_nadv_ale);

Please switch this to enable_gpmc_cs_config(..) and note that config7 is computed so shouldn't be #defined.

[snip]

board/logicpd/omap3som/omap3logic.c line 174

Quoted 11 lines
board/logicpd/omap3som/omap3logic.c +11 -0
+int board_late_init(void)
+{
+ ? ? ? unsigned char enetaddr[6];
+
+#ifdef CONFIG_CMD_CACHE
+ ? ? ? dcache_enable();
+ ? ? ? printf("Data (writethrough) Cache is %s\n",
+ ? ? ? ? ? ? ? dcache_status() ? "ON" : "OFF");
+#endif
+ ? ? ? return 0;
+}

Cache should be defaulting to enabled already and enetaddr is unused, so you could drop board_late_init.

board/logicpd/omap3som/omap3logic.c line 182

Quoted 8 lines
board/logicpd/omap3som/omap3logic.c +8 -0
+
+#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+int board_mmc_init(bd_t *bis)
+{
+ ? ? ? omap_mmc_init(0);
+ ? ? ? return 0;
+}
+#endif

Just a one line return omap_mmc_init(0);

Quoted 15 lines
board/logicpd/omap3som/omap3logic.c +15 -0
+/*
+ * Routine: misc_init_r
+ * Description: Init ethernet (done here so udelay works)
+ */
+int misc_init_r(void)
+{
+#if defined(CONFIG_CMD_NET)
+ ? ? ? setup_net_chip();
+#endif
+
+ ? ? ? dieid_num_r();
+
+ ? ? ? return 0;
+}
+

board/logicpd/omap3som/omap3logic.c line 208

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c +10 -0
+
+
+int board_eth_init(bd_t *bis)
+{
+ ? ? ? int rc = 0;
+#ifdef CONFIG_SMC911X
+ ? ? ? rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+ ? ? ? return rc;
+}

Just return smc911x_..(...); and iirc you only need to provide board_eth_init when CONFIG_CMD_NET or perhaps CONFIG_SMC911X is set.

[snip]

Quoted 1 line

+++ b/include/configs/omap3_logic.h

[snip]

board/logicpd/omap3som/omap3logic.c

Quoted 2 lines
board/logicpd/omap3som/omap3logic.c +2 -0
+#define CONFIG_ARMV7 ? ? ? ? ? 1 ? ? ? /* This is an ARM V7 CPU core */
+#define CONFIG_OMAP ? ? ? ? ? ?1 ? ? ? /* in a TI OMAP core */

In this file at large, two problems. One, you've got 'dead' #defines like CONFIG_ARMV7 and CONFIG_NET_MULTI (and probably others, there's been a number of recent threads and patches removing stuff I think I see you bringing back) and two the preferred syntax is just '#define CONFIG_FOO' for on/off stuff.

Thanks!

Signature · 1 line
Tom
#2 lore raw

PATCH 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

Quoted 11 lines · Tom Rini
Quoted 5 lines · Peter Barada

From: Peter Barada <[email protected]>

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

We can't merge this with the existing am3517evm support? Also, have you tried out SPL for this board yet? It'd probably be good to switch from x-loader.

At first glance this board file and the am3517evm board files look close, but I think they will diverge shortly when I submit more patches to deal with specific peripherals on these boards (such as dynamic LCD/HDMI screen configuration based on environment variables).

I want to switch from x-loader to SPL, and will (when I can find time) - and submit patches for SPL support then.

I'll incorporate your suggestions into a new version and resubmit the patch.

Signature · 2 lines
Peter Barada
peter.barada at logicpd.com
#3 lore raw

PATCH 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

In reply to Peter Barada

Hi Peter,

In addition to Tom's comments, several comments below:

Quoted 58 lines · Peter Barada

From: Peter Barada <[email protected]>

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

---
 board/logicpd/omap3som/Makefile     |   48 +++
 board/logicpd/omap3som/config.mk    |   33 ++
 board/logicpd/omap3som/omap3logic.c |  566 +++++++++++++++++++++++++++++++++++
 board/logicpd/omap3som/omap3logic.h |   35 +++
 boards.cfg                          |    1 +
 include/configs/omap3_logic.h       |  356 ++++++++++++++++++++++
 6 files changed, 1039 insertions(+), 0 deletions(-)
 create mode 100644 board/logicpd/omap3som/Makefile
 create mode 100644 board/logicpd/omap3som/config.mk
 create mode 100644 board/logicpd/omap3som/omap3logic.c
 create mode 100644 board/logicpd/omap3som/omap3logic.h
 create mode 100644 include/configs/omap3_logic.h
board/logicpd/omap3som/Makefile new file +31 -0
new file mode 100644
index 0000000..ef0409f
@@ -0,0 +1,48 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS-y	:= omap3logic.o
+
+COBJS	:= $(sort $(COBJS-y))
+SRCS	:= $(COBJS:.o=.c)

board/logicpd/omap3som/Makefile line 41

Quoted 10 lines
board/logicpd/omap3som/Makefile new file +10 -0
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+clean:
+	rm -f $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak $(obj).depend

clean and distclean are obsolete in this directory level, please remove.

Quoted 36 lines
board/logicpd/omap3som/Makefile new file +7 -0
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
board/logicpd/omap3som/config.mk new file +23 -0
new file mode 100644
index 0000000..897b252
@@ -0,0 +1,33 @@
+#
+# (C) Copyright 2006 - 2008
+# Texas Instruments, <www.ti.com>
+#
+# EVM 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,

board/logicpd/omap3som/config.mk line 33

Quoted 10 lines
board/logicpd/omap3som/config.mk new file +10 -0
+# 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.
+CONFIG_SYS_TEXT_BASE = 0x80400000

As Tom already said, this should be in the board config file and this file should be removed completely.

Quoted 24 lines
board/logicpd/omap3som/omap3logic.c new file +18 -0
new file mode 100644
index 0000000..5c6e896
@@ -0,0 +1,566 @@
+/*
+ * (C) Copyright 2011
+ * Logic Product Development <www.logicpd.com>
+ *
+ * Author :
+ *	Peter Barada <[email protected]>
+ *
+ * Derived from Beagle Board and 3430 SDP code by
+ *	Richard Woodruff <[email protected]>
+ *	Syed Mohammed Khasim <[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.

board/logicpd/omap3som/omap3logic.c line 28

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c new file +10 -0
+ *
+ * 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

I vote for removing the postal address,
because it is subject to change and you will not follow it, but it is not a blocker.

[...]

board/logicpd/omap3som/omap3logic.c line 63

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c new file +10 -0
+/*
+ * Routine: logic_identify
+ * Description: Detect if we are running on a Logic or Torpedo.
+ *              This can be done by GPIO_189. If its low after driving it high,
+ *              then its a SOM LV, else Torpedo.
+ */
+unsigned int logic_identify(void)
+{
+	unsigned int val = 0;
+	u32 cpu_family = get_cpu_family();

You only use this once, so IMO can be inlined.

board/logicpd/omap3som/omap3logic.c line 68

Quoted 5 lines
board/logicpd/omap3som/omap3logic.c new file +5 -0
+	int i;
+
+	MUX_LOGIC_HSUSB0_DATA5_GPIO_MUX();
+
+	if (!gpio_request(189, "")) {

This does not look good... can it be:
if (gpio_request(...) == 0)
and also please provide a label with a description instead of an empty one.

Quoted 28 lines
board/logicpd/omap3som/omap3logic.c new file +28 -0
+
+		gpio_direction_output(189, 0);
+		gpio_set_value(189, 1);
+
+		/* Let it soak for a bit */
+		for (i = 0; i < 0x100; ++i)
+			asm("nop");
+
+		gpio_direction_input(189);
+		val = gpio_get_value(189);
+		gpio_free(189);
+
+		printf("Board:");
+		if (cpu_family == CPU_OMAP36XX) {
+			printf(" DM37xx");
+			if (val) {
+				printf(" Torpedo\n");
+				val = MACH_TYPE_DM3730_TORPEDO;
+			} else {
+				printf(" SOM LV\n");
+				val = MACH_TYPE_DM3730_SOM_LV;
+			}
+		} else {
+			printf(" OMAP35xx");
+			if (val) {
+				printf(" Torpedo\n");
+				val = MACH_TYPE_OMAP3_TORPEDO;
+			} else {

board/logicpd/omap3som/omap3logic.c line 106

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c new file +10 -0
+				printf(" SOM LV\n");
+				val = MACH_TYPE_OMAP3530_LV_SOM;
+			}
+		}
+	}
+
+	MUX_LOGIC_HSUSB0_DATA5_DATA5();
+
+	return val;
+}

The whole function looks like checkboard(), isn't it? I think it should be then.

[...]

board/logicpd/omap3som/omap3logic.c line 155

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c new file +10 -0
+/*
+ * Routine: board_init
+ * Description: Early hardware init.
+ */
+int board_init(void)
+{
+	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
+
+	/* board id for Linux */
+	gd->bd->bi_arch_number = logic_identify();

This also can be moved to checkboard().

Quoted 7 lines
board/logicpd/omap3som/omap3logic.c new file +7 -0
+
+	/* boot param addr */
+	gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
+
+
+	return 0;
+}

[...]

board/logicpd/omap3som/omap3logic.c line 192

Quoted 9 lines
board/logicpd/omap3som/omap3logic.c new file +9 -0
+/*
+ * Routine: misc_init_r
+ * Description: Init ethernet (done here so udelay works)
+ */
+int misc_init_r(void)
+{
+#if defined(CONFIG_CMD_NET)
+	setup_net_chip();
+#endif

Can this be done in board_eth_init()?
So the net init code will be close to each other?

board/logicpd/omap3som/omap3logic.c line 200

Quoted 8 lines
board/logicpd/omap3som/omap3logic.c new file +8 -0
+
+	dieid_num_r();
+
+	return 0;
+}
+
+
+

Three empty lines?
There should be only one line between functions.

board/logicpd/omap3som/omap3logic.c line 208

Quoted 8 lines
board/logicpd/omap3som/omap3logic.c new file +8 -0
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC911X
+	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+	return rc;
+}

board_eth_init() has a weak implementation, so
I think it would be much nicer:
#ifdef CONFIG_SMC911X
int board_eth_init(bd_t *bis)

{
	setup_net_chip();

	return smc911x_initialize(0, CONFIG_SMC911X_BASE);
}

#endif

board/logicpd/omap3som/omap3logic.c

Quoted 3 lines
board/logicpd/omap3som/omap3logic.c new file +3 -0
+
+
+

Again three empty lines?

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c new file +10 -0
+/*
+ * IEN  - Input Enable
+ * IDIS - Input Disable
+ * PTD  - Pull type Down
+ * PTU  - Pull type Up
+ * DIS  - Pull type selection is inactive
+ * EN   - Pull type selection is active
+ * M0   - Mode 0
+ * The commented string gives the final mux configuration for that pin
+ */

board/logicpd/omap3som/omap3logic.c line 231

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c new file +10 -0
+
+/*
+ * Routine: set_muxconf_regs
+ * Description: Setting up the configuration Mux registers specific to the
+ *		hardware. Many pins need to be moved from protect to primary
+ *		mode.
+ */
+void set_muxconf_regs(void)
+{
+ /*SDRC*/

Alignment...

[...]

Quoted 1 line

+ /*GPMC*/

same here, comments must be aligned to code.

[...]

Quoted 1 line

+ /*DSS*/

ditto

[...]

Quoted 1 line

+ /*CAMERA*/

ditto

[...]

Quoted 1 line

+ /*Audio Interface */

ditto

board/logicpd/omap3som/omap3logic.c line 375

Quoted 6 lines
board/logicpd/omap3som/omap3logic.c new file +6 -0
+	MUX_VAL(CP(MCBSP2_FSX),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(MCBSP2_CLKX),	(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(MCBSP2_DR),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(MCBSP2_DX),		(IEN  | PTD | EN  | M7)); /*safe mode */
+
+ /*Expansion card  */

ditto

board/logicpd/omap3som/omap3logic.c line 386

Quoted 11 lines
board/logicpd/omap3som/omap3logic.c new file +11 -0
+	MUX_VAL(CP(MMC1_CLK),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_CMD),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT0),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT1),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT2),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT3),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT4),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC1_DAT5),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC1_DAT6),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC1_DAT7),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+ /*Wireless LAN */

ditto

board/logicpd/omap3som/omap3logic.c line 397

Quoted 11 lines
board/logicpd/omap3som/omap3logic.c new file +11 -0
+	MUX_VAL(CP(MMC2_CLK),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_CMD),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT0),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT1),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT2),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT3),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT4),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT5),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT6),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT7),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+ /*Bluetooth*/

ditto

board/logicpd/omap3som/omap3logic.c line 406

Quoted 9 lines
board/logicpd/omap3som/omap3logic.c new file +9 -0
+	MUX_VAL(CP(MCBSP3_DX),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP3_DR),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP3_CLKX),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP3_FSX),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(UART2_CTS),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(UART2_RTS),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(UART2_TX),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(UART2_RX),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+ /*Modem Interface */

ditto

Quoted 7 lines
board/logicpd/omap3som/omap3logic.c new file +7 -0
+	MUX_VAL(CP(UART1_TX),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(UART1_RTS),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(UART1_CTS),		(IEN  | PTU | DIS | M0));
+	MUX_VAL(CP(UART1_RX),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(MCBSP4_CLKX),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP4_DR),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP4_DX),		(IDIS | PTD | EN  | M7)); /*safe mode*/

board/logicpd/omap3som/omap3logic.c line 423

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c new file +10 -0
+	MUX_VAL(CP(MCBSP4_FSX),		(IDIS | PTD | EN  | M7)); /*safe mode*/
+
+	MUX_VAL(CP(MCBSP1_CLKR),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP1_FSR),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP1_DX),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP1_DR),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP_CLKS),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP1_FSX),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP1_CLKX),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+ /*Serial Interface*/

ditto

[...]

Quoted 1 line

+ /*Control and debug */

ditto

[...]

Quoted 1 line

+ /*Die to Die */

ditto

[...]

Quoted 1 line

+}

I think this function is *much better* than the mux config done .h file. Good job!

Signature · 2 lines
Regards,
Igor.
#4 lore raw

PATCH v2 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

In reply to Peter Barada

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

Cc Tom Rini <[email protected]>
Cc Igor Grinberg <[email protected]>

---
Changes for V2:
Rework logic_identify() into identify_board() - can't use checkboard()
since its enabled by CONFIG_DISPLAY_BOARDINFO
Properly indent comments in set_muxconf_regs()
Move setup_net_chip() call from misc_init_r to board_eth_init() Remove triple empty line spacing
Pass gpio_request(189) non-empty description
Remove board/logicpd/omap3som/config.mk
Remove clean/distclean from board/logicpd/omap3som/Makefile Modify board_mmc_init() to be one line function
Modify include/configs/omap3_logic.h to use on/off #defines

 board/logicpd/omap3som/Makefile     |   42 +++
 board/logicpd/omap3som/omap3logic.c |  582 +++++++++++++++++++++++++++++++++++
 board/logicpd/omap3som/omap3logic.h |   35 ++
 boards.cfg                          |    1 +
 include/configs/omap3_logic.h       |  359 +++++++++++++++++++++
 5 files changed, 1019 insertions(+), 0 deletions(-)
 create mode 100644 board/logicpd/omap3som/Makefile
 create mode 100644 board/logicpd/omap3som/omap3logic.c
 create mode 100644 board/logicpd/omap3som/omap3logic.h
 create mode 100644 include/configs/omap3_logic.h
board/logicpd/omap3som/Makefile new file +42 -0
new file mode 100644
index 0000000..75e237b
@@ -0,0 +1,42 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS-y	:= omap3logic.o
+
+COBJS	:= $(sort $(COBJS-y))
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
board/logicpd/omap3som/omap3logic.c new file +582 -0

582 lines not on this page · raw message

board/logicpd/omap3som/omap3logic.h new file +35 -0
new file mode 100644
index 0000000..5b2ca66
@@ -0,0 +1,35 @@
+/*
+ * (C) Copyright 2011
+ * Logic Product Development <www.logicpd.com>
+ *
+ * Author:
+ * Peter Barada <[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 _OMAP3LOGIC_H_
+#define _OMAP3LOGIC_H_
+
+const omap3_sysinfo sysinfo = {
+	DDR_DISCRETE,
+	"Logic DM37x/OMAP35x reference board",
+	"NAND",
+};
+
+#endif
boards.cfg +1 -0
index 1e5b3e0..f07ae28 100644
@@ -202,6 +202,7 @@ igep0030                     arm         armv7       igep0030            isee
 am3517_evm                   arm         armv7       am3517evm           logicpd        omap3
 omap3_zoom1                  arm         armv7       zoom1               logicpd        omap3
 omap3_zoom2                  arm         armv7       zoom2               logicpd        omap3
+omap3_logic                  arm         armv7       omap3som            logicpd        omap3
 omap3_mvblx                  arm         armv7       mvblx               matrix_vision  omap3
 am3517_crane                 arm         armv7       am3517crane         ti             omap3
 omap3_beagle                 arm         armv7       beagle              ti             omap3
include/configs/omap3_logic.h new file +359 -0

359 lines not on this page · raw message

Signature · 1 line
1.7.1
#5 lore raw

PATCH v2 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

Quoted 3 lines · Peter Barada

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

#if 0'd code isn't allowed for merging so I assume this is an RFC :)

Quoted 3 lines

+ ? ? ? ? ? ? ? /* Let it soak for a bit */
+ ? ? ? ? ? ? ? for (i = 0; i < 0x100; ++i)
+ ? ? ? ? ? ? ? ? ? ? ? asm("nop");

Can we just use a sdelay(...) here? And in the whole function you haven't addressed Igor's comment (unless it's incoming and I just haven't gotten the email yet) about this just being checkboard().

Quoted 26 lines
(quoted diff) +26 -0
+/* GPMC CS1 settings for Logic SOM LV/Torpedo LAN92xx Ethernet chip */
+#define LOGIC_NET_GPMC_CONFIG1 ?0x00001000
+#define LOGIC_NET_GPMC_CONFIG2 ?0x00080801
+#define LOGIC_NET_GPMC_CONFIG3 ?0x00000000
+#define LOGIC_NET_GPMC_CONFIG4 ?0x08010801
+#define LOGIC_NET_GPMC_CONFIG5 ?0x00080a0a
+#define LOGIC_NET_GPMC_CONFIG6 ?0x03000280
+#define LOGIC_NET_GPMC_CONFIG7 ?0x00000848
+
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ * ? ? ? ? ? ? Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+ ? ? ? struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+ ? ? ? /* Configure GPMC registers */
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG1, &gpmc_cfg->cs[1].config1);
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG2, &gpmc_cfg->cs[1].config2);
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG3, &gpmc_cfg->cs[1].config3);
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG4, &gpmc_cfg->cs[1].config4);
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG5, &gpmc_cfg->cs[1].config5);
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG6, &gpmc_cfg->cs[1].config6);
+ ? ? ? writel(LOGIC_NET_GPMC_CONFIG7, &gpmc_cfg->cs[1].config7);

Review

Quoted 10 lines
(quoted diff) +10 -0
+
+ ? ? ? /* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+ ? ? ? writew(readw(&ctrl_base->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+ ? ? ? /* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+ ? ? ? writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+ ? ? ? /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+ ? ? ? writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+ ? ? ? ? ? ? ? &ctrl_base->gpmc_nadv_ale);
+
+}

Or this just being an enable_gpmc_cs_config call.

board/logicpd/omap3som/omap3logic.c line 217

Quoted 7 lines
board/logicpd/omap3som/omap3logic.c new file +7 -0
+int misc_init_r(void)
+{
+
+ ? ? ? dieid_num_r();
+
+ ? ? ? return 0;
+}

Extra whitespace. I think checkpatch.pl will catch this so please run your patch through checkpatch.pl, roughly like this:

$ git format-patch -1
$ ./tools/checkpatch.pl 0001-whatever-its-called.patch

[snip]

Quoted 1 line

+#define CONFIG_L2_OFF ? ? ? ? ? ? ? ? ?/* Keep L2 Cache Disabled */

Why do we want to do this?

[snip]

Quoted 1 line

+#define CONFIG_SYS_MAXARGS ? ? ? ? ? ? 64 ? ? ?/* max number of command args */

This is very very large and probably doesn't need to be. This is the number of arguments to the u-boot commands, not to the linux kernel.

Thanks.

Signature · 1 line
Tom
#6 lore raw

PATCH v2 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

Quoted 5 lines · Tom Rini
Quoted 3 lines · Peter Barada

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

#if 0'd code isn't allowed for merging so I assume this is an RFC :)

My bad - sent the wrong patch. I'll update and send again.

Quoted 6 lines

board/logicpd/omap3som/omap3logic.c line 105

Quoted 3 lines
board/logicpd/omap3som/omap3logic.c new file +3 -0
+               /* Let it soak for a bit */
+               for (i = 0; i < 0x100; ++i)
+                       asm("nop");

Can we just use a sdelay(...) here? And in the whole function you haven't addressed Igor's comment (unless it's incoming and I just haven't gotten the email yet) about this just being checkboard().

Done - "sdelay(0x100)" instead of the delay loop.

As for the function, in arch/arm/cpu/armv7/omap3/board.c there's already a checkboard() function that is called early (before relocation) that prints out the banner. I tried to make that a weak alias and override it in my board file, but when its called, gd->bd is not setup so that code aborts when it tries to set gd->bd->bi_arch_number. I then tried storing the value in a global and then set gd->bd->bi_arch_number in board_init(), but between the call to checkboard() and board_init() the BSS section is zeroed. If I stored/load the computed bi_arch_number into a non-zero static value it works, but I feel that is really fragile.

Remember that identify_board() not only prints a banner but also determines one of four machine IDs passed to the linux kernel to identify which of the variants its running on.

Quoted 29 lines
Quoted 29 lines
board/logicpd/omap3som/omap3logic.c new file +29 -0
+/* GPMC CS1 settings for Logic SOM LV/Torpedo LAN92xx Ethernet chip */
+#define LOGIC_NET_GPMC_CONFIG1  0x00001000
+#define LOGIC_NET_GPMC_CONFIG2  0x00080801
+#define LOGIC_NET_GPMC_CONFIG3  0x00000000
+#define LOGIC_NET_GPMC_CONFIG4  0x08010801
+#define LOGIC_NET_GPMC_CONFIG5  0x00080a0a
+#define LOGIC_NET_GPMC_CONFIG6  0x03000280
+#define LOGIC_NET_GPMC_CONFIG7  0x00000848
+
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *             Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+       struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+       /* Configure GPMC registers */
+       writel(LOGIC_NET_GPMC_CONFIG1, &gpmc_cfg->cs[1].config1);
+       writel(LOGIC_NET_GPMC_CONFIG2, &gpmc_cfg->cs[1].config2);
+       writel(LOGIC_NET_GPMC_CONFIG3, &gpmc_cfg->cs[1].config3);
+       writel(LOGIC_NET_GPMC_CONFIG4, &gpmc_cfg->cs[1].config4);
+       writel(LOGIC_NET_GPMC_CONFIG5, &gpmc_cfg->cs[1].config5);
+       writel(LOGIC_NET_GPMC_CONFIG6, &gpmc_cfg->cs[1].config6);
+       writel(LOGIC_NET_GPMC_CONFIG7, &gpmc_cfg->cs[1].config7);
+
+       /* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+       writew(readw(&ctrl_base->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
Quoted 8 lines

board/logicpd/omap3som/omap3logic.c line 181

Quoted 7 lines
board/logicpd/omap3som/omap3logic.c new file +7 -0
+       /* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+       writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+       /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+       writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+               &ctrl_base->gpmc_nadv_ale);
+
+}

Or this just being an enable_gpmc_cs_config call.

Done.

Quoted 11 lines

board/logicpd/omap3som/omap3logic.c line 217

Quoted 7 lines
board/logicpd/omap3som/omap3logic.c new file +7 -0
+int misc_init_r(void)
+{
+
+       dieid_num_r();
+
+       return 0;
+}

Extra whitespace. I think checkpatch.pl will catch this so please run your patch through checkpatch.pl, roughly like this:

$ git format-patch -1
$ ./tools/checkpatch.pl 0001-whatever-its-called.patch

I rand checkpatch.pl over the result of "git diff --cached" and it didn't complain about the emty line after the open brace. I've removed it.

Quoted 3 lines

[snip]

Quoted 1 line

+#define CONFIG_L2_OFF /* Keep L2 Cache Disabled */

Why do we want to do this?

This is a holdover from a previous verison ofu-boot (2010.06) where I added LCD/HDMI support for up to a 720p 32bpp display and when I did that the kernel wouldn't start w/o disabling L2 in u-boot (possibly because the reserved memory for the display in u-boot alone is larger than the L2 cache in a OMAP35x/DM37x), but I never figured out why it failed. I've removed it and will readdress when I add in the LCD/HDMI support.

Quoted 4 lines

[snip]

Quoted 1 line

+#define CONFIG_SYS_MAXARGS 64 /* max number of command args */

This is very very large and probably doesn't need to be. This is the number of arguments to the u-boot commands, not to the linux kernel.

You're right, yet another holdover from an older version of u-boot. I've reduced it 16 to match up with most of the other boards.

So the big question before I submit V3 of this patch is whether to include overriding OMAP3's checkboard() function or to use identify_board() as is to compute bi_arch_number... I can do it either way, but don't want to waste anyone's time (with the wrong method).

Thanks in advance!

Signature · 2 lines
Peter Barada
peter.barada at logicpd.com
#7 lore raw

PATCH v2 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

Quoted 6 lines · Peter Barada
Quoted 5 lines · Tom Rini
Quoted 3 lines · Peter Barada

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

#if 0'd code isn't allowed for merging so I assume this is an RFC :)

Quoted 8 lines

My bad - sent the wrong patch. ?I'll update and send again.

Quoted 6 lines
Quoted 3 lines

+ ? ? ? ? ? ? ? /* Let it soak for a bit */
+ ? ? ? ? ? ? ? for (i = 0; i < 0x100; ++i)
+ ? ? ? ? ? ? ? ? ? ? ? asm("nop");

Can we just use a sdelay(...) here? ?And in the whole function you haven't addressed Igor's comment (unless it's incoming and I just haven't gotten the email yet) about this just being checkboard().

Done - "sdelay(0x100)" instead of the delay loop.

Great, thanks.

Quoted 13 lines

As for the function, in arch/arm/cpu/armv7/omap3/board.c there's already a checkboard() function that is called early (before relocation) that prints out the banner. ?I tried to make that a weak alias and override it in my board file, but when its called, gd->bd is not setup so that code aborts when it tries to set gd->bd->bi_arch_number. ?I then tried storing the value in a global and then set gd->bd->bi_arch_number in board_init(), but between the call to checkboard() and board_init() the BSS section is zeroed. ?If I stored/load the computed bi_arch_number into a non-zero static value it works, but I feel that is really fragile.

Remember that identify_board() not only prints a banner but also determines one of four machine IDs passed to the linux kernel to identify which of the variants its running on.

[snip]

Quoted 4 lines

So the big question before I submit V3 of this patch is whether to include overriding OMAP3's checkboard() function or to use identify_board() as is to compute bi_arch_number... ?I can do it either way, but don't want to waste anyone's time (with the wrong method).

OK, after re-reading (and mentally applying the changes you said you've got) the patches, along with Igor's comments on v1, just inline your identify logic to board_init()

Signature · 1 line
Tom
#8 lore raw

PATCH 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

Cc Tom Rini <[email protected]>
Cc Igor Grinberg <[email protected]>

---

Changes for V3:
Inline identify_board() into board_init()
Remove triple empty lines
Use sdelay() instead of naked delay loop
Use enable_gpmc_cs_config() to setup GPMC CS1 access to LAN92xx Remove CONFIG_L2_OFF - holdover from previous work in u-boot-2011.06
where adding 270p 32bpp frambuffer support cause failure while booting linux kernel. Will address when I add video support
Reduce CONFIG_SYS_MAXARGS to 16

Changes for V2:
Rework logic_identify() into identify_board() - can't use checkboard()
since its enabled by CONFIG_DISPLAY_BOARDINFO
Properly indent comments in set_muxconf_regs()
Move setup_net_chip() call from misc_init_r to board_eth_init() Remove triple empty line spacing
Pass gpio_request(189) non-empty description
Remove board/logicpd/omap3som/config.mk
Remove clean/distclean from board/logicpd/omap3som/Makefile Modify board_mmc_init() to be one line function
Modify include/configs/omap3_logic.h to use on/off #defines

 board/logicpd/omap3som/Makefile     |   42 +++
 board/logicpd/omap3som/omap3logic.c |  523 +++++++++++++++++++++++++++++++++++
 board/logicpd/omap3som/omap3logic.h |   35 +++
 boards.cfg                          |    1 +
 include/configs/omap3_logic.h       |  351 +++++++++++++++++++++++
 5 files changed, 952 insertions(+), 0 deletions(-)
 create mode 100644 board/logicpd/omap3som/Makefile
 create mode 100644 board/logicpd/omap3som/omap3logic.c
 create mode 100644 board/logicpd/omap3som/omap3logic.h
 create mode 100644 include/configs/omap3_logic.h
board/logicpd/omap3som/Makefile new file +42 -0
new file mode 100644
index 0000000..75e237b
@@ -0,0 +1,42 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS-y	:= omap3logic.o
+
+COBJS	:= $(sort $(COBJS-y))
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
board/logicpd/omap3som/omap3logic.c new file +523 -0

523 lines not on this page · raw message

board/logicpd/omap3som/omap3logic.h new file +35 -0
new file mode 100644
index 0000000..5b2ca66
@@ -0,0 +1,35 @@
+/*
+ * (C) Copyright 2011
+ * Logic Product Development <www.logicpd.com>
+ *
+ * Author:
+ * Peter Barada <[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 _OMAP3LOGIC_H_
+#define _OMAP3LOGIC_H_
+
+const omap3_sysinfo sysinfo = {
+	DDR_DISCRETE,
+	"Logic DM37x/OMAP35x reference board",
+	"NAND",
+};
+
+#endif
boards.cfg +1 -0
index 1e5b3e0..f07ae28 100644
@@ -202,6 +202,7 @@ igep0030                     arm         armv7       igep0030            isee
 am3517_evm                   arm         armv7       am3517evm           logicpd        omap3
 omap3_zoom1                  arm         armv7       zoom1               logicpd        omap3
 omap3_zoom2                  arm         armv7       zoom2               logicpd        omap3
+omap3_logic                  arm         armv7       omap3som            logicpd        omap3
 omap3_mvblx                  arm         armv7       mvblx               matrix_vision  omap3
 am3517_crane                 arm         armv7       am3517crane         ti             omap3
 omap3_beagle                 arm         armv7       beagle              ti             omap3
include/configs/omap3_logic.h new file +351 -0

351 lines not on this page · raw message

Signature · 1 line
1.5.6.5
#9 lore raw

PATCH 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

Quoted 3 lines · Peter Barada

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

[snip]

My apologies, I forgot to change the subject to [PATCH V3], but as the commentary indicates, it is V3. I'm still getting used to git send-email...

Signature · 2 lines
Peter Barada
peter.barada at logicpd.com
#10 lore raw

PATCH 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

In reply to Peter Barada
Quoted 7 lines · Peter Barada

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

Cc Tom Rini <[email protected]>
Cc Igor Grinberg <[email protected]>

[snip]

Review

Quoted 10 lines
(quoted diff) +10 -0
+#ifdef CONFIG_SMC911X
+/* GPMC CS1 settings for Logic SOM LV/Torpedo LAN92xx Ethernet chip */
+static const u32 gpmc_lan92xx_config[] = {
+ ? ? ? 0x00001000,
+ ? ? ? 0x00080801,
+ ? ? ? 0x00000000,
+ ? ? ? 0x08010801,
+ ? ? ? 0x00080a0a,
+ ? ? ? 0x03000280,
+};

The correct form here is #define NET_LAN92XX_GPMC_CONFIGn 0x... in board.h and then ref them here.

And feel free to wait a little before spinning v4 incase others have comments. Assuming it's just this (or some other trivial comments) that change in v4 I'll put that v4 into u-boot-ti/next early next week. Thanks for turning around on the feedback quickly!

Signature · 1 line
Tom
#11 lore raw

PATCH 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

In reply to Peter Barada

Dear Peter Barada,

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

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

Cc Tom Rini <[email protected]>
Cc Igor Grinberg <[email protected]>

...

Quoted 10 lines
 board/logicpd/omap3som/Makefile     |   42 +++
 board/logicpd/omap3som/omap3logic.c |  523 +++++++++++++++++++++++++++++++++++
 board/logicpd/omap3som/omap3logic.h |   35 +++
 boards.cfg                          |    1 +
 include/configs/omap3_logic.h       |  351 +++++++++++++++++++++++
 5 files changed, 952 insertions(+), 0 deletions(-)
 create mode 100644 board/logicpd/omap3som/Makefile
 create mode 100644 board/logicpd/omap3som/omap3logic.c
 create mode 100644 board/logicpd/omap3som/omap3logic.h
 create mode 100644 include/configs/omap3_logic.h

Entry to MAINTAINERS missing.

Quoted 3 lines

+/* two dimensional array of strucures containining board name and Linux
+ * machine IDs; row it selected based on CPU column is slected based
+ * on hsusb0_data5 pin having a pulldown resistor */

Incorrect multiline comment style. Please fix globally.

board/logicpd/omap3som/omap3logic.c line 158

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c new file +10 -0
+#ifdef CONFIG_SMC911X
+/* GPMC CS1 settings for Logic SOM LV/Torpedo LAN92xx Ethernet chip */
+static const u32 gpmc_lan92xx_config[] = {
+	0x00001000,
+	0x00080801,
+	0x00000000,
+	0x08010801,
+	0x00080a0a,
+	0x03000280,
+};

And what exactly is the meaning of these magic numbers?

include/configs/omap3_logic.h line 142

Quoted 7 lines
include/configs/omap3_logic.h new file +7 -0
+#define CONFIG_HARD_I2C			1
+#define CONFIG_SYS_I2C_SPEED		100000
+#define CONFIG_SYS_I2C_SLAVE		1
+#define CONFIG_SYS_I2C_BUS		0
+#define CONFIG_SYS_I2C_BUS_SELECT	1
+#define CONFIG_I2C_MULTI_BUS		1
+#define CONFIG_DRIVER_OMAP34XX_I2C	1

Please do not define values for macros that only switch on a feature.

...

Quoted 8 lines
include/configs/omap3_logic.h new file +8 -0
+#define CONFIG_PREBOOT \
+	"echo ======================NOTICE============================;"\
+	"echo The u-boot environment is not set. - You are;"            \
+	"echo required to set a valid display for your LCD panel.;"	\
+	"echo Valid display options are:;"				\
+	"echo \"  2 == LQ121S1DG31     TFT SVGA    (12.1)  Sharp\";"	\
+	"echo \"  3 == LQ036Q1DA01     TFT QVGA    (3.6)   Sharp w/ASIC\";" \
+	"echo \"  5 == LQ064D343       TFT VGA     (6.4)   Sharp\";"	\

include/configs/omap3_logic.h line 190

Quoted 10 lines
include/configs/omap3_logic.h new file +10 -0
+	"echo \"  7 == LQ10D368        TFT VGA     (10.4)  Sharp\";"	\
+	"echo \" 15 == LQ043T1DG01     TFT WQVGA   (4.3)   Sharp (DEFAULT)\";" \
+	"echo \" vga[-16 OR -24]       LCD VGA     640x480\";"          \
+	"echo \" svga[-16 OR -24]      LCD SVGA    800x600\";"          \
+	"echo \" xga[-16 OR -24]       LCD XGA     1024x768\";"         \
+	"echo \" 720p[-16 OR -24]      LCD 720P    1280x720\";"         \
+	"echo \" sxga[-16 OR -24]      LCD SXGA    1280x1024\";"        \
+	"echo \" uxga[-16 OR -24]      LCD UXGA    1600x1200\";"        \
+	"echo MAKE SURE YOUR DISPLAY VARIABLE IS CORRECTLY ENTERED!;"	\
+	"setenv display 15;"						\

Strange. First you ask the user to set a valid display type, and then you hard-set it to some predefined value. What's the reationale behind that?

include/configs/omap3_logic.h line 192

Quoted 2 lines
include/configs/omap3_logic.h new file +2 -0
+	"setenv preboot;"						\
+	"saveenv;"

Would it not be better to erase the preboot setting only after some display type definition was entered and saved _by_the_user_ ?

Quoted 3 lines

+/*-----------------------------------------------------------------------
+ * Physical Memory Map
+ */

Incorrect multiline comment style. Please fix globally.

Best regards,

Wolfgang Denk

Signature · 6 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
If all the Chinese simultaneously jumped into the Pacific  off  a  10
foot platform erected 10 feet off their coast, it would cause a tidal
wave that would destroy everything in this country west of Nebraska.
#12 lore raw

PATCH 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

In reply to Peter Barada

Hi Peter,

Some comments (hopefully last ones) in addition to Wolfgang's and Tom's:

Quoted 41 lines · Peter Barada

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

Cc Tom Rini <[email protected]>
Cc Igor Grinberg <[email protected]>

---

Changes for V3:
Inline identify_board() into board_init()
Remove triple empty lines
Use sdelay() instead of naked delay loop
Use enable_gpmc_cs_config() to setup GPMC CS1 access to LAN92xx Remove CONFIG_L2_OFF - holdover from previous work in u-boot-2011.06
where adding 270p 32bpp frambuffer support cause failure while booting linux kernel. Will address when I add video support
Reduce CONFIG_SYS_MAXARGS to 16

Changes for V2:
Rework logic_identify() into identify_board() - can't use checkboard()
since its enabled by CONFIG_DISPLAY_BOARDINFO
Properly indent comments in set_muxconf_regs()
Move setup_net_chip() call from misc_init_r to board_eth_init() Remove triple empty line spacing
Pass gpio_request(189) non-empty description
Remove board/logicpd/omap3som/config.mk
Remove clean/distclean from board/logicpd/omap3som/Makefile Modify board_mmc_init() to be one line function
Modify include/configs/omap3_logic.h to use on/off #defines

 board/logicpd/omap3som/Makefile     |   42 +++
 board/logicpd/omap3som/omap3logic.c |  523 +++++++++++++++++++++++++++++++++++
 board/logicpd/omap3som/omap3logic.h |   35 +++
 boards.cfg                          |    1 +
 include/configs/omap3_logic.h       |  351 +++++++++++++++++++++++
 5 files changed, 952 insertions(+), 0 deletions(-)
 create mode 100644 board/logicpd/omap3som/Makefile
 create mode 100644 board/logicpd/omap3som/omap3logic.c
 create mode 100644 board/logicpd/omap3som/omap3logic.h
 create mode 100644 include/configs/omap3_logic.h

[...]

Quoted 5 lines
board/logicpd/omap3som/omap3logic.c new file +0 -0
new file mode 100644
index 0000000..eb051db

[...]

Quoted 15 lines
board/logicpd/omap3som/omap3logic.c new file +15 -0
+/*
+ * Routine: board_init
+ * Description: Early hardware init.
+ */
+int board_init(void)
+{
+	struct board_id *board;
+	unsigned int val;
+
+	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
+
+	/* boot param addr */
+	gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
+
+	/*

board/logicpd/omap3som/omap3logic.c line 102

Quoted 10 lines
board/logicpd/omap3som/omap3logic.c new file +10 -0
+	 * To identify between a SOM LV and Torpedo module,
+	 * a pulldown resistor is on hsusb0_data5 for the SOM LV module.
+	 * Drive the pin (and let it soak), then read it back.
+	 * If the pin is still high its a Torpedo.  If low its a SOM LV
+	 */
+
+	/* Mux hsusb0_data5 as a GPIO */
+	MUX_VAL(CP(HSUSB0_DATA5),	(IEN  | PTD | DIS | M4));
+
+	if (gpio_request(GPIO_189, "husb0_data5.gpio_189") == 0) {

Usually, by the label goes the functionality it is used for in current request, but af course it is up to you, it is not a blocker as long as the label is valid.

board/logicpd/omap3som/omap3logic.c line 105

Quoted 3 lines
board/logicpd/omap3som/omap3logic.c new file +3 -0
+
+		/* Drive GPIO_189 - the pulldown resistor on the SOM LV
+		 * will drain the voltage */

incorrect multi-line comment (fix globally) and probably, the empty line before it can be removed.

Quoted 24 lines
board/logicpd/omap3som/omap3logic.c new file +24 -0
+		gpio_direction_output(GPIO_189, 0);
+		gpio_set_value(GPIO_189, 1);
+
+		/* Let it soak for a bit */
+		sdelay(0x100);
+
+		/* Read state of GPIO_189 as an input and if its set.
+		 * If so the board is a Torpedo */
+		gpio_direction_input(GPIO_189);
+		val = gpio_get_value(GPIO_189);
+		gpio_free(GPIO_189);
+
+		board = &boards[!!(get_cpu_family() == CPU_OMAP36XX)][!!val];
+		printf("Board: %s\n", board->name);
+
+		/* Set the machine_id passed to Linux */
+		gd->bd->bi_arch_number = board->machine_id;
+	}
+
+	/* restore hsusb0_data5 pin as hsusb0_data5 */
+	MUX_VAL(CP(HSUSB0_DATA5),	(IEN  | PTD | DIS | M0));
+
+	return 0;
+}

[...]

Quoted 3 lines

+/*
+ * Routine: misc_init_r
+ * Description: Init ethernet (done here so udelay works)

Function changed, comment left...

Quoted 7 lines

+ */

board/logicpd/omap3som/omap3logic.c new file +6 -0
+int misc_init_r(void)
+{
+	dieid_num_r();
+
+	return 0;
+}

[...]

Signature · 2 lines
Regards,
Igor.
#13 lore raw

PATCH v4 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

Cc Tom Rini <[email protected]>
Cc Igor Grinberg <[email protected]>
Cc Wolfgang Denk <[email protected]>

---
Changes for V4:
Use #defines for LAN92XX GPMC register settings
Add myself to MAINTAINERS
Fix multiline comments
Remove switch values in on/off macro definitions
Modify CONFIG_PREBOOT to make it clear the 4.3" display is the default Rework name of GPIO_189 to better describe what its used for Fix misc_init_r comment

Changes for V3:
Inline identify_board() into board_init()
Remove triple empty lines
Use sdelay() instead of naked delay loop
Use enable_gpmc_cs_config() to setup GPMC CS1 access to LAN92xx Remove CONFIG_L2_OFF - holdover from previous work in u-boot-2011.06
where adding 270p 32bpp frambuffer support cause failure while booting linux kernel. Will address when I add video support
Reduce CONFIG_SYS_MAXARGS to 16

Changes for V2:
Rework logic_identify() into identify_board() - can't use checkboard()
since its enabled but CONFIG_DISPLAY_BOARDINFO.
Properly indent comments in set_muxconf_regs()
Move setup_net_chip() call from misc_init_r to board_eth_init() Remove triple empty line spacing
Pass gpio_request(189) non-empty description
Remove board/logicpd/omap3som/config.mk
Remove clean/distclean from board/logicpd/omap3som/Makefile Modify board_mmc_init() to be one line function
Modify include/configs/omap3_logic.h to use on/off #defines

 MAINTAINERS                         |    4 +
 board/logicpd/omap3som/Makefile     |   42 +++
 board/logicpd/omap3som/omap3logic.c |  532 +++++++++++++++++++++++++++++++++++
 board/logicpd/omap3som/omap3logic.h |   47 +++
 boards.cfg                          |    1 +
 include/configs/omap3_logic.h       |  358 +++++++++++++++++++++++
 6 files changed, 984 insertions(+), 0 deletions(-)
 create mode 100644 board/logicpd/omap3som/Makefile
 create mode 100644 board/logicpd/omap3som/omap3logic.c
 create mode 100644 board/logicpd/omap3som/omap3logic.h
 create mode 100644 include/configs/omap3_logic.h
MAINTAINERS +4 -0
index a56ca10..c37bf11 100644
@@ -41,6 +41,10 @@ Reinhard Arlt <[email protected]>
 
 	CPCI750		PPC750FX/GX
 
+Peter Barada <[email protected]>
+
+	omap3_logic	ARM ARMV7 (Logic OMAP35xx/DM37xx)
+
 Yuli Barcohen <[email protected]>
 
 	Adder		MPC87x/MPC852T
board/logicpd/omap3som/Makefile new file +42 -0

42 lines not on this page · raw message

board/logicpd/omap3som/omap3logic.c new file +532 -0

532 lines not on this page · raw message

board/logicpd/omap3som/omap3logic.h new file +47 -0

47 lines not on this page · raw message

boards.cfg +1 -0
index 1e5b3e0..f07ae28 100644
@@ -202,6 +202,7 @@ igep0030                     arm         armv7       igep0030            isee
 am3517_evm                   arm         armv7       am3517evm           logicpd        omap3
 omap3_zoom1                  arm         armv7       zoom1               logicpd        omap3
 omap3_zoom2                  arm         armv7       zoom2               logicpd        omap3
+omap3_logic                  arm         armv7       omap3som            logicpd        omap3
 omap3_mvblx                  arm         armv7       mvblx               matrix_vision  omap3
 am3517_crane                 arm         armv7       am3517crane         ti             omap3
 omap3_beagle                 arm         armv7       beagle              ti             omap3
include/configs/omap3_logic.h new file +358 -0

358 lines not on this page · raw message

Signature · 1 line
1.7.1
#14 lore raw

PATCH v4 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

Hi Peter,

Thanks for fixing all the issues pointed.
I have one last question (sorry for not seeing it earlier) and one neat below.

Quoted 9 lines · Peter Barada

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

Cc Tom Rini <[email protected]>
Cc Igor Grinberg <[email protected]>
Cc Wolfgang Denk <[email protected]>

---

[...]

Quoted 5 lines
board/logicpd/omap3som/omap3logic.c new file +0 -0
new file mode 100644
index 0000000..3a5d3d5

[...]

Quoted 8 lines
board/logicpd/omap3som/omap3logic.c new file +8 -0
+/*
+ * Routine: set_muxconf_regs
+ * Description: Setting up the configuration Mux registers specific to the
+ *		hardware. Many pins need to be moved from protect to primary
+ *		mode.
+ */
+void set_muxconf_regs(void)
+{

[...]

Quoted 1 line
board/logicpd/omap3som/omap3logic.c new file +1 -0
+	MUX_VAL(CP(GPMC_NCS6),		(IEN  | PTU | EN  | M7)); /*safe mode */

[...]

Quoted 61 lines
board/logicpd/omap3som/omap3logic.c new file +61 -0
+	MUX_VAL(CP(GPMC_WAIT2),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(GPMC_WAIT3),		(IEN  | PTU | EN  | M7)); /*safe mode */
+	/*DSS*/
+	MUX_VAL(CP(DSS_PCLK),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_HSYNC),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_VSYNC),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_ACBIAS),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA0),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA1),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA2),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA3),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA4),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA5),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA6),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA7),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA8),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA9),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA10),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA11),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA12),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA13),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA14),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA15),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA16),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA17),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA18),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA19),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA20),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA21),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA22),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(DSS_DATA23),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	/*CAMERA*/
+	MUX_VAL(CP(CAM_HS),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_VS),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_XCLKA),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_PCLK),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_FLD),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_D0),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_D1),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_D2),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_D3),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_D4),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_D5),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_D6),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_D7),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_D8),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_D9),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_D10),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_D11),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_XCLKB),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_WEN),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CAM_STROBE),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CSI2_DX0),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CSI2_DY0),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CSI2_DX1),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(CSI2_DY1),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	/*Audio Interface */
+	MUX_VAL(CP(MCBSP2_FSX),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(MCBSP2_CLKX),	(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(MCBSP2_DR),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(MCBSP2_DX),		(IEN  | PTD | EN  | M7)); /*safe mode */

[...]

Quoted 24 lines
board/logicpd/omap3som/omap3logic.c new file +24 -0
+	MUX_VAL(CP(MMC1_DAT4),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC1_DAT5),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC1_DAT6),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC1_DAT7),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	/*Wireless LAN */
+	MUX_VAL(CP(MMC2_CLK),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_CMD),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT0),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT1),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT2),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT3),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT4),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT5),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT6),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MMC2_DAT7),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	/*Bluetooth*/
+	MUX_VAL(CP(MCBSP3_DX),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP3_DR),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP3_CLKX),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP3_FSX),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(UART2_CTS),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(UART2_RTS),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(UART2_TX),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(UART2_RX),		(IEN  | PTD | EN  | M7)); /*safe mode*/

[...]

Quoted 29 lines
board/logicpd/omap3som/omap3logic.c new file +29 -0
+	MUX_VAL(CP(MCBSP4_CLKX),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP4_DR),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP4_DX),		(IDIS | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP4_FSX),		(IDIS | PTD | EN  | M7)); /*safe mode*/
+
+	MUX_VAL(CP(MCBSP1_CLKR),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP1_FSR),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP1_DX),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP1_DR),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP_CLKS),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP1_FSX),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCBSP1_CLKX),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	/*Serial Interface*/
+	MUX_VAL(CP(UART3_CTS_RCTX),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(UART3_RTS_SD),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(UART3_RX_IRRX),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(UART3_TX_IRTX),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(HSUSB0_CLK),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(HSUSB0_STP),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(HSUSB0_DIR),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(HSUSB0_NXT),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(HSUSB0_DATA0),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(HSUSB0_DATA1),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(HSUSB0_DATA2),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(HSUSB0_DATA3),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(HSUSB0_DATA4),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(HSUSB0_DATA5),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(HSUSB0_DATA6),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(HSUSB0_DATA7),	(IEN  | PTD | EN  | M7)); /*safe mode*/

[...]

Quoted 12 lines
board/logicpd/omap3som/omap3logic.c new file +12 -0
+	MUX_VAL(CP(MCSPI1_CLK),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCSPI1_SIMO),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCSPI1_SOMI),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCSPI1_CS0),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCSPI1_CS1),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCSPI1_CS2),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCSPI1_CS3),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCSPI2_CLK),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCSPI2_SIMO),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCSPI2_SOMI),	(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCSPI2_CS0),		(IEN  | PTD | EN  | M7)); /*safe mode*/
+	MUX_VAL(CP(MCSPI2_CS1),		(IEN  | PTD | EN  | M7)); /*safe mode*/

[...]

Quoted 7 lines
board/logicpd/omap3som/omap3logic.c new file +7 -0
+	MUX_VAL(CP(SYS_BOOT0),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(SYS_BOOT1),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(SYS_BOOT2),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(SYS_BOOT3),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(SYS_BOOT4),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(SYS_BOOT5),		(IEN  | PTD | EN  | M7)); /*safe mode */
+	MUX_VAL(CP(SYS_BOOT6),		(IEN  | PTD | EN  | M7)); /*safe mode */

[...]

board/logicpd/omap3som/omap3logic.c line 531

Quoted 1 line
board/logicpd/omap3som/omap3logic.c new file +1 -0
+	MUX_VAL(CP(SDRC_CKE1),		(IDIS | PTD | DIS | M7)); /*safe mode*/

The TRM says that the initial state of pins is the safe mode (M7). Also not every pin has this state by definition.
So the question is, wouldn't it be better to remove those lines that setup the safe mode, or is there a purpose, which I don't see? Removing those lines will make the file/patch much shorter.

[...]

Quoted 5 lines
include/configs/omap3_logic.h new file +0 -0
new file mode 100644
index 0000000..1a30f63

[...]

include/configs/omap3_logic.h line 105

Quoted 2 lines
include/configs/omap3_logic.h new file +2 -0
+/* DDR - I use Micron DDR */
+#define CONFIG_OMAP3_MICRON_DDR

You forgot to remove that one - it is not used anymore...

[...]

Signature · 2 lines
Regards,
Igor.
#15 lore raw

PATCH v4 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

Quoted 15 lines · Igor Grinberg

Hi Peter,

Thanks for fixing all the issues pointed.
I have one last question (sorry for not seeing it earlier) and one neat below.

Quoted 9 lines · Peter Barada

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

Cc Tom Rini <[email protected]>
Cc Igor Grinberg <[email protected]>
Cc Wolfgang Denk <[email protected]>

---

[ ... ]

Quoted 7 lines

The TRM says that the initial state of pins is the safe mode (M7). Also not every pin has this state by definition.
So the question is, wouldn't it be better to remove those lines that setup the safe mode, or is there a purpose, which I don't see? Removing those lines will make the file/patch much shorter.

Back when we first started with u-boot on these boards, it was loaded from another bootloader that did its own pinmux setup and this was how I put all the pins back to a known state. Moving to SPL/u-boot will preclude having to tweak all the pins.

I'll trim the pinmux setup back to only those pins that are different than their reset values (or those that need PTD/EN pulldowns to minimise power consumption when the kernel goes into suspend).

Quoted 3 lines

include/configs/omap3_logic.h line 105

Quoted 2 lines
include/configs/omap3_logic.h new file +2 -0
+/* DDR - I use Micron DDR */
+#define CONFIG_OMAP3_MICRON_DDR

You forgot to remove that one - it is not used anymore...

Done...

Quoted 5 lines

[...]

--
Regards,
Igor.

Signature · 2 lines
Peter Barada
peter.barada at logicpd.com
#16 lore raw

PATCH v5 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

In reply to Igor Grinberg

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

Cc Tom Rini <[email protected]>
Cc Igor Grinberg <[email protected]>
Cc Wolfgang Denk <[email protected]>

---
Changes for V5:
Remove CONFIG_OMAP3_MICRON_DDR - not used anymore
Trim set_muxconf_regs() to only those different from reset values Add 'ramboot' environment commands to load kernel/root-ramdisk via tftp

Changes for V4:
Use #defines for LAN92XX GPMC register settings
Add myself to MAINTAINERS
Fix multiline comments
Remove switch values in on/off macro definitions
Modify CONFIG_PREBOOT to make it clear the 4.3" display is the default Rework name of GPIO_189 to better describe what its used for Fix misc_init_r comment

Changes for V3:
Inline identify_board() into board_init()
Remove triple empty lines
Use sdelay() instead of naked delay loop
Use enable_gpmc_cs_config() to setup GPMC CS1 access to LAN92xx Remove CONFIG_L2_OFF - holdover from previous work in u-boot-2011.06
where adding 270p 32bpp frambuffer support cause failure while booting linux kernel. Will address when I add video support
Reduce CONFIG_SYS_MAXARGS to 16

Changes for V2:
Rework logic_identify() into identify_board() - can't use checkboard()
since its enabled but CONFIG_DISPLAY_BOARDINFO.
Properly indent comments in set_muxconf_regs()
Move setup_net_chip() call from misc_init_r to board_eth_init() Remove triple empty line spacing
Pass gpio_request(189) non-empty description
Remove board/logicpd/omap3som/config.mk
Remove clean/distclean from board/logicpd/omap3som/Makefile Modify board_mmc_init() to be one line function
Modify include/configs/omap3_logic.h to use on/off #defines

 MAINTAINERS                         |    4 +
 board/logicpd/omap3som/Makefile     |   42 ++++
 board/logicpd/omap3som/omap3logic.c |  247 ++++++++++++++++++++++++
 board/logicpd/omap3som/omap3logic.h |   47 +++++
 boards.cfg                          |    1 +
 include/configs/omap3_logic.h       |  362 +++++++++++++++++++++++++++++++++++
 6 files changed, 703 insertions(+), 0 deletions(-)
 create mode 100644 board/logicpd/omap3som/Makefile
 create mode 100644 board/logicpd/omap3som/omap3logic.c
 create mode 100644 board/logicpd/omap3som/omap3logic.h
 create mode 100644 include/configs/omap3_logic.h
MAINTAINERS +4 -0
index a56ca10..c37bf11 100644
@@ -41,6 +41,10 @@ Reinhard Arlt <[email protected]>
 
 	CPCI750		PPC750FX/GX
 
+Peter Barada <[email protected]>
+
+	omap3_logic	ARM ARMV7 (Logic OMAP35xx/DM37xx)
+
 Yuli Barcohen <[email protected]>
 
 	Adder		MPC87x/MPC852T
board/logicpd/omap3som/Makefile new file +42 -0

42 lines not on this page · raw message

board/logicpd/omap3som/omap3logic.c new file +247 -0

247 lines not on this page · raw message

board/logicpd/omap3som/omap3logic.h new file +47 -0

47 lines not on this page · raw message

boards.cfg +1 -0
index 1e5b3e0..f07ae28 100644
@@ -202,6 +202,7 @@ igep0030                     arm         armv7       igep0030            isee
 am3517_evm                   arm         armv7       am3517evm           logicpd        omap3
 omap3_zoom1                  arm         armv7       zoom1               logicpd        omap3
 omap3_zoom2                  arm         armv7       zoom2               logicpd        omap3
+omap3_logic                  arm         armv7       omap3som            logicpd        omap3
 omap3_mvblx                  arm         armv7       mvblx               matrix_vision  omap3
 am3517_crane                 arm         armv7       am3517crane         ti             omap3
 omap3_beagle                 arm         armv7       beagle              ti             omap3
include/configs/omap3_logic.h new file +362 -0

362 lines not on this page · raw message

Signature · 1 line
1.5.6.5
#17 lore raw

PATCH v5 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

Quoted 8 lines · Peter Barada

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

Cc Tom Rini <[email protected]>
Cc Igor Grinberg <[email protected]>
Cc Wolfgang Denk <[email protected]>
Signature · 2 lines
Regards,
Igor.
#18 lore raw

PATCH v5 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

Quoted 11 lines · Igor Grinberg
Quoted 8 lines · Peter Barada

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

Cc Tom Rini <[email protected]>
Cc Igor Grinberg <[email protected]>
Cc Wolfgang Denk <[email protected]>

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

Signature · 1 line
Tom
#19 lore raw

PATCH v2 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

In reply to Peter Barada

Hi Peter,

Quoted 5 lines · Peter Barada
Quoted 4 lines · Tom Rini
Quoted 3 lines · Peter Barada

This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.

[...]

Quoted 9 lines

As for the function, in arch/arm/cpu/armv7/omap3/board.c there's already a checkboard() function that is called early (before relocation) that prints out the banner. I tried to make that a weak alias and override it in my board file, but when its called, gd->bd is not setup so that code aborts when it tries to set gd->bd->bi_arch_number. I then tried storing the value in a global and then set gd->bd->bi_arch_number in board_init(), but between the call to checkboard() and board_init() the BSS section is zeroed. If I stored/load the computed bi_arch_number into a non-zero static value it works, but I feel that is really fragile.

This make me wonder, should we move the checkboard() call further in the init sequence?
Because, IIRC, it stayed in the same place, where it was, before the relocation feature was introduced and board_init() was called before the checkboard() (as board_init_f() does now). Also, the struct bd_info (bd_t) should have the board data and ironically it is not available in checkboard() function.

So, Albert, Wolfgang,
the question is, should we move the checkboard() call after the gd->bd pointer initialization or are there any cases where it is not appropriate?

Signature · 2 lines
Regards,
Igor.
#20 lore raw

PATCH v2 1/1 ARMV7: Add support For Logic OMAP35x/DM37x modules

Dear Igor Grinberg,

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

As for the function, in arch/arm/cpu/armv7/omap3/board.c there's already a checkboard() function that is called early (before relocation) that

And keep in mind: before relocation means that the BSS segment is not available, and data segment is read-only. [You may be lucky on some systems that things appear to be different, but this is nothing you should take granted, and it is definitely nothing that should be used for common code.]

Quoted 5 lines
Quoted 5 lines

code aborts when it tries to set gd->bd->bi_arch_number. I then tried storing the value in a global and then set gd->bd->bi_arch_number in board_init(), but between the call to checkboard() and board_init() the BSS section is zeroed. If I stored/load the computed bi_arch_number into a non-zero static value it works, but I feel that is really fragile.

It is not only fragile, but broken. See above: the data ssegment must not be written before relocation.

Quoted 2 lines

This make me wonder, should we move the checkboard() call further in the init sequence?

No, it should not. It is part of the very early init code, and should remain where it is. Just don't add any code that does not belong there.

Quoted 2 lines

Also, the struct bd_info (bd_t) should have the board data and ironically it is not available in checkboard() function.

I don't see what is ironically about thaat. bd_info does not exist at that point of time. You misinterpret the purpose of the checkboard() function, it seems.

Quoted 4 lines

So, Albert, Wolfgang,
the question is, should we move the checkboard() call after the gd->bd pointer initialization or are there any cases where it is not appropriate?

Please leave as is, it is perfectly intentional. Just don't place any code in checkboard() which does not fit there.

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
A stone was placed at a ford in a river with the inscription:
"When this stone is covered it is dangerous to ford here."