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

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

Draft
wants to merge 15 commits into
base: rcar_gen3_v2.5
Choose a base branch
from

Conversation

oleksiimoisieiev
Copy link

@oleksiimoisieiev oleksiimoisieiev commented Dec 1, 2021

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

  1. Build linux-bsp kernel with pinctrl-scmi feature implemented from the MR Introduce scmi-pinctrl driver support linux-bsp#3
    using command:

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

set CONFIG_PINCTRL_SCMI=y in your .config

  1. 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.

  1. 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.

  2. Check if the devices works properly.

oleksiimoisieiev and others added 15 commits December 1, 2021 10:46
Revering SiP service removal. SiP functionality is needed for SCMI
protocol implementation.
This reverts commit ba21828.

Signed-off-by: Oleksii Moisieiev <[email protected]>
Actually it is shared memory region owned by Secure World DDR area
for communication between server (ARM TF) and client (some software
running in lower privilege level) using SCMI protocol.

Signed-off-by: Oleksandr Tyshchenko <[email protected]>
Signed-off-by: Sergiy Kibrik <[email protected]>
Will be used in ATF SCP implementation.

Signed-off-by: Sergiy Kibrik <[email protected]>
Signed-off-by: Oleksii Moisieiev <[email protected]>
This driver does not actually manage R-Car power, but merely keeps Linux
scmi_pm_domain driver happy by successful replies

Signed-off-by: Sergiy Kibrik <[email protected]>
Add SCMI base procol commands handling.

Signed-off-by: Sergiy Kibrik <[email protected]>
Put HW descriptions for EAVB, USB, I2C and audio controllers under
corresponding drivers management.

Signed-off-by: Sergiy Kibrik <[email protected]>
Set scmi_max_payload equals to SCMI_PAYLOAD_SZIE (128) from SCP-firmware,
which was taken as a reference.
Link to SCP firmware: https://github.com/ARM-software/SCP-firmware.git
SCMI_PAYLOAD_SZIE is defined in software_mmap.h file and sets maximum
payload for the scmi message.

Linux kernel smc implementation also has max_payload = 128.
This code was presented in the following patch:
https://lore.kernel.org/r/[email protected]

The direct link for the code line is:
https://github.com/ARM-software/SCP-firmware/blob/dc4dfbad2b3104288f7aeade14ffca523a7b33ce/product/rcar/include/software_mmap.h#L78

Signed-off-by: Oleksii Moisieiev <[email protected]>
Complete implementation of the discover_list_protocols handler.
It includes skip handling and dynamic generation of the protocols
list.

Signed-off-by: Oleksii Moisieiev <[email protected]>
This defines the generic interface, and ops, which should provide
the platform specific implementation of pin control subsystem.
This driver was designed to be used from agents via SCP, as well as from
the other drivers, which requires pins configuration.

Signed-off-by: Oleksii Moisieiev <[email protected]>
Moved implementation of the r8a77951 pinctrl driver.
Implementation was taken from the follwoing location
Repository: https://github.com/renesas-rcar/linux-bsp.git
Path: drivers/pinctrl/renesas
Commit: 301d2c636929be96f3d87b1b5d287f87ed67a7be

Signed-off-by: Oleksii Moisieiev <[email protected]>
Implementation of the r8a77951 pinctrl driver, based on
the renesas linux-bsp source code.
Implements include/drivers/pinctrl.h generic interface.

Signed-off-by: Oleksii Moisieiev <[email protected]>
Moving ALIGN_NEXT macro to the common header, so another
SCMI protocols could use this macro.

Signed-off-by: Oleksii Moisieiev <[email protected]>
SCMI pinctrl implementation for Renesas. Using pinctrl driver to
work with PINS. This driver implements SCMI Pinctrl protocol and
provides interface for agents to access to the HW.

Signed-off-by: Oleksii Moisieiev <[email protected]>
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.

2 participants