1
0
Fork 0
alistair23-linux/arch/mips/include/asm/mach-generic
Paul Burton 6c359eb1dc
MIPS: Allow auto-dection of ARCH_PFN_OFFSET & PHYS_OFFSET
On systems where physical memory begins at a non-zero address, defining
PHYS_OFFSET (which influences ARCH_PFN_OFFSET) can save us time & memory
by avoiding book-keeping for pages from address zero to the start of
memory.

Some MIPS platforms already make use of this, but with the definition of
PHYS_OFFSET being compile-time constant it hasn't been possible to
enable this optimization for a kernel which may run on systems with
varying physical memory base addresses.

Introduce a new Kconfig option CONFIG_MIPS_AUTO_PFN_OFFSET which, when
enabled, makes ARCH_PFN_OFFSET a variable & detects it from the boot
memory map (which for example may have been populated from DT). The
relationship with PHYS_OFFSET is reversed, with PHYS_OFFSET now being
based on ARCH_PFN_OFFSET. This is because ARCH_PFN_OFFSET is used far
more often, so avoiding the need for runtime calculation gives us a
smaller impact on kernel text size (0.1% rather than 0.15% for
64r6el_defconfig).

Signed-off-by: Paul Burton <paul.burton@mips.com>
Suggested-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
Patchwork: https://patchwork.linux-mips.org/patch/20048/
Cc: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
2018-07-30 10:27:32 -07:00
..
cpu-feature-overrides.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
floppy.h MIPS: Squash lines for simple wrapper functions 2016-10-04 16:13:57 +02:00
ide.h mips/ide: flush dcache also if icache does not snoop dcache 2014-01-24 22:39:56 +01:00
ioremap.h MIPS: Replace use of phys_t with phys_addr_t. 2014-11-24 22:47:31 +01:00
irq.h MIPS/IRQCHIP: Move irq_chip from arch/mips to drivers/irqchip. 2015-06-21 21:52:50 +02:00
kernel-entry-init.h MIPS: Fix misspellings in comments. 2016-04-03 12:32:09 +02:00
kmalloc.h MIPS: remove CONFIG_DMA_COHERENT 2018-06-24 09:26:02 -07:00
mangle-port.h MIPS: Move headfiles to new location below arch/mips/include 2008-10-11 16:18:52 +01:00
mc146818rtc.h MIPS: generic: Set RTC_ALWAYS_BCD to 0 2017-06-28 12:22:41 +02:00
spaces.h MIPS: Allow auto-dection of ARCH_PFN_OFFSET & PHYS_OFFSET 2018-07-30 10:27:32 -07:00
topology.h MIPS: Move headfiles to new location below arch/mips/include 2008-10-11 16:18:52 +01:00
war.h MIPS: Create a common <asm/mach-generic/war.h> 2015-03-31 11:59:40 +02:00