Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'microblaze-v4.18-rc1' of git://git.monstr.eu/linux-2.6-microblaze

Pull microblaze updates from Michal Simek:

- Fix simpleImage format generation

- Remove earlyprintk support and replace it by earlycon

* tag 'microblaze-v4.18-rc1' of git://git.monstr.eu/linux-2.6-microblaze:
microblaze: dts: replace 'linux,stdout-path' with 'stdout-path'
microblaze: remove redundant early_printk support
microblaze: remove unnecessary prom.h includes
microblaze: Fix simpleImage format generation

+12 -364
-8
arch/microblaze/Kconfig.debug
··· 8 8 9 9 source "lib/Kconfig.debug" 10 10 11 - config EARLY_PRINTK 12 - bool "Early printk function for kernel" 13 - depends on SERIAL_UARTLITE_CONSOLE || SERIAL_8250_CONSOLE 14 - default n 15 - help 16 - This option turns on/off early printk messages to console. 17 - First Uartlite node is taken. 18 - 19 11 config HEART_BEAT 20 12 bool "Heart beat function for kernel" 21 13 default n
+6 -4
arch/microblaze/boot/Makefile
··· 22 22 quiet_cmd_cp = CP $< $@$2 23 23 cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) 24 24 25 - quiet_cmd_strip = STRIP $@ 25 + quiet_cmd_strip = STRIP $< $@$2 26 26 cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \ 27 - -K _fdt_start vmlinux -o $@ 27 + -K _fdt_start $< -o $@$2 28 28 29 29 UIMAGE_LOADADDR = $(CONFIG_KERNEL_BASE_ADDR) 30 + UIMAGE_IN = $@ 31 + UIMAGE_OUT = $@.ub 30 32 31 33 $(obj)/simpleImage.%: vmlinux FORCE 32 34 $(call if_changed,cp,.unstrip) 33 35 $(call if_changed,objcopy) 34 36 $(call if_changed,uimage) 35 - $(call if_changed,strip) 36 - @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' 37 + $(call if_changed,strip,.strip) 38 + @echo 'Kernel: $(UIMAGE_OUT) is ready' ' (#'`cat .version`')' 37 39 38 40 clean-files += simpleImage.*.unstrip linux.bin.ub
+1 -1
arch/microblaze/boot/dts/system.dts
··· 44 44 } ; 45 45 chosen { 46 46 bootargs = "console=ttyUL0,115200 highres=on"; 47 - linux,stdout-path = "/plb@0/serial@84000000"; 47 + stdout-path = "/plb@0/serial@84000000"; 48 48 } ; 49 49 cpus { 50 50 #address-cells = <1>;
+1 -1
arch/microblaze/include/asm/cpuinfo.h
··· 13 13 #ifndef _ASM_MICROBLAZE_CPUINFO_H 14 14 #define _ASM_MICROBLAZE_CPUINFO_H 15 15 16 - #include <asm/prom.h> 16 + #include <linux/of.h> 17 17 18 18 /* CPU Version and FPGA Family code conversion table type */ 19 19 struct cpu_ver_key {
-1
arch/microblaze/include/asm/pci.h
··· 19 19 #include <linux/scatterlist.h> 20 20 21 21 #include <asm/io.h> 22 - #include <asm/prom.h> 23 22 #include <asm/pci-bridge.h> 24 23 25 24 #define PCIBIOS_MIN_IO 0x1000
-27
arch/microblaze/include/asm/prom.h
··· 1 - /* 2 - * Definitions for talking to the Open Firmware PROM on 3 - * Power Macintosh computers. 4 - * 5 - * Copyright (C) 1996-2005 Paul Mackerras. 6 - * 7 - * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. 8 - * 9 - * This program is free software; you can redistribute it and/or 10 - * modify it under the terms of the GNU General Public License 11 - * as published by the Free Software Foundation; either version 12 - * 2 of the License, or (at your option) any later version. 13 - */ 14 - #ifndef _ASM_MICROBLAZE_PROM_H 15 - #define _ASM_MICROBLAZE_PROM_H 16 - 17 - #include <linux/of.h> 18 - 19 - /* Other Prototypes */ 20 - enum early_consoles { 21 - UARTLITE = 1, 22 - UART16550 = 2, 23 - }; 24 - 25 - extern int of_early_console(void *version); 26 - 27 - #endif /* _ASM_MICROBLAZE_PROM_H */
-5
arch/microblaze/include/asm/setup.h
··· 19 19 20 20 extern char *klimit; 21 21 22 - int setup_early_printk(char *opt); 23 - void remap_early_printk(void); 24 - void disable_early_printk(void); 25 - 26 22 void microblaze_heartbeat(void); 27 23 void microblaze_setup_heartbeat(void); 28 24 29 25 # ifdef CONFIG_MMU 30 26 extern void mmu_reset(void); 31 - extern void early_console_reg_tlb_alloc(unsigned int addr); 32 27 # endif /* CONFIG_MMU */ 33 28 34 29 extern void of_platform_reset_gpio_probe(void);
-1
arch/microblaze/kernel/Makefile
··· 22 22 23 23 obj-y += cpu/ 24 24 25 - obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 26 25 obj-$(CONFIG_HEART_BEAT) += heartbeat.o 27 26 obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o 28 27 obj-$(CONFIG_MMU) += misc.o
-184
arch/microblaze/kernel/early_printk.c
··· 1 - /* 2 - * Early printk support for Microblaze. 3 - * 4 - * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu> 5 - * Copyright (C) 2007-2009 PetaLogix 6 - * Copyright (C) 2003-2006 Yasushi SHOJI <yashi@atmark-techno.com> 7 - * 8 - * This file is subject to the terms and conditions of the GNU General Public 9 - * License. See the file "COPYING" in the main directory of this archive 10 - * for more details. 11 - */ 12 - 13 - #include <linux/console.h> 14 - #include <linux/kernel.h> 15 - #include <linux/init.h> 16 - #include <linux/string.h> 17 - #include <linux/tty.h> 18 - #include <linux/io.h> 19 - #include <asm/processor.h> 20 - #include <linux/fcntl.h> 21 - #include <asm/setup.h> 22 - #include <asm/prom.h> 23 - 24 - static u32 base_addr; 25 - 26 - #ifdef CONFIG_SERIAL_UARTLITE_CONSOLE 27 - static void early_printk_uartlite_putc(char c) 28 - { 29 - /* 30 - * Limit how many times we'll spin waiting for TX FIFO status. 31 - * This will prevent lockups if the base address is incorrectly 32 - * set, or any other issue on the UARTLITE. 33 - * This limit is pretty arbitrary, unless we are at about 10 baud 34 - * we'll never timeout on a working UART. 35 - */ 36 - 37 - unsigned retries = 1000000; 38 - /* read status bit - 0x8 offset */ 39 - while (--retries && (in_be32(base_addr + 8) & (1 << 3))) 40 - ; 41 - 42 - /* Only attempt the iowrite if we didn't timeout */ 43 - /* write to TX_FIFO - 0x4 offset */ 44 - if (retries) 45 - out_be32(base_addr + 4, c & 0xff); 46 - } 47 - 48 - static void early_printk_uartlite_write(struct console *unused, 49 - const char *s, unsigned n) 50 - { 51 - while (*s && n-- > 0) { 52 - if (*s == '\n') 53 - early_printk_uartlite_putc('\r'); 54 - early_printk_uartlite_putc(*s); 55 - s++; 56 - } 57 - } 58 - 59 - static struct console early_serial_uartlite_console = { 60 - .name = "earlyser", 61 - .write = early_printk_uartlite_write, 62 - .flags = CON_PRINTBUFFER | CON_BOOT, 63 - .index = -1, 64 - }; 65 - #endif /* CONFIG_SERIAL_UARTLITE_CONSOLE */ 66 - 67 - #ifdef CONFIG_SERIAL_8250_CONSOLE 68 - static void early_printk_uart16550_putc(char c) 69 - { 70 - /* 71 - * Limit how many times we'll spin waiting for TX FIFO status. 72 - * This will prevent lockups if the base address is incorrectly 73 - * set, or any other issue on the UARTLITE. 74 - * This limit is pretty arbitrary, unless we are at about 10 baud 75 - * we'll never timeout on a working UART. 76 - */ 77 - 78 - #define UART_LSR_TEMT 0x40 /* Transmitter empty */ 79 - #define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ 80 - #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) 81 - 82 - unsigned retries = 10000; 83 - 84 - while (--retries && 85 - !((in_be32(base_addr + 0x14) & BOTH_EMPTY) == BOTH_EMPTY)) 86 - ; 87 - 88 - if (retries) 89 - out_be32(base_addr, c & 0xff); 90 - } 91 - 92 - static void early_printk_uart16550_write(struct console *unused, 93 - const char *s, unsigned n) 94 - { 95 - while (*s && n-- > 0) { 96 - if (*s == '\n') 97 - early_printk_uart16550_putc('\r'); 98 - early_printk_uart16550_putc(*s); 99 - s++; 100 - } 101 - } 102 - 103 - static struct console early_serial_uart16550_console = { 104 - .name = "earlyser", 105 - .write = early_printk_uart16550_write, 106 - .flags = CON_PRINTBUFFER | CON_BOOT, 107 - .index = -1, 108 - }; 109 - #endif /* CONFIG_SERIAL_8250_CONSOLE */ 110 - 111 - int __init setup_early_printk(char *opt) 112 - { 113 - int version = 0; 114 - 115 - if (early_console) 116 - return 1; 117 - 118 - base_addr = of_early_console(&version); 119 - if (base_addr) { 120 - #ifdef CONFIG_MMU 121 - early_console_reg_tlb_alloc(base_addr); 122 - #endif 123 - switch (version) { 124 - #ifdef CONFIG_SERIAL_UARTLITE_CONSOLE 125 - case UARTLITE: 126 - pr_info("Early console on uartlite at 0x%08x\n", 127 - base_addr); 128 - early_console = &early_serial_uartlite_console; 129 - break; 130 - #endif 131 - #ifdef CONFIG_SERIAL_8250_CONSOLE 132 - case UART16550: 133 - pr_info("Early console on uart16650 at 0x%08x\n", 134 - base_addr); 135 - early_console = &early_serial_uart16550_console; 136 - break; 137 - #endif 138 - default: 139 - pr_info("Unsupported early console %d\n", 140 - version); 141 - return 1; 142 - } 143 - 144 - register_console(early_console); 145 - return 0; 146 - } 147 - return 1; 148 - } 149 - 150 - /* Remap early console to virtual address and do not allocate one TLB 151 - * only for early console because of performance degression */ 152 - void __init remap_early_printk(void) 153 - { 154 - if (!early_console) 155 - return; 156 - pr_info("early_printk_console remapping from 0x%x to ", base_addr); 157 - base_addr = (u32) ioremap(base_addr, PAGE_SIZE); 158 - pr_cont("0x%x\n", base_addr); 159 - 160 - #ifdef CONFIG_MMU 161 - /* 162 - * Early console is on the top of skipped TLB entries 163 - * decrease tlb_skip size ensure that hardcoded TLB entry will be 164 - * used by generic algorithm 165 - * FIXME check if early console mapping is on the top by rereading 166 - * TLB entry and compare baseaddr 167 - * mts rtlbx, (tlb_skip - 1) 168 - * nop 169 - * mfs rX, rtlblo 170 - * nop 171 - * cmp rX, orig_base_addr 172 - */ 173 - tlb_skip -= 1; 174 - #endif 175 - } 176 - 177 - void __init disable_early_printk(void) 178 - { 179 - if (!early_console) 180 - return; 181 - pr_warn("disabling early console\n"); 182 - unregister_console(early_console); 183 - early_console = NULL; 184 - }
-35
arch/microblaze/kernel/misc.S
··· 63 63 nop 64 64 65 65 .size _tlbie, . - _tlbie 66 - 67 - /* 68 - * Allocate TLB entry for early console 69 - */ 70 - .globl early_console_reg_tlb_alloc; 71 - .type early_console_reg_tlb_alloc, @function 72 - .align 4; 73 - early_console_reg_tlb_alloc: 74 - /* 75 - * Load a TLB entry for the UART, so that microblaze_progress() can use 76 - * the UARTs nice and early. We use a 4k real==virtual mapping. 77 - */ 78 - lwi r4, r0, tlb_skip 79 - mts rtlbx, r4 /* TLB slot 63 */ 80 - 81 - or r4,r5,r0 82 - andi r4,r4,0xfffff000 83 - ori r4,r4,(TLB_WR|TLB_I|TLB_M|TLB_G) 84 - 85 - andi r5,r5,0xfffff000 86 - ori r5,r5,(TLB_VALID | TLB_PAGESZ(PAGESZ_4K)) 87 - 88 - mts rtlblo,r4 /* Load the data portion of the entry */ 89 - nop 90 - mts rtlbhi,r5 /* Load the tag portion of the entry */ 91 - nop 92 - 93 - lwi r5, r0, tlb_skip 94 - addik r5, r5, 1 95 - swi r5, r0, tlb_skip 96 - 97 - rtsd r15, 8 98 - nop 99 - 100 - .size early_console_reg_tlb_alloc, . - early_console_reg_tlb_alloc
-1
arch/microblaze/kernel/platform.c
··· 12 12 13 13 #include <linux/init.h> 14 14 #include <linux/of_platform.h> 15 - #include <asm/prom.h> 16 15 #include <asm/setup.h> 17 16 18 17 static struct of_device_id xilinx_of_bus_ids[] __initdata = {
-82
arch/microblaze/kernel/prom.c
··· 13 13 * 2 of the License, or (at your option) any later version. 14 14 */ 15 15 16 - #include <stdarg.h> 17 - #include <linux/export.h> 18 16 #include <linux/kernel.h> 19 17 #include <linux/string.h> 20 - #include <linux/init.h> 21 - #include <linux/threads.h> 22 - #include <linux/spinlock.h> 23 - #include <linux/types.h> 24 - #include <linux/pci.h> 25 - #include <linux/stringify.h> 26 - #include <linux/delay.h> 27 - #include <linux/initrd.h> 28 - #include <linux/bitops.h> 29 - #include <linux/kexec.h> 30 - #include <linux/debugfs.h> 31 - #include <linux/irq.h> 32 18 #include <linux/memblock.h> 33 19 #include <linux/of_fdt.h> 34 - 35 - #include <asm/prom.h> 36 - #include <asm/page.h> 37 - #include <asm/processor.h> 38 - #include <asm/irq.h> 39 - #include <linux/io.h> 40 - #include <asm/mmu.h> 41 - #include <asm/pgtable.h> 42 - #include <asm/sections.h> 43 - #include <asm/pci-bridge.h> 44 - 45 - #ifdef CONFIG_EARLY_PRINTK 46 - static const char *stdout; 47 - 48 - static int __init early_init_dt_scan_chosen_serial(unsigned long node, 49 - const char *uname, int depth, void *data) 50 - { 51 - int l; 52 - const char *p; 53 - 54 - pr_debug("%s: depth: %d, uname: %s\n", __func__, depth, uname); 55 - 56 - if (depth == 1 && (strcmp(uname, "chosen") == 0 || 57 - strcmp(uname, "chosen@0") == 0)) { 58 - p = of_get_flat_dt_prop(node, "linux,stdout-path", &l); 59 - if (p != NULL && l > 0) 60 - stdout = p; /* store pointer to stdout-path */ 61 - } 62 - 63 - if (stdout && strstr(stdout, uname)) { 64 - p = of_get_flat_dt_prop(node, "compatible", &l); 65 - pr_debug("Compatible string: %s\n", p); 66 - 67 - if ((strncmp(p, "xlnx,xps-uart16550", 18) == 0) || 68 - (strncmp(p, "xlnx,axi-uart16550", 18) == 0)) { 69 - unsigned int addr; 70 - 71 - *(u32 *)data = UART16550; 72 - 73 - addr = *(u32 *)of_get_flat_dt_prop(node, "reg", &l); 74 - addr += *(u32 *)of_get_flat_dt_prop(node, 75 - "reg-offset", &l); 76 - /* clear register offset */ 77 - return be32_to_cpu(addr) & ~3; 78 - } 79 - if ((strncmp(p, "xlnx,xps-uartlite", 17) == 0) || 80 - (strncmp(p, "xlnx,opb-uartlite", 17) == 0) || 81 - (strncmp(p, "xlnx,axi-uartlite", 17) == 0) || 82 - (strncmp(p, "xlnx,mdm", 8) == 0)) { 83 - const unsigned int *addrp; 84 - 85 - *(u32 *)data = UARTLITE; 86 - 87 - addrp = of_get_flat_dt_prop(node, "reg", &l); 88 - return be32_to_cpup(addrp); /* return address */ 89 - } 90 - } 91 - return 0; 92 - } 93 - 94 - /* this function is looking for early console - Microblaze specific */ 95 - int __init of_early_console(void *version) 96 - { 97 - return of_scan_flat_dt(early_init_dt_scan_chosen_serial, version); 98 - } 99 - #endif 100 20 101 21 void __init early_init_devtree(void *params) 102 22 { ··· 25 105 early_init_dt_scan(params); 26 106 if (!strlen(boot_command_line)) 27 107 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); 28 - 29 - parse_early_param(); 30 108 31 109 memblock_allow_resize(); 32 110
+4 -13
arch/microblaze/kernel/setup.c
··· 27 27 #include <linux/param.h> 28 28 #include <linux/pci.h> 29 29 #include <linux/cache.h> 30 - #include <linux/of_platform.h> 30 + #include <linux/of.h> 31 31 #include <linux/dma-mapping.h> 32 32 #include <asm/cacheflush.h> 33 33 #include <asm/entry.h> 34 34 #include <asm/cpuinfo.h> 35 35 36 - #include <asm/prom.h> 37 36 #include <asm/pgtable.h> 38 37 39 38 DEFINE_PER_CPU(unsigned int, KSP); /* Saved kernel stack pointer */ ··· 53 54 { 54 55 *cmdline_p = boot_command_line; 55 56 57 + setup_memory(); 58 + parse_early_param(); 59 + 56 60 console_verbose(); 57 61 58 62 unflatten_device_tree(); ··· 63 61 setup_cpuinfo(); 64 62 65 63 microblaze_cache_init(); 66 - 67 - setup_memory(); 68 - 69 - #ifdef CONFIG_EARLY_PRINTK 70 - /* remap early console to virtual address */ 71 - remap_early_printk(); 72 - #endif 73 64 74 65 xilinx_pci_init(); 75 66 ··· 127 132 128 133 /* initialize device tree for usage in early_printk */ 129 134 early_init_devtree(_fdt_start); 130 - 131 - #ifdef CONFIG_EARLY_PRINTK 132 - setup_early_printk(NULL); 133 - #endif 134 135 135 136 /* setup kernel_tlb after BSS cleaning 136 137 * Maybe worth to move to asm code */
-1
arch/microblaze/pci/indirect_pci.c
··· 16 16 #include <linux/init.h> 17 17 18 18 #include <linux/io.h> 19 - #include <asm/prom.h> 20 19 #include <asm/pci-bridge.h> 21 20 22 21 static int