From patchwork Mon Aug 1 22:09:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12934151 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 0F845C19F2C for ; Mon, 1 Aug 2022 22:11:00 +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=ubt+4ylfm26FiQIXNiHaDWv8B5OcR6UIJWmesXN0srw=; b=O15CA/kXgdjkGx Jb+X0/ELXq+GTqOFVLHRaI9vHEaxcJlSXWoHYEvK8PELS1t4OiiJqAobsOkxb2Gg9vmTU4/5Q3CPA YPr3WE06SExXFpH6Qfxbmv0+L7vhSQwQ3mxwZ0y9WhQEbJcUA5VVSa1ZNqDlFNxVgOcec0aBZskRU H95d4Sdj9l0L3o3/yeRKQEz2kxIqycMcF8qJ7aV0Fm5yr0QIoHdIdjEP3YpExqOkaRTanGqRq3dUZ H8DP+k779J4hTtc9zr7OAtvQlRBukSdUnZw8LbbNa1iSfiNlUCgWMJUGdDqKTTrkELDKHG7ja54+R +TWcVCXfRu3P4BNdlMsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIdbX-00BFzU-Q6; Mon, 01 Aug 2022 22:09:39 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIdbU-00BFwk-C2 for linux-arm-kernel@lists.infradead.org; Mon, 01 Aug 2022 22:09:37 +0000 Received: by mail-pj1-x102c.google.com with SMTP id x2-20020a17090ab00200b001f4da5cdc9cso6559125pjq.0 for ; Mon, 01 Aug 2022 15:09:34 -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=9Z8J3irksMZXis7Ie9brihlp5V92bNnWK5MaHlycXJo=; b=PiL+wNbeYjYPPXoxsUcMIi1LeUIRuIw6u9OiR1j3/5sio2e+qGd88Cbri1RfgBKSUo XJ+yWyVyTtbsBzo0HX61BtxEn+Sm1t2U8+ooX4EdtP/Z72p6pTTYFdweoliDLdFeZwmb PDiQhMStGlAVpcC4S5TLlY8sfLc/cYcMgi1uQw8VnEYfb+TGI64IvluEeXH8i383FyDz fGcTvKVeJczaw2DaTMPa5MroHev6cVgl0lrOo+tukNhtgoqs6+2emyLJ8NzWJkKWYuE/ +FdJfTjDducUqsRzq8AMtqfn8gfxchW5vUfGbeOgUW1nDI0xFgUaE9FpEqyFGhEhWIQP Ok8Q== 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=9Z8J3irksMZXis7Ie9brihlp5V92bNnWK5MaHlycXJo=; b=B/j6NscQ38zXg64l+efwlVVDvbrxh3Oh4+bLDlrsRdIrSYsvHFSMq4nTJcmzwZHJZU HOhJ+qXPHBnEeU6HE7yEpvocEoTLKb11GVUYmIzAGqMZelUcxkyCBETArzc+t4eNf/Gq bO6OKa6VGduX+2dJOaVcm4JoR5RUqP8rpcAtZD7tSFt95ouvxV/8YVgBMu6T4zAWFfOM L+PnJnO1LO4E5dunVBq2ydPkG7M/gfO9G25+meZEKXHVb4rEMJbdSCJoLCDzewqThC3w zbPd1JHu37ZqaPxAyYuO8dL7nAPJk5Y1rpvDcFZhlakQzElov0gwaaEdhUH0bDobVv10 uWaQ== X-Gm-Message-State: ACgBeo1hsOPfu1Un8WLdHKoZFCeEuPqusxMCtFtn8s8LRoVfblJiwcq9 9qErgatJGT6M+uXqWLIDMTc= X-Google-Smtp-Source: AA6agR7iWd0Wn7UJ43mQfrjRZalF3kIoRd7+rxXZ8UFJ5UhnkR77njj5iyB/cVMOwmt2qJP+K0VZWw== X-Received: by 2002:a17:902:cec4:b0:16d:7d8c:4be with SMTP id d4-20020a170902cec400b0016d7d8c04bemr17802366plg.139.1659391774294; Mon, 01 Aug 2022 15:09:34 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id g15-20020a1709029f8f00b001637529493esm10136969plq.66.2022.08.01.15.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 15:09:33 -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 v3 0/3] Add Broadcom STB memory controller driver Date: Mon, 1 Aug 2022 15:09:28 -0700 Message-Id: <20220801220931.181531-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-20220801_150936_648631_21BD7C36 X-CRM114-Status: GOOD ( 15.32 ) 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 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 | 302 ++++++++++++++++++ 6 files changed, 381 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