LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 19/20] [POWERPC] pci32: 4xx embedded platforms want to reassign all PCI resources
From: Josh Boyer @ 2007-12-13 19:05 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <20071213073851.C321FDDFC9@ozlabs.org>

On Thu, 13 Dec 2007 18:38:46 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> This makes 4xx embedded platforms re-assign all PCI resources as we
> pretty much never care about what the various firmwares have done on
> these, it's generally not compatible with the way the kernel will map
> the bridges.
> 
> We still need to also enable bus renumbering on some of them, but I
> will do that from a separate patch after I've fixed 4xx PCIe to handle
> all bus numbers.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

[snip]

> Index: linux-work/arch/powerpc/platforms/44x/sequoia.c
> ===================================================================
> --- linux-work.orig/arch/powerpc/platforms/44x/sequoia.c	2007-12-10 16:51:42.000000000 +1100
> +++ linux-work/arch/powerpc/platforms/44x/sequoia.c	2007-12-10 16:55:06.000000000 +1100
> @@ -21,7 +21,8 @@
>  #include <asm/udbg.h>
>  #include <asm/time.h>
>  #include <asm/uic.h>
> -#include "44x.h"
> +#include <asm/pci-bridge.h>
> +

Oh, and you also broke the Sequoia build with this change because you
removed the 44x.h include :).

josh

^ permalink raw reply

* Re: [ofa-general] Re: [ewg] Re: [PATCH] IB/ehca: Serialize HCA-related hCalls on POWER5
From: Caitlin Bestler @ 2007-12-13 19:22 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: Arnd Bergmann, Roland Dreier, Joachim Fenkes, LKML, linuxppc-dev,
	OF-General, Stefan Roscher
In-Reply-To: <4760EDC0.5020703@voltaire.com>

On Dec 13, 2007 12:30 AM, Or Gerlitz <ogerlitz@voltaire.com> wrote:
> Roland Dreier wrote:
> > I think the right fix for iSER would be to make iSER work even for
> > devices that don't support FMRs.  For example cxgb3 doesn't implement
> > FMRs so if anyone ever updates iSER to work on iWARP and not just IB,
> > then this is something that has to be tackled anyway.  Then ehca could
> > just get rid of the FMR support it has.
>
> OK, The iSER design took into account the case of many initiators
> running on strong/modern machines talking to possibly lightweight
> embedded target for which the processing cost per I/O at the target side
> should be minimized, that is at most --one-- RDMA operation should be
> issued by the target to serve an I/O request.
>
> For that end, iSER works with one descriptor (called stag in iWARP and
> rkey in IB) per I/O direction sent from the initiator to the target and
> hence can't work without some sort of FMR implementation.
>
> The current implementation of the open iscsi initiator makes sure to
> issue commands in thread (sleepable) context, see iscsi_xmitworker and
> references to it in drivers/scsi/libiscsi.c , so this keeps ehca users
> safe for the time being.
>
> Or.
>

I agree, *some* form of FMR support is important for iSER (and probably
for NFS over RDMA as well). Rather than adding a crippled NO FMR
mode it would make more sense to add support for FMR Work Requests.
I'm not certain what, if any, impact that would have on the Power5 problem,
but that's certainly a cleaner path for iWARP.

^ permalink raw reply

* Re: [PATCH 1/20] [POWERPC] Reworking machine check handling and Fix 440/440A
From: Josh Boyer @ 2007-12-13 19:53 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <20071213073836.A25EDDDF80@ozlabs.org>

On Thu, 13 Dec 2007 18:38:31 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> This adds a cputable function pointer for the CPU-side machine
> check handling. The semantic is still the same as the old one,
> the one in ppc_md. overrides the one in cputable, though
> ultimately we'll want to change that so the CPU gets first.
>=20
> This removes CONFIG_440A which was a problem for multiplatform
> kernels and instead fixes up the IVOR at runtime from a setup_cpu
> function. The "A" version of the machine check also tweaks the
> regs->trap value to differenciate the 2 versions at the C level.

[snip]

> Index: linux-merge/include/asm-ppc/reg_booke.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- linux-merge.orig/include/asm-ppc/reg_booke.h	2007-12-11 16:21:38.0000=
00000 +1100
> +++ linux-merge/include/asm-ppc/reg_booke.h	2007-12-11 16:23:21.000000000=
 +1100
> @@ -207,7 +207,7 @@
>  #define	CCR1_TCS	0x00000080 /* Timer Clock Select */
>=20
>  /* Bit definitions for the MCSR. */
> -#ifdef CONFIG_440A
> +#ifdef CONFIG_44x
>  #define MCSR_MCS	0x80000000 /* Machine Check Summary */
>  #define MCSR_IB		0x40000000 /* Instruction PLB Error */
>  #define MCSR_DRB	0x20000000 /* Data Read PLB Error */

This breaks non-44x based arch/ppc platforms.  For example ep405 in
arch/ppc fails with:

/home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c: In function =E2=80=98m=
achine_check_440A=E2=80=99:
/home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:260: error: =E2=80=98MC=
SR_IB=E2=80=99 undeclared (first use in this function)
/home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:260: error: (Each undec=
lared identifier is reported only once
/home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:260: error: for each fu=
nction it appears in.)
/home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:262: error: =E2=80=98MC=
SR_DRB=E2=80=99 undeclared (first use in this function)
/home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:264: error: =E2=80=98MC=
SR_DWB=E2=80=99 undeclared (first use in this function)
/home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:266: error: =E2=80=98MC=
SR_TLBP=E2=80=99 undeclared (first use in this function)
/home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:268: error: =E2=80=98MC=
SR_ICP=E2=80=99 undeclared (first use in this function)
/home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:272: error: =E2=80=98MC=
SR_DCSP=E2=80=99 undeclared (first use in this function)
/home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:274: error: =E2=80=98MC=
SR_DCFP=E2=80=99 undeclared (first use in this function)
/home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:276: error: =E2=80=98MC=
SR_IMPE=E2=80=99 undeclared (first use in this function)
make[2]: *** [arch/ppc/kernel/traps.o] Error 1

The same is true for other platforms as well.  Getting closer...

josh

^ permalink raw reply

* Re: [PATCH/RFC] CPM1: implement GPIO API
From: Arnd Bergmann @ 2007-12-13 20:31 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <20071213165530.GB4347@loki.buserror.net>

On Thursday 13 December 2007, Scott Wood wrote:
> > +}
> > +EXPORT_SYMBOL_GPL(gpio_request);
> 
> This is an API, not internals; can we stick with plain EXPORT_SYMBOL()?

The architecture independent API posted by David Brownell uses _GPL,
see http://lkml.org/lkml/2007/11/9/141.

I'd vote for _GPL on all new interfaces anyway, but I guess this one
is really David's decision since he came up with the API.

	Arnd <><

^ permalink raw reply

* Re: apm_emulation regression
From: Benjamin Herrenschmidt @ 2007-12-13 20:31 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Rafael J. Wysocki, linuxppc-dev list, linux-pm, ralf
In-Reply-To: <1197546020.6558.247.camel@johannes.berg>


On Thu, 2007-12-13 at 12:40 +0100, Johannes Berg wrote:
> > > That basically means X will break. That's why X broke on the latest
> > > ubuntu until I whacked some new scripts in them to force console
> > > switching, among other things. Possibly other apps that relied
> > > on /dev/apm_bios to be notified of system suspend/resume broke as well.
> > 
> > Ah. I guess I never noticed because I had the scripts to do console
> > switching all along.
> 
> Actually, it just occurred to me that the *kernel* does a console switch
> when we use /sys/power/state, so maybe that is why I never had a problem
> rather than userspace doing a console switch (which it only started
> doing very recently)

The kernel console switching can be disabled and -is- by some distros.
For example, the problem I was having was when testing Gutsy before it
was final, the script to console switch wasn't in the right place for
powermac and didn't work. X wouldn't be suspended properly and the
machine would lockup.

In general, we should try to fix that, as other things might rely
on /dev/apm_bios doing the right thing.

Ben.

^ permalink raw reply

* Re: [PATCH 19/20] [POWERPC] pci32: 4xx embedded platforms want to reassign all PCI resources
From: Benjamin Herrenschmidt @ 2007-12-13 20:37 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <20071213130113.59342c40@weaponx>


> This one is slightly broken in my opinion.  You've added
> the ppc_pci_flags to all of these platforms, which is fine for your
> intended goal.  But now all of these platforms _have_ to compile with
> PCI enabled or they'll break with:
> 
> arch/powerpc/platforms/built-in.o: In function `walnut_probe':
> walnut.c:(.init.text+0x9a): undefined reference to `ppc_pci_flags'
> walnut.c:(.init.text+0xa6): undefined reference to `ppc_pci_flags'
> make[1]: *** [.tmp_vmlinux1] Error 1
> 
> So to do it correctly we need to either select CONFIG_PCI for all of
> them, wrap the ppc_pci_flags assignment in #ifdef CONFIG_PCI, or move
> the ppc_pci_flags variable declaration into something that always gets
> compiled.

Hrm... PCI is user selectable ? Forgot about that ...

All those platforms have PCI slots, so we may as well select it in
Kconfig... I'd rather avoid #ifdef's

Ben.

^ permalink raw reply

* Re: [PATCH 19/20] [POWERPC] pci32: 4xx embedded platforms want to reassign all PCI resources
From: Benjamin Herrenschmidt @ 2007-12-13 20:37 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <20071213130547.728d873d@weaponx>


On Thu, 2007-12-13 at 13:05 -0600, Josh Boyer wrote:
> On Thu, 13 Dec 2007 18:38:46 +1100
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> 
> > This makes 4xx embedded platforms re-assign all PCI resources as we
> > pretty much never care about what the various firmwares have done on
> > these, it's generally not compatible with the way the kernel will map
> > the bridges.
> > 
> > We still need to also enable bus renumbering on some of them, but I
> > will do that from a separate patch after I've fixed 4xx PCIe to handle
> > all bus numbers.
> > 
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> [snip]
> 
> > Index: linux-work/arch/powerpc/platforms/44x/sequoia.c
> > ===================================================================
> > --- linux-work.orig/arch/powerpc/platforms/44x/sequoia.c	2007-12-10 16:51:42.000000000 +1100
> > +++ linux-work/arch/powerpc/platforms/44x/sequoia.c	2007-12-10 16:55:06.000000000 +1100
> > @@ -21,7 +21,8 @@
> >  #include <asm/udbg.h>
> >  #include <asm/time.h>
> >  #include <asm/uic.h>
> > -#include "44x.h"
> > +#include <asm/pci-bridge.h>
> > +
> 
> Oh, and you also broke the Sequoia build with this change because you
> removed the 44x.h include :).

Ok.

Ben.

^ permalink raw reply

* Re: [PATCH 19/20] [POWERPC] pci32: 4xx embedded platforms want to reassign all PCI resources
From: Josh Boyer @ 2007-12-13 20:40 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev
In-Reply-To: <1197578243.15741.150.camel@pasglop>

On Fri, 14 Dec 2007 07:37:23 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> 
> > This one is slightly broken in my opinion.  You've added
> > the ppc_pci_flags to all of these platforms, which is fine for your
> > intended goal.  But now all of these platforms _have_ to compile with
> > PCI enabled or they'll break with:
> > 
> > arch/powerpc/platforms/built-in.o: In function `walnut_probe':
> > walnut.c:(.init.text+0x9a): undefined reference to `ppc_pci_flags'
> > walnut.c:(.init.text+0xa6): undefined reference to `ppc_pci_flags'
> > make[1]: *** [.tmp_vmlinux1] Error 1
> > 
> > So to do it correctly we need to either select CONFIG_PCI for all of
> > them, wrap the ppc_pci_flags assignment in #ifdef CONFIG_PCI, or move
> > the ppc_pci_flags variable declaration into something that always gets
> > compiled.
> 
> Hrm... PCI is user selectable ? Forgot about that ...
> 
> All those platforms have PCI slots, so we may as well select it in
> Kconfig... I'd rather avoid #ifdef's

What about people that don't have PCI on their boards, or don't really
care about it?

josh

^ permalink raw reply

* Re: [PATCH 1/20] [POWERPC] Reworking machine check handling and Fix 440/440A
From: Benjamin Herrenschmidt @ 2007-12-13 20:38 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <20071213135317.0cffbfb8@weaponx>


> This breaks non-44x based arch/ppc platforms.  For example ep405 in
> arch/ppc fails with:
> 
> /home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c: In function ‘machine_check_440A’:
> /home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:260: error: ‘MCSR_IB’ undeclared (first use in this function)
> /home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:260: error: (Each undeclared identifier is reported only once
> /home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:260: error: for each function it appears in.)
> /home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:262: error: ‘MCSR_DRB’ undeclared (first use in this function)
> /home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:264: error: ‘MCSR_DWB’ undeclared (first use in this function)
> /home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:266: error: ‘MCSR_TLBP’ undeclared (first use in this function)
> /home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:268: error: ‘MCSR_ICP’ undeclared (first use in this function)
> /home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:272: error: ‘MCSR_DCSP’ undeclared (first use in this function)
> /home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:274: error: ‘MCSR_DCFP’ undeclared (first use in this function)
> /home/jwboyer/src/linux-2.6/arch/ppc/kernel/traps.c:276: error: ‘MCSR_IMPE’ undeclared (first use in this function)
> make[2]: *** [arch/ppc/kernel/traps.o] Error 1
> 
> The same is true for other platforms as well.  Getting closer...

True, I intended to use 4xx not 44x for the ifdef... very easy typo to
make.

Ben.

^ permalink raw reply

* Re: [PATCH 19/20] [POWERPC] pci32: 4xx embedded platforms want to reassign all PCI resources
From: Benjamin Herrenschmidt @ 2007-12-13 20:52 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <20071213144056.1a46b7a3@weaponx>


On Thu, 2007-12-13 at 14:40 -0600, Josh Boyer wrote:
> 
> > > This one is slightly broken in my opinion.  You've added
> > > the ppc_pci_flags to all of these platforms, which is fine for
> your
> > > intended goal.  But now all of these platforms _have_ to compile
> with
> > > PCI enabled or they'll break with:
> > > 
> > > arch/powerpc/platforms/built-in.o: In function `walnut_probe':
> > > walnut.c:(.init.text+0x9a): undefined reference to `ppc_pci_flags'
> > > walnut.c:(.init.text+0xa6): undefined reference to `ppc_pci_flags'
> > > make[1]: *** [.tmp_vmlinux1] Error 1
> > > 
> > > So to do it correctly we need to either select CONFIG_PCI for all
> of
> > > them, wrap the ppc_pci_flags assignment in #ifdef CONFIG_PCI, or
> move
> > > the ppc_pci_flags variable declaration into something that always
> gets
> > > compiled.
> > 
> > Hrm... PCI is user selectable ? Forgot about that ...
> > 
> > All those platforms have PCI slots, so we may as well select it in
> > Kconfig... I'd rather avoid #ifdef's
> 
> What about people that don't have PCI on their boards, or don't really
> care about it?

Then those boards wouldn't be a walnut, ep405, ... right ?

That's why I put the flags in the BSP. If your board has no PCI, don't
muck around with the PCI flags. 

Ben.

^ permalink raw reply

* Re: [ofa-general] Re: [ewg] Re: [PATCH] IB/ehca: Serialize HCA-related hCalls on POWER5
From: Joachim Fenkes @ 2007-12-13 20:59 UTC (permalink / raw)
  To: Caitlin Bestler
  Cc: Arnd Bergmann, Roland Dreier, LKML, Or Gerlitz, linuxppc-dev,
	caitlin.bestler, OF-General, Stefan Roscher
In-Reply-To: <469958e00712131122s661dd970ud359389e1c6637d4@mail.gmail.com>

caitlin.bestler@gmail.com wrote on 13.12.2007 20:22:49:

> On Dec 13, 2007 12:30 AM, Or Gerlitz <ogerlitz@voltaire.com> wrote:
> > The current implementation of the open iscsi initiator makes sure to
> > issue commands in thread (sleepable) context, see iscsi_xmitworker and
> > references to it in drivers/scsi/libiscsi.c , so this keeps ehca users
> > safe for the time being.

> I agree, *some* form of FMR support is important for iSER (and probably
> for NFS over RDMA as well). Rather than adding a crippled NO FMR
> mode it would make more sense to add support for FMR Work Requests.
> I'm not certain what, if any, impact that would have on the Power5 
problem,
> but that's certainly a cleaner path for iWARP.

Well, FMR WRs wouldn't change the eHCA issue -- the driver would have to 
make an hCall in any case, and the architecture says that the hCalls used 
in this scenario might return H_LONG_BUSY, causing the driver to sleep. No 
way around that. Because of this, eHCA's FMRs are actually standard MRs 
with a different API.

If, as Or said, the iSCSI initiator issues commands in sleepable context 
anyway, nothing would be lost by using standard MRs as a fallback solution 
if FMRs aren't available, would it?

J.

^ permalink raw reply

* Re: [PATCH 19/20] [POWERPC] pci32: 4xx embedded platforms want to reassign all PCI resources
From: Josh Boyer @ 2007-12-13 21:11 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev
In-Reply-To: <1197579177.15741.169.camel@pasglop>

On Fri, 14 Dec 2007 07:52:57 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> 
> On Thu, 2007-12-13 at 14:40 -0600, Josh Boyer wrote:
> > 
> > > > This one is slightly broken in my opinion.  You've added
> > > > the ppc_pci_flags to all of these platforms, which is fine for
> > your
> > > > intended goal.  But now all of these platforms _have_ to compile
> > with
> > > > PCI enabled or they'll break with:
> > > > 
> > > > arch/powerpc/platforms/built-in.o: In function `walnut_probe':
> > > > walnut.c:(.init.text+0x9a): undefined reference to `ppc_pci_flags'
> > > > walnut.c:(.init.text+0xa6): undefined reference to `ppc_pci_flags'
> > > > make[1]: *** [.tmp_vmlinux1] Error 1
> > > > 
> > > > So to do it correctly we need to either select CONFIG_PCI for all
> > of
> > > > them, wrap the ppc_pci_flags assignment in #ifdef CONFIG_PCI, or
> > move
> > > > the ppc_pci_flags variable declaration into something that always
> > gets
> > > > compiled.
> > > 
> > > Hrm... PCI is user selectable ? Forgot about that ...
> > > 
> > > All those platforms have PCI slots, so we may as well select it in
> > > Kconfig... I'd rather avoid #ifdef's
> > 
> > What about people that don't have PCI on their boards, or don't really
> > care about it?
> 
> Then those boards wouldn't be a walnut, ep405, ... right ?
> 
> That's why I put the flags in the BSP. If your board has no PCI, don't
> muck around with the PCI flags. 

Well, there is physical PCI hardware on the boards, yes.  But what if
people have no intention of using it?  E.g. they have no devices, etc.
Now we're requiring PCI support to be built into the kernel.

I'm just being pedantic about keeping embedded tiny.

josh

^ permalink raw reply

* RE: [ofa-general] Re: [ewg] Re: [PATCH] IB/ehca: Serialize HCA-related hCalls on POWER5
From: Caitlin Bestler @ 2007-12-13 21:08 UTC (permalink / raw)
  To: Joachim Fenkes
  Cc: Arnd Bergmann, Roland Dreier, LKML, Or Gerlitz, linuxppc-dev,
	OF-General, Stefan Roscher
In-Reply-To: <OFD5B7D5E6.3538DC2A-ONC12573B0.0072D42A-C12573B0.00735730@de.ibm.com>



> -----Original Message-----
> From: Joachim Fenkes [mailto:FENKES@de.ibm.com]
> Sent: Thursday, December 13, 2007 1:00 PM
> To: Caitlin Bestler
> Cc: Arnd Bergmann; caitlin.bestler@gmail.com; OF-General; LKML;
> linuxppc-dev@ozlabs.org; Or Gerlitz; Roland Dreier; Stefan Roscher
> Subject: Re: [ofa-general] Re: [ewg] Re: [PATCH] IB/ehca: Serialize
> HCA-related hCalls on POWER5
>=20
> caitlin.bestler@gmail.com wrote on 13.12.2007 20:22:49:
>=20
> > On Dec 13, 2007 12:30 AM, Or Gerlitz <ogerlitz@voltaire.com> wrote:
> > > The current implementation of the open iscsi initiator makes sure
> to
> > > issue commands in thread (sleepable) context, see iscsi_xmitworker
> and
> > > references to it in drivers/scsi/libiscsi.c , so this keeps ehca
> users
> > > safe for the time being.
>=20
> > I agree, *some* form of FMR support is important for iSER (and
> probably
> > for NFS over RDMA as well). Rather than adding a crippled NO FMR
> > mode it would make more sense to add support for FMR Work Requests.
> > I'm not certain what, if any, impact that would have on the Power5
> problem,
> > but that's certainly a cleaner path for iWARP.
>=20
> Well, FMR WRs wouldn't change the eHCA issue -- the driver would have
> to
> make an hCall in any case, and the architecture says that the hCalls
> used
> in this scenario might return H_LONG_BUSY, causing the driver to
sleep.
> No
> way around that. Because of this, eHCA's FMRs are actually standard
MRs
> with a different API.
>=20
> If, as Or said, the iSCSI initiator issues commands in sleepable
> context
> anyway, nothing would be lost by using standard MRs as a fallback
> solution
> if FMRs aren't available, would it?
>=20

To clarify, an FMR Work Request is simply posted to the SendQ like
any other Work Request (of course the QP has to be privileged, or
it will complete in error). An SQ Post should never block.

But yes, if the current iSCSI initiator always does all call-based
FMRs in a sleepable context then I would agree then any changes can
wait for the first vendor that wants to support FMR Work Requests.

FMR Work Requests can be pipelined, so anyone with hardware that
supported them would have strong motivation to enable the open
iSCSI initiator to take advantage of this.

^ permalink raw reply

* Re: [PATCH 2/4] mpc8313erdb: Add NAND to device tree, and call of_platform_bus_probe().
From: Olof Johansson @ 2007-12-13 21:40 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20071213171714.GA4510@loki.buserror.net>

