svn commit: r331907 - in stable/11/sys/arm: include ti ti/am335x
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Tue Apr 3 06:06:40 UTC 2018
Author: gonzo
Date: Tue Apr 3 06:06:39 2018
New Revision: 331907
URL: https://svnweb.freebsd.org/changeset/base/331907
Log:
MFC r307943-r307944, r308698
r307943 by andrew:
Remove the need for the delay to be zero when MULTIDELAY is undefined,
it may be useful to only enable this in some configs.
Sponsored by: ABT Systems Ltd
r307944 by andrew:
Add MULTIDELAY support to the am335x dmtimer. This will be useful for
testing Cortex-A8 support in GENERIC.
Sponsored by: ABT Systems Ltd
r308698 by loos:
After r308533, the platform compatible string must be an exact match.
Use "ti,am33xx" instead of "ti,am335x", which gives an exact match in every
DTS we support.
This fixes the boot on TI SoCs after r308533.
Suggested by: gonzo
Sponsored by: Rubicon Communications, LLC (Netgate)
Modified:
stable/11/sys/arm/include/platformvar.h
stable/11/sys/arm/ti/am335x/am335x_dmtimer.c
stable/11/sys/arm/ti/ti_machdep.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/arm/include/platformvar.h
==============================================================================
--- stable/11/sys/arm/include/platformvar.h Tue Apr 3 04:31:54 2018 (r331906)
+++ stable/11/sys/arm/include/platformvar.h Tue Apr 3 06:06:39 2018 (r331907)
@@ -97,7 +97,7 @@ extern platform_method_t fdt_platform_methods[];
#ifdef MULTIDELAY
#define FDT_PLATFORM_CTASSERT(delay) CTASSERT(delay > 0)
#else
-#define FDT_PLATFORM_CTASSERT(delay) CTASSERT(delay == 0)
+#define FDT_PLATFORM_CTASSERT(delay)
#endif
#define PLATFORM_DATA(NAME, delay) \
Modified: stable/11/sys/arm/ti/am335x/am335x_dmtimer.c
==============================================================================
--- stable/11/sys/arm/ti/am335x/am335x_dmtimer.c Tue Apr 3 04:31:54 2018 (r331906)
+++ stable/11/sys/arm/ti/am335x/am335x_dmtimer.c Tue Apr 3 06:06:39 2018 (r331907)
@@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$");
#include <sys/timetc.h>
#include <machine/bus.h>
+#ifdef MULTIDELAY
+#include <machine/machdep.h> /* For arm_set_delay */
+#endif
+
#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
@@ -67,6 +71,8 @@ struct am335x_dmtimer_softc {
static struct am335x_dmtimer_softc *am335x_dmtimer_et_sc = NULL;
static struct am335x_dmtimer_softc *am335x_dmtimer_tc_sc = NULL;
+static void am335x_dmtimer_delay(int, void *);
+
/*
* We use dmtimer2 for eventtimer and dmtimer3 for timecounter.
*/
@@ -235,6 +241,10 @@ am335x_dmtimer_tc_init(struct am335x_dmtimer_softc *sc
am335x_dmtimer_tc_sc = sc;
tc_init(&sc->func.tc);
+#ifdef MULTIDELAY
+ arm_set_delay(am335x_dmtimer_delay, sc);
+#endif
+
return (0);
}
@@ -328,23 +338,13 @@ static devclass_t am335x_dmtimer_devclass;
DRIVER_MODULE(am335x_dmtimer, simplebus, am335x_dmtimer_driver, am335x_dmtimer_devclass, 0, 0);
MODULE_DEPEND(am335x_dmtimer, am335x_prcm, 1, 1, 1);
-void
-DELAY(int usec)
+static void
+am335x_dmtimer_delay(int usec, void *arg)
{
- struct am335x_dmtimer_softc *sc;
+ struct am335x_dmtimer_softc *sc = arg;
int32_t counts;
uint32_t first, last;
- sc = am335x_dmtimer_tc_sc;
-
- if (sc == NULL) {
- for (; usec > 0; usec--)
- for (counts = 200; counts > 0; counts--)
- /* Prevent gcc from optimizing out the loop */
- cpufunc_nullop();
- return;
- }
-
/* Get the number of times to count */
counts = (usec + 1) * (sc->sysclk_freq / 1000000);
@@ -361,3 +361,19 @@ DELAY(int usec)
}
}
+#ifndef MULTIDELAY
+void
+DELAY(int usec)
+{
+ int32_t counts;
+
+ if (am335x_dmtimer_tc_sc == NULL) {
+ for (; usec > 0; usec--)
+ for (counts = 200; counts > 0; counts--)
+ /* Prevent gcc from optimizing out the loop */
+ cpufunc_nullop();
+ return;
+ } else
+ am335x_dmtimer_delay(usec, am335x_dmtimer_tc_sc);
+}
+#endif
Modified: stable/11/sys/arm/ti/ti_machdep.c
==============================================================================
--- stable/11/sys/arm/ti/ti_machdep.c Tue Apr 3 04:31:54 2018 (r331906)
+++ stable/11/sys/arm/ti/ti_machdep.c Tue Apr 3 06:06:39 2018 (r331907)
@@ -124,5 +124,5 @@ static platform_method_t am335x_methods[] = {
PLATFORMMETHOD_END,
};
-FDT_PLATFORM_DEF(am335x, "am335x", 0, "ti,am335x", 0);
+FDT_PLATFORM_DEF(am335x, "am335x", 0, "ti,am33xx", 200);
#endif
More information about the svn-src-stable
mailing list