* [PATCH v3] powerpc: Keep track of emulated instructions if debugfs is enabled
From: Geert Uytterhoeven @ 2009-05-08 14:15 UTC (permalink / raw)
To: Linux/PPC Development
Counters for the various classes of emulated instructions are available under
/sys/kernel/debug/powerpc/emulated_instructions (assumed debugfs is mounted on
/sys/kernel/debug). Optionally (controlled by
/sys/kernel/debug/powerpc/emulated_instructions/do_warn), rate-limited warnings
can be printed to the console when instructions are emulated.
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
---
Tested on ppc64 (ps3) and ppc32 (sequoia) using mfpvr.
v3:
- add generic unaligned
- switch from sysfs + sysctl to debugfs. All virtual files now show up under
/sys/kernel/debug/powerpc/emulated_instructions (assumed debugfs mounted on
/sys/kernel/debug)
- enable the printing of rate-limited warnings by writing a non-zero value to
/sys/kernel/debug/powerpc/emulated_instructions/do_warn
- switch from per-CPU to system-wide counters
- always use 32-bit counters (was 64-bit on ppc64)
- counters are writable, i.e. can be reset (by root)
v2:
- arch/powerpc/kernel/sysfs.c is now compiled on ppc32, so we can provide
counters in sysfs on ppc32, too,
- WARN_EMULATED() is a no-op if CONFIG_SYSCTL is disabled,
- Add warnings for altivec,
- Add warnings for recently introduced emulation of vsx and isel
instructions.
arch/powerpc/include/asm/emulated_ops.h | 73 +++++++++++++++++++++++
arch/powerpc/kernel/align.c | 20 +++++-
arch/powerpc/kernel/traps.c | 96 ++++++++++++++++++++++++++++++-
3 files changed, 183 insertions(+), 6 deletions(-)
create mode 100644 arch/powerpc/include/asm/emulated_ops.h
diff --git a/arch/powerpc/include/asm/emulated_ops.h b/arch/powerpc/include/asm/emulated_ops.h
new file mode 100644
index 0000000..a1fdb0a
--- /dev/null
+++ b/arch/powerpc/include/asm/emulated_ops.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2007 Sony Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _ASM_POWERPC_EMULATED_OPS_H
+#define _ASM_POWERPC_EMULATED_OPS_H
+
+#include <asm/atomic.h>
+
+
+#ifdef CONFIG_DEBUG_FS
+
+struct ppc_emulated_entry {
+ const char *name;
+ atomic_t val;
+};
+
+extern struct ppc_emulated {
+#ifdef CONFIG_ALTIVEC
+ struct ppc_emulated_entry altivec;
+#endif
+ struct ppc_emulated_entry dcba;
+ struct ppc_emulated_entry dcbz;
+ struct ppc_emulated_entry fp_pair;
+ struct ppc_emulated_entry isel;
+ struct ppc_emulated_entry mcrxr;
+ struct ppc_emulated_entry mfpvr;
+ struct ppc_emulated_entry multiple;
+ struct ppc_emulated_entry popcntb;
+ struct ppc_emulated_entry spe;
+ struct ppc_emulated_entry string;
+ struct ppc_emulated_entry unaligned;
+#ifdef CONFIG_MATH_EMULATION
+ struct ppc_emulated_entry math;
+#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
+ struct ppc_emulated_entry 8xx;
+#endif
+#ifdef CONFIG_VSX
+ struct ppc_emulated_entry vsx;
+#endif
+} ppc_emulated;
+
+extern u32 ppc_warn_emulated;
+
+extern void ppc_warn_emulated_print(const char *type);
+
+#define PPC_WARN_EMULATED(type) \
+ do { \
+ atomic_inc(&ppc_emulated.type.val); \
+ if (ppc_warn_emulated) \
+ ppc_warn_emulated_print(ppc_emulated.type.name); \
+ } while (0)
+
+#else /* !CONFIG_DEBUG_FS */
+
+#define PPC_WARN_EMULATED(type) do { } while (0)
+
+#endif /* !CONFIG_DEBUG_FS */
+
+#endif /* _ASM_POWERPC_EMULATED_OPS_H */
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 5ffcfaa..a5b632e 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -24,6 +24,7 @@
#include <asm/system.h>
#include <asm/cache.h>
#include <asm/cputable.h>
+#include <asm/emulated_ops.h>
struct aligninfo {
unsigned char len;
@@ -730,8 +731,10 @@ int fix_alignment(struct pt_regs *regs)
areg = dsisr & 0x1f; /* register to update */
#ifdef CONFIG_SPE
- if ((instr >> 26) == 0x4)
+ if ((instr >> 26) == 0x4) {
+ PPC_WARN_EMULATED(spe);
return emulate_spe(regs, reg, instr);
+ }
#endif
instr = (dsisr >> 10) & 0x7f;
@@ -783,23 +786,28 @@ int fix_alignment(struct pt_regs *regs)
flags |= SPLT;
nb = 8;
}
+ PPC_WARN_EMULATED(vsx);
return emulate_vsx(addr, reg, areg, regs, flags, nb);
}
#endif
/* A size of 0 indicates an instruction we don't support, with
* the exception of DCBZ which is handled as a special case here
*/
- if (instr == DCBZ)
+ if (instr == DCBZ) {
+ PPC_WARN_EMULATED(dcbz);
return emulate_dcbz(regs, addr);
+ }
if (unlikely(nb == 0))
return 0;
/* Load/Store Multiple instructions are handled in their own
* function
*/
- if (flags & M)
+ if (flags & M) {
+ PPC_WARN_EMULATED(multiple);
return emulate_multiple(regs, addr, reg, nb,
flags, instr, swiz);
+ }
/* Verify the address of the operand */
if (unlikely(user_mode(regs) &&
@@ -816,8 +824,12 @@ int fix_alignment(struct pt_regs *regs)
}
/* Special case for 16-byte FP loads and stores */
- if (nb == 16)
+ if (nb == 16) {
+ PPC_WARN_EMULATED(fp_pair);
return emulate_fp_pair(addr, reg, flags);
+ }
+
+ PPC_WARN_EMULATED(unaligned);
/* If we are loading, get the data from user space, else
* get it from register values
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 678fbff..1e88109 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -33,7 +33,9 @@
#include <linux/backlight.h>
#include <linux/bug.h>
#include <linux/kdebug.h>
+#include <linux/debugfs.h>
+#include <asm/emulated_ops.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -757,36 +759,44 @@ static int emulate_instruction(struct pt_regs *regs)
/* Emulate the mfspr rD, PVR. */
if ((instword & PPC_INST_MFSPR_PVR_MASK) == PPC_INST_MFSPR_PVR) {
+ PPC_WARN_EMULATED(mfpvr);
rd = (instword >> 21) & 0x1f;
regs->gpr[rd] = mfspr(SPRN_PVR);
return 0;
}
/* Emulating the dcba insn is just a no-op. */
- if ((instword & PPC_INST_DCBA_MASK) == PPC_INST_DCBA)
+ if ((instword & PPC_INST_DCBA_MASK) == PPC_INST_DCBA) {
+ PPC_WARN_EMULATED(dcba);
return 0;
+ }
/* Emulate the mcrxr insn. */
if ((instword & PPC_INST_MCRXR_MASK) == PPC_INST_MCRXR) {
int shift = (instword >> 21) & 0x1c;
unsigned long msk = 0xf0000000UL >> shift;
+ PPC_WARN_EMULATED(mcrxr);
regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk);
regs->xer &= ~0xf0000000UL;
return 0;
}
/* Emulate load/store string insn. */
- if ((instword & PPC_INST_STRING_GEN_MASK) == PPC_INST_STRING)
+ if ((instword & PPC_INST_STRING_GEN_MASK) == PPC_INST_STRING) {
+ PPC_WARN_EMULATED(string);
return emulate_string_inst(regs, instword);
+ }
/* Emulate the popcntb (Population Count Bytes) instruction. */
if ((instword & PPC_INST_POPCNTB_MASK) == PPC_INST_POPCNTB) {
+ PPC_WARN_EMULATED(popcntb);
return emulate_popcntb_inst(regs, instword);
}
/* Emulate isel (Integer Select) instruction */
if ((instword & PPC_INST_ISEL_MASK) == PPC_INST_ISEL) {
+ PPC_WARN_EMULATED(isel);
return emulate_isel(regs, instword);
}
@@ -984,6 +994,8 @@ void SoftwareEmulation(struct pt_regs *regs)
#ifdef CONFIG_MATH_EMULATION
errcode = do_mathemu(regs);
+ if (errcode >= 0)
+ PPC_WARN_EMULATED(math);
switch (errcode) {
case 0:
@@ -1005,6 +1017,9 @@ void SoftwareEmulation(struct pt_regs *regs)
#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
errcode = Soft_emulate_8xx(regs);
+ if (errcode >= 0)
+ PPC_WARN_EMULATED(8xx);
+
switch (errcode) {
case 0:
emulate_single_step(regs);
@@ -1088,6 +1103,7 @@ void altivec_assist_exception(struct pt_regs *regs)
flush_altivec_to_thread(current);
+ PPC_WARN_EMULATED(altivec);
err = emulate_altivec(regs);
if (err == 0) {
regs->nip += 4; /* skip emulated instruction */
@@ -1286,3 +1302,79 @@ void kernel_bad_stack(struct pt_regs *regs)
void __init trap_init(void)
{
}
+
+
+#ifdef CONFIG_DEBUG_FS
+
+#define WARN_EMULATED_SETUP(type) .type = { .name = #type }
+
+struct ppc_emulated ppc_emulated = {
+#ifdef CONFIG_ALTIVEC
+ WARN_EMULATED_SETUP(altivec),
+#endif
+ WARN_EMULATED_SETUP(dcba),
+ WARN_EMULATED_SETUP(dcbz),
+ WARN_EMULATED_SETUP(fp_pair),
+ WARN_EMULATED_SETUP(isel),
+ WARN_EMULATED_SETUP(mcrxr),
+ WARN_EMULATED_SETUP(mfpvr),
+ WARN_EMULATED_SETUP(multiple),
+ WARN_EMULATED_SETUP(popcntb),
+ WARN_EMULATED_SETUP(spe),
+ WARN_EMULATED_SETUP(string),
+ WARN_EMULATED_SETUP(unaligned),
+#ifdef CONFIG_MATH_EMULATION
+ WARN_EMULATED_SETUP(math),
+#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
+ WARN_EMULATED_SETUP(8xx),
+#endif
+#ifdef CONFIG_VSX
+ WARN_EMULATED_SETUP(vsx),
+#endif
+};
+
+u32 ppc_warn_emulated;
+
+void ppc_warn_emulated_print(const char *type)
+{
+ if (printk_ratelimit())
+ pr_warning("%s used emulated %s instruction\n", current->comm,
+ type);
+}
+
+static int __init ppc_warn_emulated_init(void)
+{
+ struct dentry *dir, *d;
+ unsigned int i;
+ struct ppc_emulated_entry *entries = (void *)&ppc_emulated;
+
+ if (!powerpc_debugfs_root)
+ return -ENODEV;
+
+ dir = debugfs_create_dir("emulated_instructions",
+ powerpc_debugfs_root);
+ if (!dir)
+ return -ENOMEM;
+
+ d = debugfs_create_u32("do_warn", S_IRUGO | S_IWUSR, dir,
+ &ppc_warn_emulated);
+ if (!d)
+ goto fail;
+
+ for (i = 0; i < sizeof(ppc_emulated)/sizeof(*entries); i++) {
+ d = debugfs_create_u32(entries[i].name, S_IRUGO | S_IWUSR, dir,
+ (u32 *)&entries[i].val.counter);
+ if (!d)
+ goto fail;
+ }
+
+ return 0;
+
+fail:
+ debugfs_remove_recursive(dir);
+ return -ENOMEM;
+}
+
+device_initcall(ppc_warn_emulated_init);
+
+#endif /* !CONFIG_DEBUG_FS */
--
1.6.2.4
With kind regards,
Geert Uytterhoeven
Software Architect
Techsoft Centre
Technology and Software Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
^ permalink raw reply related
* Re: [PATCH 3/6] powerpc/85xx: Fix reg and interrupts for mpc8569emds' localbus, add NAND
From: Kumar Gala @ 2009-05-08 14:11 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linuxppc-dev, Haiying Wang
In-Reply-To: <20090502021651.GC18281@oksana.dev.rtsoft.ru>
On May 1, 2009, at 9:16 PM, Anton Vorontsov wrote:
> This patch fixes bogus reg = <> property in the localbus node,
> and fixes interrupt property (should be "interrupts").
>
> Also add node for NAND support.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> arch/powerpc/boot/dts/mpc8569mds.dts | 11 +++++++++--
> 1 files changed, 9 insertions(+), 2 deletions(-)
applied to next
- k
^ permalink raw reply
* Re: [PATCH 2/6] powerpc/85xx: Fix mpc8569emds' crypto node to include SNOW unit
From: Kumar Gala @ 2009-05-08 14:11 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linuxppc-dev, Haiying Wang
In-Reply-To: <20090502021649.GB18281@oksana.dev.rtsoft.ru>
On May 1, 2009, at 9:16 PM, Anton Vorontsov wrote:
> fsl,exec-units-mask should be 0xbfe to include SNOW unit in
> MPC8569E's security engine.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> arch/powerpc/boot/dts/mpc8569mds.dts | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
applied to next
- k
^ permalink raw reply
* Re: [PATCH 1/6] powerpc/85xx: Add PCI IDs for MPC8569 family processors
From: Kumar Gala @ 2009-05-08 14:10 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linuxppc-dev, Haiying Wang
In-Reply-To: <20090502021647.GA18281@oksana.dev.rtsoft.ru>
On May 1, 2009, at 9:16 PM, Anton Vorontsov wrote:
> This patch adds PCI IDs for MPC8569 and MPC8569E processors,
> plus adds appropriate quirks for these IDs, and thus makes
> PCI-E actually work on MPC8569E-MDS boards.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> arch/powerpc/sysdev/fsl_pci.c | 2 ++
> include/linux/pci_ids.h | 2 ++
> 2 files changed, 4 insertions(+), 0 deletions(-)
applied to next
- k
^ permalink raw reply
* [PATCH] powerpc/fsl: Removed reg property from 85xx/86xx soc node
From: Kumar Gala @ 2009-05-08 14:05 UTC (permalink / raw)
To: linuxppc-dev
Between the addition of the ecm/mcm law nodes and the fact that the
get_immrbase() has been using the range property of the SoC to determine
the base address of CCSR space we no longer need the reg property at
the soc node level. It has been ill specified and varied between device
trees to cover either the {e,m}cm-law node, some odd subset of CCSR
space or all of CCSR space.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/boot/dts/gef_ppc9a.dts | 1 -
arch/powerpc/boot/dts/gef_sbc310.dts | 1 -
arch/powerpc/boot/dts/gef_sbc610.dts | 1 -
arch/powerpc/boot/dts/mpc8536ds.dts | 1 -
arch/powerpc/boot/dts/mpc8540ads.dts | 1 -
arch/powerpc/boot/dts/mpc8541cds.dts | 1 -
arch/powerpc/boot/dts/mpc8544ds.dts | 1 -
arch/powerpc/boot/dts/mpc8548cds.dts | 1 -
arch/powerpc/boot/dts/mpc8555cds.dts | 1 -
arch/powerpc/boot/dts/mpc8560ads.dts | 1 -
arch/powerpc/boot/dts/mpc8568mds.dts | 1 -
arch/powerpc/boot/dts/mpc8569mds.dts | 1 -
arch/powerpc/boot/dts/mpc8572ds.dts | 1 -
arch/powerpc/boot/dts/mpc8572ds_36b.dts | 1 -
arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts | 1 -
arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts | 1 -
arch/powerpc/boot/dts/mpc8610_hpcd.dts | 1 -
arch/powerpc/boot/dts/mpc8641_hpcn.dts | 1 -
arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts | 1 -
arch/powerpc/boot/dts/sbc8548.dts | 1 -
arch/powerpc/boot/dts/sbc8560.dts | 1 -
arch/powerpc/boot/dts/sbc8641d.dts | 1 -
arch/powerpc/boot/dts/socrates.dts | 1 -
arch/powerpc/boot/dts/stx_gp3_8560.dts | 1 -
arch/powerpc/boot/dts/tqm8540.dts | 1 -
arch/powerpc/boot/dts/tqm8541.dts | 1 -
arch/powerpc/boot/dts/tqm8548-bigflash.dts | 1 -
arch/powerpc/boot/dts/tqm8548.dts | 1 -
arch/powerpc/boot/dts/tqm8555.dts | 1 -
arch/powerpc/boot/dts/tqm8560.dts | 1 -
30 files changed, 0 insertions(+), 30 deletions(-)
diff --git a/arch/powerpc/boot/dts/gef_ppc9a.dts b/arch/powerpc/boot/dts/gef_ppc9a.dts
index 38dd005..910944e 100644
--- a/arch/powerpc/boot/dts/gef_ppc9a.dts
+++ b/arch/powerpc/boot/dts/gef_ppc9a.dts
@@ -164,7 +164,6 @@
device_type = "soc";
compatible = "fsl,mpc8641-soc", "simple-bus";
ranges = <0x0 0xfef00000 0x00100000>;
- reg = <0xfef00000 0x100000>; // CCSRBAR 1M
bus-frequency = <33333333>;
mcm-law@0 {
diff --git a/arch/powerpc/boot/dts/gef_sbc310.dts b/arch/powerpc/boot/dts/gef_sbc310.dts
index 155776c..0f4c9ec 100644
--- a/arch/powerpc/boot/dts/gef_sbc310.dts
+++ b/arch/powerpc/boot/dts/gef_sbc310.dts
@@ -163,7 +163,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0xfef00000 0x00100000>;
- reg = <0xfef00000 0x100000>; // CCSRBAR 1M
bus-frequency = <33333333>;
mcm-law@0 {
diff --git a/arch/powerpc/boot/dts/gef_sbc610.dts b/arch/powerpc/boot/dts/gef_sbc610.dts
index 6898d7e..217f8aa 100644
--- a/arch/powerpc/boot/dts/gef_sbc610.dts
+++ b/arch/powerpc/boot/dts/gef_sbc610.dts
@@ -128,7 +128,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0xfef00000 0x00100000>;
- reg = <0xfef00000 0x100000>; // CCSRBAR 1M
bus-frequency = <33333333>;
mcm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8536ds.dts b/arch/powerpc/boot/dts/mpc8536ds.dts
index b6fd856..e781ad2 100644
--- a/arch/powerpc/boot/dts/mpc8536ds.dts
+++ b/arch/powerpc/boot/dts/mpc8536ds.dts
@@ -51,7 +51,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0xffe00000 0x100000>;
- reg = <0xffe00000 0x1000>;
bus-frequency = <0>; // Filled out by uboot.
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8540ads.dts b/arch/powerpc/boot/dts/mpc8540ads.dts
index 7c8b109..9dc2929 100644
--- a/arch/powerpc/boot/dts/mpc8540ads.dts
+++ b/arch/powerpc/boot/dts/mpc8540ads.dts
@@ -55,7 +55,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x100000>; // CCSRBAR 1M
bus-frequency = <0>;
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8541cds.dts b/arch/powerpc/boot/dts/mpc8541cds.dts
index de9d8b5..9a3ad31 100644
--- a/arch/powerpc/boot/dts/mpc8541cds.dts
+++ b/arch/powerpc/boot/dts/mpc8541cds.dts
@@ -55,7 +55,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x1000>; // CCSRBAR 1M
bus-frequency = <0>;
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
index 9819d6c..98e94b4 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -57,7 +57,6 @@
compatible = "simple-bus";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x1000>; // CCSRBAR 1M
bus-frequency = <0>; // Filled out by uboot.
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts
index 6e40db7..475be14 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -60,7 +60,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x1000>; // CCSRBAR
bus-frequency = <0>;
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8555cds.dts b/arch/powerpc/boot/dts/mpc8555cds.dts
index 6291497..065b2f0 100644
--- a/arch/powerpc/boot/dts/mpc8555cds.dts
+++ b/arch/powerpc/boot/dts/mpc8555cds.dts
@@ -55,7 +55,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x1000>; // CCSRBAR 1M
bus-frequency = <0>;
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
index a2347b5..a5bb1ec 100644
--- a/arch/powerpc/boot/dts/mpc8560ads.dts
+++ b/arch/powerpc/boot/dts/mpc8560ads.dts
@@ -55,7 +55,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x200>;
bus-frequency = <330000000>;
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index fcab168..073f140 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -62,7 +62,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x1000>;
bus-frequency = <0>;
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8569mds.dts b/arch/powerpc/boot/dts/mpc8569mds.dts
index e16a5d4..69cec81 100644
--- a/arch/powerpc/boot/dts/mpc8569mds.dts
+++ b/arch/powerpc/boot/dts/mpc8569mds.dts
@@ -94,7 +94,6 @@
device_type = "soc";
compatible = "fsl,mpc8569-immr", "simple-bus";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x1000>;
bus-frequency = <0>;
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8572ds.dts b/arch/powerpc/boot/dts/mpc8572ds.dts
index 3f9a623..cafc128 100644
--- a/arch/powerpc/boot/dts/mpc8572ds.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds.dts
@@ -182,7 +182,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0 0xffe00000 0x100000>;
- reg = <0 0xffe00000 0 0x1000>; // CCSRBAR & soc regs, remove once parse code for immrbase fixed
bus-frequency = <0>; // Filled out by uboot.
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8572ds_36b.dts b/arch/powerpc/boot/dts/mpc8572ds_36b.dts
index fee17f3..1197965 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_36b.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_36b.dts
@@ -182,7 +182,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0xf 0xffe00000 0x100000>;
- reg = <0xf 0xffe00000 0 0x1000>; // CCSRBAR & soc regs, remove once parse code for immrbase fixed
bus-frequency = <0>; // Filled out by uboot.
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
index abb1730..5bd1011 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
@@ -59,7 +59,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0xffe00000 0x100000>;
- reg = <0xffe00000 0x1000>; // CCSRBAR & soc regs, remove once parse code for immrbase fixed
bus-frequency = <0>; // Filled out by uboot.
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
index 0ded4a6..0efc345 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
@@ -58,7 +58,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x0 0xffe00000 0x100000>;
- reg = <0xffe00000 0x1000>; // CCSRBAR & soc regs, remove once parse code for immrbase fixed
bus-frequency = <0>; // Filled out by uboot.
L2: l2-cache-controller@20000 {
diff --git a/arch/powerpc/boot/dts/mpc8610_hpcd.dts b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
index 252db6e..cfc2c60 100644
--- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts
+++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
@@ -112,7 +112,6 @@
device_type = "soc";
compatible = "fsl,mpc8610-immr", "simple-bus";
ranges = <0x0 0xe0000000 0x00100000>;
- reg = <0xe0000000 0x1000>;
bus-frequency = <0>;
mcm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index 8bcccd7..848320e 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -114,7 +114,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x00000000 0xffe00000 0x00100000>;
- reg = <0xffe00000 0x00001000>; // CCSRBAR
bus-frequency = <0>;
mcm-law@0 {
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts b/arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts
index d4c909d..65893b9 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts
@@ -107,7 +107,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x00000000 0x0f 0xffe00000 0x00100000>;
- reg = <0x0f 0xffe00000 0x0 0x00001000>; // CCSRBAR
bus-frequency = <0>;
mcm-law@0 {
diff --git a/arch/powerpc/boot/dts/sbc8548.dts b/arch/powerpc/boot/dts/sbc8548.dts
index 66c9165..9eefe00 100644
--- a/arch/powerpc/boot/dts/sbc8548.dts
+++ b/arch/powerpc/boot/dts/sbc8548.dts
@@ -151,7 +151,6 @@
#size-cells = <1>;
device_type = "soc";
ranges = <0x00000000 0xe0000000 0x00100000>;
- reg = <0xe0000000 0x00001000>; // CCSRBAR
bus-frequency = <0>;
compatible = "simple-bus";
diff --git a/arch/powerpc/boot/dts/sbc8560.dts b/arch/powerpc/boot/dts/sbc8560.dts
index ff6a522..239d57a 100644
--- a/arch/powerpc/boot/dts/sbc8560.dts
+++ b/arch/powerpc/boot/dts/sbc8560.dts
@@ -57,7 +57,6 @@
#size-cells = <1>;
device_type = "soc";
ranges = <0x0 0xff700000 0x00100000>;
- reg = <0xff700000 0x00100000>;
clock-frequency = <0>;
ecm-law@0 {
diff --git a/arch/powerpc/boot/dts/sbc8641d.dts b/arch/powerpc/boot/dts/sbc8641d.dts
index aa8f931..ee5538f 100644
--- a/arch/powerpc/boot/dts/sbc8641d.dts
+++ b/arch/powerpc/boot/dts/sbc8641d.dts
@@ -126,7 +126,6 @@
device_type = "soc";
compatible = "simple-bus";
ranges = <0x00000000 0xf8000000 0x00100000>;
- reg = <0xf8000000 0x00001000>; // CCSRBAR
bus-frequency = <0>;
mcm-law@0 {
diff --git a/arch/powerpc/boot/dts/socrates.dts b/arch/powerpc/boot/dts/socrates.dts
index 779876a..feb4ef6 100644
--- a/arch/powerpc/boot/dts/socrates.dts
+++ b/arch/powerpc/boot/dts/socrates.dts
@@ -55,7 +55,6 @@
device_type = "soc";
ranges = <0x00000000 0xe0000000 0x00100000>;
- reg = <0xe0000000 0x00001000>; // CCSRBAR 1M
bus-frequency = <0>; // Filled in by U-Boot
compatible = "fsl,mpc8544-immr", "simple-bus";
diff --git a/arch/powerpc/boot/dts/stx_gp3_8560.dts b/arch/powerpc/boot/dts/stx_gp3_8560.dts
index ce35e89..b670d03 100644
--- a/arch/powerpc/boot/dts/stx_gp3_8560.dts
+++ b/arch/powerpc/boot/dts/stx_gp3_8560.dts
@@ -52,7 +52,6 @@
#size-cells = <1>;
device_type = "soc";
ranges = <0 0xfdf00000 0x100000>;
- reg = <0xfdf00000 0x1000>;
bus-frequency = <0>;
compatible = "fsl,mpc8560-immr", "simple-bus";
diff --git a/arch/powerpc/boot/dts/tqm8540.dts b/arch/powerpc/boot/dts/tqm8540.dts
index 5e9eecc..7134753 100644
--- a/arch/powerpc/boot/dts/tqm8540.dts
+++ b/arch/powerpc/boot/dts/tqm8540.dts
@@ -54,7 +54,6 @@
#size-cells = <1>;
device_type = "soc";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x200>;
bus-frequency = <0>;
compatible = "fsl,mpc8540-immr", "simple-bus";
diff --git a/arch/powerpc/boot/dts/tqm8541.dts b/arch/powerpc/boot/dts/tqm8541.dts
index 3c8d5c1..b30f637 100644
--- a/arch/powerpc/boot/dts/tqm8541.dts
+++ b/arch/powerpc/boot/dts/tqm8541.dts
@@ -53,7 +53,6 @@
#size-cells = <1>;
device_type = "soc";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x200>;
bus-frequency = <0>;
compatible = "fsl,mpc8541-immr", "simple-bus";
diff --git a/arch/powerpc/boot/dts/tqm8548-bigflash.dts b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
index 435d2b2..61f25e1 100644
--- a/arch/powerpc/boot/dts/tqm8548-bigflash.dts
+++ b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
@@ -55,7 +55,6 @@
#size-cells = <1>;
device_type = "soc";
ranges = <0x0 0xa0000000 0x100000>;
- reg = <0xa0000000 0x1000>; // CCSRBAR
bus-frequency = <0>;
compatible = "fsl,mpc8548-immr", "simple-bus";
diff --git a/arch/powerpc/boot/dts/tqm8548.dts b/arch/powerpc/boot/dts/tqm8548.dts
index 3b8af5b..025759c 100644
--- a/arch/powerpc/boot/dts/tqm8548.dts
+++ b/arch/powerpc/boot/dts/tqm8548.dts
@@ -55,7 +55,6 @@
#size-cells = <1>;
device_type = "soc";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x1000>; // CCSRBAR
bus-frequency = <0>;
compatible = "fsl,mpc8548-immr", "simple-bus";
diff --git a/arch/powerpc/boot/dts/tqm8555.dts b/arch/powerpc/boot/dts/tqm8555.dts
index a820bbe..95e2873 100644
--- a/arch/powerpc/boot/dts/tqm8555.dts
+++ b/arch/powerpc/boot/dts/tqm8555.dts
@@ -53,7 +53,6 @@
#size-cells = <1>;
device_type = "soc";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x200>;
bus-frequency = <0>;
compatible = "fsl,mpc8555-immr", "simple-bus";
diff --git a/arch/powerpc/boot/dts/tqm8560.dts b/arch/powerpc/boot/dts/tqm8560.dts
index fa73550..ff70580 100644
--- a/arch/powerpc/boot/dts/tqm8560.dts
+++ b/arch/powerpc/boot/dts/tqm8560.dts
@@ -55,7 +55,6 @@
#size-cells = <1>;
device_type = "soc";
ranges = <0x0 0xe0000000 0x100000>;
- reg = <0xe0000000 0x200>;
bus-frequency = <0>;
compatible = "fsl,mpc8560-immr", "simple-bus";
--
1.6.0.6
^ permalink raw reply related
* [PATCH 08/15] powerpc/cell: Extract duplicated IOPTE_* to <asm/iommu.h>
From: Geert Uytterhoeven @ 2009-05-08 14:01 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linux-fbdev-devel, Arnd Bergmann, linux-kernel, linuxppc-dev,
Geert Uytterhoeven, cbe-oss-dev
In-Reply-To: <1241791284-11490-8-git-send-email-Geert.Uytterhoeven@sonycom.com>
Both arch/powerpc/platforms/cell/iommu.c and arch/powerpc/platforms/ps3/mm.c
contain the same Cell IOMMU page table entry definitions. Extract them and move
them to <asm/iommu.h>.
This also allows them to be used by drivers.
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@ozlabs.org
---
arch/powerpc/include/asm/iommu.h | 10 ++++++++++
arch/powerpc/platforms/cell/iommu.c | 10 ----------
arch/powerpc/platforms/ps3/mm.c | 1 +
arch/powerpc/platforms/ps3/platform.h | 10 ----------
arch/powerpc/platforms/ps3/system-bus.c | 1 +
5 files changed, 12 insertions(+), 20 deletions(-)
diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h
index 7464c0d..0b16e76 100644
--- a/arch/powerpc/include/asm/iommu.h
+++ b/arch/powerpc/include/asm/iommu.h
@@ -35,6 +35,16 @@
#define IOMMU_PAGE_MASK (~((1 << IOMMU_PAGE_SHIFT) - 1))
#define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE)
+/* Cell page table entries */
+#define IOPTE_PP_W 0x8000000000000000ul /* protection: write */
+#define IOPTE_PP_R 0x4000000000000000ul /* protection: read */
+#define IOPTE_M 0x2000000000000000ul /* coherency required */
+#define IOPTE_SO_R 0x1000000000000000ul /* ordering: writes */
+#define IOPTE_SO_RW 0x1800000000000000ul /* ordering: r & w */
+#define IOPTE_RPN_Mask 0x07fffffffffff000ul /* RPN */
+#define IOPTE_H 0x0000000000000800ul /* cache hint */
+#define IOPTE_IOID_Mask 0x00000000000007fful /* ioid */
+
/* Boot time flags */
extern int iommu_is_off;
extern int iommu_force_on;
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index bed4690..d85691c 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -100,16 +100,6 @@
#define IOSTE_PS_1M 0x0000000000000005ul /* - 1MB */
#define IOSTE_PS_16M 0x0000000000000007ul /* - 16MB */
-/* Page table entries */
-#define IOPTE_PP_W 0x8000000000000000ul /* protection: write */
-#define IOPTE_PP_R 0x4000000000000000ul /* protection: read */
-#define IOPTE_M 0x2000000000000000ul /* coherency required */
-#define IOPTE_SO_R 0x1000000000000000ul /* ordering: writes */
-#define IOPTE_SO_RW 0x1800000000000000ul /* ordering: r & w */
-#define IOPTE_RPN_Mask 0x07fffffffffff000ul /* RPN */
-#define IOPTE_H 0x0000000000000800ul /* cache hint */
-#define IOPTE_IOID_Mask 0x00000000000007fful /* ioid */
-
/* IOMMU sizing */
#define IO_SEGMENT_SHIFT 28
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index 9a2b6d9..4f17e1d 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -24,6 +24,7 @@
#include <linux/lmb.h>
#include <asm/firmware.h>
+#include <asm/iommu.h>
#include <asm/prom.h>
#include <asm/udbg.h>
#include <asm/lv1call.h>
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h
index 136aa06..9a196a8 100644
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -232,14 +232,4 @@ int ps3_repository_read_spu_resource_id(unsigned int res_index,
int ps3_repository_read_vuart_av_port(unsigned int *port);
int ps3_repository_read_vuart_sysmgr_port(unsigned int *port);
-/* Page table entries */
-#define IOPTE_PP_W 0x8000000000000000ul /* protection: write */
-#define IOPTE_PP_R 0x4000000000000000ul /* protection: read */
-#define IOPTE_M 0x2000000000000000ul /* coherency required */
-#define IOPTE_SO_R 0x1000000000000000ul /* ordering: writes */
-#define IOPTE_SO_RW 0x1800000000000000ul /* ordering: r & w */
-#define IOPTE_RPN_Mask 0x07fffffffffff000ul /* RPN */
-#define IOPTE_H 0x0000000000000800ul /* cache hint */
-#define IOPTE_IOID_Mask 0x00000000000007fful /* ioid */
-
#endif
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index 9a73d02..6c655eb 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -27,6 +27,7 @@
#include <asm/udbg.h>
#include <asm/lv1call.h>
#include <asm/firmware.h>
+#include <asm/iommu.h>
#include "platform.h"
--
1.6.2.4
^ permalink raw reply related
* [PATCH] net/fs_enet/mii-fec: Use PHY_POLL instead of hard coded '-1'
From: Wolfram Sang @ 2009-05-08 14:00 UTC (permalink / raw)
To: w.sang; +Cc: netdev, linuxppc-dev, Vitaly Bordug
Initialize the irq-table with PHY_POLL. '-1' means the same now, but is
hardly maintainable.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Vitaly Bordug <vbordug@ru.mvista.com>
Cc: Pantelis Antoniou <pantelis.antoniou@gmail.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: netdev@vger.kernel.org
Cc: linuxppc-dev@ozlabs.org
---
drivers/net/fs_enet/mii-fec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fec.c
index 28077cc..9eb5480 100644
--- a/drivers/net/fs_enet/mii-fec.c
+++ b/drivers/net/fs_enet/mii-fec.c
@@ -166,7 +166,7 @@ static int __devinit fs_enet_mdio_probe(struct of_device *ofdev,
goto out_unmap_regs;
for (i = 0; i < PHY_MAX_ADDR; i++)
- new_bus->irq[i] = -1;
+ new_bus->irq[i] = PHY_POLL;
while ((np = of_get_next_child(ofdev->node, np)))
if (!strcmp(np->type, "ethernet-phy"))
--
1.6.2
^ permalink raw reply related
* [PATCH] mmc: Add fsl,esdhc as a valid compatible to bind against
From: Kumar Gala @ 2009-05-08 13:52 UTC (permalink / raw)
To: pierre; +Cc: linuxppc-dev, linux-kernel
We plan to use fsl,esdhc going forward as the base compatible so update
the driver to bind against it.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
drivers/mmc/host/sdhci-of.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of.c b/drivers/mmc/host/sdhci-of.c
index 3ff4ac3..09cc597 100644
--- a/drivers/mmc/host/sdhci-of.c
+++ b/drivers/mmc/host/sdhci-of.c
@@ -277,6 +277,7 @@ static int __devexit sdhci_of_remove(struct of_device *ofdev)
static const struct of_device_id sdhci_of_match[] = {
{ .compatible = "fsl,mpc8379-esdhc", .data = &sdhci_esdhc, },
{ .compatible = "fsl,mpc8536-esdhc", .data = &sdhci_esdhc, },
+ { .compatible = "fsl,esdhc", .data = &sdhci_esdhc, },
{ .compatible = "generic-sdhci", },
{},
};
--
1.6.0.6
^ permalink raw reply related
* [PATCH] powerpc/fsl: Update FSL esdhc binding
From: Kumar Gala @ 2009-05-08 13:51 UTC (permalink / raw)
To: linuxppc-dev; +Cc: devicetree-discuss
Updated the binding spec to use "fsl,eshdc" as the base compatible
rather than the first chip in the family.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
Documentation/powerpc/dts-bindings/fsl/esdhc.txt | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt b/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
index 6008465..421897d 100644
--- a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
+++ b/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
@@ -5,8 +5,7 @@ for MMC, SD, and SDIO types of memory cards.
Required properties:
- compatible : should be
- "fsl,<chip>-esdhc", "fsl,mpc8379-esdhc" for MPC83xx processors.
- "fsl,<chip>-esdhc", "fsl,mpc8536-esdhc" for MPC85xx processors.
+ "fsl,<chip>-esdhc", "fsl,esdhc"
- reg : should contain eSDHC registers location and length.
- interrupts : should contain eSDHC interrupt.
- interrupt-parent : interrupt source phandle.
@@ -15,7 +14,7 @@ Required properties:
Example:
sdhci@2e000 {
- compatible = "fsl,mpc8378-esdhc", "fsl,mpc8379-esdhc";
+ compatible = "fsl,mpc8378-esdhc", "fsl,mpc8379-esdhc", "fsl,esdhc";
reg = <0x2e000 0x1000>;
interrupts = <42 0x8>;
interrupt-parent = <&ipic>;
--
1.6.0.6
^ permalink raw reply related
* Re: [PATCH 3/3 v3] Add 4xx SATA dts node documentation
From: Sergei Shtylyov @ 2009-05-08 13:35 UTC (permalink / raw)
To: Feng Kan; +Cc: linuxppc-dev
In-Reply-To: <1241632186-2613-1-git-send-email-fkan@amcc.com>
Feng Kan wrote:
> Signed-off-by: Feng Kan <fkan@amcc.com>
[...]
> diff --git a/Documentation/powerpc/dts-bindings/4xx/sata.txt b/Documentation/powerpc/dts-bindings/4xx/sata.txt
> new file mode 100644
> index 0000000..3ce00d0
> --- /dev/null
> +++ b/Documentation/powerpc/dts-bindings/4xx/sata.txt
> @@ -0,0 +1,24 @@
> +AMCC SoC SATA Support
> +
> +This following is only for the 460ex support for Designware SATA core
> +
> +Required properties:
> +- compatible : "amcc,sata-460ex".
> +- reg : the first set defines SATA controller register, the second set
> + is for the AHB DMA controller for SATA.
> +- interrupt-parent: UIC3
> +- interrupts: one for SATA and one for the DMA
> +
> +Notes:
> +The SATA is only available when the first PCIe port is disabled.
> +
> +Example:
> +
> +SATA0: sata@bffd1000 {
> + compatible = "amcc,sata-460ex";
> + reg = <4 0xbffd1000 0x800 4 0xbffd0800 0x400>;
Spaces ISO tab.
> + interrupt-parent = <&UIC3>;
> + interrupts = <0 4 /* SATA */
> + 5 4>; /* AHBDMA */
> +};
> +
MBR, Sergei
^ permalink raw reply
* [PowerPC] Next May 8 boot failure: OOPS during ibmveth module init
From: Sachin Sant @ 2009-05-08 12:52 UTC (permalink / raw)
To: linux-next; +Cc: linuxppc-dev, Stephen Rothwell, netdev
In-Reply-To: <20090508180251.f53f204e.sfr@canb.auug.org.au>
[-- Attachment #1: Type: text/plain, Size: 5383 bytes --]
Todays Next failed to boot on a Power6 JS22 blade with following oops.
Unable to handle kernel paging request for data at address 0x654af306c04b990
Faulting instruction address: 0xc00000000003a740
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=1024 NUMA pSeries
Modules linked in: ibmveth(+) sg sd_mod crc_t10dif ibmvscsic scsi_transport_srp scsi_tgt scsi_mod
NIP: c00000000003a740 LR: c000000000361e20 CTR: 0000000000000000
REGS: c000000042af6e80 TRAP: 0300 Not tainted (2.6.30-rc4-next-20090508)
MSR: 8000000000009032 <EE,ME,IR,DR> CR: 28222286 XER: 20000001
DAR: 0654af306c04b990, DSISR: 0000000040000000
TASK = c0000000428084d0[590] 'modprobe' THREAD: c000000042af4000 CPU: 0
GPR00: c000000000361e10 c000000042af7100 c000000000eb8190 c00000004427cc80
GPR04: 0654af306c04b990 0000000000000006 0000000000000000 0000000000000002
GPR08: c00000004427cc00 0000000000000088 0000000000000280 000000000000007c
GPR12: 0000000084222284 c000000000f92400 0000000000000000 0000000000000000
GPR16: 0000000000000000 0000000000000000 d000000000ed4346 d000000000ed3aa0
GPR20: d000000000ed6358 c00000004427cc00 00000000ffffffff 0000000000000000
GPR24: 0000000000000000 c0000000402d0000 0000000000000010 c00000004194b400
GPR28: 0000000000000006 0654af306c04b990 c000000000e44f18 0000000000000000
NIP [c00000000003a740] .memcpy+0x240/0x278
LR [c000000000361e20] .__nla_put+0x30/0x4c
Call Trace:
[c000000042af7100] [c000000000361e10] .__nla_put+0x20/0x4c (unreliable)
[c000000042af7190] [c000000000361e88] .nla_put+0x4c/0x60
[c000000042af7200] [c00000000053993c] .rtnl_fill_ifinfo+0x308/0x614
[c000000042af7300] [c00000000053a118] .rtmsg_ifinfo+0x104/0x198
[c000000042af73b0] [c00000000053a244] .rtnetlink_event+0x98/0xb0
[c000000042af7430] [c0000000005c8330] .notifier_call_chain+0x68/0xdc
[c000000042af74d0] [c000000000530488] .register_netdevice+0x390/0x418
[c000000042af75a0] [c000000000530568] .register_netdev+0x58/0x80
[c000000042af7630] [d000000000ed2da4] .ibmveth_probe+0x2c8/0x3a4 [ibmveth]
[c000000042af7730] [c000000000023208] .vio_bus_probe+0x2f0/0x358
[c000000042af77f0] [c000000000462be0] .driver_probe_device+0xd4/0x1bc
[c000000042af7890] [c000000000462d5c] .__driver_attach+0x94/0xd8
[c000000042af7920] [c000000000462164] .bus_for_each_dev+0x80/0xe8
[c000000042af79d0] [c0000000004629b0] .driver_attach+0x28/0x40
[c000000042af7a50] [c000000000461808] .bus_add_driver+0xdc/0x27c
[c000000042af7af0] [c0000000004631d0] .driver_register+0xf0/0x1b0
[c000000042af7b90] [c000000000025178] .vio_register_driver+0x44/0x60
[c000000042af7c20] [d000000000ed2ed4] .ibmveth_module_init+0x54/0xa60 [ibmveth]
[c000000042af7ca0] [c0000000000092c0] .do_one_initcall+0x80/0x19c
[c000000042af7d90] [c0000000000bf884] .SyS_init_module+0xe0/0x248
[c000000042af7e30] [c000000000008534] syscall_exit+0x0/0x40
Instruction dump:
7cb01120 7c862214 7c661a14 4bfffe04 409c001c 80040000 81240004 38840008
90030000 91230004 38630008 409d0014 <80040000> 38840004 90030000 38630004
---[ end trace 695e9dc0c5a9da2f ]---
udevd-event[587]: '/sbin/modprobe' abnormal exit
Unable to handle kernel paging request for data at address 0x654af306c04b990
Faulting instruction address: 0xc000000000543ce0
Oops: Kernel access of bad area, sig: 11 [#2]
SMP NR_CPUS=1024 NUMA pSeries
Modules linked in: ibmveth(+) sg sd_mod crc_t10dif ibmvscsic scsi_transport_srp scsi_tgt scsi_mod
NIP: c000000000543ce0 LR: c000000000543dcc CTR: c00000000053dd98
REGS: c0000000408b3740 TRAP: 0300 Tainted: G D (2.6.30-rc4-next-20090508)
MSR: 8000000000009032 <EE,ME,IR,DR> CR: 24042428 XER: 00000001
DAR: 0654af306c04b990, DSISR: 0000000040000000
TASK = c00000004053d880[752] 'udevd' THREAD: c0000000408b0000 CPU: 3
GPR00: c000000000543dcc c0000000408b39c0 c000000000eb8190 c0000000448e0000
GPR04: 0000000000010000 c000000000796dec 0000000000000006 0000000000000000
GPR08: c00000004265cf34 c000000000ea7250 c00000004265cf34 0000000000000000
GPR12: 0000000044042488 c000000000f92a00 0000000000000001 0000000000000001
GPR16: 00000000100372dc 00000000100374e0 00000000100376f8 0000000000000000
GPR20: 0000000010036ec8 0000000000000000 00000fffdb3a6618 0000000000000200
GPR24: 0000000000000006 0000000000000005 c0000000448f0000 c0000000448e0000
GPR28: 0654af306c04b990 0000000000000000 c000000000e45318 c0000000448e0000
NIP [c000000000543ce0] ._format_mac_addr+0x54/0xd4
LR [c000000000543dcc] .sysfs_format_mac+0x30/0x6c
Call Trace:
[c0000000408b39c0] [c00000000010c9a4] .__alloc_pages_internal+0x1b8/0x590 (unreliable)
[c0000000408b3a70] [c000000000543dcc] .sysfs_format_mac+0x30/0x6c
[c0000000408b3b00] [c00000000053dde8] .show_address+0x50/0x88
[c0000000408b3b90] [c00000000045ead4] .dev_attr_show+0x4c/0x94
[c0000000408b3c20] [c0000000001bce48] .sysfs_read_file+0x10c/0x1d0
[c0000000408b3ce0] [c00000000014c9a0] .vfs_read+0xd0/0x1bc
[c0000000408b3d80] [c00000000014cb94] .SyS_read+0x58/0xa0
[c0000000408b3e30] [c000000000008534] syscall_exit+0x0/0x40
Instruction dump:
f8010010 ebc2cc58 f821ff51 7c7b1b78 7cd83378 7cbc2b78 7f432214 7c7f1b78
3ba00000 3b26ffff 48000044 e8be8000 <88dc0000> 3b9c0001 4be0ff89 60000000
---[ end trace 695e9dc0c5a9da30 ]---
attempt to access beyond end of device
Next May 7 with same config boots fine.
Thanks
-Sachin
--
---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------
[-- Attachment #2: log --]
[-- Type: text/plain, Size: 13642 bytes --]
boot: next
Using 007ba4b8 bytes for initrd buffer
Please wait, loading kernel...
Allocated 01500000 bytes for kernel @ 02200000
Elf64 kernel loaded...
Loading ramdisk...
ramdisk loaded 007ba4b8 @ 03700000
OF stdout device is: /vdevice/vty@30000000
Preparing to boot Linux version 2.6.30-rc4-next-20090508 (root@mjs22lp5) (gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux) ) #3 SMP Fri May 8 17:04:14 IST 2009
Calling ibm,client-architecture... done
command line: root=/dev/sda3 sysrq=8
memory layout at init:
alloc_bottom : 0000000003ec0000
alloc_top : 0000000008000000
alloc_top_hi : 0000000008000000
rmo_top : 0000000008000000
ram_top : 0000000008000000
instantiating rtas at 0x0000000007630000... done
boot cpu hw idx 0000000000000000
starting cpu hw idx 0000000000000002... done
copying OF device tree...
Building dt strings...
Building dt structure...
Device tree strings 0x0000000003ed0000 -> 0x0000000003ed1585
Device tree struct 0x0000000003ee0000 -> 0x0000000003ef0000
Calling quiesce...
returning from prom_init
Phyp-dump disabled at boot time
Using pSeries machine description
Using 1TB segments
Found initrd at 0xc000000003700000:0xc000000003eba4b8
console [udbg0] enabled
Partition configured for 8 cpus.
CPU maps initialized for 2 threads per core
Starting Linux PPC64 #3 SMP Fri May 8 17:04:14 IST 2009
-----------------------------------------------------
ppc64_pft_size = 0x19
physicalMemorySize = 0x80000000
htab_hash_mask = 0x3ffff
-----------------------------------------------------
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 2.6.30-rc4-next-20090508 (root@mjs22lp5) (gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux) ) #3 SMP Fri May 8 17:04:14 IST 2009
[boot]0012 Setup Arch
EEH: No capable adapters found
PPC64 nvram contains 15360 bytes
Zone PFN ranges:
DMA 0x00000000 -> 0x00008000
Normal 0x00008000 -> 0x00008000
Movable zone start PFN for each node
early_node_map[3] active PFN ranges
1: 0x00000000 -> 0x00000800
0: 0x00000800 -> 0x00004600
1: 0x00004600 -> 0x00008000
[boot]0015 Setup Done
Built 2 zonelists in Node order, mobility grouping on. Total pages: 32726
Policy zone: DMA
Kernel command line: root=/dev/sda3 sysrq=8
Experimental hierarchical RCU implementation.
Experimental hierarchical RCU init done.
NR_IRQS:512
[boot]0020 XICS Init
[boot]0021 XICS Done
PID hash table entries: 4096 (order: 12, 32768 bytes)
clocksource: timebase mult[7d0000] shift[22] registered
Console: colour dummy device 80x25
console handover: boot [udbg0] -> real [hvc0]
allocated 1310720 bytes of page_cgroup
please try cgroup_disable=memory option if you don't want
freeing bootmem node 0
freeing bootmem node 1
Memory: 2032704k/2097152k available (13056k kernel code, 69440k reserved, 2048k data, 4268k bss, 4672k init)
Calibrating delay loop... 1022.36 BogoMIPS (lpj=5111808)
Security Framework initialized
SELinux: Disabled at boot.
Dentry cache hash table entries: 262144 (order: 5, 2097152 bytes)
Inode-cache hash table entries: 131072 (order: 4, 1048576 bytes)
Mount-cache hash table entries: 4096
Initializing cgroup subsys ns
Initializing cgroup subsys cpuacct
Initializing cgroup subsys memory
Initializing cgroup subsys devices
Initializing cgroup subsys freezer
Processor 1 found.
Processor 2 found.
Processor 3 found.
Brought up 4 CPUs
net_namespace: 1888 bytes
NET: Registered protocol family 16
IBM eBus Device Driver
PCI: Probing PCI hardware
bio: create slab <bio-0> at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Failed to register trace events module notifier
NET: Registered protocol family 2
IP route cache hash table entries: 16384 (order: 1, 131072 bytes)
TCP established hash table entries: 65536 (order: 4, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 4, 1048576 bytes)
TCP: Hash tables configured (established 65536 bind 65536)
TCP reno registered
NET: Registered protocol family 1
Unpacking initramfs...
Freeing initrd memory: 7913k freed
IOMMU table initialized, virtual merging enabled
audit: initializing netlink socket (disabled)
type=2000 audit(1241782614.530:1): initialized
HugeTLB registered 16 MB page size, pre-allocated 0 pages
HugeTLB registered 16 GB page size, pre-allocated 0 pages
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
Btrfs loaded
msgmni has been set to 3984
alg: No test for stdrng (krng)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
pci_hotplug: PCI Hot Plug PCI Core version: 0.5
rpaphp: RPA HOT Plug PCI Controller Driver version: 0.1
Generic RTC Driver v1.07
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>)
input: Macintosh mouse button emulation as /devices/virtual/input/input0
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
mice: PS/2 mouse device common for all mice
EDAC MC: Ver: 2.1.0 May 8 2009
usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
TCP cubic registered
NET: Registered protocol family 15
registered taskstats version 1
Freeing unused kernel memory: 4672k freed
doing fast boot
SysRq : Changing Loglevel
Loglevel set to 8
SCSI subsystem initialized
vio_register_driver: driver ibmvscsi registering
ibmvscsi 30000002: SRP_VERSION: 16.a
scsi0 : IBM POWER Virtual SCSI Adapter 1.5.8
ibmvscsi 30000002: partner initialization complete
ibmvscsi 30000002: sent SRP login
ibmvscsi 30000002: SRP_LOGIN succeeded
ibmvscsi 30000002: host srp version: 16.a, host partition 06-1C12A (1), OS 3, max io 262144
scsi 0:0:1:0: Direct-Access AIX VDASD 0001 PQ: 0 ANSI: 3
scsi 0:0:2:0: CD-ROM AIX VOPTA PQ: 0 ANSI: 4
Creating device nodes with udev
udevd version 128 started
Driver 'sd' needs updating - please use bus_type methods
sd 0:0:1:0: [sda] 33554432 512-byte hardware sectors: (17.1 GB/16.0 GiB)
sd 0:0:1:0: [sda] Write Protect is off
sd 0:0:1:0: [sda] Mode Sense: 17 00 00 08
sd 0:0:1:0: [sda] Cache data unavailable
sd 0:0:1:0: [sda] Assuming drive cache: write through
sd 0:0:1:0: [sda] Cache data unavailable
sd 0:0:1:0: [sda] Assuming drive cache: write through
sda: sda1 sda2 sda3
sd 0:0:1:0: [sda] Attached SCSI disk
Boot logging started on /dev/hvc0(/dev/console) at Fri May 8 11:36:54 2009
Waiting for device /dev/sda3 to appear: ok
showconsole: Warning: the ioctl TIOCGDEV is not known by the kernel
fsck 1.41.1 (01-Sep-2008)
[/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a /dev/sda3
/dev/sda3: clean, 263693/983040 files, 2840945/3929888 blocks
fsck succeeded. Mounting root device read-write.
Mounting root /dev/sda3
mount -o rw,acl,user_xattr -t ext3 /dev/sda3 /root
kjournald starting. Commit interval 5 seconds
EXT3 FS on sda3, internal journal
EXT3-fs: mounted filesystem with writeback data mode.
mount: can't find /root/proc in /etc/fstab or /etc/mtab
INIT: version 2.86 booting
System Boot Control: Running /etc/init.d/boot
Mounting procfs at /proc done
Mounting sysfs at /sys done
Mounting debugfs at /sys/kernel/debug done
Remounting tmpfs at /dev done
Initializing /dev done
Mounting devpts at /dev/pts done
Starting udevd: udevd version 128 started
done
Loading drivers, configuring devices: sd 0:0:1:0: Attached scsi generic sg0 type 0
scsi 0:0:2:0: Attached scsi generic sg1 type 5
drivers/net/ibmveth.c: ibmveth: IBM i/pSeries Virtual Ethernet Driver 1.03
vio_register_driver: driver ibmveth registering
Unable to handle kernel paging request for data at address 0x654af306c04b990
Faulting instruction address: 0xc00000000003a740
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=1024 NUMA pSeries
Modules linked in: ibmveth(+) sg sd_mod crc_t10dif ibmvscsic scsi_transport_srp scsi_tgt scsi_mod
NIP: c00000000003a740 LR: c000000000361e20 CTR: 0000000000000000
REGS: c000000042af6e80 TRAP: 0300 Not tainted (2.6.30-rc4-next-20090508)
MSR: 8000000000009032 <EE,ME,IR,DR> CR: 28222286 XER: 20000001
DAR: 0654af306c04b990, DSISR: 0000000040000000
TASK = c0000000428084d0[590] 'modprobe' THREAD: c000000042af4000 CPU: 0
GPR00: c000000000361e10 c000000042af7100 c000000000eb8190 c00000004427cc80
GPR04: 0654af306c04b990 0000000000000006 0000000000000000 0000000000000002
GPR08: c00000004427cc00 0000000000000088 0000000000000280 000000000000007c
GPR12: 0000000084222284 c000000000f92400 0000000000000000 0000000000000000
GPR16: 0000000000000000 0000000000000000 d000000000ed4346 d000000000ed3aa0
GPR20: d000000000ed6358 c00000004427cc00 00000000ffffffff 0000000000000000
GPR24: 0000000000000000 c0000000402d0000 0000000000000010 c00000004194b400
GPR28: 0000000000000006 0654af306c04b990 c000000000e44f18 0000000000000000
NIP [c00000000003a740] .memcpy+0x240/0x278
LR [c000000000361e20] .__nla_put+0x30/0x4c
Call Trace:
[c000000042af7100] [c000000000361e10] .__nla_put+0x20/0x4c (unreliable)
[c000000042af7190] [c000000000361e88] .nla_put+0x4c/0x60
[c000000042af7200] [c00000000053993c] .rtnl_fill_ifinfo+0x308/0x614
[c000000042af7300] [c00000000053a118] .rtmsg_ifinfo+0x104/0x198
[c000000042af73b0] [c00000000053a244] .rtnetlink_event+0x98/0xb0
[c000000042af7430] [c0000000005c8330] .notifier_call_chain+0x68/0xdc
[c000000042af74d0] [c000000000530488] .register_netdevice+0x390/0x418
[c000000042af75a0] [c000000000530568] .register_netdev+0x58/0x80
[c000000042af7630] [d000000000ed2da4] .ibmveth_probe+0x2c8/0x3a4 [ibmveth]
[c000000042af7730] [c000000000023208] .vio_bus_probe+0x2f0/0x358
[c000000042af77f0] [c000000000462be0] .driver_probe_device+0xd4/0x1bc
[c000000042af7890] [c000000000462d5c] .__driver_attach+0x94/0xd8
[c000000042af7920] [c000000000462164] .bus_for_each_dev+0x80/0xe8
[c000000042af79d0] [c0000000004629b0] .driver_attach+0x28/0x40
[c000000042af7a50] [c000000000461808] .bus_add_driver+0xdc/0x27c
[c000000042af7af0] [c0000000004631d0] .driver_register+0xf0/0x1b0
[c000000042af7b90] [c000000000025178] .vio_register_driver+0x44/0x60
[c000000042af7c20] [d000000000ed2ed4] .ibmveth_module_init+0x54/0xa60 [ibmveth]
[c000000042af7ca0] [c0000000000092c0] .do_one_initcall+0x80/0x19c
[c000000042af7d90] [c0000000000bf884] .SyS_init_module+0xe0/0x248
[c000000042af7e30] [c000000000008534] syscall_exit+0x0/0x40
Instruction dump:
7cb01120 7c862214 7c661a14 4bfffe04 409c001c 80040000 81240004 38840008
90030000 91230004 38630008 409d0014 <80040000> 38840004 90030000 38630004
---[ end trace 695e9dc0c5a9da2f ]---
udevd-event[587]: '/sbin/modprobe' abnormal exit
Unable to handle kernel paging request for data at address 0x654af306c04b990
Faulting instruction address: 0xc000000000543ce0
Oops: Kernel access of bad area, sig: 11 [#2]
SMP NR_CPUS=1024 NUMA pSeries
Modules linked in: ibmveth(+) sg sd_mod crc_t10dif ibmvscsic scsi_transport_srp scsi_tgt scsi_mod
NIP: c000000000543ce0 LR: c000000000543dcc CTR: c00000000053dd98
REGS: c0000000408b3740 TRAP: 0300 Tainted: G D (2.6.30-rc4-next-20090508)
MSR: 8000000000009032 <EE,ME,IR,DR> CR: 24042428 XER: 00000001
DAR: 0654af306c04b990, DSISR: 0000000040000000
TASK = c00000004053d880[752] 'udevd' THREAD: c0000000408b0000 CPU: 3
GPR00: c000000000543dcc c0000000408b39c0 c000000000eb8190 c0000000448e0000
GPR04: 0000000000010000 c000000000796dec 0000000000000006 0000000000000000
GPR08: c00000004265cf34 c000000000ea7250 c00000004265cf34 0000000000000000
GPR12: 0000000044042488 c000000000f92a00 0000000000000001 0000000000000001
GPR16: 00000000100372dc 00000000100374e0 00000000100376f8 0000000000000000
GPR20: 0000000010036ec8 0000000000000000 00000fffdb3a6618 0000000000000200
GPR24: 0000000000000006 0000000000000005 c0000000448f0000 c0000000448e0000
GPR28: 0654af306c04b990 0000000000000000 c000000000e45318 c0000000448e0000
NIP [c000000000543ce0] ._format_mac_addr+0x54/0xd4
LR [c000000000543dcc] .sysfs_format_mac+0x30/0x6c
Call Trace:
[c0000000408b39c0] [c00000000010c9a4] .__alloc_pages_internal+0x1b8/0x590 (unreliable)
[c0000000408b3a70] [c000000000543dcc] .sysfs_format_mac+0x30/0x6c
[c0000000408b3b00] [c00000000053dde8] .show_address+0x50/0x88
[c0000000408b3b90] [c00000000045ead4] .dev_attr_show+0x4c/0x94
[c0000000408b3c20] [c0000000001bce48] .sysfs_read_file+0x10c/0x1d0
[c0000000408b3ce0] [c00000000014c9a0] .vfs_read+0xd0/0x1bc
[c0000000408b3d80] [c00000000014cb94] .SyS_read+0x58/0xa0
[c0000000408b3e30] [c000000000008534] syscall_exit+0x0/0x40
Instruction dump:
f8010010 ebc2cc58 f821ff51 7c7b1b78 7cd83378 7cbc2b78 7f432214 7c7f1b78
3ba00000 3b26ffff 48000044 e8be8000 <88dc0000> 3b9c0001 4be0ff89 60000000
---[ end trace 695e9dc0c5a9da30 ]---
attempt to access beyond end of device
sda3: rw=0, want=31439208, limit=31439205
IBM eHEA ethernet device driver (Release EHEA_0101)
irq: irq 590080 on host null mapped to virtual irq 256
Driver 'sr' needs updating - please use bus_type methods
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.20
sr 0:0:2:0: Attached scsi CD-ROM sr0
^ permalink raw reply
* [PATCH] mpc5121/clocks: make debug output more readable
From: Wolfram Sang @ 2009-05-08 12:34 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1355 bytes --]
- Drop KERN_ levels for printks which print to the same line
- use '=' in output to connect key/value pairs
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: John Rigby <jcrigby@gmail.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/platforms/512x/clock.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
Index: .kernel/arch/powerpc/platforms/512x/clock.c
===================================================================
--- .kernel.orig/arch/powerpc/platforms/512x/clock.c
+++ .kernel/arch/powerpc/platforms/512x/clock.c
@@ -83,12 +83,11 @@ static void dump_clocks(void)
mutex_lock(&clocks_mutex);
printk(KERN_INFO "CLOCKS:\n");
list_for_each_entry(p, &clocks, node) {
- printk(KERN_INFO " %s %ld", p->name, p->rate);
+ printk(KERN_INFO " %s=%ld", p->name, p->rate);
if (p->parent)
- printk(KERN_INFO " %s %ld", p->parent->name,
- p->parent->rate);
+ printk(" %s=%ld", p->parent->name, p->parent->rate);
if (p->flags & CLK_HAS_CTRL)
- printk(KERN_INFO " reg/bit %d/%d", p->reg, p->bit);
+ printk(" reg/bit=%d/%d", p->reg, p->bit);
printk("\n");
}
mutex_unlock(&clocks_mutex);
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH 0/5] rapidio: adding memory mapping IO support and misc fixes
From: Jan Neskudla @ 2009-05-08 11:39 UTC (permalink / raw)
To: ext Gerhard Jaeger; +Cc: linuxppc-dev
In-Reply-To: <200905081228.10955.g.jaeger@sysgo.com>
Hi Gerhard,
Yes I am sure, I know I chosen a different board than I use. I wanted to
show that this compilation problem is not influenced by our e500
patches. So I did the test on the pristine 2.6.29.1 kernel without any
external patches applied, and the problem is exactly the same when the
rionet is compiled for E500 with our patches.
And anyway the dma_client structure is defined in the 2.6.28, but not in
the 2.6.29, so it looks to me that a rionet dma support is written for
older kernel.
Here is the Linus tree and async_tx tree merge tree months ago
and info is:
dmaengine: kill struct dma_client and supporting infrastructure
http://git.kernel.org/?
p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d9e8a3a5b8298a3c814ed37ac5756e6f67b6be41
Jan
On Fri, 2009-05-08 at 12:28 +0200, ext Gerhard Jaeger wrote:
> Hi Jan,
>
> On Friday 08 May 2009 12:06:35 Jan Neskudla wrote:
> [SNIPSNAP]
> > Important CONFIG options are:
> > PPC_86xx=y
> > HPC8641_HPCN=y
>
> you're using a e500 board (EP8548A), but the options above
> will be used when building a kernel for a e600 machine (MPC8641).
> Are you sure that is okay?
>
> - Gerhard
^ permalink raw reply
* Re: [PATCH 0/5] rapidio: adding memory mapping IO support and misc fixes
From: Gerhard Jaeger @ 2009-05-08 10:28 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Jan Neskudla
In-Reply-To: <1241777196.16400.25.camel@demuxf9c>
Hi Jan,
On Friday 08 May 2009 12:06:35 Jan Neskudla wrote:
[SNIPSNAP]
> Important CONFIG options are:
> PPC_86xx=y
> HPC8641_HPCN=y
you're using a e500 board (EP8548A), but the options above
will be used when building a kernel for a e600 machine (MPC8641).
Are you sure that is okay?
- Gerhard
--
Gerhard Jaeger <gjaeger@sysgo.com>
SYSGO AG Embedding Innovations
www.sysgo.com | www.elinos.com | www.pikeos.com | www.osek.de
^ permalink raw reply
* Re: [PATCH 0/5] rapidio: adding memory mapping IO support and misc fixes
From: Jan Neskudla @ 2009-05-08 10:06 UTC (permalink / raw)
To: ext Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <AF270294-0B90-4935-9D4A-F17EB7811CE2@kernel.crashing.org>
On Thu, 2009-05-07 at 10:21 -0500, ext Kumar Gala wrote:
> On May 7, 2009, at 9:10 AM, Jan Neskudla wrote:
>
> > And one more think, when I enabled usage of DMA, rionet does not
> > compile too,
> > but in this case I do not have a fix. I tested this on kernel
> > 2.6.29.1 and
> > EP8548 as target board.
>
> What exactly do you mean by that? What CONFIG options cause compile
> failure? Can you post the compiler error.
>
> - k
The problem is with the missing stucture dma_client in the kernel tree
sources. It looks to me that a dma model changed after 2.6
.28. Here are the details.
I used a pristine kernel 2.6.29 + patch 2.6.29.1 than Leo's patches in
this order.
rio-warn_unused_result-warnings-fix.patch
rionet-add-memory-access-to-simulated-Ethernet-over-rapidio.patch
powerpc-add-memory-map-support-to-Freescale-RapioIO-block.patch
powerpc-fsl_rio-use-LAW-address-from-device-tree.patch
rapidio-add-common-mapping-APIs-for-RapidIO-memory-access.patch
Important CONFIG options are:
PPC_86xx=y
HPC8641_HPCN=y
RAPIDIO=y
DMADEVICES=y
FSL_DMA=y !!
NETDEVICES=y
RIONET=y/m
RIONET_MEMMAP=y
RIONET_DMA=y !!
And the error during compilation:
CC drivers/net/rionet.o
drivers/net/rionet.c:110: error: field `rio_dma_client' has incomplete
type
drivers/net/rionet.c: In function `rio_send_mem':
drivers/net/rionet.c:239: error: parse error before "rnet"
drivers/net/rionet.c: At top level:
drivers/net/rionet.c:514: warning: "enum dma_state" declared inside
parameter list
drivers/net/rionet.c:514: warning: its scope is only this definition or
declaration, which is probably not what you want
drivers/net/rionet.c:515: error: parameter `state' has incomplete type
drivers/net/rionet.c:515: error: return type is an incomplete type
drivers/net/rionet.c: In function `rionet_dma_event':
drivers/net/rionet.c:516: warning: type defaults to `int' in declaration
of `__mptr'
drivers/net/rionet.c:516: warning: initialization from incompatible
pointer type
drivers/net/rionet.c:518: error: variable `ack' has initializer but
incomplete type
drivers/net/rionet.c:518: error: `DMA_DUP' undeclared (first use in this
function)
drivers/net/rionet.c:518: error: (Each undeclared identifier is reported
only once
drivers/net/rionet.c:518: error: for each function it appears in.)
drivers/net/rionet.c:518: error: storage size of 'ack' isn't known
drivers/net/rionet.c:522: error: `DMA_RESOURCE_AVAILABLE' undeclared
(first use in this function)
drivers/net/rionet.c:524: error: `DMA_ACK' undeclared (first use in this
function)
drivers/net/rionet.c:531: error: `DMA_RESOURCE_REMOVED' undeclared
(first use in this function)
drivers/net/rionet.c:544: warning: `return' with a value, in function
returning void
drivers/net/rionet.c:518: warning: unused variable `ack'
drivers/net/rionet.c: In function `rionet_dma_register':
drivers/net/rionet.c:553: error: implicit declaration of function
`dma_async_client_register'
drivers/net/rionet.c:554: error: implicit declaration of function
`dma_async_client_chan_request'
drivers/net/rionet.c: In function `rionet_close':
drivers/net/rionet.c:731: error: implicit declaration of function
`dma_async_client_unregister'
make[2]: *** [drivers/net/rionet.o] Error 1
Jan
^ permalink raw reply
* Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
From: David Miller @ 2009-05-08 7:52 UTC (permalink / raw)
To: jcrigby; +Cc: linuxppc-dev, kosmo, wd, dzu, netdev
In-Reply-To: <4b73d43f0905071902y3b51d36ct2a04c560b5acdfb9@mail.gmail.com>
From: John Rigby <jcrigby@gmail.com>
Date: Thu, 7 May 2009 20:02:53 -0600
> Also don't forget that the register map is the same on 512x, mx and
> coldfire platforms but not on the other ppc platforms so if you want
> to one binary to rule them all you will need to have an offest table
> or some such.
I would suggest using ->read_reg() ->write_reg() methods for abstracting
this. That's how we handle all of the different way ESP scsi chips
have their registers wired up.
I/O register reads take hundreds, if not thousands of CPU cycles so,
relatively speaking, the indirection costs absolutely nothing.
^ permalink raw reply
* Re: [PATCH] Fix wrong register read address and add interrupt acknowledge.
From: Benjamin Krill @ 2009-05-08 7:50 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev, Timur Tabi, arnd, linux-serial
In-Reply-To: <20090505230919.GE14017@zod.rchland.ibm.com>
* Josh Boyer | 2009-05-05 19:09:19 [-0400]:
>On Tue, May 05, 2009 at 02:24:04PM -0500, Timur Tabi wrote:
>>On Tue, May 5, 2009 at 2:11 PM, Benjamin Krill <ben@codiert.org> wrote:
>
>That is quite true. Although resending the patch just for that seems overkill.
>The maintainer can edit the summary rather easily.
Ben, could you please merge this patch in your next tree?
cheers
ben
^ permalink raw reply
* Re: [PATCH] 83xx: add support for the kmeter1 board.
From: Heiko Schocher @ 2009-05-08 5:44 UTC (permalink / raw)
To: Varlese, Christopher; +Cc: linuxppc-dev
In-Reply-To: <D839955AA28B9A42A61B9181506E27C40182F50E@SRVCHBER1212.ch.keymile.net>
Hello Christopher,
Varlese, Christopher wrote:
> (FYI I working on the kmeter1)
>
> kmeter1.c reuses the same QE_ENET10 RGMII errata workaround code from mpc836x_mds.c (MPC8360EMDS eval board).
>
> In my view errata nodes in the dts is overkill. Maybe the errata code can go into a reusable function somewhere in 83xx/ or in ucc_geth.c?
To put an errata node in the dts was just an idea ;-)
I also mentioned putting this code in the ucc_geth.c driver ...
> I also think the original errata code needs improving:
> - mask some SVR bits so activated for all matching CPU models, e.g. MPC8360 & MPC8360E.
Did a first try in my v2 patch, see:
http://ozlabs.org/pipermail/linuxppc-dev/2009-April/071384.html
but I got no response yet.
> - The code in mpc836x_mds.c and kmeter1.c does not do exactly what Freescale errata says!
:-(
> Here the errata document:
> http://www.freescale.com/files/32bit/doc/errata/MPC8360ECE.pdf
>
> Because kmeter1 is using an MPC8360 CPU model the workaround doesn't actually trigger. So to kill 2 birds with 1 stone we tested a Uboot patch (below) doing what QE_ENET10 says. It seemed to work fine for us.
> /* RGMII timing Errata workaround for rev 2.1 silicon
> * (ref: MPC8360ECE rev.1 12/2007 QE_ENET10 UCC2 option 1)
> */
> void *reg = (void *)(CONFIG_SYS_IMMR + 0x14ac);
> clrsetbits_be32 (reg, 0x000000F0, 0x000000A0);
>
>>From my point of view:
> - The workaround code in kmeter1.c could go for now.
> - An improved errata workaround for 836x boards would be nice (..who is motivated? :-))
I can make this errata, if someone gives advice, where to put ...
I vote for putting it into the ucc_geth.c driver, and activating it
maybe through the "phy-connection-type" if it activates the rgmii
mode ... ?
bye
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply
* Re: [PATCH 06/12] mpc5121: Added NAND Flash Controller driver.
From: John Rigby @ 2009-05-08 3:30 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: linuxppc-dev, linux-mtd, Piotr Ziecik
In-Reply-To: <1241640919-4650-7-git-send-email-wd@denx.de>
[-- Attachment #1: Type: text/plain, Size: 35686 bytes --]
Did you choose to not support hardware ECC so you could use the spare area?
The original driver only supported hardware ECC but unfortuneatly the
hardware ECC includes the spare area so the spare area cannot be written
separately.
On Wed, May 6, 2009 at 2:15 PM, Wolfgang Denk <wd@denx.de> wrote:
> From: Piotr Ziecik <kosmo@semihalf.com>
>
> This patch adds NAND Flash Controller driver for MPC5121
> revision 2. All device features, except hardware ECC and
> power management, are supported.
>
> Signed-off-by: Piotr Ziecik <kosmo@semihalf.com>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: <linux-mtd@lists.infradead.org>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: John Rigby <jcrigby@gmail.com>
> ---
> arch/powerpc/include/asm/mpc5121_nfc.h | 100 +++
> arch/powerpc/platforms/512x/mpc512x_shared.c | 1 +
> drivers/mtd/nand/Kconfig | 7 +
> drivers/mtd/nand/Makefile | 1 +
> drivers/mtd/nand/mpc5121_nfc.c | 855
> ++++++++++++++++++++++++++
> 5 files changed, 964 insertions(+), 0 deletions(-)
> create mode 100644 arch/powerpc/include/asm/mpc5121_nfc.h
> create mode 100644 drivers/mtd/nand/mpc5121_nfc.c
>
> diff --git a/arch/powerpc/include/asm/mpc5121_nfc.h
> b/arch/powerpc/include/asm/mpc5121_nfc.h
> new file mode 100644
> index 0000000..b96a5b9
> --- /dev/null
> +++ b/arch/powerpc/include/asm/mpc5121_nfc.h
> @@ -0,0 +1,100 @@
> +/*
> + * Copyright 2004-2008 Freescale Semiconductor, Inc.
> + * Copyright 2009 Semihalf.
> + *
> + * Approved as OSADL project by a majority of OSADL members and funded
> + * by OSADL membership fees in 2009; for details see www.osadl.org.
> + *
> + * Based on original driver from Freescale Semiconductor
> + * written by John Rigby <jrigby@freescale.com> on basis
> + * of drivers/mtd/nand/mxc_nand.c. Reworked and extended by
> + * Piotr Ziecik <kosmo@semihalf.com>.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
> + * MA 02110-1301, USA.
> + */
> +
> +#ifndef MPC5121_NFC_H
> +#define MPC5121_NFC_H
> +
> +/* Addresses for NFC MAIN RAM BUFFER areas */
> +#define NFC_MAIN_AREA(n) ((n) * 0x200)
> +
> +/* Addresses for NFC SPARE BUFFER areas */
> +#define NFC_SPARE_BUFFERS 8
> +#define NFC_SPARE_LEN 0x40
> +#define NFC_SPARE_AREA(n) (0x1000 + ((n) * NFC_SPARE_LEN))
> +
> +/* MPC5121 NFC registers */
> +#define NFC_BUF_ADDR 0x1E04
> +#define NFC_FLASH_ADDR 0x1E06
> +#define NFC_FLASH_CMD 0x1E08
> +#define NFC_CONFIG 0x1E0A
> +#define NFC_ECC_STATUS1 0x1E0C
> +#define NFC_ECC_STATUS2 0x1E0E
> +#define NFC_SPAS 0x1E10
> +#define NFC_WRPROT 0x1E12
> +#define NFC_NF_WRPRST 0x1E18
> +#define NFC_CONFIG1 0x1E1A
> +#define NFC_CONFIG2 0x1E1C
> +#define NFC_UNLOCKSTART_BLK0 0x1E20
> +#define NFC_UNLOCKEND_BLK0 0x1E22
> +#define NFC_UNLOCKSTART_BLK1 0x1E24
> +#define NFC_UNLOCKEND_BLK1 0x1E26
> +#define NFC_UNLOCKSTART_BLK2 0x1E28
> +#define NFC_UNLOCKEND_BLK2 0x1E2A
> +#define NFC_UNLOCKSTART_BLK3 0x1E2C
> +#define NFC_UNLOCKEND_BLK3 0x1E2E
> +
> +/* Bit Definitions: NFC_BUF_ADDR */
> +#define NFC_RBA_MASK (7 << 0)
> +#define NFC_ACTIVE_CS_SHIFT 5
> +#define NFC_ACTIVE_CS_MASK (3 << NFC_ACTIVE_CS_SHIFT)
> +
> +/* Bit Definitions: NFC_CONFIG */
> +#define NFC_BLS_UNLOCKED (1 << 1)
> +
> +/* Bit Definitions: NFC_CONFIG1 */
> +#define NFC_ECC_4BIT (1 << 0)
> +#define NFC_FULL_PAGE_DMA (1 << 1)
> +#define NFC_SPARE_ONLY (1 << 2)
> +#define NFC_ECC_ENABLE (1 << 3)
> +#define NFC_INT_MASK (1 << 4)
> +#define NFC_BIG_ENDIAN (1 << 5)
> +#define NFC_RESET (1 << 6)
> +#define NFC_CE (1 << 7)
> +#define NFC_ONE_CYCLE (1 << 8)
> +#define NFC_PPB_32 (0 << 9)
> +#define NFC_PPB_64 (1 << 9)
> +#define NFC_PPB_128 (2 << 9)
> +#define NFC_PPB_256 (3 << 9)
> +#define NFC_PPB_MASK (3 << 9)
> +#define NFC_FULL_PAGE_INT (1 << 11)
> +
> +/* Bit Definitions: NFC_CONFIG2 */
> +#define NFC_COMMAND (1 << 0)
> +#define NFC_ADDRESS (1 << 1)
> +#define NFC_INPUT (1 << 2)
> +#define NFC_OUTPUT (1 << 3)
> +#define NFC_ID (1 << 4)
> +#define NFC_STATUS (1 << 5)
> +#define NFC_CMD_FAIL (1 << 15)
> +#define NFC_INT (1 << 15)
> +
> +/* Bit Definitions: NFC_WRPROT */
> +#define NFC_WPC_LOCK_TIGHT (1 << 0)
> +#define NFC_WPC_LOCK (1 << 1)
> +#define NFC_WPC_UNLOCK (1 << 2)
> +
> +#endif /* MPC5121_NFC_H */
> diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c
> b/arch/powerpc/platforms/512x/mpc512x_shared.c
> index d8cd579..7135d89 100644
> --- a/arch/powerpc/platforms/512x/mpc512x_shared.c
> +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
> @@ -71,6 +71,7 @@ void __init mpc512x_init_IRQ(void)
> static struct of_device_id __initdata of_bus_ids[] = {
> { .compatible = "fsl,mpc5121-immr", },
> { .compatible = "fsl,mpc5121-localbus", },
> + { .compatible = "fsl,mpc5121-nfc", },
> {},
> };
>
> diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
> index 890936d..fb0d1c4 100644
> --- a/drivers/mtd/nand/Kconfig
> +++ b/drivers/mtd/nand/Kconfig
> @@ -413,6 +413,13 @@ config MTD_NAND_FSL_UPM
> Enables support for NAND Flash chips wired onto Freescale PowerPC
> processor localbus with User-Programmable Machine support.
>
> +config MTD_NAND_MPC5121_NFC
> + tristate "MPC5121 built-in NAND Flash Controller support"
> + depends on PPC_MPC512x
> + help
> + This enables the driver for the NAND flash controller on the
> + MPC5121 SoC.
> +
> config MTD_NAND_MXC
> tristate "MXC NAND support"
> depends on ARCH_MX2 || ARCH_MX3
> diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
> index d33860a..563e812 100644
> --- a/drivers/mtd/nand/Makefile
> +++ b/drivers/mtd/nand/Makefile
> @@ -39,5 +39,6 @@ obj-$(CONFIG_MTD_NAND_SH_FLCTL) +=
> sh_flctl.o
> obj-$(CONFIG_MTD_NAND_MXC) += mxc_nand.o
> obj-$(CONFIG_MTD_NAND_SOCRATES) += socrates_nand.o
> obj-$(CONFIG_MTD_NAND_TXX9NDFMC) += txx9ndfmc.o
> +obj-$(CONFIG_MTD_NAND_MPC5121_NFC) += mpc5121_nfc.o
>
> nand-objs := nand_base.o nand_bbt.o
> diff --git a/drivers/mtd/nand/mpc5121_nfc.c
> b/drivers/mtd/nand/mpc5121_nfc.c
> new file mode 100644
> index 0000000..a8da4db
> --- /dev/null
> +++ b/drivers/mtd/nand/mpc5121_nfc.c
> @@ -0,0 +1,855 @@
> +/*
> + * Copyright 2004-2008 Freescale Semiconductor, Inc.
> + * Copyright 2009 Semihalf.
> + *
> + * Based on original driver from Freescale Semiconductor
> + * written by John Rigby <jrigby@freescale.com> on basis
> + * of drivers/mtd/nand/mxc_nand.c. Reworked and extended
> + * Piotr Ziecik <kosmo@semihalf.com>.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
> + * MA 02110-1301, USA.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/clk.h>
> +#include <linux/delay.h>
> +#include <linux/init.h>
> +#include <linux/interrupt.h>
> +#include <linux/io.h>
> +#include <linux/mtd/mtd.h>
> +#include <linux/mtd/nand.h>
> +#include <linux/mtd/partitions.h>
> +#include <linux/of_device.h>
> +#include <linux/of_platform.h>
> +
> +#include <asm/mpc512x.h>
> +#include <asm/mpc5121_nfc.h>
> +
> +#define DRV_NAME "mpc5121_nfc"
> +#define DRV_VERSION "0.5"
> +
> +/* Timeouts */
> +#define NFC_RESET_TIMEOUT 1000 /* 1 ms */
> +#define NFC_TIMEOUT (HZ / 10) /* 1/10 s */
> +
> +struct mpc5121_nfc_prv {
> + struct mtd_info mtd;
> + struct nand_chip chip;
> + int irq;
> + void __iomem *regs;
> + struct clk *clk;
> + wait_queue_head_t irq_waitq;
> + uint column;
> + int spareonly;
> + void __iomem *csreg;
> +};
> +
> +static void mpc5121_nfc_done(struct mtd_info *mtd);
> +
> +#ifdef CONFIG_MTD_PARTITIONS
> +static const char *mpc5121_nfc_pprobes[] = { "cmdlinepart", NULL };
> +#endif
> +
> +/* Read NFC register */
> +static inline u16 nfc_read(struct mtd_info *mtd, uint reg)
> +{
> + struct nand_chip *chip = mtd->priv;
> + struct mpc5121_nfc_prv *prv = chip->priv;
> +
> + return in_be16(prv->regs + reg);
> +}
> +
> +/* Write NFC register */
> +static inline void nfc_write(struct mtd_info *mtd, uint reg, u16 val)
> +{
> + struct nand_chip *chip = mtd->priv;
> + struct mpc5121_nfc_prv *prv = chip->priv;
> +
> + out_be16(prv->regs + reg, val);
> +}
> +
> +/* Set bits in NFC register */
> +static inline void nfc_set(struct mtd_info *mtd, uint reg, u16 bits)
> +{
> + nfc_write(mtd, reg, nfc_read(mtd, reg) | bits);
> +}
> +
> +/* Clear bits in NFC register */
> +static inline void nfc_clear(struct mtd_info *mtd, uint reg, u16 bits)
> +{
> + nfc_write(mtd, reg, nfc_read(mtd, reg) & ~bits);
> +}
> +
> +/* Invoke address cycle */
> +static inline void mpc5121_nfc_send_addr(struct mtd_info *mtd, u16 addr)
> +{
> + nfc_write(mtd, NFC_FLASH_ADDR, addr);
> + nfc_write(mtd, NFC_CONFIG2, NFC_ADDRESS);
> + mpc5121_nfc_done(mtd);
> +}
> +
> +/* Invoke command cycle */
> +static inline void mpc5121_nfc_send_cmd(struct mtd_info *mtd, u16 cmd)
> +{
> + nfc_write(mtd, NFC_FLASH_CMD, cmd);
> + nfc_write(mtd, NFC_CONFIG2, NFC_COMMAND);
> + mpc5121_nfc_done(mtd);
> +}
> +
> +/* Send data from NFC buffers to NAND flash */
> +static inline void mpc5121_nfc_send_prog_page(struct mtd_info *mtd)
> +{
> + nfc_clear(mtd, NFC_BUF_ADDR, NFC_RBA_MASK);
> + nfc_write(mtd, NFC_CONFIG2, NFC_INPUT);
> + mpc5121_nfc_done(mtd);
> +}
> +
> +/* Receive data from NAND flash */
> +static inline void mpc5121_nfc_send_read_page(struct mtd_info *mtd)
> +{
> + nfc_clear(mtd, NFC_BUF_ADDR, NFC_RBA_MASK);
> + nfc_write(mtd, NFC_CONFIG2, NFC_OUTPUT);
> + mpc5121_nfc_done(mtd);
> +}
> +
> +/* Receive ID from NAND flash */
> +static inline void mpc5121_nfc_send_read_id(struct mtd_info *mtd)
> +{
> + nfc_clear(mtd, NFC_BUF_ADDR, NFC_RBA_MASK);
> + nfc_write(mtd, NFC_CONFIG2, NFC_ID);
> + mpc5121_nfc_done(mtd);
> +}
> +
> +/* Receive status from NAND flash */
> +static inline void mpc5121_nfc_send_read_status(struct mtd_info *mtd)
> +{
> + nfc_clear(mtd, NFC_BUF_ADDR, NFC_RBA_MASK);
> + nfc_write(mtd, NFC_CONFIG2, NFC_STATUS);
> + mpc5121_nfc_done(mtd);
> +}
> +
> +/* NFC interrupt handler */
> +static irqreturn_t mpc5121_nfc_irq(int irq, void *data)
> +{
> + struct mtd_info *mtd = data;
> + struct nand_chip *chip = mtd->priv;
> + struct mpc5121_nfc_prv *prv = chip->priv;
> +
> + nfc_set(mtd, NFC_CONFIG1, NFC_INT_MASK);
> + wake_up(&prv->irq_waitq);
> +
> + return IRQ_HANDLED;
> +}
> +
> +/* Wait for operation complete */
> +static void mpc5121_nfc_done(struct mtd_info *mtd)
> +{
> + struct nand_chip *chip = mtd->priv;
> + struct mpc5121_nfc_prv *prv = chip->priv;
> + int rv;
> +
> + if ((nfc_read(mtd, NFC_CONFIG2) & NFC_INT) == 0) {
> + nfc_clear(mtd, NFC_CONFIG1, NFC_INT_MASK);
> + rv = wait_event_timeout(prv->irq_waitq,
> + (nfc_read(mtd, NFC_CONFIG2) & NFC_INT),
> NFC_TIMEOUT);
> +
> + if (!rv)
> + printk(KERN_WARNING DRV_NAME
> + ": Timeout while waiting for
> interrupt.\n");
> + }
> +
> + nfc_clear(mtd, NFC_CONFIG2, NFC_INT);
> +}
> +
> +/* Do address cycle(s) */
> +static void mpc5121_nfc_addr_cycle(struct mtd_info *mtd, int column, int
> page)
> +{
> + struct nand_chip *chip = mtd->priv;
> + u32 pagemask = chip->pagemask;
> +
> + if (column != -1) {
> + mpc5121_nfc_send_addr(mtd, column);
> + if (mtd->writesize > 512)
> + mpc5121_nfc_send_addr(mtd, column >> 8);
> + }
> +
> + if (page != -1) {
> + do {
> + mpc5121_nfc_send_addr(mtd, page & 0xFF);
> + page >>= 8;
> + pagemask >>= 8;
> + } while (pagemask);
> + }
> +}
> +
> +/* Control chip select signals */
> +static void mpc5121_nfc_select_chip(struct mtd_info *mtd, int chip)
> +{
> + if (chip < 0) {
> + nfc_clear(mtd, NFC_CONFIG1, NFC_CE);
> + return;
> + }
> +
> + nfc_clear(mtd, NFC_BUF_ADDR, NFC_ACTIVE_CS_MASK);
> + nfc_set(mtd, NFC_BUF_ADDR, (chip << NFC_ACTIVE_CS_SHIFT) &
> +
> NFC_ACTIVE_CS_MASK);
> + nfc_set(mtd, NFC_CONFIG1, NFC_CE);
> +}
> +
> +/* Init external chip select logic on ADS5121 board */
> +static int ads5121_chipselect_init(struct mtd_info *mtd)
> +{
> + struct nand_chip *chip = mtd->priv;
> + struct mpc5121_nfc_prv *prv = chip->priv;
> + struct device_node *dn;
> +
> + dn = of_find_compatible_node(NULL, NULL, "fsl,mpc5121ads-cpld");
> + if (dn) {
> + prv->csreg = of_iomap(dn, 0);
> + of_node_put(dn);
> + if (!prv->csreg)
> + return -ENOMEM;
> +
> + /* CPLD Register 9 controls NAND /CE Lines */
> + prv->csreg += 9;
> + return 0;
> + }
> +
> + return -EINVAL;
> +}
> +
> +/* Control chips select signal on ADS5121 board */
> +static void ads5121_select_chip(struct mtd_info *mtd, int chip)
> +{
> + struct nand_chip *nand = mtd->priv;
> + struct mpc5121_nfc_prv *prv = nand->priv;
> + u8 v;
> +
> + v = in_8(prv->csreg);
> + v |= 0x0F;
> +
> + if (chip >= 0) {
> + mpc5121_nfc_select_chip(mtd, 0);
> + v &= ~(1 << chip);
> + } else
> + mpc5121_nfc_select_chip(mtd, -1);
> +
> + out_8(prv->csreg, v);
> +}
> +
> +/* Read NAND Ready/Busy signal */
> +static int mpc5121_nfc_dev_ready(struct mtd_info *mtd)
> +{
> + /*
> + * NFC handles ready/busy signal internally. Therefore, this
> function
> + * always returns status as ready.
> + */
> + return 1;
> +}
> +
> +/* Write command to NAND flash */
> +static void mpc5121_nfc_command(struct mtd_info *mtd, unsigned command,
> + int column, int
> page)
> +{
> + struct nand_chip *chip = mtd->priv;
> + struct mpc5121_nfc_prv *prv = chip->priv;
> +
> + prv->column = (column >= 0) ? column : 0;
> + prv->spareonly = 0;
> +
> + switch (command) {
> + case NAND_CMD_PAGEPROG:
> + mpc5121_nfc_send_prog_page(mtd);
> + break;
> + /*
> + * NFC does not support sub-page reads and writes,
> + * so emulate them using full page transfers.
> + */
> + case NAND_CMD_READ0:
> + column = 0;
> + break;
> +
> + case NAND_CMD_READ1:
> + prv->column += 256;
> + command = NAND_CMD_READ0;
> + column = 0;
> + break;
> +
> + case NAND_CMD_READOOB:
> + prv->spareonly = 1;
> + command = NAND_CMD_READ0;
> + column = 0;
> + break;
> +
> + case NAND_CMD_SEQIN:
> + mpc5121_nfc_command(mtd, NAND_CMD_READ0, column, page);
> + column = 0;
> + break;
> +
> + case NAND_CMD_ERASE1:
> + case NAND_CMD_ERASE2:
> + case NAND_CMD_READID:
> + case NAND_CMD_STATUS:
> + break;
> +
> + default:
> + return;
> + }
> +
> + mpc5121_nfc_send_cmd(mtd, command);
> + mpc5121_nfc_addr_cycle(mtd, column, page);
> +
> + switch (command) {
> + case NAND_CMD_READ0:
> + if (mtd->writesize > 512)
> + mpc5121_nfc_send_cmd(mtd, NAND_CMD_READSTART);
> + mpc5121_nfc_send_read_page(mtd);
> + break;
> +
> + case NAND_CMD_READID:
> + mpc5121_nfc_send_read_id(mtd);
> + break;
> +
> + case NAND_CMD_STATUS:
> + mpc5121_nfc_send_read_status(mtd);
> + if (chip->options & NAND_BUSWIDTH_16)
> + prv->column = 1;
> + else
> + prv->column = 0;
> + break;
> + }
> +}
> +
> +/* Copy data from/to NFC spare buffers. */
> +static void mpc5121_nfc_copy_spare(struct mtd_info *mtd, uint offset,
> + u8 *buffer, uint size, int
> wr)
> +{
> + struct nand_chip *nand = mtd->priv;
> + struct mpc5121_nfc_prv *prv = nand->priv;
> + uint o, s, sbsize, blksize;
> +
> + /*
> + * NAND spare area is available through NFC spare buffers.
> + * The NFC divides spare area into (page_size / 512) chunks.
> + * Each chunk is placed into separate spare memory area, using
> + * first (spare_size / num_of_chunks) bytes of the buffer.
> + *
> + * For NAND device in which the spare area is not divided fully
> + * by the number of chunks, number of used bytes in each spare
> + * buffer is rounded down to the nearest even number of bytes,
> + * and all remaining bytes are added to the last used spare area.
> + *
> + * For more information read section 26.6.10 of MPC5121e
> + * Microcontroller Reference Manual, Rev. 3.
> + */
> +
> + /* Calculate number of valid bytes in each spare buffer */
> + sbsize = (mtd->oobsize / (mtd->writesize / 512)) & ~1;
> +
> + while (size) {
> + /* Calculate spare buffer number */
> + s = offset / sbsize;
> + if (s > NFC_SPARE_BUFFERS - 1)
> + s = NFC_SPARE_BUFFERS - 1;
> +
> + /*
> + * Calculate offset to requested data block in selected
> spare
> + * buffer and its size.
> + */
> + o = offset - (s * sbsize);
> + blksize = min(sbsize - o, size);
> +
> + if (wr)
> + memcpy_toio(prv->regs + NFC_SPARE_AREA(s) + o,
> + buffer, blksize);
> + else
> + memcpy_fromio(buffer,
> + prv->regs + NFC_SPARE_AREA(s) + o,
> blksize);
> +
> + buffer += blksize;
> + offset += blksize;
> + size -= blksize;
> + };
> +}
> +
> +/* Copy data from/to NFC main and spare buffers */
> +static void mpc5121_nfc_buf_copy(struct mtd_info *mtd, u_char *buf, int
> len,
> + int
> wr)
> +{
> + struct nand_chip *chip = mtd->priv;
> + struct mpc5121_nfc_prv *prv = chip->priv;
> + uint c = prv->column;
> + uint l;
> +
> + /* Handle spare area access */
> + if (prv->spareonly || c >= mtd->writesize) {
> + /* Calculate offset from beginning of spare area */
> + if (c >= mtd->writesize)
> + c -= mtd->writesize;
> +
> + prv->column += len;
> + mpc5121_nfc_copy_spare(mtd, c, buf, len, wr);
> + return;
> + }
> +
> + /*
> + * Handle main area access - limit copy length to prevent
> + * crossing main/spare boundary.
> + */
> + l = min((uint)len, mtd->writesize - c);
> + prv->column += l;
> +
> + if (wr)
> + memcpy_toio(prv->regs + NFC_MAIN_AREA(0) + c, buf, l);
> + else
> + memcpy_fromio(buf, prv->regs + NFC_MAIN_AREA(0) + c, l);
> +
> + /* Handle crossing main/spare boundary */
> + if (l != len) {
> + buf += l;
> + len -= l;
> + mpc5121_nfc_buf_copy(mtd, buf, len, wr);
> + }
> +}
> +
> +/* Read data from NFC buffers */
> +static void mpc5121_nfc_read_buf(struct mtd_info *mtd, u_char *buf, int
> len)
> +{
> + mpc5121_nfc_buf_copy(mtd, buf, len, 0);
> +}
> +
> +/* Write data to NFC buffers */
> +static void mpc5121_nfc_write_buf(struct mtd_info *mtd,
> + const u_char *buf, int len)
> +{
> + mpc5121_nfc_buf_copy(mtd, (u_char *)buf, len, 1);
> +}
> +
> +/* Compare buffer with NAND flash */
> +static int mpc5121_nfc_verify_buf(struct mtd_info *mtd,
> + const u_char *buf, int len)
> +{
> + u_char tmp[256];
> + uint bsize;
> +
> + while (len) {
> + bsize = min(len, 256);
> + mpc5121_nfc_read_buf(mtd, tmp, bsize);
> +
> + if (memcmp(buf, tmp, bsize))
> + return 1;
> +
> + buf += bsize;
> + len -= bsize;
> + }
> +
> + return 0;
> +}
> +
> +/* Read byte from NFC buffers */
> +static u8 mpc5121_nfc_read_byte(struct mtd_info *mtd)
> +{
> + u8 tmp;
> +
> + mpc5121_nfc_read_buf(mtd, &tmp, sizeof(tmp));
> +
> + return tmp;
> +}
> +
> +/* Read word from NFC buffers */
> +static u16 mpc5121_nfc_read_word(struct mtd_info *mtd)
> +{
> + u16 tmp;
> +
> + mpc5121_nfc_read_buf(mtd, (u_char *)&tmp, sizeof(tmp));
> +
> + return tmp;
> +}
> +
> +/*
> + * Read NFC configuration from Reset Config Word
> + *
> + * NFC is configured during reset in basis of information stored
> + * in Reset Config Word. There is no other way to set NAND block
> + * size, spare size and bus width.
> + */
> +static int mpc5121_nfc_read_hw_config(struct mtd_info *mtd)
> +{
> + struct nand_chip *chip = mtd->priv;
> + struct mpc512x_reset_module *rm;
> + struct device_node *rmnode;
> + uint rcw_pagesize = 0;
> + uint rcw_sparesize = 0;
> + uint rcw_width;
> + uint rcwh;
> + uint romloc, ps;
> +
> + rmnode = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-reset");
> + if (!rmnode) {
> + printk(KERN_ERR DRV_NAME ": Missing 'fsl,mpc5121-reset' "
> + "node in device tree!\n");
> + return -ENODEV;
> + }
> +
> + rm = of_iomap(rmnode, 0);
> + if (!rm) {
> + printk(KERN_ERR DRV_NAME
> + ": Error mapping reset module
> node!\n");
> + return -EBUSY;
> + }
> +
> + rcwh = in_be32(&rm->rcwhr);
> +
> + /* Bit 6: NFC bus width */
> + rcw_width = ((rcwh >> 6) & 0x1) ? 2 : 1;
> +
> + /* Bit 7: NFC Page/Spare size */
> + ps = (rcwh >> 7) & 0x1;
> +
> + /* Bits [22:21]: ROM Location */
> + romloc = (rcwh >> 21) & 0x3;
> +
> + /* Decode RCW bits */
> + switch ((ps << 2) | romloc) {
> + case 0x00:
> + case 0x01:
> + rcw_pagesize = 512;
> + rcw_sparesize = 16;
> + break;
> + case 0x02:
> + case 0x03:
> + rcw_pagesize = 4096;
> + rcw_sparesize = 128;
> + break;
> + case 0x04:
> + case 0x05:
> + rcw_pagesize = 2048;
> + rcw_sparesize = 64;
> + break;
> + case 0x06:
> + case 0x07:
> + rcw_pagesize = 4096;
> + rcw_sparesize = 218;
> + break;
> + }
> +
> + mtd->writesize = rcw_pagesize;
> + mtd->oobsize = rcw_sparesize;
> + if (rcw_width == 2)
> + chip->options |= NAND_BUSWIDTH_16;
> +
> + printk(KERN_NOTICE DRV_NAME ": Configured for "
> + "%u-bit NAND, page size %u
> "
> + "with %u spare.\n",
> + rcw_width * 8,
> rcw_pagesize,
> + rcw_sparesize);
> + iounmap(rm);
> + of_node_put(rmnode);
> + return 0;
> +}
> +
> +/* Free driver resources */
> +static void mpc5121_nfc_free(struct device *dev, struct mtd_info *mtd)
> +{
> + struct nand_chip *chip = mtd->priv;
> + struct mpc5121_nfc_prv *prv = chip->priv;
> +
> + if (prv->clk) {
> + clk_disable(prv->clk);
> + clk_put(prv->clk);
> + }
> +
> + if (prv->csreg)
> + iounmap(prv->csreg);
> +}
> +
> +static int __init mpc5121_nfc_probe(struct of_device *op,
> + const struct of_device_id *match)
> +{
> + struct device_node *rootnode, *dn = op->node;
> + struct device *dev = &op->dev;
> + struct mpc5121_nfc_prv *prv;
> + struct resource res;
> + struct mtd_info *mtd;
> +#ifdef CONFIG_MTD_PARTITIONS
> + struct mtd_partition *parts;
> +#endif
> + struct nand_chip *chip;
> + unsigned long regs_paddr, regs_size;
> + const uint *chips_no;
> + int resettime = 0;
> + int retval = 0;
> + int rev, len;
> +
> + /*
> + * Check SoC revision. This driver supports only NFC
> + * in MPC5121 revision 2.
> + */
> + rev = (mfspr(SPRN_SVR) >> 4) & 0xF;
> + if (rev != 2) {
> + printk(KERN_ERR DRV_NAME
> + ": SoC revision %u is not supported!\n",
> rev);
> + return -ENXIO;
> + }
> +
> + prv = devm_kzalloc(dev, sizeof(*prv), GFP_KERNEL);
> + if (!prv) {
> + printk(KERN_ERR DRV_NAME ": Memory exhausted!\n");
> + return -ENOMEM;
> + }
> +
> + mtd = &prv->mtd;
> + chip = &prv->chip;
> +
> + mtd->priv = chip;
> + chip->priv = prv;
> +
> + /* Read NFC configuration from Reset Config Word */
> + retval = mpc5121_nfc_read_hw_config(mtd);
> + if (retval) {
> + printk(KERN_ERR DRV_NAME ": Unable to read NFC config!\n");
> + return retval;
> + }
> +
> + prv->irq = irq_of_parse_and_map(dn, 0);
> + if (prv->irq == NO_IRQ) {
> + printk(KERN_ERR DRV_NAME ": Error mapping IRQ!\n");
> + return -EINVAL;
> + }
> +
> + retval = of_address_to_resource(dn, 0, &res);
> + if (retval) {
> + printk(KERN_ERR DRV_NAME ": Error parsing memory
> region!\n");
> + return retval;
> + }
> +
> + chips_no = of_get_property(dn, "chips", &len);
> + if (!chips_no || len != sizeof(*chips_no)) {
> + printk(KERN_ERR DRV_NAME ": Invalid/missing 'chips' "
> +
> "property!\n");
> + return -EINVAL;
> + }
> +
> + regs_paddr = res.start;
> + regs_size = res.end - res.start + 1;
> +
> + if (!devm_request_mem_region(dev, regs_paddr, regs_size, DRV_NAME))
> {
> + printk(KERN_ERR DRV_NAME ": Error requesting memory
> region!\n");
> + return -EBUSY;
> + }
> +
> + prv->regs = devm_ioremap(dev, regs_paddr, regs_size);
> + if (!prv->regs) {
> + printk(KERN_ERR DRV_NAME ": Error mapping memory
> region!\n");
> + return -ENOMEM;
> + }
> +
> + mtd->name = "MPC5121 NAND";
> + chip->dev_ready = mpc5121_nfc_dev_ready;
> + chip->cmdfunc = mpc5121_nfc_command;
> + chip->read_byte = mpc5121_nfc_read_byte;
> + chip->read_word = mpc5121_nfc_read_word;
> + chip->read_buf = mpc5121_nfc_read_buf;
> + chip->write_buf = mpc5121_nfc_write_buf;
> + chip->verify_buf = mpc5121_nfc_verify_buf;
> + chip->select_chip = mpc5121_nfc_select_chip;
> + chip->options = NAND_NO_AUTOINCR | NAND_USE_FLASH_BBT;
> + chip->ecc.mode = NAND_ECC_SOFT;
> +
> + /* Support external chip-select logic on ADS5121 board */
> + rootnode = of_find_node_by_path("/");
> + if (of_device_is_compatible(rootnode, "fsl,mpc5121ads")) {
> + retval = ads5121_chipselect_init(mtd);
> + if (retval) {
> + printk(KERN_ERR DRV_NAME ": Chipselect init
> error!\n");
> + of_node_put(rootnode);
> + return retval;
> + }
> +
> + chip->select_chip = ads5121_select_chip;
> + }
> + of_node_put(rootnode);
> +
> + /* Enable NFC clock */
> + prv->clk = clk_get(dev, "nfc_clk");
> + if (!prv->clk) {
> + printk(KERN_ERR DRV_NAME ": Unable to acquire NFC
> clock!\n");
> + retval = -ENODEV;
> + goto error;
> + }
> +
> + clk_enable(prv->clk);
> +
> + /* Reset NAND Flash controller */
> + nfc_set(mtd, NFC_CONFIG1, NFC_RESET);
> + while (nfc_read(mtd, NFC_CONFIG1) & NFC_RESET) {
> + if (resettime++ >= NFC_RESET_TIMEOUT) {
> + printk(KERN_ERR DRV_NAME
> + ": Timeout while resetting
> NFC!\n");
> + retval = -EINVAL;
> + goto error;
> + }
> +
> + udelay(1);
> + }
> +
> + /* Enable write to NFC memory */
> + nfc_write(mtd, NFC_CONFIG, NFC_BLS_UNLOCKED);
> +
> + /* Enable write to all NAND pages */
> + nfc_write(mtd, NFC_UNLOCKSTART_BLK0, 0x0000);
> + nfc_write(mtd, NFC_UNLOCKEND_BLK0, 0xFFFF);
> + nfc_write(mtd, NFC_WRPROT, NFC_WPC_UNLOCK);
> +
> + /*
> + * Setup NFC:
> + * - Big Endian transfers,
> + * - Interrupt after full page read/write.
> + */
> + nfc_write(mtd, NFC_CONFIG1, NFC_BIG_ENDIAN | NFC_INT_MASK |
> + NFC_FULL_PAGE_INT);
> +
> + /* Set spare area size */
> + nfc_write(mtd, NFC_SPAS, mtd->oobsize >> 1);
> +
> + init_waitqueue_head(&prv->irq_waitq);
> + retval = devm_request_irq(dev, prv->irq, &mpc5121_nfc_irq, 0,
> DRV_NAME,
> +
> mtd);
> + if (retval) {
> + printk(KERN_ERR DRV_NAME ": Error requesting IRQ!\n");
> + goto error;
> + }
> +
> + /* Detect NAND chips */
> + if (nand_scan(mtd, *chips_no)) {
> + printk(KERN_ERR DRV_NAME ": NAND Flash not found !\n");
> + devm_free_irq(dev, prv->irq, mtd);
> + retval = -ENXIO;
> + goto error;
> + }
> +
> + /* Set erase block size */
> + switch (mtd->erasesize / mtd->writesize) {
> + case 32:
> + nfc_set(mtd, NFC_CONFIG1, NFC_PPB_32);
> + break;
> +
> + case 64:
> + nfc_set(mtd, NFC_CONFIG1, NFC_PPB_64);
> + break;
> +
> + case 128:
> + nfc_set(mtd, NFC_CONFIG1, NFC_PPB_128);
> + break;
> +
> + case 256:
> + nfc_set(mtd, NFC_CONFIG1, NFC_PPB_256);
> + break;
> +
> + default:
> + printk(KERN_ERR DRV_NAME ": Unsupported NAND flash!\n");
> + devm_free_irq(dev, prv->irq, mtd);
> + retval = -ENXIO;
> + goto error;
> + }
> +
> + dev_set_drvdata(dev, mtd);
> +
> + /* Register device in MTD */
> +#ifdef CONFIG_MTD_PARTITIONS
> + retval = parse_mtd_partitions(mtd, mpc5121_nfc_pprobes, &parts, 0);
> +#ifdef CONFIG_MTD_OF_PARTS
> + if (retval == 0)
> + retval = of_mtd_parse_partitions(dev, dn, &parts);
> +#endif
> + if (retval < 0) {
> + printk(KERN_ERR DRV_NAME ": Error parsing MTD
> partitions!\n");
> + devm_free_irq(dev, prv->irq, mtd);
> + retval = -EINVAL;
> + goto error;
> + }
> +
> + if (retval > 0)
> + retval = add_mtd_partitions(mtd, parts, retval);
> + else
> +#endif
> + retval = add_mtd_device(mtd);
> +
> + if (retval) {
> + printk(KERN_ERR DRV_NAME ": Error adding MTD device!\n");
> + devm_free_irq(dev, prv->irq, mtd);
> + goto error;
> + }
> +
> + return 0;
> +error:
> + mpc5121_nfc_free(dev, mtd);
> + return retval;
> +}
> +
> +static int __exit mpc5121_nfc_remove(struct of_device *op)
> +{
> + struct device *dev = &op->dev;
> + struct mtd_info *mtd = dev_get_drvdata(dev);
> + struct nand_chip *chip = mtd->priv;
> + struct mpc5121_nfc_prv *prv = chip->priv;
> +
> + nand_release(mtd);
> + devm_free_irq(dev, prv->irq, mtd);
> + mpc5121_nfc_free(dev, mtd);
> +
> + return 0;
> +}
> +
> +static struct of_device_id mpc5121_nfc_match[] = {
> + { .compatible = "fsl,mpc5121-nfc", },
> + {},
> +};
> +
> +static struct of_platform_driver mpc5121_nfc_driver = {
> + .owner = THIS_MODULE,
> + .name = DRV_NAME,
> + .match_table = mpc5121_nfc_match,
> + .probe = mpc5121_nfc_probe,
> + .remove = __exit_p(mpc5121_nfc_remove),
> + .suspend = NULL,
> + .resume = NULL,
> + .driver = {
> + .name = DRV_NAME,
> + .owner = THIS_MODULE,
> + },
> +};
> +
> +static int __init mpc5121_nfc_init(void)
> +{
> + if (of_register_platform_driver(&mpc5121_nfc_driver) != 0) {
> + printk(KERN_ERR DRV_NAME ": Driver register failed!\n");
> + return -ENODEV;
> + }
> + return 0;
> +}
> +
> +static void __exit mpc5121_nfc_cleanup(void)
> +{
> + of_unregister_platform_driver(&mpc5121_nfc_driver);
> +}
> +
> +module_init(mpc5121_nfc_init);
> +module_exit(mpc5121_nfc_cleanup);
> +
> +MODULE_AUTHOR("Freescale Semiconductor, Inc.");
> +MODULE_DESCRIPTION("MPC5121 NAND MTD driver");
> +MODULE_LICENSE("GPL");
> +MODULE_VERSION(DRV_VERSION);
> --
> 1.6.0.6
>
>
[-- Attachment #2: Type: text/html, Size: 40951 bytes --]
^ permalink raw reply
* Re: [PATCH 06/12] mpc5121: Added NAND Flash Controller driver.
From: Grant Likely @ 2009-05-08 3:07 UTC (permalink / raw)
To: John Rigby; +Cc: linuxppc-dev, linux-mtd, Wolfgang Denk, Piotr Ziecik
In-Reply-To: <4b73d43f0905071922x7b5ed328q86b14a35c0040270@mail.gmail.com>
On Thu, May 7, 2009 at 8:22 PM, John Rigby <jcrigby@gmail.com> wrote:
>
>
> On Wed, May 6, 2009 at 2:59 PM, Grant Likely <grant.likely@secretlab.ca>
> wrote:
>>
>>
>> > diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c
>> > b/arch/powerpc/platforms/512x/mpc512x_shared.c
>> > index d8cd579..7135d89 100644
>> > --- a/arch/powerpc/platforms/512x/mpc512x_shared.c
>> > +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
>> > @@ -71,6 +71,7 @@ void __init mpc512x_init_IRQ(void)
>> > =A0static struct of_device_id __initdata of_bus_ids[] =3D {
>> > =A0 =A0 =A0 =A0{ .compatible =3D "fsl,mpc5121-immr", },
>> > =A0 =A0 =A0 =A0{ .compatible =3D "fsl,mpc5121-localbus", },
>> > + =A0 =A0 =A0 { .compatible =3D "fsl,mpc5121-nfc", },
>>
>> This doesn't look right. =A0Shouldn't the NAND controller be hanging of
>> the IMMR node?
>
> I just wanted to confirm that NFC is in its own memory space. =A0 It has =
its
> own mapping and is not part of the IMMR space.
Hmmm... I wonder then if it might be better to have an IPB node, and
hang all the IPB connected nodes off of it.
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH 08/12] mpc5121: Added I2C support.
From: Grant Likely @ 2009-05-08 3:01 UTC (permalink / raw)
To: John Rigby
Cc: linux-i2c, linuxppc-dev, Wolfgang Denk, Detlev Zundel,
Piotr Ziecik
In-Reply-To: <4b73d43f0905071912k4bcc8821nabfa27aa5b1f587b@mail.gmail.com>
On Thu, May 7, 2009 at 8:12 PM, John Rigby <jcrigby@gmail.com> wrote:
> Ok, the interrupt enabling should happen in the driver.=A0 Should it key =
off
> compatible or should a new property be added like the existing 5200 clock=
ing
> property?
key off compatible. And the 5200 clocking property has been depreciated.
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH 11/12] mpc5121: Added MPC512x DMA driver.
From: John Rigby @ 2009-05-08 2:49 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, Wolfgang Denk, Piotr Ziecik
In-Reply-To: <fa686aa40905061407v2bac38e9k3ee8d68c0c58e692@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2476 bytes --]
On Wed, May 6, 2009 at 3:07 PM, Grant Likely <grant.likely@secretlab.ca>wrote:
> On Wed, May 6, 2009 at 2:15 PM, Wolfgang Denk <wd@denx.de> wrote:
> > From: Piotr Ziecik <kosmo@semihalf.com>
> >
> > This patch adds initial version of MPC512x DMA driver.
> > Only memory to memory transfers are currenly supported.
> >
> > Signed-off-by: Piotr Ziecik <kosmo@semihalf.com>
> > Signed-off-by: Wolfgang Denk <wd@denx.de>
> > Cc: Grant Likely <grant.likely@secretlab.ca>
> > Cc: John Rigby <jcrigby@gmail.com>
>
> Don't have time to review this in detail right now, but three quick
> comments:
>
> > drivers/dma/mpc512x_dma.c | 642
> ++++++++++++++++++++++++++
> > drivers/dma/mpc512x_dma.h | 192 ++++++++
>
> It looks to me like these two files should be merged.
>
> > diff --git a/arch/powerpc/boot/dts/mpc5121ads.dts
> b/arch/powerpc/boot/dts/mpc5121ads.dts
> > index c2d9de9..e7f0e09 100644
> > --- a/arch/powerpc/boot/dts/mpc5121ads.dts
> > +++ b/arch/powerpc/boot/dts/mpc5121ads.dts
> > @@ -373,7 +373,7 @@
> > };
> >
> > dma@14000 {
> > - compatible = "fsl,mpc5121-dma2";
> > + compatible = "fsl,mpc512x-dma";
>
> Nack. Compatible values should not use wildcards. Be specific. And
> be specific about what it is compatible to if another part implements
> the same device.
The internal name for the dma module was dma2 that is where the orginal name
came from. There is a dma2 in some 8xxx but last I looked it is not at all
the same. I would vote for fsl,mpc5121-dma.
>
>
> > reg = <0x14000 0x1800>;
> > interrupts = <65 0x8>;
> > interrupt-parent = < &ipic >;
> > diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c
> b/arch/powerpc/platforms/512x/mpc512x_shared.c
> > index b776e45..135fd6b 100644
> > --- a/arch/powerpc/platforms/512x/mpc512x_shared.c
> > +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
> > @@ -95,6 +95,7 @@ void __init mpc512x_init_i2c(void)
> > static struct of_device_id __initdata of_bus_ids[] = {
> > { .compatible = "fsl,mpc5121-immr", },
> > { .compatible = "fsl,mpc5121-localbus", },
> > + { .compatible = "fsl,mpc5121-dma", },
>
> This doesn't look right either. Shouldn't the dma device hang off the
> IMMR node?
Yes dma is part of IMMR.
>
>
> g.
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
>
[-- Attachment #2: Type: text/html, Size: 3779 bytes --]
^ permalink raw reply
* Re: [rtc-linux] Re: [PATCH 10/12] mpc5121: Add MPC5121 Real time clock driver.
From: John Rigby @ 2009-05-08 2:41 UTC (permalink / raw)
To: rtc-linux; +Cc: linuxppc-dev, Piotr Ziecik, Wolfgang Denk
In-Reply-To: <fa686aa40905061540x96c1524hd88ee78bc366b89b@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]
Can we get 5121 support in and add 5200 support later? They are not
identical.
On Wed, May 6, 2009 at 4:40 PM, Grant Likely <grant.likely@secretlab.ca>wrote:
>
> On Wed, May 6, 2009 at 3:06 PM, Wolfram Sang <w.sang@pengutronix.de>
> wrote:
> > On Wed, May 06, 2009 at 10:15:17PM +0200, Wolfgang Denk wrote:
> >> From: John Rigby <jrigby@freescale.com>
> >>
> >> Based on Domen Puncer's rtc driver for 5200 posted to
> >> the ppclinux mailing list:
> >> http://patchwork.ozlabs.org/linuxppc-embedded/patch?id=11675
> >> but never commited anywhere.
> >>
> >> Changes to Domen's original:
> >>
> >> Changed filenames/routine names from mpc5200* to mpc5121*
> >
> > Why not changing it to mpc5xxx? From a glimpse, it should still work on
> > MPC5200, too.
>
> If this is true, the I heartily agree with Wolfram. :-)
>
> g.
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
>
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to "rtc-linux".
> Membership options at http://groups.google.com/group/rtc-linux .
> Please read http://groups.google.com/group/rtc-linux/web/checklist
> before submitting a driver.
> -~----------~----~----~----~------~----~------~--~---
>
>
[-- Attachment #2: Type: text/html, Size: 2172 bytes --]
^ permalink raw reply
* Re: [PATCH 03/12] fs_enet: Add FEC TX Alignment workaround for MPC5121.
From: John Rigby @ 2009-05-08 2:36 UTC (permalink / raw)
To: Grant Likely
Cc: linuxppc-dev, netdev, Wolfgang Denk, Detlev Zundel, Piotr Ziecik
In-Reply-To: <fa686aa40905061542g2cf538bau5eebcfc154906810@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1766 bytes --]
I was having deja-vu with this and realized that I have fixed at least some
of the objections to this patch.
Wolfgang you may want to look at the patch in my 5121 git tree here:
http://git.denx.de/?p=linux-mpc512x.git;a=commit;h=2950be3be42af7449941c3340998c27ef918f10f
It does runtime tx packet alignment It also has fewer ifdefs and trys to
share more code. It also has a header that explains everything including
that fact that there is not a runtime conflict sine the only other ppc that
has fec is 8xx which is not in the same family.
On Wed, May 6, 2009 at 4:42 PM, Grant Likely <grant.likely@secretlab.ca>wrote:
> On Wed, May 6, 2009 at 4:12 PM, Wolfgang Denk <wd@denx.de> wrote:
> > Dear Grant Likely,
> >
> > In message <fa686aa40905061337w6aa82f5aj787618ba108e528f@mail.gmail.com>
> you wrote:
> >>
> >> > The FEC on 5121 has problems with misaligned tx buffers.
> >> > The RM says any alignment is ok but empirical results
> >> > show that packet buffers ending in 0x1E will sometimes
> >> > hang the FEC. Other bad alignment does not hang but will
> >> > cause silent TX failures resulting in about a 1% packet
> >> > loss as tested by ping -f from a remote host.
> >> >
> >> > This patch is a work around that copies every tx packet
> >> > to an aligned skb before sending.
> >>
> >> OUCH!
> >
> > Yes :-(
> >
> >> > +#else
> >> > +#define tx_skb_align_workaround(dev, skb) (skb)
> >> > +#endif
> >>
> >> Another use of #ifdef blocks. What is the multiplatform impact?
> >
> > Hm... Can you recommend a better way to solve the problem? Suggestions
> > are welcome.
>
> I'd rather see a runtime selectable workaround. ie. enable it based
> on the compatible property.
>
> g.
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
>
[-- Attachment #2: Type: text/html, Size: 2629 bytes --]
^ permalink raw reply
* Re: [PATCH 06/12] mpc5121: Added NAND Flash Controller driver.
From: John Rigby @ 2009-05-08 2:22 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, linux-mtd, Wolfgang Denk, Piotr Ziecik
In-Reply-To: <fa686aa40905061359p3ba2115fj57f4d9a79f01efda@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 826 bytes --]
On Wed, May 6, 2009 at 2:59 PM, Grant Likely <grant.likely@secretlab.ca>wrote:
>
>
> > diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c
> b/arch/powerpc/platforms/512x/mpc512x_shared.c
> > index d8cd579..7135d89 100644
> > --- a/arch/powerpc/platforms/512x/mpc512x_shared.c
> > +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
> > @@ -71,6 +71,7 @@ void __init mpc512x_init_IRQ(void)
> > static struct of_device_id __initdata of_bus_ids[] = {
> > { .compatible = "fsl,mpc5121-immr", },
> > { .compatible = "fsl,mpc5121-localbus", },
> > + { .compatible = "fsl,mpc5121-nfc", },
>
> This doesn't look right. Shouldn't the NAND controller be hanging of
> the IMMR node?
>
I just wanted to confirm that NFC is in its own memory space. It has its
own mapping and is not part of the IMMR space.
[-- Attachment #2: Type: text/html, Size: 1239 bytes --]
^ 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