On Thu, Dec 13, 2007 at 11:17:14AM -0600, Scott Wood wrote:
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> diff --git a/arch/powerpc/platforms/83xx/mpc8313_rdb.c b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
> index 6fb8299..3ad482a 100644
> --- a/arch/powerpc/platforms/83xx/mpc8313_rdb.c
> +++ b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
> @@ -14,6 +14,7 @@
>   */
>  
>  #include <linux/pci.h>
> +#include <linux/of_platform.h>
>  
>  #include <asm/time.h>
>  #include <asm/ipic.h>
> @@ -75,6 +76,22 @@ static int __init mpc8313_rdb_probe(void)
>  	return of_flat_dt_is_compatible(root, "MPC8313ERDB");
>  }
>  
> +static struct of_device_id __initdata of_bus_ids[] = {
> +	{ .name = "soc8313", },
> +	{ .name = "localbus", },

Please probe based on compatible instead of name properties.


Thanks,

Olof

^ permalink raw reply

* RE: [ofa-general] Re: [ewg] Re: [PATCH] IB/ehca: Serialize HCA-related hCalls on POWER5
From: Joachim Fenkes @ 2007-12-13 21:35 UTC (permalink / raw)
  To: Caitlin Bestler
  Cc: Arnd Bergmann, Roland Dreier, LKML, Or Gerlitz, linuxppc-dev,
	OF-General, Stefan Roscher
In-Reply-To: <78C9135A3D2ECE4B8162EBDCE82CAD7702B14004@nekter>

"Caitlin Bestler" <Caitlin.Bestler@neterion.com> wrote on 13.12.2007 
22:08:34:

> To clarify, an FMR Work Request is simply posted to the SendQ like
> any other Work Request (of course the QP has to be privileged, or
> it will complete in error). An SQ Post should never block.

This would require hardware support, wouldn't it? eHCA2 doesn't have this 
kind of support, so FMR WRs are not an option here.

J.

^ permalink raw reply

* Re: [PATCH 19/20] [POWERPC] pci32: 4xx embedded platforms want to reassign all PCI resources
From: Benjamin Herrenschmidt @ 2007-12-13 21:37 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <20071213151138.02db0cd8@weaponx>


On Thu, 2007-12-13 at 15:11 -0600, Josh Boyer wrote:
> Well, there is physical PCI hardware on the boards, yes.  But what if
> people have no intention of using it?  E.g. they have no devices, etc.
> Now we're requiring PCI support to be built into the kernel.
> 
> I'm just being pedantic about keeping embedded tiny.

Keeping your embedded design tiny (and thus your own BSP) is one thing,
but adding ifdef's all over the place so that somebody can tinify an
eval board, I'm less sure about this... but if you want, you can fixup
my patches.

Ben.

^ permalink raw reply

* Re: [PATCH 19/20] [POWERPC] pci32: 4xx embedded platforms want to reassign all PCI resources
From: Josh Boyer @ 2007-12-13 21:59 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev
In-Reply-To: <1197581846.15741.183.camel@pasglop>

On Fri, 14 Dec 2007 08:37:26 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> 
> On Thu, 2007-12-13 at 15:11 -0600, Josh Boyer wrote:
> > Well, there is physical PCI hardware on the boards, yes.  But what if
> > people have no intention of using it?  E.g. they have no devices, etc.
> > Now we're requiring PCI support to be built into the kernel.
> > 
> > I'm just being pedantic about keeping embedded tiny.
> 
> Keeping your embedded design tiny (and thus your own BSP) is one thing,
> but adding ifdef's all over the place so that somebody can tinify an
> eval board, I'm less sure about this... but if you want, you can fixup
> my patches.

I'm not really advocating for ifdefs.  If it annoys me enough (which I
doubt it will), then I'd try to come up with some way to avoid those
too.  For now, I think selecting PCI in Kconfig for those boards is OK.

josh

^ permalink raw reply

* RE: [ofa-general] Re: [ewg] Re: [PATCH] IB/ehca: SerializeHCA-related hCalls on POWER5
From: Sean Hefty @ 2007-12-13 21:48 UTC (permalink / raw)
  To: 'Caitlin Bestler', Joachim Fenkes
  Cc: Arnd Bergmann, Roland Dreier, LKML, linuxppc-dev, OF-General,
	Stefan Roscher
In-Reply-To: <78C9135A3D2ECE4B8162EBDCE82CAD7702B14004@nekter>

>To clarify, an FMR Work Request is simply posted to the SendQ like
>any other Work Request (of course the QP has to be privileged, or
>it will complete in error). An SQ Post should never block.

FMR's as defined by the IB spec and that created by Mellanox are not the same.
They, unfortunately, use the same name and acronym only.  Mellanox FMRs use an
API that is more like that of standard MRs. 

- Sean

^ permalink raw reply

* Device Tree updates for xilinx.
From: Stephen Neuendorffer @ 2007-12-13 23:41 UTC (permalink / raw)
  To: Stephen Neuendorffer, Grant Likely, Michal Simek, John Williams
  Cc: linuxppc-dev, git
In-Reply-To: <20071204012811.AD70CEF004D@mail134-dub.bigfish.com>

