ZynqMP firmware driver

Zynq Ultrascale+ MPSoC/Versal  firmware driver

Firmware interface driver for Zynq Ultrascale+ MPSoC/Versal


Introduction


ZynqMP has an interface to communicate with secure firmware. Firmware driver provides an interface to firmware APIs. Interface APIs can be used by any driver to communicate to PMUFW(Platform Management Unit)(ZynqMP) or PLM(Platform Loader and Manager)(Versal). These requests include clock management, pin control, device control, power management service, FPGA service and other platform management services.

HW IP features

NA

Features supported in driver

  • Communication layer to request Platform Management Unit and Trustzone
  • Control/configure devices through IOCTL
  • Query platform specific information from firmware
  • Clock control
  • Pin control and configurations
  • other platform management services like FPGA management, reset, etc
  • Debug interface to debug firmware APIs
  • Sysfs interface for accessing GGS and PGGS registers, setting shutdown scope, setting health boot status, accessing PMU and CSU registers

Missing Features, Known Issues and Limitations

None

Kernel Configuration

Firmware driver is by default enabled for ZynqMP platform. The following config options should be enabled in order to build the ZynqMP firmware driver:
CONFIG_ZYNQMP_FIRMWARE:
 
Firmware interface driver is used by different to
communicate with the firmware for various platform
management services.
Say yes to enable ZynqMP firmware interface driver.
In doubt, say N
 
Symbol: ZYNQMP_FIRMWARE [=y]
Type  : boolean
Prompt: Enable Xilinx Zynq MPSoC firmware interface
  Location:
    -> Firmware Drivers
      -> Zynq MPSoC Firmware Drivers
  Defined at drivers/firmware/xilinx/zynqmp/Kconfig:7
  Depends on: ARCH_ZYNQMP [=y]
  Selected by: ARCH_ZYNQMP [=y]
The following config options should be enabled in order to enable ZynqMP firmware debugfs:
CONFIG_ZYNQMP_FIRMWARE_DEBUG:
 
Say yes to enable ZynqMP firmware interface debug APIs.
In doubt, say N
 
Symbol: ZYNQMP_FIRMWARE_DEBUG [=n]
Type  : boolean
Prompt: Enable Xilinx Zynq MPSoC firmware debug APIs
  Location:
    -> Firmware Drivers
      -> Zynq MPSoC Firmware Drivers
        -> Enable Xilinx Zynq MPSoC firmware interface (ZYNQMP_FIRMWARE [=y])
  Defined at drivers/firmware/xilinx/zynqmp/Kconfig:16
  Depends on: ARCH_ZYNQMP [=y] && ZYNQMP_FIRMWARE [=y] && DEBUG_FS [=y]

Devicetree

  • ZynqMP
{
       compatible = "xlnx,zynqmp";
       #address-cells = <2>;
       #size-cells = <2>;
       firmware {
               zynqmp_firmware: zynqmp-firmware {
                       compatible = "xlnx,zynqmp-firmware";
                       method = "smc";
               };
       };
}
  • Versal
{
       compatible = "xlnx,versal";
       #address-cells = <2>;
       #size-cells = <2>;;
       firmware {
               versal_firmware: versal-firmware {
                        compatible = "xlnx,versal-firmware";
                        method = "smc";
       };
}

Test procedure

  • Firmware version running on hardware should match with expected version
[    0.021138] zynqmp_plat_init Platform Management API v1.0
  • ATF PM version should match with expected version
[    0.021146] zynqmp_plat_init Trustzone version v1.0
  • If CONFIG_ZYNQMP_FIRMWARE_DEBUG is enabled, debugfs entry should be present and pm_get_api_version should return correct value.
root@xilinx-zcu102-2018_1:~# ls /sys/kernel/debug/zynqmp-firmware/pm
root@xilinx-zcu102-2018_1:~# echo pm_get_api_version > /sys/kernel/debug/zynqmp-firmware/pm
root@xilinx-zcu102-2018_1:~# cat /sys/kernel/debug/zynqmp-firmware/pm
root@xilinx-zcu102-2018_1:~# PM-API Version = 1.0

Mainline status

Firmware driver is up-streamed to mainline kernel.
Patches for modification of existing driver to extend support for Versal is up-streamed to mainline kernel.


Change Log

2018.1

Summary:
  • Add ZynqMP firmware driver
Commits:
  • a755cc6 drivers: firmware: xilinx: Add ZynqMP firmware driver
  • 0aea30b drivers: firmware: xilinx: Add sysfs interface
  • 889d73e drivers: firmware: xilinx: Add debugfs interface
  • e479034 firmware: zynqmp: Add sysfs to set shutdown scope
2018.2
Summary:
  • Add sysfs and IOCTL to set boot health status
Commits

Related Links


http://www.wiki.xilinx.com/Zynq+UltraScale%EF%BC%8B+MPSoC+Power+Management+-+Linux+Kernel

© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy