summaryrefslogtreecommitdiff
path: root/sys/arch/armv7/imx
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-10-05 22:06:49 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-10-05 22:06:49 +0000
commitd61f3d4e7d9143c4d3edd268978195aa041f81e4 (patch)
tree0c046610f586550b73c5016a07744a3276d0c72f /sys/arch/armv7/imx
parentfb6d4103628f27e5c21220e95c8eee0d732cef04 (diff)
Make imxdog(4) set cpuresetfn, and remove all the imx platform that is no
longer needed, including the imx board IDs. ok patrick@, jsg@
Diffstat (limited to 'sys/arch/armv7/imx')
-rw-r--r--sys/arch/armv7/imx/files.imx24
-rw-r--r--sys/arch/armv7/imx/imx.c89
-rw-r--r--sys/arch/armv7/imx/imx6.c142
-rw-r--r--sys/arch/armv7/imx/imx_machdep.c98
-rw-r--r--sys/arch/armv7/imx/imxdog.c8
5 files changed, 14 insertions, 347 deletions
diff --git a/sys/arch/armv7/imx/files.imx b/sys/arch/armv7/imx/files.imx
index 726797def5a..99e6002c05c 100644
--- a/sys/arch/armv7/imx/files.imx
+++ b/sys/arch/armv7/imx/files.imx
@@ -1,16 +1,8 @@
-# $OpenBSD: files.imx,v 1.19 2016/09/23 17:59:17 kettenis Exp $
+# $OpenBSD: files.imx,v 1.20 2016/10/05 22:06:48 kettenis Exp $
-define imx {}
-device imx: imx
-attach imx at fdt
-file arch/armv7/imx/imx_machdep.c imx needs-flag
-file arch/armv7/imx/imx.c imx
-file arch/armv7/imx/imx6.c
-
-# serial ports
device imxuart
attach imxuart at fdt
-file arch/armv7/imx/imxuart.c imxuart
+file arch/armv7/imx/imxuart.c imxuart
device imxccm
attach imxccm at fdt
@@ -30,11 +22,11 @@ file arch/armv7/imx/imxdog.c imxdog
device imxocotp
attach imxocotp at fdt
-file arch/armv7/imx/imxocotp.c imxocotp
+file arch/armv7/imx/imxocotp.c imxocotp
device imxgpio
attach imxgpio at fdt
-file arch/armv7/imx/imxgpio.c imxgpio
+file arch/armv7/imx/imxgpio.c imxgpio
device imxiic: i2cbus
attach imxiic at fdt
@@ -46,16 +38,16 @@ file arch/armv7/imx/if_fec.c fec
device imxehci: usbus
attach imxehci at fdt
-file arch/armv7/imx/imxehci.c imxehci
+file arch/armv7/imx/imxehci.c imxehci
device imxesdhc: sdmmcbus
attach imxesdhc at fdt
-file arch/armv7/imx/imxesdhc.c imxesdhc
+file arch/armv7/imx/imxesdhc.c imxesdhc
device imxahci: scsi, atascsi
attach imxahci at fdt
-file arch/armv7/imx/imxahci.c imxahci
+file arch/armv7/imx/imxahci.c imxahci
device imxtemp
attach imxtemp at fdt
-file arch/armv7/imx/imxtemp.c imxtemp \ No newline at end of file
+file arch/armv7/imx/imxtemp.c imxtemp
diff --git a/sys/arch/armv7/imx/imx.c b/sys/arch/armv7/imx/imx.c
deleted file mode 100644
index 1fc256b0aa2..00000000000
--- a/sys/arch/armv7/imx/imx.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* $OpenBSD: imx.c,v 1.26 2016/09/23 17:59:17 kettenis Exp $ */
-/*
- * Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
- * Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
- *
- * 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/mainbus/mainbus.h>
-#include <armv7/armv7/armv7var.h>
-
-#include <dev/ofw/fdt.h>
-
-int imx_match(struct device *, void *, void *);
-void imx6_init();
-
-struct cfattach imx_ca = {
- sizeof(struct armv7_softc), imx_match, armv7_attach
-};
-
-struct cfdriver imx_cd = {
- NULL, "imx", DV_DULL
-};
-
-struct board_dev imx_devs[] = {
- { NULL, 0 }
-};
-
-const char *imx_compatible[] = {
- "fsl,imx6sl",
- "fsl,imx6sx",
- "fsl,imx6dl",
- "fsl,imx6q",
- "fsl,imx6qp",
- NULL
-};
-
-struct board_dev *
-imx_board_devs(void)
-{
- void *node;
- int i;
-
- node = fdt_find_node("/");
- if (node == NULL)
- return NULL;
-
- for (i = 0; imx_compatible[i] != NULL; i++) {
- if (fdt_is_compatible(node, imx_compatible[i]))
- return imx_devs;
- }
- return NULL;
-}
-
-void
-imx_board_init(void)
-{
- imx6_init();
-}
-
-int
-imx_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 (imx_board_devs() != NULL);
-}
diff --git a/sys/arch/armv7/imx/imx6.c b/sys/arch/armv7/imx/imx6.c
deleted file mode 100644
index eeb78d2e874..00000000000
--- a/sys/arch/armv7/imx/imx6.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* $OpenBSD: imx6.c,v 1.5 2016/07/09 18:14:18 kettenis Exp $ */
-/*
- * Copyright (c) 2011 Uwe Stuehler <uwe@openbsd.org>
- * Copyright (c) 2012 Patrick Wildt <patrick@blueri.se>
- *
- * 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 <sys/device.h>
-#include <machine/bus.h>
-#include <arch/arm/armv7/armv7var.h>
-
-#include <armv7/armv7/armv7var.h>
-
-/* IRQs are defined without the 32 cpu IRQs */
-
-#define CCM_ADDR 0x020c4000
-#define CCM_SIZE 0x5000
-
-#define CCM_IRQ1 87
-#define CCM_IRQ2 88
-
-#define IOMUXC_ADDR 0x020e0000
-#define IOMUXC_SIZE 0x4000
-
-#define OCOTP_ADDR 0x021bc000
-#define OCOTP_SIZE 0x4000
-
-#define GPIOx_SIZE 0x4000
-#define GPIO1_ADDR 0x0209c000
-#define GPIO2_ADDR 0x020a0000
-#define GPIO3_ADDR 0x020a4000
-#define GPIO4_ADDR 0x020a8000
-#define GPIO5_ADDR 0x020ac000
-#define GPIO6_ADDR 0x020b0000
-#define GPIO7_ADDR 0x020b4000
-
-#define GPIO1_IRQ7 58
-#define GPIO1_IRQ6 59
-#define GPIO1_IRQ5 60
-#define GPIO1_IRQ4 61
-#define GPIO1_IRQ3 62
-#define GPIO1_IRQ2 63
-#define GPIO1_IRQ1 64
-#define GPIO1_IRQ0 65
-#define GPIO1_IRQ16 66
-#define GPIO1_IRQ32 67
-#define GPIO2_IRQ16 68
-#define GPIO2_IRQ32 69
-#define GPIO3_IRQ16 70
-#define GPIO3_IRQ32 71
-#define GPIO4_IRQ16 72
-#define GPIO4_IRQ32 73
-#define GPIO5_IRQ16 74
-#define GPIO5_IRQ32 75
-#define GPIO6_IRQ16 76
-#define GPIO6_IRQ32 77
-#define GPIO7_IRQ16 78
-#define GPIO7_IRQ32 79
-
-struct armv7_dev imx6_devs[] = {
-
- /*
- * Clock Control Module
- */
- { .name = "imxccm",
- .unit = 0,
- .mem = { { CCM_ADDR, CCM_SIZE } },
- },
-
- /*
- * IOMUX Controller
- */
- { .name = "imxiomuxc",
- .unit = 0,
- .mem = { { IOMUXC_ADDR, IOMUXC_SIZE } },
- },
-
- /*
- * On-Chip OTP Controller
- */
- { .name = "imxocotp",
- .unit = 0,
- .mem = { { OCOTP_ADDR, OCOTP_SIZE } },
- },
-
- /*
- * GPIO
- */
- { .name = "imxgpio",
- .unit = 0,
- .mem = { { GPIO1_ADDR, GPIOx_SIZE } },
- },
-
- { .name = "imxgpio",
- .unit = 1,
- .mem = { { GPIO2_ADDR, GPIOx_SIZE } },
- },
-
- { .name = "imxgpio",
- .unit = 2,
- .mem = { { GPIO3_ADDR, GPIOx_SIZE } },
- },
-
- { .name = "imxgpio",
- .unit = 3,
- .mem = { { GPIO4_ADDR, GPIOx_SIZE } },
- },
-
- { .name = "imxgpio",
- .unit = 4,
- .mem = { { GPIO5_ADDR, GPIOx_SIZE } },
- },
-
- { .name = "imxgpio",
- .unit = 5,
- .mem = { { GPIO6_ADDR, GPIOx_SIZE } },
- },
-
- { .name = "imxgpio",
- .unit = 6,
- .mem = { { GPIO7_ADDR, GPIOx_SIZE } },
- },
-};
-
-void
-imx6_init(void)
-{
- armv7_set_devs(imx6_devs);
-}
diff --git a/sys/arch/armv7/imx/imx_machdep.c b/sys/arch/armv7/imx/imx_machdep.c
deleted file mode 100644
index 23b96d45c4b..00000000000
--- a/sys/arch/armv7/imx/imx_machdep.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* $OpenBSD: imx_machdep.c,v 1.19 2016/06/08 15:27:05 jsg 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 <dev/ic/comreg.h>
-#include <dev/ic/comvar.h>
-
-#include <arm/cortex/smc.h>
-#include <arm/armv7/armv7var.h>
-#include <arm/mainbus/mainbus.h>
-#include <armv7/armv7/armv7var.h>
-#include <armv7/imx/imxuartvar.h>
-#include <armv7/armv7/armv7_machdep.h>
-
-extern void imxdog_reset(void);
-extern struct board_dev *imx_board_devs(void);
-extern void imx_board_init(void);
-
-void
-imx_platform_smc_write(bus_space_tag_t iot, bus_space_handle_t ioh, bus_size_t off,
- uint32_t op, uint32_t val)
-{
- bus_space_write_4(iot, ioh, off, val);
-}
-
-void
-imx_platform_init_mainbus(struct device *self)
-{
- mainbus_legacy_found(self, "cortex");
- mainbus_legacy_found(self, "imx");
-}
-
-void
-imx_platform_watchdog_reset(void)
-{
- imxdog_reset();
-}
-
-void
-imx_platform_powerdown(void)
-{
-
-}
-
-void
-imx_platform_disable_l2_if_needed(void)
-{
-
-}
-
-void
-imx_platform_board_init(void)
-{
- imx_board_init();
-}
-
-struct armv7_platform imx_platform = {
- .board_init = imx_platform_board_init,
- .smc_write = imx_platform_smc_write,
- .watchdog_reset = imx_platform_watchdog_reset,
- .powerdown = imx_platform_powerdown,
- .disable_l2_if_needed = imx_platform_disable_l2_if_needed,
- .init_mainbus = imx_platform_init_mainbus,
-};
-
-struct armv7_platform *
-imx_platform_match(void)
-{
- struct board_dev *devs;
-
- devs = imx_board_devs();
- if (devs == NULL)
- return (NULL);
-
- imx_platform.devs = devs;
- return (&imx_platform);
-}
diff --git a/sys/arch/armv7/imx/imxdog.c b/sys/arch/armv7/imx/imxdog.c
index 52e12fdbd1b..fb1c856ead4 100644
--- a/sys/arch/armv7/imx/imxdog.c
+++ b/sys/arch/armv7/imx/imxdog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imxdog.c,v 1.4 2016/07/27 11:45:02 patrick Exp $ */
+/* $OpenBSD: imxdog.c,v 1.5 2016/10/05 22:06:48 kettenis Exp $ */
/*
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
*
@@ -28,6 +28,8 @@
#include <machine/bus.h>
#include <machine/fdt.h>
+#include <armv7/armv7/armv7_machdep.h>
+
#include <dev/ofw/openfirm.h>
#include <dev/ofw/fdt.h>
@@ -83,11 +85,13 @@ imxdog_attach(struct device *parent, struct device *self, void *aux)
panic("imxdog_attach: bus_space_map failed!");
printf("\n");
+
imxdog_sc = sc;
+ cpuresetfn = imxdog_reset;
}
void
-imxdog_reset()
+imxdog_reset(void)
{
if (imxdog_sc == NULL)
return;