Skip to contentSkip to conversation

microblaze: remove early_printk

PATCH Superseded Rob Herring 1 participant 4 messages Feb 28, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

cover microblaze: remove early_printk

This started with removing 'linux,stdout-path' which dtc now warns about, but I noticed the early_printk support only supports that. The early_printk support is redundant with earlycon support since the 2 Xilinx UARTs support earlycon now.

This is compile tested only. If earlycon support has already been tested, then this change should be harmless. AFAICT, the ioremap calls work early before paging is up. Otherwise, fixmap support is needed.

Rob

Rob Herring (3):
microblaze: remove unnecessary prom.h includes
microblaze: remove redundant early_printk support
microblaze: dts: replace 'linux,stdout-path' with 'stdout-path'

 arch/microblaze/Kconfig.debug         |   8 --
 arch/microblaze/boot/dts/system.dts   |   2 +-
 arch/microblaze/include/asm/cpuinfo.h |   2 +-
 arch/microblaze/include/asm/pci.h     |   1 -
 arch/microblaze/include/asm/prom.h    |  27 -----
 arch/microblaze/kernel/Makefile       |   1 -
 arch/microblaze/kernel/early_printk.c | 184 ----------------------------------
 arch/microblaze/kernel/misc.S         |  35 -------
 arch/microblaze/kernel/platform.c     |   1 -
 arch/microblaze/kernel/prom.c         |  80 ---------------
 arch/microblaze/kernel/setup.c        |  12 +--
 arch/microblaze/pci/indirect_pci.c    |   1 -
 12 files changed, 3 insertions(+), 351 deletions(-)
 delete mode 100644 arch/microblaze/include/asm/prom.h
 delete mode 100644 arch/microblaze/kernel/early_printk.c
Signature · 1 line
2.14.1
author maintainer
#1 lore raw

PATCH 1/3 microblaze: remove unnecessary prom.h includes

In preparation to remove prom.h, remove unnecessary prom.h includes.

---
 arch/microblaze/include/asm/cpuinfo.h | 2 +-
 arch/microblaze/include/asm/pci.h     | 1 -
 arch/microblaze/kernel/platform.c     | 1 -
 arch/microblaze/pci/indirect_pci.c    | 1 -
 4 files changed, 1 insertion(+), 4 deletions(-)
arch/microblaze/include/asm/cpuinfo.h +1 -1
index 3337417fcdca..8f4996730552 100644
@@ -13,7 +13,7 @@
 #ifndef _ASM_MICROBLAZE_CPUINFO_H
 #define _ASM_MICROBLAZE_CPUINFO_H
 
