devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] riscv,aplic: support for hart indexes
@ 2025-01-09 11:38 Vladimir Kondratiev
  2025-01-09 11:38 ` [PATCH v4 1/2] dt-bindings: interrupt-controller: add risc-v,aplic " Vladimir Kondratiev
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Vladimir Kondratiev @ 2025-01-09 11:38 UTC (permalink / raw)
  To: Anup Patel, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: linux-riscv, linux-kernel, devicetree, Vladimir Kondratiev

Risc-v APLIC uses "hart index" to access data per destination hart.
Current implementation assumes hart indexes are consecutive integers
starting from 0, while Risc-V documentation says it may be
arbitrary numbers, with a clue that it may be related to the hart IDs.

In all boards I see in today's kernel, hart IDs are consecutive
integers, thus using dart IDs is the same as indexes.

However, for the MIPS P8700, hart IDs are different from indexes,
on this SoC they encode thread number, core and cluster in bits
[0..3], [4..15], [16..19] resulting Soc consisting of 3 clusters *
4 cores * 2 threads with hart IDs:
0x0, 0x1, 0x10, 0x11, 0x20, 0x21, 0x30, 0x31, 0x10000 etc.

Change default hart index to be hart ID related to the start of domain,
and add optional property to configure arbitrary indexes.

Use of "device_property" API allows to cover both ACPI and OF in single
code

1-st commit adds dt-bindings, 2-nd - code

Changed from v1:
1. use as fallback logical indexes instead of hart ids
2. refactor code to avoid unnecessary memory allocation

Changed from v2:
1. change property name to plural "riscv,hart-indexes"

Changed from v3:
1. added missing recepients as per "get_maintainer.pl"
   no other changes

Vladimir Kondratiev (2):
  dt-bindings: interrupt-controller: add risc-v,aplic hart indexes
  irqchip/riscv-aplic: add support for hart indexes

 .../interrupt-controller/riscv,aplic.yaml     |  8 ++++++
 drivers/irqchip/irq-riscv-aplic-direct.c      | 25 ++++++++++++++++---
 2 files changed, 30 insertions(+), 3 deletions(-)


base-commit: 9d89551994a430b50c4fffcb1e617a057fa76e20
-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-01-29 16:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 11:38 [PATCH v4 0/2] riscv,aplic: support for hart indexes Vladimir Kondratiev
2025-01-09 11:38 ` [PATCH v4 1/2] dt-bindings: interrupt-controller: add risc-v,aplic " Vladimir Kondratiev
2025-01-10 16:20   ` Rob Herring
2025-01-12  7:47     ` Vladimir Kondratiev
2025-01-10 16:22   ` Rob Herring
2025-01-12  8:38     ` Vladimir Kondratiev
2025-01-27 17:52       ` Thomas Gleixner
2025-01-29  9:16         ` [PATCH v5 0/2] riscv,aplic: support for " Vladimir Kondratiev
2025-01-29  9:16           ` [PATCH v5 1/2] dt-bindings: interrupt-controller: add risc-v,aplic " Vladimir Kondratiev
2025-01-29 16:40             ` Rob Herring (Arm)
2025-01-29  9:16           ` [PATCH v5 2/2] irqchip/riscv-aplic: add support for " Vladimir Kondratiev
2025-01-09 11:38 ` [PATCH v4 " Vladimir Kondratiev
2025-01-20  9:57 ` [PATCH v4 0/2] riscv,aplic: " Vladimir Kondratiev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).