From nobody Wed Sep 07 07:59:43 2022 X-Original-To: dev-commits-src-main@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 4MMvmc4G7sz4bsLJ; Wed, 7 Sep 2022 07:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MMvmc2V2Cz46tk; Wed, 7 Sep 2022 07:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662537584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fuL3cYV8ckZ9QDAA0ws87lMJ7PaRcBPh+VQK4Sou1zc=; b=q1J+i6zIoCpHnAXTBAAKktm2n5LwQNzyETxp7yD1+cEjO0LzhIrnqHGQuWwW//hgWPdXjj qlHv+OUb3gwLEiQLkr8WDmdCLBmlQbMpIihmpvXJ+m58ot6BNqM4Jt3AV2RaWPlx0bWsoH Fkv2HWjRXPC0Pvysk1zC1uqfGEBwGd+hrvX3uAC2jxfmOd4uwGZOeKP5RimMKRyB4FRZHm M2pXK1I8dT1iBgpPiSmk+Tr47zAeezDj8wCbQZCe2TndoABVieyKeHr3okYQfmLRNieUat SpnS/N3ctuvvCxeF/RtqtjIc1lAF+MVadVud/Al85NWMmfaWTBVcD6ejMfh2Lg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MMvmc0G0szS5G; Wed, 7 Sep 2022 07:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2877xhTA082078; Wed, 7 Sep 2022 07:59:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2877xhCV082077; Wed, 7 Sep 2022 07:59:43 GMT (envelope-from git) Date: Wed, 7 Sep 2022 07:59:43 GMT Message-Id: <202209070759.2877xhCV082077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Kornel=20Dul=C4=99ba?= Subject: git: 06c30b2c7618 - main - mvneta: Use clkgen API on armv7 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06c30b2c7618e2963ff0954d61892915ac1640fa Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662537584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fuL3cYV8ckZ9QDAA0ws87lMJ7PaRcBPh+VQK4Sou1zc=; b=F3fxkB8t8mxuiDXXVV3KR3RavpV5jQYGVc6wXtVZY3juj+T1UdL+UiI3cCxFNDkUXFz1bq bmheZ74tsVh3AKYMHPwnJ1A8u2teYpTlTy5D56GweCTTrUdfvJyGl9a6mwShE+Wqv0B0Gj QR4HZb+/XoJ5073pJT3swkeotgfxox9PDB1tgHsZDKi1QG4t+lVefXi+Tv7cqE/CiLhZV6 OnK7URSsXNuBqeoXG78vNv/OSAy2VwJRdJZ2jSN8ArgHOKXn1AXUaXgj78YuwuA+kycfVt 36nNcMn0ItLAgiDMqBmyoK5iysDgFQL39BeDOrY/ew/PdgZ7RendSWEVg2Md1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662537584; a=rsa-sha256; cv=none; b=qMIQHh5WaokMfIkloJnT15tmKWF6ZVrKHaIaZ5nLyDwrkuM2uFa3Zvz9mAnB4z0u2ii0ul 4ZNDD4HN2hkSnLkRTsrZedpXWb5/K1pkaD9qw3jkhVUX77bCmEkUD+wlp5Di1EJTKYDErR h6/EidPmJYzho6fyaokkgBna4kM8YwCRc8sOTDIYqsHwEiFhX5VeJUdfVZJIjJypsZCdvu GHxbVauouG+4JYrJ80u9Llez61yOLhqPQ6WxZ1/vRSKudJyMM55sBuh3jiv6BNMAS2TXf4 i4CG0KIbeTNuluXEpXZfSEzVNqpbp/8j6cvRHvDA9+EArTDd3D5c5VkrKyBlkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kd: URL: https://cgit.FreeBSD.org/src/commit/?id=06c30b2c7618e2963ff0954d61892915ac1640fa commit 06c30b2c7618e2963ff0954d61892915ac1640fa Author: Albert Jakieła AuthorDate: 2022-09-06 08:33:34 +0000 Commit: Kornel Dulęba CommitDate: 2022-09-07 07:44:59 +0000 mvneta: Use clkgen API on armv7 With addition of clkgen devices to the Armada38x we no longer need to rely on get_tclk() to get the device frequency. Leave it as a fallback, just in case. Reviewed by: manu Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D36465 --- sys/dev/neta/if_mvneta.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c index eb6c9eec74ce..3e3b07259d4e 100644 --- a/sys/dev/neta/if_mvneta.c +++ b/sys/dev/neta/if_mvneta.c @@ -65,9 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__aarch64__) #include -#endif #include #include @@ -532,9 +530,8 @@ mvneta_attach(device_t self) #if !defined(__aarch64__) uint32_t reg; #endif -#if defined(__aarch64__) clk_t clk; -#endif + sc = device_get_softc(self); sc->dev = self; @@ -556,14 +553,19 @@ mvneta_attach(device_t self) MVNETA_WRITE(sc, MVNETA_PRXINIT, 0x00000001); MVNETA_WRITE(sc, MVNETA_PTXINIT, 0x00000001); -#if defined(__aarch64__) error = clk_get_by_ofw_index(sc->dev, ofw_bus_get_node(sc->dev), 0, &clk); if (error != 0) { +#if defined(__aarch64__) device_printf(sc->dev, "Cannot get clock, using default frequency: %d\n", A3700_TCLK_250MHZ); sc->clk_freq = A3700_TCLK_250MHZ; +#else + device_printf(sc->dev, + "Cannot get clock, using get_tclk()\n"); + sc->clk_freq = get_tclk(); +#endif } else { error = clk_get_freq(clk, &sc->clk_freq); if (error != 0) { @@ -573,9 +575,6 @@ mvneta_attach(device_t self) return (error); } } -#else - sc->clk_freq = get_tclk(); -#endif #if !defined(__aarch64__) /*