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 X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD0F1C433E1 for ; Mon, 20 Jul 2020 10:36:15 +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 98BAF22482 for ; Mon, 20 Jul 2020 10:36:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DtYSwkL8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="MXfcuqbY"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="TftN0qAK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98BAF22482 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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:Content-ID:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NQhp/Yali8tVpeck9JOrElRh3fAatdsSQovi+yAVy+4=; b=DtYSwkL8CtacoG+doK+s0RgXT 3lOiJc8/w/T3N+r0RTFBMDrJsGoAP+E/ALJ9bQ40iJWH0n+8ceE0iAM8nqoo5qH70ATd1+299XetK jgxrVteVf8Inr7e5T7fO40v2S7dblbS5pVy9vdbwEpEdlAB949Gd0tPt++9/wCAD/H8zOd4TpVIsA npaJi5ROAPxR1oQNWfF1cR7pFXK+XxtPpbibWIl0u/YlDffNSzxpS5LvAXv0oZY99lPWwbDGGWbf7 PgkpBF9j4Mz2Fy8vmoy7qu+k1NsBzMBsBn07sjdNI5zaR71IAFcrjzQr4b3R+Vmc0SrrWpFXHBIJQ kjQ11diMQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxT7r-00020D-OG; Mon, 20 Jul 2020 10:34:27 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxT7o-0001zB-N3 for linux-arm-kernel@lists.infradead.org; Mon, 20 Jul 2020 10:34:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595241264; x=1626777264; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=Kx5Osh/juLvKzsOz48waSWEqnOkFWndZeUDr2b1b/wk=; b=MXfcuqbY2Vm3OJm7N++jcq5e+rGiTNWJD3xkJr7/QTF/iajyD9jY+wNa LZokT4x6irQ+deoxARVBKR3GDGDFuvhvq2lEw/gc0nncmFYoP3Ay3H1ch 3JWlw8Js52DHg5MBGeXbJQ4esZiAuIfaw/SpA2/z+inKdxXt1m5wayEzR yqYEFMq6AkF4zzwniiMamL2FZfX9GliYvytuMIzkcvB7jSbncaoOOwrpE +D0e9HP9Qe9H4H/ziMaxzX6jzq/GUyeduXlxUB5urXVtXpCNzJ967mWEp UcxocOhHQcve/FgieoxIByVKq2O5NLlcWWJD11qMWlRYXkUrWpYKJDa68 w==; IronPort-SDR: 1STA3FXydpc08F+CXiiRJEF/JGW5Uz4u/vcjdq6/3/qcvZtxZJsDWsoVhnuvowbPkLhORgQWEC PQwqhheiXQ3T+95hM4/WK7J+64su4mjush6tYThhinfUlmCCNSfVOHqP1I2c5+Se039q/oYcIV s/jBkeMistLfYMGW3PRGH1fKodocAp+IaICC+e6XlfoQ12NOmLY9a2iHYlbWAioiBi0e3qk/a0 XmLJ+JidPFc+ppULc35QcyCJIzt0Qz5ynHpn7FrFWyWh00ckjZSAq+fngQMC9m0qCOcsN1ijSn 2Ds= X-IronPort-AV: E=Sophos;i="5.75,374,1589266800"; d="scan'208";a="82493679" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Jul 2020 03:34:20 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 20 Jul 2020 03:33:41 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3 via Frontend Transport; Mon, 20 Jul 2020 03:34:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QgvIPLlh4QSh/7+dhPQsJg2QKMEgwqy8Tcp6k5uvWsauvJGKwDrHVpwsMG7eLbXbBqs4/VAjr1jga/GerewIK3gH29gBo2PIy0/5nAcnahb3hmpddkb+Rt+07ybNJxGhnG8xFyL5xVrggeOiujALnkxltaA/QHMuCT817oRZ92haacGvnsf+rQyD/6c56VQ2sGkMXIzVpQPcYJ64ey9m7SnWf3xhdTUMNWm6i8bQyzv7fy1AcZ4mIcQv0+ta9u6W/p1dRUazPB6lrmdRL5mGxmdIjJHTwuXtot3FCmPBlr+oCk1gOTkFqq1ULp1tZ7vwXGQCeK2FK8FPgFdDHHGa/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kx5Osh/juLvKzsOz48waSWEqnOkFWndZeUDr2b1b/wk=; b=DlJSg8lSQ7V2hEFqnOCtpZ2gzqUrVFQitH/UFWWgKUNjKX90qsdSCqla/Nd0qqn/qsI4qqscjeIwEjFGoNTvtZzJykx2abGQ8szVCbY3Fw1WWIRTSzkc3HfPKCSWHGZEuXuDIf8kU6mVtrTWZTnkWilaaHjkCDO5IkhqYbc8i68SpdJa7z4KgPwgLPTFrSMKAD4bnwyjYfs+hr7yjezfQYW2jTxXpGr+kHL2zsoLTnxfNpxpXjRHSyYB/w0B5AruaA7oG+DYnbksHGhAc9Cxb1P1p2p7SlyHKqKXrpHb7uIYYESZoffrt9lXMLTfJfO+M+tiALXYX1oQe5cmQjHmXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kx5Osh/juLvKzsOz48waSWEqnOkFWndZeUDr2b1b/wk=; b=TftN0qAKBYO+oddMHibPE02uxwjjPgWbL6CCG7718itMWHaBtO5nQjJUhXKnV/qw+P/M34uIAyJmC4mhgzeEXyI9LMcx8/5UMOQ2HGgffk5e2xFof1g/KOheZ1xdzb0xnEHE5XvvJ/CRb2xXujIV/JiU3RZJ/JDgemw6LwUBGKw= Received: from DM6PR11MB3420.namprd11.prod.outlook.com (2603:10b6:5:69::31) by DM5PR1101MB2105.namprd11.prod.outlook.com (2603:10b6:4:51::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.25; Mon, 20 Jul 2020 10:34:18 +0000 Received: from DM6PR11MB3420.namprd11.prod.outlook.com ([fe80::e8b2:1d82:49d9:f4b]) by DM6PR11MB3420.namprd11.prod.outlook.com ([fe80::e8b2:1d82:49d9:f4b%6]) with mapi id 15.20.3195.025; Mon, 20 Jul 2020 10:34:18 +0000 From: To: Subject: Re: [PATCH 07/19] clk: at91: sam9x60-pll: use frac when setting frequency Thread-Topic: [PATCH 07/19] clk: at91: sam9x60-pll: use frac when setting frequency Thread-Index: AQHWXoFSXlCh1mtaPk2N/8h+NLHL3A== Date: Mon, 20 Jul 2020 10:34:18 +0000 Message-ID: <46ffd816-fff5-81af-f85d-61dcf7447029@microchip.com> References: <1594812267-6697-1-git-send-email-claudiu.beznea@microchip.com> <1594812267-6697-8-git-send-email-claudiu.beznea@microchip.com> <20200717091238.GL3428@piout.net> In-Reply-To: <20200717091238.GL3428@piout.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 authentication-results: bootlin.com; dkim=none (message not signed) header.d=none;bootlin.com; dmarc=none action=none header.from=microchip.com; x-originating-ip: [82.76.227.81] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3b1839d9-90eb-4f26-2cc3-08d82c987550 x-ms-traffictypediagnostic: DM5PR1101MB2105: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-bypassexternaltag: True x-ms-oob-tlc-oobclassifiers: OLM:1443; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GuUaqyRylV6YruAhx6MHf2WlqlnHNv6GtiNoxFSq71sD+0smwl/abRJl3MMrd1Pm0aI4lq/kPN/ZePaJRYLPLMzW8JS/JweEg2SWhjnNbwG6bOgF/L/+olCsJRa1osvIwbn7QrXynctIkcL7N3E4ngjoLmhEbtwJMkKmouw0JPJQFFj36Q6tM3TCNGnEFuedXKKnXPGFCQm2kF2JXdp2MckifTn1lkrfuVGv/MO26Ii01s7S6cmv9uSzuE/D4MisBqKRAyqFFyySgnb7HzH0WJB2sYwGANIwHg1JW4Qf2SLgkf3rJg6iRw7FN4mHXWv8KXwNtwszeBFHLy5dcuqD0kpx5J6J/tnlsaHdLnKkzN4+4u9de4WMK4AU3y+m25TnYbx2bOS/aSOKqGca/38QZ7zPbnUcTw5OfEB80/efrChrkfhZ9zUiki3lPSfv4C4oguFMoADio6CmQrx73AKZ6A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3420.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(39860400002)(346002)(376002)(136003)(396003)(66946007)(76116006)(91956017)(2616005)(66556008)(66476007)(53546011)(6506007)(64756008)(8676002)(86362001)(66446008)(6916009)(5660300002)(83380400001)(6512007)(2906002)(36756003)(26005)(316002)(8936002)(31686004)(71200400001)(31696002)(478600001)(4326008)(6486002)(186003)(966005)(54906003)(43740500002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: nLhAaN9rf5ZBzSEGfbJPLGDl4CV4TupFZmwoa/LKc6+W3iB08e6cPKF8a+ZgZp0sG6rMqc3MYq1dA0ibPHKcoBzhPhColQp/VIuRzPenv5+UgZxSoRyCkk3EN42v2FAYvFbHiZVMVoz4miEV2e7TwGjwMtX5QP9a0YJ/oIENBA6Y5yH6U/d3wkChA9biSWSKqyyOPh3cg8jlutJRQsg12pqliHGx3zRzm5TmIYMqr1HLmNpvIXhgnYBfvwfssAhn1oW1FSQ2243WLsYDMc4Z8iNy+nMXM8p0Fbl/aJhTzk40DwD0TIg4qTNl3eNtXbVoptHYOjbJAHwYA6mD5zX24TWTT7zCiV/0JUNgaxMIZqlNGT7c8vSt6hALLPJEucbL7sS9rxBo1hk6YJzqzITvV03zndhuhbh401JOhoa8JAPPnNYtvQjGSoMziR3uoQO97ogI8XTAObfVdkkpyzvdy8Ku8NGCTgehs5YHeBQkkHg= Content-ID: <8987D5865C93F64887A4D4353EFEBDE7@namprd11.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3420.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b1839d9-90eb-4f26-2cc3-08d82c987550 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2020 10:34:18.6775 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +R+RQfTGZ2hXwQSKeWvXgw+ysH2k4Il1SqQZM02c3ZkpUgfEyUoqgvqXynh66USjEgfZmh2YFDkhlLzYJRABAPCpA/uROmg8XtrkJM/zRLY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2105 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200720_063425_054668_D9ED5ADF X-CRM114-Status: GOOD ( 19.13 ) 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: bbrezillon@kernel.org, sboyd@kernel.org, mturquette@baylibre.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 17.07.2020 12:12, Alexandre Belloni wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > On 15/07/2020 14:24:15+0300, Claudiu Beznea wrote: >> In commit a436c2a447e59 ("clk: at91: add sam9x60 PLL driver") >> the fractional part of PLL wasn't set on registers but it was >> calculated and taken into account for determining div and mul >> (see sam9x60_pll_get_best_div_mul()). >> > > I think this becomes an issue only once 4/19 is applied so you should > probably squash those two together. I kept it separate as I was thinking about the scenario where the bootloaders set up the frequency using also fractional part. But at the same time I was thinking about squashing them together. Now that there is also someone thinking about having them together (you) I will squash them. Thank you, Claudiu Beznea > >> Fixes: a436c2a447e59 ("clk: at91: add sam9x60 PLL driver") >> Signed-off-by: Claudiu Beznea >> --- >> drivers/clk/at91/clk-sam9x60-pll.c | 9 ++++++--- >> 1 file changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/clk/at91/clk-sam9x60-pll.c b/drivers/clk/at91/clk-sam9x60-pll.c >> index 00f2afd6e9b6..13e15bd48770 100644 >> --- a/drivers/clk/at91/clk-sam9x60-pll.c >> +++ b/drivers/clk/at91/clk-sam9x60-pll.c >> @@ -16,6 +16,7 @@ >> >> #define PMC_PLL_CTRL0_DIV_MSK GENMASK(7, 0) >> #define PMC_PLL_CTRL1_MUL_MSK GENMASK(31, 24) >> +#define PMC_PLL_CTRL1_FRACR_MSK GENMASK(21, 0) >> >> #define PLL_DIV_MAX (FIELD_GET(PMC_PLL_CTRL0_DIV_MSK, UINT_MAX) + 1) >> #define UPLL_DIV 2 >> @@ -55,7 +56,7 @@ static int sam9x60_pll_prepare(struct clk_hw *hw) >> unsigned long flags; >> u8 div; >> u16 mul; >> - u32 val; >> + u32 val, frac; >> >> spin_lock_irqsave(pll->lock, flags); >> regmap_write(regmap, AT91_PMC_PLL_UPDT, pll->id); >> @@ -65,9 +66,10 @@ static int sam9x60_pll_prepare(struct clk_hw *hw) >> >> regmap_read(regmap, AT91_PMC_PLL_CTRL1, &val); >> mul = FIELD_GET(PMC_PLL_CTRL1_MUL_MSK, val); >> + frac = FIELD_GET(PMC_PLL_CTRL1_FRACR_MSK, val); >> >> if (sam9x60_pll_ready(regmap, pll->id) && >> - (div == pll->div && mul == pll->mul)) { >> + (div == pll->div && mul == pll->mul && frac == pll->frac)) { >> spin_unlock_irqrestore(pll->lock, flags); >> return 0; >> } >> @@ -80,7 +82,8 @@ static int sam9x60_pll_prepare(struct clk_hw *hw) >> regmap_write(regmap, AT91_PMC_PLL_ACR, val); >> >> regmap_write(regmap, AT91_PMC_PLL_CTRL1, >> - FIELD_PREP(PMC_PLL_CTRL1_MUL_MSK, pll->mul)); >> + FIELD_PREP(PMC_PLL_CTRL1_MUL_MSK, pll->mul) | >> + FIELD_PREP(PMC_PLL_CTRL1_FRACR_MSK, pll->frac)); >> >> if (pll->characteristics->upll) { >> /* Enable the UTMI internal bandgap */ >> -- >> 2.7.4 >> > > -- > Alexandre Belloni, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel