Re: adding error handling for the script installing binary

2012-04-23 Thread Akira Tsukamoto

Hi Vishal,

> Thanks for the patch. I have updated the script.

Great! Thank you for including my input.
Akira

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH 1/3] ARM: imx: Add common imx cpuidle init functionality.

2012-04-23 Thread Shawn Guo
On Mon, Apr 23, 2012 at 10:45:02AM -0500, Rob Lee wrote:
> >> Let me try last time.  What about having a late_initcall hook in
> >> machine_desc?
> >
> > Also fine with me.
> >
> 
> Shall I add Shawn's patch to my imx cpuidle patchset or should the
> arch/arm/kernel/setup.c and arch.h changes be submitted separately?
> If separately, Shawn, did you want to submit this patch or should I?
> 
Strange.  Russell is not in the Cc list.  I remember I added Russell
into Cc when I propose the idea.  Added him again.

Rob,

I suggest you have changes on arch/arm/kernel/setup.c and arch.h be
a separate patch, but you can still have it in the series to show why
we need the changes.  Cc Russell when posting the series, and see if
Russell is fine with the patch.  If he is, we can ask his preference
how the patch should go in, submitting it to his patch tracker or we
can have it go though arm-soc along with the series to save the
dependency.

Regards,
Shawn

> >> 8<---
> >>
> >> diff --git a/arch/arm/include/asm/mach/arch.h 
> >> b/arch/arm/include/asm/mach/arch.h
> >> index d7692ca..0b1c94b 100644
> >> --- a/arch/arm/include/asm/mach/arch.h
> >> +++ b/arch/arm/include/asm/mach/arch.h
> >> @@ -43,6 +43,7 @@ struct machine_desc {
> >>         void                    (*init_irq)(void);
> >>         struct sys_timer        *timer;         /* system tick timer    */
> >>         void                    (*init_machine)(void);
> >> +       void                    (*init_late)(void);
> >>  #ifdef CONFIG_MULTI_IRQ_HANDLER
> >>         void                    (*handle_irq)(struct pt_regs *);
> >>  #endif
> >> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> >> index ebfac78..549f036 100644
> >> --- a/arch/arm/kernel/setup.c
> >> +++ b/arch/arm/kernel/setup.c
> >> @@ -800,6 +800,14 @@ static int __init customize_machine(void)
> >>  }
> >>  arch_initcall(customize_machine);
> >>
> >> +static int __init init_machine_late(void)
> >> +{
> >> +       if (machine_desc->init_late)
> >> +               machine_desc->init_late();
> >> +       return 0;
> >> +}
> >> +late_initcall(init_machine_late);
> >> +
> >>  #ifdef CONFIG_KEXEC
> >>  static inline unsigned long long get_total_mem(void)
> >>  {
> >> diff --git a/arch/arm/mach-imx/mach-imx6q.c 
> >> b/arch/arm/mach-imx/mach-imx6q.c
> >> index da6c1d9..0e3640f 100644
> >> --- a/arch/arm/mach-imx/mach-imx6q.c
> >> +++ b/arch/arm/mach-imx/mach-imx6q.c
> >> @@ -142,6 +142,7 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device 
> >> Tree)")
> >>         .handle_irq     = imx6q_handle_irq,
> >>         .timer          = &imx6q_timer,
> >>         .init_machine   = imx6q_init_machine,
> >> +       .init_late      = imx6q_init_late,
> >>         .dt_compat      = imx6q_dt_compat,
> >>         .restart        = imx6q_restart,
> >>  MACHINE_END

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH 02/17][V2] ARM: OMAP4: cpuidle - Declare the states with the driver declaration

2012-04-23 Thread Kevin Hilman
Daniel Lezcano  writes:

> On 04/23/2012 07:08 PM, Kevin Hilman wrote:
>> Daniel Lezcano  writes:
>>
>>> On 04/19/2012 03:58 PM, Daniel Lezcano wrote:
 On 04/10/2012 12:37 AM, Kevin Hilman wrote:
> Daniel Lezcano   writes:
>
>> The cpuidle API allows to declare statically the states in the driver
>> structure. Let's use it.
>> We do no longer need the fill_cstate function called at runtime and
>> by the way adding more instructions at boot time.
>>
>> Signed-off-by: Daniel Lezcano
>> Reviewed-by: Jean Pihet
>> Reviewed-by: Santosh Shilimkar
>> ---
>>arch/arm/mach-omap2/cpuidle44xx.c |   57
>> +---
>>1 files changed, 33 insertions(+), 24 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/cpuidle44xx.c
>> b/arch/arm/mach-omap2/cpuidle44xx.c
>> index ee0bc50..6d86b59 100644
>> --- a/arch/arm/mach-omap2/cpuidle44xx.c
>> +++ b/arch/arm/mach-omap2/cpuidle44xx.c
>> @@ -132,21 +132,39 @@ struct cpuidle_driver omap4_idle_driver = {
>>.name= "omap4_idle",
>>.owner= THIS_MODULE,
>>.en_core_tk_irqen= 1,
>> +.states = {
>> +{
>> +/* C1 - CPU0 ON + CPU1 ON + MPU ON */
>> +.exit_latency = 2 + 2,
>> +.target_residency = 5,
>> +.flags = CPUIDLE_FLAG_TIME_VALID,
>> +.enter = omap4_enter_idle,
>> +.name = "C1",
>> +.desc = "MPUSS ON"
>> +},
>> +{
>> +/* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */
>> +.exit_latency = 328 + 440,
>> +.target_residency = 960,
>> +.flags = CPUIDLE_FLAG_TIME_VALID,
>> +.enter = omap4_enter_idle,
>> +.name = "C2",
>> +.desc = "MPUSS CSWR",
>> +},
>> +{
>> +/* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */
>> +.exit_latency = 460 + 518,
>> +.target_residency = 1100,
>> +.flags = CPUIDLE_FLAG_TIME_VALID,
>> +.enter = omap4_enter_idle,
>> +.name = "C3",
>> +.desc = "MPUSS OSWR",
>> +},
>> +},
>> +.state_count = OMAP4_NUM_STATES,
>
> I think you can drop OMAP4_NUM_STATES here, and just use:
>
>  .state_count = ARRAY_SIZE(omap4_idle_driver.states),
>
> Then drop OMAP4_NUM_STATES all together in patch 3.

 Ok.
>>>
>>> I said 'ok' but it is not :)
>>>
>>> omap4_idle_driver.states has a fixed length which is CPUIDLE_STATE_MAX (8).
>>> We need to define it manually as 3 for now.
>>
>> I don't see the connection between the two.
>>
>> Why can't you use ARRAY_SIZE(), and just have an error check later in
>> the init to see if state_count>  max.
>
>
> Maybe I misunderstood but you say:
>
> .state_count = ARRAY_SIZE(omap4_idle_driver.states),
>
> As in the cpuidle structure, the state array is CPUIDLE_STATE_MAX,
> ARRAY_SIZE will always return 8, not the number of the initialized
> states.

Oh, I see now.

> Anyway, I modified the patchset to use ARRAY_SIZE on the
> omap4_idle_data array, so we have:
>
> .state_count = ARRAY_SIZE(omap4_idle_data),

Great, that should work.

Thanks,

Kevin

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH 02/17][V2] ARM: OMAP4: cpuidle - Declare the states with the driver declaration

2012-04-23 Thread Daniel Lezcano

On 04/23/2012 07:08 PM, Kevin Hilman wrote:

Daniel Lezcano  writes:


On 04/19/2012 03:58 PM, Daniel Lezcano wrote:

On 04/10/2012 12:37 AM, Kevin Hilman wrote:

Daniel Lezcano   writes:


The cpuidle API allows to declare statically the states in the driver
structure. Let's use it.
We do no longer need the fill_cstate function called at runtime and
by the way adding more instructions at boot time.

Signed-off-by: Daniel Lezcano
Reviewed-by: Jean Pihet
Reviewed-by: Santosh Shilimkar
---
   arch/arm/mach-omap2/cpuidle44xx.c |   57
+---
   1 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle44xx.c
b/arch/arm/mach-omap2/cpuidle44xx.c
index ee0bc50..6d86b59 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -132,21 +132,39 @@ struct cpuidle_driver omap4_idle_driver = {
   .name= "omap4_idle",
   .owner= THIS_MODULE,
   .en_core_tk_irqen= 1,
+.states = {
+{
+/* C1 - CPU0 ON + CPU1 ON + MPU ON */
+.exit_latency = 2 + 2,
+.target_residency = 5,
+.flags = CPUIDLE_FLAG_TIME_VALID,
+.enter = omap4_enter_idle,
+.name = "C1",
+.desc = "MPUSS ON"
+},
+{
+/* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */
+.exit_latency = 328 + 440,
+.target_residency = 960,
+.flags = CPUIDLE_FLAG_TIME_VALID,
+.enter = omap4_enter_idle,
+.name = "C2",
+.desc = "MPUSS CSWR",
+},
+{
+/* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */
+.exit_latency = 460 + 518,
+.target_residency = 1100,
+.flags = CPUIDLE_FLAG_TIME_VALID,
+.enter = omap4_enter_idle,
+.name = "C3",
+.desc = "MPUSS OSWR",
+},
+},
+.state_count = OMAP4_NUM_STATES,


I think you can drop OMAP4_NUM_STATES here, and just use:

 .state_count = ARRAY_SIZE(omap4_idle_driver.states),

Then drop OMAP4_NUM_STATES all together in patch 3.


Ok.


I said 'ok' but it is not :)

omap4_idle_driver.states has a fixed length which is CPUIDLE_STATE_MAX (8).
We need to define it manually as 3 for now.


I don't see the connection between the two.

Why can't you use ARRAY_SIZE(), and just have an error check later in
the init to see if state_count>  max.



Maybe I misunderstood but you say:

.state_count = ARRAY_SIZE(omap4_idle_driver.states),

As in the cpuidle structure, the state array is CPUIDLE_STATE_MAX, 
ARRAY_SIZE will always return 8, not the number of the initialized states.


Anyway, I modified the patchset to use ARRAY_SIZE on the omap4_idle_data 
array, so we have:


.state_count = ARRAY_SIZE(omap4_idle_data),

  -- Daniel

--
  Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: adding error handling for the script installing binary

2012-04-23 Thread Vishal Bhoj
Hi Akira,

Thanks for the patch. I have updated the script.

Regards,
Vishal

On 23 April 2012 08:07, Akira Tsukamoto  wrote:

> Hi,
>
> I have reports from some of the Japanese user for the script to
> install binary blob into SD card that it completes even failing
> downloading binary files and being confusing.
>
> I made a quick fix and attached the patch for the panda board.
> The patch prevents executing when it has error downloading binary blob.
>
> The script is:
> install-binaries-4.0.3.sh
>
> I also experienced that "wget" fails to download the file in Japan
> (could be having thin Internet connection to the URL)
> but the current script continues executing and finishes it without
> any message without the file being downloaded successfully from
> the url.
>
> Ideally we should have md5 checksum for the downloaded file
> but I think it could be considered in the future.
>
> Regards,
>
> Akira
> --**
> --- 
> panda-ics-gcc46-tilt-tracking-**blob-234/install-binaries-4.0.**3.sh
>2012-04-18 19:52:33.0 +0900
> +++ panda-ics-gcc46-tilt-tracking-**blob-12.03-release-6/install-**
> binaries-4.0.3.sh 2012-04-23
> 11:27:43.0 +0900
> @@ -1,14 +1,23 @@
> -#!/bin/bash -x
> +#!/bin/bash
> +
> +DL_URL='https://dl.google.**com/dl/android/aosp/imgtec-**
> panda-iml74k-cfb7bdad.tgz
> '
> +
> +err_handle() {
> +  echo "Error, please try again"
> +  exit 1
> +}
> +
> +trap 'err_handle' ERR
>
>  if [[ -z "$1"  ]]; then
> -echo "usage: install-binaries.sh "
> -exit -1
> +  echo "usage: install-binaries.sh "
> +  exit -1
>  fi
>
>
>  mkdir -p /tmp/binaries
>  cd /tmp/binaries/
> -wget --no-check-certificate https://dl.google.com/dl/**
> android/aosp/imgtec-panda-**iml74k-cfb7bdad.tgz
> +wget --no-check-certificate $DL_URL
>  tar -zxvf imgtec-panda-iml74k-cfb7bdad.**tgz
>  sh extract-imgtec-panda.sh
>  sudo mount $1 /mnt/
> @@ -33,3 +42,4 @@ sudo chmod -R 755 /mnt/vendor/lib/
>  sudo umount -f $1
>  cd -
>  sudo rm -r /tmp/binaries
> +echo "Sucess, installing binary files"
>
> ___
> linaro-dev mailing list
> linaro-dev@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-dev
>
>
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH 02/17][V2] ARM: OMAP4: cpuidle - Declare the states with the driver declaration

2012-04-23 Thread Kevin Hilman
Daniel Lezcano  writes:

> On 04/19/2012 03:58 PM, Daniel Lezcano wrote:
>> On 04/10/2012 12:37 AM, Kevin Hilman wrote:
>>> Daniel Lezcano  writes:
>>>
 The cpuidle API allows to declare statically the states in the driver
 structure. Let's use it.
 We do no longer need the fill_cstate function called at runtime and
 by the way adding more instructions at boot time.

 Signed-off-by: Daniel Lezcano
 Reviewed-by: Jean Pihet
 Reviewed-by: Santosh Shilimkar
 ---
   arch/arm/mach-omap2/cpuidle44xx.c |   57
 +---
   1 files changed, 33 insertions(+), 24 deletions(-)

 diff --git a/arch/arm/mach-omap2/cpuidle44xx.c
 b/arch/arm/mach-omap2/cpuidle44xx.c
 index ee0bc50..6d86b59 100644
 --- a/arch/arm/mach-omap2/cpuidle44xx.c
 +++ b/arch/arm/mach-omap2/cpuidle44xx.c
 @@ -132,21 +132,39 @@ struct cpuidle_driver omap4_idle_driver = {
   .name= "omap4_idle",
   .owner= THIS_MODULE,
   .en_core_tk_irqen= 1,
 +.states = {
 +{
 +/* C1 - CPU0 ON + CPU1 ON + MPU ON */
 +.exit_latency = 2 + 2,
 +.target_residency = 5,
 +.flags = CPUIDLE_FLAG_TIME_VALID,
 +.enter = omap4_enter_idle,
 +.name = "C1",
 +.desc = "MPUSS ON"
 +},
 +{
 +/* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */
 +.exit_latency = 328 + 440,
 +.target_residency = 960,
 +.flags = CPUIDLE_FLAG_TIME_VALID,
 +.enter = omap4_enter_idle,
 +.name = "C2",
 +.desc = "MPUSS CSWR",
 +},
 +{
 +/* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */
 +.exit_latency = 460 + 518,
 +.target_residency = 1100,
 +.flags = CPUIDLE_FLAG_TIME_VALID,
 +.enter = omap4_enter_idle,
 +.name = "C3",
 +.desc = "MPUSS OSWR",
 +},
 +},
 +.state_count = OMAP4_NUM_STATES,
>>>
>>> I think you can drop OMAP4_NUM_STATES here, and just use:
>>>
>>> .state_count = ARRAY_SIZE(omap4_idle_driver.states),
>>>
>>> Then drop OMAP4_NUM_STATES all together in patch 3.
>>
>> Ok.
>
> I said 'ok' but it is not :)
>
> omap4_idle_driver.states has a fixed length which is CPUIDLE_STATE_MAX (8).
> We need to define it manually as 3 for now.

I don't see the connection between the two.

Why can't you use ARRAY_SIZE(), and just have an error check later in
the init to see if state_count > max.

Kevin

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: No group tracks at Connect

2012-04-23 Thread David Rusling
All,
thank you for a lively discussion.I think that there's some very 
good ideas floating about.   It's clear that we all care passionately about 
make Linaro Connect as good as it can possibly be.   Some comments:

[1] What is the problem that we're trying to solve?   It is, in my view, is 
trying to ensure that everyone important to each discussion is able to be there 
so that the right decisions take place
I saw some clashes at the last event where meetings were empty or moved so that 
the right people were there.   I think that this was because we didn't look 
across the booking 'silos' before the week itself
Linux kernel intersects most of our problem areas and that makes the kernel 
experts a scarce resource and a critical path on scheduling

[2] It's a slice and dice problem with most things being group based.
I don't think that each WG needs to stay together for the morning (technical) 
sessions, but they do for the afternoon hacking sessions (mostly)
Zach's point about avoiding silos is a good one

[3] We give the mandate to solve 'heavy lifting' problems to particular groups
The graphics WG is the right 'center of gravity' for UMM, for example
but the overlap between groups can be quite large (especially platforms which 
is where the technologies come together)

[4] Kiko's suggestion was to group the sessions by topic (big.LITTLE) and area 
(architecture) and Zach's suggestion was to have topic champion (continuous 
integration).Practically, some of this is already happening, for example 
with Amit pulling together all the big.LITTLE sessions (switcher and MP).

Here's my suggestion:

[1] Take Kiko's 'table' as the basis and transcribe it into the Connect 
planning spreadsheets maintained by Arwen etc.   That gives us {topic, area, 
contents}
[2] Nominate and agree champions / engineering teams to own each topic (add two 
columns {champion, team}.   The champions could be the TL, they could be 
nominated by them, they don't have to work in the team that 'owns' the topic.
[3] Have the champions own creating the sessions and ensuring that the right 
people (key decision makers) are signed up.   In effect, one of their roles is 
to work across silos.

Let's leave aside how the summit tool could show a schedule by topic or whether 
we'd have 'topic leader' shirts made for now.

I'm happy to own [1] and support [2] and [3].

Makes sense?

Dave


David Rusling, CTO

Linaro
Lockton House
Clarendon Rd
Cambridge
CB2 8FH
 
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
 






___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH 1/3] ARM: imx: Add common imx cpuidle init functionality.

