Date: Sun, 12 Feb 2017 23:01:34 -0800 From: "Tony Hain" <tony@tndh.net> To: "'Ian Lepore'" <ian@freebsd.org>, "'Oleksandr Tymoshenko'" <gonzo@bluezbox.com> Cc: <freebsd-arm@freebsd.org> Subject: RE: Questions about BBB/BBG dtb names vs. content Message-ID: <0fe001d285c7$032c32a0$098497e0$@tndh.net> In-Reply-To: <1486841770.10020.287.camel@freebsd.org> References: <0ee901d28406$052ed070$0f8c7150$@tndh.net> <20170211015231.GA56071@bluezbox.com> <0f3901d2849a$3ac2ca40$b0485ec0$@tndh.net> <1486841770.10020.287.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> -----Original Message----- > From: Ian Lepore [mailto:ian@freebsd.org] > Sent: Saturday, February 11, 2017 11:36 AM > To: Tony Hain; 'Oleksandr Tymoshenko' > Cc: freebsd-arm@freebsd.org > Subject: Re: Questions about BBB/BBG dtb names vs. content >=20 > On Sat, 2017-02-11 at 11:08 -0800, Tony Hain wrote: > > > > > > > [...] > > > > There is still the open question about the "compatible" strings > > containing "-" while the file names do not. If that is what is = coming > > from upstream and expected, fine. I just wanted to check to make = sure > > something didn't get crossed up during the name changes. Hopefully I > > will get a green build done this weekend. > > > > Tony >=20 > There is not necessarily any relationship between dts/dtb filenames = and > =A0any compat strings within the dtb. =A0The compat strings are = defined by the > bindings documentation, and are essentially a contract between the dts > source and the device driver source. =A0The filenames are a separate contract, > mostly between vendors and the u-boot source, but even those don't = have > to agree. >=20 > Anybody can set the u-boot fdt_file env var to anything they want. = IMO, that > is the right way to handle all this freebsd and local user customization... if you > want a uart device enabled, then create your own tony-bb.dts that = includes > the standard beaglebone source, then adds the few lines of code needed = to > enable the uart, and in u-boot just do setenv fdt_file tony-bb.dtb; > saveenv. =A0(At least until overlay support settles down and finds its = way into > freebsd.) So how would I get crochet to build that dtb? As far as I can tell I = need to add an include line in the black file, including the compatible for = green, because I can't follow the sequence that actually builds the dts = initially. I did put together a dts for all 6 uarts, because it was a pita to find = and correlate the references which are not collected as a complete set = anywhere as far as I can tell. I offer it here for contrib if it is useful for = the short term, or for the dtbo effort. I am running crochet now, so I am = not positive this works yet, but it should be close. /* am335x-bone-uarts.dts * * 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.dts" to board dts */ /dts-v1/; / { model =3D "TI AM335x BeagleBone Green"; compatible =3D "ti,am335x-bone-green", "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; }; &am33xx_pinmux { uart0_pins: uart0_pins { pinctrl-single,pins =3D < /* Addr offset | Direction | MuxMode | Connector | Proc = pin | SignalName | Conflict */ 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"; };
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0fe001d285c7$032c32a0$098497e0$>