diff mbox

[U-Boot] sun5i: Add A13 Olimex SOM Wifi board support

Message ID 1493984379-3394-1-git-send-email-jagan@openedev.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Jagan Teki May 5, 2017, 11:39 a.m. UTC
Add support for Olimex A13-512-SOM board, and this particular
design is like A13-SOM-WIFI can mount on-top of A13-SOM.

Boot Log:
--------
U-Boot SPL 2017.05-rc2-00063-g2c831b5-dirty (May 05 2017 - 16:55:59)
DRAM: 512 MiB
CPU: 1008000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC1

U-Boot 2017.05-rc2-00063-g2c831b5-dirty (May 05 2017 - 16:55:59 +0530) Allwinner Technology

CPU:   Allwinner A13 (SUN5I)
Model: Olimex A13-Olinuxino SOM Wifi
I2C:   ready
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0

Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Jagan Teki <jagan@openedev.com>
---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/sun5i-a13-olinuxino-som-wifi.dts | 173 ++++++++++++++++++++++++++
 board/sunxi/MAINTAINERS                       |   5 +
 configs/A13-OLinuXino-SOM-Wifi_defconfig      |  18 +++
 4 files changed, 197 insertions(+)
 create mode 100644 arch/arm/dts/sun5i-a13-olinuxino-som-wifi.dts
 create mode 100644 configs/A13-OLinuXino-SOM-Wifi_defconfig

Comments

Maxime Ripard May 9, 2017, 8:02 p.m. UTC | #1
Hi Jagan,

On Fri, May 05, 2017 at 05:09:39PM +0530, Jagan Teki wrote:
> Add support for Olimex A13-512-SOM board, and this particular
> design is like A13-SOM-WIFI can mount on-top of A13-SOM.
> 
> Boot Log:
> --------
> U-Boot SPL 2017.05-rc2-00063-g2c831b5-dirty (May 05 2017 - 16:55:59)
> DRAM: 512 MiB
> CPU: 1008000000Hz, AXI/AHB/APB: 3/2/2
> Trying to boot from MMC1
> 
> U-Boot 2017.05-rc2-00063-g2c831b5-dirty (May 05 2017 - 16:55:59 +0530) Allwinner Technology
> 
> CPU:   Allwinner A13 (SUN5I)
> Model: Olimex A13-Olinuxino SOM Wifi
> I2C:   ready
> DRAM:  512 MiB
> MMC:   SUNXI SD/MMC: 0
> *** Warning - bad CRC, using default environment
> 
> In:    serial
> Out:   serial
> Err:   serial
> Net:   No ethernet found.
> starting USB...
> USB0:   USB EHCI 1.00
> USB1:   USB OHCI 1.0
> scanning bus 0 for devices... 2 USB Device(s) found
>        scanning usb for storage devices... 0 Storage Device(s) found
> Hit any key to stop autoboot:  0
> 
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Signed-off-by: Jagan Teki <jagan@openedev.com>
> ---
>  arch/arm/dts/Makefile                         |   1 +
>  arch/arm/dts/sun5i-a13-olinuxino-som-wifi.dts | 173 ++++++++++++++++++++++++++

We've had the policy so far to send the DT to upstream's kernel first.

Most notably, the biggest issue I have with this DT is its name, which
is going to be an issue if we ever change it in Linux. The SOM WiFi
module is using USB, therefore it doesn't have any difference compared
to the SOM itself.

Why not just create a DT and defconfig for the SOM, wifi or not?

Maxime
diff mbox

Patch

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 959e23d..8031d97 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -226,6 +226,7 @@  dtb-$(CONFIG_MACH_SUN5I) += \
 	sun5i-a13-inet-98v-rev2.dtb \
 	sun5i-a13-olinuxino.dtb \
 	sun5i-a13-olinuxino-micro.dtb \
+	sun5i-a13-olinuxino-som-wifi.dtb \
 	sun5i-a13-q8-tablet.dtb \
 	sun5i-a13-utoo-p66.dtb \
 	sun5i-gr8-chip-pro.dtb \
diff --git a/arch/arm/dts/sun5i-a13-olinuxino-som-wifi.dts b/arch/arm/dts/sun5i-a13-olinuxino-som-wifi.dts
new file mode 100644
index 0000000..cda2d1c
--- /dev/null
+++ b/arch/arm/dts/sun5i-a13-olinuxino-som-wifi.dts
@@ -0,0 +1,173 @@ 
+/*
+ * Copyright 2012 Maxime Ripard <maxime.ripard@free-electrons.com>
+ * Copyright 2013 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.
+ *
+ * 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 "sun5i-a13.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+	model = "Olimex A13-Olinuxino SOM Wifi";
+	compatible = "olimex,a13-olinuxino-som-wifi", "allwinner,sun5i-a13";
+
+	aliases {
+		serial0 = &uart1;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pins_olinuxinom>;
+
+		power {
+			label = "a13-olinuxino-micro:green:power";
+			gpios = <&pio 6 9 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+	};
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxinom>;
+	vmmc-supply = <&reg_vcc3v3>;
+	bus-width = <4>;
+	cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
+	cd-inverted;
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
+
+&otg_sram {
+	status = "okay";
+};
+
+&pio {
+	mmc0_cd_pin_olinuxinom: mmc0_cd_pin@0 {
+		allwinner,pins = "PG0";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+	};
+
+	led_pins_olinuxinom: led_pins@0 {
+		allwinner,pins = "PG9";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+
+	usb0_id_detect_pin: usb0_id_detect_pin@0 {
+		allwinner,pins = "PG2";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+	};
+
+	usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+		allwinner,pins = "PG1";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+	};
+
+	usb0_vbus_pin_olinuxinom: usb0_vbus_pin@0 {
+		allwinner,pins = "PG12";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+
+	usb1_vbus_pin_olinuxinom: usb1_vbus_pin@0 {
+		allwinner,pins = "PG11";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+};
+
+&reg_usb0_vbus {
+	pinctrl-0 = <&usb0_vbus_pin_olinuxinom>;
+	gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>;
+	status = "okay";
+};
+
+&reg_usb1_vbus {
+	pinctrl-0 = <&usb1_vbus_pin_olinuxinom>;
+	gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
+	status = "okay";
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins_b>;
+	status = "okay";
+};
+
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usbphy {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+	usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
+	usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
+	usb0_vbus-supply = <&reg_usb0_vbus>;
+	usb1_vbus-supply = <&reg_usb1_vbus>;
+	status = "okay";
+};
diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS
index a512a20..e263844 100644
--- a/board/sunxi/MAINTAINERS
+++ b/board/sunxi/MAINTAINERS
@@ -73,6 +73,11 @@  F:	include/configs/sun9i.h
 F:	configs/Merrii_A80_Optimus_defconfig
 F:	include/configs/sun50i.h
 
+A13-OLIMEX-SOM-WIFI BOARD
+M:	Jagan Teki <jagan@openedev.com>
+S:	Maintained
+F:	configs/A13-OLinuXino-SOM-Wifi_defconfig
+
 A20-OLIMEX-SOM-EVB BOARD
 M:	Marcus Cooper <codekipper@gmail.com>
 S:	Maintained
diff --git a/configs/A13-OLinuXino-SOM-Wifi_defconfig b/configs/A13-OLinuXino-SOM-Wifi_defconfig
new file mode 100644
index 0000000..072d9b5
--- /dev/null
+++ b/configs/A13-OLinuXino-SOM-Wifi_defconfig
@@ -0,0 +1,18 @@ 
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN5I=y
+CONFIG_DRAM_CLK=408
+CONFIG_DRAM_EMR1=0
+CONFIG_MMC0_CD_PIN="PG0"
+CONFIG_USB1_VBUS_PIN="PG11"
+CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino-som-wifi"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_SPL_ISO_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_SUNXI_NO_PMIC=y
+CONFIG_USB_EHCI_HCD=y