[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#779311: linux 3.16.7-ckt4-3: [PATCH] Please add dts for the LeMaker Banana Pro



Source: linux
Version: 3.16.7-ckt4-3
Severity: Wishlist
Tags: patch

Hello,

the LeMaker Banana Pro is a small ARM development board based on the
Allwinner A20 SoC.  Its predecessor, the Banana Pi, is already
supported in the Debian kernel.  The main components of the board
(UART, MMC, SATA, USB, Ethernet) are supported in kernel 3.16, just
the device-tree information is missing.  Attached is a patch against
the current Debian kernel SVN to backport the devicetree data from
kernel 3.19.

Please note that I have replaced a few symbolic constants for the
pinmux setup (SUN4I_PINCTRL_10_MA, SUN4I_PINCTRL_NO_PULL and
SUN4I_PINCTRL_PULL_UP) in the dts with their numeric values (exactly
as they are handled in all other dtbs in kernel 3.16), because the
patchsets that introduce those symbolic constant definitions in later
kernels touch a bunch of unrelated files and shuffle around various
include files. Pulling in those changes would go against the
principle of making the backport minimal-invasive, so I decided to
use the numerical values as all dts files in kernel 3.16 do.

The attached patch is fully self-contained and provides only
additional device-tree data; it does not touch any existing code.
I therefore consider it suitable for inclusion into Jessie despite
the freeze.

Regards,
Karsten
-- 
Gem. Par. 28 Abs. 4 Bundesdatenschutzgesetz widerspreche ich der Nutzung
sowie der Weitergabe meiner personenbezogenen Daten für Zwecke der
Werbung sowie der Markt- oder Meinungsforschung.
Index: debian/patches/features/arm/dts-sun7i-Add-dts-file-for-Bananapro-board.patch
===================================================================
--- debian/patches/features/arm/dts-sun7i-Add-dts-file-for-Bananapro-board.patch	(revision 0)
+++ debian/patches/features/arm/dts-sun7i-Add-dts-file-for-Bananapro-board.patch	(working copy)
@@ -0,0 +1,293 @@
+From 10662a33dcd97f27004779df7e9188c124bc7076 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Sun, 18 Jan 2015 13:08:19 +0100
+Subject: ARM: dts: sun7i: Add dts file for Bananapro board
+Origin: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=10662a33dcd97f27004779df7e9188c124bc7076
+
+Add support for the new Bananapro A20 development board from lemaker.org.
+This board features 1G RAM, 2 USB A receptacles, 1 micro USB receptacle for
+OTG, 1 micro USB receptacle for power, HDMI, sata, Gbit ethernet, ir receiver,
+3.5 mm jack for a/v out, on board microphone, 40 gpio pins and sdio wifi.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+
+Index: linux-3.16.7-ckt7/arch/arm/boot/dts/Makefile
+===================================================================
+--- linux-3.16.7-ckt7.orig/arch/arm/boot/dts/Makefile
++++ linux-3.16.7-ckt7/arch/arm/boot/dts/Makefile
+@@ -377,6 +377,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \
+ 	sun6i-a31-m9.dtb
+ dtb-$(CONFIG_MACH_SUN7I) += \
+ 	sun7i-a20-bananapi.dtb \
++	sun7i-a20-bananapro.dtb \
+ 	sun7i-a20-cubieboard2.dtb \
+ 	sun7i-a20-cubietruck.dtb \
+ 	sun7i-a20-i12-tvbox.dtb \
+Index: linux-3.16.7-ckt7/arch/arm/boot/dts/sun7i-a20-bananapro.dts
+===================================================================
+--- /dev/null
++++ linux-3.16.7-ckt7/arch/arm/boot/dts/sun7i-a20-bananapro.dts
+@@ -0,0 +1,262 @@
++/*
++ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
++ *
++ * 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.
++ *
++ *     You should have received a copy of the GNU General Public
++ *     License along with this file; if not, write to the Free
++ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++ *     MA 02110-1301 USA
++ *
++ * 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 "sun7i-a20.dtsi"
++#include "sunxi-common-regulators.dtsi"
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/interrupt-controller/arm-gic.h>
++
++/ {
++	model = "LeMaker Banana Pro";
++	compatible = "lemaker,bananapro", "allwinner,sun7i-a20";
++
++	leds {
++		compatible = "gpio-leds";
++		pinctrl-names = "default";
++		pinctrl-0 = <&led_pins_bananapro>;
++
++		blue {
++			label = "bananapro:blue:usr";
++			gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>;
++		};
++
++		green {
++			label = "bananapro:green:usr";
++			gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>;
++		};
++	};
++
++	reg_gmac_3v3: gmac-3v3 {
++		compatible = "regulator-fixed";
++		pinctrl-names = "default";
++		pinctrl-0 = <&gmac_power_pin_bananapro>;
++		regulator-name = "gmac-3v3";
++		regulator-min-microvolt = <3300000>;
++		regulator-max-microvolt = <3300000>;
++		startup-delay-us = <100000>;
++		enable-active-high;
++		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>;
++	};
++
++	reg_vmmc3: vmmc3 {
++		compatible = "regulator-fixed";
++		pinctrl-names = "default";
++		pinctrl-0 = <&vmmc3_pin_bananapro>;
++		regulator-name = "vmmc3";
++		regulator-min-microvolt = <3300000>;
++		regulator-max-microvolt = <3300000>;
++		enable-active-high;
++		gpio = <&pio 7 22 GPIO_ACTIVE_HIGH>;
++	};
++};
++
++&ahci {
++	status = "okay";
++};
++
++&ehci0 {
++	status = "okay";
++};
++
++&ehci1 {
++	status = "okay";
++};
++
++&gmac {
++	pinctrl-names = "default";
++	pinctrl-0 = <&gmac_pins_rgmii_a>;
++	phy = <&phy1>;
++	phy-mode = "rgmii";
++	phy-supply = <&reg_gmac_3v3>;
++	status = "okay";
++
++	phy1: ethernet-phy@1 {
++		reg = <1>;
++	};
++};
++
++&i2c0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&i2c0_pins_a>;
++	status = "okay";
++
++	axp209: pmic@34 {
++		compatible = "x-powers,axp209";
++		reg = <0x34>;
++		interrupt-parent = <&nmi_intc>;
++		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
++
++		interrupt-controller;
++		#interrupt-cells = <1>;
++	};
++};
++
++&i2c2 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&i2c2_pins_a>;
++	status = "okay";
++};
++
++&ir0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&ir0_pins_a>;
++	status = "okay";
++};
++
++&mmc0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapro>;
++	vmmc-supply = <&reg_vcc3v3>;
++	bus-width = <4>;
++	cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
++	cd-inverted;
++	status = "okay";
++};
++
++&mmc3 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&mmc3_pins_a>;
++	vmmc-supply = <&reg_vmmc3>;
++	bus-width = <4>;
++	non-removable;
++	status = "okay";
++};
++
++&ohci0 {
++	status = "okay";
++};
++
++&ohci1 {
++	status = "okay";
++};
++
++&pio {
++	gmac_power_pin_bananapro: gmac_power_pin@0 {
++		allwinner,pins = "PH23";
++		allwinner,function = "gpio_out";
++		allwinner,drive = <0>;
++		allwinner,pull = <0>;
++	};
++
++	led_pins_bananapro: led_pins@0 {
++		allwinner,pins = "PH24", "PG2";
++		allwinner,function = "gpio_out";
++		allwinner,drive = <0>;
++		allwinner,pull = <0>;
++	};
++
++	mmc0_cd_pin_bananapro: mmc0_cd_pin@0 {
++		allwinner,pins = "PH10";
++		allwinner,function = "gpio_in";
++		allwinner,drive = <0>;
++		allwinner,pull = <1>;
++	};
++
++	usb1_vbus_pin_bananapro: usb1_vbus_pin@0 {
++		allwinner,pins = "PH0";
++		allwinner,function = "gpio_out";
++		allwinner,drive = <0>;
++		allwinner,pull = <0>;
++	};
++
++	usb2_vbus_pin_bananapro: usb2_vbus_pin@0 {
++		allwinner,pins = "PH1";
++		allwinner,function = "gpio_out";
++		allwinner,drive = <0>;
++		allwinner,pull = <0>;
++	};
++
++	vmmc3_pin_bananapro: vmmc3_pin@0 {
++		allwinner,pins = "PH22";
++		allwinner,function = "gpio_out";
++		allwinner,drive = <0>;
++		allwinner,pull = <0>;
++	};
++};
++
++&reg_usb1_vbus {
++	pinctrl-0 = <&usb1_vbus_pin_bananapro>;
++	gpio = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */
++	status = "okay";
++};
++
++&reg_usb2_vbus {
++	pinctrl-0 = <&usb2_vbus_pin_bananapro>;
++	gpio = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
++	status = "okay";
++};
++
++&spi0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&spi0_pins_a>;
++	status = "okay";
++};
++
++&uart0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&uart0_pins_a>;
++	status = "okay";
++};
++
++&uart2 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&uart2_pins_a>;
++	status = "okay";
++};
++
++&uart7 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&uart7_pins_a>;
++	status = "okay";
++};
++
++&usbphy {
++	usb1_vbus-supply = <&reg_usb1_vbus>;
++	usb2_vbus-supply = <&reg_usb2_vbus>;
++	status = "okay";
++};
Index: debian/patches/features/arm/dts-sun7i-Rename-sun7i-a20-ir-to-sun4i-a10-ir.patch
===================================================================
--- debian/patches/features/arm/dts-sun7i-Rename-sun7i-a20-ir-to-sun4i-a10-ir.patch	(revision 0)
+++ debian/patches/features/arm/dts-sun7i-Rename-sun7i-a20-ir-to-sun4i-a10-ir.patch	(working copy)
@@ -0,0 +1,39 @@
+From 1715a389949a4a3f03192268dfb3ac5710f2dd3c Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Mon, 30 Jun 2014 23:57:54 +0200
+Subject: ARM: dts: sun7i: Rename sun7i-a20-ir to sun4i-a10-ir
+Origin: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=1715a389949a4a3f03192268dfb3ac5710f2dd3c
+
+The sun7i block is the same as the one in the sun4i, rename the compatible
+to reflect this.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+
+--
+
+I've already included the matching change to sunxi-cir.c in my pull-req to
+Mauro.
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+
+Index: linux-3.16.7-ckt7/arch/arm/boot/dts/sun7i-a20.dtsi
+===================================================================
+--- linux-3.16.7-ckt7.orig/arch/arm/boot/dts/sun7i-a20.dtsi
++++ linux-3.16.7-ckt7/arch/arm/boot/dts/sun7i-a20.dtsi
+@@ -800,7 +800,7 @@
+ 		};
+ 
+ 		ir0: ir@01c21800 {
+-			compatible = "allwinner,sun7i-a20-ir";
++			compatible = "allwinner,sun4i-a10-ir";
+ 			clocks = <&apb0_gates 6>, <&ir0_clk>;
+ 			clock-names = "apb", "ir";
+ 			interrupts = <0 5 4>;
+@@ -809,7 +809,7 @@
+ 		};
+ 
+ 		ir1: ir@01c21c00 {
+-			compatible = "allwinner,sun7i-a20-ir";
++			compatible = "allwinner,sun4i-a10-ir";
+ 			clocks = <&apb0_gates 7>, <&ir1_clk>;
+ 			clock-names = "apb", "ir";
+ 			interrupts = <0 6 4>;
Index: debian/patches/features/arm/dts-sunxi-Add-IR-controllers-on-A20-to-dtsi.patch
===================================================================
--- debian/patches/features/arm/dts-sunxi-Add-IR-controllers-on-A20-to-dtsi.patch	(revision 0)
+++ debian/patches/features/arm/dts-sunxi-Add-IR-controllers-on-A20-to-dtsi.patch	(working copy)
@@ -0,0 +1,41 @@
+From c1a0ee3d5322d488c539e20d40db88b181628670 Mon Sep 17 00:00:00 2001
+From: Alexander Bersenev <bay@hackerdom.ru>
+Date: Sat, 21 Jun 2014 17:04:05 +0600
+Subject: ARM: sunxi: Add IR controllers on A20 to dtsi
+Origin: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=c1a0ee3d5322d488c539e20d40db88b181628670
+
+This patch adds records for two IR controllers on A20
+
+Signed-off-by: Alexander Bersenev <bay@hackerdom.ru>
+Signed-off-by: Alexsey Shestacov <wingrime@linux-sunxi.org>
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+
+Index: linux-3.16.7-ckt7/arch/arm/boot/dts/sun7i-a20.dtsi
+===================================================================
+--- linux-3.16.7-ckt7.orig/arch/arm/boot/dts/sun7i-a20.dtsi
++++ linux-3.16.7-ckt7/arch/arm/boot/dts/sun7i-a20.dtsi
+@@ -799,6 +799,24 @@
+ 			status = "disabled";
+ 		};
+ 
++		ir0: ir@01c21800 {
++			compatible = "allwinner,sun7i-a20-ir";
++			clocks = <&apb0_gates 6>, <&ir0_clk>;
++			clock-names = "apb", "ir";
++			interrupts = <0 5 4>;
++			reg = <0x01c21800 0x40>;
++			status = "disabled";
++		};
++
++		ir1: ir@01c21c00 {
++			compatible = "allwinner,sun7i-a20-ir";
++			clocks = <&apb0_gates 7>, <&ir1_clk>;
++			clock-names = "apb", "ir";
++			interrupts = <0 6 4>;
++			reg = <0x01c21c00 0x40>;
++			status = "disabled";
++		};
++
+ 		sid: eeprom@01c23800 {
+ 			compatible = "allwinner,sun7i-a20-sid";
+ 			reg = <0x01c23800 0x200>;
Index: debian/patches/series
===================================================================
--- debian/patches/series	(revision 22423)
+++ debian/patches/series	(working copy)
@@ -107,6 +107,9 @@
 features/arm/dts-sun7i-Add-board-support-for-LinkSprite-pcDuino-V3.patch
 features/arm/dts-sun7i-pcduino3-Relicense-the-device-tree-under-GPLv2-X11.patch
 features/arm/dts-sun7i-Add-support-for-A20-OLinuXino-Lime2.patch
+features/arm/dts-sunxi-Add-IR-controllers-on-A20-to-dtsi.patch
+features/arm/dts-sun7i-Rename-sun7i-a20-ir-to-sun4i-a10-ir.patch
+features/arm/dts-sun7i-Add-dts-file-for-Bananapro-board.patch
 features/arm64/drivers-net-Add-APM-X-Gene-SoC-ethernet-driver-suppo.patch
 features/arm64/drivers-net-NET_XGENE-should-depend-on-HAS_DMA.patch
 features/arm64/net-xgene-Check-negative-return-value-of-xgene_enet_.patch

Reply to: