Giter VIP home page Giter VIP logo

Comments (6)

vchong avatar vchong commented on July 26, 2024

@sherrellbc That wiki is outdated. You can still follow it to install the custom toolchain, which is required. Then:

UEFI_TOOLS_GIT_URL=https://git.linaro.org/uefi/uefi-tools.git
UEFI_TOOLS_GIT_BRANCH=master
EDK2_GIT_URL=https://github.com/96boards-hikey/edk2.git
EDK2_GIT_VERSION="origin/hikey-aosp"
ATF_GIT_URL=https://github.com/96boards-hikey/arm-trusted-firmware.git
ATF_GIT_VERSION="origin/hikey"
OPEN_PLATFORM_PKG_GIT_URL=https://github.com/96boards-hikey/OpenPlatformPkg.git
OPEN_PLATFORM_PKG_GIT_BRANCH=hikey-aosp
OPTEE_OS_GIT_URL=https://github.com/OP-TEE/optee_os.git
OPTEE_GIT_VERSION=master

export AARCH64_TOOLCHAIN=GCC49

git clone -b $UEFI_TOOLS_GIT_BRANCH $UEFI_TOOLS_GIT_URL uefi-tools

git clone $EDK2_GIT_URL edk2
cd edk2
git checkout -b stable-baseline $EDK2_GIT_VERSION
cd ..

git clone -b $OPEN_PLATFORM_PKG_GIT_BRANCH $OPEN_PLATFORM_PKG_GIT_URL OpenPlatformPkg

cd edk2
rm -rf OpenPlatformPkg
ln -s ../OpenPlatformPkg
cd ..

git clone $ATF_GIT_URL arm-trusted-firmware
cd arm-trusted-firmware
git checkout -b stable-baseline $ATF_GIT_VERSION
cd ..

git clone $OPTEE_OS_GIT_URL optee_os
cd optee_os
git checkout -b stable-baseline $OPTEE_GIT_VERSION
cd ..

export EDK2_DIR=${PWD}/edk2
export ATF_DIR=${PWD}/arm-trusted-firmware
export OPTEE_OS_DIR=${PWD}/optee_os
export UEFI_TOOLS_DIR=${PWD}/uefi-tools

cd ${EDK2_DIR}
bash -x ${UEFI_TOOLS_DIR}/uefi-build.sh -T GCC49 -b RELEASE -a ${ATF_DIR} -s ${OPTEE_OS_DIR} hikey

from documentation.

sherrellbc avatar sherrellbc commented on July 26, 2024

@vchong
These updates seem to almost work. I had to remove the ${WORKSPACE} and ${BUILD_NUMBER} references; I just replaced both with one ${PWD}.

The first compilation error I mentioned is still a problem (but manually fixable)


g++  -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/   -c -o VfrUtilityLib.o VfrUtilityLib.cpp
VfrUtilityLib.cpp: In member function β€˜CHAR8* CVfrStringDB::GetVarStoreNameFormStringId(EFI_STRING_ID)’:
VfrUtilityLib.cpp:3287:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if (mStringFileName == '\0' ) {
                          ^~~~
make[2]: *** [<builtin>: VfrUtilityLib.o] Error 1

The master branch of l-loader does not have a debug.S, so the final binary will not be generated. The following commands will fail:

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

I just removed the debug.o dependency and the build properly finished.

However, the hikey branch does have this source file. Of course, debugging would be useful. Aside from the debug printing, start.S looked to be identical in both the master and hikey branches. I copied debug.S, start.S, and serial_pl011.h from hikey into master and the build went through.

I tried to build from the hikey branch but gen_loader.py will fail with:

Traceback (most recent call last):
  File "gen_loader.py", line 263, in <module>
    main(sys.argv[1:])
  File "gen_loader.py", line 258, in main
    loader.create_stage2(img_prm_ptable, img_sec_ptable, output_img)
UnboundLocalError: local variable 'img_sec_ptable' referenced before assignment

Taking a peek into this file shows that if --img_prm_ptable is passed then stage2 is set to 1. Then, since stage2=1, this method is called with an uninitialized img_sec_ptable.

Seems like master fixed this by adding these two lines.

Also, there are confusingly two l-loader repos. One owned by 96boards-hikey and the other just by 96boards. Your instructions use the former, so I assume that is the correct one?

from documentation.

vchong avatar vchong commented on July 26, 2024

These updates seem to almost work. I had to remove the ${WORKSPACE} and ${BUILD_NUMBER} references; I just replaced both with one ${PWD}.

Ah sorry, copy paste error. I've updated the instructions.

Regarding l-loader, I understand your confusion, but I believe that the program is small enough that as long as you manage to get it to build, you can use any one of the methods that worked for you.

Actually (and hopefully this doesn't add to the confusion :s) I just remembered there's a 'newer' set of instructions here: https://github.com/Linaro/documentation/blob/master/Reference-Platform/Releases/RPB_16.06/ConsumerEdition/HiKey/BuildSourceBL.md, and for l-loader all that you need to do should just be to run make!

from documentation.

sherrellbc avatar sherrellbc commented on July 26, 2024

@vchong Perfect. Thanks for the updates! I've had bit of trouble flashing the device (HiKey) properly, though. It seems the flasher is a bit unreliable. The first time it failed, the second time completed properly but the filesystem was corrupted, and then a third time it succeeded and I was able to boot (but still with a few fsck-related errors in the boot log).

However, the build documentation works as expected. This issue can be closed as far as I'm concerned!

from documentation.

vchong avatar vchong commented on July 26, 2024

Are you flashing from what we call 'uefi' mode, i.e. jumpers 1-2 5-6 closed? For flashing the system/rootfs, flashing from 'recovery' mode, i.e. jumpers 1-2 3-4 closed seems to be much better. The only thing is you've to go through the trouble of running hisi-idt first, i.e.

$ sudo python hisi-idt.py -d /dev/ttyUSB0 --img1=l-loader.bin (again, remember ttyUSB* can change)
$ sudo fastboot flash ptable ptable-linux-8g.img (or 4g)
$ sudo fastboot flash fastboot fip.bin
$ sudo fastboot flash nvme nvme.img
$ sudo fastboot flash boot boot-fat.uefi.img (boot image file name can change based on build)
$ sudo fastboot flash system rootfs.img (this is not in the link below but you can do this from here as well)

re: https://github.com/96boards/documentation/blob/master/ConsumerEdition/HiKey/Installation/BoardRecovery.md

from documentation.

fixxxxxxer avatar fixxxxxxer commented on July 26, 2024

@vchong , what is the status of this issue?

Can we label and/or close? Please :)

Thanks!

from documentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.