[Patch 1/3] for to add OMAP3 EVM support to Sakoman's u-boot Tree

This patch adds OMAP3 EVM support to u-boot.

- This patch adds board related support taking Beagle port as a reference.
- Clocking and Pin Muxing is similar to Beagle
- UART support is changed to UART1
- NAND boot is changed to ONENAND
- Prompt is changed for the board to OAMP3_EVM

Files changed with this patch :
Makefile | 3
board/omap3evm/Makefile | 47 ++++
board/omap3evm/clock.c | 313 +++++++++++++++++++++++++++++++
board/omap3evm/config.mk | 17 +
board/omap3evm/lowlevel_init.S | 360 ++++++++++++++++++++++++++++++++++++
board/omap3evm/mem.c | 288 ++++++++++++++++++++++++++++
board/omap3evm/nand.c | 408 +++++++++++++++++++++++++++++++++++++++++
board/omap3evm/omap3evm.c | 389 +++++++++++++++++++++++++++++++++++++++
board/omap3evm/sys_info.c | 312 +++++++++++++++++++++++++++++++
board/omap3evm/syslib.c | 76 +++++++
board/omap3evm/u-boot.lds | 63 ++++++
include/configs/omap3evm.h | 297 +++++++++++++++++++++++++++++
13 files changed, 2576 insertions(+)

Signed-off-by: Manikandan Pillai <mani.pillai@ti.com>

diff -uprN omap3-uboot-org/u-boot-omap3/board/omap3evm/clock.c omap3-uboot/u-boot-omap3/board/omap3evm/clock.c
--- omap3-uboot-org/u-boot-omap3/board/omap3evm/clock.c 1970-01-01 05:30:00.000000000 +0530
+++ omap3-uboot/u-boot-omap3/board/omap3evm/clock.c 2008-07-08 10:29:03.000000000 +0530
@@ -0,0 +1,313 @@
+/*
+ * (C) Copyright 2008
+ * Texas Instruments, <www.ti.com>
+ *
+ * Author :
+ * Manikandan Pillai <mani.pillai@ti.com>
+ *
+ * Derived from Beagle Board and OMAP3 SDP code by
+ * Richard Woodruff <r-woodruff2@ti.com>
+ * Syed Mohammed Khasim <khasim@ti.com>
+ *
+ * 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
+ */

Some first comments, mainly from trying to apply this patch series. Didn't look at the code yet.

Pillai, Manikandan wrote:

This patch adds OMAP3 EVM support to u-boot.

- This patch adds board related support taking Beagle port as a reference.
- Clocking and Pin Muxing is similar to Beagle
- UART support is changed to UART1
- NAND boot is changed to ONENAND
- Prompt is changed for the board to OAMP3_EVM

Files changed with this patch :
Makefile | 3
board/omap3evm/Makefile | 47 ++++
board/omap3evm/clock.c | 313 +++++++++++++++++++++++++++++++
board/omap3evm/config.mk | 17 +
board/omap3evm/lowlevel_init.S | 360 ++++++++++++++++++++++++++++++++++++
board/omap3evm/mem.c | 288 ++++++++++++++++++++++++++++
board/omap3evm/nand.c | 408 +++++++++++++++++++++++++++++++++++++++++
board/omap3evm/omap3evm.c | 389 +++++++++++++++++++++++++++++++++++++++
board/omap3evm/sys_info.c | 312 +++++++++++++++++++++++++++++++
board/omap3evm/syslib.c | 76 +++++++
board/omap3evm/u-boot.lds | 63 ++++++
include/configs/omap3evm.h | 297 +++++++++++++++++++++++++++++
13 files changed, 2576 insertions(+)

Signed-off-by: Manikandan Pillai <mani.pillai@ti.com>

diff -uprN omap3-uboot-org/u-boot-omap3/board/omap3evm/clock.c omap3-uboot/u-boot-omap3/board/omap3evm/clock.c
--- omap3-uboot-org/u-boot-omap3/board/omap3evm/clock.c 1970-01-01 05:30:00.000000000 +0530
+++ omap3-uboot/u-boot-omap3/board/omap3evm/clock.c 2008-07-08 10:29:03.000000000 +0530

Please use directory (strip) level 1 and not 2 (i.e. patch should use standard -p1 and not -p2).

Same for patch 2 & 3.

diff -uprN omap3-uboot-org/u-boot-omap3/scp.txt omap3-uboot/u-boot-omap3/scp.txt
--- omap3-uboot-org/u-boot-omap3/scp.txt 1970-01-01 05:30:00.000000000 +0530
+++ omap3-uboot/u-boot-omap3/scp.txt 2008-07-08 10:35:37.000000000 +0530
@@ -0,0 +1,3 @@
+echo "file being transferred to linwoodxc22 is $1"
+scp $1 a0393249@10.24.98.225:/user/a0393249/u-boot-omap/u-boot-omap3/$1
+

