From owner-freebsd-arm@freebsd.org Sun Nov 4 18:49:50 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 DC61D10E219E for ; Sun, 4 Nov 2018 18:49:49 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [195.149.99.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "raven.bwct.de", Issuer "raven.bwct.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2814B7F320; Sun, 4 Nov 2018 18:49:49 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.15.2/8.15.2) with ESMTPS id wA4InkgS015528 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 4 Nov 2018 19:49:47 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cicely.de; s=default; t=1541357387; bh=kcOd3B9wTKGWvMYBVFSfB1Vw2onDbcBr5BCljH/shAU=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To; b=Lo3h5RhPCzG8IJOmqqBnEADWWBB8KXg+IrS+NmOQazu1987RQGVJXxNROS98PTIvO LQzwQCGv4ssxLYV9JPZS2O/LBaO8+dVxgZaArXyYHn8CNPi3eInywfmnBjmXLeZv+S PY/bsRczT/m78lDtBsT9dDg4HYr+DglV3udkKf/4= Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.5/8.14.4) with ESMTP id wA4InfBP029654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 4 Nov 2018 19:49:41 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.15.2/8.15.2) with ESMTP id wA4IndFR044817; Sun, 4 Nov 2018 19:49:39 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.15.2/8.15.2/Submit) id wA4Ind3s044816; Sun, 4 Nov 2018 19:49:39 +0100 (CET) (envelope-from ticso) Date: Sun, 4 Nov 2018 19:49:39 +0100 From: Bernd Walter To: Ian Lepore Cc: ticso@cicely.de, freebsd-arm@freebsd.org, Bernd Walter Subject: Re: How to add custom dts entries Message-ID: <20181104184939.GO79858@cicely7.cicely.de> Reply-To: ticso@cicely.de References: <20181103200709.GB79858@cicely7.cicely.de> <1541277990.52306.4.camel@freebsd.org> <20181103205455.GD79858@cicely7.cicely.de> <1541279079.52306.8.camel@freebsd.org> <20181103212031.GF79858@cicely7.cicely.de> <1541280338.52306.9.camel@freebsd.org> <20181104183247.GN79858@cicely7.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181104183247.GN79858@cicely7.cicely.de> X-Operating-System: FreeBSD cicely7.cicely.de 11.0-STABLE amd64 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.9 required=4.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9 autolearn=ham version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de X-Rspamd-Queue-Id: 2814B7F320 X-Spamd-Result: default: False [0.00 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[ticso@cicely.de]; R_DKIM_ALLOW(-0.20)[cicely.de]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cicely.de]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[cicely.de:+]; MX_GOOD(-0.01)[cached: mx1.bwct.de]; RCVD_IN_DNSWL_NONE(0.00)[3.99.149.195.list.dnswl.org : 127.0.20.0]; NEURAL_HAM_SHORT(-0.19)[-0.188,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.00)[country: DE(-0.01)]; ASN(0.00)[asn:21461, ipnet:195.149.99.0/24, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2018 18:49:50 -0000 On Sun, Nov 04, 2018 at 07:32:47PM +0100, Bernd Walter wrote: > On Sat, Nov 03, 2018 at 03:25:38PM -0600, Ian Lepore wrote: > > Add a status = "okay" to the spi node in your patch/overlay. > > Makes sense. > > So the spigen overlay works fine, once I set fdt_overlays in loader.conf > to use the overlay file. > > spi0: mem 0x7e204000-0x7e204fff irq 25 on simplebus0 > spibus0: on spi0 > spibus0: at cs 1 mode 0 > spibus0: at cs 0 mode 0 > spibus0: at cs 0 mode 0 > spibus0: at cs 1 mode 0 > > With my own overlay I do this to install it: > dtc -I dts -O dtb -o rpi-apa102-matrix.dtbo rpi-apa102-matrix.dts > cp rpi-apa102-matrix.dtbo /boot/dtb/overlays > > [77]cicely1> cat rpi-apa102-matrix.dts > /dts-v1/; > /plugin/; > > / { > compatible = "brcm,bcm2835"; > }; > > /* &spi0 { */ > &{/soc/spi@7e204000} { > status = "okay"; > > apa102led0 { > compatible = "led,apa102"; > reg = <0>; > spi-max-frequency = <20000000>; > status = "okay"; > }; > }; > > &onewire { > compatible = "w1-gpio"; > gpios = <&gpio 4 1>; > }; > > Still puzzled with the format. > With &spi0 it didn't work, neither with the current format, which is > copied from the spigen.dts. > Neither spi0 attaches, nor the onewire bus. > > Some other, mostly beaglebone related examples use a more complex > setup with overlay_ entries and everything inside the compatible block. > > Can I have a device.hints please ;-) > > ofwdump shows: > ... > Node 0x20fc: spi@7e204000 > compatible: > 62 72 63 6d 2c 62 63 6d 32 38 33 35 2d 73 70 69 00 > 'brcm,bcm2835-spi' > ... > status: > 64 69 73 61 62 6c 65 64 00 > 'disabled' > ... > > Havn't checked ofwdump with the spigen overlay. Interesting. When I use &spi0 and leave out the &onewire block, it attaches something. spi0: mem 0x7e204000-0x7e204fff irq 25 on simplebus0 spibus0: on spi0 spibus0: at cs 0 mode 0 spibus0: at cs 0 mode 0 spibus0: at cs 1 mode 0 And also my driver attaches just fine: apa102led0: at cs 0 mode 0 on spibus0 And ofwdump shows the spi0 es enabled: Node 0x20fc: spi@7e204000 compatible: 62 72 63 6d 2c 62 63 6d 32 38 33 35 2d 73 70 69 00 'brcm,bcm2835-spi' ... status: 6f 6b 61 79 00 'okay' ... I'm not on the real hardware, so no LED connected to test the driver. It would probably also attach with the &{/soc/spi@7e204000}. But why does the &onewire entry make such a difference? Is the whole file revoked because of an error? I have no console connected, so I don't see loader messages. Also it is a bit puzzling about the "unknown card" entries. -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.