Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4495614rdb; Tue, 12 Dec 2023 00:36:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGz4vPVsw+UFI2hkorrnCDPJKtIG+Jtet/suUN/iXAtAfl07JSUToRs8lzNEc1IWc/3I1DM X-Received: by 2002:a17:903:247:b0:1d0:6b95:9bfe with SMTP id j7-20020a170903024700b001d06b959bfemr3444061plh.1.1702370177033; Tue, 12 Dec 2023 00:36:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702370177; cv=pass; d=google.com; s=arc-20160816; b=ZlP9TmQaqUk3wG9Iq8l2NTV9WXIJjR+N9smORj6MCXEJ1l4jb/FknGAQR1W4KrSqGu SLlbbuB8R5Z9vRtclPwK3nIkdIVEUHqCvqGr1fbsu9dtsps3jWgJ4EcURYfzc1Wutmja qb8ycFROC2+15ATGtF9nTL5NwMV8CT4Kgzny51E/jSTABr4Su8hi7cx/swQrl11TZW1q AEIqQsIPPFsEkdFN0MjTz2zH+GvQj1HKfSj7DnbVHYulEPZJjb9kSU8XALA10laZTUko iRN6YQ4q30SYBhhkCIwjVWudf3njStAvCs1wfYBLxCvZUJeaZpywraKyQutFIgmjCj06 KHMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=C1uyOxX90WGmYq6yRBwUvozwLWqXaBIci+It6jRXfvM=; fh=PbZO3GeobdNBBoW6IvXwCXxlQPSKVB7neucscWcAId0=; b=TasyRTz9aewdIVbVSD2Qe6sCh7hMbnI3Z4cbiFLZaShAtUgpQBhJ/zhYdV8RxYw4qQ 6zSUgCNKc9IAdZEh9VLAygMFkKOPife+MhH05hpi44uL74Wyyv0szS1EQO4icqaTKtwA wFsNi0xBX5a5kflHFzDr2+ZaliDbNluobXoq9TPSWYR8lA4Yw3Pj33HELhBHheP/Khbz WANasF5q4Nje5uxwUoQk1e58PC8ODMWqeNYCvTr/1IYr7urykvlvkjg+U8DVnOgoGPce J3w2P3wgiP8JUnAGCN7WX94uuasNJNO7l3b1m5bBNZLao41LCBD03niiKVDVjsmfC91L gSPw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mysnt.onmicrosoft.com header.s=selector2-mysnt-onmicrosoft-com header.b=gGkLtjxH; arc=pass (i=1 spf=pass spfdomain=kontron.de dkim=pass dkdomain=kontron.de dmarc=pass fromdomain=kontron.de); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id z9-20020a170902834900b001cf68d533fasi7258797pln.633.2023.12.12.00.36.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 00:36:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@mysnt.onmicrosoft.com header.s=selector2-mysnt-onmicrosoft-com header.b=gGkLtjxH; arc=pass (i=1 spf=pass spfdomain=kontron.de dkim=pass dkdomain=kontron.de dmarc=pass fromdomain=kontron.de); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id AE97780A5B4F; Tue, 12 Dec 2023 00:36:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234965AbjLLIfx (ORCPT + 99 others); Tue, 12 Dec 2023 03:35:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231205AbjLLIfj (ORCPT ); Tue, 12 Dec 2023 03:35:39 -0500 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2092.outbound.protection.outlook.com [40.107.6.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F0591724 for ; Tue, 12 Dec 2023 00:25:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L8Z/Yiv9ub12VN6Uu4a6UctbsL5kZqppjvExLLcBGJugrmCkNBSlJAH9jhKyLIgwuDWMm0iKfXacNyOI9UB0PRHBXGS2frL+Xp7EpHOt5M4fm4nes2phChlAdA+Yy8cy7a8NaeixnCqpybTELfdNFZ5eMxrpZwZP2ahhYKQsCiDVWl2caqnvzGxtunhkF3KZAczJ/qVb+JDrqQ8OnAhTluZzYZBJQKAIIzeNCodc9og24PAG54kL1228oAhBJC/WRTfzYJFNG6NjYOioJ8T+pvgFuv/7H+g7uKgAhBUp9763iqUdpxrXVFSRPGxEF9OTnT5+yk+mTz6OoKkHlPidmA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=C1uyOxX90WGmYq6yRBwUvozwLWqXaBIci+It6jRXfvM=; b=KhRQ0csHIcz61x4kVijnn53ntI/Vi14cDe3Xc9iiNPn8rEsWTABPKY/hDZVendb0eKSVtUbR0bDyx1JoTvbI07pD5rHMbINgfWsu9uA1+SKL2XZXGFid9JDCGw+iPcyclscNdM/liYUSWBsfVQIJzmcPo7OOGc9zgYFnvfG2tAUo9ujLmoMUKAQVdj7dojiCWsvqBIOil3SYg1npFzpEf1a8+o/WooNJR8JtWGKiQJF5piykwgC3OwSa40qak1Flagbhw+V3vN178+dz8dxtzGdwYtDONRV6XpQYbQT3KIo0BlA+dvrbrWHT4ur0umTKX74gEOi9mQSCI2RYseFRxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kontron.de; dmarc=pass action=none header.from=kontron.de; dkim=pass header.d=kontron.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mysnt.onmicrosoft.com; s=selector2-mysnt-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C1uyOxX90WGmYq6yRBwUvozwLWqXaBIci+It6jRXfvM=; b=gGkLtjxH9mlddDVEBh7JrIc3+ATLz1/Wq7ZvhDlz1PmE1wYWeuFz+HezwGG54YOWJMILLupyffq3CQXmx/KBFJ/QMC6lOm6g5ZrCl3+fl09eC9LyGGMmG997xrqIKa926cGdkmFJ+geql9Xjbdu7D6QfOYUNXzDydjydjWQxFBM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kontron.de; Received: from PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:263::10) by AS2PR10MB7763.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:64a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Tue, 12 Dec 2023 08:25:17 +0000 Received: from PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM ([fe80::27ba:9922:8d12:7b3d]) by PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM ([fe80::27ba:9922:8d12:7b3d%5]) with mapi id 15.20.7068.033; Tue, 12 Dec 2023 08:25:17 +0000 Message-ID: <6bdf9e39-e938-4644-b0ce-37191e1c00d2@kontron.de> Date: Tue, 12 Dec 2023 09:25:12 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] drm/bridge: samsung-dsim: Set P divider based on min/max of fin pll Content-Language: en-US, de-DE To: Adam Ford , dri-devel@lists.freedesktop.org Cc: Maxime Ripard , Neil Armstrong , Robert Foss , Thomas Zimmermann , Jonas Karlman , Laurent Pinchart , aford@beaconembedded.com, Jernej Skrabec , Marco Felsch , Michael Tretter , Jagan Teki , Andrzej Hajda , linux-kernel@vger.kernel.org, Marek Szyprowski References: <20231212033259.189718-1-aford173@gmail.com> From: Frieder Schrempf In-Reply-To: <20231212033259.189718-1-aford173@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0127.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:97::8) To PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:263::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR10MB5681:EE_|AS2PR10MB7763:EE_ X-MS-Office365-Filtering-Correlation-Id: ae2ed0ac-2f76-4250-3f3a-08dbfaebdef7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bBNAWjbkjgSdOB07pz3m1yRp7KLeZ1ojAVfDfbgSMnptLLisWTobOoykrbI2DdGjUtkWhPJoB5YiWjV2XG3BTs/2Fv9fKrMh5SD3bNX2uzE4D11Ergms4duKyZ0+5FEcm2qQPY9xW9Hsw4eMpa5i3/hmjN46A56MhLT+00BVWgT3pLo2t2l7UWXyPfu+RGGfIVIXMxAReUW/MHt9LzTFNGtWZZl+rEU5+Imv9gMqpEjWjlU3ZdNXvsbY7UAtSI/e9kDJ7zhqWHPpHvmER2W4SWdV+U64laIWCvdMo2hTbyqVnjYg7iYHz7RlBUngMxTAI8pKyGPUxkzkkmBIUSFgFa3j3AtymT3yjTg/DVGismfJvwNRCCUQV7B/M1/eVipGgctmQ7Bwd/X8dSiPLZo4McJEh+AeKRkv5OhTMOyYs7OfAnJhyr/uEhkJMo5CRkyeyS4DsKAJrKIxxe4FUGLpJF41r27z/V/K3jGNirNKJ0hNerfVK306Sn1Lf1DeOU+ULzPhNliVqorTMqBpzcTnN7qSFmrgjPOZjvoBFXPKFt8zD2hb8Jan4ilxtSJP8jiYUJzNgXclrHNMPgOqSNUxQYaL/kQA6b4b8DC5ERED/jMDqQZeZ6hfr/vOmqI1FFW8xn+ZLrQd3av6XiCRh7wsgQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(376002)(39860400002)(396003)(136003)(366004)(346002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(7416002)(2906002)(41300700001)(38100700002)(31696002)(36756003)(86362001)(2616005)(83380400001)(478600001)(6486002)(53546011)(6506007)(6666004)(6512007)(4326008)(5660300002)(44832011)(316002)(8936002)(66556008)(66476007)(54906003)(66946007)(8676002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bXd2VVdYTVVZWG95RVZ6REJ1UjhkUWxjUW5nTjlKa0FrMC9BTC9MVUdQampU?= =?utf-8?B?WXlmRTliSGhRbkpjUVpEb0R1aW5TSURNbXZiUS9Jb3UweGpYay8vS2lhSWRa?= =?utf-8?B?VE1NQjRRTk5TRGRINVJoMHNBeTJtYnFVT3FSM3FFUGZmbStGMzhqMFJVQlJp?= =?utf-8?B?UjJxdlZ5NlI2cWZ5bzlaaEY5YklmaXhwcTkwQWRCSGl1ZTJvOVBuRDl4YlV1?= =?utf-8?B?TFNrZGg1V25XOG1NRHhBY0E0ZGZkRGNPbGgzcmUyMjcwVS9NTWdvM3AyNlVP?= =?utf-8?B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zV2cGNKVFd1dlZRUFl1SlM1OVlBOFJ5ZXZLdUYz?= =?utf-8?B?VG1uVUVUR2VWcFJza1MzTjc3Zm10UnJweXdTMEdoMmFEWmxNWkNXUEVpaVRW?= =?utf-8?Q?x7QovrlsmJ7VzypY1IgJrkOg1zR4I0lxP/9JcOGhM48M?= X-OriginatorOrg: kontron.de X-MS-Exchange-CrossTenant-Network-Message-Id: ae2ed0ac-2f76-4250-3f3a-08dbfaebdef7 X-MS-Exchange-CrossTenant-AuthSource: PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2023 08:25:16.9330 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8c9d3c97-3fd9-41c8-a2b1-646f3942daf1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PWQ23BwlmW+e0hZfOKb6YMNR2T1KWh+fpZiQNwtRSNbd1j4mKIUcu1aJDMpiMdbp0qeO5KfYHD1fpqPtVKd+ratAQdz5ASfPJbIsq1GjP/Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR10MB7763 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 12 Dec 2023 00:36:14 -0800 (PST) Hi Adam, On 12.12.23 04:32, Adam Ford wrote: > The P divider should be set based on the min and max values of > the fin pll which may vary between different platforms. > These ranges are defined per platform, but hard-coded values > were used instead which resulted in a smaller range available > on the i.MX8M[MNP] than what was possible. > > Fixes: 846307185f0f ("drm/bridge: samsung-dsim: update PLL reference clock") > Signed-off-by: Adam Ford > > diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c > index be5914caa17d..239d253a7d71 100644 > --- a/drivers/gpu/drm/bridge/samsung-dsim.c > +++ b/drivers/gpu/drm/bridge/samsung-dsim.c > @@ -573,8 +573,8 @@ static unsigned long samsung_dsim_pll_find_pms(struct samsung_dsim *dsi, > u16 _m, best_m; > u8 _s, best_s; > > - p_min = DIV_ROUND_UP(fin, (12 * MHZ)); > - p_max = fin / (6 * MHZ); > + p_min = DIV_ROUND_UP(fin, (driver_data->pll_fin_max * MHZ)); > + p_max = fin / (driver_data->pll_fin_min * MHZ); I did some tinkering with the PLL settings the other day and this is literally one of the things I came up with. So I'm happy to provide: Reviewed-by: Frieder Schrempf Tested-by: Frieder Schrempf Regarding the P divider, I'm also wondering if there is an upper limit for the p-value (not for the resulting fin_pll) that we should take into account, too. The problem is that we have conflicts in the documentation (again) so we don't really know what the correct limit would be. There are the following ranges given in the RMs: * 1..63 (i.MX8MM RM 13.7.8.18.4) * 1..33 (i.MX8MM RM 13.7.10.1) * 1..63 (i.MX8MP RM 13.2.3.1.5.2) * 1..63 (i.MX8MP RM 13.7.2.4) Unfortunately there are similar discrepancies for the other parameters and limits. Thanks Frieder > > for (_p = p_min; _p <= p_max; ++_p) { > for (_s = 0; _s <= 5; ++_s) {