From owner-freebsd-arm@freebsd.org Tue Aug 28 07:43:23 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 2E6851082C51 for ; Tue, 28 Aug 2018 07:43:23 +0000 (UTC) (envelope-from nmingotti@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AF0F7796A for ; Tue, 28 Aug 2018 07:43:22 +0000 (UTC) (envelope-from nmingotti@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id q8-v6so886002wmq.4 for ; Tue, 28 Aug 2018 00:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=C4LdvSXW/s9bx2Ja9CRZAI9s6UB5b5R4OwCFve+Mk+4=; b=S5Bv3K6LkYV0nRUIS/bS5owIrHrKXCGhm91J9z57mKzvPZZ1V9vfXqmwL8uX+MBu9s jyUrUkYQXG1u3LjKTHk5ESk5Scy4e1Bzm+FQQuxg54F8BdaXW+XS1vVznJGBnh71Yhzl w8XvFEzj8M9PJLhQaODIfWyHsleAKR0P2LwQWtDQ7dzc0X6WIoAmq4SzsHwNtYXq9QNk EMNKaq9yfyt8MUIXiQjEPRAq6Ipiei4D3gSFZyrROW0+M6pYNqLuhL4DlblnNGcbdcjF fQKOdQOgZjHQTpQ8ysq2ogcmK20AZV2lyNiwWruMQZgprdad47WQX8J34a8LnyAQ9Vqt HP8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=C4LdvSXW/s9bx2Ja9CRZAI9s6UB5b5R4OwCFve+Mk+4=; b=m+rqopaZVFNwwKeTz65REbt4XHuQwN1kkse7YAuzbdLIC22IVXcfOuvyiscKTofAfT S3XW/Ul4PigXdiau4SEmRA3T2BB3C/2dYOd2N46j+Bt39NKywFSCKv0XZWaY0t4VuRSk COcuTpmjUxQErUrtRgho0R5+bBuU8aF6+aa3K18bXkYlxlj2bpTsm1WghhnOGvv4tK0F NsPPYv8wojtjiW0n8EQsoQMtxW4N92Djc3GfJVFEIuT1liPPScaktpW3w07LK6H+3Ewx y4Et3fysHxQL+oioCAQKBnXgrJAB2o2fcItprLhCJoBuPYgMTztqF2zXtcU1imyFoikz uVBQ== X-Gm-Message-State: APzg51DC2DNqQUGvhC5KVC8iQf8dIXBUHVZBup1vLOwn+40pdowtm4SG 14qEtPV0Vvgvph9r14c54fD2pwJA X-Google-Smtp-Source: ANB0VdYLmm+SLlvaITqo84S2L7+tcTUE/WOewMVCNz/W65Eu0O190FfvL/SdDwKpqH7F7Pzd1Zd6wA== X-Received: by 2002:a1c:a386:: with SMTP id m128-v6mr537151wme.139.1535442201091; Tue, 28 Aug 2018 00:43:21 -0700 (PDT) Received: from [172.16.0.150] (net-188-219-105-237.cust.vodafonedsl.it. [188.219.105.237]) by smtp.gmail.com with ESMTPSA id v21-v6sm450987wrd.4.2018.08.28.00.43.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Aug 2018 00:43:20 -0700 (PDT) Subject: Re: PRU Overlay Problem To: "freebsd-arm@freebsd.org" References: <9ac1edad-1fbf-0e4d-cb2f-3de077fff7f8@gmail.com> From: Nicola Mingotti Message-ID: Date: Tue, 28 Aug 2018 09:43:18 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <9ac1edad-1fbf-0e4d-cb2f-3de077fff7f8@gmail.com> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2018 07:43:23 -0000 Also, i found this, in FreeBSD.11-1 decompiling the dtb i can see the pru definition: ------------------------------------------------------------------- #> cd /boot/dtb #> dtc -I dtb -O dts am335x-boneblack.dtb | less ....                 pruss@4A300000 {                         compatible = "ti,pruss-v2";                         reg = <0x4a300000 0x80000>;                         interrupt-parent = <0x1>;                         interrupts = <0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b>;                 }; ... ------------------------------------------------------------------- But, if i decompile the dtb in FreeBSD.12-ALPHA the only thing matching pru is --------------------------------- #> cd /boot/dtb #> dtc -I dtb -O dts am335x-boneblack.dtb | less ....    pruss_ocp_gclk@530 {                                                 #clock-cells = <0x0>;                                                 compatible = "ti,mux-clock";                                                 clocks = <0x1f 0x18>;                                                 reg = <0x530>;                                                 phandle = <0x20>;                                         }; .... --------------------------------- Then, i guess the PRU description is nor present at the moment in FreeBSD-12-ALPHA Well, these are just my considerations, i may be totally wrong. Wild guesses. bye n. On 08/28/18 01:23, Nicola Mingotti wrote: > > Hi ! > > I am trying to configure the PRU in BeagleBone Black, FreeBSD-12-ALPHA. > > I found Rolf code online, it compiles and load => I  see the PRU > https://obsigna.com/articles/1530973669.html > > Ok, the problem is I would like to configure the pins for the PRU > either in the new format > that Ian says on in the old one. I tried to modify Rolf code copying > from various resources > but i failed. I ask your help. I admint this thing for me is in good > part obscure. > > In previous post I saw the DTS sources are here: > https://github.com/freebsd/freebsd/tree/master/sys/gnu/dts/arm > But, i can't find the file defining the PRU, so I am stuck, i don't > know where to copy from;) > > here is were i landed : > > --------------------- new style overlay ---------- > /dts-v1/; > /plugin/; > > / { >     compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; >     exclusive-use = "P9.27","P9.28","pru0"; > }; > > &am33xx_pinmux { >      pru_pru_pins: pinmux_pru_pru_pins { >         pinctrl-single,pins = < >              0x1a4 0x05   /* P9.27 pr1_pru0_pru_r30_5, Mode 5 output > pull-down   */ >              0x19c 0x26   /* P9.28 pr1_pru0_pru_r31_3, Mode 6 input > pull-down    */ >         >; >     }; > }; > > /* &"/" {     ummm, problem, doh  */ > &ocp { >     #address-cells = <1>; >     #size-cells = <1>; >     pruss@4a300000 { >         status = "okay"; >         compatible = "ti,pruss-v2"; >         ti,deassert-hard-reset = "pruss", "pruss"; >         reg = <0x4a300000 0x080000>; >         ti,pintc-offset = <0x20000>; >         interrupt-parent = <&intc>; >         interrupts = <20 21 22 23 24 25 26 27>; >         pinctrl-names = "default"; >         pinctrl-0 = <&pru_pru_pins>; >     }; > }; > -------------------------------------- > > ---------- old style overlay ----------------- > /dts-v1/; > /plugin/; > > / { >     compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; >     exclusive-use = "P9.27","P9.28", "pru0"; > > >     pru_pru_pins: pinmux_pru_pru_pins { >          pinctrl-single,pins = < >                0x1a4 0x05   /* P9.27 pr1_pru0_pru_r30_5, Mode 5 output > pull-down   */ >                0x19c 0x26   /* P9.28 pr1_pru0_pru_r31_3, Mode 6 input > pull-down    */ >                >; >    }; > >    fragment@1 { >     target-path="/"; >     __overlay__ { >         ocp { >             #address-cells = <1>; >             #size-cells = <1>; >             pruss@4a300000 { >                 status = "okay"; >                 compatible = "ti,pruss-v2"; >                 ti,deassert-hard-reset = "pruss", "pruss"; >                 reg = <0x4a300000 0x080000>; >                 ti,pintc-offset = <0x20000>; >                 interrupt-parent = <&intc>; >                 interrupts = <20 21 22 23 24 25 26 27>; >                 pinctrl-0 = <&pru_pru_pins>; >             }; >         }; >     }; >   }; > > }; > --------------------------------------------------- > > bye > Nicola > > > -- > -------------------------- > Dr. Nicola Mingotti > R&D - Borghi Srl > CTO - BondInsider > -------------------------- -- -------------------------- Dr. Nicola Mingotti R&D - Borghi Srl CTO - BondInsider --------------------------