devicetree -- SPI
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的更多相关文章
- 浅析Linux DeviceTree
文本将介绍Linux DeviceTree的相关知识,包括DeviceTree源文件.结构.语法.编写规则等. DeviceTree基础 DeviceTree(以下简称DT)用于描述设备信息以及设备于 ...
- linux驱动基础系列--linux spi驱动框架分析(续)
前言 这篇文章是对linux驱动基础系列--linux spi驱动框架分析的补充,主要是添加了最新的linux内核里设备树相关内容. spi设备树相关信息 如之前的文章里所述,控制器的device和s ...
- GIC , SPI , PPI (窝窝科技的文章题目改了下)【转】
转自:https://www.cnblogs.com/tureno/articles/6403408.html 转载于: http://www.wowotech.net/irq_subsystem/ ...
- SPI bus 的收发编程
https://linux-sunxi.org/SPIdev The SPI bus (or Serial Peripheral Interface bus) is a synchronous ser ...
- iMX6UL配置MCP2515模块(SPI转CAN)——基于迅为iTOP-iMX6UL开发板
写在前面 在文章"嵌入式Linux的CAN总线配置--基于迅为iTOP-4412开发板"中我给4412开发板配置了SPI转CAN模块,使用的是不带设备树的内核.在本篇文章中,要 ...
- SPI基础知识
Serial Peripheral Interface 是摩托罗拉公司提出的一种总线协议,主要应用在EEPROM,FLASH,实时时钟,A/D转换,以及数字信号处理和数字信号解码器中 是一种高速,全双 ...
- spi子系统之驱动SSD1306 OLED
spi子系统之驱动SSD1306 OLED 接触Linux之前,曾以为读源码可以更快的学习软件,于是前几个博客都是一边读源码一边添加注释,甚至精读到每一行代码,实际上效果并不理想,看过之后就忘记了.主 ...
- java中的SPI机制
1 SPI机制简介 SPI的全名为Service Provider Interface.大多数开发人员可能不熟悉,因为这个是针对厂商或者插件的.在java.util.ServiceLoader的文档里 ...
- 基于TQ2440的SPI驱动学习(OLED)
平台简介 开发板:TQ2440 (NandFlash:256M 内存:64M) u-boot版本:u-boot-2015.04 内核版本:Linux-3.14 作者:彭东林 邮箱:pengdongl ...
随机推荐
- Mycat(4):消息表mysql数据库分表实践
本文的原文连接是: http://blog.csdn.net/freewebsys/article/details/46882777 未经博主同意不得转载. 1,业务需求 比方一个社交软件,比方像腾讯 ...
- C++ 11 - STL - 函数对象(Function Object) (下)
1. 预定义函数对象 C++标准库内含许多预定义的函数对象,也就是内置的函数对象. 你可以充分利用他们,不必自己费心去写一些自己的函数对象. 要使用他们,你只要包含如下头文件 #include < ...
- Visual studio中后期生成事件命令使用
在做项目是总要把发布后的一些dll拷贝的根网站的bin目录下,为了避免每次都需要手动拷贝可以在 项目的生成事件中写入bat命令,下面的命令只在项目使用的发布配置时执行拷贝, (在生成->配置管理 ...
- 链表的游标(cursor)实现
诸如BASIC和FORTRAN等许多语言都不支持指针.如果需要链表而又不能使用指针,这时我们可以使用游标(cursor)实现法来实现链表. 在链表的实现中有两个重要的特点: 数据存储在一组结构体中.每 ...
- AsyncTask doinbackground onProgressUpdate onCancelled onPostExecute的基本使用
对于异步操作的原理我就不讲了.在这我着重讲怎么使用异步操作的doinbackground onProgressUpdate onCancelled onPostExecute这四个方法 doinbac ...
- LoadRunner利用ODBC编写MySql脚本(转)
LoadRunner测试数据库是模拟客户端去连接数据库服务器,因此,需要协议(或者说驱动的支持).LoadRunner本身直接支持Oracle.SqlServer数据库,这两个数据库直接选择相应的协议 ...
- OFBiz:解析doRequest()
这里的doRequest()是指RequestHandler中的同名函数: public void doRequest(HttpServletRequest request, HttpServletR ...
- 【laravel54】win系下本地域名配置(解决403错误)
1.apache虚拟目录地址应该指向\laravel54\public 目录下:(TP5类似) <VirtualHost *:> DocumentRoot "D:\phpStud ...
- Linux命令-目录处理命令:cp
cp /etc/grub.conf /tmp 复制一个文件 cp -r /tmp/beijing/dongchengqu /root 复制dongchengqu目录到root目录 cp /root/i ...
- ASP.NET给DataGrid,Repeater等添加全选批量删除等功能
很多情况下,在管理或者查看列表的时候我们需要很需要“全选”这个功能,这在ASP.NET中是非常容易实现的,下面我就将演示一点小代码实现这一功能. 实现全选的还是js的一个小函数: [code] ...