booting-without-of for Freescale MSI
Subsystems (2)
PATCH v2 1/4 booting-without-of for Freescale MSI
Binding document adding for Freescale MSI support.
---
Updated to V2 version per Segher's suggestion.
Documentation/powerpc/booting-without-of.txt | 40 +++++++++++++++++++++++++- 1 files changed, 39 insertions(+), 1 deletions(-)
Documentation/powerpc/booting-without-of.txt +39 -1
@@ -57,7 +57,10 @@ Table of Contents n) 4xx/Axon EMAC ethernet nodes o) Xilinx IP cores p) Freescale Synchronous Serial Interface - q) USB EHCI controllers + q) USB EHCI controllers + r) Freescale Display Interface Unit + s) Freescale on board FPGA + t) Freescael MSI interrupt controller VII - Marvell Discovery mv64[345]6x System Controller chips 1) The /system-controller node
@@ -2870,6 +2873,41 @@ platforms are moved over to use the flattened-device-tree model. reg = <0xe8000000 32>; }; + t) Freescale MSI interrupt controller + + Reguired properities: + - compatible : set as "fsl,86xx-MSI" for 86xx cpu, "fsl,85xx-MSI" for 85xx + cpu and "fsl,83xx-MSI" for 83xx cpu. + - reg : should contain the address and the length of the shared message + interrupt register set. + - msi-available-ranges: use <start count> style section to define which + msi interrupt can be used in the 256 msi interrupts. + - interrupts : each one of the interrupts here is one entry per 32 MSIs, + and routed to the host interrupt controller. the interrupts should + be set as edge sensitive. + - interrupt-parent: the phandle for the interrupt controller + that services interrupts for this device. for 83xx cpu, the interrupts + are routed to IPIC, and for 85xx/86xx cpu the interrupts are routed + to MPIC. + + Example (86xx CPU) + msi@41600 { + compatible = "fsl,86xx-MSI"; + reg = <0x41600 0x80>; + msi-available-ranges = <0 0x100>; + interrupts = < + 0xb0 0 + 0xb1 0 + 0xb2 0 + 0xb3 0 + 0xb4 0 + 0xb5 0 + 0xb6 0 + 0xb7 0>; + interrupt-parent = <&mpic>; + }; + + VII - Marvell Discovery mv64[345]6x System Controller chips ===========================================================
Signature · 1 line
1.5.4
PATCH v4 2/4 MSI support on 83xx/85xx/86xx board
This MSI driver can be used on 83xx/85xx/86xx board. In this driver, virtual interrupt host and chip were setup. There are 256 MSI interrupts in this host, Every 32 MSI interrupts cascaded to one IPIC/MPIC interrupt. The chip was treated as edge sensitive and some necessary functions were setup for this chip.
Before using the MSI interrupt, PCI/PCIE device need to ask for a MSI interrupt in the 256 MSI interrupts. A 256bit bitmap show which MSI interrupt was used, reserve bit in the bitmap can be used to force the device use some designate MSI interrupt in the 256 MSI interrupts. Sometimes this is useful for testing the all the MSI interrupts. The msi-available-ranges property in the dts file was used for this purpose.
---
Update to V4 version per the suggestion's from Michael Ellerman
arch/powerpc/sysdev/Makefile | 3 +- arch/powerpc/sysdev/fsl_msi.c | 446 +++++++++++++++++++++++++++++++++++++++++ arch/powerpc/sysdev/fsl_msi.h | 42 ++++ arch/powerpc/sysdev/fsl_pci.c | 14 ++ 4 files changed, 504 insertions(+), 1 deletions(-) create mode 100644 arch/powerpc/sysdev/fsl_msi.c create mode 100644 arch/powerpc/sysdev/fsl_msi.h
arch/powerpc/sysdev/Makefile +2 -1
@@ -4,6 +4,7 @@ endif mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o mpic_pasemi_msi.o obj-$(CONFIG_MPIC) += mpic.o $(mpic-msi-obj-y) +fsl-msi-obj-$(CONFIG_PCI_MSI) += fsl_msi.o obj-$(CONFIG_PPC_MPC106) += grackle.o obj-$(CONFIG_PPC_DCR_NATIVE) += dcr-low.o
@@ -11,7 +12,7 @@ obj-$(CONFIG_PPC_PMI) += pmi.o 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_PCI) += fsl_pci.o $(fsl-msi-obj-y) obj-$(CONFIG_FSL_LBC) += fsl_lbc.o obj-$(CONFIG_RAPIDIO) += fsl_rio.o obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o
arch/powerpc/sysdev/fsl_msi.c new file +446 -0
446 lines not on this page · raw message
arch/powerpc/sysdev/fsl_msi.h new file +42 -0
42 lines not on this page · raw message
arch/powerpc/sysdev/fsl_pci.c +14 -0
@@ -106,6 +106,16 @@ void __init setup_pci_cmd(struct pci_controller *hose) } } +#ifdef CONFIG_PCI_MSI +void __init setup_pci_pcsrbar (struct pci_controller *hose) +{ +phys_addr_t immr_base; + + immr_base =get_immrbase (); +early_write_config_dword (hose,0 ,0 ,PCI_BASE_ADDRESS_0 , immr_base); +} +#endif +static int fsl_pcie_bus_fixup;static void __init quirk_fsl_pcie_header (struct pci_dev *dev)
@@ -211,6 +221,10 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)/* Setup PEX window registers */ setup_pci_atmu (hose, &rsrc); +/*Setup PEXCSRBAR */ +#ifdef CONFIG_PCI_MSI +setup_pci_pcsrbar (hose); +#endif return 0 ; }
Signature · 1 line
1.5.4
Re: [PATCH 2/4 V4] MSI support on 83xx/85xx/86xx board
Quoted 13 lines · Jason Jin
This MSI driver can be used on 83xx/85xx/86xx board. In this driver, virtual interrupt host and chip were setup. There are 256 MSI interrupts in this host, Every 32 MSI interrupts cascaded to one IPIC/MPIC interrupt. The chip was treated as edge sensitive and some necessary functions were setup for this chip.
arch/powerpc/sysdev/fsl_msi.c new file +0
-0@@ -0,0 +1,446 @@
...
arch/powerpc/sysdev/fsl_msi.c line 64
Quoted 5 lines
arch/powerpc/sysdev/fsl_msi.c new file +5
-0+static int fsl_msi_host_match (struct irq_host *h,struct device_node *node) +{ +/* Exact match*/ +return h->of_node == node; +}
This is the default behaviour, so technically you don't need this routine - but I'm not fussed.
cheers
Signature · 8 lines
Michael Ellerman OzLabs, IBM Australia Development Lab wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person
RE: [PATCH 2/4 V4] MSI support on 83xx/85xx/86xx board
Quoted 4 lines
=20
...
=20Quoted 1 line
+static int fsl_msi_host_match(struct
irq_host*h, struct=20
Quoted 8 lines
device_node=20
arch/powerpc/sysdev/fsl_msi.c line 64
Quoted 4 lines
arch/powerpc/sysdev/fsl_msi.c new file +4
-0+*node) { +/* Exact match*/ + return h->of_node =3D=3D node; +}=20
This is the default behaviour, so technically you don't need=20 this routine - but I'm not fussed.
You are right, I noticed there is the default match function in=20 current kernel. I can try to remove this in my driver. Thanks.
Quoted 1 line
Acked-by Michael Ellerman <[email protected]>
Thanks
Jason
Re: [PATCH 2/4 V4] MSI support on 83xx/85xx/86xx board
In reply to Jason JinQuoted 18 lines · Jason Jin
This MSI driver can be used on 83xx/85xx/86xx board. In this driver, virtual interrupt host and chip were setup. There are 256 MSI interrupts in this host, Every 32 MSI interrupts cascaded to one IPIC/MPIC interrupt. The chip was treated as edge sensitive and some necessary functions were setup for this chip.
Before using the MSI interrupt, PCI/PCIE device need to ask for a MSI interrupt in the 256 MSI interrupts. A 256bit bitmap show which MSI interrupt was used, reserve bit in the bitmap can be used to force the device use some designate MSI interrupt in the 256 MSI interrupts. Sometimes this is useful for testing the all the MSI interrupts. The msi-available-ranges property in the dts file was used for this purpose.
Signed-off-by Jason Jin <[email protected]>---
Update to V4 version per the suggestion's from Michael Ellerman
arch/powerpc/sysdev/fsl_msi.c line 439
Quoted 5 lines
arch/powerpc/sysdev/fsl_msi.c new file +5
-0+static struct of_platform_driver fsl_of_msi_driver = { + .name ="fsl-of-msi" , + .match_table = fsl_of_msi_ids, + .probe = fsl_of_msi_probe, +};
nitpick: 'of' in 'fsl-of-msi' is redundant. We *already* know that this is an of_platform driver. :-)
Cheers,
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Hi Jason,
Some more comments...
Quoted 3 lines
+ - compatible : set as "fsl,86xx-MSI" for 86xx cpu, "fsl,85xx-MSI"
for 85xx
+ cpu and "fsl,83xx-MSI" for 83xx cpu.
Don't use "xx", use real device names instead. If for example the oldest 86xx device that implements this is 8600, and you write a tree for the 8699, you'd write compatible = "fsl,8699-msi", "fsl,8600-msi"; and the driver will look for "fsl,8600-msi" only usually, but it can take some special actions for 8699 if it needs to.
If these MSI devices work really identical for 83xx, 85xx, 86xx, there is no need to distinguish between them for probing either -- you want to use the same driver for all, anyway.
Oh, and the norm is to write compatible values in lower case.
Quoted 3 lines
+ - msi-available-ranges: use <start count> style section to define
which
+ msi interrupt can be used in the 256 msi interrupts.
Please make this property optional, default to "all available".
Segher
Hi, Segher.
Thanks=20
Quoted 4 lines
Quoted 1 line
+ - compatible : set as "fsl,86xx-MSI" for 86xx cpu,=20
"fsl,85xx-MSI"=20
Quoted 2 lines
for 85xx
+ cpu and "fsl,83xx-MSI" for 83xx cpu.
Quoted 11 lines
=20
Don't use "xx", use real device names instead. If for=20 example the oldest 86xx device that implements this is 8600,=20 and you write a tree for the 8699, you'd write compatible =3D=20 "fsl,8699-msi", "fsl,8600-msi"; and the driver will look for=20 "fsl,8600-msi" only usually, but it can take some special=20 actions for 8699 if it needs to.
=20
If these MSI devices work really identical for 83xx, 85xx,=20 86xx, there is no need to distinguish between them for=20 probing either -- you want to use the same driver for all, anyway
.
The driver can work for 83xx, 85xx and 86xx, but the msiir offset=20 is different for 83xx and 85xx/86xx cpu. I need this to get different=20 msiir offset in the driver.
Quoted 1 line
Oh, and the norm is to write compatible values in lower case.
Ok.
Quoted 7 lines
Quoted 1 line
+ - msi-available-ranges: use <start count> style=20
section to define
Quoted 2 lines
which
+ msi interrupt can be used in the 256 msi interrupts.=20
Please make this property optional, default to "all available". =20
The value setting for this property is "all available", and this ranges maybe
useful for some other MSI controller.=20
Jason
Quoted 7 lines
Quoted 3 lines
If these MSI devices work really identical for 83xx, 85xx, 86xx, there is no need to distinguish between them for probing either -- you want to use the same driver for all, anyway
.
The driver can work for 83xx, 85xx and 86xx, but the msiir offset is different for 83xx and 85xx/86xx cpu. I need this to get different msiir offset in the driver.
It's a different offset _within_ the region specified in "reg"? Yeah, using different "compatible" is cleanest then, no doubt.
Quoted 10 lines
Quoted 7 lines
Quoted 1 line
+ - msi-available-ranges: use <start count> style
section to define
Quoted 2 lines
which
+ msi interrupt can be used in the 256 msi interrupts.Please make this property optional, default to "all available".
The value setting for this property is "all available", and this ranges maybe
useful for some other MSI controller.
Sure, I didn't say to drop the property, just make it optional, since most trees will want the same value anyway.
Segher
Quoted 13 lines
-----Original Message-----
From: Segher Boessenkool [mailto:[email protected]]=20
Sent: Friday, May 09, 2008 6:14 PM
To: Jin Zhengxiong
Cc: [email protected]; [email protected];=20 [email protected]
Subject: Re: [PATCH 1/4 V2] booting-without-of for Freescale MSI =20Quoted 5 lines
Quoted 3 lines
If these MSI devices work really identical for 83xx, 85xx, 86xx,=20 there is no need to distinguish between them for probing either --=20 you want to use the same driver for all, anyway
.
The driver can work for 83xx, 85xx and 86xx, but the msiir=20
Quoted 7 lines
offset is=20
Quoted 2 lines
different for 83xx and 85xx/86xx cpu. I need this to get different=20 msiir offset in the driver.
=20
It's a different offset _within_ the region specified in "reg"? Yeah, using different "compatible" is cleanest then, no doubt. =20
Yes, It's different offset _within_ the "reg" region.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
+ - msi-available-ranges: use <start count> style
section to define
Quoted 2 lines
which
+ msi interrupt can be used in the 256 msi interrupts.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Please make this property optional, default to "all available".
The value setting for this property is "all available", and this=20 ranges maybe useful for some other MSI controller.
=20
Sure, I didn't say to drop the property, just make it=20 optional, since most trees will want the same value anyway.
So, The code should change to work with this change, If there's the=20 property, use it. If no, make it all available, Am I right?
Jason
Quoted 5 lines
Quoted 2 lines
Sure, I didn't say to drop the property, just make it optional, since most trees will want the same value anyway.
So, The code should change to work with this change, If there's the property, use it. If no, make it all available, Am I right?
Yeah, exactly.
Segher
Quoted 26 lines · Jason Jin
Binding document adding for Freescale MSI support.
Signed-off-by Jason Jin <[email protected]>---
Updated to V2 version per Segher's suggestion.Documentation/powerpc/booting-without-of.txt | 40 +++++++++++++++++++++++++- 1 files changed, 39 insertions(+), 1 deletions(-)Documentation/powerpc/booting-without-of.txt +4
-1@@ -57,7 +57,10 @@ Table of Contents n) 4xx/Axon EMAC ethernet nodes o) Xilinx IP cores p) Freescale Synchronous Serial Interface - q) USB EHCI controllers + q) USB EHCI controllers + r) Freescale Display Interface Unit + s) Freescale on board FPGA + t) Freescael MSI interrupt controller VII - Marvell Discovery mv64[345]6x System Controller chips 1) The /system-controller node
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 2880
Quoted 8 lines
Documentation/powerpc/booting-without-of.txt +5
-0@@ -2870,6 +2873,41 @@ platforms are moved over to use the flattened-device-tree model. reg = <0xe8000000 32>; }; + t) Freescale MSI interrupt controller + + Reguired properities: + - compatible : set as "fsl,86xx-MSI" for 86xx cpu, "fsl,85xx-MSI" for 85xx + cpu and "fsl,83xx-MSI" for 83xx cpu.
As Segher mentioned; don't use 'generic' compatible values. Use names of *actual* devices and have newer parts claim compatibility with older ones.
Otherwise looks good to me.
Cheers,
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
=20
Quoted 46 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On=20 Behalf Of Grant Likely
Sent: Friday, May 09, 2008 9:25 PM
To: Jin Zhengxiong
Cc: [email protected]; [email protected]
Subject: Re: [PATCH 1/4 V2] booting-without-of for Freescale MSI =20Quoted 7 lines · On Fri, May 9, 2008 at 3:03 AM, Jason Jin=20 <[email protected]> wrote:
Binding document adding for Freescale MSI support.
Signed-off-by Jason Jin <[email protected]>---
Updated to V2 version per Segher's suggestion.
Documentation/powerpc/booting-without-of.txt| 40=20+++++++++++++++++++++++++-
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the=20
Quoted 20 lines
1 files changed, 39 insertions(+), 1 deletions(-)Documentation/powerpc/booting-without-of.txt +4
-1@@ -57,7 +57,10 @@ Table of Contents n) 4xx/Axon EMAC ethernet nodes o) Xilinx IP cores p) Freescale Synchronous Serial Interface - q) USB EHCI controllers + q) USB EHCI controllers + r) Freescale Display Interface Unit + s) Freescale on board FPGA + t) Freescael MSI interrupt controller VII - Marvell Discovery mv64[345]6x System Controller chips 1) The /system-controller node@@ -2870,6 +2873,41 @@ platforms are moved over to use the=20flattened-device-tree model.
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model.
Quoted 7 lines
Documentation/powerpc/booting-without-of.txt +4
-0reg =3D <0xe8000000 32>; }; + t) Freescale MSI interrupt controller + + Reguired properities: + - compatible : set as "fsl,86xx-MSI" for 86xx cpu,=20
Quoted 6 lines
"fsl,85xx-MSI" for 85xx
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 2880
Quoted 1 line
Documentation/powerpc/booting-without-of.txt +1
-0+ cpu and "fsl,83xx-MSI" for 83xx cpu.=20
As Segher mentioned; don't use 'generic' compatible values. =20 Use names of *actual* devices and have newer parts claim=20 compatibility with older ones.
The *actual* devices that can use this MSI driver, is *all* the=20 boards that use "86xx/85xx/83xx" cpu. This compatible note actually was used to distinguish different msiir offset for the boards use=20 MPIC and IPIC.=20
If "MPIC-MSI" or "85xx-MSI" is 'generic'. Do we need to describe it=20 as "fsl,mpc8572ds-msi" and make all the boards who use MPIC compatible to "fsl,mpc8572ds-msi", Or each of the boards have their own compatible name=20
and each time we add a board to support MSI, add an item to the of_device_id table?
Please suggest, Thanks=20
Jason
Quoted 14 lines · Jason Jin
Binding document adding for Freescale MSI support.
Signed-off-by Jason Jin <[email protected]>---
Updated to V2 version per Segher's suggestion.Documentation/powerpc/booting-without-of.txt | 40 +++++++++++++++++++++++++- 1 files changed, 39 insertions(+), 1 deletions(-)Documentation/powerpc/booting-without-of.txt +0
-0
Documentation/powerpc/booting-without-of.txt Table of Contents · line 63
Quoted 8 lines
Documentation/powerpc/booting-without-of.txt +4
-1@@ -57,7 +57,10 @@ Table of Contents n) 4xx/Axon EMAC ethernet nodes o) Xilinx IP cores p) Freescale Synchronous Serial Interface - q) USB EHCI controllers + q) USB EHCI controllers + r) Freescale Display Interface Unit + s) Freescale on board FPGA + t) Freescael MSI interrupt controller
One more comment: Here we see sections r), s) & t) added.
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 2877
Quoted 9 lines
Documentation/powerpc/booting-without-of.txt +2
-0VII - Marvell Discovery mv64[345]6x System Controller chips 1) The /system-controller node@@ -2870,6 +2873,41 @@ platforms are moved over to use the flattened-device-tree model. reg = <0xe8000000 32>; }; + t) Freescale MSI interrupt controller +
But here, you are only adding section t)
Cheers,
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Quoted 1 line · Grant Likely
But here, you are only adding section t)
That's because r) and s) already exist. The person who added those sections didn't update the TOC.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
Quoted 6 lines · Timur Tabi
Quoted 1 line · Grant Likely
But here, you are only adding section t)
That's because r) and s) already exist. The person who added those sections didn't update the TOC.
heh. I'm obviously being far too lazy in my patch review.
Cheers,
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.