LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 3/4] [POWERPC] MPC8349E-mITX: introduce localbus and pata nodes
From: Olof Johansson @ 2007-12-04 19:16 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: linuxppc-dev, Paul Mundt, Arnd Bergmann, Jeff Garzik, linux-ide
In-Reply-To: <20071204170726.GC15599@localhost.localdomain>

Hi,

On Tue, Dec 04, 2007 at 08:07:26PM +0300, Anton Vorontsov wrote:
> diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
> index 5072f6d..c459b0a 100644
> --- a/arch/powerpc/boot/dts/mpc8349emitx.dts
> +++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
> @@ -249,6 +249,22 @@
>  		device_type = "pci";
>  	};
>  
> +	localbus@e0005000 {
> +		#address-cells = <2>;
> +		#size-cells = <1>;
> +		compatible = "fsl,mpc8349emitx-localbus",
> +			     "fsl,mpc8349e-localbus",
> +			     "fsl,pq2pro-localbus";
> +		reg = <e0005000 d8>;
> +		ranges = <3 0 f0000000 210>;
>  
> -
> +		pata@3,0 {

What's the ,0 for?

> +			compatible = "fsl,mpc8349emitx-pata", "ata-generic";
> +			reg = <3 0 10 3 20c 4>;
> +			reg-shift = <1>;
> +			pio-mode = <6>;
> +			interrupts = <17 8>;
> +			interrupt-parent = <&ipic>;
> +		};
> +	};
>  };
> diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
> index aa76819..ea5f176 100644
> --- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
> +++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
> @@ -23,6 +23,7 @@
>  #include <linux/delay.h>
>  #include <linux/seq_file.h>
>  #include <linux/root_dev.h>
> +#include <linux/of_platform.h>
>  
>  #include <asm/system.h>
>  #include <asm/atomic.h>
> @@ -37,6 +38,22 @@
>  
>  #include "mpc83xx.h"
>  
> +static struct of_device_id mpc834x_itx_ids[] = {
> +	{ .name = "localbus", },
> +	{},
> +};

Please add the "compatible" field here (fsl,pq2pro-localbus should do
just fine), instead of the name.

(Sorry for not spotting this sooner)


-Olof

^ permalink raw reply

* 2.6.25-candidates branch updated in 4xx tree
From: Josh Boyer @ 2007-12-04 19:11 UTC (permalink / raw)
  To: linuxppc-dev

For those following my tree, I've added a 2.6.25-candidates branch and
based it off of Paul's latest master.  (If you've already pulled
you'll have to reset, sorry.)

