From patchwork Fri Aug 12 22:25:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12942594 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 E2BF1C00140 for ; Fri, 12 Aug 2022 22:30:39 +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=4CoAdEfFP8A8QL5T1mcsIXyoJrRlDLsB0j/AV42rM4Y=; b=uboDOx7P63tJkx SkO2DtYqJ/VvpfVx1M1ujgtiKYyjVtk6QCvLWV4bWjLLyq6xiDQjNepiweEaQj8GiUlDkoVNJRLX9 08bnG019crrLO4VogGPy+FqGJjg4KsImAiDMPZfPzAmOSQEwIHm39tE7akFO0ynONKYGutYr0mpQd 5kMaYsNsuE5QMGIm0jmCFx147J8TeyM3Nr06xYsbnKk/ZkJreoUAmHhkxREySgfGR1ORUtNU9KC/d twdLqsGFg3RSwALj4v8vqUeVcG9sQFj1Yvy7GuxrLGaUck2JEbMCV7gecsOg2U+J3r/baB0S/B1rO r4HtGOWaUrlRzRDsMWDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMd9t-00GNWZ-2u; Fri, 12 Aug 2022 22:29:37 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMd62-00FwP1-6g for linux-arm-kernel@lists.infradead.org; Fri, 12 Aug 2022 22:25:40 +0000 Received: by mail-qk1-x736.google.com with SMTP id f14so1848170qkm.0 for ; Fri, 12 Aug 2022 15:25:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=22h/M/V860IplmghhOOIgt/faKZklILiFH5PQHaZGuQ=; b=bV9JUvVE2HdIowfvyhODwSprmEzqvEvIWJkWCX8mGzO6O6Mb1X9tyyTDSJkEV3J9kv kcqGPhbxTK5TKWHzG6ebBjnWGzzLcWZncl3zl3ODqWLTsFDspWHUzX06bIROnZ8g2lDS gDlBDvInrqAmpk6V+6S9n9WXvQeahiUbo+RB6ZxCY5WgaRydlEb/+VqaYbiHMb2IZB/1 4tFvrZAA2ikeutY2/agaLhtNF3zHs+ah7eKPInVxsGcw6zPVj3Oeksz0icXkV3vGhktC cQ83UZrwaYGnilwnF4VaJhvGeRxBKN/8FnY5XPQnmMqGw+OzdV8Xgl1xLxsMlX3LCcgZ /jXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=22h/M/V860IplmghhOOIgt/faKZklILiFH5PQHaZGuQ=; b=Ybug0oAZyUhuXO9pI6QkAh9jSDxa66DGauGa5gWxnO38yKv+5NfcFZxPNCM5l6LAEe Cwdj8oqFKmv5GxG/sEvh9iqQa0L7tIxcpOOFUt9tBJbSvGPhXQlSylkm6e9a3IF8NNCV oOnPEFZ+Iat/q9DUkVFRkTSZzRMScJSrH642JvQGiXzXz9+xXtP2BdUiutrv6iZoFbRg Mc/q7WGrkTjinzCVKpG8/Zxev+I2bsH0Y3v6VoFF+MUYB+etIx3DwKAgfHJ4ZgfgTEaZ 2BAyQbyllvcaZjis3WRTEGgCxBRsW2zQi70S4sRIS0K4bcdtizCdS+DeGNJxixxGy0u4 e49A== X-Gm-Message-State: ACgBeo2avylxV3/MIW3XblWzLrf1D4SxlvldNAVGSQEBknojyeLDUMz5 mx9MlK8kynbpCz3KRYKmwOk= X-Google-Smtp-Source: AA6agR4sfKig+81R21IHRCKMPg1+J43EyxVKJ0AjLE7V76UMtM0QABWO3kvjmalmekrTXtUjv3gzOQ== X-Received: by 2002:a37:88c3:0:b0:6b9:53c7:75e4 with SMTP id k186-20020a3788c3000000b006b953c775e4mr4299661qkd.532.1660343136819; Fri, 12 Aug 2022 15:25:36 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id f17-20020a05620a409100b006b942ae928bsm2788878qko.71.2022.08.12.15.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Aug 2022 15:25:36 -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 v5 0/3] Add Broadcom STB memory controller driver Date: Fri, 12 Aug 2022 15:25:30 -0700 Message-Id: <20220812222533.2428033-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-20220812_152539_196494_1AA746C0 X-CRM114-Status: GOOD ( 15.00 ) 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 v5: - use DEFINE_SIMPLE_PM_OPS() to avoid keeping the __maybe_unused Changes in v4: - drop unnecessary owner assignment for the platform_driver - use pm_ptr() as directed Changes in v3: - made 'frequency' property optional to avoid introducing warnings for existing BMIPS and BCM7445 DTS files - updated sysfs document to use a shorter and universal path 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 | 52 +++ drivers/memory/Kconfig | 9 + drivers/memory/Makefile | 1 + drivers/memory/brcmstb_memc.c | 301 ++++++++++++++++++ 6 files changed, 380 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