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 EE51FC25B08 for ; Wed, 17 Aug 2022 09:13:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CC5F68402E; Wed, 17 Aug 2022 11:13:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=walle.cc header.i=@walle.cc header.b="KuKL+uQ3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 98E3E826AD; Wed, 17 Aug 2022 11:13:11 +0200 (CEST) Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 617AE847F2 for ; Wed, 17 Aug 2022 11:13:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@walle.cc Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 7A5D02223E; Wed, 17 Aug 2022 11:13:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1660727587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lf3w+rdcfBNMYosj9vjC/f538KNK94RBoNCX+9y3mGQ=; b=KuKL+uQ3gju8ScvtICfBtOMf6q+DEfrIYs4A0W5xMpkhGJkwwVXb0lk6/z3j/fh9Bcz3dJ hkdatNk78v9NH+KgkevalFNYWsYd2hnqeDNeSDuvLCSsYj7RQRRwY72hYWlkn0yWHBpxMI Sv5ATOVV21K/PryVVWKO39kDG/idpE0= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 17 Aug 2022 11:13:07 +0200 From: Michael Walle To: =?UTF-8?Q?Pali_Roh=C3=A1r?= Cc: Stefan Roese , u-boot@lists.denx.de Subject: Re: [PATCH] arm: kirkwood: 88f6281: Detect CONFIG_SYS_TCLK from SAR register In-Reply-To: References: <20220816200016.18288-1-pali@kernel.org> <56f57c8a19d7d7f30fcbe442cecc4cc6@walle.cc> <20220816221420.2k5en3zvadaxsiqa@pali> <20220816223942.3acvgv5r7wfwhood@pali> <20220817083659.jlopv77svqmj25sg@pali> User-Agent: Roundcube Webmail/1.4.13 Message-ID: X-Sender: michael@walle.cc 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 Am 2022-08-17 10:43, schrieb Michael Walle: > 3) There is a chance that the timer code is actually pretty > straight-forward > and we don't need DM_CLK. > > FWIW I'm working on 3) at the moment. So if that works out, we can use > CONFIG_TIMER on kirkwood and then apply your initial patch. As there > are > no bugfix releases for u-boot anyway, we don't have to care for a > backport > fix. Ah damn, we cannot do this depending on wether CONFIG_TIMER is set or not. E.g. on a per-device basis. Or we do some ugly stuff as #ifdef CONFIG_TIMER #define CONFIG_SYS_TCLK ((readl(CONFIG_SAR_REG) & BIT(21)) ? \ 166666667 : 200000000) #else #define CONFIG_SYS_TCLK 200000000 #endif So it seems we are back to 1) or 2) :( -michael