From owner-freebsd-arm@freebsd.org Wed Mar 14 15:38:21 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 BF60FF5984C for ; Wed, 14 Mar 2018 15:38:21 +0000 (UTC) (envelope-from toshi@ruby.ocn.ne.jp) Received: from mfdf0201.ocn.ad.jp (mfdf0201.ocn.ad.jp [153.128.50.79]) by mx1.freebsd.org (Postfix) with ESMTP id 0D1EF8691C for ; Wed, 14 Mar 2018 15:38:20 +0000 (UTC) (envelope-from toshi@ruby.ocn.ne.jp) Received: from mogw0904.ocn.ad.jp (mogw0904.ocn.ad.jp [153.149.227.10]) by mfdf0201.ocn.ad.jp (Postfix) with ESMTP id F23C7C27DB6 for ; Thu, 15 Mar 2018 00:04:05 +0900 (JST) Received: from mf-smf-ucb029c2 (mf-smf-ucb029c2.ocn.ad.jp [153.153.66.195]) by mogw0904.ocn.ad.jp (Postfix) with ESMTP id 76F295001E4; Thu, 15 Mar 2018 00:03:59 +0900 (JST) Received: from ntt.pod01.mv-mta-ucb024 ([153.149.142.98]) by mf-smf-ucb029c2 with ESMTP id w7wdePk4soJV6w7wdex2QS; Thu, 15 Mar 2018 00:03:59 +0900 Received: from smtp.ocn.ne.jp ([153.149.227.134]) by ntt.pod01.mv-mta-ucb024 with id Mr3z1x0092ud8JZ01r3zZJ; Wed, 14 Mar 2018 15:03:59 +0000 Received: from localhost (p795042-ipngn200602sizuokaden.shizuoka.ocn.ne.jp [180.9.168.42]) by smtp.ocn.ne.jp (Postfix) with ESMTPA; Thu, 15 Mar 2018 00:03:59 +0900 (JST) Date: Thu, 15 Mar 2018 00:03:27 +0900 (JST) Message-Id: <20180315.000327.244671182493000373.toshi@ruby.ocn.ne.jp> To: freebsd-arm@freebsd.org Subject: Re: PWM of BeagleBone Black on 11.1-RELEASE From: SAITOU Toshihide In-Reply-To: <20180308.220228.985768279546235038.toshi@ruby.ocn.ne.jp> References: <20180308.220228.985768279546235038.toshi@ruby.ocn.ne.jp> X-GPG-fingerprint: 34B3 0B6A 8520 F5B0 EBC7 69F6 C055 9F8A 0D49 F8FC X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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: Wed, 14 Mar 2018 15:38:22 -0000 On Thu, 08 Mar 2018 22:02:28 +0900 (JST), SAITOU Toshihide wrote: > > How can I setup the PWM of BeagleBone Black? > The driver attached but no signal observed with the > followings. > > $ sysctl dev.am335x_ehrpwm.1.dutyB=50 > $ sysctl dev.am335x_ehrpwm.1.dutyA=50 > $ sysctl dev.am335x_ehrpwm.1.period=100 > > (nothing was observed) > > $ uname -a > FreeBSD beaglebone 11.1-RELEASE FreeBSD 11.1-RELEASE #0 > r321309: Fri Jul 21 10:22:32 UTC 2017 > root@releng2.nyi.freebsd.org:/usr/obj/arm.armv6/usr/src/sys/BEAGLEBONE > arm > > # dtc -I dts -O dtb pwm.dts -o pwm.dtb > # cp pwm.dtb /boot/dtb/ > > # cat /boot/loader.conf > > fdt_overlays="pwm.dtb" > > # cat pwm.dts > > /dts-v1/; > /plugin/; > > / { > compatible = "ti,beaglebone", "ti,beaglebone-black", > "ti,beaglebone-green"; > > fragment@4 { > target = <&am33xx_pinmux>; > __overlay__ { > pinctrl-single,pins = < 0x048 0xe >; /* P9.21, > gpio0_3 */ > }; > }; > > fragment@5 { > target = <&epwmss1>; > __overlay__ { > status = "okay"; > }; > }; > > fragment@6 { > target = <&ehrpwm1>; > __overlay__ { > status = "okay"; > }; > }; > > fragment@7 { > target = <&ecap1>; > __overlay__ { > status = "okay"; > }; > }; > }; It worked with this settings (althought I don't understand yet): Edit the beaglebone-black.dts as follows: add followings to the &am33xx_pinmux entry: ehrpwm0_pins: pinmux_ehrpwm0_AB { }; ehrpwm1_pins: pinmux_ehrpwm1_AB { }; append the followings: &ehrpwm0 { pinctrl-names = "default"; pinctrl-0 = <&ehrpwm0_pins>; status = "okay"; }; &ehrpwm1 { pinctrl-names = "default"; pinctrl-0 = <&ehrpwm1_pins>; status = "okay"; }; And pwm.dts is : /dts-v1/; /plugin/; / { compatible = "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-green"; fragment@0 { target = <&am33xx_pinmux>; __overlay__ { ehrpwm0_pins: pinmux_ehrpwm0_AB { pinctrl-single,pins = < 0x150 0x03 /* P9.21, 0x150, gpio0.2, mode3 */ 0x154 0x03 /* P9.22, 0x154, gpio0.3, mode3 */ >; }; }; }; fragment@1 { target = <&epwmss0>; __overlay__ { status = "okay"; }; }; fragment@2 { target = <&ehrpwm0>; __overlay__ { status = "okay"; }; }; fragment@3 { target = <&am33xx_pinmux>; __overlay__ { ehrpwm1_pins: pinmux_ehrpwm1_AB { pinctrl-single,pins = < 0x48 0x06 /* P9.14, 0x48, gpio1.18, mode6 */ 0x4c 0x06 /* P9.16, 0x4c, gpio1.19, mode6 */ >; }; }; }; fragment@4 { target = <&epwmss1>; __overlay__ { status = "okay"; }; }; fragment@5 { target = <&ehrpwm1>; __overlay__ { status = "okay"; }; }; }; I'm sorry for the noise. -- SAITOU Toshihide