mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: "Pali Rohár" <pali@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Nick Child <nick.child@ibm.com>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc: Add support for early debugging via Serial 16550 console
Date: Fri, 19 Aug 2022 15:43:18 -0700	[thread overview]
Message-ID: <ed703de5-2260-8cd5-4e28-2f7986b407d5@infradead.org> (raw)
In-Reply-To: <20220819223848.lvxakjjzfdjvyqgu@pali>



On 8/19/22 15:38, Pali Rohár wrote:
> On Friday 19 August 2022 15:34:14 Randy Dunlap wrote:
>> Hi--
>>
>> On 8/19/22 14:12, Pali Rohár wrote:
>>> Currently powerpc early debugging contains lot of platform specific
>>> options, but does not support standard UART / serial 16550 console.
>>>
>>> Later legacy_serial.c code supports registering UART as early debug console
>>> from device tree but it is not early during booting, but rather later after
>>> machine description code finishes.
>>>
>>> So for real early debugging via UART is current code unsuitable.
>>>
>>> Add support for new early debugging option CONFIG_PPC_EARLY_DEBUG_16550
>>> which enable Serial 16550 console on address defined by new option
>>> CONFIG_PPC_EARLY_DEBUG_16550_PHYSADDR and by stride by option
>>> CONFIG_PPC_EARLY_DEBUG_16550_STRIDE.
>>>
>>> With this change it is possible to debug powerpc machine descriptor code.
>>> For example this early debugging code can print on serial console also
>>> "No suitable machine description found" error which is done before
>>> legacy_serial.c code.
>>>
>>> Signed-off-by: Pali Rohár <pali@kernel.org>
>>> ---
>>> Tested on P2020 board. It allowed me do debug and implement this patch series:
>>> https://lore.kernel.org/linuxppc-dev/20220819191557.28116-1-pali@kernel.org/
>>> ---
>>>  arch/powerpc/Kconfig.debug       | 14 ++++++++++++++
>>>  arch/powerpc/include/asm/udbg.h  |  1 +
>>>  arch/powerpc/kernel/udbg.c       |  2 ++
>>>  arch/powerpc/kernel/udbg_16550.c | 33 ++++++++++++++++++++++++++++++++
>>>  4 files changed, 50 insertions(+)
>>>
>>> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
>>> index 9f363c143d86..a4e7d90a45d2 100644
>>> --- a/arch/powerpc/Kconfig.debug
>>> +++ b/arch/powerpc/Kconfig.debug
>>> @@ -276,6 +276,11 @@ config PPC_EARLY_DEBUG_OPAL_HVSI
>>>  	  Select this to enable early debugging for the PowerNV platform
>>>  	  using an "hvsi" console
>>>  
>>> +config PPC_EARLY_DEBUG_16550
>>> +	bool "Serial 16550"
>>> +	help
>>> +	  Select this to enable early debugging via Serial 16550 console
>>> +
>>>  config PPC_EARLY_DEBUG_MEMCONS
>>>  	bool "In memory console"
>>>  	help
>>> @@ -355,6 +360,15 @@ config PPC_EARLY_DEBUG_CPM_ADDR
>>>  	  platform probing is done, all platforms selected must
>>>  	  share the same address.
>>>  
>>> +config PPC_EARLY_DEBUG_16550_PHYSADDR
>>> +	hex "Early debug Serial 16550 physical address"
>>> +	depends on PPC_EARLY_DEBUG_16550
>>
>> Is there any chance that you could provide a default value here
>> so that 'make olddefconfig' does not end up like it does
>> without having a default value?
> 
> No. Because there is not any default value. Physical address of 16550 is
> hardly HW dependent. Possibly also bootloader dependent (if it can remap
> peripherals to different physical addresses).
> 
> User _has to_ specify correct physical address if want to use early
> debug 16550 console.

OK, we'll see if it ever causes a real problem then...

>> CONFIG_PPC_EARLY_DEBUG_16550=y
>> # CONFIG_PPC_EARLY_DEBUG_MEMCONS is not set
>> CONFIG_PPC_EARLY_DEBUG_16550_PHYSADDR=
>> CONFIG_PPC_EARLY_DEBUG_16550_STRIDE=1
>>
>> which then causes a kconfig prompt when starting
>> the build...
> 
> Cannot we set somehow that PPC_EARLY_DEBUG_16550 would be disabled by
> default when upgrading defconfig?

Don't know about that.

Thanks.
-- 
~Randy

  reply	other threads:[~2022-08-19 22:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19 21:12 Pali Rohár
2022-08-19 22:34 ` Randy Dunlap
2022-08-19 22:38   ` Pali Rohár
2022-08-19 22:43     ` Randy Dunlap [this message]
2022-08-22 14:14       ` Christophe Leroy
2022-08-22 14:13     ` Christophe Leroy
2022-08-22 15:28       ` Pali Rohár
2022-08-22 14:09   ` Christophe Leroy
2022-08-22 14:25 ` Christophe Leroy
2022-08-22 15:33   ` Pali Rohár
2022-08-22 16:21     ` Gabriel Paubert
2022-08-22 23:15 ` [PATCH v2] " Pali Rohár
2022-09-24 12:10   ` Pali Rohár

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=ed703de5-2260-8cd5-4e28-2f7986b407d5@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nick.child@ibm.com \
    --cc=pali@kernel.org \
    --cc=paulus@samba.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

all inboxes | Powered by JetHome®