All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Paul Bolle <pebolle@tiscali.nl>,
	Russell King <linux@arm.linux.org.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: remove check for CONFIG_DEBUG_LL_SER3
Date: Wed, 14 May 2014 12:28:25 +0200	[thread overview]
Message-ID: <4192716.enNWAQ0hz5@wuerfel> (raw)
In-Reply-To: <1400055127.31197.1.camel@x220>

On Wednesday 14 May 2014 10:12:07 Paul Bolle wrote:
>  #if defined(CONFIG_ARCH_SA1100)
>                 .macro  loadsp, rb, tmp
>                 mov     \rb, #0x80000000        @ physical base address
> -#ifdef CONFIG_DEBUG_LL_SER3
> -               add     \rb, \rb, #0x00050000   @ Ser3
> -#else
>                 add     \rb, \rb, #0x00010000   @ Ser1
> -#endif
>                 .endm
>  #elif defined(CONFIG_ARCH_S3C24XX)
>                 .macro loadsp, rb, tmp

I wonder if the entire CONFIG_ARCH_SA1100 section here is actually needed
at all, or if it should just use the #else path that calls addruart, which
is defined as

                .macro  addruart, rp, rv, tmp
                mrc     p15, 0, \rp, c1, c0
                tst     \rp, #1                 @ MMU enabled?
                moveq   \rp, #0x80000000        @ physical base address
                movne   \rp, #0xf8000000        @ virtual address

                @ We probe for the active serial port here, coherently with
                @ the comment in arch/arm/mach-sa1100/include/mach/uncompress.h.
                @ We assume r1 can be clobbered.

                @ see if Ser3 is active
                add     \rp, \rp, #0x00050000
                ldr     \rv, [\rp, #UTCR3]
                tst     \rv, #UTCR3_TXE

                @ if Ser3 is inactive, then try Ser1
                addeq   \rp, \rp, #(0x00010000 - 0x00050000)
                ldreq   \rv, [\rp, #UTCR3]
                tsteq   \rv, #UTCR3_TXE

                @ if Ser1 is inactive, then try Ser2
                addeq   \rp, \rp, #(0x00030000 - 0x00010000)
                ldreq   \rv, [\rp, #UTCR3]
                tsteq   \rv, #UTCR3_TXE

                @ clear top bits, and generate both phys and virt addresses
                lsl     \rp, \rp, #8
                lsr     \rp, \rp, #8
                orr     \rv, \rp, #0xf8000000   @ virtual
                orr     \rp, \rp, #0x80000000   @ physical

                .endm


There is a CONFIG_ARCH_S3C24XX case just below it, and I'm pretty
sure that one can be removed, because the loadsp implementation
for s3c24xx is basically the same as the addruart code.

Russell removed most of the other cases in 5cd0c3442021 "ARM:
decompressor: use platform debug macros", but I can't find an
explanation for why s3c24xx, sa1100 and iop331 were left at the
time.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: remove check for CONFIG_DEBUG_LL_SER3
Date: Wed, 14 May 2014 12:28:25 +0200	[thread overview]
Message-ID: <4192716.enNWAQ0hz5@wuerfel> (raw)
In-Reply-To: <1400055127.31197.1.camel@x220>

On Wednesday 14 May 2014 10:12:07 Paul Bolle wrote:
>  #if defined(CONFIG_ARCH_SA1100)
>                 .macro  loadsp, rb, tmp
>                 mov     \rb, #0x80000000        @ physical base address
> -#ifdef CONFIG_DEBUG_LL_SER3
> -               add     \rb, \rb, #0x00050000   @ Ser3
> -#else
>                 add     \rb, \rb, #0x00010000   @ Ser1
> -#endif
>                 .endm
>  #elif defined(CONFIG_ARCH_S3C24XX)
>                 .macro loadsp, rb, tmp

I wonder if the entire CONFIG_ARCH_SA1100 section here is actually needed
at all, or if it should just use the #else path that calls addruart, which
is defined as

                .macro  addruart, rp, rv, tmp
                mrc     p15, 0, \rp, c1, c0
                tst     \rp, #1                 @ MMU enabled?
                moveq   \rp, #0x80000000        @ physical base address
                movne   \rp, #0xf8000000        @ virtual address

                @ We probe for the active serial port here, coherently with
                @ the comment in arch/arm/mach-sa1100/include/mach/uncompress.h.
                @ We assume r1 can be clobbered.

                @ see if Ser3 is active
                add     \rp, \rp, #0x00050000
                ldr     \rv, [\rp, #UTCR3]
                tst     \rv, #UTCR3_TXE

                @ if Ser3 is inactive, then try Ser1
                addeq   \rp, \rp, #(0x00010000 - 0x00050000)
                ldreq   \rv, [\rp, #UTCR3]
                tsteq   \rv, #UTCR3_TXE

                @ if Ser1 is inactive, then try Ser2
                addeq   \rp, \rp, #(0x00030000 - 0x00010000)
                ldreq   \rv, [\rp, #UTCR3]
                tsteq   \rv, #UTCR3_TXE

                @ clear top bits, and generate both phys and virt addresses
                lsl     \rp, \rp, #8
                lsr     \rp, \rp, #8
                orr     \rv, \rp, #0xf8000000   @ virtual
                orr     \rp, \rp, #0x80000000   @ physical

                .endm


There is a CONFIG_ARCH_S3C24XX case just below it, and I'm pretty
sure that one can be removed, because the loadsp implementation
for s3c24xx is basically the same as the addruart code.

Russell removed most of the other cases in 5cd0c3442021 "ARM:
decompressor: use platform debug macros", but I can't find an
explanation for why s3c24xx, sa1100 and iop331 were left at the
time.

	Arnd

  reply	other threads:[~2014-05-14 10:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14  8:12 [PATCH] ARM: remove check for CONFIG_DEBUG_LL_SER3 Paul Bolle
2014-05-14  8:12 ` Paul Bolle
2014-05-14 10:28 ` Arnd Bergmann [this message]
2014-05-14 10:28   ` Arnd Bergmann
2022-09-28  6:42 Geert Uytterhoeven
2022-09-28  6:42 ` Geert Uytterhoeven
2022-10-04  7:44 ` Linus Walleij
2022-10-04  7:44   ` Linus Walleij
2022-10-04  7:48   ` Geert Uytterhoeven
2022-10-04  7:48     ` Geert Uytterhoeven
2022-10-04 18:55     ` Paul Bolle
2022-10-04 18:55       ` Paul Bolle

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=4192716.enNWAQ0hz5@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=pebolle@tiscali.nl \
    /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 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.