Skip to contentSkip to conversation

Porting RapidIO driver from ppc to powerpc architecture and adding memory mapped RapidIO driver.

PATCH Superseded Zhang Wei 4 participants 16 messages Jun 12, 2007 – Jun 18, 2007

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Zhang Wei

author
#0 lore raw

cover Porting RapidIO driver from ppc to powerpc architecture and adding memory mapped RapidIO driver.

Hi, Matt Porter,

These patches are used for supporting RapidIO controllers of Freescale. I ported them from ppc architecture to powerpc architecture and added some new features, such as memory mapped driver.

[PATCH 1/5] Add the explanation and sample of RapidIO DTS sector to the document of booting-without-of.txt file. [PATCH 2/5] Add RapidIO sector to MPC8641HPCN board dts file.
[PATCH 3/5] Add the platform device support with RapidIO to MPC8641HPCN platform.
[PATCH 4/5] Add RapidIO support to powerpc architecture.
[PATCH 5/5] Add the memory management driver to RapidIO.

Please see below descriptions of these patches:
1. Add the RapidIO driver of-device support.
2. Add the RapidIO driver support to MPC8641HPCN board.
3. Port the RapidIO from ppc to powerpc architecture.
4. Add Memory mapped RapidIO driver.
5. Add the support to multi master ports.
6. Add a simple bitmap RapidIO space allocator driver.
7. Change the RapidIO system size of menuconfig to automatically detection.

Thanks!

Best Regards,
Zhang Wei

author
#1 lore raw

PATCH 1/5 Add the explanation and sample of RapidIO DTS sector to the document of booting-without-of.txt file.

Add the explanation and a sample of RapidIO DTS sector to the document of booting-without-of.txt file.

---
 Documentation/powerpc/booting-without-of.txt |   41 ++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)
Documentation/powerpc/booting-without-of.txt +41 -0
index b49ce16..359c899 100644
@@ -1729,6 +1729,47 @@ platforms are moved over to use the flattened-device-tree model.
 
    More devices will be defined as this spec matures.
 
+   k) RapidIO
+
+   Required properties:
+
+    - device_type : Should be "rapidio"
+    - compatible : Should be "fsl,rapidio-v0.0" or "fsl,rapidio-v1.0"
+      and so on. The version number is got from IP Block Revision
+      Register of RapidIO controller.
+    - #address-cells : Address representation for "rapidio" devices.
+      This field represents the number of cells needed to represent
+      the RapidIO address of the registers.  For supporting more than
+      36-bits RapidIO address, this field should be <2>.
+      See 1) above for more details on defining #address-cells.
+    - reg : Offset and length of the register set for the device
+    - ranges : Should be defined as specified in 1) to describe the
+      translation of addresses for memory mapped RapidIO memory
+      space.
+    - interrupt-parent : the phandle for the interrupt controller that
+      services interrupts for this device.
+    - interrupts : <a b> where a is the interrupt number and b is a
+      field that represents an encoding of the sense and level
+      information for the interrupt.  This should be encoded based on
+      the information in section 2) depending on the type of interrupt
+      controller you have. For this sector, interrupts order should be
+      <err_irq bell_outb_irq bell_inb_irq msg1_tx_irq msg1_rx_irq
+      msg2_tx_irq msg2_rx_irq ... msgN_tx_irq msgN_rx_irq>.
+
+  Example:
+
+	srio@c0000{
+		device_type = "rapidio";
+		compatible = "fsl,rapidio-v1.0";
+		#address-cells = <2>;
+		reg = <c0000 20000>;
+		ranges = <0 0 c0000000 20000000>;
+		interrupt-parent = <&mpic>;
+		/* err_irq bell_outb_irq bell_inb_irq msg1_tx_irq msg1_rx_irq
+						      msg2_tx_irq msg2_rx_irq */
+		interrupts = <30 2 31 2 32 2 35 2 36 2 37 2 38 2>;
+	};
+
 VII - Specifying interrupt information for devices
 ===================================================
 
Signature · 1 line
1.5.1
author
#2 lore raw

PATCH 2/5 Add RapidIO sector to MPC8641HPCN board dts file.

Add RapidIO sector to the MPC8641HPCN board dts file.

---
 arch/powerpc/boot/dts/mpc8641_hpcn.dts |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
arch/powerpc/boot/dts/mpc8641_hpcn.dts +13 -0
index 04626b1..e2ce06e 100644
@@ -329,6 +329,19 @@
 				>;
 		};
 
+		srio@c0000 {
+			device_type = "rapidio";
+			compatible = "fsl,rapidio-v1.0";
+			#address-cells = <2>;
+			reg = <c0000 20000>;
+			ranges = <0 0 c0000000 20000000>;
+			interrupt-parent = <&mpic>;
+			/* err_irq bell_outb_irq bell_inb_irq
+						msg1_tx_irq msg1_rx_irq
+						msg2_tx_irq msg2_rx_irq */
+			interrupts = <30 2 31 2 32 2 35 2 36 2 37 2 38 2>;
+		};
+
 		mpic: pic@40000 {
 			clock-frequency = <0>;
 			interrupt-controller;
Signature · 1 line
1.5.1
author
#3 lore raw

PATCH 3/5 Add the platform device support with RapidIO to MPC8641HPCN platform.

Add the platform device support with RapidIO to MPC8641HPCN platform.

---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +16 -0
index 7034bca..f0ca5b3 100644
@@ -28,6 +28,8 @@
 #include <mm/mmu_decl.h>
 #include <asm/udbg.h>
 #include <asm/i8259.h>
+#include <asm/of_device.h>
+#include <asm/of_platform.h>
 
 #include <asm/mpic.h>
 
@@ -467,3 +469,17 @@ define_machine(mpc86xx_hpcn) {
 	.calibrate_decr		= generic_calibrate_decr,
 	.progress		= udbg_progress,
 };
+
+
+static struct of_device_id mpc86xx_of_ids[] = {
+	{ .type = "soc", },
+	{ .type = "rapidio", },
+	{},
+};
+
+static __init int mpc86xx_of_device_init(void)
+{
+	return of_platform_bus_probe(NULL, mpc86xx_of_ids, NULL);
+}
+
+device_initcall(mpc86xx_of_device_init);
Signature · 1 line
1.5.1
author
#4 lore raw

PATCH 4/5 Add RapidIO support to powerpc architecture.

This patch adds the RapidIO support to the powerpc architecture.
Some files are moved from ppc. OF-tree and OF-device support are added. New silicons such as MPC8548, MPC8641 with serial RapidIO controller are all supported. Memory driver hardware operations are added.
Global mport variables are changed to master port private variables. Multi master ports are supported.

---
 arch/powerpc/Kconfig          |    8 +
 arch/powerpc/kernel/Makefile  |    1 +
 arch/powerpc/kernel/rio.c     |   64 ++
 arch/powerpc/sysdev/Makefile  |    1 +
 arch/powerpc/sysdev/fsl_rio.c | 1446 +++++++++++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/fsl_rio.h |   20 +
 6 files changed, 1540 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/kernel/rio.c
 create mode 100644 arch/powerpc/sysdev/fsl_rio.c
 create mode 100644 arch/powerpc/sysdev/fsl_rio.h
arch/powerpc/Kconfig +8 -0
index e683668..a41aaac 100644
@@ -742,6 +742,14 @@ source "drivers/pci/Kconfig"
 
 source "drivers/pcmcia/Kconfig"
 
+config RAPIDIO
+	bool "RapidIO support" if MPC8540 || MPC8560 || MPC8641 || MPC8548
+	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/kernel/Makefile +1 -0
index 3e779f0..9ed2367 100644
@@ -69,6 +69,7 @@ pci64-$(CONFIG_PPC64)		+= pci_64.o pci_dn.o
 pci32-$(CONFIG_PPC32)		:= pci_32.o
 obj-$(CONFIG_PCI)		+= $(pci64-y) $(pci32-y)
 obj-$(CONFIG_PCI_MSI)		+= msi.o
+obj-$(CONFIG_RAPIDIO)		+= rio.o
 kexec-$(CONFIG_PPC64)		:= machine_kexec_64.o
 kexec-$(CONFIG_PPC32)		:= machine_kexec_32.o
 obj-$(CONFIG_KEXEC)		+= machine_kexec.o crash.o $(kexec-y)
arch/powerpc/kernel/rio.c new file +64 -0

64 lines not on this page · raw message

arch/powerpc/sysdev/Makefile +1 -0
index c3ce0bd..5d6d66b 100644
@@ -14,6 +14,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_PCIE)		+= fsl_pcie.o
+obj-$(CONFIG_RAPIDIO)		+= fsl_rio.o
 obj-$(CONFIG_TSI108_BRIDGE)	+= tsi108_pci.o tsi108_dev.o
 obj-$(CONFIG_QUICC_ENGINE)	+= qe_lib/
 mv64x60-$(CONFIG_PCI)		+= mv64x60_pci.o
arch/powerpc/sysdev/fsl_rio.c new file +1446 -0

1,446 lines not on this page · raw message

