Re: [GIT PULL] Samsung fixes for 2.6.36-rc3

2010-08-27 Thread Kyungmin Park
On Fri, Aug 27, 2010 at 6:48 PM, Kukjin Kim  wrote:
> Hi Linus,
>
> Please pull Samsung fixes from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
> s5p-fixes-for-linus
>
> These things are for bug fix on 2.6.36-rc3.
> If any problems, please let me know.

Well nothing changed. only LSI codes and required things from LSI side
are merged.
And still need more patches for booting at s5pc210 (aka s5pv310).

Several thins are missed.
1. gpio_to_irq patch not included. it's basic gpiolib feature. Without
this patch, it can't use the generic gpiolib based drivers. e.g.,
gpio-keys.
http://marc.info/?l=linux-arm-kernel&m=128202435823832&w=2

2. Wrong UART level triggers.
At least s5pc110/s5pc210 has wrong UART trigger values compare to macro name.
http://marc.info/?l=linux-arm-kernel&m=128218476209330&w=2

3. set correct gpio config at GPIO I at s5pc110
http://marc.info/?l=linux-arm-kernel&m=128202423923745&w=2


>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim , Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
>
>
> The following changes since commit 76be97c1fc945db08aae1f1b746012662d643e97:
>
>  Linux 2.6.36-rc2 (2010-08-22 17:43:29 -0700)
>
> are available in the git repository at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
> s5p-fixes-for-linus
>
> Changhwan Youn (1):
>      ARM: S5PV310: Fix on Secondary CPU startup
>
> Jongpill Lee (4):
>      ARM: S5PV310: Fix on PLL setting for S5PV310
>      ARM: S5PV310: Should be clk_sclk_apll not clk_mout_apll
>      ARM: S5PV310: Fix missed uart clocks
>      ARM: S5PV310: Bug fix on uclk1 and sclk_pwm
>
> Kukjin Kim (4):
>      ARM: SAMSUNG: Fix on build warning regarding VMALLOC_END type
>      ARM: S5PV310: Fix on default ZRELADDR of ARCH_S5PV310
>      ARM: S5PV310: Fix on typo irqs.h of S5PV310
>      ARM: S5PV310: Add CMU block for S5PV310 Clock
>
> Kyungmin Park (2):
>      ARM: S5P: VMALLOC_END should be unsigned long
>      ARM: S5PV310: Fix on GPIO base addresses
>
>  arch/arm/Kconfig                                |    3 +-
>  arch/arm/mach-s3c2410/include/mach/vmalloc.h    |    2 +-
>  arch/arm/mach-s3c64xx/include/mach/vmalloc.h    |    2 +-
>  arch/arm/mach-s5p6440/include/mach/vmalloc.h    |    2 +-
>  arch/arm/mach-s5p6442/include/mach/vmalloc.h    |    2 +-
>  arch/arm/mach-s5pv210/include/mach/vmalloc.h    |    2 +-
>  arch/arm/mach-s5pv310/clock.c                   |   82
> +-
>  arch/arm/mach-s5pv310/cpu.c                     |   10 +++
>  arch/arm/mach-s5pv310/include/mach/irqs.h       |   11 ++-
>  arch/arm/mach-s5pv310/include/mach/map.h        |   16 -
>  arch/arm/mach-s5pv310/include/mach/regs-clock.h |   59 
>  arch/arm/mach-s5pv310/include/mach/vmalloc.h    |    2 +-
>  arch/arm/mach-s5pv310/platsmp.c                 |    2 +-
>  arch/arm/plat-s5p/include/plat/map-s5p.h        |    2 +
>  14 files changed, 135 insertions(+), 62 deletions(-)
>
>
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-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 4/5] sdhci-s3c: add support for the non standard minimal clock value

2010-08-27 Thread Kukjin Kim
Chris Ball wrote:
> 
> Hi,
> 
Hi again ;-)

> Looks like this wasn't merged.  Any thoughts on doing so?
> 
Updated patch(v3) of this was merged.

http://marc.info/?l=linux-arm-kernel&m=128040710023029&w=2

(commit ID: ce5f036bbbfc6c21d7b55b8fdaa2e2bd56392d94)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

