u-boot-brain/arch/arm
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
..
cpu Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2015-04-13 10:52:46 -04:00
dts dts: peach_pi: Add DT properties needed for display 2015-04-06 14:34:41 +09:00
imx-common ARM: iMX: define an IMX_CONFIG Kconfig option 2015-03-23 13:19:17 +01:00
include break build if it would produce broken binary 2015-04-13 10:52:51 -04:00
lib Merge branch 'master' of git://git.denx.de/u-boot-tegra 2015-04-03 09:14:38 -04:00
mach-at91 ARM: atmel: at91sam9n12ek: enable spl support 2015-04-01 01:04:31 +02:00
mach-bcm283x ARM: bcm2835: implement phys_to_bus/bus_to_phys 2015-04-14 05:47:59 +02:00
mach-davinci ARM: davinci: remove hawkboard support 2015-02-24 17:07:29 -05:00
mach-highbank ARM: highbank: move SoC sources to mach-highbank 2015-02-21 08:23:51 -05:00
mach-keystone ARM: keystone: move SoC headers to mach-keystone/include/mach 2015-02-21 08:23:52 -05:00
mach-kirkwood ARM: kirkwood: move SoC headers to mach-kirkwood/include/mach 2015-02-21 08:23:52 -05:00
mach-nomadik ARM: nomadik: move SoC headers to mach-nomadik/include/mach 2015-02-21 08:23:52 -05:00
mach-orion5x edminiv2: switch to SPL 2015-02-25 07:59:50 +01:00
mach-tegra Merge branch 'master' of git://git.denx.de/u-boot-tegra 2015-04-03 09:14:38 -04:00
mach-uniphier malloc_f: enable SYS_MALLOC_F by default if DM is on 2015-03-28 09:03:09 -04:00
mach-versatile ARM: versatile: move SoC sources to mach-versatile 2015-02-21 08:23:51 -05:00
mvebu-common arm: mvebu: Add Serdes PHY config code 2015-02-06 17:24:59 +01:00
config.mk generic-board: move __HAVE_ARCH_GENERIC_BOARD to Kconfig 2015-03-28 09:03:08 -04:00
Kconfig Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2015-04-13 10:52:46 -04:00
Kconfig.debug arm: debug: add Kconfig entries for lowlevel debug 2014-10-26 22:23:12 +01:00
Makefile ARM: fix arch/arm/Makefile for Tegra 2015-04-11 12:04:30 -04:00