From: Wei Xu <xuwei5@hisilicon.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Linuxarm <linuxarm@huawei.com>,
Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>,
"Zengtao \(B\)" <prime.zeng@hisilicon.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] [PATCH v3] ns16550: Add ACPI support for ARM only
Date: Thu, 20 Feb 2020 17:59:22 +0800 [thread overview]
Message-ID: <5E4E587A.1070807@hisilicon.com> (raw)
In-Reply-To: <d723ed36-a38d-63c3-07ea-97a2c97f6c9c@suse.com>
Hi Jan,
On 2020/2/20 16:33, Jan Beulich wrote:
> On 20.02.2020 08:44, Wei Xu wrote:
>> On 2020/2/17 21:53, Jan Beulich wrote:
>>> On 03.02.2020 12:21, Wei Xu wrote:
>>>> +static int __init ns16550_acpi_uart_init(const void *data)
>>>> +{
>>>> + struct acpi_table_header *table;
>>>> + struct acpi_table_spcr *spcr;
>>>> + acpi_status status;
>>>> + /*
>>>> + * Same as the DT part.
>>>> + * Only support one UART on ARM which happen to be ns16550_com[0].
>>>> + */
>>>> + struct ns16550 *uart = &ns16550_com[0];
>>>> +
>>>> + status = acpi_get_table(ACPI_SIG_SPCR, 0, &table);
>>>> + if ( ACPI_FAILURE(status) )
>>>> + {
>>>> + printk("ns16550: Failed to get SPCR table\n");
>>>> + return -EINVAL;
>>>> + }
>>>> +
>>>> + spcr = container_of(table, struct acpi_table_spcr, header);
>>>> +
>>>> + /*
>>>> + * The serial port address may be 0 for example
>>>> + * if the console redirection is disabled.
>>>> + */
>>>> + if ( unlikely(!spcr->serial_port.address) )
>>>> + {
>>>> + printk("ns16550: the serial port address is invalid\n");
>>>
>>> Is zero really an invalid address, or is it rather a proper
>>> indicator of there not being any device?
>>
>> I will change the msg to "The console redirection is disabled." following the description in the spcr.
>> Is that OK?
>
> With the "The" preferably dropped, yes.
>
Got it.
>>>> + return -EINVAL;
>>>> + }
>>>> +
>>>> + ns16550_init_common(uart);
>>>> +
>>>> + /*
>>>> + * The baud rate is pre-configured by the firmware.
>>>
>>> But this isn't the same as BAUD_AUTO, is it? If firmware pre-configures
>>> the baud rate, isn't it this structure which it would use to communicate
>>> the information?
>>>
>>
>> No, the comments of the BAUD_AUTO stated like that
>> and in fact the baud rate is not changed after the firmmware.
>
> Oh, I see. I should have checked the comment instead of implying
> meaning assigned to similarly named things elsewhere. Keep as is.
>
Got it.
>>>> + */
>>>> + uart->baud = BAUD_AUTO;
>>>> + uart->data_bits = 8;
>>>> + uart->parity = spcr->parity;
>>>> + uart->stop_bits = spcr->stop_bits;
>>>> + uart->io_base = spcr->serial_port.address;
>>>> + uart->io_size = spcr->serial_port.bit_width;
>>>
>>> Once again: You should not ignore the GAS address space indicator.
>>
>> Sorry, I did not get the point.
>> Do you mean check the address is 0 or not?
>
> No. I mean you shouldn't ignore other parts of the structure:
>
> struct acpi_generic_address {
> u8 space_id; /* Address space where struct or register exists */
> u8 bit_width; /* Size in bits of given register */
> u8 bit_offset; /* Bit offset within the register */
> u8 access_width; /* Minimum Access size (ACPI 3.0) */
> u64 address; /* 64-bit address of struct or register */
> };
>
> Iirc you now consume all fields except space_id, yet space_id
> is a qualifier to the address field (which you obviously use).
I did not know what the space_id means yet.
I will investigate it.
Thanks a lot!
Best Regards,
Wei
>
> Jan
>
> .
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
prev parent reply other threads:[~2020-02-20 9:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-03 11:21 [Xen-devel] [PATCH v3] ns16550: Add ACPI support for ARM only Wei Xu
2020-02-17 13:53 ` Jan Beulich
2020-02-20 7:44 ` Wei Xu
2020-02-20 8:33 ` Jan Beulich
2020-02-20 9:59 ` Wei Xu [this message]
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=5E4E587A.1070807@hisilicon.com \
--to=xuwei5@hisilicon.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=konrad.wilk@oracle.com \
--cc=linuxarm@huawei.com \
--cc=prime.zeng@hisilicon.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.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 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.