Skip to content

SPI MISO conflicts with data/command (ROCK 5B and maybe other boards) #32

Description

@Gadgetoid

After much tinkering I came up with this dtoverlay which configures ROCK 5Bs spi0-m2-cs1 to skip over the MISO pin, so it can be used for data/command:

/dts-v1/;
/plugin/;

/ {
	fragment@0 {
		target = <&spi0>;

		__overlay__ {
			status = "okay";
			#address-cells = <1>;
			#size-cells = <0>;
			pinctrl-names = "default";
			pinctrl-0 = <&spi0m2_cs1 &spi0m2_nomiso_pins>;
			max-freq = <50000000>;

			spidev@1 {
				compatible = "rockchip,spidev";
				status = "okay";
				reg = <1>;
				spi-max-frequency = <50000000>;
			};
		};
	};
	fragment@1 {
		target = <&pinctrl>;

		__overlay__ {

			spi0 {

				spi0m2_nomiso_pins: spi0m2-nomiso-pins {
					rockchip,pins =
						/* spi0_clk_m2 */
						<1 11 8 &pcfg_pull_up_drv_level_6>,
						/* spi0_miso_m2 */
						/*<1 9 8 &pcfg_pull_up_drv_level_6>,*/
						/* spi0_mosi_m2 */
						<1 10 8 &pcfg_pull_up_drv_level_6>;
				};
			};
		};
	};
};

Install with: sudo armbian-add-overlay rk3588-spi0-m2-cs1-nomiso-spidev.dts

Something like this might be needed for Raspberry Pi 5, so I figured out the dtoverlay magic on ROCK while I was waiting for the SPI to be fixed...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions