Skip to content

Commit

Permalink
[POWERPC] QE: get rid of most device_types and model
Browse files Browse the repository at this point in the history
Now we're searching for "fsl,qe", "fsl,qe-muram", "fsl,qe-muram-data"
and "fsl,qe-ic".

Unfortunately it's still impossible to remove device_type = "qe"
from the existing device trees because older u-boots are looking for it.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
  • Loading branch information
Anton Vorontsov authored and Kumar Gala committed Jan 28, 2008
1 parent f67be81 commit a2dd70a
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 66 deletions.
11 changes: 6 additions & 5 deletions Documentation/powerpc/booting-without-of.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,7 @@ platforms are moved over to use the flattened-device-tree model.
i) Root QE device

Required properties:
- device_type : should be "qe";
- compatible : should be "fsl,qe";
- model : precise model of the QE, Can be "QE", "CPM", or "CPM2"
- reg : offset and length of the device registers.
- bus-frequency : the clock frequency for QUICC Engine.
Expand All @@ -1557,8 +1557,7 @@ platforms are moved over to use the flattened-device-tree model.
#address-cells = <1>;
#size-cells = <1>;
#interrupt-cells = <2>;
device_type = "qe";
model = "QE";
compatible = "fsl,qe";
ranges = <0 e0100000 00100000>;
reg = <e0100000 480>;
brg-frequency = <0>;
Expand Down Expand Up @@ -1781,7 +1780,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,qe-muram", "fsl,cpm-muram".
- mode : the could be "host" or "slave".
- ranges : Should be defined as specified in 1) to describe the
translation of MURAM addresses.
Expand All @@ -1791,10 +1790,12 @@ platforms are moved over to use the flattened-device-tree model.
Example:

muram@10000 {
device_type = "muram";
compatible = "fsl,qe-muram", "fsl,cpm-muram";
ranges = <0 00010000 0000c000>;

data-only@0{
compatible = "fsl,qe-muram-data",
"fsl,cpm-muram-data";
reg = <0 c000>;
};
};
Expand Down
9 changes: 5 additions & 4 deletions arch/powerpc/boot/dts/mpc832x_mds.dts
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,18 @@
#size-cells = <1>;
device_type = "qe";
compatible = "fsl,qe";
model = "QE";
ranges = <0 e0100000 00100000>;
reg = <e0100000 480>;
brg-frequency = <0>;
bus-frequency = <BCD3D80>;

muram@10000 {
device_type = "muram";
compatible = "fsl,qe-muram", "fsl,cpm-muram";
ranges = <0 00010000 00004000>;

data-only@0 {
compatible = "fsl,qe-muram-data",
"fsl,cpm-muram-data";
reg = <0 4000>;
};
};
Expand Down Expand Up @@ -320,9 +321,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>;
Expand Down
10 changes: 6 additions & 4 deletions arch/powerpc/boot/dts/mpc832x_rdb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,19 @@
#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,qe-muram", "fsl,cpm-muram";
ranges = <0 00010000 00004000>;

data-only@0 {
compatible = "fsl,qe-muram-data",
"fsl,cpm-muram-data";
reg = <0 4000>;
};
};
Expand Down Expand Up @@ -252,9 +254,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>;
Expand Down
10 changes: 6 additions & 4 deletions arch/powerpc/boot/dts/mpc836x_mds.dts
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,19 @@
#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,qe-muram", "fsl,cpm-muram";
ranges = <0 00010000 0000c000>;

data-only@0{
compatible = "fsl,qe-muram-data",
"fsl,cpm-muram-data";
reg = <0 c000>;
};
};
Expand Down Expand Up @@ -303,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>;
Expand Down
10 changes: 6 additions & 4 deletions arch/powerpc/boot/dts/mpc8568mds.dts
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,19 @@
#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,qe-muram", "fsl,cpm-muram";
ranges = <0 00010000 0000c000>;

data-only@0{
compatible = "fsl,qe-muram-data",
"fsl,cpm-muram-data";
reg = <0 c000>;
};
};
Expand Down Expand Up @@ -385,9 +387,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>;
Expand Down
11 changes: 7 additions & 4 deletions arch/powerpc/platforms/83xx/mpc832x_mds.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ static struct of_device_id mpc832x_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
{ .type = "qe", },
{ .compatible = "fsl,qe", },
{},
};

Expand Down Expand Up @@ -134,10 +135,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 */
Expand Down
11 changes: 7 additions & 4 deletions arch/powerpc/platforms/83xx/mpc832x_rdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ static struct of_device_id mpc832x_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
{ .type = "qe", },
{ .compatible = "fsl,qe", },
{},
};

Expand Down Expand Up @@ -145,10 +146,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 */
Expand Down
11 changes: 7 additions & 4 deletions arch/powerpc/platforms/83xx/mpc836x_mds.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ static struct of_device_id mpc836x_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
{ .type = "qe", },
{ .compatible = "fsl,qe", },
{},
};

Expand Down Expand Up @@ -165,10 +166,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 */
Expand Down
32 changes: 19 additions & 13 deletions arch/powerpc/platforms/85xx/mpc85xx_mds.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,25 @@ static void __init mpc85xx_mds_setup_arch(void)
#endif

#ifdef CONFIG_QUICC_ENGINE
if ((np = of_find_node_by_name(NULL, "qe")) != NULL) {
qe_reset();
of_node_put(np);
np = of_find_compatible_node(NULL, NULL, "fsl,qe");
if (!np) {
np = of_find_node_by_name(NULL, "qe");
if (!np)
return;
}

if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
struct device_node *ucc = NULL;
qe_reset();
of_node_put(np);

np = of_find_node_by_name(NULL, "par_io");
if (np) {
struct device_node *ucc;

par_io_init(np);
of_node_put(np);

for ( ;(ucc = of_find_node_by_name(ucc, "ucc")) != NULL;)
for_each_node_by_name(ucc, "ucc")
par_io_of_config(ucc);

of_node_put(ucc);
}

if (bcsr_regs) {
Expand All @@ -131,14 +135,14 @@ static void __init mpc85xx_mds_setup_arch(void)

iounmap(bcsr_regs);
}

#endif /* CONFIG_QUICC_ENGINE */
}

static struct of_device_id mpc85xx_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
{ .type = "qe", },
{ .compatible = "fsl,qe", },
{},
};

Expand Down Expand Up @@ -176,10 +180,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 */
Expand Down
5 changes: 4 additions & 1 deletion arch/powerpc/sysdev/fsl_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,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");

Expand Down
Loading

0 comments on commit a2dd70a

Please sign in to comment.