linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/4] riscv: implement Zicbom-based CMO instructions + the t-head variant
@ 2022-06-19 20:32 Heiko Stuebner
  2022-06-19 20:32 ` [PATCH 1/4] of: also handle dma-noncoherent in of_dma_is_coherent() Heiko Stuebner
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Heiko Stuebner @ 2022-06-19 20:32 UTC (permalink / raw)
  To: palmer, paul.walmsley
  Cc: linux-riscv, linux-kernel, wefu, guoren, cmuellner,
	philipp.tomsich, hch, samuel, atishp, anup, mick, robh+dt,
	krzk+dt, devicetree, drew, rdunlap, Heiko Stuebner

This series is based on the alternatives changes done in my svpbmt series
and thus also depends on Atish's isa-extension parsing series.

It implements using the cache-management instructions from the  Zicbom-
extension to handle cache flush, etc actions on platforms needing them.

SoCs using cpu cores from T-Head like the Allwinne D1 implement a
different set of cache instructions. But while they are different,
instructions they provide the same functionality, so a variant can
easly hook into the existing alternatives mechanism on those.


An ongoing discussion is about the currently used pre-coded
instructions. Palmer's current thinking is that we should wait
until the relevant instructions have landed in binutils.

The main Zicbom instructions are in toolchains now and at least
Debian also carries a binutils snapshot with it, but the T-Head
variant still uses pre-coded instructions for now.

The series sits on top of my svpbmt fixup series, which
for example includes the conversion away from function pointers
for the check-functions. And also uses my nops-series.


Hopefully I caught all the review-comments from v3.


changes in v4:
- modify of_dma_is_coherent() also handle coherent system
  with maybe noncoherent devices
- move Zicbom to use real instructions
- split off the actual dma-noncoherent code from the Zicbom
  extension
- Don't assumes devices are non-coherent, instead default to
  coherent and require the non-coherent ones to be marked
- CPUFEATURE_ZICBOM instead of CPUFEATURE_CMO
- fix used cache addresses
- drop some unused headers from dma-noncoherent.c
- move unsigned long cast when calling ALT_CMO_OP
- remove unneeded memset-0
- define ARCH_DMA_MINALIGN
- use flush instead of inval in arch_sync_dma_for_cpu()
- depend on !XIP_KERNEL
- trim some line lengths
- improve Kconfig description

changes in v3:
- rebase onto 5.19-rc1 + svpbmt-fixup-series
- adapt wording for block-size binding
- include asm/cacheflush.h into dma-noncoherent to fix the
  no-prototype error clang seems to generate
- use __nops macro for readability
- add some received tags
- add a0 to the clobber list

changes in v2:
- cbom-block-size is hardware-specific and comes from firmware
- update Kconfig name to use the ISA extension name
- select the ALTERNATIVES symbol when enabled
- shorten the line lengths of the errata-assembly

Heiko Stuebner (4):
  of: also handle dma-noncoherent in of_dma_is_coherent()
  dt-bindings: riscv: document cbom-block-size
  riscv: Implement Zicbom-based cache management operations
  riscv: implement cache-management errata for T-Head SoCs

 .../devicetree/bindings/riscv/cpus.yaml       |  5 +
 arch/riscv/Kconfig                            | 31 ++++++
 arch/riscv/Kconfig.erratas                    | 11 +++
 arch/riscv/Makefile                           |  4 +
 arch/riscv/errata/thead/errata.c              | 15 +++
 arch/riscv/include/asm/cache.h                |  4 +
 arch/riscv/include/asm/cacheflush.h           |  6 ++
 arch/riscv/include/asm/errata_list.h          | 59 +++++++++++-
 arch/riscv/include/asm/hwcap.h                |  1 +
 arch/riscv/kernel/cpu.c                       |  1 +
 arch/riscv/kernel/cpufeature.c                | 18 ++++
 arch/riscv/kernel/setup.c                     |  2 +
 arch/riscv/mm/Makefile                        |  1 +
 arch/riscv/mm/dma-noncoherent.c               | 96 +++++++++++++++++++
 drivers/of/address.c                          | 16 +++-
 15 files changed, 263 insertions(+), 7 deletions(-)
 create mode 100644 arch/riscv/mm/dma-noncoherent.c

-- 
2.35.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2022-06-29  1:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-19 20:32 [PATCH v4 0/4] riscv: implement Zicbom-based CMO instructions + the t-head variant Heiko Stuebner
2022-06-19 20:32 ` [PATCH 1/4] of: also handle dma-noncoherent in of_dma_is_coherent() Heiko Stuebner
2022-06-20  6:01   ` Christoph Hellwig
2022-06-20 16:33   ` Atish Patra
2022-06-20 18:11     ` Heiko Stuebner
2022-06-20 19:41       ` Atish Patra
2022-06-19 20:32 ` [PATCH 2/4] dt-bindings: riscv: document cbom-block-size Heiko Stuebner
2022-06-19 20:32 ` [PATCH 3/4] riscv: Implement Zicbom-based cache management operations Heiko Stuebner
2022-06-20  6:16   ` Christoph Hellwig
2022-06-24  7:49     ` Heiko Stuebner
2022-06-19 20:32 ` [PATCH 4/4] riscv: implement cache-management errata for T-Head SoCs Heiko Stuebner
2022-06-29  1:29   ` Samuel Holland

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).