Skip to contentSkip to conversation

arm64-add-early_ioremap-support.patch removed from -mm tree

merged [email protected] 1 participant 1 message Apr 8, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Subject: [merged] arm64-add-early_ioremap-support.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 08 Apr 2014 14:52:01 -0700

The patch titled
Subject: arm64: add early_ioremap support
has been removed from the -mm tree. Its filename was
arm64-add-early_ioremap-support.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Mark Salter <[email protected]>
Subject: arm64: add early_ioremap support

Add support for early IO or memory mappings which are needed before the normal ioremap() is usable. This also adds fixmap support for permanent fixed mappings such as that used by the earlyprintk device register region.

Cc Borislav Petkov <[email protected]>
Cc Dave Young <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Will Deacon <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Thomas Gleixner <[email protected]>

---

 Documentation/arm64/memory.txt   |    4 -
 arch/arm64/Kconfig               |    1 
 arch/arm64/include/asm/Kbuild    |    1 
 arch/arm64/include/asm/fixmap.h  |   67 ++++++++++++++++++++++
 arch/arm64/include/asm/io.h      |    1 
 arch/arm64/include/asm/memory.h  |    2 
 arch/arm64/kernel/early_printk.c |    8 ++
 arch/arm64/kernel/head.S         |    9 +--
 arch/arm64/kernel/setup.c        |    2 
 arch/arm64/mm/ioremap.c          |   85 +++++++++++++++++++++++++++++
 arch/arm64/mm/mmu.c              |   41 -------------
 11 files changed, 169 insertions(+), 52 deletions(-)
Documentation/arm64/memory.txt renamed from Documentation/arm64/memory.txt~arm64-add-early_ioremap-support +2 -2
diff -puN Documentation/arm64/memory.txt~arm64-add-early_ioremap-support Documentation/arm64/memory.txt
@@ -39,7 +39,7 @@ ffffffbffa000000	ffffffbffaffffff	  16MB
 
 ffffffbffb000000	ffffffbffbbfffff	  12MB		[guard]
 
-ffffffbffbc00000	ffffffbffbdfffff	   2MB		earlyprintk device
+ffffffbffbc00000	ffffffbffbdfffff	   2MB		fixed mappings
 
 ffffffbffbe00000	ffffffbffbffffff	   2MB		[guard]
 
@@ -66,7 +66,7 @@ fffffdfffa000000	fffffdfffaffffff	  16MB
 
 fffffdfffb000000	fffffdfffbbfffff	  12MB		[guard]
 
-fffffdfffbc00000	fffffdfffbdfffff	   2MB		earlyprintk device
+fffffdfffbc00000	fffffdfffbdfffff	   2MB		fixed mappings
 
 fffffdfffbe00000	fffffdfffbffffff	   2MB		[guard]
 
arch/arm64/Kconfig renamed from arch/arm64/Kconfig~arm64-add-early_ioremap-support +1 -0
diff -puN arch/arm64/Kconfig~arm64-add-early_ioremap-support arch/arm64/Kconfig
@@ -17,6 +17,7 @@ config ARM64
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_CLOCKEVENTS_BROADCAST if SMP
 	select GENERIC_CPU_AUTOPROBE
+	select GENERIC_EARLY_IOREMAP
 	select GENERIC_IOMAP
 	select GENERIC_IRQ_PROBE
 	select GENERIC_IRQ_SHOW
arch/arm64/include/asm/Kbuild renamed from arch/arm64/include/asm/Kbuild~arm64-add-early_ioremap-support +1 -0
diff -puN arch/arm64/include/asm/Kbuild~arm64-add-early_ioremap-support arch/arm64/include/asm/Kbuild
@@ -10,6 +10,7 @@ generic-y += delay.h
 generic-y += div64.h
 generic-y += dma.h
 generic-y += emergency-restart.h
+generic-y += early_ioremap.h
 generic-y += errno.h
 generic-y += ftrace.h
 generic-y += hash.h
arch/arm64/include/asm/fixmap.h new file +67 -0

67 lines not on this page · raw message

arch/arm64/include/asm/io.h renamed from arch/arm64/include/asm/io.h~arm64-add-early_ioremap-support +1 -0
diff -puN arch/arm64/include/asm/io.h~arm64-add-early_ioremap-support arch/arm64/include/asm/io.h
@@ -27,6 +27,7 @@
 #include <asm/byteorder.h>
 #include <asm/barrier.h>
 #include <asm/pgtable.h>
+#include <asm/early_ioremap.h>
 
 #include <xen/xen.h>
 
arch/arm64/include/asm/memory.h renamed from arch/arm64/include/asm/memory.h~arm64-add-early_ioremap-support +1 -1
diff -puN arch/arm64/include/asm/memory.h~arm64-add-early_ioremap-support arch/arm64/include/asm/memory.h
@@ -49,7 +49,7 @@
 #define PAGE_OFFSET		(UL(0xffffffffffffffff) << (VA_BITS - 1))
 #define MODULES_END		(PAGE_OFFSET)
 #define MODULES_VADDR		(MODULES_END - SZ_64M)
-#define EARLYCON_IOBASE		(MODULES_VADDR - SZ_4M)
+#define FIXADDR_TOP		(MODULES_VADDR - SZ_2M - PAGE_SIZE)
 #define TASK_SIZE_64		(UL(1) << VA_BITS)
 
 #ifdef CONFIG_COMPAT
