-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
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>
Over all this looks good, definitely the right direction. What's next step, a full review? |
@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). |
Overall looks good to me too. |
Replaced by #1388. |
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.