NET: SDP3430: trouble with shifting from LAN9C916 to SMC91XX driver
Hi Folks,
While attempting to address the warning for SDP3430 as pointed out by dirk in [1], I did a patch corresponding to what was done for EVM(353x) as in [2]. unfortunately, this wont work for me, I get:
U-Boot 2009.08-00515-gfea6a55-dirty (Oct 12 2009 - 14:03:23)
OMAP3530-GP ES3.0, CPU-OPP2 L3-165MHz
OMAP3 SDP3430 board + LPDDR/NOR
I2C: ready DRAM: 128 MB Flash: 128 MB In: serial Out: serial Err: serial smc911x: Invalid chip endian 0xdee0013d Net: No ethernet found.
OMAP34XX SDP #
and no network, using LEGACY driver seems to be working just great for me.
Note: in my patch [2], I did try both CONFIG_SMC911X_32_BIT and CONFIG_SMC911X_16_BIT with no luck either way. I even tried to hack the driver by skipping the supported chip detection code, but the driver still did not work for me.
scanning a little more in the git repo, I see all the ancient boards of OMAP family - 5912,2420 etc.. still have LEGACY driver being used..
I am pretty sure I must be missing something here and appreciate any guidance folks can give me on this..
Signature · 18 lines
Regards, Nishanth Menon Ref: [1] http://www.nabble.com/forum/Permalink.jtp?root=25837696&post=25841367&page=y [2] From fea6a55cb67b3fda1d93da74b2fe68fb25376e7e Mon Sep 17 00:00:00 2001 From: Nishanth Menon <[email protected]> Date: Mon, 12 Oct 2009 13:54:17 -0500 Subject: [BAD][PATCH] TI OMAP3: SDP3430: dont use legacy ethernet driver Stop using the LEGACY driver and use NET_MULTI this also removes the build warning for SDP3430 --- board/ti/sdp3430/sdp.c | 8 +++++--- include/configs/omap3_sdp3430.h | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-)
board/ti/sdp3430/sdp.c +5 -3
@@ -22,6 +22,7 @@* MA 02111-1307 USA */ #include <common.h> +#include <netdev.h> #include <twl4030.h> #include <asm/io.h> #include <asm/arch/mux.h>
@@ -121,8 +122,8 @@ int board_init(void)return 0 ; } -#define LAN_RESET_REGISTER (CONFIG_LAN91C96_BASE + 0x01c) -#define ETH_CONTROL_REG (CONFIG_LAN91C96_BASE + 0x30b) +#define LAN_RESET_REGISTER (CONFIG_SMC911X_BASE + 0x01c) +#define ETH_CONTROL_REG (CONFIG_SMC911X_BASE + 0x30b)/** * @brief ether_init Take the Ethernet controller out of reset and wait
@@ -130,7 +131,7 @@ int board_init(void)*/ static void ether_init (void ) { -#ifdef CONFIG_DRIVER_LAN91C96 +#ifdef CONFIG_SMC911X int cnt =20 ;writew (0x0 ,LAN_RESET_REGISTER );
@@ -155,6 +156,7 @@ static void ether_init(void)writeb (readb (ETH_CONTROL_REG ) & ~0x1 ,ETH_CONTROL_REG );udelay (1000 ); +smc911x_initialize (0 ,CONFIG_SMC911X_BASE ); reset_err_out:return ;
(quoted diff) +0 -0
b/include/configs/omap3_sdp3430.h
index 229dc5e..7b0a248 100644
include/configs/omap3_sdp3430.h +4 -3
@@ -200,9 +200,10 @@*/ #if defined(CONFIG_CMD_NET ) -#define CONFIG_DRIVER_LAN91C96 -#define CONFIG_LAN91C96_BASE DEBUG_BASE -#define CONFIG_LAN91C96_EXT_PHY +#define CONFIG_NET_MULTI +#define CONFIG_SMC911X +#define CONFIG_SMC911X_32_BIT +#define CONFIG_SMC911X_BASE DEBUG_BASE#define CONFIG_BOOTP_SEND_HOSTNAME /*
Signature · 1 line
1.6.3.3
Nishanth,
Quoted 19 lines · Nishanth Menon
Hi Folks,
While attempting to address the warning for SDP3430 as pointed out by dirk in [1], I did a patch corresponding to what was done for EVM(353x) as in [2]. unfortunately, this wont work for me, I get:
U-Boot 2009.08-00515-gfea6a55-dirty (Oct 12 2009 - 14:03:23)OMAP3530-GP ES3.0, CPU-OPP2 L3-165MHz
OMAP3 SDP3430 board + LPDDR/NORI2C: ready DRAM: 128 MB Flash: 128 MB In: serial Out: serial Err: serial smc911x: Invalid chip endian 0xdee0013d Net: No ethernet found.OMAP34XX SDP #
Quoted 8 lines
and no network, using LEGACY driver seems to be working just great for me.
Note: in my patch [2], I did try both
CONFIG_SMC911X_32_BITandCONFIG_SMC911X_16_BITwith no luck either way. I even tried to hack the driver by skipping the supported chip detection code, but the driver still did not work for me.When using
CONFIG_NET_MULTIyou need to have aboard_eth_init()function in
your board code which in turn must call smc911x_initialize(). Make sure that eth_initialize() gets called somewhere in your cpu/board.c call sequence. I suspect that while the SMC911x driver is being initialized, it isn't being registered properly with the networking library. There are many examples in the source tree of how to do this.
regards,
Ben
Ben Warren had written, on 10/13/2009 11:36 PM, the following:
Quoted 27 lines
Nishanth,
On Tue, Oct 13, 2009 at 8:13 PM, Nishanth Menon <[email protected] <mailto:[email protected]>> wrote:
Hi Folks,
While attempting to address the warning for SDP3430 as pointed out by dirk in [1], I did a patch corresponding to what was done for EVM(353x) as in [2]. unfortunately, this wont work for me, I get:
U-Boot 2009.08-00515-gfea6a55-dirty (Oct 12 2009 - 14:03:23)OMAP3530-GP ES3.0, CPU-OPP2 L3-165MHz
OMAP3 SDP3430 board + LPDDR/NOR
I2C: ready
DRAM: 128 MB
Flash: 128 MB
In: serial
Out: serial
Err: serial
smc911x: Invalid chip endian0xdee0013d
Net: No ethernet found.
OMAP34XX SDP #and no network, using LEGACY driver seems to be working just great for me.
Quoted 6 lines
Note: in my patch [2], I did try both
CONFIG_SMC911X_32_BITandCONFIG_SMC911X_16_BITwith no luck either way. I even tried to hack the driver by skipping the supported chip detection code, but the driver still did not work for me.When using
CONFIG_NET_MULTIyou need to have aboard_eth_init()function
done
Quoted 1 line
in your board code which in turn must call
smc911x_initialize(). Make
done
Quoted 1 line
sure that
eth_initialize()gets called somewhere in yourcpu/board.c
why eth_initalize? rest of the OMAP3 boards dont seem to be doing that
Quoted 3 lines
call sequence. I suspect that while the SMC911x driver is being initialized, it isn't being registered properly with the networking library. There are many examples in the source tree of how to do this.
I would expect that and did check too, but why:
smc911x: Invalid chip endian 0xdee0013d
when I had a base address and device which was supported by LAN91C96 legacy driver?
My lack of network chip knowledge is kicking me at the moment.. trying to find the device data sheet internally @ TI..
Signature · 9 lines
Regards, Nishanth Menon -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-TI-OMAP3-SDP3430-dont-use-legacy-ethernet-driver.patch Type: text/x-patch Size: 0 bytes Desc: not available Url : http://lists.denx.de/pipermail/u-boot/attachments/20091014/0609a35a/attachment.bin
Hi Nishanth,
Quoted 41 lines · Nishanth Menon
Ben Warren had written, on 10/13/2009 11:36 PM, the following:
Quoted 29 lines
Nishanth,
On Tue, Oct 13, 2009 at 8:13 PM, Nishanth Menon <[email protected] <mailto:[email protected]>> wrote:
Hi Folks,
While attempting to address the warning for SDP3430 as pointed
out by
dirk in [1], I did a patch corresponding to what was done for
EVM(353x)
as in [2]. unfortunately, this wont work for me, I get:
U-Boot 2009.08-00515-gfea6a55-dirty (Oct 12 2009 - 14:03:23)OMAP3530-GP ES3.0, CPU-OPP2 L3-165MHz
OMAP3 SDP3430 board + LPDDR/NOR
I2C: ready
DRAM: 128 MB
Flash: 128 MB
In: serial
Out: serial
Err: serial
smc911x: Invalid chip endian0xdee0013d
Net: No ethernet found.
OMAP34XX SDP #and no network, using LEGACY driver seems to be working just great for me.
Quoted 7 lines
Note: in my patch [2], I did try both
CONFIG_SMC911X_32_BITandCONFIG_SMC911X_16_BITwith no luck either way. I even tried to
hack the
driver by skipping the supported chip detection code, but the driver still did not work for me.When using
CONFIG_NET_MULTIyou need to have aboard_eth_init()functiondone
Quoted 1 line
in your board code which in turn must call
smc911x_initialize(). Makedone
Quoted 1 line
sure that
eth_initialize()gets called somewhere in yourcpu/board.c
Quoted 9 lines
why
eth_initalize? rest of the OMAP3 boards dont seem to be doing thatQuoted 3 lines
call sequence. I suspect that while the SMC911x driver is being initialized, it isn't being registered properly with the networking library. There are many examples in the source tree of how to do this.
I would expect that and did check too, but why:
smc911x: Invalid chip endian0xdee0013d
when I had a base address and device which was supported by LAN91C96 legacy driver?
The SMC911x chips all contain the magic value 0x87654321 @ offset 0x64. Your board has something else there (it's obviously not an endianness issue, so ignore the error message text). I think you need to learn more about your board, in particular which SMCS chip you're using, which data width and where it's located in memory. This is a simple memory-mapped device, and once you find out where it's located, it should 'just work'
Here's a datasheet for reference. See page 68 for the memory map.
http://www.smsc.com/media/Downloads_Public/Data_Sheets/9116.pdf
regards,
Ben
On Wed, Oct 14, 2009 at 2:00 PM, Ben Warren <[email protected]> wrote:
[...]
Quoted 11 lines
The SMC911x chips all contain the magic value
0x87654321@ offset0x64. Your board has something else there (it's obviously not an endianness issue, so ignore the error message text). ?I think you need to learn more about your board, in particular which SMCS chip you're using, which data width and where it's located in memory. ?This is a simple memory-mapped device, and once you find out where it's located, it should 'just work'Here's a datasheet for reference. ?See page 68 for the memory map.
http://www.smsc.com/media/Downloads_Public/Data_Sheets/9116.pdf
9116 seems to use memory mapped regs, while 91c96 [1] page 39 shows it to use banked register access. So unfortunately, SMC911X would not support this chip as I cannot even see the banked registers in smc911x.[ch]. so unfortuantely, I cant switch to SMC911X driver and will have to wait till lan91c96.c becomes NET_MULTI to be able to remove the warning in sdp3430 build.
In fact, I think the following boards use the legacy LAN91C96 driver:include/configs/apollon.hinclude/configs/assabet.hinclude/configs/B2.hinclude/configs/gcplus.hinclude/configs/lubbock.hinclude/configs/omap1510inn.hinclude/configs/omap1610h2.hinclude/configs/omap1610inn.hinclude/configs/omap2420h4.hinclude/configs/omap5912osk.hinclude/configs/omap730p2.h
to confirm a non ti board which uses this legacy chip, I tried building B2, and yep, I see the same warning which was plaguing me :(..
Do let me know if there are alternatives available.
Regards,
Nishanth Menon
Ref:
[1] http://www.embeddedsys.com/subpages/resources/images/documents/LAN91C96_datasheet.pdf
Quoted 16 lines · Nishanth Menon
On Wed, Oct 14, 2009 at 2:00 PM, Ben Warren <[email protected]> wrote:
[...]Quoted 8 lines
The SMC911x chips all contain the magic value
0x87654321@ offset0x64. Your board has something else there (it's obviously not an endianness issue, so ignore the error message text). I think you need to learn more about your board, in particular which SMCS chip you're using, which data width and where it's located in memory. This is a simple memory-mapped device, and once you find out where it's located, it should 'just work'Quoted 4 lines
Here's a datasheet for reference. See page 68 for the memory map.
http://www.smsc.com/media/Downloads_Public/Data_Sheets/9116.pdf
Quoted 8 lines
9116 seems to use memory mapped regs, while 91c96 [1] page 39 shows it to use banked register access. So unfortunately, SMC911X would not support this chip as I cannot even see the banked registers in smc911x.[ch]. so unfortuantely, I cant switch to SMC911X driver and will have to wait till
lan91c96.cbecomesNET_MULTIto be able to remove the warning in sdp3430 build.
I guess I misunderstood in thinking that you'd switched chips on the board design.
Quoted 16 lines
In fact, I think the following boards use the legacy LAN91C96 driver:
include/configs/apollon.hinclude/configs/assabet.hinclude/configs/B2.hinclude/configs/gcplus.hinclude/configs/lubbock.hinclude/configs/omap1510inn.hinclude/configs/omap1610h2.hinclude/configs/omap1610inn.hinclude/configs/omap2420h4.hinclude/configs/omap5912osk.hinclude/configs/omap730p2.h
to confirm a non ti board which uses this legacy chip, I tried building B2, and yep, I see the same warning which was plaguing me :(..
Quoted 3 lines
Do let me know if there are alternatives available.
The alternative that most immediately jumps to mind is for you to convert the LAN91C96 driver to NET_MULTI :) It's pretty easy to do and would help the "community" in a big way.
Quoted 6 lines
Regards,
Nishanth MenonRef:
[1] http://www.embeddedsys.com/subpages/resources/images/documents/LAN91C96_datasheet.pdf
regards,
Ben
Menon
Ben,
Quoted 4 lines
-----Original Message-----
From: Ben Warren [mailto:biggerbadderben at gmail.com]
Sent: Thursday, October 15, 2009 12:06 AM
To: Menon, Nishanth
[..]
Quoted 6 lines
Quoted 6 lines
include/configs/omap5912osk.hinclude/configs/omap730p2.h
to confirm a non ti board which uses this legacy chip, I tried building B2, and yep, I see the same warning which was plaguing me :(..
Quoted 6 lines
Quoted 3 lines
Do let me know if there are alternatives available.
The alternative that most immediately jumps to mind is for you to convert the LAN91C96 driver to
NET_MULTI:) It's pretty easy to do and would help the "community" in a big way.
:D - why do I get the feeling "I thought u'd say so" ;).. yep.. started a link in omapedia for OMAP3 TODOs I could think of
Regards,
Nishanth Menon
Ref:
[1] http://omappedia.org/wiki/OMAP3_U-Boot_TODO
PS: Dirk, I think you might ask me to post it elsewhere.. lets discuss that on a different thread if any..