These patches synchronize all the in-kernel drivers to use the
compatible names generated by the UBoot BSP generator.
(at git://git.xilinx.com/gen-mhs-devtree.git)

The patches to make this work are coming shortly:

patches 1-2 are provided for context only...  They're not ready for
mainline.  They provide 'raw' boot support and port some initialization
code from ARCH=3Dppc.
patches 3-7 are the interesting patches, which I think could be taken
for 2.6.25.

I've also pushed the working tree up to git.xilinx.com containing these
patches.  This tree also includes updates for ps2, gpio, etc.
The ll_temac currently doesn't work because I haven't gone back and
fixed the mechanism by which it finds out about the DMA that it is
connected to.

If you want output from the boot loader, you'll need something like:
		linux,stdout-path =3D "/plb_v34/opb_v20/serial@40400000";=20
This seems to work with uartlite, but I wasn't able to get it working
with a UART design.

Currently, you'll need to add, by hand the following labels:

mem_size_cells, on the toplevel #address-cells attribue, e,g. :
	mem_size_cells: #address-cells =3D <1>;

timebase, on the processors timebase-frequency attribute, e.g. :
			timebase: timebase-frequency =3D <11e1a300>;

memsize, on the memory's size, e.g.:
	DDR_256MB_32MX64_rank1_row13_col10_cl2_5: memory@0 {
		device_type =3D "memory";
		reg =3D < 0 memsize:10000000 >;
	} ;

In addition, if you're using uartlite, you'll have to specify
'console=3DttyUL0' as boot args.

For reference, below is the device tree for a Virtex2Pro design.  Except
for the changes noted above, this is entirely automatically generated.

Steve

/ {
	mem_size_cells: #address-cells =3D <1>;
	#size-cells =3D <1>;
	compatible =3D "xlnx,virtex";
	model =3D "testing";
	DDR_256MB_32MX64_rank1_row13_col10_cl2_5: memory@0 {
		device_type =3D "memory";
		reg =3D < 0 memsize:10000000 >;
	} ;
	chosen {
		bootargs =3D "root=3D/dev/nfs
nfsroot=3D172.19.221.221:/exports/xup/ydl41 ip=3Ddhcp console=3DttyUL0";
	} ;
	cpus {
		#address-cells =3D <1>;
		#cpus =3D <1>;
		#size-cells =3D <0>;
		PowerPC,405@0 {
			clock-frequency =3D <11e1a300>;
			d-cache-line-size =3D <20>;
			d-cache-size =3D <4000>;
			device_type =3D "cpu";
			i-cache-line-size =3D <20>;
			i-cache-size =3D <4000>;
			reg =3D <0>;
			timebase: timebase-frequency =3D <11e1a300>;
			xlnx,dcr-resync =3D <0>;
			xlnx,deterministic-mult =3D <0>;
			xlnx,disable-operand-forwarding =3D <1>;
			xlnx,mmu-enable =3D <1>;
		} ;
	} ;
	plb_v34 {
		#address-cells =3D <1>;
		#size-cells =3D <1>;
		compatible =3D "xlnx,plb-v34-1.02.a";
		ranges ;
		Ethernet_MAC: ethernet@80400000 {
			compatible =3D "xlnx,plb-ethernet-1.01.a";
			device_type =3D "network";
			interrupt-parent =3D <&opb_intc_0>;
			interrupts =3D < 2 0 >;
			local-mac-address =3D [ 00 00 00 00 00 00 ];
			reg =3D < 80400000 10000 >;
			xlnx,dev-blk-id =3D <0>;
			xlnx,dev-mir-enable =3D <1>;
			xlnx,dma-intr-coalesce =3D <1>;
			xlnx,dma-present =3D <1>;
			xlnx,err-count-exist =3D <1>;
			xlnx,fcs-insert-exist =3D <1>;
			xlnx,half-duplex-exist =3D <1>;
			xlnx,include-dev-pencoder =3D <1>;
			xlnx,ipif-fifo-depth =3D <8000>;
			xlnx,mac-fifo-depth =3D <40>;
			xlnx,mii-exist =3D <1>;
			xlnx,miim-clkdvd =3D <13>;
			xlnx,pad-insert-exist =3D <1>;
			xlnx,reset-present =3D <1>;
			xlnx,source-addr-insert-exist =3D <1>;
		} ;
		opb_v20 {
			#address-cells =3D <1>;
			#size-cells =3D <1>;
			compatible =3D "xlnx,opb-v20-1.10.c";
			ranges ;
			Audio_Codec: opb-ac97@7d400000 {
				compatible =3D "xlnx,opb-ac97-2.00.a";
				interrupt-parent =3D <&opb_intc_0>;
				interrupts =3D < 1 0 >;
				reg =3D < 7d400000 10000 >;
				xlnx,intr-level =3D <1>;
				xlnx,playback =3D <1>;
				xlnx,record =3D <1>;
				xlnx,use-bram =3D <1>;
			} ;
			DIPSWs_4Bit: opb-gpio@40020000 {
				compatible =3D "xlnx,opb-gpio-3.01.b";
				reg =3D < 40020000 10000 >;
				xlnx,all-inputs =3D <1>;
				xlnx,all-inputs-2 =3D <0>;
				xlnx,dout-default =3D <0>;
				xlnx,dout-default-2 =3D <0>;
				xlnx,gpio-width =3D <4>;
				xlnx,interrupt-present =3D <0>;
				xlnx,is-bidir =3D <1>;
				xlnx,is-bidir-2 =3D <1>;
				xlnx,is-dual =3D <0>;
				xlnx,tri-default =3D <ffffffff>;
				xlnx,tri-default-2 =3D <ffffffff>;
				xlnx,user-id-code =3D <3>;
			} ;
			LEDs_4Bit: opb-gpio@40000000 {
				compatible =3D "xlnx,opb-gpio-3.01.b";
				reg =3D < 40000000 10000 >;
				xlnx,all-inputs =3D <0>;
				xlnx,all-inputs-2 =3D <0>;
				xlnx,dout-default =3D <0>;
				xlnx,dout-default-2 =3D <0>;
				xlnx,gpio-width =3D <4>;
				xlnx,interrupt-present =3D <0>;
				xlnx,is-bidir =3D <0>;
				xlnx,is-bidir-2 =3D <1>;
				xlnx,is-dual =3D <0>;
				xlnx,tri-default =3D <ffffffff>;
				xlnx,tri-default-2 =3D <ffffffff>;
				xlnx,user-id-code =3D <3>;
			} ;
			PS2_Ports: opb-ps2-dual-ref@7a400000 {
				#address-cells =3D <1>;
				#size-cells =3D <1>;
				compatible =3D "xlnx,compound";
				ranges =3D < 0 7a400000 10000 >;
				opb-ps2-dual-ref@0 {
					compatible =3D
"xlnx,opb-ps2-dual-ref-1.00.a";
					interrupt-parent =3D
<&opb_intc_0>;
					interrupts =3D < 6 0 >;
					reg =3D < 0 40 >;
				} ;
				opb-ps2-dual-ref@1000 {
					compatible =3D
"xlnx,opb-ps2-dual-ref-1.00.a";
					interrupt-parent =3D
<&opb_intc_0>;
					interrupts =3D < 5 0 >;
					reg =3D < 1000 40 >;
				} ;
			} ;
			PushButtons_5Bit: opb-gpio@40040000 {
				compatible =3D "xlnx,opb-gpio-3.01.b";
				reg =3D < 40040000 10000 >;
				xlnx,all-inputs =3D <1>;
				xlnx,all-inputs-2 =3D <0>;
				xlnx,dout-default =3D <0>;
				xlnx,dout-default-2 =3D <0>;
				xlnx,gpio-width =3D <5>;
				xlnx,interrupt-present =3D <0>;
				xlnx,is-bidir =3D <1>;
				xlnx,is-bidir-2 =3D <1>;
				xlnx,is-dual =3D <0>;
				xlnx,tri-default =3D <ffffffff>;
				xlnx,tri-default-2 =3D <ffffffff>;
				xlnx,user-id-code =3D <3>;
			} ;
			RS232_Uart_1: serial@40400000 {
				compatible =3D "xlnx,opb-uartlite-1.00.b";
				device_type =3D "serial";
				interrupt-parent =3D <&opb_intc_0>;
				interrupts =3D < 4 0 >;
				port-number =3D <0>;
				reg =3D < 40400000 10000 >;
				xlnx,baudrate =3D <2580>;
				xlnx,clk-freq =3D <5f5e100>;
				xlnx,data-bits =3D <8>;
				xlnx,odd-parity =3D <0>;
				xlnx,use-parity =3D <0>;
			} ;
			SysACE_CompactFlash: opb-sysace@41800000 {
				compatible =3D "xlnx,opb-sysace-1.00.c";
				interrupt-parent =3D <&opb_intc_0>;
				interrupts =3D < 3 0 >;
				reg =3D < 41800000 10000 >;
				xlnx,mem-width =3D <10>;
			} ;
			dcr_v29 {
				#address-cells =3D <1>;
				#size-cells =3D <1>;
				compatible =3D "xlnx,dcr-v29-1.00.a";
				ranges =3D < 0 40700000 1000 >;
				VGA_FrameBuffer: plb-tft-cntlr-ref@200 {
					compatible =3D
"xlnx,plb-tft-cntlr-ref-1.00.a";
					reg =3D < 200 8 >;
					xlnx,default-tft-base-addr =3D
<7f>;
					xlnx,dps-init =3D <1>;
					xlnx,on-init =3D <1>;
					xlnx,pixclk-is-busclk-divby4 =3D
<1>;
				} ;
			} ;
			onewire_0: opb-onewire@7a200000 {
				compatible =3D "xlnx,opb-onewire-1.00.a";
				reg =3D < 7a200000 10000 >;
				xlnx,add-pullup =3D "true";
				xlnx,checkcrc =3D "true";
				xlnx,clk-div =3D <f>;
			} ;
			opb_hwicap_0: opb-hwicap@41300000 {
				compatible =3D "xlnx,opb-hwicap-1.00.b";
				reg =3D < 41300000 10000 >;
			} ;
			opb_intc_0: interrupt-controller@41200000 {
				#interrupt-cells =3D <2>;
				compatible =3D "xlnx,opb-intc-1.00.c";
				interrupt-controller ;
				reg =3D < 41200000 10000 >;
				xlnx,num-intr-inputs =3D <7>;
			} ;
			opb_timer_0: opb-timer@40800000 {
				compatible =3D "xlnx,opb-timer-1.00.b";
				interrupt-parent =3D <&opb_intc_0>;
				interrupts =3D < 0 0 >;
				reg =3D < 40800000 100 >;
				xlnx,count-width =3D <20>;
				xlnx,gen0-assert =3D <1>;
				xlnx,gen1-assert =3D <1>;
				xlnx,one-timer-only =3D <0>;
				xlnx,trig0-assert =3D <1>;
				xlnx,trig1-assert =3D <1>;
			} ;
		} ;
	} ;
}  ;

^ permalink raw reply

* [PATCH 1/7] bootwrapper: Add a firmware-independent "raw" target.
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev

From: Grant Likely <grant.likely@secretlab.ca>

This target produces a flat binary rather than an ELF file,
fixes the entry point at the beginning of the image, and takes
a complete device tree with no fixups needed.

The device tree must have labels on /#address-cells, the timebase
frequency, and the memory size.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
 arch/powerpc/Kconfig             |   12 +++++++++++
 arch/powerpc/boot/Makefile       |    6 ++++-
 arch/powerpc/boot/io.h           |    7 ++++++
 arch/powerpc/boot/raw-platform.c |   41 ++++++++++++++++++++++++++++++++++++++
 arch/powerpc/boot/wrapper        |   15 +++++++++----
 5 files changed, 75 insertions(+), 6 deletions(-)
 create mode 100644 arch/powerpc/boot/raw-platform.c

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 232c298..4a60ec4 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -394,6 +394,18 @@ config WANT_DEVICE_TREE
 	bool
 	default n
 
+config BUILD_RAW_IMAGE
+	bool "Build firmware-independent image"
+	select WANT_DEVICE_TREE
+	help
+	  If this is enabled, a firmware independent "raw" image will be
+	  built, as zImage.raw.  This requires a completely filled-in
+	  device tree, with the following labels:
+
+	  mem_size_cells: on /#address-cells
+	  memsize: on the size portion of /memory/reg
+	  timebase: on the boot CPU's timebase property
+
 config DEVICE_TREE
 	string "Static device tree source file"
 	depends on WANT_DEVICE_TREE
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 18e3271..975e1f5 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -56,7 +56,7 @@ src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \
 		cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
 		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
 		cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \
-		fixed-head.S ep88xc.c cuboot-hpc2.c
+		fixed-head.S ep88xc.c cuboot-hpc2.c raw-platform.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -159,6 +159,7 @@ image-$(CONFIG_EBONY)			+= treeImage.ebony cuImage.ebony
 image-$(CONFIG_BAMBOO)			+= treeImage.bamboo cuImage.bamboo
 image-$(CONFIG_SEQUOIA)			+= cuImage.sequoia
 image-$(CONFIG_WALNUT)			+= treeImage.walnut
+image-$(CONFIG_BUILD_RAW_IMAGE)		+= zImage.raw
 endif
 
 # For 32-bit powermacs, build the COFF and miboot images
@@ -221,6 +222,9 @@ $(obj)/treeImage.initrd.%: vmlinux $(dts) $(wrapperbits)
 $(obj)/treeImage.%: vmlinux $(dts) $(wrapperbits)
 	$(call if_changed,wrap,treeboot-$*,$(dts))
 
+$(obj)/zImage.raw: vmlinux $(dts) $(wrapperbits)
+	$(call if_changed,wrap,raw,$(dts))
+
 # If there isn't a platform selected then just strip the vmlinux.
 ifeq (,$(image-y))
 image-y := vmlinux.strip
diff --git a/arch/powerpc/boot/io.h b/arch/powerpc/boot/io.h
index ccaedae..ec57ec9 100644
--- a/arch/powerpc/boot/io.h
+++ b/arch/powerpc/boot/io.h
@@ -99,4 +99,11 @@ static inline void barrier(void)
 	asm volatile("" : : : "memory");
 }
 