What's this? Please remove.

I didn't check the details but checkpatch gives me

total: 284 errors, 48 warnings, 2582 lines checked

Regards

Dirk

Some more remarks:

Pillai, Manikandan wrote:

This patch adds OMAP3 EVM support to u-boot.

- This patch adds board related support taking Beagle port as a reference.
- Clocking and Pin Muxing is similar to Beagle
- UART support is changed to UART1
- NAND boot is changed to ONENAND
- Prompt is changed for the board to OAMP3_EVM

Files changed with this patch :
Makefile | 3
board/omap3evm/Makefile | 47 ++++
board/omap3evm/clock.c | 313 +++++++++++++++++++++++++++++++
board/omap3evm/config.mk | 17 +
board/omap3evm/lowlevel_init.S | 360 ++++++++++++++++++++++++++++++++++++
board/omap3evm/mem.c | 288 ++++++++++++++++++++++++++++
board/omap3evm/nand.c | 408 +++++++++++++++++++++++++++++++++++++++++
board/omap3evm/omap3evm.c | 389 +++++++++++++++++++++++++++++++++++++++
board/omap3evm/sys_info.c | 312 +++++++++++++++++++++++++++++++
board/omap3evm/syslib.c | 76 +++++++
board/omap3evm/u-boot.lds | 63 ++++++
include/configs/omap3evm.h | 297 +++++++++++++++++++++++++++++
13 files changed, 2576 insertions(+)

Signed-off-by: Manikandan Pillai <mani.pillai@ti.com>

diff -uprN omap3-uboot-org/u-boot-omap3/board/omap3evm/clock.c omap3-uboot/u-boot-omap3/board/omap3evm/clock.c
--- omap3-uboot-org/u-boot-omap3/board/omap3evm/clock.c 1970-01-01 05:30:00.000000000 +0530
+++ omap3-uboot/u-boot-omap3/board/omap3evm/clock.c 2008-07-08 10:29:03.000000000 +0530

Is this 100% identical to Beagle's clock.c? Same for some other files. Seems there is a lot of common code?

...

diff -uprN omap3-uboot-org/u-boot-omap3/board/omap3evm/Makefile omap3-uboot/u-boot-omap3/board/omap3evm/Makefile
--- omap3-uboot-org/u-boot-omap3/board/omap3evm/Makefile 1970-01-01 05:30:00.000000000 +0530
+++ omap3-uboot/u-boot-omap3/board/omap3evm/Makefile 2008-07-08 09:39:52.000000000 +0530
@@ -0,0 +1,47 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd@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 = lib$(BOARD).a
+
+OBJS := omap3evm.o mem.o clock.o syslib.o sys_info.o nand.o
+SOBJS := lowlevel_init.o
+
+$(LIB): $(OBJS) $(SOBJS)
+ $(AR) crv $@ $^
+
+clean:
+ rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+ rm -f $(LIB) core *.bak .depend

If I apply this I have spaces instead of tabs here, resulting in Makefile failures. Not sure if I saved it wrongly on my side or if your mailer replaced tabs by spaces, though. Do you like to check? Sorry if I did it wrong.

...

diff -uprN omap3-uboot-org/u-boot-omap3/board/omap3evm/omap3evm.c omap3-uboot/u-boot-omap3/board/omap3evm/omap3evm.c
--- omap3-uboot-org/u-boot-omap3/board/omap3evm/omap3evm.c 1970-01-01 05:30:00.000000000 +0530
+++ omap3-uboot/u-boot-omap3/board/omap3evm/omap3evm.c 2008-07-08 10:26:55.000000000 +0530

....

+int misc_init_r(void)
+{
+
+ unsigned char byte;
+
+#ifdef CONFIG_DRIVER_OMAP34XX_I2C
+ i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE);
+#endif
+ byte = 0x20;
+ i2c_write(0x4B, 0x7A, 1, &byte, 1);
+ byte = 0x03;
+ i2c_write(0x4B, 0x7D, 1, &byte, 1);
+ byte = 0xE0;
+ i2c_write(0x4B, 0x8E, 1, &byte, 1);
+ byte = 0x05;
+ i2c_write(0x4B, 0x91, 1, &byte, 1);
+ byte = 0x20;
+ i2c_write(0x4B, 0x96, 1, &byte, 1);
+ byte = 0x03;
+ i2c_write(0x4B, 0x99, 1, &byte, 1);
+ byte = 0x33;
+ i2c_write(0x4A, 0xEE, 1, &byte, 1);
+
+ *((uint *) 0x49058034) = 0xFFFFFAF9;
+ *((uint *) 0x49056034) = 0x0F9F0FFF;
+ *((uint *) 0x49058094) = 0x00000506;
+ *((uint *) 0x49056094) = 0xF060F000;

