Skip to content

Commit a09975b

Browse files
ffainelliRussell King
authored andcommitted
ARM: 8639/1: Define KERNEL_START and KERNEL_END
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 <rmk+kernel@armlinux.org.uk> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 4e23612 commit a09975b

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎arch/arm/include/asm/memory.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@
111111

112112
#endif /* !CONFIG_MMU */
113113

114+
#ifdef CONFIG_XIP_KERNEL
115+
#define KERNEL_START _sdata
116+
#else
117+
#define KERNEL_START _stext
118+
#endif
119+
#define KERNEL_END _end
120+
114121
/*
115122
* We fix the TCM memories max 32 KiB ITCM resp DTCM at these
116123
* locations

‎arch/arm/mm/init.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,8 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
230230
void __init arm_memblock_init(const struct machine_desc *mdesc)
231231
{
232232
/* Register the kernel text, kernel data and initrd with memblock. */
233-
#ifdef CONFIG_XIP_KERNEL
234-
memblock_reserve(__pa(_sdata), _end - _sdata);
235-
#else
236-
memblock_reserve(__pa(_stext), _end - _stext);
237-
#endif
233+
memblock_reserve(__pa(KERNEL_START), KERNEL_END - KERNEL_START);
234+
238235
#ifdef CONFIG_BLK_DEV_INITRD
239236
/* FDT scan will populate initrd_start */
240237
if (initrd_start && !phys_initrd_size) {

‎arch/arm/mm/mmu.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,11 +1422,7 @@ static void __init kmap_init(void)
14221422
static void __init map_lowmem(void)
14231423
{
14241424
struct memblock_region *reg;
1425-
#ifdef CONFIG_XIP_KERNEL
1426-
phys_addr_t kernel_x_start = round_down(__pa(_sdata), SECTION_SIZE);
1427-
#else
1428-
phys_addr_t kernel_x_start = round_down(__pa(_stext), SECTION_SIZE);
1429-
#endif
1425+
phys_addr_t kernel_x_start = round_down(__pa(KERNEL_START), SECTION_SIZE);
14301426
phys_addr_t kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE);
14311427

14321428
/* Map all the lowmem memory banks. */

0 commit comments

Comments
 (0)