Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'for-linus' of https://github.com/openrisc/linux

Pull OpenRISC update from Stafford Horne:
"A single fixup from me: Fix bug with earlycon being broken due to
removal of early_ioremap"

* tag 'for-linus' of https://github.com/openrisc/linux:
openrisc: Implement fixmap to fix earlycon

+45 -16
+3
arch/openrisc/Kconfig
··· 65 65 config LOCKDEP_SUPPORT 66 66 def_bool y 67 67 68 + config FIX_EARLYCON_MEM 69 + def_bool y 70 + 68 71 menu "Processor type and features" 69 72 70 73 choice
+5 -16
arch/openrisc/include/asm/fixmap.h
··· 26 26 #include <linux/bug.h> 27 27 #include <asm/page.h> 28 28 29 - /* 30 - * On OpenRISC we use these special fixed_addresses for doing ioremap 31 - * early in the boot process before memory initialization is complete. 32 - * This is used, in particular, by the early serial console code. 33 - * 34 - * It's not really 'fixmap', per se, but fits loosely into the same 35 - * paradigm. 36 - */ 37 29 enum fixed_addresses { 38 - /* 39 - * FIX_IOREMAP entries are useful for mapping physical address 40 - * space before ioremap() is useable, e.g. really early in boot 41 - * before kmalloc() is working. 42 - */ 43 - #define FIX_N_IOREMAPS 32 44 - FIX_IOREMAP_BEGIN, 45 - FIX_IOREMAP_END = FIX_IOREMAP_BEGIN + FIX_N_IOREMAPS - 1, 30 + FIX_EARLYCON_MEM_BASE, 46 31 __end_of_fixed_addresses 47 32 }; 48 33 49 34 #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 50 35 /* FIXADDR_BOTTOM might be a better name here... */ 51 36 #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 37 + #define FIXMAP_PAGE_IO PAGE_KERNEL_NOCACHE 38 + 39 + extern void __set_fixmap(enum fixed_addresses idx, 40 + phys_addr_t phys, pgprot_t flags); 52 41 53 42 #include <asm-generic/fixmap.h> 54 43
+37
arch/openrisc/mm/init.c
··· 207 207 return; 208 208 } 209 209 210 + static int __init map_page(unsigned long va, phys_addr_t pa, pgprot_t prot) 211 + { 212 + p4d_t *p4d; 213 + pud_t *pud; 214 + pmd_t *pmd; 215 + pte_t *pte; 216 + 217 + p4d = p4d_offset(pgd_offset_k(va), va); 218 + pud = pud_offset(p4d, va); 219 + pmd = pmd_offset(pud, va); 220 + pte = pte_alloc_kernel(pmd, va); 221 + 222 + if (pte == NULL) 223 + return -ENOMEM; 224 + 225 + if (pgprot_val(prot)) 226 + set_pte_at(&init_mm, va, pte, pfn_pte(pa >> PAGE_SHIFT, prot)); 227 + else 228 + pte_clear(&init_mm, va, pte); 229 + 230 + local_flush_tlb_page(NULL, va); 231 + return 0; 232 + } 233 + 234 + void __init __set_fixmap(enum fixed_addresses idx, 235 + phys_addr_t phys, pgprot_t prot) 236 + { 237 + unsigned long address = __fix_to_virt(idx); 238 + 239 + if (idx >= __end_of_fixed_addresses) { 240 + BUG(); 241 + return; 242 + } 243 + 244 + map_page(address, phys, prot); 245 + } 246 + 210 247 static const pgprot_t protection_map[16] = { 211 248 [VM_NONE] = PAGE_NONE, 212 249 [VM_READ] = PAGE_READONLY_X,