Hello,
i would like to share my personnal project, hobby : use OpenBSD to play with electronic components with arm / arm64. In this way i wrote few functions to use gpio pins : https://git.burelli.fr/oliv/gpio_lib_c Same than arduino : digitalWrite() ; digitalRead() ... I am not a developer, if you take a look, please be indulgent. I am just starting to learn C. (i just wrote few powershell scripts in the past) I ordered also BOSCH BME 280 (sensor : temperature, moisture & pressure), DS1631 (digital temperature), 24LC256 (EEPROM I2C)... _ I plugged some of these components to P9_17 & P9_18 without reading something in the dmesg _ I read the System Reference Manual https://github.com/beagleboard/beaglebone-black/wiki/System-Reference-Manual I would like to understand how the kernel detect the pin, and how an user can interact with it, how to use it ? (like /etc/rc.securelevel for gpio ?) In fact i am confuse, because for ROCK64 : http://files.pine64.org/doc/rock64/ROCK64_Pi-2%20_and_Pi_P5+_Bus.pdf it seems that we can declare in /etc/rc.securelevel gpio2_D1 as iic_sda. How can i use ioctl with these pin (iic, SPI, and pwm / analog) ? I did not find anything in the dmesg : U-Boot SPL 2018.09 (Sep 18 2018 - 14:48:13 -0600) Trying to boot from MMC2 Loading Environment from FAT... Card did not respond to voltage select! Loading Environment from MMC... *** Warning - bad CRC, using default environment U-Boot 2018.09 (Sep 18 2018 - 14:48:13 -0600) CPU : AM335X-GP rev 2.1 I2C: ready DRAM: 512 MiB No match for driver 'omap_hsmmc' No match for driver 'omap_hsmmc' Some drivers were not found MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 Loading Environment from FAT... Card did not respond to voltage select! Loading Environment from MMC... *** Warning - bad CRC, using default environment <ethaddr> not set. Validating first E-fuse MAC Net: cpsw, usb_ether Press SPACE to abort autoboot in 2 seconds Card did not respond to voltage select! Card did not respond to voltage select! Card did not respond to voltage select! Card did not respond to voltage select! Card did not respond to voltage select! switch to partitions #0, OK mmc1(part 0) is current device Scanning mmc 1:1... 36084 bytes read in 4 ms (8.6 MiB/s) Found EFI removable media binary efi/boot/bootarm.efi Scanning disks on usb... Disk usb0 not ready Disk usb1 not ready Disk usb2 not ready Disk usb3 not ready Scanning disks on mmc... Card did not respond to voltage select! MMC Device 2 not found MMC Device 3 not found Found 3 disks 89060 bytes read in 8 ms (10.6 MiB/s) ## Starting EFI application at 82000000 ... >> OpenBSD/armv7 BOOTARM 1.1 boot> booting sd0a:/bsd: 4514096+674304+232852+564468 [295783+107+311264+275293]=0x68e3b0 OpenBSD/armv7 booting ... arg0 0xc098e3b0 arg1 0xe05 arg2 0x87ff5000 Allocating page tables freestart = 0x8098f000, free_pages = 128625 (0x0001f671) IRQ stack: p0x809bd000 v0xc09bd000 ABT stack: p0x809be000 v0xc09be000 UND stack: p0x809bf000 v0xc09bf000 SVC stack: p0x809c0000 v0xc09c0000 Creating L1 page table at 0x80990000 Mapping kernel Constructing L2 page tables undefined page pmap [ using 882984 bytes of bsd ELF symbol table ] board type: 3589 Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. Copyright (c) 1995-2018 OpenBSD. All rights reserved. https://www.OpenBSD.org OpenBSD 6.4-stable (GENERIC) #0: Wed Jan 2 21:13:04 CET 2019 o...@droopy.my.domain:/sys/arch/armv7/compile/GENERIC real mem = 536870912 (512MB) avail mem = 516149248 (492MB) mainbus0 at root: TI AM335x BeagleBone Black cpu0 at mainbus0: ARM Cortex-A8 r3p2 (ARMv7) cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled cpu0: 32KB(64b/l,4way) I-cache, 32KB(64b/l,4way) wr-back D-cache omap0 at mainbus0 prcm0 at omap0 rev 0.2 dmtimer0 at omap0 rev 3.1 dmtimer1 at omap0 rev 3.1 simplebus0 at mainbus0: "ocp" simplebus1 at simplebus0: "l4_wkup" simplebus2 at simplebus1: "prcm" simplebus3 at simplebus1: "scm" syscon0 at simplebus3: "scm_conf" pinctrl0 at simplebus3 simplebus4 at simplebus3: "scm_conf" intc0 at simplebus0 rev 5.0 omgpio0 at simplebus0: rev 0.1 gpio0 at omgpio0: 32 pins omgpio1 at simplebus0: rev 0.1 gpio1 at omgpio1: 32 pins omgpio2 at simplebus0: rev 0.1 gpio2 at omgpio2: 32 pins omgpio3 at simplebus0: rev 0.1 gpio3 at omgpio3: 32 pins com0 at simplebus0: ti16750, 64 byte fifo com0: console tiiic0 at simplebus0 rev 0.11 iic0 at tiiic0 "ti,tps65217" at iic0 addr 0x24 not configured "atmel,24c256" at iic0 addr 0x50 not configured nxphdmi0 at iic0 addr 0x70: rev 0x0301 nxphdmi0: no display detected tiiic1 at simplebus0 rev 0.11 iic1 at tiiic1 "atmel,24c256" at iic1 addr 0x54 not configured "atmel,24c256" at iic1 addr 0x55 not configured "atmel,24c256" at iic1 addr 0x56 not configured "atmel,24c256" at iic1 addr 0x57 not configured ommmc0 at simplebus0 sdmmc0 at ommmc0: 4-bit, sd high-speed, mmc high-speed ommmc1 at simplebus0 sdmmc1 at ommmc1: 1-bit omdog0 at simplebus0 rev 0.1 cpsw0 at simplebus0: version 1.12 (0), address 40:bd:32:20:b2:20 ukphy0 at cpsw0 phy 0: Generic IEEE 802.3u media interface, rev. 1: OUI 0x0001f0, model 0x000f amdisplay0 at simplebus0 amdisplay0: no display attached. sdmmc0: can't enable card scsibus0 at sdmmc1: 2 targets, initiator 0 sd0 at scsibus0 targ 1 lun 0: <Kingston, M62704, 0000> SCSI2 0/direct removable sd0: 3648MB, 512 bytes/sector, 7471104 sectors vscsi0 at root scsibus1 at vscsi0: 256 targets softraid0 at root scsibus2 at softraid0: 256 targets bootfile: sd0a:/bsd boot device: sd0 root on sd0a (772d78f83983cc96.a) swap on sd0b dump on sd0b WARNING: CHECK AND RESET THE DATE! Automatic boot in progress: starting file system checks. /dev/sd0a (772d78f83983cc96.a): file system is clean; not checking /dev/sd0e (772d78f83983cc96.e): file system is clean; not checking /dev/sd0d (772d78f83983cc96.d): file system is clean; not checking setting tty flags pf enabled starting network cpsw0: bound to 192.168.26.44 from 192.168.26.254 (14:0c:76:6f:13:59) reordering libraries: done. starting early daemons: syslogd pflogd ntpd. starting RPC daemons:. savecore: no core dump checking quotas: done. clearing /tmp pin 13: caps: in out pu pd, flags: -> out pin 12: caps: in out pu pd, flags: -> out pin 26: caps: in out pu pd, flags: -> out pin 15: caps: in out pu pd, flags: -> out pin 14: caps: in out pu pd, flags: -> out pin 27: caps: in out pu pd, flags: -> out pin 1: caps: in out pu pd, flags: -> out pin 29: caps: in out pu pd, flags: -> out pin 23: caps: in out pu pd, flags: -> out pin 25: caps: in out pu pd, flags: -> out pin 12: caps: in out pu pd, flags: -> out pin 13: caps: in out pu pd, flags: -> out pin 10: caps: in out pu pd, flags: -> out pin 11: caps: in out pu pd, flags: -> out pin 8: caps: in out pu pd, flags: -> out pin 9: caps: in out pu pd, flags: -> out pin 6: caps: in out pu pd, flags: -> out pin 7: caps: in out pu pd, flags: -> out pin 16: caps: in out pu pd, flags: -> in pin 17: caps: in out pu pd, flags: -> in pin 19: caps: in out pu pd, flags: -> in kern.securelevel: 0 -> 1 creating runtime link editor directory cache. preserving editor files. starting network daemons: sshd smtpd sndiod. starting local daemons: cron. Mon Jan 21 23:19:58 CET 2019 Tank you.