From patchwork Fri Jul 22 20:10:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12926855 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 80D2CC433EF for ; Fri, 22 Jul 2022 20:12:55 +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=JTvpzTi65uniELPApzIhXqZbmfnJkqEwoxNSg6Ah1v8=; b=zwDpgOi2yNXQzh +tUbgqQplPTAwHuIUSU8lr2y0qhlZAZPdH94bw9LdxOml9ajL18+yidHoY+WTypBzmV59a7wLl/P4 8vZu3NGSiJkT0Ebdj/1QOWIti7et2GJ6m/yIliN2gqdhtPsqzc0xWY5EEosh6pmRhURtDMq1VfYWy e9nDHxwPWP8v9dWnbJmd15mcpPMR55oQzxYbTA3kVKxQnfg6ik1vOIo/lJWIy+Ng5jI8Rshz8OohU pYjUqltP6RAcOeer30W1pvaZEidYJrymb2kkzQ/jyvAFyb+EaOiiihMrVXlMvFi2cOWKCv4HOl8B7 N2GdueZIG1mEn/tLrUgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEz02-009pHR-8m; Fri, 22 Jul 2022 20:11:50 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEyzy-009p70-2x for linux-arm-kernel@lists.infradead.org; Fri, 22 Jul 2022 20:11:47 +0000 Received: by mail-pl1-x62e.google.com with SMTP id c6so1349930plc.5 for ; Fri, 22 Jul 2022 13:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=F/sHqz52JCjZtTGGz1e4gK9EfsKCCo6NBQFJa9haPXs=; b=No6XYV/cF1q7/4YwMikQsOmP4nHdGsUYQF89/RNENnOywLKSM+0sKtK6Y8f2qqpbAk ZqqQMup4pfMtW5g2QC5DzwYuCxCxPSz/ZRBYSvQTG3VY8Ws/1k7QCZKwzwZZa29svKkR 1CULsa8fGnZANIU04WsOqOEGgVgm92ahA+9eWHtVy0agppeuFloVj1BR7dE1IZCDESMz g1YsBZawHl+jprt+D48Hh368lh5w7vfKXMpYchJ9vVyAkjsLTWs0XXD5nucAxiEOUe6S DayhNBZr67gzo2bJ/+C5i2VqIs+S0oP/60pM3TacsXQ9P1IqBgtnEEiiotkOBSFQnVCW hk8w== 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=F/sHqz52JCjZtTGGz1e4gK9EfsKCCo6NBQFJa9haPXs=; b=iYThnjXCsTGyfhu4uaaDRtY7/EBkYLcE4n4HfpHsMqund0JMXSjmoKDT+ihReh8ijT AKjkoHvxLDNydsr37iAIqnPZAFBCaf765D4+r1X80daUbTbfGhYYceOokKZiXUgemmB6 LuLrPAXRVbgpP278hUl4+MVanV0d0cW848f7MqdX8iXECeRNUCJY6sM8Dnx4f2iJxzvy RVVdn0XyiMFbdAnzrZBSPD0vtlXqx8Ycao3aGhOjjGTK6BdVpCskHZDe/cKlKgK+KkV/ l++TcBd72RpzqDPMSXAslccRqKAagRwgb3vPN+D06DQepjrVuy+Ae6l7p8sdrn1J54fD dHyg== X-Gm-Message-State: AJIora/T0YoKMp7l0MVStVneuiBizm9MF6gXm/HG5HZqdIYg3XMNVIbq BkjiLuY28YZDhiB5ZEl+PcI= X-Google-Smtp-Source: AGRyM1tmntwkrguuJAICv9NXR4l1waxYHsCW+lA8zubnRJ8OSeVcVzxqCCIofQHq9BybvqvbBCkFhA== X-Received: by 2002:a17:90b:4a83:b0:1ef:de4c:65f0 with SMTP id lp3-20020a17090b4a8300b001efde4c65f0mr19248669pjb.149.1658520703099; Fri, 22 Jul 2022 13:11:43 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id p2-20020a170902780200b0016c0eb202a5sm4098604pll.225.2022.07.22.13.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 13:11:42 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Broadcom internal kernel review list , Rob Herring , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS) Subject: [PATCH v2 0/3] Add Broadcom STB memory controller driver Date: Fri, 22 Jul 2022 13:10:40 -0700 Message-Id: <20220722201043.2731570-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220722_131146_155448_7399BC3C X-CRM114-Status: GOOD ( 13.94 ) 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 Hi Krzysztof, This small patch series adds basic support for controlling self-refresh power down on Broadcom STB memory controllers. We might be able to contribute more features to the memory controller driver in the future like accurate reporting of the memory type, timings, and possibly some performance counters. Changes in v2: - merged the v1 first two patches - added a sysfs document describing attributes exposed - addressed feedback from Krzysztof regarding style and API usage Florian Fainelli (3): dt-bindings: memory-controller: Document Broadcom STB MEMC Documentation: sysfs: Document Broadcom STB memc sysfs knobs memory: Add Broadcom STB memory controller driver .../ABI/testing/sysfs-platform-brcmstb-memc | 15 + .../bindings/arm/bcm/brcm,brcmstb.txt | 11 +- .../brcm,brcmstb-memc-ddr.yaml | 53 +++ drivers/memory/Kconfig | 9 + drivers/memory/Makefile | 1 + drivers/memory/brcmstb_memc.c | 302 ++++++++++++++++++ 6 files changed, 382 insertions(+), 9 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-platform-brcmstb-memc create mode 100644 Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml create mode 100644 drivers/memory/brcmstb_memc.c