+static inline void disable_irq(void)
+{
+	int dummy;
+	asm volatile("mfmsr %0; rlwinm %0, %0, 0, ~(1<<15); mtmsr %0" :
+	             "=r" (dummy) : : "memory");
+}
+
 #endif /* _IO_H */
diff --git a/arch/powerpc/boot/raw-platform.c b/arch/powerpc/boot/raw-platform.c
new file mode 100644
index 0000000..b9caeee
--- /dev/null
+++ b/arch/powerpc/boot/raw-platform.c
@@ -0,0 +1,41 @@
+/*
+ * The "raw" platform -- for booting from a complete dtb without
+ * any fixups.
+ *
+ * Author: Scott Wood <scottwood@freescale.com>
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include "ops.h"
+#include "types.h"
+#include "io.h"
+
+BSS_STACK(4096);
+
+/* These are labels in the device tree. */
+extern u32 memsize[2], timebase, mem_size_cells;
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+                   unsigned long r6, unsigned long r7)
+{
+	u64 memsize64 = memsize[0];
+
+	if (mem_size_cells == 2) {
+		memsize64 <<= 32;
+		memsize64 |= memsize[1];
+	}
+
+	if (sizeof(void *) == 4 && memsize64 >= 0x100000000ULL)
+		memsize64 = 0xffffffff;
+
+	disable_irq();
+	timebase_period_ns = 1000000000 / timebase;
+	simple_alloc_init(_end, memsize64 - (unsigned long)_end, 32, 64);
+	ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
+	serial_console_init();
+}
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 31147a0..716cd44 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -116,10 +116,11 @@ while [ "$#" -gt 0 ]; do
 done
 
 if [ -n "$dts" ]; then
-    if [ -z "$dtb" ]; then
-	dtb="$platform.dtb"
-    fi
-    dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts"
+    dtasm="$object/$platform.dtb.S"
+    dto="$object/$platform.dtb.o"
+    echo '.section .kernel:dtb,"a"' > "$dtasm"
+    dtc -O asm -b 0 -V 16 "$dts" >> "$dtasm"
+    ${CROSS}gcc "$dtasm" -c -o "$dto"
 fi
 
 if [ -z "$kernel" ]; then
@@ -167,6 +168,10 @@ ep88xc)
     platformo="$object/fixed-head.o $object/$platform.o"
     binary=y
     ;;
+raw)
+    platformo="$object/fixed-head.o $object/raw-platform.o"
+    binary=y
+    ;;
 esac
 
 vmz="$tmpdir/`basename \"$kernel\"`.$ext"
@@ -230,7 +235,7 @@ fi
 
 if [ "$platform" != "miboot" ]; then
     ${CROSS}ld -m elf32ppc -T $lds -o "$ofile" \
-	$platformo $tmp $object/wrapper.a
+	$platformo $tmp $dto $object/wrapper.a
     rm $tmp
 fi
 
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 2/7] [POWERPC] Xilinx: clear data caches.
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev
In-Reply-To: <1197589413-5965-1-git-send-email-stephen.neuendorffer@xilinx.com>

This code is needed to boot without a boot loader.

Grant:  I'm not sure where the right place to put this is.  I'm assuming we'll actually need some boot code that is not generic?  Also, note that there is a V4FX errata workaround in arch/ppc/boot/head.S, which probably also needs to get pulled to powerpc.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 arch/powerpc/boot/raw-platform.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/raw-platform.c b/arch/powerpc/boot/raw-platform.c
index b9caeee..2a5e493 100644
--- a/arch/powerpc/boot/raw-platform.c
+++ b/arch/powerpc/boot/raw-platform.c
@@ -24,6 +24,28 @@ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
                    unsigned long r6, unsigned long r7)
 {
 	u64 memsize64 = memsize[0];
+	static const unsigned long line_size = 32;
+	static const unsigned long congruence_classes = 256;
+	unsigned long addr;
+	unsigned long dccr;
+
+	/*
+	 * Invalidate the data cache if the data cache is turned off.
+	 * - The 405 core does not invalidate the data cache on power-up
+	 *   or reset but does turn off the data cache. We cannot assume
+	 *   that the cache contents are valid.
+	 * - If the data cache is turned on this must have been done by
+	 *   a bootloader and we assume that the cache contents are
+	 *   valid.
+	 */
+	__asm__("mfdccr %0": "=r" (dccr));
+	if (dccr == 0) {
+		for (addr = 0;
+		     addr < (congruence_classes * line_size);
+		     addr += line_size) {
+			__asm__("dccci 0,%0": :"b"(addr));
+		}
+	}
 
 	if (mem_size_cells == 2) {
 		memsize64 <<= 32;
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 6/7] [POWERPC] Xilinx: Add correct compatible list for device tree bus bindings.
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev
In-Reply-To: <1197589413-5965-5-git-send-email-stephen.neuendorffer@xilinx.com>

Includes both flavors of plb, opb, dcr, and a pseudo 'compound' bus
for representing compound peripherals containing more than one logical
device.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 arch/powerpc/platforms/40x/virtex.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
index 859ba1d..7590fa5 100644
--- a/arch/powerpc/platforms/40x/virtex.c
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -15,12 +15,22 @@
 #include <asm/time.h>
 #include <asm/xilinx_intc.h>
 
+static struct of_device_id xilinx_of_bus_ids[] = {
+	{ .compatible = "xlnx,plb-v46-1.00.a", },
+	{ .compatible = "xlnx,plb-v34-1.01.a", },
+	{ .compatible = "xlnx,plb-v34-1.02.a", },
+	{ .compatible = "xlnx,opb-v20-1.10.c", },
+	{ .compatible = "xlnx,dcr-v29-1.00.a", },
+	{ .compatible = "xlnx,compound", },
+	{},
+};
+
 static int __init virtex_device_probe(void)
 {
 	if (!machine_is(virtex))
 		return 0;
 
-	of_platform_bus_probe(NULL, NULL, NULL);
+	of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL);
 
 	return 0;
 }
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 3/7] [POWERPC] Xilinx: Uartlite: Make console output actually work.
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev
In-Reply-To: <1197589413-5965-2-git-send-email-stephen.neuendorffer@xilinx.com>

From: Grant Likely <grant.likely@secretlab.ca>

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

Fixed to apply against 2.6.24-rc5, and remove DEBUG information.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 drivers/serial/uartlite.c |  121 +++++++++++++++++++++++++++++----------------
 1 files changed, 79 insertions(+), 42 deletions(-)

diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 3f59324..5ec42f3 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -9,6 +9,8 @@
  * kind, whether express or implied.
  */
 
+#undef DEBUG
+
 #include <linux/platform_device.h>
 #include <linux/module.h>
 #include <linux/console.h>
@@ -321,6 +323,49 @@ static struct uart_ops ulite_ops = {
 	.verify_port	= ulite_verify_port
 };
 
+/**
+ * ulite_get_port: Get the uart_port for a given port number and base addr
+ */
+static struct uart_port * ulite_get_port(int id)
+{
+	struct uart_port *port;
+
+	/* if id = -1; then scan for a free id and use that */
+	if (id < 0) {
+		for (id = 0; id < ULITE_NR_UARTS; id++)
+			if (ulite_ports[id].mapbase == 0)
+				break;
+	}
+
+	if ((id < 0) || (id >= ULITE_NR_UARTS)) {
+		printk(KERN_WARNING "uartlite: invalid id: %i\n", id);
+		return NULL;
+	}
+
+	/* The ID is valid, so get the address of the uart_port structure */
+	port = &ulite_ports[id];
+
+	/* Is the structure is already initialized? */
+	if (port->mapbase)
+		return port;
+
+	/* At this point, we've got an empty uart_port struct, initialize it */
+	spin_lock_init(&port->lock);
+	port->membase = NULL;
+	port->fifosize = 16;
+	port->regshift = 2;
+	port->iotype = UPIO_MEM;
+	port->iobase = 1; /* mark port in use */
+	port->ops = &ulite_ops;
+	port->irq = NO_IRQ;
+	port->flags = UPF_BOOT_AUTOCONF;
+	port->dev = NULL;
+	port->type = PORT_UNKNOWN;
+	port->line = id;
+
+	return port;
+}
+
 /* ---------------------------------------------------------------------
  * Console driver operations
  */
@@ -376,7 +421,7 @@ static void ulite_console_write(struct console *co, const char *s,
 }
 
 #if defined(CONFIG_OF)
-static inline void __init ulite_console_of_find_device(int id)
+static inline u32 __init ulite_console_of_find_device(int id)
 {
 	struct device_node *np;
 	struct resource res;
@@ -392,13 +437,14 @@ static inline void __init ulite_console_of_find_device(int id)
 		if (rc)
 			continue;
 
-		ulite_ports[id].mapbase = res.start;
 		of_node_put(np);
-		return;
+		return res.start+3;
 	}
+
+	return 0;
 }
 #else /* CONFIG_OF */
-static inline void __init ulite_console_of_find_device(int id) { /* do nothing */ }
+static inline u32 __init ulite_console_of_find_device(int id) { return 0; }
 #endif /* CONFIG_OF */
 
 static int __init ulite_console_setup(struct console *co, char *options)
@@ -408,25 +454,33 @@ static int __init ulite_console_setup(struct console *co, char *options)
 	int bits = 8;
 	int parity = 'n';
 	int flow = 'n';
+	u32 base;
 
-	if (co->index < 0 || co->index >= ULITE_NR_UARTS)
-		return -EINVAL;
+	/* Find a matching uart port in the device tree */
+	base = ulite_console_of_find_device(co->index);
 
-	port = &ulite_ports[co->index];
+	/* Get the port structure */
+	port = ulite_get_port(co->index);
+	if (!port)
+		return -ENODEV;
 
-	/* Check if it is an OF device */
-	if (!port->mapbase)
-		ulite_console_of_find_device(co->index);
+	/* was it initialized for this device? */
+	if (base) {
+		if ((port->mapbase) && (port->mapbase != base)) {
+			pr_debug(KERN_DEBUG "ulite: addr mismatch; %x != %x\n",
+				 port->mapbase, base);
+			return -ENODEV; /* port used by another device; bail */
+		}
+		port->mapbase = base;
+	}
 
-	/* Do we have a device now? */
-	if (!port->mapbase) {
-		pr_debug("console on ttyUL%i not present\n", co->index);
+	if (!port->mapbase)
 		return -ENODEV;
-	}
 