-#include <asm/prom.h>
+#include <linux/of.h>
 
 /* CPU Version and FPGA Family code conversion table type */
 struct cpu_ver_key {
arch/microblaze/include/asm/pci.h +0 -1
index 114b93488193..c1ee76d30aed 100644
@@ -19,7 +19,6 @@
 #include <linux/scatterlist.h>
 
 #include <asm/io.h>
-#include <asm/prom.h>
 #include <asm/pci-bridge.h>
 
 #define PCIBIOS_MIN_IO		0x1000
arch/microblaze/kernel/platform.c +0 -1
index b9529caa507a..2540d60610d9 100644
@@ -12,7 +12,6 @@
 
 #include <linux/init.h>
 #include <linux/of_platform.h>
-#include <asm/prom.h>
 #include <asm/setup.h>
 
 static struct of_device_id xilinx_of_bus_ids[] __initdata = {
arch/microblaze/pci/indirect_pci.c +0 -1
index ae4fca46c9f6..24030837a425 100644
@@ -16,7 +16,6 @@
 #include <linux/init.h>
 
 #include <linux/io.h>
-#include <asm/prom.h>
 #include <asm/pci-bridge.h>
 
 static int
Signature · 1 line
2.14.1
author maintainer
#2 lore raw

PATCH 2/3 microblaze: remove redundant early_printk support

In reply to Rob Herring

With earlycon support now enabled, the arch specific early_printk support can be removed.

---
 arch/microblaze/Kconfig.debug         |   8 --
 arch/microblaze/include/asm/prom.h    |  27 -----
 arch/microblaze/kernel/Makefile       |   1 -
 arch/microblaze/kernel/early_printk.c | 184 ----------------------------------
 arch/microblaze/kernel/misc.S         |  35 -------
 arch/microblaze/kernel/prom.c         |  80 ---------------
 arch/microblaze/kernel/setup.c        |  12 +--
 7 files changed, 1 insertion(+), 346 deletions(-)
 delete mode 100644 arch/microblaze/include/asm/prom.h
 delete mode 100644 arch/microblaze/kernel/early_printk.c
arch/microblaze/Kconfig.debug +0 -8
index 012e377330cd..331a3bb66297 100644
@@ -8,14 +8,6 @@ config TRACE_IRQFLAGS_SUPPORT
 
 source "lib/Kconfig.debug"
 
-config EARLY_PRINTK
-	bool "Early printk function for kernel"
-	depends on SERIAL_UARTLITE_CONSOLE || SERIAL_8250_CONSOLE
-	default n
-	help
-	  This option turns on/off early printk messages to console.
-	  First Uartlite node is taken.
-
 config HEART_BEAT
 	bool "Heart beat function for kernel"
 	default n
arch/microblaze/include/asm/prom.h deleted +0 -27
deleted file mode 100644
index 2f03ac815851..000000000000
@@ -1,27 +0,0 @@
-/*
- * Definitions for talking to the Open Firmware PROM on
- * Power Macintosh computers.
- *
- * Copyright (C) 1996-2005 Paul Mackerras.
- *
- * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-#ifndef _ASM_MICROBLAZE_PROM_H
-#define _ASM_MICROBLAZE_PROM_H
-
-#include <linux/of.h>
-
-/* Other Prototypes */
-enum early_consoles {
-	UARTLITE = 1,
-	UART16550 = 2,
-};
-
-extern int of_early_console(void *version);
-
-#endif /* _ASM_MICROBLAZE_PROM_H */
arch/microblaze/kernel/Makefile +0 -1
index 0da76fa1ab17..7e99cf6984a1 100644
@@ -22,7 +22,6 @@ obj-y += dma.o exceptions.o \
 
 obj-y += cpu/
 
-obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 obj-$(CONFIG_HEART_BEAT)	+= heartbeat.o
 obj-$(CONFIG_MODULES)		+= microblaze_ksyms.o module.o
 obj-$(CONFIG_MMU)		+= misc.o
arch/microblaze/kernel/early_printk.c deleted +0 -184

184 lines not on this page · raw message

arch/microblaze/kernel/misc.S +0 -35
index 1dafddeb8a0b..6759af688451 100644
@@ -63,38 +63,3 @@ _tlbie_1:
 	nop
 
 	.size  _tlbie, . - _tlbie
-
-/*
- * Allocate TLB entry for early console
- */
-.globl early_console_reg_tlb_alloc;
-.type  early_console_reg_tlb_alloc, @function
-.align 4;
-early_console_reg_tlb_alloc:
-	/*
-	 * Load a TLB entry for the UART, so that microblaze_progress() can use
-	 * the UARTs nice and early.  We use a 4k real==virtual mapping.
-	 */
-	lwi	r4, r0, tlb_skip
-	mts	rtlbx, r4 /* TLB slot 63 */
-
-	or	r4,r5,r0
-	andi	r4,r4,0xfffff000
-	ori	r4,r4,(TLB_WR|TLB_I|TLB_M|TLB_G)
-
-	andi	r5,r5,0xfffff000
-	ori	r5,r5,(TLB_VALID | TLB_PAGESZ(PAGESZ_4K))
-
-	mts	rtlblo,r4 /* Load the data portion of the entry */
-	nop
-	mts	rtlbhi,r5 /* Load the tag portion of the entry */
-	nop
-
-	lwi	r5, r0, tlb_skip
-	addik	r5, r5, 1
-	swi	r5, r0, tlb_skip
-
-	rtsd	r15, 8
-	nop
-
-	.size  early_console_reg_tlb_alloc, . - early_console_reg_tlb_alloc
arch/microblaze/kernel/prom.c +0 -80

91 lines not on this page · raw message

arch/microblaze/kernel/setup.c +1 -11
index be98ffe28ca8..bd47aba352af 100644
@@ -27,13 +27,12 @@
 #include <linux/param.h>
 #include <linux/pci.h>
 #include <linux/cache.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
 #include <linux/dma-mapping.h>
 #include <asm/cacheflush.h>
 #include <asm/entry.h>
 #include <asm/cpuinfo.h>
 
-#include <asm/prom.h>
 #include <asm/pgtable.h>
 
 DEFINE_PER_CPU(unsigned int, KSP);	/* Saved kernel stack pointer */
@@ -64,11 +63,6 @@ void __init setup_arch(char **cmdline_p)
 
 	setup_memory();
 
-#ifdef CONFIG_EARLY_PRINTK
-	/* remap early console to virtual address */
-	remap_early_printk();
-#endif
-
 	xilinx_pci_init();
 
 #if defined(CONFIG_DUMMY_CONSOLE)
@@ -133,10 +127,6 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
 /* initialize device tree for usage in early_printk */
 	early_init_devtree(_fdt_start);
 
-#ifdef CONFIG_EARLY_PRINTK
-	setup_early_printk(NULL);
-#endif
-
 	/* setup kernel_tlb after BSS cleaning
 	 * Maybe worth to move to asm code */
 	kernel_tlb = tlb0 + tlb1;
Signature · 1 line
2.14.1
author maintainer
#3 lore raw

PATCH 3/3 microblaze: dts: replace 'linux,stdout-path' with 'stdout-path'

In reply to Rob Herring

'linux,stdout-path' has been deprecated for some time in favor of 'stdout-path'. Now dtc will warn on occurrences of 'linux,stdout-path'. Search and replace the one occurrence with 'stdout-path'.

---
 arch/microblaze/boot/dts/system.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/microblaze/boot/dts/system.dts +1 -1
index b620da23febb..8a420c6702eb 100644
@@ -44,7 +44,7 @@
 	} ;
 	chosen {
 		bootargs = "console=ttyUL0,115200 highres=on";
-		linux,stdout-path = "/plb@0/serial@84000000";
+		stdout-path = "/plb@0/serial@84000000";
 	} ;
 	cpus {
 		#address-cells = <1>;
Signature · 1 line
2.14.1