Skip to contentSkip to conversation

OMAP3: Registering sgx device and it's platform data

PATCH Superseded Manjunatha GK 3 participants 5 messages May 13, 2010 – May 20, 2010

Subsystems (3)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 OMAP3: Registering sgx device and it's platform data

The SGX powervr_device is registered with it's platform specific data to provide information about setting constraint through omap_pm_set_min_bus_tput.

Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Mike Turquette <[email protected]>
Cc Hemanth V <[email protected]>
---
 arch/arm/mach-omap2/devices.c                  |   21 +++++++++++++++++++--
 arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   11 +++++++++++
 2 files changed, 30 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/include/mach/omap_sgxdef.h
arch/arm/mach-omap2/devices.c +19 -2
index 2271b9b..6349ee5 100644
@@ -26,7 +26,7 @@
 #include <plat/mux.h>
 #include <mach/gpio.h>
 #include <plat/mmc.h>
-
+#include <mach/omap_sgxdef.h>
 #include "mux.h"
 
 #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
@@ -786,6 +786,23 @@ static inline void omap_hdq_init(void)
 static inline void omap_hdq_init(void) {}
 #endif
 
+struct sgx_platform_data omap_sgx_data = {
+	.set_min_bus_tput = NULL,
+};
+
+static struct platform_device powervr_device = {
+	.name            = "pvrsrvkm",
+	.id              = -1,
+	.dev            = {
+	.platform_data = &omap_sgx_data,
+       }
+};
+
+static void omap_init_sgx(void)
+{
+       (void) platform_device_register(&powervr_device);
+}
+
 /*-------------------------------------------------------------------------*/
 
 static int __init omap2_init_devices(void)
@@ -800,7 +817,7 @@ static int __init omap2_init_devices(void)
 	omap_hdq_init();
 	omap_init_sti();
 	omap_init_sha1_md5();
-
+	omap_init_sgx();
 	return 0;
 }
 arch_initcall(omap2_init_devices);
arch/arm/mach-omap2/include/mach/omap_sgxdef.h new file +11 -0
new file mode 100644
index 0000000..e03ad8b
@@ -0,0 +1,11 @@
+#ifndef OMAP_SGXDEF_H
+#define OMAP_SGXDEF_H
+
+#include <plat/omap-pm.h>
+
+struct sgx_platform_data {
+	void (*set_min_bus_tput)(struct device *dev, u8 agent_id,
+				unsigned long r);
+};
+
+#endif
Signature · 1 line
1.7.0.4
#1 lore raw

G, Manjunath Kondaiah had written, on 05/13/2010 12:06 AM, the following:

Quoted 54 lines

The SGX powervr_device is registered with it's platform specific data to provide information about setting constraint through omap_pm_set_min_bus_tput.

Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Mike Turquette <[email protected]>
Cc Hemanth V <[email protected]>
---
 arch/arm/mach-omap2/devices.c                  |   21 +++++++++++++++++++--
 arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   11 +++++++++++
 2 files changed, 30 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/include/mach/omap_sgxdef.h
arch/arm/mach-omap2/devices.c +18 -1
index 2271b9b..6349ee5 100644
@@ -26,7 +26,7 @@
 #include <plat/mux.h>
 #include <mach/gpio.h>
 #include <plat/mmc.h>
-
+#include <mach/omap_sgxdef.h>
 #include "mux.h"
 
 #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
@@ -786,6 +786,23 @@ static inline void omap_hdq_init(void)
 static inline void omap_hdq_init(void) {}
 #endif
 
+struct sgx_platform_data omap_sgx_data = {
+	.set_min_bus_tput = NULL,
+};
+
+static struct platform_device powervr_device = {
+	.name            = "pvrsrvkm",
+	.id              = -1,
+	.dev            = {
+	.platform_data = &omap_sgx_data,
+       }
+};
+
+static void omap_init_sgx(void)
+{
+       (void) platform_device_register(&powervr_device);
+}
+
 /*-------------------------------------------------------------------------*/
 
 static int __init omap2_init_devices(void)

arch/arm/mach-omap2/devices.c static int __init omap2_init_devices(void) · line 820

