Changes between Version 9 and Version 10 of SPI


Ignore:
Timestamp:
08/21/2018 04:44:12 PM (6 years ago)
Author:
Tim Harvey
Comment:

updated SPI DTS example

Legend:

Unmodified
Added
Removed
Modified
  • SPI

    v9 v10  
    6060Linux kernels that utilize the device-tree need to add a device-tree node to the SPI controller to use a kernel driver. Note that you can also access SPI from userspace using {{{spidev}}} (see [#spidev below])
    6161
    62 An example device-tree child node for a m25p32-vme6g nor flash device would be:
     62An example device-tree child node for a Spansion m25p128 compatible device (S25FL128) 128Mbit (16MB) SPI NOR FLASH device would be:
    6363{{{#!c
    6464flash: m25p80@0 {
    65         /* "m25p32" is your device ID string */
    66         compatible = "m25p32";
     65        /* "m25p128" must match a supported driver compatible string */
     66        compatible = "spansion,m25p128", "jedec,spi-nor";
    6767        /* device frequency (in MHz) */
    6868        spi-max-frequency = <30000000>;
     
    7070        reg = <0>;
    7171        /* see dts documentation for your device */
    72         #device-width = <1>;
    7372        #address-cells = <1>;
    7473        #size-cells = <1>;
     74
    7575        partition@0 {
    7676           /* The name of this partition  */
    7777           label = "data";
    7878            /* starting address and length */
    79            reg = <0x0 0x2000000>;
     79           reg = <0x0 0x1000000>;
    8080        };
    8181};
     
    8484Note that this node must appear within the SPI host controller. For a list of device-tree nodes [#spitable see above].
    8585
    86 Note that the values shown in the above node are specific to the m25p32-vme6g, and can vary greatly from the actual device you are using. Replace attribute values as necessary.
     86Note that the values shown in the above node are specific to the m25p128, and can vary greatly from the actual device you are using. Replace attribute values as necessary.
    8787
    8888When searching for your device ID string or its controlling driver, searching via a Linux LXR site like the one at [https://lxr.missinglinkelectronics.com/linux missing link electronics] for your device name can be helpful.