[U-Boot] [PATCH v5 3/4] arm: add initial support for Amlogic Meson and ODROID-C2

Simon Glass sjg at chromium.org
Sun May 1 20:56:21 CEST 2016


Hi,

On 24 April 2016 at 00:50, Beniamino Galvani <b.galvani at gmail.com> wrote:
> This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
> board definition for ODROID-C2. This initial submission only supports
> UART and Ethernet (through the existing Designware driver). DTS files
> are the ones submitted to Linux arm-soc for 4.7 [1].
>
> [1] https://patchwork.ozlabs.org/patch/603583/
>
> Signed-off-by: Beniamino Galvani <b.galvani at gmail.com>

A few nits below but this looks very clean, thank you.

Reviewed-by: Simon Glass <sjg at chromium.org>

> ---
>  arch/arm/Kconfig                       |   5 +
>  arch/arm/Makefile                      |   1 +
>  arch/arm/dts/Makefile                  |   2 +
>  arch/arm/dts/meson-gxbb-odroidc2.dts   |  69 +++++++++++++
>  arch/arm/dts/meson-gxbb.dtsi           | 178 +++++++++++++++++++++++++++++++++
>  arch/arm/include/asm/arch-meson/gxbb.h |  52 ++++++++++
>  arch/arm/mach-meson/Kconfig            |  31 ++++++
>  arch/arm/mach-meson/Makefile           |   7 ++
>  arch/arm/mach-meson/board.c            |  66 ++++++++++++
>  board/hardkernel/odroid-c2/Kconfig     |  12 +++
>  board/hardkernel/odroid-c2/MAINTAINERS |   6 ++
>  board/hardkernel/odroid-c2/Makefile    |   7 ++
>  board/hardkernel/odroid-c2/README      |  60 +++++++++++
>  board/hardkernel/odroid-c2/odroid-c2.c |  51 ++++++++++
>  configs/odroid-c2_defconfig            |  23 +++++
>  drivers/serial/Kconfig                 |  15 +++
>  drivers/serial/Makefile                |   1 +
>  drivers/serial/serial_meson.c          | 162 ++++++++++++++++++++++++++++++
>  include/configs/odroid-c2.h            |  55 ++++++++++
>  19 files changed, 803 insertions(+)
>  create mode 100644 arch/arm/dts/meson-gxbb-odroidc2.dts
>  create mode 100644 arch/arm/dts/meson-gxbb.dtsi
>  create mode 100644 arch/arm/include/asm/arch-meson/gxbb.h
>  create mode 100644 arch/arm/mach-meson/Kconfig
>  create mode 100644 arch/arm/mach-meson/Makefile
>  create mode 100644 arch/arm/mach-meson/board.c
>  create mode 100644 board/hardkernel/odroid-c2/Kconfig
>  create mode 100644 board/hardkernel/odroid-c2/MAINTAINERS
>  create mode 100644 board/hardkernel/odroid-c2/Makefile
>  create mode 100644 board/hardkernel/odroid-c2/README
>  create mode 100644 board/hardkernel/odroid-c2/odroid-c2.c
>  create mode 100644 configs/odroid-c2_defconfig
>  create mode 100644 drivers/serial/serial_meson.c
>  create mode 100644 include/configs/odroid-c2.h
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index d1c3157..95a0838 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -456,6 +456,9 @@ config ARCH_KEYSTONE
>         select SUPPORT_SPL
>         select CMD_POWEROFF
>
> +config ARCH_MESON
> +       bool "Amlogic Meson"

Please add a help message describing what this is and what features it has.

> +
>  config ARCH_MX7
>         bool "Freescale MX7"
>         select CPU_V7
> @@ -780,6 +783,8 @@ source "arch/arm/mach-orion5x/Kconfig"
>
>  source "arch/arm/cpu/armv7/rmobile/Kconfig"
>
> +source "arch/arm/mach-meson/Kconfig"
> +
>  source "arch/arm/mach-rockchip/Kconfig"
>
>  source "arch/arm/mach-s5pc1xx/Kconfig"
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index d516345..ecd1887 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -50,6 +50,7 @@ machine-$(CONFIG_ARCH_HIGHBANK)               += highbank
>  machine-$(CONFIG_ARCH_KEYSTONE)                += keystone
>  # TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD
>  machine-$(CONFIG_KIRKWOOD)             += kirkwood
> +machine-$(CONFIG_ARCH_MESON)           += meson
>  machine-$(CONFIG_ARCH_MVEBU)           += mvebu
>  # TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA
>  # TODO: rename CONFIG_ORION5X -> CONFIG_ARCH_ORION5X
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index aa31fd9..be28d21 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -24,6 +24,8 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
>         rk3288-jerry.dtb \
>         rk3288-rock2-square.dtb \
>         rk3036-sdk.dtb
> +dtb-$(CONFIG_ARCH_MESON) += \
> +       meson-gxbb-odroidc2.dtb
>  dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
>         tegra20-medcom-wide.dtb \
>         tegra20-paz00.dtb \
> diff --git a/arch/arm/dts/meson-gxbb-odroidc2.dts b/arch/arm/dts/meson-gxbb-odroidc2.dts
> new file mode 100644
> index 0000000..653c2fa
> --- /dev/null
> +++ b/arch/arm/dts/meson-gxbb-odroidc2.dts
> @@ -0,0 +1,69 @@
> +/*
> + * Copyright (c) 2016 Andreas Färber
> + * Copyright (c) 2016 BayLibre, Inc.
> + * Author: Kevin Hilman <khilman at kernel.org>
> + *
> + * This file is dual-licensed: you can use it either under the terms
> + * of the GPL or the X11 license, at your option. Note that this dual
> + * licensing only applies to this file, and not this project as a
> + * whole.

Can you use SPDX for these?

> + *
> + *  a) This library is free software; you can redistribute it and/or
> + *     modify it under the terms of the GNU General Public License as
> + *     published by the Free Software Foundation; either version 2 of the
> + *     License, or (at your option) any later version.
> + *
> + *     This library 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.
> + *
> + * Or, alternatively,
> + *
> + *  b) Permission is hereby granted, free of charge, to any person
> + *     obtaining a copy of this software and associated documentation
> + *     files (the "Software"), to deal in the Software without
> + *     restriction, including without limitation the rights to use,
> + *     copy, modify, merge, publish, distribute, sublicense, and/or
> + *     sell copies of the Software, and to permit persons to whom the
> + *     Software is furnished to do so, subject to the following
> + *     conditions:
> + *
> + *     The above copyright notice and this permission notice shall be
> + *     included in all copies or substantial portions of the Software.
> + *
> + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + *     OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +/dts-v1/;

[snip]

> diff --git a/board/hardkernel/odroid-c2/odroid-c2.c b/board/hardkernel/odroid-c2/odroid-c2.c
> new file mode 100644
> index 0000000..c258d4f
> --- /dev/null
> +++ b/board/hardkernel/odroid-c2/odroid-c2.c
> @@ -0,0 +1,51 @@
> +/*
> + * (C) Copyright 2016 Beniamino Galvani <b.galvani at gmail.com>
> + *
> + * SPDX-License-Identifier:    GPL-2.0+
> + */
> +
> +#include <common.h>
> +#include <asm/io.h>
> +#include <asm/arch/gxbb.h>
> +#include <dm/platdata.h>
> +#include <phy.h>
> +
> +int board_init(void)
> +{
> +       return 0;
> +}
> +
> +static const struct eth_pdata gxbb_eth_pdata = {
> +       .iobase = GXBB_ETH_BASE,
> +       .phy_interface = PHY_INTERFACE_MODE_RGMII,
> +};
> +
> +U_BOOT_DEVICE(meson_eth) = {
> +       .name = "eth_designware",
> +       .platdata = &gxbb_eth_pdata,
> +};
> +
> +int misc_init_r(void)
> +{
> +       /* Select Ethernet function */
> +       setbits_le32(GXBB_PINMUX(6), 0x3fff);
> +
> +       /* Set RGMII mode */
> +       setbits_le32(GXBB_ETH_REG_0, GXBB_ETH_REG_0_PHY_INTF |
> +                                    GXBB_ETH_REG_0_TX_PHASE(1) |
> +                                    GXBB_ETH_REG_0_TX_RATIO(4) |
> +                                    GXBB_ETH_REG_0_PHY_CLK_EN |
> +                                    GXBB_ETH_REG_0_CLK_EN);
> +
> +       /* Enable power and clock gate */
> +       setbits_le32(GXBB_GCLK_MPEG_1, GXBB_GCLK_MPEG_1_ETH);
> +       clrbits_le32(GXBB_MEM_PD_REG_0, GXBB_MEM_PD_REG_0_ETH_MASK);
> +
> +       /* Reset PHY on GPIOZ_14 */
> +       clrbits_le32(GXBB_GPIO_EN(3), BIT(14));
> +       clrbits_le32(GXBB_GPIO_OUT(3), BIT(14));
> +       mdelay(10);
> +       setbits_le32(GXBB_GPIO_OUT(3), BIT(14));

Once you have a GPIO/pinctrl driver this could presumably be replaced.

> +
> +       return 0;
> +}

Regards,
Simon


More information about the U-Boot mailing list