All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: clps711x: Last 2 patches
@ 2012-05-15 17:55 Alexander Shiyan
  2012-05-15 17:55 ` [PATCH 1/2] ARM: clps711x: Cleanup IRQ handling Alexander Shiyan
  2012-05-15 17:55 ` [PATCH 2/2] ARM: clps711x: Added support for CPU frequencies other than 73 MHz Alexander Shiyan
  0 siblings, 2 replies; 6+ messages in thread
From: Alexander Shiyan @ 2012-05-15 17:55 UTC (permalink / raw)
  To: linux-arm-kernel

This final two patch for branch arm-soc clps711x/cleanup.
Removed redundant masking interrupts and adds the ability to
proper operation of the kernel at various clock speeds of the CPU.

Alexander Shiyan (2):
  ARM: clps711x: Cleanup IRQ handling
  ARM: clps711x: Added support for CPU frequencies other than 73 MHz

 arch/arm/mach-clps711x/Kconfig                 |    9 +++++++++
 arch/arm/mach-clps711x/common.c                |   12 ------------
 arch/arm/mach-clps711x/include/mach/hardware.h |    3 +++
 arch/arm/mach-clps711x/include/mach/irqs.h     |    5 +----
 arch/arm/mach-clps711x/include/mach/timex.h    |    4 +++-
 drivers/tty/serial/clps711x.c                  |    4 ++--
 6 files changed, 18 insertions(+), 19 deletions(-)

-- 
1.7.3.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] ARM: clps711x: Cleanup IRQ handling
  2012-05-15 17:55 [PATCH 0/2] ARM: clps711x: Last 2 patches Alexander Shiyan
@ 2012-05-15 17:55 ` Alexander Shiyan
  2012-05-15 19:29   ` Arnd Bergmann
  2012-05-15 17:55 ` [PATCH 2/2] ARM: clps711x: Added support for CPU frequencies other than 73 MHz Alexander Shiyan
  1 sibling, 1 reply; 6+ messages in thread
From: Alexander Shiyan @ 2012-05-15 17:55 UTC (permalink / raw)
  To: linux-arm-kernel

This patch contains two changes:
- Removed unused definitions from mach/irqs.h
- Do not mask interrupts in ack procedure, because we have separate
  intX_mask procedure for do it and actually these 2 functions are
  called sequentially

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/mach-clps711x/common.c            |   12 ------------
 arch/arm/mach-clps711x/include/mach/irqs.h |    5 +----
 2 files changed, 1 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c
index b6dfd2f..c965fd8 100644
--- a/arch/arm/mach-clps711x/common.c
+++ b/arch/arm/mach-clps711x/common.c
@@ -66,12 +66,6 @@ static void int1_mask(struct irq_data *d)
 
 static void int1_ack(struct irq_data *d)
 {
-	u32 intmr1;
-
-	intmr1 = clps_readl(INTMR1);
-	intmr1 &= ~(1 << d->irq);
-	clps_writel(intmr1, INTMR1);
-
 	switch (d->irq) {
 	case IRQ_CSINT:  clps_writel(0, COEOI);  break;
 	case IRQ_TC1OI:  clps_writel(0, TC1EOI); break;
@@ -108,12 +102,6 @@ static void int2_mask(struct irq_data *d)
 
 static void int2_ack(struct irq_data *d)
 {
-	u32 intmr2;
-
-	intmr2 = clps_readl(INTMR2);
-	intmr2 &= ~(1 << (d->irq - 16));
-	clps_writel(intmr2, INTMR2);
-
 	switch (d->irq) {
 	case IRQ_KBDINT: clps_writel(0, KBDEOI); break;
 	}
diff --git a/arch/arm/mach-clps711x/include/mach/irqs.h b/arch/arm/mach-clps711x/include/mach/irqs.h
index 30b7e97..14d215f 100644
--- a/arch/arm/mach-clps711x/include/mach/irqs.h
+++ b/arch/arm/mach-clps711x/include/mach/irqs.h
@@ -35,7 +35,6 @@
 #define IRQ_SSEOTI			15
 
 #define INT1_IRQS			(0x0000fff0)
-#define INT1_ACK_IRQS			(0x00004f10)
 
 /*
  * Interrupts from INTSR2
@@ -47,7 +46,5 @@
 #define IRQ_URXINT2			(16+13)	/* bit 13 */
 
 #define INT2_IRQS			(0x30070000)
-#define INT2_ACK_IRQS			(0x00010000)
-
-#define NR_IRQS                         30
 
+#define NR_IRQS				30
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] ARM: clps711x: Added support for CPU frequencies other than 73 MHz
  2012-05-15 17:55 [PATCH 0/2] ARM: clps711x: Last 2 patches Alexander Shiyan
  2012-05-15 17:55 ` [PATCH 1/2] ARM: clps711x: Cleanup IRQ handling Alexander Shiyan
@ 2012-05-15 17:55 ` Alexander Shiyan
  2012-05-15 19:36   ` Arnd Bergmann
  1 sibling, 1 reply; 6+ messages in thread