arch/powerpc/sysdev/fsl_rio.h new file +20 -0
new file mode 100644
index 0000000..cb3f36a
@@ -0,0 +1,20 @@
+/*
+ * Freescale PowerPC RapidIO definitions
+ *
+ * Copyright (C) 2007 Freescale Simconductor, Inc. All rights reserved.
+ * Zhang Wei <[email protected]>
+ *
+ * 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.
+ */
+
+#ifndef __POWERPC_SYSDEV_FSL_RIO_H
+#define __POWERPC_SYSDEV_FSL_RIO_H
+
+#include <linux/init.h>
+
+extern int fsl_rio_setup(struct of_device *of_dev);
+
+#endif				/* __POWERPC_SYSDEV_FSL_RIO_H */
Signature · 1 line
1.5.1
#5 lore raw

Re: [PATCH 2/5] Add RapidIO sector to MPC8641HPCN board dts file.

In reply to Zhang Wei
Quoted 12 lines · Zhang Wei

Add RapidIO sector to the MPC8641HPCN board dts file.

---
 arch/powerpc/boot/dts/mpc8641_hpcn.dts |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
arch/powerpc/boot/dts/mpc8641_hpcn.dts +0 -0
index 04626b1..e2ce06e 100644

arch/powerpc/boot/dts/mpc8641_hpcn.dts line 337

Quoted 9 lines
arch/powerpc/boot/dts/mpc8641_hpcn.dts +6 -0
@@ -329,6 +329,19 @@
 				>;
 		};
 
+		srio@c0000 {
+			device_type = "rapidio";
+			compatible = "fsl,rapidio-v1.0";
+			#address-cells = <2>;
+			reg = <c0000 20000>;
+			ranges = <0 0 c0000000 20000000>;

Don't understand the range setup... The code uses c0000000 as the start and 20000000 as the size for the rapidio law. So whats the 0 0 for? At first I thought address-cells 2 means that the range numbers are pairs expressing 64-bit numbers, eg start 0 0, size c0000000 20000000 but thats not right...

Sorry if I'm asking stupid questions....

And thanks for the patch, just what I need.

BTW do you have any notes/documentation on the space allocation routines intended use. I'm trying to work it out but I don't see any actual users of it yet... I need something like it for my distributed DMA driver, hence the interest.

Cheers
Phil

Quoted 10 lines
arch/powerpc/boot/dts/mpc8641_hpcn.dts +7 -0
+			interrupt-parent = <&mpic>;
+			/* err_irq bell_outb_irq bell_inb_irq
+						msg1_tx_irq msg1_rx_irq
+						msg2_tx_irq msg2_rx_irq */
+			interrupts = <30 2 31 2 32 2 35 2 36 2 37 2 38 2>;
+		};
+
 		mpic: pic@40000 {
 			clock-frequency = <0>;
 			interrupt-controller;
#6 lore raw

RE: [PATCH 2/5] Add RapidIO sector to MPC8641HPCN board dts file.

Hi, Phil,

Quoted 11 lines

Review

Quoted 11 lines

+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts

(quoted diff) +0 -0
@@ -329,6 +329,19 @@
 				>;
 		};

=20

(quoted diff) +6 -0
+		srio@c0000 {
+			device_type =3D "rapidio";
+			compatible =3D "fsl,rapidio-v1.0";
+			#address-cells =3D <2>;
+			reg =3D <c0000 20000>;
+			ranges =3D <0 0 c0000000 20000000>;
Quoted 8 lines

=20
Don't understand the range setup... The code uses c0000000 as=20 the start
and 20000000 as the size for the rapidio law. So whats the 0 0 for?=20 At first I thought address-cells 2 means that the range numbers are pairs expressing 64-bit numbers, eg start 0 0, size c0000000 20000000 but thats not right...
=20

RapidIO address width is 34bits, so we use <2> for #address-cells. "0 0" is the RapidIO bus address, since the #address-cells is 2, it's double zero. "c0000000" is the parent bus address, which is memory address. "20000000" is the size.
So, they means mapping the address of memory 0xc0000000 to RapidIO bus address 0x0 and the size is 0x20000000.

Quoted 10 lines

Sorry if I'm asking stupid questions....
=20
And thanks for the patch, just what I need.
=20
BTW do you have any notes/documentation on the space=20 allocation routines
intended use. I'm trying to work it out but I don't see any=20 actual users
of it yet... I need something like it for my distributed DMA driver, hence the interest.

Sorry, there is no documentation now. But I'll post an example for using them.

Quoted 19 lines

=20
Cheers
Phil
=20

arch/powerpc/boot/dts/mpc8641_hpcn.dts

Quoted 4 lines
arch/powerpc/boot/dts/mpc8641_hpcn.dts +4 -0
+			interrupt-parent =3D <&mpic>;
+			/* err_irq bell_outb_irq bell_inb_irq
+						msg1_tx_irq msg1_rx_irq
+						msg2_tx_irq=20

msg2_rx_irq */

Review

Quoted 1 line
(quoted diff) +1 -0
+			interrupts =3D <30 2 31 2 32 2 35 2 36 2=20

37 2 38 2>;

arch/powerpc/boot/dts/mpc8641_hpcn.dts line 347

Quoted 5 lines
arch/powerpc/boot/dts/mpc8641_hpcn.dts +2 -0
+		};
+
 		mpic: pic@40000 {
 			clock-frequency =3D <0>;
 			interrupt-controller;

=20
=20
=20

#7 lore raw

Re: [PATCH 1/5] Add the explanation and sample of RapidIO DTS sector to the document of booting-without-of.txt file.

In reply to Zhang Wei

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1736

Quoted 5 lines
Documentation/powerpc/booting-without-of.txt +5 -0
+   k) RapidIO
+
+   Required properties:
+
+    - device_type : Should be "rapidio"

There is no OF binding, so no.

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1739

Quoted 3 lines
Documentation/powerpc/booting-without-of.txt +3 -0
+    - compatible : Should be "fsl,rapidio-v0.0" or "fsl,rapidio-v1.0"
+      and so on. The version number is got from IP Block Revision
+      Register of RapidIO controller.

It's better to use real device names, just like everyone else.

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1743

Quoted 4 lines
Documentation/powerpc/booting-without-of.txt +4 -0
+    - #address-cells : Address representation for "rapidio" devices.
+      This field represents the number of cells needed to represent
+      the RapidIO address of the registers.  For supporting more than
+      36-bits RapidIO address, this field should be <2>.

More than 32 bit?

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1750

Quoted 2 lines
Documentation/powerpc/booting-without-of.txt +2 -0
+    - interrupt-parent : the phandle for the interrupt controller that
+      services interrupts for this device.

Not required, depends on the interrupt tree of the system.

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model.

Quoted 3 lines
Documentation/powerpc/booting-without-of.txt +3 -0
+    - interrupts : <a b> where a is the interrupt number and b is a
+      field that represents an encoding of the sense and level
+      information for the interrupt.

No. The format of an "interrupts" entry is defined by the interrupt domain this device sits in, not by the device itself.

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1757

Quoted 3 lines

For this sector, interrupts order should be

Documentation/powerpc/booting-without-of.txt +2 -0
+      <err_irq bell_outb_irq bell_inb_irq msg1_tx_irq msg1_rx_irq
+      msg2_tx_irq msg2_rx_irq ... msgN_tx_irq msgN_rx_irq>.

That's to be defined in the binding for your specific device, not in a more generic rapidio binding.

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1764

Quoted 1 line
Documentation/powerpc/booting-without-of.txt +1 -0
+		#address-cells = <2>;

You want a #size-cells as well.

Hope this helps,

Segher

#8 lore raw

RE: [PATCH 1/5] Add the explanation and sample of RapidIO DTS sector to the document of booting-without-of.txt file.

Hi, Segher,=20

Quoted 11 lines

-----Original Message-----
Subject: Re: [PATCH 1/5] Add the explanation and sample of=20 RapidIO DTS sector to the document of booting-without-of.txt file. =20

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1736

Quoted 5 lines
Documentation/powerpc/booting-without-of.txt +5 -0
+   k) RapidIO
+
+   Required properties:
+
+    - device_type : Should be "rapidio"

=20
There is no OF binding, so no.

So, we need to define it.

Quoted 8 lines

=20

Quoted 1 line

+ - compatible : Should be "fsl,rapidio-v0.0" or=20

"fsl,rapidio-v1.0"

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1739

Quoted 2 lines
Documentation/powerpc/booting-without-of.txt +2 -0
+      and so on. The version number is got from IP Block Revision
+      Register of RapidIO controller.

=20
It's better to use real device names, just like everyone else.

Some silicons of Freescale processor are the same RapidIO controller, such as mpc8540/mpc8560 are the same (v0.0), mpc8548/mpc8641 are the same (v1.0). For v1.0 RapidIO controller, should we use mpc8548 or mpc8641? Those will make people confused. Using IP Block Revision is a clear choice.

Quoted 9 lines

=20

Quoted 1 line

+ - #address-cells : Address representation for=20

"rapidio" devices.

Review

Quoted 2 lines
(quoted diff) +2 -0
+      This field represents the number of cells needed to represent
+      the RapidIO address of the registers.  For=20

supporting more than

Quoted 1 line

+ 36-bits RapidIO address, this field should be <2>.

=20
More than 32 bit?

Yes, RapidIO bus address width is 34 bits.

Quoted 7 lines

=20

Quoted 1 line

+ - interrupt-parent : the phandle for the interrupt=20

controller that

Quoted 1 line

+ services interrupts for this device.

=20
Not required, depends on the interrupt tree of the system. =20

Quoted 8 lines

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model.

Quoted 3 lines
Documentation/powerpc/booting-without-of.txt +3 -0
+    - interrupts : <a b> where a is the interrupt number and b is a
+      field that represents an encoding of the sense and level
+      information for the interrupt.

=20
No. The format of an "interrupts" entry is defined by the interrupt domain this device sits in, not by the device itself.
=20

Do you misunderstand the meaning of 'interrupts'? These interrupts is issued from the RapidIO controller to the pic controller for tx, rx, err, doorbell and message.

Quoted 6 lines

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1757

Quoted 3 lines

For this sector, interrupts order should be

Documentation/powerpc/booting-without-of.txt +2 -0
+      <err_irq bell_outb_irq bell_inb_irq msg1_tx_irq msg1_rx_irq
+      msg2_tx_irq msg2_rx_irq ... msgN_tx_irq msgN_rx_irq>.

=20
That's to be defined in the binding for your specific device, not in a more generic rapidio binding.

These description is just for compatible=3D"fsl,rapidio-v*.*" rapidio controller.

Quoted 5 lines

=20

Review

Quoted 1 line
(quoted diff) +1 -0
+		#address-cells =3D <2>;

=20
You want a #size-cells as well.
=20

The size is not used in this sector, so no defined.

Thanks!
Wei.

#9 lore raw

Re: [PATCH 1/5] Add the explanation and sample of RapidIO DTS sector to the document of booting-without-of.txt file.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

+ - device_type : Should be "rapidio"

There is no OF binding, so no.

So, we need to define it.

If you want to. Until that has been done, don't use a "device_type". Linux won't use it, anyway.

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

+ - compatible : Should be "fsl,rapidio-v0.0" or

"fsl,rapidio-v1.0"

Quoted 2 lines
Documentation/powerpc/booting-without-of.txt +2 -0
+      and so on. The version number is got from IP Block Revision
+      Register of RapidIO controller.
Quoted 7 lines
Quoted 2 lines

It's better to use real device names, just like everyone else.

Some silicons of Freescale processor are the same RapidIO controller, such as mpc8540/mpc8560 are the same (v0.0), mpc8548/mpc8641 are the same (v1.0). For v1.0 RapidIO controller, should we use mpc8548 or mpc8641? Those will make people confused.

Not at all. On an 8641 it could be

	compatible = "fsl,mpc8641-rapidio" "fsl,mpc8548-rapidio";

which states "this is the 8641 thing and it is compatible to the 8548 thing". Perfectly clear.

Quoted 2 lines

Using IP Block Revision is a
clear choice.

I don't think so. For one thing, it describes a version of a cell design, not a version of an actual device. For another thing, if I hear "8641" I know what you're talking about (sort of, anyway), but I draw a blank stare if you say "v1.0". I'm sure I'm not the only one. Concrete names are good.

Quoted 10 lines
Quoted 8 lines
Quoted 1 line

+ - #address-cells : Address representation for

"rapidio" devices.

Review

Quoted 2 lines
(quoted diff) +2 -0
+      This field represents the number of cells needed to represent
+      the RapidIO address of the registers.  For

supporting more than

Quoted 1 line

+ 36-bits RapidIO address, this field should be <2>.

More than 32 bit?

Yes, RapidIO bus address width is 34 bits.

You said "more than 36 bit", I tried to ask if that is a typo perhaps.

Quoted 5 lines
Quoted 4 lines

No. The format of an "interrupts" entry is defined by the interrupt domain this device sits in, not by the device itself.

Do you misunderstand the meaning of 'interrupts'?

Hahaha. No, I don't misunderstand what the "interrupts" property means. Perhaps you do?

Quoted 3 lines

These interrupts is
issued from the RapidIO controller to the pic controller for tx, rx, err, doorbell and message.

But the rapidio node doesn't know or care what the interrupts are connected to, and neither should it. That's what the interrupt mapping recommended practice is for.

Quoted 9 lines
Quoted 6 lines

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1757

Quoted 3 lines

For this sector, interrupts order should be

Documentation/powerpc/booting-without-of.txt +2 -0
+      <err_irq bell_outb_irq bell_inb_irq msg1_tx_irq msg1_rx_irq
+      msg2_tx_irq msg2_rx_irq ... msgN_tx_irq msgN_rx_irq>.

That's to be defined in the binding for your specific device, not in a more generic rapidio binding.

These description is just for compatible="fsl,rapidio-v*.*" rapidio controller.

Okay, good. Please make that way more obvious then :-)

Quoted 5 lines
Quoted 3 lines

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1764

Quoted 1 line
Documentation/powerpc/booting-without-of.txt +1 -0
+		#address-cells = <2>;

You want a #size-cells as well.

The size is not used in this sector, so no defined.

The size _is_ used; in the "ranges" property in this node, for example. It is also needed to describe the "reg" for any child node of this node.

