xref: /OK3568_Linux_fs/u-boot/doc/README.uniphier (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunU-Boot for UniPhier SoC family
2*4882a593Smuzhiyun==============================
3*4882a593Smuzhiyun
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunRecommended toolchains
6*4882a593Smuzhiyun----------------------
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunThe UniPhier platform is well tested with Linaro toolchains.
9*4882a593SmuzhiyunYou can download pre-built toolchains from:
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun    http://www.linaro.org/downloads/
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunCompile the source
15*4882a593Smuzhiyun------------------
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunThe source can be configured and built with the following commands:
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun    $ make <defconfig>
20*4882a593Smuzhiyun    $ make CROSS_COMPILE=<toolchain-prefix> DEVICE_TREE=<device-tree>
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunThe recommended <toolchain-prefix> is `arm-linux-gnueabihf-` for 32bit SoCs,
23*4882a593Smuzhiyun`aarch64-linux-gnu-` for 64bit SoCs, but you may wish to change it to use your
24*4882a593Smuzhiyunfavorite compiler.
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunThe following tables show <defconfig> and <device-tree> for each board.
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun32bit SoC boards:
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun Board         | <defconfig>                  | <device-tree>
31*4882a593Smuzhiyun---------------|------------------------------|------------------------------
32*4882a593SmuzhiyunLD4 reference  | uniphier_ld4_sld8_defconfig  | uniphier-ld4-ref (default)
33*4882a593Smuzhiyunsld8 reference | uniphier_ld4_sld8_defconfig  | uniphier-sld8-def
34*4882a593SmuzhiyunPro4 reference | uniphier_pro4_defconfig      | uniphier-pro4-ref (default)
35*4882a593SmuzhiyunPro4 Ace       | uniphier_pro4_defconfig      | uniphier-pro4-ace
36*4882a593SmuzhiyunPro4 Sanji     | uniphier_pro4_defconfig      | uniphier-pro4-sanji
37*4882a593SmuzhiyunPro5 4KBOX     | uniphier_pxs2_ld6b_defconfig | uniphier-pro5-4kbox
38*4882a593SmuzhiyunPXs2 Gentil    | uniphier_pxs2_ld6b_defconfig | uniphier-pxs2-gentil
39*4882a593SmuzhiyunPXs2 Vodka     | uniphier_pxs2_ld6b_defconfig | uniphier-pxs2-vodka (default)
40*4882a593SmuzhiyunLD6b reference | uniphier_pxs2_ld6b_defconfig | uniphier-ld6b-ref
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun64bit SoC boards:
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun Board         | <defconfig>           | <device-tree>
45*4882a593Smuzhiyun---------------|-----------------------|----------------------------
46*4882a593SmuzhiyunLD11 reference | uniphier_v8_defconfig | uniphier-ld11-ref
47*4882a593SmuzhiyunLD11 Global    | uniphier_v8_defconfig | uniphier-ld11-global
48*4882a593SmuzhiyunLD20 reference | uniphier_v8_defconfig | uniphier-ld20-ref (default)
49*4882a593SmuzhiyunLD20 Global    | uniphier_v8_defconfig | uniphier-ld20-global
50*4882a593Smuzhiyun
51*4882a593SmuzhiyunFor example, to compile the source for PXs2 Vodka board, run the following:
52*4882a593Smuzhiyun
53*4882a593Smuzhiyun    $ make uniphier_pxs2_ld6b_defconfig
54*4882a593Smuzhiyun    $ make CROSS_COMPILE=arm-linux-gnueabihf- DEVICE_TREE=uniphier-pxs2-vodka
55*4882a593Smuzhiyun
56*4882a593SmuzhiyunThe device tree marked as (default) can be omitted.  `uniphier-pxs2-vodka` is
57*4882a593Smuzhiyunthe default device tree for the configuration `uniphier_pxs2_ld6b_defconfig`,
58*4882a593Smuzhiyunso the following gives the same result.
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun    $ make uniphier_pxs2_ld6b_defconfig
61*4882a593Smuzhiyun    $ make CROSS_COMPILE=arm-linux-gnueabihf-
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun
64*4882a593SmuzhiyunBooting 32bit SoC boards
65*4882a593Smuzhiyun------------------------
66*4882a593Smuzhiyun
67*4882a593SmuzhiyunThe build command will generate the following:
68*4882a593Smuzhiyun- u-boot.bin
69*4882a593Smuzhiyun- spl/u-boot.bin
70*4882a593Smuzhiyun
71*4882a593SmuzhiyunU-Boot can boot UniPhier 32bit SoC boards by itself.  Flash the generated images
72*4882a593Smuzhiyunto the storage device (NAND or eMMC) on your board.
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun - spl/u-boot-spl.bin at the offset address 0x00000000
75*4882a593Smuzhiyun - u-boot.bin         at the offset address 0x00020000
76*4882a593Smuzhiyun
77*4882a593SmuzhiyunThe `u-boot-with-spl.bin` is the concatenation of the two (with appropriate
78*4882a593Smuzhiyunpadding), so you can also do:
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun - u-boot-with-spl.bin at the offset address 0x00000000
81*4882a593Smuzhiyun
82*4882a593SmuzhiyunIf a TFTP server is available, the images can be easily updated.
83*4882a593SmuzhiyunJust copy the u-boot-spl.bin and u-boot.bin to the TFTP public directory,
84*4882a593Smuzhiyunand run the following command at the U-Boot command line:
85*4882a593Smuzhiyun
86*4882a593SmuzhiyunTo update the images in NAND:
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun    => run nandupdate
89*4882a593Smuzhiyun
90*4882a593SmuzhiyunTo update the images in eMMC:
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun    => run emmcupdate
93*4882a593Smuzhiyun
94*4882a593Smuzhiyun
95*4882a593SmuzhiyunBooting 64bit SoC boards
96*4882a593Smuzhiyun------------------------
97*4882a593Smuzhiyun
98*4882a593SmuzhiyunThe build command will generate the following:
99*4882a593Smuzhiyun- u-boot.bin
100*4882a593Smuzhiyun
101*4882a593SmuzhiyunHowever, U-Boot is not the first stage loader for UniPhier 64bit SoC boards.
102*4882a593SmuzhiyunU-Boot serves as a non-secure boot loader loaded by [ARM Trusted Firmware],
103*4882a593Smuzhiyunso you need to provide the `u-boot.bin` to the build command of ARM Trusted
104*4882a593SmuzhiyunFirmware.
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun[ARM Trusted Firmware]: https://github.com/ARM-software/arm-trusted-firmware
107*4882a593Smuzhiyun
108*4882a593Smuzhiyun
109*4882a593SmuzhiyunUniPhier specific commands
110*4882a593Smuzhiyun--------------------------
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun - pinmon (enabled by CONFIG_CMD_PINMON)
113*4882a593Smuzhiyun     shows the boot mode pins that has been latched at the power-on reset
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun - ddrphy (enabled by CONFIG_CMD_DDRPHY_DUMP)
116*4882a593Smuzhiyun     shows the DDR PHY parameters set by the PHY training
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun - ddrmphy (enabled by CONFIG_CMD_DDRMPHY_DUMP)
119*4882a593Smuzhiyun     shows the DDR Multi PHY parameters set by the PHY training
120*4882a593Smuzhiyun
121*4882a593Smuzhiyun
122*4882a593SmuzhiyunSupported devices
123*4882a593Smuzhiyun-----------------
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun - UART (on-chip)
126*4882a593Smuzhiyun - NAND
127*4882a593Smuzhiyun - SD/eMMC
128*4882a593Smuzhiyun - USB 2.0 (EHCI)
129*4882a593Smuzhiyun - USB 3.0 (xHCI)
130*4882a593Smuzhiyun - GPIO
131*4882a593Smuzhiyun - LAN (on-board SMSC9118)
132*4882a593Smuzhiyun - I2C
133*4882a593Smuzhiyun - EEPROM (connected to the on-board I2C bus)
134*4882a593Smuzhiyun - Support card (SRAM, NOR flash, some peripherals)
135*4882a593Smuzhiyun
136*4882a593Smuzhiyun
137*4882a593SmuzhiyunMicro Support Card
138*4882a593Smuzhiyun------------------
139*4882a593Smuzhiyun
140*4882a593SmuzhiyunThe recommended bit switch settings are as follows:
141*4882a593Smuzhiyun
142*4882a593Smuzhiyun SW2    OFF(1)/ON(0)   Description
143*4882a593Smuzhiyun ------------------------------------------
144*4882a593Smuzhiyun bit 1   <----         BKSZ[0]
145*4882a593Smuzhiyun bit 2   ---->         BKSZ[1]
146*4882a593Smuzhiyun bit 3   <----         SoC Bus Width 16/32
147*4882a593Smuzhiyun bit 4   <----         SERIAL_SEL[0]
148*4882a593Smuzhiyun bit 5   ---->         SERIAL_SEL[1]
149*4882a593Smuzhiyun bit 6   ---->         BOOTSWAP_EN
150*4882a593Smuzhiyun bit 7   <----         CS1/CS5
151*4882a593Smuzhiyun bit 8   <----         SOC_SERIAL_DISABLE
152*4882a593Smuzhiyun
153*4882a593Smuzhiyun SW8    OFF(1)/ON(0)   Description
154*4882a593Smuzhiyun ------------------------------------------
155*4882a593Smuzhiyun bit 1    <----        CS1_SPLIT
156*4882a593Smuzhiyun bit 2    <----        CASE9_ON
157*4882a593Smuzhiyun bit 3    <----        CASE10_ON
158*4882a593Smuzhiyun bit 4  Don't Care     Reserve
159*4882a593Smuzhiyun bit 5  Don't Care     Reserve
160*4882a593Smuzhiyun bit 6  Don't Care     Reserve
161*4882a593Smuzhiyun bit 7    ---->        BURST_EN
162*4882a593Smuzhiyun bit 8    ---->        FLASHBUS32_16
163*4882a593Smuzhiyun
164*4882a593SmuzhiyunThe BKSZ[1:0] specifies the address range of memory slot and peripherals
165*4882a593Smuzhiyunas follows:
166*4882a593Smuzhiyun
167*4882a593Smuzhiyun BKSZ    Description              RAM slot            Peripherals
168*4882a593Smuzhiyun --------------------------------------------------------------------
169*4882a593Smuzhiyun 0b00   15MB RAM / 1MB Peri    00000000-00efffff    00f00000-00ffffff
170*4882a593Smuzhiyun 0b01   31MB RAM / 1MB Peri    00000000-01efffff    01f00000-01ffffff
171*4882a593Smuzhiyun 0b10   64MB RAM / 1MB Peri    00000000-03efffff    03f00000-03ffffff
172*4882a593Smuzhiyun 0b11  127MB RAM / 1MB Peri    00000000-07efffff    07f00000-07ffffff
173*4882a593Smuzhiyun
174*4882a593SmuzhiyunSet BSKZ[1:0] to 0b01 for U-Boot.
175*4882a593SmuzhiyunThis mode is the most handy because EA[24] is always supported by the save pin
176*4882a593Smuzhiyunmode of the system bus.  On the other hand, EA[25] is not supported for some
177*4882a593Smuzhiyunnewer SoCs.  Even if it is, EA[25] is not connected on most of the boards.
178*4882a593Smuzhiyun
179*4882a593Smuzhiyun--
180*4882a593SmuzhiyunMasahiro Yamada <yamada.masahiro@socionext.com>
181*4882a593SmuzhiyunJul. 2017
182