Преглед на файлове

ARM: introduce atag_offset to replace boot_params

The boot_params member of the mdesc structure is used to provide a
default physical address for the ATAG list.  Since this value is fixed
at compile time and sometimes based on constants such as ARCH_PHYS_OFFSET,
it gets in the way of runtime PHYS_OFFSET and CONFIG_ARM_PATCH_PHYS_VIRT
usage.

Let's introduce atag_offset which should contains only the relative
offset from PHYS_OFFSET instead of an absolute value, in preparation
to move all instance of boot_params over to it.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Tested-by: Petr Štetiar <ynezz@true.cz>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Nicolas Pitre преди 14 години
родител
ревизия
2bb9839e31
променени са 2 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 1 0
      arch/arm/include/asm/mach/arch.h
  2. 2 0
      arch/arm/kernel/setup.c

+ 1 - 0
arch/arm/include/asm/mach/arch.h

@@ -18,6 +18,7 @@ struct machine_desc {
 	unsigned int		nr;		/* architecture number	*/
 	unsigned int		nr;		/* architecture number	*/
 	const char		*name;		/* architecture name	*/
 	const char		*name;		/* architecture name	*/
 	unsigned long		boot_params;	/* tagged list		*/
 	unsigned long		boot_params;	/* tagged list		*/
+	unsigned long		atag_offset;	/* tagged list (relative) */
 	const char		**dt_compat;	/* array of device tree
 	const char		**dt_compat;	/* array of device tree
 						 * 'compatible' strings	*/
 						 * 'compatible' strings	*/
 
 

+ 2 - 0
arch/arm/kernel/setup.c

@@ -819,6 +819,8 @@ static struct machine_desc * __init setup_machine_tags(unsigned int nr)
 
 
 	if (__atags_pointer)
 	if (__atags_pointer)
 		tags = phys_to_virt(__atags_pointer);
 		tags = phys_to_virt(__atags_pointer);
+	else if (mdesc->atag_offset)
+		tags = (void *)(PAGE_OFFSET + mdesc->atag_offset);
 	else if (mdesc->boot_params) {
 	else if (mdesc->boot_params) {
 #ifdef CONFIG_MMU
 #ifdef CONFIG_MMU
 		/*
 		/*