Skip to content

HSM implementation for Allwinner D1

Samuel Holland opensbi 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest9 patches 0 repliesNew
  2. v2 RFC9 patches 0 repliesSuperseded
  3. v1 RFC2 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Fix typo in commit message
- Move comment about priority range to function declaration
- Rename irqchip_plic_* functions to fdt_plic_*
- Add a "bool smode" parameter instead of hard coding the context ID

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9lib: sbi_hsm: Call a device hook during hart resumeinclude/sbi/sbi_hsm.h lib/sbi/sbi_hsm.c+16 -00 replies
2/9lib: sbi_hsm: Assume a consistent resume addressinclude/sbi/sbi_hsm.h lib/sbi/sbi_hsm.c+22 -280 replies
3/9lib: irqchip/plic: Constify plic_data pointersinclude/sbi_utils/irqchip/plic.h lib/utils/irqchip/plic.c+11 -90 replies
4/9lib: irqchip/plic: Factor out a context init functioninclude/sbi_utils/irqchip/plic.h lib/utils/irqchip/plic.c platform/fpga/ariane/platform.c +1 more+48 -530 replies
5/9lib: irqchip/plic: Add context save/restore helpersinclude/sbi_utils/irqchip/plic.h lib/utils/irqchip/plic.c+54 -30 replies
6/9lib: irqchip/plic: Add priority save/restore helpersinclude/sbi_utils/irqchip/plic.h lib/utils/irqchip/plic.c+24 -00 replies
7/9lib: utils/irqchip: Add FDT wrappers for PLIC save/restore functionsinclude/sbi_utils/irqchip/fdt_irqchip_plic.h lib/utils/irqchip/fdt_irqchip_plic.c+52 -01 reply
8/9lib: utils/irqchip: Add wrapper for T-HEAD PLIC delegationinclude/sbi_utils/irqchip/fdt_irqchip_plic.h lib/utils/irqchip/fdt_irqchip_plic.c+9 -00 replies
9/9platform: Add HSM implementation for Allwinner D1platform/generic/allwinner/objects.mk platform/generic/allwinner/sun20i-d1.c+216 -01 reply

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by.

PatchAnup Patel
1/9R-b
2/9R-b
3/9R-b
4/9R-b
5/9R-b
6/9R-b
7/9R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/9] HSM implementation for Allwinner D1

This series adds a minimal working HSM implementation for the Allwinner D1 SoC. It works with the Linux sbi_cpuidle driver. Even with canned values for entry/exit latency, I am seeing 30-45 mW reduction in power usage at idle.

Since this is the first HSM driver submission, there is no example to follow. I have updated the series based on the comments to the RFCs. Still, comments welcome!

Regards,
Samuel

Changes in v3:
- Fix typo in commit message
- Move comment about priority range to function declaration
- Rename irqchip_plic_* functions to fdt_plic_*
- Add a "bool smode" parameter instead of hard coding the context ID

Changes in v2:
- Rebase on top of the current master branch
- Use array_size() from sbi_types.h
- Use a separate variable for each CSR instead of an array
- Use the PLIC helpers added in earlier patches
- Use the saved SIE bits to program the wakeup interrupt mask
- Set the entry address only once during cold boot
- Use the generic implementation for retentive suspend
- Clean up/add comments throughout the HSM implementation

Samuel Holland (9):
lib: sbi_hsm: Call a device hook during hart resume
lib: sbi_hsm: Assume a consistent resume address
lib: irqchip/plic: Constify plic_data pointers
lib: irqchip/plic: Factor out a context init function
lib: irqchip/plic: Add context save/restore helpers
lib: irqchip/plic: Add priority save/restore helpers
lib: utils/irqchip: Add FDT wrappers for PLIC save/restore functions
lib: utils/irqchip: Add wrapper for T-HEAD PLIC delegation
platform: Add HSM implementation for Allwinner D1

 include/sbi/sbi_hsm.h                        |  12 +-
 include/sbi_utils/irqchip/fdt_irqchip_plic.h |  22 ++
 include/sbi_utils/irqchip/plic.h             |  20 +-
 lib/sbi/sbi_hsm.c                            |  54 ++---
 lib/utils/irqchip/fdt_irqchip_plic.c         |  39 ++++
 lib/utils/irqchip/plic.c                     | 124 ++++++++---
 platform/fpga/ariane/platform.c              |  19 +-
 platform/fpga/openpiton/platform.c           |  19 +-
 platform/generic/allwinner/objects.mk        |   6 +
 platform/generic/allwinner/sun20i-d1.c       | 210 +++++++++++++++++++
 10 files changed, 442 insertions(+), 83 deletions(-)
 create mode 100644 include/sbi_utils/irqchip/fdt_irqchip_plic.h
 create mode 100644 platform/generic/allwinner/objects.mk
 create mode 100644 platform/generic/allwinner/sun20i-d1.c
Signature · 1 line
2.35.1