Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1516477imm; Thu, 19 Jul 2018 03:09:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcJVI06r+Np23KVQ8qzQAPgtFJcSOUC40KhjWOqJJBz0Ftqb2Ev+I0bFpfkB8/JVDVqJBNn X-Received: by 2002:a62:21c3:: with SMTP id o64-v6mr8874837pfj.21.1531994973737; Thu, 19 Jul 2018 03:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531994973; cv=none; d=google.com; s=arc-20160816; b=Yj71pQf4lcfQtWmkwwb/j/IM1LZbaCv7yjd1ft+a0vwM0j8RUeV1VmfQvlk3/ZScd3 qAYTmkbwGEiyvPXSE9PyhB7YCRCOqj4Pu12WTXyQEF+V6YdifHsdGdP5g8yzY15SJkly C0rTZGCePzs7vXW6r40r9owE8RXNnlOT0Zowc9C0yzNozHY6leiRTw7ubbx1/2x34cNX AgBeze0vsI1+RzwVIdw3RQ0lj/D7aWfxp5JrAJeF3CLL1VBUROsGinWsgjM+Gb9jMORb Wkc8rVRBB0XXy/lhwvV/hjnsdL7s3Vlp22ilHkyHQqKLFCIrGcZSq7jYJVOv9HOEKXB4 szsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=z6gYWWamb506ccaiEkGugDpWnP5J2VnOBRoKW/Lps4E=; b=GC2gE4mlOCbu9rWNiKzP65KtfKqOd6OwiRXfyDufsI0ISvGCj3AAZi900jZL56uwV9 mrWlbocgR9NmJ/s7/a7YQyV4wTpzMuIJy0uOnDpFwZReDHjRexWyxsyzl8Ke2LIhppb5 oeUm5uuYpl1TrHHNi9BpnbI1MQplgdL/QH/PKo2wscb1O9hQst33aXqqS1dDytxwvgSJ Ly4tC2zc/qz3xJzblFMRJeGqPHOd01UE5J+4uri6Wth6dxdTM//uygAOGZ19eucVxsb2 5WOZvkxxmZdU/vDpfrXXtkm6GSQOf1V7lYVQB2I0oSw/DoniXQHYJqAnZ2VMxck0Xp7D kAOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5-v6si5747085pgh.451.2018.07.19.03.09.19; Thu, 19 Jul 2018 03:09:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730687AbeGSKu0 (ORCPT + 99 others); Thu, 19 Jul 2018 06:50:26 -0400 Received: from mail-sh2.amlogic.com ([58.32.228.45]:26022 "EHLO mail-sh2.amlogic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726956AbeGSKu0 (ORCPT ); Thu, 19 Jul 2018 06:50:26 -0400 Received: from [192.168.90.200] (10.18.20.235) by mail-sh2.amlogic.com (10.18.11.6) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Thu, 19 Jul 2018 18:07:17 +0800 Subject: Re: [RFC PATCH v2 1/2] dt-bindings: nand: meson: add Amlogic NAND controller driver To: Boris Brezillon References: <20180719094612.5833-1-yixun.lan@amlogic.com> <20180719094612.5833-2-yixun.lan@amlogic.com> <20180719115751.34ff1a51@bbrezillon> CC: , , Liang Yang , David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , Jerome Brunet , Neil Armstrong , Martin Blumenstingl , Carlo Caione , Kevin Hilman , Rob Herring , Jian Hu , , , , From: Yixun Lan Message-ID: <63bb7f53-81d2-fe98-9ae3-37aae7d8647c@amlogic.com> Date: Thu, 19 Jul 2018 18:07:25 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20180719115751.34ff1a51@bbrezillon> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.18.20.235] X-ClientProxiedBy: mail-sh2.amlogic.com (10.18.11.6) To mail-sh2.amlogic.com (10.18.11.6) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris: see my comments, thanks for the quick response On 07/19/18 17:57, Boris Brezillon wrote: > On Thu, 19 Jul 2018 17:46:11 +0800 > Yixun Lan wrote: > >> From: Liang Yang >> >> Add Amlogic NAND controller dt-bindings for Meson SoC, >> Current this driver support GXBB/GXL/AXG platform. >> >> Signed-off-by: Liang Yang >> Signed-off-by: Yixun Lan >> --- >> .../bindings/mtd/amlogic,meson-nand.txt | 95 +++++++++++++++++++ >> 1 file changed, 95 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/mtd/amlogic,meson-nand.txt >> >> diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.txt b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.txt >> new file mode 100644 >> index 000000000000..31f910dcd27a >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.txt >> @@ -0,0 +1,95 @@ >> +Amlogic NAND Flash Controller (NFC) for GXBB/GXL/AXG family SoCs >> + >> +This file documents the properties in addition to those available in >> +the MTD NAND bindings. >> + >> +Required properties: >> +- compatible : contains one of: >> + - "amlogic,meson-gxl-nfc" >> + - "amlogic,meson-axg-nfc" >> +- clocks : >> + A list of phandle + clock-specifier pairs for the clocks listed >> + in clock-names. >> + >> +- clock-names: Should contain the following: >> + "core" - NFC module gate clock >> + "device" - device clock from eMMC sub clock controller >> + >> +- pins : Select pins which NFC need. >> +- nand_pins: Detail NAND pins information. > > You should document pinctrl-0 and pinctrl-names, not pins and nand_pins. > Ok, will fix this >> +- amlogic,mmc-syscon : Required for NAND clocks, it's shared with SD/eMMC >> + controller port C > > Are you sure this is still needed, even after exposing MMC/NAND clks > through the CCF? > yes, the SD_EMMC_CLOCK register from eMMC space explore a few other bit that not fit well into clock model, thus we still need to access them from NAND driver, we know it's kind of ugly.. #define SD_EMMC_CLOCK 0x00 #define CLK_ALWAYS_ON BIT(28) #define CLK_SELECT_NAND BIT(31) #define CLK_DIV_MASK GENMASK(5, 0) we probably could get rid of CLK_DIV_MASK, but need to keep other two > You forgot > - #address-cells > - #size-cells > - reg > - interrupts > - > will fix these >> + >> +Optional children nodes: >> +Children nodes represent the available nand chips. >> + >> +Optional properties: >> +- amlogic,nand-enable-scrambler: enable the NAND scrambler feature. >> + - (absent) = scrambler is disabled >> + - (present) = scrambler is enabled > > I keep thinking this is not needed if you have the NAND chip properly > defined (NAND_NEED_SCRAMBLING flag set in chip->options). > Ok, we will try this flag >> + >> + >> +Other properties: >> +see Documentation/devicetree/bindings/mtd/nand.txt for generic bindings. >> + >> +Example demonstrate on AXG SoC: >> + >> + sd_emmc_c_clkc: mmc@7000 { >> + compatible = "amlogic,meson-axg-mmc-clkc", "syscon"; >> + reg = <0x0 0x7000 0x0 0x800>; >> + status = "okay"; >> + }; >> + >> + nand: nfc@7800 { >> + compatible = "amlogic,meson-axg-nfc"; >> + reg = <0x0 0x7800 0x0 0x100>; >> + #address-cells = <1>; >> + #size-cells = <0>; >> + interrupts = ; >> + status = "disabled"; >> + >> + clocks = <&clkc CLKID_SD_EMMC_C>, >> + <&sd_emmc_c_clkc CLKID_MMC_DIV>; >> + clock-names = "core", "device"; >> + amlogic,mmc-syscon = <&sd_emmc_c_clkc>; >> + >> + status = "okay"; >> + >> + pinctrl-names = "default"; >> + pinctrl-0 = <&nand_pins>; >> + >> + nand@0 { >> + reg = <0>; >> + #address-cells = <1>; >> + #size-cells = <1>; >> + >> + nand-on-flash-bbt; >> + nand-ecc-mode = "hw"; >> + nand-ecc-strength = <8>; >> + nand-ecc-step-size = <1024>; > > I'd recommend not forcing a specific ECC config in the example. > Ok, will fix >> + >> + amlogic,nand-enable-scrambler; >> + >> + partition@0 { >> + label = "boot"; >> + reg = <0x00000000 0x00200000>; >> + read-only; >> + }; > > Blank line here. will fix > >> + partition@200000 { >> + label = "env"; >> + reg = <0x00200000 0x00400000>; >> + }; >> + partition@600000 { >> + label = "system"; >> + reg = <0x00600000 0x00a00000>; >> + }; >> + partition@1000000 { >> + label = "rootfs"; >> + reg = <0x01000000 0x03000000>; >> + }; >> + partition@4000000 { >> + label = "media"; >> + reg = <0x04000000 0x8000000>; >> + }; >> + }; >> + }; > > . >