From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from web92013.mail.cnb.yahoo.com (web92013.mail.cnb.yahoo.com [203.209.230.60]) by ozlabs.org (Postfix) with SMTP id B2026DDEF8 for ; Wed, 9 Jan 2008 00:40:38 +1100 (EST) Date: Tue, 8 Jan 2008 21:40:32 +0800 (CST) From: diak sim Subject: port linux-2.6 to ml410, problem on disabling external interrupts To: linuxppc-embedded@ozlabs.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-2000563917-1199799632=:44671" Message-ID: <486779.44671.qm@web92013.mail.cnb.yahoo.com> List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --0-2000563917-1199799632=:44671 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable there is a strange problem.=0A=0Amy platform is ml410, port linux-2.6.23rc2= vertex kernel to it. the toolchain is generated by crosstool. the cross-gc= c is powerpc-405-linux-gnu-gcc 4.0.2.when i complete the kernel compiling a= nd download it to the board to run, there are a few questions.=0A=0Aat firs= t, i can't see anything output after "Now booting the kernel". through debu= gging i found that init_IRQ() function in init/main.c can't run to the end.= so i cut it and rerun the kernel. it runs so long until the rootfs is moun= ted. the problem occurs in executing /linuxrc. it says "init has generated = signal 4 but has no handler for it". the reason, i've known, is that i disa= bled the init_IRQ() function. then i get down to search for the wrong point= .=0A=0Athe init_IRQ() called in init/main.c is defined in arch/powerpc/kern= el/irq.c. init_IRQ() calls ppc_md.init_IRQ(). ppc_md is a variable of "stru= ct machdep_calls". the ppc_md.init_IRQ is evaluated in arch/ppc/syslib/ppc4= xx_setup.c. the statement is ppc_md.init_IRQ =3D ppc4xx_init_IRQ. and the p= pc4xx_init_IRQ() calls ppc4xx_pic_init() defined in arch/ppc/syslib/xilinx_= pic.c.=0A=0Atracing into ppc4xx_pic_init() function, i located the problem = at "intc_out_be32(intc + IER, 0)". "intc_out_be32" is a macro as the real f= orm "out_be32((addr), (mask))". the out_be32() is a function defined in inc= lude/asm-ppc/io.h.=0A=0Aextern inline void out_be32(volatile unsigned __iom= em *addr, int val)=0A{=0A __asm__ __volatile__("sync; stw%U0%X0 %1,%= 0" : "=3Dm" (*addr) : "r" (val));=0A}=0A=0Ai replace "intc_out_be32(intc + = IER, 0)" with the assemble statements and rerun, nothing changes.=0A=0AXPS'= s debugger points out that the kernel stop in _delay() function. but there = is not any call to this function. only the 2 assemble statements are there.= =0A=0Adividing the "sync" and "stw" into 2 __asm__ ones, "sync" is passed b= ut "stw" makes a strange _delay() calling.=0A=0Aso strange it is, who can h= elp me?=0A=0Athanks.=0A=0A=0A=0A=0A __________________________________= _________________________ =0A=E9=9B=85=E8=99=8E=E9=82=AE=E7=AE=B1=E4=BC=A0= =E9=80=92=E6=96=B0=E5=B9=B4=E7=A5=9D=E7=A6=8F=EF=BC=8C=E4=B8=AA=E6=80=A7=E8= =B4=BA=E5=8D=A1=E9=80=81=E4=BA=B2=E6=9C=8B=EF=BC=81 =0Ahttp://cn.mail.yahoo= .com/gc/index.html?entry=3D5&souce=3Dmail_mailletter_tagline --0-2000563917-1199799632=:44671 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
there is a strange problem.

my platform is ml41= 0, port linux-2.6.23rc2 vertex kernel to it. the toolchain is generated by = crosstool. the cross-gcc is powerpc-405-linux-gnu-gcc 4.0.2.when i complete= the kernel compiling and download it to the board to run, there are a few = questions.

at first, i can't see anything output after "Now booting = the kernel". through debugging i found that init_IRQ() function in init/mai= n.c can't run to the end. so i cut it and rerun the kernel. it runs so long= until the rootfs is mounted. the problem occurs in executing /linuxrc. it = says "init has generated signal 4 but has no handler for it". the reason, i= 've known, is that i disabled the init_IRQ() function. then i get down to s= earch for the wrong point.

the init_IRQ() called in init/main.c is defined in arch/powerpc/kernel/irq.c. init_IRQ() calls ppc_md.init_IRQ(= ). ppc_md is a variable of "struct machdep_calls". the ppc_md.init_IRQ is e= valuated in arch/ppc/syslib/ppc4xx_setup.c. the statement is ppc_md.init_IR= Q =3D ppc4xx_init_IRQ. and the ppc4xx_init_IRQ() calls ppc4xx_pic_init() de= fined in arch/ppc/syslib/xilinx_pic.c.

tracing into ppc4xx_pic_init(= ) function, i located the problem at "intc_out_be32(intc + IER, 0)". "intc_= out_be32" is a macro as the real form "out_be32((addr), (mask))". the out_b= e32() is a function defined in include/asm-ppc/io.h.

extern inline v= oid out_be32(volatile unsigned __iomem *addr, int val)
{
  =       __asm__ __volatile__("sync; stw%U0%X0 %1,%0"= : "=3Dm" (*addr) : "r" (val));
}

i replace "intc_out_be32(intc += IER, 0)" with the assemble statements and rerun, nothing changes.

X= PS's debugger points out that the kernel stop in _delay() function. but there is not any call to this function. only the 2 assemble statements are= there.

dividing the "sync" and "stw" into 2 __asm__ ones, "sync" is= passed but "stw" makes a strange _delay() calling.

so strange it is= , who can help me?

thanks.

=0A=0A=0A
=E9=9B=85=E8=99=8E=E9=82=AE=E7=AE=B1=E4=BC=A0=E9=80= =92=E6=96=B0=E5=B9=B4=E7=A5=9D=E7=A6=8F=EF=BC=8C=E4=B8=AA=E6=80=A7=E8=B4=BA= =E5=8D=A1=E9=80=81=E4=BA=B2=E6=9C=8B=EF=BC=81 --0-2000563917-1199799632=:44671--