From patchwork Wed Apr 6 01:48:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 12802264 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 781A5C433F5 for ; Wed, 6 Apr 2022 01:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=66YFgHw3FUDnTMTxi4tU9cJGWfm7rLhC0gG4KjUyMy4=; b=ovYm/N/uFFj9Tl 39yPEJrdlk+Pj4KODifZaMr1PRCFtuk3j730wy5akc+2hEvDFkSfeaQHrcNpSWOWzVtrPMbJSPwJ+ eq0TX1SpUuXtkgeg8Uw7Hjsl87SB4//9GAlbhfYlUORu5ipVKwVEhxwvxv/FuBOK2qYyIYE9Jjtqe g9OrYCQPG8LpmKw9egDoDDQ9Ng95ZL+ndMcTXa3J000ArkbVH7zypDfGc/PCBT6dRQWxFBNYV9dOP PI2gXB5nsDoouQ1GMeU7+q6R7PEvuOJkO4oc0JDVJ8Y9eHrw2wvswU++/+hbUehhULQK9myRdax2C 2mOMspnaXzWB9CV/NECQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbunW-003GlY-Ad; Wed, 06 Apr 2022 01:49:26 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbunT-003GjB-Jt for linux-arm-kernel@lists.infradead.org; Wed, 06 Apr 2022 01:49:24 +0000 Received: by mail-pl1-x630.google.com with SMTP id m16so702534plx.3 for ; Tue, 05 Apr 2022 18:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/YAk+fWUU+ETvZMAahO94+Nmhx8ga8SOKFjIYbyRo2A=; b=TdiuHKaZORaWPGQTvEUC06LmhEQ2Hv4BGNuu+2WWjop40q0AwxKFUcVd+SuxV1iC2f fqTGkOvq2So+26pvLbXOPbG++jhun+FsmlEBb7ZVx0joMcOhwx6tONZKnOGOSWcLcAfc /hqRG+wM3LeeAcZ6vYUV1vNuR2rb/C7Aet6wY= 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:mime-version :content-transfer-encoding; bh=/YAk+fWUU+ETvZMAahO94+Nmhx8ga8SOKFjIYbyRo2A=; b=xCqQ7HecP9m/tT8HpIz6A6CyUC2vvRWp1ugGp7zZAvEJ2R9InhDaTawTJIOCDZkG0e rafDcJ8I41H9LKfL5plxvKs5qCsaENzrJGbkp5DYFQZn7KP66SM3yMh3Jk29OrChItnn vgNriv07c3KOv8RGbgNNwRYb2MXZ2ZvP2iqTdxzSm8MKk6xcu6GPIq0YEmtodZq+Fe0h n0ulp2CLC6n5I7xPATB8XQJYdS02Qs2h6AbcUjAieMBVICa60AiYsrLwVcarAF2bz5p2 IT9ympXgXOsOg8BH+AaFWTXAKHXDWlKhzN9mOCfdeyaGaFK7qfmNBSFkUYMOeDMKcflJ g/lQ== X-Gm-Message-State: AOAM5338iyUD2YVHul4xhjW3jrI+4EFLS76u+ejh1Aj8SW5CcpNr6YXO gyN7xv4+e5ZW8G1cwgIzoH6QiQ== X-Google-Smtp-Source: ABdhPJxRiO+aF5ru+VVliawznjkQgTfqyIcNS4jn2oAT5iUCxwlpZhGj0CMVfVLc/UCVkgor6cxH+g== X-Received: by 2002:a17:90a:c253:b0:1c9:ada2:f28d with SMTP id d19-20020a17090ac25300b001c9ada2f28dmr7240326pjx.17.1649209761200; Tue, 05 Apr 2022 18:49:21 -0700 (PDT) Received: from localhost ([2620:15c:202:201:6903:769c:e1f5:9c25]) by smtp.gmail.com with UTF8SMTPSA id t69-20020a638148000000b0039822f39a40sm13620410pgd.25.2022.04.05.18.49.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Apr 2022 18:49:20 -0700 (PDT) From: Brian Norris To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Heiko Stuebner Cc: linux-kernel@vger.kernel.org, Elaine Zhang , linux-pm@vger.kernel.org, Doug Anderson , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Brian Norris Subject: [RFC PATCH 0/2] rockchip / devfreq: Coordinate DRAM controller resources between ATF and kernel Date: Tue, 5 Apr 2022 18:48:40 -0700 Message-Id: <20220406014842.2771799-1-briannorris@chromium.org> X-Mailer: git-send-email 2.35.1.1094.g7c7d902a7c-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220405_184923_713352_37C5F80A X-CRM114-Status: GOOD ( 11.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Rockchip RK3399, there are a few hardware resources that are shared between firmware (ARM Trusted Firmware) and kernel (power domain driver) that need to be coordinated properly for DRAM DVFS to work reliably. See patch 1 for plenty more description. These fixes are based in part on the specification in the RK3399, and in part based on extrapolation and observation. Any confirmation about the behavior of PMU_CRU_GATEDIS_CON0, etc., is welcome. Otherwise, see the patches. Regards, Brian Brian Norris (2): soc: rockchip: power-domain: Manage resource conflicts with firmware PM / devfreq: rk3399_dmc: Block PMU during transitions drivers/devfreq/rk3399_dmc.c | 13 ++++ drivers/soc/rockchip/pm_domains.c | 118 ++++++++++++++++++++++++++++++ include/soc/rockchip/pm_domains.h | 25 +++++++ 3 files changed, 156 insertions(+) create mode 100644 include/soc/rockchip/pm_domains.h