From nobody Wed Jun 9 21:16:49 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BFE0D5D56F0 for ; Wed, 9 Jun 2021 21:16:58 +0000 (UTC) (envelope-from mgrooms@shrew.net) Received: from mx2.shrew.net (mx2.shrew.net [38.97.5.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g0T32TKz3mfd; Wed, 9 Jun 2021 21:16:57 +0000 (UTC) (envelope-from mgrooms@shrew.net) Received: from mail.shrew.net (mail.shrew.prv [10.24.10.20]) by mx2.shrew.net (8.15.2/8.15.2) with ESMTP id 159LGoVt016485; Wed, 9 Jun 2021 16:16:50 -0500 (CDT) (envelope-from mgrooms@shrew.net) Received: from [10.22.200.30] (unknown [136.49.68.36]) by mail.shrew.net (Postfix) with ESMTPSA id 4C35D19A11C; Wed, 9 Jun 2021 16:16:45 -0500 (CDT) Subject: Re: RPI4 Hardware PWM To: freebsd-arm@freebsd.org References: <9bb7f3d1-8256-be26-ba87-90946ce1b95f@shrew.net> From: Matthew Grooms Message-ID: Date: Wed, 9 Jun 2021 16:16:49 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 In-Reply-To: <9bb7f3d1-8256-be26-ba87-90946ce1b95f@shrew.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx2.shrew.net [10.24.10.11]); Wed, 09 Jun 2021 16:16:50 -0500 (CDT) X-Rspamd-Queue-Id: 4G0g0T32TKz3mfd X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mgrooms@shrew.net designates 38.97.5.132 as permitted sender) smtp.mailfrom=mgrooms@shrew.net X-Spamd-Result: default: False [0.49 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[38.97.5.132:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[shrew.net]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[38.97.5.132:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.79)[0.794]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:174, ipnet:38.0.0.0/8, country:US]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[freebsd-arm]; RECEIVED_SPAMHAUS_PBL(0.00)[136.49.68.36:received] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N On 6/8/2021 4:06 PM, Matthew Grooms wrote: > Hey All, > > I have a project I'm working on that depends on interfacing with a few > sensor modules using both i2c and PWM. I've got the i2c devices to > work correctly, but I'm not sure how to interface with the HW PWM > support of the RPI4. I can see there are settings exposed via sysctl > for Beaglebone systems ... > > https://zewaren.net/bbb-pwm.html > > I was hoping I'd be able to force GPIO 12 or 13 into ALT0  and set the > duty values via sysctl, but that doesn't seem to be an option. Any > help would be greatly appreciated. Replying to myself with a bit more info. I see that there is a driver available for rpi boards authored by PHK ... https://cgit.freebsd.org/src/tree/sys/arm/broadcom/bcm2835/bcm2835_pwm.c That has notes on RPi2/3 boards, but not mention of RPi4. When I load that, I see the following output ... Jun  9 18:29:50 generic kernel: pwm0: mem 0x7e20c000-0x7e20c027 on simplebus0 Jun  9 18:29:50 generic kernel: pwm0: cannot find Clock Manager I assume I'm doing something wrong. Any feedback would be greatly appreciated. Thanks, -Matthew