Skip to contentSkip to conversation

pruss mfd drivers.

PATCH In review Subhasish Ghosh 4 participants 6 messages May 31, 2011 – Jul 6, 2011 Staging

lore
Share & tools
lore
#1 lore raw

PATCH v5 1/1 drivers:staging:pruss: add pruss staging mfd driver.

In reply to Subhasish Ghosh

This patch adds the pruss MFD driver and associated include files. For details regarding the PRUSS please refer the folowing link:
http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit_Subsystem

The rational behind the MFD driver being the fact that multiple devices can be implemented on the cores independently. This is determined by the nature of the program which is loaded into the PRU's instruction memory. A device may be de-initialized and another loaded or two different devices can be run simultaneously on the two cores.
It's also possible, as in our case, to implement a single device on both the PRU's resulting in improved load sharing.

---
 drivers/staging/Kconfig            |    2 +
 drivers/staging/Makefile           |    1 +
 drivers/staging/pruss/Kconfig      |   16 ++
 drivers/staging/pruss/Makefile     |    5 +
 drivers/staging/pruss/TODO         |   14 +
 drivers/staging/pruss/pruss.c      |  483 ++++++++++++++++++++++++++++++++++++
 drivers/staging/pruss/pruss.h      |  130 ++++++++++
 drivers/staging/pruss/pruss_core.h |  132 ++++++++++
 8 files changed, 783 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/pruss/Kconfig
 create mode 100644 drivers/staging/pruss/Makefile
 create mode 100644 drivers/staging/pruss/TODO
 create mode 100644 drivers/staging/pruss/pruss.c
 create mode 100644 drivers/staging/pruss/pruss.h
 create mode 100644 drivers/staging/pruss/pruss_core.h
drivers/staging/Kconfig +2 -0
index 5c8fcfc..9cbf201 100644
@@ -179,5 +179,7 @@ source "drivers/staging/cptm1217/Kconfig"
 
 source "drivers/staging/ste_rmi4/Kconfig"
 
+source "drivers/staging/pruss/Kconfig"
+
 endif # !STAGING_EXCLUDE_BUILD
 endif # STAGING
drivers/staging/Makefile +1 -0
index d538863..2296c34 100644
@@ -70,3 +70,4 @@ obj-$(CONFIG_SND_INTEL_SST)		+= intel_sst/
 obj-$(CONFIG_SPEAKUP)	+= speakup/
 obj-$(CONFIG_TOUCHSCREEN_CLEARPAD_TM1217)	+= cptm1217/
 obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4)	+= ste_rmi4/
+obj-$(CONFIG_MFD_DA8XX_PRUSS)	+= pruss/
drivers/staging/pruss/Kconfig new file +16 -0
new file mode 100644
index 0000000..f426b67
@@ -0,0 +1,16 @@
+#
+# TI's pruss staging drivers
+#
+
+menu "Texas Instruments pruss drivers"
+
+config MFD_DA8XX_PRUSS
+	tristate "Texas Instruments DA8XX PRUSS support"
+	depends on ARCH_DAVINCI_DA850
+	select MFD_CORE
+	help
+	  This driver provides support API for the programmable
+	  realtime unit (PRU) present on TI's da8xx processors. It
+	  provides basic read, write, config, enable, disable
+	  routines to facilitate devices emulated on it.
+endmenu
drivers/staging/pruss/Makefile new file +5 -0
new file mode 100644
index 0000000..a9c657b
@@ -0,0 +1,5 @@
+#
+# Makefile for TI's pruss drivers
+#
+
+obj-$(CONFIG_MFD_DA8XX_PRUSS) 		+= pruss.o
drivers/staging/pruss/TODO new file +14 -0
new file mode 100644
index 0000000..38a8ec7
@@ -0,0 +1,14 @@
+TODO:
+
+0. Functionality wise, everything works.
+
+1. Currently the plan is to add sysfs attributes for
+	a. prux/load
+	b. prux/unload
+	c. prux/run
+	d. prux/halt
+   These will add to a more dynamic firmware management for the PRU.
+
+2. But, not sure how the fdt will effect these entries.
+
+Please send patches to Greg Kroah-Hartman <[email protected]>.
drivers/staging/pruss/pruss.c new file +483 -0

483 lines not on this page · raw message

drivers/staging/pruss/pruss.h new file +130 -0

130 lines not on this page · raw message

drivers/staging/pruss/pruss_core.h new file +132 -0

132 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#0 lore raw

v5 cover pruss mfd drivers.

				PRUSS Functional Block Diagram
		/-------------------------------------------------------\
		|							|
		|			|------|			|
	32GPO<------->PRU CORE-0 <----->|      |<----> DRAM 0		|
	30GPI<------->(4KB IRAM)	|  S   |	(512 Bytes)	|
		|			|      |			|
	32GPO<------->PRU CORE-1 <----->|  C   |<----> DRAM 1		|
	30GPI<------->(4KB IRAM)	|      |	(512 Bytes)	|
		|			|  R   |			|
		|			|      |			|

