All of lore.kernel.org
 help / color / mirror / Atom feed
* 32-bit DMA limit for devices (and drivers)
@ 2021-04-30 11:21 Andre Przywara
  2021-04-30 12:02 ` Mark Kettenis
  2021-05-01 11:45 ` Bin Meng
  0 siblings, 2 replies; 8+ messages in thread
From: Andre Przywara @ 2021-04-30 11:21 UTC (permalink / raw)
  To: u-boot

Hi,

We now see the first Allwinner devices [1] having DRAM located above
4GB in address space (4GB DRAM starting at 1GB). After one fix[2]
this works somewhat fine, but the sun8i-emac network device is still
limited to 32-bit DMA addresses. With U-Boot relocating itself (plus
stack and heap) to the end of DRAM, it now runs completely beyond 4GB
on those machines, so not giving pure 32-bit addresses for buffers
anymore.
In Linux we handle this easily by just keeping the default DMA
mask at 32 bits, and letting the DMA framework deal with the nasty
details.

I was wondering how this should be handled in U-Boot? The straight
forward solution would be:
- Let the driver allocate the RX and TX buffers separately, placing them
  below 4GB in the address space (using lmb_reserve(), I guess?)
- Use those RX buffers and hand the addresses back to the upper layers.
- We already copy TX packets, so this would also be covered, in this
  situation. Other drivers might need to introduce copying.

This sounds like a common problem, so I was wondering if there is a
more generic solution to this? Maybe there are already platforms or
devices affected? Or should the whole heap and stack be moved below 4GB
(if this is easily possible)?
In our case we make the buffers part of our priv struct, so should
there be an option to let the priv_auto allocation come from below 4GB?

Grateful for any input on this!

Thanks!
Andre

[1] https://linux-sunxi.org/X96_Mate
[2] https://lists.denx.de/pipermail/u-boot/2021-April/448327.html

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

end of thread, other threads:[~2021-05-02  0:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-30 11:21 32-bit DMA limit for devices (and drivers) Andre Przywara
2021-04-30 12:02 ` Mark Kettenis
2021-04-30 13:34   ` Andre Przywara
2021-04-30 16:31     ` Jernej Škrabec
2021-05-01 11:45 ` Bin Meng
2021-05-01 12:23   ` Mark Kettenis
2021-05-02  0:21     ` Andre Przywara
2021-05-02  0:30       ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.