From owner-freebsd-embedded@FreeBSD.ORG Mon Dec 5 01:29:42 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C54C106564A for ; Mon, 5 Dec 2011 01:29:42 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id B53998FC13 for ; Mon, 5 Dec 2011 01:29:41 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so5659222vbb.13 for ; Sun, 04 Dec 2011 17:29:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=jw5AFtcUJKJgcI8mIEDMk+oDGXQ9m+KoIMpR0pws4HA=; b=py6uPK3UKIu4VFZGSqJdZGdkolnT/AvzgBB3HRQrpGOO4cGN6cRmR16jO5COBIOc2n LrmenAV2WfJf8wGGkeB1aHRqcBjNHX2w7IXE3Susb0gBgN2WLmaLgVRAkCGd7OP+4ot3 jnRFtE4swk0uHBVdYDkUZuka1ncTT9WbluFqw= MIME-Version: 1.0 Received: by 10.52.94.227 with SMTP id df3mr3968919vdb.51.1323048581077; Sun, 04 Dec 2011 17:29:41 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.109.10 with HTTP; Sun, 4 Dec 2011 17:29:41 -0800 (PST) In-Reply-To: <2B6F6CAC-F4EF-4958-A435-579A69862AE5@bsdimp.com> References: <2B6F6CAC-F4EF-4958-A435-579A69862AE5@bsdimp.com> Date: Mon, 5 Dec 2011 09:29:41 +0800 X-Google-Sender-Auth: iSOu5FwPU68xUPG8EiARjPZ1zZk Message-ID: From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-embedded@freebsd.org Subject: Re: ar71xx_gpio.c touches SPI_CS1 and 2? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 01:29:42 -0000 On 5 December 2011 01:19, Warner Losh wrote: > When I was looking into this question for the Atmel chips, I was torn. = =A0On the one hand, it would be nice if there was a pin mux device. =A0On t= he other hand, it didn't map well into the device model. =A0I finally settl= ed on having per-board functions that setup the pins. =A0This is also the m= odel followed by linux. =A0Either the boot loader or the board-dependent co= de would do the setup. I think we should have a per-board set of hints which lets us dictate non-default GPIO functions and config. That way we can override what's going on in the board config without having to write C code. As i said, something like this: hint.blah.gpiofunction_set=3D"0x10000000" hint.blah.gpiofunction_clear=3D"0x00130000" It'd also be useful if the device drivers would do this themselves - eg the ar71xx USB device driver could ensure that the relevant GPIO function wire were enabled. But we may need to _disable_ some of these default pins (eg if the eeprom has enabled the digital sound function block on the SoC) so i still think having the above would work. Adrian