From fa7a1ca7aea1d66bdf8fd4e5c731d6d164305b07 Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Sat, 22 Aug 2015 03:29:12 +0000 Subject: [PATCH] Make the mpc85xx platform a kobj base class. Summary: Some systems are based around mpc85xx, but need special initialization. By making the mpc85xx platform a base class, these systems can be platform subclasses, and perform board-specific initialization in addition to the mpc85xx initialization. Test Plan: Tested on my RB800. A platform class was created, and will be committed separately. Reviewed By: nwhitehorn Differential Revision: https://reviews.freebsd.org/D3305 --- sys/powerpc/mpc85xx/mpc85xx.h | 5 +++++ sys/powerpc/mpc85xx/platform_mpc85xx.c | 9 ++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/powerpc/mpc85xx/mpc85xx.h b/sys/powerpc/mpc85xx/mpc85xx.h index c3cbf55512ca..66e7ace98642 100644 --- a/sys/powerpc/mpc85xx/mpc85xx.h +++ b/sys/powerpc/mpc85xx/mpc85xx.h @@ -30,6 +30,8 @@ #ifndef _MPC85XX_H_ #define _MPC85XX_H_ +#include + /* * Configuration control and status registers */ @@ -84,4 +86,7 @@ int law_disable(int trgt, u_long addr, u_long size); int law_getmax(void); int law_pci_target(struct resource *, int *, int *); +DECLARE_CLASS(mpc85xx_platform); +int mpc85xx_attach(platform_t); + #endif /* _MPC85XX_H_ */ diff --git a/sys/powerpc/mpc85xx/platform_mpc85xx.c b/sys/powerpc/mpc85xx/platform_mpc85xx.c index a7724cf05b75..eb9577f1128c 100644 --- a/sys/powerpc/mpc85xx/platform_mpc85xx.c +++ b/sys/powerpc/mpc85xx/platform_mpc85xx.c @@ -71,7 +71,6 @@ vm_offset_t ccsrbar_va; static int cpu, maxcpu; static int mpc85xx_probe(platform_t); -static int mpc85xx_attach(platform_t); static void mpc85xx_mem_regions(platform_t, struct mem_region *phys, int *physsz, struct mem_region *avail, int *availsz); static u_long mpc85xx_timebase_freq(platform_t, struct cpuref *cpuref); @@ -98,11 +97,7 @@ static platform_method_t mpc85xx_methods[] = { PLATFORMMETHOD_END }; -static platform_def_t mpc85xx_platform = { - "mpc85xx", - mpc85xx_methods, - 0 -}; +DEFINE_CLASS_0(mpc85xx, mpc85xx_platform, mpc85xx_methods, 0); PLATFORM_DEF(mpc85xx_platform); @@ -117,7 +112,7 @@ mpc85xx_probe(platform_t plat) return (ENXIO); } -static int +int mpc85xx_attach(platform_t plat) { phandle_t cpus, child, ccsr;