Code Monkey home page Code Monkey logo

Comments (27)

jbech-linaro avatar jbech-linaro commented on July 17, 2024 2

Any pointers on how this was done (git commit) would be helpful.

Even though this doesn't really affect any platform code in OP-TEE I would have added another composite PLATFORM flag to the exiting RPI3 builds. That would made things look the same as for other platforms and platform flavors. So instead of using just PLATFORM=rpi3 as today we would use PLATFORM=rpi-3b and PLATFORM=rpi-3bplus. By doing so we can "ifdef" in both build scripts as well as in OP-TEE platform code if needed.

Things touching this in our existing full developer setup for OP-TEE are:
https://github.com/OP-TEE/build/blob/master/rpi3.mk#L40
https://github.com/OP-TEE/build/blob/master/rpi3.mk#L166

Would like to get optee on Rpi3 B + running with u-boot generated from the optee build system itself rather than hackish methods of copying from other sources.

Indeed.

from build.

jbech-linaro avatar jbech-linaro commented on July 17, 2024 1

@Hacklog24 , are using the UART cable or not? @igoropaniuk just recently added a patch that should make it work without the UART cable, but in case you're running an older commit than that, then it just works with the UART cable. Personally I'm only using the UART cable, I've never tried using HDMI myself.

from build.

igoropaniuk avatar igoropaniuk commented on July 17, 2024 1

@Hacklog24

I have an LCD display connected to the Raspberry,

