Re: [U-Boot] [PATCH] video: meson: hdmi-supply regulator should be optional

2019-06-05 Thread Mohammad Rasim
On 19/06/04 10:26PM, Maxime Jourdan wrote:
> Some boards don't have such a regulator, and don't need one to enable
> HDMI display. Make it optional, fixing hdmi display for those boards.
>
> Also surround the regulator code with a config check on DM_REGULATOR.
>
> Reported-by: Mohammad Rasim 
> Signed-off-by: Maxime Jourdan 
> ---
>  drivers/video/meson/meson_dw_hdmi.c | 14 ++
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/meson/meson_dw_hdmi.c 
> b/drivers/video/meson/meson_dw_hdmi.c
> index 7a1c060856..483c93f6b6 100644
> --- a/drivers/video/meson/meson_dw_hdmi.c
> +++ b/drivers/video/meson/meson_dw_hdmi.c
> @@ -361,13 +361,19 @@ static int meson_dw_hdmi_probe(struct udevice *dev)
>   priv->hdmi.i2c_clk_high = 0x67;
>   priv->hdmi.i2c_clk_low = 0x78;
>
> +#if CONFIG_IS_ENABLED(DM_REGULATOR)
>   ret = device_get_supply_regulator(dev, "hdmi-supply", );
> - if (ret)
> + if (ret && ret != -ENOENT) {
> + pr_err("Failed to get HDMI regulator\n");
>   return ret;
> + }
>
> - ret = regulator_set_enable(supply, true);
> - if (ret)
> - return ret;
> + if (!ret) {
> + ret = regulator_set_enable(supply, true);
> + if (ret)
> +     return ret;
> + }
> +#endif
>
>   ret = reset_get_bulk(dev, );
>   if (ret)
> --
> 2.21.0
>
Tested-by: Mohammad Rasim 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] pinctrl: meson-gxbb: add hdmi related pins

2019-06-05 Thread Mohammad Rasim
On 19/06/04 10:26PM, Maxime Jourdan wrote:
> The GXBB pinctrl is missing pins related to HDMI, namely hot plug
> detection (hpd) and I2C (sda + scl).
>
> This fixes HDMI support for GXBB in u-boot.
>
> Reported-by: Mohammad Rasim 
> Signed-off-by: Maxime Jourdan 
> ---
>  drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 19 +++
>  1 file changed, 19 insertions(+)
>
> diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c 
> b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
> index 59b5be6211..9e2e151164 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
> @@ -61,6 +61,10 @@ static const unsigned int eth_txd1_pins[]  = { 
> PIN(GPIOZ_11, EE_OFF) };
>  static const unsigned int eth_txd2_pins[]= { PIN(GPIOZ_12, EE_OFF) };
>  static const unsigned int eth_txd3_pins[]= { PIN(GPIOZ_13, EE_OFF) };
>
> +static const unsigned int hdmi_hpd_pins[]= { PIN(GPIOH_0, EE_OFF) };
> +static const unsigned int hdmi_sda_pins[]= { PIN(GPIOH_1, EE_OFF) };
> +static const unsigned int hdmi_scl_pins[]= { PIN(GPIOH_2, EE_OFF) };
> +
>  static const unsigned int uart_tx_ao_a_pins[]= { PIN(GPIOAO_0, 0) };
>  static const unsigned int uart_rx_ao_a_pins[]= { PIN(GPIOAO_1, 0) };
>  static const unsigned int uart_cts_ao_a_pins[]   = { PIN(GPIOAO_2, 0) };
> @@ -232,6 +236,11 @@ static struct meson_pmx_group 
> meson_gxbb_periphs_groups[] = {
>   GROUP(eth_txd2, 6,  3),
>   GROUP(eth_txd3, 6,  2),
>
> + /* Bank H */
> + GROUP(hdmi_hpd, 1,  26),
> + GROUP(hdmi_sda, 1,  25),
> + GROUP(hdmi_scl, 1,  24),
> +
>   /* Bank DV */
>   GROUP(uart_tx_b,2,  29),
>   GROUP(uart_rx_b,2,  28),
> @@ -351,6 +360,14 @@ static const char * const eth_groups[] = {
>   "eth_txd0", "eth_txd1", "eth_txd2", "eth_txd3",
>  };
>
> +static const char * const hdmi_hpd_groups[] = {
> + "hdmi_hpd",
> +};
> +
> +static const char * const hdmi_i2c_groups[] = {
> + "hdmi_sda", "hdmi_scl",
> +};
> +
>  static const char * const gpio_aobus_groups[] = {
>   "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4",
>   "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9",
> @@ -383,6 +400,8 @@ static struct meson_pmx_func 
> meson_gxbb_periphs_functions[] = {
>   FUNCTION(uart_b),
>   FUNCTION(uart_c),
>   FUNCTION(eth),
> + FUNCTION(hdmi_hpd),
> + FUNCTION(hdmi_i2c),
>  };
>
>  static struct meson_pmx_func meson_gxbb_aobus_functions[] = {
> --
> 2.21.0
>
Tested-by: Mohammad Rasim 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v5 4/5] ARM: board: meson: add p200 board

2019-03-23 Thread Mohammad Rasim
This adds the defconfig and README files for p200 board

Signed-off-by: Mohammad Rasim 
Acked-by: Neil Armstrong 
---
 board/amlogic/p200/MAINTAINERS |   1 +
 board/amlogic/p200/README.p200 | 103 +
 configs/p200_defconfig |  41 +
 3 files changed, 145 insertions(+)
 create mode 100644 board/amlogic/p200/README.p200
 create mode 100644 configs/p200_defconfig

diff --git a/board/amlogic/p200/MAINTAINERS b/board/amlogic/p200/MAINTAINERS
index 77a055b681d9..96fe92dd0874 100644
--- a/board/amlogic/p200/MAINTAINERS
+++ b/board/amlogic/p200/MAINTAINERS
@@ -5,3 +5,4 @@ S:  Maintained
 F: board/amlogic/p200/
 F: configs/nanopi-k2_defconfig
 F: configs/odroid-c2_defconfig
+F: configs/p200_defconfig
diff --git a/board/amlogic/p200/README.p200 b/board/amlogic/p200/README.p200
new file mode 100644
index ..01d82d1e79e3
--- /dev/null
+++ b/board/amlogic/p200/README.p200
@@ -0,0 +1,103 @@
+U-Boot for Amlogic P200
+===
+
+P200 is a reference board manufactured by Amlogic with the following
+specifications:
+
+ - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz
+ - ARM Mali 450 GPU
+ - 2GB DDR3 SDRAM
+ - Gigabit Ethernet
+ - HDMI 2.0 4K/60Hz display
+ - 2 x USB 2.0 Host
+ - eMMC, microSD
+ - Infrared receiver
+ - SDIO WiFi Module
+ - CVBS+Stereo Audio Jack
+
+Schematics are available from Amlogic on demand.
+
+Currently the u-boot port supports the following devices:
+ - serial
+ - eMMC, microSD
+ - Ethernet
+ - I2C
+ - Regulators
+ - Reset controller
+ - Clock controller
+ - USB Host
+ - ADC
+
+u-boot compilation
+==
+
+ > export ARCH=arm
+ > export CROSS_COMPILE=aarch64-none-elf-
+ > make p200_defconfig
+ > make
+
+Image creation
+==
+
+Amlogic doesn't provide sources for the firmware and for tools needed
+to create the bootloader image, so it is necessary to obtain them from
+the git tree published by the board vendor:
+
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > export 
PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
+ > git clone https://github.com/BayLibre/u-boot.git -b 
n-amlogic-openlinux-20170606 amlogic-u-boot
+ > cd amlogic-u-boot
+ > make gxb_p200_v1_defconfig
+ > make
+ > export FIPDIR=$PWD/fip
+
+Go back to mainline U-boot source tree then :
+ > mkdir fip
+
+ > cp $FIPDIR/gxl/bl2.bin fip/
+ > cp $FIPDIR/gxl/acs.bin fip/
+ > cp $FIPDIR/gxl/bl21.bin fip/
+ > cp $FIPDIR/gxl/bl30.bin fip/
+ > cp $FIPDIR/gxl/bl301.bin fip/
+ > cp $FIPDIR/gxl/bl31.img fip/
+ > cp u-boot.bin fip/bl33.bin
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl30.bin \
+   fip/zero_tmp \
+   fip/bl30_zero.bin \
+   fip/bl301.bin \
+   fip/bl301_zero.bin \
+   fip/bl30_new.bin \
+   bl30
+
+ > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl2_acs.bin \
+   fip/zero_tmp \
+   fip/bl2_zero.bin \
+   fip/bl21.bin \
+   fip/bl21_zero.bin \
+   fip/bl2_new.bin \
+   bl2
+
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output 
fip/bl2.n.bin.sig
+ > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
+   --output fip/u-boot.bin \
+   --bl2 fip/bl2.n.bin.sig \
+   --bl30 fip/bl30_new.bin.enc \
+   --bl31 fip/bl31.img.enc \
+   --bl33 fip/bl33.bin.enc
+
+and then write the image to SD with:
+
+ > DEV=/dev/your_sd_device
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
diff --git a/configs/p200_defconfig b/configs/p200_defconfig
new file mode 100644
index ..3980e4eb5f1d
--- /dev/null
+++ b/configs/p200_defconfig
@@ -0,0 +1,41 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MESON=y
+CONFIG_SYS_TEXT_BASE=0x0100
+CONFIG_DEBUG_UART_BASE=0xc81004c0
+CONFIG_DEBUG_UART_CLOCK=2400
+CONFIG_IDENT_STRING=" p200"
+CONFIG_DEBUG_UART=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_MISC_INIT_R=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+# CONFIG_CMD_BDI is not set
+# CONFIG_CMD_IMI is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MMC=y
+# CONFIG_CMD

[U-Boot] [PATCH 5/5] ARM: board: meson: add p201 board

2019-03-23 Thread Mohammad Rasim
This adds support for p201 reference boards

Signed-off-by: Mohammad Rasim 
---
 board/amlogic/p201/MAINTAINERS |   5 ++
 board/amlogic/p201/Makefile|   5 ++
 board/amlogic/p201/README.p201 | 103 +
 board/amlogic/p201/p201.c  |  43 ++
 configs/p201_defconfig |  41 +
 5 files changed, 197 insertions(+)
 create mode 100644 board/amlogic/p201/MAINTAINERS
 create mode 100644 board/amlogic/p201/Makefile
 create mode 100644 board/amlogic/p201/README.p201
 create mode 100644 board/amlogic/p201/p201.c
 create mode 100644 configs/p201_defconfig

diff --git a/board/amlogic/p201/MAINTAINERS b/board/amlogic/p201/MAINTAINERS
new file mode 100644
index ..3e84a8e2a2af
--- /dev/null
+++ b/board/amlogic/p201/MAINTAINERS
@@ -0,0 +1,5 @@
+P201
+M: Neil Armstrong 
+S: Maintained
+F: board/amlogic/p201/
+F: configs/p201_defconfig
diff --git a/board/amlogic/p201/Makefile b/board/amlogic/p201/Makefile
new file mode 100644
index ..11de5396ab4c
--- /dev/null
+++ b/board/amlogic/p201/Makefile
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2016 Beniamino Galvani 
+
+obj-y  := p201.o
diff --git a/board/amlogic/p201/README.p201 b/board/amlogic/p201/README.p201
new file mode 100644
index ..c251096ce142
--- /dev/null
+++ b/board/amlogic/p201/README.p201
@@ -0,0 +1,103 @@
+U-Boot for Amlogic P201
+===
+
+P201 is a reference board manufactured by Amlogic with the following
+specifications:
+
+ - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz
+ - ARM Mali 450 GPU
+ - 2GB DDR3 SDRAM
+ - 10/100 Ethernet
+ - HDMI 2.0 4K/60Hz display
+ - 2 x USB 2.0 Host
+ - eMMC, microSD
+ - Infrared receiver
+ - SDIO WiFi Module
+ - CVBS+Stereo Audio Jack
+
+Schematics are available from Amlogic on demand.
+
+Currently the u-boot port supports the following devices:
+ - serial
+ - eMMC, microSD
+ - Ethernet
+ - I2C
+ - Regulators
+ - Reset controller
+ - Clock controller
+ - USB Host
+ - ADC
+
+u-boot compilation
+==
+
+ > export ARCH=arm
+ > export CROSS_COMPILE=aarch64-none-elf-
+ > make p201_defconfig
+ > make
+
+Image creation
+==
+
+Amlogic doesn't provide sources for the firmware and for tools needed
+to create the bootloader image, so it is necessary to obtain them from
+the git tree published by the board vendor:
+
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > export 
PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
+ > git clone https://github.com/BayLibre/u-boot.git -b 
n-amlogic-openlinux-20170606 amlogic-u-boot
+ > cd amlogic-u-boot
+ > make gxb_p201_v1_defconfig
+ > make
+ > export FIPDIR=$PWD/fip
+
+Go back to mainline U-boot source tree then :
+ > mkdir fip
+
+ > cp $FIPDIR/gxl/bl2.bin fip/
+ > cp $FIPDIR/gxl/acs.bin fip/
+ > cp $FIPDIR/gxl/bl21.bin fip/
+ > cp $FIPDIR/gxl/bl30.bin fip/
+ > cp $FIPDIR/gxl/bl301.bin fip/
+ > cp $FIPDIR/gxl/bl31.img fip/
+ > cp u-boot.bin fip/bl33.bin
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl30.bin \
+   fip/zero_tmp \
+   fip/bl30_zero.bin \
+   fip/bl301.bin \
+   fip/bl301_zero.bin \
+   fip/bl30_new.bin \
+   bl30
+
+ > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl2_acs.bin \
+   fip/zero_tmp \
+   fip/bl2_zero.bin \
+   fip/bl21.bin \
+   fip/bl21_zero.bin \
+   fip/bl2_new.bin \
+   bl2
+
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output 
fip/bl2.n.bin.sig
+ > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
+   --output fip/u-boot.bin \
+   --bl2 fip/bl2.n.bin.sig \
+   --bl30 fip/bl30_new.bin.enc \
+   --bl31 fip/bl31.img.enc \
+   --bl33 fip/bl33.bin.enc
+
+and then write the image to SD with:
+
+ > DEV=/dev/your_sd_device
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
diff --git a/board/amlogic/p201/p201.c b/board/amlogic/p201/p201.c
new file mode 100644
index ..ef0c65cd9f89
--- /dev/null
+++ b/board/amlogic/p201/p201.c
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2016 Be

[U-Boot] [PATCH v5 3/5] ARM: dts: meson: add u-boot.dtsi for p200 and p201

2019-03-23 Thread Mohammad Rasim
This adds *-u-boot.dtsi files for p200 and p201 boards
These are just copies of arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi

Signed-off-by: Mohammad Rasim 
Acked-by: Neil Armstrong 
---
 arch/arm/dts/meson-gxbb-p200-u-boot.dtsi | 7 +++
 arch/arm/dts/meson-gxbb-p201-u-boot.dtsi | 7 +++
 2 files changed, 14 insertions(+)
 create mode 100644 arch/arm/dts/meson-gxbb-p200-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-p201-u-boot.dtsi

diff --git a/arch/arm/dts/meson-gxbb-p200-u-boot.dtsi 
b/arch/arm/dts/meson-gxbb-p200-u-boot.dtsi
new file mode 100644
index ..c35158d7e9ee
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-p200-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong 
+ */
+
+#include "meson-gx-u-boot.dtsi"
diff --git a/arch/arm/dts/meson-gxbb-p201-u-boot.dtsi 
b/arch/arm/dts/meson-gxbb-p201-u-boot.dtsi
new file mode 100644
index ..c35158d7e9ee
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-p201-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong 
+ */
+
+#include "meson-gx-u-boot.dtsi"
--
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v5 2/5] ARM: dts: meson: add p200 and p201 boards

2019-03-23 Thread Mohammad Rasim
This adds the device trees for p200 and p201 boards.
Synced from kernel 5.0.0
Commit: a667cb7a94d4 ("Merge branch 'akpm' (patches from Andrew)")

Signed-off-by: Mohammad Rasim 
Acked-by: Neil Armstrong 
---
 arch/arm/dts/Makefile |   2 +
 arch/arm/dts/meson-gxbb-p200.dts  |  99 
 arch/arm/dts/meson-gxbb-p201.dts  |  26 
 arch/arm/dts/meson-gxbb-p20x.dtsi | 247 ++
 4 files changed, 374 insertions(+)
 create mode 100644 arch/arm/dts/meson-gxbb-p200.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p201.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p20x.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 2a040b20a539..adf5f26facc1 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -60,6 +60,8 @@ dtb-$(CONFIG_ARCH_MESON) += \
meson-gxbb-nanopi-k2.dtb \
meson-gxbb-odroidc2.dtb \
meson-gxbb-nanopi-k2.dtb \
+   meson-gxbb-p200.dtb \
+   meson-gxbb-p201.dtb \
meson-gxl-s905x-p212.dtb \
meson-gxl-s905x-libretech-cc.dtb \
meson-gxl-s905x-khadas-vim.dtb \
diff --git a/arch/arm/dts/meson-gxbb-p200.dts b/arch/arm/dts/meson-gxbb-p200.dts
new file mode 100644
index ..9d2406a7c4fa
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-p200.dts
@@ -0,0 +1,99 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2016 Andreas Färber
+ * Copyright (c) 2016 BayLibre, Inc.
+ * Author: Kevin Hilman 
+ */
+
+/dts-v1/;
+
+#include "meson-gxbb-p20x.dtsi"
+#include 
+
+/ {
+   compatible = "amlogic,p200", "amlogic,meson-gxbb";
+   model = "Amlogic Meson GXBB P200 Development Board";
+
+   avdd18_usb_adc: regulator-avdd18_usb_adc {
+   compatible = "regulator-fixed";
+   regulator-name = "AVDD18_USB_ADC";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   };
+
+   adc_keys {
+   compatible = "adc-keys";
+   io-channels = < 0>;
+   io-channel-names = "buttons";
+   keyup-threshold-microvolt = <180>;
+
+   button-home {
+   label = "Home";
+   linux,code = ;
+   press-threshold-microvolt = <90>; /* 50% */
+   };
+
+   button-esc {
+   label = "Esc";
+   linux,code = ;
+   press-threshold-microvolt = <684000>; /* 38% */
+   };
+
+   button-up {
+   label = "Volume Up";
+   linux,code = ;
+   press-threshold-microvolt = <468000>; /* 26% */
+   };
+
+   button-down {
+   label = "Volume Down";
+   linux,code = ;
+   press-threshold-microvolt = <252000>; /* 14% */
+   };
+
+   button-menu {
+   label = "Menu";
+   linux,code = ;
+   press-threshold-microvolt = <0>; /* 0% */
+   };
+   };
+};
+
+ {
+   status = "okay";
+   pinctrl-0 = <_rgmii_pins>;
+   pinctrl-names = "default";
+   phy-handle = <_phy0>;
+   phy-mode = "rgmii";
+
+   amlogic,tx-delay-ns = <2>;
+
+   snps,reset-gpio = < GPIOZ_14 0>;
+   snps,reset-delays-us = <0 1 100>;
+   snps,reset-active-low;
+
+   mdio {
+   compatible = "snps,dwmac-mdio";
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   eth_phy0: ethernet-phy@3 {
+   /* Micrel KSZ9031 (0x00221620) */
+   reg = <3>;
+   interrupt-parent = <_intc>;
+   /* MAC_INTR on GPIOZ_15 */
+   interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
+   };
+   };
+};
+
+_B {
+   status = "okay";
+   pinctrl-0 = <_b_pins>;
+   pinctrl-names = "default";
+};
+
+ {
+   status = "okay";
+   vref-supply = <_usb_adc>;
+};
diff --git a/arch/arm/dts/meson-gxbb-p201.dts b/arch/arm/dts/meson-gxbb-p201.dts
new file mode 100644
index ..56e0dd1ff55c
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-p201.dts
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2016 Andreas Färber
+ * Copyright (c) 2016 BayLibre, Inc.
+ * Author: Kevin Hilman 
+ */
+
+/dts-v1/;
+
+#include "meson-gxbb-p20x.dtsi"
+
+/ {
+   compatible = "amlogic,p201", "amlogic,meson-gxbb";
+   model = "Amlogic Meson G

[U-Boot] [PATCH v5 0/5] ARM: meson: add support for p200 and p201 boards

2019-03-23 Thread Mohammad Rasim
This adds support for p200 and p201 reference boards from amlogic

Mohammad Rasim (5):
  ARM: board: meson: rename odroid-c2 to p200
  ARM: dts: meson: add p200 and p201 boards
  ARM: dts: meson: add u-boot.dtsi for p200 and p201
  ARM: board: meson: add p200 board
  ARM: board: meson: add p201 board

 arch/arm/dts/Makefile |   2 +
 arch/arm/dts/meson-gxbb-p200-u-boot.dtsi  |   7 +
 arch/arm/dts/meson-gxbb-p200.dts  |  99 +++
 arch/arm/dts/meson-gxbb-p201-u-boot.dtsi  |   7 +
 arch/arm/dts/meson-gxbb-p201.dts  |  26 ++
 arch/arm/dts/meson-gxbb-p20x.dtsi | 247 ++
 arch/arm/mach-meson/Kconfig   |   2 +-
 board/amlogic/{odroid-c2 => p200}/MAINTAINERS |   6 +-
 board/amlogic/{odroid-c2 => p200}/Makefile|   2 +-
 .../{odroid-c2 => p200}/README.nanopi-k2  |   0
 .../{odroid-c2 => p200}/README.odroid-c2  |   0
 board/amlogic/p200/README.p200| 103 
 .../{odroid-c2/odroid-c2.c => p200/p200.c}|   0
 board/amlogic/p201/MAINTAINERS|   5 +
 board/amlogic/p201/Makefile   |   5 +
 board/amlogic/p201/README.p201| 103 
 board/amlogic/p201/p201.c |  43 +++
 configs/p200_defconfig|  41 +++
 configs/p201_defconfig|  41 +++
 19 files changed, 734 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/meson-gxbb-p200-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-p200.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p201-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-p201.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p20x.dtsi
 rename board/amlogic/{odroid-c2 => p200}/MAINTAINERS (70%)
 rename board/amlogic/{odroid-c2 => p200}/Makefile (82%)
 rename board/amlogic/{odroid-c2 => p200}/README.nanopi-k2 (100%)
 rename board/amlogic/{odroid-c2 => p200}/README.odroid-c2 (100%)
 create mode 100644 board/amlogic/p200/README.p200
 rename board/amlogic/{odroid-c2/odroid-c2.c => p200/p200.c} (100%)
 create mode 100644 board/amlogic/p201/MAINTAINERS
 create mode 100644 board/amlogic/p201/Makefile
 create mode 100644 board/amlogic/p201/README.p201
 create mode 100644 board/amlogic/p201/p201.c
 create mode 100644 configs/p200_defconfig
 create mode 100644 configs/p201_defconfig

--
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v5 1/5] ARM: board: meson: rename odroid-c2 to p200

2019-03-23 Thread Mohammad Rasim
This renames the odroid-c2 to p200 and set it as the default GXBB board
Other boards (odroid-c2 and nanopi-k2) will inherit from p200

Signed-off-by: Mohammad Rasim 
Acked-by: Neil Armstrong 
---
 arch/arm/mach-meson/Kconfig  | 2 +-
 board/amlogic/{odroid-c2 => p200}/MAINTAINERS| 5 ++---
 board/amlogic/{odroid-c2 => p200}/Makefile   | 2 +-
 board/amlogic/{odroid-c2 => p200}/README.nanopi-k2   | 0
 board/amlogic/{odroid-c2 => p200}/README.odroid-c2   | 0
 board/amlogic/{odroid-c2/odroid-c2.c => p200/p200.c} | 0
 6 files changed, 4 insertions(+), 5 deletions(-)
 rename board/amlogic/{odroid-c2 => p200}/MAINTAINERS (70%)
 rename board/amlogic/{odroid-c2 => p200}/Makefile (82%)
 rename board/amlogic/{odroid-c2 => p200}/README.nanopi-k2 (100%)
 rename board/amlogic/{odroid-c2 => p200}/README.odroid-c2 (100%)
 rename board/amlogic/{odroid-c2/odroid-c2.c => p200/p200.c} (100%)

diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
index 11077bc6cc24..1b1d0aef0d22 100644
--- a/arch/arm/mach-meson/Kconfig
+++ b/arch/arm/mach-meson/Kconfig
@@ -61,7 +61,7 @@ config SYS_VENDOR

 config SYS_BOARD
string "Board name"
-   default "odroid-c2" if MESON_GXBB
+   default "p200" if MESON_GXBB
default "p212" if MESON_GXL
default "q200" if MESON_GXM
default "s400" if MESON_AXG
diff --git a/board/amlogic/odroid-c2/MAINTAINERS 
b/board/amlogic/p200/MAINTAINERS
similarity index 70%
rename from board/amlogic/odroid-c2/MAINTAINERS
rename to board/amlogic/p200/MAINTAINERS
index 6a853066d781..77a055b681d9 100644
--- a/board/amlogic/odroid-c2/MAINTAINERS
+++ b/board/amlogic/p200/MAINTAINERS
@@ -1,8 +1,7 @@
-ODROID-C2
+P200
 M: Beniamino Galvani 
 M: Neil Armstrong 
 S: Maintained
-F: board/amlogic/odroid-c2/
-F: include/configs/odroid-c2.h
+F: board/amlogic/p200/
 F: configs/nanopi-k2_defconfig
 F: configs/odroid-c2_defconfig
diff --git a/board/amlogic/odroid-c2/Makefile b/board/amlogic/p200/Makefile
similarity index 82%
rename from board/amlogic/odroid-c2/Makefile
rename to board/amlogic/p200/Makefile
index a6a3db755f21..f82a7ea9ca6b 100644
--- a/board/amlogic/odroid-c2/Makefile
+++ b/board/amlogic/p200/Makefile
@@ -2,4 +2,4 @@
 #
 # (C) Copyright 2016 Beniamino Galvani 

-obj-y  := odroid-c2.o
+obj-y  := p200.o
diff --git a/board/amlogic/odroid-c2/README.nanopi-k2 
b/board/amlogic/p200/README.nanopi-k2
similarity index 100%
rename from board/amlogic/odroid-c2/README.nanopi-k2
rename to board/amlogic/p200/README.nanopi-k2
diff --git a/board/amlogic/odroid-c2/README.odroid-c2 
b/board/amlogic/p200/README.odroid-c2
similarity index 100%
rename from board/amlogic/odroid-c2/README.odroid-c2
rename to board/amlogic/p200/README.odroid-c2
diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/p200/p200.c
similarity index 100%
rename from board/amlogic/odroid-c2/odroid-c2.c
rename to board/amlogic/p200/p200.c
--
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 5/5] ARM: board: meson: add p201 board

2019-03-15 Thread Mohammad Rasim
This adds the p201 reference board

Signed-off-by: Mohammad Rasim 
Acked-by: Neil Armstrong 
---
 board/amlogic/p201/MAINTAINERS |   5 ++
 board/amlogic/p201/Makefile|   5 ++
 board/amlogic/p201/README.p201 | 103 +
 board/amlogic/p201/p201.c  |  43 ++
 configs/p201_defconfig |  41 +
 5 files changed, 197 insertions(+)
 create mode 100644 board/amlogic/p201/MAINTAINERS
 create mode 100644 board/amlogic/p201/Makefile
 create mode 100644 board/amlogic/p201/README.p201
 create mode 100644 board/amlogic/p201/p201.c
 create mode 100644 configs/p201_defconfig

diff --git a/board/amlogic/p201/MAINTAINERS b/board/amlogic/p201/MAINTAINERS
new file mode 100644
index ..3e84a8e2a2af
--- /dev/null
+++ b/board/amlogic/p201/MAINTAINERS
@@ -0,0 +1,5 @@
+P201
+M: Neil Armstrong 
+S: Maintained
+F: board/amlogic/p201/
+F: configs/p201_defconfig
diff --git a/board/amlogic/p201/Makefile b/board/amlogic/p201/Makefile
new file mode 100644
index ..11de5396ab4c
--- /dev/null
+++ b/board/amlogic/p201/Makefile
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2016 Beniamino Galvani 
+
+obj-y  := p201.o
diff --git a/board/amlogic/p201/README.p201 b/board/amlogic/p201/README.p201
new file mode 100644
index ..c251096ce142
--- /dev/null
+++ b/board/amlogic/p201/README.p201
@@ -0,0 +1,103 @@
+U-Boot for Amlogic P201
+===
+
+P201 is a reference board manufactured by Amlogic with the following
+specifications:
+
+ - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz
+ - ARM Mali 450 GPU
+ - 2GB DDR3 SDRAM
+ - 10/100 Ethernet
+ - HDMI 2.0 4K/60Hz display
+ - 2 x USB 2.0 Host
+ - eMMC, microSD
+ - Infrared receiver
+ - SDIO WiFi Module
+ - CVBS+Stereo Audio Jack
+
+Schematics are available from Amlogic on demand.
+
+Currently the u-boot port supports the following devices:
+ - serial
+ - eMMC, microSD
+ - Ethernet
+ - I2C
+ - Regulators
+ - Reset controller
+ - Clock controller
+ - USB Host
+ - ADC
+
+u-boot compilation
+==
+
+ > export ARCH=arm
+ > export CROSS_COMPILE=aarch64-none-elf-
+ > make p201_defconfig
+ > make
+
+Image creation
+==
+
+Amlogic doesn't provide sources for the firmware and for tools needed
+to create the bootloader image, so it is necessary to obtain them from
+the git tree published by the board vendor:
+
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > export 
PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
+ > git clone https://github.com/BayLibre/u-boot.git -b 
n-amlogic-openlinux-20170606 amlogic-u-boot
+ > cd amlogic-u-boot
+ > make gxb_p201_v1_defconfig
+ > make
+ > export FIPDIR=$PWD/fip
+
+Go back to mainline U-boot source tree then :
+ > mkdir fip
+
+ > cp $FIPDIR/gxl/bl2.bin fip/
+ > cp $FIPDIR/gxl/acs.bin fip/
+ > cp $FIPDIR/gxl/bl21.bin fip/
+ > cp $FIPDIR/gxl/bl30.bin fip/
+ > cp $FIPDIR/gxl/bl301.bin fip/
+ > cp $FIPDIR/gxl/bl31.img fip/
+ > cp u-boot.bin fip/bl33.bin
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl30.bin \
+   fip/zero_tmp \
+   fip/bl30_zero.bin \
+   fip/bl301.bin \
+   fip/bl301_zero.bin \
+   fip/bl30_new.bin \
+   bl30
+
+ > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl2_acs.bin \
+   fip/zero_tmp \
+   fip/bl2_zero.bin \
+   fip/bl21.bin \
+   fip/bl21_zero.bin \
+   fip/bl2_new.bin \
+   bl2
+
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output 
fip/bl2.n.bin.sig
+ > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
+   --output fip/u-boot.bin \
+   --bl2 fip/bl2.n.bin.sig \
+   --bl30 fip/bl30_new.bin.enc \
+   --bl31 fip/bl31.img.enc \
+   --bl33 fip/bl33.bin.enc
+
+and then write the image to SD with:
+
+ > DEV=/dev/your_sd_device
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
diff --git a/board/amlogic/p201/p201.c b/board/amlogic/p201/p201.c
new file mode 100644
index ..ef0c65cd9f89
--- /dev/null
+++ b/board/amlogic/p201/p201.c
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyri

[U-Boot] [PATCH v4 4/5] ARM: board: meson: add p200 board

2019-03-15 Thread Mohammad Rasim
This adds the p200 defconfig

Signed-off-by: Mohammad Rasim 
---
 configs/p200_defconfig | 41 +
 1 file changed, 41 insertions(+)
 create mode 100644 configs/p200_defconfig

diff --git a/configs/p200_defconfig b/configs/p200_defconfig
new file mode 100644
index ..3980e4eb5f1d
--- /dev/null
+++ b/configs/p200_defconfig
@@ -0,0 +1,41 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MESON=y
+CONFIG_SYS_TEXT_BASE=0x0100
+CONFIG_DEBUG_UART_BASE=0xc81004c0
+CONFIG_DEBUG_UART_CLOCK=2400
+CONFIG_IDENT_STRING=" p200"
+CONFIG_DEBUG_UART=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_MISC_INIT_R=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+# CONFIG_CMD_BDI is not set
+# CONFIG_CMD_IMI is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MMC=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_REGULATOR=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-p200"
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_MESON=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_MESON_GX=y
+CONFIG_DM_ETH=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_MESON_GXBB=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_RESET=y
+CONFIG_DEBUG_UART_MESON=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
+CONFIG_DEBUG_UART_SKIP_INIT=y
+CONFIG_MESON_SERIAL=y
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_SYS_BOARD="p200"
--
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 2/5] ARM: dts: meson: add p200 and p201 boards

2019-03-15 Thread Mohammad Rasim
This adds the device trees for p200 and p201 boards.
Synced from kernel 5.0.0
Commit a667cb7a94d4 ("Merge branch 'akpm' (patches from Andrew)")

Signed-off-by: Mohammad Rasim 
Acked-by: Neil Armstrong 
---
 arch/arm/dts/Makefile |   2 +
 arch/arm/dts/meson-gxbb-p200.dts  |  99 
 arch/arm/dts/meson-gxbb-p201.dts  |  26 
 arch/arm/dts/meson-gxbb-p20x.dtsi | 247 ++
 4 files changed, 374 insertions(+)
 create mode 100644 arch/arm/dts/meson-gxbb-p200.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p201.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p20x.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 2a040b20a539..adf5f26facc1 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -60,6 +60,8 @@ dtb-$(CONFIG_ARCH_MESON) += \
meson-gxbb-nanopi-k2.dtb \
meson-gxbb-odroidc2.dtb \
meson-gxbb-nanopi-k2.dtb \
+   meson-gxbb-p200.dtb \
+   meson-gxbb-p201.dtb \
meson-gxl-s905x-p212.dtb \
meson-gxl-s905x-libretech-cc.dtb \
meson-gxl-s905x-khadas-vim.dtb \
diff --git a/arch/arm/dts/meson-gxbb-p200.dts b/arch/arm/dts/meson-gxbb-p200.dts
new file mode 100644
index ..9d2406a7c4fa
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-p200.dts
@@ -0,0 +1,99 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2016 Andreas Färber
+ * Copyright (c) 2016 BayLibre, Inc.
+ * Author: Kevin Hilman 
+ */
+
+/dts-v1/;
+
+#include "meson-gxbb-p20x.dtsi"
+#include 
+
+/ {
+   compatible = "amlogic,p200", "amlogic,meson-gxbb";
+   model = "Amlogic Meson GXBB P200 Development Board";
+
+   avdd18_usb_adc: regulator-avdd18_usb_adc {
+   compatible = "regulator-fixed";
+   regulator-name = "AVDD18_USB_ADC";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   };
+
+   adc_keys {
+   compatible = "adc-keys";
+   io-channels = < 0>;
+   io-channel-names = "buttons";
+   keyup-threshold-microvolt = <180>;
+
+   button-home {
+   label = "Home";
+   linux,code = ;
+   press-threshold-microvolt = <90>; /* 50% */
+   };
+
+   button-esc {
+   label = "Esc";
+   linux,code = ;
+   press-threshold-microvolt = <684000>; /* 38% */
+   };
+
+   button-up {
+   label = "Volume Up";
+   linux,code = ;
+   press-threshold-microvolt = <468000>; /* 26% */
+   };
+
+   button-down {
+   label = "Volume Down";
+   linux,code = ;
+   press-threshold-microvolt = <252000>; /* 14% */
+   };
+
+   button-menu {
+   label = "Menu";
+   linux,code = ;
+   press-threshold-microvolt = <0>; /* 0% */
+   };
+   };
+};
+
+ {
+   status = "okay";
+   pinctrl-0 = <_rgmii_pins>;
+   pinctrl-names = "default";
+   phy-handle = <_phy0>;
+   phy-mode = "rgmii";
+
+   amlogic,tx-delay-ns = <2>;
+
+   snps,reset-gpio = < GPIOZ_14 0>;
+   snps,reset-delays-us = <0 1 100>;
+   snps,reset-active-low;
+
+   mdio {
+   compatible = "snps,dwmac-mdio";
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   eth_phy0: ethernet-phy@3 {
+   /* Micrel KSZ9031 (0x00221620) */
+   reg = <3>;
+   interrupt-parent = <_intc>;
+   /* MAC_INTR on GPIOZ_15 */
+   interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
+   };
+   };
+};
+
+_B {
+   status = "okay";
+   pinctrl-0 = <_b_pins>;
+   pinctrl-names = "default";
+};
+
+ {
+   status = "okay";
+   vref-supply = <_usb_adc>;
+};
diff --git a/arch/arm/dts/meson-gxbb-p201.dts b/arch/arm/dts/meson-gxbb-p201.dts
new file mode 100644
index ..56e0dd1ff55c
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-p201.dts
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2016 Andreas Färber
+ * Copyright (c) 2016 BayLibre, Inc.
+ * Author: Kevin Hilman 
+ */
+
+/dts-v1/;
+
+#include "meson-gxbb-p20x.dtsi"
+
+/ {
+   compatible = "amlogic,p201", "amlogic,meson-gxbb";
+   model = "Amlogic Meson G

[U-Boot] [PATCH v4 3/5] Arm: dts: meson: add u-boot.dtsi for p200 and p201

2019-03-15 Thread Mohammad Rasim
This adds *-u-boot.dtsi files for p200 and p201 boards
These are just copies of arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi

Signed-off-by: Mohammad Rasim 
---
 arch/arm/dts/meson-gxbb-p200-u-boot.dtsi | 7 +++
 arch/arm/dts/meson-gxbb-p201-u-boot.dtsi | 7 +++
 2 files changed, 14 insertions(+)
 create mode 100644 arch/arm/dts/meson-gxbb-p200-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-p201-u-boot.dtsi

diff --git a/arch/arm/dts/meson-gxbb-p200-u-boot.dtsi 
b/arch/arm/dts/meson-gxbb-p200-u-boot.dtsi
new file mode 100644
index ..c35158d7e9ee
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-p200-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong 
+ */
+
+#include "meson-gx-u-boot.dtsi"
diff --git a/arch/arm/dts/meson-gxbb-p201-u-boot.dtsi 
b/arch/arm/dts/meson-gxbb-p201-u-boot.dtsi
new file mode 100644
index ..c35158d7e9ee
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-p201-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong 
+ */
+
+#include "meson-gx-u-boot.dtsi"
--
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 1/5] ARM: board: meson: rename odroid-c2 to p200

2019-03-15 Thread Mohammad Rasim
This renames the odroid-c2 to p200 and set it as the default GXBB board
Other boards (odroid-c2 and nanopi-k2) will inherit from p200

Signed-off-by: Mohammad Rasim 
---
 arch/arm/mach-meson/Kconfig   |   2 +-
 board/amlogic/{odroid-c2 => p200}/MAINTAINERS |   6 +-
 board/amlogic/{odroid-c2 => p200}/Makefile|   2 +-
 .../{odroid-c2 => p200}/README.nanopi-k2  |   0
 .../{odroid-c2 => p200}/README.odroid-c2  |   0
 board/amlogic/p200/README.p200| 103 ++
 .../{odroid-c2/odroid-c2.c => p200/p200.c}|   0
 configs/nanopi-k2_defconfig   |   1 +
 configs/odroid-c2_defconfig   |   1 +
 9 files changed, 110 insertions(+), 5 deletions(-)
 rename board/amlogic/{odroid-c2 => p200}/MAINTAINERS (70%)
 rename board/amlogic/{odroid-c2 => p200}/Makefile (82%)
 rename board/amlogic/{odroid-c2 => p200}/README.nanopi-k2 (100%)
 rename board/amlogic/{odroid-c2 => p200}/README.odroid-c2 (100%)
 create mode 100644 board/amlogic/p200/README.p200
 rename board/amlogic/{odroid-c2/odroid-c2.c => p200/p200.c} (100%)

diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
index 11077bc6cc24..1b1d0aef0d22 100644
--- a/arch/arm/mach-meson/Kconfig
+++ b/arch/arm/mach-meson/Kconfig
@@ -61,7 +61,7 @@ config SYS_VENDOR

 config SYS_BOARD
string "Board name"
-   default "odroid-c2" if MESON_GXBB
+   default "p200" if MESON_GXBB
default "p212" if MESON_GXL
default "q200" if MESON_GXM
default "s400" if MESON_AXG
diff --git a/board/amlogic/odroid-c2/MAINTAINERS 
b/board/amlogic/p200/MAINTAINERS
similarity index 70%
rename from board/amlogic/odroid-c2/MAINTAINERS
rename to board/amlogic/p200/MAINTAINERS
index 6a853066d781..96fe92dd0874 100644
--- a/board/amlogic/odroid-c2/MAINTAINERS
+++ b/board/amlogic/p200/MAINTAINERS
@@ -1,8 +1,8 @@
-ODROID-C2
+P200
 M: Beniamino Galvani 
 M: Neil Armstrong 
 S: Maintained
-F: board/amlogic/odroid-c2/
-F: include/configs/odroid-c2.h
+F: board/amlogic/p200/
 F: configs/nanopi-k2_defconfig
 F: configs/odroid-c2_defconfig
+F: configs/p200_defconfig
diff --git a/board/amlogic/odroid-c2/Makefile b/board/amlogic/p200/Makefile
similarity index 82%
rename from board/amlogic/odroid-c2/Makefile
rename to board/amlogic/p200/Makefile
index a6a3db755f21..f82a7ea9ca6b 100644
--- a/board/amlogic/odroid-c2/Makefile
+++ b/board/amlogic/p200/Makefile
@@ -2,4 +2,4 @@
 #
 # (C) Copyright 2016 Beniamino Galvani 

-obj-y  := odroid-c2.o
+obj-y  := p200.o
diff --git a/board/amlogic/odroid-c2/README.nanopi-k2 
b/board/amlogic/p200/README.nanopi-k2
similarity index 100%
rename from board/amlogic/odroid-c2/README.nanopi-k2
rename to board/amlogic/p200/README.nanopi-k2
diff --git a/board/amlogic/odroid-c2/README.odroid-c2 
b/board/amlogic/p200/README.odroid-c2
similarity index 100%
rename from board/amlogic/odroid-c2/README.odroid-c2
rename to board/amlogic/p200/README.odroid-c2
diff --git a/board/amlogic/p200/README.p200 b/board/amlogic/p200/README.p200
new file mode 100644
index ..01d82d1e79e3
--- /dev/null
+++ b/board/amlogic/p200/README.p200
@@ -0,0 +1,103 @@
+U-Boot for Amlogic P200
+===
+
+P200 is a reference board manufactured by Amlogic with the following
+specifications:
+
+ - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz
+ - ARM Mali 450 GPU
+ - 2GB DDR3 SDRAM
+ - Gigabit Ethernet
+ - HDMI 2.0 4K/60Hz display
+ - 2 x USB 2.0 Host
+ - eMMC, microSD
+ - Infrared receiver
+ - SDIO WiFi Module
+ - CVBS+Stereo Audio Jack
+
+Schematics are available from Amlogic on demand.
+
+Currently the u-boot port supports the following devices:
+ - serial
+ - eMMC, microSD
+ - Ethernet
+ - I2C
+ - Regulators
+ - Reset controller
+ - Clock controller
+ - USB Host
+ - ADC
+
+u-boot compilation
+==
+
+ > export ARCH=arm
+ > export CROSS_COMPILE=aarch64-none-elf-
+ > make p200_defconfig
+ > make
+
+Image creation
+==
+
+Amlogic doesn't provide sources for the firmware and for tools needed
+to create the bootloader image, so it is necessary to obtain them from
+the git tree published by the board vendor:
+
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > export 
PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
+ > git clone https://github.com/BayLibre/u-boot.git -b 
n-amlogic-openlinux-20170606 amlogic-u-boot
+ > cd amlogic-u-boot
+ > make gxb_p200_v1_defconfig
+

[U-Boot] [PATCH v4 0/5] Arm: meson: add support for p200 and p201 boards

2019-03-15 Thread Mohammad Rasim

This adds support for p200 and p201 reference boards from amlogic

Mohammad Rasim (5):
  ARM: board: meson: rename odroid-c2 to p200
  ARM: dts: meson: add p200 and p201 boards
  Arm: dts: meson: add u-boot.dtsi for p200 and p201
  ARM: board: meson: add p200 board
  ARM: board: meson: add p201 board

 arch/arm/dts/Makefile |   2 +
 arch/arm/dts/meson-gxbb-p200-u-boot.dtsi  |   7 +
 arch/arm/dts/meson-gxbb-p200.dts  |  99 +++
 arch/arm/dts/meson-gxbb-p201-u-boot.dtsi  |   7 +
 arch/arm/dts/meson-gxbb-p201.dts  |  26 ++
 arch/arm/dts/meson-gxbb-p20x.dtsi | 247 ++
 arch/arm/mach-meson/Kconfig   |   2 +-
 board/amlogic/{odroid-c2 => p200}/MAINTAINERS |   6 +-
 board/amlogic/{odroid-c2 => p200}/Makefile|   2 +-
 .../{odroid-c2 => p200}/README.nanopi-k2  |   0
 .../{odroid-c2 => p200}/README.odroid-c2  |   0
 board/amlogic/p200/README.p200| 103 
 .../{odroid-c2/odroid-c2.c => p200/p200.c}|   0
 board/amlogic/p201/MAINTAINERS|   5 +
 board/amlogic/p201/Makefile   |   5 +
 board/amlogic/p201/README.p201| 103 
 board/amlogic/p201/p201.c |  43 +++
 configs/nanopi-k2_defconfig   |   1 +
 configs/odroid-c2_defconfig   |   1 +
 configs/p200_defconfig|  41 +++
 configs/p201_defconfig|  41 +++
 21 files changed, 736 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/meson-gxbb-p200-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-p200.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p201-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-p201.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p20x.dtsi
 rename board/amlogic/{odroid-c2 => p200}/MAINTAINERS (70%)
 rename board/amlogic/{odroid-c2 => p200}/Makefile (82%)
 rename board/amlogic/{odroid-c2 => p200}/README.nanopi-k2 (100%)
 rename board/amlogic/{odroid-c2 => p200}/README.odroid-c2 (100%)
 create mode 100644 board/amlogic/p200/README.p200
 rename board/amlogic/{odroid-c2/odroid-c2.c => p200/p200.c} (100%)
 create mode 100644 board/amlogic/p201/MAINTAINERS
 create mode 100644 board/amlogic/p201/Makefile
 create mode 100644 board/amlogic/p201/README.p201
 create mode 100644 board/amlogic/p201/p201.c
 create mode 100644 configs/p200_defconfig
 create mode 100644 configs/p201_defconfig

--
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 3/3] ARM: board: meson: add p200 board

2019-03-14 Thread Mohammad Rasim
Signed-off-by: Mohammad Rasim 
---
 board/amlogic/odroid-c2/MAINTAINERS |   1 +
 board/amlogic/odroid-c2/README.p200 | 103 
 configs/p200_defconfig  |  41 +++
 3 files changed, 145 insertions(+)
 create mode 100644 board/amlogic/odroid-c2/README.p200
 create mode 100644 configs/p200_defconfig

diff --git a/board/amlogic/odroid-c2/MAINTAINERS 
b/board/amlogic/odroid-c2/MAINTAINERS
index 6a853066d7..617d9c7045 100644
--- a/board/amlogic/odroid-c2/MAINTAINERS
+++ b/board/amlogic/odroid-c2/MAINTAINERS
@@ -6,3 +6,4 @@ F:  board/amlogic/odroid-c2/
 F: include/configs/odroid-c2.h
 F: configs/nanopi-k2_defconfig
 F: configs/odroid-c2_defconfig
+F: configs/p200_defconfig
diff --git a/board/amlogic/odroid-c2/README.p200 
b/board/amlogic/odroid-c2/README.p200
new file mode 100644
index 00..01d82d1e79
--- /dev/null
+++ b/board/amlogic/odroid-c2/README.p200
@@ -0,0 +1,103 @@
+U-Boot for Amlogic P200
+===
+
+P200 is a reference board manufactured by Amlogic with the following
+specifications:
+
+ - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz
+ - ARM Mali 450 GPU
+ - 2GB DDR3 SDRAM
+ - Gigabit Ethernet
+ - HDMI 2.0 4K/60Hz display
+ - 2 x USB 2.0 Host
+ - eMMC, microSD
+ - Infrared receiver
+ - SDIO WiFi Module
+ - CVBS+Stereo Audio Jack
+
+Schematics are available from Amlogic on demand.
+
+Currently the u-boot port supports the following devices:
+ - serial
+ - eMMC, microSD
+ - Ethernet
+ - I2C
+ - Regulators
+ - Reset controller
+ - Clock controller
+ - USB Host
+ - ADC
+
+u-boot compilation
+==
+
+ > export ARCH=arm
+ > export CROSS_COMPILE=aarch64-none-elf-
+ > make p200_defconfig
+ > make
+
+Image creation
+==
+
+Amlogic doesn't provide sources for the firmware and for tools needed
+to create the bootloader image, so it is necessary to obtain them from
+the git tree published by the board vendor:
+
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > export 
PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
+ > git clone https://github.com/BayLibre/u-boot.git -b 
n-amlogic-openlinux-20170606 amlogic-u-boot
+ > cd amlogic-u-boot
+ > make gxb_p200_v1_defconfig
+ > make
+ > export FIPDIR=$PWD/fip
+
+Go back to mainline U-boot source tree then :
+ > mkdir fip
+
+ > cp $FIPDIR/gxl/bl2.bin fip/
+ > cp $FIPDIR/gxl/acs.bin fip/
+ > cp $FIPDIR/gxl/bl21.bin fip/
+ > cp $FIPDIR/gxl/bl30.bin fip/
+ > cp $FIPDIR/gxl/bl301.bin fip/
+ > cp $FIPDIR/gxl/bl31.img fip/
+ > cp u-boot.bin fip/bl33.bin
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl30.bin \
+   fip/zero_tmp \
+   fip/bl30_zero.bin \
+   fip/bl301.bin \
+   fip/bl301_zero.bin \
+   fip/bl30_new.bin \
+   bl30
+
+ > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl2_acs.bin \
+   fip/zero_tmp \
+   fip/bl2_zero.bin \
+   fip/bl21.bin \
+   fip/bl21_zero.bin \
+   fip/bl2_new.bin \
+   bl2
+
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output 
fip/bl2.n.bin.sig
+ > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
+   --output fip/u-boot.bin \
+   --bl2 fip/bl2.n.bin.sig \
+   --bl30 fip/bl30_new.bin.enc \
+   --bl31 fip/bl31.img.enc \
+   --bl33 fip/bl33.bin.enc
+
+and then write the image to SD with:
+
+ > DEV=/dev/your_sd_device
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
diff --git a/configs/p200_defconfig b/configs/p200_defconfig
new file mode 100644
index 00..4011866140
--- /dev/null
+++ b/configs/p200_defconfig
@@ -0,0 +1,41 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MESON=y
+CONFIG_SYS_TEXT_BASE=0x0100
+CONFIG_DEBUG_UART_BASE=0xc81004c0
+CONFIG_DEBUG_UART_CLOCK=2400
+CONFIG_IDENT_STRING=" p200"
+CONFIG_DEBUG_UART=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_MISC_INIT_R=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+# CONFIG_CMD_BDI is not set
+# CONFIG_CMD_IMI is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MMC=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_REGULATOR=y
+C

[U-Boot] [PATCH v3 2/3] ARM: board: meson: add p201 board

2019-03-14 Thread Mohammad Rasim
Signed-off-by: Mohammad Rasim 
Acked-by: Neil Armstrong 
---
 board/amlogic/p201/MAINTAINERS |   5 ++
 board/amlogic/p201/Makefile|   5 ++
 board/amlogic/p201/README.p201 | 103 +
 board/amlogic/p201/p201.c  |  43 ++
 configs/p201_defconfig |  41 +
 5 files changed, 197 insertions(+)
 create mode 100644 board/amlogic/p201/MAINTAINERS
 create mode 100644 board/amlogic/p201/Makefile
 create mode 100644 board/amlogic/p201/README.p201
 create mode 100644 board/amlogic/p201/p201.c
 create mode 100644 configs/p201_defconfig

diff --git a/board/amlogic/p201/MAINTAINERS b/board/amlogic/p201/MAINTAINERS
new file mode 100644
index 00..3e84a8e2a2
--- /dev/null
+++ b/board/amlogic/p201/MAINTAINERS
@@ -0,0 +1,5 @@
+P201
+M: Neil Armstrong 
+S: Maintained
+F: board/amlogic/p201/
+F: configs/p201_defconfig
diff --git a/board/amlogic/p201/Makefile b/board/amlogic/p201/Makefile
new file mode 100644
index 00..11de5396ab
--- /dev/null
+++ b/board/amlogic/p201/Makefile
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2016 Beniamino Galvani 
+
+obj-y  := p201.o
diff --git a/board/amlogic/p201/README.p201 b/board/amlogic/p201/README.p201
new file mode 100644
index 00..c251096ce1
--- /dev/null
+++ b/board/amlogic/p201/README.p201
@@ -0,0 +1,103 @@
+U-Boot for Amlogic P201
+===
+
+P201 is a reference board manufactured by Amlogic with the following
+specifications:
+
+ - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz
+ - ARM Mali 450 GPU
+ - 2GB DDR3 SDRAM
+ - 10/100 Ethernet
+ - HDMI 2.0 4K/60Hz display
+ - 2 x USB 2.0 Host
+ - eMMC, microSD
+ - Infrared receiver
+ - SDIO WiFi Module
+ - CVBS+Stereo Audio Jack
+
+Schematics are available from Amlogic on demand.
+
+Currently the u-boot port supports the following devices:
+ - serial
+ - eMMC, microSD
+ - Ethernet
+ - I2C
+ - Regulators
+ - Reset controller
+ - Clock controller
+ - USB Host
+ - ADC
+
+u-boot compilation
+==
+
+ > export ARCH=arm
+ > export CROSS_COMPILE=aarch64-none-elf-
+ > make p201_defconfig
+ > make
+
+Image creation
+==
+
+Amlogic doesn't provide sources for the firmware and for tools needed
+to create the bootloader image, so it is necessary to obtain them from
+the git tree published by the board vendor:
+
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > export 
PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
+ > git clone https://github.com/BayLibre/u-boot.git -b 
n-amlogic-openlinux-20170606 amlogic-u-boot
+ > cd amlogic-u-boot
+ > make gxb_p201_v1_defconfig
+ > make
+ > export FIPDIR=$PWD/fip
+
+Go back to mainline U-boot source tree then :
+ > mkdir fip
+
+ > cp $FIPDIR/gxl/bl2.bin fip/
+ > cp $FIPDIR/gxl/acs.bin fip/
+ > cp $FIPDIR/gxl/bl21.bin fip/
+ > cp $FIPDIR/gxl/bl30.bin fip/
+ > cp $FIPDIR/gxl/bl301.bin fip/
+ > cp $FIPDIR/gxl/bl31.img fip/
+ > cp u-boot.bin fip/bl33.bin
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl30.bin \
+   fip/zero_tmp \
+   fip/bl30_zero.bin \
+   fip/bl301.bin \
+   fip/bl301_zero.bin \
+   fip/bl30_new.bin \
+   bl30
+
+ > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl2_acs.bin \
+   fip/zero_tmp \
+   fip/bl2_zero.bin \
+   fip/bl21.bin \
+   fip/bl21_zero.bin \
+   fip/bl2_new.bin \
+   bl2
+
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output 
fip/bl2.n.bin.sig
+ > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
+   --output fip/u-boot.bin \
+   --bl2 fip/bl2.n.bin.sig \
+   --bl30 fip/bl30_new.bin.enc \
+   --bl31 fip/bl31.img.enc \
+   --bl33 fip/bl33.bin.enc
+
+and then write the image to SD with:
+
+ > DEV=/dev/your_sd_device
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
diff --git a/board/amlogic/p201/p201.c b/board/amlogic/p201/p201.c
new file mode 100644
index 00..ef0c65cd9f
--- /dev/null
+++ b/board/amlogic/p201/p201.c
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2016 Beniamino Galvani 
+ */
+
+#include 
+#in

[U-Boot] [PATCH v3 0/3] ARM: meson: add p200 and p201 boards

2019-03-14 Thread Mohammad Rasim
This adds support for p200 and p201 reference boards from amlogic

Mohammad Rasim (3):
  ARM: dts: meson: add p200 and p201 boards
  ARM: board: meson: add p201 board
  ARM: board: meson: add p200 board

 arch/arm/dts/Makefile   |   2 +
 arch/arm/dts/meson-gxbb-p200.dts|  99 +++
 arch/arm/dts/meson-gxbb-p201.dts|  26 +++
 arch/arm/dts/meson-gxbb-p20x.dtsi   | 247 
 board/amlogic/odroid-c2/MAINTAINERS |   1 +
 board/amlogic/odroid-c2/README.p200 | 103 
 board/amlogic/p201/MAINTAINERS  |   5 +
 board/amlogic/p201/Makefile |   5 +
 board/amlogic/p201/README.p201  | 103 
 board/amlogic/p201/p201.c   |  43 +
 configs/p200_defconfig  |  41 +
 configs/p201_defconfig  |  41 +
 12 files changed, 716 insertions(+)
 create mode 100644 arch/arm/dts/meson-gxbb-p200.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p201.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p20x.dtsi
 create mode 100644 board/amlogic/odroid-c2/README.p200
 create mode 100644 board/amlogic/p201/MAINTAINERS
 create mode 100644 board/amlogic/p201/Makefile
 create mode 100644 board/amlogic/p201/README.p201
 create mode 100644 board/amlogic/p201/p201.c
 create mode 100644 configs/p200_defconfig
 create mode 100644 configs/p201_defconfig

--
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 1/3] ARM: dts: meson: add p200 and p201 boards

2019-03-14 Thread Mohammad Rasim

This adds the device trees for p200 and p201 boards.
Synced from kernel 5.0.0
Commit a667cb7a94d4 ("Merge branch 'akpm' (patches from Andrew)")

Signed-off-by: Mohammad Rasim 
Acked-by: Neil Armstrong 
---
 arch/arm/dts/Makefile |   2 +
 arch/arm/dts/meson-gxbb-p200.dts  |  99 
 arch/arm/dts/meson-gxbb-p201.dts  |  26 
 arch/arm/dts/meson-gxbb-p20x.dtsi | 247 ++
 4 files changed, 374 insertions(+)
 create mode 100644 arch/arm/dts/meson-gxbb-p200.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p201.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p20x.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 2a040b20a5..adf5f26fac 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -60,6 +60,8 @@ dtb-$(CONFIG_ARCH_MESON) += \
