Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Device Tree support #679

Closed
wants to merge 9 commits into from
Closed

RFC: Device Tree support #679

wants to merge 9 commits into from

Conversation

jforissier
Copy link
Contributor

This is a proof-of-concept showing how OP-TEE can get information from the Device Tree to configure its console, i.e., /chosen/secure-stdout-path or /chosen/stdout-path.
Tested on HiKey. Build with make PLATFORM=hikey CFG_TEE_CORE_LOG_LEVEL=3 CFG_DT=y.
Depends on https://github.com/jforissier/arm-trusted-firmware/tree/dt.

Prepare Device Tree support (CFG_DT=y).

Import libfdt code from https://git.kernel.org/cgit/utils/dtc/dtc.git
commit 53bf130b1cdd ("libfdt: simplify fdt_node_check_compatible()").
Some build flags are removed as needed to build a few source files. The
'-pedantic' flag, however, is removed for the whole TEE core because it
causes errors in <libfdt.h> which  may be included from anywhere.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
When CFG_DT=y, OP-TEE expects to find the address of the Flattened
Device Tree (FDT) binary in r2. The bootloader has to take care of
this. r2 is not used when CFG_DT=n.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
When CFG_DT=y a linker section is created (.rodata.dtdrv) to hold all
the DT-compatible drivers. The table can later be queried at runtime.
Some manipulation functions are exported in <kernel/dt.h>.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Add a common interface for UART drivers.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
When CFG_DT=y, look for console UART parameters from DT properties:
/chosen/secure-stdout-path and /chosen/stdout-path.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
The PL011 driver is extended to register a struct serial_driver
interface through the dt_driver struct when CFG_DT=y.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
When DT is enabled, memory has to be reserved for the console code to
be able to configure any UART because console_init() has no way to do
dynamically currently.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
@jenswi-linaro
Copy link
Contributor

Over all this looks good, definitely the right direction. What's next step, a full review?

@jforissier
Copy link
Contributor Author

@jenswi-linaro I'd like to get some feedback at Linaro Connect next week. Also if possible involve the ARM-TF maintainers and see what they think, bearing in mind that some ARM-TF patches depend on things that are not 100% upstream (OP-TEE dispatcher and HiKey support).
Then depending on the outcome we can proceed with a full review.

@pascal-brand38
Copy link
Contributor

Overall looks good to me too.

@vchong vchong mentioned this pull request Aug 7, 2016
@jforissier jforissier mentioned this pull request Jan 26, 2017
@jforissier
Copy link
Contributor Author

Replaced by #1388.

@jforissier jforissier closed this Mar 3, 2017
@jforissier jforissier deleted the dt branch April 28, 2017 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants