* [PATCH] powerpc/oprofile: Remove unused dump_pmcs() in FSL oprofile
From: Michael Ellerman @ 2009-04-08 0:02 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, afleming
It's still in the git history if anyone wants it.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/oprofile/op_model_fsl_emb.c | 14 --------------
1 files changed, 0 insertions(+), 14 deletions(-)
diff --git a/arch/powerpc/oprofile/op_model_fsl_emb.c b/arch/powerpc/oprofile/op_model_fsl_emb.c
index 91596f6..62312ab 100644
--- a/arch/powerpc/oprofile/op_model_fsl_emb.c
+++ b/arch/powerpc/oprofile/op_model_fsl_emb.c
@@ -228,20 +228,6 @@ static void pmc_stop_ctrs(void)
mtpmr(PMRN_PMGC0, pmgc0);
}
-static void dump_pmcs(void)
-{
- printk("pmgc0: %x\n", mfpmr(PMRN_PMGC0));
- printk("pmc\t\tpmlca\t\tpmlcb\n");
- printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC0),
- mfpmr(PMRN_PMLCA0), mfpmr(PMRN_PMLCB0));
- printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC1),
- mfpmr(PMRN_PMLCA1), mfpmr(PMRN_PMLCB1));
- printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC2),
- mfpmr(PMRN_PMLCA2), mfpmr(PMRN_PMLCB2));
- printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC3),
- mfpmr(PMRN_PMLCA3), mfpmr(PMRN_PMLCB3));
-}
-
static int fsl_emb_cpu_setup(struct op_counter_config *ctr)
{
int i;
--
1.6.2.1
^ permalink raw reply related
* Re: Hotplug on PPC4xx
From: Sean MacLennan @ 2009-04-07 23:27 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20090406182023.0729073a@lappy.seanm.ca>
On Mon, 6 Apr 2009 18:20:23 -0400
"Sean MacLennan" <sean.maclennan@ottawa.kanatek.ca> wrote:
> I am trying to run the /sbin/hotplug from the kernel and it doesn't
> work. Has anybody got it running?
I looked into it some more. It turns out that the env pointers are
freed before they are copied.
In kobject_uevent_env() if I change the line that calls the helper from
UMH_NO_WAIT to UMH_WAIT_EXEC, then it works... but probably at a loss
of performance.
retval = call_usermodehelper(argv[0], argv,
env->envp, UMH_WAIT_EXEC);
Any other ideas?
Cheers,
Sean
^ permalink raw reply
* Re: [PATCH] powerpc/oprofile: dump_pmcs() is not used
From: Kumar Gala @ 2009-04-07 19:42 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, afleming
In-Reply-To: <771B1F79-194B-4C6A-A2AE-5E4BEF0A17D3@freescale.com>
On Apr 6, 2009, at 9:03 AM, Kumar Gala wrote:
>
> On Apr 6, 2009, at 8:45 AM, Michael Ellerman wrote:
>
>> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
>> ---
>> arch/powerpc/oprofile/op_model_fsl_emb.c | 2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> Or should we just remove it?
>
> I'm for removing it if Andy doesn't have any issues. Someone can
> always add it back as debugfs code in the future if they want it.
I chatted w/Andy and we both agreed to just remove the code rather
than #if 0 it. If you send me a patch with that I'll apply it.
- k
^ permalink raw reply
* Re: issue at the beginning of kernel booting
From: Scott Wood @ 2009-04-07 19:41 UTC (permalink / raw)
To: Sauce.Cheng; +Cc: linuxppc-dev
In-Reply-To: <22930588.post@talk.nabble.com>
Sauce.Cheng wrote:
>>> i tried
>>> CONFIG_PPC_EARLY_DEBUG_CPM=y
>>> CONFIG_PPC_EARLY_DEBUG_CPM_ADDR=0xf00000008
>>> how can i make sure CPM_ADDR, 0xf0000008 is default value
>
>> Look at the u-boot source, or dump the memory and see if it looks like a
>> ring buffer.
>
> sorry, i mean that CPM_ADDR is address of what? address of CPM registers or
> something?
It's the address of a transmit descriptor for the serial port. It's
typically in DPRAM, but the exact position depends on where u-boot put
it. Try 0xf0000088.
>> This is a dts-v0 tree, which implies it's fairly old.
> dose later dts be used in corresponding kernel version ?
Yes, current kernels use dts-v1.
> in addition, there is one more question.
> my RAM size is 32MBytes, my "vmlinux" size is 30MBytes, "vmlinux.o" size is
> 58MBytes. so , will there be something wrong at uncompressing time ?
That's just debugging information; it won't end up in the uImage. Use
the "size" utility in your toolchain to see how big the actual code and
data are.
-Scott
^ permalink raw reply
* Re: [PATCH] powerpc: 85xx: Add PHY fixup to socrates board code
From: Anton Vorontsov @ 2009-04-07 18:40 UTC (permalink / raw)
To: Anatolij Gustschin; +Cc: linuxppc-dev
In-Reply-To: <20090407180957.GA2831@oksana.dev.rtsoft.ru>
On Tue, Apr 07, 2009 at 10:09:57PM +0400, Anton Vorontsov wrote:
[...]
> Still, I think you shouldn't do this in a board-specific fixup.
> Maybe I'm a bit naive, but shouldn't this work too?
Yes, I'm naive. The phydev isn't yet bound to any driver, so we
can't call phy_disable_interrupts().
And I don't see any proper solution. :-( After all, it appears
we'll have to live with the board fixup.
> diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
> index b754020..9052937 100644
> --- a/drivers/net/phy/mdio_bus.c
> +++ b/drivers/net/phy/mdio_bus.c
> @@ -205,6 +205,16 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr)
>
> phydev->bus = bus;
>
> + /*
> + * Some PHYs may have unmasked/pending interrupts, this might
> + * cause troubles w/ shared IRQs. So try to put the PHYs into
> + * some sane state.
> + *
> + * NOTE: This won't work if you have two PHYs w/ shared IRQs
> + * on different MDIO buses.
> + */
> + phy_disable_interrupts(phydev);
> +
> /* Run all of the fixups for this PHY */
> phy_scan_fixups(phydev);
>
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH] powerpc: Fix tlbilx opcode
From: Peter Bergner @ 2009-04-07 18:31 UTC (permalink / raw)
To: Kumar Gala
Cc: linuxppc-dev, Alan Modra, binutils@sourceware.org,
Edmar Wienskoski-RA8797
In-Reply-To: <606D70D7-6F85-48DF-854F-18DAE01ACA95@kernel.crashing.org>
On Tue, 2009-04-07 at 12:54 -0500, Kumar Gala wrote:
> On Apr 7, 2009, at 12:36 PM, Peter Bergner wrote:
> > How do you want to handle the current binutils code that implements tlbilx
> > and its extended mnemonics? Should they be changed to use secondary opcode
> > 18 instead of 787 as per the ISA 2.06 doc?
>
> YES ! :)
The ISA 2.06 documentation states the secondary opcode used by tlbilx and
its extended mnemonics is 18 and not 787 which the current code uses.
This patch fixes the typo, as well as reordering the extended mnemonics
so they are listed in the opcodes table before the base tlbilx insn, so
that objdump will attempt to use them before the base insn.
This built and make checks fine, so I committed this as obvious.
Peter
opcodes/
* ppc-opc.c (powerpc_opcodes) <"tlbilxlpid", "tlbilxpid", "tlbilxva",
"tlbilx">: Use secondary opcode "18" as per the ISA 2.06 documentation.
Reorder entries so the extended mnemonics are listed before tlbilx.
gas/testsuite/
* gas/ppc/e500mc.d: Update to match extended mnemonics.
Index: gas/testsuite/gas/ppc/e500mc.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/ppc/e500mc.d,v
retrieving revision 1.3
diff -u -p -r1.3 e500mc.d
--- gas/testsuite/gas/ppc/e500mc.d 26 Feb 2009 22:07:33 -0000 1.3
+++ gas/testsuite/gas/ppc/e500mc.d 7 Apr 2009 18:15:23 -0000
@@ -50,7 +50,8 @@ Disassembly of section \.text:
a0: 7c 64 29 fe dcbtstep r3,r4,r5
a4: 7c c7 42 7e dcbtep r6,r7,r8
a8: 7c 0b 67 fe dcbzep r11,r12
- ac: 7c 00 06 26 tlbilx 0,0,r0
- b0: 7c 20 06 26 tlbilx 1,0,r0
- b4: 7c 62 1e 26 tlbilx 3,r2,r3
- b8: 7c 64 2e 26 tlbilx 3,r4,r5
+ ac: 7c 00 00 24 tlbilxlpid
+ b0: 7c 20 00 24 tlbilxpid
+ b4: 7c 62 18 24 tlbilxva r2,r3
+ b8: 7c 64 28 24 tlbilxva r4,r5
+
Index: opcodes/ppc-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/ppc-opc.c,v
retrieving revision 1.120
diff -u -p -r1.120 ppc-opc.c
--- opcodes/ppc-opc.c 2 Apr 2009 13:30:56 -0000 1.120
+++ opcodes/ppc-opc.c 7 Apr 2009 18:15:24 -0000
@@ -3464,6 +3464,11 @@ const struct powerpc_opcode powerpc_opco
{"isellt", X(31,15), X_MASK, PPCISEL, PPCNONE, {RT, RA, RB}},
+{"tlbilxlpid", XTO(31,18,0), XTO_MASK, E500MC, PPCNONE, {0}},
+{"tlbilxpid", XTO(31,18,1), XTO_MASK, E500MC, PPCNONE, {0}},
+{"tlbilxva", XTO(31,18,3), XTO_MASK, E500MC, PPCNONE, {RA0, RB}},
+{"tlbilx", X(31,18), X_MASK, E500MC, PPCNONE, {T, RA0, RB}},
+
{"mfcr", XFXM(31,19,0,0), XFXFXM_MASK, POWER4, PPCNONE, {RT, FXM4}},
{"mfcr", XFXM(31,19,0,0), XRARB_MASK, COM, POWER4, {RT}},
{"mfocrf", XFXM(31,19,0,1), XFXFXM_MASK, COM, PPCNONE, {RT, FXM}},
@@ -4551,10 +4556,6 @@ const struct powerpc_opcode powerpc_opco
{"lxvw4x", X(31,780), XX1_MASK, PPCVSX, PPCNONE, {XT6, RA, RB}},
{"tlbivax", X(31,786), XRT_MASK, BOOKE, PPCNONE, {RA, RB}},
-{"tlbilx", X(31,787), X_MASK, E500MC, PPCNONE, {T, RA0, RB}},
-{"tlbilxlpid", XTO(31,787,0), XTO_MASK, E500MC, PPCNONE, {0}},
-{"tlbilxpid", XTO(31,787,1), XTO_MASK, E500MC, PPCNONE, {0}},
-{"tlbilxva", XTO(31,787,3), XTO_MASK, E500MC, PPCNONE, {RA0, RB}},
{"lwzcix", X(31,789), X_MASK, POWER6, PPCNONE, {RT, RA0, RB}},
^ permalink raw reply
* Printk time stamp seems to be stuck.
From: Subodh Nijsure @ 2009-04-07 18:18 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 933 bytes --]
I am running PPC kernel (2.6.26) with .config that contains
CONFIG_PRINTK_TIME=y also I am booting kernel with parameter printk.time=1.
I am also booting the kernel with option initcall_debug and I see following
output after setup_vmstat() the printk timestamp feature stops working.
i.e. after call to setup_vmstat all printk messages have same timestamp...
[ 4.294855] calling pdflush_init+0x0/0x28()
[ 4.294926] initcall pdflush_init+0x0/0x28() returned 0 after 0 msecs
[ 4.294931] calling kswapd_init+0x0/0x2c()
[ 4.294962] initcall kswapd_init+0x0/0x2c() returned 0 after 0 msecs
[ 4.294966] calling setup_vmstat+0x0/0x74()
[ 4.294966] initcall setup_vmstat+0x0/0x74() returned 0 after 0 msecs
[ 4.294966] calling init_emergency_pool+0x0/0x84()
[ 4.294966] highmem bounce pool size: 64 pages
Has anybody else seen this or there is something odd with my kernel/board
setup.
/Subodh Nijsure
[-- Attachment #2: Type: text/html, Size: 2237 bytes --]
^ permalink raw reply
* Re: AMCC 440EP phy detection
From: Eddie Dawydiuk @ 2009-04-07 18:20 UTC (permalink / raw)
To: Feng Kan; +Cc: linuxppc-dev
In-Reply-To: <49DB83BA.3080807@amcc.com>
Feng,
> Are you able to ping in u-boot? Sounded like you were only pinging in
> linux.
We are not using u-boot, we've written a custom bootloader. I see there are a
few debugging flags in the emac driver I can enable, I'll do that next to look
into the problem further. Thanks for the response.
> I would try the mii command in uboot. It seems like it detected the
> phys. Try enable the
> loopbacks at the different stages to see if the traffic is returning.
> This excerise is
> much easier in uboot than linux.
>
>
> Feng Kan
> AMCC Software
>
> Eddie Dawydiuk wrote:
>> Hello,
>>
>> I'm working on a board based on the Yosemite AMCC 440EP eval board.
>> I'm having some difficulty getting both network interfaces working.
>> The first problem I found is the ibm_newemac driver was detecting the
>> two phys at address 0 and 1 where we have them wired for addresses 1
>> and 3. As a result I hardcoded the phy-address in the dts file. I then
>> found I was able to receive and send data on eth1(phy-address 3)
>> without incident. Although I found eth0 can receive data but I see no
>> packets being transmitted(using a packet sniffer) and I see no
>> indication from a software standpoint of any transmit failures. We are
>> using Micrel KSZ8041FTL phys(RMII mode) where the Yosemite board used
>> Micrel KS8721BL phys. I've reviewed the schematic and it appears both
>> phys are connected identically and I've seen this same failure on
>> multiple boards. I thought the fact that the driver detected a phy at
>> address 0 might be a clue, but I can't make much of the clue. So I
>> thought I'd post this info in the hopes someone else might have run
>> into a similar problem or have a suggestion.
>>
>>
>
--
Best Regards,
________________________________________________________________
Eddie Dawydiuk, Technologic Systems | voice: (480) 837-5200
16525 East Laser Drive | fax: (480) 837-5300
Fountain Hills, AZ 85268 | web: www.embeddedARM.com
^ permalink raw reply
* Re: [PATCH] powerpc: 85xx: Add PHY fixup to socrates board code
From: Anton Vorontsov @ 2009-04-07 18:09 UTC (permalink / raw)
To: Anatolij Gustschin; +Cc: linuxppc-dev
In-Reply-To: <49DB8C3C.5080306@denx.de>
On Tue, Apr 07, 2009 at 07:24:12PM +0200, Anatolij Gustschin wrote:
> Anton Vorontsov wrote:
> > On Tue, Apr 07, 2009 at 04:19:48PM +0200, Anatolij Gustschin wrote:
> >> If the firmware missed to initialize the PHY correctly,
> >> Linux may hang up on socrates while eth0/eth1 interface
> >> startup (caused by continuous unacknowledged PHY interrupt).
> >>
> >> This patch adds PHY fixup to socrates platform code to
> >> ensure the PHY is pre-initialized correctly. It is needed
> >> to be compatible with older firmware.
> >
> > Is that really board-specific fixup, or can it be placed
> > somewhere inside drivers/net/phy/marvell.c?
>
> On this board the multi-PHY is configured to use shared IRQ pin
> for both PHY ports. Placing this fixup in drivers/net/phy/marvell.c
> as e.g. '.config_init' callback could be done, but this will add
> more overhead as the fixup routine have to do more work:
>
> acquire 'struct mii_bus' pointer and walk through all registered PHYs
> searching for the PHY which use the same interrupt, then getting
> the address of this PHY on the bus and disable and clear PHY irqs
> by writing/reading to/from this PHY, (but only in the case it was
> not already brought up and has interrupts enabled!) e.g.:
>
> struct mii_bus *bus = phydev->bus;
> int addr;
>
> for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
> struct phy_device *phy = bus->phy_map[addr];
>
> if (addr != phydev->addr && bus->irq[addr] == phydev->irq &&
> (phy->phy_id & 0x0ffffff0) == 0x01410cb0 &&
> !(phy->interrupts & PHY_INTERRUPT_ENABLED)) {
>
> int imask = phy_read(phy, MII_M1011_IMASK);
>
> if (imask) {
> phy_write(phy, 0x12, 0); /* disable */
> phy_read(phy, 0x13); /* clear */
> }
> }
> }
>
> All this to allow support for multiple m88e1121 devices.
> Otherwise, after registering first phy interrupt handler
> and enabling interrupt pending irq on other PHY port or
> other PHY device will lock up the board.
>
> The fixup in this patch will only be done while mdio bus scan
> before registering a PHY device.
Still, I think you shouldn't do this in a board-specific fixup.
Maybe I'm a bit naive, but shouldn't this work too?
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index b754020..9052937 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -205,6 +205,16 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr)
phydev->bus = bus;
+ /*
+ * Some PHYs may have unmasked/pending interrupts, this might
+ * cause troubles w/ shared IRQs. So try to put the PHYs into
+ * some sane state.
+ *
+ * NOTE: This won't work if you have two PHYs w/ shared IRQs
+ * on different MDIO buses.
+ */
+ phy_disable_interrupts(phydev);
+
/* Run all of the fixups for this PHY */
phy_scan_fixups(phydev);
^ permalink raw reply related
* Re: [PATCH] powerpc: Fix tlbilx opcode
From: Kumar Gala @ 2009-04-07 17:54 UTC (permalink / raw)
To: Peter Bergner; +Cc: linuxppc-dev, Edmar Wienskoski-RA8797
In-Reply-To: <1239125792.7557.7.camel@otta>
On Apr 7, 2009, at 12:36 PM, Peter Bergner wrote:
> On Mon, 2009-04-06 at 15:36 -0500, Kumar Gala wrote:
>> The tlbilx opcode was not matching the Power ISA 2.06 arch spec.
>> The old opcode was an early suggested opcode that changed during the
>> 2.06 architecture process.
> [snip]
>> #define PPC_INST_STSWI 0x7c0005aa
>> #define PPC_INST_STSWX 0x7c00052a
>> -#define PPC_INST_TLBILX 0x7c000626
>> +#define PPC_INST_TLBILX 0x7c000024
>> #define PPC_INST_WAIT 0x7c00007c
>
> How do you want to handle the current binutils code that implements
> tlbilx
> and its extended mnemonics? Should they be changed to use secondary
> opcode
> 18 instead of 787 as per the ISA 2.06 doc?
YES ! :)
> {"tlbilx", X(31,787), X_MASK, E500MC,
> PPCNONE, {T, RA0, RB}},
> {"tlbilxlpid", XTO(31,787,0), XTO_MASK, E500MC,
> PPCNONE, {0}},
> {"tlbilxpid", XTO(31,787,1), XTO_MASK, E500MC,
> PPCNONE, {0}},
> {"tlbilxva", XTO(31,787,3), XTO_MASK, E500MC,
> PPCNONE, {RA0, RB}},
>
> If you want to change the tlbilx entry to use 18 rather than 787,
> let me
> know whether you want me to make the change or whether you (Edmar?)
> will
> handle it.
>
> I'll note the extended mnemonics should be moved before tlbilx so
> that the
> disassembler will use them (if appropriate) instead of the base
> instruction.
I'll check w/Edmar.
- k
^ permalink raw reply
* Re: [PATCH] powerpc: Fix tlbilx opcode
From: Peter Bergner @ 2009-04-07 17:36 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Edmar Wienskoski-RA8797
In-Reply-To: <1239050219-4477-1-git-send-email-galak@kernel.crashing.org>
On Mon, 2009-04-06 at 15:36 -0500, Kumar Gala wrote:
> The tlbilx opcode was not matching the Power ISA 2.06 arch spec.
> The old opcode was an early suggested opcode that changed during the
> 2.06 architecture process.
[snip]
> #define PPC_INST_STSWI 0x7c0005aa
> #define PPC_INST_STSWX 0x7c00052a
> -#define PPC_INST_TLBILX 0x7c000626
> +#define PPC_INST_TLBILX 0x7c000024
> #define PPC_INST_WAIT 0x7c00007c
How do you want to handle the current binutils code that implements tlbilx
and its extended mnemonics? Should they be changed to use secondary opcode
18 instead of 787 as per the ISA 2.06 doc?
{"tlbilx", X(31,787), X_MASK, E500MC, PPCNONE, {T, RA0, RB}},
{"tlbilxlpid", XTO(31,787,0), XTO_MASK, E500MC, PPCNONE, {0}},
{"tlbilxpid", XTO(31,787,1), XTO_MASK, E500MC, PPCNONE, {0}},
{"tlbilxva", XTO(31,787,3), XTO_MASK, E500MC, PPCNONE, {RA0, RB}},
If you want to change the tlbilx entry to use 18 rather than 787, let me
know whether you want me to make the change or whether you (Edmar?) will
handle it.
I'll note the extended mnemonics should be moved before tlbilx so that the
disassembler will use them (if appropriate) instead of the base instruction.
Peter
^ permalink raw reply
* Re: [PATCH] powerpc: 85xx: Add PHY fixup to socrates board code
From: Anatolij Gustschin @ 2009-04-07 17:24 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev
In-Reply-To: <20090407143011.GA15727@oksana.dev.rtsoft.ru>
Anton Vorontsov wrote:
> On Tue, Apr 07, 2009 at 04:19:48PM +0200, Anatolij Gustschin wrote:
>> If the firmware missed to initialize the PHY correctly,
>> Linux may hang up on socrates while eth0/eth1 interface
>> startup (caused by continuous unacknowledged PHY interrupt).
>>
>> This patch adds PHY fixup to socrates platform code to
>> ensure the PHY is pre-initialized correctly. It is needed
>> to be compatible with older firmware.
>
> Is that really board-specific fixup, or can it be placed
> somewhere inside drivers/net/phy/marvell.c?
On this board the multi-PHY is configured to use shared IRQ pin
for both PHY ports. Placing this fixup in drivers/net/phy/marvell.c
as e.g. '.config_init' callback could be done, but this will add
more overhead as the fixup routine have to do more work:
acquire 'struct mii_bus' pointer and walk through all registered PHYs
searching for the PHY which use the same interrupt, then getting
the address of this PHY on the bus and disable and clear PHY irqs
by writing/reading to/from this PHY, (but only in the case it was
not already brought up and has interrupts enabled!) e.g.:
struct mii_bus *bus = phydev->bus;
int addr;
for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
struct phy_device *phy = bus->phy_map[addr];
if (addr != phydev->addr && bus->irq[addr] == phydev->irq &&
(phy->phy_id & 0x0ffffff0) == 0x01410cb0 &&
!(phy->interrupts & PHY_INTERRUPT_ENABLED)) {
int imask = phy_read(phy, MII_M1011_IMASK);
if (imask) {
phy_write(phy, 0x12, 0); /* disable */
phy_read(phy, 0x13); /* clear */
}
}
}
All this to allow support for multiple m88e1121 devices.
Otherwise, after registering first phy interrupt handler
and enabling interrupt pending irq on other PHY port or
other PHY device will lock up the board.
The fixup in this patch will only be done while mdio bus scan
before registering a PHY device.
> Has this fixup any effect after phy power down/up sequence?
> Otherwise you may encounter same problem after suspend/resume.
No, do we need it after phy power down/up sequence?
If each phy interrupt handler remains registered and the phy is
only stopped (phydev->state == PHY_HALTED) we don't have
this problem, i think. And we do not use PM on this board.
>> Signed-off-by: Anatolij Gustschin <agust@denx.de>
>> ---
>> arch/powerpc/platforms/85xx/socrates.c | 18 ++++++++++++++++++
>> 1 files changed, 18 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c
>> index d0e8443..2275a39 100644
>> --- a/arch/powerpc/platforms/85xx/socrates.c
>> +++ b/arch/powerpc/platforms/85xx/socrates.c
>> @@ -28,6 +28,7 @@
>> #include <linux/delay.h>
>> #include <linux/seq_file.h>
>> #include <linux/of_platform.h>
>> +#include <linux/phy.h>
>>
>> #include <asm/system.h>
>> #include <asm/time.h>
>> @@ -78,6 +79,21 @@ static void __init socrates_pic_init(void)
>> of_node_put(np);
>> }
>>
>> +static int socrates_m88e1121_fixup(struct phy_device *phydev)
>> +{
>> + int err;
>> +
>> + err = phy_write(phydev, 0x12, 0);
>
> Do you know the proper names for 0x12 and 0x13 registers
> on that chip?
Marvell PHY driver defines them as MII_M1011_IMASK and
MII_M1011_IEVENT respectively. I can use these defines
here too. The data sheet is under NDA.
Thanks,
Anatolij
^ permalink raw reply
* Re: AMCC 440EP phy detection
From: Stefan Roese @ 2009-04-07 17:18 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Eddie Dawydiuk
In-Reply-To: <fa686aa40904071011n22084931wc8900606fd62f167@mail.gmail.com>
On Tuesday 07 April 2009, Grant Likely wrote:
> Phy address 0 is the broadcast address. All phys will usually respond
> to address 0 accesses.
Not all. Some (e.g. LXT971) can be used at this address. But you're correct,
it's definitely a bad idea to use 0 as an PHY address.
Not sure how the Micrel reacts here. The datasheet could help...
Best regards,
Stefan
^ permalink raw reply
* Re: AMCC 440EP phy detection
From: Grant Likely @ 2009-04-07 17:11 UTC (permalink / raw)
To: Eddie Dawydiuk; +Cc: linuxppc-dev
In-Reply-To: <49DB8033.1090908@embeddedarm.com>
On Tue, Apr 7, 2009 at 9:32 AM, Eddie Dawydiuk <eddie@embeddedarm.com> wrot=
e:
> Hello,
>
> I'm working on a board based on the Yosemite AMCC 440EP eval board. I'm
> having some difficulty getting both network interfaces working. The first
> problem I found is the ibm_newemac driver was detecting the two phys at
> address 0 and 1 where we have them wired for addresses 1 and 3. As a resu=
lt
> I hardcoded the phy-address in the dts file. I then found I was able to
> receive and send data on eth1(phy-address 3) without incident. Although I
> found eth0 can receive data but I see no packets being transmitted(using =
a
> packet sniffer) and I see no indication from a software standpoint of any
> transmit failures. We are using Micrel KSZ8041FTL phys(RMII mode) where t=
he
> Yosemite board used Micrel KS8721BL phys. =A0I've reviewed the schematic =
and
> it appears both phys are connected identically and I've seen this same
> failure on multiple boards. I thought the fact that the driver detected a
> phy at address 0 might be a clue, but I can't make much of the clue. So I
> thought I'd post this info in the hopes someone else might have run into =
a
> similar problem or have a suggestion.
Phy address 0 is the broadcast address. All phys will usually respond
to address 0 accesses. Off the top of my head, It sounds like one PHY
is responding to addresses 0 & 1, and the other phy isn't responding
at all.
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH 3/4 v2] mtd/powerpc: Remove unused "device-width" property
From: Stefan Roese @ 2009-04-07 16:54 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, devicetree-discuss, linux-mtd
In-Reply-To: <49DB8271.8050501@freescale.com>
On Tuesday 07 April 2009, Scott Wood wrote:
> Stefan Roese wrote:
> > This property is unused. It's not handled as all by the physmap_of
> > driver. So let's remove it from the documentation.
> >
> > Signed-off-by: Stefan Roese <sr@denx.de>
> > CC: Grant Likely <grant.likely@secretlab.ca>
>
> The device tree describes the hardware, not what Linux happens to do
> with it at the moment.
>
> I'd rather keep it.
I find it rather confusing to "see" such bindings that are not supported. One
could expect something to happen/change after defining this property. So in
general I think adding unsupported properties to the Documentation is a bad
idea. But that's just my 2 cents. If the general opinion is to keep this
property, I'll keep it in of course.
Best regards,
Stefan
^ permalink raw reply
* Re: AMCC 440EP phy detection
From: Feng Kan @ 2009-04-07 16:47 UTC (permalink / raw)
To: Eddie Dawydiuk; +Cc: linuxppc-dev
In-Reply-To: <49DB8033.1090908@embeddedarm.com>
Hi Eddie:
Are you able to ping in u-boot? Sounded like you were only pinging in linux.
I would try the mii command in uboot. It seems like it detected the
phys. Try enable the
loopbacks at the different stages to see if the traffic is returning.
This excerise is
much easier in uboot than linux.
Feng Kan
AMCC Software
Eddie Dawydiuk wrote:
> Hello,
>
> I'm working on a board based on the Yosemite AMCC 440EP eval board. I'm having
> some difficulty getting both network interfaces working. The first problem I
> found is the ibm_newemac driver was detecting the two phys at address 0 and 1
> where we have them wired for addresses 1 and 3. As a result I hardcoded the
> phy-address in the dts file. I then found I was able to receive and send data on
> eth1(phy-address 3) without incident. Although I found eth0 can receive data but
> I see no packets being transmitted(using a packet sniffer) and I see no
> indication from a software standpoint of any transmit failures. We are using
> Micrel KSZ8041FTL phys(RMII mode) where the Yosemite board used Micrel KS8721BL
> phys. I've reviewed the schematic and it appears both phys are connected
> identically and I've seen this same failure on multiple boards. I thought the
> fact that the driver detected a phy at address 0 might be a clue, but I can't
> make much of the clue. So I thought I'd post this info in the hopes someone else
> might have run into a similar problem or have a suggestion.
>
>
^ permalink raw reply
* Re: [PATCH 3/4 v2] mtd/powerpc: Remove unused "device-width" property
From: Scott Wood @ 2009-04-07 16:42 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev, devicetree-discuss, linux-mtd
In-Reply-To: <1239093575-12147-1-git-send-email-sr@denx.de>
Stefan Roese wrote:
> This property is unused. It's not handled as all by the physmap_of
> driver. So let's remove it from the documentation.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> CC: Grant Likely <grant.likely@secretlab.ca>
The device tree describes the hardware, not what Linux happens to do
with it at the moment.
I'd rather keep it.
-Scott
^ permalink raw reply
* AMCC 440EP phy detection
From: Eddie Dawydiuk @ 2009-04-07 16:32 UTC (permalink / raw)
To: linuxppc-dev, Grant Likely
Hello,
I'm working on a board based on the Yosemite AMCC 440EP eval board. I'm having
some difficulty getting both network interfaces working. The first problem I
found is the ibm_newemac driver was detecting the two phys at address 0 and 1
where we have them wired for addresses 1 and 3. As a result I hardcoded the
phy-address in the dts file. I then found I was able to receive and send data on
eth1(phy-address 3) without incident. Although I found eth0 can receive data but
I see no packets being transmitted(using a packet sniffer) and I see no
indication from a software standpoint of any transmit failures. We are using
Micrel KSZ8041FTL phys(RMII mode) where the Yosemite board used Micrel KS8721BL
phys. I've reviewed the schematic and it appears both phys are connected
identically and I've seen this same failure on multiple boards. I thought the
fact that the driver detected a phy at address 0 might be a clue, but I can't
make much of the clue. So I thought I'd post this info in the hopes someone else
might have run into a similar problem or have a suggestion.
--
Best Regards,
________________________________________________________________
Eddie Dawydiuk, Technologic Systems | voice: (480) 837-5200
16525 East Laser Drive | fax: (480) 837-5300
Fountain Hills, AZ 85268 | web: www.embeddedARM.com
^ permalink raw reply
* Re: [PATCH v3 4/5] powerpc: i2c-mpc: document new FSL I2C bindings and cleanup
From: Grant Likely @ 2009-04-07 15:43 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: linuxppc-dev, devicetree-discuss, linux-i2c, Ben Dooks
In-Reply-To: <20090407082231.646648985@denx.de>
On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger <wg@grandegger.com> wro=
te:
> This patch documents the new bindings for the MPC I2C bus driver.
> Furthermore, it removes obsolete FSL device related definitions
> for I2C.
> It should go through the appropriate PowerPC maintainer(s) hands.
>
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> =A0Documentation/powerpc/dts-bindings/fsl/i2c.txt | =A0 46 ++++++++++++++=
++---------
> =A0include/linux/fsl_devices.h =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =
=A0 =A04 --
> =A02 files changed, 31 insertions(+), 19 deletions(-)
>
> Index: linux-2.6-galak/Documentation/powerpc/dts-bindings/fsl/i2c.txt
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- linux-2.6-galak.orig/Documentation/powerpc/dts-bindings/fsl/i2c.txt 2=
009-04-07 10:09:08.185721241 +0200
> +++ linux-2.6-galak/Documentation/powerpc/dts-bindings/fsl/i2c.txt =A0 =
=A0 =A02009-04-07 10:09:15.413719535 +0200
> @@ -7,8 +7,10 @@
>
> =A0Recommended properties :
>
> - - compatible : Should be "fsl-i2c" for parts compatible with
> - =A0 Freescale I2C specifications.
> + - compatible : compatibility list with 2 entries, the first should
> + =A0 be "fsl,CHIP-i2c" where CHIP is the name of a compatible processor,
> + =A0 e.g. mpc8313, mpc8543, mpc8544, mpc5200 or mpc5200b. The second one
> + =A0 should be "fsl-i2c".
> =A0- interrupts : <a b> where a is the interrupt number and b is a
> =A0 =A0field that represents an encoding of the sense and level
> =A0 =A0information for the interrupt. =A0This should be encoded based on
> @@ -16,17 +18,31 @@
> =A0 =A0controller you have.
> =A0- interrupt-parent : the phandle for the interrupt controller that
> =A0 =A0services interrupts for this device.
> - - dfsrr : boolean; if defined, indicates that this I2C device has
> - =A0 a digital filter sampling rate register
> - - fsl5200-clocking : boolean; if defined, indicated that this device
> - =A0 uses the FSL 5200 clocking mechanism.
> -
> -Example :
> - =A0 =A0 =A0 i2c@3000 {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 interrupt-parent =3D <40000>;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 interrupts =3D <1b 3>;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D <3000 18>;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 device_type =3D "i2c";
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =A0=3D "fsl-i2c";
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 dfsrr;
> + - fsl,preserve-clocking : boolean; if defined, the clock settings
> + =A0 from the bootloader are preserved (not touched).
> + - clock-frequency : desired I2C bus clock frequency in Hz.
> +
> +Examples :
> +
> + =A0 =A0 =A0 i2c@3d00 {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 #address-cells =3D <1>;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 #size-cells =3D <0>;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =3D "fsl,mpc5200b-i2c","fsl,mpc5=
200-i2c","fsl-i2c";
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 cell-index =3D <0>;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D <0x3d00 0x40>;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 interrupts =3D <2 15 0>;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 interrupt-parent =3D <&mpc5200_pic>;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 fsl,preserve-clocking;
> =A0 =A0 =A0 =A0};
> +
> + =A0 =A0 =A0 i2c@3100 {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 #address-cells =3D <1>;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 #size-cells =3D <0>;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 cell-index =3D <1>;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =3D "fsl,mpc8544-i2c", "fsl-i2c"=
;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D <0x3100 0x100>;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 interrupts =3D <43 2>;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 interrupt-parent =3D <&mpic>;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 clock-frequency =3D <400000>;
> + =A0 =A0 =A0 };
> +
> Index: linux-2.6-galak/include/linux/fsl_devices.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- linux-2.6-galak.orig/include/linux/fsl_devices.h =A0 =A02009-04-07 10=
:09:08.185721241 +0200
> +++ linux-2.6-galak/include/linux/fsl_devices.h 2009-04-07 10:09:15.41471=
9119 +0200
> @@ -43,10 +43,6 @@
> =A0*
> =A0*/
>
> -/* Flags related to I2C device features */
> -#define FSL_I2C_DEV_SEPARATE_DFSRR =A0 =A0 0x00000001
> -#define FSL_I2C_DEV_CLOCK_5200 =A0 =A0 =A0 =A0 0x00000002
> -
> =A0enum fsl_usb2_operating_modes {
> =A0 =A0 =A0 =A0FSL_USB2_MPH_HOST,
> =A0 =A0 =A0 =A0FSL_USB2_DR_HOST,
>
>
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH v3 5/5] powerpc/85xx: i2c-mpc: use new I2C bindings for the Socates board
From: Grant Likely @ 2009-04-07 15:43 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: linuxppc-dev, devicetree-discuss, linux-i2c, Ben Dooks
In-Reply-To: <20090407082231.803193635@denx.de>
On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger <wg@grandegger.com> wro=
te:
> Preserve I2C clock settings for the Socrates MPC8544 board.
I had thought that the preserve-clocking property was intended for
older boards that don't currently have any method of getting the clock
setting out of u-boot. Since Socrates is a new board, U-Boot should
probably be made to fill in the real clock rate setting.
g.
>
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
> ---
> =A0arch/powerpc/boot/dts/socrates.dts | =A0 =A08 ++++----
> =A01 file changed, 4 insertions(+), 4 deletions(-)
>
> Index: linux-2.6-galak/arch/powerpc/boot/dts/socrates.dts
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- linux-2.6-galak.orig/arch/powerpc/boot/dts/socrates.dts =A0 =A0 2009-=
04-07 10:09:07.161718915 +0200
> +++ linux-2.6-galak/arch/powerpc/boot/dts/socrates.dts =A02009-04-07 10:0=
9:16.207719258 +0200
> @@ -79,11 +79,11 @@
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#address-cells =3D <1>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#size-cells =3D <0>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cell-index =3D <0>;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =3D "fsl-i2c";
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =3D "fsl,mpc8544=
-i2c", "fsl-i2c";
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0x3000 0x100>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <43 2>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&mpi=
c>;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dfsrr;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fsl,preserve-clocking;
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dtt@28 {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible=
=3D "winbond,w83782d";
> @@ -111,11 +111,11 @@
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#address-cells =3D <1>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#size-cells =3D <0>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cell-index =3D <1>;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =3D "fsl-i2c";
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =3D "fsl,mpc8544=
-i2c", "fsl-i2c";
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0x3100 0x100>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <43 2>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&mpi=
c>;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dfsrr;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fsl,preserve-clocking;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0enet0: ethernet@24000 {
>
>
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH v3 2/5] i2c: i2c-mpc: use dev based printout function
From: Grant Likely @ 2009-04-07 15:37 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: linuxppc-dev, devicetree-discuss, linux-i2c, Ben Dooks
In-Reply-To: <20090407082231.335327816@denx.de>
On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger <wg@grandegger.com> wro=
te:
> This patch used the dev_dbg, dev_err, etc. functions for debug
> and error output instead of printk and pr_debug.
>
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> =A0drivers/i2c/busses/i2c-mpc.c | =A0 31 +++++++++++++++++--------------
> =A01 file changed, 17 insertions(+), 14 deletions(-)
>
> Index: linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- linux-2.6-galak.orig/drivers/i2c/busses/i2c-mpc.c =A0 2009-04-07 10:0=
9:13.271719088 +0200
> +++ linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c =A0 =A0 =A0 =A02009-04-0=
7 10:09:14.012720756 +0200
> @@ -50,6 +50,7 @@
> =A0#define CSR_RXAK 0x01
>
> =A0struct mpc_i2c {
> + =A0 =A0 =A0 struct device *dev;
> =A0 =A0 =A0 =A0void __iomem *base;
> =A0 =A0 =A0 =A0u32 interrupt;
> =A0 =A0 =A0 =A0wait_queue_head_t queue;
> @@ -104,7 +105,7 @@
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0while (!(readb(i2c->base + MPC_I2C_SR) & C=
SR_MIF)) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0schedule();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (time_after(jiffies, or=
ig_jiffies + timeout)) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pr_debug("I=
2C: timeout\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_dbg(i2c=
->dev, "timeout\n");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0writeccr(i=
2c, 0);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0result =3D=
-EIO;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;
> @@ -118,7 +119,7 @@
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(i2c->interrupt & CSR_MIF)=
, timeout);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (unlikely(!(i2c->interrupt & CSR_MIF)))=
{
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pr_debug("I2C: wait timeout=
\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_dbg(i2c->dev, "wait tim=
eout\n");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0writeccr(i2c, 0);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0result =3D -ETIMEDOUT;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> @@ -131,17 +132,17 @@
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return result;
>
> =A0 =A0 =A0 =A0if (!(x & CSR_MCF)) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 pr_debug("I2C: unfinished\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_dbg(i2c->dev, "unfinished\n");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -EIO;
> =A0 =A0 =A0 =A0}
>
> =A0 =A0 =A0 =A0if (x & CSR_MAL) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 pr_debug("I2C: MAL\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_dbg(i2c->dev, "MAL\n");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -EIO;
> =A0 =A0 =A0 =A0}
>
> =A0 =A0 =A0 =A0if (writing && (x & CSR_RXAK)) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 pr_debug("I2C: No RXAK\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_dbg(i2c->dev, "No RXAK\n");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* generate stop */
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0writeccr(i2c, CCR_MEN);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -EIO;
> @@ -263,12 +264,12 @@
> =A0 =A0 =A0 =A0/* Allow bus up to 1s to become not busy */
> =A0 =A0 =A0 =A0while (readb(i2c->base + MPC_I2C_SR) & CSR_MBB) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (signal_pending(current)) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pr_debug("I2C: Interrupted\=
n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_dbg(i2c->dev, "Interrup=
ted\n");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0writeccr(i2c, 0);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -EINTR;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (time_after(jiffies, orig_jiffies + HZ)=
) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pr_debug("I2C: timeout\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_dbg(i2c->dev, "timeout\=
n");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (readb(i2c->base + MPC_=
I2C_SR) =3D=3D
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(CSR_MCF | CSR_MBB=
| CSR_RXAK))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mpc_i2c_fi=
xup(i2c);
> @@ -279,9 +280,10 @@
>
> =A0 =A0 =A0 =A0for (i =3D 0; ret >=3D 0 && i < num; i++) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pmsg =3D &msgs[i];
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 pr_debug("Doing %s %d bytes to 0x%02x - %d =
of %d messages\n",
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pmsg->flags & I2C_M_RD ?=
"read" : "write",
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pmsg->len, pmsg->addr, i=
+ 1, num);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_dbg(i2c->dev,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "Doing %s %d bytes to 0x%02=
x - %d of %d messages\n",
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pmsg->flags & I2C_M_RD ? "r=
ead" : "write",
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pmsg->len, pmsg->addr, i + =
1, num);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (pmsg->flags & I2C_M_RD)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ret =3D
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mpc_read(i2c, pmsg=
->addr, pmsg->buf, pmsg->len, i);
> @@ -320,6 +322,8 @@
> =A0 =A0 =A0 =A0if (!i2c)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -ENOMEM;
>
> + =A0 =A0 =A0 i2c->dev =3D &op->dev; /* for debug and error output */
> +
> =A0 =A0 =A0 =A0if (of_get_property(op->node, "dfsrr", NULL))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0i2c->flags |=3D FSL_I2C_DEV_SEPARATE_DFSRR=
;
>
> @@ -331,7 +335,7 @@
>
> =A0 =A0 =A0 =A0i2c->base =3D of_iomap(op->node, 0);
> =A0 =A0 =A0 =A0if (!i2c->base) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR "i2c-mpc - failed to map co=
ntroller\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(i2c->dev, "failed to map controller=
\n");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0result =3D -ENOMEM;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto fail_map;
> =A0 =A0 =A0 =A0}
> @@ -341,8 +345,7 @@
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0result =3D request_irq(i2c->irq, mpc_i2c_i=
sr,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 I=
RQF_SHARED, "i2c-mpc", i2c);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (result < 0) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"i2c-mpc - f=
ailed to attach interrupt\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(i2c->dev, "failed t=
o attach interrupt\n");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto fail_request;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0}
> @@ -357,7 +360,7 @@
>
> =A0 =A0 =A0 =A0result =3D i2c_add_adapter(&i2c->adap);
> =A0 =A0 =A0 =A0if (result < 0) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR "i2c-mpc - failed to add ad=
apter\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(i2c->dev, "failed to add adapter\n"=
);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto fail_add;
> =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0of_register_i2c_devices(&i2c->adap, op->node);
>
>
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH v3 1/5] i2c: i2c-mpc: various coding style fixes
From: Grant Likely @ 2009-04-07 15:36 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: linuxppc-dev, devicetree-discuss, linux-i2c, Ben Dooks
In-Reply-To: <20090407082231.177941706@denx.de>
On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger <wg@grandegger.com> wro=
te:
> Fix errors reported by checkpatch (indention, long lines, trailing
> white space, etc.).
>
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> =A0drivers/i2c/busses/i2c-mpc.c | =A0 35 ++++++++++++++++++--------------=
---
> =A01 file changed, 18 insertions(+), 17 deletions(-)
>
> Index: linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- linux-2.6-galak.orig/drivers/i2c/busses/i2c-mpc.c =A0 2009-04-07 10:0=
9:09.400719216 +0200
> +++ linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c =A0 =A0 =A0 =A02009-04-0=
7 10:09:13.271719088 +0200
> @@ -20,7 +20,7 @@
> =A0#include <linux/of_platform.h>
> =A0#include <linux/of_i2c.h>
>
> -#include <asm/io.h>
> +#include <linux/io.h>
> =A0#include <linux/fsl_devices.h>
> =A0#include <linux/i2c.h>
> =A0#include <linux/interrupt.h>
> @@ -28,10 +28,10 @@
>
> =A0#define DRV_NAME "mpc-i2c"
>
> -#define MPC_I2C_FDR =A0 =A00x04
> -#define MPC_I2C_CR =A0 =A0 0x08
> -#define MPC_I2C_SR =A0 =A0 0x0c
> -#define MPC_I2C_DR =A0 =A0 0x10
> +#define MPC_I2C_FDR =A0 0x04
> +#define MPC_I2C_CR =A0 =A00x08
> +#define MPC_I2C_SR =A0 =A00x0c
> +#define MPC_I2C_DR =A0 =A00x10
> =A0#define MPC_I2C_DFSRR 0x14
>
> =A0#define CCR_MEN =A00x80
> @@ -58,7 +58,7 @@
> =A0 =A0 =A0 =A0u32 flags;
> =A0};
>
> -static __inline__ void writeccr(struct mpc_i2c *i2c, u32 x)
> +static inline void writeccr(struct mpc_i2c *i2c, u32 x)
> =A0{
> =A0 =A0 =A0 =A0writeb(x, i2c->base + MPC_I2C_CR);
> =A0}
> @@ -100,8 +100,7 @@
> =A0 =A0 =A0 =A0u32 x;
> =A0 =A0 =A0 =A0int result =3D 0;
>
> - =A0 =A0 =A0 if (i2c->irq =3D=3D NO_IRQ)
> - =A0 =A0 =A0 {
> + =A0 =A0 =A0 if (i2c->irq =3D=3D NO_IRQ) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0while (!(readb(i2c->base + MPC_I2C_SR) & C=
SR_MIF)) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0schedule();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (time_after(jiffies, or=
ig_jiffies + timeout)) {
> @@ -176,7 +175,7 @@
> =A0}
>
> =A0static int mpc_write(struct mpc_i2c *i2c, int target,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0const u8 * data, int length, int=
restart)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0const u8 *data, int length, int =
restart)
> =A0{
> =A0 =A0 =A0 =A0int i, result;
> =A0 =A0 =A0 =A0unsigned timeout =3D i2c->adap.timeout;
> @@ -207,7 +206,7 @@
> =A0}
>
> =A0static int mpc_read(struct mpc_i2c *i2c, int target,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 u8 * data, int length, int restart)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 u8 *data, int length, int restart)
> =A0{
> =A0 =A0 =A0 =A0unsigned timeout =3D i2c->adap.timeout;
> =A0 =A0 =A0 =A0int i, result;
> @@ -311,7 +310,8 @@
> =A0 =A0 =A0 =A0.timeout =3D HZ,
> =A0};
>
> -static int __devinit fsl_i2c_probe(struct of_device *op, const struct of=
_device_id *match)
> +static int __devinit fsl_i2c_probe(struct of_device *op,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cons=
t struct of_device_id *match)
> =A0{
> =A0 =A0 =A0 =A0int result =3D 0;
> =A0 =A0 =A0 =A0struct mpc_i2c *i2c;
> @@ -341,11 +341,12 @@
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0result =3D request_irq(i2c->irq, mpc_i2c_i=
sr,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 I=
RQF_SHARED, "i2c-mpc", i2c);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (result < 0) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR "i2c-mpc - =
failed to attach interrupt\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"i2c-mpc - f=
ailed to attach interrupt\n");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto fail_request;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0}
> -
> +
> =A0 =A0 =A0 =A0mpc_i2c_setclock(i2c);
>
> =A0 =A0 =A0 =A0dev_set_drvdata(&op->dev, i2c);
> @@ -368,7 +369,7 @@
> =A0 =A0 =A0 =A0free_irq(i2c->irq, i2c);
> =A0fail_request:
> =A0 =A0 =A0 =A0irq_dispose_mapping(i2c->irq);
> - =A0 =A0 =A0 iounmap(i2c->base);
> + =A0 =A0 =A0 iounmap(i2c->base);
> =A0fail_map:
> =A0 =A0 =A0 =A0kfree(i2c);
> =A0 =A0 =A0 =A0return result;
> @@ -414,7 +415,7 @@
>
> =A0 =A0 =A0 =A0rv =3D of_register_platform_driver(&mpc_i2c_driver);
> =A0 =A0 =A0 =A0if (rv)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR DRV_NAME
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR DRV_NAME
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 " of_register_platform_driver=
failed (%i)\n", rv);
> =A0 =A0 =A0 =A0return rv;
> =A0}
> @@ -428,6 +429,6 @@
> =A0module_exit(fsl_i2c_exit);
>
> =A0MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>");
> -MODULE_DESCRIPTION
> - =A0 =A0("I2C-Bus adapter for MPC107 bridge and MPC824x/85xx/52xx proces=
sors");
> +MODULE_DESCRIPTION("I2C-Bus adapter for MPC107 bridge and "
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"MPC824x/85xx/52xx processors");
> =A0MODULE_LICENSE("GPL");
>
>
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH v3 3/5] i2c: i2c-mpc: make I2C bus speed configurable
From: Grant Likely @ 2009-04-07 15:36 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: linuxppc-dev, devicetree-discuss, linux-i2c, Ben Dooks
In-Reply-To: <20090407082231.500525932@denx.de>
On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger <wg@grandegger.com> wro=
te:
> This patch makes the I2C bus speed configurable by using the I2C node
> property "clock-frequency". If the property is not defined, the old
> fixed clock settings will be used for backward comptibility.
>
> The generic I2C clock properties, especially the CPU-specific source
> clock pre-scaler are defined via the OF match table:
>
> =A0static const struct of_device_id mpc_i2c_of_match[] =3D {
> =A0 =A0 =A0 =A0...
> =A0 =A0 =A0 =A0{.compatible =3D "fsl,mpc8543-i2c",
> =A0 =A0 =A0 =A0 .data =3D &(struct fsl_i2c_match_data) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.setclock =3D mpc_i2c_setc=
lock_8xxx,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.prescaler =3D 2,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0},
> =A0 =A0 =A0 =A0},
>
> The "data" field defines the relevant I2C setclock function and the
> relevant pre-scaler for the I2C source clock frequency.
>
> It uses arch-specific tables and functions to determine resonable
> Freqency Divider Register (fdr) values for MPC83xx, MPC85xx, MPC86xx,
> MPC5200 and MPC5200B.
>
> The i2c->flags field and the corresponding FSL_I2C_DEV_* definitions
> have been removed as they are obsolete.
>
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
I haven't tested it, but it looks good and I trust Wolfgang.
Acked-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> =A0drivers/i2c/busses/i2c-mpc.c | =A0262 ++++++++++++++++++++++++++++++++=
+++++++----
> =A01 file changed, 242 insertions(+), 20 deletions(-)
>
> Index: linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- linux-2.6-galak.orig/drivers/i2c/busses/i2c-mpc.c =A0 2009-04-07 10:0=
9:14.012720756 +0200
> +++ linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c =A0 =A0 =A0 =A02009-04-0=
7 10:09:14.581719146 +0200
> @@ -26,6 +26,9 @@
> =A0#include <linux/interrupt.h>
> =A0#include <linux/delay.h>
>
> +#include <asm/mpc52xx.h>
> +#include <sysdev/fsl_soc.h>
> +
> =A0#define DRV_NAME "mpc-i2c"
>
> =A0#define MPC_I2C_FDR =A0 0x04
> @@ -56,7 +59,18 @@
> =A0 =A0 =A0 =A0wait_queue_head_t queue;
> =A0 =A0 =A0 =A0struct i2c_adapter adap;
> =A0 =A0 =A0 =A0int irq;
> - =A0 =A0 =A0 u32 flags;
> +};
> +
> +struct mpc_i2c_divider {
> + =A0 =A0 =A0 u16 divider;
> + =A0 =A0 =A0 u16 fdr; =A0 =A0 =A0 =A0/* including dfsrr */
> +};
> +
> +struct mpc_i2c_match_data {
> + =A0 =A0 =A0 void (*setclock)(struct device_node *node,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct mpc_i2c *i2c,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0u32 clock, u32 prescaler=
);
> + =A0 =A0 =A0 u32 prescaler;
> =A0};
>
> =A0static inline void writeccr(struct mpc_i2c *i2c, u32 x)
> @@ -150,17 +164,180 @@
> =A0 =A0 =A0 =A0return 0;
> =A0}
>
> -static void mpc_i2c_setclock(struct mpc_i2c *i2c)
> +#ifdef CONFIG_PPC_52xx
> +static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] =3D {
> + =A0 =A0 =A0 {20, 0x20}, {22, 0x21}, {24, 0x22}, {26, 0x23},
> + =A0 =A0 =A0 {28, 0x24}, {30, 0x01}, {32, 0x25}, {34, 0x02},
> + =A0 =A0 =A0 {36, 0x26}, {40, 0x27}, {44, 0x04}, {48, 0x28},
> + =A0 =A0 =A0 {52, 0x63}, {56, 0x29}, {60, 0x41}, {64, 0x2a},
> + =A0 =A0 =A0 {68, 0x07}, {72, 0x2b}, {80, 0x2c}, {88, 0x09},
> + =A0 =A0 =A0 {96, 0x2d}, {104, 0x0a}, {112, 0x2e}, {120, 0x81},
> + =A0 =A0 =A0 {128, 0x2f}, {136, 0x47}, {144, 0x0c}, {160, 0x30},
> + =A0 =A0 =A0 {176, 0x49}, {192, 0x31}, {208, 0x4a}, {224, 0x32},
> + =A0 =A0 =A0 {240, 0x0f}, {256, 0x33}, {272, 0x87}, {288, 0x10},
> + =A0 =A0 =A0 {320, 0x34}, {352, 0x89}, {384, 0x35}, {416, 0x8a},
> + =A0 =A0 =A0 {448, 0x36}, {480, 0x13}, {512, 0x37}, {576, 0x14},
> + =A0 =A0 =A0 {640, 0x38}, {768, 0x39}, {896, 0x3a}, {960, 0x17},
> + =A0 =A0 =A0 {1024, 0x3b}, {1152, 0x18}, {1280, 0x3c}, {1536, 0x3d},
> + =A0 =A0 =A0 {1792, 0x3e}, {1920, 0x1b}, {2048, 0x3f}, {2304, 0x1c},
> + =A0 =A0 =A0 {2560, 0x1d}, {3072, 0x1e}, {3584, 0x7e}, {3840, 0x1f},
> + =A0 =A0 =A0 {4096, 0x7f}, {4608, 0x5c}, {5120, 0x5d}, {6144, 0x5e},
> + =A0 =A0 =A0 {7168, 0xbe}, {7680, 0x5f}, {8192, 0xbf}, {9216, 0x9c},
> + =A0 =A0 =A0 {10240, 0x9d}, {12288, 0x9e}, {15360, 0x9f}
> +};
> +
> +int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int presca=
ler)
> +{
> + =A0 =A0 =A0 const struct mpc52xx_i2c_divider *div =3D NULL;
> + =A0 =A0 =A0 unsigned int pvr =3D mfspr(SPRN_PVR);
> + =A0 =A0 =A0 u32 divider;
> + =A0 =A0 =A0 int i;
> +
> + =A0 =A0 =A0 if (!clock)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -EINVAL;
> +
> + =A0 =A0 =A0 /* Determine divider value */
> + =A0 =A0 =A0 divider =3D mpc52xx_find_ipb_freq(node) / clock;
> +
> + =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0* We want to choose an FDR/DFSR that generates an I2C bu=
s speed that
> + =A0 =A0 =A0 =A0* is equal to or lower than the requested speed.
> + =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 for (i =3D 0; i < ARRAY_SIZE(mpc52xx_i2c_dividers); i++) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 div =3D &mpc_i2c_dividers_52xx[i];
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Old MPC5200 rev A CPUs do not support th=
e high bits */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (div->fdr & 0xc0 && pvr =3D=3D 0x8082201=
1)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (div->divider >=3D divider)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 return div ? (int)div->fdr : -EINVAL;
> +}
> +
> +static void mpc_i2c_setclock_52xx(struct device_node *node,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct =
mpc_i2c *i2c,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 u32 clo=
ck, u32 prescaler)
> +{
> + =A0 =A0 =A0 int fdr =3D mpc52xx_i2c_get_fdr(node, clock, prescaler);
> +
> + =A0 =A0 =A0 if (fdr < 0)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 fdr =3D 0x3f; /* backward compatibility */
> + =A0 =A0 =A0 writeb(fdr & 0xff, i2c->base + MPC_I2C_FDR);
> + =A0 =A0 =A0 dev_info(i2c->dev, "clock %d Hz (fdr=3D%d)\n", clock, fdr);
> +}
> +#else /* !CONFIG_PPC_52xx */
> +static void mpc_i2c_setclock_52xx(struct device_node *node,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct =
mpc_i2c *i2c,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 u32 clo=
ck, u32 prescaler)
> +{
> +}
> +#endif /* CONFIG_PPC_52xx*/
> +
> +#ifdef CONFIG_FSL_SOC
> +static const struct mpc_i2c_divider mpc_i2c_dividers_8xxx[] =3D {
> + =A0 =A0 =A0 {160, 0x0120}, {192, 0x0121}, {224, 0x0122}, {256, 0x0123},
> + =A0 =A0 =A0 {288, 0x0100}, {320, 0x0101}, {352, 0x0601}, {384, 0x0102},
> + =A0 =A0 =A0 {416, 0x0602}, {448, 0x0126}, {480, 0x0103}, {512, 0x0127},
> + =A0 =A0 =A0 {544, 0x0b03}, {576, 0x0104}, {608, 0x1603}, {640, 0x0105},
> + =A0 =A0 =A0 {672, 0x2003}, {704, 0x0b05}, {736, 0x2b03}, {768, 0x0106},
> + =A0 =A0 =A0 {800, 0x3603}, {832, 0x0b06}, {896, 0x012a}, {960, 0x0107},
> + =A0 =A0 =A0 {1024, 0x012b}, {1088, 0x1607}, {1152, 0x0108}, {1216, 0x2b=
07},
> + =A0 =A0 =A0 {1280, 0x0109}, {1408, 0x1609}, {1536, 0x010a}, {1664, 0x16=
0a},
> + =A0 =A0 =A0 {1792, 0x012e}, {1920, 0x010b}, {2048, 0x012f}, {2176, 0x2b=
0b},
> + =A0 =A0 =A0 {2304, 0x010c}, {2560, 0x010d}, {2816, 0x2b0d}, {3072, 0x01=
0e},
> + =A0 =A0 =A0 {3328, 0x2b0e}, {3584, 0x0132}, {3840, 0x010f}, {4096, 0x01=
33},
> + =A0 =A0 =A0 {4608, 0x0110}, {5120, 0x0111}, {6144, 0x0112}, {7168, 0x01=
36},
> + =A0 =A0 =A0 {7680, 0x0113}, {8192, 0x0137}, {9216, 0x0114}, {10240, 0x0=
115},
> + =A0 =A0 =A0 {12288, 0x0116}, {14336, 0x013a}, {15360, 0x0117}, {16384, =
0x013b},
> + =A0 =A0 =A0 {18432, 0x0118}, {20480, 0x0119}, {24576, 0x011a}, {28672, =
0x013e},
> + =A0 =A0 =A0 {30720, 0x011b}, {32768, 0x013f}, {36864, 0x011c}, {40960, =
0x011d},
> + =A0 =A0 =A0 {49152, 0x011e}, {61440, 0x011f}
> +};
> +
> +u32 mpc_i2c_get_sec_cfg_8xxx(void)
> +{
> + =A0 =A0 =A0 struct device_node *node =3D NULL;
> + =A0 =A0 =A0 u32 __iomem *reg;
> + =A0 =A0 =A0 u32 val =3D 0;
> +
> + =A0 =A0 =A0 node =3D of_find_node_by_name(NULL, "global-utilities");
> + =A0 =A0 =A0 if (node) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 const u32 *prop =3D of_get_property(node, "=
reg", NULL);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (prop) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Map and check POR Devi=
ce Status Register 2
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* (PORDEVSR2) at 0xE0014
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D ioremap(get_immrbas=
e() + *prop + 0x14, 0x4);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!reg)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN=
_ERR
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0"Error: couldn't map PORDEVSR2\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 val =3D in_=
be32(reg) & 0x00000080; /* sec-cfg */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 iounmap(reg);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> + =A0 =A0 =A0 }
> + =A0 =A0 =A0 if (node)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_node_put(node);
> +
> + =A0 =A0 =A0 return val;
> +}
> +
> +int mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock, u32 presca=
ler)
> +{
> + =A0 =A0 =A0 const struct mpc_i2c_divider *div =3D NULL;
> + =A0 =A0 =A0 u32 divider;
> + =A0 =A0 =A0 int i;
> +
> + =A0 =A0 =A0 if (!clock)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -EINVAL;
> +
> + =A0 =A0 =A0 /* Determine proper divider value */
> + =A0 =A0 =A0 if (of_device_is_compatible(node, "fsl,mpc8544-i2c"))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 prescaler =3D mpc_i2c_get_sec_cfg_8xxx() ? =
3 : 2;
> + =A0 =A0 =A0 if (!prescaler)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 prescaler =3D 1;
> +
> + =A0 =A0 =A0 divider =3D fsl_get_sys_freq() / clock / prescaler;
> +
> + =A0 =A0 =A0 pr_debug("I2C: src_clock=3D%d clock=3D%d divider=3D%d\n",
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fsl_get_sys_freq(), clock, divider);
> +
> + =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0* We want to choose an FDR/DFSR that generates an I2C bu=
s speed that
> + =A0 =A0 =A0 =A0* is equal to or lower than the requested speed.
> + =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 for (i =3D 0; i < ARRAY_SIZE(mpc_i2c_dividers_8xxx); i++) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 div =3D &mpc_i2c_dividers_8xxx[i];
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (div->divider >=3D divider)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 return div ? (int)div->fdr : -EINVAL;
> +}
> +
> +static void mpc_i2c_setclock_8xxx(struct device_node *node,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct =
mpc_i2c *i2c,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 u32 clo=
ck, u32 prescaler)
> +{
> + =A0 =A0 =A0 int fdr =3D mpc_i2c_get_fdr_8xxx(node, clock, prescaler);
> +
> + =A0 =A0 =A0 if (fdr < 0)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 fdr =3D 0x1031; /* backward compatibility *=
/
> + =A0 =A0 =A0 writeb(fdr & 0xff, i2c->base + MPC_I2C_FDR);
> + =A0 =A0 =A0 writeb((fdr >> 8) & 0xff, i2c->base + MPC_I2C_DFSRR);
> + =A0 =A0 =A0 dev_info(i2c->dev, "clock %d Hz (dfsrr=3D%d fdr=3D%d)\n",
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0clock, fdr >> 8, fdr & 0xff);
> +}
> +
> +#else /* !CONFIG_FSL_SOC */
> +static void mpc_i2c_setclock_8xxx(struct device_node *node,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct =
mpc_i2c *i2c,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 u32 clo=
ck, u32 prescaler)
> =A0{
> - =A0 =A0 =A0 /* Set clock and filters */
> - =A0 =A0 =A0 if (i2c->flags & FSL_I2C_DEV_SEPARATE_DFSRR) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 writeb(0x31, i2c->base + MPC_I2C_FDR);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 writeb(0x10, i2c->base + MPC_I2C_DFSRR);
> - =A0 =A0 =A0 } else if (i2c->flags & FSL_I2C_DEV_CLOCK_5200)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 writeb(0x3f, i2c->base + MPC_I2C_FDR);
> - =A0 =A0 =A0 else
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 writel(0x1031, i2c->base + MPC_I2C_FDR);
> =A0}
> +#endif /* CONFIG_FSL_SOC */
>
> =A0static void mpc_i2c_start(struct mpc_i2c *i2c)
> =A0{
> @@ -315,8 +492,11 @@
> =A0static int __devinit fsl_i2c_probe(struct of_device *op,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const=
struct of_device_id *match)
> =A0{
> - =A0 =A0 =A0 int result =3D 0;
> =A0 =A0 =A0 =A0struct mpc_i2c *i2c;
> + =A0 =A0 =A0 const u32 *prop;
> + =A0 =A0 =A0 u32 clock =3D 0;
> + =A0 =A0 =A0 int result =3D 0;
> + =A0 =A0 =A0 int plen;
>
> =A0 =A0 =A0 =A0i2c =3D kzalloc(sizeof(*i2c), GFP_KERNEL);
> =A0 =A0 =A0 =A0if (!i2c)
> @@ -324,13 +504,6 @@
>
> =A0 =A0 =A0 =A0i2c->dev =3D &op->dev; /* for debug and error output */
>
> - =A0 =A0 =A0 if (of_get_property(op->node, "dfsrr", NULL))
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 i2c->flags |=3D FSL_I2C_DEV_SEPARATE_DFSRR;
> -
> - =A0 =A0 =A0 if (of_device_is_compatible(op->node, "fsl,mpc5200-i2c") ||
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_device_is_compatible(op-=
>node, "mpc5200-i2c"))
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 i2c->flags |=3D FSL_I2C_DEV_CLOCK_5200;
> -
> =A0 =A0 =A0 =A0init_waitqueue_head(&i2c->queue);
>
> =A0 =A0 =A0 =A0i2c->base =3D of_iomap(op->node, 0);
> @@ -350,7 +523,22 @@
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0}
>
> - =A0 =A0 =A0 mpc_i2c_setclock(i2c);
> + =A0 =A0 =A0 if (!of_get_property(op->node, "fsl,preserve-clocking", NUL=
L)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 prop =3D of_get_property(op->node, "clock-f=
requency", &plen);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (prop && plen =3D=3D sizeof(u32))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 clock =3D *prop;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (match->data) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct mpc_i2c_match_data *=
data =3D
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (struct mpc=
_i2c_match_data *)match->data;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 data->setclock(op->node, i2=
c, clock, data->prescaler);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Backwards compatibility =
*/
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (of_get_property(op->nod=
e, "dfsrr", NULL))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mpc_i2c_set=
clock_8xxx(op->node, i2c,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 clock, 0);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> + =A0 =A0 =A0 }
>
> =A0 =A0 =A0 =A0dev_set_drvdata(&op->dev, i2c);
>
> @@ -395,9 +583,43 @@
> =A0};
>
> =A0static const struct of_device_id mpc_i2c_of_match[] =3D {
> - =A0 =A0 =A0 {.compatible =3D "fsl-i2c",},
> + =A0 =A0 =A0 {.compatible =3D "mpc5200-i2c",
> + =A0 =A0 =A0 =A0.data =3D &(struct mpc_i2c_match_data) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .setclock =3D mpc_i2c_setcl=
ock_52xx,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 },
> + =A0 =A0 =A0 },
> + =A0 =A0 =A0 {.compatible =3D "fsl,mpc5200b-i2c",
> + =A0 =A0 =A0 =A0.data =3D &(struct mpc_i2c_match_data) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .setclock =3D mpc_i2c_setcl=
ock_52xx,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 },
> + =A0 =A0 =A0 },
> + =A0 =A0 =A0 {.compatible =3D "fsl,mpc5200-i2c",
> + =A0 =A0 =A0 =A0.data =3D &(struct mpc_i2c_match_data) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .setclock =3D mpc_i2c_setcl=
ock_52xx,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 },
> + =A0 =A0 =A0 },
> + =A0 =A0 =A0 {.compatible =3D "fsl,mpc8313-i2c",
> + =A0 =A0 =A0 =A0.data =3D &(struct mpc_i2c_match_data) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .setclock =3D mpc_i2c_setcl=
ock_8xxx,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 },
> + =A0 =A0 =A0 },
> + =A0 =A0 =A0 {.compatible =3D "fsl,mpc8543-i2c",
> + =A0 =A0 =A0 =A0.data =3D &(struct mpc_i2c_match_data) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .setclock =3D mpc_i2c_setcl=
ock_8xxx,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .prescaler =3D 2,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 },
> + =A0 =A0 =A0 },
> + =A0 =A0 =A0 {.compatible =3D "fsl,mpc8544-i2c",
> + =A0 =A0 =A0 =A0.data =3D &(struct mpc_i2c_match_data) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .setclock =3D mpc_i2c_setcl=
ock_8xxx,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .prescaler =3D 3,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 },
> + =A0 =A0 =A0 /* Backward compatibility */
> + =A0 =A0 =A0 },
> + =A0 =A0 =A0 {.compatible =3D "fsl-i2c", },
> =A0 =A0 =A0 =A0{},
> =A0};
> +
> =A0MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);
>
>
>
>
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* [PATCH] powerpc/4xx: Sequoia: Enable NAND support
From: Stefan Roese @ 2009-04-07 15:31 UTC (permalink / raw)
To: linuxppc-dev
Now that the 4xx NAND driver is available again in arch/powerpc, let's
enable it on Sequoia. This patch also disables the early debug messages
(CONFIG_PPC_EARLY_DEBUG) in the Sequoia defconfig.
Signed-off-by: Stefan Roese <sr@denx.de>
---
arch/powerpc/boot/dts/sequoia.dts | 22 ++++++
arch/powerpc/configs/44x/sequoia_defconfig | 109 ++++++++++++++++++----------
2 files changed, 94 insertions(+), 37 deletions(-)
diff --git a/arch/powerpc/boot/dts/sequoia.dts b/arch/powerpc/boot/dts/sequoia.dts
index 43cc68b..739dd0d 100644
--- a/arch/powerpc/boot/dts/sequoia.dts
+++ b/arch/powerpc/boot/dts/sequoia.dts
@@ -199,6 +199,28 @@
};
};
+ ndfc@3,0 {
+ compatible = "ibm,ndfc";
+ reg = <0x00000003 0x00000000 0x00002000>;
+ ccr = <0x00001000>;
+ bank-settings = <0x80002222>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ nand {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x00000000 0x00084000>;
+ };
+ partition@84000 {
+ label = "user";
+ reg = <0x00000000 0x01f7c000>;
+ };
+ };
+ };
};
UART0: serial@ef600300 {
diff --git a/arch/powerpc/configs/44x/sequoia_defconfig b/arch/powerpc/configs/44x/sequoia_defconfig
index a921fe3..0dd7d3b 100644
--- a/arch/powerpc/configs/44x/sequoia_defconfig
+++ b/arch/powerpc/configs/44x/sequoia_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.29-rc2
-# Tue Jan 20 08:22:45 2009
+# Linux kernel version: 2.6.29
+# Tue Apr 7 17:04:52 2009
#
# CONFIG_PPC64 is not set
@@ -57,6 +57,7 @@ CONFIG_GENERIC_BUG=y
CONFIG_PPC_DCR_NATIVE=y
# CONFIG_PPC_DCR_MMIO is not set
CONFIG_PPC_DCR=y
+CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
#
@@ -74,6 +75,15 @@ CONFIG_POSIX_MQUEUE=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=14
CONFIG_GROUP_SCHED=y
@@ -88,8 +98,12 @@ CONFIG_SYSFS_DEPRECATED_V2=y
# CONFIG_NAMESPACES is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
CONFIG_EMBEDDED=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
@@ -99,10 +113,8 @@ CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
-CONFIG_COMPAT_BRK=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
-CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
@@ -112,10 +124,12 @@ CONFIG_AIO=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PCI_QUIRKS=y
CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -123,6 +137,7 @@ CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
+# CONFIG_SLOW_WORK is not set
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
@@ -135,7 +150,6 @@ CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_BLOCK=y
CONFIG_LBD=y
-# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_BLK_DEV_INTEGRITY is not set
@@ -151,11 +165,6 @@ CONFIG_DEFAULT_AS=y
# CONFIG_DEFAULT_CFQ is not set
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="anticipatory"
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
-# CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
# CONFIG_FREEZER is not set
# CONFIG_PPC4xx_PCI_EXPRESS is not set
@@ -176,6 +185,7 @@ CONFIG_SEQUOIA=y
# CONFIG_ARCHES is not set
# CONFIG_CANYONLANDS is not set
# CONFIG_GLACIER is not set
+# CONFIG_REDWOOD is not set
# CONFIG_YOSEMITE is not set
# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set
CONFIG_PPC44x_SIMPLE=y
@@ -238,9 +248,13 @@ CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_UNEVICTABLE_LRU=y
+CONFIG_HAVE_MLOCK=y
+CONFIG_HAVE_MLOCKED_PAGE_BIT=y
+CONFIG_STDBINUTILS=y
CONFIG_PPC_4K_PAGES=y
# CONFIG_PPC_16K_PAGES is not set
# CONFIG_PPC_64K_PAGES is not set
+# CONFIG_PPC_256K_PAGES is not set
CONFIG_FORCE_MAX_ZONEORDER=11
CONFIG_PROC_DEVICETREE=y
CONFIG_CMDLINE_BOOL=y
@@ -265,6 +279,7 @@ CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_PCI_LEGACY=y
# CONFIG_PCI_DEBUG is not set
# CONFIG_PCI_STUB is not set
+# CONFIG_PCI_IOV is not set
# CONFIG_PCCARD is not set
# CONFIG_HOTPLUG_PCI is not set
# CONFIG_HAS_RAPIDIO is not set
@@ -278,18 +293,16 @@ CONFIG_PCI_LEGACY=y
# Default settings for advanced configuration options are used
#
CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_LOWMEM_CAM_NUM=3
CONFIG_PAGE_OFFSET=0xc0000000
CONFIG_KERNEL_START=0xc0000000
CONFIG_PHYSICAL_START=0x00000000
CONFIG_TASK_SIZE=0xc0000000
-CONFIG_CONSISTENT_START=0xff100000
-CONFIG_CONSISTENT_SIZE=0x00200000
CONFIG_NET=y
#
# Networking options
#
-CONFIG_COMPAT_NET_DEV_OPS=y
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
CONFIG_UNIX=y
@@ -339,6 +352,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_LAPB is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
+# CONFIG_PHONET is not set
# CONFIG_NET_SCHED is not set
# CONFIG_DCB is not set
@@ -351,7 +365,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_AF_RXRPC is not set
-# CONFIG_PHONET is not set
# CONFIG_WIRELESS is not set
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set
@@ -448,14 +461,23 @@ CONFIG_MTD_PHYSMAP_OF=y
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
-# CONFIG_MTD_NAND is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+CONFIG_MTD_NAND_ECC_SMC=y
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=y
+CONFIG_MTD_NAND_NDFC=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_CAFE is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_NAND_FSL_ELBC is not set
# CONFIG_MTD_ONENAND is not set
#
# LPDDR flash memory drivers
#
# CONFIG_MTD_LPDDR is not set
-# CONFIG_MTD_QINFO_PROBE is not set
#
# UBI - Unsorted block images
@@ -483,12 +505,16 @@ CONFIG_BLK_DEV_RAM_SIZE=35000
# CONFIG_BLK_DEV_HD is not set
CONFIG_MISC_DEVICES=y
# CONFIG_PHANTOM is not set
-# CONFIG_EEPROM_93CX6 is not set
# CONFIG_SGI_IOC4 is not set
# CONFIG_TIFM_CORE is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_HP_ILO is not set
# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_93CX6 is not set
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set
@@ -515,6 +541,7 @@ CONFIG_HAVE_IDE=y
# CONFIG_I2O is not set
# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
+CONFIG_COMPAT_NET_DEV_OPS=y
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_MACVLAN is not set
@@ -529,6 +556,8 @@ CONFIG_NET_ETHERNET=y
# CONFIG_SUNGEM is not set
# CONFIG_CASSINI is not set
# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_ETHOC is not set
+# CONFIG_DNET is not set
# CONFIG_NET_TULIP is not set
# CONFIG_HP100 is not set
CONFIG_IBM_NEW_EMAC=y
@@ -568,6 +597,7 @@ CONFIG_NETDEV_1000=y
# CONFIG_QLA3XXX is not set
# CONFIG_ATL1 is not set
# CONFIG_ATL1E is not set
+# CONFIG_ATL1C is not set
# CONFIG_JME is not set
CONFIG_NETDEV_10000=y
# CONFIG_CHELSIO_T1 is not set
@@ -577,6 +607,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
# CONFIG_IXGBE is not set
# CONFIG_IXGB is not set
# CONFIG_S2IO is not set
+# CONFIG_VXGE is not set
# CONFIG_MYRI10GE is not set
# CONFIG_NETXEN_NIC is not set
# CONFIG_NIU is not set
@@ -586,6 +617,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
# CONFIG_BNX2X is not set
# CONFIG_QLGE is not set
# CONFIG_SFC is not set
+# CONFIG_BE2NET is not set
# CONFIG_TR is not set
#
@@ -593,7 +625,6 @@ CONFIG_CHELSIO_T3_DEPENDS=y
#
# CONFIG_WLAN_PRE80211 is not set
# CONFIG_WLAN_80211 is not set
-# CONFIG_IWLWIFI_LEDS is not set
#
# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -734,7 +765,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y
#
#
-# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#
# CONFIG_USB_GADGET is not set
@@ -750,6 +781,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y
# CONFIG_EDAC is not set
# CONFIG_RTC_CLASS is not set
# CONFIG_DMADEVICES is not set
+# CONFIG_AUXDISPLAY is not set
# CONFIG_UIO is not set
# CONFIG_STAGING is not set
@@ -778,6 +810,11 @@ CONFIG_INOTIFY_USER=y
# CONFIG_FUSE_FS is not set
#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
@@ -842,7 +879,6 @@ CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_REGISTER_V4 is not set
# CONFIG_RPCSEC_GSS_KRB5 is not set
# CONFIG_RPCSEC_GSS_SPKM3 is not set
# CONFIG_SMB_FS is not set
@@ -858,6 +894,7 @@ CONFIG_SUNRPC=y
CONFIG_MSDOS_PARTITION=y
# CONFIG_NLS is not set
# CONFIG_DLM is not set
+# CONFIG_BINARY_PRINTF is not set
#
# Library routines
@@ -873,11 +910,12 @@ CONFIG_CRC32=y
# CONFIG_LIBCRC32C is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
-CONFIG_PLIST=y
+CONFIG_DECOMPRESS_GZIP=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_HAVE_LMB=y
+CONFIG_NLATTR=y
#
# Kernel hacking
@@ -924,9 +962,12 @@ CONFIG_SCHED_DEBUG=y
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
CONFIG_SYSCTL_SYSCALL_CHECK=y
+# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_TRACING_SUPPORT=y
#
# Tracers
@@ -934,17 +975,20 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
# CONFIG_FUNCTION_TRACER is not set
# CONFIG_SCHED_TRACER is not set
# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_EVENT_TRACER is not set
# CONFIG_BOOT_TRACER is not set
# CONFIG_TRACE_BRANCH_PROFILING is not set
# CONFIG_STACK_TRACER is not set
-# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_KMEMTRACE is not set
+# CONFIG_WORKQUEUE_TRACER is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_DYNAMIC_DEBUG is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_PRINT_STACK_DEPTH=64
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_DEBUG_STACK_USAGE is not set
-# CONFIG_DEBUG_PAGEALLOC is not set
# CONFIG_CODE_PATCHING_SELFTEST is not set
# CONFIG_FTR_FIXUP_SELFTEST is not set
# CONFIG_MSI_BITMAP_SELFTEST is not set
@@ -952,20 +996,7 @@ CONFIG_PRINT_STACK_DEPTH=64
# CONFIG_IRQSTACKS is not set
# CONFIG_VIRQ_DEBUG is not set
# CONFIG_BDI_SWITCH is not set
-CONFIG_PPC_EARLY_DEBUG=y
-# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
-# CONFIG_PPC_EARLY_DEBUG_G5 is not set
-# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
-# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
-# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
-# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
-# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
-# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
-CONFIG_PPC_EARLY_DEBUG_44x=y
-# CONFIG_PPC_EARLY_DEBUG_40x is not set
-# CONFIG_PPC_EARLY_DEBUG_CPM is not set
-CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
-CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x1
+# CONFIG_PPC_EARLY_DEBUG is not set
#
# Security options
@@ -988,10 +1019,12 @@ CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
# CONFIG_CRYPTO_GF128MUL is not set
# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_WORKQUEUE=y
# CONFIG_CRYPTO_CRYPTD is not set
# CONFIG_CRYPTO_AUTHENC is not set
# CONFIG_CRYPTO_TEST is not set
@@ -1060,6 +1093,7 @@ CONFIG_CRYPTO_DES=y
# Compression
#
# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_ZLIB is not set
# CONFIG_CRYPTO_LZO is not set
#
@@ -1068,5 +1102,6 @@ CONFIG_CRYPTO_DES=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set
CONFIG_CRYPTO_HW=y
# CONFIG_CRYPTO_DEV_HIFN_795X is not set
+# CONFIG_CRYPTO_DEV_PPC4XX is not set
# CONFIG_PPC_CLOCK is not set
# CONFIG_VIRTUALIZATION is not set
--
1.6.2.2
^ permalink raw reply related
* Re: [PATCH] powerpc: Add configurable -Werror for arch/powerpc
From: Kumar Gala @ 2009-04-07 15:05 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <b0b55030b7ba669cbdec74a8b89875096ea07622.1239069602.git.michael@ellerman.id.au>
On Apr 6, 2009, at 9:00 PM, Michael Ellerman wrote:
> Add an option, on by default, to build all code under arch/powerpc
> with
> -Werror, which causes gcc to treat warnings as errors.
>
> The intention is to make it harder for people to inadvertantly
> introduce
> errors in the arch/powerpc code. It needs to be configurable so that
> if a warning is introduced, people can easily work around it while
> it's
> being fixed.
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
> arch/powerpc/Kconfig.debug | 8 ++++++++
> arch/powerpc/kernel/Makefile | 4 ++++
> arch/powerpc/kvm/Makefile | 4 ++++
> arch/powerpc/lib/Makefile | 4 ++++
> arch/powerpc/mm/Makefile | 4 ++++
> arch/powerpc/oprofile/Makefile | 4 ++++
> arch/powerpc/platforms/Makefile | 4 ++++
> arch/powerpc/sysdev/Makefile | 4 ++++
> arch/powerpc/xmon/Makefile | 4 ++++
> 9 files changed, 40 insertions(+), 0 deletions(-)
>
> v2: Leave math-emu alone, it's a steaming pile of warnings.
Acked-by: Kumar Gala <galak@kernel.crashing.org>
- k
^ 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