How to access GPIOs on BeagleV Ahead

@jamidon

did you make these changes

looks like they have been busy
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 23.10
Release: 23.10
Codename: mantic

I didn’t run the menu config step, didn’t know it was needed. I think that explains the ‘-dirty’ in your build.

I’ll give this a whirl and see what happens.

Thanks.

also testing right now…

diff --git a/patches/linux/beaglev_defconfig b/patches/linux/beaglev_defconfig
index f1dcd6a..c9ecc38 100644
--- a/patches/linux/beaglev_defconfig
+++ b/patches/linux/beaglev_defconfig
@@ -27,7 +27,7 @@ CONFIG_THREAD_INFO_IN_TASK=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 # CONFIG_COMPILE_TEST is not set
 # CONFIG_WERROR is not set
-CONFIG_LOCALVERSION="-20240429"
+CONFIG_LOCALVERSION="-20240430"
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_BUILD_SALT=""
 CONFIG_DEFAULT_INIT=""
@@ -2371,7 +2371,7 @@ CONFIG_OF_GPIO=y
 CONFIG_GPIO_ACPI=y
 CONFIG_GPIOLIB_IRQCHIP=y
 # CONFIG_DEBUG_GPIO is not set
-# CONFIG_GPIO_SYSFS is not set
+CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_CDEV=y
 CONFIG_GPIO_CDEV_V1=y
 CONFIG_GPIO_GENERIC=y
@@ -2383,7 +2383,7 @@ CONFIG_GPIO_GENERIC=y
 # CONFIG_GPIO_ALTERA is not set
 # CONFIG_GPIO_AMDPT is not set
 # CONFIG_GPIO_CADENCE is not set
-# CONFIG_GPIO_DWAPB is not set
+CONFIG_GPIO_DWAPB=y
 # CONFIG_GPIO_FTGPIO010 is not set
 # CONFIG_GPIO_GENERIC_PLATFORM is not set
 # CONFIG_GPIO_GRGPIO is not set

I didn’t think the gpio driver made it mainline yet…

Must be a patch in buildroot:

voodoo@BeagleV-Ahead:~$ uname -r
6.9.0-rc6-20240430+
voodoo@BeagleV-Ahead:~$ dmesg | grep gpio
voodoo@BeagleV-Ahead:~$ dmesg | grep pin
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 1032192
[    0.124340] pinctrl core: initialized pinctrl subsystem

Pushed: config: add CONFIG_GPIO_SYSFS CONFIG_GPIO_DWAPB and include sysconf.txt (f6e38f09) · Commits · BeagleV-Ahead / xuantie-ubuntu · GitLab

BTW, I’ve integrated our arm64 based sysconf.txt file into riscv64, so you can change all the user defaults:

# This file will be automatically evaluated and installed at next boot
# time, and regenerated (to avoid leaking passwords and such information).
#
# To force it to be evaluated immediately, you can run (as root):
#
#     /usr/sbin/bbbio-set-sysconf
#
# You can disable the file evaluation by disabling the bbbio-set-sysconf
# service in systemd:
#
#     systemctl disable bbbio-set-sysconf
#
# Comments (all portions of a line following a '#' character) are
# ignored. This file is read line by line. Valid
# configuration lines are of the form 'key=value'. Whitespace around
# 'key' and 'value' is ignored. This file will be _regenerated_ every
# time it is evaluated.
#
# We follow the convention to indent with one space comments, and
# leave no space to indicate the line is an example that could be
# uncommented.

# user_name - Set a user name for the user (1000)
#user_name=beagle

# user_password - Set a password for user (1000)
#user_password=FooBar

# user_authorized_key - Set an authorized key for a user (1000) ssh login
#user_authorized_key=

# iwd_psk_file - Set a configuration for iwd https://wiki.archlinux.org/title/iwd
#iwd_psk_file=

# hostapd_file - Set a configuration for hostapd https://wiki.gentoo.org/wiki/Hostapd
#hostapd_file=SoftAp0.conf

# hostname - Set the system hostname.
#hostname=BeagleBone

# keymap - Set the system keymap.
#keymap=us

# timezone - Set the system timezone.
#timezone=America/Chicago

Regards,

1 Like