@@ -51,7 +51,7 @@ struct machine_desc {
bool (*smp_init)(void);
void (*fixup)(struct tag *, char **);
void (*dt_fixup)(void);
- long long (*pv_fixup)(void);
+ phys_addr_t (*pv_fixup)(void);
void (*reserve)(void);/* reserve mem blocks */
void (*map_io)(void);/* IO mapping function */
void (*init_early)(void);
@@ -68,7 +68,7 @@ static phys_addr_t keystone_virt_to_idmap(unsigned long x)
return (phys_addr_t)(x) - CONFIG_PAGE_OFFSET + KEYSTONE_LOW_PHYS_START;
}
-static long long __init keystone_pv_fixup(void)
+static phys_addr_t __init keystone_pv_fixup(void)
{
long long offset;
phys_addr_t mem_start, mem_end;
@@ -88,7 +88,7 @@ static long long __init keystone_pv_fixup(void)
return 0;
}
- offset = KEYSTONE_HIGH_PHYS_START - KEYSTONE_LOW_PHYS_START;
+ offset = KEYSTONE_HIGH_PHYS_START;
/* Populate the arch idmap hook */
arch_virt_to_idmap = keystone_virt_to_idmap;
@@ -1401,14 +1401,15 @@ void __init early_paging_init(const struct machine_desc *mdesc)
pgtables_remap *lpae_pgtables_remap;
unsigned long pa_pgd;
unsigned int cr;
- long long offset;
+ phys_addr_t new_phys_offset;
+ phys_addr_t old_phys_offset = PHYS_OFFSET;
void *boot_data;
if (!mdesc->pv_fixup)
return;
- offset = mdesc->pv_fixup();
- if (offset == 0)
+ new_phys_offset = mdesc->pv_fixup();
+ if (new_phys_offset == 0)
return;
/*
@@ -1422,12 +1423,12 @@ void __init early_paging_init(const struct machine_desc *mdesc)
boot_data = __va(__atags_pointer);
barrier();
- pr_info("Switching physical address space to 0x%08llx\n",
- (u64)PHYS_OFFSET + offset);
+ pr_info("Switching physical address space to %pa\n",
+ &new_phys_offset);
/* Re-set the phys pfn offset, and the pv offset */
- __pv_offset = PHYS_OFFSET + offset - PAGE_OFFSET;
- __pv_phys_pfn_offset = PFN_DOWN(PHYS_OFFSET + offset);
+ __pv_offset = new_phys_offset - PAGE_OFFSET;
+ __pv_phys_pfn_offset = PFN_DOWN(new_phys_offset);
/* Run the patch stub to update the constants */
fixup_pv_table(&__pv_table_begin,
@@ -1451,7 +1452,8 @@ void __init early_paging_init(const struct machine_desc *mdesc)
* needs to be assembly. It's fairly simple, as we're using the
* temporary tables setup by the initial assembly code.
*/
- lpae_pgtables_remap(offset, pa_pgd, boot_data);
+ lpae_pgtables_remap((new_phys_offset - old_phys_offset),
+ pa_pgd, boot_data);
/* Re-enable the caches */
set_cr(cr);