2012-04-23 Thread Rob Lee
>> Let me try last time.  What about having a late_initcall hook in
>> machine_desc?
>
> Also fine with me.
>

Shall I add Shawn's patch to my imx cpuidle patchset or should the
arch/arm/kernel/setup.c and arch.h changes be submitted separately?
If separately, Shawn, did you want to submit this patch or should I?

Thanks,
Rob

>>
>> Regards,
>> Shawn
>>
>> 8<---
>>
>> diff --git a/arch/arm/include/asm/mach/arch.h 
>> b/arch/arm/include/asm/mach/arch.h
>> index d7692ca..0b1c94b 100644
>> --- a/arch/arm/include/asm/mach/arch.h
>> +++ b/arch/arm/include/asm/mach/arch.h
>> @@ -43,6 +43,7 @@ struct machine_desc {
>>         void                    (*init_irq)(void);
>>         struct sys_timer        *timer;         /* system tick timer    */
>>         void                    (*init_machine)(void);
>> +       void                    (*init_late)(void);
>>  #ifdef CONFIG_MULTI_IRQ_HANDLER
>>         void                    (*handle_irq)(struct pt_regs *);
>>  #endif
>> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
>> index ebfac78..549f036 100644
>> --- a/arch/arm/kernel/setup.c
>> +++ b/arch/arm/kernel/setup.c
>> @@ -800,6 +800,14 @@ static int __init customize_machine(void)
>>  }
>>  arch_initcall(customize_machine);
>>
>> +static int __init init_machine_late(void)
>> +{
>> +       if (machine_desc->init_late)
>> +               machine_desc->init_late();
>> +       return 0;
>> +}
>> +late_initcall(init_machine_late);
>> +
>>  #ifdef CONFIG_KEXEC
>>  static inline unsigned long long get_total_mem(void)
>>  {
>> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
>> index da6c1d9..0e3640f 100644
>> --- a/arch/arm/mach-imx/mach-imx6q.c
>> +++ b/arch/arm/mach-imx/mach-imx6q.c
>> @@ -142,6 +142,7 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device 
>> Tree)")
>>         .handle_irq     = imx6q_handle_irq,
>>         .timer          = &imx6q_timer,
>>         .init_machine   = imx6q_init_machine,
>> +       .init_late      = imx6q_init_late,
>>         .dt_compat      = imx6q_dt_compat,
>>         .restart        = imx6q_restart,
>>  MACHINE_END
>>
>> ___
>> linux-arm-kernel mailing list
>> linux-arm-ker...@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
>
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917- |

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH 02/17][V2] ARM: OMAP4: cpuidle - Declare the states with the driver declaration

2012-04-23 Thread Daniel Lezcano

On 04/19/2012 03:58 PM, Daniel Lezcano wrote:

On 04/10/2012 12:37 AM, Kevin Hilman wrote:

Daniel Lezcano  writes:


The cpuidle API allows to declare statically the states in the driver
structure. Let's use it.
We do no longer need the fill_cstate function called at runtime and
by the way adding more instructions at boot time.

Signed-off-by: Daniel Lezcano
Reviewed-by: Jean Pihet
Reviewed-by: Santosh Shilimkar
---
  arch/arm/mach-omap2/cpuidle44xx.c |   57 
+---

  1 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle44xx.c 
b/arch/arm/mach-omap2/cpuidle44xx.c

index ee0bc50..6d86b59 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -132,21 +132,39 @@ struct cpuidle_driver omap4_idle_driver = {
  .name= "omap4_idle",
  .owner= THIS_MODULE,
  .en_core_tk_irqen= 1,
+.states = {
+{
+/* C1 - CPU0 ON + CPU1 ON + MPU ON */
+.exit_latency = 2 + 2,
+.target_residency = 5,
+.flags = CPUIDLE_FLAG_TIME_VALID,
+.enter = omap4_enter_idle,
+.name = "C1",
+.desc = "MPUSS ON"
+},
+{
+/* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */
+.exit_latency = 328 + 440,
+.target_residency = 960,
+.flags = CPUIDLE_FLAG_TIME_VALID,
+.enter = omap4_enter_idle,
+.name = "C2",
+.desc = "MPUSS CSWR",
+},
+{
+/* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */
+.exit_latency = 460 + 518,
+.target_residency = 1100,
+.flags = CPUIDLE_FLAG_TIME_VALID,
+.enter = omap4_enter_idle,
+.name = "C3",
+.desc = "MPUSS OSWR",
+},
+},
+.state_count = OMAP4_NUM_STATES,


I think you can drop OMAP4_NUM_STATES here, and just use:

.state_count = ARRAY_SIZE(omap4_idle_driver.states),

Then drop OMAP4_NUM_STATES all together in patch 3.


Ok.


I said 'ok' but it is not :)

omap4_idle_driver.states has a fixed length which is CPUIDLE_STATE_MAX (8).
We need to define it manually as 3 for now.


--
   Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  Facebook |
  Twitter |
  Blog



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] ARM: ux500: add the cpuidle driver for WFI and ARM retention

2012-04-23 Thread Daniel Lezcano

On 04/23/2012 09:57 AM, Rickard Andersson wrote:

Should not the driver be located in the 'drivers/cpuidle/' directory?


We had a discussion about moving the cpuidle drivers to this directory 
but there are too much dependencies between the arch specific code and 
the drivers and Russell thinks there is no real benefit of moving these 
drivers out arch/arm.


http://www.spinics.net/lists/arm-kernel/msg155454.html

The discussion is at91 specific but as this work was part of moving the 
drivers to the 'drivers' directory in general. I assumed the same rule 
applied to the ux500 cpuidle driver.


The current driver has the WFI and the ApIdle states and could be moved 
to drivers directory without complicating the dependencies but that 
won't be consistent with the rest of the drivers location (not only ARM) 
and I am not sure that will be still the case with the next states 
'ApSleep' and 'ApDeepSleep'.


IMO we should put this driver in arch/arm/mach-ux500, and, in the 
future, if we are able to move all the SoC cpuidle drivers to the 
'drivers' directory then this driver will be moved too.


Thanks
  -- Daniel

--
  Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: won't someone please think of the users!?

2012-04-23 Thread Vladimir Pantelic

Clark, Rob wrote:


Also, I wonder if we should split #linaro, either into #linaro-devel
and leave #linaro as a place that users can come to for help, or setup
a separate #linaro-users?  This way we aren't just dumping out new
releases with nowhere for users to turn to for help..  (Well, they can
always come to #linaro but I guess this would help with the
signal-to-noise..)


Think twice before setting up something like #linaro-users, unless you
are willing to staff it and really help users there. Just having another
"idle mostly" ghost town on IRC does not help much.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: won't someone please think of the users!?

2012-04-23 Thread Vladimir Pantelic

Clark, Rob wrote:

just some random thoughts on our release model, etc..  I've been
meaning to write up for a while but haven't had time


[+1] :)

Actually, the issue isn't as much with Ubuntu as with Android.

For Ubuntu, I have stopped pointing people at Linaro and always
advise them to use official Ubuntu releases because there they
at least stand a chance of getting some kind of support -
although they often return from #ubuntu-arm saying that
nobody would/could help them there...
And don't get me wrong, I absolutely do not expect Linaro
to provide Ubuntu support, I would actually prefer if Linaro
Ubuntu builds were much more less visible to end users :)

For Android on e.g. Pandaboard, there simply is not much else
than Linaro to point people to. The original TI Pandroid effort
was scrapped when TI found that it is too much work to support
a user centric Android release and now TI as well points to Linaro.
The only other place one could point people to is plain AOSP,
but that lacks stuff like HW accell and isn't the focus of
Google any more as far as panda is concerned.

So Linaro is the only viable solution there, but as with
Ubuntu, there is no end-customer support and the monthly
releases make it a moving target. Again, I do not blame
Linaro for the lack of support, it is simply a fact that
"Android as a distribution" is way less supported than
others, especially on less mainstream platforms.
Having e.g. Cyanogenmod on Panda would surely help a lot,
but I guess there is no critical mass for that and dev boards
like Panda and others are in a way moving targets themselves...

So I guess the only thing that can be done short-term
is to state very clearly what Linaro builds are and what they
are not and to discourage the average user from going down
that road unless they know what they are doing (which will fail
as well since users like car drivers all think they are above
average..)

Regards,

Vladimir

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] ARM: ux500: add the cpuidle driver for WFI and ARM retention

2012-04-23 Thread Rickard Andersson

Should not the driver be located in the 'drivers/cpuidle/' directory?

BR
Rickard

This patch adds the cpuidle driver for the ux500 SoC.
The boards saves 12mA with these states. It is based on the latest
cpuidle consolidation from Robert Lee.

The cpu can go to retention only if the other core is in WFI.

If the other cpu is in WFI and we decoupled the gic from the cores,
then we have the guarantee, it won't be wake up.

It is up to the prcmu firmware to recouple the gic automatically
after the power state mode is selected.

Signed-off-by: Daniel Lezcano
---
  arch/arm/mach-ux500/Makefile  |1 +
  arch/arm/mach-ux500/cpuidle.c |  171 +
  2 files changed, 172 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/mach-ux500/cpuidle.c

diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index fc7db5d..3b86b61 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -4,6 +4,7 @@

  obj-y := clock.o cpu.o devices.o devices-common.o \
   id.o usb.o timer.o
+obj-$(CONFIG_CPU_IDLE)  += cpuidle.o
  obj-$(CONFIG_CACHE_L2X0)  += cache-l2x0.o
  obj-$(CONFIG_UX500_SOC_DB8500)+= cpu-db8500.o devices-db8500.o
  obj-$(CONFIG_MACH_MOP500) += board-mop500.o board-mop500-sdi.o \
