summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-10-23 18:50:35 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-10-23 18:50:35 +0000
commitbf65065b48b9c76806650de996db2d20d2e2c4bc (patch)
tree44543c7594851cfcbff0f418c81b44cf66775d26 /sys/arch
parent56bfbc8f97d198798acc98fbcfb2949a866bd1de (diff)
De-platformize sunxi. This removes the board initialization code that sets up
SRAM for the EMAC. Instead we rely on u-boot setting this up for us. ok jsg@, patrick@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/armv7/armv7/platform.c7
-rw-r--r--sys/arch/armv7/conf/GENERIC5
-rw-r--r--sys/arch/armv7/conf/RAMDISK5
-rw-r--r--sys/arch/armv7/sunxi/files.sunxi10
-rw-r--r--sys/arch/armv7/sunxi/sun4i.c51
-rw-r--r--sys/arch/armv7/sunxi/sun7i.c39
-rw-r--r--sys/arch/armv7/sunxi/sunxi.c148
-rw-r--r--sys/arch/armv7/sunxi/sunxi_machdep.c64
8 files changed, 4 insertions, 325 deletions
diff --git a/sys/arch/armv7/armv7/platform.c b/sys/arch/armv7/armv7/platform.c
index 23163b810ab..3160cb5a51f 100644
--- a/sys/arch/armv7/armv7/platform.c
+++ b/sys/arch/armv7/armv7/platform.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: platform.c,v 1.18 2016/10/09 01:40:43 jsg Exp $ */
+/* $OpenBSD: platform.c,v 1.19 2016/10/23 18:50:34 kettenis Exp $ */
/*
* Copyright (c) 2014 Patrick Wildt <patrick@blueri.se>
*
@@ -27,7 +27,6 @@
#include <arm/cortex/smc.h>
#include "omap.h"
-#include "sunxi.h"
#include "exynos.h"
static struct armv7_platform *platform;
@@ -40,16 +39,12 @@ void com_fdt_init_cons(void);
void pluart_init_cons(void);
struct armv7_platform *omap_platform_match(void);
-struct armv7_platform *sunxi_platform_match(void);
struct armv7_platform *exynos_platform_match(void);
struct armv7_platform * (*plat_match[])(void) = {
#if NOMAP > 0
omap_platform_match,
#endif
-#if NSUNXI > 0
- sunxi_platform_match,
-#endif
#if NEXYNOS > 0
exynos_platform_match,
#endif
diff --git a/sys/arch/armv7/conf/GENERIC b/sys/arch/armv7/conf/GENERIC
index 7d4865e4cd2..78ddb91ea7b 100644
--- a/sys/arch/armv7/conf/GENERIC
+++ b/sys/arch/armv7/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.68 2016/10/22 15:16:25 kettenis Exp $
+# $OpenBSD: GENERIC,v 1.69 2016/10/23 18:50:34 kettenis Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -83,9 +83,6 @@ omehci* at fdt? # EHCI
usb* at omehci?
# Sunxi A1x/A20 SoC
-sunxi0 at mainbus?
-
-# Sunxi on-chip devices
sxiintc* at fdt? # A1x interrupt controller
sxipio* at fdt? early 1 # GPIO pins for leds & PHYs
gpio* at sxipio?
diff --git a/sys/arch/armv7/conf/RAMDISK b/sys/arch/armv7/conf/RAMDISK
index 7e5c7100e34..51dc8182a07 100644
--- a/sys/arch/armv7/conf/RAMDISK
+++ b/sys/arch/armv7/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISK,v 1.63 2016/10/22 15:16:25 kettenis Exp $
+# $OpenBSD: RAMDISK,v 1.64 2016/10/23 18:50:34 kettenis Exp $
machine armv7 arm
@@ -81,9 +81,6 @@ omehci* at fdt? # EHCI
usb* at omehci?
# Sunxi A1x/A20 SoC
-sunxi0 at mainbus?
-
-# Sunxi on-chip devices
sxiintc* at fdt? # A1x interrupt controller
sxipio* at fdt? early 1 # GPIO pins for leds & PHYs
gpio* at sxipio?
diff --git a/sys/arch/armv7/sunxi/files.sunxi b/sys/arch/armv7/sunxi/files.sunxi
index 339d206c596..53222ded162 100644
--- a/sys/arch/armv7/sunxi/files.sunxi
+++ b/sys/arch/armv7/sunxi/files.sunxi
@@ -1,12 +1,4 @@
-# $OpenBSD: files.sunxi,v 1.16 2016/10/22 15:16:25 kettenis Exp $
-
-define sunxi {}
-device sunxi: sunxi
-attach sunxi at fdt
-file arch/armv7/sunxi/sunxi_machdep.c sunxi needs-flag
-file arch/armv7/sunxi/sunxi.c sunxi
-file arch/armv7/sunxi/sun4i.c
-file arch/armv7/sunxi/sun7i.c
+# $OpenBSD: files.sunxi,v 1.17 2016/10/23 18:50:34 kettenis Exp $
device sxiccmu
attach sxiccmu at fdt
diff --git a/sys/arch/armv7/sunxi/sun4i.c b/sys/arch/armv7/sunxi/sun4i.c
deleted file mode 100644
index 444f92f42fd..00000000000
--- a/sys/arch/armv7/sunxi/sun4i.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $OpenBSD: sun4i.c,v 1.6 2016/10/09 11:14:22 kettenis Exp $ */
-/*
- * Copyright (c) 2011 Uwe Stuehler <uwe@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-
-#include <machine/bus.h>
-
-#include <armv7/armv7/armv7var.h>
-#include <armv7/sunxi/sunxireg.h>
-
-struct armv7_dev sxia1x_devs[] = {
-
- /* Timers/Counters, resources mapped on first unit */
- { .name = "sxitimer",
- .unit = 0,
- .mem = { { TIMER_ADDR, TIMERx_SIZE },
- { CPUCNTRS_ADDR, CPUCNTRS_ADDR } }
- },
- { .name = "sxitimer",
- .unit = 1,
- },
- { .name = "sxitimer",
- .unit = 2,
- },
-
- /* Terminator */
- { .name = NULL,
- .unit = 0,
- }
-};
-
-void
-sxia1x_init(void)
-{
- armv7_set_devs(sxia1x_devs);
-}
diff --git a/sys/arch/armv7/sunxi/sun7i.c b/sys/arch/armv7/sunxi/sun7i.c
deleted file mode 100644
index 13752da5cb4..00000000000
--- a/sys/arch/armv7/sunxi/sun7i.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* $OpenBSD: sun7i.c,v 1.7 2016/10/09 11:14:22 kettenis Exp $ */
-
-/*
- * Copyright (c) 2011 Uwe Stuehler <uwe@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-
-#include <machine/bus.h>
-
-#include <armv7/armv7/armv7var.h>
-#include <armv7/sunxi/sunxireg.h>
-
-struct armv7_dev sxia20_devs[] = {
-
- /* Terminator */
- { .name = NULL,
- .unit = 0,
- }
-};
-
-void
-sxia20_init(void)
-{
- armv7_set_devs(sxia20_devs);
-}
diff --git a/sys/arch/armv7/sunxi/sunxi.c b/sys/arch/armv7/sunxi/sunxi.c
deleted file mode 100644
index c6d42d368e0..00000000000
--- a/sys/arch/armv7/sunxi/sunxi.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* $OpenBSD: sunxi.c,v 1.21 2016/10/22 15:16:25 kettenis Exp $ */
-/*
- * Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#include <machine/bus.h>
-
-#include <arm/armv7/armv7var.h>
-#include <arm/mainbus/mainbus.h>
-#include <armv7/armv7/armv7var.h>
-#include <armv7/sunxi/sunxireg.h>
-
-#include <dev/ofw/fdt.h>
-
-int sunxi_match(struct device *, void *, void *);
-void sxia1x_init();
-void sxia20_init();
-
-struct cfattach sunxi_ca = {
- sizeof(struct armv7_softc), sunxi_match, armv7_attach
-};
-
-struct cfdriver sunxi_cd = {
- NULL, "sunxi", DV_DULL
-};
-
-struct board_dev sun4i_devs[] = {
- { NULL, 0 }
-};
-
-struct board_dev sun5i_devs[] = {
- { NULL, 0 }
-};
-
-struct board_dev sun7i_devs[] = {
- { NULL, 0 }
-};
-
-struct sunxi_soc {
- char *compatible;
- struct board_dev *devs;
- void (*init)(void);
-};
-
-struct sunxi_soc sunxi_socs[] = {
- {
- "allwinner,sun4i-a10",
- sun4i_devs,
- sxia1x_init,
- },
- {
- "allwinner,sun5i-a10s",
- sun5i_devs,
- sxia1x_init,
- },
- {
- "allwinner,sun5i-r8",
- sun5i_devs,
- sxia1x_init,
- },
- {
- "allwinner,sun7i-a20",
- sun7i_devs,
- sxia20_init,
- },
- {
- "allwinner,sun8i-h3",
- sun7i_devs,
- sxia20_init,
- },
- { NULL, NULL, NULL },
-};
-
-struct board_dev *
-sunxi_board_devs(void)
-{
- void *node;
- int i;
-
- node = fdt_find_node("/");
- if (node == NULL)
- return NULL;
-
- for (i = 0; sunxi_socs[i].compatible != NULL; i++) {
- if (fdt_is_compatible(node, sunxi_socs[i].compatible))
- return sunxi_socs[i].devs;
- }
- return NULL;
-}
-
-void
-sunxi_board_init(void)
-{
- bus_space_handle_t ioh;
- void *node;
- int i, match = 0;
-
- node = fdt_find_node("/");
- if (node == NULL)
- return;
-
- for (i = 0; sunxi_socs[i].compatible != NULL; i++) {
- if (fdt_is_compatible(node, sunxi_socs[i].compatible)) {
- sunxi_socs[i].init();
- match = 1;
- break;
- }
- }
-
- if (match) {
- if (bus_space_map(&armv7_bs_tag, SYSCTRL_ADDR, SYSCTRL_SIZE, 0,
- &ioh))
- panic("sunxi_attach: bus_space_map failed!");
- /* map the part of SRAM dedicated to EMAC to EMAC */
- bus_space_write_4(&armv7_bs_tag, ioh, 4,
- bus_space_read_4(&armv7_bs_tag, ioh, 4) | (5 << 2));
- }
-}
-
-int
-sunxi_match(struct device *parent, void *cfdata, void *aux)
-{
- union mainbus_attach_args *ma = (union mainbus_attach_args *)aux;
- struct cfdata *cf = (struct cfdata *)cfdata;
-
- if (ma->ma_name == NULL)
- return (0);
-
- if (strcmp(cf->cf_driver->cd_name, ma->ma_name) != 0)
- return (0);
-
- return (sunxi_board_devs() != NULL);
-}
diff --git a/sys/arch/armv7/sunxi/sunxi_machdep.c b/sys/arch/armv7/sunxi/sunxi_machdep.c
deleted file mode 100644
index 0ae64b471d8..00000000000
--- a/sys/arch/armv7/sunxi/sunxi_machdep.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* $OpenBSD: sunxi_machdep.c,v 1.13 2016/10/08 11:21:41 kettenis Exp $ */
-/*
- * Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/systm.h>
-#include <sys/termios.h>
-
-#include <machine/bus.h>
-#include <machine/bootconfig.h>
-
-#include <arm/cortex/smc.h>
-#include <arm/armv7/armv7var.h>
-#include <arm/mainbus/mainbus.h>
-#include <armv7/armv7/armv7var.h>
-#include <armv7/armv7/armv7_machdep.h>
-
-extern struct board_dev *sunxi_board_devs(void);
-extern void sunxi_board_init(void);
-
-void
-sunxi_platform_init_mainbus(struct device *self)
-{
- mainbus_legacy_found(self, "cortex");
- mainbus_legacy_found(self, "sunxi");
-}
-
-void
-sunxi_platform_board_init(void)
-{
- sunxi_board_init();
-}
-
-struct armv7_platform sunxi_platform = {
- .board_init = sunxi_platform_board_init,
- .init_mainbus = sunxi_platform_init_mainbus,
-};
-
-struct armv7_platform *
-sunxi_platform_match(void)
-{
- struct board_dev *devs;
-
- devs = sunxi_board_devs();
- if (devs == NULL)
- return (NULL);
-
- sunxi_platform.devs = devs;
- return (&sunxi_platform);
-}