[U-Boot] [PATCH 6/6] sunxi: Add initial Banana-Pi Zero support

Maxime Ripard maxime.ripard at free-electrons.com
Fri Jan 5 08:35:48 UTC 2018


Hi Jun,

On Fri, Jan 05, 2018 at 03:37:01PM +0800, Jun Nie wrote:
> Banana-Pi Zero is designed for IOT development
> using the Allwinner H2+ SOC.
> 
> Key features
> - Allwinner H2+, Quad-core Cortex-A7
> - 512MB DRAM
> - microSD slot
> - Serial Debug Port
> - Combo WiFi/BT
> - HDMI
> 
> Signed-off-by: Jun Nie <jun.nie at linaro.org>
> ---
>  arch/arm/dts/Makefile                           |   1 +
>  arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts | 113 ++++++++++++++++++++++++
>  configs/bananapi_zero_defconfig                 |  17 ++++
>  3 files changed, 131 insertions(+)
>  create mode 100644 arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts
>  create mode 100644 configs/bananapi_zero_defconfig
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index a895c70..80eec7e 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -327,6 +327,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \
>  	sun8i-a83t-cubietruck-plus.dtb \
>  	sun8i-a83t-tbs-a711.dts
>  dtb-$(CONFIG_MACH_SUN8I_H3) += \
> +	sun8i-h2-plus-bananapi-m2-zero.dtb \
>  	sun8i-h2-plus-orangepi-zero.dtb \
>  	sun8i-h3-bananapi-m2-plus.dtb \
>  	sun8i-h3-orangepi-2.dtb \
> diff --git a/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts b/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts
> new file mode 100644
> index 0000000..4d96c16
> --- /dev/null
> +++ b/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts
> @@ -0,0 +1,113 @@
> +/*
> + * Copyright (C) 2017 Jun Nie <jun.nie at linaro.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.
> + *
> + *  a) This file 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 file 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/;
> +#include "sun8i-h3.dtsi"
> +#include "sunxi-common-regulators.dtsi"
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>

Where is that DT coming from?

Usually, we'll just merge a DT merged in Linux.

> +/ {
> +	model = "Banana Pi BPI-M2-Zero";
> +	compatible = "sinovoip,bpi-m2-zero", "allwinner,sun8i-h2-plus";
> +
> +	aliases {
> +		serial0 = &uart0;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";
> +	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +
> +		pwr_led {
> +			label = "bananapi-m2-zero:red:pwr";
> +			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
> +			default-state = "on";
> +		};
> +	};
> +
> +	gpio_keys {
> +		compatible = "gpio-keys";
> +		pinctrl-names = "default";
> +
> +		sw4 {
> +			label = "power";
> +			linux,code = <BTN_0>;
> +			gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +};
> +
> +&mmc0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc0_pins_a>;
> +	vmmc-supply = <&reg_vcc3v3>;
> +	bus-width = <4>;
> +	/*
> +	 * In different revisions the board have different card detect
> +	 * configuration.
> +	 */
> +	broken-cd;
> +	status = "okay";
> +};
> +
> +&uart0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&uart0_pins_a>;
> +	status = "okay";
> +};
> +
> +&usb_otg {
> +	dr_mode = "otg";
> +	status = "okay";
> +};
> +
> +&usbphy {
> +	usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
> +	/* USB OTG VBUS is directly connected to 5V without any regulators */

Then it cannot really do OTG, but rather only peripheral (or host, if
the power is provided by the board).

> +	status = "okay";
> +};
> diff --git a/configs/bananapi_zero_defconfig b/configs/bananapi_zero_defconfig
> new file mode 100644
> index 0000000..9c78b21
> --- /dev/null
> +++ b/configs/bananapi_zero_defconfig
> @@ -0,0 +1,17 @@
> +CONFIG_ARM=y
> +CONFIG_ARCH_SUNXI=y
> +CONFIG_MACH_SUN8I_H3=y
> +CONFIG_DRAM_CLK=408
> +CONFIG_DRAM_ZQ=3881979
> +CONFIG_DRAM_ODT_EN=y
> +CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-bananapi-m2-zero"
> +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_SPL=y
> +# CONFIG_CMD_FLASH is not set
> +# CONFIG_CMD_FPGA is not set
> +CONFIG_CMD_USB_MASS_STORAGE=y

This shouldn't be enabled in the defconfig.

The rest of the serie looks good, 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: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180105/025a9ebc/attachment.sig>


More information about the U-Boot mailing list