From patchwork Wed Apr 20 16:14:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 66225 Delivered-To: patches@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2540712qge; Wed, 20 Apr 2016 09:14:21 -0700 (PDT) X-Received: by 10.194.107.36 with SMTP id gz4mr9570344wjb.33.1461168861489; Wed, 20 Apr 2016 09:14:21 -0700 (PDT) Return-Path: Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com. [2a00:1450:400c:c09::231]) by mx.google.com with ESMTPS id he1si6773205wjc.187.2016.04.20.09.14.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Apr 2016 09:14:21 -0700 (PDT) Received-SPF: pass (google.com: domain of peter.griffin@linaro.org designates 2a00:1450:400c:c09::231 as permitted sender) client-ip=2a00:1450:400c:c09::231; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of peter.griffin@linaro.org designates 2a00:1450:400c:c09::231 as permitted sender) smtp.mailfrom=peter.griffin@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-wm0-x231.google.com with SMTP id n3so90311236wmn.0 for ; Wed, 20 Apr 2016 09:14:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MT0Fmpzd/lOLSECn3jIbjgyJxnkw0UGpncjtmXHzsRY=; b=e8XT2ZTj6tM/7Bgj/0U0QOeVowFAjfalDdHkTPneIqtMn6CFE9y7lduomegry8R9ix Z+1+es6aQJx0gabPMm8Q5TlZWs1ZXqYZCodiSde4j8Jpol8zA+o+I7pcEB4R8GFaxJPV x8Yuonlfj8UHana6ilXsDPMDYMfoEebiRF9DM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MT0Fmpzd/lOLSECn3jIbjgyJxnkw0UGpncjtmXHzsRY=; b=P39CP9vzeOVkf2Gi52vcx12w8RceM0cw1cC63OgA8+oVH6o7HcDfChKjXlj1QOxAts NFaFK6B5aDYXb9DiMbZkmh5XXUATRTjg9CSXreXj2l+/N3e3GS/ph9PHf7aeABy2q0Gg TUt7xRH8j4B4ZNQrSlYlZtBAWeRp3yS7gHgPTXMtO1+3TBP0xiAHy2BXJyy3sVX9lyQt HTV1seSmFTjPMBHaN1KZtRDtDGqHw6ym7wNWh4Z4Af/53Ev1LlXuSCOSTICIZc7tpO5N 2Ghh2f4opmn8G90poK3DzBdczwZe6BlziXsnVtjjGgtssV3So9p6VGdllWughsheZvxZ p/iA== X-Gm-Message-State: AOPr4FVHbiek2Tw0bsj/uxFQd1LDY1iNxAtRHaF7xQNI96Phxx04F7qOUDwb1qfNeJyD1QfxpjA= X-Received: by 10.194.246.137 with SMTP id xw9mr10232579wjc.172.1461168861182; Wed, 20 Apr 2016 09:14:21 -0700 (PDT) Return-Path: Received: from localhost.localdomain (cpc84787-aztw28-2-0-cust15.18-1.cable.virginm.net. [82.37.140.16]) by smtp.gmail.com with ESMTPSA id da5sm6353845wjb.25.2016.04.20.09.14.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Apr 2016 09:14:20 -0700 (PDT) From: Peter Griffin To: u-boot@lists.denx.de, albert.u.boot@aribaud.net, sjg@chromium.org, agraf@suse.de, trini@konsulko.com, liming.wang@canonical.com Cc: Peter Griffin Subject: [PATCH 7/7] ARM: hikey: Simplify README instructions. Date: Wed, 20 Apr 2016 17:14:03 +0100 Message-Id: <1461168843-15610-8-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461168843-15610-1-git-send-email-peter.griffin@linaro.org> References: <1461168843-15610-1-git-send-email-peter.griffin@linaro.org> This patch updates and simplifies the hikey README. The old instructions were hard to follow, and convoluted. This patch also updates the link to the mcuimage.bin which was outdated. Using an outdated mcuimage.bin results in the additional a53 cores not coming online when the kernel issues PSCI requests to arm trusted firmware (ATF). Signed-off-by: Peter Griffin --- board/hisilicon/hikey/README | 95 +++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 46 deletions(-) -- 1.9.1 diff --git a/board/hisilicon/hikey/README b/board/hisilicon/hikey/README index 36adbdb..0f6aab7 100644 --- a/board/hisilicon/hikey/README +++ b/board/hisilicon/hikey/README @@ -22,50 +22,55 @@ Currently the u-boot port supports: - * SD card * GPIO -Compile u-boot -============== +The HiKey U-Boot port has been tested with l-loader, booting ATF, which then boots +U-Boot as the bl33.bin executable. - > mkdir -p ./aarch64/bin - > cd ./aarch64 - > git clone http://git.denx.de/u-boot.git - > make CROSS_COMPILE=aarch64-linux-gnu- hikey_config - > make CROSS_COMPILE=aarch64-linux-gnu- - > cp u-boot.bin ./aarch64/bin/u-boot-hikey.bin +Compile from source +=================== -ARM Trusted Firmware (ATF) & l-loader -===================================== +First get all the sources -This u-boot port has been tested with l-loader, booting ATF, which then boots -u-boot as the bl33.bin executable. + > mkdir -p ~/hikey/src ~/hikey/bin + > cd ~/hikey/src + > git clone https://github.com/96boards/edk2.git + > git clone https://github.com/96boards/arm-trusted-firmware.git + > git clone https://github.com/96boards/l-loader.git + > git clone https://github.com/96boards/burn-boot.git -Get the BL30 mcu binary. - > wget -P aarch64/bin https://builds.96boards.org/releases/hikey/linaro/binaries/15.05/mcuimage.bin +Get the BL30 mcuimage.bin binary. It is shipped as part of the UEFI source. +The latest version can be obtained from the edk2 repo. -1. Get ATF source code - > cd ./aarch64 - > git clone https://github.com/96boards/arm-trusted-firmware.git - > cd ./arm-trusted-firmware + > cp edk2/HisiPkg/HiKeyPkg/NonFree/mcuimage.bin ~/hikey/bin/ -2. Compile ATF, I use the build-tf.mak in the directory with this README, and copy it to ATF directory - > cp ../u-boot/board/hisilicon/hikey/build-tf.mak . - > make -f build-tf.mak build +Get nvme.img binary (check this link is still the latest) + > wget -P ~/hikey/bin https://builds.96boards.org/releases/reference-platform/debian/hikey/16.03/bootloader/nvme.img -3. Get l-loader - > cd ../ - > git clone https://github.com/96boards/l-loader.git - > cd ./l-loader +Compile U-Boot +============== -4. Make sym links to ATF bl1 / fip binaries - > ln -s ../bin/bl1-hikey.bin bl1.bin - > ln -s ../bin/fip-hikey.bin fip.bin + > cd ~/hikey/src/u-boot + > make CROSS_COMPILE=aarch64-linux-gnu- hikey_config + > make CROSS_COMPILE=aarch64-linux-gnu- + > cp u-boot.bin ~/hikey/bin + +Compile ARM Trusted Firmware (ATF) +================================== + + > cd ~/hikey/src/atf + > make CROSS_COMPILE=aarch64-linux-gnu- all fip \ + BL30=~/hikey/bin/mcuimage.bin \ + BL33=~/hikey/bin/u-boot.bin DEBUG=1 PLAT=hikey - > arm-linux-gnueabihf-gcc -c -o start.o start.S - > arm-linux-gnueabihf-gcc -c -o debug.o debug.S - > arm-linux-gnueabihf-ld -Bstatic -Tl-loader.lds -Ttext 0xf9800800 start.o debug.o -o loader - > arm-linux-gnueabihf-objcopy -O binary loader temp - > python gen_loader.py -o ../bin/l-loader.bin --img_loader=temp --img_bl1=bl1.bin - > sudo bash -x generate_ptable.sh - > python gen_loader.py -o ../bin/ptable.img --img_prm_ptable=./prm_ptable.img --img_sec_ptable=./sec_ptable.img +Copy resulting binaries + > cp build/hikey/debug/bl1.bin ~/hikey/bin + > cp build/hikey/debug/fip.bin ~/hikey/bin + +Compile l-loader +=============== + > cd ~/hikey/l-loader + > make BL1=~/hikey/bin/bl1.bin all + > cp *.img ~/hikey/bin + > cp l-loader.bin ~/hikey.bin These instructions are adapted from https://github.com/96boards/documentation/wiki/HiKeyUEFI @@ -74,15 +79,12 @@ FLASHING ======== 1. Connect the second jumper on J15 BOOT SEL, to go into recovery mode and flash l-loader.bin with -fastboot using the hisi-idt.py utility. - - > cd ../ - > git clone https://github.com/96boards/burn-boot.git +the hisi-idt.py utility. The command below assumes HiKey enumerated as the first USB serial port - > sudo ./burn-boot/hisi-idt.py -d /dev/ttyUSB0 --img1=./bin/l-loader.bin + > sudo ~/hikey/burn_boot/hisi-idt.py -d /dev/ttyUSB0 --img1=~/hikey/bin/l-loader.bin -2. Once LED 0 comes on solid, it should be detected as a fastboot device by plugging a USB A to mini B +2. Once LED 0 comes on solid, HiKey board should be detected as a fastboot device by plugging a USB A to mini B cable from your PC to the USB OTG port of HiKey (on some boards I've found this to be unreliable). > sudo fastboot devices @@ -90,10 +92,10 @@ The command below assumes HiKey enumerated as the first USB serial port 0123456789ABCDEF fastboot 3. Flash the images - > wget -P aarch64/bin wget https://builds.96boards.org/releases/hikey/linaro/binaries/latest/nvme.img - > sudo fastboot flash ptable ./bin/ptable.img - > sudo fastboot flash fastboot ./bin/fip-hikey.bin - > sudo fastboot flash nvme ./bin/nvme.img + + > sudo fastboot flash ptable ~/hikey/bin/ptable.img + > sudo fastboot flash fastboot ~/hikey/bin/fip.bin + > sudo fastboot flash nvme ~/hikey/bin/nvme.img 4. Disconnect second jumper on J15 BOOT SEL, and reset the board and you will now (hopefully) have ATF, booting u-boot from eMMC. On 'new' boards I've had to do the @@ -102,7 +104,8 @@ The command below assumes HiKey enumerated as the first USB serial port Note: To get USB host working, also disconnect the USB OTG cable used for flashing. Otherwise you will get 'dwc_otg_core_host_init: Timeout!' errors. -See working boot trace below: - +See working boot trace below (by default trace is now output to UART3 not UART0 on latest +ATF, U-Boot and Kernel sources): - debug EMMC boot: send RST_N . debug EMMC boot: start eMMC boot......