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

Merge tag 'highbank-debugll-cleanup' of git://sources.calxeda.com/kernel/linux into next/soc

From Rob Herring:
Use common debug_ll_init function and remove the static mapping code
from mach-highbank.

* tag 'highbank-debugll-cleanup' of git://sources.calxeda.com/kernel/linux:
ARM: highbank: use common debug_ll_io_init
ARM: implement debug_ll_io_init()

+39 -46
+7
arch/arm/include/asm/mach/map.h
··· 40 40 extern void vm_reserve_area_early(unsigned long addr, unsigned long size, 41 41 void *caller); 42 42 43 + #ifdef CONFIG_DEBUG_LL 44 + extern void debug_ll_addr(unsigned long *paddr, unsigned long *vaddr); 45 + extern void debug_ll_io_init(void); 46 + #else 47 + static inline void debug_ll_io_init(void) {} 48 + #endif 49 + 43 50 struct mem_type; 44 51 extern const struct mem_type *get_mem_type(unsigned int type); 45 52 /*
+14
arch/arm/kernel/debug.S
··· 100 100 b 1b 101 101 ENDPROC(printch) 102 102 103 + ENTRY(debug_ll_addr) 104 + addruart r2, r3, ip 105 + str r2, [r0] 106 + str r3, [r1] 107 + mov pc, lr 108 + ENDPROC(debug_ll_addr) 109 + 103 110 #else 104 111 105 112 ENTRY(printascii) ··· 125 118 THUMB( svc #0xab ) 126 119 mov pc, lr 127 120 ENDPROC(printch) 121 + 122 + ENTRY(debug_ll_addr) 123 + mov r2, #0 124 + str r2, [r0] 125 + str r2, [r1] 126 + mov pc, lr 127 + ENDPROC(debug_ll_addr) 128 128 129 129 #endif
-1
arch/arm/mach-highbank/Makefile
··· 3 3 plus_sec := $(call as-instr,.arch_extension sec,+sec) 4 4 AFLAGS_smc.o :=-Wa,-march=armv7-a$(plus_sec) 5 5 6 - obj-$(CONFIG_DEBUG_HIGHBANK_UART) += lluart.o 7 6 obj-$(CONFIG_SMP) += platsmp.o 8 7 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 9 8 obj-$(CONFIG_PM_SLEEP) += pm.o
-5
arch/arm/mach-highbank/core.h
··· 5 5 extern void highbank_clocks_init(void); 6 6 extern void highbank_restart(char, const char *); 7 7 extern void __iomem *scu_base_addr; 8 - #ifdef CONFIG_DEBUG_HIGHBANK_UART 9 - extern void highbank_lluart_map_io(void); 10 - #else 11 - static inline void highbank_lluart_map_io(void) {} 12 - #endif 13 8 14 9 #ifdef CONFIG_PM_SLEEP 15 10 extern void highbank_pm_init(void);
+2 -6
arch/arm/mach-highbank/highbank.c
··· 35 35 #include <asm/hardware/gic.h> 36 36 #include <asm/hardware/cache-l2x0.h> 37 37 #include <asm/mach/arch.h> 38 + #include <asm/mach/map.h> 38 39 #include <asm/mach/time.h> 39 40 40 41 #include "core.h" ··· 52 51 asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base)); 53 52 54 53 scu_base_addr = ioremap(base, SZ_4K); 55 - } 56 - 57 - static void __init highbank_map_io(void) 58 - { 59 - highbank_lluart_map_io(); 60 54 } 61 55 62 56 #define HB_JUMP_TABLE_PHYS(cpu) (0x40 + (0x10 * (cpu))) ··· 207 211 208 212 DT_MACHINE_START(HIGHBANK, "Highbank") 209 213 .smp = smp_ops(highbank_smp_ops), 210 - .map_io = highbank_map_io, 214 + .map_io = debug_ll_io_init, 211 215 .init_irq = highbank_init_irq, 212 216 .timer = &highbank_timer, 213 217 .handle_irq = gic_handle_irq,
-34
arch/arm/mach-highbank/lluart.c
··· 1 - /* 2 - * Copyright 2011 Calxeda, Inc. 3 - * 4 - * This program is free software; you can redistribute it and/or modify it 5 - * under the terms and conditions of the GNU General Public License, 6 - * version 2, as published by the Free Software Foundation. 7 - * 8 - * This program is distributed in the hope it will be useful, but WITHOUT 9 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 - * more details. 12 - * 13 - * You should have received a copy of the GNU General Public License along with 14 - * this program. If not, see <http://www.gnu.org/licenses/>. 15 - */ 16 - #include <linux/init.h> 17 - #include <asm/page.h> 18 - #include <asm/sizes.h> 19 - #include <asm/mach/map.h> 20 - 21 - #define HB_DEBUG_LL_PHYS_BASE 0xfff36000 22 - #define HB_DEBUG_LL_VIRT_BASE 0xfee36000 23 - 24 - static struct map_desc lluart_io_desc __initdata = { 25 - .virtual = HB_DEBUG_LL_VIRT_BASE, 26 - .pfn = __phys_to_pfn(HB_DEBUG_LL_PHYS_BASE), 27 - .length = SZ_4K, 28 - .type = MT_DEVICE, 29 - }; 30 - 31 - void __init highbank_lluart_map_io(void) 32 - { 33 - iotable_init(&lluart_io_desc, 1); 34 - }
+16
arch/arm/mm/mmu.c
··· 876 876 #define pci_reserve_io() do { } while (0) 877 877 #endif 878 878 879 + #ifdef CONFIG_DEBUG_LL 880 + void __init debug_ll_io_init(void) 881 + { 882 + struct map_desc map; 883 + 884 + debug_ll_addr(&map.pfn, &map.virtual); 885 + if (!map.pfn || !map.virtual) 886 + return; 887 + map.pfn = __phys_to_pfn(map.pfn); 888 + map.virtual &= PAGE_MASK; 889 + map.length = PAGE_SIZE; 890 + map.type = MT_DEVICE; 891 + create_mapping(&map); 892 + } 893 + #endif 894 + 879 895 static void * __initdata vmalloc_min = 880 896 (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET); 881 897