Replace the A20 kernel config with a generic ALLWINNER kernel config that

supports A20, A31, and A31S. Adds support for the BananaPi M2 (A31S) board.

Submitted by:		Emmanuel Vadot <manu@bidouilliste.com>
Reviewed by:		jmcneill
Differential Revision:	https://reviews.freebsd.org/D5580
This commit is contained in:
Jared McNeill 2016-04-21 16:49:04 +00:00
parent 40cf3344dc
commit 473bbf691b
15 changed files with 98 additions and 11 deletions

View File

@ -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"

View File

@ -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"

View File

@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
#include <arm/allwinner/allwinner_pinctrl.h>
#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 */

View File

@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
#include <arm/allwinner/allwinner_pinctrl.h>
#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 */

View File

@ -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

View File

@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
#include <arm/allwinner/allwinner_pinctrl.h>
#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 */

View File

@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
#include <arm/allwinner/allwinner_pinctrl.h>
#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 */

View File

@ -0,0 +1,4 @@
# $FreeBSD$
arm/allwinner/a31/a31_padconf.c standard
arm/allwinner/a31/a31s_padconf.c standard

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -0,0 +1,33 @@
/*-
* Copyright (c) 2016 Emmanuel Vadot <manu@bidouilliste.com>
* 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";
};

View File

@ -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 \