From owner-svn-src-stable@FreeBSD.ORG Wed May 19 14:50:07 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A37D7106566C; Wed, 19 May 2010 14:50:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9057F8FC14; Wed, 19 May 2010 14:50:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4JEo7Oa004105; Wed, 19 May 2010 14:50:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4JEo7mK004095; Wed, 19 May 2010 14:50:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201005191450.o4JEo7mK004095@svn.freebsd.org> From: Alexander Motin Date: Wed, 19 May 2010 14:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208299 - in stable/8: share/man/man4 sys/arm/mv sys/conf sys/dev/mvs sys/modules sys/modules/mvs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2010 14:50:07 -0000 Author: mav Date: Wed May 19 14:50:07 2010 New Revision: 208299 URL: http://svn.freebsd.org/changeset/base/208299 Log: MFC r207536, r207696, r208183: Import mvs(4) - Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA controllers driver for CAM ATA subsystem. This driver supports same hardware as atamarvell, ataadaptec and atamvsata drivers from ata(4), but provides many additional features, such as NCQ, PMP, etc. Added: stable/8/share/man/man4/mvs.4 - copied unchanged from r207536, head/share/man/man4/mvs.4 stable/8/sys/dev/mvs/ - copied from r207536, head/sys/dev/mvs/ stable/8/sys/modules/mvs/ - copied from r207536, head/sys/modules/mvs/ Modified: stable/8/share/man/man4/Makefile stable/8/sys/arm/mv/files.mv stable/8/sys/conf/NOTES stable/8/sys/conf/files stable/8/sys/conf/kmod.mk stable/8/sys/dev/mvs/mvs.c stable/8/sys/modules/Makefile stable/8/sys/modules/mvs/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Wed May 19 10:35:53 2010 (r208298) +++ stable/8/share/man/man4/Makefile Wed May 19 14:50:07 2010 (r208299) @@ -218,6 +218,7 @@ MAN= aac.4 \ msk.4 \ mtio.4 \ multicast.4 \ + mvs.4 \ mwl.4 \ mwlfw.4 \ mxge.4 \ Copied: stable/8/share/man/man4/mvs.4 (from r207536, head/share/man/man4/mvs.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/mvs.4 Wed May 19 14:50:07 2010 (r208299, copy of r207536, head/share/man/man4/mvs.4) @@ -0,0 +1,176 @@ +.\" Copyright (c) 2009 Alexander Motin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (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$ +.\" +.Dd April 27, 2010 +.Dt MVS 4 +.Os +.Sh NAME +.Nm mvs +.Nd Marvell Serial ATA Host Controller driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device pci" +.Cd "device scbus" +.Cd "device mvs" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mvs_load="YES" +.Ed +.Pp +The following tunables are settable from the +.Xr loader 8 : +.Bl -ohang +.It Va hint.mvs. Ns Ar X Ns Va .msi +controls Message Signaled Interrupts (MSI) usage by the specified controller. +.It Va hint.mvs. Ns Ar X Ns Va .ccc +controls Command Completion Coalescing (CCC) usage by the specified controller. +Non-zero value enables CCC and defines maximum time (in us), request can wait +for interrupt. +CCC reduces number of context switches on systems with many parallel requests, +but it can decrease disk performance on some workloads due to additional +command latency. +.It Va hint.mvs. Ns Ar X Ns Va .cccc +defines number of completed commands for CCC, which trigger interrupt without +waiting for specified coalescing timeout. +.It Va hint.mvs. Ns Ar X Ns Va .pm_level +controls SATA interface Power Management for the specified channel, +allowing some power to be saved at the cost of additional command +latency. +Possible values: +.Bl -tag -compact +.It 0 +interface Power Management is disabled (default); +.It 1 +device is allowed to initiate PM state change, host is passive; +.It 4 +driver initiates PARTIAL PM state transition 1ms after port becomes idle; +.It 5 +driver initiates SLUMBER PM state transition 125ms after port becomes idle. +.El +.Pp +Note that interface Power Management is not compatible with +device presence detection. +A manual bus reset is needed on device hot-plug. +.It Va hint.mvs. Ns Ar X Ns Va .sata_rev +setting to nonzero value limits maximum SATA revision (speed). +Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. +.El +.Sh DESCRIPTION +This driver provides the +.Xr CAM 4 +subsystem with native access to the +.Tn SATA +ports of several generations (Gen-I/II/IIe) of Marvell SATA controllers. +Each SATA port found is represented to CAM as a separate bus with one +target, or, if HBA supports Port Multipliers (Gen-II/IIe), 16 targets. +Most of the bus-management details are handled by the SATA-specific +transport of CAM. +Connected ATA disks are handled by the ATA protocol disk peripheral driver +.Xr ada 4 . +ATAPI devices are handled by the SCSI protocol peripheral drivers +.Xr cd 4 , +.Xr da 4 , +.Xr sa 4 , +etc. +.Pp +Driver features include support for Serial ATA and ATAPI devices, +Port Multipliers (including FIS-based switching, when supported), +hardware command queues (up to 31 command per port), +Native Command Queuing, SATA interface Power Management, device hot-plug +and Message Signaled Interrupts. +.Pp +Same hardware is also supported by atamarvell and ataadaptec drivers from +.Xr ata 4 +subsystem. +If both drivers are loaded at the same time, this one will be +given precedence as the more functional of the two. +.Sh HARDWARE +The +.Nm +driver supports the following controllers: +.Bl -tag -compact +.It Gen-I (SATA 1.5Gbps): +.Bl -bullet -compact +.It +88SX5040 +.It +88SX5041 +.It +88SX5080 +.It +88SX5081 +.El +.It Gen-II (SATA 3Gbps, NCQ, PMP): +.Bl -bullet -compact +.It +88SX6040 +.It +88SX6041 (including Adaptec 1420SA) +.It +88SX6080 +.It +88SX6081 +.El +.It Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): +.Bl -bullet -compact +.It +88SX6042 +.It +88SX7042 (including Adaptec 1430SA) +.It +88F5182 SoC +.It +88F6281 SoC +.It +MV78100 SoC +.El +.El +Note, that this hardware supports command queueing and FIS-based switching +only for ATA DMA commands. ATAPI and non-DMA ATA commands executed one by one +for each port. +.Pp +.Sh SEE ALSO +.Xr ada 4 , +.Xr ata 4 , +.Xr cam 4 , +.Xr cd 4 , +.Xr da 4 , +.Xr sa 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 9.0 . +.Sh AUTHORS +.An Alexander Motin Aq mav@FreeBSD.org . Modified: stable/8/sys/arm/mv/files.mv ============================================================================== --- stable/8/sys/arm/mv/files.mv Wed May 19 10:35:53 2010 (r208298) +++ stable/8/sys/arm/mv/files.mv Wed May 19 14:50:07 2010 (r208299) @@ -30,6 +30,7 @@ arm/mv/timer.c standard arm/mv/twsi.c optional iicbus dev/mge/if_mge.c optional mge +dev/mvs/mvs_soc.c optional mvs dev/uart/uart_bus_mbus.c optional uart dev/uart/uart_cpu_mv.c optional uart dev/uart/uart_dev_ns8250.c optional uart Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Wed May 19 10:35:53 2010 (r208298) +++ stable/8/sys/conf/NOTES Wed May 19 14:50:07 2010 (r208299) @@ -1651,12 +1651,14 @@ device twe # 3ware ATA RAID # Serial ATA host controllers: # # ahci: Advanced Host Controller Interface (AHCI) compatible +# mvs: Marvell 88SX50XX/88SX60XX/88SX70XX/SoC controllers # siis: SiliconImage SiI3124/SiI3132/SiI3531 controllers # # These drivers are part of cam(4) subsystem. They supersede less featured # ata(4) subsystem drivers, supporting same hardware. device ahci +device mvs device siis # Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Wed May 19 10:35:53 2010 (r208298) +++ stable/8/sys/conf/files Wed May 19 14:50:07 2010 (r208299) @@ -1279,6 +1279,9 @@ dev/mpt/mpt_pci.c optional mpt pci dev/mpt/mpt_raid.c optional mpt dev/mpt/mpt_user.c optional mpt dev/msk/if_msk.c optional msk inet +dev/mvs/mvs.c optional mvs +dev/mvs/mvs_if.m optional mvs +dev/mvs/mvs_pci.c optional mvs pci dev/mwl/if_mwl.c optional mwl dev/mwl/if_mwl_pci.c optional mwl pci dev/mwl/mwlhal.c optional mwl Modified: stable/8/sys/conf/kmod.mk ============================================================================== --- stable/8/sys/conf/kmod.mk Wed May 19 10:35:53 2010 (r208298) +++ stable/8/sys/conf/kmod.mk Wed May 19 14:50:07 2010 (r208299) @@ -324,7 +324,7 @@ MFILES?= dev/acpica/acpi_if.m dev/acpi_s dev/agp/agp_if.m dev/ata/ata_if.m dev/eisa/eisa_if.m \ dev/iicbus/iicbb_if.m dev/iicbus/iicbus_if.m \ dev/mmc/mmcbr_if.m dev/mmc/mmcbus_if.m \ - dev/mii/miibus_if.m dev/ofw/ofw_bus_if.m \ + dev/mii/miibus_if.m dev/mvs/mvs_if.m dev/ofw/ofw_bus_if.m \ dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ dev/pci/pcib_if.m dev/ppbus/ppbus_if.m dev/smbus/smbus_if.m \ dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \ Modified: stable/8/sys/dev/mvs/mvs.c ============================================================================== --- head/sys/dev/mvs/mvs.c Sun May 2 19:28:30 2010 (r207536) +++ stable/8/sys/dev/mvs/mvs.c Wed May 19 14:50:07 2010 (r208299) @@ -2168,6 +2168,6 @@ mvspoll(struct cam_sim *sim) arg.arg = ch->dev; arg.cause = 2; /* XXX */ - mvs_ch_intr(arg.arg); + mvs_ch_intr(&arg); } Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Wed May 19 10:35:53 2010 (r208298) +++ stable/8/sys/modules/Makefile Wed May 19 14:50:07 2010 (r208299) @@ -186,6 +186,7 @@ SUBDIR= ${_3dfx} \ msdosfs_iconv \ ${_mse} \ msk \ + mvs \ mwl \ mxge \ my \ Modified: stable/8/sys/modules/mvs/Makefile ============================================================================== --- head/sys/modules/mvs/Makefile Sun May 2 19:28:30 2010 (r207536) +++ stable/8/sys/modules/mvs/Makefile Wed May 19 14:50:07 2010 (r208299) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../dev/mvs KMOD= mvs -SRCS= mvs.c mvs_pci.c mvs.h mvs_if.h device_if.h bus_if.h pci_if.h opt_cam.h +SRCS= mvs.c mvs_pci.c mvs.h mvs_if.c mvs_if.h device_if.h bus_if.h pci_if.h opt_cam.h MFILES= kern/bus_if.m kern/device_if.m dev/pci/pci_if.m dev/mvs/mvs_if.m