linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
Date: Tue, 26 Jan 2010 09:22:21 -0800	[thread overview]
Message-ID: <20100126172221.GB17449@atomide.com> (raw)
In-Reply-To: <FCCFB4CDC6E5564B9182F639FC356087030070F293@dbde02.ent.ti.com>

Hi,

* Pandita, Vikram <vikram.pandita@ti.com> [100118 17:24]:
> 
> 
> >-----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. 

Just to clarify, the uncompress.h code is using the UART_SCR to store the
DEBUG_LL port number based on the machine ID.

The reason this code is not needed is that the earlyprintk code prints
out something already before we get to this code.

If earlyprintk did not print anything before this code, we would need
to save UART_SCR here as the debug serial port gets initialized the first
time something is printed.

Although the code above uses UART_OMAP_SCR and not UART_SCR, it resets
the uart so we lose UART_SCR.

So in any case I've dropped the code above.

Regards,

Tony

  parent reply	other threads:[~2010-01-26 17:22 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
2010-01-26 17:22     ` Tony Lindgren [this message]
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=20100126172221.GB17449@atomide.com \
    --to=tony@atomide.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).