SPI (Serial Peripheral Interface) busses

SPI busses can be described with a node for the SPI master device
and a set of child nodes for each SPI slave on the bus.  For this
discussion, it is assumed that the system's SPI controller is in
SPI master mode.  This binding does not describe SPI controllers
in slave mode.

The SPI master node requires the following properties:
- #address-cells  - number of cells required to define a chip select
            address on the SPI bus.
- #size-cells     - should be zero.
- compatible      - name of SPI bus controller following generic names
            recommended practice.
- cs-gpios      - (optional) gpios chip select.
No other properties are required in the SPI bus node.  It is assumed
that a driver for an SPI bus device will understand that it is an SPI bus.
However, the binding does not attempt to define the specific method for
assigning chip select numbers.  Since SPI chip select configuration is
flexible and non-standardized, it is left out of this binding with the
assumption that board specific platform code will be used to manage
chip selects.  Individual drivers can define additional properties to
support describing the chip select layout.

Optional property:
- num-cs : total number of chipselects

If cs-gpios is used the number of chip select will automatically increased
with max(cs-gpios > hw cs)

So if for example the controller has 2 CS lines, and the cs-gpios
property looks like this:

cs-gpios = <&gpio1 0 0> <0> <&gpio1 1 0> <&gpio1 2 0>;

Then it should be configured so that num_chipselect = 4 with the
following mapping:

cs0 : &gpio1 0 0
cs1 : native
cs2 : &gpio1 1 0
cs3 : &gpio1 2 0

SPI slave nodes must be children of the SPI master node and can
contain the following properties.
- reg             - (required) chip select address of device.
- compatible      - (required) name of SPI device following generic names
            recommended practice
- spi-max-frequency - (required) Maximum SPI clocking speed of device in Hz
- spi-cpol        - (optional) Empty property indicating device requires
            inverse clock polarity (CPOL) mode
- spi-cpha        - (optional) Empty property indicating device requires
            shifted clock phase (CPHA) mode
- spi-cs-high     - (optional) Empty property indicating device requires
            chip select active high
- spi-3wire       - (optional) Empty property indicating device requires
                3-wire mode.

If a gpio chipselect is used for the SPI slave the gpio number will be passed
via the cs_gpio

SPI example for an MPC5200 SPI bus:
    spi@f00 {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
        reg = <0xf00 0x20>;
        interrupts = <2 13 0 2 14 0>;
        interrupt-parent = <&mpc5200_pic>;

ethernet-switch@0 {
            compatible = "micrel,ks8995m";
            spi-max-frequency = <1000000>;
            reg = <0>;
        };

codec@1 {
            compatible = "ti,tlv320aic26";
            spi-max-frequency = <100000>;
            reg = <1>;
        };
    };

devicetree -- SPI的更多相关文章

  1. 浅析Linux DeviceTree

    文本将介绍Linux DeviceTree的相关知识,包括DeviceTree源文件.结构.语法.编写规则等. DeviceTree基础 DeviceTree(以下简称DT)用于描述设备信息以及设备于 ...

  2. linux驱动基础系列--linux spi驱动框架分析(续)

    前言 这篇文章是对linux驱动基础系列--linux spi驱动框架分析的补充,主要是添加了最新的linux内核里设备树相关内容. spi设备树相关信息 如之前的文章里所述,控制器的device和s ...

  3. GIC , SPI , PPI (窝窝科技的文章题目改了下)【转】

    转自:https://www.cnblogs.com/tureno/articles/6403408.html 转载于:  http://www.wowotech.net/irq_subsystem/ ...

  4. SPI bus 的收发编程

    https://linux-sunxi.org/SPIdev The SPI bus (or Serial Peripheral Interface bus) is a synchronous ser ...

  5. iMX6UL配置MCP2515模块(SPI转CAN)——基于迅为iTOP-iMX6UL开发板

    写在前面   在文章"嵌入式Linux的CAN总线配置--基于迅为iTOP-4412开发板"中我给4412开发板配置了SPI转CAN模块,使用的是不带设备树的内核.在本篇文章中,要 ...

  6. SPI基础知识

    Serial Peripheral Interface 是摩托罗拉公司提出的一种总线协议,主要应用在EEPROM,FLASH,实时时钟,A/D转换,以及数字信号处理和数字信号解码器中 是一种高速,全双 ...

  7. spi子系统之驱动SSD1306 OLED

    spi子系统之驱动SSD1306 OLED 接触Linux之前,曾以为读源码可以更快的学习软件,于是前几个博客都是一边读源码一边添加注释,甚至精读到每一行代码,实际上效果并不理想,看过之后就忘记了.主 ...

  8. java中的SPI机制

    1 SPI机制简介 SPI的全名为Service Provider Interface.大多数开发人员可能不熟悉,因为这个是针对厂商或者插件的.在java.util.ServiceLoader的文档里 ...

  9. 基于TQ2440的SPI驱动学习(OLED)

    平台简介 开发板:TQ2440 (NandFlash:256M  内存:64M) u-boot版本:u-boot-2015.04 内核版本:Linux-3.14 作者:彭东林 邮箱:pengdongl ...

随机推荐

  1. uva539 卡坦岛 简单回溯!

    继续回溯搞起! 开始想复杂了,用了好多数组判断节点的度.边是否已经走过,结果导致超时了,后来简化成如下版本,走过的标志不需要另辟vis数组,只要将map[i][j]和map[j][i]赋值0即可. # ...

  2. Transform数据权限浅析1之mdl语句批量加载权限

    Cognos建模工具除了Framework之外,还有一个Transform,两者的最大区别就是在于Framework是通过结构直连关系数据库的,数据根据数据仓库的变化而变化,而Transform是生产 ...

  3. 算法笔记_045:币值最大化问题(Java)

    目录 1 问题描述 2 解决方案 2.1 动态规划法   1 问题描述 给定一排n个硬币,其面值均为正整数c1,c2,...,cn,这些整数并不一定两两不同.请问如何选择硬币,使得在其原始位置互不相邻 ...

  4. 算法笔记_024:字符串的包含(Java)

    目录 1 问题描述 2 解决方案 2.1 蛮力轮询法 2.2 素数相乘法 2.3 位运算法 1 问题描述 给定一长字符串A和一短字符串B.请问,如何最快地判断出短字符串B中的所有字符是否都在长字符串A ...

  5. TP框架ajax U方法不解析怎么办?

    TP框架中ajax U方法不解析 ajax U方法不解析 ajax url不解析 问题: 造成问题原因: Js 存在单独的 js文件中和html分离了.造成不解析! 解决方法: 方法一:将js放到ht ...

  6. Python 创建特殊元组tuple

    创建1个元素的tuple  (1,) 创建单元素tupletuple和list一样,可以包含 0 个.1个和任意多个元素.包含多个元素的 tuple,前面我们已经创建过了.包含 0 个元素的 tupl ...

  7. ant design pro (十三)advanced 错误处理

    一.概述 原文地址:https://pro.ant.design/docs/error-cn 二.详细 2.1.页面级报错 2.1.1.应用场景 路由直接引导到报错页面,比如你输入的网址没有匹配到任何 ...

  8. Android studio中导入第三方类库

    常常在github上看到一些好用的框架,但是对于一个新手怎样在android studio上导入去总会遇到各种麻烦,索性来研究下第三方类库怎样在android studio上导入. 以我在github ...

  9. Solr 4.0部署

    http://www.blogjava.net/xiaohuzi2008/archive/2012/12/03/392373.html

  10. 关于windows10 CMD 的一些操作

    之前接触过cmd的一些操作方法,比如用dir.tasklist等一些方法,但是用了会立马忘记,再用到时又要重新google,这着实让我头痛!!! 今天又碰到一个关于改变目录的问题,又是纠结万分,所以就 ...