* [PATCH 2/5] [POWERPC][NET] ucc_geth_mii and users: get rid of device_type
From: Anton Vorontsov @ 2008-01-24 15:40 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20080124151850.GA15190@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/mpc836x_rdk.dts | 3 +--
arch/powerpc/boot/dts/mpc8568mds.dts | 2 +-
drivers/net/ucc_geth_mii.c | 3 +++
6 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index e300df4..1bb75ef 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -304,8 +304,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 4d5cfd3..f6a8633 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -237,8 +237,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 9a2581b..fa98bdf 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/mpc836x_rdk.dts b/arch/powerpc/boot/dts/mpc836x_rdk.dts
index e244619..e299442 100644
--- a/arch/powerpc/boot/dts/mpc836x_rdk.dts
+++ b/arch/powerpc/boot/dts/mpc836x_rdk.dts
@@ -251,8 +251,7 @@
mdio@2120 {
#address-cells = <1>;
#size-cells = <0>;
- device_type = "mdio";
- compatible = "fsl,ucc-mdio", "ucc_geth_phy";
+ compatible = "fsl,ucc-mdio";
reg = <0x2120 0x18>;
phy1: ethernet-phy@1 {
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 04f5c6f..692d5bd 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -357,7 +357,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 3/5] [POWERPC][SPI] use brg-frequency for SPI in QE
From: Anton Vorontsov @ 2008-01-24 15:40 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20080124151850.GA15190@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 26f7d83..f4473ad 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -75,7 +75,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;
@@ -100,11 +100,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);
}
@@ -1273,22 +1283,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;
@@ -1305,7 +1323,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 4/5] [POWERPC] fsl_spi_init and users: stop using device_type = "spi"
From: Anton Vorontsov @ 2008-01-24 15:40 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20080124151850.GA15190@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/mpc836x_rdk.dts | 6 +-
arch/powerpc/boot/dts/mpc8568mds.dts | 8 +-
arch/powerpc/sysdev/fsl_soc.c | 94 ++++++++++++++++----------
11 files changed, 88 insertions(+), 68 deletions(-)
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index f9545b0..bedfdd0 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1568,8 +1568,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
@@ -1582,8 +1582,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 9bcf2c9..20a03f5 100644
--- a/arch/powerpc/boot/dts/mpc8313erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
@@ -130,8 +130,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 1bb75ef..15bb345 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -223,8 +223,8 @@
};
spi@4c0 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <4c0 40>;
interrupts = <2>;
interrupt-parent = < &qeic >;
@@ -232,8 +232,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 f6a8633..f086fac 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -184,8 +184,8 @@
};
spi@4c0 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <4c0 40>;
interrupts = <2>;
interrupt-parent = <&qeic>;
@@ -193,8 +193,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 04b8da4..4a4ddea 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 a06ff92..79983d7 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 4120e92..1736e03 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 fa98bdf..d3b8262 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -225,8 +225,8 @@
};
spi@4c0 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <4c0 40>;
interrupts = <2>;
interrupt-parent = < &qeic >;
@@ -234,8 +234,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/mpc836x_rdk.dts b/arch/powerpc/boot/dts/mpc836x_rdk.dts
index e299442..6efa5b7 100644
--- a/arch/powerpc/boot/dts/mpc836x_rdk.dts
+++ b/arch/powerpc/boot/dts/mpc836x_rdk.dts
@@ -165,9 +165,8 @@
};
spi@4c0 {
- device_type = "spi";
cell-index = <0>;
- compatible = "fsl,spi", "fsl_spi";
+ compatible = "fsl,spi";
reg = <0x4c0 0x40>;
interrupts = <2>;
interrupt-parent = <&qeic>;
@@ -175,9 +174,8 @@
};
spi@500 {
- device_type = "spi";
cell-index = <1>;
- compatible = "fsl,spi", "fsl_spi";
+ compatible = "fsl,spi";
reg = <0x500 0x40>;
interrupts = <1>;
interrupt-parent = <&qeic>;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 692d5bd..c929fba 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -302,8 +302,8 @@
};
spi@4c0 {
- device_type = "spi";
- compatible = "fsl_spi";
+ cell-index = <0>;
+ compatible = "fsl,spi";
reg = <4c0 40>;
interrupts = <2>;
interrupt-parent = <&qeic>;
@@ -311,8 +311,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 f4473ad..e75fd44 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -1276,42 +1276,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];
@@ -1330,6 +1305,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;
@@ -1340,7 +1319,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)
@@ -1367,13 +1346,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 5/5] [POWERPC] fsl_soc, legacy_serial: add support for "soc" compatible matching
From: Anton Vorontsov @ 2008-01-24 15:40 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20080124151850.GA15190@localhost.localdomain>
We'll match on "soc" compatible for generic code, and "fsl,soc"
for fsl specific code.
Unfortunately it's still impossible to remove device_type = "soc"
from the existing device tree, because older u-boots are looking for
it.
Neither we can remove model number from the soc name to heal
arch/powerpc/boot/cuboot-85xx.c, because then dts'es will be
incompatible with older u-boots again.
So, just one machine converted so far: MPC8360E-RDK. It's new machine
so we don't care about backward compatibility yet.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
I know, this patch will conflict with the legacy serial rework[1].
It's okay though, if [1] will hit galak/powerpc.git first, I'll
simply rebase that patch.
[1] http://ozlabs.org/pipermail/linuxppc-dev/2008-January/050096.html
Documentation/powerpc/booting-without-of.txt | 18 ++++------
arch/powerpc/boot/dts/mpc836x_rdk.dts | 1 -
arch/powerpc/kernel/legacy_serial.c | 3 +-
arch/powerpc/sysdev/fsl_soc.c | 51 +++++++++++++++-----------
4 files changed, 39 insertions(+), 34 deletions(-)
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index bedfdd0..a3b6e2a 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -32,7 +32,7 @@ Table of Contents
c) The /cpus/* nodes
d) the /memory node(s)
e) The /chosen node
- f) the /soc<SOCname> node
+ f) the /soc node
IV - "dtc", the device tree compiler
@@ -960,20 +960,16 @@ compatibility.
under /chosen called interrupt-controller which had a phandle value
that pointed to the main interrupt controller)
- f) the /soc<SOCname> node
+ f) the /soc node
This node is used to represent a system-on-a-chip (SOC) and must be
present if the processor is a SOC. The top-level soc node contains
- information that is global to all devices on the SOC. The node name
- should contain a unit address for the SOC, which is the base address
- of the memory-mapped register set for the SOC. The name of an soc
- node should start with "soc", and the remainder of the name should
- represent the part number for the soc. For example, the MPC8540's
- soc node would be called "soc8540".
+ information that is global to all devices on the SOC. The name of an
+ soc node should be "soc".
Required properties:
- - device_type : Should be "soc"
+ - compatible : Should be "cpu-specific-soc", "soc".
- ranges : Should be defined as specified in 1) to describe the
translation of SOC addresses for memory mapped SOC registers.
- bus-frequency: Contains the bus frequency for the SOC node.
@@ -2713,11 +2709,11 @@ Note that the #address-cells and #size-cells for the SoC node
in this example have been explicitly listed; these are likely
not necessary as they are usually the same as the root node.
- soc8540@e0000000 {
+ soc@e0000000 {
#address-cells = <1>;
#size-cells = <1>;
#interrupt-cells = <2>;
- device_type = "soc";
+ compatible = "fsl,mpc8540-soc", "fsl,soc", "soc";
ranges = <00000000 e0000000 00100000>
reg = <e0000000 00003000>;
bus-frequency = <0>;
diff --git a/arch/powerpc/boot/dts/mpc836x_rdk.dts b/arch/powerpc/boot/dts/mpc836x_rdk.dts
index 6efa5b7..ef739ee 100644
--- a/arch/powerpc/boot/dts/mpc836x_rdk.dts
+++ b/arch/powerpc/boot/dts/mpc836x_rdk.dts
@@ -58,7 +58,6 @@
soc@e0000000 {
#address-cells = <1>;
#size-cells = <1>;
- device_type = "soc";
compatible = "fsl,mpc8360-soc", "fsl,soc", "soc";
ranges = <0 0xe0000000 0x100000>;
reg = <0xe0000000 0x200>;
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 4bfff88..c99d0ae 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -309,7 +309,8 @@ void __init find_legacy_serial_ports(void)
/* First fill our array with SOC ports */
for_each_compatible_node(np, "serial", "ns16550") {
struct device_node *soc = of_get_parent(np);
- if (soc && !strcmp(soc->type, "soc")) {
+ if (soc && (!strcmp(soc->type, "soc") ||
+ of_device_is_compatible(soc, "soc"))) {
index = add_legacy_soc_port(np, np);
if (index >= 0 && np == stdout)
legacy_serial_console = index;
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index e75fd44..96851ae 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -48,27 +48,31 @@ static phys_addr_t immrbase = -1;
phys_addr_t get_immrbase(void)
{
struct device_node *soc;
+ int size;
+ u32 naddr;
+ const u32 *prop;
if (immrbase != -1)
return immrbase;
- soc = of_find_node_by_type(NULL, "soc");
- if (soc) {
- int size;
- u32 naddr;
- const u32 *prop = of_get_property(soc, "#address-cells", &size);
+ soc = of_find_compatible_node(NULL, NULL, "fsl,soc");
+ if (!soc) {
+ soc = of_find_node_by_type(NULL, "soc");
+ if (!soc)
+ return immrbase;
+ }
- if (prop && size == 4)
- naddr = *prop;
- else
- naddr = 2;
+ prop = of_get_property(soc, "#address-cells", &size);
+ if (prop && size == 4)
+ naddr = *prop;
+ else
+ naddr = 2;
- prop = of_get_property(soc, "ranges", &size);
- if (prop)
- immrbase = of_translate_address(soc, prop + naddr);
+ prop = of_get_property(soc, "ranges", &size);
+ if (prop)
+ immrbase = of_translate_address(soc, prop + naddr);
- of_node_put(soc);
- }
+ of_node_put(soc);
return immrbase;
}
@@ -528,11 +532,13 @@ static int __init mpc83xx_wdt_init(void)
goto nodev;
}
- soc = of_find_node_by_type(NULL, "soc");
-
+ soc = of_find_compatible_node(NULL, NULL, "fsl,soc");
if (!soc) {
- ret = -ENODEV;
- goto nosoc;
+ soc = of_find_node_by_type(NULL, "soc");
+ if (!soc) {
+ ret = -ENODEV;
+ goto nosoc;
+ }
}
freq = of_get_property(soc, "bus-frequency", NULL);
@@ -1373,9 +1379,12 @@ int __init fsl_spi_init(struct spi_board_info *board_infos,
const u32 *freq;
int size;
- np = of_find_node_by_type(NULL, "soc");
- if (!np)
- return -ENODEV;
+ np = of_find_compatible_node(NULL, NULL, "fsl,soc");
+ 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) {
--
1.5.2.2
^ permalink raw reply related
* Re: [PATCH] UCC TDM driver for QE based MPC83xx platforms.
From: Timur Tabi @ 2008-01-24 15:39 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Poonam_Aggrwal-b10812, michael.barkowski, netdev, kumar.gala,
linux-kernel, rubini, linuxppc-dev, ashish.kalra, rich.cutler,
akpm
In-Reply-To: <20080124171920.49d805cb.sfr@canb.auug.org.au>
Stephen Rothwell wrote:
>> + tdm_ctrl[device_num]->ut_info->uf_info.tdm_tx_clk =
>> + (char *) of_get_property(np, "fsl,tdm-tx-clk", NULL);
> ^
> We don't normall put spaces here.
Since when?
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.
From: Anton Vorontsov @ 2008-01-24 15:48 UTC (permalink / raw)
To: Poonam_Aggrwal-b10812
Cc: michael.barkowski, netdev, kumar.gala, linux-kernel, rubini,
linuxppc-dev, ashish.kalra, rich.cutler, akpm, timur
In-Reply-To: <Pine.LNX.4.64.0801241553270.4984@linux121>
Hello Poonam,
On Thu, Jan 24, 2008 at 04:00:06PM +0530, Poonam_Aggrwal-b10812 wrote:
> Thanks Stephen for your comments, incorporated them.
> From: Poonam Aggrwal <b10812@freescale.com>
>
> This patch makes necessary changes in the QE and UCC framework to support
> TDM. It also adds support to configure the BRG properly through device
> tree entries. Includes the device tree changes for UCC TDM driver as well.
> It also includes device tree entries for UCC TDM driver.
>
> Tested on MPC8323ERDB platform.
>
> Signed-off-by: Poonam Aggrwal <b10812@freescale.com>
> Signed-off-by: Ashish Kalra <ashish.kalra@freescale.com>
> Signed-off-by: Kim Phillips <Kim.Phillips@freescale.com>
> Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com>
> ---
> arch/powerpc/boot/dts/mpc832x_rdb.dts | 58 +++++++
> arch/powerpc/sysdev/qe_lib/qe.c | 184 +++++++++++++++++++++--
> arch/powerpc/sysdev/qe_lib/ucc.c | 265 +++++++++++++++++++++++++++++++++
> arch/powerpc/sysdev/qe_lib/ucc_fast.c | 37 +++++
> include/asm-powerpc/qe.h | 8 +
> include/asm-powerpc/ucc.h | 4 +
> include/asm-powerpc/ucc_fast.h | 4 +
> 7 files changed, 548 insertions(+), 12 deletions(-)
>
> diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
> index 388c8a7..c0e6283 100644
> --- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
> +++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
> @@ -105,6 +105,17 @@
> device_type = "par_io";
> num-ports = <7>;
>
> + ucc1pio:ucc_pin@01 {
> + pio-map = <
> + /* port pin dir open_drain assignment has_irq */
> + 0 e 2 0 1 0 /* CLK11 */
> + 3 16 1 0 2 0 /* BRG9 */
> + 3 1b 1 0 2 0 /* BRG3 */
> + 0 0 3 0 2 0 /* TDMATxD0 */
> + 0 4 3 0 2 0 /* TDMARxD0 */
> + 3 1b 2 0 1 0>; /* CLK1 */
> + };
> +
Can we not introduce new pio-maps in the device trees? There
were debates regarding this, and if I understood everything
correctly, pio-maps considered as a bad taste. Better
do bunch of par_io_config_pin() in the board file. Better
yet fixup the firmware (u-boot) to set up dedicated pins
correctly.
Thanks,
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH 2/5] [POWERPC][NET] ucc_geth_mii and users: get rid of device_type
From: Kumar Gala @ 2008-01-24 15:52 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linuxppc-dev list
In-Reply-To: <20080124154001.GB23246@localhost.localdomain>
On Jan 24, 2008, at 9:40 AM, Anton Vorontsov wrote:
> 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>
can we look at using "fsl,gianfar-mdio" ? Meaning my understanding
the programming model for the UCC mdio is identical to gianfar MDIO
programming.
- k
^ permalink raw reply
* Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.
From: Timur Tabi @ 2008-01-24 15:55 UTC (permalink / raw)
To: avorontsov
Cc: Poonam_Aggrwal-b10812, michael.barkowski, netdev, kumar.gala,
linux-kernel, rubini, linuxppc-dev, ashish.kalra, rich.cutler,
akpm
In-Reply-To: <20080124154804.GA22178@localhost.localdomain>
Anton Vorontsov wrote:
> Can we not introduce new pio-maps in the device trees? There
> were debates regarding this, and if I understood everything
> correctly, pio-maps considered as a bad taste. Better
> do bunch of par_io_config_pin() in the board file. Better
> yet fixup the firmware (u-boot) to set up dedicated pins
> correctly.
I'm on the fence with respect to pio-maps vs. par_io_config_pin() calls. The
problem is that the configuration of these pins is board-specific, but pins are
used by devices. A device driver can't call par_io_config_pin(), because the
calls are different depending on which SoC and which UCC you're using. The
platform code can't call par_io_config_pin(), because that configuration depends
on which drivers are loaded.
In other words, the pin configurations are dependent on the UCC configurations,
and the UCC configurations are stored in the device tree. So it makes sense to
put the pin configurations in the device tree, too.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: [PATCH 2/5] [POWERPC][NET] ucc_geth_mii and users: get rid of device_type
From: Anton Vorontsov @ 2008-01-24 16:11 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev list
In-Reply-To: <53D750AF-AC04-47F6-8537-4F17206CC279@kernel.crashing.org>
On Thu, Jan 24, 2008 at 09:52:14AM -0600, Kumar Gala wrote:
>
> On Jan 24, 2008, at 9:40 AM, Anton Vorontsov wrote:
>
> >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>
>
> can we look at using "fsl,gianfar-mdio" ? Meaning my understanding
> the programming model for the UCC mdio is identical to gianfar MDIO
> programming.
I didn't look much into gianfar mii driver, so I can't tell.
Would "fsl,ucc-mdio", "fsl,gianfar-mdio" work for us? That way
we'll match on "fsl,ucc-mdio" today, and "fsl,gianfar-mdio" when/if
drivers are merged?
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* [PATCH] IB/ehca: Prevent sending UD packets to QP0
From: Joachim Fenkes @ 2008-01-24 16:59 UTC (permalink / raw)
To: LinuxPPC-Dev, LKML, OF-General, Roland Dreier, OF-EWG
Cc: Stefan Roscher, Christoph Raisch
IB spec doesn't allow packets to QP0 sent on any other VL than VL15.
Hardware doesn't filter those packets on the send side, so we need to do
this in the driver and firmware.
As eHCA doesn't support QP0, we can just filter out all traffic going to
QP0, regardless of SL or VL.
Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---
drivers/infiniband/hw/ehca/ehca_reqs.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c
index 3aacc8c..2ce8cff 100644
--- a/drivers/infiniband/hw/ehca/ehca_reqs.c
+++ b/drivers/infiniband/hw/ehca/ehca_reqs.c
@@ -209,6 +209,10 @@ static inline int ehca_write_swqe(struct ehca_qp *qp,
ehca_gen_err("wr.ud.ah is NULL. qp=%p", qp);
return -EINVAL;
}
+ if (unlikely(send_wr->wr.ud.remote_qpn == 0)) {
+ ehca_gen_err("dest QP# is 0. qp=%x", qp->real_qp_num);
+ return -EINVAL;
+ }
my_av = container_of(send_wr->wr.ud.ah, struct ehca_av, ib_ah);
wqe_p->u.ud_av.ud_av = my_av->av;
--
1.5.2
^ permalink raw reply related
* Re: how to handle TARGET_CPM in cuboot-85xx?
From: Scott Wood @ 2008-01-24 16:23 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev list
In-Reply-To: <0802475D-30B4-4954-96D9-39522FACCDBD@kernel.crashing.org>
On Thu, Jan 24, 2008 at 08:24:42AM -0600, Kumar Gala wrote:
> diff --git a/arch/powerpc/boot/cuboot-85xx.c b/arch/powerpc/boot/
> cuboot-85xx.c
> index 6776a1a..e2616f2 100644
> --- a/arch/powerpc/boot/cuboot-85xx.c
> +++ b/arch/powerpc/boot/cuboot-85xx.c
> @@ -15,6 +15,7 @@
> #include "cuboot.h"
>
> #define TARGET_85xx
> +#define TARGET_CPM2
> #include "ppcboot.h"
>
> static bd_t bd;
>
>
> --
>
> however it varies which boards need this. Should I just duplicate
> cuboot-85xx.c into cuboot-<boardname>.c as the way to handle this
> right now?
I don't think we need to go that fine grained -- one cuboot-85xx and one
cuboot-85xx-cpm2 should suffice.
-Scott
^ permalink raw reply
* [PATCH] powerpc: reduce code duplication in legacy_serial, add UART parent types
From: Paul Gortmaker @ 2008-01-24 17:13 UTC (permalink / raw)
To: linuxppc-dev; +Cc: scottwood, Paul Gortmaker, arnd
In-Reply-To: <200801172335.48817.arnd@arndb.de>
The legacy_serial was treating each UART parent in a separate code block.
Rather than continue this trend for the new parent IDs, this condenses
all (soc, tsi, opb, plus two more new types) into one of_device_id array.
The new types are wrs,epld-localbus for the Wind River sbc8560, and a
more generic "simple-bus" as requested by Scott Wood.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/powerpc/kernel/legacy_serial.c | 45 +++++++++++++---------------------
1 files changed, 17 insertions(+), 28 deletions(-)
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 4bfff88..523a9d4 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -4,6 +4,7 @@
#include <linux/serial_core.h>
#include <linux/console.h>
#include <linux/pci.h>
+#include <linux/of_device.h>
#include <asm/io.h>
#include <asm/mmu.h>
#include <asm/prom.h>
@@ -31,6 +32,15 @@ static struct legacy_serial_info {
int irq_check_parent;
phys_addr_t taddr;
} legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS];
+
+static struct __init of_device_id parents[] = {
+ {.type = "soc",},
+ {.type = "tsi-bridge",},
+ {.type = "opb", .compatible = "ibm,opb",},
+ {.compatible = "simple-bus",},
+ {.compatible = "wrs,epld-localbus",},
+};
+
static unsigned int legacy_serial_count;
static int legacy_serial_console = -1;
@@ -306,18 +316,20 @@ void __init find_legacy_serial_ports(void)
DBG(" no linux,stdout-path !\n");
}
- /* First fill our array with SOC ports */
+ /* Iterate over all the 16550 ports, looking for known parents */
for_each_compatible_node(np, "serial", "ns16550") {
- struct device_node *soc = of_get_parent(np);
- if (soc && !strcmp(soc->type, "soc")) {
+ struct device_node *parent = of_get_parent(np);
+ if (!parent)
+ continue;
+ if (of_match_node(parents, parent) != NULL) {
index = add_legacy_soc_port(np, np);
if (index >= 0 && np == stdout)
legacy_serial_console = index;
}
- of_node_put(soc);
+ of_node_put(parent);
}
- /* First fill our array with ISA ports */
+ /* Next, fill our array with ISA ports */
for_each_node_by_type(np, "serial") {
struct device_node *isa = of_get_parent(np);
if (isa && !strcmp(isa->name, "isa")) {
@@ -328,29 +340,6 @@ void __init find_legacy_serial_ports(void)
of_node_put(isa);
}
- /* First fill our array with tsi-bridge ports */
- for_each_compatible_node(np, "serial", "ns16550") {
- struct device_node *tsi = of_get_parent(np);
- if (tsi && !strcmp(tsi->type, "tsi-bridge")) {
- index = add_legacy_soc_port(np, np);
- if (index >= 0 && np == stdout)
- legacy_serial_console = index;
- }
- of_node_put(tsi);
- }
-
- /* First fill our array with opb bus ports */
- for_each_compatible_node(np, "serial", "ns16550") {
- struct device_node *opb = of_get_parent(np);
- if (opb && (!strcmp(opb->type, "opb") ||
- of_device_is_compatible(opb, "ibm,opb"))) {
- index = add_legacy_soc_port(np, np);
- if (index >= 0 && np == stdout)
- legacy_serial_console = index;
- }
- of_node_put(opb);
- }
-
#ifdef CONFIG_PCI
/* Next, try to locate PCI ports */
for (np = NULL; (np = of_find_all_nodes(np));) {
--
1.5.0.rc1.gf4b6c
^ permalink raw reply related
* DTC 1.1.0 Release!
From: Jon Loeliger @ 2008-01-24 16:45 UTC (permalink / raw)
To: linuxppc-dev
Folks,
I have tagged and released a DTC 1.1.0.
You may find it using git here:
git://www.jdl.com/software/dtc
A tarball snap-shot is also available here:
http://www.jdl.com/software/dtc-1.1.0.tgz
Please let me know if there are problems with it!
Thanks,
jdl
^ permalink raw reply
* Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.
From: Anton Vorontsov @ 2008-01-24 16:23 UTC (permalink / raw)
To: Timur Tabi
Cc: Poonam_Aggrwal-b10812, michael.barkowski, netdev, kumar.gala,
linux-kernel, rubini, linuxppc-dev, ashish.kalra, rich.cutler,
akpm
In-Reply-To: <4798B4F3.2010101@freescale.com>
On Thu, Jan 24, 2008 at 09:55:31AM -0600, Timur Tabi wrote:
> Anton Vorontsov wrote:
>
> >Can we not introduce new pio-maps in the device trees? There
> >were debates regarding this, and if I understood everything
> >correctly, pio-maps considered as a bad taste. Better
> >do bunch of par_io_config_pin() in the board file. Better
> >yet fixup the firmware (u-boot) to set up dedicated pins
> >correctly.
>
> I'm on the fence with respect to pio-maps vs. par_io_config_pin() calls.
> The problem is that the configuration of these pins is board-specific, but
> pins are used by devices. A device driver can't call par_io_config_pin(),
> because the calls are different depending on which SoC and which UCC you're
> using. The platform code can't call par_io_config_pin(), because that
> configuration depends on which drivers are loaded.
Are you saying that TDM is sharing same pins with the other QE device,
and we can choose to use/not use some device depending on which driver
is loaded? I think this particular board and patch isn't that case.
Even if someday there will be the case when drivers are mutually
exclusive, i.e. presence of some driver should trigger pins
reconfiguration, then anyway this should be handled differently.
That is, we should not _register_ two mutually exclusive devices
in the first place, so drivers will not probe them. That's board
setup code authority, and pins configuration still should happen
there.
[ Irrelevant to UCCs and this particular case: lately I've
encountered one interesting case of Par IO usage. FHCI USB needs
switching between pin's dedicated functions and GPIO functions.
So, firstly it is using pins as dedicated, and later (at the bus
reset) driver turns them to act as GPIOs. This is still handled
without pio-map though, via gpios = <> property for that driver. ]
> In other words, the pin configurations are dependent on the UCC
> configurations, and the UCC configurations are stored in the device tree.
> So it makes sense to put the pin configurations in the device tree, too.
In that particular case UCC configuration is static, for every UCC.
So, we can set up all pins in the firmware/board file.
Please correct me if I'm wrong.
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.
From: Anton Vorontsov @ 2008-01-24 17:23 UTC (permalink / raw)
To: Timur Tabi
Cc: Poonam_Aggrwal-b10812, michael.barkowski, netdev, kumar.gala,
linux-kernel, rubini, linuxppc-dev, ashish.kalra, rich.cutler,
akpm
In-Reply-To: <4798BDEB.2010501@freescale.com>
On Thu, Jan 24, 2008 at 10:33:47AM -0600, Timur Tabi wrote:
> Anton Vorontsov wrote:
>
> >Are you saying that TDM is sharing same pins with the other QE device,
> >and we can choose to use/not use some device depending on which driver
> >is loaded?
>
> No. I'd have to closely examine the DTS, but I don't think that UCC
> devices share pins at all. But that isn't my point.
>
> >In that particular case UCC configuration is static, for every UCC.
> >So, we can set up all pins in the firmware/board file.
>
> Yes, but deciding what the UCC does might not be static. At what point do
> we declare, "UCC5 is for eth0 and eth0 only"?
>
> The advantage of putting the pin configurations in the device tree is that
> they now become configurable. I can envision a scenario where UCC5 could
> be either an Ethernet or a UART, depending on the setting of some jumpers
> on the board. That's what the QE was designed for: any UCC can do any task,
> and you can even have a UCC change its purpose while the system is running.
> So I don't want the pin configurations hard-coded into the kernel. Having
> them in the device tree gives me some flexibility.
If hardware configuration is selected at the bootup time, by jumpers
or switches, it's even easier to do it right. Without pio-map.
> For instance, I have a plan (that I keep postponing) to introduce a new
> feature in U-Boot where U-Boot can determine the settings of some board
> jumpers and modify the device tree accordingly. The instructions on how to
> modify the device tree would be embedded in the tree itself.
Why you need to modify the device tree for that? Let the U-Boot simply
setup pins for the kernel. Regarding kernel overwriting pins
configuration...
> I can't
> support this feature if the kernel calls par_io_config_pin() regardless of
> what's in the device tree.
What I've understood from the previous debates, is that ideally kernel
should not touch pins' configuration. Today we're using pio-map solely
to fix up some old firmware misconfiguration. And we can do this in the
board file still. To determine if we need to fixup the firmware or not,
we can use some device tree property instead (firmware version?).
p.s.
I'm neither for pio-map nor against. I just want some consequence
regarding this. Last thread ended with consequence that pio-map is a
bad thing to use...
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.
From: Timur Tabi @ 2008-01-24 16:33 UTC (permalink / raw)
To: avorontsov
Cc: Poonam_Aggrwal-b10812, michael.barkowski, netdev, kumar.gala,
linux-kernel, rubini, linuxppc-dev, ashish.kalra, rich.cutler,
akpm
In-Reply-To: <20080124162345.GA27359@localhost.localdomain>
Anton Vorontsov wrote:
> Are you saying that TDM is sharing same pins with the other QE device,
> and we can choose to use/not use some device depending on which driver
> is loaded?
No. I'd have to closely examine the DTS, but I don't think that UCC devices
share pins at all. But that isn't my point.
> In that particular case UCC configuration is static, for every UCC.
> So, we can set up all pins in the firmware/board file.
Yes, but deciding what the UCC does might not be static. At what point do we
declare, "UCC5 is for eth0 and eth0 only"?
The advantage of putting the pin configurations in the device tree is that they
now become configurable. I can envision a scenario where UCC5 could be either
an Ethernet or a UART, depending on the setting of some jumpers on the board.
That's what the QE was designed for: any UCC can do any task, and you can even
have a UCC change its purpose while the system is running. So I don't want the
pin configurations hard-coded into the kernel. Having them in the device tree
gives me some flexibility.
For instance, I have a plan (that I keep postponing) to introduce a new feature
in U-Boot where U-Boot can determine the settings of some board jumpers and
modify the device tree accordingly. The instructions on how to modify the
device tree would be embedded in the tree itself. I can't support this feature
if the kernel calls par_io_config_pin() regardless of what's in the device tree.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: [PATCH v5 0/5] device_type/compatible cleanups
From: Anton Vorontsov @ 2008-01-24 17:35 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20080124151850.GA15190@localhost.localdomain>
On Thu, Jan 24, 2008 at 06:18:50PM +0300, Anton Vorontsov wrote:
[..]
> Documentation/powerpc/booting-without-of.txt | 26 +--
> 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/mpc836x_rdk.dts | 10 -
> arch/powerpc/boot/dts/mpc8568mds.dts | 10 -
> arch/powerpc/sysdev/fsl_soc.c | 191 +++++++++++++++----------
> b/Documentation/powerpc/booting-without-of.txt | 11 -
> b/arch/powerpc/boot/dts/mpc8313erdb.dts | 4
> b/arch/powerpc/boot/dts/mpc832x_mds.dts | 9 -
> b/arch/powerpc/boot/dts/mpc832x_rdb.dts | 10 -
> b/arch/powerpc/boot/dts/mpc8349emitx.dts | 4
> b/arch/powerpc/boot/dts/mpc8349emitxgp.dts | 4
> b/arch/powerpc/boot/dts/mpc834x_mds.dts | 4
> b/arch/powerpc/boot/dts/mpc836x_mds.dts | 10 -
> b/arch/powerpc/boot/dts/mpc836x_rdk.dts | 1
> b/arch/powerpc/boot/dts/mpc8568mds.dts | 10 -
> b/arch/powerpc/kernel/legacy_serial.c | 3
> b/arch/powerpc/platforms/83xx/mpc832x_mds.c | 11 -
> b/arch/powerpc/platforms/83xx/mpc832x_rdb.c | 11 -
> b/arch/powerpc/platforms/83xx/mpc836x_mds.c | 11 -
> b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | 32 ++--
> b/arch/powerpc/sysdev/fsl_soc.c | 5
> b/arch/powerpc/sysdev/qe_lib/qe.c | 64 +++++---
> b/drivers/net/ucc_geth_mii.c | 4
> b/drivers/spi/spi_mpc83xx.c | 10 -
> 26 files changed, 284 insertions(+), 204 deletions(-)
Heh. `git-format-patch --stdout -5 | diffstat` doesn't work correctly.
Once I've already stumbled against this, but obviously forgot.
Here is correct diffstat summary:
Documentation/powerpc/booting-without-of.txt | 37 +++----
arch/powerpc/boot/dts/mpc8313erdb.dts | 4
arch/powerpc/boot/dts/mpc832x_mds.dts | 20 +--
arch/powerpc/boot/dts/mpc832x_rdb.dts | 21 ++-
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 | 21 ++-
arch/powerpc/boot/dts/mpc836x_rdk.dts | 11 --
arch/powerpc/boot/dts/mpc8568mds.dts | 20 ++-
arch/powerpc/kernel/legacy_serial.c | 3
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 | 32 +++---
arch/powerpc/sysdev/fsl_soc.c | 142 ++++++++++++++++++---------
arch/powerpc/sysdev/qe_lib/qe.c | 63 ++++++++---
drivers/net/ucc_geth_mii.c | 3
drivers/spi/spi_mpc83xx.c | 6 -
19 files changed, 258 insertions(+), 170 deletions(-)
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH v5 0/5] device_type/compatible cleanups
From: Jon Loeliger @ 2008-01-24 18:26 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev
In-Reply-To: <20080124173511.GA16288@localhost.localdomain>
> Heh. `git-format-patch --stdout -5 | diffstat` doesn't work correctly.
> Once I've already stumbled against this, but obviously forgot.
Might try:
git diff --stat HEAD~4
or such!
Enjoy,
jdl
^ permalink raw reply
* Re: [PATCH UCC TDM 3/3 ] Modified Documentation to explain dts entries for TDM driver
From: Scott Wood @ 2008-01-24 20:12 UTC (permalink / raw)
To: Poonam_Aggrwal-b10812
Cc: michael.barkowski, netdev, kumar.gala, linux-kernel, rubini,
linuxppc-dev, ashish.kalra, rich.cutler, akpm, timur
In-Reply-To: <Pine.LNX.4.64.0801241022070.27491@linux121>
On Thu, Jan 24, 2008 at 10:24:13AM +0530, Poonam_Aggrwal-b10812 wrote:
> + ix) Baud Rate Generator (BRG)
> +
> + Required properties:
> + - compatible : shpuld be "fsl,cpm-brg"
> + - fsl,brg-sources : define the input clock for all 16 BRGs. The input
> + clock source could be 1 to 24 for CLK1 to CLK24. Zero means that the
> + particular BRG will be driven by QE clock(BRGCLK).
Should also have a clock-frequency property to specify what BRGCLK is.
-Scott
^ permalink raw reply
* Re: [PATCH] [POWERPC] 85xx: Port STX GP3 board over from arch/ppc
From: Scott Wood @ 2008-01-24 20:19 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0801240041530.22238@blarg.am.freescale.net>
On Thu, Jan 24, 2008 at 12:43:38AM -0600, Kumar Gala wrote:
> + d-cache-size = <0x8000>; // L1, 32K
> + i-cache-size = <0x8000>; // L1, 32K
> + timebase-frequency = <0x4ead9a0>;
> + bus-frequency = <0x13ab6680>;
> + clock-frequency = <0x312c8040>;
Decimal, please.
> + soc8560@fdf00000 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + device_type = "soc";
> + ranges = <0 0xfdf00000 0x100000>;
> + reg = <0xfdf00000 0x1000>;
compatible = "fsl,mpc8560-immr", "simple-bus".
Also add "simple-bus" to the CPM node.
> + bus-frequency = <0x13ab6680>;
Decimal, please -- if it needs to exist at all.
> @@ -49,7 +57,7 @@ config MPC8540
> config MPC8560
> bool
> select CPM2
> - default y if MPC8560_ADS
> + default y if MPC8560_ADS || STX_GP3
Can we select this from 8560 boards, instead of a default y list?
> +static struct of_device_id __initdata of_bus_ids[] = {
> + { .name = "soc", },
> + { .type = "soc", },
> + { .name = "cpm", },
> + { .name = "localbus", },
> + {},
> +};
compatible = "simple-bus".
> +/*
> + * Called very early, device-tree isn't unflattened
> + */
> +static int __init stx_gp3_probe(void)
> +{
> + unsigned long root = of_get_flat_dt_root();
> +
> + return of_flat_dt_is_compatible(root, "stx,gp3-8560");
> +}
Tabs, not spaces.
-Scott
^ permalink raw reply
* Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.
From: Scott Wood @ 2008-01-24 20:24 UTC (permalink / raw)
To: Timur Tabi
Cc: Poonam_Aggrwal-b10812, michael.barkowski, netdev, kumar.gala,
linux-kernel, rubini, linuxppc-dev, ashish.kalra, rich.cutler,
akpm
In-Reply-To: <4798BDEB.2010501@freescale.com>
On Thu, Jan 24, 2008 at 10:33:47AM -0600, Timur Tabi wrote: Yes, but
> deciding what the UCC does might not be static. At what point do we
> declare, "UCC5 is for eth0 and eth0 only"?
When the board designer decides to hook eth0 up to UCC5.
If the board designer decides to hook multiple devices up to UCC5, we first
smack the board designer, and then set it up to whichever configuration has
been jumpered.
-Scott
^ permalink raw reply
* Re: [PATCH] [POWERPC] MPC8360E-RDK: device tree, board file and defconfig
From: Stephen Rothwell @ 2008-01-24 20:58 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev
In-Reply-To: <20080124132900.GA25982@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 1803 bytes --]
Hi Anton,
On Thu, 24 Jan 2008 16:29:01 +0300 Anton Vorontsov <avorontsov@ru.mvista.com> wrote:
>
> On Thu, Jan 24, 2008 at 01:22:01PM +1100, Stephen Rothwell wrote:
> > On Wed, 23 Jan 2008 23:45:07 +0300 Anton Vorontsov <avorontsov@ru.mvista.com> wrote:
> > >
> > > +++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
> > > +static int __init mpc836x_rdk_declare_of_platform_devices(void)
> > > +{
> > > + const struct of_device_id mpc836x_rdk_ids[] = {
> >
> > Please change this to static, __initdata and not const, thanks. These
> > arrays are usually defined outside a function, but that is not really a
> > problem.
>
> Pity... we don't need these _ids anywhere outside that function. But
> looking into objdump output I see the problem now.
>
> Will change this back, thanks.
>
> > > +static void __init mpc836x_rdk_setup_arch(void)
> > > +{
> > > + struct device_node *np;
> >
> > !defined(CONFIG_PCI) && !defined(CONFIG_QUICC_ENGINE) will produce a
> > warning here.
>
> Good catch, thanks.
>
> > > + if (ppc_md.progress)
> > > + ppc_md.progress("mpc836x_rdk_setup_arch()", 0);
> > > +
> > > +#ifdef CONFIG_PCI
> > > + for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
> > > + mpc83xx_add_bridge(np);
> > > +#endif
> > > +
> > > +#ifdef CONFIG_QUICC_ENGINE
> > > + qe_reset();
> > > +
> > > + np = of_find_compatible_node(NULL, NULL, "fsl,qe-pario");
> > > + if (!np) {
> > > + pr_warning("QE PIO not initialized!\n");
> > > + return;
> >
> > You need an of_node_put(np) before the return.
>
> Hm, really? I think I don't. But if you insist... :-)
Sorry, I don't know what I was thinking - of course you don't need it.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Failed to mount rootfs
From: Bizhan Gholikhamseh (bgholikh) @ 2008-01-24 21:53 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 12945 bytes --]
Hi All,
Our custom board is leveraged from MPC8541cds from freescale.
We have been running Linux 2.6.11 on it recently I have tried to boot
the system with the latest Linux 2.6.22-rc4 from PowerPC git tree.
I did ported the libfdt to our older version of the uboot and were able
to
resolve the device tree. After downloading the uImage, dtb file and
ramdisk
I use the bootm command to boot the linux, but it failes..
........................................................................
...................
driver initialized: 16 RAM disks of 4096K size 1024 blocksize
VFS: Cannot open root device "<NULL>" or unknown-block(0,0) Please
append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(0,0) Rebooting in 180 seconds..
........................................................................
...............
During boot I observeed that the "kernel Command Line:" is empty, is
this parameter should be supplied by fdt also?
I have copied the boot log and dump of the device tree below, Any help
greatly appreicate it.
Thanks,
Last Reset Type: Power On
FLASH: 8 MB
L2 cache 256KB:enabled
In: serial
Out: serial
Err: serial
Net: TSEC0.
IDE: Compact Flash: Bus 0: OK
Device 0: Model: STI Flash 7.4.0 Firm: 01.25.06 Ser#: STI
J106306241050439
Type: Hard Disk
Capacity: 245.0 MB = 0.2 GB (501760 x 512) System watchdog: is now
stopped.
=> printenv
bootcmd=setenv bootargs root=/dev/hda2 rw console=$consoledev,$baudrate
$othbootargs;setenv autostart yes;diskboot $l; nfsboot=setenv bootargs
root=/dev/nfs rw nfsroot=$serverip:$rootpath
ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostnar
bootdelay=2
baudrate=115200
loads_echo=1
rootpath=/nfsroot
hostname=unknown
loadaddr=1000000
netdev=eth0
consoledev=ttyS1
ramdiskaddr=1000000
ramdiskfile=ramdisk.UBoot
ethact=TSEC0
firstboot=no
bootargs=root=/dev/ram rw console=ttyS1,115200 fdfile=biz3.dtb
bootfile=uImage
ramboot=setenv bootargs root=/dev/ram rw console=ttyS1,115200
filesize=80000 fileaddr=100000
ipaddr=172.28.176.13
serverip=172.28.176.140
stdin=serial
stdout=serial
stderr=serial
ethaddr=00:18:18:8f:a6:ac
eth1addr=00:18:18:8f:a6:ad
eth2addr=00:18:18:8f:a6:ae
pid=CTS-CODEC-PRIM=
serial=FSJC0537522
ver_id=V01
hwver=0400
ver=U-boot 1.1.2(pq3-20050113-0) (Jan 20 2008 - 18:03:58)
Environment size: 1050/8188 bytes
=> tftp 100000 uImage
Using TSEC0 device
TFTP from server 172.28.176.140; our IP address is 172.28.176.13
Filename 'uImage'.
Load address: 0x100000
Loading:
#################################################################
###########################################################
done
Bytes transferred = 629989 (99ce5 hex)
=> tftp 2000000 ramdisk.u-boot
Using TSEC0 device
TFTP from server 172.28.176.140; our IP address is 172.28.176.13
Filename 'ramdisk.u-boot'.
Load address: 0x2000000
Loading:
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
done
Bytes transferred = 15622378 (ee60ea hex) => tftp c00000 board.dtb Using
TSEC0 device TFTP from server 172.28.176.140; our IP address is
172.28.176.13 Filename 'board.dtb'.
Load address: 0xc00000
Loading: #
done
Bytes transferred = 4273 (10b1 hex)
=> bootm 100000 2000000 c00000
## Booting image at 00100000 ...
Image Name: Linux-2.6.22-rc4-geff2ebd2-dirty
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 629925 Bytes = 615.2 kB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
>>> inside do_bootm_linux <<<<
## Loading RAMDisk Image at 02000000 ...
Image Name: MPC85xxCDS MTWKS Ramdisk
Image Type: PowerPC Linux RAMDisk Image (gzip compressed)
Data Size: 15622314 Bytes = 14.9 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Booting using flat device tree at 0xc00000
Loading Ramdisk to 1ef33000, end 1fe190aa ... OK vfpga watchdog not
supported in this CTS version. Keeping watchdog disabled System
watchdog: is now stopped.
## Transferring control to Kernel (at address 00000000) ...
Using MPC85xx CDS machine description
Memory CAM mapping: CAM0=256Mb, CAM1=256Mb, CAM2=0Mb residual: 0Mb Linux
version 2.6.22-rc4-geff2ebd2-dirty (bizhan@bizhanhost.cisco.com) (gcc
version 3.4.3) #6 Sun Jan 20 22:51:26 PST8
setup_arch: bootmem
mpc85xx_cds_setup_arch()
CDS Version = 0xff in slot 4
Found MPC85xx PCI host bridge at 0x00000000e0008000. Firmware bus
number: 0->0 Found MPC85xx PCI host bridge at 0x00000000e0009000.
Firmware bus number: 0->0
arch: exit
Zone PFN ranges:
DMA 0 -> 131072
Normal 131072 -> 131072
early_node_map[1] active PFN ranges
0: 0 -> 131072
Built 1 zonelists. Total pages: 130048
Kernel command line:
mpic: Setting up MPIC " OpenPIC " version 1.2 at e0040000, max 1 CPUs
mpic: ISU size: 4, shift: 2, mask: 3
mpic: Initializing for 60 sources
PID hash table entries: 2048 (order: 11, 8192 bytes) Dentry cache hash
table entries: 65536 (order: 6, 262144 bytes) Inode-cache hash table
entries: 32768 (order: 5, 131072 bytes)
Memory: 502528k/524288k available (1224k kernel code, 21196k reserved,
64k data, 108k bss, 116k init) Mount-cache hash table entries: 512
device-tree: Duplicate name in /, renamed to "chosen#1"
PCI: Probing PCI hardware
PCI: Cannot allocate resource region 0 of device 0000:00:16.0
PCI: Cannot allocate resource region 1 of device 0000:00:16.0
PCI: Cannot allocate resource region 0 of device 0000:00:19.0
PCI: Cannot allocate resource region 2 of device 0000:00:19.0
PCI: Cannot allocate resource region 0 of device 0001:00:15.0
PCI: Cannot allocate resource region 1 of device 0001:00:15.0
PCI: Cannot allocate resource region 2 of device 0001:00:15.0 io
scheduler noop registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing enabled
serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 26) is a 16550A....?50.0:
ttyS1 at MMIO 0xe0004600 (irq = 26) is a 16 A
] RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
VFS: Cannot open root device "<NULL>" or unknown-block(0,0) Please
append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(0,0) Rebooting in 180 seconds..
And here is the device tree:
/memreserve/ a 0;
{
model = "MPC8541CDS";
compatible = [4d 50 43 38 35 34 31 43 44 53 00 4d 50 43 38 35 78 78
43 44 53 00];
#address-cells = <1>;
#size-cells = <1>;
cpus {
#address-cells = <1>;
#size-cells = <0>;
PowerPC,8541@0 {
device_type = "cpu";
reg = <0>;
d-cache-line-size = <20>;
i-cache-line-size = <20>;
d-cache-size = <8000>;
i-cache-size = <8000>;
timebase-frequency = <1f78a40>;
bus-frequency = <fbc5200>;
clock-frequency = <1f78a400>;
32-bit;
};
};
memory {
device_type = "memory";
reg = <8>;
};
soc8541@e0000000 {
#address-cells = <1>;
#size-cells = <1>;
#interrupt-cells = <2>;
device_type = "soc";
ranges = [00 00 00 00 e0 00 00 00 00 10 00 00];
reg = <8>;
bus-frequency = <0>;
memory-controller@2000 {
compatible = "fsl,8541-memory-controller";
reg = <8>;
interrupt-parent = <1>;
interrupts = <8>;
};
l2-cache-controller@20000 {
compatible = "fsl,8541-l2-cache-controller";
reg = <8>;
cache-line-size = <20>;
cache-size = <40000>;
interrupt-parent = <1>;
interrupts = <8>;
};
i2c@3000 {
device_type = "i2c";
compatible = "fsl-i2c";
reg = <8>;
interrupts = <8>;
interrupt-parent = <1>;
dfsrr;
};
mdio@24520 {
#address-cells = <1>;
#size-cells = <0>;
device_type = "mdio";
compatible = "gianfar";
reg = <8>;
ethernet-phy@0 {
interrupt-parent = <1>;
interrupts = <8>;
reg = <0>;
device_type = "ethernet-phy";
linux,phandle = <2>;
};
ethernet-phy@1 {
interrupt-parent = <1>;
interrupts = <8>;
reg = <1>;
device_type = "ethernet-phy";
};
};
ethernet@24000 {
#address-cells = <1>;
#size-cells = <0>;
device_type = "network";
model = "TSEC";
compatible = "gianfar";
reg = <8>;
local-mac-address = [00 18 18 8f a6 ac];
interrupts = [00 00 00 0d 00 00 00 02 00 00 00 0e 00 00 00
02 00 00 00 12 00 00 00 02];
interrupt-parent = <1>;
phy-handle = <2>;
};
serial@4500 {
device_type = "serial";
compatible = "ns16550";
reg = <8>;
clock-frequency = <fbc5200>;
interrupts = <8>;
interrupt-parent = <1>;
};
serial@4600 {
device_type = "serial";
compatible = "ns16550";
reg = <8>;
clock-frequency = <fbc5200>;
interrupts = <8>;
interrupt-parent = <1>;
};
pci@8000 {
interrupt-map-mask = [00 01 f8 00 00 00 00 00 00 00 00 00 00
00 00 07];
interrupt-map = [00 00 80 00 00 00 00 00 00 00 00 00 00 00
00 04 00 00 00 01 00 00 00 30 00 00 00 01 00 0;
interrupt-parent = <1>;
interrupts = <8>;
bus-range = <8>;
ranges = [02 00 00 00 00 00 00 00 80 00 00 00 80 00 00 00 00
00 00 00 20 00 00 00 01 00 00 00 00 00 00 00;
clock-frequency = <3f940aa>;
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
reg = <8>;
compatible = "85xx";
device_type = "pci";
linux,phandle = <3>;
i8259@19000 {
clock-frequency = <0>;
interrupt-controller;
device_type = "interrupt-controller";
reg = [00 01 90 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 01];
#address-cells = <0>;
#interrupt-cells = <2>;
built-in;
compatible = "chrp,iic";
big-endian;
interrupts = <1>;
interrupt-parent = <3>;
};
};
pci@9000 {
interrupt-map-mask = [00 00 f8 00 00 00 00 00 00 00 00 00 00
00 00 07];
interrupt-map = [00 00 a8 00 00 00 00 00 00 00 00 00 00 00
00 01 00 00 00 01 00 00 00 3b 00 00 00 01 00 0;
interrupt-parent = <1>;
interrupts = <8>;
bus-range = <8>;
ranges = [02 00 00 00 00 00 00 00 a0 00 00 00 a0 00 00 00 00
00 00 00 20 00 00 00 01 00 00 00 00 00 00 00;
clock-frequency = <3f940aa>;
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
reg = <8>;
compatible = "85xx";
device_type = "pci";
};
pic@40000 {
clock-frequency = <0>;
interrupt-controller;
#address-cells = <0>;
#interrupt-cells = <2>;
reg = <8>;
built-in;
compatible = "chrp,open-pic";
device_type = "open-pic";
big-endian;
linux,phandle = <1>;
};
};
chosen {
linux,stdout-path = "/soc8541@e0000000/serial@4600";
};
chosen {
name = "chosen";
bootargs = "root=/dev/ram rw console=ttyS1,115200";
linux,platform = <600>;
linux,initrd-start = <1ef33000>;
linux,initrd-end = <1fe190aa>;
linux,stdout-path = "/soc8541@e0000000/serial@4600";
};
};
[-- Attachment #2: Type: text/html, Size: 31020 bytes --]
^ permalink raw reply
* Re: Failed to mount rootfs
From: Jochen Friedrich @ 2008-01-24 22:12 UTC (permalink / raw)
To: Bizhan Gholikhamseh (bgholikh); +Cc: linuxppc-embedded
In-Reply-To: <F795765B112E7344AF36AA911279641502D1A9F4@xmb-sjc-212.amer.cisco.com>
Hi Bizhan,
> device-tree: Duplicate name in /, renamed to "chosen#1"
> And here is the device tree:
> chosen {
> linux,stdout-path = "/soc8541@e0000000/serial@4600";
> };
> chosen {
> name = "chosen";
> bootargs = "root=/dev/ram rw console=ttyS1,115200";
> linux,platform = <600>;
> linux,initrd-start = <1ef33000>;
> linux,initrd-end = <1fe190aa>;
> linux,stdout-path = "/soc8541@e0000000/serial@4600";
> };
you can't have two chosen nodes. Linux renames the second one to chosen#1 and thus can't find the kernel arguments.
Thanks,
Jochen
^ permalink raw reply
* Re: [i2c] [PATCH] mpc i2c driver, compare to NO_IRQ instead of zero
From: Jon Smirl @ 2008-01-24 22:32 UTC (permalink / raw)
To: i2c, linuxppc-dev
In-Reply-To: <20080121200740.13800.20524.stgit@terra.home>
Ben, do you approve of this? How should error be checked for, is
<NO_IRQ right? The current code in the kernel looks to be broken
because of these checks, the ppc build is wrong and powerpc polled
mode doesn't work.
On 1/21/08, Jon Smirl <jonsmirl@gmail.com> wrote:
> Alter the mpc i2c driver to use the NO_IRQ symbol instead of the constant zero when checking for valid interrupts. NO_IRQ=-1 on ppc and NO_IRQ=0 on powerpc so the checks against zero are not correct.
>
> Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
> ---
>
> drivers/i2c/busses/i2c-mpc.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
>
> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
> index bbe787b..d20959d 100644
> --- a/drivers/i2c/busses/i2c-mpc.c
> +++ b/drivers/i2c/busses/i2c-mpc.c
> @@ -99,7 +99,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
> u32 x;
> int result = 0;
>
> - if (i2c->irq == 0)
> + if (i2c->irq == NO_IRQ)
> {
> while (!(readb(i2c->base + MPC_I2C_SR) & CSR_MIF)) {
> schedule();
> @@ -329,7 +329,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> i2c->irq = platform_get_irq(pdev, 0);
> - if (i2c->irq < 0) {
> + if (i2c->irq < NO_IRQ) {
> result = -ENXIO;
> goto fail_get_irq;
> }
> @@ -344,7 +344,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
> goto fail_map;
> }
>
> - if (i2c->irq != 0)
> + if (i2c->irq != NO_IRQ)
> if ((result = request_irq(i2c->irq, mpc_i2c_isr,
> IRQF_SHARED, "i2c-mpc", i2c)) < 0) {
> printk(KERN_ERR
> @@ -367,7 +367,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
> return result;
>
> fail_add:
> - if (i2c->irq != 0)
> + if (i2c->irq != NO_IRQ)
> free_irq(i2c->irq, i2c);
> fail_irq:
> iounmap(i2c->base);
> @@ -384,7 +384,7 @@ static int fsl_i2c_remove(struct platform_device *pdev)
> i2c_del_adapter(&i2c->adap);
> platform_set_drvdata(pdev, NULL);
>
> - if (i2c->irq != 0)
> + if (i2c->irq != NO_IRQ)
> free_irq(i2c->irq, i2c);
>
> iounmap(i2c->base);
>
>
> _______________________________________________
> i2c mailing list
> i2c@lm-sensors.org
> http://lists.lm-sensors.org/mailman/listinfo/i2c
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
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