I call it candidates because several patches (most notably Ben's) will
probably get reworked a little before I ask Paul to pull them into his
tree.  There are also EMAC patches in there that will go through Jeff
Garzik rather than me.

The branch contains the commits below. I'm sure I've missed one or two,
so feel free to reply and let me know if you think a patch is needed
for 4xx in 2.6.25.

josh

Benjamin Herrenschmidt (32):
      [POWERPC] ibm_newemac: Fix possible lockup on close
      [POWERPC] usb: Remove OHCI useless masking/unmasking of WDH interrupt
      [POWERPC] usb: Remove broken optimisation in OHCI IRQ handler
      [POWERPC] drm: Fix for non-coherent DMA PowerPC
      [POWERPC] ibm_newemac: Fix ZMII refcounting bug
      [POWERPC] ibm_newemac: Workaround reset timeout when no link
      [POWERPC] ibm_newemac: Cleanup/Fix RGMII MDIO support detection
      [POWERPC] ibm_newemac: Cleanup/fix support for STACR register variants
      [POWERPC] emac: Update file headers copyright notices
      [POWERPC] Make isa_mem_base common to 32 and 64 bits
      [POWERPC] Merge pci_process_bridge_OF_ranges()
      [POWERPC] Fix powerpc 32 bits resource fixup for 64 bits resources
      [POWERPC] 4xx: Fix 440/440A machine check handling
      [POWERPC] 4xx: Fix 440SPE machine check
      [POWERPC] 4xx: Add xmon function to dump 44x TLB
      [POWERPC] Change 32 bits PCI message about resource allocation
      [POWERPC] Add of_translate_dma_address
      [POWERPC] 4xx: Improve support for 4xx indirect DCRs
      [POWERPC] 4xx: PLB to PCI-X support
      [POWERPC] 4xx: PLB to PCI 2.x support
      [POWERPC] 4xx: PLB to PCI Express support
      [POWERPC] 4xx: PCI support for 4xx Ebony board
      [POWERPC] 4xx: Add early udbg support for 40x processors
      [POWERPC] early debug forces console log level to max
      [POWERPC] 4xx: EP405 boards support for arch/powerpc
      [POWERPC] 4xx: Add PCI to Walnut platform
      [POWERPC] 4xx: Wire up PCI on Bamboo board
      [POWERPC] 4xx: Wire up 440EP USB controller support to Bamboo board
      [POWERPC] 4xx: Adds decoding of 440SPE memory size to boot wrapper library
      [POWERPC] 4xx: Add mfspr/mtspr inline macros to 4xx bootwrapper
      [POWERPC] 4xx: Rework 4xx clock probing in boot wrapper
      [POWERPC] 4xx: Base support for 440SPe "Katmai" eval board

Hugh Blemings (2):
      [POWERPC] ibm_newemac: Skip EMACs that are marked unused by the firmware
      [POWERPC] 4xx: Base support for 440GX Taishan eval board

Josh Boyer (1):
      [POWERPC] 4xx: Fix 440grx setup function to call 440A fixup

Stefan Roese (6):
      [POWERPC] 4xx: Fix TLB 0 problem with CONFIG_SERIAL_TEXT_DEBUG
      [POWERPC] ibm_newemac: Add BCM5248 and Marvell 88E1111 PHY support
      [POWERPC] ibm_newemac: Add ET1011c PHY support
      [POWERPC] 4xx: Add 405EX CPU type needed for EMAC support on Kilauea
      [POWERPC] 4xx: Change Kilauea dts to support new EMAC device tree properti
      [POWERPC] 4xx: Add EMAC support to Kilauea defconfig

Valentine Barshak (7):
      [POWERPC] ibm_newemac: Correct opb_bus_freq value
      [POWERPC] ibm_newemac: Fix typo reading TAH channel info
      [POWERPC] ibm_newemac: Call dev_set_drvdata() before tah_reset()
      [POWERPC] 4xx: 440GRx Rainier bootwrapper.
      [POWERPC] 4xx: 440GRx Rainier DTS.
      [POWERPC] 4xx: 440GRx Rainier board support.
      [POWERPC] 4xx: 440GRx Rainier default config

^ permalink raw reply

* Re: [PATCH v2 3/4] [POWERPC] MPC8349E-mITX: introduce localbus and pata nodes
From: Scott Wood @ 2007-12-04 19:23 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Arnd Bergmann, Jeff Garzik, linuxppc-dev, linux-ide, Paul Mundt
In-Reply-To: <20071204191657.GB5758@lixom.net>

Olof Johansson wrote:
> Hi,
> 
> On Tue, Dec 04, 2007 at 08:07:26PM +0300, Anton Vorontsov wrote:
>> diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
>> index 5072f6d..c459b0a 100644
>> --- a/arch/powerpc/boot/dts/mpc8349emitx.dts
>> +++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
>> @@ -249,6 +249,22 @@
>>  		device_type = "pci";
>>  	};
>>  
>> +	localbus@e0005000 {
>> +		#address-cells = <2>;
>> +		#size-cells = <1>;
>> +		compatible = "fsl,mpc8349emitx-localbus",
>> +			     "fsl,mpc8349e-localbus",
>> +			     "fsl,pq2pro-localbus";
>> +		reg = <e0005000 d8>;
>> +		ranges = <3 0 f0000000 210>;
>>  
>> -
>> +		pata@3,0 {
> 
> What's the ,0 for?

chipselect 3, offset 0.

-Scott

^ permalink raw reply

* Re: [PATCH 2/2] [POWERPC] pasemi: Register i2c_board_info
From: Olof Johansson @ 2007-12-04 19:32 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linuxppc-dev
In-Reply-To: <1196774926.13978.225.camel@pmac.infradead.org>

On Tue, Dec 04, 2007 at 01:28:46PM +0000, David Woodhouse wrote:
> 
> On Thu, 2007-11-29 at 21:29 -0600, Olof Johansson wrote:
> > +                               continue;
> > +
> > +                       info.addr = *addr;
> > +
> > +                       i2c_register_board_info(PCI_FUNC(pdev->devfn),
> > &info,
> > +                                               1);
> > +               }
> > +       }
> 
> +       /* Ensure that buses up to 2 are reserved */
> +       i2c_register_board_info(2, NULL, 0);
> +
> 
> 
> > +       return 0;
> > +}
> > +device_initcall(pasemi_register_i2c_devices);
> > +#endif
> 
> 
> Otherwise when you make i2c-pasemi use i2c_add_numbered_adapter(), it
> might fail to register the third bus -- because there were no devices
> preregistered on it, so something else might have stolen that bus number
> already.

Good point, I'd missed that. Thanks!

> You might want to add the patch to use i2c_add_numbered_adapter() to
> your tree, btw.

Yep, I realized that after (re)asking Paul to pull though, and didn't
want to do a third request before he's done it. :)

If he doesn't pull in the next few days I might just keep adding new
patches as they come in though, and add it back.


-Olof

^ permalink raw reply

* Re: [PATCH v2 2/2] [POWERPC] Use new machine_xxx_initcall hooks in platform code
From: Arnd Bergmann @ 2007-12-04 19:35 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Geert Uytterhoeven, olof
In-Reply-To: <fa686aa40712040621r3103bae9hd900c23d48273360@mail.gmail.com>

On Tuesday 04 December 2007, Grant Likely wrote:
> On 12/4/07, Grant Likely <grant.likely@secretlab.ca> wrote:
> > On 12/4/07, Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> wrote:
> > > You seem to have missed the PS3 *_initcall()s.
> > > Probably because they test for firmware_has_feature(FW_FEATURE_PS3_LV1) instead
> > > of machine_is(ps3).
> >
> > That's exactly why; I didn't know if 'machine_is(ps3)' was a suitable
> > substitute so I left it alone.
> 
> On that topic; I left some pseries and iseries stuff alone also for
> the same reason.

Yes, and in many cases it's the right answer to base a decision on a specific
feature rather than a platform name, for two reasons:

1. If another platform gets added that uses the same firmware feature, it
will automatically do the right thing.

2. The call to firmware_has_feature() turns into a compile-time check in
many cases, so if the kernel does not contain support for any firmware
with the given feature, all the code referenced it can get optimized
away by the compiler.

If we have many cases where an initcall is done based on a specific fw-feature
or cpu-feature, we might want to add a similar initcall mechanism for those
along the lines of machine_xxx_initcall, but of course we should be sure
not to overengineer things here.

	Arnd <><

^ permalink raw reply

* Re: [PATCH v2 3/4] [POWERPC] MPC8349E-mITX: introduce localbus and pata nodes
From: Anton Vorontsov @ 2007-12-04 19:45 UTC (permalink / raw)
  To: Olof Johansson
  Cc: linuxppc-dev, Paul Mundt, Arnd Bergmann, Jeff Garzik, linux-ide
In-Reply-To: <20071204191657.GB5758@lixom.net>

On Tue, Dec 04, 2007 at 01:16:57PM -0600, Olof Johansson wrote:
> Hi,
> 
> On Tue, Dec 04, 2007 at 08:07:26PM +0300, Anton Vorontsov wrote:
> > diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
> > index 5072f6d..c459b0a 100644
[...]
> > +static struct of_device_id mpc834x_itx_ids[] = {
> > +	{ .name = "localbus", },
> > +	{},
> > +};
> 
> Please add the "compatible" field here (fsl,pq2pro-localbus should do
> just fine), instead of the name.

Done, thanks.

- - - -
From: Anton Vorontsov <avorontsov@ru.mvista.com>
Subject: [PATCH v2.1] [POWERPC] MPC8349E-mITX: introduce localbus and pata nodes

This patch adds localbus and pata nodes to use CF IDE interface
on MPC8349E-mITX boards.

Patch also adds code to probe localbus.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 arch/powerpc/boot/dts/mpc8349emitx.dts    |   18 +++++++++++++++++-
 arch/powerpc/platforms/83xx/mpc834x_itx.c |   17 +++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
index 5072f6d..c459b0a 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -249,6 +249,22 @@
 		device_type = "pci";
 	};
 
+	localbus@e0005000 {
+		#address-cells = <2>;
+		#size-cells = <1>;
+		compatible = "fsl,mpc8349emitx-localbus",
+			     "fsl,mpc8349e-localbus",
+			     "fsl,pq2pro-localbus";
+		reg = <e0005000 d8>;
+		ranges = <3 0 f0000000 210>;
 
-
+		pata@3,0 {
+			compatible = "fsl,mpc8349emitx-pata", "ata-generic";
+			reg = <3 0 10 3 20c 4>;
+			reg-shift = <1>;
+			pio-mode = <6>;
+			interrupts = <17 8>;
+			interrupt-parent = <&ipic>;
+		};
+	};
 };
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index aa76819..4797850 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -23,6 +23,7 @@
 #include <linux/delay.h>
 #include <linux/seq_file.h>
 #include <linux/root_dev.h>
+#include <linux/of_platform.h>
 
 #include <asm/system.h>
 #include <asm/atomic.h>
@@ -37,6 +38,22 @@
 
 #include "mpc83xx.h"
 
+static struct of_device_id mpc834x_itx_ids[] = {
+	{ .compatible = "fsl,pq2pro-localbus", },
+	{},
+};
+
+static int __init mpc834x_itx_declare_of_platform_devices(void)
+{
+	if (!machine_is(mpc834x_itx))
+		return 0;
+
+	of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL);
+
+	return 0;
+}
+device_initcall(mpc834x_itx_declare_of_platform_devices);
+
 /* ************************************************************************
  *
  * Setup the architecture
-- 
1.5.2.2

^ permalink raw reply related

* Re: [PATCH v2 2/4] [libata] pata_of_platform: OF-Platform PATA device driver
From: Anton Vorontsov @ 2007-12-04 19:49 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Jeff Garzik, Arnd Bergmann, linux-ide, linuxppc-dev, Paul Mundt
In-Reply-To: <20071204184826.GA5758@lixom.net>

On Tue, Dec 04, 2007 at 12:48:26PM -0600, Olof Johansson wrote:
> Hi,
> 
> On Tue, Dec 04, 2007 at 08:07:19PM +0300, Anton Vorontsov wrote:
> > This driver nicely wraps around pata_platform library functions,
[..]
> There's a typo in the dependencies for PATA_PLATFORM that you should change:
> 
> depends on EMBEDDED || ARCH_RPC
> 
> (note ARCH_>R<PC). With my font it's hard to tell a difference :)
> 
> It should really be:
> 
> depends on EMBEDDED || PPC
> 
> Care to change that while you're at it?

Yup.

> 
> > +static struct of_device_id pata_of_platform_match[] = {
> > +	{ .compatible = "ata-generic", },
> > +};
> 
> Needs to be terminated by empty entry,

Fixed.

> and please add:
> MODULE_DEVICE_TABLE(of, pata_of_platform_match);

Ugh. I forgot about device table. Done.

Much thanks for spotting these.

- - - -
From: Anton Vorontsov <avorontsov@ru.mvista.com>
Subject: [PATCH v2.1] [libata] pata_of_platform: OF-Platform PATA device driver

This driver nicely wraps around pata_platform library functions,
and provides OF platform bus bindings to the PATA devices.

In addition fix ARCH_RPC typo in the PATA_PLATFORM Kconfig entry,
spotted by Olof Johansson.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 drivers/ata/Kconfig            |   12 ++++-
 drivers/ata/Makefile           |    1 +
 drivers/ata/pata_of_platform.c |  104 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 116 insertions(+), 1 deletions(-)
 create mode 100644 drivers/ata/pata_of_platform.c

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index ba63619..e067112 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -607,13 +607,23 @@ config PATA_WINBOND_VLB
 
 config PATA_PLATFORM
 	tristate "Generic platform device PATA support"
-	depends on EMBEDDED || ARCH_RPC
+	depends on EMBEDDED || ARCH_PPC
 	help
 	  This option enables support for generic directly connected ATA
 	  devices commonly found on embedded systems.
 
 	  If unsure, say N.
 
+config PATA_OF_PLATFORM
+	tristate "OpenFirmware platform device PATA support"
+	depends on PATA_PLATFORM && PPC_OF
+	help
+	  This option enables support for generic directly connected ATA
+	  devices commonly found on embedded systems with OpenFirmware
+	  bindings.
+
+	  If unsure, say N.
+
 config PATA_ICSIDE
 	tristate "Acorn ICS PATA support"
 	depends on ARM && ARCH_ACORN
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
index b13feb2..ebcee64 100644
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -67,6 +67,7 @@ obj-$(CONFIG_PATA_IXP4XX_CF)	+= pata_ixp4xx_cf.o
 obj-$(CONFIG_PATA_SCC)		+= pata_scc.o
 obj-$(CONFIG_PATA_BF54X)	+= pata_bf54x.o
 obj-$(CONFIG_PATA_PLATFORM)	+= pata_platform.o
+obj-$(CONFIG_PATA_OF_PLATFORM)	+= pata_of_platform.o
 obj-$(CONFIG_PATA_ICSIDE)	+= pata_icside.o
 # Should be last but two libata driver
 obj-$(CONFIG_PATA_ACPI)		+= pata_acpi.o
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
new file mode 100644
index 0000000..4daf118
--- /dev/null
+++ b/drivers/ata/pata_of_platform.c
@@ -0,0 +1,104 @@
+/*
+ * OF-platform PATA driver
+ *
+ * Copyright (c) 2007  MontaVista Software, Inc.
+ *                     Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License (Version 2) as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of_platform.h>
+#include <linux/pata_platform.h>
+
+static int __devinit pata_of_platform_probe(struct of_device *ofdev,
+					    const struct of_device_id *match)
+{
+	int ret;
+	struct device_node *dn = ofdev->node;
+	struct resource io_res;
+	struct resource ctl_res;
+	struct resource irq_res;
+	unsigned int reg_shift = 0;
+	int pio_mode = 0;
+	int pio_mask;
+	const u32 *prop;
+
+	ret = of_address_to_resource(dn, 0, &io_res);
+	if (ret) {
+		dev_err(&ofdev->dev, "can't get IO address from "
+			"device tree\n");
+		return -EINVAL;
+	}
+
+	ret = of_address_to_resource(dn, 1, &ctl_res);
+	if (ret) {
+		dev_err(&ofdev->dev, "can't get CTL address from "
+			"device tree\n");
+		return -EINVAL;
+	}
+
+	ret = of_irq_to_resource(dn, 0, &irq_res);
+	if (ret == NO_IRQ)
+		irq_res.start = irq_res.end = -1;
+	else
+		irq_res.flags = 0;
+
+	prop = (u32 *)of_get_property(dn, "reg-shift", NULL);
+	if (prop)
+		reg_shift = *prop;
+
+	prop = (u32 *)of_get_property(dn, "pio-mode", NULL);
+	if (prop) {
+		pio_mode = *prop;
+		if (pio_mode > 6) {
+			dev_err(&ofdev->dev, "invalid pio-mode\n");
+			return -EINVAL;
+		}
+	} else {
+		dev_info(&ofdev->dev, "pio-mode unspecified, assuming PIO0\n");
+	}
+
+	pio_mask = 1 << pio_mode;
+	pio_mask |= (1 << pio_mode) - 1;
+
+	return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, &irq_res,
+				     reg_shift, pio_mask);
+}
+
+static int __devexit pata_of_platform_remove(struct of_device *ofdev)
+{
+	return __pata_platform_remove(&ofdev->dev);
+}
+
+static struct of_device_id pata_of_platform_match[] = {
+	{ .compatible = "ata-generic", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, pata_of_platform_match);
+
+static struct of_platform_driver pata_of_platform_driver = {
+	.name		= "pata_of_platform",
+	.match_table	= pata_of_platform_match,
+	.probe		= pata_of_platform_probe,
+	.remove		= __devexit_p(pata_of_platform_remove),
+};
+
+static int __init pata_of_platform_init(void)
+{
+	return of_register_platform_driver(&pata_of_platform_driver);
+}
+module_init(pata_of_platform_init);
+
+static void __exit pata_of_platform_exit(void)
+{
+	of_unregister_platform_driver(&pata_of_platform_driver);
+}
+module_exit(pata_of_platform_exit);
+
+MODULE_DESCRIPTION("OF-platform PATA driver");
+MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
+MODULE_LICENSE("GPL");
-- 
1.5.2.2

^ permalink raw reply related

* Re: [PATCH 2.6.24] pasemi_mac: Fix reuse of free'd skb
From: Jeff Garzik @ 2007-12-04 19:54 UTC (permalink / raw)
  To: Olof Johansson; +Cc: ranger, netdev, dwmw2, linuxppc-dev
In-Reply-To: <20071204033414.GA13616@lixom.net>

Olof Johansson wrote:
> Turns out we're freeing the skb when we detect CRC error, but we're
> not clearing out info->skb. We could either clear it and have the stack
> reallocate it, or just leave it and the rx ring refill code will reuse
> the one that was allocated.
> 
> Reusing a freed skb obviously caused some nasty crashes of various kind,
> as reported by Brent Baude and David Woodhouse.
> 
> 
> Signed-off-by: Olof Johansson <olof@lixom.net>
> 
> ---
> 
> Jeff, I'd like to see this in 2.6.24, it's causing some real problems
> out there. It's not needed in the 2.6.25 queue since the other changes
> there have already covered these cases.
> 
> My test network at home is quiet enough to not cause CRC errors, we
> mainly get those during interface bringup before speed is configured.
> 
> diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
> index 09b4fde..6617e24 100644
> --- a/drivers/net/pasemi_mac.c
> +++ b/drivers/net/pasemi_mac.c
> @@ -586,7 +586,7 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit)
>  			/* CRC error flagged */
>  			mac->netdev->stats.rx_errors++;
>  			mac->netdev->stats.rx_crc_errors++;
> -			dev_kfree_skb_irq(skb);
> +			/* No need to free skb, it'll be reused */
>  			goto next;

applied #upstream-fixes

^ permalink raw reply

* Re: [PATCH 5/7] powerpc: Replace ppc_md.power_off with pm_power_off
From: Benjamin Herrenschmidt @ 2007-12-04 19:55 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: linuxppc-dev
In-Reply-To: <20071204180148.GA1579@mag.az.mvista.com>


On Tue, 2007-12-04 at 11:01 -0700, Mark A. Greer wrote:
> On Tue, Dec 04, 2007 at 06:23:09PM +1100, Benjamin Herrenschmidt wrote:
> > 
> > On Mon, 2007-12-03 at 22:48 -0700, Mark A. Greer wrote:
> > > From: Mark A. Greer <mgreer@mvista.com>
> > > 
> > > The ppc_md.power_off hook performs the same function that the
> > > pm_power_off hook is supposed to.  However, it is powerpc-specific
> > > and prevents kernel drivers (e.g., IPMI) from changing how a platform
> > > is powered off.  So, get rid of ppc_md.power_off and replace it with
> > > pm_power_off.
> > 
> > I'm less happy with that one... probably aesthetics :-)
> > 
> > Can't we just have the generic code call pm_power_off and ppc_md and
> > which ever powers the machine off wins ?
> 
> Yes, that would be easy to do.  Seems like duplication though.
> If you are sure you're okay with the duplication, I'll do that.

Let's ask Paulus what he thinks.

Ben.

^ permalink raw reply

* Re: [PATCH v2 2/4] [libata] pata_of_platform: OF-Platform PATA device driver
From: Olof Johansson @ 2007-12-04 20:01 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: linux-ide, Paul Mundt, Arnd Bergmann, Jeff Garzik, linuxppc-dev
In-Reply-To: <20071204194921.GB1253@localhost.localdomain>

On Tue, Dec 04, 2007 at 10:49:21PM +0300, Anton Vorontsov wrote:
>  	tristate "Generic platform device PATA support"
> -	depends on EMBEDDED || ARCH_RPC
> +	depends on EMBEDDED || ARCH_PPC

It needs to be || PPC, not || ARCH_PPC.


-Olof

^ permalink raw reply

* Re: [PATCH] pci: Fix bus resource assignment on 32 bits with 64b resources
From: Benjamin Herrenschmidt @ 2007-12-04 19:57 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg Kroah-Hartman, linux-pci, linux-kernel, linuxppc-dev
In-Reply-To: <Pine.LNX.4.62.0712041337530.12181@pademelon.sonytel.be>


On Tue, 2007-12-04 at 13:39 +0100, Geert Uytterhoeven wrote:
> 
> Can we please have them in <linux/ioport.h>? They look very useful to
> me
> elsewhere (other bus drivers, device drivers), too.
> 
> What about naming the printf format specifier macros more like in C99,
> e.g.
> PRI*?

That's a can of worms I just didn't want to open...

Ben.

^ permalink raw reply

* Re: [PATCH] Stop phy code from returning success to unknown ioctls.
From: Andy Fleming @ 2007-12-04 20:00 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linuxppc-dev, jgarzik, Domen Puncer, netdev
In-Reply-To: <1196279794.30806.54.camel@pmac.infradead.org>


On Nov 28, 2007, at 13:56, David Woodhouse wrote:

> This kind of sucks, and prevents the Fedora installer from using the
> device for network installs...
>
> [root@efika phy]# iwconfig eth0
> Warning: Driver for device eth0 has been compiled with an ancient  
> version
> of Wireless Extension, while this program support version 11 and  
> later.
> Some things may be broken...
>
> eth0        ESSID:off/any  Nickname:""
>           NWID:0  Channel:0  Access Point: 00:00:BF:81:14:E0
>           Bit Rate:-1.08206e+06 kb/s   Sensitivity=0/0
>           RTS thr:off   Fragment thr:off
>           Encryption key:<too big>
>           Power Management:off
>
> Signed-off-by: David Woodhouse <dwmw2@infradead.org>

d'oh!

Acked-by: Andy Fleming <afleming@freescale.com>


>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 9bc1177..7c9e6e3 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -406,6 +406,9 @@ int phy_mii_ioctl(struct phy_device *phydev,
>  				&& phydev->drv->config_init)
>  			phydev->drv->config_init(phydev);
>  		break;
> +
> +	default:
> +		return -ENOTTY;
>  	}
>
>  	return 0;
>
> -- 
> dwmw2
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 5/7] powerpc: Replace ppc_md.power_off with pm_power_off
From: Grant Likely @ 2007-12-04 20:05 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev
In-Reply-To: <1196798152.13230.308.camel@pasglop>

On 12/4/07, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> On Tue, 2007-12-04 at 11:01 -0700, Mark A. Greer wrote:
> > On Tue, Dec 04, 2007 at 06:23:09PM +1100, Benjamin Herrenschmidt wrote:
> > >
> > > On Mon, 2007-12-03 at 22:48 -0700, Mark A. Greer wrote:
> > > > From: Mark A. Greer <mgreer@mvista.com>
> > > >
> > > > The ppc_md.power_off hook performs the same function that the
> > > > pm_power_off hook is supposed to.  However, it is powerpc-specific
> > > > and prevents kernel drivers (e.g., IPMI) from changing how a platform
> > > > is powered off.  So, get rid of ppc_md.power_off and replace it with
> > > > pm_power_off.
> > >
> > > I'm less happy with that one... probably aesthetics :-)
> > >
> > > Can't we just have the generic code call pm_power_off and ppc_md and
> > > which ever powers the machine off wins ?
> >
> > Yes, that would be easy to do.  Seems like duplication though.
> > If you are sure you're okay with the duplication, I'll do that.
>
> Let's ask Paulus what he thinks.

We could simply have the setup code copy the ppc_md.power_off pointer
into pm_power_off; that we retain the nice assignment in
define_machine(), but eliminate the duplicated calls.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH] gianfar: fix compile warning
From: Jeff Garzik @ 2007-12-04 20:07 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, netdev
In-Reply-To: <20071202050927.8827.27154.stgit@trillian.secretlab.ca>

Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> 
> Eliminate an uninitialized variable warning.  The code is correct, but
> a pointer to the automatic variable 'addr' is passed to dma_alloc_coherent.
> Since addr has never been initialized, and the compiler doesn't know
> what dma_alloc_coherent will do with it, it complains.
> 
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> 
> Jeff, this one should go in for 2.6.24

applied #upstream-fixes

^ permalink raw reply

* Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality
From: Jeff Garzik @ 2007-12-04 20:07 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-dev, linux-kernel, netdev
In-Reply-To: <20071126142906.19642.45540.stgit@localhost.localdomain>

Vitaly Bordug wrote:
> With that patch fixed.c now fully emulates MDIO bus, thus no need
> to duplicate PHY layer functionality. That, in turn, drastically
> simplifies the code, and drops down line count.
> 
> As an additional bonus, now there is no need to register MDIO bus
> for each PHY, all emulated PHYs placed on the platform fixed MDIO bus.
> There is also no more need to pre-allocate PHYs via .config option,
> this is all now handled dynamically.
> 
> p.s. Don't even try to understand patch content! Better: apply patch
> and look into resulting drivers/net/phy/fixed.c.
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>

ACK, I presume this will go via the ppc tree?

^ permalink raw reply

* Re: [PATCH] gianfar driver: eliminate compiler warnings and unnecessary macros
From: Jeff Garzik @ 2007-12-04 20:15 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, netdev
In-Reply-To: <20071202051245.8918.24063.stgit@trillian.secretlab.ca>

Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> 
> This patch eliminates the warning of unused return values when the driver
> registers it sysfs files.  Now the driver will print an error if it is
> unable to register the sysfs files.
> 
> It also eliminates the macros used to wrap the DEVICE_ATTR macro and the
> device_create_file function call.  The macros don't reduce the number of
> lines of source code in the file and the name munging makes is so that
> cscope and friends don't see the references to the functions.  It's better
> to just call the kernel API directly.
> 
> While we're at it, the DEVICE_ATTR instances have been moved down to
> be grouped with the functions they depend on.
> 
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> 
>  drivers/net/gianfar_sysfs.c |   50 ++++++++++++++++++++++---------------------
>  1 files changed, 25 insertions(+), 25 deletions(-)

applied #upstream

^ permalink raw reply

* Re: [PATCH 5/7] powerpc: Replace ppc_md.power_off with pm_power_off
From: Benjamin Herrenschmidt @ 2007-12-04 20:24 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40712041205o39ba4e3epcbc008ea47bd83cc@mail.gmail.com>


On Tue, 2007-12-04 at 13:05 -0700, Grant Likely wrote:
> We could simply have the setup code copy the ppc_md.power_off pointer
> into pm_power_off; that we retain the nice assignment in
> define_machine(), but eliminate the duplicated calls.

Good idea.

Ben.

^ permalink raw reply

* Re: [PATCH v2 2/2] [POWERPC] Use new machine_xxx_initcall hooks in platform code
From: Benjamin Herrenschmidt @ 2007-12-04 20:31 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Geert Uytterhoeven, linuxppc-dev, olof
In-Reply-To: <200712042036.00785.arnd@arndb.de>


On Tue, 2007-12-04 at 20:35 +0100, Arnd Bergmann wrote:
> 
> 1. If another platform gets added that uses the same firmware feature,
> it
> will automatically do the right thing.

Yes but is it something that we want to happen ? That is, do we want
code somewhere in a platform/foo dir to run when using platform/bar
because they happen to share a feature ?

I don't think so ... such code should be located elsewhere, maybe in
sysdev, where it's clear that it's shared.

Thus, thing that is -really- platform specific and wants to stay in the
platform code should move to the new mechanism I believe.

As for PS3, will there ever be another platform using LV1 ? If that is
the case, we may want to create a shared directory with all the LV1
bits...

> 2. The call to firmware_has_feature() turns into a compile-time check
> in
> many cases, so if the kernel does not contain support for any firmware
> with the given feature, all the code referenced it can get optimized
> away by the compiler.

The machine init stuff will soon get rid of whatever test is in it too,
as soon as I get to do the ELF magic.

Ben.

^ permalink raw reply

* Re: [PATCH v2 2/4] [libata] pata_of_platform: OF-Platform PATA device driver
From: Anton Vorontsov @ 2007-12-04 20:37 UTC (permalink / raw)
  To: Olof Johansson
  Cc: linux-ide, Paul Mundt, Arnd Bergmann, Jeff Garzik, linuxppc-dev
In-Reply-To: <20071204200121.GA6782@lixom.net>

On Tue, Dec 04, 2007 at 02:01:21PM -0600, Olof Johansson wrote:
> On Tue, Dec 04, 2007 at 10:49:21PM +0300, Anton Vorontsov wrote:
> >  	tristate "Generic platform device PATA support"
> > -	depends on EMBEDDED || ARCH_RPC
> > +	depends on EMBEDDED || ARCH_PPC
> 
> It needs to be || PPC, not || ARCH_PPC.

D'oh.

- - - -
From: Anton Vorontsov <avorontsov@ru.mvista.com>
Subject: [PATCH v2.2] [libata] pata_of_platform: OF-Platform PATA device driver

This driver nicely wraps around pata_platform library functions,
and provides OF platform bus bindings to the PATA devices.

In addition fix ARCH_RPC typo in the PATA_PLATFORM Kconfig entry,
spotted by Olof Johansson.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 drivers/ata/Kconfig            |   12 ++++-
 drivers/ata/Makefile           |    1 +
 drivers/ata/pata_of_platform.c |  104 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 116 insertions(+), 1 deletions(-)
 create mode 100644 drivers/ata/pata_of_platform.c

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index ba63619..299ff1f 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -607,13 +607,23 @@ config PATA_WINBOND_VLB
 
 config PATA_PLATFORM
 	tristate "Generic platform device PATA support"
-	depends on EMBEDDED || ARCH_RPC
+	depends on EMBEDDED || PPC
 	help
 	  This option enables support for generic directly connected ATA
 	  devices commonly found on embedded systems.
 
 	  If unsure, say N.
 
+config PATA_OF_PLATFORM
+	tristate "OpenFirmware platform device PATA support"
+	depends on PATA_PLATFORM && PPC_OF
+	help
+	  This option enables support for generic directly connected ATA
+	  devices commonly found on embedded systems with OpenFirmware
+	  bindings.
+
+	  If unsure, say N.
+
 config PATA_ICSIDE
 	tristate "Acorn ICS PATA support"
 	depends on ARM && ARCH_ACORN
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
index b13feb2..ebcee64 100644
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -67,6 +67,7 @@ obj-$(CONFIG_PATA_IXP4XX_CF)	+= pata_ixp4xx_cf.o
 obj-$(CONFIG_PATA_SCC)		+= pata_scc.o
 obj-$(CONFIG_PATA_BF54X)	+= pata_bf54x.o
 obj-$(CONFIG_PATA_PLATFORM)	+= pata_platform.o
+obj-$(CONFIG_PATA_OF_PLATFORM)	+= pata_of_platform.o
 obj-$(CONFIG_PATA_ICSIDE)	+= pata_icside.o
 # Should be last but two libata driver
 obj-$(CONFIG_PATA_ACPI)		+= pata_acpi.o
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
new file mode 100644
index 0000000..4daf118
--- /dev/null
+++ b/drivers/ata/pata_of_platform.c
@@ -0,0 +1,104 @@
+/*
+ * OF-platform PATA driver
+ *
+ * Copyright (c) 2007  MontaVista Software, Inc.
+ *                     Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License (Version 2) as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of_platform.h>
+#include <linux/pata_platform.h>
+
+static int __devinit pata_of_platform_probe(struct of_device *ofdev,
+					    const struct of_device_id *match)
+{
+	int ret;
+	struct device_node *dn = ofdev->node;
+	struct resource io_res;
+	struct resource ctl_res;
+	struct resource irq_res;
+	unsigned int reg_shift = 0;
+	int pio_mode = 0;
+	int pio_mask;
+	const u32 *prop;
+
+	ret = of_address_to_resource(dn, 0, &io_res);
+	if (ret) {
+		dev_err(&ofdev->dev, "can't get IO address from "
+			"device tree\n");
+		return -EINVAL;
+	}
+
+	ret = of_address_to_resource(dn, 1, &ctl_res);
+	if (ret) {
+		dev_err(&ofdev->dev, "can't get CTL address from "
+			"device tree\n");
+		return -EINVAL;
+	}
+
+	ret = of_irq_to_resource(dn, 0, &irq_res);
+	if (ret == NO_IRQ)
+		irq_res.start = irq_res.end = -1;
+	else
+		irq_res.flags = 0;
+
+	prop = (u32 *)of_get_property(dn, "reg-shift", NULL);
+	if (prop)
+		reg_shift = *prop;
+
+	prop = (u32 *)of_get_property(dn, "pio-mode", NULL);
+	if (prop) {
+		pio_mode = *prop;
+		if (pio_mode > 6) {
+			dev_err(&ofdev->dev, "invalid pio-mode\n");
+			return -EINVAL;
+		}
+	} else {
+		dev_info(&ofdev->dev, "pio-mode unspecified, assuming PIO0\n");
+	}
+
+	pio_mask = 1 << pio_mode;
+	pio_mask |= (1 << pio_mode) - 1;
+
+	return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, &irq_res,
+				     reg_shift, pio_mask);
+}
+
+static int __devexit pata_of_platform_remove(struct of_device *ofdev)
+{
+	return __pata_platform_remove(&ofdev->dev);
+}
+
+static struct of_device_id pata_of_platform_match[] = {
+	{ .compatible = "ata-generic", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, pata_of_platform_match);
+
+static struct of_platform_driver pata_of_platform_driver = {
+	.name		= "pata_of_platform",
+	.match_table	= pata_of_platform_match,
+	.probe		= pata_of_platform_probe,
+	.remove		= __devexit_p(pata_of_platform_remove),
+};
+
+static int __init pata_of_platform_init(void)
+{
+	return of_register_platform_driver(&pata_of_platform_driver);
+}
+module_init(pata_of_platform_init);
+
+static void __exit pata_of_platform_exit(void)
+{
+	of_unregister_platform_driver(&pata_of_platform_driver);
+}
+module_exit(pata_of_platform_exit);
+
+MODULE_DESCRIPTION("OF-platform PATA driver");
+MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
+MODULE_LICENSE("GPL");
-- 
1.5.2.2

^ permalink raw reply related

* Re: [PATCH v2 2/4] [libata] pata_of_platform: OF-Platform PATA device driver
From: Olof Johansson @ 2007-12-04 20:39 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: linux-ide, Paul Mundt, Arnd Bergmann, Jeff Garzik, linuxppc-dev
In-Reply-To: <20071204203751.GA3015@localhost.localdomain>

On Tue, Dec 04, 2007 at 11:37:51PM +0300, Anton Vorontsov wrote:
> On Tue, Dec 04, 2007 at 02:01:21PM -0600, Olof Johansson wrote:
> > On Tue, Dec 04, 2007 at 10:49:21PM +0300, Anton Vorontsov wrote:
> > >  	tristate "Generic platform device PATA support"
> > > -	depends on EMBEDDED || ARCH_RPC
> > > +	depends on EMBEDDED || ARCH_PPC
> > 
> > It needs to be || PPC, not || ARCH_PPC.
> 
> D'oh.
> 
> - - - -
> From: Anton Vorontsov <avorontsov@ru.mvista.com>
> Subject: [PATCH v2.2] [libata] pata_of_platform: OF-Platform PATA device driver
> 
> This driver nicely wraps around pata_platform library functions,
> and provides OF platform bus bindings to the PATA devices.
> 
> In addition fix ARCH_RPC typo in the PATA_PLATFORM Kconfig entry,
> spotted by Olof Johansson.
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>

Reviewed-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* Re: [PATCH v2 3/4] [POWERPC] MPC8349E-mITX: introduce localbus and pata nodes
From: Olof Johansson @ 2007-12-04 20:40 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: linuxppc-dev, Paul Mundt, Arnd Bergmann, Jeff Garzik, linux-ide
In-Reply-To: <20071204194531.GA1253@localhost.localdomain>

On Tue, Dec 04, 2007 at 10:45:31PM +0300, Anton Vorontsov wrote:
> This patch adds localbus and pata nodes to use CF IDE interface
> on MPC8349E-mITX boards.
> 
> Patch also adds code to probe localbus.
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>

Acked-by: Olof Johansson <olof@lixom.net>


-Olof

^ permalink raw reply

* Re: [PATCH v2 1/4] [libata] pata_platform: make probe and remove functions device type neutral
From: Olof Johansson @ 2007-12-04 20:40 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: Jeff Garzik, Arnd Bergmann, linux-ide, linuxppc-dev, Paul Mundt
In-Reply-To: <20071204170625.GA15599@localhost.localdomain>

On Tue, Dec 04, 2007 at 08:06:25PM +0300, Anton Vorontsov wrote:
> Split pata_platform_{probe,remove} into two pieces:
> 1. pata_platform_{probe,remove} -- platform_device-dependant bits;
> 2. __ptata_platform_{probe,remove} -- device type neutral bits.
> 
> This is done to not duplicate code for the OF-platform driver.
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>

Acked-by: Olof Johansson <olof@lixom.net>

Tested with both the old pata_platform and new pata_of_platform drivers on
PA Semi Electra (see separate post with pata_of_platform cutover patch).


-Olof

^ permalink raw reply

* [PATCH] pata_of_platform: Move electra-ide support over to new framework
From: Olof Johansson @ 2007-12-04 20:44 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: Jeff Garzik, Arnd Bergmann, linux-ide, linuxppc-dev, Paul Mundt
In-Reply-To: <20071204170442.GA10460@localhost.localdomain>

[POWERPC] Move electra-ide support over to new pata_of_platform framework

Move electra-ide glue over to the new pata_of_platform framework, and
add the quirks needed to that driver.


Signed-off-by: Olof Johansson <olof@lixom.net>

---

I'll remove the electra-ide stuff from arch/powerpc/platforms/pasemi
once this hits a common tree, since otherwise I'd be without IDE until
they converge (i.e.  2.6.25 merge window).


-Olof

diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
index 4daf118..3e9675a 100644
--- a/drivers/ata/pata_of_platform.c
+++ b/drivers/ata/pata_of_platform.c
@@ -34,11 +34,20 @@ static int __devinit pata_of_platform_probe(struct of_device *ofdev,
 		return -EINVAL;
 	}
 
-	ret = of_address_to_resource(dn, 1, &ctl_res);
-	if (ret) {
-		dev_err(&ofdev->dev, "can't get CTL address from "
-			"device tree\n");
-		return -EINVAL;
+	if (of_device_is_compatible(dn, "electra-ide")) {
+		/* Altstatus is really at offset 0x3f6 from the primary window
+		 * on electra-ide. Adjust ctl_res and io_res accordingly.
+		 */
+		ctl_res = io_res;
+		ctl_res.start = ctl_res.start+0x3f6;
+		io_res.end = ctl_res.start-1;
+	} else {
+		ret = of_address_to_resource(dn, 1, &ctl_res);
+		if (ret) {
+			dev_err(&ofdev->dev, "can't get CTL address from "
+				"device tree\n");
+			return -EINVAL;
+		}
 	}
 
 	ret = of_irq_to_resource(dn, 0, &irq_res);
@@ -76,6 +85,7 @@ static int __devexit pata_of_platform_remove(struct of_device *ofdev)
 
 static struct of_device_id pata_of_platform_match[] = {
 	{ .compatible = "ata-generic", },
+	{ .compatible = "electra-ide", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, pata_of_platform_match);

^ permalink raw reply related

* [PATCH] [POWERPC] Xilinx: clear data caches.
From: Stephen Neuendorffer @ 2007-12-04 20:49 UTC (permalink / raw)
  To: grant.likely, linuxppc-dev

This code is needed to boot without a boot loader.

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

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

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

^ permalink raw reply related

* Re: [PATCH] pata_of_platform: Move electra-ide support over to new framework
From: Jeff Garzik @ 2007-12-04 20:50 UTC (permalink / raw)
  To: Olof Johansson; +Cc: Arnd Bergmann, linux-ide, linuxppc-dev, Paul Mundt
In-Reply-To: <20071204204432.GD8099@lixom.net>

Olof Johansson wrote:
> [POWERPC] Move electra-ide support over to new pata_of_platform framework
> 
> Move electra-ide glue over to the new pata_of_platform framework, and
> add the quirks needed to that driver.
> 
> 
> Signed-off-by: Olof Johansson <olof@lixom.net>
> 
> ---
> 
> I'll remove the electra-ide stuff from arch/powerpc/platforms/pasemi
> once this hits a common tree, since otherwise I'd be without IDE until
> they converge (i.e.  2.6.25 merge window).

FWIW I'm presuming this work will go via a powerpc tree not libata... 
Generally that's not the case, but here it's largely an arch-specific work.

	Jeff

^ permalink raw reply


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