mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH 02/20] i.MX: Add DEBUG_LL hooks for VF610
Date: Tue, 4 Oct 2016 06:27:15 -0700	[thread overview]
Message-ID: <CAHQ1cqGgfAoVYRe6eknkzfTBXfJs=bMMome5fMU57eGsSmzypw@mail.gmail.com> (raw)
In-Reply-To: <20161004062420.uie22nvogkeqyndz@pengutronix.de>

On Mon, Oct 3, 2016 at 11:24 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Mon, Oct 03, 2016 at 07:40:39AM -0700, Andrey Smirnov wrote:
>> Add code to support DEBUG_LL functionality on VF610/Vybrid platform.
>>
>> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
>> ---
>>  arch/arm/mach-imx/include/mach/debug_ll.h   |  27 ++-
>>  arch/arm/mach-imx/include/mach/vf610-regs.h | 126 +++++++++++++
>>  common/Kconfig                              |  10 +-
>>  include/serial/lpuart.h                     | 265 ++++++++++++++++++++++++++++
>>  4 files changed, 426 insertions(+), 2 deletions(-)
>>  create mode 100644 arch/arm/mach-imx/include/mach/vf610-regs.h
>>  create mode 100644 include/serial/lpuart.h
>>
>> diff --git a/arch/arm/mach-imx/include/mach/debug_ll.h b/arch/arm/mach-imx/include/mach/debug_ll.h
>> index 5c2db6c..a132f3c 100644
>> --- a/arch/arm/mach-imx/include/mach/debug_ll.h
>> +++ b/arch/arm/mach-imx/include/mach/debug_ll.h
>> @@ -14,8 +14,10 @@
>>  #include <mach/imx51-regs.h>
>>  #include <mach/imx53-regs.h>
>>  #include <mach/imx6-regs.h>
>> +#include <mach/vf610-regs.h>
>>
>>  #include <serial/imx-uart.h>
>> +#include <serial/lpuart.h>
>>
>>  #ifdef CONFIG_DEBUG_LL
>>
>> @@ -42,6 +44,8 @@
>>  #define IMX_DEBUG_SOC MX53
>>  #elif defined CONFIG_DEBUG_IMX6Q_UART
>>  #define IMX_DEBUG_SOC MX6
>> +#elif defined CONFIG_DEBUG_VF610_UART
>> +#define IMX_DEBUG_SOC VF610
>>  #else
>>  #error "unknown i.MX debug uart soc type"
>>  #endif
>> @@ -74,6 +78,13 @@ static inline void imx6_uart_setup_ll(void)
>>       imx6_uart_setup(base);
>>  }
>>
>> +static inline void vf610_uart_setup_ll(void)
>> +{
>> +     void *base = IOMEM(IMX_UART_BASE(IMX_DEBUG_SOC, CONFIG_DEBUG_IMX_UART_PORT));
>> +
>> +     lpuart_setup(base, 66000000);
>> +}
>> +
>>  static inline void PUTC_LL(int c)
>>  {
>>       void __iomem *base = IOMEM(IMX_UART_BASE(IMX_DEBUG_SOC,
>> @@ -82,14 +93,19 @@ static inline void PUTC_LL(int c)
>>       if (!base)
>>               return;
>>
>> -     imx_uart_putc(base, c);
>> +     if (IS_ENABLED(CONFIG_DEBUG_VF610_UART))
>> +             lpuart_putc(base, c);
>> +     else
>> +             imx_uart_putc(base, c);
>>  }
>> +
>>  #else
>>
>>  static inline void imx50_uart_setup_ll(void) {}
>>  static inline void imx51_uart_setup_ll(void) {}
>>  static inline void imx53_uart_setup_ll(void) {}
>>  static inline void imx6_uart_setup_ll(void)  {}
>> +static inline void vf610_uart_setup_ll(void) {}
>>
>>  #endif /* CONFIG_DEBUG_LL */
>>
>> @@ -115,4 +131,13 @@ static inline void imx53_ungate_all_peripherals(void)
>>       imx_ungate_all_peripherals(IOMEM(MX53_CCM_BASE_ADDR));
>>  }
>>
>> +static inline void vf610_ungate_all_peripherals(void)
>> +{
>> +     void __iomem *ccmbase = IOMEM(VF610_CCM_BASE_ADDR);
>> +     int i;
>> +
>> +     for (i = 0x40; i <= 0x6c; i += 4)
>> +             writel(0xffffffff, ccmbase + i);
>> +}
>> +
>>  #endif /* __MACH_DEBUG_LL_H__ */
>> diff --git a/arch/arm/mach-imx/include/mach/vf610-regs.h b/arch/arm/mach-imx/include/mach/vf610-regs.h
>
> This is probably not the right patch to add this file.

OK, unless you prefer something different, I'll split this file into a
separate patch in v2

>
>> new file mode 100644
>> index 0000000..a1c1a09
>> --- /dev/null
>> +++ b/arch/arm/mach-imx/include/mach/vf610-regs.h
>> @@ -0,0 +1,126 @@
>> +/*
>> + * Copyright 2013-2014 Freescale Semiconductor, Inc.
>> + *
>> + * SPDX-License-Identifier:  GPL-2.0+
>> + */
>> +
>> +#ifndef __ASM_ARCH_IMX_REGS_H__
>> +#define __ASM_ARCH_IMX_REGS_H__
>
> MACH_VF610_REGS_H ?

OK, will do in v2

>
>> +/* System Reset Controller (SRC) */
>> +#define SRC_SRSR_SW_RST                                      (0x1 << 18)
>> +#define SRC_SRSR_RESETB                                      (0x1 << 7)
>> +#define SRC_SRSR_JTAG_RST                            (0x1 << 5)
>> +#define SRC_SRSR_WDOG_M4                             (0x1 << 4)
>> +#define SRC_SRSR_WDOG_A5                             (0x1 << 3)
>> +#define SRC_SRSR_POR_RST                             (0x1 << 0)
>> +#define SRC_SBMR2_BMOD_MASK             (0x3 << 24)
>> +#define SRC_SBMR2_BMOD_SHIFT            24
>> +#define SRC_SBMR2_BMOD_FUSES            0x0
>> +#define SRC_SBMR2_BMOD_SERIAL           0x1
>> +#define SRC_SBMR2_BMOD_RCON             0x2
>
> Please add a VF610_ prefix.

I have a suspicion that I am not using those definitions anywhere, so
I'll ether remove them or add said prefix in v2.

Thanks,
Andrey

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-10-04 13:27 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-03 14:40 [PATCH 00/20] Vybrid support in Barebox Andrey Smirnov
2016-10-03 14:40 ` [PATCH 01/20] i.MX: Add primitive functions for VF610 family Andrey Smirnov
2016-10-03 14:40 ` [PATCH 02/20] i.MX: Add DEBUG_LL hooks for VF610 Andrey Smirnov
2016-10-04  6:24   ` Sascha Hauer
2016-10-04 13:27     ` Andrey Smirnov [this message]
2016-10-03 14:40 ` [PATCH 03/20] i.MX: scripts: Add "vf610" soc to imx-image Andrey Smirnov
2016-10-03 14:40 ` [PATCH 04/20] i.MX: Add support for VF610 Tower board Andrey Smirnov
2016-10-04  6:32   ` Sascha Hauer
2016-10-04 13:34     ` Andrey Smirnov
2016-10-07  7:56       ` Sascha Hauer
2016-10-03 14:40 ` [PATCH 05/20] i.MX: Add pinctrl driver for VF610 Andrey Smirnov
2016-10-03 14:40 ` [PATCH 06/20] clk: Port clock dependency resolution code Andrey Smirnov
2016-10-03 14:40 ` [PATCH 07/20] clk: Port of_clk_set_defautls() Andrey Smirnov
2016-10-04  6:38   ` Sascha Hauer
2016-10-04 13:36     ` Andrey Smirnov
2016-10-03 14:40 ` [PATCH 08/20] i.MX: clk: Port imx_clk_gate2_cgr() Andrey Smirnov
2016-10-03 14:40 ` [PATCH 09/20] i.MX: clk: Add IMX_PLLV3_USB_VF610 support Andrey Smirnov
2016-10-03 14:40 ` [PATCH 10/20] i.MX: clk: Port imx_check_clocks() and imx_obtain_fixed_clock() Andrey Smirnov
2016-10-04  6:49   ` Sascha Hauer
2016-10-04 13:43     ` Andrey Smirnov
2016-10-04 19:28       ` Sascha Hauer
2016-10-03 14:40 ` [PATCH 11/20] i.MX: Add VF610 clock tree initialization code Andrey Smirnov
2016-10-04  6:58   ` Sascha Hauer
2016-10-04 13:44     ` Andrey Smirnov
2016-10-03 14:40 ` [PATCH 12/20] vf610: Give enet_osc explicit "enet_ext" name Andrey Smirnov
2016-10-03 14:40 ` [PATCH 13/20] i.MX: Add 'lpuart' serial driver Andrey Smirnov
2016-10-04  7:13   ` Sascha Hauer
2016-10-04 13:56     ` Andrey Smirnov
2016-10-04 19:25       ` Sascha Hauer
2016-10-03 14:40 ` [PATCH 14/20] i.MX: i2c-imx: Add Vybrid support Andrey Smirnov
2016-10-04  7:20   ` Sascha Hauer
2016-10-04 13:57     ` Andrey Smirnov
2016-10-03 14:40 ` [PATCH 15/20] i.MX: esdhc: Do not rely on CPU type for quirks Andrey Smirnov
2016-10-03 14:40 ` [PATCH 16/20] i.MX: Kconfig: Enable OCOTP on Vybrid Andrey Smirnov
2016-10-03 14:40 ` [PATCH 17/20] i.MX: ocotp: Remove unused #define Andrey Smirnov
2016-10-03 14:40 ` [PATCH 18/20] i.MX: ocotp: Account for shadow memory gaps Andrey Smirnov
2016-10-03 14:40 ` [PATCH 19/20] i.MX: ocotp: Add Vybrid support Andrey Smirnov
2016-10-03 14:40 ` [PATCH 20/20] imx-esdhc: Request "per" clock explicitly Andrey Smirnov

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='CAHQ1cqGgfAoVYRe6eknkzfTBXfJs=bMMome5fMU57eGsSmzypw@mail.gmail.com' \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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