Re: [RFT/PATCH 05/10] cbus: retu: move to threaded IRQ and GENIRQ

2011-01-03 Thread Felipe Balbi

On Tue, Jan 04, 2011 at 09:46:15AM +0200, Felipe Balbi wrote:

@@ -593,6 +594,14 @@ static struct twl4030_platform_data sdp3430_twldata = {
   .vpll2  = &sdp3430_vpll2,
};
+static void __init sdp3430_twl_init(void)
+{
+   int irq_base = omap_irq_get_base();
+
+   sdp3430_twldata.irq_base = irq_base;
+   sdp3430_twldata.irq_end = irq_base + TWL4030_BASE_NR_IRQS;
+}
+
static struct i2c_board_info __initdata sdp3430_i2c_boardinfo[] = {
   {
   I2C_BOARD_INFO("twl4030", 0x48),


this hunk should be:

@@ -593,6 +594,16 @@ static struct twl4030_platform_data sdp3430_twldata = {
.vpll2  = &sdp3430_vpll2,
 };
 
+static void __init sdp3430_twl_init(void)

+{
+   int irq_base = omap_irq_get_base();
+
+   sdp3430_twldata.irq_base = irq_base;
+   sdp3430_twldata.irq_end = irq_base + TWL4030_BASE_NR_IRQS;
+
+   omap_irq_add(TWL4030_BASE_NR_IRQS);
+}
+
 static struct i2c_board_info __initdata sdp3430_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),

otherwise it won't work for other irq_chips

--
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFT/PATCH 05/10] cbus: retu: move to threaded IRQ and GENIRQ

2011-01-03 Thread Felipe Balbi

Hi,

On Tue, Jan 04, 2011 at 08:52:29AM +0200, Felipe Balbi wrote:

On Mon, Jan 03, 2011 at 05:40:02PM -0800, Tony Lindgren wrote:

* Felipe Balbi  [110102 23:49]:

@@ -53,23 +54,23 @@
struct retu {
/* Device lock */
spinlock_t  lock;
-   struct tasklet_struct   tasklet;
+   struct mutexirq_lock;
struct device   *dev;

+   int irq_base;
+   int nirqs;
int irq;


This one oopses, looks like irq_base is not initialized?


Aaa, good catch. Sorry for that. Gotta add a platform_data for passing
that around. Will do it on V2.


Looking into  it seems like there will be quite some
ifdeffery added to have support for Retu irq_base (and later Tahvo,
menelaus, ISP, etc etc); so, would you be willing to accept an atomic
counter to keep track of that ?

Something like the following:

static atomic_t omap_irq_base;

int omap_irq_get_base(void)
{
return atomic_read(&omap_irq_base);
}

void omap_irq_set_base(int base)
{
atomic_set(&omap_irq_base, base);
}

void omap_irq_add(int nirqs)
{
atomic_add(nirqs, &omap_irq_base);
}

void omap_irq_sub(int nirqs)
{
atomic_sub(nirqs, &omap_irq_base);
}

static int __init omap_irq_init(void)
{
atomic_set(&omap_irq_base, 0);

return 0;
}
postcore_initcall(omap_irq_init);

Then, INTC will always be the first one to call omap_irq_add():

diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 85bf8ca..3d91a11 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -224,6 +225,8 @@ void __init omap_init_irq(void)

set_irq_handler(i, handle_level_irq);
set_irq_flags(i, IRQF_VALID);
}
+
+   omap_irq_add(nr_of_irqs);
 }
 
 #ifdef CONFIG_ARCH_OMAP3


and when adding e.g. twl4030, we could:

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 3b39ef1..3ae342b 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 
+#include 

 #include 
 #include 
 #include 
@@ -571,8 +572,8 @@ static struct twl4030_codec_data sdp3430_codec = {
 };
 
 static struct twl4030_platform_data sdp3430_twldata = {

-   .irq_base   = TWL4030_IRQ_BASE,
-   .irq_end= TWL4030_IRQ_END,
+   .irq_base   = -EINVAL,  /* fixed up later */
+   .irq_end= -EINVAL,  /* fixed up later */
 
/* platform_data for children goes here */

.bci= &sdp3430_bci_data,
@@ -593,6 +594,14 @@ static struct twl4030_platform_data sdp3430_twldata = {
.vpll2  = &sdp3430_vpll2,
 };
 
+static void __init sdp3430_twl_init(void)

+{
+   int irq_base = omap_irq_get_base();
+
+   sdp3430_twldata.irq_base = irq_base;
+   sdp3430_twldata.irq_end = irq_base + TWL4030_BASE_NR_IRQS;
+}
+
 static struct i2c_board_info __initdata sdp3430_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
@@ -794,6 +803,7 @@ static struct omap_musb_board_data musb_board_data = {
 static void __init omap_3430sdp_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+   sdp3430_twl_init();
omap3430_i2c_init();
platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
if (omap_rev() > OMAP3430_REV_ES1_0)

either that, or we add several ifdefs to  and maintain that
over time. What do you think ?

--
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1 09/10] OMAP: McBSP: use omap_device APIs to modify SYSCONFIG

2011-01-03 Thread Peter Ujfalusi
Hi,

On 12/21/10 09:40, ext Kishon Vijay Abraham I wrote:
> McBSP2/3 in OMAP3 has sidetone feature which requires autoidle
> to be disabled before starting the sidetone. Also SYSCONFIG
> register has to be set with smart idle or no idle depending on the
> dma op mode (threshold or element sync). For doing these operations
> dynamically at runtime, omap_device APIs are used to modify SYSCONFIG 
> register.
> 
> Signed-off-by: Kishon Vijay Abraham I 


>  static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp)
>  {
> + struct omap_device *od;
> +
> + od = find_omap_device_by_dev(mcbsp->dev);
>   /*
>* Enable wakup behavior, smart idle and all wakeups
>* REVISIT: some wakeups may be unnecessary
>*/
>   if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
> - u16 syscon;
> -
> - syscon = MCBSP_READ(mcbsp, SYSCON);
> - syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03));
> -
> - if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) {
> - syscon |= (ENAWAKEUP | SIDLEMODE(0x02) |
> - CLOCKACTIVITY(0x02));
> - MCBSP_WRITE(mcbsp, WAKEUPEN, XRDYEN | RRDYEN);
> - } else {
> - syscon |= SIDLEMODE(0x01);
> - }
> -
> - MCBSP_WRITE(mcbsp, SYSCON, syscon);
> + if (mcbsp->dma_op_mode != MCBSP_DMA_MODE_THRESHOLD)
> + omap_device_noidle(od);

Should you configure McBSP to SMART_IDLE, when the THRESHOLD mode is
selected?
While we are here:
1. How we select the WAKE events from McBSP?
   We need XRDYEN, and RRDYEN bits for wake (in WAKEUPEN register), and
   also we need to enable the WAKEUP in SYSCON register.
2. How we are configuring the CLOCKACTIVITY field in SYSCON register?

-- 
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


I2C Touchscreen OMAP OOPS

2011-01-03 Thread David Lynch Jr.
I am trying to get a vendor provided I2C touchscreen driver working with
android froyo with a 2.6.32 linux kernel for a client. I have fixed alot
of things and I am down to one serious problem remaining. 

The driver is oops'ing reading the touchscreen data in omap_i2c_xfer.
I tried to figure out what was going on by printk tracing omap_i2c_xfer,
but the problem goes away - mostly with a few judiciously inserted
printk's

I tried backporting the 2.6.37 i2c-omap code, but that does nto change
behavior. 

What is "scheduling while atomic" ? and what am I trying to look for ?
Is the root of this problem in the touchscreen driver ? omap_i2c or
should I be looking elsewhere ?


r...@beagleboard:~# evtest /dev/input/event1
Input driver version is 1.0.0evdev.c(EVIOCGBIT): Suspicious buffer size
511, limiting output to 64 bytes. See
http://userweb.kernel.org/~dtor/eviocgbit-bug.html

Input device ID: bus 0x18 vendor 0xdead product 0x534 version 0x1
Input device name: "sitronix_ts"
Supported events:
  Event type 0 (Sync)
  Event type 1 (Key)
Event code 330 (Touch)
  Event type 3 (Absolute)
Event code 0 (X)
  Value  0
  Min0
  Max  480
Event code 1 (Y)
  Value  0
  Min0
  Max  256
Testing ... (interrupt to exit)
BUG: scheduling while atomic: swapper/0/0x00010003
Unable to handle kernel NULL pointer dereference at virtual address

pgd = c0004000
[] *pgd=
Internal error: Oops: 8007 [#1] PREEMPT
last sysfs
file: 
/sys/devices/platform/mmci-omap-hs.0/mmc_host/mmc0/mmc0:/block/mmcblk0/size
Modules linked in:
CPU: 0Not tainted  (2.6.32 #98)
PC is at 0x0
LR is at enqueue_task+0x28/0x34
pc : [<>]lr : []psr: 2193
sp : c04dbc30  ip : 0016  fp : c04dbc44
r10:   r9 :   r8 : 0002
r7 :   r6 :   r5 : c04e8cc8  r4 : c04dcfa8
r3 :   r2 : 0001  r1 : c04dcfa8  r0 : c04e8cc8
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 8c8c8019  DAC: 0017

LR: 0xc005aa2c:
aa2c  e8bd8800 e92d4800 e59100c4 e28db004 e352 03ac 13a0
e8bd8800
aa4c  e92d48f0 e1c040d0 e1a06002 e1a07003 e0566004 e0c77005 e28db014
e1a021a6
aa6c  e1a031c7 e1822e87 e0944002 e0a55003 e1c040f0 e8bd88f0 e352
e92d48d8
aa8c  e1a04001 e28db014 11c165d8 11c168f8 e5943028 e1a01004 e5933004
e12fff33
aaac  e3a03001 e584304c e8bd88d8 e92d4b78 e2525000 e28db01c e1a06000
e1a04001
aacc  0a10 e1c127d0 e1921003 0a08 e1c485d8 e2840078 e0582002
e0c93003
aaec  ebd6 e3a02000 e3a03000 e1c427f0 ea04 e59f3030 e2840090
e5932000
ab0c  e3a03000 ebcd e5943028 e1a6 e1a01004 e1a02005 e5933008
e12fff33

SP: 0xc04dbbb0:
bbb0  000f 0010  30303033 0031  

bbd0    c04dbc1c   c0034bf0 c04e8cc8
c04dcfa8
bbf0  0001  c04dcfa8 c04e8cc8   0002

bc10   c04dbc44 0016 c04dbc30 c005aaac  2193

bc30   c04e8cc8  c04da000 c04dbc54 c005ab70 
c04dcfa8
bc50  c04dbc7c c005e9b8 c044d812 8193 c05257f0 cf91e010 0001
cf91e01c
bc70  0001 0003 c04dbca4 c005aef0  0113 1004

bc90  0039 0001 601f c04e92d4 c04dbcbc c005cf14 
35303135

FP: 0xc04dbbc4:
bbc4       c04dbc1c 

bbe4  c0034bf0 c04e8cc8 c04dcfa8 0001  c04dcfa8 c04e8cc8

bc04   0002   c04dbc44 0016 c04dbc30
c005aaac
bc24   2193   c04e8cc8  c04da000
c04dbc54
bc44  c005ab70  c04dcfa8 c04dbc7c c005e9b8 c044d812 8193
c05257f0
bc64  cf91e010 0001 cf91e01c 0001 0003 c04dbca4 c005aef0

bc84  0113 1004  0039 0001 601f c04e92d4
c04dbcbc
bca4  c005cf14  35303135 63303536 cf91e000 c04dbdec c024626c
cf85bb00

R0: 0xc04e8c48:
8c48        

8c68      000f4240 000f4240 000f4240
004c4b40
8c88  004c4b40 000f4240 0003d090 0003d090 0001 c04e8c9c c04e8c9c
000f4240
8ca8  000e7ef0 0001 c04e8cb0 c04e8cb0 cc901b18 c0525278 0004
0001
8cc8    0070 0176 018b 013b 

8ce8   268a 9fd5    

8d08    cd9c987c 0008   c04e8d20
c04e8d20
8d28       c04e8cc8 


R1: 0xc04dcf28:
cf28  c01bf6e4 c037cf08 c01bf70c c037cf10 c01bf748 c037cf18 c01da958
c037cf20
cf48  c01da968 c037cf28 c02a4854 c037cf30 c02a4924 c037cf38 c02a4a84
c037cf40
cf68  c02a4bdc c037cf48 c02a4d00 c037cf50 c02a4dd0 c037cf58 c02a4f40
c037cf60
cf88  c02a50ac c037cf68 c02c74b0 c037cf70 c02c7a84 c037cf78 c02c7aa0
c037cf80
cfa8  0002 c04da000 0002 00

Re: [RFT/PATCH 05/10] cbus: retu: move to threaded IRQ and GENIRQ

2011-01-03 Thread Felipe Balbi

On Mon, Jan 03, 2011 at 05:40:02PM -0800, Tony Lindgren wrote:

* Felipe Balbi  [110102 23:49]:

@@ -53,23 +54,23 @@
 struct retu {
/* Device lock */
spinlock_t  lock;
-   struct tasklet_struct   tasklet;
+   struct mutexirq_lock;
struct device   *dev;

+   int irq_base;
+   int nirqs;
int irq;


This one oopses, looks like irq_base is not initialized?


Aaa, good catch. Sorry for that. Gotta add a platform_data for passing
that around. Will do it on V2.

--
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFT/PATCH 01/10] cbus: retu: give it a context structure

2011-01-03 Thread Felipe Balbi

On Mon, Jan 03, 2011 at 05:40:16PM -0800, Tony Lindgren wrote:

* Felipe Balbi  [110102 23:49]:

This is pretty much a cleanup patch just
adding a context structure for Retu, to avoid
all the globals it had.

Note that this breaks retu-user.c due to moving
the lock around, but that retu-user.c has to
go anyway as it's completely non-standard way
of accessing Retu children.


FYI, this one alone fails to compile with:


Yeah, there's a note on commit log about it. Anyway, I don't know what I
had in mind, I'll drop retu-user.c before this patch and there won't be
problems.

--
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 01/32] arm/omap: use system_wq in mailbox

2011-01-03 Thread Tejun Heo
Hello,

On Mon, Jan 03, 2011 at 03:35:45PM -0600, Kanigeri, Hari wrote:
> This was changed to dedicated work queue because of performance issues
> when there is heavy mailbox traffic between the cores.
> 
> Reference:
> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg24240.html

Using dedicated workqueue or system_wq doesn't make any difference in
terms of execution latency anymore.  Sleeping work items no longer
delay execution of other work items.  If mailbox is very latency
sensitive, it might make sense to create a HIGHPRI workqueue but that
usually isn't necessary.

Thank you.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] OMAP2+: hwmod: incorrect computation of autoidle_mask

2011-01-03 Thread DebBarma, Tarun Kanti
Benoit,
> -Original Message-
> From: Cousson, Benoit
> Sent: Monday, January 03, 2011 8:12 PM
> To: DebBarma, Tarun Kanti
> Cc: linux-omap@vger.kernel.org
> Subject: Re: [PATCH] OMAP2+: hwmod: incorrect computation of autoidle_mask
> 
> Hi Tarun,
> 
> On 1/3/2011 10:59 PM, DebBarma, Tarun Kanti wrote:
> > Autoidle is just a single bit setting across OMAP platforms.
> > In _set_module_autoidle() I am seeing 0x3 where the mask is
> > computed. I believe this should be 0x1.
> 
> Just a minor comment; it looks from this description that you are not
> 100% sure it is a bug :-)
> You need to refer to the various TRMs, stating that this is indeed a bug
> for all OMAPs!
Ok, I will make the change.
> 
> Adding a "fix" in the subject seems more accurate to describe the patch.
> OMAP2+: Fix incorrect computation of autoidle_mask
Yes, I will make the change.

> 
> Since is it harmless for the moment, I think it will probably go for
> 2.6.39.
> 
> > Baseline:
> > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
> >
> > Tested Info:
> > Boot tested on OMAP 2/3/4.
> >
> > Signed-off-by: Tarun Kanti DebBarma
> > Acked-by: Rajendra Nayak
> 
> Acked-by: Benoit Cousson 
> 
> 
> Thanks,
> Benoit
> 
> > ---
> >   arch/arm/mach-omap2/omap_hwmod.c |2 +-
> >   1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-
> omap2/omap_hwmod.c
> > index 5a30658..da49b56 100644
> > --- a/arch/arm/mach-omap2/omap_hwmod.c
> > +++ b/arch/arm/mach-omap2/omap_hwmod.c
> > @@ -373,7 +373,7 @@ static int _set_module_autoidle(struct omap_hwmod
> *oh, u8 autoidle,
> > }
> >
> > autoidle_shift = oh->class->sysc->sysc_fields->autoidle_shift;
> > -   autoidle_mask = (0x3<<  autoidle_shift);
> > +   autoidle_mask = (0x1<<  autoidle_shift);
> >
> > *v&= ~autoidle_mask;
> > *v |= autoidle<<  autoidle_shift;

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 07/17] OMAP2,3: DSS2: Build omap_device for each DSS HWIP

2011-01-03 Thread Tony Lindgren
* Guruswamy Senthilvadivu  [110103 04:51]:
> + char *omap2_oh_name[] = { "dss_dss", "dss_dispc", "dss_rfbi",
> + "dss_venc" };
> + char *omap3_oh_name[] = { "dss_dss", "dss_dispc", "dss_rfbi",
> + "dss_venc", "dss_dsi1" };
> + char *omap2_dev_name[] = { "omap_dss", "omap_dispc", "omap_rfbi",
> + "omap_venc" };
> + char *omap3_dev_name[] = { "omap_dss", "omap_dispc", "omap_rfbi",
> + "omap_venc", "omap_dsi1" };
> + char *(*oh_name)[];
> + char *(*dev_name)[];
> + int oh_count;
> +
> + if (cpu_is_omap24xx()) {
> + oh_name = &omap2_oh_name;
> + dev_name = &omap2_dev_name;
> + oh_count = ARRAY_SIZE(omap2_oh_name);
> + } else {
> + oh_name = &omap3_oh_name;
> + dev_name = &omap3_dev_name;
> + oh_count = ARRAY_SIZE(omap3_oh_name);
> + }

Here it looks like you don't need to repeat the common names
"dss_dss", "dss_dispc", "dss_rfbi". Instead you can have a
common char *omap_oh_name[5] then set oh_count smaller based
on the omap type.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 1/4] TI816X: Update common omap platform files

2011-01-03 Thread Tony Lindgren
* Paul Walmsley  [110103 15:06]:
> Hello Hemant 
> 
> On Mon, 3 Jan 2011, Hemant Pedanekar wrote:
> 
> > This patch updates the common platform files with TI816X support. Also adds 
> > new
> > files for TI816X modules base addresseses and irq definitions.
> > 
> > The approach taken in this patch is to add TI816X as part of OMAP3 variant 
> > where
> > the cpu class is considered as OMAP34XX and the type is TI816X. This means, 
> > both
> > cpu_is_omap34xx() and cpu_is_ti816x() checks return success on TI816X.
> 
> Looks like you should add a CONFIG_ARCH_OMAPTI816X Kconfig option for this 
> chip.  I suspect that many handheld device manufacturers won't want to 
> include TI816X-specific code/data in their builds, and vice versa.

Please use CONFIG_SOC_OMAPTI816X instead, eventually we should use
CONFIG_ARCH_OMAPX only for something that requires different compiler
options.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFT/PATCH 01/10] cbus: retu: give it a context structure

2011-01-03 Thread Tony Lindgren
* Felipe Balbi  [110102 23:49]:
> This is pretty much a cleanup patch just
> adding a context structure for Retu, to avoid
> all the globals it had.
> 
> Note that this breaks retu-user.c due to moving
> the lock around, but that retu-user.c has to
> go anyway as it's completely non-standard way
> of accessing Retu children.

FYI, this one alone fails to compile with:

drivers/cbus/retu-user.c: In function 'retu_user_write_with_mask':
drivers/cbus/retu-user.c:208: error: 'retu_lock' undeclared (first use in this 
function)
drivers/cbus/retu-user.c:208: error: (Each undeclared identifier is reported 
only once
drivers/cbus/retu-user.c:208: error: for each function it appears in.)

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFT/PATCH 05/10] cbus: retu: move to threaded IRQ and GENIRQ

2011-01-03 Thread Tony Lindgren
* Felipe Balbi  [110102 23:49]:
> @@ -53,23 +54,23 @@
>  struct retu {
>   /* Device lock */
>   spinlock_t  lock;
> - struct tasklet_struct   tasklet;
> + struct mutexirq_lock;
>   struct device   *dev;
>  
> + int irq_base;
> + int nirqs;
>   int irq;

This one oopses, looks like irq_base is not initialized?

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 2/4] TI816X: Update common OMAP machine specific sources

2011-01-03 Thread Paul Walmsley
On Mon, 3 Jan 2011, Hemant Pedanekar wrote:

> Note2: The optimized irq macro for omap3 skips checking the 4th irq status
> register but this needs to be added for TI816X (interrupts 96 to 127).
> Presently, only the multi-omap irq macro (unoptimized) is updated to check the
> 4th status register.

Sounds like you should either add an #ifdef CONFIG_ARCH_OMAPTI816X (or 
whatever macro name you use) to the optimized version to check the fourth 
ISR.  Either that, or add code to force a MULTI_OMAP build when compiling 
for this chip.  Otherwise if someone builds an "optimized", non-multi-OMAP 
kernel for this chip, they'll be pretty surprised when it misses 
interrupts from that fourth bank.


- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 1/4] TI816X: Update common omap platform files

2011-01-03 Thread Paul Walmsley
Hello Hemant 

On Mon, 3 Jan 2011, Hemant Pedanekar wrote:

> This patch updates the common platform files with TI816X support. Also adds 
> new
> files for TI816X modules base addresseses and irq definitions.
> 
> The approach taken in this patch is to add TI816X as part of OMAP3 variant 
> where
> the cpu class is considered as OMAP34XX and the type is TI816X. This means, 
> both
> cpu_is_omap34xx() and cpu_is_ti816x() checks return success on TI816X.

Looks like you should add a CONFIG_ARCH_OMAPTI816X Kconfig option for this 
chip.  I suspect that many handheld device manufacturers won't want to 
include TI816X-specific code/data in their builds, and vice versa.


- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] OMAP: TWL: sparse fixes

2011-01-03 Thread Nishanth Menon

Russell King - ARM Linux had written, on 01/03/2011 04:36 PM, the following:

On Mon, Jan 03, 2011 at 12:58:28PM -0600, Nishanth Menon wrote:

Source:
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
branch: omap-for-linus

Doing a rm arch/arm/mach-omap2/*.o;make C=1 arch/arm/mach-omap2/
resulted in the following sparse warnings:
http://pastebin.mozilla.org/907954


FYI, you may like to try:

make C=2 arch/arm/mach-omap2/

instead of the two-step process:
| Do a kernel make with "make C=1" to run sparse on all the C files that get
| recompiled, or use "make C=2" to run sparse on the files whether they need to
| be recompiled or not.  The latter is a fast way to check the whole tree if you
| have already built it.

Gee thanks. /me should update my old bash aliases :D

--
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] OMAP: TWL: sparse fixes

2011-01-03 Thread Russell King - ARM Linux
On Mon, Jan 03, 2011 at 12:58:28PM -0600, Nishanth Menon wrote:
> Source:
> git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
> branch: omap-for-linus
> 
> Doing a rm arch/arm/mach-omap2/*.o;make C=1 arch/arm/mach-omap2/
> resulted in the following sparse warnings:
> http://pastebin.mozilla.org/907954

FYI, you may like to try:

make C=2 arch/arm/mach-omap2/

instead of the two-step process:
| Do a kernel make with "make C=1" to run sparse on all the C files that get
| recompiled, or use "make C=2" to run sparse on the files whether they need to
| be recompiled or not.  The latter is a fast way to check the whole tree if you
| have already built it.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 01/32] arm/omap: use system_wq in mailbox

2011-01-03 Thread Kanigeri, Hari
Tejun,

On Mon, Jan 3, 2011 at 7:49 AM, Tejun Heo  wrote:
> With cmwq, there's no reason to use a separate workqueue for mailbox.
> Use the system_wq instead.  mbox->rxq->work is sync flushed in
> omap_mbox_fini() to make sure it's not running on any cpu, which makes
> sure that no mbox work is running when omap_mbox_exit() is entered.
>
> Signed-off-by: Tejun Heo 
> Cc: Tony Lindgren 
> Cc: linux-omap@vger.kernel.org
> ---
> Only compile tested.  Please feel free to take it into the subsystem
> tree or simply ack - I'll route it through the wq tree.

This was changed to dedicated work queue because of performance issues
when there is heavy mailbox traffic between the cores.

Reference:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg24240.html


>
> Thanks.
>
>  arch/arm/plat-omap/mailbox.c |   10 ++
>  1 files changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
> index d2fafb8..5bc4d7b 100644
> --- a/arch/arm/plat-omap/mailbox.c
> +++ b/arch/arm/plat-omap/mailbox.c
> @@ -31,7 +31,6 @@
>
>  #include 
>
> -static struct workqueue_struct *mboxd;
>  static struct omap_mbox **mboxes;
>  static bool rq_full;
>
> @@ -186,7 +185,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
>        /* no more messages in the fifo. clear IRQ source. */
>        ack_mbox_irq(mbox, IRQ_RX);
>  nomem:
> -       queue_work(mboxd, &mbox->rxq->work);
> +       schedule_work(&mbox->rxq->work);
>  }
>
>  static irqreturn_t mbox_interrupt(int irq, void *p)
> @@ -291,7 +290,7 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
>  {
>        free_irq(mbox->irq, mbox);
>        tasklet_kill(&mbox->txq->tasklet);
> -       flush_work(&mbox->rxq->work);
> +       flush_work_sync(&mbox->rxq->work);
>        mbox_queue_free(mbox->txq);
>        mbox_queue_free(mbox->rxq);
>
> @@ -385,10 +384,6 @@ static int __init omap_mbox_init(void)
>        if (err)
>                return err;
>
> -       mboxd = create_workqueue("mboxd");
> -       if (!mboxd)
> -               return -ENOMEM;
> -
>        /* kfifo size sanity check: alignment and minimal size */
>        mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t));
>        mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size, 
> sizeof(mbox_msg_t));
> @@ -399,7 +394,6 @@ subsys_initcall(omap_mbox_init);
>
>  static void __exit omap_mbox_exit(void)
>  {
> -       destroy_workqueue(mboxd);
>        class_unregister(&omap_mbox_class);
>  }
>  module_exit(omap_mbox_exit);
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Thank you,
Best regards,
Hari Kanigeri
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 1/3] ARM: add CPPI 4.1 DMA support

2011-01-03 Thread Felipe Balbi

Hi,

On Mon, Jan 03, 2011 at 05:19:45PM +, Russell King - ARM Linux wrote:

   Frankly speaking, I doubt that drivers/dma/ will have place for the
purely MUSB specific DMA engines such as the named ones (there's no TUSB
DMA BTW -- it uses OMAP DMA).


Long term, we need to kill off all these platform private DMA interfaces.
There's a growing amount of IP that's being shared not only between ARM
silicon vendors, but also across architectures, and having to re-implement
drivers because the underlying DMA engine is different is not feasible.

For example, we're seeing ARMs primecells being used with various
different DMA controllers in various different ARM SoCs.  I've heard
rumours of them appearing in MIPS or PPC stuff as well.  We're seeing
PXA peripheral IP appearing in x86 stuff too.

We can't have drivers tied to their SoC DMA engines, and we can't continue
having SoC DMA engines implementing their own unique APIs.  We do need to
get on top of this before it becomes a major problem (if it hasn't
already).

The DMA engine API is still evolving, and should not be taken as concrete
- I've recently been bringing up a number of points with Dan on various
aspects of the API, some of which ultimately will lead to changes to the
async-tx API, and others which hopefully will mean that the DMA slave
API is better documented.


I couldn't agree more with you Russell. If the API isn't enough
currently, we can always propose an extension.

Having all sorts of SoC-specific "APIs" has already caused enough
problems and it still does (non-generic IRQ handling on
twl?030, menelaus, cbus - which isn't in mainline yet -, etc,
non-generic McBSP usage, non-generic GPMC usage, etc etc). So, if we can
plan for making use of generic APIs, let's do so.

--
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 1/3] ARM: add CPPI 4.1 DMA support

2011-01-03 Thread Felipe Balbi

Hi,

On Mon, Jan 03, 2011 at 10:45:35PM +0530, Gupta, Ajay Kumar wrote:

> Moreover, even Felipe also seems to move other musb
> DMAs (Inventra, CPPI3.0, TUSB) to drivers/dma.

Frankly speaking, I doubt that drivers/dma/ will have place for the
purely MUSB specific DMA engines such as the named ones (there's no TUSB
DMA BTW it uses OMAP DMA).

I think we will get more clarity once we start on this activity.


I agree, but I personally don't see that many limiting factors.
dmaengine is just a generic API for doing DMA transfers. If it's not
enough for us currently, we extend it.

--
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] OMAP3+: sr_device: include pm header

2011-01-03 Thread Nishanth Menon
omap_enable_smartreflex_on_init is meant to be used by boards
which would like to have SR enabled by default on the platform, while
omap_devinit_smartreflex is used by pm code, the protos are defined
in pm.h. This header should be included to ensure that sr_device
function definitions match the prototypes.

including pm.h fixes the sparse warnings (with CONFIG_OMAP_SMARTREFLEX=y):
arch/arm/mach-omap2/sr_device.c:138:13: warning: symbol 
'omap_enable_smartreflex_on_init' was not declared. Should it be static?
arch/arm/mach-omap2/sr_device.c:143:12: warning: symbol 
'omap_devinit_smartreflex' was not declared. Should it be static?

Signed-off-by: Nishanth Menon 
---
Based on:
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
branch: omap-for-linus

 arch/arm/mach-omap2/sr_device.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index 786d685..b1e0af1 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -27,6 +27,7 @@
 #include 
 
 #include "control.h"
+#include "pm.h"
 
 static bool sr_enable_on_init;
 
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ETM: Fix etm_probe and etb_probe section mismatch warnings in arch/arm/kernel/etm.c

2011-01-03 Thread Tony Lindgren
Hi,

* Elvis Dowson  [101226 13:26]:
> Hi,
>This patch fixes section mismatch warnings for etm_probe() and 
> etb_probe() for linux-2.6.37-rc7.

This you should resend to linux-arm-kernel.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] OMAP: TWL: sparse fixes

2011-01-03 Thread Nishanth Menon
Source:
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
branch: omap-for-linus

Doing a rm arch/arm/mach-omap2/*.o;make C=1 arch/arm/mach-omap2/
resulted in the following sparse warnings:
http://pastebin.mozilla.org/907954

This series fixes the twl warnings
Nishanth Menon (2):
  OMAP2+: TWL: make conversion routines static
  OMAP2+: TWL: include pm header for init protos

 arch/arm/mach-omap2/omap_twl.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] OMAP2+: TWL: include pm header for init protos

2011-01-03 Thread Nishanth Menon
twl_init functions are declared in pm.h and used in pm.c
pm.h header defining the protos need to be included to
ensure that omap_twl.c has consistent function definition.
This fixes sparse warning:
arch/arm/mach-omap2/omap_twl.c:237:12: warning: symbol 'omap4_twl_init' was not 
declared. Should it be static?
arch/arm/mach-omap2/omap_twl.c:256:12: warning: symbol 'omap3_twl_init' was not 
declared. Should it be static?

Signed-off-by: Nishanth Menon 
---
 arch/arm/mach-omap2/omap_twl.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c
index 65ab4e3..00e1d2b 100644
--- a/arch/arm/mach-omap2/omap_twl.c
+++ b/arch/arm/mach-omap2/omap_twl.c
@@ -20,6 +20,8 @@
 
 #include 
 
+#include "pm.h"
+
 #define OMAP3_SRI2C_SLAVE_ADDR 0x12
 #define OMAP3_VDD_MPU_SR_CONTROL_REG   0x00
 #define OMAP3_VDD_CORE_SR_CONTROL_REG  0x01
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] OMAP2+: TWL: make conversion routines static

2011-01-03 Thread Nishanth Menon
The uv_to_vsel, vsel_to_uv functions don't need to be exposed to the
world as they are used as function pointers. make them static.

Fixes sparse warnings:
arch/arm/mach-omap2/omap_twl.c:63:15: warning: symbol 'twl4030_vsel_to_uv' was 
not declared. Should it be static?
arch/arm/mach-omap2/omap_twl.c:68:4: warning: symbol 'twl4030_uv_to_vsel' was 
not declared. Should it be static?
arch/arm/mach-omap2/omap_twl.c:73:15: warning: symbol 'twl6030_vsel_to_uv' was 
not declared. Should it be static?
arch/arm/mach-omap2/omap_twl.c:105:4: warning: symbol 'twl6030_uv_to_vsel' was 
not declared. Should it be static?

Signed-off-by: Nishanth Menon 
---
 arch/arm/mach-omap2/omap_twl.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c
index 15f8c6c..65ab4e3 100644
--- a/arch/arm/mach-omap2/omap_twl.c
+++ b/arch/arm/mach-omap2/omap_twl.c
@@ -60,17 +60,17 @@ static u8 smps_offset;
 
 #define REG_SMPS_OFFSET 0xE0
 
-unsigned long twl4030_vsel_to_uv(const u8 vsel)
+static unsigned long twl4030_vsel_to_uv(const u8 vsel)
 {
return (((vsel * 125) + 6000)) * 100;
 }
 
-u8 twl4030_uv_to_vsel(unsigned long uv)
+static u8 twl4030_uv_to_vsel(unsigned long uv)
 {
return DIV_ROUND_UP(uv - 60, 12500);
 }
 
-unsigned long twl6030_vsel_to_uv(const u8 vsel)
+static unsigned long twl6030_vsel_to_uv(const u8 vsel)
 {
/*
 * In TWL6030 depending on the value of SMPS_OFFSET
@@ -102,7 +102,7 @@ unsigned long twl6030_vsel_to_uv(const u8 vsel)
return vsel - 1) * 125) + 6000)) * 100;
 }
 
-u8 twl6030_uv_to_vsel(unsigned long uv)
+static u8 twl6030_uv_to_vsel(unsigned long uv)
 {
/*
 * In TWL6030 depending on the value of SMPS_OFFSET
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 4/4] TI816X: Add low level debug support

2011-01-03 Thread Hemant Pedanekar
This patch adds support for low level debugging on TI816X boards. Currently the
support for UART3 console on TI816X EVM is added.

Signed-off-by: Hemant Pedanekar 
---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 
 arch/arm/plat-omap/include/plat/serial.h   |3 +++
 arch/arm/plat-omap/include/plat/uncompress.h   |7 +++
 3 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S 
b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 6a4d413..e1b0f17 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -69,6 +69,12 @@ omap_uart_lsr:   .word   0
beq 34f @ configure OMAP3UART4
cmp \rp, #OMAP4UART4@ only on 44xx
beq 44f @ configure OMAP4UART4
+   cmp \rp, #TI816XUART1   @ ti816x UART offsets different
+   beq 81f @ configure UART1
+   cmp \rp, #TI816XUART2   @ ti816x UART offsets different
+   beq 82f @ configure UART2
+   cmp \rp, #TI816XUART3   @ ti816x UART offsets different
+   beq 83f @ configure UART3
cmp \rp, #ZOOM_UART @ only on zoom2/3
beq 95f @ configure ZOOM_UART
 
@@ -91,6 +97,12 @@ omap_uart_lsr:   .word   0
b   98f
 44:mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
b   98f
+81:mov \rp, #UART_OFFSET(TI816X_UART1_BASE)
+   b   98f
+82:mov \rp, #UART_OFFSET(TI816X_UART2_BASE)
+   b   98f
+83:mov \rp, #UART_OFFSET(TI816X_UART3_BASE)
+   b   98f
 95:ldr \rp, =ZOOM_UART_BASE
mrc p15, 0, \rv, c1, c0
tst \rv, #1 @ MMU enabled?
diff --git a/arch/arm/plat-omap/include/plat/serial.h 
b/arch/arm/plat-omap/include/plat/serial.h
index 3c3c319..4102bf4 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -86,6 +86,9 @@
 #define OMAP4UART2 OMAP2UART2
 #define OMAP4UART3 43
 #define OMAP4UART4 44
+#define TI816XUART181
+#define TI816XUART282
+#define TI816XUART383
 #define ZOOM_UART  95  /* Only on zoom2/3 */
 
 /* This is only used by 8250.c for omap1510 */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index ad98b85..30b891c 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -93,6 +93,10 @@ static inline void flush(void)
 #define DEBUG_LL_ZOOM(mach)\
_DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
 
+#define DEBUG_LL_TI816X(p, mach)   \
+   _DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT,   \
+   TI816XUART##p)
+
 static inline void __arch_decomp_setup(unsigned long arch_id)
 {
int port = 0;
@@ -166,6 +170,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
DEBUG_LL_ZOOM(omap_zoom2);
DEBUG_LL_ZOOM(omap_zoom3);
 
+   /* TI8168 base boards using UART3 */
+   DEBUG_LL_TI816X(3, ti8168evm);
+
} while (0);
 }
 
-- 
1.6.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 1/4] TI816X: Update common omap platform files

2011-01-03 Thread Hemant Pedanekar
This patch updates the common platform files with TI816X support. Also adds new
files for TI816X modules base addresseses and irq definitions.

The approach taken in this patch is to add TI816X as part of OMAP3 variant where
the cpu class is considered as OMAP34XX and the type is TI816X. This means, both
cpu_is_omap34xx() and cpu_is_ti816x() checks return success on TI816X.

