From patchwork Tue Jan 18 17:31:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 533668 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99214C433F5 for ; Tue, 18 Jan 2022 17:19:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243610AbiARRTN (ORCPT ); Tue, 18 Jan 2022 12:19:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232859AbiARRTM (ORCPT ); Tue, 18 Jan 2022 12:19:12 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 693C7C061574 for ; Tue, 18 Jan 2022 09:19:12 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id q141-20020a1ca793000000b00347b48dfb53so9385306wme.0 for ; Tue, 18 Jan 2022 09:19:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=vGvnbxeNRIB3S31pWuMCSmiB84n9/DgEiMQTAdokJ2A=; b=yI/yw5virPuhFslSzUfs/a2QGuoL29nxuPsNYii8327f2x32lmsA5vlSaVyCoNExke 61ZLyCwl+/wrM2nYMR4RJKA2LyRA8Cjt7CUq81c1gG+aF+V9bXEJWUJdfo8IzmtTFVys uY5FpPwMxMAtpiX5iOYofYXYsmW7bd8SkbSuujqWc/RWc3SnlVfofTy5iKaHjjtrp4W7 CYfpiAWfjnIruC2GMYjgoVTaWVKytidX40gOE0Bii4AZXlJ+nzaA+rW+r+hSJkjW5hj9 phz4ePZqchHunwrvujbaJtALtrPQXnXdfpxMsJhMKkm10JtS2p7z35DsESVVR4EEMbng QSyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vGvnbxeNRIB3S31pWuMCSmiB84n9/DgEiMQTAdokJ2A=; b=P8dwFw202f4z7tEZfaEeg/GAgQw8hDVDCXquKBoNnx9OQWRFQ0/hFlGdTJl9Y/+pYJ gW2Gafb9LlelW5ZPR5QI/F++D7LavggntQKBqZthawvP8FnymuvMvQl3+Czvk7rQLVmW KWCPYKcGRmCoHEVi0iNWW9dhAz7Q7Zys1BE4B324Yzt4YSlTq6acrST8T7CW4op5Zad3 KbNl4ULHwg6SXJyJ7KKqlX9md7S2V228DvlyFayv63M0T2iAGGQo/2UfTTMLX8ZngctB owsU4EU1I68MyNbgF2/z47cPcGZQBXjlWd97Zqy9+qMVhkKgEMhWz4Ts+wUm5+NOr2ud Pbkw== X-Gm-Message-State: AOAM533h8MIjx3LqAbPJVnu+I9wyQPJdC1D8AfEZYKSCPGBk/TEM5YbX +KTg+LBMjyx8T2Sk/DFhAfhtyA== X-Google-Smtp-Source: ABdhPJyDeP+FmCIq4KYZZeMOloMM6jTaZiE8LQnSZClu80cQJgrMhkBX9qbjMdKGYwPegnLC12xb3g== X-Received: by 2002:a05:600c:4991:: with SMTP id h17mr26018779wmp.14.1642526350895; Tue, 18 Jan 2022 09:19:10 -0800 (PST) Received: from localhost.localdomain ([88.160.176.23]) by smtp.gmail.com with ESMTPSA id r7sm1081239wma.39.2022.01.18.09.19.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jan 2022 09:19:10 -0800 (PST) From: Loic Poulain To: robdclark@gmail.com, sean@poorly.run Cc: linux-arm-msm@vger.kernel.org, dmitry.baryshkov@linaro.org, Loic Poulain Subject: [PATCH 1/2] drm/msm/dsi: Add support for flexible DSI block mapping Date: Tue, 18 Jan 2022 18:31:27 +0100 Message-Id: <1642527088-13088-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The QCM2290 SoC integrates same DSI hardware as SC7180 but mapped at a different address, 0x5e94000 vs 0xae94000. To support such case, this change introduces an optional io_mask value that can be used to match multiple mapped addresses. It's probably not the more elegant solution, and could be revisited if necessary. Signed-off-by: Loic Poulain --- drivers/gpu/drm/msm/dsi/dsi_cfg.h | 2 +- drivers/gpu/drm/msm/dsi/dsi_host.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h index 41e99a9..195ab2f 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h @@ -36,6 +36,7 @@ struct msm_dsi_config { const char * const *bus_clk_names; const int num_bus_clks; const resource_size_t io_start[DSI_MAX]; + const u32 io_mask; const int num_dsi; }; @@ -61,4 +62,3 @@ struct msm_dsi_cfg_handler { const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor); #endif /* __MSM_DSI_CFG_H__ */ - diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index f69a125f..428641e 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1779,6 +1779,9 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host) for (i = 0; i < cfg->num_dsi; i++) { if (cfg->io_start[i] == res->start) return i; + else if (cfg->io_mask && + (cfg->io_start[i] & cfg->io_mask) == (res->start & cfg->io_mask)) + return i; } return -EINVAL; From patchwork Tue Jan 18 17:31:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 532915 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66444C433F5 for ; Tue, 18 Jan 2022 17:19:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347153AbiARRTV (ORCPT ); Tue, 18 Jan 2022 12:19:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347149AbiARRTV (ORCPT ); Tue, 18 Jan 2022 12:19:21 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D76B7C061574 for ; Tue, 18 Jan 2022 09:19:20 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id l12-20020a7bc34c000000b003467c58cbdfso7546780wmj.2 for ; Tue, 18 Jan 2022 09:19:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=49uX77VgBk1zWAbeTSxDYHuJUihy9qWOmYwQIM0d3LQ=; b=qFlqPzVoz0yexgbQcowIdkpsUs1QX3UrKTr/ZfD0wFpj0nYoi8rKcAQLpKfv2+Yrvy zdPwIANi2+uQgSD31+Sv4utYyle+i90RfSj/NSceRsTHIV5frF8afAIdjtHkoYV9roBV 7SCeg33ZIIVsVL9mQZQ09ljylSZzvJaSLCWbLYTf+lsUHf/QtAxxjeRGn1EJZNCKnjV0 N5IxRINNWFWrHhjSfX+Qgwdo7m8MdX0THn/DPLiKikxhl7AM67jChUz96+RMMaZLvhUg CQxCjFWvog5aAXCqfvFtCLYdwBNuQfaZt0wZJAlAqX7Sjk74T4oy0+IPfzm6BJzOdp7e 7POw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=49uX77VgBk1zWAbeTSxDYHuJUihy9qWOmYwQIM0d3LQ=; b=wzr4T4djjwV7UFFVCS0t3OH2GqMMlGBLvqc6cbMvSYaxEjkSsfhe/JE/u4tFUSzrG5 WpO3jB5iUoBOeTlOS1w58Y80vexQ3yBOYsp4XXfGCYqX7V9mKLHVrJdvaQKmFwe2d8vm fruhq2WTtCzlJ5wdiMbkTu0v/BPOJwxrY6R4cl2/cKrrNpfSKXsnQDr2HzpEAS3L3c1f Qm6ZHrSB8e5HJrdPPiNr3ULRFYhfoXoVetaS3z/z9t6WjKmQzIExe7Pr5Cdlrv+FCrp3 86tUInXeHbKSen3h3CQt4eBc+yPgSk1qL//4raIscvctmY6PDTwjfMRoWMlUB5eLp4jk NHnw== X-Gm-Message-State: AOAM5311v3wHRkF0YldS8yhAlrCshWZ5/Ehh4536rWEhX9RgIaY5vTFH B0MrYuDZxn4wrDZ6XreAOnlQwSW/fI3VgA== X-Google-Smtp-Source: ABdhPJx/wQW5QTc9U8wbimFbu5ByvqCd/289tu/HCvf0TaAz4X5aZVKxEqFpLocSS9d1uIt7Ixf1mA== X-Received: by 2002:a5d:50c3:: with SMTP id f3mr25887013wrt.468.1642526359294; Tue, 18 Jan 2022 09:19:19 -0800 (PST) Received: from localhost.localdomain ([88.160.176.23]) by smtp.gmail.com with ESMTPSA id r7sm1081239wma.39.2022.01.18.09.19.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jan 2022 09:19:18 -0800 (PST) From: Loic Poulain To: robdclark@gmail.com, sean@poorly.run Cc: linux-arm-msm@vger.kernel.org, dmitry.baryshkov@linaro.org, Loic Poulain Subject: [PATCH 2/2] drm/msm/dsi: Add DSI support for QCM2290 Date: Tue, 18 Jan 2022 18:31:28 +0100 Message-Id: <1642527088-13088-2-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1642527088-13088-1-git-send-email-loic.poulain@linaro.org> References: <1642527088-13088-1-git-send-email-loic.poulain@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add support for QCM2290 DSI block. It's the same version as SC7180 DSI block (2.4.1) and thus rely on io_mask. Signed-off-by: Loic Poulain --- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c index 96bbc8b..71af048 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c @@ -192,6 +192,7 @@ static const struct msm_dsi_config sc7180_dsi_cfg = { .bus_clk_names = dsi_sc7180_bus_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names), .io_start = { 0xae94000 }, + .io_mask = 0x0ffffff, /* 0xae94000: sc7180; 0x5e94000: qcm2290 */ .num_dsi = 1, };