From owner-freebsd-embedded@FreeBSD.ORG Tue Dec 6 01:44:12 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 91FD91065670 for ; Tue, 6 Dec 2011 01:44:12 +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 4E9B28FC14 for ; Tue, 6 Dec 2011 01:44:11 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so7132377vbb.13 for ; Mon, 05 Dec 2011 17:44:11 -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; bh=oUJnO5U8WGCvhYatFdEgIC1WTSb1NSsN0a2NrRMXsyg=; b=K1RJO96oqpM3Hq6LEYq07mxIpw6Qx+abbMLX/na3BOKD/2MwjNsbQnn/BV9HRBVhdt MK0luPoEI8C8EdTa/X19ykVW9QOphrhsg5tN8vJziUCbwOlvcWnWe/PHayJzEyyZ9zgn GvVISKhVHVQaEdkAq0omPvTt0jcaD2MpktSkA= MIME-Version: 1.0 Received: by 10.52.66.35 with SMTP id c3mr7314878vdt.17.1323135851544; Mon, 05 Dec 2011 17:44:11 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.109.10 with HTTP; Mon, 5 Dec 2011 17:44:11 -0800 (PST) In-Reply-To: <9681BA0F-B8DE-479C-98B8-6DA702A489CA@bsdimp.com> References: <2B6F6CAC-F4EF-4958-A435-579A69862AE5@bsdimp.com> <9681BA0F-B8DE-479C-98B8-6DA702A489CA@bsdimp.com> Date: Tue, 6 Dec 2011 09:44:11 +0800 X-Google-Sender-Auth: 88_Hg1BJQ8whLHBEy_2v3IT7uhk Message-ID: From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 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: Tue, 06 Dec 2011 01:44:12 -0000 We're aligned in our thinking btw - it was just my choice of terminology that was poor. The reason I chose the term "GPIO" is because the pins tend to do dual-duty as either GPIO or non-GP IO pins; on the ar71xx these are configured via one nice register. On the 8 bit AVRs at least, the pin personality is configured in a variety of locations rather than just one location. So I'd like to see this done in ether the kernel config or hints, rather than by per-board C code (which is what openwrt/linux currently does.) That way we can just ship one source tree without individual C files, one per board. I'd prefer to stuff it inside a "boarddep" part of hints, that gets read by the platform startup code and initialises the IO pin personality as needed, far before the device drivers get their grubby fingers into it. This includes setting up the UART/JTAG personalities too, so I'd want it to be done very early on (maybe in platform_start(), before it starts using the UART. The firmware should have already set this up but there may be some boards out there which just disable the UART entirely in production.. ? Adrian