From nobody Fri Aug 28 16:40:05 2026 X-Original-To: dev-commits-src-all@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 4hWkdR0fl6z6qhG3 for ; Fri, 28 Aug 2026 16:40:11 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hWkdQ5glmz3khs for ; Fri, 28 Aug 2026 16:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787935210; 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=KRQLJL/9ze8qTebk6qVORyP3b77dO0WphJ0S4BB9tLo=; b=FdkedNjt01O/B3FGY/jb0FtbeWfgxQuI1dH5YSw5gklEWT2vb7cBW40pXrfcp0EP48PT7x oqgtDYJaInS4vI3xSTBeeLNXk2VMbxFbEKTOcJOQZCOi2Z0tBuMFzgHpNxDJOgTG2cNLPL vsfTzrCHpsIgJnZ4DY2Odp0rIQ9AcuS4iKNW4fpRfl4GI7D+Vx4PktIelQCFZcfgUh7Z2S 5VwAyrHNS7/rYlSbODjhBCHe/wEJvegw9Mw9GJk9C+CSD60OnTq9HcSom8iqD6VIcXwRuq +FKlgNam3/Be9YlXcqJuhXTz8mKLhnkxMFHSv+L+ZAFP9UpBkJVmKkyrHTQvXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787935210; a=rsa-sha256; cv=none; b=lzu1SbX5QV85q8iwR7HJ28zvN0lytWo5HCsCKir7LOHoXSOTfL4yhp2QojbwSuBxX/NS3b 4Ok0xbhvtEASTmMFsxAMNXRpDYQ0PDA7ygYXywcKh0pjUxG9he1hmsr6lKbBbi/rprW9bY NOu5wL1yr9h/Zz6H8CEJyNzWTQWpzhnDoaIdoSbIJKXPc/0XGjPkWSu+rfkZCGdDD75oqu o5HPLbOlGN0uCw9CYsDJT+Ig452jSRO1hlvQPUOGpLYokrzNU5GaXnjtulS9tp0xUp7ASe 3eut49lLYDz1dgTBEHdPkgaHxptJ3/k6a5uIW2Xw8n57NOdPCPKliaMCZsD31g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787935210; 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=KRQLJL/9ze8qTebk6qVORyP3b77dO0WphJ0S4BB9tLo=; b=yCXpgjcEWQAXADR5hjnUJwbHZhNfIXfrqEoTeM0wouF4Z+xfqIjf4OEdMbBiqYtKwDv7Aq SKtx9A6/TvNF28p60QlOLqyRwTXTWHsnfOeQunESeIqrMWlmpnQxrZKY21Pw72UStxhYvW tHnk99oQtU2gwu6mAgbORx6ouXsjo2TXANDA/RZi8pBgmqfwNGchkDUU88lfM33QZ0Nh+7 Jywke56mbsVcnXobRLDzJ+KGLOwoEg81ZZpxgmLI4cSDFxk2DXmsXopVvEF6cdAINGINvi Um+kOvaoOP5GS75NTFqqDoHaGKsPe1hIkjt1uMUjs+pI1WGb8r8Fw7o3tXE2pQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hWkdQ4HlCz1Gpr for ; Fri, 28 Aug 2026 16:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 186d5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Aug 2026 16:40:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Oskar Holmlund Subject: git: 541aa93794e6 - main - TI AM335x: Remove clock_common.* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oh X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 541aa93794e6abb81ae5ce565ac64dceb99e26c1 Auto-Submitted: auto-generated Date: Fri, 28 Aug 2026 16:40:05 +0000 Message-Id: <6a91b9e5.186d5.3d5dadbc@gitrepo.freebsd.org> The branch main has been updated by oh: URL: https://cgit.FreeBSD.org/src/commit/?id=541aa93794e6abb81ae5ce565ac64dceb99e26c1 commit 541aa93794e6abb81ae5ce565ac64dceb99e26c1 Author: Oskar Holmlund AuthorDate: 2026-08-28 16:34:55 +0000 Commit: Oskar Holmlund CommitDate: 2026-08-28 16:34:55 +0000 TI AM335x: Remove clock_common.* These helper function will not be needed anymore because the way that clocks are parsed from the DTS is reworked. Approved by: imp, manu(mentor) Tested by: Rick Richard Differential revision: https://reviews.freebsd.org/D46712 --- sys/arm/ti/clk/clock_common.c | 147 ------------------------------------------ sys/arm/ti/clk/clock_common.h | 39 ----------- sys/arm/ti/files.ti | 1 - 3 files changed, 187 deletions(-) diff --git a/sys/arm/ti/clk/clock_common.c b/sys/arm/ti/clk/clock_common.c deleted file mode 100644 index f8c9745dfc89..000000000000 --- a/sys/arm/ti/clk/clock_common.c +++ /dev/null @@ -1,147 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2020 Oskar Holmlund - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include "clock_common.h" - -#if 0 -#define DPRINTF(dev, msg...) device_printf(dev, msg) -#else -#define DPRINTF(dev, msg...) -#endif - -void -read_clock_cells(device_t dev, struct clock_cell_info *clk) { - ssize_t numbytes_clocks; - phandle_t node, parent, *cells; - int index, ncells, rv; - - node = ofw_bus_get_node(dev); - - /* Get names of parent clocks */ - numbytes_clocks = OF_getproplen(node, "clocks"); - clk->num_clock_cells = numbytes_clocks / sizeof(cell_t); - - /* Allocate space and get clock cells content */ - /* clock_cells / clock_cells_ncells will be freed in - * find_parent_clock_names() - */ - clk->clock_cells = malloc(numbytes_clocks, M_DEVBUF, M_WAITOK|M_ZERO); - clk->clock_cells_ncells = malloc(clk->num_clock_cells*sizeof(uint8_t), - M_DEVBUF, M_WAITOK|M_ZERO); - OF_getencprop(node, "clocks", clk->clock_cells, numbytes_clocks); - - /* Count number of clocks */ - clk->num_real_clocks = 0; - for (index = 0; index < clk->num_clock_cells; index++) { - rv = ofw_bus_parse_xref_list_alloc(node, "clocks", "#clock-cells", - clk->num_real_clocks, &parent, &ncells, &cells); - if (rv != 0) - continue; - - if (cells != NULL) - OF_prop_free(cells); - - clk->clock_cells_ncells[index] = ncells; - index += ncells; - clk->num_real_clocks++; - } -} - -int -find_parent_clock_names(device_t dev, struct clock_cell_info *clk, struct clknode_init_def *def) { - int index, clock_index, err; - bool found_all = true; - clk_t parent; - - /* Figure out names */ - for (index = 0, clock_index = 0; index < clk->num_clock_cells; index++) { - /* Get name of parent clock */ - err = clk_get_by_ofw_index(dev, 0, clock_index, &parent); - if (err != 0) { - clock_index++; - found_all = false; - DPRINTF(dev, "Failed to find clock_cells[%d]=0x%x\n", - index, clk->clock_cells[index]); - - index += clk->clock_cells_ncells[index]; - continue; - } - - def->parent_names[clock_index] = clk_get_name(parent); - clk_release(parent); - - DPRINTF(dev, "Found parent clock[%d/%d]: %s\n", - clock_index, clk->num_real_clocks, - def->parent_names[clock_index]); - - clock_index++; - index += clk->clock_cells_ncells[index]; - } - - if (!found_all) { - return 1; - } - - free(clk->clock_cells, M_DEVBUF); - free(clk->clock_cells_ncells, M_DEVBUF); - return 0; -} - -void -create_clkdef(device_t dev, struct clock_cell_info *clk, struct clknode_init_def *def) { - def->id = 1; - - clk_parse_ofw_clk_name(dev, ofw_bus_get_node(dev), &def->name); - - DPRINTF(dev, "node name: %s\n", def->name); - - def->parent_cnt = clk->num_real_clocks; - def->parent_names = malloc(clk->num_real_clocks*sizeof(char *), - M_OFWPROP, M_WAITOK); -} -void -free_clkdef(struct clknode_init_def *def) { - OF_prop_free(__DECONST(char *, def->name)); - OF_prop_free(def->parent_names); -} diff --git a/sys/arm/ti/clk/clock_common.h b/sys/arm/ti/clk/clock_common.h deleted file mode 100644 index 884b4b32d4a8..000000000000 --- a/sys/arm/ti/clk/clock_common.h +++ /dev/null @@ -1,39 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2020 Oskar Holmlund - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -struct clock_cell_info { - cell_t *clock_cells; - uint8_t *clock_cells_ncells; - uint32_t num_clock_cells; - uint8_t num_real_clocks; -}; - -void read_clock_cells(device_t dev, struct clock_cell_info *clk); -int find_parent_clock_names(device_t dev, struct clock_cell_info *clk, struct clknode_init_def *def); -void create_clkdef(device_t dev, struct clock_cell_info *clk, struct clknode_init_def *def); -void free_clkdef(struct clknode_init_def *def); diff --git a/sys/arm/ti/files.ti b/sys/arm/ti/files.ti index a31981957c70..e478ce5005da 100644 --- a/sys/arm/ti/files.ti +++ b/sys/arm/ti/files.ti @@ -19,7 +19,6 @@ arm/ti/ti_sdhci.c optional sdhci arm/ti/ti_spi.c optional ti_spi arm/ti/ti_sysc.c standard -arm/ti/clk/clock_common.c standard arm/ti/clk/ti_clk_clkctrl.c standard arm/ti/clk/ti_clkctrl.c standard arm/ti/clk/ti_clk_dpll.c standard