Commit 9e885dbd authored by Philippe Gerum's avatar Philippe Gerum
Browse files

cobalt/arm: upgrade I-pipe support

parent 00fa0c06
......@@ -1092,7 +1092,7 @@ index bb28af7..780ca50 100644
static inline void sp804_clockevents_init(void __iomem *base, unsigned int irq, const char *name)
diff --git a/arch/arm/include/asm/ipipe.h b/arch/arm/include/asm/ipipe.h
new file mode 100644
index 0000000..c7704e8
index 0000000..a1737b1
--- /dev/null
+++ b/arch/arm/include/asm/ipipe.h
@@ -0,0 +1,274 @@
......@@ -1140,7 +1140,7 @@ index 0000000..c7704e8
+#include <linux/jump_label.h>
+#include <linux/ipipe_trace.h>
+
+#define IPIPE_CORE_RELEASE 11
+#define IPIPE_CORE_RELEASE 13
+
+struct ipipe_domain;
+
......@@ -5512,7 +5512,7 @@ index da84188..888372f 100644
+ hard_local_irq_enable();
}
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c
index a5afcf7..8ef9c3e 100644
index a5afcf7..8ef9c3eb 100644
--- a/arch/arm/mach-at91/gpio.c
+++ b/arch/arm/mach-at91/gpio.c
@@ -24,9 +24,18 @@
......@@ -9769,7 +9769,7 @@ index 869254c..69438c1 100644
if (IS_ERR(timer->io_base))
return PTR_ERR(timer->io_base);
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index fb92abb..e593b85 100644
index fb92abb9..e593b85 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -104,6 +104,7 @@ struct omap_dm_timer {
......@@ -10181,7 +10181,7 @@ index 5dfbb0b..2f1562c 100644
/*
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 053d846..316b382 100644
index 053d846..16a9412 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -17,6 +17,8 @@
......@@ -10193,7 +10193,7 @@ index 053d846..316b382 100644
#include <asm/arch_timer.h>
#include <asm/virt.h>
@@ -43,14 +45,54 @@ static bool arch_timer_use_virtual = true;
@@ -43,14 +45,57 @@ static bool arch_timer_use_virtual = true;
* Architected system timer support.
*/
......@@ -10246,11 +10246,14 @@ index 053d846..316b382 100644
+ itimer->irq = irq;
+#endif /* CONFIG_IPIPE */
+ stolen:
+ __ipipe_tsc_update();
+ /*
+ * This is a 64bit clock source, no need for TSC
+ * update.
+ */
evt->event_handler(evt);
return IRQ_HANDLED;
}
@@ -62,14 +104,14 @@ static irqreturn_t arch_timer_handler_virt(int irq, void *dev_id)
@@ -62,14 +107,14 @@ static irqreturn_t arch_timer_handler_virt(int irq, void *dev_id)
{
struct clock_event_device *evt = dev_id;
......@@ -10267,7 +10270,7 @@ index 053d846..316b382 100644
}
static inline void timer_set_mode(const int access, int mode)
@@ -142,6 +184,30 @@ static int __cpuinit arch_timer_setup(struct clock_event_device *clk)
@@ -142,6 +187,30 @@ static int __cpuinit arch_timer_setup(struct clock_event_device *clk)
clk->set_mode(CLOCK_EVT_MODE_SHUTDOWN, NULL);
......@@ -10298,7 +10301,7 @@ index 053d846..316b382 100644
clockevents_config_and_register(clk, arch_timer_rate,
0xf, 0x7fffffff);
@@ -275,6 +341,11 @@ static int __init arch_timer_register(void)
@@ -275,6 +344,11 @@ static int __init arch_timer_register(void)
goto out;
}
......@@ -17281,10 +17284,10 @@ index 0000000..2746906
+#endif
diff --git a/kernel/ipipe/timer.c b/kernel/ipipe/timer.c
new file mode 100644
index 0000000..0c9b908
index 0000000..f32a7ff
--- /dev/null
+++ b/kernel/ipipe/timer.c
@@ -0,0 +1,492 @@
@@ -0,0 +1,493 @@
+/* -*- linux-c -*-
+ * linux/kernel/ipipe/timer.c
+ *
......@@ -17652,6 +17655,7 @@ index 0000000..0c9b908
+ timer->real_set_next_event = evtdev->set_next_event;
+ evtdev->mult = 1;
+ evtdev->shift = 0;
+ evtdev->max_delta_ns = UINT_MAX;
+ evtdev->set_mode = emumode;
+ evtdev->set_next_event = emutick;
+ evtdev->ipipe_stolen = 1;
......@@ -21055,18 +21059,6 @@ index 4c0d0e5..886125d 100644
goto out;
/*
diff --git a/mm/Kconfig b/mm/Kconfig
index e742d06..32bedf1 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -385,6 +385,7 @@ config NOMMU_INITIAL_TRIM_EXCESS
config TRANSPARENT_HUGEPAGE
bool "Transparent Hugepage Support"
depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE
+ depends on !IPIPE
select COMPACTION
help
Transparent Hugepages allows the kernel to use huge pages and
diff --git a/mm/memory.c b/mm/memory.c
index 4b60011..b4c639e 100644
--- a/mm/memory.c
......
......@@ -1592,7 +1592,7 @@ index bb28af7..780ca50 100644
static inline void sp804_clockevents_init(void __iomem *base, unsigned int irq, const char *name)
diff --git a/arch/arm/include/asm/ipipe.h b/arch/arm/include/asm/ipipe.h
new file mode 100644
index 0000000..4459611
index 0000000..03bdbf4
--- /dev/null
+++ b/arch/arm/include/asm/ipipe.h
@@ -0,0 +1,272 @@
......@@ -1640,7 +1640,7 @@ index 0000000..4459611
+#include <linux/jump_label.h>
+#include <linux/ipipe_trace.h>
+
+#define IPIPE_CORE_RELEASE 15
+#define IPIPE_CORE_RELEASE 16
+
+struct ipipe_domain;
+
......@@ -4232,7 +4232,7 @@ index 0000000..2829e9a
+EXPORT_SYMBOL_GPL(cpu_architecture);
diff --git a/arch/arm/kernel/ipipe_tsc.c b/arch/arm/kernel/ipipe_tsc.c
new file mode 100644
index 0000000..2e48631
index 0000000..da8d986
--- /dev/null
+++ b/arch/arm/kernel/ipipe_tsc.c
@@ -0,0 +1,203 @@
......@@ -4360,7 +4360,7 @@ index 0000000..2e48631
+
+ default:
+ unimplemented:
+ printk("I-pipel: Unimplemented tsc configuration, "
+ printk("I-pipe: Unimplemented tsc configuration, "
+ "type: %d, mask: 0x%08Lx\n", info->type, info->u.mask);
+ BUG();
+ }
......@@ -4397,8 +4397,8 @@ index 0000000..2e48631
+
+ wrap_ms *= HZ / 2;
+ do_div(wrap_ms, 1000);
+ if (wrap_ms > 0xffffffff)
+ wrap_ms = 0xffffffff;
+ if (wrap_ms > 0x7fffffff)
+ wrap_ms = 0x7fffffff;
+ ipipe_tsc_update_timer.data = wrap_ms;
+ ipipe_tsc_update_timer.function = __ipipe_tsc_update_fn;
+ mod_timer(&ipipe_tsc_update_timer,
......@@ -10858,7 +10858,7 @@ index 2f37e1d..7663e75 100644
/*
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 95fb944..36c1f95 100644
index 95fb944..575b9ae 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -21,6 +21,8 @@
......@@ -10880,7 +10880,7 @@ index 95fb944..36c1f95 100644
{
unsigned long ctrl;
@@ -143,6 +144,49 @@ static __always_inline irqreturn_t timer_handler(const int access,
@@ -143,6 +144,52 @@ static __always_inline irqreturn_t timer_handler(const int access,
if (ctrl & ARCH_TIMER_CTRL_IT_STAT) {
ctrl |= ARCH_TIMER_CTRL_IT_MASK;
arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ctrl, evt);
......@@ -10926,11 +10926,14 @@ index 95fb944..36c1f95 100644
+ itimer->irq = irq;
+#endif /* CONFIG_IPIPE */
+ stolen:
+ __ipipe_tsc_update();
+ /*
+ * This is a 64bit clock source, no need for TSC
+ * update.
+ */
evt->event_handler(evt);
return IRQ_HANDLED;
}
@@ -154,28 +198,28 @@ static irqreturn_t arch_timer_handler_virt(int irq, void *dev_id)
@@ -154,28 +201,28 @@ static irqreturn_t arch_timer_handler_virt(int irq, void *dev_id)
{
struct clock_event_device *evt = dev_id;
......@@ -10963,7 +10966,7 @@ index 95fb944..36c1f95 100644
}
static __always_inline void timer_set_mode(const int access, int mode,
@@ -293,6 +337,18 @@ static void __arch_timer_setup(unsigned type,
@@ -293,6 +340,18 @@ static void __arch_timer_setup(unsigned type,
clk->set_mode(CLOCK_EVT_MODE_SHUTDOWN, clk);
......@@ -10982,7 +10985,7 @@ index 95fb944..36c1f95 100644
clockevents_config_and_register(clk, arch_timer_rate, 0xf, 0x7fffffff);
}
@@ -431,6 +487,11 @@ static void __init arch_counter_register(unsigned type)
@@ -431,6 +490,11 @@ static void __init arch_counter_register(unsigned type)
else
arch_timer_read_counter = arch_counter_get_cntvct_mem;
......@@ -22200,18 +22203,6 @@ index 04abe53..9b2ff41 100644
goto out;
/*
diff --git a/mm/Kconfig b/mm/Kconfig
index 0862816..aacbf2df 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -397,6 +397,7 @@ config NOMMU_INITIAL_TRIM_EXCESS
config TRANSPARENT_HUGEPAGE
bool "Transparent Hugepage Support"
depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE
+ depends on !IPIPE
select COMPACTION
help
Transparent Hugepages allows the kernel to use huge pages and
diff --git a/mm/memory.c b/mm/memory.c
index 749e1c6..090df7e 100644
--- a/mm/memory.c
......
......@@ -1653,7 +1653,7 @@ index bb28af7..780ca50 100644
static inline void sp804_clockevents_init(void __iomem *base, unsigned int irq, const char *name)
diff --git a/arch/arm/include/asm/ipipe.h b/arch/arm/include/asm/ipipe.h
new file mode 100644
index 0000000..128fc6a
index 0000000..d1c125d
--- /dev/null
+++ b/arch/arm/include/asm/ipipe.h
@@ -0,0 +1,272 @@
......@@ -1701,7 +1701,7 @@ index 0000000..128fc6a
+#include <linux/jump_label.h>
+#include <linux/ipipe_trace.h>
+
+#define IPIPE_CORE_RELEASE 8
+#define IPIPE_CORE_RELEASE 9
+
+struct ipipe_domain;
+
......@@ -4301,7 +4301,7 @@ index 0000000..8024a79
+EXPORT_SYMBOL_GPL(cpu_architecture);
diff --git a/arch/arm/kernel/ipipe_tsc.c b/arch/arm/kernel/ipipe_tsc.c
new file mode 100644
index 0000000..4a87f0c
index 0000000..414ada5
--- /dev/null
+++ b/arch/arm/kernel/ipipe_tsc.c
@@ -0,0 +1,203 @@
......@@ -4429,7 +4429,7 @@ index 0000000..4a87f0c
+
+ default:
+ unimplemented:
+ printk("I-pipel: Unimplemented tsc configuration, "
+ printk("I-pipe: Unimplemented tsc configuration, "
+ "type: %d, mask: 0x%08Lx\n", info->type, info->u.mask);
+ BUG();
+ }
......@@ -4466,8 +4466,8 @@ index 0000000..4a87f0c
+
+ wrap_ms *= HZ / 2;
+ do_div(wrap_ms, 1000);
+ if (wrap_ms > 0xffffffff)
+ wrap_ms = 0xffffffff;
+ if (wrap_ms > 0x7fffffff)
+ wrap_ms = 0x7fffffff;
+ ipipe_tsc_update_timer.data = wrap_ms;
+ ipipe_tsc_update_timer.function = __ipipe_tsc_update_fn;
+ mod_timer(&ipipe_tsc_update_timer,
......@@ -5805,7 +5805,7 @@ index aab1f96..8a50f89 100644
static void __init at91sam9260_init_time(void)
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index a8bd359..bceeb39 100644
index a8bd359..bceeb39b 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -365,6 +365,7 @@ static void __init at91sam9261_register_devices(void)
......@@ -11684,7 +11684,7 @@ index 2f37e1d..7663e75 100644
/*
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 84b4c8b..a838b3c 100644
index 84b4c8b..6d7d319 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -21,6 +21,8 @@
......@@ -11706,7 +11706,7 @@ index 84b4c8b..a838b3c 100644
{
unsigned long ctrl;
@@ -144,6 +145,49 @@ static __always_inline irqreturn_t timer_handler(const int access,
@@ -144,6 +145,52 @@ static __always_inline irqreturn_t timer_handler(const int access,
if (ctrl & ARCH_TIMER_CTRL_IT_STAT) {
ctrl |= ARCH_TIMER_CTRL_IT_MASK;
arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ctrl, evt);
......@@ -11752,11 +11752,14 @@ index 84b4c8b..a838b3c 100644
+ itimer->irq = irq;
+#endif /* CONFIG_IPIPE */
+ stolen:
+ __ipipe_tsc_update();
+ /*
+ * This is a 64bit clock source, no need for TSC
+ * update.
+ */
evt->event_handler(evt);
return IRQ_HANDLED;
}
@@ -155,28 +199,28 @@ static irqreturn_t arch_timer_handler_virt(int irq, void *dev_id)
@@ -155,28 +202,28 @@ static irqreturn_t arch_timer_handler_virt(int irq, void *dev_id)
{
struct clock_event_device *evt = dev_id;
......@@ -11789,7 +11792,7 @@ index 84b4c8b..a838b3c 100644
}
static __always_inline void timer_set_mode(const int access, int mode,
@@ -296,6 +340,18 @@ static void __arch_timer_setup(unsigned type,
@@ -296,6 +343,18 @@ static void __arch_timer_setup(unsigned type,
clk->set_mode(CLOCK_EVT_MODE_SHUTDOWN, clk);
......@@ -11808,7 +11811,7 @@ index 84b4c8b..a838b3c 100644
clockevents_config_and_register(clk, arch_timer_rate, 0xf, 0x7fffffff);
}
@@ -477,6 +533,11 @@ static void __init arch_counter_register(unsigned type)
@@ -477,6 +536,11 @@ static void __init arch_counter_register(unsigned type)
clocksource_counter.name = "arch_mem_counter";
}
......@@ -23551,18 +23554,6 @@ index 1afec32..5803111 100644
goto out;
/*
diff --git a/mm/Kconfig b/mm/Kconfig
index 1d1ae6b..dbe4ef9 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -409,6 +409,7 @@ config NOMMU_INITIAL_TRIM_EXCESS
config TRANSPARENT_HUGEPAGE
bool "Transparent Hugepage Support"
depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE
+ depends on !IPIPE
select COMPACTION
help
Transparent Hugepages allows the kernel to use huge pages and
diff --git a/mm/memory.c b/mm/memory.c
index 90fb265..8a1fd79 100644
--- a/mm/memory.c
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment