Re: [PATCH V8] mmc: core: Add Power Off Notify Feature eMMC 4.5

2011-10-13 Thread Chris Ball
Hi Girish, just trivial changes below.

Does anyone have a Tested-by: to add to the patch?

On Thu, Oct 13 2011, Girish K S wrote:
> This patch adds the support for power off notify feature, available in 
> eMMC 4.5 devices. If the the host has support for this feature, then the
> mmc core will notify it to the device by setting the POWER_OFF_NOTIFICATION
> byte in the extended csd register with a value 1(POWER_ON).
>
> For suspend mode short timeout is used, whereas for the normal poweroff long
> timeout is used.
> cc: Chris Ball 
> Signed-off-by: Girish K S 
> Signed-off-by: Jaehoon Chung 
> ---
> Changes in V8:
>   Updated with review comments of Chris Ball and rebased to 
>   chris-mmc/mmc-next branch.
> Changes in V7:
>   Rebased to chris-mmc/mmc-next branch. merged to patches 
>   to single patch.
> Changes in V6:
>   Fixes checkpatch errors. The patches are generated after
>   rebasing to chris's mmc-next branch.
> Changes in V5:
>   This patch version fixes the problem with power off
>   notify function, when called for the first time and
>   card is not yet initialised.
> Changes in V4:
>   Updated with review comments of Jeon
> Changes in V2:
>   Adds poweroff notification handling in suspend/normal.
>
>  drivers/mmc/core/core.c  |   36 
>  drivers/mmc/core/mmc.c   |   23 +--
>  drivers/mmc/host/sdhci.c |9 +
>  include/linux/mmc/card.h |6 ++
>  include/linux/mmc/host.h |6 ++
>  include/linux/mmc/mmc.h  |8 
>  6 files changed, 86 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 61d7730..db368b2 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1212,11 +1212,45 @@ static void mmc_power_up(struct mmc_host *host)
>  
>  void mmc_power_off(struct mmc_host *host)
>  {
> + struct mmc_card *card;

struct mmc_card *card = host->card;

> + unsigned int notify_type;
> + unsigned int timeout;
> + int err;
> +
> + BUG_ON(!host);

Not necessary.

> +
>   mmc_host_clk_hold(host);
>  
> + card = host->card;
>   host->ios.clock = 0;
>   host->ios.vdd = 0;
>  
> + if (card != NULL && mmc_card_mmc(card) &&

!= NULL is unnecessary.

> + (card->poweroff_notify_state == MMC_POWERED_ON)) {

Extra set of parens unnecessary.

> +
> + if (host->power_notify_type == MMC_HOST_PW_NOTIFY_SHORT) {
> + notify_type = EXT_CSD_POWER_OFF_SHORT;
> + timeout = card->ext_csd.generic_cmd6_time;
> + card->poweroff_notify_state = MMC_POWEROFF_SHORT;
> + } else {
> + notify_type = EXT_CSD_POWER_OFF_LONG;
> + timeout = card->ext_csd.power_off_longtime;
> + card->poweroff_notify_state = MMC_POWEROFF_LONG;
> + }
> +
> + err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> +  EXT_CSD_POWER_OFF_NOTIFICATION,
> +  notify_type, timeout);
> +
> + if (err && err != -EBADMSG)
> + pr_err("Device failed to respond within %d poweroff "
> +"time. Forcefully powering down the device\n",
> +timeout);
> +
> + /* Set the card state to no notification after the poweroff */
> + card->poweroff_notify_state = MMC_NO_POWER_NOTIFICATION;
> + }
> +
>   /*
>* Reset ocr mask to be the highest possible voltage supported for
>* this mmc host. This value will be used at next power up.
> @@ -2208,6 +2242,7 @@ int mmc_pm_notify(struct notifier_block *notify_block,
>  
>   spin_lock_irqsave(&host->lock, flags);
>   host->rescan_disable = 1;
> + host->power_notify_type = MMC_HOST_PW_NOTIFY_SHORT;
>   spin_unlock_irqrestore(&host->lock, flags);
>   cancel_delayed_work_sync(&host->detect);
>  
> @@ -2231,6 +2266,7 @@ int mmc_pm_notify(struct notifier_block *notify_block,
>  
>   spin_lock_irqsave(&host->lock, flags);
>   host->rescan_disable = 0;
> + host->power_notify_type = MMC_HOST_PW_NOTIFY_LONG;
>   spin_unlock_irqrestore(&host->lock, flags);
>   mmc_detect_change(host, 0);
>  
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 4e869d3..f8ea938 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -458,10 +458,12 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 
> *ext_csd)
>   else
>   card->erased_byte = 0x0;
>  
> - if (card->ext_csd.rev >= 6)
> + if (card->ext_csd.rev >= 6) {
>   card->ext_csd.generic_cmd6_time = 10 *
>   ext_csd[EXT_CSD_GENERIC_CMD6_TIME];
> - else
> + card->ext_csd.power_off_longtime = 10 *
> +  

Re: [PATCH] rtc: rtc-s3c: Add device tree support

2011-10-13 Thread Grant Likely
On Tue, Oct 11, 2011 at 07:48:07PM +0900, Kukjin Kim wrote:
> Thomas Abraham wrote:
> > 
> > On 3 September 2011 21:19, Thomas Abraham 
> > wrote:
> > > Add device tree based discovery support for Samsung's rtc controller.
> > >
> > > Cc: Ben Dooks 
> > > Signed-off-by: Thomas Abraham 
> > > ---
> > >  Documentation/devicetree/bindings/rtc/s3c-rtc.txt |   20
> > 
> > >  drivers/rtc/rtc-s3c.c                             |   21
> > -
> > >  2 files changed, 40 insertions(+), 1 deletions(-)
> > >  create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > 
> > Ping. Any comments for this patch? If this looks fine, can this be
> > considered for 3.2 merge via the Samsung kernel tree.
> > 
> (Cc'ed Alessandro Zummo who is RTC Subsystem maintainer)
> 
> I'm ok with this, so if this can be got the ack from Grant and Alessandro,
> will take this.

Acked-by: Grant Likely 
> 
> > >
> > > diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > > new file mode 100644
> > > index 000..90ec45f
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > > @@ -0,0 +1,20 @@
> > > +* Samsung's S3C Real Time Clock controller
> > > +
> > > +Required properties:
> > > +- compatible: should be one of the following.
> > > +    * "samsung,s3c2410-rtc" - for controllers compatible with s3c2410
> rtc.
> > > +    * "samsung,s3c6410-rtc" - for controllers compatible with s3c6410
> rtc.
> > > +- reg: physical base address of the controller and length of memory
> mapped
> > > +  region.
> > > +- interrupts: Two interrupt numbers to the cpu should be specified.
> First
> > > +  interrupt number is the rtc alarm interupt and second interrupt
> number
> > > +  is the rtc tick interrupt. The number of cells representing a
> interrupt
> > > +  depends on the parent interrupt controller.
> > > +
> > > +Example:
> > > +
> > > +       rtc@1007 {
> > > +               compatible = "samsung,s3c6410-rtc";
> > > +               reg = <0x1007 0x100>;
> > > +               interrupts = <44 0 45 0>;
> > > +       };
> > > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
> > > index 4e7c04e..29f928c 100644
> > > --- a/drivers/rtc/rtc-s3c.c
> > > +++ b/drivers/rtc/rtc-s3c.c
> > > @@ -25,6 +25,7 @@
> > >  #include 
> > >  #include 
> > >  #include 
> > > +#include 
> > >
> > >  #include 
> > >  #include 
> > > @@ -481,7 +482,13 @@ static int __devinit s3c_rtc_probe(struct
> > platform_device *pdev)
> > >                goto err_nortc;
> > >        }
> > >
> > > -       s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
> > > +#ifdef CONFIG_OF
> > > +       if (pdev->dev.of_node)
> > > +               s3c_rtc_cpu_type = of_device_is_compatible(pdev-
> > >dev.of_node,
> > > +                       "samsung,s3c6410-rtc") ? TYPE_S3C64XX :
> > TYPE_S3C2410;
> > > +       else
> > > +#endif
> > > +               s3c_rtc_cpu_type =
> platform_get_device_id(pdev)->driver_data;
> > >
> > >        /* Check RTC Time */
> > >
> > > @@ -603,6 +610,17 @@ static int s3c_rtc_resume(struct platform_device
> *pdev)
> > >  #define s3c_rtc_resume  NULL
> > >  #endif
> > >
> > > +#ifdef CONFIG_OF
> > > +static const struct of_device_id s3c_rtc_dt_match[] = {
> > > +   { .compatible = "samsung,s3c2410-rtc" },
>  ^^^
> > > +   { .compatible = "samsung,s3c6410-rtc" },
>  ^^^
> > > +   {},
>  ^^^
> should be Tab?
> 
> > > +};
> > > +MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
> > > +#else
> > > +#define s3c_rtc_dt_match NULL
> > > +#endif
> > > +
> > >  static struct platform_device_id s3c_rtc_driver_ids[] = {
> > >        {
> > >                .name           = "s3c2410-rtc",
> > > @@ -625,6 +643,7 @@ static struct platform_driver s3c_rtc_driver = {
> > >        .driver         = {
> > >                .name   = "s3c-rtc",
> > >                .owner  = THIS_MODULE,
> > > +   .of_match_table = s3c_rtc_dt_match,
>  ^^^
> Same as above...
> 
> But I know, Thomas' original patch has no problem...probably when ping,
> happened above.
> 
> > >        },
> > >  };
> > >
> > > --
> 
> Thanks.
> 
> Best regards,
> Kgene.
> --
> Kukjin Kim , Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
> 
--
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/3] ARM: Exynos4: Add ioremap interceptor for statically remapped regions

2011-10-13 Thread Nicolas Pitre
On Thu, 13 Oct 2011, Thomas Abraham wrote:

> On 12 October 2011 22:00, Thomas Abraham  wrote:
> > On 12 October 2011 21:43, Rob Herring  wrote:
> >> On 10/10/2011 03:11 AM, Thomas Abraham wrote:
> >>> ioremap() request for statically remapped regions are intercepted and the
> >>> statically assigned virtual address is returned. For requests for which
> >>> there are no statically remapped regions, the requests are let through.
> >>>
> >>> Cc: Kukjin Kim 
> >>> Signed-off-by: Thomas Abraham 
> >>> ---
> >>>  arch/arm/mach-exynos4/cpu.c             |   16 
> >>>  arch/arm/mach-exynos4/include/mach/io.h |    4 
> >>>  2 files changed, 20 insertions(+), 0 deletions(-)
> >>>
> >>
> >> You won't need this with Nico's vmalloc.h clean-up series. It does
> >> exactly this but generically for all platforms.
> >
> > Ok. Thanks for your suggestion. I will move to using Nico's patches.
> 
> From Nico's reply to his pull request of vmalloc cleanup series, it
> looks like that pull request has been withdrawn (hope I am not missing
> anything here).

I'm just postponing it because this depends on a large cleanup in the 
OMAP code which is being pushed to mainline for the next merge window.

> Without Nico's series, and gic dt support for exynos4 support 
> requiring this patch, all other workarounds to replace this patch does 
> not seem be correct.
> 
> So is it acceptable to retain this patch and later rework/drop the
> exynos4 specific ioremap along with Nico's vmalloc patch series when
> it is merged.

I would guess so.  But please CC me on those patches so I know what to 
look for when rebasing my series.


Nicolas

Re: [PATCH 5/7] ARM: EXYNOS4: Add support external GIC

2011-10-13 Thread Will Deacon
On Thu, Oct 13, 2011 at 12:09:28PM +0100, Russell King - ARM Linux wrote:
> On Mon, Oct 10, 2011 at 02:02:09PM +0100, Marc Zyngier wrote:
> > On 07/10/11 16:16, Will Deacon wrote:
> > > On Fri, Oct 07, 2011 at 10:44:59AM +0100, Marc Zyngier wrote:
> > >> +static void __cpuinit exynos4_secondary_init(unsigned int cpu)
> > >>  {
> > >>  void __iomem *dist_base = S5P_VA_GIC_DIST +
> > >> -(gic_bank_offset * smp_processor_id());
> > >> +(gic_bank_offset * 
> > >> cpu_logical_map(cpu));
> > > 
> > > Again, I'm deeply suspicious of this code :) Is there not a common memory
> > > alias for the distributor across all of the CPUs?
> > 
> > Kukjin, could you please comment on the presence of a common memory
> > region for the distributor? This seem quite odd...
> 
> It's not odd when you consider that there's per-CPU registers within the
> GIC distributor as well (for the first 32 GIC IRQs) as the per-CPU GIC
> CPU interfaces.

Agreed, but it is odd for those registers not to be banked in hardware. Marc
and I spoke to some of the hardware chaps at ARM and they don't see this as
a common setup in the future, so rather than litter the GIC driver with
__percpu variables, we might be better off adding some extra platform callbacks
to the set that we already have.

Will
--
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: dts: Add intial dts file for Exynos4210 SoC, SMDKV310 and Origen board

2011-10-13 Thread Grant Likely
On Tue, Oct 11, 2011 at 07:43:16PM +0530, Thomas Abraham wrote:
> Add initial dts file for Exynos4210 SoC. This dts file describes the SoC
> specific devices and properties. Along with this, add dts file for Samsung's
> SMDKV310 board and Insignal's Origen board which uses the Exynos4210 dts file
> and extends it to describe the board specific properties.
> 
> Signed-off-by: Thomas Abraham 

Acked-by: Grant Likely 

> ---
>  arch/arm/boot/dts/exynos4210-origen.dts   |  137 ++
>  arch/arm/boot/dts/exynos4210-smdkv310.dts |  182 +
>  arch/arm/boot/dts/exynos4210.dtsi |  403 
> +
>  3 files changed, 722 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/boot/dts/exynos4210-origen.dts
>  create mode 100644 arch/arm/boot/dts/exynos4210-smdkv310.dts
>  create mode 100644 arch/arm/boot/dts/exynos4210.dtsi
> 
> diff --git a/arch/arm/boot/dts/exynos4210-origen.dts 
> b/arch/arm/boot/dts/exynos4210-origen.dts
> new file mode 100644
> index 000..b8c4763
> --- /dev/null
> +++ b/arch/arm/boot/dts/exynos4210-origen.dts
> @@ -0,0 +1,137 @@
> +/*
> + * Samsung's Exynos4210 based Origen board device tree source
> + *
> + * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
> + *   http://www.samsung.com
> + * Copyright (c) 2010-2011 Linaro Ltd.
> + *   www.linaro.org
> + *
> + * Device tree source file for Insignal's Origen board which is based on
> + * Samsung's Exynos4210 SoC.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +/dts-v1/;
> +/include/ "exynos4210.dtsi"
> +
> +/ {
> + model = "Insignal Origen evaluation board based on Exynos4210";
> + compatible = "insignal,origen", "samsung,exynos4210";
> +
> + memory {
> + reg = <0x4000 0x4000>;
> + };
> +
> + chosen {
> + bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x4100,8M 
> console=ttySAC2,115200 init=/linuxrc";
> + };
> +
> + sdhci@1253 {
> + samsung,sdhci-bus-width = <4>;
> + linux,mmc_cap_4_bit_data;
> + samsung,sdhci-cd-internal;
> + gpio-cd = <&gpk2 2 2 3 3>;
> + gpios = <&gpk2 0 2 0 3>,
> + <&gpk2 1 2 0 3>,
> + <&gpk2 3 2 3 3>,
> + <&gpk2 4 2 3 3>,
> + <&gpk2 5 2 3 3>,
> + <&gpk2 6 2 3 3>;
> + };
> +
> + sdhci@1251 {
> + samsung,sdhci-bus-width = <4>;
> + linux,mmc_cap_4_bit_data;
> + samsung,sdhci-cd-internal;
> + gpio-cd = <&gpk0 2 2 3 3>;
> + gpios = <&gpk0 0 2 0 3>,
> + <&gpk0 1 2 0 3>,
> + <&gpk0 3 2 3 3>,
> + <&gpk0 4 2 3 3>,
> + <&gpk0 5 2 3 3>,
> + <&gpk0 6 2 3 3>;
> + };
> +
> + gpio_keys {
> + compatible = "gpio-keys";
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + up {
> + label = "Up";
> + gpios = <&gpx2 0 0 0 2>;
> + linux,code = <103>;
> + };
> +
> + down {
> + label = "Down";
> + gpios = <&gpx2 1 0 0 2>;
> + linux,code = <108>;
> + };
> +
> + back {
> + label = "Back";
> + gpios = <&gpx1 7 0 0 2>;
> + linux,code = <158>;
> + };
> +
> + home {
> + label = "Home";
> + gpios = <&gpx1 6 0 0 2>;
> + linux,code = <102>;
> + };
> +
> + menu {
> + label = "Menu";
> + gpios = <&gpx1 5 0 0 2>;
> + linux,code = <139>;
> + };
> + };
> +
> + keypad@100A {
> + status = "disabled";
> + };
> +
> + sdhci@1252 {
> + status = "disabled";
> + };
> +
> + sdhci@1254 {
> + status = "disabled";
> + };
> +
> + i2c@1386 {
> + status = "disabled";
> + };
> +
> + i2c@1387 {
> + status = "disabled";
> + };
> +
> + i2c@1388 {
> + status = "disabled";
> + };
> +
> + i2c@1389 {
> + status = "disabled";
> + };
> +
> + i2c@138A {
> + status = "disabled";
> + };
> +
> + i2c@138B {
> + status = "disabled";
> + };
> +
> + i2c@138C {
> + status = "disabled";
> + };
> +
> + i2c@138D {
> + status = "disabled";
> + };
> +};
> diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts 
> b/arch/arm/boot/dts/exynos4210-

Re: [PATCH 1/2] ARM: Samsung: Add Exynos4 device tree enabled board file

2011-10-13 Thread Grant Likely
On Tue, Oct 11, 2011 at 07:43:15PM +0530, Thomas Abraham wrote:
> Add a new Exynos4 compatible device tree enabled board file. Boards based on
> the Exynos4 family of SoC's can use this as the machine/board file. When using
> this machine fike, a corresponding device tree blob which describes the 
> board's
> properties should be supplied at boot time to the kernel.
> 
> Signed-off-by: Thomas Abraham 

Acked-by: Grant Likely 

> ---
>  .../devicetree/bindings/arm/insignal-boards.txt|8 ++
>  .../devicetree/bindings/arm/samsung-boards.txt |8 ++
>  arch/arm/mach-exynos4/Kconfig  |   14 +++
>  arch/arm/mach-exynos4/Makefile |2 +
>  arch/arm/mach-exynos4/mach-exynos4-dt.c|   85 
> 
>  5 files changed, 117 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/arm/insignal-boards.txt
>  create mode 100644 Documentation/devicetree/bindings/arm/samsung-boards.txt
>  create mode 100644 arch/arm/mach-exynos4/mach-exynos4-dt.c
> 
> diff --git a/Documentation/devicetree/bindings/arm/insignal-boards.txt 
> b/Documentation/devicetree/bindings/arm/insignal-boards.txt
> new file mode 100644
> index 000..524c3dc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/insignal-boards.txt
> @@ -0,0 +1,8 @@
> +* Insignal's Exynos4210 based Origen evaluation board
> +
> +Origen low-cost evaluation board is based on Samsung's Exynos4210 SoC.
> +
> +Required root node properties:
> +- compatible = should be one or more of the following.
> +(a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board.
> +(b) "samsung,exynos4210"  - for boards based on Exynos4210 SoC.
> diff --git a/Documentation/devicetree/bindings/arm/samsung-boards.txt 
> b/Documentation/devicetree/bindings/arm/samsung-boards.txt
> new file mode 100644
> index 000..0bf68be
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/samsung-boards.txt
> @@ -0,0 +1,8 @@
> +* Samsung's Exynos4210 based SMDKV310 evaluation board
> +
> +SMDKV310 evaluation board is based on Samsung's Exynos4210 SoC.
> +
> +Required root node properties:
> +- compatible = should be one or more of the following.
> +(a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board.
> +(b) "samsung,exynos4210"  - for boards based on Exynos4210 SoC.
> diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
> index 0c5888a..39dc135 100644
> --- a/arch/arm/mach-exynos4/Kconfig
> +++ b/arch/arm/mach-exynos4/Kconfig
> @@ -304,6 +304,20 @@ config MACH_SMDK4412
>   help
> Machine support for Samsung SMDK4412
>  
> +comment "Flattened Device Tree based board for Exynos4 based SoC"
> +
> +config MACH_EXYNOS4_DT
> + bool "Samsung Exynos4 Machine using device tree"
> + select CPU_EXYNOS4210
> + select USE_OF
> + select ARM_AMBA
> + select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
> + help
> +   Machine support for Samsung Exynos4 machine with device tree enabled.
> +   Select this if a fdt blob is available for the Exynos4 SoC based 
> board.
> +   Note: This is under development and not all peripherals can be 
> supported
> +   with this machine file.
> +
>  endmenu
>  
>  comment "Configuration for HSMMC bus width"
> diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile
> index 8066538..4e302cb 100644
> --- a/arch/arm/mach-exynos4/Makefile
> +++ b/arch/arm/mach-exynos4/Makefile
> @@ -37,6 +37,8 @@ obj-$(CONFIG_MACH_ORIGEN)   += mach-origen.o
>  obj-$(CONFIG_MACH_SMDK4212)  += mach-smdk4x12.o
>  obj-$(CONFIG_MACH_SMDK4412)  += mach-smdk4x12.o
>  
> +obj-$(CONFIG_MACH_EXYNOS4_DT)+= mach-exynos4-dt.o
> +
>  # device support
>  
>  obj-y+= dev-audio.o
> diff --git a/arch/arm/mach-exynos4/mach-exynos4-dt.c 
> b/arch/arm/mach-exynos4/mach-exynos4-dt.c
> new file mode 100644
> index 000..85fa027
> --- /dev/null
> +++ b/arch/arm/mach-exynos4/mach-exynos4-dt.c
> @@ -0,0 +1,85 @@
> +/*
> + * Samsung's Exynos4210 flattened device tree enabled machine
> + *
> + * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
> + *   http://www.samsung.com
> + * Copyright (c) 2010-2011 Linaro Ltd.
> + *   www.linaro.org
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +
> +/*
> + * The following lookup table is used to override device names when devices
> + * are registered from device tree. This is temporarily added to enable
> + * device tree support addition for the Exynos4 architecture.
> + *
> + * For drivers that require platform data to be provided from the machine
> + * file, a platform data point

Re: [PATCH 5/7] ARM: EXYNOS4: Add support external GIC

2011-10-13 Thread Russell King - ARM Linux
On Mon, Oct 10, 2011 at 02:02:09PM +0100, Marc Zyngier wrote:
> On 07/10/11 16:16, Will Deacon wrote:
> > On Fri, Oct 07, 2011 at 10:44:59AM +0100, Marc Zyngier wrote:
> >> +static void __cpuinit exynos4_secondary_init(unsigned int cpu)
> >>  {
> >>void __iomem *dist_base = S5P_VA_GIC_DIST +
> >> -  (gic_bank_offset * smp_processor_id());
> >> +  (gic_bank_offset * cpu_logical_map(cpu));
> > 
> > Again, I'm deeply suspicious of this code :) Is there not a common memory
> > alias for the distributor across all of the CPUs?
> 
> Kukjin, could you please comment on the presence of a common memory
> region for the distributor? This seem quite odd...

It's not odd when you consider that there's per-CPU registers within the
GIC distributor as well (for the first 32 GIC IRQs) as the per-CPU GIC
CPU interfaces.
--
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: [RESEND][PATCH V2 1/2] ARM: CLKDEV: Add Common Macro for clk_lookup

2011-10-13 Thread Russell King - ARM Linux
On Tue, Oct 11, 2011 at 05:15:29PM +0530, Padmavathi Venna wrote:
> From: Padmavathi Venna  
> 
> Added a standardized macro CLKDEV_INIT which can used across all
> the platforms to support clkdev
> 
> Suggested by: Russell King 

Should be Suggested-by: (with a '-' rather than a ' ').

Other than that, it's fine.  Please submit to the patch system, thanks.
--
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: [RESEND][PATCH V2 0/2] Add a common macro for creating struct clk_lookup entries

2011-10-13 Thread Russell King - ARM Linux
On Tue, Oct 11, 2011 at 08:56:23PM +0900, Kukjin Kim wrote:
> Russell,
> Maybe as you know, this is required on upcoming Samsung stuff. Actually it's
> just change/consolidate on other stuff but add on Samsung stuff. So if
> you're ok, how about sending this to upstream via arm-soc or your tree in
> this merge window?

I think taking the first patch is the right thing before the merge
window opens, because that's the one which everything else will depend
upon.

The second patch probably needs splitting up between the various SoCs
and either submitted to their maintainers or to Arnd after the merge
window has closed.

I suspect that we're looking at one of:
a) a matter of days to the merge window opening - though the timing of
   it (9 days before the kernel summit) doesn't look good, unless it's
   going to be a short window.
b) -rc9 will persist for the next fortnight
c) we'll see the first 3.x-rc10 kernel.
--
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/2] ARM: EXYNOS4: Add SPI support

2011-10-13 Thread Russell King - ARM Linux
On Mon, Oct 10, 2011 at 01:38:04PM +0530, Padmavathi Venna wrote:
> +void __init exynos4_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
> +{
> + struct s3c64xx_spi_info *pd;
> +
> + /* Reject invalid configuration */
> + if (!num_cs || src_clk_nr < 0
> + || src_clk_nr > EXYNOS4_SPI_SRCCLK_SCLK) {
> + printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);

Let's start using pr_err() rather than printk(KERN_ERR...) in ARM code
please.
--
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 V4 3/3] ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

2011-10-13 Thread Sylwester Nawrocki
On 10/13/2011 10:55 AM, Russell King - ARM Linux wrote:
> On Thu, Oct 13, 2011 at 09:55:04AM +0200, Sylwester Nawrocki wrote:
>> Yes, it allowed to add clkdev support with minimal changes required.
>>
>> But let's see what happens when the works on common struct clk for all
>> architectures are more or less completed and we convert Samsung platforms
>> to use it;)
> 
> The common struct clk shouldn't have much to do with the clkdev part of
> it - clkdev just provides a method to associate a struct clk with the
> drivers request.  The common struct clk doesn't change that.

