From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ks_c_5601-1987?B?wMy9wr+t?= Date: Mon, 30 Jun 2008 19:21:54 +0900 Subject: [U-Boot-Users] Fw: Does U-boot support ethernet chip LAN9210 from SMSC? Message-ID: <02d401c8da9b$20600990$b301a8c0@server> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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: "???" To: "Ben Warren" Cc: Sent: Monday, June 30, 2008 3:02 PM Subject: Re: [U-Boot-Users] Does U-boot support ethernet chip LAN9210 from SMSC? > 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" > To: "???" > Cc: > Sent: Monday, June 30, 2008 2:43 PM > Subject: Re: [U-Boot-Users] Does U-boot support ethernet chip LAN9210 from SMSC? > > >> On Sun, Jun 29, 2008 at 10:06 PM, ??? wrote: >>> 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 >>> >>> 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. >>> 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) >>> Is there any recent driver for LAN9210? >> >> I don't know of another or I would have told you about it. >> >> Good luck, >> Ben >>