LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Can't run 8M ramdisk at 2.4.20 linux
From: 徐小威的EMAIL @ 2005-09-08  7:06 UTC (permalink / raw)
  To: linuxppc-embedded

Hi All:

    I build a 8M ramdisk file, it  works fine at 2.4.25 linux but fail
in 2.4.20.Why?
I do follow command to make 8M ramdsik, all files in the ramdisk is from
pRamdisk (download from denx ftp site).

dd if=/dev/zero of=new_ramdisk bs=1024k count=8
/sbin/mke2fs -F -m0 new_ramdisk
/sbin/tune2fs -c 0 new_ramdisk

RAMDISK: Compressed image found at block 0
Freeing initrd memory: 1434k freed
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 56k init
attempt to access beyond end of device
01:00: rw=0, want=1647259183, limit=16384
attempt to access beyond end of device
01:00: rw=0, want=1647259183, limit=16384
attempt to access beyond end of device
01:00: rw=0, want=1647259183, limit=16384
attempt to access beyond end of device
01:00: rw=0, want=1647259183, limit=16384
Kernel panic: No init found.  Try passing init= option to kernel.
 <0>Rebooting in 180 seconds..

^ permalink raw reply

* Re: BDI2000 with PPC405EP
From: Eugene Surovegin @ 2005-09-08  6:31 UTC (permalink / raw)
  To: Albert David; +Cc: linuxppc-embedded
In-Reply-To: <61124de7050907230383654a6@mail.gmail.com>

On Thu, Sep 08, 2005 at 11:33:53AM +0530, Albert David wrote:
> Friends,
> I have been trying to find a solution to fix "PPC: timeout while
> waiting for freeze" for my custom board.
> BDI2000 keeps resetting the system with the following message...
> 
> TARGET: processing user reset request
> TARGET: resetting target passed
> TARGET: processing target startup ....
> *** TARGET: core #0 startup failed # PPC: timeout while waiting for freeze
> TARGET: target will be restarted in 10 sec
> 
> I tried all the possible solutions provided at
> http://www.ultsol.com/faq-P206.htm for this perticular behaviour but
> the problem remains same!
> 
> I have ensured that my Board's JTAG interface is properly working by
> boundary scanning the pins of PPC405EP using UniversalScan software
> with Altera-ByteBlaster MV.
> 
> for your information: twice i could succeed connecting BDI2000 with my
> target! somehow it happen to work while i was trying to execute low
> level JTAG commands such as 'rir' rdr'  and then after exiting(JTAG
> command shell of BDI) it worked, but there is no consistency!
> 
> looks like my cpu core is not halting after asserting HALT line.
> has anyone faced similar problem??

In _all_ cases I saw this problem it was a hw bug. Ask your hw 
engineers to help you. Start with the usual suspects: power, clocks, 
strapping, etc.

I don't think working boundary scan is an indication that hw design is 
OK.

-- 
Eugene

^ permalink raw reply

* BDI2000 with PPC405EP
From: Albert David @ 2005-09-08  6:03 UTC (permalink / raw)
  To: linuxppc-embedded

Friends,
I have been trying to find a solution to fix "PPC: timeout while
waiting for freeze" for my custom board.
BDI2000 keeps resetting the system with the following message...

TARGET: processing user reset request
TARGET: resetting target passed
TARGET: processing target startup ....
*** TARGET: core #0 startup failed # PPC: timeout while waiting for freeze
TARGET: target will be restarted in 10 sec

I tried all the possible solutions provided at
http://www.ultsol.com/faq-P206.htm for this perticular behaviour but
the problem remains same!

I have ensured that my Board's JTAG interface is properly working by
boundary scanning the pins of PPC405EP using UniversalScan software
with Altera-ByteBlaster MV.

for your information: twice i could succeed connecting BDI2000 with my
target! somehow it happen to work while i was trying to execute low
level JTAG commands such as 'rir' rdr'  and then after exiting(JTAG
command shell of BDI) it worked, but there is no consistency!

looks like my cpu core is not halting after asserting HALT line.
has anyone faced similar problem??

please help!
BR,
Albert David.

^ permalink raw reply

* Re: [PATCH] add big endian version of ld_/st_ IO access macros and convert main 8xx code to use it
From: Paul Mackerras @ 2005-09-08  4:27 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-ppc-embedded
In-Reply-To: <20050908005821.GB8882@dmt.cnet>

Marcelo Tosatti writes:

> eieio/isync are not required. There's no need to execute redudant
> instructions and occupy kernel space.

Given how long it takes to access I/O devices, I don't believe an
extra instruction or two is going to make a measurable difference.
Feel free to show me measurements proving me wrong, of course... :)

Paul.

^ permalink raw reply

* Re: [PATCH] ppc32: add CONFIG_HZ
From: Marcelo Tosatti @ 2005-09-08  1:04 UTC (permalink / raw)
  To: Tom Rini; +Cc: Andrew Morton, linuxppc-dev, Kumar Gala
In-Reply-To: <20050826213144.GE5541@smtp.west.cox.net>

On Fri, Aug 26, 2005 at 02:31:44PM -0700, Tom Rini wrote:
> On Fri, Aug 26, 2005 at 04:13:04PM -0400, Dan Malek wrote:
> > 
> > On Aug 26, 2005, at 3:15 PM, Kumar Gala wrote:
> > 
> > >While ppc32 has the CONFIG_HZ Kconfig option, it wasnt actually being
> > >used. Connect it up and set all platforms to 250Hz.  This pretty much
> > >mimics the ppc64 patch from Anton Blanchard.
> > 
> > Why do we keep cranking up this clock frequency?  Do we really need
> > it running that fast?  Is it time for someone with RTOS experience to
> > implement a real scheduled clock queue in Linux instead of just
> > wasting interrupts decrementing a counter waiting for the next
> > event to expire?  :-)  If the user "ticks" are still 100 Hz, don't we 
> > need
> > something that is an integer multiple of that for at least an attempt
> > at getting it close to what a user would request?
> 
> So 250 is supposed to be the best choice of power vs latency and such.
> But hey, there's nothing stopping us from setting all of the embedded
> configs back down to 100 :)

Yep. 

Kumar, can you please change your patch to make CONFIG_8xx use 100Hz?

There was a significant performance increase from doing that (vs 1000Hz)
on a 48Mhz 8xx with small cache.

^ permalink raw reply

* Re: [PATCH] add big endian version of ld_/st_ IO access macros and convert main 8xx code to use it
From: Benjamin Herrenschmidt @ 2005-09-08  1:14 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Paul Mackerras, linux-ppc-embedded
In-Reply-To: <20050908005135.GA8882@dmt.cnet>

> e is shared by all architectures. Doing something like
> 
> /*
>  * 8, 16 and 32 bit, big and little endian I/O operations, with barrier.
>  */
> extern inline int in_8(volatile unsigned char __iomem *addr)
> {
>         int ret;
> 
>         __asm__ __volatile__(
>                 "lbz%U1%X1 %0,%1;\n"
> #ifndef CONFIG_8xx
>                 "twi 0,%0,0;\n"
>                 "isync" : "=r" (ret) : "m" (*addr));
> #else
>                 : "=r" (ret) : "m" (*addr));
> #endif
>         return ret;
> }
> 
> Seems somewhat ugly?

Yes. You can work around that by macro-generating the functions with
different rules for different CPUs, or having the twi/isync be a
separate asm block that is itself in a macro or inline that gets defined
differently on 8xx

Ben.

^ permalink raw reply

* Re: [PATCH] add big endian version of ld_/st_ IO access macros and convert main 8xx code to use it
From: Marcelo Tosatti @ 2005-09-08  0:58 UTC (permalink / raw)
  To: Dan Malek; +Cc: Paul Mackerras, linux-ppc-embedded
In-Reply-To: <00a1f47bb2edbbc001c2267191aa36f0@embeddededge.com>

On Wed, Sep 07, 2005 at 08:42:42PM -0400, Dan Malek wrote:
> 
> On Sep 7, 2005, at 8:28 PM, Benjamin Herrenschmidt wrote:
> 
> >I'm not fan of the approach. You should use in_/out_ macros for IOs. If
> >you don't need eieio on 8xx , then just #ifdef it out of the
> >implementation of these.
> 
> Yeah, #ifdef :-)  That patch wouldn't go anywhere (well,
> to /dev/null perhaps).

Well, its easy to s/st/out/ - s/ld/in/, so its still a useful patch. ;)

> We can just use the in_/out_ macros that are there.  The eieio
> doesn't hurt anything on the 8xx.

eieio/isync are not required. There's no need to execute redudant
instructions and occupy kernel space.

^ permalink raw reply

* Re: [PATCH] add big endian version of ld_/st_ IO access macros and convert main 8xx code to use it
From: Marcelo Tosatti @ 2005-09-08  0:51 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Paul Mackerras, linux-ppc-embedded
In-Reply-To: <1126139332.29803.0.camel@gaston>

On Thu, Sep 08, 2005 at 10:28:52AM +1000, Benjamin Herrenschmidt wrote:
> On Wed, 2005-09-07 at 20:03 -0300, Marcelo Tosatti wrote:
> > Hi,
> > 
> > The following patch adds big endian version of ld_/st_ macros 
> > and converts core 8xx code to use them.
> > 
> > Other than making IO accesses explicit (which is a plus for
> > readability), a common set of macros provides a unified place for the
> > volatile flag to constraint compiler code reordering.
> > 
> > There are several unlucky places at the moment which lack the 
> > volatile flag.
> 
> I'm not fan of the approach. You should use in_/out_ macros for IOs. If
> you don't need eieio on 8xx , then just #ifdef it out of the
> implementation of these.

The reason for that is that in_/out_ are supposed to be the standard 
IO macros (conformance)? In practice most drivers using the std macros
can benefit from the change. 

A common routine is shared by all architectures. Doing something like

/*
 * 8, 16 and 32 bit, big and little endian I/O operations, with barrier.
 */
extern inline int in_8(volatile unsigned char __iomem *addr)
{
        int ret;

        __asm__ __volatile__(
                "lbz%U1%X1 %0,%1;\n"
#ifndef CONFIG_8xx
                "twi 0,%0,0;\n"
                "isync" : "=r" (ret) : "m" (*addr));
#else
                : "=r" (ret) : "m" (*addr));
#endif
        return ret;
}

Seems somewhat ugly?

^ permalink raw reply

* Re: [PATCH] add big endian version of ld_/st_ IO access macros and convert main 8xx code to use it
From: Benjamin Herrenschmidt @ 2005-09-08  0:55 UTC (permalink / raw)
  To: Dan Malek; +Cc: Paul Mackerras, linux-ppc-embedded
In-Reply-To: <00a1f47bb2edbbc001c2267191aa36f0@embeddededge.com>

On Wed, 2005-09-07 at 20:42 -0400, Dan Malek wrote:
> On Sep 7, 2005, at 8:28 PM, Benjamin Herrenschmidt wrote:
> 
> > I'm not fan of the approach. You should use in_/out_ macros for IOs. If
> > you don't need eieio on 8xx , then just #ifdef it out of the
> > implementation of these.
> 
> Yeah, #ifdef :-)  That patch wouldn't go anywhere (well,
> to /dev/null perhaps).

Heh, it can be done properly: use an eieio() macro/inline and have
_that_ be #ifdef'ed to nothing on 8xx...

> We can just use the in_/out_ macros that are there.  The eieio
> doesn't hurt anything on the 8xx.

Ok, in that case, I don't see any problem.

Ben.

^ permalink raw reply

* Re: [PATCH] add big endian version of ld_/st_ IO access macros and convert main 8xx code to use it
From: Dan Malek @ 2005-09-08  0:42 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Paul Mackerras, linux-ppc-embedded
In-Reply-To: <1126139332.29803.0.camel@gaston>


On Sep 7, 2005, at 8:28 PM, Benjamin Herrenschmidt wrote:

> I'm not fan of the approach. You should use in_/out_ macros for IOs. If
> you don't need eieio on 8xx , then just #ifdef it out of the
> implementation of these.

Yeah, #ifdef :-)  That patch wouldn't go anywhere (well,
to /dev/null perhaps).

We can just use the in_/out_ macros that are there.  The eieio
doesn't hurt anything on the 8xx.

Thanks.

	-- Dan

^ permalink raw reply

* Re: [PATCH] add big endian version of ld_/st_ IO access macros and convert main 8xx code to use it
From: Benjamin Herrenschmidt @ 2005-09-08  0:28 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Paul Mackerras, linux-ppc-embedded
In-Reply-To: <20050907230324.GC7513@dmt.cnet>

On Wed, 2005-09-07 at 20:03 -0300, Marcelo Tosatti wrote:
> Hi,
> 
> The following patch adds big endian version of ld_/st_ macros 
> and converts core 8xx code to use them.
> 
> Other than making IO accesses explicit (which is a plus for
> readability), a common set of macros provides a unified place for the
> volatile flag to constraint compiler code reordering.
> 
> There are several unlucky places at the moment which lack the 
> volatile flag.

I'm not fan of the approach. You should use in_/out_ macros for IOs. If
you don't need eieio on 8xx , then just #ifdef it out of the
implementation of these.

Ben.

^ permalink raw reply

* [PATCH] add big endian version of ld_/st_ IO access macros and convert main 8xx code to use it
From: Marcelo Tosatti @ 2005-09-07 23:03 UTC (permalink / raw)
  To: linux-ppc-embedded, Dan Malek; +Cc: Paul Mackerras

Hi,

The following patch adds big endian version of ld_/st_ macros 
and converts core 8xx code to use them.

Other than making IO accesses explicit (which is a plus for
readability), a common set of macros provides a unified place for the
volatile flag to constraint compiler code reordering.

There are several unlucky places at the moment which lack the 
volatile flag.


diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -73,7 +73,7 @@ cpm_mask_irq(unsigned int irq)
 {
 	int cpm_vec = irq - CPM_IRQ_OFFSET;
 
-	((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr &= ~(1 << cpm_vec);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, ld_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr) & ~(1 << cpm_vec));
 }
 
 static void
@@ -81,7 +81,7 @@ cpm_unmask_irq(unsigned int irq)
 {
 	int cpm_vec = irq - CPM_IRQ_OFFSET;
 
-	((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr |= (1 << cpm_vec);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, ld_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr) | (1 << cpm_vec));
 }
 
 static void
@@ -95,7 +95,7 @@ cpm_eoi(unsigned int irq)
 {
 	int cpm_vec = irq - CPM_IRQ_OFFSET;
 
-	((immap_t *)IMAP_ADDR)->im_cpic.cpic_cisr = (1 << cpm_vec);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cisr, (1 << cpm_vec));
 }
 
 struct hw_interrupt_type cpm_pic = {
@@ -133,7 +133,7 @@ m8xx_cpm_reset(void)
 	 * manual recommends it.
 	 * Bit 25, FAM can also be set to use FEC aggressive mode (860T).
 	 */
-	imp->im_siu_conf.sc_sdcr = 1;
+	st_be32(&imp->im_siu_conf.sc_sdcr, 1);
 
 	/* Reclaim the DP memory for our use. */
 	m8xx_cpm_dpinit();
@@ -178,10 +178,10 @@ cpm_interrupt_init(void)
 
 	/* Initialize the CPM interrupt controller.
 	*/
-	((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr =
+	st_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr,
 	    (CICR_SCD_SCC4 | CICR_SCC_SCC3 | CICR_SCB_SCC2 | CICR_SCA_SCC1) |
-		((CPM_INTERRUPT/2) << 13) | CICR_HP_MASK;
-	((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr = 0;
+		((CPM_INTERRUPT/2) << 13) | CICR_HP_MASK);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, 0);
 
         /* install the CPM interrupt controller routines for the CPM
          * interrupt vectors
@@ -198,7 +198,7 @@ cpm_interrupt_init(void)
 	if (setup_irq(CPM_IRQ_OFFSET + CPMVEC_ERROR, &cpm_error_irqaction))
 		panic("Could not allocate CPM error IRQ!");
 
-	((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr |= CICR_IEN;
+	st_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr, ld_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr) | CICR_IEN);
 }
 
 /*
@@ -212,8 +212,8 @@ cpm_get_irq(struct pt_regs *regs)
 	/* Get the vector by setting the ACK bit and then reading
 	 * the register.
 	 */
-	((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr = 1;
-	cpm_vec = ((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr;
+	st_be16(&((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr, 1);
+	cpm_vec = ld_be16(&((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr);
 	cpm_vec >>= 11;
 
 	return cpm_vec;
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c
--- a/arch/ppc/syslib/m8xx_setup.c
+++ b/arch/ppc/syslib/m8xx_setup.c
@@ -144,12 +144,12 @@ void __init m8xx_calibrate_decr(void)
 	int freq, fp, divisor;
 
 	/* Unlock the SCCR. */
-	((volatile immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk = ~KAPWR_KEY;
-	((volatile immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk = KAPWR_KEY;
+	st_be32(&((immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk, ~KAPWR_KEY);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk, KAPWR_KEY);
 
 	/* Force all 8xx processors to use divide by 16 processor clock. */
-	((volatile immap_t *)IMAP_ADDR)->im_clkrst.car_sccr |= 0x02000000;
-
+	st_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr, 
+		ld_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr)|0x02000000);
 	/* Processor frequency is MHz.
 	 * The value 'fp' is the number of decrementer ticks per second.
 	 */
@@ -175,28 +175,24 @@ void __init m8xx_calibrate_decr(void)
 	 * we guarantee the registers are locked, then we unlock them
 	 * for our use.
 	 */
-	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbscrk = ~KAPWR_KEY;
-	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_rtcsck = ~KAPWR_KEY;
-	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk    = ~KAPWR_KEY;
-	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbscrk =  KAPWR_KEY;
-	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_rtcsck =  KAPWR_KEY;
-	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk    =  KAPWR_KEY;
+	st_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_tbscrk, ~KAPWR_KEY);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_rtcsck, ~KAPWR_KEY);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk, ~KAPWR_KEY);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_tbscrk, KAPWR_KEY);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_rtcsck, KAPWR_KEY);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk, KAPWR_KEY);
 
 	/* Disable the RTC one second and alarm interrupts. */
-	((volatile immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc &=
-						~(RTCSC_SIE | RTCSC_ALE);
+	st_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, ld_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc) & ~(RTCSC_SIE | RTCSC_ALE));
 	/* Enable the RTC */
-	((volatile immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc |=
-						(RTCSC_RTF | RTCSC_RTE);
+	st_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, ld_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc) | (RTCSC_RTF | RTCSC_RTE));
 
 	/* Enabling the decrementer also enables the timebase interrupts
 	 * (or from the other point of view, to get decrementer interrupts
 	 * we have to enable the timebase).  The decrementer interrupt
 	 * is wired into the vector table, nothing to do here for that.
 	 */
-	((volatile immap_t *)IMAP_ADDR)->im_sit.sit_tbscr =
-				((mk_int_int_mask(DEC_INTERRUPT) << 8) |
-					 (TBSCR_TBF | TBSCR_TBE));
+	st_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_tbscr, (mk_int_int_mask(DEC_INTERRUPT) << 8) | (TBSCR_TBF | TBSCR_TBE));
 
 	if (setup_irq(DEC_INTERRUPT, &tbint_irqaction))
 		panic("Could not allocate timer IRQ!");
@@ -216,9 +212,9 @@ void __init m8xx_calibrate_decr(void)
 static int
 m8xx_set_rtc_time(unsigned long time)
 {
-	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_rtck = KAPWR_KEY;
-	((volatile immap_t *)IMAP_ADDR)->im_sit.sit_rtc = time;
-	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_rtck = ~KAPWR_KEY;
+	st_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_rtck, KAPWR_KEY);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtc, time);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_rtck, ~KAPWR_KEY);
 	return(0);
 }
 
@@ -226,7 +222,7 @@ static unsigned long
 m8xx_get_rtc_time(void)
 {
 	/* Get time from the RTC. */
-	return((unsigned long)(((immap_t *)IMAP_ADDR)->im_sit.sit_rtc));
+	return (unsigned long) ld_be32(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtc);
 }
 
 static void
@@ -235,13 +231,13 @@ m8xx_restart(char *cmd)
 	__volatile__ unsigned char dummy;
 
 	local_irq_disable();
-	((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr |= 0x00000080;
+	st_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr, ld_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr) | 0x00000080);
 
 	/* Clear the ME bit in MSR to cause checkstop on machine check
 	*/
 	mtmsr(mfmsr() & ~0x1000);
 
-	dummy = ((immap_t *)IMAP_ADDR)->im_clkrst.res[0];
+	dummy = ld_be8(&((immap_t *)IMAP_ADDR)->im_clkrst.res[0]);
 	printk("Restart failed\n");
 	while(1);
 }
@@ -306,8 +302,7 @@ m8xx_init_IRQ(void)
 	i8259_init(0);
 
 	/* The i8259 cascade interrupt must be level sensitive. */
-	((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel &=
-		~(0x80000000 >> ISA_BRIDGE_INT);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel, ld_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel & ~(0x80000000 >> ISA_BRIDGE_INT)));
 
 	if (setup_irq(ISA_BRIDGE_INT, &mbx_i8259_irqaction))
 		enable_irq(ISA_BRIDGE_INT);
diff --git a/arch/ppc/syslib/m8xx_wdt.c b/arch/ppc/syslib/m8xx_wdt.c
--- a/arch/ppc/syslib/m8xx_wdt.c
+++ b/arch/ppc/syslib/m8xx_wdt.c
@@ -29,8 +29,8 @@ void m8xx_wdt_reset(void)
 {
 	volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR;
 
-	imap->im_siu_conf.sc_swsr = 0x556c;	/* write magic1 */
-	imap->im_siu_conf.sc_swsr = 0xaa39;	/* write magic2 */
+	st_be16(imap->im_siu_conf.sc_swsr, 0x556c);	/* write magic1 */
+	st_be16(imap->im_siu_conf.sc_swsr, 0xaa39);	/* write magic2 */
 }
 
 static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs)
@@ -39,7 +39,7 @@ static irqreturn_t m8xx_wdt_interrupt(in
 
 	m8xx_wdt_reset();
 
-	imap->im_sit.sit_piscr |= PISCR_PS;	/* clear irq */
+	st_be16(imap->im_sit.sit_piscr, ld_be16(imap->im_sit.sit_piscr | PISCR_PS));	/* clear irq */
 
 	return IRQ_HANDLED;
 }
@@ -51,7 +51,7 @@ void __init m8xx_wdt_handler_install(bd_
 	u32 sypcr;
 	u32 pitrtclk;
 
-	sypcr = imap->im_siu_conf.sc_sypcr;
+	sypcr = ld_be32(imap->im_siu_conf.sc_sypcr);
 
 	if (!(sypcr & 0x04)) {
 		printk(KERN_NOTICE "m8xx_wdt: wdt disabled (SYPCR: 0x%08X)\n",
@@ -87,9 +87,9 @@ void __init m8xx_wdt_handler_install(bd_
 	else
 		pitc = pitrtclk * wdt_timeout / binfo->bi_intfreq / 2;
 
-	imap->im_sit.sit_pitc = pitc << 16;
-	imap->im_sit.sit_piscr =
-	    (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE;
+	st_be32(imap->im_sit.sit_pitc, pitc << 16);
+
+	st_be16(imap->im_sit.sit_piscr, (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE);
 
 	if (setup_irq(PIT_INTERRUPT, &m8xx_wdt_irqaction))
 		panic("m8xx_wdt: error setting up the watchdog irq!");
diff --git a/arch/ppc/syslib/ppc8xx_pic.c b/arch/ppc/syslib/ppc8xx_pic.c
--- a/arch/ppc/syslib/ppc8xx_pic.c
+++ b/arch/ppc/syslib/ppc8xx_pic.c
@@ -29,8 +29,7 @@ static void m8xx_mask_irq(unsigned int i
 	word = irq_nr >> 5;
 
 	ppc_cached_irq_mask[word] &= ~(1 << (31-bit));
-	((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask =
-						ppc_cached_irq_mask[word];
+	st_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]);
 }
 
 static void m8xx_unmask_irq(unsigned int irq_nr)
@@ -41,8 +40,7 @@ static void m8xx_unmask_irq(unsigned int
 	word = irq_nr >> 5;
 
 	ppc_cached_irq_mask[word] |= (1 << (31-bit));
-	((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask =
-						ppc_cached_irq_mask[word];
+	st_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]);
 }
 
 static void m8xx_end_irq(unsigned int irq_nr)
@@ -55,8 +53,7 @@ static void m8xx_end_irq(unsigned int ir
 		word = irq_nr >> 5;
 
 		ppc_cached_irq_mask[word] |= (1 << (31-bit));
-		((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask =
-			ppc_cached_irq_mask[word];
+		st_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]);
 	}
 }
 
@@ -69,9 +66,8 @@ static void m8xx_mask_and_ack(unsigned i
 	word = irq_nr >> 5;
 
 	ppc_cached_irq_mask[word] &= ~(1 << (31-bit));
-	((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask =
-						ppc_cached_irq_mask[word];
-	((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sipend = 1 << (31-bit);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]);
+	st_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sipend, 1 << (31-bit));
 }
 
 struct hw_interrupt_type ppc8xx_pic = {
@@ -93,7 +89,7 @@ m8xx_get_irq(struct pt_regs *regs)
 	/* For MPC8xx, read the SIVEC register and shift the bits down
 	 * to get the irq number.
 	 */
-	irq = ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sivec >> 26;
+	irq = ld_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sivec) >> 26;
 
 	/*
 	 * When we read the sivec without an interrupt to process, we will
diff --git a/include/asm-ppc/byteorder.h b/include/asm-ppc/byteorder.h
--- a/include/asm-ppc/byteorder.h
+++ b/include/asm-ppc/byteorder.h
@@ -7,6 +7,48 @@
 #ifdef __GNUC__
 #ifdef __KERNEL__
 
+/* big endian */
+extern __inline__ unsigned ld_be8(const volatile unsigned char *addr)
+{
+	unsigned val;
+
+	__asm__ __volatile__ ("lbz %0,0(%1)" : "=r" (val) : "r" (addr));
+	return val;
+}
+
+extern __inline__ void st_be8(volatile unsigned char *addr, const unsigned val)
+{
+	__asm__ __volatile__ ("stb %1,0(%2)" : "=m" (*addr) : "r" (val), "r" (addr));
+}
+
+extern __inline__ unsigned ld_be16(const volatile unsigned short *addr)
+{
+	unsigned val;
+
+	__asm__ __volatile__ ("lhz %0,0(%1)" : "=r" (val) : "r" (addr));
+	return val;
+}
+
+extern __inline__ void st_be16(volatile unsigned short *addr, const unsigned val)
+{
+	__asm__ __volatile__ ("sth %1,0(%2)" : "=m" (*addr) : "r" (val), "r" (addr));
+}
+
+extern __inline__ unsigned ld_be32(const volatile unsigned *addr)
+{
+	unsigned val;
+
+	__asm__ __volatile__ ("lwz %0,0(%1)" : "=r" (val) : "r" (addr));
+	return val;
+}
+
+extern __inline__ void st_be32(volatile unsigned *addr, const unsigned val)
+{
+	__asm__ __volatile__ ("stw %1,0(%2)" : "=m" (*addr) : "r" (val), "r" (addr));
+}
+
+/* little endian (reversed) */
+
 extern __inline__ unsigned ld_le16(const volatile unsigned short *addr)
 {
 	unsigned val;

^ permalink raw reply

* Re: MPC5200 Linux Init Problem
From: Jeff Angielski @ 2005-09-07 23:29 UTC (permalink / raw)
  To: Frank Beesley; +Cc: linuxppc-embedded
In-Reply-To: <431F6CDC.7030908@aeroflex.com>

On Wed, 2005-09-07 at 17:42 -0500, Frank Beesley wrote:
> Any clues to help debug this would be greatly appreciated. I have built 
> several different kernel and busybox images with different debug prints 
> to help figure this out and I am at a loss. Please CC me as I am not on 
> the mailing list OR directly email me and we can post the solution back 
> to the list.

Have you compared the stack trace and instruction pointers to the maps
to see which functions are causing the issue?  Are they the same ones?

You are using jffs as your rootfs?  Are you sure the MTD is fully
functional?  Did you port your flash configuration to your kernel
correctly?  Have you tried NFS mounting a rootfs and then playing games
with a jffs filesystem to make sure it is working?

As for things to try, compile Busybox statically and work from there.
Once you get that working, you can play with the dynamic libraries,
making sure the right ones are on your rootfs.


Jeff Angielski
The PTR Group

^ permalink raw reply

* Re: How to implementing CLI using bison and FLEX
From: Pedro Aguilar @ 2005-09-07 22:54 UTC (permalink / raw)
  To: Sanjeevi Gopal; +Cc: linuxppc-embedded
In-Reply-To: <37c1be9b050818044671528ae9@mail.gmail.com>

Hi,

There is a new tool called tarasca that could help you to develop a CLI.
The development process could be easier/faster than using flex/yacc.

You can download it from here:
http://sourceforge.net/projects/tarasca

Regards,

Pedro

> HI,
>
>
>         I am currenly working on mpc850 processor.I wanted to
> implement a Command Line interface. I like implement it using bison
> and flex tool. If anyone is familar or already implemented plz help me
>
> --
> With Regards,
> Sanjeevi G
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>

^ permalink raw reply

* MPC5200 Linux Init Problem
From: Frank Beesley @ 2005-09-07 22:42 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: frank.beesley

I am bringing up a custom board using the MPC5200 and based on the 
Lite5200. We changed from SDR to 128MB of DDR SDRAM and the flash 
interface is now a 32MB, 32-bit wide bus using 2 Strata flash parts. I 
have u-boot-1.1.3 up and running just fine. I have three partitions on 
the flash: 0-uboot, 1-kernel image, 2-jffs file system. The linux kernel 
(DENX based 2.4.25) starts with all the normal messages plus some that I 
added for debugging. It should then start running /sbin/init 
(busybox-1.00, dynamically linked)  but instead I get the following Oops:

VFS: Mounted root (jffs filesystem) 
readonly.                                  
Freeing unused kernel memory: 60k 
init                                                
init 
filename=/sbin/init                                                       
Oops: kernel access of bad area, sig: 
11                                       
NIP: C0011030 XER: 00000000 LR: C00112AC SP: C03BBEB0 REGS: c03bbe00 
TRAP: 0300d
MSR: 00001032 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 
11                                
DAR: 80820000, DSISR: 
20000000                                                 
TASK = c03ba000[1] '    nit' Last syscall: 
11                                  
last math 00000000 last altivec 
00000000                                       
GPR00: 80820000 C03BBEB0 C03BA000 C01780A0 00001032 0000000B C0160BA4 
00000000 
GPR08: 0000001B 80820000 C0160968 C013D954 00000000 00000000 00000000 
00000000 
GPR16: 00000000 00000000 00000000 00000000 C0170000 C0190000 C0160000 
C0160000 
GPR24: C000E8CC 00000000 00000000 00000000 C03BA000 C016F920 00000000 
C03BBEB0 
Call 
backtrace:                                                                
00000000 C0005D04 
00000000                                                     
Kernel panic: Attempted to kill 
init!                                          
 <0>Rebooting in 180 
seconds..                                                 


When I change busybox to statically linked I get the following (notice 
some of my debug messages from within busybox showing up now):
VFS: Mounted root (jffs filesystem) 
readonly.                                  
Freeing unused kernel memory: 60k 
init                                         
init 
filename=/sbin/init                                                       
init started:  BusyBox v1.00 (2005.09.07-14:56+0000) multi-call 
binary         
Machine check in kernel 
mode.                                                  
Caused by (from SRR1=41030): Transfer error ack 
signal                         
Oops: machine check, sig: 
7                                                    
NIP: C0010FD0 XER: 00000000 LR: C0010F34 SP: C03BBE40 REGS: c03bbd90 
TRAP: 0200d
MSR: 00041030 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 
11                                
TASK = c03ba000[1] '    nit' Last syscall: 
162                                 
last math 00000000 last altivec 
00000000                                       
GPR00: 7C691B78 C03BBE40 C03BA000 C01790A0 00001032 00000000 C0160BA4 
00000000 
GPR08: 00000017 4BFFFFAC C001BF1C 80620464 100823E4 1010D01C 00000000 
00000000 
GPR16: 00000000 00000000 00000000 00000000 C0170000 C0190000 C0160000 
C0160000 
GPR24: C0005A40 00000001 100D3E28 C0180000 C7E38000 C016F920 00000000 
C03BBE40 
Call 
backtrace:                                                                
C000EA78 C0010E3C C001C0EC C0005A9C 10082408 10027000 
10000960                 
10000338 10051284 
00000000                                                     
Kernel panic: Attempted to kill 
init!                                          
 <0>Rebooting in 180 
seconds..                                                 
                        

1) Why am i getting machine check message - also see the task name is 
messed up.

2) Why are dynamic linking not working, is this a problem with my 
library loader.

3) Why is my init failing to load. this is the same binary and config 
files that was used on a Lite5200 and worked fine.

Any clues to help debug this would be greatly appreciated. I have built 
several different kernel and busybox images with different debug prints 
to help figure this out and I am at a loss. Please CC me as I am not on 
the mailing list OR directly email me and we can post the solution back 
to the list.

Thanks
Frank

^ permalink raw reply

* PATCH ppc: Merge a few more include files
From: jdl @ 2005-09-07 20:59 UTC (permalink / raw)
  To: linuxppc-dev, linuxppc64-dev


Merge a few asm-ppc and asm-ppc64 header files.
Note: the merge of setup.h intentionally does not carry
forward the m68k cruft.  That means this patch continues
to break the already broken amiga on the ppc32.

 include/asm-powerpc/msgbuf.h   |   33 +++++++++++++++++++
 include/asm-powerpc/param.h    |   24 ++++++++++++++
 include/asm-powerpc/setup.h    |    9 +++++
 include/asm-powerpc/timex.h    |   49 ++++++++++++++++++++++++++++
 include/asm-powerpc/topology.h |   70 ++++++++++++++++++++++++++++++++++++++++
 include/asm-powerpc/user.h     |   55 +++++++++++++++++++++++++++++++
 include/asm-ppc/msgbuf.h       |   25 --------------
 include/asm-ppc/param.h        |   24 --------------
 include/asm-ppc/setup.h        |   14 --------
 include/asm-ppc/timex.h        |   40 -----------------------
 include/asm-ppc/topology.h     |    6 ---
 include/asm-ppc/user.h         |   54 -------------------------------
 include/asm-ppc64/msgbuf.h     |   27 ---------------
 include/asm-ppc64/param.h      |   31 ------------------
 include/asm-ppc64/setup.h      |    6 ---
 include/asm-ppc64/timex.h      |   26 ---------------
 include/asm-ppc64/topology.h   |   69 ---------------------------------------
 include/asm-ppc64/user.h       |   58 ---------------------------------
 18 files changed, 240 insertions(+), 380 deletions(-)

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
---


diff --git a/include/asm-powerpc/msgbuf.h b/include/asm-powerpc/msgbuf.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/msgbuf.h
@@ -0,0 +1,33 @@
+#ifndef _ASM_POWERPC_MSGBUF_H
+#define _ASM_POWERPC_MSGBUF_H
+
+/*
+ * The msqid64_ds structure for the PowerPC architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ */
+
+struct msqid64_ds {
+	struct ipc64_perm msg_perm;
+#ifndef __powerpc64__
+	unsigned int	__unused1;
+#endif
+	__kernel_time_t msg_stime;	/* last msgsnd time */
+#ifndef __powerpc64__
+	unsigned int	__unused2;
+#endif
+	__kernel_time_t msg_rtime;	/* last msgrcv time */
+#ifndef __powerpc64__
+	unsigned int	__unused3;
+#endif
+	__kernel_time_t msg_ctime;	/* last change time */
+	unsigned long  msg_cbytes;	/* current number of bytes on queue */
+	unsigned long  msg_qnum;	/* number of messages in queue */
+	unsigned long  msg_qbytes;	/* max number of bytes on queue */
+	__kernel_pid_t msg_lspid;	/* pid of last msgsnd */
+	__kernel_pid_t msg_lrpid;	/* last receive pid */
+	unsigned long  __unused4;
+	unsigned long  __unused5;
+};
+
+#endif	/* _ASM_POWERPC_MSGBUF_H */
diff --git a/include/asm-powerpc/param.h b/include/asm-powerpc/param.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/param.h
@@ -0,0 +1,24 @@
+#ifndef _ASM_POWERPC_PARAM_H
+#define _ASM_POWERPC_PARAM_H
+
+#include <linux/config.h>
+
+#ifdef __KERNEL__
+#define HZ		CONFIG_HZ	/* internal kernel timer frequency */
+#define USER_HZ		100		/* for user interfaces in "ticks" */
+#define CLOCKS_PER_SEC	(USER_HZ)	/* frequency at which times() counts */
+#endif /* __KERNEL__ */
+
+#ifndef HZ
+#define HZ 100
+#endif
+
+#define EXEC_PAGESIZE	4096
+
+#ifndef NOGROUP
+#define NOGROUP		(-1)
+#endif
+
+#define MAXHOSTNAMELEN	64	/* max length of hostname */
+
+#endif	/* _ASM_POWERPC_PARAM_H */
diff --git a/include/asm-powerpc/setup.h b/include/asm-powerpc/setup.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/setup.h
@@ -0,0 +1,9 @@
+#ifndef _ASM_POWERPC_SETUP_H
+#define _ASM_POWERPC_SETUP_H
+
+#ifdef __KERNEL__
+
+#define COMMAND_LINE_SIZE	512
+
+#endif	/* __KERNEL__ */
+#endif	/* _ASM_POWERPC_SETUP_H */
diff --git a/include/asm-powerpc/timex.h b/include/asm-powerpc/timex.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/timex.h
@@ -0,0 +1,49 @@
+#ifndef _ASM_POWERPC_TIMEX_H
+#define _ASM_POWERPC_TIMEX_H
+
+#ifdef __KERNEL__
+
+/*
+ * PowerPC architecture timex specifications
+ */
+
+#include <linux/config.h>
+#include <asm/cputable.h>
+
+#define CLOCK_TICK_RATE	1193180 /* Underlying HZ */
+
+typedef unsigned long cycles_t;
+
+static inline cycles_t get_cycles(void)
+{
+	cycles_t ret;
+
+#ifdef __powerpc64__
+
+	__asm__ __volatile__("mftb %0" : "=r" (ret) : );
+
+#else
+	/*
+	 * For the "cycle" counter we use the timebase lower half.
+	 * Currently only used on SMP.
+	 */
+
+	ret = 0;
+
+	__asm__ __volatile__(
+		"98:	mftb %0\n"
+		"99:\n"
+		".section __ftr_fixup,\"a\"\n"
+		"	.long %1\n"
+		"	.long 0\n"
+		"	.long 98b\n"
+		"	.long 99b\n"
+		".previous"
+		: "=r" (ret) : "i" (CPU_FTR_601));
+#endif
+
+	return ret;
+}
+
+#endif	/* __KERNEL__ */
+#endif	/* _ASM_POWERPC_TIMEX_H */
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/topology.h
@@ -0,0 +1,70 @@
+#ifndef _ASM_POWERPC_TOPOLOGY_H
+#define _ASM_POWERPC_TOPOLOGY_H
+
+#include <linux/config.h>
+
+#ifdef CONFIG_NUMA
+
+#include <asm/mmzone.h>
+
+static inline int cpu_to_node(int cpu)
+{
+	int node;
+
+	node = numa_cpu_lookup_table[cpu];
+
+#ifdef DEBUG_NUMA
+	BUG_ON(node == -1);
+#endif
+
+	return node;
+}
+
+#define parent_node(node)	(node)
+
+static inline cpumask_t node_to_cpumask(int node)
+{
+	return numa_cpumask_lookup_table[node];
+}
+
+static inline int node_to_first_cpu(int node)
+{
+	cpumask_t tmp;
+	tmp = node_to_cpumask(node);
+	return first_cpu(tmp);
+}
+
+#define pcibus_to_node(node)    (-1)
+#define pcibus_to_cpumask(bus)	(cpu_online_map)
+
+#define nr_cpus_node(node)	(nr_cpus_in_node[node])
+
+/* sched_domains SD_NODE_INIT for PPC64 machines */
+#define SD_NODE_INIT (struct sched_domain) {		\
+	.span			= CPU_MASK_NONE,	\
+	.parent			= NULL,			\
+	.groups			= NULL,			\
+	.min_interval		= 8,			\
+	.max_interval		= 32,			\
+	.busy_factor		= 32,			\
+	.imbalance_pct		= 125,			\
+	.cache_hot_time		= (10*1000000),		\
+	.cache_nice_tries	= 1,			\
+	.per_cpu_gain		= 100,			\
+	.flags			= SD_LOAD_BALANCE	\
+				| SD_BALANCE_EXEC	\
+				| SD_BALANCE_NEWIDLE	\
+				| SD_WAKE_IDLE		\
+				| SD_WAKE_BALANCE,	\
+	.last_balance		= jiffies,		\
+	.balance_interval	= 1,			\
+	.nr_balance_failed	= 0,			\
+}
+
+#else
+
+#include <asm-generic/topology.h>
+
+#endif /* CONFIG_NUMA */
+
+#endif	/* _ASM_POWERPC_TOPOLOGY_H */
diff --git a/include/asm-powerpc/user.h b/include/asm-powerpc/user.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/user.h
@@ -0,0 +1,55 @@
+#ifndef _ASM_POWERPC_USER_H
+#define _ASM_POWERPC_USER_H
+
+#ifdef __KERNEL__
+
+#include <asm/ptrace.h>
+#include <asm/page.h>
+
+/*
+ * Adapted from <asm-alpha/user.h>
+ *
+ * Core file format: The core file is written in such a way that gdb
+ * can understand it and provide useful information to the user (under
+ * linux we use the `trad-core' bfd, NOT the osf-core).  The file contents
+ * are as follows:
+ *
+ *  upage: 1 page consisting of a user struct that tells gdb
+ *	what is present in the file.  Directly after this is a
+ *	copy of the task_struct, which is currently not used by gdb,
+ *	but it may come in handy at some point.  All of the registers
+ *	are stored as part of the upage.  The upage should always be
+ *	only one page long.
+ *  data: The data segment follows next.  We use current->end_text to
+ *	current->brk to pick up all of the user variables, plus any memory
+ *	that may have been sbrk'ed.  No attempt is made to determine if a
+ *	page is demand-zero or if a page is totally unused, we just cover
+ *	the entire range.  All of the addresses are rounded in such a way
+ *	that an integral number of pages is written.
+ *  stack: We need the stack information in order to get a meaningful
+ *	backtrace.  We need to write the data from usp to
+ *	current->start_stack, so we round each of these in order to be able
+ *	to write an integer number of pages.
+ */
+struct user {
+	struct pt_regs	regs;			/* entire machine state */
+	size_t		u_tsize;		/* text size (pages) */
+	size_t		u_dsize;		/* data size (pages) */
+	size_t		u_ssize;		/* stack size (pages) */
+	unsigned long	start_code;		/* text starting address */
+	unsigned long	start_data;		/* data starting address */
+	unsigned long	start_stack;		/* stack starting address */
+	long int	signal;			/* signal causing core dump */
+	struct regs *	u_ar0;			/* help gdb find registers */
+	unsigned long	magic;			/* identifies a core file */
+	char		u_comm[32];		/* user command name */
+};
+
+#define NBPG			PAGE_SIZE
+#define UPAGES			1
+#define HOST_TEXT_START_ADDR	(u.start_code)
+#define HOST_DATA_START_ADDR	(u.start_data)
+#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
+
+#endif	/* __KERNEL__ */
+#endif	/* _ASM_POWERPC_USER_H */
diff --git a/include/asm-ppc/msgbuf.h b/include/asm-ppc/msgbuf.h
deleted file mode 100644
--- a/include/asm-ppc/msgbuf.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef _PPC_MSGBUF_H
-#define _PPC_MSGBUF_H
-
-/*
- * The msqid64_ds structure for the PPC architecture.
- */
-
-struct msqid64_ds {
-	struct ipc64_perm msg_perm;
-	unsigned int	__unused1;
-	__kernel_time_t msg_stime;	/* last msgsnd time */
-	unsigned int	__unused2;
-	__kernel_time_t msg_rtime;	/* last msgrcv time */
-	unsigned int	__unused3;
-	__kernel_time_t msg_ctime;	/* last change time */
-	unsigned long  msg_cbytes;	/* current number of bytes on queue */
-	unsigned long  msg_qnum;	/* number of messages in queue */
-	unsigned long  msg_qbytes;	/* max number of bytes on queue */
-	__kernel_pid_t msg_lspid;	/* pid of last msgsnd */
-	__kernel_pid_t msg_lrpid;	/* last receive pid */
-	unsigned long  __unused4;
-	unsigned long  __unused5;
-};
-
-#endif /* _PPC_MSGBUF_H */
diff --git a/include/asm-ppc/param.h b/include/asm-ppc/param.h
deleted file mode 100644
--- a/include/asm-ppc/param.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _ASM_PPC_PARAM_H
-#define _ASM_PPC_PARAM_H
-
-#include <linux/config.h>
-
-#ifdef __KERNEL__
-#define HZ		CONFIG_HZ	/* internal timer frequency */
-#define USER_HZ		100		/* for user interfaces in "ticks" */
-#define CLOCKS_PER_SEC	(USER_HZ)	/* frequency at which times() counts */
-#endif /* __KERNEL__ */
-
-#ifndef HZ
-#define HZ 100
-#endif
-
-#define EXEC_PAGESIZE	4096
-
-#ifndef NOGROUP
-#define NOGROUP		(-1)
-#endif
-
-#define MAXHOSTNAMELEN	64	/* max length of hostname */
-
-#endif
diff --git a/include/asm-ppc/setup.h b/include/asm-ppc/setup.h
deleted file mode 100644
--- a/include/asm-ppc/setup.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifdef __KERNEL__
-#ifndef _PPC_SETUP_H
-#define _PPC_SETUP_H
-
-#define m68k_num_memory num_memory
-#define m68k_memory memory
-
-#include <asm-m68k/setup.h>
-/* We have a bigger command line buffer. */
-#undef COMMAND_LINE_SIZE
-#define COMMAND_LINE_SIZE	512
-
-#endif /* _PPC_SETUP_H */
-#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/timex.h b/include/asm-ppc/timex.h
deleted file mode 100644
--- a/include/asm-ppc/timex.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * include/asm-ppc/timex.h
- *
- * ppc architecture timex specifications
- */
-#ifdef __KERNEL__
-#ifndef _ASMppc_TIMEX_H
-#define _ASMppc_TIMEX_H
-
-#include <linux/config.h>
-#include <asm/cputable.h>
-
-#define CLOCK_TICK_RATE	1193180 /* Underlying HZ */
-
-typedef unsigned long cycles_t;
-
-/*
- * For the "cycle" counter we use the timebase lower half.
- * Currently only used on SMP.
- */
-
-static inline cycles_t get_cycles(void)
-{
-	cycles_t ret = 0;
-
-	__asm__ __volatile__(
-		"98:	mftb %0\n"
-		"99:\n"
-		".section __ftr_fixup,\"a\"\n"
-		"	.long %1\n"
-		"	.long 0\n"
-		"	.long 98b\n"
-		"	.long 99b\n"
-		".previous"
-		: "=r" (ret) : "i" (CPU_FTR_601));
-	return ret;
-}
-
-#endif
-#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/topology.h b/include/asm-ppc/topology.h
deleted file mode 100644
--- a/include/asm-ppc/topology.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_PPC_TOPOLOGY_H
-#define _ASM_PPC_TOPOLOGY_H
-
-#include <asm-generic/topology.h>
-
-#endif /* _ASM_PPC_TOPOLOGY_H */
diff --git a/include/asm-ppc/user.h b/include/asm-ppc/user.h
deleted file mode 100644
--- a/include/asm-ppc/user.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifdef __KERNEL__
-#ifndef _PPC_USER_H
-#define _PPC_USER_H
-
-/* Adapted from <asm-alpha/user.h> */
-
-#include <linux/ptrace.h>
-#include <asm/page.h>
-
-/*
- * Core file format: The core file is written in such a way that gdb
- * can understand it and provide useful information to the user (under
- * linux we use the `trad-core' bfd, NOT the osf-core).  The file contents
- * are as follows:
- *
- *  upage: 1 page consisting of a user struct that tells gdb
- *	what is present in the file.  Directly after this is a
- *	copy of the task_struct, which is currently not used by gdb,
- *	but it may come in handy at some point.  All of the registers
- *	are stored as part of the upage.  The upage should always be
- *	only one page long.
- *  data: The data segment follows next.  We use current->end_text to
- *	current->brk to pick up all of the user variables, plus any memory
- *	that may have been sbrk'ed.  No attempt is made to determine if a
- *	page is demand-zero or if a page is totally unused, we just cover
- *	the entire range.  All of the addresses are rounded in such a way
- *	that an integral number of pages is written.
- *  stack: We need the stack information in order to get a meaningful
- *	backtrace.  We need to write the data from usp to
- *	current->start_stack, so we round each of these in order to be able
- *	to write an integer number of pages.
- */
-struct user {
-	struct pt_regs	regs;			/* entire machine state */
-	size_t		u_tsize;		/* text size (pages) */
-	size_t		u_dsize;		/* data size (pages) */
-	size_t		u_ssize;		/* stack size (pages) */
-	unsigned long	start_code;		/* text starting address */
-	unsigned long	start_data;		/* data starting address */
-	unsigned long	start_stack;		/* stack starting address */
-	long int	signal;			/* signal causing core dump */
-	struct regs *	u_ar0;			/* help gdb find registers */
-	unsigned long	magic;			/* identifies a core file */
-	char		u_comm[32];		/* user command name */
-};
-
-#define NBPG			PAGE_SIZE
-#define UPAGES			1
-#define HOST_TEXT_START_ADDR	(u.start_code)
-#define HOST_DATA_START_ADDR	(u.start_data)
-#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
-
-#endif /* _PPC_USER_H */
-#endif /* __KERNEL__ */
diff --git a/include/asm-ppc64/msgbuf.h b/include/asm-ppc64/msgbuf.h
deleted file mode 100644
--- a/include/asm-ppc64/msgbuf.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _PPC64_MSGBUF_H
-#define _PPC64_MSGBUF_H
-
-/* 
- * The msqid64_ds structure for the PPC architecture.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-struct msqid64_ds {
-	struct ipc64_perm msg_perm;
-	__kernel_time_t msg_stime;	/* last msgsnd time */
-	__kernel_time_t msg_rtime;	/* last msgrcv time */
-	__kernel_time_t msg_ctime;	/* last change time */
-	unsigned long  msg_cbytes;	/* current number of bytes on queue */
-	unsigned long  msg_qnum;	/* number of messages in queue */
-	unsigned long  msg_qbytes;	/* max number of bytes on queue */
-	__kernel_pid_t msg_lspid;	/* pid of last msgsnd */
-	__kernel_pid_t msg_lrpid;	/* last receive pid */
-	unsigned long  __unused1;
-	unsigned long  __unused2;
-};
-
-#endif /* _PPC64_MSGBUF_H */
diff --git a/include/asm-ppc64/param.h b/include/asm-ppc64/param.h
deleted file mode 100644
--- a/include/asm-ppc64/param.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _ASM_PPC64_PARAM_H
-#define _ASM_PPC64_PARAM_H
-
-#include <linux/config.h>
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#ifdef __KERNEL__
-# define HZ		CONFIG_HZ	/* Internal kernel timer frequency */
-# define USER_HZ	100		/* .. some user interfaces are in "ticks" */
-# define CLOCKS_PER_SEC	(USER_HZ)	/* like times() */
-#endif
-
-#ifndef HZ
-#define HZ 100
-#endif
-
-#define EXEC_PAGESIZE	4096
-
-#ifndef NOGROUP
-#define NOGROUP		(-1)
-#endif
-
-#define MAXHOSTNAMELEN	64	/* max length of hostname */
-
-#endif /* _ASM_PPC64_PARAM_H */
diff --git a/include/asm-ppc64/setup.h b/include/asm-ppc64/setup.h
deleted file mode 100644
--- a/include/asm-ppc64/setup.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _PPC_SETUP_H
-#define _PPC_SETUP_H
-
-#define COMMAND_LINE_SIZE 512
-
-#endif /* _PPC_SETUP_H */
diff --git a/include/asm-ppc64/timex.h b/include/asm-ppc64/timex.h
deleted file mode 100644
--- a/include/asm-ppc64/timex.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * linux/include/asm-ppc/timex.h
- *
- * PPC64 architecture timex specifications
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-#ifndef _ASMPPC64_TIMEX_H
-#define _ASMPPC64_TIMEX_H
-
-#define CLOCK_TICK_RATE	1193180 /* Underlying HZ */
-
-typedef unsigned long cycles_t;
-
-static inline cycles_t get_cycles(void)
-{
-	cycles_t ret;
-
-	__asm__ __volatile__("mftb %0" : "=r" (ret) : );
-	return ret;
-}
-
-#endif
diff --git a/include/asm-ppc64/topology.h b/include/asm-ppc64/topology.h
deleted file mode 100644
--- a/include/asm-ppc64/topology.h
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef _ASM_PPC64_TOPOLOGY_H
-#define _ASM_PPC64_TOPOLOGY_H
-
-#include <linux/config.h>
-#include <asm/mmzone.h>
-
-#ifdef CONFIG_NUMA
-
-static inline int cpu_to_node(int cpu)
-{
-	int node;
-
-	node = numa_cpu_lookup_table[cpu];
-
-#ifdef DEBUG_NUMA
-	BUG_ON(node == -1);
-#endif
-
-	return node;
-}
-
-#define parent_node(node)	(node)
-
-static inline cpumask_t node_to_cpumask(int node)
-{
-	return numa_cpumask_lookup_table[node];
-}
-
-static inline int node_to_first_cpu(int node)
-{
-	cpumask_t tmp;
-	tmp = node_to_cpumask(node);
-	return first_cpu(tmp);
-}
-
-#define pcibus_to_node(node)    (-1)
-#define pcibus_to_cpumask(bus)	(cpu_online_map)
-
-#define nr_cpus_node(node)	(nr_cpus_in_node[node])
-
-/* sched_domains SD_NODE_INIT for PPC64 machines */
-#define SD_NODE_INIT (struct sched_domain) {		\
-	.span			= CPU_MASK_NONE,	\
-	.parent			= NULL,			\
-	.groups			= NULL,			\
-	.min_interval		= 8,			\
-	.max_interval		= 32,			\
-	.busy_factor		= 32,			\
-	.imbalance_pct		= 125,			\
-	.cache_hot_time		= (10*1000000),		\
-	.cache_nice_tries	= 1,			\
-	.per_cpu_gain		= 100,			\
-	.flags			= SD_LOAD_BALANCE	\
-				| SD_BALANCE_EXEC	\
-				| SD_BALANCE_NEWIDLE	\
-				| SD_WAKE_IDLE		\
-				| SD_WAKE_BALANCE,	\
-	.last_balance		= jiffies,		\
-	.balance_interval	= 1,			\
-	.nr_balance_failed	= 0,			\
-}
-
-#else
-
-#include <asm-generic/topology.h>
-
-#endif /* CONFIG_NUMA */
-
-#endif /* _ASM_PPC64_TOPOLOGY_H */
diff --git a/include/asm-ppc64/user.h b/include/asm-ppc64/user.h
deleted file mode 100644
--- a/include/asm-ppc64/user.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _PPC_USER_H
-#define _PPC_USER_H
-
-/* Adapted from <asm-alpha/user.h> 
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include <asm/ptrace.h>
-#include <asm/page.h>
-
-/*
- * Core file format: The core file is written in such a way that gdb
- * can understand it and provide useful information to the user (under
- * linux we use the `trad-core' bfd, NOT the osf-core).  The file contents
- * are as follows:
- *
- *  upage: 1 page consisting of a user struct that tells gdb
- *	what is present in the file.  Directly after this is a
- *	copy of the task_struct, which is currently not used by gdb,
- *	but it may come in handy at some point.  All of the registers
- *	are stored as part of the upage.  The upage should always be
- *	only one page long.
- *  data: The data segment follows next.  We use current->end_text to
- *	current->brk to pick up all of the user variables, plus any memory
- *	that may have been sbrk'ed.  No attempt is made to determine if a
- *	page is demand-zero or if a page is totally unused, we just cover
- *	the entire range.  All of the addresses are rounded in such a way
- *	that an integral number of pages is written.
- *  stack: We need the stack information in order to get a meaningful
- *	backtrace.  We need to write the data from usp to
- *	current->start_stack, so we round each of these in order to be able
- *	to write an integer number of pages.
- */
-struct user {
-	struct pt_regs	regs;			/* entire machine state */
-	size_t		u_tsize;		/* text size (pages) */
-	size_t		u_dsize;		/* data size (pages) */
-	size_t		u_ssize;		/* stack size (pages) */
-	unsigned long	start_code;		/* text starting address */
-	unsigned long	start_data;		/* data starting address */
-	unsigned long	start_stack;		/* stack starting address */
-	long int	signal;			/* signal causing core dump */
-	struct regs *	u_ar0;			/* help gdb find registers */
-	unsigned long	magic;			/* identifies a core file */
-	char		u_comm[32];		/* user command name */
-};
-
-#define NBPG			PAGE_SIZE
-#define UPAGES			1
-#define HOST_TEXT_START_ADDR	(u.start_code)
-#define HOST_DATA_START_ADDR	(u.start_data)
-#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
-
-#endif /* _PPC_USER_H */

^ permalink raw reply

* PATCH ppc: Make check_bugs() static inline
From: jdl @ 2005-09-07 20:56 UTC (permalink / raw)
  To: linuxppc-dev, linuxppc64-dev

Make check_bugs() static inline and remove it from syscalls.c.

 arch/ppc/kernel/syscalls.c   |    4 ----
 arch/ppc64/kernel/syscalls.c |    4 ----
 include/asm-powerpc/bugs.h   |    2 +-
 3 files changed, 1 insertions(+), 9 deletions(-)

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
---


 diff --git a/arch/ppc/kernel/syscalls.c b/arch/ppc/kernel/syscalls.c
--- a/arch/ppc/kernel/syscalls.c
+++ b/arch/ppc/kernel/syscalls.c
@@ -41,10 +41,6 @@
 #include <asm/ipc.h>
 #include <asm/semaphore.h>
 
-void
-check_bugs(void)
-{
-}
 
 /*
  * sys_ipc() is the de-multiplexer for the SysV IPC calls..
diff --git a/arch/ppc64/kernel/syscalls.c b/arch/ppc64/kernel/syscalls.c
--- a/arch/ppc64/kernel/syscalls.c
+++ b/arch/ppc64/kernel/syscalls.c
@@ -46,10 +46,6 @@
 
 extern unsigned long wall_jiffies;
 
-void
-check_bugs(void)
-{
-}
 
 /*
  * sys_ipc() is the de-multiplexer for the SysV IPC calls..
diff --git a/include/asm-powerpc/bugs.h b/include/asm-powerpc/bugs.h
--- a/include/asm-powerpc/bugs.h
+++ b/include/asm-powerpc/bugs.h
@@ -13,6 +13,6 @@
  * architecture-dependent bugs.
  */
 
-extern void check_bugs(void);
+static inline void check_bugs(void) { }
 
 #endif	/* _ASM_POWERPC_BUGS_H */

^ permalink raw reply

* PATCH Standardize on _ASM_POWERPC header symbol prefix
From: jdl @ 2005-09-07 20:27 UTC (permalink / raw)
  To: linuxppc-dev, linuxppc64-dev

Standardize on _ASM_POWERPC_... prefix for all #include
exclusion symbols.  Fixup all the non-compliers.

 include/asm-powerpc/8253pit.h     |    8 ++++----
 include/asm-powerpc/agp.h         |    8 +++-----
 include/asm-powerpc/bugs.h        |    6 +++---
 include/asm-powerpc/errno.h       |    6 +++---
 include/asm-powerpc/ioctl.h       |    6 +++---
 include/asm-powerpc/ioctls.h      |    6 +++---
 include/asm-powerpc/linkage.h     |    6 +++---
 include/asm-powerpc/mc146818rtc.h |    6 +++---
 include/asm-powerpc/mman.h        |    6 +++---
 include/asm-powerpc/module.h      |    6 +++---
 include/asm-powerpc/namei.h       |   14 +++++++-------
 include/asm-powerpc/poll.h        |    6 +++---
 include/asm-powerpc/sembuf.h      |    6 +++---
 include/asm-powerpc/shmbuf.h      |    6 +++---
 include/asm-powerpc/shmparam.h    |    6 +++---
 include/asm-powerpc/siginfo.h     |    6 +++---
 include/asm-powerpc/socket.h      |    6 +++---
 include/asm-powerpc/sockios.h     |    6 +++---
 include/asm-powerpc/string.h      |    6 +++---
 include/asm-powerpc/termbits.h    |    6 +++---
 include/asm-powerpc/termios.h     |    6 +++---
 include/asm-powerpc/unaligned.h   |    9 +++++----
 22 files changed, 73 insertions(+), 74 deletions(-)

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
---


diff --git a/include/asm-powerpc/8253pit.h b/include/asm-powerpc/8253pit.h
--- a/include/asm-powerpc/8253pit.h
+++ b/include/asm-powerpc/8253pit.h
@@ -1,10 +1,10 @@
+#ifndef _ASM_POWERPC_8253PIT_H
+#define _ASM_POWERPC_8253PIT_H
+
 /*
  * 8253/8254 Programmable Interval Timer
  */
 
-#ifndef _8253PIT_H
-#define _8253PIT_H
-
 #define PIT_TICK_RATE	1193182UL
 
-#endif
+#endif	/* _ASM_POWERPC_8253PIT_H */
diff --git a/include/asm-powerpc/agp.h b/include/asm-powerpc/agp.h
--- a/include/asm-powerpc/agp.h
+++ b/include/asm-powerpc/agp.h
@@ -1,10 +1,8 @@
-#ifndef AGP_H
-#define AGP_H 1
+#ifndef _ASM_POWERPC_AGP_H
+#define _ASM_POWERPC_AGP_H
 
 #include <asm/io.h>
 
-/* nothing much needed here */
-
 #define map_page_into_agp(page)
 #define unmap_page_from_agp(page)
 #define flush_agp_mappings()
@@ -20,4 +18,4 @@
 #define free_gatt_pages(table, order)	\
 	free_pages((unsigned long)(table), (order))
 
-#endif
+#endif	/* _ASM_POWERPC_AGP_H */
diff --git a/include/asm-powerpc/bugs.h b/include/asm-powerpc/bugs.h
--- a/include/asm-powerpc/bugs.h
+++ b/include/asm-powerpc/bugs.h
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_BUGS_H
-#define _POWERPC_BUGS_H
+#ifndef _ASM_POWERPC_BUGS_H
+#define _ASM_POWERPC_BUGS_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -15,4 +15,4 @@
 
 extern void check_bugs(void);
 
-#endif /* _POWERPC_BUGS_H */
+#endif	/* _ASM_POWERPC_BUGS_H */
diff --git a/include/asm-powerpc/errno.h b/include/asm-powerpc/errno.h
--- a/include/asm-powerpc/errno.h
+++ b/include/asm-powerpc/errno.h
@@ -1,5 +1,5 @@
-#ifndef _PPC_ERRNO_H
-#define _PPC_ERRNO_H
+#ifndef _ASM_POWERPC_ERRNO_H
+#define _ASM_POWERPC_ERRNO_H
 
 #include <asm-generic/errno.h>
 
@@ -8,4 +8,4 @@
 
 #define _LAST_ERRNO	516
 
-#endif
+#endif	/* _ASM_POWERPC_ERRNO_H */
diff --git a/include/asm-powerpc/ioctl.h b/include/asm-powerpc/ioctl.h
--- a/include/asm-powerpc/ioctl.h
+++ b/include/asm-powerpc/ioctl.h
@@ -1,5 +1,5 @@
-#ifndef _PPC_IOCTL_H
-#define _PPC_IOCTL_H
+#ifndef _ASM_POWERPC_IOCTL_H
+#define _ASM_POWERPC_IOCTL_H
 
 
 /*
@@ -66,4 +66,4 @@ extern unsigned int __invalid_size_argum
 #define IOCSIZE_MASK	(_IOC_SIZEMASK << _IOC_SIZESHIFT)
 #define IOCSIZE_SHIFT	(_IOC_SIZESHIFT)
 
-#endif
+#endif	/* _ASM_POWERPC_IOCTL_H */
diff --git a/include/asm-powerpc/ioctls.h b/include/asm-powerpc/ioctls.h
--- a/include/asm-powerpc/ioctls.h
+++ b/include/asm-powerpc/ioctls.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_PPC_IOCTLS_H
-#define _ASM_PPC_IOCTLS_H
+#ifndef _ASM_POWERPC_IOCTLS_H
+#define _ASM_POWERPC_IOCTLS_H
 
 #include <asm/ioctl.h>
 
@@ -104,4 +104,4 @@
 #define TIOCMIWAIT	0x545C	/* wait for a change on serial input line(s) */
 #define TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
 
-#endif /* _ASM_PPC_IOCTLS_H */
+#endif	/* _ASM_POWERPC_IOCTLS_H */
diff --git a/include/asm-powerpc/linkage.h b/include/asm-powerpc/linkage.h
--- a/include/asm-powerpc/linkage.h
+++ b/include/asm-powerpc/linkage.h
@@ -1,6 +1,6 @@
-#ifndef __ASM_LINKAGE_H
-#define __ASM_LINKAGE_H
+#ifndef _ASM_POWERPC_LINKAGE_H
+#define _ASM_POWERPC_LINKAGE_H
 
 /* Nothing to see here... */
 
-#endif
+#endif	/* _ASM_POWERPC_LINKAGE_H */
diff --git a/include/asm-powerpc/mc146818rtc.h b/include/asm-powerpc/mc146818rtc.h
--- a/include/asm-powerpc/mc146818rtc.h
+++ b/include/asm-powerpc/mc146818rtc.h
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_MC146818RTC_H
-#define _POWERPC_MC146818RTC_H
+#ifndef _ASM_POWERPC_MC146818RTC_H
+#define _ASM_POWERPC_MC146818RTC_H
 
 /*
  * Machine dependent access functions for RTC registers.
@@ -33,4 +33,4 @@ outb_p((val),RTC_PORT(1)); \
 })
 
 #endif	/* __KERNEL__ */
-#endif	/* _POWERPC_MC146818RTC_H */
+#endif	/* _ASM_POWERPC_MC146818RTC_H */
diff --git a/include/asm-powerpc/mman.h b/include/asm-powerpc/mman.h
--- a/include/asm-powerpc/mman.h
+++ b/include/asm-powerpc/mman.h
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_MMAN_H
-#define _POWERPC_MMAN_H
+#ifndef _ASM_POWERPC_MMAN_H
+#define _ASM_POWERPC_MMAN_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -49,4 +49,4 @@
 #define MAP_ANON	MAP_ANONYMOUS
 #define MAP_FILE	0
 
-#endif /* _POWERPC_MMAN_H */
+#endif	/* _ASM_POWERPC_MMAN_H */
diff --git a/include/asm-powerpc/module.h b/include/asm-powerpc/module.h
--- a/include/asm-powerpc/module.h
+++ b/include/asm-powerpc/module.h
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_MODULE_H
-#define _POWERPC_MODULE_H
+#ifndef _ASM_POWERPC_MODULE_H
+#define _ASM_POWERPC_MODULE_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -74,4 +74,4 @@ struct exception_table_entry;
 void sort_ex_table(struct exception_table_entry *start,
 		   struct exception_table_entry *finish);
 
-#endif /* _POWERPC_MODULE_H */
+#endif	/* _ASM_POWERPC_MODULE_H */
diff --git a/include/asm-powerpc/namei.h b/include/asm-powerpc/namei.h
--- a/include/asm-powerpc/namei.h
+++ b/include/asm-powerpc/namei.h
@@ -1,14 +1,14 @@
+#ifndef _ASM_POWERPC_NAMEI_H
+#define _ASM_POWERPC_NAMEI_H
+
+#ifdef __KERNEL__
+
 /*
- * include/asm-ppc/namei.h
  * Adapted from include/asm-alpha/namei.h
  *
  * Included from fs/namei.c
  */
 
-#ifdef __KERNEL__
-#ifndef __PPC_NAMEI_H
-#define __PPC_NAMEI_H
-
 /* This dummy routine maybe changed to something useful
  * for /usr/gnemul/ emulation stuff.
  * Look at asm-sparc/namei.h for details.
@@ -16,5 +16,5 @@
 
 #define __emul_prefix() NULL
 
-#endif /* __PPC_NAMEI_H */
-#endif /* __KERNEL__ */
+#endif	/* __KERNEL__ */
+#endif	/* _ASM_POWERPC_NAMEI_H */
diff --git a/include/asm-powerpc/poll.h b/include/asm-powerpc/poll.h
--- a/include/asm-powerpc/poll.h
+++ b/include/asm-powerpc/poll.h
@@ -1,5 +1,5 @@
-#ifndef __PPC_POLL_H
-#define __PPC_POLL_H
+#ifndef _ASM_POWERPC_POLL_H
+#define _ASM_POWERPC_POLL_H
 
 #define POLLIN		0x0001
 #define POLLPRI		0x0002
@@ -20,4 +20,4 @@ struct pollfd {
 	short revents;
 };
 
-#endif
+#endif	/* _ASM_POWERPC_POLL_H */
diff --git a/include/asm-powerpc/sembuf.h b/include/asm-powerpc/sembuf.h
--- a/include/asm-powerpc/sembuf.h
+++ b/include/asm-powerpc/sembuf.h
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_SEMBUF_H
-#define _POWERPC_SEMBUF_H
+#ifndef _ASM_POWERPC_SEMBUF_H
+#define _ASM_POWERPC_SEMBUF_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -33,4 +33,4 @@ struct semid64_ds {
 	unsigned long	__unused4;
 };
 
-#endif /* _POWERPC_SEMBUF_H */
+#endif	/* _ASM_POWERPC_SEMBUF_H */
diff --git a/include/asm-powerpc/shmbuf.h b/include/asm-powerpc/shmbuf.h
--- a/include/asm-powerpc/shmbuf.h
+++ b/include/asm-powerpc/shmbuf.h
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_SHMBUF_H
-#define _POWERPC_SHMBUF_H
+#ifndef _ASM_POWERPC_SHMBUF_H
+#define _ASM_POWERPC_SHMBUF_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -56,4 +56,4 @@ struct shminfo64 {
 	unsigned long	__unused4;
 };
 
-#endif /* _POWERPC_SHMBUF_H */
+#endif	/* _ASM_POWERPC_SHMBUF_H */
diff --git a/include/asm-powerpc/shmparam.h b/include/asm-powerpc/shmparam.h
--- a/include/asm-powerpc/shmparam.h
+++ b/include/asm-powerpc/shmparam.h
@@ -1,6 +1,6 @@
-#ifndef _PPC_SHMPARAM_H
-#define _PPC_SHMPARAM_H
+#ifndef _ASM_POWERPC_SHMPARAM_H
+#define _ASM_POWERPC_SHMPARAM_H
 
 #define	SHMLBA PAGE_SIZE		 /* attach addr a multiple of this */
 
-#endif /* _PPC_SHMPARAM_H */
+#endif	/* _ASM_POWERPC_SHMPARAM_H */
diff --git a/include/asm-powerpc/siginfo.h b/include/asm-powerpc/siginfo.h
--- a/include/asm-powerpc/siginfo.h
+++ b/include/asm-powerpc/siginfo.h
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_SIGINFO_H
-#define _POWERPC_SIGINFO_H
+#ifndef _ASM_POWERPC_SIGINFO_H
+#define _ASM_POWERPC_SIGINFO_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -15,4 +15,4 @@
 
 #include <asm-generic/siginfo.h>
 
-#endif /* _POWERPC_SIGINFO_H */
+#endif	/* _ASM_POWERPC_SIGINFO_H */
diff --git a/include/asm-powerpc/socket.h b/include/asm-powerpc/socket.h
--- a/include/asm-powerpc/socket.h
+++ b/include/asm-powerpc/socket.h
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_SOCKET_H
-#define _POWERPC_SOCKET_H
+#ifndef _ASM_POWERPC_SOCKET_H
+#define _ASM_POWERPC_SOCKET_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -56,4 +56,4 @@
 
 #define SO_PEERSEC		31
 
-#endif /* _POWERPC_SOCKET_H */
+#endif	/* _ASM_POWERPC_SOCKET_H */
diff --git a/include/asm-powerpc/sockios.h b/include/asm-powerpc/sockios.h
--- a/include/asm-powerpc/sockios.h
+++ b/include/asm-powerpc/sockios.h
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_SOCKIOS_H
-#define _POWERPC_SOCKIOS_H
+#ifndef _ASM_POWERPC_SOCKIOS_H
+#define _ASM_POWERPC_SOCKIOS_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -16,4 +16,4 @@
 #define SIOCATMARK	0x8905
 #define SIOCGSTAMP	0x8906		/* Get stamp */
 
-#endif /* _POWERPC_SOCKIOS_H */
+#endif	/* _ASM_POWERPC_SOCKIOS_H */
diff --git a/include/asm-powerpc/string.h b/include/asm-powerpc/string.h
--- a/include/asm-powerpc/string.h
+++ b/include/asm-powerpc/string.h
@@ -1,5 +1,5 @@
-#ifndef _PPC_STRING_H_
-#define _PPC_STRING_H_
+#ifndef _ASM_POWERPC_STRING_H
+#define _ASM_POWERPC_STRING_H
 
 #ifdef __KERNEL__
 
@@ -29,4 +29,4 @@ extern void * memchr(const void *,int,__
 
 #endif /* __KERNEL__ */
 
-#endif
+#endif	/* _ASM_POWERPC_STRING_H */
diff --git a/include/asm-powerpc/termbits.h b/include/asm-powerpc/termbits.h
--- a/include/asm-powerpc/termbits.h
+++ b/include/asm-powerpc/termbits.h
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_TERMBITS_H
-#define _POWERPC_TERMBITS_H
+#ifndef _ASM_POWERPC_TERMBITS_H
+#define _ASM_POWERPC_TERMBITS_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -188,4 +188,4 @@ struct termios {
 #define	TCSADRAIN	1
 #define	TCSAFLUSH	2
 
-#endif /* _POWERPC_TERMBITS_H */
+#endif	/* _ASM_POWERPC_TERMBITS_H */
diff --git a/include/asm-powerpc/termios.h b/include/asm-powerpc/termios.h
--- a/include/asm-powerpc/termios.h
+++ b/include/asm-powerpc/termios.h
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_TERMIOS_H
-#define _POWERPC_TERMIOS_H
+#ifndef _ASM_POWERPC_TERMIOS_H
+#define _ASM_POWERPC_TERMIOS_H
 
 /*
  * Liberally adapted from alpha/termios.h.  In particular, the c_cc[]
@@ -233,4 +233,4 @@ struct termio {
 
 #endif	/* __KERNEL__ */
 
-#endif	/* _POWERPC_TERMIOS_H */
+#endif	/* _ASM_POWERPC_TERMIOS_H */
diff --git a/include/asm-powerpc/unaligned.h b/include/asm-powerpc/unaligned.h
--- a/include/asm-powerpc/unaligned.h
+++ b/include/asm-powerpc/unaligned.h
@@ -1,6 +1,7 @@
+#ifndef _ASM_POWERPC_UNALIGNED_H
+#define _ASM_POWERPC_UNALIGNED_H
+
 #ifdef __KERNEL__
-#ifndef __PPC_UNALIGNED_H
-#define __PPC_UNALIGNED_H
 
 /*
  * The PowerPC can do unaligned accesses itself in big endian mode.
@@ -14,5 +15,5 @@
 
 #define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
 
-#endif
-#endif /* __KERNEL__ */
+#endif	/* __KERNEL__ */
+#endif	/* _ASM_POWERPC_UNALIGNED_H */

^ permalink raw reply

* [PATCH] ppc: Moved ASM_CONST macro into ppc_asm.h
From: Kumar Gala @ 2005-09-07 18:55 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linuxppc64-dev

Moved the ASM_CONST macro into ppc_asm for ppc32 and ppc64 since that
seems like a much better place for it long term.  Also, by adding the
macro to ppc32 it will ease some future merging of code into arch/powerpc.

Signed-off-by: Kumar Gala <kumar.gala@freescale.com>

---
commit f56255eddd631902e3835bf7cdd8d94e69799097
tree 82c222d64fdccbaed25e302816fd4cf6237e8d56
parent 71c22e7cc4bf30119761b60b26c498d7b9d33e36
author Kumar K. Gala <kumar.gala@freescale.com> Wed, 07 Sep 2005 13:53:35 -0500
committer Kumar K. Gala <kumar.gala@freescale.com> Wed, 07 Sep 2005 13:53:35 -0500

 include/asm-ppc/ppc_asm.h    |   12 ++++++++++++
 include/asm-ppc64/cputable.h |    2 +-
 include/asm-ppc64/mmu.h      |    1 +
 include/asm-ppc64/page.h     |    8 +-------
 include/asm-ppc64/ppc_asm.h  |    7 +++++++
 5 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/include/asm-ppc/ppc_asm.h b/include/asm-ppc/ppc_asm.h
--- a/include/asm-ppc/ppc_asm.h
+++ b/include/asm-ppc/ppc_asm.h
@@ -11,6 +11,9 @@
  *  2 of the License, or (at your option) any later version.
  */
 
+#ifndef __PPC_ASM_H
+#define __PPC_ASM_H
+
 #include <linux/config.h>
 
 /*
@@ -348,3 +351,12 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
 #define N_RSYM	64
 #define N_SLINE	68
 #define N_SO	100
+
+#ifdef __ASSEMBLY__
+  #define ASM_CONST(x) x
+#else
+  #define __ASM_CONST(x) x##UL
+  #define ASM_CONST(x) __ASM_CONST(x)
+#endif
+
+#endif /* __PPC_ASM_H */
diff --git a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h
--- a/include/asm-ppc64/cputable.h
+++ b/include/asm-ppc64/cputable.h
@@ -16,7 +16,7 @@
 #define __ASM_PPC_CPUTABLE_H
 
 #include <linux/config.h>
-#include <asm/page.h> /* for ASM_CONST */
+#include <asm/ppc_asm.h> /* for ASM_CONST */
 
 /* Exposed to userland CPU features - Must match ppc32 definitions */
 #define PPC_FEATURE_32			0x80000000
diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h
--- a/include/asm-ppc64/mmu.h
+++ b/include/asm-ppc64/mmu.h
@@ -14,6 +14,7 @@
 #define _PPC64_MMU_H_
 
 #include <linux/config.h>
+#include <asm/ppc_asm.h> /* for ASM_CONST */
 #include <asm/page.h>
 
 /*
diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h
--- a/include/asm-ppc64/page.h
+++ b/include/asm-ppc64/page.h
@@ -11,13 +11,7 @@
  */
 
 #include <linux/config.h>
-
-#ifdef __ASSEMBLY__
-  #define ASM_CONST(x) x
-#else
-  #define __ASM_CONST(x) x##UL
-  #define ASM_CONST(x) __ASM_CONST(x)
-#endif
+#include <asm/ppc_asm.h> /* for ASM_CONST */
 
 /* PAGE_SHIFT determines the page size */
 #define PAGE_SHIFT	12
diff --git a/include/asm-ppc64/ppc_asm.h b/include/asm-ppc64/ppc_asm.h
--- a/include/asm-ppc64/ppc_asm.h
+++ b/include/asm-ppc64/ppc_asm.h
@@ -239,4 +239,11 @@
 #define	vr30	30
 #define	vr31	31
 
+#ifdef __ASSEMBLY__
+  #define ASM_CONST(x) x
+#else
+  #define __ASM_CONST(x) x##UL
+  #define ASM_CONST(x) __ASM_CONST(x)
+#endif
+
 #endif /* _PPC64_PPC_ASM_H */

^ permalink raw reply

* Re: Platform devices on MPC8245
From: Mark Brown @ 2005-09-07 16:58 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-embedded list
In-Reply-To: <431F187E.4070006@ru.mvista.com>

On Wed, Sep 07, 2005 at 08:42:38PM +0400, Vitaly Bordug wrote:

> Yes, that's right. The proper solution (I guess) will be reconfiguration 
>  in  mpc10x_bridge_init() so that memory covered by the bridge do not 
> intercept anything what pdevs request. Or (less probably) there's 
> something odd in pdevs descriptions - if so you need to find out what 
> exactly is intercepted with the bridge area.

Setting the parent for the on-chip devices to be the PCI bridge ought to
do the trick, I think.  The thing that's worrying me is that I can't see
how existing users of this code manage to do so successfully.

-- 
"You grabbed my hand and we fell into it, like a daydream - or a fever."

^ permalink raw reply

* Re: Platform devices on MPC8245
From: Vitaly Bordug @ 2005-09-07 16:42 UTC (permalink / raw)
  To: Mark Brown; +Cc: linuxppc-embedded list
In-Reply-To: <20050907163428.GA8522@projectcolo.org.uk>

Mark Brown wrote:
> On Wed, Aug 31, 2005 at 01:26:00PM +0100, Mark Brown wrote:
> 
> 
>>I'm having some trouble using the platform device support for the
>>MPC8245 using memory map B, set up using mpc10x_bridge_init().  When
>>that function registers the host bridge it registers addresses
>>0x80000000-0xfebfffff for the bridge but by default (with EUMB mapped to
>>MPC10X_MAPB_EUMB_BASE) the platform devices on the chip are also within
>>this address range.  The problem I'm seeing is that when
>>platform_device_register() comes to call request_resource() on the
>>devices that call fails because the addresses have already been
>>allocated to the PCI host bridge.
> 
> 
> Does anyone have any suggestions as to what I'm doing wrong with this?
> Using kernel 2.6.13 I am currently working around the issue by making
> the platform bus use insert_resource() rather than request_resource() as
> in the patch below but this really seems like the wrong solution.
> 
Yes, that's right. The proper solution (I guess) will be reconfiguration 
  in  mpc10x_bridge_init() so that memory covered by the bridge do not 
intercept anything what pdevs request. Or (less probably) there's 
something odd in pdevs descriptions - if so you need to find out what 
exactly is intercepted with the bridge area.



-- 
Sincerely,
Vitaly

^ permalink raw reply

* Re: Platform devices on MPC8245
From: Mark Brown @ 2005-09-07 16:34 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <20050831122556.GA474@projectcolo.org.uk>

On Wed, Aug 31, 2005 at 01:26:00PM +0100, Mark Brown wrote:

> I'm having some trouble using the platform device support for the
> MPC8245 using memory map B, set up using mpc10x_bridge_init().  When
> that function registers the host bridge it registers addresses
> 0x80000000-0xfebfffff for the bridge but by default (with EUMB mapped to
> MPC10X_MAPB_EUMB_BASE) the platform devices on the chip are also within
> this address range.  The problem I'm seeing is that when
> platform_device_register() comes to call request_resource() on the
> devices that call fails because the addresses have already been
> allocated to the PCI host bridge.

Does anyone have any suggestions as to what I'm doing wrong with this?
Using kernel 2.6.13 I am currently working around the issue by making
the platform bus use insert_resource() rather than request_resource() as
in the patch below but this really seems like the wrong solution.

--- linux-2.6.13/drivers/base/platform.c        2005-08-29 00:41:01.000000000 +0100
+++ linux/drivers/base/platform.c       2005-09-07 17:26:10.459969600 +0100
@@ -149,7 +149,7 @@
                                p = &ioport_resource;
                }

-               if (p && request_resource(p, r)) {
+               if (p && insert_resource(p, r)) {
                        printk(KERN_ERR
                               "%s: failed to claim resource %d\n",
                               pdev->dev.bus_id, i);


-- 
"You grabbed my hand and we fell into it, like a daydream - or a fever."

^ permalink raw reply

* Re: Xilinx SystemACE driver for 2.6
From: Jeff Angielski @ 2005-09-07 13:56 UTC (permalink / raw)
  To: glikely; +Cc: linuxppc-embedded
In-Reply-To: <528646bc050906112673dd4543@mail.gmail.com>

On Tue, 2005-09-06 at 18:26 +0000, Grant Likely wrote:
> Has anybody ported the SystemACE driver from 2.4 to 2.6 yet?  If so,
> where can I pull a patch from?  Otherwise I'll start work on it.

Along these lines, has anybody done any work to improve the overall
performance of the driver?

What kind of throughput are you seeing on your systems?

With our 266MHz MPC8260 w/ SystemACE (DENX linux-2.4.25), we see the
following numbers from Bonnie 1.4.  The first set is for an ext2 system
and the second is for ext3...

---Sequential Output (nosync)--- ---Sequential Input-- --Rnd Seek-
-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --04k (03)-
MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU   /sec %CPU
  
     696 65.9  1638  5.7   367  1.6   438 47.6   868  1.7   59.5  5.4

     540 53.4   901  9.4   355  1.8   495 54.1   862  1.6   52.4  3.0



Jeff Angielski
The PTR Group

^ permalink raw reply

* Re: How can I compile the module into kernel
From: Nuguru Susheel @ 2005-09-07 14:21 UTC (permalink / raw)
  To: zhonglei; +Cc: linuxppc-embedded

Zhonglei,

 after your kernel boots up and you have command line on ur console
type 
"insmod htm.o" for normal insertion, if anything goes wrong try to force
"insmod -f htm.o"

forcing option is not recommended .. go through these pages
http://www.tldp.org/LDP/lkmpg/

> My driver is a char device driver htm.o. How can I compile it into my kernel?

^ permalink raw reply

* newbie question : how to register for a new interrupt
From: Nuguru Susheel @ 2005-09-07 14:14 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

   I have written an service routine for handling the GPIO_WAKEUP
interrupt PSC2_4 pin (MPC5200 Core), but I donno how to register this
routine into the kernel. 

I have connected an external circuit which generates interrupts to this
PSC2_4 pin, but I believe the Core doesnt know what to do when this
interrupt is generated without registering this routine ...

Help/Suggestions/Redirections please .......


--Cheers 
   nSr

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox