From: "André Przywara" <andre.przywara@arm.com>
To: Amit Singh Tomar <amittomer25@gmail.com>, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, wei.liu2@citrix.com,
konrad.wilk@oracle.com, George.Dunlap@eu.citrix.com,
ian.jackson@eu.citrix.com, tim@xen.org, julien.grall@arm.com,
jbeulich@suse.com, andrew.cooper3@citrix.com
Subject: [RFC PATCH 1/2] xen/arm: Add Amlogic S905 SoC early printk support
Date: Tue, 23 Oct 2018 00:31:56 +0100 [thread overview]
Message-ID: <a8821f12-fc38-a69a-9ab5-effa2423246f@arm.com> (raw)
In-Reply-To: <1533661673-14607-2-git-send-email-amittomer25@gmail.com>
On 8/7/18 6:07 PM, Amit Singh Tomar wrote:
Hi,
commit message?
> Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
> ---
> docs/misc/arm/early-printk.txt | 1 +
> xen/arch/arm/Rules.mk | 1 +
> xen/arch/arm/arm64/debug-meson.inc | 50
> ++++++++++++++++++++++++++++++++++++++ 3 files changed, 52
> insertions(+) create mode 100644 xen/arch/arm/arm64/debug-meson.inc
>
> diff --git a/docs/misc/arm/early-printk.txt
> b/docs/misc/arm/early-printk.txt index f765f59..2aa9528 100644
> --- a/docs/misc/arm/early-printk.txt
> +++ b/docs/misc/arm/early-printk.txt
> @@ -41,6 +41,7 @@ the name of the machine:
> - juno: printk with pl011 on Juno platform
> - lager: printk with SCIF0 on Renesas R-Car H2 processors
> - midway: printk with the pl011 on Calxeda Midway processors
> + - meson: printk with the MESON for Amlogic S905 SoCs
> - mvebu: printk with the MVEBU for Marvell Armada 3700 SoCs
> - omap5432: printk with UART3 on TI OMAP5432 processors
> - rcar3: printk with SCIF2 on Renesas R-Car Gen3 processors
> diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
> index f264592..d4fabdc 100644
> --- a/xen/arch/arm/Rules.mk
> +++ b/xen/arch/arm/Rules.mk
> @@ -36,6 +36,7 @@ EARLY_PRINTK_hikey960 := pl011,0xfff32000
> EARLY_PRINTK_juno := pl011,0x7ff80000
> EARLY_PRINTK_lager := scif,0xe6e60000
> EARLY_PRINTK_midway := pl011,0xfff36000
> +EARLY_PRINTK_meson := meson,0xc81004c0
> EARLY_PRINTK_mvebu := mvebu,0xd0012000
> EARLY_PRINTK_omap5432 := 8250,0x48020000,2
> EARLY_PRINTK_rcar3 := scif,0xe6e88000
> diff --git a/xen/arch/arm/arm64/debug-meson.inc
> b/xen/arch/arm/arm64/debug-meson.inc new file mode 100644
> index 0000000..d5507d3
> --- /dev/null
> +++ b/xen/arch/arm/arm64/debug-meson.inc
> @@ -0,0 +1,50 @@
> +/*
> + * xen/arch/arm/arm64/debug-meson.inc
> + *
> + * MESON specific debug code.
> + *
> + * Copyright (c) 2018, Amit Singh Tomar <amittomer25@gmail.com>.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms and conditions of the GNU General Public
> + * License, version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public
> + * License along with this program; If not, see
> <http://www.gnu.org/licenses/>.
> + */
> +
> +#define UART_STATUS_REG 0x0c
> +#define UART_TX_REG 0x00
As Julien mentioned, please stick to the manual names and be consistent
with the proper Xen driver. Also, please sort by offset.
> +
> +/*
> + * MESON UART wait UART to be ready to transmit
> + * xb: register which contains the UART base address
> + * c: scratch register
> + */
> +.macro early_uart_ready xb c
> +1:
> + ldrh w\c, [\xb, #UART_STATUS_REG] /* status register */
Why ldrh? This is a 32-bit register, actually you can't be sure that the
device supports a 16-bit access. Besides: the bit you are after is in
the upper half, so you actually will never see the bit set. I wonder if
you are loosing characters here.
> + tst w\c, #(1 << 21) /* Check TXFIFO FULL bit
> */
> + b.ne 1b /* Wait for the UART to
> be ready */
You can use "tbnz" to replace those two instructions.
> +.endm
> +
> +/*
> + * MESON UART transmit character
> + * xb: register which contains the UART base address
> + * wt: register which contains the character to transmit
> + */
> +.macro early_uart_transmit xb wt
> + strb \wt, [\xb, #UART_TX_REG]
TX_WFIFO is a 32-bit register, so you should rather use a 32-bit
accessor.
Cheers,
Andre.
> +.endm
> +
> +/*
> + * Local variables:
> + * mode: ASM
> + * indent-tabs-mode: nil
> + * End:
> + */
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-10-22 23:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-07 17:07 [RFC PATCH 0/2] xen/arm64: Add Support for Amlogic S905 SoC Amit Singh Tomar
2018-08-07 17:07 ` [RFC PATCH 1/2] xen/arm: Add Amlogic S905 SoC early printk support Amit Singh Tomar
2018-08-14 10:01 ` Julien Grall
2018-08-20 9:16 ` Amit Tomer
2018-08-22 9:52 ` Julien Grall
2018-09-12 6:43 ` Amit Tomer
2018-09-12 9:12 ` Julien Grall
2018-10-22 23:31 ` André Przywara [this message]
2018-11-17 8:47 ` Amit Tomer
2018-08-07 17:07 ` [RFC PATCH 2/2] xen/arm: Add MESON UART driver for Amlogic S905 SoC Amit Singh Tomar
2018-08-08 10:05 ` Jan Beulich
2018-08-14 10:17 ` Julien Grall
2018-08-20 8:12 ` Amit Tomer
2018-08-22 10:00 ` Julien Grall
2018-10-04 7:11 ` Amit Tomer
2018-10-09 10:25 ` Julien Grall
2018-10-22 23:31 ` André Przywara
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=a8821f12-fc38-a69a-9ab5-effa2423246f@arm.com \
--to=andre.przywara@arm.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=amittomer25@gmail.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=julien.grall@arm.com \
--cc=konrad.wilk@oracle.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--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 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).