Indeed. I was just wondering where we end up with the arch struct clk attribute
which is specific to clkdev processes.
It could just go into the hardware-specific data, although it doesn't sound
like a perfectly right approach.
--
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 V4 3/3] ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

2011-10-13 Thread Russell King - ARM Linux
On Thu, Oct 13, 2011 at 09:55:04AM +0200, Sylwester Nawrocki wrote:
> Yes, it allowed to add clkdev support with minimal changes required.
> 
> But let's see what happens when the works on common struct clk for all
> architectures are more or less completed and we convert Samsung platforms
> to use it;)

The common struct clk shouldn't have much to do with the clkdev part of
it - clkdev just provides a method to associate a struct clk with the
drivers request.  The common struct clk doesn't change that.
--
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 V5 3/3] ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

2011-10-13 Thread Rajeshwari Shinde
Add support for lookup of sdhci-s3c controller clocks using generic names
for s3c2416, s3c64xx, s5pc100, s5pv210 and exynos4 SoC's.

Signed-off-by: Rajeshwari Shinde 
---
 arch/arm/mach-exynos4/clock.c |   88 ++---
 arch/arm/mach-s3c2416/clock.c |   68 +++--
 arch/arm/mach-s3c64xx/clock.c |  126 +++--
 arch/arm/mach-s5pc100/clock.c |  130 --
 arch/arm/mach-s5pv210/clock.c |  167 -
 arch/arm/plat-s3c24xx/s3c2443-clock.c |   15 ++-
 6 files changed, 359 insertions(+), 235 deletions(-)

diff --git a/arch/arm/mach-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c
index 9f50e33..8bc7534 100644
--- a/arch/arm/mach-exynos4/clock.c
+++ b/arch/arm/mach-exynos4/clock.c
@@ -1157,42 +1157,6 @@ static struct clksrc_clk clksrcs[] = {
.reg_div = { .reg = S5P_CLKDIV_MFC, .shift = 0, .size = 4 },
}, {
.clk= {
-   .name   = "sclk_mmc",
-   .devname= "s3c-sdhci.0",
-   .parent = &clk_dout_mmc0.clk,
-   .enable = exynos4_clksrc_mask_fsys_ctrl,
-   .ctrlbit= (1 << 0),
-   },
-   .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
-   }, {
-   .clk= {
-   .name   = "sclk_mmc",
-   .devname= "s3c-sdhci.1",
-   .parent = &clk_dout_mmc1.clk,
-   .enable = exynos4_clksrc_mask_fsys_ctrl,
-   .ctrlbit= (1 << 4),
-   },
-   .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
-   }, {
-   .clk= {
-   .name   = "sclk_mmc",
-   .devname= "s3c-sdhci.2",
-   .parent = &clk_dout_mmc2.clk,
-   .enable = exynos4_clksrc_mask_fsys_ctrl,
-   .ctrlbit= (1 << 8),
-   },
-   .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
-   }, {
-   .clk= {
-   .name   = "sclk_mmc",
-   .devname= "s3c-sdhci.3",
-   .parent = &clk_dout_mmc3.clk,
-   .enable = exynos4_clksrc_mask_fsys_ctrl,
-   .ctrlbit= (1 << 12),
-   },
-   .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
-   }, {
-   .clk= {
.name   = "sclk_dwmmc",
.parent = &clk_dout_mmc4.clk,
.enable = exynos4_clksrc_mask_fsys_ctrl,
@@ -1250,6 +1214,50 @@ static struct clksrc_clk clk_sclk_uart3 = {
.reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 12, .size = 4 },
 };
 
+static struct clksrc_clk clk_sclk_mmc0 = {
+   .clk= {
+   .name   = "sclk_mmc",
+   .devname= "s3c-sdhci.0",
+   .parent = &clk_dout_mmc0.clk,
+   .enable = exynos4_clksrc_mask_fsys_ctrl,
+   .ctrlbit= (1 << 0),
+   },
+   .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc1 = {
+   .clk= {
+   .name   = "sclk_mmc",
+   .devname= "s3c-sdhci.1",
+   .parent = &clk_dout_mmc1.clk,
+   .enable = exynos4_clksrc_mask_fsys_ctrl,
+   .ctrlbit= (1 << 4),
+   },
+   .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc2 = {
+   .clk= {
+   .name   = "sclk_mmc",
+   .devname= "s3c-sdhci.2",
+   .parent = &clk_dout_mmc2.clk,
+   .enable = exynos4_clksrc_mask_fsys_ctrl,
+   .ctrlbit= (1 << 8),
+   },
+   .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc3 = {
+   .clk= {
+   .name   = "sclk_mmc",
+   .devname= "s3c-sdhci.3",
+   .parent = &clk_dout_mmc3.clk,
+   .enable = exynos4_clksrc_mask_fsys_ctrl,
+   .ctrlbit= (1 << 12),
+   },
+   .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
+};
+
 /* Clock initialization code */
 static struct clksrc_clk *sysclks[] = {
&clk_mout_apll,
@@ -1289,6 +1297,10 @@ static struct clksrc_clk *clksrc_cdev[] = {
&clk_sclk_uart1,
&clk_sclk_uart2,

[PATCH V4 2/3] ARM: SAMSUNG: Remove SDHCI bus clocks from platform data

2011-10-13 Thread Rajeshwari Shinde
The bus clocks previously sent through platform data to SDHCI controller
are removed.

Signed-off-by: Rajeshwari Shinde 
---
 arch/arm/mach-exynos4/Makefile |1 -
 arch/arm/mach-exynos4/setup-sdhci.c|   22 ---
 arch/arm/mach-s3c2416/Makefile |1 -
 arch/arm/mach-s3c2416/setup-sdhci.c|   24 -
 arch/arm/mach-s3c64xx/Makefile |1 -
 arch/arm/mach-s3c64xx/setup-sdhci.c|   24 -
 arch/arm/mach-s5pc100/Makefile |1 -
 arch/arm/mach-s5pc100/setup-sdhci.c|   23 
 arch/arm/mach-s5pv210/Makefile |1 -
 arch/arm/mach-s5pv210/setup-sdhci.c|   22 ---
 arch/arm/plat-samsung/include/plat/sdhci.h |   31 
 11 files changed, 0 insertions(+), 151 deletions(-)
 delete mode 100644 arch/arm/mach-exynos4/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s3c2416/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s3c64xx/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s5pc100/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s5pv210/setup-sdhci.c

diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile
index 2bb18f4..c47aae3 100644
--- a/arch/arm/mach-exynos4/Makefile
+++ b/arch/arm/mach-exynos4/Makefile
@@ -55,7 +55,6 @@ obj-$(CONFIG_EXYNOS4_SETUP_I2C5)  += setup-i2c5.o
 obj-$(CONFIG_EXYNOS4_SETUP_I2C6)   += setup-i2c6.o
 obj-$(CONFIG_EXYNOS4_SETUP_I2C7)   += setup-i2c7.o
 obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD) += setup-keypad.o
-obj-$(CONFIG_EXYNOS4_SETUP_SDHCI)  += setup-sdhci.o
 obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
 
 obj-$(CONFIG_EXYNOS4_SETUP_USB_PHY)+= setup-usb-phy.o
diff --git a/arch/arm/mach-exynos4/setup-sdhci.c 
b/arch/arm/mach-exynos4/setup-sdhci.c
deleted file mode 100644
index 92937b4..000
--- a/arch/arm/mach-exynos4/setup-sdhci.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* linux/arch/arm/mach-exynos4/setup-sdhci.c
- *
- * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
- * http://www.samsung.com
- *
- * EXYNOS4 - Helper functions for settign up SDHCI device(s) (HSMMC)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include 
-
-/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
-
-char *exynos4_hsmmc_clksrcs[4] = {
-   [0] = NULL,
-   [1] = NULL,
-   [2] = "sclk_mmc",   /* mmc_bus */
-   [3] = NULL,
-};
diff --git a/arch/arm/mach-s3c2416/Makefile b/arch/arm/mach-s3c2416/Makefile
index 7b805b2..ca0cd22 100644
--- a/arch/arm/mach-s3c2416/Makefile
+++ b/arch/arm/mach-s3c2416/Makefile
@@ -15,7 +15,6 @@ obj-$(CONFIG_S3C2416_PM)  += pm.o
 #obj-$(CONFIG_S3C2416_DMA) += dma.o
 
 # Device setup
-obj-$(CONFIG_S3C2416_SETUP_SDHCI) += setup-sdhci.o
 obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
 
 # Machine support
diff --git a/arch/arm/mach-s3c2416/setup-sdhci.c 
b/arch/arm/mach-s3c2416/setup-sdhci.c
deleted file mode 100644
index cee5395..000
--- a/arch/arm/mach-s3c2416/setup-sdhci.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* linux/arch/arm/mach-s3c2416/setup-sdhci.c
- *
- * Copyright 2010 Promwad Innovation Company
- * Yauhen Kharuzhy 
- *
- * S3C2416 - Helper functions for settign up SDHCI device(s) (HSMMC)
- *
- * Based on mach-s3c64xx/setup-sdhci.c
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include 
-
-/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
-
-char *s3c2416_hsmmc_clksrcs[4] = {
-   [0] = "hsmmc",
-   [1] = "hsmmc",
-   [2] = "hsmmc-if",
-   /* [3] = "48m", - note not successfully used yet */
-};
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index 902ab9a..94de24b 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -32,7 +32,6 @@ obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o
 obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o
 obj-$(CONFIG_S3C64XX_SETUP_IDE) += setup-ide.o
 obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad.o
-obj-$(CONFIG_S3C64XX_SETUP_SDHCI) += setup-sdhci.o
 obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
 obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
 
diff --git a/arch/arm/mach-s3c64xx/setup-sdhci.c 
b/arch/arm/mach-s3c64xx/setup-sdhci.c
deleted file mode 100644
index c75a71b..000
--- a/arch/arm/mach-s3c64xx/setup-sdhci.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* linux/arch/arm/mach-s3c64xx/setup-sdhci.c
- *
- * Copyright 2008 Simtec Electronics
- * Copyright 2008 Simtec Electronics
- * Ben Dooks 
- * http://armlinux.simtec.co.uk/
- *
- * S3C6400/S3C6410 - Helper functions for settign up SDHCI

[PATCH V4 1/3] SDHCI: S3C: Use generic clock names for sdhci bus clock options

2011-10-13 Thread Rajeshwari Shinde
This patch modifies the driver to stop depending on the clock names
being passed from the platform and switch over to bus clock lookup
using generic clock names.

Signed-off-by: Rajeshwari Shinde 
---
 drivers/mmc/host/sdhci-s3c.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 82709b6..a5fde87 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -435,14 +435,12 @@ static int __devinit sdhci_s3c_probe(struct 
platform_device *pdev)
 
for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
struct clk *clk;
-   char *name = pdata->clocks[ptr];
+   char name[14];
 
-   if (name == NULL)
-   continue;
+   sprintf(name, "mmc_busclk.%d", ptr);
 
clk = clk_get(dev, name);
if (IS_ERR(clk)) {
-   dev_err(dev, "failed to get clock %s\n", name);
continue;
}
 
-- 
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 V4 0/3] ARM: SAMSUNG: Add support for sdhci clock lookup using generic names

2011-10-13 Thread Rajeshwari Shinde
This patchset adds support for sdhci controller clock lookup using
generic names. With this patchset, there will be no need to pass clock
names in sdhci platform data.

This patchset depends on the patchset:
Add a common macro for creating struct clk_lookup entries.
mmc: sdhci-s3c: add default controller configuration.

V2 Changes:
- Added HCLK instance for HSMMC instance 1 as suggested by Heiko.
- Rebased on UART clkdev patches. So these patches should be applied
  after UART clkdev patches are applied.

V3 Changes:
- Removed double registration of hsmmc1 hclk from s3c2416 as suggested by
  Heiko

V4 Changes:
- Changed the devname for bus clocks in Exynos4 to s3c-sdhci. from 
  exynos4-sdhci. as suggested by Sylwester.

Rajeshwari Shinde (3):
  SDHCI: S3C: Use generic clock names for sdhci bus clock options
  ARM: SAMSUNG: Remove SDHCI bus clocks from platform data
  ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

 arch/arm/mach-exynos4/Makefile |1 -
 arch/arm/mach-exynos4/clock.c  |   88 +--
 arch/arm/mach-exynos4/setup-sdhci.c|   22 
 arch/arm/mach-s3c2416/Makefile |1 -
 arch/arm/mach-s3c2416/clock.c  |   68 ++-
 arch/arm/mach-s3c2416/setup-sdhci.c|   24 
 arch/arm/mach-s3c64xx/Makefile |1 -
 arch/arm/mach-s3c64xx/clock.c  |  126 +
 arch/arm/mach-s3c64xx/setup-sdhci.c|   24 
 arch/arm/mach-s5pc100/Makefile |1 -
 arch/arm/mach-s5pc100/clock.c  |  130 +-
 arch/arm/mach-s5pc100/setup-sdhci.c|   23 
 arch/arm/mach-s5pv210/Makefile |1 -
 arch/arm/mach-s5pv210/clock.c  |  167 +---
 arch/arm/mach-s5pv210/setup-sdhci.c|   22 
 arch/arm/plat-s3c24xx/s3c2443-clock.c  |   15 ++-
 arch/arm/plat-samsung/include/plat/sdhci.h |   31 -
 drivers/mmc/host/sdhci-s3c.c   |6 +-
 18 files changed, 361 insertions(+), 390 deletions(-)
 delete mode 100644 arch/arm/mach-exynos4/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s3c2416/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s3c64xx/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s5pc100/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s5pv210/setup-sdhci.c

-- 
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 v5 2/2] iommu/exynos: Add iommu driver for Exynos Platforms

2011-10-13 Thread KyongHo Cho
This is the exactly same patch with the previous
"[PATCH v5 2/2] iommu/exynos: Add iommu driver for Exynos Platforms".

The only change from the previous one is to change Sylwester's
email address in the Cc list by his request.

Regards,

KyongHo.

commit e1ad653521025dec5888b9818ed1a96aa9a5ad3a
Author: KyongHo Cho 
Date:   Thu Oct 13 17:06:55 2011 +0900

This is the System MMU driver and IOMMU API implementation for
Exynos SOC platforms. Exynos platforms has more than 10 System
MMUs dedicated for each multimedia accellerators.

The System MMU driver is already in arc/arm/plat-s5p but it is
moved to drivers/iommu due to Ohad Ben-Cohen gathered IOMMU drivers
there

This patch also includes fault handling feature in IOMMU driver
suggested by Ohad.
Users of IOMMU API can register its own fault handler with
iommu_set_fault_handler() and the handler is called by IRQ handler
of System MMU.
If no user installs fault handler, IOMMU driver prints debugging
message and generates kernel oops.

This IOMMU driver calls bus_set_iommu() instead of register_iommu()
since Joerg suggested that installing iommu_ops in bus_type.

Cc: Joerg Roedel 
Cc: Ohad Ben-Cohen 
Cc: Sylwester Nawrocki 
Cc: Russell King 
Signed-off-by: KyongHo Cho 
---
 arch/arm/plat-s5p/Kconfig   |8 -
 arch/arm/plat-s5p/Makefile  |1 -
 arch/arm/plat-s5p/sysmmu.c  |  312 -
 arch/arm/plat-samsung/include/plat/sysmmu.h |   95 ---
 drivers/iommu/Kconfig   |   14 +
 drivers/iommu/Makefile  |1 +
 drivers/iommu/exynos_iommu.c|  962
+++
 7 files changed, 977 insertions(+), 416 deletions(-)
 delete mode 100644 arch/arm/plat-s5p/sysmmu.c
 delete mode 100644 arch/arm/plat-samsung/include/plat/sysmmu.h
 create mode 100644 drivers/iommu/exynos_iommu.c

diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
index 7b9dada..831e45b 100644
--- a/arch/arm/plat-s5p/Kconfig
+++ b/arch/arm/plat-s5p/Kconfig
@@ -46,14 +46,6 @@ config S5P_PM
  Common code for power management support on S5P and newer SoCs
  Note: Do not select this for S5P6440 and S5P6450.
 
-comment "System MMU"
-
-config S5P_SYSTEM_MMU
-   bool "S5P SYSTEM MMU"
-   depends on ARCH_EXYNOS4
-   help
- Say Y here if you want to enable System MMU
-
 config S5P_SLEEP
bool
help
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
index 06401dc..7a9c4fc 100644
--- a/arch/arm/plat-s5p/Makefile
+++ b/arch/arm/plat-s5p/Makefile
@@ -19,7 +19,6 @@ obj-y += clock.o
 obj-y  += irq.o
 obj-$(CONFIG_S5P_EXT_INT)  += irq-eint.o
 obj-$(CONFIG_S5P_GPIO_INT) += irq-gpioint.o
-obj-$(CONFIG_S5P_SYSTEM_MMU)   += sysmmu.o
 obj-$(CONFIG_S5P_PM)   += pm.o irq-pm.o
 obj-$(CONFIG_S5P_SLEEP)+= sleep.o
 obj-$(CONFIG_S5P_HRT)  += s5p-time.o
diff --git a/arch/arm/plat-s5p/sysmmu.c b/arch/arm/plat-s5p/sysmmu.c
deleted file mode 100644
index e1cbc72..000
--- a/arch/arm/plat-s5p/sysmmu.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/* linux/arch/arm/plat-s5p/sysmmu.c
- *
- * Copyright (c) 2010 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.
- */
-
-#include 
-#include 
-#include 
-
-#include 
-
-#include 
-#include 
-#include 
-
-#define CTRL_ENABLE0x5
-#define CTRL_BLOCK 0x7
-#define CTRL_DISABLE   0x0
-
-static struct device *dev;
-
-static unsigned short fault_reg_offset[SYSMMU_FAULTS_NUM] = {
-   S5P_PAGE_FAULT_ADDR,
-   S5P_AR_FAULT_ADDR,
-   S5P_AW_FAULT_ADDR,
-   S5P_DEFAULT_SLAVE_ADDR,
-   S5P_AR_FAULT_ADDR,
-   S5P_AR_FAULT_ADDR,
-   S5P_AW_FAULT_ADDR,
-   S5P_AW_FAULT_ADDR
-};
-
-static char *sysmmu_fault_name[SYSMMU_FAULTS_NUM] = {
-   "PAGE FAULT",
-   "AR MULTI-HIT FAULT",
-   "AW MULTI-HIT FAULT",
-   "BUS ERROR",
-   "AR SECURITY PROTECTION FAULT",
-   "AR ACCESS PROTECTION FAULT",
-   "AW SECURITY PROTECTION FAULT",
-   "AW ACCESS PROTECTION FAULT"
-};
-
-static int (*fault_handlers[S5P_SYSMMU_TOTAL_IPNUM])(
-   enum S5P_SYSMMU_INTERRUPT_TYPE itype,
-   unsigned long pgtable_base,
-   unsigned long fault_addr);
-
-/*
- * If adjacent 2 bits are true, the system MMU is enabled.
- * The system MMU is disabled, otherwise.
- */
-static unsigned long sysmmu_states;
-
-static inline void set_sysmmu_active(sysmmu_ips ips)
-{
-   sysmmu_states |= 3 << (ips * 2);
-}
-
-static inline void set_sysmmu_inactive(sysmmu_ips ips)
-{
-   sysmmu_states &= ~(3 << (ips * 2));
-}
-
-static inline int is_sysmmu_active(sysmmu_ips ips)
-{
-   return sysmmu_states & (3 << (ips * 2));
-}
-
-static void __iomem *sysmmusfrs[S5

Re: [PATCH V4 3/3] ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

2011-10-13 Thread Sylwester Nawrocki
On 10/13/2011 09:16 AM, Rajeshwari Birje wrote:
> On Wed, Oct 12, 2011 at 9:49 PM, Sylwester Nawrocki
>  wrote:
>> On 10/12/2011 02:36 PM, Rajeshwari Birje wrote:
>>> On Wed, Oct 12, 2011 at 3:54 PM, Sylwester Nawrocki
>>>  wrote:
 Hi Rajeshwari,

 On 10/12/2011 11:43 AM, Rajeshwari Shinde wrote:
> Add support for lookup of sdhci-s3c controller clocks using generic names
> for s3c2416, s3c64xx, s5pc100, s5pv210 and exynos4 SoC's.
>
> Signed-off-by: Rajeshwari Shinde 
> ---
>  arch/arm/mach-exynos4/clock.c |   88 ++---
>  arch/arm/mach-s3c2416/clock.c |   68 +++--
>  arch/arm/mach-s3c64xx/clock.c |  126 +++--
>  arch/arm/mach-s5pc100/clock.c |  130 --
>  arch/arm/mach-s5pv210/clock.c |  167 
> -
>  arch/arm/plat-s3c24xx/s3c2443-clock.c |   15 ++-
>  6 files changed, 359 insertions(+), 235 deletions(-)
>
> diff --git a/arch/arm/mach-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c
> index 9f50e33..c6383b9 100644
> --- a/arch/arm/mach-exynos4/clock.c
> +++ b/arch/arm/mach-exynos4/clock.c
> @@ -1157,42 +1157,6 @@ static struct clksrc_clk clksrcs[] = {
>   .reg_div = { .reg = S5P_CLKDIV_MFC, .shift = 0, .size = 4 },
>> ...
> +static struct clksrc_clk clk_sclk_mmc0 = {
> + .clk= {
> + .name   = "sclk_mmc",
> + .devname= "s3c-sdhci.0",

 Would it make sense to drop this 'devname' field here and others
 until sclk_mmc3 
>>>
>>> *** The devname here distinguishes these clocks. So it should be okay
>>> to have a devname for these clocks.
>>
>> I'm not sure what's Mr Kukjin's opinion on that, but I personally would 
>> really
>> like to see all the devname fields disappear from samsung clk data 
>> structures.
>> Possibly if all involved people would keep that in mind we could achieve this
>> over time.
> 
> 
>  Devname field is still required for clocks like hsmmc for driver
> to work fine. Hence it would be tough to remove the devname
> completely.

Yes, it allowed to add clkdev support with minimal changes required.

But let's see what happens when the works on common struct clk for all
architectures are more or less completed and we convert Samsung platforms
to use it;)

Regards,
-- 
Sylwester Nawrocki
Samsung Poland R&D Center
--
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 V4 3/3] ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

2011-10-13 Thread Rajeshwari Birje
Hi Sylwester,

On Wed, Oct 12, 2011 at 9:49 PM, Sylwester Nawrocki
 wrote:
> On 10/12/2011 02:36 PM, Rajeshwari Birje wrote:
>> On Wed, Oct 12, 2011 at 3:54 PM, Sylwester Nawrocki
>>  wrote:
>>> Hi Rajeshwari,
>>>
>>> On 10/12/2011 11:43 AM, Rajeshwari Shinde wrote:
 Add support for lookup of sdhci-s3c controller clocks using generic names
 for s3c2416, s3c64xx, s5pc100, s5pv210 and exynos4 SoC's.

 Signed-off-by: Rajeshwari Shinde 
 ---
  arch/arm/mach-exynos4/clock.c         |   88 ++---
  arch/arm/mach-s3c2416/clock.c         |   68 +++--
  arch/arm/mach-s3c64xx/clock.c         |  126 +++--
  arch/arm/mach-s5pc100/clock.c         |  130 --
  arch/arm/mach-s5pv210/clock.c         |  167 
 -
  arch/arm/plat-s3c24xx/s3c2443-clock.c |   15 ++-
  6 files changed, 359 insertions(+), 235 deletions(-)

 diff --git a/arch/arm/mach-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c
 index 9f50e33..c6383b9 100644
 --- a/arch/arm/mach-exynos4/clock.c
 +++ b/arch/arm/mach-exynos4/clock.c
 @@ -1157,42 +1157,6 @@ static struct clksrc_clk clksrcs[] = {
               .reg_div = { .reg = S5P_CLKDIV_MFC, .shift = 0, .size = 4 },
> ...
 +static struct clksrc_clk clk_sclk_mmc0 = {
 +     .clk            = {
 +             .name           = "sclk_mmc",
 +             .devname        = "s3c-sdhci.0",
>>>
>>> Would it make sense to drop this 'devname' field here and others
>>> until sclk_mmc3 
>>
>> *** The devname here distinguishes these clocks. So it should be okay
>> to have a devname for these clocks.
>
> I'm not sure what's Mr Kukjin's opinion on that, but I personally would really
> like to see all the devname fields disappear from samsung clk data structures.
> Possibly if all involved people would keep that in mind we could achieve this
> over time.


 Devname field is still required for clocks like hsmmc for driver
to work fine. Hence it would be tough to remove the devname
completely.

>
>>
>>>
 +             .parent         = &clk_dout_mmc0.clk,
 +             .enable         = exynos4_clksrc_mask_fsys_ctrl,
 +             .ctrlbit        = (1 << 0),
 +     },
 +     .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
 +};
 +
 +static struct clksrc_clk clk_sclk_mmc1 = {
 +     .clk            = {
 +             .name           = "sclk_mmc",
 +             .devname        = "s3c-sdhci.1",
>>>
 +             .parent         = &clk_dout_mmc1.clk,
 +             .enable         = exynos4_clksrc_mask_fsys_ctrl,
 +             .ctrlbit        = (1 << 4),
 +     },
 +     .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
 +};
 +
 +static struct clksrc_clk clk_sclk_mmc2 = {
 +     .clk            = {
 +             .name           = "sclk_mmc",
 +             .devname        = "s3c-sdhci.2",
>>>
 +             .parent         = &clk_dout_mmc2.clk,
 +             .enable         = exynos4_clksrc_mask_fsys_ctrl,
 +             .ctrlbit        = (1 << 8),
 +     },
 +     .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
 +};
 +
 +static struct clksrc_clk clk_sclk_mmc3 = {
 +     .clk            = {
 +             .name           = "sclk_mmc",
 +             .devname        = "s3c-sdhci.3",
>>>
 +             .parent         = &clk_dout_mmc3.clk,
 +             .enable         = exynos4_clksrc_mask_fsys_ctrl,
 +             .ctrlbit        = (1 << 12),
 +     },
 +     .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
 +};
 +
  /* Clock initialization code */
  static struct clksrc_clk *sysclks[] = {
       &clk_mout_apll,
 @@ -1289,6 +1297,10 @@ static struct clksrc_clk *clksrc_cdev[] = {
       &clk_sclk_uart1,
       &clk_sclk_uart2,
       &clk_sclk_uart3,
 +     &clk_sclk_mmc0,
 +     &clk_sclk_mmc1,
 +     &clk_sclk_mmc2,
 +     &clk_sclk_mmc3,
>>>
>>> ..then drop the above 4 lines...
>>
>>  The registration for these clocks are important. The
>> s3c_register_clksrc() function sets the .ops of this clock and also
>> its parent. So the registration cannot be dropped.
>
> OK.
>
>>
>>>
  };

  static struct clk_lookup exynos4_clk_lookup[] = {
 @@ -1296,6 +1308,10 @@ static struct clk_lookup exynos4_clk_lookup[] = {
       CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", 
 &clk_sclk_uart1.clk),
       CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", 
 &clk_sclk_uart2.clk),
       CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", 
 &clk_sclk_uart3.clk),
 +     CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
 +     CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
 +     CLKDEV_INIT(