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

This patch adds network support for OMAP3 EVM.

- This patch adds network support for SMSC9118 net device.
- TFTP has problems with higher packet sizes and hence it has been reverted to 512.

Files changed with this patch :
drivers/net/Makefile | 1
drivers/net/smsc9118.c | 927 +++++++++++++++++++++++++++++++++++++++
drivers/net/smsc9118.h | 505 +++++++++++++++++++++
include/asm-arm/arch-omap3/i2c.h | 2
include/configs/omap3evm.h | 33 +
net/eth.c | 4
net/tftp.c | 2
7 files changed, 1471 insertions(+), 3 deletions(-)

diff -uprN omap3-uboot-patch1/omap3-uboot/u-boot-omap3/drivers/net/Makefile omap3-uboot/u-boot-omap3/drivers/net/Makefile
--- omap3-uboot-patch1/omap3-uboot/u-boot-omap3/drivers/net/Makefile 2008-07-10 10:17:30.000000000 +0530
+++ omap3-uboot/u-boot-omap3/drivers/net/Makefile 2008-07-09 09:07:07.000000000 +0530
@@ -66,6 +66,7 @@ COBJS-$(CONFIG_ULI526X) += uli526x.o
COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
COBJS-$(CONFIG_XILINX_EMAC) += xilinx_emac.o
COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
+COBJS-$(CONFIG_DRIVER_SMSC9118) += smsc9118.o

COBJS := $(COBJS-y)
SRCS := $(COBJS:.o=.c)
diff -uprN omap3-uboot-patch1/omap3-uboot/u-boot-omap3/drivers/net/smsc9118.c omap3-uboot/u-boot-omap3/drivers/net/smsc9118.c
--- omap3-uboot-patch1/omap3-uboot/u-boot-omap3/drivers/net/smsc9118.c 1970-01-01 05:30:00.000000000 +0530
+++ omap3-uboot/u-boot-omap3/drivers/net/smsc9118.c 2008-07-10 15:38:57.000000000 +0530
@@ -0,0 +1,927 @@
+/*--------------------------------------------------------------------------
+//
+// File name: smsc9118.c
+//
+// Abstract: Driver for SMSC LAN9118 ethernet controller.
+//
+//
+// Start Automated RH
+// *** Do not edit between "Start Automated RH" and "End Automated RH" ***
+//
+// Copyright 2005, Seagate Technology LLC
+//
+// 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
+//
+// Revision History
+//
+// *** Do not edit between "Start Automated RH" and "End Automated RH" ***
+// End Automated RH
+//
+//--------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------
+* Copyright(c) 2005-2006 SMSC

Pillai, Manikandan wrote:

This patch adds network support for OMAP3 EVM.

- This patch adds network support for SMSC9118 net device.
- TFTP has problems with higher packet sizes and hence it has been reverted to 512.

Do you have any pointer to trouble report at U-Boot list about this?

Files changed with this patch :
drivers/net/Makefile | 1
drivers/net/smsc9118.c | 927 +++++++++++++++++++++++++++++++++++++++
drivers/net/smsc9118.h | 505 +++++++++++++++++++++
include/asm-arm/arch-omap3/i2c.h | 2
include/configs/omap3evm.h | 33 +
net/eth.c | 4
net/tftp.c | 2
7 files changed, 1471 insertions(+), 3 deletions(-)

diff -uprN omap3-uboot-patch1/omap3-uboot/u-boot-omap3/drivers/net/Makefile omap3-uboot/u-boot-omap3/drivers/net/Makefile
--- omap3-uboot-patch1/omap3-uboot/u-boot-omap3/drivers/net/Makefile 2008-07-10 10:17:30.000000000 +0530
+++ omap3-uboot/u-boot-omap3/drivers/net/Makefile 2008-07-09 09:07:07.000000000 +0530
@@ -66,6 +66,7 @@ COBJS-$(CONFIG_ULI526X) += uli526x.o
COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
COBJS-$(CONFIG_XILINX_EMAC) += xilinx_emac.o
COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
+COBJS-$(CONFIG_DRIVER_SMSC9118) += smsc9118.o

This gives a reject, most probably cause Steve's git is already at 1.3.4-rc1 and the patch is against an older version?

diff -uprN omap3-uboot-patch1/omap3-uboot/u-boot-omap3/net/tftp.c omap3-uboot/u-boot-omap3/net/tftp.c
--- omap3-uboot-patch1/omap3-uboot/u-boot-omap3/net/tftp.c 2008-07-10 10:17:30.000000000 +0530
+++ omap3-uboot/u-boot-omap3/net/tftp.c 2008-07-10 14:53:40.000000000 +0530
@@ -185,7 +185,7 @@ TftpSend (void)
                pkt += strlen((char *)pkt) + 1;
                /* try for more effic. blk size */
                pkt += sprintf((char *)pkt,"blksize%c%d%c",
- 0,TftpBlkSizeOption,0);
+ 0,TftpBlkSize,0);

This gives a reject, too. Not sure why, though.

This patch gives me

Total: 381 errors, 124 warnings, 1504 lines checked

Regards

Dirk

Some more remarks:

Pillai, Manikandan wrote:

This patch adds network support for OMAP3 EVM.

- This patch adds network support for SMSC9118 net device.

Do we really have to introduce a new driver (files) for this? Isn't there any chance to extend existing

SMSC LAN9[12]1[567] Network driver

(smc911x.c) to support 9118, too? See below, too.