From: Alexander Shiyan @ 2012-05-15 17:55 UTC (permalink / raw)
  To: linux-arm-kernel

Modern CPUs from CLPS711X-line can operate at frequencies other than 73 MHz.
This patch adds calculation of system clock frequency and the frequency of
UART, depending on processor speed. Kconfig option "CPU frequency" was added
for this purposes.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/mach-clps711x/Kconfig                 |    9 +++++++++
 arch/arm/mach-clps711x/include/mach/hardware.h |    3 +++
 arch/arm/mach-clps711x/include/mach/timex.h    |    4 +++-
 drivers/tty/serial/clps711x.c                  |    4 ++--
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
index ea036d6..24a7279 100644
--- a/arch/arm/mach-clps711x/Kconfig
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -45,6 +45,15 @@ config ARCH_P720T
 config ARCH_FORTUNET
 	bool "FORTUNET"
 
+config EP72XX_CPU_SPEED
+	int "CPU frequency"
+	default 73728000
+	help
+	  This is a CPU frequency. This value must be setup in bootlader,
+	  before loading kernel.
+	  The value can be one of: 18432000, 36864000, 49152000, 73728000 or
+	  90316800.
+
 config EP72XX_ROM_BOOT
 	bool "EP721x/EP731x ROM boot"
 	help
diff --git a/arch/arm/mach-clps711x/include/mach/hardware.h b/arch/arm/mach-clps711x/include/mach/hardware.h
index 13a64fc..76e3293 100644
--- a/arch/arm/mach-clps711x/include/mach/hardware.h
+++ b/arch/arm/mach-clps711x/include/mach/hardware.h
@@ -24,6 +24,9 @@
 
 #include <mach/clps711x.h>
 
+#define CPU_BUS_SPEED		(CONFIG_EP72XX_CPU_SPEED / 2)
+#define UART_BAUD_BASE		(CPU_BUS_SPEED / 10)
+
 #define CLPS711X_VIRT_BASE	IOMEM(0xff000000)
 
 #ifndef __ASSEMBLY__
diff --git a/arch/arm/mach-clps711x/include/mach/timex.h b/arch/arm/mach-clps711x/include/mach/timex.h
index ac8823c..fa5ad13 100644
--- a/arch/arm/mach-clps711x/include/mach/timex.h
+++ b/arch/arm/mach-clps711x/include/mach/timex.h
@@ -20,4 +20,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define CLOCK_TICK_RATE 512000
+#include <mach/hardware.h>
+
+#define CLOCK_TICK_RATE		(CONFIG_EP72XX_CPU_SPEED / 144)
diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
index d0f719f..bae678d 100644
--- a/drivers/tty/serial/clps711x.c
+++ b/drivers/tty/serial/clps711x.c
@@ -401,7 +401,7 @@ static struct uart_port clps711x_ports[UART_NR] = {
 	{
 		.iobase		= SYSCON1,
 		.irq		= IRQ_UTXINT1, /* IRQ_URXINT1, IRQ_UMSINT */
-		.uartclk	= 3686400,
+		.uartclk	= UART_BAUD_BASE,
 		.fifosize	= 16,
 		.ops		= &clps711x_pops,
 		.line		= 0,
@@ -410,7 +410,7 @@ static struct uart_port clps711x_ports[UART_NR] = {
 	{
 		.iobase		= SYSCON2,
 		.irq		= IRQ_UTXINT2, /* IRQ_URXINT2 */
-		.uartclk	= 3686400,
+		.uartclk	= UART_BAUD_BASE,
 		.fifosize	= 16,
 		.ops		= &clps711x_pops,
 		.line		= 1,
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/2] ARM: clps711x: Cleanup IRQ handling
  2012-05-15 17:55 ` [PATCH 1/2] ARM: clps711x: Cleanup IRQ handling Alexander Shiyan
@ 2012-05-15 19:29   ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2012-05-15 19:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 15 May 2012, Alexander Shiyan wrote:
> This patch contains two changes:
> - Removed unused definitions from mach/irqs.h
> - Do not mask interrupts in ack procedure, because we have separate
>   intX_mask procedure for do it and actually these 2 functions are
>   called sequentially
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

Applied, and pulled it with the other cleanup into the next/cleanup branch.

Thanks,

	Arnd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] ARM: clps711x: Added support for CPU frequencies other than 73 MHz
  2012-05-15 17:55 ` [PATCH 2/2] ARM: clps711x: Added support for CPU frequencies other than 73 MHz Alexander Shiyan
@ 2012-05-15 19:36   ` Arnd Bergmann
  2012-05-15 19:51     ` Re[2]: " Alexander Shiyan
  0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2012-05-15 19:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 15 May 2012, Alexander Shiyan wrote:
> Modern CPUs from CLPS711X-line can operate at frequencies other than 73 MHz.
> This patch adds calculation of system clock frequency and the frequency of
> UART, depending on processor speed. Kconfig option "CPU frequency" was added
> for this purposes.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

I'm sceptical about this patch. While it is an improvement, it doesn't
really go far enough and does not make it possible to build a kernel
that runs on multiple mach-clps711x based machines that each have different
clock frequencies. It would be much better to make it a run-time option
like most other platforms rather than hardcode at compile time.

> diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
> index ea036d6..24a7279 100644
> --- a/arch/arm/mach-clps711x/Kconfig
> +++ b/arch/arm/mach-clps711x/Kconfig
> @@ -45,6 +45,15 @@ config ARCH_P720T
>  config ARCH_FORTUNET
>  	bool "FORTUNET"
>  
> +config EP72XX_CPU_SPEED
> +	int "CPU frequency"
> +	default 73728000
> +	help
> +	  This is a CPU frequency. This value must be setup in bootlader,
> +	  before loading kernel.
> +	  The value can be one of: 18432000, 36864000, 49152000, 73728000 or
> +	  90316800.
> +

I think it would be better to express this as a "choice" statement if you end
up requiring this to be a compile-time option.

> diff --git a/arch/arm/mach-clps711x/include/mach/hardware.h b
> diff --git a/arch/arm/mach-clps711x/include/mach/timex.h b/arch/arm/mach-clps711x/include/mach/timex.h
> index ac8823c..fa5ad13 100644
> --- a/arch/arm/mach-clps711x/include/mach/timex.h
> +++ b/arch/arm/mach-clps711x/include/mach/timex.h
> @@ -20,4 +20,6 @@
>   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
>   */
>  
> -#define CLOCK_TICK_RATE 512000
> +#include <mach/hardware.h>
> +
> +#define CLOCK_TICK_RATE		(CONFIG_EP72XX_CPU_SPEED / 144)

We're actually trying hard to remove CLOCK_TICK_RATE in the long run.
Most people believe that by now it's completely bogus for all common code,
but I think Russell still isn't convinced.

> diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
> index d0f719f..bae678d 100644
> --- a/drivers/tty/serial/clps711x.c
> +++ b/drivers/tty/serial/clps711x.c
> @@ -401,7 +401,7 @@ static struct uart_port clps711x_ports[UART_NR] = {
>  	{
>  		.iobase		= SYSCON1,
>  		.irq		= IRQ_UTXINT1, /* IRQ_URXINT1, IRQ_UMSINT */
> -		.uartclk	= 3686400,
> +		.uartclk	= UART_BAUD_BASE,
>  		.fifosize	= 16,
>  		.ops		= &clps711x_pops,
>  		.line		= 0,
> @@ -410,7 +410,7 @@ static struct uart_port clps711x_ports[UART_NR] = {
>  	{
>  		.iobase		= SYSCON2,
>  		.irq		= IRQ_UTXINT2, /* IRQ_URXINT2 */
> -		.uartclk	= 3686400,
> +		.uartclk	= UART_BAUD_BASE,
>  		.fifosize	= 16,
>  		.ops		= &clps711x_pops,
>  		.line		= 1,

I think the right way to do this is to move the uart_add_one_port() call
and the clps711x_ports array into platform code, so you can modify the
frequency at boot time, but leave the uart_driver where it is.
That will require some other changes for the console.

It's probably best to leave this patch for after the merge window, so you
can come up with a good solution for 3.6, ok?

	Arnd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re[2]: [PATCH 2/2] ARM: clps711x: Added support for CPU frequencies other than 73 MHz
  2012-05-15 19:36   ` Arnd Bergmann
@ 2012-05-15 19:51     ` Alexander Shiyan
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Shiyan @ 2012-05-15 19:51 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

Tue, 15 May 2012 19:36:47 +0000 ?? Arnd Bergmann <arnd@arndb.de>:
> On Tuesday 15 May 2012, Alexander Shiyan wrote:
> > Modern CPUs from CLPS711X-line can operate at frequencies other than 73 MHz.
> > This patch adds calculation of system clock frequency and the frequency of
> > UART, depending on processor speed. Kconfig option "CPU frequency" was added
> > for this purposes.
...
> I think the right way to do this is to move the uart_add_one_port() call
> and the clps711x_ports array into platform code, so you can modify the
> frequency at boot time, but leave the uart_driver where it is.
> That will require some other changes for the console.
> 
> It's probably best to leave this patch for after the merge window, so you
> can come up with a good solution for 3.6, ok?
OK, Arnd, I'll think about the other implementation.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-05-15 19:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-15 17:55 [PATCH 0/2] ARM: clps711x: Last 2 patches Alexander Shiyan
2012-05-15 17:55 ` [PATCH 1/2] ARM: clps711x: Cleanup IRQ handling Alexander Shiyan
2012-05-15 19:29   ` Arnd Bergmann
2012-05-15 17:55 ` [PATCH 2/2] ARM: clps711x: Added support for CPU frequencies other than 73 MHz Alexander Shiyan
2012-05-15 19:36   ` Arnd Bergmann
2012-05-15 19:51     ` Re[2]: " Alexander Shiyan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.