Update of the Allwinner drivers to:

* Use the Linux compat string
 * Use EARLY_DRIVER_MODULE to attach at the right time
 * Add a generic A10 kernel config file
 * A20 now use generic_timer
 * Add two new dts files for Olimex boards
 * Update our custom DTS file for A10 and A20 to use the same compatible
   property names as the vendor ones.

Submitted by:	Emmanuel Vadot <manu@bidouilliste.com>
Differential Revision:	https://reviews.freebsd.org/D4792
This commit is contained in:
Andrew Turner 2016-02-10 09:19:29 +00:00
parent 4bc7e098c7
commit 907fe11655
22 changed files with 308 additions and 133 deletions

View File

@ -109,7 +109,8 @@ static driver_t a10_ccm_driver = {
static devclass_t a10_ccm_devclass;
DRIVER_MODULE(a10_ccm, simplebus, a10_ccm_driver, a10_ccm_devclass, 0, 0);
EARLY_DRIVER_MODULE(a10_ccm, simplebus, a10_ccm_driver, a10_ccm_devclass, 0, 0,
BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE);
int
a10_clk_usb_activate(void)
@ -200,7 +201,7 @@ a10_clk_gmac_activate(phandle_t node)
/* Set GMAC mode. */
reg_value = CCM_GMAC_CLK_MII;
if (OF_getprop_alloc(node, "phy-type", 1, (void **)&phy_type) > 0) {
if (OF_getprop_alloc(node, "phy-mode", 1, (void **)&phy_type) > 0) {
if (strcasecmp(phy_type, "rgmii") == 0)
reg_value = CCM_GMAC_CLK_RGMII | CCM_GMAC_MODE_RGMII;
else if (strcasecmp(phy_type, "rgmii-bpi") == 0) {

View File

@ -50,7 +50,7 @@ fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig,
{
int offset;
if (fdt_is_compatible(node, "allwinner,sun4i-ic"))
if (fdt_is_compatible(node, "allwinner,sun4i-a10-ic"))
offset = 0;
else if (fdt_is_compatible(node, "arm,gic"))
offset = 32;

View File

@ -43,10 +43,10 @@ __FBSDID("$FreeBSD$");
#include <sys/gpio.h>
#include <machine/bus.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
#include <dev/usb/usb.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usb_core.h>
@ -90,6 +90,12 @@ static device_detach_t a10_ehci_detach;
bs_r_1_proto(reversed);
bs_w_1_proto(reversed);
static struct ofw_compat_data compat_data[] = {
{"allwinner,sun4i-a10-ehci", 1},
{"allwinner,sun7i-a20-ehci", 1},
{NULL, 0}
};
static int
a10_ehci_probe(device_t self)
{
@ -97,7 +103,7 @@ a10_ehci_probe(device_t self)
if (!ofw_bus_status_okay(self))
return (ENXIO);
if (!ofw_bus_is_compatible(self, "allwinner,usb-ehci"))
if (ofw_bus_search_compatible(self, compat_data)->ocd_data == 0)
return (ENXIO);
device_set_desc(self, EHCI_HC_DEVSTR);

View File

@ -73,6 +73,12 @@ __FBSDID("$FreeBSD$");
#define A10_GPIO_INPUT 0
#define A10_GPIO_OUTPUT 1
static struct ofw_compat_data compat_data[] = {
{"allwinner,sun4i-a10-pinctrl", 1},
{"allwinner,sun7i-a20-pinctrl", 1},
{NULL, 0}
};
struct a10_gpio_softc {
device_t sc_dev;
device_t sc_busdev;
@ -373,7 +379,7 @@ a10_gpio_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-gpio"))
if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
return (ENXIO);
device_set_desc(dev, "Allwinner GPIO controller");
@ -493,7 +499,9 @@ static driver_t a10_gpio_driver = {
sizeof(struct a10_gpio_softc),
};
DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0);
EARLY_DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0,
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);
int
a10_gpio_ethernet_activate(uint32_t func)

View File

@ -62,6 +62,12 @@ static int a10_mmc_pio_mode = 0;
TUNABLE_INT("hw.a10.mmc.pio_mode", &a10_mmc_pio_mode);
static struct ofw_compat_data compat_data[] = {
{"allwinner,sun4i-a10-mmc", 1},
{"allwinner,sun5i-a13-mmc", 1},
{NULL, 0}
};
struct a10_mmc_softc {
bus_space_handle_t a10_bsh;
bus_space_tag_t a10_bst;
@ -123,8 +129,9 @@ a10_mmc_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-mmc"))
if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
return (ENXIO);
device_set_desc(dev, "Allwinner Integrated MMC/SD controller");
return (BUS_PROBE_DEFAULT);

View File

@ -95,7 +95,7 @@ a10wd_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (ofw_bus_is_compatible(dev, "allwinner,sun4i-wdt")) {
if (ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-wdt")) {
device_set_desc(dev, "Allwinner A10 Watchdog");
return (BUS_PROBE_DEFAULT);
}

View File

@ -117,7 +117,8 @@ static driver_t a20_cpu_cfg_driver = {
static devclass_t a20_cpu_cfg_devclass;
DRIVER_MODULE(a20_cpu_cfg, simplebus, a20_cpu_cfg_driver, a20_cpu_cfg_devclass, 0, 0);
EARLY_DRIVER_MODULE(a20_cpu_cfg, simplebus, a20_cpu_cfg_driver, a20_cpu_cfg_devclass, 0, 0,
BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE);
uint64_t
a20_read_counter64(void)

View File

@ -79,6 +79,12 @@ __FBSDID("$FreeBSD$");
#define SW_INT_ENABLE_REG(_b) (0x40 + ((_b) * 4))
#define SW_INT_MASK_REG(_b) (0x50 + ((_b) * 4))
static struct ofw_compat_data compat_data[] = {
{"allwinner,sun4i-a10-ic", 1},
{"allwinner,sun7i-a20-sc-nmi", 1},
{NULL, 0}
};
struct a10_aintc_softc {
device_t sc_dev;
struct resource * aintc_res;
@ -101,7 +107,7 @@ a10_aintc_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-ic"))
if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
return (ENXIO);
device_set_desc(dev, "A10 AINTC Interrupt Controller");
return (BUS_PROBE_DEFAULT);
@ -158,7 +164,8 @@ static driver_t a10_aintc_driver = {
static devclass_t a10_aintc_devclass;
DRIVER_MODULE(aintc, simplebus, a10_aintc_driver, a10_aintc_devclass, 0, 0);
EARLY_DRIVER_MODULE(aintc, simplebus, a10_aintc_driver, a10_aintc_devclass, 0, 0,
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_FIRST);
int
arm_get_next_irq(int last_irq)

View File

@ -1,3 +1,4 @@
# $FreeBSD$
arm/allwinner/aintc.c standard
arm/allwinner/timer.c standard

View File

@ -12,5 +12,4 @@ arm/allwinner/a10_wdog.c standard
arm/allwinner/a20/a20_cpu_cfg.c standard
arm/allwinner/allwinner_machdep.c standard
arm/allwinner/if_emac.c optional emac
arm/allwinner/timer.c standard
#arm/allwinner/console.c standard

View File

@ -756,7 +756,7 @@ static int
emac_probe(device_t dev)
{
if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-emac"))
if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-emac"))
return (ENXIO);
device_set_desc(dev, "A10/A20 EMAC ethernet controller");

View File

@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kdb.h>
#include "a20/a20_cpu_cfg.h"
#include <arm/allwinner/allwinner_machdep.h>
/**
* Timer registers addr
@ -84,7 +84,6 @@ struct a10_timer_softc {
uint32_t sc_period;
uint32_t timer0_freq;
struct eventtimer et;
uint8_t sc_timer_type; /* 0 for A10, 1 for A20 */
};
int a10_timer_get_timerfreq(struct a10_timer_softc *);
@ -127,10 +126,6 @@ timer_read_counter64(void)
{
uint32_t lo, hi;
/* In case of A20 get appropriate counter info */
if (a10_timer_sc->sc_timer_type)
return (a20_read_counter64());
/* Latch counter, wait for it to be ready to read. */
timer_write_4(a10_timer_sc, CNT64_CTRL_REG, CNT64_RL_EN);
while (timer_read_4(a10_timer_sc, CNT64_CTRL_REG) & CNT64_RL_EN)
@ -146,14 +141,16 @@ static int
a10_timer_probe(device_t dev)
{
struct a10_timer_softc *sc;
u_int soc_family;
sc = device_get_softc(dev);
if (ofw_bus_is_compatible(dev, "allwinner,sun4i-timer"))
sc->sc_timer_type = 0;
else if (ofw_bus_is_compatible(dev, "allwinner,sun7i-timer"))
sc->sc_timer_type = 1;
else
if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-timer"))
return (ENXIO);
soc_family = allwinner_soc_family();
if (soc_family != ALLWINNERSOC_SUN4I &&
soc_family != ALLWINNERSOC_SUN5I)
return (ENXIO);
device_set_desc(dev, "Allwinner A10/A20 timer");
@ -352,7 +349,8 @@ static driver_t a10_timer_driver = {
static devclass_t a10_timer_devclass;
DRIVER_MODULE(a10_timer, simplebus, a10_timer_driver, a10_timer_devclass, 0, 0);
EARLY_DRIVER_MODULE(a10_timer, simplebus, a10_timer_driver, a10_timer_devclass, 0, 0,
BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE);
void
DELAY(int usec)

105
sys/arm/conf/A10 Normal file
View File

@ -0,0 +1,105 @@
#
# A10 -- Custom configuration for the AllWinner A10 SoC
#
# For more information on this file, please read the config(5) manual page,
# and/or the handbook section on Kernel Configuration Files:
#
# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
# latest information.
#
# An exhaustive list of options and more detailed explanations of the
# device lines is also present in the ../../conf/NOTES and NOTES files.
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
# $FreeBSD$
ident A10
include "std.armv6"
include "../allwinner/std.a10"
options HZ=100
options SCHED_4BSD # 4BSD scheduler
options PLATFORM
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
options ALT_BREAK_TO_DEBUGGER
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
options KDB # Enable kernel debugger support
# For minimum debugger support (stable branch) use:
#options KDB_TRACE # Print a stack trace for a panic
# For full debugger support use this instead:
options DDB # Enable the kernel debugger
options INVARIANTS # Enable calls of extra sanity checking
options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS
options WITNESS # Enable checks to detect deadlocks and cycles
options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
#options DIAGNOSTIC
# NFS root from boopt/dhcp
#options BOOTP
#options BOOTP_NFSROOT
#options BOOTP_COMPAT
#options BOOTP_NFSV3
#options BOOTP_WIRED_TO=emac0
# MMC/SD/SDIO Card slot support
device mmc # mmc/sd bus
device mmcsd # mmc/sd flash cards
# ATA controllers
device ahci # AHCI-compatible SATA controllers
#device ata # Legacy ATA/SATA controllers
# Console and misc
device uart
device uart_ns8250
device pty
device snp
device md
device random # Entropy device
# I2C support
#device iicbus
#device iic
# GPIO
device gpio
device gpioled
device scbus # SCSI bus (required for ATA/SCSI)
device da # Direct Access (disks)
device pass # Passthrough device (direct ATA/SCSI access)
# USB support
options USB_HOST_ALIGN=64 # Align usb buffers to cache line size.
device usb
options USB_DEBUG
#options USB_REQ_DEBUG
#options USB_VERBOSE
#device uhci
#device ohci
device ehci
device umass
# Ethernet
device loop
device ether
device mii
device bpf
device emac
# USB ethernet support, requires miibus
device miibus
# Flattened Device Tree
options FDT # Configure using FDT/DTB data
makeoptions MODULES_EXTRA=dtb/allwinner

View File

@ -52,12 +52,12 @@ options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
#options BOOTP_NFSV3
#options BOOTP_WIRED_TO=dwc0
# Boot device is 2nd slice on MMC/SD card
options ROOTDEVNAME=\"ufs:/dev/da0s2\"
# Interrupt controller
device gic
# ARM Generic Timer
device generic_timer
# MMC/SD/SDIO Card slot support
device mmc # mmc/sd bus
device mmcsd # mmc/sd flash cards

View File

@ -129,12 +129,6 @@ END(cpu_throw)
* x3 to x7, x16 and x17 are caller saved
*/
ENTRY(cpu_switch)
/* Store the new curthread */
str x1, [x18, #PC_CURTHREAD]
/* And the new pcb */
ldr x4, [x1, #TD_PCB]
str x4, [x18, #PC_CURPCB]
/*
* Save the old context.
*/
@ -174,10 +168,15 @@ ENTRY(cpu_switch)
mov x0, x19
#endif
/* Store the new curthread */
str x1, [x18, #PC_CURTHREAD]
/*
* Restore the saved context.
* Restore the saved context and save it as the curpcb.
*/
ldr x4, [x1, #TD_PCB]
str x4, [x18, #PC_CURPCB]
/*
* TODO: We may need to flush the cache here if switching

View File

@ -28,7 +28,8 @@
/dts-v1/;
/include/ "sun7i-a20.dtsi"
#include "sun7i-a20.dtsi"
#include <dt-bindings/gpio/gpio.h>
@ -65,7 +66,7 @@
};
gmac@01c50000 {
phy-type = "rgmii-bpi";
phy-mode = "rgmii-bpi";
status = "okay";
};

View File

@ -1,5 +1,6 @@
/*-
* Copyright (c) 2013 Ganbold Tsagaankhuu <ganbold@freebsd.org>
* Copyright (c) 2016 Emmanuel Vadot <manu@bidouilliste.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -22,78 +23,19 @@
* 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$
*/
/dts-v1/;
/include/ "sun7i-a20.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include "sun7i-a20-cubieboard2.dts"
/ {
model = "Cubietech Cubieboard2";
memory {
device_type = "memory";
reg = < 0x40000000 0x40000000 >; /* 1GB RAM */
};
aliases {
soc = &SOC;
UART0 = &UART0;
};
SOC: a20 {
usb1: usb@01c14000 {
status = "okay";
soc@01c00000 {
ccm@01c20000 {
compatible = "allwinner,sun4i-ccm";
#address-cells = <1>;
#size-cells = <1>;
reg = < 0x01c20000 0x400 >;
};
usb2: usb@01c1c000 {
status = "okay";
};
UART0: serial@01c28000 {
status = "okay";
};
mmc0: mmc@01c0f000 {
status = "okay";
};
emac@01c0b000 {
status = "okay";
};
gmac@01c50000 {
status = "okay";
};
ahci: sata@01c18000 {
status = "okay";
};
};
leds {
compatible = "gpio-leds";
blue {
label = "cubieboard2:blue:usr";
gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
};
green {
label = "cubieboard2:green:usr";
gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
};
};
chosen {
bootargs = "-v";
stdin = "UART0";
stdout = "UART0";
};
};

View File

@ -0,0 +1,40 @@
/*-
* Copyright (c) 2015 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 "sun7i-a20-olimex-som-evb.dts"
/ {
soc@01c00000 {
ccm@01c20000 {
compatible = "allwinner,sun4i-ccm";
#address-cells = <1>;
#size-cells = <1>;
reg = < 0x01c20000 0x400 >;
};
};
};

View File

@ -0,0 +1,40 @@
/*-
* Copyright (c) 2015 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 "sun4i-a10-olinuxino-lime.dts"
/ {
soc@01c00000 {
ccm@01c20000 {
compatible = "allwinner,sun4i-ccm";
#address-cells = <1>;
#size-cells = <1>;
reg = < 0x01c20000 0x400 >;
};
};
};

View File

@ -45,7 +45,7 @@
bus-frequency = <0>;
AINTC: interrupt-controller@01c20400 {
compatible = "allwinner,sun4i-ic";
compatible = "allwinner,sun4i-a10-ic";
interrupt-controller;
#address-cells = <0>;
#interrupt-cells = <1>;
@ -67,7 +67,7 @@
};
timer@01c20c00 {
compatible = "allwinner,sun4i-timer";
compatible = "allwinner,sun4i-a10-timer";
reg = <0x01c20c00 0x90>;
interrupts = < 22 >;
interrupt-parent = <&AINTC>;
@ -82,7 +82,7 @@
GPIO: gpio@01c20800 {
#gpio-cells = <3>;
compatible = "allwinner,sun4i-gpio";
compatible = "allwinner,sun4i-a10-pinctrl";
gpio-controller;
reg =< 0x01c20800 0x400 >;
interrupts = < 28 >;
@ -90,14 +90,14 @@
};
usb1: usb@01c14000 {
compatible = "allwinner,usb-ehci", "usb-ehci";
compatible = "allwinner,sun4i-a10-ehci", "generic-ehci";
reg = <0x01c14000 0x1000>;
interrupts = < 39 >;
interrupt-parent = <&AINTC>;
};
usb2: usb@01c1c000 {
compatible = "allwinner,usb-ehci", "usb-ehci";
compatible = "allwinner,sun4i-a10-ehci", "generic-ehci";
reg = <0x01c1c000 0x1000>;
interrupts = < 40 >;
interrupt-parent = <&AINTC>;
@ -130,7 +130,7 @@
};
emac@01c0b000 {
compatible = "allwinner,sun4i-emac";
compatible = "allwinner,sun4i-a10-emac";
reg = <0x01c0b000 0x1000>;
interrupts = <55>;
interrupt-parent = <&AINTC>;

View File

@ -26,6 +26,8 @@
* $FreeBSD$
*/
#include <dt-bindings/interrupt-controller/arm-gic.h>
/ {
compatible = "allwinner,sun7i-a20";
#address-cells = <1>;
@ -37,6 +39,14 @@
soc = &SOC;
};
timer {
compatible = "arm,armv7-timer";
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
<GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
<GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
<GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
};
SOC: a20 {
#address-cells = <1>;
#size-cells = <1>;
@ -47,9 +57,12 @@
GIC: interrupt-controller@01c81000 {
compatible = "arm,gic";
reg = <0x01c81000 0x1000>, /* Distributor Registers */
<0x01c82000 0x0100>; /* CPU Interface Registers */
<0x01c82000 0x0100>, /* CPU Interface Registers */
<0x01c84000 0x2000>,
<0x01c86000 0x2000>;
interrupt-controller;
#interrupt-cells = <1>;
#interrupt-cells = <3>;
interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
};
sramc@01c00000 {
@ -74,53 +87,59 @@
};
timer@01c20c00 {
compatible = "allwinner,sun7i-timer";
compatible = "allwinner,sun4i-a10-timer";
reg = <0x01c20c00 0x90>;
interrupts = < 22 >;
interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&GIC>;
clock-frequency = < 24000000 >;
};
watchdog@01c20c90 {
compatible = "allwinner,sun4i-wdt";
compatible = "allwinner,sun4i-a10-wdt";
reg = <0x01c20c90 0x10>;
};
pio: gpio@01c20800 {
#gpio-cells = <3>;
compatible = "allwinner,sun4i-gpio";
compatible = "allwinner,sun7i-a20-pinctrl";
gpio-controller;
reg =< 0x01c20800 0x400 >;
interrupts = < 28 >;
interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&GIC>;
};
usb1: usb@01c14000 {
compatible = "allwinner,usb-ehci", "usb-ehci";
compatible = "allwinner,sun7i-a20-ehci", "generic-ehci";
reg = <0x01c14000 0x1000>;
interrupts = < 39 >;
interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&GIC>;
};
usb2: usb@01c1c000 {
compatible = "allwinner,usb-ehci", "usb-ehci";
compatible = "allwinner,sun7i-a20-ehci", "generic-ehci";
reg = <0x01c1c000 0x1000>;
interrupts = < 40 >;
interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&GIC>;
};
mmc0: mmc@01c0f000 {
compatible = "allwinner,sun4i-a10-mmc";
compatible = "allwinner,sun5i-a13-mmc";
reg = <0x01c0f000 0x1000>;
interrupts = <32>;
interrupt-parent = <&GIC>;
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
};
sata@01c18000 {
compatible = "allwinner,sun4i-a10-ahci";
reg = <0x01c18000 0x1000>;
interrupts = <56>;
interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&GIC>;
status = "disabled";
};
@ -129,16 +148,15 @@
compatible = "snps,dw-apb-uart";
reg = <0x01c28000 0x400>;
reg-shift = <2>;
interrupts = <1>;
interrupt-parent = <&GIC>;
interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
current-speed = <115200>;
clock-frequency = < 24000000 >;
};
emac@01c0b000 {
compatible = "allwinner,sun4i-emac";
compatible = "allwinner,sun4i-a10-emac";
reg = <0x01c0b000 0x1000>;
interrupts = <55>;
interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&GIC>;
status = "disabled";
};
@ -146,7 +164,7 @@
gmac@01c50000 {
compatible = "allwinner,sun7i-a20-gmac";
reg = <0x01c50000 0x10000>;
interrupts = <85>;
interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&GIC>;
snps,pbl = <2>;
snps,fixed-burst;

View File

@ -3,6 +3,8 @@
DTS= \
bananapi.dts \
cubieboard.dts \
cubieboard2.dts
cubieboard2.dts \
olimex-a20-som-evb.dts \
olinuxino-lime.dts
.include <bsd.dtb.mk>