Ints to ARM/ | Interrupt <---->| |-------------------------> Master I/F (to SCR2)
DSP INTC <------------->Controller | |<------------------------- Slave I/F (from SCR2)
Events from | (INTC) |------| |
Periph + PRUs | |

		\-------------------------------------------------------/

Programmable Realtime Unit (PRU) is basically a 32-bit RISC processor available within TI's DA8XX SOCs. It consists of local instruction and data RAM and also has access to SOC resources via a Switched Central Resource (SCR).

There are two PRU's available within DA8XX SOC's PRUSS, hence providing two execution cores. Devices/Protocols can be emulated on these utilizing either both or only one of the PRUs independently.

The rational behind the MFD driver being the fact that multiple devices can be implemented on the cores independently.
It's also possible, as in our case, to implement a single device on both the PRU's resulting in improved load sharing.

A detailed description is also available here:
http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit_Subsystem

version 5:
=========
MFD:
* Moved the MFD drivers into staging.
* Added v4 code comments.

version 4:
=========
MFD:
* added mfd_cells in the board file
* exported seperate multiwrite/read functions
* removed clk_get_pruss api
* improved coding style
* removed code duplications
* renamed files to pruss based
* used make C=1
* added __iomem cookie for io addresses
* used iowrite/read instead of __raw variants

SUART:
* changes for the new mfd_cell implementation
* code cleanup
* used iowrite/read instead of __raw variants
* used make C=1

NOTE:
* as requested by the owner the CAN driver patch is submitted seperately.

version 3:
=========
* added locking to mfd driver.
* removed typedefs.
* resource allocation through mfd.
* renamed da8xx_register_pruss to da8xx_register_pruss_mfd.
* removed da8xx_pruss directory for suart.
* combined all suart headers.
* modified register structure for pruss.
* added function clk_add_alias_mcasp.
* suart api layer cleanup.
* removed semaphore usage.
* updated to latest internal code base.
* removed __suart_err/dbg.

version 2:
==========
* added pruss TTY Soft-UART driver.
* added pruss Soft-UART board and platform changes.
* fixed previous review comments.
* reordered patch sequence.

version 1:
==========
* added pruss mfd driver.

Subhasish Ghosh (1):
drivers:staging:pruss: add pruss staging mfd driver.

 drivers/staging/Kconfig            |    2 +
 drivers/staging/Makefile           |    1 +
 drivers/staging/pruss/Kconfig      |   16 ++
 drivers/staging/pruss/Makefile     |    5 +
 drivers/staging/pruss/TODO         |   14 +
 drivers/staging/pruss/pruss.c      |  483 ++++++++++++++++++++++++++++++++++++
 drivers/staging/pruss/pruss.h      |  130 ++++++++++
 drivers/staging/pruss/pruss_core.h |  132 ++++++++++
 8 files changed, 783 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/pruss/Kconfig
 create mode 100644 drivers/staging/pruss/Makefile
 create mode 100644 drivers/staging/pruss/TODO
 create mode 100644 drivers/staging/pruss/pruss.c
 create mode 100644 drivers/staging/pruss/pruss.h
 create mode 100644 drivers/staging/pruss/pruss_core.h
Signature · 1 line
1.7.2.3
#2 lore raw

Re: [PATCH v5 1/1] drivers:staging:pruss: add pruss staging mfd driver.

In reply to Subhasish Ghosh
Quoted 12 lines · Subhasish Ghosh

This patch adds the pruss MFD driver and associated include files. For details regarding the PRUSS please refer the folowing link:
http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit_Subsystem

The rational behind the MFD driver being the fact that multiple devices can be implemented on the cores independently. This is determined by the nature of the program which is loaded into the PRU's instruction memory. A device may be de-initialized and another loaded or two different devices can be run simultaneously on the two cores.
It's also possible, as in our case, to implement a single device on both the PRU's resulting in improved load sharing.

Quoted 1 line

Please refresh my memory as to why this can't get merged into the "normal" part of the kernel?

drivers/staging/pruss/TODO line 10

Quoted 13 lines
drivers/staging/pruss/TODO new file +10 -0
@@ -0,0 +1,14 @@
+TODO:
+
+0. Functionality wise, everything works.
+
+1. Currently the plan is to add sysfs attributes for
+	a. prux/load
+	b. prux/unload
+	c. prux/run
+	d. prux/halt
+   These will add to a more dynamic firmware management for the PRU.

Why sysfs?

drivers/staging/pruss/TODO line 14

Quoted 4 lines
drivers/staging/pruss/TODO new file +4 -0
+
+2. But, not sure how the fdt will effect these entries.
+
+Please send patches to Greg Kroah-Hartman <[email protected]>.

Don't you want people to Cc: you as well?

I'm not going to adopt this driver, I have enough as it is :)

thanks,

greg k-h

#3 lore raw

Re: [PATCH v5 1/1] drivers:staging:pruss: add pruss staging mfd driver.

Quoted 13 lines · Greg KH
Quoted 12 lines · Subhasish Ghosh

This patch adds the pruss MFD driver and associated include files. For details regarding the PRUSS please refer the folowing link:
http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit_Subsystem

