linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: khilman@deeprootsystems.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
Date: Tue, 19 Jan 2010 09:19:35 -0800	[thread overview]
Message-ID: <1263921575.3376.13.camel@localhost> (raw)
In-Reply-To: <FCCFB4CDC6E5564B9182F639FC356087030070F293@dbde02.ent.ti.com>

On Tue, 2010-01-19 at 06:56 +0530, Pandita, Vikram wrote:
> 
> >-----Original Message-----
> >From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of Tony
> >Lindgren
> >Sent: Friday, January 15, 2010 7:35 PM
> >To: linux-arm-kernel at lists.infradead.org
> >Cc: linux-omap at vger.kernel.org
> >Subject: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
> 
> UART_SCR 		-> this is the scratchpad register 
> UART_OMAP_SCR	-> This is TI-only Supplementary control register
> 
> You probably confused the two (as rightly so since SCR is same name).
> So there is no need to save/restore the UART_SCR register as you have done, see inlined -- 
> 
> >
> >Define arch_decomp_setup() the same way as some other
> >architectures do. Use arch_id to configure the debug uart
> >based on the machine_is by storing it into the uart
> >scratchpad register for DEBUG_LL code to use.
> >
> >Signed-off-by: Tony Lindgren <tony@atomide.com>
> <snip>
> >--- a/arch/arm/mach-omap2/serial.c
> >+++ b/arch/arm/mach-omap2/serial.c
> >@@ -161,11 +161,22 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
> > static inline void __init omap_uart_reset(struct omap_uart_state *uart)
> > {
> > 	struct plat_serial8250_port *p = uart->p;
> >+	u8 scratchpad = 0;
> >+
> >+	/*
> >+	 * Save UART1 scratchpad register value for UART1 for DEBUG_LL.
> >+	 * See also include/plat/uncompress.h and include/mach/debug-macro.S.
> >+	 */
> >+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
> >+		scratchpad = serial_read_reg(p, UART_SCR);
> 
> No need to save and restore the UART_SCR register. 
> This never gets used in this function.
> 
> What gets used is UART_OMAP_SCR which is OMAP specific supplimantry control register 
> and not scratchpad.
> 
> >
> > 	serial_write_reg(p, UART_OMAP_MDR1, 0x07);
> > 	serial_write_reg(p, UART_OMAP_SCR, 0x08);
> > 	serial_write_reg(p, UART_OMAP_MDR1, 0x00);
> > 	serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0));
> >+
> >+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
> >+		serial_write_reg(p, UART_SCR, scratchpad);
> 
> Remove this as well. No need. 
> 
> 
> <snip>
> >diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-
> >omap/include/plat/uncompress.h
> >index 13c305d..479bac8 100644
> >--- a/arch/arm/plat-omap/include/plat/uncompress.h
> >+++ b/arch/arm/plat-omap/include/plat/uncompress.h
> >@@ -19,62 +19,36 @@
> >
> > #include <linux/types.h>
> > #include <linux/serial_reg.h>
> >+
> >+#include <asm/mach-types.h>
> >+
> > #include <plat/serial.h>
> >
> >-unsigned int system_rev;
> >+static volatile u8 *uart1_base;
> >+static volatile u8 *uart_base;
> >+static volatile int uart_shift;
> 
> Just like uart_base is stored in scratchpad,
> Somehow the uart_shift also needs to be stored so that boards with different uart_shift requirements can be addressed. Where can we store this another variable? 

Since the base addresses are aligned, how about store the shift in the
least-significant 2 bits, and the rest is the base address.

Kevin

> <snip>
> 
> > /*
> >+ * Macros to configure UART1 and debug UART
> >+ */
> >+#define _DEBUG_LL_ENTRY(mach, uart1, dbg_uart, shift, dbg_id, reset_fn)	\
> >+	if (machine_is_##mach()) {					\
> >+		uart1_base = (volatile u8 *)(uart1);			\
> >+		uart_base = (volatile u8 *)(dbg_uart);			\
> >+		uart_shift = (shift);					\
> >+		port = (dbg_id);					\
> >+		reset_fn;						\
> >+		break;							\
> >+	}
> 
> Nice Idea... you are the man !!
> 
> <snip>
> NrybX?v^)?{.n+{f{ay
??,j\afhz
w\f
j:+vwjm\azZ+?j"!

  reply	other threads:[~2010-01-19 17:19 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-16  1:35 [PATCH 0/4] omap multiboot improvments for merge window after 2.6.34 Tony Lindgren
2010-01-16  1:35 ` [PATCH 1/4] omap: Clean the serial port defines Tony Lindgren
2010-01-16  7:48   ` Shilimkar, Santosh
2010-01-16 19:25     ` Tony Lindgren
2010-01-16 19:33       ` Shilimkar, Santosh
2010-01-16 20:03         ` Tony Lindgren
2010-01-19  0:39   ` Pandita, Vikram
2010-01-20 23:10     ` Tony Lindgren
2010-01-16  1:35 ` [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic Tony Lindgren
2010-01-16  9:35   ` Russell King - ARM Linux
2010-01-16 19:18     ` Tony Lindgren
2010-01-16 19:33       ` Russell King - ARM Linux
2010-01-16 20:00         ` Tony Lindgren
2010-01-19  1:50           ` Pandita, Vikram
2010-01-22  3:07             ` [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2 Tony Lindgren
2010-01-22 14:48               ` Pandita, Vikram
2010-01-22 20:55                 ` Tony Lindgren
2010-01-22 20:58                   ` Pandita, Vikram
2010-01-22 21:10                     ` Tony Lindgren
2010-01-22 23:10                       ` Pandita, Vikram
2010-01-23 17:13                         ` Tony Lindgren
2010-01-21 19:03         ` [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic Tony Lindgren
2010-01-16 11:04   ` Shilimkar, Santosh
2010-01-16 19:20     ` Tony Lindgren
2010-01-16 19:34       ` Shilimkar, Santosh
2010-01-19  1:26   ` Pandita, Vikram
2010-01-19 17:19     ` Kevin Hilman [this message]
2010-01-26 17:22     ` Tony Lindgren
2010-01-16  1:35 ` [PATCH 3/4] omap: Remove old DEBUG_LL serial port options Tony Lindgren
2010-01-16  1:35 ` [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot Tony Lindgren
2010-01-16 11:24   ` Shilimkar, Santosh
2010-01-16 11:55   ` Russell King - ARM Linux
2010-01-16 19:12     ` Tony Lindgren
2010-01-22 20:39     ` [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot, v2 Tony Lindgren
2010-01-22 20:56       ` Russell King - ARM Linux
2010-01-22 21:09         ` Tony Lindgren
2010-01-22 21:16           ` Tony Lindgren
2010-01-16 20:15 ` [PATCH 0/4] omap multiboot improvments for merge window after 2.6.34 Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1263921575.3376.13.camel@localhost \
    --to=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).