From dcf639fe6f801f6418357ec20376b2218f666f44 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 14 Jan 2020 11:00:41 +0100 Subject: microblaze: Kernel parameters should be parsed earlier Kernel command line should be parsed before cma initialization to be able to get cma sizes from command line. That's why call parse_early_param() before dma_continugous_reserve(). Unfortunately it can't be called earlier in machine_early_init() because if earlycon is passed in the command line the parse_early_param() attempts an ioremap which fails as the memory params are not set yet. Signed-off-by: Michal Simek Signed-off-by: Shubhrajyoti Datta --- arch/microblaze/kernel/setup.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c index 511c1ab7f57f..a8fc15ac4291 100644 --- a/arch/microblaze/kernel/setup.c +++ b/arch/microblaze/kernel/setup.c @@ -54,7 +54,6 @@ void __init setup_arch(char **cmdline_p) *cmdline_p = boot_command_line; setup_memory(); - parse_early_param(); console_verbose(); -- cgit v1.2.3 From 5119c418f950016eebe7a303e5903a239acaac09 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 12 Feb 2020 09:43:29 +0100 Subject: microblaze: Fix _reset() function There is a need to disable VM before jump to zero reset vector. Signed-off-by: Michal Simek Reviewed-by: Stefan Asserhall --- arch/microblaze/kernel/entry.S | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S index f6ded356394a..b179f8f6d287 100644 --- a/arch/microblaze/kernel/entry.S +++ b/arch/microblaze/kernel/entry.S @@ -958,6 +958,7 @@ ENTRY(_switch_to) nop ENTRY(_reset) + VM_OFF brai 0; /* Jump to reset vector */ /* These are compiled and loaded into high memory, then -- cgit v1.2.3 From cfbd8d1979af64663571baaa389c394b5955b02d Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 20 Jan 2020 12:26:12 +0100 Subject: microblaze: Remove early printk setup Early printk has been removed already that's why this setting doesn't make any sense. Also change printk level from pr_info to pr_err. Fixes: 96f0e6fcc9ad ("microblaze: remove redundant early_printk support") Signed-off-by: Michal Simek Reviewed-by: Stefan Asserhall Reviewed-by: Arnd Bergmann --- arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c index a32daec96c12..c7ee51b0900e 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c +++ b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c @@ -22,13 +22,8 @@ #define CI(c, p) { ci->c = PVR_##p(pvr); } -#if defined(CONFIG_EARLY_PRINTK) && defined(CONFIG_SERIAL_UARTLITE_CONSOLE) #define err_printk(x) \ - early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n"); -#else -#define err_printk(x) \ - pr_info("ERROR: Microblaze " x "-different for PVR and DTS\n"); -#endif + pr_err("ERROR: Microblaze " x "-different for PVR and DTS\n"); void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) { -- cgit v1.2.3 From 512b2203e4b8faaa9c37c51534557345f8744616 Mon Sep 17 00:00:00 2001 From: Stefan Asserhall Date: Tue, 4 Feb 2020 17:55:28 +0100 Subject: microblaze: Add sync to tlb operations Do the real sync by using mbar instruction. Signed-off-by: Stefan Asserhall Signed-off-by: Michal Simek Reviewed-by: Arnd Bergmann --- arch/microblaze/kernel/misc.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/misc.S b/arch/microblaze/kernel/misc.S index 6759af688451..1228a09d8109 100644 --- a/arch/microblaze/kernel/misc.S +++ b/arch/microblaze/kernel/misc.S @@ -39,7 +39,7 @@ _tlbia_1: rsubi r11, r12, MICROBLAZE_TLB_SIZE - 1 bneid r11, _tlbia_1 /* loop for all entries */ addik r12, r12, 1 - /* sync */ + mbar 1 /* sync */ rtsd r15, 8 nop .size _tlbia, . - _tlbia @@ -58,6 +58,7 @@ _tlbie: blti r12, _tlbie_1 /* Check if found */ mts rtlbhi, r0 /* flush: ensure V is clear */ nop + mbar 1 /* sync */ _tlbie_1: rtsd r15, 8 nop -- cgit v1.2.3 From 9e190c543dbf1ff36768277ea45fa6eaadffd4ce Mon Sep 17 00:00:00 2001 From: Stefan Asserhall Date: Tue, 21 Jan 2020 13:01:50 +0100 Subject: microblaze: Add missing irqflags.h header Without this header local_save_flags() is not defined. Signed-off-by: Stefan Asserhall Signed-off-by: Michal Simek Reviewed-by: Arnd Bergmann --- arch/microblaze/kernel/cpu/pvr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/cpu/pvr.c b/arch/microblaze/kernel/cpu/pvr.c index 8d0dc6db48cf..f139052a39bd 100644 --- a/arch/microblaze/kernel/cpu/pvr.c +++ b/arch/microblaze/kernel/cpu/pvr.c @@ -14,6 +14,7 @@ #include #include #include +#include /* * Until we get an assembler that knows about the pvr registers, -- cgit v1.2.3 From d9d2b2f307ce72517e891f21a0e3e101673beb3e Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 4 Feb 2020 17:52:45 +0100 Subject: microblaze: Remove unused boot_cpuid variable boot_cpuid is not used on uni processor system that's why can be removed. Signed-off-by: Michal Simek Reviewed-by: Stefan Asserhall Reviewed-by: Arnd Bergmann --- arch/microblaze/kernel/setup.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c index a8fc15ac4291..dd121e33b8e3 100644 --- a/arch/microblaze/kernel/setup.c +++ b/arch/microblaze/kernel/setup.c @@ -41,7 +41,6 @@ DEFINE_PER_CPU(unsigned int, ENTRY_SP); /* Saved SP on kernel entry */ DEFINE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */ DEFINE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */ -unsigned int boot_cpuid; /* * Placed cmd_line to .data section because can be initialized from * ASM code. Default position is BSS section which is cleared -- cgit v1.2.3 From 06951c9115fe20d479d35c3b4a95c2de0e1d587b Mon Sep 17 00:00:00 2001 From: Stefan Asserhall Date: Tue, 21 Jan 2020 12:11:07 +0100 Subject: microblaze: Define percpu sestion in linker file Adding SMP requires to have percpu section defined. Signed-off-by: Stefan Asserhall Signed-off-by: Michal Simek Reviewed-by: Arnd Bergmann --- arch/microblaze/kernel/vmlinux.lds.S | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S index 2c09fa3a8a01..df07b3d06cd6 100644 --- a/arch/microblaze/kernel/vmlinux.lds.S +++ b/arch/microblaze/kernel/vmlinux.lds.S @@ -13,6 +13,7 @@ ENTRY(microblaze_start) #define RO_EXCEPTION_TABLE_ALIGN 16 +#include #include #include #include @@ -89,6 +90,8 @@ SECTIONS { _KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ; } + PERCPU_SECTION(L1_CACHE_BYTES) + . = ALIGN(PAGE_SIZE); __init_begin = .; -- cgit v1.2.3 From 9fd1a1c9b3f2a38a5357a13335e0b9e5f21d093b Mon Sep 17 00:00:00 2001 From: afzal mohammed Date: Wed, 4 Mar 2020 06:19:59 +0530 Subject: microblaze: Replace setup_irq() by request_irq() request_irq() is preferred over setup_irq(). Invocations of setup_irq() occur after memory allocators are ready. Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized. Hence replace setup_irq() by request_irq(). [1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos Signed-off-by: afzal mohammed Signed-off-by: Michal Simek --- arch/microblaze/kernel/timer.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index a6683484b3a1..f8832cf49384 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c @@ -161,13 +161,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction timer_irqaction = { - .handler = timer_interrupt, - .flags = IRQF_TIMER, - .name = "timer", - .dev_id = &clockevent_xilinx_timer, -}; - static __init int xilinx_clockevent_init(void) { clockevent_xilinx_timer.mult = @@ -309,7 +302,8 @@ static int __init xilinx_timer_init(struct device_node *timer) freq_div_hz = timer_clock_freq / HZ; - ret = setup_irq(irq, &timer_irqaction); + ret = request_irq(irq, timer_interrupt, IRQF_TIMER, "timer", + &clockevent_xilinx_timer); if (ret) { pr_err("Failed to setup IRQ"); return ret; -- cgit v1.2.3