Skip to content

Commit

Permalink
ARM: P2V: separate PHYS_OFFSET from platform definitions
Browse files Browse the repository at this point in the history
This uncouple PHYS_OFFSET from the platform definitions, thereby
facilitating run-time computation of the physical memory offset.

Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Magnus Damm <damm@opensource.se>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Wan ZongShun <mcuos.com@gmail.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Acked-by: Jiandong Zheng <jdzheng@broadcom.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Feb 17, 2011
1 parent 6fc31d5 commit f4117ac
Show file tree
Hide file tree
Showing 65 changed files with 88 additions and 86 deletions.
2 changes: 2 additions & 0 deletions arch/arm/include/asm/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*/
#define UL(x) _AC(x, UL)

#define PHYS_OFFSET PLAT_PHYS_OFFSET

#ifdef CONFIG_MMU

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/tcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <linux/string.h> /* memcpy */
#include <asm/cputype.h>
#include <asm/mach/map.h>
#include <mach/memory.h>
#include <asm/memory.h>
#include "tcm.h"

static struct gen_pool *tcm_pool;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-aaec2000/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
#define __ASM_ARCH_MEMORY_H


#define PHYS_OFFSET UL(0xf0000000)
#define PLAT_PHYS_OFFSET UL(0xf0000000)

#endif /* __ASM_ARCH_MEMORY_H */
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@

#include <mach/hardware.h>

#define PHYS_OFFSET (AT91_SDRAM_BASE)
#define PLAT_PHYS_OFFSET (AT91_SDRAM_BASE)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-bcmring/include/mach/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* *_SIZE is the size of the region
* *_BASE is the virtual address
*/
#define RAM_START PHYS_OFFSET
#define RAM_START PLAT_PHYS_OFFSET

#define RAM_SIZE (CFG_GLOBAL_RAM_SIZE-CFG_GLOBAL_RAM_SIZE_RESERVED)
#define RAM_BASE PAGE_OFFSET
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-bcmring/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* files. Use virt_to_phys/phys_to_virt/__pa/__va instead.
*/

#define PHYS_OFFSET CFG_GLOBAL_RAM_BASE
#define PLAT_PHYS_OFFSET CFG_GLOBAL_RAM_BASE

/*
* Maximum DMA memory allowed is 14M
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-clps711x/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0xc0000000)
#define PLAT_PHYS_OFFSET UL(0xc0000000)

#if !defined(CONFIG_ARCH_CDB89712) && !defined (CONFIG_ARCH_AUTCPU12)

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-cns3xxx/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#define __phys_to_bus(x) ((x) + PHYS_OFFSET)
#define __bus_to_phys(x) ((x) - PHYS_OFFSET)
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-davinci/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
#if defined(CONFIG_ARCH_DAVINCI_DA8XX) && defined(CONFIG_ARCH_DAVINCI_DMx)
#error Cannot enable DaVinci and DA8XX platforms concurrently
#elif defined(CONFIG_ARCH_DAVINCI_DA8XX)
#define PHYS_OFFSET DA8XX_DDR_BASE
#define PLAT_PHYS_OFFSET DA8XX_DDR_BASE
#else
#define PHYS_OFFSET DAVINCI_DDR_BASE
#define PLAT_PHYS_OFFSET DAVINCI_DDR_BASE
#endif

#define DDR2_SDRCR_OFFSET 0xc
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-dove/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H

#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-ebsa110/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

/*
* Cache flushing area - SRAM
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-ep93xx/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
#define __ASM_ARCH_MEMORY_H

#if defined(CONFIG_EP93XX_SDCE3_SYNC_PHYS_OFFSET)
#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)
#elif defined(CONFIG_EP93XX_SDCE0_PHYS_OFFSET)
#define PHYS_OFFSET UL(0xc0000000)
#define PLAT_PHYS_OFFSET UL(0xc0000000)
#elif defined(CONFIG_EP93XX_SDCE1_PHYS_OFFSET)
#define PHYS_OFFSET UL(0xd0000000)
#define PLAT_PHYS_OFFSET UL(0xd0000000)
#elif defined(CONFIG_EP93XX_SDCE2_PHYS_OFFSET)
#define PHYS_OFFSET UL(0xe0000000)
#define PLAT_PHYS_OFFSET UL(0xe0000000)
#elif defined(CONFIG_EP93XX_SDCE3_ASYNC_PHYS_OFFSET)
#define PHYS_OFFSET UL(0xf0000000)
#define PLAT_PHYS_OFFSET UL(0xf0000000)
#else
#error "Kconfig bug: No EP93xx PHYS_OFFSET set"
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-footbridge/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ extern unsigned long __bus_to_pfn(unsigned long);
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#define FLUSH_BASE_PHYS 0x50000000

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-gemini/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#define __MACH_MEMORY_H

#ifdef CONFIG_GEMINI_MEM_SWAP
# define PHYS_OFFSET UL(0x00000000)
# define PLAT_PHYS_OFFSET UL(0x00000000)
#else
# define PHYS_OFFSET UL(0x10000000)
# define PLAT_PHYS_OFFSET UL(0x10000000)
#endif

#endif /* __MACH_MEMORY_H */
2 changes: 1 addition & 1 deletion arch/arm/mach-h720x/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H

