u-boot-brain/arch
Stephen Warren 79340db7f1 ARM: bcm2835: implement phys_to_bus/bus_to_phys
The BCM283[56] contain both a L1 and L2 cache between the GPU (a/k/a
VideoCore CPU?) and DRAM. DMA-capable peripherals can also optionally
access DRAM via this same  L2 cache (although they always bypass the L1
cache). Peripherals select whether to use or bypass the cache via the
top two bits of the bus address.

An IOMMU exists between the ARM CPU and the rest of the system. This
controls whether the ARM CPU's accesses use or bypass the L1 and/or L2
cache. This IOMMU is configured/controlled exclusively by the VideoCore
CPU.

In order for DRAM accesses made by the ARM core to be coherent with
accesses made by other DMA peripherals, we must program a bus address
into those peripherals that causes the peripheral's accesses to use the
same set of caches that the ARM core's accesses will use.

On the RPi1, the VideoCore firmware sets up the IOMMU to enable use of
the L2 cache. This corresponds to addresses based at 0x40000000.

On the RPi2, the VideoCore firmware sets up the IOMMU to disable use of
the L2 cache. This corresponds to addresses based at 0xc0000000.

This patch implements U-Boot's phys_to_bus/bus_to_phys APIs according
to those rules.

For full details of this setup, please see Dom Cobley's description at:
http://lists.denx.de/pipermail/u-boot/2015-March/208201.html
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/215038
https://www.mail-archive.com/u-boot@lists.denx.de/msg166568.html

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
2015-04-14 05:47:59 +02:00
..
arc arc: fix separate compilation of start.o 2015-04-10 19:22:40 +03:00
arm ARM: bcm2835: implement phys_to_bus/bus_to_phys 2015-04-14 05:47:59 +02:00
avr32 generic-board: move __HAVE_ARCH_GENERIC_BOARD to Kconfig 2015-03-28 09:03:08 -04:00
blackfin generic-board: select SYS_GENERIC_BOARD for some architectures 2015-03-28 09:03:08 -04:00
m68k m68k: merge per-CPU config.mk into arch/m68k/Makefile 2015-03-28 09:03:09 -04:00
microblaze generic-board: select SYS_GENERIC_BOARD for some architectures 2015-03-28 09:03:08 -04:00
mips generic-board: move __HAVE_ARCH_GENERIC_BOARD to Kconfig 2015-03-28 09:03:08 -04:00
nds32 remove unnecessary version.h includes 2015-03-24 10:50:50 -04:00
nios2 fdt: nios: Fix warning in ft_cpu_setup() 2015-04-10 08:15:24 -06:00
openrisc Kbuild: introduce Makefile in arch/$ARCH/ 2014-12-08 09:35:45 -05:00
powerpc generic-board: move __HAVE_ARCH_GENERIC_BOARD to Kconfig 2015-03-28 09:03:08 -04:00
sandbox generic-board: select SYS_GENERIC_BOARD for some architectures 2015-03-28 09:03:08 -04:00
sh remove unnecessary version.h includes 2015-03-24 10:50:50 -04:00
sparc Kbuild: introduce Makefile in arch/$ARCH/ 2014-12-08 09:35:45 -05:00
x86 malloc_f: enable SYS_MALLOC_F by default if DM is on 2015-03-28 09:03:09 -04:00
.gitignore .gitignore: drop include/asm/proc from ignore pattern 2014-06-19 11:18:54 -04:00
Kconfig serial-arc: switch to DM 2015-04-03 09:47:49 +03:00