aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-11-21 04:12:49 -0500
committerOlof Johansson <olof@lixom.net>2012-11-21 05:13:12 -0500
commita33ee3e6949e244f9166a7f7e764886432304ecd (patch)
tree257ae924259d68bea516f833c9728d596e7757b5
parent06f31cb0f601728f24b85c51972eee6bdc94a1d1 (diff)
parent52530343331dc111e0899bfc976f21ace5b5c95c (diff)
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()
-rw-r--r--arch/arm/include/asm/mach/map.h7
-rw-r--r--arch/arm/kernel/debug.S14
-rw-r--r--arch/arm/mach-highbank/Makefile1
-rw-r--r--arch/arm/mach-highbank/core.h5
-rw-r--r--arch/arm/mach-highbank/highbank.c8
-rw-r--r--arch/arm/mach-highbank/lluart.c34
-rw-r--r--arch/arm/mm/mmu.c16
7 files changed, 39 insertions, 46 deletions
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
index 195ac2f9d3d3..2fe141fcc8d6 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -40,6 +40,13 @@ extern void iotable_init(struct map_desc *, int);
40extern void vm_reserve_area_early(unsigned long addr, unsigned long size, 40extern void vm_reserve_area_early(unsigned long addr, unsigned long size,
41 void *caller); 41 void *caller);
42 42
43#ifdef CONFIG_DEBUG_LL
44extern void debug_ll_addr(unsigned long *paddr, unsigned long *vaddr);
45extern void debug_ll_io_init(void);
46#else
47static inline void debug_ll_io_init(void) {}
48#endif
49
43struct mem_type; 50struct mem_type;
44extern const struct mem_type *get_mem_type(unsigned int type); 51extern const struct mem_type *get_mem_type(unsigned int type);
45/* 52/*
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index 66f711b2e0e8..6809200c31fb 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -100,6 +100,13 @@ ENTRY(printch)
100 b 1b 100 b 1b
101ENDPROC(printch) 101ENDPROC(printch)
102 102
103ENTRY(debug_ll_addr)
104 addruart r2, r3, ip
105 str r2, [r0]
106 str r3, [r1]
107 mov pc, lr
108ENDPROC(debug_ll_addr)
109
103#else 110#else
104 111
105ENTRY(printascii) 112ENTRY(printascii)
@@ -119,4 +126,11 @@ ENTRY(printch)
119 mov pc, lr 126 mov pc, lr
120ENDPROC(printch) 127ENDPROC(printch)
121 128
129ENTRY(debug_ll_addr)
130 mov r2, #0
131 str r2, [r0]
132 str r2, [r1]
133 mov pc, lr
134ENDPROC(debug_ll_addr)
135
122#endif 136#endif
diff --git a/arch/arm/mach-highbank/Makefile b/arch/arm/mach-highbank/Makefile
index 3ec8bdd25d09..8a1ef576d79f 100644
--- a/arch/arm/mach-highbank/Makefile
+++ b/arch/arm/mach-highbank/Makefile
@@ -3,7 +3,6 @@ obj-y := highbank.o system.o smc.o
3plus_sec := $(call as-instr,.arch_extension sec,+sec) 3plus_sec := $(call as-instr,.arch_extension sec,+sec)
4AFLAGS_smc.o :=-Wa,-march=armv7-a$(plus_sec) 4AFLAGS_smc.o :=-Wa,-march=armv7-a$(plus_sec)
5 5
6obj-$(CONFIG_DEBUG_HIGHBANK_UART) += lluart.o
7obj-$(CONFIG_SMP) += platsmp.o 6obj-$(CONFIG_SMP) += platsmp.o
8obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 7obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
9obj-$(CONFIG_PM_SLEEP) += pm.o 8obj-$(CONFIG_PM_SLEEP) += pm.o
diff --git a/arch/arm/mach-highbank/core.h b/arch/arm/mach-highbank/core.h
index 068c68795c8c..80235b46cb58 100644
--- a/arch/arm/mach-highbank/core.h
+++ b/arch/arm/mach-highbank/core.h
@@ -5,11 +5,6 @@ extern void highbank_set_cpu_jump(int cpu, void *jump_addr);
5extern void highbank_clocks_init(void); 5extern void highbank_clocks_init(void);
6extern void highbank_restart(char, const char *); 6extern void highbank_restart(char, const char *);
7extern void __iomem *scu_base_addr; 7extern void __iomem *scu_base_addr;
8#ifdef CONFIG_DEBUG_HIGHBANK_UART
9extern void highbank_lluart_map_io(void);
10#else
11static inline void highbank_lluart_map_io(void) {}
12#endif
13 8
14#ifdef CONFIG_PM_SLEEP 9#ifdef CONFIG_PM_SLEEP
15extern void highbank_pm_init(void); 10extern void highbank_pm_init(void);
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index 3e60e5744157..dc248167d206 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -35,6 +35,7 @@
35#include <asm/hardware/gic.h> 35#include <asm/hardware/gic.h>
36#include <asm/hardware/cache-l2x0.h> 36#include <asm/hardware/cache-l2x0.h>
37#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
38#include <asm/mach/map.h>
38#include <asm/mach/time.h> 39#include <asm/mach/time.h>
39 40
40#include "core.h" 41#include "core.h"
@@ -53,11 +54,6 @@ static void __init highbank_scu_map_io(void)
53 scu_base_addr = ioremap(base, SZ_4K); 54 scu_base_addr = ioremap(base, SZ_4K);
54} 55}
55 56
56static void __init highbank_map_io(void)
57{
58 highbank_lluart_map_io();
59}
60
61#define HB_JUMP_TABLE_PHYS(cpu) (0x40 + (0x10 * (cpu))) 57#define HB_JUMP_TABLE_PHYS(cpu) (0x40 + (0x10 * (cpu)))
62#define HB_JUMP_TABLE_VIRT(cpu) phys_to_virt(HB_JUMP_TABLE_PHYS(cpu)) 58#define HB_JUMP_TABLE_VIRT(cpu) phys_to_virt(HB_JUMP_TABLE_PHYS(cpu))
63 59
@@ -211,7 +207,7 @@ static const char *highbank_match[] __initconst = {
211 207
212DT_MACHINE_START(HIGHBANK, "Highbank") 208DT_MACHINE_START(HIGHBANK, "Highbank")
213 .smp = smp_ops(highbank_smp_ops), 209 .smp = smp_ops(highbank_smp_ops),
214 .map_io = highbank_map_io, 210 .map_io = debug_ll_io_init,
215 .init_irq = highbank_init_irq, 211 .init_irq = highbank_init_irq,
216 .timer = &highbank_timer, 212 .timer = &highbank_timer,
217 .handle_irq = gic_handle_irq, 213 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-highbank/lluart.c b/arch/arm/mach-highbank/lluart.c
deleted file mode 100644
index 371575019f33..000000000000
--- a/arch/arm/mach-highbank/lluart.c
+++ /dev/null
@@ -1,34 +0,0 @@
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
24static 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
31void __init highbank_lluart_map_io(void)
32{
33 iotable_init(&lluart_io_desc, 1);
34}
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 941dfb9e9a78..39719bb93caa 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -876,6 +876,22 @@ static void __init pci_reserve_io(void)
876#define pci_reserve_io() do { } while (0) 876#define pci_reserve_io() do { } while (0)
877#endif 877#endif
878 878
879#ifdef CONFIG_DEBUG_LL
880void __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
879static void * __initdata vmalloc_min = 895static void * __initdata vmalloc_min =
880 (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET); 896 (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET);
881 897