Skip to contentSkip to conversation

Does U-boot support ethernet chip LAN9210 from SMSC?

U-Boot-Users 이승열 2 participants 2 messages Jun 30, 2008

lore
Share & tools
lore

이승열

author
#0 lore raw

Hi Ben,

The below is the part of smsc911x.c.

In reg_read(), line 5 shows "(*(addr_16 + 1) << 16));", which add 1 to addr_16. In reg_write(), line 10 shows *(volatile u16*)(addr + 2) = (u16)(val >> 16);, which add 2 to addr.

I don't understand this. Can you explain to me why address offset differs?

1. #elif CONFIG_DRIVER_SMC911X_16_BIT
2. static inline u32 reg_read(u32 addr)
3. {
4. volatile u16 *addr_16 = (u16 *)addr;
5. return ((*addr_16 & 0x0000ffff) | (*(addr_16 + 1) << 16));
6. }
7. static inline void reg_write(u32 addr, u32 val) 8.{
9. *(volatile u16*)addr = (u16)val;
10. *(volatile u16*)(addr + 2) = (u16)(val >> 16);
11. }
12. #else

Best Regards,
Seung Youl.

----- Original Message -----
From: "???" <[email protected]>
To: "Ben Warren" <[email protected]>
Cc: <[email protected]>
Sent: Monday, June 30, 2008 3:02 PM
Subject: Re: [U-Boot-Users] Does U-boot support ethernet chip LAN9210 from SMSC?

Quoted 46 lines

Hi Ben,

I have found smc911x.c source code in which both 16 and 32 bit access are supported. I will test my board with this source code.

Thank you.

Best Regards,
Seung Youl.

----- Original Message -----
From: "Ben Warren" <[email protected]>
To: "???" <[email protected]>
Cc: <[email protected]>
Sent: Monday, June 30, 2008 2:43 PM
Subject: Re: [U-Boot-Users] Does U-boot support ethernet chip LAN9210 from SMSC?

Quoted 26 lines · ???
Quoted 7 lines

Hi Ben,

Sorry for bothering you.

I have downloaded the latest version of U-boot. There is smc911x.c file. I have added this file to Makefile. The compilation is successful.

You don't have to add anything to the Makefile, just use the correct CONFIG options

Quoted 3 lines

But, there are two problems.
1. there is no LAN9210 entry in chip id list

So add it. I haven't looked at the LAN9210 data sheet to even know if it will work with this chip. You're going to have to do some work.

Quoted 2 lines

2. Only 32-bit is supported.

Not true. Both 16 and 32 bit access is supported. Check the source code (hint: look for CONFIG_DRIVER_SMC911X_16_BIT)

Quoted 1 line

Is there any recent driver for LAN9210?

I don't know of another or I would have told you about it.

Good luck,
Ben

#1 lore raw
Quoted 9 lines · ???

Hi Ben,

The below is the part of smsc911x.c.

In reg_read(), line 5 shows "(*(addr_16 + 1) << 16));", which add 1 to addr_16. In reg_write(), line 10 shows *(volatile u16*)(addr + 2) = (u16)(val >> 16);, which add 2 to addr.

I don't understand this. Can you explain to me why address offset differs?

The type of addr and addr_16 is not the same. one is a pointer and one is a number.

Quoted 70 lines

1. #elif CONFIG_DRIVER_SMC911X_16_BIT
2. static inline u32 reg_read(u32 addr)
3. {
4. volatile u16 *addr_16 = (u16 *)addr;
5. return ((*addr_16 & 0x0000ffff) | (*(addr_16 + 1) << 16));
6. }
7. static inline void reg_write(u32 addr, u32 val) 8.{
9. *(volatile u16*)addr = (u16)val;
10. *(volatile u16*)(addr + 2) = (u16)(val >> 16);
11. }
12. #else

Best Regards,
Seung Youl.

----- Original Message -----
From: "???" <[email protected]>
To: "Ben Warren" <[email protected]>
Cc: <[email protected]>
Sent: Monday, June 30, 2008 3:02 PM
Subject: Re: [U-Boot-Users] Does U-boot support ethernet chip LAN9210 from SMSC?

Quoted 12 lines

Hi Ben,

I have found smc911x.c source code in which both 16 and 32 bit access are supported. I will test my board with this source code.

Thank you.

Best Regards,
Seung Youl.

Quoted 34 lines

----- Original Message -----
From: "Ben Warren" <[email protected]>
To: "???" <[email protected]>
Cc: <[email protected]>
Sent: Monday, June 30, 2008 2:43 PM
Subject: Re: [U-Boot-Users] Does U-boot support ethernet chip LAN9210 from SMSC?

Quoted 26 lines · ???
Quoted 7 lines

Hi Ben,

Sorry for bothering you.

I have downloaded the latest version of U-boot. There is smc911x.c file. I have added this file to Makefile. The compilation is successful.

You don't have to add anything to the Makefile, just use the correct CONFIG options

Quoted 3 lines

But, there are two problems.
1. there is no LAN9210 entry in chip id list

So add it. I haven't looked at the LAN9210 data sheet to even know if it will work with this chip. You're going to have to do some work.

Quoted 2 lines

2. Only 32-bit is supported.

Not true. Both 16 and 32 bit access is supported. Check the source code (hint: look for CONFIG_DRIVER_SMC911X_16_BIT)

Quoted 1 line

Is there any recent driver for LAN9210?

I don't know of another or I would have told you about it.

Good luck,
Ben

Quoted 9 lines

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080630/a381cf3d/attachment.pgp