renesas-rcar / arm-trusted-firmware

arm-trusted-firmware
Other
25 stars 39 forks source link

Introduce the Renesas H3ULCB r8a77951 pinctrl driver with SCMI interface #19

Open oleksiimoisieiev opened 2 years ago

oleksiimoisieiev commented 2 years ago

This merge request was marked as Draft because SCMI protocol is still under the discussion.

The main idea of the feature is to separate HW configuration from the OS level and move it to AT-F. This gives a big advantages for virtualized systems, when different set of pins should be assigned to the different OS. In this case, actual sets of pins could be passed to different OS, which has registered scmi-pinctrl clients and requests AT-F to do any HW changes.

This is the implementation of the pinctrl driver for Renesas H3ULCB board, which provides the mappings and configurations of pins and has exclusive access to the HW. Pin control subsystem configuration can be accessed and modified through the SCMI pinctrl protocol. This protocol is under discussion right now, so the implementation is not final.

The Pin States configuration is expected to take place on OS side, which performs the configuration and requests AT-F to make changes in HW.

This can be tested using the follwoing scenario: 1) Build AT-F, which implements pinctrl feature using the following command:

make -j17 \ ARCH=aarch64 \ CROSS_COMPILE=aarch64-linux-gnu- \ CC=aarch64-linux-gnu-gcc \ PLAT=rcar \ MBEDTLS_COMMON_MK=1 \ LSI=H3 \ LOG_LEVEL=40 \ RCAR_DRAM_SPLIT=1 \ RCAR_GEN3_ULCB=1 \ PMIC_LEVEL_MODE=0 \ RCAR_DRAM_LPDDR4_MEMCONF=1 \ RCAR_LOSSY_ENABLE=1 \ RCAR_BL33_EXECUTION_EL=1 \ RCAR_RPC_HYPERFLASH_LOCKED=0 \ DEBUG=1 \ SPD=opteed \ RCAR_SCMI_PLATFORM=1 \ bl2 bl31 rcar

2) Build linux-bsp kernel with pinctrl-scmi feature implemented from the MR https://github.com/renesas-rcar/linux-bsp/pull/3 using command:

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j $(nproc) O=../test-build

set CONFIG_PINCTRL_SCMI=y in your .config

3) Update device-tree using the following mappings:

Documentation/devicetree/bindings/pinctrl/renesas-scmi,pfc.yaml move pins configuration from pinctrl to pinctrl-scmi driver node.

4) Upload bl2.bin and bl31.bin to the board and boot using linux-bsp kernel and the device-tree from the previous steps. This setup will redirect the pin control subsystem requests from the kernel to AT-F.

5) Check if the devices works properly.