Skip to content

Add support for Qualcomm TSCSS hardware#656

Open
imrashai wants to merge 4 commits into
qualcomm-linux:qcom-6.18.yfrom
imrashai:lemans-tsc-support
Open

Add support for Qualcomm TSCSS hardware#656
imrashai wants to merge 4 commits into
qualcomm-linux:qcom-6.18.yfrom
imrashai:lemans-tsc-support

Conversation

@imrashai
Copy link
Copy Markdown

@imrashai imrashai commented Jun 4, 2026

This series adds support for the Qualcomm TSCSS hardware on Lemans platform.

CRs-Fixed: 4560651

@imrashai imrashai requested review from a team, quic-tingweiz, rrnayak and trsoni June 4, 2026 17:49
@imrashai
Copy link
Copy Markdown
Author

imrashai commented Jun 5, 2026

Comment thread arch/arm64/configs/defconfig Outdated
CONFIG_MSM_MMCC_8996=m
CONFIG_MSM_GCC_8998=y
CONFIG_MSM_MMCC_8998=m
CONFIG_PTP_QCOM_CLOCK_TSC=y
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move it to arch/arm64/configs/qcom.config and shouldn't it be "=m" ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/ptp/qcom,ptp-tsc.yaml#
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your file name is Documentation/devicetree/bindings/ptp/qcom,tsc.yaml

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, fixed it now.

type: boolean

qcom,etu-slice:
$ref: /schemas/types.yaml#/definitions/uint8-array
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check API used for reading in driver.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it to use u32.

considered as the slice number for ETU offset calculation.

qcom,etu-event-sel:
$ref: /schemas/types.yaml#/definitions/uint8-array
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

- compatible
- reg
- clocks
- clock-names
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't interrupt-names also be required.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added interrupts also to the required list.

writel_relaxed(regval, timer->baseaddr + TSCSS_TSC_DRIFT_CORRECT_DURATION);

/* Update the INCR VAL */
writel_relaxed(incval, timer->baseaddr + TSCSS_TSC_DRIFT_CORRECT_INCR_VAL);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may end up using uninitialized incval .

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initialized now.

Comment thread drivers/ptp/ptp_qcom_tsc.c Outdated

do {
regval = readl_relaxed(timer->baseaddr + TSCSS_TSC_DRIFT_CORRECT_CMD);
} while (regval & BIT(1));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this busy loop doesn't look right. please use readl_poll_timeout.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if (timer->ptp_clock) {
ptp_clock_unregister(timer->ptp_clock);
timer->ptp_clock = NULL;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about clk prepare calls that were made during probe ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled clk disables now.

Comment thread drivers/ptp/ptp_qcom_tsc.c Outdated

static irqreturn_t qcom_etu_irq_handler(int irq, void *data)
{
struct qcom_etu_slice *etu = (struct qcom_etu_slice *)data;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you not passing timer * in handler regiration ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped this logic, as it not applicable here.

tsc@1c80000 {
compatible = "qcom,tsc";
reg = <0x0 0x01c80000 0x0 0x2000>,
<0x0 0x01c90000 0x0 0x10000>;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reg-names ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated now.

imrashai added 4 commits June 5, 2026 23:51
Qualcomm TSCSS is a time synchronization subsystem composed of two main
blocks: the Time Stamp Counter (TSC) and the Event Timestamp Unit (ETU).
The TSC block is a timestamp generator that maintains a running counter
used for system timekeeping. The ETU block captures timestamps for external
events using one of the available timestamp sources.

Signed-off-by: Imran Shaik <imran.shaik@oss.qualcomm.com>
Add support for the Qualcomm TSCSS hardware, that is a time synchronization
subsystem composed of two main blocks: the Time Stamp Counter (TSC) and the
Event Timestamp Unit (ETU).

Signed-off-by: Imran Shaik <imran.shaik@oss.qualcomm.com>
Add support to enable the Time Stamp Counter (TSC) and the Event Timestamp
Unit (ETU) driver on Lemans EVK platform.

Signed-off-by: Imran Shaik <imran.shaik@oss.qualcomm.com>
Add support to enable the TSC node on Lemans platform.

Signed-off-by: Imran Shaik <imran.shaik@oss.qualcomm.com>
@imrashai imrashai force-pushed the lemans-tsc-support branch from bbc9a56 to 6f2e58c Compare June 5, 2026 19:16
@qswat-orbit-external
Copy link
Copy Markdown

Merge Check Failed: CR Not Eligible for Merge

CR 4560651 is not eligible for merge.

The parent software image for kernel.qli.2.0 is not development complete.

Entity: kernel.qli.2.0
CR: 4560651
Reason: CR_CANNOT_MERGE

Please ensure the CR passes both CCT (ComponentChangeTasks) and ICT (Integration Change Tasks) validations.

@qcomlnxci qcomlnxci requested a review from a team June 5, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants