From: Nicholas Piggin <npiggin@gmail.com>
To: Paul Mackerras <paulus@ozlabs.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH v2 5/9] powerpc/microwatt: Use standard 16550 UART for console
Date: Sat, 19 Jun 2021 12:58:48 +1000 [thread overview]
Message-ID: <1624071299.ppzoru83yx.astroid@bobo.none> (raw)
In-Reply-To: <YMyNpLwqttl4IGSH@thinks.paulus.ozlabs.org>
Excerpts from Paul Mackerras's message of June 18, 2021 10:12 pm:
> On Fri, Jun 18, 2021 at 05:40:40PM +1000, Nicholas Piggin wrote:
>> Excerpts from Paul Mackerras's message of June 18, 2021 1:46 pm:
>> > From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> >
>> > This adds support to the Microwatt platform to use the standard
>> > 16550-style UART which available in the standalone Microwatt FPGA.
>> >
>> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> > Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
> ...
>> > +#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;
>> > +}
>>
>> Why is realmode required? No cache inhibited mappings yet?
>
> Because it's EARLY debug, for use in the very early stages of boot
> when the kernel's radix tree may or may not have been initialized.
> The easiest way to make a function that works correctly whether or not
> the radix tree has been initialized and the MMU turned on is to
> temporarily turn off the MMU for data accesses and use lbzcix/stbcix
Ah makes sense.
> (which Microwatt has, even though it doesn't implement hypervisor
> mode).
>
> (I don't know which "yet" you meant - "yet" in the process of booting a
> kernel, or "yet" in the process of Microwatt's development? Microwatt
> certainly does have cache-inhibited mappings and has done since the
> MMU was first introduced.)
I did mean mappings to the UART, but good to get both answers :D
>
> In fact the defconfig I add later in the series doesn't enable
> CONFIG_PPC_EARLY_DEBUG_MICROWATT, but it's there if it's needed for
> debugging.
>
>> mtmsrd with L=0 is defined to be context synchronizing in isa 3, so I
>> don't think the isync would be required. There is a bit of code around
>> arch/powerpc that does this, maybe it used to be needed or some other
>> implementations needed it?
>>
>> That's just for my curiosity, it doesn't really hurt to have them
>> there.
>
> Right, and in fact mtmsrd is marked as a single-issue instruction in
> Microwatt, so it should work with no isyncs or eieios. Presumably Ben
> copied the isync/eieio pattern from somewhere else.
Makes sense. Well I don't have any objection to the series.
Thanks,
Nick
next prev parent reply other threads:[~2021-06-19 2:59 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-18 3:42 [PATCH v2 0/9] powerpc: Add support for Microwatt soft-core Paul Mackerras
2021-06-18 3:43 ` [PATCH v2 1/9] powerpc: Add Microwatt platform Paul Mackerras
2021-06-19 3:03 ` Nicholas Piggin
2021-06-18 3:44 ` [PATCH v2 2/9] powerpc: Add Microwatt device tree Paul Mackerras
2021-06-19 14:26 ` Segher Boessenkool
2021-06-20 12:08 ` Paul Mackerras
2021-06-21 13:54 ` Segher Boessenkool
2021-06-18 3:45 ` [PATCH v2 3/9] powerpc/microwatt: Populate platform bus from device-tree Paul Mackerras
2021-06-18 3:45 ` [PATCH v2 4/9] powerpc/xics: Add a native ICS backend for microwatt Paul Mackerras
2021-06-18 3:46 ` [PATCH v2 5/9] powerpc/microwatt: Use standard 16550 UART for console Paul Mackerras
2021-06-18 7:40 ` Nicholas Piggin
2021-06-18 12:12 ` Paul Mackerras
2021-06-19 2:58 ` Nicholas Piggin [this message]
2021-08-12 13:14 ` Christophe Leroy
2021-08-12 16:09 ` Segher Boessenkool
2021-06-18 3:47 ` [PATCH v2 6/9] powerpc/microwatt: Add support for hardware random number generator Paul Mackerras
2021-06-19 3:08 ` Nicholas Piggin
2021-06-19 14:36 ` Segher Boessenkool
2021-06-20 8:19 ` Nicholas Piggin
2021-06-18 3:48 ` [PATCH v2 7/9] powerpc/microwatt: Add microwatt_defconfig Paul Mackerras
2021-06-18 3:49 ` [PATCH v2 8/9] powerpc/boot: Fixup device-tree on little endian Paul Mackerras
2021-06-19 3:14 ` Nicholas Piggin
2021-06-18 3:49 ` [PATCH v2 9/9] powerpc/boot: Add a boot wrapper for Microwatt Paul Mackerras
2021-06-19 3:16 ` Nicholas Piggin
2021-06-19 14:45 ` [PATCH v2 0/9] powerpc: Add support for Microwatt soft-core Segher Boessenkool
2021-06-24 14:03 ` Michael Ellerman
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=1624071299.ppzoru83yx.astroid@bobo.none \
--to=npiggin@gmail.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@ozlabs.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).