A non-existant "#size-cells" means 1, and "#address-cells" means 2, so in principle you could do without these properties; but Linux doesn't parse the tree correctly in that case (which reminds me, I have some more patches to send).

Quoted 1 line

Thanks!

My pleasure,

Segher

#10 lore raw

RE: [PATCH 1/5] Add the explanation and sample of RapidIO DTS sector to the document of booting-without-of.txt file.

Hi, Segher,=20

Quoted 9 lines

=20

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

+ - device_type : Should be "rapidio"

There is no OF binding, so no.

So, we need to define it.

=20
If you want to. Until that has been done, don't use a "device_type". Linux won't use it, anyway.

Do you have another ideas about that? Only remove it?

Quoted 32 lines

=20

Quoted 9 lines
Quoted 7 lines
Quoted 1 line

+ - compatible : Should be "fsl,rapidio-v0.0" or

"fsl,rapidio-v1.0"

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1739

Quoted 2 lines
Documentation/powerpc/booting-without-of.txt +2 -0
+      and so on. The version number is got from IP Block Revision
+      Register of RapidIO controller.

It's better to use real device names, just like everyone else.

Some silicons of Freescale processor are the same RapidIO=20

controller,

Quoted 3 lines

such as mpc8540/mpc8560 are the same (v0.0), mpc8548/mpc8641 are the same (v1.0). For v1.0 RapidIO controller, should we use mpc8548 or mpc8641? Those will make people confused.

=20
Not at all. On an 8641 it could be
=20

	compatible =3D "fsl,mpc8641-rapidio" "fsl,mpc8548-rapidio";

=20
which states "this is the 8641 thing and it is compatible to the 8548 thing". Perfectly clear.
=20

Quoted 2 lines

Using IP Block Revision is a
clear choice.

=20
I don't think so. For one thing, it describes a version of a cell design, not a version of an actual device. For another thing, if I hear "8641" I know what you're talking about (sort of, anyway), but I draw a blank stare if you say "v1.0". I'm sure I'm not the only one. Concrete names are good. =20

Quoted 1 line

From the different view ways, there are different results. Getting the

version from RapidIO IP revision register is clear to me. :)

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

+ - #address-cells : Address representation for

"rapidio" devices.

Quoted 1 line

+ This field represents the number of cells needed=20

to represent

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

+ the RapidIO address of the registers. For

supporting more than

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

+ 36-bits RapidIO address, this field should be <2>.

More than 32 bit?

Yes, RapidIO bus address width is 34 bits.

=20
You said "more than 36 bit", I tried to ask if that is a typo perhaps.

Ya, caught by you! I'll fix it in next version. :)

Quoted 10 lines

=20

Quoted 5 lines
Quoted 4 lines

No. The format of an "interrupts" entry is defined by the interrupt domain this device sits in, not by the device itself.

Do you misunderstand the meaning of 'interrupts'?

=20
Hahaha. No, I don't misunderstand what the "interrupts" property means. Perhaps you do?
=20

Quoted 8 lines
Quoted 3 lines

These interrupts is
issued from the RapidIO controller to the pic controller for tx, rx, err, doorbell and message.

=20
But the rapidio node doesn't know or care what the interrupts are connected to, and neither should it. That's what the interrupt mapping recommended practice is for.
=20

There are no rapidio device in it. Doorbell, msg are all parts of rapidio controller.
For example, 8641 rapidio controller have 2 msg unit: msg0 and msg1. They are not rapidio devices. Each msg unit has the tx_irq and rx_irq.

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1757

Quoted 3 lines

For this sector, interrupts order should be

Documentation/powerpc/booting-without-of.txt +2 -0
+      <err_irq bell_outb_irq bell_inb_irq msg1_tx_irq msg1_rx_irq
+      msg2_tx_irq msg2_rx_irq ... msgN_tx_irq msgN_rx_irq>.

That's to be defined in the binding for your specific device, not in a more generic rapidio binding.

These description is just for compatible=3D"fsl,rapidio-v*.*" =

rapidio

Quoted 9 lines
Quoted 1 line

controller.

=20
Okay, good. Please make that way more obvious then :-) =20

Quoted 5 lines
Quoted 3 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+		#address-cells =3D <2>;

You want a #size-cells as well.

The size is not used in this sector, so no defined.

Quoted 11 lines

=20
The size _is_ used; in the "ranges" property in this node, for example. It is also needed to describe the "reg" for any child node of this node.
=20
A non-existant "#size-cells" means 1, and "#address-cells" means 2, so in principle you could do without these properties; but Linux doesn't parse the tree correctly in that case (which reminds me, I have some more patches to send).
=20

Ok, I'll add it in the next version for more religious.

Thanks!
Wei.

#11 lore raw

Re: [PATCH 1/5] Add the explanation and sample of RapidIO DTS sector to the document of booting-without-of.txt file.

Quoted 10 lines
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

+ - device_type : Should be "rapidio"

There is no OF binding, so no.

So, we need to define it.

If you want to. Until that has been done, don't use a "device_type". Linux won't use it, anyway.

Do you have another ideas about that? Only remove it?

Yeah, remove it.

Quoted 10 lines
Quoted 9 lines
Quoted 2 lines

Using IP Block Revision is a
clear choice.

I don't think so. For one thing, it describes a version of a cell design, not a version of an actual device. For another thing, if I hear "8641" I know what you're talking about (sort of, anyway), but I draw a blank stare if you say "v1.0". I'm sure I'm not the only one. Concrete names are good.

Quoted 2 lines
Quoted 1 line

From the different view ways, there are different results. Getting the

version from RapidIO IP revision register is clear to me. :)

It's not in line with how all other "compatible" properties are done though.

Quoted 8 lines
Quoted 3 lines

But the rapidio node doesn't know or care what the interrupts are connected to, and neither should it. That's what the interrupt mapping recommended practice is for.

There are no rapidio device in it. Doorbell, msg are all parts of rapidio controller.
For example, 8641 rapidio controller have 2 msg unit: msg0 and msg1. They are not rapidio devices. Each msg unit has the tx_irq and rx_irq.

Ah, I think I understand what you mean now. Yes, the binding for this specific rapidio controller should define the _order_ of the interrupts in the "interrupts" property; but it cannot define the format of the single entries, that is defined by the interrupt controller node it is connected to already.

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 1 line

You want a #size-cells as well.

The size is not used in this sector, so no defined.

The size _is_ used; in the "ranges" property in this node, for example. It is also needed to describe the "reg" for any child node of this node.

Quoted 7 lines
Quoted 5 lines

A non-existant "#size-cells" means 1, and "#address-cells" means 2, so in principle you could do without these properties; but Linux doesn't parse the tree correctly in that case (which reminds me, I have some more patches to send).

Ok, I'll add it in the next version for more religious.

It's not religious; true OF believers say leave the node out if its value would be 1. It's just that Linux doesn't handle that properly yet, so you want to protect yourself :-)

Segher

#12 lore raw

Re: [PATCH 1/5] Add the explanation and sample of RapidIO DTS sector to the document of booting-without-of.txt file.

In reply to Segher Boessenkool
Quoted 11 lines
Quoted 4 lines

Some silicons of Freescale processor are the same RapidIO controller, such as mpc8540/mpc8560 are the same (v0.0), mpc8548/mpc8641 are the same (v1.0). For v1.0 RapidIO controller, should we use mpc8548 or mpc8641? Those will make people confused.

Not at all. On an 8641 it could be

	compatible = "fsl,mpc8641-rapidio" "fsl,mpc8548-rapidio";

which states "this is the 8641 thing and it is compatible to the 8548 thing". Perfectly clear.

The concern is this isn't just compatible = "..8641.." "..8548.." but something like:

"..8641.." "..8641d.." "..8548.." "..8548e.." "..8543.." "..8543e.." "..8572.." "..8572e.." "..8567.." "..8567e.." "..8568.." "..8568e.."

Quoted 8 lines
Quoted 2 lines

Using IP Block Revision is a
clear choice.

I don't think so. For one thing, it describes a version of a cell design, not a version of an actual device. For another thing, if I hear "8641" I know what you're talking about (sort of, anyway), but I draw a blank stare if you say "v1.0". I'm sure I'm not the only one. Concrete names are good.

While I agree concrete names are good, we put these 'blocks' in so many devices that using the device to match on is pointless.

I'm all for making up a name like 'Grande', 'Del', 'Janeiro'. This is effective what we did with gianfar. The name gets picked up pretty quickly by people.

- k

#13 lore raw

Re: [PATCH 1/5] Add the explanation and sample of RapidIO DTS sector to the document of booting-without-of.txt file.

Quoted 10 lines
Quoted 6 lines

Not at all. On an 8641 it could be

	compatible = "fsl,mpc8641-rapidio" "fsl,mpc8548-rapidio";

which states "this is the 8641 thing and it is compatible to the 8548 thing". Perfectly clear.

The concern is this isn't just compatible = "..8641.." "..8548.." but something like:

"..8641.." "..8641d.." "..8548.." "..8548e.." "..8543.." "..8543e.." "..8572.." "..8572e.." "..8567.." "..8567e.." "..8568.." "..8568e.."

You don't need to mention _all_ compatible devices in the "compatible" property, only the few that matter; typically the oldest one, and sometimes some intermediate device that has extra features over the original one.

It isn't useful to add "compatible" entries that no OS probes for.

Quoted 3 lines
Quoted 1 line

Concrete names are good.

While I agree concrete names are good, we put these 'blocks' in so many devices that using the device to match on is pointless.

You *definitely* should put the device name for _this_ device in there, in case it needs some special workaround.

Quoted 1 line

I'm all for making up a name like 'Grande', 'Del', 'Janeiro'. This is effective what we did with gianfar. The name gets picked up pretty quickly by people.

That can be used as the "base" name, yes.

Segher

#14 lore raw

RE: [PATCH 1/5] Add the explanation and sample of RapidIO DTS sector to the document of booting-without-of.txt file.

Hi, Kumar and Segher,=20

Quoted 10 lines
Quoted 2 lines

"..8641.." "..8641d.." "..8548.." "..8548e.." "..8543.."=20

"..8543e.."=20

Quoted 1 line

"..8572.." "..8572e.." "..8567.." "..8567e.." "..8568.." "..8568e.."

=20
You don't need to mention _all_ compatible devices in the "compatible" property, only the few that matter; typically the oldest one, and sometimes some intermediate device that has extra features over the original one. =20

The oldest one is difficult to find out sometime. Can we only set the self name in dts, such as "fsl, rapidio-8641", and add this 'compatible' property to the driver ids arrays? Such as:

static struct of_device_id of_rio_rpn_ids[] =3D {
	{ .compatible =3D "fsl, rapidio-8540",},
	{ .compatible =3D "fsl, rapidio-8560",},
	{ .compatible =3D "fsl, rapidio-8641",},
	{ .compatible =3D "fsl, rapidio-8548",},
	{},
};

How about that?

Quoted 11 lines

It isn't useful to add "compatible" entries that no OS probes for.
=20

Quoted 4 lines
Quoted 1 line

Concrete names are good.

While I agree concrete names are good, we put these 'blocks' in so=20 many devices that using the device to match on is pointless.

=20
You *definitely* should put the device name for _this_ device in there, in case it needs some special workaround. =20

Quoted 7 lines
Quoted 1 line

I'm all for making up a name like 'Grande', 'Del',=20

'Janeiro'. This is=20

Quoted 2 lines

effective what we did with gianfar. The name gets picked up pretty=20 quickly by people.

=20
That can be used as the "base" name, yes.
=20

Do you have the name list? I can change my codes according them.

How about 'Mercurary', 'Venus', 'Earth', 'Mars', 'Saturn', 'Jupiter', 'Uranus', 'Neptune',
Or 'Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo', 'Libra', 'Scorpius', 'Sagittarius', 'Capricornus', 'Aquarius', 'Pisces' ?

Thanks!
Wei.

#15 lore raw

Re: [PATCH 1/5] Add the explanation and sample of RapidIO DTS sector to the document of booting-without-of.txt file.

Quoted 8 lines
Quoted 4 lines

You don't need to mention _all_ compatible devices in the "compatible" property, only the few that matter; typically the oldest one, and sometimes some intermediate device that has extra features over the original one.

The oldest one is difficult to find out sometime. Can we only set the self name in dts, such as "fsl, rapidio-8641", and add this 'compatible' property to the driver ids arrays?

You can do that, but you typically don't need to -- the whole idea of "compatible" is to avoid this, and not need to have huge "pci id" style tables in the device drivers that need constant updating. But you _can_ do it, sure.

Quoted 11 lines

Such as:

static struct of_device_id of_rio_rpn_ids[] = {
	{ .compatible = "fsl, rapidio-8540",},
	{ .compatible = "fsl, rapidio-8560",},
	{ .compatible = "fsl, rapidio-8641",},
	{ .compatible = "fsl, rapidio-8548",},
	{},
};

How about that?

I would just put 8540 in the table and in all device trees in this case.

Quoted 11 lines
Quoted 11 lines

It isn't useful to add "compatible" entries that no OS probes for.

Quoted 4 lines
Quoted 1 line

Concrete names are good.

While I agree concrete names are good, we put these 'blocks' in so many devices that using the device to match on is pointless.

You *definitely* should put the device name for _this_ device in there, in case it needs some special workaround.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

I'm all for making up a name like 'Grande', 'Del',

'Janeiro'. This is

Quoted 2 lines

effective what we did with gianfar. The name gets picked up pretty quickly by people.

That can be used as the "base" name, yes.

Do you have the name list? I can change my codes according them.

Nope.

Quoted 4 lines

How about 'Mercurary', 'Venus', 'Earth', 'Mars', 'Saturn', 'Jupiter', 'Uranus', 'Neptune',
Or 'Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo', 'Libra', 'Scorpius', 'Sagittarius', 'Capricornus', 'Aquarius', 'Pisces' ?

I don't like making up names just for this, I don't see what good this would do. Using a pre-existing code name is fine of course, as long as it is a unique identifier, since that's all that matters.

Segher