arm64 xilinx zynqmp firmware interface
Subsystems (2)
v2 cover arm64 xilinx zynqmp firmware interface
Hi,
xilinx is using this interface for very long time and we can't merge our driver changes to Linux because of missing communication layer with firmware. This interface was developed before scpi and scmi was available. In connection to power management scpi and scmi are missing pieces which we already use. There is a separate discussion how to extend scmi to support all our use cases.
This simply patch is not adding any power management features but only adding minimum functionality which are needed for drivers.
Edgar's comment on having HVC:
"We have patches for Xen that implement a power-management mediator. That implementation handles PM calls over both SMC and HVC insns. Patches are on the Xen mailing list.
Other hypervisors may work differently.
I think we should support both but I don't have a strong opinion on it."
Thanks,
Michal
Changes in v2:
- Move to bindings/firmware and also add it to firmware node Reported-by Rob
- Add zynqmp firmware node to firmware node
- Change commit message
- Make zynqmp_pm_ret_code, invoke_pm_fn static Reported by Arnd
- Remove pm_api_version function - no need for interface
- Move driver to drivers/firmware/
Reported by Arnd and Rob
Michal Simek (1):
soc: xilinx: zynqmp: Add firmware interface
Soren Brinkmann (2):
dt: xilinx: zynqmp: Add bindings for PM firmware
arm64: zynqmp: dt: Add PM firmware node
.../bindings/firmware/xlnx,zynqmp-pm.txt | 22 ++ arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 9 + drivers/firmware/Kconfig | 1 + drivers/firmware/Makefile | 1 + drivers/firmware/xilinx/Kconfig | 6 + drivers/firmware/xilinx/Makefile | 1 + drivers/firmware/xilinx/zynqmp/firmware.c | 382 +++++++++++++++++++++ include/linux/firmware/xilinx/zynqmp/firmware.h | 232 +++++++++++++ 8 files changed, 654 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt create mode 100644 drivers/firmware/xilinx/Kconfig create mode 100644 drivers/firmware/xilinx/Makefile create mode 100644 drivers/firmware/xilinx/zynqmp/firmware.c create mode 100644 include/linux/firmware/xilinx/zynqmp/firmware.h
Signature · 1 line
1.9.1
PATCH v2 1/3 dt: xilinx: zynqmp: Add bindings for PM firmware
From: Soren Brinkmann <[email protected]>
Document the DT bindings for the Zynq UltraScale+ PM Firmware.
---
Changes in v2:
- Move to bindings/firmware and also add it to firmware node Reported-by Rob
.../bindings/firmware/xlnx,zynqmp-pm.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt new file +22 -0
@@ -0,0 +1,22 @@ +Xilinx Zynq MPSoC Firmware Device Tree Bindings + +The zynqmp-pm node describes the interface to platform firmware. + +Required properties: + - compatible: Must contain: "xlnx,zynqmp-pm" + - method: The method of calling the PM-API firmware layer. + Permitted values are: + - "smc" : To be used in configurations without a hypervisor + - "hvc" : To be used when hypervisor is present + - interrupts: Interrupt specifier + +Examples: + + firmware { + zynqmp-firmware { + compatible = "xlnx,zynqmp-pm"; + method = "smc"; + interrupt-parent = <&gic>; + interrupts = <0 35 4>; + }; + };
Signature · 1 line
1.9.1
PATCH v2 2/3 arm64: zynqmp: dt: Add PM firmware node
In reply to Michal SimekFrom: Soren Brinkmann <[email protected]>
Add node for the firmware interface.
---
Changes in v2:
- Add zynqmp firmware node to firmware node
- Change commit message
arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/xilinx/zynqmp.dtsi +9 -0
@@ -49,6 +49,15 @@ }; }; + firmware { + zynqmp-firmware { + compatible = "xlnx,zynqmp-pm"; + method = "smc"; + interrupt-parent = <&gic>; + interrupts = <0 35 4>; + }; + }; + pmu { compatible = "arm,armv8-pmuv3"; interrupt-parent = <&gic>;
Signature · 1 line
1.9.1
PATCH v2 3/3 soc: xilinx: zynqmp: Add firmware interface
In reply to Michal SimekThis patch is adding communication layer with firmware.
The most of request are coming thought ATF to PMUFW (platform management unit).
---
Changes in v2:
- Make zynqmp_pm_ret_code, invoke_pm_fn static Reported by Arnd
- Remove pm_api_version function - no need for interface
- Move driver to drivers/firmware/
Reported by Arnd and Rob
drivers/firmware/Kconfig | 1 + drivers/firmware/Makefile | 1 + drivers/firmware/xilinx/Kconfig | 6 + drivers/firmware/xilinx/Makefile | 1 + drivers/firmware/xilinx/zynqmp/firmware.c | 382 ++++++++++++++++++++++++ include/linux/firmware/xilinx/zynqmp/firmware.h | 232 ++++++++++++++ 6 files changed, 623 insertions(+) create mode 100644 drivers/firmware/xilinx/Kconfig create mode 100644 drivers/firmware/xilinx/Makefile create mode 100644 drivers/firmware/xilinx/zynqmp/firmware.c create mode 100644 include/linux/firmware/xilinx/zynqmp/firmware.h
drivers/firmware/Kconfig +1 -0
@@ -238,5 +238,6 @@ source "drivers/firmware/google/Kconfig" source "drivers/firmware/efi/Kconfig" source "drivers/firmware/meson/Kconfig" source "drivers/firmware/tegra/Kconfig" +source "drivers/firmware/xilinx/Kconfig" endmenu
drivers/firmware/Makefile +1 -0
@@ -29,3 +29,4 @@ obj-$(CONFIG_GOOGLE_FIRMWARE) += google/ obj-$(CONFIG_EFI) += efi/ obj-$(CONFIG_UEFI_CPER) += efi/ obj-y += tegra/ +obj-y += xilinx/
drivers/firmware/xilinx/Kconfig new file +6 -0
@@ -0,0 +1,6 @@ +# +# Xilinx ZYNQ MPSoC configuration +# +menuconfig SOC_XILINX_ZYNQMP + bool "Xilinx Zynq MPSoC Firmware driver support" + depends on ARCH_ZYNQMP
drivers/firmware/xilinx/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_SOC_XILINX_ZYNQMP) += zynqmp/firmware.o
drivers/firmware/xilinx/zynqmp/firmware.c new file +382 -0
382 lines not on this page · raw message
include/linux/firmware/xilinx/zynqmp/firmware.h new file +232 -0
232 lines not on this page · raw message
Signature · 1 line
1.9.1
Quoted 8 lines · Michal Simek
Hi,
xilinx is using this interface for very long time and we can't merge our driver changes to Linux because of missing communication layer with firmware. This interface was developed before scpi and scmi was available. In connection to power management scpi and scmi are missing pieces which we already use. There is a separate discussion how to extend scmi to support all our use cases.
So maybe we should wait and see where this discussion is going before we merge yet another firmware interface?
Quoted 2 lines
This simply patch is not adding any power management features but only adding minimum functionality which are needed for drivers.
I don't get it. 600 lines of firmware interface that isn't used by anything? Or is it? Needed by which driver?
Thanks,
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Re: [PATCHv2 1/3] dt: xilinx: zynqmp: Add bindings for PM firmware
In reply to Michal SimekQuoted 23 lines · Michal Simek
From: Soren Brinkmann <[email protected]>
Document the DT bindings for the Zynq UltraScale+ PM Firmware.
Signed-off-by Soren Brinkmann <[email protected]>Signed-off-by Michal Simek <[email protected]>---
Changes in v2:
- Move to bindings/firmware and also add it to firmware node Reported-by Rob.../bindings/firmware/xlnx,zynqmp-pm.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txtDocumentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt new file +1
-0@@ -0,0 +1,22 @@ +Xilinx Zynq MPSoC Firmware Device Tree Bindings
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt line 11
Quoted 10 lines
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt new file +10
-0+ +The zynqmp-pm node describes the interface to platform firmware. + +Required properties: + - compatible: Must contain: "xlnx,zynqmp-pm" + - method: The method of calling the PM-API firmware layer. + Permitted values are: + - "smc" : To be used in configurations without a hypervisor + - "hvc" : To be used when hypervisor is present + - interrupts: Interrupt specifier
What exactly is this interrupt ? I see it's not SGI, so if it's SPI, where does this originate from ? How is that dealt ?
Signature · 2 lines
Regards, Sudeep
Re: [PATCHv2 3/3] soc: xilinx: zynqmp: Add firmware interface
In reply to Michal SimekQuoted 1 line · Michal Simek
This patch is adding communication layer with firmware.
Which is used for what, exactly?
There are no users of this API introduced in this series.
Quoted 2 lines
The most of request are coming thought ATF to PMUFW (platform management unit).
[...]
Quoted 9 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +9
-0+/** +* get_set_conduit_method - Choose SMC or HVC based communication +* @np: Pointer to the device_node structure +* +* Use SMC or HVC-based functions to communicate with EL2/EL3 +*/ +static void get_set_conduit_method (struct device_node *np) +{ +const char *method;
drivers/firmware/xilinx/zynqmp/firmware.c line 214
Quoted 10 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +10
-0+struct device *dev; + + dev = container_of(&np, struct device, of_node); + +if (of_property_read_string (np,"method" , &method)) { +dev_warn (dev,"%s Missing \"method\" property - defaulting to smc\n" , + __func__); + do_fw_call = do_fw_call_smc; +return ; + }
This is a mandatory property. Don't guess if it's not present.
[...]
Quoted 4 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +4
-0+/** +* zynqmp_pm_reset_assert - Request setting of reset (1 - assert, 0 - release) +* @reset: Reset to be configured +* @assert_flag: Flag stating should reset be asserted (1) or
drivers/firmware/xilinx/zynqmp/firmware.c line 241
Quoted 10 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +10
-0+* released (0) +* +* Return: Returns status, either success or error+reason +*/ +int zynqmp_pm_reset_assert (const enum zynqmp_pm_reset reset, +const enum zynqmp_pm_reset_action assert_flag) +{ +return invoke_pm_fn (RESET_ASSERT , reset, assert_flag,0 ,0 ,NULL ); +} +EXPORT_SYMBOL_GPL (zynqmp_pm_reset_assert);
Where is the reset nr expected to come from?
Nothing in this series defined bindings for those.
Quoted 32 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +32
-0+/** +* zynqmp_pm_mmio_write - Perform write to protected mmio +* @address: Address to write to +* @mask: Mask to apply +* @value: Value to write +* +* This function provides access to PM-related control registers +* that may not be directly accessible by a particular PU. +* +* Return: Returns status, either success or error+reason +*/ +int zynqmp_pm_mmio_write (const u32 address, +const u32 mask, +const u32 value) +{ +return invoke_pm_fn (MMIO_WRITE , address, mask, value,0 ,NULL ); +} +EXPORT_SYMBOL_GPL (zynqmp_pm_mmio_write); + +/** +* zynqmp_pm_mmio_read - Read value from protected mmio +* @address: Address to write to +* @value: Value to read +* +* This function provides access to PM-related control registers +* that may not be directly accessible by a particular PU. +* +* Return: Returns status, either success or error+reason +*/ +int zynqmp_pm_mmio_read (const u32 address,u32 *value) +{ +u32 ret_payload[PAYLOAD_ARG_CNT ];
drivers/firmware/xilinx/zynqmp/firmware.c line 305
Quoted 10 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +10
-0+ +if (!value) +return -EINVAL ; + +invoke_pm_fn (MMIO_READ , address,0 ,0 ,0 , ret_payload); + *value = ret_payload[1 ]; + +return zynqmp_pm_ret_code ((enum pm_ret_status )ret_payload[0 ]); +} +EXPORT_SYMBOL_GPL (zynqmp_pm_mmio_read);
I guess these are to secure memory?
How are these safe?
What validation is done on the secure side?
Quoted 19 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +19
-0+ +/** +* zynqmp_pm_fpga_load - Perform the fpga load +* @address: Address to write to +* @size: pl bitstream size +* @flags: +* BIT(0) - Bit-stream type. +* 0 - Full Bit-stream. +* 1 - Partial Bit-stream. +* BIT(1) - Authentication. +* 1 - Enable. +* 0 - Disable. +* BIT(2) - Encryption. +* 1 - Enable. +* 0 - Disable. +* NOTE - +* The current implementation supports only Full Bit-stream. +* +* This function provides access to xilfpga library to transfer
drivers/firmware/xilinx/zynqmp/firmware.c line 334
Quoted 10 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +10
-0+* the required bitstream into PL. +* +* Return: Returns status, either success or error+reason +*/ +int zynqmp_pm_fpga_load (const u64 address,const u32 size,const u32 flags) +{ +return invoke_pm_fn (FPGA_LOAD , (u32 )address, + ((u32)(address >>32 )), size, flags,NULL ); +} +EXPORT_SYMBOL_GPL (zynqmp_pm_fpga_load);
What space is the address in?
*which* FPGA instance is this? Surely this needs to be linked to a node in the DT by some means?
[...]
Quoted 4 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +4
-0+static int __init zynqmp_plat_init (void ) +{ +struct device_node *np; +int ret =0 ;
drivers/firmware/xilinx/zynqmp/firmware.c line 372
Quoted 10 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +10
-0+ + np =of_find_compatible_node (NULL ,NULL ,"xlnx,zynqmp" ); +if (!np) +return 0 ; +of_node_put (np); + +/* We're running on a ZynqMP machine, the PM node is mandatory. */ + np =of_find_compatible_node (NULL ,NULL ,"xlnx,zynqmp-pm" ); +if (!np) +panic ("%s: pm node not found\n" , __func__);
NAK to this panic(). It breaks existing DTBs.
[...]
Quoted 5 lines
include/linux/firmware/xilinx/zynqmp/firmware.h new file +5
-0+enum pm_api_id { +/* Miscellaneous API functions: */ +GET_API_VERSION =1 , +SET_CONFIGURATION , +GET_NODE_STATUS ,
include/linux/firmware/xilinx/zynqmp/firmware.h line 62
Quoted 10 lines
include/linux/firmware/xilinx/zynqmp/firmware.h new file +10
-0+GET_OPERATING_CHARACTERISTIC , +REGISTER_NOTIFIER , +/* API for suspending of PUs: */ +REQUEST_SUSPEND , +SELF_SUSPEND , +FORCE_POWERDOWN , +ABORT_SUSPEND , +REQUEST_WAKEUP , +SET_WAKEUP_SOURCE , + SYSTEM_SHUTDOWN,
What are these? They sound like they overlap with PSCI.
Thanks,
Mark.
Re: [PATCHv2 1/3] dt: xilinx: zynqmp: Add bindings for PM firmware
In reply to Michal SimekQuoted 22 lines · Michal Simek
From: Soren Brinkmann <[email protected]>
Document the DT bindings for the Zynq UltraScale+ PM Firmware.
Signed-off-by Soren Brinkmann <[email protected]>Signed-off-by Michal Simek <[email protected]>---
Changes in v2:
- Move to bindings/firmware and also add it to firmware node Reported-by Rob.../bindings/firmware/xlnx,zynqmp-pm.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txtDocumentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt new file +0
-0
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt line 3
Quoted 3 lines
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt new file +3
-0@@ -0,0 +1,22 @@ +Xilinx Zynq MPSoC Firmware Device Tree Bindings + +The zynqmp-pm node describes the interface to platform firmware.
Is there any documentation for this? I appreciate that the answer might be "no".
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt line 11
Quoted 7 lines
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt new file +7
-0+Required properties: + - compatible: Must contain: "xlnx,zynqmp-pm" + - method: The method of calling the PM-API firmware layer. + Permitted values are: + - "smc" : To be used in configurations without a hypervisor + - "hvc" : To be used when hypervisor is present + - interrupts: Interrupt specifier
For what, exactly?
Is this an interrupt for FW to signal the OS somehow?
If so, is it an SGI?
Thanks,
Mark.
Quoted 10 lines · Marc Zyngier
Quoted 8 lines · Michal Simek
Hi,
xilinx is using this interface for very long time and we can't merge our driver changes to Linux because of missing communication layer with firmware. This interface was developed before scpi and scmi was available. In connection to power management scpi and scmi are missing pieces which we already use. There is a separate discussion how to extend scmi to support all our use cases.
Quoted 2 lines
So maybe we should wait and see where this discussion is going before we merge yet another firmware interface?
It will take a lot of time when this discussion ends and I can't see any benefit to hold all
Quoted 5 lines
Quoted 2 lines
This simply patch is not adding any power management features but only adding minimum functionality which are needed for drivers.
I don't get it. 600 lines of firmware interface that isn't used by anything? Or is it? Needed by which driver?
I can send that drivers for review. pinctrl, fpga manager, nvmem driver, clock, serdes phy and reset drivers.
But this driver need to come first because they depend on this.
Thanks,
Michal
Re: [PATCHv2 1/3] dt: xilinx: zynqmp: Add bindings for PM firmware
In reply to Mark RutlandQuoted 17 lines · Mark Rutland
Quoted 16 lines · Michal Simek
From: Soren Brinkmann <[email protected]>
Document the DT bindings for the Zynq UltraScale+ PM Firmware.
Signed-off-by Soren Brinkmann <[email protected]>Signed-off-by Michal Simek <[email protected]>---
Changes in v2:
- Move to bindings/firmware and also add it to firmware node Reported-by Rob.../bindings/firmware/xlnx,zynqmp-pm.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt
Quoted 12 lines
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt line 3
Quoted 9 lines
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt new file +3
-0@@ -0,0 +1,22 @@ +Xilinx Zynq MPSoC Firmware Device Tree Bindings + +The zynqmp-pm node describes the interface to platform firmware.Is there any documentation for this? I appreciate that the answer might be "no".
We have pm documentation somewhere but not sure if this firmware interface is the part of it. Let me ask around and see what I can find out.
Quoted 11 lines
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt line 11
Quoted 8 lines
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt new file +7
-0+Required properties: + - compatible: Must contain: "xlnx,zynqmp-pm" + - method: The method of calling the PM-API firmware layer. + Permitted values are: + - "smc" : To be used in configurations without a hypervisor + - "hvc" : To be used when hypervisor is present + - interrupts: Interrupt specifierFor what, exactly?
Quoted 3 lines
Is this an interrupt for FW to signal the OS somehow?
If so, is it an SGI?
This is SPI. There is a dedicated hardware on the chip for communication with APU.
https://www.xilinx.com/support/documentation/user_guides/ug1085-zynq-ultrascale-trm.pdf
page 275
Anyway I don't need this for this driver that's why I will remove it.
Thanks,
Michal
Re: [PATCHv2 1/3] dt: xilinx: zynqmp: Add bindings for PM firmware
In reply to Sudeep HollaQuoted 31 lines · Sudeep Holla
Quoted 28 lines · Michal Simek
From: Soren Brinkmann <[email protected]>
Document the DT bindings for the Zynq UltraScale+ PM Firmware.
Signed-off-by Soren Brinkmann <[email protected]>Signed-off-by Michal Simek <[email protected]>---
Changes in v2:
- Move to bindings/firmware and also add it to firmware node Reported-by Rob.../bindings/firmware/xlnx,zynqmp-pm.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txtDocumentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt new file +6
-0@@ -0,0 +1,22 @@ +Xilinx Zynq MPSoC Firmware Device Tree Bindings + +The zynqmp-pm node describes the interface to platform firmware. + +Required properties: + - compatible: Must contain: "xlnx,zynqmp-pm"
Quoted 9 lines
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt line 11
Quoted 5 lines
Documentation/devicetree/bindings/firmware/xlnx,zynqmp-pm.txt new file +5
-0+ - method: The method of calling the PM-API firmware layer. + Permitted values are: + - "smc" : To be used in configurations without a hypervisor + - "hvc" : To be used when hypervisor is present + - interrupts: Interrupt specifierWhat exactly is this interrupt ? I see it's not SGI, so if it's SPI, where does this originate from ? How is that dealt ?
Please look at my response to Mark for more details.
Thanks,
Michal
Re: [PATCHv2 3/3] soc: xilinx: zynqmp: Add firmware interface
In reply to Mark RutlandQuoted 4 lines · Mark Rutland
Quoted 1 line · Michal Simek
This patch is adding communication layer with firmware.
Which is used for what, exactly?
pinctrl, fpga manager, nvmem driver, clock, serdes phy and reset drivers.
Quoted 1 line
There are no users of this API introduced in this series.
But this driver need to come first because they depend on this. If you want to look at that drivers please take a look at
https://github.com/Xilinx/linux-xlnx
Quoted 19 lines
Quoted 3 lines
The most of request are coming thought ATF to PMUFW (platform management unit).
[...]
Quoted 13 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +13
-0+/** +* get_set_conduit_method - Choose SMC or HVC based communication +* @np: Pointer to the device_node structure +* +* Use SMC or HVC-based functions to communicate with EL2/EL3 +*/ +static void get_set_conduit_method (struct device_node *np) +{ +const char *method; +struct device *dev; + + dev = container_of(&np, struct device, of_node); +
Quoted 8 lines
drivers/firmware/xilinx/zynqmp/firmware.c line 214
Quoted 6 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +6
-0+if (of_property_read_string (np,"method" , &method)) { +dev_warn (dev,"%s Missing \"method\" property - defaulting to smc\n" , + __func__); + do_fw_call = do_fw_call_smc; +return ; + }This is a mandatory property. Don't guess if it's not present.
Fixed in next version
Quoted 20 lines
[...]
Quoted 4 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +4
-0+/** +* zynqmp_pm_reset_assert - Request setting of reset (1 - assert, 0 - release) +* @reset: Reset to be configured +* @assert_flag: Flag stating should reset be asserted (1) or drivers/firmware/xilinx/zynqmp/firmware.c line 241
Quoted 10 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +10
-0+* released (0) +* +* Return: Returns status, either success or error+reason +*/ +int zynqmp_pm_reset_assert (const enum zynqmp_pm_reset reset, +const enum zynqmp_pm_reset_action assert_flag) +{ +return invoke_pm_fn (RESET_ASSERT , reset, assert_flag,0 ,0 ,NULL ); +} +EXPORT_SYMBOL_GPL (zynqmp_pm_reset_assert);Where is the reset nr expected to come from?
Quoted 1 line
Nothing in this series defined bindings for those.
Numbers will be the part of reset driver binding but numbers are coming from DT.
This is the usage.
serdes: zynqmp_phy at fd400000 {
compatible = "xlnx,zynqmp-psgtr";
status = "disabled";
reg = <0x0 0xfd400000 0x0 0x40000>,
<0x0 0xfd3d0000 0x0 0x1000>,
<0x0 0xff5e0000 0x0 0x1000>;
reg-names = "serdes", "siou", "lpd";
nvmem-cells = <&soc_revision>;
nvmem-cell-names = "soc_revision";
resets = <&rst 16>, <&rst 59>, <&rst 60>,
<&rst 61>, <&rst 62>, <&rst 63>,
<&rst 64>, <&rst 3>, <&rst 29>,
<&rst 30>, <&rst 31>, <&rst 32>;
reset-names = "sata_rst", "usb0_crst", "usb1_crst",
"usb0_hibrst", "usb1_hibrst", "usb0_apbrst",
"usb1_apbrst", "dp_rst", "gem0_rst",
"gem1_rst", "gem2_rst", "gem3_rst";
lane0: lane0 {
#phy-cells = <4>;
};
lane1: lane1 {
#phy-cells = <4>;
};
lane2: lane2 {
#phy-cells = <4>;
};
lane3: lane3 {
#phy-cells = <4>;
};
};If you think that this shouldn't be the part of this patch, I can remove this part and send it as the part of reset driver.
Quoted 37 lines
Quoted 37 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +36
-0+/** +* zynqmp_pm_mmio_write - Perform write to protected mmio +* @address: Address to write to +* @mask: Mask to apply +* @value: Value to write +* +* This function provides access to PM-related control registers +* that may not be directly accessible by a particular PU. +* +* Return: Returns status, either success or error+reason +*/ +int zynqmp_pm_mmio_write (const u32 address, +const u32 mask, +const u32 value) +{ +return invoke_pm_fn (MMIO_WRITE , address, mask, value,0 ,NULL ); +} +EXPORT_SYMBOL_GPL (zynqmp_pm_mmio_write); + +/** +* zynqmp_pm_mmio_read - Read value from protected mmio +* @address: Address to write to +* @value: Value to read +* +* This function provides access to PM-related control registers +* that may not be directly accessible by a particular PU. +* +* Return: Returns status, either success or error+reason +*/ +int zynqmp_pm_mmio_read (const u32 address,u32 *value) +{ +u32 ret_payload[PAYLOAD_ARG_CNT ]; + +if (!value) +return -EINVAL ; +
Quoted 8 lines
drivers/firmware/xilinx/zynqmp/firmware.c line 305
Quoted 6 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +6
-0+invoke_pm_fn (MMIO_READ , address,0 ,0 ,0 , ret_payload); + *value = ret_payload[1 ]; + +return zynqmp_pm_ret_code ((enum pm_ret_status )ret_payload[0 ]); +} +EXPORT_SYMBOL_GPL (zynqmp_pm_mmio_read);I guess these are to secure memory?
yep.
Quoted 4 lines
How are these safe?
What validation is done on the secure side?
firmware is limiting access based on system setup.
Quoted 33 lines
Quoted 20 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +19
-0+ +/** +* zynqmp_pm_fpga_load - Perform the fpga load +* @address: Address to write to +* @size: pl bitstream size +* @flags: +* BIT(0) - Bit-stream type. +* 0 - Full Bit-stream. +* 1 - Partial Bit-stream. +* BIT(1) - Authentication. +* 1 - Enable. +* 0 - Disable. +* BIT(2) - Encryption. +* 1 - Enable. +* 0 - Disable. +* NOTE - +* The current implementation supports only Full Bit-stream. +* +* This function provides access to xilfpga library to transfer drivers/firmware/xilinx/zynqmp/firmware.c line 334
Quoted 10 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +10
-0+* the required bitstream into PL. +* +* Return: Returns status, either success or error+reason +*/ +int zynqmp_pm_fpga_load (const u64 address,const u32 size,const u32 flags) +{ +return invoke_pm_fn (FPGA_LOAD , (u32 )address, + ((u32)(address >>32 )), size, flags,NULL ); +} +EXPORT_SYMBOL_GPL (zynqmp_pm_fpga_load);What space is the address in?
Quoted 4 lines
*which* FPGA instance is this? Surely this needs to be linked to a node in the DT by some means?
[...]
It is the same case as reset functions above. If you think that this should be the part of fpga series I am happy to remove this part for this patch.
https://github.com/Xilinx/linux-xlnx/blob/master/drivers/fpga/zynqmp-fpga.c
Quoted 17 lines
Quoted 5 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +4
-0+static int __init zynqmp_plat_init (void ) +{ +struct device_node *np; +int ret =0 ;drivers/firmware/xilinx/zynqmp/firmware.c line 372
Quoted 10 lines
drivers/firmware/xilinx/zynqmp/firmware.c new file +10
-0+ + np =of_find_compatible_node (NULL ,NULL ,"xlnx,zynqmp" ); +if (!np) +return 0 ; +of_node_put (np); + +/* We're running on a ZynqMP machine, the PM node is mandatory. */ + np =of_find_compatible_node (NULL ,NULL ,"xlnx,zynqmp-pm" ); +if (!np) +panic ("%s: pm node not found\n" , __func__);NAK to this
panic(). It breaks existing DTBs.
Ok. I have fixed this.
Quoted 12 lines
[...]
Quoted 9 lines
include/linux/firmware/xilinx/zynqmp/firmware.h new file +9
-0+enum pm_api_id { +/* Miscellaneous API functions: */ +GET_API_VERSION =1 , +SET_CONFIGURATION , +GET_NODE_STATUS , +GET_OPERATING_CHARACTERISTIC , +REGISTER_NOTIFIER , +/* API for suspending of PUs: */ +REQUEST_SUSPEND ,
Quoted 8 lines
include/linux/firmware/xilinx/zynqmp/firmware.h line 62
Quoted 6 lines
include/linux/firmware/xilinx/zynqmp/firmware.h new file +6
-0+SELF_SUSPEND , +FORCE_POWERDOWN , +ABORT_SUSPEND , +REQUEST_WAKEUP , +SET_WAKEUP_SOURCE , + SYSTEM_SHUTDOWN,What are these? They sound like they overlap with PSCI.
PM guys can comment this more than I but AFAIK PSCI is not providing enough functionality for our chip that's why additional things needs to be done. I can remove them as is above with reset/fpga stuff.
Thanks,
Michal
Quoted 11 lines · Michal Simek
Quoted 10 lines · Marc Zyngier
Quoted 8 lines · Michal Simek
Hi,
xilinx is using this interface for very long time and we can't merge our driver changes to Linux because of missing communication layer with firmware. This interface was developed before scpi and scmi was available. In connection to power management scpi and scmi are missing pieces which we already use. There is a separate discussion how to extend scmi to support all our use cases.
Quoted 5 lines
Quoted 2 lines
So maybe we should wait and see where this discussion is going before we merge yet another firmware interface?
It will take a lot of time when this discussion ends and I can't see any benefit to hold all
Well, so far, the benefit of this series is exactly nil, as the code it brings is *unused*. It is impossible to review in isolation.
In the meantime, you can continue finding out how *not* to have to merge this code, and instead focus on using the infrastructure we already have, or at least influence the infrastructure that is being designed. It will be much better than dumping yet another slab of "I'm so different" code that is going to ultimately bitrot.
Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
This simply patch is not adding any power management features but only adding minimum functionality which are needed for drivers.
I don't get it. 600 lines of firmware interface that isn't used by anything? Or is it? Needed by which driver?
I can send that drivers for review. pinctrl, fpga manager, nvmem driver, clock, serdes phy and reset drivers.
But this driver need to come first because they depend on this.
My take is: no users, no use.
And if you need to hack all these drivers to hook into your specific firmware interface, I feel that you're doing it wrong. We have common APIs for device drivers. If these APIs are not good enough, we extend them. But designing drivers for a given firmware interface?
Thanks,
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Quoted 12 lines · Marc Zyngier
Quoted 11 lines · Michal Simek
Quoted 10 lines · Marc Zyngier
Quoted 8 lines · Michal Simek
Hi,
xilinx is using this interface for very long time and we can't merge our driver changes to Linux because of missing communication layer with firmware. This interface was developed before scpi and scmi was available. In connection to power management scpi and scmi are missing pieces which we already use. There is a separate discussion how to extend scmi to support all our use cases.
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
So maybe we should wait and see where this discussion is going before we merge yet another firmware interface?
It will take a lot of time when this discussion ends and I can't see any benefit to hold all
Well, so far, the benefit of this series is exactly nil, as the code it brings is *unused*. It is impossible to review in isolation.
Ok. I will add others drivers to this series that's not a problem.
Quoted 5 lines
In the meantime, you can continue finding out how *not* to have to merge this code, and instead focus on using the infrastructure we already have, or at least influence the infrastructure that is being designed. It will be much better than dumping yet another slab of "I'm so different" code that is going to ultimately bitrot.
I am happy to look the better proposed way. SCPI is ancient and SCMI is replacement and not merged yet. We already had a call with arm and Sudeep was on it too where outcome from that was that we can't use that because it doesn't support what we need to support now.
This code is compatible with current ARM SMC calling convention which allocate range for vendors.
0xC2000000-0xC200FFFF SMC64: SiP Service Calls
Provides interfaces to SoC implementation-specific services on this platform, for example secure platform initialization, configuration , and some power control services.
Quoted 12 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
This simply patch is not adding any power management features but only adding minimum functionality which are needed for drivers.
Quoted 6 lines
Quoted 2 lines
I don't get it. 600 lines of firmware interface that isn't used by anything? Or is it? Needed by which driver?
I can send that drivers for review. pinctrl, fpga manager, nvmem driver, clock, serdes phy and reset drivers.
But this driver need to come first because they depend on this.
Quoted 6 lines
My take is: no users, no use.
And if you need to hack all these drivers to hook into your specific firmware interface, I feel that you're doing it wrong. We have common APIs for device drivers. If these APIs are not good enough, we extend them. But designing drivers for a given firmware interface?
Let me send that users of this.
Thanks,
Michal
Quoted 31 lines · Michal Simek
Quoted 12 lines · Marc Zyngier
Quoted 11 lines · Michal Simek
Quoted 10 lines · Marc Zyngier
Quoted 8 lines · Michal Simek
Hi,
xilinx is using this interface for very long time and we can't merge our driver changes to Linux because of missing communication layer with firmware. This interface was developed before scpi and scmi was available. In connection to power management scpi and scmi are missing pieces which we already use. There is a separate discussion how to extend scmi to support all our use cases.
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
So maybe we should wait and see where this discussion is going before we merge yet another firmware interface?
It will take a lot of time when this discussion ends and I can't see any benefit to hold all
Well, so far, the benefit of this series is exactly nil, as the code it brings is *unused*. It is impossible to review in isolation.
Ok. I will add others drivers to this series that's not a problem.
Quoted 5 lines
In the meantime, you can continue finding out how *not* to have to merge this code, and instead focus on using the infrastructure we already have, or at least influence the infrastructure that is being designed. It will be much better than dumping yet another slab of "I'm so different" code that is going to ultimately bitrot.
Quoted 5 lines
I am happy to look the better proposed way. SCPI is ancient and SCMI is replacement and not merged yet. We already had a call with arm and Sudeep was on it too where outcome from that was that we can't use that because it doesn't support what we need to support now.
OK, none of the specifics were discussed in the meeting to conclude that SCMI can't be used. My takeaway from the meeting was Xilinx has this interface for long and being deployed in various systems. I would like to get into specifics before discarding SCMI as unusable. What bothers me more is that why was that not raised during the specification review which was quite a long period IMO ? I tend to think Xilinx never bothered to look/review the specification as this f/w interface was already there.
However I still can't see why this was posted once we started pushing out SCMI patches especially given that this f/w interface was there for long and no attempts were made in past to upstream this.
Also I am not dismissing the series yet, but if I find that SCMI can be used(after getting specifics from this series myself), I will at-least argue against the "SCMI can't be used" argument.
Signature · 2 lines
Regards, Sudeep
Quoted 40 lines · Sudeep Holla
Quoted 31 lines · Michal Simek
Quoted 12 lines · Marc Zyngier
Quoted 11 lines · Michal Simek
Quoted 10 lines · Marc Zyngier
Quoted 8 lines · Michal Simek
Hi,
xilinx is using this interface for very long time and we can't merge our driver changes to Linux because of missing communication layer with firmware. This interface was developed before scpi and scmi was available. In connection to power management scpi and scmi are missing pieces which we already use. There is a separate discussion how to extend scmi to support all our use cases.
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
So maybe we should wait and see where this discussion is going before we merge yet another firmware interface?
It will take a lot of time when this discussion ends and I can't see any benefit to hold all
Well, so far, the benefit of this series is exactly nil, as the code it brings is *unused*. It is impossible to review in isolation.
Ok. I will add others drivers to this series that's not a problem.
Quoted 5 lines
In the meantime, you can continue finding out how *not* to have to merge this code, and instead focus on using the infrastructure we already have, or at least influence the infrastructure that is being designed. It will be much better than dumping yet another slab of "I'm so different" code that is going to ultimately bitrot.
Quoted 5 lines
I am happy to look the better proposed way. SCPI is ancient and SCMI is replacement and not merged yet. We already had a call with arm and Sudeep was on it too where outcome from that was that we can't use that because it doesn't support what we need to support now.
Quoted 8 lines
OK, none of the specifics were discussed in the meeting to conclude that SCMI can't be used. My takeaway from the meeting was Xilinx has this interface for long and being deployed in various systems. I would like to get into specifics before discarding SCMI as unusable. What bothers me more is that why was that not raised during the specification review which was quite a long period IMO ? I tend to think Xilinx never bothered to look/review the specification as this f/w interface was already there.
Xilinx is using this interface from Aug 2015. I am not aware about any invitation to spec review. And not sure who was there from xilinx.
Quoted 4 lines
However I still can't see why this was posted once we started pushing out SCMI patches especially given that this f/w interface was there for long and no attempts were made in past to upstream this.
The reason is simple which is upstream our code which depends on this communication layer. I don't think there is quick path to move to different interface than this one.
Quoted 4 lines
Also I am not dismissing the series yet, but if I find that SCMI can be used(after getting specifics from this series myself), I will at-least argue against the "SCMI can't be used" argument.
This is not my argument that we can't use SCMI. This is what was my understanding from that meeting we had. And definitely there is no quick path for us to switch to SCMI and breaks all current existing customers.
And this interface is just in the same position as current SCPI. It means you have SCPI already merged and you are adding new one. SCMI could be maybe also just SCPIv2.
And when it is merged you are going to move all targets to this new interface. The same is for us but instead of scpi it is this interface we use and test.
Thanks,
Michal
Quoted 56 lines · Michal Simek
Quoted 46 lines · Sudeep Holla
Quoted 36 lines · Michal Simek
Quoted 17 lines · Marc Zyngier
Quoted 16 lines · Michal Simek
Quoted 14 lines · Marc Zyngier
Quoted 10 lines · Michal Simek
Hi,
xilinx is using this interface for very long time and we can't merge our driver changes to Linux because of missing communication layer with firmware. This interface was developed before scpi and scmi was available. In connection to power management scpi and scmi are missing pieces which we already use. There is a separate discussion how to extend scmi to support all our use cases.
So maybe we should wait and see where this discussion is going before we merge yet another firmware interface?
Quoted 7 lines
Quoted 2 lines
It will take a lot of time when this discussion ends and I can't see any benefit to hold all
Well, so far, the benefit of this series is exactly nil, as the code it brings is *unused*. It is impossible to review in isolation.
Ok. I will add others drivers to this series that's not a problem.
Quoted 6 lines
In the meantime, you can continue finding out how *not* to have to merge this code, and instead focus on using the infrastructure we already have, or at least influence the infrastructure that is being designed. It will be much better than dumping yet another slab of "I'm so different" code that is going to ultimately bitrot.
Quoted 6 lines
I am happy to look the better proposed way. SCPI is ancient and SCMI is replacement and not merged yet. We already had a call with arm and Sudeep was on it too where outcome from that was that we can't use that because it doesn't support what we need to support now.
Quoted 8 lines
OK, none of the specifics were discussed in the meeting to conclude that SCMI can't be used. My takeaway from the meeting was Xilinx has this interface for long and being deployed in various systems. I would like to get into specifics before discarding SCMI as unusable. What bothers me more is that why was that not raised during the specification review which was quite a long period IMO ? I tend to think Xilinx never bothered to look/review the specification as this f/w interface was already there.
Quoted 4 lines
Xilinx is using this interface from Aug 2015. I am not aware about any invitation to spec review. And not sure who was there from xilinx.
Sure, I can understand and that's not a problem but Xilinx was involved.
Quoted 10 lines
Quoted 5 lines
However I still can't see why this was posted once we started pushing out SCMI patches especially given that this f/w interface was there for long and no attempts were made in past to upstream this.
The reason is simple which is upstream our code which depends on this communication layer. I don't think there is quick path to move to different interface than this one.
Do you mean "smc" when you refer communication layer ? If so, that's fine. You can use "smc" as transport with SCMI if you want, specification doesn't prevent that.
Quoted 10 lines
Quoted 4 lines
Also I am not dismissing the series yet, but if I find that SCMI can be used(after getting specifics from this series myself), I will at-least argue against the "SCMI can't be used" argument.
This is not my argument that we can't use SCMI. This is what was my understanding from that meeting we had. And definitely there is no quick path for us to switch to SCMI and breaks all current existing customers.
I understand the latter and I mentioned the same earlier, but I disagree with the former. That meeting was mostly introduction(and informal IMO) and didn't involve anything at the technical level.
Quoted 3 lines
And this interface is just in the same position as current SCPI. It means you have SCPI already merged and you are adding new one. SCMI could be maybe also just SCPIv2.
Agreed, but it was posted as soon as the specification is out and so is the SCMI. I am not arguing it as a point, but just mentioning that this post was simply bad timing :)
Signature · 2 lines
Regards, Sudeep
Quoted 72 lines · Sudeep Holla
Quoted 56 lines · Michal Simek
Quoted 46 lines · Sudeep Holla
Quoted 36 lines · Michal Simek
Quoted 17 lines · Marc Zyngier
Quoted 16 lines · Michal Simek
Quoted 14 lines · Marc Zyngier
Quoted 10 lines · Michal Simek
Hi,
xilinx is using this interface for very long time and we can't merge our driver changes to Linux because of missing communication layer with firmware. This interface was developed before scpi and scmi was available. In connection to power management scpi and scmi are missing pieces which we already use. There is a separate discussion how to extend scmi to support all our use cases.
So maybe we should wait and see where this discussion is going before we merge yet another firmware interface?
Quoted 7 lines
Quoted 2 lines
It will take a lot of time when this discussion ends and I can't see any benefit to hold all
Well, so far, the benefit of this series is exactly nil, as the code it brings is *unused*. It is impossible to review in isolation.
Ok. I will add others drivers to this series that's not a problem.
Quoted 6 lines
In the meantime, you can continue finding out how *not* to have to merge this code, and instead focus on using the infrastructure we already have, or at least influence the infrastructure that is being designed. It will be much better than dumping yet another slab of "I'm so different" code that is going to ultimately bitrot.
Quoted 6 lines
I am happy to look the better proposed way. SCPI is ancient and SCMI is replacement and not merged yet. We already had a call with arm and Sudeep was on it too where outcome from that was that we can't use that because it doesn't support what we need to support now.
Quoted 8 lines
OK, none of the specifics were discussed in the meeting to conclude that SCMI can't be used. My takeaway from the meeting was Xilinx has this interface for long and being deployed in various systems. I would like to get into specifics before discarding SCMI as unusable. What bothers me more is that why was that not raised during the specification review which was quite a long period IMO ? I tend to think Xilinx never bothered to look/review the specification as this f/w interface was already there.
Quoted 4 lines
Xilinx is using this interface from Aug 2015. I am not aware about any invitation to spec review. And not sure who was there from xilinx.
Sure, I can understand and that's not a problem but Xilinx was involved.
Quoted 6 lines
Quoted 5 lines
However I still can't see why this was posted once we started pushing out SCMI patches especially given that this f/w interface was there for long and no attempts were made in past to upstream this.
Quoted 8 lines
Quoted 4 lines
The reason is simple which is upstream our code which depends on this communication layer. I don't think there is quick path to move to different interface than this one.
Do you mean "smc" when you refer communication layer ? If so, that's fine. You can use "smc" as transport with SCMI if you want, specification doesn't prevent that.
yep, just smc or hvc.
Quoted 11 lines
Quoted 10 lines
Quoted 4 lines
Also I am not dismissing the series yet, but if I find that SCMI can be used(after getting specifics from this series myself), I will at-least argue against the "SCMI can't be used" argument.
This is not my argument that we can't use SCMI. This is what was my understanding from that meeting we had. And definitely there is no quick path for us to switch to SCMI and breaks all current existing customers.
Quoted 3 lines
I understand the latter and I mentioned the same earlier, but I disagree with the former. That meeting was mostly introduction(and informal IMO) and didn't involve anything at the technical level.
Definitely the first one for me.
Quoted 7 lines
Quoted 3 lines
And this interface is just in the same position as current SCPI. It means you have SCPI already merged and you are adding new one. SCMI could be maybe also just SCPIv2.
Agreed, but it was posted as soon as the specification is out and so is the SCMI. I am not arguing it as a point, but just mentioning that this post was simply bad timing :)
Definitely not purpose just coincidence. SCMI v1 June 26, SCMI v2 Aug 4.
It is quite clear if Xilinx decides to use SCMI that there will be transition time between what we use for couple of years to new interface.
Thanks,
Michal