Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4398461pxf; Tue, 30 Mar 2021 07:02:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygPyTdz7VnWzRme3SYNn/10V0fop3MUnHvHgziypsqqmTOzffRpxLy69VcD6C0+ZcYaC73 X-Received: by 2002:a05:6402:5244:: with SMTP id t4mr33993187edd.87.1617112949544; Tue, 30 Mar 2021 07:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617112949; cv=none; d=google.com; s=arc-20160816; b=CtlOsHDzV/UKwBVHDOX2h0th3jMEkXTPwfcDKn97Li+qD3LCnh8FGAWtVr05RrCeEH IRyk9xI1e2bGBhPi5elFuS0rFKEza60ZveKYibiS+3hc8SO4VSpd52mQwwJeLs5rP0kY 3pKJo95SSVxbELUy/O+EFKogQVIs12vKqORS65Cx7z/65SERo85W/JYjyWMLdny87jsB pSNx+Z3XxVS+Zwbc7vSlEX/A2FuxXmZnqA4h3qCrM3ffBruVV0pq0/M1WY2nNhtgHl0A 9SeN+AmN2jimDGSaZaG97729/P/TRJ7ELVRVG/Bipvj8AcOdG6iZsGE7qK/L7XFNosXR U/LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=oE0RHINGOkrAhMuN+EDn+2x2x/JU6fqWc3MSjm6Mpgg=; b=uQLp14D00mu7WThwmi6hsnVAZwEotKvunM+Pttyi6P7pu3ks5t1YftUcDuQaKiskXX 5O3dha1pqBXufIv9w9usDDSZaVBic5Z9tii7rYZJiXJU0iEdRgU5jLBnvWHgPpD53pqa uke05YjfxSCAw0XuqBAaDXiSl6VBzYY6vTG2I1PnpgkTgaHzLg7260d+vg0hyMBBgk3c Clpz9AnqZ4CfBCHOhCLMc0zUr9uPGrnkogdP8Ys9IFdHzTmu8jFGaB1SkQEXzD6SmqwC /t6y1EcNN8VQCUKbemcO3qo42TDa6SS2SreuGndnCSvZhCluPO7Z9TWjb5SgQ+8MFFLx Ntjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si14455405ejm.177.2021.03.30.07.02.03; Tue, 30 Mar 2021 07:02:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232110AbhC3N6s (ORCPT + 99 others); Tue, 30 Mar 2021 09:58:48 -0400 Received: from mail-ot1-f49.google.com ([209.85.210.49]:36707 "EHLO mail-ot1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231992AbhC3N6S (ORCPT ); Tue, 30 Mar 2021 09:58:18 -0400 Received: by mail-ot1-f49.google.com with SMTP id g8-20020a9d6c480000b02901b65ca2432cso15656173otq.3; Tue, 30 Mar 2021 06:58:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=oE0RHINGOkrAhMuN+EDn+2x2x/JU6fqWc3MSjm6Mpgg=; b=XTuBkkB0XRP6SKROmqGOiNdESVgqxHCglGDSRRLRc/1yzvSoZEtylkF5w92IwY7fyY U9S59Al0L4czC0hnNTVHbuNv/TQh5PmNFKURIItKR9LmLZPi8t6oN+KjRJH/m6dIyFnI bZtG2+w+qEsicw6EaT5J40n+o77PTATDxnlTkFV7XG6Cw6axZwz5OrsPH2n3nIfpqUBk K3QNn+0YZKJJ22Maj9fIzD4aCcL/xq6wPMHbkeF94SDazKCqPuJWMY9FMk7MrZ5EC+SW RjTmHk+on6l00lpayciQaYadzpJibUNr8k/H+PmSgyX6u5UAstKavkco4GJv6uH1KCH+ ZpgQ== X-Gm-Message-State: AOAM532VWBSdEHxyBnkTSlNfpuT20/hF9BaHXSkS9Xeg1yyVVTK0bcRf QCsg7QGRrc51YMt74DtQkQ== X-Received: by 2002:a05:6830:1e14:: with SMTP id s20mr28670725otr.199.1617112697070; Tue, 30 Mar 2021 06:58:17 -0700 (PDT) Received: from robh.at.kernel.org (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id h18sm4432750oov.43.2021.03.30.06.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 06:58:15 -0700 (PDT) Received: (nullmailer pid 238595 invoked by uid 1000); Tue, 30 Mar 2021 13:58:14 -0000 Date: Tue, 30 Mar 2021 08:58:14 -0500 From: Rob Herring To: Po-Kai Chi Cc: Matthias Brugger , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, wsd_upstream@mediatek.com, CC Hwang , Loda Chou Subject: Re: [PATCH v1 1/4] dt-bindings: memory: Add binding for MediaTek Common DRAM Controller Message-ID: <20210330135814.GA224111@robh.at.kernel.org> References: <1617081731-7408-1-git-send-email-pk.chi@mediatek.com> <1617081731-7408-2-git-send-email-pk.chi@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1617081731-7408-2-git-send-email-pk.chi@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 30, 2021 at 01:22:08PM +0800, Po-Kai Chi wrote: > This patch adds the documentation of the device-tree binding for > MediaTek Common DRAM Controller. > > Signed-off-by: Po-Kai Chi > --- > .../memory-controllers/mediatek,dramc.yaml | 155 ++++++++++++++++++++ > 1 file changed, 155 insertions(+) > create mode 100644 Documentation/devicetree/bindings/memory-controllers/mediatek,dramc.yaml > > diff --git a/Documentation/devicetree/bindings/memory-controllers/mediatek,dramc.yaml b/Documentation/devicetree/bindings/memory-controllers/mediatek,dramc.yaml > new file mode 100644 > index 0000000..0217ce0 > --- /dev/null > +++ b/Documentation/devicetree/bindings/memory-controllers/mediatek,dramc.yaml > @@ -0,0 +1,155 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +# Copyright (c) 2021 MediaTek Inc. > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/memory-controllers/mediatek,dramc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: MediaTek DRAM Controller > + > +maintainers: > + - Po-Kai Chi > + > +description: | > + MediaTek DRAM controller (DRAMC) provides an interface to query information > + about DRAM which collected from bootloader and device tree. > + This is mainly used by MediaTek Extended Memory Interface (EMI) and DVFS Resource > + Control (DVFSRC). > + > +properties: > + compatible: > + items: > + - enum: > + - mediatek,mt6779-dramc > + > + reg: > + description: > + Base address of MediaTek DRAM related hardware modules, each channel has > + its own base address in order of > + DRAMC_AO_{CH}, DRAMC_NAO_{CH}, DDRPHY_AO_{CH}. > + minItems: 3 # 3 * N channels > + maxItems: 6 > + > + dram_type: These need to be either common or have a vendor prefix. Also, s/_/-/ > + description: > + The DRAM type of current DRAM chip. > + This property is filled in by bootloader according to the board hardware > + configuration. > + $ref: /schemas/types.yaml#/definitions/uint32 > + minimum: 0 > + maximum: 7 > + > + support_channel_cnt: > + description: > + The maximum DRAM channel count supported by SoC. > + $ref: /schemas/types.yaml#/definitions/uint32 > + minimum: 1 > + maximum: 4 > + > + channel_cnt: > + description: > + The DRAM channel count of current DRAM chip. > + This property is filled in by bootloader according to the board hardware > + configuration. > + $ref: /schemas/types.yaml#/definitions/uint32 > + minimum: 1 > + maximum: 4 > + > + rank_cnt: > + description: > + The DRAM rank count of current DRAM chip. > + This property is filled in by bootloader according to the board hardware > + configuration. > + $ref: /schemas/types.yaml#/definitions/uint32 > + minimum: 1 > + maximum: 2 > + > + rank_size: > + description: > + The size of each DRAM rank. > + This property is filled in by bootloader according to the board hardware > + configuration. > + $ref: /schemas/types.yaml#/definitions/uint64 > + minItems: 1 > + maxItems: 2 > + items: > + minimum: 0x0 > + maximum: 0x100000000 # support up to 4GB in single rank > + > + mr_cnt: > + description: > + Specifies how many sets of DRAM mode register information to provide. > + This property is filled in by bootloader according to the board hardware > + configuration. > + $ref: /schemas/types.yaml#/definitions/uint32 > + maximum: 40 # total 40 MRs for JEDEC LPDDR4X > + > + mr: > + description: > + Pair of DRAM mode register information. > + This property is filled in by bootloader according to the board hardware > + configuration. > + $ref: /schemas/types.yaml#/definitions/uint32-matrix > + maxItems: 40 # align with mr_cnt > + items: > + items: > + - description: > + Mode register index > + - description: > + Mode register value > + > + freq_cnt: > + description: > + Specifies how many sets of DRAM data clock rate supported by SoC. > + $ref: /schemas/types.yaml#/definitions/uint32 > + > + freq_step: > + description: > + The DRAM data clock rate may be slightly different from those defined > + by the specification due to errors in multiples of the base frequency. > + This describe the mapping from real data clock rate measured by > + frequency meter to JEDEC data clock rate. > + $ref: /schemas/types.yaml#/definitions/uint32-matrix > + items: > + items: > + - description: > + Real data rate > + - description: > + Spec data rate Looks like an OPP table. > + > +required: > + - compatible > + - reg > + - dram_type > + - support_channel_cnt > + - channel_cnt > + - rank_cnt > + - mr_cnt > + - freq_cnt > + > +additionalProperties: false > + > +examples: > + - | > + dramc@10230000 { > + compatible = "mediatek,mt6779-dramc"; > + reg = <0 0x10230000 0 0x2000>, /* DRAMC AO CHA */ > + <0 0x10240000 0 0x2000>, /* DRAMC AO CHB */ > + <0 0x10234000 0 0x1000>, /* DRAMC NAO CHA */ > + <0 0x10244000 0 0x1000>, /* DRAMC NAO CHB */ > + <0 0x10238000 0 0x2000>, /* DDRPHY AO CHA */ > + <0 0x10248000 0 0x2000>; /* DDRPHY AO CHB */ > + dram_type = <0>; > + support_channel_cnt = <2>; > + channel_cnt = <2>; > + rank_cnt = <2>; > + rank_size = <0x40000000 0x40000000>; You defined this as 64-bit, so this is a single value? > + mr_cnt = <1>; > + mr = <0x5 0xff>; > + freq_cnt = <6>; > + freq_step = <3718 3733>, > + <3094 3200>, > + <2392 2400>, > + <1534 1600>, > + <1196 1200>, > + <754 800>; > + }; > -- > 1.7.9.5 >