All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 01/12] sunxi: Add initial support for R40
Date: Wed, 1 Mar 2017 15:57:44 +0100	[thread overview]
Message-ID: <20170301145744.ocpvsagcpvgnskib@lukather> (raw)
In-Reply-To: <CAGb2v66Ch0xiFV2mkCM3dUvhwU_3jmjenkg9O79kcz=df+U-bg@mail.gmail.com>

1;4601;0c
On Wed, Mar 01, 2017 at 08:10:55PM +0800, Chen-Yu Tsai wrote:
> On Wed, Mar 1, 2017 at 6:55 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > Hi Chen-Yu
> >
> > On Wed, Mar 01, 2017 at 03:04:36PM +0800, Chen-Yu Tsai wrote:
> >> The R40 is the successor to the A20. It is a hybrid of the A20, A33
> >> and the H3.
> >>
> >> The R40's PIO controller is compatible with the A20,
> >> Reuse the A20 UART and I2C muxing code by adding the R40's macro.
> >>
> >> The display pipeline is the newer DE 2.0 variant.
> >> Block enabling video on R40 for now.
> >>
> >> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> >> ---
> >>  arch/arm/mach-sunxi/board.c    | 10 +++++++---
> >>  arch/arm/mach-sunxi/cpu_info.c |  2 ++
> >>  board/sunxi/Kconfig            |  9 +++++++--
> >>  board/sunxi/board.c            | 19 ++++++++++++++-----
> >>  4 files changed, 30 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
> >> index 5e03d039433a..5a74c9717d84 100644
> >> --- a/arch/arm/mach-sunxi/board.c
> >> +++ b/arch/arm/mach-sunxi/board.c
> >> @@ -69,12 +69,14 @@ struct mm_region *mem_map = sunxi_mem_map;
> >>  static int gpio_init(void)
> >>  {
> >>  #if CONFIG_CONS_INDEX == 1 && defined(CONFIG_UART0_PORT_F)
> >> -#if defined(CONFIG_MACH_SUN4I) || defined(CONFIG_MACH_SUN7I)
> >> +#if defined(CONFIG_MACH_SUN4I) || \
> >> +    defined(CONFIG_MACH_SUN7I) || \
> >> +    defined(CONFIG_MACH_SUN8I_R40)
> >>       /* disable GPB22,23 as uart0 tx,rx to avoid conflict */
> >>       sunxi_gpio_set_cfgpin(SUNXI_GPB(22), SUNXI_GPIO_INPUT);
> >>       sunxi_gpio_set_cfgpin(SUNXI_GPB(23), SUNXI_GPIO_INPUT);
> >>  #endif
> >> -#if defined(CONFIG_MACH_SUN8I)
> >> +#if defined(CONFIG_MACH_SUN8I) && !defined(CONFIG_MACH_SUN8I_R40)
> >>       sunxi_gpio_set_cfgpin(SUNXI_GPF(2), SUN8I_GPF_UART0);
> >>       sunxi_gpio_set_cfgpin(SUNXI_GPF(4), SUN8I_GPF_UART0);
> >>  #else
> >> @@ -82,7 +84,9 @@ static int gpio_init(void)
> >>       sunxi_gpio_set_cfgpin(SUNXI_GPF(4), SUNXI_GPF_UART0);
> >>  #endif
> >>       sunxi_gpio_set_pull(SUNXI_GPF(4), 1);
> >> -#elif CONFIG_CONS_INDEX == 1 && (defined(CONFIG_MACH_SUN4I) || defined(CONFIG_MACH_SUN7I))
> >> +#elif CONFIG_CONS_INDEX == 1 && (defined(CONFIG_MACH_SUN4I) || \
> >> +                              defined(CONFIG_MACH_SUN7I) || \
> >> +                              defined(CONFIG_MACH_SUN8I_R40))
> >>       sunxi_gpio_set_cfgpin(SUNXI_GPB(22), SUN4I_GPB_UART0);
> >>       sunxi_gpio_set_cfgpin(SUNXI_GPB(23), SUN4I_GPB_UART0);
> >>       sunxi_gpio_set_pull(SUNXI_GPB(23), SUNXI_GPIO_PULL_UP);
> >> diff --git a/arch/arm/mach-sunxi/cpu_info.c b/arch/arm/mach-sunxi/cpu_info.c
> >> index 85633ccec216..7851de299ab5 100644
> >> --- a/arch/arm/mach-sunxi/cpu_info.c
> >> +++ b/arch/arm/mach-sunxi/cpu_info.c
> >> @@ -87,6 +87,8 @@ int print_cpuinfo(void)
> >>       printf("CPU:   Allwinner A83T (SUN8I %04x)\n", sunxi_get_sram_id());
> >>  #elif defined CONFIG_MACH_SUN8I_H3
> >>       printf("CPU:   Allwinner H3 (SUN8I %04x)\n", sunxi_get_sram_id());
> >> +#elif defined CONFIG_MACH_SUN8I_R40
> >> +     printf("CPU:   Allwinner R40 (SUN8I %04x)\n", sunxi_get_sram_id());
> >>  #elif defined CONFIG_MACH_SUN9I
> >>       puts("CPU:   Allwinner A80 (SUN9I)\n");
> >>  #elif defined CONFIG_MACH_SUN50I
> >> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
> >> index 3e0e2624737e..8e8b9cd0d5fd 100644
> >> --- a/board/sunxi/Kconfig
> >> +++ b/board/sunxi/Kconfig
> >> @@ -132,6 +132,11 @@ config MACH_SUN8I_H3
> >>       select MACH_SUNXI_H3_H5
> >>       select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
> >>
> >> +config MACH_SUN8I_R40
> >> +     bool "sun8i (Allwinner R40)"
> >> +     select CPU_V7
> >> +     select SUNXI_GEN_SUN6I
> >> +
> >>  config MACH_SUN9I
> >>       bool "sun9i (Allwinner A80)"
> >>       select CPU_V7
> >> @@ -157,7 +162,7 @@ endchoice
> >>  # The sun8i SoCs share a lot, this helps to avoid a lot of "if A23 || A33"
> >>  config MACH_SUN8I
> >>       bool
> >> -     default y if MACH_SUN8I_A23 || MACH_SUN8I_A33 || MACH_SUNXI_H3_H5 || MACH_SUN8I_A83T
> >> +     default y if MACH_SUN8I_A23 || MACH_SUN8I_A33 || MACH_SUNXI_H3_H5 || MACH_SUN8I_A83T || MACH_SUN8I_R40
> >
> > You should really wrap that line too (and CONFIG_VIDEO below).
> 
> Kconfig doesn't seem to like line wrapping. I can split both into
> 1 symbol per line though. Would that be taking it to far?

