Commit 3deb4953 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl/clock: make default gravity a per-arch setting


Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
parent d57b109e
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _EVL_ARM_ASM_CALIBRATION_H
#define _EVL_ARM_ASM_CALIBRATION_H
#include <linux/kconfig.h>
static inline unsigned int evl_get_default_clock_gravity(void)
{
/* Reasonable default for many armv7-based systems. */
return IS_ENABLED(CONFIG_SMP) ? 6000 : 3000;
}
#endif /* !_EVL_ARM_ASM_CALIBRATION_H */
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _EVL_ARM64_ASM_CALIBRATION_H
#define _EVL_ARM64_ASM_CALIBRATION_H
#include <linux/kconfig.h>
static inline unsigned int evl_get_default_clock_gravity(void)
{
return 3000;
}
#endif /* !_EVL_ARM64_ASM_CALIBRATION_H */
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _EVL_X86_ASM_CALIBRATION_H
#define _EVL_X86_ASM_CALIBRATION_H
#include <linux/kconfig.h>
static inline unsigned int evl_get_default_clock_gravity(void)
{
return 3000;
}
#endif /* !_EVL_X86_ASM_CALIBRATION_H */
......@@ -33,6 +33,7 @@
#include <evl/file.h>
#include <evl/irq.h>
#include <evl/uaccess.h>
#include <asm/evl/calibration.h>
#include <uapi/evl/factory.h>
#include <uapi/evl/clock.h>
#include <trace/events/evl.h>
......@@ -1029,11 +1030,12 @@ static int set_coreclk_gravity(struct evl_clock *clock,
static void get_default_gravity(struct evl_clock_gravity *p)
{
unsigned int ulat = 3000; /* ns, decent default. */
unsigned int ulat = CONFIG_EVL_LATENCY_USER; /* ns */
if (!ulat)
/* If not specified, pick a reasonable default. */
ulat = evl_get_default_clock_gravity();
#if CONFIG_EVL_LATENCY_USER != 0
ulat = CONFIG_EVL_LATENCY_USER;
#endif
p->user = ulat;
p->kernel = CONFIG_EVL_LATENCY_KERNEL;
p->irq = CONFIG_EVL_LATENCY_IRQ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment