All of lore.kernel.org
 help / color / mirror / Atom feed
From: matthias.bgg@gmail.com (Matthias Brugger)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/10] ARM: zx: add low level debug support
Date: Sun, 15 Mar 2015 23:44:49 +0100	[thread overview]
Message-ID: <55060B61.5010500@gmail.com> (raw)
In-Reply-To: <1426333785-3952-3-git-send-email-jun.nie@linaro.org>



On 14/03/15 12:49, Jun Nie wrote:
> Use the UART0 peripheral for low level debug. Only the UART port 0 is
> currently supported.
> 
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>  arch/arm/Kconfig.debug      | 12 ++++++++++++
>  arch/arm/include/debug/zx.S | 35 +++++++++++++++++++++++++++++++++++
>  2 files changed, 47 insertions(+)
>  create mode 100644 arch/arm/include/debug/zx.S
> 
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index 970de75..b2a0e9a 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -1169,6 +1169,17 @@ choice
>  		  For more details about semihosting, please see
>  		  chapter 8 of DUI0203I_rvct_developer_guide.pdf from ARM Ltd.
>  
> +	config DEBUG_ZTE_ZX
> +		bool "Use ZTE ZX UART"
> +		depends on ARCH_ZX
> +		help
> +		  Say Y here if you are enabling ZTE ZX296702 SOC and need
> +		  debug uart support.
> +
> +		  This option is preferred over the platform specific
> +		  options; the platform specific options are deprecated
> +		  and will be soon removed.
> +
>  	config DEBUG_LL_UART_8250
>  		bool "Kernel low-level debugging via 8250 UART"
>  		help
> @@ -1315,6 +1326,7 @@ config DEBUG_LL_INCLUDE
>  	default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT
>  	default "debug/vf.S" if DEBUG_VF_UART
>  	default "debug/vt8500.S" if DEBUG_VT8500_UART0
> +	default "debug/zx.S" if DEBUG_ZTE_ZX
>  	default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
>  	default "debug/bcm63xx.S" if DEBUG_UART_BCM63XX
>  	default "debug/digicolor.S" if DEBUG_DIGICOLOR_UA0
> diff --git a/arch/arm/include/debug/zx.S b/arch/arm/include/debug/zx.S
> new file mode 100644
> index 0000000..aa745ac
> --- /dev/null
> +++ b/arch/arm/include/debug/zx.S
> @@ -0,0 +1,35 @@
> +/*
> + * Debugging macro include header
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +#define UART01x_DR              0x04    /* Data read or write */
> +#define UART01x_FR              0x14    /* Flag register (Read only) */
> +
> +#define UART01x_FR_TXFF         0x020
> +
> +
> +#define UART0_PADDR		0x09405000
> +#define UART0_VADDR		0xfc705000

Why don't you use CONFIG_DEBUG_UART_VIRT and CONFIG_DEBUG_UART_PHYS?

> +
> +		.macro	addruart, rp, rv, tmp
> +		ldr	\rp, =UART0_PADDR	@ physical
> +		ldr	\rv, =UART0_VADDR	@ virtual
> +		.endm
> +
> +		.macro	senduart,rd,rx
> +		strb	\rd, [\rx, #UART01x_DR]
> +		.endm
> +
> +		.macro	waituart,rd,rx
> +		.endm
> +
> +		.macro  busyuart,rd,rx
> +1001:		ldr	\rd, [\rx, #UART01x_FR]
> +		tst	\rd, #UART01x_FR_TXFF
> +		bne	1001b
> +		.endm
> 

  reply	other threads:[~2015-03-15 22:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-14 11:49 [PATCH 00/10] ZTE platform basic support Jun Nie
2015-03-14 11:49 ` [PATCH 01/10] ARM: zx: add basic support of ZTE ZX296702 Jun Nie
2015-03-14 21:21   ` Arnd Bergmann
2015-03-14 11:49 ` [PATCH 02/10] ARM: zx: add low level debug support Jun Nie
2015-03-15 22:44   ` Matthias Brugger [this message]
2015-03-15 22:48   ` Russell King - ARM Linux
2015-03-16  2:37     ` Shawn Guo
2015-03-16 10:08       ` Arnd Bergmann
2015-03-14 11:49 ` [PATCH 03/10] MAINTAINERS: add entry for ZTE ARM architecture Jun Nie
2015-03-14 11:49 ` [PATCH 04/10] ARM: zx: add initial L2CC initialization Jun Nie
2015-03-14 21:22   ` Arnd Bergmann
2015-03-16  2:48     ` Shawn Guo
2015-03-16  3:04       ` Jisheng Zhang
2015-03-16 10:41   ` Russell King - ARM Linux
2015-03-14 11:49 ` [PATCH 05/10] ARM: zx: bring up the secondary core Jun Nie
2015-03-14 21:25   ` Arnd Bergmann
2015-03-16  7:23     ` Shawn Guo
2015-03-14 11:49 ` [PATCH 06/10] ARM: zx: add cpu hotplug support Jun Nie
2015-03-14 21:26   ` Arnd Bergmann
2015-03-14 11:49 ` [PATCH 07/10] dt/binding: Document ZTE zx296702 devicetree Jun Nie
2015-03-14 11:49 ` [PATCH 08/10] ARM: dts: zx: add an initial dts for zx296702 Jun Nie
2015-03-14 21:30   ` Arnd Bergmann
2015-03-14 11:49 ` [PATCH 09/10] ARM: zx: Add basic defconfig support to ZX296702 Jun Nie
2015-03-15 13:15   ` Shawn Guo
2015-03-14 11:49 ` [PATCH 10/10] clk: zx: add zx296702 clock support Jun Nie
2015-03-14 21:33   ` Arnd Bergmann
2015-03-16 11:33   ` Russell King - ARM Linux

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=55060B61.5010500@gmail.com \
    --to=matthias.bgg@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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.