Something like:

default y if MACH_SUN8I_A23
default y if MACH_SUN8I_A33

?

I didn't know it was possible.. But if it works, yes, please that will
even be easier to review / extend.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170301/bd777471/attachment.sig>

  reply	other threads:[~2017-03-01 14:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01  7:04 [U-Boot] [PATCH 00/12] sunxi: Add support for R40 SoC Chen-Yu Tsai
2017-03-01  7:04 ` [U-Boot] [PATCH 01/12] sunxi: Add initial support for R40 Chen-Yu Tsai
2017-03-01 10:55   ` Maxime Ripard
2017-03-01 12:10     ` Chen-Yu Tsai
2017-03-01 14:57       ` Maxime Ripard [this message]
2017-03-01 15:22         ` [U-Boot] [linux-sunxi] " Icenowy Zheng
2017-03-01  7:04 ` [U-Boot] [PATCH 02/12] sunxi: Enable AXP221s in I2C mode with the R40 SoC Chen-Yu Tsai
2017-03-01 10:55   ` Maxime Ripard
2017-03-01  7:04 ` [U-Boot] [PATCH 03/12] sunxi: Fix watchdog reset function for R40 Chen-Yu Tsai
2017-03-01 10:56   ` Maxime Ripard
2017-03-01  7:04 ` [U-Boot] [PATCH 04/12] sunxi: Add mmc[1-3] pinmux settings " Chen-Yu Tsai
2017-03-01 10:56   ` Maxime Ripard
2017-03-01  7:04 ` [U-Boot] [PATCH 05/12] sunxi: Set PLL lock enable bits " Chen-Yu Tsai
2017-03-01 14:53   ` Maxime Ripard
2017-03-01 18:16   ` [U-Boot] [linux-sunxi] " Jernej Škrabec
2017-03-01  7:04 ` [U-Boot] [PATCH 06/12] sunxi: Provide defaults for R40 DRAM settings Chen-Yu Tsai
2017-03-01 14:53   ` Maxime Ripard
2017-03-01  7:04 ` [U-Boot] [PATCH 07/12] gpio: sunxi: Add compatible string for R40 PIO Chen-Yu Tsai
2017-03-01 14:54   ` Maxime Ripard
2017-03-01  7:04 ` [U-Boot] [PATCH 08/12] sunxi: Use H3/A64 DRAM initialization code for R40 Chen-Yu Tsai
2017-03-01 14:54   ` Maxime Ripard
2017-03-01  7:04 ` [U-Boot] [PATCH 09/12] sunxi: Enable SPL " Chen-Yu Tsai
2017-03-01 14:54   ` Maxime Ripard
2017-03-01  7:04 ` [U-Boot] [PATCH 10/12] sunxi: Fix CPUCFG address " Chen-Yu Tsai
2017-03-01 14:55   ` Maxime Ripard
2017-03-01  7:04 ` [U-Boot] [PATCH 11/12] sunxi: Add PSCI support " Chen-Yu Tsai
2017-03-01 14:55   ` Maxime Ripard
2017-03-01  7:04 ` [U-Boot] [PATCH 12/12] sunxi: Add support for Bananapi M2 Ultra Chen-Yu Tsai
2017-03-01 14:56   ` Maxime Ripard

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=20170301145744.ocpvsagcpvgnskib@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=u-boot@lists.denx.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 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.