Enable can0 can1 bookworm or change pins for i2c2

  1. Create dtsi file (unpin i2c2 from p9.19, p9.20 and pin to p9.21, p9.22 ) - /opt/source/overlay-utils/i2c2.dtsi

#include “bone/black.h”

USES_PIN( P9_21 );
USES_PIN( P9_22 );

// setup pinmux and enable controller

&i2c2 {
pinctrl-names = “default”;
pinctrl-0 = <&i2c2_pins>;

status = “okay”;

clock-frequency = <100000>;
};

&am33xx_pinmux {
i2c2_pins: i2c2 {strong text
pinctrl-single,pins = <
PIN_PULLUP( P9_22, 3 ) // sda
PIN_PULLUP( P9_21, 3 ) // scl
>;
};
};


  1. Compile dtbo file - /opt/source/overlay-utils# make i2c2.dtbo

  2. Also compile can0.dtsi, can1dtsi

  3. Add paths to /boot/uEnv.txt


###Custom Cape
dtb_overlay=i2c2.dtbo

uboot_overlay_addr0=/opt/source/overlay-utils/can0.dtbo
uboot_overlay_addr1=/opt/source/overlay-utils/can1.dtbo


Hope, it will be useful for someone )