Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/fdt Rename ARM_PLATFORM to FDT_PLATFORM and make it ...



details:   https://anonhg.NetBSD.org/src/rev/ec9fcc6c1d3a
branches:  trunk
changeset: 374173:ec9fcc6c1d3a
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Apr 07 08:55:29 2023 +0000

description:
Rename ARM_PLATFORM to FDT_PLATFORM and make it available outside arm.

diffstat:

 sys/arch/aarch64/aarch64/aarch64_machdep.c |   11 +-
 sys/arch/arm/acpi/acpi_platform.c          |   25 +-
 sys/arch/arm/altera/cycv_platform.c        |   27 ++-
 sys/arch/arm/amlogic/meson_platform.c      |   47 +++---
 sys/arch/arm/apple/apple_platform.c        |   27 ++-
 sys/arch/arm/arm32/arm32_machdep.c         |   16 +-
 sys/arch/arm/broadcom/bcm283x_platform.c   |   84 ++++++------
 sys/arch/arm/fdt/arm_fdt.c                 |   54 +-------
 sys/arch/arm/fdt/arm_fdtvar.h              |   43 +------
 sys/arch/arm/fdt/arm_platform.c            |   27 ++-
 sys/arch/arm/nvidia/tegra_platform.c       |   44 +++---
 sys/arch/arm/nxp/imx6_platform.c           |   29 ++--
 sys/arch/arm/rockchip/rk_platform.c        |   86 ++++++------
 sys/arch/arm/samsung/exynos_platform.c     |   44 +++---
 sys/arch/arm/sunxi/sunxi_platform.c        |  189 ++++++++++++++--------------
 sys/arch/arm/ti/am3_platform.c             |   21 +-
 sys/arch/arm/ti/omap3_platform.c           |   23 +-
 sys/arch/arm/vexpress/vexpress_platform.c  |   24 +-
 sys/arch/arm/xilinx/zynq_platform.c        |   24 +-
 sys/arch/evbarm/fdt/fdt_bus_machdep.c      |    9 +-
 sys/arch/evbarm/fdt/fdt_machdep.c          |   44 +++---
 sys/dev/fdt/fdt_platform.c                 |   83 ++++++++++++
 sys/dev/fdt/fdtvar.h                       |   40 +++++-
 sys/dev/fdt/files.fdt                      |    3 +-
 24 files changed, 539 insertions(+), 485 deletions(-)

diffs (truncated from 1800 to 300 lines):

diff -r c75559c1c2a9 -r ec9fcc6c1d3a sys/arch/aarch64/aarch64/aarch64_machdep.c
--- a/sys/arch/aarch64/aarch64/aarch64_machdep.c        Fri Apr 07 06:44:08 2023 +0000
+++ b/sys/arch/aarch64/aarch64/aarch64_machdep.c        Fri Apr 07 08:55:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.66 2022/08/19 08:17:32 ryo Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.67 2023/04/07 08:55:29 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.66 2022/08/19 08:17:32 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.67 2023/04/07 08:55:29 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_cpuoptions.h"
@@ -74,6 +74,7 @@
 #include <aarch64/kcore.h>
 
 #include <arm/fdt/arm_fdtvar.h>
+#include <dev/fdt/fdtvar.h>
 #include <dev/fdt/fdt_memory.h>
 
 #ifdef VERBOSE_INIT_ARM
@@ -677,9 +678,9 @@ cpu_startup(void)
        consinit();
 
 #ifdef FDT
-       const struct arm_platform * const plat = arm_fdt_platform();
-       if (plat->ap_startup != NULL)
-               plat->ap_startup();
+       const struct fdt_platform * const plat = fdt_platform_find();
+       if (plat->fp_startup != NULL)
+               plat->fp_startup();
 #endif
 
        /*
diff -r c75559c1c2a9 -r ec9fcc6c1d3a sys/arch/arm/acpi/acpi_platform.c
--- a/sys/arch/arm/acpi/acpi_platform.c Fri Apr 07 06:44:08 2023 +0000
+++ b/sys/arch/arm/acpi/acpi_platform.c Fri Apr 07 08:55:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_platform.c,v 1.35 2023/01/24 06:56:40 mlelstv Exp $ */
+/* $NetBSD: acpi_platform.c,v 1.36 2023/04/07 08:55:29 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.35 2023/01/24 06:56:40 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.36 2023/04/07 08:55:29 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -45,7 +45,6 @@
 #include <sys/kprintf.h>
 
 #include <dev/fdt/fdtvar.h>
-#include <arm/fdt/arm_fdtvar.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -408,15 +407,15 @@ acpi_platform_uart_freq(void)
        return 0;
 }
 
-static const struct arm_platform acpi_platform = {
-       .ap_devmap = acpi_platform_devmap,
-       .ap_bootstrap = acpi_platform_bootstrap,
-       .ap_startup = acpi_platform_startup,
-       .ap_init_attach_args = acpi_platform_init_attach_args,
-       .ap_device_register = acpi_platform_device_register,
-       .ap_reset = acpi_platform_reset,
-       .ap_delay = gtmr_delay,
-       .ap_uart_freq = acpi_platform_uart_freq,
+static const struct fdt_platform acpi_platform = {
+       .fp_devmap = acpi_platform_devmap,
+       .fp_bootstrap = acpi_platform_bootstrap,
+       .fp_startup = acpi_platform_startup,
+       .fp_init_attach_args = acpi_platform_init_attach_args,
+       .fp_device_register = acpi_platform_device_register,
+       .fp_reset = acpi_platform_reset,
+       .fp_delay = gtmr_delay,
+       .fp_uart_freq = acpi_platform_uart_freq,
 };
 
-ARM_PLATFORM(acpi, "netbsd,generic-acpi", &acpi_platform);
+FDT_PLATFORM(acpi, "netbsd,generic-acpi", &acpi_platform);
diff -r c75559c1c2a9 -r ec9fcc6c1d3a sys/arch/arm/altera/cycv_platform.c
--- a/sys/arch/arm/altera/cycv_platform.c       Fri Apr 07 06:44:08 2023 +0000
+++ b/sys/arch/arm/altera/cycv_platform.c       Fri Apr 07 08:55:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cycv_platform.c,v 1.18 2021/04/24 23:36:25 thorpej Exp $ */
+/* $NetBSD: cycv_platform.c,v 1.19 2023/04/07 08:55:29 skrll Exp $ */
 
 /* This file is in the public domain. */
 
@@ -7,7 +7,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cycv_platform.c,v 1.18 2021/04/24 23:36:25 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cycv_platform.c,v 1.19 2023/04/07 08:55:29 skrll Exp $");
 
 #define        _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
@@ -28,8 +28,9 @@
 #include <arm/bootconfig.h>
 #include <arm/cpufunc.h>
 
+#include <dev/fdt/fdtvar.h>
+
 #include <arm/fdt/arm_fdtvar.h>
-#include <dev/fdt/fdtvar.h>
 #include <dev/ic/comreg.h>
 
 void cycv_platform_early_putchar(char);
@@ -164,15 +165,15 @@ cycv_platform_uart_freq(void) {
        return cycv_clkmgr_early_get_l4_sp_clk();
 }
 
-static const struct arm_platform cycv_platform = {
-       .ap_devmap = cycv_platform_devmap,
-       .ap_bootstrap = cycv_platform_bootstrap,
-       .ap_init_attach_args = cycv_platform_init_attach_args,
-       .ap_device_register = cycv_platform_device_register,
-       .ap_reset = cycv_platform_reset,
-       .ap_delay = a9tmr_delay,
-       .ap_uart_freq = cycv_platform_uart_freq,
-       .ap_mpstart = cycv_mpstart,
+static const struct fdt_platform cycv_platform = {
+       .fp_devmap = cycv_platform_devmap,
+       .fp_bootstrap = cycv_platform_bootstrap,
+       .fp_init_attach_args = cycv_platform_init_attach_args,
+       .fp_device_register = cycv_platform_device_register,
+       .fp_reset = cycv_platform_reset,
+       .fp_delay = a9tmr_delay,
+       .fp_uart_freq = cycv_platform_uart_freq,
+       .fp_mpstart = cycv_mpstart,
 };
 
-ARM_PLATFORM(cycv, "altr,socfpga-cyclone5", &cycv_platform);
+FDT_PLATFORM(cycv, "altr,socfpga-cyclone5", &cycv_platform);
diff -r c75559c1c2a9 -r ec9fcc6c1d3a sys/arch/arm/amlogic/meson_platform.c
--- a/sys/arch/arm/amlogic/meson_platform.c     Fri Apr 07 06:44:08 2023 +0000
+++ b/sys/arch/arm/amlogic/meson_platform.c     Fri Apr 07 08:55:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: meson_platform.c,v 1.20 2021/04/24 23:36:26 thorpej Exp $ */
+/* $NetBSD: meson_platform.c,v 1.21 2023/04/07 08:55:29 skrll Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -33,7 +33,7 @@
 #include "arml2cc.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.20 2021/04/24 23:36:26 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.21 2023/04/07 08:55:29 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -42,6 +42,7 @@
 #include <sys/termios.h>
 
 #include <dev/fdt/fdtvar.h>
+
 #include <arm/fdt/arm_fdtvar.h>
 
 #include <uvm/uvm_extern.h>
@@ -440,18 +441,18 @@ meson8b_mpstart(void)
        return ret;
 }
 
-static const struct arm_platform meson8b_platform = {
-       .ap_devmap = meson_platform_devmap,
-       .ap_bootstrap = meson8b_platform_bootstrap,
-       .ap_init_attach_args = meson_platform_init_attach_args,
-       .ap_device_register = meson8b_platform_device_register,
-       .ap_reset = meson8b_platform_reset,
-       .ap_delay = a9ptmr_delay,
-       .ap_uart_freq = meson_platform_uart_freq,
-       .ap_mpstart = meson8b_mpstart,
+static const struct fdt_platform meson8b_platform = {
+       .fp_devmap = meson_platform_devmap,
+       .fp_bootstrap = meson8b_platform_bootstrap,
+       .fp_init_attach_args = meson_platform_init_attach_args,
+       .fp_device_register = meson8b_platform_device_register,
+       .fp_reset = meson8b_platform_reset,
+       .fp_delay = a9ptmr_delay,
+       .fp_uart_freq = meson_platform_uart_freq,
+       .fp_mpstart = meson8b_mpstart,
 };
 
-ARM_PLATFORM(meson8b, "amlogic,meson8b", &meson8b_platform);
+FDT_PLATFORM(meson8b, "amlogic,meson8b", &meson8b_platform);
 #endif /* SOC_MESON8B */
 
 #if defined(SOC_MESONGX)
@@ -478,21 +479,21 @@ mesongx_platform_reset(void)
        }
 }
 
-static const struct arm_platform mesongx_platform = {
-       .ap_devmap = meson_platform_devmap,
-       .ap_bootstrap = meson_platform_bootstrap,
-       .ap_init_attach_args = meson_platform_init_attach_args,
-       .ap_device_register = meson_platform_device_register,
-       .ap_reset = mesongx_platform_reset,
-       .ap_delay = gtmr_delay,
-       .ap_uart_freq = meson_platform_uart_freq,
-       .ap_mpstart = arm_fdt_cpu_mpstart,
+static const struct fdt_platform mesongx_platform = {
+       .fp_devmap = meson_platform_devmap,
+       .fp_bootstrap = meson_platform_bootstrap,
+       .fp_init_attach_args = meson_platform_init_attach_args,
+       .fp_device_register = meson_platform_device_register,
+       .fp_reset = mesongx_platform_reset,
+       .fp_delay = gtmr_delay,
+       .fp_uart_freq = meson_platform_uart_freq,
+       .fp_mpstart = arm_fdt_cpu_mpstart,
 };
 
 #if defined(SOC_MESONGXBB)
-ARM_PLATFORM(mesongxbb, "amlogic,meson-gxbb", &mesongx_platform);
+FDT_PLATFORM(mesongxbb, "amlogic,meson-gxbb", &mesongx_platform);
 #endif /* SOC_MESONGXBB */
 #if defined(SOC_MESONGXL)
-ARM_PLATFORM(mesongxl, "amlogic,meson-gxl", &mesongx_platform);
+FDT_PLATFORM(mesongxl, "amlogic,meson-gxl", &mesongx_platform);
 #endif /* SOC_MESONGXL */
 #endif /* SOC_MESONGX */
diff -r c75559c1c2a9 -r ec9fcc6c1d3a sys/arch/arm/apple/apple_platform.c
--- a/sys/arch/arm/apple/apple_platform.c       Fri Apr 07 06:44:08 2023 +0000
+++ b/sys/arch/arm/apple/apple_platform.c       Fri Apr 07 08:55:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: apple_platform.c,v 1.5 2022/10/15 11:07:38 jmcneill Exp $ */
+/* $NetBSD: apple_platform.c,v 1.6 2023/04/07 08:55:29 skrll Exp $ */
 
 /*-
  * Copyright (c) 2021 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: apple_platform.c,v 1.5 2022/10/15 11:07:38 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apple_platform.c,v 1.6 2023/04/07 08:55:29 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -36,6 +36,7 @@
 #include <sys/termios.h>
 
 #include <dev/fdt/fdtvar.h>
+
 #include <arm/fdt/arm_fdtvar.h>
 
 #include <uvm/uvm_extern.h>
@@ -150,7 +151,7 @@ apple_platform_devmap(void)
 }
 
 static u_int
-arm_platform_uart_freq(void)
+apple_platform_uart_freq(void)
 {
        return 0;
 }
@@ -235,15 +236,15 @@ apple_platform_device_register(device_t 
        }
 }
 
-static const struct arm_platform apple_arm_platform = {
-       .ap_devmap = apple_platform_devmap,
-       .ap_bootstrap = apple_platform_bootstrap,
-       .ap_init_attach_args = apple_platform_init_attach_args,
-       .ap_reset = psci_fdt_reset,
-       .ap_delay = gtmr_delay,
-       .ap_uart_freq = arm_platform_uart_freq,
-       .ap_device_register = apple_platform_device_register,
-       .ap_mpstart = arm_fdt_cpu_mpstart,
+static const struct fdt_platform apple_fdt_platform = {
+       .fp_devmap = apple_platform_devmap,
+       .fp_bootstrap = apple_platform_bootstrap,
+       .fp_init_attach_args = apple_platform_init_attach_args,
+       .fp_reset = psci_fdt_reset,
+       .fp_delay = gtmr_delay,
+       .fp_uart_freq = apple_platform_uart_freq,
+       .fp_device_register = apple_platform_device_register,
+       .fp_mpstart = arm_fdt_cpu_mpstart,
 };
 
-ARM_PLATFORM(apple_arm, "apple,arm-platform", &apple_arm_platform);
+FDT_PLATFORM(apple_arm, "apple,arm-platform", &apple_fdt_platform);
diff -r c75559c1c2a9 -r ec9fcc6c1d3a sys/arch/arm/arm32/arm32_machdep.c
--- a/sys/arch/arm/arm32/arm32_machdep.c        Fri Apr 07 06:44:08 2023 +0000
+++ b/sys/arch/arm/arm32/arm32_machdep.c        Fri Apr 07 08:55:29 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arm32_machdep.c,v 1.145 2023/01/19 08:03:51 mlelstv Exp $      */



Home | Main Index | Thread Index | Old Index