Signed-off-by: Hemant Pedanekar 
---
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |1 +
 arch/arm/plat-omap/include/plat/common.h  |1 +
 arch/arm/plat-omap/include/plat/cpu.h |   18 
 arch/arm/plat-omap/include/plat/hardware.h|1 +
 arch/arm/plat-omap/include/plat/irqs-ti816x.h |  131 +
 arch/arm/plat-omap/include/plat/irqs.h|3 +
 arch/arm/plat-omap/include/plat/serial.h  |5 +
 arch/arm/plat-omap/include/plat/ti816x.h  |   31 ++
 9 files changed, 192 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/irqs-ti816x.h
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index b19774c..f1e880c 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -38,6 +38,7 @@ struct omap_clk {
 #define CK_3517(1 << 9)
 #define CK_36XX(1 << 10)   /* 36xx/37xx-specific clocks */
 #define CK_443X(1 << 11)
+#define CK_TI816X  (1 << 12)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat-omap/include/plat/clock.h
index 8eb0ada..d43e623 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -53,6 +53,7 @@ struct clkops {
 #define RATE_IN_3430ES2PLUS(1 << 3)/* 3430 ES >= 2 rates only */
 #define RATE_IN_36XX   (1 << 4)
 #define RATE_IN_4430   (1 << 5)
+#define RATE_IN_TI816X (1 << 6)
 
 #define RATE_IN_24XX   (RATE_IN_242X | RATE_IN_243X)
 #define RATE_IN_34XX   (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/common.h 
b/arch/arm/plat-omap/include/plat/common.h
index 6b8088e..be5c5e8 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -63,6 +63,7 @@ void omap2_set_globals_242x(void);
 void omap2_set_globals_243x(void);
 void omap2_set_globals_3xxx(void);
 void omap2_set_globals_443x(void);
+void omap2_set_globals_ti816x(void);
 
 /* These get called from omap2_set_globals_(), do not call these */
 void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 3fd8b40..539cd57 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -105,6 +105,12 @@ static inline int is_omap ##subclass (void)
\
return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
 }
 
+#define IS_TI_SUBCLASS(subclass, id)   \
+static inline int is_ti ##subclass (void)  \
+{  \
+   return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
+}
+
 IS_OMAP_CLASS(7xx, 0x07)
 IS_OMAP_CLASS(15xx, 0x15)
 IS_OMAP_CLASS(16xx, 0x16)
@@ -118,6 +124,8 @@ IS_OMAP_SUBCLASS(343x, 0x343)
 IS_OMAP_SUBCLASS(363x, 0x363)
 IS_OMAP_SUBCLASS(443x, 0x443)
 
+IS_TI_SUBCLASS(816x, 0x816)
+
 #define cpu_is_omap7xx()   0
 #define cpu_is_omap15xx()  0
 #define cpu_is_omap16xx()  0
@@ -275,6 +283,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define cpu_is_omap3430()  0
 #define cpu_is_omap4430()  0
 #define cpu_is_omap3630()  0
+#define cpu_is_ti816x()0
 
 /*
  * Whether we have MULTI_OMAP1 or not, we still need to distinguish
@@ -330,6 +339,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # undef cpu_is_omap3530
 # undef cpu_is_omap3505
 # undef cpu_is_omap3517
+# undef cpu_is_ti816x
 # define cpu_is_omap3430() is_omap3430()
 # define cpu_is_omap3503() (cpu_is_omap3430() &&   \
(!omap3_has_iva()) &&   \
@@ -343,6 +353,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # define cpu_is_omap3530() (cpu_is_omap3430())
 # define cpu_is_omap3505() is_omap3505()
 # define cpu_is_omap3517() is_omap3517()
+# define cpu_is_ti816x()   is_ti816x()
 # undef cpu_is_omap3630
 # define cpu_is_omap3630() is_omap363x()
 #endif
@@ -389,6 +400,10 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define OMAP3505_REV(v)(OMAP35XX_CLASS | (0x3505 << 16) | (v 
<< 8))
 #define OMAP3517_REV(v)(OMAP35XX_CLASS | (0x3517 << 16) | (v 
<< 8))
 
+#define TI816X_CLASS

[PATCH v3 3/4] TI816X: Create board support and enable build for TI816X EVM

2011-01-03 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI816X EVM.

Signed-off-by: Hemant Pedanekar 
---
 arch/arm/mach-omap2/Kconfig   |5 +++
 arch/arm/mach-omap2/Makefile  |1 +
 arch/arm/mach-omap2/board-ti8168evm.c |   58 +
 3 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 3e8c9e8..5ef2afa 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -293,6 +293,11 @@ config MACH_OMAP_3630SDP
default y
select OMAP_PACKAGE_CBP
 
+config MACH_TI8168EVM
+   bool "TI8168 Evaluation Module"
+   depends on ARCH_OMAP3
+   default y
+
 config MACH_OMAP_4430SDP
bool "OMAP 4430 SDP board"
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 4ab82f6..86b05a3 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -219,6 +219,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)   += 
board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
   hsmmc.o
+obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
 # Platform specific device init code
 usbfs-$(CONFIG_ARCH_OMAP_OTG)  := usb-fs.o
 obj-y  += $(usbfs-m) $(usbfs-y)
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
new file mode 100644
index 000..e175ca4
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -0,0 +1,58 @@
+/*
+ * Code for TI8168 EVM.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - 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.
+ */
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
+};
+
+static void __init ti8168_evm_init_irq(void)
+{
+   omap_board_config = ti8168_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
+   omap2_init_common_infrastructure();
+   omap2_init_common_devices(NULL, NULL);
+   omap_init_irq();
+}
+
+static void __init ti8168_evm_init(void)
+{
+   omap_serial_init();
+}
+
+
+static void __init ti8168_evm_map_io(void)
+{
+   omap2_set_globals_ti816x();
+   omap34xx_map_common_io();
+}
+
+MACHINE_START(TI8168EVM, "ti8168evm")
+   /* Maintainer: Texas Instruments */
+   .boot_params= 0x8100,
+   .map_io = ti8168_evm_map_io,
+   .init_irq   = ti8168_evm_init_irq,
+   .init_machine   = ti8168_evm_init,
+   .timer  = &omap_timer,
+MACHINE_END
-- 
1.6.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 2/4] TI816X: Update common OMAP machine specific sources

2011-01-03 Thread Hemant Pedanekar
This patch updates the common machine spcific source files with support for
TI816X.

Note1: At present, omap34xx_io_desc data is reused for mapping, but TI816X only
has L4 slow address in common with OMAP3 and thus using omap34xx data results
into creating mappings for reserved/incorrect regions except for L4.

Note2: The optimized irq macro for omap3 skips checking the 4th irq status
register but this needs to be added for TI816X (interrupts 96 to 127).
Presently, only the multi-omap irq macro (unoptimized) is updated to check the
4th status register.

Signed-off-by: Hemant Pedanekar 
---
 arch/arm/mach-omap2/clock3xxx_data.c   |5 +++-
 arch/arm/mach-omap2/common.c   |   24 +
 arch/arm/mach-omap2/control.h  |   17 
 arch/arm/mach-omap2/id.c   |   33 ++-
 arch/arm/mach-omap2/include/mach/entry-macro.S |8 ++
 arch/arm/mach-omap2/io.c   |2 +-
 arch/arm/mach-omap2/irq.c  |5 +++-
 arch/arm/mach-omap2/serial.c   |8 +++---
 8 files changed, 93 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 9ab817e..557de99 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3466,6 +3466,9 @@ int __init omap3xxx_clk_init(void)
} else if (cpu_is_omap3630()) {
cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
cpu_clkflg = CK_36XX;
+   } else if (cpu_is_ti816x()) {
+   cpu_mask = RATE_IN_TI816X;
+   cpu_clkflg = CK_TI816X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
@@ -3545,7 +3548,7 @@ int __init omap3xxx_clk_init(void)
/*
 * Lock DPLL5 and put it in autoidle.
 */
-   if (omap_rev() >= OMAP3430_REV_ES2_0)
+   if (!cpu_is_ti816x() && (omap_rev() >= OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 778929f..7f58b7f 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -108,6 +108,30 @@ void __init omap3_map_io(void)
omap2_set_globals_3xxx();
omap34xx_map_common_io();
 }
+
+/*
+ * Adjust TAP register base such that omap3_check_revision accesses the correct
+ * TI816X register for checking device ID (it adds 0x204 to tap base while
+ * TI816X DEVICE ID register is at offset 0x600 from control base).
+ */
+#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
+   TI816X_CONTROL_DEVICE_ID - 0x204)
+
+static struct omap_globals ti816x_globals = {
+   .class  = OMAP343X_CLASS,
+   .tap= OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
+   .ctrl   = TI816X_CTRL_BASE,
+   .prm= TI816X_PRCM_BASE,
+   .cm = TI816X_PRCM_BASE,
+   .uart1_phys = TI816X_UART1_BASE,
+   .uart2_phys = TI816X_UART2_BASE,
+   .uart3_phys = TI816X_UART3_BASE,
+};
+
+void __init omap2_set_globals_ti816x(void)
+{
+   __omap2_set_globals(&ti816x_globals);
+}
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4)
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index f0629ae..5c87054 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -52,6 +52,11 @@
 #define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
 #define OMAP343X_CONTROL_GENERAL_WKUP  0xa60
 
+/* TI816X spefic control submodules */
+#define TI816X_CONTROL_OCPCONF 0x000
+#define TI816X_CONTROL_DEVBOOT 0x040
+#define TI816X_CONTROL_DEVCONF 0x600
+
 /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
 
 #define OMAP2_CONTROL_SYSCONFIG(OMAP2_CONTROL_INTERFACE + 0x10)
@@ -241,6 +246,18 @@
 #define OMAP3_PADCONF_SAD2D_MSTANDBY   0x250
 #define OMAP3_PADCONF_SAD2D_IDLEACK0x254
 
+/* TI816X CONTROL_DEVBOOT register offsets */
+#define TI816X_CONTROL_STATUS  (TI816X_CONTROL_DEVBOOT + 0x000)
+#define TI816X_CONTROL_BOOTSTAT(TI816X_CONTROL_DEVBOOT + 0x004)
+
+/* TI816X CONTROL_DEVCONF register offsets */
+#define TI816X_CONTROL_DEVICE_ID   (TI816X_CONTROL_DEVCONF + 0x000)
+#define TI816X_CONTROL_MAC_ID0_LO  (TI816X_CONTROL_DEVCONF + 0x030)
+#define TI816X_CONTROL_MAC_ID0_HI  (TI816X_CONTROL_DEVCONF + 0x034)
+#define TI816X_CONTROL_MAC_ID1_LO  (TI816X_CONTROL_DEVCONF + 0x038)
+#define TI816X_CONTROL_MAC_ID1_HI  (TI816X_CONTROL_DEVCONF + 0x03c)
+#define TI816X_CONTROL_PCIE_CFG(TI816X_CONTROL_DEVCONF + 0x040)
+
 /*
  * REVISIT: This list of registers is not comprehensive - there are more
  * that should be added.
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 5f90

[PATCH v3 0/4] Introduce support for TI816X processor series

2011-01-03 Thread Hemant Pedanekar
This patch set adds support for TI816X processor series. This series includes
DM8168, C6A816x and AM389x devices. The details can be found at following links:

http://focus.ti.com/general/docs/gencontent.tsp?contentId=77960
http://www.ti.com/ww/en/dsp/davinci-netra/index.shtml

This device is architecturally closer to the OMAP devices. Hence, these patches
are being submitted on linux-omap.

These patches are tested on OMAP3 EVM with multi-omap build.

Note that, additional patches consisting of TI816X specific hwmods, clock data
and DMTIMER changes, are required to enable successful booting on TI816X EVM.
These patches will follow shortly.

This patch set adds TI816X support as part of OMAP3 variant. The approach taken
is in accordance to the discussions in thread related to following post:
http://www.spinics.net/lists/linux-omap/msg41505.html

Hemant Pedanekar (4):
  TI816X: Update common omap platform files
  TI816X: Update common OMAP machine specific sources
  TI816X: Create board support and enable build for TI816X EVM
  TI816X: Add low level debug support

 arch/arm/mach-omap2/Kconfig|5 +
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-ti8168evm.c  |   58 +++
 arch/arm/mach-omap2/clock3xxx_data.c   |5 +-
 arch/arm/mach-omap2/common.c   |   24 +
 arch/arm/mach-omap2/control.h  |   17 +++
 arch/arm/mach-omap2/id.c   |   33 ++-
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 ++
 arch/arm/mach-omap2/include/mach/entry-macro.S |8 ++
 arch/arm/mach-omap2/io.c   |2 +-
 arch/arm/mach-omap2/irq.c  |5 +-
 arch/arm/mach-omap2/serial.c   |8 +-
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/common.h   |1 +
 arch/arm/plat-omap/include/plat/cpu.h  |   18 
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/irqs-ti816x.h  |  131 
 arch/arm/plat-omap/include/plat/irqs.h |3 +
 arch/arm/plat-omap/include/plat/serial.h   |8 ++
 arch/arm/plat-omap/include/plat/ti816x.h   |   31 ++
 arch/arm/plat-omap/include/plat/uncompress.h   |7 ++
 22 files changed, 371 insertions(+), 9 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c
 create mode 100644 arch/arm/plat-omap/include/plat/irqs-ti816x.h
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 1/3] ARM: add CPPI 4.1 DMA support

2011-01-03 Thread Russell King - ARM Linux
On Mon, Jan 03, 2011 at 08:07:18PM +0300, Sergei Shtylyov wrote:
> Hello.
>
> On 03-01-2011 20:01, Gupta, Ajay Kumar wrote:
>
> Add support for Texas Instuments Communication Port Programming Interface 
> 4.1
> (CPPI 4.1) used on OMAP-L1x/DA8xx and AM35x.
>
> At this moment, only the DMA controller and queue manager are supported.
> Support for the buffer manager is lacking but these chips don't have it 
> anyway.
>
> Signed-off-by: Sergei Shtylyov
> Signed-off-by: Sekhar Nori
>
 Russell, you have recently discarded this patch from your patch
 system. Can we know the reason?
>
>>> It was recently discussed with TI, and various people raised concerns
>>> about it.  I don't remember the exact details, and I wish they'd raise
>>> them with the patch author directly.  It may have been that it's
>>> inventing its own API rather than using something like the DMA engine
>>> API.
>
>>> Adding linux-omap to try to get a response there.
>
>> Sergei,
>> This issue was discussed recently at TI and proposal was to place it to
>> drivers/dma folder.
>
>Note that I have neither time nor inclination to do this work (not do 
> I think it's even feasible), so it will have to fall on TI's shoulders...
>
>> Moreover, even Felipe also seems to move other musb
>> DMAs (Inventra, CPPI3.0, TUSB) to drivers/dma.
>
>Frankly speaking, I doubt that drivers/dma/ will have place for the 
> purely MUSB specific DMA engines such as the named ones (there's no TUSB 
> DMA BTW -- it uses OMAP DMA).

Long term, we need to kill off all these platform private DMA interfaces.
There's a growing amount of IP that's being shared not only between ARM
silicon vendors, but also across architectures, and having to re-implement
drivers because the underlying DMA engine is different is not feasible.

For example, we're seeing ARMs primecells being used with various
different DMA controllers in various different ARM SoCs.  I've heard
rumours of them appearing in MIPS or PPC stuff as well.  We're seeing
PXA peripheral IP appearing in x86 stuff too.

We can't have drivers tied to their SoC DMA engines, and we can't continue
having SoC DMA engines implementing their own unique APIs.  We do need to
get on top of this before it becomes a major problem (if it hasn't
already).

The DMA engine API is still evolving, and should not be taken as concrete
- I've recently been bringing up a number of points with Dan on various
aspects of the API, some of which ultimately will lead to changes to the
async-tx API, and others which hopefully will mean that the DMA slave
API is better documented.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v5 1/3] ARM: add CPPI 4.1 DMA support

2011-01-03 Thread Gupta, Ajay Kumar
Hi,
>  Add support for Texas Instuments Communication Port Programming
> Interface 4.1
>  (CPPI 4.1) used on OMAP-L1x/DA8xx and AM35x.
> 
>  At this moment, only the DMA controller and queue manager are
> supported.
>  Support for the buffer manager is lacking but these chips don't have
> it anyway.
> 
>  Signed-off-by: Sergei Shtylyov
>  Signed-off-by: Sekhar Nori
> 
> >>> Russell, you have recently discarded this patch from your patch
> >>> system. Can we know the reason?
> 
> >> It was recently discussed with TI, and various people raised concerns
> >> about it.  I don't remember the exact details, and I wish they'd raise
> >> them with the patch author directly.  It may have been that it's
> >> inventing its own API rather than using something like the DMA engine
> >> API.
> 
> >> Adding linux-omap to try to get a response there.
> 
> > Sergei,
> > This issue was discussed recently at TI and proposal was to place it to
> > drivers/dma folder.
> 
> Note that I have neither time nor inclination to do this work (not do
> I think it's even feasible), so it will have to fall on TI's shoulders...

This is fine. No issues. We will discuss this at length at linux-usb list.

> 
> > Moreover, even Felipe also seems to move other musb
> > DMAs (Inventra, CPPI3.0, TUSB) to drivers/dma.
> 
> Frankly speaking, I doubt that drivers/dma/ will have place for the
> purely MUSB specific DMA engines such as the named ones (there's no TUSB
> DMA BTW it uses OMAP DMA).
I think we will get more clarity once we start on this activity.

Thanks,
Ajay
> 
> > Regards,
> > Ajay
> 
> WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 1/3] ARM: add CPPI 4.1 DMA support

2011-01-03 Thread Sergei Shtylyov

Hello.

On 03-01-2011 20:01, Gupta, Ajay Kumar wrote:


Add support for Texas Instuments Communication Port Programming Interface 4.1
(CPPI 4.1) used on OMAP-L1x/DA8xx and AM35x.



At this moment, only the DMA controller and queue manager are supported.
Support for the buffer manager is lacking but these chips don't have it anyway.



Signed-off-by: Sergei Shtylyov
Signed-off-by: Sekhar Nori



Russell, you have recently discarded this patch from your patch
system. Can we know the reason?



It was recently discussed with TI, and various people raised concerns
about it.  I don't remember the exact details, and I wish they'd raise
them with the patch author directly.  It may have been that it's
inventing its own API rather than using something like the DMA engine
API.



Adding linux-omap to try to get a response there.



Sergei,
This issue was discussed recently at TI and proposal was to place it to
drivers/dma folder.


   Note that I have neither time nor inclination to do this work (not do I 
think it's even feasible), so it will have to fall on TI's shoulders...



Moreover, even Felipe also seems to move other musb
DMAs (Inventra, CPPI3.0, TUSB) to drivers/dma.


   Frankly speaking, I doubt that drivers/dma/ will have place for the purely 
MUSB specific DMA engines such as the named ones (there's no TUSB DMA BTW -- 
it uses OMAP DMA).



Regards,
Ajay


WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v5 1/3] ARM: add CPPI 4.1 DMA support

2011-01-03 Thread Gupta, Ajay Kumar
Hi,
> >> Add support for Texas Instuments Communication Port Programming
> Interface 4.1
> >> (CPPI 4.1) used on OMAP-L1x/DA8xx and AM35x.
> >
> >> At this moment, only the DMA controller and queue manager are supported.
> >> Support for the buffer manager is lacking but these chips don't have it
> anyway.
> >
> >> Signed-off-by: Sergei Shtylyov
> >> Signed-off-by: Sekhar Nori
> >
> >Russell, you have recently discarded this patch from your patch
> > system. Can we know the reason?
> 
> It was recently discussed with TI, and various people raised concerns
> about it.  I don't remember the exact details, and I wish they'd raise
> them with the patch author directly.  It may have been that it's
> inventing its own API rather than using something like the DMA engine
> API.
> 
> Adding linux-omap to try to get a response there.

Sergei,
This issue was discussed recently at TI and proposal was to place it to
drivers/dma folder. Moreover, even Felipe also seems to move other musb
DMAs (Inventra, CPPI3.0, TUSB) to drivers/dma.

Regards,
Ajay
> ___
> Davinci-linux-open-source mailing list
> davinci-linux-open-sou...@linux.davincidsp.com
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 1/3] ARM: add CPPI 4.1 DMA support

2011-01-03 Thread Russell King - ARM Linux
On Mon, Jan 03, 2011 at 07:06:10PM +0300, Sergei Shtylyov wrote:
> Hello.
>
> On 15-05-2010 22:14, Sergei Shtylyov wrote:
>
>> Add support for Texas Instuments Communication Port Programming Interface 4.1
>> (CPPI 4.1) used on OMAP-L1x/DA8xx and AM35x.
>
>> At this moment, only the DMA controller and queue manager are supported.
>> Support for the buffer manager is lacking but these chips don't have it 
>> anyway.
>
>> Signed-off-by: Sergei Shtylyov
>> Signed-off-by: Sekhar Nori
>
>Russell, you have recently discarded this patch from your patch 
> system. Can we know the reason?

It was recently discussed with TI, and various people raised concerns
about it.  I don't remember the exact details, and I wish they'd raise
them with the patch author directly.  It may have been that it's
inventing its own API rather than using something like the DMA engine
API.

Adding linux-omap to try to get a response there.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP3: PM: Adding T2 enabling of smartreflex

2011-01-03 Thread Nishanth Menon

Thara Gopinath had written, on 12/31/2010 02:07 AM, the following:

The smartreflex bit on twl4030 needs to be enabled by default irrespective
of whether smartreflex module is enabled on the OMAP side or not.
This is because without this bit enabled the voltage scaling through
vp forceupdate does not function properly on OMAP3.

s/does not function properly/ does not function ;)
SR I2C is used for forceupdate/vc bypass modes - so neither will 
function without switching t2 mode.


T2 voltages could be set in quiet a few methods:
a) Synchronized Scaling Hardware Strategy (ENABLE_VMODE = 1) (for OMAP2 
and I had worked on one OMAP3430 product which used this as well) using 
VDD1_VFLOOR and VDD1_VROOF
b) Direct Strategy Software Scaling Mode (ENABLE_VMODE = 0) (Smart 
reflex disabled) - VDD1_VSEL
c) using smart reflex - as done below - allows OMAP with smart reflex 
hardware wired to the twl to use that functionality.


Blindly setting it to smartreflex mode is not correct IMHO. It might 
work on SDP and few TI and non-TI platforms, but not all.




Signed-off-by: Thara Gopinath 
---
This patch is against LO master and has been
tested on OMAP3430 SDP and OMAP2430 SDP.

 arch/arm/mach-omap2/omap_twl.c |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c
index 15f8c6c..a59f36b 100644
--- a/arch/arm/mach-omap2/omap_twl.c
+++ b/arch/arm/mach-omap2/omap_twl.c
@@ -58,7 +58,9 @@
 static bool is_offset_valid;
 static u8 smps_offset;
 
+#define TWL4030_DCDC_GLOBAL_CFG	0x06

 #define REG_SMPS_OFFSET 0xE0
+#define SMARTREFLEX_ENABLE BIT(3)
 
 unsigned long twl4030_vsel_to_uv(const u8 vsel)

 {
@@ -256,6 +258,7 @@ int __init omap4_twl_init(void)
 int __init omap3_twl_init(void)
 {
struct voltagedomain *voltdm;
+   u8 temp;
 
 	if (!cpu_is_omap34xx())

return -ENODEV;
@@ -267,6 +270,19 @@ int __init omap3_twl_init(void)
omap3_core_volt_info.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX;
}
 
+	/*

+* The smartreflex bit on twl4030 needs to be enabled by
+* default irrespective of whether smartreflex module is
+* enabled on the OMAP side or not. This is because without
+* this bit enabled the voltage scaling through
+* vp forceupdate does not function properly on OMAP3.
+*/
+   twl_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &temp,
+   TWL4030_DCDC_GLOBAL_CFG);
+   temp |= SMARTREFLEX_ENABLE;
+   twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, temp,
+   TWL4030_DCDC_GLOBAL_CFG);
+
voltdm = omap_voltage_domain_lookup("mpu");
omap_voltage_register_pmic(voltdm, &omap3_mpu_volt_info);
 



