rockchip: rk3399: Add Nanopi M4 2GB board support
[platform/kernel/u-boot.git] / drivers / net / pcnet.c
index d1fd4e4..b4ad11d 100644 (file)
@@ -1,13 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2002 Wolfgang Grandegger, wg@denx.de.
  *
  * This driver for AMD PCnet network controllers is derived from the
  * Linux driver pcnet32.c written 1996-1999 by Thomas Bogendoerfer.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <net.h>
 #include <netdev.h>
@@ -155,6 +155,7 @@ int pcnet_initialize(bd_t *bis)
        struct eth_device *dev;
        u16 command, status;
        int dev_nr = 0;
+       u32 bar;
 
        PCNET_DEBUG1("\npcnet_initialize...\n");
 
@@ -182,9 +183,8 @@ int pcnet_initialize(bd_t *bis)
                /*
                 * Setup the PCI device.
                 */
-               pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_0,
-                                     (unsigned int *)&dev->iobase);
-               dev->iobase = pci_io_to_phys(devbusfn, dev->iobase);
+               pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_0, &bar);
+               dev->iobase = pci_io_to_phys(devbusfn, bar);
                dev->iobase &= ~0xf;
 
                PCNET_DEBUG1("%s: devbusfn=0x%x iobase=0x%lx: ",