Date: Wed, 22 Feb 2006 18:01:10 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 92212 for review Message-ID: <200602221801.k1MI1Aob069613@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=92212 Change 92212 by marcel@marcel_nfs on 2006/02/22 18:00:55 IFC @92211 Affected files ... .. //depot/projects/uart/amd64/amd64/identcpu.c#8 integrate .. //depot/projects/uart/arm/at91/at91st.c#2 delete .. //depot/projects/uart/arm/at91/files.at91#1 branch .. //depot/projects/uart/arm/at91/files.at91rm92#2 delete .. //depot/projects/uart/arm/at91/std.at91#1 branch .. //depot/projects/uart/arm/at91/std.at91rm92#2 delete .. //depot/projects/uart/arm/at91/std.kb920x#2 integrate .. //depot/projects/uart/conf/kmod.mk#18 integrate .. //depot/projects/uart/dev/acpica/acpi_smbat.c#3 integrate .. //depot/projects/uart/dev/acpica/acpi_throttle.c#4 integrate .. //depot/projects/uart/dev/ata/ata-chipset.c#16 integrate .. //depot/projects/uart/dev/ata/ata-pci.c#13 integrate .. //depot/projects/uart/dev/ata/ata-pci.h#13 integrate .. //depot/projects/uart/dev/ata/ata-raid.c#10 integrate .. //depot/projects/uart/dev/ata/ata-raid.h#8 integrate .. //depot/projects/uart/dev/ath/if_ath.c#22 integrate .. //depot/projects/uart/dev/ath/if_athvar.h#16 integrate .. //depot/projects/uart/dev/bge/if_bge.c#22 integrate .. //depot/projects/uart/dev/ed/if_ed_cbus.c#11 integrate .. //depot/projects/uart/dev/em/if_em.c#20 integrate .. //depot/projects/uart/dev/em/if_em.h#18 integrate .. //depot/projects/uart/dev/em/if_em_osdep.h#6 integrate .. //depot/projects/uart/dev/fdc/fdc_acpi.c#3 integrate .. //depot/projects/uart/dev/ichwd/ichwd.c#3 integrate .. //depot/projects/uart/dev/ichwd/ichwd.h#3 integrate .. //depot/projects/uart/dev/isp/isp.c#11 integrate .. //depot/projects/uart/dev/isp/isp_freebsd.c#12 integrate .. //depot/projects/uart/dev/isp/isp_freebsd.h#9 integrate .. //depot/projects/uart/dev/isp/isp_ioctl.h#6 integrate .. //depot/projects/uart/dev/isp/isp_library.c#2 integrate .. //depot/projects/uart/dev/isp/isp_library.h#2 integrate .. //depot/projects/uart/dev/isp/isp_pci.c#11 integrate .. //depot/projects/uart/dev/isp/isp_sbus.c#9 integrate .. //depot/projects/uart/dev/isp/isp_target.c#7 integrate .. //depot/projects/uart/dev/isp/isp_target.h#6 integrate .. //depot/projects/uart/dev/isp/isp_tpublic.h#5 integrate .. //depot/projects/uart/dev/isp/ispmbox.h#6 integrate .. //depot/projects/uart/dev/isp/ispreg.h#4 integrate .. //depot/projects/uart/dev/isp/ispvar.h#10 integrate .. //depot/projects/uart/dev/iwi/if_iwi.c#5 integrate .. //depot/projects/uart/dev/le/am7990.c#2 integrate .. //depot/projects/uart/dev/le/am79900.c#2 integrate .. //depot/projects/uart/dev/mpt/mpt_cam.c#4 integrate .. //depot/projects/uart/dev/myri10ge/eth_z8e.dat.gz.uu#1 branch .. //depot/projects/uart/dev/myri10ge/ethp_z8e.dat.gz.uu#1 branch .. //depot/projects/uart/dev/myri10ge/if_myri10ge.c#1 branch .. //depot/projects/uart/dev/myri10ge/if_myri10ge_var.h#1 branch .. //depot/projects/uart/dev/myri10ge/mcp_gen_header.h#1 branch .. //depot/projects/uart/dev/myri10ge/myri10ge_mcp.h#1 branch .. //depot/projects/uart/dev/puc/puc.c#17 integrate .. //depot/projects/uart/dev/ral/if_ral.c#5 integrate .. //depot/projects/uart/dev/re/if_re.c#15 integrate .. //depot/projects/uart/dev/sound/pci/atiixp.c#3 integrate .. //depot/projects/uart/dev/sound/pci/atiixp.h#2 integrate .. //depot/projects/uart/dev/usb/if_ural.c#5 integrate .. //depot/projects/uart/dev/usb/usb_quirks.c#7 integrate .. //depot/projects/uart/dev/usb/usb_quirks.h#5 integrate .. //depot/projects/uart/dev/usb/usb_subr.c#14 integrate .. //depot/projects/uart/dev/usb/usbdevs#18 integrate .. //depot/projects/uart/fs/deadfs/dead_vnops.c#7 integrate .. //depot/projects/uart/fs/devfs/devfs_devs.c#8 integrate .. //depot/projects/uart/fs/nullfs/null_subr.c#7 integrate .. //depot/projects/uart/fs/nullfs/null_vnops.c#9 integrate .. //depot/projects/uart/fs/procfs/procfs_ctl.c#5 integrate .. //depot/projects/uart/fs/pseudofs/pseudofs_vnops.c#11 integrate .. //depot/projects/uart/geom/geom_slice.c#5 integrate .. //depot/projects/uart/geom/geom_slice.h#2 integrate .. //depot/projects/uart/geom/label/g_label.c#5 integrate .. //depot/projects/uart/geom/label/g_label_ufs.c#6 integrate .. //depot/projects/uart/geom/raid3/g_raid3.c#12 integrate .. //depot/projects/uart/i386/i386/identcpu.c#16 integrate .. //depot/projects/uart/i386/i386/pmap.c#29 integrate .. //depot/projects/uart/kern/kern_condvar.c#5 integrate .. //depot/projects/uart/kern/kern_exit.c#11 integrate .. //depot/projects/uart/kern/kern_kse.c#10 integrate .. //depot/projects/uart/kern/kern_kthread.c#5 integrate .. //depot/projects/uart/kern/kern_mbuf.c#7 integrate .. //depot/projects/uart/kern/kern_resource.c#9 integrate .. //depot/projects/uart/kern/kern_sig.c#23 integrate .. //depot/projects/uart/kern/kern_synch.c#13 integrate .. //depot/projects/uart/kern/kern_sysctl.c#8 integrate .. //depot/projects/uart/kern/kern_thread.c#20 integrate .. //depot/projects/uart/kern/subr_sleepqueue.c#8 integrate .. //depot/projects/uart/kern/uipc_domain.c#8 integrate .. //depot/projects/uart/kern/uipc_mbuf.c#10 integrate .. //depot/projects/uart/kern/uipc_mqueue.c#3 integrate .. //depot/projects/uart/kern/vfs_aio.c#12 integrate .. //depot/projects/uart/kern/vfs_mount.c#18 integrate .. //depot/projects/uart/kern/vfs_subr.c#20 integrate .. //depot/projects/uart/kern/vfs_syscalls.c#19 integrate .. //depot/projects/uart/modules/Makefile#24 integrate .. //depot/projects/uart/modules/coda5/Makefile#4 integrate .. //depot/projects/uart/modules/dummynet/Makefile#3 integrate .. //depot/projects/uart/modules/firewire/firewire/Makefile#2 integrate .. //depot/projects/uart/modules/firewire/fwe/Makefile#2 integrate .. //depot/projects/uart/modules/firewire/sbp/Makefile#3 integrate .. //depot/projects/uart/modules/firewire/sbp_targ/Makefile#3 integrate .. //depot/projects/uart/modules/if_vlan/Makefile#3 integrate .. //depot/projects/uart/modules/myri10ge/Makefile#1 branch .. //depot/projects/uart/modules/myri10ge/myri10ge/Makefile#1 branch .. //depot/projects/uart/modules/myri10ge/myri10ge_eth_z8e/Makefile#1 branch .. //depot/projects/uart/modules/myri10ge/myri10ge_ethp_z8e/Makefile#1 branch .. //depot/projects/uart/modules/netgraph/atm/Makefile#4 integrate .. //depot/projects/uart/modules/netgraph/bluetooth/Makefile#2 integrate .. //depot/projects/uart/modules/netgraph/bluetooth/bluetooth/Makefile#4 integrate .. //depot/projects/uart/modules/netgraph/bluetooth/bt3c/Makefile#4 integrate .. //depot/projects/uart/modules/netgraph/bluetooth/h4/Makefile#4 integrate .. //depot/projects/uart/modules/netgraph/bluetooth/ubt/Makefile#5 integrate .. //depot/projects/uart/modules/netgraph/bluetooth/ubtbcmfw/Makefile#5 integrate .. //depot/projects/uart/modules/nfs4client/Makefile#3 integrate .. //depot/projects/uart/modules/nfsclient/Makefile#4 integrate .. //depot/projects/uart/modules/twa/Makefile#5 integrate .. //depot/projects/uart/net/if_media.h#7 integrate .. //depot/projects/uart/net80211/ieee80211_ioctl.c#15 integrate .. //depot/projects/uart/netgraph/ng_ipfw.h#2 integrate .. //depot/projects/uart/netgraph/ng_ksocket.c#9 integrate .. //depot/projects/uart/netinet/in_pcb.c#11 integrate .. //depot/projects/uart/netinet/ip_dummynet.c#15 integrate .. //depot/projects/uart/netinet/tcp.h#7 integrate .. //depot/projects/uart/netinet/tcp_input.c#15 integrate .. //depot/projects/uart/netinet/tcp_sack.c#7 integrate .. //depot/projects/uart/netinet/tcp_subr.c#14 integrate .. //depot/projects/uart/netinet/tcp_timer.c#9 integrate .. //depot/projects/uart/netinet/tcp_timer.h#4 integrate .. //depot/projects/uart/netinet/tcp_var.h#9 integrate .. //depot/projects/uart/pci/agp_intel.c#9 integrate .. //depot/projects/uart/sparc64/sparc64/db_trace.c#7 integrate .. //depot/projects/uart/sparc64/sparc64/eeprom.c#9 integrate .. //depot/projects/uart/sparc64/sparc64/exception.S#6 integrate .. //depot/projects/uart/sparc64/sparc64/trap.c#9 integrate .. //depot/projects/uart/sys/mbuf.h#11 integrate .. //depot/projects/uart/sys/param.h#22 integrate .. //depot/projects/uart/sys/proc.h#18 integrate .. //depot/projects/uart/sys/sleepqueue.h#3 integrate .. //depot/projects/uart/sys/sysctl.h#9 integrate .. //depot/projects/uart/ufs/ufs/ufs_quota.c#9 integrate .. //depot/projects/uart/vm/vm_object.c#20 integrate .. //depot/projects/uart/vm/vm_page.c#18 integrate .. //depot/projects/uart/vm/vm_pageout.c#19 integrate Differences ... ==== //depot/projects/uart/amd64/amd64/identcpu.c#8 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.143 2006/01/01 05:35:57 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.144 2006/02/15 14:48:59 dwmalone Exp $"); #include "opt_cpu.h" @@ -224,8 +224,8 @@ "\003RSVD2" /* "Reserved" bit 2 */ "\004MON" /* MONITOR/MWAIT Instructions */ "\005DS_CPL" /* CPL Qualified Debug Store */ - "\006<b5>" /* Machine specific registers */ - "\007<b6>" /* Physical address extension */ + "\006VMX" /* Virtual Machine Extensions */ + "\007<b6>" "\010EST" /* Enhanced SpeedStep */ "\011TM2" /* Thermal Monitor 2 */ "\012<b9>" ==== //depot/projects/uart/arm/at91/std.kb920x#2 (text) ==== @@ -1,5 +1,5 @@ -#$FreeBSD: src/sys/arm/at91/std.kb920x,v 1.1 2006/02/04 23:32:13 imp Exp $ -include "../at91/std.at91rm92" +#$FreeBSD: src/sys/arm/at91/std.kb920x,v 1.2 2006/02/17 22:33:13 imp Exp $ +include "../at91/std.at91" files "../at91/files.kb920x" makeoptions KERNPHYSADDR=0x20000000 ==== //depot/projects/uart/conf/kmod.mk#18 (text+ko) ==== @@ -1,5 +1,5 @@ # From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $FreeBSD: src/sys/conf/kmod.mk,v 1.202 2006/02/04 06:22:27 imp Exp $ +# $FreeBSD: src/sys/conf/kmod.mk,v 1.205 2006/02/20 01:08:33 mlaier Exp $ # # The include file <bsd.kmod.mk> handles building and installing loadable # kernel modules. @@ -137,13 +137,15 @@ .for _firmw in ${FIRMWS} ${_firmw:C/\:.*$/.fwo/}: ${_firmw:C/\:.*$//} @${ECHO} ${_firmw:C/\:.*$//} ${.ALLSRC:M*${_firmw:C/\:.*$//}} -.if !exists(${.CURDIR}/${_firmw:C/\:.*$//}) - ln -s ${.ALLSRC:M*${_firmw:C/\:.*$//}} ${_firmw:C/\:.*$//} - ${LD} -b binary ${LDFLAGS} -r -d -o ${.TARGET} ${_firmw:C/\:.*$//} - rm -f ${_firmw:C/\:.*$//} -.else - ${LD} -b binary ${LDFLAGS} -r -d -o ${.TARGET} ${_firmw:C/\:.*$//} -.endif + @if [ -e ${_firmw:C/\:.*$//} ]; then \ + ${LD} -b binary ${LDFLAGS} -r -d -o ${.TARGET} \ + ${_firmw:C/\:.*$//}; \ + else \ + ln -s ${.ALLSRC:M*${_firmw:C/\:.*$//}} ${_firmw:C/\:.*$//}; \ + ${LD} -b binary ${LDFLAGS} -r -d -o ${.TARGET} \ + ${_firmw:C/\:.*$//}; \ + rm ${_firmw:C/\:.*$//}; \ + fi OBJS+= ${_firmw:C/\:.*$/.fwo/} .endfor @@ -240,7 +242,7 @@ esac ; \ path=`(cd $$path && /bin/pwd)` ; \ ${ECHO} ${.TARGET} "->" $$path ; \ - ln -s $$path ${.TARGET} + ln -sf $$path ${.TARGET} CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS} ${_ILINKS} @@ -299,7 +301,7 @@ CLEANFILES+= ${_src} .if !target(${_src}) ${_src}: - ln -s ${KERNBUILDDIR}/${_src} ${.TARGET} + ln -sf ${KERNBUILDDIR}/${_src} ${.TARGET} .endif .endfor .else ==== //depot/projects/uart/dev/acpica/acpi_smbat.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_smbat.c,v 1.4 2006/01/12 21:56:37 bruno Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_smbat.c,v 1.5 2006/02/21 03:16:58 njl Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -134,9 +134,7 @@ static int acpi_smbat_shutdown(device_t dev) { - struct acpi_smbat_softc *sc; - sc = device_get_softc(dev); acpi_battery_remove(dev); return (0); } ==== //depot/projects/uart/dev/acpica/acpi_throttle.c#4 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_throttle.c,v 1.8 2005/09/11 18:39:01 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_throttle.c,v 1.9 2006/02/21 03:15:26 njl Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -345,10 +345,8 @@ static int acpi_thr_settings(device_t dev, struct cf_setting *sets, int *count) { - struct acpi_throttle_softc *sc; int i, speed; - sc = device_get_softc(dev); if (sets == NULL || count == NULL) return (EINVAL); if (*count < CPU_MAX_SPEED) ==== //depot/projects/uart/dev/ata/ata-chipset.c#16 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.158 2006/02/13 13:47:58 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.159 2006/02/16 17:09:24 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -100,6 +100,10 @@ static int ata_ite_chipinit(device_t dev); static void ata_ite_setmode(device_t dev, int mode); static int ata_jmicron_chipinit(device_t dev); +static int ata_jmicron_allocate(device_t dev); +static void ata_jmicron_reset(device_t dev); +static void ata_jmicron_dmainit(device_t dev); +static void ata_jmicron_setmode(device_t dev, int mode); static int ata_marvell_chipinit(device_t dev); static int ata_marvell_allocate(device_t dev); static int ata_marvell_status(device_t dev); @@ -2065,6 +2069,7 @@ struct ata_chip_id *idx; static struct ata_chip_id ids[] = {{ ATA_JMB360, 0, 0, 0, ATA_SA300, "JMB360" }, + { ATA_JMB363, 0, 1, 0, ATA_SA300, "JMB363" }, { 0, 0, 0, 0, 0, 0}}; char buffer[64]; @@ -2087,49 +2092,110 @@ if (ata_setup_interrupt(dev)) return ENXIO; + /* set controller configuration to a setup we support */ + pci_write_config(dev, 0x40, 0x80c0a131, 4); + + ctlr->allocate = ata_jmicron_allocate; + ctlr->reset = ata_jmicron_reset; + ctlr->dmainit = ata_jmicron_dmainit; + ctlr->setmode = ata_jmicron_setmode; + ctlr->r_type2 = SYS_RES_MEMORY; ctlr->r_rid2 = PCIR_BAR(5); - if (!(ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, - &ctlr->r_rid2, RF_ACTIVE))) - return ENXIO; + if ((ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, + &ctlr->r_rid2, RF_ACTIVE))) { + /* reset AHCI controller */ + ATA_OUTL(ctlr->r_res2, ATA_AHCI_GHC, + ATA_INL(ctlr->r_res2, ATA_AHCI_GHC) | ATA_AHCI_GHC_HR); + DELAY(1000000); + if (ATA_INL(ctlr->r_res2, ATA_AHCI_GHC) & ATA_AHCI_GHC_HR) { + bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2,ctlr->r_res2); + device_printf(dev, "AHCI controller reset failure\n"); + return ENXIO; + } + + /* enable AHCI mode */ + ATA_OUTL(ctlr->r_res2, ATA_AHCI_GHC, + ATA_INL(ctlr->r_res2, ATA_AHCI_GHC) | ATA_AHCI_GHC_AE); + + /* get the number of HW channels */ + ctlr->channels = + (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_NPMASK) + 1; + + /* clear interrupts */ + ATA_OUTL(ctlr->r_res2, ATA_AHCI_IS, ATA_INL(ctlr->r_res2, ATA_AHCI_IS)); + + /* enable AHCI interrupts */ + ATA_OUTL(ctlr->r_res2, ATA_AHCI_GHC, + ATA_INL(ctlr->r_res2, ATA_AHCI_GHC) | ATA_AHCI_GHC_IE); + + /* enable PCI interrupt */ + pci_write_config(dev, PCIR_COMMAND, + pci_read_config(dev, PCIR_COMMAND, 2) & ~0x0400, 2); + } + /* add in PATA channel(s) */ + ctlr->channels += ctlr->chip->cfg1; + return 0; +} - /* enable AHCI mode */ - pci_write_config(dev, 0x41, 0xa1, 1); +static int +ata_jmicron_allocate(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + int error; - /* reset AHCI controller */ - ATA_OUTL(ctlr->r_res2, ATA_AHCI_GHC, - ATA_INL(ctlr->r_res2, ATA_AHCI_GHC) | ATA_AHCI_GHC_HR); - DELAY(1000000); - if (ATA_INL(ctlr->r_res2, ATA_AHCI_GHC) & ATA_AHCI_GHC_HR) { - bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2); - device_printf(dev, "AHCI controller reset failure\n"); - return ENXIO; + if (ch->unit >= 2) { + ch->unit -= 2; + error = ata_pci_allocate(dev); + ch->unit += 2; } + else + error = ata_ahci_allocate(dev); + return error; +} + +static void +ata_jmicron_reset(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); - /* enable AHCI mode */ - ATA_OUTL(ctlr->r_res2, ATA_AHCI_GHC, - ATA_INL(ctlr->r_res2, ATA_AHCI_GHC) | ATA_AHCI_GHC_AE); + if (ch->unit >= 2) + ata_generic_reset(dev); + else + ata_ahci_reset(dev); +} + +static void +ata_jmicron_dmainit(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); - /* get the number of HW channels */ - ctlr->channels = (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_NPMASK) +1; + if (ch->unit >= 2) + ata_pci_dmainit(dev); + else + ata_ahci_dmainit(dev); +} - ctlr->allocate = ata_ahci_allocate; - ctlr->reset = ata_ahci_reset; - ctlr->dmainit = ata_ahci_dmainit; - ctlr->setmode = ata_sata_setmode; +static void +ata_jmicron_setmode(device_t dev, int mode) +{ + struct ata_channel *ch = device_get_softc(device_get_parent(dev)); - /* clear interrupts */ - ATA_OUTL(ctlr->r_res2, ATA_AHCI_IS, ATA_INL(ctlr->r_res2, ATA_AHCI_IS)); + if (ch->unit >= 2) { + struct ata_device *atadev = device_get_softc(dev); - /* enable AHCI interrupts */ - ATA_OUTL(ctlr->r_res2, ATA_AHCI_GHC, - ATA_INL(ctlr->r_res2, ATA_AHCI_GHC) | ATA_AHCI_GHC_IE); + /* check for 80pin cable present */ + if (pci_read_config(dev, 0x40, 1) & 0x08) + mode = ata_limit_mode(dev, mode, ATA_UDMA2); + else + mode = ata_limit_mode(dev, mode, ATA_UDMA6); - /* enable PCI interrupt */ - pci_write_config(dev, PCIR_COMMAND, - pci_read_config(dev, PCIR_COMMAND, 2) & ~0x0400, 2); - return 0; + if (!ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode)) + atadev->mode = mode; + } + else + ata_sata_setmode(dev, mode); } ==== //depot/projects/uart/dev/ata/ata-pci.c#13 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.115 2006/02/09 20:53:32 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.116 2006/02/16 17:09:24 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -59,9 +59,6 @@ #define IOMASK 0xfffffffc #define ATA_PROBE_OK -10 -/* prototypes */ -static void ata_pci_dmainit(device_t); - int ata_legacy(device_t dev) { @@ -505,7 +502,7 @@ ch->dma->unload(dev); } -static void +void ata_pci_dmainit(device_t dev) { struct ata_channel *ch = device_get_softc(dev); ==== //depot/projects/uart/dev/ata/ata-pci.h#13 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.62 2006/01/25 23:07:42 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.63 2006/02/16 17:09:24 sos Exp $ */ /* structure holding chipset config info */ @@ -161,6 +161,7 @@ #define ATA_JMICRON_ID 0x197b #define ATA_JMB360 0x2360197b +#define ATA_JMB363 0x2363197b #define ATA_MARVELL_ID 0x11ab #define ATA_M88SX5040 0x504011ab @@ -401,6 +402,7 @@ int ata_pci_allocate(device_t dev); void ata_pci_hw(device_t dev); int ata_pci_status(device_t dev); +void ata_pci_dmainit(device_t); /* global prototypes ata-chipset.c */ ==== //depot/projects/uart/dev/ata/ata-raid.c#10 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.117 2006/01/18 13:10:17 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.118 2006/02/17 13:02:09 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -71,6 +71,8 @@ static int ata_raid_intel_read_meta(device_t dev, struct ar_softc **raidp); static int ata_raid_intel_write_meta(struct ar_softc *rdp); static int ata_raid_ite_read_meta(device_t dev, struct ar_softc **raidp); +static int ata_raid_jmicron_read_meta(device_t dev, struct ar_softc **raidp); +static int ata_raid_jmicron_write_meta(struct ar_softc *rdp); static int ata_raid_lsiv2_read_meta(device_t dev, struct ar_softc **raidp); static int ata_raid_lsiv3_read_meta(device_t dev, struct ar_softc **raidp); static int ata_raid_nvidia_read_meta(device_t dev, struct ar_softc **raidp); @@ -95,6 +97,7 @@ static void ata_raid_hptv3_print_meta(struct hptv3_raid_conf *meta); static void ata_raid_intel_print_meta(struct intel_raid_conf *meta); static void ata_raid_ite_print_meta(struct ite_raid_conf *meta); +static void ata_raid_jmicron_print_meta(struct jmicron_raid_conf *meta); static void ata_raid_lsiv2_print_meta(struct lsiv2_raid_conf *meta); static void ata_raid_lsiv3_print_meta(struct lsiv3_raid_conf *meta); static void ata_raid_nvidia_print_meta(struct nvidia_raid_conf *meta); @@ -937,6 +940,11 @@ rdp->disks[disk].sectors = ITE_LBA(rdp->disks[disk].dev); break; + case ATA_JMICRON_ID: + ctlr = AR_F_JMICRON_RAID; + rdp->disks[disk].sectors = JMICRON_LBA(rdp->disks[disk].dev); + break; + case 0: /* XXX SOS cover up for bug in our PCI code */ case ATA_PROMISE_ID: ctlr = AR_F_PROMISE_RAID; @@ -1072,6 +1080,10 @@ rdp->interleave = min(max(2, rdp->interleave), 128); /*+*/ break; + case AR_F_JMICRON_RAID: + rdp->interleave = min(max(8, rdp->interleave), 256); /*+*/ + break; + case AR_F_LSIV2_RAID: rdp->interleave = min(max(2, rdp->interleave), 4096); break; @@ -1274,6 +1286,11 @@ return 0; break; + case ATA_JMICRON_ID: + if (ata_raid_jmicron_read_meta(subdisk, ata_raid_arrays)) + return 0; + break; + case ATA_NVIDIA_ID: if (ata_raid_nvidia_read_meta(subdisk, ata_raid_arrays)) return 0; @@ -1339,6 +1356,9 @@ case AR_F_INTEL_RAID: return ata_raid_intel_write_meta(rdp); + case AR_F_JMICRON_RAID: + return ata_raid_jmicron_write_meta(rdp); + case AR_F_SIS_RAID: return ata_raid_sis_write_meta(rdp); @@ -1410,6 +1430,11 @@ size = sizeof(struct ite_raid_conf); break; + case AR_F_JMICRON_RAID: + lba = JMICRON_LBA(rdp->disks[disk].dev); + size = sizeof(struct jmicron_raid_conf); + break; + case AR_F_LSIV2_RAID: lba = LSIV2_LBA(rdp->disks[disk].dev); size = sizeof(struct lsiv2_raid_conf); @@ -2392,6 +2417,231 @@ return retval; } +/* JMicron Technology Corp Metadata */ +static int +ata_raid_jmicron_read_meta(device_t dev, struct ar_softc **raidp) +{ + struct ata_raid_subdisk *ars = device_get_softc(dev); + device_t parent = device_get_parent(dev); + struct jmicron_raid_conf *meta; + struct ar_softc *raid = NULL; + u_int16_t checksum, *ptr; + u_int64_t disk_size; + int count, array, disk, total_disks, retval = 0; + + if (!(meta = (struct jmicron_raid_conf *) + malloc(sizeof(struct jmicron_raid_conf), M_AR, M_NOWAIT | M_ZERO))) + return ENOMEM; + + if (ata_raid_rw(parent, JMICRON_LBA(parent), + meta, sizeof(struct jmicron_raid_conf), ATA_R_READ)) { + if (testing || bootverbose) + device_printf(parent, + "JMicron read metadata failed\n"); + } + + /* check for JMicron signature */ + if (strncmp(meta->signature, JMICRON_MAGIC, 2)) { + if (testing || bootverbose) + device_printf(parent, "JMicron check1 failed\n"); + goto jmicron_out; + } + + /* calculate checksum and compare for valid */ + for (checksum = 0, ptr = (u_int16_t *)meta, count = 0; count < 64; count++) + checksum += *ptr++; + if (checksum) { + if (testing || bootverbose) + device_printf(parent, "JMicron check2 failed\n"); + goto jmicron_out; + } + + if (testing || bootverbose) + ata_raid_jmicron_print_meta(meta); + + /* now convert JMicron meta into our generic form */ + for (array = 0; array < MAX_ARRAYS; array++) { +jmicron_next: + if (!raidp[array]) { + raidp[array] = + (struct ar_softc *)malloc(sizeof(struct ar_softc), M_AR, + M_NOWAIT | M_ZERO); + if (!raidp[array]) { + device_printf(parent, "failed to allocate metadata storage\n"); + goto jmicron_out; + } + } + raid = raidp[array]; + if (raid->format && (raid->format != AR_F_JMICRON_RAID)) + continue; + + for (total_disks = 0, disk = 0; disk < JM_MAX_DISKS; disk++) { + if (meta->disks[disk]) { + if (raid->format == AR_F_JMICRON_RAID) { + if (bcmp(&meta->disks[disk], + raid->disks[disk].serial, sizeof(u_int32_t))) { + array++; + goto jmicron_next; + } + } + else + bcopy(&meta->disks[disk], + raid->disks[disk].serial, sizeof(u_int32_t)); + total_disks++; + } + } + /* handle spares XXX SOS */ + + switch (meta->type) { + case JM_T_RAID0: + raid->type = AR_T_RAID0; + raid->width = total_disks; + break; + + case JM_T_RAID1: + raid->type = AR_T_RAID1; + raid->width = 1; + break; + + case JM_T_RAID01: + raid->type = AR_T_RAID01; + raid->width = total_disks / 2; + break; + + case JM_T_RAID5: + raid->type = AR_T_RAID5; + raid->width = total_disks; + break; + + case JM_T_JBOD: + raid->type = AR_T_SPAN; + raid->width = 1; + break; + + default: + device_printf(parent, + "JMicron unknown RAID type 0x%02x\n", meta->type); + free(raidp[array], M_AR); + raidp[array] = NULL; + goto jmicron_out; + } + disk_size = (meta->disk_sectors_high << 16) + meta->disk_sectors_low; + raid->format = AR_F_JMICRON_RAID; + strncpy(raid->name, meta->name, sizeof(meta->name)); + raid->generation = 0; + raid->interleave = 2 << meta->stripe_shift; + raid->total_disks = total_disks; + raid->total_sectors = disk_size * (raid->width-(raid->type==AR_RAID5)); + raid->heads = 255; + raid->sectors = 63; + raid->cylinders = raid->total_sectors / (63 * 255); + raid->offset_sectors = meta->offset * 16; + raid->rebuild_lba = 0; + raid->lun = array; + + for (disk = 0; disk < raid->total_disks; disk++) { + if (meta->disks[disk] == meta->disk_id) { + raid->disks[disk].dev = parent; + raid->disks[disk].sectors = disk_size; + raid->disks[disk].flags = + (AR_DF_ONLINE | AR_DF_PRESENT | AR_DF_ASSIGNED); + ars->raid[raid->volume] = raid; + ars->disk_number[raid->volume] = disk; + retval = 1; + break; + } + } + break; + } +jmicron_out: + free(meta, M_AR); + return retval; +} + +static int +ata_raid_jmicron_write_meta(struct ar_softc *rdp) +{ + struct jmicron_raid_conf *meta; + u_int64_t disk_sectors; + int disk, error = 0; + + if (!(meta = (struct jmicron_raid_conf *) + malloc(sizeof(struct jmicron_raid_conf), M_AR, M_NOWAIT | M_ZERO))) { + printf("ar%d: failed to allocate metadata storage\n", rdp->lun); + return ENOMEM; + } + + rdp->generation++; + switch (rdp->type) { + case AR_T_JBOD: + meta->type = JM_T_JBOD; + break; + + case AR_T_RAID0: + meta->type = JM_T_RAID0; + break; + + case AR_T_RAID1: + meta->type = JM_T_RAID1; + break; + + case AR_T_RAID5: + meta->type = JM_T_RAID5; + break; + + case AR_T_RAID01: + meta->type = JM_T_RAID01; + break; + + default: + free(meta, M_AR); + return ENODEV; + } + bcopy(JMICRON_MAGIC, meta->signature, sizeof(JMICRON_MAGIC)); + meta->version = JMICRON_VERSION; + meta->offset = rdp->offset_sectors / 16; + disk_sectors = rdp->total_sectors / (rdp->width - (rdp->type == AR_RAID5)); + meta->disk_sectors_low = disk_sectors & 0xffff; + meta->disk_sectors_high = disk_sectors >> 16; + strncpy(meta->name, rdp->name, sizeof(meta->name)); + meta->stripe_shift = ffs(rdp->interleave) - 2; + + for (disk = 0; disk < rdp->total_disks; disk++) { + if (rdp->disks[disk].serial[0]) + bcopy(rdp->disks[disk].serial,&meta->disks[disk],sizeof(u_int32_t)); + else + meta->disks[disk] = (u_int32_t)(uintptr_t)rdp->disks[disk].dev; + } + + for (disk = 0; disk < rdp->total_disks; disk++) { + if (rdp->disks[disk].dev) { + u_int16_t checksum = 0, *ptr; + int count; + + meta->disk_id = meta->disks[disk]; + meta->checksum = 0; + for (ptr = (u_int16_t *)meta, count = 0; count < 64; count++) + checksum += *ptr++; + meta->checksum -= checksum; + + if (testing || bootverbose) + ata_raid_jmicron_print_meta(meta); + + if (ata_raid_rw(rdp->disks[disk].dev, + JMICRON_LBA(rdp->disks[disk].dev), + meta, sizeof(struct jmicron_raid_conf), + ATA_R_WRITE | ATA_R_DIRECT)) { + device_printf(rdp->disks[disk].dev, "write metadata failed\n"); + error = EIO; + } + } + } + /* handle spares XXX SOS */ + + free(meta, M_AR); + return error; +} + /* LSILogic V2 MegaRAID Metadata */ static int ata_raid_lsiv2_read_meta(device_t dev, struct ar_softc **raidp) @@ -3600,6 +3850,7 @@ free(meta, M_AR); return retval; } + static int ata_raid_via_write_meta(struct ar_softc *rdp) { @@ -3931,6 +4182,7 @@ case AR_F_HPTV3_RAID: return "HighPoint v3 RocketRAID"; case AR_F_INTEL_RAID: return "Intel MatrixRAID"; case AR_F_ITE_RAID: return "Integrated Technology Express"; + case AR_F_JMICRON_RAID: return "JMicron Technology Corp"; case AR_F_LSIV2_RAID: return "LSILogic v2 MegaRAID"; case AR_F_LSIV3_RAID: return "LSILogic v3 MegaRAID"; case AR_F_NVIDIA_RAID: return "nVidia MediaShield"; @@ -4301,6 +4553,48 @@ } static char * +ata_raid_jmicron_type(int type) +{ + static char buffer[16]; + + switch (type) { + case JM_T_RAID0: return "RAID0"; + case JM_T_RAID1: return "RAID1"; + case JM_T_RAID01: return "RAID0+1"; + case JM_T_JBOD: return "JBOD"; + case JM_T_RAID5: return "RAID5"; + default: sprintf(buffer, "UNKNOWN 0x%02x", type); + return buffer; + } +} + +static void +ata_raid_jmicron_print_meta(struct jmicron_raid_conf *meta) +{ + int i; + + printf("***** ATA JMicron Technology Corp Metadata ******\n"); + printf("signature %.2s\n", meta->signature); + printf("version 0x%04x\n", meta->version); + printf("checksum 0x%04x\n", meta->checksum); + printf("disk_id 0x%08x\n", meta->disk_id); + printf("offset 0x%08x\n", meta->offset); + printf("disk_sectors_low 0x%08x\n", meta->disk_sectors_low); + printf("disk_sectors_high 0x%08x\n", meta->disk_sectors_high); + printf("name %.16s\n", meta->name); + printf("type %s\n", ata_raid_jmicron_type(meta->type)); + printf("stripe_shift %d\n", meta->stripe_shift); + printf("flags 0x%04x\n", meta->flags); + printf("spare:\n"); + for (i=0; i < 2 && meta->spare[i]; i++) + printf(" %d 0x%08x\n", i, meta->spare[i]); + printf("disks:\n"); + for (i=0; i < 8 && meta->disks[i]; i++) + printf(" %d 0x%08x\n", i, meta->disks[i]); + printf("=================================================\n"); +} + +static char * ata_raid_lsiv2_type(int type) { static char buffer[16]; ==== //depot/projects/uart/dev/ata/ata-raid.h#8 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-raid.h,v 1.43 2006/01/18 13:10:17 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-raid.h,v 1.44 2006/02/17 13:02:10 sos Exp $ */ /* misc defines */ @@ -68,13 +68,14 @@ #define AR_F_HPTV3_RAID 0x0008 #define AR_F_INTEL_RAID 0x0010 #define AR_F_ITE_RAID 0x0020 -#define AR_F_LSIV2_RAID 0x0040 -#define AR_F_LSIV3_RAID 0x0080 -#define AR_F_NVIDIA_RAID 0x0100 -#define AR_F_PROMISE_RAID 0x0200 -#define AR_F_SII_RAID 0x0400 -#define AR_F_SIS_RAID 0x0800 -#define AR_F_VIA_RAID 0x1000 +#define AR_F_JMICRON_RAID 0x0040 +#define AR_F_LSIV2_RAID 0x0080 +#define AR_F_LSIV3_RAID 0x0100 +#define AR_F_NVIDIA_RAID 0x0200 +#define AR_F_PROMISE_RAID 0x0400 +#define AR_F_SII_RAID 0x0800 +#define AR_F_SIS_RAID 0x1000 +#define AR_F_VIA_RAID 0x2000 #define AR_F_FORMAT_MASK 0x1fff u_int generation; @@ -398,6 +399,50 @@ } __packed; +/* JMicron Technology Corp Metadata */ +#define JMICRON_LBA(dev) \ + (((struct ad_softc *)device_get_ivars(dev))->total_secs - 1) +#define JM_MAX_DISKS 8 + +struct jmicron_raid_conf { + u_int8_t signature[2]; +#define JMICRON_MAGIC "JM" + + u_int16_t version; +#define JMICRON_VERSION 0x0001 + + u_int16_t checksum; + u_int8_t filler_1[10]; + u_int32_t disk_id; + u_int32_t offset; + u_int32_t disk_sectors_high; + u_int16_t disk_sectors_low; + u_int8_t filler_2[2]; + u_int8_t name[16]; + u_int8_t type; +#define JM_T_RAID0 0 +#define JM_T_RAID1 1 +#define JM_T_RAID01 2 +#define JM_T_JBOD 3 +#define JM_T_RAID5 5 + + u_int8_t stripe_shift; + u_int16_t flags; +#define JM_F_READY 0x0001 +#define JM_F_BOOTABLE 0x0002 +#define JM_F_BAD 0x0004 +#define JM_F_ACTIVE 0c0010 +#define JM_F_UNSYNC 0c0020 +#define JM_F_NEWEST 0c0040 + + u_int8_t filler_3[4]; + u_int32_t spare[2]; + u_int32_t disks[JM_MAX_DISKS]; + u_int8_t filler_4[32]; + u_int8_t filler_5[384]; +}; + + /* LSILogic V2 MegaRAID Metadata */ #define LSIV2_LBA(dev) \ (((struct ad_softc *)device_get_ivars(dev))->total_secs - 1) ==== //depot/projects/uart/dev/ath/if_ath.c#22 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.127 2006/02/13 18:23:32 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.135 2006/02/15 18:36:52 sam Exp $"); /* * Driver for the Atheros Wireless LAN controller. @@ -256,13 +256,17 @@ if (sc->sc_debug & ATH_DEBUG_KEYCACHE) \ ath_keyprint(__func__, ix, hk, mac); \ } while (0) -static void ath_printrxbuf(struct ath_buf *bf, int); -static void ath_printtxbuf(struct ath_buf *bf, int); +static void ath_printrxbuf(struct ath_buf *bf, u_int ix, int); +static void ath_printtxbuf(struct ath_buf *bf, u_int qnum, u_int ix, int done); #else #define IFF_DUMPPKTS(sc, m) \ ((sc->sc_ifp->if_flags & (IFF_DEBUG|IFF_LINK2)) == (IFF_DEBUG|IFF_LINK2)) >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602221801.k1MI1Aob069613>