RE: [PATCH 1/4] thermal: Add a new trip type to use cooling device instance number

2012-02-23 Thread R, Durgadoss
Hi Amit,

> -Original Message-
> From: amit kachhap [mailto:amitdani...@gmail.com] On Behalf Of Amit Daniel
> Kachhap
> Sent: Wednesday, February 22, 2012 3:44 PM
> To: linux...@lists.linux-foundation.org
> Cc: linux-ker...@vger.kernel.org; mj...@srcf.ucam.org; linux-
> a...@vger.kernel.org; l...@kernel.org; linaro-dev@lists.linaro.org;
> amit.kach...@linaro.org; R, Durgadoss; rob@linaro.org; patc...@linaro.org
> Subject: [PATCH 1/4] thermal: Add a new trip type to use cooling device
> instance number
> 
> This patch adds a new trip type THERMAL_TRIP_STATE_ACTIVE. This
> trip behaves same as THERMAL_TRIP_ACTIVE but also passes the cooling
> device instance number. This helps the cooling device registered as
> different instances to perform appropriate cooling action decision in
> the set_cur_state call back function.
> 
> Also since the trip temperature's are in ascending order so some logic
> is put in place to skip the un-necessary checks.
> 
> Signed-off-by: Amit Daniel Kachhap 
> ---
>  Documentation/thermal/sysfs-api.txt |4 +-
>  drivers/thermal/thermal_sys.c   |   45 --
>  include/linux/thermal.h |1 +
>  3 files changed, 45 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/thermal/sysfs-api.txt 
> b/Documentation/thermal/sysfs-
> api.txt
> index 1733ab9..7a0c080 100644
> --- a/Documentation/thermal/sysfs-api.txt
> +++ b/Documentation/thermal/sysfs-api.txt
> @@ -184,8 +184,8 @@ trip_point_[0-*]_temp
> 
>  trip_point_[0-*]_type
>   Strings which indicate the type of the trip point.
> - E.g. it can be one of critical, hot, passive, active[0-*] for ACPI
> - thermal zone.
> + E.g. it can be one of critical, hot, passive, active[0-1],
> + state-active[0-*] for ACPI thermal zone.
>   RO, Optional
> 
>  cdev[0-*]
> diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
> index 220ce7e..d4c9b20 100644
> --- a/drivers/thermal/thermal_sys.c
> +++ b/drivers/thermal/thermal_sys.c
> @@ -192,6 +192,8 @@ trip_point_type_show(struct device *dev, struct
> device_attribute *attr,
>   return sprintf(buf, "passive\n");
>   case THERMAL_TRIP_ACTIVE:
>   return sprintf(buf, "active\n");
> + case THERMAL_TRIP_STATE_ACTIVE:
> + return sprintf(buf, "state-active\n");
>   default:
>   return sprintf(buf, "unknown\n");
>   }
> @@ -1034,10 +1036,10 @@ EXPORT_SYMBOL(thermal_cooling_device_unregister);
> 
>  void thermal_zone_device_update(struct thermal_zone_device *tz)
>  {
> - int count, ret = 0;
> - long temp, trip_temp;
> + int count, ret = 0, inst_id;
> + long temp, trip_temp, max_state, last_trip_change = 0;
>   enum thermal_trip_type trip_type;
> - struct thermal_cooling_device_instance *instance;
> + struct thermal_cooling_device_instance *instance, *state_instance;
>   struct thermal_cooling_device *cdev;
> 
>   mutex_lock(&tz->lock);
> @@ -1086,6 +1088,43 @@ void thermal_zone_device_update(struct
> thermal_zone_device *tz)
>   cdev->ops->set_cur_state(cdev, 0);
>   }
>   break;
> + case THERMAL_TRIP_STATE_ACTIVE:
> + list_for_each_entry(instance, &tz->cooling_devices,
> + node) {
> + if (instance->trip != count)
> + continue;
> +
> + if (temp <= last_trip_change)
> + continue;
> +
> + inst_id = 0;
> + /*
> + *For this instance how many instance of same
> + *cooling device occured before
> + */
> +
> + list_for_each_entry(state_instance,
> + &tz->cooling_devices, node) {
> + if (instance->cdev ==
> + state_instance->cdev)
> + inst_id++;
> + if (state_instance->trip == count)
> + break;
> + }

Can you explain a bit more on this loop and the set_cur_state below ?
Sorry, I don't get the logic behind this..

Thanks,
Durga

> +
> + cdev = instance->cdev;
> + cdev->ops->get_max_state(cdev, &max_state);
> +
> + if ((temp >= trip_temp) &&
> + (inst_id <= max_state))
> + cdev->ops->set_cur_state(cdev, inst_id);
> + else if ((temp < trip_temp) &&
> + (--inst_id <= m

[ACTIVITY] Graphics weekly status - wk082012 (20120220-20120224)

2012-02-23 Thread Ilias Biris
Hello

here is the status of the Graphics group. Latest meeting minutes can be
found in

https://wiki.linaro.org/WorkingGroups/Middleware/Graphics/Notes/2012-02-22

= Highlights =

- related to the 12.02 release the group managed to release the intended
components: libmatrix, glcompbench, glmark2, glproxy. Details are in the
12.02 release highlights -
https://wiki.linaro.org/Cycles/1202/Release/Highlights

- On the Unity/Nux/Compiz front: we are discussing the way forward
related to compiz-core with Ubuntu DX. There is a patch from our side,
based on earlier work done while Travis was still working for GFX - in
discussions this is the 'distro' or 'ifdef' patch, which is rather large
and work has been going on to split it into parts.

One part introduces an API which does not affect Compiz or Unity per se.
The objective is to have Unity using the new API. In doing so, Unity
will be loosing its fixed function OpenGL code and it will start to use
a more recent part of the OpenGL API that is more compatible with OpenGL
ES (it would turn the compiz package into a compiz-gles2). This will
reduce the difference in code between Unity on the desktop and Unity on ARM.

The point is this API patch won't be used right away when it is
proposed. So there aren't any existing automated DX tests to exercise it
in Unity immediately. This is an issue since the DX team are trying to
achieve working unity-3d for 12.04 before anything else, and they are
past feature freeze.

It has now been agreed to work on getting the 'distro' patch landed as
soon as possible. The API patch will be worked on at a later stage.

- dmabuf plans: the points from the discussions at Connect are being
collected at
https://wiki.linaro.org/WorkingGroups/Middleware/Graphics/UMM/Status,
and a number of blueprints are being created and discussed to reflect
the work under https://blueprints.launchpad.net/linaro-mm-sig/

- 12.03 plans: apart from the compiz and dmabuf work which was mentioned
above, the group will focus on working towards glmark2 backlog items,
glcompbench + glproxy.

- GFX LAVA dashboard: Alexandros has given a private demo of the
dashboard to a number of people. It is clear that the tests employed are
really useful in discovering regressions and issues with performance,
comparing daily test-run results. The development strategy is to focus
on the glmark2 benchmark first. After the glmark2 visualization is in a
good state, the team will start looking into visualizing additional
benchmarks. Due to the Linaro data policy there is also some polishing
needed - perhaps there will be 2 versions of the dashboard with the
externally available being completely compliant with the data policy.

Please note that the requirement to make a private version available
under permission is proving challenging, seems we would be spending much
time protecting the private dashboard view

- Finally related to prototyping around perf events (Mali): currently
this is  bit stuck in not getting much data across the GPUs (information
is different between GPUs as well as the way to get the information is
different for different GPUs), trying to solve this in a good way.
Requires some driver specific modifications to generate the data
correctly, we will continue piloting this.

Questions, issues please let me know.

Best regards



-- 
Ilias Biris ilias.bi...@linaro.org
Project Manager, Linaro
M: +358504839608, IRC: ibiris Skype: ilias_biris
Linaro.org│ Open source software for ARM SoCs

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


Re: Ubuntu LEB 12.02 RC images

2012-02-23 Thread Fathi Boudra
On 23 February 2012 07:15, Ricardo Salveti  wrote:
> On Tue, Feb 21, 2012 at 4:08 AM, Ricardo Salveti
>  wrote:
>> Fathi will be coordinating all respin requests in the next following
>> days at linaro-release m-l, and the final image will be published this
>> thursday, at releases.linaro.org.
>
> Respin request for:

Acked and pushed. Thanks.

> linaro-o-ubuntu-desktop:
> Link:http://snapshots.linaro.org/oneiric/linaro-o-ubuntu-desktop/20120223/1/images/tar/linaro-o-ubuntu-desktop-tar-20120223-1.tar.gz
> (still building)
> Bugs fixed:
>  * Ubuntu Audio doesn't work on snowball:
> https://bugs.launchpad.net/linaro-ubuntu/+bug/932076
> Comment: Needed to have sound working by default at Snowball (with jack).
>
> Changelog for linaro-maintainers's overlay PPA (series oneiric) since
> 2012-02-21 00:00:00
>  pulseaudio (1:1.1-0ubuntu4~linaro8) oneiric; urgency=low
>
>   * debian/patches/0101-Adding-profile-config-for-snowball.patch:
>     - Fixing invalid channel map
>
>  -- Ricardo Salveti de Araujo   Thu, 23
> Feb 2012 00:53:27 -0300
>
> Debdiff (low risk, doesn't affect any other platform):
> diff -u pulseaudio-1.1/debian/patches/series
> pulseaudio-1.1/debian/patches/series
> --- pulseaudio-1.1/debian/patches/series
> +++ pulseaudio-1.1/debian/patches/series
> @@ -11,6 +11,9 @@
>  0016-nodisplay-autostart.patch
>  0017-Hack-around-a-bug-in-the-core-causing-volumes-not-to.patch
>
> +# Linaro specific board config/fixes
> +0101-Adding-profile-config-for-snowball.patch
> +
>  # Jack detection patches
>  0601-Introduce-available-concept-for-ports-and-communicat.patch
>  0602-Turn-device-ports-into-reference-counted-objects.patch
> only in patch2:
> unchanged:
> --- 
> pulseaudio-1.1.orig/debian/patches/0101-Adding-profile-config-for-snowball.patch
> +++ 
> pulseaudio-1.1/debian/patches/0101-Adding-profile-config-for-snowball.patch
> @@ -0,0 +1,96 @@
> +commit 023e9f5c24d0c4721b5c33e49f8b4a3d699ba249
> +Author: Ricardo Salveti de Araujo 
> +Date:   Wed Feb 22 19:08:43 2012 -0300
> +
> +    Adding profile config for snowball
> +
> +    Patch provided by Lee Jones 
> +
> +    Signed-off-by: Ricardo Salveti de Araujo 
> +
> +diff --git a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
> b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
> +index 45a146b..1688f34 100644
> +--- a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
>  b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
> +@@ -33,4 +33,7 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e",
> ATTRS{idProduct}=="02bb", ENV{PULSE_
> + ATTRS{vendor}=="0x10de", ENV{PULSE_PROFILE_SET}="extra-hdmi.conf"
> + ATTRS{vendor}=="0x8086", ENV{PULSE_PROFILE_SET}="extra-hdmi.conf"
> +
> ++# Specific config for ST-Ericsson's Snowball board
> ++ATTR{id}=="U8500card", ENV{PULSE_PROFILE_SET}="snowball.conf"
> ++
> + LABEL="pulseaudio_end"
> +diff --git a/src/modules/alsa/mixer/profile-sets/snowball.conf
> b/src/modules/alsa/mixer/profile-sets/snowball.conf
> +new file mode 100644
> +index 000..ffafc00
> +--- /dev/null
>  b/src/modules/alsa/mixer/profile-sets/snowball.conf
> +@@ -0,0 +1,54 @@
> ++# This file is part of PulseAudio.
> ++#
> ++# PulseAudio is free software; you can redistribute it and/or modify
> ++# it under the terms of the GNU Lesser General Public License as
> ++# published by the Free Software Foundation; either version 2.1 of the
> ++# License, or (at your option) any later version.
> ++#
> ++# PulseAudio 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.
> ++#
> ++# You should have received a copy of the GNU Lesser General Public License
> ++# along with PulseAudio; if not, write to the Free Software Foundation,
> ++# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
> ++
> ++; ST-Ericsson Snowball based board generic static setup
> ++;
> ++; See default.conf for an explanation on the directives used here.
> ++
> ++[General]
> ++auto-profiles = no
> ++
> ++[Mapping default-mapping-output]
> ++description = : headset output for Snowball (default)
> ++device-strings = hw:%f,1
> ++channel-map = front-left,front-right
> ++direction = output
> ++
> ++[Mapping mapping-output-hdmi]
> ++description = : av8100 HDMI output for Snowball
> ++device-strings = hw:%f,0
> ++channel-map = front-left,front-right
> ++direction = output
> ++
> ++[Mapping default-mapping-input]
> 

Re: gcc: Thumb interworking and weakly linked functions

2012-02-23 Thread Aneesh V

Oops! Sorry. These mails skipped my Inbox and went into a sub-folder
in my mail client that I hadn't used for a long time. I didn't
realize that I had mails!

On Monday 20 February 2012 11:29 PM, Ulrich Weigand wrote:

"V, Aneesh"  wrote:


I agree that not marking the assembly functions ' %function' is a problem
in the code, so it's not a critical bug. But I would've been happier if
the linker refused to link it rather than branching with the wrong
instruction. Isn't that a problem?


Well, if the target symbol of a branch is not marked as %function,
the linker has no way of knowing whether that target is ARM or Thumb,
so it cannot specifically error out if (and only if) the instruction
is wrong.

The linker *could* in theory give an error *unconditionally* whenever
it detects a branch to a non-%function symbol.  The reason this is not
done is probably for backwards compatibility with old hand-written code,
say from an ARM-only era: branches to non-function symbols used to be
allowed, and in fact work fine if all code is ARM-only.  Adding an error
would break such old code.


Ok. Agree. I never used to use %function when I wrote assembly
functions earlier. I am sure a lot of code will break if this was
enforced.





Problem No:2
*
Linaro GCC 2012.01 is giving a new problem w.r.to Thumb build
that is not existing in Sourcery G++ Lite 2010q1-202. However, I
couldn't reproduce this problem with a small program like above. So,
let me give you reference to the original u-boot code that shows the
problem and steps to reproduce it.

[snip]

Please note that the .rodata symbols have odd addresses. These arrays
actually need to be aligned at least to half-word boundary. In fact, in
the image I verified that they are put at even addresses. So, the
symbols have been kept as real address +1.


This seems strange.  How did you verify "that they are put at even
addresses"?
I can reproduce the odd addresses of .rodata symbols.  However, this
occurs simply because the linker put *no* alignment requirement whatsoever
on those sections:


Sorry, that was an error in interpreting the data. The data is put at
the odd address given in the map file.



Section Headers:
   [Nr] Name  TypeAddr OffSize   ES Flg Lk
Inf Al
[snip]
   [11] .rodata.wkup_padc PROGBITS 000100 04 00   A  0
0  1
   [12] .rodata.wkup_padc PROGBITS 000104 48 00   A  0
0  1
   [13] .rodata.wkup_padc PROGBITS 00014c 0c 00   A  0
0  1
   [14] .rodata.wkup_padc PROGBITS 000158 04 00   A  0
0  1

Note the "Al" column values of 1.  In the final executable, those sections
happen to end up immediately following a .rodata.str string section with
odd
lenght, and since they don't have any alignment requirement, they start out
at an odd address.

The reason for the lack of alignment requirement is actually in the source:

const struct pad_conf_entry core_padconf_array_essential[] = {

where

struct pad_conf_entry {

 u16 offset;

 u16 val;

} __attribute__ ((packed));


The "packed" attribute specifies that all struct elements ought to be
considered to have alignment requirement 1 instead of their default
alignment.  Thus the whole struct ends up having alignment requirement 1;
and since the section contains only a single variable of such struct
type, this is then also the alignment requirement of the section.



Hmm.. Thanks. Removing packed seems to help. The following also helped.

@@ -34,7 +34,7 @@ struct pad_conf_entry {

u16 val;

-} __attribute__ ((packed));
+} __attribute__ ((packed)) __attribute__ ((aligned(2)));

BTW, just for my understanding:
The effect of adding __attribute__ ((packed)) to a structure is
equivalent to adding it for each field in the structure, right? And
because the first field doesn't have any alignment requirement, the
struct also doesn't have any alignment requirement right?

Wonder why the issue never occurred until we started building in Thumb.

Thanks a lot for looking into this.

best regards,
Aneesh

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


Re: gcc: Thumb interworking and weakly linked functions

2012-02-23 Thread Aneesh V

On Tuesday 21 February 2012 03:27 PM, Dave Martin wrote:

On Mon, Feb 20, 2012 at 06:59:53PM +0100, Ulrich Weigand wrote:

"V, Aneesh"  wrote:


I agree that not marking the assembly functions ' %function' is a problem
in the code, so it's not a critical bug. But I would've been happier if
the linker refused to link it rather than branching with the wrong
instruction. Isn't that a problem?


Well, if the target symbol of a branch is not marked as %function,
the linker has no way of knowing whether that target is ARM or Thumb,
so it cannot specifically error out if (and only if) the instruction
is wrong.

The linker *could* in theory give an error *unconditionally* whenever
it detects a branch to a non-%function symbol.  The reason this is not
done is probably for backwards compatibility with old hand-written code,
say from an ARM-only era: branches to non-function symbols used to be
allowed, and in fact work fine if all code is ARM-only.  Adding an error
would break such old code.



Problem No:2
*
Linaro GCC 2012.01 is giving a new problem w.r.to Thumb build
that is not existing in Sourcery G++ Lite 2010q1-202. However, I
couldn't reproduce this problem with a small program like above. So,
let me give you reference to the original u-boot code that shows the
problem and steps to reproduce it.

[snip]

Please note that the .rodata symbols have odd addresses. These arrays
actually need to be aligned at least to half-word boundary. In fact, in
the image I verified that they are put at even addresses. So, the
symbols have been kept as real address +1.


This seems strange.  How did you verify "that they are put at even
addresses"?
I can reproduce the odd addresses of .rodata symbols.  However, this
occurs simply because the linker put *no* alignment requirement whatsoever
on those sections:

Section Headers:
   [Nr] Name  TypeAddr OffSize   ES Flg Lk
Inf Al
[snip]
   [11] .rodata.wkup_padc PROGBITS 000100 04 00   A  0
0  1
   [12] .rodata.wkup_padc PROGBITS 000104 48 00   A  0
0  1
   [13] .rodata.wkup_padc PROGBITS 00014c 0c 00   A  0
0  1
   [14] .rodata.wkup_padc PROGBITS 000158 04 00   A  0
0  1

Note the "Al" column values of 1.  In the final executable, those sections
happen to end up immediately following a .rodata.str string section with
odd
lenght, and since they don't have any alignment requirement, they start out
at an odd address.

The reason for the lack of alignment requirement is actually in the source:

const struct pad_conf_entry core_padconf_array_essential[] = {

where

struct pad_conf_entry {

 u16 offset;

 u16 val;

} __attribute__ ((packed));


The "packed" attribute specifies that all struct elements ought to be
considered to have alignment requirement 1 instead of their default
alignment.  Thus the whole struct ends up having alignment requirement 1;
and since the section contains only a single variable of such struct
type, this is then also the alignment requirement of the section.


Is "packed" even wanted here?

Based on a very brief skim of the code, it looks like the packed attribute
is an unnecessary attempt to save some space -- unnecessary because all
ARM ABI variants I know of (actually, all arches I know of) will pack that
structure into a word anyway as a result of natural alignment of the
members.  It doesn't look to me like the packed structure is used to map a
memory-mapped peripheral directly or otherwise communicate with the outside
world -- which would be the only situations in which a packed structure
would normally make sense.

Of course, I may have missed something...


No. I think packed is not needed here. Removing it didn't change the
size of the arrays. I will remove it.

Thanks,
Aneesh

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


Re: [PATCH 1/4] thermal: Add a new trip type to use cooling device instance number

2012-02-23 Thread Amit Kachhap
On 23 February 2012 12:16, R, Durgadoss  wrote:
> Hi Amit,
>
>> -Original Message-
>> From: amit kachhap [mailto:amitdani...@gmail.com] On Behalf Of Amit Daniel
>> Kachhap
>> Sent: Wednesday, February 22, 2012 3:44 PM
>> To: linux...@lists.linux-foundation.org
>> Cc: linux-ker...@vger.kernel.org; mj...@srcf.ucam.org; linux-
>> a...@vger.kernel.org; l...@kernel.org; linaro-dev@lists.linaro.org;
>> amit.kach...@linaro.org; R, Durgadoss; rob@linaro.org; patc...@linaro.org
>> Subject: [PATCH 1/4] thermal: Add a new trip type to use cooling device
>> instance number
>>
>> This patch adds a new trip type THERMAL_TRIP_STATE_ACTIVE. This
>> trip behaves same as THERMAL_TRIP_ACTIVE but also passes the cooling
>> device instance number. This helps the cooling device registered as
>> different instances to perform appropriate cooling action decision in
>> the set_cur_state call back function.
>>
>> Also since the trip temperature's are in ascending order so some logic
>> is put in place to skip the un-necessary checks.
>>
>> Signed-off-by: Amit Daniel Kachhap 
>> ---
>>  Documentation/thermal/sysfs-api.txt |    4 +-
>>  drivers/thermal/thermal_sys.c       |   45 
>> --
>>  include/linux/thermal.h             |    1 +
>>  3 files changed, 45 insertions(+), 5 deletions(-)
>>
>> diff --git a/Documentation/thermal/sysfs-api.txt 
>> b/Documentation/thermal/sysfs-
>> api.txt
>> index 1733ab9..7a0c080 100644
>> --- a/Documentation/thermal/sysfs-api.txt
>> +++ b/Documentation/thermal/sysfs-api.txt
>> @@ -184,8 +184,8 @@ trip_point_[0-*]_temp
>>
>>  trip_point_[0-*]_type
>>       Strings which indicate the type of the trip point.
>> -     E.g. it can be one of critical, hot, passive, active[0-*] for ACPI
>> -     thermal zone.
>> +     E.g. it can be one of critical, hot, passive, active[0-1],
>> +     state-active[0-*] for ACPI thermal zone.
>>       RO, Optional
>>
>>  cdev[0-*]
>> diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
>> index 220ce7e..d4c9b20 100644
>> --- a/drivers/thermal/thermal_sys.c
>> +++ b/drivers/thermal/thermal_sys.c
>> @@ -192,6 +192,8 @@ trip_point_type_show(struct device *dev, struct
>> device_attribute *attr,
>>               return sprintf(buf, "passive\n");
>>       case THERMAL_TRIP_ACTIVE:
>>               return sprintf(buf, "active\n");
>> +     case THERMAL_TRIP_STATE_ACTIVE:
>> +             return sprintf(buf, "state-active\n");
>>       default:
>>               return sprintf(buf, "unknown\n");
>>       }
>> @@ -1034,10 +1036,10 @@ EXPORT_SYMBOL(thermal_cooling_device_unregister);
>>
>>  void thermal_zone_device_update(struct thermal_zone_device *tz)
>>  {
>> -     int count, ret = 0;
>> -     long temp, trip_temp;
>> +     int count, ret = 0, inst_id;
>> +     long temp, trip_temp, max_state, last_trip_change = 0;
>>       enum thermal_trip_type trip_type;
>> -     struct thermal_cooling_device_instance *instance;
>> +     struct thermal_cooling_device_instance *instance, *state_instance;
>>       struct thermal_cooling_device *cdev;
>>
>>       mutex_lock(&tz->lock);
>> @@ -1086,6 +1088,43 @@ void thermal_zone_device_update(struct
>> thermal_zone_device *tz)
>>                                       cdev->ops->set_cur_state(cdev, 0);
>>                       }
>>                       break;
>> +             case THERMAL_TRIP_STATE_ACTIVE:
>> +                     list_for_each_entry(instance, &tz->cooling_devices,
>> +                                         node) {
>> +                             if (instance->trip != count)
>> +                                     continue;
>> +
>> +                             if (temp <= last_trip_change)
>> +                                     continue;
>> +
>> +                             inst_id = 0;
>> +                             /*
>> +                             *For this instance how many instance of same
>> +                             *cooling device occured before
>> +                             */
>> +
>> +                             list_for_each_entry(state_instance,
>> +                                             &tz->cooling_devices, node) {
>> +                                     if (instance->cdev ==
>> +                                                     state_instance->cdev)
>> +                                             inst_id++;
>> +                                     if (state_instance->trip == count)
>> +                                             break;
>> +                             }
>
> Can you explain a bit more on this loop and the set_cur_state below ?
> Sorry, I don't get the logic behind this..

This loop is basically finding the instance id of the same cooling device.
Say we have done like this,
thermal_zone_bind_cooling_device(thermal, 2, cdev);
thermal_zone_bind_cooling_device(thermal, 3, cdev);
thermal_zone_bind_cooling_device(thermal, 4, cdev);

In above same cooling device cdev is binded to trip no 2,3 and 4 with
inst_id ge

[PATCH v2 3/6] mmc: omap_hsmmc: Use OMAP_HSMMC_SUPPORTS_DUAL_VOLT flag to remove host->id based hardcoding

2012-02-23 Thread Rajendra Nayak
From: Balaji T K 

Use OMAP_HSMMC_SUPPORTS_DUAL_VOLT flag instead of host->id
for identifying SD bus voltage capabilities.

Signed-off-by: Balaji T K 
Signed-off-by: Rajendra Nayak 
Tested-by: Venkatraman S 
---
 drivers/mmc/host/omap_hsmmc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 9955aee..91faf42 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -650,7 +650,7 @@ static int omap_hsmmc_context_restore(struct 
omap_hsmmc_host *host)
OMAP_HSMMC_WRITE(host->base, SYSCONFIG,
OMAP_HSMMC_READ(host->base, SYSCONFIG) | AUTOIDLE);
 
-   if (host->id == OMAP_MMC1_DEVID) {
+   if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT) {
if (host->power_mode != MMC_POWER_OFF &&
(1 << ios->vdd) <= MMC_VDD_23_24)
hctl = SDVS18;
-- 
1.7.1


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


[PATCH v2 5/6] mmc: omap_hsmmc: Get rid of omap_hsmmc_4_set_power function

2012-02-23 Thread Rajendra Nayak
Now that omap_hsmmc_set_power() already has a check to return 0
if !host->vcc, it seems like it can be used even on MMC4 instead
of the dummy omap_hsmmc_4_set_power().

This also helps get rid of all the host->id based check to
populate the right function for on-chip/external level
shifting and use omap_hsmmc_set_power() for all MMC modules.

Signed-off-by: Rajendra Nayak 
Tested-by: Venkatraman S 
Tested-by: Balaji T K 
---
 drivers/mmc/host/omap_hsmmc.c |   21 +
 1 files changed, 1 insertions(+), 20 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index f98c599..17e264b 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -297,32 +297,13 @@ static int omap_hsmmc_set_power(struct device *dev, int 
slot, int power_on,
return ret;
 }
 
-static int omap_hsmmc_4_set_power(struct device *dev, int slot, int power_on,
-   int vdd)
-{
-   return 0;
-}
-
 static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 {
struct regulator *reg;
int ret = 0;
int ocr_value = 0;
 
-   switch (host->id) {
-   case OMAP_MMC1_DEVID:
-   case OMAP_MMC2_DEVID:
-   case OMAP_MMC3_DEVID:
-   case OMAP_MMC5_DEVID:
-   /* On-chip level shifting via PBIAS0/PBIAS1 */
-   mmc_slot(host).set_power = omap_hsmmc_set_power;
-   break;
-   case OMAP_MMC4_DEVID:
-   mmc_slot(host).set_power = omap_hsmmc_4_set_power;
-   default:
-   pr_err("MMC%d configuration not supported!\n", host->id);
-   return -EINVAL;
-   }
+   mmc_slot(host).set_power = omap_hsmmc_set_power;
 
reg = regulator_get(host->dev, "vmmc");
if (IS_ERR(reg)) {
-- 
1.7.1


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


[PATCH v2 6/6] mmc: omap_hsmmc: Don't expect MMC1 to always have vmmc supply

2012-02-23 Thread Rajendra Nayak
MMC1 is not the only instance that can be used/wired for SD.
So remove this assumption from the driver.

Now that all the mmc id based usage is removed, get rid
of all the DEVID defines and also the 'id' field from the
omap_hsmmc_host structure.

Signed-off-by: Rajendra Nayak 
Tested-by: Venkatraman S 
Tested-by: Balaji T K 
---
 drivers/mmc/host/omap_hsmmc.c |   31 ++-
 1 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 17e264b..e3eb9d4 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -106,17 +106,6 @@
 #define SOFTRESET  (1 << 1)
 #define RESETDONE  (1 << 0)
 
-/*
- * FIXME: Most likely all the data using these _DEVID defines should come
- * from the platform_data, or implemented in controller and slot specific
- * functions.
- */
-#define OMAP_MMC1_DEVID0
-#define OMAP_MMC2_DEVID1
-#define OMAP_MMC3_DEVID2
-#define OMAP_MMC4_DEVID3
-#define OMAP_MMC5_DEVID4
-
 #define MMC_AUTOSUSPEND_DELAY  100
 #define MMC_TIMEOUT_MS 20
 #define OMAP_MMC_MIN_CLOCK 40
@@ -164,7 +153,6 @@ struct omap_hsmmc_host {
void__iomem *base;
resource_size_t mapbase;
spinlock_t  irq_lock; /* Prevent races with irq handler */
-   unsigned intid;
unsigned intdma_len;
unsigned intdma_sg_idx;
unsigned char   bus_mode;
@@ -300,7 +288,6 @@ static int omap_hsmmc_set_power(struct device *dev, int 
slot, int power_on,
 static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 {
struct regulator *reg;
-   int ret = 0;
int ocr_value = 0;
 
mmc_slot(host).set_power = omap_hsmmc_set_power;
@@ -308,15 +295,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
reg = regulator_get(host->dev, "vmmc");
if (IS_ERR(reg)) {
dev_dbg(host->dev, "vmmc regulator missing\n");
-   /*
-   * HACK: until fixed.c regulator is usable,
-   * we don't require a main regulator
-   * for MMC2 or MMC3
-   */
-   if (host->id == OMAP_MMC1_DEVID) {
-   ret = PTR_ERR(reg);
-   goto err;
-   }
} else {
host->vcc = reg;
ocr_value = mmc_regulator_get_ocrmask(reg);
@@ -324,8 +302,8 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
mmc_slot(host).ocr_mask = ocr_value;
} else {
if (!(mmc_slot(host).ocr_mask & ocr_value)) {
-   pr_err("MMC%d ocrmask %x is not supported\n",
-   host->id, mmc_slot(host).ocr_mask);
+   pr_err("MMC ocrmask %x is not supported\n",
+   mmc_slot(host).ocr_mask);
mmc_slot(host).ocr_mask = 0;
return -EINVAL;
}
@@ -358,10 +336,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
}
 
return 0;
-
-err:
-   mmc_slot(host).set_power = NULL;
-   return ret;
 }
 
 static void omap_hsmmc_reg_put(struct omap_hsmmc_host *host)
@@ -1791,7 +1765,6 @@ static int __init omap_hsmmc_probe(struct platform_device 
*pdev)
host->dev->dma_mask = &pdata->dma_mask;
host->dma_ch= -1;
host->irq   = irq;
-   host->id= pdev->id;
host->slot_id   = 0;
host->mapbase   = res->start;
host->base  = ioremap(host->mapbase, SZ_4K);
-- 
1.7.1


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


[PATCH v2 4/6] mmc: omap_hsmmc: Get rid of omap_hsmmc_1_set_power function

2012-02-23 Thread Rajendra Nayak
Use omap_hsmmc_235_set_poweri() (now renamed as omap_hsmmc_set_power())
for MMC1 instance as well and get rid of omap_hsmmc_1_set_power()
completely.
omap_hsmmc_235_set_power() seems to implemented as a superset of
omap_hsmmc_1_set_power() with additonal functionality implemented
based on additional checks and hence should just work for MMC1
as well.

Signed-off-by: Rajendra Nayak 
Tested-by: Venkatraman S 
Tested-by: Balaji T K 
---
 drivers/mmc/host/omap_hsmmc.c |   30 +++---
 1 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 91faf42..f98c599 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -241,28 +241,7 @@ static int omap_hsmmc_resume_cdirq(struct device *dev, int 
slot)
 
 #ifdef CONFIG_REGULATOR
 
-static int omap_hsmmc_1_set_power(struct device *dev, int slot, int power_on,
- int vdd)
-{
-   struct omap_hsmmc_host *host =
-   platform_get_drvdata(to_platform_device(dev));
-   int ret;
-
-   if (mmc_slot(host).before_set_reg)
-   mmc_slot(host).before_set_reg(dev, slot, power_on, vdd);
-
-   if (power_on)
-   ret = mmc_regulator_set_ocr(host->mmc, host->vcc, vdd);
-   else
-   ret = mmc_regulator_set_ocr(host->mmc, host->vcc, 0);
-
-   if (mmc_slot(host).after_set_reg)
-   mmc_slot(host).after_set_reg(dev, slot, power_on, vdd);
-
-   return ret;
-}
-
-static int omap_hsmmc_235_set_power(struct device *dev, int slot, int power_on,
+static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
   int vdd)
 {
struct omap_hsmmc_host *host =
@@ -332,14 +311,11 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host 
*host)
 
switch (host->id) {
case OMAP_MMC1_DEVID:
-   /* On-chip level shifting via PBIAS0/PBIAS1 */
-   mmc_slot(host).set_power = omap_hsmmc_1_set_power;
-   break;
case OMAP_MMC2_DEVID:
case OMAP_MMC3_DEVID:
case OMAP_MMC5_DEVID:
-   /* Off-chip level shifting, or none */
-   mmc_slot(host).set_power = omap_hsmmc_235_set_power;
+   /* On-chip level shifting via PBIAS0/PBIAS1 */
+   mmc_slot(host).set_power = omap_hsmmc_set_power;
break;
case OMAP_MMC4_DEVID:
mmc_slot(host).set_power = omap_hsmmc_4_set_power;
-- 
1.7.1


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


[PATCH v2 2/6] mmc: omap_hsmmc: remove unused .set_sleep function

2012-02-23 Thread Rajendra Nayak
From: Balaji T K 

set_sleep seems to be unused in omap_hsmmc driver. so get rid of it.

Signed-off-by: Balaji T K 
Signed-off-by: Rajendra Nayak 
Tested-by: Venkatraman S 
---
 arch/arm/plat-omap/include/plat/mmc.h |2 -
 drivers/mmc/host/omap_hsmmc.c |   60 -
 2 files changed, 0 insertions(+), 62 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/mmc.h 
b/arch/arm/plat-omap/include/plat/mmc.h
index f75946c..7a38750 100644
--- a/arch/arm/plat-omap/include/plat/mmc.h
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -137,8 +137,6 @@ struct omap_mmc_platform_data {
int (*set_power)(struct device *dev, int slot,
 int power_on, int vdd);
int (*get_ro)(struct device *dev, int slot);
-   int (*set_sleep)(struct device *dev, int slot, int sleep,
-int vdd, int cardsleep);
void (*remux)(struct device *dev, int slot, int power_on);
/* Call back before enabling / disabling regulators */
void (*before_set_reg)(struct device *dev, int slot,
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 2a660ab..9955aee 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -324,61 +324,6 @@ static int omap_hsmmc_4_set_power(struct device *dev, int 
slot, int power_on,
return 0;
 }
 
-static int omap_hsmmc_1_set_sleep(struct device *dev, int slot, int sleep,
- int vdd, int cardsleep)
-{
-   struct omap_hsmmc_host *host =
-   platform_get_drvdata(to_platform_device(dev));
-   int mode = sleep ? REGULATOR_MODE_STANDBY : REGULATOR_MODE_NORMAL;
-
-   return regulator_set_mode(host->vcc, mode);
-}
-
-static int omap_hsmmc_235_set_sleep(struct device *dev, int slot, int sleep,
-  int vdd, int cardsleep)
-{
-   struct omap_hsmmc_host *host =
-   platform_get_drvdata(to_platform_device(dev));
-   int err, mode;
-
-   /*
-* If we don't see a Vcc regulator, assume it's a fixed
-* voltage always-on regulator.
-*/
-   if (!host->vcc)
-   return 0;
-
-   mode = sleep ? REGULATOR_MODE_STANDBY : REGULATOR_MODE_NORMAL;
-
-   if (!host->vcc_aux)
-   return regulator_set_mode(host->vcc, mode);
-
-   if (cardsleep) {
-   /* VCC can be turned off if card is asleep */
-   if (sleep)
-   err = mmc_regulator_set_ocr(host->mmc, host->vcc, 0);
-   else
-   err = mmc_regulator_set_ocr(host->mmc, host->vcc, vdd);
-   } else
-   err = regulator_set_mode(host->vcc, mode);
-   if (err)
-   return err;
-
-   if (!mmc_slot(host).vcc_aux_disable_is_sleep)
-   return regulator_set_mode(host->vcc_aux, mode);
-
-   if (sleep)
-   return regulator_disable(host->vcc_aux);
-   else
-   return regulator_enable(host->vcc_aux);
-}
-
-static int omap_hsmmc_4_set_sleep(struct device *dev, int slot, int sleep,
-   int vdd, int cardsleep)
-{
-   return 0;
-}
-
 static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 {
struct regulator *reg;
@@ -389,18 +334,15 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host 
*host)
case OMAP_MMC1_DEVID:
/* On-chip level shifting via PBIAS0/PBIAS1 */
mmc_slot(host).set_power = omap_hsmmc_1_set_power;
-   mmc_slot(host).set_sleep = omap_hsmmc_1_set_sleep;
break;
case OMAP_MMC2_DEVID:
case OMAP_MMC3_DEVID:
case OMAP_MMC5_DEVID:
/* Off-chip level shifting, or none */
mmc_slot(host).set_power = omap_hsmmc_235_set_power;
-   mmc_slot(host).set_sleep = omap_hsmmc_235_set_sleep;
break;
case OMAP_MMC4_DEVID:
mmc_slot(host).set_power = omap_hsmmc_4_set_power;
-   mmc_slot(host).set_sleep = omap_hsmmc_4_set_sleep;
default:
pr_err("MMC%d configuration not supported!\n", host->id);
return -EINVAL;
@@ -462,7 +404,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 
 err:
mmc_slot(host).set_power = NULL;
-   mmc_slot(host).set_sleep = NULL;
return ret;
 }
 
@@ -471,7 +412,6 @@ static void omap_hsmmc_reg_put(struct omap_hsmmc_host *host)
regulator_put(host->vcc);
regulator_put(host->vcc_aux);
mmc_slot(host).set_power = NULL;
-   mmc_slot(host).set_sleep = NULL;
 }
 
 static inline int omap_hsmmc_have_reg(void)
-- 
1.7.1


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


[PATCH v2 0/6] mmc: omap_hsmmc: Clean up use/abuse of pdev->id

2012-02-23 Thread Rajendra Nayak
Re-sending as these patches did not make it to the lists due to
issues with my 'git send-email'

This series mainly cleans up all instances of hardcoding's in
the driver based on pdev->id. This is cleanup leading to the
DT adaptation of omap_hsmmc driver.

v2 mainly has some minor changes to get rid of a debug print
which was still using host->id and getting rid of 'id' field
entirely from omap_hsmmc_host struct.

The series is tested on OMAP4SDP, OMAP4panda, OMAP3beagle and OMAP2430SDP
boards.

regards,
Rajendra

Balaji T K (3):
  mmc: omap_hsmmc: use platform_get_resource_byname for tx/rx DMA
channels
  mmc: omap_hsmmc: remove unused .set_sleep function
  mmc: omap_hsmmc: Use OMAP_HSMMC_SUPPORTS_DUAL_VOLT flag to remove
host->id based hardcoding

Rajendra Nayak (3):
  mmc: omap_hsmmc: Get rid of omap_hsmmc_1_set_power function
  mmc: omap_hsmmc: Get rid of omap_hsmmc_4_set_power function
  mmc: omap_hsmmc: Don't expect MMC1 to always have vmmc supply

 arch/arm/plat-omap/include/plat/mmc.h |2 -
 drivers/mmc/host/omap_hsmmc.c |  175 +++--
 2 files changed, 16 insertions(+), 161 deletions(-)


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


[PATCH v2 1/6] mmc: omap_hsmmc: use platform_get_resource_byname for tx/rx DMA channels

2012-02-23 Thread Rajendra Nayak
From: Balaji T K 

Git rid of hardcoded tx/rx DMA channels based on pdev->id
and use platform_get_resource_byname() to retrieve them
instead.

Signed-off-by: Balaji T K 
Signed-off-by: Rajendra Nayak 
Tested-by: Venkatraman S 
---
 drivers/mmc/host/omap_hsmmc.c |   35 +++
 1 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index fd0c661..2a660ab 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1977,32 +1977,19 @@ static int __init omap_hsmmc_probe(struct 
platform_device *pdev)
 
omap_hsmmc_conf_bus_power(host);
 
-   /* Select DMA lines */
-   switch (host->id) {
-   case OMAP_MMC1_DEVID:
-   host->dma_line_tx = OMAP24XX_DMA_MMC1_TX;
-   host->dma_line_rx = OMAP24XX_DMA_MMC1_RX;
-   break;
-   case OMAP_MMC2_DEVID:
-   host->dma_line_tx = OMAP24XX_DMA_MMC2_TX;
-   host->dma_line_rx = OMAP24XX_DMA_MMC2_RX;
-   break;
-   case OMAP_MMC3_DEVID:
-   host->dma_line_tx = OMAP34XX_DMA_MMC3_TX;
-   host->dma_line_rx = OMAP34XX_DMA_MMC3_RX;
-   break;
-   case OMAP_MMC4_DEVID:
-   host->dma_line_tx = OMAP44XX_DMA_MMC4_TX;
-   host->dma_line_rx = OMAP44XX_DMA_MMC4_RX;
-   break;
-   case OMAP_MMC5_DEVID:
-   host->dma_line_tx = OMAP44XX_DMA_MMC5_TX;
-   host->dma_line_rx = OMAP44XX_DMA_MMC5_RX;
-   break;
-   default:
-   dev_err(mmc_dev(host->mmc), "Invalid MMC id\n");
+   res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
+   if (!res) {
+   dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
+   goto err_irq;
+   }
+   host->dma_line_tx = res->start;
+
+   res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
+   if (!res) {
+   dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
goto err_irq;
}
+   host->dma_line_rx = res->start;
 
/* Request IRQ for MMC operations */
ret = request_irq(host->irq, omap_hsmmc_irq, 0,
-- 
1.7.1


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


[PATCH v3 0/2] Device tree support for TWL regulators

2012-02-23 Thread Rajendra Nayak
Re-sending as these patches did not make it to the lists due to
issues with my 'git send-email'

v3 has mainly 2 differences from v2
-1- TWL driver now uses just one table for both dt and
non-dt based lookup for driver data.
-2- All common regulator nodes for twl4030 and twl6030 are
now defined in the twl4030.dtsi and twl6030.dtsi instead of
repeating the nodes in all board files, which also means
the patch ('arm/dts: twl: Pass regulator data from dt')
has a dependency with the series from Benoit which adds the
twl4030.dtsi and twl6030.dtsi files[1].

I have tested the patches on omap4panda and omap3beagle boards.

[1] git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt.git
for_3.4/dt_i2c_twl

Rajendra Nayak (2):
  regulator: twl: adapt twl-regulator driver to dt
  arm/dts: twl: Pass regulator data from dt

 .../bindings/regulator/twl-regulator.txt   |   63 ++
 arch/arm/boot/dts/omap3-beagle.dts |6 +
 arch/arm/boot/dts/twl4030.dtsi |   18 ++
 arch/arm/boot/dts/twl6030.dtsi |   60 +
 drivers/regulator/twl-regulator.c  |  227 +---
 5 files changed, 301 insertions(+), 73 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/regulator/twl-regulator.txt


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


[PATCH v3 2/2] arm/dts: twl: Pass regulator data from dt

2012-02-23 Thread Rajendra Nayak
Pass all the voltage regulator information for
twl6030/twl4030 PMIC from device tree.

Signed-off-by: Rajendra Nayak 
Signed-off-by: Benoit Cousson 
---
 arch/arm/boot/dts/omap3-beagle.dts |6 +++
 arch/arm/boot/dts/twl4030.dtsi |   18 +++
 arch/arm/boot/dts/twl6030.dtsi |   60 
 3 files changed, 84 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap3-beagle.dts 
b/arch/arm/boot/dts/omap3-beagle.dts
index 714ba5d..54556b1 100644
--- a/arch/arm/boot/dts/omap3-beagle.dts
+++ b/arch/arm/boot/dts/omap3-beagle.dts
@@ -26,6 +26,12 @@
reg = <0x48>;
interrupts = <7>; /* SYS_NIRQ cascaded to intc */
interrupt-parent = <&intc>;
+
+   vsim: regulator@10 {
+   compatible = "ti,twl4030-vsim";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <300>;
+   };
};
 };
 
diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
index 8be5223..a94654c 100644
--- a/arch/arm/boot/dts/twl4030.dtsi
+++ b/arch/arm/boot/dts/twl4030.dtsi
@@ -18,4 +18,22 @@
compatible = "ti,twl4030-rtc";
interrupts = <11>;
};
+
+   vdac: regulator@0 {
+   compatible = "ti,twl4030-vdac";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   };
+
+   vpll2: regulator@1 {
+   compatible = "ti,twl4030-vpll2";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   };
+
+   vmmc1: regulator@2 {
+   compatible = "ti,twl4030-vmmc1";
+   regulator-min-microvolt = <185>;
+   regulator-max-microvolt = <315>;
+   };
 };
diff --git a/arch/arm/boot/dts/twl6030.dtsi b/arch/arm/boot/dts/twl6030.dtsi
index b7b4e5e..efa19e8 100644
--- a/arch/arm/boot/dts/twl6030.dtsi
+++ b/arch/arm/boot/dts/twl6030.dtsi
@@ -19,4 +19,64 @@
compatible = "ti,twl4030-rtc";
interrupts = <11>;
};
+
+   vaux1: regulator@0 {
+   compatible = "ti,twl6030-vaux1";
+   regulator-min-microvolt = <100>;
+   regulator-max-microvolt = <300>;
+   };
+
+   vaux2: regulator@1 {
+   compatible = "ti,twl6030-vaux2";
+   regulator-min-microvolt = <120>;
+   regulator-max-microvolt = <280>;
+   };
+
+   vaux3: regulator@2 {
+   compatible = "ti,twl6030-vaux3";
+   regulator-min-microvolt = <100>;
+   regulator-max-microvolt = <300>;
+   };
+
+   vmmc: regulator@3 {
+   compatible = "ti,twl6030-vmmc";
+   regulator-min-microvolt = <120>;
+   regulator-max-microvolt = <300>;
+   };
+
+   vpp: regulator@4 {
+   compatible = "ti,twl6030-vpp";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <250>;
+   };
+
+   vusim: regulator@5 {
+   compatible = "ti,twl6030-vusim";
+   regulator-min-microvolt = <120>;
+   regulator-max-microvolt = <290>;
+   };
+
+   vdac: regulator@6 {
+   compatible = "ti,twl6030-vdac";
+   };
+
+   vana: regulator@7 {
+   compatible = "ti,twl6030-vana";
+   };
+
+   vcxio: regulator@8 {
+   compatible = "ti,twl6030-vcxio";
+   };
+
+   vusb: regulator@9 {
+   compatible = "ti,twl6030-vusb";
+   };
+
+   vusb: regulator@9 {
+   compatible = "ti,twl6030-vusb";
+   };
+
+   clk32kg: regulator@10 {
+   compatible = "ti,twl6030-clk32kg";
+   };
 };
-- 
1.7.1


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


[PATCH v3 1/2] regulator: twl: adapt twl-regulator driver to dt

2012-02-23 Thread Rajendra Nayak
Modify the twl regulator driver to extract the regulator_init_data from
device tree when passed, instead of getting it through platform_data
structures (on non-DT builds)

Also add documentation for TWL regulator specific bindings.

Signed-off-by: Rajendra Nayak 
---
 .../bindings/regulator/twl-regulator.txt   |   63 ++
 drivers/regulator/twl-regulator.c  |  227 +---
 2 files changed, 217 insertions(+), 73 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/regulator/twl-regulator.txt

diff --git a/Documentation/devicetree/bindings/regulator/twl-regulator.txt 
b/Documentation/devicetree/bindings/regulator/twl-regulator.txt
new file mode 100644
index 000..074e344
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/twl-regulator.txt
@@ -0,0 +1,63 @@
+TWL family of regulators
+
+Required properties:
+For twl6030 regulators/LDOs
+- compatible:
+  - "ti,twl6030-vaux1" for VAUX1 LDO
+  - "ti,twl6030-vaux2" for VAUX2 LDO
+  - "ti,twl6030-vaux3" for VAUX3 LDO
+  - "ti,twl6030-vmmc" for VMMC LDO
+  - "ti,twl6030-vpp" for VPP LDO
+  - "ti,twl6030-vusim" for VUSIM LDO
+  - "ti,twl6030-vana" for VANA LDO
+  - "ti,twl6030-vcxio" for VCXIO LDO
+  - "ti,twl6030-vdac" for VDAC LDO
+  - "ti,twl6030-vusb" for VUSB LDO
+  - "ti,twl6030-clk32kg" for CLK32KG LDO
+For twl6025 regulators/LDOs
+- compatible:
+  - "ti,twl6025-ldo1" for LDO1 LDO
+  - "ti,twl6025-ldo2" for LDO2 LDO
+  - "ti,twl6025-ldo3" for LDO3 LDO
+  - "ti,twl6025-ldo4" for LDO4 LDO
+  - "ti,twl6025-ldo5" for LDO5 LDO
+  - "ti,twl6025-ldo6" for LDO6 LDO
+  - "ti,twl6025-ldo7" for LDO7 LDO
+  - "ti,twl6025-ldoln" for LDOLN LDO
+  - "ti,twl6025-ldousb" for LDOUSB LDO
+  - "ti,twl6025-smps3" for SMPS3 LDO
+  - "ti,twl6025-smps4" for SMPS4 LDO
+  - "ti,twl6025-vio" for VIO LDO
+For twl4030 regulators/LDOs
+- compatible:
+  - "ti,twl4030-vaux1" for VAUX1 LDO
+  - "ti,twl4030-vaux2" for VAUX2 LDO
+  - "ti,twl5030-vaux2" for VAUX2 LDO
+  - "ti,twl4030-vaux3" for VAUX3 LDO
+  - "ti,twl4030-vaux4" for VAUX4 LDO
+  - "ti,twl4030-vmmc1" for VMMC1 LDO
+  - "ti,twl4030-vmmc2" for VMMC2 LDO
+  - "ti,twl4030-vpll1" for VPLL1 LDO
+  - "ti,twl4030-vpll2" for VPLL2 LDO
+  - "ti,twl4030-vsim" for VSIM LDO
+  - "ti,twl4030-vdac" for VDAC LDO
+  - "ti,twl4030-vintana2" for VINTANA2 LDO
+  - "ti,twl4030-vio" for VIO LDO
+  - "ti,twl4030-vdd1" for VDD1 LDO
+  - "ti,twl4030-vdd2" for VDD2 LDO
+  - "ti,twl4030-vintana1" for VINTANA1 LDO
+  - "ti,twl4030-vintdig" for VINTDIG LDO
+  - "ti,twl4030-vusb1v5" for VUSB1V5 LDO
+  - "ti,twl4030-vusb1v8" for VUSB1V8 LDO
+  - "ti,twl4030-vusb3v1" for VUSB3V1 LDO
+
+Optional properties:
+- Any optional property defined in bindings/regulator/regulator.txt
+
+Example:
+
+   xyz: regulator@0 {
+   compatible = "ti,twl6030-vaux1";
+   regulator-min-microvolt  = <100>;
+   regulator-max-microvolt  = <300>;
+   };
diff --git a/drivers/regulator/twl-regulator.c 
b/drivers/regulator/twl-regulator.c
index 181a2cf..77808c7 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -14,8 +14,11 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
 
@@ -866,7 +869,8 @@ static struct regulator_ops twlsmps_ops = {
TWL_FIXED_LDO(label, offset, mVolts, 0x0, turnon_delay, \
0x0, TWL6030, twl6030fixed_ops)
 
-#define TWL4030_ADJUSTABLE_LDO(label, offset, num, turnon_delay, remap_conf) { 
\
+#define TWL4030_ADJUSTABLE_LDO(label, offset, num, turnon_delay, remap_conf) \
+static struct twlreg_info TWL4030_INFO_##label = { \
.base = offset, \
.id = num, \
.table_len = ARRAY_SIZE(label##_VSEL_table), \
@@ -884,7 +888,7 @@ static struct regulator_ops twlsmps_ops = {
}
 
 #define TWL4030_ADJUSTABLE_SMPS(label, offset, num, turnon_delay, remap_conf) \
-   { \
+static struct twlreg_info TWL4030_INFO_##label = { \
.base = offset, \
.id = num, \
.delay = turnon_delay, \
@@ -898,7 +902,8 @@ static struct regulator_ops twlsmps_ops = {
}, \
}
 
-#define TWL6030_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts) { \
+#define TWL6030_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts) \
+static struct twlreg_info TWL6030_INFO_##label = { \
.base = offset, \
.min_mV = min_mVolts, \
.max_mV = max_mVolts, \
@@ -912,7 +917,8 @@ static struct regulator_ops twlsmps_ops = {
}, \
}
 
-#define TWL6025_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts) { \
+#define TWL6025_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts) \
+static struct twlreg_info TWL6025_INFO_##label = { \
.base = offset, \
.min_mV = min_mVolts, \
.max_mV = max_mVolts, \
@@ -927,7 +933,8 @@ static struct regulator_ops twlsmps_ops = {
}
 
 #define TWL_FIXED_LDO(label, offset, mVolts, num, turnon_delay, re

Re: gcc: Thumb interworking and weakly linked functions

2012-02-23 Thread Ulrich Weigand
Aneesh V  wrote on 23.02.2012 11:27:40:

> > The "packed" attribute specifies that all struct elements ought to be
> > considered to have alignment requirement 1 instead of their default
> > alignment.  Thus the whole struct ends up having alignment requirement
1;
> > and since the section contains only a single variable of such struct
> > type, this is then also the alignment requirement of the section.
> >
>
> Hmm.. Thanks. Removing packed seems to help. The following also helped.
>
> @@ -34,7 +34,7 @@ struct pad_conf_entry {
>
>  u16 val;
>
> -} __attribute__ ((packed));
> +} __attribute__ ((packed)) __attribute__ ((aligned(2)));
>
> BTW, just for my understanding:
> The effect of adding __attribute__ ((packed)) to a structure is
> equivalent to adding it for each field in the structure, right?

Right.

> And because the first field doesn't have any alignment requirement,
> the struct also doesn't have any alignment requirement right?

Sort of.  The alignment requirement of the struct is the maximum
(actually, the least common multiple, but since we're talking only
powers of two, that amounts to the same) of the alignment requirements
of all members.  However, attribute packed for a struct applies to
each element separately, and thus each element has alignment
requirement 1, which is then also the maximum.


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand | Phone: +49-7031/16-3727
  STSM, GNU compiler and toolchain for Linux on System z and Cell/B.E.
  IBM Deutschland Research & Development GmbH
  Vorsitzende des Aufsichtsrats: Martina Koederitz | Geschäftsführung: Dirk
Wittkopp
  Sitz der Gesellschaft: Böblingen | Registergericht: Amtsgericht
Stuttgart, HRB 243294


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


[PATCH v2 3/4] arm/dts: OMAP4: Add mmc controller nodes and board data

2012-02-23 Thread Rajendra Nayak
Add omap mmc related device tree data for OMAP4.
Currenly limited to only omap4-panda and omap4-sdp
boards.

Signed-off-by: Rajendra Nayak 
---
 arch/arm/boot/dts/omap4-panda.dts |   10 ++
 arch/arm/boot/dts/omap4-sdp.dts   |   16 
 arch/arm/boot/dts/omap4.dtsi  |   31 +++
 3 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-panda.dts 
b/arch/arm/boot/dts/omap4-panda.dts
index 29646dc..9fe51b9 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -52,3 +52,13 @@
 &i2c4 {
clock-frequency = <40>;
 };
+
+&mmc1 {
+   vmmc-supply = <&vmmc>;
+   ti,bus-width = <8>;
+};
+
+&mmc5 {
+   ti,non-removable;
+   ti,bus-width = <4>;
+};
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 01db8b7..2fca7a3 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -70,3 +70,19 @@
reg = <0x1e>;
};
 };
+
+&mmc1 {
+   vmmc-supply = <&vmmc>;
+   ti,bus-width = <8>;
+};
+
+&mmc2 {
+   vmmc-supply = <&vaux1>;
+   ti,bus-width = <8>;
+   ti,non-removable;
+};
+
+&mmc5 {
+   ti,bus-width = <4>;
+   ti,non-removable;
+};
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 29f4589..9204f60 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -25,6 +25,11 @@
serial1 = &uart2;
serial2 = &uart3;
serial3 = &uart4;
+   mmc1 = &mmc1;
+   mmc2 = &mmc2;
+   mmc3 = &mmc3;
+   mmc4 = &mmc4;
+   mmc5 = &mmc5;
};
 
cpus {
@@ -155,5 +160,31 @@
#size-cells = <0>;
ti,hwmods = "i2c4";
};
+
+   mmc1: mmc@1 {
+   compatible = "ti,omap4-hsmmc";
+   ti,hwmods = "mmc1";
+   ti,dual-volt;
+   };
+
+   mmc2: mmc@2 {
+   compatible = "ti,omap4-hsmmc";
+   ti,hwmods = "mmc2";
+   };
+
+   mmc3: mmc@3 {
+   compatible = "ti,omap4-hsmmc";
+   ti,hwmods = "mmc3";
+   };
+
+   mmc4: mmc@4 {
+   compatible = "ti,omap4-hsmmc";
+   ti,hwmods = "mmc4";
+   };
+
+   mmc5: mmc@5 {
+   compatible = "ti,omap4-hsmmc";
+   ti,hwmods = "mmc5";
+   };
};
 };
-- 
1.7.1


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


[PATCH v2 1/4] mmc: omap_hsmmc: Convert hsmmc driver to use device tree

2012-02-23 Thread Rajendra Nayak
Define dt bindings for the ti-omap-hsmmc, and adapt
the driver to extract data (which was earlier passed as
platform_data) from device tree.

Signed-off-by: Rajendra Nayak 
---
 .../devicetree/bindings/mmc/ti-omap-hsmmc.txt  |   31 +
 drivers/mmc/host/omap_hsmmc.c  |   68 
 2 files changed, 99 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt

diff --git a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt 
b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
new file mode 100644
index 000..e4fa8f0
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
@@ -0,0 +1,31 @@
+* TI Highspeed MMC host controller for OMAP
+
+The Highspeed MMC Host Controller on TI OMAP family
+provides an interface for MMC, SD, and SDIO types of memory cards.
+
+Required properties:
+- compatible:
+ Should be "ti,omap2-hsmmc", for OMAP2/3 controllers
+ Should be "ti,omap4-hsmmc", for OMAP4 controllers
+- ti,hwmods: Must be "mmc", n is controller instance starting 1
+- reg : should contain hsmmc registers location and length
+
+Optional properties:
+ti,dual-volt: boolean, supports dual voltage cards
+-supply: phandle to the regulator device tree node
+"supply-name" examples are "vmmc", "vmmc_aux" etc
+ti,bus-width: Number of data lines, default assumed is 1 if the property is 
missing.
+cd-gpios: GPIOs for card detection
+wp-gpios: GPIOs for write protection
+ti,non-removable: non-removable slot (like eMMC)
+
+Example:
+   mmc1: mmc@0x4809c000 {
+   compatible = "ti,omap4-hsmmc";
+   reg = <0x4809c000 0x400>;
+   ti,hwmods = "mmc1";
+   ti,dual-volt;
+   ti,bus-width = <4>;
+   vmmc-supply = <&vmmc>; /* phandle to regulator node */
+   ti,non-removable;
+   };
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 35f6dc1..0c93d58 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -26,6 +26,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -1718,6 +1721,46 @@ static void omap_hsmmc_debugfs(struct mmc_host *mmc)
 
 #endif
 
+#ifdef CONFIG_OF
+static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
+{
+   struct omap_mmc_platform_data *pdata;
+   struct device_node *np = dev->of_node;
+   u32 bus_width;
+
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata)
+   return NULL; /* out of memory */
+
+   if (of_find_property(np, "ti,dual-volt", NULL))
+   pdata->controller_flags |= OMAP_HSMMC_SUPPORTS_DUAL_VOLT;
+
+   /* This driver only supports 1 slot */
+   pdata->nr_slots = 1;
+   pdata->slots[0].switch_pin = of_get_named_gpio(np, "cd-gpios", 0);
+   pdata->slots[0].gpio_wp = of_get_named_gpio(np, "wp-gpios", 0);
+
+   if (of_find_property(np, "ti,non-removable", NULL)) {
+   pdata->slots[0].nonremovable = true;
+   pdata->slots[0].no_regulator_off_init = true;
+   }
+   of_property_read_u32(np, "ti,bus-width", &bus_width);
+   if (bus_width == 4)
+   pdata->slots[0].caps |= MMC_CAP_4_BIT_DATA;
+   else if (bus_width == 8)
+   pdata->slots[0].caps |= MMC_CAP_8_BIT_DATA;
+   return pdata;
+}
+#else
+static inline struct omap_mmc_platform_data
+   *of_get_hsmmc_pdata(struct device *dev)
+{
+   return NULL;
+}
+#endif
+
+static const struct of_device_id omap_mmc_of_match[];
+
 static int __init omap_hsmmc_probe(struct platform_device *pdev)
 {
struct omap_mmc_platform_data *pdata = pdev->dev.platform_data;
@@ -1725,6 +1768,14 @@ static int __init omap_hsmmc_probe(struct 
platform_device *pdev)
struct omap_hsmmc_host *host = NULL;
struct resource *res;
int ret, irq;
+   const struct of_device_id *match;
+
+   match = of_match_device(omap_mmc_of_match, &pdev->dev);
+   if (match) {
+   pdata = of_get_hsmmc_pdata(&pdev->dev);
+   if (match->data)
+   pdata->reg_offset = *(u16 *)match->data;
+   }
 
if (pdata == NULL) {
dev_err(&pdev->dev, "Platform Data is missing\n");
@@ -2120,12 +2171,29 @@ static struct dev_pm_ops omap_hsmmc_dev_pm_ops = {
.runtime_resume = omap_hsmmc_runtime_resume,
 };
 
+#if defined(CONFIG_OF)
+static u16 omap4_reg_offset = 0x100;
+
+static const struct of_device_id omap_mmc_of_match[] = {
+   {
+   .compatible = "ti,omap2-hsmmc",
+   },
+   {
+   .compatible = "ti,omap4-hsmmc",
+   .data = &omap4_reg_offset,
+   },
+   {},
+}
+MODULE_DEVICE_TABLE(of, omap_mmc_of_match);
+#endif
+
 static struct platform_driver omap_hsmmc_driver = {
.remove = omap_hsmmc_remove,
.driver 

[PATCH v2 0/4] omap hsmmc device tree support

2012-02-23 Thread Rajendra Nayak
This series adds device tree support for OMAP hsmmc
driver. The series is dependent on a couple other series,
to add TWL regulator DT support[1] and another to clean
the pdev->id usage within the hsmmc driver[2]

all patches including the dependent series can be
found here
git://gitorious.org/omap-pm/linux.git for-dt/regulator

The series is tested on omap4sdp (both external and emmc),
omap4panda amd omap3beagle boards.

Things to do:
-1- Card detect isn't functional and needs twl4030 gpio
to be DT converted.
-2- pbias cell programming is missing and needs an OMAP
control module driver.

[1] http://marc.info/?l=linux-omap&m=132999699905180&w=2
[2] http://marc.info/?l=linux-omap&m=132999646604985&w=2

Rajendra Nayak (4):
  mmc: omap_hsmmc: Convert hsmmc driver to use device tree
  mmc: omap_hsmmc: Avoid a regulator voltage change with dt
  arm/dts: OMAP4: Add mmc controller nodes and board data
  arm/dts: OMAP3: Add mmc controller nodes and board data

 .../devicetree/bindings/mmc/ti-omap-hsmmc.txt  |   31 +++
 arch/arm/boot/dts/omap3-beagle.dts |6 ++
 arch/arm/boot/dts/omap3.dtsi   |   26 ++
 arch/arm/boot/dts/omap4-panda.dts  |   10 +++
 arch/arm/boot/dts/omap4-sdp.dts|   16 
 arch/arm/boot/dts/omap4.dtsi   |   31 +++
 drivers/mmc/host/omap_hsmmc.c  |   83 +++-
 7 files changed, 202 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt


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


[PATCH v2 2/4] mmc: omap_hsmmc: Avoid a regulator voltage change with dt

2012-02-23 Thread Rajendra Nayak
When booting with Device tree, the omap_hsmmc driver does not
program the pbias cell (inside OMAP control module) during
a regulator voltage change.
In case of non-dt boot, this is handled using callbacks
from within platform_data and implemented in machine code.
To be able to do this with device tree, without invoking
any machine code, a OMAP control module driver is needed
which is yet missing.

The pbias cell is used to provide a 1.8v or 3.0v reference
to the mmc/sd/sdio1 interface supporting both 1.8v and 3.0v
voltages.

Until a OMAP control module driver is available to handle this,
when booting with a device tree blob, never change the regulator
voltage which might then require a pbias cell re-program.
There are 2 instances where in the mmc regulator voltage can be
changed.
-1- when the regulator is turned OFF.
-2- when attempting a switch to 1.8v from 3.0v for dual volt cards

This patch avoids a voltage change in both cases when booting from
device tree, and hence compromises on power savings.
Once the OMAP control module driver is available and hsmmc driver
is modified to then do pbias programming even when booting
with device tree, these limitaions can be removed to achieve better
power savings.

Signed-off-by: Rajendra Nayak 
---
 drivers/mmc/host/omap_hsmmc.c |   15 ++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 0c93d58..dffde8d 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -245,6 +245,13 @@ static int omap_hsmmc_set_power(struct device *dev, int 
slot, int power_on,
 */
if (!host->vcc)
return 0;
+   /*
+* With DT, never turn OFF the regulator. This is because
+* the pbias cell programming support is still missing when
+* booting with Device tree
+*/
+   if (of_have_populated_dt() && !vdd)
+   return 0;
 
if (mmc_slot(host).before_set_reg)
mmc_slot(host).before_set_reg(dev, slot, power_on, vdd);
@@ -1537,7 +1544,13 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, 
struct mmc_ios *ios)
 * of external transceiver; but they all handle 1.8V.
 */
if ((OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET) &&
-   (ios->vdd == DUAL_VOLT_OCR_BIT)) {
+   (ios->vdd == DUAL_VOLT_OCR_BIT) &&
+   /*
+* With pbias cell programming missing, this
+* can't be allowed when booting with device
+* tree.
+*/
+   (!of_have_populated_dt())) {
/*
 * The mmc_select_voltage fn of the core does
 * not seem to set the power_mode to
-- 
1.7.1


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


[PATCH v2 4/4] arm/dts: OMAP3: Add mmc controller nodes and board data

2012-02-23 Thread Rajendra Nayak
Add omap mmc related device tree data for OMAP3.
Currenly limited to only omap3-beagle board.

Signed-off-by: Rajendra Nayak 
---
 arch/arm/boot/dts/omap3-beagle.dts |6 ++
 arch/arm/boot/dts/omap3.dtsi   |   26 ++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap3-beagle.dts 
b/arch/arm/boot/dts/omap3-beagle.dts
index 54556b1..c7b92e6 100644
--- a/arch/arm/boot/dts/omap3-beagle.dts
+++ b/arch/arm/boot/dts/omap3-beagle.dts
@@ -53,3 +53,9 @@
reg = <0x50>;
};
 };
+
+&mmc1 {
+   vmmc-supply = <&vmmc1>;
+   vmmc_aux-supply = <&vsim>;
+   ti,bus-width = <8>;
+};
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index ca37ba5..598467c 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -113,5 +113,31 @@
#size-cells = <0>;
ti,hwmods = "i2c3";
};
+
+   mmc1: mmc@1 {
+   compatible = "ti,omap2-hsmmc";
+   ti,hwmods = "mmc1";
+   ti,dual-volt;
+   };
+
+   mmc2: mmc@2 {
+   compatible = "ti,omap2-hsmmc";
+   ti,hwmods = "mmc2";
+   };
+
+   mmc3: mmc@3 {
+   compatible = "ti,omap2-hsmmc";
+   ti,hwmods = "mmc3";
+   };
+
+   mmc4: mmc@4 {
+   compatible = "ti,omap2-hsmmc";
+   ti,hwmods = "mmc4";
+   };
+
+   mmc5: mmc@5 {
+   compatible = "ti,omap2-hsmmc";
+   ti,hwmods = "mmc5";
+   };
};
 };
-- 
1.7.1


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


Re: [PATCH v2 0/4] omap hsmmc device tree support

2012-02-23 Thread Rajendra Nayak

On Thursday 23 February 2012 05:31 PM, Rajendra Nayak wrote:

This series adds device tree support for OMAP hsmmc
driver. The series is dependent on a couple other series,
to add TWL regulator DT support[1] and another to clean
the pdev->id usage within the hsmmc driver[2]

all patches including the dependent series can be
found here
git://gitorious.org/omap-pm/linux.git for-dt/regulator


sorry, the right branch is for-dt/mmc



The series is tested on omap4sdp (both external and emmc),
omap4panda amd omap3beagle boards.

Things to do:
-1- Card detect isn't functional and needs twl4030 gpio
to be DT converted.
-2- pbias cell programming is missing and needs an OMAP
control module driver.

[1] http://marc.info/?l=linux-omap&m=132999699905180&w=2
[2] http://marc.info/?l=linux-omap&m=132999646604985&w=2

Rajendra Nayak (4):
   mmc: omap_hsmmc: Convert hsmmc driver to use device tree
   mmc: omap_hsmmc: Avoid a regulator voltage change with dt
   arm/dts: OMAP4: Add mmc controller nodes and board data
   arm/dts: OMAP3: Add mmc controller nodes and board data

  .../devicetree/bindings/mmc/ti-omap-hsmmc.txt  |   31 +++
  arch/arm/boot/dts/omap3-beagle.dts |6 ++
  arch/arm/boot/dts/omap3.dtsi   |   26 ++
  arch/arm/boot/dts/omap4-panda.dts  |   10 +++
  arch/arm/boot/dts/omap4-sdp.dts|   16 
  arch/arm/boot/dts/omap4.dtsi   |   31 +++
  drivers/mmc/host/omap_hsmmc.c  |   83 +++-
  7 files changed, 202 insertions(+), 1 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt




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


Re: gcc: Thumb interworking and weakly linked functions

2012-02-23 Thread Richard Earnshaw
On 23/02/12 10:27, Aneesh V wrote:
> Ok. Agree. I never used to use %function when I wrote assembly
> functions earlier. I am sure a lot of code will break if this was
> enforced.

If you've not used %function on ARM, then your code is semantically
broken even if it isn't syntactically broken.

The ABI rules for dealing with interworking and and out-of-range
branches all rely on %function being used correctly.

R.


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


Re: [PATCH v3 1/2] regulator: twl: adapt twl-regulator driver to dt

2012-02-23 Thread Mark Brown
On Thu, Feb 23, 2012 at 05:05:53PM +0530, Rajendra Nayak wrote:
> Modify the twl regulator driver to extract the regulator_init_data from
> device tree when passed, instead of getting it through platform_data
> structures (on non-DT builds)

This doesn't apply to current -next, I expect because of the SMPS
regulator changes which went in.  Please always submit patches against
-next.  There's also a patch from Tero adding support for some
additional regulators which is floating around and would conflict with
this.  Could you guys please coordinate with each other on this?


signature.asc
Description: Digital signature
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH-WIP 02/13] xen/arm: introduce privcmp, physdev_op and memory_op hypercalls.

2012-02-23 Thread Stefano Stabellini
Signed-off-by: Stefano Stabellini 
---
 arch/arm/include/asm/xen/hypercall.h |   24 
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/xen/hypercall.h 
b/arch/arm/include/asm/xen/hypercall.h
index 04eba1c..5abba48 100644
--- a/arch/arm/include/asm/xen/hypercall.h
+++ b/arch/arm/include/asm/xen/hypercall.h
@@ -187,4 +187,28 @@ HYPERVISOR_event_channel_op(int cmd, void *arg)
return _hypercall2(int, HYPERCALL(event_channel_op), cmd, arg);
 }
 
+static inline unsigned long HYPERVISOR_hvm_op(int op, void *arg)
+{
+   return -ENOSYS;
+}
+
+static inline int
+HYPERVISOR_memory_op(unsigned int cmd, void *arg)
+{
+   return _hypercall2(int, HYPERCALL(memory_op), cmd, arg);
+}
+
+static inline int HYPERVISOR_physdev_op(int cmd, void *arg)
+{
+   return _hypercall2(int, HYPERCALL(physdev_op), cmd, arg);
+}
+
+static inline long privcmd_call(unsigned call,
+   unsigned long a1, unsigned long a2,
+   unsigned long a3, unsigned long a4,
+   unsigned long a5)
+{
+   return _hypercall5(long, call, a1, a2, a3, a4, a5);
+}
+
 #endif /* _ASM_ARM_XEN_HYPERCALL_H */
-- 
1.7.2.5


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


[PATCH-WIP 03/13] xen/arm: mmu.h and page.h related definitions

2012-02-23 Thread Stefano Stabellini
Signed-off-by: Stefano Stabellini 
---
 arch/arm/include/asm/xen/mmu.h  |   61 +++
 arch/arm/include/asm/xen/page.h |   14 +++--
 2 files changed, 72 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/include/asm/xen/mmu.h

diff --git a/arch/arm/include/asm/xen/mmu.h b/arch/arm/include/asm/xen/mmu.h
new file mode 100644
index 000..23e9962
--- /dev/null
+++ b/arch/arm/include/asm/xen/mmu.h
@@ -0,0 +1,61 @@
+#ifndef _ASM_ARM_XEN_MMU_H
+#define _ASM_ARM_XEN_MMU_H
+
+#include 
+#include 
+#include 
+
+/* Xen machine address */
+typedef struct xmaddr {
+   phys_addr_t maddr;
+} xmaddr_t;
+
+/* Xen pseudo-physical address */
+typedef struct xpaddr {
+   phys_addr_t paddr;
+} xpaddr_t;
+
+#define XMADDR(x)  ((xmaddr_t) { .maddr = (x) })
+#define XPADDR(x)  ((xpaddr_t) { .paddr = (x) })
+
+static inline xmaddr_t phys_to_machine(xpaddr_t phys)
+{
+   unsigned offset = phys.paddr & ~PAGE_MASK;
+   return XMADDR(PFN_PHYS(pfn_to_mfn(PFN_DOWN(phys.paddr))) | offset);
+}
+
+static inline xpaddr_t machine_to_phys(xmaddr_t machine)
+{
+   unsigned offset = machine.maddr & ~PAGE_MASK;
+   return XPADDR(PFN_PHYS(mfn_to_pfn(PFN_DOWN(machine.maddr))) | offset);
+}
+/* VIRT <-> MACHINE conversion */
+#define virt_to_machine(v) (phys_to_machine(XPADDR(__pa(v
+#define virt_to_pfn(v)  (PFN_DOWN(__pa(v)))
+#define virt_to_mfn(v) (pfn_to_mfn(virt_to_pfn(v)))
+#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
+
+static inline xmaddr_t arbitrary_virt_to_machine(void *vaddr)
+{
+   /* XXX: assuming it is mapped in the kernel 1:1 */
+   return virt_to_machine(vaddr);
+}
+
+/* XXX: this shouldn't be here */
+static inline pte_t *lookup_address(unsigned long address, unsigned int *level)
+{
+   BUG();
+   return NULL;
+}
+
+static inline int m2p_add_override(unsigned long mfn, struct page *page,
+   struct gnttab_map_grant_ref *kmap_op)
+{
+   return 0;
+}
+
+static inline int m2p_remove_override(struct page *page, bool clear_pte)
+{
+   return 0;
+}
+#endif
diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h
index 17bfb55..5ee3dbe 100644
--- a/arch/arm/include/asm/xen/page.h
+++ b/arch/arm/include/asm/xen/page.h
@@ -1,8 +1,16 @@
 #ifndef _ASM_ARM_XEN_PAGE_H
 #define _ASM_ARM_XEN_PAGE_H
 
-#define mfn_to_virt(m) (~0)
-#define mfn_to_pfn(m)  (~0)
-#define pfn_to_mfn(m)  (~0)
+#include 
+#include 
+#include 
+
+#define pfn_to_mfn(pfn)(pfn)
+#define phys_to_machine_mapping_valid  (1)
+#define mfn_to_pfn(mfn)(mfn)
+#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
+
+#define pte_mfnpte_pfn
+#define mfn_ptepfn_pte
 
 #endif /* _ASM_ARM_XEN_PAGE_H */
-- 
1.7.2.5


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


[PATCH-WIP 05/13] xen/arm: empty implementation of grant_table arch specific functions

2012-02-23 Thread Stefano Stabellini
Signed-off-by: Stefano Stabellini 
---
 arch/arm/xen/Makefile  |2 +-
 arch/arm/xen/grant-table.c |   47 
 2 files changed, 48 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/xen/grant-table.c

diff --git a/arch/arm/xen/Makefile b/arch/arm/xen/Makefile
index 0bad594..563f22a 100644
--- a/arch/arm/xen/Makefile
+++ b/arch/arm/xen/Makefile
@@ -1 +1 @@
-obj-y  := enlighten.o
+obj-y  := enlighten.o grant-table.o
diff --git a/arch/arm/xen/grant-table.c b/arch/arm/xen/grant-table.c
new file mode 100644
index 000..b82a799
--- /dev/null
+++ b/arch/arm/xen/grant-table.c
@@ -0,0 +1,47 @@
+/**
+ * grant_table.c
+ * ARM specific part
+ *
+ * Granting foreign access to our memory reservation.
+ *
+ * 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; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include 
+#include 
+#include 
+
+int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes,
+  unsigned long max_nr_gframes,
+  struct grant_entry **__shared)
+{
+   return -1;
+}
+
+void arch_gnttab_unmap_shared(struct grant_entry *shared,
+ unsigned long nr_gframes)
+{
+   return;
+}
-- 
1.7.2.5


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


[PATCH-WIP 04/13] xen/arm: sync_bitops

2012-02-23 Thread Stefano Stabellini
sync_bitops functions are equivalent to the SMP implementation of the
original functions, independently from CONFIG_SMP being defined.

Signed-off-by: Stefano Stabellini 
---
 arch/arm/include/asm/sync_bitops.h |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/sync_bitops.h

diff --git a/arch/arm/include/asm/sync_bitops.h 
b/arch/arm/include/asm/sync_bitops.h
new file mode 100644
index 000..2b51456
--- /dev/null
+++ b/arch/arm/include/asm/sync_bitops.h
@@ -0,0 +1,17 @@
+#ifndef __ASM_SYNC_BITOPS_H__
+#define __ASM_SYNC_BITOPS_H__
+
+#include 
+#include 
+
+#define sync_set_bit(nr,p) _set_bit(nr,p)
+#define sync_clear_bit(nr,p)   _clear_bit(nr,p)
+#define sync_change_bit(nr,p)  _change_bit(nr,p)
+#define sync_test_and_set_bit(nr,p)_test_and_set_bit(nr,p)
+#define sync_test_and_clear_bit(nr,p)  _test_and_clear_bit(nr,p)
+#define sync_test_and_change_bit(nr,p) _test_and_change_bit(nr,p)
+#define sync_test_bit(nr, addr)test_bit(nr, addr)
+#define sync_cmpxchg   cmpxchg
+
+
+#endif
-- 
1.7.2.5


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


[PATCH-WIP 10/13] xen/arm: empty implementation of xen_remap_domain_mfn_range

2012-02-23 Thread Stefano Stabellini
Signed-off-by: Stefano Stabellini 
---
 arch/arm/xen/enlighten.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index d76f3b4e..986bec3 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -25,6 +25,16 @@ EXPORT_SYMBOL_GPL(xen_have_vector_callback);
 int xen_platform_pci_unplug;
 EXPORT_SYMBOL_GPL(xen_platform_pci_unplug);
 
+/* TODO */
+int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
+  unsigned long addr,
+  unsigned long mfn, int nr,
+  pgprot_t prot, unsigned domid)
+{
+   return -ENOSYS;
+}
+EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);
+
 void __ref xen_hvm_init_shared_info(void)
 {
int cpu;
-- 
1.7.2.5


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


[PATCH-WIP 06/13] xen/arm: missing includes

2012-02-23 Thread Stefano Stabellini
Signed-off-by: Stefano Stabellini 
---
 arch/arm/include/asm/xen/grant_table.h |2 ++
 drivers/xen/grant-table.c  |2 ++
 drivers/xen/xenbus/xenbus_client.c |1 +
 drivers/xen/xenbus/xenbus_probe_frontend.c |1 +
 drivers/xen/xenfs/xenstored.c  |1 +
 include/xen/privcmd.h  |1 +
 6 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/xen/grant_table.h 
b/arch/arm/include/asm/xen/grant_table.h
index 4e3f7b2..43c0d4b 100644
--- a/arch/arm/include/asm/xen/grant_table.h
+++ b/arch/arm/include/asm/xen/grant_table.h
@@ -1,6 +1,8 @@
 #ifndef _ASM_ARM_XEN_GRANT_TABLE_H
 #define _ASM_ARM_XEN_GRANT_TABLE_H
 
+#include 
+
 #define xen_alloc_vm_area(size)alloc_vm_area(size)
 #define xen_free_vm_area(area) free_vm_area(area)
 
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index bf1c094..de77304 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -45,6 +45,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
diff --git a/drivers/xen/xenbus/xenbus_client.c 
b/drivers/xen/xenbus/xenbus_client.c
index 1906125..65088964 100644
--- a/drivers/xen/xenbus/xenbus_client.c
+++ b/drivers/xen/xenbus/xenbus_client.c
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c 
b/drivers/xen/xenbus/xenbus_probe_frontend.c
index 2f73195..e8d1798 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
diff --git a/drivers/xen/xenfs/xenstored.c b/drivers/xen/xenfs/xenstored.c
index fef20db..ddf2585 100644
--- a/drivers/xen/xenfs/xenstored.c
+++ b/drivers/xen/xenfs/xenstored.c
@@ -4,6 +4,7 @@
 #include 
 
 #include 
+#include 
 
 #include "xenfs.h"
 #include "../xenbus/xenbus_comms.h"
diff --git a/include/xen/privcmd.h b/include/xen/privcmd.h
index 17857fb..4d58881 100644
--- a/include/xen/privcmd.h
+++ b/include/xen/privcmd.h
@@ -35,6 +35,7 @@
 
 #include 
 #include 
+#include 
 
 typedef unsigned long xen_pfn_t;
 
-- 
1.7.2.5


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


[PATCH-WIP 00/13] xen/arm: receive Xen events and initialize xenbus

2012-02-23 Thread Stefano Stabellini
Hi all,
this patch series is part of the work in progress support for Xen on
ARMv7 with virtualization extensions in Linux.

It is obviously NOT ready to be accepted upstream but implements
enough support to allow Linux Dom0 to receive event channel
notifications and initialize xenbus.
With this series applied and the corresponding Xen patch series
(http://marc.info/?l=xen-devel&m=133001696312879) is possible to boot
Linux as Dom0 on Xen on a Versatile Express Cortex A15 emulator and
issue basic xl commands, like "xl list" and "xl uptime".
"xl create" is still not working though but it is the next on the list
:)


Working on this series it became obvious that passing the hypercall
number as IMM parameter to HVC is not flexible enough because we don't
always know the hypercall number at compile time.
As a result I changed the hypercall.h header file to use r12 to pass the
hypercall number instead. r12 was chosen because it is defined as
"intra-procedure call scratch register" so it seems the most appropriate. 

I have CC'ed the KVM list on the first patch because following previous
discussions hypercall.h might become a common header file to issue
hypercalls on different hypervisors on ARM. I haven't disentangled the
Xen specific bits from the generic ones yet, however it should be
straightforward.

I am looking forward to hearing your opinions, especially on the
hypercall calling convention.


The patch series is available here:

git://xenbits.xen.org/people/sstabellini/linux-pvhvm.git xenarmv7-1

It is based on the vexpress-dt branch of
git://xenbits.xen.org/people/dvrabel/linux.git, that we are currently
using as development tree for Linux on Xen on Cortex A15.  See
http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions.


The list of patches with diffstat follows:

Stefano Stabellini (13):
  xen/arm: use r12 to pass the hypercall number to the hypervisor
  xen/arm: introduce privcmp, physdev_op and memory_op hypercalls.
  xen/arm: mmu.h and page.h related definitions
  xen/arm: sync_bitops
  xen/arm: empty implementation of grant_table arch specific functions
  xen/arm: missing includes
  xen/arm: receive xen events on arm
  xen/arm: fix arm xen guest handle definitions
  xen/arm: shared_info and start_info
  xen/arm: empty implementation of xen_remap_domain_mfn_range
  xen/arm: Introduce xen_pfn_t for pfn and mfn types
  xen/arm: compile and run xenbus
  xen/arm: compile grant-table features events and xenbus, do not compile 
pci

 arch/arm/Kconfig   |4 +
 arch/arm/include/asm/sync_bitops.h |   17 
 arch/arm/include/asm/xen/events.h  |9 ++
 arch/arm/include/asm/xen/grant_table.h |2 +
 arch/arm/include/asm/xen/hypercall.h   |  111 ++--
 arch/arm/include/asm/xen/interface.h   |   12 +--
 arch/arm/include/asm/xen/mmu.h |   61 +++
 arch/arm/include/asm/xen/page.h|   14 +++-
 arch/arm/xen/Makefile  |2 +-
 arch/arm/xen/enlighten.c   |   71 --
 arch/arm/xen/grant-table.c |   47 
 arch/ia64/include/asm/xen/interface.h  |3 +-
 arch/x86/include/asm/xen/interface.h   |3 +
 drivers/xen/Makefile   |7 +-
 drivers/xen/events.c   |   36 +-
 drivers/xen/grant-table.c  |2 +
 drivers/xen/xenbus/xenbus_client.c |1 +
 drivers/xen/xenbus/xenbus_comms.c  |2 +-
 drivers/xen/xenbus/xenbus_probe.c  |   26 ---
 drivers/xen/xenbus/xenbus_probe_frontend.c |1 +
 drivers/xen/xenbus/xenbus_xs.c |3 +-
 drivers/xen/xenfs/xenstored.c  |1 +
 include/xen/interface/grant_table.h|4 +-
 include/xen/interface/memory.h |6 +-
 include/xen/interface/platform.h   |4 +-
 include/xen/interface/xen.h|6 +-
 include/xen/privcmd.h  |3 +-
 include/xen/xen.h  |2 +-
 28 files changed, 371 insertions(+), 89 deletions(-)


Cheers,

Stefano

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


[PATCH-WIP 08/13] xen/arm: fix arm xen guest handle definitions

2012-02-23 Thread Stefano Stabellini
__XEN__ is never defined in Linux: remove non-relevant functions and
macros

Signed-off-by: Stefano Stabellini 
---
 arch/arm/include/asm/xen/interface.h |9 +
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/arch/arm/include/asm/xen/interface.h 
b/arch/arm/include/asm/xen/interface.h
index 93b0139..2ee39e8 100644
--- a/arch/arm/include/asm/xen/interface.h
+++ b/arch/arm/include/asm/xen/interface.h
@@ -9,27 +9,20 @@
 
 #include 
 
-#ifdef __XEN__
-#define __DEFINE_GUEST_HANDLE(name, type) \
-typedef struct { type *p; } __guest_handle_ ## name
-#else
 #define __DEFINE_GUEST_HANDLE(name, type) \
 typedef type * __guest_handle_ ## name
-#endif
 
 #define DEFINE_GUEST_HANDLE_STRUCT(name) \
__DEFINE_GUEST_HANDLE(name, struct name)
 #define DEFINE_GUEST_HANDLE(name) __DEFINE_GUEST_HANDLE(name, name)
 #define GUEST_HANDLE(name)__guest_handle_ ## name
 
-#ifdef __XEN__
 #define set_xen_guest_handle(hnd, val) \
do {\
if (sizeof(hnd) == 8)   \
*(uint64_t *)&(hnd) = 0;\
-   (hnd).p = val;  \
+   (hnd) = val;\
} while (0)
-#endif
 
 #ifndef __ASSEMBLY__
 /* Guest handles for primitive C types. */
-- 
1.7.2.5


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


[PATCH-WIP 09/13] xen/arm: shared_info and start_info

2012-02-23 Thread Stefano Stabellini
Allow xen_hvm_domain's to be xen_initial_domain.

Set xen_domain_type to XEN_HVM_DOMAIN.

Set xen_start_info to an empty struct, set flags to SIF_INITDOMAIN and
SIF_PRIVILEGED so that we identify as initial domain by default.

Map the real shared info page using XENMEM_add_to_physmap with
XENMAPSPACE_shared_info.

Signed-off-by: Stefano Stabellini 
---
 arch/arm/xen/enlighten.c |   61 --
 include/xen/xen.h|2 +-
 2 files changed, 54 insertions(+), 9 deletions(-)

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 39ef68c..d76f3b4e 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -1,24 +1,69 @@
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 
-struct start_info *xen_start_info;
+struct start_info _xen_start_info = { .flags = (SIF_INITDOMAIN|SIF_PRIVILEGED) 
};
+struct start_info *xen_start_info = &_xen_start_info;
 EXPORT_SYMBOL_GPL(xen_start_info);
 
-enum xen_domain_type xen_domain_type = XEN_NATIVE;
+enum xen_domain_type xen_domain_type = XEN_HVM_DOMAIN;
 EXPORT_SYMBOL_GPL(xen_domain_type);
 
+struct shared_info xen_dummy_shared_info;
+struct shared_info *HYPERVISOR_shared_info = (void *)&xen_dummy_shared_info;
 
-/* TODO: remove these functions below and use the real implementation
- * instead
- */
-void rebind_evtchn_irq(int evtchn, int irq)
+DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
+
+/* XXX: to be removed */
+__read_mostly int xen_have_vector_callback;
+EXPORT_SYMBOL_GPL(xen_have_vector_callback);
+
+/* XXX: to be removed */
+int xen_platform_pci_unplug;
+EXPORT_SYMBOL_GPL(xen_platform_pci_unplug);
+
+void __ref xen_hvm_init_shared_info(void)
 {
+   int cpu;
+   struct xen_add_to_physmap xatp;
+   static struct shared_info *shared_info_page = 0;
+
+   if (!shared_info_page)
+   shared_info_page = (struct shared_info *)
+   get_zeroed_page(GFP_KERNEL);
+   if (!shared_info_page) {
+   printk(KERN_ERR "not enough memory");
+   return;
+   }
+   xatp.domid = DOMID_SELF;
+   xatp.idx = 0;
+   xatp.space = XENMAPSPACE_shared_info;
+   xatp.gpfn = __pa(shared_info_page) >> PAGE_SHIFT;
+   if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
+   BUG();
+
+   HYPERVISOR_shared_info = (struct shared_info *)shared_info_page;
+
+   /* xen_vcpu is a pointer to the vcpu_info struct in the shared_info
+* page, we use it in the event channel upcall and in some pvclock
+* related functions. We don't need the vcpu_info placement
+* optimizations because we don't use any pv_mmu or pv_irq op on
+* HVM.
+* When xen_hvm_init_shared_info is run at boot time only vcpu 0 is
+* online but xen_hvm_init_shared_info is run at resume time too and
+* in that case multiple vcpus might be online. */
+   for_each_online_cpu(cpu) {
+   per_cpu(xen_vcpu, cpu) = 
&HYPERVISOR_shared_info->vcpu_info[cpu];
+   }
 }
 
-int bind_evtchn_to_irq(unsigned int evtchn)
+static int __init xen_hvm_guest_init(void)
 {
+   xen_hvm_init_shared_info();
return 0;
 }
-EXPORT_SYMBOL_GPL(bind_evtchn_to_irq);
+
+core_initcall(xen_hvm_guest_init);
diff --git a/include/xen/xen.h b/include/xen/xen.h
index a164024..2c0d3a5 100644
--- a/include/xen/xen.h
+++ b/include/xen/xen.h
@@ -23,7 +23,7 @@ extern enum xen_domain_type xen_domain_type;
 #include 
 #include 
 
-#define xen_initial_domain()   (xen_pv_domain() && \
+#define xen_initial_domain()   (xen_domain() && \
 xen_start_info->flags & SIF_INITDOMAIN)
 #else  /* !CONFIG_XEN_DOM0 */
 #define xen_initial_domain()   (0)
-- 
1.7.2.5


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


[PATCH-WIP 07/13] xen/arm: receive xen events on arm

2012-02-23 Thread Stefano Stabellini
Compile events.c and use IRQ 32 to receive events notifications.

Signed-off-by: Stefano Stabellini 
---
 arch/arm/include/asm/xen/events.h |9 +
 drivers/xen/events.c  |   36 +++-
 2 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/arch/arm/include/asm/xen/events.h 
b/arch/arm/include/asm/xen/events.h
index efa7c61..94b4e90 100644
--- a/arch/arm/include/asm/xen/events.h
+++ b/arch/arm/include/asm/xen/events.h
@@ -1,9 +1,18 @@
 #ifndef _ASM_ARM_XEN_EVENTS_H
 #define _ASM_ARM_XEN_EVENTS_H
 
+#include 
+
 enum ipi_vector {
+   XEN_PLACEHOLDER_VECTOR,
+
/* Xen IPIs go here */
XEN_NR_IPIS,
 };
 
+static inline int xen_irqs_disabled(struct pt_regs *regs)
+{
+   return raw_irqs_disabled_flags(regs->ARM_cpsr);
+}
+
 #endif /* _ASM_ARM_XEN_EVENTS_H */
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 6e075cd..18139ee 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -31,13 +31,15 @@
 #include 
 #include 
 
+#ifdef CONFIG_X86
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
+#endif
+#include 
 #include 
 #include 
 
@@ -49,6 +51,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 /*
  * This lock protects updates to the following mapping and reference-count
@@ -801,10 +805,12 @@ EXPORT_SYMBOL_GPL(xen_pirq_from_irq);
 int bind_evtchn_to_irq(unsigned int evtchn)
 {
int irq;
+   struct irq_desc *desc;
 
mutex_lock(&irq_mapping_update_lock);
 
irq = evtchn_to_irq[evtchn];
+   irq_clear_status_flags(irq, IRQ_NOREQUEST);
 
if (irq == -1) {
irq = xen_allocate_irq_dynamic();
@@ -813,6 +819,8 @@ int bind_evtchn_to_irq(unsigned int evtchn)
 
irq_set_chip_and_handler_name(irq, &xen_dynamic_chip,
  handle_edge_irq, "event");
+   desc = irq_to_desc(irq);
+   irq_clear_status_flags(irq, IRQ_NOREQUEST);
 
xen_irq_info_evtchn_init(irq, evtchn);
}
@@ -1282,7 +1290,9 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
 {
struct pt_regs *old_regs = set_irq_regs(regs);
 
+#ifdef CONFIG_X86
exit_idle();
+#endif
irq_enter();
 
__xen_evtchn_do_upcall();
@@ -1707,6 +1717,7 @@ void __init xen_init_IRQ(void)
for (i = 0; i < NR_EVENT_CHANNELS; i++)
mask_evtchn(i);
 
+#ifdef CONFIG_X86
if (xen_hvm_domain()) {
xen_callback_vector();
native_init_IRQ();
@@ -1718,4 +1729,27 @@ void __init xen_init_IRQ(void)
if (xen_initial_domain())
pci_xen_initial_domain();
}
+#endif
 }
+#ifdef CONFIG_ARM
+#define IRQ_EVTCHN_CALLBACK 63
+irqreturn_t xen_arm_callback(int irq, void *arg)
+{
+   __xen_evtchn_do_upcall();
+   return 0;
+}
+
+int __init xen_init_IRQ_arm(void)
+{
+   int rc;
+   xen_init_IRQ();
+   rc = request_irq(IRQ_EVTCHN_CALLBACK, xen_arm_callback,
+   IRQF_DISABLED | IRQF_NOBALANCING | IRQF_TRIGGER_RISING,
+   "events", "events");
+   if (rc) {
+   printk(KERN_ERR "Error requesting IRQ %d\n", 
IRQ_EVTCHN_CALLBACK);
+   }
+   return rc;
+}
+core_initcall(xen_init_IRQ_arm);
+#endif
-- 
1.7.2.5


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


[PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-23 Thread Stefano Stabellini
We need a register to pass the hypercall number because we might not
know it at compile time and HVC only takes an immediate argument.

Among the available registers r12 seems to be the best choice because it
is defined as "intra-procedure call scratch register".

Use the ISS to pass an hypervisor specific tag.

Signed-off-by: Stefano Stabellini 
CC: k...@vger.kernel.org
---
 arch/arm/include/asm/xen/hypercall.h |   87 +++---
 1 files changed, 48 insertions(+), 39 deletions(-)

diff --git a/arch/arm/include/asm/xen/hypercall.h 
b/arch/arm/include/asm/xen/hypercall.h
index 404e63f0..04eba1c 100644
--- a/arch/arm/include/asm/xen/hypercall.h
+++ b/arch/arm/include/asm/xen/hypercall.h
@@ -33,13 +33,17 @@
 #ifndef _ASM_ARM_XEN_HYPERCALL_H
 #define _ASM_ARM_XEN_HYPERCALL_H
 
-#define __HVC_IMM(name)"( " #name " & 0xf) + "   \
-   "((" #name " << 4) & 0xfff00)"
+#include 
+#include 
 
-#define HYPERCALL(name) ".word 0xe1400070 + " __HVC_IMM(name)
-#define __HYPERCALL(name) HYPERCALL(__HYPERVISOR_##name)
+#define XEN_HYPERCALL_TAG  "0XEA1"
+
+#define __HVC_IMM(tag) "( " tag " & 0xf) + " \
+   "((" tag " << 4) & 0xfff00)"
+#define __HYPERCALL ".word 0xe1400070 + " __HVC_IMM(XEN_HYPERCALL_TAG)
 
 #define __HYPERCALL_RETREG "r0"
+#define __HYPERCALL_NUMBER "r12"
 #define __HYPERCALL_ARG1REG"r0"
 #define __HYPERCALL_ARG2REG"r1"
 #define __HYPERCALL_ARG3REG"r2"
@@ -48,30 +52,32 @@
 
 #define __HYPERCALL_DECLS  \
register unsigned long __res  asm(__HYPERCALL_RETREG);  \
+   register unsigned long __num  asm(__HYPERCALL_NUMBER) = __num; \
register unsigned long __arg1 asm(__HYPERCALL_ARG1REG) = __arg1; \
register unsigned long __arg2 asm(__HYPERCALL_ARG2REG) = __arg2; \
register unsigned long __arg3 asm(__HYPERCALL_ARG3REG) = __arg3; \
register unsigned long __arg4 asm(__HYPERCALL_ARG4REG) = __arg4; \
register unsigned long __arg5 asm(__HYPERCALL_ARG5REG) = __arg5;
 
-#define __HYPERCALL_0PARAM "=r" (__res)
+#define __HYPERCALL_0PARAM "=r" (__res), "+r" (__num)
 #define __HYPERCALL_1PARAM __HYPERCALL_0PARAM, "+r" (__arg1)
 #define __HYPERCALL_2PARAM __HYPERCALL_1PARAM, "+r" (__arg2)
 #define __HYPERCALL_3PARAM __HYPERCALL_2PARAM, "+r" (__arg3)
 #define __HYPERCALL_4PARAM __HYPERCALL_3PARAM, "+r" (__arg4)
 #define __HYPERCALL_5PARAM __HYPERCALL_4PARAM, "+r" (__arg5)
 
-#define __HYPERCALL_0ARG()
-#define __HYPERCALL_1ARG(a1)   \
-   __HYPERCALL_0ARG()  __arg1 = (unsigned long)(a1);
-#define __HYPERCALL_2ARG(a1,a2)
\
-   __HYPERCALL_1ARG(a1)__arg2 = (unsigned long)(a2);
-#define __HYPERCALL_3ARG(a1,a2,a3) \
-   __HYPERCALL_2ARG(a1,a2) __arg3 = (unsigned long)(a3);
-#define __HYPERCALL_4ARG(a1,a2,a3,a4)  \
-   __HYPERCALL_3ARG(a1,a2,a3)  __arg4 = (unsigned long)(a4);
-#define __HYPERCALL_5ARG(a1,a2,a3,a4,a5)   \
-   __HYPERCALL_4ARG(a1,a2,a3,a4)   __arg5 = (unsigned long)(a5);
+#define __HYPERCALL_0ARG(hypercall)
\
+   __num = (unsigned long)hypercall;
+#define __HYPERCALL_1ARG(hypercall,a1) 
\
+   __HYPERCALL_0ARG(hypercall) __arg1 = (unsigned long)(a1);
+#define __HYPERCALL_2ARG(hypercall,a1,a2)  
\
+   __HYPERCALL_1ARG(hypercall,a1)  __arg2 = (unsigned long)(a2);
+#define __HYPERCALL_3ARG(hypercall,a1,a2,a3)   
\
+   __HYPERCALL_2ARG(hypercall,a1,a2)   __arg3 = (unsigned 
long)(a3);
+#define __HYPERCALL_4ARG(hypercall,a1,a2,a3,a4)
\
+   __HYPERCALL_3ARG(hypercall,a1,a2,a3)__arg4 = (unsigned long)(a4);
+#define __HYPERCALL_5ARG(hypercall,a1,a2,a3,a4,a5) 
\
+   __HYPERCALL_4ARG(hypercall,a1,a2,a3,a4) __arg5 = (unsigned long)(a5);
 
 #define __HYPERCALL_CLOBBER5   "memory"
 #define __HYPERCALL_CLOBBER4   __HYPERCALL_CLOBBER5, __HYPERCALL_ARG5REG
@@ -80,102 +86,105 @@
 #define __HYPERCALL_CLOBBER1   __HYPERCALL_CLOBBER2, __HYPERCALL_ARG2REG
 #define __HYPERCALL_CLOBBER0   __HYPERCALL_CLOBBER1, __HYPERCALL_ARG1REG
 
-#define _hypercall0(type, name)
\
+#define _hypercall0(type, hypercall)   
\
 ({ \
__HYPERCALL_DECLS;  \
-   __HYPERCALL_0ARG(); \
-   asm volatile (__HYPERCALL(name)  

[PATCH-WIP 12/13] xen/arm: compile and run xenbus

2012-02-23 Thread Stefano Stabellini
bind_evtchn_to_irqhandler can legitimately return 0 (irq 0), it is not
an error.

If Linux is running as an HVM domain and is running as Dom0, use
xenstored_local_init to initialize the xenstore page and event channel,
and do not call xs_reset_watches at boot.

Signed-off-by: Stefano Stabellini 
---
 drivers/xen/xenbus/xenbus_comms.c |2 +-
 drivers/xen/xenbus/xenbus_probe.c |   26 --
 drivers/xen/xenbus/xenbus_xs.c|3 ++-
 3 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_comms.c 
b/drivers/xen/xenbus/xenbus_comms.c
index 2eff7a6..57b8230 100644
--- a/drivers/xen/xenbus/xenbus_comms.c
+++ b/drivers/xen/xenbus/xenbus_comms.c
@@ -224,7 +224,7 @@ int xb_init_comms(void)
int err;
err = bind_evtchn_to_irqhandler(xen_store_evtchn, wake_waiting,
0, "xenbus", &xb_waitq);
-   if (err <= 0) {
+   if (err < 0) {
printk(KERN_ERR "XENBUS request irq failed %i\n", err);
return err;
}
diff --git a/drivers/xen/xenbus/xenbus_probe.c 
b/drivers/xen/xenbus/xenbus_probe.c
index 1b178c6..f3d5105 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -731,16 +731,22 @@ static int __init xenbus_init(void)
return -ENODEV;
 
if (xen_hvm_domain()) {
-   uint64_t v = 0;
-   err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v);
-   if (err)
-   goto out_error;
-   xen_store_evtchn = (int)v;
-   err = hvm_get_parameter(HVM_PARAM_STORE_PFN, &v);
-   if (err)
-   goto out_error;
-   xen_store_mfn = (unsigned long)v;
-   xen_store_interface = ioremap(xen_store_mfn << PAGE_SHIFT, 
PAGE_SIZE);
+   if (xen_initial_domain()) {
+   err = xenstored_local_init();
+   xen_store_interface = phys_to_virt(xen_store_mfn << 
PAGE_SHIFT);
+   } else {
+   uint64_t v = 0;
+   err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v);
+   if (err)
+   goto out_error;
+   xen_store_evtchn = (int)v;
+   err = hvm_get_parameter(HVM_PARAM_STORE_PFN, &v);
+   if (err)
+   goto out_error;
+   xen_store_mfn = (unsigned long)v;
+   xen_store_interface = ioremap(xen_store_mfn << 
PAGE_SHIFT,
+   PAGE_SIZE);
+   }
} else {
xen_store_evtchn = xen_start_info->store_evtchn;
xen_store_mfn = xen_start_info->store_mfn;
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
index b3b8f2f..edcef19 100644
--- a/drivers/xen/xenbus/xenbus_xs.c
+++ b/drivers/xen/xenbus/xenbus_xs.c
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "xenbus_comms.h"
@@ -907,7 +908,7 @@ int xs_init(void)
return PTR_ERR(task);
 
/* shutdown watches for kexec boot */
-   if (xen_hvm_domain())
+   if (xen_hvm_domain() && !xen_initial_domain())
xs_reset_watches();
 
return 0;
-- 
1.7.2.5


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


[PATCH-WIP 13/13] xen/arm: compile grant-table features events and xenbus, do not compile pci

2012-02-23 Thread Stefano Stabellini
Also select XEN_DOM0 by default.

Signed-off-by: Stefano Stabellini 
---
 arch/arm/Kconfig |4 
 drivers/xen/Makefile |7 ---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 57b294c..1a95b35 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2201,9 +2201,13 @@ config NEON
  Say Y to include support code for NEON, the ARMv7 Advanced SIMD
  Extension.
 
+config XEN_DOM0
+   def_bool y
+
 config XEN
bool "Xen guest support on ARM"
depends on ARM
+   select XEN_DOM0
help
  Say Y if you want to run Linux in a Virtual Machine on Xen on ARM.
 
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index dab8305..e3542e1 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -1,7 +1,9 @@
 ifeq (CONFIG_X86,y)
-obj-y  += grant-table.o features.o events.o manage.o balloon.o
-obj-y  += xenbus/
+obj-y  += manage.o balloon.o
+obj-$(CONFIG_XEN_DOM0) += pci.o
 endif
+obj-y  += grant-table.o features.o events.o
+obj-y  += xenbus/
 
 nostackp := $(call cc-option, -fno-stack-protector)
 CFLAGS_features.o  := $(nostackp)
@@ -21,7 +23,6 @@ obj-$(CONFIG_XEN_SYS_HYPERVISOR)  += sys-hypervisor.o
 obj-$(CONFIG_XEN_PVHVM)+= platform-pci.o
 obj-$(CONFIG_XEN_TMEM) += tmem.o
 obj-$(CONFIG_SWIOTLB_XEN)  += swiotlb-xen.o
-obj-$(CONFIG_XEN_DOM0) += pci.o
 obj-$(CONFIG_XEN_PCIDEV_BACKEND)   += xen-pciback/
 
 xen-evtchn-y   := evtchn.o
-- 
1.7.2.5


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


[PATCH-WIP 11/13] xen/arm: Introduce xen_pfn_t for pfn and mfn types

2012-02-23 Thread Stefano Stabellini
All the original Xen headers have xen_pfn_t as mfn and pfn type, however
when they have been imported in Linux, xen_pfn_t has been replaced with
unsigned long. That might work for x86 and ia64 but it does not for arm.
Bring back xen_pfn_t and let each architecture define xen_pfn_t as they
see fit.

Signed-off-by: Stefano Stabellini 
---
 arch/arm/include/asm/xen/interface.h  |3 +++
 arch/ia64/include/asm/xen/interface.h |3 ++-
 arch/x86/include/asm/xen/interface.h  |3 +++
 include/xen/interface/grant_table.h   |4 ++--
 include/xen/interface/memory.h|6 +++---
 include/xen/interface/platform.h  |4 ++--
 include/xen/interface/xen.h   |6 +++---
 include/xen/privcmd.h |2 --
 8 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/arch/arm/include/asm/xen/interface.h 
b/arch/arm/include/asm/xen/interface.h
index 2ee39e8..65577de 100644
--- a/arch/arm/include/asm/xen/interface.h
+++ b/arch/arm/include/asm/xen/interface.h
@@ -24,6 +24,8 @@
(hnd) = val;\
} while (0)
 
+typedef uint64_t xen_pfn_t;
+
 #ifndef __ASSEMBLY__
 /* Guest handles for primitive C types. */
 __DEFINE_GUEST_HANDLE(uchar, unsigned char);
@@ -33,6 +35,7 @@ DEFINE_GUEST_HANDLE(char);
 DEFINE_GUEST_HANDLE(int);
 DEFINE_GUEST_HANDLE(long);
 DEFINE_GUEST_HANDLE(void);
+DEFINE_GUEST_HANDLE(xen_pfn_t);
 #endif
 
 /* Maximum number of virtual CPUs in multi-processor guests. */
diff --git a/arch/ia64/include/asm/xen/interface.h 
b/arch/ia64/include/asm/xen/interface.h
index 1d2427d..18904ac 100644
--- a/arch/ia64/include/asm/xen/interface.h
+++ b/arch/ia64/include/asm/xen/interface.h
@@ -66,6 +66,8 @@
 #define GUEST_HANDLE_64(name)  GUEST_HANDLE(name)
 #define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0)
 
+typedef unsigned long xen_pfn_t;
+
 #ifndef __ASSEMBLY__
 /* Guest handles for primitive C types. */
 __DEFINE_GUEST_HANDLE(uchar, unsigned char);
@@ -78,7 +80,6 @@ DEFINE_GUEST_HANDLE(long);
 DEFINE_GUEST_HANDLE(void);
 DEFINE_GUEST_HANDLE(uint64_t);
 
-typedef unsigned long xen_pfn_t;
 DEFINE_GUEST_HANDLE(xen_pfn_t);
 #define PRI_xen_pfn"lx"
 #endif
diff --git a/arch/x86/include/asm/xen/interface.h 
b/arch/x86/include/asm/xen/interface.h
index a1f2db5..59a37ec 100644
--- a/arch/x86/include/asm/xen/interface.h
+++ b/arch/x86/include/asm/xen/interface.h
@@ -46,6 +46,8 @@
 #endif
 #endif
 
+typedef unsigned long xen_pfn_t;
+
 #ifndef __ASSEMBLY__
 /* Guest handles for primitive C types. */
 __DEFINE_GUEST_HANDLE(uchar, unsigned char);
@@ -56,6 +58,7 @@ DEFINE_GUEST_HANDLE(int);
 DEFINE_GUEST_HANDLE(long);
 DEFINE_GUEST_HANDLE(void);
 DEFINE_GUEST_HANDLE(uint64_t);
+DEFINE_GUEST_HANDLE(xen_pfn_t);
 #endif
 
 #ifndef HYPERVISOR_VIRT_START
diff --git a/include/xen/interface/grant_table.h 
b/include/xen/interface/grant_table.h
index 39e5717..1fd3a66 100644
--- a/include/xen/interface/grant_table.h
+++ b/include/xen/interface/grant_table.h
@@ -254,7 +254,7 @@ DEFINE_GUEST_HANDLE_STRUCT(gnttab_dump_table);
 #define GNTTABOP_transfer4
 struct gnttab_transfer {
 /* IN parameters. */
-unsigned long mfn;
+xen_pfn_t mfn;
 domid_t   domid;
 grant_ref_t   ref;
 /* OUT parameters. */
@@ -291,7 +291,7 @@ struct gnttab_copy {
struct {
union {
grant_ref_t ref;
-   unsigned long   gmfn;
+   xen_pfn_t   gmfn;
} u;
domid_t  domid;
uint16_t offset;
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h
index eac3ce1..abbbff0 100644
--- a/include/xen/interface/memory.h
+++ b/include/xen/interface/memory.h
@@ -31,7 +31,7 @@ struct xen_memory_reservation {
  *   OUT: GMFN bases of extents that were allocated
  *   (NB. This command also updates the mach_to_phys translation table)
  */
-GUEST_HANDLE(ulong) extent_start;
+GUEST_HANDLE(xen_pfn_t) extent_start;
 
 /* Number of extents, and size/alignment of each (2^extent_order pages). */
 unsigned long  nr_extents;
@@ -130,7 +130,7 @@ struct xen_machphys_mfn_list {
  * any large discontiguities in the machine address space, 2MB gaps in
  * the machphys table will be represented by an MFN base of zero.
  */
-GUEST_HANDLE(ulong) extent_start;
+GUEST_HANDLE(xen_pfn_t) extent_start;
 
 /*
  * Number of extents written to the above array. This will be smaller
@@ -172,7 +172,7 @@ struct xen_add_to_physmap {
 unsigned long idx;
 
 /* GPFN where the source mapping page should appear. */
-unsigned long gpfn;
+xen_pfn_t gpfn;
 };
 DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap);
 
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
index c168468..1c172ce 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -54,7 +54,7 @@ DEFINE_GUEST_HANDLE_STRUCT(xen

Re: [PATCH v2 4/4] arm/dts: OMAP3: Add mmc controller nodes and board data

2012-02-23 Thread Tony Lindgren
> --- a/arch/arm/boot/dts/omap3.dtsi
> +++ b/arch/arm/boot/dts/omap3.dtsi
> @@ -113,5 +113,31 @@
>   #size-cells = <0>;
>   ti,hwmods = "i2c3";
>   };
> +
> + mmc1: mmc@1 {
> + compatible = "ti,omap2-hsmmc";
> + ti,hwmods = "mmc1";
> + ti,dual-volt;
> + };
> +
> + mmc2: mmc@2 {
> + compatible = "ti,omap2-hsmmc";
> + ti,hwmods = "mmc2";
> + };
> +
> + mmc3: mmc@3 {
> + compatible = "ti,omap2-hsmmc";
> + ti,hwmods = "mmc3";
> + };
> +
> + mmc4: mmc@4 {
> + compatible = "ti,omap2-hsmmc";
> + ti,hwmods = "mmc4";
> + };
> +
> + mmc5: mmc@5 {
> + compatible = "ti,omap2-hsmmc";
> + ti,hwmods = "mmc5";
> + };
>   };
>  };

These all should all be "ti,omap3-hsmmc" I guess?

Tony

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


12.02 efika smart book (MX?) images are totally borked

2012-02-23 Thread Zygmunt Krynicki
Hi.

I'd like to let everyone know that our 12.02 images for Efika are bogus:

http://releases.linaro.org/12.02/ubuntu/oneiric-images/ubuntu-desktop/

The desktop image is 3MB big. The reason for this is that linaro media
create crashes while trying to build it:

(this is on 12.02 LMC release)

$ linaro-media-create --image-file efika.img --dev efikasb --rootfs
ext2 --hwpack 
.cache/linaro/image-tools/fetch_image/releases.linaro.org/12.02/ubuntu/oneiric-hwpacks/hwpack_linaro-efikamx_20120221-1_armel_supported.tar.gz
--hwpack-force-yes --image-size 4G --binary
.cache/linaro/image-tools/fetch_image/releases.linaro.org/12.02/ubuntu/oneiric-images/nano/linaro-o-nano-tar-20120221-0.tar.gz
 --align-boot-part
[sudo] password for zyga:

Installing (linaro-hwpack-install)
hwpack_linaro-efikamx_20120221-1_armel_supported.tar.gz in target
rootfs.
Unpacking hardware pack ...Done
Updating apt package lists ...
Ign file: ./ InRelease
Ign file: ./ Release.gpg
Ign file: ./ Release
Ign file: ./ Translation-en
Ign http://ports.ubuntu.com oneiric InRelease
Ign http://ports.ubuntu.com oneiric-security InRelease
Ign http://ppa.launchpad.net oneiric InRelease
Ign http://ports.ubuntu.com oneiric-updates InRelease
Get:1 http://ppa.launchpad.net oneiric Release.gpg [316 B]
Ign http://ports.ubuntu.com oneiric-security InRelease
Ign http://ports.ubuntu.com oneiric InRelease
Get:2 http://ppa.launchpad.net oneiric Release [9759 B]
Ign http://ports.ubuntu.com oneiric-updates InRelease
Get:3 http://ports.ubuntu.com oneiric Release.gpg [198 B]
Get:4 http://ports.ubuntu.com oneiric-security Release.gpg [198 B]
Get:5 http://ppa.launchpad.net oneiric/main armel Packages [202 kB]
Get:6 http://ports.ubuntu.com oneiric-updates Release.gpg [198 B]
Get:7 http://ports.ubuntu.com oneiric-security Release.gpg [198 B]
Ign http://ppa.launchpad.net oneiric/main TranslationIndex
Get:8 http://ports.ubuntu.com oneiric Release.gpg [198 B]
Get:9 http://ports.ubuntu.com oneiric-updates Release.gpg [198 B]
Ign http://ppa.launchpad.net oneiric/main Translation-en
Get:10 http://ports.ubuntu.com oneiric Release [40.8 kB]
Get:11 http://ports.ubuntu.com oneiric-security Release [40.8 kB]
Get:12 http://ports.ubuntu.com oneiric-updates Release [40.8 kB]
Get:13 http://ports.ubuntu.com oneiric-security Release [40.8 kB]
Get:14 http://ports.ubuntu.com oneiric Release [40.8 kB]
Get:15 http://ports.ubuntu.com oneiric-updates Release [40.8 kB]
Get:16 http://ports.ubuntu.com oneiric/main Sources [1095 kB]
Get:17 http://ports.ubuntu.com oneiric/universe Sources [5792 kB]
Get:18 http://ports.ubuntu.com oneiric/main armel Packages [1562 kB]
Get:19 http://ports.ubuntu.com oneiric/universe armel Packages [5611 kB]
Hit http://ports.ubuntu.com oneiric/main TranslationIndex
Hit http://ports.ubuntu.com oneiric/universe TranslationIndex
Get:20 http://ports.ubuntu.com oneiric-security/main Sources [34.9 kB]
Get:21 http://ports.ubuntu.com oneiric-security/universe Sources [12.1 kB]
Get:22 http://ports.ubuntu.com oneiric-security/main armel Packages [96.3 kB]
Get:23 http://ports.ubuntu.com oneiric-security/universe armel
Packages [31.7 kB]
Get:24 http://ports.ubuntu.com oneiric-security/main TranslationIndex [73 B]
Get:25 http://ports.ubuntu.com oneiric-security/universe TranslationIndex [73 B]
Get:26 http://ports.ubuntu.com oneiric-updates/main Sources [157 kB]
Get:27 http://ports.ubuntu.com oneiric-updates/universe Sources [51.9 kB]
Get:28 http://ports.ubuntu.com oneiric-updates/main armel Packages [369 kB]
Get:29 http://ports.ubuntu.com oneiric-updates/universe armel Packages [122 kB]
Get:30 http://ports.ubuntu.com oneiric-updates/main TranslationIndex [74 B]
Get:31 http://ports.ubuntu.com oneiric-updates/universe TranslationIndex [73 B]
Get:32 http://ports.ubuntu.com oneiric-security/main armel Packages [96.3 kB]
Get:33 http://ports.ubuntu.com oneiric-security/universe armel
Packages [31.7 kB]
Get:34 http://ports.ubuntu.com oneiric-security/main TranslationIndex [73 B]
Get:35 http://ports.ubuntu.com oneiric-security/universe TranslationIndex [73 B]
Get:36 http://ports.ubuntu.com oneiric/main armel Packages [1562 kB]
Get:37 http://ports.ubuntu.com oneiric/universe armel Packages [5611 kB]
Get:38 http://ports.ubuntu.com oneiric/multiverse armel Packages [134 kB]
Get:39 http://ports.ubuntu.com oneiric/main TranslationIndex [3289 B]
Get:40 http://ports.ubuntu.com oneiric/multiverse TranslationIndex [2265 B]
Get:41 http://ports.ubuntu.com oneiric/universe TranslationIndex [2640 B]
Get:42 http://ports.ubuntu.com oneiric-updates/main armel Packages [369 kB]
Get:43 http://ports.ubuntu.com oneiric-updates/universe armel Packages [122 kB]
Get:44 http://ports.ubuntu.com oneiric-updates/main TranslationIndex [74 B]
Get:45 http://ports.ubuntu.com oneiric-updates/universe TranslationIndex [73 B]
Hit http://ports.ubuntu.com oneiric/main Translation-en
Hit http://ports.ubuntu.com oneiric/universe Translation-en
Get:46 http://ports.ubuntu

Re: 12.02 efika smart book (MX?) images are totally borked

2012-02-23 Thread Andy Doan

bug opened:
  


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


Re: [PATCH v3 1/2] regulator: twl: adapt twl-regulator driver to dt

2012-02-23 Thread Rajendra Nayak

On Thursday 23 February 2012 09:01 PM, Mark Brown wrote:

On Thu, Feb 23, 2012 at 05:05:53PM +0530, Rajendra Nayak wrote:

Modify the twl regulator driver to extract the regulator_init_data from
device tree when passed, instead of getting it through platform_data
structures (on non-DT builds)


This doesn't apply to current -next, I expect because of the SMPS
regulator changes which went in.  Please always submit patches against
-next.  There's also a patch from Tero adding support for some
additional regulators which is floating around and would conflict with
this.  Could you guys please coordinate with each other on this?


Sure, I will co-ordinate with Tero and post my patches against -next.

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


Re: [PATCH v2 4/4] arm/dts: OMAP3: Add mmc controller nodes and board data

2012-02-23 Thread Rajendra Nayak

On Friday 24 February 2012 12:27 AM, Tony Lindgren wrote:

--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -113,5 +113,31 @@
#size-cells =<0>;
ti,hwmods = "i2c3";
};
+
+   mmc1: mmc@1 {
+   compatible = "ti,omap2-hsmmc";
+   ti,hwmods = "mmc1";
+   ti,dual-volt;
+   };
+
+   mmc2: mmc@2 {
+   compatible = "ti,omap2-hsmmc";
+   ti,hwmods = "mmc2";
+   };
+
+   mmc3: mmc@3 {
+   compatible = "ti,omap2-hsmmc";
+   ti,hwmods = "mmc3";
+   };
+
+   mmc4: mmc@4 {
+   compatible = "ti,omap2-hsmmc";
+   ti,hwmods = "mmc4";
+   };
+
+   mmc5: mmc@5 {
+   compatible = "ti,omap2-hsmmc";
+   ti,hwmods = "mmc5";
+   };
};
  };


These all should all be "ti,omap3-hsmmc" I guess?


Well, I defined the binding such that both omap2 and omap3
can use the same compatible "ti,omap2-hsmmc" since there is
no difference in the way they are defined or handled. If thats
confusing, I can have separate compatibles.
Btw, I guess we do the same with a few other re-used IPs as well,
I just checked and mcpsi does the same.



Tony



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