For ZYNQMP:
By default, the Arm-trusted firmware builds for OCM space at address 0xFFFEA000. But, with DEBUG flag set to 1, it can't fit in OCM, so by default with DEBUG=1, it builds for DDR location 0x1000 with build flag DEBUG=1 mentioned while building. Alternatively, user has always an option to build for the location of their choice by specifying the build flags ZYNQMP_ATF_MEM_BASE, ZYNQMP_ATF_MEM_SIZE while building. The flag ZYNQMP_ATF_MEM_BASE specifies the base address of ATF and flag ZYNQMP_ATF_MEM_SIZE specifies the maximum size the ATF image can be.
Example build command:
The above commands builds ATF for DDR location 0x10000 with image size restricted to 0x40000 which means ATF image can span from 0x10000 to 0x50000 in DDR.
For VERSAL:
By default, the Arm-trusted firmware builds for OCM space at address 0xFFFEA000. Currently it can fit in OCM, so with DEBUG=1 it builds for the location 0xFFFEA0000. Alternatively, user has always an option to build for the location of their choice by specifying the build flags VERSAL_ATF_MEM_BASE, VERSAL_ATF_MEM_SIZE while building. The flag VERSAL_ATF_MEM_BASE specifies the base address of ATF and flag VERSAL_ATF_MEM_SIZE specifies the maximum size the ATF image can be.
Example build command:
The above commands builds ATF for DDR location 0x10000 with image size restricted to 0x40000 which means ATF image can span from 0x10000 to 0x50000 in DDR.
Functionality | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
PSCI | Power State Coordination Interface is used to coordinate power control among supervisory systems concurrently running on a device which allows a supervisory system to request cores to be powered up or down, and torequest context transfer where necessary and soon. | drivers/firmware/psci.c include/linux/psci.h include/uapi/linux/psci.h | Refer include/lib/psci/psci.h in ATF source |
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
Various Power Management functions | Enables OS to exercise Platform Management on platform | drivers/firmware/xilinx/zynqmp/firmware.c | Refer table below. ATF source: plat/xilinx/zynqmp/pm_service/pm_defs.h | Refer to UG1137 ch-11 for more information on below SMC's |
PM API | SMC ID |
PM_GET_API_VERSION | 0xC2000001 |
PM_SET_CONFIGURATION | 0xC2000002 |
PM_GET_NODE_STATUS | 0xC2000003 |
PM_GET_OP_CHARACTERISTIC | 0xC2000004 |
PM_REGISTER_NOTIFIER | 0xC2000005 |
PM_REQ_SUSPEND | 0xC2000006 |
PM_SELF_SUSPEND, | 0xC2000007 |
PM_FORCE_POWERDOWN | 0xC2000008 |
PM_ABORT_SUSPEND | 0xC2000009 |
PM_REQ_WAKEUP | 0xC200000A |
PM_SET_WAKEUP_SOURCE | 0xC200000B |
PM_SYSTEM_SHUTDOWN | 0xC200000C |
PM_REQ_NODE | 0xC200000D |
PM_RELEASE_NODE | 0xC200000E |
PM_SET_REQUIREMENT | 0xC200000F |
PM_SET_MAX_LATENCY | 0xC2000010 |
PM_RESET_ASSERT | 0xC2000011 |
PM_RESET_GET_STATUS | 0xC2000012 |
PM_MMIO_WRITE | 0xC2000013 |
PM_MMIO_READ | 0xC2000014 |
PM_INIT_FINALIZE | 0xC2000015 |
PM_GET_CHIPID | 0xC2000018 |
PM_REGISTER_ACCESS | 0xC2000034 |
PM_EFUSE_ACCESS | 0xC2000035 |
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
FPGA Load | FPGA PL bitstream programming | drivers/firmware/xilinx/zynqmp/firmware.c | Refer table below. ATF source: plat/xilinx/zynqmp/pm_service/pm_defs.h plat/xilinx/zynqmp/pm_service/pm_main.c |
PM_FPGA_LOAD | 0xC2000016 |
PM_FPGA_GET_STATUS | 0xC2000017 |
PM_FPGA_READ | 0xC200002E |
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
Crypto | At u-boot level authentication and decryption of secure images and at linux level one can use crypto functions generic way to calculate SHA3 hash and RSA encryption with public key and decryption with private key.. | u-boot: board/xilinx/zynqmp/zynqmp.c Linux: drivers/firmware/xilinx/zynqmp/firmware.c | Refer table below. ATF source: plat/xilinx/zynqmp/pm_service/pm_defs.h plat/xilinx/zynqmp/pm_service/pm_main.c |
PM API | SMC ID | Comment |
PM_SECURE_RSA_AES | 0xC2000019 | This is used for authentication and decryption of secure images at u-boot level to mainly load secure dtb and secure linux image. |
PM_SECURE_SHA | 0xC200001A | To calculate SHA3 hash - At linux level |
PM_SECURE_RSA | 0xC200001B | To calculate RSA encrypted data with public key and decrypt with RSA signature with provided key size. |
PM_SECURE_AES | 0xC200002F | |
PM_SECURE_IMAGE | 0xC200002D |
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
Query data | Request platform specific data from firmware. | Linux: drivers/firmware/xilinx/zynqmp/firmware.c | Refer table below. ATF source: plat/xilinx/zynqmp/pm_service/pm_defs.h plat/xilinx/zynqmp/pm_service/pm_svc_main.c plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.c plat/xilinx/zynqmp/pm_service/pm_api_clock.c |
PM_API | SMC_ID |
PM_QUERY_DATA | 0xC2000023 |
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
Device Control | Control and configure devices. | Linux: drivers/firmware/xilinx/zynqmp/firmware.c | Refer table below. ATF source: plat/xilinx/zynqmp/pm_service/pm_defs.h plat/xilinx/zynqmp/pm_service/pm_svc_main.c plat/xilinx/zynqmp/pm_service/pm_api_ioctl.c |
PM_API | SMC_ID |
PM_IOCTL | 0xC2000022 |
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
Clock | Control clocks in following ways:
| Linux: drivers/firmware/xilinx/zynqmp/firmware.c | Refer table below. ATF source: plat/xilinx/zynqmp/pm_service/pm_defs.h plat/xilinx/zynqmp/pm_service/pm_svc_main.c plat/xilinx/zynqmp/pm_service/pm_api_clock.c |
PM_API | SMC_ID |
PM_CLOCK_ENABLE | 0xC2000024 |
PM_CLOCK_DISABLE | 0xC2000025 |
PM_CLOCK_GETSTATE | 0xC2000026 |
PM_CLOCK_SETDIVIDER | 0xC2000027 |
PM_CLOCK_GETDIVIDER | 0xC2000028 |
PM_CLOCK_SETRATE | 0xC2000029 |
PM_CLOCK_GETRATE | 0xC200002A |
PM_CLOCK_SETPARENT | 0xC200002B |
PM_CLOCK_GETPARENT | 0xC200002C |
PM_PLL_SET_PARAMETER | 0xC2000030 |
PM_PLL_GET_PARAMETER | 0xC2000031 |
PM_PLL_SET_MODE | 0xC2000032 |
PM_PLL_GET_MODE | 0xC2000033 |
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
Pin control | Control pins in following ways:
| Linux: drivers/firmware/xilinx/zynqmp/firmware.c | Refer table below. ATF source: plat/xilinx/zynqmp/pm_service/pm_defs.h plat/xilinx/zynqmp/pm_service/pm_svc_main.c plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.c |
PM_API | SMC_ID |
PM_PINCTRL_REQUEST | 0xC200001C |
PM_PINCTRL_RELEASE | 0xC200001D |
PM_PINCTRL_GET_FUNCTION | 0xC200001E |
PM_PINCTRL_SET_FUNCTION | 0xC200001F |
PM_PINCTRL_CONFIG_PARAM_GET | 0xC2000020 |
PM_PINCTRL_CONFIG_PARAM_SET | 0xC2000021 |
Below are the Versal specific SMC ID's list which are mostly the Power Management functionalities that are being handled by ATF through SMC calls from upper level software. For all the SMC ID's in Versal, the ATF acts a pass through for handling it in Platform Management Unit(PMU) Firmware. Upon receiving the Synchronous exception through SMC, ATF checks for the SMC ID and accordingly communicates with PMU through IPI for handling it in PMU firmware and gets the response/result from it to pass the same to upper level software.
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
Various Power Management functions | Enables OS to exercise Platform Management on platform | drivers/firmware/xilinx/zynqmp.c | Refer table below. ATF source: plat/xilinx/versal/pm_service/pm_defs.h |
PM API | SMC ID |
PM_GET_API_VERSION | 0xC2000001 |
PM_GET_DEVICE_STATUS | 0xC2000003 |
PM_GET_OP_CHARACTERISTIC | 0xC2000004 |
PM_REQ_SUSPEND | 0xC2000006 |
PM_SELF_SUSPEND, | 0xC2000007 |
PM_FORCE_POWERDOWN | 0xC2000008 |
PM_ABORT_SUSPEND | 0xC2000009 |
PM_REQ_WAKEUP | 0xC200000A |
PM_SET_WAKEUP_SOURCE | 0xC200000B |
PM_SYSTEM_SHUTDOWN | 0xC200000C |
PM_REQUEST_DEVICE | 0xC200000D |
PM_RELEASE_DEVICE | 0xC200000E |
PM_SET_REQUIREMENT | 0xC200000F |
PM_RESET_ASSERT | 0xC2000011 |
PM_RESET_GET_STATUS | 0xC2000012 |
PM_INIT_FINALIZE | 0xC2000015 |
PM_GET_CHIPID | 0xC2000018 |
In Versal, the high privileged level software maintains platform specific data. Higher level software (e.g. Linux) can query platform specific data (e.g. clock information, pin information, etc) from firmware. Underneath firmware (ATF or PMU) contains these information and returns requested data.
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
Query data | Request platform specific data from firmware. | Linux: drivers/firmware/xilinx/zynqmp.c | Refer table below. ATF source: plat/xilinx/versal/pm_service/pm_defs.h plat/xilinx/versal/pm_service/pm_svc_main.c plat/xilinx/versal/pm_service/pm_client.c |
PM_API | SMC_ID |
PM_QUERY_DATA | 0xC2000023 |
In Versal, the device control and configurations are carried out at higher privilege level by performing corresponding SMC's from the higher level software(ex: u-boot, Linux or any other OS). The Below SMC's are responsible for device control and configurations. Here also, ATF responsible for handling them or passing to PMUFW for requested action.
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
Device Control | Control and configure devices. | Linux: drivers/firmware/xilinx/zynqmp.c | Refer table below. ATF source: plat/xilinx/versal/pm_service/pm_defs.h plat/xilinx/versal/pm_service/pm_svc_main.c plat/xilinx/versal/pm_service/pm_api_sys.c |
PM_API | SMC_ID |
PM_IOCTL | 0xC2000022 |
In Versal, the clock control is carried out at higher privilege level by performing corresponding SMC's from the higher level Linux. The Below SMC's are responsible for controlling clocks. Here ATF calls MMIO read/write to perform clock management.
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
Clock | Control clocks in following ways:
| Linux: drivers/firmware/xilinx/zynqmp.c | Refer table below. ATF source: plat/xilinx/versal/pm_service/pm_defs.h plat/xilinx/versal/pm_service/pm_svc_main.c plat/xilinx/versal/pm_service/pm_api_sys.c |
PM_API | SMC_ID |
PM_CLOCK_ENABLE | 0xC2000024 |
PM_CLOCK_DISABLE | 0xC2000025 |
PM_CLOCK_GETSTATE | 0xC2000026 |
PM_CLOCK_SETDIVIDER | 0xC2000027 |
PM_CLOCK_GETDIVIDER | 0xC2000028 |
PM_CLOCK_SETRATE | 0xC2000029 |
PM_CLOCK_GETRATE | 0xC200002A |
PM_CLOCK_SETPARENT | 0xC200002B |
PM_CLOCK_GETPARENT | 0xC200002C |
PM_PLL_SET_PARAMETER | 0xC2000030 |
PM_PLL_GET_PARAMETER | 0xC2000031 |
PM_PLL_SET_MODE | 0xC2000032 |
PM_PLL_GET_MODE | 0xC2000033 |
In Versal, the pin control and configurations are carried out at higher privilege level by performing corresponding SMC's from the higher level Linux. The Below SMC's are responsible for pin control and configurations. Here ATF calls MMIO read/write to perform pinmux and pin configurations.
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | Comments |
Pin control | Control pins in following ways:
| Linux: drivers/firmware/xilinx/zynqmp.c | Refer table below. ATF source: plat/xilinx/versal/pm_service/pm_defs.h plat/xilinx/versal/pm_service/pm_svc_main.c plat/xilinx/versal/pm_service/pm_api_sys.c |
PM_API | SMC_ID |
PM_PINCTRL_REQUEST | 0xC200001C |
PM_PINCTRL_RELEASE | 0xC200001D |
PM_PINCTRL_GET_FUNCTION | 0xC200001E |
PM_PINCTRL_SET_FUNCTION | 0xC200001F |
PM_PINCTRL_CONFIG_PARAM_GET | 0xC2000020 |
PM_PINCTRL_CONFIG_PARAM_SET | 0xC2000021 |
Function | Overview | Corresponding Linux Source | ATF SMC(s) Used | ATF Dependencies | For More Information |
Various Power Management functions | Enables OS to exercise power management on platform | .c, .lib, | See UG1199 |