diff options
author | gonzo <gonzo@FreeBSD.org> | 2013-02-23 22:46:26 +0000 |
---|---|---|
committer | gonzo <gonzo@FreeBSD.org> | 2013-02-23 22:46:26 +0000 |
commit | 2ef08f9a2e7bb79e977b0385d10df6dab9798255 (patch) | |
tree | a2bbbaf8be21b39249d18fbc79e000b076c98f49 /sys/arm | |
parent | 02ee4992361228dcb913b2881260ee680a2c3e39 (diff) | |
download | FreeBSD-src-2ef08f9a2e7bb79e977b0385d10df6dab9798255.zip FreeBSD-src-2ef08f9a2e7bb79e977b0385d10df6dab9798255.tar.gz |
Add macroses to properly map IO peripherals memory window from
ARM physical memory address space to VideoCore address space
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/broadcom/bcm2835/bcm2835_vcbus.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h b/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h index 1d91046..cb871f2 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h +++ b/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h @@ -34,14 +34,28 @@ #define _BCM2835_VCBUS_H_ #define BCM2835_VCBUS_SDRAM_CACHED 0x40000000 +#define BCM2835_VCBUS_IO_BASE 0x7E000000 #define BCM2835_VCBUS_SDRAM_UNCACHED 0xC0000000 +#define BCM2835_ARM_IO_BASE 0x20000000 +#define BCM2835_ARM_IO_SIZE 0x02000000 + /* * Convert physical address to VC bus address. Should be used * when submitting address over mailbox interface */ #define PHYS_TO_VCBUS(pa) ((pa) + BCM2835_VCBUS_SDRAM_CACHED) +/* Check whether pa bellong top IO window */ +#define BCM2835_ARM_IS_IO(pa) (((pa) >= BCM2835_ARM_IO_BASE) && \ + ((pa) < BCM2835_ARM_IO_BASE + BCM2835_ARM_IO_SIZE)) + +/* + * Convert physical address in IO space to VC bus address. + */ +#define IO_TO_VCBUS(pa) ((pa - BCM2835_ARM_IO_BASE) + \ + BCM2835_VCBUS_IO_BASE) + /* * Convert address from VC bus space to physical. Should be used * when address is returned by VC over mailbox interface. e.g. |