Skip to content

Commit

Permalink
microblaze: remove redundant early_printk support
Browse files Browse the repository at this point in the history
With earlycon support now enabled, the arch specific early_printk support
can be removed.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
  • Loading branch information
Rob Herring authored and Michal Simek committed Apr 23, 2018
1 parent f71044c commit 96f0e6f
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 355 deletions.
8 changes: 0 additions & 8 deletions arch/microblaze/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 0 additions & 27 deletions arch/microblaze/include/asm/prom.h

This file was deleted.

5 changes: 0 additions & 5 deletions arch/microblaze/include/asm/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,11 @@ extern char cmd_line[COMMAND_LINE_SIZE];

extern char *klimit;

int setup_early_printk(char *opt);
void remap_early_printk(void);
void disable_early_printk(void);

void microblaze_heartbeat(void);
void microblaze_setup_heartbeat(void);

# ifdef CONFIG_MMU
extern void mmu_reset(void);
extern void early_console_reg_tlb_alloc(unsigned int addr);
# endif /* CONFIG_MMU */

extern void of_platform_reset_gpio_probe(void);
Expand Down
1 change: 0 additions & 1 deletion arch/microblaze/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
184 changes: 0 additions & 184 deletions arch/microblaze/kernel/early_printk.c

This file was deleted.

35 changes: 0 additions & 35 deletions arch/microblaze/kernel/misc.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
82 changes: 0 additions & 82 deletions arch/microblaze/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,91 +13,11 @@
* 2 of the License, or (at your option) any later version.
*/

#include <stdarg.h>
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/threads.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/stringify.h>
#include <linux/delay.h>
#include <linux/initrd.h>
#include <linux/bitops.h>
#include <linux/kexec.h>
#include <linux/debugfs.h>
#include <linux/irq.h>
#include <linux/memblock.h>
#include <linux/of_fdt.h>

#include <asm/prom.h>
#include <asm/page.h>
#include <asm/processor.h>
#include <asm/irq.h>
#include <linux/io.h>
#include <asm/mmu.h>
#include <asm/pgtable.h>
#include <asm/sections.h>
#include <asm/pci-bridge.h>

#ifdef CONFIG_EARLY_PRINTK
static const char *stdout;

static int __init early_init_dt_scan_chosen_serial(unsigned long node,
const char *uname, int depth, void *data)
{
int l;
const char *p;

pr_debug("%s: depth: %d, uname: %s\n", __func__, depth, uname);

if (depth == 1 && (strcmp(uname, "chosen") == 0 ||
strcmp(uname, "chosen@0") == 0)) {
p = of_get_flat_dt_prop(node, "linux,stdout-path", &l);
if (p != NULL && l > 0)
stdout = p; /* store pointer to stdout-path */
}

if (stdout && strstr(stdout, uname)) {
p = of_get_flat_dt_prop(node, "compatible", &l);
pr_debug("Compatible string: %s\n", p);

if ((strncmp(p, "xlnx,xps-uart16550", 18) == 0) ||
(strncmp(p, "xlnx,axi-uart16550", 18) == 0)) {
unsigned int addr;

*(u32 *)data = UART16550;

addr = *(u32 *)of_get_flat_dt_prop(node, "reg", &l);
addr += *(u32 *)of_get_flat_dt_prop(node,
"reg-offset", &l);
/* clear register offset */
return be32_to_cpu(addr) & ~3;
}
if ((strncmp(p, "xlnx,xps-uartlite", 17) == 0) ||
(strncmp(p, "xlnx,opb-uartlite", 17) == 0) ||
(strncmp(p, "xlnx,axi-uartlite", 17) == 0) ||
(strncmp(p, "xlnx,mdm", 8) == 0)) {
const unsigned int *addrp;

*(u32 *)data = UARTLITE;

addrp = of_get_flat_dt_prop(node, "reg", &l);
return be32_to_cpup(addrp); /* return address */
}
}
return 0;
}

/* this function is looking for early console - Microblaze specific */
int __init of_early_console(void *version)
{
return of_scan_flat_dt(early_init_dt_scan_chosen_serial, version);
}
#endif

void __init early_init_devtree(void *params)
{
pr_debug(" -> early_init_devtree(%p)\n", params);
Expand All @@ -106,8 +26,6 @@ void __init early_init_devtree(void *params)
if (!strlen(boot_command_line))
strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);

parse_early_param();

memblock_allow_resize();

pr_debug("Phys. mem: %lx\n", (unsigned long) memblock_phys_mem_size());
Expand Down
Loading

0 comments on commit 96f0e6f

Please sign in to comment.