* [PATCH 4/7] Device tree for MPC5121 ADS
From: John Rigby @ 2008-01-08 16:01 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1199808093-15929-4-git-send-email-jrigby@freescale.com>
Bare minimum tree containing only
what is currently supported.
Signed-off-by: John Rigby <jrigby@freescale.com>
---
arch/powerpc/boot/dts/mpc5121ads.dts | 102 ++++++++++++++++++++++++++++++++++
1 files changed, 102 insertions(+), 0 deletions(-)
create mode 100644 arch/powerpc/boot/dts/mpc5121ads.dts
diff --git a/arch/powerpc/boot/dts/mpc5121ads.dts b/arch/powerpc/boot/dts/mpc5121ads.dts
new file mode 100644
index 0000000..26471ff
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc5121ads.dts
@@ -0,0 +1,102 @@
+/*
+ * MPC5121E MDS Device Tree Source
+ *
+ * Copyright 2007 Freescale Semiconductor Inc.
+ *
+ * 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.
+ */
+
+/ {
+ model = "MPC5121ADS";
+ compatible = "MPC5121ADS";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ PowerPC,5121@0 {
+ device_type = "cpu";
+ reg = <0>;
+ d-cache-line-size = <20>; // 32 bytes
+ i-cache-line-size = <20>; // 32 bytes
+ d-cache-size = <8000>; // L1, 32K
+ i-cache-size = <8000>; // L1, 32K
+ ref-frequency = <3ef1480>; // 66MHz ref clock
+ timebase-frequency = <2f34f60>; // 49.5MHz (396MHz/8) makes time tick correctly
+ bus-frequency = <bcd3d80>; // 198MHz csb bus
+ clock-frequency = <179a7b00>; // 396MHz ppc core ??
+ 32-bit;
+ };
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <00000000 10000000>; // 256MB at 0
+ };
+
+ cpld@82000000 {
+ device_type = "board-control";
+ reg = <82000000 8000>;
+ };
+
+ soc5121@80000000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ #interrupt-cells = <2>;
+ device_type = "soc";
+ ranges = <0 80000000 400000>;
+ reg = <80000000 400000>;
+ ref-frequency = <3ef1480>; // 66MHz ref
+ bus-frequency = <5e69ec0>; // 99MHz ips ref
+
+ // IPIC
+ // interrupts cell = <intr #, sense>
+ // sense values match linux IORESOURCE_IRQ_* defines:
+ // sense == 8: Level, low assertion
+ // sense == 2: Edge, high-to-low change
+ //
+ ipic: pic@c00 {
+ interrupt-controller;
+ #address-cells = <0>;
+ #interrupt-cells = <2>;
+ reg = <c00 100>;
+ built-in;
+ device_type = "ipic";
+ };
+
+ // 512x PSCs are not 52xx PSCs compatible
+ // PSC3 serial port A aka ttyPSC0
+ serial@11300 {
+ device_type = "serial";
+ compatible = "mpc512x-psc-uart";
+ port-number = <0>; // Logical port assignment
+ cell-index = <3>;
+ reg = <11300 100>;
+ interrupts = <28 8>; // actually the fifo irq
+ interrupt-parent = < &ipic >;
+ };
+
+ // PSC4 serial port B aka ttyPSC1
+ serial@11400 {
+ device_type = "serial";
+ compatible = "mpc512x-psc-uart";
+ port-number = <1>; // Logical port assignment
+ cell-index = <4>;
+ reg = <11400 100>;
+ interrupts = <28 8>; // actually the fifo irq
+ interrupt-parent = < &ipic >;
+ };
+
+ pscsfifo@11f00 {
+ compatible = "mpc512x-pscsfifo";
+ reg = <11f00 100>;
+ interrupts = <28 8>;
+ interrupt-parent = < &ipic >;
+ };
+ };
+};
--
1.5.3.5.726.g41a7a
^ permalink raw reply related
* [PATCH 5/7] Separate MPC52xx PSC FIFO registers from rest of PSC
From: John Rigby @ 2008-01-08 16:01 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1199808093-15929-5-git-send-email-jrigby@freescale.com>
This is in preparation for the addition of MPC512x
PSC support. The main difference in the 512x is
in the fifo registers.
Signed-off-by: John Rigby <jrigby@freescale.com>
---
drivers/serial/mpc52xx_uart.c | 10 ++++++----
include/asm-powerpc/mpc52xx_psc.h | 3 +++
include/asm-ppc/mpc52xx_psc.h | 3 +++
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index ec36ad7..25a91c9 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -111,6 +111,7 @@ static void mpc52xx_uart_of_enumerate(void);
#endif
#define PSC(port) ((struct mpc52xx_psc __iomem *)((port)->membase))
+#define FIFO(port) ((struct mpc52xx_psc_fifo __iomem *)(PSC(port)+1))
/* Forward declaration of the interruption handling routine */
@@ -222,6 +223,7 @@ static int
mpc52xx_uart_startup(struct uart_port *port)
{
struct mpc52xx_psc __iomem *psc = PSC(port);
+ struct mpc52xx_psc_fifo __iomem *fifo = FIFO(port);
int ret;
/* Request IRQ */
@@ -238,10 +240,10 @@ mpc52xx_uart_startup(struct uart_port *port)
out_be16(&psc->mpc52xx_psc_clock_select, 0xdd00); /* /16 prescaler on */
- out_8(&psc->rfcntl, 0x00);
- out_be16(&psc->rfalarm, 0x1ff);
- out_8(&psc->tfcntl, 0x07);
- out_be16(&psc->tfalarm, 0x80);
+ out_8(&fifo->rfcntl, 0x00);
+ out_be16(&fifo->rfalarm, 0x1ff);
+ out_8(&fifo->tfcntl, 0x07);
+ out_be16(&fifo->tfalarm, 0x80);
port->read_status_mask |= MPC52xx_PSC_IMR_RXRDY | MPC52xx_PSC_IMR_TXRDY;
out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
diff --git a/include/asm-powerpc/mpc52xx_psc.h b/include/asm-powerpc/mpc52xx_psc.h
index 26690d2..bea42b9 100644
--- a/include/asm-powerpc/mpc52xx_psc.h
+++ b/include/asm-powerpc/mpc52xx_psc.h
@@ -153,6 +153,9 @@ struct mpc52xx_psc {
u8 reserved16[3];
u8 irfdr; /* PSC + 0x54 */
u8 reserved17[3];
+};
+
+struct mpc52xx_psc_fifo {
u16 rfnum; /* PSC + 0x58 */
u16 reserved18;
u16 tfnum; /* PSC + 0x5c */
diff --git a/include/asm-ppc/mpc52xx_psc.h b/include/asm-ppc/mpc52xx_psc.h
index c82b8d4..39fcd02 100644
--- a/include/asm-ppc/mpc52xx_psc.h
+++ b/include/asm-ppc/mpc52xx_psc.h
@@ -159,6 +159,9 @@ struct mpc52xx_psc {
u8 reserved16[3];
u8 irfdr; /* PSC + 0x54 */
u8 reserved17[3];
+};
+
+struct mpc52xx_psc_fifo {
u16 rfnum; /* PSC + 0x58 */
u16 reserved18;
u16 tfnum; /* PSC + 0x5c */
--
1.5.3.5.726.g41a7a
^ permalink raw reply related
* [PATCH 3/7] Basic Freescale MPC512x support
From: John Rigby @ 2008-01-08 16:01 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1199808093-15929-3-git-send-email-jrigby@freescale.com>
512x is very similar to 83xx and most
of this is patterned after code from 83xx
New platform:
changed:
arch/powerpc/Kconfig
arch/powerpc/platforms/Kconfig
arch/powerpc/platforms/Kconfig.cputype
arch/powerpc/platforms/Makefile
new:
arch/powerpc/platforms/512x/*
Signed-off-by: John Rigby <jrigby@freescale.com>
---
arch/powerpc/Kconfig | 2 +-
arch/powerpc/platforms/512x/Kconfig | 20 ++++++
arch/powerpc/platforms/512x/Makefile | 4 +
arch/powerpc/platforms/512x/mpc5121_ads.c | 90 +++++++++++++++++++++++++++++
arch/powerpc/platforms/Kconfig | 8 +++
arch/powerpc/platforms/Kconfig.cputype | 6 +-
arch/powerpc/platforms/Makefile | 1 +
7 files changed, 127 insertions(+), 4 deletions(-)
create mode 100644 arch/powerpc/platforms/512x/Kconfig
create mode 100644 arch/powerpc/platforms/512x/Makefile
create mode 100644 arch/powerpc/platforms/512x/mpc5121_ads.c
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 66a3d8c..81c3f05 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -470,7 +470,7 @@ config PCI
bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \
|| PPC_MPC52xx || (EMBEDDED && (PPC_PSERIES || PPC_ISERIES)) \
|| PPC_PS3
- default y if !40x && !CPM2 && !8xx && !PPC_83xx \
+ default y if !40x && !CPM2 && !8xx && !PPC_512x && !PPC_83xx \
&& !PPC_85xx && !PPC_86xx
default PCI_PERMEDIA if !4xx && !CPM2 && !8xx
default PCI_QSPAN if !4xx && !CPM2 && 8xx
diff --git a/arch/powerpc/platforms/512x/Kconfig b/arch/powerpc/platforms/512x/Kconfig
new file mode 100644
index 0000000..399d279
--- /dev/null
+++ b/arch/powerpc/platforms/512x/Kconfig
@@ -0,0 +1,20 @@
+menu "Platform support"
+ depends on PPC_512x
+
+choice
+ prompt "Machine Type"
+ default MPC5121_ADS
+
+config MPC5121_ADS
+ bool "Freescale MPC5121E ADS"
+ select DEFAULT_UIMAGE
+ help
+ This option enables support for the MPC5121E ADS board.
+
+endchoice
+
+config MPC5121
+ bool
+ default y if MPC5121_ADS
+
+endmenu
diff --git a/arch/powerpc/platforms/512x/Makefile b/arch/powerpc/platforms/512x/Makefile
new file mode 100644
index 0000000..232c89f
--- /dev/null
+++ b/arch/powerpc/platforms/512x/Makefile
@@ -0,0 +1,4 @@
+#
+# Makefile for the Freescale PowerPC 512x linux kernel.
+#
+obj-$(CONFIG_MPC5121_ADS) += mpc5121_ads.o
diff --git a/arch/powerpc/platforms/512x/mpc5121_ads.c b/arch/powerpc/platforms/512x/mpc5121_ads.c
new file mode 100644
index 0000000..a860bf0
--- /dev/null
+++ b/arch/powerpc/platforms/512x/mpc5121_ads.c
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ *
+ * Author: John Rigby, <jrigby@freescale.com>, Thur Mar 29 2007
+ *
+ * Description:
+ * MPC5121 ADS board setup
+ *
+ * This 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.
+ *
+ */
+
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/reboot.h>
+#include <linux/kdev_t.h>
+#include <linux/major.h>
+#include <linux/console.h>
+#include <linux/delay.h>
+#include <linux/seq_file.h>
+#include <linux/root_dev.h>
+#include <linux/time.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+
+#include <asm/system.h>
+#include <asm/atomic.h>
+#include <asm/machdep.h>
+#include <asm/ipic.h>
+#include <asm/prom.h>
+#include <asm/time.h>
+#include <asm/of_platform.h>
+
+static void __init mpc5121_ads_setup_arch(void)
+{
+ if (ppc_md.progress)
+ ppc_md.progress("mpc5121_ads_setup_arch()", 0);
+
+ printk(KERN_INFO "MPC5121 ADS board from Freescale Semiconductor\n");
+}
+
+static void __init mpc5121_ads_declare_of_platform_devices(void)
+{
+ /* Find every child of the SOC node and add it to of_platform */
+ if (of_platform_bus_probe(NULL, NULL, NULL))
+ printk(KERN_ERR __FILE__ ": "
+ "Error while probing of_platform bus\n");
+}
+
+static void __init mpc5121_ads_init_IRQ(void)
+{
+ struct device_node *np;
+
+ np = of_find_node_by_type(NULL, "ipic");
+ if (!np)
+ return;
+
+ ipic_init(np, 0);
+
+ /*
+ * Initialize the default interrupt mapping priorities,
+ * in case the boot rom changed something on us.
+ */
+ ipic_set_default_priority();
+}
+
+/*
+ * Called very early, MMU is off, device-tree isn't unflattened
+ */
+static int __init mpc5121_ads_probe(void)
+{
+ unsigned long root = of_get_flat_dt_root();
+
+ return of_flat_dt_is_compatible(root, "MPC5121ADS");
+}
+
+define_machine(mpc5121_ads) {
+ .name = "MPC5121 ADS",
+ .probe = mpc5121_ads_probe,
+ .setup_arch = mpc5121_ads_setup_arch,
+ .init = mpc5121_ads_declare_of_platform_devices,
+ .init_IRQ = mpc5121_ads_init_IRQ,
+ .get_irq = ipic_get_irq,
+ .calibrate_decr = generic_calibrate_decr,
+};
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index ad9b1c0..1daf47f 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -25,6 +25,13 @@ config PPC_83xx
select IPIC
select WANT_DEVICE_TREE
+config PPC_512x
+ bool "Freescale 512x"
+ depends on 6xx
+ select FSL_SOC
+ select IPIC
+ select WANT_DEVICE_TREE
+
config PPC_86xx
bool "Freescale 86xx"
depends on 6xx
@@ -41,6 +48,7 @@ config CLASSIC32
source "arch/powerpc/platforms/pseries/Kconfig"
source "arch/powerpc/platforms/iseries/Kconfig"
source "arch/powerpc/platforms/chrp/Kconfig"
+source "arch/powerpc/platforms/512x/Kconfig"
source "arch/powerpc/platforms/52xx/Kconfig"
source "arch/powerpc/platforms/powermac/Kconfig"
source "arch/powerpc/platforms/prep/Kconfig"
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index c3ee0b5..e21ffa5 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -14,7 +14,7 @@ choice
There are five families of 32 bit PowerPC chips supported.
The most common ones are the desktop and server CPUs (601, 603,
604, 740, 750, 74xx) CPUs from Freescale and IBM, with their
- embedded 52xx/82xx/83xx/86xx counterparts.
+ embedded 512x/52xx/82xx/83xx/86xx counterparts.
The other embeeded parts, namely 4xx, 8xx, e200 (55xx) and e500
(85xx) each form a family of their own that is not compatible
with the others.
@@ -22,7 +22,7 @@ choice
If unsure, select 52xx/6xx/7xx/74xx/82xx/83xx/86xx.
config 6xx
- bool "52xx/6xx/7xx/74xx/82xx/83xx/86xx"
+ bool "512x/52xx/6xx/7xx/74xx/82xx/83xx/86xx"
select PPC_FPU
config PPC_85xx
@@ -229,7 +229,7 @@ config NR_CPUS
config NOT_COHERENT_CACHE
bool
- depends on 4xx || 8xx || E200
+ depends on 4xx || 8xx || E200 || PPC_512x
default y
config CHECK_CACHE_COHERENCY
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index 6d9079d..633a599 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -11,6 +11,7 @@ endif
obj-$(CONFIG_PPC_CHRP) += chrp/
obj-$(CONFIG_40x) += 40x/
obj-$(CONFIG_44x) += 44x/
+obj-$(CONFIG_PPC_512x) += 512x/
obj-$(CONFIG_PPC_MPC52xx) += 52xx/
obj-$(CONFIG_PPC_8xx) += 8xx/
obj-$(CONFIG_PPC_82xx) += 82xx/
--
1.5.3.5.726.g41a7a
^ permalink raw reply related
* [PATCH 2/7] Add mpc512x ipic support
From: John Rigby @ 2008-01-08 16:01 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1199808093-15929-2-git-send-email-jrigby@freescale.com>
Added ipic_info entries for vectors used by 512x that
were previously unused by 83xx.
Signed-off-by: John Rigby <jrigby@freescale.com>
---
arch/powerpc/sysdev/ipic.c | 62 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 62 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index 7274750..4c016da 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -48,6 +48,13 @@ static struct ipic_info ipic_info[] = {
.bit = 17,
.prio_mask = 1,
},
+ [3] = {
+ .mask = IPIC_SIMSR_H,
+ .prio = IPIC_SIPRR_C,
+ .force = IPIC_SIFCR_H,
+ .bit = 18,
+ .prio_mask = 2,
+ },
[4] = {
.mask = IPIC_SIMSR_H,
.prio = IPIC_SIPRR_C,
@@ -55,6 +62,34 @@ static struct ipic_info ipic_info[] = {
.bit = 19,
.prio_mask = 3,
},
+ [5] = {
+ .mask = IPIC_SIMSR_H,
+ .prio = IPIC_SIPRR_C,
+ .force = IPIC_SIFCR_H,
+ .bit = 20,
+ .prio_mask = 4,
+ },
+ [6] = {
+ .mask = IPIC_SIMSR_H,
+ .prio = IPIC_SIPRR_C,
+ .force = IPIC_SIFCR_H,
+ .bit = 21,
+ .prio_mask = 5,
+ },
+ [7] = {
+ .mask = IPIC_SIMSR_H,
+ .prio = IPIC_SIPRR_C,
+ .force = IPIC_SIFCR_H,
+ .bit = 22,
+ .prio_mask = 6,
+ },
+ [8] = {
+ .mask = IPIC_SIMSR_H,
+ .prio = IPIC_SIPRR_C,
+ .force = IPIC_SIFCR_H,
+ .bit = 23,
+ .prio_mask = 7,
+ },
[9] = {
.mask = IPIC_SIMSR_H,
.prio = IPIC_SIPRR_D,
@@ -223,6 +258,20 @@ static struct ipic_info ipic_info[] = {
.bit = 7,
.prio_mask = 7,
},
+ [40] = {
+ .mask = IPIC_SIMSR_H,
+ .prio = IPIC_SIPRR_B,
+ .force = IPIC_SIFCR_H,
+ .bit = 8,
+ .prio_mask = 0,
+ },
+ [41] = {
+ .mask = IPIC_SIMSR_H,
+ .prio = IPIC_SIPRR_B,
+ .force = IPIC_SIFCR_H,
+ .bit = 9,
+ .prio_mask = 1,
+ },
[42] = {
.mask = IPIC_SIMSR_H,
.prio = IPIC_SIPRR_B,
@@ -230,6 +279,13 @@ static struct ipic_info ipic_info[] = {
.bit = 10,
.prio_mask = 2,
},
+ [43] = {
+ .mask = IPIC_SIMSR_H,
+ .prio = IPIC_SIPRR_B,
+ .force = IPIC_SIFCR_H,
+ .bit = 11,
+ .prio_mask = 3,
+ },
[44] = {
.mask = IPIC_SIMSR_H,
.prio = IPIC_SIPRR_B,
@@ -387,6 +443,12 @@ static struct ipic_info ipic_info[] = {
.force = IPIC_SIFCR_L,
.bit = 18,
},
+ [83] = {
+ .mask = IPIC_SIMSR_L,
+ .prio = 0,
+ .force = IPIC_SIFCR_L,
+ .bit = 19,
+ },
[84] = {
.mask = IPIC_SIMSR_L,
.prio = 0,
--
1.5.3.5.726.g41a7a
^ permalink raw reply related
* [PATCH 1/7] mpc5121: Add IPIC config option
From: John Rigby @ 2008-01-08 16:01 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1199808093-15929-1-git-send-email-jrigby@freescale.com>
IPIC is not just for 83xx anymore so make it a separate
config option.
Signed-off-by: John Rigby <jrigby@freescale.com>
---
arch/powerpc/platforms/Kconfig | 5 +++++
arch/powerpc/sysdev/Makefile | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index ea22cad..ad9b1c0 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -22,6 +22,7 @@ config PPC_83xx
depends on 6xx
select FSL_SOC
select 83xx
+ select FSL_IPIC
select WANT_DEVICE_TREE
config PPC_86xx
@@ -80,6 +81,10 @@ config XICS
bool
default y
+config FSL_IPIC
+ bool
+ default n
+
config MPIC
bool
default n
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 9a20ef4..66fe39c 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -24,7 +24,7 @@ obj-$(CONFIG_AXON_RAM) += axonram.o
ifeq ($(CONFIG_PPC_MERGE),y)
obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
obj-$(CONFIG_PPC_I8259) += i8259.o
-obj-$(CONFIG_PPC_83xx) += ipic.o
+obj-$(CONFIG_FSL_IPIC) += ipic.o
obj-$(CONFIG_4xx) += uic.o
obj-$(CONFIG_XILINX_VIRTEX) += xilinx_intc.o
ifeq ($(CONFIG_PCI),y)
--
1.5.3.5.726.g41a7a
^ permalink raw reply related
* [PATCH 0/7] mpc5121 support
From: John Rigby @ 2008-01-08 16:01 UTC (permalink / raw)
To: linuxppc-dev
The following series adds basic support
for mpc5121. I'm hoping that this can get reviewed
quickly so it can get into the for-2.6.25 tree.
^ permalink raw reply
* Re: [PATCH 1/3] add default device trees for MPC837x MDS board
From: Grant Likely @ 2008-01-08 15:58 UTC (permalink / raw)
To: Li Yang; +Cc: linuxppc-dev, paulus
In-Reply-To: <1199707400-23588-1-git-send-email-leoli@freescale.com>
Hi Leo,
comments below. I've made my comments on the first file, but they
apply to the other two also.
Cheers,
g.
On 1/7/08, Li Yang <leoli@freescale.com> wrote:
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> address comments and use new dts spec.
>
> arch/powerpc/boot/dts/mpc8377_mds.dts | 277 +++++++++++++++++++++++++++++++
> arch/powerpc/boot/dts/mpc8378_mds.dts | 263 +++++++++++++++++++++++++++++
> arch/powerpc/boot/dts/mpc8379_mds.dts | 291 +++++++++++++++++++++++++++++++++
> 3 files changed, 831 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/boot/dts/mpc8377_mds.dts b/arch/powerpc/boot/dts/mpc8377_mds.dts
> new file mode 100644
> index 0000000..b50b5f9
> --- /dev/null
> +++ b/arch/powerpc/boot/dts/mpc8377_mds.dts
> @@ -0,0 +1,277 @@
> +/*
> + * MPC8377E MDS Device Tree Source
> + *
> + * Copyright 2007 Freescale Semiconductor Inc.
> + *
> + * 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.
> + */
> +
> +/ {
> + model = "fsl,mpc8377emds";
> + compatible = "fsl,mpc8377emds","fsl,mpc837xmds";
Compatibility at the board level is a really hard thing to claim. I'd
drop the "fsl,mpc837xmds" here and make the platform code bind to
either.
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + aliases {
> + ethernet0 = &enet0;
> + ethernet1 = &enet1;
> + serial0 = &serial0;
> + serial1 = &serial1;
> + pci0 = &pci0;
> + };
> +
> + cpus {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + PowerPC,8377@0 {
> + device_type = "cpu";
> + reg = <0>;
> + d-cache-line-size = <20>;
> + i-cache-line-size = <20>;
> + d-cache-size = <8000>; // L1, 32K
> + i-cache-size = <8000>; // L1, 32K
> + timebase-frequency = <0>;
> + bus-frequency = <0>;
> + clock-frequency = <0>;
> + };
> + };
> +
> + memory {
> + device_type = "memory";
> + reg = <00000000 20000000>; // 512MB at 0
> + };
> +
> + soc@e0000000 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + device_type = "soc";
I recommend dropping device_type and adding 'compatible = "fsl,mpc8377-immr";'
> + ranges = <0 e0000000 00100000>;
> + reg = <e0000000 00000200>;
> + bus-frequency = <0>;
> +
> + wdt@200 {
> + compatible = "mpc83xx_wdt";
"fsl,mpc8377_wdt", "fsl,mpc83xx_wdt" as per generic names recommended practice.
> + reg = <200 100>;
> + };
> +
> + i2c@3000 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + cell-index = <0>;
> + compatible = "fsl-i2c";
> + reg = <3000 100>;
> + interrupts = <e 8>;
> + interrupt-parent = < &ipic >;
> + dfsrr;
> + };
> +
> + i2c@3100 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + cell-index = <1>;
> + compatible = "fsl-i2c";
> + reg = <3100 100>;
> + interrupts = <f 8>;
> + interrupt-parent = < &ipic >;
> + dfsrr;
> + };
> +
> + spi@7000 {
> + compatible = "fsl_spi";
> + reg = <7000 1000>;
> + interrupts = <10 8>;
> + interrupt-parent = < &ipic >;
> + mode = "cpu";
> + };
> +
> + /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
> + usb@23000 {
> + compatible = "fsl-usb2-dr";
> + reg = <23000 1000>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + interrupt-parent = < &ipic >;
> + interrupts = <26 8>;
> + phy_type = "utmi_wide";
fsl,phy_type please.
> + };
> +
> + mdio@24520 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + compatible = "fsl,gianfar-mdio";
> + reg = <24520 20>;
> + phy2: ethernet-phy@2 {
> + interrupt-parent = < &ipic >;
> + interrupts = <11 8>;
> + reg = <2>;
> + device_type = "ethernet-phy";
> + };
> + phy3: ethernet-phy@3 {
> + interrupt-parent = < &ipic >;
> + interrupts = <12 8>;
> + reg = <3>;
> + device_type = "ethernet-phy";
> + };
> + };
> +
> + enet0: ethernet@24000 {
> + cell-index = <0>;
> + device_type = "network";
> + model = "eTSEC";
Drop model property
> + compatible = "gianfar";
> + reg = <24000 1000>;
> + local-mac-address = [ 00 00 00 00 00 00 ];
> + interrupts = <20 8 21 8 22 8>;
> + phy-connection-type = "mii";
> + interrupt-parent = < &ipic >;
> + phy-handle = < &phy2 >;
> + };
> +
> + enet1: ethernet@25000 {
> + cell-index = <1>;
> + device_type = "network";
> + model = "eTSEC";
Drop model property.
> + compatible = "gianfar";
> + reg = <25000 1000>;
> + local-mac-address = [ 00 00 00 00 00 00 ];
> + interrupts = <23 8 24 8 25 8>;
> + phy-connection-type = "mii";
> + interrupt-parent = < &ipic >;
> + phy-handle = < &phy3 >;
> + };
> +
> + serial0: serial@4500 {
> + cell-index = <0>;
> + device_type = "serial";
> + compatible = "ns16550";
> + reg = <4500 100>;
> + clock-frequency = <0>;
> + interrupts = <9 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + serial1: serial@4600 {
> + cell-index = <1>;
> + device_type = "serial";
> + compatible = "ns16550";
> + reg = <4600 100>;
> + clock-frequency = <0>;
> + interrupts = <a 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + crypto@30000 {
> + model = "SEC3";
Drop model property and encode relevant info into compatible.
> + compatible = "talitos";
> + reg = <30000 10000>;
> + interrupts = <b 8>;
> + interrupt-parent = < &ipic >;
> + /* Rev. 3.0 geometry */
> + num-channels = <4>;
> + channel-fifo-len = <18>;
> + exec-units-mask = <000001fe>;
> + descriptor-types-mask = <03ab0ebf>;
> + };
> +
> + sdhc@2e000 {
> + model = "eSDHC";
> + compatible = "fsl,esdhc";
Drop the model property and change compatible to "fsl,mpc8377-esdhc".
> + reg = <2e000 1000>;
> + interrupts = <2a 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + sata@18000 {
> + compatible = "fsl,mpc8379-sata", "fsl,pq2pro-sata";
> + reg = <18000 1000>;
> + interrupts = <2c 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + sata@19000 {
> + compatible = "fsl,mpc8379-sata", "fsl,pq2pro-sata";
> + reg = <19000 1000>;
> + interrupts = <2d 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + /* IPIC
> + * interrupts cell = <intr #, sense>
> + * sense values match linux IORESOURCE_IRQ_* defines:
> + * sense == 8: Level, low assertion
> + * sense == 2: Edge, high-to-low change
> + */
> + ipic: pic@700 {
> + compatible = "fsl,ipic";
> + interrupt-controller;
> + #address-cells = <0>;
> + #interrupt-cells = <2>;
> + reg = <700 100>;
> + };
> + };
> +
> + pci0: pci@e0008500 {
> + cell-index = <0>;
> + interrupt-map-mask = <f800 0 0 7>;
> + interrupt-map = <
> +
> + /* IDSEL 0x11 */
> + 8800 0 0 1 &ipic 14 8
> + 8800 0 0 2 &ipic 15 8
> + 8800 0 0 3 &ipic 16 8
> + 8800 0 0 4 &ipic 17 8
> +
> + /* IDSEL 0x12 */
> + 9000 0 0 1 &ipic 16 8
> + 9000 0 0 2 &ipic 17 8
> + 9000 0 0 3 &ipic 14 8
> + 9000 0 0 4 &ipic 15 8
> +
> + /* IDSEL 0x13 */
> + 9800 0 0 1 &ipic 17 8
> + 9800 0 0 2 &ipic 14 8
> + 9800 0 0 3 &ipic 15 8
> + 9800 0 0 4 &ipic 16 8
> +
> + /* IDSEL 0x15 */
> + a800 0 0 1 &ipic 14 8
> + a800 0 0 2 &ipic 15 8
> + a800 0 0 3 &ipic 16 8
> + a800 0 0 4 &ipic 17 8
> +
> + /* IDSEL 0x16 */
> + b000 0 0 1 &ipic 17 8
> + b000 0 0 2 &ipic 14 8
> + b000 0 0 3 &ipic 15 8
> + b000 0 0 4 &ipic 16 8
> +
> + /* IDSEL 0x17 */
> + b800 0 0 1 &ipic 16 8
> + b800 0 0 2 &ipic 17 8
> + b800 0 0 3 &ipic 14 8
> + b800 0 0 4 &ipic 15 8
> +
> + /* IDSEL 0x18 */
> + c000 0 0 1 &ipic 15 8
> + c000 0 0 2 &ipic 16 8
> + c000 0 0 3 &ipic 17 8
> + c000 0 0 4 &ipic 14 8>;
> + interrupt-parent = < &ipic >;
> + interrupts = <42 8>;
> + bus-range = <0 0>;
> + ranges = <02000000 0 90000000 90000000 0 10000000
> + 42000000 0 80000000 80000000 0 10000000
> + 01000000 0 00000000 e0300000 0 00100000>;
> + clock-frequency = <0>;
> + #interrupt-cells = <1>;
> + #size-cells = <2>;
> + #address-cells = <3>;
> + reg = <e0008500 100>;
> + compatible = "fsl,mpc8349-pci";
> + device_type = "pci";
> + };
> +};
> diff --git a/arch/powerpc/boot/dts/mpc8378_mds.dts b/arch/powerpc/boot/dts/mpc8378_mds.dts
> new file mode 100644
> index 0000000..bd9545d
> --- /dev/null
> +++ b/arch/powerpc/boot/dts/mpc8378_mds.dts
> @@ -0,0 +1,263 @@
> +/*
> + * MPC8378E MDS Device Tree Source
> + *
> + * Copyright 2007 Freescale Semiconductor Inc.
> + *
> + * 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.
> + */
> +
> +/ {
> + model = "fsl,mpc8378emds";
> + compatible = "fsl,mpc8378emds","fsl,mpc837xmds";
Again, board level compatibility is very difficult to claim.
fsl,mpc837xmds doesn't make much sense here. Just make the platform
code bind on all the variants.
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + aliases {
> + ethernet0 = &enet0;
> + ethernet1 = &enet1;
> + serial0 = &serial0;
> + serial1 = &serial1;
> + pci0 = &pci0;
> + };
> +
> + cpus {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + PowerPC,8378@0 {
> + device_type = "cpu";
> + reg = <0>;
> + d-cache-line-size = <20>;
> + i-cache-line-size = <20>;
> + d-cache-size = <8000>; // L1, 32K
> + i-cache-size = <8000>; // L1, 32K
> + timebase-frequency = <0>;
> + bus-frequency = <0>;
> + clock-frequency = <0>;
> + };
> + };
> +
> + memory {
> + device_type = "memory";
> + reg = <00000000 20000000>; // 512MB at 0
> + };
> +
> + soc@e0000000 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + device_type = "soc";
Drop device_type and add compatible
> + ranges = <0 e0000000 00100000>;
> + reg = <e0000000 00000200>;
> + bus-frequency = <0>;
> +
> + wdt@200 {
> + compatible = "mpc83xx_wdt";
> + reg = <200 100>;
> + };
> +
> + i2c@3000 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + cell-index = <0>;
> + compatible = "fsl-i2c";
> + reg = <3000 100>;
> + interrupts = <e 8>;
> + interrupt-parent = < &ipic >;
> + dfsrr;
> + };
> +
> + i2c@3100 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + cell-index = <1>;
> + compatible = "fsl-i2c";
> + reg = <3100 100>;
> + interrupts = <f 8>;
> + interrupt-parent = < &ipic >;
> + dfsrr;
> + };
> +
> + spi@7000 {
> + compatible = "fsl_spi";
> + reg = <7000 1000>;
> + interrupts = <10 8>;
> + interrupt-parent = < &ipic >;
> + mode = "cpu";
> + };
> +
> + /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
> + usb@23000 {
> + compatible = "fsl-usb2-dr";
> + reg = <23000 1000>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + interrupt-parent = < &ipic >;
> + interrupts = <26 8>;
> + phy_type = "utmi_wide";
> + };
> +
> + mdio@24520 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + compatible = "fsl,gianfar-mdio";
> + reg = <24520 20>;
> + phy2: ethernet-phy@2 {
> + interrupt-parent = < &ipic >;
> + interrupts = <11 8>;
> + reg = <2>;
> + device_type = "ethernet-phy";
> + };
> + phy3: ethernet-phy@3 {
> + interrupt-parent = < &ipic >;
> + interrupts = <12 8>;
> + reg = <3>;
> + device_type = "ethernet-phy";
> + };
> + };
> +
> + enet0: ethernet@24000 {
> + cell-index = <0>;
> + device_type = "network";
> + model = "eTSEC";
> + compatible = "gianfar";
> + reg = <24000 1000>;
> + local-mac-address = [ 00 00 00 00 00 00 ];
> + interrupts = <20 8 21 8 22 8>;
> + phy-connection-type = "mii";
> + interrupt-parent = < &ipic >;
> + phy-handle = < &phy2 >;
> + };
> +
> + enet1: ethernet@25000 {
> + cell-index = <1>;
> + device_type = "network";
> + model = "eTSEC";
> + compatible = "gianfar";
> + reg = <25000 1000>;
> + local-mac-address = [ 00 00 00 00 00 00 ];
> + interrupts = <23 8 24 8 25 8>;
> + phy-connection-type = "mii";
> + interrupt-parent = < &ipic >;
> + phy-handle = < &phy3 >;
> + };
> +
> + serial0: serial@4500 {
> + cell-index = <0>;
> + device_type = "serial";
> + compatible = "ns16550";
> + reg = <4500 100>;
> + clock-frequency = <0>;
> + interrupts = <9 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + serial1: serial@4600 {
> + cell-index = <1>;
> + device_type = "serial";
> + compatible = "ns16550";
> + reg = <4600 100>;
> + clock-frequency = <0>;
> + interrupts = <a 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + crypto@30000 {
> + model = "SEC3";
> + compatible = "talitos";
> + reg = <30000 10000>;
> + interrupts = <b 8>;
> + interrupt-parent = < &ipic >;
> + /* Rev. 3.0 geometry */
> + num-channels = <4>;
> + channel-fifo-len = <18>;
> + exec-units-mask = <000001fe>;
> + descriptor-types-mask = <03ab0ebf>;
> + };
> +
> + sdhc@2e000 {
> + model = "eSDHC";
> + compatible = "fsl,esdhc";
> + reg = <2e000 1000>;
> + interrupts = <2a 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + /* IPIC
> + * interrupts cell = <intr #, sense>
> + * sense values match linux IORESOURCE_IRQ_* defines:
> + * sense == 8: Level, low assertion
> + * sense == 2: Edge, high-to-low change
> + */
> + ipic: pic@700 {
> + compatible = "fsl,ipic";
> + interrupt-controller;
> + #address-cells = <0>;
> + #interrupt-cells = <2>;
> + reg = <700 100>;
> + };
> + };
> +
> + pci0: pci@e0008500 {
> + cell-index = <0>;
> + interrupt-map-mask = <f800 0 0 7>;
> + interrupt-map = <
> +
> + /* IDSEL 0x11 */
> + 8800 0 0 1 &ipic 14 8
> + 8800 0 0 2 &ipic 15 8
> + 8800 0 0 3 &ipic 16 8
> + 8800 0 0 4 &ipic 17 8
> +
> + /* IDSEL 0x12 */
> + 9000 0 0 1 &ipic 16 8
> + 9000 0 0 2 &ipic 17 8
> + 9000 0 0 3 &ipic 14 8
> + 9000 0 0 4 &ipic 15 8
> +
> + /* IDSEL 0x13 */
> + 9800 0 0 1 &ipic 17 8
> + 9800 0 0 2 &ipic 14 8
> + 9800 0 0 3 &ipic 15 8
> + 9800 0 0 4 &ipic 16 8
> +
> + /* IDSEL 0x15 */
> + a800 0 0 1 &ipic 14 8
> + a800 0 0 2 &ipic 15 8
> + a800 0 0 3 &ipic 16 8
> + a800 0 0 4 &ipic 17 8
> +
> + /* IDSEL 0x16 */
> + b000 0 0 1 &ipic 17 8
> + b000 0 0 2 &ipic 14 8
> + b000 0 0 3 &ipic 15 8
> + b000 0 0 4 &ipic 16 8
> +
> + /* IDSEL 0x17 */
> + b800 0 0 1 &ipic 16 8
> + b800 0 0 2 &ipic 17 8
> + b800 0 0 3 &ipic 14 8
> + b800 0 0 4 &ipic 15 8
> +
> + /* IDSEL 0x18 */
> + c000 0 0 1 &ipic 15 8
> + c000 0 0 2 &ipic 16 8
> + c000 0 0 3 &ipic 17 8
> + c000 0 0 4 &ipic 14 8>;
> + interrupt-parent = < &ipic >;
> + interrupts = <42 8>;
> + bus-range = <0 0>;
> + ranges = <02000000 0 90000000 90000000 0 10000000
> + 42000000 0 80000000 80000000 0 10000000
> + 01000000 0 00000000 e0300000 0 00100000>;
> + clock-frequency = <0>;
> + #interrupt-cells = <1>;
> + #size-cells = <2>;
> + #address-cells = <3>;
> + reg = <e0008500 100>;
> + compatible = "fsl,mpc8349-pci";
> + device_type = "pci";
> + };
> +};
> diff --git a/arch/powerpc/boot/dts/mpc8379_mds.dts b/arch/powerpc/boot/dts/mpc8379_mds.dts
> new file mode 100644
> index 0000000..4d651a3
> --- /dev/null
> +++ b/arch/powerpc/boot/dts/mpc8379_mds.dts
> @@ -0,0 +1,291 @@
> +/*
> + * MPC8379E MDS Device Tree Source
> + *
> + * Copyright 2007 Freescale Semiconductor Inc.
> + *
> + * 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.
> + */
> +
> +/ {
> + model = "fsl,mpc8379emds";
> + compatible = "fsl,mpc8379emds","fsl,mpc837xmds";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + aliases {
> + ethernet0 = &enet0;
> + ethernet1 = &enet1;
> + serial0 = &serial0;
> + serial1 = &serial1;
> + pci0 = &pci0;
> + };
> +
> + cpus {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + PowerPC,8379@0 {
> + device_type = "cpu";
> + reg = <0>;
> + d-cache-line-size = <20>;
> + i-cache-line-size = <20>;
> + d-cache-size = <8000>; // L1, 32K
> + i-cache-size = <8000>; // L1, 32K
> + timebase-frequency = <0>;
> + bus-frequency = <0>;
> + clock-frequency = <0>;
> + };
> + };
> +
> + memory {
> + device_type = "memory";
> + reg = <00000000 20000000>; // 512MB at 0
> + };
> +
> + soc@e0000000 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + device_type = "soc";
> + ranges = <0 e0000000 00100000>;
> + reg = <e0000000 00000200>;
> + bus-frequency = <0>;
> +
> + wdt@200 {
> + compatible = "mpc83xx_wdt";
> + reg = <200 100>;
> + };
> +
> + i2c@3000 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + cell-index = <0>;
> + compatible = "fsl-i2c";
> + reg = <3000 100>;
> + interrupts = <e 8>;
> + interrupt-parent = < &ipic >;
> + dfsrr;
> + };
> +
> + i2c@3100 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + cell-index = <1>;
> + compatible = "fsl-i2c";
> + reg = <3100 100>;
> + interrupts = <f 8>;
> + interrupt-parent = < &ipic >;
> + dfsrr;
> + };
> +
> + spi@7000 {
> + compatible = "fsl_spi";
> + reg = <7000 1000>;
> + interrupts = <10 8>;
> + interrupt-parent = < &ipic >;
> + mode = "cpu";
> + };
> +
> + /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
> + usb@23000 {
> + compatible = "fsl-usb2-dr";
> + reg = <23000 1000>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + interrupt-parent = < &ipic >;
> + interrupts = <26 8>;
> + phy_type = "utmi_wide";
> + };
> +
> + mdio@24520 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + compatible = "fsl,gianfar-mdio";
> + reg = <24520 20>;
> + phy2: ethernet-phy@2 {
> + interrupt-parent = < &ipic >;
> + interrupts = <11 8>;
> + reg = <2>;
> + device_type = "ethernet-phy";
> + };
> + phy3: ethernet-phy@3 {
> + interrupt-parent = < &ipic >;
> + interrupts = <12 8>;
> + reg = <3>;
> + device_type = "ethernet-phy";
> + };
> + };
> +
> + enet0: ethernet@24000 {
> + cell-index = <0>;
> + device_type = "network";
> + model = "eTSEC";
> + compatible = "gianfar";
> + reg = <24000 1000>;
> + local-mac-address = [ 00 00 00 00 00 00 ];
> + interrupts = <20 8 21 8 22 8>;
> + phy-connection-type = "mii";
> + interrupt-parent = < &ipic >;
> + phy-handle = < &phy2 >;
> + };
> +
> + enet1: ethernet@25000 {
> + cell-index = <1>;
> + device_type = "network";
> + model = "eTSEC";
> + compatible = "gianfar";
> + reg = <25000 1000>;
> + local-mac-address = [ 00 00 00 00 00 00 ];
> + interrupts = <23 8 24 8 25 8>;
> + phy-connection-type = "mii";
> + interrupt-parent = < &ipic >;
> + phy-handle = < &phy3 >;
> + };
> +
> + serial0: serial@4500 {
> + cell-index = <0>;
> + device_type = "serial";
> + compatible = "ns16550";
> + reg = <4500 100>;
> + clock-frequency = <0>;
> + interrupts = <9 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + serial1: serial@4600 {
> + cell-index = <1>;
> + device_type = "serial";
> + compatible = "ns16550";
> + reg = <4600 100>;
> + clock-frequency = <0>;
> + interrupts = <a 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + crypto@30000 {
> + model = "SEC3";
> + compatible = "talitos";
> + reg = <30000 10000>;
> + interrupts = <b 8>;
> + interrupt-parent = < &ipic >;
> + /* Rev. 3.0 geometry */
> + num-channels = <4>;
> + channel-fifo-len = <18>;
> + exec-units-mask = <000001fe>;
> + descriptor-types-mask = <03ab0ebf>;
> + };
> +
> + sdhc@2e000 {
> + model = "eSDHC";
> + compatible = "fsl,esdhc";
> + reg = <2e000 1000>;
> + interrupts = <2a 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + sata@18000 {
> + compatible = "fsl,mpc8379-sata", "fsl,pq2pro-sata";
> + reg = <18000 1000>;
> + interrupts = <2c 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + sata@19000 {
> + compatible = "fsl,mpc8379-sata", "fsl,pq2pro-sata";
> + reg = <19000 1000>;
> + interrupts = <2d 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + sata@1a000 {
> + compatible = "fsl,mpc8379-sata", "fsl,pq2pro-sata";
> + reg = <1a000 1000>;
> + interrupts = <2e 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + sata@1b000 {
> + compatible = "fsl,mpc8379-sata", "fsl,pq2pro-sata";
> + reg = <1b000 1000>;
> + interrupts = <2f 8>;
> + interrupt-parent = < &ipic >;
> + };
> +
> + /* IPIC
> + * interrupts cell = <intr #, sense>
> + * sense values match linux IORESOURCE_IRQ_* defines:
> + * sense == 8: Level, low assertion
> + * sense == 2: Edge, high-to-low change
> + */
> + ipic: pic@700 {
> + compatible = "fsl,ipic";
> + interrupt-controller;
> + #address-cells = <0>;
> + #interrupt-cells = <2>;
> + reg = <700 100>;
> + };
> + };
> +
> + pci0: pci@e0008500 {
> + cell-index = <0>;
> + interrupt-map-mask = <f800 0 0 7>;
> + interrupt-map = <
> +
> + /* IDSEL 0x11 */
> + 8800 0 0 1 &ipic 14 8
> + 8800 0 0 2 &ipic 15 8
> + 8800 0 0 3 &ipic 16 8
> + 8800 0 0 4 &ipic 17 8
> +
> + /* IDSEL 0x12 */
> + 9000 0 0 1 &ipic 16 8
> + 9000 0 0 2 &ipic 17 8
> + 9000 0 0 3 &ipic 14 8
> + 9000 0 0 4 &ipic 15 8
> +
> + /* IDSEL 0x13 */
> + 9800 0 0 1 &ipic 17 8
> + 9800 0 0 2 &ipic 14 8
> + 9800 0 0 3 &ipic 15 8
> + 9800 0 0 4 &ipic 16 8
> +
> + /* IDSEL 0x15 */
> + a800 0 0 1 &ipic 14 8
> + a800 0 0 2 &ipic 15 8
> + a800 0 0 3 &ipic 16 8
> + a800 0 0 4 &ipic 17 8
> +
> + /* IDSEL 0x16 */
> + b000 0 0 1 &ipic 17 8
> + b000 0 0 2 &ipic 14 8
> + b000 0 0 3 &ipic 15 8
> + b000 0 0 4 &ipic 16 8
> +
> + /* IDSEL 0x17 */
> + b800 0 0 1 &ipic 16 8
> + b800 0 0 2 &ipic 17 8
> + b800 0 0 3 &ipic 14 8
> + b800 0 0 4 &ipic 15 8
> +
> + /* IDSEL 0x18 */
> + c000 0 0 1 &ipic 15 8
> + c000 0 0 2 &ipic 16 8
> + c000 0 0 3 &ipic 17 8
> + c000 0 0 4 &ipic 14 8>;
> + interrupt-parent = < &ipic >;
> + interrupts = <42 8>;
> + bus-range = <0 0>;
> + ranges = <02000000 0 90000000 90000000 0 10000000
> + 42000000 0 80000000 80000000 0 10000000
> + 01000000 0 00000000 e0300000 0 00100000>;
> + clock-frequency = <0>;
> + #interrupt-cells = <1>;
> + #size-cells = <2>;
> + #address-cells = <3>;
> + reg = <e0008500 100>;
> + compatible = "fsl,mpc8349-pci";
> + device_type = "pci";
> + };
> +};
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH v6] qe: add ability to upload QE firmware
From: Josh Boyer @ 2008-01-08 15:45 UTC (permalink / raw)
To: Timur Tabi; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <47839623.4090200@freescale.com>
On Tue, 08 Jan 2008 09:26:27 -0600
Timur Tabi <timur@freescale.com> wrote:
> Stephen Rothwell wrote:
>
> > If you use:
> > for_each_child_of_node(qe, fw)
> > You don't need to initialise 'fw' in its declararion.
>
> I can't find for_each_child_of_node. It's not in Kumar's for-2.6.25 branch.
include/linux/of.h
http://git.kernel.org/?p=linux/kernel/git/galak/powerpc.git;a=blob;f=include/linux/of.h;h=c65af7bd1e9c6369757dfaeeecf74feccea83f97;hb=for-2.6.25
josh
^ permalink raw reply
* Re: [PATCH v6] qe: add ability to upload QE firmware
From: Timur Tabi @ 2008-01-08 15:29 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20080108133747.f717e4b4.sfr@canb.auug.org.au>
Stephen Rothwell wrote:
> Why not:
> const u64 *iprop;
> int len;
>
> iprop = of_get_property(fs, "extended-modes", &len);
> if (iprop && (len == sizeof(u64))
> qe_firmware_info.extended_modes = *iprop;
Actually, I like my way better, because then I don't have to define 'len', and I
don't have to define two integer property variables one for u32 and one for u64.
Besides, now that I'm at version 6, I'd rather not post updates for minor
stylistic changes.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: [PATCH v6] qe: add ability to upload QE firmware
From: Timur Tabi @ 2008-01-08 15:26 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20080108133747.f717e4b4.sfr@canb.auug.org.au>
Stephen Rothwell wrote:
> If you use:
> for_each_child_of_node(qe, fw)
> You don't need to initialise 'fw' in its declararion.
I can't find for_each_child_of_node. It's not in Kumar's for-2.6.25 branch.
> Why not:
> const u64 *iprop;
> int len;
>
> iprop = of_get_property(fs, "extended-modes", &len);
Ok.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: [PATCH 1/3] add default device trees for MPC837x MDS board
From: Kumar Gala @ 2008-01-08 15:18 UTC (permalink / raw)
To: Li Yang; +Cc: linuxppc-dev, paulus
In-Reply-To: <989B956029373F45A0B8AF029708189001BA00F1@zch01exm26.fsl.freescale.net>
>>>
>>
>> Could I convince you to convert these to dts-v1 format?
>
> Ok, I can do it. The DTS spec changes too much lately. :(
Thanks. I'll merge the two patches into one when I commit. Its open
source development ;)
- k
^ permalink raw reply
* [PATCH 4/4] [POWERPC] fsl_spi_init and users: stop using device_type = "spi"
From: Anton Vorontsov @ 2008-01-08 14:30 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <20080108142634.GA5989@localhost.localdomain>
Also:
- rename "fsl_spi" to "fsl,spi";
- add and use cell-index property, if found;
- split probing code out of fsl_spi_init, thus we can call
it for legacy device_type probing and new "compatible" probing.
Per http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048388.html
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
Documentation/powerpc/booting-without-of.txt | 8 +-
arch/powerpc/boot/dts/mpc8313erdb.dts | 4 +-
arch/powerpc/boot/dts/mpc832x_mds.dts | 8 +-
arch/powerpc/boot/dts/mpc832x_rdb.dts | 8 +-
arch/powerpc/boot/dts/mpc8349emitx.dts | 4 +-
arch/powerpc/boot/dts/mpc8349emitxgp.dts | 4 +-
arch/powerpc/boot/dts/mpc834x_mds.dts | 4 +-
arch/powerpc/boot/dts/mpc836x_mds.dts | 8 +-
arch/powerpc/boot/dts/mpc8568mds.dts | 8 +-
arch/powerpc/sysdev/fsl_soc.c | 94 ++++++++++++++++----------
10 files changed, 86 insertions(+), 64 deletions(-)
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index ed0b92c..2b30611 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1563,8 +1563,8 @@ platforms are moved over to use the flattened-device-tree model.
ii) SPI (Serial Peripheral Interface)
Required properties:
- - device_type : should be "spi".
- - compatible : should be "fsl_spi".
+ - cell-index : SPI controller index.
+ - compatible : should be "fsl,spi".
- mode : the SPI operation mode, it can be "cpu" or "cpu-qe".
- reg : Offset and length of the register set for the device
- interrupts : <a b> where a is the interrupt number and b is a
@@ -1577,8 +1577,8 @@ platforms are moved over to use the flattened-device-tree model.
Example:
spi@4c0 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <4c0 40>;
interrupts = <82 0>;
interrupt-parent = <700>;
diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts b/arch/powerpc/boot/dts/mpc8313erdb.dts
index c5b6665..a0492b6 100644
--- a/arch/powerpc/boot/dts/mpc8313erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
@@ -82,8 +82,8 @@
};
spi@7000 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <7000 1000>;
interrupts = <10 8>;
interrupt-parent = < &ipic >;
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index cf41194..cc99fb0 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -193,8 +193,8 @@
};
spi@4c0 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <4c0 40>;
interrupts = <2>;
interrupt-parent = < &qeic >;
@@ -202,8 +202,8 @@
};
spi@500 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <1>;
+ compatible = "fsl,spi";
reg = <500 40>;
interrupts = <1>;
interrupt-parent = < &qeic >;
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 09301c1..c0e5e93 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -183,8 +183,8 @@
};
spi@4c0 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <4c0 40>;
interrupts = <2>;
interrupt-parent = <&qeic>;
@@ -192,8 +192,8 @@
};
spi@500 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <1>;
+ compatible = "fsl,spi";
reg = <500 40>;
interrupts = <1>;
interrupt-parent = <&qeic>;
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
index e354f26..f8fc5f6 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -82,8 +82,8 @@
};
spi@7000 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <7000 1000>;
interrupts = <10 8>;
interrupt-parent = < &ipic >;
diff --git a/arch/powerpc/boot/dts/mpc8349emitxgp.dts b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
index ebdf0b7..666650c 100644
--- a/arch/powerpc/boot/dts/mpc8349emitxgp.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
@@ -80,8 +80,8 @@
};
spi@7000 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <7000 1000>;
interrupts = <10 8>;
interrupt-parent = < &ipic >;
diff --git a/arch/powerpc/boot/dts/mpc834x_mds.dts b/arch/powerpc/boot/dts/mpc834x_mds.dts
index 0ba13eb..6ed36a1 100644
--- a/arch/powerpc/boot/dts/mpc834x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc834x_mds.dts
@@ -93,8 +93,8 @@
};
spi@7000 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <7000 1000>;
interrupts = <10 8>;
interrupt-parent = < &ipic >;
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index 3eb8f72..be7dfed 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -224,8 +224,8 @@
};
spi@4c0 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <4c0 40>;
interrupts = <2>;
interrupt-parent = < &qeic >;
@@ -233,8 +233,8 @@
};
spi@500 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <1>;
+ compatible = "fsl,spi";
reg = <500 40>;
interrupts = <1>;
interrupt-parent = < &qeic >;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 2bc147f..84474cb 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -301,8 +301,8 @@
};
spi@4c0 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <4c0 40>;
interrupts = <2>;
interrupt-parent = <&qeic>;
@@ -310,8 +310,8 @@
};
spi@500 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <1>;
+ compatible = "fsl,spi";
reg = <500 40>;
interrupts = <1>;
interrupt-parent = <&qeic>;
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 7b13876..cec1ab7 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -1226,42 +1226,17 @@ arch_initcall(cpm_smc_uart_of_init);
#endif /* CONFIG_8xx */
#endif /* CONFIG_PPC_CPM_NEW_BINDING */
-int __init fsl_spi_init(struct spi_board_info *board_infos,
- unsigned int num_board_infos,
- void (*activate_cs)(u8 cs, u8 polarity),
- void (*deactivate_cs)(u8 cs, u8 polarity))
+static int __init of_fsl_spi_probe(char *type, char *compatible, u32 sysclk,
+ struct spi_board_info *board_infos,
+ unsigned int num_board_infos,
+ void (*activate_cs)(u8 cs, u8 polarity),
+ void (*deactivate_cs)(u8 cs, u8 polarity))
{
struct device_node *np;
- unsigned int i;
- u32 sysclk;
-
- /* SPI controller is either clocked from QE or SoC clock */
- sysclk = get_brgfreq();
- if (sysclk == -1) {
- const u32 *freq;
- int size;
-
- np = of_find_node_by_type(NULL, "soc");
- if (!np)
- return -ENODEV;
-
- freq = of_get_property(np, "clock-frequency", &size);
- if (!freq || size != sizeof(*freq) || *freq == 0) {
- freq = of_get_property(np, "bus-frequency", &size);
- if (!freq || size != sizeof(*freq) || *freq == 0) {
- of_node_put(np);
- return -ENODEV;
- }
- }
-
- sysclk = *freq;
- of_node_put(np);
- }
+ unsigned int i = 0;
- for (np = NULL, i = 1;
- (np = of_find_compatible_node(np, "spi", "fsl_spi")) != NULL;
- i++) {
- int ret = 0;
+ for_each_compatible_node(np, type, compatible) {
+ int ret;
unsigned int j;
const void *prop;
struct resource res[2];
@@ -1280,6 +1255,10 @@ int __init fsl_spi_init(struct spi_board_info *board_infos,
goto err;
pdata.bus_num = *(u32 *)prop;
+ prop = of_get_property(np, "cell-index", NULL);
+ if (prop)
+ i = *(u32 *)prop;
+
prop = of_get_property(np, "mode", NULL);
if (prop && !strcmp(prop, "cpu-qe"))
pdata.qe_mode = 1;
@@ -1290,7 +1269,7 @@ int __init fsl_spi_init(struct spi_board_info *board_infos,
}
if (!pdata.max_chipselect)
- goto err;
+ continue;
ret = of_address_to_resource(np, 0, &res[0]);
if (ret)
@@ -1317,13 +1296,56 @@ int __init fsl_spi_init(struct spi_board_info *board_infos,
if (ret)
goto unreg;
- continue;
+ goto next;
unreg:
platform_device_del(pdev);
err:
- continue;
+ pr_err("%s: registration failed\n", np->full_name);
+next:
+ i++;
}
+ return i;
+}
+
+int __init fsl_spi_init(struct spi_board_info *board_infos,
+ unsigned int num_board_infos,
+ void (*activate_cs)(u8 cs, u8 polarity),
+ void (*deactivate_cs)(u8 cs, u8 polarity))
+{
+ u32 sysclk;
+ int ret;
+
+ /* SPI controller is either clocked from QE or SoC clock */
+ sysclk = get_brgfreq();
+ if (sysclk == -1) {
+ struct device_node *np;
+ const u32 *freq;
+ int size;
+
+ np = of_find_node_by_type(NULL, "soc");
+ if (!np)
+ return -ENODEV;
+
+ freq = of_get_property(np, "clock-frequency", &size);
+ if (!freq || size != sizeof(*freq) || *freq == 0) {
+ freq = of_get_property(np, "bus-frequency", &size);
+ if (!freq || size != sizeof(*freq) || *freq == 0) {
+ of_node_put(np);
+ return -ENODEV;
+ }
+ }
+
+ sysclk = *freq;
+ of_node_put(np);
+ }
+
+ ret = of_fsl_spi_probe(NULL, "fsl,spi", sysclk, board_infos,
+ num_board_infos, activate_cs, deactivate_cs);
+ if (!ret)
+ of_fsl_spi_probe("spi", "fsl_spi", sysclk, board_infos,
+ num_board_infos, activate_cs, deactivate_cs);
+
return spi_register_board_info(board_infos, num_board_infos);
}
--
1.5.2.2
^ permalink raw reply related
* [PATCH 3/4] [POWERPC][SPI] use brg-frequency for SPI in QE
From: Anton Vorontsov @ 2008-01-08 14:30 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <20080108142634.GA5989@localhost.localdomain>
In case of QE we can use brg-frequency (which is qeclk/2).
Thus no need to divide sysclk in the spi_mpc83xx.
This patch also adds code to use get_brgfreq() on QE chips.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
---
arch/powerpc/sysdev/fsl_soc.c | 44 ++++++++++++++++++++++++++++------------
drivers/spi/spi_mpc83xx.c | 6 +----
2 files changed, 32 insertions(+), 18 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 60d9c4e..7b13876 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -66,7 +66,7 @@ phys_addr_t get_immrbase(void)
EXPORT_SYMBOL(get_immrbase);
-#if defined(CONFIG_CPM2) || defined(CONFIG_8xx)
+#if defined(CONFIG_CPM2) || defined(CONFIG_QUICC_ENGINE) || defined(CONFIG_8xx)
static u32 brgfreq = -1;
@@ -91,11 +91,21 @@ u32 get_brgfreq(void)
/* Legacy device binding -- will go away when no users are left. */
node = of_find_node_by_type(NULL, "cpm");
+ if (!node)
+ node = of_find_compatible_node(NULL, NULL, "fsl,qe");
+ if (!node)
+ node = of_find_node_by_type(NULL, "qe");
+
if (node) {
prop = of_get_property(node, "brg-frequency", &size);
if (prop && size == 4)
brgfreq = *prop;
+ if (brgfreq == -1 || brgfreq == 0) {
+ prop = of_get_property(node, "bus-frequency", &size);
+ if (prop && size == 4)
+ brgfreq = *prop / 2;
+ }
of_node_put(node);
}
@@ -1223,22 +1233,30 @@ int __init fsl_spi_init(struct spi_board_info *board_infos,
{
struct device_node *np;
unsigned int i;
- const u32 *sysclk;
+ u32 sysclk;
/* SPI controller is either clocked from QE or SoC clock */
- np = of_find_compatible_node(NULL, NULL, "fsl,qe");
- if (!np)
- np = of_find_node_by_type(NULL, "qe");
+ sysclk = get_brgfreq();
+ if (sysclk == -1) {
+ const u32 *freq;
+ int size;
- if (!np)
np = of_find_node_by_type(NULL, "soc");
+ if (!np)
+ return -ENODEV;
+
+ freq = of_get_property(np, "clock-frequency", &size);
+ if (!freq || size != sizeof(*freq) || *freq == 0) {
+ freq = of_get_property(np, "bus-frequency", &size);
+ if (!freq || size != sizeof(*freq) || *freq == 0) {
+ of_node_put(np);
+ return -ENODEV;
+ }
+ }
- if (!np)
- return -ENODEV;
-
- sysclk = of_get_property(np, "bus-frequency", NULL);
- if (!sysclk)
- return -ENODEV;
+ sysclk = *freq;
+ of_node_put(np);
+ }
for (np = NULL, i = 1;
(np = of_find_compatible_node(np, "spi", "fsl_spi")) != NULL;
@@ -1255,7 +1273,7 @@ int __init fsl_spi_init(struct spi_board_info *board_infos,
memset(res, 0, sizeof(res));
- pdata.sysclk = *sysclk;
+ pdata.sysclk = sysclk;
prop = of_get_property(np, "reg", NULL);
if (!prop)
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index 4580b9c..04f7cd9 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -436,11 +436,7 @@ static int __init mpc83xx_spi_probe(struct platform_device *dev)
mpc83xx_spi->qe_mode = pdata->qe_mode;
mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8;
mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8;
-
- if (mpc83xx_spi->qe_mode)
- mpc83xx_spi->spibrg = pdata->sysclk / 2;
- else
- mpc83xx_spi->spibrg = pdata->sysclk;
+ mpc83xx_spi->spibrg = pdata->sysclk;
mpc83xx_spi->rx_shift = 0;
mpc83xx_spi->tx_shift = 0;
--
1.5.2.2
^ permalink raw reply related
* [PATCH 2/4] [POWERPC][NET] ucc_geth_mii and users: get rid of device_type
From: Anton Vorontsov @ 2008-01-08 14:29 UTC (permalink / raw)
To: Kumar Gala, Jeff Garzik; +Cc: linuxppc-dev, netdev
In-Reply-To: <20080108142634.GA5989@localhost.localdomain>
device_type property is bogus, thus use proper compatible.
Also change compatible property to "fsl,ucc-mdio".
Per http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048388.html
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
arch/powerpc/boot/dts/mpc832x_mds.dts | 3 +--
arch/powerpc/boot/dts/mpc832x_rdb.dts | 3 +--
arch/powerpc/boot/dts/mpc836x_mds.dts | 3 +--
arch/powerpc/boot/dts/mpc8568mds.dts | 2 +-
drivers/net/ucc_geth_mii.c | 3 +++
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index 010c8d9..cf41194 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -255,8 +255,7 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <2320 18>;
- device_type = "mdio";
- compatible = "ucc_geth_phy";
+ compatible = "fsl,ucc-mdio";
phy3: ethernet-phy@03 {
interrupt-parent = < &ipic >;
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 3a73134..09301c1 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -236,8 +236,7 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <3120 18>;
- device_type = "mdio";
- compatible = "ucc_geth_phy";
+ compatible = "fsl,ucc-mdio";
phy00:ethernet-phy@00 {
interrupt-parent = <&pic>;
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index 2986860..3eb8f72 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -288,8 +288,7 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <2120 18>;
- device_type = "mdio";
- compatible = "ucc_geth_phy";
+ compatible = "fsl,ucc-mdio";
phy0: ethernet-phy@00 {
interrupt-parent = < &ipic >;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 7440347..2bc147f 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -356,7 +356,7 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <2120 18>;
- compatible = "ucc_geth_phy";
+ compatible = "fsl,ucc-mdio";
/* These are the same PHYs as on
* gianfar's MDIO bus */
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index df884f0..e3ba14a 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -256,6 +256,9 @@ static struct of_device_id uec_mdio_match[] = {
.type = "mdio",
.compatible = "ucc_geth_phy",
},
+ {
+ .compatible = "fsl,ucc-mdio",
+ },
{},
};
--
1.5.2.2
^ permalink raw reply related
* [PATCH 1/4] [POWERPC] qe_lib and users: get rid of device_types and model
From: Anton Vorontsov @ 2008-01-08 14:29 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <20080108142634.GA5989@localhost.localdomain>
Now we're searching for "fsl,qe", "fsl,qe-muram", "fsl,qe-muram-data"
and "fsl,qe-ic".
Per http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048388.html
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
Documentation/powerpc/booting-without-of.txt | 6 ++++--
arch/powerpc/boot/dts/mpc832x_mds.dts | 11 ++++++-----
arch/powerpc/boot/dts/mpc832x_rdb.dts | 11 ++++++-----
arch/powerpc/boot/dts/mpc836x_mds.dts | 11 ++++++-----
arch/powerpc/boot/dts/mpc8568mds.dts | 11 ++++++-----
arch/powerpc/platforms/83xx/mpc832x_mds.c | 11 +++++++----
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 11 +++++++----
arch/powerpc/platforms/83xx/mpc836x_mds.c | 11 +++++++----
arch/powerpc/platforms/85xx/mpc85xx_mds.c | 16 +++++++++++-----
arch/powerpc/sysdev/fsl_soc.c | 5 ++++-
arch/powerpc/sysdev/qe_lib/qe.c | 16 +++++++++++++---
11 files changed, 77 insertions(+), 43 deletions(-)
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index ee0209a..ed0b92c 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1770,7 +1770,7 @@ platforms are moved over to use the flattened-device-tree model.
vii) Multi-User RAM (MURAM)
Required properties:
- - device_type : should be "muram".
+ - compatible : should be "fsl,cpm-muram", "fsl,qe-muram".
- mode : the could be "host" or "slave".
- ranges : Should be defined as specified in 1) to describe the
translation of MURAM addresses.
@@ -1780,10 +1780,12 @@ platforms are moved over to use the flattened-device-tree model.
Example:
muram@10000 {
- device_type = "muram";
+ compatible = "fsl,cpm-muram", "fsl,qe-muram";
ranges = <0 00010000 0000c000>;
data-only@0{
+ compatible = "fsl,cpm-muram-data",
+ "fsl,qe-muram-data";
reg = <0 c000>;
};
};
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index 26ac467..010c8d9 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -175,18 +175,19 @@
qe@e0100000 {
#address-cells = <1>;
#size-cells = <1>;
- device_type = "qe";
- model = "QE";
+ compatible = "fsl,qe";
ranges = <0 e0100000 00100000>;
reg = <e0100000 480>;
brg-frequency = <0>;
bus-frequency = <BCD3D80>;
muram@10000 {
- device_type = "muram";
+ compatible = "fsl,cpm-muram", "fsl,qe-muram";
ranges = <0 00010000 00004000>;
data-only@0 {
+ compatible = "fsl,cpm-muram-data",
+ "fsl,qe-muram-data";
reg = <0 4000>;
};
};
@@ -271,9 +272,9 @@
};
};
- qeic: qeic@80 {
+ qeic: interrupt-controller@80 {
interrupt-controller;
- device_type = "qeic";
+ compatible = "fsl,qe-ic";
#address-cells = <0>;
#interrupt-cells = <1>;
reg = <80 80>;
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 10ff7aa..3a73134 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -165,18 +165,19 @@
qe@e0100000 {
#address-cells = <1>;
#size-cells = <1>;
- device_type = "qe";
- model = "QE";
+ compatible = "fsl,qe";
ranges = <0 e0100000 00100000>;
reg = <e0100000 480>;
brg-frequency = <0>;
bus-frequency = <BCD3D80>;
muram@10000 {
- device_type = "muram";
+ compatible = "fsl,cpm-muram", "fsl,qe-muram";
ranges = <0 00010000 00004000>;
data-only@0 {
+ compatible = "fsl,cpm-muram-data",
+ "fsl,qe-muram-data";
reg = <0 4000>;
};
};
@@ -252,9 +253,9 @@
};
};
- qeic:qeic@80 {
+ qeic:interrupt-controller@80 {
interrupt-controller;
- device_type = "qeic";
+ compatible = "fsl,qe-ic";
#address-cells = <0>;
#interrupt-cells = <1>;
reg = <80 80>;
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index fd841b2..2986860 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -206,18 +206,19 @@
qe@e0100000 {
#address-cells = <1>;
#size-cells = <1>;
- device_type = "qe";
- model = "QE";
+ compatible = "fsl,qe";
ranges = <0 e0100000 00100000>;
reg = <e0100000 480>;
brg-frequency = <0>;
bus-frequency = <179A7B00>;
muram@10000 {
- device_type = "muram";
+ compatible = "fsl,cpm-muram", "fsl,qe-muram";
ranges = <0 00010000 0000c000>;
data-only@0{
+ compatible = "fsl,cpm-muram-data",
+ "fsl,qe-muram-data";
reg = <0 c000>;
};
};
@@ -304,9 +305,9 @@
};
};
- qeic: qeic@80 {
+ qeic: interrupt-controller@80 {
interrupt-controller;
- device_type = "qeic";
+ compatible = "fsl,qe-ic";
#address-cells = <0>;
#interrupt-cells = <1>;
reg = <80 80>;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 5818a7c..7440347 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -283,18 +283,19 @@
qe@e0080000 {
#address-cells = <1>;
#size-cells = <1>;
- device_type = "qe";
- model = "QE";
+ compatible = "fsl,qe";
ranges = <0 e0080000 00040000>;
reg = <e0080000 480>;
brg-frequency = <0>;
bus-frequency = <179A7B00>;
muram@10000 {
- device_type = "muram";
+ compatible = "fsl,cpm-muram", "fsl,qe-muram";
ranges = <0 00010000 0000c000>;
data-only@0{
+ compatible = "fsl,cpm-muram-data",
+ "fsl,qe-muram-data";
reg = <0 c000>;
};
};
@@ -385,9 +386,9 @@
};
};
- qeic: qeic@80 {
+ qeic: interrupt-controller@80 {
interrupt-controller;
- device_type = "qeic";
+ compatible = "fsl,qe-ic";
#address-cells = <0>;
#interrupt-cells = <1>;
reg = <80 80>;
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 1e570bb..ec41284 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -105,6 +105,7 @@ static struct of_device_id mpc832x_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
{ .type = "qe", },
+ { .compatible = "fsl,qe", },
{},
};
@@ -137,10 +138,12 @@ static void __init mpc832x_sys_init_IRQ(void)
of_node_put(np);
#ifdef CONFIG_QUICC_ENGINE
- np = of_find_node_by_type(NULL, "qeic");
- if (!np)
- return;
-
+ np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+ if (!np) {
+ np = of_find_node_by_type(NULL, "qeic");
+ if (!np)
+ return;
+ }
qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
of_node_put(np);
#endif /* CONFIG_QUICC_ENGINE */
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index ffb2e93..3025871 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -118,6 +118,7 @@ static struct of_device_id mpc832x_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
{ .type = "qe", },
+ { .compatible = "fsl,qe", },
{},
};
@@ -151,10 +152,12 @@ void __init mpc832x_rdb_init_IRQ(void)
of_node_put(np);
#ifdef CONFIG_QUICC_ENGINE
- np = of_find_node_by_type(NULL, "qeic");
- if (!np)
- return;
-
+ np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+ if (!np) {
+ np = of_find_node_by_type(NULL, "qeic");
+ if (!np)
+ return;
+ }
qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
of_node_put(np);
#endif /* CONFIG_QUICC_ENGINE */
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 2ac9890..788291c 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -136,6 +136,7 @@ static struct of_device_id mpc836x_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
{ .type = "qe", },
+ { .compatible = "fsl,qe", },
{},
};
@@ -168,10 +169,12 @@ static void __init mpc836x_mds_init_IRQ(void)
of_node_put(np);
#ifdef CONFIG_QUICC_ENGINE
- np = of_find_node_by_type(NULL, "qeic");
- if (!np)
- return;
-
+ np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+ if (!np) {
+ np = of_find_node_by_type(NULL, "qeic");
+ if (!np)
+ return;
+ }
qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
of_node_put(np);
#endif /* CONFIG_QUICC_ENGINE */
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index e6c63a5..4fa6d6c 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -94,7 +94,10 @@ static void __init mpc85xx_mds_setup_arch(void)
#endif
#ifdef CONFIG_QUICC_ENGINE
- if ((np = of_find_node_by_name(NULL, "qe")) != NULL) {
+ np = of_find_compatible_node(NULL, NULL, "fsl,qe");
+ if (!np)
+ np = of_find_node_by_name(NULL, "qe");
+ if (np) {
qe_reset();
of_node_put(np);
}
@@ -139,6 +142,7 @@ static struct of_device_id mpc85xx_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
{ .type = "qe", },
+ { .compatible = "fsl,qe", },
{},
};
@@ -179,10 +183,12 @@ static void __init mpc85xx_mds_pic_init(void)
mpic_init(mpic);
#ifdef CONFIG_QUICC_ENGINE
- np = of_find_node_by_type(NULL, "qeic");
- if (!np)
- return;
-
+ np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+ if (!np) {
+ np = of_find_node_by_type(NULL, "qeic");
+ if (!np)
+ return;
+ }
qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, NULL);
of_node_put(np);
#endif /* CONFIG_QUICC_ENGINE */
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 4baad80..60d9c4e 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -1226,7 +1226,10 @@ int __init fsl_spi_init(struct spi_board_info *board_infos,
const u32 *sysclk;
/* SPI controller is either clocked from QE or SoC clock */
- np = of_find_node_by_type(NULL, "qe");
+ np = of_find_compatible_node(NULL, NULL, "fsl,qe");
+ if (!np)
+ np = of_find_node_by_type(NULL, "qe");
+
if (!np)
np = of_find_node_by_type(NULL, "soc");
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 21e0106..cd6cee3 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -68,7 +68,10 @@ phys_addr_t get_qe_base(void)
if (qebase != -1)
return qebase;
- qe = of_find_node_by_type(NULL, "qe");
+ qe = of_find_compatible_node(NULL, NULL, "fsl,qe");
+ if (!qe)
+ qe = of_find_node_by_type(NULL, "qe");
+
if (qe) {
unsigned int size;
const void *prop = of_get_property(qe, "reg", &size);
@@ -155,7 +158,10 @@ unsigned int get_brg_clk(void)
if (brg_clk)
return brg_clk;
- qe = of_find_node_by_type(NULL, "qe");
+ qe = of_find_compatible_node(NULL, NULL, "fsl,qe");
+ if (!qe)
+ qe = of_find_node_by_type(NULL, "qe");
+
if (qe) {
unsigned int size;
const u32 *prop = of_get_property(qe, "brg-frequency", &size);
@@ -334,7 +340,11 @@ static void qe_muram_init(void)
/* XXX: This is a subset of the available muram. It
* varies with the processor and the microcode patches activated.
*/
- if ((np = of_find_node_by_name(NULL, "data-only")) != NULL) {
+ np = of_find_compatible_node(NULL, NULL, "fsl,qe-muram-data");
+ if (!np)
+ np = of_find_node_by_name(NULL, "data-only");
+
+ if (np) {
address = *of_get_address(np, 0, &size, &flags);
of_node_put(np);
rh_attach_region(&qe_muram_info, address, (int) size);
--
1.5.2.2
^ permalink raw reply related
* [PATCH v4 0/4] device_type/compatible cleanups
From: Anton Vorontsov @ 2008-01-08 14:26 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
Hi all,
The fourth version follows...
Changes since v3:
- Thanks to reviewers, few glitches found and fixed;
- New conversion: device_type = "qeic" to compatible = "fsl,qe-ic";
- Documentation updated.
Changes since v2:
- SPI conversion fixed and actually tested on MPC8323E-RDB to not
break anything;
- Few more users of device_type = "qe" converted to
compatible = "fsl,qe";
- Got Ack on SPI part from David Brownell.
Changes since v1:
- Device tree lookup changes should be backward compatible with
older dtbs;
- Few of_put_node() cleanups;
- cell-index property added to spi nodes;
- cpm-muram{,-data} added as an addition to qe-muram{,-data}.
Thanks,
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* Generic MMC-over-SPI binding?
From: Simon Richter @ 2008-01-08 14:22 UTC (permalink / raw)
To: linuxppc-dev, linuxppc-embedded
Hi,
in an embedded system similar to the lite5200 board, there is an MMC
card socket connected to one of the PSCs. Ideally, I'd like to express
this fact via the device tree and have the kernel bind the mmc-spi
driver to the SPI interface, but I cannot find any place where to insert
this code that I feel comfortable with.
- It is not a board-specific thing, because any board can just use any
SPI bus for MMC.
- The mmc-spi driver appears to be platform independent, so I'm not
sure OF bindings should be added to it.
- The generic device tree scanning does not contain any special cases
yet, so I don't want to add one.
My current thought is to create a new driver that just handles MMC on
PSCs in SPI mode by gluing all the relevant drivers together, but that
doesn't seem optimal to me either.
Any ideas?
Simon
^ permalink raw reply
* Re: [PATCH] Use <linux/of_{platform, device}.h> and not <asm/...> variants.
From: Jon Loeliger @ 2008-01-08 14:05 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20080108113637.5208a0c7.sfr@canb.auug.org.au>
So, like, the other day Stephen Rothwell mumbled:
>
> Hi Jon,
>
> > Continue to fight the Good Fight by removing
> > old include file references that managed to
> > creep in recently.
>
> Thanks for doing this.
By $DIETY, I'll obtain Janitorial Karma one way or another!
The question now is, what next? I'm thinking about
picking on arch/sparc/, then drivers/ and sound/,
and finally pick off /include.
To be honest, I'm not sure what the final /include
structure is supposed to look like or do as both
pairs of these files mutually include their counterpart.
(i/l/of_d.h includes i/a/of_d.h which includes i/l/of_d.h)
(i/l/of_p.h includes i/a/of_p.h which includes i/l/of_p.h)
But, of course, the various asm/of_{platform,device}.h files
are different for each arch/, so I wasn't sure if the longer
term plan had folding the arch variants straight into the
include/linux/ version of the file or not. Seems there will
come a point when the sparc and powerpc variants will need
to be more unified...
arch/sparc/kernel/ioport.c:#include <asm/of_device.h>
arch/sparc/kernel/time.c:#include <asm/of_device.h>
arch/sparc64/kernel/auxio.c:#include <asm/of_device.h>
arch/sparc64/kernel/ebus.c:#include <asm/of_device.h>
arch/sparc64/kernel/isa.c:#include <asm/of_device.h>
arch/sparc64/kernel/pci_common.c:#include <asm/of_device.h>
arch/sparc64/kernel/pci_psycho.c:#include <asm/of_device.h>
arch/sparc64/kernel/pci_sabre.c:#include <asm/of_device.h>
arch/sparc64/kernel/pci_schizo.c:#include <asm/of_device.h>
arch/sparc64/kernel/power.c:#include <asm/of_device.h>
arch/sparc64/kernel/prom.c:#include <asm/of_device.h>
arch/sparc64/kernel/time.c:#include <asm/of_device.h>
drivers/char/ipmi/ipmi_si_intf.c:#include <asm/of_device.h>
drivers/hwmon/ams/ams.h:#include <asm/of_device.h>
drivers/input/serio/i8042-sparcio.h:#include <asm/of_device.h>
drivers/macintosh/smu.c:#include <asm/of_device.h>
drivers/macintosh/therm_pm72.c:#include <asm/of_device.h>
drivers/net/fs_enet/mac-fcc.c:#include <asm/of_device.h>
drivers/net/fs_enet/mac-fec.c:#include <asm/of_device.h>
drivers/pcmcia/m8xx_pcmcia.c:#include <asm/of_device.h>
drivers/sbus/sbus.c:#include <asm/of_device.h>
drivers/serial/sunhv.c:#include <asm/of_device.h>
drivers/serial/sunsab.c:#include <asm/of_device.h>
drivers/serial/sunsu.c:#include <asm/of_device.h>
drivers/serial/sunzilog.c:#include <asm/of_device.h>
drivers/video/bw2.c:#include <asm/of_device.h>
drivers/video/cg14.c:#include <asm/of_device.h>
drivers/video/cg3.c:#include <asm/of_device.h>
drivers/video/cg6.c:#include <asm/of_device.h>
drivers/video/ffb.c:#include <asm/of_device.h>
drivers/video/leo.c:#include <asm/of_device.h>
drivers/video/p9100.c:#include <asm/of_device.h>
drivers/video/platinumfb.c:#include <asm/of_device.h>
drivers/video/sunxvr2500.c:#include <asm/of_device.h>
drivers/video/sunxvr500.c:#include <asm/of_device.h>
drivers/video/tcx.c:#include <asm/of_device.h>
drivers/ata/pata_mpc52xx.c:#include <asm/of_platform.h>
drivers/char/hw_random/pasemi-rng.c:#include <asm/of_platform.h>
drivers/char/ipmi/ipmi_si_intf.c:#include <asm/of_platform.h>
drivers/hwmon/ams/ams-core.c:#include <asm/of_platform.h>
drivers/macintosh/smu.c:#include <asm/of_platform.h>
drivers/macintosh/therm_adt746x.c:#include <asm/of_platform.h>
drivers/macintosh/therm_pm72.c:#include <asm/of_platform.h>
drivers/macintosh/therm_windtunnel.c:#include <asm/of_platform.h>
drivers/net/fs_enet/fs_enet-main.c:#include <asm/of_platform.h>
drivers/net/fs_enet/mac-scc.c:#include <asm/of_platform.h>
drivers/net/fs_enet/mii-fec.c:#include <asm/of_platform.h>
drivers/net/ibm_newemac/core.h:#include <asm/of_platform.h>
drivers/net/ucc_geth.c:#include <asm/of_platform.h>
drivers/net/ucc_geth_mii.c:#include <asm/of_platform.h>
drivers/pcmcia/electra_cf.c:#include <asm/of_platform.h>
drivers/pcmcia/m8xx_pcmcia.c:#include <asm/of_platform.h>
drivers/serial/mpc52xx_uart.c:#include <asm/of_platform.h>
drivers/serial/of_serial.c:#include <asm/of_platform.h>
drivers/spi/mpc52xx_psc_spi.c:#include <asm/of_platform.h>
drivers/usb/host/ohci-ppc-of.c:#include <asm/of_platform.h>
drivers/video/platinumfb.c:#include <asm/of_platform.h>
drivers/watchdog/mpc5200_wdt.c:#include <asm/of_platform.h>
sound/aoa/soundbus/soundbus.h:#include <asm/of_device.h>
include/asm-powerpc/macio.h:#include <asm/of_device.h>
include/asm-powerpc/pmi.h:#include <asm/of_device.h>
include/asm-sparc/ebus.h:#include <asm/of_device.h>
include/asm-sparc/sbus.h:#include <asm/of_device.h>
include/asm-sparc64/ebus.h:#include <asm/of_device.h>
include/asm-sparc64/isa.h:#include <asm/of_device.h>
include/asm-sparc64/parport.h:#include <asm/of_device.h>
include/asm-sparc64/sbus.h:#include <asm/of_device.h>
include/linux/of_device.h:#include <asm/of_device.h>
include/linux/of_platform.h:#include <asm/of_platform.h>
^ permalink raw reply
* port linux-2.6 to ml410, problem on disabling external interrupts
From: diak sim @ 2008-01-08 13:40 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 2157 bytes --]
there is a strange problem.
my platform is ml410, port linux-2.6.23rc2 vertex kernel to it. the toolchain is generated by crosstool. the cross-gcc is powerpc-405-linux-gnu-gcc 4.0.2.when i complete the kernel compiling and download it to the board to run, there are a few questions.
at first, i can't see anything output after "Now booting the kernel". through debugging i found that init_IRQ() function in init/main.c can't run to the end. so i cut it and rerun the kernel. it runs so long until the rootfs is mounted. the problem occurs in executing /linuxrc. it says "init has generated signal 4 but has no handler for it". the reason, i've known, is that i disabled the init_IRQ() function. then i get down to search for the wrong point.
the init_IRQ() called in init/main.c is defined in arch/powerpc/kernel/irq.c. init_IRQ() calls ppc_md.init_IRQ(). ppc_md is a variable of "struct machdep_calls". the ppc_md.init_IRQ is evaluated in arch/ppc/syslib/ppc4xx_setup.c. the statement is ppc_md.init_IRQ = ppc4xx_init_IRQ. and the ppc4xx_init_IRQ() calls ppc4xx_pic_init() defined in arch/ppc/syslib/xilinx_pic.c.
tracing into ppc4xx_pic_init() function, i located the problem at "intc_out_be32(intc + IER, 0)". "intc_out_be32" is a macro as the real form "out_be32((addr), (mask))". the out_be32() is a function defined in include/asm-ppc/io.h.
extern inline void out_be32(volatile unsigned __iomem *addr, int val)
{
__asm__ __volatile__("sync; stw%U0%X0 %1,%0" : "=m" (*addr) : "r" (val));
}
i replace "intc_out_be32(intc + IER, 0)" with the assemble statements and rerun, nothing changes.
XPS's debugger points out that the kernel stop in _delay() function. but there is not any call to this function. only the 2 assemble statements are there.
dividing the "sync" and "stw" into 2 __asm__ ones, "sync" is passed but "stw" makes a strange _delay() calling.
so strange it is, who can help me?
thanks.
___________________________________________________________
雅虎邮箱传递新年祝福,个性贺卡送亲朋!
http://cn.mail.yahoo.com/gc/index.html?entry=5&souce=mail_mailletter_tagline
[-- Attachment #2: Type: text/html, Size: 2401 bytes --]
^ permalink raw reply
* Re: [PATCH 0/2] ASoC drivers for the Freescale MPC8610 SoC
From: Liam Girdwood @ 2008-01-08 12:38 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev, alsa-devel
In-Reply-To: <1199732204949-git-send-email-timur@freescale.com>
On Mon, 2008-01-07 at 12:56 -0600, Timur Tabi wrote:
> These patches add ALSA SoC device drivers for the Freescale MPC8610 SoC
> and the MPC8610-HPCD reference board.
>
> The first patch updates some files in arch/powerpc and booting-without-of.txt.
>
> The second patch adds the new audio driver files to sound/soc.
>
> Both must be applied in order to avoid a build break.
>
Both applied to the dev branch. This should let others use them atm and
allow us to port to ASoC v2.
I'll make a start on the port now.
Liam
^ permalink raw reply
* Re: [PATCH v2] [POWERPC] Update MPC8610 HPCD to support audio drivers
From: Liam Girdwood @ 2008-01-08 12:39 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev, alsa-devel, Timur Tabi
In-Reply-To: <20080108115654.d0ac909b.sfr@canb.auug.org.au>
On Tue, 2008-01-08 at 11:56 +1100, Stephen Rothwell wrote:
> Hi Timur,
>
> On Mon, 7 Jan 2008 12:56:43 -0600 Timur Tabi <timur@freescale.com> wrote:
> >
> > +++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
> > @@ -34,9 +34,27 @@
> >
> > #include <asm/mpic.h>
> >
> > +#include <linux/of_platform.h>
> > #include <sysdev/fsl_pci.h>
> > #include <sysdev/fsl_soc.h>
> >
> > +static struct of_device_id mpc8610_ids[] = {
>
> __initdata
>
> > + { .compatible = "fsl,mpc8610", },
> > + {}
> > +};
> > +
> > +static int __init mpc8610_declare_of_platform_devices(void)
> > +{
> > + if (!machine_is(mpc86xx_hpcd))
> > + return 0;
> > +
> > + /* Without this call, the SSI device driver won't get probed. */
> > + of_platform_bus_probe(NULL, mpc8610_ids, NULL);
> > +
> > + return 0;
> > +}
> > +device_initcall(mpc8610_declare_of_platform_devices);
>
> We have machine_device_initcall for this now.
>
Now changed in ASoC dev branch.
Liam
^ permalink raw reply
* [PATCH] Convert MPC837x device trees to dts-v1
From: Li Yang @ 2008-01-08 11:32 UTC (permalink / raw)
To: galak, linuxppc-dev; +Cc: Li Yang
Signed-off-by: Li Yang <leoli@freescale.com>
---
arch/powerpc/boot/dts/mpc8377_mds.dts | 148 ++++++++++++++++---------------
arch/powerpc/boot/dts/mpc8378_mds.dts | 140 +++++++++++++++---------------
arch/powerpc/boot/dts/mpc8379_mds.dts | 156 +++++++++++++++++----------------
3 files changed, 225 insertions(+), 219 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc8377_mds.dts b/arch/powerpc/boot/dts/mpc8377_mds.dts
index b50b5f9..d66c8ad 100644
--- a/arch/powerpc/boot/dts/mpc8377_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8377_mds.dts
@@ -9,6 +9,8 @@
* option) any later version.
*/
+/dts-v1/;
+
/ {
model = "fsl,mpc8377emds";
compatible = "fsl,mpc8377emds","fsl,mpc837xmds";
@@ -30,10 +32,10 @@
PowerPC,8377@0 {
device_type = "cpu";
reg = <0>;
- d-cache-line-size = <20>;
- i-cache-line-size = <20>;
- d-cache-size = <8000>; // L1, 32K
- i-cache-size = <8000>; // L1, 32K
+ d-cache-line-size = <0x20>;
+ i-cache-line-size = <0x20>;
+ d-cache-size = <0x8000>; // L1, 32K
+ i-cache-size = <0x8000>; // L1, 32K
timebase-frequency = <0>;
bus-frequency = <0>;
clock-frequency = <0>;
@@ -42,20 +44,20 @@
memory {
device_type = "memory";
- reg = <00000000 20000000>; // 512MB at 0
+ reg = <0x00000000 0x20000000>; // 512MB at 0
};
soc@e0000000 {
#address-cells = <1>;
#size-cells = <1>;
device_type = "soc";
- ranges = <0 e0000000 00100000>;
- reg = <e0000000 00000200>;
+ ranges = <0x0 0xe0000000 0x00100000>;
+ reg = <0xe0000000 0x00000200>;
bus-frequency = <0>;
wdt@200 {
compatible = "mpc83xx_wdt";
- reg = <200 100>;
+ reg = <0x200 0x100>;
};
i2c@3000 {
@@ -63,8 +65,8 @@
#size-cells = <0>;
cell-index = <0>;
compatible = "fsl-i2c";
- reg = <3000 100>;
- interrupts = <e 8>;
+ reg = <0x3000 0x100>;
+ interrupts = <0xe 0x8>;
interrupt-parent = < &ipic >;
dfsrr;
};
@@ -74,16 +76,16 @@
#size-cells = <0>;
cell-index = <1>;
compatible = "fsl-i2c";
- reg = <3100 100>;
- interrupts = <f 8>;
+ reg = <0x3100 0x100>;
+ interrupts = <0xf 0x8>;
interrupt-parent = < &ipic >;
dfsrr;
};
spi@7000 {
compatible = "fsl_spi";
- reg = <7000 1000>;
- interrupts = <10 8>;
+ reg = <0x7000 0x1000>;
+ interrupts = <0x10 0x8>;
interrupt-parent = < &ipic >;
mode = "cpu";
};
@@ -91,11 +93,11 @@
/* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
usb@23000 {
compatible = "fsl-usb2-dr";
- reg = <23000 1000>;
+ reg = <0x23000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
interrupt-parent = < &ipic >;
- interrupts = <26 8>;
+ interrupts = <0x26 0x8>;
phy_type = "utmi_wide";
};
@@ -103,16 +105,16 @@
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,gianfar-mdio";
- reg = <24520 20>;
+ reg = <0x24520 0x20>;
phy2: ethernet-phy@2 {
interrupt-parent = < &ipic >;
- interrupts = <11 8>;
+ interrupts = <0x11 0x8>;
reg = <2>;
device_type = "ethernet-phy";
};
phy3: ethernet-phy@3 {
interrupt-parent = < &ipic >;
- interrupts = <12 8>;
+ interrupts = <0x12 0x8>;
reg = <3>;
device_type = "ethernet-phy";
};
@@ -123,9 +125,9 @@
device_type = "network";
model = "eTSEC";
compatible = "gianfar";
- reg = <24000 1000>;
+ reg = <0x24000 0x1000>;
local-mac-address = [ 00 00 00 00 00 00 ];
- interrupts = <20 8 21 8 22 8>;
+ interrupts = <0x20 0x8 0x21 0x8 0x22 0x8>;
phy-connection-type = "mii";
interrupt-parent = < &ipic >;
phy-handle = < &phy2 >;
@@ -136,9 +138,9 @@
device_type = "network";
model = "eTSEC";
compatible = "gianfar";
- reg = <25000 1000>;
+ reg = <0x25000 0x1000>;
local-mac-address = [ 00 00 00 00 00 00 ];
- interrupts = <23 8 24 8 25 8>;
+ interrupts = <0x23 0x8 0x24 0x8 0x25 0x8>;
phy-connection-type = "mii";
interrupt-parent = < &ipic >;
phy-handle = < &phy3 >;
@@ -148,9 +150,9 @@
cell-index = <0>;
device_type = "serial";
compatible = "ns16550";
- reg = <4500 100>;
+ reg = <0x4500 0x100>;
clock-frequency = <0>;
- interrupts = <9 8>;
+ interrupts = <0x9 0x8>;
interrupt-parent = < &ipic >;
};
@@ -158,44 +160,44 @@
cell-index = <1>;
device_type = "serial";
compatible = "ns16550";
- reg = <4600 100>;
+ reg = <0x4600 0x100>;
clock-frequency = <0>;
- interrupts = <a 8>;
+ interrupts = <0xa 0x8>;
interrupt-parent = < &ipic >;
};
crypto@30000 {
model = "SEC3";
compatible = "talitos";
- reg = <30000 10000>;
- interrupts = <b 8>;
+ reg = <0x30000 0x10000>;
+ interrupts = <0xb 0x8>;
interrupt-parent = < &ipic >;
/* Rev. 3.0 geometry */
num-channels = <4>;
- channel-fifo-len = <18>;
- exec-units-mask = <000001fe>;
- descriptor-types-mask = <03ab0ebf>;
+ channel-fifo-len = <0x18>;
+ exec-units-mask = <0x000001fe>;
+ descriptor-types-mask = <0x03ab0ebf>;
};
sdhc@2e000 {
model = "eSDHC";
compatible = "fsl,esdhc";
- reg = <2e000 1000>;
- interrupts = <2a 8>;
+ reg = <0x2e000 0x1000>;
+ interrupts = <0x2a 0x8>;
interrupt-parent = < &ipic >;
};
sata@18000 {
compatible = "fsl,mpc8379-sata", "fsl,pq2pro-sata";
- reg = <18000 1000>;
- interrupts = <2c 8>;
+ reg = <0x18000 0x1000>;
+ interrupts = <0x2c 0x8>;
interrupt-parent = < &ipic >;
};
sata@19000 {
compatible = "fsl,mpc8379-sata", "fsl,pq2pro-sata";
- reg = <19000 1000>;
- interrupts = <2d 8>;
+ reg = <0x19000 0x1000>;
+ interrupts = <0x2d 0x8>;
interrupt-parent = < &ipic >;
};
@@ -210,67 +212,67 @@
interrupt-controller;
#address-cells = <0>;
#interrupt-cells = <2>;
- reg = <700 100>;
+ reg = <0x700 0x100>;
};
};
pci0: pci@e0008500 {
cell-index = <0>;
- interrupt-map-mask = <f800 0 0 7>;
+ interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
interrupt-map = <
/* IDSEL 0x11 */
- 8800 0 0 1 &ipic 14 8
- 8800 0 0 2 &ipic 15 8
- 8800 0 0 3 &ipic 16 8
- 8800 0 0 4 &ipic 17 8
+ 0x8800 0x0 0x0 0x1 &ipic 0x14 0x8
+ 0x8800 0x0 0x0 0x2 &ipic 0x15 0x8
+ 0x8800 0x0 0x0 0x3 &ipic 0x16 0x8
+ 0x8800 0x0 0x0 0x4 &ipic 0x17 0x8
/* IDSEL 0x12 */
- 9000 0 0 1 &ipic 16 8
- 9000 0 0 2 &ipic 17 8
- 9000 0 0 3 &ipic 14 8
- 9000 0 0 4 &ipic 15 8
+ 0x9000 0x0 0x0 0x1 &ipic 0x16 0x8
+ 0x9000 0x0 0x0 0x2 &ipic 0x17 0x8
+ 0x9000 0x0 0x0 0x3 &ipic 0x14 0x8
+ 0x9000 0x0 0x0 0x4 &ipic 0x15 0x8
/* IDSEL 0x13 */
- 9800 0 0 1 &ipic 17 8
- 9800 0 0 2 &ipic 14 8
- 9800 0 0 3 &ipic 15 8
- 9800 0 0 4 &ipic 16 8
+ 0x9800 0x0 0x0 0x1 &ipic 0x17 0x8
+ 0x9800 0x0 0x0 0x2 &ipic 0x14 0x8
+ 0x9800 0x0 0x0 0x3 &ipic 0x15 0x8
+ 0x9800 0x0 0x0 0x4 &ipic 0x16 0x8
/* IDSEL 0x15 */
- a800 0 0 1 &ipic 14 8
- a800 0 0 2 &ipic 15 8
- a800 0 0 3 &ipic 16 8
- a800 0 0 4 &ipic 17 8
+ 0xa800 0x0 0x0 0x1 &ipic 0x14 0x8
+ 0xa800 0x0 0x0 0x2 &ipic 0x15 0x8
+ 0xa800 0x0 0x0 0x3 &ipic 0x16 0x8
+ 0xa800 0x0 0x0 0x4 &ipic 0x17 0x8
/* IDSEL 0x16 */
- b000 0 0 1 &ipic 17 8
- b000 0 0 2 &ipic 14 8
- b000 0 0 3 &ipic 15 8
- b000 0 0 4 &ipic 16 8
+ 0xb000 0x0 0x0 0x1 &ipic 0x17 0x8
+ 0xb000 0x0 0x0 0x2 &ipic 0x14 0x8
+ 0xb000 0x0 0x0 0x3 &ipic 0x15 0x8
+ 0xb000 0x0 0x0 0x4 &ipic 0x16 0x8
/* IDSEL 0x17 */
- b800 0 0 1 &ipic 16 8
- b800 0 0 2 &ipic 17 8
- b800 0 0 3 &ipic 14 8
- b800 0 0 4 &ipic 15 8
+ 0xb800 0x0 0x0 0x1 &ipic 0x16 0x8
+ 0xb800 0x0 0x0 0x2 &ipic 0x17 0x8
+ 0xb800 0x0 0x0 0x3 &ipic 0x14 0x8
+ 0xb800 0x0 0x0 0x4 &ipic 0x15 0x8
/* IDSEL 0x18 */
- c000 0 0 1 &ipic 15 8
- c000 0 0 2 &ipic 16 8
- c000 0 0 3 &ipic 17 8
- c000 0 0 4 &ipic 14 8>;
+ 0xc000 0x0 0x0 0x1 &ipic 0x15 0x8
+ 0xc000 0x0 0x0 0x2 &ipic 0x16 0x8
+ 0xc000 0x0 0x0 0x3 &ipic 0x17 0x8
+ 0xc000 0x0 0x0 0x4 &ipic 0x14 0x8>;
interrupt-parent = < &ipic >;
- interrupts = <42 8>;
+ interrupts = <0x42 0x8>;
bus-range = <0 0>;
- ranges = <02000000 0 90000000 90000000 0 10000000
- 42000000 0 80000000 80000000 0 10000000
- 01000000 0 00000000 e0300000 0 00100000>;
+ ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
+ 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
+ 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
clock-frequency = <0>;
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
- reg = <e0008500 100>;
+ reg = <0xe0008500 0x100>;
compatible = "fsl,mpc8349-pci";
device_type = "pci";
};
diff --git a/arch/powerpc/boot/dts/mpc8378_mds.dts b/arch/powerpc/boot/dts/mpc8378_mds.dts
index bd9545d..c117a6a 100644
--- a/arch/powerpc/boot/dts/mpc8378_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8378_mds.dts
@@ -9,6 +9,8 @@
* option) any later version.
*/
+/dts-v1/;
+
/ {
model = "fsl,mpc8378emds";
compatible = "fsl,mpc8378emds","fsl,mpc837xmds";
@@ -30,10 +32,10 @@
PowerPC,8378@0 {
device_type = "cpu";
reg = <0>;
- d-cache-line-size = <20>;
- i-cache-line-size = <20>;
- d-cache-size = <8000>; // L1, 32K
- i-cache-size = <8000>; // L1, 32K
+ d-cache-line-size = <0x20>;
+ i-cache-line-size = <0x20>;
+ d-cache-size = <0x8000>; // L1, 32K
+ i-cache-size = <0x8000>; // L1, 32K
timebase-frequency = <0>;
bus-frequency = <0>;
clock-frequency = <0>;
@@ -42,20 +44,20 @@
memory {
device_type = "memory";
- reg = <00000000 20000000>; // 512MB at 0
+ reg = <0x00000000 0x20000000>; // 512MB at 0
};
soc@e0000000 {
#address-cells = <1>;
#size-cells = <1>;
device_type = "soc";
- ranges = <0 e0000000 00100000>;
- reg = <e0000000 00000200>;
+ ranges = <0x0 0xe0000000 0x00100000>;
+ reg = <0xe0000000 0x00000200>;
bus-frequency = <0>;
wdt@200 {
compatible = "mpc83xx_wdt";
- reg = <200 100>;
+ reg = <0x200 0x100>;
};
i2c@3000 {
@@ -63,8 +65,8 @@
#size-cells = <0>;
cell-index = <0>;
compatible = "fsl-i2c";
- reg = <3000 100>;
- interrupts = <e 8>;
+ reg = <0x3000 0x100>;
+ interrupts = <0xe 0x8>;
interrupt-parent = < &ipic >;
dfsrr;
};
@@ -74,16 +76,16 @@
#size-cells = <0>;
cell-index = <1>;
compatible = "fsl-i2c";
- reg = <3100 100>;
- interrupts = <f 8>;
+ reg = <0x3100 0x100>;
+ interrupts = <0xf 0x8>;
interrupt-parent = < &ipic >;
dfsrr;
};
spi@7000 {
compatible = "fsl_spi";
- reg = <7000 1000>;
- interrupts = <10 8>;
+ reg = <0x7000 0x1000>;
+ interrupts = <0x10 0x8>;
interrupt-parent = < &ipic >;
mode = "cpu";
};
@@ -91,11 +93,11 @@
/* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
usb@23000 {
compatible = "fsl-usb2-dr";
- reg = <23000 1000>;
+ reg = <0x23000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
interrupt-parent = < &ipic >;
- interrupts = <26 8>;
+ interrupts = <0x26 0x8>;
phy_type = "utmi_wide";
};
@@ -103,16 +105,16 @@
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,gianfar-mdio";
- reg = <24520 20>;
+ reg = <0x24520 0x20>;
phy2: ethernet-phy@2 {
interrupt-parent = < &ipic >;
- interrupts = <11 8>;
+ interrupts = <0x11 0x8>;
reg = <2>;
device_type = "ethernet-phy";
};
phy3: ethernet-phy@3 {
interrupt-parent = < &ipic >;
- interrupts = <12 8>;
+ interrupts = <0x12 0x8>;
reg = <3>;
device_type = "ethernet-phy";
};
@@ -123,9 +125,9 @@
device_type = "network";
model = "eTSEC";
compatible = "gianfar";
- reg = <24000 1000>;
+ reg = <0x24000 0x1000>;
local-mac-address = [ 00 00 00 00 00 00 ];
- interrupts = <20 8 21 8 22 8>;
+ interrupts = <0x20 0x8 0x21 0x8 0x22 0x8>;
phy-connection-type = "mii";
interrupt-parent = < &ipic >;
phy-handle = < &phy2 >;
@@ -136,9 +138,9 @@
device_type = "network";
model = "eTSEC";
compatible = "gianfar";
- reg = <25000 1000>;
+ reg = <0x25000 0x1000>;
local-mac-address = [ 00 00 00 00 00 00 ];
- interrupts = <23 8 24 8 25 8>;
+ interrupts = <0x23 0x8 0x24 0x8 0x25 0x8>;
phy-connection-type = "mii";
interrupt-parent = < &ipic >;
phy-handle = < &phy3 >;
@@ -148,9 +150,9 @@
cell-index = <0>;
device_type = "serial";
compatible = "ns16550";
- reg = <4500 100>;
+ reg = <0x4500 0x100>;
clock-frequency = <0>;
- interrupts = <9 8>;
+ interrupts = <0x9 0x8>;
interrupt-parent = < &ipic >;
};
@@ -158,30 +160,30 @@
cell-index = <1>;
device_type = "serial";
compatible = "ns16550";
- reg = <4600 100>;
+ reg = <0x4600 0x100>;
clock-frequency = <0>;
- interrupts = <a 8>;
+ interrupts = <0xa 0x8>;
interrupt-parent = < &ipic >;
};
crypto@30000 {
model = "SEC3";
compatible = "talitos";
- reg = <30000 10000>;
- interrupts = <b 8>;
+ reg = <0x30000 0x10000>;
+ interrupts = <0xb 0x8>;
interrupt-parent = < &ipic >;
/* Rev. 3.0 geometry */
num-channels = <4>;
- channel-fifo-len = <18>;
- exec-units-mask = <000001fe>;
- descriptor-types-mask = <03ab0ebf>;
+ channel-fifo-len = <0x18>;
+ exec-units-mask = <0x000001fe>;
+ descriptor-types-mask = <0x03ab0ebf>;
};
sdhc@2e000 {
model = "eSDHC";
compatible = "fsl,esdhc";
- reg = <2e000 1000>;
- interrupts = <2a 8>;
+ reg = <0x2e000 0x1000>;
+ interrupts = <0x2a 0x8>;
interrupt-parent = < &ipic >;
};
@@ -196,67 +198,67 @@
interrupt-controller;
#address-cells = <0>;
#interrupt-cells = <2>;
- reg = <700 100>;
+ reg = <0x700 0x100>;
};
};
pci0: pci@e0008500 {
cell-index = <0>;
- interrupt-map-mask = <f800 0 0 7>;
+ interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
interrupt-map = <
/* IDSEL 0x11 */
- 8800 0 0 1 &ipic 14 8
- 8800 0 0 2 &ipic 15 8
- 8800 0 0 3 &ipic 16 8
- 8800 0 0 4 &ipic 17 8
+ 0x8800 0x0 0x0 0x1 &ipic 0x14 0x8
+ 0x8800 0x0 0x0 0x2 &ipic 0x15 0x8
+ 0x8800 0x0 0x0 0x3 &ipic 0x16 0x8
+ 0x8800 0x0 0x0 0x4 &ipic 0x17 0x8
/* IDSEL 0x12 */
- 9000 0 0 1 &ipic 16 8
- 9000 0 0 2 &ipic 17 8
- 9000 0 0 3 &ipic 14 8
- 9000 0 0 4 &ipic 15 8
+ 0x9000 0x0 0x0 0x1 &ipic 0x16 0x8
+ 0x9000 0x0 0x0 0x2 &ipic 0x17 0x8
+ 0x9000 0x0 0x0 0x3 &ipic 0x14 0x8
+ 0x9000 0x0 0x0 0x4 &ipic 0x15 0x8
/* IDSEL 0x13 */
- 9800 0 0 1 &ipic 17 8
- 9800 0 0 2 &ipic 14 8
- 9800 0 0 3 &ipic 15 8
- 9800 0 0 4 &ipic 16 8
+ 0x9800 0x0 0x0 0x1 &ipic 0x17 0x8
+ 0x9800 0x0 0x0 0x2 &ipic 0x14 0x8
+ 0x9800 0x0 0x0 0x3 &ipic 0x15 0x8
+ 0x9800 0x0 0x0 0x4 &ipic 0x16 0x8
/* IDSEL 0x15 */
- a800 0 0 1 &ipic 14 8
- a800 0 0 2 &ipic 15 8
- a800 0 0 3 &ipic 16 8
- a800 0 0 4 &ipic 17 8
+ 0xa800 0x0 0x0 0x1 &ipic 0x14 0x8
+ 0xa800 0x0 0x0 0x2 &ipic 0x15 0x8
+ 0xa800 0x0 0x0 0x3 &ipic 0x16 0x8
+ 0xa800 0x0 0x0 0x4 &ipic 0x17 0x8
/* IDSEL 0x16 */
- b000 0 0 1 &ipic 17 8
- b000 0 0 2 &ipic 14 8
- b000 0 0 3 &ipic 15 8
- b000 0 0 4 &ipic 16 8
+ 0xb000 0x0 0x0 0x1 &ipic 0x17 0x8
+ 0xb000 0x0 0x0 0x2 &ipic 0x14 0x8
+ 0xb000 0x0 0x0 0x3 &ipic 0x15 0x8
+ 0xb000 0x0 0x0 0x4 &ipic 0x16 0x8
/* IDSEL 0x17 */
- b800 0 0 1 &ipic 16 8
- b800 0 0 2 &ipic 17 8
- b800 0 0 3 &ipic 14 8
- b800 0 0 4 &ipic 15 8
+ 0xb800 0x0 0x0 0x1 &ipic 0x16 0x8
+ 0xb800 0x0 0x0 0x2 &ipic 0x17 0x8
+ 0xb800 0x0 0x0 0x3 &ipic 0x14 0x8
+ 0xb800 0x0 0x0 0x4 &ipic 0x15 0x8
/* IDSEL 0x18 */
- c000 0 0 1 &ipic 15 8
- c000 0 0 2 &ipic 16 8
- c000 0 0 3 &ipic 17 8
- c000 0 0 4 &ipic 14 8>;
+ 0xc000 0x0 0x0 0x1 &ipic 0x15 0x8
+ 0xc000 0x0 0x0 0x2 &ipic 0x16 0x8
+ 0xc000 0x0 0x0 0x3 &ipic 0x17 0x8
+ 0xc000 0x0 0x0 0x4 &ipic 0x14 0x8>;
interrupt-parent = < &ipic >;
- interrupts = <42 8>;
+ interrupts = <0x42 0x8>;
bus-range = <0 0>;
- ranges = <02000000 0 90000000 90000000 0 10000000
- 42000000 0 80000000 80000000 0 10000000
- 01000000 0 00000000 e0300000 0 00100000>;
+ ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
+ 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
+ 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
clock-frequency = <0>;
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
- reg = <e0008500 100>;
+ reg = <0xe0008500 0x100>;
compatible = "fsl,mpc8349-pci";
device_type = "pci";
};
diff --git a/arch/powerpc/boot/dts/mpc8379_mds.dts b/arch/powerpc/boot/dts/mpc8379_mds.dts
index 4d651a3..7510811 100644
--- a/arch/powerpc/boot/dts/mpc8379_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8379_mds.dts
@@ -9,6 +9,8 @@
* option) any later version.
*/
+/dts-v1/;
+
/ {
model = "fsl,mpc8379emds";
compatible = "fsl,mpc8379emds","fsl,mpc837xmds";
@@ -30,10 +32,10 @@
PowerPC,8379@0 {
device_type = "cpu";
reg = <0>;
- d-cache-line-size = <20>;
- i-cache-line-size = <20>;
- d-cache-size = <8000>; // L1, 32K
- i-cache-size = <8000>; // L1, 32K
+ d-cache-line-size = <0x20>;
+ i-cache-line-size = <0x20>;
+ d-cache-size = <0x8000>; // L1, 32K
+ i-cache-size = <0x8000>; // L1, 32K
timebase-frequency = <0>;
bus-frequency = <0>;
clock-frequency = <0>;
@@ -42,20 +44,20 @@
memory {
device_type = "memory";
- reg = <00000000 20000000>; // 512MB at 0
+ reg = <0x00000000 0x20000000>; // 512MB at 0
};
soc@e0000000 {
#address-cells = <1>;
#size-cells = <1>;
device_type = "soc";
- ranges = <0 e0000000 00100000>;
- reg = <e0000000 00000200>;
+ ranges = <0x0 0xe0000000 0x00100000>;
+ reg = <0xe0000000 0x00000200>;
bus-frequency = <0>;
wdt@200 {
compatible = "mpc83xx_wdt";
- reg = <200 100>;
+ reg = <0x200 0x100>;
};
i2c@3000 {
@@ -63,8 +65,8 @@
#size-cells = <0>;
cell-index = <0>;
compatible = "fsl-i2c";
- reg = <3000 100>;
- interrupts = <e 8>;
+ reg = <0x3000 0x100>;
+ interrupts = <0xe 0x8>;
interrupt-parent = < &ipic >;
dfsrr;
};
@@ -74,16 +76,16 @@
#size-cells = <0>;
cell-index = <1>;
compatible = "fsl-i2c";
- reg = <3100 100>;
- interrupts = <f 8>;
+ reg = <0x3100 0x100>;
+ interrupts = <0xf 0x8>;
interrupt-parent = < &ipic >;
dfsrr;
};
spi@7000 {
compatible = "fsl_spi";
- reg = <7000 1000>;
- interrupts = <10 8>;
+ reg = <0x7000 0x1000>;
+ interrupts = <0x10 0x8>;
interrupt-parent = < &ipic >;
mode = "cpu";
};
@@ -91,11 +93,11 @@
/* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
usb@23000 {
compatible = "fsl-usb2-dr";
- reg = <23000 1000>;
+ reg = <0x23000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
interrupt-parent = < &ipic >;
- interrupts = <26 8>;
+ interrupts = <0x26 0x8>;
phy_type = "utmi_wide";
};
@@ -103,16 +105,16 @@
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,gianfar-mdio";
- reg = <24520 20>;
+ reg = <0x24520 0x20>;
phy2: ethernet-phy@2 {
interrupt-parent = < &ipic >;
- interrupts = <11 8>;
+ interrupts = <0x11 0x8>;
reg = <2>;
device_type = "ethernet-phy";
};
phy3: ethernet-phy@3 {
interrupt-parent = < &ipic >;
- interrupts = <12 8>;
+ interrupts = <0x12 0x8>;
reg = <3>;
device_type = "ethernet-phy";
};
@@ -123,9 +125,9 @@
device_type = "network";
model = "eTSEC";
compatible = "gianfar";
- reg = <24000 1000>;
+ reg = <0x24000 0x1000>;
local-mac-address = [ 00 00 00 00 00 00 ];
- interrupts = <20 8 21 8 22 8>;
+ interrupts = <0x20 0x8 0x21 0x8 0x22 0x8>;
phy-connection-type = "mii";
interrupt-parent = < &ipic >;
phy-handle = < &phy2 >;
@@ -136,9 +138,9 @@
device_type = "network";
model = "eTSEC";
compatible = "gianfar";
- reg = <25000 1000>;
+ reg = <0x25000 0x1000>;
local-mac-address = [ 00 00 00 00 00 00 ];
- interrupts = <23 8 24 8 25 8>;
+ interrupts = <0x23 0x8 0x24 0x8 0x25 0x8>;
phy-connection-type = "mii";
interrupt-parent = < &ipic >;
phy-handle = < &phy3 >;
@@ -148,9 +150,9 @@
cell-index = <0>;
device_type = "serial";
compatible = "ns16550";
- reg = <4500 100>;
+ reg = <0x4500 0x100>;
clock-frequency = <0>;
- interrupts = <9 8>;
+ interrupts = <0x9 0x8>;
interrupt-parent = < &ipic >;
};
@@ -158,58 +160,58 @@
cell-index = <1>;
device_type = "serial";
compatible = "ns16550";
- reg = <4600 100>;
+ reg = <0x4600 0x100>;
clock-frequency = <0>;
- interrupts = <a 8>;
+ interrupts = <0xa 0x8>;
interrupt-parent = < &ipic >;
};
crypto@30000 {
model = "SEC3";
compatible = "talitos";
- reg = <30000 10000>;
- interrupts = <b 8>;
+ reg = <0x30000 0x10000>;
+ interrupts = <0xb 0x8>;
interrupt-parent = < &ipic >;
/* Rev. 3.0 geometry */
num-channels = <4>;
- channel-fifo-len = <18>;
- exec-units-mask = <000001fe>;
- descriptor-types-mask = <03ab0ebf>;
+ channel-fifo-len = <0x18>;
+ exec-units-mask = <0x000001fe>;
+ descriptor-types-mask = <0x03ab0ebf>;
};
sdhc@2e000 {
model = "eSDHC";
compatible = "fsl,esdhc";
- reg = <2e000 1000>;
- interrupts = <2a 8>;
+ reg = <0x2e000 0x1000>;
+ interrupts = <0x2a 0x8>;
interrupt-parent = < &ipic >;
};
sata@18000 {
compatible = "fsl,mpc8379-sata", "fsl,pq2pro-sata";
- reg = <18000 1000>;
- interrupts = <2c 8>;
+ reg = <0x18000 0x1000>;
+ interrupts = <0x2c 0x8>;
interrupt-parent = < &ipic >;
};
sata@19000 {
compatible = "fsl,mpc8379-sata", "fsl,pq2pro-sata";
- reg = <19000 1000>;
- interrupts = <2d 8>;
+ reg = <0x19000 0x1000>;
+ interrupts = <0x2d 0x8>;
interrupt-parent = < &ipic >;
};
sata@1a000 {
compatible = "fsl,mpc8379-sata", "fsl,pq2pro-sata";
- reg = <1a000 1000>;
- interrupts = <2e 8>;
+ reg = <0x1a000 0x1000>;
+ interrupts = <0x2e 0x8>;
interrupt-parent = < &ipic >;
};
sata@1b000 {
compatible = "fsl,mpc8379-sata", "fsl,pq2pro-sata";
- reg = <1b000 1000>;
- interrupts = <2f 8>;
+ reg = <0x1b000 0x1000>;
+ interrupts = <0x2f 0x8>;
interrupt-parent = < &ipic >;
};
@@ -224,67 +226,67 @@
interrupt-controller;
#address-cells = <0>;
#interrupt-cells = <2>;
- reg = <700 100>;
+ reg = <0x700 0x100>;
};
};
pci0: pci@e0008500 {
cell-index = <0>;
- interrupt-map-mask = <f800 0 0 7>;
+ interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
interrupt-map = <
/* IDSEL 0x11 */
- 8800 0 0 1 &ipic 14 8
- 8800 0 0 2 &ipic 15 8
- 8800 0 0 3 &ipic 16 8
- 8800 0 0 4 &ipic 17 8
+ 0x8800 0x0 0x0 0x1 &ipic 0x14 0x8
+ 0x8800 0x0 0x0 0x2 &ipic 0x15 0x8
+ 0x8800 0x0 0x0 0x3 &ipic 0x16 0x8
+ 0x8800 0x0 0x0 0x4 &ipic 0x17 0x8
/* IDSEL 0x12 */
- 9000 0 0 1 &ipic 16 8
- 9000 0 0 2 &ipic 17 8
- 9000 0 0 3 &ipic 14 8
- 9000 0 0 4 &ipic 15 8
+ 0x9000 0x0 0x0 0x1 &ipic 0x16 0x8
+ 0x9000 0x0 0x0 0x2 &ipic 0x17 0x8
+ 0x9000 0x0 0x0 0x3 &ipic 0x14 0x8
+ 0x9000 0x0 0x0 0x4 &ipic 0x15 0x8
/* IDSEL 0x13 */
- 9800 0 0 1 &ipic 17 8
- 9800 0 0 2 &ipic 14 8
- 9800 0 0 3 &ipic 15 8
- 9800 0 0 4 &ipic 16 8
+ 0x9800 0x0 0x0 0x1 &ipic 0x17 0x8
+ 0x9800 0x0 0x0 0x2 &ipic 0x14 0x8
+ 0x9800 0x0 0x0 0x3 &ipic 0x15 0x8
+ 0x9800 0x0 0x0 0x4 &ipic 0x16 0x8
/* IDSEL 0x15 */
- a800 0 0 1 &ipic 14 8
- a800 0 0 2 &ipic 15 8
- a800 0 0 3 &ipic 16 8
- a800 0 0 4 &ipic 17 8
+ 0xa800 0x0 0x0 0x1 &ipic 0x14 0x8
+ 0xa800 0x0 0x0 0x2 &ipic 0x15 0x8
+ 0xa800 0x0 0x0 0x3 &ipic 0x16 0x8
+ 0xa800 0x0 0x0 0x4 &ipic 0x17 0x8
/* IDSEL 0x16 */
- b000 0 0 1 &ipic 17 8
- b000 0 0 2 &ipic 14 8
- b000 0 0 3 &ipic 15 8
- b000 0 0 4 &ipic 16 8
+ 0xb000 0x0 0x0 0x1 &ipic 0x17 0x8
+ 0xb000 0x0 0x0 0x2 &ipic 0x14 0x8
+ 0xb000 0x0 0x0 0x3 &ipic 0x15 0x8
+ 0xb000 0x0 0x0 0x4 &ipic 0x16 0x8
/* IDSEL 0x17 */
- b800 0 0 1 &ipic 16 8
- b800 0 0 2 &ipic 17 8
- b800 0 0 3 &ipic 14 8
- b800 0 0 4 &ipic 15 8
+ 0xb800 0x0 0x0 0x1 &ipic 0x16 0x8
+ 0xb800 0x0 0x0 0x2 &ipic 0x17 0x8
+ 0xb800 0x0 0x0 0x3 &ipic 0x14 0x8
+ 0xb800 0x0 0x0 0x4 &ipic 0x15 0x8
/* IDSEL 0x18 */
- c000 0 0 1 &ipic 15 8
- c000 0 0 2 &ipic 16 8
- c000 0 0 3 &ipic 17 8
- c000 0 0 4 &ipic 14 8>;
+ 0xc000 0x0 0x0 0x1 &ipic 0x15 0x8
+ 0xc000 0x0 0x0 0x2 &ipic 0x16 0x8
+ 0xc000 0x0 0x0 0x3 &ipic 0x17 0x8
+ 0xc000 0x0 0x0 0x4 &ipic 0x14 0x8>;
interrupt-parent = < &ipic >;
- interrupts = <42 8>;
+ interrupts = <0x42 0x8>;
bus-range = <0 0>;
- ranges = <02000000 0 90000000 90000000 0 10000000
- 42000000 0 80000000 80000000 0 10000000
- 01000000 0 00000000 e0300000 0 00100000>;
+ ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
+ 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
+ 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
clock-frequency = <0>;
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
- reg = <e0008500 100>;
+ reg = <0xe0008500 0x100>;
compatible = "fsl,mpc8349-pci";
device_type = "pci";
};
--
1.5.3.5.643.g40e25
^ permalink raw reply related
* PPC4xx : Failed to perform memory to memory DMA
From: padmanabha @ 2008-01-08 10:10 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
I am using 2.6.23 kernel for ppc 440spe based board. When i tried
memory to memory DMA ( please find the code given below )
DMA is not happening.
I am trying the same for last few days.... without any success. Can any
one guide me.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include<linux/kernel.h>
#include<linux/module.h>
#include<linux/delay.h>
#include<asm/ppc4xx_dma.h>
#include<asm/io.h>
#include<linux/slab.h>
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("PPC4xx Mem to Mem DMA demo");
MODULE_AUTHOR("padmanabha@tesbv.com");
extern void flush_dcache_all(void);
#define DMA_CHANNEL_NUM 0
#define SIZE 4096
ppc_dma_ch_t ppc_dma_channel;
ppc_dma_ch_t p_init;
void * vir_dst_addr;
void * vir_src_addr;
unsigned long int phy_src;
unsigned long int phy_dst;
int ret, offset;
void dma_trns(void)
{
memset( (char *)&p_init, 0, sizeof(p_init));
p_init.polarity = 0;
p_init.pwidth = PW_8;
ret = ppc4xx_init_dma_channel( DMA_CHANNEL_NUM, &p_init);
if (ret == DMA_STATUS_GOOD)
{
printk("%s: init_dma_channel return %d, dest is
%p\n",__FUNCTION__, ret, vir_dst_addr);
}
else if(ret == DMA_STATUS_BAD_CHANNEL)
{
printk("TS2: bad channel \n");
}
flush_dcache_all();
ppc4xx_clr_dma_status( DMA_CHANNEL_NUM);
ppc4xx_set_dma_mode(DMA_CHANNEL_NUM,DMA_MODE_MM);
ppc4xx_set_src_addr( DMA_CHANNEL_NUM, (phys_addr_t) phy_src);
ppc4xx_set_dst_addr(DMA_CHANNEL_NUM, (phys_addr_t) phy_dst);
ppc4xx_set_dma_count(DMA_CHANNEL_NUM,(SIZE * 2 ));
ppc4xx_set_channel_priority(DMA_CHANNEL_NUM,PRIORITY_HIGH);
ppc4xx_enable_dma(DMA_CHANNEL_NUM);
// wait till completion of DMA
while( 1)
{
mdelay(100);
ret = 1;
ret = ppc4xx_get_dma_residue( DMA_CHANNEL_NUM);
if( ret == 0)
{
printk(" no dma operation is pending\n");
break;
}
}
ppc4xx_disable_dma( DMA_CHANNEL_NUM);
return ;
}
static int dma_test_init(void)
{
vir_src_addr = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, 1);
if( vir_src_addr == NULL )
{
printk( " Memory not allocated\n");
return 1;
}
printk("%s: virtual address for src buffer is 0x%p \n",__FUNCTION__,
(unsigned int *)vir_src_addr);
memset( (unsigned long *)vir_src_addr, 0x55, sizeof(unsigned long) *
(SIZE *2));
#if SRC_DISPLAY
ret = 0;
while(ret < 100)
{
printk( "%s: value at virtual addr 0x%p is 0x%X \n",
__FUNCTION__,( (unsigned int *)vir_src_addr + ret ),\
*( (unsigned int *)vir_src_addr + ret));
ret++;
}
#endif
vir_dst_addr = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA,1);
if( vir_dst_addr == NULL )
{
printk( " Memory not allocated\n");
free_pages( (unsigned long)vir_src_addr, 1);
return 1;
}
printk("%s: virtual address for dst buffer is 0x%p
\n",__FUNCTION__,(unsigned int *)vir_dst_addr);
memset( (unsigned long *)vir_dst_addr, 0, sizeof(unsigned long) *
(SIZE *2));
#if DST_DISPLAY
ret = 0;
while(ret < 100)
{
printk( "%s: value at virtual addr 0x%p is 0x%X \n",
__FUNCTION__,( (unsigned int *)vir_dst_addr + ret ),\
*( (unsigned int *)vir_dst_addr + ret));
ret++;
}
#endif
// phy_src = virt_to_bus(vir_src_addr);
// phy_dst = virt_to_bus(vir_dst_addr);
phy_src = iopa( (unsigned long ) vir_src_addr);
phy_dst = iopa( (unsigned long )vir_dst_addr);
dma_trns();
ret = 1;
ret = ppc4xx_get_dma_residue( DMA_CHANNEL_NUM);
if( ret == 0)
{
printk(" no dma operation is pending\n");
}
return 0;
}
void dma_test_exit(void)
{
ret = ppc4xx_get_channel_config( DMA_CHANNEL_NUM, &ppc_dma_channel);
if( ret != DMA_STATUS_GOOD )
{
printk("TS2: DMA STATUS is not good \n");
}
else
{
printk("TS2: DMA STATUS good \n");
}
ret = 0;
while(ret < 100)
{
printk( "%s: value at virtual addr 0x%p after dma is 0x%X \n",
__FUNCTION__,( (unsigned int *)vir_dst_addr + ret ), \
*( (unsigned int *)vir_dst_addr + ret)) ;
ret++;
}
mdelay(100);
free_pages( (unsigned long)vir_src_addr, 1);
free_pages( (unsigned long)vir_dst_addr, 1);
}
module_init(dma_test_init);
module_exit(dma_test_exit);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Thanks and Regards,
Padmanabha.s
^ permalink raw reply
* PPC4xx memory to memory DMA
From: padmanabha @ 2008-01-08 9:53 UTC (permalink / raw)
To: linuxppc-embedded, reynekejunk
Hi,
I am using 2.6.23 kernel for ppc 440spe based board. When i tried
memory to memory DMA ( please find the code given below )
DMA is not happening.
I am trying the same for last few days.... without any success. Can any
one guide me.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include<linux/kernel.h>
#include<linux/module.h>
#include<linux/delay.h>
#include<asm/ppc4xx_dma.h>
#include<asm/io.h>
#include<linux/slab.h>
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("PPC4xx Mem to Mem DMA demo");
MODULE_AUTHOR("padmanabha@tesbv.com");
extern void flush_dcache_all(void);
#define DMA_CHANNEL_NUM 0
#define SIZE 4096
ppc_dma_ch_t ppc_dma_channel;
ppc_dma_ch_t p_init;
void * vir_dst_addr;
void * vir_src_addr;
unsigned long int phy_src;
unsigned long int phy_dst;
int ret, offset;
void dma_trns(void)
{
memset( (char *)&p_init, 0, sizeof(p_init));
p_init.polarity = 0;
p_init.pwidth = PW_8;
ret = ppc4xx_init_dma_channel( DMA_CHANNEL_NUM, &p_init);
if (ret == DMA_STATUS_GOOD)
{
printk("%s: init_dma_channel return %d, dest is
%p\n",__FUNCTION__, ret, vir_dst_addr);
}
else if(ret == DMA_STATUS_BAD_CHANNEL)
{
printk("TS2: bad channel \n");
}
flush_dcache_all();
ppc4xx_clr_dma_status( DMA_CHANNEL_NUM);
ppc4xx_set_dma_mode(DMA_CHANNEL_NUM,DMA_MODE_MM);
ppc4xx_set_src_addr( DMA_CHANNEL_NUM, (phys_addr_t) phy_src);
ppc4xx_set_dst_addr(DMA_CHANNEL_NUM, (phys_addr_t) phy_dst);
ppc4xx_set_dma_count(DMA_CHANNEL_NUM,(SIZE * 2 ));
ppc4xx_set_channel_priority(DMA_CHANNEL_NUM,PRIORITY_HIGH);
ppc4xx_enable_dma(DMA_CHANNEL_NUM);
// wait till completion of DMA
while( 1)
{
mdelay(100);
ret = 1;
ret = ppc4xx_get_dma_residue( DMA_CHANNEL_NUM);
if( ret == 0)
{
printk(" no dma operation is pending\n");
break;
}
}
ppc4xx_disable_dma( DMA_CHANNEL_NUM);
return ;
}
static int dma_test_init(void)
{
vir_src_addr = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, 1);
if( vir_src_addr == NULL )
{
printk( " Memory not allocated\n");
return 1;
}
printk("%s: virtual address for src buffer is 0x%p \n",__FUNCTION__,
(unsigned int *)vir_src_addr);
memset( (unsigned long *)vir_src_addr, 0x55, sizeof(unsigned long) *
(SIZE *2));
#if SRC_DISPLAY
ret = 0;
while(ret < 100)
{
printk( "%s: value at virtual addr 0x%p is 0x%X \n",
__FUNCTION__,( (unsigned int *)vir_src_addr + ret ),\
*( (unsigned int *)vir_src_addr + ret));
ret++;
}
#endif
vir_dst_addr = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA,1);
if( vir_dst_addr == NULL )
{
printk( " Memory not allocated\n");
free_pages( (unsigned long)vir_src_addr, 1);
return 1;
}
printk("%s: virtual address for dst buffer is 0x%p
\n",__FUNCTION__,(unsigned int *)vir_dst_addr);
memset( (unsigned long *)vir_dst_addr, 0, sizeof(unsigned long) *
(SIZE *2));
#if DST_DISPLAY
ret = 0;
while(ret < 100)
{
printk( "%s: value at virtual addr 0x%p is 0x%X \n",
__FUNCTION__,( (unsigned int *)vir_dst_addr + ret ),\
*( (unsigned int *)vir_dst_addr + ret));
ret++;
}
#endif
// phy_src = virt_to_bus(vir_src_addr);
// phy_dst = virt_to_bus(vir_dst_addr);
phy_src = iopa( (unsigned long ) vir_src_addr);
phy_dst = iopa( (unsigned long )vir_dst_addr);
dma_trns();
ret = 1;
ret = ppc4xx_get_dma_residue( DMA_CHANNEL_NUM);
if( ret == 0)
{
printk(" no dma operation is pending\n");
}
return 0;
}
void dma_test_exit(void)
{
ret = ppc4xx_get_channel_config( DMA_CHANNEL_NUM, &ppc_dma_channel);
if( ret != DMA_STATUS_GOOD )
{
printk("TS2: DMA STATUS is not good \n");
}
else
{
printk("TS2: DMA STATUS good \n");
}
ret = 0;
while(ret < 100)
{
printk( "%s: value at virtual addr 0x%p after dma is 0x%X \n",
__FUNCTION__,( (unsigned int *)vir_dst_addr + ret ), \
*( (unsigned int *)vir_dst_addr + ret)) ;
ret++;
}
mdelay(100);
free_pages( (unsigned long)vir_src_addr, 1);
free_pages( (unsigned long)vir_dst_addr, 1);
}
module_init(dma_test_init);
module_exit(dma_test_exit);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Thanks and Regards,
Padmanabha.s
^ permalink raw reply
* Re: [PATCH 3/4] mtd: Factor out OF partition support from the NOR driver.
From: David Woodhouse @ 2008-01-08 8:10 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, linux-mtd
In-Reply-To: <20071213171552.GB4459@loki.buserror.net>
Please adjust for commit 4edaf56e0f8a6f71e3361bf74e3dc835811761e6 and
resend.
--
dwmw2
^ 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