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
This commit is contained in:
Andrew Turner 2016-12-16 10:31:13 +00:00
parent 5a8b662ea6
commit 6c925b9c81
10 changed files with 8 additions and 90 deletions

View File

@ -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),

View File

@ -27,9 +27,10 @@
#
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/devmap.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/systm.h>
#include <sys/smp.h>
#include <machine/machdep.h>
@ -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

View File

@ -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),

View File

@ -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,

View File

@ -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,

View File

@ -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),

View File

@ -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),

View File

@ -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,
};

View File

@ -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),

View File

@ -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,