Re: [PATCH v2 2/5] clocksource: qcom: Move clocksource code out of mach-msm

2014-02-04 Thread Stephen Boyd
On 02/04, Kumar Gala wrote:
> 
> On Feb 4, 2014, at 5:09 PM, Stephen Boyd  wrote:
> 
> > On 02/04, Kumar Gala wrote:
> >> diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> >> index cd6950f..81caa16 100644
> >> --- a/drivers/clocksource/Kconfig
> >> +++ b/drivers/clocksource/Kconfig
> >> @@ -140,3 +140,7 @@ config VF_PIT_TIMER
> >>bool
> >>help
> >>  Support for Period Interrupt Timer on Freescale Vybrid Family SoCs.
> >> +
> >> +config CLKSRC_QCOM
> >> +  bool
> >> +  depends on ARCH_MSM
> > 
> > It would be a a little less noisy if  you left this as MSM_TIMER
> > (msm is all over the code in that file anyway). Also, why do we
> > care about depending on ARCH_MSM here? This is a hidden Kconfig
> > option anyway.
> 
> I will drop the depends, but not sure what point in leaving this as MSM_TIMER.
> 

Less changes to the Kconfig files if you do that. It's a minor
thing.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 2/5] clocksource: qcom: Move clocksource code out of mach-msm

2014-02-04 Thread Kumar Gala

On Feb 4, 2014, at 5:09 PM, Stephen Boyd  wrote:

> On 02/04, Kumar Gala wrote:
>> We intent to share the clocksource code for MSM platforms between legacy
> 
> s/intent/intend/
> 
>> and multiplatform supported qcom SoCs.
>> 
>> Acked-by: Olof Johansson 
>> Signed-off-by: Kumar Gala 
> 
>> diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
>> index cd6950f..81caa16 100644
>> --- a/drivers/clocksource/Kconfig
>> +++ b/drivers/clocksource/Kconfig
>> @@ -140,3 +140,7 @@ config VF_PIT_TIMER
>>  bool
>>  help
>>Support for Period Interrupt Timer on Freescale Vybrid Family SoCs.
>> +
>> +config CLKSRC_QCOM
>> +bool
>> +depends on ARCH_MSM
> 
> It would be a a little less noisy if  you left this as MSM_TIMER
> (msm is all over the code in that file anyway). Also, why do we
> care about depending on ARCH_MSM here? This is a hidden Kconfig
> option anyway.

I will drop the depends, but not sure what point in leaving this as MSM_TIMER.

- k

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by 
The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 2/5] clocksource: qcom: Move clocksource code out of mach-msm

2014-02-04 Thread Stephen Boyd
On 02/04, Kumar Gala wrote:
> We intent to share the clocksource code for MSM platforms between legacy

s/intent/intend/

> and multiplatform supported qcom SoCs.
> 
> Acked-by: Olof Johansson 
> Signed-off-by: Kumar Gala 

> diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> index cd6950f..81caa16 100644
> --- a/drivers/clocksource/Kconfig
> +++ b/drivers/clocksource/Kconfig
> @@ -140,3 +140,7 @@ config VF_PIT_TIMER
>   bool
>   help
> Support for Period Interrupt Timer on Freescale Vybrid Family SoCs.
> +
> +config CLKSRC_QCOM
> + bool
> + depends on ARCH_MSM

It would be a a little less noisy if  you left this as MSM_TIMER
(msm is all over the code in that file anyway). Also, why do we
care about depending on ARCH_MSM here? This is a hidden Kconfig
option anyway.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 2/5] clocksource: qcom: Move clocksource code out of mach-msm

2014-02-04 Thread Kumar Gala
We intent to share the clocksource code for MSM platforms between legacy
and multiplatform supported qcom SoCs.

Acked-by: Olof Johansson 
Signed-off-by: Kumar Gala 
---
 arch/arm/mach-msm/Kconfig|  13 +-
 arch/arm/mach-msm/Makefile   |   1 -
 arch/arm/mach-msm/timer.c| 333 ---
 drivers/clocksource/Kconfig  |   4 +
 drivers/clocksource/Makefile |   1 +
 drivers/clocksource/qcom-timer.c | 329 ++
 6 files changed, 339 insertions(+), 342 deletions(-)
 delete mode 100644 arch/arm/mach-msm/timer.c
 create mode 100644 drivers/clocksource/qcom-timer.c

diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 9625cf3..3c4eca7 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -21,7 +21,7 @@ config ARCH_MSM8X60
select CPU_V7
select HAVE_SMP
select MSM_SCM if SMP
-   select MSM_TIMER
+   select CLKSRC_QCOM
 
 config ARCH_MSM8960
bool "Enable support for MSM8960"
@@ -29,7 +29,7 @@ config ARCH_MSM8960
select CPU_V7
select HAVE_SMP
select MSM_SCM if SMP
-   select MSM_TIMER
+   select CLKSRC_QCOM
 
 config ARCH_MSM8974
bool "Enable support for MSM8974"
@@ -54,7 +54,7 @@ config ARCH_MSM7X00A
select MACH_TROUT if !MACH_HALIBUT
select MSM_PROC_COMM
select MSM_SMD
-   select MSM_TIMER
+   select CLKSRC_QCOM
select MSM_SMD_PKG3
 
 config ARCH_MSM7X30
@@ -66,7 +66,7 @@ config ARCH_MSM7X30
select MSM_GPIOMUX
select MSM_PROC_COMM
select MSM_SMD
-   select MSM_TIMER
+   select CLKSRC_QCOM
select MSM_VIC
 
 config ARCH_QSD8X50
@@ -78,7 +78,7 @@ config ARCH_QSD8X50
select MSM_GPIOMUX
select MSM_PROC_COMM
select MSM_SMD
-   select MSM_TIMER
+   select CLKSRC_QCOM
select MSM_VIC
 
 endchoice
@@ -153,7 +153,4 @@ config MSM_GPIOMUX
 config MSM_SCM
bool
 
-config MSM_TIMER
-   bool
-
 endif
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 8327f60..04b1bee 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -1,4 +1,3 @@
-obj-$(CONFIG_MSM_TIMER) += timer.o
 obj-$(CONFIG_MSM_PROC_COMM) += clock.o
 
 obj-$(CONFIG_MSM_VIC) += irq-vic.o
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
deleted file mode 100644
index fd16449..000
--- a/arch/arm/mach-msm/timer.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- *
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * 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.
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-#include "common.h"
-
-#define TIMER_MATCH_VAL0x
-#define TIMER_COUNT_VAL0x0004
-#define TIMER_ENABLE   0x0008
-#define TIMER_ENABLE_CLR_ON_MATCH_EN   BIT(1)
-#define TIMER_ENABLE_ENBIT(0)
-#define TIMER_CLEAR0x000C
-#define DGT_CLK_CTL0x10
-#define DGT_CLK_CTL_DIV_4  0x3
-#define TIMER_STS_GPT0_CLR_PENDBIT(10)
-
-#define GPT_HZ 32768
-
-#define MSM_DGT_SHIFT 5
-
-static void __iomem *event_base;
-static void __iomem *sts_base;
-
-static irqreturn_t msm_timer_interrupt(int irq, void *dev_id)
-{
-   struct clock_event_device *evt = dev_id;
-   /* Stop the timer tick */
-   if (evt->mode == CLOCK_EVT_MODE_ONESHOT) {
-   u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE);
-   ctrl &= ~TIMER_ENABLE_EN;
-   writel_relaxed(ctrl, event_base + TIMER_ENABLE);
-   }
-   evt->event_handler(evt);
-   return IRQ_HANDLED;
-}
-
-static int msm_timer_set_next_event(unsigned long cycles,
-   struct clock_event_device *evt)
-{
-   u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE);
-
-   ctrl &= ~TIMER_ENABLE_EN;
-   writel_relaxed(ctrl, event_base + TIMER_ENABLE);
-
-   writel_relaxed(ctrl, event_base + TIMER_CLEAR);
-   writel_relaxed(cycles, event_base + TIMER_MATCH_VAL);
-
-   if (sts_base)
-   while (readl_relaxed(sts_base) & TIMER_STS_GPT0_CLR_PEND)
-   cpu_relax();
-
-   writel_relaxed(ctrl | TIMER_ENABLE_EN, event_base + TIMER_ENABLE);
-   return 0;
-}
-
-static void msm_timer_set_mode(enum clock_event_mode mode,
-  

[PATCH v2 2/5] clocksource: qcom: Move clocksource code out of mach-msm

2014-02-04 Thread Kumar Gala
We intent to share the clocksource code for MSM platforms between legacy
and multiplatform supported qcom SoCs.

Acked-by: Olof Johansson o...@lixom.net
Signed-off-by: Kumar Gala ga...@codeaurora.org
---
 arch/arm/mach-msm/Kconfig|  13 +-
 arch/arm/mach-msm/Makefile   |   1 -
 arch/arm/mach-msm/timer.c| 333 ---
 drivers/clocksource/Kconfig  |   4 +
 drivers/clocksource/Makefile |   1 +
 drivers/clocksource/qcom-timer.c | 329 ++
 6 files changed, 339 insertions(+), 342 deletions(-)
 delete mode 100644 arch/arm/mach-msm/timer.c
 create mode 100644 drivers/clocksource/qcom-timer.c

diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 9625cf3..3c4eca7 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -21,7 +21,7 @@ config ARCH_MSM8X60
select CPU_V7
select HAVE_SMP
select MSM_SCM if SMP
-   select MSM_TIMER
+   select CLKSRC_QCOM
 
 config ARCH_MSM8960
bool Enable support for MSM8960
@@ -29,7 +29,7 @@ config ARCH_MSM8960
select CPU_V7
select HAVE_SMP
select MSM_SCM if SMP
-   select MSM_TIMER
+   select CLKSRC_QCOM
 
 config ARCH_MSM8974
bool Enable support for MSM8974
@@ -54,7 +54,7 @@ config ARCH_MSM7X00A
select MACH_TROUT if !MACH_HALIBUT
select MSM_PROC_COMM
select MSM_SMD
-   select MSM_TIMER
+   select CLKSRC_QCOM
select MSM_SMD_PKG3
 
 config ARCH_MSM7X30
@@ -66,7 +66,7 @@ config ARCH_MSM7X30
select MSM_GPIOMUX
select MSM_PROC_COMM
select MSM_SMD
-   select MSM_TIMER
+   select CLKSRC_QCOM
select MSM_VIC
 
 config ARCH_QSD8X50
@@ -78,7 +78,7 @@ config ARCH_QSD8X50
select MSM_GPIOMUX
select MSM_PROC_COMM
select MSM_SMD
-   select MSM_TIMER
+   select CLKSRC_QCOM
select MSM_VIC
 
 endchoice
@@ -153,7 +153,4 @@ config MSM_GPIOMUX
 config MSM_SCM
bool
 
-config MSM_TIMER
-   bool
-
 endif
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 8327f60..04b1bee 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -1,4 +1,3 @@
-obj-$(CONFIG_MSM_TIMER) += timer.o
 obj-$(CONFIG_MSM_PROC_COMM) += clock.o
 
 obj-$(CONFIG_MSM_VIC) += irq-vic.o
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
deleted file mode 100644
index fd16449..000
--- a/arch/arm/mach-msm/timer.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- *
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * 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.
- *
- */
-
-#include linux/clocksource.h
-#include linux/clockchips.h
-#include linux/cpu.h
-#include linux/init.h
-#include linux/interrupt.h
-#include linux/irq.h
-#include linux/io.h
-#include linux/of.h
-#include linux/of_address.h
-#include linux/of_irq.h
-#include linux/sched_clock.h
-
-#include asm/mach/time.h
-
-#include common.h
-
-#define TIMER_MATCH_VAL0x
-#define TIMER_COUNT_VAL0x0004
-#define TIMER_ENABLE   0x0008
-#define TIMER_ENABLE_CLR_ON_MATCH_EN   BIT(1)
-#define TIMER_ENABLE_ENBIT(0)
-#define TIMER_CLEAR0x000C
-#define DGT_CLK_CTL0x10
-#define DGT_CLK_CTL_DIV_4  0x3
-#define TIMER_STS_GPT0_CLR_PENDBIT(10)
-
-#define GPT_HZ 32768
-
-#define MSM_DGT_SHIFT 5
-
-static void __iomem *event_base;
-static void __iomem *sts_base;
-
-static irqreturn_t msm_timer_interrupt(int irq, void *dev_id)
-{
-   struct clock_event_device *evt = dev_id;
-   /* Stop the timer tick */
-   if (evt-mode == CLOCK_EVT_MODE_ONESHOT) {
-   u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE);
-   ctrl = ~TIMER_ENABLE_EN;
-   writel_relaxed(ctrl, event_base + TIMER_ENABLE);
-   }
-   evt-event_handler(evt);
-   return IRQ_HANDLED;
-}
-
-static int msm_timer_set_next_event(unsigned long cycles,
-   struct clock_event_device *evt)
-{
-   u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE);
-
-   ctrl = ~TIMER_ENABLE_EN;
-   writel_relaxed(ctrl, event_base + TIMER_ENABLE);
-
-   writel_relaxed(ctrl, event_base + TIMER_CLEAR);
-   writel_relaxed(cycles, event_base + TIMER_MATCH_VAL);
-
-   if (sts_base)
-   while (readl_relaxed(sts_base)  TIMER_STS_GPT0_CLR_PEND)
-  

Re: [PATCH v2 2/5] clocksource: qcom: Move clocksource code out of mach-msm

2014-02-04 Thread Stephen Boyd
On 02/04, Kumar Gala wrote:
 We intent to share the clocksource code for MSM platforms between legacy

s/intent/intend/

 and multiplatform supported qcom SoCs.
 
 Acked-by: Olof Johansson o...@lixom.net
 Signed-off-by: Kumar Gala ga...@codeaurora.org

 diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
 index cd6950f..81caa16 100644
 --- a/drivers/clocksource/Kconfig
 +++ b/drivers/clocksource/Kconfig
 @@ -140,3 +140,7 @@ config VF_PIT_TIMER
   bool
   help
 Support for Period Interrupt Timer on Freescale Vybrid Family SoCs.
 +
 +config CLKSRC_QCOM
 + bool
 + depends on ARCH_MSM

It would be a a little less noisy if  you left this as MSM_TIMER
(msm is all over the code in that file anyway). Also, why do we
care about depending on ARCH_MSM here? This is a hidden Kconfig
option anyway.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 2/5] clocksource: qcom: Move clocksource code out of mach-msm

2014-02-04 Thread Kumar Gala

On Feb 4, 2014, at 5:09 PM, Stephen Boyd sb...@codeaurora.org wrote:

 On 02/04, Kumar Gala wrote:
 We intent to share the clocksource code for MSM platforms between legacy
 
 s/intent/intend/
 
 and multiplatform supported qcom SoCs.
 
 Acked-by: Olof Johansson o...@lixom.net
 Signed-off-by: Kumar Gala ga...@codeaurora.org
 
 diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
 index cd6950f..81caa16 100644
 --- a/drivers/clocksource/Kconfig
 +++ b/drivers/clocksource/Kconfig
 @@ -140,3 +140,7 @@ config VF_PIT_TIMER
  bool
  help
Support for Period Interrupt Timer on Freescale Vybrid Family SoCs.
 +
 +config CLKSRC_QCOM
 +bool
 +depends on ARCH_MSM
 
 It would be a a little less noisy if  you left this as MSM_TIMER
 (msm is all over the code in that file anyway). Also, why do we
 care about depending on ARCH_MSM here? This is a hidden Kconfig
 option anyway.

I will drop the depends, but not sure what point in leaving this as MSM_TIMER.

- k

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by 
The Linux Foundation

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 2/5] clocksource: qcom: Move clocksource code out of mach-msm

2014-02-04 Thread Stephen Boyd
On 02/04, Kumar Gala wrote:
 
 On Feb 4, 2014, at 5:09 PM, Stephen Boyd sb...@codeaurora.org wrote:
 
  On 02/04, Kumar Gala wrote:
  diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
  index cd6950f..81caa16 100644
  --- a/drivers/clocksource/Kconfig
  +++ b/drivers/clocksource/Kconfig
  @@ -140,3 +140,7 @@ config VF_PIT_TIMER
 bool
 help
   Support for Period Interrupt Timer on Freescale Vybrid Family SoCs.
  +
  +config CLKSRC_QCOM
  +  bool
  +  depends on ARCH_MSM
  
  It would be a a little less noisy if  you left this as MSM_TIMER
  (msm is all over the code in that file anyway). Also, why do we
  care about depending on ARCH_MSM here? This is a hidden Kconfig
  option anyway.
 
 I will drop the depends, but not sure what point in leaving this as MSM_TIMER.
 

Less changes to the Kconfig files if you do that. It's a minor
thing.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/