powerpc: Remove UDBG_RTAS_CONSOLE
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 18 Dec 2024 10:55:07 +0000 (21:55 +1100)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Wed, 26 Feb 2025 15:45:09 +0000 (21:15 +0530)
The IBM Cell blade support was the last user of UDBG_RTAS_CONSOLE.

Although it's still possible to build it via
PPC_EARLY_DEBUG_UDBG_RTAS_CONSOLE, AFAIK it's not useful on any
other platfoms, because only Cell and JS20 era machines provided the
RTAS get/put-term-char functions.

If anyone is using it or needs it we can always resurrect it from git.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20241218105523.416573-19-mpe@ellerman.id.au
arch/powerpc/Kconfig.debug
arch/powerpc/kernel/rtas.c
arch/powerpc/kernel/udbg.c
arch/powerpc/platforms/Kconfig

index 20d05605fa83ff9bb7c9d42485c623bbcfa3a7c5..f15e5920080ba5e2b5058ead26d67887c9c1a268 100644 (file)
@@ -216,13 +216,6 @@ config PPC_EARLY_DEBUG_RTAS_PANEL
        help
          Select this to enable early debugging via the RTAS panel.
 
-config PPC_EARLY_DEBUG_RTAS_CONSOLE
-       bool "RTAS Console"
-       depends on PPC_RTAS
-       select UDBG_RTAS_CONSOLE
-       help
-         Select this to enable early debugging via the RTAS console.
-
 config PPC_EARLY_DEBUG_PAS_REALMODE
        bool "PA Semi real mode"
        depends on PPC_PASEMI
index d31c9799cab283e248ee349c5e14c018028d56eb..d7a738f1858d4bf9d9aac5ad14166fbd31f90633 100644 (file)
@@ -798,66 +798,6 @@ void __init udbg_init_rtas_panel(void)
        udbg_putc = call_rtas_display_status_delay;
 }
 
-#ifdef CONFIG_UDBG_RTAS_CONSOLE
-
-/* If you think you're dying before early_init_dt_scan_rtas() does its
- * work, you can hard code the token values for your firmware here and
- * hardcode rtas.base/entry etc.
- */
-static unsigned int rtas_putchar_token = RTAS_UNKNOWN_SERVICE;
-static unsigned int rtas_getchar_token = RTAS_UNKNOWN_SERVICE;
-
-static void udbg_rtascon_putc(char c)
-{
-       int tries;
-
-       if (!rtas.base)
-               return;
-
-       /* Add CRs before LFs */
-       if (c == '\n')
-               udbg_rtascon_putc('\r');
-
-       /* if there is more than one character to be displayed, wait a bit */
-       for (tries = 0; tries < 16; tries++) {
-               if (rtas_call(rtas_putchar_token, 1, 1, NULL, c) == 0)
-                       break;
-               udelay(1000);
-       }
-}
-
-static int udbg_rtascon_getc_poll(void)
-{
-       int c;
-
-       if (!rtas.base)
-               return -1;
-
-       if (rtas_call(rtas_getchar_token, 0, 2, &c))
-               return -1;
-
-       return c;
-}
-
-static int udbg_rtascon_getc(void)
-{
-       int c;
-
-       while ((c = udbg_rtascon_getc_poll()) == -1)
-               ;
-
-       return c;
-}
-
-
-void __init udbg_init_rtas_console(void)
-{
-       udbg_putc = udbg_rtascon_putc;
-       udbg_getc = udbg_rtascon_getc;
-       udbg_getc_poll = udbg_rtascon_getc_poll;
-}
-#endif /* CONFIG_UDBG_RTAS_CONSOLE */
-
 void rtas_progress(char *s, unsigned short hex)
 {
        struct device_node *root;
@@ -2135,21 +2075,6 @@ int __init early_init_dt_scan_rtas(unsigned long node,
                rtas.size = *sizep;
        }
 
-#ifdef CONFIG_UDBG_RTAS_CONSOLE
-       basep = of_get_flat_dt_prop(node, "put-term-char", NULL);
-       if (basep)
-               rtas_putchar_token = *basep;
-
-       basep = of_get_flat_dt_prop(node, "get-term-char", NULL);
-       if (basep)
-               rtas_getchar_token = *basep;
-
-       if (rtas_putchar_token != RTAS_UNKNOWN_SERVICE &&
-           rtas_getchar_token != RTAS_UNKNOWN_SERVICE)
-               udbg_init_rtas_console();
-
-#endif
-
        /* break now */
        return 1;
 }
index 0a72a537f879e5c2ab732ec215a8b2ceef473967..862b22b2b616dc76d6b06a318179b9996c32e3a5 100644 (file)
@@ -36,9 +36,6 @@ void __init udbg_early_init(void)
 #elif defined(CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL)
        /* RTAS panel debug */
        udbg_init_rtas_panel();
-#elif defined(CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE)
-       /* RTAS console debug */
-       udbg_init_rtas_console();
 #elif defined(CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE)
        udbg_init_pas_realmode();
 #elif defined(CONFIG_PPC_EARLY_DEBUG_BOOTX)
index b78c132d47ab0c20afc97612e17bddb81ef3e2db..fea3766eac0f311cb983757ad798aa299a18309e 100644 (file)
@@ -70,10 +70,6 @@ config PPC_DT_CPU_FTRS
          firmware provides this binding.
          If you're not sure say Y.
 
-config UDBG_RTAS_CONSOLE
-       bool "RTAS based debug console"
-       depends on PPC_RTAS
-
 config PPC_SMP_MUXED_IPI
        bool
        help