diff -Naur ./arch/mips/ar231x/ar2315.c ./arch/mips/ar231x/ar2315.c --- ./arch/mips/ar231x/ar2315.c 2012-01-06 23:54:46.088547779 +0100 +++ ./arch/mips/ar231x/ar2315.c 2012-01-06 23:57:27.117346318 +0100 @@ -367,7 +367,7 @@ .reset_base = AR2315_RESET, .reset_mac = AR2315_RESET_ENET0, .reset_phy = AR2315_RESET_EPHY0, - .phy_base = AR2315_ENET0, + .phy_base = KSEG1ADDR(AR2315_ENET0), .config = &ar231x_board, }; @@ -405,13 +405,13 @@ static inline u32 spiflash_read_reg(int reg) { - return ar231x_read_reg(KSEG1ADDR(AR2315_SPI) + reg); + return ar231x_read_reg(AR2315_SPI + reg); } static inline void spiflash_write_reg(int reg, u32 data) { - ar231x_write_reg(KSEG1ADDR(AR2315_SPI) + reg, data); + ar231x_write_reg(AR2315_SPI + reg, data); } static u32 @@ -540,7 +540,7 @@ ar2315_init_gpio(); platform_device_register(&ar2315_wdt); platform_device_register(&ar2315_spiflash); - ar231x_add_ethernet(0, AR2315_ENET0, AR2315_IRQ_ENET0_INTRS, + ar231x_add_ethernet(0, KSEG1ADDR(AR2315_ENET0), AR2315_IRQ_ENET0_INTRS, &ar2315_eth_data); ar231x_add_wmac(0, AR2315_WLAN0, AR2315_IRQ_WLAN0_INTRS); diff -Naur ./arch/mips/ar231x/board.c ./arch/mips/ar231x/board.c --- ./arch/mips/ar231x/board.c 2012-01-06 23:54:46.088547779 +0100 +++ ./arch/mips/ar231x/board.c 2012-01-06 23:55:30.044765777 +0100 @@ -137,6 +137,7 @@ u8 *bcfg, *rcfg; u8 *board_data; u8 *radio_data; + u8 *mac_addr; u32 offset; ar231x_board.config = NULL; @@ -194,6 +195,12 @@ rcfg_size = BOARD_CONFIG_BUFSZ - offset; memcpy(radio_data, rcfg, rcfg_size); + mac_addr = &radio_data[0x1d * 2]; + if (is_broadcast_ether_addr(mac_addr)) { + printk(KERN_INFO "Radio MAC is blank; using board-data\n"); + memcpy(mac_addr, ar231x_board.config->wlan0_mac, ETH_ALEN); + } + return 0; } diff -Naur ./arch/mips/ar231x/pci.c ./arch/mips/ar231x/pci.c --- ./arch/mips/ar231x/pci.c 2012-01-06 23:54:46.088547779 +0100 +++ ./arch/mips/ar231x/pci.c 2012-01-06 23:55:57.084899837 +0100 @@ -176,7 +176,7 @@ if (ar231x_devtype != DEV_TYPE_AR2315) return -ENODEV; - configspace = (unsigned long) ioremap_nocache(0x80000000, 1*1024*1024); /* Remap PCI config space */ + configspace = (unsigned long) ioremap_nocache(AR2315_PCIEXT, 1*1024*1024); /* Remap PCI config space */ ar231x_pci_controller.io_map_base = (unsigned long) ioremap_nocache(AR531X_MEM_BASE + AR531X_MEM_SIZE, AR531X_IO_SIZE); set_io_port_base(ar231x_pci_controller.io_map_base); /* PCI I/O space */ diff -Naur ./arch/mips/include/asm/mach-ar231x/ar2315_regs.h ./arch/mips/include/asm/mach-ar231x/ar2315_regs.h --- ./arch/mips/include/asm/mach-ar231x/ar2315_regs.h 2012-01-06 23:54:46.112547898 +0100 +++ ./arch/mips/include/asm/mach-ar231x/ar2315_regs.h 2012-01-06 23:58:01.261515613 +0100 @@ -27,14 +27,14 @@ * Address map */ #define AR2315_SPI_READ 0x08000000 /* SPI FLASH */ -#define AR2315_WLAN0 0xB0000000 /* Wireless MMR */ -#define AR2315_PCI 0xB0100000 /* PCI MMR */ -#define AR2315_SDRAMCTL 0xB0300000 /* SDRAM MMR */ -#define AR2315_LOCAL 0xB0400000 /* LOCAL BUS MMR */ -#define AR2315_ENET0 0xB0500000 /* ETHERNET MMR */ -#define AR2315_DSLBASE 0xB1000000 /* RESET CONTROL MMR */ -#define AR2315_UART0 0xB1100003 /* UART MMR */ -#define AR2315_SPI 0xB1300000 /* SPI FLASH MMR */ +#define AR2315_WLAN0 0x10000000 /* Wireless MMR */ +#define AR2315_PCI 0x10100000 /* PCI MMR */ +#define AR2315_SDRAMCTL 0x10300000 /* SDRAM MMR */ +#define AR2315_LOCAL 0x10400000 /* LOCAL BUS MMR */ +#define AR2315_ENET0 0x10500000 /* ETHERNET MMR */ +#define AR2315_DSLBASE 0x11000000 /* RESET CONTROL MMR */ +#define AR2315_UART0 0x11100003 /* UART MMR */ +#define AR2315_SPI 0x11300000 /* SPI FLASH MMR */ #define AR2315_PCIEXT 0x80000000 /* pci external */ /* diff -Naur ./arch/mips/include/asm/mach-ar231x/dma-coherence.h ./arch/mips/include/asm/mach-ar231x/dma-coherence.h --- ./arch/mips/include/asm/mach-ar231x/dma-coherence.h 2012-01-06 23:54:46.112547898 +0100 +++ ./arch/mips/include/asm/mach-ar231x/dma-coherence.h 2012-01-07 00:00:28.458245493 +0100 @@ -12,21 +12,33 @@ #define PCI_DMA_OFFSET 0x20000000 -struct device; +#include + +static inline dma_addr_t ar231x_dev_offset(struct device *dev) +{ +#ifdef CONFIG_PCI + extern struct bus_type pci_bus_type; + + if (dev && dev->bus == &pci_bus_type) + return PCI_DMA_OFFSET; + else +#endif + return 0; +} static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size) { - return virt_to_phys(addr) + (dev != NULL ? PCI_DMA_OFFSET : 0); + return virt_to_phys(addr) + ar231x_dev_offset(dev); } static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page) { - return page_to_phys(page) + (dev != NULL ? PCI_DMA_OFFSET : 0); + return page_to_phys(page) + ar231x_dev_offset(dev); } -static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) +static unsigned long plat_dma_addr_to_phys(struct device *dev, dma_addr_t dma_addr) { - return (dma_addr > PCI_DMA_OFFSET ? dma_addr - PCI_DMA_OFFSET : dma_addr); + return dma_addr - ar231x_dev_offset(dev); } static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) diff -Naur ./arch/mips/mm/dma-default.c ./arch/mips/mm/dma-default.c --- ./arch/mips/mm/dma-default.c 2012-01-06 23:54:46.088547779 +0100 +++ ./arch/mips/mm/dma-default.c 2012-01-07 00:01:41.738608901 +0100 @@ -20,9 +20,9 @@ #include -static inline unsigned long dma_addr_to_virt(dma_addr_t dma_addr) +static inline unsigned long dma_addr_to_virt(struct device *dev, dma_addr_t dma_addr) { - unsigned long addr = plat_dma_addr_to_phys(dma_addr); + unsigned long addr = plat_dma_addr_to_phys(dev, dma_addr); return (unsigned long)phys_to_virt(addr); } @@ -170,7 +170,7 @@ enum dma_data_direction direction) { if (cpu_is_noncoherent_r10000(dev)) - __dma_sync(dma_addr_to_virt(dma_addr), size, + __dma_sync(dma_addr_to_virt(dev, dma_addr), size, direction); plat_unmap_dma_mem(dev, dma_addr); @@ -246,7 +246,7 @@ if (cpu_is_noncoherent_r10000(dev)) { unsigned long addr; - addr = dma_addr_to_virt(dma_handle); + addr = dma_addr_to_virt(dev, dma_handle); __dma_sync(addr, size, direction); } } @@ -262,7 +262,7 @@ if (!plat_device_is_coherent(dev)) { unsigned long addr; - addr = dma_addr_to_virt(dma_handle); + addr = dma_addr_to_virt(dev, dma_handle); __dma_sync(addr, size, direction); } } @@ -277,7 +277,7 @@ if (cpu_is_noncoherent_r10000(dev)) { unsigned long addr; - addr = dma_addr_to_virt(dma_handle); + addr = dma_addr_to_virt(dev, dma_handle); __dma_sync(addr + offset, size, direction); } } @@ -293,7 +293,7 @@ if (!plat_device_is_coherent(dev)) { unsigned long addr; - addr = dma_addr_to_virt(dma_handle); + addr = dma_addr_to_virt(dev, dma_handle); __dma_sync(addr + offset, size, direction); } }