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 3E9FCC25B0E for ; Tue, 16 Aug 2022 20:02:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 499C684926; Tue, 16 Aug 2022 22:02:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="LFVZpwPI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 77B628492C; Tue, 16 Aug 2022 22:02:10 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BA2E2848A5 for ; Tue, 16 Aug 2022 22:02:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4A93660AD7; Tue, 16 Aug 2022 20:02:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CC01C433D6; Tue, 16 Aug 2022 20:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660680125; bh=gLIGQV1kNMviQdpy1Oc4ikepd01WGx9xvEqDmZQeNNg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LFVZpwPIi1ISeRglNPVztT8weNIzdfsEsj6PyQWupcJEHs5i/xCFDB9KyfUWPxJHl nTvxh1/W90KPAWf07bOOUievPHAHh/TwdvP+7Fly7B12uGCZ/KSJFfeZJjWT0qXa0P 3M8WbaqHzEppv3eGJiKb66gmGQBSjdlQtTZUQrrtXP9PlKwwwVQwNM4HfH9ub9ZuRz Ze4l3MBTXwtyGkpNi3KD7+u17YtCqvQz251W3Ux+dCEYmOnJFaPKVvV1264OAyvAA6 A2wW4ea6tP5IHMLQV5q1ND4UIpLIiPNvOKbuAPva0dga5dkwgptX5g5Kegkn1Zke3q 8442nfX6qSZug== Received: by pali.im (Postfix) id A758D68B; Tue, 16 Aug 2022 22:02:02 +0200 (CEST) Date: Tue, 16 Aug 2022 22:02:02 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Michael Walle Cc: baruch@tkos.co.il, dgilmore@redhat.com, jon@solid-run.com, judge.packham@gmail.com, marek.behun@nic.cz, mario.six@gdsys.cc, sr@denx.de, u-boot@lists.denx.de Subject: Re: [PATCH 5/5] arm: kirkwood: Do not overwrite CONFIG_SYS_TCLK Message-ID: <20220816200202.nsagctguyggfjz3p@pali> References: <20210801102511.2qtqytqmvofs2vib@pali> <20220816093748.1753810-1-michael@walle.cc> <20220816181708.5t3rl5zxo5oqjder@pali> <20220816193851.t5gxdrpavkef62c5@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220816193851.t5gxdrpavkef62c5@pali> User-Agent: NeoMutt/20180716 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 Tuesday 16 August 2022 21:38:51 Pali Rohár wrote: > Meanwhile I have found following email thread: > https://lore.kernel.org/linux-arm-kernel/20121020113800.GC21046@lunn.ch/t/#u > > Where are more 6281 boards with 166 MHz TCLK and there is interesting output: > $ dmesg | grep -i tclk > [ 5.851008] Kirkwood: MV88F6281-A0, TCLK=200000000 > > Which means that old kernel version had TCLK detection code. I grepped > git linux history and I successfully found it: > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm/mach-kirkwood/common.c?h=v3.15#n542 > > #define SAMPLE_AT_RESET (DEV_BUS_VIRT_BASE + 0x0030) > > static int __init kirkwood_find_tclk(void) > { > u32 dev, rev; > > kirkwood_pcie_id(&dev, &rev); > > if (dev == MV88F6281_DEV_ID || dev == MV88F6282_DEV_ID) > if (((readl(SAMPLE_AT_RESET) >> 21) & 1) == 0) > return 200000000; > > return 166666667; > } > > So for TCLK detection is used BIT 21 of already mentioned 0x10030 Sample > at Reset Register. > > I'm going to prepare a patch which will fix this issue for 88F6281 SoCs. Done! Please test it! https://patchwork.ozlabs.org/project/uboot/patch/20220816200016.18288-1-pali@kernel.org/