Quoted 5 lines
arch/arm/mach-omap2/devices.c +1 -1
@@ -800,7 +817,7 @@ static int __init omap2_init_devices(void)
 	omap_hdq_init();
 	omap_init_sti();
 	omap_init_sha1_md5();
-
+	omap_init_sgx();

should'nt we depend on has_sgx_feature?

Quoted 20 lines
arch/arm/mach-omap2/devices.c +0 -0
 	return 0;
 }
 arch_initcall(omap2_init_devices);
arch/arm/mach-omap2/include/mach/omap_sgxdef.h new file +11 -0
new file mode 100644
index 0000000..e03ad8b
@@ -0,0 +1,11 @@
+#ifndef OMAP_SGXDEF_H
+#define OMAP_SGXDEF_H
+
+#include <plat/omap-pm.h>
+
+struct sgx_platform_data {
+	void (*set_min_bus_tput)(struct device *dev, u8 agent_id,
+				unsigned long r);
+};
+
+#endif
Signature · 2 lines
Regards,
Nishanth Menon
#2 lore raw
Quoted 70 lines

-----Original Message-----
From: Menon, Nishanth
Sent: Thursday, May 13, 2010 9:02 PM
To: G, Manjunath Kondaiah
Cc: [email protected]; Agarwal, Preshit; Tony Lindgren; Kevin Hilman; Turquette, Mike; V, Hemanth
Subject: Re: [PATCH v4] OMAP3: Registering sgx device and it's platform data

G, Manjunath Kondaiah had written, on 05/13/2010 12:06 AM, the following:

Quoted 4 lines

The SGX powervr_device is registered with it's platform specific data to provide information about setting constraint through omap_pm_set_min_bus_tput.

Quoted 8 lines
Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Mike Turquette <[email protected]>
Cc Hemanth V <[email protected]>
---
 arch/arm/mach-omap2/devices.c                  |   21 

+++++++++++++++++++--

Review

Quoted 5 lines
 arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   11 +++++++++++
 2 files changed, 30 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/include/mach/omap_sgxdef.h
(quoted diff) +0 -0

b/arch/arm/mach-omap2/devices.c

arch/arm/mach-omap2/devices.c line 32

Quoted 12 lines

index 2271b9b..6349ee5 100644

arch/arm/mach-omap2/devices.c +1 -1
@@ -26,7 +26,7 @@
 #include <plat/mux.h>
 #include <mach/gpio.h>
 #include <plat/mmc.h>
-
+#include <mach/omap_sgxdef.h>
 #include "mux.h"
 
 #if defined(CONFIG_VIDEO_OMAP2) || 

defined(CONFIG_VIDEO_OMAP2_MODULE)

Quoted 12 lines
arch/arm/mach-omap2/devices.c +8 -0
@@ -786,6 +786,23 @@ static inline void omap_hdq_init(void)
 static inline void omap_hdq_init(void) {}
 #endif
 
+struct sgx_platform_data omap_sgx_data = {
+	.set_min_bus_tput = NULL,
+};
+
+static struct platform_device powervr_device = {
+	.name            = "pvrsrvkm",
+	.id              = -1,
+	.dev            = {

arch/arm/mach-omap2/devices.c static inline void omap_hdq_init(void) · line 806

Quoted 10 lines
arch/arm/mach-omap2/devices.c +9 -0
+	.platform_data = &omap_sgx_data,
+       }
+};
+
+static void omap_init_sgx(void)
+{
+       (void) platform_device_register(&powervr_device);
+}
+
 

/*------------------------------------------------------------ -------------*/

Quoted 1 line
Quoted 8 lines

arch/arm/mach-omap2/devices.c static int __init omap2_init_devices(void) · line 820

Quoted 7 lines

static int __init omap2_init_devices(void)

arch/arm/mach-omap2/devices.c +1 -1
@@ -800,7 +817,7 @@ static int __init omap2_init_devices(void)
 	omap_hdq_init();
 	omap_init_sti();
 	omap_init_sha1_md5();
-
+	omap_init_sgx();

should'nt we depend on has_sgx_feature?

I will change it to: "if (omap3_has_sgx) omap_init_sgx();"