> On Wed, Jun 09, 2010 at 11:39:42AM +0200, Marek Szyprowski wrote:
> > S3C SDHCI host controller can change the source for generating mmc
clock.
> > By default host bus clock is used, what causes some problems on machines
> > with 133MHz bus, because the SDHCI divider cannot be as high get proper
> > clock value for identification mode. This is not a problem for the
> > controller, because it can generate lower frequencies from other clock
> > sources. This patch adds a new quirk to SDHCI driver to calculate the
> > minimal supported clock frequency.
> >
> > This fixes the flood of the following warnings on Samsung S5PV210 SoCs:
> > mmc0: Minimum clock frequency too high for identification mode
> >
> > Signed-off-by: Marek Szyprowski 
> > Signed-off-by: Kyungmin Park 
> > ---
> >  drivers/mmc/host/sdhci-of-esdhc.c |1 +
> >  drivers/mmc/host/sdhci-s3c.c  |   29
> +
> >  drivers/mmc/host/sdhci.c  |2 +-
> >  drivers/mmc/host/sdhci.h  |2 ++
> >  4 files changed, 33 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sdhci-of-esdhc.c
b/drivers/mmc/host/sdhci-of-
> esdhc.c
> > index c8623de..64b3f79 100644
> > --- a/drivers/mmc/host/sdhci-of-esdhc.c
> > +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> > @@ -124,6 +124,7 @@ struct sdhci_of_data sdhci_esdhc = {
> >   SDHCI_QUIRK_BROKEN_CARD_DETECTION |
> >   SDHCI_QUIRK_NO_BUSY_IRQ |
> >   SDHCI_QUIRK_NONSTANDARD_CLOCK |
> > + SDHCI_QUIRK_NONSTANDARD_MINCLOCK |
> >   SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
> >   SDHCI_QUIRK_PIO_NEEDS_DELAY |
> >   SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET |
> > diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> > index 2b6cb44..615008d 100644
> > --- a/drivers/mmc/host/sdhci-s3c.c
> > +++ b/drivers/mmc/host/sdhci-s3c.c
> > @@ -209,10 +209,37 @@ static void sdhci_s3c_set_clock(struct sdhci_host
> *host, unsigned int clock)
> > }
> >  }
> >
> > +/**
> > + * sdhci_s3c_get_min_clock - callback to get minimal supported clock
value
> > + * @host: The SDHCI host being queried
> > + *
> > + * To init mmc host properly a minimal clock value is needed. For high
system
> > + * bus clock's values the standard formula gives values out of allowed
range.
> > + * The clock still can be set to lower values, if clock source other
then
> > + * system bus is selected.
> > +*/
> > +static unsigned int sdhci_s3c_get_min_clock(struct sdhci_host *host)
> > +{
> > +   struct sdhci_s3c *ourhost = to_s3c(host);
> > +   unsigned int delta, min = UINT_MAX;
> > +   int src;
> > +
> > +   for (src = 0; src < MAX_BUS_CLK; src++) {
> > +   delta = sdhci_s3c_consider_clock(ourhost, src, 0);
> > +   if (delta == UINT_MAX)
> > +   continue;
> > +   /* delta is a negative value in this case */
> > +   if (-delta < min)
> > +   min = -delta;
> > +   }
> > +   return min;
> > +}
> > +
> >  static struct sdhci_ops sdhci_s3c_ops = {
> > .get_max_clock  = sdhci_s3c_get_max_clk,
> > .get_timeout_clock  = sdhci_s3c_get_timeout_clk,
> > .set_clock  = sdhci_s3c_set_clock,
> > +   .get_min_clock  = sdhci_s3c_get_min_clock,
> >  };
> >
> >  static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
> > @@ -316,6 +343,8 @@ static int __devinit sdhci_s3c_probe(struct
> platform_device *pdev)
> > host->quirks = 0;
> > host->irq = irq;
> >
> > +   host->quirks |= SDHCI_QUIRK_NONSTANDARD_MINCLOCK;
> > +
> > /* Setup quirks for the controller */
> > host->quirks |= SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC;
> >
> > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> > index c6d1bd8..8b3ee53 100644
> > --- a/drivers/mmc/host/sdhci.c
> > +++ b/drivers/mmc/host/sdhci.c
> > @@ -1785,7 +1785,7 @@ int sdhci_add_host(struct sdhci_host *host)
> >  * Set host parameters.
> >  */
> > mmc->ops = &sdhci_ops;
> > -   if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK &&
> > +   if (host->quirks & SDHCI_QUIRK_NONSTANDARD_MINCLOCK &&
> > host->ops->set_clock && host->ops->get_min_clock)
> > mmc->f_min = host->ops->get_min_clock(host);
> > else
> > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> > index c846813..3fd87c2 100644
> > --- a/drivers/mmc/host/sdhci.h
> > +++ b/drivers/mmc/host/sdhci.h
> > @@ -240,6 +240,8 @@ struct sdhci_host {
> >  #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN  (1<<25)
> >  /* Controller cannot support End Attribute i

RE: [PATCH] sdhci-s3c: Add SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK quirk for Samsung SoC

2010-08-27 Thread Kukjin Kim
Chris Ball wrote:
> 
> Hi,
> 
Hi :-)

> This wasn't merged, after some questions from Kyungmin Park -- is
> the patch still desirable?
> 

This patch is being in mainline now.
(Commit ID: 3fe42e077f65351503f5004031549db330bb105e)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

> On Thu, Jun 10, 2010 at 08:39:51PM +0900, Kukjin Kim wrote:
> > From: Lee Hyuk 
> >
> > On Samsung's SDMMC hosts the timeout clock is derivied from the SD
> > Clock, which is set dynamically.
> > So, checked 'SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK' quirk and
> removed
> > 'sdhci_s3c_get_timeout_clk' callback which doesn't need any more.
> >
> > Signed-off-by: Hyuk Lee 
> > Signed-off-by: Kukjin Kim 
> > ---
> >  drivers/mmc/host/sdhci-s3c.c |   10 +++---
> >  1 files changed, 3 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> > index af21792..ca09382 100644
> > --- a/drivers/mmc/host/sdhci-s3c.c
> > +++ b/drivers/mmc/host/sdhci-s3c.c
> > @@ -110,11 +110,6 @@ static unsigned int sdhci_s3c_get_max_clk(struct
> sdhci_host *host)
> > return max;
> >  }
> >
> > -static unsigned int sdhci_s3c_get_timeout_clk(struct sdhci_host *host)
> > -{
> > -   return sdhci_s3c_get_max_clk(host) / 100;
> > -}
> > -
> >  /**
> >   * sdhci_s3c_consider_clock - consider one the bus clocks for current
setting
> >   * @ourhost: Our SDHCI instance.
> > @@ -188,7 +183,6 @@ static void sdhci_s3c_set_clock(struct sdhci_host
*host,
> unsigned int clock)
> >
> > ourhost->cur_clk = best_src;
> > host->max_clk = clk_get_rate(clk);
> > -   host->timeout_clk = sdhci_s3c_get_timeout_clk(host);
> >
> > ctrl = readl(host->ioaddr + S3C_SDHCI_CONTROL2);
> > ctrl &= ~S3C_SDHCI_CTRL2_SELBASECLK_MASK;
> > @@ -211,7 +205,6 @@ static void sdhci_s3c_set_clock(struct sdhci_host
*host,
> unsigned int clock)
> >
> >  static struct sdhci_ops sdhci_s3c_ops = {
> > .get_max_clock  = sdhci_s3c_get_max_clk,
> > -   .get_timeout_clock  = sdhci_s3c_get_timeout_clk,
> > .set_clock  = sdhci_s3c_set_clock,
> >  };
> >
> > @@ -335,6 +328,9 @@ static int __devinit sdhci_s3c_probe(struct
> platform_device *pdev)
> > host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
> >  SDHCI_QUIRK_32BIT_DMA_SIZE);
> >
> > +   /* HSMMC on Samsung SoCs uses SDCLK as timeout clock. */
> > +   host->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK;
> > +
> > ret = sdhci_add_host(host);
> > if (ret) {
> > dev_err(dev, "sdhci_add_host() failed\n");
> > --
> > 1.6.2.5
> 
> --
> Chris Ball  
> One Laptop Per Child

--
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 1/2] s3c24xx: DMA: don't use autoreload feature

2010-08-27 Thread Vasily Khoruzhick
Some integrated DMA-capable hardware doesn't like autoreload
feature of s3c24xx DMA-engine, that's why s3cmci driver
didn't work with DMA transfers enabled.

I rewrote DMA driver not to use autoreload feature and removed
all pre-loading features. Buffer re-load is fast enought to perform
it in IRQ handler, and anyway I don't see any reason to waste CPU
cycles on waiting for buffer load. Driver is much simplier now,
it was tested with s3cmci and s3c24xx-i2s drivers on s3c2442 and
s3c2410 SoCs and works just nice.

Signed-off-by: Vasily Khoruzhick 
---
 arch/arm/mach-s3c2410/include/mach/dma.h |   13 +-
 arch/arm/plat-s3c24xx/dma.c  |  442 +-
 2 files changed, 75 insertions(+), 380 deletions(-)

diff --git a/arch/arm/mach-s3c2410/include/mach/dma.h 
b/arch/arm/mach-s3c2410/include/mach/dma.h
index cf68136..198826f 100644
--- a/arch/arm/mach-s3c2410/include/mach/dma.h
+++ b/arch/arm/mach-s3c2410/include/mach/dma.h
@@ -79,16 +79,9 @@ enum s3c2410_dma_state {
  *
  * There are no buffers loaded (the channel should be inactive)
  *
- * S3C2410_DMA_1LOADED
- *
- * There is one buffer loaded, however it has not been confirmed to be
- * loaded by the DMA engine. This may be because the channel is not
- * yet running, or the DMA driver decided that it was too costly to
- * sit and wait for it to happen.
- *
  * S3C2410_DMA_1RUNNING
  *
- * The buffer has been confirmed running, and not finisged
+ * The buffer has been confirmed running, and not finished
  *
  * S3C2410_DMA_1LOADED_1RUNNING
  *
@@ -98,9 +91,7 @@ enum s3c2410_dma_state {
 
 enum s3c2410_dma_loadst {
S3C2410_DMALOAD_NONE,
-   S3C2410_DMALOAD_1LOADED,
S3C2410_DMALOAD_1RUNNING,
-   S3C2410_DMALOAD_1LOADED_1RUNNING,
 };
 
 
@@ -129,6 +120,7 @@ struct s3c2410_dma_buf {
dma_addr_t   data;  /* start of DMA data */
dma_addr_t   ptr;   /* where the DMA got to [1] */
void*id;/* client's id */
+   unsigned inttimestamp;
 };
 
 /* [1] is this updated for both recv/send modes? */
@@ -189,6 +181,7 @@ struct s3c2410_dma_chan {
struct s3c2410_dma_buf  *curr;  /* current dma buffer */
struct s3c2410_dma_buf  *next;  /* next buffer to load */
struct s3c2410_dma_buf  *end;   /* end of queue */
+   spinlock_t  queue_lock;
 
/* system device */
struct sys_device   dev;
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
index 6ad274e..5ed045b 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -133,70 +133,6 @@ dmadbg_showregs(const char *fname, int line, struct 
s3c2410_dma_chan *chan)
 #define dbg_showchan(chan) do { } while(0)
 #endif /* CONFIG_S3C2410_DMA_DEBUG */
 
-/* s3c2410_dma_stats_timeout
- *
- * Update DMA stats from timeout info
-*/
-
-static void
-s3c2410_dma_stats_timeout(struct s3c2410_dma_stats *stats, int val)
-{
-   if (stats == NULL)
-   return;
-
-   if (val > stats->timeout_longest)
-   stats->timeout_longest = val;
-   if (val < stats->timeout_shortest)
-   stats->timeout_shortest = val;
-
-   stats->timeout_avg += val;
-}
-
-/* s3c2410_dma_waitforload
- *
- * wait for the DMA engine to load a buffer, and update the state accordingly
-*/
-
-static int
-s3c2410_dma_waitforload(struct s3c2410_dma_chan *chan, int line)
-{
-   int timeout = chan->load_timeout;
-   int took;
-
-   if (chan->load_state != S3C2410_DMALOAD_1LOADED) {
-   printk(KERN_ERR "dma%d: s3c2410_dma_waitforload() called in 
loadstate %d from line %d\n", chan->number, chan->load_state, line);
-   return 0;
-   }
-
-   if (chan->stats != NULL)
-   chan->stats->loads++;
-
-   while (--timeout > 0) {
-   if ((dma_rdreg(chan, S3C2410_DMA_DSTAT) << (32-20)) != 0) {
-   took = chan->load_timeout - timeout;
-
-   s3c2410_dma_stats_timeout(chan->stats, took);
-
-   switch (chan->load_state) {
-   case S3C2410_DMALOAD_1LOADED:
-   chan->load_state = S3C2410_DMALOAD_1RUNNING;
-   break;
-
-   default:
-   printk(KERN_ERR "dma%d: unknown load_state in 
s3c2410_dma_waitforload() %d\n", chan->number, chan->load_state);
-   }
-
-   return 1;
-   }
-   }
-
-   if (chan->stats != NULL) {
-   chan->stats->timeout_failed++;
-   }
-
-   return 0;
-}
-
 /* s3c2410_dma_loadbuffer
  *
  * load a buffer, and update the channel state
@@ -206,66 +142,35 @@ static inline int
 s3c2410_dma_loadbuffer(struct s3c2410_dma_chan *chan,
   struct s3c2410_dma_buf *buf)
 {
-   unsigned long reload;
-

Re: [PATCH 1/2] s3c24xx: DMA: don't use autoreload feature

2010-08-27 Thread Vasily Khoruzhick
В сообщении от 18 августа 2010 18:04:25 автор Vasily Khoruzhick написал:
> Some integrated DMA-capable hardware doesn't like autoreload
> feature of s3c24xx DMA-engine, that's why s3cmci driver
> didn't work with DMA transfers enabled.
> 
> I rewrote DMA driver not to use autoreload feature and removed
> all pre-loading features. Buffer re-load is fast enought to perform
> it in IRQ handler, and anyway I don't see any reason to waste CPU
> cycles on waiting for buffer load. Driver is much simplier now,
> it was tested with s3cmci and s3c24xx-i2s drivers on s3c2442 and
> s3c2410 SoCs and works just nice.
 
Patch has problem with suspend/resume (chan->dcon is clobbered by
dma_sel->select())

Will resend fixed version soon.

Regards
Vasily


signature.asc
Description: This is a digitally signed message part.


Re: [PATCH] sdhci-s3c: Add SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK quirk for Samsung SoC

2010-08-27 Thread Chris Ball
Hi,

This wasn't merged, after some questions from Kyungmin Park -- is
the patch still desirable?

On Thu, Jun 10, 2010 at 08:39:51PM +0900, Kukjin Kim wrote:
> From: Lee Hyuk 
> 
> On Samsung's SDMMC hosts the timeout clock is derivied from the SD
> Clock, which is set dynamically.
> So, checked 'SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK' quirk and removed
> 'sdhci_s3c_get_timeout_clk' callback which doesn't need any more.
> 
> Signed-off-by: Hyuk Lee 
> Signed-off-by: Kukjin Kim 
> ---
>  drivers/mmc/host/sdhci-s3c.c |   10 +++---
>  1 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index af21792..ca09382 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -110,11 +110,6 @@ static unsigned int sdhci_s3c_get_max_clk(struct 
> sdhci_host *host)
>   return max;
>  }
>  
> -static unsigned int sdhci_s3c_get_timeout_clk(struct sdhci_host *host)
> -{
> - return sdhci_s3c_get_max_clk(host) / 100;
> -}
> -
>  /**
>   * sdhci_s3c_consider_clock - consider one the bus clocks for current setting
>   * @ourhost: Our SDHCI instance.
> @@ -188,7 +183,6 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, 
> unsigned int clock)
>  
>   ourhost->cur_clk = best_src;
>   host->max_clk = clk_get_rate(clk);
> - host->timeout_clk = sdhci_s3c_get_timeout_clk(host);
>  
>   ctrl = readl(host->ioaddr + S3C_SDHCI_CONTROL2);
>   ctrl &= ~S3C_SDHCI_CTRL2_SELBASECLK_MASK;
> @@ -211,7 +205,6 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, 
> unsigned int clock)
>  
>  static struct sdhci_ops sdhci_s3c_ops = {
>   .get_max_clock  = sdhci_s3c_get_max_clk,
> - .get_timeout_clock  = sdhci_s3c_get_timeout_clk,
>   .set_clock  = sdhci_s3c_set_clock,
>  };
>  
> @@ -335,6 +328,9 @@ static int __devinit sdhci_s3c_probe(struct 
> platform_device *pdev)
>   host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
>SDHCI_QUIRK_32BIT_DMA_SIZE);
>  
> + /* HSMMC on Samsung SoCs uses SDCLK as timeout clock. */
> + host->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK;
> +
>   ret = sdhci_add_host(host);
>   if (ret) {
>   dev_err(dev, "sdhci_add_host() failed\n");
> -- 
> 1.6.2.5

-- 
Chris Ball  
One Laptop Per Child
--
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 4/5] sdhci-s3c: add support for the non standard minimal clock value

2010-08-27 Thread Chris Ball
Hi,

Looks like this wasn't merged.  Any thoughts on doing so?

On Wed, Jun 09, 2010 at 11:39:42AM +0200, Marek Szyprowski wrote:
> S3C SDHCI host controller can change the source for generating mmc clock.
> By default host bus clock is used, what causes some problems on machines
> with 133MHz bus, because the SDHCI divider cannot be as high get proper
> clock value for identification mode. This is not a problem for the
> controller, because it can generate lower frequencies from other clock
> sources. This patch adds a new quirk to SDHCI driver to calculate the
> minimal supported clock frequency.
> 
> This fixes the flood of the following warnings on Samsung S5PV210 SoCs:
> mmc0: Minimum clock frequency too high for identification mode
> 
> Signed-off-by: Marek Szyprowski 
> Signed-off-by: Kyungmin Park 
> ---
>  drivers/mmc/host/sdhci-of-esdhc.c |1 +
>  drivers/mmc/host/sdhci-s3c.c  |   29 +
>  drivers/mmc/host/sdhci.c  |2 +-
>  drivers/mmc/host/sdhci.h  |2 ++
>  4 files changed, 33 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c 
> b/drivers/mmc/host/sdhci-of-esdhc.c
> index c8623de..64b3f79 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -124,6 +124,7 @@ struct sdhci_of_data sdhci_esdhc = {
> SDHCI_QUIRK_BROKEN_CARD_DETECTION |
> SDHCI_QUIRK_NO_BUSY_IRQ |
> SDHCI_QUIRK_NONSTANDARD_CLOCK |
> +   SDHCI_QUIRK_NONSTANDARD_MINCLOCK |
> SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
> SDHCI_QUIRK_PIO_NEEDS_DELAY |
> SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET |
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index 2b6cb44..615008d 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -209,10 +209,37 @@ static void sdhci_s3c_set_clock(struct sdhci_host 
> *host, unsigned int clock)
>   }
>  }
>  
> +/**
> + * sdhci_s3c_get_min_clock - callback to get minimal supported clock value
> + * @host: The SDHCI host being queried
> + *
> + * To init mmc host properly a minimal clock value is needed. For high system
> + * bus clock's values the standard formula gives values out of allowed range.
> + * The clock still can be set to lower values, if clock source other then
> + * system bus is selected.
> +*/
> +static unsigned int sdhci_s3c_get_min_clock(struct sdhci_host *host)
> +{
> + struct sdhci_s3c *ourhost = to_s3c(host);
> + unsigned int delta, min = UINT_MAX;
> + int src;
> +
> + for (src = 0; src < MAX_BUS_CLK; src++) {
> + delta = sdhci_s3c_consider_clock(ourhost, src, 0);
> + if (delta == UINT_MAX)
> + continue;
> + /* delta is a negative value in this case */
> + if (-delta < min)
> + min = -delta;
> + }
> + return min;
> +}
> +
>  static struct sdhci_ops sdhci_s3c_ops = {
>   .get_max_clock  = sdhci_s3c_get_max_clk,
>   .get_timeout_clock  = sdhci_s3c_get_timeout_clk,
>   .set_clock  = sdhci_s3c_set_clock,
> + .get_min_clock  = sdhci_s3c_get_min_clock,
>  };
>  
>  static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
> @@ -316,6 +343,8 @@ static int __devinit sdhci_s3c_probe(struct 
> platform_device *pdev)
>   host->quirks = 0;
>   host->irq = irq;
>  
> + host->quirks |= SDHCI_QUIRK_NONSTANDARD_MINCLOCK;
> +
>   /* Setup quirks for the controller */
>   host->quirks |= SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC;
>  
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index c6d1bd8..8b3ee53 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1785,7 +1785,7 @@ int sdhci_add_host(struct sdhci_host *host)
>* Set host parameters.
>*/
>   mmc->ops = &sdhci_ops;
> - if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK &&
> + if (host->quirks & SDHCI_QUIRK_NONSTANDARD_MINCLOCK &&
>   host->ops->set_clock && host->ops->get_min_clock)
>   mmc->f_min = host->ops->get_min_clock(host);
>   else
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index c846813..3fd87c2 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -240,6 +240,8 @@ struct sdhci_host {
>  #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN(1<<25)
>  /* Controller cannot support End Attribute in NOP ADMA descriptor */
>  #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC(1<<26)
> +/* Controller has nonstandard clock management */
> +#define SDHCI_QUIRK_NONSTANDARD_MINCLOCK (1<<27)
>  
>   int irq;/* Device IRQ */
>   void __iomem *  ioaddr; /* Mapped address */
> -- 
> 1.7.1.240.g225c

-- 
Chris Ball  
One Laptop Per Child
--
To unsub

Re: [PATCH 3/5] sdhci-s3c: increase the timeout value

2010-08-27 Thread Chris Ball
Hi Marek,

On Wed, Jun 09, 2010 at 11:39:41AM +0200, Marek Szyprowski wrote:
> This patch increases the timeout value on sdhci-s3c controller by using
> SDHCI_QUIRK_BROKEN_TIMEOUT_VAL quirk. Without it most transfers from
> external mmc cards fails on Samsung s5pv210 SoCs based systems. Tested
> on Samsung Aquila board.
> 
> Signed-off-by: Marek Szyprowski 
> Signed-off-by: Kyungmin Park 
> ---
>  drivers/mmc/host/sdhci-s3c.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index ad30f07..2b6cb44 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -331,6 +331,7 @@ static int __devinit sdhci_s3c_probe(struct 
> platform_device *pdev)
>* transfers, not sure if this is a problem with this specific
>* SDHCI block, or a missing configuration that needs to be set. */
>   host->quirks |= SDHCI_QUIRK_NO_BUSY_IRQ;
> + host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
>  
>   host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
>SDHCI_QUIRK_32BIT_DMA_SIZE);
> -- 
> 1.7.1.240.g225c

Kukjin Kim suggested using SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK instead,
so this wasn't merged.  Would you like to resubmit with that change?

-- 
Chris Ball  
One Laptop Per Child
--
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] S3C: SDHCI: Modify timeout clock calculation.

2010-08-27 Thread Chris Ball
Hi,

This wasn't picked up -- any comments from the list?

On Fri, Mar 05, 2010 at 12:32:43PM +0530, Thomas Abraham wrote:
> In sdhci_s3c_set_clock function of S3C SDHCI controller driver, when a new
> clock source is selected, the timeout clock is recalculated. This patch 
> modifies the calculation of the timeout clock based on the 
> SDHCI_TIMEOUT_CLK_UNIT capability which is determined from the 
> SDHCI_CAPABILITIES register.
> 
> Signed-off-by: Thomas Abraham 
> ---
>  drivers/mmc/host/sdhci-s3c.c |6 +-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index 50997d2..ab4641c 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -181,6 +181,7 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, 
> unsigned int clock)
>  
>   if (ourhost->cur_clk != best_src) {
>   struct clk *clk = ourhost->clk_bus[best_src];
> + unsigned int caps;
>  
>   /* turn clock off to card before changing clock source */
>   writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL);
> @@ -188,7 +189,10 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, 
> unsigned int clock)
>   ourhost->cur_clk = best_src;
>   host->max_clk = clk_get_rate(clk);
>   host->timeout_clk = sdhci_s3c_get_timeout_clk(host);
> -
> + caps = readl(host->ioaddr + SDHCI_CAPABILITIES);
> + if (caps & SDHCI_TIMEOUT_CLK_UNIT)
> + host->timeout_clk *= 1000;
> +
>   ctrl = readl(host->ioaddr + S3C_SDHCI_CONTROL2);
>   ctrl &= ~S3C_SDHCI_CTRL2_SELBASECLK_MASK;
>   ctrl |= best_src << S3C_SDHCI_CTRL2_SELBASECLK_SHIFT;
> -- 
> 1.6.6.rc2

-- 
Chris Ball  
One Laptop Per Child
--
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] SDHCI: Modify checks to determine the presense of card.

2010-08-27 Thread Chris Ball
Hi,

This wasn't picked up -- any comments from the list?

On Fri, Mar 05, 2010 at 12:29:37PM +0530, Thomas Abraham wrote:
> In the sdhci_request function, the card is determined to be present based
> on the SDCD pin status. SDHCI host controllers that do not use SDCD pin
> but rely on other mechanism such as external pin interrupts, update the
> host flags with SDHCI_DEVICE_DEAD flag based on the card insertion status.
> This patch modifies the sdhci_request function such that the it uses
> both the SDCD status and SDHCI_DEVICE_DEAD host flag to determine if the
> card is inserted or not.
> 
> Signed-off-by: Thomas Abraham 
> ---
>  drivers/mmc/host/sdhci.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index c279fbc..f1a6ebe 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1106,7 +1106,7 @@ static void sdhci_request(struct mmc_host *mmc, struct 
> mmc_request *mrq)
>   present = sdhci_readl(host, SDHCI_PRESENT_STATE) &
>   SDHCI_CARD_PRESENT;
>  
> - if (!present || host->flags & SDHCI_DEVICE_DEAD) {
> + if (!present && host->flags & SDHCI_DEVICE_DEAD) {
>   host->mrq->cmd->error = -ENOMEDIUM;
>   tasklet_schedule(&host->finish_tasklet);
>   } else
> -- 
> 1.6.6.rc2

-- 
Chris Ball  
One Laptop Per Child
--
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/1] i2c-s3c2410: Enable i2c clock only when doing some transfert

2010-08-27 Thread Vasily Khoruzhick
В сообщении от 23 июля 2010 12:02:49 автор Vasily Khoruzhick написал:
> В сообщении от 15 июля 2010 16:06:14 автор Arnaud Patard написал:
> > This patch modify the s3c2410 i2c driver behaviour to enable the
> > i2c clock only when needed. I'm not sure if this has a big impact
> > on power usage but at least it's fixing a bug with the uda1380
> > codec which needs to be hard reset'ed if the i2c clock is enabled
> > before it's powered on (at least on h1940).
> > 
> > Signed-off-by: Arnaud Patard 
> 
> Fixes same bug with uda1380 on rx1950 aswell.
> 
> Tested-by: Vasily Khoruzhick 

This patch has problem with suspend/resume, clock needs to be enabled on i2c 
re-init. Here's fixed version of patch in attachment.
From a7b655bc82e21dcd8ae380efd39ec0455cd48779 Mon Sep 17 00:00:00 2001
From: Arnaud Patard (Rtp) 
Date: Thu, 15 Jul 2010 15:06:14 +0200
Subject: [PATCH v2 1/1] i2c-s3c2410: Enable i2c clock only when doing some transfert

This patch modify the s3c2410 i2c driver behaviour to enable the
i2c clock only when needed. I'm not sure if this has a big impact
on power usage but at least it's fixing a bug with the uda1380
codec which needs to be hard reset'ed if the i2c clock is enabled
before it's powered on (at least on h1940).

v2: enable clock on i2c init in resume handler

Signed-off-by: Arnaud Patard 
Signed-off-by: Vasily Khoruzhick 
---
 drivers/i2c/busses/i2c-s3c2410.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 72902e0..0e2a2c7 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -555,18 +555,23 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
 	int retry;
 	int ret;
 
+	clk_enable(i2c->clk);
+
 	for (retry = 0; retry < adap->retries; retry++) {
 
 		ret = s3c24xx_i2c_doxfer(i2c, msgs, num);
 
-		if (ret != -EAGAIN)
+		if (ret != -EAGAIN) {
+			clk_disable(i2c->clk);
 			return ret;
+		}
 
 		dev_dbg(i2c->dev, "Retrying transmission (%d)\n", retry);
 
 		udelay(100);
 	}
 
+	clk_disable(i2c->clk);
 	return -EREMOTEIO;
 }
 
@@ -911,6 +916,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, i2c);
 
 	dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev));
+	clk_disable(i2c->clk);
 	return 0;
 
  err_cpufreq:
@@ -978,7 +984,9 @@ static int s3c24xx_i2c_resume(struct device *dev)
 	struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
 
 	i2c->suspended = 0;
+	clk_enable(i2c->clk);
 	s3c24xx_i2c_init(i2c);
+	clk_disable(i2c->clk);
 
 	return 0;
 }
-- 
1.7.2



[PATCH] ARM: SAMSUNG: Removing unused codes

2010-08-27 Thread Kukjin Kim
This patch removes following unused codes.

arch/arm/plat-samsung/adc.c:438: warning: unused variable 'flags'
arch/arm/mach-s5pv210/clock.c:176: warning: 's5pv210_clk_ip4_ctrl' defined but 
not used

Signed-off-by: Kukjin Kim 
---
 arch/arm/mach-s5pv210/clock.c |5 -
 arch/arm/plat-samsung/adc.c   |1 -
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
index af91fef..10a3934 100644
--- a/arch/arm/mach-s5pv210/clock.c
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -173,11 +173,6 @@ static int s5pv210_clk_ip3_ctrl(struct clk *clk, int 
enable)
return s5p_gatectrl(S5P_CLKGATE_IP3, clk, enable);
 }
 
-static int s5pv210_clk_ip4_ctrl(struct clk *clk, int enable)
-{
-   return s5p_gatectrl(S5P_CLKGATE_IP4, clk, enable);
-}
-
 static int s5pv210_clk_mask0_ctrl(struct clk *clk, int enable)
 {
return s5p_gatectrl(S5P_CLK_SRC_MASK0, clk, enable);
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index 04d9521..e8f2be2 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -435,7 +435,6 @@ static int s3c_adc_suspend(struct platform_device *pdev, 
pm_message_t state)
 static int s3c_adc_resume(struct platform_device *pdev)
 {
struct adc_device *adc = platform_get_drvdata(pdev);
-   unsigned long flags;
 
clk_enable(adc->clk);
enable_irq(adc->irq);
-- 
1.6.2.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


[GIT PULL] Samsung fixes for 2.6.36-rc3

2010-08-27 Thread Kukjin Kim
Hi Linus,

Please pull Samsung fixes from:

git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
s5p-fixes-for-linus

These things are for bug fix on 2.6.36-rc3.
If any problems, please let me know.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.


The following changes since commit 76be97c1fc945db08aae1f1b746012662d643e97:

  Linux 2.6.36-rc2 (2010-08-22 17:43:29 -0700)

are available in the git repository at:
   git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
s5p-fixes-for-linus

Changhwan Youn (1):
  ARM: S5PV310: Fix on Secondary CPU startup

Jongpill Lee (4):
  ARM: S5PV310: Fix on PLL setting for S5PV310
  ARM: S5PV310: Should be clk_sclk_apll not clk_mout_apll
  ARM: S5PV310: Fix missed uart clocks
  ARM: S5PV310: Bug fix on uclk1 and sclk_pwm

Kukjin Kim (4):
  ARM: SAMSUNG: Fix on build warning regarding VMALLOC_END type
  ARM: S5PV310: Fix on default ZRELADDR of ARCH_S5PV310
  ARM: S5PV310: Fix on typo irqs.h of S5PV310
  ARM: S5PV310: Add CMU block for S5PV310 Clock

Kyungmin Park (2):
  ARM: S5P: VMALLOC_END should be unsigned long
  ARM: S5PV310: Fix on GPIO base addresses

 arch/arm/Kconfig|3 +-
 arch/arm/mach-s3c2410/include/mach/vmalloc.h|2 +-
 arch/arm/mach-s3c64xx/include/mach/vmalloc.h|2 +-
 arch/arm/mach-s5p6440/include/mach/vmalloc.h|2 +-
 arch/arm/mach-s5p6442/include/mach/vmalloc.h|2 +-
 arch/arm/mach-s5pv210/include/mach/vmalloc.h|2 +-
 arch/arm/mach-s5pv310/clock.c   |   82
+-
 arch/arm/mach-s5pv310/cpu.c |   10 +++
 arch/arm/mach-s5pv310/include/mach/irqs.h   |   11 ++-
 arch/arm/mach-s5pv310/include/mach/map.h|   16 -
 arch/arm/mach-s5pv310/include/mach/regs-clock.h |   59 
 arch/arm/mach-s5pv310/include/mach/vmalloc.h|2 +-
 arch/arm/mach-s5pv310/platsmp.c |2 +-
 arch/arm/plat-s5p/include/plat/map-s5p.h|2 +
 14 files changed, 135 insertions(+), 62 deletions(-)

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