From nobody Tue Jan 24 15:35:02 2023 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 4P1WHt0LMCz3blKf for ; Tue, 24 Jan 2023 15:35:06 +0000 (UTC) (envelope-from 01070185e46b1a6e-ee34b885-1215-45c7-ac18-83320c02cac2-000000@eu-central-1.amazonses.com) Received: from b224-8.smtp-out.eu-central-1.amazonses.com (b224-8.smtp-out.eu-central-1.amazonses.com [69.169.224.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4P1WHr5Bk2z3CH5 for ; Tue, 24 Jan 2023 15:35:04 +0000 (UTC) (envelope-from 01070185e46b1a6e-ee34b885-1215-45c7-ac18-83320c02cac2-000000@eu-central-1.amazonses.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cyclaero.com header.s=ez3m2wtglgbm5wj4q3hdyvc7qtjtqmlb header.b=kHgSvj+u; dkim=pass header.d=amazonses.com header.s=sokbgaaqhfgd6qjht2wmdajpuuanpimv header.b=y2BxlDLl; spf=pass (mx1.freebsd.org: domain of 01070185e46b1a6e-ee34b885-1215-45c7-ac18-83320c02cac2-000000@eu-central-1.amazonses.com designates 69.169.224.8 as permitted sender) smtp.mailfrom=01070185e46b1a6e-ee34b885-1215-45c7-ac18-83320c02cac2-000000@eu-central-1.amazonses.com; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ez3m2wtglgbm5wj4q3hdyvc7qtjtqmlb; d=cyclaero.com; t=1674574502; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References; bh=mavJHJUlTh/CxGREvyTY729ddrZtjeFDVLA8CjX9ucs=; b=kHgSvj+uR71v1L7VEnF69VQKwqs7mwT4pGBC2yQxetOZxjG1H/WXkqz+2da5hwsE 1dQkn9XPFm6CuXb3uO8BRgyn3eyReWO4RwEz1TdNntBzlNF5rEJe7NZiBd90C+KKeqq +H2L30jlkCNjfkr66j97UoygBsPa6bJzqJz76QWJJVgKEpiaH/YimOrGw+WhlKPP9hF jCJ1+1OJArSRci11prcexEsdEEEwo70OUF3SeXdqt1UX7SO8L45vFPTZ+lWXdhJ3mRP vJdKciBd7WCENzZgViFiG3f/9MG6xXhCa6XjblH6ZT1ID4Qxi78x9An21wZ/KsRZECx RDO+blcP6A== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=sokbgaaqhfgd6qjht2wmdajpuuanpimv; d=amazonses.com; t=1674574502; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References:Feedback-ID; bh=mavJHJUlTh/CxGREvyTY729ddrZtjeFDVLA8CjX9ucs=; b=y2BxlDLlaGZxRAw7Ftkd2XgFndumhxM/54J7WSEhWWq254MSKqK47JgI6ioh/5UL fiiIuQdIfg0JIEsxq9l7dqOqn5fH02al18pWRO9HdQlkWbSwREj0GNxLNz+8VxCnh9K L9yGg3wYeW7VKMacPCqWYrDSmGcOe23+xG+WOwyY= From: "Dr. Rolf Jansen" Message-ID: <01070185e46b1a6e-ee34b885-1215-45c7-ac18-83320c02cac2-000000@eu-central-1.amazonses.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_A3A27D85-289A-4F7A-9B78-6572DD14D844" 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 (Mac OS X Mail 12.4 \(3445.104.15\)) Subject: Re: GPIO inputs on Pis? Date: Tue, 24 Jan 2023 15:35:02 +0000 In-Reply-To: <0b235f83-7cb3-1d14-7c64-aee7c1c0c23d@denninger.net> Cc: Karl Denninger To: "freebsd-arm@freebsd.org" References: <0b235f83-7cb3-1d14-7c64-aee7c1c0c23d@denninger.net> X-Mailer: Apple Mail (2.3445.104.15) Feedback-ID: 1.eu-central-1.i3TZMOZE/rJo3HQG0qvfyolMxXljeCj2Qj8Jp3rxK3c=:AmazonSES X-SES-Outgoing: 2023.01.24-69.169.224.8 X-Spamd-Result: default: False [-0.70 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; SUBJECT_ENDS_QUESTION(1.00)[]; FROM_NAME_HAS_TITLE(1.00)[dr]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[freebsd-rj@cyclaero.com,01070185e46b1a6e-ee34b885-1215-45c7-ac18-83320c02cac2-000000@eu-central-1.amazonses.com]; R_DKIM_ALLOW(-0.20)[cyclaero.com:s=ez3m2wtglgbm5wj4q3hdyvc7qtjtqmlb,amazonses.com:s=sokbgaaqhfgd6qjht2wmdajpuuanpimv]; R_SPF_ALLOW(-0.20)[+ip4:69.169.224.0/20]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[69.169.224.8:from]; FROM_HAS_DN(0.00)[]; DMARC_NA(0.00)[cyclaero.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[freebsd-rj@cyclaero.com,01070185e46b1a6e-ee34b885-1215-45c7-ac18-83320c02cac2-000000@eu-central-1.amazonses.com]; DWL_DNSWL_NONE(0.00)[amazonses.com:dkim]; RCPT_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[cyclaero.com:+,amazonses.com:+]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; ASN(0.00)[asn:16509, ipnet:69.169.224.0/23, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[69.169.224.8:from] X-Rspamd-Queue-Id: 4P1WHr5Bk2z3CH5 X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_A3A27D85-289A-4F7A-9B78-6572DD14D844 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > Am 23.01.2023 um 11:41 schrieb Karl Denninger : >=20 > Is there support somewhere in the 13.x for other than "read current = state" / "set current state"? >=20 > Specifically, there is evidence in the sys/gpio.h header file that I = can open up a file descriptor and then use select()/read() to grab the = contents of a ring buffer of some size (presumably interrupt-posted) of = events since last look, and determine if there's anything in there. = Provided you're reasonably fast this might be enough to, for example, = read an optical encoder that has a modest pulse rate. >=20 > I see apparent review code at https://reviews.freebsd.org/D27398 = from late 2020, but nothing else I = can find digging around; an example (assuming it is actually implemented = and works) would be helpful >=20 See = https://forums.freebsd.org/threads/gpio-api-general-orange-pi-h3.83950/pos= t-556728 = And the messages in that thread that follow the one linked above. There is a respective thread on this mailing list as well: Porting FreeBSD to ARM processors: User Space GPIO Interrupt programming = - GSoC-2018 = = --Apple-Mail=_A3A27D85-289A-4F7A-9B78-6572DD14D844 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii
Am 23.01.2023 um 11:41 schrieb Karl Denninger <karl@denninger.net>:

Is there support somewhere in the 13.x for other than "read current state" / "set current state"?

Specifically, there is evidence in the sys/gpio.h header file that I can open up a file descriptor and then use select()/read() to grab the contents of a ring buffer of some size (presumably interrupt-posted) of events since last look, and determine if there's anything in there.  Provided you're reasonably fast this might be enough to, for example, read an optical encoder that has a modest pulse rate.

I see apparent review code at https://reviews.freebsd.org/D27398 from late 2020, but nothing else I can find digging around; an example (assuming it is actually implemented and works) would be helpful

See


And the messages in that thread that follow the one linked above.

There is a respective thread on this mailing list as well:

--Apple-Mail=_A3A27D85-289A-4F7A-9B78-6572DD14D844--