Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp691669imm; Sat, 22 Sep 2018 08:33:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV62UEDUaJKeRNvxKu6dz5fM5hRy5zgy1Ux5JdaQFtEVQME438lU7oZOSDg+LXvmfJdszL+gD X-Received: by 2002:a63:525c:: with SMTP id s28-v6mr2704737pgl.78.1537630407762; Sat, 22 Sep 2018 08:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537630407; cv=none; d=google.com; s=arc-20160816; b=cNV8J3nXo7WF7y6VD84gyN6QWikxVPsieQfEIQUwmuEjrKG9oTLbWSkL8fDA3vmOL2 wD3zWK3gH3eMzCRVl/Lmqq4tOXx2EE+h1z9U8p1g6LTylqt2OtrIVGa5ioTh1hAbEJ9x Rpz84Jv+jbKHZ+omhmDSDxLbmkzSxxSELu1fHRydiyznwyG5hJ+uNnscAi28O19qJxSf HYkKY0CGooJWfpmeSZTKOK9vtpTXuvFlQCBTgEMOSgMmPxUy8uAUcQPLQl464GmkOZZC 5d9kwiEzTQ0xaAPMhLvxwQB9jvKMo28erwaIblo0IR/4zEFkFWYkwFHyoffgywh4Od+v iOBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SJUBPvQlv+59yJXa4obXLAMyaSqOoxIliyFJOoC/vHI=; b=bJsf5JxRb1s2mw08sobf7h/EBNkOUGWbLWXrbfMCyRB3kqj1F8Y8xNqFTB7Vz+ackh CTkVM1MVxwmaRkntaCe5v9QvBq7G51m0ev6SDV8Jox6bY2PfE6pNNRCvbLQ6WQJils/e H3Qk6OteXSK6h2qQMjLLSYv1aD7IGMXHEkEVEj2i7b9s5uA/02CGhy2ggWgIJJbqEOGJ qj27bcpv7tO0tCWj/AlTY02uyN8vcXx83/D3R0bT8fL512hFGT+HZG7QJ0u630UwBKFs wuSQw5oUX1uk99GiL2aCM0SbsyE6NDK88BO/14t4cRWHtKRBtsD2LYziDny86h86QB0U 2orw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b="P21/7pGx"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13-v6si29946401pgg.263.2018.09.22.08.33.11; Sat, 22 Sep 2018 08:33:27 -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; dkim=pass header.i=@googlemail.com header.s=20161025 header.b="P21/7pGx"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728778AbeIVV04 (ORCPT + 99 others); Sat, 22 Sep 2018 17:26:56 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:46939 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727993AbeIVV04 (ORCPT ); Sat, 22 Sep 2018 17:26:56 -0400 Received: by mail-oi0-f66.google.com with SMTP id y207-v6so13781593oie.13 for ; Sat, 22 Sep 2018 08:32:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SJUBPvQlv+59yJXa4obXLAMyaSqOoxIliyFJOoC/vHI=; b=P21/7pGxWgCYO5aDoHDOqSn41VwhfDWfl5/heqyhgLaat/D56JhDd6uXZqx0f26mdc RrxpSh0XjYbHM03P7qfhJ/Zw7m8pUgYA4bWtmmgcK5n7RlRG5KgNCJ8Q3QyksR5VjvVf bal2EQcE1LeUUfBNwXG/b4A58jSU+C0aVgHcjyLjjFJ92+FCE3cXOXjgc9BBOGz7lHKZ OmM7C61vlBrtxtYIxtrAPZxL8YrhYpTUGqwoKeim4tExTCjsc8UOcMfrBH4Sl8PgaOk8 9s/bWzEIy1XW3jxS/iALw4IvQphm4iNos/iRGZMf1MldSv9KhlAb5h9OC1/OoBAxEM2Z mCWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SJUBPvQlv+59yJXa4obXLAMyaSqOoxIliyFJOoC/vHI=; b=jCf+vBonfCyRFy9THtiEis2reuQXDQD3q34UyKD+eL3xjYQR/IxvtcrKWaKQyFOsV3 H7/RB81WYqu7lGG9APiq5/9fqQy86tz2sVdTzZaoXj10S9JG1hP32tkeavtHdjkADNoo jbC7jgeepScbx2qy5UMoEporXSH1qWDbN0maIF3uCC8B6PM+9BAf3J9ISuUqdgHpyBvi 8p3ogyDT8zPYSmLVMTylDQ15F7GoBebKuV0qDLksikNEyAu/Hq885kbO42GHtYVGlDsK w8QhLJ1RyxHpLcocWOqDdIaKH6tlVNQaep1Qdy06jYuunnkjLu3DT6vW+LwX2nP2uF3b WPaw== X-Gm-Message-State: APzg51Dpo5g1IcbdTTliZODlRXQULCr+B0lx5RaWFR12MWsgbu4uKhne Nd57SmLSttixunqOQDl4mwLPHSHYJp62WUohZT0= X-Received: by 2002:aca:338a:: with SMTP id z132-v6mr1463872oiz.184.1537630377308; Sat, 22 Sep 2018 08:32:57 -0700 (PDT) MIME-Version: 1.0 References: <1537433449-65213-1-git-send-email-jianxin.pan@amlogic.com> <1537433449-65213-3-git-send-email-jianxin.pan@amlogic.com> In-Reply-To: <1537433449-65213-3-git-send-email-jianxin.pan@amlogic.com> From: Martin Blumenstingl Date: Sat, 22 Sep 2018 17:32:46 +0200 Message-ID: Subject: Re: [PATCH v4 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller To: jianxin.pan@amlogic.com Cc: boris.brezillon@bootlin.com, linux-mtd@lists.infradead.org, liang.yang@amlogic.com, yixun.lan@amlogic.com, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, richard@nod.at, jbrunet@baylibre.com, Neil Armstrong , carlo@caione.org, khilman@baylibre.com, robh@kernel.org, jian.hu@amlogic.com, hanjie.lin@amlogic.com, victor.wan@amlogic.com, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, Sep 20, 2018 at 10:51 AM Jianxin Pan wrote: [snip] > +static int meson_nfc_clk_init(struct meson_nfc *nfc) > +{ > + int ret; > + > + /* request core clock */ > + nfc->core_clk = devm_clk_get(nfc->dev, "core"); > + if (IS_ERR(nfc->core_clk)) { > + dev_err(nfc->dev, "failed to get core clk\n"); > + return PTR_ERR(nfc->core_clk); > + } > + > + nfc->device_clk = devm_clk_get(nfc->dev, "device"); > + if (IS_ERR(nfc->device_clk)) { > + dev_err(nfc->dev, "failed to get device clk\n"); > + return PTR_ERR(nfc->device_clk); > + } > + > + nfc->phase_tx = devm_clk_get(nfc->dev, "tx"); > + if (IS_ERR(nfc->phase_tx)) { > + dev_err(nfc->dev, "failed to get tx clk\n"); > + return PTR_ERR(nfc->phase_tx); > + } > + > + nfc->phase_rx = devm_clk_get(nfc->dev, "rx"); > + if (IS_ERR(nfc->phase_rx)) { > + dev_err(nfc->dev, "failed to get rx clk\n"); > + return PTR_ERR(nfc->phase_rx); > + } neither the "rx" nor the "tx" clock are documented in the dt-bindings patch > + /* init SD_EMMC_CLOCK to sane defaults w/min clock rate */ > + regmap_update_bits(nfc->reg_clk, 0, > + CLK_SELECT_NAND | CLK_ALWAYS_ON | CLK_DIV_MASK, > + CLK_SELECT_NAND | CLK_ALWAYS_ON | CLK_DIV_MASK); clk_set_rate also works for clocks that are not enabled yet (except if they have the flag CLK_SET_RATE_UNGATE) this should help you to remove CLK_DIV_MASK here is CLK_SELECT_NAND a bit that switches the clock output from the sdmmc controller to the NAND controller? if so: can this be modeled as a mux clock? the public S905 datasheet doesn't mention CLK_ALWAYS_ON at bit 28 but uses bit 24 instead. the description from the datasheet: Cfg_always_on: 1: Keep clock always on 0: Clock on/off controlled by activities. Any APB3 access or descriptor execution will turn clock on. Recommended value: 0 can you please explain what CLK_ALWAYS_ON does and why it has to be 1? Regards Martin