diff --git a/arch/arm/mach-ux500/cpuidle.c b/arch/arm/mach-ux500/cpuidle.c
new file mode 100644
index 000..b54884bd
--- /dev/null
+++ b/arch/arm/mach-ux500/cpuidle.c
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2012 Linaro : Daniel Lezcano  (IBM)
+ *
+ * Based on the work of Rickard Andersson
+ * and Jonas Aaberg.
+ *
+ * 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.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+static atomic_t master = ATOMIC_INIT(0);
+static DEFINE_SPINLOCK(master_lock);
+static DEFINE_PER_CPU(struct cpuidle_device, ux500_cpuidle_device);
+
+static inline int ux500_enter_idle(struct cpuidle_device *dev,
+  struct cpuidle_driver *drv, int index)
+{
+   int this_cpu = smp_processor_id();
+   bool recouple = false;
+
+   clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER,&this_cpu);
+
+   if (atomic_inc_return(&master) == num_online_cpus()) {
+
+   /* With this lock, we prevent the other cpu to exit and enter
+* this function again and become the master */
+   if (!spin_trylock(&master_lock))
+   goto wfi;
+
+   /* decouple the gic from the A9 cores */
+   if (prcmu_gic_decouple())
+   goto out;
+
+   /* If an error occur, we will have to recouple the gic
+* manually */
+   recouple = true;
+
+   /* At this state, as the gic is decoupled, if the other
+* cpu is in WFI, we have the guarantee it won't be wake
+* up, so we can safely go to retention */
+   if (!prcmu_is_cpu_in_wfi(this_cpu ? 0 : 1))
+   goto out;
+
+   /* The prcmu will be in charge of watching the interrupts
+* and wake up the cpus */
+   if (prcmu_copy_gic_settings())
+   goto out;
+
+   /* Check in the meantime an interrupt did
+* not occur on the gic ... */
+   if (prcmu_gic_pending_irq())
+   goto out;
+
+   /* ... and the prcmu */
+   if (prcmu_pending_irq())
+   goto out;
+
+   /* Go to the retention state, the prcmu will wait for the
+* cpu to go WFI and this is what happens after exiting this
+* 'master' critical section */
+   if (prcmu_set_power_state(PRCMU_AP_IDLE, true, true))
+   goto out;
+
+   /* When we switch to retention, the prcmu is in charge
+* of recoupling the gic automatically */
+   recouple = false;
+
+   spin_unlock(&master_lock);
+   }
+wfi:
+   cpu_do_idle();
+out:
+   atomic_dec(&master);
+
+   if (recouple) {
+   prcmu_gic_recouple();
+   spin_unlock(&master_lock);
+   }
+
+   clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT,&this_cpu);
+
+   return index;
+}
+
+static struct cpuidle_driver ux500_idle_driver = {
+   .name = "ux500_idle",
+   .owner = THIS_MODULE,
+   .en_core_tk_irqen = 1,
+   .states = {
+   ARM_CPUIDLE_WFI_STATE,
+   {
+   .enter= ux500_enter_idle,
+   .exit_latency = 70,
+   .target_residency = 260,
+   .flags

Re: [PATCH] ARM: ux500: add the cpuidle driver for WFI and ARM retention

2012-04-23 Thread Vincent Guittot
Hi Daniel,

You can add my Ack on your patch

Vincent

On 19 April 2012 14:46, Daniel Lezcano  wrote:
> This patch adds the cpuidle driver for the ux500 SoC.
> The boards saves 12mA with these states. It is based on the latest
> cpuidle consolidation from Robert Lee.
>
> The cpu can go to retention only if the other core is in WFI.
>
> If the other cpu is in WFI and we decoupled the gic from the cores,
> then we have the guarantee, it won't be wake up.
>
> It is up to the prcmu firmware to recouple the gic automatically
> after the power state mode is selected.
>
> Signed-off-by: Daniel Lezcano 
> ---
>  arch/arm/mach-ux500/Makefile  |    1 +
>  arch/arm/mach-ux500/cpuidle.c |  171 
> +
>  2 files changed, 172 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-ux500/cpuidle.c
>
> diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
> index fc7db5d..3b86b61 100644
> --- a/arch/arm/mach-ux500/Makefile
> +++ b/arch/arm/mach-ux500/Makefile
> @@ -4,6 +4,7 @@
>
>  obj-y                          := clock.o cpu.o devices.o devices-common.o \
>                                   id.o usb.o timer.o
> +obj-$(CONFIG_CPU_IDLE)          += cpuidle.o
>  obj-$(CONFIG_CACHE_L2X0)       += cache-l2x0.o
>  obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o
>  obj-$(CONFIG_MACH_MOP500)      += board-mop500.o board-mop500-sdi.o \
> diff --git a/arch/arm/mach-ux500/cpuidle.c b/arch/arm/mach-ux500/cpuidle.c
> new file mode 100644
> index 000..b54884bd
> --- /dev/null
> +++ b/arch/arm/mach-ux500/cpuidle.c
> @@ -0,0 +1,171 @@
> +/*
> + * Copyright (c) 2012 Linaro : Daniel Lezcano  
> (IBM)
> + *
> + * Based on the work of Rickard Andersson 
> + * and Jonas Aaberg .
> + *
> + * 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.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +static atomic_t master = ATOMIC_INIT(0);
> +static DEFINE_SPINLOCK(master_lock);
> +static DEFINE_PER_CPU(struct cpuidle_device, ux500_cpuidle_device);
> +
> +static inline int ux500_enter_idle(struct cpuidle_device *dev,
> +                                  struct cpuidle_driver *drv, int index)
> +{
> +       int this_cpu = smp_processor_id();
> +       bool recouple = false;
> +
> +       clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &this_cpu);
> +
> +       if (atomic_inc_return(&master) == num_online_cpus()) {
> +
> +               /* With this lock, we prevent the other cpu to exit and enter
> +                * this function again and become the master */
> +               if (!spin_trylock(&master_lock))
> +                       goto wfi;
> +
> +               /* decouple the gic from the A9 cores */
> +               if (prcmu_gic_decouple())
> +                       goto out;
> +
> +               /* If an error occur, we will have to recouple the gic
> +                * manually */
> +               recouple = true;
> +
> +               /* At this state, as the gic is decoupled, if the other
> +                * cpu is in WFI, we have the guarantee it won't be wake
> +                * up, so we can safely go to retention */
> +               if (!prcmu_is_cpu_in_wfi(this_cpu ? 0 : 1))
> +                       goto out;
> +
> +               /* The prcmu will be in charge of watching the interrupts
> +                * and wake up the cpus */
> +               if (prcmu_copy_gic_settings())
> +                       goto out;
> +
> +               /* Check in the meantime an interrupt did
> +                * not occur on the gic ... */
> +               if (prcmu_gic_pending_irq())
> +                       goto out;
> +
> +               /* ... and the prcmu */
> +               if (prcmu_pending_irq())
> +                       goto out;
> +
> +               /* Go to the retention state, the prcmu will wait for the
> +                * cpu to go WFI and this is what happens after exiting this
> +                * 'master' critical section */
> +               if (prcmu_set_power_state(PRCMU_AP_IDLE, true, true))
> +                       goto out;
> +
> +               /* When we switch to retention, the prcmu is in charge
> +                * of recoupling the gic automatically */
> +               recouple = false;
> +
> +               spin_unlock(&master_lock);
> +       }
> +wfi:
> +       cpu_do_idle();
> +out:
> +       atomic_dec(&master);
> +
> +       if (recouple) {
> +               prcmu_gic_recouple();
> +               spin_unlock(&master_lock);
> +       }
> +
> +       clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &this_cpu);
> +
> +       return index;
> +}
> +
> +static struct cpuidle_driver ux500_idle_driver = {
> +       .name = "ux500_idle",
> +       .owner = THIS_MODULE,
> +       .en_core

Re: [PATCH 1/3] ARM: imx: Add common imx cpuidle init functionality.

2012-04-23 Thread Sascha Hauer
On Mon, Apr 23, 2012 at 03:10:15PM +0800, Shawn Guo wrote:
> On Mon, Apr 23, 2012 at 08:56:23AM +0200, Sascha Hauer wrote:
> > On Mon, Apr 23, 2012 at 02:53:01PM +0800, Shawn Guo wrote:
> > > On Mon, Apr 23, 2012 at 08:27:39AM +0200, Sascha Hauer wrote:
> > > > On Mon, Apr 23, 2012 at 01:18:21PM +0800, Shawn Guo wrote:
> > > > > On Sun, Apr 22, 2012 at 11:44:39PM -0500, Rob Lee wrote:
> ...
> > > > i.MX6 SoC. We could directly ask the devicetree in an initcall or we
> > > > could introduce a cpu_is_mx6() just like we have a macro for all other
> > > > i.MX SoCs.
> > > > 
> > > Oops, my reply was a brain-dead one.  Hmm, then it seems that we have
> > > to introduce cpu_is_mx6() which I tried hard to avoid.  I do not have
> > > a preference between defining a macro and asking device tree.
> > 
> > Since we already have a place in early setup code in which we know that
> > we are running on an i.MX6 I suggest for the sake of the symmetry of the
> > universe that we introduce a cpu_is_mx6.
> > 
> Let me try last time.  What about having a late_initcall hook in
> machine_desc?

Also fine with me.

> 
> Regards,
> Shawn
> 
> 8<---
> 
> diff --git a/arch/arm/include/asm/mach/arch.h 
> b/arch/arm/include/asm/mach/arch.h
> index d7692ca..0b1c94b 100644
> --- a/arch/arm/include/asm/mach/arch.h
> +++ b/arch/arm/include/asm/mach/arch.h
> @@ -43,6 +43,7 @@ struct machine_desc {
> void(*init_irq)(void);
> struct sys_timer*timer; /* system tick timer*/
> void(*init_machine)(void);
> +   void(*init_late)(void);
>  #ifdef CONFIG_MULTI_IRQ_HANDLER
> void(*handle_irq)(struct pt_regs *);
>  #endif
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index ebfac78..549f036 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -800,6 +800,14 @@ static int __init customize_machine(void)
>  }
>  arch_initcall(customize_machine);
> 
> +static int __init init_machine_late(void)
> +{
> +   if (machine_desc->init_late)
> +   machine_desc->init_late();
> +   return 0;
> +}
> +late_initcall(init_machine_late);
> +
>  #ifdef CONFIG_KEXEC
>  static inline unsigned long long get_total_mem(void)
>  {
> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> index da6c1d9..0e3640f 100644
> --- a/arch/arm/mach-imx/mach-imx6q.c
> +++ b/arch/arm/mach-imx/mach-imx6q.c
> @@ -142,6 +142,7 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device 
> Tree)")
> .handle_irq = imx6q_handle_irq,
> .timer  = &imx6q_timer,
> .init_machine   = imx6q_init_machine,
> +   .init_late  = imx6q_init_late,
> .dt_compat  = imx6q_dt_compat,
> .restart= imx6q_restart,
>  MACHINE_END
> 
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH 1/2] mfd: Add Freescale's PMIC MC34708 support

2012-04-23 Thread Marc Reilly
Hi,

> From: "Ying-Chun Liu (PaulLiu)" 
> 
> Freescale MC34708 is a PMIC which supports the following features:
>  * 6 multi-mode buck regulators
>  * Boost regulator for USB OTG.
>  * 8 regulators for thermal budget optimization
>  * 10-bit ADC
>  * Real time clock
> 
> Signed-off-by: Robin Gong 
> Signed-off-by: Ying-Chun Liu (PaulLiu) 
> Cc: Samuel Ortiz 
> Cc: Mark Brown 
> Cc: Shawn Guo 
> ---
>  Documentation/devicetree/bindings/mfd/mc34708.txt |   61 ++
>  drivers/mfd/Kconfig   |   11 +
>  drivers/mfd/Makefile  |1 +
>  drivers/mfd/mc34708-core.c|  634
> + include/linux/mfd/mc34708.h   | 
> 134 +
>  5 files changed, 841 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/mc34708.txt
>  create mode 100644 drivers/mfd/mc34708-core.c
>  create mode 100644 include/linux/mfd/mc34708.h


Why not add the MC34708 to the existing mc13xxx driver? (apart from the 
obvious 13/34)

I haven't looked at the 34708 in detail but this code looks remarkably 
similar. It seems unnecessary to duplicate all of this ...

Aside from that, I'd look at using regmap, as Mark Brown suggested. You can 
look for my patches for the mc13xxx for an example.

Cheers,
Marc



> 
> diff --git a/Documentation/devicetree/bindings/mfd/mc34708.txt
> b/Documentation/devicetree/bindings/mfd/mc34708.txt new file mode 100644
> index 000..2bb5c9e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/mc34708.txt
> @@ -0,0 +1,61 @@
> +* Freescale MC34708 Power Management Integrated Circuit (PMIC)
> +
> +Required properties:
> +- compatible : Must be "fsl,mc34708"
> +
> +Optional properties:
> +- fsl,mc34708-uses-adc   : Indicate the ADC is being used
> +- fsl,mc34708-uses-rtc   : Indicate the RTC is being used
> +- fsl,mc34708-uses-ts: Indicate the touchscreen controller is being
> used +
> +Sub-nodes:
> +- regulators : Contain the regulator nodes.  The MC34708 regulators are
> +  bound using their names as listed below for enabling.
> +
> +mc34708__sw1a: regulator SW1A
> +mc34708__sw1b: regulator SW1B
> +mc34708__sw2 : regulator SW2
> +mc34708__sw3 : regulator SW3
> +mc34708__sw4A: regulator SW4A
> +mc34708__sw4b: regulator SW4B
> +mc34708__swbst   : regulator SWBST
> +mc34708__vpll: regulator VPLL
> +mc34708__vrefddr : regulator VREFDDR
> +mc34708__vusb: regulator VUSB
> +mc34708__vusb2   : regulator VUSB2
> +mc34708__vdac: regulator VDAC
> +mc34708__vgen1   : regulator VGEN1
> +mc34708__vgen2   : regulator VGEN2
> +
> +  The bindings details of individual regulator device can be found in:
> +  Documentation/devicetree/bindings/regulator/regulator.txt
> +
> +Examples:
> +
> +i2c@63fc8000 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + compatible = "fsl,imx53-i2c", "fsl,imx1-i2c";
> + reg = <0x63fc8000 0x4000>;
> + interrupts = <62>;
> + status = "okay";
> +
> + pmic: mc34708@8 {
> + compatible = "fsl,mc34708";
> + reg = <0x08>;
> +
> + regulators {
> + mc34708__sw1a {
> + regulator-min-microvolt = <65>;
> + regulator-max-microvolt = <1437500>;
> + regulator-boot-on;
> + regulator-always-on;
> + };
> +
> + mc34708__vusb {
> + regulator-boot-on;
> + regulator-always-on;
> + };
> + };
> + };
> +};
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 29f463c..17b6cc5 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -600,6 +600,17 @@ config MFD_MC13XXX
> additional drivers must be enabled in order to use the
> functionality of the device.
> 
> +config MFD_MC34708
> + tristate "Support for Freescale's PMIC MC34708"
> + depends on I2C
> + depends on OF
> + select MFD_CORE
> + help
> +   Support for the Freescale's PMIC MC34708
> +   This driver provides common support for accessing the device,
> +   additional drivers must be enabled in order to use the
> +   functionality of the device.
> +
>  config ABX500_CORE
>   bool "ST-Ericsson ABX500 Mixed Signal Circuit register functions"
>   default y if ARCH_U300 || ARCH_U8500
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 05fa538..b98d943 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -54,6 +54,7 @@ obj-$(CONFIG_TWL6030_PWM)   += twl6030-pwm.o
>  obj-$(CONFIG_TWL6040_CORE)   += twl6040-core.o twl6040-irq.o
> 
>  obj-$(CONFIG_MFD_MC13XXX)+= mc13xxx-core.o
> +obj-$(CONFIG_MFD_MC34708)   += mc34708-core.o
> 
>  obj-$(CONFIG_MFD_CORE)   += mfd-core.o
> 
> diff --git a/driv

Re: [PATCH 1/3] ARM: imx: Add common imx cpuidle init functionality.

2012-04-23 Thread Shawn Guo
On Mon, Apr 23, 2012 at 08:56:23AM +0200, Sascha Hauer wrote:
> On Mon, Apr 23, 2012 at 02:53:01PM +0800, Shawn Guo wrote:
> > On Mon, Apr 23, 2012 at 08:27:39AM +0200, Sascha Hauer wrote:
> > > On Mon, Apr 23, 2012 at 01:18:21PM +0800, Shawn Guo wrote:
> > > > On Sun, Apr 22, 2012 at 11:44:39PM -0500, Rob Lee wrote:
...
> > > > > Since device_initcall isn't platform specific, it seems I would still
> > > > > need a cpu_is_imx6q() function or similiar functionality from a device
> > > > > tree call.  Or do you have something else in mind that I'm not seeing?
> > > > > 
> > > > I guess Sascha is asking for something like the following.
> > > > 
> > > > static int __init imx_device_init(void)
> > > > {
> > > > imx5_device_init();
> > > > imx6_device_init();
> > > > }
> > > > device_initcall(imx_device_init)
> > > > 
> > > > static int __init imx6_device_init(void)
> > > > {
> > > > /*
> > > >  * do whatever needs to get done in device_initcall time
> > > >  */
> > > > }
> > > 
> > > The problem is more how we can detect that we are actually running a
> > > i.MX6 SoC. We could directly ask the devicetree in an initcall or we
> > > could introduce a cpu_is_mx6() just like we have a macro for all other
> > > i.MX SoCs.
> > > 
> > Oops, my reply was a brain-dead one.  Hmm, then it seems that we have
> > to introduce cpu_is_mx6() which I tried hard to avoid.  I do not have
> > a preference between defining a macro and asking device tree.
> 
> Since we already have a place in early setup code in which we know that
> we are running on an i.MX6 I suggest for the sake of the symmetry of the
> universe that we introduce a cpu_is_mx6.
> 
Let me try last time.  What about having a late_initcall hook in
machine_desc?

Regards,
Shawn

8<---

diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index d7692ca..0b1c94b 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -43,6 +43,7 @@ struct machine_desc {
void(*init_irq)(void);
struct sys_timer*timer; /* system tick timer*/
void(*init_machine)(void);
+   void(*init_late)(void);
 #ifdef CONFIG_MULTI_IRQ_HANDLER
void(*handle_irq)(struct pt_regs *);
 #endif
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index ebfac78..549f036 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -800,6 +800,14 @@ static int __init customize_machine(void)
 }
 arch_initcall(customize_machine);

+static int __init init_machine_late(void)
+{
+   if (machine_desc->init_late)
+   machine_desc->init_late();
+   return 0;
+}
+late_initcall(init_machine_late);
+
 #ifdef CONFIG_KEXEC
 static inline unsigned long long get_total_mem(void)
 {
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index da6c1d9..0e3640f 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -142,6 +142,7 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device 
Tree)")
.handle_irq = imx6q_handle_irq,
.timer  = &imx6q_timer,
.init_machine   = imx6q_init_machine,
+   .init_late  = imx6q_init_late,
.dt_compat  = imx6q_dt_compat,
.restart= imx6q_restart,
 MACHINE_END

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev