From 87021e009bc2eacd9274651f1064f4bff6c69ffe Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 23 Sep 2016 14:11:23 +0000 Subject: [PATCH] Restrict where we need to define fdt_fixup_table to just PowerPC and Marvell. Sponsored by: ABT Systems Ltd --- sys/arm/allwinner/a10_common.c | 4 ---- sys/arm/altera/socfpga/socfpga_common.c | 4 ---- sys/arm/amlogic/aml8726/aml8726_machdep.c | 4 ---- sys/arm/annapurna/alpine/common.c | 3 --- sys/arm/at91/at91_common.c | 4 ---- sys/arm/broadcom/bcm2835/bcm2835_common.c | 4 ---- sys/arm/freescale/imx/imx6_machdep.c | 4 ---- sys/arm/freescale/imx/imx_common.c | 4 ---- sys/arm/freescale/vybrid/vf_common.c | 4 ---- sys/arm/lpc/lpc_intc.c | 4 ---- sys/arm/nvidia/tegra124/tegra124_machdep.c | 4 ---- sys/arm/qemu/virt_common.c | 4 ---- sys/arm/rockchip/rk30xx_common.c | 4 ---- sys/arm/samsung/exynos/exynos5_common.c | 4 ---- sys/arm/ti/ti_common.c | 4 ---- sys/arm/versatile/versatile_common.c | 4 ---- sys/arm/xilinx/zy7_machdep.c | 4 ---- sys/dev/ofw/ofw_fdt.c | 13 +++++++++++-- 18 files changed, 11 insertions(+), 69 deletions(-) diff --git a/sys/arm/allwinner/a10_common.c b/sys/arm/allwinner/a10_common.c index 82be0c043ab5..6b3fded7a3ab 100644 --- a/sys/arm/allwinner/a10_common.c +++ b/sys/arm/allwinner/a10_common.c @@ -38,10 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int diff --git a/sys/arm/altera/socfpga/socfpga_common.c b/sys/arm/altera/socfpga/socfpga_common.c index 740d342f6792..9944b90e8b52 100644 --- a/sys/arm/altera/socfpga/socfpga_common.c +++ b/sys/arm/altera/socfpga/socfpga_common.c @@ -70,10 +70,6 @@ cpu_reset(void) while (1); } -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, diff --git a/sys/arm/amlogic/aml8726/aml8726_machdep.c b/sys/arm/amlogic/aml8726/aml8726_machdep.c index 10bb5914319d..7ab7f5ec975f 100644 --- a/sys/arm/amlogic/aml8726/aml8726_machdep.c +++ b/sys/arm/amlogic/aml8726/aml8726_machdep.c @@ -165,10 +165,6 @@ platform_devmap_init(void) return (0); } -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG #ifndef DEV_GIC static int diff --git a/sys/arm/annapurna/alpine/common.c b/sys/arm/annapurna/alpine/common.c index cf905569275d..b03c3a487552 100644 --- a/sys/arm/annapurna/alpine/common.c +++ b/sys/arm/annapurna/alpine/common.c @@ -56,9 +56,6 @@ __FBSDID("$FreeBSD$"); #define LOCK 0x00000001 extern bus_addr_t al_devmap_pa; -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; static int alpine_get_wdt_base(uint32_t *pbase, uint32_t *psize); static int alpine_pic_decode_fdt(uint32_t iparent, uint32_t *intr, diff --git a/sys/arm/at91/at91_common.c b/sys/arm/at91/at91_common.c index 49ad0659b7ac..696161f34001 100644 --- a/sys/arm/at91/at91_common.c +++ b/sys/arm/at91/at91_common.c @@ -49,10 +49,6 @@ __FBSDID("$FreeBSD$"); extern const struct devmap_entry at91_devmap[]; -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_aic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, diff --git a/sys/arm/broadcom/bcm2835/bcm2835_common.c b/sys/arm/broadcom/bcm2835/bcm2835_common.c index e7ce52b2a898..6f136f81da99 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_common.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_common.c @@ -46,10 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_intc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, diff --git a/sys/arm/freescale/imx/imx6_machdep.c b/sys/arm/freescale/imx/imx6_machdep.c index 098a912e691d..ad826787a1a6 100644 --- a/sys/arm/freescale/imx/imx6_machdep.c +++ b/sys/arm/freescale/imx/imx6_machdep.c @@ -52,10 +52,6 @@ __FBSDID("$FreeBSD$"); #include "platform_if.h" -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - static uint32_t gpio1_node; #ifndef INTRNG diff --git a/sys/arm/freescale/imx/imx_common.c b/sys/arm/freescale/imx/imx_common.c index c423873c80c3..3eb076e0b51f 100644 --- a/sys/arm/freescale/imx/imx_common.c +++ b/sys/arm/freescale/imx/imx_common.c @@ -50,10 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_intc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, diff --git a/sys/arm/freescale/vybrid/vf_common.c b/sys/arm/freescale/vybrid/vf_common.c index 494f5d60e0c1..d57748172822 100644 --- a/sys/arm/freescale/vybrid/vf_common.c +++ b/sys/arm/freescale/vybrid/vf_common.c @@ -62,10 +62,6 @@ cpu_reset(void) while (1); } -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, diff --git a/sys/arm/lpc/lpc_intc.c b/sys/arm/lpc/lpc_intc.c index db7c300aa326..d26ef9099c74 100644 --- a/sys/arm/lpc/lpc_intc.c +++ b/sys/arm/lpc/lpc_intc.c @@ -227,10 +227,6 @@ lpc_intc_eoi(void *data) } -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, diff --git a/sys/arm/nvidia/tegra124/tegra124_machdep.c b/sys/arm/nvidia/tegra124/tegra124_machdep.c index 387a4f7b9d4f..dba6b6ec8b9f 100644 --- a/sys/arm/nvidia/tegra124/tegra124_machdep.c +++ b/sys/arm/nvidia/tegra124/tegra124_machdep.c @@ -61,10 +61,6 @@ __FBSDID("$FreeBSD$"); PMC_SCRATCH0_MODE_BOOTLOADER | \ PMC_SCRATCH0_MODE_RCM) -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - static vm_offset_t tegra124_lastaddr(platform_t plat) { diff --git a/sys/arm/qemu/virt_common.c b/sys/arm/qemu/virt_common.c index 03cba309308d..cda02e539e66 100644 --- a/sys/arm/qemu/virt_common.c +++ b/sys/arm/qemu/virt_common.c @@ -37,10 +37,6 @@ __FBSDID("$FreeBSD$"); #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG fdt_pic_decode_t fdt_pic_table[] = { &gic_decode_fdt, diff --git a/sys/arm/rockchip/rk30xx_common.c b/sys/arm/rockchip/rk30xx_common.c index aa66b72101a3..826ebda79817 100644 --- a/sys/arm/rockchip/rk30xx_common.c +++ b/sys/arm/rockchip/rk30xx_common.c @@ -38,10 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, diff --git a/sys/arm/samsung/exynos/exynos5_common.c b/sys/arm/samsung/exynos/exynos5_common.c index b91e0830e1ec..04021c1cb919 100644 --- a/sys/arm/samsung/exynos/exynos5_common.c +++ b/sys/arm/samsung/exynos/exynos5_common.c @@ -49,10 +49,6 @@ cpu_reset(void) while (1); } -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, diff --git a/sys/arm/ti/ti_common.c b/sys/arm/ti/ti_common.c index 41c5a72c210c..64a7830f6a5c 100644 --- a/sys/arm/ti/ti_common.c +++ b/sys/arm/ti/ti_common.c @@ -49,10 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG #ifdef SOC_TI_AM335X static int diff --git a/sys/arm/versatile/versatile_common.c b/sys/arm/versatile/versatile_common.c index aca54b7eb8ee..983b3ce018b5 100644 --- a/sys/arm/versatile/versatile_common.c +++ b/sys/arm/versatile/versatile_common.c @@ -46,10 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_intc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, diff --git a/sys/arm/xilinx/zy7_machdep.c b/sys/arm/xilinx/zy7_machdep.c index 9a464ea9ec42..771503d7dd38 100644 --- a/sys/arm/xilinx/zy7_machdep.c +++ b/sys/arm/xilinx/zy7_machdep.c @@ -93,10 +93,6 @@ platform_devmap_init(void) } -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_gic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, diff --git a/sys/dev/ofw/ofw_fdt.c b/sys/dev/ofw/ofw_fdt.c index 0f7cf07919b3..605166832d9a 100644 --- a/sys/dev/ofw/ofw_fdt.c +++ b/sys/dev/ofw/ofw_fdt.c @@ -52,6 +52,15 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif +#if defined(__arm__) +#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) || \ + defined(SOC_MV_DISCOVERY) || defined(SOC_MV_DOVE) || \ + defined(SOC_MV_FREY) || defined(SOC_MV_KIRKWOOD) || \ + defined(SOC_MV_LOKIPLUS) || defined(SOC_MV_ORION) +#define FDT_MARVELL +#endif +#endif + static int ofw_fdt_init(ofw_t, void *); static phandle_t ofw_fdt_peer(ofw_t, phandle_t); static phandle_t ofw_fdt_child(ofw_t, phandle_t); @@ -415,7 +424,7 @@ ofw_fdt_package_to_path(ofw_t ofw, phandle_t package, char *buf, size_t len) return (-1); } -#if defined(__arm__) || defined(__powerpc__) +#if defined(FDT_MARVELL) || defined(__powerpc__) static int ofw_fdt_fixup(ofw_t ofw) { @@ -454,7 +463,7 @@ ofw_fdt_fixup(ofw_t ofw) static int ofw_fdt_interpret(ofw_t ofw, const char *cmd, int nret, cell_t *retvals) { -#if defined(__arm__) || defined(__powerpc__) +#if defined(FDT_MARVELL) || defined(__powerpc__) int rv; /*