xref: /openbmc/u-boot/doc/README.rockchip (revision e5fd39c886485e3dec77f4438a6e364c2987cf5f)
183d290c5STom Rini# SPDX-License-Identifier: GPL-2.0+
2adfb2bfeSSimon Glass#
3adfb2bfeSSimon Glass# Copyright (C) 2015 Google. Inc
4adfb2bfeSSimon Glass# Written by Simon Glass <sjg@chromium.org>
5adfb2bfeSSimon Glass
6adfb2bfeSSimon GlassU-Boot on Rockchip
7adfb2bfeSSimon Glass==================
8adfb2bfeSSimon Glass
90c14c366SSimon GlassA wide range of Rockchip SoCs are supported in mainline U-Boot
10adfb2bfeSSimon Glass
11adfb2bfeSSimon Glass
12adfb2bfeSSimon GlassPrerequisites
13adfb2bfeSSimon Glass=============
14adfb2bfeSSimon Glass
15adfb2bfeSSimon GlassYou will need:
16adfb2bfeSSimon Glass
17f1387130SSimon Glass   - Firefly RK3288 board or something else with a supported RockChip SoC
18adfb2bfeSSimon Glass   - Power connection to 5V using the supplied micro-USB power cable
19adfb2bfeSSimon Glass   - Separate USB serial cable attached to your computer and the Firefly
20adfb2bfeSSimon Glass        (connect to the micro-USB connector below the logo)
21adfb2bfeSSimon Glass   - rkflashtool [3]
22adfb2bfeSSimon Glass   - openssl (sudo apt-get install openssl)
23adfb2bfeSSimon Glass   - Serial UART connection [4]
24adfb2bfeSSimon Glass   - Suitable ARM cross compiler, e.g.:
25adfb2bfeSSimon Glass        sudo apt-get install gcc-4.7-arm-linux-gnueabi
26adfb2bfeSSimon Glass
27adfb2bfeSSimon Glass
28adfb2bfeSSimon GlassBuilding
29adfb2bfeSSimon Glass========
30adfb2bfeSSimon Glass
3116217f96SSimon GlassAt present 12 RK3288 boards are supported:
32adfb2bfeSSimon Glass
33744368d6SXu Ziyuan   - EVB RK3288 - use evb-rk3288 configuration
34d7ca67b7Sjk.kernel@gmail.com   - Fennec RK3288 - use fennec-rk3288 configuration
351c62d999SXu Ziyuan   - Firefly RK3288 - use firefly-rk3288 configuration
361c62d999SXu Ziyuan   - Hisense Chromebook - use chromebook_jerry configuration
3716217f96SSimon Glass   - Asus C100P Chromebook - use chromebook_minnie configuration
3816217f96SSimon Glass   - Asus Chromebit - use chromebook_mickey configuration
397da8680bSJernej Skrabec   - MiQi RK3288 - use miqi-rk3288 configuration
40a84b589eSWadim Egorov   - phyCORE-RK3288 RDK - use phycore-rk3288 configuration
41dd63fbc7Sjk.kernel@gmail.com   - PopMetal RK3288 - use popmetal-rk3288 configuration
421c62d999SXu Ziyuan   - Radxa Rock 2 - use rock2 configuration
4343b5c78dSJernej Skrabec   - Tinker RK3288 - use tinker-rk3288 configuration
4416217f96SSimon Glass   - Vyasa RK3288 - use vyasa-rk3288 configuration
45adfb2bfeSSimon Glass
4616217f96SSimon GlassTwo RK3036 boards are supported:
471d5a6968Shuang lin
48f1387130SSimon Glass   - EVB RK3036 - use evb-rk3036 configuration
49f1387130SSimon Glass   - Kylin - use kylin_rk3036 configuration
501d5a6968Shuang lin
5116217f96SSimon GlassOne RK3328 board is supported:
5216217f96SSimon Glass
5316217f96SSimon Glass   - EVB RK3328
5416217f96SSimon Glass
55*9e92116bSSimon GlassSize RK3399 boards are supported (aarch64):
5616217f96SSimon Glass
5716217f96SSimon Glass   - EBV RK3399 - use evb_rk3399 configuration
5816217f96SSimon Glass   - Firefly RK3399 - use the firefly_rk3399 configuration
5916217f96SSimon Glass   - Puma - use puma_rk3399 configuration
6016217f96SSimon Glass   - Ficus - use ficus-rk3399 configuration
6116217f96SSimon Glass   - Rock960 (Vamrs) - use rock960-rk3399 configuration
62*9e92116bSSimon Glass   - Bob - use chromebook_bob configuration
6316217f96SSimon Glass
6416217f96SSimon GlassFour RK3368 boards are supported:
6516217f96SSimon Glass
6616217f96SSimon Glass   - Sheep - use sheep-rk3368 configuration
6716217f96SSimon Glass   - Lion - use lion-rk3368 configuration
6816217f96SSimon Glass   - Geekbox - use geekbox configuration
6916217f96SSimon Glass   - EVB PX5 - use evb-px5  configuration
7016217f96SSimon Glass
7116217f96SSimon GlassOne RK3128 board is supported:
7216217f96SSimon Glass
7316217f96SSimon Glass   - EVB RK3128 - use evb-rk3128 configuration
7416217f96SSimon Glass
7516217f96SSimon GlassOne RK3229 board is supported:
7616217f96SSimon Glass
7716217f96SSimon Glass   - EVB RK3229 - use evb-rk3229 configuration
7816217f96SSimon Glass
7916217f96SSimon GlassTwo RV1108 boards are supported:
8016217f96SSimon Glass
8116217f96SSimon Glass   - EVB RV1108 - use evb-rv1108 configuration
8216217f96SSimon Glass   - Elgin R1 - use elgin-rv1108 configuration
8316217f96SSimon Glass
8416217f96SSimon GlassOne RV3188 baord is supported:
8516217f96SSimon Glass
8616217f96SSimon Glass   - Raxda Rock - use rock configuration
8716217f96SSimon Glass
8816217f96SSimon Glass
89adfb2bfeSSimon GlassFor example:
90adfb2bfeSSimon Glass
91adfb2bfeSSimon Glass   CROSS_COMPILE=arm-linux-gnueabi- make O=firefly firefly-rk3288_defconfig all
92adfb2bfeSSimon Glass
93adfb2bfeSSimon Glass(or you can use another cross compiler if you prefer)
94adfb2bfeSSimon Glass
95adfb2bfeSSimon Glass
96adfb2bfeSSimon GlassWriting to the board with USB
97adfb2bfeSSimon Glass=============================
98adfb2bfeSSimon Glass
99adfb2bfeSSimon GlassFor USB to work you must get your board into ROM boot mode, either by erasing
100adfb2bfeSSimon Glassyour MMC or (perhaps) holding the recovery button when you boot the board.
101adfb2bfeSSimon GlassTo erase your MMC, you can boot into Linux and type (as root)
102adfb2bfeSSimon Glass
103adfb2bfeSSimon Glass   dd if=/dev/zero of=/dev/mmcblk0 bs=1M
104adfb2bfeSSimon Glass
105adfb2bfeSSimon GlassConnect your board's OTG port to your computer.
106adfb2bfeSSimon Glass
107adfb2bfeSSimon GlassTo create a suitable image and write it to the board:
108adfb2bfeSSimon Glass
109717f8845SJeffy Chen   ./firefly-rk3288/tools/mkimage -n rk3288 -T rkimage -d \
110f2acc55eSSimon Glass	./firefly-rk3288/spl/u-boot-spl-dtb.bin out && \
111adfb2bfeSSimon Glass   cat out | openssl rc4 -K 7c4e0304550509072d2c7b38170d1711 | rkflashtool l
112adfb2bfeSSimon Glass
113adfb2bfeSSimon GlassIf all goes well you should something like:
114adfb2bfeSSimon Glass
115adfb2bfeSSimon Glass   U-Boot SPL 2015.07-rc1-00383-ge345740-dirty (Jun 03 2015 - 10:06:49)
116adfb2bfeSSimon Glass   Card did not respond to voltage select!
117adfb2bfeSSimon Glass   spl: mmc init failed with error: -17
118adfb2bfeSSimon Glass   ### ERROR ### Please RESET the board ###
119adfb2bfeSSimon Glass
120adfb2bfeSSimon GlassYou will need to reset the board before each time you try. Yes, that's all
121adfb2bfeSSimon Glassit does so far. If support for the Rockchip USB protocol or DFU were added
122adfb2bfeSSimon Glassin SPL then we could in principle load U-Boot and boot to a prompt from USB
123adfb2bfeSSimon Glassas several other platforms do. However it does not seem to be possible to
124adfb2bfeSSimon Glassuse the existing boot ROM code from SPL.
125adfb2bfeSSimon Glass
126adfb2bfeSSimon Glass
127adfb2bfeSSimon GlassBooting from an SD card
128adfb2bfeSSimon Glass=======================
129adfb2bfeSSimon Glass
130adfb2bfeSSimon GlassTo write an image that boots from an SD card (assumed to be /dev/sdc):
131adfb2bfeSSimon Glass
132717f8845SJeffy Chen   ./firefly-rk3288/tools/mkimage -n rk3288 -T rksd -d \
133f2acc55eSSimon Glass	firefly-rk3288/spl/u-boot-spl-dtb.bin out && \
134f2acc55eSSimon Glass   sudo dd if=out of=/dev/sdc seek=64 && \
13573e6dbe8SKever Yang   sudo dd if=firefly-rk3288/u-boot-dtb.img of=/dev/sdc seek=16384
136adfb2bfeSSimon Glass
137adfb2bfeSSimon GlassThis puts the Rockchip header and SPL image first and then places the U-Boot
138341e44edSGoldschmidt Simonimage at block 16384 (i.e. 8MB from the start of the SD card). This
139adfb2bfeSSimon Glasscorresponds with this setting in U-Boot:
140adfb2bfeSSimon Glass
14173e6dbe8SKever Yang   #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR	0x4000
142adfb2bfeSSimon Glass
143adfb2bfeSSimon GlassPut this SD (or micro-SD) card into your board and reset it. You should see
144adfb2bfeSSimon Glasssomething like:
145adfb2bfeSSimon Glass
146f1387130SSimon Glass   U-Boot 2016.01-rc2-00309-ge5bad3b-dirty (Jan 02 2016 - 23:41:59 -0700)
147adfb2bfeSSimon Glass
148f1387130SSimon Glass   Model: Radxa Rock 2 Square
149adfb2bfeSSimon Glass   DRAM:  2 GiB
150f1387130SSimon Glass   MMC:   dwmmc@ff0f0000: 0, dwmmc@ff0c0000: 1
151f1387130SSimon Glass   *** Warning - bad CRC, using default environment
152adfb2bfeSSimon Glass
153f1387130SSimon Glass   In:    serial
154f1387130SSimon Glass   Out:   vop@ff940000.vidconsole
155f1387130SSimon Glass   Err:   serial
156f1387130SSimon Glass   Net:   Net Initialization Skipped
157f1387130SSimon Glass   No ethernet found.
158f1387130SSimon Glass   Hit any key to stop autoboot:  0
159adfb2bfeSSimon Glass   =>
160adfb2bfeSSimon Glass
161b47ea792SXu ZiyuanThe rockchip bootrom can load and boot an initial spl, then continue to
162760b9578SHeinrich Schuchardtload a second-stage bootloader (ie. U-Boot) as soon as the control is returned
163760b9578SHeinrich Schuchardtto the bootrom. Both the RK3288 and the RK3036 use this special boot sequence.
164760b9578SHeinrich SchuchardtThe configuration option enabling this is:
165b47ea792SXu Ziyuan
166760b9578SHeinrich Schuchardt	CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
167b47ea792SXu Ziyuan
168b47ea792SXu ZiyuanYou can create the image via the following operations:
169b47ea792SXu Ziyuan
170b47ea792SXu Ziyuan   ./firefly-rk3288/tools/mkimage -n rk3288 -T rksd -d \
171b47ea792SXu Ziyuan	firefly-rk3288/spl/u-boot-spl-dtb.bin out && \
172b47ea792SXu Ziyuan   cat firefly-rk3288/u-boot-dtb.bin >> out && \
173b47ea792SXu Ziyuan   sudo dd if=out of=/dev/sdc seek=64
174b47ea792SXu Ziyuan
175f1387130SSimon GlassIf you have an HDMI cable attached you should see a video console.
176f1387130SSimon Glass
1771d5a6968Shuang linFor evb_rk3036 board:
178717f8845SJeffy Chen	./evb-rk3036/tools/mkimage -n rk3036 -T rksd  -d evb-rk3036/spl/u-boot-spl.bin out && \
1791d5a6968Shuang lin	cat evb-rk3036/u-boot-dtb.bin >> out && \
1801d5a6968Shuang lin	sudo dd if=out of=/dev/sdc seek=64
1811d5a6968Shuang lin
1821d5a6968Shuang linNote: rk3036 SDMMC and debug uart use the same iomux, so if you boot from SD, the
1831d5a6968Shuang lin      debug uart must be disabled
184adfb2bfeSSimon Glass
185f46b859bSHeiko Stübner
186532cb7f5SJagan TekiBooting from an SD card on RK3288 with TPL
187532cb7f5SJagan Teki==========================================
188532cb7f5SJagan Teki
189532cb7f5SJagan TekiSince the size of SPL can't be exceeded 0x8000 bytes in RK3288, it is not possible add
190532cb7f5SJagan Tekinew SPL features like Falcon mode or etc.
191532cb7f5SJagan Teki
192532cb7f5SJagan TekiSo introduce TPL so-that adding new features to SPL is possible because now TPL should
193532cb7f5SJagan Tekirun minimal with code like DDR, clock etc and rest of new features in SPL.
194532cb7f5SJagan Teki
195532cb7f5SJagan TekiAs of now TPL is added on Vyasa-RK3288 board.
196532cb7f5SJagan Teki
197532cb7f5SJagan TekiTo write an image that boots from an SD card (assumed to be /dev/mmcblk0):
198532cb7f5SJagan Teki
199532cb7f5SJagan Teki   ./tools/mkimage -n rk3288 -T rksd -d ./tpl/u-boot-tpl.bin out &&
200532cb7f5SJagan Teki    cat ./spl/u-boot-spl-dtb.bin >> out &&
201532cb7f5SJagan Teki    sudo dd if=out of=/dev/mmcblk0 seek=64 &&
202d80599e8SJagan Teki    sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 seek=16384
203532cb7f5SJagan Teki
204f46b859bSHeiko StübnerBooting from an SD card on RK3188
205f46b859bSHeiko Stübner=================================
206f46b859bSHeiko Stübner
207f46b859bSHeiko StübnerFor rk3188 boards the general storage onto the card stays the same as
208f46b859bSHeiko Stübnerdescribed above, but the image creation needs a bit more care.
209f46b859bSHeiko Stübner
210f46b859bSHeiko StübnerThe bootrom of rk3188 expects to find a small 1kb loader which returns
211f46b859bSHeiko Stübnercontrol to the bootrom, after which it will load the real loader, which
2124d9253fbSPhilipp Tomsichcan then be up to 29kb in size and does the regular ddr init.  This is
2134d9253fbSPhilipp Tomsichhandled by a single image (built as the SPL stage) that tests whether
2144d9253fbSPhilipp Tomsichit is handled for the first or second time via code executed from the
2154d9253fbSPhilipp Tomsichboot0-hook.
216f46b859bSHeiko Stübner
217f46b859bSHeiko StübnerAdditionally the rk3188 requires everything the bootrom loads to be
218f46b859bSHeiko Stübnerrc4-encrypted. Except for the very first stage the bootrom always reads
219f46b859bSHeiko Stübnerand decodes 2kb pages, so files should be sized accordingly.
220f46b859bSHeiko Stübner
221f46b859bSHeiko Stübner# copy tpl, pad to 1020 bytes and append spl
2224d9253fbSPhilipp Tomsichtools/mkimage -n rk3188 -T rksd -d spl/u-boot-spl.bin out
223f46b859bSHeiko Stübner
224f46b859bSHeiko Stübner# truncate, encode and append u-boot.bin
225f46b859bSHeiko Stübnertruncate -s %2048 u-boot.bin
226f46b859bSHeiko Stübnercat u-boot.bin | split -b 512 --filter='openssl rc4 -K 7C4E0304550509072D2C7B38170D1711' >> out
227f46b859bSHeiko Stübner
228f46b859bSHeiko Stübner
229a16e2e06SXu ZiyuanUsing fastboot on rk3288
230a16e2e06SXu Ziyuan========================
231a16e2e06SXu Ziyuan- Write GPT partition layout to mmc device which fastboot want to use it to
232a16e2e06SXu Ziyuanstore the image
233a16e2e06SXu Ziyuan
234a16e2e06SXu Ziyuan        => gpt write mmc 1 $partitions
235a16e2e06SXu Ziyuan
236a16e2e06SXu Ziyuan- Invoke fastboot command to prepare
237a16e2e06SXu Ziyuan
238a16e2e06SXu Ziyuan        => fastboot 1
239a16e2e06SXu Ziyuan
240a16e2e06SXu Ziyuan- Start fastboot request on PC
241a16e2e06SXu Ziyuan
242a16e2e06SXu Ziyuan        fastboot -i 0x2207 flash loader evb-rk3288/spl/u-boot-spl-dtb.bin
243a16e2e06SXu Ziyuan
244a16e2e06SXu ZiyuanYou should see something like:
245a16e2e06SXu Ziyuan
246a16e2e06SXu Ziyuan        => fastboot 1
247a16e2e06SXu Ziyuan        WARNING: unknown variable: partition-type:loader
248a16e2e06SXu Ziyuan        Starting download of 357796 bytes
249a16e2e06SXu Ziyuan        ..
250a16e2e06SXu Ziyuan        downloading of 357796 bytes finished
251a16e2e06SXu Ziyuan        Flashing Raw Image
252a16e2e06SXu Ziyuan        ........ wrote 357888 bytes to 'loader'
253a16e2e06SXu Ziyuan
254adfb2bfeSSimon GlassBooting from SPI
255adfb2bfeSSimon Glass================
256adfb2bfeSSimon Glass
257*9e92116bSSimon GlassTo write an image that boots from SPI flash (e.g. for the Haier Chromebook or
258*9e92116bSSimon GlassBob):
259adfb2bfeSSimon Glass
260dd8e4290SSimon Glass   ./chromebook_jerry/tools/mkimage -n rk3288 -T rkspi \
261dd8e4290SSimon Glass	-d chromebook_jerry/spl/u-boot-spl-dtb.bin spl.bin && \
262dd8e4290SSimon Glass   dd if=spl.bin of=spl-out.bin bs=128K conv=sync && \
263dd8e4290SSimon Glass   cat spl-out.bin chromebook_jerry/u-boot-dtb.img >out.bin && \
264adfb2bfeSSimon Glass   dd if=out.bin of=out.bin.pad bs=4M conv=sync
265adfb2bfeSSimon Glass
266adfb2bfeSSimon GlassThis converts the SPL image to the required SPI format by adding the Rockchip
2676cecc2b5SSimon Glassheader and skipping every second 2KB block. Then the U-Boot image is written at
268adfb2bfeSSimon Glassoffset 128KB and the whole image is padded to 4MB which is the SPI flash size.
269adfb2bfeSSimon GlassThe position of U-Boot is controlled with this setting in U-Boot:
270adfb2bfeSSimon Glass
271adfb2bfeSSimon Glass   #define CONFIG_SYS_SPI_U_BOOT_OFFS	(128 << 10)
272adfb2bfeSSimon Glass
273adfb2bfeSSimon GlassIf you have a Dediprog em100pro connected then you can write the image with:
274adfb2bfeSSimon Glass
275adfb2bfeSSimon Glass      sudo em100 -s -c GD25LQ32 -d out.bin.pad -r
276adfb2bfeSSimon Glass
277adfb2bfeSSimon GlassWhen booting you should see something like:
278adfb2bfeSSimon Glass
279adfb2bfeSSimon Glass   U-Boot SPL 2015.07-rc2-00215-g9a58220-dirty (Jun 23 2015 - 12:11:32)
280adfb2bfeSSimon Glass
281adfb2bfeSSimon Glass
282adfb2bfeSSimon Glass   U-Boot 2015.07-rc2-00215-g9a58220-dirty (Jun 23 2015 - 12:11:32 -0600)
283adfb2bfeSSimon Glass
284adfb2bfeSSimon Glass   Model: Google Jerry
285adfb2bfeSSimon Glass   DRAM:  2 GiB
286adfb2bfeSSimon Glass   MMC:
287adfb2bfeSSimon Glass   Using default environment
288adfb2bfeSSimon Glass
289adfb2bfeSSimon Glass   In:    serial@ff690000
290adfb2bfeSSimon Glass   Out:   serial@ff690000
291adfb2bfeSSimon Glass   Err:   serial@ff690000
292adfb2bfeSSimon Glass   =>
293adfb2bfeSSimon Glass
294adfb2bfeSSimon GlassFuture work
295adfb2bfeSSimon Glass===========
296adfb2bfeSSimon Glass
297adfb2bfeSSimon GlassImmediate priorities are:
298adfb2bfeSSimon Glass
299adfb2bfeSSimon Glass- USB host
300adfb2bfeSSimon Glass- USB device
301f1387130SSimon Glass- Run CPU at full speed (code exists but we only see ~60 DMIPS maximum)
302adfb2bfeSSimon Glass- NAND flash
303adfb2bfeSSimon Glass- Boot U-Boot proper over USB OTG (at present only SPL works)
304adfb2bfeSSimon Glass
305adfb2bfeSSimon Glass
306adfb2bfeSSimon GlassDevelopment Notes
307adfb2bfeSSimon Glass=================
308adfb2bfeSSimon Glass
309adfb2bfeSSimon GlassThere are plenty of patches in the links below to help with this work.
310adfb2bfeSSimon Glass
311adfb2bfeSSimon Glass[1] https://github.com/rkchrome/uboot.git
312adfb2bfeSSimon Glass[2] https://github.com/linux-rockchip/u-boot-rockchip.git branch u-boot-rk3288
313adfb2bfeSSimon Glass[3] https://github.com/linux-rockchip/rkflashtool.git
314adfb2bfeSSimon Glass[4] http://wiki.t-firefly.com/index.php/Firefly-RK3288/Serial_debug/en
315adfb2bfeSSimon Glass
316adfb2bfeSSimon Glassrkimage
317adfb2bfeSSimon Glass-------
318adfb2bfeSSimon Glass
319adfb2bfeSSimon Glassrkimage.c produces an SPL image suitable for sending directly to the boot ROM
320adfb2bfeSSimon Glassover USB OTG. This is a very simple format - just the string RK32 (as 4 bytes)
321adfb2bfeSSimon Glassfollowed by u-boot-spl-dtb.bin.
322adfb2bfeSSimon Glass
323adfb2bfeSSimon GlassThe boot ROM loads image to 0xff704000 which is in the internal SRAM. The SRAM
324adfb2bfeSSimon Glassstarts at 0xff700000 and extends to 0xff718000 where we put the stack.
325adfb2bfeSSimon Glass
326adfb2bfeSSimon Glassrksd
327adfb2bfeSSimon Glass----
328adfb2bfeSSimon Glass
329adfb2bfeSSimon Glassrksd.c produces an image consisting of 32KB of empty space, a header and
330adfb2bfeSSimon Glassu-boot-spl-dtb.bin. The header is defined by 'struct header0_info' although
331adfb2bfeSSimon Glassmost of the fields are unused by U-Boot. We just need to specify the
332adfb2bfeSSimon Glasssignature, a flag and the block offset and size of the SPL image.
333adfb2bfeSSimon Glass
334adfb2bfeSSimon GlassThe header occupies a single block but we pad it out to 4 blocks. The header
335adfb2bfeSSimon Glassis encoding using RC4 with the key 7c4e0304550509072d2c7b38170d1711. The SPL
336adfb2bfeSSimon Glassimage can be encoded too but we don't do that.
337adfb2bfeSSimon Glass
338adfb2bfeSSimon GlassThe maximum size of u-boot-spl-dtb.bin which the boot ROM will read is 32KB,
339adfb2bfeSSimon Glassor 0x40 blocks. This is a severe and annoying limitation. There may be a way
340adfb2bfeSSimon Glassaround this limitation, since there is plenty of SRAM, but at present the
341adfb2bfeSSimon Glassboard refuses to boot if this limit is exceeded.
342adfb2bfeSSimon Glass
343adfb2bfeSSimon GlassThe image produced is padded up to a block boundary (512 bytes). It should be
344adfb2bfeSSimon Glasswritten to the start of an SD card using dd.
345adfb2bfeSSimon Glass
346adfb2bfeSSimon GlassSince this image is set to load U-Boot from the SD card at block offset,
347adfb2bfeSSimon GlassCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, dd should be used to write
348adfb2bfeSSimon Glassu-boot-dtb.img to the SD card at that offset. See above for instructions.
349adfb2bfeSSimon Glass
350adfb2bfeSSimon Glassrkspi
351adfb2bfeSSimon Glass-----
352adfb2bfeSSimon Glass
353adfb2bfeSSimon Glassrkspi.c produces an image consisting of a header and u-boot-spl-dtb.bin. The
354adfb2bfeSSimon Glassresulting image is then spread out so that only the first 2KB of each 4KB
355adfb2bfeSSimon Glasssector is used. The header is the same as with rksd and the maximum size is
356adfb2bfeSSimon Glassalso 32KB (before spreading). The image should be written to the start of
357adfb2bfeSSimon GlassSPI flash.
358adfb2bfeSSimon Glass
359adfb2bfeSSimon GlassSee above for instructions on how to write a SPI image.
360adfb2bfeSSimon Glass
361002c634cSSimon Glassrkmux.py
362002c634cSSimon Glass--------
363002c634cSSimon Glass
364002c634cSSimon GlassYou can use this script to create #defines for SoC register access. See the
365002c634cSSimon Glassscript for usage.
366002c634cSSimon Glass
367adfb2bfeSSimon Glass
368adfb2bfeSSimon GlassDevice tree and driver model
369adfb2bfeSSimon Glass----------------------------
370adfb2bfeSSimon Glass
371adfb2bfeSSimon GlassWhere possible driver model is used to provide a structure to the
372adfb2bfeSSimon Glassfunctionality. Device tree is used for configuration. However these have an
373adfb2bfeSSimon Glassoverhead and in SPL with a 32KB size limit some shortcuts have been taken.
374adfb2bfeSSimon GlassIn general all Rockchip drivers should use these features, with SPL-specific
375adfb2bfeSSimon Glassmodifications where required.
376adfb2bfeSSimon Glass
3773f3e1e33SJacob ChenGPT partition layout
3783f3e1e33SJacob Chen----------------------------
3793f3e1e33SJacob Chen
3803f3e1e33SJacob ChenRockchip use a unified GPT partition layout  in open source support.
3813f3e1e33SJacob ChenWith this GPT partition layout, uboot can be compatilbe with other components,
3823f3e1e33SJacob Chenlike miniloader, trusted-os, arm-trust-firmware.
3833f3e1e33SJacob Chen
3843f3e1e33SJacob ChenThere are some documents about partitions in the links below.
3853f3e1e33SJacob Chenhttp://rockchip.wikidot.com/partitions
386adfb2bfeSSimon Glass
387adfb2bfeSSimon Glass--
388adfb2bfeSSimon GlassSimon Glass <sjg@chromium.org>
389adfb2bfeSSimon Glass24 June 2015
390