Changes between Version 9 and Version 10 of SPI
- Timestamp:
- 08/21/2018 04:44:12 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SPI
v9 v10 60 60 Linux 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]) 61 61 62 An example device-tree child node for a m25p32-vme6g nor flashdevice would be:62 An example device-tree child node for a Spansion m25p128 compatible device (S25FL128) 128Mbit (16MB) SPI NOR FLASH device would be: 63 63 {{{#!c 64 64 flash: m25p80@0 { 65 /* "m25p 32" is your device IDstring */66 compatible = " m25p32";65 /* "m25p128" must match a supported driver compatible string */ 66 compatible = "spansion,m25p128", "jedec,spi-nor"; 67 67 /* device frequency (in MHz) */ 68 68 spi-max-frequency = <30000000>; … … 70 70 reg = <0>; 71 71 /* see dts documentation for your device */ 72 #device-width = <1>;73 72 #address-cells = <1>; 74 73 #size-cells = <1>; 74 75 75 partition@0 { 76 76 /* The name of this partition */ 77 77 label = "data"; 78 78 /* starting address and length */ 79 reg = <0x0 0x 2000000>;79 reg = <0x0 0x1000000>; 80 80 }; 81 81 }; … … 84 84 Note that this node must appear within the SPI host controller. For a list of device-tree nodes [#spitable see above]. 85 85 86 Note that the values shown in the above node are specific to the m25p 32-vme6g, and can vary greatly from the actual device you are using. Replace attribute values as necessary.86 Note 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. 87 87 88 88 When 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.