diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-01-10 17:01:09 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-01-11 18:55:10 +0100 |
commit | fbdea8fd54fe9d817fd9c56a6d18b39abd8f716e (patch) | |
tree | dd032518f420eb6e6ee859a8a918fc70e2202a26 /commands/devinfo.c | |
parent | 5961dae8f9d11c918522c035889045f6f65bca91 (diff) | |
download | barebox-fbdea8fd54fe9d817fd9c56a6d18b39abd8f716e.tar.gz barebox-fbdea8fd54fe9d817fd9c56a6d18b39abd8f716e.tar.xz |
of: populate new device_d::dma_coherent attribute
So far, whether device DMA is coherent was a one-time global decision.
This is insufficient, because some platforms:
- are cache coherent, while the architecture isn't in general, e.g.
barebox support for ARM with CONFIG_MMU=y assumes non-coherent DMA,
but LS1046A can be fully coherent.
- have a mix of devices that snoop caches and devices that don't
(StarFive JH7100).
To enable dev_dma_(map|unmap)_single to take the correct device-specific
action with regards to cache maintenance, provide dev_is_dma_coherent()
with semantics similar to what Linux provides.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240110160112.4134162-8-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/devinfo.c')
-rw-r--r-- | commands/devinfo.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/commands/devinfo.c b/commands/devinfo.c index aeb9c55339..6001b00cfa 100644 --- a/commands/devinfo.c +++ b/commands/devinfo.c @@ -105,6 +105,10 @@ static int do_devinfo(int argc, char *argv[]) if (dev->of_node) { struct device *main_dev = dev->of_node->dev; + printf("DMA Coherent: %s%s\n", + dev_is_dma_coherent(dev) ? "true" : "false", + dev->dma_coherent == DEV_DMA_COHERENCE_DEFAULT ? " (default)" : ""); + printf("Device node: %pOF", dev->of_node); if (!main_dev) { printf(" (unpopulated)\n"); |