* RE: ML403 and Montavista 4.01
From: Rick Moleres @ 2006-09-09 22:11 UTC (permalink / raw)
To: linux-ppc, linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 642 bytes --]
This is planned to be released with EDK 8.2.2 (currently scheduled for
release in October)
-Rick
________________________________
From: linuxppc-embedded-bounces+moleres=xilinx.com@ozlabs.org
[mailto:linuxppc-embedded-bounces+moleres=xilinx.com@ozlabs.org] On
Behalf Of linux-ppc@eurotel.it
Sent: Saturday, September 09, 2006 4:13 AM
To: linuxppc-embedded@ozlabs.org
Subject: ML403 and Montavista 4.01
Hello, we started developing kernel with Montavista 4.01 to Xilinx
ML403.
Is there any info about upgrading ISE 8.1 Montavista 4 MLD/TCL and
driver files to enable automatic driver generation?
[-- Attachment #2: Type: text/html, Size: 3896 bytes --]
^ permalink raw reply
* [RFC] inline hypercall implementation for pseries
From: Arnd Bergmann @ 2006-09-09 22:42 UTC (permalink / raw)
To: linuxppc-dev; +Cc: paulus, anton, arnd
This patch goes on top of the latest hcall statistics patch from
Mike Kravetz and changes the implementation of all hcalls to
end up in an inline assembly. This reduces the number of instructions
required on the side of the caller, so that in most cases we
don't need any stack memory at all.
Unfortunately, I don't have any hypervisor machine to try
this out, so I'm hoping someone else can test it and fix the
obvious bugs.
When statistics are enabled, the code is somewhat larger
than before, but for the regular case, it gets smaller,
this is the 'size' output for
arch/powerpc/platforms/pseries/built-in.o:
text data bss dec hex filename
45940 11584 8860 66384 10350 out of line, without stats
47152 16240 8860 72252 11a3c out-of-line, with stats
45492 11488 8860 65840 10130 inline, without stats
47264 16176 8860 72300 11a6c inline, with stats
As an example, the pSeries_lpar_hpte_invalidate function changes
from:
mflr 0 #,
mr 11,5 # psize, psize
li 5,0 #,
mr 6,3 # slot, slot
li 3,4 #,
sldi 9,11,5 #, tmp128, psize
cmpdi 7,11,0 #, tmp134, psize
std 0,16(1) #,
stdu 1,-144(1) #,,
ori 5,5,32768 #,,,
ld 0,.LC26@toc(2) #, tmp127
sldi 5,5,16 #,,
add 9,9,0 # tmp129, tmp128, tmp127
ld 0,16(9) # <variable>.avpnm, <variable>.avpnm
srdi 9,4,23 #, tmp126, va
addi 4,1,112 #,,
andc 0,9,0 #, tmp133, tmp126, <variable>.avpnm
sldi 0,0,7 #, want_v, tmp133
beq 7,.L68 #
ori 0,0,4 #, want_v, want_v,
.L68:
rldicr 7,0,16,47 #,,, want_v
rldicr 7,7,48,56 #,,,
bl .plpar_hcall #
nop
cmpdi 7,3,-7 #, tmp137, rc
addic 9,3,-1 #, rc
subfe 0,9,3 # tmp142,, rc
beq 7,.L72 #
tdnei 0,0 # tmp142
addi 1,1,144 #,,
ld 0,16(1) #,
mtlr 0 #,
blr #
to
.pSeries_lpar_hpte_invalidate:
ld 0,.LC26@toc(2) #, tmp126
sldi 6,5,5 #, tmp127, psize
cmpdi 7,5,0 #, tmp133, psize
srdi 4,4,23 #, tmp125, va
mr 5,3 # slot, slot
li 3,4 # __r3,
add 6,6,0 # tmp128, tmp127, tmp126
ld 0,16(6) # <variable>.avpnm, <variable>.avpnm
andc 0,4,0 #, tmp132, tmp125, <variable>.avpnm
sldi 0,0,7 #, want_v, tmp132
beq 7,.L68 #
ori 0,0,4 #, want_v, want_v,
or 2,2,2 # medium priority
li 4,0 # __r4,
rldicr 6,0,0,56 #, __r6, want_v
ori 4,4,32768 #, __r4, __r4,
sldi 4,4,16 #, __r4, __r4
.long 0x44000022 # HVCALL
cmpdi 7,3,-7 #, tmp135, lpar_rc
addic 9,3,-1 #, lpar_rc
subfe 0,9,3 # tmp140,, lpar_rc
beqlr 7
tdnei 0,0 # tmp140
blr
and this also avoid the overhead of writing output arguments
to memory if they are not used afterwards.
Arnd <><
Index: linus-2.6/arch/powerpc/platforms/pseries/hvCall.S
===================================================================
--- linus-2.6.orig/arch/powerpc/platforms/pseries/hvCall.S 2006-09-10
00:17:27.000000000 +0200
+++ linus-2.6/arch/powerpc/platforms/pseries/hvCall.S 2006-09-10
00:17:27.000000000 +0200
@@ -11,154 +11,43 @@
#include <asm/processor.h>
#include <asm/ppc_asm.h>
#include <asm/asm-offsets.h>
-
-#define STK_PARM(i) (48 + ((i)-3)*8)
-#ifdef CONFIG_HCALL_STATS
-/*
- * precall must preserve all registers. use unused STK_PARM()
- * areas to save snapshots and opcode.
- */
-#define HCALL_INST_PRECALL \
- std r3,STK_PARM(r3)(r1); /* save opcode */ \
- mftb r0; /* get timebase and */ \
- std r0,STK_PARM(r5)(r1); /* save for later */ \
-BEGIN_FTR_SECTION; \
- mfspr r0,SPRN_PURR; /* get PURR and */ \
- std r0,STK_PARM(r6)(r1); /* save for later */ \
-END_FTR_SECTION_IFCLR(CPU_FTR_PURR);
-
+ .text
+_GLOBAL(hcall_instrument)
/*
- * postcall is performed immediately before function return which
- * allows liberal use of volatile registers.
+ * Special calling conventions:
+ * - r3 to r12 are input and output argument registers.
+ * - r13 contains a pointer to the statistics structure for the
+ * current hcall number / cpu.
+ * - r14, r15 and r16 are clobbered during this call and need to
+ * be saved by the caller.
+ * - cr is caller clobbered as well
*/
-#define HCALL_INST_POSTCALL \
- ld r4,STK_PARM(r3)(r1); /* validate opcode */ \
- cmpldi cr7,r4,MAX_HCALL_OPCODE; \
- bgt- cr7,1f; \
- \
- /* get time and PURR snapshots after hcall */ \
- mftb r7; /* timebase after */ \
-BEGIN_FTR_SECTION; \
- mfspr r8,SPRN_PURR; /* PURR after */ \
- ld r6,STK_PARM(r6)(r1); /* PURR before */ \
- subf r6,r6,r8; /* delta */ \
-END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
- ld r5,STK_PARM(r5)(r1); /* timebase before */ \
- subf r5,r5,r7; /* time delta */ \
- \
- /* calculate address of stat structure r4 = opcode */ \
- srdi r4,r4,2; /* index into array */ \
- mulli r4,r4,HCALL_STAT_SIZE; \
- LOAD_REG_ADDR(r7, per_cpu__hcall_stats); \
- add r4,r4,r7; \
- ld r7,PACA_DATA_OFFSET(r13); /* per cpu offset */ \
- add r4,r4,r7; \
- \
- /* update stats */ \
- ld r7,HCALL_STAT_CALLS(r4); /* count */ \
- addi r7,r7,1; \
- std r7,HCALL_STAT_CALLS(r4); \
- ld r7,HCALL_STAT_TB(r4); /* timebase */ \
- add r7,r7,r5; \
- std r7,HCALL_STAT_TB(r4); \
-BEGIN_FTR_SECTION; \
- ld r7,HCALL_STAT_PURR(r4); /* PURR */ \
- add r7,r7,r6; \
- std r7,HCALL_STAT_PURR(r4); \
-END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
-1:
-#else
-#define HCALL_INST_PRECALL
-#define HCALL_INST_POSTCALL
-#endif
-
- .text
-
-_GLOBAL(plpar_hcall_norets)
- HMT_MEDIUM
-
- mfcr r0
- stw r0,8(r1)
-
- HCALL_INST_PRECALL
+ mftb r15 /* get timebase and */
+BEGIN_FTR_SECTION;
+ mfspr r16,SPRN_PURR /* get PURR and */
+END_FTR_SECTION_IFCLR(CPU_FTR_PURR)
HVSC /* invoke the hypervisor */
- HCALL_INST_POSTCALL
-
- lwz r0,8(r1)
- mtcrf 0xff,r0
- blr /* return r3 = status */
-
-_GLOBAL(plpar_hcall)
- HMT_MEDIUM
-
- mfcr r0
- stw r0,8(r1)
-
- HCALL_INST_PRECALL
-
- std r4,STK_PARM(r4)(r1) /* Save ret buffer */
-
- mr r4,r5
- mr r5,r6
- mr r6,r7
- mr r7,r8
- mr r8,r9
- mr r9,r10
-
- HVSC /* invoke the hypervisor */
-
- ld r12,STK_PARM(r4)(r1)
- std r4, 0(r12)
- std r5, 8(r12)
- std r6, 16(r12)
- std r7, 24(r12)
-
- HCALL_INST_POSTCALL
-
- lwz r0,8(r1)
- mtcrf 0xff,r0
-
- blr /* return r3 = status */
-
-_GLOBAL(plpar_hcall9)
- HMT_MEDIUM
-
- mfcr r0
- stw r0,8(r1)
-
- HCALL_INST_PRECALL
-
- std r4,STK_PARM(r4)(r1) /* Save ret buffer */
-
- mr r4,r5
- mr r5,r6
- mr r6,r7
- mr r7,r8
- mr r8,r9
- mr r9,r10
- ld r10,STK_PARM(r11)(r1) /* put arg7 in R10 */
- ld r11,STK_PARM(r12)(r1) /* put arg8 in R11 */
- ld r12,STK_PARM(r13)(r1) /* put arg9 in R12 */
-
- HVSC /* invoke the hypervisor */
-
- ld r12,STK_PARM(r4)(r1)
- std r4, 0(r12)
- std r5, 8(r12)
- std r6, 16(r12)
- std r7, 24(r12)
- std r8, 32(r12)
- std r9, 40(r12)
- std r10,48(r12)
- std r11,56(r12)
- std r12,64(r12)
-
- HCALL_INST_POSTCALL
-
- lwz r0,8(r1)
- mtcrf 0xff,r0
-
- blr /* return r3 = status */
+ /* get time and PURR snapshots after hcall */
+ mftb r14 /* timebase after */
+ subf r15,r15,r14 /* time delta */
+BEGIN_FTR_SECTION
+ mfspr r14,SPRN_PURR /* PURR after */
+ subf r16,r16,r14 /* delta */
+END_FTR_SECTION_IFCLR(CPU_FTR_PURR)
+
+ /* update stats */
+ ld r14,HCALL_STAT_CALLS(r13) /* count */
+ addi r14,r14,1
+ std r14,HCALL_STAT_CALLS(r13)
+ ld r14,HCALL_STAT_TB(r13) /* timebase */
+ add r14,r14,r5
+ std r14,HCALL_STAT_TB(r13)
+BEGIN_FTR_SECTION
+ ld r14,HCALL_STAT_PURR(r13)/* PURR */
+ add r14,r14,r6
+ std r14,HCALL_STAT_PURR(r13)
+END_FTR_SECTION_IFCLR(CPU_FTR_PURR)
+1: blr
Index: linus-2.6/arch/powerpc/kernel/asm-offsets.c
===================================================================
--- linus-2.6.orig/arch/powerpc/kernel/asm-offsets.c 2006-09-10
00:17:27.000000000 +0200
+++ linus-2.6/arch/powerpc/kernel/asm-offsets.c 2006-09-10 00:17:27.000000000
+0200
@@ -44,6 +44,7 @@
#include <asm/cache.h>
#include <asm/compat.h>
#include <asm/mmu.h>
+#include <asm/hvcall.h>
#endif
#define DEFINE(sym, val) \
Index: linus-2.6/include/asm-powerpc/hvcall.h
===================================================================
--- linus-2.6.orig/include/asm-powerpc/hvcall.h 2006-09-10 00:17:27.000000000
+0200
+++ linus-2.6/include/asm-powerpc/hvcall.h 2006-09-10 00:17:27.000000000 +0200
@@ -2,6 +2,13 @@
#define _ASM_POWERPC_HVCALL_H
#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
+#include <asm/reg.h>
+#include <asm/time.h>
+#include <asm/cputable.h>
+#include <linux/percpu.h>
+#endif
+
#define HVSC .long 0x44000022
#define H_SUCCESS 0
@@ -212,6 +219,194 @@
#ifndef __ASSEMBLY__
+#define __hvcall_plpar(nr, nr_in, i1, i2, i3, i4, i5, i6, i7, i8, o1, o2, o3,
o4, o5, o6, o7) \
+({ \
+ register unsigned long __r3 asm("r3") = nr; \
+ register unsigned long __r4 asm("r4"); \
+ register unsigned long __r5 asm("r5"); \
+ register unsigned long __r6 asm("r6"); \
+ register unsigned long __r7 asm("r7"); \
+ register unsigned long __r8 asm("r8"); \
+ register unsigned long __r9 asm("r9"); \
+ register unsigned long __r10 asm("r10"); \
+ register unsigned long __r11 asm("r11"); \
+ HMT_medium(); \
+ if ((nr_in) >= 1) __r4 = (unsigned long)i1; \
+ if ((nr_in) >= 2) __r5 = (unsigned long)i2; \
+ if ((nr_in) >= 3) __r6 = (unsigned long)i3; \
+ if ((nr_in) >= 4) __r7 = (unsigned long)i4; \
+ if ((nr_in) >= 5) __r8 = (unsigned long)i5; \
+ if ((nr_in) >= 6) __r9 = (unsigned long)i6; \
+ if ((nr_in) >= 7) __r10 = (unsigned long)i7; \
+ if ((nr_in) >= 8) __r11 = (unsigned long)i8; \
+ asm volatile(".long 0x44000022" : \
+ "+r" (__r3), \
+ "+r" (__r4), \
+ "+r" (__r5), \
+ "+r" (__r6), \
+ "+r" (__r7), \
+ "+r" (__r8), \
+ "+r" (__r9), \
+ "+r" (__r10), \
+ "+r" (__r11) : \
+ "0" (__r3), \
+ "1" (__r4), \
+ "2" (__r5), \
+ "3" (__r6), \
+ "4" (__r7), \
+ "5" (__r8), \
+ "6" (__r9), \
+ "7" (__r10), \
+ "8" (__r11) : \
+ "cc", "memory"); \
+ *(o1) = (typeof (*(o1)))__r4; \
+ *(o2) = (typeof (*(o2)))__r5; \
+ *(o3) = (typeof (*(o3)))__r6; \
+ *(o4) = (typeof (*(o4)))__r7; \
+ *(o5) = (typeof (*(o5)))__r8; \
+ *(o6) = (typeof (*(o6)))__r9; \
+ *(o7) = (typeof (*(o7)))__r10; \
+ __r3; \
+})
+
+#define __hvcall_plpar_stats(nr, nr_in, i1, i2, i3, i4, i5, i6, i7, i8, o1,
o2, o3, o4, o5, o6, o7) \
+({ \
+ register unsigned long __r3 asm("r3") = nr; \
+ register unsigned long __r4 asm("r4"); \
+ register unsigned long __r5 asm("r5"); \
+ register unsigned long __r6 asm("r6"); \
+ register unsigned long __r7 asm("r7"); \
+ register unsigned long __r8 asm("r8"); \
+ register unsigned long __r9 asm("r9"); \
+ register unsigned long __r10 asm("r10"); \
+ register unsigned long __r11 asm("r11"); \
+ register unsigned long __r13 asm("r13"); \
+ HMT_medium(); \
+ BUILD_BUG_ON(nr > MAX_HCALL_OPCODE); \
+ if ((nr_in) >= 1) __r4 = (unsigned long)i1; \
+ if ((nr_in) >= 2) __r5 = (unsigned long)i2; \
+ if ((nr_in) >= 3) __r6 = (unsigned long)i3; \
+ if ((nr_in) >= 4) __r7 = (unsigned long)i4; \
+ if ((nr_in) >= 5) __r8 = (unsigned long)i5; \
+ if ((nr_in) >= 6) __r9 = (unsigned long)i6; \
+ if ((nr_in) >= 7) __r10 = (unsigned long)i7; \
+ if ((nr_in) >= 8) __r11 = (unsigned long)i8; \
+ __r13 = (unsigned long)&__get_cpu_var(hcall_stats)[nr >> 2]; \
+ asm volatile("bl .hcall_instrument" : \
+ "+r" (__r3), \
+ "+r" (__r4), \
+ "+r" (__r5), \
+ "+r" (__r6), \
+ "+r" (__r7), \
+ "+r" (__r8), \
+ "+r" (__r9), \
+ "+r" (__r10), \
+ "+r" (__r11), \
+ "+r" (__r13) : \
+ "0" (__r3), \
+ "1" (__r4), \
+ "2" (__r5), \
+ "3" (__r6), \
+ "4" (__r7), \
+ "5" (__r8), \
+ "6" (__r9), \
+ "7" (__r10), \
+ "8" (__r11) : \
+ "cc", "memory", "r14", "r15", "r16"); \
+ *(o1) = (typeof (*(o1)))__r4; \
+ *(o2) = (typeof (*(o2)))__r5; \
+ *(o3) = (typeof (*(o3)))__r6; \
+ *(o4) = (typeof (*(o4)))__r7; \
+ *(o5) = (typeof (*(o5)))__r8; \
+ *(o6) = (typeof (*(o6)))__r9; \
+ *(o7) = (typeof (*(o7)))__r10; \
+ __r3; \
+})
+
+/* inline hypercall statistics */
+struct hcall_stats {
+ unsigned long num_calls; /* number of calls (on this CPU) */
+ unsigned long tb_total; /* total wall time (mftb) of calls. */
+ unsigned long purr_total; /* total cpu time (PURR) of calls. */
+};
+
+DECLARE_PER_CPU(struct hcall_stats[], hcall_stats);
+
+/* resolve variable number of output arguments */
+
+#define __hvcall_out7(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7, i8, o1,
o2, o3, o4, o5, o6, o7) \
+__hvcall_ ## type(nr, nr_in, i1, i2, i3, i4, i5, i6, i7, i8, o1, o2, o3, o4,
o5, o6, o7)
+
+#define __hvcall_out6(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7, i8, o1,
o2, o3, o4, o5, o6) \
+unsigned long o7; __hvcall_out7(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7,
i8, o1, o2, o3, o4, o5, o6, &o7)
+
+#define __hvcall_out5(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7, i8, o1,
o2, o3, o4, o5) \
+unsigned long o6; __hvcall_out6(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7,
i8, o1, o2, o3, o4, o5, &o6)
+
+#define __hvcall_out4(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7, i8, o1,
o2, o3, o4) \
+unsigned long o5; __hvcall_out5(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7,
i8, o1, o2, o3, o4, &o5)
+
+#define __hvcall_out3(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7, i8, o1,
o2, o3) \
+unsigned long o4; __hvcall_out4(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7,
i8, o1, o2, o3, &o4)
+
+#define __hvcall_out2(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7, i8, o1,
o2) \
+unsigned long o3; __hvcall_out3(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7,
i8, o1, o2, &o3)
+
+#define __hvcall_out1(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7, i8, o1) \
+unsigned long o2; __hvcall_out2(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7,
i8, o1, &o2)
+
+#define __hvcall_out0(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7, i8) \
+unsigned long o1; __hvcall_out1(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7,
i8, &o1)
+
+/* resolve variable number of input arguments */
+
+#define __hvcall_in8(type, nr, nr_in, nr_out, i1, i2, i3, i4, i5, i6, i7, i8,
o...) \
+__hvcall_out ## nr_out(type, nr, nr_in, i1, i2, i3, i4, i5, i6, i7, i8, ## o)
+
+#define __hvcall_in7(type, nr, nr_in, nr_out, i1, i2, i3, i4, i5, i6, i7,
o...) \
+__hvcall_in8(type, nr, nr_in, nr_out, i1, i2, i3, i4, i5, i6, i7, 0, ## o)
+
+#define __hvcall_in6(type, nr, nr_in, nr_out, i1, i2, i3, i4, i5, i6, o...) \
+__hvcall_in7(type, nr, nr_in, nr_out, i1, i2, i3, i4, i5, i6, 0, ## o)
+
+#define __hvcall_in5(type, nr, nr_in, nr_out, i1, i2, i3, i4, i5, o...) \
+__hvcall_in6(type, nr, nr_in, nr_out, i1, i2, i3, i4, i5, 0, ## o)
+
+#define __hvcall_in4(type, nr, nr_in, nr_out, i1, i2, i3, i4, o...) \
+__hvcall_in5(type, nr, nr_in, nr_out, i1, i2, i3, i4, 0, ## o)
+
+#define __hvcall_in3(type, nr, nr_in, nr_out, i1, i2, i3, o...) \
+__hvcall_in4(type, nr, nr_in, nr_out, i1, i2, i3, 0, ## o)
+
+#define __hvcall_in2(type, nr, nr_in, nr_out, i1, i2, o...) \
+__hvcall_in3(type, nr, nr_in, nr_out, i1, i2, 0, ## o)
+
+#define __hvcall_in1(type, nr, nr_in, nr_out, i1, o...) \
+__hvcall_in2(type, nr, nr_in, nr_out, i1, 0, ## o)
+
+#define __hvcall_in0(type, nr, nr_in, nr_out, o...) \
+__hvcall_in1(type, nr, nr_in, nr_out, 0, ## o)
+
+#ifndef CONFIG_HCALL_STATS
+/**
+ * hvcall: the main entry point for calling a hypervisor function
+ *
+ * @nr: hcall API number
+ * @nr_in: numer of input arguments
+ * @nr_out: number of output arguments
+ * @args: input and output arguments, number must match nr_in + nr_out
+ *
+ * Arguments can be of any basic type that can be casted to
+ * unsigned long. Output arguments are passed as pointers.
+ */
+#define plpar_hcall(nr, nr_in, nr_out, args...) \
+({ __hvcall_in ## nr_in(plpar, nr, nr_in, nr_out, ## args); })
+#else
+#define plpar_hcall(nr, nr_in, nr_out, args...) \
+({ __hvcall_in ## nr_in(plpar_stats, nr, nr_in, nr_out, ## args); })
+#endif
+
+#if 0
/**
* plpar_hcall_norets: - Make a pseries hypervisor call with no return
arguments
* @opcode: The hypervisor call to make.
@@ -256,6 +451,12 @@
unsigned long purr_delta);
#define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1)
+#endif
+
+void update_hcall_stats(unsigned long opcode, unsigned long tb_delta,
+ unsigned long purr_delta);
+#define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1)
+
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_HVCALL_H */
Index: linus-2.6/arch/powerpc/kernel/rtas.c
===================================================================
--- linus-2.6.orig/arch/powerpc/kernel/rtas.c 2006-09-10 00:17:12.000000000
+0200
+++ linus-2.6/arch/powerpc/kernel/rtas.c 2006-09-10 00:17:27.000000000 +0200
@@ -665,7 +665,7 @@
*/
local_irq_save(flags);
do {
- rc = plpar_hcall_norets(H_JOIN);
+ rc = plpar_hcall(H_JOIN, 0, 0);
smp_rmb();
} while (rc == H_SUCCESS && data->waiting > 0);
if (rc == H_SUCCESS)
@@ -676,7 +676,7 @@
data->args->args[data->args->nargs] =
rtas_call(ibm_suspend_me_token, 0, 1, NULL);
for_each_possible_cpu(i)
- plpar_hcall_norets(H_PROD,i);
+ plpar_hcall(H_PROD, 1, 0, i);
} else {
data->waiting = -EBUSY;
printk(KERN_ERR "Error on H_JOIN hypervisor call\n");
@@ -692,14 +692,11 @@
int i;
long state;
long rc;
- unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
struct rtas_suspend_me_data data;
/* Make sure the state is valid */
- rc = plpar_hcall(H_VASI_STATE, retbuf,
- ((u64)args->args[0] << 32) | args->args[1]);
-
- state = retbuf[0];
+ rc = plpar_hcall(H_VASI_STATE, 1, 1,
+ ((u64)args->args[0] << 32) | args->args[1], &state);
if (rc) {
printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned %ld\n",rc);
@@ -730,7 +727,7 @@
* anyone we successfully put to sleep with H_JOIN.
*/
for_each_possible_cpu(i)
- plpar_hcall_norets(H_PROD, i);
+ plpar_hcall(H_PROD, 1, 0, i);
return data.waiting;
}
Index: linus-2.6/arch/powerpc/platforms/pseries/plpar_wrappers.h
===================================================================
--- linus-2.6.orig/arch/powerpc/platforms/pseries/plpar_wrappers.h 2006-09-10
00:17:12.000000000 +0200
+++ linus-2.6/arch/powerpc/platforms/pseries/plpar_wrappers.h 2006-09-10
00:17:27.000000000 +0200
@@ -5,17 +5,17 @@
static inline long poll_pending(void)
{
- return plpar_hcall_norets(H_POLL_PENDING);
+ return plpar_hcall(H_POLL_PENDING, 0, 0);
}
static inline long prod_processor(void)
{
- return plpar_hcall_norets(H_PROD);
+ return plpar_hcall(H_PROD, 0, 0);
}
static inline long cede_processor(void)
{
- return plpar_hcall_norets(H_CEDE);
+ return plpar_hcall(H_CEDE, 0, 0);
}
static inline long vpa_call(unsigned long flags, unsigned long cpu,
@@ -24,7 +24,7 @@
/* flags are in bits 16-18 (counting from most significant bit) */
flags = flags << (63 - 18);
- return plpar_hcall_norets(H_REGISTER_VPA, flags, cpu, vpa);
+ return plpar_hcall(H_REGISTER_VPA, 3, 0, flags, cpu, vpa);
}
static inline long unregister_vpa(unsigned long cpu, unsigned long vpa)
@@ -53,131 +53,86 @@
unsigned long hpte_group, unsigned long hpte_v,
unsigned long hpte_r, unsigned long *slot)
{
- long rc;
- unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
-
- rc = plpar_hcall(H_ENTER, retbuf, flags, hpte_group, hpte_v, hpte_r);
-
- *slot = retbuf[0];
-
- return rc;
+ return plpar_hcall(H_ENTER, 4, 1, flags, hpte_group, hpte_v, hpte_r, slot);
}
static inline long plpar_pte_remove(unsigned long flags, unsigned long ptex,
unsigned long avpn, unsigned long *old_pteh_ret,
unsigned long *old_ptel_ret)
{
- long rc;
- unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
-
- rc = plpar_hcall(H_REMOVE, retbuf, flags, ptex, avpn);
-
- *old_pteh_ret = retbuf[0];
- *old_ptel_ret = retbuf[1];
-
- return rc;
+ return plpar_hcall(H_REMOVE, 3, 2, flags, ptex, avpn, old_pteh_ret,
old_ptel_ret);
}
static inline long plpar_pte_read(unsigned long flags, unsigned long ptex,
unsigned long *old_pteh_ret, unsigned long *old_ptel_ret)
{
- long rc;
- unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
-
- rc = plpar_hcall(H_READ, retbuf, flags, ptex);
-
- *old_pteh_ret = retbuf[0];
- *old_ptel_ret = retbuf[1];
-
- return rc;
+ return plpar_hcall(H_READ, 2, 2, flags, ptex, old_pteh_ret, old_ptel_ret);
}
static inline long plpar_pte_protect(unsigned long flags, unsigned long ptex,
unsigned long avpn)
{
- return plpar_hcall_norets(H_PROTECT, flags, ptex, avpn);
+ return plpar_hcall(H_PROTECT, 3, 0, flags, ptex, avpn);
}
static inline long plpar_tce_get(unsigned long liobn, unsigned long ioba,
unsigned long *tce_ret)
{
- long rc;
- unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
-
- rc = plpar_hcall(H_GET_TCE, retbuf, liobn, ioba);
-
- *tce_ret = retbuf[0];
-
- return rc;
+ return plpar_hcall(H_GET_TCE, 2, 1, liobn, ioba, tce_ret);
}
static inline long plpar_tce_put(unsigned long liobn, unsigned long ioba,
unsigned long tceval)
{
- return plpar_hcall_norets(H_PUT_TCE, liobn, ioba, tceval);
+ return plpar_hcall(H_PUT_TCE, 3, 0, liobn, ioba, tceval);
}
static inline long plpar_tce_put_indirect(unsigned long liobn,
unsigned long ioba, unsigned long page, unsigned long count)
{
- return plpar_hcall_norets(H_PUT_TCE_INDIRECT, liobn, ioba, page, count);
+ return plpar_hcall(H_PUT_TCE_INDIRECT, 4, 0, liobn, ioba, page, count);
}
static inline long plpar_tce_stuff(unsigned long liobn, unsigned long ioba,
unsigned long tceval, unsigned long count)
{
- return plpar_hcall_norets(H_STUFF_TCE, liobn, ioba, tceval, count);
+ return plpar_hcall(H_STUFF_TCE, 4, 0, liobn, ioba, tceval, count);
}
static inline long plpar_get_term_char(unsigned long termno,
unsigned long *len_ret, char *buf_ret)
{
- long rc;
- unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
unsigned long *lbuf = (unsigned long *)buf_ret; /* TODO: alignment? */
- rc = plpar_hcall(H_GET_TERM_CHAR, retbuf, termno);
-
- *len_ret = retbuf[0];
- lbuf[0] = retbuf[1];
- lbuf[1] = retbuf[2];
-
- return rc;
+ return plpar_hcall(H_GET_TERM_CHAR, 1, 3, termno, len_ret, lbuf, lbuf+1);
}
static inline long plpar_put_term_char(unsigned long termno, unsigned long
len,
const char *buffer)
{
unsigned long *lbuf = (unsigned long *)buffer; /* TODO: alignment? */
- return plpar_hcall_norets(H_PUT_TERM_CHAR, termno, len, lbuf[0],
+ return plpar_hcall(H_PUT_TERM_CHAR, 4, 0, termno, len, lbuf[0],
lbuf[1]);
}
static inline long plpar_eoi(unsigned long xirr)
{
- return plpar_hcall_norets(H_EOI, xirr);
+ return plpar_hcall(H_EOI, 1, 0, xirr);
}
static inline long plpar_cppr(unsigned long cppr)
{
- return plpar_hcall_norets(H_CPPR, cppr);
+ return plpar_hcall(H_CPPR, 1, 0, cppr);
}
static inline long plpar_ipi(unsigned long servernum, unsigned long mfrr)
{
- return plpar_hcall_norets(H_IPI, servernum, mfrr);
+ return plpar_hcall(H_IPI, 2, 0, servernum, mfrr);
}
static inline long plpar_xirr(unsigned long *xirr_ret)
{
- long rc;
- unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
-
- rc = plpar_hcall(H_XIRR, retbuf);
-
- *xirr_ret = retbuf[0];
-
- return rc;
+ return plpar_hcall(H_XIRR, 0, 1, xirr_ret);
}
#endif /* _PSERIES_PLPAR_WRAPPERS_H */
Index: linus-2.6/include/asm-powerpc/vio.h
===================================================================
--- linus-2.6.orig/include/asm-powerpc/vio.h 2006-09-10 00:17:12.000000000
+0200
+++ linus-2.6/include/asm-powerpc/vio.h 2006-09-10 00:17:27.000000000 +0200
@@ -34,7 +34,7 @@
/* End architecture-specific constants */
#define h_vio_signal(ua, mode) \
- plpar_hcall_norets(H_VIO_SIGNAL, ua, mode)
+ plpar_hcall(H_VIO_SIGNAL, 2, 0, ua, mode)
#define VIO_IRQ_DISABLE 0UL
#define VIO_IRQ_ENABLE 1UL
Index: linus-2.6/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- linus-2.6.orig/arch/powerpc/platforms/pseries/setup.c 2006-09-10
00:17:12.000000000 +0200
+++ linus-2.6/arch/powerpc/platforms/pseries/setup.c 2006-09-10
00:17:27.000000000 +0200
@@ -215,7 +215,7 @@
set = 1UL << 63;
reset = 0;
- plpar_hcall_norets(H_PERFMON, set, reset);
+ plpar_hcall(H_PERFMON, 2, 0, set, reset);
/* instruct hypervisor to maintain PMCs */
if (firmware_has_feature(FW_FEATURE_SPLPAR))
@@ -355,13 +355,13 @@
static int pseries_set_dabr(unsigned long dabr)
{
- return plpar_hcall_norets(H_SET_DABR, dabr);
+ return plpar_hcall(H_SET_DABR, 1, 0, dabr);
}
static int pseries_set_xdabr(unsigned long dabr)
{
/* We want to catch accesses from kernel and userspace */
- return plpar_hcall_norets(H_SET_XDABR, dabr,
+ return plpar_hcall(H_SET_XDABR, 2, 0, dabr,
H_DABRX_KERNEL | H_DABRX_USER);
}
Index: linus-2.6/arch/powerpc/platforms/pseries/lpar.c
===================================================================
--- linus-2.6.orig/arch/powerpc/platforms/pseries/lpar.c 2006-09-10
00:17:48.000000000 +0200
+++ linus-2.6/arch/powerpc/platforms/pseries/lpar.c 2006-09-10
00:18:10.000000000 +0200
@@ -48,11 +48,6 @@
#define DBG_LOW(fmt...) do { } while(0)
#endif
-/* in hvCall.S */
-EXPORT_SYMBOL(plpar_hcall);
-EXPORT_SYMBOL(plpar_hcall9);
-EXPORT_SYMBOL(plpar_hcall_norets);
-
extern void pSeries_find_serial_port(void);
^ permalink raw reply
* Re: [RFC] inline hypercall implementation for pseries
From: Arnd Bergmann @ 2006-09-10 0:31 UTC (permalink / raw)
To: linuxppc-dev; +Cc: paulus, anton
In-Reply-To: <200609100042.54291.arnd@arndb.de>
T24gU3VuZGF5IDEwIFNlcHRlbWJlciAyMDA2IDAwOjQyLCBBcm5kIEJlcmdtYW5uIHdyb3RlOgo+
ICugoKCgoKCgLyogZ2V0IHRpbWUgYW5kIFBVUlIgc25hcHNob3RzIGFmdGVyIGhjYWxsICovCj4g
K6CgoKCgoKBtZnRioKCgoHIxNKCgoKCgoKCgoKCgoKCgoKCgoKCgoC8qIHRpbWViYXNlIGFmdGVy
ICovCj4gK6CgoKCgoKBzdWJmoKCgoHIxNSxyMTUscjE0oKCgoKCgoKCgoKCgoC8qIHRpbWUgZGVs
dGEgKi8KPiArQkVHSU5fRlRSX1NFQ1RJT04KPiAroKCgoKCgoG1mc3ByoKCgcjE0LFNQUk5fUFVS
UqCgoKCgoKCgoKCgLyogUFVSUiBhZnRlciAqLwo+ICugoKCgoKCgc3ViZqCgoKByMTYscjE2LHIx
NKCgoKCgoKCgoKCgoKAvKiBkZWx0YSAqLwo+ICtFTkRfRlRSX1NFQ1RJT05fSUZDTFIoQ1BVX0ZU
Ul9QVVJSKQo+ICsKPiAroKCgoKCgoC8qIHVwZGF0ZSBzdGF0c6AqLwo+ICugoKCgoKCgbGSgoKCg
oKByMTQsSENBTExfU1RBVF9DQUxMUyhyMTMpIC8qIGNvdW50ICovCj4gK6CgoKCgoKBhZGRpoKCg
oHIxNCxyMTQsMQo+ICugoKCgoKCgc3RkoKCgoKByMTQsSENBTExfU1RBVF9DQUxMUyhyMTMpCj4g
K6CgoKCgoKBsZCCgIKAgoHIxNCxIQ0FMTF9TVEFUX1RCKHIxMymgoC8qIHRpbWViYXNlICovCj4g
K6CgoKCgoKBhZGSgoKCgoHIxNCxyMTQscjUKPiAroKCgoKCgoHN0ZKCgoKCgcjE0LEhDQUxMX1NU
QVRfVEIocjEzKQo+ICtCRUdJTl9GVFJfU0VDVElPTgo+ICugoKCgoKCgbGSgoKCgoKByMTQsSENB
TExfU1RBVF9QVVJSKHIxMykvKiBQVVJSICovCj4gK6CgoKCgoKBhZGSgoKCgoHIxNCxyMTQscjYK
PiAroKCgoKCgoHN0ZKCgoKCgcjE0LEhDQUxMX1NUQVRfUFVSUihyMTMpCj4gK0VORF9GVFJfU0VD
VElPTl9JRkNMUihDUFVfRlRSX1BVUlIpCgoKSG1tLCBzZWVtcyBJIGN1dCB0b28gbXVjaCB0aGVy
ZSwgaXQgc2hvdWxkIGF0IGxlYXN0IGNvbnRhaW4KYSBIVlNDIGluc3RydWN0aW9uLCBhZnRlciB0
aGUgZmlyc3QgRU5EX0ZUUl9TRUNUSU9OLiBJdCBtYXkKYWxzbyBiZSBiZXR0ZXIgdG8gdXNlIGhp
Z2hlciByZWdpc3RlcnMgaW5zdGVhZCBvZiByMTMuLi5yMTYuCgoJQXJuZCA8PjwK
^ permalink raw reply
* Re: 'make ARCH=ppc defconfig' failing for cross-compile
From: Christian @ 2006-09-10 6:15 UTC (permalink / raw)
To: Judith Lebzelter; +Cc: linuxppc-dev
In-Reply-To: <20060909000512.GF9335@shell0.pdx.osdl.net>
On Fri, 8 Sep 2006, Judith Lebzelter wrote:
> I have been doing cross-compiles for ppc and powerpc on my i686 system.
> In order to do this I generate the .config file like this:
>
> make ARCH=ppc defconfig
> (or make ARCH=powerpc defconfig)
Seems like defconfig has been removed, because there are so many
sub-platforms for ppc:
$ ls arch/ppc/configs/*defconfig | wc -l
56
Just pick the defonfig for your platform, for my PReP that'd be:
$ make ARCH=ppc CROSS_COMPILE=powerpc-604-linux-gnu- prep_defconfig
HTH,
Christian.
--
BOFH excuse #383:
Your processor has taken a ride to Heaven's Gate on the UFO behind Hale-Bopp's comet.
^ permalink raw reply
* Stupid Telnet Question
From: Martin, Tim @ 2006-09-10 18:07 UTC (permalink / raw)
To: linuxppc-embedded
I'm using ELDK 4.0 on a custom PPC74xx board, and NFS mounting the root
file system. When I use the default NFS directory (e.g.
/opt/eldk_4.0/ppc_74xx) read-write, I can telnet into the board fine
(after modifying /etc/xinetd.d/telnet of course).
But this default directory is overkill for my future needs, so I'd like
to use a smaller root file system (but still NFS mount it). As a start,
I looked at the ramdisk in ppc_74xx/images. I unzipped the ramdisk, and
NFS mounted that as the root file system.
I'd also like to have the root file system mounted read-only. So I
attempted to fix all the obvious problems I ran into with mounting ELDK
ramdisk filesystem read-only. This consisted of:
1) "mount -n" ing everything that needed to be mounted, so /etc/mtab
wasn't updated
2) Creating a tmpfs /tmp ramdisk
3) Symlinking /var to /tmp/var, so I can run syslog
4) Symlinking /dev to /tmp/dev, so I can mknod devices in the /etc/rc.sh
script. For starters, I just copied the contents of ELDK_MAKEDEV into
that script, but I will prune it down as I find device files I don't
need. This way the devices can be read-write.
5) Putting those same devices in the /tmp/dev directory so that I could
solve the "Unable to open initial console" chicken-egg problem of no
device files being present when the root fs is mounted before the rc.sh
script runs.
The above steps work in-so-far as I can boot the board and work from the
serial console. Now I'd like to get telnet working. When I just telnet
locally from the serial console to the board (using the loopback IP
127.0.0.1) the telnet daemon connects, but the login program doesn't
give me a chance to type a username or login. =20
Question: What stupid thing have I done to cause this and how can I fix
it?
-------------------------------------------------
This is what my console session looks like:
# telnet 127.0.0.1
Entering character mode
Escape character is '^]'.
Linux 2.6.14 (172.16.5.11) (17:13 on Tuesday, 22 November 2011)
Login incorrect
Login incorrect
Login incorrect
Login incorrect
Connection closed by foreign host.
-------------------------------------------------
And here's what syslog is saying:
Nov 22 17:15:08 172 authpriv.info xinetd[1025]: START: telnet pid=3D1037
from=3D172.16.1.199
Nov 22 17:15:08 172 authpriv.notice login: FAILED LOGIN 1 FROM
172.16.1.199 FOR (null), Authentication failure
Nov 22 17:15:08 172 authpriv.notice login: FAILED LOGIN 2 FROM
172.16.1.199 FOR (null), Authentication failure
Nov 22 17:15:08 172 authpriv.notice login: FAILED LOGIN 3 FROM
172.16.1.199 FOR (null), Authentication failure
Nov 22 17:15:08 172 authpriv.notice login: FAILED LOGIN SESSION FROM
172.16.1.199 FOR (null), Authentication faie
^ permalink raw reply
* Unable to boot kernel 2.6 from u-boot 1.1.4 in Xilinx ML403
From: steve.alexander @ 2006-09-11 3:36 UTC (permalink / raw)
To: linuxppc-embedded
Wolfgang, Aleck,
I think this patch
http://ozlabs.org/pipermail/linuxppc-embedded/2006-August/023912.html
explains the inability to use u-boot for the ml403 (and ml3xx) for the
2.6 kernel.
-SteveA
^ permalink raw reply
* Re: Stupid Telnet Question
From: Ben Warren @ 2006-09-11 4:49 UTC (permalink / raw)
To: Martin, Tim, linuxppc-embedded
In-Reply-To: <821B2170E9E7F04FA38DF7EC21DE4871064A53C4@VCAEXCH01.hq.corp.viasat.com>
Tim,
--- "Martin, Tim" <tim.martin@viasat.com> wrote:
<snip>
> When I just telnet
> locally from the serial console to the board (using
> the loopback IP
> 127.0.0.1) the telnet daemon connects, but the login
> program doesn't
> give me a chance to type a username or login.
>
> Question: What stupid thing have I done to cause
> this and how can I fix
> it?
>
> -------------------------------------------------
> This is what my console session looks like:
>
> # telnet 127.0.0.1
>
> Entering character mode
> Escape character is '^]'.
>
>
> Linux 2.6.14 (172.16.5.11) (17:13 on Tuesday, 22
> November 2011)
>
> Login incorrect
>
> Login incorrect
>
> Login incorrect
>
>
> Login incorrect
> Connection closed by foreign host.
>
> -------------------------------------------------
> And here's what syslog is saying:
>
> Nov 22 17:15:08 172 authpriv.info xinetd[1025]:
> START: telnet pid=1037
> from=172.16.1.199
> Nov 22 17:15:08 172 authpriv.notice login: FAILED
> LOGIN 1 FROM
> 172.16.1.199 FOR (null), Authentication failure
For security reasons, Telnet is typically set up so
that you can't log in using 'root'. This is because
the data channel isn't encrypted so passwords are
easily compromised. If you don't have any other users
set up, it will give the behaviour that you're seeing.
It's been a while since I've done this, but I think
you need to edit /etc/xinetd.d/telnet to allow root
use. Or add a user. Or install SSH.
cheers,
Ben
^ permalink raw reply
* Re: Perhaps git-update-server-info needs to be run on .../paulus/powerpc.git?
From: Paul Mackerras @ 2006-09-11 8:25 UTC (permalink / raw)
To: Kim Phillips, linuxppc-dev
In-Reply-To: <17625.18896.977702.640753@cargo.ozlabs.ibm.com>
Paul Mackerras writes:
> Kim Phillips writes:
>
> > Linus' tree clones fine, paulus' doesn't:
>
> Try now...
>
> Paul.
Oops, mail system error, ignore me...
Paul.
^ permalink raw reply
* Re: MPC8360E USB Host Controller Driver
From: Alex Zeffertt @ 2006-09-11 9:08 UTC (permalink / raw)
To: Dan Gora; +Cc: linuxppc-embedded
In-Reply-To: <4779de450609081809g33187e96vf2754af95c7e8514@mail.gmail.com>
Dan Gora wrote:
>>> Could you give a direct link ? I've been browsing around the
>>> Freescale website for an hour, downloaded hundreds of
>>> megabytes of archives but haven't been able to find the
>>> MPC8360E USB Linux driver.
>>>
>>> Laurent Pinchart
>
> Hi Laurent,
>
> I believe that I recall seeing the USB drivers in the "MPC8360E Device
> Drivers - Release 1.1 GPL ", accessible from the main 8360 page.
>
> http://www.freescale.com/files/netcomm/software/device_drivers/MPC8360EGPLDRV.zip
>
These don't look like Linux drivers to me. (Although they are GPL so you could
port them to Linux if you have the inclination.)
Alex
^ permalink raw reply
* missing release_region in i8042_exit
From: Olaf Hering @ 2006-09-11 9:30 UTC (permalink / raw)
To: linuxppc-dev
Does anyone know why 64bit kernels do not call release_region in
i8042_platform_exit? Why is it allowed on 32bit kernels?
drivers/input/serio/i8042-io.h
83 static inline void i8042_platform_exit(void)
84 {
85 #if !defined(__sh__) && !defined(__alpha__) && !defined(CONFIG_PPC64)
86 release_region(I8042_DATA_REG, 16);
87 #endif
88 }
^ permalink raw reply
* upgrade cramfs rootfs while running
From: ganesh subramonian @ 2006-09-11 9:39 UTC (permalink / raw)
To: linuxppc-embedded
i have a cramfs image, which is my rootfs(/ partition)
on flash. in an earlier thread i found some replies
saying that upgrading it while mounted was prone to
errors. however if i am doing the upgrade only in my
shutdown scripts (so that most applications are killed
by this time) like this:
mount -o loop -t cramfs rootfs.img /tmp/somedir
eraseall /dev/mtd2
cp rootfs.img /dev/mtd2
export PATH=/tmp/somedir/bin:/tmp/somedir/sbin...
export LD_LIBRARY_PATH=/tmp/somedir/lib
reboot
is there anything that could go wrong? All further
programs(with their libs) should be executed from the
loop mounted rootfs.
or else can i do something like
mount -o loop ...
cd /tmp/somedir
pivot_root . tmp
eraseall, copy
reboot
Since i am upgrading just before reboot only these
scripts would be running. Is there a risk in
either/both of these methods.
Thanks
Ganesh
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply
* [PATCH] Prevent legacy io access on pmac
From: Olaf Hering @ 2006-09-11 11:53 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev
The ppc32 common config runs also on PReP/CHRP, which uses PC style IO
devices. The probing is bogus, it crashes or floods dmesg.
ppc can boot one single binary on prep, chrp and pmac boards.
ppc64 can boot one single binary on pseries and G5 boards.
pmac has no legacy io, probing for PC style legacy hardware leads to a
hard crash:
* add check for parport_pc, exit on pmac.
32bit chrp has no ->check_legacy_ioport, the probe is always called.
64bit chrp has check_legacy_ioport, check for a "parallel" node
* add check for isapnp, only PReP boards may have real ISA slots.
32bit PReP will have no ->check_legacy_ioport, the probe is always called.
* update code in i8042_platform_init. Run ->check_legacy_ioport first, always
call request_region. No functional change. Remove whitespace before i8042_reset init.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
arch/powerpc/platforms/pseries/setup.c | 6 ++++++
drivers/input/serio/i8042-io.h | 13 +++++--------
drivers/parport/parport_pc.c | 4 ++++
drivers/pnp/pnpbios/core.c | 8 ++++++++
include/asm-powerpc/io.h | 2 ++
5 files changed, 25 insertions(+), 8 deletions(-)
Index: linux-2.6.18-rc6/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- linux-2.6.18-rc6.orig/arch/powerpc/platforms/pseries/setup.c
+++ linux-2.6.18-rc6/arch/powerpc/platforms/pseries/setup.c
@@ -401,6 +401,12 @@ static int pSeries_check_legacy_ioport(u
return -ENODEV;
of_node_put(np);
break;
+ case PARALLEL_BASE:
+ np = of_find_node_by_type(NULL, "parallel");
+ if (np == NULL)
+ return -ENODEV;
+ of_node_put(np);
+ break;
}
return 0;
}
Index: linux-2.6.18-rc6/drivers/input/serio/i8042-io.h
===================================================================
--- linux-2.6.18-rc6.orig/drivers/input/serio/i8042-io.h
+++ linux-2.6.18-rc6/drivers/input/serio/i8042-io.h
@@ -67,25 +67,22 @@ static inline int i8042_platform_init(vo
* On some platforms touching the i8042 data register region can do really
* bad things. Because of this the region is always reserved on such boxes.
*/
-#if !defined(__sh__) && !defined(__alpha__) && !defined(__mips__) && !defined(CONFIG_PPC_MERGE)
- if (!request_region(I8042_DATA_REG, 16, "i8042"))
- return -EBUSY;
-#endif
-
- i8042_reset = 1;
-
#if defined(CONFIG_PPC_MERGE)
if (check_legacy_ioport(I8042_DATA_REG))
return -EBUSY;
+#endif
+#if !defined(__sh__) && !defined(__alpha__) && !defined(__mips__)
if (!request_region(I8042_DATA_REG, 16, "i8042"))
return -EBUSY;
#endif
+
+ i8042_reset = 1;
return 0;
}
static inline void i8042_platform_exit(void)
{
-#if !defined(__sh__) && !defined(__alpha__) && !defined(CONFIG_PPC64)
+#if !defined(__sh__) && !defined(__alpha__)
release_region(I8042_DATA_REG, 16);
#endif
}
Index: linux-2.6.18-rc6/drivers/parport/parport_pc.c
===================================================================
--- linux-2.6.18-rc6.orig/drivers/parport/parport_pc.c
+++ linux-2.6.18-rc6/drivers/parport/parport_pc.c
@@ -3374,6 +3374,10 @@ __setup("parport_init_mode=",parport_ini
static int __init parport_pc_init(void)
{
+#if defined(CONFIG_PPC_MERGE)
+ if (check_legacy_ioport(PARALLEL_BASE))
+ return -EBUSY;
+#endif
if (parse_parport_params())
return -EINVAL;
Index: linux-2.6.18-rc6/include/asm-powerpc/io.h
===================================================================
--- linux-2.6.18-rc6.orig/include/asm-powerpc/io.h
+++ linux-2.6.18-rc6/include/asm-powerpc/io.h
@@ -11,6 +11,8 @@
/* Check of existence of legacy devices */
extern int check_legacy_ioport(unsigned long base_port);
+#define PARALLEL_BASE 0x378
+#define PNPBIOS_BASE 0xf000 /* only relevant for PReP */
#ifndef CONFIG_PPC64
#include <asm-ppc/io.h>
Index: linux-2.6.18-rc6/drivers/pnp/pnpbios/core.c
===================================================================
--- linux-2.6.18-rc6.orig/drivers/pnp/pnpbios/core.c
+++ linux-2.6.18-rc6/drivers/pnp/pnpbios/core.c
@@ -526,6 +526,10 @@ static int __init pnpbios_init(void)
{
int ret;
+#if defined(CONFIG_PPC_MERGE)
+ if (check_legacy_ioport(PNPBIOS_BASE))
+ return -ENODEV;
+#endif
if (pnpbios_disabled || dmi_check_system(pnpbios_dmi_table)) {
printk(KERN_INFO "PnPBIOS: Disabled\n");
return -ENODEV;
@@ -575,6 +579,10 @@ subsys_initcall(pnpbios_init);
static int __init pnpbios_thread_init(void)
{
+#if defined(CONFIG_PPC_MERGE)
+ if (check_legacy_ioport(PNPBIOS_BASE))
+ return 0;
+#endif
if (pnpbios_disabled)
return 0;
#ifdef CONFIG_HOTPLUG
^ permalink raw reply
* Re: I2C on MPC8272...
From: Vitaly Bordug @ 2006-09-11 11:57 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <BE8B3EECA608414FB163FBA4576FCEBD432009@EXNY.us.corp.aacisd.com>
On Fri, 8 Sep 2006 13:00:58 -0400
"Kuffner Cory" <CKuffner@LIO.AACISD.com> wrote:
> Hello all,
>
> Does anyone know how to use the I2C module for the MPC8272?? We are attempting to enable it by following code written for a bareboard system and converting it into a kernel module (2.6.11 Kernel), but nothing happens on our SDA and SCL data lines. The parameter ram is kind of tricky to set up, but I beleive we have everything pointing where it should. To write to the IMM we are using the ioremap function with ioread and iowrite, we can write to the ports so I don't think there is an issue writing to memory, but I'm new to embedded linux. Has anyone ever used the I2C controller in one of freescale's chips or just a good understanding of I2C modules in embedded linux?? I think all the chips have the same I2C interface....so it should be the same set up for MPC8250, 8255, 8260, etc.
>
I am recalling i2c functional on 8272, but no other details unfortunately. IIRC, i2c-mpc.c did the magic with some minor intervention.
Barely, to access immr it is ioremapped early, and cpm2_immr-> holds i2c controller, pram and other pleasant stuff. And, I am recalling i2c on 8540 working fine right out of the box...
--
Sincerely,
Vitaly
^ permalink raw reply
* Re: [2.6.19 PATCH 0/7] ehea: IBM eHEA Ethernet Device Driver
From: Jeff Garzik @ 2006-09-11 13:12 UTC (permalink / raw)
To: Jan-Bernd Themann
Cc: Thomas Klein, Jan-Bernd Themann, netdev, linux-kernel, linux-ppc,
Christoph Raisch, Marcus Eder
In-Reply-To: <200609041236.32279.ossthema@de.ibm.com>
Jan-Bernd Themann wrote:
> Hi,
>
> this is our current version of the IBM eHEA Ethernet Device Driver. We added
> minor bug fixes and changes to the last version.
>
> Jeff, this driver has been discussed on the netdev, linux-ppc and
> kernel mailing list. We didn't receive any further comments since our previous
> patch set from August 23. Please consider our driver for
> upstream inclusion.
>
> Thanks,
>
> Jan-Bernd Themann & Christoph Raisch
>
> Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
> Changelog-by: Jan-Bernd Themann <themann@de.ibm.com>
Email me an all-in-one-email patch, please.
Jeff
^ permalink raw reply
* Reminder: [PATCH] Add new, missing argument to of_irq_map_raw().
From: Jon Loeliger @ 2006-09-11 13:29 UTC (permalink / raw)
To: linuxppc-dev
Paul,
I just wanted to check with you that this patch isn't
slipping through the cracks as we close out 2.6.18.
Without this, the 86xx build is broken, of course.
Thanks!
jdl
------- Forwarded Message
From: Jon Loeliger <jdl@freescale.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH] Add new, missing argument to of_irq_map_raw().
Date: Fri, 01 Sep 2006 10:17:20 -0500
Message-Id: <E1GJAlk-00053S-3U@jdl.com>
Ben speaks; we follow.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
- ---
Paul,
This patch is needed in the 2.6.18 release for 86xx.
Ben's recent changes to of_irq_map_raw() missed one caller.
This patch cleans that up.
Thanks,
jdl
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 4a33d95..cdaf668 100644
- --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -154,7 +154,7 @@ get_pci_irq_from_of(struct pci_controlle
laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(slot, 0) << 8);
laddr[1] = laddr[2] = 0;
- - of_irq_map_raw(hosenode, &pin, laddr, &oirq);
+ of_irq_map_raw(hosenode, &pin, 1, laddr, &oirq);
DBG("mpc86xx_hpcn: pci irq addr %x, slot %d, pin %d, irq %d\n",
laddr[0], slot, pin, oirq.specifier[0]);
return oirq.specifier[0];
- --
1.4.2.rc2.g85d6c-dirty
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev
------- End of Forwarded Message
^ permalink raw reply
* Re: [PATCH] Prevent legacy io access on pmac
From: Olaf Hering @ 2006-09-11 15:17 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev
In-Reply-To: <20060911115354.GA23884@aepfle.de>
On Mon, Sep 11, Olaf Hering wrote:
> * add check for parport_pc, exit on pmac.
How do I allow parport on PCI cards?
^ permalink raw reply
* Re: [PATCH] Prevent legacy io access on pmac
From: Segher Boessenkool @ 2006-09-11 15:30 UTC (permalink / raw)
To: Olaf Hering; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20060911151730.GA25244@aepfle.de>
>> * add check for parport_pc, exit on pmac.
>
> How do I allow parport on PCI cards?
Use the parport_serial driver... cards that are fixed at the
legacy address probably won't work at all on a PowerMac, the PCI
bridges would have to be set up specially and you'll run into all
kinds of problems.
Cards that have a parport with a configurable base address work
fine in a PowerMac.
Segher
^ permalink raw reply
* Re: Kernel panic: kernel access of bad area pc
From: Will Schmidt @ 2006-09-11 15:37 UTC (permalink / raw)
To: ppc64; +Cc: linuxppc-dev
In-Reply-To: <200609081532.59764.ppc64@storix.com>
On Fri, 2006-08-09 at 15:32 -0700, ppc64@storix.com wrote:
> I have a process to create tape boot images by combining the kernel and initrd
> into a zImage. The process works for 2.4 (RHEL 3.3) & 2.6 kernels (SLES9 &
> RHEL4). However on SLES8 ppc64 the kernel panics with "error kernel access of
> bad area pc".
> Anyone have an idea what is causing the failure? The error message appears to
> be pretty generic.
The exception is a "TRAP: 0600" which is an alignment interrupt.
the trap occurred at NIP: C000000000085874
Get an objdump of your kernel, (or drop into xmon/kdb and use the
disassembler commands) and see what instruction lives at that NIP
address, and which registers it is referencing. (Then its a matter of
finding out why the registers have bad data in them).
(You probally have already done this, but if not... ) If you're booting
off of tape in this instance, may want to try booting off of disk, and
doing some tape operations after successful boot, to ensure the driver
is all OK.
-Will
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* Any PPC system with working USB 2.0 host
From: Jamie Guinan @ 2006-09-11 15:51 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
I'm trying to get ahold of a low-power, small form factor system with
support for USB 2.0 hi-speed host. PPC would appear to be a good
solution for this.
I've tried 2 well-known embedded board vendors, and despite having USB
2.0 capable hardware, neither could provide a working solution. The
"BSPs" from both vendors depend on out-of-tree patches, so I won't
bother this list with details.
Does USB 2.0 host on the KuroBox in fact work, with hi-speed devices?
Any other boards that are known to work?
-Jamie
^ permalink raw reply
* Re: Kernel panic: kernel access of bad area pc
From: Olaf Hering @ 2006-09-11 16:01 UTC (permalink / raw)
To: ppc64; +Cc: linuxppc-dev
In-Reply-To: <200609081532.59764.ppc64@storix.com>
On Fri, Sep 08, ppc64@storix.com wrote:
> I have a process to create tape boot images by combining the kernel and initrd
> into a zImage. The process works for 2.4 (RHEL 3.3) & 2.6 kernels (SLES9 &
> RHEL4). However on SLES8 ppc64 the kernel panics with "error kernel access of
> bad area pc".
What do you use to create the zImage header?
Also, does the SP3 kernel work any better? The reiserfs mem corruption
has likely has likely the same cause as the ramdisk corruption.
^ permalink raw reply
* Re: [PATCH] Prevent legacy io access on pmac
From: Olaf Hering @ 2006-09-11 15:52 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev, Daniel Quinlan, Vojtech Pavlik
In-Reply-To: <20060911115354.GA23884@aepfle.de>
On Mon, Sep 11, Olaf Hering wrote:
>
> The ppc32 common config runs also on PReP/CHRP, which uses PC style IO
> devices. The probing is bogus, it crashes or floods dmesg.
>
> ppc can boot one single binary on prep, chrp and pmac boards.
> ppc64 can boot one single binary on pseries and G5 boards.
> pmac has no legacy io, probing for PC style legacy hardware leads to a
> hard crash:
drivers/input/touchscreen/mk712.c pokes at 0x262 and other IO ports.
A comment in the driver suggests that it is only used on Gateway
computers. Should the driver be X86 only?
^ permalink raw reply
* RE: Any PPC system with working USB 2.0 host
From: Steven Blakeslee @ 2006-09-11 15:54 UTC (permalink / raw)
To: Jamie Guinan, linuxppc-embedded
> Any other boards that are known to work?
>=20
AMCC 440EPx. Freescale 8343. Both have Linux support with USB 2.0
host.
^ permalink raw reply
* Re: [PATCH 1/1] bootwrapper: add flat device tree support code
From: Jon Loeliger @ 2006-09-11 17:27 UTC (permalink / raw)
To: Hollis Blanchard; +Cc: linuxppc-dev
In-Reply-To: <1157726787.26967.7.camel@basalt.austin.ibm.com>
On Fri, 2006-09-08 at 09:46, Hollis Blanchard wrote:
> On Thu, 2006-09-07 at 20:46 -0700, Mark A. Greer wrote:
> > --- /dev/null
> > +++ b/arch/powerpc/boot/flatdevtree.c
> > @@ -0,0 +1,628 @@
> > +/*
> > + * DO NOT EDIT THIS FILE!!
> > + *
> > + * The master copy is kept in a mercurial repository that you can clone:
> > + * "hg clone http://unsanctioned.org/flatdevtree/hgweb.py flatdevtree"
> > + * Please send patches to Hollis Blanchard <hollisb@us.ibm.com> and
> > + * CC: <Linuxppc-dev@ozlabs.org>
> > + *
>
> Actually I'm not intending for that to be a long-term URL. If we need
> something permanent for this file, I can set something up on
> penguinppc.org...
>
> (NAK)
>
> -Hollis
Wasn't there a notion of even combining this with
the DTC code base directly? I haven't seen any
patches or motion down this line, though...?
Thanks,
jdl
^ permalink raw reply
* Re: [PATCH 1/1] bootwrapper: add flat device tree support code
From: Jon Loeliger @ 2006-09-11 18:39 UTC (permalink / raw)
To: Hollis Blanchard; +Cc: linuxppc-dev
In-Reply-To: <1158000245.24546.24.camel@basalt.austin.ibm.com>
On Mon, 2006-09-11 at 13:44, Hollis Blanchard wrote:
> That's certainly a good place the new code could be applied. Of course,
> I haven't sent patches to uboot, iseries boot code, kexec, or any other
> number of places either, and don't really plan to. If those areas have
> problems, they can switch to the consolidated codebase then (rather than
> bugfixing the non-consolidated code).
I'm worried about the code-duplication factor here...
> Why, are you going to convert DTC?
I'm not opposed to accepting patches. :-)
jdl
^ permalink raw reply
* Re: [PATCH 1/1] bootwrapper: add flat device tree support code
From: Hollis Blanchard @ 2006-09-11 18:44 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev
In-Reply-To: <1157995667.27129.148.camel@cashmere.sps.mot.com>
On Mon, 2006-09-11 at 12:27 -0500, Jon Loeliger wrote:
>
> Wasn't there a notion of even combining this with
> the DTC code base directly? I haven't seen any
> patches or motion down this line, though...?
That's certainly a good place the new code could be applied. Of course,
I haven't sent patches to uboot, iseries boot code, kexec, or any other
number of places either, and don't really plan to. If those areas have
problems, they can switch to the consolidated codebase then (rather than
bugfixing the non-consolidated code).
Why, are you going to convert DTC?
-Hollis
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox