linaro-swg / optee_android_manifest

Android manifest for building OP-TEE in AOSP
38 stars 34 forks source link

Does this repo support hikey960? #45

Closed BeitongT closed 6 years ago

BeitongT commented 6 years ago

Hi, I saw the new commits for initial support for hikey960. Does this repo support hikey960 now?

vchong commented 6 years ago

@BeitongT No. It's work in progress but no scheduled delivery date. In the meantime, please use https://github.com/bsupiot/hikey960-aosp-optee/wiki, which is a contribution from one of our community users. There are some known issues so please contribute back patches if possible. Thanks!

BeitongT commented 6 years ago

Thanks!

vchong commented 6 years ago

You're welcome. I'll close this for now, but when you see instructions on the README for building for hikey960 then you'll know it's ready.

vchong commented 5 years ago

@BeitongT You can try hikey960 build now.

BeitongT commented 5 years ago

Thanks for the update!

On Nov 19, 2018, at 1:45 AM, vchong notifications@github.com wrote:

@BeitongT https://github.com/BeitongT You can try hikey960 build now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/linaro-swg/optee_android_manifest/issues/45#issuecomment-439787818, or mute the thread https://github.com/notifications/unsubscribe-auth/AdJUEcCKhbg8ksAwGC8sbvc61peRnPLTks5uwlOCgaJpZM4YETy8.

BeitongT commented 5 years ago

By the way, I am a new comer to Android. Could you please tell me some methods or give me some ideas on how to connect an Android app with the trusted application in secure world?

vchong commented 5 years ago

@BeitongT Sorry but we don't really have any reference implementation for that since it's not really an OP-TEE related issue. You would connect the App the same way you would connect to any other library. The general advice is to use JNI. You can also look at https://github.com/linaro-swg/optee_android_manifest/issues/31 for an example done by one of our users. Sample code is available there as well. But I think this was done before Treble was implemented so not sure if it'll still work now.

BeitongT commented 5 years ago

thanks!

BeitongT commented 5 years ago

Hi, when I was trying to sync the project. There is an error "error: https://android.googlesourse.com/platform/external/libdrm did not send all necessary objects." It seems that the libdrm is not cloned rightly. Anyone know how to solve this problem?

jforissier commented 5 years ago

googlesourse? With an 's'?

BeitongT commented 5 years ago

sorry it's a typo when I was typing the error message "https://android.googlesource.com/platform/external/libdrm ".

vchong commented 5 years ago

@BeitongT for future references, please open a new issue if it's not related to the original question.

In any case, can you git clone the repo manually? If yes then maybe it's a temporary network issue.

BeitongT commented 5 years ago

thanks! @vchong It works now. After executing "git clone --branch android-9.0.0_r7 https://android.googlesource.com/platform/external/libdrm". Ok, I will open a new issue in the future, thanks!

vchong commented 5 years ago

Why android-9.0.0_r7? We're using master branch for libdrm. If you sync project again now, do you still get the error?

BeitongT commented 5 years ago

I manually clone the /external/libdrm and the build works fine. I use android-9.0.0_r7 because the error shows error: https://android.googlesource.com/platform/external/libdrm did not send all necessary objects error: Could not read 3933a57341a729a424fd6823af0c14fd104b95d1 fatal: bad object 3933a57341a729a424fd6823af0c14fd104b95d1 3933a57341a729a424fd6823af0c14fd104b95d1 is tag for android-9.0.0_r7

vchong commented 5 years ago

Which manifest are you using, and for which board?

BeitongT commented 5 years ago

for HiKey960 ./sync-p-hikey960.sh

I use the Hikey960 board and use the command in the Readme.md directly

vchong commented 5 years ago

Not sure why sync-p-hikey960.sh would generate the error since it should be getting master branch for libdrm. 3933a57341a729a424fd6823af0c14fd104b95d1 is in pinned-manifest-stable_yvr18.xml which shouldn't be used in this case since it's a manifest for hikey only. Can you paste a full log of your sync (including errors) in some pastebin somewhere?

Have you tried flashing your board with the built images, and are they working fine?

BeitongT commented 5 years ago

Sorry, I am not at home now. I will paste the log ASAP.

BeitongT commented 5 years ago

https://pastebin.com/HK1XJniG is the full log for sync. The error is in line 772. Build with android-9.0.0_r7 is successful.

vchong commented 5 years ago

Thanks! Can't really tell what's causing the issue form the log. Did you start from scratch when you run sync-p-hikey960.sh? Or did you run in on an existing source tree? If you delete external/libdrm and try again, do you still get the error?

BeitongT commented 5 years ago

yeah, I get everything from scratch. The libdrm is got from the script. By the way, I cannot flash the image to my board. I keep got the “wait for device “ error. That’s what I did.

  1. Set to recovery mode
  2. Copy image as the instructions
  3. Run the flash_all.sh And get wait for device error. I used the solutions to recovery hikey960 first and then flashed successfully. And when I boot the device, nothing shows up on the lcd. The green led keeps blinking. Any ideas for these two errors?

On Mon, Nov 19, 2018 at 10:13 PM vchong notifications@github.com wrote:

Thanks! Can't really tell what's causing the issue form the log. Did you start from scratch when you run sync-p-hikey960.sh? Or did you run in on an existing source tree? If you delete external/libdrm and try again, do you still get the error?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/linaro-swg/optee_android_manifest/issues/45#issuecomment-440122240, or mute the thread https://github.com/notifications/unsubscribe-auth/AdJUEWCmdzLoB0n1tMxdOfFHY_43pQpSks5uw3M6gaJpZM4YETy8 .

vchong commented 5 years ago

Sorry, can't really tell from the info you've provided. Can you paste the commands you used for flashing, the results, and the boot log maybe?

BeitongT commented 5 years ago

For flash the image, I followed the instructions in https://github.com/linaro-swg/optee_android_manifest

  1. Set jumpers/switches 1-2 and 3-4, and unset 5-6.
  2. Reset the board. I am a little confused about this step. Is it push the reset button? Or execute the following code "sudo ./hikey_idt -c config -p /dev/ttyUSB0" I choose to push the reset button
  3. cp -a out/target/product/hikey960/*.img device/linaro/hikey/installer/hikey960/ -> no error
  4. sudo ./device/linaro/hikey/installer/hikey960/flash-all.sh /dev/ttyUSBn -> error. Log is shown below

android out dir:./device/linaro/hikey/installer/hikey960/../../../../../out/target/product/hikey960 < waiting for device >

vchong commented 5 years ago

Did you replace the 'n' in /dev/ttyUSBn with the proper device number? E.g. /dev/ttyUSB0 or /dev/ttyUSB1?

Also, sync-p-hikey960.sh doesn't only sync all the repos, it also patches the appropriate repos for op-tee. I think that when you get the sync error, the source tree is not completely downloaded and patched, which might explain the images not working properly. It's surprising that you managed to even complete the build at all.

ggulgun commented 5 years ago

Hello all,

I have a problem using pre-built optee(3.3.0 release) images. I wanted flash them into Hikey960. Are these images suitable for Hikey960?

vchong commented 5 years ago

@pwnageco As mentioned above, please open a new issue instead of tagging the end of some random current issue. It makes searching back later harder!

In any case no, 3.3.0 is for hikey (620) only. You can't use it on hikey960. Generally, if hikey960 is not explicitly specified, then it's for hikey (620) only!