diff --git a/release/arm/BANANAPI.conf b/release/arm/BANANAPI.conf index 15994f4d5e52..5da9f3842866 100644 --- a/release/arm/BANANAPI.conf +++ b/release/arm/BANANAPI.conf @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-bananapi" -KERNEL="A20" +KERNEL="ALLWINNER" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" diff --git a/release/arm/CUBIEBOARD2.conf b/release/arm/CUBIEBOARD2.conf index 6b5a4acbd791..e7cfab669cf4 100644 --- a/release/arm/CUBIEBOARD2.conf +++ b/release/arm/CUBIEBOARD2.conf @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" -KERNEL="A20" +KERNEL="ALLWINNER" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" diff --git a/sys/arm/allwinner/a10_padconf.c b/sys/arm/allwinner/a10_padconf.c index b441d7ceb878..f77f5e68f615 100644 --- a/sys/arm/allwinner/a10_padconf.c +++ b/sys/arm/allwinner/a10_padconf.c @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include +#ifdef SOC_ALLWINNER_A10 + const static struct allwinner_pins a10_pins[] = { {"PA0", 0, 0, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, {"PA1", 0, 1, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, @@ -225,3 +227,5 @@ const struct allwinner_padconf a10_padconf = { .npins = sizeof(a10_pins) / sizeof(struct allwinner_pins), .pins = a10_pins, }; + +#endif /* SOC_ALLWINNER_A10 */ diff --git a/sys/arm/allwinner/a20/a20_padconf.c b/sys/arm/allwinner/a20/a20_padconf.c index f8da5b5c5a59..910afe39a7bd 100644 --- a/sys/arm/allwinner/a20/a20_padconf.c +++ b/sys/arm/allwinner/a20/a20_padconf.c @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include +#ifdef SOC_ALLWINNER_A20 + const static struct allwinner_pins a20_pins[] = { {"PA0", 0, 0, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", "gmac", NULL, NULL}}, {"PA1", 0, 1, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", "gmac", NULL, NULL}}, @@ -225,3 +227,5 @@ const struct allwinner_padconf a20_padconf = { .npins = sizeof(a20_pins) / sizeof(struct allwinner_pins), .pins = a20_pins, }; + +#endif /* SOC_ALLWINNER_A20 */ diff --git a/sys/arm/allwinner/a20/files.a20 b/sys/arm/allwinner/a20/files.a20 index 7488578f3e3a..08e17afa18a8 100644 --- a/sys/arm/allwinner/a20/files.a20 +++ b/sys/arm/allwinner/a20/files.a20 @@ -1,5 +1,3 @@ # $FreeBSD$ arm/allwinner/a20/a20_padconf.c standard -arm/allwinner/aw_mp.c optional smp -arm/allwinner/a20/a20_if_dwc.c optional dwc diff --git a/sys/arm/allwinner/a31/a31_padconf.c b/sys/arm/allwinner/a31/a31_padconf.c index e591d575e7eb..830a0661dcb3 100644 --- a/sys/arm/allwinner/a31/a31_padconf.c +++ b/sys/arm/allwinner/a31/a31_padconf.c @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include +#ifdef SOC_ALLWINNER_A31 + const static struct allwinner_pins a31_pins[] = { {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}}, {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}}, @@ -214,3 +216,5 @@ const struct allwinner_padconf a31_padconf = { .npins = nitems(a31_pins), .pins = a31_pins, }; + +#endif /* SOC_ALLWINNER_A31 */ diff --git a/sys/arm/allwinner/a31/a31s_padconf.c b/sys/arm/allwinner/a31/a31s_padconf.c index e133aa202da9..1901313cc27a 100644 --- a/sys/arm/allwinner/a31/a31s_padconf.c +++ b/sys/arm/allwinner/a31/a31s_padconf.c @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include +#ifdef SOC_ALLWINNER_A31S + const static struct allwinner_pins a31s_pins[] = { {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}}, {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}}, @@ -194,3 +196,5 @@ const struct allwinner_padconf a31s_padconf = { .npins = nitems(a31s_pins), .pins = a31s_pins, }; + +#endif /* SOC_ALLWINNER_A31S */ diff --git a/sys/arm/allwinner/a31/files.a31 b/sys/arm/allwinner/a31/files.a31 new file mode 100644 index 000000000000..b181150745e1 --- /dev/null +++ b/sys/arm/allwinner/a31/files.a31 @@ -0,0 +1,4 @@ +# $FreeBSD$ + +arm/allwinner/a31/a31_padconf.c standard +arm/allwinner/a31/a31s_padconf.c standard diff --git a/sys/arm/allwinner/a31/std.a31 b/sys/arm/allwinner/a31/std.a31 new file mode 100644 index 000000000000..22250fbe425b --- /dev/null +++ b/sys/arm/allwinner/a31/std.a31 @@ -0,0 +1,15 @@ +# Allwinner A31 common options +#$FreeBSD$ + +cpu CPU_CORTEXA +machine arm armv6 +makeoptions CONF_CFLAGS="-march=armv7a" + +makeoptions KERNVIRTADDR=0xc0200000 +options KERNVIRTADDR=0xc0200000 + +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 + +files "../allwinner/files.allwinner" +files "../allwinner/a31/files.a31" diff --git a/sys/arm/allwinner/a20/a20_if_dwc.c b/sys/arm/allwinner/aw_if_dwc.c similarity index 100% rename from sys/arm/allwinner/a20/a20_if_dwc.c rename to sys/arm/allwinner/aw_if_dwc.c diff --git a/sys/arm/allwinner/files.allwinner b/sys/arm/allwinner/files.allwinner index 34daf434392d..69e195a11618 100644 --- a/sys/arm/allwinner/files.allwinner +++ b/sys/arm/allwinner/files.allwinner @@ -10,10 +10,12 @@ arm/allwinner/aw_usbphy.c optional ehci arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_mmc.c optional mmc arm/allwinner/a10_sramc.c standard +arm/allwinner/aw_if_dwc.c optional dwc arm/allwinner/aw_rtc.c standard arm/allwinner/aw_wdog.c standard arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/allwinner_machdep.c standard +arm/allwinner/aw_mp.c optional smp arm/allwinner/axp209.c optional axp209 arm/allwinner/if_emac.c optional emac arm/allwinner/sunxi_dma_if.m standard diff --git a/sys/arm/allwinner/std.allwinner b/sys/arm/allwinner/std.allwinner new file mode 100644 index 000000000000..885d41df34fb --- /dev/null +++ b/sys/arm/allwinner/std.allwinner @@ -0,0 +1,16 @@ +# Allwinner common options +#$FreeBSD$ + +cpu CPU_CORTEXA +machine arm armv6 +makeoptions CONF_CFLAGS="-march=armv7a" + +makeoptions KERNVIRTADDR=0xc0200000 +options KERNVIRTADDR=0xc0200000 + +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 + +files "../allwinner/files.allwinner" +files "../allwinner/a20/files.a20" +files "../allwinner/a31/files.a31" diff --git a/sys/arm/conf/A20 b/sys/arm/conf/ALLWINNER similarity index 94% rename from sys/arm/conf/A20 rename to sys/arm/conf/ALLWINNER index f28080c623f5..dc62ccd09d89 100644 --- a/sys/arm/conf/A20 +++ b/sys/arm/conf/ALLWINNER @@ -1,5 +1,5 @@ # -# A20 -- Custom configuration for the Allwinner A20 ARM SoC +# ALLWINNER -- Custom configuration for the Allwinner A20 and A31 ARM SoC # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -18,14 +18,16 @@ # # $FreeBSD$ -ident A20 +ident ALLWINNER include "std.armv6" -include "../allwinner/a20/std.a20" +include "../allwinner/std.allwinner" options INTRNG options SOC_ALLWINNER_A20 +options SOC_ALLWINNER_A31 +options SOC_ALLWINNER_A31S options HZ=100 options SCHED_ULE # ULE scheduler @@ -56,7 +58,7 @@ options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options BOOTP_WIRED_TO=dwc0 # EXT_RESOURCES pseudo devices -options EXT_RESOURCES +options EXT_RESOURCES device clk device phy device hwreset @@ -125,9 +127,6 @@ device miibus # Sound support device sound -# Pinmux -device fdt_pinctrl - # Framebuffer support device vt device kbdmux @@ -136,6 +135,9 @@ device ukbd device videomode device hdmi +# Pinmux +device fdt_pinctrl + # Flattened Device Tree options FDT # Configure using FDT/DTB data makeoptions MODULES_EXTRA=dtb/allwinner diff --git a/sys/boot/fdt/dts/arm/bananapim2.dts b/sys/boot/fdt/dts/arm/bananapim2.dts new file mode 100644 index 000000000000..b241111cd111 --- /dev/null +++ b/sys/boot/fdt/dts/arm/bananapim2.dts @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "sun6i-a31s-sinovoip-bpi-m2.dts" + +&mmc2 { + status = "disabled"; +}; diff --git a/sys/modules/dtb/allwinner/Makefile b/sys/modules/dtb/allwinner/Makefile index 80ac333d2f15..24f923bb80e5 100644 --- a/sys/modules/dtb/allwinner/Makefile +++ b/sys/modules/dtb/allwinner/Makefile @@ -2,6 +2,7 @@ # All the dts files for allwinner systems we support. DTS= \ bananapi.dts \ + bananapim2.dts \ cubieboard.dts \ cubieboard2.dts \ olimex-a20-som-evb.dts \