meson-gxbb-nanopi-k2.dtb \
meson-gxbb-odroidc2.dtb \
meson-gxbb-nanopi-k2.dtb \
+   meson-gxbb-p200.dtb \
+   meson-gxbb-p201.dtb \
meson-gxl-s905x-p212.dtb \
meson-gxl-s905x-libretech-cc.dtb \
meson-gxl-s905x-khadas-vim.dtb \
diff --git a/arch/arm/dts/meson-gxbb-p200.dts b/arch/arm/dts/meson-gxbb-p200.dts
new file mode 100644
index 00..9d2406a7c4
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-p200.dts
@@ -0,0 +1,99 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2016 Andreas Färber
+ * Copyright (c) 2016 BayLibre, Inc.
+ * Author: Kevin Hilman 
+ */
+
+/dts-v1/;
+
+#include "meson-gxbb-p20x.dtsi"
+#include 
+
+/ {
+   compatible = "amlogic,p200", "amlogic,meson-gxbb";
+   model = "Amlogic Meson GXBB P200 Development Board";
+
+   avdd18_usb_adc: regulator-avdd18_usb_adc {
+   compatible = "regulator-fixed";
+   regulator-name = "AVDD18_USB_ADC";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   };
+
+   adc_keys {
+   compatible = "adc-keys";
+   io-channels = < 0>;
+   io-channel-names = "buttons";
+   keyup-threshold-microvolt = <180>;
+
+   button-home {
+   label = "Home";
+   linux,code = ;
+   press-threshold-microvolt = <90>; /* 50% */
+   };
+
+   button-esc {
+   label = "Esc";
+   linux,code = ;
+   press-threshold-microvolt = <684000>; /* 38% */
+   };
+
+   button-up {
+   label = "Volume Up";
+   linux,code = ;
+   press-threshold-microvolt = <468000>; /* 26% */
+   };
+
+   button-down {
+   label = "Volume Down";
+   linux,code = ;
+   press-threshold-microvolt = <252000>; /* 14% */
+   };
+
+   button-menu {
+   label = "Menu";
+   linux,code = ;
+   press-threshold-microvolt = <0>; /* 0% */
+   };
+   };
+};
+
+ {
+   status = "okay";
+   pinctrl-0 = <_rgmii_pins>;
+   pinctrl-names = "default";
+   phy-handle = <_phy0>;
+   phy-mode = "rgmii";
+
+   amlogic,tx-delay-ns = <2>;
+
+   snps,reset-gpio = < GPIOZ_14 0>;
+   snps,reset-delays-us = <0 1 100>;
+   snps,reset-active-low;
+
+   mdio {
+   compatible = "snps,dwmac-mdio";
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   eth_phy0: ethernet-phy@3 {
+   /* Micrel KSZ9031 (0x00221620) */
+   reg = <3>;
+   interrupt-parent = <_intc>;
+   /* MAC_INTR on GPIOZ_15 */
+   interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
+   };
+   };
+};
+
+_B {
+   status = "okay";
+   pinctrl-0 = <_b_pins>;
+   pinctrl-names = "default";
+};
+
+ {
+   status = "okay";
+   vref-supply = <_usb_adc>;
+};
diff --git a/arch/arm/dts/meson-gxbb-p201.dts b/arch/arm/dts/meson-gxbb-p201.dts
new file mode 100644
index 00..56e0dd1ff5
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-p201.dts
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2016 Andreas Färber
+ * Copyright (c) 2016 BayLibre, Inc.
+ * Author: Kevin Hilman 
+ */
+
+/dts-v1/;
+
+#include "meson-gxbb-p20x.dtsi"
+
+/ {
+   compatible = "amlogic,p201", "amlogic,meson-gxbb";
+   model = "Amlogic Meson GXBB P201 Devel

[U-Boot] [PATCH v2 3/3] ARM: board: meson: add p200 board

2019-03-14 Thread Mohammad Rasim

Signed-off-by: Mohammad Rasim 
---
 board/amlogic/odroid-c2/README.p200 | 103 
 configs/p200_defconfig  |  41 +++
 2 files changed, 144 insertions(+)
 create mode 100644 board/amlogic/odroid-c2/README.p200
 create mode 100644 configs/p200_defconfig

diff --git a/board/amlogic/odroid-c2/README.p200 
b/board/amlogic/odroid-c2/README.p200
new file mode 100644
index 00..01d82d1e79
--- /dev/null
+++ b/board/amlogic/odroid-c2/README.p200
@@ -0,0 +1,103 @@
+U-Boot for Amlogic P200
+===
+
+P200 is a reference board manufactured by Amlogic with the following
+specifications:
+
+ - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz
+ - ARM Mali 450 GPU
+ - 2GB DDR3 SDRAM
+ - Gigabit Ethernet
+ - HDMI 2.0 4K/60Hz display
+ - 2 x USB 2.0 Host
+ - eMMC, microSD
+ - Infrared receiver
+ - SDIO WiFi Module
+ - CVBS+Stereo Audio Jack
+
+Schematics are available from Amlogic on demand.
+
+Currently the u-boot port supports the following devices:
+ - serial
+ - eMMC, microSD
+ - Ethernet
+ - I2C
+ - Regulators
+ - Reset controller
+ - Clock controller
+ - USB Host
+ - ADC
+
+u-boot compilation
+==
+
+ > export ARCH=arm
+ > export CROSS_COMPILE=aarch64-none-elf-
+ > make p200_defconfig
+ > make
+
+Image creation
+==
+
+Amlogic doesn't provide sources for the firmware and for tools needed
+to create the bootloader image, so it is necessary to obtain them from
+the git tree published by the board vendor:
+
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > export 
PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
+ > git clone https://github.com/BayLibre/u-boot.git -b 
n-amlogic-openlinux-20170606 amlogic-u-boot
+ > cd amlogic-u-boot
+ > make gxb_p200_v1_defconfig
+ > make
+ > export FIPDIR=$PWD/fip
+
+Go back to mainline U-boot source tree then :
+ > mkdir fip
+
+ > cp $FIPDIR/gxl/bl2.bin fip/
+ > cp $FIPDIR/gxl/acs.bin fip/
+ > cp $FIPDIR/gxl/bl21.bin fip/
+ > cp $FIPDIR/gxl/bl30.bin fip/
+ > cp $FIPDIR/gxl/bl301.bin fip/
+ > cp $FIPDIR/gxl/bl31.img fip/
+ > cp u-boot.bin fip/bl33.bin
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl30.bin \
+   fip/zero_tmp \
+   fip/bl30_zero.bin \
+   fip/bl301.bin \
+   fip/bl301_zero.bin \
+   fip/bl30_new.bin \
+   bl30
+
+ > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl2_acs.bin \
+   fip/zero_tmp \
+   fip/bl2_zero.bin \
+   fip/bl21.bin \
+   fip/bl21_zero.bin \
+   fip/bl2_new.bin \
+   bl2
+
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output 
fip/bl2.n.bin.sig
+ > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
+   --output fip/u-boot.bin \
+   --bl2 fip/bl2.n.bin.sig \
+   --bl30 fip/bl30_new.bin.enc \
+   --bl31 fip/bl31.img.enc \
+   --bl33 fip/bl33.bin.enc
+
+and then write the image to SD with:
+
+ > DEV=/dev/your_sd_device
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
diff --git a/configs/p200_defconfig b/configs/p200_defconfig
new file mode 100644
index 00..4011866140
--- /dev/null
+++ b/configs/p200_defconfig
@@ -0,0 +1,41 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MESON=y
+CONFIG_SYS_TEXT_BASE=0x0100
+CONFIG_DEBUG_UART_BASE=0xc81004c0
+CONFIG_DEBUG_UART_CLOCK=2400
+CONFIG_IDENT_STRING=" p200"
+CONFIG_DEBUG_UART=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_MISC_INIT_R=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+# CONFIG_CMD_BDI is not set
+# CONFIG_CMD_IMI is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MMC=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_REGULATOR=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-p200"
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_MESON=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_MESON_GX=y
+CONFIG_DM_ETH=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_MESON_GXBB=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_RESET=y
+CONFIG_DEBUG_UART_MESON=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
+C

[U-Boot] [PATCH v2 2/3] ARM: board: meson: add p201 board

2019-03-14 Thread Mohammad Rasim

Signed-off-by: Mohammad Rasim 
---
 board/amlogic/p201/MAINTAINERS |   6 ++
 board/amlogic/p201/Makefile|   5 ++
 board/amlogic/p201/README.p201 | 103 +
 board/amlogic/p201/p201.c  |  43 ++
 configs/p201_defconfig |  41 +
 5 files changed, 198 insertions(+)
 create mode 100644 board/amlogic/p201/MAINTAINERS
 create mode 100644 board/amlogic/p201/Makefile
 create mode 100644 board/amlogic/p201/README.p201
 create mode 100644 board/amlogic/p201/p201.c
 create mode 100644 configs/p201_defconfig

diff --git a/board/amlogic/p201/MAINTAINERS b/board/amlogic/p201/MAINTAINERS
new file mode 100644
index 00..6ebb5f6396
--- /dev/null
+++ b/board/amlogic/p201/MAINTAINERS
@@ -0,0 +1,6 @@
+P201
+M: Beniamino Galvani 
+M: Neil Armstrong 
+S: Maintained
+F: board/amlogic/p201/
+F: configs/p201_defconfig
diff --git a/board/amlogic/p201/Makefile b/board/amlogic/p201/Makefile
new file mode 100644
index 00..11de5396ab
--- /dev/null
+++ b/board/amlogic/p201/Makefile
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2016 Beniamino Galvani 
+
+obj-y  := p201.o
diff --git a/board/amlogic/p201/README.p201 b/board/amlogic/p201/README.p201
new file mode 100644
index 00..c251096ce1
--- /dev/null
+++ b/board/amlogic/p201/README.p201
@@ -0,0 +1,103 @@
+U-Boot for Amlogic P201
+===
+
+P201 is a reference board manufactured by Amlogic with the following
+specifications:
+
+ - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz
+ - ARM Mali 450 GPU
+ - 2GB DDR3 SDRAM
+ - 10/100 Ethernet
+ - HDMI 2.0 4K/60Hz display
+ - 2 x USB 2.0 Host
+ - eMMC, microSD
+ - Infrared receiver
+ - SDIO WiFi Module
+ - CVBS+Stereo Audio Jack
+
+Schematics are available from Amlogic on demand.
+
+Currently the u-boot port supports the following devices:
+ - serial
+ - eMMC, microSD
+ - Ethernet
+ - I2C
+ - Regulators
+ - Reset controller
+ - Clock controller
+ - USB Host
+ - ADC
+
+u-boot compilation
+==
+
+ > export ARCH=arm
+ > export CROSS_COMPILE=aarch64-none-elf-
+ > make p201_defconfig
+ > make
+
+Image creation
+==
+
+Amlogic doesn't provide sources for the firmware and for tools needed
+to create the bootloader image, so it is necessary to obtain them from
+the git tree published by the board vendor:
+
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > export 
PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
+ > git clone https://github.com/BayLibre/u-boot.git -b 
n-amlogic-openlinux-20170606 amlogic-u-boot
+ > cd amlogic-u-boot
+ > make gxb_p201_v1_defconfig
+ > make
+ > export FIPDIR=$PWD/fip
+
+Go back to mainline U-boot source tree then :
+ > mkdir fip
+
+ > cp $FIPDIR/gxl/bl2.bin fip/
+ > cp $FIPDIR/gxl/acs.bin fip/
+ > cp $FIPDIR/gxl/bl21.bin fip/
+ > cp $FIPDIR/gxl/bl30.bin fip/
+ > cp $FIPDIR/gxl/bl301.bin fip/
+ > cp $FIPDIR/gxl/bl31.img fip/
+ > cp u-boot.bin fip/bl33.bin
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl30.bin \
+   fip/zero_tmp \
+   fip/bl30_zero.bin \
+   fip/bl301.bin \
+   fip/bl301_zero.bin \
+   fip/bl30_new.bin \
+   bl30
+
+ > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
+
+ > $FIPDIR/blx_fix.sh \
+   fip/bl2_acs.bin \
+   fip/zero_tmp \
+   fip/bl2_zero.bin \
+   fip/bl21.bin \
+   fip/bl21_zero.bin \
+   fip/bl2_new.bin \
+   bl2
+
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output 
fip/bl2.n.bin.sig
+ > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
+   --output fip/u-boot.bin \
+   --bl2 fip/bl2.n.bin.sig \
+   --bl30 fip/bl30_new.bin.enc \
+   --bl31 fip/bl31.img.enc \
+   --bl33 fip/bl33.bin.enc
+
+and then write the image to SD with:
+
+ > DEV=/dev/your_sd_device
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
diff --git a/board/amlogic/p201/p201.c b/board/amlogic/p201/p201.c
new file mode 100644
index 00..ef0c65cd9f
--- /dev/null
+++ b/board/amlogic/p201/p201.c
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2016 Beniamino Galvani 
+ */
+
+#include 
+#in

[U-Boot] [PATCH v2 1/3] ARM: dts: meson: add p200 and p201 boards

2019-03-14 Thread Mohammad Rasim
This adds the device trees for p200 and p201 boards.
Synced from kernel 5.0.0 revision a667cb7a94d48a483fb5d6006fe04a440f1a42ce.

Signed-off-by: Mohammad Rasim 
---
 arch/arm/dts/Makefile |   2 +
 arch/arm/dts/meson-gxbb-p200.dts  |  99 
 arch/arm/dts/meson-gxbb-p201.dts  |  26 
 arch/arm/dts/meson-gxbb-p20x.dtsi | 247 ++
 4 files changed, 374 insertions(+)
 create mode 100644 arch/arm/dts/meson-gxbb-p200.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p201.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p20x.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 2a040b20a5..adf5f26fac 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -60,6 +60,8 @@ dtb-$(CONFIG_ARCH_MESON) += \
meson-gxbb-nanopi-k2.dtb \
meson-gxbb-odroidc2.dtb \
meson-gxbb-nanopi-k2.dtb \
+   meson-gxbb-p200.dtb \
+   meson-gxbb-p201.dtb \
meson-gxl-s905x-p212.dtb \
meson-gxl-s905x-libretech-cc.dtb \
meson-gxl-s905x-khadas-vim.dtb \
diff --git a/arch/arm/dts/meson-gxbb-p200.dts b/arch/arm/dts/meson-gxbb-p200.dts
new file mode 100644
index 00..9d2406a7c4
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-p200.dts
@@ -0,0 +1,99 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2016 Andreas Färber
+ * Copyright (c) 2016 BayLibre, Inc.
+ * Author: Kevin Hilman 
+ */
+
+/dts-v1/;
+
+#include "meson-gxbb-p20x.dtsi"
+#include 
+
+/ {
+   compatible = "amlogic,p200", "amlogic,meson-gxbb";
+   model = "Amlogic Meson GXBB P200 Development Board";
+
+   avdd18_usb_adc: regulator-avdd18_usb_adc {
+   compatible = "regulator-fixed";
+   regulator-name = "AVDD18_USB_ADC";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   };
+
+   adc_keys {
+   compatible = "adc-keys";
+   io-channels = < 0>;
+   io-channel-names = "buttons";
+   keyup-threshold-microvolt = <180>;
+
+   button-home {
+   label = "Home";
+   linux,code = ;
+   press-threshold-microvolt = <90>; /* 50% */
+   };
+
+   button-esc {
+   label = "Esc";
+   linux,code = ;
+   press-threshold-microvolt = <684000>; /* 38% */
+   };
+
+   button-up {
+   label = "Volume Up";
+   linux,code = ;
+   press-threshold-microvolt = <468000>; /* 26% */
+   };
+
+   button-down {
+   label = "Volume Down";
+   linux,code = ;
+   press-threshold-microvolt = <252000>; /* 14% */
+   };
+
+   button-menu {
+   label = "Menu";
+   linux,code = ;
+   press-threshold-microvolt = <0>; /* 0% */
+   };
+   };
+};
+
+ {
+   status = "okay";
+   pinctrl-0 = <_rgmii_pins>;
+   pinctrl-names = "default";
+   phy-handle = <_phy0>;
+   phy-mode = "rgmii";
+
+   amlogic,tx-delay-ns = <2>;
+
+   snps,reset-gpio = < GPIOZ_14 0>;
+   snps,reset-delays-us = <0 1 100>;
+   snps,reset-active-low;
+
+   mdio {
+   compatible = "snps,dwmac-mdio";
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   eth_phy0: ethernet-phy@3 {
+   /* Micrel KSZ9031 (0x00221620) */
+   reg = <3>;
+   interrupt-parent = <_intc>;
+   /* MAC_INTR on GPIOZ_15 */
+   interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
+   };
+   };
+};
+
+_B {
+   status = "okay";
+   pinctrl-0 = <_b_pins>;
+   pinctrl-names = "default";
+};
+
+ {
+   status = "okay";
+   vref-supply = <_usb_adc>;
+};
diff --git a/arch/arm/dts/meson-gxbb-p201.dts b/arch/arm/dts/meson-gxbb-p201.dts
new file mode 100644
index 00..56e0dd1ff5
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-p201.dts
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2016 Andreas Färber
+ * Copyright (c) 2016 BayLibre, Inc.
+ * Author: Kevin Hilman 
+ */
+
+/dts-v1/;
+
+#include "meson-gxbb-p20x.dtsi"
+
+/ {
+   compatible = "amlogic,p201", "amlogic,meson-gxbb";
+   model = "Amlogic Meson GXBB P201 Development Board";
+};
+
+ {
+   status =

[U-Boot] [PATCH v2 0/3] ARM: meson: add p200 and p201 boards

2019-03-14 Thread Mohammad Rasim

This adds support for p200 and p201 reference boards from amlogic

Mohammad Rasim (3):
  ARM: dts: meson: add p200 and p201 boards
  ARM: board: meson: add p201 board
  ARM: board: meson: add p200 board

 arch/arm/dts/Makefile   |   2 +
 arch/arm/dts/meson-gxbb-p200.dts|  99 +++
 arch/arm/dts/meson-gxbb-p201.dts|  26 +++
 arch/arm/dts/meson-gxbb-p20x.dtsi   | 247 
 board/amlogic/odroid-c2/README.p200 | 103 
 board/amlogic/p201/MAINTAINERS  |   6 +
 board/amlogic/p201/Makefile |   5 +
 board/amlogic/p201/README.p201  | 103 
 board/amlogic/p201/p201.c   |  43 +
 configs/p200_defconfig  |  41 +
 configs/p201_defconfig  |  41 +
 11 files changed, 716 insertions(+)
 create mode 100644 arch/arm/dts/meson-gxbb-p200.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p201.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p20x.dtsi
 create mode 100644 board/amlogic/odroid-c2/README.p200
 create mode 100644 board/amlogic/p201/MAINTAINERS
 create mode 100644 board/amlogic/p201/Makefile
 create mode 100644 board/amlogic/p201/README.p201
 create mode 100644 board/amlogic/p201/p201.c
 create mode 100644 configs/p200_defconfig
 create mode 100644 configs/p201_defconfig

--
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 0/2] ARM: meson: add p200 and p201 boards

2019-03-14 Thread Mohammad Rasim
This adds support for p200 and p201 reference boards from amlogic

Mohammad Rasim (2):
  ARM: dts: meson: add p200 and p201 boards
  ARM: board: meson: add p200 and p201 boards

 arch/arm/dts/Makefile   |   2 +
 arch/arm/dts/meson-gxbb-p200.dts|  99 +++
 arch/arm/dts/meson-gxbb-p201.dts|  26 +++
 arch/arm/dts/meson-gxbb-p20x.dtsi   | 247 
 board/amlogic/odroid-c2/README.p200 | 103 
 board/amlogic/p201/MAINTAINERS  |   6 +
 board/amlogic/p201/Makefile |   5 +
 board/amlogic/p201/README.p201  | 103 
 board/amlogic/p201/p201.c   |  43 +
 configs/p200_defconfig  |  41 +
 configs/p201_defconfig  |  41 +
 11 files changed, 716 insertions(+)
 create mode 100644 arch/arm/dts/meson-gxbb-p200.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p201.dts
 create mode 100644 arch/arm/dts/meson-gxbb-p20x.dtsi
 create mode 100644 board/amlogic/odroid-c2/README.p200
 create mode 100644 board/amlogic/p201/MAINTAINERS
 create mode 100644 board/amlogic/p201/Makefile
 create mode 100644 board/amlogic/p201/README.p201
 create mode 100644 board/amlogic/p201/p201.c
 create mode 100644 configs/p200_defconfig
 create mode 100644 configs/p201_defconfig

--
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] ARM: dts: meson: add p200 and p201 boards

2019-03-14 Thread Mohammad Rasim
On 19/03/14 04:05, Neil Armstrong wrote:
> Hi Mohammad,
>
> Thanks for patches,
>
> Can you specify from which kernel release you sync'ed the DT ?
kernel version: 5.0.0
revision: a667cb7a94d48a483fb5d6006fe04a440f1a42ce

Should I include this information in V2?
>
> On 14/03/2019 14:52, Mohammad Rasim wrote:
> > Signed-off-by: Mohammad Rasim 
> > ---
> >  arch/arm/dts/Makefile |   2 +
> >  arch/arm/dts/meson-gxbb-p200.dts  |  99 
> >  arch/arm/dts/meson-gxbb-p201.dts  |  26 
> >  arch/arm/dts/meson-gxbb-p20x.dtsi | 247 ++
> >  4 files changed, 374 insertions(+)
> >  create mode 100644 arch/arm/dts/meson-gxbb-p200.dts
> >  create mode 100644 arch/arm/dts/meson-gxbb-p201.dts
> >  create mode 100644 arch/arm/dts/meson-gxbb-p20x.dtsi
> >
> > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> > index 2a040b20a5..adf5f26fac 100644
> > --- a/arch/arm/dts/Makefile
> > +++ b/arch/arm/dts/Makefile
> > @@ -60,6 +60,8 @@ dtb-$(CONFIG_ARCH_MESON) += \
> > meson-gxbb-nanopi-k2.dtb \
> > meson-gxbb-odroidc2.dtb \
> > meson-gxbb-nanopi-k2.dtb \
> > +   meson-gxbb-p200.dtb \
> > +   meson-gxbb-p201.dtb \
> > meson-gxl-s905x-p212.dtb \
> > meson-gxl-s905x-libretech-cc.dtb \
> > meson-gxl-s905x-khadas-vim.dtb \
> > diff --git a/arch/arm/dts/meson-gxbb-p200.dts 
> > b/arch/arm/dts/meson-gxbb-p200.dts
> > new file mode 100644
> > index 00..9d2406a7c4
> > --- /dev/null
> > +++ b/arch/arm/dts/meson-gxbb-p200.dts
> > @@ -0,0 +1,99 @@
> > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > +/*
> > + * Copyright (c) 2016 Andreas Färber
>
> You should use format-patch and git send-email to send this patch, it will 
> keep the UTF-8 encoding.
I used format-patch but with my own smtp client (msmtp) which apparently
corrupted the message
>
> > + * Copyright (c) 2016 BayLibre, Inc.
> > + * Author: Kevin Hilman 
> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include "meson-gxbb-p20x.dtsi"
> > +#include 
> > +
> > +/ {
> > +   compatible = "amlogic,p200", "amlogic,meson-gxbb";
> > +   model = "Amlogic Meson GXBB P200 Development Board";
> > +
> > +   avdd18_usb_adc: regulator-avdd18_usb_adc {
> > +   compatible = "regulator-fixed";
> > +   regulator-name = "AVDD18_USB_ADC";
> > +   regulator-min-microvolt = <180>;
> > +   regulator-max-microvolt = <180>;
> > +   };
> > +
> > +   adc_keys {
> > +   compatible = "adc-keys";
> > +   io-channels = < 0>;
> > +   io-channel-names = "buttons";
> > +   keyup-threshold-microvolt = <180>;
> > +
> > +   button-home {
> > +   label = "Home";
> > +   linux,code = ;
> > +   press-threshold-microvolt = <90>; /* 50% */
> > +   };
> > +
> > +   button-esc {
> > +   label = "Esc";
> > +   linux,code = ;
> > +   press-threshold-microvolt = <684000>; /* 38% */
> > +   };
> > +
> > +   button-up {
> > +   label = "Volume Up";
> > +   linux,code = ;
> > +   press-threshold-microvolt = <468000>; /* 26% */
> > +   };
> > +
> > +   button-down {
> > +   label = "Volume Down";
> > +   linux,code = ;
> > +   press-threshold-microvolt = <252000>; /* 14% */
> > +   };
> > +
> > +   button-menu {
> > +   label = "Menu";
> > +   linux,code = ;
> > +   press-threshold-microvolt = <0>; /* 0% */
> > +   };
> > +   };
> > +};
> > +
> > + {
> > +   status = "okay";
> > +   pinctrl-0 = <_rgmii_pins>;
> > +   pinctrl-names = "default";
> > +   phy-handle = <_phy0>;
> > +   phy-mode = "rgmii";
> > +
> > +   amlogic,tx-delay-ns = <2>;
> > +
> > +   snps,reset-gpio = < GPIOZ_14 0>;
> > +   snps,reset-delays-us = <0 1 100>;
> > +   snps,reset-active-low;
> > +
> > +   mdio {
> > +   compatible = "snps,dwmac-mdio";

[U-Boot] u-boot environment utilities and mmc device(calculate fw_env.config parameters)

2017-10-12 Thread MOHAMMAD RASIM

Hi,
How can i calculate the numbers to plug in the configuration file of 
uboot tools(fw_env.config)?
My device doesn't have mtd devices instead it uses mmc block device, 
here are some info about the device


*$*lsblk -o FSTYPE,NAME,SIZE,PHY-SEC,LOG-SEC,ALIGNMENT,TYPE
NAME  SIZE PHY-SEC LOG-SEC ALIGNMENT TYPE
mmcblk0boot0    4M 512 512 0 disk
mmcblk0boot1    4M 512 512 0 disk
mmcblk0           14.6G 512 512    0 disk

u-boot reports the following partition table:

#
Partition table get from SPL is :
    name    offset size  flag
===
   0: bootloader 0 40  0
   1: reserved 240 400  0
   2: cache    6c0 2000  2
   3: env 2740 80  0
   4: logo    2840 200  1
   5: recovery    2ac0 200  1
   6: rsv 2d40 80  1
   7: tee 2e40 80  1
   8: crypt   2f40 200  1
   9: misc    31c0 200  1
  10: instaboot   3440 2000  1
  11: boot    54c0 200  1
  12: system  5740 4000  1
  13: data    97c0 30c20  4
mmc read lba=0x12000, blocks=0x2
mmc read lba=0x12002, blocks=0x2
mmc_read_partition_tbl: mmc read partition OK!
eMMC/TSD partition table have been checked OK!
mmc env offset: 0x2740
##

So the env offset is 2740 and size is 80 but when i try to plug 
them in fw_env.config using /dev/mmcblk0 as a device I still get bad CRC 
error

using hexdump i can get the environment at position 677392

###
$hexdump -C -s 677392 -n 4384 /dev/mmcblk0
000a5610  62 6f 6f 74 63 6d 64 3d  72 75 6e 20 73 74 6f 72 |bootcmd=run 
stor|
000a5620  65 62 6f 6f 74 00 62 6f  6f 74 64 65 6c 61 79 3d 
|eboot.bootdelay=|
000a5630  31 00 62 61 75 64 72 61  74 65 3d 31 31 35 32 30 
|1.baudrate=11520|
000a5640  30 00 65 74 68 61 64 64  72 3d 30 30 3a 31 35 3a 
|0.ethaddr=00:15:|
000a5650  31 38 3a 30 31 3a 38 31  3a 33 31 00 69 70 61 64 
|18:01:81:31.ipad|
000a5660  64 72 3d 31 30 2e 31 38  2e 39 2e 39 37 00 73 65 
|dr=10.18.9.97.se|
000a5670  72 76 65 72 69 70 3d 31  30 2e 31 38 2e 39 2e 31 
|rverip=10.18.9.1|
000a5680  31 33 00 70 72 65 62 6f  6f 74 3d 72 75 6e 20 66 
|13.preboot=run f|
000a5690  61 63 74 6f 72 79 5f 72  65 73 65 74 5f 70 6f 77 
|actory_reset_pow|
000a56a0  65 72 6f 66 66 5f 70 72  6f 74 65 63 74 3b 72 75 
|eroff_protect;ru|
000a56b0  6e 20 75 70 67 72 61 64  65 5f 63 68 65 63 6b 3b  |n 
upgrade_check;|
000a56c0  72 75 6e 20 62 6f 6f 74  6d 6f 64 65 5f 63 68 65  |run 
bootmode_che|
000a56d0  63 6b 3b 72 75 6e 20 69  6e 69 74 5f 64 69 73 70  |ck;run 
init_disp|
000a56e0  6c 61 79 3b 72 75 6e 20  73 74 6f 72 65 61 72 67  |lay;run 
storearg|
000a56f0  73 3b 72 75 6e 20 75 70  64 61 74 65 5f 6b 65 79  |s;run 
update_key|
000a5700  3b 72 75 6e 20 69 72 72  65 6d 6f 74 65 5f 75 70  |;run 
irremote_up|
000a5710  64 61 74 65 3b 72 75 6e  20 73 77 69 74 63 68 5f |date;run 
switch_|
000a5720  62 6f 6f 74 6d 6f 64 65  3b 00 67 61 74 65 77 61 
|bootmode;.gatewa|
000a5730  79 69 70 3d 31 30 2e 31  38 2e 39 2e 31 00 6e 65 
|yip=10.18.9.1.ne|
000a5740  74 6d 61 73 6b 3d 32 35  35 2e 32 35 35 2e 32 35 
|tmask=255.255.25|
000a5750  35 2e 30 00 68 6f 73 74  6e 61 6d 65 3d 61 72 6d 
|5.0.hostname=arm|
000a5760  5f 67 78 62 62 00 66 69  72 73 74 62 6f 6f 74 3d 
|_gxbb.firstboot=|
000a5770  31 00 75 70 67 72 61 64  65 5f 73 74 65 70 3d 30 
|1.upgrade_step=0|
000a5780  00 6c 6f 61 64 61 64 64  72 3d 31 30 38 30 30 30 
|.loadaddr=108000|
000a5790  30 00 6f 75 74 70 75 74  6d 6f 64 65 3d 31 30 38 
|0.outputmode=108|
000a57a0  30 70 36 30 68 7a 00 68  64 6d 69 6d 6f 64 65 3d 
|0p60hz.hdmimode=|
000a57b0  31 30 38 30 70 36 30 68  7a 00 63 76 62 73 6d 6f 
|1080p60hz.cvbsmo|
000a57c0  64 65 3d 35 37 36 63 76  62 73 00 64 69 73 70 6c 
|de=576cvbs.displ|
000a57d0  61 79 5f 77 69 64 74 68  3d 31 39 32 30 00 64 69 
|ay_width=1920.di|
000a57e0  73 70 6c 61 79 5f 68 65  69 67 68 74 3d 31 30 38 
|splay_height=108|
000a57f0  30 00 64 69 73 70 6c 61  79 5f 62 70 70 3d 31 36 
|0.display_bpp=16|
000a5800  00 64 69 73 70 6c 61 79  5f 63 6f 6c 6f 72 5f 69 
|.display_color_i|
000a5810  6e 64 65 78 3d 31 36 00  64 69 73 70 6c 61 79 5f 
|ndex=16.display_|
000a5820  6c 61 79 65 72 3d 6f 73  64 31 00 64 69 73 70 6c 
|layer=osd1.displ|
000a5830  61 79 5f 63 6f 6c 6f 72  5f 66 67 3d 30 78 66 66 
|ay_color_fg=0xff|
000a5840  66 66 00 64 69 73 70 6c  61 79 5f 63 6f 6c 6f 72