Porting RapidIO driver from ppc to powerpc architecture and adding memory mapped RapidIO driver.
Subsystems (5)
v3 cover Porting RapidIO driver from ppc to powerpc architecture and adding memory mapped RapidIO driver.
These patches are the version 3 patches for RapidIO with dts update and some minor fixups.
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 OF-node to the document of booting-without-of.txt file. [PATCH 2/5] Add RapidIO OF-node 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
PATCH v3 1/5 Add the explanation and a sample of RapidIO OF node to the document of booting-without-of.txt file.
Add the explanation and a sample of RapidIO OF node to the document of booting-without-of.txt file.
--- Documentation/powerpc/booting-without-of.txt | 37 ++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-)
Documentation/powerpc/booting-without-of.txt +37 -0
@@ -1824,6 +1824,43 @@ platforms are moved over to use the flattened-device-tree model. fsl,has-rstcr; }; + l) RapidIO + + RapidIO is a definition of a system interconnect. This node add + the support for RapidIO processor in kernel. The node name is + suggested to be 'rapidio'. + + Required properties: + + - compatible : Using "fsl,rapidio-delta" for Freescale PowerPC + 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. + 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. + - interrupts : binding interrupts for this device node, + please follow below orders: + <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: + + rapidio@c0000 { + compatible = "fsl,rapidio-delta"; + #address-cells = <2>; + #size-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>; + }; + More devices will be defined as this spec matures. VII - Specifying interrupt information for devices
Signature · 1 line
1.5.1
PATCH v3 2/5 Add RapidIO OF-node to the MPC8641HPCN board dts file.
Add RapidIO OF-node 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
@@ -422,6 +422,19 @@ >; }; + rapidio@c0000 { + compatible = "fsl,rapidio-delta"; + #address-cells = <2>; + #size-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
PATCH v3 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
@@ -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>
@@ -444,3 +446,17 @@ define_machine(mpc86xx_hpcn) { .progress = udbg_progress, .pcibios_fixup_bus = fsl_pcibios_fixup_bus, }; + + +static struct of_device_id mpc86xx_of_ids[] = { + { .type ="soc" , }, + { .compatible ="fsl,rapidio-delta" , }, + {}, +}; + +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
PATCH v3 5/5 Add the memory management driver to RapidIO.
In reply to Zhang WeiThis patch adds the memory management driver to RapidIO. The RapidIO system size is changed to automatically detection. Add the memory mapping driver to RapidIO basic driver. Multi master ports are supported.
Add a simple Bitmap RapidIO space allocator driver.
--- drivers/net/rionet.c | 17 +- drivers/rapidio/Kconfig | 18 +- drivers/rapidio/Makefile | 1 + drivers/rapidio/rio-access.c | 10 +- drivers/rapidio/rio-scan.c | 53 +++-- drivers/rapidio/rio-sysfs.c | 3 +- drivers/rapidio/rio.c | 479 ++++++++++++++++++++++++++++++++++- drivers/rapidio/rio.h | 9 +- drivers/rapidio/sallocator/Kconfig | 9 + drivers/rapidio/sallocator/Makefile | 12 + drivers/rapidio/sallocator/bitmap.c | 382 ++++++++++++++++++++++++++++ include/linux/rio.h | 71 +++++- include/linux/rio_drv.h | 41 +++- 13 files changed, 1046 insertions(+), 59 deletions(-) create mode 100644 drivers/rapidio/sallocator/Kconfig create mode 100644 drivers/rapidio/sallocator/Makefile create mode 100644 drivers/rapidio/sallocator/bitmap.c
drivers/net/rionet.c +15 -2
@@ -78,7 +78,7 @@ static int rionet_capable = 1;* could be made into a hash table to save memory depending * on system trade-offs. */ -static struct rio_dev *rionet_active[RIO_MAX_ROUTE_ENTRIES ]; +static struct rio_dev **rionet_active;#define is_rionet_capable (pef, src_ops, dst_ops) \ ((pef & RIO_PEF_INB_MBOX) && \
@@ -115,6 +115,7 @@ static int rionet_rx_clean(struct net_device *ndev) rnet->rx_skb[i]->data = data;skb_put (rnet->rx_skb[i],RIO_MAX_MSG_SIZE ); + rnet->rx_skb[i]->dev = ndev; rnet->rx_skb[i]->protocol =eth_type_trans (rnet->rx_skb[i], ndev); error =netif_rx (rnet->rx_skb[i]);
@@ -202,7 +203,8 @@ static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev) }if (eth->h_dest[0 ] &0x01 ) { -for (i =0 ; i <RIO_MAX_ROUTE_ENTRIES ; i++) +for (i =0 ; i <RIO_MAX_ROUTE_ENTRIES (rnet->mport->sys_size); + i++)if (rionet_active[i])rionet_queue_tx_msg (skb, ndev, rionet_active[i]);
@@ -392,6 +394,8 @@ static void rionet_remove(struct rio_dev *rdev)struct net_device *ndev =NULL ;struct rionet_peer *peer, *tmp; +free_pages ((unsigned long )rionet_active, rdev->net->hport->sys_size ? +__ilog2 (sizeof (void *)) +4 :0 );unregister_netdev (ndev);kfree (ndev);
@@ -449,6 +453,15 @@ static int rionet_setup_netdev(struct rio_mport *mport) goto out; } +if (!(rionet_active = (struct rio_dev **)__get_free_pages (GFP_KERNEL , + mport->sys_size ?__ilog2 (sizeof (void *)) +4 + :0 ))) { + rc = -ENOMEM ; + goto out; + } +memset ((void *)rionet_active,0 ,sizeof (void *) * +RIO_MAX_ROUTE_ENTRIES (mport->sys_size)); +/* Set up private area */ rnet = (struct rionet_private *)ndev->priv; rnet->mport = mport;
drivers/rapidio/Kconfig +10 -8
@@ -1,14 +1,6 @@ # # RapidIO configuration # -config RAPIDIO_8_BIT_TRANSPORT - bool "8-bit transport addressing" - depends on RAPIDIO - ---help--- - By default, the kernel assumes a 16-bit addressed RapidIO - network. By selecting this option, the kernel will support - an 8-bit addressed network. - config RAPIDIO_DISC_TIMEOUT int "Discovery timeout duration (seconds)" depends on RAPIDIO
@@ -16,3 +8,13 @@ config RAPIDIO_DISC_TIMEOUT ---help--- Amount of time a discovery node waits for a host to complete enumeration before giving up. + +config RAPIDIO_PROC_FS + bool "I/O and Memory resource debug" + depends on RAPIDIO && PROC_FS + default y + ---help--- + Enable this option, it will create a /proc/riores node for + monitoring the RapidIO I/O and Memory resource. + +source "drivers/rapidio/sallocator/Kconfig"
drivers/rapidio/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-y += rio.o rio-access.o rio-driver.o rio-scan.o rio-sysfs.o obj-$(CONFIG_RAPIDIO) += switches/ +obj-$(CONFIG_RAPIDIO) += sallocator/
drivers/rapidio/rio-access.c +5 -5
@@ -48,7 +48,7 @@ int __rio_local_read_config_##size \u32 data =0 ; \ if (RIO_##size##_BAD) return RIO_BAD_SIZE; \spin_lock_irqsave (&rio_config_lock, flags); \ - res = mport->ops->lcread (mport->id, offset, len, &data); \ + res = mport->ops->lcread (mport, mport->id, offset, len, &data); \ *value = (type )data; \spin_unlock_irqrestore (&rio_config_lock, flags); \return res; \
@@ -71,7 +71,7 @@ int __rio_local_write_config_##size \unsigned long flags; \ if (RIO_##size##_BAD) return RIO_BAD_SIZE; \spin_lock_irqsave (&rio_config_lock, flags); \ - res = mport->ops->lcwrite (mport->id, offset, len, value); \ + res = mport->ops->lcwrite (mport, mport->id, offset, len, value);\spin_unlock_irqrestore (&rio_config_lock, flags); \return res; \ }
@@ -108,7 +108,7 @@ int rio_mport_read_config_##size \u32 data =0 ; \ if (RIO_##size##_BAD) return RIO_BAD_SIZE; \spin_lock_irqsave (&rio_config_lock, flags); \ - res = mport->ops->cread (mport->id, destid, hopcount, offset, len, &data); \ + res = mport->ops->cread (mport, mport->id, destid, hopcount, offset, len, &data); \ *value = (type )data; \spin_unlock_irqrestore (&rio_config_lock, flags); \return res; \
@@ -131,7 +131,7 @@ int rio_mport_write_config_##size \unsigned long flags; \ if (RIO_##size##_BAD) return RIO_BAD_SIZE; \spin_lock_irqsave (&rio_config_lock, flags); \ - res = mport->ops->cwrite (mport->id, destid, hopcount, offset, len, value); \ + res = mport->ops->cwrite (mport, mport->id, destid, hopcount, offset, len, value); \spin_unlock_irqrestore (&rio_config_lock, flags); \return res; \ }
@@ -166,7 +166,7 @@ int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid, u16 data)unsigned long flags;spin_lock_irqsave (&rio_doorbell_lock, flags); - res = mport->ops->dsend (mport->id, destid, data); + res = mport->ops->dsend (mport, mport->id, destid, data);spin_unlock_irqrestore (&rio_doorbell_lock, flags);return res;
drivers/rapidio/rio-scan.c +37 -16
149 lines not on this page · raw message
drivers/rapidio/rio-sysfs.c +2 -1
@@ -43,7 +43,8 @@ static ssize_t routes_show(struct device *dev, struct device_attribute *attr, chif (!rdev->rswitch) goto out; -for (i =0 ; i <RIO_MAX_ROUTE_ENTRIES ; i++) { +for (i =0 ; i <RIO_MAX_ROUTE_ENTRIES (rdev->net->hport->sys_size); + i++) {if (rdev->rswitch->route_table[i] ==RIO_INVALID_ROUTE )continue ; str +=
drivers/rapidio/rio.c +476 -3
516 lines not on this page · raw message
drivers/rapidio/rio.h +2 -7
@@ -51,10 +51,5 @@ extern struct rio_route_ops __end_rio_route_ops[]; DECLARE_RIO_ROUTE_SECTION(.rio_route_ops, \ vid, did, add_hook, get_hook) -#ifdef CONFIG_RAPIDIO_8_BIT_TRANSPORT -#define RIO_GET_DID (x) ((x & 0x00ff0000) >> 16) -#define RIO_SET_DID (x) ((x & 0x000000ff) << 16) -#else -#define RIO_GET_DID (x) (x & 0xffff) -#define RIO_SET_DID (x) (x & 0xffff) -#endif +#define RIO_GET_DID (size, x) (size ? (x & 0xffff) : ((x & 0x00ff0000) >> 16)) +#define RIO_SET_DID (size, x) (size ? (x & 0xffff) : ((x & 0x000000ff) << 16))
drivers/rapidio/sallocator/Kconfig new file +9 -0
@@ -0,0 +1,9 @@ +choice + prompt "Default RapidIO Space Allocator" + depends on RAPIDIO + default RIO_SA_DEFAULT_BITMAP + + config RIO_SA_DEFAULT_BITMAP + bool "Bitmap" + +endchoice
drivers/rapidio/sallocator/Makefile new file +12 -0
@@ -0,0 +1,12 @@ +# +# Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved. +# +# Author: Zhang Wei, [email protected], Jun 2007 +# +# This 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. +# + +obj-$(CONFIG_RIO_SA_DEFAULT_BITMAP) += bitmap.o
drivers/rapidio/sallocator/bitmap.c new file +382 -0
382 lines not on this page · raw message
include/linux/rio.h +59 -12
129 lines not on this page · raw message
include/linux/rio_drv.h +36 -5
61 lines not on this page · raw message
Signature · 1 line
1.5.1
PATCH v3 4/5 Add RapidIO support to powerpc architecture.
In reply to Zhang WeiThis patch adds the RapidIO support to the powerpc architecture. Some files are moved from ppc. OF-tree and OF-device supports 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 | 1455 +++++++++++++++++++++++++++++++++++++++++ arch/powerpc/sysdev/fsl_rio.h | 20 + 6 files changed, 1549 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
@@ -492,6 +492,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
@@ -70,6 +70,7 @@ pci64-$(CONFIG_PPC64) += pci_64.o pci_dn.o isa-bridge.o pci32-$(CONFIG_PPC32) := pci_32.o obj-$(CONFIG_PCI) += $(pci64-y) $(pci32-y) pci-common.o 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
@@ -12,6 +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_RAPIDIO) += fsl_rio.o obj-$(CONFIG_FSL_PCI) += fsl_pci.o obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o obj-$(CONFIG_QUICC_ENGINE) += qe_lib/
arch/powerpc/sysdev/fsl_rio.c new file +1455 -0
1,455 lines not on this page · raw message
arch/powerpc/sysdev/fsl_rio.h new file +20 -0
@@ -0,0 +1,20 @@ +/* +* Freescale PowerPC RapidIO definitions +* +* Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved. +* Zhang Wei <[email protected]>, Jun 2007 +* +* 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
Re: [PATCH 3/5 v3] Add the platform device support with RapidIO to MPC8641HPCN platform.
In reply to Zhang Weiarch/powerpc/platforms/86xx/mpc86xx_hpcn.c line 32
Quoted 3 lines · On Thu, 26 Jul 2007 16:42:50 +0800 Zhang Wei <[email protected]> wrote:
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +2
-0+#include <asm/of_device.h> +#include <asm/of_platform.h>
These should now be <linux/of_device.h> and <linux/of_platform.h>
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Re: [PATCH 4/5 v3] Add RapidIO support to powerpc architecture.
In reply to Zhang WeiReview
Quoted 3 lines · On Thu, 26 Jul 2007 16:42:51 +0800 Zhang Wei <[email protected]> wrote:
(quoted diff) +2
-0+ +#include <../sysdev/fsl_rio.h>
This can just be <sysdev/fsl_rio.h> if it is only built on 32bit.
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Re: [PATCH 4/5 v3] Add RapidIO support to powerpc architecture.
In reply to Zhang WeiQuoted 8 lines · Zhang Wei
This patch adds the RapidIO support to the powerpc architecture. Some files are moved from ppc. OF-tree and OF-device supports 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.
Quoted 8 lines
Signed-off-by Zhang Wei <[email protected]>--- 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 | 1455 +++++++++++++++++++++++++++++++++++++++++
how much of this moved from ppc85xx_rio.c?
Quoted 11 lines
arch/powerpc/sysdev/fsl_rio.h | 20 + 6 files changed, 1549 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.harch/powerpc/Kconfig +0
-0
arch/powerpc/Kconfig source "drivers/pci/Kconfig" · line 499
Quoted 8 lines
arch/powerpc/Kconfig +5
-0@@ -492,6 +492,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.
why not make this depend on something like HAS_RAPIDIO and let the boards select HAS_RAPIDIO if they have it
Quoted 11 lines
arch/powerpc/Kconfig +3
-0+ +source "drivers/rapidio/Kconfig" + source "drivers/pci/hotplug/Kconfig" endmenuarch/powerpc/kernel/Makefile +0
-0@@ -70,6 +70,7 @@ pci64-$(CONFIG_PPC64) += pci_64.o pci_dn.o isa-
Quoted 5 lines
bridge.o
pci32-$(CONFIG_PPC32) := pci_32.o
obj-$(CONFIG_PCI) += $(pci64-y) $(pci32-y) pci-common.o
obj-$(CONFIG_PCI_MSI) += msi.o
+obj-$(CONFIG_RAPIDIO) += rio.o
should probably live in sysdev/rio.c
Quoted 76 lines
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 +4
-0@@ -0,0 +1,64 @@ +/* +* RapidIO PowerPC support +* +* Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ * Zhang Wei <[email protected]>, Jun 2007
+ *
+ * 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.
+ *
+ * New RapidIO peer-to-peer network initialize with of-device supoort.
+ *
+ */arch/powerpc/kernel/rio.c new file +48
-0+ +#include <linux/init.h> +#include <linux/kernel.h> +#include <linux/rio.h> + +#include <asm/rio.h> +#include <asm/of_device.h> +#include <asm/of_platform.h> + +#include <../sysdev/fsl_rio.h> + + +/* The probe function for RapidIO peer-to-peer network. +*/ +static int __devinit of_rio_rpn_probe (struct of_device *dev, +const struct of_device_id *match) +{ +int rc; +printk (KERN_INFO "Setting up RapidIO peer-to-peer network %s\n" , + dev->node->full_name); + + rc =fsl_rio_setup (dev); +if (rc) + goto out; + +/* Enumerate all registered ports */ + rc =rio_init_mports (); +out: +return rc; +}; + +static struct of_device_id of_rio_rpn_ids[] = { + { + .compatible ="fsl,rapidio-delta" , + }, + {}, +}; + +static struct of_platform_driver of_rio_rpn_driver = { + .name ="of-rio" , + .match_table = of_rio_rpn_ids, + .probe = of_rio_rpn_probe, +}; + +static __init int of_rio_rpn_init (void ) +{ +return of_register_platform_driver (&of_rio_rpn_driver); +}
Quoted 10 lines · Zhang Wei
These patches are the version 3 patches for RapidIO with dts update and some minor fixups.
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 OF-node to the document of booting-without-of.txt file. [PATCH 2/5] Add RapidIO OF-node 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.
Quoted 4 lines
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.
Can we do the port from ppc as follows:
- cp arch/ppc/syslib/*85xx*rio to arch/powerpc/syslib/fsl_rio.{c,h} make everything still build
- rename cleanup the code in fsl_rio.{c,h}
this makes it easier to see what changes actually are to fsl_rio.{c,h}
Quoted 4 lines
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.
also you describe 7 items, was expect 7 patches :)
- k
Re: [PATCH 1/5 v3] Add the explanation and a sample of RapidIO OF node to the document of booting-without-of.txt file.
In reply to Zhang WeiQuoted 20 lines · Zhang Wei
Add the explanation and a sample of RapidIO OF node to the document of booting-without-of.txt file.
Signed-off-by Zhang Wei <[email protected]>--- Documentation/powerpc/booting-without-of.txt | 37 +++++++++++++++ +++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-)Documentation/powerpc/booting-without-of.txt +0
-0@@ -1824,6 +1824,43 @@ platforms are moved over to use theflattened-device-tree model.
Documentation/powerpc/booting-without-of.txt +3
-0fsl,has-rstcr; }; + l) RapidIO + + RapidIO is a definition of a system interconnect. This node add
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1839
Quoted 10 lines
Documentation/powerpc/booting-without-of.txt +10
-0+ the support for RapidIO processor in kernel. The node name is + suggested to be 'rapidio'. + + Required properties: + + - compatible : Using "fsl,rapidio-delta" for Freescale PowerPC + 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.
Can you explain this a little further. I'm a bit confused by 'RapidIO address of the registers'.
Quoted 29 lines
Documentation/powerpc/booting-without-of.txt +24
-0+ 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. + - interrupts : binding interrupts for this device node, + please follow below orders: + <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: + + rapidio@c0000 { + compatible = "fsl,rapidio-delta"; + #address-cells = <2>; + #size-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>; + }; + More devices will be defined as this spec matures. VII - Specifying interrupt information for devicesSignature · 1 line
1.5.1
RE: [PATCH 4/5 v3] Add RapidIO support to powerpc architecture.
In reply to Kumar GalaHi, Kumar,=20
Quoted 21 lines
-----Original Message-----
From: Kumar Gala [mailto:[email protected]]=20 On Jul 26, 2007, at 3:42 AM, Zhang Wei wrote:
=20Quoted 10 lines
This patch adds the RapidIO support to the powerpc architecture. Some files are moved from ppc. OF-tree and OF-device supports are =20 added.
New silicons such as MPC8548, MPC8641 with serial RapidIO =20 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.Quoted 7 lines
Signed-off-by Zhang Wei <[email protected]>--- 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| 1455=20
Quoted 6 lines
++++++++++++++++++++++++++++++=20
Quoted 1 line
+++++++++++
=20
how much of this moved fromppc85xx_rio.c?From the code size, 2/3 are moved from
pcc85xx_rio.cwith clean up, 1/3
are new coding.
Quoted 18 lines
=20
Quoted 11 lines
arch/powerpc/sysdev/fsl_rio.h | 20 + 6 files changed, 1549 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.harch/powerpc/Kconfig +0
-0arch/powerpc/Kconfig source "drivers/pci/Kconfig" · line 496
Quoted 5 lines
arch/powerpc/Kconfig +2
-0@@ -492,6 +492,14 @@ source "drivers/pci/Kconfig" source "drivers/pcmcia/Kconfig" +config RAPIDIO + bool "RapidIO support" if MPC8540 || MPC8560 || MPC8641=20|| MPC8548
Quoted 6 lines
arch/powerpc/Kconfig source "drivers/pci/Kconfig" · line 499
Quoted 3 lines
arch/powerpc/Kconfig +3
-0+ help + If you say Y here, the kernel will include drivers and + infrastructure code to support RapidIO interconnect devices.=20
why not make this depend on something likeHAS_RAPIDIOand let the =20 boards selectHAS_RAPIDIOif they have it
It's more clear, We can know how many and which processors support RapidIO. :-)
Quoted 14 lines
=20
arch/powerpc/kernel/Makefile pci64-$(CONFIG_PPC64) +=3D=20
Quoted 12 lines
arch/powerpc/Kconfig +3
-0+ +source "drivers/rapidio/Kconfig" + source "drivers/pci/hotplug/Kconfig" endmenuarch/powerpc/kernel/=20 renamed from arch/powerpc/kernel/Makefile +0
-0
Makefile
index 42c42ec..02d4100 100644arch/powerpc/kernel/Makefile +0
-0@@ -70,6 +70,7 @@ pci64-$(CONFIG_PPC64) +=3D=20pci_64.o pci_dn.o isa-=20
Quoted 7 lines
Quoted 5 lines
bridge.o
pci32-$(CONFIG_PPC32) :=3D pci_32.o
obj-$(CONFIG_PCI) +=3D $(pci64-y) $(pci32-y) pci-common.o
obj-$(CONFIG_PCI_MSI) +=3D msi.o
+obj-$(CONFIG_RAPIDIO) +=3D rio.o=20
should probably live insysdev/rio.c
This just keep the same position of ppc arch.
Thanks!
-zw
RE: [PATCH 1/5 v3] Add the explanation and a sample of RapidIO OF node to the document of booting-without-of.txt file.
In reply to Kumar GalaHi, Kumar,=20
Quoted 10 lines
+ RapidIO is a definition of a system interconnect. This node add
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model.
Quoted 8 lines
Documentation/powerpc/booting-without-of.txt +8
-0+ the support for RapidIO processor in kernel. The node name is + suggested to be 'rapidio'. + + Required properties: + + - compatible : Using "fsl,rapidio-delta" for Freescale PowerPC + RapidIO controller. + - #address-cells : Address representation for=20"rapidio" devices.
Quoted 6 lines
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1839
Quoted 2 lines
Documentation/powerpc/booting-without-of.txt +2
-0+ This field represents the number of cells needed to represent + the RapidIO address of the registers.=20
Can you explain this a little further. I'm a bit confused by =20 'RapidIO address of the registers'.
=20
I want to present "This field represents the number of cells [needed to represent the RapidIO address] of the registers."
Maybe I should remove 'of the registers' to be more clear.
Thanks!
-zw
Re: [PATCH 3/5 v3] Add the platform device support with RapidIO to MPC8641HPCN platform.
In reply to Zhang WeiReview
Quoted 6 lines · Zhang Wei
(quoted diff) +6
-0+ +static struct of_device_id mpc86xx_of_ids[] =3D { +=A0=A0=A0=A0=A0=A0=A0{ .type =3D "soc", }, +=A0=A0=A0=A0=A0=A0=A0{ .compatible =3D "fsl,rapidio-delta", }, +=A0=A0=A0=A0=A0=A0=A0{}, +};
With the device tree source you have posted in 2/5, the rapidio node is a child of the soc bus, and it doesn't have any children of its own. Therefore it is completely equivalent to _only_ add the soc type to mpc86xx_of_ids[], as in=20
static struct of_device_id mpc86xx_of_ids[] =3D {
{ .type =3D "soc", },
{},
};Even if you intend to add children to the rapidio node in the future, I'd think it would be more appropriate to have those scanned by the rapidio bus driver, not by of_platform.
Arnd <><
RE: [PATCH 3/5 v3] Add the platform device support with RapidIO to MPC8641HPCN platform.
Hi, Arnd,
I can change it as you metioned now.
Thanks!
-zw
Quoted 43 lines
-----Original Message-----
From: [email protected]=20 [mailto:[email protected]] On Behalf Of Arnd Bergmann
Sent: Sunday, July 29, 2007 9:57 PM
To: [email protected]
Cc: Zhang Wei-r63237; [email protected];=20 [email protected]; [email protected];=20 [email protected]
Subject: Re: [PATCH 3/5 v3] Add the platform device support=20 with RapidIO to MPC8641HPCN platform.
=20Review
Quoted 6 lines · Zhang Wei
(quoted diff) +6
-0+ +static struct of_device_id mpc86xx_of_ids[] =3D { +=A0=A0=A0=A0=A0=A0=A0{ .type =3D "soc", }, +=A0=A0=A0=A0=A0=A0=A0{ .compatible =3D "fsl,rapidio-delta", }, +=A0=A0=A0=A0=A0=A0=A0{}, +};=20
With the device tree source you have posted in 2/5, the=20 rapidio node is
a child of the soc bus, and it doesn't have any children of its own. Therefore it is completely equivalent to _only_ add the soc type to mpc86xx_of_ids[], as in=20
=20static struct of_device_id mpc86xx_of_ids[] =3D { { .type =3D "soc", }, {}, };=20
Even if you intend to add children to the rapidio node in the future, I'd think it would be more appropriate to have those scanned by the rapidio bus driver, not byof_platform.
=20Arnd <><=20
-
To unsubscribe from this list: send the line "unsubscribe=20 linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
=20
Re: [PATCH 1/5 v3] Add the explanation and a sample of RapidIO OF node to the document of booting-without-of.txt file.
In reply to Zhang Wei-r63237Quoted 11 lines
Quoted 8 lines
Quoted 1 line
+ - #address-cells : Address representation for
"rapidio" devices.
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1839
Quoted 2 lines
Documentation/powerpc/booting-without-of.txt +2
-0+ This field represents the number of cells needed to represent + the RapidIO address of the registers.Can you explain this a little further. I'm a bit confused by 'RapidIO address of the registers'.
I want to present "This field represents the number of cells [needed to represent the RapidIO address] of the registers."
Maybe I should remove 'of the registers' to be more clear.
This is completely content-free anyway; the semantics of #address-cells (and #size-cells, which you forgot) are already defined in the base OF spec; what you _should_ be defining here is a) the required value of #address-cells for a rapidio bus; and b) how addresses on that bus are represented (simply as a 64-bit integer, encoded as a pair of 32-bit integers as usual; but it needs to be said).
Segher
Re: [PATCH 1/5 v3] Add the explanation and a sample of RapidIO OF node to the document of booting-without-of.txt file.
In reply to Zhang WeiQuoted 1 line
+ l) RapidIO
"FSL PowerPC bridge RapidIO" or something like that -- you aren't doing a _generic_ rapidio binding here.
Quoted 10 lines
Documentation/powerpc/booting-without-of.txt +10
-0+ RapidIO is a definition of a system interconnect. This node add + the support for RapidIO processor in kernel. The node name is + suggested to be 'rapidio'. + + Required properties: + + - compatible : Using "fsl,rapidio-delta" for Freescale PowerPC + RapidIO controller. + - #address-cells : Address representation for "rapidio" devices. + This field represents the number of cells needed to represent
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1848
Quoted 10 lines
Documentation/powerpc/booting-without-of.txt +10
-0+ the RapidIO address of the registers. + 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. + - interrupts : binding interrupts for this device node, + please follow below orders: + <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>.
_All_ of these are "as specified in 1)". You should be saying the specifics for your device here; for example, what register blocks of your controller are described in "reg", and in what order?
Segher
Can anyone tell me what the status of these are? What kernel release are they targetted for? Currently I'm trying to work with 2.6.23 plus these patches locally.
Cheers
Phil
Quoted 32 lines · Zhang Wei
These patches are the version 3 patches for RapidIO with dts update and some minor fixups.
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 OF-node to the document of booting-without-of.txt file. [PATCH 2/5] Add RapidIO OF-node 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_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
Quoted 3 lines · Phil Terry
Can anyone tell me what the status of these are? What kernel release are they targetted for? Currently I'm trying to work with 2.6.23 plus these patches locally.
hopefully 2.6.25. I'd like to get the documentation updates in 2.6.24 if we have agreement on them.
- k
Yes, I'm working on it. Do not worry about it.
Wei.
Quoted 24 lines
-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Tuesday, October 30, 2007 4:31 AM
To: [email protected]
Cc: Zhang Wei-r63237; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 0/5 v3] Porting RapidIO driver from ppc to powerpc architecture and adding memory mapped RapidIO driver.Quoted 5 lines · Phil Terry
Can anyone tell me what the status of these are? What kernel release are
they targetted for? Currently I'm trying to work with 2.6.23 plus these
patches locally.hopefully 2.6.25. I'd like to get the documentation updates in 2.6.24 if we have agreement on them.
- k
Quoted 1 line · Zhang Wei-r63237 wrote:
Yes, I'm working on it. Do not worry about it.
How's this going? I've been working on this a bit myself, but if you are close to posting your stuff, I'll stop and wait for your version instead. It doesn't make sense for us to duplicate the same work.
Randy Vinson
Hi, Randy,
I'll post it soon and hope to get much feedback from you.
Thanks!
Wei.=20
Quoted 12 lines
-----Original Message-----
From: Randy Vinson [mailto:[email protected]]=20
=20Quoted 1 line · Zhang Wei-r63237 wrote:
Yes, I'm working on it. Do not worry about it.
How's this going? I've been working on this a bit myself, but=20 if you are
close to posting your stuff, I'll stop and wait for your version instead. It doesn't make sense for us to duplicate the same work. =20
Randy Vinson
=20
Re: [PATCH 5/5 v3] Add the memory management driver to RapidIO.
In reply to Zhang WeiQuoted 5 lines · Zhang Wei
This patch adds the memory management driver to RapidIO. The RapidIO system size is changed to automatically detection. Add the memory mapping driver to RapidIO basic driver. Multi master ports are supported.
Add a simple Bitmap RapidIO space allocator driver.
Can we break up the functionality here into separate patches. I'm seeing 4 logical patches:
* system size is changed to automatic detection
* support for multi master ports
* bitmap allocator
* memory map driver
Quoted 21 lines
Signed-off-by Zhang Wei <[email protected]>---
drivers/net/rionet.c | 17 +- drivers/rapidio/Kconfig | 18 +- drivers/rapidio/Makefile | 1 + drivers/rapidio/rio-access.c | 10 +- drivers/rapidio/rio-scan.c | 53 +++-- drivers/rapidio/rio-sysfs.c | 3 +- drivers/rapidio/rio.c | 479 ++++++++++++++++++++++++++ ++++++++- drivers/rapidio/rio.h | 9 +- drivers/rapidio/sallocator/Kconfig | 9 + drivers/rapidio/sallocator/Makefile | 12 + drivers/rapidio/sallocator/bitmap.c | 382 ++++++++++++++++++++++++++ ++ include/linux/rio.h | 71 +++++- include/linux/rio_drv.h | 41 +++- 13 files changed, 1046 insertions(+), 59 deletions(-)create mode 100644
drivers/rapidio/sallocator/Kconfigcreate mode 100644drivers/rapidio/sallocator/Makefilecreate mode 100644drivers/rapidio/sallocator/bitmap.c
[snip]
drivers/rapidio/Kconfig config RAPIDIO_DISC_TIMEOUT · line 19
Quoted 8 lines
drivers/rapidio/Kconfig +8
-0+config RAPIDIO_PROC_FS + bool "I/O and Memory resource debug" + depends on RAPIDIO && PROC_FS + default y + ---help--- + Enable this option, it will create a /proc/riores node for + monitoring the RapidIO I/O and Memory resource. +
This isn't going to be acceptable. You should use sysfs or debugfs not proc.
- k