1*4882a593Smuzhiyun================================================================================ 2*4882a593Smuzhiyun Board Information 3*4882a593Smuzhiyun================================================================================ 4*4882a593Smuzhiyun 5*4882a593SmuzhiyunDeveloped by HiSilicon, the board features the Hi3798C V200 with an 6*4882a593Smuzhiyunintegrated quad-core 64-bit ARM Cortex A53 processor and high 7*4882a593Smuzhiyunperformance Mali T720 GPU, making it capable of running any commercial 8*4882a593Smuzhiyunset-top solution based on Linux or Android. Its high performance 9*4882a593Smuzhiyunspecification also supports a premium user experience with up to H.265 10*4882a593SmuzhiyunHEVC decoding of 4K video at 60 frames per second. 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunSOC Hisilicon Hi3798CV200 13*4882a593SmuzhiyunCPU Quad-core ARM Cortex-A53 64 bit 14*4882a593SmuzhiyunDRAM DDR3/3L/4 SDRAM interface, maximum 32-bit data width 2 GB 15*4882a593SmuzhiyunUSB Two USB 2.0 ports One USB 3.0 ports 16*4882a593SmuzhiyunCONSOLE USB-micro port for console support 17*4882a593SmuzhiyunETHERNET 1 GBe Ethernet 18*4882a593SmuzhiyunPCIE One PCIe 2.0 interfaces 19*4882a593SmuzhiyunJTAG 8-Pin JTAG 20*4882a593SmuzhiyunEXPANSION INTERFACE Linaro 96Boards Low Speed Expansion slot 21*4882a593SmuzhiyunDIMENSION Standard 160×120 mm 96Boards Enterprice Edition form factor 22*4882a593SmuzhiyunWIFI 802.11AC 2*2 with Bluetooth 23*4882a593SmuzhiyunCONNECTORS One connector for Smart Card One connector for TSI 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun 26*4882a593Smuzhiyun================================================================================ 27*4882a593Smuzhiyun BUILD INSTRUCTIONS 28*4882a593Smuzhiyun================================================================================ 29*4882a593Smuzhiyun 30*4882a593SmuzhiyunNote of warning: 31*4882a593Smuzhiyun================ 32*4882a593Smuzhiyun 33*4882a593SmuzhiyunU-boot has a *strong* dependency with the l-loader and the arm trusted firmware 34*4882a593Smuzhiyunrepositories. 35*4882a593Smuzhiyun 36*4882a593SmuzhiyunThe boot sequence is: 37*4882a593Smuzhiyun l-loader --> arm_trusted_firmware --> u-boot 38*4882a593Smuzhiyun 39*4882a593SmuzhiyunU-Boot needs to be aware of the BL31 runtime location and size to avoid writing 40*4882a593Smuzhiyunover it. Currently, BL31 is being placed below the kernel text offset (check 41*4882a593Smuzhiyunpoplar.c) but this could change in the future. 42*4882a593Smuzhiyun 43*4882a593SmuzhiyunThe current version of u-boot has been tested with: 44*4882a593Smuzhiyun - https://github.com/Linaro/poplar-l-loader.git 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun commit f0988698dcc5c08bd0a8f50aa0457e138a5f438c 47*4882a593Smuzhiyun Author: Alex Elder <elder@linaro.org> 48*4882a593Smuzhiyun Date: Fri Jun 16 08:57:59 2017 -0500 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun l-loader: use external memory region definitions 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun The ARM Trusted Firmware code now has a header file that collects 53*4882a593Smuzhiyun all the definitions for the memory regions used for its boot stages. 54*4882a593Smuzhiyun Include that file where needed, and use the definitions found therein 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun Signed-off-by: Alex Elder <elder@linaro.org> 57*4882a593Smuzhiyun 58*4882a593Smuzhiyun 59*4882a593Smuzhiyun - https://github.com/Linaro/poplar-arm-trusted-firmware.git 60*4882a593Smuzhiyun 61*4882a593Smuzhiyun commit 6ac42dd3be13c99aa8ce29a15073e2f19d935f68 62*4882a593Smuzhiyun Author: Alex Elder <elder@linaro.org> 63*4882a593Smuzhiyun Date: Fri Jun 16 09:24:50 2017 -0500 64*4882a593Smuzhiyun 65*4882a593Smuzhiyun poplar: define memory regions in a separate file 66*4882a593Smuzhiyun 67*4882a593Smuzhiyun Separate the definitions for memory regions used for the BL stage 68*4882a593Smuzhiyun images and FIP into a new file. The "l-loader" image uses knowledge 69*4882a593Smuzhiyun of the sizes and locations of these memory regions, and it can now 70*4882a593Smuzhiyun include this (external) header to get these definitions, rather than 71*4882a593Smuzhiyun having to make coordinated changes to both code bases. 72*4882a593Smuzhiyun 73*4882a593Smuzhiyun The new file has a complete set of definitions (more than may be 74*4882a593Smuzhiyun required by one or the other user). It also includes a summary of 75*4882a593Smuzhiyun how the boot process works, and how it uses these regions. 76*4882a593Smuzhiyun 77*4882a593Smuzhiyun It should now be relatively easy to adjust the sizes and locations 78*4882a593Smuzhiyun of these memory regions, or to add to them (e.g. for TEE). 79*4882a593Smuzhiyun 80*4882a593Smuzhiyun Signed-off-by: Alex Elder <elder@linaro.org> 81*4882a593Smuzhiyun 82*4882a593Smuzhiyun 83*4882a593SmuzhiyunCompile from source: 84*4882a593Smuzhiyun==================== 85*4882a593Smuzhiyun 86*4882a593SmuzhiyunGet all the sources 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun > mkdir -p ~/poplar/src ~/poplar/bin 89*4882a593Smuzhiyun > cd ~/poplar/src 90*4882a593Smuzhiyun > git clone https://github.com/Linaro/poplar-l-loader.git l-loader 91*4882a593Smuzhiyun > git clone https://github.com/Linaro/poplar-arm-trusted-firmware.git atf 92*4882a593Smuzhiyun > git clone https://github.com/Linaro/poplar-u-boot.git u-boot 93*4882a593Smuzhiyun 94*4882a593SmuzhiyunMake sure you are using the correct branch on each one of these repositories. 95*4882a593SmuzhiyunThe definition of "correct" might change over time (at this moment in time this 96*4882a593Smuzhiyunwould be the "latest" branch). 97*4882a593Smuzhiyun 98*4882a593SmuzhiyunCompile U-Boot: 99*4882a593Smuzhiyun=============== 100*4882a593Smuzhiyun 101*4882a593Smuzhiyun Prerequisite: 102*4882a593Smuzhiyun # sudo apt-get install device-tree-compiler 103*4882a593Smuzhiyun 104*4882a593Smuzhiyun > cd ~/poplar/src/u-boot 105*4882a593Smuzhiyun > make CROSS_COMPILE=aarch64-linux-gnu- poplar_defconfig 106*4882a593Smuzhiyun > make CROSS_COMPILE=aarch64-linux-gnu- 107*4882a593Smuzhiyun > cp u-boot.bin ~/poplar/bin 108*4882a593Smuzhiyun 109*4882a593SmuzhiyunCompile ARM Trusted Firmware (ATF): 110*4882a593Smuzhiyun=================================== 111*4882a593Smuzhiyun 112*4882a593Smuzhiyun > cd ~/poplar/src/atf 113*4882a593Smuzhiyun > make CROSS_COMPILE=aarch64-linux-gnu- all fip \ 114*4882a593Smuzhiyun SPD=none BL33=~/poplar/bin/u-boot.bin DEBUG=1 PLAT=poplar 115*4882a593Smuzhiyun 116*4882a593SmuzhiyunCopy resulting binaries 117*4882a593Smuzhiyun > cp build/hi3798cv200/debug/bl1.bin ~/poplar/src/l-loader/atf/ 118*4882a593Smuzhiyun > cp build/hi3798cv200/debug/fip.bin ~/poplar/src/l-loader/atf/ 119*4882a593Smuzhiyun 120*4882a593SmuzhiyunCompile l-loader: 121*4882a593Smuzhiyun================= 122*4882a593Smuzhiyun 123*4882a593Smuzhiyun > cd ~/poplar/src/l-loader 124*4882a593Smuzhiyun > make clean 125*4882a593Smuzhiyun > make CROSS_COMPILE=arm-linux-gnueabi- 126*4882a593Smuzhiyun 127*4882a593Smuzhiyun Due to BootROM requiremets, rename l-loader.bin to fastboot.bin: 128*4882a593Smuzhiyun > cp l-loader.bin ~/poplar/bin/fastboot.bin 129*4882a593Smuzhiyun 130*4882a593Smuzhiyun 131*4882a593Smuzhiyun================================================================================ 132*4882a593Smuzhiyun FLASH INSTRUCTIONS 133*4882a593Smuzhiyun================================================================================ 134*4882a593Smuzhiyun 135*4882a593SmuzhiyunTwo methods: 136*4882a593Smuzhiyun 137*4882a593SmuzhiyunUsing USB debrick support: 138*4882a593Smuzhiyun Copy fastboot.bin to a FAT partition on the USB drive and reboot the 139*4882a593Smuzhiyun poplar board while pressing S3(usb_boot). 140*4882a593Smuzhiyun 141*4882a593Smuzhiyun The system will execute the new u-boot and boot into a shell which you 142*4882a593Smuzhiyun can then use to write to eMMC. 143*4882a593Smuzhiyun 144*4882a593SmuzhiyunUsing U-BOOT from shell: 145*4882a593Smuzhiyun 1) using AXIS usb ethernet dongle and tftp 146*4882a593Smuzhiyun 2) using FAT formated USB drive 147*4882a593Smuzhiyun 148*4882a593Smuzhiyun 149*4882a593Smuzhiyun1. TFTP (USB ethernet dongle) 150*4882a593Smuzhiyun============================= 151*4882a593Smuzhiyun 152*4882a593SmuzhiyunPlug a USB AXIS ethernet dongle on any of the USB2 ports on the Poplar board. 153*4882a593SmuzhiyunCopy fastboot.bin to your tftp server. 154*4882a593SmuzhiyunIn u-boot make sure your network is properly setup. 155*4882a593Smuzhiyun 156*4882a593SmuzhiyunThen 157*4882a593Smuzhiyun 158*4882a593Smuzhiyun=> tftp 0x30000000 fastboot.bin 159*4882a593Smuzhiyunstarting USB... 160*4882a593SmuzhiyunUSB0: USB EHCI 1.00 161*4882a593Smuzhiyunscanning bus 0 for devices... 1 USB Device(s) found 162*4882a593SmuzhiyunUSB1: USB EHCI 1.00 163*4882a593Smuzhiyunscanning bus 1 for devices... 3 USB Device(s) found 164*4882a593Smuzhiyun scanning usb for storage devices... 0 Storage Device(s) found 165*4882a593Smuzhiyun scanning usb for ethernet devices... 1 Ethernet Device(s) found 166*4882a593SmuzhiyunWaiting for Ethernet connection... done. 167*4882a593SmuzhiyunUsing asx0 device 168*4882a593SmuzhiyunTFTP from server 192.168.1.4; our IP address is 192.168.1.10 169*4882a593SmuzhiyunFilename 'poplar/fastboot.bin'. 170*4882a593SmuzhiyunLoad address: 0x30000000 171*4882a593SmuzhiyunLoading: ################################################################# 172*4882a593Smuzhiyun ################################################################# 173*4882a593Smuzhiyun ############################################################### 174*4882a593Smuzhiyun 2 MiB/s 175*4882a593Smuzhiyundone 176*4882a593SmuzhiyunBytes transferred = 983040 (f0000 hex) 177*4882a593Smuzhiyun 178*4882a593Smuzhiyun=> mmc write 0x30000000 0 0x780 179*4882a593Smuzhiyun 180*4882a593SmuzhiyunMMC write: dev # 0, block # 0, count 1920 ... 1920 blocks written: OK 181*4882a593Smuzhiyun=> reset 182*4882a593Smuzhiyun 183*4882a593Smuzhiyun 184*4882a593Smuzhiyun2. USING USB FAT DRIVE 185*4882a593Smuzhiyun======================= 186*4882a593Smuzhiyun 187*4882a593SmuzhiyunCopy fastboot.bin to any partition on a FAT32 formated usb flash drive. 188*4882a593SmuzhiyunEnter the uboot prompt 189*4882a593Smuzhiyun 190*4882a593Smuzhiyun=> fatls usb 0:2 191*4882a593Smuzhiyun 983040 fastboot.bin 192*4882a593Smuzhiyun 193*4882a593Smuzhiyun1 file(s), 0 dir(s) 194*4882a593Smuzhiyun 195*4882a593Smuzhiyun=> fatload usb 0:2 0x30000000 fastboot.bin 196*4882a593Smuzhiyunreading fastboot.bin 197*4882a593Smuzhiyun983040 bytes read in 44 ms (21.3 MiB/s) 198*4882a593Smuzhiyun 199*4882a593Smuzhiyun=> mmc write 0x30000000 0 0x780 200*4882a593Smuzhiyun 201*4882a593SmuzhiyunMMC write: dev # 0, block # 0, count 1920 ... 1920 blocks written: OK 202*4882a593Smuzhiyun 203*4882a593Smuzhiyun 204*4882a593Smuzhiyun================================================================================ 205*4882a593Smuzhiyun BOOT TRACE 206*4882a593Smuzhiyun================================================================================ 207*4882a593Smuzhiyun 208*4882a593SmuzhiyunBootrom start 209*4882a593SmuzhiyunBoot Media: eMMC 210*4882a593SmuzhiyunDecrypt auxiliary code ...OK 211*4882a593Smuzhiyun 212*4882a593Smuzhiyunlsadc voltage min: 000000FE, max: 000000FF, aver: 000000FE, index: 00000000 213*4882a593Smuzhiyun 214*4882a593SmuzhiyunEntry boot auxiliary code 215*4882a593Smuzhiyun 216*4882a593SmuzhiyunAuxiliary code - v1.00 217*4882a593SmuzhiyunDDR code - V1.1.2 20160205 218*4882a593SmuzhiyunBuild: Mar 24 2016 - 17:09:44 219*4882a593SmuzhiyunReg Version: v134 220*4882a593SmuzhiyunReg Time: 2016/03/18 09:44:55 221*4882a593SmuzhiyunReg Name: hi3798cv2dmb_hi3798cv200_ddr3_2gbyte_8bitx4_4layers.reg 222*4882a593Smuzhiyun 223*4882a593SmuzhiyunBoot auxiliary code success 224*4882a593SmuzhiyunBootrom success 225*4882a593Smuzhiyun 226*4882a593SmuzhiyunLOADER: Switched to aarch64 mode 227*4882a593SmuzhiyunLOADER: Entering ARM TRUSTED FIRMWARE 228*4882a593SmuzhiyunLOADER: CPU0 executes at 0x000ce000 229*4882a593Smuzhiyun 230*4882a593SmuzhiyunINFO: BL1: 0xe1000 - 0xe7000 [size = 24576] 231*4882a593SmuzhiyunNOTICE: Booting Trusted Firmware 232*4882a593SmuzhiyunNOTICE: BL1: v1.3(debug):v1.3-372-g1ba9c60 233*4882a593SmuzhiyunNOTICE: BL1: Built : 17:51:33, Apr 30 2017 234*4882a593SmuzhiyunINFO: BL1: RAM 0xe1000 - 0xe7000 235*4882a593SmuzhiyunINFO: BL1: Loading BL2 236*4882a593SmuzhiyunINFO: Loading image id=1 at address 0xe9000 237*4882a593SmuzhiyunINFO: Image id=1 loaded at address 0xe9000, size = 0x5008 238*4882a593SmuzhiyunNOTICE: BL1: Booting BL2 239*4882a593SmuzhiyunINFO: Entry point address = 0xe9000 240*4882a593SmuzhiyunINFO: SPSR = 0x3c5 241*4882a593SmuzhiyunNOTICE: BL2: v1.3(debug):v1.3-372-g1ba9c60 242*4882a593SmuzhiyunNOTICE: BL2: Built : 17:51:33, Apr 30 2017 243*4882a593SmuzhiyunINFO: BL2: Loading BL31 244*4882a593SmuzhiyunINFO: Loading image id=3 at address 0x129000 245*4882a593SmuzhiyunINFO: Image id=3 loaded at address 0x129000, size = 0x8038 246*4882a593SmuzhiyunINFO: BL2: Loading BL33 247*4882a593SmuzhiyunINFO: Loading image id=5 at address 0x37000000 248*4882a593SmuzhiyunINFO: Image id=5 loaded at address 0x37000000, size = 0x58f17 249*4882a593SmuzhiyunNOTICE: BL1: Booting BL31 250*4882a593SmuzhiyunINFO: Entry point address = 0x129000 251*4882a593SmuzhiyunINFO: SPSR = 0x3cd 252*4882a593SmuzhiyunINFO: Boot bl33 from 0x37000000 for 364311 Bytes 253*4882a593SmuzhiyunNOTICE: BL31: v1.3(debug):v1.3-372-g1ba9c60 254*4882a593SmuzhiyunNOTICE: BL31: Built : 17:51:33, Apr 30 2017 255*4882a593SmuzhiyunINFO: BL31: Initializing runtime services 256*4882a593SmuzhiyunINFO: BL31: Preparing for EL3 exit to normal world 257*4882a593SmuzhiyunINFO: Entry point address = 0x37000000 258*4882a593SmuzhiyunINFO: SPSR = 0x3c9 259*4882a593Smuzhiyun 260*4882a593Smuzhiyun 261*4882a593SmuzhiyunU-Boot 2017.05-rc2-00130-gd2255b0 (Apr 30 2017 - 17:51:28 +0200)poplar 262*4882a593Smuzhiyun 263*4882a593SmuzhiyunModel: HiSilicon Poplar Development Board 264*4882a593SmuzhiyunBOARD: Hisilicon HI3798cv200 Poplar 265*4882a593SmuzhiyunDRAM: 1 GiB 266*4882a593SmuzhiyunMMC: Hisilicon DWMMC: 0 267*4882a593SmuzhiyunIn: serial@f8b00000 268*4882a593SmuzhiyunOut: serial@f8b00000 269*4882a593SmuzhiyunErr: serial@f8b00000 270*4882a593SmuzhiyunNet: Net Initialization Skipped 271*4882a593SmuzhiyunNo ethernet found. 272*4882a593Smuzhiyun 273*4882a593SmuzhiyunHit any key to stop autoboot: 0 274*4882a593Smuzhiyunstarting USB... 275*4882a593SmuzhiyunUSB0: USB EHCI 1.00 276*4882a593Smuzhiyunscanning bus 0 for devices... 1 USB Device(s) found 277*4882a593SmuzhiyunUSB1: USB EHCI 1.00 278*4882a593Smuzhiyunscanning bus 1 for devices... 4 USB Device(s) found 279*4882a593Smuzhiyun scanning usb for storage devices... 1 Storage Device(s) found 280*4882a593Smuzhiyun scanning usb for ethernet devices... 1 Ethernet Device(s) found 281*4882a593Smuzhiyun 282*4882a593SmuzhiyunUSB device 0: 283*4882a593Smuzhiyun Device 0: Vendor: SanDisk Rev: 1.00 Prod: Cruzer Blade 284*4882a593Smuzhiyun Type: Removable Hard Disk 285*4882a593Smuzhiyun Capacity: 7632.0 MB = 7.4 GB (15630336 x 512) 286*4882a593Smuzhiyun... is now current device 287*4882a593SmuzhiyunScanning usb 0:1... 288*4882a593Smuzhiyun=> 289