Overlays as with BeagleBone Black

On the BeagleBone Black, I used the overlays defined in /boot/uEnv.txt to enable CAN and some UARTs and to disable several things like HDMI etc. Now I received my BBAI a few days ago where the whole overlay setup has been removed from uEnv.txt.

I then went ahead and tried to use the config-pin tool but for any pin I tried (I even tried to set some to GPIO) it errored out (I can’t look up the error right now but could tomorrow, if it matters).

My question: How do I enable peripherals like CAN and UART (with or without overlays, it doesn’t matter to me)?

I used the Debian 9.9 LXQT image (https://debian.beagleboard.org/images/am57xx-debian-9.9-lxqt-armhf-2019-08-03-4gb.img.xz)

I’m in the middle of trying this to get spidev/spi2 to work: https://www.elinux.org/EBC_Exercise_41_Pin_Muxing_for_the_AI

Thanks, that looks like it might work. I am a bit surprised though, that after the relative ease of use of config-pin and overlays, we should now be back at having to compile DTBs ourselves. I assume (hope) this is just temporary and in the future, there will be simpler solutions again.

Sadly, with the AM5, we can't do the pinmux from userspace.. (hardware
bugs)... Everything must be done early..

Regards,

Hallo Robert,

i need to activate the /dev/i2c-2 on the beaglebone AI. When i got that right i have to add a node in the device tree in order to activate it.

Can you tell me what i have to add there?

Kind Regards

i need to activate the /dev/i2c-2 on the beaglebone AI. When i got that right i have to add a node in the device tree in order to activate it.
Can you tell me what i have to add there?

Don’t know if this will help you, but to get access to the eeprom on my cape I added:

`
&i2c4 {
eeprom: eeprom@54 {
compatible = “atmel,24c32”;
reg = <0x54>;
};
};

`

to the .dts After that /sys/bus/i2c/devices/3-0054/eeprom appeared and I could do e.g. “hexdump -C …”.

Be sure to set the iopads accordingly. I used this:

`
DRA7XX_CORE_IOPAD(0x3440, PIN_INPUT_PULLUP | MUX_MODE7) // R6 P9.19a i2c4_scl
DRA7XX_CORE_IOPAD(0x357C, PULL_DIS | MUX_MODE15) // F4 P9.19b
DRA7XX_CORE_IOPAD(0x3444, PIN_INPUT_PULLUP | MUX_MODE7) // T9 P9.20a i2c4_sda
DRA7XX_CORE_IOPAD(0x3578, PULL_DIS | MUX_MODE15) // D2 P9.20b

`

/opt/scripts/device/bone/show-pins.pl shows:

P9.19a 16 R6 7 fast rx up i2c4_scl kiwisdr (cape_pins_kiwi)

P9.20a 17 T9 7 fast rx up i2c4_sda kiwisdr (cape_pins_kiwi)

P9.20b 94 D2 f fast Driver off kiwisdr (cape_pins_kiwi)

P9.19b 95 F4 f fast Driver off kiwisdr (cape_pins_kiwi)

To reply to myself: After looking at it again and reading through other people’s pages, I managed to get the CAN device working with this DTS (after cloning the BeagleBoard-DeviceTrees repo):

`

#include “am5729-beagleboneai.dts”

/ {
chosen {
base_dtb = “am5729-beagleboneai-kitepower.dts”;
base_dtb_timestamp = TIMESTAMP;
};
};

// The second name (pinmux_dcan2_pins) seems not used
&dra7_pmx_core {
dcan2_pins: pinmux_dcan2_pins {
pinctrl-single,pins = <
/* P9_24: uart1_txd.d_can2_rx /
DRA7XX_CORE_IOPAD(0x368C, PIN_INPUT_PULLUP | MUX_MODE2)
/
P9_26: uart1_rxd.d_can2_tx */
DRA7XX_CORE_IOPAD(0x3688, PIN_OUTPUT_PULLUP | MUX_MODE2)

;
};
};

// Initially defined in dra7 (which is included through multiple layers) as disabled
&dcan2 {
pinctrl-names = “default”; // Not sure what this is used for
pinctrl-0 = <&dcan2_pins>;
status = “okay”;
};

`

This muxes the 2 pins with the CAN peripheral to CAN.

After compiling this into a DTB, putting it on the beagle and setting it up in the uEnv.txt, I only need to bring up the CAN device:

sudo ip link set can0 up type can bitrate ${bitrate}

and CAN works (I use a bit rate of 125000).

Thanks for the people who took time to document their efforts and I hope this helps others.

Did you do any further changes on your BBAI to make this device tree run?

I just want to do a simple pinmux to give PRU1_0 some gpio’s, but everytime I edit my uEnv.txt, the kernel does not load after reboot. So I was looking around and found this thread.
I tried to copy your .dts, compiled it and copied it to /boot/dtbs/4.14xxxx. However, the kernel does not load. (Btw. I am using the 4.14.108-ti-xenomai-r127 kernel, didn’t test with normal ti kernel yet)

Another dts I tried is descriped here: https://www.element14.com/community/community/project14/visionthing/blog/2019/11/16/beagleboard-ai-brick-recovery-procedure#jive_content_id_BBAI_SETUP_CHECKLIST
Still no success.

The only other device tree that worked for me, is the am5729-beagleboneai-roboticscape.dtb
Any any ideas on this?

Did you do any further changes on your BBAI to make this device tree run?

Yes, this is the exact DTB I am using, everything else is stock (I
think I was using the Debian 9.10 IoT image).

I just want to do a simple pinmux to give PRU1_0 some gpio's, but everytime I edit my uEnv.txt, the kernel does not load after reboot. So I was looking around and found this thread.
I tried to copy your .dts, compiled it and copied it to /boot/dtbs/4.14xxxx. However, the kernel does not load. (Btw. I am using the 4.14.108-ti-xenomai-r127 kernel, didn't test with normal ti kernel yet)

I am using 4.19.x-ti, so this could certainly be an important difference.

Bert