#define PHYS_OFFSET UL(0x40000000)
#define PLAT_PHYS_OFFSET UL(0x40000000)
/*
* This is the maximum DMA address that can be DMAd to.
* There should not be more than (0xd0000000 - 0xc0000000)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-integrator/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#define BUS_OFFSET UL(0x80000000)
#define __virt_to_bus(x) ((x) - PAGE_OFFSET + BUS_OFFSET)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-iop13xx/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#ifndef __ASSEMBLY__

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-iop32x/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0xa0000000)
#define PLAT_PHYS_OFFSET UL(0xa0000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-iop33x/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-ixp2000/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H

#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#include <mach/ixp2000-regs.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ixp23xx/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET (0x00000000)
#define PLAT_PHYS_OFFSET (0x00000000)

#define IXP23XX_PCI_SDRAM_OFFSET (*((volatile int *)IXP23XX_PCI_SDRAM_BAR) & 0xfffffff0)

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ixp4xx/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#if !defined(__ASSEMBLY__) && defined(CONFIG_PCI)

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-kirkwood/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H

#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-ks8695/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/*
* Physical SRAM offset.
*/
#define PHYS_OFFSET KS8695_SDRAM_PA
#define PLAT_PHYS_OFFSET KS8695_SDRAM_PA

#ifndef __ASSEMBLY__

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-lh7a40x/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0xc0000000)
#define PLAT_PHYS_OFFSET UL(0xc0000000)

/*
* Sparsemem version of the above
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-loki/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H

#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-lpc32xx/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
/*
* Physical DRAM offset of bank 0
*/
#define PHYS_OFFSET UL(0x80000000)
#define PLAT_PHYS_OFFSET UL(0x80000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-mmp/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
#ifndef __ASM_MACH_MEMORY_H
#define __ASM_MACH_MEMORY_H

#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#endif /* __ASM_MACH_MEMORY_H */
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/board-msm7x30.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/memory.h>
#include <asm/setup.h>

#include <mach/gpio.h>
#include <mach/board.h>
#include <mach/memory.h>
#include <mach/msm_iomap.h>
#include <mach/dma.h>

Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-msm/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

/* physical offset of RAM */
#if defined(CONFIG_ARCH_QSD8X50) && defined(CONFIG_MSM_SOC_REV_A)
#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)
#elif defined(CONFIG_ARCH_QSD8X50)
#define PHYS_OFFSET UL(0x20000000)
#define PLAT_PHYS_OFFSET UL(0x20000000)
#elif defined(CONFIG_ARCH_MSM7X30)
#define PHYS_OFFSET UL(0x00200000)
#define PLAT_PHYS_OFFSET UL(0x00200000)
#elif defined(CONFIG_ARCH_MSM8X60)
#define PHYS_OFFSET UL(0x40200000)
#define PLAT_PHYS_OFFSET UL(0x40200000)
#else
#define PHYS_OFFSET UL(0x10000000)
#define PLAT_PHYS_OFFSET UL(0x10000000)
#endif

#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mv78xx0/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H

#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-mx3/mach-kzm_arm11_01.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <asm/irq.h>
#include <asm/mach-types.h>
#include <asm/memory.h>
#include <asm/setup.h>
#include <asm/mach/arch.h>
#include <asm/mach/irq.h>
Expand All @@ -36,7 +37,6 @@
#include <mach/clock.h>
#include <mach/common.h>
#include <mach/iomux-mx3.h>
#include <mach/memory.h>

#include "devices-imx31.h"
#include "devices.h"
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-netx/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H

#define PHYS_OFFSET UL(0x80000000)
#define PLAT_PHYS_OFFSET UL(0x80000000)

#endif

2 changes: 1 addition & 1 deletion arch/arm/mach-nomadik/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-ns9xxx/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
#define NS9XXX_CS2STAT_LENGTH UL(0x1000)
#define NS9XXX_CS3STAT_LENGTH UL(0x1000)

#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-nuc93x/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H

#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-orion5x/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H

#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-pnx4008/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0x80000000)
#define PLAT_PHYS_OFFSET UL(0x80000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0xa0000000)
#define PLAT_PHYS_OFFSET UL(0xa0000000)

#if !defined(__ASSEMBLY__) && defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
void cmx2xx_pci_adjust_zones(unsigned long *size, unsigned long *holes);
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-realview/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
* Physical DRAM offset.
*/
#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET
#define PHYS_OFFSET UL(0x70000000)
#define PLAT_PHYS_OFFSET UL(0x70000000)
#else
#define PHYS_OFFSET UL(0x00000000)
#define PLAT_PHYS_OFFSET UL(0x00000000)
#endif

#if !defined(__ASSEMBLY__) && defined(CONFIG_ZONE_DMA)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-rpc/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/*
* Physical DRAM offset.
*/
#define PHYS_OFFSET UL(0x10000000)
#define PLAT_PHYS_OFFSET UL(0x10000000)

/*
* Cache flushing area - ROM
Expand Down
Loading

0 comments on commit f4117ac

Please sign in to comment.