Commit a288465f authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze

* 'next' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Fix msr instruction detection
  microblaze: Fix pte_update function
  microblaze: Fix asm compilation warning
  microblaze: Fix IRQ flag handling for MSR=0
parents 80d02d27 0eb6aaf5
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <asm/registers.h> #include <asm/registers.h>
#ifdef CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR #if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
static inline unsigned long arch_local_irq_save(void) static inline unsigned long arch_local_irq_save(void)
{ {
......
...@@ -411,20 +411,19 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) ...@@ -411,20 +411,19 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
static inline unsigned long pte_update(pte_t *p, unsigned long clr, static inline unsigned long pte_update(pte_t *p, unsigned long clr,
unsigned long set) unsigned long set)
{ {
unsigned long old, tmp, msr; unsigned long flags, old, tmp;
__asm__ __volatile__("\ raw_local_irq_save(flags);
msrclr %2, 0x2\n\
nop\n\ __asm__ __volatile__( "lw %0, %2, r0 \n"
lw %0, %4, r0\n\ "andn %1, %0, %3 \n"
andn %1, %0, %5\n\ "or %1, %1, %4 \n"
or %1, %1, %6\n\ "sw %1, %2, r0 \n"
sw %1, %4, r0\n\ : "=&r" (old), "=&r" (tmp)
mts rmsr, %2\n\ : "r" ((unsigned long)(p + 1) - 4), "r" (clr), "r" (set)
nop" : "cc");
: "=&r" (old), "=&r" (tmp), "=&r" (msr), "=m" (*p)
: "r" ((unsigned long)(p + 1) - 4), "r" (clr), "r" (set), "m" (*p) raw_local_irq_restore(flags);
: "cc");
return old; return old;
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
register unsigned tmp __asm__("r3"); \ register unsigned tmp __asm__("r3"); \
tmp = 0x0; /* Prevent warning about unused */ \ tmp = 0x0; /* Prevent warning about unused */ \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"mfs %0, rpvr" #pvrid ";" \ "mfs %0, rpvr" #pvrid ";" \
: "=r" (tmp) : : "memory"); \ : "=r" (tmp) : : "memory"); \
val = tmp; \ val = tmp; \
} }
...@@ -54,7 +54,7 @@ int cpu_has_pvr(void) ...@@ -54,7 +54,7 @@ int cpu_has_pvr(void)
if (!(flags & PVR_MSR_BIT)) if (!(flags & PVR_MSR_BIT))
return 0; return 0;
get_single_pvr(0x00, pvr0); get_single_pvr(0, pvr0);
pr_debug("%s: pvr0 is 0x%08x\n", __func__, pvr0); pr_debug("%s: pvr0 is 0x%08x\n", __func__, pvr0);
if (pvr0 & PVR0_PVR_FULL_MASK) if (pvr0 & PVR0_PVR_FULL_MASK)
......
...@@ -62,15 +62,14 @@ real_start: ...@@ -62,15 +62,14 @@ real_start:
andi r1, r1, ~2 andi r1, r1, ~2
mts rmsr, r1 mts rmsr, r1
/* /*
* Here is checking mechanism which check if Microblaze has msr instructions * According to Xilinx, msrclr instruction behaves like 'mfs rX,rpc'
* We load msr and compare it with previous r1 value - if is the same, * if the msrclr instruction is not enabled. We use this to detect
* msr instructions works if not - cpu don't have them. * if the opcode is available, by issuing msrclr and then testing the result.
* r8 == 0 - msr instructions are implemented
* r8 != 0 - msr instructions are not implemented
*/ */
/* r8=0 - I have msr instr, 1 - I don't have them */ msrclr r8, 0 /* clear nothing - just read msr for test */
rsubi r0, r0, 1 /* set the carry bit */ cmpu r8, r8, r1 /* r1 must contain msr reg content */
msrclr r0, 0x4 /* try to clear it */
/* read the carry bit, r8 will be '0' if msrclr exists */
addik r8, r0, 0
/* r7 may point to an FDT, or there may be one linked in. /* r7 may point to an FDT, or there may be one linked in.
if it's in r7, we've got to save it away ASAP. if it's in r7, we've got to save it away ASAP.
......
...@@ -161,11 +161,11 @@ void __init machine_early_init(const char *cmdline, unsigned int ram, ...@@ -161,11 +161,11 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR #if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
if (msr) if (msr)
eprintk("!!!Your kernel has setup MSR instruction but " eprintk("!!!Your kernel has setup MSR instruction but "
"CPU don't have it %d\n", msr); "CPU don't have it %x\n", msr);
#else #else
if (!msr) if (!msr)
eprintk("!!!Your kernel not setup MSR instruction but " eprintk("!!!Your kernel not setup MSR instruction but "
"CPU have it %d\n", msr); "CPU have it %x\n", msr);
#endif #endif
for (src = __ivt_start; src < __ivt_end; src++, dst++) for (src = __ivt_start; src < __ivt_end; src++, dst++)
......
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