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

Jun Nie jun.nie at linaro.org
Fri Jan 5 08:51:11 UTC 2018


>> +/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.

The DT come from Linux but modified with removing necessary nodes.
>
>> +/ {
>> +     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).

Right, and working mode in u-boot is decided in compile time,
CONFIG_USB_MUSB_HOST.

>
>> +     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.

Thanks for pointing out! Is there any guidance, where DTS should come
from, what defconfig shall include, ...?  I am new to u-boot :-)

>
> The rest of the serie looks good, thanks!
> Maxime


Thanks for review!
Jun


More information about the U-Boot mailing list