[OpenWrt-Devel] lantiq: Initial linux 4.4 support (with SPI problems)
Martin Blumenstingl
martin.blumenstingl at googlemail.com
Sat Jan 16 15:17:12 EST 2016
On Sat, Jan 16, 2016 at 7:07 PM, Daniel Schwierzeck
<daniel.schwierzeck at gmail.com> wrote:
> If you use native CS, you should use the same numbering as in the
> datasheet:
>
> &spi {
> ...
> spi-nor at 4 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "jedec,spi-nor";
> reg = <4>;
> spi-max-frequency = <25000000>;
> };
> };
>
> If you use GPIO CS, you can ignore the native CS numbering and choose
> your own and you can also start with 0:
>
> &spi {
> ...
> cs-gpios = <&gpio 10 1>;
>
> spi-nor at 0 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "jedec,spi-nor";
> reg = <0>;
> spi-max-frequency = <25000000>;
> };
> };
>
> If you use native CS 4, you have to manipulate bits 3 and 11 in the
> GPOCON and FGPO registers. Thus you have to keep the (cs - 1)
> translation.
Thanks for the explanation.
I think what confused me is that I thought of mixing GPIO-based CS and
HW CS. But as far as I can see that is not supported: either use GPIOs
or HW for CS.
Thus I went ahead and updated the board .dts to be +1 compared to
their old value and reverted my changes to your patch.
>> While reviewing my changes I may have found a small problem with your
>> driver:
>> You don't have a separate "lantiq,spi-xrx100" OF-match. I think you
>> should add one with the same settings as for the other xrx-SoCs.
>> If you look at DGN3500.dtsi [2] you'll see that it's an ARX100 board
>> using spi_cs4.
>
> that's because I couldn't test it. But according to the datasheet,
> xRX100 also supports six native CS lines.
I added an of_device_id for "lantiq,spi-xrx100". Unfortunately I also
don't have xRX100 hardware which uses any SPI device, thus I can only
compile-test it.
So compared to your patch the final list of changes is:
- INIT_COMPLETION -> reinit_completion
- use clk_get_fpi()
- of_device_id for "lantiq,spi-xrx100"
I only have three small questions left:
- The "spi_frm" interrupt is currently unused - is that on purpose?
- I went ahead and added multiple "compatible" strings to the
soc.dtsi, for example: compatible = "lantiq,spi-ase",
"lantiq,spi-xway"; - do you see any problems with that?
Please let me know if you have more feedback - otherwise I'll do the
final round of tests and send the patches later.
PS: My git tree is contains the latest set of changes: [0]
Martin
[0] https://github.com/xdarklight/openwrt/commits/lantiq-spi-driver-daniel-v3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list