arch/arm64/kernel/early_printk.c renamed from arch/arm64/kernel/early_printk.c~arm64-add-early_ioremap-support +6 -2
diff -puN arch/arm64/kernel/early_printk.c~arm64-add-early_ioremap-support arch/arm64/kernel/early_printk.c
@@ -26,6 +26,8 @@
 #include <linux/amba/serial.h>
 #include <linux/serial_reg.h>
 
+#include <asm/fixmap.h>
+
 static void __iomem *early_base;
 static void (*printch)(char ch);
 
@@ -141,8 +143,10 @@ static int __init setup_early_printk(cha
 	}
 	/* no options parsing yet */
 
-	if (paddr)
-		early_base = early_io_map(paddr, EARLYCON_IOBASE);
+	if (paddr) {
+		set_fixmap_io(FIX_EARLYCON_MEM_BASE, paddr);
+		early_base = (void __iomem *)fix_to_virt(FIX_EARLYCON_MEM_BASE);
+	}
 
 	printch = match->printch;
 	early_console = &early_console_dev;
arch/arm64/kernel/head.S renamed from arch/arm64/kernel/head.S~arm64-add-early_ioremap-support +3 -6
diff -puN arch/arm64/kernel/head.S~arm64-add-early_ioremap-support arch/arm64/kernel/head.S
@@ -404,7 +404,7 @@ ENDPROC(__calc_phys_offset)
  *   - identity mapping to enable the MMU (low address, TTBR0)
  *   - first few MB of the kernel linear mapping to jump to once the MMU has
  *     been enabled, including the FDT blob (TTBR1)
- *   - UART mapping if CONFIG_EARLY_PRINTK is enabled (TTBR1)
+ *   - pgd entry for fixed mappings (TTBR1)
  */
 __create_page_tables:
 	pgtbl	x25, x26, x24			// idmap_pg_dir and swapper_pg_dir addresses
@@ -461,15 +461,12 @@ __create_page_tables:
 	sub	x6, x6, #1			// inclusive range
 	create_block_map x0, x7, x3, x5, x6
 1:
-#ifdef CONFIG_EARLY_PRINTK
 	/*
-	 * Create the pgd entry for the UART mapping. The full mapping is done
-	 * later based earlyprintk kernel parameter.
+	 * Create the pgd entry for the fixed mappings.
 	 */
-	ldr	x5, =EARLYCON_IOBASE		// UART virtual address
+	ldr	x5, =FIXADDR_TOP		// Fixed mapping virtual address
 	add	x0, x26, #2 * PAGE_SIZE		// section table address
 	create_pgd_entry x26, x0, x5, x6, x7
-#endif
 	ret
 ENDPROC(__create_page_tables)
 	.ltorg
arch/arm64/kernel/setup.c renamed from arch/arm64/kernel/setup.c~arm64-add-early_ioremap-support +2 -0
diff -puN arch/arm64/kernel/setup.c~arm64-add-early_ioremap-support arch/arm64/kernel/setup.c
@@ -42,6 +42,7 @@
 #include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 
+#include <asm/fixmap.h>
 #include <asm/cputype.h>
 #include <asm/elf.h>
 #include <asm/cputable.h>
@@ -361,6 +362,7 @@ void __init setup_arch(char **cmdline_p)
 	*cmdline_p = boot_command_line;
 
 	init_mem_pgprot();
+	early_ioremap_init();
 
 	parse_early_param();
 
arch/arm64/mm/ioremap.c renamed from arch/arm64/mm/ioremap.c~arm64-add-early_ioremap-support +85 -0

94 lines not on this page · raw message

arch/arm64/mm/mmu.c renamed from arch/arm64/mm/mmu.c~arm64-add-early_ioremap-support +0 -40
diff -puN arch/arm64/mm/mmu.c~arm64-add-early_ioremap-support arch/arm64/mm/mmu.c
@@ -260,47 +260,6 @@ static void __init create_mapping(phys_a
 	} while (pgd++, addr = next, addr != end);
 }
 
-#ifdef CONFIG_EARLY_PRINTK
-/*
- * Create an early I/O mapping using the pgd/pmd entries already populated
- * in head.S as this function is called too early to allocated any memory. The
- * mapping size is 2MB with 4KB pages or 64KB or 64KB pages.
- */
-void __iomem * __init early_io_map(phys_addr_t phys, unsigned long virt)
-{
-	unsigned long size, mask;
-	bool page64k = IS_ENABLED(CONFIG_ARM64_64K_PAGES);
-	pgd_t *pgd;
-	pud_t *pud;
-	pmd_t *pmd;
-	pte_t *pte;
-
-	/*
-	 * No early pte entries with !ARM64_64K_PAGES configuration, so using
-	 * sections (pmd).
-	 */
-	size = page64k ? PAGE_SIZE : SECTION_SIZE;
-	mask = ~(size - 1);
-
-	pgd = pgd_offset_k(virt);
-	pud = pud_offset(pgd, virt);
-	if (pud_none(*pud))
-		return NULL;
-	pmd = pmd_offset(pud, virt);
-
-	if (page64k) {
-		if (pmd_none(*pmd))
-			return NULL;
-		pte = pte_offset_kernel(pmd, virt);
-		set_pte(pte, __pte((phys & mask) | PROT_DEVICE_nGnRE));
-	} else {
-		set_pmd(pmd, __pmd((phys & mask) | PROT_SECT_DEVICE_nGnRE));
-	}
-
-	return (void __iomem *)((virt & mask) + (phys & ~mask));
-}
-#endif