Add PRUSS UIO driver support
v10 cover Add PRUSS UIO driver support
This patch series add support for PRUSS (Programmable Real-time Unit Sub System) UIO driver in Texas Instruments DA850, AM18xx and OMAP-L138 processors. PRUSS is programmable RISC core which can be used to implement Soft IPs (eg:- DMA, CAN, UART,SmartCard) and Industrial communications data link layers (eg:- PROFIBUS). UIO driver exposes PRUSS resources like memory and interrupts to user space application.PRUSS UIO application API can be used to control PRUs in PRUSS, setup PRU INTC, load firmware to PRUs and implement IPC between Host processor and PRUs. More information on PRUSS and UIO linux user space API available in the links below
http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit_Subsystem
http://processors.wiki.ti.com/index.php/PRU_Linux_Application_Loader
http://processors.wiki.ti.com/index.php/PRU_Linux_Application_Loader_API_Guide
Platform/board specific portion of this patch depends on Mistral patches below
[PATCH 1/1] davinci: changed SRAM allocator to shared ram :
https://patchwork.kernel.org/patch/549351/ [PATCH 1/1] da830: macro rename DA8XX_LPSC0_DMAX to DA8XX_LPSC0_PRUSS : https://patchwork.kernel.org/patch/549331/ [PATCH v2 01/13] mfd: pruss mfd driver : https://patchwork.kernel.org/patch/549531/ [PATCH v2 02/13] da850: pruss platform specific additions : https://patchwork.kernel.org/patch/549521/
I will submit a seperate patch set on top of these patches to support PRUSS UIO driver.
Pratheesh Gangadhar (1):
PRUSS UIO driver support
drivers/uio/Kconfig | 17 +++ drivers/uio/Makefile | 1 + drivers/uio/uio_pruss.c | 247 +++++++++++++++++++++++++++++++++++++++++++++ include/linux/uio_pruss.h | 25 +++++ 4 files changed, 290 insertions(+), 0 deletions(-) create mode 100644 drivers/uio/uio_pruss.c create mode 100644 include/linux/uio_pruss.h
PATCH v10 1/1 PRUSS UIO driver support
This patch implements PRUSS (Programmable Real-time Unit Sub System) UIO driver which exports SOC resources associated with PRUSS like I/O, memories and IRQs to user space. PRUSS is dual 32-bit RISC processors which is efficient in performing embedded tasks that require manipulation of packed memory mapped data structures and handling system events that have tight real time constraints. This driver is currently supported on Texas Instruments DA850, AM18xx and OMAP-L138 devices.
For example, PRUSS runs firmware for real-time critical industrial communication data link layer and communicates with application stack running in user space via shared memory and IRQs.
--- drivers/uio/Kconfig | 17 +++ drivers/uio/Makefile | 1 + drivers/uio/uio_pruss.c | 247 +++++++++++++++++++++++++++++++++++++++++++++ include/linux/uio_pruss.h | 25 +++++ 4 files changed, 290 insertions(+), 0 deletions(-) create mode 100644 drivers/uio/uio_pruss.c create mode 100644 include/linux/uio_pruss.h
drivers/uio/Kconfig +17 -0
@@ -94,4 +94,21 @@ config UIO_NETX To compile this driver as a module, choose M here; the module will be called uio_netx. +config UIO_PRUSS + tristate "Texas Instruments PRUSS driver" + depends on ARCH_DAVINCI_DA850 + help + PRUSS driver for OMAPL138/DA850/AM18XX devices + PRUSS driver requires user space components, examples and user space + driver is available from below SVN repo - you may use anonymous login + + https://gforge.ti.com/gf/project/pru_sw/ + + More info on API is available at below wiki + + http://processors.wiki.ti.com/index.php/PRU_Linux_Application_Loader + + To compile this driver as a module, choose M here: the module + will be called uio_pruss. + endif
drivers/uio/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-$(CONFIG_UIO_AEC) += uio_aec.o obj-$(CONFIG_UIO_SERCOS3) += uio_sercos3.o obj-$(CONFIG_UIO_PCI_GENERIC) += uio_pci_generic.o obj-$(CONFIG_UIO_NETX) += uio_netx.o +obj-$(CONFIG_UIO_PRUSS) += uio_pruss.o
drivers/uio/uio_pruss.c new file +247 -0
247 lines not on this page · raw message
include/linux/uio_pruss.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* include/linux/uio_pruss.h +* +* Platform data for uio_pruss driver +* +* Copyright (C) 2010-11 Texas Instruments Incorporated - http://www.ti.com/ +* +* 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 version 2. +* +* This program is distributed "as is" WITHOUT ANY WARRANTY of any +* kind, whether express or implied; without even the implied warranty +* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#ifndef _UIO_PRUSS_H_ +#define _UIO_PRUSS_H_ + +/* Used to configure the PRUSS INTC base offset for UIO driver */ +struct uio_pruss_pdata { +u32 pintc_base; +}; +#endif /* _LINUX_UIO_PRUSS_H_ */
Signature · 1 line
1.6.0.6
Re: [PATCH v10 1/1] PRUSS UIO driver support
Quoted 11 lines · On Friday 04 March 2011 05:42:52 Pratheesh Gangadhar wrote:
This patch implements PRUSS (Programmable Real-time Unit Sub System) UIO driver which exports SOC resources associated with PRUSS like I/O, memories and IRQs to user space. PRUSS is dual 32-bit RISC processors which is efficient in performing embedded tasks that require manipulation of packed memory mapped data structures and handling system events that have tight real time constraints. This driver is currently supported on Texas Instruments DA850, AM18xx and OMAP-L138 devices.
For example, PRUSS runs firmware for real-time critical industrial communication data link layer and communicates with application stack running in user space via shared memory and IRQs.
Looks good
Quoted 2 lines
Signed-off-by Pratheesh Gangadhar <[email protected]>Reviewed-by Thomas Gleixner <[email protected]>
Re: [PATCH v10 1/1] PRUSS UIO driver support
In reply to Pratheesh Gangadharinclude/linux/uio_pruss.h
Quoted 5 lines · Pratheesh Gangadhar
include/linux/uio_pruss.h new file +0
-0
That should go to arch/arm/mach-davinci/include/mach/ and not to the top level include/linux/ directory.
Quoted 30 lines
include/linux/uio_pruss.h new file +25
-0@@ -0,0 +1,25 @@ +/* +* include/linux/uio_pruss.h +* +* Platform data for uio_pruss driver +* +* Copyright (C) 2010-11 Texas Instruments Incorporated - http://www.ti.com/ +* +* 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 version 2. +* +* This program is distributed "as is" WITHOUT ANY WARRANTY of any +* kind, whether express or implied; without even the implied warranty +* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#ifndef _UIO_PRUSS_H_ +#define _UIO_PRUSS_H_ + +/* Used to configure the PRUSS INTC base offset for UIO driver */ +struct uio_pruss_pdata { +u32 pintc_base; +}; +#endif /* _LINUX_UIO_PRUSS_H_ */ Signature · 1 line
1.6.0.6
Thanks,
Hans
RE: [PATCH v10 1/1] PRUSS UIO driver support
Hi Hans,
Quoted 9 lines · Hans J. Koch
include/linux/uio_pruss.h
Quoted 5 lines · Pratheesh Gangadhar
include/linux/uio_pruss.h new file +0
-0That should go to
arch/arm/mach-davinci/include/mach/and not to the top levelinclude/linux/directory.
It was put in here because this driver will be used across two ARM architectures (DaVinci and OMAP). Although it won't be used outside of ARM at least in near future.
Thanks,
Sekhar
Re: [PATCH v10 1/1] PRUSS UIO driver support
Quoted 11 lines · Sekhar
Quoted 9 lines · Hans J. Koch
include/linux/uio_pruss.h
Quoted 5 lines · Pratheesh Gangadhar
include/linux/uio_pruss.h new file +0
-0That should go to
arch/arm/mach-davinci/include/mach/and not to the top levelinclude/linux/directory.
Quoted 4 lines
It was put in here because this driver will be used across two ARM architectures (DaVinci and OMAP). Although it won't be used outside of ARM at least in near future.
I think include/linux/ is fine for this, and arch/arm/include/asm would be ok as well. You might want to have only a single pruss header file that defines all the platform data for the child drivers, though.
Ideally, you would of course not need the header at all. This will be possible with the move to a flat device tree, where you can store the offset as a property of the device
Another alternative would be to move it to a resource of the platform device.
Arnd
Re: [PATCH v10 1/1] PRUSS UIO driver support
Quoted 12 lines · Arnd Bergmann
Quoted 11 lines · Sekhar
Quoted 9 lines · Hans J. Koch
include/linux/uio_pruss.h
Quoted 5 lines · Pratheesh Gangadhar
include/linux/uio_pruss.h new file +0
-0That should go to
arch/arm/mach-davinci/include/mach/and not to the top levelinclude/linux/directory.
Quoted 6 lines
Quoted 4 lines
It was put in here because this driver will be used across two ARM architectures (DaVinci and OMAP). Although it won't be used outside of ARM at least in near future.
I think
include/linux/is fine for this
No, please use include/linux/platform_data/ instead, that is where platform data should be going into, not into the "global" space if include/linux/
Quoted 10 lines
, and
arch/arm/include/asmwould
be ok as well. You might want to have only a single pruss header file that defines all the platform data for the child drivers, though.Ideally, you would of course not need the header at all. This will be possible with the move to a flat device tree, where you can store the offset as a property of the device
Another alternative would be to move it to a resource of the platform device.
That might be a nice idea for the future.
thanks,
greg k-h
Re: [PATCH v10 1/1] PRUSS UIO driver support
In reply to Nori, SekharQuoted 13 lines · Sekhar
Hi Hans,
Quoted 9 lines · Hans J. Koch
include/linux/uio_pruss.h
Quoted 5 lines · Pratheesh Gangadhar
include/linux/uio_pruss.h new file +0
-0That should go to
arch/arm/mach-davinci/include/mach/and not to the top levelinclude/linux/directory.
Quoted 4 lines
It was put in here because this driver will be used across two ARM architectures (DaVinci and OMAP). Although it won't be used outside of ARM at least in near future.
OK, I accept that. I'll review the rest soon.
Thanks,
Hans
Re: [PATCH v10 1/1] PRUSS UIO driver support
In reply to Pratheesh GangadharQuoted 14 lines · Pratheesh Gangadhar
This patch implements PRUSS (Programmable Real-time Unit Sub System) UIO driver which exports SOC resources associated with PRUSS like I/O, memories and IRQs to user space. PRUSS is dual 32-bit RISC processors which is efficient in performing embedded tasks that require manipulation of packed memory mapped data structures and handling system events that have tight real time constraints. This driver is currently supported on Texas Instruments DA850, AM18xx and OMAP-L138 devices.
For example, PRUSS runs firmware for real-time critical industrial communication data link layer and communicates with application stack running in user space via shared memory and IRQs.Signed-off-by Pratheesh Gangadhar <[email protected]>Reviewed-by Thomas Gleixner <[email protected]>
Quoted 8 lines
--- drivers/uio/Kconfig | 17 +++ drivers/uio/Makefile | 1 + drivers/uio/uio_pruss.c | 247 +++++++++++++++++++++++++++++++++++++++++++++ include/linux/uio_pruss.h | 25 +++++ 4 files changed, 290 insertions(+), 0 deletions(-) create mode 100644 drivers/uio/uio_pruss.c create mode 100644 include/linux/uio_pruss.h
Make that include/linux/platform_data/uio_pruss.h as Greg said. Otherwise, I don't see further issues, so I think we can take the next version.
Thanks,
Hans