Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: Make PAGE_OFFSET configurable.

nommu needs to be able to shift PAGE_OFFSET, so we switch it to a
non-user-visible CONFIG_PAGE_OFFSET and use that in the few places
where it matters.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+35 -29
-26
arch/sh/Kconfig
··· 238 238 239 239 source "arch/sh/mm/Kconfig" 240 240 241 - config MEMORY_START 242 - hex "Physical memory start address" 243 - default "0x08000000" 244 - ---help--- 245 - Computers built with Hitachi SuperH processors always 246 - map the ROM starting at address zero. But the processor 247 - does not specify the range that RAM takes. 248 - 249 - The physical memory (RAM) start address will be automatically 250 - set to 08000000. Other platforms, such as the Solution Engine 251 - boards typically map RAM at 0C000000. 252 - 253 - Tweak this only when porting to a new machine which does not 254 - already have a defconfig. Changing it from the known correct 255 - value on any of the known systems will only lead to disaster. 256 - 257 - config MEMORY_SIZE 258 - hex "Physical memory size" 259 - default "0x00400000" 260 - help 261 - This sets the default memory size assumed by your SH kernel. It can 262 - be overridden as normal by the 'mem=' argument on the kernel command 263 - line. If unsure, consult your board specifications or just leave it 264 - as 0x00400000 which was the default value before this became 265 - configurable. 266 - 267 241 config CF_ENABLER 268 242 bool "Compact Flash Enabler support" 269 243 depends on SH_ADX || SH_SOLUTION_ENGINE || SH_UNKNOWN || SH_CAT68701 || SH_SH03
+2 -1
arch/sh/boot/compressed/Makefile
··· 18 18 # Assign dummy values if these 2 variables are not defined, 19 19 # in order to suppress error message. 20 20 # 21 + CONFIG_PAGE_OFFSET ?= 0x80000000 21 22 CONFIG_MEMORY_START ?= 0x0c000000 22 23 CONFIG_BOOT_LINK_OFFSET ?= 0x00800000 23 - IMAGE_OFFSET := $(shell printf "0x%8x" $$[0x80000000+$(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)]) 24 + IMAGE_OFFSET := $(shell printf "0x%8x" $$[$(CONFIG_PAGE_OFFSET)+$(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)]) 24 25 25 26 LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds 26 27
+1 -1
arch/sh/kernel/vmlinux.lds.S
··· 13 13 ENTRY(_start) 14 14 SECTIONS 15 15 { 16 - . = 0x80000000 + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET; 16 + . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET; 17 17 _text = .; /* Text and read-only data */ 18 18 text = .; /* Text and read-only data */ 19 19 .empty_zero_page : {
+31
arch/sh/mm/Kconfig
··· 161 161 turning this off will boot the kernel on these machines with the 162 162 MMU implicitly switched off. 163 163 164 + config PAGE_OFFSET 165 + hex 166 + default "0x80000000" if MMU 167 + default "0x00000000" 168 + 169 + config MEMORY_START 170 + hex "Physical memory start address" 171 + default "0x08000000" 172 + ---help--- 173 + Computers built with Hitachi SuperH processors always 174 + map the ROM starting at address zero. But the processor 175 + does not specify the range that RAM takes. 176 + 177 + The physical memory (RAM) start address will be automatically 178 + set to 08000000. Other platforms, such as the Solution Engine 179 + boards typically map RAM at 0C000000. 180 + 181 + Tweak this only when porting to a new machine which does not 182 + already have a defconfig. Changing it from the known correct 183 + value on any of the known systems will only lead to disaster. 184 + 185 + config MEMORY_SIZE 186 + hex "Physical memory size" 187 + default "0x00400000" 188 + help 189 + This sets the default memory size assumed by your SH kernel. It can 190 + be overridden as normal by the 'mem=' argument on the kernel command 191 + line. If unsure, consult your board specifications or just leave it 192 + as 0x00400000 which was the default value before this became 193 + configurable. 194 + 164 195 config 32BIT 165 196 bool "Support 32-bit physical addressing through PMB" 166 197 depends on CPU_SH4A
+1 -1
include/asm-sh/page.h
··· 84 84 #define __MEMORY_START CONFIG_MEMORY_START 85 85 #define __MEMORY_SIZE CONFIG_MEMORY_SIZE 86 86 87 - #define PAGE_OFFSET (0x80000000UL) 87 + #define PAGE_OFFSET CONFIG_PAGE_OFFSET 88 88 #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) 89 89 #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) 90 90