linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] ep93xx/ts72xx patches
@ 2011-06-12 15:04 Petr Štetiar
  2011-06-12 15:04 ` [PATCH v2 1/5] ARM: ep93xx: use more reliable CPLD watchdog for reset on ts72xx Petr Štetiar
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Petr Štetiar @ 2011-06-12 15:04 UTC (permalink / raw)
  To: linux-arm-kernel

Whole patchset is available on my GitHub repository[1] also.

1. https://github.com/ynezz/linux-2.6/commits/ts72xx-upstream


Changes since v1:

* incorporated Ryan's and Hartley's comments on CPLD watchdog patch
* added one more patch 5/5, which is fixing the bug in the model detection


Petr ?tetiar (5):
  ARM: ep93xx: use more reliable CPLD watchdog for reset on ts72xx
  ARM: ep93xx: add model detection for ts-7300 and ts-7400 boards
  ARM: ep93xx: increase NR_BANKS to 16 for support of 128MB RAM
  ARM: ep93xx: fix inverted RTS/DTR signals on uart1
  ARM: ep93xx: ts72xx: fix board model detection

 arch/arm/include/asm/setup.h               |    6 +++++-
 arch/arm/mach-ep93xx/core.c                |    4 ++--
 arch/arm/mach-ep93xx/include/mach/system.h |   18 +++++++++++++-----
 arch/arm/mach-ep93xx/include/mach/ts72xx.h |   26 ++++++++++++++++++++++----
 4 files changed, 42 insertions(+), 12 deletions(-)

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

* [PATCH v2 1/5] ARM: ep93xx: use more reliable CPLD watchdog for reset on ts72xx
  2011-06-12 15:04 [PATCH v2 0/5] ep93xx/ts72xx patches Petr Štetiar
@ 2011-06-12 15:04 ` Petr Štetiar
  2011-06-13 17:39   ` H Hartley Sweeten
  2011-06-12 15:04 ` [PATCH v2 2/5] ARM: ep93xx: add model detection for ts-7300 and ts-7400 boards Petr Štetiar
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Petr Štetiar @ 2011-06-12 15:04 UTC (permalink / raw)
  To: linux-arm-kernel

On all ep93xx based boards from Technologic Systems, there's CPLD watchdog
available, so use this one to reset the board instead of the soft reset in
CPU.  I've seen some weird lockups with the soft reset on ep93xx in the past,
while the reset via CPLD watchdog seems to be rock solid (tm) and works fine
so far.

Cc: Ryan Mallon <ryan@bluewatersys.com>
Tested-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Petr ?tetiar <ynezz@true.cz>
---
 arch/arm/mach-ep93xx/include/mach/system.h |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-ep93xx/include/mach/system.h b/arch/arm/mach-ep93xx/include/mach/system.h
index 6d661fe..67ec430 100644
--- a/arch/arm/mach-ep93xx/include/mach/system.h
+++ b/arch/arm/mach-ep93xx/include/mach/system.h
@@ -2,7 +2,10 @@
  * arch/arm/mach-ep93xx/include/mach/system.h
  */
 
+#include <linux/io.h>
+
 #include <mach/hardware.h>
+#include <mach/ts72xx.h>
 
 static inline void arch_idle(void)
 {
@@ -13,11 +16,16 @@ static inline void arch_reset(char mode, const char *cmd)
 {
 	local_irq_disable();
 
-	/*
-	 * Set then clear the SWRST bit to initiate a software reset
-	 */
-	ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_SWRST);
-	ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_SWRST);
+	if (board_is_ts7200() || board_is_ts7250() || board_is_ts7260() ||
+	    board_is_ts7300() || board_is_ts7400()) {
+		/* We use more reliable CPLD watchdog to perform the reset */
+		__raw_writeb(0x5, TS72XX_WDT_FEED_PHYS_BASE);
+		__raw_writeb(0x1, TS72XX_WDT_CONTROL_PHYS_BASE);
+	} else {
+		/* Set then clear the SWRST bit to initiate a software reset */
+		ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_SWRST);
+		ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_SWRST);
+	}
 
 	while (1)
 		;
-- 
1.7.1

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

* [PATCH v2 2/5] ARM: ep93xx: add model detection for ts-7300 and ts-7400 boards
  2011-06-12 15:04 [PATCH v2 0/5] ep93xx/ts72xx patches Petr Štetiar
  2011-06-12 15:04 ` [PATCH v2 1/5] ARM: ep93xx: use more reliable CPLD watchdog for reset on ts72xx Petr Štetiar
@ 2011-06-12 15:04 ` Petr Štetiar
  2011-06-13 17:40   ` H Hartley Sweeten
  2011-06-12 15:04 ` [PATCH v2 3/5] ARM: ep93xx: increase NR_BANKS to 16 for support of 128MB RAM Petr Štetiar
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Petr Štetiar @ 2011-06-12 15:04 UTC (permalink / raw)
  To: linux-arm-kernel

Cc: Ryan Mallon <ryan@bluewatersys.com>
Acked-By: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Petr ?tetiar <ynezz@true.cz>
---
 arch/arm/mach-ep93xx/include/mach/ts72xx.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-ep93xx/include/mach/ts72xx.h b/arch/arm/mach-ep93xx/include/mach/ts72xx.h
index 0eabec6..ee7f875 100644
--- a/arch/arm/mach-ep93xx/include/mach/ts72xx.h
+++ b/arch/arm/mach-ep93xx/include/mach/ts72xx.h
@@ -20,6 +20,8 @@
 #define TS72XX_MODEL_TS7200		0x00
 #define TS72XX_MODEL_TS7250		0x01
 #define TS72XX_MODEL_TS7260		0x02
+#define TS72XX_MODEL_TS7300		0x03
+#define TS72XX_MODEL_TS7400		0x04
 
 
 #define TS72XX_OPTIONS_PHYS_BASE	0x22400000
@@ -66,6 +68,16 @@ static inline int board_is_ts7260(void)
 	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7260;
 }
 
+static inline int board_is_ts7300(void)
+{
+	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7300;
+}
+
+static inline int board_is_ts7400(void)
+{
+	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7400;
+}
+
 static inline int is_max197_installed(void)
 {
 	return !!(__raw_readb(TS72XX_OPTIONS_VIRT_BASE) &
-- 
1.7.1

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

* [PATCH v2 3/5] ARM: ep93xx: increase NR_BANKS to 16 for support of 128MB RAM
  2011-06-12 15:04 [PATCH v2 0/5] ep93xx/ts72xx patches Petr Štetiar
  2011-06-12 15:04 ` [PATCH v2 1/5] ARM: ep93xx: use more reliable CPLD watchdog for reset on ts72xx Petr Štetiar
  2011-06-12 15:04 ` [PATCH v2 2/5] ARM: ep93xx: add model detection for ts-7300 and ts-7400 boards Petr Štetiar
@ 2011-06-12 15:04 ` Petr Štetiar
  2011-06-13 17:43   ` H Hartley Sweeten
  2011-06-12 15:04 ` [PATCH v2 4/5] ARM: ep93xx: fix inverted RTS/DTR signals on uart1 Petr Štetiar
  2011-06-12 15:05 ` [PATCH v2 5/5] ARM: ep93xx: ts72xx: fix board model detection Petr Štetiar
  4 siblings, 1 reply; 14+ messages in thread
From: Petr Štetiar @ 2011-06-12 15:04 UTC (permalink / raw)
  To: linux-arm-kernel

I've got hands on one ts-7300 board, which is equiped with 128MB RAM in two
64MB memory chips, so it's 16 banks/8MB each. Without this patch, the bootmem
init code complains about small NR_BANKS number and only lower 64MB is
accessible.

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Petr ?tetiar <ynezz@true.cz>
---
 arch/arm/include/asm/setup.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index ee2ad8a..b13720d 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -192,7 +192,11 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
 /*
  * Memory map description
  */
-#define NR_BANKS 8
+#ifdef CONFIG_ARCH_EP93XX
+# define NR_BANKS 16
+#else
+# define NR_BANKS 8
+#endif
 
 struct membank {
 	phys_addr_t start;
-- 
1.7.1

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

* [PATCH v2 4/5] ARM: ep93xx: fix inverted RTS/DTR signals on uart1
  2011-06-12 15:04 [PATCH v2 0/5] ep93xx/ts72xx patches Petr Štetiar
                   ` (2 preceding siblings ...)
  2011-06-12 15:04 ` [PATCH v2 3/5] ARM: ep93xx: increase NR_BANKS to 16 for support of 128MB RAM Petr Štetiar
@ 2011-06-12 15:04 ` Petr Štetiar
  2011-06-13 17:38   ` H Hartley Sweeten
  2011-06-12 15:05 ` [PATCH v2 5/5] ARM: ep93xx: ts72xx: fix board model detection Petr Štetiar
  4 siblings, 1 reply; 14+ messages in thread
From: Petr Štetiar @ 2011-06-12 15:04 UTC (permalink / raw)
  To: linux-arm-kernel

It was discovered by Roberto Bergo, that RTS/DTR signals are inverted after
the boot, because it was causing him problems with hardware controlled modem
connected on ttyAM0. Todd Valentic came with this patch for the issue.

Discussion: http://tech.groups.yahoo.com/group/ts-7000/message/20259

Cc: Ryan Mallon <ryan@bluewatersys.com>
Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Todd Valentic <todd.valentic@sri.com>
Tested-by: Roberto Bergo <roberto.bergo@robson.it>
Signed-off-by: Petr ?tetiar <ynezz@true.cz>
---
 arch/arm/mach-ep93xx/core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 8207954..cf1ce32 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -251,9 +251,9 @@ static void ep93xx_uart_set_mctrl(struct amba_device *dev,
 	unsigned int mcr;
 
 	mcr = 0;
-	if (!(mctrl & TIOCM_RTS))
+	if (mctrl & TIOCM_RTS)
 		mcr |= 2;
-	if (!(mctrl & TIOCM_DTR))
+	if (mctrl & TIOCM_DTR)
 		mcr |= 1;
 
 	__raw_writel(mcr, base + EP93XX_UART_MCR_OFFSET);
-- 
1.7.1

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

* [PATCH v2 5/5] ARM: ep93xx: ts72xx: fix board model detection
  2011-06-12 15:04 [PATCH v2 0/5] ep93xx/ts72xx patches Petr Štetiar
                   ` (3 preceding siblings ...)
  2011-06-12 15:04 ` [PATCH v2 4/5] ARM: ep93xx: fix inverted RTS/DTR signals on uart1 Petr Štetiar
@ 2011-06-12 15:05 ` Petr Štetiar
  2011-06-13 17:47   ` H Hartley Sweeten
  4 siblings, 1 reply; 14+ messages in thread
From: Petr Štetiar @ 2011-06-12 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

Fix the obvious error in board detection logic, because according to the TS's
manual, the model is stored in the least three significant bits. For example
the byte read on my ts-7300 is 0x23 and the detection then fails.

Cc: Ryan Mallon <ryan@bluewatersys.com>
Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Petr ?tetiar <ynezz@true.cz>
---
 arch/arm/mach-ep93xx/include/mach/ts72xx.h |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-ep93xx/include/mach/ts72xx.h b/arch/arm/mach-ep93xx/include/mach/ts72xx.h
index ee7f875..f1397a1 100644
--- a/arch/arm/mach-ep93xx/include/mach/ts72xx.h
+++ b/arch/arm/mach-ep93xx/include/mach/ts72xx.h
@@ -6,7 +6,7 @@
  * TS72xx memory map:
  *
  * virt		phys		size
- * febff000	22000000	4K	model number register
+ * febff000	22000000	4K	model number register (bits 0-2)
  * febfe000	22400000	4K	options register
  * febfd000	22800000	4K	options register #2
  * febf9000	10800000	4K	TS-5620 RTC index register
@@ -22,6 +22,7 @@
 #define TS72XX_MODEL_TS7260		0x02
 #define TS72XX_MODEL_TS7300		0x03
 #define TS72XX_MODEL_TS7400		0x04
+#define TS72XX_MODEL_MASK		0x07
 
 
 #define TS72XX_OPTIONS_PHYS_BASE	0x22400000
@@ -53,29 +54,34 @@
 
 #ifndef __ASSEMBLY__
 
+static inline int ts72xx_model(void)
+{
+	return __raw_readb(TS72XX_MODEL_VIRT_BASE) & TS72XX_MODEL_MASK;
+}
+
 static inline int board_is_ts7200(void)
 {
-	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7200;
+	return ts72xx_model() == TS72XX_MODEL_TS7200;
 }
 
 static inline int board_is_ts7250(void)
 {
-	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7250;
+	return ts72xx_model() == TS72XX_MODEL_TS7250;
 }
 
 static inline int board_is_ts7260(void)
 {
-	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7260;
+	return ts72xx_model() == TS72XX_MODEL_TS7260;
 }
 
 static inline int board_is_ts7300(void)
 {
-	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7300;
+	return ts72xx_model()  == TS72XX_MODEL_TS7300;
 }
 
 static inline int board_is_ts7400(void)
 {
-	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7400;
+	return ts72xx_model() == TS72XX_MODEL_TS7400;
 }
 
 static inline int is_max197_installed(void)
-- 
1.7.1

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

* [PATCH v2 4/5] ARM: ep93xx: fix inverted RTS/DTR signals on uart1
  2011-06-12 15:04 ` [PATCH v2 4/5] ARM: ep93xx: fix inverted RTS/DTR signals on uart1 Petr Štetiar
@ 2011-06-13 17:38   ` H Hartley Sweeten
  0 siblings, 0 replies; 14+ messages in thread
From: H Hartley Sweeten @ 2011-06-13 17:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday, June 12, 2011 8:05 AM, Petr ?tetiar wrote:
>
> It was discovered by Roberto Bergo, that RTS/DTR signals are inverted after
> the boot, because it was causing him problems with hardware controlled modem
> connected on ttyAM0. Todd Valentic came with this patch for the issue.
>
> Discussion: http://tech.groups.yahoo.com/group/ts-7000/message/20259
>
> Cc: Ryan Mallon <ryan@bluewatersys.com>
> Cc: Hartley Sweeten <hsweeten@visionengravers.com>
> Signed-off-by: Todd Valentic <todd.valentic@sri.com>
> Tested-by: Roberto Bergo <roberto.bergo@robson.it>
> Signed-off-by: Petr ?tetiar <ynezz@true.cz>
> ---
>  arch/arm/mach-ep93xx/core.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
> index 8207954..cf1ce32 100644
> --- a/arch/arm/mach-ep93xx/core.c
> +++ b/arch/arm/mach-ep93xx/core.c
> @@ -251,9 +251,9 @@ static void ep93xx_uart_set_mctrl(struct amba_device *dev,
>  	unsigned int mcr;
>  
>  	mcr = 0;
> -	if (!(mctrl & TIOCM_RTS))
> +	if (mctrl & TIOCM_RTS)
>  		mcr |= 2;
> -	if (!(mctrl & TIOCM_DTR))
> +	if (mctrl & TIOCM_DTR)
>  		mcr |= 1;
>  
>  	__raw_writel(mcr, base + EP93XX_UART_MCR_OFFSET);

This looks correct.

Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Please add the patch to Russell's Patch Tracker.

Thanks,
Hartley

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

* [PATCH v2 1/5] ARM: ep93xx: use more reliable CPLD watchdog for reset on ts72xx
  2011-06-12 15:04 ` [PATCH v2 1/5] ARM: ep93xx: use more reliable CPLD watchdog for reset on ts72xx Petr Štetiar
@ 2011-06-13 17:39   ` H Hartley Sweeten
  0 siblings, 0 replies; 14+ messages in thread
From: H Hartley Sweeten @ 2011-06-13 17:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday, June 12, 2011 8:05 AM, Petr ?tetiar wrote:
>
> On all ep93xx based boards from Technologic Systems, there's CPLD watchdog
> available, so use this one to reset the board instead of the soft reset in
> CPU.  I've seen some weird lockups with the soft reset on ep93xx in the past,
> while the reset via CPLD watchdog seems to be rock solid (tm) and works fine
> so far.
>
> Cc: Ryan Mallon <ryan@bluewatersys.com>
> Tested-by: Mika Westerberg <mika.westerberg@iki.fi>
> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Signed-off-by: Petr ?tetiar <ynezz@true.cz>

Please submit to Russell's Patch Tracker.

Regards,
Hartley

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

* [PATCH v2 2/5] ARM: ep93xx: add model detection for ts-7300 and ts-7400 boards
  2011-06-12 15:04 ` [PATCH v2 2/5] ARM: ep93xx: add model detection for ts-7300 and ts-7400 boards Petr Štetiar
@ 2011-06-13 17:40   ` H Hartley Sweeten
  0 siblings, 0 replies; 14+ messages in thread
From: H Hartley Sweeten @ 2011-06-13 17:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday, June 12, 2011 8:05 AM, Petr ?tetiar wrote:
>
> Cc: Ryan Mallon <ryan@bluewatersys.com>
> Acked-By: H Hartley Sweeten <hsweeten@visionengravers.com>
> Signed-off-by: Petr ?tetiar <ynezz@true.cz>

Please submit to Russell's Patch Tracker.

Regards,
Hartley

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

* [PATCH v2 3/5] ARM: ep93xx: increase NR_BANKS to 16 for support of 128MB RAM
  2011-06-12 15:04 ` [PATCH v2 3/5] ARM: ep93xx: increase NR_BANKS to 16 for support of 128MB RAM Petr Štetiar
@ 2011-06-13 17:43   ` H Hartley Sweeten
  2011-06-17 10:32     ` Petr Štetiar
  0 siblings, 1 reply; 14+ messages in thread
From: H Hartley Sweeten @ 2011-06-13 17:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday, June 12, 2011 8:05 AM, Petr ?tetiar wrote:
>
> I've got hands on one ts-7300 board, which is equiped with 128MB RAM in two
> 64MB memory chips, so it's 16 banks/8MB each. Without this patch, the bootmem
> init code complains about small NR_BANKS number and only lower 64MB is
> accessible.
>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Ryan Mallon <ryan@bluewatersys.com>
> Signed-off-by: Petr ?tetiar <ynezz@true.cz>
> ---
>  arch/arm/include/asm/setup.h |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
> index ee2ad8a..b13720d 100644
> --- a/arch/arm/include/asm/setup.h
> +++ b/arch/arm/include/asm/setup.h
> @@ -192,7 +192,11 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
>  /*
>   * Memory map description
>   */
> -#define NR_BANKS 8
> +#ifdef CONFIG_ARCH_EP93XX
> +# define NR_BANKS 16
> +#else
> +# define NR_BANKS 8
> +#endif
>  
>  struct membank {
>  	phys_addr_t start;

I would like Russell's opinion on this patch before it's accepted into his
Patch Tracker.

But, as far as the ep93xx support goes...

Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

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

* [PATCH v2 5/5] ARM: ep93xx: ts72xx: fix board model detection
  2011-06-12 15:05 ` [PATCH v2 5/5] ARM: ep93xx: ts72xx: fix board model detection Petr Štetiar
@ 2011-06-13 17:47   ` H Hartley Sweeten
  0 siblings, 0 replies; 14+ messages in thread
From: H Hartley Sweeten @ 2011-06-13 17:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday, June 12, 2011 8:05 AM, Petr ?tetiar wrote:
>
> Fix the obvious error in board detection logic, because according to the TS's
> manual, the model is stored in the least three significant bits. For example
> the byte read on my ts-7300 is 0x23 and the detection then fails.
>
> Cc: Ryan Mallon <ryan@bluewatersys.com>
> Cc: Hartley Sweeten <hsweeten@visionengravers.com>
> Signed-off-by: Petr ?tetiar <ynezz@true.cz>
> ---
>  arch/arm/mach-ep93xx/include/mach/ts72xx.h |   18 ++++++++++++------
>  1 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/mach-ep93xx/include/mach/ts72xx.h b/arch/arm/mach-ep93xx/include/mach/ts72xx.h
> index ee7f875..f1397a1 100644
> --- a/arch/arm/mach-ep93xx/include/mach/ts72xx.h
> +++ b/arch/arm/mach-ep93xx/include/mach/ts72xx.h
> @@ -6,7 +6,7 @@
>   * TS72xx memory map:
>   *
>   * virt		phys		size
> - * febff000	22000000	4K	model number register
> + * febff000	22000000	4K	model number register (bits 0-2)
>   * febfe000	22400000	4K	options register
>   * febfd000	22800000	4K	options register #2
>   * febf9000	10800000	4K	TS-5620 RTC index register
> @@ -22,6 +22,7 @@
>  #define TS72XX_MODEL_TS7260		0x02
>  #define TS72XX_MODEL_TS7300		0x03
>  #define TS72XX_MODEL_TS7400		0x04
> +#define TS72XX_MODEL_MASK		0x07
>  
>  
>  #define TS72XX_OPTIONS_PHYS_BASE	0x22400000
> @@ -53,29 +54,34 @@
>  
>  #ifndef __ASSEMBLY__
>  
> +static inline int ts72xx_model(void)
> +{
> +	return __raw_readb(TS72XX_MODEL_VIRT_BASE) & TS72XX_MODEL_MASK;
> +}
> +
>  static inline int board_is_ts7200(void)
>  {
> -	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7200;
> +	return ts72xx_model() == TS72XX_MODEL_TS7200;
>  }
>  
>  static inline int board_is_ts7250(void)
>  {
> -	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7250;
> +	return ts72xx_model() == TS72XX_MODEL_TS7250;
>  }
>  
>  static inline int board_is_ts7260(void)
>  {
> -	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7260;
> +	return ts72xx_model() == TS72XX_MODEL_TS7260;
>  }
>  
>  static inline int board_is_ts7300(void)
>  {
> -	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7300;
> +	return ts72xx_model()  == TS72XX_MODEL_TS7300;
>  }
>  
>  static inline int board_is_ts7400(void)
>  {
> -	return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7400;
> +	return ts72xx_model() == TS72XX_MODEL_TS7400;
>  }
>  
>  static inline int is_max197_installed(void)

The "model" register on the ts boards is part of the CPLD.  Since it only
has the three lower data bits connected to it masking the value is correct.
Otherwise the read will pickup random garbage on the upper 5 bits during the
8-bit read.

Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Please sumbit to Russell's Patch Tracker.

Regards,
Hartley

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

* [PATCH v2 3/5] ARM: ep93xx: increase NR_BANKS to 16 for support of 128MB RAM
  2011-06-13 17:43   ` H Hartley Sweeten
@ 2011-06-17 10:32     ` Petr Štetiar
  2011-07-09  8:20       ` Petr Štetiar
  0 siblings, 1 reply; 14+ messages in thread
From: Petr Štetiar @ 2011-06-17 10:32 UTC (permalink / raw)
  To: linux-arm-kernel

H Hartley Sweeten <hartleys@visionengravers.com> [2011-06-13 12:43:25]:

> On Sunday, June 12, 2011 8:05 AM, Petr ?tetiar wrote:
> >
> > I've got hands on one ts-7300 board, which is equiped with 128MB RAM in two
> > 64MB memory chips, so it's 16 banks/8MB each. Without this patch, the bootmem
> > init code complains about small NR_BANKS number and only lower 64MB is
> > accessible.
> >
> > Cc: Russell King <linux@arm.linux.org.uk>
> > Cc: Hartley Sweeten <hsweeten@visionengravers.com>
> > Cc: Ryan Mallon <ryan@bluewatersys.com>
> > Signed-off-by: Petr ?tetiar <ynezz@true.cz>
> > ---
> >  arch/arm/include/asm/setup.h |    6 +++++-
> >  1 files changed, 5 insertions(+), 1 deletions(-)
> > 
> > diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
> > index ee2ad8a..b13720d 100644
> > --- a/arch/arm/include/asm/setup.h
> > +++ b/arch/arm/include/asm/setup.h
> > @@ -192,7 +192,11 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
> >  /*
> >   * Memory map description
> >   */
> > -#define NR_BANKS 8
> > +#ifdef CONFIG_ARCH_EP93XX
> > +# define NR_BANKS 16
> > +#else
> > +# define NR_BANKS 8
> > +#endif
> >  
> >  struct membank {
> >  	phys_addr_t start;
> 
> I would like Russell's opinion on this patch before it's accepted into his
> Patch Tracker.
> 
> But, as far as the ep93xx support goes...
> 
> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Hello Russell,

could I kindly ask you about your opinnion on this patch? Thanks a lot.

-- ynezz

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

* [PATCH v2 3/5] ARM: ep93xx: increase NR_BANKS to 16 for support of 128MB RAM
  2011-06-17 10:32     ` Petr Štetiar
@ 2011-07-09  8:20       ` Petr Štetiar
  2011-07-09  8:20         ` Russell King - ARM Linux
  0 siblings, 1 reply; 14+ messages in thread
From: Petr Štetiar @ 2011-07-09  8:20 UTC (permalink / raw)
  To: linux-arm-kernel

Petr ?tetiar <ynezz@true.cz> [2011-06-17 12:32:49]:

> H Hartley Sweeten <hartleys@visionengravers.com> [2011-06-13 12:43:25]:
> 
> > On Sunday, June 12, 2011 8:05 AM, Petr ?tetiar wrote:
> > >
> > > I've got hands on one ts-7300 board, which is equiped with 128MB RAM in two
> > > 64MB memory chips, so it's 16 banks/8MB each. Without this patch, the bootmem
> > > init code complains about small NR_BANKS number and only lower 64MB is
> > > accessible.
> > >
> > > Cc: Russell King <linux@arm.linux.org.uk>
> > > Cc: Hartley Sweeten <hsweeten@visionengravers.com>
> > > Cc: Ryan Mallon <ryan@bluewatersys.com>
> > > Signed-off-by: Petr ?tetiar <ynezz@true.cz>
> > > ---
> > >  arch/arm/include/asm/setup.h |    6 +++++-
> > >  1 files changed, 5 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
> > > index ee2ad8a..b13720d 100644
> > > --- a/arch/arm/include/asm/setup.h
> > > +++ b/arch/arm/include/asm/setup.h
> > > @@ -192,7 +192,11 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
> > >  /*
> > >   * Memory map description
> > >   */
> > > -#define NR_BANKS 8
> > > +#ifdef CONFIG_ARCH_EP93XX
> > > +# define NR_BANKS 16
> > > +#else
> > > +# define NR_BANKS 8
> > > +#endif
> > >  
> > >  struct membank {
> > >  	phys_addr_t start;
> > 
> > I would like Russell's opinion on this patch before it's accepted into his
> > Patch Tracker.
> > 
> > But, as far as the ep93xx support goes...
> > 
> > Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> 
> Hello Russell,
> 
> could I kindly ask you about your opinnion on this patch? Thanks a lot.

Ping. Thanks a lot.

-- ynezz

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

* [PATCH v2 3/5] ARM: ep93xx: increase NR_BANKS to 16 for support of 128MB RAM
  2011-07-09  8:20       ` Petr Štetiar
@ 2011-07-09  8:20         ` Russell King - ARM Linux
  0 siblings, 0 replies; 14+ messages in thread
From: Russell King - ARM Linux @ 2011-07-09  8:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jul 09, 2011 at 10:20:08AM +0200, Petr ?tetiar wrote:
> Petr ?tetiar <ynezz@true.cz> [2011-06-17 12:32:49]:
> 
> > H Hartley Sweeten <hartleys@visionengravers.com> [2011-06-13 12:43:25]:
> > 
> > > On Sunday, June 12, 2011 8:05 AM, Petr ?tetiar wrote:
> > > >
> > > > I've got hands on one ts-7300 board, which is equiped with 128MB RAM in two
> > > > 64MB memory chips, so it's 16 banks/8MB each. Without this patch, the bootmem
> > > > init code complains about small NR_BANKS number and only lower 64MB is
> > > > accessible.
> > > >
> > > > Cc: Russell King <linux@arm.linux.org.uk>
> > > > Cc: Hartley Sweeten <hsweeten@visionengravers.com>
> > > > Cc: Ryan Mallon <ryan@bluewatersys.com>
> > > > Signed-off-by: Petr ?tetiar <ynezz@true.cz>
> > > > ---
> > > >  arch/arm/include/asm/setup.h |    6 +++++-
> > > >  1 files changed, 5 insertions(+), 1 deletions(-)
> > > > 
> > > > diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
> > > > index ee2ad8a..b13720d 100644
> > > > --- a/arch/arm/include/asm/setup.h
> > > > +++ b/arch/arm/include/asm/setup.h
> > > > @@ -192,7 +192,11 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
> > > >  /*
> > > >   * Memory map description
> > > >   */
> > > > -#define NR_BANKS 8
> > > > +#ifdef CONFIG_ARCH_EP93XX
> > > > +# define NR_BANKS 16
> > > > +#else
> > > > +# define NR_BANKS 8
> > > > +#endif
> > > >  
> > > >  struct membank {
> > > >  	phys_addr_t start;
> > > 
> > > I would like Russell's opinion on this patch before it's accepted into his
> > > Patch Tracker.
> > > 
> > > But, as far as the ep93xx support goes...
> > > 
> > > Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> > 
> > Hello Russell,
> > 
> > could I kindly ask you about your opinnion on this patch? Thanks a lot.
> 
> Ping. Thanks a lot.

It's fine.

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

end of thread, other threads:[~2011-07-09  8:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-12 15:04 [PATCH v2 0/5] ep93xx/ts72xx patches Petr Štetiar
2011-06-12 15:04 ` [PATCH v2 1/5] ARM: ep93xx: use more reliable CPLD watchdog for reset on ts72xx Petr Štetiar
2011-06-13 17:39   ` H Hartley Sweeten
2011-06-12 15:04 ` [PATCH v2 2/5] ARM: ep93xx: add model detection for ts-7300 and ts-7400 boards Petr Štetiar
2011-06-13 17:40   ` H Hartley Sweeten
2011-06-12 15:04 ` [PATCH v2 3/5] ARM: ep93xx: increase NR_BANKS to 16 for support of 128MB RAM Petr Štetiar
2011-06-13 17:43   ` H Hartley Sweeten
2011-06-17 10:32     ` Petr Štetiar
2011-07-09  8:20       ` Petr Štetiar
2011-07-09  8:20         ` Russell King - ARM Linux
2011-06-12 15:04 ` [PATCH v2 4/5] ARM: ep93xx: fix inverted RTS/DTR signals on uart1 Petr Štetiar
2011-06-13 17:38   ` H Hartley Sweeten
2011-06-12 15:05 ` [PATCH v2 5/5] ARM: ep93xx: ts72xx: fix board model detection Petr Štetiar
2011-06-13 17:47   ` H Hartley Sweeten

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).