Skip to contentSkip to conversation

(Resend part #1) Add the RapidIO support to powerpc architecture with memory mapping support.

PATCH In review Zhang Wei 2 participants 3 messages Dec 21, 2007 – Jan 4, 2008

Subsystems (2)
lore
Share & tools
lore

Zhang Wei

author
#0 lore raw

PATCH 2/3 (Resend part #1) Add the RapidIO support to powerpc architecture with memory mapping support.

The patch adds the RapidIO support to powerpc with of-device support. New Serial RapidIO of new Freescale processor, such as MPC8548, MPC8568, is also added.

---
 arch/powerpc/Kconfig                |   12 +
 arch/powerpc/platforms/85xx/Kconfig |    1 +
 arch/powerpc/platforms/86xx/Kconfig |    1 +
 arch/powerpc/sysdev/Makefile        |    1 +
 arch/powerpc/sysdev/fsl_rio.c       | 1130 ++++++++++++++++++++++++++---------
 5 files changed, 861 insertions(+), 284 deletions(-)
arch/powerpc/Kconfig +12 -0
index 18f397c..ee27b77 100644
@@ -523,6 +523,18 @@ source "drivers/pci/Kconfig"
 
 source "drivers/pcmcia/Kconfig"
 
+config FSL_RAPIDIO
+	bool
+	default n
+
+config RAPIDIO
+	bool "RapidIO support" if FSL_RAPIDIO
+	help
+	  If you say Y here, the kernel will include drivers and
+	  infrastructure code to support RapidIO interconnect devices.
+
+source "drivers/rapidio/Kconfig"
+
 source "drivers/pci/hotplug/Kconfig"
 
 endmenu
arch/powerpc/platforms/85xx/Kconfig +1 -0
index 7748a3a..09c522d 100644
@@ -56,6 +56,7 @@ config MPC85xx
 	select PPC_UDBG_16550
 	select PPC_INDIRECT_PCI if PCI
 	select MPIC
+	select FSL_RAPIDIO
 	select FSL_PCI if PCI
 	select SERIAL_8250_SHARE_IRQ if SERIAL_8250
 	default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \
arch/powerpc/platforms/86xx/Kconfig +1 -0
index 21d1135..a6a6593 100644
@@ -24,6 +24,7 @@ config MPC8641
 	select FSL_PCI if PCI
 	select PPC_UDBG_16550
 	select MPIC
+	select FSL_RAPIDIO
 	default y if MPC8641_HPCN
 
 config MPC8610
arch/powerpc/sysdev/Makefile +1 -0
index 99a77d7..073d197 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_U3_DART)		+= dart_iommu.o
 obj-$(CONFIG_MMIO_NVRAM)	+= mmio_nvram.o
 obj-$(CONFIG_FSL_SOC)		+= fsl_soc.o
 obj-$(CONFIG_FSL_PCI)		+= fsl_pci.o
+obj-$(CONFIG_FSL_RAPIDIO)	+= fsl_rio.o
 obj-$(CONFIG_TSI108_BRIDGE)	+= tsi108_pci.o tsi108_dev.o
 obj-$(CONFIG_QUICC_ENGINE)	+= qe_lib/
 obj-$(CONFIG_PPC_BESTCOMM)	+= bestcomm/
arch/powerpc/sysdev/fsl_rio.c +846 -284

1,664 lines not on this page · raw message

Signature · 1 line
1.5.2
#1 lore raw

Hi,

This is a very large patch. It may be easier to review if it could be split on some logical way, that is at all possible (I don't know either way). This is just a quick note about some more trivial things.

arch/powerpc/sysdev/fsl_rio.c static struct rio_msg_tx_ring { · line 200

Quoted 9 lines · On Fri, 21 Dec 2007 17:58:43 +0800 Zhang Wei <[email protected]> wrote:
arch/powerpc/sysdev/fsl_rio.c +8 -0
+struct rio_priv {
+	volatile void __iomem *regs_win;
+	volatile struct rio_atmu_regs __iomem *atmu_regs;
+	volatile struct rio_atmu_regs __iomem *maint_atmu_regs;
+	volatile struct rio_atmu_regs __iomem *dbell_atmu_regs;
+	volatile void __iomem *dbell_win;
+	volatile void __iomem *maint_win;
+	volatile struct rio_msg_regs __iomem *msg_regs;

Paulus has said that any pointer marked __iomem does not need to be volatile ...

arch/powerpc/sysdev/fsl_rio.c static int mpc85xx_rio_get_cmdline(char *s) · line 1219

Quoted 4 lines
arch/powerpc/sysdev/fsl_rio.c +4 -0
+static int of_cells_get(struct device_node *np, const char *str)
+{
+	struct device_node *tmp = NULL;
+	const int *var = NULL;

These initializations are unnecessary.

arch/powerpc/sysdev/fsl_rio.c static int mpc85xx_rio_get_cmdline(char *s) · line 1225

Quoted 5 lines
arch/powerpc/sysdev/fsl_rio.c +5 -0
+	var = of_get_property(np, str, NULL);
+	tmp = of_get_parent(np);
+
+	while (!var && tmp) {
+		var = (int *)of_get_property(tmp, str, NULL);

While I applaud the number of casts remove by this patch, this one is an unnecessary addition.

arch/powerpc/sysdev/fsl_rio.c static int mpc85xx_rio_get_cmdline(char *s) · line 1227

Quoted 2 lines
arch/powerpc/sysdev/fsl_rio.c +2 -0
+		of_node_put(tmp);
+		tmp = of_get_parent(np);

You should do the above two line in the opposite order. Also do you really want to keep getting the parent of the same node over and over (i.e. you never change np)?

Review

Quoted 1 line
(quoted diff) +1 -0
+	}

You probably want a final of_node_put(tmp).

arch/powerpc/sysdev/fsl_rio.c static int mpc85xx_rio_get_cmdline(char *s) · line 1306

Quoted 7 lines
arch/powerpc/sysdev/fsl_rio.c +7 -0
+	INFO("Phy type: ");
+	switch (phy_type) {
+	case RIO_PHY_SERIAL:
+		printk("serial\n");
+		break;
+	case RIO_PHY_PARALLEL:
+		printk("parallel");

Missing \n

arch/powerpc/sysdev/fsl_rio.c static int mpc85xx_rio_get_cmdline(char *s) · line 1359

Quoted 8 lines
arch/powerpc/sysdev/fsl_rio.c +6 -0
+	port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL);
+	if (!port) {
+		ERR("Can't alloc memory for 'port'\n");
+		rc = -ENOMEM;
+		goto err;
+	}
 	port->id = 0;
 	port->index = 0;

These two could go as you just allocated zeroed memory.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
author
#2 lore raw

RE: [PATCH 2/3] (Resend part #1) Add the RapidIO support to powerpcarchitecture with memory mapping support.

Hi, =20

Thanks!

Maybe I should make a clean and split them into small patches.

Cheers!
Wei.

Quoted 77 lines

Hi,
=20
This is a very large patch. It may be easier to review if it could be split on some logical way, that is at all possible (I don't=20 know either
way). This is just a quick note about some more trivial things. =20

arch/powerpc/sysdev/fsl_rio.c static struct rio_msg_tx_ring { · line 200

Quoted 9 lines · On Fri, 21 Dec 2007 17:58:43 +0800 Zhang Wei=20 <[email protected]> wrote:
arch/powerpc/sysdev/fsl_rio.c +8 -0
+struct rio_priv {
+	volatile void __iomem *regs_win;
+	volatile struct rio_atmu_regs __iomem *atmu_regs;
+	volatile struct rio_atmu_regs __iomem *maint_atmu_regs;
+	volatile struct rio_atmu_regs __iomem *dbell_atmu_regs;
+	volatile void __iomem *dbell_win;
+	volatile void __iomem *maint_win;
+	volatile struct rio_msg_regs __iomem *msg_regs;

=20
Paulus has said that any pointer marked __iomem does not need to be volatile ...
=20

arch/powerpc/sysdev/fsl_rio.c static int mpc85xx_rio_get_cmdline(char *s)

Quoted 4 lines
arch/powerpc/sysdev/fsl_rio.c +4 -0
+static int of_cells_get(struct device_node *np, const char *str)
+{
+	struct device_node *tmp =3D NULL;
+	const int *var =3D NULL;

=20
These initializations are unnecessary.
=20

Review

Quoted 5 lines
(quoted diff) +5 -0
+	var =3D of_get_property(np, str, NULL);
+	tmp =3D of_get_parent(np);
+
+	while (!var && tmp) {
+		var =3D (int *)of_get_property(tmp, str, NULL);

=20
While I applaud the number of casts remove by this patch,=20 this one is an
unnecessary addition.
=20

Review

Quoted 2 lines
(quoted diff) +2 -0
+		of_node_put(tmp);
+		tmp =3D of_get_parent(np);

=20
You should do the above two line in the opposite order. Also do you really want to keep getting the parent of the same node over and over (i.e. you never change np)?
=20

Review

Quoted 1 line
(quoted diff) +1 -0
+	}

=20
You probably want a final of_node_put(tmp).
=20
=20

arch/powerpc/sysdev/fsl_rio.c static int mpc85xx_rio_get_cmdline(char *s) · line 1306

Quoted 7 lines
arch/powerpc/sysdev/fsl_rio.c +7 -0
+	INFO("Phy type: ");
+	switch (phy_type) {
+	case RIO_PHY_SERIAL:
+		printk("serial\n");
+		break;
+	case RIO_PHY_PARALLEL:
+		printk("parallel");

=20
Missing \n
=20

arch/powerpc/sysdev/fsl_rio.c static int mpc85xx_rio_get_cmdline(char *s)

Quoted 8 lines
arch/powerpc/sysdev/fsl_rio.c +6 -0
+	port =3D kzalloc(sizeof(struct rio_mport), GFP_KERNEL);
+	if (!port) {
+		ERR("Can't alloc memory for 'port'\n");
+		rc =3D -ENOMEM;
+		goto err;
+	}
 	port->id =3D 0;
 	port->index =3D 0;

=20
These two could go as you just allocated zeroed memory. =20
--=20
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/
=20