Re: AM335x OMAP2 common clock external fixed-clock registration

2015-04-15 Thread Tero Kristo

On 04/15/2015 11:51 PM, Michael Welling wrote:

On Wed, Apr 15, 2015 at 01:45:53PM -0700, Mike Turquette wrote:

On Wed, Apr 15, 2015 at 12:47 PM, Michael Welling  wrote:

On Wed, Apr 15, 2015 at 09:43:30PM +0300, Tero Kristo wrote:

On 04/15/2015 05:09 PM, Michael Welling wrote:

On Wed, Apr 15, 2015 at 09:34:48AM +0300, Tero Kristo wrote:

On 04/15/2015 12:17 AM, Michael Welling wrote:

Greetings,

I have developed an AM3354 based SoM and it uses an external SI5351 clock
generator to drive the clock inputs for an external duart and I2S audio
master clock. With the registration according to the documentation the
reference clock is not being detected and hence the clock generator is
not working as expect.

After trying many different things, I started to look around the mailing
lists to find information related to this issue.

I came acrossed post that has the exact same issue:
https://lkml.org/lkml/2013/2/18/468

Seeing as the patch did not land upstream, I am wondering if there is
a solution that I am not seeing.

I am willing to provide a patch given appropriate guidance.


Hi Michael,

The info on the email you referenced is kind of obsolete, TI SoCs
are calling of_clk_init() during boot now, and thus external clock
nodes should be registered fine also. Maybe you can provide the
actual DTS patch you are trying out so we can help better...? Are


See attached patch and console output.


I see a bug in your dt data.



+ clocks {
+ ref27: ref27 {
+ #clock-cells = <0>;
+ compatibale = "fixed-clock";

This should be compatible, right? DT is annoying in that it doesn't
verify property names.



Ooops.

Now the clock appears in /sys/kernel/debug/clk:
root@som3517-som200:/sys/kernel/debug/clk# cat clk_summary
clock enable_cnt  prepare_cntrate   
accuracy   phase

  ref27002700  
0 0
...

There is still an issue with the si5351.

I had to comment out the clk_put here for the frequency to show up:
http://lxr.free-electrons.com/source/drivers/clk/clk-si5351.c#L1133

Ideas?


What is the most recent upstream commit that you are based on?


I am working from 4.0.0-rc7.

7b43b47373d40d557cd7e1a84a0bd8ebc4d745ab


Hmm, I wonder why si5351 calls clk_put immediately after of_clk_get in 
the first place, as far as I understand this destroys the clock handle, 
which is still being used later in the code.


-Tero





Regards,
Mike




+ clock-frequency = <2700>;
+ };
+ };

-Tero




you seeing any boot time error / warning prints for your new clock?


With the debug messages on you see that the reference clock is not being
detected.

Whilest debugging I found that the of_clk_get is returning an error no matter
which clock I pass it:
http://lxr.free-electrons.com/source/drivers/clk/clk-si5351.c#L1131



-Tero




--
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: AM335x OMAP2 common clock external fixed-clock registration

2015-04-15 Thread Michael Welling
On Wed, Apr 15, 2015 at 01:45:53PM -0700, Mike Turquette wrote:
> On Wed, Apr 15, 2015 at 12:47 PM, Michael Welling  wrote:
> > On Wed, Apr 15, 2015 at 09:43:30PM +0300, Tero Kristo wrote:
> >> On 04/15/2015 05:09 PM, Michael Welling wrote:
> >> >On Wed, Apr 15, 2015 at 09:34:48AM +0300, Tero Kristo wrote:
> >> >>On 04/15/2015 12:17 AM, Michael Welling wrote:
> >> >>>Greetings,
> >> >>>
> >> >>>I have developed an AM3354 based SoM and it uses an external SI5351 
> >> >>>clock
> >> >>>generator to drive the clock inputs for an external duart and I2S audio
> >> >>>master clock. With the registration according to the documentation the
> >> >>>reference clock is not being detected and hence the clock generator is
> >> >>>not working as expect.
> >> >>>
> >> >>>After trying many different things, I started to look around the mailing
> >> >>>lists to find information related to this issue.
> >> >>>
> >> >>>I came acrossed post that has the exact same issue:
> >> >>>https://lkml.org/lkml/2013/2/18/468
> >> >>>
> >> >>>Seeing as the patch did not land upstream, I am wondering if there is
> >> >>>a solution that I am not seeing.
> >> >>>
> >> >>>I am willing to provide a patch given appropriate guidance.
> >> >>
> >> >>Hi Michael,
> >> >>
> >> >>The info on the email you referenced is kind of obsolete, TI SoCs
> >> >>are calling of_clk_init() during boot now, and thus external clock
> >> >>nodes should be registered fine also. Maybe you can provide the
> >> >>actual DTS patch you are trying out so we can help better...? Are
> >> >
> >> >See attached patch and console output.
> >>
> >> I see a bug in your dt data.
> >>
> >> 
> >>
> >> + clocks {
> >> + ref27: ref27 {
> >> + #clock-cells = <0>;
> >> + compatibale = "fixed-clock";
> >>
> >> This should be compatible, right? DT is annoying in that it doesn't
> >> verify property names.
> >>
> >
> > Ooops.
> >
> > Now the clock appears in /sys/kernel/debug/clk:
> > root@som3517-som200:/sys/kernel/debug/clk# cat clk_summary
> >clock enable_cnt  prepare_cntrate   
> > accuracy   phase
> > 
> >  ref27002700
> >   0 0
> > ...
> >
> > There is still an issue with the si5351.
> >
> > I had to comment out the clk_put here for the frequency to show up:
> > http://lxr.free-electrons.com/source/drivers/clk/clk-si5351.c#L1133
> >
> > Ideas?
> 
> What is the most recent upstream commit that you are based on?

I am working from 4.0.0-rc7.

7b43b47373d40d557cd7e1a84a0bd8ebc4d745ab

> 
> Regards,
> Mike
> 
> >
> >> + clock-frequency = <2700>;
> >> + };
> >> + };
> >>
> >> -Tero
> >>
> >> >
> >> >>you seeing any boot time error / warning prints for your new clock?
> >> >
> >> >With the debug messages on you see that the reference clock is not being
> >> >detected.
> >> >
> >> >Whilest debugging I found that the of_clk_get is returning an error no 
> >> >matter
> >> >which clock I pass it:
> >> >http://lxr.free-electrons.com/source/drivers/clk/clk-si5351.c#L1131
> >> >
> >> >>
> >> >>-Tero
> >>
--
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: AM335x OMAP2 common clock external fixed-clock registration

2015-04-15 Thread Mike Turquette
On Wed, Apr 15, 2015 at 12:47 PM, Michael Welling  wrote:
> On Wed, Apr 15, 2015 at 09:43:30PM +0300, Tero Kristo wrote:
>> On 04/15/2015 05:09 PM, Michael Welling wrote:
>> >On Wed, Apr 15, 2015 at 09:34:48AM +0300, Tero Kristo wrote:
>> >>On 04/15/2015 12:17 AM, Michael Welling wrote:
>> >>>Greetings,
>> >>>
>> >>>I have developed an AM3354 based SoM and it uses an external SI5351 clock
>> >>>generator to drive the clock inputs for an external duart and I2S audio
>> >>>master clock. With the registration according to the documentation the
>> >>>reference clock is not being detected and hence the clock generator is
>> >>>not working as expect.
>> >>>
>> >>>After trying many different things, I started to look around the mailing
>> >>>lists to find information related to this issue.
>> >>>
>> >>>I came acrossed post that has the exact same issue:
>> >>>https://lkml.org/lkml/2013/2/18/468
>> >>>
>> >>>Seeing as the patch did not land upstream, I am wondering if there is
>> >>>a solution that I am not seeing.
>> >>>
>> >>>I am willing to provide a patch given appropriate guidance.
>> >>
>> >>Hi Michael,
>> >>
>> >>The info on the email you referenced is kind of obsolete, TI SoCs
>> >>are calling of_clk_init() during boot now, and thus external clock
>> >>nodes should be registered fine also. Maybe you can provide the
>> >>actual DTS patch you are trying out so we can help better...? Are
>> >
>> >See attached patch and console output.
>>
>> I see a bug in your dt data.
>>
>> 
>>
>> + clocks {
>> + ref27: ref27 {
>> + #clock-cells = <0>;
>> + compatibale = "fixed-clock";
>>
>> This should be compatible, right? DT is annoying in that it doesn't
>> verify property names.
>>
>
> Ooops.
>
> Now the clock appears in /sys/kernel/debug/clk:
> root@som3517-som200:/sys/kernel/debug/clk# cat clk_summary
>clock enable_cnt  prepare_cntrate   
> accuracy   phase
> 
>  ref27002700  
> 0 0
> ...
>
> There is still an issue with the si5351.
>
> I had to comment out the clk_put here for the frequency to show up:
> http://lxr.free-electrons.com/source/drivers/clk/clk-si5351.c#L1133
>
> Ideas?

What is the most recent upstream commit that you are based on?

Regards,
Mike

>
>> + clock-frequency = <2700>;
>> + };
>> + };
>>
>> -Tero
>>
>> >
>> >>you seeing any boot time error / warning prints for your new clock?
>> >
>> >With the debug messages on you see that the reference clock is not being
>> >detected.
>> >
>> >Whilest debugging I found that the of_clk_get is returning an error no 
>> >matter
>> >which clock I pass it:
>> >http://lxr.free-electrons.com/source/drivers/clk/clk-si5351.c#L1131
>> >
>> >>
>> >>-Tero
>>
--
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: AM335x OMAP2 common clock external fixed-clock registration

2015-04-15 Thread Michael Welling
On Wed, Apr 15, 2015 at 09:43:30PM +0300, Tero Kristo wrote:
> On 04/15/2015 05:09 PM, Michael Welling wrote:
> >On Wed, Apr 15, 2015 at 09:34:48AM +0300, Tero Kristo wrote:
> >>On 04/15/2015 12:17 AM, Michael Welling wrote:
> >>>Greetings,
> >>>
> >>>I have developed an AM3354 based SoM and it uses an external SI5351 clock
> >>>generator to drive the clock inputs for an external duart and I2S audio
> >>>master clock. With the registration according to the documentation the
> >>>reference clock is not being detected and hence the clock generator is
> >>>not working as expect.
> >>>
> >>>After trying many different things, I started to look around the mailing
> >>>lists to find information related to this issue.
> >>>
> >>>I came acrossed post that has the exact same issue:
> >>>https://lkml.org/lkml/2013/2/18/468
> >>>
> >>>Seeing as the patch did not land upstream, I am wondering if there is
> >>>a solution that I am not seeing.
> >>>
> >>>I am willing to provide a patch given appropriate guidance.
> >>
> >>Hi Michael,
> >>
> >>The info on the email you referenced is kind of obsolete, TI SoCs
> >>are calling of_clk_init() during boot now, and thus external clock
> >>nodes should be registered fine also. Maybe you can provide the
> >>actual DTS patch you are trying out so we can help better...? Are
> >
> >See attached patch and console output.
> 
> I see a bug in your dt data.
> 
> 
> 
> + clocks {
> + ref27: ref27 {
> + #clock-cells = <0>;
> + compatibale = "fixed-clock";
> 
> This should be compatible, right? DT is annoying in that it doesn't
> verify property names.
>

Ooops.

Now the clock appears in /sys/kernel/debug/clk:
root@som3517-som200:/sys/kernel/debug/clk# cat clk_summary 
   clock enable_cnt  prepare_cntrate   accuracy 
  phase

 ref27002700  0 
0  
...

There is still an issue with the si5351.

I had to comment out the clk_put here for the frequency to show up:
http://lxr.free-electrons.com/source/drivers/clk/clk-si5351.c#L1133

Ideas?

> + clock-frequency = <2700>;
> + };
> + };
> 
> -Tero
> 
> >
> >>you seeing any boot time error / warning prints for your new clock?
> >
> >With the debug messages on you see that the reference clock is not being
> >detected.
> >
> >Whilest debugging I found that the of_clk_get is returning an error no matter
> >which clock I pass it:
> >http://lxr.free-electrons.com/source/drivers/clk/clk-si5351.c#L1131
> >
> >>
> >>-Tero
> 
--
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/2] pinctrl: bindings: pinctrl: Add support for TI's IODelay configuration

2015-04-15 Thread Nishanth Menon
On 04/15/2015 01:44 PM, Lennart Sorensen wrote:
> On Wed, Apr 15, 2015 at 11:51:32AM -0500, Nishanth Menon wrote:
>> I am yet to post a new revision to this series - few other stuff got
>> in the way. IODelay driver in no way removes the constraint that the
>> SoC architecture has - most of the pins still need to be muxed in
>> bootloader - we cannot escape that. The reasoning for doing the mux in
>> bootloader is independent of the need for iodelay.
>>
>> Reasoning for mux in bootloader is because the mux and pull fields are
>> glitchy - much more than previous generations of TI SoCs and
>> significantly long enough to cause issues depending on the pins being
>> muxed.
> 
> Well if we know glitching is NOT an issue on our boards, then we don't
> have to do anything in the boot loader other than the basic setup for
> the serial console and emmc and SD, which has always been necesary.
> 
> I consider moving the mux setup to the bootloader a terrible design and
> won't go along with it.  We make sure all external devices have reset
> lines being held while the pinmux is being setup, so glitching is a
> non issue.

I cannot discuss customer boards on this list - the right forum for TI
support is e2e.ti.com or in cases where FAE (Field Applications
Engineer) is involved, via appropriate support path.

Now, that said, even with personal opinions in place, I have to stick
with what the SoC constraints on hand and suggested architecture we
have discussed to ensure safe platform operation at least for the
platforms we are contributing to. again... muxing in the bootloader IS
NOT what this patch is about. If we can stick to the topic in
discussion, it is probably more effective. Any improvement suggestions
to the code is more than appreciated.

>> Reasoning for iodelay is different - it is a hardware block meant to
>> control the timing of signals in a particular signal path to ensure
>> that specification compliance is met.
>>
>> Lets try not to mix the two.
> 
> Well I was told by multiple people from TI that the reason for moving
> the pinmux setup to the bootloader was because of the iodelay issue,
> so you will have to get the message made clear within TI then.
> 
I have passed on this message.

-- 
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 1/2] pinctrl: bindings: pinctrl: Add support for TI's IODelay configuration

2015-04-15 Thread Lennart Sorensen
On Wed, Apr 15, 2015 at 11:51:32AM -0500, Nishanth Menon wrote:
> I am yet to post a new revision to this series - few other stuff got
> in the way. IODelay driver in no way removes the constraint that the
> SoC architecture has - most of the pins still need to be muxed in
> bootloader - we cannot escape that. The reasoning for doing the mux in
> bootloader is independent of the need for iodelay.
> 
> Reasoning for mux in bootloader is because the mux and pull fields are
> glitchy - much more than previous generations of TI SoCs and
> significantly long enough to cause issues depending on the pins being
> muxed.

Well if we know glitching is NOT an issue on our boards, then we don't
have to do anything in the boot loader other than the basic setup for
the serial console and emmc and SD, which has always been necesary.

I consider moving the mux setup to the bootloader a terrible design and
won't go along with it.  We make sure all external devices have reset
lines being held while the pinmux is being setup, so glitching is a
non issue.

> Reasoning for iodelay is different - it is a hardware block meant to
> control the timing of signals in a particular signal path to ensure
> that specification compliance is met.
> 
> Lets try not to mix the two.

Well I was told by multiple people from TI that the reason for moving
the pinmux setup to the bootloader was because of the iodelay issue,
so you will have to get the message made clear within TI then.

-- 
Len Sorensen
--
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: AM335x OMAP2 common clock external fixed-clock registration

2015-04-15 Thread Tero Kristo

On 04/15/2015 05:09 PM, Michael Welling wrote:

On Wed, Apr 15, 2015 at 09:34:48AM +0300, Tero Kristo wrote:

On 04/15/2015 12:17 AM, Michael Welling wrote:

Greetings,

I have developed an AM3354 based SoM and it uses an external SI5351 clock
generator to drive the clock inputs for an external duart and I2S audio
master clock. With the registration according to the documentation the
reference clock is not being detected and hence the clock generator is
not working as expect.

After trying many different things, I started to look around the mailing
lists to find information related to this issue.

I came acrossed post that has the exact same issue:
https://lkml.org/lkml/2013/2/18/468

Seeing as the patch did not land upstream, I am wondering if there is
a solution that I am not seeing.

I am willing to provide a patch given appropriate guidance.


Hi Michael,

The info on the email you referenced is kind of obsolete, TI SoCs
are calling of_clk_init() during boot now, and thus external clock
nodes should be registered fine also. Maybe you can provide the
actual DTS patch you are trying out so we can help better...? Are


See attached patch and console output.


I see a bug in your dt data.



+   clocks {
+   ref27: ref27 {
+   #clock-cells = <0>;
+   compatibale = "fixed-clock";

This should be compatible, right? DT is annoying in that it doesn't 
verify property names.


+   clock-frequency = <2700>;
+   };
+   };

-Tero




you seeing any boot time error / warning prints for your new clock?


With the debug messages on you see that the reference clock is not being
detected.

Whilest debugging I found that the of_clk_get is returning an error no matter
which clock I pass it:
http://lxr.free-electrons.com/source/drivers/clk/clk-si5351.c#L1131



-Tero


--
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/2] pinctrl: bindings: pinctrl: Add support for TI's IODelay configuration

2015-04-15 Thread Nishanth Menon
On 04/14/2015 08:29 PM, Lennart Sorensen wrote:
> On Tue, Mar 17, 2015 at 06:41:51PM -0700, Tony Lindgren wrote:
>> Yeah agreed. I suggest discussing the binding and the generic
>> parsing code for it first :)
>>  
>> It seems with the generic binding the actual driver should be
>> just the hardware specific code hopefully.
> 
> Did this thread go anywhere in the last month?  I am certainly looking
> forward to seeing what the resolution is to this, given for our use the
> boot loader setup is not appealing at all.
> 
I am yet to post a new revision to this series - few other stuff got
in the way. IODelay driver in no way removes the constraint that the
SoC architecture has - most of the pins still need to be muxed in
bootloader - we cannot escape that. The reasoning for doing the mux in
bootloader is independent of the need for iodelay.

Reasoning for mux in bootloader is because the mux and pull fields are
glitchy - much more than previous generations of TI SoCs and
significantly long enough to cause issues depending on the pins being
muxed.

Reasoning for iodelay is different - it is a hardware block meant to
control the timing of signals in a particular signal path to ensure
that specification compliance is met.

Lets try not to mix the two.

-- 
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: ARM errata 430973 on multi platform kernels

2015-04-15 Thread Sebastian Reichel
Hi,

On Thu, Apr 09, 2015 at 02:48:43PM +0100, Russell King - ARM Linux wrote:
> On Thu, Apr 09, 2015 at 12:06:58AM +0100, Russell King - ARM Linux wrote:
> > On Tue, Apr 07, 2015 at 08:22:08AM -0700, Tony Lindgren wrote:
> > > Works for me. The above needs the following fix folded in to build:
> > > 
> > > --- a/arch/arm/mm/proc-v7.S
> > > +++ b/arch/arm/mm/proc-v7.S
> > > @@ -532,7 +532,7 @@ __v7_ca9mp_proc_info:
> > >  __v7_ca8_proc_info:
> > >   .long   0x410fc080
> > >   .long   0xff00
> > > - __v7_proc __v7_ca8mp_proc_info, proc_fns = ca8_processor_functions
> > > + __v7_proc __v7_ca8_proc_info, __v7_setup, proc_fns = 
> > > ca8_processor_functions
> > >   .size   __v7_ca8_proc_info, . - __v7_ca8_proc_info
> > >  
> > >  #endif   /* CONFIG_ARM_LPAE */
> > 
> > Thanks, merged into the original patch.
> 
> Do you want to give me an ack for this, thanks?

I tried to test this together with Tony's follow up patch, but I get
this after applying the patch to v4.0:

sre@earth ~/src/linux [430973-fix] % make -j4
  CHK include/config/kernel.release
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
  CALLscripts/checksyscalls.sh
  CHK include/generated/compile.h
  AS  arch/arm/mm/proc-v7.o
arch/arm/mm/proc-v7.S: Assembler messages:
arch/arm/mm/proc-v7.S:535: Error: invalid operands (*ABS* and .text sections) 
for `|'
arch/arm/mm/proc-v7.S:535: Error: invalid operands (*ABS* and .text sections) 
for `|'
scripts/Makefile.build:294: recipe for target 'arch/arm/mm/proc-v7.o' failed
make[1]: *** [arch/arm/mm/proc-v7.o] Error 1
Makefile:947: recipe for target 'arch/arm/mm' failed
make: *** [arch/arm/mm] Error 2
make: *** Waiting for unfinished jobs

-- Sebastian


signature.asc
Description: Digital signature


Re: [PATCH v4 3/7] drm/tilcdc: Add support for external tda998x encoder

2015-04-15 Thread Jyri Sarha

On 04/02/15 01:20, Russell King - ARM Linux wrote:

This is where the DRM model is weak - we don't really have a way to
say "this is the set of CRTCs which/can/  be associated with this
connector, can any of the CRTCs accept this mode?" and eliminate
modes which fail that check.

This problem seems to be one which recurrs, so I wonder if it's
something which ought to be solved properly.

It's made slightly more difficult because we don't really know which
connectors could be associated with which CRTCs - that information is
stored at the encoder level (with the encoders possible_crtcs), and
I'm not sure we have a way for generic DRM code to know which encoders
could be associated with which connectors.


I agree that this is not the most elegant solution to the problem, but 
it works with Beaglebone-Black - which is AFAIK the only piece of HW 
that uses tda998x with tilcdc.


I would like to get these patches merged and revisit the mode validation 
code once we have a better solution for it.


Best regards,
Jyri
--
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: AM335x OMAP2 common clock external fixed-clock registration

2015-04-15 Thread Michael Welling
On Wed, Apr 15, 2015 at 09:34:48AM +0300, Tero Kristo wrote:
> On 04/15/2015 12:17 AM, Michael Welling wrote:
> >Greetings,
> >
> >I have developed an AM3354 based SoM and it uses an external SI5351 clock
> >generator to drive the clock inputs for an external duart and I2S audio
> >master clock. With the registration according to the documentation the
> >reference clock is not being detected and hence the clock generator is
> >not working as expect.
> >
> >After trying many different things, I started to look around the mailing
> >lists to find information related to this issue.
> >
> >I came acrossed post that has the exact same issue:
> >https://lkml.org/lkml/2013/2/18/468
> >
> >Seeing as the patch did not land upstream, I am wondering if there is
> >a solution that I am not seeing.
> >
> >I am willing to provide a patch given appropriate guidance.
> 
> Hi Michael,
> 
> The info on the email you referenced is kind of obsolete, TI SoCs
> are calling of_clk_init() during boot now, and thus external clock
> nodes should be registered fine also. Maybe you can provide the
> actual DTS patch you are trying out so we can help better...? Are

See attached patch and console output.

> you seeing any boot time error / warning prints for your new clock?

With the debug messages on you see that the reference clock is not being
detected.

Whilest debugging I found that the of_clk_get is returning an error no matter
which clock I pass it:
http://lxr.free-electrons.com/source/drivers/clk/clk-si5351.c#L1131

> 
> -Tero
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index a1c776b..3d2d516 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -401,7 +401,8 @@ dtb-$(CONFIG_SOC_AM33XX) += \
 	am335x-evmsk.dtb \
 	am335x-nano.dtb \
 	am335x-pepper.dtb \
-	am335x-lxm.dtb
+	am335x-lxm.dtb \
+	som-3354-200es.dtb
 dtb-$(CONFIG_ARCH_OMAP4) += \
 	omap4-duovero-parlor.dtb \
 	omap4-panda.dtb \
diff --git a/arch/arm/boot/dts/som-3354-200es.dts b/arch/arm/boot/dts/som-3354-200es.dts
new file mode 100644
index 000..03f06e8
--- /dev/null
+++ b/arch/arm/boot/dts/som-3354-200es.dts
@@ -0,0 +1,590 @@
+/*
+ * som-3354-200es.dts - Device Tree file for the SOM-3354M with SOM-200ES. 
+ *
+ * Copyright (C) 2015 EMAC Inc.
+ * Copyright (C) 2015 QWERTY Embedded Design
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/dts-v1/;
+
+#include "am33xx.dtsi"
+
+/ {
+	model = "EMAC SOM-3354M SOM-200ES";
+	compatible = "emac,som3354", "ti,am33xx";
+
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&vdd1_reg>;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x8000 0x2000>; /* 512 MB */
+	};
+
+	leds {
+		pinctrl-names = "default";
+		pinctrl-0 = <&leds_pins>;
+
+		compatible = "gpio-leds";
+
+		led@0 {
+			label = "stat";
+			gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+	};
+
+	vmain: fixedregulator@0 {
+		compatible = "regulator-fixed";
+		regulator-name = "vmain";
+		regulator-min-microvolt = <330>;
+		regulator-max-microvolt = <330>;
+		regulator-boot-on;
+	};
+
+	backlight {
+		compatible = "pwm-backlight";
+		pwms = <&ecap2 0 5 0>;
+		brightness-levels = <0 51 53 56 62 75 101 152 255>;
+		default-brightness-level = <8>;
+	};
+
+	panel {
+		compatible = "ti,tilcdc,panel";
+		pinctrl-names = "default";
+		pinctrl-0 = <&lcd_pins>;
+		status = "okay";
+
+		enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
+
+		panel-info {
+			ac-bias		= <255>;
+			ac-bias-intrpt	= <0>;
+			dma-burst-sz	= <16>;
+			bpp		= <16>;
+			fdd		= <0x80>;
+			tft-alt-mode	= <0>;
+			stn-565-mode	= <0>;
+			mono-8bit-mode	= <0>;
+			sync-edge	= <0>;
+			sync-ctrl	= <0>;
+			raster-order	= <1>;
+			fifo-th		= <0>;
+		};
+
+		display-timings {
+			native-mode = <&timing0>;
+			timing0: 480x272 {
+hactive		= <480>;
+vactive		= <272>;
+hback-porch = <1>;
+hfront-porch= <44>;
+hsync-len   = <45>;
+vback-porch = <1>;
+vfront-porch= <13>;
+vsync-len   = <14>;
+clock-frequency = <900>;
+hsync-active= <0>;
+vsync-active= <0>;
+de-active = <1>;
+pixelclk-active = <1>;
+			};
+		};
+	};
+
+	clocks {
+		ref27: ref27 {
+			#clock-cells = <0>;
+			compatibale = "fixed-clock";
+			clock-frequency = <2700>;
+		};
+	};
+
+/*
+	sound {
+		compatible = "ti,da830-evm-audio";
+		ti,model = "SOM3354 CS4271";
+		ti,audio-codec = <&cs4271>;
+		ti,mcasp-controller = <&mcasp0>;
+		ti,codec-clock-rate = <12288000>;
+		ti,audio-routing =
+			"Line Out",   "AOUTA+",
+			"Line Out",   "AOUTA-",
+			"Line Out",   "AOUTB+",
+			"Line Out",   "AOUTB-";
+	};
+*/
+};
+
+&mcasp0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mcasp0_pins>;
+
+	status = "okay";
+
+	op-mode = <0>;  /* MCASP_IIS_MODE */
+	tdm-slots = <2>;
+	/* 4 serializers */
+	serial-dir = <  /* 

Re: [RFC][PATCH v2 05/13] usb: otg: add OTG core

2015-04-15 Thread Roger Quadros
On 15/04/15 12:29, Paul Bolle wrote:
> (This will go into a minor detail. That's probably not what you want
> when posting an RFC. But this patch got caught by an email filter I use
> and a future, non-RFC, version will get caught too. So I decided to
> bother you with this now.)
> 
> On Tue, 2015-04-14 at 13:41 +0300, Roger Quadros wrote:
>> --- a/drivers/usb/common/Makefile
>> +++ b/drivers/usb/common/Makefile
> 
>> +obj-$(CONFIG_USB_OTG_CORE) += usb-otg.o
> 
> This creates a module usb-otg.ko if CONFIG_USB_OTG_CORE is 'm', built
> from just usb-otg.c.
> 
>> --- /dev/null
>> +++ b/drivers/usb/common/usb-otg.c
> 
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
> 
>> +EXPORT_SYMBOL_GPL(usb_otg_register);
> 
>> +EXPORT_SYMBOL_GPL(usb_otg_unregister);
> 
>> +EXPORT_SYMBOL_GPL(usb_otg_sync_inputs);
> 
>> +EXPORT_SYMBOL_GPL(usb_otg_kick_fsm);
> 
>> +EXPORT_SYMBOL_GPL(usb_otg_register_hcd);
> 
>> +EXPORT_SYMBOL_GPL(usb_otg_unregister_hcd);
> 
>> +EXPORT_SYMBOL_GPL(usb_otg_register_gadget);
> 
>> +EXPORT_SYMBOL_GPL(usb_otg_unregister_gadget);
>  
>> +EXPORT_SYMBOL_GPL(usb_otg_fsm_to_dev);
> 
> This code adds no MODULE_LICENSE() macro in this patch and usb-otg.ko
> will carry no license field. So I think the loading of that module
> (triggered by loading another module that uses one of the exported
> symbols, I suppose) taints the kernel. Am I correct?

Right. I will fix this. Thanks.

cheers,
-roger

--
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


[RFC PATCH 31/35] ARM: dts: omap3: split l3-smx node out of ocp bus node

2015-04-15 Thread Tero Kristo
ocp bus node will be needed for hwmod data module init, so it can't be
reserved by l3-smx driver. Thus, split l3-smx as its own separate node
under the ocp bus, and add a new compatible string for the l3-bus.

Signed-off-by: Tero Kristo 
---
 arch/arm/boot/dts/omap3.dtsi |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 3fdc84f..4ff8685 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -79,13 +79,17 @@
 * hierarchy.
 */
ocp {
-   compatible = "ti,omap3-l3-smx", "simple-bus";
-   reg = <0x6800 0x1>;
-   interrupts = <9 10>;
+   compatible = "simple-bus", "ti,omap3-l3";
#address-cells = <1>;
#size-cells = <1>;
ranges;
-   ti,hwmods = "l3_main";
+
+   l3_smx: l3_smx@6800 {
+   compatible = "ti,omap3-l3-smx";
+   reg = <0x6800 0x1>;
+   interrupts = <9 10>;
+   ti,hwmods = "l3_main";
+   };
 
aes: aes@480c5000 {
compatible = "ti,omap3-aes";
-- 
1.7.9.5

--
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


[RFC PATCH 30/35] ARM: OMAP3: io: remove early PM init when hwmod data is built as module

2015-04-15 Thread Tero Kristo
If hwmod data is built as a module, PM init will be done after the module
has been loaded. PM code has dependencies towards certain hwmods, which
are not going to be available during early init.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/io.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 258e5ac..6cb1e40 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -487,8 +487,10 @@ void __init am35xx_init_early(void)
 void __init omap3_init_late(void)
 {
omap_common_late_init();
+#ifndef CONFIG_OMAP_HWMOD_DATA_MODULES
omap3_pm_init();
omap2_clk_enable_autoidle_all();
+#endif
 }
 
 void __init omap3430_init_late(void)
-- 
1.7.9.5

--
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


[RFC PATCH 24/35] ARM: OMAP2+: display: remove code from __init section

2015-04-15 Thread Tero Kristo
Needed by hwmod module boot.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/common.h  |4 ++--
 arch/arm/mach-omap2/devices.c |4 ++--
 arch/arm/mach-omap2/display.c |8 
 arch/arm/mach-omap2/display.h |2 +-
 arch/arm/mach-omap2/drm.c |4 ++--
 arch/arm/mach-omap2/fb.c  |8 
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 46e2458..54cf6ca 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -321,8 +321,8 @@ extern int omap_dss_reset(struct omap_hwmod *);
 /* SoC specific clock initializer */
 int omap_clk_init(void);
 
-int __init omapdss_init_of(void);
-void __init omapdss_early_init_of(void);
+int omapdss_init_of(void);
+void omapdss_early_init_of(void);
 
 #endif /* __ASSEMBLER__ */
 #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 1afb50d..b7f717a 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -346,12 +346,12 @@ static struct platform_device omap_vout_device = {
.id = -1,
 };
 
-int __init omap_init_vout(void)
+int omap_init_vout(void)
 {
return platform_device_register(&omap_vout_device);
 }
 #else
-int __init omap_init_vout(void) { return 0; }
+int omap_init_vout(void) { return 0; }
 #endif
 
 /*-*/
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 7a050f9..6a2d4aa 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -254,7 +254,7 @@ err:
return ERR_PTR(r);
 }
 
-static enum omapdss_version __init omap_display_get_version(void)
+static enum omapdss_version omap_display_get_version(void)
 {
if (cpu_is_omap24xx())
return OMAPDSS_VER_OMAP24xx;
@@ -557,12 +557,12 @@ int omap_dss_reset(struct omap_hwmod *oh)
return r;
 }
 
-void __init omapdss_early_init_of(void)
+void omapdss_early_init_of(void)
 {
 
 }
 
-struct device_node * __init omapdss_find_dss_of_node(void)
+struct device_node *omapdss_find_dss_of_node(void)
 {
struct device_node *node;
 
@@ -585,7 +585,7 @@ struct device_node * __init omapdss_find_dss_of_node(void)
return NULL;
 }
 
-int __init omapdss_init_of(void)
+int omapdss_init_of(void)
 {
int r;
enum omapdss_version ver;
diff --git a/arch/arm/mach-omap2/display.h b/arch/arm/mach-omap2/display.h
index 7375854..4fcc326 100644
--- a/arch/arm/mach-omap2/display.h
+++ b/arch/arm/mach-omap2/display.h
@@ -31,6 +31,6 @@ int omap_init_vrfb(void);
 int omap_init_fb(void);
 int omap_init_vout(void);
 
-struct device_node * __init omapdss_find_dss_of_node(void);
+struct device_node *omapdss_find_dss_of_node(void);
 
 #endif
diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c
index facd740..c1ea886 100644
--- a/arch/arm/mach-omap2/drm.c
+++ b/arch/arm/mach-omap2/drm.c
@@ -41,7 +41,7 @@ static struct platform_device omap_drm_device = {
.id = 0,
 };
 
-int __init omap_init_drm(void)
+int omap_init_drm(void)
 {
platform_data.omaprev = GET_OMAP_TYPE;
 
@@ -49,5 +49,5 @@ int __init omap_init_drm(void)
 
 }
 #else
-int __init omap_init_drm(void) { return 0; }
+int omap_init_drm(void) { return 0; }
 #endif
diff --git a/arch/arm/mach-omap2/fb.c b/arch/arm/mach-omap2/fb.c
index 26e28e9..028976a 100644
--- a/arch/arm/mach-omap2/fb.c
+++ b/arch/arm/mach-omap2/fb.c
@@ -65,7 +65,7 @@ static const struct resource omap3_vrfb_resources[] = {
DEFINE_RES_MEM_NAMED(0xfc00u, 0x400, "vrfb-area-11"),
 };
 
-int __init omap_init_vrfb(void)
+int omap_init_vrfb(void)
 {
struct platform_device *pdev;
const struct resource *res;
@@ -87,7 +87,7 @@ int __init omap_init_vrfb(void)
return PTR_RET(pdev);
 }
 #else
-int __init omap_init_vrfb(void) { return 0; }
+int omap_init_vrfb(void) { return 0; }
 #endif
 
 #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
@@ -106,10 +106,10 @@ static struct platform_device omap_fb_device = {
.num_resources = 0,
 };
 
-int __init omap_init_fb(void)
+int omap_init_fb(void)
 {
return platform_device_register(&omap_fb_device);
 }
 #else
-int __init omap_init_fb(void) { return 0; }
+int omap_init_fb(void) { return 0; }
 #endif
-- 
1.7.9.5

--
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


[RFC PATCH 21/35] ARM: OMAP2+: SR: remove code from __init section

2015-04-15 Thread Tero Kristo
Needed by hwmod module boot.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/sr_device.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index d7cff26..c453fe4 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -32,8 +32,8 @@
 static bool sr_enable_on_init;
 
 /* Read EFUSE values from control registers for OMAP3430 */
-static void __init sr_set_nvalues(struct omap_volt_data *volt_data,
-   struct omap_sr_data *sr_data)
+static void sr_set_nvalues(struct omap_volt_data *volt_data,
+  struct omap_sr_data *sr_data)
 {
struct omap_sr_nvalue_table *nvalue_table;
int i, j, count = 0;
@@ -93,7 +93,7 @@ static void __init sr_set_nvalues(struct omap_volt_data 
*volt_data,
sr_data->nvalue_count = j;
 }
 
-static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
+static int sr_dev_init(struct omap_hwmod *oh, void *user)
 {
struct omap_sr_data *sr_data;
struct platform_device *pdev;
@@ -171,7 +171,7 @@ void __init omap_enable_smartreflex_on_init(void)
sr_enable_on_init = true;
 }
 
-int __init omap_devinit_smartreflex(void)
+int omap_devinit_smartreflex(void)
 {
return omap_hwmod_for_each_by_class("smartreflex", sr_dev_init, NULL);
 }
-- 
1.7.9.5

--
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


[RFC PATCH 20/35] ARM: OMAP2+: omap_device: remove omap_device_build from __init section

2015-04-15 Thread Tero Kristo
Some devices are built late in boot with the introduction of hwmod
data modules, and the omap_device_build() function is required later
in boot also. Thus, remove it from the __init section.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/omap_device.c |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_device.c 
b/arch/arm/mach-omap2/omap_device.c
index be9541e..52fcaad 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -507,10 +507,10 @@ void omap_device_delete(struct omap_device *od)
  * information.  Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise,
  * passes along the return value of omap_device_build_ss().
  */
-struct platform_device __init *omap_device_build(const char *pdev_name,
-int pdev_id,
-struct omap_hwmod *oh,
-void *pdata, int pdata_len)
+struct platform_device *omap_device_build(const char *pdev_name,
+ int pdev_id,
+ struct omap_hwmod *oh,
+ void *pdata, int pdata_len)
 {
struct omap_hwmod *ohs[] = { oh };
 
@@ -535,11 +535,11 @@ struct platform_device __init *omap_device_build(const 
char *pdev_name,
  * platform_device record.  Returns an ERR_PTR() on error, or passes
  * along the return value of omap_device_register().
  */
-struct platform_device __init *omap_device_build_ss(const char *pdev_name,
-   int pdev_id,
-   struct omap_hwmod **ohs,
-   int oh_cnt, void *pdata,
-   int pdata_len)
+struct platform_device *omap_device_build_ss(const char *pdev_name,
+int pdev_id,
+struct omap_hwmod **ohs,
+int oh_cnt, void *pdata,
+int pdata_len)
 {
int ret = -ENOMEM;
struct platform_device *pdev;
-- 
1.7.9.5

--
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


[RFC PATCH 32/35] ARM: OMAP3: hwmod_data: add support for hwmod early data

2015-04-15 Thread Tero Kristo
This data will be registered during early boot, rest of the hwmod
data will be provided through a module during probe time.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/omap_hwmod.h |1 +
 arch/arm/mach-omap2/omap_hwmod_3xxx_early_data.c |  549 ++
 2 files changed, 550 insertions(+)
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_3xxx_early_data.c

diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 9612add..3ff9133 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -747,6 +747,7 @@ extern int omap_hwmod_aess_preprogram(struct omap_hwmod 
*oh);
  */
 extern int omap2420_hwmod_init(void);
 extern int omap2430_hwmod_init(void);
+int omap3xxx_hwmod_early_init(void);
 extern int omap3xxx_hwmod_init(void);
 extern int omap44xx_hwmod_init(void);
 extern int omap54xx_hwmod_init(void);
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_early_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_early_data.c
new file mode 100644
index 000..c4af146
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_early_data.c
@@ -0,0 +1,549 @@
+/*
+ * omap_hwmod_3xxx_early_data.c - hardware modules present on the OMAP3xxx 
chips
+ *
+ * Copyright (C) 2009-2011 Nokia Corporation
+ * Copyright (C) 2012 Texas Instruments, Inc.
+ * Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * The data in this file should be completely autogeneratable from
+ * the TI hardware database or other technical documentation.
+ *
+ * XXX these should be marked initdata for multi-OMAP kernels
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include "l3_3xxx.h"
+#include "l4_3xxx.h"
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "soc.h"
+#include "omap_hwmod.h"
+#include "omap_hwmod_common_data.h"
+#include "prm-regbits-34xx.h"
+#include "cm-regbits-34xx.h"
+
+#include "i2c.h"
+#include "wd_timer.h"
+#include "serial.h"
+
+/* L3 */
+static struct omap_hwmod_irq_info omap3xxx_l3_main_irqs[] = {
+   { .irq = 9 + OMAP_INTC_START, },
+   { .irq = 10 + OMAP_INTC_START, },
+   { .irq = -1 },
+};
+
+static struct omap_hwmod omap3xxx_l3_main_hwmod = {
+   .name   = "l3_main",
+   .class  = &l3_hwmod_class,
+   .mpu_irqs   = omap3xxx_l3_main_irqs,
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+/* L4 CORE */
+static struct omap_hwmod omap3xxx_l4_core_hwmod = {
+   .name   = "l4_core",
+   .class  = &l4_hwmod_class,
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+/* L4 PER */
+static struct omap_hwmod omap3xxx_l4_per_hwmod = {
+   .name   = "l4_per",
+   .class  = &l4_hwmod_class,
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+/* L4 WKUP */
+static struct omap_hwmod omap3xxx_l4_wkup_hwmod = {
+   .name   = "l4_wkup",
+   .class  = &l4_hwmod_class,
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+/* L4 SEC */
+static struct omap_hwmod omap3xxx_l4_sec_hwmod = {
+   .name   = "l4_sec",
+   .class  = &l4_hwmod_class,
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+/* MPU */
+static struct omap_hwmod_irq_info omap3xxx_mpu_irqs[] = {
+   { .name = "pmu", .irq = 3 + OMAP_INTC_START },
+   { .irq = -1 }
+};
+
+static struct omap_hwmod omap3xxx_mpu_hwmod = {
+   .name   = "mpu",
+   .mpu_irqs   = omap3xxx_mpu_irqs,
+   .class  = &mpu_hwmod_class,
+   .main_clk   = "arm_fck",
+};
+
+/* timer class */
+static struct omap_hwmod_class_sysconfig omap3xxx_timer_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
+  SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
+  SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE |
+  SYSS_HAS_RESET_STATUS),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+   .clockact   = CLOCKACT_TEST_ICLK,
+   .sysc_fields= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap3xxx_timer_hwmod_class = {
+   .name = "timer",
+   .sysc = &omap3xxx_timer_sysc,
+};
+
+/* secure timers dev attribute */
+static struct omap_timer_capability_dev_attr capability_secure_dev_attr = {
+   .timer_capability   = OMAP_TIMER_ALWON | OMAP_TIMER_SECURE,
+};
+
+/* always-on timers dev attribute */
+static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
+   .timer_capability   = OMAP_TIMER_ALWON,
+};
+
+/* timer1 */
+static struct omap_hwmod omap3xxx_timer1_hwmod = {
+   .name   = "timer1",
+   .mpu_irqs   = omap2_timer1_mpu_irqs,
+   .main_clk   = "gpt1_fck",
+   .p

[RFC PATCH 18/35] ARM: OMAP3+: cpuidle: remove code from __init section

2015-04-15 Thread Tero Kristo
Needed by hwmod module boot.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/cpuidle34xx.c |2 +-
 arch/arm/mach-omap2/cpuidle44xx.c |2 +-
 arch/arm/mach-omap2/pm.h  |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c 
b/arch/arm/mach-omap2/cpuidle34xx.c
index aa7b379..0f149d8 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -323,7 +323,7 @@ static struct cpuidle_driver omap3_idle_driver = {
  * Registers the OMAP3 specific cpuidle driver to the cpuidle
  * framework with the valid set of states.
  */
-int __init omap3_idle_init(void)
+int omap3_idle_init(void)
 {
mpu_pd = pwrdm_lookup("mpu_pwrdm");
core_pd = pwrdm_lookup("core_pwrdm");
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c 
b/arch/arm/mach-omap2/cpuidle44xx.c
index 01e398a..72e47d7 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -231,7 +231,7 @@ static struct cpuidle_driver omap4_idle_driver = {
  * Registers the OMAP4+ specific cpuidle driver to the cpuidle
  * framework with the valid set of states.
  */
-int __init omap4_idle_init(void)
+int omap4_idle_init(void)
 {
mpu_pd = pwrdm_lookup("mpu_pwrdm");
cpu_pd[0] = pwrdm_lookup("cpu0_pwrdm");
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 425bfcd..dc02ce8 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -16,8 +16,8 @@
 #include "powerdomain.h"
 
 #ifdef CONFIG_CPU_IDLE
-extern int __init omap3_idle_init(void);
-extern int __init omap4_idle_init(void);
+int omap3_idle_init(void);
+int omap4_idle_init(void);
 #else
 static inline int omap3_idle_init(void)
 {
-- 
1.7.9.5

--
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


[RFC PATCH 26/35] ARM: OMAP2+: build: add support for hwmod data modules

2015-04-15 Thread Tero Kristo
New Kconfig option added, OMAP_HWMOD_DATA_MODULES, which builds hwmod
data as modules if enabled. By default, the data is built-in to kernel
image for ease of use. Makefile is also changed to support building of
the new hwmod data modules.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/Kconfig |9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 2b8e477..a543dfe 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -299,6 +299,15 @@ config OMAP4_ERRATA_I688
  In MPU case, L3 T2ASYNC FIFO and DDR T2ASYNC FIFO needs to be drained.
  IO barrier ensure that there is no synchronisation loss on initiators
  operating on both interconnect port simultaneously.
+
+config OMAP_HWMOD_DATA_MODULES
+   bool "OMAP hardware module data built to modules"
+   default n
+   help
+ Select whether hwmod data shall be built as modules, or built
+ in to kernel. By default, this option is n, which means all the
+ hwmod data will be built-in to kernel image.
+
 endmenu
 
 endif
-- 
1.7.9.5

--
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


[RFC PATCH 29/35] ARM: OMAP2+: io: remove common_pm_late_init if using hwmod data modules

2015-04-15 Thread Tero Kristo
If hwmod data is built as a module, PM init will be done after the module
has been loaded. PM code has dependencies towards certain hwmods, which
are not going to be available during early init.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/io.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index c2b80b8..258e5ac 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -354,7 +354,9 @@ static int __init _omap2_init_reprogram_sdrc(void)
 static void __init __maybe_unused omap_common_late_init(void)
 {
omap_mux_late_init();
+#ifndef CONFIG_OMAP_HWMOD_DATA_MODULES
omap2_common_pm_late_init();
+#endif
omap_soc_device_init();
 }
 
-- 
1.7.9.5

--
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


[RFC PATCH 28/35] ARM: OMAP2+: board-generic: add support for generic hwmod modular init

2015-04-15 Thread Tero Kristo
When hwmod data is built into modules, a slightly different init is
required at the board level. Add this new init support function, and
change the boards that support hwmod data module in subsequent patches.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/board-generic.c |5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c 
b/arch/arm/mach-omap2/board-generic.c
index 34ff14b..c58cf5a 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -42,6 +42,11 @@ static void __init omap_generic_init(void)
omapdss_init_of();
 }
 
+static void __init __maybe_unused omap_generic_modular_init(void)
+{
+   omap_pdata_quirks_early_init(omap_dt_match_table);
+}
+
 #ifdef CONFIG_SOC_OMAP2420
 static const char *const omap242x_boards_compat[] __initconst = {
"ti,omap2420",
-- 
1.7.9.5

--
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


[RFC PATCH 17/35] ARM: OMAP3: control: remove code from __init section

2015-04-15 Thread Tero Kristo
Needed by hwmod module boot.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/control.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index da041b4..b0d5e47 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -602,7 +602,7 @@ static void __init omap3_ctrl_setup_d2d_padconf(void)
  * Initializes system control module. This sets up the sysconfig autoidle,
  * and sets up modem and iva2 so that they can be idled properly.
  */
-void __init omap3_ctrl_init(void)
+void omap3_ctrl_init(void)
 {
omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG);
 
-- 
1.7.9.5

--
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


[RFC PATCH 35/35] HACK: remove omap3 hwmod external dependencies

2015-04-15 Thread Tero Kristo
This is a hack in a sense that this is a temporary trial patch to verify
the module functionality for omap3. The external dependencies should
be removed all at once for all platforms when the support is added for all.

Signed-off-by: Tero Kristo 
---
 .../mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c |2 +-
 .../mach-omap2/omap_hwmod_common_ipblock_data.c|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
index c6c6384..7ba20ee 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
@@ -275,7 +275,7 @@ struct omap_hwmod_class_sysconfig omap2_hdq1w_sysc = {
 struct omap_hwmod_class omap2_hdq1w_class = {
.name   = "hdq1w",
.sysc   = &omap2_hdq1w_sysc,
-   .reset  = &omap_hdq1w_reset,
+   //.reset= &omap_hdq1w_reset,
 };
 
 struct omap_hwmod_irq_info omap2_hdq1w_mpu_irqs[] = {
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_ipblock_data.c 
b/arch/arm/mach-omap2/omap_hwmod_common_ipblock_data.c
index f21664d..cd1c4a7 100644
--- a/arch/arm/mach-omap2/omap_hwmod_common_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_common_ipblock_data.c
@@ -30,7 +30,7 @@ static struct omap_hwmod_class_sysconfig omap2_dss_sysc = {
 struct omap_hwmod_class omap2_dss_hwmod_class = {
.name   = "dss",
.sysc   = &omap2_dss_sysc,
-   .reset  = omap_dss_reset,
+   //.reset= omap_dss_reset,
 };
 
 /*
-- 
1.7.9.5

--
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


[RFC PATCH 27/35] ARM: OMAP2+: pdata-quirks: add support for early and late pdata_quirks init

2015-04-15 Thread Tero Kristo
This splits up the platform bus registration to early boot and module
time probe versions, which register different portions of the bus based
on hwmod data availability. The common version is retained still for
supporting the different SoCs during transition time.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/common.h   |2 +
 arch/arm/mach-omap2/pdata-quirks.c |  115 
 2 files changed, 117 insertions(+)

diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 172b902..95b80a1 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -305,6 +305,8 @@ static inline void omap4_cpu_resume(void)
 
 #endif
 
+void omap_pdata_quirks_late_init(const struct of_device_id *);
+void omap_pdata_quirks_early_init(const struct of_device_id *);
 void pdata_quirks_init(const struct of_device_id *);
 void omap_auxdata_legacy_init(struct device *dev);
 void omap_pcs_legacy_init(int irq, void (*rearm)(void));
diff --git a/arch/arm/mach-omap2/pdata-quirks.c 
b/arch/arm/mach-omap2/pdata-quirks.c
index 6d5948a..ffdccd3 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -26,6 +26,7 @@
 #include "omap_device.h"
 #include "omap-secure.h"
 #include "soc.h"
+#include "clock.h"
 
 struct pdata_init {
const char *compatible;
@@ -452,6 +453,120 @@ static void pdata_quirks_check(struct pdata_init *quirks)
}
 }
 
+struct bus_entry {
+   struct platform_device *dev;
+   struct device_node *bus;
+   struct list_head link;
+};
+
+static LIST_HEAD(bus_list);
+
+static struct platform_device
+*omap_pdata_bus_create(struct device_node *bus,
+  const struct of_device_id *bus_match,
+  struct device *parent)
+{
+   const struct of_dev_auxdata *auxdata;
+   struct device_node *child;
+   struct platform_device *dev;
+   const char *oh_name;
+   const char *bus_id = NULL;
+   void *platform_data = NULL;
+   int i;
+   int count;
+
+   if (!of_get_property(bus, "compatible", NULL))
+   return NULL;
+
+   auxdata = of_dev_lookup(omap_auxdata_lookup, bus);
+   if (auxdata) {
+   bus_id = auxdata->name;
+   platform_data = auxdata->platform_data;
+   }
+
+   /* check hwmod availability */
+   count = of_property_count_strings(bus, "ti,hwmods");
+   for (i = 0; i < count; i++) {
+   of_property_read_string_index(bus, "ti,hwmods", i, &oh_name);
+   if (!omap_hwmod_lookup(oh_name)) {
+   pr_info("%s: hwmod %s not ready yet, skipping.\n",
+   __func__, oh_name);
+   return NULL;
+   }
+   }
+
+   dev = of_platform_device_create_pdata(bus, bus_id, platform_data,
+ parent);
+
+   if (!dev || !of_match_node(bus_match, bus))
+   return NULL;
+
+   for_each_child_of_node(bus, child) {
+   omap_pdata_bus_create(child, bus_match, &dev->dev);
+   }
+
+   of_node_set_flag(bus, OF_POPULATED_BUS);
+
+   return dev;
+}
+
+void omap_pdata_quirks_late_init(const struct of_device_id 
*omap_dt_match_table)
+{
+   struct bus_entry *entry;
+   struct bus_entry *tmp;
+   struct device_node *child;
+
+   omapdss_early_init_of();
+
+   omap2_system_dma_init();
+
+   pdata_quirks_check(auxdata_quirks);
+
+   list_for_each_entry_safe(entry, tmp, &bus_list, link) {
+   for_each_child_of_node(entry->bus, child) {
+   omap_pdata_bus_create(child, omap_dt_match_table,
+ &entry->dev->dev);
+   }
+
+   list_del(&entry->link);
+   kfree(entry);
+   }
+
+   pdata_quirks_check(pdata_quirks);
+
+   omapdss_init_of();
+
+#ifdef CONFIG_OMAP_HWMOD_DATA_MODULES
+   omap2_common_pm_late_init();
+
+   if (cpu_is_omap34xx())
+   omap3_pm_init();
+
+   omap2_clk_enable_autoidle_all();
+#endif
+}
+EXPORT_SYMBOL(omap_pdata_quirks_late_init);
+
+void __init omap_pdata_quirks_early_init(const struct of_device_id *bus_match)
+{
+   struct device_node *bus;
+   struct bus_entry *entry;
+   struct platform_device *dev;
+
+   omap_sdrc_init(NULL, NULL);
+
+   for_each_matching_node(bus, bus_match) {
+   dev = omap_pdata_bus_create(bus, bus_match, NULL);
+   entry = kzalloc(sizeof(*entry), GFP_KERNEL);
+   entry->bus = bus;
+   entry->dev = dev;
+   list_add(&entry->link, &bus_list);
+   }
+
+   /* Populate any devices outside ocp bus */
+   of_platform_populate(NULL, bus_match, omap_auxdata_lookup, NULL);
+}
+
 void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table)
 {
omap_sdrc_init(NULL, NULL);
-- 
1.7.9.5

--
To unsu

[RFC PATCH 25/35] ARM: OMAP2+: DMA: remove omap2_system_dma_init from __init section

2015-04-15 Thread Tero Kristo
With the introduction of the hwmod data modules, the DMA init also needs
to happen later in boot. Thus, remove it from the __init section, and
also make the API publicly available.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/common.h |2 ++
 arch/arm/mach-omap2/dma.c|6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 54cf6ca..172b902 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -324,5 +324,7 @@ int omap_clk_init(void);
 int omapdss_init_of(void);
 void omapdss_early_init_of(void);
 
+void omap2_system_dma_init(void);
+
 #endif /* __ASSEMBLER__ */
 #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index 3ff450b..946f355 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -204,7 +204,7 @@ static unsigned configure_dma_errata(void)
return errata;
 }
 
-static struct omap_system_dma_plat_info dma_plat_info __initdata = {
+static struct omap_system_dma_plat_info dma_plat_info = {
.reg_map= reg_map,
.channel_stride = 0x60,
.show_dma_caps  = omap2_show_dma_caps,
@@ -220,7 +220,7 @@ static struct platform_device_info omap_dma_dev_info = {
 };
 
 /* One time initializations */
-static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void 
*unused)
+static int omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
 {
struct platform_device  *pdev;
struct omap_system_dma_plat_infop;
@@ -270,7 +270,7 @@ static int __init omap2_system_dma_init_dev(struct 
omap_hwmod *oh, void *unused)
return 0;
 }
 
-static int __init omap2_system_dma_init(void)
+int omap2_system_dma_init(void)
 {
struct platform_device *pdev;
int res;
-- 
1.7.9.5

--
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


[RFC PATCH 19/35] ARM: OMAP3: PRM: remove code from __init section

2015-04-15 Thread Tero Kristo
Needed by hwmod module boot.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/prm3xxx.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index 5713bbd..4f16257 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -270,7 +270,7 @@ int omap3xxx_prm_clear_mod_irqs(s16 module, u8 regs, u32 
ignore_bits)
  * Toggles the reset signal to modem IP block. Required to allow
  * OMAP3430 without stacked modem to idle properly.
  */
-void __init omap3_prm_reset_modem(void)
+void omap3_prm_reset_modem(void)
 {
omap2_prm_write_mod_reg(
OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON_MASK |
@@ -286,7 +286,7 @@ void __init omap3_prm_reset_modem(void)
  *
  * Initializes PRM registers for PM use. Called from PM init.
  */
-void __init omap3_prm_init_pm(bool has_uart4, bool has_iva)
+void omap3_prm_init_pm(bool has_uart4, bool has_iva)
 {
u32 en_uart4_mask;
u32 grpsel_uart4_mask;
-- 
1.7.9.5

--
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


[RFC PATCH 22/35] ARM: OMAP2+: PM: remove code from __init section

2015-04-15 Thread Tero Kristo
Needed by hwmod module boot.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/pm.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 58920bc..4891559 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -108,7 +108,7 @@ static void __init omap2_init_processor_devices(void)
}
 }
 
-int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
+int omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
 {
/* XXX The usecount test is racy */
if ((clkdm->flags & CLKDM_CAN_ENABLE_AUTO) &&
@@ -128,8 +128,8 @@ int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, 
void *unused)
  * opp entry and sets the voltage domain to the voltage specified
  * in the opp entry
  */
-static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
-const char *oh_name)
+static int omap2_set_init_voltage(char *vdd_name, char *clk_name,
+ const char *oh_name)
 {
struct voltagedomain *voltdm;
struct clk *clk;
@@ -296,7 +296,7 @@ static int __init omap2_common_pm_init(void)
 }
 omap_postcore_initcall(omap2_common_pm_init);
 
-int __init omap2_common_pm_late_init(void)
+int omap2_common_pm_late_init(void)
 {
if (of_have_populated_dt()) {
omap3_twl_init();
-- 
1.7.9.5

--
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


[RFC PATCH 23/35] ARM: OMAP3: PM: remove code from __init section

2015-04-15 Thread Tero Kristo
Needed by hwmod module boot.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/pm34xx.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 88721df..de614e7 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -408,7 +408,7 @@ int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, 
int state)
return -EINVAL;
 }
 
-static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
+static int pwrdms_setup(struct powerdomain *pwrdm, void *unused)
 {
struct power_state *pwrst;
 
@@ -458,7 +458,7 @@ static void __init pm_errata_configure(void)
}
 }
 
-int __init omap3_pm_init(void)
+int omap3_pm_init(void)
 {
struct power_state *pwrst, *tmp;
struct clockdomain *neon_clkdm, *mpu_clkdm, *per_clkdm, *wkup_clkdm;
-- 
1.7.9.5

--
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


[RFC PATCH 33/35] ARM: OMAP3: pdata-quirks: add hwmod module platform data

2015-04-15 Thread Tero Kristo
Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/omap_hwmod.h   |8 
 arch/arm/mach-omap2/pdata-quirks.c |   11 +++
 2 files changed, 19 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 3ff9133..0c7eaf8 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -692,6 +692,14 @@ struct omap_hwmod {
struct omap_hwmod   *parent_hwmod;
 };
 
+enum {
+   OMAP_HWMOD_PTR_DSS_RESET = 0,
+   OMAP_HWMOD_PTR_HDQ1W_RESET,
+   OMAP_HWMOD_PTR_I2C_RESET,
+   OMAP_HWMOD_PTR_WD_TIMER_DIS,
+   OMAP_HWMOD_PTR_WD_TIMER_RESET,
+};
+
 struct omap_hwmod *omap_hwmod_lookup(const char *name);
 int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
void *data);
diff --git a/arch/arm/mach-omap2/pdata-quirks.c 
b/arch/arm/mach-omap2/pdata-quirks.c
index ffdccd3..c2c414e 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -27,6 +27,8 @@
 #include "omap-secure.h"
 #include "soc.h"
 #include "clock.h"
+#include "hdq1w.h"
+#include "wd_timer.h"
 
 struct pdata_init {
const char *compatible;
@@ -336,6 +338,14 @@ void omap_pcs_legacy_init(int irq, void (*rearm)(void))
pcs_pdata.rearm = rearm;
 }
 
+static void *omap_hwmod_pointers[] = {
+   [OMAP_HWMOD_PTR_DSS_RESET] = omap_dss_reset,
+   [OMAP_HWMOD_PTR_HDQ1W_RESET] = omap_hdq1w_reset,
+   [OMAP_HWMOD_PTR_I2C_RESET] = omap_i2c_reset,
+   [OMAP_HWMOD_PTR_WD_TIMER_DIS] = omap2_wd_timer_disable,
+   [OMAP_HWMOD_PTR_WD_TIMER_RESET] = omap2_wd_timer_reset,
+};
+
 /*
  * GPIOs for TWL are initialized by the I2C bus and need custom
  * handing until DSS has device tree bindings.
@@ -379,6 +389,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] = {
OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", 
&pcs_pdata),
OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d00, "5d00.mmu",
   &omap3_iommu_pdata),
+   OF_DEV_AUXDATA("ti,omap3-l3", 0x0, "ocp", &omap_hwmod_pointers),
/* Only on am3517 */
OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c03, "davinci_mdio.0", NULL),
OF_DEV_AUXDATA("ti,am3517-emac", 0x5c00, "davinci_emac.0",
-- 
1.7.9.5

--
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


[RFC PATCH 05/35] ARM: OMAP2+: hwmod: add support for rerouting hwmod links

2015-04-15 Thread Tero Kristo
If a hwmod with same name is already registered, reroute the links to
use the existing one rather than fail. This is needed when hwmod data
is made into a separate module, and for example, l3 bus is already
registered under different hwmod. The late module init will use
an l3 dummy hwmod instead, which will be rerouted to use the real
l3 hwmod.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/omap_hwmod.c |   26 ++
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 939161e..4fc42c9 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2797,6 +2797,8 @@ static int __init _add_link(struct omap_hwmod_ocp_if *oi)
  */
 static int __init _register_link(struct omap_hwmod_ocp_if *oi)
 {
+   struct omap_hwmod *oh;
+
if (!oi || !oi->master || !oi->slave || !oi->user)
return -EINVAL;
 
@@ -2810,11 +2812,27 @@ static int __init _register_link(struct 
omap_hwmod_ocp_if *oi)
 * Register the connected hwmods, if they haven't been
 * registered already
 */
-   if (oi->master->_state != _HWMOD_STATE_REGISTERED)
-   _register(oi->master);
+   if (oi->master->_state != _HWMOD_STATE_REGISTERED) {
+   oh = _lookup(oi->master->name);
+   if (oh) {
+   pr_debug("%s: remapping %s to %08x\n", __func__,
+oh->name, (u32)oh);
+   oi->master = oh;
+   } else {
+   _register(oi->master);
+   }
+   }
 
-   if (oi->slave->_state != _HWMOD_STATE_REGISTERED)
-   _register(oi->slave);
+   if (oi->slave->_state != _HWMOD_STATE_REGISTERED) {
+   oh = _lookup(oi->slave->name);
+   if (oh) {
+   pr_debug("%s: remapping %s to %08x\n", __func__,
+oh->name, (u32)oh);
+   oi->slave = oh;
+   } else {
+   _register(oi->slave);
+   }
+   }
 
_add_link(oi);
 
-- 
1.7.9.5

--
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


[RFC PATCH 16/35] ARM: OMAP2+: voltage: remove code from __init section

2015-04-15 Thread Tero Kristo
Needed by hwmod module boot.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/voltage.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
index cba8cad..84512e9 100644
--- a/arch/arm/mach-omap2/voltage.c
+++ b/arch/arm/mach-omap2/voltage.c
@@ -230,7 +230,7 @@ int omap_voltage_register_pmic(struct voltagedomain *voltdm,
  * system boot to init the voltage controller and
  * voltage processors.
  */
-int __init omap_voltage_late_init(void)
+int omap_voltage_late_init(void)
 {
struct voltagedomain *voltdm;
 
-- 
1.7.9.5

--
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


[RFC PATCH 08/35] ARM: OMAP2+: hwmod: move APIs out of __init section

2015-04-15 Thread Tero Kristo
With hwmod init being split into an early and a late module init parts,
certain hwmod APIs can't reside under __init section anymore. Thus,
remove the __init declaration from the required APIs to make them
accessible at the module probe phase also.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/omap_hwmod.c |   37 +++--
 arch/arm/mach-omap2/omap_hwmod.h |2 +-
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 4fc42c9..6e7b541 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1232,7 +1232,7 @@ static int _get_addr_space_by_name(struct omap_hwmod *oh, 
const char *name,
  * Intended to be called during hwmod registration only. No return
  * value.
  */
-static void __init _save_mpu_port_index(struct omap_hwmod *oh)
+static void _save_mpu_port_index(struct omap_hwmod *oh)
 {
struct omap_hwmod_ocp_if *os = NULL;
struct list_head *p;
@@ -1285,7 +1285,8 @@ static struct omap_hwmod_ocp_if *_find_mpu_rt_port(struct 
omap_hwmod *oh)
  * Returns a pointer to the struct omap_hwmod_addr_space record representing
  * the register target MPU address space; or returns NULL upon error.
  */
-static struct omap_hwmod_addr_space * __init _find_mpu_rt_addr_space(struct 
omap_hwmod *oh)
+static struct omap_hwmod_addr_space
+*_find_mpu_rt_addr_space(struct omap_hwmod *oh)
 {
struct omap_hwmod_ocp_if *os;
struct omap_hwmod_addr_space *mem;
@@ -2371,8 +2372,8 @@ static int of_dev_hwmod_lookup(struct device_node *np,
  * Returns 0 on success, -EINVAL if an invalid hwmod is passed, and
  * -ENXIO on absent or invalid register target address space.
  */
-static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
-   int index, struct device_node *np)
+static int _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
+int index, struct device_node *np)
 {
struct omap_hwmod_addr_space *mem;
void __iomem *va_start = NULL;
@@ -2428,7 +2429,7 @@ static int __init _init_mpu_rt_base(struct omap_hwmod 
*oh, void *data,
  * upon success or if the hwmod isn't registered or if the hwmod's
  * address space is not defined, or -EINVAL upon failure.
  */
-static int __init _init(struct omap_hwmod *oh, void *data)
+static int _init(struct omap_hwmod *oh, void *data)
 {
int r, index;
struct device_node *np = NULL;
@@ -2486,7 +2487,7 @@ static int __init _init(struct omap_hwmod *oh, void *data)
  * a stub; implementing this properly requires iclk autoidle usecounting in
  * the clock code.   No return value.
  */
-static void __init _setup_iclk_autoidle(struct omap_hwmod *oh)
+static void _setup_iclk_autoidle(struct omap_hwmod *oh)
 {
struct omap_hwmod_ocp_if *os;
struct list_head *p;
@@ -2521,7 +2522,7 @@ static void __init _setup_iclk_autoidle(struct omap_hwmod 
*oh)
  * reset.  Returns 0 upon success or a negative error code upon
  * failure.
  */
-static int __init _setup_reset(struct omap_hwmod *oh)
+static int _setup_reset(struct omap_hwmod *oh)
 {
int r;
 
@@ -2582,7 +2583,7 @@ static int __init _setup_reset(struct omap_hwmod *oh)
  *
  * No return value.
  */
-static void __init _setup_postsetup(struct omap_hwmod *oh)
+static void _setup_postsetup(struct omap_hwmod *oh)
 {
u8 postsetup_state;
 
@@ -2630,7 +2631,7 @@ static void __init _setup_postsetup(struct omap_hwmod *oh)
  * affects the IP block hardware, or system integration hardware
  * associated with the IP block.  Returns 0.
  */
-static int __init _setup(struct omap_hwmod *oh, void *data)
+static int _setup(struct omap_hwmod *oh, void *data)
 {
if (oh->_state != _HWMOD_STATE_INITIALIZED)
return 0;
@@ -2682,7 +2683,7 @@ static int __init _setup(struct omap_hwmod *oh, void 
*data)
  * that the copy process would be relatively complex due to the large number
  * of substructures.
  */
-static int __init _register(struct omap_hwmod *oh)
+static int _register(struct omap_hwmod *oh)
 {
if (!oh || !oh->name || !oh->class || !oh->class->name ||
(oh->_state != _HWMOD_STATE_UNKNOWN))
@@ -2725,8 +2726,8 @@ static int __init _register(struct omap_hwmod *oh)
  * 'supplemental' allocations will be logged when debugging is
  * enabled.  Returns 0.
  */
-static int __init _alloc_links(struct omap_hwmod_link **ml,
-  struct omap_hwmod_link **sl)
+static int _alloc_links(struct omap_hwmod_link **ml,
+   struct omap_hwmod_link **sl)
 {
unsigned int sz;
 
@@ -2762,7 +2763,7 @@ static int __init _alloc_links(struct omap_hwmod_link 
**ml,
  * locking in this code.  Changes to this assumption will require
  * additional locking.  Returns 0.
  */
-static int __init _add_link(struct omap_hwmod_ocp_if *oi)
+static int _add_link(struct omap_hwmod_ocp_if *oi)
 {
struct om

[RFC PATCH 09/35] ARM: OMAP2+: hwmod: move omap_hwmod_init_postsetup to hwmod driver

2015-04-15 Thread Tero Kristo
Previously this function was incorrectly implemented under low level
IO init. However, this API will be needed for late hwmod data module
init also, so move it to the generic hwmod codebase, and export the
function also for module use.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/io.c |   20 
 arch/arm/mach-omap2/omap_hwmod.c |   38 ++
 arch/arm/mach-omap2/omap_hwmod.h |2 ++
 3 files changed, 40 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index c4871c5..c2b80b8 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -351,26 +351,6 @@ static int __init _omap2_init_reprogram_sdrc(void)
return v;
 }
 
-static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
-{
-   return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
-}
-
-static void __init omap_hwmod_init_postsetup(void)
-{
-   u8 postsetup_state;
-
-   /* Set the default postsetup state for all hwmods */
-#ifdef CONFIG_PM
-   postsetup_state = _HWMOD_STATE_IDLE;
-#else
-   postsetup_state = _HWMOD_STATE_ENABLED;
-#endif
-   omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);
-
-   omap_pm_if_early_init();
-}
-
 static void __init __maybe_unused omap_common_late_init(void)
 {
omap_mux_late_init();
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 6e7b541..d20179a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3879,6 +3879,44 @@ ohsps_unlock:
 }
 
 /**
+ * _set_hwmod_postsetup_state - set postsetup state for a single hwmod
+ * @oh: hwmod to set postsetup state for
+ * @data: postsetup state
+ *
+ * Wrapper function for setting the postsetup state for a single hwmod.
+ * Forces return value to zero, so that we don't bail out with an error
+ * value returned from omap_hwmod_set_postsetup_state(); with hwmod data
+ * split to module + early init portions, the postsetup init will be
+ * called twice for some hwmods, but we still want to setup the state for
+ * all and not abort with the first hwmod complaining about its postsetup
+ * state being set already. Returns 0 always.
+ */
+static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
+{
+   omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
+   return 0;
+}
+
+/**
+ * omap_hwmod_init_postsetup - initialize postsetup state for all hwmods
+ *
+ * Sets the hwmod postsetup state for all hwmods based on PM configuration.
+ */
+void omap_hwmod_init_postsetup(void)
+{
+   u8 postsetup_state;
+
+   /* Set the default postsetup state for all hwmods */
+#ifdef CONFIG_PM
+   postsetup_state = _HWMOD_STATE_IDLE;
+#else
+   postsetup_state = _HWMOD_STATE_ENABLED;
+#endif
+   omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);
+}
+EXPORT_SYMBOL(omap_hwmod_init_postsetup);
+
+/**
  * omap_hwmod_get_context_loss_count - get lost context count
  * @oh: struct omap_hwmod *
  *
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index fe75d38..6da0524 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -729,6 +729,8 @@ int omap_hwmod_for_each_by_class(const char *classname,
 int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
 int omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
 
+void omap_hwmod_init_postsetup(void);
+
 extern void __init omap_hwmod_init(void);
 
 const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
-- 
1.7.9.5

--
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


[RFC PATCH 03/35] ARM: OMAP2: n8x0: remove __initdata declarations from code

2015-04-15 Thread Tero Kristo
Parts of the n8x0 board support code is needed during pdata registration,
which will be moved later in the boot. Thus, it can't reside under __initdata
section anymore and must be moved out of it.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/board-n8x0.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index b6443a4..d03a333 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -153,7 +153,7 @@ static struct omap2_mcspi_device_config p54spi_mcspi_config 
= {
.turbo_mode = 0,
 };
 
-static struct spi_board_info n800_spi_board_info[] __initdata = {
+static struct spi_board_info n800_spi_board_info[] = {
{
.modalias   = "p54spi",
.bus_num= 2,
@@ -569,11 +569,11 @@ static int n8x0_menelaus_late_init(struct device *dev)
 }
 #endif
 
-struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = {
+struct menelaus_platform_data n8x0_menelaus_platform_data = {
.late_init = n8x0_menelaus_late_init,
 };
 
-struct aic3x_pdata n810_aic33_data __initdata = {
+struct aic3x_pdata n810_aic33_data = {
.gpio_reset = 118,
 };
 
@@ -593,7 +593,7 @@ omap_late_initcall(n8x0_late_initcall);
  * Legacy init pdata init for n8x0. Note that we want to follow the
  * I2C bus numbering starting at 0 for device tree like other omaps.
  */
-void * __init n8x0_legacy_init(void)
+void *n8x0_legacy_init(void)
 {
board_check_revision();
spi_register_board_info(n800_spi_board_info,
-- 
1.7.9.5

--
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


[RFC PATCH 11/35] ARM: OMAP2+: pdata-quirks: move data out of __initdata section

2015-04-15 Thread Tero Kristo
These need to move later in the boot with hwmod data being moved into a
module, thus remove the __init declarations to make them accessible at
module probe phase also.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/pdata-quirks.c |   58 ++--
 1 file changed, 29 insertions(+), 29 deletions(-)

diff --git a/arch/arm/mach-omap2/pdata-quirks.c 
b/arch/arm/mach-omap2/pdata-quirks.c
index e642b07..6d5948a 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -37,11 +37,11 @@ static struct twl4030_gpio_platform_data twl_gpio_auxdata;
 
 #if IS_ENABLED(CONFIG_WL12XX)
 
-static struct wl12xx_platform_data wl12xx __initdata;
+static struct wl12xx_platform_data wl12xx;
 
-static void __init __used legacy_init_wl12xx(unsigned ref_clock,
-unsigned tcxo_clock,
-int gpio)
+static void __used legacy_init_wl12xx(unsigned ref_clock,
+ unsigned tcxo_clock,
+ int gpio)
 {
int res;
 
@@ -64,7 +64,7 @@ static inline void legacy_init_wl12xx(unsigned ref_clock,
 #endif
 
 #ifdef CONFIG_MACH_NOKIA_N8X0
-static void __init omap2420_n8x0_legacy_init(void)
+static void omap2420_n8x0_legacy_init(void)
 {
omap_auxdata_lookup[0].platform_data = n8x0_legacy_init();
 }
@@ -73,7 +73,7 @@ static void __init omap2420_n8x0_legacy_init(void)
 #endif
 
 #ifdef CONFIG_ARCH_OMAP3
-static void __init hsmmc2_internal_input_clk(void)
+static void hsmmc2_internal_input_clk(void)
 {
u32 reg;
 
@@ -104,7 +104,7 @@ static int omap3_sbc_t3730_twl_callback(struct device *dev,
return 0;
 }
 
-static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name)
+static void omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name)
 {
int err = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, hub_name);
 
@@ -121,18 +121,18 @@ static void __init omap3_sbc_t3x_usb_hub_init(int gpio, 
char *hub_name)
msleep(1);
 }
 
-static void __init omap3_sbc_t3730_twl_init(void)
+static void omap3_sbc_t3730_twl_init(void)
 {
twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
 }
 
-static void __init omap3_sbc_t3730_legacy_init(void)
+static void omap3_sbc_t3730_legacy_init(void)
 {
omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
 }
 
-static void __init omap3_sbc_t3530_legacy_init(void)
+static void omap3_sbc_t3530_legacy_init(void)
 {
omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
 }
@@ -157,27 +157,27 @@ static struct platform_device btwilink_device = {
.id = -1,
 };
 
-static void __init omap3_igep0020_rev_f_legacy_init(void)
+static void omap3_igep0020_rev_f_legacy_init(void)
 {
legacy_init_wl12xx(0, 0, 177);
platform_device_register(&wl18xx_device);
platform_device_register(&btwilink_device);
 }
 
-static void __init omap3_igep0030_rev_g_legacy_init(void)
+static void omap3_igep0030_rev_g_legacy_init(void)
 {
legacy_init_wl12xx(0, 0, 136);
platform_device_register(&wl18xx_device);
platform_device_register(&btwilink_device);
 }
 
-static void __init omap3_evm_legacy_init(void)
+static void omap3_evm_legacy_init(void)
 {
hsmmc2_internal_input_clk();
legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 149);
 }
 
-static void __init omap3_zoom_legacy_init(void)
+static void omap3_zoom_legacy_init(void)
 {
legacy_init_wl12xx(WL12XX_REFCLOCK_26, 0, 162);
 }
@@ -208,7 +208,7 @@ static struct emac_platform_data am35xx_emac_pdata = {
.interrupt_disable  = am35xx_disable_emac_int,
 };
 
-static void __init am35xx_emac_reset(void)
+static void am35xx_emac_reset(void)
 {
u32 v;
 
@@ -218,12 +218,12 @@ static void __init am35xx_emac_reset(void)
omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
 }
 
-static struct gpio cm_t3517_wlan_gpios[] __initdata = {
+static struct gpio cm_t3517_wlan_gpios[] = {
{ 56,   GPIOF_OUT_INIT_HIGH,"wlan pwr" },
{ 4,GPIOF_OUT_INIT_HIGH,"xcvr noe" },
 };
 
-static void __init omap3_sbc_t3517_wifi_init(void)
+static void omap3_sbc_t3517_wifi_init(void)
 {
int err = gpio_request_array(cm_t3517_wlan_gpios,
ARRAY_SIZE(cm_t3517_wlan_gpios));
@@ -239,7 +239,7 @@ static void __init omap3_sbc_t3517_wifi_init(void)
gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0);
 }
 
-static void __init omap3_sbc_t3517_legacy_init(void)
+static void omap3_sbc_t3517_legacy_init(void)
 {
omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub");
omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub");
@@ -249,7 +249,7 @@ static void __init omap3_sbc_t3517_legacy_init(void)
legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 145);
 }
 
-static void __init am3517_evm_legacy_init(void)
+static void am3517_evm_legacy_init(void)
 {

[RFC PATCH 14/35] ARM: OMAP2+: VC: remove code from __init section

2015-04-15 Thread Tero Kristo
Needed by hwmod module boot.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/vc.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index be9ef83..c67bdc5 100644
--- a/arch/arm/mach-omap2/vc.c
+++ b/arch/arm/mach-omap2/vc.c
@@ -413,7 +413,7 @@ static void omap3_set_off_timings(struct voltagedomain 
*voltdm)
voltdm->write(voltoffset, OMAP3_PRM_VOLTOFFSET_OFFSET);
 }
 
-static void __init omap3_vc_init_channel(struct voltagedomain *voltdm)
+static void omap3_vc_init_channel(struct voltagedomain *voltdm)
 {
omap3_vc_init_pmic_signaling(voltdm);
omap3_set_off_timings(voltdm);
@@ -562,7 +562,7 @@ struct i2c_init_data {
u8 hsscll_12;
 };
 
-static const __initdata struct i2c_init_data omap4_i2c_timing_data[] = {
+static const struct i2c_init_data omap4_i2c_timing_data[] = {
{
.load = 50,
.loadbits = 0x3,
@@ -610,7 +610,7 @@ static const __initdata struct i2c_init_data 
omap4_i2c_timing_data[] = {
  * Pre-calculated values are provided in data tables, as it is not
  * too straightforward to calculate these runtime.
  */
-static void __init omap4_vc_i2c_timing_init(struct voltagedomain *voltdm)
+static void omap4_vc_i2c_timing_init(struct voltagedomain *voltdm)
 {
u32 capacitance;
u32 val;
@@ -690,7 +690,7 @@ static void __init omap4_vc_i2c_timing_init(struct 
voltagedomain *voltdm)
  * channel registers.  All other VC channels will use the
  * same configuration.
  */
-static void __init omap_vc_i2c_init(struct voltagedomain *voltdm)
+static void omap_vc_i2c_init(struct voltagedomain *voltdm)
 {
struct omap_vc_channel *vc = voltdm->vc;
static bool initialized;
@@ -761,7 +761,7 @@ void __init omap_pm_setup_sr_i2c_pcb_length(u32 mm)
 }
 #endif
 
-void __init omap_vc_init_channel(struct voltagedomain *voltdm)
+void omap_vc_init_channel(struct voltagedomain *voltdm)
 {
struct omap_vc_channel *vc = voltdm->vc;
u8 on_vsel, onlp_vsel, ret_vsel, off_vsel;
-- 
1.7.9.5

--
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


[RFC PATCH 12/35] ARM: OMAP2+: dma: change DMA iomap to use hwmod pointers instead of pdata

2015-04-15 Thread Tero Kristo
This makes it possible to do the iomapping before driver probe. Driver
probe requires access to the DMA IO mapping already, so if it is
allocated after omap_device_build, it is too late and causes a crash.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/dma.c |   25 -
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index e1a56d8..3ff450b 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -225,13 +225,24 @@ static int __init omap2_system_dma_init_dev(struct 
omap_hwmod *oh, void *unused)
struct platform_device  *pdev;
struct omap_system_dma_plat_infop;
struct omap_dma_dev_attr*d;
-   struct resource *mem;
+   struct resource mem;
char*name = "omap_dma_system";
+   int r;
 
p = dma_plat_info;
p.dma_attr = (struct omap_dma_dev_attr *)oh->dev_attr;
p.errata = configure_dma_errata();
 
+   r = omap_hwmod_get_resource_byname(oh, IORESOURCE_MEM, NULL, &mem);
+   if (r)
+   return -ENXIO;
+
+   dma_base = ioremap(mem.start, mem.end - mem.start);
+   if (!dma_base) {
+   pr_err("%s: ioremap fail\n", __func__);
+   return -ENOMEM;
+   }
+
pdev = omap_device_build(name, 0, oh, &p, sizeof(p));
if (IS_ERR(pdev)) {
pr_err("%s: Can't build omap_device for %s:%s.\n",
@@ -242,18 +253,6 @@ static int __init omap2_system_dma_init_dev(struct 
omap_hwmod *oh, void *unused)
omap_dma_dev_info.res = pdev->resource;
omap_dma_dev_info.num_res = pdev->num_resources;
 
-   mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!mem) {
-   dev_err(&pdev->dev, "%s: no mem resource\n", __func__);
-   return -EINVAL;
-   }
-
-   dma_base = ioremap(mem->start, resource_size(mem));
-   if (!dma_base) {
-   dev_err(&pdev->dev, "%s: ioremap fail\n", __func__);
-   return -ENOMEM;
-   }
-
d = oh->dev_attr;
 
if (cpu_is_omap34xx() && (omap_type() != OMAP2_DEVICE_TYPE_GP))
-- 
1.7.9.5

--
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


[RFC PATCH 13/35] ARM: OMAP2+: VP: remove code from __init section

2015-04-15 Thread Tero Kristo
Needed for hwmod module boot.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/vp.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
index a3c3065..f757e94 100644
--- a/arch/arm/mach-omap2/vp.c
+++ b/arch/arm/mach-omap2/vp.c
@@ -35,7 +35,7 @@ static u32 _vp_set_init_voltage(struct voltagedomain *voltdm, 
u32 volt)
 }
 
 /* Generic voltage init functions */
-void __init omap_vp_init(struct voltagedomain *voltdm)
+void omap_vp_init(struct voltagedomain *voltdm)
 {
struct omap_vp_instance *vp = voltdm->vp;
u32 val, sys_clk_rate, timeout, waittime;
-- 
1.7.9.5

--
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


[RFC PATCH 02/35] clk: ti: gate/interface: add support for clk_ops->disable_unused

2015-04-15 Thread Tero Kristo
While executing clk_disable_unused during boot, the dflt clk operations
to disable the clocks include usecounting mechanism for clockdomains,
which is indexed badly in case a direct clock disable call is made. This
can potentially cause the underlying clockdomain to be disabled in
certain cases. Fixed by adding a separate disable_unused clk_ops, which
does not access the clockdomain functionality at all, and won't mess up
the usecounting.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/clock.c |   27 +--
 drivers/clk/ti/composite.c  |1 +
 drivers/clk/ti/gate.c   |2 ++
 drivers/clk/ti/interface.c  |1 +
 include/linux/clk/ti.h  |1 +
 5 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 6124db5..2b096c7 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -345,15 +345,12 @@ err:
 }
 
 /**
- * omap2_dflt_clk_disable - disable a clock in the hardware
+ * omap2_dflt_clk_disable_ll - low level disable a clock in the hardware
  * @hw: struct clk_hw * of the clock to disable
  *
- * Disable the clock @hw in the hardware, and call into the OMAP
- * clockdomain code to "disable" the corresponding clockdomain if all
- * clocks/hwmods in that clockdomain are now disabled.  No return
- * value.
+ * Disable the clock @hw in the hardware. No return value.
  */
-void omap2_dflt_clk_disable(struct clk_hw *hw)
+void omap2_dflt_clk_disable_ll(struct clk_hw *hw)
 {
struct clk_hw_omap *clk;
u32 v;
@@ -376,6 +373,24 @@ void omap2_dflt_clk_disable(struct clk_hw *hw)
v &= ~(1 << clk->enable_bit);
omap2_clk_writel(v, clk, clk->enable_reg);
/* No OCP barrier needed here since it is a disable operation */
+}
+
+/**
+ * omap2_dflt_clk_disable - disable a clock in the hardware
+ * @hw: struct clk_hw * of the clock to disable
+ *
+ * Disable the clock @hw in the hardware, and call into the OMAP
+ * clockdomain code to "disable" the corresponding clockdomain if all
+ * clocks/hwmods in that clockdomain are now disabled.  No return
+ * value.
+ */
+void omap2_dflt_clk_disable(struct clk_hw *hw)
+{
+   struct clk_hw_omap *clk;
+
+   clk = to_clk_hw_omap(hw);
+
+   omap2_dflt_clk_disable_ll(hw);
 
if (clkdm_control && clk->clkdm)
clkdm_clk_disable(clk->clkdm, hw->clk);
diff --git a/drivers/clk/ti/composite.c b/drivers/clk/ti/composite.c
index 3654f61..9e10191 100644
--- a/drivers/clk/ti/composite.c
+++ b/drivers/clk/ti/composite.c
@@ -57,6 +57,7 @@ static const struct clk_ops ti_composite_divider_ops = {
 static const struct clk_ops ti_composite_gate_ops = {
.enable = &omap2_dflt_clk_enable,
.disable= &omap2_dflt_clk_disable,
+   .disable_unused = &omap2_dflt_clk_disable_ll,
.is_enabled = &omap2_dflt_clk_is_enabled,
 };
 
diff --git a/drivers/clk/ti/gate.c b/drivers/clk/ti/gate.c
index d493307..e2d4d1e 100644
--- a/drivers/clk/ti/gate.c
+++ b/drivers/clk/ti/gate.c
@@ -41,6 +41,7 @@ static const struct clk_ops omap_gate_clk_ops = {
.init   = &omap2_init_clk_clkdm,
.enable = &omap2_dflt_clk_enable,
.disable= &omap2_dflt_clk_disable,
+   .disable_unused = &omap2_dflt_clk_disable_ll,
.is_enabled = &omap2_dflt_clk_is_enabled,
 };
 
@@ -48,6 +49,7 @@ static const struct clk_ops omap_gate_clk_hsdiv_restore_ops = 
{
.init   = &omap2_init_clk_clkdm,
.enable = &omap36xx_gate_clk_enable_with_hsdiv_restore,
.disable= &omap2_dflt_clk_disable,
+   .disable_unused = &omap2_dflt_clk_disable_ll,
.is_enabled = &omap2_dflt_clk_is_enabled,
 };
 
diff --git a/drivers/clk/ti/interface.c b/drivers/clk/ti/interface.c
index 265d91f..c037259 100644
--- a/drivers/clk/ti/interface.c
+++ b/drivers/clk/ti/interface.c
@@ -29,6 +29,7 @@ static const struct clk_ops ti_interface_clk_ops = {
.init   = &omap2_init_clk_clkdm,
.enable = &omap2_dflt_clk_enable,
.disable= &omap2_dflt_clk_disable,
+   .disable_unused = &omap2_dflt_clk_disable_ll,
.is_enabled = &omap2_dflt_clk_is_enabled,
 };
 
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index 6784400..c8c0543 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -306,6 +306,7 @@ int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long 
rate,
 int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate, u8 index);
 int omap2_dflt_clk_enable(struct clk_hw *hw);
+void omap2_dflt_clk_disable_ll(struct clk_hw *hw);
 void omap2_dflt_clk_disable(struct clk_hw *hw);
 int omap2_dflt_clk_is_enabled(struct clk_hw *hw);
 void omap3_clk_lock_dpll5(void);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to 

[RFC PATCH 06/35] of/platform: export a couple of platform device init APIs

2015-04-15 Thread Tero Kristo
Some custom platform bus registration code needs access to couple of
of/platform APIs, thus make these available outside of/platform.
The APIs exported in this patch are required by OMAP hwmod data module
support, which basically splits the platform bus registration to be done
in two phases; an early init containing only a small subset of the bus,
and a late init which adds everything else.

Signed-off-by: Tero Kristo 
---
 drivers/of/platform.c   |6 +++---
 include/linux/of_platform.h |9 +
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index b189733..e933cf7 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -218,7 +218,7 @@ static void of_dma_deconfigure(struct device *dev)
  * Returns pointer to created platform device, or NULL if a device was not
  * registered.  Unavailable devices will not get registered.
  */
-static struct platform_device *of_platform_device_create_pdata(
+struct platform_device *of_platform_device_create_pdata(
struct device_node *np,
const char *bus_id,
void *platform_data,
@@ -345,8 +345,8 @@ static struct amba_device *of_amba_device_create(struct 
device_node *node,
 /**
  * of_devname_lookup() - Given a device node, lookup the preferred Linux name
  */
-static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata 
*lookup,
-struct device_node *np)
+const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *lookup,
+  struct device_node *np)
 {
struct resource res;
 
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 611a691..8af1e42 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -63,10 +63,19 @@ extern struct platform_device 
*of_find_device_by_node(struct device_node *np);
 extern struct platform_device *of_platform_device_create(struct device_node 
*np,
   const char *bus_id,
   struct device *parent);
+extern struct platform_device *of_platform_device_create_pdata(
+   struct device_node *np,
+   const char *bus_id,
+   void *platform_data,
+   struct device *parent);
 
 extern int of_platform_bus_probe(struct device_node *root,
 const struct of_device_id *matches,
 struct device *parent);
+
+extern const struct of_dev_auxdata *of_dev_lookup(
+   const struct of_dev_auxdata *lookup,
+   struct device_node *np);
 #ifdef CONFIG_OF_ADDRESS
 extern int of_platform_populate(struct device_node *root,
const struct of_device_id *matches,
-- 
1.7.9.5

--
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


[RFC PATCH 10/35] ARM: OMAP2+: hwmod: export hwmod APIs for driver use

2015-04-15 Thread Tero Kristo
These are required for providing hwmod data in late boot through a module.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/omap_hwmod.c |   14 ++
 arch/arm/mach-omap2/omap_hwmod.h |5 -
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index d20179a..1f2b659 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3234,6 +3234,11 @@ static void __init *memblock_alloc(int size)
return memblock_virt_alloc(size, 0);
 }
 
+static void *kzalloc_alloc(int size)
+{
+   return kzalloc(size, GFP_KERNEL);
+}
+
 /**
  * omap_hwmod_register_links - register an array of hwmod links
  * @ois: pointer to an array of omap_hwmod_ocp_if to register
@@ -3276,6 +3281,14 @@ int omap_hwmod_register_links(struct omap_hwmod_ocp_if 
**ois)
return 0;
 }
 
+int omap_hwmod_register_links_late(struct omap_hwmod_ocp_if **ois)
+{
+   soc_ops.memalloc = kzalloc_alloc;
+
+   return omap_hwmod_register_links(ois);
+}
+EXPORT_SYMBOL(omap_hwmod_register_links_late);
+
 /**
  * _ensure_mpu_hwmod_is_setup - ensure the MPU SS hwmod is init'ed and set up
  * @oh: pointer to the hwmod currently being set up (usually not the MPU)
@@ -3344,6 +3357,7 @@ int omap_hwmod_setup_all(void)
return 0;
 }
 omap_core_initcall(omap_hwmod_setup_all);
+EXPORT_SYMBOL(omap_hwmod_setup_all);
 
 /**
  * omap_hwmod_enable - enable an omap_hwmod
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 6da0524..9612add 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -755,6 +755,9 @@ extern int ti81xx_hwmod_init(void);
 extern int dra7xx_hwmod_init(void);
 int am43xx_hwmod_init(void);
 
-extern int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois);
+int omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois);
+int omap_hwmod_register_links_late(struct omap_hwmod_ocp_if **ios);
+
+int omap_hwmod_setup_all(void);
 
 #endif
-- 
1.7.9.5

--
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


[RFC PATCH 04/35] ARM: OMAP2+: hwmod: add support for specifying memalloc functionality

2015-04-15 Thread Tero Kristo
hwmod currently uses memblock alloc, which only works very early in boot.
Change this by adding a runtime setup support for specifying memory alloc
functionality, this will allow hwmod init to be executed also later during
boot, when memblock allocation is no longer available.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/omap_hwmod.c |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 355b089..939161e 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -193,6 +193,7 @@ struct omap_hwmod_soc_ops {
int (*init_clkdm)(struct omap_hwmod *oh);
void (*update_context_lost)(struct omap_hwmod *oh);
int (*get_context_lost)(struct omap_hwmod *oh);
+   void * (*memalloc)(int size);
 };
 
 /* soc_ops: adapts the omap_hwmod code to the currently-booted SoC */
@@ -2738,7 +2739,8 @@ static int __init _alloc_links(struct omap_hwmod_link 
**ml,
sz = sizeof(struct omap_hwmod_link) * LINKS_PER_OCP_IF;
 
*sl = NULL;
-   *ml = memblock_virt_alloc(sz, 0);
+
+   *ml = soc_ops.memalloc(sz);
 
*sl = (void *)(*ml) + sizeof(struct omap_hwmod_link);
 
@@ -2855,7 +2857,7 @@ static int __init _alloc_linkspace(struct 
omap_hwmod_ocp_if **ois)
pr_debug("omap_hwmod: %s: allocating %d byte linkspace (%d links)\n",
 __func__, sz, max_ls);
 
-   linkspace = memblock_virt_alloc(sz, 0);
+   linkspace = soc_ops.memalloc(sz);
 
return 0;
 }
@@ -3208,6 +3210,11 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, 
void *data),
return ret;
 }
 
+static void __init *memblock_alloc(int size)
+{
+   return memblock_virt_alloc(size, 0);
+}
+
 /**
  * omap_hwmod_register_links - register an array of hwmod links
  * @ois: pointer to an array of omap_hwmod_ocp_if to register
@@ -3928,6 +3935,8 @@ void __init omap_hwmod_init(void)
WARN(1, "omap_hwmod: unknown SoC type\n");
}
 
+   soc_ops.memalloc = memblock_alloc;
+
inited = true;
 }
 
-- 
1.7.9.5

--
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


[RFC PATCH 07/35] wl12xx: remove __init declaration from platform data setup API

2015-04-15 Thread Tero Kristo
With most of the OMAP hwmod data being moved to a module, this API
needs to be accessed later in the boot and can't reside under
__init section anymore.

Signed-off-by: Tero Kristo 
---
 drivers/net/wireless/ti/wilink_platform_data.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ti/wilink_platform_data.c 
b/drivers/net/wireless/ti/wilink_platform_data.c
index a92bd3e..55bba5a 100644
--- a/drivers/net/wireless/ti/wilink_platform_data.c
+++ b/drivers/net/wireless/ti/wilink_platform_data.c
@@ -25,7 +25,7 @@
 
 static struct wl12xx_platform_data *wl12xx_platform_data;
 
-int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
+int wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
 {
if (wl12xx_platform_data)
return -EBUSY;
-- 
1.7.9.5

--
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


[RFC PATCH 15/35] ARM: OMAP2+: twl: remove code from __init section

2015-04-15 Thread Tero Kristo
Needed by hwmod module boot.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/omap_twl.c   |4 ++--
 arch/arm/mach-omap2/twl-common.c |4 ++--
 2 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 6bf6267..22ddd40 100644
--- a/arch/arm/mach-omap2/omap_twl.c
+++ b/arch/arm/mach-omap2/omap_twl.c
@@ -218,7 +218,7 @@ static struct omap_voltdm_pmic omap4_core_pmic = {
.uv_to_vsel = twl6030_uv_to_vsel,
 };
 
-int __init omap4_twl_init(void)
+int omap4_twl_init(void)
 {
struct voltagedomain *voltdm;
 
@@ -237,7 +237,7 @@ int __init omap4_twl_init(void)
return 0;
 }
 
-int __init omap3_twl_init(void)
+int omap3_twl_init(void)
 {
struct voltagedomain *voltdm;
 
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index 292eca0..2dd3440 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -34,7 +34,7 @@
 #include "voltage.h"
 #include "mux.h"
 
-static struct i2c_board_info __initdata pmic_i2c_board_info = {
+static struct i2c_board_info pmic_i2c_board_info = {
.addr   = 0x48,
.flags  = I2C_CLIENT_WAKE,
 };
@@ -85,7 +85,7 @@ void __init omap4_pmic_init(const char *pmic_type,
 }
 #endif
 
-void __init omap_pmic_late_init(void)
+void omap_pmic_late_init(void)
 {
/* Init the OMAP TWL parameters (if PMIC has been registerd) */
if (!pmic_i2c_board_info.irq)
-- 
1.7.9.5

--
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


[RFC PATCH 00/35] ARM: OMAP2+: hwmod data module support

2015-04-15 Thread Tero Kristo
Hi,

This RFC provides support for moving hwmod data into separate modules
which can be registered later during boot. Only system critical parts
of the hwmod data remain in omap_hwmod_*_early_data.c file, rest are
moved into omap_hwmod_*_late_data.c. The late data can alternatively
be built into a module, or built-in to kernel image, in which case
the system behaves pretty much the same way as it does currently. Use
kconfig option OMAP_HWMOD_DATA_MODULES to control the behavior. If
this approach is something that is seen feasible to follow, rest of
the SoCs can be converted in similar manner, and eventually all the
hwmod code should be moved under some driver (drivers/bus/ maybe?)

This RFC set only provides support for omap3 hwmod data split. Please
note that you probably must use ramdisk rootfs to load the hwmod data
module itself from, as most of the system devices are not initialized
in the early boot.

Testing done on omap3-beagle:
- boot, insmod, suspend-resume (ret/off), cpuidle (ret/off)

Boot log for omap3 here: http://pastebin.ubuntu.com/10826443/
- some spam generated by USB here, it seems to defer probe until i2c/twl
  is ready
- some additional debug prints enabled for testing purposes

Trial branch pushed here:
- tree: https://github.com/t-kristo/linux-pm.git
- branch: 4.0-hwmod-split-rfc

-Tero

--
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


[RFC PATCH 01/35] clk: composite: add support for disable_unused clk operation

2015-04-15 Thread Tero Kristo
Certain gate clocks require this for the init time clk_disable_unused
functionality to work properly, thus add support for it. If the gate
clock does not provide disable_unused ops, just call gate_ops->disable,
just like the core clock code would do.

Signed-off-by: Tero Kristo 
---
 drivers/clk/clk-composite.c |   16 
 1 file changed, 16 insertions(+)

diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index 956b7e5..5cb1496 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -187,6 +187,20 @@ static void clk_composite_disable(struct clk_hw *hw)
gate_ops->disable(gate_hw);
 }
 
+static void clk_composite_disable_unused(struct clk_hw *hw)
+{
+   struct clk_composite *composite = to_clk_composite(hw);
+   const struct clk_ops *gate_ops = composite->gate_ops;
+   struct clk_hw *gate_hw = composite->gate_hw;
+
+   __clk_hw_set_clk(gate_hw, hw);
+
+   if (gate_ops->disable_unused)
+   gate_ops->disable_unused(gate_hw);
+   else
+   gate_ops->disable(gate_hw);
+}
+
 struct clk *clk_register_composite(struct device *dev, const char *name,
const char **parent_names, int num_parents,
struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
@@ -267,6 +281,8 @@ struct clk *clk_register_composite(struct device *dev, 
const char *name,
clk_composite_ops->is_enabled = clk_composite_is_enabled;
clk_composite_ops->enable = clk_composite_enable;
clk_composite_ops->disable = clk_composite_disable;
+   clk_composite_ops->disable_unused =
+   clk_composite_disable_unused;
}
 
init.ops = clk_composite_ops;
-- 
1.7.9.5

--
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 v2] genirq: Set IRQCHIP_SKIP_SET_WAKE flag for dummy_irq_chip

2015-04-15 Thread Gregory CLEMENT
On 15/04/2015 10:14, Roger Quadros wrote:
> Without this system suspend is broken on systems that have
> drivers calling enable/disable_irq_wake() for interrupts based off
> the dummy irq hook.
> (e.g. drivers/gpio/gpio-pcf857x.c)
> 
> http://article.gmane.org/gmane.linux.kernel/1879035
> 
> Signed-off-by: Roger Quadros 

FWIW:

Reviewed-by: Gregory CLEMENT 


> ---
>  kernel/irq/dummychip.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/irq/dummychip.c b/kernel/irq/dummychip.c
> index 988dc58..2feb6fe 100644
> --- a/kernel/irq/dummychip.c
> +++ b/kernel/irq/dummychip.c
> @@ -57,5 +57,6 @@ struct irq_chip dummy_irq_chip = {
>   .irq_ack= noop,
>   .irq_mask   = noop,
>   .irq_unmask = noop,
> + .flags  = IRQCHIP_SKIP_SET_WAKE,
>  };
>  EXPORT_SYMBOL_GPL(dummy_irq_chip);
> 


-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
--
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: [RFC][PATCH v2 05/13] usb: otg: add OTG core

2015-04-15 Thread Paul Bolle
(This will go into a minor detail. That's probably not what you want
when posting an RFC. But this patch got caught by an email filter I use
and a future, non-RFC, version will get caught too. So I decided to
bother you with this now.)

On Tue, 2015-04-14 at 13:41 +0300, Roger Quadros wrote:
> --- a/drivers/usb/common/Makefile
> +++ b/drivers/usb/common/Makefile

> +obj-$(CONFIG_USB_OTG_CORE) += usb-otg.o

This creates a module usb-otg.ko if CONFIG_USB_OTG_CORE is 'm', built
from just usb-otg.c.

> --- /dev/null
> +++ b/drivers/usb/common/usb-otg.c

> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.

> +EXPORT_SYMBOL_GPL(usb_otg_register);

> +EXPORT_SYMBOL_GPL(usb_otg_unregister);

> +EXPORT_SYMBOL_GPL(usb_otg_sync_inputs);

> +EXPORT_SYMBOL_GPL(usb_otg_kick_fsm);

> +EXPORT_SYMBOL_GPL(usb_otg_register_hcd);

> +EXPORT_SYMBOL_GPL(usb_otg_unregister_hcd);

> +EXPORT_SYMBOL_GPL(usb_otg_register_gadget);

> +EXPORT_SYMBOL_GPL(usb_otg_unregister_gadget);
 
> +EXPORT_SYMBOL_GPL(usb_otg_fsm_to_dev);

This code adds no MODULE_LICENSE() macro in this patch and usb-otg.ko
will carry no license field. So I think the loading of that module
(triggered by loading another module that uses one of the exported
symbols, I suppose) taints the kernel. Am I correct?


Paul Bolle

--
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] genirq: provide dummy set_irq_wake()

2015-04-15 Thread Gregory CLEMENT
Hi Roger,

On 15/04/2015 10:07, Roger Quadros wrote:
> Hi Gregory,
> 
> On 14/04/15 17:02, Gregory CLEMENT wrote:
>> Hi Roger,
>>
>> On 14/04/2015 12:13, Roger Quadros wrote:
>>> Hi Thomas,
>>>
>>> On 30/03/15 16:15, Roger Quadros wrote:
 Without this system suspend is broken on systems that have
 drivers calling enable/disable_irq_wake() for interrupts based off
 the dummy irq hook.
 (e.g. drivers/gpio/gpio-pcf857x.c)

 http://article.gmane.org/gmane.linux.kernel/1879035

 Signed-off-by: Roger Quadros 
>>>
>>> Any comments on this patch?
>>
>> I read the url you pointed and I wonder why, at then end, did
>> you choose to add a dummy set_irq_wake() instead of using
>> IRQCHIP_SKIP_SET_WAKE ?
> 
> You mean like this?
> 
> diff --git a/kernel/irq/dummychip.c b/kernel/irq/dummychip.c
> index 988dc58..2feb6fe 100644
> --- a/kernel/irq/dummychip.c
> +++ b/kernel/irq/dummychip.c
> @@ -57,5 +57,6 @@ struct irq_chip dummy_irq_chip = {
>   .irq_ack= noop,
>   .irq_mask   = noop,
>   .irq_unmask = noop,
> + .flags  = IRQCHIP_SKIP_SET_WAKE,
>  };
>  EXPORT_SYMBOL_GPL(dummy_irq_chip);


Yes exactly.

> 
> This works as well and is better. I'll post a v2.


Thanks,

Gregory

> 
> cheers,
> -roger
> 
>>>
 ---
  kernel/irq/dummychip.c | 6 ++
  1 file changed, 6 insertions(+)

 diff --git a/kernel/irq/dummychip.c b/kernel/irq/dummychip.c
 index 988dc58..2405d7a 100644
 --- a/kernel/irq/dummychip.c
 +++ b/kernel/irq/dummychip.c
 @@ -32,6 +32,11 @@ static unsigned int noop_ret(struct irq_data *data)
return 0;
  }
  
 +static int noop_int_ret(struct irq_data *data, unsigned int val)
 +{
 +  return 0;
 +}
 +
  /*
   * Generic no controller implementation
   */
 @@ -57,5 +62,6 @@ struct irq_chip dummy_irq_chip = {
.irq_ack= noop,
.irq_mask   = noop,
.irq_unmask = noop,
 +  .irq_set_wake   = noop_int_ret,
  };
  EXPORT_SYMBOL_GPL(dummy_irq_chip);

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


-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
--
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 v4 1/8] dmaengine: of_dma: Support for DMA routers

2015-04-15 Thread Peter Ujfalusi
On 04/10/2015 10:40 AM, Maxime Ripard wrote:
> On Thu, Apr 09, 2015 at 11:24:58AM +0300, Peter Ujfalusi wrote:
>> On 04/08/2015 06:42 PM, Maxime Ripard wrote:
 ---
  Documentation/devicetree/bindings/dma/dma.txt | 28 +
  drivers/dma/dmaengine.c   |  7 +++
  drivers/dma/of-dma.c  | 86 
 +++
  include/linux/dmaengine.h | 17 ++
  include/linux/of_dma.h| 21 +++
  5 files changed, 159 insertions(+)
>>>
>>> Can that be moved to a header / C file of its own?
>>>
>>> There's a lot of various code already in dmaengine.h and dmaengine.c,
>>> it would be really great to avoid adding more random stuff in there.
>>
>> This patch adds the core support for DMA signal routers. It adds
>> fairly small amount of generic code to the core to achieve this. I
>> don't think it would be better to create let's say of-dma-router.c
>> and .h just for this and export functions from of-dma.c to be used
>> outside of the file.
> 
> A lot of "a fairly small amount of generic code" has been added over
> time, and we ended up in the current situation.

So that we have fairly good dmaengine core? If people using the code, they
will eventually fix things, add new features. When dmaengine came to existence
we did not had DMA routers, now that the SoCs are getting even more
complicated they are coming (in case of DRA7x, it is already here).

> It's a bit sad if we just end up moving this just after it got merged,
> especially if it doesn't have any kind of dependency on any of the
> core function.

This provides core functionality to handle DMA signal routers via DT. It does
depend on the DT DMA parsing core code as it integrates with it.

>> The signal router is not a DMA device, it is represented in the device tree
>> and the code will do the needed translation, which is transparent for the DMA
>> clients and also for the DMA controllers. Neither should know about the 
>> signal
>> router.
> 
> Yeah, I got that part, and we do agree on that.
> 
>> Similar translation can be done for ACPI.
> 
> But this argument is exactly why it shouldn't be tied to the device
> tree. We wouldn't like to re-do all this all over again for ACPI,
> while your code seems to just handle that very well, wouldn't we?

The data structures used by the DT and ACPI layers are different. Underneath
DT and ACPI we do not have enough information on how to handle the DMA signal
router. If you happen to have multiple DMA controllers in the system for
example how would you tell how the routers are connected?
In DRA7x we have sDMA and eDMA controllers. Both have similar DMA crossbar. It
is only possible to know the hierarchy of the components via DT. I'm sure this
is the same for ACPI. You take away the ACPI layer and you loose the topology
of the system.
Probably with huge architectural change in the dmaengine core (and thus with
all the drivers) this might be possible, but I don't think that is a valid
route to take.

-- 
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


[PATCH v2] genirq: Set IRQCHIP_SKIP_SET_WAKE flag for dummy_irq_chip

2015-04-15 Thread Roger Quadros
Without this system suspend is broken on systems that have
drivers calling enable/disable_irq_wake() for interrupts based off
the dummy irq hook.
(e.g. drivers/gpio/gpio-pcf857x.c)

http://article.gmane.org/gmane.linux.kernel/1879035

Signed-off-by: Roger Quadros 
---
 kernel/irq/dummychip.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/dummychip.c b/kernel/irq/dummychip.c
index 988dc58..2feb6fe 100644
--- a/kernel/irq/dummychip.c
+++ b/kernel/irq/dummychip.c
@@ -57,5 +57,6 @@ struct irq_chip dummy_irq_chip = {
.irq_ack= noop,
.irq_mask   = noop,
.irq_unmask = noop,
+   .flags  = IRQCHIP_SKIP_SET_WAKE,
 };
 EXPORT_SYMBOL_GPL(dummy_irq_chip);
-- 
2.1.0

--
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] genirq: provide dummy set_irq_wake()

2015-04-15 Thread Roger Quadros
Hi Gregory,

On 14/04/15 17:02, Gregory CLEMENT wrote:
> Hi Roger,
> 
> On 14/04/2015 12:13, Roger Quadros wrote:
>> Hi Thomas,
>>
>> On 30/03/15 16:15, Roger Quadros wrote:
>>> Without this system suspend is broken on systems that have
>>> drivers calling enable/disable_irq_wake() for interrupts based off
>>> the dummy irq hook.
>>> (e.g. drivers/gpio/gpio-pcf857x.c)
>>>
>>> http://article.gmane.org/gmane.linux.kernel/1879035
>>>
>>> Signed-off-by: Roger Quadros 
>>
>> Any comments on this patch?
> 
> I read the url you pointed and I wonder why, at then end, did
> you choose to add a dummy set_irq_wake() instead of using
> IRQCHIP_SKIP_SET_WAKE ?

You mean like this?

diff --git a/kernel/irq/dummychip.c b/kernel/irq/dummychip.c
index 988dc58..2feb6fe 100644
--- a/kernel/irq/dummychip.c
+++ b/kernel/irq/dummychip.c
@@ -57,5 +57,6 @@ struct irq_chip dummy_irq_chip = {
.irq_ack= noop,
.irq_mask   = noop,
.irq_unmask = noop,
+   .flags  = IRQCHIP_SKIP_SET_WAKE,
 };
 EXPORT_SYMBOL_GPL(dummy_irq_chip);

This works as well and is better. I'll post a v2.

cheers,
-roger

>>
>>> ---
>>>  kernel/irq/dummychip.c | 6 ++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/kernel/irq/dummychip.c b/kernel/irq/dummychip.c
>>> index 988dc58..2405d7a 100644
>>> --- a/kernel/irq/dummychip.c
>>> +++ b/kernel/irq/dummychip.c
>>> @@ -32,6 +32,11 @@ static unsigned int noop_ret(struct irq_data *data)
>>> return 0;
>>>  }
>>>  
>>> +static int noop_int_ret(struct irq_data *data, unsigned int val)
>>> +{
>>> +   return 0;
>>> +}
>>> +
>>>  /*
>>>   * Generic no controller implementation
>>>   */
>>> @@ -57,5 +62,6 @@ struct irq_chip dummy_irq_chip = {
>>> .irq_ack= noop,
>>> .irq_mask   = noop,
>>> .irq_unmask = noop,
>>> +   .irq_set_wake   = noop_int_ret,
>>>  };
>>>  EXPORT_SYMBOL_GPL(dummy_irq_chip);
>>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> 
> 

--
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