From 8f183bbb9bc01dd5eb65f3725d340f2269414a9a Mon Sep 17 00:00:00 2001 From: Aditya Prayoga Date: Tue, 10 Mar 2020 16:18:51 +0700 Subject: [PATCH] Added Helios64 SPI page --- docs/helios64/img/spi/spi_on_uext.png | Bin 0 -> 7236 bytes docs/helios64/spi.md | 83 ++++++++++++++++++++++++++ mkdocs.yml | 1 + 3 files changed, 84 insertions(+) create mode 100755 docs/helios64/img/spi/spi_on_uext.png create mode 100644 docs/helios64/spi.md diff --git a/docs/helios64/img/spi/spi_on_uext.png b/docs/helios64/img/spi/spi_on_uext.png new file mode 100755 index 0000000000000000000000000000000000000000..369a3dca61e13d589c6ca3144ec078e192d31aae GIT binary patch literal 7236 zcmZ8m1yCH@wj~J=WN;W@NPvL=!QGu;!QCAu5Zo{t1cVnrxLk~a43|_M&n)0KsP@v@ zP6!B?J%6tkiS(Ex2nZzCAH_x0+!v2BQS}mL?)!b~epb_$k>hSB75~`Cl7MKouP1G* zXzP4jk+J){KXQ;(*lbql!oF{qwmnj>M_$LKD_5_k_LJZ;tQh+p9XZQ`?) z_rqx0tFfC4;%~fJ9xE4F9-|jR=3k;FEjYyJ-p9wqMTCZiPQH&w>8c{ri#mIFFn*{v zsAL}AE;uonI}v_4<@#G8JUpCTzk$;Xs`uvpN^^%``_6{feTCxabiKP_PR`M>cE}lW zy7r6Hs_^qvAt#$bvm=s+hsW-0g>J(orBqbPYDIzYGwh<;8ow~u#HUG4QChnCkzL)O z=Uj~2c3H&L)iv^Ra#AIO*Qrp_^I)5hmD;%J?j-1hT7zEAmd`Rjyplba^GGrhq%D7Q zaZ#6+<+9Es?$To@Jd$}?T>M_u(>C%F6l8plgM*`d#2!$f{@A(rw9@Qkj^SN=&s~&O z2McOChr z#k6weg*1k#a_=HbtJ(sRhFQ6-3sDu}_|8sY85tSG)~^(1?=O9ii<5w`U2~M^&*6A> z&UJ<39{El5SxyTAEUgU^o8-|jvmInMT3|LT`k>L_W-P+VVY&WF(~WtW^u;;QwSRfR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&9f&P1F0QA73F0W`RYwxV7CV22>StFm*+|X9e+wdflu!__6f^SwALFs} A)c^nh literal 0 HcmV?d00001 diff --git a/docs/helios64/spi.md b/docs/helios64/spi.md new file mode 100644 index 0000000..5953a35 --- /dev/null +++ b/docs/helios64/spi.md @@ -0,0 +1,83 @@ +!!! notice + ***Preliminary Info*** + +RK3399 has SPI controller with following features: + +- 6 on-chip SPI controllers + +- Support master and slave mode, software-configurable + +- DMA-based or interrupt-based operation + +- Embedded two 32x16bits FIFO for TX and RX operation respectively + +On Helios64 the bus are divided into three types: unused, system (internal bus) and user application (external) + +| Bus | Usage | Remarks | +|-----|-------|-----------| +| 0 | Not Used | | +| 1 | System | Bootable SPI Flash | +| 2 | External | User Application | +| 3 | Not Used | | +| 4 | Not Used | | +| 5 | System | Reserved for Production use only | + + +## Internal Bus + +| Bus | Chip Select | Device | Remarks | +|-----|-------------|---------|---------| +| 1 | 0 | W25Q128JV | Bootable SPI Flash | +| 5 | 0 | W25X20CL | SATA Controller ROM | + + +### Bootable SPI Flash + +Helios64 is equipped with [Winbond W25Q128JV 3V 128M-Bit Serial Flash Memory](https://www.winbond.com/hq/product/code-storage-flash-memory/serial-nor-flash/?__locale=en&partNo=W25Q128JV) +as a Bootable SPI NOR Flash. + +This flash contains + +- preloader & bootloader + +| Binaries | Offset | Remarks | +|----------|--------|---------| +| Preloader | 0x0040 | U-Boot TPL & SPL | +| Bootloader | 0x4000 | U-Boot & ATF | + +- electronic nameplate data in Security Register + + +## External Bus + +| Bus | Chip Select | Remarks | +|-----|-------------|---------| +| 2 | 0 | User Application | + +SPI Bus for user application is exposed on [UEXT Connector (P2)](/helios64/uext) + +![!UEXT](/helios64/img/spi/spi_on_uext.png) + +| Pin | Signal Name | +|-----|-------------| +| 7 | MISO | +| 8 | MOSI | +| 9 | SCK | +| 10 | SSEL | + +The pin voltage level is 3.3V + + +## Usage in Linux + +### Enable SPIDEV in device tree + +To make SPI device accessible by user space application, we need to create a device tree node. +After the node has been created, user application can access the device at + +`/dev/spidev5.0` + +!!! note + *To Be Updated* + + diff --git a/mkdocs.yml b/mkdocs.yml index 7f43e10..bf89e0a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -80,6 +80,7 @@ nav: - I2C : 'helios64/i2c.md' - LED : 'helios64/led.md' - USB : 'helios64/usb.md' + - SPI : 'helios64/spi.md' - Helios4: - Introduction: 'helios4/intro.md' - Kit Assembly: 'helios4/kit.md'