--
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP PM: Expose vc registers in debugfs

2011-01-03 Thread Nishanth Menon

saw...@ti.com had written, on 12/30/2010 06:04 AM, the following:

From: Anand Sawant 

This patch will expose the following voltage controller registers
as part of voltage layer debugfs.
1. PRM_VC_BYPASS_VAL
2. PRM_VC_CMD_VAL - for all VDDs

This patch will help in debugging voltage scaling issues.

How does this patch help in debugging voltage scaling issues?



Tested on Zoom3 & OMAP4430 SDP.

Patch rebased to latest Kevin's PM branch.

Signed-off-by: Anand S Sawant 
---
 arch/arm/mach-omap2/voltage.c |   15 +++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
index ed6079c..a9b52e4 100644
--- a/arch/arm/mach-omap2/voltage.c
+++ b/arch/arm/mach-omap2/voltage.c
@@ -336,6 +336,11 @@ static void omap4_voltage_write_reg(u32 val, u16 mod, u8 
offset)
 }
 
 /* Voltage debugfs support */

+
+/**
+ * Gets the current vp output voltage (auto-compensated) for the
+ * voltage domain.
+ */

please remove this from this patch - has nothing to do with $subject
also, please read kernel documentation for function comment header style


 static int vp_volt_debug_get(void *data, u64 *val)
 {
struct omap_vdd_info *vdd = (struct omap_vdd_info *) data;
@@ -359,6 +364,10 @@ static int vp_volt_debug_get(void *data, u64 *val)
return 0;
 }
 
+/**

+ * Gets the current nominal OPP voltage (non auto-compensated) for the
+ * voltage domain.
+ */

same here

 static int nom_volt_debug_get(void *data, u64 *val)
 {
struct omap_vdd_info *vdd = (struct omap_vdd_info *) data;
@@ -456,6 +465,7 @@ static void __init vp_init(struct omap_vdd_info *vdd)
vdd->write_reg(vp_val, mod, vdd->vp_offs.vlimitto);
 }
 
+/* Creates debugfs entries for key vp & vc parameters */

and here

 static void __init vdd_debugfs_init(struct omap_vdd_info *vdd)
 {
char *name;
@@ -501,6 +511,11 @@ static void __init vdd_debugfs_init(struct omap_vdd_info 
*vdd)
(void) debugfs_create_file("curr_nominal_volt", S_IRUGO,
vdd->debug_dir, (void *) vdd,
&nom_volt_debug_fops);
+
+   (void) debugfs_create_x8("vc_bypass_val", S_IRUGO, vdd->debug_dir,
+   &(vdd->vc_reg.bypass_val_reg));
+   (void) debugfs_create_x8("vc_cmdval", S_IRUGO, vdd->debug_dir,
+   &(vdd->vc_reg.cmdval_reg));

why the cast to void?


 }
 
 /* Voltage scale and accessory APIs */



--
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP2+: hwmod: incorrect computation of autoidle_mask

2011-01-03 Thread Cousson, Benoit

Hi Tarun,

On 1/3/2011 10:59 PM, DebBarma, Tarun Kanti wrote:

Autoidle is just a single bit setting across OMAP platforms.
In _set_module_autoidle() I am seeing 0x3 where the mask is
computed. I believe this should be 0x1.


Just a minor comment; it looks from this description that you are not 
100% sure it is a bug :-)
You need to refer to the various TRMs, stating that this is indeed a bug 
for all OMAPs!


Adding a "fix" in the subject seems more accurate to describe the patch.
OMAP2+: Fix incorrect computation of autoidle_mask

Since is it harmless for the moment, I think it will probably go for 2.6.39.


Baseline:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

Tested Info:
Boot tested on OMAP 2/3/4.

Signed-off-by: Tarun Kanti DebBarma
Acked-by: Rajendra Nayak


Acked-by: Benoit Cousson 


Thanks,
Benoit


---
  arch/arm/mach-omap2/omap_hwmod.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 5a30658..da49b56 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -373,7 +373,7 @@ static int _set_module_autoidle(struct omap_hwmod *oh, u8 
autoidle,
}

autoidle_shift = oh->class->sysc->sysc_fields->autoidle_shift;
-   autoidle_mask = (0x3<<  autoidle_shift);
+   autoidle_mask = (0x1<<  autoidle_shift);

*v&= ~autoidle_mask;
*v |= autoidle<<  autoidle_shift;


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: Cannot get USB ports on custom beagleboard to work

2011-01-03 Thread Premi, Sanjeev
> -Original Message-
> From: linux-omap-ow...@vger.kernel.org 
> [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Elvis Dowson
> Sent: Monday, January 03, 2011 4:07 AM
> To: linux-omap Mailing List
> Subject: Cannot get USB ports on custom beagleboard to work
> 
> Hi,
>I have a custom beagleboard on which I cannot seem to 
> get the USB ports to work with a wired mouse, using a powered USB hub.
> 
> Any suggestions on how I can trouble shoot this issue. This 
> is based off the TI rowboat-eclair-2.6.32 kernel.
>
[snip]...[snip]

> Starting udev
> Remounting root file system...
> Caching udev devnodes
> Populating dev cache
> logger: mount: mount point /proc/bus/usb does not exist

I not familiar with the Android kernels, but based on this error:
Check that "CONFIG_USB_DEVICEFS=y" in your kernel configuration.

~sanjeev

[snip]...[snip]
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ETM: Fix etm_probe and etb_probe section mismatch warnings in arch/arm/kernel/etm.c

2011-01-03 Thread Nishanth Menon

Elvis Dowson had written, on 12/26/2010 03:26 PM, the following:

Hi,
   This patch fixes section mismatch warnings for etm_probe() and 
etb_probe() for linux-2.6.37-rc7.

Elvis Dowson


Could you post this to l-a and cc l-o?
a better cc list is got by scripts/get_maintainer.pl patch




From d9168ebf22bfac428955b3a3fe2d657faae4a9ee Mon Sep 17 00:00:00 2001
From: Elvis Dowson 
Date: Mon, 27 Dec 2010 01:21:39 +0400
Subject: [PATCH] ETM: Fix etm_probe and etb_probe section mismatch warnings in 
arch/arm/kernel/etm.c

Fix the following section mismatch warning when building omap2plus_defconfig:

WARNING: vmlinux.o(.data+0x1b70): Section mismatch in reference from the 
variable etb_driver to the function .init.text:etb_probe()

WARNING: vmlinux.o(.data+0x1bbc): Section mismatch in reference from the variable etm_driver to the function .init.text:etm_probe() 


Signed-off-by: Elvis Dowson 
---
 arch/arm/kernel/etm.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c
index 11db628..e881a0d 100644
--- a/arch/arm/kernel/etm.c
+++ b/arch/arm/kernel/etm.c
@@ -338,7 +338,7 @@ static struct miscdevice etb_miscdev = {
.fops = &etb_fops,
 };
 
-static int __init etb_probe(struct amba_device *dev, struct amba_id *id)

+static int __devinit etb_probe(struct amba_device *dev, struct amba_id *id)
 {
struct tracectx *t = &tracer;
int ret = 0;
@@ -530,7 +530,7 @@ static ssize_t trace_mode_store(struct kobject *kobj,
 static struct kobj_attribute trace_mode_attr =
__ATTR(trace_mode, 0644, trace_mode_show, trace_mode_store);
 
-static int __init etm_probe(struct amba_device *dev, struct amba_id *id)

+static int __devinit etm_probe(struct amba_device *dev, struct amba_id *id)
 {
struct tracectx *t = &tracer;
int ret = 0;



--
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 01/32] arm/omap: use system_wq in mailbox

2011-01-03 Thread Tejun Heo
With cmwq, there's no reason to use a separate workqueue for mailbox.
Use the system_wq instead.  mbox->rxq->work is sync flushed in
omap_mbox_fini() to make sure it's not running on any cpu, which makes
sure that no mbox work is running when omap_mbox_exit() is entered.

Signed-off-by: Tejun Heo 
Cc: Tony Lindgren 
Cc: linux-omap@vger.kernel.org
---
Only compile tested.  Please feel free to take it into the subsystem
tree or simply ack - I'll route it through the wq tree.

Thanks.

 arch/arm/plat-omap/mailbox.c |   10 ++
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index d2fafb8..5bc4d7b 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -31,7 +31,6 @@
 
 #include 
 
-static struct workqueue_struct *mboxd;
 static struct omap_mbox **mboxes;
 static bool rq_full;
 
@@ -186,7 +185,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
/* no more messages in the fifo. clear IRQ source. */
ack_mbox_irq(mbox, IRQ_RX);
 nomem:
-   queue_work(mboxd, &mbox->rxq->work);
+   schedule_work(&mbox->rxq->work);
 }
 
 static irqreturn_t mbox_interrupt(int irq, void *p)
@@ -291,7 +290,7 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
 {
free_irq(mbox->irq, mbox);
tasklet_kill(&mbox->txq->tasklet);
-   flush_work(&mbox->rxq->work);
+   flush_work_sync(&mbox->rxq->work);
mbox_queue_free(mbox->txq);
mbox_queue_free(mbox->rxq);
 
@@ -385,10 +384,6 @@ static int __init omap_mbox_init(void)
if (err)
return err;
 
-   mboxd = create_workqueue("mboxd");
-   if (!mboxd)
-   return -ENOMEM;
-
/* kfifo size sanity check: alignment and minimal size */
mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t));
mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size, 
sizeof(mbox_msg_t));
@@ -399,7 +394,6 @@ subsys_initcall(omap_mbox_init);
 
 static void __exit omap_mbox_exit(void)
 {
-   destroy_workqueue(mboxd);
class_unregister(&omap_mbox_class);
 }
 module_exit(omap_mbox_exit);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/7 v2] OMAP2430: hwmod data: Add McSPI

2011-01-03 Thread Govindraj
On Fri, Dec 31, 2010 at 12:33 AM, Grant Likely
 wrote:
> On Wed, Dec 01, 2010 at 07:31:22PM +0530, Govindraj.R wrote:
>> From: Charulatha V 
>>
>> Update the 2430 hwmod data file with McSPI info.
>>
>> Signed-off-by: Charulatha V 
>> Signed-off-by: Govindraj.R 
>
> Hmmm; this patch is virtually identical to the first patch in this
> series which adds 2420 hwmod support.  I see a large block of
> identical data with minor differences.  Surely support for these two
> chips can share the common blocks of data.
>
> Is this going to be a common situation for HWMOD data?

Grant,

Thanks for your Review comments.

Currently we have four hwmod data files:
2420, 2430 , 3xxx, 44xx

We need to fill these four files with hw info data to be passed
to driver there could be small info that might be duplicated.

Currently we are updating all the four files.
As Paul said there might be some changes done going forward.
To handle the hwmod files.

Hope this clarifies.

--
Thanks,
Govindraj.R


