From nobody Wed Jun 21 15:59:15 2023 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QmSqc0QHwz4gHfy for ; Wed, 21 Jun 2023 15:59:24 +0000 (UTC) (envelope-from titus@edc.ro) Received: from eatlas.ro (eatlas.ro [86.126.82.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "eatlas.ro", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QmSqb3N7Fz467K for ; Wed, 21 Jun 2023 15:59:23 +0000 (UTC) (envelope-from titus@edc.ro) Authentication-Results: mx1.freebsd.org; none Received: from mail.edc.ro ([10.1.4.58]) by eatlas.ro (8.16.1/8.16.1) with ESMTPS id 35LFxGpW036865 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 21 Jun 2023 18:59:16 +0300 (EEST) (envelope-from titus@edc.ro) Received: from tituss-imac.eatlas.local (eatlas.ro [86.126.82.18]) (authenticated bits=0) by mail.edc.ro (8.16.1/8.16.1) with ESMTPSA id 35LFxDcp010723 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Jun 2023 18:59:14 +0300 (EEST) (envelope-from titus@edc.ro) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=edc.ro; s=mail; t=1687363154; bh=DBid7h5FL55+6N70agF65ByJ3S3N4fQHoOFh8w0JIgI=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=Tn2U1mwzd5oCkMKt9PwtBgKoMeMOoClEJVakuKI2l9gPpZxiV97+GlqALGVQ6etnQ QNQT2O7b+m5+SwztG874DJLo6KEZHOPrSRxl53cHsIafmTpMy5d3IXsOY1DOKgcM67 FSzZdEiQSr7hYmGNDmITaic4SSG1yHa/1rXt2Sq8= Content-Type: text/plain; charset=utf-8 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: h616 clocks From: titus In-Reply-To: <20230621155551.5c6a2db2ad87c08c7d2ec7f2@bidouilliste.com> Date: Wed, 21 Jun 2023 18:59:15 +0300 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20230621155551.5c6a2db2ad87c08c7d2ec7f2@bidouilliste.com> To: Emmanuel Vadot X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ns.edc.ro X-Rspamd-Queue-Id: 4QmSqb3N7Fz467K X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8708, ipnet:86.120.0.0/13, country:RO] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Thanks for the answer.=20 the line was =E2=80=9Cadjusted=E2=80=9D copied from the linux driver=20 im not sure which clocks are mandatory to have a h616 board working = (uart, sdmmc, usb, ethernet will suffice)=20 i just saw that there are more clocks in the linux driver than in the = freebsd h6 driver but probably the ones defined for h6 in freebsd will = suffice for my goal i do not have a h616 board yet but i will get one in several days and i = hopefully can test its not quite a development board but an android tv box which should = have the uart pins/pads exposed on the mb so i can hook the serial uart = wires > On Jun 21, 2023, at 4:55 PM, Emmanuel Vadot = wrote: >=20 >=20 > Hello Titus, >=20 > On Wed, 21 Jun 2023 10:58:17 +0300 > titus wrote: >=20 >> I?m trying to add support for allwinner H616 ccu >> I downloaded H616 user manual and i mostly can figure out differences = from allwinner H6 but i have a question >> how is the CCU_GATE clock parent assigned to a specifc ccu gate - = there is no indication in the manual >=20 > There is, you need to look at the system bus tree (page 90 for the H6 > and page 46 for the H616). >=20 >> for example=20 >> CCU_GATE(CLK_BUS_DE, "bus-de", "psi-ahb1-ahb2", 0x60c, 0) >> the manual says that >> 0x060C DE Bus Gating Reset Register (Default Value: 0x0000_0000) has = bit 0 as DE_GATING and bit 16 as DE_RST >> but why is psi-ahb1-ahb2 chosen as parent ? (can?t find any reference = in the manual) >=20 > No idea where you got this example as we don't have this clock defined > in FreeBSD so a bit hard to answer to this specific example. > But indeed that looks correct as the DE engine sits on the PSI2AHB bus > which is on the PSI bus. > If you look at page 91 in the H6 user manual you can see that AHB1 and > AHB2 are both the same clock and equal to the PSI one, which itself is > created from 4 possible parents (OSC24M, CCU_32K, RC16M and PLL_PERI0) > and two factors (N and M). > Clocks can be a bit hard to understand, especially clock topology and > Allwinner doesn't make it better by not having a full clock topo table > in their docs usually. So open the doc 3 or 4 times and go back and > forth reading the clock tree and register definitions. > Also don't hesitate to ask more questions I'll see if I can help. >=20 > Cheers, >=20 > --=20 > Emmanuel Vadot >=20 >=20