From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1D7D7C38142 for ; Fri, 27 Jan 2023 20:28:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 89441852A0; Fri, 27 Jan 2023 21:28:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pLy4EzOd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4FC8C855D2; Fri, 27 Jan 2023 21:28:18 +0100 (CET) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 05D86852A0 for ; Fri, 27 Jan 2023 21:28:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=clamor95@gmail.com Received: by mail-wm1-x32e.google.com with SMTP id c10-20020a05600c0a4a00b003db0636ff84so4307834wmq.0 for ; Fri, 27 Jan 2023 12:28:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=OglyvgESEUPrbQ3rCVJBwR9OF9UTXuD7rhJzOmLGmNo=; b=pLy4EzOd50Pjww5KmvBsCDy+dCiRPw5NLrD7KaO18NdNOJfwFk9b1oXFZgXqczeR16 R7Hodr0++uvhsYGI+XuNUU8wyihwCJcoMi6j7YwKPFV7rx5yEnu6BcZT+PMFwxz9e7nQ I+3sCGek8+URFS8rPuyvMisNeNO7McTxwCj3UyqzCiEmJV8d85lMw7MPtH4gFMNbyBJW HLb38LF7eHWBOvxnPqK0DtV46HlD5vYo+HPNePkstxJv5J8ZS5z3suNhUH7bbpXpzl6y 9n07KzYweAuCcJ2IbFzVga59B7kss1wxpvDotHWf4aQhPOXNMdeLxDr3+Sq4aOrBCSB4 D4Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OglyvgESEUPrbQ3rCVJBwR9OF9UTXuD7rhJzOmLGmNo=; b=ZPR/92ORDWF08ACgYRDZl5ogrf/XsZUwTaSFU/n1AuSJO/93ewxrRSCEiJZaJU7Psh lugIaxmtnltjuKn222ZN26qyfOt5C8y0iExjDHa803dVLBRW62SYxFpLbVpTfSgb4LWD vF6Y4TDpSM/9Hkb38bdaIj4LZNJpz5GS261iMxu4k4UhY/6b8B6nzrOamLzl4EWFxwvu wFGAOdeV+rukgluddN1PJvKhAIe1imG8PzaZFpH1D6Xbrax3YG+eyUUb8OjIwR+M/qNh l8+xI1QOfU0RwZDNw+/S0DNXRsagtmEFL7/eWGqGQcWlArYN3UBbGEjeE2C+K1FiGyV1 tYxA== X-Gm-Message-State: AFqh2kr18TSa8PrG1A27myuydAv0pyk0ndLnbVRNJwh7JVFPcC6+U3n9 R0yD3ie3f8sZ/MlHpsbOXoQ= X-Google-Smtp-Source: AMrXdXtCSlBXxRGCUaVt4pGrhcpWbUr5O6PyBwRVURIYwkrZMaNGiM/QYoFbvuXW+F+LC884eTu+Sw== X-Received: by 2002:a05:600c:3b1e:b0:3cf:497c:c4f5 with SMTP id m30-20020a05600c3b1e00b003cf497cc4f5mr42556881wms.13.1674851285313; Fri, 27 Jan 2023 12:28:05 -0800 (PST) Received: from [192.168.149.157] ([46.211.86.58]) by smtp.gmail.com with ESMTPSA id g11-20020a5d488b000000b002be5bdbe40csm5559530wrq.27.2023.01.27.12.28.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 27 Jan 2023 12:28:04 -0800 (PST) Message-ID: <84599727-8131-8643-5115-2896c45e2a69@gmail.com> Date: Fri, 27 Jan 2023 22:27:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux armv7l; rv:102.0) Gecko/20100101 Thunderbird/102.7.0 Subject: Re: [PATCH v7 0/3] Timer support for ARM Tegra To: Thierry Reding Cc: Rayagonda Kokatanur , Tom Warren , Marek Vasut , Maxim Schwalm , Dmitry Osipenko , =?UTF-8?Q?Jonas_Schw=c3=b6bel?= , Agneli , Heinrich Schuchardt , Michal Simek , Stefan Roese , Eugen Hristev , Michael Walle , Simon Glass , Jim Liu , William Zhang , Rick Chen , Stefan Herbrechtsmeier , Andre Przywara , Jaehoon Chung , u-boot@lists.denx.de References: <20230127071312.13844-1-clamor95@gmail.com> Content-Language: en-US From: "Svyatoslav R." In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 1/27/23 19:15, Thierry Reding wrote: > On Fri, Jan 27, 2023 at 09:13:09AM +0200, Svyatoslav Ryhel wrote: >> - ARM: tegra: remap clock_osc_freq for all Tegra family >> Enum clock_osc_freq was designed to use only with T20. >> This patch remaps it to use additional frequencies, added in >> T30+ SoC while maintaining backwards compatibility with T20. >> >> - drivers: timer: add timer driver for ARMv7 based Tegra devices >> Add timer support for T20/T30/T114/T124 and T210 based devices. >> Driver is based on DM, has device tree support and can be >> used on SPL and early boot stage. >> >> Arm64 Tegra (apart T210) according to comment in tegra-common.h use >> architected timer. >> >> - ARM: tegra: include timer as default option >> Enable TIMER as default option for all Tegra devices and >> enable TEGRA_TIMER for TEGRA_ARMV7_COMMON and TEGRA210. >> Additionally enable SPL_TIMER if build as SPL part and >> drop deprecated configs from common header. >> >> P. S. I have no arm64 Tegra and according to comment in >> tegra-common.h >> Use the Tegra US timer on ARMv7, but the architected timer on ARMv8. >> >> --- >> Changeog from V6 >> - use clk_m as timer calibration clock (this should properly fix T210) >> - enable timer for T210 >> >> Changed from v5: >> - added paz00 tester >> >> Changed from v4: >> - added comments >> >> Changed from v3: >> - removed BOOTSTAGE ifdefs >> - use early timer on boot stage unconditionally >> --- >> Svyatoslav Ryhel (3): >> ARM: tegra: remap clock_osc_freq for all Tegra family >> drivers: timer: add driver for ARMv7 based Tegra devices and T210 >> ARM: tegra: include timer as default option >> >> arch/arm/Kconfig | 1 + >> arch/arm/include/asm/arch-tegra/clock.h | 9 +- >> arch/arm/mach-tegra/Kconfig | 3 + >> arch/arm/mach-tegra/clock.c | 17 +++- >> arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- >> arch/arm/mach-tegra/tegra114/clock.c | 13 +-- >> arch/arm/mach-tegra/tegra124/clock.c | 13 +-- >> arch/arm/mach-tegra/tegra20/clock.c | 4 +- >> arch/arm/mach-tegra/tegra210/clock.c | 22 +--- >> arch/arm/mach-tegra/tegra30/clock.c | 10 +- >> drivers/timer/Kconfig | 8 ++ >> drivers/timer/Makefile | 1 + >> drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ >> drivers/usb/host/ehci-tegra.c | 46 +++++++-- >> include/configs/tegra-common.h | 6 -- >> 15 files changed, 274 insertions(+), 79 deletions(-) >> create mode 100644 drivers/timer/tegra-timer.c > Ugh... turns out I had completely messed up the testing on Tegra186 and > it wasn't working at all. The problem is that the selection of the TIMER > symbol for all of Tegra causes the driver model to be used, but there is > no DM driver for the architected timer that's used on Tegra186. > > The quickest fix would be to do this: > > --- >8 --- > diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig > index b50eec5b8c9b..05c8ce0e08dd 100644 > --- a/arch/arm/mach-tegra/Kconfig > +++ b/arch/arm/mach-tegra/Kconfig > @@ -56,7 +56,6 @@ config TEGRA_COMMON > select MISC > select OF_CONTROL > select SPI > - select TIMER > imply CMD_DM > imply CRC32_VERIFY > > @@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON > select TEGRA_PINCTRL > select TEGRA_PMC > select TEGRA_TIMER > + select TIMER > > config TEGRA_ARMV8_COMMON > bool "Tegra 64-bit common options" > @@ -137,6 +137,7 @@ config TEGRA210 > select TEGRA_PMC > select TEGRA_PMC_SECURE > select TEGRA_TIMER > + select TIMER > > config TEGRA186 > bool "Tegra186 family" > --- >8 --- > > So basically make TIMER selected on everything except Tegra186, so that > on Tegra186 things are basically unmodified. I can propose to include 'select TIMER' directly into TEGRA_TIMER config option. This will eliminate need of including it into mach-tegra Kconfigs. BTW, may you check current patch set on T124 and T210 if those work properly. My T30 devices work fine and same as before after switch to clk_m as timer calibration clock. Best Regards, Svyatoslav R. > Thierry