>
> g.
>
>> ---
>>  arch/arm/mach-omap2/omap_hwmod_2430_data.c |  219 
>> 
>>  1 files changed, 219 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c 
>> b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
>> index 7cf0d3a..bcdfb2b 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
>> @@ -17,6 +17,7 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>>  #include 
>>
>>  #include "omap_hwmod_common_data.h"
>> @@ -38,6 +39,9 @@ static struct omap_hwmod omap2430_iva_hwmod;
>>  static struct omap_hwmod omap2430_l3_main_hwmod;
>>  static struct omap_hwmod omap2430_l4_core_hwmod;
>>  static struct omap_hwmod omap2430_wd_timer2_hwmod;
>> +static struct omap_hwmod omap2430_mcspi1_hwmod;
>> +static struct omap_hwmod omap2430_mcspi2_hwmod;
>> +static struct omap_hwmod omap2430_mcspi3_hwmod;
>>
>>  /* L3 -> L4_CORE interface */
>>  static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = {
>> @@ -216,6 +220,60 @@ static struct omap_hwmod_ocp_if 
>> *omap2430_l4_wkup_slaves[] = {
>>  static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = {
>>  };
>>
>> +/* l4 core -> mcspi1 interface */
>> +static struct omap_hwmod_addr_space omap2430_mcspi1_addr_space[] = {
>> +     {
>> +             .pa_start       = 0x48098000,
>> +             .pa_end         = 0x480980ff,
>> +             .flags          = ADDR_TYPE_RT,
>> +     },
>> +};
>> +
>> +static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi1 = {
>> +     .master         = &omap2430_l4_core_hwmod,
>> +     .slave          = &omap2430_mcspi1_hwmod,
>> +     .clk            = "mcspi1_ick",
>> +     .addr           = omap2430_mcspi1_addr_space,
>> +     .addr_cnt       = ARRAY_SIZE(omap2430_mcspi1_addr_space),
>> +     .user           = OCP_USER_MPU | OCP_USER_SDMA,
>> +};
>> +
>> +/* l4 core -> mcspi2 interface */
>> +static struct omap_hwmod_addr_space omap2430_mcspi2_addr_space[] = {
>> +     {
>> +             .pa_start       = 0x4809a000,
>> +             .pa_end         = 0x4809a0ff,
>> +             .flags          = ADDR_TYPE_RT,
>> +     },
>> +};
>> +
>> +static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi2 = {
>> +     .master         = &omap2430_l4_core_hwmod,
>> +     .slave          = &omap2430_mcspi2_hwmod,
>> +     .clk            = "mcspi2_ick",
>> +     .addr           = omap2430_mcspi2_addr_space,
>> +     .addr_cnt       = ARRAY_SIZE(omap2430_mcspi2_addr_space),
>> +     .user           = OCP_USER_MPU | OCP_USER_SDMA,
>> +};
>> +
>> +/* l4 core -> mcspi3 interface */
>> +static struct omap_hwmod_addr_space omap2430_mcspi3_addr_space[] = {
>> +     {
>> +             .pa_start       = 0x480b8000,
>> +             .pa_end         = 0x480b80ff,
>> +             .flags          = ADDR_TYPE_RT,
>> +     },
>> +};
>> +
>> +static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi3 = {
>> +     .master         = &omap2430_l4_core_hwmod,
>> +     .slave          = &omap2430_mcspi3_hwmod,
>> +     .clk            = "mcspi3_ick",
>> +     .addr           = omap2430_mcspi3_addr_space,
>> +     .addr_cnt       = ARRAY_SIZE(omap2430_mcspi3_addr_space),
>> +     .user           = OCP_USER_MPU | OCP_USER_SDMA,
>> +};
>> +
>>  /* L4 WKUP */
>>  static struct omap_hwmod omap2430_l4_wkup_hwmod = {
>>       .name           = "l4_wkup",
>> @@ -569,6 +627,162 @@ static struct omap_hwmod omap2430_i2c2_hwmod = {
>>       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
>>  };
>>
>> +/*
>> + * 'mcspi' class
>> + * multichannel serial port interface (mcspi) / master/slave synchronous 
>> serial
>> + * bus
>> + */
>> +
>> +static struct omap_hwmod_class_sysconfig omap2430_mcspi_sysc = {
>> +     .rev_offs       = 0x,
>> +     .sysc_offs      = 0x0010,
>> +     .syss_offs      = 0x0014,
>> +     .sysc_flags     = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
>> +                             SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
>> +                       

[PATCH v3 10/17] OMAP2,3: DSS2: Move dss_feature_init to dss

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

Move dss_feature_init call from core to dss as it involves DSS HW related
configuration.  This movement is must since dsshw_probe would be called
first in which the registers are accessed.

Signed-off-by: Senthilvadivu Guruswamy 
---
 drivers/video/omap2/dss/core.c |2 --
 drivers/video/omap2/dss/dss.c  |3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index a6b3b61..0d5f6dd 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -187,8 +187,6 @@ static int omap_dss_probe(struct platform_device *pdev)
 
core.pdev = pdev;
 
-   dss_features_init();
-
dss_init_overlay_managers(pdev);
dss_init_overlays(pdev);
 
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 59a632d..99dd490 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include "dss.h"
+#include "dss_features.h"
 
 #define DSS_BASE   0x4805
 
@@ -966,6 +967,8 @@ static int omap_dsshw_probe(struct platform_device *pdev)
 
dss.pdev = pdev;
 
+   dss_features_init();
+
r = dss_get_clocks();
if (r)
goto err_clocks;
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 14/17] OMAP2,3: DSS2: VENC Move init,exit to driver

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

For hwmod adaptation, move init exit methods from core.c to its driver probe,
remove.   pdev member has to be maintained by its own drivers.  Regulator has
to be privately handled in each driver. Replace printk to dev_dbg for boot time
optimization.

Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/board-3430sdp.c |2 +-
 drivers/video/omap2/dss/core.c  |   29 ---
 drivers/video/omap2/dss/dss.h   |1 -
 drivers/video/omap2/dss/venc.c  |   88 ++
 4 files changed, 48 insertions(+), 72 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index e1a3318..83baba7 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -302,7 +302,7 @@ static struct omap_dss_board_info sdp3430_dss_data = {
 };
 
 static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omap_display");
+   REGULATOR_SUPPLY("vdda_dac", "omap_venc");
 
 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
 };
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 3711553..6f9fc38 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -43,7 +43,6 @@ static struct {
 
struct regulator *vdds_dsi_reg;
struct regulator *vdds_sdi_reg;
-   struct regulator *vdda_dac_reg;
 } core;
 
 static char *def_disp_name;
@@ -85,20 +84,6 @@ struct regulator *dss_get_vdds_sdi(void)
return reg;
 }
 
-struct regulator *dss_get_vdda_dac(void)
-{
-   struct regulator *reg;
-
-   if (core.vdda_dac_reg != NULL)
-   return core.vdda_dac_reg;
-
-   reg = regulator_get(&core.pdev->dev, "vdda_dac");
-   if (!IS_ERR(reg))
-   core.vdda_dac_reg = reg;
-
-   return reg;
-}
-
 #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
 static int dss_debug_show(struct seq_file *s, void *unused)
 {
@@ -198,12 +183,6 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_dpi;
}
 
-   r = venc_init(pdev);
-   if (r) {
-   DSSERR("Failed to initialize venc\n");
-   goto err_venc;
-   }
-
if (cpu_is_omap34xx()) {
r = sdi_init(skip_init);
if (r) {
@@ -253,8 +232,6 @@ err_dsi:
if (cpu_is_omap34xx())
sdi_exit();
 err_sdi:
-   venc_exit();
-err_venc:
dpi_exit();
 err_dpi:
 
@@ -268,7 +245,6 @@ static int omap_dss_remove(struct platform_device *pdev)
 
dss_uninitialize_debugfs();
 
-   venc_exit();
dpi_exit();
if (cpu_is_omap34xx()) {
dsi_exit();
@@ -561,11 +537,6 @@ static void __exit omap_dss_exit(void)
core.vdds_sdi_reg = NULL;
}
 
-   if (core.vdda_dac_reg != NULL) {
-   regulator_put(core.vdda_dac_reg);
-   core.vdda_dac_reg = NULL;
-   }
-
platform_driver_unregister(&omap_dss_driver);
 
omap_dss_bus_unregister();
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 0029aff..734e052 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -172,7 +172,6 @@ struct platform_device;
 struct bus_type *dss_get_bus(void);
 struct regulator *dss_get_vdds_dsi(void);
 struct regulator *dss_get_vdds_sdi(void);
-struct regulator *dss_get_vdda_dac(void);
 
 /* display */
 int dss_suspend_all_devices(void);
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index ac63cee..4e84e71 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -289,6 +289,7 @@ const struct omap_video_timings omap_dss_ntsc_timings = {
 EXPORT_SYMBOL(omap_dss_ntsc_timings);
 
 static struct {
+   struct platform_device *pdev;
void __iomem *base;
struct mutex venc_lock;
u32 wss_data;
@@ -306,6 +307,17 @@ static inline u32 venc_read_reg(int idx)
return l;
 }
 
+static struct regulator *venc_get_vdda_dac(void)
+{
+   struct regulator *reg;
+
+   reg = regulator_get(&venc.pdev->dev, "vdda_dac");
+   if (!IS_ERR(reg))
+   venc.vdda_dac_reg = reg;
+
+   return reg;
+}
+
 static void venc_write_config(const struct venc_config *config)
 {
DSSDBG("write venc conf\n");
@@ -641,46 +653,6 @@ static struct omap_dss_driver venc_driver = {
 };
 /* driver end */
 
-
-
-int venc_init(struct platform_device *pdev)
-{
-   u8 rev_id;
-
-   mutex_init(&venc.venc_lock);
-
-   venc.wss_data = 0;
-
-   venc.base = ioremap(VENC_BASE, SZ_1K);
-   if (!venc.base) {
-   DSSERR("can't ioremap VENC\n");
-   return -ENOMEM;
-   }
-
-   venc.vdda_dac_reg = dss_get_vdda_dac();
-   if (IS_ERR(venc.vdda_dac_reg)) {
-   iounmap(venc.base);
-   DSSERR("ca

[PATCH v3 01/17] OMAP2420: hwmod data: add DSS DISPC RFBI VENC

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

Hwmod needs database of all IPs in a system. This patch generates the hwmod
database for OMAP2420 Display Sub System,. Since DSS is also considered as an
IP as DISPC, RFBI, name it as dss_dss.

Signed-off-by: Senthilvadivu Guruswamy 
Acked-by: Benoit Cousson 
---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |  283 
 1 files changed, 283 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index b85c630..14ae4a8 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -38,6 +38,10 @@ static struct omap_hwmod omap2420_mpu_hwmod;
 static struct omap_hwmod omap2420_iva_hwmod;
 static struct omap_hwmod omap2420_l3_main_hwmod;
 static struct omap_hwmod omap2420_l4_core_hwmod;
+static struct omap_hwmod omap2420_dss_dss_hwmod;
+static struct omap_hwmod omap2420_dss_dispc_hwmod;
+static struct omap_hwmod omap2420_dss_rfbi_hwmod;
+static struct omap_hwmod omap2420_dss_venc_hwmod;
 static struct omap_hwmod omap2420_wd_timer2_hwmod;
 static struct omap_hwmod omap2420_gpio1_hwmod;
 static struct omap_hwmod omap2420_gpio2_hwmod;
@@ -64,6 +68,13 @@ static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = 
{
&omap2420_mpu__l3_main,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap2420_dss__l3 = {
+   .master = &omap2420_dss_dss_hwmod,
+   .slave  = &omap2420_l3_main_hwmod,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* Master interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = {
&omap2420_l3_main__l4_core,
@@ -470,6 +481,272 @@ static struct omap_hwmod omap2420_uart3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap2420_dss_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2420_dss_hwmod_class = {
+   .name = "dss",
+   .sysc = &omap2420_dss_sysc,
+};
+
+/* dss */
+static struct omap_hwmod_irq_info omap2420_dss_irqs[] = {
+   { .irq = 25 },
+};
+
+static struct omap_hwmod_dma_info omap2420_dss_sdma_chs[] = {
+   { .name = "dispc", .dma_req = 5 },
+};
+
+/* dss */
+/* dss master ports */
+static struct omap_hwmod_ocp_if *omap2420_dss_masters[] = {
+   &omap2420_dss__l3,
+};
+
+static struct omap_hwmod_addr_space omap2420_dss_addrs[] = {
+   {
+   .pa_start   = 0x4805,
+   .pa_end = 0x480503FF,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap2420_l4_core__dss = {
+   .master = &omap2420_l4_core_hwmod,
+   .slave  = &omap2420_dss_dss_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap2420_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap2420_dss_addrs),
+   .user   = OCP_USER_MPU,
+};
+
+/* dss slave ports */
+static struct omap_hwmod_ocp_if *omap2420_dss_slaves[] = {
+   &omap2420_l4_core__dss,
+};
+
+static struct omap_hwmod_opt_clk dss_opt_clks[] = {
+   { .role = "tv_clk", .clk = "dss_54m_fck" },
+   { .role = "sys_clk", .clk = "dss2_fck" },
+};
+
+static struct omap_hwmod omap2420_dss_dss_hwmod = {
+   .name   = "dss_dss",
+   .class  = &omap2420_dss_hwmod_class,
+   .main_clk   = "dss1_fck", /* instead of dss_fck */
+   .mpu_irqs   = omap2420_dss_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap2420_dss_irqs),
+   .sdma_reqs  = omap2420_dss_sdma_chs,
+   .sdma_reqs_cnt  = ARRAY_SIZE(omap2420_dss_sdma_chs),
+
+   .prcm   = {
+   .omap2 = {
+   .prcm_reg_id = 1,
+   .module_bit = OMAP24XX_EN_DSS1_SHIFT,
+   .module_offs = CORE_MOD,
+   .idlest_reg_id = 1,
+   .idlest_idle_bit = OMAP24XX_ST_DSS_SHIFT,
+   },
+   },
+   .opt_clks   = dss_opt_clks,
+   .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
+   .slaves = omap2420_dss_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap2420_dss_slaves),
+   .masters= omap2420_dss_masters,
+   .masters_cnt= ARRAY_SIZE(omap2420_dss_masters),
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+/*
+ * 'dispc' class
+ * display controller
+ */
+
+static struct omap_hwmod_class_sysconfig omap2420_dispc_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SIDLEMODE | 

[PATCH v3 03/17] OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

Hwmod needs database of all IPs in a system. This patch generates the hwmod
database for Display Sub System applicable for OMAP3430-ES2 onwards and
OMAP36xx.  DSS is also considered as an IP as DISPC, RFBI and named as dss_dss.
For all the IP modules in DSS, same clock is needed for enabling. Hwmod sees
DSS IPs as independent IPs, so same clock has to be repeated for .main_clk in
each IP.

OMAP3430ES1 do not have IDLEST bit to poll on for dss IP.  So this hwmod is
not applicable for 3430ES1.

Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  339 
 1 files changed, 339 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 8d81813..5f5fbe8 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -44,6 +44,11 @@ static struct omap_hwmod omap3xxx_l3_main_hwmod;
 static struct omap_hwmod omap3xxx_l4_core_hwmod;
 static struct omap_hwmod omap3xxx_l4_per_hwmod;
 static struct omap_hwmod omap3xxx_wd_timer2_hwmod;
+static struct omap_hwmod omap3xxx_dss_dss_hwmod;
+static struct omap_hwmod omap3xxx_dss_dispc_hwmod;
+static struct omap_hwmod omap3xxx_dss_dsi1_hwmod;
+static struct omap_hwmod omap3xxx_dss_rfbi_hwmod;
+static struct omap_hwmod omap3xxx_dss_venc_hwmod;
 static struct omap_hwmod omap3xxx_i2c1_hwmod;
 static struct omap_hwmod omap3xxx_i2c2_hwmod;
 static struct omap_hwmod omap3xxx_i2c3_hwmod;
@@ -84,6 +89,13 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_slaves[] = 
{
&omap3xxx_mpu__l3_main,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap3xxx_dss__l3 = {
+   .master = &omap3xxx_dss_dss_hwmod,
+   .slave  = &omap3xxx_l3_main_hwmod,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* Master interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = {
&omap3xxx_l3_main__l4_core,
@@ -664,6 +676,326 @@ static struct omap_hwmod_class i2c_class = {
.sysc = &i2c_sysc,
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_dss_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap3xxx_dss_hwmod_class = {
+   .name = "dss",
+   .sysc = &omap3xxx_dss_sysc,
+};
+
+/* dss */
+static struct omap_hwmod_irq_info omap3xxx_dss_irqs[] = {
+   { .irq = 25 },
+};
+
+static struct omap_hwmod_dma_info omap3xxx_dss_sdma_chs[] = {
+   { .name = "dispc", .dma_req = 5 },
+   { .name = "dsi1", .dma_req = 74 },
+};
+
+/* dss */
+/* dss master ports */
+static struct omap_hwmod_ocp_if *omap3xxx_dss_masters[] = {
+   &omap3xxx_dss__l3,
+};
+
+static struct omap_hwmod_addr_space omap3xxx_dss_addrs[] = {
+   {
+   .pa_start   = 0x4805,
+   .pa_end = 0x480503FF,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss = {
+   .master = &omap3xxx_l4_core_hwmod,
+   .slave  = &omap3xxx_dss_dss_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap3xxx_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap3xxx_dss_addrs),
+   .user   = OCP_USER_MPU,
+};
+
+/* dss slave ports */
+static struct omap_hwmod_ocp_if *omap3xxx_dss_slaves[] = {
+   &omap3xxx_l4_core__dss,
+};
+
+static struct omap_hwmod_opt_clk dss_opt_clks[] = {
+   { .role = "tv_clk", .clk = "dss_tv_fck" },
+   { .role = "dssclk", .clk = "dss_96m_fck" },
+   { .role = "sys_clk", .clk = "dss2_alwon_fck" },
+};
+
+static struct omap_hwmod omap3xxx_dss_dss_hwmod = {
+   .name   = "dss_dss",
+   .class  = &omap3xxx_dss_hwmod_class,
+   .main_clk   = "dss1_alwon_fck", /* instead of dss_fck */
+   .mpu_irqs   = omap3xxx_dss_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap3xxx_dss_irqs),
+   .sdma_reqs  = omap3xxx_dss_sdma_chs,
+   .sdma_reqs_cnt  = ARRAY_SIZE(omap3xxx_dss_sdma_chs),
+
+   .prcm   = {
+   .omap2 = {
+   .prcm_reg_id = 1,
+   .module_bit = OMAP3430_EN_DSS1_SHIFT,
+   .module_offs = OMAP3430_DSS_MOD,
+   .idlest_reg_id = 1,
+   .idlest_idle_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT,
+   },
+   },
+   .opt_clks   = dss_opt_clks,
+   .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
+   .slaves = omap3xxx_dss_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_slaves),
+   .masters= omap3xxx_dss_masters,
+   .masters_cnt  

[PATCH v3 15/17] OMAP2,3: DSS2: DSI Move init, exit to driver

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

For hwmod adaptation, move init exit methods from core.c to its driver probe,
remove.  pdev member has to be maintained by its own drivers.  Regulator has
to be privately handled in each driver.

Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/board-3430sdp.c |1 +
 drivers/video/omap2/dss/core.c  |8 
 drivers/video/omap2/dss/dsi.c   |   29 ++---
 3 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 83baba7..88f5b01 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -527,6 +527,7 @@ static struct regulator_init_data sdp3430_vdac = {
 /* VPLL2 for digital video outputs */
 static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
+   REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
 };
 
 static struct regulator_init_data sdp3430_vpll2 = {
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 6f9fc38..21944d7 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -190,11 +190,6 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_sdi;
}
 
-   r = dsi_init(pdev);
-   if (r) {
-   DSSERR("Failed to initialize DSI\n");
-   goto err_dsi;
-   }
}
 
r = dss_initialize_debugfs();
@@ -227,9 +222,6 @@ err_register:
dss_uninitialize_debugfs();
 err_debugfs:
if (cpu_is_omap34xx())
-   dsi_exit();
-err_dsi:
-   if (cpu_is_omap34xx())
sdi_exit();
 err_sdi:
dpi_exit();
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 037d366..b592075 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -222,6 +222,7 @@ struct dsi_irq_stats {
 
 static struct
 {
+   struct platform_device *pdev;
void __iomem*base;
 
struct dsi_clock_info current_cinfo;
@@ -277,6 +278,20 @@ static struct
 #endif
 } dsi;
 
+static struct regulator *dsi_get_vdds_dsi(void)
+{
+   struct regulator *reg;
+
+   if (dsi.vdds_dsi_reg != NULL)
+   return dsi.vdds_dsi_reg;
+
+   reg = regulator_get(&dsi.pdev->dev, "vdds_dsi");
+   if (!IS_ERR(reg))
+   dsi.vdds_dsi_reg = reg;
+
+   return reg;
+}
+
 #ifdef DEBUG
 static unsigned int dsi_perf;
 module_param_named(dsi_perf, dsi_perf, bool, 0644);
@@ -3271,7 +3286,7 @@ int dsi_init(struct platform_device *pdev)
goto err1;
}
 
-   dsi.vdds_dsi_reg = dss_get_vdds_dsi();
+   dsi.vdds_dsi_reg = dsi_get_vdds_dsi();
if (IS_ERR(dsi.vdds_dsi_reg)) {
DSSERR("can't get VDDS_DSI regulator\n");
r = PTR_ERR(dsi.vdds_dsi_reg);
@@ -3306,11 +3321,20 @@ void dsi_exit(void)
 /* DSI1 HW IP initialisation */
 static int omap_dsi1hw_probe(struct platform_device *pdev)
 {
-   return 0;
+   int r;
+   dsi.pdev = pdev;
+   r = dsi_init(pdev);
+   if (r) {
+   DSSERR("Failed to initialize DSI\n");
+   goto err_dsi;
+   }
+err_dsi:
+   return r;
 }
 
 static int omap_dsi1hw_remove(struct platform_device *pdev)
 {
+   dsi_exit();
return 0;
 }
 
@@ -3330,4 +3354,3 @@ static int __init omap_dsi1_init(void)
 
 device_initcall(omap_dsi1_init);
 
-
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 08/17] OMAP2,3: DSS2: Create platform_driver for each DSS HW IP

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver. 
Platform driver of dsshw has to be registered before of dispc, rfbi, dsi1,
venc and omapdisplay driver should be after all the HW IPs. Sequence it with
arch_initcall and device_initcall_sync.

Signed-off-by: Senthilvadivu Guruswamy 
---
 drivers/video/omap2/dss/core.c  |2 +-
 drivers/video/omap2/dss/dispc.c |   28 
 drivers/video/omap2/dss/dsi.c   |   29 -
 drivers/video/omap2/dss/dss.c   |   27 +++
 drivers/video/omap2/dss/rfbi.c  |   28 
 drivers/video/omap2/dss/venc.c  |   28 
 6 files changed, 140 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 48d20d8..d165434 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -989,7 +989,7 @@ static int __init omap_dss_init2(void)
 }
 
 core_initcall(omap_dss_init);
-device_initcall(omap_dss_init2);
+device_initcall_sync(omap_dss_init2);
 #endif
 
 MODULE_AUTHOR("Tomi Valkeinen ");
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index fa40fa5..942dea5 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3167,3 +3167,31 @@ int dispc_setup_plane(enum omap_plane plane,
 
return r;
 }
+
+/* DISPC HW IP initialisation */
+static int omap_dispchw_probe(struct platform_device *pdev)
+{
+   return 0;
+}
+
+static int omap_dispchw_remove(struct platform_device *pdev)
+{
+   return 0;
+}
+
+static struct platform_driver omap_dispchw_driver = {
+   .probe  = omap_dispchw_probe,
+   .remove = omap_dispchw_remove,
+   .driver = {
+   .name   = "omap_dispc",
+   .owner  = THIS_MODULE,
+   },
+};
+
+static int __init omap_dispc_init(void)
+{
+   return platform_driver_register(&omap_dispchw_driver);
+}
+
+device_initcall(omap_dispc_init);
+
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index aa4f7a5..037d366 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -292,7 +292,6 @@ static inline u32 dsi_read_reg(const struct dsi_reg idx)
return __raw_readl(dsi.base + idx.idx);
 }
 
-
 void dsi_save_context(void)
 {
 }
@@ -3304,3 +3303,31 @@ void dsi_exit(void)
DSSDBG("omap_dsi_exit\n");
 }
 
+/* DSI1 HW IP initialisation */
+static int omap_dsi1hw_probe(struct platform_device *pdev)
+{
+   return 0;
+}
+
+static int omap_dsi1hw_remove(struct platform_device *pdev)
+{
+   return 0;
+}
+
+static struct platform_driver omap_dsi1hw_driver = {
+   .probe  = omap_dsi1hw_probe,
+   .remove = omap_dsi1hw_remove,
+   .driver = {
+   .name   = "omap_dsi1",
+   .owner  = THIS_MODULE,
+   },
+};
+
+static int __init omap_dsi1_init(void)
+{
+   return platform_driver_register(&omap_dsi1hw_driver);
+}
+
+device_initcall(omap_dsi1_init);
+
+
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 77c3621..6d0bd89 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -639,3 +639,30 @@ void dss_exit(void)
iounmap(dss.base);
 }
 
+/* DSS HW IP initialisation */
+static int omap_dsshw_probe(struct platform_device *pdev)
+{
+   return 0;
+}
+
+static int omap_dsshw_remove(struct platform_device *pdev)
+{
+   return 0;
+}
+
+static struct platform_driver omap_dsshw_driver = {
+   .probe  = omap_dsshw_probe,
+   .remove = omap_dsshw_remove,
+   .driver = {
+   .name   = "omap_dss",
+   .owner  = THIS_MODULE,
+   },
+};
+
+static int __init omap_dss_init1(void)
+{
+   return platform_driver_register(&omap_dsshw_driver);
+}
+
+arch_initcall(omap_dss_init1);
+
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index bbe6246..a086233 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -1054,3 +1054,31 @@ int rfbi_init_display(struct omap_dss_device *dssdev)
dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
return 0;
 }
+
+/* RFBI HW IP initialisation */
+static int omap_rfbihw_probe(struct platform_device *pdev)
+{
+   return 0;
+}
+
+static int omap_rfbihw_remove(struct platform_device *pdev)
+{
+   return 0;
+}
+
+static struct platform_driver omap_rfbihw_driver = {
+   .probe  = omap_rfbihw_probe,
+   .remove = omap_rfbihw_remove,
+   .driver = {
+   .name   = "omap_rfbi",
+   .owner  = THIS_MODULE,
+   },
+};
+
+static int __init omap_rfbi_init(void)
+{
+   return platform_driver_register(&omap_rfbihw_driver);
+}
+
+device_initcall(omap_rfbi_init);
+
diff --git a/drivers/video/omap2/dss/

[PATCH v3 17/17] OMAP2,3: DSS2: Get DSS IRQ from platform device

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

DSS IRQ number can be obtained from platform_get_irq().  This API in turn
picks the right IRQ number belonging to HW IP from the hwmod database.
So hardcoding of IRQ number could be removed.

Signed-off-by: Senthilvadivu Guruswamy 
---
 drivers/video/omap2/dss/dss.c |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index f544160..8fafae9 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -565,7 +565,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
 
 int dss_init(bool skip_init)
 {
-   int r;
+   int r, dss_irq;
u32 rev;
struct resource *dss_mem;
 
@@ -611,15 +611,18 @@ int dss_init(bool skip_init)
REG_FLD_MOD(DSS_CONTROL, 0, 2, 2);  /* venc clock mode = normal */
 #endif
 
-   r = request_irq(INT_24XX_DSS_IRQ,
+   dss_irq = platform_get_irq(dss.pdev, 0);
+   if (dss_irq != -ENXIO) {
+   r = request_irq(dss_irq,
cpu_is_omap24xx()
? dss_irq_handler_omap2
: dss_irq_handler_omap3,
0, "OMAP DSS", NULL);
 
-   if (r < 0) {
-   DSSERR("omap2 dss: request_irq failed\n");
-   goto fail1;
+   if (r < 0) {
+   DSSERR("omap2 dss: request_irq failed\n");
+   goto fail1;
+   }
}
 
if (cpu_is_omap34xx()) {
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 00/17] OMAP2,3: hwmod DSS Adaptation

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

v3 of the DSS hwmod patch series focus on fixing the review comments. OMAP4 
hwmod support will be posted after the acceptance of this basic change in
the dss2 design.

This patch series decouples the "Clocks for DSS in hwmod adaptation" changes
from this series.  Another series would be posted which could be discussed
w.r.t clocks in DSS across omap2,3.

Removing the SYSCONFIG settings from DSS driver would also be part of these
clock changes series and not covered in this series as it depends on some of
the omap_hwmod framework changes w.r.t opt clocks handling.

Summary of the hwmod DSS design:

DSS, DISPC, DSI, RFBI, VENC are made as platform drivers each 
corresponding to the hwmod class in the hwmod database. 

No Hardcoding of silicon data:
hwmod database abstracts the SOC data like base addr, irq numbers and are
implemented in this patch series.

Continue to have custom bus for display panels:
"omapdss" driver continues to be a platform driver that registers the custom
bus.  It also continues to register the display panels(omap_dss_device) on the
board to the panel drivers (omap_dss_driver)
For Eg:  primary lcd device would be registered with lcd panel driver.
lcd panel driver if it is on a parallel interface would use library functions 
exported from dpi.o.  if it is on a dsi interface would use library functions
exported from dsi platform driver(dsi.o).

Clocks:
Handling of clocks in DSS only is one of the design approaches, that does not
change the existing implementation.  If each of the DSS HW IPs had to handle
their own clocks, then corresponding clock changes can be requested in the hwmod
database as well which is not the current design/implementation.  As stated, 
this would be handled in another series seperately.
For Eg: VENC would need 54MCLK which is termed as dss_opt clocks as of now apart
for the dss main clocks.  Currently VENC driver needs to be aware of this and 
has to
use clk_get/put, clk_enable/disable, since VENC hwmod is not aware of 54MCLK.



Current dss driver:
---
1.  Omapdss platform driver
- initialises necessary Ips dss, dispc.
- also initialises Ips like sdi, dsi, venc, rfbi
- creates a custom bus and registers the display devices/drivers
connected on the board to the custom bus.

2.  Suspend/resume of omapdss
- in turn sends suspend/resume calls for each of the display devices
registered to it.

Modified change:
---
Platform driver for each DSS HW IP in addition to the software "omapdss"
driver.

Omapdss platform driver
- initialises necessary software libraries like dpi, sdi.
- continues to have a custom bus and registers the display devices 
and drivers connected on the board to the custom bus.
- continues to handle suspend/resume of the display devices registered
to the custom bus.

DSS platform driver
- initialises DSS IP alone
- Handles the clocks related to the DSS and other DSSHW IPs like RFBI,
DSI, VENC, DISPC.  Previously this was a part of "omapdss" driver in 
core.c
- Continues to handle the DSS IRQs.
- No suspend/resume hooks.

DISPC platform driver
- initialises DISPC IP alone
- Gets the required clock from DSS platform driver.
- No suspend/resume hooks.
- Continues to provide DISPC library functions.

DSI platform driver
- initialises DSI IP alone
- Gets the required clock from DSS platform driver.
- No suspend/resume hooks.
- Continues to provide DISPC library functions.

RFBI, VENC platform drivers
- initialises DSI,VENC IPs
- Gets the required clock from DSS platform driver.
- No suspend/resume hooks.
- Continues to provide DISPC library functions.

Testing:
-
The patches are tested on 2420-n800, 2430sdp, 3630zoom, 3430sdp.
Complete bootup with penguins on panel is done on 3430sdp.
For the rest of the mentioned platforms, kernel is built with "OMAP2_DSS"
and bootup is tested so that base address and clk_get calls are successful.

Changes since RFC:
---
1) All the platform driver registration except DSS, were within the file core.c.
Registeration of these driver got seperated to its own file.
2) Usage of regulators by different drivers are implemented.
For Eg: Regulator used by VENC is moved to venc driver.  But vdda_dac would be 
needed by DPI and DSI as well.
4) OMAP2420 and OMAP2430 hwmod database are generated in this v1.
5) Module support for omapdss driver can continue as the DSS HW IP specific 
platform
drivers are decoupled from omapdss driver.
6) Following review comments incorporated:
Changed the hwmod device name from "dss" to "dss_dss"
Changed name of core driver from "omapdss" to "omap_display" as it 
deals with panels.
Fixed comments on return values from platform_get_resource/irq 

[PATCH v3 13/17] OMAP2,3: DSS2: DISPC Move init,exit to driver

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

For hwmod adaptation, move init exit methods from core.c to its driver probe,
remove.   pdev member has to be maintained by its own drivers.  Replace printk
with dev_dbg for boot time optimization.

Signed-off-by: Senthilvadivu Guruswamy 
---
 drivers/video/omap2/dss/core.c  |9 -
 drivers/video/omap2/dss/dispc.c |   75 +-
 2 files changed, 34 insertions(+), 50 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index edb025c..3711553 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -198,12 +198,6 @@ static int omap_dss_probe(struct platform_device *pdev)
goto err_dpi;
}
 
-   r = dispc_init();
-   if (r) {
-   DSSERR("Failed to initialize dispc\n");
-   goto err_dispc;
-   }
-
r = venc_init(pdev);
if (r) {
DSSERR("Failed to initialize venc\n");
@@ -261,8 +255,6 @@ err_dsi:
 err_sdi:
venc_exit();
 err_venc:
-   dispc_exit();
-err_dispc:
dpi_exit();
 err_dpi:
 
@@ -277,7 +269,6 @@ static int omap_dss_remove(struct platform_device *pdev)
dss_uninitialize_debugfs();
 
venc_exit();
-   dispc_exit();
dpi_exit();
if (cpu_is_omap34xx()) {
dsi_exit();
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 942dea5..57de1c9 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -173,6 +173,7 @@ struct dispc_irq_stats {
 };
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
u32 fifo_size[3];
@@ -3079,47 +3080,6 @@ static void _omap_dispc_initial_config(void)
dispc_read_plane_fifo_sizes();
 }
 
-int dispc_init(void)
-{
-   u32 rev;
-
-   spin_lock_init(&dispc.irq_lock);
-
-#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
-   spin_lock_init(&dispc.irq_stats_lock);
-   dispc.irq_stats.last_reset = jiffies;
-#endif
-
-   INIT_WORK(&dispc.error_work, dispc_error_worker);
-
-   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
-   if (!dispc.base) {
-   DSSERR("can't ioremap DISPC\n");
-   return -ENOMEM;
-   }
-
-   enable_clocks(1);
-
-   _omap_dispc_initial_config();
-
-   _omap_dispc_initialize_irq();
-
-   dispc_save_context();
-
-   rev = dispc_read_reg(DISPC_REVISION);
-   printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
-  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
-
-   enable_clocks(0);
-
-   return 0;
-}
-
-void dispc_exit(void)
-{
-   iounmap(dispc.base);
-}
-
 int dispc_enable_plane(enum omap_plane plane, bool enable)
 {
DSSDBG("dispc_enable_plane %d, %d\n", plane, enable);
@@ -3171,11 +3131,44 @@ int dispc_setup_plane(enum omap_plane plane,
 /* DISPC HW IP initialisation */
 static int omap_dispchw_probe(struct platform_device *pdev)
 {
+   u32 rev;
+   dispc.pdev = pdev;
+
+   spin_lock_init(&dispc.irq_lock);
+
+#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
+   spin_lock_init(&dispc.irq_stats_lock);
+   dispc.irq_stats.last_reset = jiffies;
+#endif
+
+   INIT_WORK(&dispc.error_work, dispc_error_worker);
+
+   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
+   if (!dispc.base) {
+   DSSERR("can't ioremap DISPC\n");
+   return -ENOMEM;
+   }
+
+   enable_clocks(1);
+
+   _omap_dispc_initial_config();
+
+   _omap_dispc_initialize_irq();
+
+   dispc_save_context();
+
+   rev = dispc_read_reg(DISPC_REVISION);
+   dev_dbg(&pdev->dev, "OMAP DISPC rev %d.%d\n",
+  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
+
+   enable_clocks(0);
+
return 0;
 }
 
 static int omap_dispchw_remove(struct platform_device *pdev)
 {
+   iounmap(dispc.base);
return 0;
 }
 
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 02/17] OMAP2430: hwmod data: add DSS DISPC RFBI VENC

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

Hwmod needs database of all IPs in a system. This patch generates the hwmod
database for OMAP2430 Display Sub System. Since DSS is also considered as an
IP as DISPC, RFBI, name it as dss_dss.

Signed-off-by: Senthilvadivu Guruswamy 
Acked-by: Benoit Cousson 
---
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |  282 
 1 files changed, 282 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 8ecfbcd..b06eeea 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -38,6 +38,10 @@ static struct omap_hwmod omap2430_mpu_hwmod;
 static struct omap_hwmod omap2430_iva_hwmod;
 static struct omap_hwmod omap2430_l3_main_hwmod;
 static struct omap_hwmod omap2430_l4_core_hwmod;
+static struct omap_hwmod omap2430_dss_dss_hwmod;
+static struct omap_hwmod omap2430_dss_dispc_hwmod;
+static struct omap_hwmod omap2430_dss_rfbi_hwmod;
+static struct omap_hwmod omap2430_dss_venc_hwmod;
 static struct omap_hwmod omap2430_wd_timer2_hwmod;
 static struct omap_hwmod omap2430_gpio1_hwmod;
 static struct omap_hwmod omap2430_gpio2_hwmod;
@@ -65,6 +69,13 @@ static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = 
{
&omap2430_mpu__l3_main,
 };
 
+/* DSS -> l3 */
+static struct omap_hwmod_ocp_if omap2430_dss__l3 = {
+   .master = &omap2430_dss_dss_hwmod,
+   .slave  = &omap2430_l3_main_hwmod,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /* Master interfaces on the L3 interconnect */
 static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = {
&omap2430_l3_main__l4_core,
@@ -469,6 +480,271 @@ static struct omap_hwmod omap2430_uart3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
 };
 
+/*
+ * 'dss' class
+ * display sub-system
+ */
+
+static struct omap_hwmod_class_sysconfig omap2430_dss_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2430_dss_hwmod_class = {
+   .name = "dss",
+   .sysc = &omap2430_dss_sysc,
+};
+
+/* dss */
+static struct omap_hwmod_irq_info omap2430_dss_irqs[] = {
+   { .irq = 25 },
+};
+static struct omap_hwmod_dma_info omap2430_dss_sdma_chs[] = {
+   { .name = "dispc", .dma_req = 5 },
+};
+
+/* dss */
+/* dss master ports */
+static struct omap_hwmod_ocp_if *omap2430_dss_masters[] = {
+   &omap2430_dss__l3,
+};
+
+static struct omap_hwmod_addr_space omap2430_dss_addrs[] = {
+   {
+   .pa_start   = 0x4805,
+   .pa_end = 0x480503FF,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* l4_core -> dss */
+static struct omap_hwmod_ocp_if omap2430_l4_core__dss = {
+   .master = &omap2430_l4_core_hwmod,
+   .slave  = &omap2430_dss_dss_hwmod,
+   .clk= "dss_ick",
+   .addr   = omap2430_dss_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap2430_dss_addrs),
+   .user   = OCP_USER_MPU,
+};
+
+/* dss slave ports */
+static struct omap_hwmod_ocp_if *omap2430_dss_slaves[] = {
+   &omap2430_l4_core__dss,
+};
+
+static struct omap_hwmod_opt_clk dss_opt_clks[] = {
+   { .role = "tv_clk", .clk = "dss_54m_fck" },
+   { .role = "sys_clk", .clk = "dss2_fck" },
+};
+
+static struct omap_hwmod omap2430_dss_dss_hwmod = {
+   .name   = "dss_dss",
+   .class  = &omap2430_dss_hwmod_class,
+   .main_clk   = "dss1_fck", /* instead of dss_fck */
+   .mpu_irqs   = omap2430_dss_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap2430_dss_irqs),
+   .sdma_reqs  = omap2430_dss_sdma_chs,
+   .sdma_reqs_cnt  = ARRAY_SIZE(omap2430_dss_sdma_chs),
+
+   .prcm   = {
+   .omap2 = {
+   .prcm_reg_id = 1,
+   .module_bit = OMAP24XX_EN_DSS1_SHIFT,
+   .module_offs = CORE_MOD,
+   .idlest_reg_id = 1,
+   .idlest_idle_bit = OMAP24XX_ST_DSS_SHIFT,
+   },
+   },
+   .opt_clks   = dss_opt_clks,
+   .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
+   .slaves = omap2430_dss_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap2430_dss_slaves),
+   .masters= omap2430_dss_masters,
+   .masters_cnt= ARRAY_SIZE(omap2430_dss_masters),
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+/*
+ * 'dispc' class
+ * display controller
+ */
+
+static struct omap_hwmod_class_sysconfig omap2430_dispc_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SIDLEMODE | SYS

[PATCH v3 09/17] OMAP2,3: DSS2: Move clocks from core driver to dss driver

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

clks are moved to dss platform driver.  clk_get/put APIs use dss device instead
of core platform device. So the device name is changed from omap_display to
omap_dss in 2420, 2430, 3xxx clock database files. Now teh core driver
"omap_display" only takes care of panel registration with the custom bus.
dss driver would take care of the clocks needed by DISPC, RFBI, DSI, VENC.

TODO:  The clock content would be adapted to omap_hwmod in a seperate series.

Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/clock2420_data.c |8 +-
 arch/arm/mach-omap2/clock2430_data.c |8 +-
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +-
 drivers/video/omap2/dss/core.c   |  372 +-
 drivers/video/omap2/dss/dss.c|  380 +-
 drivers/video/omap2/dss/dss.h|   14 +-
 6 files changed, 405 insertions(+), 391 deletions(-)

diff --git a/arch/arm/mach-omap2/clock2420_data.c 
b/arch/arm/mach-omap2/clock2420_data.c
index a220820..7a56c67 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1786,10 +1786,10 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL,   "gfx_2d_fck",   &gfx_2d_fck,CK_242X),
CLK(NULL,   "gfx_ick",  &gfx_ick,   CK_242X),
/* DSS domain clocks */
-   CLK("omap_display", "ick",  &dss_ick,   CK_242X),
-   CLK("omap_display", "dss1_fck", &dss1_fck,  CK_242X),
-   CLK("omap_display", "dss2_fck", &dss2_fck,  CK_242X),
-   CLK("omap_display", "tv_fck",   &dss_54m_fck,   CK_242X),
+   CLK("omap_dss", "ick",  &dss_ick,   CK_242X),
+   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_242X),
+   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_242X),
+   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_242X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_242X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_242X),
diff --git a/arch/arm/mach-omap2/clock2430_data.c 
b/arch/arm/mach-omap2/clock2430_data.c
index 78f7712..48d3437 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1890,10 +1890,10 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL,   "mdm_ick",  &mdm_ick,   CK_243X),
CLK(NULL,   "mdm_osc_ck",   &mdm_osc_ck,CK_243X),
/* DSS domain clocks */
-   CLK("omap_display", "ick",  &dss_ick,   CK_243X),
-   CLK("omap_display", "dss1_fck", &dss1_fck,  CK_243X),
-   CLK("omap_display", "dss2_fck", &dss2_fck,  CK_243X),
-   CLK("omap_display", "tv_fck",   &dss_54m_fck,   CK_243X),
+   CLK("omap_dss", "ick",  &dss_ick,   CK_243X),
+   CLK("omap_dss", "dss1_fck", &dss1_fck,  CK_243X),
+   CLK("omap_dss", "dss2_fck", &dss2_fck,  CK_243X),
+   CLK("omap_dss", "tv_fck",   &dss_54m_fck,   CK_243X),
/* L3 domain clocks */
CLK(NULL,   "core_l3_ck",   &core_l3_ck,CK_243X),
CLK(NULL,   "ssi_fck",  &ssi_ssr_sst_fck, CK_243X),
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 8c9e4c4..be9077b 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3355,13 +3355,13 @@ static struct omap_clk omap3xxx_clks[] = {
CLK("omap_rng", "ick",  &rng_ick,   CK_34XX | CK_36XX),
CLK(NULL,   "sha11_ick",&sha11_ick, CK_34XX | CK_36XX),
CLK(NULL,   "des1_ick", &des1_ick,  CK_34XX | CK_36XX),
-   CLK("omap_display", "dss1_fck", &dss1_alwon_fck_3430es1, 
CK_3430ES1),
-   CLK("omap_display", "dss1_fck", &dss1_alwon_fck_3430es2, 
CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
-   CLK("omap_display", "tv_fck",   &dss_tv_fck,CK_3XXX),
-   CLK("omap_display", "video_fck",&dss_96m_fck,   CK_3XXX),
-   CLK("omap_display", "dss2_fck", &dss2_alwon_fck, CK_3XXX),
-   CLK("omap_display", "ick",  &dss_ick_3430es1,   
CK_3430ES1),
-   CLK("omap_display", "ick",  &dss_ick_3430es2,   
CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
+   CLK("omap_dss", "dss1_fck", &dss1_alwon_fck_3430es1, CK_3430ES1),
+   CLK("omap_dss", "dss1_fck", &dss1_alwon_fck_3430es2, CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
+   CLK("omap_dss", "tv_fck",   &dss_tv_fck,CK_3XXX),
+   CLK("omap_dss", "video_fck",&dss_96m_fck,   CK_3XXX),
+   CLK("omap_dss", "dss2_fck", &dss2_alwon_fck, CK_3XXX),
+   CLK("omap_dss", "ick",  &dss_ick_3430es1,   CK_3430ES1),
+   CLK("omap_dss", "ick",  &dss_ick_3430es2,   CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
CLK(NULL,   "cam_mclk", &cam_mclk, 

[PATCH v3 04/17] OMAP2,3 DSS2 Change driver name to omap_display

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

Change the driver name from omapdss to omap_display as the driver takes care of
the display devices ie number of panels, type of panels available in the
platform.  Change the device name in the board files and 2420,2430,3xxx clock
files from omapdss to omap_display to match the driver name.

Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/board-3430sdp.c  |2 +-
 arch/arm/mach-omap2/board-am3517evm.c|2 +-
 arch/arm/mach-omap2/board-cm-t35.c   |2 +-
 arch/arm/mach-omap2/board-devkit8000.c   |6 +++---
 arch/arm/mach-omap2/board-igep0020.c |2 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |6 +++---
 arch/arm/mach-omap2/board-omap3evm.c |4 ++--
 arch/arm/mach-omap2/board-omap3pandora.c |8 
 arch/arm/mach-omap2/board-omap3stalker.c |2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |4 ++--
 arch/arm/mach-omap2/board-rx51-video.c   |2 +-
 arch/arm/mach-omap2/clock2420_data.c |8 
 arch/arm/mach-omap2/clock2430_data.c |8 
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +++---
 drivers/video/omap2/dss/core.c   |2 +-
 15 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 3b39ef1..10a399e 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -302,7 +302,7 @@ static struct omap_dss_board_info sdp3430_dss_data = {
 };
 
 static struct platform_device sdp3430_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &sdp3430_dss_data,
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index bc15626..2b37dcf 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -368,7 +368,7 @@ static struct omap_dss_board_info am3517_evm_dss_data = {
 };
 
 static struct platform_device am3517_evm_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data  = &am3517_evm_dss_data,
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 486a3de..f0293a3 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -391,7 +391,7 @@ static struct omap_dss_board_info cm_t35_dss_data = {
 };
 
 static struct platform_device cm_t35_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &cm_t35_dss_data,
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 451e7ff..f948435 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -189,7 +189,7 @@ static struct omap_dss_board_info devkit8000_dss_data = {
 };
 
 static struct platform_device devkit8000_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &devkit8000_dss_data,
@@ -197,7 +197,7 @@ static struct platform_device devkit8000_dss_device = {
 };
 
 static struct regulator_consumer_supply devkit8000_vdda_dac_supply =
-   REGULATOR_SUPPLY("vdda_dac", "omapdss");
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 static uint32_t board_keymap[] = {
KEY(0, 0, KEY_1),
@@ -272,7 +272,7 @@ static struct twl4030_gpio_platform_data 
devkit8000_gpio_data = {
 };
 
 static struct regulator_consumer_supply devkit8000_vpll1_supply =
-   REGULATOR_SUPPLY("vdds_dsi", "omapdss");
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data devkit8000_vmmc1 = {
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index 0afa301..46985eb 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -479,7 +479,7 @@ static struct omap_dss_board_info igep2_dss_data = {
 };
 
 static struct platform_device igep2_dss_device = {
-   .name   = "omapdss",
+   .name   = "omap_display",
.id = -1,
.dev= {
.platform_data = &igep2_dss_data,
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 6c12760..ebfddb8 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -223,7 +223,7 @@ static struct omap_dss_board_info beagle_dss_data = {
 };
 
 static struct platform_device beagle_dss_devic

[PATCH v3 11/17] OMAP2,3: DSS2: DSS Move init,exit to driver

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

For hwmod adaptation, move init exit methods from core.c to its driver probe,
remove. pdev member has to be maintained by its own drivers.

Signed-off-by: Senthilvadivu Guruswamy 
---
 drivers/video/omap2/dss/core.c |   16 
 drivers/video/omap2/dss/dss.c  |   16 
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 0d5f6dd..5b0f551 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -192,18 +192,6 @@ static int omap_dss_probe(struct platform_device *pdev)
 
dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
 
-#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
-   /* DISPC_CONTROL */
-   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
-   skip_init = 1;
-#endif
-
-   r = dss_init(skip_init);
-   if (r) {
-   DSSERR("Failed to initialize DSS\n");
-   goto err_dss;
-   }
-
r = rfbi_init();
if (r) {
DSSERR("Failed to initialize rfbi\n");
@@ -285,8 +273,6 @@ err_dispc:
 err_dpi:
rfbi_exit();
 err_rfbi:
-   dss_exit();
-err_dss:
 
return r;
 }
@@ -307,8 +293,6 @@ static int omap_dss_remove(struct platform_device *pdev)
sdi_exit();
}
 
-   dss_exit();
-
dss_uninit_overlays(pdev);
dss_uninit_overlay_managers(pdev);
 
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 99dd490..b622d04 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -964,6 +964,7 @@ void dss_debug_dump_clocks(struct seq_file *s)
 static int omap_dsshw_probe(struct platform_device *pdev)
 {
int r;
+   int skip_init = 0;
 
dss.pdev = pdev;
 
@@ -978,6 +979,19 @@ static int omap_dsshw_probe(struct platform_device *pdev)
dss.ctx_id = dss_get_ctx_id();
DSSDBG("initial ctx id %u\n", dss.ctx_id);
 
+#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
+   /* DISPC_CONTROL */
+   if (omap_readl(0x48050440) & 1) /* LCD enabled? */
+   skip_init = 1;
+#endif
+
+   r = dss_init(skip_init);
+   if (r) {
+   DSSERR("Failed to initialize DSS\n");
+   goto err_dss;
+   }
+
+err_dss:
dss_clk_disable_all_no_ctx();
 err_clocks:
 
@@ -988,6 +1002,8 @@ static int omap_dsshw_remove(struct platform_device *pdev)
 {
int c;
 
+   dss_exit();
+
/* these should be removed at some point */
c = dss.dss_ick->usecount;
if (c > 0) {
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 16/17] OMAP2,3: DSS2: Use platform device to get baseaddr

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

DSS, DISPC, DSI, RFBI, VENC baseaddr can be obtained from 
platform_get_resource().
This API in turn picks the right silicon baseaddr from the hwmod database.
So hardcoding of base addr could be removed.

Signed-off-by: Senthilvadivu Guruswamy 
---
 drivers/video/omap2/dss/dispc.c |   11 ---
 drivers/video/omap2/dss/dsi.c   |   12 +---
 drivers/video/omap2/dss/dss.c   |   11 ---
 drivers/video/omap2/dss/rfbi.c  |   10 +++---
 drivers/video/omap2/dss/venc.c  |   11 ---
 5 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 57de1c9..7ce65c6 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -42,8 +42,6 @@
 #include "dss_features.h"
 
 /* DISPC */
-#define DISPC_BASE 0x48050400
-
 #define DISPC_SZ_REGS  SZ_1K
 
 struct dispc_reg { u16 idx; };
@@ -3132,6 +3130,8 @@ int dispc_setup_plane(enum omap_plane plane,
 static int omap_dispchw_probe(struct platform_device *pdev)
 {
u32 rev;
+   struct resource *dispc_mem;
+
dispc.pdev = pdev;
 
spin_lock_init(&dispc.irq_lock);
@@ -3143,7 +3143,12 @@ static int omap_dispchw_probe(struct platform_device 
*pdev)
 
INIT_WORK(&dispc.error_work, dispc_error_worker);
 
-   dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
+   dispc_mem = platform_get_resource(dispc.pdev, IORESOURCE_MEM, 0);
+   if (!dispc_mem) {
+   DSSERR("can't get IORESOURCE_MEM DISPC\n");
+   return -EINVAL;
+   }
+   dispc.base = ioremap(dispc_mem->start, resource_size(dispc_mem));
if (!dispc.base) {
DSSERR("can't ioremap DISPC\n");
return -ENOMEM;
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index b592075..40e112b 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -42,8 +42,6 @@
 /*#define VERBOSE_IRQ*/
 #define DSI_CATCH_MISSING_TE
 
-#define DSI_BASE   0x4804FC00
-
 struct dsi_reg { u16 idx; };
 
 #define DSI_REG(idx)   ((const struct dsi_reg) { idx })
@@ -3253,6 +3251,7 @@ int dsi_init(struct platform_device *pdev)
 {
u32 rev;
int r;
+   struct resource *dsi_mem;
 
spin_lock_init(&dsi.errors_lock);
dsi.errors = 0;
@@ -3279,7 +3278,13 @@ int dsi_init(struct platform_device *pdev)
dsi.te_timer.function = dsi_te_timeout;
dsi.te_timer.data = 0;
 #endif
-   dsi.base = ioremap(DSI_BASE, DSI_SZ_REGS);
+   dsi_mem = platform_get_resource(dsi.pdev, IORESOURCE_MEM, 0);
+   if (!dsi_mem) {
+   DSSERR("can't get IORESOURCE_MEM DSI\n");
+   r = -EINVAL;
+   goto err0;
+   }
+   dsi.base = ioremap(dsi_mem->start, resource_size(dsi_mem));
if (!dsi.base) {
DSSERR("can't ioremap DSI\n");
r = -ENOMEM;
@@ -3306,6 +3311,7 @@ err2:
iounmap(dsi.base);
 err1:
destroy_workqueue(dsi.workqueue);
+err0:
return r;
 }
 
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index b622d04..f544160 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -35,8 +35,6 @@
 #include "dss.h"
 #include "dss_features.h"
 
-#define DSS_BASE   0x4805
-
 #define DSS_SZ_REGSSZ_512
 
 struct dss_reg {
@@ -569,8 +567,15 @@ int dss_init(bool skip_init)
 {
int r;
u32 rev;
+   struct resource *dss_mem;
 
-   dss.base = ioremap(DSS_BASE, DSS_SZ_REGS);
+   dss_mem = platform_get_resource(dss.pdev, IORESOURCE_MEM, 0);
+   if (!dss_mem) {
+   DSSERR("can't get IORESOURCE_MEM DSS\n");
+   r = -EINVAL;
+   goto fail0;
+   }
+   dss.base = ioremap(dss_mem->start, resource_size(dss_mem));
if (!dss.base) {
DSSERR("can't ioremap DSS\n");
r = -ENOMEM;
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 14a5262..33afbe8 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -36,8 +36,6 @@
 #include 
 #include "dss.h"
 
-#define RFBI_BASE   0x48050800
-
 struct rfbi_reg { u16 idx; };
 
 #define RFBI_REG(idx)  ((const struct rfbi_reg) { idx })
@@ -1017,6 +1015,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
 {
u32 rev;
u32 l;
+   struct resource *rfbi_mem;
 
rfbi.pdev = pdev;
 
@@ -1026,7 +1025,12 @@ static int omap_rfbihw_probe(struct platform_device 
*pdev)
atomic_set(&rfbi.cmd_fifo_full, 0);
atomic_set(&rfbi.cmd_pending, 0);
 
-   rfbi.base = ioremap(RFBI_BASE, SZ_256);
+   rfbi_mem = platform_get_resource(rfbi.pdev, IORESOURCE_MEM, 0);
+   if (!rfbi_mem) {
+   DSSERR("can't get IORESOURCE_MEM RFBI\n");
+ 

[PATCH v3 07/17] OMAP2,3: DSS2: Build omap_device for each DSS HWIP

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

Looks up the hwmod database for each of the given DSS HW IP and builds
omap_device which inturn does the platform device register for each of DSS HW IP

Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/devices.c |   50 +
 arch/arm/plat-omap/include/plat/display.h |6 +++
 2 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 27d1505..d2e87a5 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -938,10 +938,60 @@ static struct platform_device omap_display_device = {
},
 };
 
+static struct omap_device_pm_latency omap_dss_latency[] = {
+   [0] = {
+   .deactivate_func= omap_device_idle_hwmods,
+   .activate_func  = omap_device_enable_hwmods,
+   },
+};
+
 int __init omap_display_init(struct omap_dss_board_info
*board_data)
 {
int r = 0;
+   struct omap_hwmod *oh;
+   struct omap_device *od;
+   int i;
+   struct omap_display_platform_data pdata;
+   char *omap2_oh_name[] = { "dss_dss", "dss_dispc", "dss_rfbi",
+   "dss_venc" };
+   char *omap3_oh_name[] = { "dss_dss", "dss_dispc", "dss_rfbi",
+   "dss_venc", "dss_dsi1" };
+   char *omap2_dev_name[] = { "omap_dss", "omap_dispc", "omap_rfbi",
+   "omap_venc" };
+   char *omap3_dev_name[] = { "omap_dss", "omap_dispc", "omap_rfbi",
+   "omap_venc", "omap_dsi1" };
+   char *(*oh_name)[];
+   char *(*dev_name)[];
+   int oh_count;
+
+   if (cpu_is_omap24xx()) {
+   oh_name = &omap2_oh_name;
+   dev_name = &omap2_dev_name;
+   oh_count = ARRAY_SIZE(omap2_oh_name);
+   } else {
+   oh_name = &omap3_oh_name;
+   dev_name = &omap3_dev_name;
+   oh_count = ARRAY_SIZE(omap3_oh_name);
+   }
+
+   pdata.board_data=   board_data;
+   pdata.board_data->get_last_off_on_transaction_id = NULL;
+
+   for (i = 0; i < oh_count; i++) {
+   oh = omap_hwmod_lookup((*oh_name)[i]);
+   if (!oh) {
+   pr_err("Could not look up %s\n", (*oh_name)[i]);
+   return r;
+   }
+   od = omap_device_build((*dev_name)[i], -1, oh, &pdata,
+   sizeof(struct omap_display_platform_data),
+   omap_dss_latency,
+   ARRAY_SIZE(omap_dss_latency), 0);
+
+   WARN((IS_ERR(od)), "Could not build omap_device for %s\n",
+   (*oh_name)[i]);
+   }
omap_display_device.dev.platform_data = board_data;
 
r = platform_device_register(&omap_display_device);
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index 871bbae..23afd6d 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -26,6 +26,7 @@
 #include 
 #include 
 
+
 #define DISPC_IRQ_FRAMEDONE(1 << 0)
 #define DISPC_IRQ_VSYNC(1 << 1)
 #define DISPC_IRQ_EVSYNC_EVEN  (1 << 2)
@@ -224,6 +225,11 @@ struct omap_dss_board_info {
 /* Init with the board info */
 extern int omap_display_init(struct omap_dss_board_info *board_data);
 
+struct omap_display_platform_data {
+   struct omap_dss_board_info *board_data;
+   /* TODO: Additional members to be added when PM is considered */
+};
+
 struct omap_video_timings {
/* Unit: pixels */
u16 x_res;
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 12/17] OMAP2,3: DSS2: RFBI Move init,exit to driver

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

For hwmod adaptation, move init exit methods from core.c to its driver probe,
remove.  pdev member has to be maintained by its own drivers.  Replace printk
with dev_dbg for boot time optimization.

Signed-off-by: Senthilvadivu Guruswamy 
---
 drivers/video/omap2/dss/core.c |9 
 drivers/video/omap2/dss/rfbi.c |   80 ++--
 2 files changed, 36 insertions(+), 53 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 5b0f551..edb025c 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -192,12 +192,6 @@ static int omap_dss_probe(struct platform_device *pdev)
 
dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
 
-   r = rfbi_init();
-   if (r) {
-   DSSERR("Failed to initialize rfbi\n");
-   goto err_rfbi;
-   }
-
r = dpi_init(pdev);
if (r) {
DSSERR("Failed to initialize dpi\n");
@@ -271,8 +265,6 @@ err_venc:
 err_dispc:
dpi_exit();
 err_dpi:
-   rfbi_exit();
-err_rfbi:
 
return r;
 }
@@ -287,7 +279,6 @@ static int omap_dss_remove(struct platform_device *pdev)
venc_exit();
dispc_exit();
dpi_exit();
-   rfbi_exit();
if (cpu_is_omap34xx()) {
dsi_exit();
sdi_exit();
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index a086233..14a5262 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -100,6 +100,7 @@ static int rfbi_convert_timings(struct rfbi_timings *t);
 static void rfbi_get_clk_info(u32 *clk_period, u32 *max_clk_div);
 
 static struct {
+   struct platform_device *pdev;
void __iomem*base;
 
unsigned long   l4_khz;
@@ -957,50 +958,6 @@ void rfbi_dump_regs(struct seq_file *s)
 #undef DUMPREG
 }
 
-int rfbi_init(void)
-{
-   u32 rev;
-   u32 l;
-
-   spin_lock_init(&rfbi.cmd_lock);
-
-   init_completion(&rfbi.cmd_done);
-   atomic_set(&rfbi.cmd_fifo_full, 0);
-   atomic_set(&rfbi.cmd_pending, 0);
-
-   rfbi.base = ioremap(RFBI_BASE, SZ_256);
-   if (!rfbi.base) {
-   DSSERR("can't ioremap RFBI\n");
-   return -ENOMEM;
-   }
-
-   rfbi_enable_clocks(1);
-
-   msleep(10);
-
-   rfbi.l4_khz = dss_clk_get_rate(DSS_CLK_ICK) / 1000;
-
-   /* Enable autoidle and smart-idle */
-   l = rfbi_read_reg(RFBI_SYSCONFIG);
-   l |= (1 << 0) | (2 << 3);
-   rfbi_write_reg(RFBI_SYSCONFIG, l);
-
-   rev = rfbi_read_reg(RFBI_REVISION);
-   printk(KERN_INFO "OMAP RFBI rev %d.%d\n",
-  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
-
-   rfbi_enable_clocks(0);
-
-   return 0;
-}
-
-void rfbi_exit(void)
-{
-   DSSDBG("rfbi_exit\n");
-
-   iounmap(rfbi.base);
-}
-
 int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
 {
int r;
@@ -1058,11 +1015,46 @@ int rfbi_init_display(struct omap_dss_device *dssdev)
 /* RFBI HW IP initialisation */
 static int omap_rfbihw_probe(struct platform_device *pdev)
 {
+   u32 rev;
+   u32 l;
+
+   rfbi.pdev = pdev;
+
+   spin_lock_init(&rfbi.cmd_lock);
+
+   init_completion(&rfbi.cmd_done);
+   atomic_set(&rfbi.cmd_fifo_full, 0);
+   atomic_set(&rfbi.cmd_pending, 0);
+
+   rfbi.base = ioremap(RFBI_BASE, SZ_256);
+   if (!rfbi.base) {
+   DSSERR("can't ioremap RFBI\n");
+   return -ENOMEM;
+   }
+
+   rfbi_enable_clocks(1);
+
+   msleep(10);
+
+   rfbi.l4_khz = dss_clk_get_rate(DSS_CLK_ICK) / 1000;
+
+   /* Enable autoidle and smart-idle */
+   l = rfbi_read_reg(RFBI_SYSCONFIG);
+   l |= (1 << 0) | (2 << 3);
+   rfbi_write_reg(RFBI_SYSCONFIG, l);
+
+   rev = rfbi_read_reg(RFBI_REVISION);
+   dev_dbg(&pdev->dev, "OMAP RFBI rev %d.%d\n",
+  FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
+
+   rfbi_enable_clocks(0);
+
return 0;
 }
 
 static int omap_rfbihw_remove(struct platform_device *pdev)
 {
+   iounmap(rfbi.base);
return 0;
 }
 
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 06/17] OMAP2,3 DSS2 Move DSS driver register from board file to devices.c

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

omap_display_init function is introduced in devices.c to do the DSS driver
registration.  So replace platform_device_register or platform_add_devices of
DSS with omap_display_init().

Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/board-3430sdp.c   |   14 +---
 arch/arm/mach-omap2/board-am3517evm.c |   16 +-
 arch/arm/mach-omap2/board-cm-t35.c|   10 +
 arch/arm/mach-omap2/board-devkit8000.c|   10 +
 arch/arm/mach-omap2/board-igep0020.c  |   10 +
 arch/arm/mach-omap2/board-omap3beagle.c   |   10 +
 arch/arm/mach-omap2/board-omap3evm.c  |   14 +---
 arch/arm/mach-omap2/board-omap3pandora.c  |   10 +
 arch/arm/mach-omap2/board-omap3stalker.c  |   10 +
 arch/arm/mach-omap2/board-rx51-video.c|   15 +
 arch/arm/mach-omap2/devices.c |   32 +
 arch/arm/plat-omap/include/plat/display.h |4 +++
 12 files changed, 46 insertions(+), 109 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 29e56a2..e1a3318 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -301,21 +301,9 @@ static struct omap_dss_board_info sdp3430_dss_data = {
.default_device = &sdp3430_lcd_device,
 };
 
-static struct platform_device sdp3430_dss_device = {
-   .name   = "omap_display",
-   .id = -1,
-   .dev= {
-   .platform_data = &sdp3430_dss_data,
-   },
-};
-
 static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
-static struct platform_device *sdp3430_devices[] __initdata = {
-   &sdp3430_dss_device,
-};
-
 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
 };
 
@@ -790,7 +778,7 @@ static void __init omap_3430sdp_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
omap3430_i2c_init();
-   platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
+   omap_display_init(&sdp3430_dss_data);
if (omap_rev() > OMAP3430_REV_ES1_0)
ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
else
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 2b37dcf..782d270 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -367,24 +367,12 @@ static struct omap_dss_board_info am3517_evm_dss_data = {
.default_device = &am3517_evm_lcd_device,
 };
 
-static struct platform_device am3517_evm_dss_device = {
-   .name   = "omap_display",
-   .id = -1,
-   .dev= {
-   .platform_data  = &am3517_evm_dss_data,
-   },
-};
-
 /*
  * Board initialization
  */
 static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
 };
 
-static struct platform_device *am3517_evm_devices[] __initdata = {
-   &am3517_evm_dss_device,
-};
-
 static void __init am3517_evm_init_irq(void)
 {
omap_board_config = am3517_evm_config;
@@ -484,9 +472,7 @@ static void __init am3517_evm_init(void)
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 
am3517_evm_i2c_init();
-   platform_add_devices(am3517_evm_devices,
-   ARRAY_SIZE(am3517_evm_devices));
-
+   omap_display_init(&am3517_evm_dss_data);
omap_serial_init();
 
/* Configure GPIO for EHCI port */
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 307e93a..c5e80ad 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -390,14 +390,6 @@ static struct omap_dss_board_info cm_t35_dss_data = {
.default_device = &cm_t35_dvi_device,
 };
 
-static struct platform_device cm_t35_dss_device = {
-   .name   = "omap_display",
-   .id = -1,
-   .dev= {
-   .platform_data = &cm_t35_dss_data,
-   },
-};
-
 static struct omap2_mcspi_device_config tdo24m_mcspi_config = {
.turbo_mode = 0,
.single_channel = 1,/* 0: slave, 1: master */
@@ -457,7 +449,7 @@ static void __init cm_t35_init_display(void)
msleep(50);
gpio_set_value(lcd_en_gpio, 1);
 
-   err = platform_device_register(&cm_t35_dss_device);
+   err = omap_display_init(&cm_t35_dss_data);
if (err) {
pr_err("CM-T35: failed to register DSS device\n");
goto err_dev_reg;
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index f948435..78f2951 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -188,14 +188,6 @@ static struct omap_dss_board_info devkit8000_dss_data = {
.default_device = &devkit8000_lcd_device,
 };
 
-static struct p

[PATCH v3 05/17] OMAP2,3 DSS2 Use Regulator init with driver name

2011-01-03 Thread Guruswamy Senthilvadivu
From: Senthilvadivu Guruswamy 

Use driver name in regulator inits needed for display instead of using device
structure name.

Signed-off-by: Senthilvadivu Guruswamy 
---
 arch/arm/mach-omap2/board-3430sdp.c  |   11 +++
 arch/arm/mach-omap2/board-cm-t35.c   |   12 
 arch/arm/mach-omap2/board-igep0020.c |6 ++
 arch/arm/mach-omap2/board-omap3evm.c |6 ++
 arch/arm/mach-omap2/board-omap3stalker.c |6 ++
 5 files changed, 13 insertions(+), 28 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 10a399e..29e56a2 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -309,10 +309,8 @@ static struct platform_device sdp3430_dss_device = {
},
 };
 
-static struct regulator_consumer_supply sdp3430_vdda_dac_supply = {
-   .supply = "vdda_dac",
-   .dev= &sdp3430_dss_device.dev,
-};
+static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 static struct platform_device *sdp3430_devices[] __initdata = {
&sdp3430_dss_device,
@@ -540,10 +538,7 @@ static struct regulator_init_data sdp3430_vdac = {
 
 /* VPLL2 for digital video outputs */
 static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
-   {
-   .supply = "vdds_dsi",
-   .dev= &sdp3430_dss_device.dev,
-   }
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display"),
 };
 
 static struct regulator_init_data sdp3430_vpll2 = {
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index f0293a3..307e93a 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -484,15 +484,11 @@ static struct regulator_consumer_supply 
cm_t35_vsim_supply = {
.supply = "vmmc_aux",
 };
 
-static struct regulator_consumer_supply cm_t35_vdac_supply = {
-   .supply = "vdda_dac",
-   .dev= &cm_t35_dss_device.dev,
-};
+static struct regulator_consumer_supply cm_t35_vdac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
-static struct regulator_consumer_supply cm_t35_vdvi_supply = {
-   .supply = "vdvi",
-   .dev= &cm_t35_dss_device.dev,
-};
+static struct regulator_consumer_supply cm_t35_vdvi_supply =
+   REGULATOR_SUPPLY("vdvi", "omap_display");
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data cm_t35_vmmc1 = {
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index 46985eb..3b8b0d0 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -486,10 +486,8 @@ static struct platform_device igep2_dss_device = {
},
 };
 
-static struct regulator_consumer_supply igep2_vpll2_supply = {
-   .supply = "vdds_dsi",
-   .dev= &igep2_dss_device.dev,
-};
+static struct regulator_consumer_supply igep2_vpll2_supply =
+   REGULATOR_SUPPLY("vdds_dsi", "omap_display");
 
 static struct regulator_init_data igep2_vpll2 = {
.constraints = {
diff --git a/arch/arm/mach-omap2/board-omap3evm.c 
b/arch/arm/mach-omap2/board-omap3evm.c
index 2851984..8f9dece 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -494,10 +494,8 @@ static struct twl4030_codec_data omap3evm_codec_data = {
.audio = &omap3evm_audio_data,
 };
 
-static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = {
-   .supply = "vdda_dac",
-   .dev= &omap3_evm_dss_device.dev,
-};
+static struct regulator_consumer_supply omap3_evm_vdda_dac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 /* VDAC for DSS driving S-Video */
 static struct regulator_init_data omap3_evm_vdac = {
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c 
b/arch/arm/mach-omap2/board-omap3stalker.c
index 7f080d6..085ec27 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -437,10 +437,8 @@ static struct twl4030_codec_data omap3stalker_codec_data = 
{
.audio  = &omap3stalker_audio_data,
 };
 
-static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = {
-   .supply = "vdda_dac",
-   .dev= &omap3_stalker_dss_device.dev,
-};
+static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply =
+   REGULATOR_SUPPLY("vdda_dac", "omap_display");
 
 /* VDAC for DSS driving S-Video */
 static struct regulator_init_data omap3_stalker_vdac = {
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v7 5/7] omap3: nand: configurable fifo threshold to gain the throughput

2011-01-03 Thread Nori, Sekhar
Hi Sukumar,

On Wed, Dec 29, 2010 at 19:02:24, Ghorai, Sukumar wrote:
> Configure the FIFO THREASHOLD value different for read and write to keep busy
> both filling and to drain out of FIFO at reading and writing.
> 
> Signed-off-by: Vimal Singh 
> Signed-off-by: Sukumar Ghorai 
> ---
>  arch/arm/mach-omap2/gpmc.c |   11 +++
>  arch/arm/plat-omap/include/plat/gpmc.h |5 -
>  drivers/mtd/nand/omap2.c   |   22 ++
>  3 files changed, 25 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
> index cfaf357..b26b1a5 100644
> --- a/arch/arm/mach-omap2/gpmc.c
> +++ b/arch/arm/mach-omap2/gpmc.c
> @@ -59,7 +59,6 @@
>  #define GPMC_CHUNK_SHIFT 24  /* 16 MB */
>  #define GPMC_SECTION_SHIFT   28  /* 128 MB */
>  
> -#define PREFETCH_FIFOTHRESHOLD   (0x40 << 8)
>  #define CS_NUM_SHIFT 24
>  #define ENABLE_PREFETCH  (0x1 << 7)
>  #define DMA_MPU_MODE 2
> @@ -595,15 +594,19 @@ EXPORT_SYMBOL(gpmc_nand_write);
>  /**
>   * gpmc_prefetch_enable - configures and starts prefetch transfer
>   * @cs: cs (chip select) number
> + * @fifo_th: fifo threshold to be used for read/ write
>   * @dma_mode: dma mode enable (1) or disable (0)
>   * @u32_count: number of bytes to be transferred
>   * @is_write: prefetch read(0) or write post(1) mode
>   */
> -int gpmc_prefetch_enable(int cs, int dma_mode,
> +int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
>   unsigned int u32_count, int is_write)
>  {
>  
> - if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
> + if (fifo_th > PREFETCH_FIFOTHRESHOLD_MAX) {
> + printk(KERN_ERR "PREFETCH Fifo Threshold is not supported\n");
> + return -1;

Please consider using pr_err(). Also, adding function/device name 
prefix helps locate which module caused the error from logs.

Also, is "operation not permitted" the best error we can give back 
here?

> + } else if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
>   /* Set the amount of bytes to be prefetched */
>   gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count);
>  
> @@ -611,7 +614,7 @@ int gpmc_prefetch_enable(int cs, int dma_mode,
>* enable the engine. Set which cs is has requested for.
>*/
>   gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) |
> - PREFETCH_FIFOTHRESHOLD |
> + PREFETCH_FIFOTHRESHOLD(fifo_th) |
>   ENABLE_PREFETCH |
>   (dma_mode << DMA_MPU_MODE) |
>   (0x1 & is_write)));
> diff --git a/arch/arm/plat-omap/include/plat/gpmc.h 
> b/arch/arm/plat-omap/include/plat/gpmc.h
> index 054e704..fb82335 100644
> --- a/arch/arm/plat-omap/include/plat/gpmc.h
> +++ b/arch/arm/plat-omap/include/plat/gpmc.h
> @@ -83,6 +83,9 @@
>  #define GPMC_IRQ_FIFOEVENTENABLE 0x01
>  #define GPMC_IRQ_COUNT_EVENT 0x02
>  
> +#define PREFETCH_FIFOTHRESHOLD_MAX   0x40
> +#define PREFETCH_FIFOTHRESHOLD(val)  (val << 8)

Parenthesize val please.

> +
>  /*
>   * Note that all values in this struct are in nanoseconds, while
>   * the register values are in gpmc_fck cycles.
> @@ -133,7 +136,7 @@ extern int gpmc_cs_request(int cs, unsigned long size, 
> unsigned long *base);
>  extern void gpmc_cs_free(int cs);
>  extern int gpmc_cs_set_reserved(int cs, int reserved);
>  extern int gpmc_cs_reserved(int cs);
> -extern int gpmc_prefetch_enable(int cs, int dma_mode,
> +extern int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
>   unsigned int u32_count, int is_write);
>  extern int gpmc_prefetch_reset(int cs);
>  extern void omap3_gpmc_save_context(void);
> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> index 007862e..384d89b 100644
> --- a/drivers/mtd/nand/omap2.c
> +++ b/drivers/mtd/nand/omap2.c
> @@ -243,7 +243,8 @@ static void omap_read_buf_pref(struct mtd_info *mtd, 
> u_char *buf, int len)
>   }
>  
>   /* configure and start prefetch transfer */
> - ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0);
> + ret = gpmc_prefetch_enable(info->gpmc_cs,
> + PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x0);
>   if (ret) {
>   /* PFPW engine is busy, use cpu copy method */
>   if (info->nand.options & NAND_BUSWIDTH_16)
> @@ -287,7 +288,8 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
>   }
>  
>   /*  configure and start prefetch transfer */
> - ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x1);
> + ret = gpmc_prefetch_enable(info->gpmc_cs,
> + PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x1);
>   if (ret) {
>   /* PFPW engine is busy, use cpu copy method */
>   if (info->nan

RE: [PATCH v7 4/7] omap3: nand: prefetch in irq mode support

2011-01-03 Thread Nori, Sekhar
Hi Sukumar,

On Wed, Dec 29, 2010 at 19:02:23, Ghorai, Sukumar wrote:
> This patch enable prefetch-irq mode for nand transfer(read, write)
> 
> Signed-off-by: Vimal Singh 
> Signed-off-by: Sukumar Ghorai 
> ---
>  arch/arm/mach-omap2/board-flash.c  |2 +
>  arch/arm/plat-omap/include/plat/nand.h |4 +-
>  drivers/mtd/nand/omap2.c   |  169 
> 
>  3 files changed, 174 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-flash.c 
> b/arch/arm/mach-omap2/board-flash.c
> index f6b7253..1964509 100644
> --- a/arch/arm/mach-omap2/board-flash.c
> +++ b/arch/arm/mach-omap2/board-flash.c
> @@ -16,6 +16,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  #include 
> @@ -147,6 +148,7 @@ __init board_nand_init(struct mtd_partition *nand_parts,
>   board_nand_data.nr_parts= nr_parts;
>   board_nand_data.devsize = nand_type;
>  
> + board_nand_data.gpmc_irq = OMAP_GPMC_IRQ_BASE + cs;
>   gpmc_nand_init(&board_nand_data);
>  }
>  #else
> diff --git a/arch/arm/plat-omap/include/plat/nand.h 
> b/arch/arm/plat-omap/include/plat/nand.h
> index 78c0bdb..ae5e053 100644
> --- a/arch/arm/plat-omap/include/plat/nand.h
> +++ b/arch/arm/plat-omap/include/plat/nand.h
> @@ -13,7 +13,8 @@
>  enum nand_io {
>   NAND_OMAP_PREFETCH_POLLED = 0,  /* prefetch polled mode, default */
>   NAND_OMAP_POLLED,   /* polled mode, without prefetch */
> - NAND_OMAP_PREFETCH_DMA  /* prefetch enabled sDMA mode */
> + NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */
> + NAND_OMAP_PREFETCH_IRQ  /* prefetch enabled irq mode */
>  };
>  
>  struct omap_nand_platform_data {
> @@ -26,6 +27,7 @@ struct omap_nand_platform_data {
>   int (*nand_setup)(void);
>   int (*dev_ready)(struct omap_nand_platform_data *);
>   int dma_channel;
> + int gpmc_irq;
>   enum nand_ioxfer_type;
>   unsigned long   phys_base;
>   int devsize;
> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> index 66b7428..007862e 100644
> --- a/drivers/mtd/nand/omap2.c
> +++ b/drivers/mtd/nand/omap2.c
> @@ -11,6 +11,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -108,6 +109,13 @@ struct omap_nand_info {
>   unsigned long   phys_base;
>   struct completion   comp;
>   int dma_ch;
> + int gpmc_irq;
> + enum {
> + OMAP_NAND_IO_READ = 0,  /* read */
> + OMAP_NAND_IO_WRITE, /* write */
> + } iomode;
> + u_char  *buf;
> + int buf_len;
>  };
>  
>  /**
> @@ -436,6 +444,153 @@ static void omap_write_buf_dma_pref(struct mtd_info 
> *mtd,
>   omap_nand_dma_transfer(mtd, (u_char *) buf, len, 0x1);
>  }
>  
> +/*
> + * omap_nand_irq - GMPC irq handler
> + * @this_irq: gpmc irq number
> + * @dev: omap_nand_info structure pointer is passed here
> + */
> +static irqreturn_t omap_nand_irq(int this_irq, void *dev)
> +{
> + struct omap_nand_info *info = (struct omap_nand_info *) dev;
> + u32 bytes;
> + u32 irq_stat;
> +
> + irq_stat = gpmc_read_status(GPMC_GET_IRQ_STATUS);
> + bytes = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT);
> + bytes = bytes  & 0xFFFC; /* io in multiple of 4 bytes */
> + if (info->iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */
> + if (irq_stat & 0x2)
> + goto done;
> +
> + if (info->buf_len & (info->buf_len < bytes))

Meant to use logical AND here?

> + bytes = info->buf_len;
> + else if (!info->buf_len)
> + bytes = 0;
> + iowrite32_rep(info->nand.IO_ADDR_W,
> + (u32 *)info->buf, bytes >> 2);
> + info->buf = info->buf + bytes;
> + info->buf_len -= bytes;
> +
> + } else {
> + ioread32_rep(info->nand.IO_ADDR_R,
> + (u32 *)info->buf, bytes >> 2);
> + info->buf = info->buf + bytes;
> +
> + if (irq_stat & 0x2)
> + goto done;
> + }
> + gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat);
> + irq_stat = gpmc_read_status(GPMC_GET_IRQ_STATUS);

irq_stat update remains unused.

> +
> + return IRQ_HANDLED;
> +
> +done:
> + complete(&info->comp);
> + /* disable irq */
> + gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ, 0);
> +
> + /* clear status */
> + gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat);
> + irq_stat = gpmc_read_status(GPMC_GET_IRQ_STATUS);
> +
> + return IRQ_HANDLED;
> +}
> +
> +/*
> +

[PATCH] OMAP2+: hwmod: incorrect computation of autoidle_mask

2011-01-03 Thread Tarun Kanti DebBarma
Autoidle is just a single bit setting across OMAP platforms.
In _set_module_autoidle() I am seeing 0x3 where the mask is
computed. I believe this should be 0x1.

Baseline:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

Tested Info:
Boot tested on OMAP 2/3/4.

Signed-off-by: Tarun Kanti DebBarma 
Acked-by: Rajendra Nayak 
---
 arch/arm/mach-omap2/omap_hwmod.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 5a30658..da49b56 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -373,7 +373,7 @@ static int _set_module_autoidle(struct omap_hwmod *oh, u8 
autoidle,
}
 
autoidle_shift = oh->class->sysc->sysc_fields->autoidle_shift;
-   autoidle_mask = (0x3 << autoidle_shift);
+   autoidle_mask = (0x1 << autoidle_shift);
 
*v &= ~autoidle_mask;
*v |= autoidle << autoidle_shift;
-- 
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/6] Add infrastructure for conditional code and data sections

2011-01-03 Thread Paul Walmsley
On Sun, 2 Jan 2011, Paul Walmsley wrote:

> Hello Thomas
> 
> On Tue, 21 Dec 2010, Thomas Petazzoni wrote:
> 
> > WARNING: This is only a proof-of-concept, there are many known
> > issues. The sole purpose of this patch is to get some feedback on
> > whether the idea is useful or not, and whether it's worth cleaning up
> > the remaining issues.
> 
> As Aaron

s/Aaron/Aaro/.  Sorry, Aaro.


- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html