Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jul 2017 12:17:49 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320642 - in head/sys/arm: conf versatile
Message-ID:  <201707041217.v64CHnA2092178@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Tue Jul  4 12:17:49 2017
New Revision: 320642
URL: https://svnweb.freebsd.org/changeset/base/320642

Log:
  Teach VERSATILEPB about PLATFORM. This will help move it into the GENERIC
  kernel configuration.

Modified:
  head/sys/arm/conf/VERSATILEPB
  head/sys/arm/versatile/versatile_machdep.c

Modified: head/sys/arm/conf/VERSATILEPB
==============================================================================
--- head/sys/arm/conf/VERSATILEPB	Tue Jul  4 10:54:08 2017	(r320641)
+++ head/sys/arm/conf/VERSATILEPB	Tue Jul  4 12:17:49 2017	(r320642)
@@ -69,6 +69,7 @@ device		md
 device		random			# Entropy device
 
 options 	INTRNG
+options 	PLATFORM
 
 # Flattened Device Tree
 options 	FDT			# Configure using FDT/DTB data

Modified: head/sys/arm/versatile/versatile_machdep.c
==============================================================================
--- head/sys/arm/versatile/versatile_machdep.c	Tue Jul  4 10:54:08 2017	(r320641)
+++ head/sys/arm/versatile/versatile_machdep.c	Tue Jul  4 12:17:49 2017	(r320642)
@@ -49,34 +49,21 @@ __FBSDID("$FreeBSD$");
 
 #include <machine/bus.h>
 #include <machine/machdep.h>
-#include <machine/platform.h> 
+#include <machine/platform.h>
+#include <machine/platformvar.h>
 
+#include "platform_if.h"
+
 /* Start of address space used for bootstrap map */
 #define DEVMAP_BOOTSTRAP_MAP_START	0xE0000000
 
-vm_offset_t
-platform_lastaddr(void)
+static vm_offset_t
+versatile_lastaddr(platform_t plat)
 {
 
 	return (DEVMAP_BOOTSTRAP_MAP_START);
 }
 
-void
-platform_probe_and_attach(void)
-{
-
-}
-
-void
-platform_gpio_init(void)
-{
-}
-
-void
-platform_late_init(void)
-{
-}
-
 #define FDT_DEVMAP_MAX	(2)		/* FIXME */
 static struct devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = {
 	{ 0, 0, 0, },
@@ -87,8 +74,8 @@ static struct devmap_entry fdt_devmap[FDT_DEVMAP_MAX] 
 /*
  * Construct devmap table with DT-derived config data.
  */
-int
-platform_devmap_init(void)
+static int
+versatile_devmap_init(platform_t plat)
 {
 	int i = 0;
 	fdt_devmap[i].pd_va = 0xf0100000;
@@ -99,10 +86,18 @@ platform_devmap_init(void)
 	return (0);
 }
 
-void
-cpu_reset(void)
+static void
+versatile_cpu_reset(platform_t plat)
 {
 	printf("cpu_reset\n");
 	while (1);
 }
 
+static platform_method_t versatile_methods[] = {
+	PLATFORMMETHOD(platform_lastaddr,	versatile_lastaddr),
+	PLATFORMMETHOD(platform_devmap_init,	versatile_devmap_init),
+	PLATFORMMETHOD(platform_cpu_reset,	versatile_cpu_reset),
+
+	PLATFORMMETHOD_END,
+};
+FDT_PLATFORM_DEF(versatile, "versatile", 0, "arm,versatile-pb", 1);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707041217.v64CHnA2092178>