Re: [PATCH V2 1/4] cpufreq: exynos: Adding cpufreq driver for exynos5440

2013-03-05 Thread Viresh Kumar
On 6 March 2013 13:35, amit kachhap  wrote:
> On Tue, Mar 5, 2013 at 6:48 AM, Viresh Kumar  wrote:

>>> +static void exynos_cpufreq_work(struct work_struct *work)
>>> +{
>>> +   unsigned int cur_pstate, index;
>>> +   struct cpufreq_policy *policy = cpufreq_cpu_get(0); /* boot CPU */
>>> +   struct cpufreq_frequency_table *freq_table = dvfs_info->freq_table;
>>> +
>>> +   if (policy == NULL)
>>> +   goto skip_work;
>>
>> How can that be true? And if it can be, you will miss POSTCHANGE 
>> notifications
>> too.
> This skip of POSTCHANGE notifications is needed in one case where
> bootup frequency does not match with any elements of cpufreq table and
> hence I simply assign the highest frequency. Also cpufreq driver is
> not registered at this point.

I will keep a variable for that then, otherwise its misleading... So keep a
variable like cpufreq_enabled for it and set it to 1 as soon as this first
interrupt is gone... keep it in unlikely() too.

>>> +   dvfs_info = kzalloc(sizeof(struct exynos_dvfs_data), GFP_KERNEL);
>>
>> sizeof(*dvfs_info) ??
> Isn't both same?

You need to read Documentation/CodingStyle.
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 1/4] cpufreq: exynos: Adding cpufreq driver for exynos5440

2013-03-05 Thread amit kachhap
Hi Viresh,

Again thanks for your review comments.

On Tue, Mar 5, 2013 at 6:48 AM, Viresh Kumar  wrote:
> On 2 March 2013 15:04, Amit Daniel Kachhap  wrote:
>> This patch adds dvfs support for exynos5440 SOC. This soc has 4 cores and
>> they run at same frequency. The nature of exynos5440 clock controller is
>> different from previous exynos controllers so not using the common exynos
>> cpufreq framework. The major difference being interrupt notfication for
>> frequency change. Also, OPP library is used for device tree parsing to get
>> different parameters like frequency, voltage etc. Since the opp library sorts
>> the frequency table in ascending order so they are again re-arranged in
>> descending order. This will have one-to-one mapping with the clock controller
>> state management logic.
>>
>> Signed-off-by: Amit Daniel Kachhap 
>> ---
>> Changes in V2:
>> * Added OPP library support to parse DT parameters.
>> * Removed a hack to handle interrupts in bootup.
>> * Added many review comments from Viresh and Inder.
>
> Added? Thanks :)
typo error :)

>
>>
>> All these patches are dependent on Thomas Abraham common clock patches.
>> http://www.mail-archive.com/linux-samsung-soc@vger.kernel.org/msg15860.html
>>
>>  .../bindings/cpufreq/cpufreq-exynos5440.txt|   32 ++
>>  drivers/cpufreq/Kconfig.arm|9 +
>>  drivers/cpufreq/Makefile   |1 +
>>  drivers/cpufreq/exynos5440-cpufreq.c   |  450 
>> 
>>  4 files changed, 492 insertions(+), 0 deletions(-)
>>  create mode 100644 
>> Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt
>>  create mode 100644 drivers/cpufreq/exynos5440-cpufreq.c
>>
>> diff --git 
>> a/Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt 
>> b/Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt
>> new file mode 100644
>> index 000..caa3f8d
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt
>> @@ -0,0 +1,32 @@
>> +
>> +Exynos5440 cpufreq driver
>> +---
>> +
>> +Exynos5440 SoC cpufreq driver for CPU frequency scaling.
>> +
>> +Required properties:
>> +- interrupts: Interrupt to know the completion of cpu frequency change.
>> +- operating-points: Table of frequencies and voltage CPU could be 
>> transitioned into,
>> +   in the decreasing order. Frequency should be in KHZ units and voltage
>> +   should be in microvolts.
>> +- clocks: phandle of the clock from common clock binding. More description 
>> can
>> +   be found in 
>> Documentation/devicetree/bindings/clock/clock-bindings.txt.
>> +
>> +Optional properties:
>> +- clock-latency: Clock transition latency in microsecond.
>> +
>> +All the required listed above must be defined under node cpufreq.
>> +
>> +Example:
>> +
>> +   cpufreq@16 {
>> +   compatible = "samsung,exynos5440-cpufreq";
>> +   reg = <0x16 0x1000>;
>> +   interrupts = <0 57 0>;
>> +   operating-points = <
>> +   100 975000
>> +   80  925000>;
>> +   clocks = <&clock 2>;
>> +   clock-latency = <10>;
>> +   };
>> +
>> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
>> index 030ddf6..7ed9c4a 100644
>> --- a/drivers/cpufreq/Kconfig.arm
>> +++ b/drivers/cpufreq/Kconfig.arm
>> @@ -77,6 +77,15 @@ config ARM_EXYNOS5250_CPUFREQ
>>   This adds the CPUFreq driver for Samsung EXYNOS5250
>>   SoC.
>>
>> +config ARM_EXYNOS5440_CPUFREQ
>> +   def_bool SOC_EXYNOS5440
>> +   depends on HAVE_CLK && PM_OPP && OF
>> +   help
>> + This adds the CPUFreq driver for Samsung EXYNOS5440
>> + SoC. The nature of exynos5440 clock controller is
>> + different than previous exynos controllers so not using
>> + the common exynos framework.
>> +
>>  config ARM_KIRKWOOD_CPUFREQ
>> def_bool ARCH_KIRKWOOD && OF
>> help
>> diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
>> index 863fd18..c841438 100644
>> --- a/drivers/cpufreq/Makefile
>> +++ b/drivers/cpufreq/Makefile
>> @@ -52,6 +52,7 @@ obj-$(CONFIG_ARM_EXYNOS_CPUFREQ)  += exynos-cpufreq.o
>>  obj-$(CONFIG_ARM_EXYNOS4210_CPUFREQ)   += exynos4210-cpufreq.o
>>  obj-$(CONFIG_ARM_EXYNOS4X12_CPUFREQ)   += exynos4x12-cpufreq.o
>>  obj-$(CONFIG_ARM_EXYNOS5250_CPUFREQ)   += exynos5250-cpufreq.o
>> +obj-$(CONFIG_ARM_EXYNOS5440_CPUFREQ)   += exynos5440-cpufreq.o
>>  obj-$(CONFIG_ARM_KIRKWOOD_CPUFREQ) += kirkwood-cpufreq.o
>>  obj-$(CONFIG_ARM_OMAP2PLUS_CPUFREQ)+= omap-cpufreq.o
>>  obj-$(CONFIG_ARM_SPEAR_CPUFREQ)+= spear-cpufreq.o
>> diff --git a/drivers/cpufreq/exynos5440-cpufreq.c 
>> b/drivers/cpufreq/exynos5440-cpufreq.c
>> new file mode 100644
>> index 000..2dc43b1
>> --- /dev/null
>> +++ b/drivers/cpufreq/exynos5440-cpufreq.c
>> @@ -0,0 +1,450 @@

Re: [PATCH 1/2] ARM: exynos: pl330: Add #dma-cells for generic dma binding support

2013-03-05 Thread Padma Venkat
On Wed, Mar 6, 2013 at 4:07 AM, Arnd Bergmann  wrote:
> On Monday 04 March 2013, Padmavathi Venna wrote:
>>
>> This patch adds #dma-cells property to PL330 DMA controller
>> nodes for supporting generic dma dt bindings on samsung exynos
>> platforms. #dma-channels and #dma-requests are not required now
>> but added in advance.
>>
>> Signed-off-by: Padmavathi Venna 
>
> Acked-by: Arnd Bergmann 
>
> Should we apply these directly to the arm-soc fixes branch, or wait
> until they come back from the Samsung subarchitecture tree?

Hmm, If Kukjin can take in 3.9 rc2 it's better to go via Samsung tree.

Kukjin,

Can you please take this patch in 3.9 rc2 ?

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


[PATCH] iio: adc: exynos5_adc: fix compilation warnings

2013-03-05 Thread Naveen Krishna Chatradhi
From: Naveen Krishna Ch 

Fixes the compilation warnings and potential NULL pointer
dereferencing pointed out by "Dan Carpenter".

Signed-off-by: Naveen Krishna Ch 
---
 drivers/iio/adc/exynos_adc.c |   24 +---
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index ed6fdd7..67d07aa 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -92,7 +92,7 @@ struct exynos_adc {
struct completion   completion;
 
u32 value;
-   unsigned intversion;
+   unsigned intversion;
 };
 
 static const struct of_device_id exynos_adc_match[] = {
@@ -102,12 +102,15 @@ static const struct of_device_id exynos_adc_match[] = {
 };
 MODULE_DEVICE_TABLE(of, exynos_adc_match);
 
-static inline unsigned int exynos_adc_get_version(struct platform_device *pdev)
+static inline int exynos_adc_get_version(struct platform_device *pdev)
 {
const struct of_device_id *match;
 
match = of_match_node(exynos_adc_match, pdev->dev.of_node);
-   return (unsigned int)match->data;
+   if (!match)
+   return -ENODEV;
+
+   return (int)match->data;
 }
 
 static int exynos_read_raw(struct iio_dev *indio_dev,
@@ -117,7 +120,7 @@ static int exynos_read_raw(struct iio_dev *indio_dev,
long mask)
 {
struct exynos_adc *info = iio_priv(indio_dev);
-   unsigned long timeout;
+   int timeout;
u32 con1, con2;
 
if (mask != IIO_CHAN_INFO_RAW)
@@ -255,7 +258,7 @@ static int exynos_adc_probe(struct platform_device *pdev)
struct iio_dev *indio_dev = NULL;
struct resource *mem;
int ret = -ENODEV;
-   int irq;
+   int irq, version;
 
if (!np)
return ret;
@@ -268,6 +271,15 @@ static int exynos_adc_probe(struct platform_device *pdev)
 
info = iio_priv(indio_dev);
 
+   version = exynos_adc_get_version(pdev);
+   if (version < 0) {
+   dev_err(&pdev->dev, "no matching of_node, err = %d\n", version);
+   ret = version;
+   goto err_iio;
+   }
+
+   info->version = version;
+
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
info->regs = devm_request_and_ioremap(&pdev->dev, mem);
@@ -311,8 +323,6 @@ static int exynos_adc_probe(struct platform_device *pdev)
goto err_irq;
}
 
-   info->version = exynos_adc_get_version(pdev);
-
platform_set_drvdata(pdev, indio_dev);
 
indio_dev->name = dev_name(&pdev->dev);
-- 
1.7.9.5

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


Re: State of pinctrl and exynos5250?

2013-03-05 Thread Doug Anderson
Thomas,

On Tue, Mar 5, 2013 at 4:01 PM, Thomas Abraham
 wrote:
> So now I have: pinctrl_0 is SPI[46], pinctrl_1 is SPI[45], pinctrl_2
> is SPI[50] and pinctrl_3 is SPI[47]. I am yet to test this and
> confirm. If you feel these are wrong, could you please let me know.

Yes, that matches my findings / guesses.  ;)


> Right, I did not pay attention to the bisecting problem. What I have
> now is, a set of individual patches that migrate i2c, sdhci, dwmmc,
> i2s, spi and keypad drivers to pinctrl based pin-configuration. In
> addition to that, two patches that add default pin-state information
> for Exynos4 and Exynos5 platforms. Since there are multiple drivers
> involved, is it okay to keep them as separate patches?

My own personal opinion is that it's worth keeping bisect working and
also a good idea to keep the patches to the individual drivers
separate.  That would mean adding support for either pinctrl or gpio
in the short term (like Linus did for i2c).  Once everything is moved
over then killing gpio support would be OK by me.

I'd feel most strongly about not killing dw_mmc since that is such a
critical driver for booting.  i2s/spi/keypad are a little less
critical and I'd be more OK with them breaking as long as it was clear
in the commit message that breakage is expected.

I'm a bit of a latecomer to this conversation, though, so I'm not sure
my ack / nak holds much weight.  If someone else thinks it's more
important to kill the old GPIO stuff (or more important to avoid
useless churn) then their opinion ought to hold.

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


Re: State of pinctrl and exynos5250?

2013-03-05 Thread Doug Anderson
Thomas,

On Tue, Mar 5, 2013 at 3:49 PM, Thomas Abraham
 wrote:
> Yes, I am currently held up with supporting default pin states at slot
> level. One option that could be considered is to list out the default
> pin states for all slots in the parent node of the slots. So it would
> be something like below as an example.
>
> dwmmc2@1222 {
><>
>
> pinctrl-names = "slot0-default", "slot1-default";
> pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>;
> pinctrl-1 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4 &sd2_bus8>;
>
> slot@0 {
> reg = <0>;
> bus-width = <4>;
> disable-wp;
> };
>
> slot@1 {
> reg = <0>;
> bus-width = <8>;
> disable-wp;
> };
> };
>
> Then, during the initial slot setup stage, the driver, knowing the
> current slot number that is being setup, can setup the pin state for
> the particular slot using the devm_pinctrl_get_select API. pinctrl
> subsystem would not setup the default pin state in this case.
>
> Does this look like a hack?

That feels like a hack to me.  The right place for the slot data is
under the slot node, not in the parent.  ...but I would certainly
defer to any experts that might have a different opinion.


> For now, I have prepared patches without
> this approach, since Exynos5250 has just one slot, I have just listed
> only one default pin state, which the pinctrl framework helps to setup
> during driver bind.

That actually doesn't seem awful to me.  It's basically saying that we
are describing pinmux at a device level and not a slot level.  It
would make it a pain to dynamically adjust pinmux on a slot-by-slot
basis, but is that a terrible thing?

In the two-slot case you could just do:

  pinctrl-0 = <&sd1_clk &sd1_cmd &sd1_cd &sd2_bus4 &sd2_clk &sd2_cmd
&sd1_cd &sd1_bus4>;
  pinctrl-names = "default";

In other words the default state just sets up pin muxing for all the
whole controller (AKA all slots).

...but maybe someone will yell at me for that suggestion.  It's really
hard to justify all this extra work for the multiple slot case when
there are no current users that I know of...


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


Re: State of pinctrl and exynos5250?

2013-03-05 Thread Thomas Abraham
On 6 March 2013 05:20, Doug Anderson  wrote:
> Thomas,
>
> On Mon, Mar 4, 2013 at 6:04 AM, Thomas Abraham
>  wrote:
>>
>> Ok. I will repost this patch again with pinctrl_1 and pinctrl_2
>> included. I had not included this in the earlier patch since I was not
>> sure of the best pin grouping for the camera and c2c interface.
>
> OK, thanks.

I have added pinctrl_1 and pinctrl_2 now.

>
 --> NOTE: Appears (IIRC) to have incorrect interrupt for pinctrl_3.  I
 believe that 45 is pinctrl_1.  Maybe 3 is 47?
>>>
>>> I can't verify this, unfortunately.
>>
>> The documentation does not state this clearly. I will recheck on this
>> and correct as needed.
>
> OK.  Let me know if you can't find it.  I spent a bunch of time
> digging in this area and wrote up my findings, but I certainly could
> be wrong.  ;)

So now I have: pinctrl_0 is SPI[46], pinctrl_1 is SPI[45], pinctrl_2
is SPI[50] and pinctrl_3 is SPI[47]. I am yet to test this and
confirm. If you feel these are wrong, could you please let me know.

>
>> I have posted i2c pinctrl support patch based on LinusW's pin grab by
>> device core patch. If that is acceptable, I can post pinctrl support
>> patches for other other controllers as well.
>
> OK, I see that.  .  That
> particular patch isn't strictly required, right?  Even without that
> patch I can specify pinctrl for the i2c nodes and it will work
> OK--this just removes the old gpio nodes.
>
> One problem I see with taking this approach for DW_MMC and for SPI is
> that it will make bisecting hard.  If you land a change to take out
> GPIO stuff from dw_mmc and the spi driver then it will make the
> transition difficult.  exynos5 boards will stop booting until the
> device tree support is also landed.  ...and it would be an awfully big
> patch to add all the device tree stuff in the same patch as the dw_mmc
> and spi driver changes...

Right, I did not pay attention to the bisecting problem. What I have
now is, a set of individual patches that migrate i2c, sdhci, dwmmc,
i2s, spi and keypad drivers to pinctrl based pin-configuration. In
addition to that, two patches that add default pin-state information
for Exynos4 and Exynos5 platforms. Since there are multiple drivers
involved, is it okay to keep them as separate patches?

Thanks,
Thomas.

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


RE: State of pinctrl and exynos5250?

2013-03-05 Thread Kukjin Kim
Doug Anderson wrote:
> 
> Tomasz,
> 
> Thanks for your response.
> 
> 
> On Sat, Mar 2, 2013 at 3:48 AM, Tomasz Figa  wrote:
> >
> > The 4 patches above are already merged in Kgene's for-next-next (for
> 3.10)
> > branch.
> 
> Excellent.  I see them now.  I haven't yet seen them show up in
> linux-next (which is where I tend to look first), though...
> 
Just note, I'm sorting them out. So you will see them in linux-next within a
couple of days.

BRs,

- Kukjin

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


Re: State of pinctrl and exynos5250?

2013-03-05 Thread Doug Anderson
Thomas,

On Mon, Mar 4, 2013 at 6:04 AM, Thomas Abraham
 wrote:
>
> Ok. I will repost this patch again with pinctrl_1 and pinctrl_2
> included. I had not included this in the earlier patch since I was not
> sure of the best pin grouping for the camera and c2c interface.

OK, thanks.

>>> --> NOTE: Appears (IIRC) to have incorrect interrupt for pinctrl_3.  I
>>> believe that 45 is pinctrl_1.  Maybe 3 is 47?
>>
>> I can't verify this, unfortunately.
>
> The documentation does not state this clearly. I will recheck on this
> and correct as needed.

OK.  Let me know if you can't find it.  I spent a bunch of time
digging in this area and wrote up my findings, but I certainly could
be wrong.  ;)

> I have posted i2c pinctrl support patch based on LinusW's pin grab by
> device core patch. If that is acceptable, I can post pinctrl support
> patches for other other controllers as well.

OK, I see that.  .  That
particular patch isn't strictly required, right?  Even without that
patch I can specify pinctrl for the i2c nodes and it will work
OK--this just removes the old gpio nodes.

One problem I see with taking this approach for DW_MMC and for SPI is
that it will make bisecting hard.  If you land a change to take out
GPIO stuff from dw_mmc and the spi driver then it will make the
transition difficult.  exynos5 boards will stop booting until the
device tree support is also landed.  ...and it would be an awfully big
patch to add all the device tree stuff in the same patch as the dw_mmc
and spi driver changes...


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


Re: State of pinctrl and exynos5250?

2013-03-05 Thread Thomas Abraham
On 6 March 2013 04:59, Doug Anderson  wrote:
> Tomasz,
>
> Thanks for your response.
>
>
> On Sat, Mar 2, 2013 at 3:48 AM, Tomasz Figa  wrote:
>>
>> The 4 patches above are already merged in Kgene's for-next-next (for 3.10)
>> branch.
>
> Excellent.  I see them now.  I haven't yet seen them show up in
> linux-next (which is where I tend to look first), though...
>
>>> ARM: dts: add pinctrl nodes for Exynos5250 SoC
>>> - https://patchwork.kernel.org/patch/1871991/
>>
>> This one is not merged yet. Since I do not know much about Exynos 5250, I
>> could not verify any hardware-specific details in the patch, just the
>> general correctness of the patch.
>
> OK, good.  That means you guys came to the same conclusions that I did.  :)
>
>>> IMHO that means we've got the following work ahead of us:
>>> 1. Add pinctrl support to dw_mmc-exynos (with backward compability for
>>> GPIO specifier)
>>> 2. Add pinctrl support to spi-s3c64xx.c (with backward compability for
>>> GPIO specifier)
>>
>> There is a patch that should be already merged that makes the driver core
>> set default pinctrl state for a device before entering driver's probe
>> callback.
>>
>> In case when the driver doesn't require more states than just the default
>> one you don't have to add pinctrl support to the driver at all, just
>> specify appropriate pinctrl properties in device tree (with only one state
>> listed in pinctrl-names called "default").
>>
>> However in some drivers this might be prevented by legacy pin
>> configuration code which would fail.
>
> Nice to know about.  In the very least I'm pretty sure that we'll need
> a patch to make the GPIO settings optional.  Looking at
> dw_mci_exynos_setup_bus it's a fatal error if the GPIOs are missing.
> The dw_mmc stuff will also be interesting since we'll need to figure
> out if the muxing needs to be specified on a per-slot level.  I think
> that most of the automatic stuff won't work in that case.
>
> It sounds like Thomas is planning on taking this on?

Hi Doug,

Yes, I am currently held up with supporting default pin states at slot
level. One option that could be considered is to list out the default
pin states for all slots in the parent node of the slots. So it would
be something like below as an example.

dwmmc2@1222 {
   <>

pinctrl-names = "slot0-default", "slot1-default";
pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>;
pinctrl-1 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4 &sd2_bus8>;

slot@0 {
reg = <0>;
bus-width = <4>;
disable-wp;
};

slot@1 {
reg = <0>;
bus-width = <8>;
disable-wp;
};
};

Then, during the initial slot setup stage, the driver, knowing the
current slot number that is being setup, can setup the pin state for
the particular slot using the devm_pinctrl_get_select API. pinctrl
subsystem would not setup the default pin state in this case.

Does this look like a hack? For now, I have prepared patches without
this approach, since Exynos5250 has just one slot, I have just listed
only one default pin state, which the pinctrl framework helps to setup
during driver bind.

Thanks,
Thomas.

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


Re: State of pinctrl and exynos5250?

2013-03-05 Thread Doug Anderson
Tomasz,

Thanks for your response.


On Sat, Mar 2, 2013 at 3:48 AM, Tomasz Figa  wrote:
>
> The 4 patches above are already merged in Kgene's for-next-next (for 3.10)
> branch.

Excellent.  I see them now.  I haven't yet seen them show up in
linux-next (which is where I tend to look first), though...

>> ARM: dts: add pinctrl nodes for Exynos5250 SoC
>> - https://patchwork.kernel.org/patch/1871991/
>
> This one is not merged yet. Since I do not know much about Exynos 5250, I
> could not verify any hardware-specific details in the patch, just the
> general correctness of the patch.

OK, good.  That means you guys came to the same conclusions that I did.  :)

>> IMHO that means we've got the following work ahead of us:
>> 1. Add pinctrl support to dw_mmc-exynos (with backward compability for
>> GPIO specifier)
>> 2. Add pinctrl support to spi-s3c64xx.c (with backward compability for
>> GPIO specifier)
>
> There is a patch that should be already merged that makes the driver core
> set default pinctrl state for a device before entering driver's probe
> callback.
>
> In case when the driver doesn't require more states than just the default
> one you don't have to add pinctrl support to the driver at all, just
> specify appropriate pinctrl properties in device tree (with only one state
> listed in pinctrl-names called "default").
>
> However in some drivers this might be prevented by legacy pin
> configuration code which would fail.

Nice to know about.  In the very least I'm pretty sure that we'll need
a patch to make the GPIO settings optional.  Looking at
dw_mci_exynos_setup_bus it's a fatal error if the GPIOs are missing.
The dw_mmc stuff will also be interesting since we'll need to figure
out if the muxing needs to be specified on a per-slot level.  I think
that most of the automatic stuff won't work in that case.

It sounds like Thomas is planning on taking this on?

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


Re: [PATCH 2/2] Arm: socfpga: pl330: Add #dma-cells for generic dma binding support

2013-03-05 Thread Dinh Nguyen
On Mon, 2013-03-04 at 11:04 +0530, Padmavathi Venna wrote:
> This patch adds #dma-cells property to PL330 DMA controller nodes for
> supporting generic dma dt bindings on SOCFPGA platform. #dma-channels
> and #dma-requests are not required now but added in advance.
> 
> Signed-off-by: Padmavathi Venna 
> ---
> 
> Based on Torvalds tree
> 
>  arch/arm/boot/dts/socfpga.dtsi |3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi
> index 936d230..7e8769b 100644
> --- a/arch/arm/boot/dts/socfpga.dtsi
> +++ b/arch/arm/boot/dts/socfpga.dtsi
> @@ -75,6 +75,9 @@
>   compatible = "arm,pl330", "arm,primecell";
>   reg = <0xffe01000 0x1000>;
>   interrupts = <0 180 4>;
> + #dma-cells = <1>;
> + #dma-channels = <8>;
> + #dma-requests = <32>;

Acked-by: Dinh Nguyen};
>   };
>  



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


Re: [PATCH 00/23] RFC: exynos multiplatform support

2013-03-05 Thread Tomasz Figa
On Tuesday 05 of March 2013 19:19:02 Arnd Bergmann wrote:
> On Tuesday 05 March 2013, Tomasz Figa wrote:
> > > With this patch set, we can build mach-exynos as part
> > > of a multiplatform kernel, with the following caveats:
> > > 
> > > * Only DT based boards are supported
> > 
> > As far as I'm aware, there are plans to drop non-DT Exynos support.
> > Kgene should know more on this.
> 
> Yes, that was my understanding as well. It might not actually be too
> hard to get multiplatform working with the ATAGS based board files
> (we do that on some of the other platforms), but there is probably
> no reason to try hard.
> 
> > > * Moving to common-clk breaks things including cpufreq
> > > 
> > >   and others. Thomas is working on a patch for this
> > 
> > We have several patches internally for fixing things up to run
> > correclty with common-clk. I'll see if we can post some patches.
> 
> Ok, excellent.
> 
> > > * We disable the gpio implementation, which also breaks
> > > 
> > >   stuff, but Thomas has a patch already
> > 
> > The legacy GPIO code is needed only for non-DT case. DT-case uses the
> > new pinctrl-samsung driver, which is (AFAIK) multiplatform-aware.
> 
> Please have a closer look at the "ARM: exynos: work around missing gpio
> code on multiplatform" patch, I think there a few files I had to touch
> that actually rely on the legacy gpio code:
> 
> * the pm-gpio.c file
> * the s3c_i2c0_cfg_gpio function
> * the eint irqchip
> 
> If none of these are needed for DT-based systems, we should probably
> build that code conditionally based on the CONFIG_EXYNOS_ATAGS symbol
> I introduced.

Yes, none of them are needed for DT-based systems.

> > > * sparsemem support is not available on multiplatform
> > 
> > There was some discussion some time ago whether we really need
> > sparsemem on Exynos. If I remember correctly, it turned out that we
> > don't. So this is not really an issue.
> 
> Ok, good.
> 
> > > Arnd Bergmann (23):
> > >   ARM: exynos: introduce EXYNOS_ATAGS symbol
> > >   irqchip: exynos: remove dependency on mach/irqs.h
> > >   tty: serial/samsung: prepare for common clock API
> > >   tty: serial/samsung: make register definitions global
> > >   tty: serial/samsung: fix modular build
> > >   ARM: exynos: move debug-macro.S to include/debug/
> > >   i2c: s3c2410: make header file local
> > >   mmc: sdhci-s3c: remove platform dependencies
> > >   usb: exynos: do not include plat/usb-phy.h
> > >   [media] exynos: remove unnecessary header inclusions
> > >   video/exynos: remove unnecessary header inclusions
> > >   thermal/exynos: remove unnecessary header inclusions
> > >   mtd: onenand/samsung: make regs-onenand.h file local
> > >   rtc: s3c: make header file local
> > >   spi: s3c64xx: move to generic dmaengine API
> > >   pwm: samsung: repair the worst MMIO abuses
> > 
> > I'm currently working (in my free time) on a series of cleanup patches
> > sanitizing Samsung PWM code for S3C64xx and S5PV210 DT (and
> > multiplatform) support.
> 
> Ah, nice.
> 
> > On those platforms it is a bit more complex case as there are two
> > blocks of code that access the same hardware - samsung-time (using
> > two PWM channels for clocksource and clock events) and pwm-samsung.
> > 
> > Hopefully, I will have some patches ready soon.
> 
> How are you planning to solve this? Do you want to have a combined
> driver that registers both a clocksource and a pwm?

Let's start with a quick introduction to the s3c-pwm hardware. Each 
channel has its own timer value, compare and reload value registers, so 
they don't need any extra locking. However there are additional shared 
configuration registers, containing things such as start and reload bits 
for all channels, prescaler and main divisor values, etc. Those registers 
needs synchronization.

Now there are several possible approaches:

1) A brute force one - two separate drivers, based on the fact that the
   clocksource driver will be used only on uniprocessor systems, so
   a simple _irqsave when accessing a shared register in both will 
   guarantee correct synchronization.

2) Two separate drivers with some synchronized shared code accessing 
   registers (_start, _stop, _set_reload, _set_prescaler, _set_divisor, 
   etc.; all using a shared spinlock).

3) Single driver registering PWM channels, clocksource and clock event 
   device. This does not seem like a bad idea, since the whole code for 
   configuration of the PWM block would reside in one location and there 
   would be no redundancy. However there is a question where such driver 
   should be placed - drivers/clocksource, drivers/pwm, or maybe somewhere 
   else?

Personally I wanted to go with first option, which would require least 
amount of changes to existing code, at a cost of some code duplication 
(but some PWM code is duplicated already).

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.ker

Re: [PATCH 00/23] RFC: exynos multiplatform support

2013-03-05 Thread Arnd Bergmann
On Tuesday 05 March 2013, Heiko Stübner wrote:
> Am Dienstag, 5. März 2013, 22:54:22 schrieb Arnd Bergmann:
> > On Tuesday 05 March 2013, Arnd Bergmann wrote:
> 
> > We still need a solution for the ASoC drivers, but they are
> > not as essential. We could probably move the wrapper files
> > from plat-samsung/*dma*.c to sounds/soc/samsung when that becomes
> > the only remaining user.
> 
> In ASoC there is also a clear distinction between the different SoC
> generations. SND_SAMSUNG_I2S /_PCM /_AC97 ... is only used by newer SoCs
> while SND_S3C24XX_I2S and SND_S3C_I2SV2_SOC is used by the legacy SoCs.

Well, the only file that really needs to get changed is dma.c, which
seems to be used by both the old and the new drivers.

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


Re: [PATCH 1/2] ARM: exynos: pl330: Add #dma-cells for generic dma binding support

2013-03-05 Thread Arnd Bergmann
On Monday 04 March 2013, Padmavathi Venna wrote:
> 
> This patch adds #dma-cells property to PL330 DMA controller
> nodes for supporting generic dma dt bindings on samsung exynos
> platforms. #dma-channels and #dma-requests are not required now
> but added in advance.
> 
> Signed-off-by: Padmavathi Venna 

Acked-by: Arnd Bergmann 

Should we apply these directly to the arm-soc fixes branch, or wait
until they come back from the Samsung subarchitecture tree?
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 00/23] RFC: exynos multiplatform support

2013-03-05 Thread Heiko Stübner
Am Dienstag, 5. März 2013, 22:54:22 schrieb Arnd Bergmann:
> On Tuesday 05 March 2013, Arnd Bergmann wrote:
> > The s3c64xx_dma code is also interesting because
> > it has both an implementation of the s3c_dma interface in
> > arch/arm/mach-s3c64xx/dma.c and one using the generic interface in
> > drivers/dma/amba-pl08x.c.
> 
> This actually brings me to an interesting idea: the s3c64xx SPI driver
> is used with the regular dmaengine API and pl330 on S5P and Exynos,
> but with the s3c-dma interface and pl080 on S3C64xx.
>
> If we just convert S3C64xx to use the pl080 dmaengine driver
> instead, we can apply my SPI patch without breaking anything.

The S3C24XX starting from S3C2443 (including S3C2416 and S3C2450) also use the
s3c64xx-spi driver.

My argument has of course the problem of me seemingly being the only user of
it currently and it being stuff not in mainline yet [0] :-) .

But on the other hand, it's no use anyway staying attached to old cruft, so
it also wouldn't be a problem to go your way. I'll just try to come up with
a dmaengine driver for s3c24xx after common-clk and pinctrl ;-) .


[0] https://github.com/mmind/linux-es600/blob/topic/es600-devel/arch/arm/mach-
s3c24xx/mach-as090.c#L138


> We still need a solution for the ASoC drivers, but they are
> not as essential. We could probably move the wrapper files
> from plat-samsung/*dma*.c to sounds/soc/samsung when that becomes
> the only remaining user.

In ASoC there is also a clear distinction between the different SoC
generations. SND_SAMSUNG_I2S /_PCM /_AC97 ... is only used by newer SoCs
while SND_S3C24XX_I2S and SND_S3C_I2SV2_SOC is used by the legacy SoCs.

Of course "my subarch" is bitten again, as it's using the new sound
interface, but the same as above applies.


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


Re: [PATCH 00/23] RFC: exynos multiplatform support

2013-03-05 Thread Arnd Bergmann
On Tuesday 05 March 2013, Tomasz Figa wrote:
> AFAIR, the PL080 in S3C64xx is a slightly customized variant and requires 
> some modifications to the driver. However I'm saying this only based on 
> what I remember from the past, as I haven't checked current version of the 
> driver yet, so it's possible that it has been modified already.
> 
> I believe I will eventually have to take a look at it anyway, as it's a 
> necessary step towards S3C64xx DT support.

Ok. Let me know if you need any help adding DT support to the pl08x driver.
It would be nice to have that for SPEAr, Versatile and lpce32xx as well.

All three currently have full DT support except for the DMA binding,
since the common code for that was only added in 3.9-rc1.

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


Re: [PATCH 00/23] RFC: exynos multiplatform support

2013-03-05 Thread Tomasz Figa
On Tuesday 05 of March 2013 21:54:22 Arnd Bergmann wrote:
> On Tuesday 05 March 2013, Arnd Bergmann wrote:
> > The s3c64xx_dma code is also interesting because
> > it has both an implementation of the s3c_dma interface in
> > arch/arm/mach-s3c64xx/dma.c and one using the generic interface in
> > drivers/dma/amba-pl08x.c.
> 
> This actually brings me to an interesting idea: the s3c64xx SPI driver
> is used with the regular dmaengine API and pl330 on S5P and Exynos,
> but with the s3c-dma interface and pl080 on S3C64xx.
> 
> If we just convert S3C64xx to use the pl080 dmaengine driver
> instead, we can apply my SPI patch without breaking anything.

AFAIR, the PL080 in S3C64xx is a slightly customized variant and requires 
some modifications to the driver. However I'm saying this only based on 
what I remember from the past, as I haven't checked current version of the 
driver yet, so it's possible that it has been modified already.

I believe I will eventually have to take a look at it anyway, as it's a 
necessary step towards S3C64xx DT support.

Best regards,
Tomasz

> We still need a solution for the ASoC drivers, but they are
> not as essential. We could probably move the wrapper files
> from plat-samsung/*dma*.c to sounds/soc/samsung when that becomes
> the only remaining user.
> 
> There is also drivers/mmc/host/s3cmci.c, which uses the s3c-dma
> interface, but it is only used on s3c24xx, not s3c64xx or later.
> 
>   Arnd
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-samsung-soc" in the body of a message to
> majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 00/23] RFC: exynos multiplatform support

2013-03-05 Thread Arnd Bergmann
On Tuesday 05 March 2013, Arnd Bergmann wrote:
> The s3c64xx_dma code is also interesting because
> it has both an implementation of the s3c_dma interface in
> arch/arm/mach-s3c64xx/dma.c and one using the generic interface in
> drivers/dma/amba-pl08x.c. 

This actually brings me to an interesting idea: the s3c64xx SPI driver
is used with the regular dmaengine API and pl330 on S5P and Exynos,
but with the s3c-dma interface and pl080 on S3C64xx.

If we just convert S3C64xx to use the pl080 dmaengine driver
instead, we can apply my SPI patch without breaking anything.

We still need a solution for the ASoC drivers, but they are
not as essential. We could probably move the wrapper files
from plat-samsung/*dma*.c to sounds/soc/samsung when that becomes
the only remaining user.

There is also drivers/mmc/host/s3cmci.c, which uses the s3c-dma
interface, but it is only used on s3c24xx, not s3c64xx or later.

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


Re: [PATCH 00/23] RFC: exynos multiplatform support

2013-03-05 Thread Heiko Stübner
Am Dienstag, 5. März 2013, 18:42:10 schrieb Arnd Bergmann:
> Hi everyone,
> 
> Although I'm not present at the Linaro Connect hacking
> sessions, I am participating remotely and have tried
> hacking on multiplatform support for Exynos. This patch
> set is far from complete, but I think the patches
> can be useful anyway.
> 
> The series gets increasingly fishy towards the end,
> and we should probably not apply any of the last nine
> patches as-is, nor do I expect everything to work, since
> I have not tested them at all.
> 
> With this patch set, we can build mach-exynos as part
> of a multiplatform kernel, with the following caveats:
> 
> * Only DT based boards are supported
> * Moving to common-clk breaks things including cpufreq
>   and others. Thomas is working on a patch for this
> * We disable the gpio implementation, which also breaks
>   stuff, but Thomas has a patch already
> * Using the generic DMA engine API in SPI and ASoC
>   means they no longer work on S3C

If I remember correctly Kgene mentioning some time back, that someone was 
working on converting the s3c dma to dmaengine, but I never heard anything 
more about it.

So personally I would be grateful, for people not breaking my devices :-) .


On an unrelated note, exists some sort of documentation for creating dmaengine 
drivers somewhere? Documentation/* seems to always be only targetted at device 
driver writers and my own DMA knowledge is still stuck at the theoretical 
level they teach in generic operating-systems university courses.


Heiko
 

> * I did not like the solution for the UART driver, but
>   could also not think of a better one.
> * The FB_S3C, S3C2410_WATCHDOG and S3C_ADC drivers
>   are left as an exercise to the reader, they are
>   currently disabled with multiplatform
> * sparsemem support is not available on multiplatform
> 
> The patches are based on v3.9-rc1 and I have pushed
> the git branch to
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git
> testing/exynos-multiplatform
> 
> I have not yet added subsystem maintainers to Cc on the
> patches, I'd like to coordinate with the other people
> involved first, so see if they already have patches
> for the same drivers.
> 
>   Arnd
> 
> Arnd Bergmann (23):
>   ARM: exynos: introduce EXYNOS_ATAGS symbol
>   irqchip: exynos: remove dependency on mach/irqs.h
>   tty: serial/samsung: prepare for common clock API
>   tty: serial/samsung: make register definitions global
>   tty: serial/samsung: fix modular build
>   ARM: exynos: move debug-macro.S to include/debug/
>   i2c: s3c2410: make header file local
>   mmc: sdhci-s3c: remove platform dependencies
>   usb: exynos: do not include plat/usb-phy.h
>   [media] exynos: remove unnecessary header inclusions
>   video/exynos: remove unnecessary header inclusions
>   thermal/exynos: remove unnecessary header inclusions
>   mtd: onenand/samsung: make regs-onenand.h file local
>   rtc: s3c: make header file local
>   spi: s3c64xx: move to generic dmaengine API
>   pwm: samsung: repair the worst MMIO abuses
>   ASoC: samsung: move plat/ headers to local directory
>   ASoC: samsung: convert to dmaengine API
>   ASoC: samsung: use irq resource for idma
>   ARM: exynos: prepare for sparse IRQ
>   ARM: exynos: hack to disable private clock code
>   ARM: exynos: work around missing gpio code on multiplatform
>   ARM: exynos: experimental multiplatform support
> 
>  arch/arm/Kconfig  |  11 +-
>  arch/arm/Kconfig.debug|   8 +
>  arch/arm/include/debug/exynos.S   |  39 +++
>  arch/arm/include/debug/samsung.S  |  87 +++
>  arch/arm/mach-exynos/Kconfig  |  36 ++-
>  arch/arm/mach-exynos/Makefile |   5 +
>  arch/arm/mach-exynos/common.c |  14 +-
>  arch/arm/mach-exynos/common.h |   2 +-
>  arch/arm/mach-exynos/dev-audio.c  |   1 +
>  arch/arm/mach-exynos/dev-uart.c   |   1 +
>  arch/arm/mach-exynos/include/mach/debug-macro.S   |  39 ---
>  arch/arm/mach-exynos/include/mach/gpio.h  |   2 +
>  arch/arm/mach-exynos/include/mach/irqs.h  |   5 +-
>  arch/arm/mach-exynos/mach-armlex4210.c|   3 +
>  arch/arm/mach-exynos/mach-exynos4-dt.c|   2 +
>  arch/arm/mach-exynos/mach-exynos5-dt.c|   2 +
>  arch/arm/mach-exynos/mach-nuri.c  |   2 +
>  arch/arm/mach-exynos/mach-origen.c|   3 +
>  arch/arm/mach-exynos/mach-smdk4x12.c  |   2 +
>  arch/arm/mach-exynos/mach-smdkv310.c  |   3 +
>  arch/arm/mach-exynos/setup-i2c0.c |   3 +-
>  arch/arm/mach-exynos/setup-sdhci-gpio.c   |   2 +-
>  arch/arm/mach-exynos/setup-usb-phy.c  |   8 +-
>  arch/arm/mach-s3c24xx/clock-s3c2440.c |   5 +
>  arch/arm/mach-s3c24xx/common.c|   5 +
>  arch/arm/mach-s3c24xx/dma-s3c241

Re: [PATCH 00/23] RFC: exynos multiplatform support

2013-03-05 Thread Arnd Bergmann
On Tuesday 05 March 2013, Heiko Stübner wrote:
> If I remember correctly Kgene mentioning some time back, that someone was 
> working on converting the s3c dma to dmaengine, but I never heard anything 
> more about it.

Ok, let's see if we can find out what happened to that.

> So personally I would be grateful, for people not breaking my devices :-) .

I'm sure we can find a way. It's also clear that the current s3c_dma
does not have a bright future.

> On an unrelated note, exists some sort of documentation for creating 
> dmaengine 
> drivers somewhere? Documentation/* seems to always be only targetted at 
> device 
> driver writers and my own DMA knowledge is still stuck at the theoretical 
> level they teach in generic operating-systems university courses.

I think we only have Documentation/dmaengine.txt, which is targetted at
people using the dmaengine API, not at someone writing a driver.

I have only limited experience myself, but I know that it comes down
to filling the operations of a struct dma_device. A slight complication
is that the dmaengine interface handles both memory-to-memory transfers
and slave device transfers (the slave being the device that you are
talking to), and you have to know which parts are relevant for your
use case. You probably only need the slave interface, but it can seem
like it's bolted to the side of the original API.

drivers/dma/mxs-dma.c looks like a reasonable driver that one can
use as an example. The s3c64xx_dma code is also interesting because
it has both an implementation of the s3c_dma interface in
arch/arm/mach-s3c64xx/dma.c and one using the generic interface in
drivers/dma/amba-pl08x.c. The latter also implements a "virtual
channel" concept that you probably don't need.

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


Re: [PATCH] dma: of-dma: return error when 'dma-cells' not found

2013-03-05 Thread Arnd Bergmann
On Tuesday 05 March 2013, Rob Herring wrote:
> > Why would you call of_dma_controller_register() for a dma
> > engine that does not support slave channels, when that is the
> > only purpose of that interface?
> 
> Well maybe then that function should be allowed to fail without erroring
> out. I just fixed it a the line that failed.

We have a lot of interfaces that fall back to silently doing nothing
when there is no need.

> Doing be32_to_cpup directly
> on a function return that can be NULL is not correct either.

Agreed.
 
> > Note that the binding defines #dma-cells as required, and it
> > does not make any sense otherwise.
> 
> The 2nd patch I submitted changes that. It does not make sense to
> require it if you have no requests and hence will never have a phandle
> reference in a slave device.

I still don't see why you would want to use the binding for
dma slaves to describe a dmaengine that does not have slaves.

> The simple fact is that the pl330 had an
> existing binding that worked for the memory to memory only case and
> kernel changes broke this. Kernel changes should not break existing
> device-trees.

Of course we should not break the existing device tree, but I think
it would be more sensible to change the pl330 specific binding in this
case to require the use of the generic dma slave binding only when
there are slaves connected to it.

If the #dma-cells property is absent, the pl330 driver can be changed
not to call of_dma_controller_register.

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


Re: [PATCH 00/23] RFC: exynos multiplatform support

2013-03-05 Thread Arnd Bergmann
On Tuesday 05 March 2013, Tomasz Figa wrote:
> > 
> > With this patch set, we can build mach-exynos as part
> > of a multiplatform kernel, with the following caveats:
> > 
> > * Only DT based boards are supported
> 
> As far as I'm aware, there are plans to drop non-DT Exynos support. Kgene 
> should know more on this.

Yes, that was my understanding as well. It might not actually be too 
hard to get multiplatform working with the ATAGS based board files
(we do that on some of the other platforms), but there is probably
no reason to try hard.
 
> > * Moving to common-clk breaks things including cpufreq
> >   and others. Thomas is working on a patch for this
> 
> We have several patches internally for fixing things up to run correclty with 
> common-clk. I'll see if we can post some patches.

Ok, excellent.

> > * We disable the gpio implementation, which also breaks
> >   stuff, but Thomas has a patch already
> 
> The legacy GPIO code is needed only for non-DT case. DT-case uses the new 
> pinctrl-samsung driver, which is (AFAIK) multiplatform-aware.

Please have a closer look at the "ARM: exynos: work around missing gpio
code on multiplatform" patch, I think there a few files I had to touch
that actually rely on the legacy gpio code:

* the pm-gpio.c file
* the s3c_i2c0_cfg_gpio function
* the eint irqchip

If none of these are needed for DT-based systems, we should probably
build that code conditionally based on the CONFIG_EXYNOS_ATAGS symbol
I introduced.

> > * sparsemem support is not available on multiplatform
> 
> There was some discussion some time ago whether we really need sparsemem on 
> Exynos. If I remember correctly, it turned out that we don't. So this is not 
> really an issue.

Ok, good.
 
> > Arnd Bergmann (23):
> >   ARM: exynos: introduce EXYNOS_ATAGS symbol
> >   irqchip: exynos: remove dependency on mach/irqs.h
> >   tty: serial/samsung: prepare for common clock API
> >   tty: serial/samsung: make register definitions global
> >   tty: serial/samsung: fix modular build
> >   ARM: exynos: move debug-macro.S to include/debug/
> >   i2c: s3c2410: make header file local
> >   mmc: sdhci-s3c: remove platform dependencies
> >   usb: exynos: do not include plat/usb-phy.h
> >   [media] exynos: remove unnecessary header inclusions
> >   video/exynos: remove unnecessary header inclusions
> >   thermal/exynos: remove unnecessary header inclusions
> >   mtd: onenand/samsung: make regs-onenand.h file local
> >   rtc: s3c: make header file local
> >   spi: s3c64xx: move to generic dmaengine API
> >   pwm: samsung: repair the worst MMIO abuses
> 
> I'm currently working (in my free time) on a series of cleanup patches 
> sanitizing Samsung PWM code for S3C64xx and S5PV210 DT (and multiplatform) 
> support.

Ah, nice.

> On those platforms it is a bit more complex case as there are two blocks of 
> code that access the same hardware - samsung-time (using two PWM channels for 
> clocksource and clock events) and pwm-samsung.
> 
> Hopefully, I will have some patches ready soon.

How are you planning to solve this? Do you want to have a combined driver that
registers both a clocksource and a pwm?

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


[PATCH] ARM: EXYNOS: remove EXYNOS_DEV_SYSMMU entirely

2013-03-05 Thread Paul Bolle
Commit 25e9d28d927d2e1731df53f60cde53d75bcb7c36 ("ARM: EXYNOS: remove
system mmu initialization from exynos tree") removed the Kconfig symbol
EXYNOS_DEV_SYSMMU. Remove its last traces too.

Signed-off-by: Paul Bolle 
---
0) Untested.

1) Please note that this patch changes the dependencies of EXYNOS_IOMMU
(it removed a dependency that could never be met). That's probably what
needs to be done but some specific review is needed here.

 arch/arm/mach-exynos/Kconfig | 4 
 drivers/iommu/Kconfig| 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 70f94c8..6c2bdc3 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -200,7 +200,6 @@ config MACH_SMDKV310
select EXYNOS4_SETUP_USB_PHY
select EXYNOS_DEV_DMA
select EXYNOS_DEV_DRM
-   select EXYNOS_DEV_SYSMMU
select S3C24XX_PWM
select S3C_DEV_HSMMC
select S3C_DEV_HSMMC1
@@ -254,7 +253,6 @@ config MACH_UNIVERSAL_C210
select EXYNOS4_SETUP_USB_PHY
select EXYNOS_DEV_DMA
select EXYNOS_DEV_DRM
-   select EXYNOS_DEV_SYSMMU
select HAVE_SCHED_CLOCK
select S3C_DEV_HSMMC
select S3C_DEV_HSMMC2
@@ -331,7 +329,6 @@ config MACH_ORIGEN
select EXYNOS4_SETUP_USB_PHY
select EXYNOS_DEV_DMA
select EXYNOS_DEV_DRM
-   select EXYNOS_DEV_SYSMMU
select S3C24XX_PWM
select S3C_DEV_HSMMC
select S3C_DEV_HSMMC2
@@ -367,7 +364,6 @@ config MACH_SMDK4212
select EXYNOS4_SETUP_USB_PHY
select EXYNOS_DEV_DMA
select EXYNOS_DEV_DRM
-   select EXYNOS_DEV_SYSMMU
select S3C24XX_PWM
select S3C_DEV_HSMMC2
select S3C_DEV_HSMMC3
diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index 5c514d07..c520c20 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -168,7 +168,7 @@ config TEGRA_IOMMU_SMMU
 
 config EXYNOS_IOMMU
bool "Exynos IOMMU Support"
-   depends on ARCH_EXYNOS && EXYNOS_DEV_SYSMMU
+   depends on ARCH_EXYNOS
select IOMMU_API
help
  Support for the IOMMU(System MMU) of Samsung Exynos application
-- 
1.7.11.7

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


Re: [PATCH 00/23] RFC: exynos multiplatform support

2013-03-05 Thread Tomasz Figa
Hi Arnd,

First of all, thanks for your great effort on making Exynos multiplatform-
friendly.

I have added my two cents inline.

On Tuesday 05 of March 2013 18:42:10 Arnd Bergmann wrote:
> Hi everyone,
> 
> Although I'm not present at the Linaro Connect hacking
> sessions, I am participating remotely and have tried
> hacking on multiplatform support for Exynos. This patch
> set is far from complete, but I think the patches
> can be useful anyway.
> 
> The series gets increasingly fishy towards the end,
> and we should probably not apply any of the last nine
> patches as-is, nor do I expect everything to work, since
> I have not tested them at all.
> 
> With this patch set, we can build mach-exynos as part
> of a multiplatform kernel, with the following caveats:
> 
> * Only DT based boards are supported

As far as I'm aware, there are plans to drop non-DT Exynos support. Kgene 
should know more on this.

> * Moving to common-clk breaks things including cpufreq
>   and others. Thomas is working on a patch for this

We have several patches internally for fixing things up to run correclty with 
common-clk. I'll see if we can post some patches.

> * We disable the gpio implementation, which also breaks
>   stuff, but Thomas has a patch already

The legacy GPIO code is needed only for non-DT case. DT-case uses the new 
pinctrl-samsung driver, which is (AFAIK) multiplatform-aware.

> * Using the generic DMA engine API in SPI and ASoC
>   means they no longer work on S3C
> * I did not like the solution for the UART driver, but
>   could also not think of a better one.
> * The FB_S3C, S3C2410_WATCHDOG and S3C_ADC drivers
>   are left as an exercise to the reader, they are
>   currently disabled with multiplatform
> * sparsemem support is not available on multiplatform

There was some discussion some time ago whether we really need sparsemem on 
Exynos. If I remember correctly, it turned out that we don't. So this is not 
really an issue.

> The patches are based on v3.9-rc1 and I have pushed
> the git branch to
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git
> testing/exynos-multiplatform
> 
> I have not yet added subsystem maintainers to Cc on the
> patches, I'd like to coordinate with the other people
> involved first, so see if they already have patches
> for the same drivers.
> 
>   Arnd
> 
> Arnd Bergmann (23):
>   ARM: exynos: introduce EXYNOS_ATAGS symbol
>   irqchip: exynos: remove dependency on mach/irqs.h
>   tty: serial/samsung: prepare for common clock API
>   tty: serial/samsung: make register definitions global
>   tty: serial/samsung: fix modular build
>   ARM: exynos: move debug-macro.S to include/debug/
>   i2c: s3c2410: make header file local
>   mmc: sdhci-s3c: remove platform dependencies
>   usb: exynos: do not include plat/usb-phy.h
>   [media] exynos: remove unnecessary header inclusions
>   video/exynos: remove unnecessary header inclusions
>   thermal/exynos: remove unnecessary header inclusions
>   mtd: onenand/samsung: make regs-onenand.h file local
>   rtc: s3c: make header file local
>   spi: s3c64xx: move to generic dmaengine API
>   pwm: samsung: repair the worst MMIO abuses

I'm currently working (in my free time) on a series of cleanup patches 
sanitizing Samsung PWM code for S3C64xx and S5PV210 DT (and multiplatform) 
support.

On those platforms it is a bit more complex case as there are two blocks of 
code that access the same hardware - samsung-time (using two PWM channels for 
clocksource and clock events) and pwm-samsung.

Hopefully, I will have some patches ready soon.

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center
SW Solution Development, Kernel and System Framework

>   ASoC: samsung: move plat/ headers to local directory
>   ASoC: samsung: convert to dmaengine API
>   ASoC: samsung: use irq resource for idma
>   ARM: exynos: prepare for sparse IRQ
>   ARM: exynos: hack to disable private clock code
>   ARM: exynos: work around missing gpio code on multiplatform
>   ARM: exynos: experimental multiplatform support
> 
>  arch/arm/Kconfig  |  11 +-
>  arch/arm/Kconfig.debug|   8 +
>  arch/arm/include/debug/exynos.S   |  39 +++
>  arch/arm/include/debug/samsung.S  |  87 +++
>  arch/arm/mach-exynos/Kconfig  |  36 ++-
>  arch/arm/mach-exynos/Makefile |   5 +
>  arch/arm/mach-exynos/common.c |  14 +-
>  arch/arm/mach-exynos/common.h |   2 +-
>  arch/arm/mach-exynos/dev-audio.c  |   1 +
>  arch/arm/mach-exynos/dev-uart.c   |   1 +
>  arch/arm/mach-exynos/include/mach/debug-macro.S   |  39 ---
>  arch/arm/mach-exynos/include/mach/gpio.h  |   2 +
>  arch/arm/mach-exynos/include/mach/irqs.h  |   5 +-
>  arch/arm/mach-exynos/mach-armlex4210.c|   3 +
>  arch/arm/mach-exynos/mach-exynos4-dt.c|   2 +
>  arch/ar

Re: [PATCH 00/23] RFC: exynos multiplatform support

2013-03-05 Thread Tony Lindgren
* Arnd Bergmann  [130305 09:51]:
> Hi everyone,
> 
> Although I'm not present at the Linaro Connect hacking
> sessions, I am participating remotely and have tried
> hacking on multiplatform support for Exynos. This patch
> set is far from complete, but I think the patches
> can be useful anyway.
> 
> The series gets increasingly fishy towards the end,
> and we should probably not apply any of the last nine
> patches as-is, nor do I expect everything to work, since
> I have not tested them at all.
> 
> With this patch set, we can build mach-exynos as part
> of a multiplatform kernel, with the following caveats:
> 
> * Only DT based boards are supported
> * Moving to common-clk breaks things including cpufreq
>   and others. Thomas is working on a patch for this
> * We disable the gpio implementation, which also breaks
>   stuff, but Thomas has a patch already
> * Using the generic DMA engine API in SPI and ASoC
>   means they no longer work on S3C
> * I did not like the solution for the UART driver, but
>   could also not think of a better one.
> * The FB_S3C, S3C2410_WATCHDOG and S3C_ADC drivers
>   are left as an exercise to the reader, they are
>   currently disabled with multiplatform
> * sparsemem support is not available on multiplatform

For booting, you might want to add fixing up of the initcalls
to your checklist too as that can easily cause surprises to
other SoCs.

Regards,

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


Re: [PATCH 1/3] pinctrl: exynos: add exynos5250 SoC specific data

2013-03-05 Thread Thomas Abraham
On 27 December 2012 22:28, Kukjin Kim  wrote:
> Thomas Abraham wrote:
>>
>> Hi Linus,
>>
>> On 14 December 2012 21:21, Linus Walleij  wrote:
>> > On Thu, Dec 13, 2012 at 12:54 PM, Thomas Abraham
>> >  wrote:
>> >
>> >> Add Samsung Exynos5250 SoC specific data to enable pinctrl support for
>> >> all platforms based on Exynos5250.
>> >>
>> >> Signed-off-by: Thomas Abraham 
>> >
>> > Acked-by: Linus Walleij 
>> >
>> > For this series, I guess you'll fix it through the Samsung tree?
>>
>> Thanks for your ack. Since there are patches to be prepared for
>> migrating the rest of Exynos5250 related code to the pinctrl
>> framework, it would be easier if this series goes through the Samsung
>> tree.
>>
> I applied this series, thanks.

This series has not made it into 3.9-rc1. So I will rebase this series
to 3.9-rc1 and post again.

Thanks,
Thomas.

>
> And I think, would be clear if the config could be changed like following.
>
> 8<--
> From: Kukjin Kim 
> Subject: [PATCH] pinctrl: exynos: change PINCTRL_EXYNOS option
>
> Since pinctrl-exynos can support exynos4 and exynos5 so changed
> the option name to PINCTRL_EXYNOS for more clarity.
>
> Cc: Thomas Abraham 
> Cc: Linus Walleij 
> Cc: Grant Likely 
> Signed-off-by: Kukjin Kim 
> ---
> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
> index 91d5b6f..e1f63e7 100644
> --- a/arch/arm/mach-exynos/Kconfig
> +++ b/arch/arm/mach-exynos/Kconfig
> @@ -412,7 +412,7 @@ config MACH_EXYNOS4_DT
> select CPU_EXYNOS4210
> select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
> select PINCTRL
> -   select PINCTRL_EXYNOS4
> +   select PINCTRL_EXYNOS
> select USE_OF
> help
>   Machine support for Samsung Exynos4 machine with device tree
> enabled.
> diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
> index c31aeb0..f59feab 100644
> --- a/drivers/pinctrl/Kconfig
> +++ b/drivers/pinctrl/Kconfig
> @@ -185,8 +185,8 @@ config PINCTRL_SAMSUNG
> select PINMUX
> select PINCONF
>
> -config PINCTRL_EXYNOS4
> -   bool "Pinctrl driver data for Exynos4 SoC"
> +config PINCTRL_EXYNOS
> +   bool "Pinctrl driver data for Samsung EXYNOS SoCs"
> depends on OF && GPIOLIB
> select PINCTRL_SAMSUNG
>
> diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
> index fc4606f..6e87e52 100644
> --- a/drivers/pinctrl/Makefile
> +++ b/drivers/pinctrl/Makefile
> @@ -36,7 +36,7 @@ obj-$(CONFIG_PINCTRL_TEGRA30) += pinctrl-tegra30.o
>  obj-$(CONFIG_PINCTRL_U300) += pinctrl-u300.o
>  obj-$(CONFIG_PINCTRL_COH901)   += pinctrl-coh901.o
>  obj-$(CONFIG_PINCTRL_SAMSUNG)  += pinctrl-samsung.o
> -obj-$(CONFIG_PINCTRL_EXYNOS4)  += pinctrl-exynos.o
> +obj-$(CONFIG_PINCTRL_EXYNOS)   += pinctrl-exynos.o
>  obj-$(CONFIG_PINCTRL_EXYNOS5440)   += pinctrl-exynos5440.o
>  obj-$(CONFIG_PINCTRL_XWAY) += pinctrl-xway.o
>  obj-$(CONFIG_PINCTRL_LANTIQ)   += pinctrl-lantiq.o
> 8<--
>
> - Kukjin
>
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 16/23] pwm: samsung: repair the worst MMIO abuses

2013-03-05 Thread Arnd Bergmann
The Samsung PWM driver uses "magic" pointers that are mapped
at boot time to point its MMIO registers. This fails horribly
with a multiplatform kernel, which can not rely on platform
specific header files to contain the right values, aside from
this being a really bad idea in general.

This changes the driver to at least pass an __iomem token
around in the device structure to dereference that. Fixing
the platform code is much harder, so we'll leave that
until we have a DT binding for pwm-samsung, which may require
other changes in this area. Since we are already touching
every MMIO accessor in this driver, let's also use the
proper readl_relaxed variant rather than __raw_readl.

Signed-off-by: Arnd Bergmann 
---
 drivers/pwm/pwm-samsung.c | 60 +--
 1 file changed, 42 insertions(+), 18 deletions(-)

diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c
index 5207e6c..9d7234d 100644
--- a/drivers/pwm/pwm-samsung.c
+++ b/drivers/pwm/pwm-samsung.c
@@ -22,9 +22,25 @@
 #include 
 #include 
 
-#include 
+#ifndef CONFIG_ARCH_MULTIPLATFORM
+/*
+ * This is gross: the platform maps the timer at a fixed
+ * virtual address and expects us to use that address
+ * rather than a proper resource. This should get done properly
+ * when we get a DT binding for this driver.
+ */
+#include 
+static inline void dummy(void)
+{
+   BUILD_BUG_ON(S3C_VA_TIMER != IOMEM(0xf630));
+}
+#else
+#define S3C_VA_TIMER IOMEM(0xf630);
+#endif
 
-#include 
+#define S3C2410_TCON   8
+#define S3C2410_TCNTB(tmr) (0x0c + (tmr)*0x0c + 0x00)
+#define S3C2410_TCMPB(tmr) (0x0c + (tmr)*0x0c + 0x04)
 
 struct s3c_chip {
struct platform_device  *pdev;
@@ -38,6 +54,7 @@ struct s3c_chip {
 
unsigned chartcon_base;
unsigned charpwm_id;
+   void __iomem*base;
struct pwm_chip  chip;
 };
 
@@ -65,9 +82,9 @@ static int s3c_pwm_enable(struct pwm_chip *chip, struct 
pwm_device *pwm)
 
local_irq_save(flags);
 
-   tcon = __raw_readl(S3C2410_TCON);
+   tcon = readl_relaxed(s3c->base + S3C2410_TCON);
tcon |= pwm_tcon_start(s3c);
-   __raw_writel(tcon, S3C2410_TCON);
+   writel_relaxed(tcon, s3c->base + S3C2410_TCON);
 
local_irq_restore(flags);
 
@@ -82,9 +99,9 @@ static void s3c_pwm_disable(struct pwm_chip *chip, struct 
pwm_device *pwm)
 
local_irq_save(flags);
 
-   tcon = __raw_readl(S3C2410_TCON);
+   tcon = readl_relaxed(s3c->base + S3C2410_TCON);
tcon &= ~pwm_tcon_start(s3c);
-   __raw_writel(tcon, S3C2410_TCON);
+   writel_relaxed(tcon, s3c->base + S3C2410_TCON);
 
local_irq_restore(flags);
 }
@@ -133,8 +150,8 @@ static int s3c_pwm_config(struct pwm_chip *chip, struct 
pwm_device *pwm,
/* The TCMP and TCNT can be read without a lock, they're not
 * shared between the timers. */
 
-   tcmp = __raw_readl(S3C2410_TCMPB(s3c->pwm_id));
-   tcnt = __raw_readl(S3C2410_TCNTB(s3c->pwm_id));
+   tcmp = readl_relaxed(s3c->base + S3C2410_TCMPB(s3c->pwm_id));
+   tcnt = readl_relaxed(s3c->base + S3C2410_TCNTB(s3c->pwm_id));
 
period = NS_IN_HZ / period_ns;
 
@@ -177,16 +194,16 @@ static int s3c_pwm_config(struct pwm_chip *chip, struct 
pwm_device *pwm,
 
local_irq_save(flags);
 
-   __raw_writel(tcmp, S3C2410_TCMPB(s3c->pwm_id));
-   __raw_writel(tcnt, S3C2410_TCNTB(s3c->pwm_id));
+   writel_relaxed(tcmp, s3c->base + S3C2410_TCMPB(s3c->pwm_id));
+   writel_relaxed(tcnt, s3c->base + S3C2410_TCNTB(s3c->pwm_id));
 
-   tcon = __raw_readl(S3C2410_TCON);
+   tcon = readl_relaxed(s3c->base + S3C2410_TCON);
tcon |= pwm_tcon_manulupdate(s3c);
tcon |= pwm_tcon_autoreload(s3c);
-   __raw_writel(tcon, S3C2410_TCON);
+   writel_relaxed(tcon, s3c->base + S3C2410_TCON);
 
tcon &= ~pwm_tcon_manulupdate(s3c);
-   __raw_writel(tcon, S3C2410_TCON);
+   writel_relaxed(tcon, s3c->base + S3C2410_TCON);
 
local_irq_restore(flags);
 
@@ -207,6 +224,7 @@ static int s3c_pwm_probe(struct platform_device *pdev)
unsigned long flags;
unsigned long tcon;
unsigned int id = pdev->id;
+   struct resource *res;
int ret;
 
if (id == 4) {
@@ -220,6 +238,12 @@ static int s3c_pwm_probe(struct platform_device *pdev)
return -ENOMEM;
}
 
+   /* try to get a proper base address, fall back to S3C_VA_TIMER */
+   s3c->base = S3C_VA_TIMER;
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (res)
+   s3c->base = devm_ioremap(dev, res->start, resource_size(res));
+
/* calculate base of control bits in TCON */
s3c->tcon_base = id == 0 ? 0 : (id * 4) + 4;
s3c->pwm_id = id;
@@ -245,9 +269,9 @@ static int s3c_pwm_probe(struct platform_device *pdev)
 
local_irq_save(flags);
 
-   tcon = __raw_readl(S3C2410_TCON);
+  

[PATCH 22/23] ARM: exynos: work around missing gpio code on multiplatform

2013-03-05 Thread Arnd Bergmann
With CONFIG_ARCH_MULTIPLATFORM, we can no longer have
our own mach/gpio.h included by the kernel-wide linux/gpio.h
header, and disabling the gpio-samsung driver means we cannot
use any of the private interfaces. This patch disables
all code referring to the driver and gets things to build
again, but surely breaks a lot of stuff in the process.

Thomas Abraham alrady has a proper set of patches to
address this.

Do not apply.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/mach-exynos/Makefile  | 2 ++
 arch/arm/mach-exynos/common.c  | 3 +++
 arch/arm/mach-exynos/dev-audio.c   | 1 +
 arch/arm/mach-exynos/include/mach/gpio.h   | 2 ++
 arch/arm/mach-exynos/mach-armlex4210.c | 1 +
 arch/arm/mach-exynos/mach-origen.c | 1 +
 arch/arm/mach-exynos/setup-i2c0.c  | 3 ++-
 arch/arm/mach-s3c64xx/include/mach/gpio.h  | 4 
 arch/arm/plat-samsung/include/plat/gpio-core.h | 3 +++
 arch/arm/plat-samsung/pm-gpio.c| 1 +
 drivers/gpio/Makefile  | 2 +-
 11 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index b0dcf7d..e2f1742 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -50,7 +50,9 @@ obj-$(CONFIG_MACH_EXYNOS5_DT) += mach-exynos5-dt.o
 # device support
 
 obj-y  += dev-uart.o
+ifdef CONFIG_ARCH_EXYNOS_SINGLE
 obj-$(CONFIG_ARCH_EXYNOS4) += dev-audio.o
+endif
 obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o
 obj-$(CONFIG_EXYNOS_DEV_DMA)   += dma.o
 obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI) += dev-ohci.o
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 504d50e..59607b5 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -745,10 +746,12 @@ static int exynos_irq_eint_set_type(struct irq_data 
*data, unsigned int type)
__raw_writel(ctrl, EINT_CON(exynos_eint_base, data->irq));
spin_unlock(&eint_lock);
 
+#ifdef CONFIG_ARCH_EXYNOS_SINGLE
if (soc_is_exynos5250())
s3c_gpio_cfgpin(exynos5_irq_to_gpio(data->irq), 
S3C_GPIO_SFN(0xf));
else
s3c_gpio_cfgpin(exynos4_irq_to_gpio(data->irq), 
S3C_GPIO_SFN(0xf));
+#endif
 
return 0;
 }
diff --git a/arch/arm/mach-exynos/dev-audio.c b/arch/arm/mach-exynos/dev-audio.c
index c662c89..25b173b 100644
--- a/arch/arm/mach-exynos/dev-audio.c
+++ b/arch/arm/mach-exynos/dev-audio.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define EXYNOS4_AUDSS_INT_MEM  (0x0300)
 
diff --git a/arch/arm/mach-exynos/include/mach/gpio.h 
b/arch/arm/mach-exynos/include/mach/gpio.h
index eb24f1e..88c6d26 100644
--- a/arch/arm/mach-exynos/include/mach/gpio.h
+++ b/arch/arm/mach-exynos/include/mach/gpio.h
@@ -284,6 +284,8 @@ enum exynos5_gpio_number {
 
 /* define the number of gpios */
 
+#ifdef CONFIG_MACH_EXYNOS_SINGLE
 #define ARCH_NR_GPIOS  (CONFIG_SAMSUNG_GPIO_EXTRA + S3C_GPIO_END)
+#endif
 
 #endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-exynos/mach-armlex4210.c 
b/arch/arm/mach-exynos/mach-armlex4210.c
index cb95992..2a8e7c1 100644
--- a/arch/arm/mach-exynos/mach-armlex4210.c
+++ b/arch/arm/mach-exynos/mach-armlex4210.c
@@ -27,6 +27,7 @@
 
 #include 
 #include 
+#include 
 
 #include "common.h"
 
diff --git a/arch/arm/mach-exynos/mach-origen.c 
b/arch/arm/mach-exynos/mach-origen.c
index d1849d1..72650e2 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -47,6 +47,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include "common.h"
diff --git a/arch/arm/mach-exynos/setup-i2c0.c 
b/arch/arm/mach-exynos/setup-i2c0.c
index e2d9dfb..95acd62 100644
--- a/arch/arm/mach-exynos/setup-i2c0.c
+++ b/arch/arm/mach-exynos/setup-i2c0.c
@@ -17,10 +17,11 @@ struct platform_device; /* don't need the contents */
 #include 
 #include 
 #include 
+#include 
 
 void s3c_i2c0_cfg_gpio(struct platform_device *dev)
 {
-   if (soc_is_exynos5250() || soc_is_exynos5440())
+   if (soc_is_exynos5250() || soc_is_exynos5440() || 
!IS_ENABLED(CONFIG_ARCH_EXYNOS_SINGLE))
/* will be implemented with gpio function */
return;
 
diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio.h 
b/arch/arm/mach-s3c64xx/include/mach/gpio.h
index 8b540c4..95be5b5 100644
--- a/arch/arm/mach-s3c64xx/include/mach/gpio.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio.h
@@ -11,6 +11,8 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
 */
+#ifndef __MACH_GPIO_H
+#define __MACH_GPIO_H
 
 /* GPIO bank sizes */
 #define S3C64XX_GPIO_A_NR  (8)
@@ -91,3 +93,5 @@ enum s3c_gpio_number {
 #define BOARD_NR_GPIOS (16 + CONFIG_SAMSUNG_GPIO_EXTRA)
 
 #define ARCH_NR_GPIOS  (GPIO_

[PATCH 08/23] mmc: sdhci-s3c: remove platform dependencies

2013-03-05 Thread Arnd Bergmann
plat/regs-sdhci.h is not used anywhere but in the sdhci-s3c
driver, so it can become a local file there and all other
inclusions removed.

plat/sdhci.h is used only to define the platform devices,
and with the exception of the platform_data structure not
needed by the driver, so we can split out the platform_data
definition instead and leave the rest to platform code.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/mach-exynos/setup-sdhci-gpio.c |  2 +-
 arch/arm/mach-s5pc100/setup-sdhci-gpio.c|  1 -
 arch/arm/mach-s5pv210/setup-sdhci-gpio.c|  1 -
 arch/arm/plat-samsung/include/plat/regs-sdhci.h | 87 -
 arch/arm/plat-samsung/include/plat/sdhci.h  | 56 +---
 drivers/mmc/host/Kconfig|  2 +-
 drivers/mmc/host/sdhci-s3c-regs.h   | 87 +
 drivers/mmc/host/sdhci-s3c.c|  5 +-
 include/linux/platform_data/mmc-sdhci-s3c.h | 56 
 9 files changed, 148 insertions(+), 149 deletions(-)
 delete mode 100644 arch/arm/plat-samsung/include/plat/regs-sdhci.h
 create mode 100644 drivers/mmc/host/sdhci-s3c-regs.h
 create mode 100644 include/linux/platform_data/mmc-sdhci-s3c.h

diff --git a/arch/arm/mach-exynos/setup-sdhci-gpio.c 
b/arch/arm/mach-exynos/setup-sdhci-gpio.c
index e8d08bf..d5b98c8 100644
--- a/arch/arm/mach-exynos/setup-sdhci-gpio.c
+++ b/arch/arm/mach-exynos/setup-sdhci-gpio.c
@@ -19,8 +19,8 @@
 #include 
 #include 
 
+#include 
 #include 
-#include 
 #include 
 
 void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
diff --git a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c 
b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
index 03c02d0..6010c03 100644
--- a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
@@ -19,7 +19,6 @@
 #include 
 
 #include 
-#include 
 #include 
 
 void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c 
b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
index 3e3ac05..0512ada 100644
--- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
@@ -20,7 +20,6 @@
 #include 
 
 #include 
-#include 
 #include 
 
 void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
diff --git a/arch/arm/plat-samsung/include/plat/regs-sdhci.h 
b/arch/arm/plat-samsung/include/plat/regs-sdhci.h
deleted file mode 100644
index e34049a..000
--- a/arch/arm/plat-samsung/include/plat/regs-sdhci.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* linux/arch/arm/plat-s3c/include/plat/regs-sdhci.h
- *
- * Copyright 2008 Openmoko, Inc.
- * Copyright 2008 Simtec Electronics
- * http://armlinux.simtec.co.uk/
- * Ben Dooks 
- *
- * S3C Platform - SDHCI (HSMMC) register definitions
- *
- * 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.
-*/
-
-#ifndef __PLAT_S3C_SDHCI_REGS_H
-#define __PLAT_S3C_SDHCI_REGS_H __FILE__
-
-#define S3C_SDHCI_CONTROL2 (0x80)
-#define S3C_SDHCI_CONTROL3 (0x84)
-#define S3C64XX_SDHCI_CONTROL4 (0x8C)
-
-#define S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR  (1 << 31)
-#define S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK(1 << 30)
-#define S3C_SDHCI_CTRL2_CDINVRXD3  (1 << 29)
-#define S3C_SDHCI_CTRL2_SLCARDOUT  (1 << 28)
-
-#define S3C_SDHCI_CTRL2_FLTCLKSEL_MASK (0xf << 24)
-#define S3C_SDHCI_CTRL2_FLTCLKSEL_SHIFT(24)
-#define S3C_SDHCI_CTRL2_FLTCLKSEL(_x)  ((_x) << 24)
-
-#define S3C_SDHCI_CTRL2_LVLDAT_MASK(0xff << 16)
-#define S3C_SDHCI_CTRL2_LVLDAT_SHIFT   (16)
-#define S3C_SDHCI_CTRL2_LVLDAT(_x) ((_x) << 16)
-
-#define S3C_SDHCI_CTRL2_ENFBCLKTX  (1 << 15)
-#define S3C_SDHCI_CTRL2_ENFBCLKRX  (1 << 14)
-#define S3C_SDHCI_CTRL2_SDCDSEL(1 << 13)
-#define S3C_SDHCI_CTRL2_SDSIGPC(1 << 12)
-#define S3C_SDHCI_CTRL2_ENBUSYCHKTXSTART   (1 << 11)
-
-#define S3C_SDHCI_CTRL2_DFCNT_MASK (0x3 << 9)
-#define S3C_SDHCI_CTRL2_DFCNT_SHIFT(9)
-#define S3C_SDHCI_CTRL2_DFCNT_NONE (0x0 << 9)
-#define S3C_SDHCI_CTRL2_DFCNT_4SDCLK   (0x1 << 9)
-#define S3C_SDHCI_CTRL2_DFCNT_16SDCLK  (0x2 << 9)
-#define S3C_SDHCI_CTRL2_DFCNT_64SDCLK  (0x3 << 9)
-
-#define S3C_SDHCI_CTRL2_ENCLKOUTHOLD   (1 << 8)
-#define S3C_SDHCI_CTRL2_RWAITMODE  (1 << 7)
-#define S3C_SDHCI_CTRL2_DISBUFRD   (1 << 6)
-#define S3C_SDHCI_CTRL2_SELBASECLK_MASK(0x3 << 4)
-#define S3C_SDHCI_CTRL2_SELBASECLK_SHIFT   (4)
-#define S3C_SDHCI_CTRL2_PWRSYNC(1 << 3)
-#define S3C_SDHCI_CTRL2_ENCLKOUTMSKCON (1 << 1)
-#define S3C_SDHCI_CTRL2_HWINITFIN  (1 

[PATCH 13/23] mtd: onenand/samsung: make regs-onenand.h file local

2013-03-05 Thread Arnd Bergmann
Nothing uses the NAND register definitions other than the
actual driver, so we can move the header file into the
same local directory, which lets us build it in a multiplatform
configuration.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/plat-samsung/include/plat/regs-onenand.h | 63 ---
 drivers/mtd/onenand/samsung.c |  4 +-
 drivers/mtd/onenand/samsung.h | 61 ++
 3 files changed, 63 insertions(+), 65 deletions(-)
 delete mode 100644 arch/arm/plat-samsung/include/plat/regs-onenand.h
 create mode 100644 drivers/mtd/onenand/samsung.h

diff --git a/arch/arm/plat-samsung/include/plat/regs-onenand.h 
b/arch/arm/plat-samsung/include/plat/regs-onenand.h
deleted file mode 100644
index 930ea8b..000
--- a/arch/arm/plat-samsung/include/plat/regs-onenand.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * linux/arch/arm/plat-s3c/include/plat/regs-onenand.h
- *
- *  Copyright (C) 2008-2010 Samsung Electronics
- *  Kyungmin Park 
- *
- * 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.
- */
-#ifndef __SAMSUNG_ONENAND_H__
-#define __SAMSUNG_ONENAND_H__
-
-#include 
-
-/*
- * OneNAND Controller
- */
-#define MEM_CFG_OFFSET 0x
-#define BURST_LEN_OFFSET   0x0010
-#define MEM_RESET_OFFSET   0x0020
-#define INT_ERR_STAT_OFFSET0x0030
-#define INT_ERR_MASK_OFFSET0x0040
-#define INT_ERR_ACK_OFFSET 0x0050
-#define ECC_ERR_STAT_OFFSET0x0060
-#define MANUFACT_ID_OFFSET 0x0070
-#define DEVICE_ID_OFFSET   0x0080
-#define DATA_BUF_SIZE_OFFSET   0x0090
-#define BOOT_BUF_SIZE_OFFSET   0x00A0
-#define BUF_AMOUNT_OFFSET  0x00B0
-#define TECH_OFFSET0x00C0
-#define FBA_WIDTH_OFFSET   0x00D0
-#define FPA_WIDTH_OFFSET   0x00E0
-#define FSA_WIDTH_OFFSET   0x00F0
-#define TRANS_SPARE_OFFSET 0x0140
-#define DBS_DFS_WIDTH_OFFSET   0x0160
-#define INT_PIN_ENABLE_OFFSET  0x01A0
-#define ACC_CLOCK_OFFSET   0x01C0
-#define FLASH_VER_ID_OFFSET0x01F0
-#define FLASH_AUX_CNTRL_OFFSET 0x0300  /* s3c64xx only */
-
-#define ONENAND_MEM_RESET_HOT  0x3
-#define ONENAND_MEM_RESET_COLD 0x2
-#define ONENAND_MEM_RESET_WARM 0x1
-
-#define CACHE_OP_ERR   (1 << 13)
-#define RST_CMP(1 << 12)
-#define RDY_ACT(1 << 11)
-#define INT_ACT(1 << 10)
-#define UNSUP_CMD  (1 << 9)
-#define LOCKED_BLK (1 << 8)
-#define BLK_RW_CMP (1 << 7)
-#define ERS_CMP(1 << 6)
-#define PGM_CMP(1 << 5)
-#define LOAD_CMP   (1 << 4)
-#define ERS_FAIL   (1 << 3)
-#define PGM_FAIL   (1 << 2)
-#define INT_TO (1 << 1)
-#define LD_FAIL_ECC_ERR(1 << 0)
-
-#define TSRF   (1 << 0)
-
-#endif
diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c
index 33f2a8f..2cf7408 100644
--- a/drivers/mtd/onenand/samsung.c
+++ b/drivers/mtd/onenand/samsung.c
@@ -23,11 +23,11 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
-#include 
 
-#include 
+#include "samsung.h"
 
 enum soc_type {
TYPE_S3C6400,
diff --git a/drivers/mtd/onenand/samsung.h b/drivers/mtd/onenand/samsung.h
new file mode 100644
index 000..c4a80e6
--- /dev/null
+++ b/drivers/mtd/onenand/samsung.h
@@ -0,0 +1,61 @@
+/*
+ * linux/arch/arm/plat-s3c/include/plat/regs-onenand.h
+ *
+ *  Copyright (C) 2008-2010 Samsung Electronics
+ *  Kyungmin Park 
+ *
+ * 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.
+ */
+#ifndef __SAMSUNG_ONENAND_H__
+#define __SAMSUNG_ONENAND_H__
+
+/*
+ * OneNAND Controller
+ */
+#define MEM_CFG_OFFSET 0x
+#define BURST_LEN_OFFSET   0x0010
+#define MEM_RESET_OFFSET   0x0020
+#define INT_ERR_STAT_OFFSET0x0030
+#define INT_ERR_MASK_OFFSET0x0040
+#define INT_ERR_ACK_OFFSET 0x0050
+#define ECC_ERR_STAT_OFFSET0x0060
+#define MANUFACT_ID_OFFSET 0x0070
+#define DEVICE_ID_OFFSET   0x0080
+#define DATA_BUF_SIZE_OFFSET   0x0090
+#define BOOT_BUF_SIZE_OFFSET   0x00A0
+#define BUF_AMOUNT_OFFSET  0x00B0
+#define TECH_OFFSET0x00C0
+#define FBA_WIDTH_OFFSET   0x00D0
+#define FPA_WIDTH_OFFSET   0x00E0
+#define FSA_WIDTH_OFFSET   0x00F0
+#define TRANS_SPARE_OFFSET 0x0140
+#define DBS_DFS_WIDTH_OFFSET   0x0160
+#define INT_PIN_ENABLE_OFFSET  0x01A0
+#define ACC_CLOCK_OFFSET   0x01C0
+#define FLASH_VER_ID_OFFSET0x01F0
+#define FLASH_AUX_CNTRL_OFFSET 0x0300  /* s3c64xx only */
+
+#define ONENAND_MEM_RESET_HOT  0x3
+#define ONENAND_MEM_RESET_COLD 0x2
+#define ONENAND_MEM_RESET_WARM 0x1
+
+#define CACHE_OP_ERR   (1 << 13)
+#define RST_CMP 

[PATCH 17/23] ASoC: samsung: move plat/ headers to local directory

2013-03-05 Thread Arnd Bergmann
The plat/iis.h and plat/ac97.h files in the samsung platform are
only needed by the ASoC drivers, so they can be moved into the
same directory, as one more step towards a multiplatform build.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/mach-s3c24xx/dma-s3c2410.c|  2 -
 arch/arm/mach-s3c24xx/dma-s3c2412.c|  2 -
 arch/arm/mach-s3c24xx/dma-s3c2440.c|  2 -
 arch/arm/mach-s3c24xx/dma-s3c2443.c|  2 -
 arch/arm/plat-samsung/include/plat/regs-ac97.h | 67 
 arch/arm/plat-samsung/include/plat/regs-iis.h  | 70 --
 sound/soc/samsung/ac97.c   |  2 +-
 sound/soc/samsung/h1940_uda1380.c  |  2 +-
 sound/soc/samsung/neo1973_wm8753.c |  2 +-
 sound/soc/samsung/regs-ac97.h  | 67 
 sound/soc/samsung/regs-iis.h   | 70 ++
 sound/soc/samsung/rx1950_uda1380.c |  2 +-
 sound/soc/samsung/s3c24xx-i2s.c|  2 +-
 sound/soc/samsung/s3c24xx_uda134x.c|  2 +-
 14 files changed, 143 insertions(+), 151 deletions(-)
 delete mode 100644 arch/arm/plat-samsung/include/plat/regs-ac97.h
 delete mode 100644 arch/arm/plat-samsung/include/plat/regs-iis.h
 create mode 100644 sound/soc/samsung/regs-ac97.h
 create mode 100644 sound/soc/samsung/regs-iis.h

diff --git a/arch/arm/mach-s3c24xx/dma-s3c2410.c 
b/arch/arm/mach-s3c24xx/dma-s3c2410.c
index 25d085a..a4a13c9 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2410.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2410.c
@@ -25,11 +25,9 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 static struct s3c24xx_dma_map __initdata s3c2410_dma_mappings[] = {
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2412.c 
b/arch/arm/mach-s3c24xx/dma-s3c2412.c
index d2408ba..6eaa7a4 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2412.c
@@ -25,11 +25,9 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #define MAP(x) { (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| 
DMA_CH_VALID }
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2440.c 
b/arch/arm/mach-s3c24xx/dma-s3c2440.c
index 0b86e74..477d450 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2440.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2440.c
@@ -25,11 +25,9 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 static struct s3c24xx_dma_map __initdata s3c2440_dma_mappings[] = {
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2443.c 
b/arch/arm/mach-s3c24xx/dma-s3c2443.c
index 0553625..80a8d56 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2443.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2443.c
@@ -25,11 +25,9 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #define MAP(x) { \
diff --git a/arch/arm/plat-samsung/include/plat/regs-ac97.h 
b/arch/arm/plat-samsung/include/plat/regs-ac97.h
deleted file mode 100644
index c3878f7..000
--- a/arch/arm/plat-samsung/include/plat/regs-ac97.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* arch/arm/mach-s3c2410/include/mach/regs-ac97.h
- *
- * Copyright (c) 2006 Simtec Electronics 
- * http://www.simtec.co.uk/products/SWLINUX/
- *
- * 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.
- *
- * S3C2440 AC97 Controller
-*/
-
-#ifndef __ASM_ARCH_REGS_AC97_H
-#define __ASM_ARCH_REGS_AC97_H __FILE__
-
-#define S3C_AC97_GLBCTRL   (0x00)
-
-#define S3C_AC97_GLBCTRL_CODECREADYIE  (1<<22)
-#define S3C_AC97_GLBCTRL_PCMOUTURIE(1<<21)
-#define S3C_AC97_GLBCTRL_PCMINORIE (1<<20)
-#define S3C_AC97_GLBCTRL_MICINORIE (1<<19)
-#define S3C_AC97_GLBCTRL_PCMOUTTIE (1<<18)
-#define S3C_AC97_GLBCTRL_PCMINTIE  (1<<17)
-#define S3C_AC97_GLBCTRL_MICINTIE  (1<<16)
-#define S3C_AC97_GLBCTRL_PCMOUTTM_OFF  (0<<12)
-#define S3C_AC97_GLBCTRL_PCMOUTTM_PIO  (1<<12)
-#define S3C_AC97_GLBCTRL_PCMOUTTM_DMA  (2<<12)
-#define S3C_AC97_GLBCTRL_PCMOUTTM_MASK (3<<12)
-#define S3C_AC97_GLBCTRL_PCMINTM_OFF   (0<<10)
-#define S3C_AC97_GLBCTRL_PCMINTM_PIO   (1<<10)
-#define S3C_AC97_GLBCTRL_PCMINTM_DMA   (2<<10)
-#define S3C_AC97_GLBCTRL_PCMINTM_MASK  (3<<10)
-#define S3C_AC97_GLBCTRL_MICINTM_OFF   (0<<8)
-#define S3C_AC97_GLBCTRL_MICINTM_PIO   (1<<8)
-#define S3C_AC97_GLBCTRL_MICINTM_DMA   (2<<8)
-#define S3C_AC97_GLBCTRL_MICINTM_MASK  (3<<8)
-#define S3C_AC97_GLBCTRL_TRANSFERDATAENABLE(1<<3)
-#define S3C_AC97_GLBCTRL_ACLINKON  (1<<2

[PATCH 11/23] video/exynos: remove unnecessary header inclusions

2013-03-05 Thread Arnd Bergmann
In multiplatform configurations, we cannot include headers
provided by only the exynos platform. Fortunately a number
of drivers that include those headers do not actually need
them, so we can just remove the inclusions.

Signed-off-by: Arnd Bergmann 
---
 drivers/video/exynos/exynos_mipi_dsi.c  | 2 --
 drivers/video/exynos/exynos_mipi_dsi_common.c   | 2 --
 drivers/video/exynos/exynos_mipi_dsi_lowlevel.c | 2 --
 3 files changed, 6 deletions(-)

diff --git a/drivers/video/exynos/exynos_mipi_dsi.c 
b/drivers/video/exynos/exynos_mipi_dsi.c
index fac7df6..3dd43ca 100644
--- a/drivers/video/exynos/exynos_mipi_dsi.c
+++ b/drivers/video/exynos/exynos_mipi_dsi.c
@@ -35,8 +35,6 @@
 
 #include 
 
-#include 
-
 #include "exynos_mipi_dsi_common.h"
 #include "exynos_mipi_dsi_lowlevel.h"
 
diff --git a/drivers/video/exynos/exynos_mipi_dsi_common.c 
b/drivers/video/exynos/exynos_mipi_dsi_common.c
index c70cb89..520fc9b 100644
--- a/drivers/video/exynos/exynos_mipi_dsi_common.c
+++ b/drivers/video/exynos/exynos_mipi_dsi_common.c
@@ -31,8 +31,6 @@
 #include 
 #include 
 
-#include 
-
 #include "exynos_mipi_dsi_regs.h"
 #include "exynos_mipi_dsi_lowlevel.h"
 #include "exynos_mipi_dsi_common.h"
diff --git a/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c 
b/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c
index 95cb99a..15c5abd 100644
--- a/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c
+++ b/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c
@@ -26,8 +26,6 @@
 
 #include 
 
-#include 
-
 #include "exynos_mipi_dsi_regs.h"
 
 void exynos_mipi_dsi_func_reset(struct mipi_dsim_device *dsim)
-- 
1.8.1.2

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


[PATCH 04/23] tty: serial/samsung: make register definitions global

2013-03-05 Thread Arnd Bergmann
The registers for the Samsung S3C serial port are currently defined in
the platform specific arch/arm/plat-samsung/include/plat/regs-serial.h
file, which is not visible to multiplatform capable drivers.

Unfortunately, it is not possible to move the file into a more local
place as we should normally try to, because the same registers
may be used in one of four places:

* In the driver itself
* In platform-independent ARM code for early debug output
* In platform_data definitions
* In the Samsung platform power management code

I have also found no way to logically split out a platform_data
file, other than possibly move everything into
include/linux/platform_data, which also felt wrong. The only
part of this file that makes sense to keep specific to the s3c24xx
platform are the virtual and physical addresses defined here,
which are needed in no other location.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/mach-s3c24xx/clock-s3c2440.c|   5 +
 arch/arm/mach-s3c24xx/common.c   |   5 +
 arch/arm/plat-samsung/include/plat/regs-serial.h | 282 +--
 drivers/tty/serial/samsung.c |   6 +-
 include/linux/serial_s3c.h   | 260 +
 5 files changed, 274 insertions(+), 284 deletions(-)
 create mode 100644 include/linux/serial_s3c.h

diff --git a/arch/arm/mach-s3c24xx/clock-s3c2440.c 
b/arch/arm/mach-s3c24xx/clock-s3c2440.c
index 04b87ec..1069b56 100644
--- a/arch/arm/mach-s3c24xx/clock-s3c2440.c
+++ b/arch/arm/mach-s3c24xx/clock-s3c2440.c
@@ -123,6 +123,11 @@ static struct clk s3c2440_clk_ac97 = {
.ctrlbit= S3C2440_CLKCON_AC97,
 };
 
+#define S3C24XX_VA_UART0  (S3C_VA_UART)
+#define S3C24XX_VA_UART1  (S3C_VA_UART + 0x4000 )
+#define S3C24XX_VA_UART2  (S3C_VA_UART + 0x8000 )
+#define S3C24XX_VA_UART3  (S3C_VA_UART + 0xC000 )
+
 static unsigned long  s3c2440_fclk_n_getrate(struct clk *clk)
 {
unsigned long ucon0, ucon1, ucon2, divisor;
diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c
index 6bcf87f..92e6094 100644
--- a/arch/arm/mach-s3c24xx/common.c
+++ b/arch/arm/mach-s3c24xx/common.c
@@ -239,6 +239,11 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, 
int size)
 
 /* Serial port registrations */
 
+#define S3C2410_PA_UART0  (S3C24XX_PA_UART)
+#define S3C2410_PA_UART1  (S3C24XX_PA_UART + 0x4000 )
+#define S3C2410_PA_UART2  (S3C24XX_PA_UART + 0x8000 )
+#define S3C2443_PA_UART3  (S3C24XX_PA_UART + 0xC000 )
+
 static struct resource s3c2410_uart0_resource[] = {
[0] = DEFINE_RES_MEM(S3C2410_PA_UART0, SZ_16K),
[1] = DEFINE_RES_NAMED(IRQ_S3CUART_RX0, \
diff --git a/arch/arm/plat-samsung/include/plat/regs-serial.h 
b/arch/arm/plat-samsung/include/plat/regs-serial.h
index 29c26a8..f05f2af 100644
--- a/arch/arm/plat-samsung/include/plat/regs-serial.h
+++ b/arch/arm/plat-samsung/include/plat/regs-serial.h
@@ -1,281 +1 @@
-/* arch/arm/plat-samsung/include/plat/regs-serial.h
- *
- *  From linux/include/asm-arm/hardware/serial_s3c2410.h
- *
- *  Internal header file for Samsung S3C2410 serial ports (UART0-2)
- *
- *  Copyright (C) 2002 Shane Nay (sh...@minirl.com)
- *
- *  Additional defines, Copyright 2003 Simtec Electronics (li...@simtec.co.uk)
- *
- *  Adapted from:
- *
- *  Internal header file for MX1ADS serial ports (UART1 & 2)
- *
- *  Copyright (C) 2002 Shane Nay (sh...@minirl.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifndef __ASM_ARM_REGS_SERIAL_H
-#define __ASM_ARM_REGS_SERIAL_H
-
-#define S3C24XX_VA_UART0  (S3C_VA_UART)
-#define S3C24XX_VA_UART1  (S3C_VA_UART + 0x4000 )
-#define S3C24XX_VA_UART2  (S3C_VA_UART + 0x8000 )
-#define S3C24XX_VA_UART3  (S3C_VA_UART + 0xC000 )
-
-#define S3C2410_PA_UART0  (S3C24XX_PA_UART)
-#define S3C2410_PA_UART1  (S3C24XX_PA_UART + 0x4000 )
-#define S3C2410_PA_UART2  (S3C24XX_PA_UART + 0x8000 )
-#define S3C2443_PA_UART3  (S3C24XX_PA_UART + 0xC000 )
-
-#define S3C2410_URXH (0x24)
-#define S3C2410_UTXH (0x20)
-#define S3C2410_ULCON(0x00)
-#define S3C2410_UCON (0x04)
-#define S3C2410_UFCON(0x08)
-#define S3C2410_UMCON(0x0C)
-#define S3C2410_UBRDIV   (0x28)
-#define S3C2410_UTRSTAT  (0x10)
-#define S3C2410_UERSTAT  (0x14)
-#define

[PATCH 18/23] ASoC: samsung: convert to dmaengine API

2013-03-05 Thread Arnd Bergmann
In order to build the exynos kernel with CONFIG_ARCH_MULTIPLATFORM,
we must convert all users of the Samsung private DMA interface to
the generic dmaengine API. This converts the sound/soc drivers,
breaking the older s3c platforms in the process, since they do not
support the dmaengine interface yet.

This patch must not get mainlined until mach-s3c* is also converted,
but can be used for testing in the meantime.

Signed-off-by: Arnd Bergmann 
---
 sound/soc/samsung/ac97.c|  15 --
 sound/soc/samsung/dma.c | 104 +---
 sound/soc/samsung/dma.h |   4 +-
 sound/soc/samsung/i2s.c |   9 +---
 sound/soc/samsung/pcm.c |  13 -
 sound/soc/samsung/s3c2412-i2s.c |  10 
 sound/soc/samsung/s3c24xx-i2s.c |  10 
 sound/soc/samsung/spdif.c   |   6 ---
 8 files changed, 57 insertions(+), 114 deletions(-)

diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c
index c76abdf..214f454 100644
--- a/sound/soc/samsung/ac97.c
+++ b/sound/soc/samsung/ac97.c
@@ -39,30 +39,15 @@ struct s3c_ac97_info {
 };
 static struct s3c_ac97_info s3c_ac97;
 
-static struct s3c2410_dma_client s3c_dma_client_out = {
-   .name = "AC97 PCMOut"
-};
-
-static struct s3c2410_dma_client s3c_dma_client_in = {
-   .name = "AC97 PCMIn"
-};
-
-static struct s3c2410_dma_client s3c_dma_client_micin = {
-   .name = "AC97 MicIn"
-};
-
 static struct s3c_dma_params s3c_ac97_pcm_out = {
-   .client = &s3c_dma_client_out,
.dma_size   = 4,
 };
 
 static struct s3c_dma_params s3c_ac97_pcm_in = {
-   .client = &s3c_dma_client_in,
.dma_size   = 4,
 };
 
 static struct s3c_dma_params s3c_ac97_mic_in = {
-   .client = &s3c_dma_client_micin,
.dma_size   = 4,
 };
 
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
index 21b7926..67b8dcc 100644
--- a/sound/soc/samsung/dma.c
+++ b/sound/soc/samsung/dma.c
@@ -16,14 +16,14 @@
 
 #include 
 #include 
+#include 
 #include 
+#include 
 
 #include 
 #include 
 
 #include 
-#include 
-#include 
 
 #include "dma.h"
 
@@ -67,12 +67,16 @@ static void audio_buffdone(void *data);
  * place a dma buffer onto the queue for the dma system
  * to handle.
  */
+
 static void dma_enqueue(struct snd_pcm_substream *substream)
 {
struct runtime_data *prtd = substream->runtime->private_data;
dma_addr_t pos = prtd->dma_pos;
+   unsigned long period = prtd->dma_period;
unsigned int limit;
-   struct samsung_dma_prep dma_info;
+   enum dma_transfer_direction direction;
+   struct dma_chan *chan = prtd->params->ch;
+   struct dma_async_tx_descriptor *desc;
 
pr_debug("Entered %s\n", __func__);
 
@@ -81,29 +85,30 @@ static void dma_enqueue(struct snd_pcm_substream *substream)
pr_debug("%s: loaded %d, limit %d\n",
__func__, prtd->dma_loaded, limit);
 
-   dma_info.cap = (samsung_dma_has_circular() ? DMA_CYCLIC : DMA_SLAVE);
-   dma_info.direction =
-   (substream->stream == SNDRV_PCM_STREAM_PLAYBACK
-   ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM);
-   dma_info.fp = audio_buffdone;
-   dma_info.fp_param = substream;
-   dma_info.period = prtd->dma_period;
-   dma_info.len = prtd->dma_period*limit;
+   direction = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK
+? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM);
 
while (prtd->dma_loaded < limit) {
pr_debug("dma_loaded: %d\n", prtd->dma_loaded);
 
-   if ((pos + dma_info.period) > prtd->dma_end) {
-   dma_info.period  = prtd->dma_end - pos;
+   if ((pos + period) > prtd->dma_end) {
+   period  = prtd->dma_end - pos;
pr_debug("%s: corrected dma len %ld\n",
-   __func__, dma_info.period);
+   __func__, period);
}
 
-   dma_info.buf = pos;
-   prtd->params->ops->prepare(prtd->params->ch, &dma_info);
+   desc = dmaengine_prep_dma_cyclic(chan, pos,
+prtd->dma_period*limit, period, direction,
+   DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
+
+   if (desc) {
+   desc->callback = audio_buffdone;
+   desc->callback_param = substream;
+   dmaengine_submit(desc);
+   }
 
prtd->dma_loaded++;
-   pos += prtd->dma_period;
+   pos += period;
if (pos >= prtd->dma_end)
pos = prtd->dma_start;
}
@@ -125,13 +130,6 @@ static void audio_buffdone(void *data)
 
if (substream)
snd_pcm_period_elapsed(substream);
-
-   spin_lock(&prtd->lock);
-   if (!samsung_dma_has_circular()) {
-   

[PATCH 12/23] thermal/exynos: remove unnecessary header inclusions

2013-03-05 Thread Arnd Bergmann
In multiplatform configurations, we cannot include headers
provided by only the exynos platform. Fortunately a number
of drivers that include those headers do not actually need
them, so we can just remove the inclusions.

Signed-off-by: Arnd Bergmann 
---
 drivers/thermal/exynos_thermal.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index e04ebd8..8dd7984 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -39,8 +39,6 @@
 #include 
 #include 
 
-#include 
-
 /* Exynos generic registers */
 #define EXYNOS_TMU_REG_TRIMINFO0x0
 #define EXYNOS_TMU_REG_CONTROL 0x20
-- 
1.8.1.2

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


[PATCH 02/23] irqchip: exynos: remove dependency on mach/irqs.h

2013-03-05 Thread Arnd Bergmann
As a preparation for multiplatform, this changes the exynos
"combiner" irqchip to no longer make any assumptions about
using specific IRQ numbers or the number of combiners in the
system.

For this, we have to revert to always initializing the combiner
explicitly from architecture code, rather than using the new
irqchip_init function as we should. The problem is the
dependency on the IRQ base value for the combiner, which is
currently hardcoded in the mach/irqs.h file. Once that file
becomes unused, we can move to irqchip_init again.

Getting rid of the dependency on the number of combiners
actually cleans up the code, because we also remove the
global combiner_data array and pass dynamically allocated
pointers through the irq domain instead.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/mach-exynos/common.c |   5 +-
 arch/arm/mach-exynos/common.h |   2 +-
 drivers/irqchip/exynos-combiner.c | 113 --
 3 files changed, 64 insertions(+), 56 deletions(-)

diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index d63d399..4b4526d 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -443,6 +443,7 @@ static void __init exynos5_init_clocks(int xtal)
 
 void __init exynos4_init_irq(void)
 {
+   struct device_node *dn;
unsigned int gic_bank_offset;
 
gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000;
@@ -454,8 +455,8 @@ void __init exynos4_init_irq(void)
irqchip_init();
 #endif
 
-   if (!of_have_populated_dt())
-   combiner_init(S5P_VA_COMBINER_BASE, NULL);
+   dn = of_find_compatible_node(NULL, NULL, "samsung,exynos4210-combiner");
+   combiner_init(S5P_VA_COMBINER_BASE, COMBINER_IRQ(0, 0), dn);
 
/*
 * The parameters of s5p_init_irq() are for VIC init.
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 9339bb8..ed96450 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -61,7 +61,7 @@ void exynos4212_register_clocks(void);
 #endif
 
 struct device_node;
-void combiner_init(void __iomem *combiner_base, struct device_node *np);
+void combiner_init(void __iomem *combiner_base, int irq_base, struct 
device_node *np);
 
 extern struct smp_operations exynos_smp_ops;
 
diff --git a/drivers/irqchip/exynos-combiner.c 
b/drivers/irqchip/exynos-combiner.c
index 04d86a9..1276d4e 100644
--- a/drivers/irqchip/exynos-combiner.c
+++ b/drivers/irqchip/exynos-combiner.c
@@ -15,9 +15,13 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
+#ifdef CONFIG_EXYNOS_ATAGS
 #include 
+#endif
+
+#include 
 
 #include "irqchip.h"
 
@@ -25,6 +29,8 @@
 #define COMBINER_ENABLE_CLEAR  0x4
 #define COMBINER_INT_STATUS0xC
 
+#define IRQ_IN_COMBINER8
+
 static DEFINE_SPINLOCK(irq_controller_lock);
 
 struct combiner_chip_data {
@@ -33,9 +39,6 @@ struct combiner_chip_data {
void __iomem *base;
 };
 
-static struct irq_domain *combiner_irq_domain;
-static struct combiner_chip_data combiner_data[MAX_COMBINER_NR];
-
 static inline void __iomem *combiner_base(struct irq_data *data)
 {
struct combiner_chip_data *combiner_data =
@@ -93,35 +96,6 @@ static struct irq_chip combiner_chip = {
.irq_unmask = combiner_unmask_irq,
 };
 
-static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int 
irq)
-{
-   unsigned int max_nr;
-
-   if (soc_is_exynos5250())
-   max_nr = EXYNOS5_MAX_COMBINER_NR;
-   else
-   max_nr = EXYNOS4_MAX_COMBINER_NR;
-
-   if (combiner_nr >= max_nr)
-   BUG();
-   if (irq_set_handler_data(irq, &combiner_data[combiner_nr]) != 0)
-   BUG();
-   irq_set_chained_handler(irq, combiner_handle_cascade_irq);
-}
-
-static void __init combiner_init_one(unsigned int combiner_nr,
-void __iomem *base)
-{
-   combiner_data[combiner_nr].base = base;
-   combiner_data[combiner_nr].irq_offset = irq_find_mapping(
-   combiner_irq_domain, combiner_nr * MAX_IRQ_IN_COMBINER);
-   combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3);
-
-   /* Disable all interrupts */
-   __raw_writel(combiner_data[combiner_nr].irq_mask,
-base + COMBINER_ENABLE_CLEAR);
-}
-
 #ifdef CONFIG_OF
 static int combiner_irq_domain_xlate(struct irq_domain *d,
 struct device_node *controller,
@@ -135,7 +109,7 @@ static int combiner_irq_domain_xlate(struct irq_domain *d,
if (intsize < 2)
return -EINVAL;
 
-   *out_hwirq = intspec[0] * MAX_IRQ_IN_COMBINER + intspec[1];
+   *out_hwirq = intspec[0] * IRQ_IN_COMBINER + intspec[1];
*out_type = 0;
 
return 0;
@@ -154,6 +128,8 @@ static int combiner_irq_domain_xlate(struct irq_domain *d,
 static int combiner_irq_domain_map(struct irq_domain *d, unsigned int irq,
  

[PATCH 10/23] [media] exynos: remove unnecessary header inclusions

2013-03-05 Thread Arnd Bergmann
In multiplatform configurations, we cannot include headers
provided by only the exynos platform. Fortunately a number
of drivers that include those headers do not actually need
them, so we can just remove the inclusions.

Signed-off-by: Arnd Bergmann 
---
 drivers/media/platform/exynos-gsc/gsc-regs.c | 1 -
 drivers/media/platform/s5p-tv/sii9234_drv.c  | 3 ---
 2 files changed, 4 deletions(-)

diff --git a/drivers/media/platform/exynos-gsc/gsc-regs.c 
b/drivers/media/platform/exynos-gsc/gsc-regs.c
index 6f5b5a4..e22d147 100644
--- a/drivers/media/platform/exynos-gsc/gsc-regs.c
+++ b/drivers/media/platform/exynos-gsc/gsc-regs.c
@@ -12,7 +12,6 @@
 
 #include 
 #include 
-#include 
 
 #include "gsc-core.h"
 
diff --git a/drivers/media/platform/s5p-tv/sii9234_drv.c 
b/drivers/media/platform/s5p-tv/sii9234_drv.c
index d90d228..39b77d2 100644
--- a/drivers/media/platform/s5p-tv/sii9234_drv.c
+++ b/drivers/media/platform/s5p-tv/sii9234_drv.c
@@ -23,9 +23,6 @@
 #include 
 #include 
 
-#include 
-#include 
-
 #include 
 #include 
 
-- 
1.8.1.2

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


[PATCH 15/23] spi: s3c64xx: move to generic dmaengine API

2013-03-05 Thread Arnd Bergmann
The spi-s3c64xx uses a Samsung proprietary interface for
talking to the DMA engine, which does not work with
multiplatform kernels. Since the driver can also operate
in PIO mode without any DMA, older platforms that do
not support the DMA engine API will still work, although
slower.

The conversion was rather mechanical, since the samsung
interface is just a shallow wrapper around the dmaengine
interface.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/plat-samsung/devs.c  |  10 +++
 drivers/spi/spi-s3c64xx.c | 107 ++
 include/linux/platform_data/spi-s3c64xx.h |   3 +
 3 files changed, 62 insertions(+), 58 deletions(-)

diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 76209c9..58fb02a 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -10,6 +10,7 @@
  * published by the Free Software Foundation.
 */
 
+#include 
 #include 
 #include 
 #include 
@@ -1551,6 +1552,9 @@ void __init s3c64xx_spi0_set_platdata(int 
(*cfg_gpio)(void), int src_clk_nr,
pd.num_cs = num_cs;
pd.src_clk_nr = src_clk_nr;
pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi0_cfg_gpio;
+#ifdef CONFIG_PL330_DMA
+   pd.filter = pl330_filter;
+#endif
 
s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi0);
 }
@@ -1589,6 +1593,9 @@ void __init s3c64xx_spi1_set_platdata(int 
(*cfg_gpio)(void), int src_clk_nr,
pd.num_cs = num_cs;
pd.src_clk_nr = src_clk_nr;
pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi1_cfg_gpio;
+#ifdef CONFIG_PL330_DMA
+   pd.filter = pl330_filter;
+#endif
 
s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi1);
 }
@@ -1627,6 +1634,9 @@ void __init s3c64xx_spi2_set_platdata(int 
(*cfg_gpio)(void), int src_clk_nr,
pd.num_cs = num_cs;
pd.src_clk_nr = src_clk_nr;
pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi2_cfg_gpio;
+#ifdef CONFIG_PL330_DMA
+   pd.filter = pl330_filter;
+#endif
 
s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi2);
 }
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index e862ab8..9be07a6 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -22,8 +22,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -31,7 +33,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #define MAX_SPI_PORTS  3
@@ -131,9 +132,9 @@
 #define TXBUSY(1<<3)
 
 struct s3c64xx_spi_dma_data {
-   unsignedch;
+   struct dma_chan *ch;
enum dma_transfer_direction direction;
-   enum dma_ch dmach;
+   unsigned int request;
 };
 
 /**
@@ -195,16 +196,11 @@ struct s3c64xx_spi_driver_data {
unsignedcur_speed;
struct s3c64xx_spi_dma_data rx_dma;
struct s3c64xx_spi_dma_data tx_dma;
-   struct samsung_dma_ops  *ops;
struct s3c64xx_spi_port_config  *port_conf;
unsigned intport_id;
unsigned long   gpios[4];
 };
 
-static struct s3c2410_dma_client s3c64xx_spi_dma_client = {
-   .name = "samsung-spi-dma",
-};
-
 static void flush_fifo(struct s3c64xx_spi_driver_data *sdd)
 {
void __iomem *regs = sdd->regs;
@@ -285,50 +281,42 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
unsigned len, dma_addr_t buf)
 {
struct s3c64xx_spi_driver_data *sdd;
-   struct samsung_dma_prep info;
-   struct samsung_dma_config config;
+   struct dma_slave_config config;
+   struct scatterlist sg;
+   struct dma_async_tx_descriptor *desc;
 
if (dma->direction == DMA_DEV_TO_MEM) {
sdd = container_of((void *)dma,
struct s3c64xx_spi_driver_data, rx_dma);
-   config.direction = sdd->rx_dma.direction;
-   config.fifo = sdd->sfr_start + S3C64XX_SPI_RX_DATA;
-   config.width = sdd->cur_bpw / 8;
-   sdd->ops->config(sdd->rx_dma.ch, &config);
+   config.direction = dma->direction;
+   config.src_addr = sdd->sfr_start + S3C64XX_SPI_RX_DATA;
+   config.src_addr_width = sdd->cur_bpw / 8;
+   config.src_maxburst = 1;
+   dmaengine_slave_config(dma->ch, &config);
} else {
sdd = container_of((void *)dma,
struct s3c64xx_spi_driver_data, tx_dma);
-   config.direction =  sdd->tx_dma.direction;
-   config.fifo = sdd->sfr_start + S3C64XX_SPI_TX_DATA;
-   config.width = sdd->cur_bpw / 8;
-   sdd->ops->config(sdd->tx_dma.ch, &config);
+   config.direction = dma->direction;
+   config.dst_addr = sdd->sfr_start + S3C64XX_SPI_TX_DATA;
+   config.dst_addr_width = sdd->cur_bpw / 8;
+   config.dst_maxburst = 

[PATCH 05/23] tty: serial/samsung: fix modular build

2013-03-05 Thread Arnd Bergmann
There are a few bugs in the samsung serial driver when
built as a loadable module, which makes the console
code unavailable, as well as giving no access to
the 'printascii' early debug function. This adds
the appropriate compile time conditionals.

Signed-off-by: Arnd Bergmann 
---
 drivers/tty/serial/samsung.c | 4 ++--
 drivers/tty/serial/samsung.h | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index 729a60d..a3277ca 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -894,7 +894,7 @@ console_initcall(s3c24xx_serial_console_init);
 #define S3C24XX_SERIAL_CONSOLE NULL
 #endif
 
-#ifdef CONFIG_CONSOLE_POLL
+#if defined(CONFIG_SERIAL_SAMSUNG_CONSOLE) && defined(CONFIG_CONSOLE_POLL)
 static int s3c24xx_serial_get_poll_char(struct uart_port *port);
 static void s3c24xx_serial_put_poll_char(struct uart_port *port,
 unsigned char c);
@@ -918,7 +918,7 @@ static struct uart_ops s3c24xx_serial_ops = {
.request_port   = s3c24xx_serial_request_port,
.config_port= s3c24xx_serial_config_port,
.verify_port= s3c24xx_serial_verify_port,
-#ifdef CONFIG_CONSOLE_POLL
+#if defined(CONFIG_SERIAL_SAMSUNG_CONSOLE) && defined(CONFIG_CONSOLE_POLL)
.poll_get_char = s3c24xx_serial_get_poll_char,
.poll_put_char = s3c24xx_serial_put_poll_char,
 #endif
diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
index 1a4bca3..00a499e 100644
--- a/drivers/tty/serial/samsung.h
+++ b/drivers/tty/serial/samsung.h
@@ -76,7 +76,9 @@ struct s3c24xx_uart_port {
 #define wr_regb(port, reg, val) __raw_writeb(val, portaddr(port, reg))
 #define wr_regl(port, reg, val) __raw_writel(val, portaddr(port, reg))
 
-#ifdef CONFIG_SERIAL_SAMSUNG_DEBUG
+#if defined(CONFIG_SERIAL_SAMSUNG_DEBUG) && \
+defined(CONFIG_DEBUG_LL) && \
+!defined(MODULE)
 
 extern void printascii(const char *);
 
-- 
1.8.1.2

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


[PATCH 03/23] tty: serial/samsung: prepare for common clock API

2013-03-05 Thread Arnd Bergmann
With the common clock interface, there is no way to
provide the "clock_source" sysfs attribute for the
samsung serial ports. Given that this file was
purely informational and had fixed contents, we have
reason to believe that no user space programs
were relying on it.

The sysfs file is not documented in the ABI docs.

Signed-off-by: Arnd Bergmann 
---
 drivers/tty/serial/samsung.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index 2769a38..603f3f3 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1179,6 +1179,7 @@ static int s3c24xx_serial_init_port(struct 
s3c24xx_uart_port *ourport,
return 0;
 }
 
+#ifdef CONFIG_SAMSUNG_CLOCK
 static ssize_t s3c24xx_serial_show_clksrc(struct device *dev,
  struct device_attribute *attr,
  char *buf)
@@ -1194,7 +1195,7 @@ static ssize_t s3c24xx_serial_show_clksrc(struct device 
*dev,
 }
 
 static DEVICE_ATTR(clock_source, S_IRUGO, s3c24xx_serial_show_clksrc, NULL);
-
+#endif
 
 /* Device driver serial port probe */
 
@@ -1252,9 +1253,11 @@ static int s3c24xx_serial_probe(struct platform_device 
*pdev)
uart_add_one_port(&s3c24xx_uart_drv, &ourport->port);
platform_set_drvdata(pdev, &ourport->port);
 
+#ifdef CONFIG_SAMSUNG_CLOCK
ret = device_create_file(&pdev->dev, &dev_attr_clock_source);
if (ret < 0)
dev_err(&pdev->dev, "failed to add clock source attr.\n");
+#endif
 
ret = s3c24xx_serial_cpufreq_register(ourport);
if (ret < 0)
@@ -1272,7 +1275,9 @@ static int s3c24xx_serial_remove(struct platform_device 
*dev)
 
if (port) {
s3c24xx_serial_cpufreq_deregister(to_ourport(port));
+#ifdef CONFIG_SAMSUNG_CLOCK
device_remove_file(&dev->dev, &dev_attr_clock_source);
+#endif
uart_remove_one_port(&s3c24xx_uart_drv, port);
}
 
-- 
1.8.1.2

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


[PATCH 19/23] ASoC: samsung: use irq resource for idma

2013-03-05 Thread Arnd Bergmann
With multiplatform kernels, we cannot use hardwired IRQ
numbers in device drivers. This changes the idma driver
to use a proper resource, like all other drivers do.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/plat-samsung/devs.c |  6 ++
 sound/soc/samsung/idma.c | 10 --
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 58fb02a..ec912e4 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -146,14 +146,20 @@ struct platform_device s3c_device_camif = {
 
 /* ASOC DMA */
 
+#ifdef CONFIG_PLAT_S5P 
+static struct resource samsung_asoc_idma_resource = DEFINE_RES_IRQ(IRQ_I2S0);
+
 struct platform_device samsung_asoc_idma = {
.name   = "samsung-idma",
.id = -1,
+   .num_resources  = 1,
+   .resource   = &samsung_asoc_idma_resource,
.dev= {
.dma_mask   = &samsung_device_dma_mask,
.coherent_dma_mask  = DMA_BIT_MASK(32),
}
 };
+#endif
 
 /* FB */
 
diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c
index a07950b..f36a541 100644
--- a/sound/soc/samsung/idma.c
+++ b/sound/soc/samsung/idma.c
@@ -68,6 +68,8 @@ static struct idma_info {
dma_addr_t  lp_tx_addr;
 } idma;
 
+static int idma_irq;
+
 static void idma_getpos(dma_addr_t *src)
 {
*src = idma.lp_tx_addr +
@@ -305,7 +307,7 @@ static int idma_open(struct snd_pcm_substream *substream)
if (prtd == NULL)
return -ENOMEM;
 
-   ret = request_irq(IRQ_I2S0, iis_irq, 0, "i2s", prtd);
+   ret = request_irq(idma_irq, iis_irq, 0, "i2s", prtd);
if (ret < 0) {
pr_err("fail to claim i2s irq , ret = %d\n", ret);
kfree(prtd);
@@ -324,7 +326,7 @@ static int idma_close(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct idma_ctrl *prtd = runtime->private_data;
 
-   free_irq(IRQ_I2S0, prtd);
+   free_irq(idma_irq, prtd);
 
if (!prtd)
pr_err("idma_close called with prtd == NULL\n");
@@ -418,6 +420,10 @@ static struct snd_soc_platform_driver asoc_idma_platform = 
{
 
 static int asoc_idma_platform_probe(struct platform_device *pdev)
 {
+   idma_irq = platform_get_irq(pdev, 0);
+   if (idma_irq < 0)
+   return idma_irq;
+
return snd_soc_register_platform(&pdev->dev, &asoc_idma_platform);
 }
 
-- 
1.8.1.2

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


[PATCH 00/23] RFC: exynos multiplatform support

2013-03-05 Thread Arnd Bergmann
Hi everyone,

Although I'm not present at the Linaro Connect hacking
sessions, I am participating remotely and have tried
hacking on multiplatform support for Exynos. This patch
set is far from complete, but I think the patches
can be useful anyway.

The series gets increasingly fishy towards the end,
and we should probably not apply any of the last nine
patches as-is, nor do I expect everything to work, since
I have not tested them at all.

With this patch set, we can build mach-exynos as part
of a multiplatform kernel, with the following caveats:

* Only DT based boards are supported
* Moving to common-clk breaks things including cpufreq
  and others. Thomas is working on a patch for this
* We disable the gpio implementation, which also breaks
  stuff, but Thomas has a patch already
* Using the generic DMA engine API in SPI and ASoC
  means they no longer work on S3C
* I did not like the solution for the UART driver, but
  could also not think of a better one.
* The FB_S3C, S3C2410_WATCHDOG and S3C_ADC drivers
  are left as an exercise to the reader, they are
  currently disabled with multiplatform
* sparsemem support is not available on multiplatform

The patches are based on v3.9-rc1 and I have pushed
the git branch to

git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git 
testing/exynos-multiplatform

I have not yet added subsystem maintainers to Cc on the
patches, I'd like to coordinate with the other people
involved first, so see if they already have patches
for the same drivers.

Arnd

Arnd Bergmann (23):
  ARM: exynos: introduce EXYNOS_ATAGS symbol
  irqchip: exynos: remove dependency on mach/irqs.h
  tty: serial/samsung: prepare for common clock API
  tty: serial/samsung: make register definitions global
  tty: serial/samsung: fix modular build
  ARM: exynos: move debug-macro.S to include/debug/
  i2c: s3c2410: make header file local
  mmc: sdhci-s3c: remove platform dependencies
  usb: exynos: do not include plat/usb-phy.h
  [media] exynos: remove unnecessary header inclusions
  video/exynos: remove unnecessary header inclusions
  thermal/exynos: remove unnecessary header inclusions
  mtd: onenand/samsung: make regs-onenand.h file local
  rtc: s3c: make header file local
  spi: s3c64xx: move to generic dmaengine API
  pwm: samsung: repair the worst MMIO abuses
  ASoC: samsung: move plat/ headers to local directory
  ASoC: samsung: convert to dmaengine API
  ASoC: samsung: use irq resource for idma
  ARM: exynos: prepare for sparse IRQ
  ARM: exynos: hack to disable private clock code
  ARM: exynos: work around missing gpio code on multiplatform
  ARM: exynos: experimental multiplatform support

 arch/arm/Kconfig  |  11 +-
 arch/arm/Kconfig.debug|   8 +
 arch/arm/include/debug/exynos.S   |  39 +++
 arch/arm/include/debug/samsung.S  |  87 +++
 arch/arm/mach-exynos/Kconfig  |  36 ++-
 arch/arm/mach-exynos/Makefile |   5 +
 arch/arm/mach-exynos/common.c |  14 +-
 arch/arm/mach-exynos/common.h |   2 +-
 arch/arm/mach-exynos/dev-audio.c  |   1 +
 arch/arm/mach-exynos/dev-uart.c   |   1 +
 arch/arm/mach-exynos/include/mach/debug-macro.S   |  39 ---
 arch/arm/mach-exynos/include/mach/gpio.h  |   2 +
 arch/arm/mach-exynos/include/mach/irqs.h  |   5 +-
 arch/arm/mach-exynos/mach-armlex4210.c|   3 +
 arch/arm/mach-exynos/mach-exynos4-dt.c|   2 +
 arch/arm/mach-exynos/mach-exynos5-dt.c|   2 +
 arch/arm/mach-exynos/mach-nuri.c  |   2 +
 arch/arm/mach-exynos/mach-origen.c|   3 +
 arch/arm/mach-exynos/mach-smdk4x12.c  |   2 +
 arch/arm/mach-exynos/mach-smdkv310.c  |   3 +
 arch/arm/mach-exynos/setup-i2c0.c |   3 +-
 arch/arm/mach-exynos/setup-sdhci-gpio.c   |   2 +-
 arch/arm/mach-exynos/setup-usb-phy.c  |   8 +-
 arch/arm/mach-s3c24xx/clock-s3c2440.c |   5 +
 arch/arm/mach-s3c24xx/common.c|   5 +
 arch/arm/mach-s3c24xx/dma-s3c2410.c   |   2 -
 arch/arm/mach-s3c24xx/dma-s3c2412.c   |   2 -
 arch/arm/mach-s3c24xx/dma-s3c2440.c   |   2 -
 arch/arm/mach-s3c24xx/dma-s3c2443.c   |   2 -
 arch/arm/mach-s3c24xx/include/mach/debug-macro.S  |   2 +-
 arch/arm/mach-s3c24xx/mach-rx1950.c   |   1 -
 arch/arm/mach-s3c64xx/include/mach/debug-macro.S  |   2 +-
 arch/arm/mach-s3c64xx/include/mach/gpio.h |   4 +
 arch/arm/mach-s3c64xx/setup-usb-phy.c |   4 +-
 arch/arm/mach-s5p64x0/include/mach/debug-macro.S  |   2 +-
 arch/arm/mach-s5pc100/include/mach/debug-macro.S  |   2 +-
 arch/arm/mach-s5pc100/setup-sdhci-gpio.c  |   1 -
 arch/arm/mach-s5pv210/include/mach/debug-macro.S  |   2 +-
 arch/arm/mach-s5pv210/setup-sdhci-gpio.c  |   1 -
 ar

[PATCH 09/23] usb: exynos: do not include plat/usb-phy.h

2013-03-05 Thread Arnd Bergmann
The definitions have moved to include/linux/usb/samsung-usb-phy.h,
and plat/usb-phy.h is unavailable from drivers in a multiplatform
configuration.

Also fix up the plat/usb-phy.h header file to use the definitions
from the new header instead of providing a separate copy.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/mach-exynos/setup-usb-phy.c | 8 
 arch/arm/mach-s3c64xx/setup-usb-phy.c| 4 ++--
 arch/arm/mach-s5pv210/setup-usb-phy.c| 4 ++--
 arch/arm/plat-samsung/include/plat/usb-phy.h | 5 +
 drivers/usb/host/ehci-s5p.c  | 1 -
 drivers/usb/host/ohci-exynos.c   | 1 -
 6 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-exynos/setup-usb-phy.c 
b/arch/arm/mach-exynos/setup-usb-phy.c
index b81cc56..6af4066 100644
--- a/arch/arm/mach-exynos/setup-usb-phy.c
+++ b/arch/arm/mach-exynos/setup-usb-phy.c
@@ -204,9 +204,9 @@ static int exynos4210_usb_phy1_exit(struct platform_device 
*pdev)
 
 int s5p_usb_phy_init(struct platform_device *pdev, int type)
 {
-   if (type == S5P_USB_PHY_DEVICE)
+   if (type == USB_PHY_TYPE_DEVICE)
return exynos4210_usb_phy0_init(pdev);
-   else if (type == S5P_USB_PHY_HOST)
+   else if (type == USB_PHY_TYPE_HOST)
return exynos4210_usb_phy1_init(pdev);
 
return -EINVAL;
@@ -214,9 +214,9 @@ int s5p_usb_phy_init(struct platform_device *pdev, int type)
 
 int s5p_usb_phy_exit(struct platform_device *pdev, int type)
 {
-   if (type == S5P_USB_PHY_DEVICE)
+   if (type == USB_PHY_TYPE_DEVICE)
return exynos4210_usb_phy0_exit(pdev);
-   else if (type == S5P_USB_PHY_HOST)
+   else if (type == USB_PHY_TYPE_HOST)
return exynos4210_usb_phy1_exit(pdev);
 
return -EINVAL;
diff --git a/arch/arm/mach-s3c64xx/setup-usb-phy.c 
b/arch/arm/mach-s3c64xx/setup-usb-phy.c
index c8174d9..ca960bd 100644
--- a/arch/arm/mach-s3c64xx/setup-usb-phy.c
+++ b/arch/arm/mach-s3c64xx/setup-usb-phy.c
@@ -76,7 +76,7 @@ static int s3c_usb_otgphy_exit(struct platform_device *pdev)
 
 int s5p_usb_phy_init(struct platform_device *pdev, int type)
 {
-   if (type == S5P_USB_PHY_DEVICE)
+   if (type == USB_PHY_TYPE_DEVICE)
return s3c_usb_otgphy_init(pdev);
 
return -EINVAL;
@@ -84,7 +84,7 @@ int s5p_usb_phy_init(struct platform_device *pdev, int type)
 
 int s5p_usb_phy_exit(struct platform_device *pdev, int type)
 {
-   if (type == S5P_USB_PHY_DEVICE)
+   if (type == USB_PHY_TYPE_DEVICE)
return s3c_usb_otgphy_exit(pdev);
 
return -EINVAL;
diff --git a/arch/arm/mach-s5pv210/setup-usb-phy.c 
b/arch/arm/mach-s5pv210/setup-usb-phy.c
index 356a090..b2ee533 100644
--- a/arch/arm/mach-s5pv210/setup-usb-phy.c
+++ b/arch/arm/mach-s5pv210/setup-usb-phy.c
@@ -80,7 +80,7 @@ static int s5pv210_usb_otgphy_exit(struct platform_device 
*pdev)
 
 int s5p_usb_phy_init(struct platform_device *pdev, int type)
 {
-   if (type == S5P_USB_PHY_DEVICE)
+   if (type == USB_PHY_TYPE_DEVICE)
return s5pv210_usb_otgphy_init(pdev);
 
return -EINVAL;
@@ -88,7 +88,7 @@ int s5p_usb_phy_init(struct platform_device *pdev, int type)
 
 int s5p_usb_phy_exit(struct platform_device *pdev, int type)
 {
-   if (type == S5P_USB_PHY_DEVICE)
+   if (type == USB_PHY_TYPE_DEVICE)
return s5pv210_usb_otgphy_exit(pdev);
 
return -EINVAL;
diff --git a/arch/arm/plat-samsung/include/plat/usb-phy.h 
b/arch/arm/plat-samsung/include/plat/usb-phy.h
index 959bcdb..ab34dfa 100644
--- a/arch/arm/plat-samsung/include/plat/usb-phy.h
+++ b/arch/arm/plat-samsung/include/plat/usb-phy.h
@@ -11,10 +11,7 @@
 #ifndef __PLAT_SAMSUNG_USB_PHY_H
 #define __PLAT_SAMSUNG_USB_PHY_H __FILE__
 
-enum s5p_usb_phy_type {
-   S5P_USB_PHY_DEVICE,
-   S5P_USB_PHY_HOST,
-};
+#include 
 
 extern int s5p_usb_phy_init(struct platform_device *pdev, int type);
 extern int s5p_usb_phy_exit(struct platform_device *pdev, int type);
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 20ebf6a..7dc9c15 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -19,7 +19,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define EHCI_INSNREG00(base)   (base + 0x90)
 #define EHCI_INSNREG00_ENA_INCR16  (0x1 << 25)
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index e3b7e85..b5b5977 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -17,7 +17,6 @@
 #include 
 #include 
 #include 
-#include 
 
 struct exynos_ohci_hcd {
struct device *dev;
-- 
1.8.1.2

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


[PATCH 23/23] ARM: exynos: experimental multiplatform support

2013-03-05 Thread Arnd Bergmann
This enables the exynos platform to be selected as part
of a CONFIG_ARCH_MULTIPLATFORM kernel. This still
breaks a number of drivers, which we will have to
enable again one by one. Single-platform configurations
should not be impacted by this.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/Kconfig   | 11 ++-
 arch/arm/mach-exynos/Kconfig   | 21 +
 arch/arm/mach-exynos/Makefile  |  1 +
 arch/arm/plat-samsung/Kconfig  |  5 +
 arch/arm/plat-samsung/Makefile |  3 +++
 drivers/video/Kconfig  |  2 +-
 drivers/watchdog/Kconfig   |  1 +
 7 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5b71469..56b62f5 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -854,18 +854,11 @@ config ARCH_S5PV210
help
  Samsung S5PV210/S5PC110 series based systems
 
-config ARCH_EXYNOS
+config ARCH_EXYNOS_SINGLE
bool "Samsung EXYNOS"
select ARCH_HAS_CPUFREQ
select ARCH_HAS_HOLES_MEMORYMODEL
select ARCH_SPARSEMEM_ENABLE
-   select CLKDEV_LOOKUP
-   select CPU_V7
-   select GENERIC_CLOCKEVENTS
-   select HAVE_CLK
-   select HAVE_S3C2410_I2C if I2C
-   select HAVE_S3C2410_WATCHDOG if WATCHDOG
-   select HAVE_S3C_RTC if RTC_CLASS
select NEED_MACH_GPIO_H
select NEED_MACH_MEMORY_H
help
@@ -1650,7 +1643,7 @@ config LOCAL_TIMERS
bool "Use local timer interrupts"
depends on SMP
default y
-   select HAVE_ARM_TWD if (!ARCH_MSM_SCORPIONMP && !EXYNOS4_MCT)
+   select HAVE_ARM_TWD if (!ARCH_MSM_SCORPIONMP)
help
  Enable support for local timers on SMP platforms, rather then the
  legacy IPI broadcast method.  Local timers allows the system
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 3291a72..1f2e7dc 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -7,6 +7,19 @@
 
 # Configuration options for the EXYNOS4
 
+config ARCH_EXYNOS
+   bool "Samsung EXYNOS" if ARCH_MULTI_V7
+   default ARCH_EXYNOS_SINGLE
+   select CLKDEV_LOOKUP
+   select CPU_V7
+   select GENERIC_CLOCKEVENTS
+   select HAVE_CLK
+   select HAVE_S3C2410_I2C if I2C
+   select HAVE_S3C2410_WATCHDOG if WATCHDOG
+   select HAVE_S3C_RTC if RTC_CLASS
+   help
+ Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
+
 if ARCH_EXYNOS
 
 menu "SAMSUNG EXYNOS SoCs Support"
@@ -35,7 +48,7 @@ config CPU_EXYNOS4210
select PM_GENERIC_DOMAINS
select S5P_PM if PM
select S5P_SLEEP if PM
-   select SAMSUNG_DMADEV
+   select SAMSUNG_DMADEV if ARCH_EXYNOS_SINGLE
help
  Enable EXYNOS4210 CPU support
 
@@ -45,7 +58,7 @@ config SOC_EXYNOS4212
depends on ARCH_EXYNOS4
select S5P_PM if PM
select S5P_SLEEP if PM
-   select SAMSUNG_DMADEV
+   select SAMSUNG_DMADEV if ARCH_EXYNOS_SINGLE
help
  Enable EXYNOS4212 SoC support
 
@@ -53,7 +66,7 @@ config SOC_EXYNOS4412
bool "SAMSUNG EXYNOS4412"
default y
depends on ARCH_EXYNOS4
-   select SAMSUNG_DMADEV
+   select SAMSUNG_DMADEV if ARCH_EXYNOS_SINGLE
help
  Enable EXYNOS4412 SoC support
 
@@ -64,7 +77,7 @@ config SOC_EXYNOS5250
select S5P_PM if PM
select S5P_SLEEP if PM
select S5P_DEV_MFC
-   select SAMSUNG_DMADEV
+   select SAMSUNG_DMADEV if ARCH_EXYNOS_SINGLE
help
  Enable EXYNOS5250 SoC support
 
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index e2f1742..646b79e 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -4,6 +4,7 @@
 #  http://www.samsung.com/
 #
 # Licensed under GPLv2
+ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(srctree)/$(src)/include 
-I$(srctree)/arch/arm/plat-samsung/include
 
 obj-y  :=
 obj-m  :=
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index a9d5216..b6669db 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -13,6 +13,10 @@ config PLAT_SAMSUNG
help
  Base platform code for all Samsung SoC based systems
 
+config PLAT_SAMSUNG_SINGLE
+   def_bool PLAT_SAMSUNG && !ARCH_MULTIPLATFORM
+   
+
 config PLAT_S5P
bool
depends on (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS)
@@ -178,6 +182,7 @@ config S5P_DEV_UART
 
 config S3C_ADC
bool "ADC common driver support"
+   depends on PLAT_SAMSUNG_SINGLE
help
  Core support for the ADC block found in the Samsung SoC systems
  for drivers such as the touchscreen and hwmon to use to share
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 3a7c64d..78f560e 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -4,6 +4,9 @@
 #
 # 

[PATCH 01/23] ARM: exynos: introduce EXYNOS_ATAGS symbol

2013-03-05 Thread Arnd Bergmann
As a preparation for multiplatform support, this introduces
a new Kconfig symbol to split the ATAGS based EXYNOS platforms
from the DT based ones. Turning off CONFIG_EXYNOS_ATAGS disables
all platforms that are not yet converted to DT, and we can
have code that relies on DT checking for this symbol being
disabled.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/mach-exynos/Kconfig | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 70f94c8..3291a72 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -176,7 +176,20 @@ config EXYNOS_SETUP_SPI
help
  Common setup code for SPI GPIO configurations.
 
+
+config EXYNOS_ATAGS
+   bool "ATAGS based boot for EXYNOS (deprecated)"
+   depends on ARCH_EXYNOS_SINGLE
+   depends on ATAGS
+   default y
+   help
+ The EXYNOS platform is moving towards being completely probed
+ through device tree. This enables support for board files using
+ the traditional ATAGS boot format.
+ Note that this option is not available for multiplatform builds.
+
 # machine support
+if EXYNOS_ATAGS
 
 if ARCH_EXYNOS4
 
@@ -400,6 +413,8 @@ config MACH_SMDK4412
  Machine support for Samsung SMDK4412
 endif
 
+endif
+
 comment "Flattened Device Tree based board for EXYNOS SoCs"
 
 config MACH_EXYNOS4_DT
-- 
1.8.1.2

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


[PATCH 21/23] ARM: exynos: hack to disable private clock code

2013-03-05 Thread Arnd Bergmann
Multiplatform kernels rely on the common clock implementation,
which conflicts with Samsung's own implementation of the same
interface. This disables all code that provides or requires
the nonstandard version.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/mach-exynos/Makefile| 2 ++
 arch/arm/mach-exynos/common.c| 6 ++
 arch/arm/plat-samsung/clock-clksrc.c | 3 +++
 arch/arm/plat-samsung/s5p-clock.c| 3 +++
 drivers/cpufreq/Kconfig.arm  | 4 +++-
 drivers/devfreq/Kconfig  | 1 +
 6 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 435757e..b0dcf7d 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -13,10 +13,12 @@ obj-:=
 # Core
 
 obj-$(CONFIG_ARCH_EXYNOS)  += common.o
+ifdef CONFIG_SAMSUNG_CLOCK
 obj-$(CONFIG_ARCH_EXYNOS4) += clock-exynos4.o
 obj-$(CONFIG_CPU_EXYNOS4210)   += clock-exynos4210.o
 obj-$(CONFIG_SOC_EXYNOS4212)   += clock-exynos4212.o
 obj-$(CONFIG_SOC_EXYNOS5250)   += clock-exynos5.o
+endif
 
 obj-$(CONFIG_PM)   += pm.o
 obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 4b4526d..504d50e 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -404,6 +404,9 @@ static void __init exynos5_map_io(void)
 
 static void __init exynos4_init_clocks(int xtal)
 {
+   if (!IS_ENABLED(CONFIG_SAMSUNG_CLOCK))
+   return;
+
printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
 
s3c24xx_register_baseclocks(xtal);
@@ -425,6 +428,9 @@ static void __init exynos5440_map_io(void)
 
 static void __init exynos5_init_clocks(int xtal)
 {
+   if (!IS_ENABLED(CONFIG_SAMSUNG_CLOCK))
+   return;
+
printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
 
/* EXYNOS5440 can support only common clock framework */
diff --git a/arch/arm/plat-samsung/clock-clksrc.c 
b/arch/arm/plat-samsung/clock-clksrc.c
index 786a410..094fde9 100644
--- a/arch/arm/plat-samsung/clock-clksrc.c
+++ b/arch/arm/plat-samsung/clock-clksrc.c
@@ -179,6 +179,9 @@ void __init s3c_register_clksrc(struct clksrc_clk *clksrc, 
int size)
 {
int ret;
 
+   if (!IS_ENABLED(CONFIG_SAMSUNG_CLOCK))
+   return;
+
for (; size > 0; size--, clksrc++) {
if (!clksrc->reg_div.reg && !clksrc->reg_src.reg)
printk(KERN_ERR "%s: clock %s has no registers set\n",
diff --git a/arch/arm/plat-samsung/s5p-clock.c 
b/arch/arm/plat-samsung/s5p-clock.c
index 48a1599..0e22618 100644
--- a/arch/arm/plat-samsung/s5p-clock.c
+++ b/arch/arm/plat-samsung/s5p-clock.c
@@ -286,6 +286,9 @@ void __init s5p_register_clocks(unsigned long xtal_freq)
 {
int ret;
 
+   if (!IS_ENABLED(CONFIG_SAMSUNG_CLOCK))
+   return;
+
clk_ext_xtal_mux.rate = xtal_freq;
 
ret = s3c24xx_register_clocks(s5p_clks, ARRAY_SIZE(s5p_clks));
diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index 030ddf6..b6fb4fa 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -51,7 +51,7 @@ config ARM_S5PV210_CPUFREQ
 
 config ARM_EXYNOS_CPUFREQ
bool "SAMSUNG EXYNOS SoCs"
-   depends on ARCH_EXYNOS
+   depends on ARCH_EXYNOS && SAMSUNG_CLOCK
default y
help
  This adds the CPUFreq driver common part for Samsung
@@ -59,6 +59,7 @@ config ARM_EXYNOS_CPUFREQ
 
  If in doubt, say N.
 
+if ARM_EXYNOS_CPUFREQ
 config ARM_EXYNOS4210_CPUFREQ
def_bool CPU_EXYNOS4210
help
@@ -76,6 +77,7 @@ config ARM_EXYNOS5250_CPUFREQ
help
  This adds the CPUFreq driver for Samsung EXYNOS5250
  SoC.
+endif
 
 config ARM_KIRKWOOD_CPUFREQ
def_bool ARCH_KIRKWOOD && OF
diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
index 0f079be..d4f9a24 100644
--- a/drivers/devfreq/Kconfig
+++ b/drivers/devfreq/Kconfig
@@ -68,6 +68,7 @@ comment "DEVFREQ Drivers"
 config ARM_EXYNOS4_BUS_DEVFREQ
bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver"
depends on CPU_EXYNOS4210 || CPU_EXYNOS4212 || CPU_EXYNOS4412
+   depends on SAMSUNG_CLOCK
select ARCH_HAS_OPP
select DEVFREQ_GOV_SIMPLE_ONDEMAND
help
-- 
1.8.1.2

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


[PATCH 20/23] ARM: exynos: prepare for sparse IRQ

2013-03-05 Thread Arnd Bergmann
When we enable CONFIG_SPARSE_IRQ, we have to set the
value of NR_IRQS in the machine_desc for legacy IRQ
domains, and any file referring to the number of
interrupts or a specific number must include the
mach/irqs.h header file explicitly.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/mach-exynos/dev-uart.c  | 1 +
 arch/arm/mach-exynos/include/mach/irqs.h | 5 -
 arch/arm/mach-exynos/mach-armlex4210.c   | 2 ++
 arch/arm/mach-exynos/mach-exynos4-dt.c   | 2 ++
 arch/arm/mach-exynos/mach-exynos5-dt.c   | 2 ++
 arch/arm/mach-exynos/mach-nuri.c | 2 ++
 arch/arm/mach-exynos/mach-origen.c   | 2 ++
 arch/arm/mach-exynos/mach-smdk4x12.c | 2 ++
 arch/arm/mach-exynos/mach-smdkv310.c | 3 +++
 arch/arm/plat-samsung/irq-vic-timer.c| 1 +
 arch/arm/plat-samsung/pm.c   | 1 +
 arch/arm/plat-samsung/s5p-irq.c  | 1 +
 12 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-exynos/dev-uart.c b/arch/arm/mach-exynos/dev-uart.c
index 7c42f4b..c48aff0 100644
--- a/arch/arm/mach-exynos/dev-uart.c
+++ b/arch/arm/mach-exynos/dev-uart.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
diff --git a/arch/arm/mach-exynos/include/mach/irqs.h 
b/arch/arm/mach-exynos/include/mach/irqs.h
index 1f4dc35..8bd5dde 100644
--- a/arch/arm/mach-exynos/include/mach/irqs.h
+++ b/arch/arm/mach-exynos/include/mach/irqs.h
@@ -466,7 +466,10 @@
 #define IRQ_TIMER_BASE (IRQ_GPIO_END + 64)
 
 /* Set the default NR_IRQS */
+#define EXYNOS_NR_IRQS (IRQ_TIMER_BASE + IRQ_TIMER_COUNT)
 
-#define NR_IRQS(IRQ_TIMER_BASE + 
IRQ_TIMER_COUNT)
+#ifndef CONFIG_SPARSE_IRQ
+#define NR_IRQSEXYNOS_NR_IRQS
+#endif
 
 #endif /* __ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-exynos/mach-armlex4210.c 
b/arch/arm/mach-exynos/mach-armlex4210.c
index 685f291..cb95992 100644
--- a/arch/arm/mach-exynos/mach-armlex4210.c
+++ b/arch/arm/mach-exynos/mach-armlex4210.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include "common.h"
@@ -197,6 +198,7 @@ static void __init armlex4210_machine_init(void)
 MACHINE_START(ARMLEX4210, "ARMLEX4210")
/* Maintainer: Alim Akhtar  */
.atag_offset= 0x100,
+   .nr_irqs= EXYNOS_NR_IRQS,
.smp= smp_ops(exynos_smp_ops),
.init_irq   = exynos4_init_irq,
.map_io = armlex4210_map_io,
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c 
b/arch/arm/mach-exynos/mach-exynos4-dt.c
index 3358088..55aa611 100644
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
@@ -16,6 +16,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -137,6 +138,7 @@ static char const *exynos4_dt_compat[] __initdata = {
 
 DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
/* Maintainer: Thomas Abraham  */
+   .nr_irqs= EXYNOS_NR_IRQS,
.smp= smp_ops(exynos_smp_ops),
.init_irq   = exynos4_init_irq,
.map_io = exynos4_dt_map_io,
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c 
b/arch/arm/mach-exynos/mach-exynos5-dt.c
index acaeb14..c674e7f 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -17,6 +17,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -211,6 +212,7 @@ static void __init exynos5_reserve(void)
 
 DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
/* Maintainer: Kukjin Kim  */
+   .nr_irqs= EXYNOS_NR_IRQS,
.init_irq   = exynos5_init_irq,
.smp= smp_ops(exynos_smp_ops),
.map_io = exynos5_dt_map_io,
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index 1ea7973..fee0885 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -53,6 +53,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include "common.h"
@@ -1375,6 +1376,7 @@ static void __init nuri_machine_init(void)
 MACHINE_START(NURI, "NURI")
/* Maintainer: Kyungmin Park  */
.atag_offset= 0x100,
+   .nr_irqs= EXYNOS_NR_IRQS,
.smp= smp_ops(exynos_smp_ops),
.init_irq   = exynos4_init_irq,
.map_io = nuri_map_io,
diff --git a/arch/arm/mach-exynos/mach-origen.c 
b/arch/arm/mach-exynos/mach-origen.c
index 579d2d1..d1849d1 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -46,6 +46,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include "common.h"
@@ -810,6 +811,7 @@ static void __init origen_machine_init(void)
 MACHINE_START(ORIGEN, "ORIGEN")
/* Maintainer: JeongHyeon Kim  */
.atag_offset= 0x100,
+   .nr_irqs= EXYNOS_NR_IRQS,
.smp= smp_ops(exynos_smp_ops),
.init_irq   = exynos4_init_irq,

[PATCH 14/23] rtc: s3c: make header file local

2013-03-05 Thread Arnd Bergmann
Nothing outside of the rtc driver includes plat/regs-rtc.h,
so we can simply move the file into the same directory,
which allows us to build the file as platform-independent
code.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/plat-samsung/include/plat/regs-rtc.h | 71 ---
 drivers/rtc/rtc-s3c.c |  3 +-
 drivers/rtc/rtc-s3c.h | 70 ++
 3 files changed, 71 insertions(+), 73 deletions(-)
 delete mode 100644 arch/arm/plat-samsung/include/plat/regs-rtc.h
 create mode 100644 drivers/rtc/rtc-s3c.h

diff --git a/arch/arm/plat-samsung/include/plat/regs-rtc.h 
b/arch/arm/plat-samsung/include/plat/regs-rtc.h
deleted file mode 100644
index 0f8263e..000
--- a/arch/arm/plat-samsung/include/plat/regs-rtc.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* arch/arm/mach-s3c2410/include/mach/regs-rtc.h
- *
- * Copyright (c) 2003 Simtec Electronics 
- *   http://www.simtec.co.uk/products/SWLINUX/
- *
- * 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.
- *
- * S3C2410 Internal RTC register definition
-*/
-
-#ifndef __ASM_ARCH_REGS_RTC_H
-#define __ASM_ARCH_REGS_RTC_H __FILE__
-
-#define S3C2410_RTCREG(x) (x)
-#define S3C2410_INTP   S3C2410_RTCREG(0x30)
-#define S3C2410_INTP_ALM   (1 << 1)
-#define S3C2410_INTP_TIC   (1 << 0)
-
-#define S3C2410_RTCCON S3C2410_RTCREG(0x40)
-#define S3C2410_RTCCON_RTCEN   (1 << 0)
-#define S3C2410_RTCCON_CNTSEL  (1 << 2)
-#define S3C2410_RTCCON_CLKRST  (1 << 3)
-#define S3C2443_RTCCON_TICSEL  (1 << 4)
-#define S3C64XX_RTCCON_TICEN   (1 << 8)
-
-#define S3C2410_TICNT  S3C2410_RTCREG(0x44)
-#define S3C2410_TICNT_ENABLE   (1 << 7)
-
-/* S3C2443: tick count is 15 bit wide
- * TICNT[6:0] contains upper 7 bits
- * TICNT1[7:0] contains lower 8 bits
- */
-#define S3C2443_TICNT_PART(x)  ((x & 0x7f00) >> 8)
-#define S3C2443_TICNT1 S3C2410_RTCREG(0x4C)
-#define S3C2443_TICNT1_PART(x) (x & 0xff)
-
-/* S3C2416: tick count is 32 bit wide
- * TICNT[6:0] contains bits [14:8]
- * TICNT1[7:0] contains lower 8 bits
- * TICNT2[16:0] contains upper 17 bits
- */
-#define S3C2416_TICNT2 S3C2410_RTCREG(0x48)
-#define S3C2416_TICNT2_PART(x) ((x & 0x8000) >> 15)
-
-#define S3C2410_RTCALM S3C2410_RTCREG(0x50)
-#define S3C2410_RTCALM_ALMEN   (1 << 6)
-#define S3C2410_RTCALM_YEAREN  (1 << 5)
-#define S3C2410_RTCALM_MONEN   (1 << 4)
-#define S3C2410_RTCALM_DAYEN   (1 << 3)
-#define S3C2410_RTCALM_HOUREN  (1 << 2)
-#define S3C2410_RTCALM_MINEN   (1 << 1)
-#define S3C2410_RTCALM_SECEN   (1 << 0)
-
-#define S3C2410_ALMSEC S3C2410_RTCREG(0x54)
-#define S3C2410_ALMMIN S3C2410_RTCREG(0x58)
-#define S3C2410_ALMHOURS3C2410_RTCREG(0x5c)
-
-#define S3C2410_ALMDATES3C2410_RTCREG(0x60)
-#define S3C2410_ALMMON S3C2410_RTCREG(0x64)
-#define S3C2410_ALMYEARS3C2410_RTCREG(0x68)
-
-#define S3C2410_RTCSEC S3C2410_RTCREG(0x70)
-#define S3C2410_RTCMIN S3C2410_RTCREG(0x74)
-#define S3C2410_RTCHOURS3C2410_RTCREG(0x78)
-#define S3C2410_RTCDATES3C2410_RTCREG(0x7c)
-#define S3C2410_RTCMON S3C2410_RTCREG(0x84)
-#define S3C2410_RTCYEARS3C2410_RTCREG(0x88)
-
-#endif /* __ASM_ARCH_REGS_RTC_H */
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index fb994e9..7995f79 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -29,9 +29,8 @@
 #include 
 #include 
 
-#include 
 #include 
-#include 
+#include "rtc-s3c.h"
 
 enum s3c_cpu_type {
TYPE_S3C2410,
diff --git a/drivers/rtc/rtc-s3c.h b/drivers/rtc/rtc-s3c.h
new file mode 100644
index 000..004b61a
--- /dev/null
+++ b/drivers/rtc/rtc-s3c.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2003 Simtec Electronics 
+ *   http://www.simtec.co.uk/products/SWLINUX/
+ *
+ * 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.
+ *
+ * S3C2410 Internal RTC register definition
+*/
+
+#ifndef __ASM_ARCH_REGS_RTC_H
+#define __ASM_ARCH_REGS_RTC_H __FILE__
+
+#define S3C2410_RTCREG(x) (x)
+#define S3C2410_INTP   S3C2410_RTCREG(0x30)
+#define S3C2410_INTP_ALM   (1 << 1)
+#define S3C2410_INTP_TIC   (1 << 0)
+
+#define S3C2410_RTCCON S3C2410_RTCREG(0x40)
+#define S3C2410_RTCCON_RTCEN   (1 << 0)
+#define S3C2410_RTCCON_CNTSEL  (1 << 2)
+#define S3C2410_RTCCON_CLKRST  (1 << 3)
+#define S3C2443_RTCCON_TICSEL  (1 << 4)
+#define S3C64XX_RTCCON_TICEN   (1 << 8)
+
+#define S3C2410_TICNT  S3C2410_RTCREG(0x44)
+#define S3C2410_TICNT_ENABLE   (1 << 7)
+
+/* S3C2443: tick count is 15 bit wide
+ * TICNT[6:0] contains upper 7 bits
+ * TICNT1[7:0] contains lower 8 bits
+ */
+#define S3C2443_TICNT_PART(x) 

[PATCH 07/23] i2c: s3c2410: make header file local

2013-03-05 Thread Arnd Bergmann
No other file in the kernel besides i2c-s3c2410.c uses
the current plat/regs-iic.h, so we can simply move the
header file to live in the same directory as the driver,
as a preparation to multiplatform builds.

Signed-off-by: Arnd Bergmann 
---
 arch/arm/mach-s3c24xx/mach-rx1950.c   |  1 -
 arch/arm/plat-samsung/devs.c  |  1 -
 arch/arm/plat-samsung/include/plat/regs-iic.h | 56 ---
 drivers/i2c/busses/i2c-s3c2410.c  |  3 +-
 drivers/i2c/busses/i2c-s3c2410.h  | 56 +++
 5 files changed, 58 insertions(+), 59 deletions(-)
 delete mode 100644 arch/arm/plat-samsung/include/plat/regs-iic.h
 create mode 100644 drivers/i2c/busses/i2c-s3c2410.h

diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c 
b/arch/arm/mach-s3c24xx/mach-rx1950.c
index 1f9ba2a..43f3ac5 100644
--- a/arch/arm/mach-s3c24xx/mach-rx1950.c
+++ b/arch/arm/mach-s3c24xx/mach-rx1950.c
@@ -56,7 +56,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "common.h"
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 51afedd..76209c9 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -62,7 +62,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/plat-samsung/include/plat/regs-iic.h 
b/arch/arm/plat-samsung/include/plat/regs-iic.h
deleted file mode 100644
index 2f7c17d..000
--- a/arch/arm/plat-samsung/include/plat/regs-iic.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* arch/arm/mach-s3c2410/include/mach/regs-iic.h
- *
- * Copyright (c) 2004 Simtec Electronics 
- * http://www.simtec.co.uk/products/SWLINUX/
- *
- * 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.
- *
- * S3C2410 I2C Controller
-*/
-
-#ifndef __ASM_ARCH_REGS_IIC_H
-#define __ASM_ARCH_REGS_IIC_H __FILE__
-
-/* see s3c2410x user guide, v1.1, section 9 (p447) for more info */
-
-#define S3C2410_IICREG(x) (x)
-
-#define S3C2410_IICCONS3C2410_IICREG(0x00)
-#define S3C2410_IICSTAT   S3C2410_IICREG(0x04)
-#define S3C2410_IICADDS3C2410_IICREG(0x08)
-#define S3C2410_IICDS S3C2410_IICREG(0x0C)
-#define S3C2440_IICLCS3C2410_IICREG(0x10)
-
-#define S3C2410_IICCON_ACKEN   (1<<7)
-#define S3C2410_IICCON_TXDIV_16(0<<6)
-#define S3C2410_IICCON_TXDIV_512   (1<<6)
-#define S3C2410_IICCON_IRQEN   (1<<5)
-#define S3C2410_IICCON_IRQPEND (1<<4)
-#define S3C2410_IICCON_SCALE(x)((x)&15)
-#define S3C2410_IICCON_SCALEMASK   (0xf)
-
-#define S3C2410_IICSTAT_MASTER_RX  (2<<6)
-#define S3C2410_IICSTAT_MASTER_TX  (3<<6)
-#define S3C2410_IICSTAT_SLAVE_RX   (0<<6)
-#define S3C2410_IICSTAT_SLAVE_TX   (1<<6)
-#define S3C2410_IICSTAT_MODEMASK   (3<<6)
-
-#define S3C2410_IICSTAT_START  (1<<5)
-#define S3C2410_IICSTAT_BUSBUSY(1<<5)
-#define S3C2410_IICSTAT_TXRXEN (1<<4)
-#define S3C2410_IICSTAT_ARBITR (1<<3)
-#define S3C2410_IICSTAT_ASSLAVE(1<<2)
-#define S3C2410_IICSTAT_ADDR0  (1<<1)
-#define S3C2410_IICSTAT_LASTBIT(1<<0)
-
-#define S3C2410_IICLC_SDA_DELAY0   (0 << 0)
-#define S3C2410_IICLC_SDA_DELAY5   (1 << 0)
-#define S3C2410_IICLC_SDA_DELAY10  (2 << 0)
-#define S3C2410_IICLC_SDA_DELAY15  (3 << 0)
-#define S3C2410_IICLC_SDA_DELAY_MASK   (3 << 0)
-
-#define S3C2410_IICLC_FILTER_ON(1<<2)
-
-#endif /* __ASM_ARCH_REGS_IIC_H */
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index f6b880b..d042ad0 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -42,9 +42,10 @@
 
 #include 
 
-#include 
 #include 
 
+#include "i2c-s3c2410.h"
+
 /* Treat S3C2410 as baseline hardware, anything else is supported via quirks */
 #define QUIRK_S3C2440  (1 << 0)
 #define QUIRK_HDMIPHY  (1 << 1)
diff --git a/drivers/i2c/busses/i2c-s3c2410.h b/drivers/i2c/busses/i2c-s3c2410.h
new file mode 100644
index 000..2f7c17d
--- /dev/null
+++ b/drivers/i2c/busses/i2c-s3c2410.h
@@ -0,0 +1,56 @@
+/* arch/arm/mach-s3c2410/include/mach/regs-iic.h
+ *
+ * Copyright (c) 2004 Simtec Electronics 
+ * http://www.simtec.co.uk/products/SWLINUX/
+ *
+ * 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.
+ *
+ * S3C2410 I2C Controller
+*/
+
+#ifndef __ASM_ARCH_REGS_IIC_H
+#define __ASM_ARCH_REGS_IIC_H __FILE__
+
+/* see s3c2410x user guide, v1.1, section 9 (p447) for more info */
+
+#define S3C2410_IICREG(x) (x)
+
+#define S3C2410_IICCONS3C2410_IICREG(0x00)
+#define S3C2410_IICSTAT   S3C2410_IICREG(0x04)
+#define S3C2410_IICADDS3C2410_IICREG(0x08)
+#define S3C2410_IICDS S3C2

[PATCH 06/23] ARM: exynos: move debug-macro.S to include/debug/

2013-03-05 Thread Arnd Bergmann
The move is necessary to support early debug output
on exynos with multiplatform configurations. This
implies also moving the plat/debug-macro.S file, but
we are leaving the remaining users of that file
in place, to avoid adding large numbers of extra
configuration options to Kconfig.debug

Signed-off-by: Arnd Bergmann 
---
 arch/arm/Kconfig.debug   |  8 +++
 arch/arm/include/debug/exynos.S  | 39 +++
 arch/arm/include/debug/samsung.S | 87 
 arch/arm/mach-exynos/include/mach/debug-macro.S  | 39 ---
 arch/arm/mach-s3c24xx/include/mach/debug-macro.S |  2 +-
 arch/arm/mach-s3c64xx/include/mach/debug-macro.S |  2 +-
 arch/arm/mach-s5p64x0/include/mach/debug-macro.S |  2 +-
 arch/arm/mach-s5pc100/include/mach/debug-macro.S |  2 +-
 arch/arm/mach-s5pv210/include/mach/debug-macro.S |  2 +-
 arch/arm/plat-samsung/include/plat/debug-macro.S | 87 
 10 files changed, 139 insertions(+), 131 deletions(-)
 create mode 100644 arch/arm/include/debug/exynos.S
 create mode 100644 arch/arm/include/debug/samsung.S
 delete mode 100644 arch/arm/mach-exynos/include/mach/debug-macro.S
 delete mode 100644 arch/arm/plat-samsung/include/plat/debug-macro.S

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index aca..3c6851a 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -330,6 +330,7 @@ choice
 
config DEBUG_S3C_UART0
depends on PLAT_SAMSUNG
+   select DEBUG_EXYNOS_UART if ARCH_EXYNOS
bool "Use S3C UART 0 for low-level debug"
help
  Say Y here if you want the debug print routines to direct
@@ -341,6 +342,7 @@ choice
 
config DEBUG_S3C_UART1
depends on PLAT_SAMSUNG
+   select DEBUG_EXYNOS_UART if ARCH_EXYNOS
bool "Use S3C UART 1 for low-level debug"
help
  Say Y here if you want the debug print routines to direct
@@ -352,6 +354,7 @@ choice
 
config DEBUG_S3C_UART2
depends on PLAT_SAMSUNG
+   select DEBUG_EXYNOS_UART if ARCH_EXYNOS
bool "Use S3C UART 2 for low-level debug"
help
  Say Y here if you want the debug print routines to direct
@@ -363,6 +366,7 @@ choice
 
config DEBUG_S3C_UART3
depends on PLAT_SAMSUNG && ARCH_EXYNOS
+   select DEBUG_EXYNOS_UART
bool "Use S3C UART 3 for low-level debug"
help
  Say Y here if you want the debug print routines to direct
@@ -485,6 +489,9 @@ choice
 
 endchoice
 
+config DEBUG_EXYNOS_UART
+   bool
+
 config DEBUG_IMX_UART_PORT
int "i.MX Debug UART Port Selection" if DEBUG_IMX1_UART || \
DEBUG_IMX25_UART || \
@@ -579,6 +586,7 @@ endchoice
 
 config DEBUG_LL_INCLUDE
string
+   default "debug/exynos.S" if DEBUG_EXYNOS_UART
default "debug/icedcc.S" if DEBUG_ICEDCC
default "debug/imx.S" if DEBUG_IMX1_UART || \
 DEBUG_IMX25_UART || \
diff --git a/arch/arm/include/debug/exynos.S b/arch/arm/include/debug/exynos.S
new file mode 100644
index 000..b17fdb7
--- /dev/null
+++ b/arch/arm/include/debug/exynos.S
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * 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.
+*/
+
+/* pull in the relevant register and map files. */
+
+#define S3C_ADDR_BASE   0xF600
+#define S3C_VA_UARTS3C_ADDR_BASE + 0x0100
+#define EXYNOS4_PA_UART0x1380
+#define EXYNOS5_PA_UART0x12C0
+
+   /* note, for the boot process to work we have to keep the UART
+* virtual address aligned to an 1MiB boundary for the L1
+* mapping the head code makes. We keep the UART virtual address
+* aligned and add in the offset when we load the value here.
+*/
+
+   .macro addruart, rp, rv, tmp
+   mrc p15, 0, \tmp, c0, c0, 0
+   and \tmp, \tmp, #0xf0
+   teq \tmp, #0xf0 @@ A15
+   ldreq   \rp, =EXYNOS5_PA_UART
+   movne   \rp, #EXYNOS4_PA_UART   @@ EXYNOS4
+   ldr \rv, =S3C_VA_UART
+#if CONFIG_DEBUG_S3C_UART != 0
+   add \rp, \rp, #(0x1 * CONFIG_DEBUG_S3C_UART)
+   add \rv, \rv, #(0x1 * CONFIG_DEBUG_S3C_UART)
+#endif
+   .endm
+
+#define fifo_full fifo_full_s5pv210
+#define fifo_level fifo_level_s5pv210
+
+#include 
diff --git a/arch/arm/include/debug/samsung.S b/arch/arm/include/debug/samsung.S
new file mode 100644
index 000..8d8d922
--- /dev/null
+++ b/arch/arm/include/debug/samsung.S

Re: [PATCH] dma: of-dma: return error when 'dma-cells' not found

2013-03-05 Thread Rob Herring
On 03/05/2013 04:15 AM, Arnd Bergmann wrote:
> On Tuesday 05 March 2013 03:43:52 Rob Herring wrote:
>> On 03/05/2013 03:25 AM, Padmavathi Venna wrote:
>>> This patch returns error when 'dma-cells' property not found
>>> in the corresponding device node. With out this change there
>>> is a crash in the generic dma incompatible platforms.
>>>
>>> Signed-off-by: Padmavathi Venna 
>>
>> NAK.
>>
>> #dma-cells should be optional. It is not needed for platforms supporting
>> memory to memory transfers only and should therefore be optional. You
>> cannot assume the dtb can be updated and kernel changes need to work
>> with old dtbs. I've submitted patches to address this and fix the crash:
>>
>> https://lists.ozlabs.org/pipermail/devicetree-discuss/2013-February/028769.html
> 
> Why would you call of_dma_controller_register() for a dma
> engine that does not support slave channels, when that is the
> only purpose of that interface?

Well maybe then that function should be allowed to fail without erroring
out. I just fixed it a the line that failed. Doing be32_to_cpup directly
on a function return that can be NULL is not correct either.

> Note that the binding defines #dma-cells as required, and it
> does not make any sense otherwise.

The 2nd patch I submitted changes that. It does not make sense to
require it if you have no requests and hence will never have a phandle
reference in a slave device. The simple fact is that the pl330 had an
existing binding that worked for the memory to memory only case and
kernel changes broke this. Kernel changes should not break existing
device-trees.

Rob

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


[PATCH V2] ARM: dts: Modify SPI nodes according generic DMA DT bindings

2013-03-05 Thread Padmavathi Venna
This patch removes custom way of adding spi dma channels and
adds according to new generic DMA DT bindings on samsung exynos4
and exynos5440 platforms.

Signed-off-by: Padmavathi Venna 
---

Changes since V1:
- Corrected the pdma phandle in spi1 node.

 arch/arm/boot/dts/exynos4.dtsi|   15 +--
 arch/arm/boot/dts/exynos5440.dtsi |5 +++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 1a62bcf..4521a72 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -235,8 +235,9 @@
compatible = "samsung,exynos4210-spi";
reg = <0x1392 0x100>;
interrupts = <0 66 0>;
-   tx-dma-channel = <&pdma0 7>; /* preliminary */
-   rx-dma-channel = <&pdma0 6>; /* preliminary */
+   dmas = <&pdma0 7
+   &pdma0 6>;
+   dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
@@ -246,8 +247,9 @@
compatible = "samsung,exynos4210-spi";
reg = <0x1393 0x100>;
interrupts = <0 67 0>;
-   tx-dma-channel = <&pdma1 7>; /* preliminary */
-   rx-dma-channel = <&pdma1 6>; /* preliminary */
+   dmas = <&pdma1 7
+   &pdma1 6>;
+   dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
@@ -257,8 +259,9 @@
compatible = "samsung,exynos4210-spi";
reg = <0x1394 0x100>;
interrupts = <0 68 0>;
-   tx-dma-channel = <&pdma0 9>; /* preliminary */
-   rx-dma-channel = <&pdma0 8>; /* preliminary */
+   dmas = <&pdma0 9
+   &pdma0 8>;
+   dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
diff --git a/arch/arm/boot/dts/exynos5440.dtsi 
b/arch/arm/boot/dts/exynos5440.dtsi
index 9a99755..31a3626 100644
--- a/arch/arm/boot/dts/exynos5440.dtsi
+++ b/arch/arm/boot/dts/exynos5440.dtsi
@@ -79,8 +79,9 @@
compatible = "samsung,exynos4210-spi";
reg = <0xD 0x1000>;
interrupts = <0 4 0>;
-   tx-dma-channel = <&pdma0 5>; /* preliminary */
-   rx-dma-channel = <&pdma0 4>; /* preliminary */
+   dmas = <&pdma0 5
+   &pdma0 4>;
+   dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
};
-- 
1.7.4.4

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


Re: [PATCH] ARM: dts: Modify SPI nodes according generic DMA DT bindings

2013-03-05 Thread Sylwester Nawrocki
On 03/05/2013 11:06 AM, Sachin Kamat wrote:
> On 5 March 2013 15:34, Padmavathi Venna  wrote:
>> This patch removes custom way of adding spi dma channels and
>> adds according to new generic DMA DT bindings on samsung exynos4
>> and exynos5440 platforms.
>>
>> Signed-off-by: Padmavathi Venna 
>> ---
>>  arch/arm/boot/dts/exynos4.dtsi|   15 +--
>>  arch/arm/boot/dts/exynos5440.dtsi |5 +++--
>>  2 files changed, 12 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
...
>> @@ -246,8 +247,9 @@
>> compatible = "samsung,exynos4210-spi";
>> reg = <0x1393 0x100>;
>> interrupts = <0 67 0>;
>> -   tx-dma-channel = <&pdma1 7>; /* preliminary */
>> -   rx-dma-channel = <&pdma1 6>; /* preliminary */
>> +   dmas = <&pdma0 7
>> +   &pdma0 6>;
> 
> Shouldn't these be pdma1 as was earlier?

Yes, it should. And this is also what the SoC documentation says - SPI1 is
assigned to Peri DMA1.
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: dts: Modify SPI nodes according generic DMA DT bindings

2013-03-05 Thread Padma Venkat
On Tue, Mar 5, 2013 at 3:36 PM, Sachin Kamat  wrote:
> On 5 March 2013 15:34, Padmavathi Venna  wrote:
>> This patch removes custom way of adding spi dma channels and
>> adds according to new generic DMA DT bindings on samsung exynos4
>> and exynos5440 platforms.
>>
>> Signed-off-by: Padmavathi Venna 
>> ---
>>  arch/arm/boot/dts/exynos4.dtsi|   15 +--
>>  arch/arm/boot/dts/exynos5440.dtsi |5 +++--
>>  2 files changed, 12 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
>> index 1a62bcf..2449651 100644
>> --- a/arch/arm/boot/dts/exynos4.dtsi
>> +++ b/arch/arm/boot/dts/exynos4.dtsi
>> @@ -235,8 +235,9 @@
>> compatible = "samsung,exynos4210-spi";
>> reg = <0x1392 0x100>;
>> interrupts = <0 66 0>;
>> -   tx-dma-channel = <&pdma0 7>; /* preliminary */
>> -   rx-dma-channel = <&pdma0 6>; /* preliminary */
>> +   dmas = <&pdma0 7
>> +   &pdma0 6>;
>> +   dma-names = "tx", "rx";
>> #address-cells = <1>;
>> #size-cells = <0>;
>> status = "disabled";
>> @@ -246,8 +247,9 @@
>> compatible = "samsung,exynos4210-spi";
>> reg = <0x1393 0x100>;
>> interrupts = <0 67 0>;
>> -   tx-dma-channel = <&pdma1 7>; /* preliminary */
>> -   rx-dma-channel = <&pdma1 6>; /* preliminary */
>> +   dmas = <&pdma0 7
>> +   &pdma0 6>;
>
> Shouldn't these be pdma1 as was earlier?

Oops, It's my mistake. Will repost this.

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


Re: [PATCH] dma: of-dma: return error when 'dma-cells' not found

2013-03-05 Thread Arnd Bergmann
On Tuesday 05 March 2013 03:43:52 Rob Herring wrote:
> On 03/05/2013 03:25 AM, Padmavathi Venna wrote:
> > This patch returns error when 'dma-cells' property not found
> > in the corresponding device node. With out this change there
> > is a crash in the generic dma incompatible platforms.
> > 
> > Signed-off-by: Padmavathi Venna 
> 
> NAK.
> 
> #dma-cells should be optional. It is not needed for platforms supporting
> memory to memory transfers only and should therefore be optional. You
> cannot assume the dtb can be updated and kernel changes need to work
> with old dtbs. I've submitted patches to address this and fix the crash:
> 
> https://lists.ozlabs.org/pipermail/devicetree-discuss/2013-February/028769.html

Why would you call of_dma_controller_register() for a dma
engine that does not support slave channels, when that is the
only purpose of that interface?

Note that the binding defines #dma-cells as required, and it
does not make any sense otherwise.

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


Re: [PATCH] ARM: dts: Modify SPI nodes according generic DMA DT bindings

2013-03-05 Thread Sachin Kamat
On 5 March 2013 15:34, Padmavathi Venna  wrote:
> This patch removes custom way of adding spi dma channels and
> adds according to new generic DMA DT bindings on samsung exynos4
> and exynos5440 platforms.
>
> Signed-off-by: Padmavathi Venna 
> ---
>  arch/arm/boot/dts/exynos4.dtsi|   15 +--
>  arch/arm/boot/dts/exynos5440.dtsi |5 +++--
>  2 files changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
> index 1a62bcf..2449651 100644
> --- a/arch/arm/boot/dts/exynos4.dtsi
> +++ b/arch/arm/boot/dts/exynos4.dtsi
> @@ -235,8 +235,9 @@
> compatible = "samsung,exynos4210-spi";
> reg = <0x1392 0x100>;
> interrupts = <0 66 0>;
> -   tx-dma-channel = <&pdma0 7>; /* preliminary */
> -   rx-dma-channel = <&pdma0 6>; /* preliminary */
> +   dmas = <&pdma0 7
> +   &pdma0 6>;
> +   dma-names = "tx", "rx";
> #address-cells = <1>;
> #size-cells = <0>;
> status = "disabled";
> @@ -246,8 +247,9 @@
> compatible = "samsung,exynos4210-spi";
> reg = <0x1393 0x100>;
> interrupts = <0 67 0>;
> -   tx-dma-channel = <&pdma1 7>; /* preliminary */
> -   rx-dma-channel = <&pdma1 6>; /* preliminary */
> +   dmas = <&pdma0 7
> +   &pdma0 6>;

Shouldn't these be pdma1 as was earlier?
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] dma: of-dma: return error when 'dma-cells' not found

2013-03-05 Thread Padma Venkat
On Tue, Mar 5, 2013 at 3:13 PM, Rob Herring  wrote:
> On 03/05/2013 03:25 AM, Padmavathi Venna wrote:
>> This patch returns error when 'dma-cells' property not found
>> in the corresponding device node. With out this change there
>> is a crash in the generic dma incompatible platforms.
>>
>> Signed-off-by: Padmavathi Venna 
>
> NAK.
>
> #dma-cells should be optional. It is not needed for platforms supporting
> memory to memory transfers only and should therefore be optional. You
> cannot assume the dtb can be updated and kernel changes need to work
> with old dtbs. I've submitted patches to address this and fix the crash:
>
> https://lists.ozlabs.org/pipermail/devicetree-discuss/2013-February/028769.html
>

Okay.

Thanks
Padma

> Rob
>> ---
>>
>> Based on Vinod Koul next branch.
>>
>>  drivers/dma/of-dma.c |8 +++-
>>  1 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
>> index 69d04d2..46aca0d 100644
>> --- a/drivers/dma/of-dma.c
>> +++ b/drivers/dma/of-dma.c
>> @@ -92,6 +92,7 @@ int of_dma_controller_register(struct device_node *np,
>>   void *data)
>>  {
>>   struct of_dma   *ofdma;
>> + const__be32 *ip;
>>   int nbcells;
>>
>>   if (!np || !of_dma_xlate) {
>> @@ -103,7 +104,12 @@ int of_dma_controller_register(struct device_node *np,
>>   if (!ofdma)
>>   return -ENOMEM;
>>
>> - nbcells = be32_to_cpup(of_get_property(np, "#dma-cells", NULL));
>> + ip = of_get_property(np, "#dma-cells", NULL);
>> + if (!ip)
>> + return -ENXIO;
>> +
>> + nbcells = be32_to_cpup(ip);
>> +
>>   if (!nbcells) {
>>   pr_err("%s: #dma-cells property is missing or invalid\n",
>>  __func__);
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ARM: dts: Modify SPI nodes according generic DMA DT bindings

2013-03-05 Thread Padmavathi Venna
This patch removes custom way of adding spi dma channels and
adds according to new generic DMA DT bindings on samsung exynos4
and exynos5440 platforms.

Signed-off-by: Padmavathi Venna 
---
 arch/arm/boot/dts/exynos4.dtsi|   15 +--
 arch/arm/boot/dts/exynos5440.dtsi |5 +++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 1a62bcf..2449651 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -235,8 +235,9 @@
compatible = "samsung,exynos4210-spi";
reg = <0x1392 0x100>;
interrupts = <0 66 0>;
-   tx-dma-channel = <&pdma0 7>; /* preliminary */
-   rx-dma-channel = <&pdma0 6>; /* preliminary */
+   dmas = <&pdma0 7
+   &pdma0 6>;
+   dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
@@ -246,8 +247,9 @@
compatible = "samsung,exynos4210-spi";
reg = <0x1393 0x100>;
interrupts = <0 67 0>;
-   tx-dma-channel = <&pdma1 7>; /* preliminary */
-   rx-dma-channel = <&pdma1 6>; /* preliminary */
+   dmas = <&pdma0 7
+   &pdma0 6>;
+   dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
@@ -257,8 +259,9 @@
compatible = "samsung,exynos4210-spi";
reg = <0x1394 0x100>;
interrupts = <0 68 0>;
-   tx-dma-channel = <&pdma0 9>; /* preliminary */
-   rx-dma-channel = <&pdma0 8>; /* preliminary */
+   dmas = <&pdma0 9
+   &pdma0 8>;
+   dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
diff --git a/arch/arm/boot/dts/exynos5440.dtsi 
b/arch/arm/boot/dts/exynos5440.dtsi
index 9a99755..31a3626 100644
--- a/arch/arm/boot/dts/exynos5440.dtsi
+++ b/arch/arm/boot/dts/exynos5440.dtsi
@@ -79,8 +79,9 @@
compatible = "samsung,exynos4210-spi";
reg = <0xD 0x1000>;
interrupts = <0 4 0>;
-   tx-dma-channel = <&pdma0 5>; /* preliminary */
-   rx-dma-channel = <&pdma0 4>; /* preliminary */
+   dmas = <&pdma0 5
+   &pdma0 4>;
+   dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
};
-- 
1.7.4.4

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


Re: [PATCH] dma: of-dma: return error when 'dma-cells' not found

2013-03-05 Thread Rob Herring
On 03/05/2013 03:25 AM, Padmavathi Venna wrote:
> This patch returns error when 'dma-cells' property not found
> in the corresponding device node. With out this change there
> is a crash in the generic dma incompatible platforms.
> 
> Signed-off-by: Padmavathi Venna 

NAK.

#dma-cells should be optional. It is not needed for platforms supporting
memory to memory transfers only and should therefore be optional. You
cannot assume the dtb can be updated and kernel changes need to work
with old dtbs. I've submitted patches to address this and fix the crash:

https://lists.ozlabs.org/pipermail/devicetree-discuss/2013-February/028769.html

Rob
> ---
> 
> Based on Vinod Koul next branch.
> 
>  drivers/dma/of-dma.c |8 +++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
> index 69d04d2..46aca0d 100644
> --- a/drivers/dma/of-dma.c
> +++ b/drivers/dma/of-dma.c
> @@ -92,6 +92,7 @@ int of_dma_controller_register(struct device_node *np,
>   void *data)
>  {
>   struct of_dma   *ofdma;
> + const__be32 *ip;
>   int nbcells;
>  
>   if (!np || !of_dma_xlate) {
> @@ -103,7 +104,12 @@ int of_dma_controller_register(struct device_node *np,
>   if (!ofdma)
>   return -ENOMEM;
>  
> - nbcells = be32_to_cpup(of_get_property(np, "#dma-cells", NULL));
> + ip = of_get_property(np, "#dma-cells", NULL);
> + if (!ip)
> + return -ENXIO;
> +
> + nbcells = be32_to_cpup(ip);
> +
>   if (!nbcells) {
>   pr_err("%s: #dma-cells property is missing or invalid\n",
>  __func__);
> 

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


[PATCH V2] DMA: PL330: Add check if device tree compatible

2013-03-05 Thread Padmavathi Venna
This patch register the dma controller with generic dma helpers only
in DT case. This also adds some extra error handling in the driver.

Signed-off-by: Padmavathi Venna 
Reported-by: Sachin Kamat 
---

Based on Vinod Koul next branch.

Changes since V1:
- return silently when of_dma_controller_register fails, as
  suggested by Arnd.

 drivers/dma/pl330.c |   38 +++---
 1 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 7181531..5dbc594 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2882,7 +2882,7 @@ pl330_probe(struct amba_device *adev, const struct 
amba_id *id)
 {
struct dma_pl330_platdata *pdat;
struct dma_pl330_dmac *pdmac;
-   struct dma_pl330_chan *pch;
+   struct dma_pl330_chan *pch, *_p;
struct pl330_info *pi;
struct dma_device *pd;
struct resource *res;
@@ -2984,7 +2984,16 @@ pl330_probe(struct amba_device *adev, const struct 
amba_id *id)
ret = dma_async_device_register(pd);
if (ret) {
dev_err(&adev->dev, "unable to register DMAC\n");
-   goto probe_err2;
+   goto probe_err3;
+   }
+
+   if (adev->dev.of_node) {
+   ret = of_dma_controller_register(adev->dev.of_node,
+of_dma_pl330_xlate, pdmac);
+   if (ret) {
+   dev_err(&adev->dev,
+   "unable to register DMA to the generic DT DMA 
helpers\n");
+   }
}
 
dev_info(&adev->dev,
@@ -2995,16 +3004,21 @@ pl330_probe(struct amba_device *adev, const struct 
amba_id *id)
pi->pcfg.data_bus_width / 8, pi->pcfg.num_chan,
pi->pcfg.num_peri, pi->pcfg.num_events);
 
-   ret = of_dma_controller_register(adev->dev.of_node,
-of_dma_pl330_xlate, pdmac);
-   if (ret) {
-   dev_err(&adev->dev,
-   "unable to register DMA to the generic DT DMA helpers\n");
-   goto probe_err2;
-   }
-
return 0;
+probe_err3:
+   amba_set_drvdata(adev, NULL);
 
+   /* Idle the DMAC */
+   list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,
+   chan.device_node) {
+
+   /* Remove the channel */
+   list_del(&pch->chan.device_node);
+
+   /* Flush the channel */
+   pl330_control(&pch->chan, DMA_TERMINATE_ALL, 0);
+   pl330_free_chan_resources(&pch->chan);
+   }
 probe_err2:
pl330_del(pi);
 probe_err1:
@@ -3023,8 +3037,10 @@ static int pl330_remove(struct amba_device *adev)
if (!pdmac)
return 0;
 
-   of_dma_controller_free(adev->dev.of_node);
+   if (adev->dev.of_node)
+   of_dma_controller_free(adev->dev.of_node);
 
+   dma_async_device_unregister(&pdmac->ddma);
amba_set_drvdata(adev, NULL);
 
/* Idle the DMAC */
-- 
1.7.4.4

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


[PATCH] dma: of-dma: return error when 'dma-cells' not found

2013-03-05 Thread Padmavathi Venna
This patch returns error when 'dma-cells' property not found
in the corresponding device node. With out this change there
is a crash in the generic dma incompatible platforms.

Signed-off-by: Padmavathi Venna 
---

Based on Vinod Koul next branch.

 drivers/dma/of-dma.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
index 69d04d2..46aca0d 100644
--- a/drivers/dma/of-dma.c
+++ b/drivers/dma/of-dma.c
@@ -92,6 +92,7 @@ int of_dma_controller_register(struct device_node *np,
void *data)
 {
struct of_dma   *ofdma;
+   const__be32 *ip;
int nbcells;
 
if (!np || !of_dma_xlate) {
@@ -103,7 +104,12 @@ int of_dma_controller_register(struct device_node *np,
if (!ofdma)
return -ENOMEM;
 
-   nbcells = be32_to_cpup(of_get_property(np, "#dma-cells", NULL));
+   ip = of_get_property(np, "#dma-cells", NULL);
+   if (!ip)
+   return -ENXIO;
+
+   nbcells = be32_to_cpup(ip);
+
if (!nbcells) {
pr_err("%s: #dma-cells property is missing or invalid\n",
   __func__);
-- 
1.7.4.4

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