* Re: [i2c] [PATCH] mpc i2c driver, compare to NO_IRQ instead of zero
From: Jon Smirl @ 2008-01-25 17:13 UTC (permalink / raw)
To: i2c, linuxppc-dev
In-Reply-To: <20080121200740.13800.20524.stgit@terra.home>
Any final objections to this patch? When these were changed to 0
instead of NO_IRQ it should have broken polling mode on ppc. ppc would
treat polling mode, NO_IRQ=-1, as an error.
On powerpc this change is a NOP since NO_IRQ=0.
On 1/21/08, Jon Smirl <jonsmirl@gmail.com> wrote:
> Alter the mpc i2c driver to use the NO_IRQ symbol instead of the constant zero when checking for valid interrupts. NO_IRQ=-1 on ppc and NO_IRQ=0 on powerpc so the checks against zero are not correct.
>
> Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
> ---
>
> drivers/i2c/busses/i2c-mpc.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
>
> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
> index bbe787b..d20959d 100644
> --- a/drivers/i2c/busses/i2c-mpc.c
> +++ b/drivers/i2c/busses/i2c-mpc.c
> @@ -99,7 +99,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
> u32 x;
> int result = 0;
>
> - if (i2c->irq == 0)
> + if (i2c->irq == NO_IRQ)
> {
> while (!(readb(i2c->base + MPC_I2C_SR) & CSR_MIF)) {
> schedule();
> @@ -329,7 +329,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> i2c->irq = platform_get_irq(pdev, 0);
> - if (i2c->irq < 0) {
> + if (i2c->irq < NO_IRQ) {
> result = -ENXIO;
> goto fail_get_irq;
> }
> @@ -344,7 +344,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
> goto fail_map;
> }
>
> - if (i2c->irq != 0)
> + if (i2c->irq != NO_IRQ)
> if ((result = request_irq(i2c->irq, mpc_i2c_isr,
> IRQF_SHARED, "i2c-mpc", i2c)) < 0) {
> printk(KERN_ERR
> @@ -367,7 +367,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
> return result;
>
> fail_add:
> - if (i2c->irq != 0)
> + if (i2c->irq != NO_IRQ)
> free_irq(i2c->irq, i2c);
> fail_irq:
> iounmap(i2c->base);
> @@ -384,7 +384,7 @@ static int fsl_i2c_remove(struct platform_device *pdev)
> i2c_del_adapter(&i2c->adap);
> platform_set_drvdata(pdev, NULL);
>
> - if (i2c->irq != 0)
> + if (i2c->irq != NO_IRQ)
> free_irq(i2c->irq, i2c);
>
> iounmap(i2c->base);
>
>
> _______________________________________________
> i2c mailing list
> i2c@lm-sensors.org
> http://lists.lm-sensors.org/mailman/listinfo/i2c
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* [PATCH] hide kernel only code in asm-powerpc/elf.h
From: Olaf Hering @ 2008-01-25 18:08 UTC (permalink / raw)
To: Paul Mackeras, linuxppc-dev
stuff inside CONFIG_* should not be exported via make headers-install
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
include/asm-powerpc/elf.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/asm-powerpc/elf.h
+++ b/include/asm-powerpc/elf.h
@@ -420,6 +420,7 @@ do { \
/* Keep this the last entry. */
#define R_PPC64_NUM 107
+#ifdef __KERNEL__
#ifdef CONFIG_SPU_BASE
/* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */
#define NT_SPU 1
@@ -427,5 +428,6 @@ do { \
#define ARCH_HAVE_EXTRA_ELF_NOTES
#endif /* CONFIG_SPU_BASE */
+#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_ELF_H */
^ permalink raw reply
* Please pull 'for-2.6.25' branch of 4xx tree
From: Josh Boyer @ 2008-01-25 21:19 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
Hi Paul,
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git for-2.6.25
to pick up a few more patches for 4xx that should go in for 2.6.25.
Mostly self explanatory in the changelogs. The diffstat is mostly from
the PIKA Warp board patches that Sean worked quite hard on.
thx,
josh
David Gibson (1):
[POWERPC] Enable RTC for Ebony and Walnut (v2)
Roel Kluin (1):
[POWERPC] 4xx: logical/bitand typo in powerpc/boot/4xx.c
Sean MacLennan (5):
[POWERPC] 4xx: Add PowerPC 440EP Rev C
[POWERPC] 4xx: PIKA Warp base platform
[POWERPC] 4xx: PIKA Warp DTS
[POWERPC] 4xx: PIKA Warp bootwrapper
[POWERPC] 4xx: PIKA Warp defconfig
Stefan Roese (2):
[POWERPC] 4xx: Add 405EXr to cputable
[POWERPC] 4xx: Add AMCC Haleakala (405EXr) dts
arch/powerpc/Kconfig | 2 +-
arch/powerpc/boot/4xx.c | 2 +-
arch/powerpc/boot/Makefile | 4 +-
arch/powerpc/boot/cuboot-warp.c | 39 ++
arch/powerpc/boot/dts/ebony.dts | 5 +-
arch/powerpc/boot/dts/haleakala.dts | 274 +++++++++
arch/powerpc/boot/dts/walnut.dts | 5 +-
arch/powerpc/boot/dts/warp.dts | 239 +++++++
arch/powerpc/configs/warp_defconfig | 1057 ++++++++++++++++++++++++++++++++
arch/powerpc/kernel/cputable.c | 28 +-
arch/powerpc/platforms/40x/walnut.c | 1 +
arch/powerpc/platforms/44x/Kconfig | 15 +
arch/powerpc/platforms/44x/Makefile | 2 +
arch/powerpc/platforms/44x/ebony.c | 2 +
arch/powerpc/platforms/44x/warp-nand.c | 105 ++++
arch/powerpc/platforms/44x/warp.c | 153 +++++
arch/powerpc/platforms/Kconfig | 6 +
arch/powerpc/sysdev/Makefile | 1 +
arch/powerpc/sysdev/of_rtc.c | 59 ++
include/asm-powerpc/of_platform.h | 2 +
20 files changed, 1992 insertions(+), 9 deletions(-)
^ permalink raw reply
* [PATCH 1/2] IB/ehca: Update sma_attr also in case of disruptive config change
From: Joachim Fenkes @ 2008-01-25 20:12 UTC (permalink / raw)
To: LinuxPPC-Dev, LKML, OF-General, Roland Dreier, OF-EWG
Cc: Stefan Roscher, Christoph Raisch
In-Reply-To: <200801252111.11915.fenkes@de.ibm.com>
Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---
drivers/infiniband/hw/ehca/ehca_irq.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index 863b34f..b5ca94c 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -403,6 +403,8 @@ static void parse_ec(struct ehca_shca *shca, u64 eqe)
sport->port_state = IB_PORT_ACTIVE;
dispatch_port_event(shca, port, IB_EVENT_PORT_ACTIVE,
"is active");
+ ehca_query_sma_attr(shca, port,
+ &sport->saved_attr);
} else
notify_port_conf_change(shca, port);
break;
--
1.5.2
^ permalink raw reply related
* Re: [PATCH v3] create modalias file in sysfs for bus of_platform
From: Paul Mackerras @ 2008-01-26 0:23 UTC (permalink / raw)
To: Olaf Hering; +Cc: linuxppc-dev
In-Reply-To: <20080122190939.GA14124@aepfle.de>
Olaf Hering writes:
> Create /sys/bus/of_platform/devices/*/modalias file to allow autoloading
> of modules. modalias files are already present for many other bus types.
This one causes various oopses on boot for me, both on a dual G5 and
on a tibook.
Paul.
^ permalink raw reply
* Re: [i2c] [PATCH] Convert pfc8563 i2c driver from old style to new style
From: Jon Smirl @ 2008-01-25 17:16 UTC (permalink / raw)
To: i2c, linuxppc-dev, Jean Delvare
In-Reply-To: <20080121200901.15517.30253.stgit@terra.home>
Any final objections to this patch? Jean can you pick it up?
On 1/21/08, Jon Smirl <jonsmirl@gmail.com> wrote:
> Convert pfc8563 i2c driver from old style to new style.
>
> Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
> ---
>
> drivers/rtc/rtc-pcf8563.c | 107 +++++++++++----------------------------------
> 1 files changed, 27 insertions(+), 80 deletions(-)
>
>
> diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c
> index b3317fc..8eff549 100644
> --- a/drivers/rtc/rtc-pcf8563.c
> +++ b/drivers/rtc/rtc-pcf8563.c
> @@ -25,10 +25,6 @@
> * located at 0x51 will pass the validation routine due to
> * the way the registers are implemented.
> */
> -static const unsigned short normal_i2c[] = { I2C_CLIENT_END };
> -
> -/* Module parameters */
> -I2C_CLIENT_INSMOD;
>
> #define PCF8563_REG_ST1 0x00 /* status */
> #define PCF8563_REG_ST2 0x01
> @@ -72,9 +68,6 @@ struct pcf8563 {
> int c_polarity; /* 0: MO_C=1 means 19xx, otherwise MO_C=1 means 20xx */
> };
>
> -static int pcf8563_probe(struct i2c_adapter *adapter, int address, int kind);
> -static int pcf8563_detach(struct i2c_client *client);
> -
> /*
> * In the routines that deal directly with the pcf8563 hardware, we use
> * rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch.
> @@ -257,98 +250,52 @@ static const struct rtc_class_ops pcf8563_rtc_ops = {
> .set_time = pcf8563_rtc_set_time,
> };
>
> -static int pcf8563_attach(struct i2c_adapter *adapter)
> +static int pcf8563_remove(struct i2c_client *client)
> {
> - return i2c_probe(adapter, &addr_data, pcf8563_probe);
> + struct rtc_device *rtc = i2c_get_clientdata(client);
> +
> + if (rtc)
> + rtc_device_unregister(rtc);
> +
> + return 0;
> }
>
> +static struct i2c_device_id pcf8563_id[] = {
> + {"pcf8563", 0},
> + {"rtc8564", 0},
> + {},
> +};
> +MODULE_DEVICE_TABLE(i2c, pcf8563_id);
> +
> +static int pcf8563_probe(struct i2c_client *client, const struct i2c_device_id *id);
> +
> static struct i2c_driver pcf8563_driver = {
> .driver = {
> - .name = "pcf8563",
> + .name = "rtc-pcf8563",
> },
> .id = I2C_DRIVERID_PCF8563,
> - .attach_adapter = &pcf8563_attach,
> - .detach_client = &pcf8563_detach,
> + .probe = &pcf8563_probe,
> + .remove = &pcf8563_remove,
> + .id_table = pcf8563_id,
> };
>
> -static int pcf8563_probe(struct i2c_adapter *adapter, int address, int kind)
> +static int pcf8563_probe(struct i2c_client *client, const struct i2c_device_id *id)
> {
> - struct pcf8563 *pcf8563;
> - struct i2c_client *client;
> + int result;
> struct rtc_device *rtc;
>
> - int err = 0;
> -
> - dev_dbg(&adapter->dev, "%s\n", __FUNCTION__);
> -
> - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {
> - err = -ENODEV;
> - goto exit;
> - }
> -
> - if (!(pcf8563 = kzalloc(sizeof(struct pcf8563), GFP_KERNEL))) {
> - err = -ENOMEM;
> - goto exit;
> - }
> -
> - client = &pcf8563->client;
> - client->addr = address;
> - client->driver = &pcf8563_driver;
> - client->adapter = adapter;
> -
> - strlcpy(client->name, pcf8563_driver.driver.name, I2C_NAME_SIZE);
> -
> - /* Verify the chip is really an PCF8563 */
> - if (kind < 0) {
> - if (pcf8563_validate_client(client) < 0) {
> - err = -ENODEV;
> - goto exit_kfree;
> - }
> - }
> -
> - /* Inform the i2c layer */
> - if ((err = i2c_attach_client(client)))
> - goto exit_kfree;
> -
> - dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n");
> + result = pcf8563_validate_client(client);
> + if (result)
> + return result;
>
> rtc = rtc_device_register(pcf8563_driver.driver.name, &client->dev,
> &pcf8563_rtc_ops, THIS_MODULE);
> -
> - if (IS_ERR(rtc)) {
> - err = PTR_ERR(rtc);
> - goto exit_detach;
> - }
> + if (IS_ERR(rtc))
> + return PTR_ERR(rtc);
>
> i2c_set_clientdata(client, rtc);
>
> return 0;
> -
> -exit_detach:
> - i2c_detach_client(client);
> -
> -exit_kfree:
> - kfree(pcf8563);
> -
> -exit:
> - return err;
> -}
> -
> -static int pcf8563_detach(struct i2c_client *client)
> -{
> - struct pcf8563 *pcf8563 = container_of(client, struct pcf8563, client);
> - int err;
> - struct rtc_device *rtc = i2c_get_clientdata(client);
> -
> - if (rtc)
> - rtc_device_unregister(rtc);
> -
> - if ((err = i2c_detach_client(client)))
> - return err;
> -
> - kfree(pcf8563);
> -
> - return 0;
> }
>
> static int __init pcf8563_init(void)
>
>
> _______________________________________________
> i2c mailing list
> i2c@lm-sensors.org
> http://lists.lm-sensors.org/mailman/listinfo/i2c
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* Re: [PATCH 5/5] [POWERPC] fsl_soc, legacy_serial: add support for "soc" compatible matching
From: Anton Vorontsov @ 2008-01-25 18:53 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev list, Yoder Stuart
In-Reply-To: <479A27AF.5080701@freescale.com>
On Fri, Jan 25, 2008 at 12:17:19PM -0600, Scott Wood wrote:
> Anton Vorontsov wrote:
> >Freescale soc register space: "fsl,soc"
> >generic soc device: "soc" (or maybe "linux,soc" better?)
> >
> >I know, Scott Wood is pushing "xxxx-immr" thing forward... but
> >I don't like that name because SOC isn't only device with the
> >Internal Memory Mapped Registers.
>
> If you look in the manual for xxxx, you'll find something called
> "Internal Memory Mapped Registers". Thus, the name xxxx-immr.
Theory.
> >(Think of QE placed outside of "soc"/"immr" node).
>
> When is the QE ever placed outside the soc/immr/ccsr node?
> The QE registers are part of the IMMR/CCSR.
Practice.
$ grep qe@ arch/powerpc/boot/dts/*
arch/powerpc/boot/dts/mpc832x_mds.dts: qe@e0100000 {
arch/powerpc/boot/dts/mpc832x_rdb.dts: qe@e0100000 {
arch/powerpc/boot/dts/mpc836x_mds.dts: qe@e0100000 {
arch/powerpc/boot/dts/mpc8568mds.dts: qe@e0080000 {
^^^ if the practice is wrong, then we should fix it, and then
-immr would be the good name indeed (just as I've said previously).
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH 5/5] [POWERPC] fsl_soc, legacy_serial: add support for "soc" compatible matching
From: Scott Wood @ 2008-01-25 18:17 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev list, Yoder Stuart
In-Reply-To: <20080125171355.GA9879@localhost.localdomain>
Anton Vorontsov wrote:
> Freescale soc register space: "fsl,soc"
> generic soc device: "soc" (or maybe "linux,soc" better?)
>
> I know, Scott Wood is pushing "xxxx-immr" thing forward... but
> I don't like that name because SOC isn't only device with the
> Internal Memory Mapped Registers.
If you look in the manual for xxxx, you'll find something called
"Internal Memory Mapped Registers". Thus, the name xxxx-immr.
>(Think of QE placed outside of "soc"/"immr" node).
When is the QE ever placed outside the soc/immr/ccsr node?
The QE registers are part of the IMMR/CCSR.
-Scott
^ permalink raw reply
* Re: [PATCH 7/9] powerpc: add MPC837x RDB platform support
From: Kim Phillips @ 2008-01-25 17:45 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Jerry, Huang, Joe D'Abbraccio
In-Reply-To: <ED723035-5E14-44B5-B35C-B94133561D78@kernel.crashing.org>
On Fri, 25 Jan 2008 10:17:14 -0600
Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Jan 24, 2008, at 8:47 PM, Kim Phillips wrote:
>
> > primarily based on mpc837x mds code.
> >
> > Signed-off-by: Joe D'Abbraccio <ljd015@freescale.com>
> > Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> > ---
>
> Who's the actual other of these patches? (all 9 of them).
I took Joe's 837x from:
http://ozlabs.org/pipermail/linuxppc-embedded/2007-September/028460.html
and updated them.
831x I took from Jerry Huang's tree and updated them.
Kim
^ permalink raw reply
* RE: Failed to mount rootfs
From: Bizhan Gholikhamseh (bgholikh) @ 2008-01-25 16:47 UTC (permalink / raw)
To: hs; +Cc: linuxppc-embedded
In-Reply-To: <47998D8B.8050100@denx.de>
=20
Hi Heiko,=20
> "Bizhan Gholikhamseh (bgholikh)" <bgholikh@cisco.com> wrote:
> > Our custom board is leveraged from MPC8541cds from freescale.
> > We have been running Linux 2.6.11 on it recently I have=20
> tried to boot=20
> > the system with the latest Linux 2.6.22-rc4 from PowerPC git tree.
> > =20
> > I did ported the libfdt to our older version of the uboot and were=20
> > able to
>=20
> Hmm... why you didnt use actual code?
>=20
> [...]
> > chosen {
> > linux,stdout-path =3D "/soc8541@e0000000/serial@4600";
> > };
> > chosen {
> > name =3D "chosen";
> > bootargs =3D "root=3D/dev/ram rw console=3DttyS1,115200";
> > linux,platform =3D <600>;
> > linux,initrd-start =3D <1ef33000>;
> > linux,initrd-end =3D <1fe190aa>;
> > linux,stdout-path =3D "/soc8541@e0000000/serial@4600";
> > };
> > };
>=20
> Here is your problem, you have 2 choosen nodes:
>=20
> 64k data, 108k bss, 116k init) Mount-cache hash table entries: 512
> device-tree: Duplicate name in /, renamed to "chosen#1"
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> -> Linux didnt find your commandline ...
>=20
> Hmm... do you have CONFIG_OF_FLAT_TREE and CONFIG_OF_LIBFDT defined?
> If so, this would explain, why you have 2 choosen nodes.
Yes I do have both CONFIG_OF_FLAT_TREE and CONFIG_OF_LIBFDT defined. Is
there a document to tell more about these options please?
Thanks,
Bizhan
^ permalink raw reply
* drivers/char/hvc_* and /Documentation/powerpc/hvcs.txt
From: Timur Tabi @ 2008-01-25 22:39 UTC (permalink / raw)
To: linuxppc-dev
Hi,
I'm working on a console driver for the Freescale hypervisor. I notice a bunch
of hvc_* files in the drivers/char directory. I also noticed
/Documentation/powerpc/hvcs.txt.
My guess is that hvcs.txt talks about drivers/char/hvcs.c, which is a console
driver specific to some IBM hypervisor. The hvc_*.c files are based on that
code but they're more generic and allow people to write console drivers for
other hypervisors easliy. Am I right?
If so, does this mean that I can take hvc_beat.c, modify it to make Freescale
hypervisor calls instead, and presto, I'm done?
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: [PATCH 5/5] [POWERPC] fsl_soc, legacy_serial: add support for "soc" compatible matching
From: Anton Vorontsov @ 2008-01-25 17:26 UTC (permalink / raw)
To: Kumar Gala; +Cc: Scott Wood, linuxppc-dev list, Yoder Stuart
In-Reply-To: <20080125171355.GA9879@localhost.localdomain>
On Fri, Jan 25, 2008 at 08:13:55PM +0300, Anton Vorontsov wrote:
[...]
> My thinking:
>
> Freescale soc register space: "fsl,soc"
> generic soc device: "soc" (or maybe "linux,soc" better?)
>
> I know, Scott Wood is pushing "xxxx-immr" thing forward... but
> I don't like that name because SOC isn't only device with the
> Internal Memory Mapped Registers. (Think of QE placed outside
> of "soc"/"immr" node).
>
> Though, "soc" by itself is fully unfortunate name. QE is the
> part of SOC too, as we used to call it when speaking of hardware.
> But logically we divide things for "core soc" and "core soc's
> companion/communication/offload modules", i.e. QE/CPMs/...
>
> We can remove that ambiguity by moving QE/CPMs nodes inside
> the soc node. Then indeed -immr would be the best compatible for
> the "soc" node.
Oh, and yes, I'm aware that CPM's IMMRs are relocatable, and
that's [most probably] why we have CPMs outside of soc node.
So, my point is that that -immr name is too vague, so in my
opinion we should avoid using it.
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* [PATCHv3 2.6.25] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers
From: Jochen Friedrich @ 2008-01-25 17:11 UTC (permalink / raw)
To: Scott Wood; +Cc: Kernel, Linux, linuxppc-dev list, Linux I2C, Jean Delvare
Using the port of 2.4 code from Vitaly Bordug <vitb@kernel.crashing.org>
and the actual algorithm used by the i2c driver of the DBox code on
cvs.tuxboc.org from Tmbinc, Gillem (htoa@gmx.net). Renamed i2c-rpx.c and
i2c-algo-8xx.c to i2c-cpm.c and converted the driver to an
of_platform_driver.
Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
arch/powerpc/boot/dts/mpc8272ads.dts | 10 +
arch/powerpc/boot/dts/mpc866ads.dts | 10 +
arch/powerpc/boot/dts/mpc885ads.dts | 10 +
arch/powerpc/platforms/8xx/mpc885ads_setup.c | 5 +
drivers/i2c/busses/Kconfig | 10 +
drivers/i2c/busses/Makefile | 1 +
drivers/i2c/busses/i2c-cpm.c | 759 ++++++++++++++++++++++++++
7 files changed, 805 insertions(+), 0 deletions(-)
create mode 100644 drivers/i2c/busses/i2c-cpm.c
diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts
index 7285ca1..7273996 100644
--- a/arch/powerpc/boot/dts/mpc8272ads.dts
+++ b/arch/powerpc/boot/dts/mpc8272ads.dts
@@ -215,6 +215,16 @@
linux,network-index = <1>;
fsl,cpm-command = <16200300>;
};
+
+ i2c@11860 {
+ compatible = "fsl,mpc8248-i2c",
+ "fsl,cpm2-i2c",
+ "fsl,cpm-i2c";
+ reg = <11860 20 8afc 2>;
+ interrupts = <1 8>;
+ interrupt-parent = <&PIC>;
+ fsl,cpm-command = <29600000>;
+ };
};
PIC: interrupt-controller@10c00 {
diff --git a/arch/powerpc/boot/dts/mpc866ads.dts b/arch/powerpc/boot/dts/mpc866ads.dts
index daf9433..80c08bf 100644
--- a/arch/powerpc/boot/dts/mpc866ads.dts
+++ b/arch/powerpc/boot/dts/mpc866ads.dts
@@ -169,6 +169,16 @@
fsl,cpm-command = <0000>;
linux,network-index = <1>;
};
+
+ i2c@860 {
+ compatible = "fsl,mpc866-i2c",
+ "fsl,cpm1-i2c",
+ "fsl,cpm-i2c";
+ reg = <860 20 3c80 30>;
+ interrupts = <10 3>;
+ interrupt-parent = <&Cpm_pic>;
+ fsl,cpm-command = <0010>;
+ };
};
};
diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts
index 8848e63..fd9c9d7 100644
--- a/arch/powerpc/boot/dts/mpc885ads.dts
+++ b/arch/powerpc/boot/dts/mpc885ads.dts
@@ -213,6 +213,16 @@
fsl,cpm-command = <0080>;
linux,network-index = <2>;
};
+
+ i2c@860 {
+ compatible = "fsl,mpc885-i2c",
+ "fsl,cpm1-i2c",
+ "fsl,cpm-i2c";
+ reg = <860 20 3c80 30>;
+ interrupts = <10>;
+ interrupt-parent = <&CPM_PIC>;
+ fsl,cpm-command = <0010>;
+ };
};
};
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index f39447b..1e7d056 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -157,6 +157,11 @@ static struct cpm_pin mpc885ads_pins[] = {
{CPM_PORTE, 28, CPM_PIN_OUTPUT},
{CPM_PORTE, 29, CPM_PIN_OUTPUT},
#endif
+ /* I2C */
+#ifdef CONFIG_I2C_8XX
+ {CPM_PORTB, 26, CPM_PIN_INPUT | CPM_PIN_OPENDRAIN},
+ {CPM_PORTB, 27, CPM_PIN_INPUT | CPM_PIN_OPENDRAIN},
+#endif
};
static void __init init_ioports(void)
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index c466c6c..5950172 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -114,6 +114,16 @@ config I2C_BLACKFIN_TWI_CLK_KHZ
help
The unit of the TWI clock is kHz.
+config I2C_CPM
+ tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)"
+ depends on (CPM1 || CPM2) && I2C && PPC_OF
+ help
+ This supports the use of the I2C interface on Freescale
+ processors with CPM1 or CPM2.
+
+ This driver can also be built as a module. If so, the module
+ will be called i2c-cpm.
+
config I2C_DAVINCI
tristate "DaVinci I2C driver"
depends on ARCH_DAVINCI
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index 81d43c2..a395555 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o
obj-$(CONFIG_I2C_AT91) += i2c-at91.o
obj-$(CONFIG_I2C_AU1550) += i2c-au1550.o
obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o
+obj-$(CONFIG_I2C_CPM) += i2c-cpm.o
obj-$(CONFIG_I2C_DAVINCI) += i2c-davinci.o
obj-$(CONFIG_I2C_ELEKTOR) += i2c-elektor.o
obj-$(CONFIG_I2C_GPIO) += i2c-gpio.o
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
new file mode 100644
index 0000000..7191427
--- /dev/null
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -0,0 +1,759 @@
+/*
+ * Freescale CPM1/CPM2 I2C interface.
+ * Copyright (c) 1999 Dan Malek (dmalek@jlc.net).
+ *
+ * moved into proper i2c interface;
+ * Brad Parker (brad@heeltoe.com)
+ *
+ * (C) 2007 Montavista Software, Inc.
+ * Vitaly Bordug <vitb@kernel.crashing.org>
+ *
+ * RPX lite specific parts of the i2c interface
+ * Update: There actually isn't anything RPXLite-specific about this module.
+ * This should work for most any CPM board. The console messages have been
+ * changed to eliminate RPXLite references.
+ *
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * moved into proper i2c interface; separated out platform specific
+ * parts into i2c-8xx.c
+ * Brad Parker (brad@heeltoe.com)
+ *
+ * Parts from dbox2_i2c.c (cvs.tuxbox.org)
+ * (C) 2000-2001 Tmbinc, Gillem (htoa@gmx.net)
+ *
+ * (C) 2007 Montavista Software, Inc.
+ * Vitaly Bordug <vitb@kernel.crashing.org>
+ *
+ * Converted to of_platform_device. Renamed to i2c-cpm.c.
+ * (C) 2007 Jochen Friedrich <jochen@scram.de>
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/stddef.h>
+#include <linux/i2c.h>
+#include <linux/io.h>
+#include <linux/time.h>
+#include <linux/dma-mapping.h>
+#include <linux/of_device.h>
+#include <linux/of_platform.h>
+#include <sysdev/fsl_soc.h>
+#include <asm/cpm.h>
+
+/*
+ * Wait for patch from Jon Smirl
+ * #include "powerpc-common.h"
+ */
+
+/* Try to define this if you have an older CPU (earlier than rev D4) */
+/* However, better use a GPIO based bitbang driver in this case :/ */
+#undef I2C_CHIP_ERRATA
+
+#define CPM_MAX_READ 513
+#define CPM_MAXBD 4
+
+#define CPM_CR_INIT_TRX (0x00)
+#define CPM_CR_CLOSE_RXBD (0x07)
+
+#define I2C_EB (0x10) /* Big endian mode */
+
+/* I2C parameter RAM. */
+struct i2c_ram {
+ ushort rbase; /* Rx Buffer descriptor base address */
+ ushort tbase; /* Tx Buffer descriptor base address */
+ u_char rfcr; /* Rx function code */
+ u_char tfcr; /* Tx function code */
+ ushort mrblr; /* Max receive buffer length */
+ uint rstate; /* Internal */
+ uint rdp; /* Internal */
+ ushort rbptr; /* Rx Buffer descriptor pointer */
+ ushort rbc; /* Internal */
+ uint rxtmp; /* Internal */
+ uint tstate; /* Internal */
+ uint tdp; /* Internal */
+ ushort tbptr; /* Tx Buffer descriptor pointer */
+ ushort tbc; /* Internal */
+ uint txtmp; /* Internal */
+ char res1[4]; /* Reserved */
+ ushort rpbase; /* Relocation pointer */
+ char res2[2]; /* Reserved */
+};
+
+/* I2C Registers */
+struct i2c_reg {
+ u8 i2mod;
+ u8 res1[3];
+ u8 i2add;
+ u8 res2[3];
+ u8 i2brg;
+ u8 res3[3];
+ u8 i2com;
+ u8 res4[3];
+ u8 i2cer;
+ u8 res5[3];
+ u8 i2cmr;
+};
+
+struct cpm_i2c {
+ char *base;
+ struct of_device *ofdev;
+ struct i2c_adapter adap;
+ uint dp_addr;
+ int version; /* CPM1=1, CPM2=2 */
+ int irq;
+ int cp_command;
+ struct i2c_reg __iomem *i2c_reg;
+ struct i2c_ram __iomem *i2c_ram;
+ u16 i2c_addr;
+ wait_queue_head_t i2c_wait;
+ struct mutex i2c_mutex; /* Protects I2C CPM */
+ u_char *txbuf[CPM_MAXBD];
+ u_char *rxbuf[CPM_MAXBD];
+ u32 txdma[CPM_MAXBD];
+ u32 rxdma[CPM_MAXBD];
+};
+
+static irqreturn_t cpm_i2c_interrupt(int irq, void *dev_id)
+{
+ struct cpm_i2c *cpm;
+ struct i2c_reg __iomem *i2c_reg;
+ struct i2c_adapter *adap = dev_id;
+ int i;
+
+ cpm = i2c_get_adapdata(dev_id);
+ i2c_reg = cpm->i2c_reg;
+
+ /* Clear interrupt. */
+ i = in_8(&i2c_reg->i2cer);
+ out_8(&i2c_reg->i2cer, i);
+
+ dev_dbg(&adap->dev, "Interrupt: %x\n", i);
+
+ /* Get 'me going again. */
+ wake_up_interruptible(&cpm->i2c_wait);
+
+ return i ? IRQ_HANDLED : IRQ_NONE;
+}
+
+static void cpm_reset_i2c_params(struct cpm_i2c *cpm)
+{
+ struct i2c_ram __iomem *i2c_ram = cpm->i2c_ram;
+
+ /* Set up the IIC parameters in the parameter ram. */
+ out_be16(&i2c_ram->tbase, cpm->dp_addr);
+ out_be16(&i2c_ram->rbase, cpm->dp_addr + sizeof(cbd_t) * CPM_MAXBD);
+
+ out_8(&i2c_ram->tfcr, I2C_EB);
+ out_8(&i2c_ram->rfcr, I2C_EB);
+
+ out_be16(&i2c_ram->mrblr, CPM_MAX_READ);
+
+ out_be32(&i2c_ram->rstate, 0);
+ out_be32(&i2c_ram->rdp, 0);
+ out_be16(&i2c_ram->rbptr, in_be16(&i2c_ram->rbase));
+ out_be16(&i2c_ram->rbc, 0);
+ out_be32(&i2c_ram->rxtmp, 0);
+ out_be32(&i2c_ram->tstate, 0);
+ out_be32(&i2c_ram->tdp, 0);
+ out_be16(&i2c_ram->tbptr, in_be16(&i2c_ram->tbase));
+ out_be16(&i2c_ram->tbc, 0);
+ out_be32(&i2c_ram->txtmp, 0);
+}
+
+static void cpm_i2c_force_close(struct i2c_adapter *adap)
+{
+ struct cpm_i2c *cpm = i2c_get_adapdata(adap);
+ struct i2c_reg __iomem *i2c_reg = cpm->i2c_reg;
+
+ dev_dbg(&adap->dev, "cpm_i2c_force_close()\n");
+
+ cpm_command(cpm->cp_command, CPM_CR_CLOSE_RXBD);
+
+ out_8(&i2c_reg->i2cmr, 0x00); /* Disable all interrupts */
+ out_8(&i2c_reg->i2cer, 0xff);
+}
+
+static void cpm_i2c_parse_message(struct i2c_adapter *adap,
+ struct i2c_msg *pmsg, int num, int tx, int rx)
+{
+ cbd_t *tbdf, *rbdf;
+ u_char addr;
+ u_char *tb;
+ u_char *rb;
+ struct cpm_i2c *cpm = i2c_get_adapdata(adap);
+ struct i2c_ram __iomem *i2c_ram = cpm->i2c_ram;
+ int i, dscan;
+
+ tbdf = (cbd_t *) cpm_muram_addr(in_be16(&i2c_ram->tbase));
+ rbdf = (cbd_t *) cpm_muram_addr(in_be16(&i2c_ram->rbase));
+
+ /*
+ * This chip can't do zero length writes. However, the i2c core uses
+ * them to scan for devices. The best we can do is to convert them
+ * into 1 byte reads
+ */
+
+ dscan = ((pmsg->len == 0) && (num == 1));
+
+ addr = pmsg->addr << 1;
+ if ((pmsg->flags & I2C_M_RD) || dscan)
+ addr |= 1;
+
+ tb = cpm->txbuf[tx];
+ rb = cpm->rxbuf[rx];
+
+ /* Align read buffer */
+ rb = (u_char *) (((ulong) rb + 1) & ~1);
+
+ if ((pmsg->flags & I2C_M_RD) || dscan) {
+ /*
+ * To read, we need an empty buffer of the proper length.
+ * All that is used is the first byte for address, the remainder
+ * is just used for timing (and doesn't really have to exist).
+ */
+ tb[0] = addr; /* Device address byte w/rw flag */
+
+ dev_dbg(&adap->dev, "cpm_i2c_read(abyte=0x%x)\n", addr);
+
+ if (dscan)
+ tbdf[tx].cbd_datlen = 2;
+ else
+ tbdf[tx].cbd_datlen = pmsg->len + 1;
+
+ tbdf[tx].cbd_sc = 0;
+
+ if (!(pmsg->flags & I2C_M_NOSTART))
+ tbdf[tx].cbd_sc |= BD_I2C_START;
+ if (tx + 1 == num)
+ tbdf[tx].cbd_sc |= BD_SC_LAST | BD_SC_WRAP;
+
+ rbdf[rx].cbd_datlen = 0;
+ rbdf[rx].cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT;
+
+ if (rx + 1 == CPM_MAXBD)
+ tbdf[rx].cbd_sc |= BD_SC_WRAP;
+
+ eieio();
+ tbdf[tx].cbd_sc |= BD_SC_READY;
+ } else {
+ tb[0] = addr; /* Device address byte w/rw flag */
+ for (i = 0; i < pmsg->len; i++)
+ tb[i+1] = pmsg->buf[i];
+
+ dev_dbg(&adap->dev, "cpm_iic_write(abyte=0x%x)\n", addr);
+
+ tbdf[tx].cbd_datlen = pmsg->len + 1;
+ tbdf[tx].cbd_sc = 0;
+
+ if (!(pmsg->flags & I2C_M_NOSTART))
+ tbdf[tx].cbd_sc |= BD_I2C_START;
+
+ if (tx + 1 == num)
+ tbdf[tx].cbd_sc |= BD_SC_LAST | BD_SC_WRAP;
+
+ eieio();
+ tbdf[tx].cbd_sc |= BD_SC_READY | BD_SC_INTRPT;
+
+ dev_dbg(&adap->dev, "tx sc %d %04x\n",
+ tx, tbdf[tx].cbd_sc);
+ }
+}
+
+static int cpm_i2c_check_message(struct i2c_adapter *adap,
+ struct i2c_msg *pmsg, int tx, int rx)
+{
+ cbd_t *tbdf, *rbdf;
+ u_char *tb;
+ u_char *rb;
+ struct cpm_i2c *cpm = i2c_get_adapdata(adap);
+ struct i2c_ram __iomem *i2c_ram = cpm->i2c_ram;
+ int i;
+
+ tbdf = (cbd_t *) cpm_muram_addr(in_be16(&i2c_ram->tbase));
+ rbdf = (cbd_t *) cpm_muram_addr(in_be16(&i2c_ram->rbase));
+
+ tb = cpm->txbuf[tx];
+ rb = cpm->rxbuf[rx];
+
+ /* Align read buffer */
+ rb = (u_char *) (((uint) rb + 1) & ~1);
+
+ if (pmsg->flags & I2C_M_RD) {
+ dev_dbg(&adap->dev, "rx sc %04x, rx sc %04x\n",
+ tbdf[tx].cbd_sc, rbdf[rx].cbd_sc);
+
+ if (tbdf[tx].cbd_sc & BD_SC_NAK) {
+ dev_dbg(&adap->dev, "IIC read; No ack\n");
+
+ if (pmsg->flags & I2C_M_IGNORE_NAK)
+ return 0;
+ else
+ return -EIO;
+ }
+ if (rbdf[rx].cbd_sc & BD_SC_EMPTY) {
+ dev_dbg(&adap->dev,
+ "IIC read; complete but rbuf empty\n");
+ return -EREMOTEIO;
+ }
+ if (rbdf[rx].cbd_sc & BD_SC_OV) {
+ dev_dbg(&adap->dev, "IIC read; Overrun\n");
+ return -EREMOTEIO;
+ }
+ for (i = 0; i < pmsg->len; i++)
+ pmsg->buf[i] = rb[i];
+ } else {
+ dev_dbg(&adap->dev, "tx sc %d %04x\n", tx, tbdf[tx].cbd_sc);
+
+ if (tbdf[tx].cbd_sc & BD_SC_NAK) {
+ dev_dbg(&adap->dev, "IIC write; No ack\n");
+
+ if (pmsg->flags & I2C_M_IGNORE_NAK)
+ return 0;
+ else
+ return -EIO;
+ }
+ if (tbdf[tx].cbd_sc & BD_SC_UN) {
+ dev_dbg(&adap->dev, "IIC write; Underrun\n");
+ return -EIO;
+ }
+ if (tbdf[tx].cbd_sc & BD_SC_CL) {
+ dev_dbg(&adap->dev, "IIC write; Collision\n");
+ return -EIO;
+ }
+ }
+ return 0;
+}
+
+static int cpm_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+{
+ struct cpm_i2c *cpm = i2c_get_adapdata(adap);
+ struct i2c_reg __iomem *i2c_reg = cpm->i2c_reg;
+ struct i2c_ram __iomem *i2c_ram = cpm->i2c_ram;
+ struct i2c_msg *pmsg, *rmsg;
+ int ret, i;
+ int tptr;
+ int rptr;
+ cbd_t *tbdf, *rbdf;
+
+ if (num > CPM_MAXBD)
+ return -EINVAL;
+
+ /* Check if we have any oversized READ requests */
+ for (i = 0; i < num; i++) {
+ pmsg = &msgs[i];
+ if (pmsg->len >= CPM_MAX_READ)
+ return -EINVAL;
+ }
+
+ mutex_lock(&cpm->i2c_mutex);
+
+ /* Reset to use first buffer */
+ out_be16(&i2c_ram->rbptr, in_be16(&i2c_ram->rbase));
+ out_be16(&i2c_ram->tbptr, in_be16(&i2c_ram->tbase));
+
+ tbdf = (cbd_t *) cpm_muram_addr(in_be16(&i2c_ram->tbase));
+ rbdf = (cbd_t *) cpm_muram_addr(in_be16(&i2c_ram->rbase));
+
+ tptr = 0;
+ rptr = 0;
+
+ while (tptr < num) {
+ pmsg = &msgs[tptr];
+ dev_dbg(&adap->dev, "i2c-algo-cpm.o: " "R: %d T: %d\n",
+ rptr, tptr);
+
+ cpm_i2c_parse_message(adap, pmsg, num, tptr, rptr);
+ if (pmsg->flags & I2C_M_RD)
+ rptr++;
+ tptr++;
+ }
+ /* Start transfer now */
+ /* Chip bug, set enable here */
+ out_8(&i2c_reg->i2cmr, 0x13); /* Enable RX/TX/Error interupts */
+ out_8(&i2c_reg->i2cer, 0xff); /* Clear interrupt status */
+ out_8(&i2c_reg->i2mod, in_8(&i2c_reg->i2mod) | 1); /* Enable */
+ /* Begin transmission */
+ out_8(&i2c_reg->i2com, in_8(&i2c_reg->i2com) | 0x80);
+
+ tptr = 0;
+ rptr = 0;
+
+ while (tptr < num) {
+ /* Check for outstanding messages */
+ dev_dbg(&adap->dev, "test ready.\n");
+ if (!(tbdf[tptr].cbd_sc & BD_SC_READY)) {
+ dev_dbg(&adap->dev, "ready.\n");
+ rmsg = &msgs[tptr];
+ ret = cpm_i2c_check_message(adap, rmsg, tptr, rptr);
+ tptr++;
+ if (rmsg->flags & I2C_M_RD)
+ rptr++;
+ if (ret)
+ goto out_err;
+ } else {
+ dev_dbg(&adap->dev, "not ready.\n");
+ ret = wait_event_interruptible_timeout(cpm->i2c_wait,
+ !(tbdf[tptr].cbd_sc & BD_SC_READY), 1 * HZ);
+ if (ret == 0) {
+ ret = -EREMOTEIO;
+ dev_dbg(&adap->dev, "I2C read: timeout!\n");
+ goto out_err;
+ }
+ }
+ }
+#ifdef I2C_CHIP_ERRATA
+ /*
+ * Chip errata, clear enable. This is not needed on rev D4 CPUs.
+ * Disabling I2C too early may cause too short stop condition
+ */
+ udelay(4);
+ out_8(&i2c_reg->i2mod, in_8(&i2c_reg->i2mod) | ~1);
+#endif
+ mutex_unlock(&cpm->i2c_mutex);
+ return (num);
+
+out_err:
+ cpm_i2c_force_close(adap);
+#ifdef I2C_CHIP_ERRATA
+ /*
+ * Chip errata, clear enable. This is not needed on rev D4 CPUs.
+ */
+ out_8(&i2c_reg->i2mod, in_8(&i2c_reg->i2mod) | ~1);
+#endif
+ mutex_unlock(&cpm->i2c_mutex);
+ return ret;
+}
+
+static u32 cpm_i2c_func(struct i2c_adapter *adap)
+{
+ return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+}
+
+/* -----exported algorithm data: ------------------------------------- */
+
+static const struct i2c_algorithm cpm_i2c_algo = {
+ .master_xfer = cpm_i2c_xfer,
+ .functionality = cpm_i2c_func,
+};
+
+static const struct i2c_adapter cpm_ops = {
+ .owner = THIS_MODULE,
+ .name = "i2c-cpm",
+ .id = I2C_HW_MPC8XX_EPON,
+ .algo = &cpm_i2c_algo,
+ .class = I2C_CLASS_HWMON,
+};
+
+static int cpm_i2c_setup(struct cpm_i2c *cpm)
+{
+ struct of_device *ofdev = cpm->ofdev;
+ const u32 *data;
+ int len, ret, i;
+ void __iomem *i2c_base;
+ cbd_t *tbdf, *rbdf;
+ unsigned char brg;
+
+ pr_debug("i2c-cpm: cpm_i2c_setup()\n");
+
+ init_waitqueue_head(&cpm->i2c_wait);
+ mutex_init(&cpm->i2c_mutex);
+
+ cpm->irq = of_irq_to_resource(ofdev->node, 0, NULL);
+ if (cpm->irq == NO_IRQ)
+ return -EINVAL;
+
+ /* Install interrupt handler. */
+ ret = request_irq(cpm->irq, cpm_i2c_interrupt, 0, "cpm_i2c",
+ &cpm->adap);
+ if (ret)
+ goto out_irq;
+
+ /* IIC parameter RAM */
+ i2c_base = of_iomap(ofdev->node, 1);
+ if (i2c_base == NULL) {
+ ret = -EINVAL;
+ goto out_irq;
+ }
+
+ if (of_device_is_compatible(ofdev->node, "fsl,cpm1-i2c")) {
+
+ /* Check for and use a microcode relocation patch. */
+ cpm->i2c_ram = i2c_base;
+ cpm->i2c_addr = in_be16(&cpm->i2c_ram->rpbase);
+
+ /*
+ * Maybe should use cpm_muram_alloc instead of hardcoding
+ * this in micropatch.c
+ */
+ if (cpm->i2c_addr) {
+ cpm->i2c_ram = cpm_muram_addr(cpm->i2c_addr);
+ iounmap(i2c_base);
+ }
+
+ cpm->version = 1;
+
+ } else if (of_device_is_compatible(ofdev->node, "fsl,cpm2-i2c")) {
+ cpm->i2c_addr = cpm_muram_alloc(sizeof(struct i2c_ram), 64);
+ cpm->i2c_ram = cpm_muram_addr(cpm->i2c_addr);
+ out_be16(i2c_base, cpm->i2c_addr);
+ iounmap(i2c_base);
+
+ cpm->version = 2;
+
+ } else {
+ iounmap(i2c_base);
+ ret = -EINVAL;
+ goto out_irq;
+ }
+
+ /* I2C control/status registers */
+ cpm->i2c_reg = of_iomap(ofdev->node, 0);
+ if (cpm->i2c_reg == NULL) {
+ ret = -EINVAL;
+ goto out_ram;
+ }
+
+ data = of_get_property(ofdev->node, "fsl,cpm-command", &len);
+ if (!data || len != 4) {
+ ret = -EINVAL;
+ goto out_reg;
+ }
+ cpm->cp_command = *data;
+
+ data = of_get_property(ofdev->node, "linux,i2c-class", &len);
+ if (data && len == 4)
+ cpm->adap.class = *data;
+
+ /*
+ * Allocate space for CPM_MAXBD transmit and receive buffer
+ * descriptors in the DP ram.
+ */
+ cpm->dp_addr = cpm_muram_alloc(sizeof(cbd_t) * 2 * CPM_MAXBD, 8);
+ if (!cpm->dp_addr) {
+ ret = -ENOMEM;
+ goto out_reg;
+ }
+
+ /* Initialize Tx/Rx parameters. */
+
+ cpm_reset_i2c_params(cpm);
+
+ pr_debug("i2c-cpm: i2c_ram %x, dp_addr 0x%x\n", (uint) cpm->i2c_ram,
+ cpm->dp_addr);
+ pr_debug("i2c-cpm: tbase %d, rbase %d\n",
+ in_be16(&cpm->i2c_ram->tbase), in_be16(&cpm->i2c_ram->rbase));
+
+ tbdf = (cbd_t *) cpm_muram_addr(in_be16(&cpm->i2c_ram->tbase));
+ rbdf = (cbd_t *) cpm_muram_addr(in_be16(&cpm->i2c_ram->rbase));
+
+ /* Allocate TX and RX buffers */
+
+ for (i = 0; i < CPM_MAXBD; i++) {
+ cpm->rxbuf[i] = dma_alloc_coherent(
+ NULL, CPM_MAX_READ + 1, &cpm->rxdma[i], GFP_KERNEL);
+ if (!cpm->rxbuf[i]) {
+ ret = -ENOMEM;
+ goto out_muram;
+ }
+ rbdf[i].cbd_bufaddr = ((cpm->rxdma[i] + 1) & ~1);
+ cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(
+ NULL, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL);
+ if (!cpm->txbuf[i]) {
+ ret = -ENOMEM;
+ goto out_muram;
+ }
+ tbdf[i].cbd_bufaddr = cpm->txdma[i];
+ }
+
+ cpm_command(cpm->cp_command, CPM_CR_INIT_TRX);
+
+ /*
+ * Select an invalid address. Just make sure we don't use loopback mode
+ */
+ out_8(&cpm->i2c_reg->i2add, 0xfe);
+
+ /* Make clock run at 60 kHz. */
+
+ brg = get_brgfreq() / (32 * 2 * 60000) - 3;
+ out_8(&cpm->i2c_reg->i2brg, brg);
+
+ out_8(&cpm->i2c_reg->i2mod, 0x00);
+ out_8(&cpm->i2c_reg->i2com, 0x01); /* Master mode */
+
+ /* Disable interrupts. */
+ out_8(&cpm->i2c_reg->i2cmr, 0);
+ out_8(&cpm->i2c_reg->i2cer, 0xff);
+
+ return 0;
+
+out_muram:
+ for (i = 0; i < CPM_MAXBD; i++) {
+ if (cpm->rxbuf[i])
+ dma_free_coherent(NULL, CPM_MAX_READ + 1,
+ cpm->rxbuf[i], cpm->rxdma[i]);
+ if (cpm->txbuf[i])
+ dma_free_coherent(NULL, CPM_MAX_READ + 1,
+ cpm->txbuf[i], cpm->txdma[i]);
+ }
+ cpm_muram_free(cpm->dp_addr);
+out_reg:
+ iounmap(cpm->i2c_reg);
+out_ram:
+ if ((cpm->version == 1) && (!cpm->i2c_addr))
+ iounmap(cpm->i2c_ram);
+ if (cpm->version == 2)
+ cpm_muram_free(cpm->i2c_addr);
+out_irq:
+ free_irq(cpm->irq, &cpm->adap);
+ return ret;
+}
+
+static void cpm_i2c_shutdown(struct cpm_i2c *cpm)
+{
+ int i;
+
+ /* Shut down I2C. */
+ out_8(&cpm->i2c_reg->i2mod, in_8(&cpm->i2c_reg->i2mod) | ~1);
+
+ /* Disable interrupts */
+ out_8(&cpm->i2c_reg->i2cmr, 0);
+ out_8(&cpm->i2c_reg->i2cer, 0xff);
+
+ free_irq(cpm->irq, &cpm->adap);
+
+ /* Free all memory */
+ for (i = 0; i < CPM_MAXBD; i++) {
+ dma_free_coherent(NULL, CPM_MAX_READ + 1,
+ cpm->rxbuf[i], cpm->rxdma[i]);
+ dma_free_coherent(NULL, CPM_MAX_READ + 1,
+ cpm->txbuf[i], cpm->txdma[i]);
+ }
+
+ cpm_muram_free(cpm->dp_addr);
+ iounmap(cpm->i2c_reg);
+
+ if ((cpm->version == 1) && (!cpm->i2c_addr))
+ iounmap(cpm->i2c_ram);
+ if (cpm->version == 2)
+ cpm_muram_free(cpm->i2c_addr);
+
+ return;
+}
+
+static int __devinit cpm_i2c_probe(struct of_device *ofdev,
+ const struct of_device_id *match)
+{
+ int result;
+ struct cpm_i2c *cpm;
+
+ cpm = kzalloc(sizeof(struct cpm_i2c), GFP_KERNEL);
+ if (!cpm)
+ return -ENOMEM;
+
+ cpm->ofdev = ofdev;
+
+ dev_set_drvdata(&ofdev->dev, cpm);
+
+ cpm->adap = cpm_ops;
+ i2c_set_adapdata(&cpm->adap, cpm);
+ cpm->adap.dev.parent = &ofdev->dev;
+
+ result = cpm_i2c_setup(cpm);
+ if (result) {
+ printk(KERN_ERR "i2c-cpm: Unable to init hardware\n");
+ goto out;
+ }
+
+ /* register new adapter to i2c module... */
+
+ result = i2c_add_adapter(&cpm->adap);
+ if (result < 0) {
+ printk(KERN_ERR "i2c-cpm: Unable to register with I2C\n");
+ goto out2;
+ }
+
+ pr_debug("i2c-cpm: hw routines for %s registered.\n", cpm->adap.name);
+
+ /*
+ * Wait for patch from Jon Smirl
+ * of_register_i2c_devices(&cpm->adap, ofdev->node);
+ */
+
+ return 0;
+out2:
+ cpm_i2c_shutdown(cpm);
+out:
+ dev_set_drvdata(&ofdev->dev, NULL);
+ kfree(cpm);
+
+ return result;
+}
+
+static int __devexit cpm_i2c_remove(struct of_device *ofdev)
+{
+ struct cpm_i2c *cpm = dev_get_drvdata(&ofdev->dev);
+
+ i2c_del_adapter(&cpm->adap);
+
+ cpm_i2c_shutdown(cpm);
+
+ dev_set_drvdata(&ofdev->dev, NULL);
+ kfree(cpm);
+
+ return 0;
+}
+
+static const struct of_device_id cpm_i2c_match[] = {
+ {
+ .compatible = "fsl,cpm-i2c",
+ },
+ {},
+};
+
+MODULE_DEVICE_TABLE(of, cpm_i2c_match);
+
+static struct of_platform_driver cpm_i2c_driver = {
+ .match_table = cpm_i2c_match,
+ .probe = cpm_i2c_probe,
+ .remove = __devexit_p(cpm_i2c_remove),
+ .driver = {
+ .name = "fsl-i2c-cpm",
+ .owner = THIS_MODULE,
+ }
+};
+
+static int __init cpm_i2c_init(void)
+{
+ return of_register_platform_driver(&cpm_i2c_driver);
+}
+
+static void __exit cpm_i2c_exit(void)
+{
+ of_unregister_platform_driver(&cpm_i2c_driver);
+}
+
+module_init(cpm_i2c_init);
+module_exit(cpm_i2c_exit);
+
+MODULE_AUTHOR("Dan Malek <dmalek@jlc.net>");
+MODULE_DESCRIPTION("I2C-Bus adapter routines for CPM boards");
+MODULE_LICENSE("GPL");
--
1.5.3.8
^ permalink raw reply related
* [PATCH 2/2] IB/ehca: Add PMA support
From: Joachim Fenkes @ 2008-01-25 20:18 UTC (permalink / raw)
To: LinuxPPC-Dev, LKML, OF-General, Roland Dreier, OF-EWG
Cc: Stefan Roscher, Christoph Raisch
In-Reply-To: <200801252111.11915.fenkes@de.ibm.com>
From: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
This patch enables ehca to redirect any PMA queries to the
actual PMA QP.
Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Reviewed-by: Joachim Fenkes <fenkes@de.ibm.com>
Reviewed-by: Christoph Raisch <raisch@de.ibm.com>
---
drivers/infiniband/hw/ehca/ehca_classes.h | 1 +
drivers/infiniband/hw/ehca/ehca_iverbs.h | 5 ++
drivers/infiniband/hw/ehca/ehca_main.c | 2 +-
drivers/infiniband/hw/ehca/ehca_sqp.c | 91 +++++++++++++++++++++++++++++
4 files changed, 98 insertions(+), 1 deletions(-)
diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h
index f281d16..92cce8a 100644
--- a/drivers/infiniband/hw/ehca/ehca_classes.h
+++ b/drivers/infiniband/hw/ehca/ehca_classes.h
@@ -101,6 +101,7 @@ struct ehca_sport {
spinlock_t mod_sqp_lock;
enum ib_port_state port_state;
struct ehca_sma_attr saved_attr;
+ u32 pma_qp_nr;
};
#define HCA_CAP_MR_PGSIZE_4K 0x80000000
diff --git a/drivers/infiniband/hw/ehca/ehca_iverbs.h b/drivers/infiniband/hw/ehca/ehca_iverbs.h
index c469bfd..a8a2ea5 100644
--- a/drivers/infiniband/hw/ehca/ehca_iverbs.h
+++ b/drivers/infiniband/hw/ehca/ehca_iverbs.h
@@ -187,6 +187,11 @@ int ehca_dealloc_ucontext(struct ib_ucontext *context);
int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma);
+int ehca_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
+ struct ib_wc *in_wc, struct ib_grh *in_grh,
+ struct ib_mad *in_mad,
+ struct ib_mad *out_mad);
+
void ehca_poll_eqs(unsigned long data);
int ehca_calc_ipd(struct ehca_shca *shca, int port,
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index 0fe0c84..33b5bac 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -472,7 +472,7 @@ int ehca_init_device(struct ehca_shca *shca)
shca->ib_device.dealloc_fmr = ehca_dealloc_fmr;
shca->ib_device.attach_mcast = ehca_attach_mcast;
shca->ib_device.detach_mcast = ehca_detach_mcast;
- /* shca->ib_device.process_mad = ehca_process_mad; */
+ shca->ib_device.process_mad = ehca_process_mad;
shca->ib_device.mmap = ehca_mmap;
if (EHCA_BMASK_GET(HCA_CAP_SRQ, shca->hca_cap)) {
diff --git a/drivers/infiniband/hw/ehca/ehca_sqp.c b/drivers/infiniband/hw/ehca/ehca_sqp.c
index 79e72b2..706d97a 100644
--- a/drivers/infiniband/hw/ehca/ehca_sqp.c
+++ b/drivers/infiniband/hw/ehca/ehca_sqp.c
@@ -39,12 +39,18 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <rdma/ib_mad.h>
#include "ehca_classes.h"
#include "ehca_tools.h"
#include "ehca_iverbs.h"
#include "hcp_if.h"
+#define IB_MAD_STATUS_REDIRECT __constant_htons(0x0002)
+#define IB_MAD_STATUS_UNSUP_VERSION __constant_htons(0x0004)
+#define IB_MAD_STATUS_UNSUP_METHOD __constant_htons(0x0008)
+
+#define IB_PMA_CLASS_PORT_INFO __constant_htons(0x0001)
/**
* ehca_define_sqp - Defines special queue pair 1 (GSI QP). When special queue
@@ -83,6 +89,9 @@ u64 ehca_define_sqp(struct ehca_shca *shca,
port, ret);
return ret;
}
+ shca->sport[port - 1].pma_qp_nr = pma_qp_nr;
+ ehca_dbg(&shca->ib_device, "port=%x pma_qp_nr=%x",
+ port, pma_qp_nr);
break;
default:
ehca_err(&shca->ib_device, "invalid qp_type=%x",
@@ -109,3 +118,85 @@ u64 ehca_define_sqp(struct ehca_shca *shca,
return H_SUCCESS;
}
+
+struct ib_perf {
+ struct ib_mad_hdr mad_hdr;
+ u8 reserved[40];
+ u8 data[192];
+} __attribute__ ((packed));
+
+
+static int ehca_process_perf(struct ib_device *ibdev, u8 port_num,
+ struct ib_mad *in_mad, struct ib_mad *out_mad)
+{
+ struct ib_perf *in_perf = (struct ib_perf *)in_mad;
+ struct ib_perf *out_perf = (struct ib_perf *)out_mad;
+ struct ib_class_port_info *poi =
+ (struct ib_class_port_info *)out_perf->data;
+ struct ehca_shca *shca =
+ container_of(ibdev, struct ehca_shca, ib_device);
+ struct ehca_sport *sport = &shca->sport[port_num - 1];
+
+ ehca_dbg(ibdev, "method=%x", in_perf->mad_hdr.method);
+
+ *out_mad = *in_mad;
+
+ if (in_perf->mad_hdr.class_version != 1) {
+ ehca_warn(ibdev, "Unsupported class_version=%x",
+ in_perf->mad_hdr.class_version);
+ out_perf->mad_hdr.status = IB_MAD_STATUS_UNSUP_VERSION;
+ goto perf_reply;
+ }
+
+ switch (in_perf->mad_hdr.method) {
+ case IB_MGMT_METHOD_GET:
+ case IB_MGMT_METHOD_SET:
+ /* set class port info for redirection */
+ out_perf->mad_hdr.attr_id = IB_PMA_CLASS_PORT_INFO;
+ out_perf->mad_hdr.status = IB_MAD_STATUS_REDIRECT;
+ memset(poi, 0, sizeof(*poi));
+ poi->base_version = 1;
+ poi->class_version = 1;
+ poi->resp_time_value = 18;
+ poi->redirect_lid = sport->saved_attr.lid;
+ poi->redirect_qp = sport->pma_qp_nr;
+ poi->redirect_qkey = IB_QP1_QKEY;
+ poi->redirect_pkey = IB_DEFAULT_PKEY_FULL;
+
+ ehca_dbg(ibdev, "ehca_pma_lid=%x ehca_pma_qp=%x",
+ sport->saved_attr.lid, sport->pma_qp_nr);
+ break;
+
+ case IB_MGMT_METHOD_GET_RESP:
+ return IB_MAD_RESULT_FAILURE;
+
+ default:
+ out_perf->mad_hdr.status = IB_MAD_STATUS_UNSUP_METHOD;
+ break;
+ }
+
+perf_reply:
+ out_perf->mad_hdr.method = IB_MGMT_METHOD_GET_RESP;
+
+ return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY;
+}
+
+int ehca_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
+ struct ib_wc *in_wc, struct ib_grh *in_grh,
+ struct ib_mad *in_mad,
+ struct ib_mad *out_mad)
+{
+ int ret;
+
+ if (!port_num || port_num > ibdev->phys_port_cnt)
+ return IB_MAD_RESULT_FAILURE;
+
+ /* accept only pma request */
+ if (in_mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_PERF_MGMT)
+ return IB_MAD_RESULT_SUCCESS;
+
+ ehca_dbg(ibdev, "port_num=%x src_qp=%x", port_num, in_wc->src_qp);
+ ret = ehca_process_perf(ibdev, port_num, in_mad, out_mad);
+
+ return ret;
+}
--
1.5.2
^ permalink raw reply related
* [PATCH 0/2] IB/ehca: PMA support and a minor fix
From: Joachim Fenkes @ 2008-01-25 20:11 UTC (permalink / raw)
To: LinuxPPC-Dev, LKML, OF-General, Roland Dreier, OF-EWG
Cc: Stefan Roscher, Christoph Raisch
This patchset will fix a minor issue and then add support for Performance
MADs, which redirects all PMA queries to the actual PMA QP.
[1/2] adds a missing query_pma_attr()
[2/2] adds PMA redirection code
The patches will apply, in order, on top of Roland's for-2.6.25 branch.
Please review them and apply for 2.6.25 if you think they're okay.
Thanks and regards,
Joachim
--
Joachim Fenkes -- eHCA Linux Driver Developer and Hardware Tamer
IBM Deutschland Entwicklung GmbH -- Dept. 3627 (I/O Firmware Dev. 2)
Schoenaicher Strasse 220 -- 71032 Boeblingen -- Germany
eMail: fenkes@de.ibm.com
^ permalink raw reply
* Reminder: removal of arch/ppc
From: Kumar Gala @ 2008-01-25 16:55 UTC (permalink / raw)
To: linuxppc-dev list, linuxppc-embedded
Just a reminder that the plan is to remove arch/ppc this summer (June
2008). The following boards still existing over in arch/ppc. Some of
them have been ported over to arch/powerpc. If you care about one of
these boards and its not ported speak up (it helps if you have access
to the board). Also, if you know a given board is free to die of
bitrot let us know so we know not to worry about it:
PREP
PQ2ADS
TQM8260
CPCI690
EV64260
CHESTNUT
LOPEC
KATANA
HDPU
MVME5100
PAL4
POWERPMC250
PPLUS
PRPMC750
PRPMC800
RADSTONE_PPC7D
SANDPOINT
SBC82xx
SPRUCE
LITE5200
EV64360
MPC86XADS
MPC885ADS
ADS8272
4xx:
BAMBOO
CPCI405
EBONY
EP405
BUBINGA
LUAN
YUCCA
OCOTEA
REDWOOD_5
REDWOOD_6
SYCAMORE
TAISHAN
WALNUT
XILINX_ML300
XILINX_ML403
- k
^ permalink raw reply
* Re: [PATCH v2] [POWERPC] 85xx: Port STX GP3 board over from arch/ppc
From: Scott Wood @ 2008-01-25 16:08 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0801242245390.22024@blarg.am.freescale.net>
On Thu, Jan 24, 2008 at 10:47:21PM -0600, Kumar Gala wrote:
> + soc8560@fdf00000 {
soc@fdf00000
-Scott
> + cpm@919c0 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + compatible = "fsl,mpc8560-cpm", "fsl,cpm2";
This is also a simple-bus.
> +static struct of_device_id __initdata of_bus_ids[] = {
> + { .name = "soc", },
> + { .type = "soc", },
> + { .name = "cpm", },
> + { .name = "localbus", },
> + { .compatible = "simple-bus", },
> + {},
> +};
You should be able to get rid of the others besides simple-bus (there may
have been some confusion in what you asked over IRC yesterday -- I
thought you were talking about compatible in the device tree, not here).
-Scott
^ permalink raw reply
* [RFC][PATCH] remove section mappinng
From: Badari Pulavarty @ 2008-01-25 16:05 UTC (permalink / raw)
To: linuxppc-dev; +Cc: anton, Paul Mackerras, linux-mm
Hi Paul/Ben/Anton,
As part of making memory remove working on ppc64, I need the code to
remove htab mappings for the section of the memory.
Here is the code I cooked up, it seems to be working fine.
But I have concerns where I need your help.
In order to invalidate htab entries, we need to find the "slot".
But I can only find the hpte group. Is it okay to invalidate the
first entry in the group ? Do I need to invalidate the entire group ?
Please help, as I would like to push this for 2.6.25/2.6.26.
Thanks,
Badari
For memory remove, we need to remove htab mapping.
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
---
arch/powerpc/mm/hash_utils_64.c | 32 ++++++++++++++++++++++++++++++++
include/asm-powerpc/sparsemem.h | 1 +
2 files changed, 33 insertions(+)
Index: linux-2.6.24-rc8/arch/powerpc/mm/hash_utils_64.c
===================================================================
--- linux-2.6.24-rc8.orig/arch/powerpc/mm/hash_utils_64.c 2008-01-17 09:47:37.000000000 -0800
+++ linux-2.6.24-rc8/arch/powerpc/mm/hash_utils_64.c 2008-01-25 07:57:48.000000000 -0800
@@ -191,6 +191,33 @@ int htab_bolt_mapping(unsigned long vsta
return ret < 0 ? ret : 0;
}
+static void htab_remove_mapping(unsigned long vstart, unsigned long vend,
+ int psize, int ssize)
+{
+ unsigned long vaddr;
+ unsigned int step, shift;
+
+ shift = mmu_psize_defs[psize].shift;
+ step = 1 << shift;
+
+ for (vaddr = vstart; vaddr < vend; vaddr += step) {
+ unsigned long hash, hpteg;
+ unsigned long vsid = get_kernel_vsid(vaddr, ssize);
+ unsigned long va = hpt_va(vaddr, vsid, ssize);
+
+ hash = hpt_hash(va, shift, ssize);
+ hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
+
+ /*
+ * HELP - how do I find the slot ? Is it okay to
+ * invalidates only first entry ? Do I need to
+ * remove entire group instead ?
+ */
+ BUG_ON(!ppc_md.hpte_invalidate);
+ ppc_md.hpte_invalidate(hpteg, va, psize, ssize, 0);
+ }
+}
+
static int __init htab_dt_scan_seg_sizes(unsigned long node,
const char *uname, int depth,
void *data)
@@ -436,6 +463,11 @@ void create_section_mapping(unsigned lon
_PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX,
mmu_linear_psize, mmu_kernel_ssize));
}
+
+void remove_section_mapping(unsigned long start, unsigned long end)
+{
+ htab_remove_mapping(start, end, mmu_linear_psize, mmu_kernel_ssize);
+}
#endif /* CONFIG_MEMORY_HOTPLUG */
static inline void make_bl(unsigned int *insn_addr, void *func)
Index: linux-2.6.24-rc8/include/asm-powerpc/sparsemem.h
===================================================================
--- linux-2.6.24-rc8.orig/include/asm-powerpc/sparsemem.h 2008-01-15 20:22:48.000000000 -0800
+++ linux-2.6.24-rc8/include/asm-powerpc/sparsemem.h 2008-01-24 16:20:17.000000000 -0800
@@ -20,6 +20,7 @@
#ifdef CONFIG_MEMORY_HOTPLUG
extern void create_section_mapping(unsigned long start, unsigned long end);
+extern void remove_section_mapping(unsigned long start, unsigned long end);
#ifdef CONFIG_NUMA
extern int hot_add_scn_to_nid(unsigned long scn_addr);
#else
^ permalink raw reply
* Re: [PATCH] [NET]: Remove PowerPC code from fec.c
From: Jochen Friedrich @ 2008-01-25 16:04 UTC (permalink / raw)
To: Frans Pop
Cc: linux-m68k, netdev, linux-kernel, linuxppc-dev, geert, gerg,
scottwood, jgarzik
In-Reply-To: <E1JIQpQ-0006Xj-RR@faramir.fjphome.nl>
Hi Frans,
> Jochen Friedrich wrote:
>> +++ b/drivers/net/fec.c
>> @@ -23,6 +23,9 @@
>> *
>> * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be)
>> * Copyright (c) 2004-2006 Macq Electronique SA.
>> + *
>> + * This driver is now only used on ColdFire processors. Remove conditional
>> + * Powerpc code.
>> */
>
> This comment makes sense for a changelog, but IMO it makes no sense at all
> to add it to the file.
I just added it to clarify this code is now only used on m68knommu (Coldfire).
The comments on top are mailny about MPC860T CPUs (PowerPC), however the driver is no
longer used for these CPUs.
Maybe the wording should be changed to:
This driver is now only used on ColdFire (m68knommu) processors. Conditional
PowerPC code has been removed.
Thanks,
Jochen
^ permalink raw reply
* Re: [PATCH 4/9] enable FSL SATA driver config for Freescale SoCs
From: Kumar Gala @ 2008-01-25 16:04 UTC (permalink / raw)
To: Kim Phillips; +Cc: linuxppc-dev, Jerry Huang
In-Reply-To: <20080124204621.2c09359e.kim.phillips@freescale.com>
On Jan 24, 2008, at 8:46 PM, Kim Phillips wrote:
> The mpc8315 shares the same SATA controller as the mpc837x,
> and likelihood is that future SoCs from Freescale will also.
>
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> ---
> Kumar, let me know if you want me to post this to the ata list (I'm
> assuming it's not necessary).
It is necessary so they are aware. CC jgarizk, but we'll take it via
powerpc.
- k
^ permalink raw reply
* Re: [PATCH] mpc834x_mds: Convert device tree source to dts-v1
From: Kumar Gala @ 2008-01-25 15:57 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: linuxppc-dev
In-Reply-To: <1201242129-13417-1-git-send-email-paul.gortmaker@windriver.com>
On Fri, 25 Jan 2008, Paul Gortmaker wrote:
> Move mpc834x_mds device tree source forward to dts-v1 format. Nothing
> too complex in this one, so it boils down to just adding a bunch of 0x
> in the right places and converting clock speeds to decimal.
>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
> arch/powerpc/boot/dts/mpc834x_mds.dts | 254 +++++++++++++++++----------------
> 1 files changed, 128 insertions(+), 126 deletions(-)
>
applied. I fixed up things so that interrupts use decimal.
- k
^ permalink raw reply
* Re: [PATCH for-2.6.25] [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c
From: Kumar Gala @ 2008-01-25 15:56 UTC (permalink / raw)
To: Jochen Friedrich
Cc: Kernel, Linux, linuxppc-dev list, netdev@vger.kernel.org,
Scott Wood, Garzik, Jeff
In-Reply-To: <4799F2CE.309@scram.de>
On Fri, 25 Jan 2008, Jochen Friedrich wrote:
> Rename commproc.[ch] to cpm1.[ch] to be more consistent with cpm2. Also
> rename cpm2_common.c to cpm2.c as suggested by Scott Wood. Adjust the
> includes accordingly.
>
> Signed-off-by: Jochen Friedrich <jochen@scram.de>
> ---
> arch/powerpc/platforms/8xx/ep88xc.c | 1 +
> arch/powerpc/platforms/8xx/mpc86xads_setup.c | 2 +-
> arch/powerpc/platforms/8xx/mpc885ads_setup.c | 2 +-
> arch/powerpc/sysdev/Makefile | 4 ++--
> arch/powerpc/sysdev/{commproc.c => cpm1.c} | 4 ++--
> arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} | 3 +--
> arch/powerpc/sysdev/micropatch.c | 2 +-
> arch/ppc/8260_io/enet.c | 2 +-
> arch/ppc/8xx_io/commproc.c | 2 +-
> arch/ppc/8xx_io/enet.c | 6 +++---
> arch/ppc/8xx_io/fec.c | 2 +-
> arch/ppc/8xx_io/micropatch.c | 2 +-
> arch/ppc/boot/simple/iic.c | 2 +-
> arch/ppc/boot/simple/m8xx_tty.c | 2 +-
> arch/ppc/kernel/ppc_ksyms.c | 2 +-
> arch/ppc/platforms/mpc866ads_setup.c | 2 +-
> arch/ppc/platforms/mpc885ads_setup.c | 2 +-
> arch/ppc/syslib/mpc8xx_devices.c | 2 +-
> arch/ppc/xmon/start_8xx.c | 2 +-
> drivers/net/fec_8xx/fec_8xx-netta.c | 2 +-
> drivers/net/fec_8xx/fec_main.c | 2 +-
> drivers/net/fec_8xx/fec_mii.c | 2 +-
> drivers/net/fs_enet/fs_enet.h | 2 +-
> drivers/net/fs_enet/mac-fec.c | 2 +-
> drivers/net/fs_enet/mac-scc.c | 2 +-
> drivers/serial/cpm_uart/cpm_uart_cpm1.h | 2 +-
> include/asm-powerpc/{commproc.h => cpm1.h} | 8 ++++----
> include/asm-ppc/{commproc.h => cpm1.h} | 8 ++++----
> 28 files changed, 38 insertions(+), 38 deletions(-)
> rename arch/powerpc/sysdev/{commproc.c => cpm1.c} (99%)
> rename arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} (99%)
> rename include/asm-powerpc/{commproc.h => cpm1.h} (99%)
> rename include/asm-ppc/{commproc.h => cpm1.h} (99%)
>
applied.
- k
^ permalink raw reply
* Re: [PATCHv3 7/7] [POWERPC] Move definition of buffer descriptor to cpm.h
From: Kumar Gala @ 2008-01-25 15:56 UTC (permalink / raw)
To: Jochen Friedrich; +Cc: Scott Wood, Kernel, Linux, linuxppc-dev list
In-Reply-To: <4798ACA5.5050106@scram.de>
On Thu, 24 Jan 2008, Jochen Friedrich wrote:
> Buffer descriptors are used by both CPM1 and CPM2. Move the definitions
> from the cpm dependent include file to common cpm.h
>
> Signed-off-by: Jochen Friedrich <jochen@scram.de>
> ---
> include/asm-powerpc/cpm.h | 73 ++++++++++++++++++++++++++++++++++++++++++++
> include/asm-powerpc/cpm1.h | 65 ---------------------------------------
> include/asm-powerpc/cpm2.h | 64 --------------------------------------
> 3 files changed, 73 insertions(+), 129 deletions(-)
>
applied.
- k
^ permalink raw reply
* Re: ml310 kernel2.6 booting problems
From: Grant Likely @ 2008-01-25 15:17 UTC (permalink / raw)
To: greenlean; +Cc: linuxppc-embedded
In-Reply-To: <15087192.post@talk.nabble.com>
On 1/25/08, greenlean <jmgomez@atc.ugr.es> wrote:
>
> I'm also having some problem with my systemace file system. I'm working with
> secretlab git, and I try to mount the CF card with xsysace and with xsa, but
> in both cases it can't mount the rootfs:
>
> Linux/PPC load: console=ttyS0,9600 root=/dev/xsa3 rw
> :
> :
> :
> [ 2.777706] xsysace xsysace.0: Xilinx SystemACE revision 1.0.12
> [ 2.849967] xsysace xsysace.0: capacity: 986320 sectors
> [ 2.913383] xsa: unknown partition table
You're definitely not having a filesystem problem; it's a partition
table problem. Either the partition table is corrupt or the kernel
doesn't understand the type of partition table, or the system ace
isn't able to read the CF correctly (hardware problem).
g.
> :
> :
> [ 3.398810] Please append a correct "root=" boot option; here are the
> availa:
> [ 3.499476] fe00 493160 xsa (driver?)
> [ 3.547926] Kernel panic - not syncing: VFS: Unable to mount root fs on
> unkn)
>
> Does this mean that I have configured incorrectly the file system options in
> the kernel??
> I have read that the solution to this is to change the DOS/FAT/NT Filesystem
> option to the below configuration:
>
> <*> Second extended fs support
> DOS/FAT/NT Filesystems
> < > MSDOS fs support
> < > VFAT (Windows-95) fs support
> < > NTFS file system support
> [*] Advanced partition selection
> [*] PC BIOS (MSDOS partition tables) support
> I've already tested this configuration:
>
> <*> Second extended fs support
> DOS/FAT/NT Filesystems
> <*> MSDOS fs support
> <*> VFAT (Windows-95) fs support
> < > NTFS file system support
> [] Advanced partition selection
>
>
> My CF card has the following structure:
>
> Disco /dev/sdc: 521 MB, 521773056 bytes
> 16 cabezas, 63 sectores/pistas, 1011 cilindros
> Unidades = cilindros de 1008 * 512 = 516096 bytes
> Disk identifier: 0x00000000
>
> Disposit. Inicio Comienzo Fin Bloques Id Sistema
> /dev/sdc1 1 400 201568+ 6 FAT16
> /dev/sdc2 401 500 50400 82 Linux swap / Solaris
> /dev/sdc3 501 1011 257544 83 Linux
>
> I'm also wondering if I should use xsysace or xsa, because I have search in
> the file xsysace.c for the name of the device and It is named as xsysace. Am
> I right, and should I use xsysace? Or this name isn't related with the /dev
> file??
> $ grep xsysace xsysace.c
>
> .name = "xsysace",
> ace_major = register_blkdev(ace_major, "xsysace");
> printk(KERN_WARNING "xsysace: register_blkdev() failed\n");
> unregister_blkdev(ace_major, "xsysace");
>
> I'm going to reformat my CF card and test it,maybe the partition table is
> corrupted, but fdisk is not saying anything at all.
>
> Thanks
>
>
> Grant Likely-2 wrote:
> >
> > On 1/16/08, Joachim Meyer <Jogi95@web.de> wrote:
> >> Hi
> >>
> >> I made an Ace file with my Kernel and load it with the Flash Card.
> >> I made the Initial release CF image on the card and copied my ace file in
> >> an folder, from which I boot with the DIP-Switch.
> >> If I used
> >> "console=ttyUL0 ,9600 root=/dev/xsysace/disc0/part2 rw "
> >
> > try root=/dev/xsa2
> > Also, the ',9600' is unnecessary with the uartlite.
> >
> >>
> >> I tried to use this:
> >> "console=ttyUL0 ,9600 root=fe02 rw"
> >> and with this, after making ace-file etc. I get:
> >> [ 12.862678] EXT3 FS on xsa2, internal journal
> >> [ 12.899229] EXT3-fs: recovery complete.
> >> [ 12.982635] EXT3-fs: mounted filesystem with ordered data mode.
> >> [ 13.038505] VFS: Mounted root (ext3 filesystem).
> >> [ 13.094113] Freeing unused kernel memory: 96k init
> >> [ 13.159079] Warning: unable to open an initial console.
> >
> > You're probably missing the /dev/console device file
> >
> > g.
> >
> > --
> > Grant Likely, B.Sc., P.Eng.
> > Secret Lab Technologies Ltd.
> > _______________________________________________
> > Linuxppc-embedded mailing list
> > Linuxppc-embedded@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> >
> >
>
> --
> View this message in context: http://www.nabble.com/ml310-kernel2.6-booting-problems-tp14881983p15087192.html
> Sent from the linuxppc-embedded mailing list archive at Nabble.com.
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* [patch 11/11] ps3fb: Fix modedb typos
From: Geert Uytterhoeven @ 2008-01-25 15:06 UTC (permalink / raw)
To: Antonino A. Daplas, Andrew Morton, linux-fbdev-devel
Cc: Geert Uytterhoeven, linuxppc-dev, cbe-oss-dev
In-Reply-To: <20080125150623.202631389@vixen.sonytel.be>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]
From: Geoff Levand <geoffrey.levand@am.sony.com>
ps3fb: Fix modedb typos
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
---
drivers/video/ps3fb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -184,7 +184,7 @@ static const struct fb_videomode ps3fb_m
"720p", 50, 1124, 644, 13468, 298, 478, 57, 44, 80, 5,
FB_SYNC_BROADCAST, FB_VMODE_NONINTERLACED
}, {
- /* 1080 */
+ /* 1080i */
"1080i", 50, 1688, 964, 13468, 264, 600, 94, 62, 88, 5,
FB_SYNC_BROADCAST, FB_VMODE_INTERLACED
}, {
@@ -232,7 +232,7 @@ static const struct fb_videomode ps3fb_m
FB_SYNC_BROADCAST, FB_VMODE_NONINTERLACED
}, {
/* 1080if */
- "1080f", 50, 1920, 1080, 13468, 148, 484, 36, 4, 88, 5,
+ "1080if", 50, 1920, 1080, 13468, 148, 484, 36, 4, 88, 5,
FB_SYNC_BROADCAST, FB_VMODE_INTERLACED
}, {
/* 1080pf */
--
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
^ 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