From owner-freebsd-arm@freebsd.org Sun Jan 28 22:09:38 2018 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2CCEEE22AC for ; Sun, 28 Jan 2018 22:09:38 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3483470F00 for ; Sun, 28 Jan 2018 22:09:37 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1efv8j-000Etp-7b; Sun, 28 Jan 2018 14:09:29 -0800 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id w0SM9R43057276; Sun, 28 Jan 2018 14:09:27 -0800 (PST) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Sun, 28 Jan 2018 14:09:27 -0800 From: Oleksandr Tymoshenko To: "Klaus P. Ohrhallinger" Cc: freebsd-arm@freebsd.org Subject: Re: RPI3 / bcm2835 sdhci device driver Message-ID: <20180128220927.GA56771@bluezbox.com> References: <6fc103a5-6634-8cc0-34d9-702b4484c2e0@7he.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6fc103a5-6634-8cc0-34d9-702b4484c2e0@7he.at> X-Operating-System: FreeBSD/11.1-RELEASE-p4 (amd64) User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Klaus P. Ohrhallinger (k@7he.at) wrote: > Hello, > > This is a device driver for the second SDHCI on Raspberry Pi 3: > > http://kweb.7he.at/tmp/rpi/sdhci0-01.diff > > It allows the Arasan SDHCI to be [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jan 2018 22:09:38 -0000 Klaus P. Ohrhallinger (k@7he.at) wrote: > Hello, > > This is a device driver for the second SDHCI on Raspberry Pi 3: > > http://kweb.7he.at/tmp/rpi/sdhci0-01.diff > > It allows the Arasan SDHCI to be used for other purposes, e.g. driving > the radio (wlan) module. Hi Klaus, Thanks a lot for working on this. You might consider using https://reviews.freebsd.org for patch submissions. Its UI is not exactly the paramaunt of usability but still beats posting comments in emails. Also there is command-line cient for patch management that is pretty usable: https://wiki.freebsd.org/Phabricator I have several comments on current version of the driver: - Looks like Linux and official name for the driver is sdhost, as compatible string suggest, so I suggest renaming it to bcm2835_sdhost. It's more distinctive from sdhci comparing to sdhci0 - "+#define DEBUG 0". DEBUG flag is set using "options DEBUG" in kernel config, so overriding it introduces side-effects. If you need internal flag for development use prefixed version like SDHOST_DEBUG. Also I'd suggest against using numeric values to indicate boolean conditions in preprocessor directives. Common expectation is to signal such conditions using #define FOO and to check them using #ifdef FOO or #if defined(FOO) - bcm2835_gpio_dev + bcm_gpio_set_alternate hack is bad. I know that there are hacks like this in other drivers but I am working on pinmux support for Pi and once it's done whole bcm_sdhci0_swap_pins can be just deleted. Pins are going to be muxed using information from device tree. I hope to finish it "real soon". I will let you know once it's done. -- gonzo