ZynqMP firmware driver

ZynqMP firmware driver

Zynq Ultrascale+ MPSoC/Versal  firmware driver

Firmware interface driver for Zynq Ultrascale+ MPSoC/Versal

 

Table of Contents

Firmware interface driver for Zynq Ultrascale+ MPSoC

Introduction

HW IP features

Features supported in driver

Missing Features, Known Issues and Limitations

Devicetree

Test procedure

Mainline status

Change Log

Related Links

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

  • 7e719b9 firmware: zynqmp: Add sysfs and IOCTL to set boot health status

2018.3
Summary:

  • Add support for PL configuration readback, efuse access and zynqmp-aes

Commits:

  • 1f3aaff firmware: Add pm api function for PL readback 

  • e7dfc7c zynqmp: firmware: Adds new eemi call for reg access 

  • 301dde0 zynqmp: firmware: Adds zynqmp-aes support 

  • 5bda6a6 zynqmp: firmware: provides support to access efuse 

  • e732840 fpga: Fix bitstream typo error

 

2019.1

Summary:

  • Add support for secure partition load and PDI load API

  • Extend driver for versal devices and add support for feature check

Commits:

  • 322324b zynqmp: firmware: provides support for secure partition load

  • 386d334 zynqmp: firmware: Adds a driver for loading secure partition from Linux

  • 3f9e46d drivers: xilinx: Reorganize firmware driver for zynqmp

  • 9140687 drivers: firmware: xilinx: Sync upstream'ed zynqmp firmware driver

  • 6a63448 drivers: Defer probe if firmware is not ready

  • c27ff49 xilinx: Sync license with mainline

  • 190fbae drivers: firmware: xilinx: Update zynqmp firmware driver for versal

  • 251bf84 drivers: firmware: xilinx: Add support for feature check

  • c724008 firmware: zynqmp: Extend driver for versal

  • 7939524 firmware: zynqmp: Fix feature check response

  • 20dc6c8 firmware: xilinx: fix debugfs write handler

  • 3518bfa firmware: xilinx: Sync kernel-doc format with mainline

  • 7a9636f firmware: xilinx: Sync positions with mainline

  • eef20a5 firmware: zynqmp: Sync location of get_chipid

  • 55c4e45 firmware: xilinx: use only 4 words in return payload

  • 704cb84 firmware: zynqmp: Modify zynqmp_pm_secure_load to return only dst.

  • 07bb52b firmware: zynqmp-secure: Correct error handling for secure_load

  • b1331d7 zynqmp-secure: Fix for crash seen with secure image loading

  • f7b1bb6 drivers: firmware: Add Pdi load API support

  • b9f0537 clk: zynqmp: Warn user if clock user are more than allowed

 

2019.2

Summary:

  • Validate IOCTL ids for Versal and add IOCTL ids for probe counter

Commits:

  • 9d49682 firmware: xilinx: Handle error pointer correctly 

  • 36cf587 drivers: firmware: xilinx: Add IOCTL ids for probe counter

  • c6e497f firmware: xilinx: Allow valid IOCTL ids only for versal

  • af5ebe7 firmware: xilinx: Fix the error check

  • c464c59 firmware: xilinx: Add compatible string without wip

 

2020.1

Summary:

  • Add OSPI MUX selection support

Commits:

  • febefc9firmware: xilinx: Add OSPI MUX selection support 

 

2020.2

Summary:

  • Add support for get last reset reason

  • Add IOCTL support for AIE ISR clear

Commits:

  • f6c05e2 firmware: xilinx: Add support for GET_LAST_RESET_REASON IOCTL

  • b2a6bdb xilinx: firmware: Add sysfs to get last reset reason 

  • 67ff189 firmware: xilinx: Use u32 for reset ID in reset APIs 

  • c9b1770 firmware: xilinx: Add IOCTL support for AIE ISR Clear 

Related Links


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