Hello John, I have confirmed that the patch is totally bogus and should be ignored. Having said that there are some issues that I think need to be looked at.
interestingly enough this all came about as I tried to add a second SPI device to the MT7620a... Much like what is discussed here http://comments.gmane.org/gmane.comp.embedded.openwrt.devel/24633 what i found is that when looking at the SPI definition in mt7620a.dtsi spi@b00 { compatible = "ralink,mt7620a-spi", "ralink,rt2880-spi"; reg = <0xb00 0x100>; resets = <&rstctrl 18>; reset-names = "spi"; #address-cells = <1>; #size-cells = <1>; status = "disabled"; pinctrl-names = "default"; pinctrl-0 = <&spi_pins>; }; that a) there is no entry "ralink,mt7620a-spi" in mt7620.c which is what I was trying to address in my patch (albeit incorrectly) b) using the original mt7620.c its possible to use "ralink,mt5350-spi" which has num_cs set to 2. c) that "ralink,rt2880-spi" must be removed from the compatibility list or a cs1 >= max cs error will result on initialization resulting in the second device not being registered. So spi@b00 { compatible = "ralink,mt5350-spi" reg = <0xb00 0x100>; resets = <&rstctrl 18>; reset-names = "spi"; #address-cells = <1>; #size-cells = <1>; status = "disabled"; pinctrl-names = "default"; pinctrl-0 = <&spi_pins>; }; works for me. my second spi device is configured correctly. Thanks, --luis On 9/1/14, 11:03 AM, John Crispin wrote > Hi Luis, > > i am planning to look at this during the week as i need to fix up spi > support for mt7628 anyhow. i will look at this at the same time > > John > > > > On 01/09/2014 16:51, Luis Soltero wrote: >> Hello John, >> >> OK. thanks for our comments. So... is it worth pursuing this to >> get it right or is it so wrong that we should just forget it and >> retract the whole thing? Your mesg is unclear. Let me know what >> you want me to do. >> >> Thanks, >> >> --luis >> >> On 9/1/14, 2:25 AM, John Crispin wrote: >>> Hi, >>> >>> that patch subject is utterly wrong. the real desc would be >>> >>> "add support for the 2nd CS line on mt7620a and add a special >>> device_id for this." >>> >>> however, as you only register the CS with the spi driver and are >>> missing the actuall /cs1 mux init, this patch is wrong/incomplete >>> as it relies on the bootloader to have setup the cs line already >>> and has a misleading desription. >>> >>> John >>> >>> On 31/08/2014 22:55, Luis Soltero wrote: >>>> Hello All, >>>> >>>> the mt7620a.dtsi makes reference to mt7620a-spi but this node >>>> does not exist in spi.c. The following patch address this. >>>> >>>> here is the entry in the dts file... spi@b00 { >>>> >>>> >>>> compatible = "ralink,mt7620a-spi", "ralink,rt2880-spi"; >>>> >>>> >>>> reg = <0xb00 0x100>; >>>> >>>> >>>> >>>> >>>> resets = <&rstctrl 18>; >>>> >>>> >>>> reset-names = "spi"; >>>> >>>> >>>> >>>> >>>> #address-cells = <1>; >>>> >>>> >>>> #size-cells = <1>; >>>> >>>> >>>> >>>> >>>> status = "disabled"; >>>> >>>> >>>> >>>> >>>> pinctrl-names = "default"; >>>> >>>> >>>> pinctrl-0 = <&spi_pins>; >>>> >>>> >>>> }; >>>> >>>> >>>> the following mus be added to the DTS file to use it. >>>> >>>> spi@b00 { >>>> >>>> >>>> status = "okay"; >>>> >>>> >>>> num-cs = <2>; >>>> >>>> >>>> m25p80@0 { snip.... >>>> >>>> here is the patch. >>>> >>>> --luis >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ openwrt-devel >>>> mailing list [email protected] >>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel >>>> > _______________________________________________ >>> openwrt-devel mailing list [email protected] >>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel >>> > _______________________________________________ > openwrt-devel mailing list > [email protected] > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel > -- Luis Soltero, Ph.D., MCS Director of Software Development, CTO Global Marine Networks, LLC StarPilot, LLC Tel: +1.865.379.8723 Fax: +1.865.681.5017 E-Mail: [email protected] Web: http://www.globalmarinenet.net Web: http://www.redportglobal.com Web: http://www.starpilotllc.com _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