It won't work, because it's not even configured in the default config.txt we're using.
Please consider HDMI connection or serial console cable (simple USB FTDI will work, here is setup details https://h3droid.com/blog/uart-cable)

For details check https://github.com/OP-TEE/build/blob/master/docs/rpi3.md#61-debug-cable--uart-cable

If you still plan to bring up DPI/LVDS display, check configuration flags (unfortunately I can't help you with any other suggestions regarding DPI display, as I don't have one) in https://www.raspberrypi.org/documentation/configuration/config-txt/video.md

And https://www.raspberrypi.org/forums/viewtopic.php?t=157109

from build.

jbech-linaro avatar jbech-linaro commented on July 17, 2024

Hi @jdeus ,

I cannot vouch for the instructions they provide on the URL you provided (even though it looks more or less like as a copy/paste of our official instructions), but if you follow our official instructions (here and here), then I guarantee that it will work, since two of us have independently tested this OK for the 3.2.0-rc1 tag released 1.5 week ago.

// Regards Joakim

from build.

jdeus avatar jdeus commented on July 17, 2024

Hello,

Turns out the instructions are exactly the same as provided on your repo. Still can't get it to work unfortunately, I've tried reformatting the SD card multiple times and followed the instructions given on your repo, still no luck

from build.

jbech-linaro avatar jbech-linaro commented on July 17, 2024

@jdeus , if I find some time I will try it once more tomorrow. You can never say never, but it feel a bit unlikely that it has stopped working since just a week ago. We haven't merged that many patches since last week. I'll make a reply here if I find time to try it out.

from build.

jdeus avatar jdeus commented on July 17, 2024

That would be great.

I looked a bit around and found that uboot.env in the boot partition seems messed up:
https://ufile.io/z14iw

Here's the entire rootfs.cpio.gz archive: https://ufile.io/04k70

What's going on?

from build.

jbech-linaro avatar jbech-linaro commented on July 17, 2024

@jdeus

This morning, I've just rebuilt it all from scratch and re-populated the SD-card from scratch and everything is fine and works as expected. So, I'm not sure how to help when things are working here on my side. What you can do is to make sure all dependencies are met (apt-get), start from a fully clean folder. Pay attention if there are error messages while building (due to missing packages etc).

I'm also building using a Debian machine:

$ uname -a
Linux debby 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux

Alias used in "Build" and "Revisions" below.

$ alias | grep rpo_clean_all
alias rpo_clean_all='repo forall -c '\''echo Cleaning ... $REPO_PATH && git clean -xdf && git checkout -f'\'''
alias rpo_rev='repo forall -c '\''echo $REPO_PATH -- `git log --oneline -1`'\'''

Build ...

  508  rpo_clean_all 
  509  repo sync -j3 -d
  510  time make -j8
  511  make img-help 
  512  history 

Revisions ...

$ rpo_rev 
arm-trusted-firmware -- 1da4e155 Resolve GCC6.x build errors
build -- 3b5d8f0 grub: ignore harmless warning
buildroot -- 62dca337fe package/samba4: bump version to 4.8.1
firmware -- 3fb63c413c firmware: FXL6408/GPIOman: Support config of termination via dt-blob firmware: GPIO expander: Add API to reconfigure pins firmware: GPIOMAN: Add API to reconfigure pins firmware: Mailbox service: Add command to reconfigure GPIO setup firmware: FXL6408: Return success code on reading status of an output firmware: GPIO expander: Add set/get_config functions to dummy driver
linux -- 7d976fc52ae3 kernel.h: add u64_to_user_ptr()
optee_benchmark -- 7437cb2 Initial CMake support
optee_client -- 2d542f2 Do not export CMakeLists.txt when running install
optee_examples -- 1c5d96f ta/Makefiles: Set LDFLAGS to null before building ta make scripts
optee_os -- af8149de core: make stack trace robust
optee_test -- c0e8678 xest: OpenSSL may be provided by the system
u-boot -- bc6d93cf5e rpi3: remove jtag enable code

Boot and xtest log, full log is here (note, only available for 24-hours).

U-Boot 2016.03-00725-gbc6d93cf5e (Jul 04 2018 - 07:38:59 +0200)

DRAM:  944 MiB
RPI 3 Model B (0xa02082)
boot regs: 0x00000000 0x00000000 0x00000000 0x00000000
MMC:   bcm2835_sdhci: 0
reading uboot.env
In:    serial
Out:   lcd
Err:   lcd
Net:   Net Initialization Skipped
No ethernet found.
starting USB...
USB0:   Core Release: 2.80a
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
       scanning usb for ethernet devices... 1 Ethernet Device(s) found
Hit any key to stop autoboot:  0 
reading Image
10203648 bytes read in 886 ms (11 MiB/s)
reading bcm2710-rpi-3-b.dtb
13376 bytes read in 19 ms (687.5 KiB/s)
reading optee.bin
419024 bytes read in 53 ms (7.5 MiB/s)
## Flattened Device Tree blob at 01700000
   Booting using the fdt blob at 0x1700000
   reserving fdt memory region: addr=0 size=1000
   reserving fdt memory region: addr=8000000 size=2000000
   Loading Device Tree to 000000003ab2f000, end 000000003ab3543f ... OK

Starting kernel ...

## Transferring control to ARM TF (at address 8400000) (dtb at 3ab2f000)...
NOTICE:  BL3-1: v1.1(debug):1da4e155
NOTICE:  BL3-1: Built : 07:39:53, Jul  4 2018
INFO:    BL3-1: Initializing runtime services
INFO:    BL3-1: Initializing BL3-2
....
I/TC:  OP-TEE version: 3.2.0-rc1-10-gaf8149de #1 Wed Jul  4 05:39:20 UTC 2018 aarch64
....
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.6.3-01139-g7d976fc52ae3 (jbech@debby) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #1 SMP Wed Jul 4 07:42:31 CEST 2018
....
Starting tee-supplicant...
Starting network: OK

Welcome to Buildroot, type root to login
buildroot login: root
# xtest
...
-----------------------
Result of testsuite regression:
regression_1001 OK
regression_1002 OK
regression_1003 OK
regression_1004 OK
regression_1005 OK
regression_1006 OK
regression_1007 OK
regression_1008 OK
regression_1009 OK
regression_1010 OK
regression_1011 OK
regression_1012 OK
regression_1013 OK
regression_1015 OK
regression_1016 OK
regression_1017 OK
regression_1018 OK
regression_1019 OK
regression_4001 OK
regression_4002 OK
regression_4003 OK
regression_4004 OK
regression_4005 OK
regression_4006 OK
regression_4007 OK
regression_4008 OK
regression_4009 OK
regression_4010 OK
regression_4011 OK
regression_4012 OK
regression_5006 OK
regression_6001 OK
regression_6002 OK
regression_6003 OK
regression_6004 OK
regression_6005 OK
regression_6006 OK
regression_6007 OK
regression_6008 OK
regression_6009 OK
regression_6010 OK
regression_6012 OK
regression_6013 OK
regression_6014 OK
regression_6015 OK
regression_6016 OK
regression_6017 OK
regression_6018 OK
regression_6019 OK
regression_6020 OK
regression_7001 OK
regression_7002 OK
regression_7003 OK
regression_7004 OK
regression_7005 OK
regression_7006 OK
regression_7007 OK
regression_7008 OK
regression_7009 OK
regression_7010 OK
regression_7013 OK
regression_7016 OK
regression_7017 OK
regression_7018 OK
regression_7019 OK
regression_8001 OK
regression_8002 OK
regression_8101 OK
regression_8102 OK
regression_8103 OK
regression_2001 OK
regression_2002 OK
regression_2003 OK
regression_2004 OK
+-----------------------------------------------------
16081 subtests of which 0 failed
74 test cases of which 0 failed
0 test case was skipped
TEE test application done!
# 

from build.

jbech-linaro avatar jbech-linaro commented on July 17, 2024

FYI, since I was at it, I even took the time to update my "rpi_nfs" branch which makes life easier for me when running RPi3 using NFS (this is no official stuff, it's just for my own sake). But, that also turned out to work fine. So both the official with SD card as well as when using NFS seem to be working fine here.

from build.

jdeus avatar jdeus commented on July 17, 2024

I've tried again from a clean machine and still the same result. Tried multiple SD cards, re-did each step multiple times, and same result. Tested the uart and the pi using raspbian and they both are OK.

from build.

jbech-linaro avatar jbech-linaro commented on July 17, 2024

Sorry, but I have no clue why it isn't working. If you want to give my binaries a try I've uploaded them here. Replace your rootfs.cpio.gz with the one from my URL and you should be good to go. I've separately added kernel, U-Boot env, the dtb, TEE core also, but those are already in the rootfs.cpio.gz, so you shouldn't really need them.

from build.

jbech-linaro avatar jbech-linaro commented on July 17, 2024

Stupid question, you are using RPi3 right and not one of the older versions? Also, we haven't tested this using the newer RPi3 B+, so I cannot tell if that could be a problem or not (and I don't have the RPi3 B+ myself, so I cannot test it).

from build.

jdeus avatar jdeus commented on July 17, 2024

Thanks for the link, I'll try that. I'm currently using the latest RPi3 to date, the 3 B+.

from build.

jbech-linaro avatar jbech-linaro commented on July 17, 2024

I'm currently using the latest RPi3 to date, the 3 B+.

I wonder if that could be the issue? I'm not sure if there is a new dtb file for the new RPI3 B+ or not. That could be worth checking.

You don't happen to have an old RPi3 laying around that you could give a try?

from build.

jdeus avatar jdeus commented on July 17, 2024

There is a new dtb called bcm2710-rpi-3-b-plus.dtb (here. I'll test with it.

from build.

jbech-linaro avatar jbech-linaro commented on July 17, 2024

Right, having that said, be aware of the OP-TEE specifics, that are only on our fork (which is used by default in our setup):
linaro-swg/linux@cc225a7

Whatever dt/dtsi/dtb we end up with, the OP-TEE specifics must the there otherwise the probe in Linux kernel will fail.

from build.

jdeus avatar jdeus commented on July 17, 2024

Turns out it's u-boot related. If I do the following, then it boots:

git clone --depth 1 git://git.denx.de/u-boot.git
cd u-boot
make rpi_3_defconfig
make CROSS_COMPILE=/root/devel/optee/toolchains/aarch64/bin/aarch64-linux-gnu-

I also had to remove the following from config.txt, or it wouldn't boot for some reason:

kernel_old=1
disable_commandline_tags=1

Also, I copied bcm2710-rpi-3-b-plus.dtb over bcm2710-rpi-3-b.dtb (so I don't have to modify u-boot.env)

Now it boots but I get the following error message: "tee-supplicant or tee device not found" from init.d.optee

In the rootfs tee-supplicant is however at /usr/sbin/tee-supplicant

Any idea?

from build.

jforissier avatar jforissier commented on July 17, 2024

@jdeus looks like the scripts looks for /bin/tee-supplicant but you're saying the correct path is /usr/sbin/tee-supplicant?

from build.

jbech-linaro avatar jbech-linaro commented on July 17, 2024

Great progress!

Now it boots but I get the following error message: "tee-supplicant or tee device not found" from init.d.optee

Weird, on the SD-card setup, that should autostart. On my NFS setup I need to manually start tee-supplicant. Can you simply try just that, i.,e.

$ tee-supplicant &
# Then run xtest
$ xtest

If tee-supplicant still doesn't load, try

$ strace tee-supplicant

And that will probably give some hints.

from build.

jdeus avatar jdeus commented on July 17, 2024

@jforissier That is correct.

@jbech-linaro Unfortunately it seems the exit 1 from init.d.optee prevents the shell from starting and thus I get the blinking cursor usually immediately after the message "tee supplicant or TEE device not found"

from build.

jdeus avatar jdeus commented on July 17, 2024

I got hold of a RPi 3 b (NOT +), and looks like it's booting fine except I don't get the shell at the end, just the blinking cursor. See here for a screenshot. Any idea ?

Edit: okay works using the UART

from build.

jbech-linaro avatar jbech-linaro commented on July 17, 2024

@jdeus did you manage to conclude anything here regarding 3B vs 3B+?

from build.

Hacklog24 avatar Hacklog24 commented on July 17, 2024

Hi,
I'm new to OP-TEE and wanted to learn more about it by running it on a Raspberry Pi 3B+.
I think that I have the same problem, can someone help me please?
Here's the list of actions I just followed based on your build support page (https://github.com/OP-TEE/build):

Installed the necessary dependencies;

Installed repo;
  1. Got OP-TEE's code through repo;
    repo init -u https://github.com/OP-TEE/manifest.git -m rpi3.xml

  2. Got the toolchains;

  3. Ran the "make " command;

  4. Flashed an SD card with the commands shown in "make img-help":

$ fdisk /dev/sdx # where sdx is the name of your sd-card

p # prints partition table
d # repeat until all partitions are deleted
n # create a new partition
p # create primary
1 # make it the first partition
# use the default sector
+32M # create a boot partition with 32MB of space
n # create rootfs partition
p
2

# fill the remaining disk, adjust size to fit your needs
t # change partition type
1 # select first partition
e # use type 'e' (FAT16)
a # make partition bootable
1 # select first partition
p # double check everything looks right
w # write partition table to disk.

run the following as root
$ mkfs.vfat -F16 -n BOOT /dev/sdx1
$ mkdir -p /media/boot
$ mount /dev/sdx1 /media/boot
$ cd /media
$ gunzip -cd /home/michele/devel/optee/build/../out-br/images/rootfs.cpio.gz | sudo cpio -idmv "boot/*"
$ umount boot

run the following as root
$ mkfs.ext4 -L rootfs /dev/sdx2
$ mkdir -p /media/rootfs
$ mount /dev/sdx2 /media/rootfs
$ cd rootfs
$ gunzip -cd /home/michele/devel/optee/build/../out-br/images/rootfs.cpio.gz | sudo cpio -idmv
$ rm -rf /media/rootfs/boot/*
$ cd .. && umount rootfs

But once the procedure is finished and the card inserted into the raspberry, the red LED flashes and nothing happens on the screen. It's stuck on the rainbow screen.

Thank you very much
Best Regards,
Michelangelo

from build.

Hacklog24 avatar Hacklog24 commented on July 17, 2024

Good morning and thank you so much for the timely reply. Sorry for the stupid question, I have an LCD display connected to the Raspberry, I still need the cable? If yes, what exactly is it for?

Thank you so much and excuse me for the questions.

from build.

Hacklog24 avatar Hacklog24 commented on July 17, 2024

Thank you very much for all the help and material.
So, I can try the connection with the HDMI and in case it does not work, try with the cable that you suggested? It’s right?

Thanks also for all the tips on the display.

from build.

jbech-linaro avatar jbech-linaro commented on July 17, 2024

Issues like this has been sorted out and more up-to-date information can be found in: OP-TEE/optee_os#2783 (comment), so I'm closing the ticket.

from build.

johnphilby avatar johnphilby commented on July 17, 2024

Right, having that said, be aware of the OP-TEE specifics, that are only on our fork (which is used by default in our setup):
linaro-swg/linux@cc225a7

Whatever dt/dtsi/dtb we end up with, the OP-TEE specifics must the there otherwise the probe in Linux kernel will fail.

@jbech-linaro How does one incorporate these changes when a new dtb such as bcm2710-rpi-3-b-plus.dtb needs to be used? Just cloning bcm2710-rpi-3-b.dtsi with a different name such as bcm2710-rpi-3-b-plus.dtsi in linux/arch/arm/boot/dts, as I have come to know, does not work. Any pointers on how this was done (git commit) would be helpful.

Would like to get optee on Rpi3 B + running with u-boot generated from the optee build system itself rather than hackish methods of copying from other sources.

from build.

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.