[U-Boot-Users] there some thing wrong with my RTL8019 network driver

赵 包 zjrbhy at yahoo.com.cn
Tue Mar 13 07:58:09 CET 2007

I have ported U-Boot 1.1.5 on S3C44B0, it can run on my custom board now.
  but the rtl8019 network driver doesn't work.I want rtl8019  to work in 16bit mode.but U-Boot 1.1.5  only surpport 8bit mode.
  the physical level send function is in u-boot-1.1.5\drivers\rtl8019.c,I list below:
  extern int eth_send (volatile void *packet, int length)
 volatile unsigned char *p;
 unsigned int pn;
   pn = length;
 p = (volatile unsigned char *) packet;
   while (get_reg (RTL8019_COMMAND) == RTL8019_TRANSMIT);
   put_reg (RTL8019_REMOTESTARTADDRESS0, 0);
 put_reg (RTL8019_REMOTEBYTECOUNT0, (pn & 0xff));
 put_reg (RTL8019_REMOTEBYTECOUNT1, ((pn >> 8) & 0xff));
   put_reg (RTL8019_COMMAND, RTL8019_REMOTEDMAWR);
 while (pn > 0) {
  put_reg (RTL8019_DMA_DATA, *p++);
   pn = length;
   while (pn < 60) { /*Padding */
  put_reg (RTL8019_DMA_DATA, 0);
   while (!(get_reg (RTL8019_INTERRUPTSTATUS)) & 0x40);
   put_reg (RTL8019_INTERRUPTSTATUS, 0x40);
 put_reg (RTL8019_TRANSMITBYTECOUNT0, (pn & 0xff));
 put_reg (RTL8019_TRANSMITBYTECOUNT1, ((pn >> 8 & 0xff)));
 put_reg (RTL8019_COMMAND, RTL8019_TRANSMIT);
   return 0;
  since RTL8019 work in 8bit mode,the pointer "p"  in  "put_reg (RTL8019_DMA_DATA, *p++)" is  unsigned char  type.
  if I let RTL8019 work in 16bit mode,i think i should change the pointer "p"  to unsigned int type in order to transmit a 16bit word a time,then I run into a  byte alignment problem.since the argument "packet" isn't always a even number.
  how to solve the problem?
  and I wonder the RTL8019 receive data package through interrupt mode or polling mode ,I guess it work in polling mode,am I right?
  best regarts

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20070313/99367100/attachment.htm 

More information about the U-Boot mailing list