xref: /openbmc/u-boot/doc/README.uniphier (revision 73a555d12aaa10a7d84f1d863d52ed5735ea4fdc)
17168da16SMasahiro YamadaU-Boot for UniPhier SoC family
27168da16SMasahiro Yamada==============================
37168da16SMasahiro Yamada
47168da16SMasahiro Yamada
512a5ce72SMasahiro YamadaRecommended toolchains
612a5ce72SMasahiro Yamada----------------------
77168da16SMasahiro Yamada
8673ac334SMasahiro YamadaThe UniPhier platform is well tested with Linaro toolchains.
97168da16SMasahiro YamadaYou can download pre-built toolchains from:
107168da16SMasahiro Yamada
117168da16SMasahiro Yamada    http://www.linaro.org/downloads/
127168da16SMasahiro Yamada
137168da16SMasahiro Yamada
147168da16SMasahiro YamadaCompile the source
157168da16SMasahiro Yamada------------------
167168da16SMasahiro Yamada
17673ac334SMasahiro YamadaThe source can be configured and built with the following commands:
187168da16SMasahiro Yamada
19673ac334SMasahiro Yamada    $ make <defconfig>
20673ac334SMasahiro Yamada    $ make CROSS_COMPILE=<toolchain-prefix> DEVICE_TREE=<device-tree>
217168da16SMasahiro Yamada
22673ac334SMasahiro YamadaThe recommended <toolchain-prefix> is `arm-linux-gnueabihf-` for 32bit SoCs,
23673ac334SMasahiro Yamada`aarch64-linux-gnu-` for 64bit SoCs, but you may wish to change it to use your
24673ac334SMasahiro Yamadafavorite compiler.
255fd3f434SMasahiro Yamada
26673ac334SMasahiro YamadaThe following tables show <defconfig> and <device-tree> for each board.
273365b4ebSMasahiro Yamada
28673ac334SMasahiro Yamada32bit SoC boards:
29c6c7eed7SMasahiro Yamada
30673ac334SMasahiro Yamada Board         | <defconfig>                 | <device-tree>
3181b9bb5fSMasahiro Yamada---------------|-----------------------------|------------------------------
32673ac334SMasahiro YamadaLD4 reference  | uniphier_ld4_sld8_defconfig | uniphier-ld4-ref (default)
33673ac334SMasahiro Yamadasld8 reference | uniphier_ld4_sld8_defconfig | uniphier-sld8-def
3481b9bb5fSMasahiro YamadaPro4 reference | uniphier_v7_defconfig       | uniphier-pro4-ref
3581b9bb5fSMasahiro YamadaPro4 Ace       | uniphier_v7_defconfig       | uniphier-pro4-ace
3681b9bb5fSMasahiro YamadaPro4 Sanji     | uniphier_v7_defconfig       | uniphier-pro4-sanji
3781b9bb5fSMasahiro YamadaPro5 4KBOX     | uniphier_v7_defconfig       | uniphier-pro5-4kbox
3881b9bb5fSMasahiro YamadaPXs2 Gentil    | uniphier_v7_defconfig       | uniphier-pxs2-gentil
3981b9bb5fSMasahiro YamadaPXs2 Vodka     | uniphier_v7_defconfig       | uniphier-pxs2-vodka (default)
4081b9bb5fSMasahiro YamadaLD6b reference | uniphier_v7_defconfig       | uniphier-ld6b-ref
41c6c7eed7SMasahiro Yamada
42673ac334SMasahiro Yamada64bit SoC boards:
43673ac334SMasahiro Yamada
44673ac334SMasahiro Yamada Board         | <defconfig>           | <device-tree>
45673ac334SMasahiro Yamada---------------|-----------------------|----------------------------
46673ac334SMasahiro YamadaLD11 reference | uniphier_v8_defconfig | uniphier-ld11-ref
47673ac334SMasahiro YamadaLD11 Global    | uniphier_v8_defconfig | uniphier-ld11-global
48673ac334SMasahiro YamadaLD20 reference | uniphier_v8_defconfig | uniphier-ld20-ref (default)
49673ac334SMasahiro YamadaLD20 Global    | uniphier_v8_defconfig | uniphier-ld20-global
5081b9bb5fSMasahiro YamadaPXs3 reference | uniphier_v8_defconfig | uniphier-pxs3-ref
51673ac334SMasahiro Yamada
52673ac334SMasahiro YamadaFor example, to compile the source for PXs2 Vodka board, run the following:
53673ac334SMasahiro Yamada
5481b9bb5fSMasahiro Yamada    $ make uniphier_v7_defconfig
55673ac334SMasahiro Yamada    $ make CROSS_COMPILE=arm-linux-gnueabihf- DEVICE_TREE=uniphier-pxs2-vodka
5628f40d4aSMasahiro Yamada
57673ac334SMasahiro YamadaThe device tree marked as (default) can be omitted.  `uniphier-pxs2-vodka` is
5881b9bb5fSMasahiro Yamadathe default device tree for the configuration `uniphier_v7_defconfig`, so the
5981b9bb5fSMasahiro Yamadafollowing gives the same result.
601a264534SMasahiro Yamada
6181b9bb5fSMasahiro Yamada    $ make uniphier_v7_defconfig
6212a5ce72SMasahiro Yamada    $ make CROSS_COMPILE=arm-linux-gnueabihf-
63019df879SMasahiro Yamada
64019df879SMasahiro Yamada
65673ac334SMasahiro YamadaBooting 32bit SoC boards
66673ac334SMasahiro Yamada------------------------
6712a5ce72SMasahiro Yamada
68673ac334SMasahiro YamadaThe build command will generate the following:
69673ac334SMasahiro Yamada- u-boot.bin
70673ac334SMasahiro Yamada- spl/u-boot.bin
7112a5ce72SMasahiro Yamada
72673ac334SMasahiro YamadaU-Boot can boot UniPhier 32bit SoC boards by itself.  Flash the generated images
73673ac334SMasahiro Yamadato the storage device (NAND or eMMC) on your board.
74d085ecd6SMasahiro Yamada
753cb9abc9SMasahiro Yamada - spl/u-boot-spl.bin at the offset address 0x00000000
76cf3175bcSMasahiro Yamada - u-boot.bin         at the offset address 0x00020000
77d085ecd6SMasahiro Yamada
78673ac334SMasahiro YamadaThe `u-boot-with-spl.bin` is the concatenation of the two (with appropriate
79673ac334SMasahiro Yamadapadding), so you can also do:
80d085ecd6SMasahiro Yamada
81d085ecd6SMasahiro Yamada - u-boot-with-spl.bin at the offset address 0x00000000
827168da16SMasahiro Yamada
837168da16SMasahiro YamadaIf a TFTP server is available, the images can be easily updated.
84d085ecd6SMasahiro YamadaJust copy the u-boot-spl.bin and u-boot.bin to the TFTP public directory,
85673ac334SMasahiro Yamadaand run the following command at the U-Boot command line:
86673ac334SMasahiro Yamada
87673ac334SMasahiro YamadaTo update the images in NAND:
887168da16SMasahiro Yamada
897168da16SMasahiro Yamada    => run nandupdate
907168da16SMasahiro Yamada
91673ac334SMasahiro YamadaTo update the images in eMMC:
92c231c436SMasahiro Yamada
93c231c436SMasahiro Yamada    => run emmcupdate
94c231c436SMasahiro Yamada
95c231c436SMasahiro Yamada
96673ac334SMasahiro YamadaBooting 64bit SoC boards
97673ac334SMasahiro Yamada------------------------
98673ac334SMasahiro Yamada
99673ac334SMasahiro YamadaThe build command will generate the following:
100673ac334SMasahiro Yamada- u-boot.bin
101673ac334SMasahiro Yamada
102673ac334SMasahiro YamadaHowever, U-Boot is not the first stage loader for UniPhier 64bit SoC boards.
103673ac334SMasahiro YamadaU-Boot serves as a non-secure boot loader loaded by [ARM Trusted Firmware],
104673ac334SMasahiro Yamadaso you need to provide the `u-boot.bin` to the build command of ARM Trusted
105673ac334SMasahiro YamadaFirmware.
106673ac334SMasahiro Yamada
107673ac334SMasahiro Yamada[ARM Trusted Firmware]: https://github.com/ARM-software/arm-trusted-firmware
108673ac334SMasahiro Yamada
109673ac334SMasahiro Yamada
1109e19031cSMasahiro YamadaVerified Boot
1119e19031cSMasahiro Yamada-------------
1129e19031cSMasahiro Yamada
1139e19031cSMasahiro YamadaU-Boot supports an image verification method called "Verified Boot".
1149e19031cSMasahiro YamadaThis is a brief tutorial to utilize this feature for the UniPhier platform.
1159e19031cSMasahiro YamadaYou will find details documents in the doc/uImage.FIT directory.
1169e19031cSMasahiro Yamada
1179e19031cSMasahiro YamadaHere, we take LD20 reference board for example, but it should work for any
1189e19031cSMasahiro Yamadaother boards including 32 bit SoCs.
1199e19031cSMasahiro Yamada
1209e19031cSMasahiro Yamada1. Generate key to sign with
1219e19031cSMasahiro Yamada
1229e19031cSMasahiro Yamada  $ mkdir keys
1239e19031cSMasahiro Yamada  $ openssl genpkey -algorithm RSA -out keys/dev.key \
1249e19031cSMasahiro Yamada    -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537
1259e19031cSMasahiro Yamada  $ openssl req -batch -new -x509 -key keys/dev.key -out keys/dev.crt
1269e19031cSMasahiro Yamada
1279e19031cSMasahiro YamadaTwo files "dev.key" and "dev.crt" will be created.  The base name is arbitrary,
1289e19031cSMasahiro Yamadabut need to match to the "key-name-hint" property described below.
1299e19031cSMasahiro Yamada
1309e19031cSMasahiro Yamada2. Describe FIT source
1319e19031cSMasahiro Yamada
1329e19031cSMasahiro YamadaYou need to write an FIT (Flattened Image Tree) source file to describe the
1339e19031cSMasahiro Yamadastructure of the image container.
1349e19031cSMasahiro Yamada
1359e19031cSMasahiro YamadaThe following is an example for a simple usecase:
1369e19031cSMasahiro Yamada
1379e19031cSMasahiro Yamada---------------------------------------->8----------------------------------------
1389e19031cSMasahiro Yamada/dts-v1/;
1399e19031cSMasahiro Yamada
1409e19031cSMasahiro Yamada/ {
1419e19031cSMasahiro Yamada	description = "Kernel, DTB and Ramdisk for UniPhier LD20 Reference Board";
1429e19031cSMasahiro Yamada	#address-cells = <1>;
1439e19031cSMasahiro Yamada
1449e19031cSMasahiro Yamada	images {
145971a5419SAndre Przywara		kernel {
1469e19031cSMasahiro Yamada			description = "linux";
1479e19031cSMasahiro Yamada			data = /incbin/("PATH/TO/YOUR/LINUX/DIR/arch/arm64/boot/Image.gz");
1489e19031cSMasahiro Yamada			type = "kernel";
1499e19031cSMasahiro Yamada			arch = "arm64";
1509e19031cSMasahiro Yamada			os = "linux";
1519e19031cSMasahiro Yamada			compression = "gzip";
1529e19031cSMasahiro Yamada			load = <0x82080000>;
1539e19031cSMasahiro Yamada			entry = <0x82080000>;
154971a5419SAndre Przywara			hash-1 {
1559e19031cSMasahiro Yamada				algo = "sha256";
1569e19031cSMasahiro Yamada			};
1579e19031cSMasahiro Yamada		};
1589e19031cSMasahiro Yamada
159971a5419SAndre Przywara		fdt-1 {
1609e19031cSMasahiro Yamada			description = "fdt";
1619e19031cSMasahiro Yamada			data = /incbin/("PATH/TO/YOUR/LINUX/DIR/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dtb");
1629e19031cSMasahiro Yamada			type = "flat_dt";
1639e19031cSMasahiro Yamada			arch = "arm64";
1649e19031cSMasahiro Yamada			compression = "none";
165971a5419SAndre Przywara			hash-1 {
1669e19031cSMasahiro Yamada				algo = "sha256";
1679e19031cSMasahiro Yamada			};
1689e19031cSMasahiro Yamada		};
1699e19031cSMasahiro Yamada
170971a5419SAndre Przywara		ramdisk {
1719e19031cSMasahiro Yamada			description = "ramdisk";
1729e19031cSMasahiro Yamada			data = /incbin/("PATH/TO/YOUR/ROOTFS/DIR/rootfs.cpio");
1739e19031cSMasahiro Yamada			type = "ramdisk";
1749e19031cSMasahiro Yamada			arch = "arm64";
1759e19031cSMasahiro Yamada			os = "linux";
1769e19031cSMasahiro Yamada			compression = "none";
177971a5419SAndre Przywara			hash-1 {
1789e19031cSMasahiro Yamada				algo = "sha256";
1799e19031cSMasahiro Yamada			};
1809e19031cSMasahiro Yamada		};
1819e19031cSMasahiro Yamada	};
1829e19031cSMasahiro Yamada
1839e19031cSMasahiro Yamada	configurations {
184971a5419SAndre Przywara		default = "config-1";
1859e19031cSMasahiro Yamada
186971a5419SAndre Przywara		config-1 {
1879e19031cSMasahiro Yamada			description = "Configuration0";
188971a5419SAndre Przywara			kernel = "kernel";
189971a5419SAndre Przywara			fdt = "fdt-1";
190971a5419SAndre Przywara			ramdisk = "ramdisk";
191971a5419SAndre Przywara			signature-1 {
1929e19031cSMasahiro Yamada				algo = "sha256,rsa2048";
1939e19031cSMasahiro Yamada				key-name-hint = "dev";
1949e19031cSMasahiro Yamada				sign-images = "kernel", "fdt", "ramdisk";
1959e19031cSMasahiro Yamada			};
1969e19031cSMasahiro Yamada		};
1979e19031cSMasahiro Yamada	};
1989e19031cSMasahiro Yamada};
1999e19031cSMasahiro Yamada---------------------------------------->8----------------------------------------
2009e19031cSMasahiro Yamada
2019e19031cSMasahiro YamadaYou need to change the three '/incbin/' lines, depending on the location of
2029e19031cSMasahiro Yamadayour kernel image, device tree blob, and init ramdisk.  The "load" and "entry"
2039e19031cSMasahiro Yamadaproperties also need to be adjusted if you want to change the physical placement
2049e19031cSMasahiro Yamadaof the kernel.
2059e19031cSMasahiro Yamada
2069e19031cSMasahiro YamadaThe "key-name-hint" must specify the key name you have created in the step 1.
2079e19031cSMasahiro Yamada
2089e19031cSMasahiro YamadaThe FIT file name is arbitrary.  Let's say you saved it into "fit.its".
2099e19031cSMasahiro Yamada
2109e19031cSMasahiro Yamada3. Compile U-Boot with FIT and signature enabled
2119e19031cSMasahiro Yamada
2129e19031cSMasahiro YamadaTo use the Verified Boot, you need to enable the following two options:
2139e19031cSMasahiro Yamada  CONFIG_FIT
2149e19031cSMasahiro Yamada  CONFIG_FIT_SIGNATURE
2159e19031cSMasahiro Yamada
2169e19031cSMasahiro YamadaThey are disabled by default for UniPhier defconfig files.  So, you need to
2179e19031cSMasahiro Yamadatweak the configuration from "make menuconfig" or friends.
2189e19031cSMasahiro Yamada
2199e19031cSMasahiro Yamada  $ make uniphier_v8_defconfig
2209e19031cSMasahiro Yamada  $ make menuconfig
2219e19031cSMasahiro Yamada      [ enable CONFIG_FIT and CONFIG_FIT_SIGNATURE ]
2229e19031cSMasahiro Yamada  $ make CROSS_COMPILE=aarch64-linux-gnu-
2239e19031cSMasahiro Yamada
2249e19031cSMasahiro Yamada4. Build the image tree blob
2259e19031cSMasahiro Yamada
2269e19031cSMasahiro YamadaAfter building U-Boot, you will see tools/mkimage.  With this tool, you can
2279e19031cSMasahiro Yamadacreate an image tree blob as follows:
2289e19031cSMasahiro Yamada
2299e19031cSMasahiro Yamada  $ tools/mkimage -f fit.its -k keys -K dts/dt.dtb -r -F fitImage
2309e19031cSMasahiro Yamada
2319e19031cSMasahiro YamadaThe -k option must specify the key directory you have created in step 1.
2329e19031cSMasahiro Yamada
2339e19031cSMasahiro YamadaA file "fitImage" will be created.  This includes kernel, DTB, Init-ramdisk,
2349e19031cSMasahiro Yamadahash data for each of the three, and signature data.
2359e19031cSMasahiro Yamada
2369e19031cSMasahiro YamadaThe public key needed for the run-time verification is stored in "dts/dt.dtb".
2379e19031cSMasahiro Yamada
2389e19031cSMasahiro Yamada5. Compile U-Boot again
2399e19031cSMasahiro Yamada
2409e19031cSMasahiro YamadaSince the "dt.dtb" has been updated in step 4, you need to re-compile the
2419e19031cSMasahiro YamadaU-Boot.
2429e19031cSMasahiro Yamada
2439e19031cSMasahiro Yamada  $ make CROSS_COMPILE=aarch64-linux-gnu-
2449e19031cSMasahiro Yamada
2459e19031cSMasahiro YamadaThe re-compiled "u-boot.bin" is appended with DTB that contains the public key.
2469e19031cSMasahiro Yamada
2479e19031cSMasahiro Yamada6. Flash the image
2489e19031cSMasahiro Yamada
2499e19031cSMasahiro YamadaFlash the "fitImage" to a storage device (NAND, eMMC, or whatever) on your
2509e19031cSMasahiro Yamadaboard.
2519e19031cSMasahiro Yamada
2529e19031cSMasahiro YamadaPlease note the "u-boot.bin" must be signed, and verified by someone when it is
2539e19031cSMasahiro Yamadaloaded.  For ARMv8 SoCs, the "someone" is generally ARM Trusted Firmware BL2.
2549e19031cSMasahiro YamadaARM Trusted Firmware supports an image authentication mechanism called Trusted
2559e19031cSMasahiro YamadaBoard Boot (TBB).  The verification process must be chained from the moment of
2569e19031cSMasahiro Yamadathe system reset.  If the Chain of Trust has a breakage somewhere, the verified
2579e19031cSMasahiro Yamadaboot process is entirely pointless.
2589e19031cSMasahiro Yamada
2599e19031cSMasahiro Yamada7. Boot verified kernel
2609e19031cSMasahiro Yamada
2619e19031cSMasahiro YamadaLoad the fitImage to memory and run the following from the U-Boot command line.
2629e19031cSMasahiro Yamada
2639e19031cSMasahiro Yamada  > bootm <addr>
2649e19031cSMasahiro Yamada
2659e19031cSMasahiro YamadaHere, <addr> is the base address of the fitImage.
2669e19031cSMasahiro Yamada
2679e19031cSMasahiro YamadaIf it is successful, you will see messages like follows:
2689e19031cSMasahiro Yamada
2699e19031cSMasahiro Yamada---------------------------------------->8----------------------------------------
2709e19031cSMasahiro Yamada## Loading kernel from FIT Image at 84100000 ...
271971a5419SAndre Przywara   Using 'config-1' configuration
2729e19031cSMasahiro Yamada   Verifying Hash Integrity ... sha256,rsa2048:dev+ OK
273971a5419SAndre Przywara   Trying 'kernel' kernel subimage
2749e19031cSMasahiro Yamada     Description:  linux
2759e19031cSMasahiro Yamada     Created:      2017-10-20  14:32:29 UTC
2769e19031cSMasahiro Yamada     Type:         Kernel Image
2779e19031cSMasahiro Yamada     Compression:  gzip compressed
2789e19031cSMasahiro Yamada     Data Start:   0x841000c8
2799e19031cSMasahiro Yamada     Data Size:    6957818 Bytes = 6.6 MiB
2809e19031cSMasahiro Yamada     Architecture: AArch64
2819e19031cSMasahiro Yamada     OS:           Linux
2829e19031cSMasahiro Yamada     Load Address: 0x82080000
2839e19031cSMasahiro Yamada     Entry Point:  0x82080000
2849e19031cSMasahiro Yamada     Hash algo:    sha256
2859e19031cSMasahiro Yamada     Hash value:   82a37b7f11ae55f4e07aa25bf77e4067cb9dc1014d52d6cd4d588f92eee3aaad
2869e19031cSMasahiro Yamada   Verifying Hash Integrity ... sha256+ OK
2879e19031cSMasahiro Yamada## Loading ramdisk from FIT Image at 84100000 ...
288971a5419SAndre Przywara   Using 'config-1' configuration
289971a5419SAndre Przywara   Trying 'ramdisk' ramdisk subimage
2909e19031cSMasahiro Yamada     Description:  ramdisk
2919e19031cSMasahiro Yamada     Created:      2017-10-20  14:32:29 UTC
2929e19031cSMasahiro Yamada     Type:         RAMDisk Image
2939e19031cSMasahiro Yamada     Compression:  uncompressed
2949e19031cSMasahiro Yamada     Data Start:   0x847a5cc0
2959e19031cSMasahiro Yamada     Data Size:    5264365 Bytes = 5 MiB
2969e19031cSMasahiro Yamada     Architecture: AArch64
2979e19031cSMasahiro Yamada     OS:           Linux
2989e19031cSMasahiro Yamada     Load Address: unavailable
2999e19031cSMasahiro Yamada     Entry Point:  unavailable
3009e19031cSMasahiro Yamada     Hash algo:    sha256
3019e19031cSMasahiro Yamada     Hash value:   44980a2874154a2e31ed59222c9f8ea968867637f35c81e4107a984de7014deb
3029e19031cSMasahiro Yamada   Verifying Hash Integrity ... sha256+ OK
3039e19031cSMasahiro Yamada## Loading fdt from FIT Image at 84100000 ...
304971a5419SAndre Przywara   Using 'config-1' configuration
305971a5419SAndre Przywara   Trying 'fdt-1' fdt subimage
3069e19031cSMasahiro Yamada     Description:  fdt
3079e19031cSMasahiro Yamada     Created:      2017-10-20  14:32:29 UTC
3089e19031cSMasahiro Yamada     Type:         Flat Device Tree
3099e19031cSMasahiro Yamada     Compression:  uncompressed
3109e19031cSMasahiro Yamada     Data Start:   0x847a2cb0
3119e19031cSMasahiro Yamada     Data Size:    12111 Bytes = 11.8 KiB
3129e19031cSMasahiro Yamada     Architecture: AArch64
3139e19031cSMasahiro Yamada     Hash algo:    sha256
3149e19031cSMasahiro Yamada     Hash value:   c517099db537f6d325e6be46b25c871a41331ad5af0283883fd29d40bfc14e1d
3159e19031cSMasahiro Yamada   Verifying Hash Integrity ... sha256+ OK
3169e19031cSMasahiro Yamada   Booting using the fdt blob at 0x847a2cb0
3179e19031cSMasahiro Yamada   Uncompressing Kernel Image ... OK
3189e19031cSMasahiro Yamada   reserving fdt memory region: addr=80000000 size=2000000
3199e19031cSMasahiro Yamada   Loading Device Tree to 000000009fffa000, end 000000009fffff4e ... OK
3209e19031cSMasahiro Yamada
3219e19031cSMasahiro YamadaStarting kernel ...
3229e19031cSMasahiro Yamada---------------------------------------->8----------------------------------------
3239e19031cSMasahiro Yamada
3249e19031cSMasahiro YamadaPlease pay attention to the lines that start with "Verifying Hash Integrity".
3259e19031cSMasahiro Yamada
3269e19031cSMasahiro Yamada"Verifying Hash Integrity ... sha256,rsa2048:dev+ OK" means the signature check
3279e19031cSMasahiro Yamadapassed.
3289e19031cSMasahiro Yamada
3299e19031cSMasahiro Yamada"Verifying Hash Integrity ... sha256+ OK" (3 times) means the hash check passed
3309e19031cSMasahiro Yamadafor kernel, DTB, and Init ramdisk.
3319e19031cSMasahiro Yamada
3329e19031cSMasahiro YamadaIf they are not displayed, the Verified Boot is not working.
3339e19031cSMasahiro Yamada
3349e19031cSMasahiro Yamada
335*7ef5b1e7SMasahiro YamadaDeployment for Distro Boot
336*7ef5b1e7SMasahiro Yamada--------------------------
337*7ef5b1e7SMasahiro Yamada
338*7ef5b1e7SMasahiro YamadaUniPhier SoC family boot the kernel in a generic manner as described in
339*7ef5b1e7SMasahiro Yamadadoc/README.distro .
340*7ef5b1e7SMasahiro Yamada
341*7ef5b1e7SMasahiro YamadaTo boot the kernel, you need to deploy necesssary components to a file
342*7ef5b1e7SMasahiro Yamadasystem on one of your block devices (eMMC, NAND, USB drive, etc.).
343*7ef5b1e7SMasahiro Yamada
344*7ef5b1e7SMasahiro YamadaThe components depend on the kernel image format.
345*7ef5b1e7SMasahiro Yamada
346*7ef5b1e7SMasahiro Yamada[1] Bare images
347*7ef5b1e7SMasahiro Yamada
348*7ef5b1e7SMasahiro Yamada  - kernel
349*7ef5b1e7SMasahiro Yamada  - init ramdisk
350*7ef5b1e7SMasahiro Yamada  - device tree blob
351*7ef5b1e7SMasahiro Yamada  - boot configuration file (extlinux.conf)
352*7ef5b1e7SMasahiro Yamada
353*7ef5b1e7SMasahiro YamadaHere is an exmple of the configuration file.
354*7ef5b1e7SMasahiro Yamada
355*7ef5b1e7SMasahiro Yamada-------------------->8--------------------
356*7ef5b1e7SMasahiro Yamadamenu title UniPhier Boot Options.
357*7ef5b1e7SMasahiro Yamada
358*7ef5b1e7SMasahiro Yamadatimeout 50
359*7ef5b1e7SMasahiro Yamadadefault UniPhier
360*7ef5b1e7SMasahiro Yamada
361*7ef5b1e7SMasahiro Yamadalabel UniPhier
362*7ef5b1e7SMasahiro Yamada      kernel ../Image
363*7ef5b1e7SMasahiro Yamada      initrd ../rootfs.cpio.gz
364*7ef5b1e7SMasahiro Yamada      fdtdir ..
365*7ef5b1e7SMasahiro Yamada-------------------->8--------------------
366*7ef5b1e7SMasahiro Yamada
367*7ef5b1e7SMasahiro YamadaThen, write 'Image', 'rootfs.cpio.gz', 'uniphier-ld20-ref.dtb' (DTB depends on
368*7ef5b1e7SMasahiro Yamadayour board), and 'extlinux/extlinux.conf' to the file system.
369*7ef5b1e7SMasahiro Yamada
370*7ef5b1e7SMasahiro Yamada[2] FIT
371*7ef5b1e7SMasahiro Yamada
372*7ef5b1e7SMasahiro Yamada  - FIT blob
373*7ef5b1e7SMasahiro Yamada  - boot configuration file (extlinux.conf)
374*7ef5b1e7SMasahiro Yamada
375*7ef5b1e7SMasahiro Yamada-------------------->8--------------------
376*7ef5b1e7SMasahiro Yamadamenu title UniPhier Boot Options.
377*7ef5b1e7SMasahiro Yamada
378*7ef5b1e7SMasahiro Yamadatimeout 50
379*7ef5b1e7SMasahiro Yamadadefault UniPhier
380*7ef5b1e7SMasahiro Yamada
381*7ef5b1e7SMasahiro Yamadalabel UniPhier
382*7ef5b1e7SMasahiro Yamada      kernel ../fitImage
383*7ef5b1e7SMasahiro Yamada-------------------->8--------------------
384*7ef5b1e7SMasahiro Yamada
385*7ef5b1e7SMasahiro YamadaSince the init ramdisk and DTB are contained in the FIT blob,
386*7ef5b1e7SMasahiro Yamadayou do not need to describe them in the configuration file.
387*7ef5b1e7SMasahiro YamadaWrite 'fitImage' and 'extlinux/extlinux.conf' to the file system.
388*7ef5b1e7SMasahiro Yamada
389*7ef5b1e7SMasahiro Yamada
3907168da16SMasahiro YamadaUniPhier specific commands
3917168da16SMasahiro Yamada--------------------------
3927168da16SMasahiro Yamada
3937168da16SMasahiro Yamada - pinmon (enabled by CONFIG_CMD_PINMON)
3947168da16SMasahiro Yamada     shows the boot mode pins that has been latched at the power-on reset
3957168da16SMasahiro Yamada
3967168da16SMasahiro Yamada - ddrphy (enabled by CONFIG_CMD_DDRPHY_DUMP)
3977168da16SMasahiro Yamada     shows the DDR PHY parameters set by the PHY training
3987168da16SMasahiro Yamada
39912a5ce72SMasahiro Yamada - ddrmphy (enabled by CONFIG_CMD_DDRMPHY_DUMP)
40012a5ce72SMasahiro Yamada     shows the DDR Multi PHY parameters set by the PHY training
40112a5ce72SMasahiro Yamada
4027168da16SMasahiro Yamada
4037168da16SMasahiro YamadaSupported devices
4047168da16SMasahiro Yamada-----------------
4057168da16SMasahiro Yamada
4067168da16SMasahiro Yamada - UART (on-chip)
4077168da16SMasahiro Yamada - NAND
408a111bfbfSMasahiro Yamada - SD/eMMC
4091e7df7c4SMasahiro Yamada - USB 2.0 (EHCI)
4101e7df7c4SMasahiro Yamada - USB 3.0 (xHCI)
411b9a66b63SMasahiro Yamada - GPIO
4127168da16SMasahiro Yamada - LAN (on-board SMSC9118)
4137168da16SMasahiro Yamada - I2C
4147168da16SMasahiro Yamada - EEPROM (connected to the on-board I2C bus)
4157168da16SMasahiro Yamada - Support card (SRAM, NOR flash, some peripherals)
4167168da16SMasahiro Yamada
4177168da16SMasahiro Yamada
41862102beeSMasahiro YamadaMicro Support Card
41962102beeSMasahiro Yamada------------------
42062102beeSMasahiro Yamada
42162102beeSMasahiro YamadaThe recommended bit switch settings are as follows:
42262102beeSMasahiro Yamada
42362102beeSMasahiro Yamada SW2    OFF(1)/ON(0)   Description
42462102beeSMasahiro Yamada ------------------------------------------
42562102beeSMasahiro Yamada bit 1   <----         BKSZ[0]
42662102beeSMasahiro Yamada bit 2   ---->         BKSZ[1]
42762102beeSMasahiro Yamada bit 3   <----         SoC Bus Width 16/32
42862102beeSMasahiro Yamada bit 4   <----         SERIAL_SEL[0]
42962102beeSMasahiro Yamada bit 5   ---->         SERIAL_SEL[1]
43062102beeSMasahiro Yamada bit 6   ---->         BOOTSWAP_EN
43162102beeSMasahiro Yamada bit 7   <----         CS1/CS5
43262102beeSMasahiro Yamada bit 8   <----         SOC_SERIAL_DISABLE
43362102beeSMasahiro Yamada
43462102beeSMasahiro Yamada SW8    OFF(1)/ON(0)   Description
43562102beeSMasahiro Yamada ------------------------------------------
436e69514ccSMasahiro Yamada bit 1    <----        CS1_SPLIT
43762102beeSMasahiro Yamada bit 2    <----        CASE9_ON
43862102beeSMasahiro Yamada bit 3    <----        CASE10_ON
43962102beeSMasahiro Yamada bit 4  Don't Care     Reserve
44062102beeSMasahiro Yamada bit 5  Don't Care     Reserve
44162102beeSMasahiro Yamada bit 6  Don't Care     Reserve
44262102beeSMasahiro Yamada bit 7    ---->        BURST_EN
44362102beeSMasahiro Yamada bit 8    ---->        FLASHBUS32_16
44462102beeSMasahiro Yamada
44562102beeSMasahiro YamadaThe BKSZ[1:0] specifies the address range of memory slot and peripherals
44662102beeSMasahiro Yamadaas follows:
44762102beeSMasahiro Yamada
44862102beeSMasahiro Yamada BKSZ    Description              RAM slot            Peripherals
44962102beeSMasahiro Yamada --------------------------------------------------------------------
450c57a9a63SMasahiro Yamada 0b00   15MB RAM / 1MB Peri    00000000-00efffff    00f00000-00ffffff
451c57a9a63SMasahiro Yamada 0b01   31MB RAM / 1MB Peri    00000000-01efffff    01f00000-01ffffff
452c57a9a63SMasahiro Yamada 0b10   64MB RAM / 1MB Peri    00000000-03efffff    03f00000-03ffffff
453c57a9a63SMasahiro Yamada 0b11  127MB RAM / 1MB Peri    00000000-07efffff    07f00000-07ffffff
45462102beeSMasahiro Yamada
45562102beeSMasahiro YamadaSet BSKZ[1:0] to 0b01 for U-Boot.
45662102beeSMasahiro YamadaThis mode is the most handy because EA[24] is always supported by the save pin
45762102beeSMasahiro Yamadamode of the system bus.  On the other hand, EA[25] is not supported for some
45862102beeSMasahiro Yamadanewer SoCs.  Even if it is, EA[25] is not connected on most of the boards.
45962102beeSMasahiro Yamada
4607168da16SMasahiro Yamada--
46162102beeSMasahiro YamadaMasahiro Yamada <yamada.masahiro@socionext.com>
4629e19031cSMasahiro YamadaOct. 2017
463