lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250121-coldfire-global-pool-v1-0-382a7235c2aa@yoseli.org>
Date: Tue, 21 Jan 2025 11:54:12 +0100
From: Jean-Michel Hautbois <jeanmichel.hautbois@...eli.org>
To: Geert Uytterhoeven <geert@...ux-m68k.org>, 
 Greg Ungerer <gerg@...ux-m68k.org>
Cc: linux-m68k@...ts.linux-m68k.org, linux-kernel@...r.kernel.org, 
 Jean-Michel Hautbois <jeanmichel.hautbois@...eli.org>
Subject: [PATCH 0/2] m68k: Add basic support for DMA global coherent pool

The coldfire M5441x family can't use coherent allocations, because the
cache does not support snooping (cache coherency is not supported while
external or DMA masters use the bus).

In order to make it possible to use coherent memory, the only way is to
disable the cache for specific adresses. This patch series introduces
the global coherent pool allocation along with a different cache
configuration. This is tested on M54418 only.

The CONFIG_DMABASE is fixed to 0x4f000000 in my configuration file.
When booting with memblock=debug, we can see:
memblock_reserve: [0x4f000000-0x4fffffff] cf_bootmem_alloc+0x9a/0x11c

Which corresponds to the memblock_reserve call in cf_bootmem_alloc().

Later, I have a SPI NOR, which is detected, and the dma_alloc_coherent
is successful:
[    3.940000] fsl-dspi fsl-dspi.0: registered host spi0
[    3.940000] spi spi0.0: DSPI controller timing params: CS-to-SCK delay 100 ns, SCK-to-CS delay 100 ns
[    3.940000] spi spi0.0: setup mode 0, 8 bits/w, 31250000 Hz max --> 0
[    3.970000] Creating 1 MTD partitions on "Micron mt25ql01G SPI Flash chip":
[    3.970000] 0x000000000000-0x000008000000 : "w25q01"
[    4.010000] fsl-dspi fsl-dspi.0: registered child spi0.0
[    4.020000] DSPI: Coldfire DSPI Slave driver

The FEC driver is not modified and still uses the hack cache flush,
because I have an issue when DMA is used intensively:
fec enet-fec.0 eth0: rcv is not +last

I could not figure out why it appears, so some help on this would be
great :-).

I also could not modify the ACRs successfully, and I am not sure if it is
needed or not.

Thanks !

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@...eli.org>
---
Jean-Michel Hautbois (2):
      m68k: Enable DMA support for Coldfire M5441x
      arch: m68k: Add DMA mapping operations for Coldfire M5441x

 arch/m68k/Kconfig.cpu        |   2 +
 arch/m68k/Kconfig.machine    |  15 +++++
 arch/m68k/coldfire/Makefile  |   2 +
 arch/m68k/coldfire/dma_ops.c | 131 +++++++++++++++++++++++++++++++++++++++++++
 arch/m68k/include/asm/dma.h  |   1 -
 arch/m68k/kernel/dma.c       |  10 ++++
 arch/m68k/mm/mcfmmu.c        |   5 ++
 7 files changed, 165 insertions(+), 1 deletion(-)
---
base-commit: ffd294d346d185b70e28b1a28abe367bbfe53c04
change-id: 20250117-coldfire-global-pool-2a77d13647b6

Best regards,
-- 
Jean-Michel Hautbois <jeanmichel.hautbois@...eli.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