Page MenuHomeFreeBSD

D8769.id22864.diff
No OneTemporary

D8769.id22864.diff

Index: sys/arm/conf/RK3188
===================================================================
--- sys/arm/conf/RK3188
+++ sys/arm/conf/RK3188
@@ -25,6 +25,9 @@
options SCHED_ULE # ULE scheduler
options SMP # Enable multiple cores
+options PLATFORM
+options PLATFORM_SMP
+options MULTIDELAY
# Root mount from MMC/SD card
options ROOTDEVNAME=\"ufs:/dev/mmcsd0\"
Index: sys/arm/rockchip/rk30xx_machdep.c
===================================================================
--- sys/arm/rockchip/rk30xx_machdep.c
+++ sys/arm/rockchip/rk30xx_machdep.c
@@ -42,35 +42,27 @@
#include <vm/vm.h>
#include <vm/pmap.h>
-#include <machine/armreg.h>
#include <machine/bus.h>
#include <machine/machdep.h>
-#include <machine/platform.h>
+#include <machine/platform.h>
+#include <machine/platformvar.h>
#include <arm/rockchip/rk30xx_wdog.h>
+#include <arm/rockchip/rk30xx_mp.h>
-vm_offset_t
-platform_lastaddr(void)
+#include "platform_if.h"
+
+static vm_offset_t
+rk30xx_lastaddr(platform_t plat)
{
return (devmap_lastaddr());
}
-void
-platform_probe_and_attach(void)
+static void
+rk30xx_late_init(platform_t plat)
{
-}
-
-void
-platform_gpio_init(void)
-{
-}
-
-void
-platform_late_init(void)
-{
-
/* Enable cache */
cpufunc_control(CPU_CONTROL_DC_ENABLE|CPU_CONTROL_IC_ENABLE,
CPU_CONTROL_DC_ENABLE|CPU_CONTROL_IC_ENABLE);
@@ -79,8 +71,8 @@
/*
* Set up static device mappings.
*/
-int
-platform_devmap_init(void)
+static int
+rk30xx_devmap_init(platform_t plat)
{
devmap_add_entry(0x10000000, 0x00200000);
@@ -89,8 +81,8 @@
return (0);
}
-void
-cpu_reset()
+static void
+rk30xx_cpu_reset()
{
rk30_wd_watchdog_reset();
@@ -97,3 +89,14 @@
printf("Reset failed!\n");
while (1);
}
+
+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),
+ PLATFORMMETHOD(platform_mp_start_ap, rk30xx_mp_start_ap),
+ PLATFORMMETHOD(platform_mp_setmaxid, rk30xx_mp_setmaxid),
+ PLATFORMMETHOD_END,
+};
+FDT_PLATFORM_DEF(rk30xx, "RK3188", 0, "rockchip,rk3188", 200);
Index: sys/arm/rockchip/rk30xx_mp.h
===================================================================
--- sys/arm/rockchip/rk30xx_mp.h
+++ sys/arm/rockchip/rk30xx_mp.h
@@ -0,0 +1,38 @@
+/*-
+ * Copyright (C) 2016 Ganbold Tsagaankhuu <ganbold@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _RK30XX_MP_H_
+#define _RK30XX_MP_H_
+
+void rk30xx_mp_setmaxid(platform_t plat);
+void rk30xx_mp_start_ap(platform_t plat);
+
+#endif /* _RK30XX_MP_H_ */
Index: sys/arm/rockchip/rk30xx_mp.c
===================================================================
--- sys/arm/rockchip/rk30xx_mp.c
+++ sys/arm/rockchip/rk30xx_mp.c
@@ -37,10 +37,14 @@
#include <vm/pmap.h>
#include <machine/cpu.h>
+#include <machine/cpu-v6.h>
#include <machine/smp.h>
#include <machine/fdt.h>
#include <machine/intr.h>
+#include <machine/platformvar.h>
+#include <arm/rockchip/rk30xx_mp.h>
+
#define SCU_PHYSBASE 0x1013c000
#define SCU_SIZE 0x100
@@ -80,7 +84,7 @@
}
void
-platform_mp_setmaxid(void)
+rk30xx_mp_setmaxid(platform_t plat)
{
bus_space_handle_t scu;
int ncpu;
@@ -101,7 +105,7 @@
}
void
-platform_mp_start_ap(void)
+rk30xx_mp_start_ap(platform_t plat)
{
bus_space_handle_t scu;
bus_space_handle_t imem;

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 6, 11:20 AM (16 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30963740
Default Alt Text
D8769.id22864.diff (4 KB)

Event Timeline