Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/samsung Remove a build dependency on SOC_EXYNOS...
details: https://anonhg.NetBSD.org/src/rev/11fc90db12e6
branches: trunk
changeset: 993905:11fc90db12e6
user: skrll <skrll%NetBSD.org@localhost>
date: Mon Oct 08 08:16:59 2018 +0000
description:
Remove a build dependency on SOC_EXYNOS4 and SOC_EXYNOS5. Now runtime.
diffstat:
sys/arch/arm/samsung/exynos_platform.c | 28 +++++++++++++---
sys/arch/arm/samsung/exynos_soc.c | 57 +++++++++++++++++++--------------
sys/arch/arm/samsung/exynos_var.h | 4 +-
3 files changed, 56 insertions(+), 33 deletions(-)
diffs (175 lines):
diff -r 8e3aa755164e -r 11fc90db12e6 sys/arch/arm/samsung/exynos_platform.c
--- a/sys/arch/arm/samsung/exynos_platform.c Mon Oct 08 08:05:08 2018 +0000
+++ b/sys/arch/arm/samsung/exynos_platform.c Mon Oct 08 08:16:59 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_platform.c,v 1.17 2018/09/21 12:04:07 skrll Exp $ */
+/* $NetBSD: exynos_platform.c,v 1.18 2018/10/08 08:17:00 skrll Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -35,7 +35,7 @@
#include "ukbd.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.17 2018/09/21 12:04:07 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.18 2018/10/08 08:17:00 skrll Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -124,8 +124,6 @@
exynos_platform_bootstrap(void)
{
- exynos_bootstrap();
-
void (*mp_bootstrap)(void) = NULL;
const struct of_compat_data *cd = of_search_compatible(OF_finddevice("/"), mp_compat_data);
if (cd)
@@ -205,9 +203,18 @@
return devmap;
}
+static void
+exynos4_platform_bootstrap(void)
+{
+
+ exynos_bootstrap(4);
+
+ exynos_platform_bootstrap();
+}
+
static const struct arm_platform exynos4_platform = {
.ap_devmap = exynos4_platform_devmap,
- .ap_bootstrap = exynos_platform_bootstrap,
+ .ap_bootstrap = exynos4_platform_bootstrap,
.ap_init_attach_args = exynos_platform_init_attach_args,
.ap_early_putchar = exynos_platform_early_putchar,
.ap_device_register = exynos_platform_device_register,
@@ -240,9 +247,18 @@
return devmap;
}
+static void
+exynos5_platform_bootstrap(void)
+{
+
+ exynos_bootstrap(5);
+
+ exynos_platform_bootstrap();
+}
+
static const struct arm_platform exynos5_platform = {
.ap_devmap = exynos5_platform_devmap,
- .ap_bootstrap = exynos_platform_bootstrap,
+ .ap_bootstrap = exynos5_platform_bootstrap,
.ap_init_attach_args = exynos_platform_init_attach_args,
.ap_early_putchar = exynos_platform_early_putchar,
.ap_device_register = exynos_platform_device_register,
diff -r 8e3aa755164e -r 11fc90db12e6 sys/arch/arm/samsung/exynos_soc.c
--- a/sys/arch/arm/samsung/exynos_soc.c Mon Oct 08 08:05:08 2018 +0000
+++ b/sys/arch/arm/samsung/exynos_soc.c Mon Oct 08 08:16:59 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_soc.c,v 1.36 2018/09/14 11:58:38 skrll Exp $ */
+/* $NetBSD: exynos_soc.c,v 1.37 2018/10/08 08:16:59 skrll Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
#include "opt_exynos.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: exynos_soc.c,v 1.36 2018/09/14 11:58:38 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exynos_soc.c,v 1.37 2018/10/08 08:16:59 skrll Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -475,7 +475,7 @@
void
-exynos_bootstrap(void)
+exynos_bootstrap(int soc)
{
int error;
size_t core_size, audiocore_size;
@@ -487,33 +487,40 @@
bus_addr_t exynos_cmu_apll_offset;
const vaddr_t iobase = EXYNOS_CORE_VBASE;
+ switch (soc) {
#ifdef SOC_EXYNOS4
- core_size = EXYNOS4_CORE_SIZE;
- audiocore_size = EXYNOS4_AUDIOCORE_SIZE;
- audiocore_pbase = EXYNOS4_AUDIOCORE_PBASE;
- audiocore_vbase = EXYNOS4_AUDIOCORE_VBASE;
- exynos_wdt_offset = EXYNOS4_WDT_OFFSET;
- exynos_pmu_offset = EXYNOS4_PMU_OFFSET;
- exynos_sysreg_offset = EXYNOS4_SYSREG_OFFSET;
- exynos_cmu_apll_offset = EXYNOS4_CMU_APLL;
-
- cpu_freq_settings = cpu_freq_settings_exynos4;
- ncpu_freq_settings = __arraycount(cpu_freq_settings_exynos4);
-#endif
+ case 4:
+ core_size = EXYNOS4_CORE_SIZE;
+ audiocore_size = EXYNOS4_AUDIOCORE_SIZE;
+ audiocore_pbase = EXYNOS4_AUDIOCORE_PBASE;
+ audiocore_vbase = EXYNOS4_AUDIOCORE_VBASE;
+ exynos_wdt_offset = EXYNOS4_WDT_OFFSET;
+ exynos_pmu_offset = EXYNOS4_PMU_OFFSET;
+ exynos_sysreg_offset = EXYNOS4_SYSREG_OFFSET;
+ exynos_cmu_apll_offset = EXYNOS4_CMU_APLL;
+ cpu_freq_settings = cpu_freq_settings_exynos4;
+ ncpu_freq_settings = __arraycount(cpu_freq_settings_exynos4);
+ break;
+#endif
#ifdef SOC_EXYNOS5
- core_size = EXYNOS5_CORE_SIZE;
- audiocore_size = EXYNOS5_AUDIOCORE_SIZE;
- audiocore_pbase = EXYNOS5_AUDIOCORE_PBASE;
- audiocore_vbase = EXYNOS5_AUDIOCORE_VBASE;
- exynos_wdt_offset = EXYNOS5_WDT_OFFSET;
- exynos_pmu_offset = EXYNOS5_PMU_OFFSET;
- exynos_sysreg_offset = EXYNOS5_SYSREG_OFFSET;
- exynos_cmu_apll_offset = EXYNOS5_CMU_APLL;
+ case 5:
+ core_size = EXYNOS5_CORE_SIZE;
+ audiocore_size = EXYNOS5_AUDIOCORE_SIZE;
+ audiocore_pbase = EXYNOS5_AUDIOCORE_PBASE;
+ audiocore_vbase = EXYNOS5_AUDIOCORE_VBASE;
+ exynos_wdt_offset = EXYNOS5_WDT_OFFSET;
+ exynos_pmu_offset = EXYNOS5_PMU_OFFSET;
+ exynos_sysreg_offset = EXYNOS5_SYSREG_OFFSET;
+ exynos_cmu_apll_offset = EXYNOS5_CMU_APLL;
- cpu_freq_settings = cpu_freq_settings_exynos5;
- ncpu_freq_settings = __arraycount(cpu_freq_settings_exynos5);
+ cpu_freq_settings = cpu_freq_settings_exynos5;
+ ncpu_freq_settings = __arraycount(cpu_freq_settings_exynos5);
+ break;
#endif
+ default:
+ panic("%s: unknown soc version", __func__);
+ }
/* map in the exynos io registers */
error = bus_space_map(&armv7_generic_bs_tag, EXYNOS_CORE_PBASE,
diff -r 8e3aa755164e -r 11fc90db12e6 sys/arch/arm/samsung/exynos_var.h
--- a/sys/arch/arm/samsung/exynos_var.h Mon Oct 08 08:05:08 2018 +0000
+++ b/sys/arch/arm/samsung/exynos_var.h Mon Oct 08 08:16:59 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_var.h,v 1.26 2018/09/14 11:58:38 skrll Exp $ */
+/* $NetBSD: exynos_var.h,v 1.27 2018/10/08 08:17:00 skrll Exp $ */
/*-
* Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
@@ -143,7 +143,7 @@
extern bus_space_handle_t exynos_cmu_bsh;
extern bus_space_handle_t exynos_sysreg_bsh;
-extern void exynos_bootstrap(void);
+extern void exynos_bootstrap(int);
extern void exynos_dma_bootstrap(psize_t memsize);
struct exynos_pinctrl_softc;
Home |
Main Index |
Thread Index |
Old Index