Skip to content

Commit

Permalink
ARM: 8639/1: Define KERNEL_START and KERNEL_END
Browse files Browse the repository at this point in the history
In preparation for adding CONFIG_DEBUG_VIRTUAL support, define a set of
common constants: KERNEL_START and KERNEL_END which abstract
CONFIG_XIP_KERNEL vs. !CONFIG_XIP_KERNEL. Update the code where
relevant.

Acked-by: Russell King <[email protected]>
Signed-off-by: Florian Fainelli <[email protected]>
Signed-off-by: Russell King <[email protected]>
  • Loading branch information
ffainelli authored and Russell King committed Feb 28, 2017
1 parent 4e23612 commit a09975b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
7 changes: 7 additions & 0 deletions arch/arm/include/asm/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@

#endif /* !CONFIG_MMU */

#ifdef CONFIG_XIP_KERNEL
#define KERNEL_START _sdata
#else
#define KERNEL_START _stext
#endif
#define KERNEL_END _end

/*
* We fix the TCM memories max 32 KiB ITCM resp DTCM at these
* locations
Expand Down
7 changes: 2 additions & 5 deletions arch/arm/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,8 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
void __init arm_memblock_init(const struct machine_desc *mdesc)
{
/* Register the kernel text, kernel data and initrd with memblock. */
#ifdef CONFIG_XIP_KERNEL
memblock_reserve(__pa(_sdata), _end - _sdata);
#else
memblock_reserve(__pa(_stext), _end - _stext);
#endif
memblock_reserve(__pa(KERNEL_START), KERNEL_END - KERNEL_START);

#ifdef CONFIG_BLK_DEV_INITRD
/* FDT scan will populate initrd_start */
if (initrd_start && !phys_initrd_size) {
Expand Down
6 changes: 1 addition & 5 deletions arch/arm/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1422,11 +1422,7 @@ static void __init kmap_init(void)
static void __init map_lowmem(void)
{
struct memblock_region *reg;
#ifdef CONFIG_XIP_KERNEL
phys_addr_t kernel_x_start = round_down(__pa(_sdata), SECTION_SIZE);
#else
phys_addr_t kernel_x_start = round_down(__pa(_stext), SECTION_SIZE);
#endif
phys_addr_t kernel_x_start = round_down(__pa(KERNEL_START), SECTION_SIZE);
phys_addr_t kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE);

/* Map all the lowmem memory banks. */
Expand Down

0 comments on commit a09975b

Please sign in to comment.