Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jul 2020 11:13:37 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r363645 - head/sys/arm/broadcom/bcm2835
Message-ID:  <202007281113.06SBDbBn047709@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Tue Jul 28 11:13:37 2020
New Revision: 363645
URL: https://svnweb.freebsd.org/changeset/base/363645

Log:
  Aadd Raspberry Pi firmware messages to manage GPIOs
  
  Some GPIOs are managed by an external IO expaandder through the firmware.
  Add the message details for these.
  
  Sponsored by:	Innovate UK

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h	Tue Jul 28 10:58:37 2020	(r363644)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h	Tue Jul 28 11:13:37 2020	(r363645)
@@ -142,6 +142,61 @@ union msg_set_turbo_body {
 	} resp;
 };
 
+#define	BCM2835_FIRMWARE_TAG_GET_GPIO_STATE		0x00030041
+#define	BCM2835_FIRMWARE_TAG_SET_GPIO_STATE		0x00038041
+#define	BCM2835_FIRMWARE_TAG_GET_GPIO_CONFIG		0x00030043
+#define	BCM2835_FIRMWARE_TAG_SET_GPIO_CONFIG		0x00038043
+
+#define	BCM2835_FIRMWARE_GPIO_IN			0
+#define	BCM2835_FIRMWARE_GPIO_OUT			1
+
+union msg_get_gpio_state {
+	struct {
+		uint32_t gpio;
+	} req;
+	struct {
+		uint32_t gpio;
+		uint32_t state;
+	} resp;
+};
+
+union msg_set_gpio_state {
+	struct {
+		uint32_t gpio;
+		uint32_t state;
+	} req;
+	struct {
+		uint32_t gpio;
+	} resp;
+};
+
+union msg_get_gpio_config {
+	struct {
+		uint32_t gpio;
+	} req;
+	struct {
+		uint32_t gpio;
+		uint32_t dir;
+		uint32_t pol;
+		uint32_t term_en;
+		uint32_t term_pull_up;
+	} resp;
+};
+
+union msg_set_gpio_config {
+	struct {
+		uint32_t gpio;
+		uint32_t dir;
+		uint32_t pol;
+		uint32_t term_en;
+		uint32_t term_pull_up;
+		uint32_t state;
+	} req;
+	struct {
+		uint32_t gpio;
+	} resp;
+};
+
 int bcm2835_firmware_property(device_t, uint32_t, void *, size_t);
 
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007281113.06SBDbBn047709>