-Manjunath

#3 lore raw
In reply to Manjunatha GK
Quoted 3 lines · Manjunatha GK

The SGX powervr_device is registered with it's platform specific data to provide information about setting constraint through omap_pm_set_min_bus_tput.

Now the patch content doesn't match the description as you no longer call omap_pm_set_min_bus_tput()...

Quoted 26 lines
Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Mike Turquette <[email protected]>
Cc Hemanth V <[email protected]>
---
 arch/arm/mach-omap2/devices.c                  |   21 +++++++++++++++++++--
 arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   11 +++++++++++
 2 files changed, 30 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/include/mach/omap_sgxdef.h
arch/arm/mach-omap2/devices.c +1 -1
index 2271b9b..6349ee5 100644
@@ -26,7 +26,7 @@
 #include <plat/mux.h>
 #include <mach/gpio.h>
 #include <plat/mmc.h>
-
+#include <mach/omap_sgxdef.h>
 #include "mux.h"
 
 #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)

arch/arm/mach-omap2/devices.c static inline void omap_hdq_init(void) · line 791

Quoted 6 lines
arch/arm/mach-omap2/devices.c +3 -0
@@ -786,6 +786,23 @@ static inline void omap_hdq_init(void)
 static inline void omap_hdq_init(void) {}
 #endif
 
+struct sgx_platform_data omap_sgx_data = {
+	.set_min_bus_tput = NULL,
+};

When I suggested you remove the #ifdef CONFIG_PM, I was expecting you to leave the omap_pm_set_min_bus_tput() part.

The point was that the driver itself should choose whether or not to call pdata->set_min_bus_tput() using #ifdef or other runtime decisions.

Kevin

#4 lore raw
Quoted 59 lines

-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Friday, May 14, 2010 10:10 PM
To: G, Manjunath Kondaiah
Cc: [email protected]; Agarwal, Preshit; Tony Lindgren; Turquette, Mike; V, Hemanth
Subject: Re: [PATCH v4] OMAP3: Registering sgx device and it's platform data

Quoted 3 lines · Manjunatha GK

The SGX powervr_device is registered with it's platform specific data to provide information about setting constraint through omap_pm_set_min_bus_tput.

Now the patch content doesn't match the description as you no longer call omap_pm_set_min_bus_tput()...

Quoted 8 lines
Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Mike Turquette <[email protected]>
Cc Hemanth V <[email protected]>
---
 arch/arm/mach-omap2/devices.c                  |   21 

+++++++++++++++++++--

Review

Quoted 5 lines
 arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   11 +++++++++++
 2 files changed, 30 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/include/mach/omap_sgxdef.h
(quoted diff) +0 -0

b/arch/arm/mach-omap2/devices.c

arch/arm/mach-omap2/devices.c line 32

Quoted 12 lines

index 2271b9b..6349ee5 100644

arch/arm/mach-omap2/devices.c +1 -1
@@ -26,7 +26,7 @@
 #include <plat/mux.h>
 #include <mach/gpio.h>
 #include <plat/mmc.h>
-
+#include <mach/omap_sgxdef.h>
 #include "mux.h"
 
 #if defined(CONFIG_VIDEO_OMAP2) || 

defined(CONFIG_VIDEO_OMAP2_MODULE)

arch/arm/mach-omap2/devices.c static inline void omap_hdq_init(void) · line 791

Quoted 7 lines
arch/arm/mach-omap2/devices.c +3 -0
@@ -786,6 +786,23 @@ static inline void omap_hdq_init(void)
 static inline void omap_hdq_init(void) {}
 #endif
 
+struct sgx_platform_data omap_sgx_data = {
+	.set_min_bus_tput = NULL,
+};

When I suggested you remove the #ifdef CONFIG_PM, I was expecting you to leave the omap_pm_set_min_bus_tput() part.

Quoted 3 lines

The point was that the driver itself should choose whether or not to call
pdata->set_min_bus_tput() using #ifdef or other runtime decisions.

I agree with your point. I will have only:
.set_min_bus_tput = omap_pm_set_min_bus_tput,

Let driver decide calling this using #ifdef or other runtime decisions.

-Manjunath