by vinibali » Tue Jul 20, 2021 8:20 pm
Just to note, it's clear now, the flash entry is for the mtd device, apart from the the spidev is responsible for the spidev. Pretty obvious, but I paste the edited dtsi file, which I used for the zero.
Long story sort, spi devices needs to be enabled (status from disabled to okay), and spidev subdevice must be defined, using both spidev and flash for the same device is not recommended. Make the diff on your own, I think it's not so visible if I just paste the diff output here.
Original DTB file:
$this->bbcode_second_pass_code('', '
spi@1c68000 {
compatible = "allwinner,sun8i-h3-spi";
reg = <0x1c68000 0x1000>;
interrupts = <0x00 0x41 0x04>;
clocks = <0x03 0x1e 0x03 0x52>;
clock-names = "ahb\0mod";
dmas = <0x14 0x17 0x14 0x17>;
dma-names = "rx\0tx";
pinctrl-names = "default";
pinctrl-0 = <0x15>;
resets = <0x03 0x0f>;
status = "disabled";
#address-cells = <0x01>;
#size-cells = <0x00>;
phandle = <0x50>;
flash@0 {
#address-cells = <0x01>;
#size-cells = <0x01>;
compatible = "mxicy,mx25l1606e\0winbond,w25q128";
reg = <0x00>;
spi-max-frequency = <0x2625a00>;
};
};
spi@1c69000 {
compatible = "allwinner,sun8i-h3-spi";
reg = <0x1c69000 0x1000>;
interrupts = <0x00 0x42 0x04>;
clocks = <0x03 0x1f 0x03 0x53>;
clock-names = "ahb\0mod";
dmas = <0x14 0x18 0x14 0x18>;
dma-names = "rx\0tx";
pinctrl-names = "default";
pinctrl-0 = <0x16>;
resets = <0x03 0x10>;
status = "disabled";
#address-cells = <0x01>;
#size-cells = <0x00>;
phandle = <0x51>;
};
')
Edited DTB file:
$this->bbcode_second_pass_code('', '
spi@1c68000 {
compatible = "allwinner,sun8i-h3-spi";
reg = <0x1c68000 0x1000>;
interrupts = <0x00 0x41 0x04>;
clocks = <0x03 0x1e 0x03 0x52>;
clock-names = "ahb\0mod";
dmas = <0x14 0x17 0x14 0x17>;
dma-names = "rx\0tx";
pinctrl-names = "default";
pinctrl-0 = <0x15>;
resets = <0x03 0x0f>;
status = "okay";
#address-cells = <0x01>;
#size-cells = <0x00>;
phandle = <0x50>;
spidev@0 {
spi-max-frequency = <0xf4240>;
reg = <0x00>;
status = "okay";
compatible = "spidev";
};
flash@0 {
#address-cells = <0x01>;
#size-cells = <0x01>;
compatible = "mxicy,mx25l1606e\0winbond,w25q128";
reg = <0x00>;
spi-max-frequency = <0x2625a00>;
};
};
spi@1c69000 {
compatible = "allwinner,sun8i-h3-spi";
reg = <0x1c69000 0x1000>;
interrupts = <0x00 0x42 0x04>;
clocks = <0x03 0x1f 0x03 0x53>;
clock-names = "ahb\0mod";
dmas = <0x14 0x18 0x14 0x18>;
dma-names = "rx\0tx";
pinctrl-names = "default";
pinctrl-0 = <0x16>;
resets = <0x03 0x10>;
status = "okay";
#address-cells = <0x01>;
#size-cells = <0x00>;
phandle = <0x51>;
spidev@0 {
spi-max-frequency = <0xf4240>;
reg = <0x00>;
status = "okay";
compatible = "spidev";
};
};
')