public inbox for opensbi@lists.infradead.org
 help / color / mirror / Atom feed
From: Nick Hu <nick.hu@sifive.com>
To: opensbi@lists.infradead.org
Cc: Nick Hu <nick.hu@sifive.com>,
	 Samuel Holland <samuel.holland@sifive.com>,
	 Anup Patel <anup@brainfault.org>,
	Vincent Chen <vincent.chen@sifive.com>,
	 Andy Chiu <andy.chiu@sifive.com>,
	Cyan Yang <cyan.yang@sifive.com>,
	 Yong-Xuan Wang <yongxuan.wang@sifive.com>
Subject: [PATCH v7 00/12] Add SiFive TMC0 and SMC0 driver
Date: Mon, 20 Oct 2025 14:34:02 +0800	[thread overview]
Message-ID: <20251020-cache-upstream-v7-0-69a132447d8a@sifive.com> (raw)

SiFive TMC0 and SMC0 are the power controllers that controls the Tile and
CoreComplex power domain. Add the drivers to support the power
management features such as HSM STOP and System Suspend.

Features such as power management may require flushing the entire
cache before entering a non-retention power state. To support this, a
simple cache flush framework is introduced to allow the external CMO
to perform a full cache flush.

---
Changes in v7:
- Update the change log of PATCH 9 and PATCH 12 because the TMC0 and SMC0 are moved to the
  lib/utils/hsm and lib/utils/suspend.
- Add new commit to Extend the sbi_ipi_raw_send() to use all available IPI device in
  PATCH 8 and use it in PATCH 9
- Add `system_resume` callback for system suspend
- Since the SMC0 driver need the `aplic_reinit_all()`, update the
  SMC0 Kconfig option to depend upon the APLIC Kconfig option
- Link to v6: https://lore.kernel.org/r/20250905-cache-upstream-v6-0-6a6da629c961@sifive.com

Changes in v6:
- Rename the aplic_restore() to aplic_reinit_all()
- Remove fdt_hsm_sifive_tmc0_cold_init() from TMC0 header file
- Remove the sifive_dev_platform.c
- Add a dummy inline flavor of fdt_cmo_init() for the case where CONFIG_FDT_CACHE is disabled
- Link to v5: https://lore.kernel.org/r/20250902-cache-upstream-v5-0-af60a067f47a@sifive.com

Changes in v5:
- Put the SiFive TMC0 driver to the fdt_early_driver
- Fix the format of the comments in SiFive TMC0 driver

Changes in v4:
- Call fdt_cmo_init() directly as part of generic_early_init()
- Rename SBI_HART_EXT_XSF* to SBI_HART_EXT_XSIFIVE*
- Move the TMC0 driver to the lib/utils/hsm/
- Move the SMC0 driver to the lib/utils/suspend/

Changes in v3:
- Add the SiFive TMC and SMC driver

Changes in v2:
- Since the platform override hooks was deprecated, use the fdt_driver
for initializing the sifive_dev_platform.

---
Nick Hu (10):
  lib: utils: Add cache flush library
  lib: utils: Add FDT cache library
  lib: utils/cache: Add fdt cmo helpers
  lib: sbi: Add SiFive proprietary xsfcflushdlone
  lib: sbi: Add SiFive proprietary xsfcease
  lib: sbi: Extends sbi_ipi_raw_send() to use all available IPI devices
  lib: utils/irqchip: Add APLIC restore function
  platform: sifive: Add SiFive TMC0 driver
  lib: utils/timer: Expose timer update function
  platform: sifive: Add SiFive SMC0 driver

