Devicetree for many peripherals (UART, I2C, SPI)

I have a custom board based on the nRF5340. I have 3 UART, 2 SPI, and 4 I2C busses (9 total).

I've tried to put these in my devicetree like so:

&uart0 {
	status = "okay";
	current-speed = <115200>;
	pinctrl-0 = <&uart0_default>;
	pinctrl-1 = <&uart0_sleep>;
	pinctrl-names = "default", "sleep";
};
&uart1 {
	status = "okay";
	current-speed = <115200>;
	pinctrl-0 = <&uart1_default>;
	pinctrl-1 = <&uart1_sleep>;
	pinctrl-names = "default", "sleep";
};
&uart2 {
	status = "okay";
	current-speed = <115200>;
	pinctrl-0 = <&uart2_default>;
	pinctrl-1 = <&uart2_sleep>;
	pinctrl-names = "default", "sleep";
};

&i2c3 {
	compatible = "nordic,nrf-twim";
	status = "okay";
	clock-frequency = <I2C_BITRATE_FAST>;
	pinctrl-0 = <&i2c3_default>;
	pinctrl-1 = <&i2c3_sleep>;
	pinctrl-names = "default", "sleep";
};

&i2c4 {
	compatible = "nordic,nrf-twim";
	status = "okay";
	clock-frequency = <I2C_BITRATE_FAST>;
	pinctrl-0 = <&i2c4_default>;
	pinctrl-1 = <&i2c4_sleep>;
	pinctrl-names = "default", "sleep";
};

&i2c6 {
	compatible = "nordic,nrf-twim";
	status = "okay";
	clock-frequency = <I2C_BITRATE_FAST>;
	pinctrl-0 = <&i2c6_default>;
	pinctrl-1 = <&i2c6_sleep>;
	pinctrl-names = "default", "sleep";
};

&i2c7 {
	compatible = "nordic,nrf-twim";
	status = "okay";
	clock-frequency = <I2C_BITRATE_FAST>;
	pinctrl-0 = <&i2c7_default>;
	pinctrl-1 = <&i2c7_sleep>;
	pinctrl-names = "default", "sleep";
};

&spi8 {
	compatible = "nordic,nrf-spim";
	status = "okay";
	cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>, // Thermistors
	<&gpio0 31 GPIO_ACTIVE_LOW>, // Empty
	<&gpio0 4 GPIO_ACTIVE_LOW>,  // TEC DAC
	<&gpio0 5 GPIO_ACTIVE_LOW>; // Empty

	pinctrl-0 = <&spi8_default>;
	pinctrl-1 = <&spi8_sleep>;
	pinctrl-names = "default", "sleep";
};

&spi9 {
	compatible = "nordic,nrf-spim";
	status = "okay";
	cs-gpios = <&gpio0 19 GPIO_ACTIVE_LOW>, // Ethernet
	<&gpio0 12 GPIO_ACTIVE_LOW>; // Empty

	pinctrl-0 = <&spi9_default>;
	pinctrl-1 = <&spi9_sleep>;
	pinctrl-names = "default", "sleep";
};

This throws an error that "i2c4" is an "unknown label", because it's not defined in `nrf5340_cpuapp_peripherals.dtsi`.

I can't double up on the peripheral indexes (e.g. `uart0` and `i2c0`), because they both share the same address in `nrf5340_cpuapp_peripherals.dtsi` and it throws an error saying "only one of the following peripherals can be enabled...".

Is there a way to define more then 4 UART/I2C/SPI peripherals on an nRF5340?

Parents Reply Children
No Data
Related