* Re: [PATCH v2] [POWERPC] Fix CONFIG_SMP=n build break
From: Olof Johansson @ 2007-10-28 2:02 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev, paulus, linux-kernel, Arnd Bergmann
In-Reply-To: <20071028123850.e5b9c555.sfr@canb.auug.org.au>
On Sun, Oct 28, 2007 at 12:38:50PM +1100, Stephen Rothwell wrote:
> Hi Olof,
>
> Just a trivial thing ...
>
> On Sat, 27 Oct 2007 12:28:51 -0500 Olof Johansson <olof@lixom.net> wrote:
> >
> > +u8 iic_get_target_id(int cpu)
> > +{
> > + return per_cpu(iic, cpu).target_id;
> > +}
> > +
> > +EXPORT_SYMBOL_GPL(iic_get_target_id);
>
> We don't normally put a blank line between a function and its EXPORT...
Yeah, sloppy of me, I thought I just copied and pasted. Paulus: feel
free to fix up before applying.
Thanks for your feedback,
-Olof
^ permalink raw reply
* Re: [PATCH v2] [POWERPC] Fix CONFIG_SMP=n build break
From: Stephen Rothwell @ 2007-10-28 1:38 UTC (permalink / raw)
To: Olof Johansson; +Cc: linuxppc-dev, paulus, linux-kernel, Arnd Bergmann
In-Reply-To: <20071027172851.GA11930@lixom.net>
[-- Attachment #1: Type: text/plain, Size: 436 bytes --]
Hi Olof,
Just a trivial thing ...
On Sat, 27 Oct 2007 12:28:51 -0500 Olof Johansson <olof@lixom.net> wrote:
>
> +u8 iic_get_target_id(int cpu)
> +{
> + return per_cpu(iic, cpu).target_id;
> +}
> +
> +EXPORT_SYMBOL_GPL(iic_get_target_id);
We don't normally put a blank line between a function and its EXPORT...
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [PATCH] powerpc: Fix cache line vs. block size confusion
From: Benjamin Herrenschmidt @ 2007-10-27 21:49 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev list, Ronald L Rockhold, Lixin Zhang
We had an historical confusion in the kernel between cache line
and cache block size. The former is an implementation detail of
the L1 cache which can be useful for performance optimisations,
the later is the actual size on which the cache control
instructions operate, which can be different.
For some reason, we had a weird hack reading the right property
on powermac and the wrong one on any other 64 bits (32 bits is
unaffected as it only uses the cputable for cache block size
infos at this stage).
This fixes the booting-without-of.txt documentation to mention
the right properties, and fixes the 64 bits initialization code
to look for the block size first, with a fallback to the line
size if the property is missing.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Note: I didn't update all the .dts files which is fine as only
64 bits currently cares about those properties and the code has
a fallback to the line size property. So they can be fixed
gradually if necessary.
Index: linux-work/Documentation/powerpc/booting-without-of.txt
===================================================================
--- linux-work.orig/Documentation/powerpc/booting-without-of.txt 2007-10-28 08:45:27.000000000 +1100
+++ linux-work/Documentation/powerpc/booting-without-of.txt 2007-10-28 08:45:38.000000000 +1100
@@ -851,12 +851,18 @@ address which can extend beyond that lim
/cpus/PowerPC,970FX@0
/cpus/PowerPC,970FX@1
(unit addresses do not require leading zeroes)
- - d-cache-line-size : one cell, L1 data cache line size in bytes
- - i-cache-line-size : one cell, L1 instruction cache line size in
+ - d-cache-block-size : one cell, L1 data cache block size in bytes (*)
+ - i-cache-block-size : one cell, L1 instruction cache block size in
bytes
- d-cache-size : one cell, size of L1 data cache in bytes
- i-cache-size : one cell, size of L1 instruction cache in bytes
+(*) The cache "block" size is the size on which the cache management
+instructions operate. Historically, this document used the cache
+"line" size here which is incorrect. The kernel will prefer the cache
+block size and will fallback to cache line size for backward
+compatibility.
+
Recommended properties:
- timebase-frequency : a cell indicating the frequency of the
@@ -870,6 +876,10 @@ address which can extend beyond that lim
for the above, the common code doesn't use that property, but
you are welcome to re-use the pSeries or Maple one. A future
kernel version might provide a common function for this.
+ - d-cache-line-size : one cell, L1 data cache line size in bytes
+ if different from the block size
+ - i-cache-line-size : one cell, L1 instruction cache line size in
+ bytes if different from the block size
You are welcome to add any property you find relevant to your board,
like some information about the mechanism used to soft-reset the
Index: linux-work/arch/powerpc/kernel/setup_64.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/setup_64.c 2007-10-28 08:45:27.000000000 +1100
+++ linux-work/arch/powerpc/kernel/setup_64.c 2007-10-28 08:46:19.000000000 +1100
@@ -291,23 +291,16 @@ static void __init initialize_cache_info
if ( num_cpus == 1 ) {
const u32 *sizep, *lsizep;
u32 size, lsize;
- const char *dc, *ic;
-
- /* Then read cache informations */
- if (machine_is(powermac)) {
- dc = "d-cache-block-size";
- ic = "i-cache-block-size";
- } else {
- dc = "d-cache-line-size";
- ic = "i-cache-line-size";
- }
size = 0;
lsize = cur_cpu_spec->dcache_bsize;
sizep = of_get_property(np, "d-cache-size", NULL);
if (sizep != NULL)
size = *sizep;
- lsizep = of_get_property(np, dc, NULL);
+ lsizep = of_get_property(np, "d-cache-block-size", NULL);
+ /* fallback if block size missing */
+ if (lsizep == NULL)
+ lsizep = of_get_property(np, "d-cache-line-size", NULL);
if (lsizep != NULL)
lsize = *lsizep;
if (sizep == 0 || lsizep == 0)
@@ -324,7 +317,9 @@ static void __init initialize_cache_info
sizep = of_get_property(np, "i-cache-size", NULL);
if (sizep != NULL)
size = *sizep;
- lsizep = of_get_property(np, ic, NULL);
+ lsizep = of_get_property(np, "i-cache-block-size", NULL);
+ if (lsizep == NULL)
+ lsizep = of_get_property(np, "i-cache-line-size", NULL);
if (lsizep != NULL)
lsize = *lsizep;
if (sizep == 0 || lsizep == 0)
^ permalink raw reply
* RE: [i2c] i2c-mpc.c driver issues
From: Joakim Tjernlund @ 2007-10-27 20:52 UTC (permalink / raw)
To: 'Jean Delvare'; +Cc: linuxppc-dev, i2c
In-Reply-To: <20071026115329.0307e207@hyperion.delvare>
> -----Original Message-----
> From:
> linuxppc-dev-bounces+joakim.tjernlund=transmode.se@ozlabs.org
> [mailto:linuxppc-dev-bounces+joakim.tjernlund=transmode.se@ozl
abs.org] On Behalf Of Jean Delvare
> Sent: den 26 oktober 2007 11:53
> To: Tjernlund
> Cc: linuxppc-dev@ozlabs.org; i2c@lm-sensors.org
> Subject: Re: [i2c] i2c-mpc.c driver issues
>
> Hi Jocke,
>
> On Wed, 24 Oct 2007 23:06:13 +0200, Tjernlund wrote:
> > While browsing the i2c-mpc.c driver I noticed some things
> that look odd
> > to me so I figured I report them. Could not find a
> maintainer in the MAINTANERS file
> > so I sent here, cc:ed linuxppc-dev as well.
> >
> > 1) There are a lot of return -1 error code that is
> propagated back to
> > userspace. Should be changed to proper -Exxx codes.
>
> This is true of many Linux i2c bus drivers, unfortunately.
> While nothing
> actually prevents drivers from returning -1 to userspace on error,
> meaningful error codes would of course be preferred.
>
> > 2) mpc_read(), according to the comment below it sends a
> STOP condition here but
> > this function does not known if this is the last read or
> not. mpc_xfer is
> > the one that knows when the transaction is over and
> should send the stop, which it already
> > does.
> >
> > /* Generate stop on last byte */
> > if (i == length - 1)
> > writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_TXAK);
>
> Probably correct, although I am not familiar with this specific
> hardware. I guess that the same is true of mpc_write as well, which is
> even worse because write + read combined transactions are very common
> (while read + write are not.)
>
> I'm not completely sure that mpc_xfer sends the stop. mpc_i2c_stop
> doesn't seem to do much.
Don't have the manual handy, but there is something bothering me with
the read function. After reading the last char there is nothing that
wait for the STOP to complete, instead one just exits and call
mpc_i2c_stop(). It might be so that the i2c_wait() won't complete until
the STOP has been sent, but I would not bet on it.
Jocke
^ permalink raw reply
* [PATCH] fix breakage in pegasos_eth (fallout from commit b45d9147f1582333e180e1023624c003874b7312)
From: Al Viro @ 2007-10-27 20:02 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev, linux-kernel, buytenh
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index 3f27239..8df230a 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -8,6 +8,9 @@
#define MV643XX_ETH_NAME "mv643xx_eth"
#define MV643XX_ETH_SHARED_REGS 0x2000
#define MV643XX_ETH_SHARED_REGS_SIZE 0x2000
+#define MV643XX_ETH_BAR_4 0x220
+#define MV643XX_ETH_SIZE_REG_4 0x224
+#define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x0290
struct mv643xx_eth_platform_data {
int port_number;
^ permalink raw reply related
* Re: 2.6.24-rc1 sysctl table check failed on PowerMac
From: Mikael Pettersson @ 2007-10-27 19:37 UTC (permalink / raw)
To: adobriyan, mikpe; +Cc: linuxppc-dev, paulus, linux-kernel
On Sat, 27 Oct 2007 22:34:53 +0400, Alexey Dobriyan wrote:
> On Sat, Oct 27, 2007 at 07:57:38PM +0200, Mikael Pettersson wrote:
> > Booting 2.6.24-rc1 on my PowerMac the kernel now spits
> > out a sysctl warning early in the boot sequence:
> >
> > --- dmesg-2.6.23
> > +++ dmesg-2.6.24-rc1
> > ...
> > IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
> > TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
> > TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
> > TCP: Hash tables configured (established 131072 bind 65536)
> > TCP reno registered
> > +sysctl table check failed: /kernel .1 Writable sysctl directory
>
> [PATCH] powerpc: fix sysctl whining re kernel.powersave-nap
>
> kernel was marked with 0755. Everywhere else it's 0555.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
>
> arch/powerpc/kernel/idle.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/arch/powerpc/kernel/idle.c
> +++ b/arch/powerpc/kernel/idle.c
> @@ -122,7 +122,7 @@ static ctl_table powersave_nap_sysctl_root[] = {
> {
> .ctl_name = CTL_KERN,
> .procname = "kernel",
> - .mode = 0755,
> + .mode = 0555,
> .child = powersave_nap_ctl_table,
> },
> {}
>
This eliminated the warning. Thanks.
^ permalink raw reply
* Re: 2.6.24-rc1 sysctl table check failed on PowerMac
From: Alexey Dobriyan @ 2007-10-27 18:34 UTC (permalink / raw)
To: Mikael Pettersson; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <200710271757.l9RHvcY9021751@harpo.it.uu.se>
On Sat, Oct 27, 2007 at 07:57:38PM +0200, Mikael Pettersson wrote:
> Booting 2.6.24-rc1 on my PowerMac the kernel now spits
> out a sysctl warning early in the boot sequence:
>
> --- dmesg-2.6.23
> +++ dmesg-2.6.24-rc1
> ...
> IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
> TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
> TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
> TCP: Hash tables configured (established 131072 bind 65536)
> TCP reno registered
> +sysctl table check failed: /kernel .1 Writable sysctl directory
[PATCH] powerpc: fix sysctl whining re kernel.powersave-nap
kernel was marked with 0755. Everywhere else it's 0555.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
arch/powerpc/kernel/idle.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -122,7 +122,7 @@ static ctl_table powersave_nap_sysctl_root[] = {
{
.ctl_name = CTL_KERN,
.procname = "kernel",
- .mode = 0755,
+ .mode = 0555,
.child = powersave_nap_ctl_table,
},
{}
^ permalink raw reply
* Re: [PATCH v2] [POWERPC] Fix CONFIG_SMP=n build break
From: Arnd Bergmann @ 2007-10-27 18:08 UTC (permalink / raw)
To: Olof Johansson; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <20071027172851.GA11930@lixom.net>
On Saturday 27 October 2007, Olof Johansson wrote:
> Fix two build errors on powerpc allyesconfig + CONFIG_SMP=n:
>
> arch/powerpc/platforms/built-in.o: In function `cpu_affinity_set':
> arch/powerpc/platforms/cell/spu_priv1_mmio.c:78: undefined reference to `.iic_get_target_id'
> arch/powerpc/platforms/built-in.o: In function `iic_init_IRQ':
> arch/powerpc/platforms/cell/interrupt.c:397: undefined reference to `.iic_setup_cpu'
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
>
Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
^ permalink raw reply
* 2.6.24-rc1 sysctl table check failed on PowerMac
From: Mikael Pettersson @ 2007-10-27 17:57 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev, linux-kernel
Booting 2.6.24-rc1 on my PowerMac the kernel now spits
out a sysctl warning early in the boot sequence:
--- dmesg-2.6.23
+++ dmesg-2.6.24-rc1
...
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
+sysctl table check failed: /kernel .1 Writable sysctl directory
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
^ permalink raw reply
* Re: [PATCH] [Powerpc] fix switch_slb handling of 1T ESID values
From: Will Schmidt @ 2007-10-27 17:36 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev, paulus
In-Reply-To: <1193458771.18243.55.camel@pasglop>
On Sat, 2007-10-27 at 14:19 +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2007-10-26 at 15:46 -0500, Will Schmidt wrote:
> > [Powerpc] fix switch_slb handling of 1T ESID values
> >
> > Now that we have 1TB segment size support, we need to be using the
> > GET_ESID_1T macro when comparing ESID values for pc,stack, and
> > unmapped_base within switch_slb() when we're on a CPU that supports it.
> >
> > This also happens to fix a duplicate-slb-entry inspired machine-check
> > exception I was seeing when trying to run java on a power6 partition.
> >
> > Tested on power6 and power5.
> >
> > Signed-Off-By: Will Schmidt <will_schmidt@vnet.ibm.com>
>
> Good catch !
>
> A minor comment is maybe you could factor out the code better doing
> something like a ESID_COMPARE() macro ?
Yeah, thats a good idea. I'll spin up a new patch in the next day or
so.
It occurred to me that I should continue to use GET_ESID when the user
address is < 1T too.
>
> > ---
> >
> > There is a similar bit of code in stab.c switch_stab(). Should this change also be made there?
> > ---
>
> There is no machine that does stab and 1T segments.
Ok, thanks for the clarification.
-Will
>
> Ben.
>
> >
> > arch/powerpc/mm/slb.c | 19 ++++++++++++++-----
> > 1 files changed, 14 insertions(+), 5 deletions(-)
> >
> >
> > diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
> > index bbd2c51..0c527d7 100644
> > --- a/arch/powerpc/mm/slb.c
> > +++ b/arch/powerpc/mm/slb.c
> > @@ -193,16 +193,25 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
> > return;
> > slb_allocate(pc);
> >
> > - if (GET_ESID(pc) == GET_ESID(stack))
> > - return;
> > + if (cpu_has_feature(CPU_FTR_1T_SEGMENT)) {
> > + if (GET_ESID_1T(pc) == GET_ESID_1T(stack))
> > + return;
> > + } else
> > + if (GET_ESID(pc) == GET_ESID(stack))
> > + return;
> >
> > if (is_kernel_addr(stack))
> > return;
> > slb_allocate(stack);
> >
> > - if ((GET_ESID(pc) == GET_ESID(unmapped_base))
> > - || (GET_ESID(stack) == GET_ESID(unmapped_base)))
> > - return;
> > + if (cpu_has_feature(CPU_FTR_1T_SEGMENT)) {
> > + if ((GET_ESID_1T(pc) == GET_ESID_1T(unmapped_base))
> > + || (GET_ESID_1T(stack) == GET_ESID_1T(unmapped_base)))
> > + return;
> > + } else
> > + if ((GET_ESID(pc) == GET_ESID(unmapped_base))
> > + || (GET_ESID(stack) == GET_ESID(unmapped_base)))
> > + return;
> >
> > if (is_kernel_addr(unmapped_base))
> > return;
> >
> >
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
^ permalink raw reply
* [PATCH v2] [POWERPC] Fix CONFIG_SMP=n build break
From: Olof Johansson @ 2007-10-27 17:28 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <200710262019.12094.arnd@arndb.de>
Fix two build errors on powerpc allyesconfig + CONFIG_SMP=n:
arch/powerpc/platforms/built-in.o: In function `cpu_affinity_set':
arch/powerpc/platforms/cell/spu_priv1_mmio.c:78: undefined reference to `.iic_get_target_id'
arch/powerpc/platforms/built-in.o: In function `iic_init_IRQ':
arch/powerpc/platforms/cell/interrupt.c:397: undefined reference to `.iic_setup_cpu'
Signed-off-by: Olof Johansson <olof@lixom.net>
---
On Fri, Oct 26, 2007 at 08:19:10PM +0200, Arnd Bergmann wrote:
> I think here it would be better to move iic_get_target_id out of
> CONFIG_SMP as well. We might want to kexec from an SMP kernel into
> a UP kernel, and in that case, cpu_affinity_set() should better
> reset the routing to CPU 0.
Makes sense. New patch.
-Olof
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 151fd8b..04f74f9 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -158,6 +158,18 @@ static unsigned int iic_get_irq(void)
return virq;
}
+void iic_setup_cpu(void)
+{
+ out_be64(&__get_cpu_var(iic).regs->prio, 0xff);
+}
+
+u8 iic_get_target_id(int cpu)
+{
+ return per_cpu(iic, cpu).target_id;
+}
+
+EXPORT_SYMBOL_GPL(iic_get_target_id);
+
#ifdef CONFIG_SMP
/* Use the highest interrupt priorities for IPI */
@@ -166,29 +178,17 @@ static inline int iic_ipi_to_irq(int ipi)
return IIC_IRQ_TYPE_IPI + 0xf - ipi;
}
-void iic_setup_cpu(void)
-{
- out_be64(&__get_cpu_var(iic).regs->prio, 0xff);
-}
-
void iic_cause_IPI(int cpu, int mesg)
{
out_be64(&per_cpu(iic, cpu).regs->generate, (0xf - mesg) << 4);
}
-u8 iic_get_target_id(int cpu)
-{
- return per_cpu(iic, cpu).target_id;
-}
-EXPORT_SYMBOL_GPL(iic_get_target_id);
-
struct irq_host *iic_get_irq_host(int node)
{
return iic_host;
}
EXPORT_SYMBOL_GPL(iic_get_irq_host);
-
static irqreturn_t iic_ipi_action(int irq, void *dev_id)
{
int ipi = (int)(long)dev_id;
^ permalink raw reply related
* Re: [PATCH] ucc_geth: add support for netpoll
From: Anton Vorontsov @ 2007-10-27 14:37 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linuxppc-dev, netdev, leoli, linux-kernel
In-Reply-To: <4723389F.7010109@ru.mvista.com>
On Sat, Oct 27, 2007 at 05:09:51PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> Anton Vorontsov wrote:
>
> > This patch adds netpoll support for the QE UCC Gigabit Ethernet
> > driver. The approach is very similar to the gianfar driver.
>
> It's rather contrarywise -- this is standard approach and gianfar with its
> 3 TSEC IRQs has a quite non-standard poll_controller() implementation.
Oh.. well, right -- gianfar a bit more comlex in that regard.
>
> > Tested using netconsole.
>
> KGDBoE is considered a better test (I hope you've also tested with it).
At the time of posting it was tested using netconsole only, a few
days later it's was tested using KGDBoE also. So, it works indeed.
> > Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> > diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> > index 18a6f48..06807ce 100644
> > --- a/drivers/net/ucc_geth.c
> > +++ b/drivers/net/ucc_geth.c
> > @@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
> > return IRQ_HANDLED;
> > }
> >
> > +#ifdef CONFIG_NET_POLL_CONTROLLER
> > +/*
> > + * Polling 'interrupt' - used by things like netconsole to send skbs
> > + * without having to re-enable interrupts. It's not called while
> > + * the interrupt routine is executing.
> > + */
> > +static void ucc_netpoll(struct net_device *dev)
> > +{
> > + struct ucc_geth_private *ugeth = netdev_priv(dev);
> > +
> > + disable_irq(ugeth->ug_info->uf_info.irq);
> > + ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
> > + enable_irq(ugeth->ug_info->uf_info.irq);
>
> Why not make it less complex (for a reader and gcc too :-) ?
Yup, I'm agree here but it's too late. Again. ;-)
This patch already accepted into the -mm (a week or so after the
silence), so.. now I'd rather not bother Andrew with such really
cosmetic changes. But if Jeff would directly apply modfied patch,
I'll send it. ;-)
Anyhow, I'm sincerely appreciate your comments.
Thanks,
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* [PATCH] Free when ioremap fails in powerpc/platforms/52xx/mpc52xx_pci.c
From: Roel Kluin @ 2007-10-27 14:11 UTC (permalink / raw)
To: linuxppc-dev
Free hose when ioremap fails
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index 4c6c82a..50f9655 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -395,8 +395,10 @@ mpc52xx_add_bridge(struct device_node *node)
hose->ops = &mpc52xx_pci_ops;
pci_regs = ioremap(rsrc.start, rsrc.end - rsrc.start + 1);
- if (!pci_regs)
+ if (!pci_regs) {
+ pcibios_free_controller(hose);
return -ENOMEM;
+ }
pci_process_bridge_OF_ranges(hose, node, 1);
^ permalink raw reply related
* [PATCH] allocation fix in ppc/platforms/4xx/luan.c
From: Roel Kluin @ 2007-10-27 14:22 UTC (permalink / raw)
To: linuxppc-dev
Don't allocate hose2 when when hose1 can't be allocated and free hose1 when
hose2 can't be allocated.
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/ppc/platforms/4xx/luan.c b/arch/ppc/platforms/4xx/luan.c
index 4b16961..b79ebb8 100644
--- a/arch/ppc/platforms/4xx/luan.c
+++ b/arch/ppc/platforms/4xx/luan.c
@@ -230,9 +230,14 @@ luan_setup_hoses(void)
/* Allocate hoses for PCIX1 and PCIX2 */
hose1 = pcibios_alloc_controller();
+ if (!hose1)
+ return;
+
hose2 = pcibios_alloc_controller();
- if (!hose1 || !hose2)
+ if (!hose2) {
+ pcibios_free_controller(hose1);
return;
+ }
/* Setup PCIX1 */
hose1->first_busno = 0;
^ permalink raw reply related
* Re: [PATCH] ucc_geth: add support for netpoll
From: Sergei Shtylyov @ 2007-10-27 13:09 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: netdev, leoli, linux-kernel, linuxppc-dev
In-Reply-To: <20071011124842.GB13963@localhost.localdomain>
Hello.
Anton Vorontsov wrote:
> This patch adds netpoll support for the QE UCC Gigabit Ethernet
> driver. The approach is very similar to the gianfar driver.
It's rather contrarywise -- this is standard approach and gianfar with its
3 TSEC IRQs has a quite non-standard poll_controller() implementation.
> Tested using netconsole.
KGDBoE is considered a better test (I hope you've also tested with it).
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> index 18a6f48..06807ce 100644
> --- a/drivers/net/ucc_geth.c
> +++ b/drivers/net/ucc_geth.c
> @@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
> return IRQ_HANDLED;
> }
>
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +/*
> + * Polling 'interrupt' - used by things like netconsole to send skbs
> + * without having to re-enable interrupts. It's not called while
> + * the interrupt routine is executing.
> + */
> +static void ucc_netpoll(struct net_device *dev)
> +{
> + struct ucc_geth_private *ugeth = netdev_priv(dev);
> +
> + disable_irq(ugeth->ug_info->uf_info.irq);
> + ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
> + enable_irq(ugeth->ug_info->uf_info.irq);
Why not make it less complex (for a reader and gcc too :-) ?
struct ucc_geth_private *ugeth = netdev_priv(dev);
int irq = ugeth->ug_info->uf_info.irq;
disable_irq(irq);
ucc_geth_irq_handler(irq, dev);
enable_irq(irq);
> +}
> +#endif /* CONFIG_NET_POLL_CONTROLLER */
> +
> /* Called when something needs to use the ethernet device */
> /* Returns 0 for success. */
> static int ucc_geth_open(struct net_device *dev)
WBR, Sergei
^ permalink raw reply
* Re: arch/powerpc/boot/wrapper broken
From: Michael Buesch @ 2007-10-27 13:01 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20071027165549.3288d76e@kernel.crashing.org>
On Saturday 27 October 2007 14:55:49 Vitaly Bordug wrote:
> On Sat, 27 Oct 2007 14:42:49 +0200
> Michael Buesch wrote:
>
> > It calls the "mkimage" command, which does not exist
> > in my $PATH.
> >
> well, mkImage is a part of u-boot and there was some talk to make it part of kernel too,
> since it does not take alot of place but still mandatory for a number of platforms to work.
>
> I think, Paul will clarify the details, meanwhile you can install mkImage say building u-boot, and
> some distros may have such a package.
>
Ubuntu doesn't seem to, though.
In any case, I think that the name "mkimage" is bad for a tool installed
globally in /usr. Does it make a iso9660 image? (No it doesn't, I know :) )
I'd vote for shipping it with the kernel in /scripts or something like that.
--
Greetings Michael.
^ permalink raw reply
* Re: arch/powerpc/boot/wrapper broken
From: Vitaly Bordug @ 2007-10-27 12:55 UTC (permalink / raw)
To: Michael Buesch; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <200710271442.50158.mb@bu3sch.de>
On Sat, 27 Oct 2007 14:42:49 +0200
Michael Buesch wrote:
> It calls the "mkimage" command, which does not exist
> in my $PATH.
>
well, mkImage is a part of u-boot and there was some talk to make it part of kernel too,
since it does not take alot of place but still mandatory for a number of platforms to work.
I think, Paul will clarify the details, meanwhile you can install mkImage say building u-boot, and
some distros may have such a package.
--
Sincerely, Vitaly
^ permalink raw reply
* arch/powerpc/boot/wrapper broken
From: Michael Buesch @ 2007-10-27 12:42 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
It calls the "mkimage" command, which does not exist
in my $PATH.
--
Greetings Michael.
^ permalink raw reply
* Re: [PATCH] compat_ioctl: fix block device compat ioctl regression
From: Jens Axboe @ 2007-10-27 11:34 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-kernel, linuxppc-dev, Geert Uytterhoeven, akpm,
Johannes Berg, Philip Langdale
In-Reply-To: <200710271138.06456.arnd@arndb.de>
On Sat, Oct 27 2007, Arnd Bergmann wrote:
> From: Philip Langdale <philipl@overt.org>
> The conversion of handlers to compat_blkdev_ioctl accidentally
> disabled handling of most ioctl numbers on block devices because
> of a typo. Fix the one line to enable it all again.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>
> Mea Culpa. This should have been found by my testing, as it's clear
> that most of my big patch never worked at all. Sorry for causing
> problems for everyone involved here.
>
> I'm attributing the patch to Philip, as he's the one who pointed
> out to me what the fix is.
Oops, added for swift inclusion.
--
Jens Axboe
^ permalink raw reply
* Re: [PATCH 6/7] mpc83xx: timer driver for PM wakeup
From: Anton Vorontsov @ 2007-10-27 10:46 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, paulus
In-Reply-To: <20071023212502.GE30959@loki.buserror.net>
Hi Scott,
On Tue, Oct 23, 2007 at 04:25:02PM -0500, Scott Wood wrote:
> This is a driver for the mpc83xx's GTM4 timer. It's functionality
> is limited to providing a wakeup source for suspend-to-RAM.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
I think you can use dev_err(&dev->dev
> +static int __devinit gtm_probe(struct of_device *dev,
> + const struct of_device_id *match)
> +{
> + struct device_node *np = dev->node;
> + struct resource res;
> + int ret = 0;
> + u32 busfreq = fsl_get_sys_freq();
> + struct gtm_priv *priv;
> +
> + if (busfreq == 0) {
> + printk(KERN_ERR "gtm: No bus frequency in device tree.\n");
here
> + return -ENODEV;
> + }
> +
> + priv = kmalloc(sizeof(struct gtm_priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + spin_lock_init(&priv->lock);
> + dev_set_drvdata(&dev->dev, priv);
> +
> + ret = of_address_to_resource(np, 0, &res);
> + if (ret)
> + goto out;
> +
> + priv->irq = irq_of_parse_and_map(np, 0);
> + if (priv->irq == NO_IRQ) {
> + printk(KERN_ERR "mpc83xx-gtm exists in device tree "
> + "without an IRQ.\n");
and here.
Thanks,
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* [PATCH] compat_ioctl: fix block device compat ioctl regression
From: Arnd Bergmann @ 2007-10-27 9:38 UTC (permalink / raw)
To: akpm, linuxppc-dev, Geert Uytterhoeven, Johannes Berg, Jens Axboe
Cc: linux-kernel, Philip Langdale
In-Reply-To: <47228A9E.80505@overt.org>
From: Philip Langdale <philipl@overt.org>
The conversion of handlers to compat_blkdev_ioctl accidentally
disabled handling of most ioctl numbers on block devices because
of a typo. Fix the one line to enable it all again.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Mea Culpa. This should have been found by my testing, as it's clear
that most of my big patch never worked at all. Sorry for causing
problems for everyone involved here.
I'm attributing the patch to Philip, as he's the one who pointed
out to me what the fix is.
Arnd <><
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -581,7 +581,7 @@ static int compat_blkdev_driver_ioctl(struct inode *inode, struct file *file,
{
int ret;
- switch (arg) {
+ switch (cmd) {
case HDIO_GET_UNMASKINTR:
case HDIO_GET_MULTCOUNT:
case HDIO_GET_KEEPSETTINGS:
^ permalink raw reply
* Re: [PATCH 1/2] PowerPC: Add 44x NDFC device-tree aware support
From: Thomas Gleixner @ 2007-10-27 8:46 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev, linux-mtd
In-Reply-To: <200710270653.32459.sr@denx.de>
On Sat, 27 Oct 2007, Stefan Roese wrote:
> Hi Valentine,
>
> On Friday 26 October 2007, Valentine Barshak wrote:
> > This adds device-tree aware PowerPC 44x NDFC (NAND Flash Controller)
> > driver. The code is based on the original ndfc.c driver by Thomas Gleixner.
> > The major difference is that here we try to handle all chips found as one
> > mtd device instead of having a separate one on each chip.
> > The partition handling code is based on the physmap_of one.
> > The the first 4 bits of the "bank-mask" property show which of the 4 NDFC
> > banks have chips attached. The "bank-width" property is 1 for 8-bit flash
> > and 2 for a 16-bit one.
> >
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
>
> Are you sure you have the Signed-off-by from Thomas already on this?
Definitely not.
tglx
^ permalink raw reply
* [PATCH] ppc4xx: mmu_mapin_ram bugfix for booting with mem<16 MB
From: Magnus Hjorth @ 2007-10-27 8:35 UTC (permalink / raw)
To: Grant Likely; +Cc: Linuxppc-embedded
In-Reply-To: <fa686aa40710261254r105530d4u2e95d96948030ed7@mail.gmail.com>
From: Magnus Hjorth <mh@omnisys.se>
This patch (for 2.6.23.1) fixes an unsigned arithmetic bug causing the
kernel to hang when booting with less than 16 MB of memory on ppc4xx.
Signed-off-by: Magnus Hjorth <mh@omnisys.se>
---
OK, trying to do this by the book now...
--- linux-2.6.23.1/arch/ppc/mm/4xx_mmu.c.orig 2007-10-27 10:14:42.000000000 +0200
+++ linux-2.6.23.1/arch/ppc/mm/4xx_mmu.c 2007-10-27 10:15:34.000000000 +0200
@@ -105,7 +105,7 @@ unsigned long __init mmu_mapin_ram(void)
return s;
}
- while (s <= (total_lowmem - LARGE_PAGE_SIZE_16M)) {
+ while (s + LARGE_PAGE_SIZE_16M <= total_lowmem) {
pmd_t *pmdp;
unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
@@ -120,7 +120,7 @@ unsigned long __init mmu_mapin_ram(void)
s += LARGE_PAGE_SIZE_16M;
}
- while (s <= (total_lowmem - LARGE_PAGE_SIZE_4M)) {
+ while (s + LARGE_PAGE_SIZE_4M <= total_lowmem) {
pmd_t *pmdp;
unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;
^ permalink raw reply
* [PATCH/RFC] powerpc: Pass PID argument to _tlbie (WAS: Apparent kernel bug with GDB on ppc405)
From: Benjamin Herrenschmidt @ 2007-10-27 7:32 UTC (permalink / raw)
To: Matt Mackall; +Cc: linuxppc-dev list, Josh Boyer, Kumar Gala, linuxppc-embedded
In-Reply-To: <1193448653.18243.9.camel@pasglop>
Allright, so Matt, let me know if that fixes your problem with gdb, and
I'll clean the patch up a bit and submit it. I want to double check if
something similar may be needed for freescale booke.
Basically, the problem is that things like get_user_pages() can cause
COW operations which in turn call _tlbie() to be called for translations
that aren't in the current address space.
The current 40x and 44x implementation of _tlbie doesn't handle that
properly as it only invalidates entries in the current PID.
This is an attempt at fixing it. Untested, I just checked it builds for
arch/powerpc and arch/ppc. I also haven't looked whether the freescale
BookE _tlbie needs similar treatement (it will get passed the pid in r4
with that patch, so if it needs to do something with it, it can). Kumar,
can you have a look ?
Index: linux-work/arch/powerpc/mm/fault.c
===================================================================
--- linux-work.orig/arch/powerpc/mm/fault.c 2007-10-27 14:44:05.000000000 +1000
+++ linux-work/arch/powerpc/mm/fault.c 2007-10-27 16:57:50.000000000 +1000
@@ -309,7 +309,7 @@ good_area:
set_bit(PG_arch_1, &page->flags);
}
pte_update(ptep, 0, _PAGE_HWEXEC);
- _tlbie(address);
+ _tlbie(address, mm->context.id);
pte_unmap_unlock(ptep, ptl);
up_read(&mm->mmap_sem);
return 0;
Index: linux-work/include/asm-powerpc/tlbflush.h
===================================================================
--- linux-work.orig/include/asm-powerpc/tlbflush.h 2007-10-27 14:44:19.000000000 +1000
+++ linux-work/include/asm-powerpc/tlbflush.h 2007-10-27 16:57:50.000000000 +1000
@@ -1,5 +1,8 @@
#ifndef _ASM_POWERPC_TLBFLUSH_H
#define _ASM_POWERPC_TLBFLUSH_H
+
+#include <linux/mm.h>
+
/*
* TLB flushing:
*
@@ -16,9 +19,6 @@
*/
#ifdef __KERNEL__
-struct mm_struct;
-struct vm_area_struct;
-
#if defined(CONFIG_4xx) || defined(CONFIG_8xx) || defined(CONFIG_FSL_BOOKE)
/*
* TLB flushing for software loaded TLB chips
@@ -28,7 +28,7 @@ struct vm_area_struct;
* specific tlbie's
*/
-extern void _tlbie(unsigned long address);
+extern void _tlbie(unsigned long address, unsigned int pid);
#if defined(CONFIG_40x) || defined(CONFIG_8xx)
#define _tlbia() asm volatile ("tlbia; sync" : : : "memory")
@@ -44,13 +44,13 @@ static inline void flush_tlb_mm(struct m
static inline void flush_tlb_page(struct vm_area_struct *vma,
unsigned long vmaddr)
{
- _tlbie(vmaddr);
+ _tlbie(vmaddr, vma->vm_mm->context.id);
}
static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
unsigned long vmaddr)
{
- _tlbie(vmaddr);
+ _tlbie(vmaddr, vma->vm_mm->context.id);
}
static inline void flush_tlb_range(struct vm_area_struct *vma,
Index: linux-work/arch/powerpc/kernel/misc_32.S
===================================================================
--- linux-work.orig/arch/powerpc/kernel/misc_32.S 2007-10-27 16:58:33.000000000 +1000
+++ linux-work/arch/powerpc/kernel/misc_32.S 2007-10-27 17:08:32.000000000 +1000
@@ -288,7 +288,16 @@ _GLOBAL(_tlbia)
*/
_GLOBAL(_tlbie)
#if defined(CONFIG_40x)
+ /* We run the search with interrupts disabled because we have to change
+ * the PID and I don't want to preempt when that happens.
+ */
+ mfmsr r5
+ mfspr r6,SPRN_PID
+ wrteei 0
+ mtspr SPRN_PID,r4
tlbsx. r3, 0, r3
+ mtspr SPRN_PID,r6
+ wrtee r5
bne 10f
sync
/* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear.
@@ -297,23 +306,23 @@ _GLOBAL(_tlbie)
tlbwe r3, r3, TLB_TAG
isync
10:
+
#elif defined(CONFIG_44x)
- mfspr r4,SPRN_MMUCR
- mfspr r5,SPRN_PID /* Get PID */
- rlwimi r4,r5,0,24,31 /* Set TID */
+ mfspr r5,SPRN_MMUCR
+ rlwimi r5,r4,0,24,31 /* Set TID */
/* We have to run the search with interrupts disabled, even critical
* and debug interrupts (in fact the only critical exceptions we have
* are debug and machine check). Otherwise an interrupt which causes
* a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */
- mfmsr r5
+ mfmsr r4
lis r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha
addi r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l
- andc r6,r5,r6
+ andc r6,r4,r6
mtmsr r6
- mtspr SPRN_MMUCR,r4
+ mtspr SPRN_MMUCR,r5
tlbsx. r3, 0, r3
- mtmsr r5
+ mtmsr r4
bne 10f
sync
/* There are only 64 TLB entries, so r3 < 64,
Index: linux-work/arch/powerpc/mm/mmu_decl.h
===================================================================
--- linux-work.orig/arch/powerpc/mm/mmu_decl.h 2007-10-27 17:11:33.000000000 +1000
+++ linux-work/arch/powerpc/mm/mmu_decl.h 2007-10-27 17:11:58.000000000 +1000
@@ -61,12 +61,12 @@ extern unsigned long total_lowmem;
#define mmu_mapin_ram() (0UL)
#elif defined(CONFIG_4xx)
-#define flush_HPTE(X, va, pg) _tlbie(va)
+#define flush_HPTE(pid, va, pg) _tlbie(va, pid)
extern void MMU_init_hw(void);
extern unsigned long mmu_mapin_ram(void);
#elif defined(CONFIG_FSL_BOOKE)
-#define flush_HPTE(X, va, pg) _tlbie(va)
+#define flush_HPTE(pid, va, pg) _tlbie(va, pid)
extern void MMU_init_hw(void);
extern unsigned long mmu_mapin_ram(void);
extern void adjust_total_lowmem(void);
Index: linux-work/arch/ppc/kernel/misc.S
===================================================================
--- linux-work.orig/arch/ppc/kernel/misc.S 2007-10-27 17:15:25.000000000 +1000
+++ linux-work/arch/ppc/kernel/misc.S 2007-10-27 17:15:59.000000000 +1000
@@ -224,7 +224,16 @@ _GLOBAL(_tlbia)
*/
_GLOBAL(_tlbie)
#if defined(CONFIG_40x)
+ /* We run the search with interrupts disabled because we have to change
+ * the PID and I don't want to preempt when that happens.
+ */
+ mfmsr r5
+ mfspr r6,SPRN_PID
+ wrteei 0
+ mtspr SPRN_PID,r4
tlbsx. r3, 0, r3
+ mtspr SPRN_PID,r6
+ wrtee r5
bne 10f
sync
/* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear.
@@ -234,22 +243,21 @@ _GLOBAL(_tlbie)
isync
10:
#elif defined(CONFIG_44x)
- mfspr r4,SPRN_MMUCR
- mfspr r5,SPRN_PID /* Get PID */
- rlwimi r4,r5,0,24,31 /* Set TID */
+ mfspr r5,SPRN_MMUCR
+ rlwimi r5,r4,0,24,31 /* Set TID */
/* We have to run the search with interrupts disabled, even critical
* and debug interrupts (in fact the only critical exceptions we have
* are debug and machine check). Otherwise an interrupt which causes
* a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */
- mfmsr r5
+ mfmsr r4
lis r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha
addi r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l
- andc r6,r5,r6
+ andc r6,r4,r6
mtmsr r6
- mtspr SPRN_MMUCR,r4
+ mtspr SPRN_MMUCR,r5
tlbsx. r3, 0, r3
- mtmsr r5
+ mtmsr r4
bne 10f
sync
/* There are only 64 TLB entries, so r3 < 64,
Index: linux-work/arch/ppc/mm/fault.c
===================================================================
--- linux-work.orig/arch/ppc/mm/fault.c 2007-10-27 17:14:09.000000000 +1000
+++ linux-work/arch/ppc/mm/fault.c 2007-10-27 17:14:13.000000000 +1000
@@ -227,7 +227,7 @@ good_area:
set_bit(PG_arch_1, &page->flags);
}
pte_update(ptep, 0, _PAGE_HWEXEC);
- _tlbie(address);
+ _tlbie(address, mm->context.id);
pte_unmap_unlock(ptep, ptl);
up_read(&mm->mmap_sem);
return 0;
Index: linux-work/arch/ppc/mm/mmu_decl.h
===================================================================
--- linux-work.orig/arch/ppc/mm/mmu_decl.h 2007-10-27 17:14:43.000000000 +1000
+++ linux-work/arch/ppc/mm/mmu_decl.h 2007-10-27 17:14:54.000000000 +1000
@@ -54,12 +54,12 @@ extern unsigned int num_tlbcam_entries;
#define mmu_mapin_ram() (0UL)
#elif defined(CONFIG_4xx)
-#define flush_HPTE(X, va, pg) _tlbie(va)
+#define flush_HPTE(pid, va, pg) _tlbie(va, pid)
extern void MMU_init_hw(void);
extern unsigned long mmu_mapin_ram(void);
#elif defined(CONFIG_FSL_BOOKE)
-#define flush_HPTE(X, va, pg) _tlbie(va)
+#define flush_HPTE(pid, va, pg) _tlbie(va, pid)
extern void MMU_init_hw(void);
extern unsigned long mmu_mapin_ram(void);
extern void adjust_total_lowmem(void);
Index: linux-work/arch/ppc/platforms/4xx/ebony.c
===================================================================
--- linux-work.orig/arch/ppc/platforms/4xx/ebony.c 2007-10-27 17:13:38.000000000 +1000
+++ linux-work/arch/ppc/platforms/4xx/ebony.c 2007-10-27 17:13:40.000000000 +1000
@@ -236,7 +236,7 @@ ebony_early_serial_map(void)
gen550_init(0, &port);
/* Purge TLB entry added in head_44x.S for early serial access */
- _tlbie(UART0_IO_BASE);
+ _tlbie(UART0_IO_BASE, 0);
#endif
port.membase = ioremap64(PPC440GP_UART1_ADDR, 8);
Index: linux-work/arch/ppc/platforms/4xx/ocotea.c
===================================================================
--- linux-work.orig/arch/ppc/platforms/4xx/ocotea.c 2007-10-27 17:13:26.000000000 +1000
+++ linux-work/arch/ppc/platforms/4xx/ocotea.c 2007-10-27 17:13:28.000000000 +1000
@@ -259,7 +259,7 @@ ocotea_early_serial_map(void)
gen550_init(0, &port);
/* Purge TLB entry added in head_44x.S for early serial access */
- _tlbie(UART0_IO_BASE);
+ _tlbie(UART0_IO_BASE, 0);
#endif
port.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
Index: linux-work/arch/ppc/platforms/4xx/taishan.c
===================================================================
--- linux-work.orig/arch/ppc/platforms/4xx/taishan.c 2007-10-27 17:13:47.000000000 +1000
+++ linux-work/arch/ppc/platforms/4xx/taishan.c 2007-10-27 17:13:50.000000000 +1000
@@ -316,7 +316,7 @@ taishan_early_serial_map(void)
gen550_init(0, &port);
/* Purge TLB entry added in head_44x.S for early serial access */
- _tlbie(UART0_IO_BASE);
+ _tlbie(UART0_IO_BASE, 0);
#endif
port.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
^ permalink raw reply
* Re: [PATCH 1/2] PowerPC: Add 44x NDFC device-tree aware support
From: Stefan Roese @ 2007-10-27 4:53 UTC (permalink / raw)
To: Valentine Barshak; +Cc: linuxppc-dev, tglx, linux-mtd
In-Reply-To: <20071026163958.GA11784@ru.mvista.com>
Hi Valentine,
On Friday 26 October 2007, Valentine Barshak wrote:
> This adds device-tree aware PowerPC 44x NDFC (NAND Flash Controller)
> driver. The code is based on the original ndfc.c driver by Thomas Gleixne=
r.
> The major difference is that here we try to handle all chips found as one
> mtd device instead of having a separate one on each chip.
> The partition handling code is based on the physmap_of one.
> The the first 4 bits of the "bank-mask" property show which of the 4 NDFC
> banks have chips attached. The "bank-width" property is 1 for 8-bit flash
> and 2 for a 16-bit one.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Are you sure you have the Signed-off-by from Thomas already on this?
> ---
> =A0drivers/mtd/nand/Kconfig =A0 | =A0 =A07
> =A0drivers/mtd/nand/Makefile =A0| =A0 =A01
> =A0drivers/mtd/nand/ndfc_of.c | =A0449
> +++++++++++++++++++++++++++++++++++++++++++++ include/linux/mtd/ndfc.h =
=A0 |
> =A0 =A04
> =A04 files changed, 461 insertions(+)
>
> diff -pruN linux-2.6.orig/drivers/mtd/nand/Kconfig
> linux-2.6/drivers/mtd/nand/Kconfig ---
> linux-2.6.orig/drivers/mtd/nand/Kconfig=A0=A0=A0=A0=A02007-10-25 19:20:05=
=2E000000000
> +0400 +++ linux-2.6/drivers/mtd/nand/Kconfig=A0=A02007-10-26 16:16:20.000=
000000
> +0400 @@ -158,6 +158,13 @@ config MTD_NAND_NDFC
> =A0=A0=A0=A0=A0=A0=A0=A0help
> =A0=A0=A0=A0=A0=A0=A0=A0 NDFC Nand Flash Controllers are integrated in IB=
M/AMCC's 4xx SoCs
> =A0
> +config MTD_NAND_NDFC_OF
> +=A0=A0=A0=A0=A0=A0=A0tristate "NDFC OF Nand Flash Controller"
> +=A0=A0=A0=A0=A0=A0=A0depends on 44x
> +=A0=A0=A0=A0=A0=A0=A0select MTD_NAND_ECC_SMC
> +=A0=A0=A0=A0=A0=A0=A0help
> +=A0=A0=A0=A0=A0=A0=A0 NDFC OF Nand Flash Controllers are integrated in P=
owerPC44x SoCs
> +
> =A0config MTD_NAND_S3C2410_CLKSTOP
> =A0=A0=A0=A0=A0=A0=A0=A0bool "S3C2410 NAND IDLE clock stop"
> =A0=A0=A0=A0=A0=A0=A0=A0depends on MTD_NAND_S3C2410
> diff -pruN linux-2.6.orig/drivers/mtd/nand/Makefile
> linux-2.6/drivers/mtd/nand/Makefile ---
> linux-2.6.orig/drivers/mtd/nand/Makefile=A0=A0=A0=A02007-10-25 19:20:05.0=
00000000
> +0400 +++ linux-2.6/drivers/mtd/nand/Makefile=A02007-10-26 16:16:20.00000=
0000
> +0400 @@ -24,6 +24,7 @@ obj-$(CONFIG_MTD_NAND_TS7250)=A0=A0=A0=A0=A0=A0=
=A0=A0=A0+=3D ts7250
> =A0obj-$(CONFIG_MTD_NAND_NANDSIM)=A0=A0=A0=A0=A0=A0=A0=A0=A0+=3D nandsim.o
> =A0obj-$(CONFIG_MTD_NAND_CS553X)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0+=3D cs553x=
_nand.o
> =A0obj-$(CONFIG_MTD_NAND_NDFC)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0+=3D nd=
fc.o
> +obj-$(CONFIG_MTD_NAND_NDFC_OF)=A0=A0=A0=A0=A0=A0=A0=A0=A0+=3D ndfc_of.o
> =A0obj-$(CONFIG_MTD_NAND_AT91)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0+=3D at=
91_nand.o
> =A0obj-$(CONFIG_MTD_NAND_CM_X270)=A0=A0=A0=A0=A0=A0=A0=A0=A0+=3D cmx270_n=
and.o
> =A0obj-$(CONFIG_MTD_NAND_BASLER_EXCITE)=A0=A0=A0+=3D excite_nandflash.o
> diff -pruN linux-2.6.orig/drivers/mtd/nand/ndfc_of.c
> linux-2.6/drivers/mtd/nand/ndfc_of.c ---
> linux-2.6.orig/drivers/mtd/nand/ndfc_of.c=A0=A0=A01970-01-01 03:00:00.000=
000000
> +0300 +++ linux-2.6/drivers/mtd/nand/ndfc_of.c=A0=A0=A0=A0=A0=A0=A0=A0200=
7-10-26
> 17:28:57.000000000 +0400 @@ -0,0 +1,449 @@
> +/*
> + * =A0PowerPC 44x NDFC (NanD Flash Controller) driver
> + * =A0with OF device tree support.
> + *
> + * =A0Based on the original ndfc driver by Thomas Gleixner
> + *
> + * =A0Copyright 2006 IBM
> + *
> + * =A0This program is free software; you can redistribute=A0=A0=A0=A0=A0=
=A0=A0=A0 it and/or
> modify it + * =A0under =A0the terms of=A0=A0=A0=A0=A0=A0=A0=A0 the GNU Ge=
neral =A0Public License
> as published by the + * =A0Free Software Foundation; =A0either version 2 =
of
> the=A0License, or (at your + * =A0option) any later version.
> + *
> + */
> +#include <linux/module.h>
> +#include <linux/mtd/nand.h>
> +#include <linux/mtd/nand_ecc.h>
> +#include <linux/mtd/partitions.h>
> +#include <linux/mtd/ndfc.h>
> +#include <linux/mtd/mtd.h>
> +#include <linux/of.h>
> +#include <linux/of_platform.h>
> +
> +#include <asm/io.h>
> +
> +
> +struct of_ndfc {
> +=A0=A0=A0=A0=A0=A0=A0__iomem void=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0*ba=
se;
> +=A0=A0=A0=A0=A0=A0=A0struct resource=A0=A0=A0=A0=A0=A0=A0=A0=A0*res;
> +=A0=A0=A0=A0=A0=A0=A0unsigned=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0bank_width;
> +=A0=A0=A0=A0=A0=A0=A0unsigned =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0chip_cnt;
> +=A0=A0=A0=A0=A0=A0=A0unsigned char=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0chip_=
map[NDFC_MAX_BANKS];
> +=A0=A0=A0=A0=A0=A0=A0struct nand_hw_control=A0=A0control;
> +=A0=A0=A0=A0=A0=A0=A0struct nand_chip=A0=A0=A0=A0=A0=A0=A0=A0chip;
> +=A0=A0=A0=A0=A0=A0=A0struct mtd_info=A0=A0=A0=A0=A0=A0=A0=A0=A0mtd;
> +#ifdef CONFIG_MTD_PARTITIONS
> +=A0=A0=A0=A0=A0=A0=A0struct mtd_partition=A0=A0=A0=A0*parts;
> +#endif
> +};
> +
> +static inline u32 ndfc_raw_readl(struct of_ndfc *ndfc, u32 off)
> +{
> + return __raw_readl(ndfc->base + off);
> +}
> +
> +static inline void ndfc_raw_writel(struct of_ndfc *ndfc, u32 off, u32 va=
l)
> +{
> + __raw_writel(val, ndfc->base + off);
> +}
> +
> +static inline void ndfc_writel(struct of_ndfc *ndfc, u32 off, u32 val)
> +{
> + writel(val, ndfc->base + off);
> +}
> +
> +static void ndfc_select_chip(struct mtd_info *mtd, int chip)
> +{
> + struct nand_chip *this =3D mtd->priv;
> + struct of_ndfc *ndfc =3D this->priv;
> + uint32_t ccr;
> +
> + ccr =3D ndfc_raw_readl(ndfc, NDFC_CCR);
> + if ((chip >=3D 0) && (chip < ndfc->chip_cnt)) {
> + ccr &=3D ~NDFC_CCR_BS_MASK;
> + ccr |=3D NDFC_CCR_BS(ndfc->chip_map[chip]);
> + } else
> + ccr |=3D NDFC_CCR_RESET_CE;
> + ndfc_raw_writel(ndfc, NDFC_CCR, ccr);
> +}
> +
> +static void ndfc_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int
> ctrl) +{
> + struct nand_chip *this =3D mtd->priv;
> + struct of_ndfc *ndfc =3D this->priv;
> +
> + if (cmd =3D=3D NAND_CMD_NONE)
> + return;
> +
> + if (ctrl & NAND_CLE)
> + ndfc_writel(ndfc, NDFC_CMD, cmd & 0xff);
> + else
> + ndfc_writel(ndfc, NDFC_ALE, cmd & 0xff);
> +}
> +
> +static int ndfc_ready(struct mtd_info *mtd)
> +{
> + struct nand_chip *this =3D mtd->priv;
> + struct of_ndfc *ndfc =3D this->priv;
> +
> + return ndfc_raw_readl(ndfc, NDFC_STAT) & NDFC_STAT_IS_READY;
> +}
> +
> +static void ndfc_enable_hwecc(struct mtd_info *mtd, int mode)
> +{
> + uint32_t ccr;
> + struct nand_chip *this =3D mtd->priv;
> + struct of_ndfc *ndfc =3D this->priv;
> +
> + ccr =3D ndfc_raw_readl(ndfc, NDFC_CCR);
> + ccr |=3D NDFC_CCR_RESET_ECC;
> + ndfc_raw_writel(ndfc, NDFC_CCR, ccr);
> + wmb();
I suspect that when we use the in_be32() and friends functions for IO acces=
s,=20
the memory-barriers can go away.
> +}
> +
> +
> +static int ndfc_calculate_ecc(struct mtd_info *mtd,
> + const u_char *dat, u_char *ecc_code)
> +{
> + uint32_t ecc;
> + struct nand_chip *this =3D mtd->priv;
> + struct of_ndfc *ndfc =3D this->priv;
> + uint8_t *p =3D (uint8_t *)&ecc;
> +
> + wmb();
Same here.
> + ecc =3D ndfc_raw_readl(ndfc, NDFC_ECC);
> + ecc_code[0] =3D p[1];
> + ecc_code[1] =3D p[2];
> + ecc_code[2] =3D p[3];
> +
> + return 0;
> +}
> +
> +
> +/*
> + * Speedups for buffer read/write/verify
> + *
> + * NDFC allows 32bit read/write of data. So we can speed up the buffer
> + * functions. No further checking, as nand_base will always read/write
> + * page aligned.
> + */
> +static void ndfc_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
> +{
> + struct nand_chip *this =3D mtd->priv;
> + struct of_ndfc *ndfc =3D this->priv;
> + uint32_t *p =3D (uint32_t *) buf;
> +
> + for(;len > 0; len -=3D 4)
> + *p++ =3D ndfc_raw_readl(ndfc, NDFC_DATA);
> +}
> +
> +static void ndfc_write_buf(struct mtd_info *mtd, const uint8_t *buf, int
> len) +{
> + struct nand_chip *this =3D mtd->priv;
> + struct of_ndfc *ndfc =3D this->priv;
> + uint32_t *p =3D (uint32_t *) buf;
> +
> + for(;len > 0; len -=3D 4)
> + ndfc_raw_writel(ndfc, NDFC_DATA, *p++);
> +}
> +
> +static int ndfc_verify_buf(struct mtd_info *mtd, const uint8_t *buf, int
> len) +{
> + struct nand_chip *this =3D mtd->priv;
> + struct of_ndfc *ndfc =3D this->priv;
> + uint32_t *p =3D (uint32_t *) buf;
> +
> + for(;len > 0; len -=3D 4)
> + if (*p++ !=3D ndfc_raw_readl(ndfc, NDFC_DATA))
> + return -EFAULT;
> + return 0;
> +}
> +
> +
> +
> +static void ndfc_chip_init(struct nand_chip *chip,
> + struct of_ndfc *ndfc)
> +{
> + chip->IO_ADDR_R =3D ndfc->base + NDFC_DATA;
> + chip->IO_ADDR_W =3D ndfc->base + NDFC_DATA;
> + chip->cmd_ctrl =3D ndfc_hwcontrol;
> + chip->dev_ready =3D ndfc_ready;
> + chip->select_chip =3D ndfc_select_chip;
> + chip->chip_delay =3D 50;
> + chip->priv =3D ndfc;
> + if (ndfc->bank_width =3D=3D 2)
> + chip->options |=3D NAND_BUSWIDTH_16;
> + chip->controller =3D &ndfc->control;
> + chip->read_buf =3D ndfc_read_buf;
> + chip->write_buf =3D ndfc_write_buf;
> + chip->verify_buf =3D ndfc_verify_buf;
> + chip->ecc.correct =3D nand_correct_data;
> + chip->ecc.hwctl =3D ndfc_enable_hwecc;
> + chip->ecc.calculate =3D ndfc_calculate_ecc;
> + chip->ecc.mode =3D NAND_ECC_HW;
> + chip->ecc.size =3D 256;
> + chip->ecc.bytes =3D 3;
> + ndfc->mtd.priv =3D chip;
> + ndfc->mtd.owner =3D THIS_MODULE;
> +}
> +
> +
> +#ifdef CONFIG_MTD_PARTITIONS
> +#define OF_FLASH_PARTS(ndfc) ((ndfc)->parts)
> +
> +static int __devinit parse_partitions(struct of_ndfc *ndfc,
> + struct of_device *dev)
> +{
> + const char *partname;
> + static const char *part_probe_types[]
> + =3D { "cmdlinepart", "RedBoot", NULL };
> + struct device_node *dp =3D dev->node, *pp;
> + int nr_parts, i;
> +
> + /* First look for RedBoot table or partitions on the command
> + * line, these take precedence over device tree information */
> + nr_parts =3D parse_mtd_partitions(&ndfc->mtd, part_probe_types,
> + &ndfc->parts, 0);
> + if (nr_parts > 0) {
> + add_mtd_partitions(&ndfc->mtd, ndfc->parts, nr_parts);
> + return 0;
> + }
> +
> + /* First count the subnodes */
> + nr_parts =3D 0;
> + for (pp =3D dp->child; pp; pp =3D pp->sibling)
> + nr_parts++;
> +
> + if (nr_parts =3D=3D 0)
> + return 0;
> +
> + ndfc->parts =3D kzalloc(nr_parts * sizeof(*ndfc->parts),
> + GFP_KERNEL);
> + if (!ndfc->parts)
> + return -ENOMEM;
> +
> + for (pp =3D dp->child, i =3D 0; pp; pp =3D pp->sibling, i++) {
> + const u32 *reg;
> + int len;
> +
> + reg =3D of_get_property(pp, "reg", &len);
> + if (!reg || (len !=3D 2*sizeof(u32))) {
> + dev_err(&dev->dev, "Invalid 'reg' on %s\n",
> + dp->full_name);
> + kfree(ndfc->parts);
> + ndfc->parts =3D NULL;
> + return -EINVAL;
> + }
> + ndfc->parts[i].offset =3D reg[0];
> + ndfc->parts[i].size =3D reg[1];
> +
> + partname =3D of_get_property(pp, "label", &len);
> + if (!partname)
> + partname =3D of_get_property(pp, "name", &len);
> + ndfc->parts[i].name =3D (char *)partname;
> +
> + if (of_get_property(pp, "read-only", &len))
> + ndfc->parts[i].mask_flags =3D MTD_WRITEABLE;
> + }
> +
> + return nr_parts;
> +}
This parse_partition code looks very much like the code in the physmap_of=20
driver. I think it would be a good idea not to duplicate this code, but to=
=20
extract it and use one version in both drivers.
> +#else /* MTD_PARTITIONS */
> +#define OF_FLASH_PARTS(ndfc) (0)
> +#define parse_partitions(ndfc, dev) (0)
> +#endif /* MTD_PARTITIONS */
> +
> +
> +static int of_ndfc_remove(struct of_device *dev)
> +{
> + struct of_ndfc *ndfc;
> +
> + ndfc =3D dev_get_drvdata(&dev->dev);
> + if (!ndfc)
> + return 0;
> +
> + if (OF_FLASH_PARTS(ndfc)) {
> + del_mtd_partitions(&ndfc->mtd);
> + kfree(OF_FLASH_PARTS(ndfc));
> + } else {
> + del_mtd_device(&ndfc->mtd);
> + }
> + nand_release(&ndfc->mtd);
> +
> + dev_set_drvdata(&dev->dev, NULL);
> +
> + if (ndfc->base)
> + iounmap(ndfc->base);
> +
> + if (ndfc->res) {
> + release_resource(ndfc->res);
> + kfree(ndfc->res);
> + }
> +
> + kfree(ndfc);
> +
> + return 0;
> +}
> +
> +
> +static int __devinit ndfc_map_banks(struct of_ndfc *ndfc, const u32 *mas=
k)
> +{
> + unsigned cnt, i, tmp;
> + uint32_t bcr;
> +
> + if (!ndfc || !mask)
> + return -EINVAL;
> +
> + /* Disable all banks */
> + for (cnt =3D 0; cnt < NDFC_MAX_BANKS; cnt++) {
> + ndfc_raw_writel(ndfc, NDFC_BCFG0 + (cnt << 2), 0);
> + }
> +
> + /* Enable bank and set default RE/WE/CE timings */
> + bcr =3D NDFC_BxCFG_EN | NDFC_BxCFG_RR(2) | NDFC_BxCFG_RWH(2) |
> + NDFC_BxCFG_RWP(2) | NDFC_BxCFG_CRW(2);
> + if (ndfc->bank_width =3D=3D 2)
> + bcr |=3D NDFC_BxCFG_SZ_16BIT;
> +
> + cnt =3D 0;
> + tmp =3D *mask;
> + while ((i =3D ffs(tmp)) && (cnt < NDFC_MAX_BANKS)) {
> + i--;
> + tmp &=3D ~(1 << i);
> + ndfc->chip_map[cnt++] =3D i;
> + ndfc_raw_writel(ndfc, NDFC_BCFG0 + (i << 2), bcr);
> + }
> + ndfc->chip_cnt =3D cnt;
> + return cnt;
> +}
> +
> +
> +static int __devinit of_ndfc_probe(struct of_device *dev,
> + const struct of_device_id *match)
> +{
> + struct device_node *dp =3D dev->node;
> + struct resource res;
> + struct of_ndfc *ndfc;
> + const u32 *prop;
> + resource_size_t rlen;
> + int err;
> +
> + err =3D -ENXIO;
> + if (of_address_to_resource(dp, 0, &res)) {
> + dev_err(&dev->dev, "can't get IO address from device tree\n");
> + goto err_out;
> + }
> +
> + dev_dbg(&dev->dev, "regs: %.8llx-%.8llx\n",
> + (unsigned long long)res.start, (unsigned long long)res.end);
> +
> + ndfc =3D kzalloc(sizeof(struct of_ndfc), GFP_KERNEL);
> + if (!ndfc) {
> + err =3D -ENOMEM;
> + goto err_out;
> + }
> +
> + rlen =3D res.end - res.start + 1;
> + ndfc->res =3D request_mem_region(res.start, rlen, dev->dev.bus_id);
> + if (!ndfc->res) {
> + err =3D -EBUSY;
> + goto err_free_out;
> + }
> +
> + ndfc->base =3D ioremap(res.start, rlen);
> + if (!ndfc->base) {
> + err =3D -ENXIO;
> + goto err_rel_out;
> + }
> +
> + spin_lock_init(&ndfc->control.lock);
> + init_waitqueue_head(&ndfc->control.wq);
> +
> + prop =3D of_get_property(dp, "bank-width", NULL);
> + ndfc->bank_width =3D ((prop) && (*prop) =3D=3D 2) ? 2 : 1;
> +
> + prop =3D of_get_property(dp, "bank-mask", NULL);
> + err =3D ndfc_map_banks(ndfc, prop);
> + if (err <=3D 0) {
> + dev_err(&dev->dev, "no banks found\n");
> + err =3D -ENODEV;
> + goto err_unmap_out;
> + }
> +
> + ndfc_chip_init(&ndfc->chip, ndfc);
> + dev_set_drvdata(&dev->dev, ndfc);
> +
> + dev_info(&dev->dev, "NDFC driver initialized. Chip-Rev: 0x%08x\n",
> + ndfc_raw_readl(ndfc, NDFC_REVID));
> +
> + err =3D nand_scan_ident(&ndfc->mtd, ndfc->chip_cnt);
> + if (err)
> + goto err_dat_out;
> +
> + if ((ndfc->mtd.writesize !=3D 2048) && (ndfc->mtd.writesize !=3D 512)) {
> + dev_err(&dev->dev, "unexpected NAND flash writesize %d",
> + ndfc->mtd.writesize);
> + goto err_dat_out;
> + }
> +
> + err =3D nand_scan_tail(&ndfc->mtd);
> + if (err)
> + goto err_dat_out;
> +
> + err =3D parse_partitions(ndfc, dev);
> + if (err < 0)
> + goto err_dat_out;
> +
> + if (err > 0)
> + add_mtd_partitions(&ndfc->mtd, OF_FLASH_PARTS(ndfc), err);
> + else
> + add_mtd_device(&ndfc->mtd);
> +
> + return 0;
> +
> +err_dat_out:
> + dev_set_drvdata(&dev->dev, NULL);
> +err_unmap_out:
> + iounmap(ndfc->base);
> +err_rel_out:
> + release_resource(ndfc->res);
> + kfree(ndfc->res);
> +err_free_out:
> + kfree(ndfc);
> +err_out:
> + return err;
> +}
> +
> +static struct of_device_id of_ndfc_match[] =3D {
> + {
> + .compatible =3D "ibm,ndfc",
> + },
> + { },
> +};
> +MODULE_DEVICE_TABLE(of, of_ndfc_match);
> +
> +static struct of_platform_driver of_ndfc_driver =3D {
> + .name =3D "of-ndfc",
> + .match_table =3D of_ndfc_match,
> + .probe =3D of_ndfc_probe,
> + .remove =3D of_ndfc_remove,
> +};
> +
> +static int __init of_ndfc_init(void)
> +{
> + return of_register_platform_driver(&of_ndfc_driver);
> +}
> +
> +static void __exit of_ndfc_exit(void)
> +{
> + of_unregister_platform_driver(&of_ndfc_driver);
> +}
> +
> +module_init(of_ndfc_init);
> +module_exit(of_ndfc_exit);
> +
> +MODULE_LICENSE("GPL");
> +
> +
> +MODULE_DESCRIPTION("OF driver for NDFC");
> diff -pruN linux-2.6.orig/include/linux/mtd/ndfc.h
> linux-2.6/include/linux/mtd/ndfc.h ---
> linux-2.6.orig/include/linux/mtd/ndfc.h 2007-10-25 19:20:42.000000000 +04=
00
> +++ linux-2.6/include/linux/mtd/ndfc.h 2007-10-26 16:19:42.000000000 +0400
> @@ -52,6 +52,10 @@
> #define NDFC_BxCFG_SZ_MASK 0x08000000 /* Bank Size */
> #define NDFC_BxCFG_SZ_8BIT 0x00000000 /* 8bit */
> #define NDFC_BxCFG_SZ_16BIT 0x08000000 /* 16bit */
> +#define NDFC_BxCFG_RR(x) (((x) & 0x7) << 0)
> +#define NDFC_BxCFG_RWH(x) (((x) & 0x7) << 4)
> +#define NDFC_BxCFG_RWP(x) (((x) & 0x7) << 8)
> +#define NDFC_BxCFG_CRW(x) (((x) & 0x7) << 12)
>
> #define NDFC_MAX_BANKS 4
Best regards,
Stefan
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox