Commit 6bd55f0b authored by Michal Simek's avatar Michal Simek Committed by Michal Simek

microblaze: Fix coding style issues

Fix coding style issues reported by checkpatch.pl.
Signed-off-by: default avatarMichal Simek <monstr@monstr.eu>
parent 5b3084b5
...@@ -150,7 +150,7 @@ static inline void writel(unsigned int v, volatile void __iomem *addr) ...@@ -150,7 +150,7 @@ static inline void writel(unsigned int v, volatile void __iomem *addr)
#define page_to_bus(page) (page_to_phys(page)) #define page_to_bus(page) (page_to_phys(page))
#define bus_to_virt(addr) (phys_to_virt(addr)) #define bus_to_virt(addr) (phys_to_virt(addr))
extern void iounmap(void *addr); extern void iounmap(void __iomem *addr);
/*extern void *__ioremap(phys_addr_t address, unsigned long size, /*extern void *__ioremap(phys_addr_t address, unsigned long size,
unsigned long flags);*/ unsigned long flags);*/
extern void __iomem *ioremap(phys_addr_t address, unsigned long size); extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
......
...@@ -17,82 +17,70 @@ ...@@ -17,82 +17,70 @@
static inline void __enable_icache_msr(void) static inline void __enable_icache_msr(void)
{ {
__asm__ __volatile__ (" msrset r0, %0; \ __asm__ __volatile__ (" msrset r0, %0;" \
nop; " \ "nop;" \
: : "i" (MSR_ICE) : "memory"); : : "i" (MSR_ICE) : "memory");
} }
static inline void __disable_icache_msr(void) static inline void __disable_icache_msr(void)
{ {
__asm__ __volatile__ (" msrclr r0, %0; \ __asm__ __volatile__ (" msrclr r0, %0;" \
nop; " \ "nop;" \
: : "i" (MSR_ICE) : "memory"); : : "i" (MSR_ICE) : "memory");
} }
static inline void __enable_dcache_msr(void) static inline void __enable_dcache_msr(void)
{ {
__asm__ __volatile__ (" msrset r0, %0; \ __asm__ __volatile__ (" msrset r0, %0;" \
nop; " \ "nop;" \
: \ : : "i" (MSR_DCE) : "memory");
: "i" (MSR_DCE) \
: "memory");
} }
static inline void __disable_dcache_msr(void) static inline void __disable_dcache_msr(void)
{ {
__asm__ __volatile__ (" msrclr r0, %0; \ __asm__ __volatile__ (" msrclr r0, %0;" \
nop; " \ "nop; " \
: \ : : "i" (MSR_DCE) : "memory");
: "i" (MSR_DCE) \
: "memory");
} }
static inline void __enable_icache_nomsr(void) static inline void __enable_icache_nomsr(void)
{ {
__asm__ __volatile__ (" mfs r12, rmsr; \ __asm__ __volatile__ (" mfs r12, rmsr;" \
nop; \ "nop;" \
ori r12, r12, %0; \ "ori r12, r12, %0;" \
mts rmsr, r12; \ "mts rmsr, r12;" \
nop; " \ "nop;" \
: \ : : "i" (MSR_ICE) : "memory", "r12");
: "i" (MSR_ICE) \
: "memory", "r12");
} }
static inline void __disable_icache_nomsr(void) static inline void __disable_icache_nomsr(void)
{ {
__asm__ __volatile__ (" mfs r12, rmsr; \ __asm__ __volatile__ (" mfs r12, rmsr;" \
nop; \ "nop;" \
andi r12, r12, ~%0; \ "andi r12, r12, ~%0;" \
mts rmsr, r12; \ "mts rmsr, r12;" \
nop; " \ "nop;" \
: \ : : "i" (MSR_ICE) : "memory", "r12");
: "i" (MSR_ICE) \
: "memory", "r12");
} }
static inline void __enable_dcache_nomsr(void) static inline void __enable_dcache_nomsr(void)
{ {
__asm__ __volatile__ (" mfs r12, rmsr; \ __asm__ __volatile__ (" mfs r12, rmsr;" \
nop; \ "nop;" \
ori r12, r12, %0; \ "ori r12, r12, %0;" \
mts rmsr, r12; \ "mts rmsr, r12;" \
nop; " \ "nop;" \
: \ : : "i" (MSR_DCE) : "memory", "r12");
: "i" (MSR_DCE) \
: "memory", "r12");
} }
static inline void __disable_dcache_nomsr(void) static inline void __disable_dcache_nomsr(void)
{ {
__asm__ __volatile__ (" mfs r12, rmsr; \ __asm__ __volatile__ (" mfs r12, rmsr;" \
nop; \ "nop;" \
andi r12, r12, ~%0; \ "andi r12, r12, ~%0;" \
mts rmsr, r12; \ "mts rmsr, r12;" \
nop; " \ "nop;" \
: \ : : "i" (MSR_DCE) : "memory", "r12");
: "i" (MSR_DCE) \
: "memory", "r12");
} }
...@@ -106,7 +94,7 @@ do { \ ...@@ -106,7 +94,7 @@ do { \
int align = ~(cache_line_length - 1); \ int align = ~(cache_line_length - 1); \
end = min(start + cache_size, end); \ end = min(start + cache_size, end); \
start &= align; \ start &= align; \
} while (0); } while (0)
/* /*
* Helper macro to loop over the specified cache_size/line_length and * Helper macro to loop over the specified cache_size/line_length and
...@@ -118,12 +106,12 @@ do { \ ...@@ -118,12 +106,12 @@ do { \
int step = -line_length; \ int step = -line_length; \
WARN_ON(step >= 0); \ WARN_ON(step >= 0); \
\ \
__asm__ __volatile__ (" 1: " #op " %0, r0; \ __asm__ __volatile__ (" 1: " #op " %0, r0;" \
bgtid %0, 1b; \ "bgtid %0, 1b;" \
addk %0, %0, %1; \ "addk %0, %0, %1;" \
" : : "r" (len), "r" (step) \ : : "r" (len), "r" (step) \
: "memory"); \ : "memory"); \
} while (0); } while (0)
/* Used for wdc.flush/clear which can use rB for offset which is not possible /* Used for wdc.flush/clear which can use rB for offset which is not possible
* to use for simple wdc or wic. * to use for simple wdc or wic.
...@@ -142,12 +130,12 @@ do { \ ...@@ -142,12 +130,12 @@ do { \
count = end - start; \ count = end - start; \
WARN_ON(count < 0); \ WARN_ON(count < 0); \
\ \
__asm__ __volatile__ (" 1: " #op " %0, %1; \ __asm__ __volatile__ (" 1: " #op " %0, %1;" \
bgtid %1, 1b; \ "bgtid %1, 1b;" \
addk %1, %1, %2; \ "addk %1, %1, %2;" \
" : : "r" (start), "r" (count), \ : : "r" (start), "r" (count), \
"r" (step) : "memory"); \ "r" (step) : "memory"); \
} while (0); } while (0)
/* It is used only first parameter for OP - for wic, wdc */ /* It is used only first parameter for OP - for wic, wdc */
#define CACHE_RANGE_LOOP_1(start, end, line_length, op) \ #define CACHE_RANGE_LOOP_1(start, end, line_length, op) \
...@@ -157,13 +145,13 @@ do { \ ...@@ -157,13 +145,13 @@ do { \
end = ((end & align) == end) ? end - line_length : end & align; \ end = ((end & align) == end) ? end - line_length : end & align; \
WARN_ON(end - start < 0); \ WARN_ON(end - start < 0); \
\ \
__asm__ __volatile__ (" 1: " #op " %1, r0; \ __asm__ __volatile__ (" 1: " #op " %1, r0;" \
cmpu %0, %1, %2; \ "cmpu %0, %1, %2;" \
bgtid %0, 1b; \ "bgtid %0, 1b;" \
addk %1, %1, %3; \ "addk %1, %1, %3;" \
" : : "r" (temp), "r" (start), "r" (end),\ : : "r" (temp), "r" (start), "r" (end), \
"r" (line_length) : "memory"); \ "r" (line_length) : "memory"); \
} while (0); } while (0)
#define ASM_LOOP #define ASM_LOOP
...@@ -352,7 +340,7 @@ static void __invalidate_dcache_all_noirq_wt(void) ...@@ -352,7 +340,7 @@ static void __invalidate_dcache_all_noirq_wt(void)
#endif #endif
pr_debug("%s\n", __func__); pr_debug("%s\n", __func__);
#ifdef ASM_LOOP #ifdef ASM_LOOP
CACHE_ALL_LOOP(cpuinfo.dcache_size, cpuinfo.dcache_line_length, wdc) CACHE_ALL_LOOP(cpuinfo.dcache_size, cpuinfo.dcache_line_length, wdc);
#else #else
for (i = 0; i < cpuinfo.dcache_size; for (i = 0; i < cpuinfo.dcache_size;
i += cpuinfo.dcache_line_length) i += cpuinfo.dcache_line_length)
...@@ -361,7 +349,8 @@ static void __invalidate_dcache_all_noirq_wt(void) ...@@ -361,7 +349,8 @@ static void __invalidate_dcache_all_noirq_wt(void)
#endif #endif
} }
/* FIXME It is blindly invalidation as is expected /*
* FIXME It is blindly invalidation as is expected
* but can't be called on noMMU in microblaze_cache_init below * but can't be called on noMMU in microblaze_cache_init below
* *
* MS: noMMU kernel won't boot if simple wdc is used * MS: noMMU kernel won't boot if simple wdc is used
...@@ -375,7 +364,7 @@ static void __invalidate_dcache_all_wb(void) ...@@ -375,7 +364,7 @@ static void __invalidate_dcache_all_wb(void)
pr_debug("%s\n", __func__); pr_debug("%s\n", __func__);
#ifdef ASM_LOOP #ifdef ASM_LOOP
CACHE_ALL_LOOP(cpuinfo.dcache_size, cpuinfo.dcache_line_length, CACHE_ALL_LOOP(cpuinfo.dcache_size, cpuinfo.dcache_line_length,
wdc) wdc);
#else #else
for (i = 0; i < cpuinfo.dcache_size; for (i = 0; i < cpuinfo.dcache_size;
i += cpuinfo.dcache_line_length) i += cpuinfo.dcache_line_length)
...@@ -616,46 +605,45 @@ static const struct scache wt_nomsr_noirq = { ...@@ -616,46 +605,45 @@ static const struct scache wt_nomsr_noirq = {
#define CPUVER_7_20_A 0x0c #define CPUVER_7_20_A 0x0c
#define CPUVER_7_20_D 0x0f #define CPUVER_7_20_D 0x0f
#define INFO(s) printk(KERN_INFO "cache: " s "\n");
void microblaze_cache_init(void) void microblaze_cache_init(void)
{ {
if (cpuinfo.use_instr & PVR2_USE_MSR_INSTR) { if (cpuinfo.use_instr & PVR2_USE_MSR_INSTR) {
if (cpuinfo.dcache_wb) { if (cpuinfo.dcache_wb) {
INFO("wb_msr"); pr_info("wb_msr\n");
mbc = (struct scache *)&wb_msr; mbc = (struct scache *)&wb_msr;
if (cpuinfo.ver_code <= CPUVER_7_20_D) { if (cpuinfo.ver_code <= CPUVER_7_20_D) {
/* MS: problem with signal handling - hw bug */ /* MS: problem with signal handling - hw bug */
INFO("WB won't work properly"); pr_info("WB won't work properly\n");
} }
} else { } else {
if (cpuinfo.ver_code >= CPUVER_7_20_A) { if (cpuinfo.ver_code >= CPUVER_7_20_A) {
INFO("wt_msr_noirq"); pr_info("wt_msr_noirq\n");
mbc = (struct scache *)&wt_msr_noirq; mbc = (struct scache *)&wt_msr_noirq;
} else { } else {
INFO("wt_msr"); pr_info("wt_msr\n");
mbc = (struct scache *)&wt_msr; mbc = (struct scache *)&wt_msr;
} }
} }
} else { } else {
if (cpuinfo.dcache_wb) { if (cpuinfo.dcache_wb) {
INFO("wb_nomsr"); pr_info("wb_nomsr\n");
mbc = (struct scache *)&wb_nomsr; mbc = (struct scache *)&wb_nomsr;
if (cpuinfo.ver_code <= CPUVER_7_20_D) { if (cpuinfo.ver_code <= CPUVER_7_20_D) {
/* MS: problem with signal handling - hw bug */ /* MS: problem with signal handling - hw bug */
INFO("WB won't work properly"); pr_info("WB won't work properly\n");
} }
} else { } else {
if (cpuinfo.ver_code >= CPUVER_7_20_A) { if (cpuinfo.ver_code >= CPUVER_7_20_A) {
INFO("wt_nomsr_noirq"); pr_info("wt_nomsr_noirq\n");
mbc = (struct scache *)&wt_nomsr_noirq; mbc = (struct scache *)&wt_nomsr_noirq;
} else { } else {
INFO("wt_nomsr"); pr_info("wt_nomsr\n");
mbc = (struct scache *)&wt_nomsr; mbc = (struct scache *)&wt_nomsr;
} }
} }
} }
/* FIXME Invalidation is done in U-BOOT /*
* FIXME Invalidation is done in U-BOOT
* WT cache: Data is already written to main memory * WT cache: Data is already written to main memory
* WB cache: Discard data on noMMU which caused that kernel doesn't boot * WB cache: Discard data on noMMU which caused that kernel doesn't boot
*/ */
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n"); early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n");
#else #else
#define err_printk(x) \ #define err_printk(x) \
printk(KERN_INFO "ERROR: Microblaze " x "-different for PVR and DTS\n"); pr_info("ERROR: Microblaze " x "-different for PVR and DTS\n");
#endif #endif
void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
...@@ -38,12 +38,11 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) ...@@ -38,12 +38,11 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
CI(ver_code, VERSION); CI(ver_code, VERSION);
if (!ci->ver_code) { if (!ci->ver_code) {
printk(KERN_ERR "ERROR: MB has broken PVR regs " pr_err("ERROR: MB has broken PVR regs -> use DTS setting\n");
"-> use DTS setting\n");
return; return;
} }
temp = PVR_USE_BARREL(pvr) | PVR_USE_MSR_INSTR(pvr) |\ temp = PVR_USE_BARREL(pvr) | PVR_USE_MSR_INSTR(pvr) |
PVR_USE_PCMP_INSTR(pvr) | PVR_USE_DIV(pvr); PVR_USE_PCMP_INSTR(pvr) | PVR_USE_DIV(pvr);
if (ci->use_instr != temp) if (ci->use_instr != temp)
err_printk("BARREL, MSR, PCMP or DIV"); err_printk("BARREL, MSR, PCMP or DIV");
...@@ -59,13 +58,13 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) ...@@ -59,13 +58,13 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
err_printk("HW_FPU"); err_printk("HW_FPU");
ci->use_fpu = temp; ci->use_fpu = temp;
ci->use_exc = PVR_OPCODE_0x0_ILLEGAL(pvr) |\ ci->use_exc = PVR_OPCODE_0x0_ILLEGAL(pvr) |
PVR_UNALIGNED_EXCEPTION(pvr) |\ PVR_UNALIGNED_EXCEPTION(pvr) |
PVR_ILL_OPCODE_EXCEPTION(pvr) |\ PVR_ILL_OPCODE_EXCEPTION(pvr) |
PVR_IOPB_BUS_EXCEPTION(pvr) |\ PVR_IOPB_BUS_EXCEPTION(pvr) |
PVR_DOPB_BUS_EXCEPTION(pvr) |\ PVR_DOPB_BUS_EXCEPTION(pvr) |
PVR_DIV_ZERO_EXCEPTION(pvr) |\ PVR_DIV_ZERO_EXCEPTION(pvr) |
PVR_FPU_EXCEPTION(pvr) |\ PVR_FPU_EXCEPTION(pvr) |
PVR_FSL_EXCEPTION(pvr); PVR_FSL_EXCEPTION(pvr);
CI(pvr_user1, USER1); CI(pvr_user1, USER1);
......
...@@ -68,31 +68,30 @@ void __init setup_cpuinfo(void) ...@@ -68,31 +68,30 @@ void __init setup_cpuinfo(void)
cpu = (struct device_node *) of_find_node_by_type(NULL, "cpu"); cpu = (struct device_node *) of_find_node_by_type(NULL, "cpu");
if (!cpu) if (!cpu)
printk(KERN_ERR "You don't have cpu!!!\n"); pr_err("You don't have cpu!!!\n");
printk(KERN_INFO "%s: initialising\n", __func__); pr_info("%s: initialising\n", __func__);
switch (cpu_has_pvr()) { switch (cpu_has_pvr()) {
case 0: case 0:
printk(KERN_WARNING pr_warn("%s: No PVR support. Using static CPU info from FDT\n",
"%s: No PVR support. Using static CPU info from FDT\n",
__func__); __func__);
set_cpuinfo_static(&cpuinfo, cpu); set_cpuinfo_static(&cpuinfo, cpu);
break; break;
/* FIXME I found weird behavior with MB 7.00.a/b 7.10.a /* FIXME I found weird behavior with MB 7.00.a/b 7.10.a
* please do not use FULL PVR with MMU */ * please do not use FULL PVR with MMU */
case 1: case 1:
printk(KERN_INFO "%s: Using full CPU PVR support\n", pr_info("%s: Using full CPU PVR support\n",
__func__); __func__);
set_cpuinfo_static(&cpuinfo, cpu); set_cpuinfo_static(&cpuinfo, cpu);
set_cpuinfo_pvr_full(&cpuinfo, cpu); set_cpuinfo_pvr_full(&cpuinfo, cpu);
break; break;
default: default:
printk(KERN_WARNING "%s: Unsupported PVR setting\n", __func__); pr_warn("%s: Unsupported PVR setting\n", __func__);
set_cpuinfo_static(&cpuinfo, cpu); set_cpuinfo_static(&cpuinfo, cpu);
} }
if (cpuinfo.mmu_privins) if (cpuinfo.mmu_privins)
printk(KERN_WARNING "%s: Stream instructions enabled" pr_warn("%s: Stream instructions enabled"
" - USERSPACE CAN LOCK THIS KERNEL!\n", __func__); " - USERSPACE CAN LOCK THIS KERNEL!\n", __func__);
} }
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/dma-debug.h> #include <linux/dma-debug.h>
#include <linux/export.h> #include <linux/export.h>
#include <asm/bug.h> #include <linux/bug.h>
/* /*
* Generic direct DMA implementation * Generic direct DMA implementation
......
...@@ -140,20 +140,20 @@ int __init setup_early_printk(char *opt) ...@@ -140,20 +140,20 @@ int __init setup_early_printk(char *opt)
switch (version) { switch (version) {
#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE #ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
case UARTLITE: case UARTLITE:
printk(KERN_INFO "Early console on uartlite " pr_info("Early console on uartlite at 0x%08x\n",
"at 0x%08x\n", base_addr); base_addr);
early_console = &early_serial_uartlite_console; early_console = &early_serial_uartlite_console;
break; break;
#endif #endif
#ifdef CONFIG_SERIAL_8250_CONSOLE #ifdef CONFIG_SERIAL_8250_CONSOLE
case UART16550: case UART16550:
printk(KERN_INFO "Early console on uart16650 " pr_info("Early console on uart16650 at 0x%08x\n",
"at 0x%08x\n", base_addr); base_addr);
early_console = &early_serial_uart16550_console; early_console = &early_serial_uart16550_console;
break; break;
#endif #endif
default: default:
printk(KERN_INFO "Unsupported early console %d\n", pr_info("Unsupported early console %d\n",
version); version);
return 1; return 1;
} }
...@@ -171,10 +171,9 @@ void __init remap_early_printk(void) ...@@ -171,10 +171,9 @@ void __init remap_early_printk(void)
{ {
if (!early_console_initialized || !early_console) if (!early_console_initialized || !early_console)
return; return;
printk(KERN_INFO "early_printk_console remapping from 0x%x to ", pr_info("early_printk_console remapping from 0x%x to ", base_addr);
base_addr);
base_addr = (u32) ioremap(base_addr, PAGE_SIZE); base_addr = (u32) ioremap(base_addr, PAGE_SIZE);
printk(KERN_CONT "0x%x\n", base_addr); pr_cont("0x%x\n", base_addr);
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
/* /*
...@@ -197,7 +196,7 @@ void __init disable_early_printk(void) ...@@ -197,7 +196,7 @@ void __init disable_early_printk(void)
{ {
if (!early_console_initialized || !early_console) if (!early_console_initialized || !early_console)
return; return;
printk(KERN_WARNING "disabling early console\n"); pr_warn("disabling early console\n");
unregister_console(early_console); unregister_console(early_console);
early_console_initialized = 0; early_console_initialized = 0;
} }
...@@ -40,7 +40,7 @@ void die(const char *str, struct pt_regs *fp, long err) ...@@ -40,7 +40,7 @@ void die(const char *str, struct pt_regs *fp, long err)
{ {
console_verbose(); console_verbose();
spin_lock_irq(&die_lock); spin_lock_irq(&die_lock);
printk(KERN_WARNING "Oops: %s, sig: %ld\n", str, err); pr_warn("Oops: %s, sig: %ld\n", str, err);
show_regs(fp); show_regs(fp);
spin_unlock_irq(&die_lock); spin_unlock_irq(&die_lock);
/* do_exit() should take care of panic'ing from an interrupt /* do_exit() should take care of panic'ing from an interrupt
...@@ -61,9 +61,9 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) ...@@ -61,9 +61,9 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
{ {
siginfo_t info; siginfo_t info;
if (kernel_mode(regs)) { if (kernel_mode(regs))
die("Exception in kernel mode", regs, signr); die("Exception in kernel mode", regs, signr);
}
info.si_signo = signr; info.si_signo = signr;
info.si_errno = 0; info.si_errno = 0;
info.si_code = code; info.si_code = code;
...@@ -79,8 +79,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, ...@@ -79,8 +79,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
#endif #endif
#if 0 #if 0
printk(KERN_WARNING "Exception %02x in %s mode, FSR=%08x PC=%08x " \ pr_warn("Exception %02x in %s mode, FSR=%08x PC=%08x ESR=%08x\n",
"ESR=%08x\n",
type, user_mode(regs) ? "user" : "kernel", fsr, type, user_mode(regs) ? "user" : "kernel", fsr,
(unsigned int) regs->pc, (unsigned int) regs->esr); (unsigned int) regs->pc, (unsigned int) regs->esr);
#endif #endif
...@@ -92,8 +91,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, ...@@ -92,8 +91,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
_exception(SIGILL, regs, ILL_ILLOPC, addr); _exception(SIGILL, regs, ILL_ILLOPC, addr);
return; return;
} }
printk(KERN_WARNING "Illegal opcode exception " \ pr_warn("Illegal opcode exception in kernel mode.\n");
"in kernel mode.\n");
die("opcode exception", regs, SIGBUS); die("opcode exception", regs, SIGBUS);
break; break;
case MICROBLAZE_IBUS_EXCEPTION: case MICROBLAZE_IBUS_EXCEPTION:
...@@ -102,8 +100,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, ...@@ -102,8 +100,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
_exception(SIGBUS, regs, BUS_ADRERR, addr); _exception(SIGBUS, regs, BUS_ADRERR, addr);
return; return;
} }
printk(KERN_WARNING "Instruction bus error exception " \ pr_warn("Instruction bus error exception in kernel mode.\n");
"in kernel mode.\n");
die("bus exception", regs, SIGBUS); die("bus exception", regs, SIGBUS);
break; break;
case MICROBLAZE_DBUS_EXCEPTION: case MICROBLAZE_DBUS_EXCEPTION:
...@@ -112,8 +109,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, ...@@ -112,8 +109,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
_exception(SIGBUS, regs, BUS_ADRERR, addr); _exception(SIGBUS, regs, BUS_ADRERR, addr);
return; return;
} }
printk(KERN_WARNING "Data bus error exception " \ pr_warn("Data bus error exception in kernel mode.\n");
"in kernel mode.\n");
die("bus exception", regs, SIGBUS); die("bus exception", regs, SIGBUS);
break; break;
case MICROBLAZE_DIV_ZERO_EXCEPTION: case MICROBLAZE_DIV_ZERO_EXCEPTION:
...@@ -122,8 +118,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, ...@@ -122,8 +118,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
_exception(SIGFPE, regs, FPE_INTDIV, addr); _exception(SIGFPE, regs, FPE_INTDIV, addr);
return; return;
} }
printk(KERN_WARNING "Divide by zero exception " \ pr_warn("Divide by zero exception in kernel mode.\n");
"in kernel mode.\n");
die("Divide by zero exception", regs, SIGBUS); die("Divide by zero exception", regs, SIGBUS);
break; break;
case MICROBLAZE_FPU_EXCEPTION: case MICROBLAZE_FPU_EXCEPTION:
...@@ -151,8 +146,8 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, ...@@ -151,8 +146,8 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
#endif #endif
default: default:
/* FIXME what to do in unexpected exception */ /* FIXME what to do in unexpected exception */
printk(KERN_WARNING "Unexpected exception %02x " pr_warn("Unexpected exception %02x PC=%08x in %s mode\n",
"PC=%08x in %s mode\n", type, (unsigned int) addr, type, (unsigned int) addr,
kernel_mode(regs) ? "kernel" : "user"); kernel_mode(regs) ? "kernel" : "user");
} }
return; return;
......
...@@ -35,18 +35,18 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) ...@@ -35,18 +35,18 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
* happen. This tool is too much intrusive to * happen. This tool is too much intrusive to
* ignore such a protection. * ignore such a protection.
*/ */
asm volatile(" 1: lwi %0, %2, 0; \ asm volatile(" 1: lwi %0, %2, 0;" \
2: swi %3, %2, 0; \ "2: swi %3, %2, 0;" \
addik %1, r0, 0; \ " addik %1, r0, 0;" \
3: \ "3:" \
.section .fixup, \"ax\"; \ " .section .fixup, \"ax\";" \
4: brid 3b; \ "4: brid 3b;" \
addik %1, r0, 1; \ " addik %1, r0, 1;" \
.previous; \ " .previous;" \
.section __ex_table,\"a\"; \ " .section __ex_table,\"a\";" \
.word 1b,4b; \ " .word 1b,4b;" \
.word 2b,4b; \ " .word 2b,4b;" \
.previous;" \ " .previous;" \
: "=&r" (old), "=r" (faulted) : "=&r" (old), "=r" (faulted)
: "r" (parent), "r" (return_hooker) : "r" (parent), "r" (return_hooker)
); );
...@@ -81,16 +81,16 @@ static int ftrace_modify_code(unsigned long addr, unsigned int value) ...@@ -81,16 +81,16 @@ static int ftrace_modify_code(unsigned long addr, unsigned int value)
{ {
int faulted = 0; int faulted = 0;
__asm__ __volatile__(" 1: swi %2, %1, 0; \ __asm__ __volatile__(" 1: swi %2, %1, 0;" \
addik %0, r0, 0; \ " addik %0, r0, 0;" \
2: \ "2:" \
.section .fixup, \"ax\"; \ " .section .fixup, \"ax\";" \
3: brid 2b; \ "3: brid 2b;" \
addik %0, r0, 1; \ " addik %0, r0, 1;" \
.previous; \ " .previous;" \
.section __ex_table,\"a\"; \ " .section __ex_table,\"a\";" \
.word 1b,3b; \ " .word 1b,3b;" \
.previous;" \ " .previous;" \
: "=r" (faulted) : "=r" (faulted)
: "r" (addr), "r" (value) : "r" (addr), "r" (value)
); );
......
...@@ -61,7 +61,7 @@ void setup_heartbeat(void) ...@@ -61,7 +61,7 @@ void setup_heartbeat(void)
if (gpio) { if (gpio) {
base_addr = be32_to_cpup(of_get_property(gpio, "reg", NULL)); base_addr = be32_to_cpup(of_get_property(gpio, "reg", NULL));
base_addr = (unsigned long) ioremap(base_addr, PAGE_SIZE); base_addr = (unsigned long) ioremap(base_addr, PAGE_SIZE);
printk(KERN_NOTICE "Heartbeat GPIO at 0x%x\n", base_addr); pr_notice("Heartbeat GPIO at 0x%x\n", base_addr);
/* GPIO is configured as output */ /* GPIO is configured as output */
prop = (int *) of_get_property(gpio, "xlnx,is-bidir", NULL); prop = (int *) of_get_property(gpio, "xlnx,is-bidir", NULL);
......
...@@ -147,12 +147,12 @@ void __init init_IRQ(void) ...@@ -147,12 +147,12 @@ void __init init_IRQ(void)
intr_mask = intr_mask =
be32_to_cpup(of_get_property(intc, "xlnx,kind-of-intr", NULL)); be32_to_cpup(of_get_property(intc, "xlnx,kind-of-intr", NULL));
if (intr_mask > (u32)((1ULL << nr_irq) - 1)) if (intr_mask > (u32)((1ULL << nr_irq) - 1))
printk(KERN_INFO " ERROR: Mismatch in kind-of-intr param\n"); pr_info(" ERROR: Mismatch in kind-of-intr param\n");
#ifdef CONFIG_SELFMOD_INTC #ifdef CONFIG_SELFMOD_INTC
selfmod_function((int *) arr_func, intc_baseaddr); selfmod_function((int *) arr_func, intc_baseaddr);
#endif #endif
printk(KERN_INFO "%s #0 at 0x%08x, num_irq=%d, edge=0x%x\n", pr_info("%s #0 at 0x%08x, num_irq=%d, edge=0x%x\n",
intc->name, intc_baseaddr, nr_irq, intr_mask); intc->name, intc_baseaddr, nr_irq, intr_mask);
/* /*
......
...@@ -141,7 +141,7 @@ void kgdb_arch_exit(void) ...@@ -141,7 +141,7 @@ void kgdb_arch_exit(void)
/* /*
* Global data * Global data
*/ */
struct kgdb_arch arch_kgdb_ops = { const struct kgdb_arch arch_kgdb_ops = {
#ifdef __MICROBLAZEEL__ #ifdef __MICROBLAZEEL__
.gdb_bpt_instr = {0x18, 0x00, 0x0c, 0xba}, /* brki r16, 0x18 */ .gdb_bpt_instr = {0x18, 0x00, 0x0c, 0xba}, /* brki r16, 0x18 */
#else #else
......
...@@ -108,8 +108,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, ...@@ -108,8 +108,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
break; break;
default: default:
printk(KERN_ERR "module %s: " pr_err("module %s: Unknown relocation: %u\n",
"Unknown relocation: %u\n",
module->name, module->name,
ELF32_R_TYPE(rela[i].r_info)); ELF32_R_TYPE(rela[i].r_info));
return -ENOEXEC; return -ENOEXEC;
......
...@@ -15,29 +15,29 @@ ...@@ -15,29 +15,29 @@
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/uaccess.h> /* for USER_DS macros */ #include <linux/uaccess.h> /* for USER_DS macros */
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
void show_regs(struct pt_regs *regs) void show_regs(struct pt_regs *regs)
{ {
printk(KERN_INFO " Registers dump: mode=%X\r\n", regs->pt_mode); pr_info(" Registers dump: mode=%X\r\n", regs->pt_mode);
printk(KERN_INFO " r1=%08lX, r2=%08lX, r3=%08lX, r4=%08lX\n", pr_info(" r1=%08lX, r2=%08lX, r3=%08lX, r4=%08lX\n",
regs->r1, regs->r2, regs->r3, regs->r4); regs->r1, regs->r2, regs->r3, regs->r4);
printk(KERN_INFO " r5=%08lX, r6=%08lX, r7=%08lX, r8=%08lX\n", pr_info(" r5=%08lX, r6=%08lX, r7=%08lX, r8=%08lX\n",
regs->r5, regs->r6, regs->r7, regs->r8); regs->r5, regs->r6, regs->r7, regs->r8);
printk(KERN_INFO " r9=%08lX, r10=%08lX, r11=%08lX, r12=%08lX\n", pr_info(" r9=%08lX, r10=%08lX, r11=%08lX, r12=%08lX\n",
regs->r9, regs->r10, regs->r11, regs->r12); regs->r9, regs->r10, regs->r11, regs->r12);
printk(KERN_INFO " r13=%08lX, r14=%08lX, r15=%08lX, r16=%08lX\n", pr_info(" r13=%08lX, r14=%08lX, r15=%08lX, r16=%08lX\n",
regs->r13, regs->r14, regs->r15, regs->r16); regs->r13, regs->r14, regs->r15, regs->r16);
printk(KERN_INFO " r17=%08lX, r18=%08lX, r19=%08lX, r20=%08lX\n", pr_info(" r17=%08lX, r18=%08lX, r19=%08lX, r20=%08lX\n",
regs->r17, regs->r18, regs->r19, regs->r20); regs->r17, regs->r18, regs->r19, regs->r20);
printk(KERN_INFO " r21=%08lX, r22=%08lX, r23=%08lX, r24=%08lX\n", pr_info(" r21=%08lX, r22=%08lX, r23=%08lX, r24=%08lX\n",
regs->r21, regs->r22, regs->r23, regs->r24); regs->r21, regs->r22, regs->r23, regs->r24);
printk(KERN_INFO " r25=%08lX, r26=%08lX, r27=%08lX, r28=%08lX\n", pr_info(" r25=%08lX, r26=%08lX, r27=%08lX, r28=%08lX\n",
regs->r25, regs->r26, regs->r27, regs->r28); regs->r25, regs->r26, regs->r27, regs->r28);
printk(KERN_INFO " r29=%08lX, r30=%08lX, r31=%08lX, rPC=%08lX\n", pr_info(" r29=%08lX, r30=%08lX, r31=%08lX, rPC=%08lX\n",
regs->r29, regs->r30, regs->r31, regs->pc); regs->r29, regs->r30, regs->r31, regs->pc);
printk(KERN_INFO " msr=%08lX, ear=%08lX, esr=%08lX, fsr=%08lX\n", pr_info(" msr=%08lX, ear=%08lX, esr=%08lX, fsr=%08lX\n",
regs->msr, regs->ear, regs->esr, regs->fsr); regs->msr, regs->ear, regs->esr, regs->fsr);
} }
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/syscall.h> #include <asm/syscall.h>
#include <asm/io.h> #include <linux/io.h>
/* Returns the address where the register at REG_OFFS in P is stashed away. */ /* Returns the address where the register at REG_OFFS in P is stashed away. */
static microblaze_reg_t *reg_save_addr(unsigned reg_offs, static microblaze_reg_t *reg_save_addr(unsigned reg_offs,
......
...@@ -150,33 +150,35 @@ void __init machine_early_init(const char *cmdline, unsigned int ram, ...@@ -150,33 +150,35 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
/* printk("TLB1 0x%08x, TLB0 0x%08x, tlb 0x%x\n", tlb0, /* printk("TLB1 0x%08x, TLB0 0x%08x, tlb 0x%x\n", tlb0,
tlb1, kernel_tlb); */ tlb1, kernel_tlb); */
printk("Ramdisk addr 0x%08x, ", ram); pr_info("Ramdisk addr 0x%08x, ", ram);
if (fdt) if (fdt)
printk("FDT at 0x%08x\n", fdt); pr_info("FDT at 0x%08x\n", fdt);
else else
printk("Compiled-in FDT at 0x%08x\n", pr_info("Compiled-in FDT at 0x%08x\n",
(unsigned int)_fdt_start); (unsigned int)_fdt_start);
#ifdef CONFIG_MTD_UCLINUX #ifdef CONFIG_MTD_UCLINUX
printk("Found romfs @ 0x%08x (0x%08x)\n", pr_info("Found romfs @ 0x%08x (0x%08x)\n",
romfs_base, romfs_size); romfs_base, romfs_size);
printk("#### klimit %p ####\n", old_klimit); pr_info("#### klimit %p ####\n", old_klimit);
BUG_ON(romfs_size < 0); /* What else can we do? */ BUG_ON(romfs_size < 0); /* What else can we do? */
printk("Moved 0x%08x bytes from 0x%08x to 0x%08x\n", pr_info("Moved 0x%08x bytes from 0x%08x to 0x%08x\n",
romfs_size, romfs_base, (unsigned)&__bss_stop); romfs_size, romfs_base, (unsigned)&__bss_stop);
printk("New klimit: 0x%08x\n", (unsigned)klimit); pr_info("New klimit: 0x%08x\n", (unsigned)klimit);
#endif #endif
#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR #if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
if (msr) if (msr) {
printk("!!!Your kernel has setup MSR instruction but " pr_info("!!!Your kernel has setup MSR instruction but ");
"CPU don't have it %x\n", msr); pr_cont("CPU don't have it %x\n", msr);
}
#else #else
if (!msr) if (!msr) {
printk("!!!Your kernel not setup MSR instruction but " pr_info("!!!Your kernel not setup MSR instruction but ");
"CPU have it %x\n", msr); pr_cont"CPU have it %x\n", msr);
}
#endif #endif
/* Do not copy reset vectors. offset = 0x2 means skip the first /* Do not copy reset vectors. offset = 0x2 means skip the first
......
...@@ -255,7 +255,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -255,7 +255,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
set_fs(USER_DS); set_fs(USER_DS);
#ifdef DEBUG_SIG #ifdef DEBUG_SIG
printk(KERN_INFO "SIG deliver (%s:%d): sp=%p pc=%08lx\n", pr_info("SIG deliver (%s:%d): sp=%p pc=%08lx\n",
current->comm, current->pid, frame, regs->pc); current->comm, current->pid, frame, regs->pc);
#endif #endif
...@@ -330,8 +330,8 @@ static void do_signal(struct pt_regs *regs, int in_syscall) ...@@ -330,8 +330,8 @@ static void do_signal(struct pt_regs *regs, int in_syscall)
int signr; int signr;
struct k_sigaction ka; struct k_sigaction ka;
#ifdef DEBUG_SIG #ifdef DEBUG_SIG
printk(KERN_INFO "do signal: %p %d\n", regs, in_syscall); pr_info("do signal: %p %d\n", regs, in_syscall);
printk(KERN_INFO "do signal2: %lx %lx %ld [%lx]\n", regs->pc, regs->r1, pr_info("do signal2: %lx %lx %ld [%lx]\n", regs->pc, regs->r1,
regs->r12, current_thread_info()->flags); regs->r12, current_thread_info()->flags);
#endif #endif
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/unistd.h> #include <linux/unistd.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/syscalls.h> #include <asm/syscalls.h>
asmlinkage long sys_mmap(unsigned long addr, unsigned long len, asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
......
...@@ -26,7 +26,7 @@ static unsigned long kstack_depth_to_print; /* 0 == entire stack */ ...@@ -26,7 +26,7 @@ static unsigned long kstack_depth_to_print; /* 0 == entire stack */
static int __init kstack_setup(char *s) static int __init kstack_setup(char *s)
{ {
return !strict_strtoul(s, 0, &kstack_depth_to_print); return !kstrtoul(s, 0, &kstack_depth_to_print);
} }
__setup("kstack=", kstack_setup); __setup("kstack=", kstack_setup);
...@@ -66,9 +66,7 @@ void show_stack(struct task_struct *task, unsigned long *sp) ...@@ -66,9 +66,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
} }
print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, 32, 4, (void *)fp, print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, 32, 4, (void *)fp,
words_to_show << 2, 0); words_to_show << 2, 0);
printk(KERN_INFO "\n\n"); pr_info("\n\nCall Trace:\n");
pr_info("Call Trace:\n");
microblaze_unwind(task, NULL); microblaze_unwind(task, NULL);
pr_info("\n"); pr_info("\n");
......
...@@ -25,5 +25,4 @@ long long __ashldi3(long long u, word_type b) ...@@ -25,5 +25,4 @@ long long __ashldi3(long long u, word_type b)
return w.ll; return w.ll;
} }
EXPORT_SYMBOL(__ashldi3); EXPORT_SYMBOL(__ashldi3);
...@@ -27,5 +27,4 @@ long long __ashrdi3(long long u, word_type b) ...@@ -27,5 +27,4 @@ long long __ashrdi3(long long u, word_type b)
return w.ll; return w.ll;
} }
EXPORT_SYMBOL(__ashrdi3); EXPORT_SYMBOL(__ashrdi3);
...@@ -25,5 +25,4 @@ long long __lshrdi3(long long u, word_type b) ...@@ -25,5 +25,4 @@ long long __lshrdi3(long long u, word_type b)
return w.ll; return w.ll;
} }
EXPORT_SYMBOL(__lshrdi3); EXPORT_SYMBOL(__lshrdi3);
...@@ -103,12 +103,12 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c) ...@@ -103,12 +103,12 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
} }
#else #else
/* Load the holding buffer */ /* Load the holding buffer */
buf_hold = (*i_src++ & 0xFFFFFF00) >>8; buf_hold = (*i_src++ & 0xFFFFFF00) >> 8;
for (; c >= 4; c -= 4) { for (; c >= 4; c -= 4) {
value = *i_src++; value = *i_src++;
*i_dst++ = buf_hold | ((value & 0xFF) << 24); *i_dst++ = buf_hold | ((value & 0xFF) << 24);
buf_hold = (value & 0xFFFFFF00) >>8; buf_hold = (value & 0xFFFFFF00) >> 8;
} }
#endif #endif
/* Realign the source */ /* Realign the source */
...@@ -129,12 +129,12 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c) ...@@ -129,12 +129,12 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
} }
#else #else
/* Load the holding buffer */ /* Load the holding buffer */
buf_hold = (*i_src++ & 0xFFFF0000 )>>16; buf_hold = (*i_src++ & 0xFFFF0000) >> 16;
for (; c >= 4; c -= 4) { for (; c >= 4; c -= 4) {
value = *i_src++; value = *i_src++;
*i_dst++ = buf_hold | ((value & 0xFFFF)<<16); *i_dst++ = buf_hold | ((value & 0xFFFF) << 16);
buf_hold = (value & 0xFFFF0000) >>16; buf_hold = (value & 0xFFFF0000) >> 16;
} }
#endif #endif
/* Realign the source */ /* Realign the source */
......
...@@ -129,7 +129,8 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) ...@@ -129,7 +129,8 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c)
for (; c >= 4; c -= 4) { for (; c >= 4; c -= 4) {
value = *--i_src; value = *--i_src;
*--i_dst = buf_hold | ((value & 0xFFFFFF00)>>8); *--i_dst = buf_hold |
((value & 0xFFFFFF00) >> 8);
buf_hold = (value & 0xFF) << 24; buf_hold = (value & 0xFF) << 24;
} }
#endif #endif
...@@ -155,7 +156,8 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) ...@@ -155,7 +156,8 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c)
for (; c >= 4; c -= 4) { for (; c >= 4; c -= 4) {
value = *--i_src; value = *--i_src;
*--i_dst = buf_hold | ((value & 0xFFFF0000)>>16); *--i_dst = buf_hold |
((value & 0xFFFF0000) >> 16);
buf_hold = (value & 0xFFFF) << 16; buf_hold = (value & 0xFFFF) << 16;
} }
#endif #endif
...@@ -181,7 +183,8 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) ...@@ -181,7 +183,8 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c)
for (; c >= 4; c -= 4) { for (; c >= 4; c -= 4) {
value = *--i_src; value = *--i_src;
*--i_dst = buf_hold | ((value & 0xFF000000)>> 24); *--i_dst = buf_hold |
((value & 0xFF000000) >> 24);
buf_hold = (value & 0xFFFFFF) << 8; buf_hold = (value & 0xFFFFFF) << 8;
} }
#endif #endif
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/hardirq.h> #include <linux/hardirq.h>
#include <asm/mmu_context.h> #include <linux/mmu_context.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -102,8 +102,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle) ...@@ -102,8 +102,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
# endif # endif
if ((unsigned int)ret > cpuinfo.dcache_base && if ((unsigned int)ret > cpuinfo.dcache_base &&
(unsigned int)ret < cpuinfo.dcache_high) (unsigned int)ret < cpuinfo.dcache_high)
printk(KERN_WARNING pr_warn("ERROR: Your cache coherent area is CACHED!!!\n");
"ERROR: Your cache coherent area is CACHED!!!\n");
/* dma_handle is same as physical (shadowed) address */ /* dma_handle is same as physical (shadowed) address */
*dma_handle = (dma_addr_t)ret; *dma_handle = (dma_addr_t)ret;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/mmu_context.h> #include <linux/mmu_context.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <asm/exceptions.h> #include <asm/exceptions.h>
...@@ -100,7 +100,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -100,7 +100,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
/* On a kernel SLB miss we can only check for a valid exception entry */ /* On a kernel SLB miss we can only check for a valid exception entry */
if (unlikely(kernel_mode(regs) && (address >= TASK_SIZE))) { if (unlikely(kernel_mode(regs) && (address >= TASK_SIZE))) {
printk(KERN_WARNING "kernel task_size exceed"); pr_warn("kernel task_size exceed");
_exception(SIGSEGV, regs, code, address); _exception(SIGSEGV, regs, code, address);
} }
...@@ -114,9 +114,9 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -114,9 +114,9 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
/* in_atomic() in user mode is really bad, /* in_atomic() in user mode is really bad,
as is current->mm == NULL. */ as is current->mm == NULL. */
printk(KERN_EMERG "Page fault in user mode with " pr_emerg("Page fault in user mode with in_atomic(), mm = %p\n",
"in_atomic(), mm = %p\n", mm); mm);
printk(KERN_EMERG "r15 = %lx MSR = %lx\n", pr_emerg("r15 = %lx MSR = %lx\n",
regs->r15, regs->msr); regs->r15, regs->msr);
die("Weird page fault", regs, SIGSEGV); die("Weird page fault", regs, SIGSEGV);
} }
......
...@@ -89,7 +89,7 @@ static unsigned long highmem_setup(void) ...@@ -89,7 +89,7 @@ static unsigned long highmem_setup(void)
reservedpages++; reservedpages++;
} }
totalram_pages += totalhigh_pages; totalram_pages += totalhigh_pages;
printk(KERN_INFO "High memory: %luk\n", pr_info("High memory: %luk\n",
totalhigh_pages << (PAGE_SHIFT-10)); totalhigh_pages << (PAGE_SHIFT-10));
return reservedpages; return reservedpages;
...@@ -142,8 +142,8 @@ void __init setup_memory(void) ...@@ -142,8 +142,8 @@ void __init setup_memory(void)
((u32)_text <= (memory_start + lowmem_size - 1))) { ((u32)_text <= (memory_start + lowmem_size - 1))) {
memory_size = lowmem_size; memory_size = lowmem_size;
PAGE_OFFSET = memory_start; PAGE_OFFSET = memory_start;
printk(KERN_INFO "%s: Main mem: 0x%x, " pr_info("%s: Main mem: 0x%x, size 0x%08x\n",
"size 0x%08x\n", __func__, (u32) memory_start, __func__, (u32) memory_start,
(u32) memory_size); (u32) memory_size);
break; break;
} }
...@@ -158,7 +158,7 @@ void __init setup_memory(void) ...@@ -158,7 +158,7 @@ void __init setup_memory(void)
kernel_align_start = PAGE_DOWN((u32)_text); kernel_align_start = PAGE_DOWN((u32)_text);
/* ALIGN can be remove because _end in vmlinux.lds.S is align */ /* ALIGN can be remove because _end in vmlinux.lds.S is align */
kernel_align_size = PAGE_UP((u32)klimit) - kernel_align_start; kernel_align_size = PAGE_UP((u32)klimit) - kernel_align_start;
printk(KERN_INFO "%s: kernel addr:0x%08x-0x%08x size=0x%08x\n", pr_info("%s: kernel addr:0x%08x-0x%08x size=0x%08x\n",
__func__, kernel_align_start, kernel_align_start __func__, kernel_align_start, kernel_align_start
+ kernel_align_size, kernel_align_size); + kernel_align_size, kernel_align_size);
memblock_reserve(kernel_align_start, kernel_align_size); memblock_reserve(kernel_align_start, kernel_align_size);
...@@ -181,10 +181,10 @@ void __init setup_memory(void) ...@@ -181,10 +181,10 @@ void __init setup_memory(void)
max_low_pfn = ((u64)memory_start + (u64)lowmem_size) >> PAGE_SHIFT; max_low_pfn = ((u64)memory_start + (u64)lowmem_size) >> PAGE_SHIFT;
max_pfn = ((u64)memory_start + (u64)memory_size) >> PAGE_SHIFT; max_pfn = ((u64)memory_start + (u64)memory_size) >> PAGE_SHIFT;
printk(KERN_INFO "%s: max_mapnr: %#lx\n", __func__, max_mapnr); pr_info("%s: max_mapnr: %#lx\n", __func__, max_mapnr);
printk(KERN_INFO "%s: min_low_pfn: %#lx\n", __func__, min_low_pfn); pr_info("%s: min_low_pfn: %#lx\n", __func__, min_low_pfn);
printk(KERN_INFO "%s: max_low_pfn: %#lx\n", __func__, max_low_pfn); pr_info("%s: max_low_pfn: %#lx\n", __func__, max_low_pfn);
printk(KERN_INFO "%s: max_pfn: %#lx\n", __func__, max_pfn); pr_info("%s: max_pfn: %#lx\n", __func__, max_pfn);
/* /*
* Find an area to use for the bootmem bitmap. * Find an area to use for the bootmem bitmap.
...@@ -246,7 +246,7 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end) ...@@ -246,7 +246,7 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
free_page(addr); free_page(addr);
totalram_pages++; totalram_pages++;
} }
printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10); pr_info("Freeing %s: %ldk freed\n", what, (end - begin) >> 10);
} }
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
...@@ -260,7 +260,7 @@ void free_initrd_mem(unsigned long start, unsigned long end) ...@@ -260,7 +260,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
totalram_pages++; totalram_pages++;
pages++; pages++;
} }
printk(KERN_NOTICE "Freeing initrd memory: %dk freed\n", pr_notice("Freeing initrd memory: %dk freed\n",
(int)(pages * (PAGE_SIZE / 1024))); (int)(pages * (PAGE_SIZE / 1024)));
} }
#endif #endif
...@@ -304,11 +304,11 @@ void __init mem_init(void) ...@@ -304,11 +304,11 @@ void __init mem_init(void)
initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin; initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin;
bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start; bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start;
pr_info("Memory: %luk/%luk available (%luk kernel code, " pr_info("Memory: %luk/%luk available (%luk kernel code, ",
"%luk reserved, %luk data, %luk bss, %luk init)\n",
nr_free_pages() << (PAGE_SHIFT-10), nr_free_pages() << (PAGE_SHIFT-10),
num_physpages << (PAGE_SHIFT-10), num_physpages << (PAGE_SHIFT-10),
codesize >> 10, codesize >> 10);
pr_cont("%luk reserved, %luk data, %luk bss, %luk init)\n",
reservedpages << (PAGE_SHIFT-10), reservedpages << (PAGE_SHIFT-10),
datasize >> 10, datasize >> 10,
bsssize >> 10, bsssize >> 10,
...@@ -394,17 +394,17 @@ asmlinkage void __init mmu_init(void) ...@@ -394,17 +394,17 @@ asmlinkage void __init mmu_init(void)
unsigned int kstart, ksize; unsigned int kstart, ksize;
if (!memblock.reserved.cnt) { if (!memblock.reserved.cnt) {
printk(KERN_EMERG "Error memory count\n"); pr_emerg("Error memory count\n");
machine_restart(NULL); machine_restart(NULL);
} }
if ((u32) memblock.memory.regions[0].size < 0x400000) { if ((u32) memblock.memory.regions[0].size < 0x400000) {
printk(KERN_EMERG "Memory must be greater than 4MB\n"); pr_emerg("Memory must be greater than 4MB\n");
machine_restart(NULL); machine_restart(NULL);
} }
if ((u32) memblock.memory.regions[0].size < kernel_tlb) { if ((u32) memblock.memory.regions[0].size < kernel_tlb) {
printk(KERN_EMERG "Kernel size is greater than memory node\n"); pr_emerg("Kernel size is greater than memory node\n");
machine_restart(NULL); machine_restart(NULL);
} }
......
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/fixmap.h> #include <asm/fixmap.h>
#define flush_HPTE(X, va, pg) _tlbie(va)
unsigned long ioremap_base; unsigned long ioremap_base;
unsigned long ioremap_bot; unsigned long ioremap_bot;
EXPORT_SYMBOL(ioremap_bot); EXPORT_SYMBOL(ioremap_bot);
...@@ -75,9 +73,8 @@ static void __iomem *__ioremap(phys_addr_t addr, unsigned long size, ...@@ -75,9 +73,8 @@ static void __iomem *__ioremap(phys_addr_t addr, unsigned long size,
p >= memory_start && p < virt_to_phys(high_memory) && p >= memory_start && p < virt_to_phys(high_memory) &&
!(p >= virt_to_phys((unsigned long)&__bss_stop) && !(p >= virt_to_phys((unsigned long)&__bss_stop) &&
p < virt_to_phys((unsigned long)__bss_stop))) { p < virt_to_phys((unsigned long)__bss_stop))) {
printk(KERN_WARNING "__ioremap(): phys addr "PTE_FMT pr_warn("__ioremap(): phys addr "PTE_FMT" is RAM lr %pf\n",
" is RAM lr %pf\n", (unsigned long)p, (unsigned long)p, __builtin_return_address(0));
__builtin_return_address(0));
return NULL; return NULL;
} }
...@@ -128,9 +125,10 @@ void __iomem *ioremap(phys_addr_t addr, unsigned long size) ...@@ -128,9 +125,10 @@ void __iomem *ioremap(phys_addr_t addr, unsigned long size)
} }
EXPORT_SYMBOL(ioremap); EXPORT_SYMBOL(ioremap);
void iounmap(void *addr) void iounmap(void __iomem *addr)
{ {
if (addr > high_memory && (unsigned long) addr < ioremap_bot) if ((__force void *)addr > high_memory &&
(unsigned long) addr < ioremap_bot)
vfree((void *) (PAGE_MASK & (unsigned long) addr)); vfree((void *) (PAGE_MASK & (unsigned long) addr));
} }
EXPORT_SYMBOL(iounmap); EXPORT_SYMBOL(iounmap);
...@@ -152,8 +150,7 @@ int map_page(unsigned long va, phys_addr_t pa, int flags) ...@@ -152,8 +150,7 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)
set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT,
__pgprot(flags))); __pgprot(flags)));
if (unlikely(mem_init_done)) if (unlikely(mem_init_done))
flush_HPTE(0, va, pmd_val(*pd)); _tlbie(va);
/* flush_HPTE(0, va, pg); */
} }
return err; return err;
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/io.h> #include <linux/io.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/export.h> #include <linux/export.h>
#include <asm/io.h> #include <linux/io.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
void pci_iounmap(struct pci_dev *dev, void __iomem *addr) void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <linux/export.h> #include <linux/export.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/io.h> #include <linux/io.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
...@@ -552,11 +552,10 @@ int pci_mmap_legacy_page_range(struct pci_bus *bus, ...@@ -552,11 +552,10 @@ int pci_mmap_legacy_page_range(struct pci_bus *bus,
*/ */
if ((offset + size) > hose->isa_mem_size) { if ((offset + size) > hose->isa_mem_size) {
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
printk(KERN_DEBUG pr_debug("Process %s (pid:%d) mapped non-existing PCI",
"Process %s (pid:%d) mapped non-existing PCI" current->comm, current->pid);
"legacy memory for 0%04x:%02x\n", pr_debug("legacy memory for 0%04x:%02x\n",
current->comm, current->pid, pci_domain_nr(bus), pci_domain_nr(bus), bus->number);
bus->number);
#endif #endif
if (vma->vm_flags & VM_SHARED) if (vma->vm_flags & VM_SHARED)
return shmem_zero_setup(vma); return shmem_zero_setup(vma);
...@@ -564,7 +563,7 @@ int pci_mmap_legacy_page_range(struct pci_bus *bus, ...@@ -564,7 +563,7 @@ int pci_mmap_legacy_page_range(struct pci_bus *bus,
} }
offset += hose->isa_mem_phys; offset += hose->isa_mem_phys;
} else { } else {
unsigned long io_offset = (unsigned long)hose->io_base_virt - \ unsigned long io_offset = (unsigned long)hose->io_base_virt -
_IO_BASE; _IO_BASE;
unsigned long roffset = offset + io_offset; unsigned long roffset = offset + io_offset;
rp = &hose->io_resource; rp = &hose->io_resource;
...@@ -668,7 +667,7 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose, ...@@ -668,7 +667,7 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
unsigned long long isa_mb = 0; unsigned long long isa_mb = 0;
struct resource *res; struct resource *res;
printk(KERN_INFO "PCI host bridge %s %s ranges:\n", pr_info("PCI host bridge %s %s ranges:\n",
dev->full_name, primary ? "(primary)" : ""); dev->full_name, primary ? "(primary)" : "");
/* Get ranges property */ /* Get ranges property */
...@@ -685,9 +684,10 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose, ...@@ -685,9 +684,10 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
cpu_addr = of_translate_address(dev, ranges + 3); cpu_addr = of_translate_address(dev, ranges + 3);
size = of_read_number(ranges + pna + 3, 2); size = of_read_number(ranges + pna + 3, 2);
pr_debug("pci_space: 0x%08x pci_addr:0x%016llx " pr_debug("pci_space: 0x%08x pci_addr:0x%016llx ",
"cpu_addr:0x%016llx size:0x%016llx\n", pci_space, pci_addr);
pci_space, pci_addr, cpu_addr, size); pr_debug("cpu_addr:0x%016llx size:0x%016llx\n",
cpu_addr, size);
ranges += np; ranges += np;
...@@ -716,14 +716,12 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose, ...@@ -716,14 +716,12 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
res = NULL; res = NULL;
switch ((pci_space >> 24) & 0x3) { switch ((pci_space >> 24) & 0x3) {
case 1: /* PCI IO space */ case 1: /* PCI IO space */
printk(KERN_INFO pr_info(" IO 0x%016llx..0x%016llx -> 0x%016llx\n",
" IO 0x%016llx..0x%016llx -> 0x%016llx\n",
cpu_addr, cpu_addr + size - 1, pci_addr); cpu_addr, cpu_addr + size - 1, pci_addr);
/* We support only one IO range */ /* We support only one IO range */
if (hose->pci_io_size) { if (hose->pci_io_size) {
printk(KERN_INFO pr_info(" \\--> Skipped (too many) !\n");
" \\--> Skipped (too many) !\n");
continue; continue;
} }
/* On 32 bits, limit I/O space to 16MB */ /* On 32 bits, limit I/O space to 16MB */
...@@ -750,15 +748,13 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose, ...@@ -750,15 +748,13 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
break; break;
case 2: /* PCI Memory space */ case 2: /* PCI Memory space */
case 3: /* PCI 64 bits Memory space */ case 3: /* PCI 64 bits Memory space */
printk(KERN_INFO pr_info(" MEM 0x%016llx..0x%016llx -> 0x%016llx %s\n",
" MEM 0x%016llx..0x%016llx -> 0x%016llx %s\n",
cpu_addr, cpu_addr + size - 1, pci_addr, cpu_addr, cpu_addr + size - 1, pci_addr,
(pci_space & 0x40000000) ? "Prefetch" : ""); (pci_space & 0x40000000) ? "Prefetch" : "");
/* We support only 3 memory ranges */ /* We support only 3 memory ranges */
if (memno >= 3) { if (memno >= 3) {
printk(KERN_INFO pr_info(" \\--> Skipped (too many) !\n");
" \\--> Skipped (too many) !\n");
continue; continue;
} }
/* Handles ISA memory hole space here */ /* Handles ISA memory hole space here */
...@@ -781,8 +777,7 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose, ...@@ -781,8 +777,7 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
hose->pci_mem_offset = cpu_addr - pci_addr; hose->pci_mem_offset = cpu_addr - pci_addr;
else if (pci_addr != 0 && else if (pci_addr != 0 &&
hose->pci_mem_offset != cpu_addr - pci_addr) { hose->pci_mem_offset != cpu_addr - pci_addr) {
printk(KERN_INFO pr_info(" \\--> Skipped (offset mismatch) !\n");
" \\--> Skipped (offset mismatch) !\n");
continue; continue;
} }
...@@ -809,7 +804,7 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose, ...@@ -809,7 +804,7 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
*/ */
if (isa_hole >= 0 && hose->pci_mem_offset != isa_mb) { if (isa_hole >= 0 && hose->pci_mem_offset != isa_mb) {
unsigned int next = isa_hole + 1; unsigned int next = isa_hole + 1;
printk(KERN_INFO " Removing ISA hole at 0x%016llx\n", isa_mb); pr_info(" Removing ISA hole at 0x%016llx\n", isa_mb);
if (next < memno) if (next < memno)
memmove(&hose->mem_resources[isa_hole], memmove(&hose->mem_resources[isa_hole],
&hose->mem_resources[next], &hose->mem_resources[next],
...@@ -833,7 +828,7 @@ static void pcibios_fixup_resources(struct pci_dev *dev) ...@@ -833,7 +828,7 @@ static void pcibios_fixup_resources(struct pci_dev *dev)
int i; int i;
if (!hose) { if (!hose) {
printk(KERN_ERR "No host bridge for PCI dev %s !\n", pr_err("No host bridge for PCI dev %s !\n",
pci_name(dev)); pci_name(dev));
return; return;
} }
...@@ -842,12 +837,12 @@ static void pcibios_fixup_resources(struct pci_dev *dev) ...@@ -842,12 +837,12 @@ static void pcibios_fixup_resources(struct pci_dev *dev)
if (!res->flags) if (!res->flags)
continue; continue;
if (res->start == 0) { if (res->start == 0) {
pr_debug("PCI:%s Resource %d %016llx-%016llx [%x]" \ pr_debug("PCI:%s Resource %d %016llx-%016llx [%x]",
"is unassigned\n",
pci_name(dev), i, pci_name(dev), i,
(unsigned long long)res->start, (unsigned long long)res->start,
(unsigned long long)res->end, (unsigned long long)res->end,
(unsigned int)res->flags); (unsigned int)res->flags);
pr_debug("is unassigned\n");
res->end -= res->start; res->end -= res->start;
res->start = 0; res->start = 0;
res->flags |= IORESOURCE_UNSET; res->flags |= IORESOURCE_UNSET;
...@@ -856,7 +851,7 @@ static void pcibios_fixup_resources(struct pci_dev *dev) ...@@ -856,7 +851,7 @@ static void pcibios_fixup_resources(struct pci_dev *dev)
pr_debug("PCI:%s Resource %d %016llx-%016llx [%x]\n", pr_debug("PCI:%s Resource %d %016llx-%016llx [%x]\n",
pci_name(dev), i, pci_name(dev), i,
(unsigned long long)res->start,\ (unsigned long long)res->start,
(unsigned long long)res->end, (unsigned long long)res->end,
(unsigned int)res->flags); (unsigned int)res->flags);
} }
...@@ -947,7 +942,7 @@ static void pcibios_fixup_bridge(struct pci_bus *bus) ...@@ -947,7 +942,7 @@ static void pcibios_fixup_bridge(struct pci_bus *bus)
pr_debug("PCI:%s Bus rsrc %d %016llx-%016llx [%x] fixup...\n", pr_debug("PCI:%s Bus rsrc %d %016llx-%016llx [%x] fixup...\n",
pci_name(dev), i, pci_name(dev), i,
(unsigned long long)res->start,\ (unsigned long long)res->start,
(unsigned long long)res->end, (unsigned long long)res->end,
(unsigned int)res->flags); (unsigned int)res->flags);
...@@ -1154,12 +1149,12 @@ static void pcibios_allocate_bus_resources(struct pci_bus *bus) ...@@ -1154,12 +1149,12 @@ static void pcibios_allocate_bus_resources(struct pci_bus *bus)
} }
} }
pr_debug("PCI: %s (bus %d) bridge rsrc %d: %016llx-%016llx " pr_debug("PCI: %s (bus %d) bridge rsrc %d: %016llx-%016llx ",
"[0x%x], parent %p (%s)\n",
bus->self ? pci_name(bus->self) : "PHB", bus->self ? pci_name(bus->self) : "PHB",
bus->number, i, bus->number, i,
(unsigned long long)res->start, (unsigned long long)res->start,
(unsigned long long)res->end, (unsigned long long)res->end);
pr_debug("[0x%x], parent %p (%s)\n",
(unsigned int)res->flags, (unsigned int)res->flags,
pr, (pr && pr->name) ? pr->name : "nil"); pr, (pr && pr->name) ? pr->name : "nil");
...@@ -1174,9 +1169,8 @@ static void pcibios_allocate_bus_resources(struct pci_bus *bus) ...@@ -1174,9 +1169,8 @@ static void pcibios_allocate_bus_resources(struct pci_bus *bus)
if (reparent_resources(pr, res) == 0) if (reparent_resources(pr, res) == 0)
continue; continue;
} }
printk(KERN_WARNING "PCI: Cannot allocate resource region " pr_warn("PCI: Cannot allocate resource region ");
"%d of PCI bridge %d, will remap\n", i, bus->number); pr_cont("%d of PCI bridge %d, will remap\n", i, bus->number);
res->start = res->end = 0; res->start = res->end = 0;
res->flags = 0; res->flags = 0;
} }
...@@ -1198,8 +1192,8 @@ static inline void alloc_resource(struct pci_dev *dev, int idx) ...@@ -1198,8 +1192,8 @@ static inline void alloc_resource(struct pci_dev *dev, int idx)
pr = pci_find_parent_resource(dev, r); pr = pci_find_parent_resource(dev, r);
if (!pr || (pr->flags & IORESOURCE_UNSET) || if (!pr || (pr->flags & IORESOURCE_UNSET) ||
request_resource(pr, r) < 0) { request_resource(pr, r) < 0) {
printk(KERN_WARNING "PCI: Cannot allocate resource region %d" pr_warn("PCI: Cannot allocate resource region %d ", idx);
" of device %s, will remap\n", idx, pci_name(dev)); pr_cont("of device %s, will remap\n", pci_name(dev));
if (pr) if (pr)
pr_debug("PCI: parent is %p: %016llx-%016llx [%x]\n", pr_debug("PCI: parent is %p: %016llx-%016llx [%x]\n",
pr, pr,
...@@ -1282,8 +1276,7 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus) ...@@ -1282,8 +1276,7 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus)
res->end = (offset + 0xfff) & 0xfffffffful; res->end = (offset + 0xfff) & 0xfffffffful;
pr_debug("Candidate legacy IO: %pR\n", res); pr_debug("Candidate legacy IO: %pR\n", res);
if (request_resource(&hose->io_resource, res)) { if (request_resource(&hose->io_resource, res)) {
printk(KERN_DEBUG pr_debug("PCI %04x:%02x Cannot reserve Legacy IO %pR\n",
"PCI %04x:%02x Cannot reserve Legacy IO %pR\n",
pci_domain_nr(bus), bus->number, res); pci_domain_nr(bus), bus->number, res);
kfree(res); kfree(res);
} }
...@@ -1311,8 +1304,7 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus) ...@@ -1311,8 +1304,7 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus)
res->end = 0xbffff + offset; res->end = 0xbffff + offset;
pr_debug("Candidate VGA memory: %pR\n", res); pr_debug("Candidate VGA memory: %pR\n", res);
if (request_resource(pres, res)) { if (request_resource(pres, res)) {
printk(KERN_DEBUG pr_debug("PCI %04x:%02x Cannot reserve VGA memory %pR\n",
"PCI %04x:%02x Cannot reserve VGA memory %pR\n",
pci_domain_nr(bus), bus->number, res); pci_domain_nr(bus), bus->number, res);
kfree(res); kfree(res);
} }
...@@ -1362,10 +1354,9 @@ void pcibios_claim_one_bus(struct pci_bus *bus) ...@@ -1362,10 +1354,9 @@ void pcibios_claim_one_bus(struct pci_bus *bus)
if (r->parent || !r->start || !r->flags) if (r->parent || !r->start || !r->flags)
continue; continue;
pr_debug("PCI: Claiming %s: " pr_debug("PCI: Claiming %s: ", pci_name(dev));
"Resource %d: %016llx..%016llx [%x]\n", pr_debug("Resource %d: %016llx..%016llx [%x]\n",
pci_name(dev), i, i, (unsigned long long)r->start,
(unsigned long long)r->start,
(unsigned long long)r->end, (unsigned long long)r->end,
(unsigned int)r->flags); (unsigned int)r->flags);
...@@ -1423,8 +1414,8 @@ static void pcibios_setup_phb_resources(struct pci_controller *hose, ...@@ -1423,8 +1414,8 @@ static void pcibios_setup_phb_resources(struct pci_controller *hose,
res->end = (res->end + io_offset) & 0xffffffffu; res->end = (res->end + io_offset) & 0xffffffffu;
if (!res->flags) { if (!res->flags) {
printk(KERN_WARNING "PCI: I/O resource not set for host" pr_warn("PCI: I/O resource not set for host ");
" bridge %s (domain %d)\n", pr_cont("bridge %s (domain %d)\n",
hose->dn->full_name, hose->global_number); hose->dn->full_name, hose->global_number);
/* Workaround for lack of IO resource only on 32-bit */ /* Workaround for lack of IO resource only on 32-bit */
res->start = (unsigned long)hose->io_base_virt - isa_io_base; res->start = (unsigned long)hose->io_base_virt - isa_io_base;
...@@ -1445,8 +1436,8 @@ static void pcibios_setup_phb_resources(struct pci_controller *hose, ...@@ -1445,8 +1436,8 @@ static void pcibios_setup_phb_resources(struct pci_controller *hose,
if (!res->flags) { if (!res->flags) {
if (i > 0) if (i > 0)
continue; continue;
printk(KERN_ERR "PCI: Memory resource 0 not set for " pr_err("PCI: Memory resource 0 not set for ");
"host bridge %s (domain %d)\n", pr_cont("host bridge %s (domain %d)\n",
hose->dn->full_name, hose->global_number); hose->dn->full_name, hose->global_number);
/* Workaround for lack of MEM resource only on 32-bit */ /* Workaround for lack of MEM resource only on 32-bit */
...@@ -1489,7 +1480,7 @@ static void pcibios_scan_phb(struct pci_controller *hose) ...@@ -1489,7 +1480,7 @@ static void pcibios_scan_phb(struct pci_controller *hose)
bus = pci_scan_root_bus(hose->parent, hose->first_busno, bus = pci_scan_root_bus(hose->parent, hose->first_busno,
hose->ops, hose, &resources); hose->ops, hose, &resources);
if (bus == NULL) { if (bus == NULL) {
printk(KERN_ERR "Failed to create bus for PCI domain %04x\n", pr_err("Failed to create bus for PCI domain %04x\n",
hose->global_number); hose->global_number);
pci_free_resource_list(&resources); pci_free_resource_list(&resources);
return; return;
...@@ -1505,7 +1496,7 @@ static int __init pcibios_init(void) ...@@ -1505,7 +1496,7 @@ static int __init pcibios_init(void)
struct pci_controller *hose, *tmp; struct pci_controller *hose, *tmp;
int next_busno = 0; int next_busno = 0;
printk(KERN_INFO "PCI: Probing PCI hardware\n"); pr_info("PCI: Probing PCI hardware\n");
/* Scan all of the recorded PCI controllers. */ /* Scan all of the recorded PCI controllers. */
list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
...@@ -1605,7 +1596,7 @@ fake_pci_bus(struct pci_controller *hose, int busnr) ...@@ -1605,7 +1596,7 @@ fake_pci_bus(struct pci_controller *hose, int busnr)
static struct pci_bus bus; static struct pci_bus bus;
if (!hose) if (!hose)
printk(KERN_ERR "Can't find hose for PCI bus %d!\n", busnr); pr_err("Can't find hose for PCI bus %d!\n", busnr);
bus.number = busnr; bus.number = busnr;
bus.sysdata = hose; bus.sysdata = hose;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <asm/io.h> #include <linux/io.h>
#define XPLB_PCI_ADDR 0x10c #define XPLB_PCI_ADDR 0x10c
#define XPLB_PCI_DATA 0x110 #define XPLB_PCI_DATA 0x110
...@@ -82,7 +82,7 @@ xilinx_pci_exclude_device(struct pci_controller *hose, u_char bus, u8 devfn) ...@@ -82,7 +82,7 @@ xilinx_pci_exclude_device(struct pci_controller *hose, u_char bus, u8 devfn)
* *
* List pci devices in very early phase. * List pci devices in very early phase.
*/ */
void __init xilinx_early_pci_scan(struct pci_controller *hose) static void __init xilinx_early_pci_scan(struct pci_controller *hose)
{ {
u32 bus = 0; u32 bus = 0;
u32 val, dev, func, offset; u32 val, dev, func, offset;
...@@ -91,27 +91,27 @@ void __init xilinx_early_pci_scan(struct pci_controller *hose) ...@@ -91,27 +91,27 @@ void __init xilinx_early_pci_scan(struct pci_controller *hose)
for (dev = 0; dev < 2; dev++) { for (dev = 0; dev < 2; dev++) {
/* List only first function number - up-to 8 functions */ /* List only first function number - up-to 8 functions */
for (func = 0; func < 1; func++) { for (func = 0; func < 1; func++) {
printk(KERN_INFO "%02x:%02x:%02x", bus, dev, func); pr_info("%02x:%02x:%02x", bus, dev, func);
/* read the first 64 standardized bytes */ /* read the first 64 standardized bytes */
/* Up-to 192 bytes can be list of capabilities */ /* Up-to 192 bytes can be list of capabilities */
for (offset = 0; offset < 64; offset += 4) { for (offset = 0; offset < 64; offset += 4) {
early_read_config_dword(hose, bus, early_read_config_dword(hose, bus,
PCI_DEVFN(dev, func), offset, &val); PCI_DEVFN(dev, func), offset, &val);
if (offset == 0 && val == 0xFFFFFFFF) { if (offset == 0 && val == 0xFFFFFFFF) {
printk(KERN_CONT "\nABSENT"); pr_cont("\nABSENT");
break; break;
} }
if (!(offset % 0x10)) if (!(offset % 0x10))
printk(KERN_CONT "\n%04x: ", offset); pr_cont("\n%04x: ", offset);
printk(KERN_CONT "%08x ", val); pr_cont("%08x ", val);
} }
printk(KERN_INFO "\n"); pr_info("\n");
} }
} }
} }
#else #else
void __init xilinx_early_pci_scan(struct pci_controller *hose) static void __init xilinx_early_pci_scan(struct pci_controller *hose)
{ {
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment