From owner-svn-src-head@FreeBSD.ORG Wed Oct 29 20:01:26 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A815D1065687; Wed, 29 Oct 2008 20:01:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B2598FC25; Wed, 29 Oct 2008 20:01:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9TK1QAa031787; Wed, 29 Oct 2008 20:01:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9TK1Qpv031781; Wed, 29 Oct 2008 20:01:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810292001.m9TK1Qpv031781@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 Oct 2008 20:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184452 - in head/sys: arm/at91 dev/mmc dev/sdhci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2008 20:01:26 -0000 Author: mav Date: Wed Oct 29 20:01:26 2008 New Revision: 184452 URL: http://svn.freebsd.org/changeset/base/184452 Log: Allow card reader bridge driver to report maximum supported transfer size. sdhci supports up to 65535 blocks transfers, at91_mci - one block. Enable multiblock operations disabled before to follow at91_mci driver limitations. Reviewed by: imp@ Modified: head/sys/arm/at91/at91_mci.c head/sys/dev/mmc/mmc.c head/sys/dev/mmc/mmcbrvar.h head/sys/dev/mmc/mmcsd.c head/sys/dev/mmc/mmcvar.h head/sys/dev/sdhci/sdhci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Wed Oct 29 19:52:24 2008 (r184451) +++ head/sys/arm/at91/at91_mci.c Wed Oct 29 20:01:26 2008 (r184452) @@ -642,6 +642,9 @@ at91_mci_read_ivar(device_t bus, device_ case MMCBR_IVAR_VDD: *(int *)result = sc->host.ios.vdd; break; + case MMCBR_IVAR_MAX_DATA: + *(int *)result = 1; + break; } return (0); } @@ -682,6 +685,7 @@ at91_mci_write_ivar(device_t bus, device case MMCBR_IVAR_HOST_OCR: case MMCBR_IVAR_F_MIN: case MMCBR_IVAR_F_MAX: + case MMCBR_IVAR_MAX_DATA: return (EINVAL); } return (0); Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Wed Oct 29 19:52:24 2008 (r184451) +++ head/sys/dev/mmc/mmc.c Wed Oct 29 20:01:26 2008 (r184452) @@ -1343,6 +1343,9 @@ mmc_read_ivar(device_t bus, device_t chi case MMC_IVAR_ERASE_SECTOR: *(int *)result = ivar->erase_sector; break; + case MMC_IVAR_MAX_DATA: + *(int *)result = mmcbr_get_max_data(bus); + break; } return (0); } Modified: head/sys/dev/mmc/mmcbrvar.h ============================================================================== --- head/sys/dev/mmc/mmcbrvar.h Wed Oct 29 19:52:24 2008 (r184451) +++ head/sys/dev/mmc/mmcbrvar.h Wed Oct 29 20:01:26 2008 (r184452) @@ -72,6 +72,7 @@ enum mmcbr_device_ivars { MMCBR_IVAR_VDD, MMCBR_IVAR_CAPS, MMCBR_IVAR_TIMING, + MMCBR_IVAR_MAX_DATA, // MMCBR_IVAR_, }; @@ -94,6 +95,7 @@ MMCBR_ACCESSOR(power_mode, POWER_MODE, i MMCBR_ACCESSOR(vdd, VDD, int) MMCBR_ACCESSOR(caps, CAPS, int) MMCBR_ACCESSOR(timing, TIMING, int) +MMCBR_ACCESSOR(max_data, MAX_DATA, int) static int __inline mmcbr_update_ios(device_t dev) Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Wed Oct 29 19:52:24 2008 (r184451) +++ head/sys/dev/mmc/mmcsd.c Wed Oct 29 20:01:26 2008 (r184452) @@ -81,8 +81,6 @@ struct mmcsd_softc { int running; }; -#define MULTI_BLOCK_BROKEN - /* bus entry points */ static int mmcsd_probe(device_t dev); static int mmcsd_attach(device_t dev); @@ -235,12 +233,7 @@ mmcsd_rw(struct mmcsd_softc *sc, struct while (block < end) { char *vaddr = bp->bio_data + (block - bp->bio_pblkno) * sz; - int numblocks; -#ifdef MULTI_BLOCK - numblocks = end - block; -#else - numblocks = 1; -#endif + int numblocks = min(end - block, mmc_get_max_data(dev)); memset(&req, 0, sizeof(req)); memset(&cmd, 0, sizeof(cmd)); memset(&stop, 0, sizeof(stop)); Modified: head/sys/dev/mmc/mmcvar.h ============================================================================== --- head/sys/dev/mmc/mmcvar.h Wed Oct 29 19:52:24 2008 (r184451) +++ head/sys/dev/mmc/mmcvar.h Wed Oct 29 20:01:26 2008 (r184452) @@ -68,6 +68,7 @@ enum mmc_device_ivars { MMC_IVAR_CARD_TYPE, MMC_IVAR_BUS_WIDTH, MMC_IVAR_ERASE_SECTOR, + MMC_IVAR_MAX_DATA, // MMC_IVAR_, }; @@ -87,5 +88,6 @@ MMC_ACCESSOR(high_cap, HIGH_CAP, int) MMC_ACCESSOR(card_type, CARD_TYPE, int) MMC_ACCESSOR(bus_width, BUS_WIDTH, int) MMC_ACCESSOR(erase_sector, ERASE_SECTOR, int) +MMC_ACCESSOR(max_data, MAX_DATA, int) #endif /* DEV_MMC_MMCVAR_H */ Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Wed Oct 29 19:52:24 2008 (r184451) +++ head/sys/dev/sdhci/sdhci.c Wed Oct 29 20:01:26 2008 (r184452) @@ -1440,6 +1440,9 @@ sdhci_read_ivar(device_t bus, device_t c case MMCBR_IVAR_TIMING: *(int *)result = slot->host.ios.timing; break; + case MMCBR_IVAR_MAX_DATA: + *(int *)result = 65535; + break; } return (0); } @@ -1494,6 +1497,7 @@ sdhci_write_ivar(device_t bus, device_t case MMCBR_IVAR_HOST_OCR: case MMCBR_IVAR_F_MIN: case MMCBR_IVAR_F_MAX: + case MMCBR_IVAR_MAX_DATA: return (EINVAL); } return (0);