From owner-freebsd-arm@FreeBSD.ORG Thu May 24 20:01:47 2012 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7C5D1065674 for ; Thu, 24 May 2012 20:01:47 +0000 (UTC) (envelope-from ben.r.gray@gmail.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 456B28FC19 for ; Thu, 24 May 2012 20:01:46 +0000 (UTC) Received: by wgbds11 with SMTP id ds11so161446wgb.31 for ; Thu, 24 May 2012 13:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=LJrXWfFKOW7UC8YXaNlh/zYH1SaHk12sExIQb3JZCeQ=; b=Hg7oq3kLFuMMRuX+K+ZagGX8k/iPBv8wluomVsubcjm4QB47UTqvFfvunL8EYOmlPy msRBnVnJq6RH/OA5BSMlu2ZbSTiAT3vJuMNwvnmymjqiMzrgFoDCptUCCpo9nefZv9YH UkpUuThUQWa6oxGg6v2hUF9vZcByaX8LvFd074NOHMO7b0Zw9rgSI6uO1MaXpKQkd11G zPqHoXaAmGCS5WdHszkX73Pyd3pj81SkbSirBivLaXiUM2QIsPUEZs+3bAZ9nqYCYrBY 2fUqCkB90PW7r/XzNLhXGE/r5tgiPoCXaByotAa8Kksw4wrHXLMx3vL+LnqpU5JrLdEN dHDw== Received: by 10.180.85.129 with SMTP id h1mr1466718wiz.2.1337889706089; Thu, 24 May 2012 13:01:46 -0700 (PDT) Received: from Bens-MBP.local (93-97-50-127.zone5.bethere.co.uk. [93.97.50.127]) by mx.google.com with ESMTPS id ez4sm49558669wid.3.2012.05.24.13.01.44 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 May 2012 13:01:45 -0700 (PDT) Message-ID: <4FBE93A7.7050502@gmail.com> Date: Thu, 24 May 2012 21:01:43 +0100 From: Ben Gray User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: freebsd-arm@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: SDIO driver X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:01:47 -0000 Hi all, I've being doing some work on hacking SDIO support into the kernel. My changes build on top of the current MMC/MMCBR module. Expanding the diagram from Warner Losh's pdf (http://www.bsdcan.org/2007/schedule/attachments/23-freebsd-sd-warner-losh.pdf), my hacks have the following logic layout +------------+ +------------+ | ti_mmchs0 | | ti_mmchs1 | +------------+ +------------+ | | | | +--------+ +--------+ | mmc0 | | mmc1 | +--------+ +--------+ | | +------+-----+ | | | | +---------+ +---------+ +---------+ | mmcsd0 | | mmcsd1 | | sdio0 | +---------+ +---------+ +---------+ | | +------+-------+------- .... -----+ | | | function#1 function#2 function#7 +----------+ +-----------+ +----------+ | wifi | | bluetooth | .... | whatever | +----------+ +-----------+ +----------+ So my sdio module sits at the same level as the current mmcsd module and uses the same interface to talk to the mmc0 module (notably MMCBUS_WAIT_FOR_REQUEST). The sdio part does the card setup and CIS scanning, then enables any child functions and probes for a suitable child driver. The problem with this approach is that currently a driver can target only one logic function on the card - I don't know if any driver will ever need to span more than one function. But perhaps a bigger problem is that it doesn't support 'combo cards' (cards with both I/O and standard SD memory). However supporting combo cards, I think, would require a lot more changes to the current mmc/mmcsd drivers which I'm reluctant to do. Anyway I'm interested in whether anyone thinks this is useful in it's current form? or whether the above limitations are too much of a problem? If others are happy and would like it in the tree then perhaps I can commit it to the armv6 branch for review? Lastly the code is not quite complete as there are still corner cases that need to be fixed, however in it's current form it works with a basic wifi driver I've written for the Pandaboard (can load f/w, read registers, etc). Cheers, Ben.