From owner-freebsd-arm@FreeBSD.ORG Fri Jun 5 16:59:31 2015 Return-Path: Delivered-To: freeBSD-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F69D417 for ; Fri, 5 Jun 2015 16:59:31 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.116.210]) (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 DAA38133A for ; Fri, 5 Jun 2015 16:59:30 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from mbpro2.bs.cs.huji.ac.il ([132.65.179.20]) by kabab.cs.huji.ac.il with esmtp id 1Z0uxW-000AZO-7J; Fri, 05 Jun 2015 19:59:06 +0300 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2100\)) Subject: Re: pwm for raspberry pi? From: Daniel Braniss In-Reply-To: Date: Fri, 5 Jun 2015 19:59:15 +0300 Cc: freebsd-arm Message-Id: References: <1FD1336E-D99F-4114-AD33-FBA1DF844E93@cs.huji.ac.il> To: Luiz Otavio O Souza X-Mailer: Apple Mail (2.2100) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2015 16:59:31 -0000 > On May 26, 2015, at 9:51 PM, Luiz Otavio O Souza = wrote: >=20 > On 26 May 2015 at 03:13, Daniel Braniss wrote: >>=20 >>> On May 26, 2015, at 1:14 AM, Luiz Otavio O Souza wrote: >>>=20 >>> On 25 May 2015 at 07:52, Daniel Braniss wrote: >>>> Hi, >>>> Now that I=E2=80=99m rapping up my spi/rfid driver (available on = demand :-), >>>> I would like to use the pwm interface to power on/off a lock, but >>>> have no idea how to go around it, so any clues would be mostly = welcomed. >>>>=20 >>>> cheers, >>>> danny >>>=20 >>> The PWM module is quite simple and has only two outputs, they can be >>> used only with recent 40 GPIO pins header (RPi-B+ or RPi2), in the >>> older models only one output was wired. >>>=20 >> I do have a B+ >>=20 >>> The bcm2835 peripherals datasheet describes the PWM module registers >>=20 >> I=E2=80=99ve read it, hence I know it=E2=80=99s possible, what I=E2=80=99= missing is how to access it via >> FreeBSD. There is a some mention for the BeagleBoneBlack, but it = seems >> broken, the FDT mentions the pins. Too many leads but not enough info >> on how to tie them up :-) >>=20 >> cheers, >> danny >=20 > There is no defined API to access PWM settings ATM, on beaglebone this > is done with sysctls: >=20 > dev.am335x_pwm.2.dutyB: 0 > dev.am335x_pwm.2.dutyA: 0 > dev.am335x_pwm.2.period: 1000 > dev.am335x_pwm.2.freq: 100000 > dev.am335x_pwm.2.clkdiv: 1 > dev.am335x_pwm.2.%parent: simplebus0 > dev.am335x_pwm.2.%pnpinfo: name=3Dpwm@48304000 compat=3Dti,am335x-pwm > dev.am335x_pwm.2.%location: > dev.am335x_pwm.2.%driver: am335x_pwm > dev.am335x_pwm.2.%desc: AM335x PWM >=20 > There are 3 PWM modules, each one with two outputs controlled by dutyA > and dutyB. >=20 > Here is the PWM code for beaglebone: > = https://svnweb.freebsd.org/base/head/sys/arm/ti/am335x/am335x_ehrpwm.c?vie= w=3Dmarkup = >=20 i see these under 10.1 but nothing under 11, what am I missing? i tried with today=E2=80=99s current, and I see the modules being = compile, the .dts seems ok but no signes of am35x_pwm > At some point I think I will expose PWM settings via gpioctl (and > possibly add a gpiopwm for a software based pwm). >=20 > Regards, > Luiz