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 D5167C4332F for ; Wed, 4 Jan 2023 17:51:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D94438551E; Wed, 4 Jan 2023 18:51:31 +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="VRsnzayT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 65A3D85515; Wed, 4 Jan 2023 18:51:30 +0100 (CET) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 106418551E for ; Wed, 4 Jan 2023 18:51:27 +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=seanga2@gmail.com Received: by mail-qt1-x82b.google.com with SMTP id x11so27781986qtv.13 for ; Wed, 04 Jan 2023 09:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=TKOzo+/MWYYBPO6EuT6HTlMDPHk/gltbl+XCB4fvYX4=; b=VRsnzayT0onDveWyd+a3DjJ5ew/qFx0n6evH+A4Qi4LfPIVu9HYSEPoamnZB2Gag/y hmrGOBy2taA5jd0Rz6upKOY+SLrKyVOKPm4RFR+3UboLgTyxwrpcdHBrRc5LO1fr0CUF eJZ1emHJp0FwyQa9bBREvQqdKRuwGF0yDO3jp1Oa79kWNhJvSDItdoUN08hvzTRHADMp eLuY/AGi9+H80T3WdT8BEMYldwdYgeHRgELJ+NvHgjdNEVjWWmqoZDqbi9g8XujJwCin 0JhToOsvIcTukD3hezt/23K2ALOg3uzejtT01DUmIGSMXycs+3Dfv+LwnKYQ7gv8aQR5 ejKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TKOzo+/MWYYBPO6EuT6HTlMDPHk/gltbl+XCB4fvYX4=; b=2n3TpmX9C5Tf1gZ1TUn8Wsn+YBNdJlxZ2bBk8n/aFKOgHMe0gEP+DHVqvenhirdUDD UdIcIZFPcv32MMOE6zfyuVrMWJ8FDHWQ2IA18yFnTWUB+dn0LW/3bznimuND2dTs7qYG AbXVR+tuH/NrSxgiNw9UQseurBQGUO42QMZRTH22+9R1rke813E0Z+eO86+HSSBUY4bz CqEcwSPkLIYkPSrQ7gCkJTT58gWBaH7H+4MVZbAEILPgOL//igorF/nDn64Zi7OQ7dtG r323g/gY0SiEyhQmbLqRjbg+TXYJCJgZkJqGgKUqHr6C3EvxrAectwTYn4AfSs3EPp06 U1CA== X-Gm-Message-State: AFqh2krAyBU4VirjHOazo0LwSzmxViFHex15kQNPw8lCQj9sSe4dKCc6 YIANH2OsGFZGzZY2LwjkqB0= X-Google-Smtp-Source: AMrXdXt/kp+Fj5H1ul9CIQJ6vFa7BzSgfsw9RWfS1lLmNWlvjtoe8aHFBLim/tFqtByakFqbYMb3sw== X-Received: by 2002:ac8:75d9:0:b0:3a8:1ef2:7c6b with SMTP id z25-20020ac875d9000000b003a81ef27c6bmr62405022qtq.13.1672854685909; Wed, 04 Jan 2023 09:51:25 -0800 (PST) Received: from [192.168.1.201] (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with ESMTPSA id c9-20020ac85189000000b003a54a19c550sm20504605qtn.57.2023.01.04.09.51.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Jan 2023 09:51:25 -0800 (PST) Message-ID: <3be4dbdc-a80a-247f-6103-31d9b64c1e40@gmail.com> Date: Wed, 4 Jan 2023 12:51:23 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v5 05/19] clk: at91: sam9x60: Add initial setup of UPLL and USBCK rates Content-Language: en-US To: Sergiu Moga , eugen.hristev@microchip.com, durai.manickamkr@microchip.com, sandeep.sheriker@microchip.com, greg@embeddedgreg.com, nicolas.ferre@microchip.com, ludovic.desroches@microchip.com, lukma@denx.de, marex@denx.de, michael@walle.cc, hs@denx.de, claudiu.beznea@microchip.com, balamanikandan.gunasundar@microchip.com, michael@amarulasolutions.com, dario.binacchi@amarulasolutions.com, cristian.birsan@microchip.com, peng.fan@nxp.com, mihai.sain@microchip.com, weijie.gao@mediatek.com, sumit.garg@linaro.org, jim.t90615@gmail.com, michal.simek@amd.com, sjg@chromium.org, j-keerthy@ti.com, ashok.reddy.soma@xilinx.com Cc: u-boot@lists.denx.de References: <20221222105357.105457-1-sergiu.moga@microchip.com> <20221222105357.105457-6-sergiu.moga@microchip.com> From: Sean Anderson In-Reply-To: <20221222105357.105457-6-sergiu.moga@microchip.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean On 12/22/22 05:53, Sergiu Moga wrote: > In order for some of the functionalities, such as the USB clocks, > to work properly we need some clocks to be properly initialised > at the very beginning of booting. > > Signed-off-by: Sergiu Moga > --- > > > v1 -> v2: > - Adapted according to the additional 04/19 PATCH, now making use of > `at91_clk_setup` > > > > v2 -> v5: > - No change > > > > drivers/clk/at91/sam9x60.c | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c > index 14c2ffcac1..e2f72446d5 100644 > --- a/drivers/clk/at91/sam9x60.c > +++ b/drivers/clk/at91/sam9x60.c > @@ -378,6 +378,31 @@ static const struct { > { .n = "dbgu_gclk", .id = 47, }, > }; > > +/** > + * Clock setup description > + * @cid: clock id corresponding to clock subsystem > + * @pid: parent clock id corresponding to clock subsystem > + * @rate: clock rate > + * @prate: parent rate > + */ It's not necessary to document structs where they are used. > +static const struct pmc_clk_setup sam9x60_clk_setup[] = { > + { > + .cid = AT91_TO_CLK_ID(PMC_TYPE_CORE, ID_PLL_U_FRAC), > + .rate = 960000000, > + }, > + > + { > + .cid = AT91_TO_CLK_ID(PMC_TYPE_CORE, ID_PLL_U_DIV), > + .rate = 480000000, > + }, > + > + { > + .cid = AT91_TO_CLK_ID(PMC_TYPE_CORE, ID_USBCK), > + .pid = AT91_TO_CLK_ID(PMC_TYPE_CORE, ID_PLL_U_DIV), > + .rate = 48000000, > + }, > +}; > + > #define prepare_mux_table(_allocs, _index, _dst, _src, _num, _label) \ > do { \ > int _i; \ > @@ -668,6 +693,11 @@ static int sam9x60_clk_probe(struct udevice *dev) > clk_dm(AT91_TO_CLK_ID(PMC_TYPE_GCK, sam9x60_gck[i].id), c); > } > > + /* Setup clocks. */ > + ret = at91_clk_setup(sam9x60_clk_setup, ARRAY_SIZE(sam9x60_clk_setup)); > + if (ret) > + goto fail; > + > return 0; > > fail: With that fixed: Acked-by: Sean Anderson