Changeset 3693
- Timestamp:
- 02/07/08 22:56:12 (4 years ago)
- Files:
-
- trunk/freewrt/package/base-files/files/etc/hotplug.d/usb/01-mount (modified) (1 diff)
- trunk/freewrt/package/e2fsprogs/Makefile (modified) (2 diffs)
- trunk/freewrt/rules.mk (modified) (1 diff)
- trunk/freewrt/target/linux/brcm-2.6/Makefile (modified) (1 diff)
- trunk/freewrt/target/linux/brcm-2.6/extra/arch/mips/bcm947xx/prom.c (modified) (1 diff)
- trunk/freewrt/target/linux/brcm-2.6/extra/arch/mips/bcm947xx/setup.c (modified) (6 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/arch/mips/bcm947xx/time.c (modified) (2 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/gpio (deleted)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/leds (deleted)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/Kconfig (modified) (6 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/Makefile (modified) (1 diff)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/b43_pci_bridge.c (deleted)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/driver_chipcommon.c (modified) (11 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/driver_extif.c (deleted)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/driver_mipscore.c (modified) (6 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/driver_pcicore.c (modified) (19 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/main.c (modified) (34 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/pci.c (modified) (13 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/pcmcia.c (modified) (9 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/scan.c (modified) (4 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/ssb_private.h (modified) (4 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/drivers/usb (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/extra/drivers/usb)
- trunk/freewrt/target/linux/brcm-2.6/extra/fs (deleted)
- trunk/freewrt/target/linux/brcm-2.6/extra/include/asm-mips/mach-bcm947xx/gpio.h (modified) (1 diff)
- trunk/freewrt/target/linux/brcm-2.6/extra/include/asm-mips/mach-bcm947xx/war.h (deleted)
- trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/gpio_dev.h (deleted)
- trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/ssb/ssb.h (modified) (11 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/ssb/ssb_driver_chipcommon.h (modified) (4 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/ssb/ssb_driver_extif.h (modified) (2 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/ssb/ssb_driver_mips.h (modified) (4 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/ssb/ssb_driver_pci.h (modified) (2 diffs)
- trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/ssb/ssb_regs.h (modified) (4 diffs)
- trunk/freewrt/target/linux/brcm-2.6/patches/1000-eeprom_93cx6.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1000-eeprom_93cx6.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1001-squashfs.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1001-squashfs.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1002-lzma_decompress.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1002-lzma_decompress.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1003-squashfs_lzma.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1003-squashfs_lzma.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1004-extra_optimization.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1004-extra_optimization.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1006-gcc4_inline_fix.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1006-gcc4_inline_fix.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1007-samsung_flash.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1007-samsung_flash.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1009-revert_intel_flash_breakage.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1009-revert_intel_flash_breakage.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1010-disable_old_squashfs_compatibility.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1010-disable_old_squashfs_compatibility.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1011-mips_boot.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1011-mips_boot.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1012-mips_cpu_tlb.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1012-mips_cpu_tlb.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1013-mips_generic_gpio_support.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1013-mips_generic_gpio_support.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1060-rootfs_split.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1060-rootfs_split.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1065-block2mtd_init.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1065-block2mtd_init.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1100-netfilter_layer7_2.9.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1100-netfilter_layer7_2.9.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1101-netfilter_layer7_pktmatch.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1101-netfilter_layer7_pktmatch.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1110-ipp2p_0.8.1rc1.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1110-ipp2p_0.8.1rc1.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1120-openswan-2.4.0.kernel-2.6-natt.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1120-openswan-2.4.0.kernel-2.6-natt.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1130-netfilter-ipset.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1130-netfilter-ipset.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1140-netfilter_time.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1140-netfilter_time.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1150-netfilter_imq.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1150-netfilter_imq.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1160-netfilter_route.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1160-netfilter_route.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1170-netfilter_chaostables.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1170-netfilter_chaostables.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1180-netfilter_depends.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1180-netfilter_depends.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1200-sched_esfq.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1200-sched_esfq.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1201-multiple_default_gateways.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1201-multiple_default_gateways.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1202-mips-freestanding.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1202-mips-freestanding.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1204-jffs2_eofdetect.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1204-jffs2_eofdetect.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1207-powerpc_asm_segment_h.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1207-powerpc_asm_segment_h.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1208-rtl8110sb_fix.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1208-rtl8110sb_fix.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1209-mini_fo.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1209-mini_fo.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1210-mac80211_include_wireless_dev.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1210-mac80211_include_wireless_dev.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1213-kobject_uevent.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1213-kobject_uevent.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1300-ssb_integrate.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1300-ssb_integrate.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1310-ssb_pcicore_fixes.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1310-ssb_pcicore_fixes.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1510-Yaffs.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1510-Yaffs.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1900-headers_type_and_time.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1900-headers_type_and_time.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1902-darwin_scripts_include.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1902-darwin_scripts_include.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1903-stddef_include.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1903-stddef_include.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/1904-ls_time_locale.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/1904-ls_time_locale.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/2100-board_support.patch (modified) (4 diffs)
- trunk/freewrt/target/linux/brcm-2.6/patches/2110-flash_map.patch (modified) (2 diffs)
- trunk/freewrt/target/linux/brcm-2.6/patches/2120-b44_ssb_support.patch (modified) (70 diffs)
- trunk/freewrt/target/linux/brcm-2.6/patches/2130-remove_scache.patch (modified) (6 diffs)
- trunk/freewrt/target/linux/brcm-2.6/patches/2150-cpu_fixes.patch (modified) (11 diffs)
- trunk/freewrt/target/linux/brcm-2.6/patches/2160-kmap_coherent.patch (modified) (4 diffs)
- trunk/freewrt/target/linux/brcm-2.6/patches/2170-cpu_wait.patch (modified) (1 diff)
- trunk/freewrt/target/linux/brcm-2.6/patches/2200-b44_ssb_fixup.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/2200-b44_ssb_fixup.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/2210-ssb_fixes.patch (modified) (8 diffs)
- trunk/freewrt/target/linux/brcm-2.6/patches/2220-bcm5354.patch (deleted)
- trunk/freewrt/target/linux/brcm-2.6/patches/2225-bcm5354_ssbrev.patch (deleted)
- trunk/freewrt/target/linux/brcm-2.6/patches/2230-ohci-ssb.patch (deleted)
- trunk/freewrt/target/linux/brcm-2.6/patches/2230-ssb_arch_setup.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/2230-ssb_arch_setup.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/2240-extif_fixes.patch (copied) (copied from trunk/freewrt/target/linux/brcm-2.6/patches/2240-extif_fixes.patch)
- trunk/freewrt/target/linux/brcm-2.6/patches/2250-ohci-ssb-usb2.patch (deleted)
- trunk/freewrt/target/linux/brcm-2.6/patches/2260-ohci-set-dma-mask.patch (deleted)
- trunk/freewrt/target/linux/brcm-2.6/patches/2300-fork_cacheflush.patch (deleted)
- trunk/freewrt/target/linux/brcm-2.6/patches/2310-no_highpage.patch (deleted)
- trunk/freewrt/target/linux/brcm-2.6/patches/2400-b43-pci_ssb_bridge.patch (deleted)
- trunk/freewrt/target/linux/brcm-2.6/patches/2410-aec62xx_pci_enable.patch (deleted)
- trunk/freewrt/target/linux/brcm-2.6/patches/2500-lzma_initramfs.patch (deleted)
- trunk/freewrt/target/linux/generic-2.6.24 (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/freewrt/package/base-files/files/etc/hotplug.d/usb/01-mount
r3686 r3693 13 13 path=/mnt/${dev}_${part##*part} 14 14 mkdir -p ${path} 15 [ -x /usr/sbin/fsck ] && /usr/sbin/fsck -a -V /dev/discs/${dev}/${part} >> /var/log/fsck.log 2>&116 15 mount ${part} ${path} 17 16 done trunk/freewrt/package/e2fsprogs/Makefile
r3686 r3693 9 9 PKG_NAME:= e2fsprogs 10 10 PKG_VERSION:= 1.39 11 PKG_RELEASE:= 311 PKG_RELEASE:= 2 12 12 PKG_MD5SUM:= 06f7806782e357797fad1d34b7ced0c6 13 13 MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=e2fsprogs/} … … 34 34 ${INSTALL_DIR} ${IDIR_E2FSPROGS}/usr/lib 35 35 ${INSTALL_DIR} ${IDIR_E2FSPROGS}/usr/sbin 36 ${INSTALL_BIN} ${WRKINST}/usr/sbin/fsck ${IDIR_E2FSPROGS}/usr/sbin/ 37 ${INSTALL_BIN} ${WRKINST}/usr/sbin/fsck.ext2 ${IDIR_E2FSPROGS}/usr/sbin/ 38 ln -s fsck.ext2 ${IDIR_E2FSPROGS}/usr/sbin/fsck.ext3 39 ln -s fsck.ext2 ${IDIR_E2FSPROGS}/usr/sbin/e2fsck 36 ${INSTALL_BIN} ${WRKINST}/usr/sbin/e2fsck ${IDIR_E2FSPROGS}/usr/sbin/ 37 ${INSTALL_BIN} ${WRKINST}/usr/sbin/mke2fs ${IDIR_E2FSPROGS}/usr/sbin/ 40 38 ${INSTALL_BIN} ${WRKINST}/usr/sbin/tune2fs ${IDIR_E2FSPROGS}/usr/sbin/ 41 39 ${CP} ${WRKINST}/usr/lib/lib{blkid,com_err,e2p,ext2fs,uuid}.so.* \ trunk/freewrt/rules.mk
r3686 r3693 86 86 UNAME_R:= 2.6.21.1 87 87 else ifeq ($(strip ${FWRT_LINUX_2_6_BRCM_ASUS_WL500G_PREMIUM}),y) 88 UNAME_R:= 2.6.2 488 UNAME_R:= 2.6.22.1 89 89 else ifeq ($(strip ${FWRT_LINUX_2_4}),y) 90 90 UNAME_R:= 2.4.34 trunk/freewrt/target/linux/brcm-2.6/Makefile
r3686 r3693 1 include ${TOPDIR}/target/linux/generic-2.6.2 4/Makefile1 include ${TOPDIR}/target/linux/generic-2.6.22.1/Makefile trunk/freewrt/target/linux/brcm-2.6/extra/arch/mips/bcm947xx/prom.c
r3691 r3693 42 42 unsigned long mem; 43 43 44 //mips_machgroup = MACH_GROUP_BRCM;44 mips_machgroup = MACH_GROUP_BRCM; 45 45 mips_machtype = MACH_BCM47XX; 46 46 trunk/freewrt/target/linux/brcm-2.6/extra/arch/mips/bcm947xx/setup.c
r3691 r3693 32 32 #include <linux/serial_core.h> 33 33 #include <linux/serial_reg.h> 34 #include <linux/serial_8250.h>35 34 #include <asm/bootinfo.h> 36 35 #include <asm/time.h> … … 56 55 57 56 /* Set the watchdog timer to reset immediately */ 58 ssb_chipco_watchdog _timer_set(&ssb.chipco, 1);57 ssb_chipco_watchdog(&ssb.chipco, 1); 59 58 while (1) 60 59 cpu_relax(); … … 65 64 /* Disable interrupts and watchdog and spin forever */ 66 65 local_irq_disable(); 67 ssb_chipco_watchdog _timer_set(&ssb.chipco, 0);66 ssb_chipco_watchdog(&ssb.chipco, 0); 68 67 while (1) 69 68 cpu_relax(); … … 109 108 } 110 109 111 static int bcm47xx_get_invariants(struct ssb_bus *bus, struct ssb_init_invariants *iv)112 {113 char *s;114 115 // TODO116 //iv->boardinfo.vendor =117 if ((s = nvram_get("boardtype")))118 iv->boardinfo.type = (u16)simple_strtoul(s, NULL, 0);119 if ((s = nvram_get("boardrev")))120 iv->boardinfo.rev = (u16)simple_strtoul(s, NULL, 0);121 bcm47xx_fill_sprom(&iv->sprom);122 return 0;123 }124 125 110 void __init plat_mem_setup(void) 126 111 { … … 129 114 struct ssb_mipscore *mcore; 130 115 131 err = ssb_bus_ssbbus_register(&ssb, SSB_ENUM_BASE, bcm47xx_ get_invariants);116 err = ssb_bus_ssbbus_register(&ssb, SSB_ENUM_BASE, bcm47xx_fill_sprom); 132 117 if (err) { 133 118 const char *msg = "Failed to initialize SSB bus (err %d)\n"; … … 173 158 pm_power_off = bcm47xx_machine_halt; 174 159 160 board_time_init = bcm47xx_time_init;//FIXME move into ssb 175 161 } 176 162 trunk/freewrt/target/linux/brcm-2.6/extra/arch/mips/bcm947xx/time.c
r3692 r3693 36 36 37 37 void __init 38 plat_time_init(void)38 bcm47xx_time_init(void) 39 39 { 40 40 unsigned long hz; … … 55 55 } 56 56 57 //void __init 58 //plat_timer_setup(struct irqaction *irq) 59 //{ 60 // /* Enable the timer interrupt */ 61 // setup_irq(7, irq); 62 // } 63 64 //TODO: remove this function 57 void __init 58 plat_timer_setup(struct irqaction *irq) 59 { 60 /* Enable the timer interrupt */ 61 setup_irq(7, irq); 62 } trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/Kconfig
r3691 r3693 1 1 menu "Sonics Silicon Backplane" 2 3 config SSB_POSSIBLE4 bool5 depends on HAS_IOMEM6 default y7 2 8 3 config SSB 9 4 tristate "Sonics Silicon Backplane support" 10 depends on SSB_POSSIBLE5 depends on EXPERIMENTAL 11 6 help 12 Support for the Sonics Silicon Backplane bus. 13 You only need to enable this option, if you are 14 configuring a kernel for an embedded system with 15 this bus. 16 It will be auto-selected if needed in other 17 environments. 7 Support for the Sonics Silicon Backplane bus 18 8 19 The module will be called ssb .9 The module will be called ssb 20 10 21 If unsure, say N. 22 23 config SSB_PCIHOST_POSSIBLE 24 bool 25 depends on SSB && PCI 26 default y 11 If unsure, say M 27 12 28 13 config SSB_PCIHOST 29 14 bool "Support for SSB on PCI-bus host" 30 depends on SSB _PCIHOST_POSSIBLE15 depends on SSB && PCI 31 16 default y 32 17 help … … 36 21 If unsure, say Y 37 22 38 config SSB_PCMCIAHOST_POSSIBLE39 bool40 depends on SSB && PCMCIA && EXPERIMENTAL41 default y42 43 23 config SSB_PCMCIAHOST 44 bool "Support for SSB on PCMCIA-bus host (EXPERIMENTAL)"45 depends on SSB _PCMCIAHOST_POSSIBLE24 bool "Support for SSB on PCMCIA-bus host" 25 depends on SSB && PCMCIA 46 26 help 47 27 Support for a Sonics Silicon Backplane on top … … 52 32 config SSB_SILENT 53 33 bool "No SSB kernel messages" 54 depends on SSB && EMBEDDED34 depends on SSB 55 35 help 56 36 This option turns off all Sonics Silicon Backplane printks. … … 76 56 # ChipCommon and ExtIf serial support routines. 77 57 78 config SSB_DRIVER_PCICORE_POSSIBLE79 bool80 depends on SSB_PCIHOST81 default y82 83 58 config SSB_DRIVER_PCICORE 84 59 bool "SSB PCI core driver" 85 depends on SSB_DRIVER_PCICORE_POSSIBLE 60 depends on SSB && SSB_PCIHOST 61 default y 86 62 help 87 63 Driver for the Sonics Silicon Backplane attached … … 91 67 92 68 config SSB_PCICORE_HOSTMODE 93 bool "Hostmode support for SSB PCI core (EXPERIMENTAL)"94 depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS && EXPERIMENTAL69 bool "Hostmode support for SSB PCI core" 70 depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS 95 71 help 96 72 PCIcore hostmode operation (external PCI bus). 97 73 98 74 config SSB_DRIVER_MIPS 99 bool "SSB Broadcom MIPS core driver (EXPERIMENTAL)"100 depends on SSB && MIPS && EXPERIMENTAL75 bool "SSB Broadcom MIPS core driver" 76 depends on SSB && MIPS 101 77 select SSB_SERIAL 102 78 help … … 107 83 108 84 config SSB_DRIVER_EXTIF 109 bool "SSB Broadcom EXTIF core driver (EXPERIMENTAL)"110 depends on SSB_DRIVER_MIPS && EXPERIMENTAL85 bool "SSB Broadcom EXTIF core driver" 86 depends on SSB_DRIVER_MIPS 111 87 help 112 88 Driver for the Sonics Silicon Backplane attached trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/Makefile
r3691 r3693 1 # core 2 ssb-y += main.o scan.o 1 ssb-builtin-drivers-y += driver_chipcommon.o 2 ssb-builtin-drivers-$(CONFIG_SSB_DRIVER_MIPS) += driver_mipscore.o 3 ssb-builtin-drivers-$(CONFIG_SSB_DRIVER_PCICORE) += driver_pcicore.o 3 4 4 # host support 5 ssb-$(CONFIG_SSB_PCIHOST) += pci.o pcihost_wrapper.o 6 ssb-$(CONFIG_SSB_PCMCIAHOST) += pcmcia.o 5 ssb-hostsupport-$(CONFIG_SSB_PCIHOST) += pci.o pcihost_wrapper.o 6 ssb-hostsupport-$(CONFIG_SSB_PCMCIAHOST) += pcmcia.o 7 7 8 # built-in drivers 9 ssb-y += driver_chipcommon.o 10 ssb-$(CONFIG_SSB_DRIVER_MIPS) += driver_mipscore.o 11 ssb-$(CONFIG_SSB_DRIVER_EXTIF) += driver_extif.o 12 ssb-$(CONFIG_SSB_DRIVER_PCICORE) += driver_pcicore.o 8 obj-$(CONFIG_SSB) += ssb.o 13 9 14 # b43 pci-ssb-bridge driver 15 # Not strictly a part of SSB, but kept here for convenience 16 ssb-$(CONFIG_SSB_PCIHOST) += b43_pci_bridge.o 17 18 obj-$(CONFIG_SSB) += ssb.o 10 ssb-objs := main.o scan.o \ 11 $(ssb-hostsupport-y) $(ssb-builtin-drivers-y) trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/driver_chipcommon.c
r3691 r3693 17 17 18 18 /* Clock sources */ 19 enum ssb_clksrc{19 enum { 20 20 /* PCI clock */ 21 21 SSB_CHIPCO_CLKSRC_PCI, … … 38 38 { 39 39 ssb_write32(cc->dev, offset, value); 40 }41 42 static inline void chipco_write32_masked(struct ssb_chipcommon *cc, u16 offset,43 u32 mask, u32 value)44 {45 value &= mask;46 value |= chipco_read32(cc, offset) & ~mask;47 chipco_write32(cc, offset, value);48 40 } 49 41 … … 94 86 break; 95 87 default: 96 SSB_WARN_ON(1);88 assert(0); 97 89 } 98 90 } 99 91 100 92 /* Get the Slow Clock Source */ 101 static enum ssb_clksrcchipco_pctl_get_slowclksrc(struct ssb_chipcommon *cc)93 static int chipco_pctl_get_slowclksrc(struct ssb_chipcommon *cc) 102 94 { 103 95 struct ssb_bus *bus = cc->dev->bus; 104 u32 uninitialized_var(tmp);96 u32 tmp = 0; 105 97 106 98 if (cc->dev->id.revision < 6) { … … 132 124 static int chipco_pctl_clockfreqlimit(struct ssb_chipcommon *cc, int get_max) 133 125 { 134 int uninitialized_var(limit);135 enum ssb_clksrcclocksrc;136 int divisor = 1;126 int limit; 127 int clocksrc; 128 int divisor; 137 129 u32 tmp; 138 130 … … 147 139 break; 148 140 default: 149 SSB_WARN_ON(1); 141 assert(0); 142 divisor = 1; 150 143 } 151 144 } else if (cc->dev->id.revision < 10) { 152 145 switch (clocksrc) { 153 146 case SSB_CHIPCO_CLKSRC_LOPWROS: 147 divisor = 1; 154 148 break; 155 149 case SSB_CHIPCO_CLKSRC_XTALOS: … … 159 153 divisor *= 4; 160 154 break; 155 default: 156 assert(0); 157 divisor = 1; 161 158 } 162 159 } else { … … 185 182 limit = 25000000; 186 183 break; 184 default: 185 assert(0); 186 limit = 0; 187 187 } 188 188 limit /= divisor; … … 236 236 pll_on_delay = chipco_read32(cc, SSB_CHIPCO_PLLONDELAY); 237 237 tmp = (((pll_on_delay + 2) * 1000000) + (minfreq - 1)) / minfreq; 238 SSB_WARN_ON(tmp & ~0xFFFF);238 assert((tmp & ~0xFFFF) == 0); 239 239 240 240 cc->fast_pwrup_delay = tmp; … … 265 265 } 266 266 267 /* Get the processor clock */268 void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc,269 u32 *plltype, u32 *n, u32 *m)270 {271 *n = chipco_read32(cc, SSB_CHIPCO_CLOCK_N);272 *plltype = (cc->capabilities & SSB_CHIPCO_CAP_PLLT);273 switch (*plltype) {274 case SSB_PLLTYPE_2:275 case SSB_PLLTYPE_4:276 case SSB_PLLTYPE_6:277 case SSB_PLLTYPE_7:278 *m = chipco_read32(cc, SSB_CHIPCO_CLOCK_MIPS);279 break;280 case SSB_PLLTYPE_3:281 /* 5350 uses m2 to control mips */282 *m = chipco_read32(cc, SSB_CHIPCO_CLOCK_M2);283 break;284 default:285 *m = chipco_read32(cc, SSB_CHIPCO_CLOCK_SB);286 break;287 }288 }289 290 /* Get the bus clock */291 267 void ssb_chipco_get_clockcontrol(struct ssb_chipcommon *cc, 292 268 u32 *plltype, u32 *n, u32 *m) … … 343 319 chipco_write32(cc, SSB_CHIPCO_PROG_WAITCNT, tmp); /* 0x01020a0c for a 100Mhz clock */ 344 320 } 345 }346 347 /* Set chip watchdog reset timer to fire in 'ticks' backplane cycles */348 void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, u32 ticks)349 {350 /* instant NMI */351 chipco_write32(cc, SSB_CHIPCO_WATCHDOG, ticks);352 321 } 353 322 … … 384 353 /* Internal backplane clock */ 385 354 baud_base = ssb_clockspeed(bus); 386 div = chipco_read32(cc, SSB_CHIPCO_CLKDIV) 387 & SSB_CHIPCO_CLKDIV_UART; 355 div = 2; /* Minimum divisor */ 356 chipco_write32(cc, SSB_CHIPCO_CLKDIV, 357 (chipco_read32(cc, SSB_CHIPCO_CLKDIV) 358 & ~SSB_CHIPCO_CLKDIV_UART) | div); 388 359 } else { 389 360 /* Fixed internal backplane clock */ trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/driver_mipscore.c
r3691 r3693 14 14 #include <linux/serial_core.h> 15 15 #include <linux/serial_reg.h> 16 #include < linux/time.h>16 #include <asm/time.h> 17 17 18 18 #include "ssb_private.h" … … 118 118 } 119 119 120 /* XXX: leave here or move into separate extif driver? */ 121 static int ssb_extif_serial_init(struct ssb_device *dev, struct ssb_serial_ports *ports) 122 { 123 124 } 125 126 120 127 static void ssb_mips_serial_init(struct ssb_mipscore *mcore) 121 128 { 122 129 struct ssb_bus *bus = mcore->dev->bus; 123 130 131 //TODO if (EXTIF available 132 #if 0 133 extifregs_t *eir = (extifregs_t *) regs; 134 sbconfig_t *sb; 135 136 /* Determine external UART register base */ 137 sb = (sbconfig_t *)((ulong) eir + SBCONFIGOFF); 138 base = EXTIF_CFGIF_BASE(sb_base(R_REG(&sb->sbadmatch1))); 139 140 /* Determine IRQ */ 141 irq = sb_irq(sbh); 142 143 /* Disable GPIO interrupt initially */ 144 W_REG(&eir->gpiointpolarity, 0); 145 W_REG(&eir->gpiointmask, 0); 146 147 /* Search for external UARTs */ 148 n = 2; 149 for (i = 0; i < 2; i++) { 150 regs = (void *) REG_MAP(base + (i * 8), 8); 151 if (BCMINIT(serial_exists)(regs)) { 152 /* Set GPIO 1 to be the external UART IRQ */ 153 W_REG(&eir->gpiointmask, 2); 154 if (add) 155 add(regs, irq, 13500000, 0); 156 } 157 } 158 159 /* Add internal UART if enabled */ 160 if (R_REG(&eir->corecontrol) & CC_UE) 161 if (add) 162 add((void *) &eir->uartdata, irq, sb_clock(sbh), 2); 163 164 #endif 124 165 if (bus->extif.dev) 125 166 mcore->nr_serial_ports = ssb_extif_serial_init(&bus->extif, mcore->serial_ports); … … 134 175 struct ssb_bus *bus = mcore->dev->bus; 135 176 136 mcore->flash_buswidth = 2;137 177 if (bus->chipco.dev) { 138 178 mcore->flash_window = 0x1c000000; 139 mcore->flash_window_size = 0x02000000; 140 if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG) 141 & SSB_CHIPCO_CFG_DS16) == 0) 142 mcore->flash_buswidth = 1; 179 mcore->flash_window_size = 0x800000; 143 180 } else { 144 181 mcore->flash_window = 0x1fc00000; 145 mcore->flash_window_size = 0x00400000; 146 } 147 } 148 149 u32 ssb_cpu_clock(struct ssb_mipscore *mcore) 182 mcore->flash_window_size = 0x400000; 183 } 184 } 185 186 187 static void ssb_cpu_clock(struct ssb_mipscore *mcore) 188 { 189 } 190 191 void ssb_mipscore_init(struct ssb_mipscore *mcore) 150 192 { 151 193 struct ssb_bus *bus = mcore->dev->bus; 152 u32 pll_type, n, m, rate = 0;153 154 if (bus->extif.dev) {155 ssb_extif_get_clockcontrol(&bus->extif, &pll_type, &n, &m);156 } else if (bus->chipco.dev) {157 ssb_chipco_get_clockcpu(&bus->chipco, &pll_type, &n, &m);158 } else159 return 0;160 161 if ((pll_type == SSB_PLLTYPE_5) || (bus->chip_id == 0x5365)) {162 rate = 200000000;163 } else {164 rate = ssb_calc_clock_rate(pll_type, n, m);165 }166 167 if (pll_type == SSB_PLLTYPE_6) {168 rate *= 2;169 }170 171 return rate;172 }173 174 void ssb_mipscore_init(struct ssb_mipscore *mcore)175 {176 struct ssb_bus *bus;177 194 struct ssb_device *dev; 178 195 unsigned long hz, ns; … … 184 201 ssb_dprintk(KERN_INFO PFX "Initializing MIPS core...\n"); 185 202 186 bus = mcore->dev->bus;187 203 hz = ssb_clockspeed(bus); 188 204 if (!hz) … … 190 206 ns = 1000000000 / hz; 191 207 192 if (bus->extif.dev) 193 ssb_extif_timing_init(&bus->extif, ns); 194 else if (bus->chipco.dev) 208 //TODO 209 #if 0 210 if (have EXTIF) { 211 /* Initialize extif so we can get to the LEDs and external UART */ 212 W_REG(&eir->prog_config, CF_EN); 213 214 /* Set timing for the flash */ 215 tmp = CEIL(10, ns) << FW_W3_SHIFT; /* W3 = 10nS */ 216 tmp = tmp | (CEIL(40, ns) << FW_W1_SHIFT); /* W1 = 40nS */ 217 tmp = tmp | CEIL(120, ns); /* W0 = 120nS */ 218 W_REG(&eir->prog_waitcount, tmp); /* 0x01020a0c for a 100Mhz clock */ 219 220 /* Set programmable interface timing for external uart */ 221 tmp = CEIL(10, ns) << FW_W3_SHIFT; /* W3 = 10nS */ 222 tmp = tmp | (CEIL(20, ns) << FW_W2_SHIFT); /* W2 = 20nS */ 223 tmp = tmp | (CEIL(100, ns) << FW_W1_SHIFT); /* W1 = 100nS */ 224 tmp = tmp | CEIL(120, ns); /* W0 = 120nS */ 225 W_REG(&eir->prog_waitcount, tmp); 226 } 227 else... chipcommon 228 #endif 229 if (bus->chipco.dev) 195 230 ssb_chipco_timing_init(&bus->chipco, ns); 196 231 … … 199 234 dev = &(bus->devices[i]); 200 235 dev->irq = ssb_mips_irq(dev) + 2; 201 switch (dev->id.coreid) { 202 case SSB_DEV_USB11_HOST: 203 /* shouldn't need a separate irq line for non-4710, most of them have a proper 204 * external usb controller on the pci */ 205 if ((bus->chip_id == 0x4710) && (irq <= 4)) { 206 set_irq(dev, irq++); 207 break; 208 } 209 /* fallthrough */ 210 case SSB_DEV_PCI: 211 case SSB_DEV_ETHERNET: 212 case SSB_DEV_80211: 213 case SSB_DEV_USB20_HOST: 214 /* These devices get their own IRQ line if available, the rest goes on IRQ0 */ 215 if (irq <= 4) { 216 set_irq(dev, irq++); 217 break; 218 } 236 switch(dev->id.coreid) { 237 case SSB_DEV_USB11_HOST: 238 /* shouldn't need a separate irq line for non-4710, most of them have a proper 239 * external usb controller on the pci */ 240 if ((bus->chip_id == 0x4710) && (irq <= 4)) { 241 set_irq(dev, irq++); 242 break; 243 } 244 case SSB_DEV_PCI: 245 case SSB_DEV_ETHERNET: 246 case SSB_DEV_80211: 247 case SSB_DEV_USB20_HOST: 248 /* These devices get their own IRQ line if available, the rest goes on IRQ0 */ 249 if (irq <= 4) { 250 set_irq(dev, irq++); 251 break; 252 } 219 253 } 220 254 } trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/driver_pcicore.c
r3691 r3693 35 35 36 36 #include <asm/paccess.h> 37 /* Probe a 32bit value on the bus and catch bus exceptions. 38 * Returns nonzero on a bus exception. 39 * This is MIPS specific */ 40 #define mips_busprobe32(val, addr) get_dbe((val), ((u32 *)(addr))) 37 /* Read the bus and catch bus exceptions. This is MIPS specific. */ 38 #define mips_busprobe(val, addr) get_dbe((val), (addr)) 41 39 42 40 /* Assume one-hot slot wiring */ … … 48 46 static struct ssb_pcicore *extpci_core; 49 47 50 static u32 ssb_pcicore_pcibus_iobase = 0x100;51 static u32 ssb_pcicore_pcibus_membase = SSB_PCI_DMA;48 u32 pci_iobase = 0x100; 49 u32 pci_membase = SSB_PCI_DMA; 52 50 53 51 int pcibios_plat_dev_init(struct pci_dev *d) … … 57 55 u32 *base; 58 56 59 ssb_printk(KERN_INFO "PCI: Fixing up device %s\n", 60 pci_name(d)); 57 printk("PCI: Fixing up device %s\n", pci_name(d)); 61 58 62 59 /* Fix up resource bases */ 63 60 for (pos = 0; pos < 6; pos++) { 64 61 res = &d->resource[pos]; 65 if (res->flags & IORESOURCE_IO) 66 base = &ssb_pcicore_pcibus_iobase; 67 else 68 base = &ssb_pcicore_pcibus_membase; 62 base = ((res->flags & IORESOURCE_IO) ? &pci_iobase : &pci_membase); 69 63 if (res->end) { 70 64 size = res->end - res->start + 1; … … 92 86 return; 93 87 94 ssb_printk(KERN_INFO"PCI: fixing up bridge\n");88 printk("PCI: fixing up bridge\n"); 95 89 96 90 /* Enable PCI bridge bus mastering and memory space */ … … 100 94 /* Enable PCI bridge BAR1 prefetch and burst */ 101 95 pci_write_config_dword(dev, SSB_BAR1_CONTROL, 3); 102 103 /* Make sure our latency is high enough to handle the devices behind us */104 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0xa8);105 96 } 106 97 DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, ssb_fixup_pcibridge); 107 98 108 int __init pcibios_map_irq( conststruct pci_dev *dev, u8 slot, u8 pin)99 int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 109 100 { 110 101 return ssb_mips_irq(extpci_core->dev) + 2; … … 157 148 void __iomem *mmio; 158 149 159 SSB_WARN_ON(!pc->hostmode);150 assert(pc->hostmode); 160 151 if (unlikely(len != 1 && len != 2 && len != 4)) 161 152 goto out; … … 168 159 goto out; 169 160 170 if (mips_busprobe 32(val,mmio)) {161 if (mips_busprobe(val, (u32 *) mmio)) { 171 162 val = 0xffffffff; 172 163 goto unmap; … … 203 194 void __iomem *mmio; 204 195 205 SSB_WARN_ON(!pc->hostmode);196 assert(pc->hostmode); 206 197 if (unlikely(len != 1 && len != 2 && len != 4)) 207 198 goto out; … … 214 205 goto out; 215 206 216 if (mips_busprobe 32(val,mmio)) {207 if (mips_busprobe(val, (u32 *) mmio)) { 217 208 val = 0xffffffff; 218 209 goto unmap; … … 234 225 break; 235 226 } 236 writel( val, mmio);227 writel(*((const u32 *)buf), mmio); 237 228 238 229 err = 0; … … 279 270 .name = "SSB PCIcore external memory", 280 271 .start = SSB_PCI_DMA, 281 .end = SSB_PCI_DMA +SSB_PCI_DMA_SZ - 1,272 .end = (u32)SSB_PCI_DMA + (u32)SSB_PCI_DMA_SZ - 1, 282 273 .flags = IORESOURCE_MEM, 283 274 }; … … 301 292 u32 val; 302 293 303 if (WARN_ON(extpci_core)) 294 if (extpci_core) { 295 WARN_ON(1); 304 296 return; 297 } 305 298 extpci_core = pc; 306 299 … … 312 305 val |= SSB_PCICORE_CTL_CLK; /* Clock on */ 313 306 pcicore_write32(pc, SSB_PCICORE_CTL, val); 314 udelay(150); /* Assertion time demanded by the PCI standard */307 udelay(150); 315 308 val |= SSB_PCICORE_CTL_RST; /* Deassert RST# */ 316 309 pcicore_write32(pc, SSB_PCICORE_CTL, val); 317 val = SSB_PCICORE_ARBCTL_INTERN; 318 pcicore_write32(pc, SSB_PCICORE_ARBCTL, val); 319 udelay(1); /* Assertion time demanded by the PCI standard */ 320 321 /*TODO cardbus mode */ 310 udelay(1); 311 312 //TODO cardbus mode 322 313 323 314 /* 64MB I/O window */ … … 346 337 * to non-MIPS platform. */ 347 338 set_io_port_base((unsigned long)ioremap_nocache(SSB_PCI_MEM, 0x04000000)); 348 /* Give some time to the PCI controller to configure itself with the new349 * values. Not waiting at this point causes crashes of the machine. */350 mdelay(10);351 339 register_pci_controller(&ssb_pcicore_controller); 352 340 } … … 377 365 return 0; 378 366 379 return !mips_busprobe 32(tmp,(bus->mmio + (pc->dev->core_index * SSB_CORE_SIZE)));367 return !mips_busprobe(tmp, (u32 *) (bus->mmio + (pc->dev->core_index * SSB_CORE_SIZE))); 380 368 } 381 369 #endif /* CONFIG_SSB_PCICORE_HOSTMODE */ … … 443 431 v |= data; 444 432 pcicore_write32(pc, mdio_data, v); 445 /* Wait for the device to complete the transaction */446 433 udelay(10); 447 434 for (i = 0; i < 10; i++) { … … 472 459 473 460 dev = bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev; 474 if (WARN_ON(!dev)) 475 return; 461 assert(dev); 476 462 /* This forces an update of the cached registers. */ 477 463 ssb_broadcast_value(dev, 0xFD8, 0); … … 511 497 512 498 intvec = ssb_read32(pdev, SSB_INTVEC); 513 if ((bus->chip_id & 0xFF00) == 0x4400) { 514 /* Workaround: On the BCM44XX the BPFLAG routing 515 * bit is wrong. Use a hardcoded constant. */ 516 intvec |= 0x00000002; 517 } else { 518 tmp = ssb_read32(dev, SSB_TPSFLAG); 519 tmp &= SSB_TPSFLAG_BPFLAG; 520 intvec |= tmp; 521 } 499 tmp = ssb_read32(dev, SSB_TPSFLAG); 500 tmp &= SSB_TPSFLAG_BPFLAG; 501 intvec |= tmp; 522 502 ssb_write32(pdev, SSB_INTVEC, intvec); 523 503 } … … 546 526 } 547 527 } else { 548 WARN_ON(pdev->id.coreid != SSB_DEV_PCIE);528 assert(pdev->id.coreid == SSB_DEV_PCIE); 549 529 //TODO: Better make defines for all these magic PCIE values. 550 530 if ((pdev->id.revision == 0) || (pdev->id.revision == 1)) { trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/main.c
r3691 r3693 14 14 #include <linux/ssb/ssb.h> 15 15 #include <linux/ssb/ssb_regs.h> 16 #include <linux/dma-mapping.h> 17 #include <linux/pci.h> 18 19 #include <pcmcia/cs_types.h> 20 #include <pcmcia/cs.h> 21 #include <pcmcia/cistpl.h> 22 #include <pcmcia/ds.h> 16 17 #ifdef CONFIG_SSB_PCIHOST 18 # include <linux/pci.h> 19 #endif 20 21 #ifdef CONFIG_SSB_PCMCIAHOST 22 # include <pcmcia/cs_types.h> 23 # include <pcmcia/cs.h> 24 # include <pcmcia/cistpl.h> 25 # include <pcmcia/ds.h> 26 #endif 23 27 24 28 … … 27 31 28 32 29 /* Temporary list of yet-to-be-attached buses */30 33 static LIST_HEAD(attach_queue); 31 /* List if running buses */32 34 static LIST_HEAD(buses); 33 /* Software ID counter */34 35 static unsigned int next_busnumber; 35 /* buses_mutes locks the two buslists and the next_busnumber.36 * Don't lock this directly, but use ssb_buses_[un]lock() below. */37 36 static DEFINE_MUTEX(buses_mutex); 38 39 /* There are differences in the codeflow, if the bus is40 * initialized from early boot, as various needed services41 * are not available early. This is a mechanism to delay42 * these initializations to after early boot has finished.43 * It's also used to avoid mutex locking, as that's not44 * available and needed early. */45 static bool ssb_is_early_boot = 1;46 37 47 38 static void ssb_buses_lock(void); … … 50 41 51 42 #ifdef CONFIG_SSB_PCIHOST 52 struct ssb_bus * ssb_pci_dev_to_bus(struct pci_dev *pdev)43 struct ssb_bus * ssb_pci_dev_to_bus(struct pci_dev *pdev) 53 44 { 54 45 struct ssb_bus *bus; … … 68 59 #endif /* CONFIG_SSB_PCIHOST */ 69 60 70 static struct ssb_device * ssb_device_get(struct ssb_device *dev)61 static struct ssb_device * ssb_device_get(struct ssb_device *dev) 71 62 { 72 63 if (dev) … … 132 123 bus->pcicore.setup_done = 0; 133 124 #endif 134 #ifdef CONFIG_SSB_DEBUG135 bus->powered_up = 0;136 #endif137 125 } 138 126 … … 172 160 pm_message_t state = PMSG_FREEZE; 173 161 174 /* First check that we are capable to freeze all devices. */175 162 for (i = 0; i < bus->nr_devices; i++) { 176 163 dev = &(bus->devices[i]); 177 if (!dev->dev ||178 !dev->dev->driver ||179 !device_is_registered(dev->dev))164 if (!dev->dev->driver) 165 continue; 166 if (!device_is_registered(dev->dev)) 180 167 continue; 181 168 drv = drv_to_ssb_drv(dev->dev->driver); 182 if (!drv) 183 continue; 184 if (!drv->suspend) { 185 /* Nope, can't suspend this one. */ 186 return -EOPNOTSUPP; 169 if (drv && drv->suspend) { 170 err = drv->suspend(dev, state); 171 if (err) 172 goto out; 187 173 } 188 174 } 189 /* Now suspend all devices */ 175 out: 176 return err; 177 } 178 179 int ssb_devices_thaw(struct ssb_bus *bus) 180 { 181 struct ssb_device *dev; 182 struct ssb_driver *drv; 183 int err = 0; 184 int i; 185 190 186 for (i = 0; i < bus->nr_devices; i++) { 191 187 dev = &(bus->devices[i]); 192 if (!dev->dev ||193 !dev->dev->driver ||194 !device_is_registered(dev->dev))188 if (!dev->dev->driver) 189 continue; 190 if (!device_is_registered(dev->dev)) 195 191 continue; 196 192 drv = drv_to_ssb_drv(dev->dev->driver); 197 if (!drv) 198 continue; 199 err = drv->suspend(dev, state); 200 if (err) { 201 ssb_printk(KERN_ERR PFX "Failed to freeze device %s\n", 202 dev->dev->bus_id); 203 goto err_unwind; 193 if (drv && drv->resume) { 194 err = drv->resume(dev); 195 if (err) 196 goto out; 204 197 } 205 198 } 206 207 return 0; 208 err_unwind: 209 for (i--; i >= 0; i--) { 210 dev = &(bus->devices[i]); 211 if (!dev->dev || 212 !dev->dev->driver || 213 !device_is_registered(dev->dev)) 214 continue; 215 drv = drv_to_ssb_drv(dev->dev->driver); 216 if (!drv) 217 continue; 218 if (drv->resume) 219 drv->resume(dev); 220 } 221 return err; 222 } 223 224 int ssb_devices_thaw(struct ssb_bus *bus) 225 { 226 struct ssb_device *dev; 227 struct ssb_driver *drv; 228 int err; 229 int i; 230 231 for (i = 0; i < bus->nr_devices; i++) { 232 dev = &(bus->devices[i]); 233 if (!dev->dev || 234 !dev->dev->driver || 235 !device_is_registered(dev->dev)) 236 continue; 237 drv = drv_to_ssb_drv(dev->dev->driver); 238 if (!drv) 239 continue; 240 if (SSB_WARN_ON(!drv->resume)) 241 continue; 242 err = drv->resume(dev); 243 if (err) { 244 ssb_printk(KERN_ERR PFX "Failed to thaw device %s\n", 245 dev->dev->bus_id); 246 } 247 } 248 249 return 0; 199 out: 200 return err; 250 201 } 251 202 #endif /* CONFIG_SSB_PCIHOST */ … … 321 272 } 322 273 323 static int ssb_device_uevent(struct device *dev, char **envp, int num_envp,324 char *buffer, int buffer_size)325 {326 struct ssb_device *ssb_dev = dev_to_ssb_dev(dev);327 int ret, i = 0, length = 0;328 329 if (!dev)330 return -ENODEV;331 332 ret = add_uevent_var(envp, num_envp, &i,333 buffer, buffer_size, &length,334 "MODALIAS=ssb:v%04Xid%04Xrev%02X",335 ssb_dev->id.vendor, ssb_dev->id.coreid,336 ssb_dev->id.revision);337 envp[i] = NULL;338 339 return ret;340 }341 342 274 static struct bus_type ssb_bustype = { 343 .name = "ssb",275 .name = NULL, /* Intentionally NULL to indicate early boot */ 344 276 .match = ssb_bus_match, 345 277 .probe = ssb_device_probe, … … 348 280 .suspend = ssb_device_suspend, 349 281 .resume = ssb_device_resume, 350 .uevent = ssb_device_uevent,351 282 }; 352 283 284 #define is_early_boot() (ssb_bustype.name == NULL) 285 353 286 static void ssb_buses_lock(void) 354 287 { 355 /* See the comment at the ssb_is_early_boot definition */ 356 if (!ssb_is_early_boot) 288 if (!is_early_boot()) 357 289 mutex_lock(&buses_mutex); 358 290 } … … 360 292 static void ssb_buses_unlock(void) 361 293 { 362 /* See the comment at the ssb_is_early_boot definition */ 363 if (!ssb_is_early_boot) 294 if (!is_early_boot()) 364 295 mutex_unlock(&buses_mutex); 365 296 } … … 491 422 * (no udelay() available). So do it here in attach stage. 492 423 */ 493 err = ssb_bus_powerup(bus, 0);494 if (err)495 goto error;496 424 ssb_pcicore_init(&bus->pcicore); 497 ssb_bus_may_powerdown(bus);498 425 499 426 err = ssb_devices_register(bus); 500 error:501 427 if (err) { 502 428 drop_them_all = 1; … … 542 468 } 543 469 544 /* Ops for the plain SSB bus without a host-device (no PCI or PCMCIA). */545 470 static const struct ssb_bus_ops ssb_ssb_ops = { 546 471 .read16 = ssb_ssb_read16, … … 551 476 552 477 static int ssb_fetch_invariants(struct ssb_bus *bus, 553 ssb_invariants_func_t get_invariants) 478 int (*get_invariants)(struct ssb_bus *bus, 479 struct ssb_init_invariants *iv)) 554 480 { 555 481 struct ssb_init_invariants iv; … … 567 493 568 494 static int ssb_bus_register(struct ssb_bus *bus, 569 ssb_invariants_func_t get_invariants, 495 int (*get_invariants)(struct ssb_bus *bus, 496 struct ssb_init_invariants *iv), 570 497 unsigned long baseaddr) 571 498 { … … 596 523 597 524 /* Initialize basic system devices (if available) */ 598 err = ssb_bus_powerup(bus, 0);599 if (err)600 goto err_pcmcia_exit;601 525 ssb_chipcommon_init(&bus->chipco); 602 526 ssb_mipscore_init(&bus->mipscore); 603 527 err = ssb_fetch_invariants(bus, get_invariants); 604 if (err) { 605 ssb_bus_may_powerdown(bus); 528 if (err) 606 529 goto err_pcmcia_exit; 607 } 608 ssb_bus_may_powerdown(bus); 609 610 /* Queue it for attach. 611 * See the comment at the ssb_is_early_boot definition. */ 530 531 /* Queue it for attach */ 612 532 list_add_tail(&bus->list, &attach_queue); 613 if (! ssb_is_early_boot) {533 if (!is_early_boot()) { 614 534 /* This is not early boot, so we must attach the bus now */ 615 535 err = ssb_attach_queued_buses(); … … 682 602 int ssb_bus_ssbbus_register(struct ssb_bus *bus, 683 603 unsigned long baseaddr, 684 ssb_invariants_func_t get_invariants) 604 int (*get_invariants)(struct ssb_bus *bus, 605 struct ssb_init_invariants *iv)) 685 606 { 686 607 int err; … … 775 696 n1 += SSB_CHIPCO_CLK_T2_BIAS; 776 697 n2 += SSB_CHIPCO_CLK_T2_BIAS; 777 SSB_WARN_ON(!((n1 >= 2) && (n1 <= 7)));778 SSB_WARN_ON(!((n2 >= 5) && (n2 <= 23)));698 assert((n1 >= 2) && (n1 <= 7)); 699 assert((n2 >= 5) && (n2 <= 23)); 779 700 break; 780 701 case SSB_PLLTYPE_5: /* 25Mhz, 4 dividers */ 781 702 return 100000000; 782 703 default: 783 SSB_WARN_ON(1);704 assert(0); 784 705 } 785 706 … … 830 751 m2 += SSB_CHIPCO_CLK_T2M2_BIAS; 831 752 m3 += SSB_CHIPCO_CLK_T2_BIAS; 832 SSB_WARN_ON(!((m1 >= 2) && (m1 <= 7)));833 SSB_WARN_ON(!((m2 >= 3) && (m2 <= 10)));834 SSB_WARN_ON(!((m3 >= 2) && (m3 <= 7)));753 assert((m1 >= 2) && (m1 <= 7)); 754 assert((m2 >= 3) && (m2 <= 10)); 755 assert((m3 >= 2) && (m3 <= 7)); 835 756 836 757 if (!(mc & SSB_CHIPCO_CLK_T2MC_M1BYP)) … … 842 763 return clock; 843 764 default: 844 SSB_WARN_ON(1);765 assert(0); 845 766 } 846 767 return 0; … … 854 775 u32 clkctl_n, clkctl_m; 855 776 856 if (ssb_extif_available(&bus->extif)) 857 ssb_extif_get_clockcontrol(&bus->extif, &plltype, 858 &clkctl_n, &clkctl_m); 859 else if (bus->chipco.dev) 777 //TODO if EXTIF: PLLTYPE == 1, read n from clockcontrol_n, m from clockcontrol_sb 778 779 if (bus->chipco.dev) { 860 780 ssb_chipco_get_clockcontrol(&bus->chipco, &plltype, 861 781 &clkctl_n, &clkctl_m); 862 else782 } else 863 783 return 0; 864 784 … … 885 805 return SSB_TMSLOW_REJECT_23; 886 806 default: 887 WARN_ON(1);807 assert(0); 888 808 } 889 809 return (SSB_TMSLOW_REJECT_22 | SSB_TMSLOW_REJECT_23); … … 902 822 } 903 823 EXPORT_SYMBOL(ssb_device_is_enabled); 904 905 static void ssb_flush_tmslow(struct ssb_device *dev)906 {907 /* Make _really_ sure the device has finished the TMSLOW908 * register write transaction, as we risk running into909 * a machine check exception otherwise.910 * Do this by reading the register back to commit the911 * PCI write and delay an additional usec for the device912 * to react to the change. */913 ssb_read32(dev, SSB_TMSLOW);914 udelay(1);915 }916 824 917 825 void ssb_device_enable(struct ssb_device *dev, u32 core_specific_flags) … … 923 831 SSB_TMSLOW_RESET | SSB_TMSLOW_CLOCK | 924 832 SSB_TMSLOW_FGC | core_specific_flags); 925 ssb_flush_tmslow(dev); 833 /* flush */ 834 ssb_read32(dev, SSB_TMSLOW); 835 udelay(1); 926 836 927 837 /* Clear SERR if set. This is a hw bug workaround. */ … … 938 848 SSB_TMSLOW_CLOCK | SSB_TMSLOW_FGC | 939 849 core_specific_flags); 940 ssb_flush_tmslow(dev); 850 /* flush */ 851 ssb_read32(dev, SSB_TMSLOW); 852 udelay(1); 941 853 942 854 ssb_write32(dev, SSB_TMSLOW, SSB_TMSLOW_CLOCK | 943 855 core_specific_flags); 944 ssb_flush_tmslow(dev); 856 /* flush */ 857 ssb_read32(dev, SSB_TMSLOW); 858 udelay(1); 945 859 } 946 860 EXPORT_SYMBOL(ssb_device_enable); 947 861 948 /* Wait for a bit in a register to get set or unset.949 * timeout is in units of ten-microseconds */950 862 static int ssb_wait_bit(struct ssb_device *dev, u16 reg, u32 bitmask, 951 863 int timeout, int set) … … 987 899 reject | SSB_TMSLOW_RESET | 988 900 core_specific_flags); 989 ssb_flush_tmslow(dev); 901 /* flush */ 902 ssb_read32(dev, SSB_TMSLOW); 903 udelay(1); 990 904 991 905 ssb_write32(dev, SSB_TMSLOW, 992 906 reject | SSB_TMSLOW_RESET | 993 907 core_specific_flags); 994 ssb_flush_tmslow(dev); 908 /* flush */ 909 ssb_read32(dev, SSB_TMSLOW); 910 udelay(1); 995 911 } 996 912 EXPORT_SYMBOL(ssb_device_disable); … … 998 914 u32 ssb_dma_translation(struct ssb_device *dev) 999 915 { 1000 switch (dev->bus->bustype) {916 switch(dev->bus->bustype) { 1001 917 case SSB_BUSTYPE_SSB: 1002 918 return 0; … … 1028 944 { 1029 945 struct ssb_chipcommon *cc; 1030 int err = 0;946 int err; 1031 947 1032 948 /* On buses where more than one core may be working … … 1034 950 * still cores that may want to run. */ 1035 951 if (bus->bustype == SSB_BUSTYPE_SSB) 1036 goto out;952 return 0; 1037 953 1038 954 cc = &bus->chipco; … … 1041 957 if (err) 1042 958 goto error; 1043 out: 1044 #ifdef CONFIG_SSB_DEBUG 1045 bus->powered_up = 0; 1046 #endif 1047 return err; 959 960 return 0; 1048 961 error: 1049 962 ssb_printk(KERN_ERR PFX "Bus powerdown failed\n"); 1050 goto out;963 return err; 1051 964 } 1052 965 EXPORT_SYMBOL(ssb_bus_may_powerdown); 1053 966 1054 int ssb_bus_powerup(struct ssb_bus *bus, booldynamic_pctl)967 int ssb_bus_powerup(struct ssb_bus *bus, int dynamic_pctl) 1055 968 { 1056 969 struct ssb_chipcommon *cc; … … 1065 978 ssb_chipco_set_clockmode(cc, mode); 1066 979 1067 #ifdef CONFIG_SSB_DEBUG1068 bus->powered_up = 1;1069 #endif1070 980 return 0; 1071 981 error: … … 1084 994 break; 1085 995 case SSB_ADM_TYPE1: 1086 SSB_WARN_ON(adm & SSB_ADM_NEG); /* unsupported */996 assert(!(adm & SSB_ADM_NEG)); /* unsupported */ 1087 997 base = (adm & SSB_ADM_BASE1); 1088 998 break; 1089 999 case SSB_ADM_TYPE2: 1090 SSB_WARN_ON(adm & SSB_ADM_NEG); /* unsupported */1000 assert(!(adm & SSB_ADM_NEG)); /* unsupported */ 1091 1001 base = (adm & SSB_ADM_BASE2); 1092 1002 break; 1093 1003 default: 1094 SSB_WARN_ON(1);1004 assert(0); 1095 1005 } 1096 1006 … … 1108 1018 break; 1109 1019 case SSB_ADM_TYPE1: 1110 SSB_WARN_ON(adm & SSB_ADM_NEG); /* unsupported */1020 assert(!(adm & SSB_ADM_NEG)); /* unsupported */ 1111 1021 size = ((adm & SSB_ADM_SZ1) >> SSB_ADM_SZ1_SHIFT); 1112 1022 break; 1113 1023 case SSB_ADM_TYPE2: 1114 SSB_WARN_ON(adm & SSB_ADM_NEG); /* unsupported */1024 assert(!(adm & SSB_ADM_NEG)); /* unsupported */ 1115 1025 size = ((adm & SSB_ADM_SZ2) >> SSB_ADM_SZ2_SHIFT); 1116 1026 break; 1117 1027 default: 1118 SSB_WARN_ON(1);1028 assert(0); 1119 1029 } 1120 1030 size = (1 << (size + 1)); … … 1128 1038 int err; 1129 1039 1130 /* See the comment at the ssb_is_early_boot definition */ 1131 ssb_is_early_boot = 0; 1040 ssb_bustype.name = "ssb"; 1132 1041 err = bus_register(&ssb_bustype); 1133 1042 if (err) … … 1143 1052 bus_unregister(&ssb_bustype); 1144 1053 1145 err = b43_pci_ssb_bridge_init();1146 if (err) {1147 ssb_printk(KERN_ERR "Broadcom 43xx PCI-SSB-bridge "1148 "initialization failed");1149 /* don't fail SSB init because of this */1150 err = 0;1151 }1152 1153 1054 return err; 1154 1055 } … … 1157 1058 static void __exit ssb_modexit(void) 1158 1059 { 1159 b43_pci_ssb_bridge_exit();1160 1060 bus_unregister(&ssb_bustype); 1161 1061 } trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/pci.c
r3691 r3693 24 24 25 25 26 /* Define the following to 1 to enable a printk on each coreswitch. */27 #define SSB_VERBOSE_PCICORESWITCH_DEBUG 028 29 30 /* Lowlevel coreswitching */31 26 int ssb_pci_switch_coreidx(struct ssb_bus *bus, u8 coreidx) 32 27 { … … 66 61 unsigned long flags; 67 62 68 #if SSB_VERBOSE_PCICORESWITCH_DEBUG 69 ssb_printk(KERN_INFO PFX 70 "Switching to %s core, index %d\n", 71 ssb_core_name(dev->id.coreid), 72 dev->core_index); 73 #endif 63 ssb_dprintk(KERN_INFO PFX 64 "Switching to %s core, index %d\n", 65 ssb_core_name(dev->id.coreid), 66 dev->core_index); 74 67 75 68 spin_lock_irqsave(&bus->bar_lock, flags); … … 82 75 } 83 76 84 /* Enable/disable the on board crystal oscillator and/or PLL. */85 77 int ssb_pci_xtal(struct ssb_bus *bus, u32 what, int turn_on) 86 78 { … … 167 159 } 168 160 169 /* Get the word-offset for a SSB_SPROM_XXX define. */170 161 #define SPOFF(offset) (((offset) - SSB_SPROM_BASE) / sizeof(u16)) 171 /* Helper to extract some _offset, which is one of the SSB_SPROM_XXX defines. */172 162 #define SPEX(_outvar, _offset, _mask, _shift) \ 173 163 out->_outvar = ((in[SPOFF(_offset)] & (_mask)) >> (_shift)) … … 307 297 for (i = 0; i < 3; i++) { 308 298 v = in[SPOFF(SSB_SPROM1_IL0MAC) + i]; 309 *((( __be16 *)out->il0mac) + i) = cpu_to_be16(v);299 *(((u16 *)out->il0mac) + i) = cpu_to_be16(v); 310 300 } 311 301 for (i = 0; i < 3; i++) { 312 302 v = in[SPOFF(SSB_SPROM1_ET0MAC) + i]; 313 *((( __be16 *)out->et0mac) + i) = cpu_to_be16(v);303 *(((u16 *)out->et0mac) + i) = cpu_to_be16(v); 314 304 } 315 305 for (i = 0; i < 3; i++) { 316 306 v = in[SPOFF(SSB_SPROM1_ET1MAC) + i]; 317 *((( __be16 *)out->et1mac) + i) = cpu_to_be16(v);307 *(((u16 *)out->et1mac) + i) = cpu_to_be16(v); 318 308 } 319 309 SPEX(et0phyaddr, SSB_SPROM1_ETHPHY, SSB_SPROM1_ETHPHY_ET0A, 0); … … 353 343 for (i = 0; i < 4; i++) { 354 344 v = in[SPOFF(SSB_SPROM1_OEM) + i]; 355 *((( __le16 *)out->oem) + i) = cpu_to_le16(v);345 *(((u16 *)out->oem) + i) = cpu_to_le16(v); 356 346 } 357 347 } … … 375 365 for (i = 0; i < 4; i++) { 376 366 v = in[SPOFF(SSB_SPROM2_CCODE) + i]; 377 *((( __le16 *)out->country_str) + i) = cpu_to_le16(v);367 *(((u16 *)out->country_str) + i) = cpu_to_le16(v); 378 368 } 379 369 } … … 500 490 } 501 491 502 #ifdef CONFIG_SSB_DEBUG503 static int ssb_pci_assert_buspower(struct ssb_bus *bus)504 {505 if (likely(bus->powered_up))506 return 0;507 508 printk(KERN_ERR PFX "FATAL ERROR: Bus powered down "509 "while accessing PCI MMIO space\n");510 if (bus->power_warn_count <= 10) {511 bus->power_warn_count++;512 dump_stack();513 }514 515 return -ENODEV;516 }517 #else /* DEBUG */518 static inline int ssb_pci_assert_buspower(struct ssb_bus *bus)519 {520 return 0;521 }522 #endif /* DEBUG */523 524 492 static u16 ssb_pci_read16(struct ssb_device *dev, u16 offset) 525 493 { 526 494 struct ssb_bus *bus = dev->bus; 527 495 528 if (unlikely(ssb_pci_assert_buspower(bus)))529 return 0xFFFF;530 496 if (unlikely(bus->mapped_device != dev)) { 531 497 if (unlikely(ssb_pci_switch_core(bus, dev))) 532 498 return 0xFFFF; 533 499 } 534 return ioread16(bus->mmio + offset);500 return readw(bus->mmio + offset); 535 501 } 536 502 … … 539 505 struct ssb_bus *bus = dev->bus; 540 506 541 if (unlikely(ssb_pci_assert_buspower(bus)))542 return 0xFFFFFFFF;543 507 if (unlikely(bus->mapped_device != dev)) { 544 508 if (unlikely(ssb_pci_switch_core(bus, dev))) 545 509 return 0xFFFFFFFF; 546 510 } 547 return ioread32(bus->mmio + offset);511 return readl(bus->mmio + offset); 548 512 } 549 513 … … 552 516 struct ssb_bus *bus = dev->bus; 553 517 554 if (unlikely(ssb_pci_assert_buspower(bus)))555 return;556 518 if (unlikely(bus->mapped_device != dev)) { 557 519 if (unlikely(ssb_pci_switch_core(bus, dev))) 558 520 return; 559 521 } 560 iowrite16(value, bus->mmio + offset);522 writew(value, bus->mmio + offset); 561 523 } 562 524 … … 565 527 struct ssb_bus *bus = dev->bus; 566 528 567 if (unlikely(ssb_pci_assert_buspower(bus)))568 return;569 529 if (unlikely(bus->mapped_device != dev)) { 570 530 if (unlikely(ssb_pci_switch_core(bus, dev))) 571 531 return; 572 532 } 573 iowrite32(value, bus->mmio + offset); 574 } 575 576 /* Not "static", as it's used in main.c */ 533 writel(value, bus->mmio + offset); 534 } 535 577 536 const struct ssb_bus_ops ssb_pci_ops = { 578 537 .read16 = ssb_pci_read16, … … 632 591 goto out; 633 592 634 /* Use interruptible locking, as the SPROM write might635 * be holding the lock for several seconds. So allow userspace636 * to cancel operation. */637 593 err = -ERESTARTSYS; 638 594 if (mutex_lock_interruptible(&bus->pci_sprom_mutex)) … … 677 633 } 678 634 679 /* Use interruptible locking, as the SPROM write might680 * be holding the lock for several seconds. So allow userspace681 * to cancel operation. */682 635 err = -ERESTARTSYS; 683 636 if (mutex_lock_interruptible(&bus->pci_sprom_mutex)) 684 637 goto out_kfree; 685 638 err = ssb_devices_freeze(bus); 686 if (err == -EOPNOTSUPP) {687 ssb_printk(KERN_ERR PFX "SPROM write: Could not freeze devices. "688 "No suspend support. Is CONFIG_PM enabled?\n");689 goto out_unlock;690 }691 639 if (err) { 692 640 ssb_printk(KERN_ERR PFX "SPROM write: Could not freeze all devices\n"); trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/pcmcia.c
r3691 r3693 22 22 23 23 24 /* Define the following to 1 to enable a printk on each coreswitch. */25 #define SSB_VERBOSE_PCMCIACORESWITCH_DEBUG 026 27 28 24 int ssb_pcmcia_switch_coreidx(struct ssb_bus *bus, 29 25 u8 coreidx) … … 96 92 unsigned long flags; 97 93 98 #if SSB_VERBOSE_PCMCIACORESWITCH_DEBUG 99 ssb_printk(KERN_INFO PFX 100 "Switching to %s core, index %d\n", 101 ssb_core_name(dev->id.coreid), 102 dev->core_index); 103 #endif 94 ssb_dprintk(KERN_INFO PFX 95 "Switching to %s core, index %d\n", 96 ssb_core_name(dev->id.coreid), 97 dev->core_index); 104 98 105 99 spin_lock_irqsave(&bus->bar_lock, flags); … … 119 113 int res, err = 0; 120 114 121 SSB_WARN_ON((seg != 0) && (seg != 1));115 assert(seg == 0 || seg == 1); 122 116 reg.Offset = 0x34; 123 117 reg.Function = 0; … … 152 146 } 153 147 154 /* These are the main device register access functions.155 * do_select_core is inline to have the likely hotpath inline.156 * All unlikely codepaths are out-of-line. */157 148 static inline int do_select_core(struct ssb_bus *bus, 158 149 struct ssb_device *dev, … … 186 177 return 0xFFFF; 187 178 x = readw(bus->mmio + offset); 188 179 //printk("R16 0x%04X, 0x%04X\n", offset, x); 189 180 return x; 190 181 } … … 198 189 return 0xFFFFFFFF; 199 190 x = readl(bus->mmio + offset); 200 191 //printk("R32 0x%04X, 0x%08X\n", offset, x); 201 192 return x; 202 193 } … … 208 199 if (unlikely(do_select_core(bus, dev, &offset))) 209 200 return; 201 //printk("W16 0x%04X, 0x%04X\n", offset, value); 210 202 writew(value, bus->mmio + offset); 211 203 } … … 217 209 if (unlikely(do_select_core(bus, dev, &offset))) 218 210 return; 211 //printk("W32 0x%04X, 0x%08X\n", offset, value); 219 212 readw(bus->mmio + offset); 220 213 writew(value >> 16, bus->mmio + offset + 2); … … 223 216 } 224 217 225 /* Not "static", as it's used in main.c */226 218 const struct ssb_bus_ops ssb_pcmcia_ops = { 227 219 .read16 = ssb_pcmcia_read16, trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/scan.c
r3691 r3693 16 16 #include <linux/ssb/ssb_regs.h> 17 17 #include <linux/pci.h> 18 #include <linux/io.h> 19 20 #include <pcmcia/cs_types.h> 21 #include <pcmcia/cs.h> 22 #include <pcmcia/cistpl.h> 23 #include <pcmcia/ds.h> 18 #include <asm/io.h> 19 20 #ifdef CONFIG_SSB_PCMCIAHOST 21 # include <pcmcia/cs_types.h> 22 # include <pcmcia/cs.h> 23 # include <pcmcia/cistpl.h> 24 # include <pcmcia/ds.h> 25 #endif 24 26 25 27 #include "ssb_private.h" 26 28 27 29 28 const char * ssb_core_name(u16 coreid)30 const char * ssb_core_name(u16 coreid) 29 31 { 30 32 switch (coreid) { … … 204 206 pci_iounmap(bus->host_pci, bus->mmio); 205 207 #else 206 SSB_BUG_ON(1); /* Can't reach this code. */208 assert(0); /* Can't reach this code. */ 207 209 #endif 208 210 break; … … 212 214 } 213 215 214 static void __iomem * ssb_ioremap(struct ssb_bus *bus,215 unsigned long baseaddr)216 static void __iomem * ssb_ioremap(struct ssb_bus *bus, 217 unsigned long baseaddr) 216 218 { 217 219 void __iomem *mmio = NULL; … … 228 230 mmio = pci_iomap(bus->host_pci, 0, ~0UL); 229 231 #else 230 SSB_BUG_ON(1); /* Can't reach this code. */232 assert(0); /* Can't reach this code. */ 231 233 #endif 232 234 break; trunk/freewrt/target/linux/brcm-2.6/extra/drivers/ssb/ssb_private.h
r3691 r3693 4 4 #include <linux/ssb/ssb.h> 5 5 #include <linux/types.h> 6 #include <asm/io.h> 6 7 7 8 … … 16 17 /* dprintk: Debugging printk; vanishes for non-debug compilation */ 17 18 #ifdef CONFIG_SSB_DEBUG 18 # define ssb_dprintk(fmt, x...) ssb_printk(fmt , ##x)19 # define ssb_dprintk(fmt, x...) ssb_printk(fmt ,##x) 19 20 #else 20 21 # define ssb_dprintk(fmt, x...) do { /* nothing */ } while (0) 21 22 #endif 22 23 24 /* printkl: Rate limited printk */ 25 #define ssb_printkl(fmt, x...) do { \ 26 if (printk_ratelimit()) \ 27 ssb_printk(fmt ,##x); \ 28 } while (0) 29 30 /* dprintkl: Rate limited debugging printk */ 23 31 #ifdef CONFIG_SSB_DEBUG 24 # define SSB_WARN_ON(x) WARN_ON(x) 25 # define SSB_BUG_ON(x) BUG_ON(x) 32 # define ssb_dprintkl ssb_printkl 26 33 #else 27 static inline int __ssb_do_nothing(int x) { return x; } 28 # define SSB_WARN_ON(x) __ssb_do_nothing(unlikely(!!(x))) 29 # define SSB_BUG_ON(x) __ssb_do_nothing(unlikely(!!(x))) 34 # define ssb_dprintkl(fmt, x...) do { /* nothing */ } while (0) 30 35 #endif 36 37 #define assert(cond) do { \ 38 if (unlikely(!(cond))) { \ 39 ssb_dprintk(KERN_ERR PFX "BUG: Assertion failed (%s) " \ 40 "at: %s:%d:%s()\n", \ 41 #cond, __FILE__, __LINE__, __func__); \ 42 } \ 43 } while (0) 31 44 32 45 … … 108 121 109 122 /* scan.c */ 110 extern const char * ssb_core_name(u16 coreid);123 extern const char * ssb_core_name(u16 coreid); 111 124 extern int ssb_bus_scan(struct ssb_bus *bus, 112 125 unsigned long baseaddr); … … 116 129 /* core.c */ 117 130 extern u32 ssb_calc_clock_rate(u32 plltype, u32 n, u32 m); 131 #ifdef CONFIG_SSB_PCIHOST 118 132 extern int ssb_devices_freeze(struct ssb_bus *bus); 119 133 extern int ssb_devices_thaw(struct ssb_bus *bus); 120 extern struct ssb_bus *ssb_pci_dev_to_bus(struct pci_dev *pdev); 121 122 /* b43_pci_bridge.c */ 123 #ifdef CONFIG_SSB_PCIHOST 124 extern int __init b43_pci_ssb_bridge_init(void); 125 extern void __exit b43_pci_ssb_bridge_exit(void); 126 #else /* CONFIG_SSB_PCIHOST */ 127 static inline int b43_pci_ssb_bridge_init(void) 128 { 129 return 0; 130 } 131 static inline void b43_pci_ssb_bridge_exit(void) 132 { 133 } 134 extern struct ssb_bus * ssb_pci_dev_to_bus(struct pci_dev *pdev); 134 135 #endif /* CONFIG_SSB_PCIHOST */ 135 136 trunk/freewrt/target/linux/brcm-2.6/extra/include/asm-mips/mach-bcm947xx/gpio.h
r3691 r3693 28 28 } 29 29 30 static inline int gpio_direction_output(unsigned gpio , int value)30 static inline int gpio_direction_output(unsigned gpio) 31 31 { 32 32 if (ssb.chipco.dev) 33 ssb_chipco_gpio_outen(&ssb.chipco, 1 << gpio, value<< gpio);33 ssb_chipco_gpio_outen(&ssb.chipco, 1 << gpio, 1 << gpio); 34 34 else if (ssb.extif.dev) 35 ssb_extif_gpio_outen(&ssb.extif, 1 << gpio, value<< gpio);35 ssb_extif_gpio_outen(&ssb.extif, 1 << gpio, 1 << gpio); 36 36 else 37 37 return -EINVAL; trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/ssb/ssb.h
r3691 r3693 1 1 #ifndef LINUX_SSB_H_ 2 2 #define LINUX_SSB_H_ 3 #ifdef __KERNEL__ 3 4 4 5 #include <linux/device.h> … … 6 7 #include <linux/types.h> 7 8 #include <linux/spinlock.h> 8 #include <linux/pci.h> 9 #include <linux/mod_devicetable.h> 9 #ifdef CONFIG_SSB_PCIHOST 10 # include <linux/pci.h> 11 #endif 10 12 11 13 #include <linux/ssb/ssb_regs.h> … … 155 157 #define SSB_VENDOR_BROADCOM 0x4243 156 158 159 struct ssb_device_id { 160 u16 vendor; 161 u16 coreid; 162 u8 revision; 163 }; 164 #define SSB_DEVICE(_vendor, _coreid, _revision) \ 165 { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } 166 #define SSB_DEVTABLE_END \ 167 { 0, }, 168 169 #define SSB_ANY_VENDOR 0xFFFF 170 #define SSB_ANY_ID 0xFFFF 171 #define SSB_ANY_REV 0xFF 172 157 173 /* Some kernel subsystems poke with dev->drvdata, so we must use the 158 174 * following ugly workaround to get from struct device to struct ssb_device */ … … 183 199 struct ssb_device * dev_to_ssb_dev(struct device *dev) 184 200 { 185 struct __ssb_dev_wrapper *wrap; 186 wrap = container_of(dev, struct __ssb_dev_wrapper, dev); 201 struct __ssb_dev_wrapper *wrap = container_of(dev, struct __ssb_dev_wrapper, dev); 187 202 return wrap->sdev; 188 203 } … … 282 297 283 298 #ifdef CONFIG_SSB_PCIHOST 284 /* Mutex to protect the SPROM writing. */285 299 struct mutex pci_sprom_mutex; 286 300 #endif … … 320 334 struct ssb_sprom sprom; 321 335 322 /* Internal -only stuff follows. Do not touch. */336 /* Internal. */ 323 337 struct list_head list; 324 #ifdef CONFIG_SSB_DEBUG325 /* Is the bus already powered up? */326 bool powered_up;327 int power_warn_count;328 #endif /* DEBUG */329 338 }; 330 339 … … 334 343 struct ssb_sprom sprom; 335 344 }; 336 /* Type of function to fetch the invariants. */337 typedef int (*ssb_invariants_func_t)(struct ssb_bus *bus,338 struct ssb_init_invariants *iv);339 345 340 346 /* Register a SSB system bus. get_invariants() is called after the … … 344 350 extern int ssb_bus_ssbbus_register(struct ssb_bus *bus, 345 351 unsigned long baseaddr, 346 ssb_invariants_func_t get_invariants); 352 int (*get_invariants)(struct ssb_bus *bus, 353 struct ssb_init_invariants *iv)); 347 354 #ifdef CONFIG_SSB_PCIHOST 348 355 extern int ssb_bus_pcibus_register(struct ssb_bus *bus, … … 359 366 extern u32 ssb_clockspeed(struct ssb_bus *bus); 360 367 361 /* Is the device enabled in hardware? */362 368 int ssb_device_is_enabled(struct ssb_device *dev); 363 /* Enable a device and pass device-specific SSB_TMSLOW flags.364 * If no device-specific flags are available, use 0. */365 369 void ssb_device_enable(struct ssb_device *dev, u32 core_specific_flags); 366 /* Disable a device in hardware and pass SSB_TMSLOW flags (if any). */367 370 void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags); 368 371 … … 406 409 407 410 408 /* If a driver is shutdown or suspended, call this to signal 409 * that the bus may be completely powered down. SSB will decide, 410 * if it's really time to power down the bus, based on if there 411 * are other devices that want to run. */ 411 /* Bus-Power handling functions. */ 412 412 extern int ssb_bus_may_powerdown(struct ssb_bus *bus); 413 /* Before initializing and enabling a device, call this to power-up the bus. 414 * If you want to allow use of dynamic-power-control, pass the flag. 415 * Otherwise static always-on powercontrol will be used. */ 416 extern int ssb_bus_powerup(struct ssb_bus *bus, bool dynamic_pctl); 413 extern int ssb_bus_powerup(struct ssb_bus *bus, int dynamic_pctl); 417 414 418 415 … … 422 419 423 420 421 #endif /* __KERNEL__ */ 424 422 #endif /* LINUX_SSB_H_ */ trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/ssb/ssb_driver_chipcommon.h
r3691 r3693 13 13 * Licensed under the GPL version 2. See COPYING for details. 14 14 */ 15 #ifdef __KERNEL__ 15 16 16 17 /** ChipCommon core registers. **/ … … 364 365 extern void ssb_chipco_resume(struct ssb_chipcommon *cc); 365 366 366 extern void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc,367 u32 *plltype, u32 *n, u32 *m);368 367 extern void ssb_chipco_get_clockcontrol(struct ssb_chipcommon *cc, 369 368 u32 *plltype, u32 *n, u32 *m); … … 380 379 enum ssb_clkmode mode); 381 380 382 extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc,383 u32 ticks);384 385 u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask);386 387 void ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value);388 389 void ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value);390 391 381 #ifdef CONFIG_SSB_SERIAL 392 382 extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc, … … 394 384 #endif /* CONFIG_SSB_SERIAL */ 395 385 386 #endif /* __KERNEL__ */ 396 387 #endif /* LINUX_SSB_CHIPCO_H_ */ trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/ssb/ssb_driver_extif.h
r3691 r3693 20 20 #ifndef LINUX_SSB_EXTIFCORE_H_ 21 21 #define LINUX_SSB_EXTIFCORE_H_ 22 23 #ifdef __KERNEL__ 24 25 struct ssb_extif { 26 struct ssb_device *dev; 27 }; 22 28 23 29 /* external interface address space */ … … 154 160 155 161 156 157 #ifdef CONFIG_SSB_DRIVER_EXTIF 158 159 struct ssb_extif { 160 struct ssb_device *dev; 161 }; 162 163 static inline bool ssb_extif_available(struct ssb_extif *extif) 164 { 165 return (extif->dev != NULL); 166 } 167 168 extern void ssb_extif_get_clockcontrol(struct ssb_extif *extif, 169 u32 *plltype, u32 *n, u32 *m); 170 171 extern void ssb_extif_timing_init(struct ssb_extif *extif, 172 unsigned long ns); 173 174 u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask); 175 176 void ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, u32 value); 177 178 void ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask, u32 value); 179 180 #ifdef CONFIG_SSB_SERIAL 181 extern int ssb_extif_serial_init(struct ssb_extif *extif, 182 struct ssb_serial_port *ports); 183 #endif /* CONFIG_SSB_SERIAL */ 184 185 186 #else /* CONFIG_SSB_DRIVER_EXTIF */ 187 /* extif disabled */ 188 189 struct ssb_extif { 190 }; 191 192 static inline bool ssb_extif_available(struct ssb_extif *extif) 193 { 194 return 0; 195 } 196 197 static inline 198 void ssb_extif_get_clockcontrol(struct ssb_extif *extif, 199 u32 *plltype, u32 *n, u32 *m) 200 { 201 } 202 203 #endif /* CONFIG_SSB_DRIVER_EXTIF */ 162 #endif /* __KERNEL__ */ 204 163 #endif /* LINUX_SSB_EXTIFCORE_H_ */ trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/ssb/ssb_driver_mips.h
r3691 r3693 1 1 #ifndef LINUX_SSB_MIPSCORE_H_ 2 2 #define LINUX_SSB_MIPSCORE_H_ 3 4 #ifdef __KERNEL__ 3 5 4 6 #ifdef CONFIG_SSB_DRIVER_MIPS … … 21 23 struct ssb_serial_port serial_ports[4]; 22 24 23 u8 flash_buswidth;24 25 u32 flash_window; 25 26 u32 flash_window_size; … … 27 28 28 29 extern void ssb_mipscore_init(struct ssb_mipscore *mcore); 29 extern u32 ssb_cpu_clock(struct ssb_mipscore *mcore);30 30 31 31 extern unsigned int ssb_mips_irq(struct ssb_device *dev); … … 44 44 #endif /* CONFIG_SSB_DRIVER_MIPS */ 45 45 46 #endif /* __KERNEL__ */ 46 47 #endif /* LINUX_SSB_MIPSCORE_H_ */ trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/ssb/ssb_driver_pci.h
r3691 r3693 1 1 #ifndef LINUX_SSB_PCICORE_H_ 2 2 #define LINUX_SSB_PCICORE_H_ 3 #ifdef __KERNEL__ 3 4 4 5 #ifdef CONFIG_SSB_DRIVER_PCICORE … … 104 105 105 106 #endif /* CONFIG_SSB_DRIVER_PCICORE */ 107 #endif /* __KERNEL__ */ 106 108 #endif /* LINUX_SSB_PCICORE_H_ */ trunk/freewrt/target/linux/brcm-2.6/extra/include/linux/ssb/ssb_regs.h
r3691 r3693 1 1 #ifndef LINUX_SSB_REGS_H_ 2 2 #define LINUX_SSB_REGS_H_ 3 #ifdef __KERNEL__ 3 4 4 5 … … 6 7 * All regions may not exist on all chips. 7 8 */ 8 #define SSB_SDRAM_BASE 0x00000000 U/* Physical SDRAM */9 #define SSB_PCI_MEM 0x08000000 U/* Host Mode sb2pcitranslation0 (64 MB) */10 #define SSB_PCI_CFG 0x0c000000 U/* Host Mode sb2pcitranslation1 (64 MB) */11 #define SSB_SDRAM_SWAPPED 0x10000000 U/* Byteswapped Physical SDRAM */12 #define SSB_ENUM_BASE 0x18000000 U/* Enumeration space base */13 #define SSB_ENUM_LIMIT 0x18010000 U/* Enumeration space limit */14 15 #define SSB_FLASH2 0x1c000000 U/* Flash Region 2 (region 1 shadowed here) */16 #define SSB_FLASH2_SZ 0x02000000 U/* Size of Flash Region 2 */17 18 #define SSB_EXTIF_BASE 0x1f000000 U/* External Interface region base address */19 #define SSB_FLASH1 0x1fc00000 U/* Flash Region 1 */20 #define SSB_FLASH1_SZ 0x00400000 U/* Size of Flash Region 1 */21 22 #define SSB_PCI_DMA 0x40000000 U/* Client Mode sb2pcitranslation2 (1 GB) */23 #define SSB_PCI_DMA_SZ 0x40000000 U/* Client Mode sb2pcitranslation2 size in bytes */24 #define SSB_PCIE_DMA_L32 0x00000000U/* PCIE Client Mode sb2pcitranslation2 (2 ZettaBytes), low 32 bits */25 #define SSB_PCIE_DMA_H32 0x80000000U/* PCIE Client Mode sb2pcitranslation2 (2 ZettaBytes), high 32 bits */26 #define SSB_EUART (S SB_EXTIF_BASE + 0x00800000)27 #define SSB_LED (S SB_EXTIF_BASE + 0x00900000)9 #define SSB_SDRAM_BASE 0x00000000 /* Physical SDRAM */ 10 #define SSB_PCI_MEM 0x08000000 /* Host Mode sb2pcitranslation0 (64 MB) */ 11 #define SSB_PCI_CFG 0x0c000000 /* Host Mode sb2pcitranslation1 (64 MB) */ 12 #define SSB_SDRAM_SWAPPED 0x10000000 /* Byteswapped Physical SDRAM */ 13 #define SSB_ENUM_BASE 0x18000000 /* Enumeration space base */ 14 #define SSB_ENUM_LIMIT 0x18010000 /* Enumeration space limit */ 15 16 #define SSB_FLASH2 0x1c000000 /* Flash Region 2 (region 1 shadowed here) */ 17 #define SSB_FLASH2_SZ 0x02000000 /* Size of Flash Region 2 */ 18 19 #define SSB_EXTIF_BASE 0x1f000000 /* External Interface region base address */ 20 #define SSB_FLASH1 0x1fc00000 /* Flash Region 1 */ 21 #define SSB_FLASH1_SZ 0x00400000 /* Size of Flash Region 1 */ 22 23 #define SSB_PCI_DMA 0x40000000 /* Client Mode sb2pcitranslation2 (1 GB) */ 24 #define SSB_PCI_DMA_SZ 0x40000000 /* Client Mode sb2pcitranslation2 size in bytes */ 25 #define SSB_PCIE_DMA_L32 0x00000000 /* PCIE Client Mode sb2pcitranslation2 (2 ZettaBytes), low 32 bits */ 26 #define SSB_PCIE_DMA_H32 0x80000000 /* PCIE Client Mode sb2pcitranslation2 (2 ZettaBytes), high 32 bits */ 27 #define SSB_EUART (SB_EXTIF_BASE + 0x00800000) 28 #define SSB_LED (SB_EXTIF_BASE + 0x00900000) 28 29 29 30 … … 268 269 }; 269 270 270 /* Address-Match values and masks (SSB_ADMATCH xxx) */271 /* Address-Match values and masks (SSB_ADMATCH?) */ 271 272 #define SSB_ADM_TYPE 0x00000003 /* Address type */ 272 273 #define SSB_ADM_TYPE0 0 … … 290 291 291 292 293 #endif /* __KERNEL__ */ 292 294 #endif /* LINUX_SSB_REGS_H_ */ trunk/freewrt/target/linux/brcm-2.6/patches/2100-board_support.patch
r3686 r3693 1 Index: linux-2.6.2 3/arch/mips/Kconfig2 =================================================================== 3 --- linux-2.6.2 3.orig/arch/mips/Kconfig 2007-10-13 02:23:06.662507926 +02004 +++ linux-2.6.2 3/arch/mips/Kconfig 2007-10-13 02:23:41.484492317 +02001 Index: linux-2.6.22-rc4/arch/mips/Kconfig 2 =================================================================== 3 --- linux-2.6.22-rc4.orig/arch/mips/Kconfig 2007-06-10 21:32:36.000000000 +0100 4 +++ linux-2.6.22-rc4/arch/mips/Kconfig 2007-06-10 21:33:12.000000000 +0100 5 5 @@ -4,6 +4,10 @@ 6 6 # Horrible source of confusion. Die, die, die ... … … 14 14 15 15 menu "Machine selection" 16 @@ - 44,6 +48,23 @@17 note that a kernel built with this option selected will not be18 able to run on normal units.16 @@ -126,6 +130,23 @@ 17 Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and 18 Olivetti M700-10 workstations. 19 19 20 20 +config BCM947XX … … 35 35 + Support for BCM947xx based boards 36 36 + 37 config MIPS_COBALT38 bool " Cobalt Server"37 config LASAT 38 bool "LASAT Networks platforms" 39 39 select DMA_NONCOHERENT 40 Index: linux-2.6.23/arch/mips/Makefile 41 =================================================================== 42 --- linux-2.6.23.orig/arch/mips/Makefile 2007-10-13 02:23:06.682509066 +0200 43 +++ linux-2.6.23/arch/mips/Makefile 2007-10-13 02:23:11.210767122 +0200 44 @@ -533,6 +533,18 @@ 40 Index: linux-2.6.22-rc4/arch/mips/kernel/cpu-probe.c 41 =================================================================== 42 --- linux-2.6.22-rc4.orig/arch/mips/kernel/cpu-probe.c 2007-06-10 21:32:13.000000000 +0100 43 +++ linux-2.6.22-rc4/arch/mips/kernel/cpu-probe.c 2007-06-10 21:33:12.000000000 +0100 44 @@ -711,6 +711,28 @@ 45 } 46 47 48 +static inline void cpu_probe_broadcom(struct cpuinfo_mips *c) 49 +{ 50 + decode_config1(c); 51 + switch (c->processor_id & 0xff00) { 52 + case PRID_IMP_BCM3302: 53 + c->cputype = CPU_BCM3302; 54 + c->isa_level = MIPS_CPU_ISA_M32R1; 55 + c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 56 + MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER; 57 + break; 58 + case PRID_IMP_BCM4710: 59 + c->cputype = CPU_BCM4710; 60 + c->isa_level = MIPS_CPU_ISA_M32R1; 61 + c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 62 + MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER; 63 + break; 64 + default: 65 + c->cputype = CPU_UNKNOWN; 66 + break; 67 + } 68 +} 69 + 70 __init void cpu_probe(void) 71 { 72 struct cpuinfo_mips *c = ¤t_cpu_data; 73 @@ -733,6 +755,9 @@ 74 case PRID_COMP_SIBYTE: 75 cpu_probe_sibyte(c); 76 break; 77 + case PRID_COMP_BROADCOM: 78 + cpu_probe_broadcom(c); 79 + break; 80 case PRID_COMP_SANDCRAFT: 81 cpu_probe_sandcraft(c); 82 break; 83 Index: linux-2.6.22-rc4/arch/mips/kernel/proc.c 84 =================================================================== 85 --- linux-2.6.22-rc4.orig/arch/mips/kernel/proc.c 2007-06-10 21:32:13.000000000 +0100 86 +++ linux-2.6.22-rc4/arch/mips/kernel/proc.c 2007-06-10 21:33:12.000000000 +0100 87 @@ -83,6 +83,8 @@ 88 [CPU_VR4181] = "NEC VR4181", 89 [CPU_VR4181A] = "NEC VR4181A", 90 [CPU_SR71000] = "Sandcraft SR71000", 91 + [CPU_BCM3302] = "Broadcom BCM3302", 92 + [CPU_BCM4710] = "Broadcom BCM4710", 93 [CPU_PR4450] = "Philips PR4450", 94 }; 95 96 Index: linux-2.6.22-rc4/arch/mips/Makefile 97 =================================================================== 98 --- linux-2.6.22-rc4.orig/arch/mips/Makefile 2007-06-10 21:32:56.000000000 +0100 99 +++ linux-2.6.22-rc4/arch/mips/Makefile 2007-06-10 21:33:12.000000000 +0100 100 @@ -560,6 +560,18 @@ 45 101 load-$(CONFIG_SIBYTE_BIGSUR) := 0xffffffff80100000 46 102 … … 61 117 # 62 118 core-$(CONFIG_SNI_RM) += arch/mips/sni/ 63 Index: linux-2.6.23.1/drivers/Makefile 64 =================================================================== 65 --- linux-2.6.23.1.orig/drivers/Makefile 2008-01-27 04:34:31.000000000 +0100 66 +++ linux-2.6.23.1/drivers/Makefile 2008-01-27 04:39:57.000000000 +0100 67 @@ -89,3 +89,4 @@ 119 Index: linux-2.6.22-rc4/arch/mips/mm/tlbex.c 120 =================================================================== 121 --- linux-2.6.22-rc4.orig/arch/mips/mm/tlbex.c 2007-06-10 21:32:35.000000000 +0100 122 +++ linux-2.6.22-rc4/arch/mips/mm/tlbex.c 2007-06-10 21:33:12.000000000 +0100 123 @@ -892,6 +892,8 @@ 124 case CPU_4KSC: 125 case CPU_20KC: 126 case CPU_25KF: 127 + case CPU_BCM3302: 128 + case CPU_BCM4710: 129 tlbw(p); 130 break; 131 132 Index: linux-2.6.22-rc4/drivers/Kconfig 133 =================================================================== 134 --- linux-2.6.22-rc4.orig/drivers/Kconfig 2007-06-10 21:32:13.000000000 +0100 135 +++ linux-2.6.22-rc4/drivers/Kconfig 2007-06-10 21:33:12.000000000 +0100 136 @@ -56,6 +56,8 @@ 137 138 source "drivers/hwmon/Kconfig" 139 140 +source "drivers/ssb/Kconfig" 141 + 142 source "drivers/mfd/Kconfig" 143 144 source "drivers/media/Kconfig" 145 Index: linux-2.6.22-rc4/drivers/Makefile 146 =================================================================== 147 --- linux-2.6.22-rc4.orig/drivers/Makefile 2007-06-10 21:32:14.000000000 +0100 148 +++ linux-2.6.22-rc4/drivers/Makefile 2007-06-10 21:33:12.000000000 +0100 149 @@ -81,3 +81,4 @@ 150 obj-$(CONFIG_DMA_ENGINE) += dma/ 151 obj-$(CONFIG_HID) += hid/ 68 152 obj-$(CONFIG_PPC_PS3) += ps3/ 69 obj-$(CONFIG_OF) += of/70 obj-$(CONFIG_GPIO_DEVICE) += gpio/71 153 +obj-$(CONFIG_SSB) += ssb/ 72 Index: linux-2.6.23.1/include/linux/pci_ids.h 73 =================================================================== 74 --- linux-2.6.23.1.orig/include/linux/pci_ids.h 2008-01-27 04:55:18.000000000 +0100 75 +++ linux-2.6.23.1/include/linux/pci_ids.h 2008-01-27 04:55:22.000000000 +0100 76 @@ -1972,6 +1972,7 @@ 154 Index: linux-2.6.22-rc4/include/asm-mips/bootinfo.h 155 =================================================================== 156 --- linux-2.6.22-rc4.orig/include/asm-mips/bootinfo.h 2007-06-10 21:32:14.000000000 +0100 157 +++ linux-2.6.22-rc4/include/asm-mips/bootinfo.h 2007-06-10 21:33:12.000000000 +0100 158 @@ -213,6 +213,12 @@ 159 #define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */ 160 #define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */ 161 162 +/* 163 + * Valid machtype for group Broadcom 164 + */ 165 +#define MACH_GROUP_BRCM 23 /* Broadcom */ 166 +#define MACH_BCM47XX 1 /* Broadcom BCM47xx */ 167 + 168 #define CL_SIZE COMMAND_LINE_SIZE 169 170 const char *get_system_type(void); 171 Index: linux-2.6.22-rc4/include/asm-mips/cpu.h 172 =================================================================== 173 --- linux-2.6.22-rc4.orig/include/asm-mips/cpu.h 2007-06-10 21:32:14.000000000 +0100 174 +++ linux-2.6.22-rc4/include/asm-mips/cpu.h 2007-06-10 21:33:12.000000000 +0100 175 @@ -104,6 +104,13 @@ 176 #define PRID_IMP_SR71000 0x0400 177 178 /* 179 + * These are the PRID's for when 23:16 == PRID_COMP_BROADCOM 180 + */ 181 + 182 +#define PRID_IMP_BCM4710 0x4000 183 +#define PRID_IMP_BCM3302 0x9000 184 + 185 +/* 186 * Definitions for 7:0 on legacy processors 187 */ 188 189 @@ -200,7 +207,9 @@ 190 #define CPU_SB1A 62 191 #define CPU_74K 63 192 #define CPU_R14000 64 193 -#define CPU_LAST 64 194 +#define CPU_BCM3302 65 195 +#define CPU_BCM4710 66 196 +#define CPU_LAST 66 197 198 /* 199 * ISA Level encodings 200 Index: linux-2.6.22-rc4/include/linux/pci_ids.h 201 =================================================================== 202 --- linux-2.6.22-rc4.orig/include/linux/pci_ids.h 2007-06-10 21:32:14.000000000 +0100 203 +++ linux-2.6.22-rc4/include/linux/pci_ids.h 2007-06-10 21:33:12.000000000 +0100 204 @@ -1991,6 +1991,7 @@ 77 205 #define PCI_DEVICE_ID_TIGON3_5906M 0x1713 78 206 #define PCI_DEVICE_ID_BCM4401 0x4401 trunk/freewrt/target/linux/brcm-2.6/patches/2110-flash_map.patch
r3686 r3693 1 Index: linux-2.6.2 3/drivers/mtd/maps/Kconfig1 Index: linux-2.6.22-rc4/drivers/mtd/maps/Kconfig 2 2 =================================================================== 3 --- linux-2.6.2 3.orig/drivers/mtd/maps/Kconfig 2007-10-09 22:31:38.000000000 +02004 +++ linux-2.6.2 3/drivers/mtd/maps/Kconfig 2007-10-13 02:28:13.644001805 +02005 @@ -35 2,6 +352,12 @@3 --- linux-2.6.22-rc4.orig/drivers/mtd/maps/Kconfig 2007-06-10 21:32:13.000000000 +0100 4 +++ linux-2.6.22-rc4/drivers/mtd/maps/Kconfig 2007-06-10 21:33:14.000000000 +0100 5 @@ -358,6 +358,12 @@ 6 6 Mapping for the Flaga digital module. If you don't have one, ignore 7 7 this setting. … … 12 12 + help 13 13 + Support for the flash chips on the BCM947xx board. 14 + 14 + 15 15 config MTD_WALNUT 16 16 tristate "Flash device mapped on IBM 405GP Walnut" 17 17 depends on MTD_JEDECPROBE && WALNUT 18 Index: linux-2.6.2 3/drivers/mtd/maps/Makefile18 Index: linux-2.6.22-rc4/drivers/mtd/maps/Makefile 19 19 =================================================================== 20 --- linux-2.6.2 3.orig/drivers/mtd/maps/Makefile 2007-10-09 22:31:38.000000000 +020021 +++ linux-2.6.2 3/drivers/mtd/maps/Makefile 2007-10-13 02:27:56.727037761 +020020 --- linux-2.6.22-rc4.orig/drivers/mtd/maps/Makefile 2007-06-10 21:32:13.000000000 +0100 21 +++ linux-2.6.22-rc4/drivers/mtd/maps/Makefile 2007-06-10 21:33:14.000000000 +0100 22 22 @@ -33,6 +33,7 @@ 23 23 obj-$(CONFIG_MTD_PCMCIA) += pcmciamtd.o trunk/freewrt/target/linux/brcm-2.6/patches/2120-b44_ssb_support.patch
r3686 r3693 1 Index: linux-2.6.2 3/drivers/net/b44.c1 Index: linux-2.6.22-rc4/drivers/net/b44.c 2 2 =================================================================== 3 --- linux-2.6.2 3.orig/drivers/net/b44.c 2007-10-13 10:58:27.872607266 +02004 +++ linux-2.6.2 3/drivers/net/b44.c 2007-10-13 11:00:46.916530927 +02003 --- linux-2.6.22-rc4.orig/drivers/net/b44.c 2007-06-10 21:32:13.000000000 +0100 4 +++ linux-2.6.22-rc4/drivers/net/b44.c 2007-06-10 21:33:15.000000000 +0100 5 5 @@ -1,7 +1,9 @@ 6 6 -/* b44.c: Broadcom 4400 device driver. … … 15 15 * 16 16 * Distribute under GPL. 17 @@ -2 1,11 +23,13 @@17 @@ -20,11 +22,13 @@ 18 18 #include <linux/delay.h> 19 19 #include <linux/init.h> … … 29 29 30 30 #define DRV_MODULE_NAME "b44" 31 @@ -8 7,8 +91,8 @@31 @@ -86,8 +90,8 @@ 32 32 static char version[] __devinitdata = 33 33 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; … … 40 40 MODULE_VERSION(DRV_MODULE_VERSION); 41 41 42 @@ -9 6,18 +100,11 @@42 @@ -95,18 +99,11 @@ 43 43 module_param(b44_debug, int, 0); 44 44 MODULE_PARM_DESC(b44_debug, "B44 bitmapped debugging message enable value"); … … 62 62 static void b44_init_rings(struct b44 *); 63 63 64 @@ -11 9,6 +116,7 @@64 @@ -118,6 +115,7 @@ 65 65 66 66 static int dma_desc_align_mask; … … 70 70 static const char b44_gstrings[][ETH_GSTRING_LEN] = { 71 71 #define _B44(x...) # x, 72 @@ -12 6,35 +124,24 @@72 @@ -125,35 +123,24 @@ 73 73 #undef _B44 74 74 }; … … 108 108 + enum dma_data_direction dir) 109 109 +{ 110 + dma_sync_single_range_for_device( sdev->dev, dma_base,110 + dma_sync_single_range_for_device(&sdev->dev, dma_base, 111 111 + offset & dma_desc_align_mask, 112 112 + dma_desc_sync_size, dir); … … 118 118 + enum dma_data_direction dir) 119 119 +{ 120 + dma_sync_single_range_for_cpu( sdev->dev, dma_base,120 + dma_sync_single_range_for_cpu(&sdev->dev, dma_base, 121 121 + offset & dma_desc_align_mask, 122 122 + dma_desc_sync_size, dir); … … 124 124 125 125 static int b44_wait_bit(struct b44 *bp, unsigned long reg, 126 @@ -18 2,117 +169,29 @@126 @@ -181,117 +168,29 @@ 127 127 return 0; 128 128 } … … 240 240 -#endif 241 241 - return 0; 242 + data[0] = (val >> 8) & 0xFF; 243 + data[1] = (val >> 0) & 0xFF; 244 } 245 242 -} 243 - 246 244 -static int ssb_is_core_up(struct b44 *bp) 247 245 -{ 248 246 - return ((br32(bp, B44_SBTMSLOW) & (SBTMSLOW_RESET | SBTMSLOW_REJECT | SBTMSLOW_CLOCK)) 249 247 - == SBTMSLOW_CLOCK); 250 -} 251 - 248 + data[0] = (val >> 8) & 0xFF; 249 + data[1] = (val >> 0) & 0xFF; 250 } 251 252 252 -static void __b44_cam_write(struct b44 *bp, unsigned char *data, int index) 253 253 +static inline void __b44_cam_write(struct b44 *bp, unsigned char *data, int index) … … 255 255 u32 val; 256 256 257 @@ -32 8,14 +227,14 @@257 @@ -327,14 +226,14 @@ 258 258 bw32(bp, B44_IMASK, bp->imask); 259 259 } … … 272 272 (MDIO_TA_VALID << MDIO_DATA_TA_SHIFT))); 273 273 err = b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0); 274 @@ -34 4,18 +243,34 @@274 @@ -343,18 +242,34 @@ 275 275 return err; 276 276 } … … 302 302 + if (bp->phy_addr == B44_PHY_ADDR_NO_PHY) 303 303 + return 0; 304 + 304 + 305 305 + return __b44_writephy(bp, bp->phy_addr, reg, val); 306 306 +} … … 309 309 /* FIXME FIXME: phy_id is ignored, bp->phy_addr use is unconditional 310 310 * due to code existing before miilib use was added to this driver. 311 @@ -38 4,6 +299,8 @@311 @@ -383,6 +298,8 @@ 312 312 u32 val; 313 313 int err; … … 318 318 if (err) 319 319 return err; 320 @@ -44 2,11 +359,27 @@320 @@ -441,11 +358,27 @@ 321 321 __b44_set_flow_ctrl(bp, pause_enab); 322 322 } … … 335 335 + */ 336 336 + if ((atoi(nvram_get("boardnum")) == 2) && 337 + (__b44_readphy(bp, 0, MII_BMCR, &val) == 0) && 337 + (__b44_readphy(bp, 0, MII_BMCR, &val) == 0) && 338 338 + (val & BMCR_ISOLATE) && 339 339 + (__b44_writephy(bp, 0, MII_BMCR, val & ~BMCR_ISOLATE) != 0)) { … … 346 346 goto out; 347 347 if ((err = b44_writephy(bp, B44_MII_ALEDCTRL, 348 @@ -54 2,6 +475,19 @@348 @@ -541,6 +474,19 @@ 349 349 { 350 350 u32 bmsr, aux; … … 371 371 372 372 - pci_unmap_single(bp->pdev, 373 + dma_unmap_single( bp->sdev->dev,373 + dma_unmap_single(&bp->sdev->dev, 374 374 pci_unmap_addr(rp, mapping), 375 375 skb->len, … … 379 379 dev_kfree_skb_irq(skb); 380 380 } 381 @@ -657,9 +603,9 @@ 381 @@ -656,10 +602,10 @@ 382 skb = dev_alloc_skb(RX_PKT_BUF_SZ); 382 383 if (skb == NULL) 383 384 return -ENOMEM; 384 385 - 385 386 - mapping = pci_map_single(bp->pdev, skb->data, 386 + mapping = dma_map_single(bp->sdev->dev, skb->data, 387 + 388 + mapping = dma_map_single(&bp->sdev->dev, skb->data, 387 389 RX_PKT_BUF_SZ, 388 390 - PCI_DMA_FROMDEVICE); … … 396 398 if (!dma_mapping_error(mapping)) 397 399 - pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); 398 + dma_unmap_single( bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE);400 + dma_unmap_single(&bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE); 399 401 dev_kfree_skb_any(skb); 400 skb = __ netdev_alloc_skb(bp->dev, RX_PKT_BUF_SZ, GFP_ATOMIC|GFP_DMA);402 skb = __dev_alloc_skb(RX_PKT_BUF_SZ,GFP_DMA); 401 403 if (skb == NULL) 402 404 return -ENOMEM; 403 405 - mapping = pci_map_single(bp->pdev, skb->data, 404 + mapping = dma_map_single( bp->sdev->dev, skb->data,406 + mapping = dma_map_single(&bp->sdev->dev, skb->data, 405 407 RX_PKT_BUF_SZ, 406 408 - PCI_DMA_FROMDEVICE); … … 410 412 if (!dma_mapping_error(mapping)) 411 413 - pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); 412 + dma_unmap_single( bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE);414 + dma_unmap_single(&bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE); 413 415 dev_kfree_skb_any(skb); 414 416 return -ENOMEM; 415 417 } 416 @@ -70 5,9 +651,9 @@417 dp->addr = cpu_to_le32((u32) mapping + RX_PKT_OFFSET+ bp->dma_offset);418 @@ -707,9 +653,9 @@ 419 dp->addr = cpu_to_le32((u32) mapping + bp->rx_offset + bp->dma_offset); 418 420 419 421 if (bp->flags & B44_FLAG_RX_RING_HACK) … … 427 429 return RX_PKT_BUF_SZ; 428 430 } 429 @@ -73 4,9 +680,9 @@431 @@ -736,9 +682,9 @@ 430 432 pci_unmap_addr(src_map, mapping)); 431 433 … … 440 442 ctrl = src_desc->ctrl; 441 443 if (dest_idx == (B44_RX_RING_SIZE - 1)) 442 @@ -75 0,13 +696,13 @@444 @@ -752,13 +698,13 @@ 443 445 src_map->skb = NULL; 444 446 … … 452 454 453 455 - pci_dma_sync_single_for_device(bp->pdev, le32_to_cpu(src_desc->addr), 454 + dma_sync_single_for_device( bp->sdev->dev, le32_to_cpu(src_desc->addr),456 + dma_sync_single_for_device(&bp->sdev->dev, le32_to_cpu(src_desc->addr), 455 457 RX_PKT_BUF_SZ, 456 458 - PCI_DMA_FROMDEVICE); … … 459 461 460 462 static int b44_rx(struct b44 *bp, int budget) 461 @@ -77 6,9 +722,9 @@463 @@ -778,9 +724,9 @@ 462 464 struct rx_header *rh; 463 465 u16 len; 464 466 465 467 - pci_dma_sync_single_for_cpu(bp->pdev, map, 466 + dma_sync_single_for_cpu( bp->sdev->dev, map,468 + dma_sync_single_for_cpu(&bp->sdev->dev, map, 467 469 RX_PKT_BUF_SZ, 468 470 - PCI_DMA_FROMDEVICE); … … 470 472 rh = (struct rx_header *) skb->data; 471 473 len = le16_to_cpu(rh->len); 472 if ((len > (RX_PKT_BUF_SZ - RX_PKT_OFFSET)) ||473 @@ -81 0,8 +756,8@@474 if ((len > (RX_PKT_BUF_SZ - bp->rx_offset)) || 475 @@ -812,11 +758,11 @@ 474 476 skb_size = b44_alloc_rx_skb(bp, cons, bp->rx_prod); 475 477 if (skb_size < 0) … … 477 479 - pci_unmap_single(bp->pdev, map, 478 480 - skb_size, PCI_DMA_FROMDEVICE); 479 + dma_unmap_single( bp->sdev->dev, map,481 + dma_unmap_single(&bp->sdev->dev, map, 480 482 + skb_size, DMA_FROM_DEVICE); 481 483 /* Leave out rx_header */ 482 skb_put(skb, len + RX_PKT_OFFSET); 483 skb_pull(skb, RX_PKT_OFFSET); 484 @@ -982,24 +928,24 @@ 484 - skb_put(skb, len+bp->rx_offset); 485 - skb_pull(skb,bp->rx_offset); 486 + skb_put(skb, len+bp->rx_offset); 487 + skb_pull(skb,bp->rx_offset); 488 } else { 489 struct sk_buff *copy_skb; 490 491 @@ -985,23 +931,23 @@ 485 492 goto err_out; 486 493 } 487 494 488 495 - mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE); 489 + mapping = dma_map_single( bp->sdev->dev, skb->data, len, DMA_TO_DEVICE);496 + mapping = dma_map_single(&bp->sdev->dev, skb->data, len, DMA_TO_DEVICE); 490 497 if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) { 491 struct sk_buff *bounce_skb;492 493 498 /* Chip can't handle DMA to/from >1GB, use bounce buffer */ 494 499 if (!dma_mapping_error(mapping)) 495 500 - pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE); 496 + dma_unmap_single(bp->sdev->dev, mapping, len, DMA_TO_DEVICE); 497 498 bounce_skb = __dev_alloc_skb(len, GFP_ATOMIC | GFP_DMA); 501 + dma_unmap_single(&bp->sdev->dev, mapping, len, DMA_TO_DEVICE); 502 503 bounce_skb = __dev_alloc_skb(TX_PKT_BUF_SZ, 504 GFP_ATOMIC|GFP_DMA); 499 505 if (!bounce_skb) 500 506 goto err_out; … … 502 508 - mapping = pci_map_single(bp->pdev, bounce_skb->data, 503 509 - len, PCI_DMA_TODEVICE); 504 + mapping = dma_map_single( bp->sdev->dev, bounce_skb->data,510 + mapping = dma_map_single(&bp->sdev->dev, bounce_skb->data, 505 511 + len, DMA_TO_DEVICE); 506 512 if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) { 507 513 if (!dma_mapping_error(mapping)) 508 514 - pci_unmap_single(bp->pdev, mapping, 509 - len, PCI_DMA_TODEVICE);510 + dma_unmap_single( bp->sdev->dev, mapping,511 + len, DMA_TO_DEVICE);515 - len, PCI_DMA_TODEVICE); 516 + dma_unmap_single(&bp->sdev->dev, mapping, 517 + len, DMA_TO_DEVICE); 512 518 dev_kfree_skb_any(bounce_skb); 513 519 goto err_out; 514 520 } 515 @@ -102 2,9 +968,9 @@521 @@ -1025,9 +971,9 @@ 516 522 bp->tx_ring[entry].addr = cpu_to_le32((u32) mapping+bp->dma_offset); 517 523 … … 526 532 entry = NEXT_TX(entry); 527 533 528 @@ -1 097,10 +1043,10 @@534 @@ -1100,10 +1046,10 @@ 529 535 530 536 if (rp->skb == NULL) 531 537 continue; 532 538 - pci_unmap_single(bp->pdev, 533 + dma_unmap_single( bp->sdev->dev,539 + dma_unmap_single(&bp->sdev->dev, 534 540 pci_unmap_addr(rp, mapping), 535 541 RX_PKT_BUF_SZ, … … 539 545 rp->skb = NULL; 540 546 } 541 @@ -111 1,10 +1057,10 @@547 @@ -1114,10 +1060,10 @@ 542 548 543 549 if (rp->skb == NULL) 544 550 continue; 545 551 - pci_unmap_single(bp->pdev, 546 + dma_unmap_single( bp->sdev->dev,552 + dma_unmap_single(&bp->sdev->dev, 547 553 pci_unmap_addr(rp, mapping), 548 554 rp->skb->len, … … 552 558 rp->skb = NULL; 553 559 } 554 @@ -113 6,14 +1082,14 @@560 @@ -1139,14 +1085,14 @@ 555 561 memset(bp->tx_ring, 0, B44_TX_RING_BYTES); 556 562 … … 559 565 - DMA_TABLE_BYTES, 560 566 - PCI_DMA_BIDIRECTIONAL); 561 + dma_sync_single_for_device( bp->sdev->dev, bp->rx_ring_dma,567 + dma_sync_single_for_device(&bp->sdev->dev, bp->rx_ring_dma, 562 568 + DMA_TABLE_BYTES, 563 569 + DMA_BIDIRECTIONAL); … … 567 573 - DMA_TABLE_BYTES, 568 574 - PCI_DMA_TODEVICE); 569 + dma_sync_single_for_device( bp->sdev->dev, bp->tx_ring_dma,575 + dma_sync_single_for_device(&bp->sdev->dev, bp->tx_ring_dma, 570 576 + DMA_TABLE_BYTES, 571 577 + DMA_TO_DEVICE); … … 573 579 for (i = 0; i < bp->rx_pending; i++) { 574 580 if (b44_alloc_rx_skb(bp, -1, i) < 0) 575 @@ -116 3,24 +1109,24 @@581 @@ -1166,24 +1112,24 @@ 576 582 bp->tx_buffers = NULL; 577 583 if (bp->rx_ring) { … … 580 586 - DMA_TABLE_BYTES, 581 587 - DMA_BIDIRECTIONAL); 582 + dma_unmap_single( bp->sdev->dev, bp->rx_ring_dma,588 + dma_unmap_single(&bp->sdev->dev, bp->rx_ring_dma, 583 589 + DMA_TABLE_BYTES, 584 590 + DMA_BIDIRECTIONAL); … … 586 592 } else 587 593 - pci_free_consistent(bp->pdev, DMA_TABLE_BYTES, 588 + dma_free_coherent( bp->sdev->dev, DMA_TABLE_BYTES,594 + dma_free_coherent(&bp->sdev->dev, DMA_TABLE_BYTES, 589 595 bp->rx_ring, bp->rx_ring_dma); 590 596 bp->rx_ring = NULL; … … 596 602 - DMA_TABLE_BYTES, 597 603 - DMA_TO_DEVICE); 598 + dma_unmap_single( bp->sdev->dev, bp->tx_ring_dma,604 + dma_unmap_single(&bp->sdev->dev, bp->tx_ring_dma, 599 605 + DMA_TABLE_BYTES, 600 606 + DMA_TO_DEVICE); … … 602 608 } else 603 609 - pci_free_consistent(bp->pdev, DMA_TABLE_BYTES, 604 + dma_free_coherent( bp->sdev->dev, DMA_TABLE_BYTES,610 + dma_free_coherent(&bp->sdev->dev, DMA_TABLE_BYTES, 605 611 bp->tx_ring, bp->tx_ring_dma); 606 612 bp->tx_ring = NULL; 607 613 bp->flags &= ~B44_FLAG_TX_RING_HACK; 608 @@ -120 6,7 +1152,7 @@614 @@ -1209,7 +1155,7 @@ 609 615 goto out_err; 610 616 611 617 size = DMA_TABLE_BYTES; 612 618 - bp->rx_ring = pci_alloc_consistent(bp->pdev, size, &bp->rx_ring_dma); 613 + bp->rx_ring = dma_alloc_coherent( bp->sdev->dev, size, &bp->rx_ring_dma, GFP_ATOMIC);619 + bp->rx_ring = dma_alloc_coherent(&bp->sdev->dev, size, &bp->rx_ring_dma, GFP_ATOMIC); 614 620 if (!bp->rx_ring) { 615 621 /* Allocation may have failed due to pci_alloc_consistent 616 622 insisting on use of GFP_DMA, which is more restrictive 617 @@ -12 18,9 +1164,9 @@623 @@ -1221,9 +1167,9 @@ 618 624 if (!rx_ring) 619 625 goto out_err; … … 622 628 - DMA_TABLE_BYTES, 623 629 - DMA_BIDIRECTIONAL); 624 + rx_ring_dma = dma_map_single( bp->sdev->dev, rx_ring,630 + rx_ring_dma = dma_map_single(&bp->sdev->dev, rx_ring, 625 631 + DMA_TABLE_BYTES, 626 632 + DMA_BIDIRECTIONAL); … … 628 634 if (dma_mapping_error(rx_ring_dma) || 629 635 rx_ring_dma + size > DMA_30BIT_MASK) { 630 @@ -123 3,9 +1179,9 @@636 @@ -1236,9 +1182,9 @@ 631 637 bp->flags |= B44_FLAG_RX_RING_HACK; 632 638 } 633 639 634 640 - bp->tx_ring = pci_alloc_consistent(bp->pdev, size, &bp->tx_ring_dma); 635 + bp->tx_ring = dma_alloc_coherent( bp->sdev->dev, size, &bp->tx_ring_dma, GFP_ATOMIC);641 + bp->tx_ring = dma_alloc_coherent(&bp->sdev->dev, size, &bp->tx_ring_dma, GFP_ATOMIC); 636 642 if (!bp->tx_ring) { 637 643 - /* Allocation may have failed due to pci_alloc_consistent … … 640 646 than necessary... */ 641 647 struct dma_desc *tx_ring; 642 @@ -124 5,9 +1191,9 @@648 @@ -1248,9 +1194,9 @@ 643 649 if (!tx_ring) 644 650 goto out_err; … … 647 653 - DMA_TABLE_BYTES, 648 654 - DMA_TO_DEVICE); 649 + tx_ring_dma = dma_map_single( bp->sdev->dev, tx_ring,655 + tx_ring_dma = dma_map_single(&bp->sdev->dev, tx_ring, 650 656 + DMA_TABLE_BYTES, 651 657 + DMA_TO_DEVICE); … … 653 659 if (dma_mapping_error(tx_ring_dma) || 654 660 tx_ring_dma + size > DMA_30BIT_MASK) { 655 @@ -128 2,7 +1228,9 @@661 @@ -1285,7 +1231,9 @@ 656 662 /* bp->lock is held. */ 657 663 static void b44_chip_reset(struct b44 *bp) … … 664 670 bw32(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE); 665 671 b44_wait_bit(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE, 200, 1); 666 @@ -129 4,19 +1242,23 @@672 @@ -1297,19 +1245,23 @@ 667 673 } 668 674 bw32(bp, B44_DMARX_CTRL, 0); … … 682 688 - bw32(bp, B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE | 683 689 + switch (sdev->bus->bustype) { 684 + case SSB_BUSTYPE_SSB: 690 + case SSB_BUSTYPE_SSB: 685 691 + bw32(bp, B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE | 686 692 + (((ssb_clockspeed(sdev->bus) + (B44_MDC_RATIO / 2)) / B44_MDC_RATIO) … … 696 702 697 703 if (!(br32(bp, B44_DEVCTRL) & DEVCTRL_IPP)) { 698 @@ -13 49,6 +1301,7 @@704 @@ -1352,6 +1304,7 @@ 699 705 { 700 706 struct b44 *bp = netdev_priv(dev); … … 704 710 if (netif_running(dev)) 705 711 return -EBUSY; 706 @@ -13 59,7 +1312,11 @@712 @@ -1362,7 +1315,11 @@ 707 713 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); 708 714 709 715 spin_lock_irq(&bp->lock); 710 716 - __b44_set_mac_addr(bp); 711 + 717 + 712 718 + val = br32(bp, B44_RXCONFIG); 713 719 + if (!(val & RXCONFIG_CAM_ABSENT)) 714 720 + __b44_set_mac_addr(bp); 715 + 721 + 716 722 spin_unlock_irq(&bp->lock); 717 723 718 724 return 0; 719 @@ -144 5,18 +1402,6 @@725 @@ -1448,18 +1405,6 @@ 720 726 return err; 721 727 } … … 736 742 /* 737 743 * Polling receive - used by netconsole and other diagnostic tools 738 @@ -157 0,7 +1515,6 @@744 @@ -1574,7 +1519,6 @@ 739 745 static void b44_setup_wol(struct b44 *bp) 740 746 { … … 744 750 bw32(bp, B44_RXCONFIG, RXCONFIG_ALLMULTI); 745 751 746 @@ -159 4,13 +1538,6 @@752 @@ -1598,13 +1542,6 @@ 747 753 } else { 748 754 b44_setup_pseudo_magicp(bp); … … 758 764 759 765 static int b44_close(struct net_device *dev) 760 @@ -170 0,7 +1637,7 @@766 @@ -1704,7 +1641,7 @@ 761 767 762 768 val = br32(bp, B44_RXCONFIG); … … 767 773 bw32(bp, B44_RXCONFIG, val); 768 774 } else { 769 @@ -17 47,12 +1684,8 @@775 @@ -1751,12 +1688,8 @@ 770 776 771 777 static void b44_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info) … … 780 786 781 787 static int b44_nway_reset(struct net_device *dev) 782 @@ -20 35,6 +1968,245 @@783 .get_ ethtool_stats = b44_get_ethtool_stats,788 @@ -2040,6 +1973,245 @@ 789 .get_perm_addr = ethtool_op_get_perm_addr, 784 790 }; 785 791 … … 970 976 + 971 977 + b44_enable_ints(bp); 972 + 978 + 973 979 + return 0; 974 980 + } … … 1015 1021 + 1016 1022 + b44_enable_ints(bp); 1017 + 1023 + 1018 1024 + return 0; 1019 1025 + } … … 1026 1032 { 1027 1033 struct mii_ioctl_data *data = if_mii(ifr); 1028 @@ -204 4,40 +2216,64 @@1034 @@ -2049,40 +2221,64 @@ 1029 1035 if (!netif_running(dev)) 1030 1036 goto out; … … 1094 1100 - goto out; 1095 1101 + bp->dma_offset = ssb_dma_translation(sdev); 1096 1097 - bp->dev->dev_addr[0] = eeprom[79]; 1098 - bp->dev->dev_addr[1] = eeprom[78]; 1099 - bp->dev->dev_addr[2] = eeprom[81]; 1100 - bp->dev->dev_addr[3] = eeprom[80]; 1101 - bp->dev->dev_addr[4] = eeprom[83]; 1102 - bp->dev->dev_addr[5] = eeprom[82]; 1102 + 1103 1103 + switch (instance) { 1104 1104 + case 1: … … 1111 1111 + break; 1112 1112 + } 1113 + 1113 1114 - bp->dev->dev_addr[0] = eeprom[79]; 1115 - bp->dev->dev_addr[1] = eeprom[78]; 1116 - bp->dev->dev_addr[2] = eeprom[81]; 1117 - bp->dev->dev_addr[3] = eeprom[80]; 1118 - bp->dev->dev_addr[4] = eeprom[83]; 1119 - bp->dev->dev_addr[5] = eeprom[82]; 1114 1120 + memcpy(bp->dev->dev_addr, addr, 6); 1115 1121 1116 1122 if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){ 1117 1123 printk(KERN_ERR PFX "Invalid MAC address found in EEPROM\n"); 1118 @@ -20 86,103 +2282,52 @@1124 @@ -2091,108 +2287,52 @@ 1119 1125 1120 1126 memcpy(bp->dev->perm_addr, bp->dev->dev_addr, bp->dev->addr_len); … … 1122 1128 - bp->phy_addr = eeprom[90] & 0x1f; 1123 1129 - 1130 /* With this, plus the rx_header prepended to the data by the 1131 * hardware, we'll land the ethernet header on a 2-byte boundary. 1132 */ 1133 bp->rx_offset = 30; 1134 - 1124 1135 bp->imask = IMASK_DEF; 1125 1136 - 1126 1137 - bp->core_unit = ssb_core_unit(bp); 1127 1138 - bp->dma_offset = SB_PCI_DMA; … … 1129 1140 /* XXX - really required? 1130 1141 bp->flags |= B44_FLAG_BUGGY_TXPTR; 1131 */1132 1142 - */ 1143 - 1133 1144 - if (ssb_get_core_rev(bp) >= 7) 1134 + if (bp->sdev->id.revision >= 7) 1135 bp->flags |= B44_FLAG_B0_ANDLATER; 1145 - bp->flags |= B44_FLAG_B0_ANDLATER; 1146 + */ 1136 1147 1137 1148 -out: … … 1197 1208 if (!dev) { 1198 1209 - dev_err(&pdev->dev, "Etherdev alloc failed, aborting.\n"); 1199 + dev_err( sdev->dev, "Etherdev alloc failed, aborting.\n");1210 + dev_err(&sdev->dev, "Etherdev alloc failed, aborting.\n"); 1200 1211 err = -ENOMEM; 1201 1212 - goto err_out_free_res; … … 1205 1216 SET_MODULE_OWNER(dev); 1206 1217 - SET_NETDEV_DEV(dev,&pdev->dev); 1207 + SET_NETDEV_DEV(dev, sdev->dev);1218 + SET_NETDEV_DEV(dev,&sdev->dev); 1208 1219 1209 1220 /* No interesting netdevice features in this card... */ … … 1229 1240 bp->tx_pending = B44_DEF_TX_RING_PENDING; 1230 1241 1231 @@ -22 01,16 +2346,16 @@1242 @@ -2211,16 +2351,16 @@ 1232 1243 dev->poll_controller = b44_poll_controller; 1233 1244 #endif … … 1242 1253 if (err) { 1243 1254 - dev_err(&pdev->dev, 1244 + dev_err( sdev->dev,1255 + dev_err(&sdev->dev, 1245 1256 "Problem fetching invariants of chip, aborting.\n"); 1246 1257 - goto err_out_iounmap; … … 1249 1260 1250 1261 bp->mii_if.dev = dev; 1251 @@ -22 29,61 +2374,52 @@1262 @@ -2239,61 +2379,52 @@ 1252 1263 1253 1264 err = register_netdev(dev); … … 1255 1266 - dev_err(&pdev->dev, "Cannot register net device, aborting.\n"); 1256 1267 - goto err_out_iounmap; 1257 + dev_err( sdev->dev, "Cannot register net device, aborting.\n");1268 + dev_err(&sdev->dev, "Cannot register net device, aborting.\n"); 1258 1269 + goto out; 1259 1270 } … … 1327 1338 del_timer_sync(&bp->timer); 1328 1339 1329 @@ -23 01,33 +2437,22@@1340 @@ -2311,26 +2442,16 @@ 1330 1341 b44_init_hw(bp, B44_PARTIAL_RESET); 1331 1342 b44_setup_wol(bp); … … 1357 1368 return 0; 1358 1369 1359 rc = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev); 1360 if (rc) { 1361 printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name); 1362 - pci_disable_device(pdev); 1363 return rc; 1364 } 1365 1366 @@ -2346,29 +2471,31 @@ 1370 @@ -2356,29 +2477,31 @@ 1367 1371 return 0; 1368 1372 } … … 1402 1406 1403 1407 module_init(b44_init); 1404 Index: linux-2.6.2 3/drivers/net/b44.h1408 Index: linux-2.6.22-rc4/drivers/net/b44.h 1405 1409 =================================================================== 1406 --- linux-2.6.23.orig/drivers/net/b44.h 2007-10-13 10:58:27.880607722 +0200 1407 +++ linux-2.6.23/drivers/net/b44.h 2007-10-13 11:00:46.904530245 +0200 1410 --- linux-2.6.22-rc4.orig/drivers/net/b44.h 2007-06-10 21:32:13.000000000 +0100 1411 +++ linux-2.6.22-rc4/drivers/net/b44.h 2007-06-10 21:33:15.000000000 +0100 1412 @@ -129,6 +129,7 @@ 1413 #define RXCONFIG_FLOW 0x00000020 /* Flow Control Enable */ 1414 #define RXCONFIG_FLOW_ACCEPT 0x00000040 /* Accept Unicast Flow Control Frame */ 1415 #define RXCONFIG_RFILT 0x00000080 /* Reject Filter */ 1416 +#define RXCONFIG_CAM_ABSENT 0x00000100 /* CAM Absent */ 1417 #define B44_RXMAXLEN 0x0404UL /* EMAC RX Max Packet Length */ 1418 #define B44_TXMAXLEN 0x0408UL /* EMAC TX Max Packet Length */ 1419 #define B44_MDIO_CTRL 0x0410UL /* EMAC MDIO Control */ 1408 1420 @@ -227,75 +228,9 @@ 1409 1421 #define B44_RX_PAUSE 0x05D4UL /* MIB RX Pause Packets */ … … 1511 1523 #define B44_FLAG_FULL_DUPLEX 0x00010000 1512 1524 #define B44_FLAG_100_BASE_T 0x00020000 1513 @@ -45 0,8 +388,7 @@1525 @@ -452,8 +390,7 @@ 1514 1526 struct net_device_stats stats; 1515 1527 struct b44_hw_stats hw_stats; … … 1521 1533 1522 1534 dma_addr_t rx_ring_dma, tx_ring_dma; 1523 Index: linux-2.6.2 3/drivers/net/Kconfig1535 Index: linux-2.6.22-rc4/drivers/net/Kconfig 1524 1536 =================================================================== 1525 --- linux-2.6.2 3.orig/drivers/net/Kconfig 2007-10-13 10:58:27.888608180 +02001526 +++ linux-2.6.2 3/drivers/net/Kconfig 2007-10-13 11:00:46.912530699 +02001527 @@ -15 77,7 +1577,7 @@1537 --- linux-2.6.22-rc4.orig/drivers/net/Kconfig 2007-06-10 21:32:48.000000000 +0100 1538 +++ linux-2.6.22-rc4/drivers/net/Kconfig 2007-06-10 21:33:15.000000000 +0100 1539 @@ -1511,7 +1511,7 @@ 1528 1540 1529 1541 config B44 trunk/freewrt/target/linux/brcm-2.6/patches/2130-remove_scache.patch
r3686 r3693 1 Index: linux-2.6.2 3/arch/mips/Kconfig1 Index: linux-2.6.22-rc4/arch/mips/Kconfig 2 2 =================================================================== 3 --- linux-2.6.2 3.orig/arch/mips/Kconfig 2007-10-13 02:23:41.484492317 +02004 +++ linux-2.6.2 3/arch/mips/Kconfig 2007-10-13 02:47:02.784347843 +02005 @@ - 192,7 +192,6 @@3 --- linux-2.6.22-rc4.orig/arch/mips/Kconfig 2007-06-10 21:33:12.000000000 +0100 4 +++ linux-2.6.22-rc4/arch/mips/Kconfig 2007-06-10 21:33:17.000000000 +0100 5 @@ -202,7 +202,6 @@ 6 6 select I8259 7 7 select MIPS_BOARDS_GEN … … 11 11 select MIPS_MSC 12 12 select SWAP_IO_SPACE 13 @@ -1 281,13 +1280,6 @@13 @@ -1345,13 +1344,6 @@ 14 14 bool 15 15 select BOARD_SCACHE … … 25 25 bool 26 26 select BOARD_SCACHE 27 Index: linux-2.6.2 3/arch/mips/kernel/cpu-probe.c27 Index: linux-2.6.22-rc4/arch/mips/kernel/cpu-probe.c 28 28 =================================================================== 29 --- linux-2.6.2 3.orig/arch/mips/kernel/cpu-probe.c 2007-10-13 02:23:11.210767122 +020030 +++ linux-2.6.2 3/arch/mips/kernel/cpu-probe.c 2007-10-13 02:47:02.788348072 +020031 @@ - 701,6 +701,8 @@29 --- linux-2.6.22-rc4.orig/arch/mips/kernel/cpu-probe.c 2007-06-10 21:33:12.000000000 +0100 30 +++ linux-2.6.22-rc4/arch/mips/kernel/cpu-probe.c 2007-06-10 21:33:17.000000000 +0100 31 @@ -619,6 +619,8 @@ 32 32 break; 33 33 case PRID_IMP_25KF: … … 38 38 case PRID_IMP_34K: 39 39 c->cputype = CPU_34K; 40 Index: linux-2.6.2 3/arch/mips/mm/c-r4k.c40 Index: linux-2.6.22-rc4/arch/mips/mm/c-r4k.c 41 41 =================================================================== 42 --- linux-2.6.2 3.orig/arch/mips/mm/c-r4k.c 2007-10-09 22:31:38.000000000 +020043 +++ linux-2.6.2 3/arch/mips/mm/c-r4k.c 2007-10-13 02:47:02.792348301 +020044 @@ -10 86,7 +1086,6 @@42 --- linux-2.6.22-rc4.orig/arch/mips/mm/c-r4k.c 2007-06-10 21:32:13.000000000 +0100 43 +++ linux-2.6.22-rc4/arch/mips/mm/c-r4k.c 2007-06-10 21:33:17.000000000 +0100 44 @@ -1038,7 +1038,6 @@ 45 45 46 46 extern int r5k_sc_init(void); … … 50 50 static void __init setup_scache(void) 51 51 { 52 @@ -1 140,29 +1139,17 @@53 #endif52 @@ -1086,29 +1085,17 @@ 53 return; 54 54 55 55 default: … … 85 85 c->scache.waysize = scache_size / c->scache.ways; 86 86 87 Index: linux-2.6.2 3/arch/mips/mm/Makefile87 Index: linux-2.6.22-rc4/arch/mips/mm/Makefile 88 88 =================================================================== 89 --- linux-2.6.2 3.orig/arch/mips/mm/Makefile 2007-10-09 22:31:38.000000000 +020090 +++ linux-2.6.2 3/arch/mips/mm/Makefile 2007-10-13 02:47:23.393522295 +020091 @@ -3 1,6 +31,5@@89 --- linux-2.6.22-rc4.orig/arch/mips/mm/Makefile 2007-06-10 21:32:13.000000000 +0100 90 +++ linux-2.6.22-rc4/arch/mips/mm/Makefile 2007-06-10 21:33:17.000000000 +0100 91 @@ -30,4 +30,3 @@ 92 92 obj-$(CONFIG_IP22_CPU_SCACHE) += sc-ip22.o 93 93 obj-$(CONFIG_R5000_CPU_SCACHE) += sc-r5k.o 94 94 obj-$(CONFIG_RM7000_CPU_SCACHE) += sc-rm7k.o 95 95 -obj-$(CONFIG_MIPS_CPU_SCACHE) += sc-mips.o 96 97 EXTRA_CFLAGS += -Werrortrunk/freewrt/target/linux/brcm-2.6/patches/2150-cpu_fixes.patch
r3686 r3693 1 Index: linux-2.6.2 3/arch/mips/kernel/genex.S1 Index: linux-2.6.22/arch/mips/kernel/genex.S 2 2 =================================================================== 3 --- linux-2.6.2 3.orig/arch/mips/kernel/genex.S 2007-10-13 11:29:46.219648163 +02004 +++ linux-2.6.2 3/arch/mips/kernel/genex.S 2007-10-13 11:29:49.619841933+02003 --- linux-2.6.22.orig/arch/mips/kernel/genex.S 2007-07-26 06:29:25.057170943 +0200 4 +++ linux-2.6.22/arch/mips/kernel/genex.S 2007-07-26 06:29:40.890073208 +0200 5 5 @@ -51,6 +51,10 @@ 6 6 NESTED(except_vec3_generic, 0, sp) … … 14 14 mfc0 k0, CP0_INDEX 15 15 #endif 16 Index: linux-2.6.2 3/arch/mips/mm/c-r4k.c16 Index: linux-2.6.22/arch/mips/mm/c-r4k.c 17 17 =================================================================== 18 --- linux-2.6.2 3.orig/arch/mips/mm/c-r4k.c 2007-10-13 11:29:46.227648623+020019 +++ linux-2.6.2 3/arch/mips/mm/c-r4k.c 2007-10-13 11:29:49.619841933+020020 @@ - 30,6 +30,9 @@18 --- linux-2.6.22.orig/arch/mips/mm/c-r4k.c 2007-07-26 06:29:40.826069560 +0200 19 +++ linux-2.6.22/arch/mips/mm/c-r4k.c 2007-07-26 06:32:45.956619550 +0200 20 @@ -29,6 +29,9 @@ 21 21 #include <asm/cacheflush.h> /* for run_uncached() */ 22 22 … … 28 28 * Special Variant of smp_call_function for use by cache functions: 29 29 * 30 @@ -94,6 +97,9 @@ 30 @@ -85,14 +88,21 @@ 31 32 static inline void r4k_blast_dcache_page_dc32(unsigned long addr) 33 { 34 + unsigned long flags; 35 + 36 + local_irq_save(flags); 37 R4600_HIT_CACHEOP_WAR_IMPL; 38 blast_dcache32_page(addr); 39 + local_irq_restore(flags); 40 } 41 42 static void __init r4k_blast_dcache_page_setup(void) 31 43 { 32 44 unsigned long dc_lsize = cpu_dcache_line_size(); … … 38 50 r4k_blast_dcache_page = (void *)cache_noop; 39 51 else if (dc_lsize == 16) 40 @@ -10 8,6 +114,9 @@52 @@ -107,6 +117,9 @@ 41 53 { 42 54 unsigned long dc_lsize = cpu_dcache_line_size(); … … 48 60 r4k_blast_dcache_page_indexed = (void *)cache_noop; 49 61 else if (dc_lsize == 16) 50 @@ -12 2,6 +131,9 @@62 @@ -121,6 +134,9 @@ 51 63 { 52 64 unsigned long dc_lsize = cpu_dcache_line_size(); … … 58 70 r4k_blast_dcache = (void *)cache_noop; 59 71 else if (dc_lsize == 16) 60 @@ -623,6 +635,8 @@ 72 @@ -202,8 +218,12 @@ 73 74 static void (* r4k_blast_icache_page)(unsigned long addr); 75 76 +static void r4k_flush_cache_all(void); 77 static void __init r4k_blast_icache_page_setup(void) 78 { 79 +#ifdef CONFIG_BCM947XX 80 + r4k_blast_icache_page = (void *)r4k_flush_cache_all; 81 +#else 82 unsigned long ic_lsize = cpu_icache_line_size(); 83 84 if (ic_lsize == 0) 85 @@ -214,6 +234,7 @@ 86 r4k_blast_icache_page = blast_icache32_page; 87 else if (ic_lsize == 64) 88 r4k_blast_icache_page = blast_icache64_page; 89 +#endif 90 } 91 92 93 @@ -221,6 +242,9 @@ 94 95 static void __init r4k_blast_icache_page_indexed_setup(void) 96 { 97 +#ifdef CONFIG_BCM947XX 98 + r4k_blast_icache_page_indexed = (void *)r4k_flush_cache_all; 99 +#else 100 unsigned long ic_lsize = cpu_icache_line_size(); 101 102 if (ic_lsize == 0) 103 @@ -239,6 +263,7 @@ 104 blast_icache32_page_indexed; 105 } else if (ic_lsize == 64) 106 r4k_blast_icache_page_indexed = blast_icache64_page_indexed; 107 +#endif 108 } 109 110 static void (* r4k_blast_icache)(void); 111 @@ -322,12 +347,17 @@ 112 */ 113 static inline void local_r4k_flush_cache_all(void * args) 114 { 115 + unsigned long flags; 116 + 117 + local_irq_save(flags); 118 r4k_blast_dcache(); 119 + r4k_blast_icache(); 120 + local_irq_restore(flags); 121 } 122 123 static void r4k_flush_cache_all(void) 124 { 125 - if (!cpu_has_dc_aliases) 126 + if (!cpu_has_dc_aliases && cpu_use_kmap_coherent) 127 return; 128 129 r4k_on_each_cpu(local_r4k_flush_cache_all, NULL, 1, 1); 130 @@ -335,6 +365,9 @@ 131 132 static inline void local_r4k___flush_cache_all(void * args) 133 { 134 + unsigned long flags; 135 + 136 + local_irq_save(flags); 137 r4k_blast_dcache(); 138 r4k_blast_icache(); 139 140 @@ -348,6 +381,7 @@ 141 case CPU_R14000: 142 r4k_blast_scache(); 143 } 144 + local_irq_restore(flags); 145 } 146 147 static void r4k___flush_cache_all(void) 148 @@ -358,17 +392,21 @@ 149 static inline void local_r4k_flush_cache_range(void * args) 150 { 151 struct vm_area_struct *vma = args; 152 + unsigned long flags; 153 154 if (!(cpu_context(smp_processor_id(), vma->vm_mm))) 155 return; 156 157 + local_irq_save(flags); 158 r4k_blast_dcache(); 159 + r4k_blast_icache(); 160 + local_irq_restore(flags); 161 } 162 163 static void r4k_flush_cache_range(struct vm_area_struct *vma, 164 unsigned long start, unsigned long end) 165 { 166 - if (!cpu_has_dc_aliases) 167 + if (!cpu_has_dc_aliases && cpu_use_kmap_coherent) 168 return; 169 170 r4k_on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1); 171 @@ -377,6 +415,7 @@ 172 static inline void local_r4k_flush_cache_mm(void * args) 173 { 174 struct mm_struct *mm = args; 175 + unsigned long flags; 176 177 if (!cpu_context(smp_processor_id(), mm)) 178 return; 179 @@ -395,12 +434,15 @@ 180 return; 181 } 182 183 + local_irq_save(flags); 184 r4k_blast_dcache(); 185 + r4k_blast_icache(); 186 + local_irq_restore(flags); 187 } 188 189 static void r4k_flush_cache_mm(struct mm_struct *mm) 190 { 191 - if (!cpu_has_dc_aliases) 192 + if (!cpu_has_dc_aliases && cpu_use_kmap_coherent) 193 return; 194 195 r4k_on_each_cpu(local_r4k_flush_cache_mm, mm, 1, 1); 196 @@ -420,6 +462,7 @@ 197 unsigned long paddr = fcp_args->pfn << PAGE_SHIFT; 198 int exec = vma->vm_flags & VM_EXEC; 199 struct mm_struct *mm = vma->vm_mm; 200 + unsigned long flags; 201 pgd_t *pgdp; 202 pud_t *pudp; 203 pmd_t *pmdp; 204 @@ -451,8 +494,9 @@ 205 * for every cache flush operation. So we do indexed flushes 206 * in that case, which doesn't overly flush the cache too much. 207 */ 208 + local_irq_save(flags); 209 if ((mm == current->active_mm) && (pte_val(*ptep) & _PAGE_VALID)) { 210 - if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) { 211 + if (!cpu_use_kmap_coherent || cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) { 212 r4k_blast_dcache_page(addr); 213 if (exec && !cpu_icache_snoops_remote_store) 214 r4k_blast_scache_page(addr); 215 @@ -460,14 +504,14 @@ 216 if (exec) 217 r4k_blast_icache_page(addr); 218 219 - return; 220 + goto done; 221 } 222 223 /* 224 * Do indexed flush, too much work to get the (possible) TLB refills 225 * to work correctly. 226 */ 227 - if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) { 228 + if (!cpu_use_kmap_coherent || cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) { 229 r4k_blast_dcache_page_indexed(cpu_has_pindexed_dcache ? 230 paddr : addr); 231 if (exec && !cpu_icache_snoops_remote_store) { 232 @@ -483,6 +527,8 @@ 233 } else 234 r4k_blast_icache_page_indexed(addr); 235 } 236 +done: 237 + local_irq_restore(flags); 238 } 239 240 static void r4k_flush_cache_page(struct vm_area_struct *vma, 241 @@ -499,7 +545,11 @@ 242 243 static inline void local_r4k_flush_data_cache_page(void * addr) 244 { 245 + unsigned long flags; 246 + 247 + local_irq_save(flags); 248 r4k_blast_dcache_page((unsigned long) addr); 249 + local_irq_restore(flags); 250 } 251 252 static void r4k_flush_data_cache_page(unsigned long addr) 253 @@ -542,6 +592,9 @@ 254 255 static void r4k_flush_icache_range(unsigned long start, unsigned long end) 256 { 257 +#ifdef CONFIG_BCM947XX 258 + r4k_flush_cache_all(); 259 +#else 260 struct flush_icache_range_args args; 261 262 args.start = start; 263 @@ -549,12 +602,15 @@ 264 265 r4k_on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1); 266 instruction_hazard(); 267 +#endif 268 } 269 270 #ifdef CONFIG_DMA_NONCOHERENT 271 272 static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) 273 { 274 + unsigned long flags; 275 + 276 /* Catch bad driver code */ 277 BUG_ON(size == 0); 278 279 @@ -571,18 +627,21 @@ 280 * subset property so we have to flush the primary caches 281 * explicitly 282 */ 283 + local_irq_save(flags); 284 if (size >= dcache_size) { 285 r4k_blast_dcache(); 286 } else { 287 R4600_HIT_CACHEOP_WAR_IMPL; 288 blast_dcache_range(addr, addr + size); 289 } 290 - 291 bc_wback_inv(addr, size); 292 + local_irq_restore(flags); 293 } 294 295 static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) 296 { 297 + unsigned long flags; 298 + 299 /* Catch bad driver code */ 300 BUG_ON(size == 0); 301 302 @@ -594,6 +653,7 @@ 303 return; 304 } 305 306 + local_irq_save(flags); 307 if (size >= dcache_size) { 308 r4k_blast_dcache(); 309 } else { 310 @@ -602,6 +662,7 @@ 311 } 312 313 bc_inv(addr, size); 314 + local_irq_restore(flags); 315 } 316 #endif /* CONFIG_DMA_NONCOHERENT */ 317 318 @@ -616,8 +677,12 @@ 319 unsigned long dc_lsize = cpu_dcache_line_size(); 320 unsigned long sc_lsize = cpu_scache_line_size(); 61 321 unsigned long addr = (unsigned long) arg; 62 322 + unsigned long flags; 323 324 + local_irq_save(flags); 63 325 R4600_HIT_CACHEOP_WAR_IMPL; 64 326 + BCM4710_PROTECTED_FILL_TLB(addr); … … 67 329 protected_writeback_dcache_line(addr & ~(dc_lsize - 1)); 68 330 if (!cpu_icache_snoops_remote_store && scache_size) 69 @@ -1198,6 +1212,17 @@ 331 @@ -644,6 +709,7 @@ 332 } 333 if (MIPS_CACHE_SYNC_WAR) 334 __asm__ __volatile__ ("sync"); 335 + local_irq_restore(flags); 336 } 337 338 static void r4k_flush_cache_sigtramp(unsigned long addr) 339 @@ -1144,6 +1210,17 @@ 70 340 * silly idea of putting something else there ... 71 341 */ … … 85 355 case CPU_R4000SC: 86 356 case CPU_R4000MC: 87 @@ -1 228,6 +1253,15 @@357 @@ -1174,6 +1251,15 @@ 88 358 /* Default cache error handler for R4000 and R5000 family */ 89 359 set_uncached_handler (0x100, &except_vec2_generic, 0x80); … … 101 371 setup_scache(); 102 372 103 @@ -12 73,5 +1307,13 @@373 @@ -1219,5 +1305,13 @@ 104 374 build_clear_page(); 105 375 build_copy_page(); … … 115 385 +#endif 116 386 } 117 Index: linux-2.6.2 3/arch/mips/mm/tlbex.c387 Index: linux-2.6.22/arch/mips/mm/tlbex.c 118 388 =================================================================== 119 --- linux-2.6.23.orig/arch/mips/mm/tlbex.c 2007-10-13 11:29:46.235649074 +0200 120 +++ linux-2.6.23/arch/mips/mm/tlbex.c 2007-10-13 11:35:46.076155216 +0200 121 @@ -1273,6 +1273,9 @@ 122 /* No need for i_nop */ 123 } 389 --- linux-2.6.22.orig/arch/mips/mm/tlbex.c 2007-07-26 06:29:40.582055658 +0200 390 +++ linux-2.6.22/arch/mips/mm/tlbex.c 2007-07-26 06:32:45.964620005 +0200 391 @@ -1229,6 +1229,10 @@ 392 #endif 393 } 394 395 +#ifdef CONFIG_BCM947XX 396 +extern int bcm4710; 397 +#endif 398 + 399 static void __init build_r4000_tlb_refill_handler(void) 400 { 401 u32 *p = tlb_handler; 402 @@ -1243,6 +1247,10 @@ 403 memset(relocs, 0, sizeof(relocs)); 404 memset(final_handler, 0, sizeof(final_handler)); 124 405 125 406 +#ifdef CONFIG_BCM947XX 126 407 + i_nop(&p); 127 408 +#endif 128 #ifdef CONFIG_64BIT 129 build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */ 130 #else 131 @@ -1708,6 +1711,9 @@ 132 struct reloc **r, unsigned int pte, 133 unsigned int ptr) 134 { 135 +#ifdef CONFIG_BCM947XX 136 + i_nop(p); 137 +#endif 138 #ifdef CONFIG_64BIT 139 build_get_pmde64(p, l, r, pte, ptr); /* get pmd in ptr */ 140 #else 141 Index: linux-2.6.23/include/asm-mips/r4kcache.h 409 + 410 /* 411 * create the plain linear handler 412 */ 413 @@ -1736,6 +1744,9 @@ 414 memset(labels, 0, sizeof(labels)); 415 memset(relocs, 0, sizeof(relocs)); 416 417 +#ifdef CONFIG_BCM947XX 418 + i_nop(&p); 419 +#endif 420 if (bcm1250_m3_war()) { 421 i_MFC0(&p, K0, C0_BADVADDR); 422 i_MFC0(&p, K1, C0_ENTRYHI); 423 Index: linux-2.6.22/include/asm-mips/r4kcache.h 142 424 =================================================================== 143 --- linux-2.6.2 3.orig/include/asm-mips/r4kcache.h 2007-10-13 11:29:46.255650214+0200144 +++ linux-2.6.2 3/include/asm-mips/r4kcache.h 2007-10-13 11:29:49.631842613 +0200425 --- linux-2.6.22.orig/include/asm-mips/r4kcache.h 2007-07-26 06:29:25.085172538 +0200 426 +++ linux-2.6.22/include/asm-mips/r4kcache.h 2007-07-26 06:29:40.938075943 +0200 145 427 @@ -17,6 +17,20 @@ 146 428 #include <asm/cpu-features.h> … … 345 627 346 628 #endif /* _ASM_R4KCACHE_H */ 347 Index: linux-2.6.2 3/include/asm-mips/stackframe.h629 Index: linux-2.6.22/include/asm-mips/stackframe.h 348 630 =================================================================== 349 --- linux-2.6.2 3.orig/include/asm-mips/stackframe.h 2007-10-13 11:29:46.263650671+0200350 +++ linux-2.6.2 3/include/asm-mips/stackframe.h 2007-10-13 11:33:38.504885346+0200631 --- linux-2.6.22.orig/include/asm-mips/stackframe.h 2007-07-26 06:29:25.093172994 +0200 632 +++ linux-2.6.22/include/asm-mips/stackframe.h 2007-07-26 06:29:40.962077312 +0200 351 633 @@ -350,6 +350,10 @@ 352 634 .macro RESTORE_SP_AND_RET trunk/freewrt/target/linux/brcm-2.6/patches/2160-kmap_coherent.patch
r3686 r3693 1 Index: linux-2.6.2 3/arch/mips/mm/init.c1 Index: linux-2.6.22-rc6/arch/mips/mm/init.c 2 2 =================================================================== 3 --- linux-2.6.2 3.orig/arch/mips/mm/init.c 2007-10-09 22:31:38.000000000 +02004 +++ linux-2.6.2 3/arch/mips/mm/init.c 2007-10-13 02:57:18.483434538+02005 @@ -2 11,7 +211,7 @@3 --- linux-2.6.22-rc6.orig/arch/mips/mm/init.c 2007-07-04 02:17:11.423962000 +0200 4 +++ linux-2.6.22-rc6/arch/mips/mm/init.c 2007-07-04 02:17:31.269202250 +0200 5 @@ -207,7 +207,7 @@ 6 6 void *vfrom, *vto; 7 7 8 8 vto = kmap_atomic(to, KM_USER1); 9 - if (cpu_has_dc_aliases && !Page_dcache_dirty(from)) {10 + if (cpu_has_dc_aliases && cpu_use_kmap_coherent && !Page_dcache_dirty(from)) {9 - if (cpu_has_dc_aliases) { 10 + if (cpu_has_dc_aliases && cpu_use_kmap_coherent) { 11 11 vfrom = kmap_coherent(from, vaddr); 12 12 copy_page(vto, vfrom); 13 13 kunmap_coherent(); 14 @@ -23 4,7 +234,7 @@14 @@ -230,7 +230,7 @@ 15 15 struct page *page, unsigned long vaddr, void *dst, const void *src, 16 16 unsigned long len) … … 21 21 memcpy(vto, src, len); 22 22 kunmap_coherent(); 23 @@ -2 50,7 +250,7 @@23 @@ -246,7 +246,7 @@ 24 24 struct page *page, unsigned long vaddr, void *dst, const void *src, 25 25 unsigned long len) … … 30 30 kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); 31 31 memcpy(dst, vfrom, len); 32 Index: linux-2.6.2 3/include/asm-mips/mach-bcm947xx/cpu-feature-overrides.h32 Index: linux-2.6.22-rc6/include/asm-mips/mach-bcm947xx/cpu-feature-overrides.h 33 33 =================================================================== 34 34 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 35 +++ linux-2.6.2 3/include/asm-mips/mach-bcm947xx/cpu-feature-overrides.h 2007-10-13 02:56:22.020216880 +020035 +++ linux-2.6.22-rc6/include/asm-mips/mach-bcm947xx/cpu-feature-overrides.h 2007-07-04 02:17:31.273202500 +0200 36 36 @@ -0,0 +1,13 @@ 37 37 +/* … … 48 48 + 49 49 +#endif /* __ASM_MACH_BCM947XX_CPU_FEATURE_OVERRIDES_H */ 50 Index: linux-2.6.2 3/include/asm-mips/cpu-features.h50 Index: linux-2.6.22-rc6/include/asm-mips/cpu-features.h 51 51 =================================================================== 52 --- linux-2.6.2 3.orig/include/asm-mips/cpu-features.h 2007-10-09 22:31:38.000000000 +020053 +++ linux-2.6.2 3/include/asm-mips/cpu-features.h 2007-10-13 02:56:22.028217337+020052 --- linux-2.6.22-rc6.orig/include/asm-mips/cpu-features.h 2007-07-04 02:17:11.455964000 +0200 53 +++ linux-2.6.22-rc6/include/asm-mips/cpu-features.h 2007-07-04 02:17:31.305204500 +0200 54 54 @@ -101,6 +101,9 @@ 55 55 #ifndef cpu_has_pindexed_dcache&nbs
