diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-10-05 22:06:49 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-10-05 22:06:49 +0000 |
commit | d61f3d4e7d9143c4d3edd268978195aa041f81e4 (patch) | |
tree | 0c046610f586550b73c5016a07744a3276d0c72f /sys/arch/armv7 | |
parent | fb6d4103628f27e5c21220e95c8eee0d732cef04 (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')
-rw-r--r-- | sys/arch/armv7/armv7/armv7var.h | 12 | ||||
-rw-r--r-- | sys/arch/armv7/armv7/platform.c | 7 | ||||
-rw-r--r-- | sys/arch/armv7/conf/GENERIC | 3 | ||||
-rw-r--r-- | sys/arch/armv7/conf/RAMDISK | 3 | ||||
-rw-r--r-- | sys/arch/armv7/imx/files.imx | 24 | ||||
-rw-r--r-- | sys/arch/armv7/imx/imx.c | 89 | ||||
-rw-r--r-- | sys/arch/armv7/imx/imx6.c | 142 | ||||
-rw-r--r-- | sys/arch/armv7/imx/imx_machdep.c | 98 | ||||
-rw-r--r-- | sys/arch/armv7/imx/imxdog.c | 8 |
9 files changed, 19 insertions, 367 deletions
diff --git a/sys/arch/armv7/armv7/armv7var.h b/sys/arch/armv7/armv7/armv7var.h index e1e78a5fa55..84851ca754e 100644 --- a/sys/arch/armv7/armv7/armv7var.h +++ b/sys/arch/armv7/armv7/armv7var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: armv7var.h,v 1.12 2016/06/04 18:09:16 jsg Exp $ */ +/* $OpenBSD: armv7var.h,v 1.13 2016/10/05 22:06:48 kettenis Exp $ */ /* * Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com> * Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se> @@ -31,7 +31,7 @@ struct armv7_board { void (*init)(void); }; -/* Needed by omap, imx, sunxi */ +/* Needed by omap, sunxi */ struct armv7_softc { struct device sc_dv; @@ -80,17 +80,9 @@ int armv7_submatch(struct device *, void *, void *); #define BOARD_ID_EXYNOS4_SMDKC210 2838 #define BOARD_ID_EXYNOS4_NURI 3379 #define BOARD_ID_AM335X_BEAGLEBONE 3589 -#define BOARD_ID_IMX6_SABRELITE 3769 #define BOARD_ID_EXYNOS5_CHROMEBOOK 3774 -#define BOARD_ID_IMX6_SABRESD 3980 #define BOARD_ID_SUN4I_A10 4104 -#define BOARD_ID_IMX6_NOVENA 4269 -#define BOARD_ID_IMX6_UTILITE 4273 #define BOARD_ID_SUN7I_A20 4283 -#define BOARD_ID_IMX6_WANDBOARD 4412 -#define BOARD_ID_IMX6_HUMMINGBOARD 4773 -#define BOARD_ID_IMX6_UDOO 4800 -#define BOARD_ID_IMX6_CUBOXI 4821 extern uint32_t board_id; #endif /* __ARMV7VAR_H__ */ diff --git a/sys/arch/armv7/armv7/platform.c b/sys/arch/armv7/armv7/platform.c index dd14b00e922..7954b7f34a7 100644 --- a/sys/arch/armv7/armv7/platform.c +++ b/sys/arch/armv7/armv7/platform.c @@ -1,4 +1,4 @@ -/* $OpenBSD: platform.c,v 1.15 2016/10/05 07:29:59 patrick Exp $ */ +/* $OpenBSD: platform.c,v 1.16 2016/10/05 22:06:48 kettenis Exp $ */ /* * Copyright (c) 2014 Patrick Wildt <patrick@blueri.se> * @@ -26,7 +26,6 @@ #include <armv7/armv7/armv7_machdep.h> #include <arm/cortex/smc.h> -#include "imx.h" #include "omap.h" #include "sunxi.h" #include "exynos.h" @@ -41,16 +40,12 @@ void imxuart_init_cons(void); void com_fdt_init_cons(void); void pluart_init_cons(void); -struct armv7_platform *imx_platform_match(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 *vexpress_platform_match(void); struct armv7_platform * (*plat_match[])(void) = { -#if NIMX > 0 - imx_platform_match, -#endif #if NOMAP > 0 omap_platform_match, #endif diff --git a/sys/arch/armv7/conf/GENERIC b/sys/arch/armv7/conf/GENERIC index 2bc096dfbc5..d0b86f1db1f 100644 --- a/sys/arch/armv7/conf/GENERIC +++ b/sys/arch/armv7/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.57 2016/10/03 01:59:20 jsg Exp $ +# $OpenBSD: GENERIC,v 1.58 2016/10/05 22:06:48 kettenis Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -39,7 +39,6 @@ agtimer* at fdt? armliicc* at cortex? # iMX -imx0 at mainbus? # iMX SoC imxccm* at fdt? early 1 # clock control module imxiomuxc* at fdt? early 1 # iomux controller imxocotp* at fdt? # on-chip otp controller diff --git a/sys/arch/armv7/conf/RAMDISK b/sys/arch/armv7/conf/RAMDISK index c7d8259fc10..40c9fa5e339 100644 --- a/sys/arch/armv7/conf/RAMDISK +++ b/sys/arch/armv7/conf/RAMDISK @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK,v 1.52 2016/10/03 01:59:20 jsg Exp $ +# $OpenBSD: RAMDISK,v 1.53 2016/10/05 22:06:48 kettenis Exp $ machine armv7 arm @@ -38,7 +38,6 @@ agtimer* at fdt? armliicc* at cortex? # iMX -imx0 at mainbus? # iMX SoC imxccm* at fdt? early 1 # clock control module imxiomuxc* at fdt? early 1 # iomux controller imxocotp* at fdt? # on-chip otp controller 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; |