Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Rename armv7fdt to armfdt now that bus space + dma ...



details:   https://anonhg.NetBSD.org/src/rev/f2abed889d4c
branches:  trunk
changeset: 824261:f2abed889d4c
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon May 29 23:21:12 2017 +0000

description:
Rename armv7fdt to armfdt now that bus space + dma tags are filled in by
platform code.

diffstat:

 sys/arch/arm/fdt/arm_fdt.c            |  100 ++++++++++++++++++++++++++++++++
 sys/arch/arm/fdt/arm_fdtvar.h         |   66 +++++++++++++++++++++
 sys/arch/arm/fdt/armv7_fdt.c          |  104 ----------------------------------
 sys/arch/arm/fdt/armv7_fdtvar.h       |   66 ---------------------
 sys/arch/arm/fdt/files.fdt            |    8 +-
 sys/arch/arm/nvidia/tegra_platform.c  |   12 +-
 sys/arch/evbarm/conf/TEGRA            |    4 +-
 sys/arch/evbarm/tegra/tegra_machdep.c |   18 ++--
 8 files changed, 187 insertions(+), 191 deletions(-)

diffs (truncated from 512 to 300 lines):

diff -r 24580599b5ed -r f2abed889d4c sys/arch/arm/fdt/arm_fdt.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/fdt/arm_fdt.c        Mon May 29 23:21:12 2017 +0000
@@ -0,0 +1,100 @@
+/* $NetBSD: arm_fdt.c,v 1.1 2017/05/29 23:21:12 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
+ * 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 ``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 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.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.1 2017/05/29 23:21:12 jmcneill Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+
+#include <machine/cpu.h>
+#include <sys/bus.h>
+
+#include <dev/fdt/fdtvar.h>
+#include <dev/ofw/openfirm.h>
+
+#include <arm/fdt/arm_fdtvar.h>
+
+static int     arm_fdt_match(device_t, cfdata_t, void *);
+static void    arm_fdt_attach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(arm_fdt, 0,
+    arm_fdt_match, arm_fdt_attach, NULL, NULL);
+
+static struct arm_platlist arm_platform_list =
+    TAILQ_HEAD_INITIALIZER(arm_platform_list);
+
+int
+arm_fdt_match(device_t parent, cfdata_t cf, void *aux)
+{
+       return 1;
+}
+
+void
+arm_fdt_attach(device_t parent, device_t self, void *aux)
+{
+       const struct arm_platform *plat = arm_fdt_platform();
+       struct fdt_attach_args faa;
+
+       aprint_naive("\n");
+       aprint_normal("\n");
+
+       plat->init_attach_args(&faa);
+       faa.faa_name = "";
+       faa.faa_phandle = OF_peer(0);
+
+       config_found(self, &faa, NULL);
+}
+
+const struct arm_platform *
+arm_fdt_platform(void)
+{
+       static const struct arm_platform_info *booted_platform = NULL;
+
+       if (booted_platform == NULL) {
+               __link_set_decl(arm_platforms, struct arm_platform_info);
+               struct arm_platform_info * const *info;
+               const struct arm_platform_info *best_info = NULL;
+               const int phandle = OF_peer(0);
+               int match, best_match = 0;
+
+               __link_set_foreach(info, arm_platforms) {
+                       const char * const compat[] = { (*info)->compat, NULL };
+                       match = of_match_compatible(phandle, compat);
+                       if (match > best_match) {
+                               best_match = match;
+                               best_info = *info;
+                       }
+               }
+
+               booted_platform = best_info;
+       }
+
+       return booted_platform == NULL ? NULL : booted_platform->ops;
+}
diff -r 24580599b5ed -r f2abed889d4c sys/arch/arm/fdt/arm_fdtvar.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/fdt/arm_fdtvar.h     Mon May 29 23:21:12 2017 +0000
@@ -0,0 +1,66 @@
+/* $NetBSD: arm_fdtvar.h,v 1.1 2017/05/29 23:21:12 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
+ * 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 ``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 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.
+ */
+
+#ifndef _ARM_ARM_FDTVAR_H
+#define _ARM_ARM_FDTVAR_H
+
+/*
+ * Platform-specific data
+ */
+
+struct fdt_attach_args;
+
+struct arm_platform {
+       const struct pmap_devmap * (*devmap)(void);
+       void                    (*bootstrap)(void);
+       void                    (*init_attach_args)(struct fdt_attach_args *);
+       void                    (*early_putchar)(char);
+       void                    (*device_register)(device_t, void *);
+       void                    (*reset)(void);
+};
+
+struct arm_platform_info {
+       const char *                    compat;
+       const struct arm_platform *     ops;
+};
+
+#define _ARM_PLATFORM_REGISTER(name)   \
+       __link_set_add_rodata(arm_platforms, __CONCAT(name,_platinfo));
+
+#define ARM_PLATFORM(_name, _compat, _ops)                             \
+static const struct arm_platform_info __CONCAT(_name,_platinfo) = {    \
+       .compat = (_compat),                                            \
+       .ops = (_ops)                                                   \
+};                                                                     \
+_ARM_PLATFORM_REGISTER(_name)
+
+TAILQ_HEAD(arm_platlist, arm_platform_info);
+
+const struct arm_platform *    arm_fdt_platform(void);
+
+#endif /* !_ARM_ARM_FDTVAR_H */
diff -r 24580599b5ed -r f2abed889d4c sys/arch/arm/fdt/armv7_fdt.c
--- a/sys/arch/arm/fdt/armv7_fdt.c      Mon May 29 23:13:03 2017 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/* $NetBSD: armv7_fdt.c,v 1.3 2017/05/29 23:13:03 jmcneill Exp $ */
-
-/*-
- * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
- * 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 ``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 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.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: armv7_fdt.c,v 1.3 2017/05/29 23:13:03 jmcneill Exp $");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-
-#include <machine/cpu.h>
-#include <sys/bus.h>
-
-#include <dev/fdt/fdtvar.h>
-#include <dev/ofw/openfirm.h>
-
-#include <arm/fdt/armv7_fdtvar.h>
-
-static int     armv7_fdt_match(device_t, cfdata_t, void *);
-static void    armv7_fdt_attach(device_t, device_t, void *);
-
-CFATTACH_DECL_NEW(armv7_fdt, 0,
-    armv7_fdt_match, armv7_fdt_attach, NULL, NULL);
-
-extern struct bus_space armv7_generic_bs_tag;
-extern struct bus_space armv7_generic_a4x_bs_tag;
-extern struct arm32_bus_dma_tag armv7_generic_dma_tag;
-
-static struct armv7_platlist armv7_platform_list =
-    TAILQ_HEAD_INITIALIZER(armv7_platform_list);
-
-int
-armv7_fdt_match(device_t parent, cfdata_t cf, void *aux)
-{
-       return 1;
-}
-
-void
-armv7_fdt_attach(device_t parent, device_t self, void *aux)
-{
-       const struct armv7_platform *plat = armv7_fdt_platform();
-       struct fdt_attach_args faa;
-
-       aprint_naive("\n");
-       aprint_normal("\n");
-
-       plat->init_attach_args(&faa);
-       faa.faa_name = "";
-       faa.faa_phandle = OF_peer(0);
-
-       config_found(self, &faa, NULL);
-}
-
-const struct armv7_platform *
-armv7_fdt_platform(void)
-{
-       static const struct armv7_platform_info *booted_platform = NULL;
-
-       if (booted_platform == NULL) {
-               __link_set_decl(armv7_platforms, struct armv7_platform_info);
-               struct armv7_platform_info * const *info;
-               const struct armv7_platform_info *best_info = NULL;
-               const int phandle = OF_peer(0);
-               int match, best_match = 0;
-
-               __link_set_foreach(info, armv7_platforms) {
-                       const char * const compat[] = { (*info)->compat, NULL };
-                       match = of_match_compatible(phandle, compat);
-                       if (match > best_match) {
-                               best_match = match;
-                               best_info = *info;
-                       }
-               }
-
-               booted_platform = best_info;
-       }
-
-       return booted_platform == NULL ? NULL : booted_platform->ops;
-}
diff -r 24580599b5ed -r f2abed889d4c sys/arch/arm/fdt/armv7_fdtvar.h
--- a/sys/arch/arm/fdt/armv7_fdtvar.h   Mon May 29 23:13:03 2017 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/* $NetBSD: armv7_fdtvar.h,v 1.2 2017/05/29 23:13:03 jmcneill Exp $ */
-
-/*-
- * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
- * 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.



Home | Main Index | Thread Index | Old Index