From patchwork Wed Sep 28 08:45:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2394 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4AD2F3F0E1 for ; Wed, 28 Sep 2022 10:45:26 +0200 (CEST) Received: by mail-ej1-f71.google.com with SMTP id dm10-20020a170907948a00b00781fa5e140fsf5161389ejc.21 for ; Wed, 28 Sep 2022 01:45:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664354726; cv=pass; d=google.com; s=arc-20160816; b=s3pv73dVxDfgJKwdSmc9TwxFrDXmpnhf6zIOBtsAXBPXeBqM3ybfdCnp4550Nn3Rzi HTtwpEOPL1carlMxLIZhSw2cX3HxtvDAMIJcbiJt/TiEbwcofifZuwCNEOyx54f9fO6X ENxKQoxXQvpASUPIT/gKF0nI5GBUuUzPrgh45A8pjKFhwsIDyMAqdG3hf6dhelOxEo4V SxeHZ53/SlkS6Ws46D8XMJM9gfWs6iWwoOuH5JS1Rj3D6gg4SbiUkYUS0lHkIQrYQ/Ab IHWf2rMgteQ9ghJVIM0IuLW1mBASzchkDFRBEAtHpkKlga4tcObFxz4hyiVnFf6wFlO9 Z2wA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=OZL0wRQFP7Yar/PDbG7ZoKwSVTT5x3Gyu+eYvAm2q0o=; b=AjM8k7jw4WIQk30Z3qqihKRRu5XlWq1h31XPtzZ7s2jLnOhKwyGOMzX7P4VRUF2GNG QFAmYA6FF7s3gPf26wfp/Bvw2/rVZSyZsed0nnyL/b1nM/ZCp+iSs7OldAmuPBCM7pHE 6BFxyQtjUR1gsJ942DpcpME3O76rUX+SAGBKb217rKKvUgNqnX3hGZXGHGviQn/fU0G/ ua/+bucC/QxtsWiPOlr3EQmCn9AGjMuT+2nwuJGCaLM4aVO3kJFNa8PMIIPcnfr7kNvY 70p1lBaj/2CNfQYihjX+EjSon3j243nHK0W6uiiG7Ws0yrleyJgKe7kk0JYLiLueOl0K mOKg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BkVyTpWA; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=OZL0wRQFP7Yar/PDbG7ZoKwSVTT5x3Gyu+eYvAm2q0o=; b=ampOeRWQd+0I3nl0prLFLbJEhBNvCSDO18ghoQRFa4qja80IgoEQcoWgc+UpoeVIYr J23iIHbCGbWMEdHeovOtSfSbDNw0c8W4OR9yjIq1+FG4XVr1HAzWb8goWRngowLMsvOn VX0SeSCuQHu8vNOtmKF1QqgpyxmYim/kOsEfA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=OZL0wRQFP7Yar/PDbG7ZoKwSVTT5x3Gyu+eYvAm2q0o=; b=jT36ebapWS0KW1PpLXT3898g/p1aKC1ycZYoOZ2AvRwP3AQQHYZmz5bqMCZl3HdO2w +vFUWauhJweJidrJE8num/5hbXo/46ZtnphSFJ96YeiFP83EQ4P4cWG8ZSozKFv8zZZL +2i8VbuVh/RP4cf/wFBteSivhsOF7Thds9je7SbS3IgcGFuyf8adbIpDJBHvBMKc4kjU 6gL+vmnhbAEhha8TQwwqjEsGGk6IbHXcJ6LCPS58t9ScijI5mb3GclZJQ3mdAA377zyh LUzMiJhce3b7THvkCiSt1QL+fuD7XTYnAbfpRTMpxjeuYZNnWY7FX1thaVE1BeYD8WU0 VzNQ== X-Gm-Message-State: ACrzQf2tiayqKzHc70A+rxvULiIlIpIn+PayLCz2OH/uWccW5tXoOz4I OBeqICj5GuWKLGmqTMGfxdQQKxwY X-Google-Smtp-Source: AMsMyM5PniGGeoSdsmSw9FND95Rz3va0oWS3vMcjB7hb2iX3gE2Pq2H/KdP5HfsioZrexcQGCtpXOw== X-Received: by 2002:a17:907:a06a:b0:77d:2f20:69c0 with SMTP id ia10-20020a170907a06a00b0077d2f2069c0mr26053413ejc.40.1664354725776; Wed, 28 Sep 2022 01:45:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:e10:b0:776:305f:399f with SMTP id l16-20020a1709060e1000b00776305f399fls516637eji.1.-pod-prod-gmail; Wed, 28 Sep 2022 01:45:24 -0700 (PDT) X-Received: by 2002:a17:906:fd84:b0:730:acee:d067 with SMTP id xa4-20020a170906fd8400b00730aceed067mr26722554ejb.206.1664354724526; Wed, 28 Sep 2022 01:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664354724; cv=none; d=google.com; s=arc-20160816; b=FhsPVPhbzib8Bf87eVM4KwiJDCquLiN82c9tNgLGQ7VKb+Ssw1GUpt3fO/p6HTjOQZ neUO1+CbgFG/pmqmYC9FDQkC1+3fyMWbeNhmkoUB3qWdGjMDdDXb3NzunKyFDYMDExf2 zKJHA+Em9ZUTSA0ynYszC4TwNuF8taV17O+oG8t6ndum6lUu9rF5roqFxVhSbjtR2DfN bdIIHXf2xvC8iXjgXeepOt2tgIy6U68KKWkcp41eicLWDnVR6yG+NHPekdCW4Gv9NA1I TLC9Ukp/mOALPPXc4IW4rinFqHul5u7Gv0aIsn3jL+SO9VpPreCk08UQ2oEX9FHs6axm xWFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=h3YaKURbiQ7LuhL1Xu/lWdSKUeeQp7qXCFgrkT2hkvo=; b=WsIIcA2sZ5vSCWjA7DAsQyLLLHNlN9QIfTvWmzksS3annxf3tSvi/ka47mh/8Q+kTa X9NNEJ51Tr76znM8Aaiv4mTW8LdsL8TpPNVhkurKnfmyJg6m40rQ23LoePADbOlLGgCC 6T7aqdAAzZR9llxP3/VAIxafNQ5scIo7ES9szlE0edo4vvq56o0f/SPhjPqhmjDTaV1W /pcGB8PkBAJo6Wu705yg0YrxbxIimypR8HlXfoher6Gxo9JmmB6124Qp8txDW7HcQwE9 8D9tpPNBqQajMhTpjTNhnlwfS9sEwgQNUMF/8nKXz3S+GSty6ukM2Zm6B66vnB057XUM g9zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BkVyTpWA; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id dn6-20020a17090794c600b007309a848439sor1740511ejc.35.2022.09.28.01.45.24 for (Google Transport Security); Wed, 28 Sep 2022 01:45:24 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:906:9bd3:b0:778:c8e0:fcee with SMTP id de19-20020a1709069bd300b00778c8e0fceemr26842385ejc.275.1664354724331; Wed, 28 Sep 2022 01:45:24 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-232-92-192.retail.telecomitalia.it. [95.232.92.192]) by smtp.gmail.com with ESMTPSA id q1-20020a50cc81000000b00457618d3409sm2928883edi.68.2022.09.28.01.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:45:24 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Giulio Benetti , Heinrich Schuchardt , Neil Armstrong , Sean Anderson , Simon Glass Subject: [PATCH 1/7] dm: clk: add missing stub when CONFIG_CLK is deactivated Date: Wed, 28 Sep 2022 10:45:03 +0200 Message-Id: <20220928084509.2758974-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> References: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BkVyTpWA; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add missing stub for functions [devm_]clk_...() when CONFIG_CLK is deactivated. Signed-off-by: Dario Binacchi Reviewed-by: Sean Anderson --- include/clk.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/include/clk.h b/include/clk.h index 76bb64bb5ee0..407513e0fa29 100644 --- a/include/clk.h +++ b/include/clk.h @@ -88,8 +88,9 @@ struct clk_bulk { unsigned int count; }; -#if CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(CLK) struct phandle_1_arg; + +#if CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(CLK) /** * clk_get_by_phandle() - Get a clock by its phandle information (of-platadata) * @dev: Device containing the phandle @@ -258,12 +259,26 @@ int clk_release_all(struct clk *clk, int count); void devm_clk_put(struct udevice *dev, struct clk *clk); #else + +static inline int clk_get_by_phandle(struct udevice *dev, const + struct phandle_1_arg *cells, + struct clk *clk) +{ + return -ENOSYS; +} + static inline int clk_get_by_index(struct udevice *dev, int index, struct clk *clk) { return -ENOSYS; } +static inline int clk_get_by_index_nodev(ofnode node, int index, + struct clk *clk) +{ + return -ENOSYS; +} + static inline int clk_get_bulk(struct udevice *dev, struct clk_bulk *bulk) { return -ENOSYS; @@ -275,6 +290,17 @@ static inline int clk_get_by_name(struct udevice *dev, const char *name, return -ENOSYS; } +static inline struct clk *devm_clk_get(struct udevice *dev, const char *id) +{ + return ERR_PTR(-ENOSYS); +} + +static inline struct clk *devm_clk_get_optional(struct udevice *dev, + const char *id) +{ + return ERR_PTR(-ENOSYS); +} + static inline int clk_get_by_name_nodev(ofnode node, const char *name, struct clk *clk) { @@ -285,6 +311,10 @@ static inline int clk_release_all(struct clk *clk, int count) { return -ENOSYS; } + +static inline void devm_clk_put(struct udevice *dev, struct clk *clk) +{ +} #endif /** From patchwork Wed Sep 28 08:45:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2395 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 252DD3F042 for ; Wed, 28 Sep 2022 10:45:27 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id w20-20020a05640234d400b00450f24c8ca6sf9692108edc.13 for ; Wed, 28 Sep 2022 01:45:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664354727; cv=pass; d=google.com; s=arc-20160816; b=TCNmbxSpxAjSEe5As4jMWZ8EALXWuhlg3J8AvX+L3vnph3GwdNEyELNruoJJoBseZS zG0yiuqfw5dcZv19nNVhJzW/Ow0bfu0dSbnXA5zEwivo0rVn/FdgvNjxGC+U/G+fopZQ DyzteHGZvdkV33q/vuTPr8mHrlcMGfh/Xia0X6AP+foNIGDv+kYd0rfSpa2STZLzzMqU tdDf2sgbgrzHjM58lEAW/dqk92t3iM2OINLnfaxDp2aTyKjF1Umf4D/mG0uVigGQ8wTA VFa72gVk/OWXUinMRGB53nlb9uW3sOiSw3zsQx0702212Mpe7qjJzcg4g2TfdrRtoa5R KdUQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=pAStVDcRDBFA5J6CDaBVIQvWCiwWTHU9YEpphDjiv70=; b=0wbOPhD2U7kJR0BSjbNpWQmv/gSJ/sS7NJVpBTOzt0cdZ2DvoQ41lEKmHLCYqJ6yO+ GqOwOSpDAkhM6avqx+vd2AsSrNqoAAQj+viBa0HzuHtitjnZHucDtLTQ3XluFT5J4FF4 Z0Z3IQEf2kgBq7lAo6pYZf34jXZTyNblTJOugVLP1kcTmfBNOsiI6GUmFUIcGkRh2BoR jFzF+pRh7stn0v023NtUrDANRTHQ3ONEsNymgMpZT+el35TvMlm++vhRNjL/QUGHvHGW sHuKL7hpi/iztNPeQWAK5gwKKO0N2GQpztU0gzMvADiQblt/EYdWko2Rn4LO22/8EIG3 dVVg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MiQzFdlA; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=pAStVDcRDBFA5J6CDaBVIQvWCiwWTHU9YEpphDjiv70=; b=Jq329MCEcnOXDYJEcaCD1+QYUyRFn5JtaPcRVvyl/Fhh6Mmib8SriuCaE3GnhRi33x wBxsRIz0hHo0xyJQmFSOqO3AchrRdbwDlc/JsUH8vXxaPfaDgelMkdgtZmdqfhZdlcV2 o7orh/8Jbkxr4gxNUNLY+E5aL7tDjcQeB8Q/k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=pAStVDcRDBFA5J6CDaBVIQvWCiwWTHU9YEpphDjiv70=; b=wY3NeTxUppxlCipvmboFo3WamZppNcskZ5CF7o9z3YlH02cpRM8uRRM7fjnU+HpWYf cu7yFOvNKe1bt+Ly210l7XXhlBK6nFR59gH1t392Dn5tqkHdrNvNDarevQ67frHdepn2 FKOs2YM5/8m0nC4r7eiU1FPmArzdMeLfO3BioasVI+Fp38dFlgmwuUxuOWsMXYCYTUfR NJ9xqCf1KHy3ZbqZgLB8EDg+j38MigV9/cDJAUnehAUX5wtqVcxX4bzZOBcI/Utqoduu UvtZunuqsEfAhWrAj8FM+klr0jLkUHryjkNIsjjlMCxk5CLes2TR1Ii2xIfDwChsWXD3 d4Nw== X-Gm-Message-State: ACrzQf1Y+KZsdOfyibH2eYJa6McyCjHXIza6tr+DuOwmyWMI4r1LeEJl u47PxaIY12SPmPNJTD9ZqUwcDtJt X-Google-Smtp-Source: AMsMyM57F96TWI+j0+FIg0bUDFR4udXUUQQY1SZ84BbtsBBpLxePyb2BGIauT6+n7kEVzVlKC4Bkvg== X-Received: by 2002:aa7:c04d:0:b0:454:2f81:b966 with SMTP id k13-20020aa7c04d000000b004542f81b966mr32564443edo.269.1664354726780; Wed, 28 Sep 2022 01:45:26 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:348a:b0:783:b20:46a0 with SMTP id g10-20020a170906348a00b007830b2046a0ls513674ejb.6.-pod-prod-gmail; Wed, 28 Sep 2022 01:45:25 -0700 (PDT) X-Received: by 2002:a17:906:7310:b0:782:cfd4:9c07 with SMTP id di16-20020a170906731000b00782cfd49c07mr20664465ejc.708.1664354725600; Wed, 28 Sep 2022 01:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664354725; cv=none; d=google.com; s=arc-20160816; b=fO8gXEa+S2i2Vn2PZTVaeAzmw22Nkq7kgPnf+QgAcPRhpciJEYXa3h1U7/wux+K0M6 LOxOmhF8BGLNQx1JcFp+P1N26uOfe3ixFBbZnSQzDAxjJh9jJFIkxo6YAi00xiKfAt06 CGcG0GiUFtnFOAbvbOfKCvAYWEpkdXY1j05Uz9JI9U1fb0bMdQcUAjobbohKhCG50t6u 5SVbyQ9adT9VYMr2mIBkjb/sCawkpXJXx3jae8WcWVHhkzi147rH99fCAuCNksfpfwW4 Yx6cxmL1ProrfFCh44jB6Ma/+r2IymY858gwB24/y9aTB9voJcZdgbjx5hbiSGEEwvao E2LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7jdvP+NwVZ4EDodsd5IWv/WlTqEvLXasi7voixbR6Zw=; b=qpxLoLDiWYhz4WLgcawxIUSn7/+bhf0Tw8gdUQaKpubms1WSmRfNP+UtH54mNScVtF kXkX/JsBtVI0Bkl1UqDGS5s+9YmclsX+9m/Do2oD4/M6WQwWrWTR1UQhu7LbYeVCPB6g fR4z0YO9B3sodRX5WBnGGbHjsrey9sU8ySxay0SRXH4hQuqa0cUuJeRlmx7nxG8vdJwX SLxwdaWem1Pnj1pPzVy8zoIVe5QlAo8Dvw4ZZiALLHXadI3ypy1A4jxSxoeeyKd+/9mg yEeEhMp+i4it1guPxbjfoX2L5W70qUw3LEheZhU/SOVPLmVbbO8coNRzuS+UiakwQRYS 6k3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MiQzFdlA; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id b22-20020a1709063f9600b0077086e34deesor1735834ejj.50.2022.09.28.01.45.25 for (Google Transport Security); Wed, 28 Sep 2022 01:45:25 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:907:7245:b0:782:331b:60f4 with SMTP id ds5-20020a170907724500b00782331b60f4mr27172571ejc.594.1664354725392; Wed, 28 Sep 2022 01:45:25 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-232-92-192.retail.telecomitalia.it. [95.232.92.192]) by smtp.gmail.com with ESMTPSA id q1-20020a50cc81000000b00457618d3409sm2928883edi.68.2022.09.28.01.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:45:25 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Lukasz Majewski , Sean Anderson , Stefano Babic Subject: [PATCH 2/7] clk: imx: gate2 support shared counter and relative clock functions Date: Wed, 28 Sep 2022 10:45:04 +0200 Message-Id: <20220928084509.2758974-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> References: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MiQzFdlA; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Michael Trimarchi Add shared counter in order to avoid to swich off clock that are already used. Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- drivers/clk/imx/clk-gate2.c | 15 ++++++++++++++- drivers/clk/imx/clk.h | 27 +++++++++++++++++++++++---- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/drivers/clk/imx/clk-gate2.c b/drivers/clk/imx/clk-gate2.c index 40b2d4caab49..da2723023778 100644 --- a/drivers/clk/imx/clk-gate2.c +++ b/drivers/clk/imx/clk-gate2.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include "clk.h" @@ -33,6 +34,7 @@ struct clk_gate2 { u8 bit_idx; u8 cgr_val; u8 flags; + unsigned int *share_count; }; #define to_clk_gate2(_clk) container_of(_clk, struct clk_gate2, clk) @@ -42,6 +44,9 @@ static int clk_gate2_enable(struct clk *clk) struct clk_gate2 *gate = to_clk_gate2(clk); u32 reg; + if (gate->share_count && (*gate->share_count)++ > 0) + return 0; + reg = readl(gate->reg); reg &= ~(3 << gate->bit_idx); reg |= gate->cgr_val << gate->bit_idx; @@ -55,6 +60,13 @@ static int clk_gate2_disable(struct clk *clk) struct clk_gate2 *gate = to_clk_gate2(clk); u32 reg; + if (gate->share_count) { + if (WARN_ON(*gate->share_count == 0)) + return 0; + else if (--(*gate->share_count) > 0) + return 0; + } + reg = readl(gate->reg); reg &= ~(3 << gate->bit_idx); writel(reg, gate->reg); @@ -82,7 +94,7 @@ static const struct clk_ops clk_gate2_ops = { struct clk *clk_register_gate2(struct device *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, u8 cgr_val, - u8 clk_gate2_flags) + u8 clk_gate2_flags, unsigned int *share_count) { struct clk_gate2 *gate; struct clk *clk; @@ -96,6 +108,7 @@ struct clk *clk_register_gate2(struct device *dev, const char *name, gate->bit_idx = bit_idx; gate->cgr_val = cgr_val; gate->flags = clk_gate2_flags; + gate->share_count = share_count; clk = &gate->clk; diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 46dee35a6735..11f5dca1175b 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -53,7 +53,7 @@ struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, struct clk *clk_register_gate2(struct device *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, u8 cgr_val, - u8 clk_gate_flags); + u8 clk_gate_flags, unsigned int *share_count); struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name, const char *parent_name, void __iomem *base, @@ -63,7 +63,26 @@ static inline struct clk *imx_clk_gate2(const char *name, const char *parent, void __iomem *reg, u8 shift) { return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, - shift, 0x3, 0); + shift, 0x3, 0, NULL); +} + +static inline struct clk *imx_clk_gate2_shared(const char *name, + const char *parent, + void __iomem *reg, u8 shift, + unsigned int *share_count) +{ + return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, + shift, 0x3, 0, share_count); +} + +static inline struct clk *imx_clk_gate2_shared2(const char *name, + const char *parent, + void __iomem *reg, u8 shift, + unsigned int *share_count) +{ + return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT | + CLK_OPS_PARENT_ENABLE, reg, shift, 0x3, 0, + share_count); } static inline struct clk *imx_clk_gate4(const char *name, const char *parent, @@ -71,7 +90,7 @@ static inline struct clk *imx_clk_gate4(const char *name, const char *parent, { return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - reg, shift, 0x3, 0); + reg, shift, 0x3, 0, NULL); } static inline struct clk *imx_clk_gate4_flags(const char *name, @@ -80,7 +99,7 @@ static inline struct clk *imx_clk_gate4_flags(const char *name, { return clk_register_gate2(NULL, name, parent, flags | CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - reg, shift, 0x3, 0); + reg, shift, 0x3, 0, NULL); } static inline struct clk *imx_clk_fixed_factor(const char *name, From patchwork Wed Sep 28 08:45:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2396 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 30FB63F235 for ; Wed, 28 Sep 2022 10:45:28 +0200 (CEST) Received: by mail-ej1-f71.google.com with SMTP id qw31-20020a1709066a1f00b00783d9fd7df2sf3247559ejc.17 for ; Wed, 28 Sep 2022 01:45:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664354728; cv=pass; d=google.com; s=arc-20160816; b=q2JLg/HcXQUWehhELO6xek1YxXiOvqJayibIa54R9GdO5SpUQ/N3/33Ejvs3LG84i0 a2hPdJWXbg2YdmQ0V+t4jY0B2otyae5jg69TJwFiLtI5voBdhEJvB1Qe5e3Gwwd5Xf3j 3lCQ910iYL9Ny5JrlaHilDl0LaLnGeoZhP1/q37NbRaKes9Tu8vS8BSf5dQRfjZKdqbB SmEY+jE7+SYSxuS7JH04PKpHYTnq2exFA8TR2wJpgPjkPDbqaehvv7XdL66Dd+jFzegC 0uw9P8m2zFTDJ+NTVKuFtjv8ovbLIZaTx4M4NWeo0yfY8WnENAgaw6U67Cez2IjKnBoQ AkSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=bYu/lFaINeHbPf4AicabBNnXlErSQAjKPVzPqNLIHdk=; b=QeevYqG4nFQIpC8slaWb/3MPKyxFM0s/QTBB1d4cNCMI2UiH96dgs7bD6lFJjGeBhu zEqVF/PI+vOf5ibijcj9wSG9wWR3K/owimvFpqGZKPxs7mhauzo7tZQ216rneJEa5hXJ xFh499PKWbwxyoOi8zj0/YbTOGWsmHSnEiza0vPvQ3ZZZ/nXiXsQuW1J+5ARqOGjZlRq vBvXrQjPk+g5ZBHcX6uudUHipKDlKWIio1cX60bqB/ZR4DjQWdCM4/SR2k2B/OHOYWoh T9EX5pdkQqetoVDfHU/QiUU3rqpQ6h/d4S7f2jrSt03gnr9CPkIqVdcsoL0XxR70VymN UODA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="BB5/lhMZ"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=bYu/lFaINeHbPf4AicabBNnXlErSQAjKPVzPqNLIHdk=; b=Ctbans4hp3TQL0lyLRRtlvCTGcA4Qy/8doEyvPQg/yKGxJNH2KNEF0MGboY0OCYOpf 7bZnYsnvtfdH8+xC9DKEYABN9xEI7H/2mMzW0RYgB3rR7zG3nLncCFZnHJAFZpe12CqM jwhnyCMJdOO06H+1b+m5e4vIoy8mKQ4oo4Jfk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=bYu/lFaINeHbPf4AicabBNnXlErSQAjKPVzPqNLIHdk=; b=gYLrm3M5SJ8/LQzjP6kPJ1ABfvOmJsHUhLzyHabkIehj/ppsb3ImuSYg4x/TgRzqjM SguG6AccRyHy1MKrI0L+wnpLkiUYjQERDGEAjmCRNCGm/hd1wlroxMIDZaGnsx8b42LR S3Y0hrtGXfevHM2cHYOul7WNxYt03HRYcMHFRuDZHbbFLkInRl5M4ez584sFw8hogLAw xSimzDlggX97jIS2TLMTpwVjAJK6MqAVrLi3zxao/VZqnmTAbJaDcFdCSZbYc4n1ig8i 43xhc1W/c66CulskKOusHMAYzrRFWpkFNqGKqNu6HnRMAoFPfAouvp2wU613JkJ0ErJ1 JQBA== X-Gm-Message-State: ACrzQf0z+fDN18lGqLETCiO8ksIUBZFl/4fREvW2qTbwBJjzdi0934zv dfhqpW77wi27RfeOJMtyFFNYEbZE X-Google-Smtp-Source: AMsMyM6zT4bS8iY9U01jB0ceHP5mLFIWyw9vjyLKA0Sedmp7DlL7wXvkmCSYSHscIvHLBht+Ty9H6A== X-Received: by 2002:a17:906:4795:b0:787:434f:d761 with SMTP id cw21-20020a170906479500b00787434fd761mr5186458ejc.597.1664354727849; Wed, 28 Sep 2022 01:45:27 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:2690:b0:457:99eb:cba9 with SMTP id w16-20020a056402269000b0045799ebcba9ls1006558edd.0.-pod-prod-gmail; Wed, 28 Sep 2022 01:45:26 -0700 (PDT) X-Received: by 2002:a05:6402:2947:b0:451:32a:2222 with SMTP id ed7-20020a056402294700b00451032a2222mr31951885edb.376.1664354726705; Wed, 28 Sep 2022 01:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664354726; cv=none; d=google.com; s=arc-20160816; b=JdFxrfEq4IEr3ieDAouZuSKtOoLWE19uyOoOFgfenHUfAhjIn/b7Rkcsjv2VfoOPKD Iq/kRSgoYupgQ2hLrqMXCfQXHSGX2qPf2leNUt2tCf/NV8uERGbrh380vjo7fp7pXz9z uLFwwd9E2ky33v+mkK8Dos6BZ7zMHTVDHTe7wagprcY7/F32C5DjlPEluh808YEeNWQg flbOQi+y/Vsnnq/86NhIBavl9l8jzaEbknwYgJIwmX/snIIKr3FpOQ3HuICSRqLdaQ/B 0WoZVlSHH+FFc6C2hqmPgEEUqutRtUmIcaj/4QaXmDyncS4+3cgfvVVQxNzNjVE32mil TpnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=4Mtvf75aAuDyqMvX2drR2TOMmgNgBilytxd7R8mYfmk=; b=SfrCpKd2ub7fLRQbEsUslMNpXmko/wX+kL2r0gzV+EqjNi7jXUBIIF0MZ0TslLjCUd 3Txjl7mJFZwmig2dm5N2faZGn8l4LFLToYWbB2w0tLimBUvHrAEcP8rcJZw1kM/dzrAq AQg1p+AeUdynaQ6xDoAY4uJPL8M6VbzJWwEvuVLMDVNJIizcXfeJs0Usb/UCBbn/6gCs WcifuUTSKEBqXjOELbjMm1lEXrBijAMy268qzmlmNXJ0ijOjm7R1DXhU+viJvTtGTczu PhnhpgwDn4QZitoochE0i+RF1z7ImKeL9YrbdqXynXdpRIxOrpbT0GoLPqfFluwoy40d XE7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="BB5/lhMZ"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id m11-20020a170906258b00b0077e2277f4b5sor1630141ejb.133.2022.09.28.01.45.26 for (Google Transport Security); Wed, 28 Sep 2022 01:45:26 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:906:974c:b0:784:d96c:b4fa with SMTP id o12-20020a170906974c00b00784d96cb4famr6269568ejy.391.1664354726515; Wed, 28 Sep 2022 01:45:26 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-232-92-192.retail.telecomitalia.it. [95.232.92.192]) by smtp.gmail.com with ESMTPSA id q1-20020a50cc81000000b00457618d3409sm2928883edi.68.2022.09.28.01.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:45:26 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Lukasz Majewski , Sean Anderson , Stefano Babic Subject: [PATCH 3/7] clk: imx: clk-imx8mn add gpmi nand clocks Date: Wed, 28 Sep 2022 10:45:05 +0200 Message-Id: <20220928084509.2758974-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> References: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="BB5/lhMZ"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Michael Trimarchi Add gpmi nand clock. Those clock can be used in mxs nand driver to run nand to EDO mode 5, 4, ... Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- drivers/clk/imx/clk-imx8mn.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index 15d7599cfb7d..35e0d935d390 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -15,6 +15,8 @@ #include "clk.h" +static u32 share_count_nand; + static const char *pll_ref_sels[] = { "clock-osc-24m", "dummy", "dummy", "dummy", }; static const char *dram_pll_bypass_sels[] = {"dram_pll", "dram_pll_ref_sel", }; static const char *arm_pll_bypass_sels[] = {"arm_pll", "arm_pll_ref_sel", }; @@ -90,6 +92,10 @@ static const char *imx8mn_usdhc3_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy static const char *imx8mn_qspi_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll2_333m", "sys_pll2_500m", "audio_pll2_out", "sys_pll1_266m", "sys_pll3_out", "sys_pll1_100m", }; +static const char * const imx8mn_nand_sels[] = {"osc_24m", "sys_pll2_500m", "audio_pll1_out", + "sys_pll1_400m", "audio_pll2_out", "sys_pll3_out", + "sys_pll2_250m", "video_pll1_out", }; + static const char * const imx8mn_usb_core_sels[] = {"clock-osc-24m", "sys_pll1_100m", "sys_pll1_40m", "sys_pll2_100m", "sys_pll2_200m", "clk_ext2", "clk_ext3", "audio_pll2_out", }; @@ -268,6 +274,8 @@ static int imx8mn_clk_probe(struct udevice *dev) clk_dm(IMX8MN_CLK_USDHC3, imx8m_clk_composite("usdhc3", imx8mn_usdhc3_sels, base + 0xbc80)); + clk_dm(IMX8MN_CLK_NAND, + imx8m_clk_composite("nand", imx8mn_nand_sels, base + 0xab00)); clk_dm(IMX8MN_CLK_QSPI, imx8m_clk_composite("qspi", imx8mn_qspi_sels, base + 0xab80)); clk_dm(IMX8MN_CLK_USB_CORE_REF, @@ -299,6 +307,12 @@ static int imx8mn_clk_probe(struct udevice *dev) imx_clk_gate4("usdhc3_root_clk", "usdhc3", base + 0x45e0, 0)); clk_dm(IMX8MN_CLK_QSPI_ROOT, imx_clk_gate4("qspi_root_clk", "qspi", base + 0x42f0, 0)); + clk_dm(IMX8MN_CLK_NAND_ROOT, + imx_clk_gate2_shared2("nand_root_clk", "nand", base + 0x4300, 0, &share_count_nand)); + clk_dm(IMX8MN_CLK_NAND_USDHC_BUS_RAWNAND_CLK, + imx_clk_gate2_shared2("nand_usdhc_rawnand_clk", + "nand_usdhc_bus", base + 0x4300, 0, + &share_count_nand)); clk_dm(IMX8MN_CLK_USB1_CTRL_ROOT, imx_clk_gate4("usb1_ctrl_root_clk", "usb_bus", base + 0x44d0, 0)); From patchwork Wed Sep 28 08:45:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2397 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 638ED3F042 for ; Wed, 28 Sep 2022 10:45:29 +0200 (CEST) Received: by mail-ej1-f69.google.com with SMTP id qb16-20020a1709077e9000b007827e5f3e2dsf5062628ejc.3 for ; Wed, 28 Sep 2022 01:45:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664354729; cv=pass; d=google.com; s=arc-20160816; b=kpx1Jr121Qz+ID5pPZkYfNEOMZwP5pnl8VVdzs+CUwRGV09vWsFkugkeuwt5e4goR7 GTQ8TATnJR/9SsJUARMBIot5WRh3EATSwe8hQnqACS7DFW2KUyM+OOickzdh8M8cksR0 dn9Mam/W9R6eF1WWOxo39PyLR6gh8M4fvgTZ0G2Rc1Kuqgq2dOLZpG+Il/wlQN1kE15f A7lOZE52KKWp3b7Mq8prCHxljLeDhDe362sHNph0Y9+83QPsop50T+sf0Rke28wmJFWh QqNhy8RRkcFh87cxg2QbvdPQvE3EWMmc2Ugab3LBy3tR/ymN0lSlPXu564TZDgSiq/OM kh0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=gOcps8/hoH7i+2hDhYzV2n3ZlK8e41U1/yApl60dfvw=; b=0YOAB9ivzF8JH1mM7VbzYBtG51r/tlXozfwwWFaWAZpJIS7t2m9BYbbtXEofGQFHVF yED7mSHVKcopXMa/HCy7kxClBC4BdRuX/2M7kMkFIFMeAkq32Qwe/vL99A5rkslgwMoz +hN+Dd71lW0tYdXZgE6ig0i5LVPj+iYRt6hiAplpEgjD8ytEtVCNQXqUYjiXavdONjN9 2pa0tXt3gCc02RzNRLU8ULvw9rm/Xltf1rai/StI6WsUBLBUUJdjJek3OffdkZvGwBru m6jIgQIqcEenr4rnLe301xoKg3CsbS0tp5w8+f57HtbiCwuC/u32QJF6f0cDsB5jevYk Qc8A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hotHuo8v; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=gOcps8/hoH7i+2hDhYzV2n3ZlK8e41U1/yApl60dfvw=; b=ZCtoamkPMybvsznJ0C0cucjlTjUPl6mlgz13uLzAiUIGjMiExHgqMg1lAfpXlxNZp1 z/oth99xroQ6IfQZ15dWdlr5Wv2XfnmlvU7vR0esjmmGh5TbAv1lT8/9G126BSxjSIDQ Ay4q1+dEF5L/nqDFn+4pyv91ICiuoi3d0QxtE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=gOcps8/hoH7i+2hDhYzV2n3ZlK8e41U1/yApl60dfvw=; b=fa0iOH3t4ad0gSrcU9yiO0rKe+SDJjVp4Og6MXRxKpG+r2x3YO/aKRbGV4bSLVYukf HAd6pPbflDkl722cmuZ9enEvBAZQ5f1fRH9WhAVMOw6kidfhzJK4KQ3r70CY5JVKxA1N 8Qvo2iaCJoiCEJr9BRU2AfZKcS1omibpKF2BV2F0TcBMZvGLgVjBO81mw2Na9XE+1R4S EwOAhDatgeikeIbCirFtgG2asWjOdd24YuwnvPaw0nWDNCwQCZtFcmK+al4FK1xovvsm rzTtTfKGcag6z3suaTJ3PtBpsznRj+Ee63bneG5oYGIBAlnHHICQc3hnEjHNX/4uPbtU qvcw== X-Gm-Message-State: ACrzQf0zAElJYKyfy6R1xbVjQulX6TGy0LdpH0r8o4xzFYMZqBEQznC3 AQS6itBCrD1AtQRVISlZl3C92/cC X-Google-Smtp-Source: AMsMyM6GBeffKBbY0xBpHUYKf+fhesIwaR5QcOh3Jiqqa5yeFP9jhtwolcGpi+i9pq6wML3B8dUm1A== X-Received: by 2002:a17:906:8a46:b0:781:7171:74d0 with SMTP id gx6-20020a1709068a4600b00781717174d0mr25866127ejc.214.1664354729062; Wed, 28 Sep 2022 01:45:29 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:274b:b0:448:77f2:6859 with SMTP id z11-20020a056402274b00b0044877f26859ls1005681edd.3.-pod-prod-gmail; Wed, 28 Sep 2022 01:45:28 -0700 (PDT) X-Received: by 2002:a05:6402:520c:b0:451:4213:49db with SMTP id s12-20020a056402520c00b00451421349dbmr32115113edd.130.1664354727903; Wed, 28 Sep 2022 01:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664354727; cv=none; d=google.com; s=arc-20160816; b=tuBCxCxhib7l6G0mAg5tkTzqbmliYefSb+7czCY1zNFay/ExUepP9v4tlZn7UlCV+X LyBJme61EyBv5DPGHlisRrNEWi9auf9ViTjr89zaTVTzxoD/9FDaNbxdfMBQQZv4xdnO J/xnLjMUJQpXDIudcYdCpEpeJTxLB6a+pxF3otQ/YIxDIVx5F7D2Avr9IfdpPh57uBOd JZIQWZzI700JIb013KY6It+sH42AZ+HnVjFZF5DuPcY0Ml/QLl4sKCIOrnY7DUtJEEzA SuHW51A3+z6MGcsXAhkMVzEM+4eBJ4G48pXgulRU35tddG7S10Kklt4TtMW1E4IUtlNi QoFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=S7zIP/MB7OJgolC5AxNEFIwGEzidAnEC3Z+Z4dejx+g=; b=D6ZEs5s8TFZXu/5uwfRzHAJyUsWVqTQb4BgH2wCVCxoJ5gxrxnthkvsj2yyccMfwC0 Y5jAH3k+UqjsdiXFch/yZThiVHbhsxJdNne2Zx32++ldx7srNuDuGuoQAdpIFa/VIMlh oYOdEJdoBnOj7tIARfI0RaO/Q7EsaYNgN1zuzv2/N9cdpnSPM9C9vHvTMPgzSzYhqWdI cq+yuR3QRfzAhPtHiPDbRdntsmttmLWzg9fW/OCTkuMljHJ3iBYKBMWoxBo/usPZiEbr CJwcyuADcXDtYN2HU9Tom/1RxTHfyuAsfi3pstd77R1QV1tdv966HE5AxDewRv3i41U+ Jsrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hotHuo8v; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id l22-20020a170906a41600b00781132aefc9sor1776736ejz.94.2022.09.28.01.45.27 for (Google Transport Security); Wed, 28 Sep 2022 01:45:27 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:906:9b87:b0:733:1795:2855 with SMTP id dd7-20020a1709069b8700b0073317952855mr26880645ejc.156.1664354727658; Wed, 28 Sep 2022 01:45:27 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-232-92-192.retail.telecomitalia.it. [95.232.92.192]) by smtp.gmail.com with ESMTPSA id q1-20020a50cc81000000b00457618d3409sm2928883edi.68.2022.09.28.01.45.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:45:27 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Fabio Estevam , "NXP i.MX U-Boot Team" , Stefano Babic Subject: [PATCH 4/7] imx: gpmi: Add register needed to control nand bus timing Date: Wed, 28 Sep 2022 10:45:06 +0200 Message-Id: <20220928084509.2758974-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> References: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hotHuo8v; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Michael Trimarchi It is used as delay for gpmi write strobe. Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- arch/arm/include/asm/mach-imx/regs-gpmi.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/include/asm/mach-imx/regs-gpmi.h b/arch/arm/include/asm/mach-imx/regs-gpmi.h index 33daa53c45df..7a1577863195 100644 --- a/arch/arm/include/asm/mach-imx/regs-gpmi.h +++ b/arch/arm/include/asm/mach-imx/regs-gpmi.h @@ -93,6 +93,11 @@ struct mxs_gpmi_regs { #define GPMI_CTRL1_DECOUPLE_CS (1 << 24) #define GPMI_CTRL1_WRN_DLY_SEL_MASK (0x3 << 22) #define GPMI_CTRL1_WRN_DLY_SEL_OFFSET 22 +#define GPMI_CTRL1_WRN_DLY_SEL_4_TO_8NS 0x0 +#define GPMI_CTRL1_WRN_DLY_SEL_6_TO_10NS 0x1 +#define GPMI_CTRL1_WRN_DLY_SEL_7_TO_12NS 0x2 +#define GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY 0x3 + #define GPMI_CTRL1_TIMEOUT_IRQ_EN (1 << 20) #define GPMI_CTRL1_GANGED_RDYBUSY (1 << 19) #define GPMI_CTRL1_BCH_MODE (1 << 18) @@ -111,6 +116,10 @@ struct mxs_gpmi_regs { #define GPMI_CTRL1_ATA_IRQRDY_POLARITY (1 << 2) #define GPMI_CTRL1_CAMERA_MODE (1 << 1) #define GPMI_CTRL1_GPMI_MODE (1 << 0) +#define GPMI_CTRL1_CLEAR_MASK (GPMI_CTRL1_WRN_DLY_SEL_MASK | \ + GPMI_CTRL1_DLL_ENABLE | \ + GPMI_CTRL1_RDN_DELAY_MASK | \ + GPMI_CTRL1_HALF_PERIOD) #define GPMI_TIMING0_ADDRESS_SETUP_MASK (0xff << 16) #define GPMI_TIMING0_ADDRESS_SETUP_OFFSET 16 From patchwork Wed Sep 28 08:45:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2398 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 235643F0E1 for ; Wed, 28 Sep 2022 10:45:30 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id y1-20020a056402358100b00451b144e23esf9680741edc.18 for ; Wed, 28 Sep 2022 01:45:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664354730; cv=pass; d=google.com; s=arc-20160816; b=jXoc7B5zHZDE8Pd/sCF1J99/zESllLWvdew+db/hAmQ9DsLFa5WLaWTxyOLipuh/99 NM06W6sbyJhGUhpSMEHA8EKFjen2r5cajg2GHa+F1oBL7vxeICFke3oTxDrfT0CY6r/y /6TBspJTC7w1zyJ2RczvV9ZC13yem7BsG+wnhFla4jRmfAfPpGdNGCiRaepO/AfEmbpK XdGtz9/wIsajFHXesHjsK0HnFHhJnuvPFsIbssHRX60Gf2E3G6nY8LITcJ81j3qavYNJ Y/Q5vqWp4fShK26ilnrWg/nG96yrkXabShplWRLV4zvBLwelo+ki8RIkZZbCbMJITGqc u/Nw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=S+OTiC0WXu9ZjBSM9fUdZAXAhmWmVBGawIjn9yL62xw=; b=hmD8+QhDPHjUmwzNwR8Y9jfjtKArwgdv50ZVQoUxZNKggpZHwq77zMtJV/AFbCG3Ui D960I6iwZUEkl/7TvdADj0bxF8sYRiuhy7RFy298cMRdmUpl5AhQtH5KSknAgNbQBk7g 47JvFY/nz3G8y+o2x8ZfQl0ac/blh+94EGcLpPqK0fMyzpIUSRjSaluy248jf0dtsmBI 16QBCt2o3T7GD1EG6YEy2VjL4MVt2xzUmmaPjTdC7kscqhZ+uNYIit+AoKaygV5iDdb4 cfDRmI5grs9O61gMZE3xeAHskCo4Q96BUUQfglfd+vEFWgnznYEKc43er3ls9OvZlkE9 5X2g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=big1rEI2; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=S+OTiC0WXu9ZjBSM9fUdZAXAhmWmVBGawIjn9yL62xw=; b=qaK6Ozioye3Rj5dAIRO7FsrKc8JAVTFOhCR4t/yOaHBNuO4rlMUIXwJOifzkTczJwz iC+gaWkOdKEMp2HVxMe8MJRsgb2UMfQG3r+Y2T6ttl311THL0p4l0Et0ZVpcyveW1vn6 2IJIRGXnpYdNZZuyVTzLjkkNMK5FCoRUHpJmQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=S+OTiC0WXu9ZjBSM9fUdZAXAhmWmVBGawIjn9yL62xw=; b=dfwY7SHAJgZI/MwQ6MtmHOjsKCTr9FIBqzHa5uo4LhxykFt8FLsoXwvu7fcVYhIzSk Kvjre6FUEw+bgQ6M6Lhfpm0MYZsRI3Uumu2JBHvdtxi23NfmM1ttDaA5z9m/PTkx0qii JRdon9+T2ATmn/OX66s6r1P+kvM99uJLs1cH0blEII43ueEURH6flMBIHNoLG/tA3YiV Rp9gxDFXiMFFKZMTQ+27FF3s/wnBWuN+dJjdcGt3tBTRhcD76JFFveIbHmEfQyhJsqKT IGyDkx1+wib+a6VGwbne/UjdIMCaMp8RcqwGbHKT6HbiGvSBRvCyxPTxldrwNdR8Pgza OqZg== X-Gm-Message-State: ACrzQf2j6gv9C1GMXZmpz+POxz8c87icq88T21p9QQ16Ig100jZXixZr mTQZyhUgZRzICU/fJ0acd8f77jhb X-Google-Smtp-Source: AMsMyM4IdkIocEjdmg9RJziI21vhGETDkrW4QmcY9brwsZ+WMv1NI5M2g60E2K0do3vEWHaG01XWrQ== X-Received: by 2002:a17:907:75f4:b0:77c:1b9b:96b3 with SMTP id jz20-20020a17090775f400b0077c1b9b96b3mr26829222ejc.459.1664354729827; Wed, 28 Sep 2022 01:45:29 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:2690:b0:457:99eb:cba9 with SMTP id w16-20020a056402269000b0045799ebcba9ls1006657edd.0.-pod-prod-gmail; Wed, 28 Sep 2022 01:45:29 -0700 (PDT) X-Received: by 2002:aa7:cb18:0:b0:452:9071:aff with SMTP id s24-20020aa7cb18000000b0045290710affmr31998969edt.194.1664354728788; Wed, 28 Sep 2022 01:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664354728; cv=none; d=google.com; s=arc-20160816; b=WIcYjA4e8ogE0ikKKij4O2+9ZAj831/6ogbu9wRepSr7ovpr1nzQwZvnlljGtZltEc +Gb3mUks+N6Ql6RCcuFSwwnTSTP5L8Vaup5CxLHOF9vE2SHQS/GFYtMAXfRnW4xubJlz j4mXUwOjjppITaV+X1tbut5xHK2ywz6Mq2d+DnE+hPat9zpwf3ULgfziO9b9S01cBg8n jKzX6TfJVNjFtaOX8AS52XTjQnNkPEaW+2qe56bN3gbPL1wa66oGRBGNxMRk5L0Puvbt Ec4bhzwJIaycs33zDCA6FIFid6CJdosdY50KFrcyAd7g/K3hLqdvjX/c6N7BcgE9+O7T O90Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7Q0/SbwRQ0I7XLRgaDesmTir/HZrBwVaidAAMqNpCXk=; b=IdYW9Qy1c4tERpR2reQD2VY847+a3t9W1PfxP5BsKdt7xlB3pJ5/1dO1CCwoFDnNe6 juUsg4nvrc7IqdY9AWIJumnXSdPpmKiFqye4dG+0A2grui2U+6BsrVdQSPR2Ue8ibhiA Q2YlIlL9KNcVAkTblYq1k0eaNtLkj3HXrbaH47R/hygiC23oqLHkacOUGFJ2lF8IpKXb xTlLqNJBdaZHDp/ITIooLgJOCAHczmts6FjFQJrofEZKMHsaf6/eVNhN9xmygZ8OI3FJ rO/exwAzBiz2ybYoSiwzxYUZUEgD8BTWTlOgElTEZ0LRQV8L+V2VbHD/GPwYNekXIqww Iynw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=big1rEI2; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id k21-20020a170906971500b00783072c0a16sor1732922ejx.87.2022.09.28.01.45.28 for (Google Transport Security); Wed, 28 Sep 2022 01:45:28 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:907:7625:b0:779:e6f7:a669 with SMTP id jy5-20020a170907762500b00779e6f7a669mr26743924ejc.472.1664354728611; Wed, 28 Sep 2022 01:45:28 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-232-92-192.retail.telecomitalia.it. [95.232.92.192]) by smtp.gmail.com with ESMTPSA id q1-20020a50cc81000000b00457618d3409sm2928883edi.68.2022.09.28.01.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:45:28 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi Subject: [PATCH 5/7] mtd: mxs_nand: don't get the gpmi_apbh_dma clock Date: Wed, 28 Sep 2022 10:45:07 +0200 Message-Id: <20220928084509.2758974-6-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> References: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=big1rEI2; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This clock name is not present in any U-boot and Linux kernel device tree. Fixes: commit a59691280daca ("MXS_NAND: Add clock support for iMX8") Signed-off-by: Dario Binacchi --- drivers/mtd/nand/raw/mxs_nand_dt.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/mtd/nand/raw/mxs_nand_dt.c b/drivers/mtd/nand/raw/mxs_nand_dt.c index b9833a646f01..c1e784832f33 100644 --- a/drivers/mtd/nand/raw/mxs_nand_dt.c +++ b/drivers/mtd/nand/raw/mxs_nand_dt.c @@ -143,19 +143,6 @@ static int mxs_nand_dt_probe(struct udevice *dev) debug("Can't enable gpmi_apb_bch clk: %d\n", ret); return ret; } - - /* this clock is used for apbh_dma, since the apbh dma does not support DM, - * we optionally enable it here - */ - ret = clk_get_by_name(dev, "gpmi_apbh_dma", &gpmi_clk); - if (ret < 0) { - debug("Can't get gpmi_apbh_dma clk: %d\n", ret); - } else { - ret = clk_enable(&gpmi_clk); - if (ret < 0) { - debug("Can't enable gpmi_apbh_dma clk: %d\n", ret); - } - } } return mxs_nand_init_ctrl(info); From patchwork Wed Sep 28 08:45:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2399 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 48E8A3F042 for ; Wed, 28 Sep 2022 10:45:31 +0200 (CEST) Received: by mail-ej1-f70.google.com with SMTP id sd4-20020a1709076e0400b00781e6ba94e1sf5079327ejc.1 for ; Wed, 28 Sep 2022 01:45:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664354731; cv=pass; d=google.com; s=arc-20160816; b=ff8bifjwJcz4LYl1K0DXhBWDJCElDKr1btuodnH+XszXWzRlrB4HdcixwioRYkj08K p0gkpKjGxXujptEGKTdoMr/l3vh0nYLVjPLzUnqbOExVfEjEIlq4Ozj43YqIBjupQaYK GyQSewzfXUdzTkNqZTqghmECTs8X8YcQhiw8aR5NHNWwCptPKQ4G5mq05EmNupjhnnUz vpRsNAWJMpcH9WrZh7Ftb9dZzvUEjXNlla/tZni/+dIq0D3wBoRjhx0u7JjX74R6UGZe HyQRTJgi/gZaJhQXoS/BfMknKrXBMbGmefgB0vTLIsOMXvEt89ATbXZs9agTN7CCE7Hr 5/jw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Ts6PHrcG/pXZE8ETll/zfY46RXksO61SAoJMY1tV6is=; b=RgX1s20wEPtO7GRVgJaqZTqgOGUZFcRxf+FWlBovufFGewC/88YfwtsMxTSAniiofP QZfz/gDFKKBTfOt+i2NkN8hWMjlqiSN8KLHJcJUZ1SliaAEURDMpftfoFDcbyCkwseEL BSqiBPCCQ8Eri1R6qDjgeAFuY+C6SUUw1kmSN68zRDoEbP7uhY1WgTGZAQ5ZQ79xUDvX wXYCPk1wIhCCh1XXz1nyql8TTiixL8Xbhm/1MD7VxviitoaZLd4JHF6UHt5XoaDtAhOp j/85uhB3vN33icFQTQlJdYtlqpKP2LuDdH6J3Ww0aTO0KNtK2xF7hMXSYLfgQU98304/ QiLQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DqztypmE; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=Ts6PHrcG/pXZE8ETll/zfY46RXksO61SAoJMY1tV6is=; b=dJHVtWDEzEsm77TzrOJ52miy95hazaaIswLu6+NBS9L9gJ+ja3uC5/rBN9AGJR/Kd3 VHU7qPdG3uISmOZz7g/19XGn3fsjs2qnVlNxj5argaTo3uL5xW/LWnodfIO2uQyWWiMv 1LsP21KLZx5/KlDtUrF18FN/ZXsnN0c2BS3c0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=Ts6PHrcG/pXZE8ETll/zfY46RXksO61SAoJMY1tV6is=; b=PdYcW0B8EELLdPGkvZSkXKQg9lRXHKS7wCl9FZmnKAUkq1HaQJ3fruu6h72uR/Vpn3 sUGErqGgry99ecbnYl2YAGrAJ15seYs5VHcVk8MGuBD+fz0R2wk7L88ljFURJOgcmbXH tlEMvWD6//yGQ/4tUEYdmL4X1SnnzL2QFGyrrMvRx/QzhXytlwJzIFY4GdfdVtptJVcF rk+LeiSmtU4q/tSY8empzpoxEoTPfvx7eMUWqJ+SfbLXzvBtY5/FMxSVbO3whH/EpJnk oLZSKB/QQ6QFiWmujGYQynF+4rHt0LUfc2fnhaNYOmqwY5GlWJCa9wDwVwB/sBTPWzgV p7nA== X-Gm-Message-State: ACrzQf0kWU1LwlaaV10BhRrRme0jGUTnlDNOpf44K/m3w6UZxX5sfaf6 uXOVAez4b0AVxwhYKpG0YMUnigaq X-Google-Smtp-Source: AMsMyM7B+9XdCw+9nzSAahGNSpOZV0yW1LyzOuBfOq7MSGoLhet2Vvxe/Wj4jS7I5hJvCJgojbxGWg== X-Received: by 2002:a17:906:5a71:b0:770:8625:489e with SMTP id my49-20020a1709065a7100b007708625489emr26792604ejc.405.1664354730977; Wed, 28 Sep 2022 01:45:30 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:2808:b0:726:abf9:5f2e with SMTP id r8-20020a170906280800b00726abf95f2els521445ejc.9.-pod-prod-gmail; Wed, 28 Sep 2022 01:45:30 -0700 (PDT) X-Received: by 2002:a17:906:db07:b0:77b:82cf:54af with SMTP id xj7-20020a170906db0700b0077b82cf54afmr27172112ejb.666.1664354729735; Wed, 28 Sep 2022 01:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664354729; cv=none; d=google.com; s=arc-20160816; b=kk3BNWSUcReTfzj7lpQOoNXHAE0QSf7gIv84ezL/RlgFrkjv+pNFeP9vxciuV/m5xP ftgR2DZLIwOIKatmhLL5TF/4nq6YLSGmJZ1SKUKNrN0gEYgRLfhwXN3iCaSdaVXa2nsU D/1vgwaBFJW/A5MD5/StqF1SEMe/+iGQdUdt7O3XTGWbytIamDZ5lLzlMsbc9qQoSNHz MxqHcT0UudlLthRMEIL7aiio5zWE3vTsVFHnAwRCIT8naNQQ6jTcokZgHI2HHkcvdSHH Dn0p/ipoWVHVZPfjL06xeUQu9sCbm3NZpmXiS6NAXt2WMfWej4sajiT05m4KrN7YeNb0 1bKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=WDZRGm0/aBPq9E4otCB/0HB0hOmx8MMpYjuXzovqE4Y=; b=Xbrg5mWxphB9K5DKGMxRorvs/Uw1yBbEsRucVpQzbCBhMwq/57Km44jmrV77JGVXxQ 5Og59eFryrncwbQScFuzvoQwr/i5TtgZ6A16GaVf/Fb/LUu6t8OQanaUAGI3t6vpNwgF q4YZGrYy3SMrNjh18vHzr3s1helKdfUJveNAptnu7cEyzbH4qqtNaTIRkPDzYAMIZDh8 uOb/DGZZ2Zk9a+I/RS9Rz6CxSLZGNgR6DgQb7sZkqLaTMAwxNMer1AOtPGg2GXURXjTG wG2Qvym0GRjueS8HECVJDQE6SfAkdokekh3rDsaD7mA+G4+/MoDrKtqk7vV+qat6d7b7 ZaAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DqztypmE; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id y63-20020a50bb45000000b00457fd1b12f8sor75943ede.13.2022.09.28.01.45.29 for (Google Transport Security); Wed, 28 Sep 2022 01:45:29 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6402:298e:b0:451:129e:1b35 with SMTP id eq14-20020a056402298e00b00451129e1b35mr31781910edb.79.1664354729589; Wed, 28 Sep 2022 01:45:29 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-232-92-192.retail.telecomitalia.it. [95.232.92.192]) by smtp.gmail.com with ESMTPSA id q1-20020a50cc81000000b00457618d3409sm2928883edi.68.2022.09.28.01.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:45:29 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi Subject: [PATCH 6/7] mtd: mxs_nand: get the clock with the right name Date: Wed, 28 Sep 2022 10:45:08 +0200 Message-Id: <20220928084509.2758974-7-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> References: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DqztypmE; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Rename the gpmi_apb_bch clock name to gpmi_bch_apb, as you can find in the device tree. Fixes: commit a59691280daca ("MXS_NAND: Add clock support for iMX8") Signed-off-by: Dario Binacchi --- drivers/mtd/nand/raw/mxs_nand_dt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/mxs_nand_dt.c b/drivers/mtd/nand/raw/mxs_nand_dt.c index c1e784832f33..94ee7ed9ec83 100644 --- a/drivers/mtd/nand/raw/mxs_nand_dt.c +++ b/drivers/mtd/nand/raw/mxs_nand_dt.c @@ -132,15 +132,15 @@ static int mxs_nand_dt_probe(struct udevice *dev) return ret; } - ret = clk_get_by_name(dev, "gpmi_apb_bch", &gpmi_clk); + ret = clk_get_by_name(dev, "gpmi_bch_apb", &gpmi_clk); if (ret < 0) { - debug("Can't get gpmi_apb_bch clk: %d\n", ret); + debug("Can't get gpmi_bch_apb clk: %d\n", ret); return ret; } ret = clk_enable(&gpmi_clk); if (ret < 0) { - debug("Can't enable gpmi_apb_bch clk: %d\n", ret); + debug("Can't enable gpmi_bch_apb clk: %d\n", ret); return ret; } } From patchwork Wed Sep 28 08:45:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2400 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 484343F042 for ; Wed, 28 Sep 2022 10:45:32 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id t13-20020a056402524d00b00452c6289448sf9809366edd.17 for ; Wed, 28 Sep 2022 01:45:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664354732; cv=pass; d=google.com; s=arc-20160816; b=uvohKZqfhu0fYPzblJGDcEULK45tjroarzoy/I1jBDeXYCQX3Hcw5gVSzderwB56iN 9/BVU6ymh0a8f2zuAp3Qmv+4r6g04aL2/wok7ZrolNbB6dY4Bmfklqv/d5sdFAAiq6hD d+l4+843UnMnXmPOKF+leuQAyX31CetTFObJxAGHRcAGpSL1xuwiVIJ+MvCVq7dFekNz 9ZviV6syFh/K718PNcO8pawl43nheCbHBvOA26DMYc0q84D7kmX/SfODJlsuE1c8XrIz aXE24dCRtpitcV4h7LiW6fDeaZqlB3TtmvjvxBGZqmxUKwaRpatuxMNsRNmKWbTjuIeN hTjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=LV7oIzdsJs8EQmlraCTD7VRWL5qftLUVyxG1Q8mJCgM=; b=Q5HhBuO6RQY+f5y3DrqXSl6lYltnyyIQvVmfVcLO+DOgeOApPpXkof3qoPODk2xi90 1p0Ug/YLGkq7g6Gyiz65G0u3Oa0K74iXPhyRsx0LfyWTzXHY6koo1qTQ8Uc3SyXx3LyF kT4WCgvuNFLYgBilZpy7oGV0wVCs+Szx8cJUQISORWYfs8NjP7Ln5o/OUe3P+BvJv/FV M5DTUsE3d1UGdcMix3okvmHObq9k/FRL+nCv5763U4ldOtBpFdRhsh5d+LghiBPw6HiL 7uQoPyZ0EK6q7dlGQCtj2pzpCL/Sf0ew/hWDRQQI/9I0FOu6shsmn1jXyRyxexhkP2D7 QR7g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IS1RItaW; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=LV7oIzdsJs8EQmlraCTD7VRWL5qftLUVyxG1Q8mJCgM=; b=cYZv079JWrXJ57oxXx+Vcqj6ApnNdR5qcpu9S1XQAs24u+Pt6ViFvzjZoR1BAN1dZx kCK8fZytspCgKxJ+ZGj+YOn9IqyMUh9fYbyFZW78kLsoqUcoPHxYy3iCaBjNi3TGUjBM 8QE4YeC1Mic8wn/1mLcBVxbeO18rwFLbgpy38= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=LV7oIzdsJs8EQmlraCTD7VRWL5qftLUVyxG1Q8mJCgM=; b=sZdSCqdVMVz75+GW5fTOdj8HuEuD7NT1ArreOhC40swv6mJDumVWKs0NdYV6CXcEI5 v6IRq4rTWr4Mzp2AEA+BjUBW8IgZMbvnQ1nnQ/upqdAyJxVjY97hBb3h+P6f+I7uaL0l /ohUeb69lpCGmwIByXHtLLacu5lbmqrkPfgoE/ivHb00kXN3lydcWTBZN01UXMFufMYY KatWX+UgE8tQirHKwuZxsD5NE0R0NvFirXB3kgHz3+QxYhvmTSr0BFe0HctzKtgVhBGn gsBL3cNottZyHuevbW4CADVU8D0icdwEVAQE4NBRuBHvmtuLu5EVZIEvhkWl0BvKM/s1 P5AA== X-Gm-Message-State: ACrzQf3vGrBB3P7k3vKyQ3fArkYgFcRfztRsfQHHuPjodmeENGjotwlr GVomL2Z81RYsVpcrD3sdjx8zkSKp X-Google-Smtp-Source: AMsMyM4waVqt7BYDpfl81gsf8BxfN9+ajJHGNMZ0Ibk9J3lDvMsK6p+2OQoA1mAKHpi/73zS7w9tgQ== X-Received: by 2002:a17:906:eeca:b0:730:6880:c398 with SMTP id wu10-20020a170906eeca00b007306880c398mr26775893ejb.706.1664354732029; Wed, 28 Sep 2022 01:45:32 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:348a:b0:783:b20:46a0 with SMTP id g10-20020a170906348a00b007830b2046a0ls513831ejb.6.-pod-prod-gmail; Wed, 28 Sep 2022 01:45:31 -0700 (PDT) X-Received: by 2002:a17:907:2cca:b0:77d:6542:d912 with SMTP id hg10-20020a1709072cca00b0077d6542d912mr26598915ejc.528.1664354730853; Wed, 28 Sep 2022 01:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664354730; cv=none; d=google.com; s=arc-20160816; b=yofjiB5y9Hclw5ir2K2vIqvqEy+zm7EcBBJ0kDX7DAMg03MymJ8q37gBtBp49B2UKe 9sLd5y9wgA3FyqN0QlkyRWZLBaVkQtnHzhbFzMjECdt32HKFs/JSJX7kq83wOpFVhShV OqRHLbp3pX89Spxnq/8GY3JORxRTpwWr6021Ky27aMcCdjPw6pfPgAVsXW9fsNeD2EMF bJ+gHtUQPVlNm0/d1uDthOMh72tLKqNt9an05obu76U5s1ClZId99m3aF3NS/urA5lnj yEjcmpGHv4UWhn/WZwLrkEgu4L/lo/arPM8CddOpA7UB7l+0vFg67ayG5SfSC8AaKhRk 2QsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=zD5sizCJ0c8j0o2a5Do7sQNp08/BX94TooD/v2J1nZ0=; b=ooIlXerhzrFMFvaEjHSqUEW09IaHkjubiGK4SLLKX0g+bcoCoZUTvATQiXtxAhFS6F 8IX4W3QKPT6X5J1RDZj1F+KmeedO7RPyRiGyz5xcZk+vLUr528mG6A7n4rKfh1JSqK/A P2uGbtsQHrmD03cQnwW14xY/nEOVuGGghGFSiZDK7JkuxKG/IrsUT7D3uuFhXuqQ2yxU kRt1FZq5JEosv6BF0zjB/OsTl5AP5QHKgBLJKDm2zPo2kJcUpd89M8EsZw00gS3wP0NH ThoR4hRnn8D3wtcz1udXaF3sAs89ObAGF55+H7jmw9JclU25Oe8WSmrKGI7W/H8pXAcd 4/+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IS1RItaW; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id t2-20020a50d702000000b00456913695besor2285999edi.15.2022.09.28.01.45.30 for (Google Transport Security); Wed, 28 Sep 2022 01:45:30 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6402:1f06:b0:457:149d:beaa with SMTP id b6-20020a0564021f0600b00457149dbeaamr19378567edb.238.1664354730529; Wed, 28 Sep 2022 01:45:30 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-232-92-192.retail.telecomitalia.it. [95.232.92.192]) by smtp.gmail.com with ESMTPSA id q1-20020a50cc81000000b00457618d3409sm2928883edi.68.2022.09.28.01.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:45:30 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Han Xu , Miquel Raynal Subject: [PATCH 7/7] mtd: mxs_nand: Support EDO mode for imx8mn architecture Date: Wed, 28 Sep 2022 10:45:09 +0200 Message-Id: <20220928084509.2758974-8-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> References: <20220928084509.2758974-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IS1RItaW; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Michael Trimarchi Add support for imx8mn architecture in order to run the NAND in fast edo mode. Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- drivers/mtd/nand/raw/mxs_nand.c | 200 +++++++++++++++++++++++++++++ drivers/mtd/nand/raw/mxs_nand_dt.c | 66 ++++++---- include/mxs_nand.h | 3 + 3 files changed, 242 insertions(+), 27 deletions(-) diff --git a/drivers/mtd/nand/raw/mxs_nand.c b/drivers/mtd/nand/raw/mxs_nand.c index 7893e9d7e343..65eab4c8088a 100644 --- a/drivers/mtd/nand/raw/mxs_nand.c +++ b/drivers/mtd/nand/raw/mxs_nand.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -26,10 +27,12 @@ #include #include #include +#include #include #include #include #include +#include #define MXS_NAND_DMA_DESCRIPTOR_COUNT 4 @@ -49,6 +52,10 @@ #endif #define MXS_NAND_BCH_TIMEOUT 10000 +#define USEC_PER_SEC 1000000 +#define NSEC_PER_SEC 1000000000L + +#define TO_CYCLES(duration, period) DIV_ROUND_UP_ULL(duration, period) struct nand_ecclayout fake_ecc_layout; @@ -1344,6 +1351,196 @@ err1: return ret; } +/* + * <1> Firstly, we should know what's the GPMI-clock means. + * The GPMI-clock is the internal clock in the gpmi nand controller. + * If you set 100MHz to gpmi nand controller, the GPMI-clock's period + * is 10ns. Mark the GPMI-clock's period as GPMI-clock-period. + * + * <2> Secondly, we should know what's the frequency on the nand chip pins. + * The frequency on the nand chip pins is derived from the GPMI-clock. + * We can get it from the following equation: + * + * F = G / (DS + DH) + * + * F : the frequency on the nand chip pins. + * G : the GPMI clock, such as 100MHz. + * DS : GPMI_HW_GPMI_TIMING0:DATA_SETUP + * DH : GPMI_HW_GPMI_TIMING0:DATA_HOLD + * + * <3> Thirdly, when the frequency on the nand chip pins is above 33MHz, + * the nand EDO(extended Data Out) timing could be applied. + * The GPMI implements a feedback read strobe to sample the read data. + * The feedback read strobe can be delayed to support the nand EDO timing + * where the read strobe may deasserts before the read data is valid, and + * read data is valid for some time after read strobe. + * + * The following figure illustrates some aspects of a NAND Flash read: + * + * |<---tREA---->| + * | | + * | | | + * |<--tRP-->| | + * | | | + * __ ___|__________________________________ + * RDN \________/ | + * | + * /---------\ + * Read Data --------------< >--------- + * \---------/ + * | | + * |<-D->| + * FeedbackRDN ________ ____________ + * \___________/ + * + * D stands for delay, set in the HW_GPMI_CTRL1:RDN_DELAY. + * + * + * <4> Now, we begin to describe how to compute the right RDN_DELAY. + * + * 4.1) From the aspect of the nand chip pins: + * Delay = (tREA + C - tRP) {1} + * + * tREA : the maximum read access time. + * C : a constant to adjust the delay. default is 4000ps. + * tRP : the read pulse width, which is exactly: + * tRP = (GPMI-clock-period) * DATA_SETUP + * + * 4.2) From the aspect of the GPMI nand controller: + * Delay = RDN_DELAY * 0.125 * RP {2} + * + * RP : the DLL reference period. + * if (GPMI-clock-period > DLL_THRETHOLD) + * RP = GPMI-clock-period / 2; + * else + * RP = GPMI-clock-period; + * + * Set the HW_GPMI_CTRL1:HALF_PERIOD if GPMI-clock-period + * is greater DLL_THRETHOLD. In other SOCs, the DLL_THRETHOLD + * is 16000ps, but in mx6q, we use 12000ps. + * + * 4.3) since {1} equals {2}, we get: + * + * (tREA + 4000 - tRP) * 8 + * RDN_DELAY = ----------------------- {3} + * RP + */ +static void mxs_compute_timings(struct nand_chip *chip, + const struct nand_sdr_timings *sdr) +{ + struct mxs_nand_info *nand_info = nand_get_controller_data(chip); + unsigned long clk_rate; + unsigned int dll_wait_time_us; + unsigned int dll_threshold_ps = nand_info->max_chain_delay; + unsigned int period_ps, reference_period_ps; + unsigned int data_setup_cycles, data_hold_cycles, addr_setup_cycles; + unsigned int tRP_ps; + bool use_half_period; + int sample_delay_ps, sample_delay_factor; + u16 busy_timeout_cycles; + u8 wrn_dly_sel; + u32 timing0; + u32 timing1; + u32 ctrl1n; + + if (sdr->tRC_min >= 30000) { + /* ONFI non-EDO modes [0-3] */ + clk_rate = 22000000; + wrn_dly_sel = GPMI_CTRL1_WRN_DLY_SEL_4_TO_8NS; + } else if (sdr->tRC_min >= 25000) { + /* ONFI EDO mode 4 */ + clk_rate = 80000000; + wrn_dly_sel = GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY; + debug("%s, setting ONFI onfi edo 4\n", __func__); + } else { + /* ONFI EDO mode 5 */ + clk_rate = 100000000; + wrn_dly_sel = GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY; + debug("%s, setting ONFI onfi edo 5\n", __func__); + } + + /* SDR core timings are given in picoseconds */ + period_ps = div_u64((u64)NSEC_PER_SEC * 1000, clk_rate); + + addr_setup_cycles = TO_CYCLES(sdr->tALS_min, period_ps); + data_setup_cycles = TO_CYCLES(sdr->tDS_min, period_ps); + data_hold_cycles = TO_CYCLES(sdr->tDH_min, period_ps); + busy_timeout_cycles = TO_CYCLES(sdr->tWB_max + sdr->tR_max, period_ps); + + timing0 = (addr_setup_cycles << GPMI_TIMING0_ADDRESS_SETUP_OFFSET) | + (data_hold_cycles << GPMI_TIMING0_DATA_HOLD_OFFSET) | + (data_setup_cycles << GPMI_TIMING0_DATA_SETUP_OFFSET); + timing1 = (busy_timeout_cycles * 4096) << GPMI_TIMING1_DEVICE_BUSY_TIMEOUT_OFFSET; + + /* + * Derive NFC ideal delay from {3}: + * + * (tREA + 4000 - tRP) * 8 + * RDN_DELAY = ----------------------- + * RP + */ + if (period_ps > dll_threshold_ps) { + use_half_period = true; + reference_period_ps = period_ps / 2; + } else { + use_half_period = false; + reference_period_ps = period_ps; + } + + tRP_ps = data_setup_cycles * period_ps; + sample_delay_ps = (sdr->tREA_max + 4000 - tRP_ps) * 8; + if (sample_delay_ps > 0) + sample_delay_factor = sample_delay_ps / reference_period_ps; + else + sample_delay_factor = 0; + + ctrl1n = (wrn_dly_sel << GPMI_CTRL1_WRN_DLY_SEL_OFFSET); + if (sample_delay_factor) + ctrl1n |= (sample_delay_factor << GPMI_CTRL1_RDN_DELAY_OFFSET) | + GPMI_CTRL1_DLL_ENABLE | + (use_half_period ? GPMI_CTRL1_HALF_PERIOD : 0); + + writel(timing0, &nand_info->gpmi_regs->hw_gpmi_timing0); + writel(timing1, &nand_info->gpmi_regs->hw_gpmi_timing1); + + /* + * Clear several CTRL1 fields, DLL must be disabled when setting + * RDN_DELAY or HALF_PERIOD. + */ + writel(GPMI_CTRL1_CLEAR_MASK, &nand_info->gpmi_regs->hw_gpmi_ctrl1_clr); + writel(ctrl1n, &nand_info->gpmi_regs->hw_gpmi_ctrl1_set); + + clk_set_rate(nand_info->gpmi_clk, clk_rate); + + /* Wait 64 clock cycles before using the GPMI after enabling the DLL */ + dll_wait_time_us = USEC_PER_SEC / clk_rate * 64; + if (!dll_wait_time_us) + dll_wait_time_us = 1; + + /* Wait for the DLL to settle. */ + udelay(dll_wait_time_us); +} + +static int mxs_nand_setup_interface(struct mtd_info *mtd, int chipnr, + const struct nand_data_interface *conf) +{ + struct nand_chip *chip = mtd_to_nand(mtd); + const struct nand_sdr_timings *sdr; + + sdr = nand_get_sdr_timings(conf); + if (IS_ERR(sdr)) + return PTR_ERR(sdr); + + /* Stop here if this call was just a check */ + if (chipnr < 0) + return 0; + + /* Do the actual derivation of the controller timings */ + mxs_compute_timings(chip, sdr); + + return 0; +} + int mxs_nand_init_spl(struct nand_chip *nand) { struct mxs_nand_info *nand_info; @@ -1432,6 +1629,9 @@ int mxs_nand_init_ctrl(struct mxs_nand_info *nand_info) nand->read_buf = mxs_nand_read_buf; nand->write_buf = mxs_nand_write_buf; + if (nand_info->gpmi_clk) + nand->setup_data_interface = mxs_nand_setup_interface; + /* first scan to find the device and get the page size */ if (nand_scan_ident(mtd, CONFIG_SYS_MAX_NAND_DEVICE, NULL)) goto err_free_buffers; diff --git a/drivers/mtd/nand/raw/mxs_nand_dt.c b/drivers/mtd/nand/raw/mxs_nand_dt.c index 94ee7ed9ec83..a922a22b2730 100644 --- a/drivers/mtd/nand/raw/mxs_nand_dt.c +++ b/drivers/mtd/nand/raw/mxs_nand_dt.c @@ -22,22 +22,27 @@ struct mxs_nand_dt_data { unsigned int max_ecc_strength_supported; + int max_chain_delay; /* See the async EDO mode */ }; static const struct mxs_nand_dt_data mxs_nand_imx6q_data = { .max_ecc_strength_supported = 40, + .max_chain_delay = 12000, }; static const struct mxs_nand_dt_data mxs_nand_imx6sx_data = { .max_ecc_strength_supported = 62, + .max_chain_delay = 12000, }; static const struct mxs_nand_dt_data mxs_nand_imx7d_data = { .max_ecc_strength_supported = 62, + .max_chain_delay = 12000, }; static const struct mxs_nand_dt_data mxs_nand_imx8qxp_data = { .max_ecc_strength_supported = 62, + .max_chain_delay = 12000, }; static const struct udevice_id mxs_nand_dt_ids[] = { @@ -72,8 +77,10 @@ static int mxs_nand_dt_probe(struct udevice *dev) int ret; data = (void *)dev_get_driver_data(dev); - if (data) + if (data) { info->max_ecc_strength_supported = data->max_ecc_strength_supported; + info->max_chain_delay = data->max_chain_delay; + } info->dev = dev; @@ -92,44 +99,49 @@ static int mxs_nand_dt_probe(struct udevice *dev) info->use_minimum_ecc = dev_read_bool(dev, "fsl,use-minimum-ecc"); - if (IS_ENABLED(CONFIG_CLK) && IS_ENABLED(CONFIG_IMX8)) { + if (IS_ENABLED(CONFIG_CLK) && + (IS_ENABLED(CONFIG_IMX8) || IS_ENABLED(CONFIG_IMX8M))) { /* Assigned clock already set clock */ struct clk gpmi_clk; - ret = clk_get_by_name(dev, "gpmi_io", &gpmi_clk); - if (ret < 0) { + info->gpmi_clk = devm_clk_get(dev, "gpmi_io"); + + if (IS_ERR(info->gpmi_clk)) { + ret = PTR_ERR(info->gpmi_clk); debug("Can't get gpmi io clk: %d\n", ret); return ret; } - ret = clk_enable(&gpmi_clk); + ret = clk_enable(info->gpmi_clk); if (ret < 0) { debug("Can't enable gpmi io clk: %d\n", ret); return ret; } - ret = clk_get_by_name(dev, "gpmi_apb", &gpmi_clk); - if (ret < 0) { - debug("Can't get gpmi_apb clk: %d\n", ret); - return ret; - } - - ret = clk_enable(&gpmi_clk); - if (ret < 0) { - debug("Can't enable gpmi_apb clk: %d\n", ret); - return ret; - } - - ret = clk_get_by_name(dev, "gpmi_bch", &gpmi_clk); - if (ret < 0) { - debug("Can't get gpmi_bch clk: %d\n", ret); - return ret; - } - - ret = clk_enable(&gpmi_clk); - if (ret < 0) { - debug("Can't enable gpmi_bch clk: %d\n", ret); - return ret; + if (IS_ENABLED(CONFIG_IMX8)) { + ret = clk_get_by_name(dev, "gpmi_apb", &gpmi_clk); + if (ret < 0) { + debug("Can't get gpmi_apb clk: %d\n", ret); + return ret; + } + + ret = clk_enable(&gpmi_clk); + if (ret < 0) { + debug("Can't enable gpmi_apb clk: %d\n", ret); + return ret; + } + + ret = clk_get_by_name(dev, "gpmi_bch", &gpmi_clk); + if (ret < 0) { + debug("Can't get gpmi_bch clk: %d\n", ret); + return ret; + } + + ret = clk_enable(&gpmi_clk); + if (ret < 0) { + debug("Can't enable gpmi_bch clk: %d\n", ret); + return ret; + } } ret = clk_get_by_name(dev, "gpmi_bch_apb", &gpmi_clk); diff --git a/include/mxs_nand.h b/include/mxs_nand.h index 741dc8734eae..bb5b84b8c26e 100644 --- a/include/mxs_nand.h +++ b/include/mxs_nand.h @@ -12,6 +12,7 @@ #include #include #include +#include /** * @gf_len: The length of Galois Field. (e.g., 13 or 14) @@ -43,6 +44,7 @@ struct mxs_nand_info { struct nand_chip chip; struct udevice *dev; unsigned int max_ecc_strength_supported; + int max_chain_delay; bool use_minimum_ecc; int cur_chip; @@ -59,6 +61,7 @@ struct mxs_nand_info { struct mxs_gpmi_regs *gpmi_regs; struct mxs_bch_regs *bch_regs; + struct clk *gpmi_clk; /* Functions with altered behaviour */ int (*hooked_read_oob)(struct mtd_info *mtd,