Vincent Chen (1):
  utils: cache: Add SiFive ccache controller

 include/sbi/sbi_hart.h                        |   4 +
 include/sbi_utils/cache/cache.h               |  69 +++
 include/sbi_utils/cache/fdt_cache.h           |  34 ++
 include/sbi_utils/cache/fdt_cmo_helper.h      |  34 ++
 include/sbi_utils/hsm/fdt_hsm_sifive_inst.h   |  20 +
 include/sbi_utils/hsm/fdt_hsm_sifive_tmc0.h   |  19 +
 include/sbi_utils/ipi/aclint_mswi.h           |   1 +
 include/sbi_utils/irqchip/aplic.h             |   3 +
 .../suspend/fdt_suspend_sifive_smc0.h         |  18 +
 include/sbi_utils/timer/aclint_mtimer.h       |   5 +
 lib/sbi/sbi_hart.c                            |   2 +
 lib/utils/Kconfig                             |   2 +
 lib/utils/cache/Kconfig                       |  23 +
 lib/utils/cache/cache.c                       |  46 ++
 lib/utils/cache/fdt_cache.c                   |  87 ++++
 lib/utils/cache/fdt_cache_drivers.carray      |   3 +
 lib/utils/cache/fdt_cmo_helper.c              | 112 +++++
 lib/utils/cache/fdt_sifive_ccache.c           | 175 +++++++
 lib/utils/cache/objects.mk                    |  14 +
 lib/utils/hsm/Kconfig                         |   5 +
 lib/utils/hsm/fdt_hsm_sifive_tmc0.c           | 468 ++++++++++++++++++
 lib/utils/hsm/objects.mk                      |   2 +
 lib/utils/ipi/aclint_mswi.c                   |   5 +
 lib/utils/irqchip/aplic.c                     | 160 +++---
 lib/utils/suspend/Kconfig                     |   4 +
 lib/utils/suspend/fdt_suspend_sifive_smc0.c   | 323 ++++++++++++
 lib/utils/suspend/objects.mk                  |   3 +
 lib/utils/timer/aclint_mtimer.c               |  28 +-
 platform/generic/Kconfig                      |   5 +
 platform/generic/configs/defconfig            |   5 +
 platform/generic/platform.c                   |   3 +-
 platform/generic/sifive/objects.mk            |   3 +
 platform/generic/sifive/sifive_dev_platform.c |  57 +++
 33 files changed, 1667 insertions(+), 75 deletions(-)
 create mode 100644 include/sbi_utils/cache/cache.h
 create mode 100644 include/sbi_utils/cache/fdt_cache.h
 create mode 100644 include/sbi_utils/cache/fdt_cmo_helper.h
 create mode 100644 include/sbi_utils/hsm/fdt_hsm_sifive_inst.h
 create mode 100644 include/sbi_utils/hsm/fdt_hsm_sifive_tmc0.h
 create mode 100644 include/sbi_utils/suspend/fdt_suspend_sifive_smc0.h
 create mode 100644 lib/utils/cache/Kconfig
 create mode 100644 lib/utils/cache/cache.c
 create mode 100644 lib/utils/cache/fdt_cache.c
 create mode 100644 lib/utils/cache/fdt_cache_drivers.carray
 create mode 100644 lib/utils/cache/fdt_cmo_helper.c
 create mode 100644 lib/utils/cache/fdt_sifive_ccache.c
 create mode 100644 lib/utils/cache/objects.mk
 create mode 100644 lib/utils/hsm/fdt_hsm_sifive_tmc0.c
 create mode 100644 lib/utils/suspend/fdt_suspend_sifive_smc0.c
 create mode 100644 platform/generic/sifive/sifive_dev_platform.c

--
2.17.1

--
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

To: opensbi@lists.infradead.org

---
Nick Hu (11):
      lib: utils: Add cache flush library
      lib: utils: Add FDT cache library
      lib: utils/cache: Add fdt cmo helpers
      lib: sbi: Add SiFive proprietary xsfcflushdlone
      lib: sbi: Add SiFive proprietary xsfcease
      lib: utils/irqchip: Add APLIC restore function
      lib: sbi: Extends sbi_ipi_raw_send() to use all available IPI devices
      lib: utils/hsm: Add SiFive TMC0 driver
      lib: utils/timer: Expose timer update function
      lib: sbi: Add system_resume callback for restoring the system
      lib: utils/suspend: Add SiFive SMC0 driver

Vincent Chen (1):
      utils: cache: Add SiFive ccache controller

 include/sbi/sbi_hart.h                      |   4 +
 include/sbi/sbi_ipi.h                       |   2 +-
 include/sbi/sbi_system.h                    |   7 +
 include/sbi_utils/cache/cache.h             |  69 ++++++
 include/sbi_utils/cache/fdt_cache.h         |  34 +++
 include/sbi_utils/cache/fdt_cmo_helper.h    |  40 +++
 include/sbi_utils/hsm/fdt_hsm_sifive_inst.h |  20 ++
 include/sbi_utils/hsm/fdt_hsm_sifive_tmc0.h |  14 ++
 include/sbi_utils/irqchip/aplic.h           |   3 +
 include/sbi_utils/timer/aclint_mtimer.h     |   5 +
 lib/sbi/sbi_hart.c                          |   2 +
 lib/sbi/sbi_hsm.c                           |   7 +-
 lib/sbi/sbi_ipi.c                           |  16 +-
 lib/sbi/sbi_system.c                        |  17 ++
 lib/utils/Kconfig                           |   2 +
 lib/utils/cache/Kconfig                     |  23 ++
 lib/utils/cache/cache.c                     |  46 ++++
 lib/utils/cache/fdt_cache.c                 |  87 +++++++
 lib/utils/cache/fdt_cache_drivers.carray    |   3 +
 lib/utils/cache/fdt_cmo_helper.c            | 112 +++++++++
 lib/utils/cache/fdt_sifive_ccache.c         | 175 +++++++++++++
 lib/utils/cache/objects.mk                  |  14 ++
 lib/utils/hsm/Kconfig                       |   5 +
 lib/utils/hsm/fdt_hsm_sifive_tmc0.c         | 367 ++++++++++++++++++++++++++++
 lib/utils/hsm/objects.mk                    |   3 +
 lib/utils/irqchip/aplic.c                   | 164 +++++++------
 lib/utils/suspend/Kconfig                   |   4 +
 lib/utils/suspend/fdt_suspend_sifive_smc0.c | 318 ++++++++++++++++++++++++
 lib/utils/suspend/objects.mk                |   3 +
 lib/utils/timer/aclint_mtimer.c             |  28 ++-
 platform/generic/andes/ae350.c              |   2 +-
 platform/generic/configs/defconfig          |   4 +
 platform/generic/platform.c                 |   3 +-
 33 files changed, 1520 insertions(+), 83 deletions(-)
---
base-commit: e3eb59a396ac55975e3debecfc5b71418eb62248
change-id: 20250829-cache-upstream-93730838a1a6

Best regards,
-- 
Nick Hu <nick.hu@sifive.com>


-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

             reply	other threads:[~2025-10-20  6:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-20  6:34 Nick Hu [this message]
2025-10-20  6:34 ` [PATCH v7 01/12] lib: utils: Add cache flush library Nick Hu
2025-10-20  6:34 ` [PATCH v7 02/12] lib: utils: Add FDT cache library Nick Hu
2025-10-20  6:34 ` [PATCH v7 03/12] utils: cache: Add SiFive ccache controller Nick Hu
2025-10-20  6:34 ` [PATCH v7 04/12] lib: utils/cache: Add fdt cmo helpers Nick Hu
2025-10-28  5:54   ` Anup Patel
2025-10-20  6:34 ` [PATCH v7 05/12] lib: sbi: Add SiFive proprietary xsfcflushdlone Nick Hu
2025-10-20  6:34 ` [PATCH v7 06/12] lib: sbi: Add SiFive proprietary xsfcease Nick Hu
2025-10-20  6:34 ` [PATCH v7 07/12] lib: utils/irqchip: Add APLIC restore function Nick Hu
2025-10-20  6:34 ` [PATCH v7 08/12] lib: sbi: Extends sbi_ipi_raw_send() to use all available IPI devices Nick Hu
2025-10-28  4:59   ` Anup Patel
2025-10-20  6:34 ` [PATCH v7 09/12] lib: utils/hsm: Add SiFive TMC0 driver Nick Hu
2025-10-28  5:00   ` Anup Patel
2025-10-20  6:34 ` [PATCH v7 10/12] lib: utils/timer: Expose timer update function Nick Hu
2025-10-20  6:34 ` [PATCH v7 11/12] lib: sbi: Add system_resume callback for restoring the system Nick Hu
2025-10-28  5:01   ` Anup Patel
2025-10-20  6:34 ` [PATCH v7 12/12] lib: utils/suspend: Add SiFive SMC0 driver Nick Hu
2025-10-28  6:02 ` [PATCH v7 00/12] Add SiFive TMC0 and " Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251020-cache-upstream-v7-0-69a132447d8a@sifive.com \
    --to=nick.hu@sifive.com \
    --cc=andy.chiu@sifive.com \
    --cc=anup@brainfault.org \
    --cc=cyan.yang@sifive.com \
    --cc=opensbi@lists.infradead.org \
    --cc=samuel.holland@sifive.com \
    --cc=vincent.chen@sifive.com \
    --cc=yongxuan.wang@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox