From patchwork Thu Jul 23 15:26:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 11681233 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1CB73138A for ; Thu, 23 Jul 2020 15:30:49 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E77B220714 for ; Thu, 23 Jul 2020 15:30:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3RoZCmEX"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="OOg1f43G" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E77B220714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8Mr7iwRpfT4Di/dJF+cjIQfEt+J7SWk1MhG/7gyyUuo=; b=3RoZCmEXW6QlI/LAtDBubUobY IewKr4DTUmEFB0SAAFdfbSYyq5av+8ncqtDOCGRe34pVBMJwSbd0tp8LGurpcEJoOEgw+SkklGW4V lKvE3mTAN4ps96Gyd+qspGcJP5gCzHGTeIS2OARfa/3SrcrT7OuKtm9rHt5XVCZ9FI6Y+m6LGSNeM zza2AWSiEoE6nJanfL5pE6caaPimbfDI617f1v1pgP/UfVXKw/0PY7A2PbbNmLfQmNg+3t/m6AptS RnUhHI0Z0/fMzPwCVbJSzglDIlD4YNXIDVUJFlLKPLuLQh6aMYDy3pHFA3pC19mgRVtZMV/3nMwJh blg7LSAfg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyd9U-0008Hw-R4; Thu, 23 Jul 2020 15:28:56 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyd7h-0007Y4-Cb for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2020 15:27:09 +0000 Received: by mail-wm1-x341.google.com with SMTP id c80so5345753wme.0 for ; Thu, 23 Jul 2020 08:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gT16S+wE9QP+Lpme4e1jgxInlD0M0uUa46Dg/gZiw4M=; b=OOg1f43G0/Boq4zjOO1Z381OJt14MPElkJJ6ldbqBbuoTC9fhJZGA3yDnmM95/n/7O pDdAajclwTkT1pQIg42a9a1qY5XBCIdofu2d0gGgNEfWv1Wdivb/YuXCY21uinty3DiC P1+yAP36cUUz+fQFtnR/jhbxIHAKWbNAHKXK/YsxVQgCHPNtIzD/gidu6IIKbmvi6j+i YCRGBtrS9vVSkrxhOpvzpN5THXNqYDZpMjeydx9SVHGlyuk/KNMMjhZ9GWu8F4LwfuMH yZrM6chFuRBiJJg3ceGRVvI8fVaOWDx2UsZw7Bq8yomd+bJHtgz3vKwAZcQ65d9ZAGgO dbwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gT16S+wE9QP+Lpme4e1jgxInlD0M0uUa46Dg/gZiw4M=; b=RfMrXxsqahI+9Mwa3w5BPnkwKNtGIhsqYw2d4atot6YOwhMwAVfChcjraZV+P9FoML CCwKbEk79d/iFVv5KUOjdxHJaGj86Mqt9qESFQZpxb5OpY5dyKRzroWwqi6mjwUJmDGX 5ROIcy04NrpJMXb+9YKeLZKTs2PhOvTy5kReQgXCUOJxiY5wd3Ar8P8TFjRPJzY+Qvtj 91QuJOdDZxlwXUHqCT9D6Ujn7ukvSkrfWqO0A3PnpBMic7Xdy64VBhBvuM0ZYGmeCmw+ kzc9+vnGqa+AVv+8Y3iLzEYeneD90prPnSOG69ryR+qya26saIoq8bFAtUyjuS4Aq30m qKyQ== X-Gm-Message-State: AOAM53015/O+wbaf5dBDI6c33DZm3pXb0OvGTQHsWmk6zVWzM3UEa9+f EfovAXP94oTp8I118ELbFU4LOA== X-Google-Smtp-Source: ABdhPJwY+1bzVpcKIe9+Fd1bx4mT//TJdWy4E/CueiOaDYHUQBR9iRc4PNZhj2N3QFJvjfFN+ZJvTA== X-Received: by 2002:a1c:28a:: with SMTP id 132mr4521810wmc.109.1595518024251; Thu, 23 Jul 2020 08:27:04 -0700 (PDT) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:dca7:8d30:33fa:daac]) by smtp.gmail.com with ESMTPSA id g145sm5963491wmg.23.2020.07.23.08.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 08:27:03 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Subject: [PATCH 09/16] clocksource/drivers/timer-atmel-tcb: Add sama5d2 support Date: Thu, 23 Jul 2020 17:26:29 +0200 Message-Id: <20200723152639.639771-9-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200723152639.639771-1-daniel.lezcano@linaro.org> References: <1b1122f4-bce9-f349-e602-ed8e14cbb501@linaro.org> <20200723152639.639771-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200723_112705_494319_E367C45C X-CRM114-Status: GOOD ( 14.56 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:341 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Ludovic Desroches , "moderated list:ARM/Microchip AT91 SoC support" , "open list:CLOCKSOURCE, CLOCKEVENT DRIVERS" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Alexandre Belloni The first divisor for the sama5d2 is actually the gclk selector. Because the currently remaining divisors are fitting the use case, currently ensure it is skipped. Signed-off-by: Alexandre Belloni Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200710230813.1005150-10-alexandre.belloni@bootlin.com --- drivers/clocksource/timer-atmel-tcb.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/timer-atmel-tcb.c b/drivers/clocksource/timer-atmel-tcb.c index 7fea134650fc..787dbebbb432 100644 --- a/drivers/clocksource/timer-atmel-tcb.c +++ b/drivers/clocksource/timer-atmel-tcb.c @@ -359,9 +359,15 @@ static struct atmel_tcb_config tcb_sam9x5_config = { .counter_width = 32, }; +static struct atmel_tcb_config tcb_sama5d2_config = { + .counter_width = 32, + .has_gclk = 1, +}; + static const struct of_device_id atmel_tcb_of_match[] = { { .compatible = "atmel,at91rm9200-tcb", .data = &tcb_rm9200_config, }, { .compatible = "atmel,at91sam9x5-tcb", .data = &tcb_sam9x5_config, }, + { .compatible = "atmel,sama5d2-tcb", .data = &tcb_sama5d2_config, }, { /* sentinel */ } }; @@ -426,7 +432,10 @@ static int __init tcb_clksrc_init(struct device_node *node) /* How fast will we be counting? Pick something over 5 MHz. */ rate = (u32) clk_get_rate(t0_clk); - for (i = 0; i < ARRAY_SIZE(atmel_tcb_divisors); i++) { + i = 0; + if (tc.tcb_config->has_gclk) + i = 1; + for (; i < ARRAY_SIZE(atmel_tcb_divisors); i++) { unsigned divisor = atmel_tcb_divisors[i]; unsigned tmp;