The rational behind the MFD driver being the fact that multiple devices can be implemented on the cores independently. This is determined by the nature of the program which is loaded into the PRU's instruction memory. A device may be de-initialized and another loaded or two different devices can be run simultaneously on the two cores.
It's also possible, as in our case, to implement a single device on both the PRU's resulting in improved load sharing.

Quoted 4 lines
Quoted 1 line

Please refresh my memory as to why this can't get merged into the "normal" part of the kernel?

Dropped from my queue due to lack of response :(

Please resend when you get the chance, and address the above comment in your changelog entry (and in your TODO file as well.)

thanks,

greg k-h

#4 lore raw

RE: [PATCH v5 1/1] drivers:staging:pruss: add pruss staging mfd driver.

Quoted 13 lines · Greg KH
Quoted 12 lines · Subhasish Ghosh
Quoted 12 lines

This patch adds the pruss MFD driver and associated include files. For details regarding the PRUSS please refer the folowing link:
http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit_Subsystem

The rational behind the MFD driver being the fact that multiple devices can be implemented on the cores independently. This is determined by the nature of the program which is loaded into the PRU's instruction memory. A device may be de-initialized and another loaded or two different devices can be run simultaneously on the two cores.
It's also possible, as in our case, to implement a single device on both the PRU's resulting in improved load sharing.

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

[MW] Greg, thanks for reviewing Mistral's patch submission. I have been following the traffic on their patches and will provide an initial response to address some of your questions.

Quoted 2 lines
Quoted 2 lines

Please refresh my memory as to why this can't get merged into the "normal" part of the kernel?

[MW] Arnd had recommended moving the driver to the staging area until all interfaces have stabilized. One of the main reasons it cannot currently be merged in the "normal" part of the kernel is the question of how firmware should be configured and loaded. (https://lkml.org/lkml/2011/5/24/230, https://lkml.org/lkml/2011/5/10/463)

Quoted 4 lines

Dropped from my queue due to lack of response :(

Please resend when you get the chance, and address the above comment in your changelog entry (and in your TODO file as well.)

[MW] Please let us know if Mistral still needs to resubmit their patch or if we can continue discussions on this submission.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/staging/pruss/TODO new file +4 -0
@@ -0,0 +1,14 @@
+TODO:
+
+0. Functionality wise, everything works.
+
Quoted 8 lines
Quoted 8 lines

drivers/staging/pruss/TODO line 10

Quoted 6 lines
drivers/staging/pruss/TODO new file +6 -0
+1. Currently the plan is to add sysfs attributes for
+	a. prux/load
+	b. prux/unload
+	c. prux/run
+	d. prux/halt
+   These will add to a more dynamic firmware management for the PRU.

Why sysfs?

[MW] Sysfs was discussed between Subhasish and Arnd in the following thread:
https://lkml.org/lkml/2011/5/5/137. Arnd had recommended three options for loading a firmware-- the third of which involved sysfs.

Quoted 8 lines
Quoted 8 lines

drivers/staging/pruss/TODO line 14

Quoted 4 lines
drivers/staging/pruss/TODO new file +4 -0
+
+2. But, not sure how the fdt will effect these entries.
+
+Please send patches to Greg Kroah-Hartman <[email protected]>.

Don't you want people to Cc: you as well?

I'm not going to adopt this driver, I have enough as it is :)

#5 lore raw

Re: [PATCH v5 1/1] drivers:staging:pruss: add pruss staging mfd driver.

Quoted 31 lines · Melissa
Quoted 13 lines · Greg KH
Quoted 12 lines · Subhasish Ghosh
Quoted 12 lines

This patch adds the pruss MFD driver and associated include files. For details regarding the PRUSS please refer the folowing link:
http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit_Subsystem

The rational behind the MFD driver being the fact that multiple devices can be implemented on the cores independently. This is determined by the nature of the program which is loaded into the PRU's instruction memory. A device may be de-initialized and another loaded or two different devices can be run simultaneously on the two cores.
It's also possible, as in our case, to implement a single device on both the PRU's resulting in improved load sharing.

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

[MW] Greg, thanks for reviewing Mistral's patch submission. I have been following the traffic on their patches and will provide an initial response to address some of your questions.

Quoted 2 lines
Quoted 2 lines

Please refresh my memory as to why this can't get merged into the "normal" part of the kernel?

[MW] Arnd had recommended moving the driver to the staging area until all interfaces have stabilized. One of the main reasons it cannot currently be merged in the "normal" part of the kernel is the question of how firmware should be configured and loaded.
(https://lkml.org/lkml/2011/5/24/230,
https://lkml.org/lkml/2011/5/10/463)

Quoted 7 lines
Quoted 4 lines

Dropped from my queue due to lack of response :(

Please resend when you get the chance, and address the above comment in your changelog entry (and in your TODO file as well.)

[MW] Please let us know if Mistral still needs to resubmit their patch or if we can continue discussions on this submission.

Please resend it, with the above information in the changelog and in the TODO file.

greg k-h