My question: How do I enable peripherals like CAN and UART (with or without overlays, it doesn't matter to me)?
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
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?
&i2c4 {
eeprom: eeprom@54 {
compatible = "atmel,24c32";
reg = <0x54>;
};
};
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
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)
#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";};
sudo ip link set can0 up type can bitrate ${bitrate}
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 forpinctrl-0 = <&dcan2_pins>;status = "okay";};