From: Gabor Juhos Date: Wed, 22 May 2013 03:57:43 +0000 (+0000) Subject: net: pcnet: use pci_virt_to_mem to obtain buffer addresses X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=54fbcb0c04923704898913e0e6e316063e4e631e;p=u-boot.git net: pcnet: use pci_virt_to_mem to obtain buffer addresses The pcnet driver uses the pci_phys_to_mem function to get the memory address of the DMA buffers. This This assumes an 1:1 mapping between the PCI and physical memory which is not true on all platforms. On MIPS platform U-Boot is running within a mapped memory region, and the pci_phys_to_mem macro can't be used to obtain the memory address of the buffers. Signed-off-by: Gabor Juhos Cc: Daniel Schwierzeck --- diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c index aa69298401..283cb48b4e 100644 --- a/drivers/net/pcnet.c +++ b/drivers/net/pcnet.c @@ -130,7 +130,7 @@ static int pcnet_recv (struct eth_device *dev); static void pcnet_halt (struct eth_device *dev); static int pcnet_probe (struct eth_device *dev, bd_t * bis, int dev_num); -#define PCI_TO_MEM(d,a) pci_phys_to_mem((pci_dev_t)d->priv, (u_long)(a)) +#define PCI_TO_MEM(d, a) pci_virt_to_mem((pci_dev_t)d->priv, (a)) #define PCI_TO_MEM_LE(d,a) (u32)(cpu_to_le32(PCI_TO_MEM(d,a))) static struct pci_device_id supported[] = {