Add reset driver support for ZynqMP
v3 cover Add reset driver support for ZynqMP
Nava kishore Manne (3):
firmware: xilinx: Add reset API's
dt-bindings: reset: Add bindings for ZynqMP reset driver
reset: reset-zynqmp: Adding support for Xilinx zynqmp reset
controller.
.../bindings/reset/xlnx,zynqmp-reset.txt | 52 +++++++ drivers/firmware/xilinx/zynqmp.c | 40 ++++++ drivers/reset/Makefile | 1 + drivers/reset/reset-zynqmp.c | 114 +++++++++++++++ .../dt-bindings/reset/xlnx-zynqmp-resets.h | 130 +++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 136 ++++++++++++++++++ 6 files changed, 473 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/xlnx,zynqmp-reset.txt create mode 100644 drivers/reset/reset-zynqmp.c create mode 100644 include/dt-bindings/reset/xlnx-zynqmp-resets.h
Signature · 1 line
2.18.0
PATCH v3 1/3 firmware: xilinx: Add reset API's
This Patch Adds reset API's to support release, assert and status functionalities by using firmware interface.
---
Changes for v3:
-Modified the reset start and end macro
values as suggested by Vesa.
Changes for v2:
-None.
Changes for v1:
-None.
Changes for RFC-V3:
-None.
Changes for RFC-V2:
-New patch.
drivers/firmware/xilinx/zynqmp.c | 40 ++++++++ include/linux/firmware/xlnx-zynqmp.h | 136 +++++++++++++++++++++++++++ 2 files changed, 176 insertions(+)
drivers/firmware/xilinx/zynqmp.c +40 -0
@@ -469,6 +469,44 @@ static int zynqmp_pm_ioctl(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, arg1, arg2, out); } +/** +* 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 +* released (0) +* +* Return: Returns status, either success or error+reason +*/ +static int zynqmp_pm_reset_assert (const enum zynqmp_pm_reset reset, +const enum zynqmp_pm_reset_action assert_flag) +{ +return zynqmp_pm_invoke_fn (PM_RESET_ASSERT , reset, assert_flag, +0 ,0 ,NULL ); +} + +/** +* zynqmp_pm_reset_get_status - Get status of the reset +* @reset: Reset whose status should be returned +* @status: Returned status +* +* Return: Returns status, either success or error+reason +*/ +static int zynqmp_pm_reset_get_status (const enum zynqmp_pm_reset reset, +u32 *status) +{ +u32 ret_payload[PAYLOAD_ARG_CNT ]; +int ret; + +if (!status) +return -EINVAL ; + + ret =zynqmp_pm_invoke_fn (PM_RESET_GET_STATUS , reset,0 , +0 ,0 , ret_payload); + *status = ret_payload[1 ]; + +return ret; +} +static const struct zynqmp_eemi_ops eemi_ops = { .get_api_version = zynqmp_pm_get_api_version, .query_data = zynqmp_pm_query_data,
@@ -482,6 +520,8 @@ static const struct zynqmp_eemi_ops eemi_ops = { .clock_setparent = zynqmp_pm_clock_setparent, .clock_getparent = zynqmp_pm_clock_getparent, .ioctl = zynqmp_pm_ioctl, + .reset_assert = zynqmp_pm_reset_assert, + .reset_get_status = zynqmp_pm_reset_get_status, };/**
include/linux/firmware/xlnx-zynqmp.h +136 -0
154 lines not on this page · raw message
Signature · 7 lines
2.18.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Philipp Zabel
maintainerRe: [PATCH v3 1/3] firmware: xilinx: Add reset API's
Quoted 4 lines · Nava kishore Manne
This Patch Adds reset API's to support release, assert and status functionalities by using firmware interface.
Signed-off-by Nava kishore Manne <[email protected]>
Michal, Should I merge this through the reset tree together with the reset driver?
regards
Philipp
Re: [PATCH v3 1/3] firmware: xilinx: Add reset API's
Quoted 8 lines · Philipp Zabel
Quoted 4 lines · Nava kishore Manne
This Patch Adds reset API's to support release, assert and status functionalities by using firmware interface.
Signed-off-by Nava kishore Manne <[email protected]>Michal, Should I merge this through the reset tree together with the reset driver?
It would be better if this goes via my tree. There is at least one series which also touches the same parts in these files that's why there will be collisions.
If you can review that I will take it via my tree and arm-soc guys to mainline.
Thanks,
Michal
Re: [PATCH v3 1/3] firmware: xilinx: Add reset API's
Quoted 10 lines · Michal Simek
Quoted 8 lines · Philipp Zabel
Quoted 4 lines · Nava kishore Manne
This Patch Adds reset API's to support release, assert and status functionalities by using firmware interface.
Signed-off-by Nava kishore Manne <[email protected]>Michal, Should I merge this through the reset tree together with the reset driver?
Quoted 6 lines
It would be better if this goes via my tree. There is at least one series which also touches the same parts in these files that's why there will be collisions.
If you can review that I will take it via my tree and arm-soc guys to mainline.
Ok, thanks. Feel free to add my
to to reset patches and pick them up together into your tree.
regards
Philipp
PATCH v3 2/3 dt-bindings: reset: Add bindings for ZynqMP reset driver
In reply to Nava kishore ManneAdd documentation to describe Xilinx ZynqMP reset driver bindings.
--- .../bindings/reset/xlnx,zynqmp-reset.txt | 52 +++++++ .../dt-bindings/reset/xlnx-zynqmp-resets.h | 130 ++++++++++++++++++ 2 files changed, 182 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/xlnx,zynqmp-reset.txt create mode 100644 include/dt-bindings/reset/xlnx-zynqmp-resets.h
Documentation/devicetree/bindings/reset/xlnx,zynqmp-reset.txt new file +52 -0
@@ -0,0 +1,52 @@ +-------------------------------------------------------------------------- + = Zynq UltraScale+ MPSoC reset driver binding = +-------------------------------------------------------------------------- +The Zynq UltraScale+ MPSoC has several different resets. + +See Chapter 36 of the Zynq UltraScale+ MPSoC TRM (UG) for more information +about zynqmp resets. + +Please also refer to reset.txt in this directory for common reset +controller binding usage. + +Required Properties: +- compatible: "xlnx,zynqmp-reset" +- #reset-cells: Specifies the number of cells needed to encode reset + line, should be 1 + +------- +Example +------- + +firmware { + zynqmp_firmware: zynqmp-firmware { + compatible = "xlnx,zynqmp-firmware"; + method = "smc"; + + zynqmp_reset: reset-controller { + compatible = "xlnx,zynqmp-reset"; + #reset-cells = <1>; + }; + }; +}; + +Specifying reset lines connected to IP modules +============================================== + +Device nodes that need access to reset lines should +specify them as a reset phandle in their corresponding node as +specified in reset.txt. + +For list of all valid reset indicies see +<dt-bindings/reset/xlnx-zynqmp-resets.h> + +Example: + +serdes: zynqmp_phy@fd400000 { + ... + + resets = <&zynqmp_reset ZYNQMP_RESET_SATA>; + reset-names = "sata_rst"; + + ... +};
include/dt-bindings/reset/xlnx-zynqmp-resets.h new file +130 -0
130 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH v3 3/3 reset: reset-zynqmp: Adding support for Xilinx zynqmp reset controller.
In reply to Nava kishore ManneAdd a reset controller driver for Xilinx Zynq UltraScale+ MPSoC. The zynqmp reset-controller has the ability to reset lines connected to different blocks and peripheral in the Soc.
---
Changes for v3:
-Fixed some minor coding issues as suggested
by philipp and vesa.
Changes for v2:
-Fixed some minor coding issues as suggested
by philipp.
Changes for v1:
-None.
Changes for RFC-V3:
-None.
Changes for RFC-V2:
-Moved eemi_ops into a priv struct as suggested
by philipp.
drivers/reset/Makefile | 1 + drivers/reset/reset-zynqmp.c | 114 +++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 drivers/reset/reset-zynqmp.c
drivers/reset/Makefile +1 -0
@@ -26,4 +26,5 @@ obj-$(CONFIG_RESET_TI_SYSCON) += reset-ti-syscon.o obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o obj-$(CONFIG_RESET_UNIPHIER_GLUE) += reset-uniphier-glue.o obj-$(CONFIG_RESET_ZYNQ) += reset-zynq.o +obj-$(CONFIG_ARCH_ZYNQMP) += reset-zynqmp.o
drivers/reset/reset-zynqmp.c new file +114 -0
114 lines not on this page · raw message
Signature · 1 line
2.18.0
Quoted 6 lines · Nava kishore Manne
Nava kishore Manne (3):
firmware: xilinx: Add reset API's
dt-bindings: reset: Add bindings for ZynqMP reset driver
reset: reset-zynqmp: Adding support for Xilinx zynqmp reset
controller.
Quoted 11 lines
.../bindings/reset/xlnx,zynqmp-reset.txt | 52 +++++++ drivers/firmware/xilinx/zynqmp.c | 40 ++++++ drivers/reset/Makefile | 1 + drivers/reset/reset-zynqmp.c | 114 +++++++++++++++ .../dt-bindings/reset/xlnx-zynqmp-resets.h | 130 +++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 136 ++++++++++++++++++ 6 files changed, 473 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/xlnx,zynqmp-reset.txt create mode 100644 drivers/reset/reset-zynqmp.c create mode 100644 include/dt-bindings/reset/xlnx-zynqmp-resets.h
Applied all to
https://github.com/Xilinx/linux-xlnx/commits/zynqmp/soc
Thanks,
Michal