From 859e5f45cbb33fe5d591a8e429667f0b7d4f4be8 Mon Sep 17 00:00:00 2001 From: Guo Ren Date: Wed, 19 Dec 2018 19:56:14 +0800 Subject: csky: CPU-hotplug supported for SMP This is a simple implement of CPU-hotplug for power saving. CPU use wait instruction to enter power saving mode and waiting for IPI wakeup signal. Signed-off-by: Guo Ren --- arch/csky/Kconfig | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'arch/csky/Kconfig') diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig index cb64f8dacd08..8bdbe9219662 100644 --- a/arch/csky/Kconfig +++ b/arch/csky/Kconfig @@ -198,6 +198,15 @@ config RAM_BASE hex "DRAM start addr (the same with memory-section in dts)" default 0x0 +config HOTPLUG_CPU + bool "Support for hot-pluggable CPUs" + select GENERIC_IRQ_MIGRATION + depends on SMP + help + Say Y here to allow turning CPUs off and on. CPUs can be + controlled through /sys/devices/system/cpu/cpu1/hotplug/target. + + Say N if you want to disable CPU hotplug. endmenu source "kernel/Kconfig.hz" -- cgit v1.2.3 From 0ea2dc7cd668be5475babecaf6fdeaa464e2847b Mon Sep 17 00:00:00 2001 From: Guo Ren Date: Sun, 9 Dec 2018 14:18:05 +0800 Subject: csky: stacktrace supported. The gcc option "-mbacktrace" will push fp(r8),lr into stack and we could unwind the stack with: fp = *fp lr = (unsigned int *)fp[1] Signed-off-by: Guo Ren --- arch/csky/Kconfig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/csky/Kconfig') diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig index 8bdbe9219662..65804d1628a8 100644 --- a/arch/csky/Kconfig +++ b/arch/csky/Kconfig @@ -94,6 +94,9 @@ config MMU config RWSEM_GENERIC_SPINLOCK def_bool y +config STACKTRACE_SUPPORT + def_bool y + config TIME_LOW_RES def_bool y -- cgit v1.2.3 From 230c77a5e92a29bf21e98ee35e22b0537f61c55b Mon Sep 17 00:00:00 2001 From: Guo Ren Date: Sun, 9 Dec 2018 14:29:59 +0800 Subject: csky: basic ftrace supported When gcc with -pg, it'll add _mcount stub in every function. We need implement the _mcount in kernel and ftrace depends on stackstrace. To do: call-graph, dynamic ftrace Signed-off-by: Guo Ren --- arch/csky/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/csky/Kconfig') diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig index 65804d1628a8..0b9a290c0157 100644 --- a/arch/csky/Kconfig +++ b/arch/csky/Kconfig @@ -29,6 +29,7 @@ config CSKY select GENERIC_SCHED_CLOCK select GENERIC_SMP_IDLE_THREAD select HAVE_ARCH_TRACEHOOK + select HAVE_FUNCTION_TRACER select HAVE_GENERIC_DMA_COHERENT select HAVE_KERNEL_GZIP select HAVE_KERNEL_LZO -- cgit v1.2.3 From d7950be145c84ca5094c52bc1ad1e7f1893d0f19 Mon Sep 17 00:00:00 2001 From: Guo Ren Date: Sat, 15 Dec 2018 21:04:27 +0800 Subject: csky: ftrace call graph supported. With csky-gcc -pg -mbacktrace, ftrace call graph supported. Signed-off-by: Guo Ren --- arch/csky/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/csky/Kconfig') diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig index 0b9a290c0157..6e814772d72e 100644 --- a/arch/csky/Kconfig +++ b/arch/csky/Kconfig @@ -30,6 +30,7 @@ config CSKY select GENERIC_SMP_IDLE_THREAD select HAVE_ARCH_TRACEHOOK select HAVE_FUNCTION_TRACER + select HAVE_FUNCTION_GRAPH_TRACER select HAVE_GENERIC_DMA_COHERENT select HAVE_KERNEL_GZIP select HAVE_KERNEL_LZO -- cgit v1.2.3 From f50fd2d8524c15b08da9e7e9d84752f0f1be7172 Mon Sep 17 00:00:00 2001 From: Guo Ren Date: Wed, 2 Jan 2019 22:09:25 +0800 Subject: csky: Add perf support for C-SKY This adds basic perf support for all C-SKY CPUs. Hardware events are only supported by 807/810/860. Signed-off-by: Guo Ren --- arch/csky/Kconfig | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'arch/csky/Kconfig') diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig index 6e814772d72e..7689b54d4236 100644 --- a/arch/csky/Kconfig +++ b/arch/csky/Kconfig @@ -35,6 +35,7 @@ config CSKY select HAVE_KERNEL_GZIP select HAVE_KERNEL_LZO select HAVE_KERNEL_LZMA + select HAVE_PERF_EVENTS select HAVE_C_RECORDMCOUNT select HAVE_DMA_API_DEBUG select HAVE_DMA_CONTIGUOUS @@ -43,7 +44,7 @@ config CSKY select OF select OF_EARLY_FLATTREE select OF_RESERVED_MEM - select PERF_USE_VMALLOC + select PERF_USE_VMALLOC if CPU_CK610 select RTC_LIB select TIMER_OF select USB_ARCH_HAS_EHCI @@ -150,6 +151,19 @@ config CPU_CK860 select CPU_HAS_FPUV2 endchoice +choice + prompt "C-SKY PMU type" + depends on PERF_EVENTS + depends on CPU_CK807 || CPU_CK810 || CPU_CK860 + +config CPU_PMU_NONE + bool "None" + +config CSKY_PMU_V1 + bool "Performance Monitoring Unit Ver.1" + +endchoice + choice prompt "Power Manager Instruction (wait/doze/stop)" default CPU_PM_NONE -- cgit v1.2.3