linux/drivers/virtio/virtio_rtc_arm.c
Peter Hilber e2ef16757b virtio_rtc: Add Arm Generic Timer cross-timestamping
For platforms using the Arm Generic Timer, add precise cross-timestamping
support to virtio_rtc.

Always report the CP15 virtual counter as the HW counter in use by
arm_arch_timer, since the Linux kernel's usage of the Arm Generic Timer
should always be compatible with this.

Signed-off-by: Peter Hilber <quic_philber@quicinc.com>
Message-Id: <20250509160734.1772-4-quic_philber@quicinc.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2025-05-27 10:27:54 -04:00

24 lines
518 B
C

// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Provides cross-timestamp params for Arm.
*
* Copyright (C) 2022-2023 OpenSynergy GmbH
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/clocksource_ids.h>
#include <uapi/linux/virtio_rtc.h>
#include "virtio_rtc_internal.h"
/* see header for doc */
int viortc_hw_xtstamp_params(u8 *hw_counter, enum clocksource_ids *cs_id)
{
*hw_counter = VIRTIO_RTC_COUNTER_ARM_VCT;
*cs_id = CSID_ARM_ARCH_COUNTER;
return 0;
}