- TFTP has problems with higher packet sizes and hence it has been reverted to 512.

Files changed with this patch :
drivers/net/Makefile | 1
drivers/net/smsc9118.c | 927 +++++++++++++++++++++++++++++++++++++++
drivers/net/smsc9118.h | 505 +++++++++++++++++++++
include/asm-arm/arch-omap3/i2c.h | 2
include/configs/omap3evm.h | 33 +
net/eth.c | 4
net/tftp.c | 2
7 files changed, 1471 insertions(+), 3 deletions(-)

Signed-off-by missing here. Same with patch 3.

...

diff -uprN omap3-uboot-patch1/omap3-uboot/u-boot-omap3/drivers/net/smsc9118.c omap3-uboot/u-boot-omap3/drivers/net/smsc9118.c
--- omap3-uboot-patch1/omap3-uboot/u-boot-omap3/drivers/net/smsc9118.c 1970-01-01 05:30:00.000000000 +0530
+++ omap3-uboot/u-boot-omap3/drivers/net/smsc9118.c 2008-07-10 15:38:57.000000000 +0530
@@ -0,0 +1,927 @@
+/*--------------------------------------------------------------------------
+//
+// File name: smsc9118.c
+//
+// Abstract: Driver for SMSC LAN9118 ethernet controller.
+//
+// Start Automated RH
+// *** Do not edit between "Start Automated RH" and "End Automated RH" ***
+//
+// Copyright 2005, Seagate Technology LLC
+//
+// 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
+//
+// Revision History
+//
+// *** Do not edit between "Start Automated RH" and "End Automated RH" ***
+// End Automated RH
+//
+//--------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------
+* Copyright(c) 2005-2006 SMSC
+*
+* Use of this source code is subject to the terms of the SMSC Software
+* License Agreement (SLA) under which you licensed this software product.
+* If you did not accept the terms of the SLA, you are not authorized to use
+* this source code.

I'm not sure that something like this is okay. Same with the header file.

+* This code and information is provided as is without warranty of any kind,
+* either expressed or implied, including but not limited to the implied
+* warranties of merchantability and/or fitness for a particular purpose.
+*
+* File name : smsc9118.c
+* Description : smsc9118 polled driver (non-interrupt driven)
+*
+* History :
+* 09-27-06 MDG v1.0 (First Release)
+* modified for ARM platform
+* 07-09-08 MK Pillai Modifed for OMAP3 EVM platform
+*----------------------------------------------------------------------------*/

...

diff -uprN omap3-uboot-patch1/omap3-uboot/u-boot-omap3/include/asm-arm/arch-omap3/i2c.h omap3-uboot/u-boot-omap3/include/asm-arm/arch-omap3/i2c.h
--- omap3-uboot-patch1/omap3-uboot/u-boot-omap3/include/asm-arm/arch-omap3/i2c.h 2008-07-10 10:17:30.000000000 +0530
+++ omap3-uboot/u-boot-omap3/include/asm-arm/arch-omap3/i2c.h 2008-07-10 16:41:46.000000000 +0530
@@ -86,7 +86,7 @@
#define I2C_CON_BE (1 << 14) /* Big endian mode */
#define I2C_CON_STB (1 << 11) /* Start byte mode (master mode only) */
#define I2C_CON_MST (1 << 10) /* Master/slave mode */
-#define I2C_CON_TRX (1 << 9) /* Transmitter/receiver mode /*
+#define I2C_CON_TRX (1 << 9) /* Transmitter/receiver mode */

This typo is alreay fixed in Steve's git.

                                   /* (master mode only) */
#define I2C_CON_XA (1 << 8) /* Expand address */
#define I2C_CON_STP (1 << 1) /* Stop condition (master mode only) */
diff -uprN omap3-uboot-patch1/omap3-uboot/u-boot-omap3/include/configs/omap3evm.h omap3-uboot/u-boot-omap3/include/configs/omap3evm.h
--- omap3-uboot-patch1/omap3-uboot/u-boot-omap3/include/configs/omap3evm.h 2008-07-10 10:17:59.000000000 +0530
+++ omap3-uboot/u-boot-omap3/include/configs/omap3evm.h 2008-07-10 16:48:13.000000000 +0530

...

@@ -294,4 +299,30 @@ extern unsigned int boot_flash_type;
#define NAND_ENABLE_CE(nand)
#define NAND_WAIT_READY(nand) udelay(10)

+
+/*----------------------------------------------------------------------------
+ * SMSC9115 Ethernet from SMSC9118 family
+ * ----------------------------------------------------------------------------
+ */

What do we really have at EVM? 9115 or 9118? If 9115, then smc911x.c should work as it states

SMSC LAN9[12]1[567] Network driver

?

+#if defined (CONFIG_CMD_NET)
+
+#define CONFIG_DRIVER_SMSC9118
+
+#define CONFIG_SMSC9118_BASE (0x2C000000)
+#define CONFIG_SMSC9118_EXT_PHY
+
+#endif /* (CONFIG_CMD_NET) */
+
+#define ES_2_0

ES_2_0 is removed in patch 3 again. So unneccessary here?

+/*
+ * BOOTP fields
+ */
+
+#define CONFIG_BOOTP_SUBNETMASK 0x00000001
+#define CONFIG_BOOTP_GATEWAY 0x00000002
+#define CONFIG_BOOTP_HOSTNAME 0x00000004
+#define CONFIG_BOOTP_BOOTPATH 0x00000010
+
#endif /* __CONFIG_H */

...

Thanks,

Dirk