We should add at least some comments what this 'magic' code does. Same for Beagle.

+ /* set clksel_tv and clksel_dss1 to DPLL4 clock divided by 1 */
+ *((uint *) 0x48004E40) = 0x00001001;
+ return (0);
+}
+

...

diff -uprN omap3-uboot-org/u-boot-omap3/board/omap3evm/sys_info.c omap3-uboot/u-boot-omap3/board/omap3evm/sys_info.c
--- omap3-uboot-org/u-boot-omap3/board/omap3evm/sys_info.c 1970-01-01 05:30:00.000000000 +0530
+++ omap3-uboot/u-boot-omap3/board/omap3evm/sys_info.c 2008-07-08 10:27:38.000000000 +0530

...

+/*********************************************************************
+ * display_board_info() - print banner with board info.
+ *********************************************************************/
+void display_board_info(u32 btype)
+{
+ char *bootmode = {
+ "NOR",
+ "ONND",
+ "NAND",
+ "P2a",
+ "NOR",
+ "P2a",
+ "P2b",
+ };
+ u32 brev = get_board_rev();
+ char cpu_3430s = "3530";

EVM has 3430 or 3530 ?

+ char db_ver = "0.0"; /* board type */
+ char mem_sdr = "mSDR"; /* memory type */
+ char mem_ddr = "LPDDR";
+ char t_tst = "TST"; /* security level */
+ char t_emu = "EMU";
+ char t_hs = "HS";
+ char t_gp = "GP";
+ char unk = "?";
+#ifdef CONFIG_LED_INFO
+ char led_string[CONFIG_LED_LEN] = { 0 };
+#endif
+ char p_l3 = "165";
+ char p_cpu = "2";
+
+ char *cpu_s, *db_s, *mem_s, *sec_s;
+ u32 cpu, rev, sec;
+
+ rev = get_cpu_rev();
+ cpu = get_cpu_type();
+ sec = get_device_type();
+
+ if (is_mem_sdr())
+ mem_s = mem_sdr;
+ else
+ mem_s = mem_ddr;
+
+ cpu_s = cpu_3430s;
+
+ db_s = db_ver;
+ db_s[0] += (brev >> 4) & 0xF;
+ db_s[2] += brev & 0xF;
+
+ switch (sec) {
+ case TST_DEVICE:
+ sec_s = t_tst;
+ break;
+ case EMU_DEVICE:
+ sec_s = t_emu;
+ break;
+ case HS_DEVICE:
+ sec_s = t_hs;
+ break;
+ case GP_DEVICE:
+ sec_s = t_gp;
+ break;
+ default:
+ sec_s = unk;
+ }
+
+ printf("OMAP%s-%s rev %d, CPU-OPP%s L3-%sMHz\n", cpu_s, sec_s, rev,
+ p_cpu, p_l3);
+ printf("OMAP3 EVM Board + %s/%s\n",
+ mem_s, bootmode[get_gpmc0_type()]);
+
+}

...

diff -uprN omap3-uboot-org/u-boot-omap3/Makefile omap3-uboot/u-boot-omap3/Makefile
--- omap3-uboot-org/u-boot-omap3/Makefile 2008-07-06 20:38:47.000000000 +0530
+++ omap3-uboot/u-boot-omap3/Makefile 2008-07-08 09:38:22.000000000 +0530
@@ -2573,6 +2573,9 @@ SMN42_config : unconfig
omap3530beagle_config : unconfig
        @./mkconfig $(@:_config=) arm omap3 omap3530beagle

+omap3evm_config : unconfig
+ @./mkconfig $(@:_config=) arm omap3 omap3evm
+

We have to use the standard format @$(MKCONFIG) here. Same for Beagle.

diff -uprN omap3-uboot-org/u-boot-omap3/scp.txt omap3-uboot/u-boot-omap3/scp.txt
--- omap3-uboot-org/u-boot-omap3/scp.txt 1970-01-01 05:30:00.000000000 +0530
+++ omap3-uboot/u-boot-omap3/scp.txt 2008-07-08 10:35:37.000000000 +0530
@@ -0,0 +1,3 @@
+echo "file being transferred to linwoodxc22 is $1"
+scp $1 a0393249@10.24.98.225:/user/a0393249/u-boot-omap/u-boot-omap3/$1
+

As already mentioned, please remove.

Thanks

Dirk

It is safe to say 3530 for the EVM.