We're no longer updating This wiki!!

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:xu3_expansionboard [2016/05/18 18:09]
odroid [SPI Flash Control on Expansion Board]
en:xu3_expansionboard [2017/06/07 17:46]
odroid
Line 33: Line 33:
   ​   ​
 ==== SPI Flash Control on Expansion Board ==== ==== SPI Flash Control on Expansion Board ====
- 
-To use spidev on your **ODROID-XU4/​XU3** you must edit/​compile the device-tree source first. 
- 
-=== How to fix device tree blob with command line === 
-Install device tree compiler package. 
-  sudo apt-get install device-tree-compiler 
- 
-Generate an exynos5422-odroidxu3.dts file from the stock dtb file. 
-<​code>​ 
-sudo -s 
-cd /media/boot 
-dtc -I dtb -O dts ./​exynos5422-odroidxu3.dtb > ./​exynos5422-odroidxu3.dts 
-</​code>​ 
- 
-Edit dts file to use vi editor. 
-<​code>​ 
-vi ./​exynos5422-odroidxu3.dts 
-</​code>​ 
- 
-Find string "​spi@12d3"​ & add spi control data. 
- 
-<​code>​ 
-... 
- spi@12d30000 { 
- compatible = "​samsung,​exynos5410-spi";​ 
- reg = <​0x12d30000 0x100>; 
- interrupts = <0x0 0x45 0x0>; 
- dma-mode; 
- dmas = <0x43 0x5 0x43 0x4>; 
- dma-names = "​tx",​ "​rx";​ 
- swap-mode;​ 
- #​address-cells = <​0x1>;​ 
- #​size-cells = <​0x0>;​ 
- clocks = <0x2 0x5cb 0x2 0x1027>; 
- clock-names = "​spi",​ "​spi_busclk0";​ 
- pinctrl-names = "​default";​ 
- pinctrl-0 = <​0x44>;​ 
- status = "​okay";​ 
- cs-gpios = <0x45 0x5 0x0>; 
-  
-                /* ADD Line Start(spi control data) */ 
- samsung,​spi-src-slk = <0>; 
- num-cs = <0>; 
- 
- spidev { 
- compatible = "​spidev";​ 
- reg = <0>; 
- spi-max-frequency = <​20000000>;​ 
-  
- controller-data { 
- cs-gpio = <0x45 0x5 0x0>; 
- samsung,​spi-feedback-delay = <0>; 
- }; 
- }; 
-                /* ADD Line Ebd */ 
- }; 
-... 
-</​code>​ 
- 
-<WRAP center round important 100%> 
-The value of **cs-gpio** must be identical to **cs-gpios** in controller-data section. 
-</​WRAP>​ 
- 
-Compile dts file & update 
-<​code>​ 
-dtc -O dtb -o ./​exynos5422-odroidxu3.dtb ./​exynos5422-odroidxu3.dts 
-</​code>​ 
- 
-Reboot. 
-  reboot 
-Check your SPI node. 
-  ls /​dev/​spidev* 
- 
-After update, you need a hard-boot. Reboot doesn'​t access the updated dtb file from time to time. 
  
 === Compile & run SPI test example source code === === Compile & run SPI test example source code ===
Line 516: Line 442:
  
 </​file>​ </​file>​
 +
 +
 +If you use an old kernel, you must edit/​compile the device-tree source first to enable spidev on your **ODROID-XU4/​XU3** ​
 +
 +=== How to fix device tree blob with command line ===
 +Install device tree compiler package.
 +  sudo apt-get install device-tree-compiler
 +
 +Generate an exynos5422-odroidxu3.dts file from the stock dtb file.
 +<​code>​
 +sudo -s
 +cd /media/boot
 +dtc -I dtb -O dts ./​exynos5422-odroidxu3.dtb > ./​exynos5422-odroidxu3.dts
 +</​code>​
 +
 +Edit dts file to use vi editor.
 +<​code>​
 +vi ./​exynos5422-odroidxu3.dts
 +</​code>​
 +
 +Find string "​spi@12d3"​ & add spi control data.
 +
 +<​code>​
 +...
 + spi@12d30000 {
 + compatible = "​samsung,​exynos5410-spi";​
 + reg = <​0x12d30000 0x100>;
 + interrupts = <0x0 0x45 0x0>;
 + dma-mode;
 + dmas = <0x43 0x5 0x43 0x4>;
 + dma-names = "​tx",​ "​rx";​
 + swap-mode;​
 + #​address-cells = <​0x1>;​
 + #​size-cells = <​0x0>;​
 + clocks = <0x2 0x5cb 0x2 0x1027>;
 + clock-names = "​spi",​ "​spi_busclk0";​
 + pinctrl-names = "​default";​
 + pinctrl-0 = <​0x44>;​
 + status = "​okay";​
 + cs-gpios = <0x45 0x5 0x0>;
 +
 +                /* ADD Line Start(spi control data) */
 + samsung,​spi-src-slk = <0>;
 + num-cs = <0>;
 +
 + spidev {
 + compatible = "​spidev";​
 + reg = <0>;
 + spi-max-frequency = <​20000000>;​
 +
 + controller-data {
 + cs-gpio = <0x45 0x5 0x0>;
 + samsung,​spi-feedback-delay = <0>;
 + };
 + };
 +                /* ADD Line Ebd */
 + };
 +...
 +</​code>​
 +
 +<WRAP center round important 100%>
 +The value of **cs-gpio** must be identical to **cs-gpios** in controller-data section.
 +</​WRAP>​
 +
 +Compile dts file & update
 +<​code>​
 +dtc -O dtb -o ./​exynos5422-odroidxu3.dtb ./​exynos5422-odroidxu3.dts
 +</​code>​
 +
 +Reboot.
 +  reboot
 +Check your SPI node.
 +  ls /​dev/​spidev*
 +
 +After update, you might need a hard-boot. Reboot doesn'​t access the updated dtb file from time to time.
 +
 +
en/xu3_expansionboard.txt ยท Last modified: 2017/06/07 17:46 by odroid
CC Attribution-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0