Add 2nd SPI NOR to Omega2+

All, I am trying to add a second SPI NOR device to my Onion Omega2+. (Unfortunately, I need to use an old release of OpenWRT, branch lede-17.01.)
On this board, the SPI bus is shared with the primary SPI NOR, which uses CS0. The same bus is exposed for expansion but uses CS1. I have the second SPI NOR connected with CS1.
My change, which is either wrong or not sufficient, is in OMEGA2.dtsi:

I removed this chunk:

	spidev@1 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "linux,spidev";
		reg = <1>;
		spi-max-frequency = <40000000>;
	};

And added this:

	m25p80@1 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "jedec,spi-nor";
		reg = <1>;
		spi-max-frequency = <10000000>;
		m25p,chunked-io = <31>;

		partition@0 {
			label = "authenta-spi-nor";
			reg = <0x0 0x1000000>;
		};
	};

This chunk of code instantiates the primary SPI NOR.

	m25p80@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <10000000>;
		m25p,chunked-io = <31>;

		partition@0 {
			label = "u-boot";
			reg = <0x0 0x30000>;
			read-only;
		};
<SNIP>
	};

When I'm running, I see one pulse on CS1, with a single one-byte command (0x3F), but I think that's not a legit command. I think it's a fluke. And there are not apparent read-backs from the device after. So, I think it's just all wrong!

I would appreciate it if someone can please show me what I'm doing wrong or missing. Thank you in advance!

Should anyone have the same problem as I did, I have discovered that there is a bug in the silicon. Please see https://forum.openwrt.org/t/error-when-using-spi-device-on-hlk-7688-module/37851

Applying this patch
https://github.com/OnionIoT/source/blob/openwrt-18.06/target/linux/ramips/patches-4.14/9999-spi-mt7621.patch
resolved the issue.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.