Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 54D12C433EF for ; Mon, 6 Dec 2021 16:30:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6F915830A7; Mon, 6 Dec 2021 17:29:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fMTASEBt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3061B83084; Mon, 6 Dec 2021 17:29:50 +0100 (CET) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D66DE8307B for ; Mon, 6 Dec 2021 17:29:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=aford173@gmail.com Received: by mail-qk1-x734.google.com with SMTP id i9so11692908qki.3 for ; Mon, 06 Dec 2021 08:29:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KXFhyzKRIvHnO5KiF3PNKxdbl8UnUN6CVHjU9SmY5f8=; b=fMTASEBtzTXCrXzyo8r81btVm7XclMvc9DR4E4TLymYzCqzZ1K9D1OkLcSgemh3R9n +YNjigEU/6Azhuz6S4q7IIn5RKMvj2pep207VmYFQvrpodJk2jboI6/f/GcEUtLR71tz 6sg9nYiFsOSNM+f0uAAzrzVfi5xmlIfQomrn2bK0GIQ1PDAHym3XKlP2U1CtzTPPpHhk wHksXsp/ELdBduMqO6S0ycBzgv4VcMMFA8RD8bMmlWDtXnE2KdcIYIISSNlV3VrQYG1v vNYev1LwrzayhTl/+mnz4hVcnGXqq8tyWUmZKIpSGwOoxgvqA9YYCHDTKESOLHKIzJxw EfoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KXFhyzKRIvHnO5KiF3PNKxdbl8UnUN6CVHjU9SmY5f8=; b=zbB60RvL1PkmDO6jddMk+faXeCoftiz2i8VemyN2dmFZLyHG0MxesC6SvmkdRB4Oym cBe1v6BMp1BTFWTvsEMt7gTd+3qb8/tcmHkdSiAP1WGNEJxdioH7lUS/Cg4GbxYha0oE yIr/ewhheMkLT+bgRrcCSF7dsHsPE1v9sUpqx/aYvNtykNMDGJyUcoewUVtxNVIK/nZ3 GRi1sXVMwoK1yS96lm6QbZMWBOOMFbpMindRM3JHm+ApLxKH6NABnYvEN9INp5ReF4Ue FBflhef9pOPeeHaExPi517YvcyCQyEMqO1hkunWykbF29Z/RPYrfSKX1O45RBMaRyY9a tADw== X-Gm-Message-State: AOAM532OMNaRMJxEoBeCrZkS0YhmpBT+Zl+0FMcwX8c6AyKiNmPUzcDA NpoBLzatnI7vN4n6U5hiM7CO5eGAxLc= X-Google-Smtp-Source: ABdhPJxYCnJ7Rtlu4+rjoejL+YIiMYAqvOP7LYgwZhR0dKFfNu2PZ+xFysP6BNT56K10urgtVQxk0A== X-Received: by 2002:a05:620a:f05:: with SMTP id v5mr33412854qkl.46.1638808185259; Mon, 06 Dec 2021 08:29:45 -0800 (PST) Received: from aford-OptiPlex-7050.logicpd.com ([174.46.170.158]) by smtp.gmail.com with ESMTPSA id d6sm7172526qtq.15.2021.12.06.08.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Dec 2021 08:29:44 -0800 (PST) From: Adam Ford To: u-boot@lists.denx.de Cc: marek.vasut+renesas@gmail.com, joe.hershberger@ni.com, rfried.dev@gmail.com, Adam Ford Subject: [PATCH 1/5] net: ravb: Support multiple clocks Date: Mon, 6 Dec 2021 10:29:26 -0600 Message-Id: <20211206162930.56301-2-aford173@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211206162930.56301-1-aford173@gmail.com> References: <20211206162930.56301-1-aford173@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean The RZ/G2 series uses an external clock as a reference to the AVB. If this clock is controlled by an external programmable clock, it must be requested by the consumer or it will not turn on. In order to do this, update the driver to use bulk enable and disable functions to enable clocks for boards with multiple clocks. Signed-off-by: Adam Ford --- drivers/net/ravb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c index 6953b7286a..d756dddb02 100644 --- a/drivers/net/ravb.c +++ b/drivers/net/ravb.c @@ -129,7 +129,7 @@ struct ravb_priv { struct phy_device *phydev; struct mii_dev *bus; void __iomem *iobase; - struct clk clk; + struct clk_bulk clks; struct gpio_desc reset_gpio; }; @@ -485,7 +485,7 @@ static int ravb_probe(struct udevice *dev) iobase = map_physmem(pdata->iobase, 0x1000, MAP_NOCACHE); eth->iobase = iobase; - ret = clk_get_by_index(dev, 0, ð->clk); + ret = clk_get_bulk(dev, ð->clks); if (ret < 0) goto err_mdio_alloc; @@ -518,7 +518,7 @@ static int ravb_probe(struct udevice *dev) eth->bus = miiphy_get_dev_by_name(dev->name); /* Bring up PHY */ - ret = clk_enable(ð->clk); + ret = clk_enable_bulk(ð->clks); if (ret) goto err_mdio_register; @@ -533,7 +533,7 @@ static int ravb_probe(struct udevice *dev) return 0; err_mdio_reset: - clk_disable(ð->clk); + clk_release_bulk(ð->clks); err_mdio_register: mdio_free(mdiodev); err_mdio_alloc: @@ -545,7 +545,7 @@ static int ravb_remove(struct udevice *dev) { struct ravb_priv *eth = dev_get_priv(dev); - clk_disable(ð->clk); + clk_release_bulk(ð->clks); free(eth->phydev); mdio_unregister(eth->bus); -- 2.32.0