From 6c925b9c81036a86db387f75a32b423420eadf6c Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Fri, 16 Dec 2016 10:31:13 +0000 Subject: [PATCH] All armv6 platforms have the same implementation of platform_lastaddr. Replace them with a default handler that returns devmap_lastaddr. Reviewed by: mmel Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D8806 --- sys/arm/allwinner/aw_machdep.c | 15 --------------- sys/arm/arm/platform_if.m | 10 ++++++++-- sys/arm/broadcom/bcm2835/bcm2835_machdep.c | 10 ---------- sys/arm/freescale/imx/imx51_machdep.c | 9 --------- sys/arm/freescale/imx/imx53_machdep.c | 9 --------- sys/arm/freescale/imx/imx6_machdep.c | 9 --------- sys/arm/nvidia/tegra124/tegra124_machdep.c | 8 -------- sys/arm/qemu/virt_machdep.c | 9 --------- sys/arm/rockchip/rk30xx_machdep.c | 9 --------- sys/arm/ti/ti_machdep.c | 10 ---------- 10 files changed, 8 insertions(+), 90 deletions(-) diff --git a/sys/arm/allwinner/aw_machdep.c b/sys/arm/allwinner/aw_machdep.c index 2c34475656ee..0fd20a5083a2 100644 --- a/sys/arm/allwinner/aw_machdep.c +++ b/sys/arm/allwinner/aw_machdep.c @@ -61,7 +61,6 @@ static platform_attach_t a31_attach; static platform_attach_t a31s_attach; static platform_attach_t a83t_attach; static platform_attach_t h3_attach; -static platform_lastaddr_t allwinner_lastaddr; static platform_devmap_init_t allwinner_devmap_init; static platform_cpu_reset_t allwinner_cpu_reset; @@ -129,13 +128,6 @@ h3_attach(platform_t plat) return (0); } -static vm_offset_t -allwinner_lastaddr(platform_t plat) -{ - - return (devmap_lastaddr()); -} - /* * Set up static device mappings. * @@ -166,7 +158,6 @@ allwinner_cpu_reset(platform_t plat) #if defined(SOC_ALLWINNER_A10) static platform_method_t a10_methods[] = { PLATFORMMETHOD(platform_attach, a10_attach), - PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), @@ -178,7 +169,6 @@ FDT_PLATFORM_DEF(a10, "a10", 0, "allwinner,sun4i-a10", 200); #if defined(SOC_ALLWINNER_A13) static platform_method_t a13_methods[] = { PLATFORMMETHOD(platform_attach, a13_attach), - PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), @@ -190,7 +180,6 @@ FDT_PLATFORM_DEF(a13, "a13", 0, "allwinner,sun5i-a13", 200); #if defined(SOC_ALLWINNER_A20) static platform_method_t a20_methods[] = { PLATFORMMETHOD(platform_attach, a20_attach), - PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), @@ -206,7 +195,6 @@ FDT_PLATFORM_DEF(a20, "a20", 0, "allwinner,sun7i-a20", 200); #if defined(SOC_ALLWINNER_A31) static platform_method_t a31_methods[] = { PLATFORMMETHOD(platform_attach, a31_attach), - PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), @@ -222,7 +210,6 @@ FDT_PLATFORM_DEF(a31, "a31", 0, "allwinner,sun6i-a31", 200); #if defined(SOC_ALLWINNER_A31S) static platform_method_t a31s_methods[] = { PLATFORMMETHOD(platform_attach, a31s_attach), - PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), @@ -238,7 +225,6 @@ FDT_PLATFORM_DEF(a31s, "a31s", 0, "allwinner,sun6i-a31s", 200); #if defined(SOC_ALLWINNER_A83T) static platform_method_t a83t_methods[] = { PLATFORMMETHOD(platform_attach, a83t_attach), - PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), @@ -254,7 +240,6 @@ FDT_PLATFORM_DEF(a83t, "a83t", 0, "allwinner,sun8i-a83t", 200); #if defined(SOC_ALLWINNER_H3) static platform_method_t h3_methods[] = { PLATFORMMETHOD(platform_attach, h3_attach), - PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), diff --git a/sys/arm/arm/platform_if.m b/sys/arm/arm/platform_if.m index 5647b22867c9..1539e771c4e5 100644 --- a/sys/arm/arm/platform_if.m +++ b/sys/arm/arm/platform_if.m @@ -27,9 +27,10 @@ # #include +#include +#include #include #include -#include #include #include @@ -58,6 +59,11 @@ CODE { return; } + static vm_offset_t platform_default_lastaddr(platform_t plat) + { + return (devmap_lastaddr()); + } + static void platform_default_mp_setmaxid(platform_t plat) { mp_ncpus = 1; @@ -100,7 +106,7 @@ METHOD int devmap_init { */ METHOD vm_offset_t lastaddr { platform_t _plat; -}; +} DEFAULT platform_default_lastaddr; /** * @brief Called after the static device mappings are established and just diff --git a/sys/arm/broadcom/bcm2835/bcm2835_machdep.c b/sys/arm/broadcom/bcm2835/bcm2835_machdep.c index 5d0507998b3d..a29a1c148054 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_machdep.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_machdep.c @@ -68,17 +68,9 @@ static platform_devmap_init_t bcm2835_devmap_init; #ifdef SOC_BCM2836 static platform_devmap_init_t bcm2836_devmap_init; #endif -static platform_lastaddr_t bcm2835_lastaddr; static platform_late_init_t bcm2835_late_init; static platform_cpu_reset_t bcm2835_cpu_reset; -static vm_offset_t -bcm2835_lastaddr(platform_t plat) -{ - - return (devmap_lastaddr()); -} - static void bcm2835_late_init(platform_t plat) { @@ -136,7 +128,6 @@ bcm2835_cpu_reset(platform_t plat) #ifdef SOC_BCM2835 static platform_method_t bcm2835_methods[] = { PLATFORMMETHOD(platform_devmap_init, bcm2835_devmap_init), - PLATFORMMETHOD(platform_lastaddr, bcm2835_lastaddr), PLATFORMMETHOD(platform_late_init, bcm2835_late_init), PLATFORMMETHOD(platform_cpu_reset, bcm2835_cpu_reset), @@ -148,7 +139,6 @@ FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, "raspberrypi,model-b", 100); #ifdef SOC_BCM2836 static platform_method_t bcm2836_methods[] = { PLATFORMMETHOD(platform_devmap_init, bcm2836_devmap_init), - PLATFORMMETHOD(platform_lastaddr, bcm2835_lastaddr), PLATFORMMETHOD(platform_late_init, bcm2835_late_init), PLATFORMMETHOD(platform_cpu_reset, bcm2835_cpu_reset), diff --git a/sys/arm/freescale/imx/imx51_machdep.c b/sys/arm/freescale/imx/imx51_machdep.c index 3d208768b984..cbf6c9690eb7 100644 --- a/sys/arm/freescale/imx/imx51_machdep.c +++ b/sys/arm/freescale/imx/imx51_machdep.c @@ -47,16 +47,8 @@ __FBSDID("$FreeBSD$"); static platform_attach_t imx51_attach; static platform_devmap_init_t imx51_devmap_init; -static platform_lastaddr_t imx51_lastaddr; static platform_cpu_reset_t imx51_cpu_reset; -static vm_offset_t -imx51_lastaddr(platform_t plat) -{ - - return (devmap_lastaddr()); -} - static int imx51_attach(platform_t plat) { @@ -102,7 +94,6 @@ imx_soc_type(void) static platform_method_t imx51_methods[] = { PLATFORMMETHOD(platform_attach, imx51_attach), PLATFORMMETHOD(platform_devmap_init, imx51_devmap_init), - PLATFORMMETHOD(platform_lastaddr, imx51_lastaddr), PLATFORMMETHOD(platform_cpu_reset, imx51_cpu_reset), PLATFORMMETHOD_END, diff --git a/sys/arm/freescale/imx/imx53_machdep.c b/sys/arm/freescale/imx/imx53_machdep.c index 81a5486a1a19..3b4d9f1d845e 100644 --- a/sys/arm/freescale/imx/imx53_machdep.c +++ b/sys/arm/freescale/imx/imx53_machdep.c @@ -47,16 +47,8 @@ __FBSDID("$FreeBSD$"); static platform_attach_t imx53_attach; static platform_devmap_init_t imx53_devmap_init; -static platform_lastaddr_t imx53_lastaddr; static platform_cpu_reset_t imx53_cpu_reset; -static vm_offset_t -imx53_lastaddr(platform_t plat) -{ - - return (devmap_lastaddr()); -} - static int imx53_attach(platform_t plat) { @@ -102,7 +94,6 @@ imx_soc_type(void) static platform_method_t imx53_methods[] = { PLATFORMMETHOD(platform_attach, imx53_attach), PLATFORMMETHOD(platform_devmap_init, imx53_devmap_init), - PLATFORMMETHOD(platform_lastaddr, imx53_lastaddr), PLATFORMMETHOD(platform_cpu_reset, imx53_cpu_reset), PLATFORMMETHOD_END, diff --git a/sys/arm/freescale/imx/imx6_machdep.c b/sys/arm/freescale/imx/imx6_machdep.c index a2c5fd8d51e6..4e1d77b9432b 100644 --- a/sys/arm/freescale/imx/imx6_machdep.c +++ b/sys/arm/freescale/imx/imx6_machdep.c @@ -56,7 +56,6 @@ static uint32_t gpio1_node; static platform_attach_t imx6_attach; static platform_devmap_init_t imx6_devmap_init; -static platform_lastaddr_t imx6_lastaddr; static platform_late_init_t imx6_late_init; static platform_cpu_reset_t imx6_cpu_reset; @@ -164,13 +163,6 @@ fix_fdt_interrupt_data(void) OF_setprop(socnode, "interrupt-parent", &gicxref, sizeof(gicxref)); } -static vm_offset_t -imx6_lastaddr(platform_t plat) -{ - - return (devmap_lastaddr()); -} - static int imx6_attach(platform_t plat) { @@ -350,7 +342,6 @@ early_putc_t *early_putc = imx6_early_putc; static platform_method_t imx6_methods[] = { PLATFORMMETHOD(platform_attach, imx6_attach), - PLATFORMMETHOD(platform_lastaddr, imx6_lastaddr), PLATFORMMETHOD(platform_devmap_init, imx6_devmap_init), PLATFORMMETHOD(platform_late_init, imx6_late_init), PLATFORMMETHOD(platform_cpu_reset, imx6_cpu_reset), diff --git a/sys/arm/nvidia/tegra124/tegra124_machdep.c b/sys/arm/nvidia/tegra124/tegra124_machdep.c index 3ef47a16abba..55b411dd7914 100644 --- a/sys/arm/nvidia/tegra124/tegra124_machdep.c +++ b/sys/arm/nvidia/tegra124/tegra124_machdep.c @@ -66,13 +66,6 @@ static platform_devmap_init_t tegra124_devmap_init; static platform_late_init_t tegra124_late_init; static platform_cpu_reset_t tegra124_cpu_reset; -static vm_offset_t -tegra124_lastaddr(platform_t plat) -{ - - return (devmap_lastaddr()); -} - static int tegra124_attach(platform_t plat) { @@ -146,7 +139,6 @@ early_putc_t *early_putc = tegra124_early_putc; static platform_method_t tegra124_methods[] = { PLATFORMMETHOD(platform_attach, tegra124_attach), - PLATFORMMETHOD(platform_lastaddr, tegra124_lastaddr), PLATFORMMETHOD(platform_devmap_init, tegra124_devmap_init), PLATFORMMETHOD(platform_late_init, tegra124_late_init), PLATFORMMETHOD(platform_cpu_reset, tegra124_cpu_reset), diff --git a/sys/arm/qemu/virt_machdep.c b/sys/arm/qemu/virt_machdep.c index 08ea4602dd33..72ed0fae0e49 100644 --- a/sys/arm/qemu/virt_machdep.c +++ b/sys/arm/qemu/virt_machdep.c @@ -44,13 +44,6 @@ __FBSDID("$FreeBSD$"); #include "platform_if.h" -static vm_offset_t -virt_lastaddr(platform_t plat) -{ - - return (devmap_lastaddr()); -} - /* * Set up static device mappings. */ @@ -64,7 +57,6 @@ virt_devmap_init(platform_t plat) static platform_method_t virt_methods[] = { PLATFORMMETHOD(platform_devmap_init, virt_devmap_init), - PLATFORMMETHOD(platform_lastaddr, virt_lastaddr), #ifdef SMP PLATFORMMETHOD(platform_mp_start_ap, virt_mp_start_ap), @@ -86,7 +78,6 @@ gem5_devmap_init(platform_t plat) static platform_method_t gem5_methods[] = { PLATFORMMETHOD(platform_devmap_init, gem5_devmap_init), - PLATFORMMETHOD(platform_lastaddr, virt_lastaddr), PLATFORMMETHOD_END, }; diff --git a/sys/arm/rockchip/rk30xx_machdep.c b/sys/arm/rockchip/rk30xx_machdep.c index 92c98bb68139..f5f5c93ff329 100644 --- a/sys/arm/rockchip/rk30xx_machdep.c +++ b/sys/arm/rockchip/rk30xx_machdep.c @@ -52,18 +52,10 @@ __FBSDID("$FreeBSD$"); #include "platform_if.h" -static platform_lastaddr_t rk30xx_lastaddr; static platform_devmap_init_t rk30xx_devmap_init; static platform_late_init_t rk30xx_late_init; static platform_cpu_reset_t rk30xx_cpu_reset; -static vm_offset_t -rk30xx_lastaddr(platform_t plat) -{ - - return (devmap_lastaddr()); -} - static void rk30xx_late_init(platform_t plat) { @@ -97,7 +89,6 @@ rk30xx_cpu_reset(platform_t plat) #if defined(SOC_ROCKCHIP_RK3188) static platform_method_t rk30xx_methods[] = { - PLATFORMMETHOD(platform_lastaddr, rk30xx_lastaddr), PLATFORMMETHOD(platform_devmap_init, rk30xx_devmap_init), PLATFORMMETHOD(platform_late_init, rk30xx_late_init), PLATFORMMETHOD(platform_cpu_reset, rk30xx_cpu_reset), diff --git a/sys/arm/ti/ti_machdep.c b/sys/arm/ti/ti_machdep.c index 7963e225696e..eb10700b3cd2 100644 --- a/sys/arm/ti/ti_machdep.c +++ b/sys/arm/ti/ti_machdep.c @@ -66,7 +66,6 @@ static platform_devmap_init_t ti_omap4_devmap_init; static platform_attach_t ti_am335x_attach; static platform_devmap_init_t ti_am335x_devmap_init; #endif -static platform_lastaddr_t ti_lastaddr; static platform_cpu_reset_t ti_plat_cpu_reset; void (*ti_cpu_reset)(void) = NULL; @@ -91,13 +90,6 @@ ti_am335x_attach(platform_t plat) } #endif -static vm_offset_t -ti_lastaddr(platform_t plat) -{ - - return (devmap_lastaddr()); -} - /* * Construct static devmap entries to map out the most frequently used * peripherals using 1mb section mappings. @@ -141,7 +133,6 @@ ti_plat_cpu_reset(platform_t plat) static platform_method_t omap4_methods[] = { PLATFORMMETHOD(platform_attach, omap4_attach), PLATFORMMETHOD(platform_devmap_init, ti_omap4_devmap_init), - PLATFORMMETHOD(platform_lastaddr, ti_lastaddr), PLATFORMMETHOD(platform_cpu_reset, ti_plat_cpu_reset), #ifdef SMP @@ -157,7 +148,6 @@ FDT_PLATFORM_DEF(omap4, "omap4", 0, "ti,omap4430", 200); static platform_method_t am335x_methods[] = { PLATFORMMETHOD(platform_attach, ti_am335x_attach), PLATFORMMETHOD(platform_devmap_init, ti_am335x_devmap_init), - PLATFORMMETHOD(platform_lastaddr, ti_lastaddr), PLATFORMMETHOD(platform_cpu_reset, ti_plat_cpu_reset), PLATFORMMETHOD_END,