From owner-freebsd-arm@freebsd.org Wed Feb 15 17:34:19 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8D3BCE0B96 for ; Wed, 15 Feb 2017 17:34:19 +0000 (UTC) (envelope-from tony@tndh.net) Received: from express.tndh.net (express.tndh.net [IPv6:2001:470:e930:1240:20d:56ff:fe04:4c0a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B36441778; Wed, 15 Feb 2017 17:34:19 +0000 (UTC) (envelope-from tony@tndh.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tndh.net; s=dkim; h=Subject:Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:In-Reply-To:References:Cc:To:From; bh=tC9hS+U8exMjaF3u6tfEQ5QTyE2XImYY7FJrHmlMIpg=; b=AMjVWhvAkqqPLo+gRPzxoyhK17Fg8Bog2x8WujG1Hmj+VetV+yazRDUNOpyLMvBcMjsBfTtYDUjB+4+Qty5/M3+jbG9kSp22P3KAG5h+p1Lfvu3JhVumJQJeTapi+sF8tkaM29kNA5kJ9rvQxkkBzO152/KPM7MeZAL1eZ3pYJcJ0adO; Received: from express.tndh.net ([2001:470:e930:1240:20d:56ff:fe04:4c0a] helo=eaglet) by express.tndh.net with esmtp (Exim 4.72 (FreeBSD)) (envelope-from ) id 1ce3T1-000OEo-8a; Wed, 15 Feb 2017 09:34:17 -0800 From: "Tony Hain" To: "'Ian Lepore'" , "'Oleksandr Tymoshenko'" Cc: References: <0ee901d28406$052ed070$0f8c7150$@tndh.net> <20170211015231.GA56071@bluezbox.com> <0f3901d2849a$3ac2ca40$b0485ec0$@tndh.net> <1486841770.10020.287.camel@freebsd.org> <0fe001d285c7$032c32a0$098497e0$@tndh.net> <1487005000.10020.292.camel@freebsd.org> In-Reply-To: <1487005000.10020.292.camel@freebsd.org> Date: Wed, 15 Feb 2017 09:34:12 -0800 Message-ID: <123601d287b1$b8f1c820$2ad55860$@tndh.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQCzikkuUoxhpHAkDcVcrtsdCslcNQH9hJ4TAXN5MpwBwWtU/QLGedD0ArIe9bCjUaPBEA== Content-Language: en-us X-SA-Exim-Connect-IP: 2001:470:e930:1240:20d:56ff:fe04:4c0a X-SA-Exim-Mail-From: tony@tndh.net X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on express.tndh.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=4.5 tests=ALL_TRUSTED,RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Subject: RE: Questions about BBB/BBG dtb names vs. content X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on express.tndh.net) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 17:34:19 -0000 Ian Lepore wrote: > > --------------- snip ---------------------- >=20 > It looks like you've designed it so that you have to modify the stock source to > include that file above. =A0Instead, reverse that. =A0Remove the block = that has the > model=3D and all, and in its place do >=20 > =A0#include "am335x-bonegreen.dts" >=20 > and then follow that with the=A0&am33xx_pinmux {...} and #uartN {...} = blocks > you already have. >=20 > Then you just need to tell crochet to build that dts file instead of = (or in > addition to) the standard ones. =A0I don't use crochet, so I'm not = sure how to > make it do that, but someone here can probably give us the right incantation. Well crochet appears to be an obscure collection of scripts that do not provide an option for specific dts files. With the only configuration = option being at the board level, Beaglebone, it builds dtb's for both White and Black, and I can't figure out how to modify that. My approach was to = move the black.dts out of the way and park a modified green.dts in its place, with the include for the uarts. Yes I could have put the uart = definitions in the dts, but it seems more broadly applicable to keep that as a full set = to be included when needed, rather than cluttering up the base dts for = every board type. The list I sent the other day had syntax errors, as well as duplicating the uart0_pins label, so dtc kept failing, and the error = message was not descriptive enough to make debugging easy. In any case, with the steps below a crochet build completed, but I keep getting "read-only = file system - growfs: /dev/mmcsd0s2: Operation not permitted " and " cannot = open /etc/fstab: No such file or directory " after the resize so I don't know = if it runs on the BBG yet. mv am335x-boneblack.dts am335x-boneblack.dts.dist cp am335x-bonegreen.dts am335x-boneblack.dts (fav editor) --- am335x-boneblack.dts diff am335x-bonegreen.dts am335x-boneblack.dts(modified) > #include "am335x-bone-uarts.dtsi" < &am33xx_pinmux { < uart2_pins: uart2_pins { < pinctrl-single,pins =3D < < AM33XX_IOPAD(0x950, PIN_INPUT | MUX_MODE1) = /* spi0_sclk.uart2_rxd */ < AM33XX_IOPAD(0x954, PIN_OUTPUT | MUX_MODE1) = /* spi0_d0.uart2_txd */ < >; < }; < }; < < &uart2 { < pinctrl-names =3D "default"; < pinctrl-0 =3D <&uart2_pins>; < status =3D "okay"; < }; < cat am335x-bone-uarts.dtsi /* am335x-bone-uarts.dtsi * * BeagleBone Green / Black - All 6 uarts defined : * this was difficult to find as the SRM doesn't include the address offset, * and example dts files found by search were incomplete, * many with incorrect offsets * eventually tripped over address offset P8/9 maps at: * http://www.siue.edu/~gengel/bbbWebStuff/BeagleboneBlackP8HeaderTable.pdf * http://www.siue.edu/~gengel/bbbWebStuff/BeagleboneBlackP9HeaderTable.pdf * coorelated with 335x pin map at * http://www.ti.com/lit/ds/symlink/am3359.pdf * zcz ball number matches above tables * * compiled by Tony Hain - 2/12/17 * * modify comment markers below to enable/disable required uarts * * add #include "am335x-bone-uarts.dtsi" to board dts */ // IOPAD Addr offset | Direction | MuxMode | Connector | Proc = pin | SignalName | Conflict &am33xx_pinmux { // uart0_pins: uart0_pins { // pinctrl-single,pins =3D < // AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* J1_4 E15 uart0_rxd */ // AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* J1_5 E16 uart0_txd */ // AM33XX_IOPAD(0x978, PIN_OUTPUT | MUX_MODE5) /* P9_20 = D18 uart0_ctsn ! uart1_cts*/ // AM33XX_IOPAD(0x97c, PIN_INPUT | MUX_MODE5) /* P9_19 = D17 uart0_rtsn ! uart1_rts*/ // >; // }; uart1_pins: uart1_pins { pinctrl-single,pins =3D < AM33XX_IOPAD(0x980, PIN_INPUT | MUX_MODE0) /* P9_26 = D16 uart1_rxd */ AM33XX_IOPAD(0x984, PIN_INPUT | MUX_MODE0) /* P9_24 = D15 uart1_txd */ // AM33XX_IOPAD(0x978, PIN_INPUT_PULLDOWN | MUX_MODE0) /* P9_20 = D18 uart1_ctsn ! uart0_cts*/ // AM33XX_IOPAD(0x97c, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* P9_19 = D17 uart1_rtsn ! uart0_rts*/ // AM33XX_IOPAD(0xXxx, PIN_INPUT_PULLDOWN | MUX_MODE5) /* No_pin = G16 uart1_ri */ // AM33XX_IOPAD(0xXxx, PIN_INPUT_PULLDOWN | MUX_MODE5) /* No_pin = K18 uart1_dcd */ // AM33XX_IOPAD(0xXxx, PIN_INPUT_PULLDOWN | MUX_MODE5) /* No_pin = L18 uart1_dsr */ // AM33XX_IOPAD(0xXxx, PIN_OUTPUT_PULLDOWN | MUX_MODE5) /* No_pin = L17 uart1_dtr */ >; }; uart2_pins: uart2_pins { pinctrl-single,pins =3D < AM33XX_IOPAD(0x950, PIN_INPUT | MUX_MODE1) /* P9_22 = A17 uart2_rxd */ AM33XX_IOPAD(0x954, PIN_OUTPUT | MUX_MODE1) /* P9_21 = B17 uart2_txd */ // AM33XX_IOPAD(0x8c0, PIN_INPUT_PULLDOWN | MUX_MODE6) /* P8_37 U1 uart2_ctsn ! uart5_txd*/ // AM33XX_IOPAD(0x8b8, PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* P8_38 U2 uart2_rtsn ! uart5_rxd*/ >; }; uart3_pins: uart3_pins { pinctrl-single,pins =3D < // AM33XX_IOPAD(0xXxx, PIN_INPUT | MUX_MODE1) /* No_pin = C15 uart3_rxd ! hdmi */ AM33XX_IOPAD(0x964, PIN_OUTPUT_PULLUP | MUX_MODE1) /* P9_42 = C18 uart3_txd */ // AM33XX_IOPAD(0x8c8, PIN_INPUT_PULLUP | MUX_MODE6) /* P8_36 U3 uart3_ctsn */ // AM33XX_IOPAD(0x8cc, PIN_OUTPUT | MUX_MODE6) /* P8_34 U4 uart3_rtsn */ >; }; uart4_pins: uart4_pins { pinctrl-single,pins =3D < AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE6) /* P9_11 = T17 uart4_rxd */ AM33XX_IOPAD(0x874, PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* P9_13 = U17 uart4_txd */ // AM33XX_IOPAD(0x8d0, PIN_INPUT_PULLUP | MUX_MODE6) /* P8_35 V2 uart4_ctsn */ // AM33XX_IOPAD(0x8d4, PIN_OUTPUT | MUX_MODE6) /* P8_33 V3 uart4_rtsn */ >; }; uart5_pins: uart5_pins { pinctrl-single,pins =3D < AM33XX_IOPAD(0x8c4, PIN_INPUT | MUX_MODE4) /* P8_38 U2 uart5_rxd ! uart2_rts*/ AM33XX_IOPAD(0x8c0, PIN_OUTPUT | MUX_MODE4) /* P8_37 U1 uart5_txd ! uart2_cts*/ // AM33XX_IOPAD(0x8d8, PIN_INPUT_PULLUP | MUX_MODE6) /* P8_31 V4 uart5_ctsn */ // AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE6) /* P8_32 T5 uart5_rtsn */ >; }; }; &uart0 { pinctrl-names =3D "default"; pinctrl-0 =3D <&uart0_pins>; status =3D "okay"; // status =3D "disabled"; }; &uart1 { pinctrl-names =3D "default"; pinctrl-0 =3D <&uart1_pins>; status =3D "okay"; // status =3D "disabled"; }; &uart2 { pinctrl-names =3D "default"; pinctrl-0 =3D <&uart2_pins>; // status =3D "okay"; status =3D "disabled"; }; &uart3 { pinctrl-names =3D "default"; pinctrl-0 =3D <&uart3_pins>; // status =3D "okay"; status =3D "disabled"; }; &uart4 { pinctrl-names =3D "default"; pinctrl-0 =3D <&uart4_pins>; // status =3D "okay"; status =3D "disabled"; }; &uart5 { pinctrl-names =3D "default"; pinctrl-0 =3D <&uart5_pins>; // status =3D "okay"; status =3D "disabled"; };