From patchwork Wed Jul 29 21:39:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 51675 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id A0FD122DB5 for ; Wed, 29 Jul 2015 21:40:01 +0000 (UTC) Received: by wixh2 with SMTP id h2sf11511733wix.0 for ; Wed, 29 Jul 2015 14:40:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=vi0zZJzv/5Hr03qkFUCM5JAOwbQV07teW80aoYjlEO4=; b=QQdPkjtAMqcPGA6fEBUhfzOI4l967wjHK3wfBe10aL//zY5bY1n5uGxmOKZztG6akk ZQkAA1cI+kD+elcdk+2tKk74ScnumYA0nGtQUgiMFDOJ5xWST4c+88gEBpwqoQt9zRYd 6exLttQYnPap2yoko5h/LO/bm4DnedmFYlp5kcGnosl5WrJEQwSZTSu83kc3Q0JKS/Kz 6e1uoujH/UQsD5+0WWzZRFte6FtDBr4CBZ7+NDkXyqlC8opSQuMo324/FR+WdpnyjTv+ qypulKDF8IOVy2+OA0JhkM7pps7RpGDiXdiw4y+xr9q4/z9sgi7MFs/vNjBPfhzBOIHp eYqQ== X-Gm-Message-State: ALoCoQlZziFLZRcF4J/EaQSr7HRykUQA3wFSx4io2w6JltYp//s7/xCWeOY7xionkUR+U+TKsBVF X-Received: by 10.194.5.229 with SMTP id v5mr16677697wjv.0.1438206001000; Wed, 29 Jul 2015 14:40:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.76 with SMTP id lm12ls105341lac.109.gmail; Wed, 29 Jul 2015 14:40:00 -0700 (PDT) X-Received: by 10.152.18.194 with SMTP id y2mr40443616lad.5.1438206000834; Wed, 29 Jul 2015 14:40:00 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id an8si22588480lac.79.2015.07.29.14.40.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2015 14:40:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbyj8 with SMTP id yj8so15519340lbb.0 for ; Wed, 29 Jul 2015 14:40:00 -0700 (PDT) X-Received: by 10.152.1.66 with SMTP id 2mr41919052lak.56.1438206000697; Wed, 29 Jul 2015 14:40:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.7.198 with SMTP id l6csp120050lba; Wed, 29 Jul 2015 14:40:00 -0700 (PDT) X-Received: by 10.181.11.229 with SMTP id el5mr21101073wid.40.1438205995917; Wed, 29 Jul 2015 14:39:55 -0700 (PDT) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com. [209.85.212.173]) by mx.google.com with ESMTPS id em11si46204049wjd.52.2015.07.29.14.39.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2015 14:39:55 -0700 (PDT) Received-SPF: pass (google.com: domain of peter.griffin@linaro.org designates 209.85.212.173 as permitted sender) client-ip=209.85.212.173; Received: by wibxm9 with SMTP id xm9so219173941wib.0 for ; Wed, 29 Jul 2015 14:39:55 -0700 (PDT) X-Received: by 10.180.105.98 with SMTP id gl2mr22020471wib.56.1438205995643; Wed, 29 Jul 2015 14:39:55 -0700 (PDT) Received: from localhost.localdomain (cpc14-aztw22-2-0-cust189.18-1.cable.virginm.net. [82.45.1.190]) by smtp.gmail.com with ESMTPSA id h9sm40559615wjx.20.2015.07.29.14.39.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Jul 2015 14:39:55 -0700 (PDT) From: Peter Griffin To: u-boot@lists.denx.de, albert.u.boot@aribaud.net, trini@konsulko.com, panto@antoniou-consulting.com, marex@denx.de, sjg@chromium.org, robherring2@gmail.com Cc: Peter Griffin Subject: [PATCH v3 8/8] ARM64: hikey: Add a README for this board. Date: Wed, 29 Jul 2015 22:39:36 +0100 Message-Id: <1438205976-11105-9-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438205976-11105-1-git-send-email-peter.griffin@linaro.org> References: <1438205976-11105-1-git-send-email-peter.griffin@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.griffin@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , To help others with compiling and flashing ATF and u-boot add a README for this board. Signed-off-by: Peter Griffin --- board/hisilicon/hikey/README | 160 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 board/hisilicon/hikey/README diff --git a/board/hisilicon/hikey/README b/board/hisilicon/hikey/README new file mode 100644 index 0000000..25c8143 --- /dev/null +++ b/board/hisilicon/hikey/README @@ -0,0 +1,160 @@ +Introduction +============ + +HiKey is the first certified 96Boards Consumer Edition board. The board/SoC has: - +* HiSilicon Kirin 6220 eight-core ARM Cortex-A53 64-bit SoC running at 1.2GHz. +* ARM Mali 450-MP4 GPU +* 1GB 800MHz LPDDR3 DRAM +* 4GB eMMC Flash Storage +* microSD +* 802.11a/b/g/n WiFi, Bluetooth + +The HiKey schematic can be found here: - +https://github.com/96boards/documentation/blob/master/hikey/96Boards-Hikey-Rev-A1.pdf + +A SoC datasheet can be found here: - +https://github.com/96boards/documentation/blob/master/hikey/ +Hi6220V100_Multi-Mode_Application_Processor_Function_Description.pdf + +Currently the u-boot port supports: - +* USB +* eMMC +* SD card +* GPIO + +Compile u-boot +============== + +make CROSS_COMPILE=aarch64-linux-gnu- hikey_config +make CROSS_COMPILE=aarch64-linux-gnu- + +ARM Trusted Firmware (ATF) & l-loader +===================================== + +This u-boot port has been tested with l-loader, booting ATF, which then boots +u-boot as the bl33.bin executable. + +1. Get ATF source code +git clone https://github.com/96boards/arm-trusted-firmware.git + +2. Compile ATF I use the makefile here +http://people.linaro.org/~peter.griffin/hikey/hikey-u-boot-release_r1/build-tf.mak + +3. Get l-loader +git clone https://github.com/96boards/l-loader.git + +4. Make sym links to ATF bip / fip binaries +ln -s /home/griffinp/aarch64/bl1-hikey.bin bl1.bin +ln -s /home/griffinp/aarch64/fip-hikey.bin fip.bin + +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 l-loader.bin --img_loader=temp --img_bl1=bl1.bin +sudo bash -x generate_ptable.sh +python gen_loader.py -o ptable.img --img_prm_ptable=prm_ptable.img --img_sec_ptable=sec_ptable.img + +These instructions are adapted from +https://github.com/96boards/documentation/wiki/HiKeyUEFI + +FLASHING +======== + +1. Connect jumper J2 to go into recovery mode and flash l-loader.bin with + fastboot using the hisi-idt.py utility + +> git clone https://github.com/96boards/burn-boot.git +> sudo python /home/griffinp/Software/hikey/burn-boot/hisi-idt.py -d /dev/ttyUSB0 --img1=/tmp/l-loader.bin + +2. Once LED 0 comes on solid, it should be detected as a fastboot device + (on some boards I've found this to be unreliable) + +sudo fastboot devices + +3. Flash the images +wget https://builds.96boards.org/releases/hikey/nvme.img +sudo fastboot flash ptable ptable.img +sudo fastboot flash fastboot fip.bin +sudo fastboot flash nvme nvme.img + +4. Disconnect jumper J2, 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 + flashing twice in the past to avoid an ATF error. + +See working boot trace below: - + +debug EMMC boot: print init OK +debug EMMC boot: send RST_N . +debug EMMC boot: start eMMC boot...... +load fastboot1! +Switch to aarch64 mode. CPU0 executes at 0xf9801000! +NOTICE: Booting Trusted Firmware +NOTICE: BL1: v1.1(release):a0c0399 +NOTICE: BL1: Built : 13:23:48, May 22 2015 +NOTICE: succeed to init lpddr3 rank0 dram phy +INFO: lpddr3_freq_init, set ddrc 533mhz +INFO: init ddr3 rank0 +INFO: ddr3 rank1 init pass +INFO: lpddr3_freq_init, set ddrc 800mhz +INFO: init ddr3 rank0 +INFO: ddr3 rank1 init pass +INFO: Elpida DDR +NOTICE: BL1: Booting BL2 +INFO: [BDID] [fff91c18] midr: 0x410fd033 +INFO: [BDID] [fff91c1c] board type: 0 +INFO: [BDID] [fff91c20] board id: 0x2b +INFO: init_acpu_dvfs: pmic version 17 +INFO: init_acpu_dvfs: ACPU_CHIP_MAX_FREQ=0x186a00. +INFO: acpu_dvfs_volt_init: success! +INFO: acpu_dvfs_set_freq: support freq num is 5 +INFO: acpu_dvfs_set_freq: start prof is 0x4 +INFO: acpu_dvfs_set_freq: magic is 0x5a5ac5c5 +INFO: acpu_dvfs_set_freq: voltage: +INFO: - 0: 0x3a +INFO: - 1: 0x3a +INFO: - 2: 0x4a +INFO: - 3: 0x5b +INFO: - 4: 0x6b +NOTICE: acpu_dvfs_set_freq: set acpu freq success!NOTICE: BL2: v1.1(debug):a0c0399 +NOTICE: BL2: Built : 10:19:28, May 27 2015 +INFO: BL2: Loading BL3-0 +INFO: Using FIP +WARNING: Failed to access image 'bl30.bin' (-1) +ERROR: Failed to load BL3-0 (-1) +ERROR: Please burn mcu image: +ERROR: sudo fastboot flash mcuimage mcuimage.bin +INFO: BL2: TrustZone: protecting 16777216 bytes of memory at 0x3f000000 +INFO: BL2: Loading BL3-1 +INFO: Using FIP +INFO: Loading file 'bl31.bin' at address 0xf9858000 +INFO: File 'bl31.bin' loaded: 0xf9858000 - 0xf9860010 +INFO: BL2: Loading BL3-2 +INFO: Using FIP +WARNING: Failed to access image 'bl32.bin' (-1) +WARNING: Failed to load BL3-2 (-1) +INFO: BL2: Loading BL3-3 +INFO: Using FIP +INFO: Loading file 'bl33.bin' at address 0x35000000 +INFO: File 'bl33.bin' loaded: 0x35000000 - 0x35042938 +NOTICE: BL1: Booting BL3-1 +NOTICE: BL3-1: v1.1(debug):a0c0399 +NOTICE: BL3-1: Built : 10:19:31, May 27 2015 +INFO: BL3-1: Initializing runtime services +INFO: BL3-1: Preparing for EL3 exit to normal world +INFO: BL3-1: Next image address = 0x35000000 +INFO: BL3-1: Next image spsr = 0x3c9 + + +U-Boot 2015.04-00007-g1b3d379-dirty (May 27 2015 - 10:18:16) hikey + +DRAM: 1008 MiB +MMC: sd_card_detect: SD card present +HiKey DWMMC: 0, HiKey DWMMC: 1 +In: serial +Out: serial +Err: serial +Net: Net Initialization Skipped +No ethernet found. +Hit any key to stop autoboot: 0