-	/* not initialized yet? */
+	/* registers mapped yet? */
 	if (!port->membase) {
-		if (ulite_request_port(port))
+		port->membase = ioremap(port->mapbase, ULITE_REGION);
+		if (!port->membase)
 			return -ENODEV;
 	}
 
@@ -488,39 +542,22 @@ static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq)
 	struct uart_port *port;
 	int rc;
 
-	/* if id = -1; then scan for a free id and use that */
-	if (id < 0) {
-		for (id = 0; id < ULITE_NR_UARTS; id++)
-			if (ulite_ports[id].mapbase == 0)
-				break;
-	}
-	if (id < 0 || id >= ULITE_NR_UARTS) {
-		dev_err(dev, "%s%i too large\n", ULITE_NAME, id);
-		return -EINVAL;
+	port = ulite_get_port(id);
+	if (!port) {
+		dev_err(dev, "Cannot get uart_port structure\n");
+		return -ENODEV;
 	}
 
-	if ((ulite_ports[id].mapbase) && (ulite_ports[id].mapbase != base)) {
-		dev_err(dev, "cannot assign to %s%i; it is already in use\n",
-			ULITE_NAME, id);
-		return -EBUSY;
+	/* was it initialized for this device? */
+	if ((port->mapbase) && (port->mapbase != base)) {
+		pr_debug(KERN_DEBUG "ulite: addr mismatch; %x != %x\n",
+			 port->mapbase, base);
+		return -ENODEV;
 	}
 
-	port = &ulite_ports[id];
-
-	spin_lock_init(&port->lock);
-	port->fifosize = 16;
-	port->regshift = 2;
-	port->iotype = UPIO_MEM;
-	port->iobase = 1; /* mark port in use */
 	port->mapbase = base;
-	port->membase = NULL;
-	port->ops = &ulite_ops;
 	port->irq = irq;
-	port->flags = UPF_BOOT_AUTOCONF;
 	port->dev = dev;
-	port->type = PORT_UNKNOWN;
-	port->line = id;
-
 	dev_set_drvdata(dev, port);
 
 	/* Register the port */
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 4/7] [POWERPC] Xilinx: update compatible list for interrupt controller
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev
In-Reply-To: <1197589413-5965-3-git-send-email-stephen.neuendorffer@xilinx.com>

These values now match what is generated by the uboot BSP generator.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 arch/powerpc/sysdev/xilinx_intc.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c
index c2f17cc..10345dd 100644
--- a/arch/powerpc/sysdev/xilinx_intc.c
+++ b/arch/powerpc/sysdev/xilinx_intc.c
@@ -135,10 +135,16 @@ void __init xilinx_intc_init_tree(void)
 	struct device_node *np;
 
 	/* find top level interrupt controller */
-	for_each_compatible_node(np, NULL, "xilinx,intc") {
+	for_each_compatible_node(np, NULL, "xlnx,opb-intc-1.00.c") {
 		if (!of_get_property(np, "interrupts", NULL))
 			break;
 	}
+        if(!np) {
+		for_each_compatible_node(np, NULL, "xlnx,xps-intc-1.00.a") {
+			if (!of_get_property(np, "interrupts", NULL))
+				break;
+		}
+        }
 
 	/* xilinx interrupt controller needs to be top level */
 	BUG_ON(!np);
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 5/7] [POWERPC] Xilinx: Update compatible to use values generated by BSP generator.
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev
In-Reply-To: <1197589413-5965-4-git-send-email-stephen.neuendorffer@xilinx.com>

Mainly, this involves two changes:
1) xilinx->xlnx (recognized standard is to use the stock ticker)
2) In order to have the device tree focus on describing what the hardware is as exactly as possible, the compatible strings contain the full IP name and IP version.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 arch/powerpc/platforms/40x/virtex.c |    2 +-
 drivers/block/xsysace.c             |    4 ++-
 drivers/serial/uartlite.c           |   42 +++++++++++++++++++++-------------
 drivers/video/xilinxfb.c            |    2 +-
 4 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
index 14bbc32..859ba1d 100644
--- a/arch/powerpc/platforms/40x/virtex.c
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -30,7 +30,7 @@ static int __init virtex_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	if (!of_flat_dt_is_compatible(root, "xilinx,virtex"))
+	if (!of_flat_dt_is_compatible(root, "xlnx,virtex"))
 		return 0;
 
 	return 1;
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 82effce..45bc51b 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -1208,7 +1208,9 @@ static int __devexit ace_of_remove(struct of_device *op)
 
 /* Match table for of_platform binding */
 static struct of_device_id __devinit ace_of_match[] = {
-	{ .compatible = "xilinx,xsysace", },
+	{ .compatible = "xlnx,opb-sysace-1.00.b", },
+	{ .compatible = "xlnx,opb-sysace-1.00.c", },
+	{ .compatible = "xlnx,xps-sysace-1.00.a", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, ace_of_match);
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 5ec42f3..6536cc7 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -21,8 +21,18 @@
 #include <linux/interrupt.h>
 #include <asm/io.h>
 #if defined(CONFIG_OF)
+#include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
+
+/* Match table for of_platform binding */
+static struct of_device_id __devinit ulite_of_match[] = {
+	{ .type = "serial", .compatible = "xlnx,opb-uartlite-1.00.b", },
+	{ .type = "serial", .compatible = "xlnx,xps-uartlite-1.00.a", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, ulite_of_match);
+
 #endif
 
 #define ULITE_NAME		"ttyUL"
@@ -427,18 +437,25 @@ static inline u32 __init ulite_console_of_find_device(int id)
 	struct resource res;
 	const unsigned int *of_id;
 	int rc;
+        const struct of_device_id *matches = ulite_of_match;
+
+	while (matches->compatible[0]) {
+		for_each_compatible_node(np, NULL, matches->compatible) {
+			if (!of_match_node(matches, np))
+				continue;
 
-	for_each_compatible_node(np, NULL, "xilinx,uartlite") {
-		of_id = of_get_property(np, "port-number", NULL);
-		if ((!of_id) || (*of_id != id))
-			continue;
+			of_id = of_get_property(np, "port-number", NULL);
+			if ((!of_id) || (*of_id != id))
+				continue;
 
-		rc = of_address_to_resource(np, 0, &res);
-		if (rc)
-			continue;
+			rc = of_address_to_resource(np, 0, &res);
+			if (rc)
+				continue;
 
-		of_node_put(np);
-		return res.start+3;
+                        of_node_put(np);
+                        return res.start+3;
+		}
+		matches++;
 	}
 
 	return 0;
@@ -654,13 +671,6 @@ static int __devexit ulite_of_remove(struct of_device *op)
 	return ulite_release(&op->dev);
 }
 
-/* Match table for of_platform binding */
-static struct of_device_id __devinit ulite_of_match[] = {
-	{ .type = "serial", .compatible = "xilinx,uartlite", },
-	{},
-};
-MODULE_DEVICE_TABLE(of, ulite_of_match);
-
 static struct of_platform_driver ulite_of_driver = {
 	.owner = THIS_MODULE,
 	.name = "uartlite",
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index e38d3b7..9b426d3 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -460,7 +460,7 @@ static int __devexit xilinxfb_of_remove(struct of_device *op)
 
 /* Match table for of_platform binding */
 static struct of_device_id __devinit xilinxfb_of_match[] = {
-	{ .compatible = "xilinx,ml300-fb", },
+	{ .compatible = "xlnx,plb-tft-cntlr-ref-1.00.a", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, xilinxfb_of_match);
-- 
1.5.3.4

^ permalink raw reply related


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