forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
riscv: mm: dma-noncoherent: nonstandard cache operations support
Introduce support for nonstandard noncoherent systems in the RISC-V architecture. It enables function pointer support to handle cache management in such systems. This patch adds a new configuration option called "RISCV_NONSTANDARD_CACHE_OPS." This option is a boolean flag that depends on "RISCV_DMA_NONCOHERENT" and enables the function pointer support for cache management in nonstandard noncoherent systems. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Tested-by: Conor Dooley <conor.dooley@microchip.com> # tyre-kicking on a d1 Reviewed-by: Emil Renner Berthing <emil.renner.berthing@canonical.com> Tested-by: Emil Renner Berthing <emil.renner.berthing@canonical.com> # Link: https://lore.kernel.org/r/20230818135723.80612-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
- Loading branch information
1 parent
e021ae7
commit b79f300
Showing
4 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
/* | ||
* Copyright (C) 2023 Renesas Electronics Corp. | ||
*/ | ||
|
||
#ifndef __ASM_DMA_NONCOHERENT_H | ||
#define __ASM_DMA_NONCOHERENT_H | ||
|
||
#include <linux/dma-direct.h> | ||
|
||
/* | ||
* struct riscv_nonstd_cache_ops - Structure for non-standard CMO function pointers | ||
* | ||
* @wback: Function pointer for cache writeback | ||
* @inv: Function pointer for invalidating cache | ||
* @wback_inv: Function pointer for flushing the cache (writeback + invalidating) | ||
*/ | ||
struct riscv_nonstd_cache_ops { | ||
void (*wback)(phys_addr_t paddr, size_t size); | ||
void (*inv)(phys_addr_t paddr, size_t size); | ||
void (*wback_inv)(phys_addr_t paddr, size_t size); | ||
}; | ||
|
||
extern struct riscv_nonstd_cache_ops noncoherent_cache_ops; | ||
|
||
void riscv_noncoherent_register_cache_ops(const struct riscv_nonstd_cache_ops *ops); | ||
|
||
#endif /* __ASM_DMA_NONCOHERENT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters