* [PATCH] powerpc/microwatt: Remove unused early debug code
@ 2022-09-19 5:27 Michael Ellerman
2022-09-19 5:36 ` Andrew Donnellan
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Michael Ellerman @ 2022-09-19 5:27 UTC (permalink / raw)
To: linuxppc-dev; +Cc: lukas.bulwahn, andrew.donnellan
The original microwatt submission[1] included some early debug code for
using the Microwatt "potato" UART.
The series that was eventually merged switched to using a standard UART,
and so doesn't need any special early debug handling. But some of the
original code was merged accidentally under the non-existent
CONFIG_PPC_EARLY_DEBUG_MICROWATT.
Drop the unused code.
1: https://lore.kernel.org/linuxppc-dev/20200509050340.GD1464954@thinks.paulus.ozlabs.org/
Fixes: 48b545b8018d ("powerpc/microwatt: Use standard 16550 UART for console")
Reported-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/kernel/udbg_16550.c | 39 --------------------------------
1 file changed, 39 deletions(-)
diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
index d3942de254c6..ddfbc74bf85f 100644
--- a/arch/powerpc/kernel/udbg_16550.c
+++ b/arch/powerpc/kernel/udbg_16550.c
@@ -296,42 +296,3 @@ void __init udbg_init_40x_realmode(void)
}
#endif /* CONFIG_PPC_EARLY_DEBUG_40x */
-
-#ifdef CONFIG_PPC_EARLY_DEBUG_MICROWATT
-
-#define UDBG_UART_MW_ADDR ((void __iomem *)0xc0002000)
-
-static u8 udbg_uart_in_isa300_rm(unsigned int reg)
-{
- uint64_t msr = mfmsr();
- uint8_t c;
-
- mtmsr(msr & ~(MSR_EE|MSR_DR));
- isync();
- eieio();
- c = __raw_rm_readb(UDBG_UART_MW_ADDR + (reg << 2));
- mtmsr(msr);
- isync();
- return c;
-}
-
-static void udbg_uart_out_isa300_rm(unsigned int reg, u8 val)
-{
- uint64_t msr = mfmsr();
-
- mtmsr(msr & ~(MSR_EE|MSR_DR));
- isync();
- eieio();
- __raw_rm_writeb(val, UDBG_UART_MW_ADDR + (reg << 2));
- mtmsr(msr);
- isync();
-}
-
-void __init udbg_init_debug_microwatt(void)
-{
- udbg_uart_in = udbg_uart_in_isa300_rm;
- udbg_uart_out = udbg_uart_out_isa300_rm;
- udbg_use_uart();
-}
-
-#endif /* CONFIG_PPC_EARLY_DEBUG_MICROWATT */
--
2.37.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/microwatt: Remove unused early debug code
2022-09-19 5:27 [PATCH] powerpc/microwatt: Remove unused early debug code Michael Ellerman
@ 2022-09-19 5:36 ` Andrew Donnellan
2022-09-26 6:17 ` Joel Stanley
2022-10-04 13:24 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Donnellan @ 2022-09-19 5:36 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: lukas.bulwahn, andrew.donnellan
On Mon, 2022-09-19 at 15:27 +1000, Michael Ellerman wrote:
> The original microwatt submission[1] included some early debug code
> for
> using the Microwatt "potato" UART.
>
> The series that was eventually merged switched to using a standard
> UART,
> and so doesn't need any special early debug handling. But some of the
> original code was merged accidentally under the non-existent
> CONFIG_PPC_EARLY_DEBUG_MICROWATT.
>
> Drop the unused code.
>
> 1:
> https://lore.kernel.org/linuxppc-dev/20200509050340.GD1464954@thinks.paulus.ozlabs.org/
>
> Fixes: 48b545b8018d ("powerpc/microwatt: Use standard 16550 UART for
> console")
> Reported-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
grep confirms this is indeed dead code.
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/microwatt: Remove unused early debug code
2022-09-19 5:27 [PATCH] powerpc/microwatt: Remove unused early debug code Michael Ellerman
2022-09-19 5:36 ` Andrew Donnellan
@ 2022-09-26 6:17 ` Joel Stanley
2022-10-04 13:24 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Joel Stanley @ 2022-09-26 6:17 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras
Cc: lukas.bulwahn, linuxppc-dev, andrew.donnellan
On Mon, 19 Sept 2022 at 05:28, Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> The original microwatt submission[1] included some early debug code for
> using the Microwatt "potato" UART.
The potato is indeed dead.
>
> The series that was eventually merged switched to using a standard UART,
> and so doesn't need any special early debug handling. But some of the
> original code was merged accidentally under the non-existent
> CONFIG_PPC_EARLY_DEBUG_MICROWATT.
The kconfig never got added, so you're right. Using the "legacy serial
console" must be how we get early console on microwatt? I can't quite
work it out.
May or may not be related to https://github.com/linuxppc/issues/issues/413
>
> Drop the unused code.
>
> 1: https://lore.kernel.org/linuxppc-dev/20200509050340.GD1464954@thinks.paulus.ozlabs.org/
>
> Fixes: 48b545b8018d ("powerpc/microwatt: Use standard 16550 UART for console")
> Reported-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
> arch/powerpc/kernel/udbg_16550.c | 39 --------------------------------
> 1 file changed, 39 deletions(-)
>
> diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
> index d3942de254c6..ddfbc74bf85f 100644
> --- a/arch/powerpc/kernel/udbg_16550.c
> +++ b/arch/powerpc/kernel/udbg_16550.c
> @@ -296,42 +296,3 @@ void __init udbg_init_40x_realmode(void)
> }
>
> #endif /* CONFIG_PPC_EARLY_DEBUG_40x */
> -
> -#ifdef CONFIG_PPC_EARLY_DEBUG_MICROWATT
> -
> -#define UDBG_UART_MW_ADDR ((void __iomem *)0xc0002000)
> -
> -static u8 udbg_uart_in_isa300_rm(unsigned int reg)
> -{
> - uint64_t msr = mfmsr();
> - uint8_t c;
> -
> - mtmsr(msr & ~(MSR_EE|MSR_DR));
> - isync();
> - eieio();
> - c = __raw_rm_readb(UDBG_UART_MW_ADDR + (reg << 2));
> - mtmsr(msr);
> - isync();
> - return c;
> -}
> -
> -static void udbg_uart_out_isa300_rm(unsigned int reg, u8 val)
> -{
> - uint64_t msr = mfmsr();
> -
> - mtmsr(msr & ~(MSR_EE|MSR_DR));
> - isync();
> - eieio();
> - __raw_rm_writeb(val, UDBG_UART_MW_ADDR + (reg << 2));
> - mtmsr(msr);
> - isync();
> -}
> -
> -void __init udbg_init_debug_microwatt(void)
> -{
> - udbg_uart_in = udbg_uart_in_isa300_rm;
> - udbg_uart_out = udbg_uart_out_isa300_rm;
> - udbg_use_uart();
> -}
> -
> -#endif /* CONFIG_PPC_EARLY_DEBUG_MICROWATT */
> --
> 2.37.2
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/microwatt: Remove unused early debug code
2022-09-19 5:27 [PATCH] powerpc/microwatt: Remove unused early debug code Michael Ellerman
2022-09-19 5:36 ` Andrew Donnellan
2022-09-26 6:17 ` Joel Stanley
@ 2022-10-04 13:24 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2022-10-04 13:24 UTC (permalink / raw)
To: linuxppc-dev, Michael Ellerman; +Cc: lukas.bulwahn, andrew.donnellan
On Mon, 19 Sep 2022 15:27:55 +1000, Michael Ellerman wrote:
> The original microwatt submission[1] included some early debug code for
> using the Microwatt "potato" UART.
>
> The series that was eventually merged switched to using a standard UART,
> and so doesn't need any special early debug handling. But some of the
> original code was merged accidentally under the non-existent
> CONFIG_PPC_EARLY_DEBUG_MICROWATT.
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/microwatt: Remove unused early debug code
https://git.kernel.org/powerpc/c/456c3005102b18cce6662b1915c6efffe7744dcc
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-10-04 13:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19 5:27 [PATCH] powerpc/microwatt: Remove unused early debug code Michael Ellerman
2022-09-19 5:36 ` Andrew Donnellan
2022-09-26 6:17 ` Joel Stanley
2022-10-04 13:24 ` Michael Ellerman
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).