Index: stable/12/sys/arm64/rockchip/clk/rk3399_cru.c
===================================================================
--- stable/12/sys/arm64/rockchip/clk/rk3399_cru.c	(revision 358643)
+++ stable/12/sys/arm64/rockchip/clk/rk3399_cru.c	(revision 358644)
@@ -1,2028 +1,1286 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
  * Copyright (c) 2018 Emmanuel Vadot <manu@freebsd.org>
  * Copyright (c) 2018 Greg V <greg@unrelenting.technology>
  *
  * 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.
  *
  * $FreeBSD$
  */
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
 #include <sys/rman.h>
 #include <sys/kernel.h>
 #include <sys/module.h>
 #include <machine/bus.h>
 
 #include <dev/fdt/simplebus.h>
 
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 
 #include <dev/extres/clk/clk_div.h>
 #include <dev/extres/clk/clk_fixed.h>
 #include <dev/extres/clk/clk_mux.h>
 
 #include <arm64/rockchip/clk/rk_cru.h>
 
-/* GATES */
+#include <arm64/rockchip/clk/rk3399_cru_dt.h>
 
-#define	SCLK_USB2PHY0_REF	123
-#define	SCLK_USB2PHY1_REF	124
-#define	SCLK_USB3OTG0_REF	129
-#define	SCLK_USB3OTG1_REF	130
-#define	SCLK_USB3OTG0_SUSPEND	131
-#define	SCLK_USB3OTG1_SUSPEND	132
-#define	ACLK_EMMC_CORE		241
-#define	ACLK_EMMC_NOC		242
-#define	ACLK_EMMC_GRF		243
-#define	ACLK_USB3_NOC		245
-#define	ACLK_USB3OTG0		246
-#define	ACLK_USB3OTG1		247
-#define	ACLK_USB3_RKSOC_AXI_PERF	248
-#define	ACLK_USB3_GRF		249
-#define	PCLK_GPIO2		336
-#define	PCLK_GPIO3		337
-#define	PCLK_GPIO4		338
-#define	PCLK_I2C1		341
-#define	PCLK_I2C2		342
-#define	PCLK_I2C3		343
-#define	PCLK_I2C5		344
-#define	PCLK_I2C6		345
-#define	PCLK_I2C7		346
-#define	PCLK_SPI0		347
-#define	PCLK_SPI1		348
-#define	PCLK_SPI2		349
-#define	PCLK_SPI4		350
-#define	PCLK_SPI5		351
-#define	HCLK_HOST0		456
-#define	HCLK_HOST0_ARB		457
-#define	HCLK_HOST1		458
-#define	HCLK_HOST1_ARB		459
-#define	HCLK_SDMMC		462
+#define	CRU_CLKSEL_CON(x)	(0x100 + (x) * 0x4)
+#define	CRU_CLKGATE_CON(x)	(0x300 + (x) * 0x4)
 
+
+/* GATES */
+
 static struct rk_cru_gate rk3399_gates[] = {
 	/* CRU_CLKGATE_CON0 */
-	CRU_GATE(0, "clk_core_l_lpll_src", "lpll", 0x300, 0)
-	CRU_GATE(0, "clk_core_l_bpll_src", "bpll", 0x300, 1)
-	CRU_GATE(0, "clk_core_l_dpll_src", "dpll", 0x300, 2)
-	CRU_GATE(0, "clk_core_l_gpll_src", "gpll", 0x300, 3)
+	/* 15-8 unused */
+	GATE(SCLK_PVTM_CORE_L, "clk_pvtm_core_l", "xin24m",		0, 7),
+	GATE(0, "pclk_dbg_core_l", "pclk_dbg_core_l_c",			0, 6),
+	GATE(0, "atclk_core_l", "atclk_core_l_c",			0, 5),
+	GATE(0, "aclkm_core_l", "aclkm_core_l_c",			0, 4),
+	GATE(0, "clk_core_l_gpll_src", "gpll",				0, 3),
+	GATE(0, "clk_core_l_dpll_src", "dpll",				0, 2),
+	GATE(0, "clk_core_l_bpll_src", "bpll",				0, 1),
+	GATE(0, "clk_core_l_lpll_src", "lpll",				0, 0),
 
 	/* CRU_CLKGATE_CON1 */
-	CRU_GATE(0, "clk_core_b_lpll_src", "lpll", 0x304, 0)
-	CRU_GATE(0, "clk_core_b_bpll_src", "bpll", 0x304, 1)
-	CRU_GATE(0, "clk_core_b_dpll_src", "dpll", 0x304, 2)
-	CRU_GATE(0, "clk_core_b_gpll_src", "gpll", 0x304, 3)
+	/* 15 - 8 unused */
+	GATE(SCLK_PVTM_CORE_B, "clk_pvtm_core_b", "xin24m",		1, 7),
+	GATE(0, "pclk_dbg_core_b","pclk_dbg_core_b_c",			1, 6),
+	GATE(0, "atclk_core_b", "atclk_core_b_c", 			1, 5),
+	GATE(0, "aclkm_core_b", "aclkm_core_b_c",			1, 4),
+	GATE(0, "clk_core_b_gpll_src", "gpll",				1, 3),
+	GATE(0, "clk_core_b_dpll_src", "dpll",				1, 2),
+	GATE(0, "clk_core_b_bpll_src", "bpll",				1, 1),
+	GATE(0, "clk_core_b_lpll_src", "lpll",				1, 0),
 
+	/* CRU_CLKGATE_CON2 */
+	/* 15 - 11 unused */
+	GATE(0, "npll_cs", "npll",					2, 10),
+	GATE(0, "gpll_cs", "gpll",					2, 9),
+	GATE(0, "cpll_cs", "cpll",					2, 8),
+	GATE(SCLK_CCI_TRACE, "clk_cci_trace", "clk_cci_trace_c",	2, 7),
+	GATE(0, "gpll_cci_trace", "gpll",				2, 6),
+	GATE(0, "cpll_cci_trace", "cpll",				2, 5),
+	GATE(0, "aclk_cci_pre", "aclk_cci_pre_c",			2, 4),
+	GATE(0, "vpll_aclk_cci_src", "vpll",				2, 3),
+	GATE(0, "npll_aclk_cci_src", "npll",				2, 2),
+	GATE(0, "gpll_aclk_cci_src", "gpll",				2, 1),
+	GATE(0, "cpll_aclk_cci_src", "cpll",				2, 0),
+
+	/* CRU_CLKGATE_CON3 */
+	/* 15 - 8 unused */
+	GATE(0, "aclk_center", "aclk_center_c",				3, 7),
+	/* 6 unused */
+	/* 5 unused */
+	GATE(PCLK_DDR, "pclk_ddr", "pclk_ddr_c",			3, 4),
+	GATE(0, "clk_ddrc_gpll_src", "gpll",				3, 3),
+	GATE(0, "clk_ddrc_dpll_src", "dpll",				3, 2),
+	GATE(0, "clk_ddrc_bpll_src", "bpll",				3, 1),
+	GATE(0, "clk_ddrc_lpll_src", "lpll",				3, 0),
+
+
+	/* CRU_CLKGATE_CON4 */
+	/* 15 - 12 unused */
+	GATE(SCLK_PVTM_DDR, "clk_pvtm_ddr", "xin24m",			4, 11),
+	GATE(0, "clk_rga_core", "clk_rga_core_c",			4, 10),
+	GATE(0, "hclk_rga_pre", "hclk_rga_pre_c",			4, 9),
+	GATE(0, "aclk_rga_pre", "aclk_rga_pre_c",			4, 8),
+	GATE(0, "hclk_iep_pre", "hclk_iep_pre_c",			4, 7),
+	GATE(0, "aclk_iep_pre", "aclk_iep_pre_c",			4, 6),
+	GATE(SCLK_VDU_CA, "clk_vdu_ca", "clk_vdu_ca_c",			4, 5),
+	GATE(SCLK_VDU_CORE, "clk_vdu_core", "clk_vdu_core_c",		4, 4),
+	GATE(0, "hclk_vdu_pre", "hclk_vdu_pre_c",			4, 3),
+	GATE(0, "aclk_vdu_pre", "aclk_vdu_pre_c",			4, 2),
+	GATE(0, "hclk_vcodec_pre", "hclk_vcodec_pre_c",			4, 1),
+	GATE(0, "aclk_vcodec_pre", "aclk_vcodec_pre_c",			4, 0),
+
 	/* CRU_CLKGATE_CON5 */
-	CRU_GATE(0, "cpll_aclk_perihp_src", "cpll", 0x314, 0)
-	CRU_GATE(0, "gpll_aclk_perihp_src", "gpll", 0x314, 1)
+	/* 15 - 10 unused */
+	GATE(SCLK_MAC_TX, "clk_rmii_tx", "clk_rmii_src",		5, 9),
+	GATE(SCLK_MAC_RX, "clk_rmii_rx", "clk_rmii_src",		5, 8),
+	GATE(SCLK_MACREF, "clk_mac_ref", "clk_rmii_src",		5, 7),
+	GATE(SCLK_MACREF_OUT, "clk_mac_refout", "clk_rmii_src",		5, 6),
+	GATE(SCLK_MAC, "clk_gmac", "clk_gmac_c",			5, 5),
+	GATE(PCLK_PERIHP, "pclk_perihp", "pclk_perihp_c",		5, 4),
+	GATE(HCLK_PERIHP, "hclk_perihp", "hclk_perihp_c",		5, 3),
+	GATE(ACLK_PERIHP, "aclk_perihp", "aclk_perihp_c",		5, 2),
+	GATE(0, "cpll_aclk_perihp_src", "cpll",				5, 1),
+	GATE(0, "gpll_aclk_perihp_src", "gpll",				5, 0),
 
 	/* CRU_CLKGATE_CON6 */
-	CRU_GATE(0, "gpll_aclk_emmc_src", "gpll", 0x318, 12)
-	CRU_GATE(0, "cpll_aclk_emmc_src", "cpll", 0x318, 13)
-	CRU_GATE(SCLK_USB2PHY0_REF, "clk_usb2phy0_ref", "xin24m", 0x318, 5)
-	CRU_GATE(SCLK_USB2PHY1_REF, "clk_usb2phy1_ref", "xin24m", 0x318, 6)
+	/* 15 unused */
+	GATE(SCLK_EMMC, "clk_emmc", "clk_emmc_c",			6, 14),
+	GATE(0, "cpll_aclk_emmc_src", "cpll",				6, 13),
+	GATE(0, "gpll_aclk_emmc_src", "gpll",				6, 12),
+	GATE(0, "pclk_gmac_pre", "pclk_gmac_pre_c",			6, 11),
+	GATE(0, "aclk_gmac_pre", "aclk_gmac_pre_c",			6, 10),
+	GATE(0, "cpll_aclk_gmac_src", "cpll",				6, 9),
+	GATE(0, "gpll_aclk_gmac_src", "gpll",				6, 8),
+	/* 7 unused */
+	GATE(SCLK_USB2PHY1_REF, "clk_usb2phy1_ref", "xin24m",		6, 6),
+	GATE(SCLK_USB2PHY0_REF, "clk_usb2phy0_ref", "xin24m", 		6, 5),
+	GATE(SCLK_HSICPHY, "clk_hsicphy", "clk_hsicphy_c",		6, 4),
+	GATE(0, "clk_pcie_core_cru", "clk_pcie_core_cru_c",		6, 3),
+	GATE(SCLK_PCIE_PM, "clk_pcie_pm", "clk_pcie_pm_c",		6, 2),
+	GATE(SCLK_SDMMC, "clk_sdmmc", "clk_sdmmc_c",			6, 1),
+	GATE(SCLK_SDIO, "clk_sdio", "clk_sdio_c",			6, 0),
 
 	/* CRU_CLKGATE_CON7 */
-	CRU_GATE(0, "gpll_aclk_perilp0_src", "gpll", 0x31C, 0)
-	CRU_GATE(0, "cpll_aclk_perilp0_src", "cpll", 0x31C, 1)
+	/* 15 - 10 unused */
+	GATE(FCLK_CM0S, "fclk_cm0s", "fclk_cm0s_c",			7, 9),
+	GATE(SCLK_CRYPTO1, "clk_crypto1", "clk_crypto1_c",		7, 8),
+	GATE(SCLK_CRYPTO0, "clk_crypto0", "clk_crypto0_c",		7, 7),
+	GATE(0, "cpll_fclk_cm0s_src", "cpll",				7, 6),
+	GATE(0, "gpll_fclk_cm0s_src", "gpll",				7, 5),
+	GATE(PCLK_PERILP0, "pclk_perilp0", "pclk_perilp0_c",		7, 4),
+	GATE(HCLK_PERILP0, "hclk_perilp0", "hclk_perilp0_c",		7, 3),
+	GATE(ACLK_PERILP0, "aclk_perilp0", "aclk_perilp0_c",		7, 2),
+	GATE(0, "cpll_aclk_perilp0_src", "cpll",			7, 1),
+	GATE(0, "gpll_aclk_perilp0_src", "gpll",			7, 0),
 
 	/* CRU_CLKGATE_CON8 */
-	CRU_GATE(0, "hclk_perilp1_cpll_src", "cpll", 0x320, 1)
-	CRU_GATE(0, "hclk_perilp1_gpll_src", "gpll", 0x320, 0)
+	GATE(SCLK_SPDIF_8CH, "clk_spdif", "clk_spdif_mux",		8, 15),
+	GATE(0, "clk_spdif_frac", "clk_spdif_frac_c",			8, 14),
+	GATE(0, "clk_spdif_div", "clk_spdif_div_c",			8, 13),
+	GATE(SCLK_I2S_8CH_OUT, "clk_i2sout", "clk_i2sout_c",		8, 12),
+	GATE(SCLK_I2S2_8CH, "clk_i2s2", "clk_i2s2_mux",			8, 11),
+	GATE(0, "clk_i2s2_frac", "clk_i2s2_frac_c",			8, 10),
+	GATE(0, "clk_i2s2_div", "clk_i2s2_div_c",			8, 9),
+	GATE(SCLK_I2S1_8CH, "clk_i2s1", "clk_i2s1_mux",			8, 8),
+	GATE(0, "clk_i2s1_frac", "clk_i2s1_frac_c",			8, 7),
+	GATE(0, "clk_i2s1_div", "clk_i2s1_div_c",			8, 6),
+	GATE(SCLK_I2S0_8CH, "clk_i2s0", "clk_i2s0_mux",			8, 5),
+	GATE(0, "clk_i2s0_frac","clk_i2s0_frac_c",			8, 4),
+	GATE(0, "clk_i2s0_div","clk_i2s0_div_c",			8, 3),
+	GATE(PCLK_PERILP1, "pclk_perilp1", "pclk_perilp1_c",		8, 2),
+	GATE(HCLK_PERILP1, "cpll_hclk_perilp1_src", "cpll",		8, 1),
+	GATE(0, "gpll_hclk_perilp1_src", "gpll",			8, 0),
 
-	/* CRU_CLKGATE_CON12 */
-	CRU_GATE(SCLK_USB3OTG0_REF, "sclk_usb3otg0_ref", "xin24m", 0x330, 1)
-	CRU_GATE(SCLK_USB3OTG1_REF, "sclk_usb3otg1_ref", "xin24m", 0x330, 2)
-	CRU_GATE(SCLK_USB3OTG0_SUSPEND, "sclk_usb3otg0_suspend", "xin24m", 0x330, 3)
-	CRU_GATE(SCLK_USB3OTG1_SUSPEND, "sclk_usb3otg1_suspend", "xin24m", 0x330, 4)
+	/* CRU_CLKGATE_CON9 */
+	GATE(SCLK_SPI4, "clk_spi4", "clk_spi4_c", 			9, 15),
+	GATE(SCLK_SPI2, "clk_spi2", "clk_spi2_c",			9, 14),
+	GATE(SCLK_SPI1, "clk_spi1", "clk_spi1_c",			9, 13),
+	GATE(SCLK_SPI0, "clk_spi0", "clk_spi0_c",			9, 12),
+	GATE(SCLK_SARADC, "clk_saradc", "clk_saradc_c",			9, 11),
+	GATE(SCLK_TSADC, "clk_tsadc", "clk_tsadc_c",			9, 10),
+	/* 9 - 8 unused */
+	GATE(0, "clk_uart3_frac", "clk_uart3_frac_c",			9, 7),
+	GATE(0, "clk_uart3_div", "clk_uart3_div_c",			9, 6),
+	GATE(0, "clk_uart2_frac", "clk_uart2_frac_c",			9, 5),
+	GATE(0, "clk_uart2_div", "clk_uart2_div_c",			9, 4),
+	GATE(0, "clk_uart1_frac", "clk_uart1_frac_c",			9, 3),
+	GATE(0, "clk_uart1_div", "clk_uart1_div_c",			9, 2),
+	GATE(0, "clk_uart0_frac", "clk_uart0_frac_c", 			9, 1),
+	GATE(0, "clk_uart0_div", "clk_uart0_div_c",			9, 0),
 
-	/* CRU_CLKGATE_CON20 */
-	CRU_GATE(HCLK_HOST0, "hclk_host0", "hclk_perihp", 0x350, 5)
-	CRU_GATE(HCLK_HOST0_ARB, "hclk_host0_arb", "hclk_perihp", 0x350, 6)
-	CRU_GATE(HCLK_HOST1, "hclk_host1", "hclk_perihp", 0x350, 7)
-	CRU_GATE(HCLK_HOST1_ARB, "hclk_host1_arb", "hclk_perihp", 0x350, 8)
+	/* CRU_CLKGATE_CON10 */
+	GATE(SCLK_VOP1_PWM, "clk_vop1_pwm", "clk_vop1_pwm_c",		10, 15),
+	GATE(SCLK_VOP0_PWM, "clk_vop0_pwm", "clk_vop0_pwm_c",		10, 14),
+	GATE(DCLK_VOP0_DIV, "dclk_vop0_div", "dclk_vop0_div_c",		10, 12),
+	GATE(DCLK_VOP1_DIV, "dclk_vop1_div", "dclk_vop1_div_c",		10, 13),
+	GATE(0, "hclk_vop1_pre", "hclk_vop1_pre_c",			10, 11),
+	GATE(ACLK_VOP1_PRE, "aclk_vop1_pre", "aclk_vop1_pre_c",		10, 10),
+	GATE(0, "hclk_vop0_pre", "hclk_vop0_pre_c",			10, 9),
+	GATE(ACLK_VOP0_PRE, "aclk_vop0_pre", "aclk_vop0_pre_c",		10, 8),
+	GATE(0, "clk_cifout_src", "clk_cifout_src_c",			10, 7),
+	GATE(SCLK_SPDIF_REC_DPTX, "clk_spdif_rec_dptx", "clk_spdif_rec_dptx_c", 10, 6),
+	GATE(SCLK_I2C7, "clk_i2c7", "clk_i2c7_c",			10, 5),
+	GATE(SCLK_I2C3, "clk_i2c3", "clk_i2c3_c",			10, 4),
+	GATE(SCLK_I2C6, "clk_i2c6", "clk_i2c6_c",			10, 3),
+	GATE(SCLK_I2C2, "clk_i2c2", "clk_i2c2_c",			10, 2),
+	GATE(SCLK_I2C5, "clk_i2c5", "clk_i2c5_c",			10, 1),
+	GATE(SCLK_I2C1, "clk_i2c1", "clk_i2c1_c",			10, 0),
 
-	/* CRU_CLKGATE_CON22 */
-	CRU_GATE(PCLK_I2C7, "pclk_rki2c7", "pclk_perilp1", 0x358, 5)
-	CRU_GATE(PCLK_I2C1, "pclk_rki2c1", "pclk_perilp1", 0x358, 6)
-	CRU_GATE(PCLK_I2C5, "pclk_rki2c5", "pclk_perilp1", 0x358, 7)
-	CRU_GATE(PCLK_I2C6, "pclk_rki2c6", "pclk_perilp1", 0x358, 8)
-	CRU_GATE(PCLK_I2C2, "pclk_rki2c2", "pclk_perilp1", 0x358, 9)
-	CRU_GATE(PCLK_I2C3, "pclk_rki2c3", "pclk_perilp1", 0x358, 10)
 
-	/* CRU_CLKGATE_CON23 */
-	CRU_GATE(PCLK_SPI0, "pclk_spi0", "pclk_perilp1", 0x35C, 10)
-	CRU_GATE(PCLK_SPI1, "pclk_spi1", "pclk_perilp1", 0x35C, 11)
-	CRU_GATE(PCLK_SPI2, "pclk_spi2", "pclk_perilp1", 0x35C, 12)
-	CRU_GATE(PCLK_SPI4, "pclk_spi4", "pclk_perilp1", 0x35C, 13)
+	/* CRU_CLKGATE_CON11 */
+	GATE(SCLK_MIPIDPHY_CFG, "clk_mipidphy_cfg", "xin24m",		11, 15),
+	GATE(SCLK_MIPIDPHY_REF, "clk_mipidphy_ref", "xin24m",		11, 14),
+	/* 13-12 unused */
+	GATE(PCLK_EDP, "pclk_edp", "pclk_edp_c",			11, 11),
+	GATE(PCLK_HDCP, "pclk_hdcp", "pclk_hdcp_c",			11, 10),
+	/* 9 unuwsed */
+	GATE(SCLK_DP_CORE, "clk_dp_core", "clk_dp_core_c",		11, 8),
+	GATE(SCLK_HDMI_CEC, "clk_hdmi_cec", "clk_hdmi_cec_c",		11, 7),
+	GATE(SCLK_HDMI_SFR, "clk_hdmi_sfr", "xin24m",			11, 6),
+	GATE(SCLK_ISP1, "clk_isp1", "clk_isp1_c",			11, 5),
+	GATE(SCLK_ISP0, "clk_isp0",  "clk_isp0_c",			11, 4),
+	GATE(HCLK_HDCP, "hclk_hdcp",  "hclk_hdcp_c",			11, 3),
+	GATE(ACLK_HDCP, "aclk_hdcp", "aclk_hdcp_c",			11, 2),
+	GATE(PCLK_VIO, "pclk_vio", "pclk_vio_c",			11, 1),
+	GATE(ACLK_VIO, "aclk_vio", "aclk_vio_c",			11, 0),
 
-	/* CRU_CLKGATE_CON30 */
-	CRU_GATE(ACLK_USB3_NOC, "aclk_usb3_noc", "aclk_usb3", 0x378, 0)
-	CRU_GATE(ACLK_USB3OTG0, "aclk_usb3otg0", "aclk_usb3", 0x378, 1)
-	CRU_GATE(ACLK_USB3OTG1, "aclk_usb3otg1", "aclk_usb3", 0x378, 2)
-	CRU_GATE(ACLK_USB3_RKSOC_AXI_PERF, "aclk_usb3_rksoc_axi_perf", "aclk_usb3", 0x378, 3)
-	CRU_GATE(ACLK_USB3_GRF, "aclk_usb3_grf", "aclk_usb3", 0x378, 4)
+	/* CRU_CLKGATE_CON12 */
+	/* 15 - 14 unused */
+	GATE(HCLK_SD, "hclk_sd", "hclk_sd_c",				12, 13),
+	GATE(ACLK_GIC_PRE, "aclk_gic_pre",  "aclk_gic_pre_c",		12, 12),
+	GATE(HCLK_ISP1, "hclk_isp1", "hclk_isp1_c",			12, 11),
+	GATE(ACLK_ISP1, "aclk_isp1", "aclk_isp1_c",			12, 10),
+	GATE(HCLK_ISP0, "hclk_isp0", "hclk_isp0_c",			12, 9),
+	GATE(ACLK_ISP0, "aclk_isp0",  "aclk_isp0_c",			12, 8),
+	/* 7 unused */
+	GATE(SCLK_PCIEPHY_REF100M, "clk_pciephy_ref100m", "clk_pciephy_ref100m_c", 12, 6),
+	/* 5 unused */
+	GATE(SCLK_USB3OTG1_SUSPEND, "clk_usb3otg1_suspend", "clk_usb3otg1_suspend_c", 12, 4),
+	GATE(SCLK_USB3OTG0_SUSPEND, "clk_usb3otg0_suspend", "clk_usb3otg0_suspend_c", 12, 3),
+	GATE(SCLK_USB3OTG1_REF, "clk_usb3otg1_ref", "xin24m",		12, 2),
+	GATE(SCLK_USB3OTG0_REF, "clk_usb3otg0_ref", "xin24m",		12, 1),
+	GATE(ACLK_USB3, "aclk_usb3",  "aclk_usb3_c", 			12, 0),
 
-	/* CRU_CLKGATE_CON31 */
-	CRU_GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_alive", 0x37c, 3)
-	CRU_GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_alive", 0x37c, 4)
-	CRU_GATE(PCLK_GPIO4, "pclk_gpio4", "pclk_alive", 0x37c, 5)
+	/* CRU_CLKGATE_CON13 */
+	GATE(SCLK_TESTCLKOUT2, "clk_testout2", "clk_testout2_c",	13, 15),
+	GATE(SCLK_TESTCLKOUT1, "clk_testout1",  "clk_testout1_c",	13, 14),
+	GATE(SCLK_SPI5, "clk_spi5",  "clk_spi5_c",			13, 13),
+	GATE(0, "clk_usbphy0_480m_src", "clk_usbphy0_480m",		13, 12),
+	GATE(0, "clk_usbphy1_480m_src", "clk_usbphy1_480m",		13, 12),
+	GATE(0, "clk_test", "clk_test_c",				13, 11),
+	/* 10 unused */
+	GATE(0, "clk_test_frac", "clk_test_frac_c",			13, 9),
+	/* 8 unused */
+	GATE(SCLK_UPHY1_TCPDCORE, "clk_uphy1_tcpdcore", "clk_uphy1_tcpdcore_c", 13, 7),
+	GATE(SCLK_UPHY1_TCPDPHY_REF, "clk_uphy1_tcpdphy_ref", "clk_uphy1_tcpdphy_ref_c", 13, 6),
+	GATE(SCLK_UPHY0_TCPDCORE, "clk_uphy0_tcpdcore", "clk_uphy0_tcpdcore_c", 13, 5),
+	GATE(SCLK_UPHY0_TCPDPHY_REF, "clk_uphy0_tcpdphy_ref", "clk_uphy0_tcpdphy_ref_c", 13, 4),
+	/* 3 - 2 unused */
+	GATE(SCLK_PVTM_GPU, "aclk_pvtm_gpu", "xin24m", 			13, 1),
+	GATE(0, "aclk_gpu_pre", "aclk_gpu_pre_c",			13, 0),
 
-	/* CRU_CLKGATE_CON32 */
-	CRU_GATE(ACLK_EMMC_CORE, "aclk_emmccore", "aclk_emmc", 0x380, 8)
-	CRU_GATE(ACLK_EMMC_NOC, "aclk_emmc_noc", "aclk_emmc", 0x380, 9)
-	CRU_GATE(ACLK_EMMC_GRF, "aclk_emmcgrf", "aclk_emmc", 0x380, 10)
+	/* CRU_CLKGATE_CON14 */
+	/* 15 - 14 unused */
+	GATE(ACLK_PERF_CORE_L, "aclk_perf_core_l", "aclkm_core_l",	14, 13),
+	GATE(ACLK_CORE_ADB400_CORE_L_2_CCI500, "aclk_core_adb400_core_l_2_cci500", "aclkm_core_l", 14, 12),
+	GATE(ACLK_GIC_ADB400_CORE_L_2_GIC, "aclk_core_adb400_core_l_2_gic", "armclkl", 14, 11),
+	GATE(ACLK_GIC_ADB400_GIC_2_CORE_L, "aclk_core_adb400_gic_2_core_l", "armclkl", 14, 10),
+	GATE(0, "clk_dbg_pd_core_l", "armclkl",				14, 9),
+	/* 8 - 7 unused */
+	GATE(ACLK_PERF_CORE_B, "aclk_perf_core_b", "aclkm_core_b", 	14, 6),
+	GATE(ACLK_CORE_ADB400_CORE_B_2_CCI500, "aclk_core_adb400_core_b_2_cci500", "aclkm_core_b", 14, 5),
+	GATE(ACLK_GIC_ADB400_CORE_B_2_GIC, "aclk_core_adb400_core_b_2_gic", "armclkb", 14, 4),
+	GATE(ACLK_GIC_ADB400_GIC_2_CORE_B, "aclk_core_adb400_gic_2_core_b", "armclkb", 14, 3),
+	GATE(0, "pclk_dbg_cxcs_pd_core_b", "pclk_dbg_core_b",		14, 2),
+	GATE(0, "clk_dbg_pd_core_b", "armclkb", 			14, 1),
+	/* 0 unused */
 
-	/* CRU_CLKGATE_CON33 */
-	CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_sd", 0x384, 8)
+	/* CRU_CLKGATE_CON15 */
+	/* 15 - 8 unused */
+	GATE(ACLK_CCI_GRF, "aclk_cci_grf", "aclk_cci_pre",		15, 7),
+	GATE(0, "clk_dbg_noc", "clk_cs",				15, 6),
+	GATE(0, "clk_dbg_cxcs", "clk_cs",				15, 5),
+	GATE(ACLK_CCI_NOC1, "aclk_cci_noc1", "aclk_cci_pre",		15, 4),
+	GATE(ACLK_CCI_NOC0, "aclk_cci_noc0", "aclk_cci_pre",		15, 3),
+	GATE(ACLK_CCI, "aclk_cci", "aclk_cci_pre",			15, 2),
+	GATE(ACLK_ADB400M_PD_CORE_B, "aclk_adb400m_pd_core_b", "aclk_cci_pre", 15, 1),
+	GATE(ACLK_ADB400M_PD_CORE_L, "aclk_adb400m_pd_core_l", "aclk_cci_pre", 15, 0),
 
-	/* CRU_CLKGATE_CON34 */
-	CRU_GATE(PCLK_SPI4, "pclk_spi5", "pclk_perilp1", 0x388, 5)
-};
+	/* CRU_CLKGATE_CON16 */
+	/* 15 - 12 unused */
+	GATE(HCLK_RGA_NOC, "hclk_rga_noc", "hclk_rga_pre",		16, 11),
+	GATE(HCLK_RGA, "hclk_rga", "hclk_rga_pre", 			16, 10),
+	GATE(ACLK_RGA_NOC, "aclk_rga_noc", "aclk_rga_pre",		16, 9),
+	GATE(ACLK_RGA, "aclk_rga", "aclk_rga_pre", 			16, 8),
+	/* 7 - 4 unused */
+	GATE(HCLK_IEP_NOC, "hclk_iep_noc", "hclk_iep_pre",		16, 3),
+	GATE(HCLK_IEP, "hclk_iep", "hclk_iep_pre", 			16, 2),
+	GATE(ACLK_IEP_NOC, "aclk_iep_noc", "aclk_iep_pre",		16, 1),
+	GATE(ACLK_IEP, "aclk_iep", "aclk_iep_pre", 			16, 0),
 
 
-/*
- * PLLs
- */
+	/* CRU_CLKGATE_CON17 */
+	/* 15 - 12 unused */
+	GATE(HCLK_VDU_NOC, "hclk_vdu_noc", "hclk_vdu_pre",		17, 11),
+	GATE(HCLK_VDU, "hclk_vdu", "hclk_vdu_pre",			17, 10),
+	GATE(ACLK_VDU_NOC, "aclk_vdu_noc", "aclk_vdu_pre",		17, 9),
+	GATE(ACLK_VDU, "aclk_vdu", "aclk_vdu_pre", 			17, 8),
+	GATE(0, "hclk_vcodec_noc", "hclk_vcodec_pre",			17, 3),
+	GATE(HCLK_VCODEC, "hclk_vcodec", "hclk_vcodec_pre",		17, 2),
+	GATE(0, "aclk_vcodec_noc", "aclk_vcodec_pre",			17, 1),
+	GATE(ACLK_VCODEC, "aclk_vcodec", "aclk_vcodec_pre",		17, 0),
 
-#define PLL_APLLL			1
-#define PLL_APLLB			2
-#define PLL_DPLL			3
-#define PLL_CPLL			4
-#define PLL_GPLL			5
-#define PLL_NPLL			6
-#define PLL_VPLL			7
+	/* CRU_CLKGATE_CON18 */
+	GATE(PCLK_CIC, "pclk_cic", "pclk_ddr",				18, 15),
+	GATE(0, "clk_ddr_mon_timer", "xin24m",				18, 14),
+	GATE(0, "clk_ddr_mon", "clk_ddrc_div2",				18, 13),
+	GATE(PCLK_DDR_MON, "pclk_ddr_mon", "pclk_ddr", 			18, 12),
+	GATE(0, "clk_ddr_cic", "clk_ddrc_div2",				18, 11),
+	GATE(PCLK_CENTER_MAIN_NOC, "pclk_center_main_noc", "pclk_ddr",	18, 10),
+	GATE(0, "clk_ddrcfg_msch1", "clk_ddrc_div2",			18,  9),
+	GATE(0, "clk_ddrphy1", "clk_ddrc_div2",				18,  8),
+	GATE(0, "clk_ddrphy_ctrl1", "clk_ddrc_div2",			18,  7),
+	GATE(0, "clk_ddrc1", "clk_ddrc_div2",				18,  6),
+	GATE(0, "clk_ddr1_msch", "clk_ddrc_div2",			18,  5),
+	GATE(0, "clk_ddrcfg_msch0", "clk_ddrc_div2",			18,  4),
+	GATE(0, "clk_ddrphy0", "clk_ddrc_div2",				18,  3),
+	GATE(0, "clk_ddrphy_ctrl0", "clk_ddrc_div2",			18,  2),
+	GATE(0, "clk_ddrc0", "clk_ddrc_div2",				18,  1),
 
-static struct rk_clk_pll_rate rk3399_pll_rates[] = {
-	{
-		.freq = 2208000000,
-		.refdiv = 1,
-		.fbdiv = 92,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 2184000000,
-		.refdiv = 1,
-		.fbdiv = 91,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 2160000000,
-		.refdiv = 1,
-		.fbdiv = 90,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 2136000000,
-		.refdiv = 1,
-		.fbdiv = 89,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 2112000000,
-		.refdiv = 1,
-		.fbdiv = 88,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 2088000000,
-		.refdiv = 1,
-		.fbdiv = 87,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 2064000000,
-		.refdiv = 1,
-		.fbdiv = 86,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 2040000000,
-		.refdiv = 1,
-		.fbdiv = 85,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 2016000000,
-		.refdiv = 1,
-		.fbdiv = 84,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1992000000,
-		.refdiv = 1,
-		.fbdiv = 83,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1968000000,
-		.refdiv = 1,
-		.fbdiv = 82,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1944000000,
-		.refdiv = 1,
-		.fbdiv = 81,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1920000000,
-		.refdiv = 1,
-		.fbdiv = 80,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1896000000,
-		.refdiv = 1,
-		.fbdiv = 79,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1872000000,
-		.refdiv = 1,
-		.fbdiv = 78,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1848000000,
-		.refdiv = 1,
-		.fbdiv = 77,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1824000000,
-		.refdiv = 1,
-		.fbdiv = 76,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1800000000,
-		.refdiv = 1,
-		.fbdiv = 75,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1776000000,
-		.refdiv = 1,
-		.fbdiv = 74,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1752000000,
-		.refdiv = 1,
-		.fbdiv = 73,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1728000000,
-		.refdiv = 1,
-		.fbdiv = 72,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1704000000,
-		.refdiv = 1,
-		.fbdiv = 71,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1680000000,
-		.refdiv = 1,
-		.fbdiv = 70,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1656000000,
-		.refdiv = 1,
-		.fbdiv = 69,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1632000000,
-		.refdiv = 1,
-		.fbdiv = 68,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1608000000,
-		.refdiv = 1,
-		.fbdiv = 67,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1600000000,
-		.refdiv = 3,
-		.fbdiv = 200,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1584000000,
-		.refdiv = 1,
-		.fbdiv = 66,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1560000000,
-		.refdiv = 1,
-		.fbdiv = 65,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1536000000,
-		.refdiv = 1,
-		.fbdiv = 64,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1512000000,
-		.refdiv = 1,
-		.fbdiv = 63,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1488000000,
-		.refdiv = 1,
-		.fbdiv = 62,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1464000000,
-		.refdiv = 1,
-		.fbdiv = 61,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1440000000,
-		.refdiv = 1,
-		.fbdiv = 60,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1416000000,
-		.refdiv = 1,
-		.fbdiv = 59,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1392000000,
-		.refdiv = 1,
-		.fbdiv = 58,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1368000000,
-		.refdiv = 1,
-		.fbdiv = 57,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1344000000,
-		.refdiv = 1,
-		.fbdiv = 56,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1320000000,
-		.refdiv = 1,
-		.fbdiv = 55,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1296000000,
-		.refdiv = 1,
-		.fbdiv = 54,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1272000000,
-		.refdiv = 1,
-		.fbdiv = 53,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1248000000,
-		.refdiv = 1,
-		.fbdiv = 52,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1200000000,
-		.refdiv = 1,
-		.fbdiv = 50,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1188000000,
-		.refdiv = 2,
-		.fbdiv = 99,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1104000000,
-		.refdiv = 1,
-		.fbdiv = 46,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1100000000,
-		.refdiv = 12,
-		.fbdiv = 550,
-		.postdiv1 = 1,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1008000000,
-		.refdiv = 1,
-		.fbdiv = 84,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 1000000000,
-		.refdiv = 1,
-		.fbdiv = 125,
-		.postdiv1 = 3,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 984000000,
-		.refdiv = 1,
-		.fbdiv = 82,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 960000000,
-		.refdiv = 1,
-		.fbdiv = 80,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 936000000,
-		.refdiv = 1,
-		.fbdiv = 78,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 912000000,
-		.refdiv = 1,
-		.fbdiv = 76,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 900000000,
-		.refdiv = 4,
-		.fbdiv = 300,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 888000000,
-		.refdiv = 1,
-		.fbdiv = 74,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 864000000,
-		.refdiv = 1,
-		.fbdiv = 72,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 840000000,
-		.refdiv = 1,
-		.fbdiv = 70,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 816000000,
-		.refdiv = 1,
-		.fbdiv = 68,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 800000000,
-		.refdiv = 1,
-		.fbdiv = 100,
-		.postdiv1 = 3,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 700000000,
-		.refdiv = 6,
-		.fbdiv = 350,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 696000000,
-		.refdiv = 1,
-		.fbdiv = 58,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 676000000,
-		.refdiv = 3,
-		.fbdiv = 169,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 600000000,
-		.refdiv = 1,
-		.fbdiv = 75,
-		.postdiv1 = 3,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 594000000,
-		.refdiv = 1,
-		.fbdiv = 99,
-		.postdiv1 = 4,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 533250000,
-		.refdiv = 8,
-		.fbdiv = 711,
-		.postdiv1 = 4,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 504000000,
-		.refdiv = 1,
-		.fbdiv = 63,
-		.postdiv1 = 3,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 500000000,
-		.refdiv = 6,
-		.fbdiv = 250,
-		.postdiv1 = 2,
-		.postdiv2 = 1,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 408000000,
-		.refdiv = 1,
-		.fbdiv = 68,
-		.postdiv1 = 2,
-		.postdiv2 = 2,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 312000000,
-		.refdiv = 1,
-		.fbdiv = 52,
-		.postdiv1 = 2,
-		.postdiv2 = 2,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 297000000,
-		.refdiv = 1,
-		.fbdiv = 99,
-		.postdiv1 = 4,
-		.postdiv2 = 2,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 216000000,
-		.refdiv = 1,
-		.fbdiv = 72,
-		.postdiv1 = 4,
-		.postdiv2 = 2,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 148500000,
-		.refdiv = 1,
-		.fbdiv = 99,
-		.postdiv1 = 4,
-		.postdiv2 = 4,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 106500000,
-		.refdiv = 1,
-		.fbdiv = 71,
-		.postdiv1 = 4,
-		.postdiv2 = 4,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 96000000,
-		.refdiv = 1,
-		.fbdiv = 64,
-		.postdiv1 = 4,
-		.postdiv2 = 4,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 74250000,
-		.refdiv = 2,
-		.fbdiv = 99,
-		.postdiv1 = 4,
-		.postdiv2 = 4,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 65000000,
-		.refdiv = 1,
-		.fbdiv = 65,
-		.postdiv1 = 6,
-		.postdiv2 = 4,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 54000000,
-		.refdiv = 1,
-		.fbdiv = 54,
-		.postdiv1 = 6,
-		.postdiv2 = 4,
-		.dsmpd = 1,
-	},
-	{
-		.freq = 27000000,
-		.refdiv = 1,
-		.fbdiv = 27,
-		.postdiv1 = 6,
-		.postdiv2 = 4,
-		.dsmpd = 1,
-	},
-	{},
-};
+	/* CRU_CLKGATE_CON19 */
+	/* 15 - 3 unused */
+	GATE(PCLK_DDR_SGRF, "pclk_ddr_sgrf", "pclk_ddr",		19, 2),
+	GATE(ACLK_CENTER_PERI_NOC, "aclk_center_peri_noc", "aclk_center", 19, 1),
+	GATE(ACLK_CENTER_MAIN_NOC, "aclk_center_main_noc", "aclk_center", 19, 0),
 
-static const char *pll_parents[] = {"xin24m"};
 
-static struct rk_clk_pll_def lpll = {
-	.clkdef = {
-		.id = PLL_APLLL,
-		.name = "lpll",
-		.parent_names = pll_parents,
-		.parent_cnt = nitems(pll_parents),
-	},
-	.base_offset = 0x00,
-	.gate_offset = 0x300,
-	.gate_shift = 0,
-	.flags = RK_CLK_PLL_HAVE_GATE,
-	.rates = rk3399_pll_rates,
-	.normal_mode = true,
-};
+	/* CRU_CLKGATE_CON20 */
+	GATE(0, "hclk_ahb1tom", "hclk_perihp",				20, 15),
+	GATE(0, "pclk_perihp_noc", "pclk_perihp",			20, 14),
+	GATE(0, "hclk_perihp_noc", "hclk_perihp",			20, 13),
+	GATE(0, "aclk_perihp_noc", "aclk_perihp",			20, 12),
+	GATE(PCLK_PCIE, "pclk_pcie", "pclk_perihp",			20, 11),
+	GATE(ACLK_PCIE, "aclk_pcie", "aclk_perihp",			20, 10),
+	GATE(HCLK_HSIC, "hclk_hsic", "hclk_perihp",			20, 9),
+	GATE(HCLK_HOST1_ARB, "hclk_host1_arb", "hclk_perihp",		20, 8),
+	GATE(HCLK_HOST1, "hclk_host1", "hclk_perihp",			20, 7),
+	GATE(HCLK_HOST0_ARB, "hclk_host0_arb", "hclk_perihp",		20, 6),
+	GATE(HCLK_HOST0, "hclk_host0", "hclk_perihp",			20, 5),
+	GATE(PCLK_PERIHP_GRF, "pclk_perihp_grf", "pclk_perihp",		20, 4),
+	GATE(ACLK_PERF_PCIE, "aclk_perf_pcie", "aclk_perihp",		20, 2),
+	/* 1 - 0 unused */
 
-static struct rk_clk_pll_def bpll = {
-	.clkdef = {
-		.id = PLL_APLLB,
-		.name = "bpll",
-		.parent_names = pll_parents,
-		.parent_cnt = nitems(pll_parents),
-	},
-	.base_offset = 0x20,
-	.gate_offset = 0x300,
-	.gate_shift = 1,
-	.flags = RK_CLK_PLL_HAVE_GATE,
-	.rates = rk3399_pll_rates,
-	.normal_mode = true,
-};
+	/* CRU_CLKGATE_CON21 */
+	/* 15 - 10 unused */
+	GATE(PCLK_UPHY1_TCPD_G, "pclk_uphy1_tcpd_g", "pclk_alive",	21, 9),
+	GATE(PCLK_UPHY1_TCPHY_G, "pclk_uphy1_tcphy_g", "pclk_alive",	21, 8),
+	/* 7 unused */
+	GATE(PCLK_UPHY0_TCPD_G, "pclk_uphy0_tcpd_g", "pclk_alive",	21, 6),
+	GATE(PCLK_UPHY0_TCPHY_G, "pclk_uphy0_tcphy_g", "pclk_alive",	21, 5),
+	GATE(PCLK_USBPHY_MUX_G, "pclk_usbphy_mux_g", "pclk_alive",	21, 4),
+	GATE(SCLK_DPHY_RX0_CFG, "clk_dphy_rx0_cfg", "clk_mipidphy_cfg",	21, 3),
+	GATE(SCLK_DPHY_TX1RX1_CFG, "clk_dphy_tx1rx1_cfg", "clk_mipidphy_cfg", 21, 2),
+	GATE(SCLK_DPHY_TX0_CFG, "clk_dphy_tx0_cfg", "clk_mipidphy_cfg",	21, 1),
+	GATE(SCLK_DPHY_PLL, "clk_dphy_pll", "clk_mipidphy_ref",		21, 0),
 
-static struct rk_clk_pll_def dpll = {
-	.clkdef = {
-		.id = PLL_DPLL,
-		.name = "dpll",
-		.parent_names = pll_parents,
-		.parent_cnt = nitems(pll_parents),
-	},
-	.base_offset = 0x40,
-	.gate_offset = 0x300,
-	.gate_shift = 2,
-	.flags = RK_CLK_PLL_HAVE_GATE,
-	.rates = rk3399_pll_rates,
-};
 
+	/* CRU_CLKGATE_CON22 */
+	GATE(PCLK_EFUSE1024S, "pclk_efuse1024s", "pclk_perilp1",	22, 15),
+	GATE(PCLK_EFUSE1024NS, "pclk_efuse1024ns", "pclk_perilp1",	22, 14),
+	GATE(PCLK_TSADC, "pclk_tsadc", "pclk_perilp1",			22, 13),
+	GATE(PCLK_SARADC, "pclk_saradc", "pclk_perilp1",		22, 12),
+	GATE(PCLK_MAILBOX0, "pclk_mailbox0", "pclk_perilp1",		22, 11),
+	GATE(PCLK_I2C3, "pclk_i2c3", "pclk_perilp1",			22, 10),
+	GATE(PCLK_I2C2, "pclk_i2c2", "pclk_perilp1",			22, 9),
+	GATE(PCLK_I2C6, "pclk_i2c6", "pclk_perilp1",			22, 8),
+	GATE(PCLK_I2C5, "pclk_i2c5", "pclk_perilp1",			22, 7),
+	GATE(PCLK_I2C1, "pclk_i2c1", "pclk_perilp1",			22, 6),
+	GATE(PCLK_I2C7, "pclk_i2c7", "pclk_perilp1",			22, 5),
+	GATE(PCLK_UART3, "pclk_uart3", "pclk_perilp1",			22, 3),
+	GATE(PCLK_UART2, "pclk_uart2", "pclk_perilp1",			22, 2),
+	GATE(PCLK_UART1, "pclk_uart1", "pclk_perilp1",			22, 1),
+	GATE(PCLK_UART0, "pclk_uart0", "pclk_perilp1",			22, 0),
 
-static struct rk_clk_pll_def cpll = {
-	.clkdef = {
-		.id = PLL_CPLL,
-		.name = "cpll",
-		.parent_names = pll_parents,
-		.parent_cnt = nitems(pll_parents),
-	},
-	.base_offset = 0x60,
-	.rates = rk3399_pll_rates,
-};
+	/* CRU_CLKGATE_CON23 */
+	/* 15 - 14 unused */
+	GATE(PCLK_SPI4, "pclk_spi4", "pclk_perilp1",			23, 13),
+	GATE(PCLK_SPI2, "pclk_spi2", "pclk_perilp1",			23, 12),
+	GATE(PCLK_SPI1, "pclk_spi1", "pclk_perilp1",			23, 11),
+	GATE(PCLK_SPI0, "pclk_spi0", "pclk_perilp1",			23, 10),
+	GATE(PCLK_DCF, "pclk_dcf", "pclk_perilp0",			23, 9),
+	GATE(ACLK_DCF, "aclk_dcf", "aclk_perilp0",			23, 8),
+	GATE(SCLK_INTMEM5, "clk_intmem5", "aclk_perilp0",		23, 7),
+	GATE(SCLK_INTMEM4, "clk_intmem4", "aclk_perilp0",		23, 6),
+	GATE(SCLK_INTMEM3, "clk_intmem3", "aclk_perilp0",		23, 5),
+	GATE(SCLK_INTMEM2, "clk_intmem2", "aclk_perilp0",		23, 4),
+	GATE(SCLK_INTMEM1, "clk_intmem1", "aclk_perilp0",		23, 3),
+	GATE(SCLK_INTMEM0, "clk_intmem0", "aclk_perilp0",		23, 2),
+	GATE(ACLK_TZMA, "aclk_tzma", "aclk_perilp0",			23, 1),
+	GATE(ACLK_INTMEM, "aclk_intmem", "aclk_perilp0",		23, 0),
 
-static struct rk_clk_pll_def gpll = {
-	.clkdef = {
-		.id = PLL_GPLL,
-		.name = "gpll",
-		.parent_names = pll_parents,
-		.parent_cnt = nitems(pll_parents),
-	},
-	.base_offset = 0x80,
-	.gate_offset = 0x300,
-	.gate_shift = 3,
-	.flags = RK_CLK_PLL_HAVE_GATE,
-	.rates = rk3399_pll_rates,
-};
+	/* CRU_CLKGATE_CON24 */
+	GATE(HCLK_S_CRYPTO1, "hclk_s_crypto1", "hclk_perilp0",		24, 15),
+	GATE(HCLK_M_CRYPTO1, "hclk_m_crypto1", "hclk_perilp0",		24, 14),
+	GATE(PCLK_PERIHP_GRF, "pclk_perilp_sgrf", "pclk_perilp1",	24, 13),
+	GATE(SCLK_M0_PERILP_DEC, "clk_m0_perilp_dec", "fclk_cm0s",	24, 11),
+	GATE(DCLK_M0_PERILP, "dclk_m0_perilp", "fclk_cm0s", 		24, 10),
+	GATE(HCLK_M0_PERILP, "hclk_m0_perilp", "fclk_cm0s", 		24, 9),
+	GATE(SCLK_M0_PERILP, "sclk_m0_perilp", "fclk_cm0s",		24, 8),
+	/* 7 - unused */
+	GATE(HCLK_S_CRYPTO0, "hclk_s_crypto0", "hclk_perilp0",		24, 6),
+	GATE(HCLK_M_CRYPTO0, "hclk_m_crypto0", "hclk_perilp0",		24, 5),
+	GATE(HCLK_ROM, "hclk_rom", "hclk_perilp0",			24, 4),
+	/* 3 - 0 unused */
 
-static struct rk_clk_pll_def npll = {
-	.clkdef = {
-		.id = PLL_NPLL,
-		.name = "npll",
-		.parent_names = pll_parents,
-		.parent_cnt = nitems(pll_parents),
-	},
-	.base_offset = 0xa0,
-	.rates = rk3399_pll_rates,
-};
+	/* CRU_CLKGATE_CON25 */
+	/* 15 - 13 unused */
+	GATE(0, "hclk_sdio_noc", "hclk_perilp1",			25, 12),
+	GATE(HCLK_M0_PERILP_NOC, "hclk_m0_perilp_noc", "fclk_cm0s",	25, 11),
+	GATE(0, "pclk_perilp1_noc", "pclk_perilp1",			25, 10),
+	GATE(0, "hclk_perilp1_noc", "hclk_perilp1",			25, 9),
+	GATE(HCLK_PERILP0_NOC, "hclk_perilp0_noc", "hclk_perilp0",	25, 8),
+	GATE(ACLK_PERILP0_NOC, "aclk_perilp0_noc", "aclk_perilp0",	25, 7),
+	GATE(ACLK_DMAC1_PERILP, "aclk_dmac1_perilp", "aclk_perilp0",	25, 6),
+	GATE(ACLK_DMAC0_PERILP, "aclk_dmac0_perilp", "aclk_perilp0",	25, 5),
+	/* 4 - 0 unused */
 
-static struct rk_clk_pll_def vpll = {
-	.clkdef = {
-		.id = PLL_VPLL,
-		.name = "vpll",
-		.parent_names = pll_parents,
-		.parent_cnt = nitems(pll_parents),
-	},
-	.base_offset = 0xc0,
-	.rates = rk3399_pll_rates,
-};
+	/* CRU_CLKGATE_CON26 */
+	/* 15 - 12 unused */
+	GATE(SCLK_TIMER11, "clk_timer11", "xin24m",			26, 11),
+	GATE(SCLK_TIMER10, "clk_timer10", "xin24m",			26, 10),
+	GATE(SCLK_TIMER09, "clk_timer09", "xin24m",			26, 9),
+	GATE(SCLK_TIMER08, "clk_timer08", "xin24m",			26, 8),
+	GATE(SCLK_TIMER07, "clk_timer07", "xin24m",			26, 7),
+	GATE(SCLK_TIMER06, "clk_timer06", "xin24m",			26, 6),
+	GATE(SCLK_TIMER05, "clk_timer05", "xin24m",			26, 5),
+	GATE(SCLK_TIMER04, "clk_timer04", "xin24m",			26, 4),
+	GATE(SCLK_TIMER03, "clk_timer03", "xin24m",			26, 3),
+	GATE(SCLK_TIMER02, "clk_timer02", "xin24m",			26, 2),
+	GATE(SCLK_TIMER01, "clk_timer01", "xin24m",			26, 1),
+	GATE(SCLK_TIMER00, "clk_timer00", "xin24m",			26, 0),
 
-#define	ACLK_PERIHP	192
-#define	HCLK_PERIHP	448
-#define	PCLK_PERIHP	320
+	/* CRU_CLKGATE_CON27 */
+	/* 15 - 9 unused */
+	GATE(ACLK_ISP1_WRAPPER, "aclk_isp1_wrapper", "hclk_isp1", 	27, 8),
+	GATE(HCLK_ISP1_WRAPPER, "hclk_isp1_wrapper", "aclk_isp0", 	27, 7),
+	GATE(PCLK_ISP1_WRAPPER, "pclkin_isp1_wrapper", "pclkin_cif",	27, 6),
+	GATE(ACLK_ISP0_WRAPPER, "aclk_isp0_wrapper", "aclk_isp0", 	27, 5),
+	GATE(HCLK_ISP0_WRAPPER, "hclk_isp0_wrapper", "hclk_isp0", 	27, 4),
+	GATE(ACLK_ISP1_NOC, "aclk_isp1_noc", "aclk_isp1",		27, 3),
+	GATE(HCLK_ISP1_NOC, "hclk_isp1_noc", "hclk_isp1",		27, 2),
+	GATE(ACLK_ISP0_NOC, "aclk_isp0_noc", "aclk_isp0",		27, 1),
+	GATE(HCLK_ISP0_NOC, "hclk_isp0_noc", "hclk_isp0",		27, 0),
 
-static const char *aclk_perihp_parents[] = {"cpll_aclk_perihp_src", "gpll_aclk_perihp_src"};
+	/* CRU_CLKGATE_CON28 */
+	/* 15 - 8 unused */
+	GATE(ACLK_VOP1, "aclk_vop1", "aclk_vop1_pre",			28, 7),
+	GATE(HCLK_VOP1, "hclk_vop1", "hclk_vop1_pre",			28, 6),
+	GATE(ACLK_VOP1_NOC, "aclk_vop1_noc", "aclk_vop1_pre",		28, 5),
+	GATE(HCLK_VOP1_NOC, "hclk_vop1_noc", "hclk_vop1_pre",		28, 4),
+	GATE(ACLK_VOP0, "aclk_vop0", "aclk_vop0_pre",			28, 3),
+	GATE(HCLK_VOP0, "hclk_vop0", "hclk_vop0_pre",			28, 2),
+	GATE(ACLK_VOP0_NOC, "aclk_vop0_noc", "aclk_vop0_pre",		28, 1),
+	GATE(HCLK_VOP0_NOC, "hclk_vop0_noc", "hclk_vop0_pre",		28, 0),
 
-static struct rk_clk_composite_def aclk_perihp = {
-	.clkdef = {
-		.id = ACLK_PERIHP,
-		.name = "aclk_perihp",
-		.parent_names = aclk_perihp_parents,
-		.parent_cnt = nitems(aclk_perihp_parents),
-	},
-	/* CRU_CLKSEL_CON14 */
-	.muxdiv_offset = 0x138,
+	/* CRU_CLKGATE_CON29 */
+	/* 15 - 13 unused */
+	GATE(PCLK_VIO_GRF, "pclk_vio_grf", "pclk_vio",			29, 12),
+	GATE(PCLK_GASKET, "pclk_gasket", "pclk_hdcp",			29, 11),
+	GATE(ACLK_HDCP22, "aclk_hdcp22", "aclk_hdcp",			29, 10),
+	GATE(HCLK_HDCP22, "hclk_hdcp22", "hclk_hdcp",			29, 9),
+	GATE(PCLK_HDCP22, "pclk_hdcp22", "pclk_hdcp",			29, 8),
+	GATE(PCLK_DP_CTRL, "pclk_dp_ctrl", "pclk_hdcp",			29, 7),
+	GATE(PCLK_HDMI_CTRL, "pclk_hdmi_ctrl", "pclk_hdcp",		29, 6),
+	GATE(HCLK_HDCP_NOC, "hclk_hdcp_noc", "hclk_hdcp",		29, 5),
+	GATE(ACLK_HDCP_NOC, "aclk_hdcp_noc", "aclk_hdcp",		29, 4),
+	GATE(PCLK_HDCP_NOC, "pclk_hdcp_noc", "pclk_hdcp",		29, 3),
+	GATE(PCLK_MIPI_DSI1, "pclk_mipi_dsi1", "pclk_vio", 		29, 2),
+	GATE(PCLK_MIPI_DSI0, "pclk_mipi_dsi0", "pclk_vio", 		29, 1),
+	GATE(ACLK_VIO_NOC, "aclk_vio_noc", "aclk_vio",			29, 0),
 
-	.mux_shift = 7,
-	.mux_width = 1,
+	/* CRU_CLKGATE_CON30 */
+	/* 15 - 12 unused */
+	GATE(ACLK_GPU_GRF, "aclk_gpu_grf", "aclk_gpu_pre", 		30, 11),
+	GATE(ACLK_PERF_GPU, "aclk_perf_gpu", "aclk_gpu_pre",		30, 10),
+	/* 9 unused */
+	GATE(ACLK_GPU, "aclk_gpu", "aclk_gpu_pre",			30, 8),
+	/* 7 - 5 unused */
+	GATE(ACLK_USB3_GRF, "aclk_usb3_grf", "aclk_usb3",		30, 4),
+	GATE(ACLK_USB3_RKSOC_AXI_PERF, "aclk_usb3_rksoc_axi_perf", "aclk_usb3", 30, 3),
+	GATE(ACLK_USB3OTG1, "aclk_usb3otg1", "aclk_usb3",		30, 2),
+	GATE(ACLK_USB3OTG0, "aclk_usb3otg0", "aclk_usb3",		30, 1),
+	GATE(ACLK_USB3_NOC, "aclk_usb3_noc", "aclk_usb3",		30, 0),
 
-	.div_shift = 0,
-	.div_width = 5,
+	/* CRU_CLKGATE_CON31 */
+	/* 15 - 11 unused */
+	GATE(PCLK_SGRF, "pclk_sgrf", "pclk_alive",			31, 10),
+	GATE(PCLK_PMU_INTR_ARB, "pclk_pmu_intr_arb", "pclk_alive",	31, 9),
+	GATE(PCLK_HSICPHY, "pclk_hsicphy", "pclk_perihp",		31, 8),
+	GATE(PCLK_TIMER1, "pclk_timer1", "pclk_alive",			31, 7),
+	GATE(PCLK_TIMER0, "pclk_timer0", "pclk_alive",			31, 6),
+	GATE(PCLK_GPIO4, "pclk_gpio4", "pclk_alive",			31, 5),
+	GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_alive",			31, 4),
+	GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_alive",			31, 3),
+	GATE(PCLK_INTR_ARB, "pclk_intr_arb", "pclk_alive",		31, 2),
+	GATE(PCLK_GRF, "pclk_grf", "pclk_alive",			31, 1),
+	/* 0 unused */
 
-	/* CRU_CLKGATE_CON5 */
-	.gate_offset = 0x314,
-	.gate_shift = 2,
+	/* CRU_CLKGATE_CON32 */
+	/* 15 - 14 unused */
+	GATE(PCLK_EDP_CTRL, "pclk_edp_ctrl", "pclk_edp",		32, 13),
+	GATE(PCLK_EDP_NOC, "pclk_edp_noc", "pclk_edp",			32, 12),
+	/* 11 unused */
+	GATE(ACLK_EMMC_GRF, "aclk_emmcgrf", "aclk_emmc",		32, 10),
+	GATE(ACLK_EMMC_NOC, "aclk_emmc_noc", "aclk_emmc",		32, 9),
+	GATE(ACLK_EMMC_CORE, "aclk_emmccore", "aclk_emmc",		32, 8),
+	/* 7 - 5 unused */
+	GATE(ACLK_PERF_GMAC, "aclk_perf_gmac", "aclk_gmac_pre",		32, 4),
+	GATE(PCLK_GMAC_NOC, "pclk_gmac_noc", "pclk_gmac_pre", 		32, 3),
+	GATE(PCLK_GMAC, "pclk_gmac", "pclk_gmac_pre",			32, 2),
+	GATE(ACLK_GMAC_NOC, "aclk_gmac_noc", "aclk_gmac_pre",		32, 1),
+	GATE(ACLK_GMAC, "aclk_gmac", "aclk_gmac_pre",			32, 0),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* CRU_CLKGATE_CON33 */
+	/* 15 - 10 unused */
+	GATE(0, "hclk_sdmmc_noc", "hclk_sd",				33, 9),
+	GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_sd", 			33, 8),
+	GATE(ACLK_GIC_ADB400_GIC_2_CORE_B, "aclk_gic_adb400_gic_2_core_b", "aclk_gic_pre", 33, 5),
+	GATE(ACLK_GIC_ADB400_GIC_2_CORE_L, "aclk_gic_adb400_gic_2_core_l", "aclk_gic_pre", 33, 4),
+	GATE(ACLK_GIC_ADB400_CORE_B_2_GIC, "aclk_gic_adb400_core_b_2_gic", "aclk_gic_pre", 33, 3),
+	GATE(ACLK_GIC_ADB400_CORE_L_2_GIC, "aclk_gic_adb400_core_l_2_gic", "aclk_gic_pre", 33, 2),
+	GATE(ACLK_GIC_NOC, "aclk_gic_noc", "aclk_gic_pre",		33, 1),
+	GATE(ACLK_GIC, "aclk_gic", "aclk_gic_pre",			33, 0),
 
-static const char *hclk_pclk_perihp_parents[] = {"aclk_perihp"};
-
-static struct rk_clk_composite_def hclk_perihp = {
-	.clkdef = {
-		.id = HCLK_PERIHP,
-		.name = "hclk_perihp",
-		.parent_names = hclk_pclk_perihp_parents,
-		.parent_cnt = nitems(hclk_pclk_perihp_parents),
-	},
-	/* CRU_CLKSEL_CON14 */
-	.muxdiv_offset = 0x138,
-
-	.div_shift = 8,
-	.div_width = 2,
-
-	/* CRU_CLKGATE_CON5 */
-	.gate_offset = 0x314,
-	.gate_shift = 3,
-
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
+	/* CRU_CLKGATE_CON34 */
+	/* 15 - 7 unused */
+	GATE(0, "hclk_sdioaudio_noc", "hclk_perilp1",			34, 6),
+	GATE(PCLK_SPI5, "pclk_spi5", "hclk_perilp1",			34, 5),
+	GATE(HCLK_SDIO, "hclk_sdio", "hclk_perilp1",			34, 4),
+	GATE(HCLK_SPDIF, "hclk_spdif", "hclk_perilp1",			34, 3),
+	GATE(HCLK_I2S2_8CH, "hclk_i2s2", "hclk_perilp1",		34, 2),
+	GATE(HCLK_I2S1_8CH, "hclk_i2s1", "hclk_perilp1",		34, 1),
+	GATE(HCLK_I2S0_8CH, "hclk_i2s0", "hclk_perilp1",		34, 0),
 };
 
-static struct rk_clk_composite_def pclk_perihp = {
-	.clkdef = {
-		.id = PCLK_PERIHP,
-		.name = "pclk_perihp",
-		.parent_names = hclk_pclk_perihp_parents,
-		.parent_cnt = nitems(hclk_pclk_perihp_parents),
-	},
-	/* CRU_CLKSEL_CON14 */
-	.muxdiv_offset = 0x138,
+#define PLL_RATE(_hz, _ref, _fb, _post1, _post2, _dspd)			\
+{									\
+	.freq = _hz,							\
+	.refdiv = _ref,							\
+	.fbdiv = _fb,							\
+	.postdiv1 = _post1,						\
+	.postdiv2 = _post2,						\
+	.dsmpd = _dspd,							\
+}
 
-	.div_shift = 12,
-	.div_width = 3,
-
-	/* CRU_CLKGATE_CON5 */
-	.gate_offset = 0x314,
-	.gate_shift = 4,
-
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
+static struct rk_clk_pll_rate rk3399_pll_rates[] = {
+	/* _mhz, _refdiv, _fbdiv, _postdiv1, _postdiv2, _dsmpd, _frac */
+	PLL_RATE(2208000000,  1,  92, 1, 1, 1),
+	PLL_RATE(2184000000,  1,  91, 1, 1, 1),
+	PLL_RATE(2160000000,  1,  90, 1, 1, 1),
+	PLL_RATE(2136000000,  1,  89, 1, 1, 1),
+	PLL_RATE(2112000000,  1,  88, 1, 1, 1),
+	PLL_RATE(2088000000,  1,  87, 1, 1, 1),
+	PLL_RATE(2064000000,  1,  86, 1, 1, 1),
+	PLL_RATE(2040000000,  1,  85, 1, 1, 1),
+	PLL_RATE(2016000000,  1,  84, 1, 1, 1),
+	PLL_RATE(1992000000,  1,  83, 1, 1, 1),
+	PLL_RATE(1968000000,  1,  82, 1, 1, 1),
+	PLL_RATE(1944000000,  1,  81, 1, 1, 1),
+	PLL_RATE(1920000000,  1,  80, 1, 1, 1),
+	PLL_RATE(1896000000,  1,  79, 1, 1, 1),
+	PLL_RATE(1872000000,  1,  78, 1, 1, 1),
+	PLL_RATE(1848000000,  1,  77, 1, 1, 1),
+	PLL_RATE(1824000000,  1,  76, 1, 1, 1),
+	PLL_RATE(1800000000,  1,  75, 1, 1, 1),
+	PLL_RATE(1776000000,  1,  74, 1, 1, 1),
+	PLL_RATE(1752000000,  1,  73, 1, 1, 1),
+	PLL_RATE(1728000000,  1,  72, 1, 1, 1),
+	PLL_RATE(1704000000,  1,  71, 1, 1, 1),
+	PLL_RATE(1680000000,  1,  70, 1, 1, 1),
+	PLL_RATE(1656000000,  1,  69, 1, 1, 1),
+	PLL_RATE(1632000000,  1,  68, 1, 1, 1),
+	PLL_RATE(1608000000,  1,  67, 1, 1, 1),
+	PLL_RATE(1600000000,  3, 200, 1, 1, 1),
+	PLL_RATE(1584000000,  1,  66, 1, 1, 1),
+	PLL_RATE(1560000000,  1,  65, 1, 1, 1),
+	PLL_RATE(1536000000,  1,  64, 1, 1, 1),
+	PLL_RATE(1512000000,  1,  63, 1, 1, 1),
+	PLL_RATE(1488000000,  1,  62, 1, 1, 1),
+	PLL_RATE(1464000000,  1,  61, 1, 1, 1),
+	PLL_RATE(1440000000,  1,  60, 1, 1, 1),
+	PLL_RATE(1416000000,  1,  59, 1, 1, 1),
+	PLL_RATE(1392000000,  1,  58, 1, 1, 1),
+	PLL_RATE(1368000000,  1,  57, 1, 1, 1),
+	PLL_RATE(1344000000,  1,  56, 1, 1, 1),
+	PLL_RATE(1320000000,  1,  55, 1, 1, 1),
+	PLL_RATE(1296000000,  1,  54, 1, 1, 1),
+	PLL_RATE(1272000000,  1,  53, 1, 1, 1),
+	PLL_RATE(1248000000,  1,  52, 1, 1, 1),
+	PLL_RATE(1200000000,  1,  50, 1, 1, 1),
+	PLL_RATE(1188000000,  2,  99, 1, 1, 1),
+	PLL_RATE(1104000000,  1,  46, 1, 1, 1),
+	PLL_RATE(1100000000, 12, 550, 1, 1, 1),
+	PLL_RATE(1008000000,  1,  84, 2, 1, 1),
+	PLL_RATE(1000000000,  1, 125, 3, 1, 1),
+	PLL_RATE( 984000000,  1,  82, 2, 1, 1),
+	PLL_RATE( 960000000,  1,  80, 2, 1, 1),
+	PLL_RATE( 936000000,  1,  78, 2, 1, 1),
+	PLL_RATE( 912000000,  1,  76, 2, 1, 1),
+	PLL_RATE( 900000000,  4, 300, 2, 1, 1),
+	PLL_RATE( 888000000,  1,  74, 2, 1, 1),
+	PLL_RATE( 864000000,  1,  72, 2, 1, 1),
+	PLL_RATE( 840000000,  1,  70, 2, 1, 1),
+	PLL_RATE( 816000000,  1,  68, 2, 1, 1),
+	PLL_RATE( 800000000,  1, 100, 3, 1, 1),
+	PLL_RATE( 700000000,  6, 350, 2, 1, 1),
+	PLL_RATE( 696000000,  1,  58, 2, 1, 1),
+	PLL_RATE( 676000000,  3, 169, 2, 1, 1),
+	PLL_RATE( 600000000,  1,  75, 3, 1, 1),
+	PLL_RATE( 594000000,  1,  99, 4, 1, 1),
+	PLL_RATE( 533250000,  8, 711, 4, 1, 1),
+	PLL_RATE( 504000000,  1,  63, 3, 1, 1),
+	PLL_RATE( 500000000,  6, 250, 2, 1, 1),
+	PLL_RATE( 408000000,  1,  68, 2, 2, 1),
+	PLL_RATE( 312000000,  1,  52, 2, 2, 1),
+	PLL_RATE( 297000000,  1,  99, 4, 2, 1),
+	PLL_RATE( 216000000,  1,  72, 4, 2, 1),
+	PLL_RATE( 148500000,  1,  99, 4, 4, 1),
+	PLL_RATE( 106500000,  1,  71, 4, 4, 1),
+	PLL_RATE(  96000000,  1,  64, 4, 4, 1),
+	PLL_RATE(  74250000,  2,  99, 4, 4, 1),
+	PLL_RATE(  65000000,  1,  65, 6, 4, 1),
+	PLL_RATE(  54000000,  1,  54, 6, 4, 1),
+	PLL_RATE(  27000000,  1,  27, 6, 4, 1),
+	{},
 };
 
-#define	ACLK_PERILP0	194
-#define	HCLK_PERILP0	449
-#define	PCLK_PERILP0	322
-
-static const char *aclk_perilp0_parents[] = {"cpll_aclk_perilp0_src", "gpll_aclk_perilp0_src"};
-
-static struct rk_clk_composite_def aclk_perilp0 = {
-	.clkdef = {
-		.id = ACLK_PERILP0,
-		.name = "aclk_perilp0",
-		.parent_names = aclk_perilp0_parents,
-		.parent_cnt = nitems(aclk_perilp0_parents),
-	},
-	/* CRU_CLKSEL_CON14 */
-	.muxdiv_offset = 0x15C,
-
-	.mux_shift = 7,
-	.mux_width = 1,
-
-	.div_shift = 0,
-	.div_width = 5,
-
-	/* CRU_CLKGATE_CON7 */
-	.gate_offset = 0x31C,
-	.gate_shift = 2,
-
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
+static struct rk_clk_armclk_rates rk3399_cpu_l_rates[]  = {
+	{1800000000, 1},
+	{1704000000, 1},
+	{1608000000, 1},
+	{1512000000, 1},
+	{1488000000, 1},
+	{1416000000, 1},
+	{1200000000, 1},
+	{1008000000, 1},
+	{ 816000000, 1},
+	{ 696000000, 1},
+	{ 600000000, 1},
+	{ 408000000, 1},
+	{ 312000000, 1},
+	{ 216000000, 1},
+	{  96000000, 1},
 };
 
-static const char *hclk_pclk_perilp0_parents[] = {"aclk_perilp0"};
-
-static struct rk_clk_composite_def hclk_perilp0 = {
-	.clkdef = {
-		.id = HCLK_PERILP0,
-		.name = "hclk_perilp0",
-		.parent_names = hclk_pclk_perilp0_parents,
-		.parent_cnt = nitems(hclk_pclk_perilp0_parents),
-	},
-	/* CRU_CLKSEL_CON23 */
-	.muxdiv_offset = 0x15C,
-
-	.div_shift = 8,
-	.div_width = 2,
-
-	/* CRU_CLKGATE_CON7 */
-	.gate_offset = 0x31C,
-	.gate_shift = 3,
-
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
+static struct rk_clk_armclk_rates rk3399_cpu_b_rates[] = {
+	{2208000000, 1},
+	{2184000000, 1},
+	{2088000000, 1},
+	{2040000000, 1},
+	{2016000000, 1},
+	{1992000000, 1},
+	{1896000000, 1},
+	{1800000000, 1},
+	{1704000000, 1},
+	{1608000000, 1},
+	{1512000000, 1},
+	{1488000000, 1},
+	{1416000000, 1},
+	{1200000000, 1},
+	{1008000000, 1},
+	{ 816000000, 1},
+	{ 696000000, 1},
+	{ 600000000, 1},
+	{ 408000000, 1},
+	{ 312000000, 1},
+	{ 216000000, 1},
+	{  96000000, 1},
 };
 
-static struct rk_clk_composite_def pclk_perilp0 = {
-	.clkdef = {
-		.id = PCLK_PERILP0,
-		.name = "pclk_perilp0",
-		.parent_names = hclk_pclk_perilp0_parents,
-		.parent_cnt = nitems(hclk_pclk_perilp0_parents),
-	},
-	/* CRU_CLKSEL_CON23 */
-	.muxdiv_offset = 0x15C,
 
-	.div_shift = 12,
-	.div_width = 3,
+/* Standard PLL. */
+#define PLL(_id, _name, _base,  _nm)					\
+{									\
+	.type = RK3399_CLK_PLL,						\
+	.clk.pll = &(struct rk_clk_pll_def) {				\
+		.clkdef.id = _id,					\
+		.clkdef.name = _name,					\
+		.clkdef.parent_names = pll_src_p,			\
+		.clkdef.parent_cnt = nitems(pll_src_p),			\
+		.clkdef.flags = CLK_NODE_STATIC_STRINGS,		\
+		.base_offset = _base,					\
+		.rates = rk3399_pll_rates,				\
+		.normal_mode = _nm					\
+	},								\
+}
 
-	/* CRU_CLKGATE_CON7 */
-	.gate_offset = 0x31C,
-	.gate_shift = 4,
+#define PLIST(_name) static const char *_name[]
+PLIST(pll_src_p) = {"xin24m", "xin32k"};
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
+PLIST(armclkl_p) = {"clk_core_l_lpll_src", "clk_core_l_bpll_src",
+		    "clk_core_l_dpll_src", "clk_core_l_gpll_src"};
+PLIST(armclkb_p) = {"clk_core_b_lpll_src", "clk_core_b_bpll_src",
+		    "clk_core_b_dpll_src", "clk_core_b_gpll_src"};
+PLIST(ddrclk_p) = {"clk_ddrc_lpll_src", "clk_ddrc_bpll_src",
+		   "clk_ddrc_dpll_src", "clk_ddrc_gpll_src"};
+PLIST(pll_src_cpll_gpll_p) =		{"cpll", "gpll"};
+PLIST(pll_src_cpll_gpll_ppll_p) =	{"cpll", "gpll", "ppll"};
+PLIST(pll_src_cpll_gpll_upll_p) =	{"cpll", "gpll", "upll"};
+PLIST(pll_src_npll_cpll_gpll_p) =	{"npll", "cpll", "gpll"};
+PLIST(pll_src_cpll_gpll_npll_npll_p) =	{"cpll", "gpll", "npll", "npll"};
+PLIST(pll_src_cpll_gpll_npll_ppll_p) =	{"cpll", "gpll", "npll", "ppll" };
+PLIST(pll_src_cpll_gpll_npll_24m_p) =	{"cpll", "gpll", "npll",  "xin24m" };
+PLIST(pll_src_cpll_gpll_npll_usbphy480m_p)= {"cpll", "gpll", "npll", "clk_usbphy_480m" };
+PLIST(pll_src_ppll_cpll_gpll_npll_upll_p) = { "ppll", "cpll", "gpll", "npll", "upll" };
+PLIST(pll_src_cpll_gpll_npll_upll_24m_p)= { "cpll", "gpll", "npll", "upll", "xin24m" };
+PLIST(pll_src_cpll_gpll_npll_ppll_upll_24m_p) = { "cpll", "gpll", "npll",  "ppll", "upll", "xin24m" };
+PLIST(pll_src_vpll_cpll_gpll_gpll_p) = 	{"vpll", "cpll", "gpll", "gpll"};
+PLIST(pll_src_vpll_cpll_gpll_npll_p) = 	{"vpll", "cpll", "gpll", "npll"};
 
-/*
- * misc
- */
-#define	PCLK_ALIVE		390
+PLIST(aclk_cci_p) = {"cpll_aclk_cci_src", "gpll_aclk_cci_src",
+		     "npll_aclk_cci_src", "vpll_aclk_cci_src"};
+PLIST(cci_trace_p) = {"cpll_cci_trace","gpll_cci_trace"};
+PLIST(cs_p)= {"cpll_cs", "gpll_cs", "npll_cs","npll_cs"};
+PLIST(aclk_perihp_p)= {"cpll_aclk_perihp_src", "gpll_aclk_perihp_src" };
+PLIST(dclk_vop0_p) =	{"dclk_vop0_div", "dclk_vop0_frac"};
+PLIST(dclk_vop1_p)= 	{"dclk_vop1_div", "dclk_vop1_frac"};
 
-static const char *alive_parents[] = {"gpll"};
+PLIST(clk_cif_p) = 	{"clk_cifout_src", "xin24m"};
 
-static struct rk_clk_composite_def pclk_alive = {
-	.clkdef = {
-		.id = PCLK_ALIVE,
-		.name = "pclk_alive",
-		.parent_names = alive_parents,
-		.parent_cnt = nitems(alive_parents),
-	},
-	/* CRU_CLKSEL_CON57 */
-	.muxdiv_offset = 0x01e4,
 
-	.div_shift = 0,
-	.div_width = 5,
-};
+PLIST(pll_src_24m_usbphy480m_p) = { "xin24m", "clk_usbphy_480m"};
+PLIST(pll_src_24m_pciephy_p) = { "xin24m", "clk_pciephy_ref100m"};
+PLIST(pll_src_24m_32k_cpll_gpll_p)= {"xin24m", "xin32k", "cpll", "gpll"};
+PLIST(pciecore_cru_phy_p) = {"clk_pcie_core_cru", "clk_pcie_core_phy"};
 
-#define	HCLK_PERILP1		450
-#define	PCLK_PERILP1		323
+PLIST(aclk_emmc_p)		= { "cpll_aclk_emmc_src", "gpll_aclk_emmc_src"};
 
-static const char *hclk_perilp1_parents[] = {"cpll", "gpll"};
+PLIST(aclk_perilp0_p)		= { "cpll_aclk_perilp0_src",
+					    "gpll_aclk_perilp0_src" };
 
-static struct rk_clk_composite_def hclk_perilp1 = {
-	.clkdef = {
-		.id = HCLK_PERILP1,
-		.name = "hclk_perilp1",
-		.parent_names = hclk_perilp1_parents,
-		.parent_cnt = nitems(hclk_perilp1_parents),
-	},
-	/* CRU_CLKSEL_CON25 */
-	.muxdiv_offset = 0x164,
-	.mux_shift = 7,
-	.mux_width = 1,
+PLIST(fclk_cm0s_p)			= { "cpll_fclk_cm0s_src",
+					    "gpll_fclk_cm0s_src" };
 
-	.div_shift = 0,
-	.div_width = 5,
+PLIST(hclk_perilp1_p)		= { "cpll_hclk_perilp1_src",
+					    "gpll_hclk_perilp1_src" };
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX,
-};
+PLIST(clk_testout1_p)		= { "clk_testout1_pll_src", "xin24m" };
+PLIST(clk_testout2_p)		= { "clk_testout2_pll_src", "xin24m" };
 
-static const char *pclk_perilp1_parents[] = {"hclk_perilp1"};
+PLIST(usbphy_480m_p)		= { "clk_usbphy0_480m_src",
+					    "clk_usbphy1_480m_src" };
+PLIST(aclk_gmac_p)		= { "cpll_aclk_gmac_src",
+				    "gpll_aclk_gmac_src" };
+PLIST(rmii_p)			= { "clk_gmac", "clkin_gmac" };
+PLIST(spdif_p)			= { "clk_spdif_div", "clk_spdif_frac",
+				    "clkin_i2s", "xin12m" };
+PLIST(i2s0_p)			= { "clk_i2s0_div", "clk_i2s0_frac",
+				    "clkin_i2s", "xin12m" };
+PLIST(i2s1_p)			= { "clk_i2s1_div", "clk_i2s1_frac",
+				    "clkin_i2s", "xin12m" };
+PLIST(i2s2_p)			= { "clk_i2s2_div", "clk_i2s2_frac",
+				    "clkin_i2s", "xin12m" };
+PLIST(i2sch_p)			= {"clk_i2s0", "clk_i2s1", "clk_i2s2"};
+PLIST(i2sout_p)			= {"clk_i2sout_src", "xin12m"};
 
-static struct rk_clk_composite_def pclk_perilp1 = {
-	.clkdef = {
-		.id = PCLK_PERILP1,
-		.name = "pclk_perilp1",
-		.parent_names = pclk_perilp1_parents,
-		.parent_cnt = nitems(pclk_perilp1_parents),
-	},
-	/* CRU_CLKSEL_CON25 */
-	.muxdiv_offset = 0x164,
+PLIST(uart0_p)= {"clk_uart0_div", "clk_uart0_frac", "xin24m"};
+PLIST(uart1_p)= {"clk_uart1_div", "clk_uart1_frac", "xin24m"};
+PLIST(uart2_p)= {"clk_uart2_div", "clk_uart2_frac", "xin24m"};
+PLIST(uart3_p)= {"clk_uart3_div", "clk_uart3_frac", "xin24m"};
 
-	.div_shift = 8,
-	.div_width = 3,
+static struct rk_clk rk3399_clks[] = {
 
-	/* CRU_CLKGATE_CON8 */
-	.gate_offset = 0x320,
-	.gate_shift = 2,
+	/* External clocks */
+	LINK("xin24m"),
+	FRATE(0, "xin32k", 32768),
+	FFACT(0, "xin12m", "xin24m", 1, 2),
+	FRATE(0, "clkin_i2s", 0),
+	FRATE(0, "pclkin_cif", 0),
+	LINK("clk_usbphy0_480m"),
+	LINK("clk_usbphy1_480m"),
+	LINK("clkin_gmac"),
+	FRATE(0, "clk_pcie_core_phy", 0),
+	FFACT(0, "clk_ddrc_div2", "clk_ddrc", 1, 2),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* PLLs */
+	PLL(PLL_APLLL, "lpll", 0x00, false),
+	PLL(PLL_APLLB, "bpll", 0x20, true),
+	PLL(PLL_DPLL,  "dpll", 0x40, false),
+	PLL(PLL_CPLL,  "cpll", 0x60, false),
+	PLL(PLL_GPLL,  "gpll", 0x80, false),
+	PLL(PLL_NPLL,  "npll", 0xA0, false),
+	PLL(PLL_VPLL,  "vpll", 0xC0, false),
 
-/* USB3 clock */
+	/*  CRU_CLKSEL_CON0 */
+	CDIV(0, "aclkm_core_l_c", "armclkl", 0,
+	    0, 8, 5),
+	ARMDIV(ARMCLKL, "armclkl", armclkl_p, rk3399_cpu_l_rates,
+	    0, 0, 5,	6, 2, 0, 3),
+	/* CRU_CLKSEL_CON1 */
+	CDIV(0, "pclk_dbg_core_l_c", "armclkl", 0,
+	    1, 8, 5),
+	CDIV(0, "atclk_core_l_c", "armclkl", 0,
+	    1, 0, 5),
 
-#define	ACLK_USB3	244
-static const char *aclk_usb3_parents[] = {"cpll", "gpll", "npll", "npll"};
-static struct rk_clk_composite_def aclk_usb3 = {
-	.clkdef = {
-		.id = ACLK_USB3,
-		.name = "aclk_usb3",
-		.parent_names = aclk_usb3_parents,
-		.parent_cnt = nitems(aclk_usb3_parents),
-	},
-	/* CRU_CLKSET_CON39 */
-	.muxdiv_offset = 0x19C,
-	.mux_shift = 6,
-	.mux_width = 2,
+	/* CRU_CLKSEL_CON2 */
+	CDIV(0, "aclkm_core_b_c", "armclkb", 0,
+	    2, 8, 5),
+	ARMDIV(ARMCLKB, "armclkb", armclkb_p, rk3399_cpu_b_rates,
+	    2, 0, 5,	6, 2, 1, 3),
 
-	.div_shift = 0,
-	.div_width = 5,
+	/* CRU_CLKSEL_CON3 */
+	CDIV(0, "pclken_dbg_core_b", "pclk_dbg_core_b", 0,
+	    3, 13, 2),
+	CDIV(0, "pclk_dbg_core_b_c", "armclkb", 0,
+	    3, 8, 5),
+	CDIV(0, "atclk_core_b_c", "armclkb", 0,
+	    3, 0, 5),
 
-	/* CRU_CLKGATE_CON12 */
-	.gate_offset = 0x330,
-	.gate_shift = 0,
+	/* CRU_CLKSEL_CON4 */
+	COMP(0, "clk_cs", cs_p, 0,
+	    4, 0, 5,	6, 2),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* CRU_CLKSEL_CON5 */
+	COMP(0, "clk_cci_trace_c", cci_trace_p, 0,
+	    5, 8, 5,	15, 1),
+	COMP(0, "aclk_cci_pre_c", aclk_cci_p, 0,
+	    5, 0, 5, 	6, 2),
 
-/*
- * i2c
- */
-static const char *i2c_parents[] = {"cpll", "gpll"};
+	/*  CRU_CLKSEL_CON6 */
+	COMP(0, "pclk_ddr_c", pll_src_cpll_gpll_p, 0,
+	    6, 8, 5,	15, 1),
+	COMP(SCLK_DDRC, "clk_ddrc", ddrclk_p, 0,
+	    6, 0, 3, 	4, 2),
 
-#define	SCLK_I2C1	65
-#define	SCLK_I2C2	66
-#define	SCLK_I2C3	67
-#define	SCLK_I2C5	68
-#define	SCLK_I2C6	69
-#define	SCLK_I2C7	70
+	/* CRU_CLKSEL_CON7 */
+	CDIV(0, "hclk_vcodec_pre_c", "aclk_vcodec_pre", 0,
+	    7, 8, 5),
+	COMP(0, "aclk_vcodec_pre_c", pll_src_cpll_gpll_npll_ppll_p, 0,
+	    7, 0, 5,	6, 2),
 
-static struct rk_clk_composite_def i2c1 = {
-	.clkdef = {
-		.id = SCLK_I2C1,
-		.name = "clk_i2c1",
-		.parent_names = i2c_parents,
-		.parent_cnt = nitems(i2c_parents),
-	},
-	/* CRU_CLKSEL_CON61 */
-	.muxdiv_offset = 0x01f4,
-	.mux_shift = 7,
-	.mux_width = 1,
+	/* CRU_CLKSEL_CON8 */
+	CDIV(0, "hclk_vdu_pre_c", "aclk_vdu_pre", 0,
+	    8, 8, 5),
+	COMP(0, "aclk_vdu_pre_c", pll_src_cpll_gpll_npll_ppll_p, 0,
+	    8, 0, 5,	6, 2),
 
-	.div_shift = 0,
-	.div_width = 7,
+	/* CRU_CLKSEL_CON9 */
+	COMP(0, "clk_vdu_ca_c", pll_src_cpll_gpll_npll_npll_p, 0,
+	    9, 8, 5,	14, 2),
+	COMP(0, "clk_vdu_core_c", pll_src_cpll_gpll_npll_npll_p, 0,
+	    9, 0, 5,	6, 2),
 
-	/* CRU_CLKGATE_CON10 */
-	.gate_offset = 0x0328,
-	.gate_shift = 0,
+	/* CRU_CLKSEL_CON10 */
+	CDIV(0, "hclk_iep_pre_c", "aclk_iep_pre", 0,
+	    10, 8, 5),
+	COMP(0, "aclk_iep_pre_c", pll_src_cpll_gpll_npll_ppll_p, 0,
+	    10, 0, 5, 	6, 2),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* CRU_CLKSEL_CON11 */
+	CDIV(0, "hclk_rga_pre_c", "aclk_rga_pre", 0,
+	    11, 8, 5),
+	COMP(0, "aclk_rga_pre_c", pll_src_cpll_gpll_npll_ppll_p, 0,
+	    11, 0, 5,	 6, 2),
 
-static struct rk_clk_composite_def i2c2 = {
-	.clkdef = {
-		.id = SCLK_I2C2,
-		.name = "clk_i2c2",
-		.parent_names = i2c_parents,
-		.parent_cnt = nitems(i2c_parents),
-	},
-	/* CRU_CLKSEL_CON62 */
-	.muxdiv_offset = 0x01f8,
-	.mux_shift = 7,
-	.mux_width = 1,
+	/* CRU_CLKSEL_CON12 */
+	COMP(0, "aclk_center_c", pll_src_cpll_gpll_npll_npll_p, 0,
+	    12, 8, 5, 	14, 2),
+	COMP(SCLK_RGA_CORE, "clk_rga_core_c", pll_src_cpll_gpll_npll_ppll_p, 0,
+	    12, 0, 5, 	6, 2),
 
-	.div_shift = 0,
-	.div_width = 7,
+	/* CRU_CLKSEL_CON13 */
+	COMP(0, "hclk_sd_c", pll_src_cpll_gpll_p, 0,
+	    13, 8, 5,	15, 1),
+	COMP(0, "aclk_gpu_pre_c", pll_src_ppll_cpll_gpll_npll_upll_p, 0,
+	    13, 0, 5,	5, 3),
 
-	/* CRU_CLKGATE_CON10 */
-	.gate_offset = 0x0328,
-	.gate_shift = 2,
+	/* CRU_CLKSEL_CON14 */
+	MUX(0, "upll", pll_src_24m_usbphy480m_p, 0,
+	    14, 	15, 1),
+	CDIV(0, "pclk_perihp_c", "aclk_perihp", 0,
+	    14, 12, 2),
+	CDIV(0, "hclk_perihp_c", "aclk_perihp", 0,
+	    14, 8, 2),
+	MUX(0, "clk_usbphy_480m", usbphy_480m_p, 0,
+	    14,		 6, 1),
+	COMP(0, "aclk_perihp_c", aclk_perihp_p, 0,
+	    14, 0, 5,	7, 1),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* CRU_CLKSEL_CON15 */
+	COMP(0, "clk_sdio_c", pll_src_cpll_gpll_npll_ppll_upll_24m_p, 0,
+	    15, 0, 7,	8, 3),
 
-static struct rk_clk_composite_def i2c3 = {
-	.clkdef = {
-		.id = SCLK_I2C3,
-		.name = "clk_i2c3",
-		.parent_names = i2c_parents,
-		.parent_cnt = nitems(i2c_parents),
-	},
-	/* CRU_CLKSEL_CON63 */
-	.muxdiv_offset = 0x01fc,
-	.mux_shift = 7,
-	.mux_width = 1,
+	/* CRU_CLKSEL_CON16 */
+	COMP(0, "clk_sdmmc_c", pll_src_cpll_gpll_npll_ppll_upll_24m_p, 0,
+	    16, 0, 7,	8, 3),
 
-	.div_shift = 0,
-	.div_width = 7,
+	/* CRU_CLKSEL_CON17 */
+	COMP(0, "clk_pcie_pm_c", pll_src_cpll_gpll_npll_24m_p, 0,
+	    17, 0, 7,	8, 3),
 
-	/* CRU_CLKGATE_CON10 */
-	.gate_offset = 0x0328,
-	.gate_shift = 4,
+	/* CRU_CLKSEL_CON18 */
+	CDIV(0, "clk_pciephy_ref100m_c", "npll", 0,
+	    18, 11, 5),
+	MUX(SCLK_PCIEPHY_REF, "clk_pciephy_ref", pll_src_24m_pciephy_p, 0,
+	    18,		10, 1),
+	MUX(SCLK_PCIE_CORE, "clk_pcie_core", pciecore_cru_phy_p, 0,
+	    18,		7, 1),
+	COMP(0, "clk_pcie_core_cru_c", pll_src_cpll_gpll_npll_npll_p, 0,
+	    18, 0, 7,	8, 2),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* CRU_CLKSEL_CON19 */
+	CDIV(0, "pclk_gmac_pre_c", "aclk_gmac_pre", 0,
+	    19, 8, 3),
+	MUX(SCLK_RMII_SRC, "clk_rmii_src",rmii_p, 0,
+	    19,		4, 1),
+	MUX(SCLK_HSICPHY, "clk_hsicphy_c", pll_src_cpll_gpll_npll_usbphy480m_p, 0,
+	    19,		0, 2),
 
-static struct rk_clk_composite_def i2c5 = {
-	.clkdef = {
-		.id = SCLK_I2C5,
-		.name = "clk_i2c5",
-		.parent_names = i2c_parents,
-		.parent_cnt = nitems(i2c_parents),
-	},
-	/* CRU_CLKSEL_CON61 */
-	.muxdiv_offset = 0x01f4,
-	.mux_shift = 15,
-	.mux_width = 1,
+	/* CRU_CLKSEL_CON20 */
+	COMP(0, "clk_gmac_c", pll_src_cpll_gpll_npll_npll_p, 0,
+	    20, 8, 5,	14, 2),
+	COMP(0, "aclk_gmac_pre_c", aclk_gmac_p, 0,
+	    20, 0, 5,	7, 1),
 
-	.div_shift = 8,
-	.div_width = 7,
+	/* CRU_CLKSEL_CON21 */
+	COMP(ACLK_EMMC, "aclk_emmc", aclk_emmc_p, 0,
+	    21, 0, 5,	7, 1),
 
-	/* CRU_CLKGATE_CON10 */
-	.gate_offset = 0x0328,
-	.gate_shift = 1,
+	/* CRU_CLKSEL_CON22 */
+	COMP(0, "clk_emmc_c", pll_src_cpll_gpll_npll_upll_24m_p, 0,
+	    22, 0, 7,	8, 3),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* CRU_CLKSEL_CON23 */
+	CDIV(0, "pclk_perilp0_c", "aclk_perilp0", 0,
+	    23, 12, 3),
+	CDIV(0, "hclk_perilp0_c", "aclk_perilp0", 0,
+	    23, 8, 2),
+	COMP(0, "aclk_perilp0_c", aclk_perilp0_p, 0,
+	    23, 0, 5,	7, 1),
 
-static struct rk_clk_composite_def i2c6 = {
-	.clkdef = {
-		.id = SCLK_I2C6,
-		.name = "clk_i2c6",
-		.parent_names = i2c_parents,
-		.parent_cnt = nitems(i2c_parents),
-	},
-	/* CRU_CLKSEL_CON62 */
-	.muxdiv_offset = 0x01f8,
-	.mux_shift = 15,
-	.mux_width = 1,
+	/* CRU_CLKSEL_CON24 */
+	COMP(0, "fclk_cm0s_c", fclk_cm0s_p, 0,
+	    24, 8, 5,	15, 1),
+	COMP(0, "clk_crypto0_c", pll_src_cpll_gpll_ppll_p, 0,
+	    24, 0, 5,	6, 2),
 
-	.div_shift = 8,
-	.div_width = 7,
+	/* CRU_CLKSEL_CON25 */
+	CDIV(0, "pclk_perilp1_c", "hclk_perilp1", 0,
+	    25, 8, 3),
+	COMP(HCLK_PERILP1, "hclk_perilp1", hclk_perilp1_p, 0,
+	    25, 0, 5,	7, 1),
 
-	/* CRU_CLKGATE_CON10 */
-	.gate_offset = 0x0328,
-	.gate_shift = 3,
+	/* CRU_CLKSEL_CON26 */
+	CDIV(0, "clk_saradc_c", "xin24m", 0,
+	    26, 8, 8),
+	COMP(0, "clk_crypto1_c", pll_src_cpll_gpll_ppll_p, 0,
+	    26, 0, 5,	6, 2),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* CRU_CLKSEL_CON27 */
+	COMP(0, "clk_tsadc_c", pll_src_p, 0,
+	    27, 0, 10,	15, 1),
 
-static struct rk_clk_composite_def i2c7 = {
-	.clkdef = {
-		.id = SCLK_I2C7,
-		.name = "clk_i2c7",
-		.parent_names = i2c_parents,
-		.parent_cnt = nitems(i2c_parents),
-	},
-	/* CRU_CLKSEL_CON63 */
-	.muxdiv_offset = 0x01fc,
-	.mux_shift = 15,
-	.mux_width = 1,
+	/* CRU_CLKSEL_CON28 */
+	MUX(0, "clk_i2s0_mux", i2s0_p, 0,
+	    28, 8, 2),
+	COMP(0, "clk_i2s0_div_c", pll_src_cpll_gpll_p, 0,
+	    28, 0, 7,	7, 1),
 
-	.div_shift = 8,
-	.div_width = 7,
+	/* CRU_CLKSEL_CON29 */
+	MUX(0, "clk_i2s1_mux", i2s1_p, 0,
+	    29,		8, 2),
+	COMP(0, "clk_i2s1_div_c", pll_src_cpll_gpll_p, 0,
+	    29, 0, 7,	7, 1),
 
-	/* CRU_CLKGATE_CON10 */
-	.gate_offset = 0x0328,
-	.gate_shift = 5,
+	/* CRU_CLKSEL_CON30 */
+	MUX(0, "clk_i2s2_mux", i2s2_p, 0,
+	    30,		8, 2),
+	COMP(0, "clk_i2s2_div_c", pll_src_cpll_gpll_p, 0,
+	    30, 0, 7,	7, 1),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* CRU_CLKSEL_CON31 */
+	MUX(0, "clk_i2sout_c", i2sout_p, 0,
+	    31,		2, 1),
+	MUX(0, "clk_i2sout_src", i2sch_p, 0,
+	    31,		0, 2),
 
-/* USB3 */
+	/* CRU_CLKSEL_CON32 */
+	COMP(0, "clk_spdif_rec_dptx_c", pll_src_cpll_gpll_p, 0,
+	    32, 8, 5,	15, 1),
+	MUX(0, "clk_spdif_mux", spdif_p, 0,
+	    32,		13, 2),
+	COMP(0, "clk_spdif_div_c", pll_src_cpll_gpll_p, 0,
+	    32, 0, 7,	7, 1),
 
-#define	SCLK_UPHY0_TCPDPHY_REF	125
-#define	SCLK_UPHY0_TCPDCORE	126
+	/* CRU_CLKSEL_CON33 */
+	MUX(0, "clk_uart_src", pll_src_cpll_gpll_p, 0,
+	    33,		15, 1),
+	MUX(0, "clk_uart0_src", pll_src_cpll_gpll_upll_p, 0,
+	    33,		12, 2),
+	MUX(SCLK_UART0, "clk_uart0", uart0_p, 0,
+	    33,		8, 2),
+	CDIV(0, "clk_uart0_div_c", "clk_uart0_src", 0,
+	    33, 0, 7),
 
-/* Missing xin32k exported by rk808 */
-static const char *uphy0_tcpdphy_ref_parents[] = {"xin24m"};
+	/* CRU_CLKSEL_CON34 */
+	MUX(SCLK_UART1, "clk_uart1", uart1_p, 0,
+	    34,		8, 2),
+	CDIV(0, "clk_uart1_div_c", "clk_uart_src", 0,
+	    34, 0, 7),
 
-static struct rk_clk_composite_def uphy0_tcpdphy_ref = {
-	.clkdef = {
-		.id = SCLK_UPHY0_TCPDPHY_REF,
-		.name = "uphy0_tcpdphy_ref",
-		.parent_names = uphy0_tcpdphy_ref_parents,
-		.parent_cnt = nitems(uphy0_tcpdphy_ref_parents),
-	},
-	/* CRU_CLKSET_CON64 */
-	.muxdiv_offset = 0x0200,
-	.mux_shift = 15,
-	.mux_width = 1,
+	/* CRU_CLKSEL_CON35 */
+	MUX(SCLK_UART2, "clk_uart2", uart2_p, 0,
+	    35,		8, 2),
+	CDIV(0, "clk_uart2_div_c", "clk_uart_src", 0,
+	    35, 0, 7),
 
-	.div_shift = 8,
-	.div_width = 5,
+	/* CRU_CLKSEL_CON36 */
+	MUX(SCLK_UART3, "clk_uart3", uart3_p, 0,
+	    36,		8, 2),
+	CDIV(0, "clk_uart3_div_c", "clk_uart_src", 0,
+	    36, 0, 7),
 
-	/* CRU_CLKGATE_CON13 */
-	.gate_offset = 0x0334,
-	.gate_shift = 4,
+	/* CRU_CLKSEL_CON37 */
+	/* unused */
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* CRU_CLKSEL_CON38 */
+	MUX(0, "clk_testout2_pll_src", pll_src_cpll_gpll_npll_npll_p, 0,
+	    38,		14, 2),
+	COMP(0, "clk_testout2_c", clk_testout2_p, 0,
+	    38, 8, 5,	13, 1),
+	MUX(0, "clk_testout1_pll_src", pll_src_cpll_gpll_npll_npll_p, 0,
+	    38,		6, 2),
+	COMP(0, "clk_testout1_c", clk_testout1_p, 0,
+	    38, 0, 5,	5, 1),
 
-/* Missing xin32k exported by rk808 */
-static const char *uphy0_tcpdcore_parents[] = {"xin24m", "xin24m", "cpll", "gpll"};
+	/* CRU_CLKSEL_CON39 */
+	COMP(0, "aclk_usb3_c", pll_src_cpll_gpll_npll_npll_p, 0,
+	    39, 0, 5,	6, 2),
 
-static struct rk_clk_composite_def uphy0_tcpdcore = {
-	.clkdef = {
-		.id = SCLK_UPHY0_TCPDCORE,
-		.name = "uphy0_tcpdcore",
-		.parent_names = uphy0_tcpdcore_parents,
-		.parent_cnt = nitems(uphy0_tcpdcore_parents),
-	},
-	/* CRU_CLKSET_CON64 */
-	.muxdiv_offset = 0x0200,
-	.mux_shift = 6,
-	.mux_width = 2,
+	/* CRU_CLKSEL_CON40 */
+	COMP(0, "clk_usb3otg0_suspend_c", pll_src_p, 0,
+	    40, 0, 10,	15, 1),
 
-	.div_shift = 0,
-	.div_width = 5,
+	/* CRU_CLKSEL_CON41 */
+	COMP(0, "clk_usb3otg1_suspend_c", pll_src_p, 0,
+	    41, 0, 10,	15, 1),
 
-	/* CRU_CLKGATE_CON13 */
-	.gate_offset = 0x0334,
-	.gate_shift = 5,
+	/* CRU_CLKSEL_CON42 */
+	COMP(0, "aclk_hdcp_c", pll_src_cpll_gpll_ppll_p, 0,
+	    42, 8, 5,	14, 2),
+	COMP(0, "aclk_vio_c", pll_src_cpll_gpll_ppll_p, 0,
+	    42, 0, 5,	6, 2),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
 
-#define	SCLK_UPHY1_TCPDPHY_REF	127
-#define	SCLK_UPHY1_TCPDCORE	128
+	/* CRU_CLKSEL_CON43 */
+	CDIV(0, "pclk_hdcp_c", "aclk_hdcp", 0,
+	    43, 10, 5),
+	CDIV(0, "hclk_hdcp_c", "aclk_hdcp", 0,
+	    43, 5, 5),
+	CDIV(0, "pclk_vio_c", "aclk_vio", 0,
+	    43, 0, 5),
 
-/* Missing xin32k exported by rk808 */
-static const char *uphy1_tcpdphy_ref_parents[] = {"xin24m"};
+	/* CRU_CLKSEL_CON44 */
+	COMP(0, "pclk_edp_c", pll_src_cpll_gpll_p, 0,
+	    44, 8, 6,	15, 1),
 
-static struct rk_clk_composite_def uphy1_tcpdphy_ref = {
-	.clkdef = {
-		.id = SCLK_UPHY1_TCPDPHY_REF,
-		.name = "uphy1_tcpdphy_ref",
-		.parent_names = uphy1_tcpdphy_ref_parents,
-		.parent_cnt = nitems(uphy1_tcpdphy_ref_parents),
-	},
-	/* CRU_CLKSET_CON65 */
-	.muxdiv_offset = 0x0204,
-	.mux_shift = 15,
-	.mux_width = 1,
+	/* CRU_CLKSEL_CON45  - XXX clocks in mux are reversed in TRM !!!*/
+	COMP(0, "clk_hdmi_cec_c", pll_src_p, 0,
+	    45, 0, 10,	15, 1),
 
-	.div_shift = 8,
-	.div_width = 5,
+	/* CRU_CLKSEL_CON46 */
+	COMP(0, "clk_dp_core_c", pll_src_npll_cpll_gpll_p, 0,
+	    46, 0, 5,	6, 2),
 
-	/* CRU_CLKGATE_CON13 */
-	.gate_offset = 0x0334,
-	.gate_shift = 6,
+	/* CRU_CLKSEL_CON47 */
+	CDIV(0, "hclk_vop0_pre_c", "aclk_vop0_pre_c", 0,
+	    47, 8, 5),
+	COMP(0, "aclk_vop0_pre_c", pll_src_vpll_cpll_gpll_npll_p, 0,
+	    47, 0, 5,	6, 2),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* CRU_CLKSEL_CON48 */
+	CDIV(0, "hclk_vop1_pre_c", "aclk_vop1_pre", 0,
+	    48, 8, 5),
+	COMP(0, "aclk_vop1_pre_c", pll_src_vpll_cpll_gpll_npll_p, 0,
+	    48, 0, 5,	6, 2),
 
-/* Missing xin32k exported by rk808 */
-static const char *uphy1_tcpdcore_parents[] = {"xin24m", "xin24m", "cpll", "gpll"};
+	/* CRU_CLKSEL_CON49 */
+	MUX(DCLK_VOP0, "dclk_vop0", dclk_vop0_p, 0,
+	    49,		11, 1),
+	COMP(0, "dclk_vop0_div_c", pll_src_vpll_cpll_gpll_gpll_p, 0,
+	    49, 0, 8,	8, 2),
 
-static struct rk_clk_composite_def uphy1_tcpdcore = {
-	.clkdef = {
-		.id = SCLK_UPHY1_TCPDCORE,
-		.name = "uphy1_tcpdcore",
-		.parent_names = uphy1_tcpdcore_parents,
-		.parent_cnt = nitems(uphy1_tcpdcore_parents),
-	},
-	/* CRU_CLKSET_CON65 */
-	.muxdiv_offset = 0x0204,
-	.mux_shift = 6,
-	.mux_width = 2,
+	/* CRU_CLKSEL_CON50 */
+	MUX(DCLK_VOP1, "dclk_vop1", dclk_vop1_p, 0,
+	    50,		11, 1),
+	COMP(0, "dclk_vop1_div_c", pll_src_vpll_cpll_gpll_gpll_p, 0,
+	    50, 0, 8,	8, 2),
 
-	.div_shift = 0,
-	.div_width = 5,
+	/* CRU_CLKSEL_CON51 */
+	COMP(0, "clk_vop0_pwm_c", pll_src_vpll_cpll_gpll_gpll_p, 0,
+	    51, 0, 5,	6, 2),
 
-	/* CRU_CLKGATE_CON13 */
-	.gate_offset = 0x0334,
-	.gate_shift = 7,
+	/* CRU_CLKSEL_CON52 */
+	COMP(0, "clk_vop1_pwm_c", pll_src_vpll_cpll_gpll_gpll_p, 0,
+	    52, 0, 5,	6, 2),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* CRU_CLKSEL_CON53 */
+	CDIV(0, "hclk_isp0_c", "aclk_isp0", 0,
+	    53, 8, 5),
+	COMP(0, "aclk_isp0_c", pll_src_cpll_gpll_ppll_p, 0,
+	    53, 0, 5,	6, 2),
 
-/*
- * spi
- */
-static const char *spi_parents[] = {"cpll", "gpll"};
+	/* CRU_CLKSEL_CON54 */
+	CDIV(0, "hclk_isp1_c", "aclk_isp1", 0,
+	    54, 8, 5),
+	COMP(0, "aclk_isp1_c", pll_src_cpll_gpll_ppll_p, 0,
+	    54, 0, 5,	6, 2),
 
-#define	SCLK_SPI0	71
-#define	SCLK_SPI1	72
-#define	SCLK_SPI2	73
-#define	SCLK_SPI4	74
-#define	SCLK_SPI5	75
+	/* CRU_CLKSEL_CON55 */
+	COMP(0, "clk_isp1_c", pll_src_cpll_gpll_npll_npll_p, 0,
+	    55, 8, 5,	14, 2),
+	COMP(0, "clk_isp0_c", pll_src_cpll_gpll_npll_npll_p, 0,
+	    55, 0, 5,	6, 2),
 
-static struct rk_clk_composite_def spi0 = {
-	.clkdef = {
-		.id = SCLK_SPI0,
-		.name = "clk_spi0",
-		.parent_names = spi_parents,
-		.parent_cnt = nitems(spi_parents),
-	},
-	/* CRU_CLKSEL_CON59 */
-	.muxdiv_offset = 0x01ec,
-	.mux_shift = 7,
-	.mux_width = 1,
+	/* CRU_CLKSEL_CON56 */
+	COMP(0, "aclk_gic_pre_c", pll_src_cpll_gpll_p, 0,
+	    56, 8, 5,	15, 1),
+	MUX(0, "clk_cifout_src_c", pll_src_cpll_gpll_npll_npll_p, 0,
+	    56,		6, 2),
+	COMP(SCLK_CIF_OUT, "clk_cifout", clk_cif_p, 0,
+	    56, 0, 5,	5, 1),
 
-	.div_shift = 0,
-	.div_width = 7,
+	/* CRU_CLKSEL_CON57 */
+	CDIV(0, "clk_test_24m", "xin24m", 0,
+	    57, 6, 10),
+	CDIV(PCLK_ALIVE, "pclk_alive", "gpll", 0,
+	    57, 0, 5),
 
-	/* CRU_CLKGATE_CON9 */
-	.gate_offset = 0x0324,
-	.gate_shift = 12,
+	/* CRU_CLKSEL_CON58 */
+	COMP(0, "clk_spi5_c", pll_src_cpll_gpll_p, 0,
+	    58, 8, 7,	15, 1),
+	MUX(0, "clk_test_pre", pll_src_cpll_gpll_p, 0,
+	    58,		7, 1),
+	CDIV(0, "clk_test_c", "clk_test_pre", 0,
+	    58, 0, 5),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
-
-static struct rk_clk_composite_def spi1 = {
-	.clkdef = {
-		.id = SCLK_SPI1,
-		.name = "clk_spi1",
-		.parent_names = spi_parents,
-		.parent_cnt = nitems(spi_parents),
-	},
 	/* CRU_CLKSEL_CON59 */
-	.muxdiv_offset = 0x01ec,
-	.mux_shift = 15,
-	.mux_width = 1,
+	COMP(0, "clk_spi1_c", pll_src_cpll_gpll_p, 0,
+	    59, 8, 7,	15, 1),
+	COMP(0, "clk_spi0_c", pll_src_cpll_gpll_p, 0,
+	    59, 0, 7,	7, 1),
 
-	.div_shift = 8,
-	.div_width = 7,
-
-	/* CRU_CLKGATE_CON9 */
-	.gate_offset = 0x0324,
-	.gate_shift = 13,
-
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
-
-static struct rk_clk_composite_def spi2 = {
-	.clkdef = {
-		.id = SCLK_SPI2,
-		.name = "clk_spi2",
-		.parent_names = spi_parents,
-		.parent_cnt = nitems(spi_parents),
-	},
 	/* CRU_CLKSEL_CON60 */
-	.muxdiv_offset = 0x01f0,
-	.mux_shift = 7,
-	.mux_width = 1,
+	COMP(0, "clk_spi4_c", pll_src_cpll_gpll_p, 0,
+	    60, 8, 7,	15, 1),
+	COMP(0, "clk_spi2_c", pll_src_cpll_gpll_p, 0,
+	    60, 0, 7,	7, 1),
 
-	.div_shift = 0,
-	.div_width = 7,
+	/* CRU_CLKSEL_CON61 */
+	COMP(0, "clk_i2c5_c", pll_src_cpll_gpll_p, 0,
+	    61, 8, 7,	15, 1),
+	COMP(0, "clk_i2c1_c", pll_src_cpll_gpll_p, 0,
+	    61, 0, 7,	7, 1),
 
-	/* CRU_CLKGATE_CON9 */
-	.gate_offset = 0x0324,
-	.gate_shift = 14,
+	/* CRU_CLKSEL_CON62 */
+	COMP(0, "clk_i2c6_c", pll_src_cpll_gpll_p, 0,
+	    62, 8, 7,	15, 1),
+	COMP(0, "clk_i2c2_c", pll_src_cpll_gpll_p, 0,
+	    62, 0, 7,	7, 1),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
+	/* CRU_CLKSEL_CON63 */
+	COMP(0, "clk_i2c7_c", pll_src_cpll_gpll_p, 0,
+	    63, 8, 7,	15, 1),
+	COMP(0, "clk_i2c3_c", pll_src_cpll_gpll_p, 0,
+	    63, 0, 7,	7, 1),
 
-static struct rk_clk_composite_def spi4 = {
-	.clkdef = {
-		.id = SCLK_SPI4,
-		.name = "clk_spi4",
-		.parent_names = spi_parents,
-		.parent_cnt = nitems(spi_parents),
-	},
-	/* CRU_CLKSEL_CON60 */
-	.muxdiv_offset = 0x01f0,
-	.mux_shift = 15,
-	.mux_width = 1,
+	/* CRU_CLKSEL_CON64 */
+	COMP(0, "clk_uphy0_tcpdphy_ref_c", pll_src_p, 0,
+	    64, 8, 5,	15, 1),
+	COMP(0, "clk_uphy0_tcpdcore_c", pll_src_24m_32k_cpll_gpll_p, 0,
+	    64, 0, 5,	6, 2),
 
-	.div_shift = 8,
-	.div_width = 7,
+	/* CRU_CLKSEL_CON65 */
+	COMP(0, "clk_uphy1_tcpdphy_ref_c", pll_src_p, 0,
+	    65, 8, 5,	15, 1),
+	COMP(0, "clk_uphy1_tcpdcore_c", pll_src_24m_32k_cpll_gpll_p, 0,
+	    65, 0, 5,	6, 2),
 
-	/* CRU_CLKGATE_CON9 */
-	.gate_offset = 0x0324,
-	.gate_shift = 15,
+	/* CRU_CLKSEL_CON99  - 107 */
+	FRACT(0, "clk_spdif_frac_c", "clk_spdif_div", 0,
+	    99),
+	FRACT(0, "clk_i2s0_frac_c", "clk_i2s0_div", 0,
+	    96),
+	FRACT(0, "clk_i2s1_frac_c", "clk_i2s1_div", 0,
+	    97),
+	FRACT(0, "clk_i2s2_frac_c", "clk_i2s2_div", 0,
+	    98),
+	FRACT(0, "clk_uart0_frac_c", "clk_uart0_div", 0,
+	    100),
+	FRACT(0, "clk_uart1_frac_c", "clk_uart1_div", 0,
+	    101),
+	FRACT(0, "clk_uart2_frac_c", "clk_uart2_div", 0,
+	    102),
+	FRACT(0, "clk_uart3_frac_c", "clk_uart3_div", 0,
+	    103),
+	FRACT(0, "clk_test_frac_c", "clk_test_pre", 0,
+	    105),
+	FRACT(DCLK_VOP0_FRAC, "dclk_vop0_frac", "dclk_vop0_div", 0,
+	    106),
+	FRACT(DCLK_VOP1_FRAC, "dclk_vop1_frac", "dclk_vop1_div", 0,
+	    107),
 
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
-
-static struct rk_clk_composite_def spi5 = {
-	.clkdef = {
-		.id = SCLK_SPI5,
-		.name = "clk_spi5",
-		.parent_names = spi_parents,
-		.parent_cnt = nitems(spi_parents),
-	},
-	/* CRU_CLKSEL_CON58 */
-	.muxdiv_offset = 0x01e8,
-	.mux_shift = 15,
-	.mux_width = 1,
-
-	.div_shift = 8,
-	.div_width = 7,
-
-	/* CRU_CLKGATE_CON13 */
-	.gate_offset = 0x0334,
-	.gate_shift = 13,
-
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
-
-/*
- * ARM CPU clocks (LITTLE and big)
+/* Not yet implemented yet
+ *	MMC(SCLK_SDMMC_DRV,     "sdmmc_drv",    "clk_sdmmc", RK3399_SDMMC_CON0, 1),
+ *	MMC(SCLK_SDMMC_SAMPLE,  "sdmmc_sample", "clk_sdmmc", RK3399_SDMMC_CON1, 1),
+ *	MMC(SCLK_SDIO_DRV,      "sdio_drv",     "clk_sdio",  RK3399_SDIO_CON0,  1),
+ *	MMC(SCLK_SDIO_SAMPLE,   "sdio_sample",  "clk_sdio",  RK3399_SDIO_CON1,  1),
  */
-#define ARMCLKL				8
-#define ARMCLKB				9
 
-static const char *armclk_parents[] = {"lpll", "bpll", "dpll", "gpll"};
 
-static struct rk_clk_armclk_rates rk3399_armclkl_rates[] = {
-	{
-		.freq = 1800000000,
-		.div = 1,
-	},
-	{
-		.freq = 1704000000,
-		.div = 1,
-	},
-	{
-		.freq = 1608000000,
-		.div = 1,
-	},
-	{
-		.freq = 1512000000,
-		.div = 1,
-	},
-	{
-		.freq = 1488000000,
-		.div = 1,
-	},
-	{
-		.freq = 1416000000,
-		.div = 1,
-	},
-	{
-		.freq = 1200000000,
-		.div = 1,
-	},
-	{
-		.freq = 1008000000,
-		.div = 1,
-	},
-	{
-		.freq = 816000000,
-		.div = 1,
-	},
-	{
-		.freq = 696000000,
-		.div = 1,
-	},
-	{
-		.freq = 600000000,
-		.div = 1,
-	},
-	{
-		.freq = 408000000,
-		.div = 1,
-	},
-	{
-		.freq = 312000000,
-		.div = 1,
-	},
-	{
-		.freq = 216000000,
-		.div = 1,
-	},
-	{
-		.freq = 96000000,
-		.div = 1,
-	},
-};
 
-static struct rk_clk_armclk_def armclk_l = {
-	.clkdef = {
-		.id = ARMCLKL,
-		.name = "armclkl",
-		.parent_names = armclk_parents,
-		.parent_cnt = nitems(armclk_parents),
-	},
-	/* CRU_CLKSEL_CON0 */
-	.muxdiv_offset = 0x100,
-	.mux_shift = 6,
-	.mux_width = 2,
-
-	.div_shift = 0,
-	.div_width = 5,
-
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX,
-	.main_parent = 0,
-	.alt_parent = 3,
-
-	.rates = rk3399_armclkl_rates,
-	.nrates = nitems(rk3399_armclkl_rates),
-};
-
-static struct rk_clk_armclk_rates rk3399_armclkb_rates[] = {
-	{
-		.freq = 2208000000,
-		.div = 1,
-	},
-	{
-		.freq = 2184000000,
-		.div = 1,
-	},
-	{
-		.freq = 2088000000,
-		.div = 1,
-	},
-	{
-		.freq = 2040000000,
-		.div = 1,
-	},
-	{
-		.freq = 2016000000,
-		.div = 1,
-	},
-	{
-		.freq = 1992000000,
-		.div = 1,
-	},
-	{
-		.freq = 1896000000,
-		.div = 1,
-	},
-	{
-		.freq = 1800000000,
-		.div = 1,
-	},
-	{
-		.freq = 1704000000,
-		.div = 1,
-	},
-	{
-		.freq = 1608000000,
-		.div = 1,
-	},
-	{
-		.freq = 1512000000,
-		.div = 1,
-	},
-	{
-		.freq = 1488000000,
-		.div = 1,
-	},
-	{
-		.freq = 1416000000,
-		.div = 1,
-	},
-	{
-		.freq = 1200000000,
-		.div = 1,
-	},
-	{
-		.freq = 1008000000,
-		.div = 1,
-	},
-	{
-		.freq = 816000000,
-		.div = 1,
-	},
-	{
-		.freq = 696000000,
-		.div = 1,
-	},
-	{
-		.freq = 600000000,
-		.div = 1,
-	},
-	{
-		.freq = 408000000,
-		.div = 1,
-	},
-	{
-		.freq = 312000000,
-		.div = 1,
-	},
-	{
-		.freq = 216000000,
-		.div = 1,
-	},
-	{
-		.freq = 96000000,
-		.div = 1,
-	},
-};
-
-static struct rk_clk_armclk_def armclk_b = {
-	.clkdef = {
-		.id = ARMCLKB,
-		.name = "armclkb",
-		.parent_names = armclk_parents,
-		.parent_cnt = nitems(armclk_parents),
-	},
-	.muxdiv_offset = 0x108,
-	.mux_shift = 6,
-	.mux_width = 2,
-
-	.div_shift = 0,
-	.div_width = 5,
-
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX,
-	.main_parent = 1,
-	.alt_parent = 3,
-
-	.rates = rk3399_armclkb_rates,
-	.nrates = nitems(rk3399_armclkb_rates),
-};
-
-/*
- * sdmmc
- */
-
-#define	HCLK_SD		461
-
-static const char *hclk_sd_parents[] = {"cpll", "gpll"};
-
-static struct rk_clk_composite_def hclk_sd = {
-	.clkdef = {
-		.id = HCLK_SD,
-		.name = "hclk_sd",
-		.parent_names = hclk_sd_parents,
-		.parent_cnt = nitems(hclk_sd_parents),
-	},
-
-	.muxdiv_offset = 0x134,
-	.mux_shift = 15,
-	.mux_width = 1,
-
-	.div_shift = 8,
-	.div_width = 5,
-
-	.gate_offset = 0x330,
-	.gate_shift = 13,
-
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
-
-#define	SCLK_SDMMC		76
-
-static const char *sclk_sdmmc_parents[] = {"cpll", "gpll", "npll", "ppll"};
-
-static struct rk_clk_composite_def sclk_sdmmc = {
-	.clkdef = {
-		.id = SCLK_SDMMC,
-		.name = "sclk_sdmmc",
-		.parent_names = sclk_sdmmc_parents,
-		.parent_cnt = nitems(sclk_sdmmc_parents),
-	},
-
-	.muxdiv_offset = 0x140,
-	.mux_shift = 8,
-	.mux_width = 3,
-
-	.div_shift = 0,
-	.div_width = 7,
-
-	.gate_offset = 0x318,
-	.gate_shift = 1,
-
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
-
-/*
- * emmc
- */
-
-#define	SCLK_EMMC		78
-
-static const char *sclk_emmc_parents[] = {"cpll", "gpll", "npll"};
-
-static struct rk_clk_composite_def sclk_emmc = {
-	.clkdef = {
-		.id = SCLK_EMMC,
-		.name = "sclk_emmc",
-		.parent_names = sclk_emmc_parents,
-		.parent_cnt = nitems(sclk_emmc_parents),
-	},
-
-	.muxdiv_offset = 0x158,
-	.mux_shift = 8,
-	.mux_width = 3,
-
-	.div_shift = 0,
-	.div_width = 7,
-
-	.gate_offset = 0x318,
-	.gate_shift = 14,
-
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
-};
-
-#define	ACLK_EMMC		240
-
-static const char *aclk_emmc_parents[] = {
-	"cpll_aclk_emmc_src",
-	"gpll_aclk_emmc_src"
-};
-
-static struct rk_clk_composite_def aclk_emmc = {
-	.clkdef = {
-		.id = ACLK_EMMC,
-		.name = "aclk_emmc",
-		.parent_names = aclk_emmc_parents,
-		.parent_cnt = nitems(aclk_emmc_parents),
-	},
-
-	.muxdiv_offset = 0x154,
-	.mux_shift = 7,
-	.mux_width = 1,
-
-	.div_shift = 0,
-	.div_width = 5,
-
-	.flags = RK_CLK_COMPOSITE_HAVE_MUX,
-};
-
-static struct rk_clk rk3399_clks[] = {
-	{
-		.type = RK3399_CLK_PLL,
-		.clk.pll = &lpll
-	},
-	{
-		.type = RK3399_CLK_PLL,
-		.clk.pll = &bpll
-	},
-	{
-		.type = RK3399_CLK_PLL,
-		.clk.pll = &dpll
-	},
-	{
-		.type = RK3399_CLK_PLL,
-		.clk.pll = &cpll
-	},
-	{
-		.type = RK3399_CLK_PLL,
-		.clk.pll = &gpll
-	},
-	{
-		.type = RK3399_CLK_PLL,
-		.clk.pll = &npll
-	},
-	{
-		.type = RK3399_CLK_PLL,
-		.clk.pll = &vpll
-	},
-
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &aclk_perihp,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &hclk_perihp,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &pclk_perihp,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &aclk_perilp0,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &hclk_perilp0,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &pclk_perilp0,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &pclk_alive,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &hclk_perilp1,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &pclk_perilp1,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &aclk_usb3,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &i2c1,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &i2c2,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &i2c3,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &i2c5,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &i2c6,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &i2c7,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &uphy0_tcpdphy_ref,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &uphy0_tcpdcore,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &uphy1_tcpdphy_ref,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &uphy1_tcpdcore,
-	},
-
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &spi0,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &spi1,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &spi2,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &spi4,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &spi5,
-	},
-
-	{
-		.type = RK_CLK_ARMCLK,
-		.clk.armclk = &armclk_l,
-	},
-	{
-		.type = RK_CLK_ARMCLK,
-		.clk.armclk = &armclk_b,
-	},
-
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &hclk_sd,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &sclk_sdmmc,
-	},
-
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &sclk_emmc,
-	},
-	{
-		.type = RK_CLK_COMPOSITE,
-		.clk.composite = &aclk_emmc,
-	},
 };
 
 static int
 rk3399_cru_probe(device_t dev)
 {
 
 	if (!ofw_bus_status_okay(dev))
 		return (ENXIO);
 
 	if (ofw_bus_is_compatible(dev, "rockchip,rk3399-cru")) {
 		device_set_desc(dev, "Rockchip RK3399 Clock and Reset Unit");
 		return (BUS_PROBE_DEFAULT);
 	}
 
 	return (ENXIO);
 }
 
 static int
 rk3399_cru_attach(device_t dev)
 {
 	struct rk_cru_softc *sc;
 
 	sc = device_get_softc(dev);
 	sc->dev = dev;
 
 	sc->gates = rk3399_gates;
 	sc->ngates = nitems(rk3399_gates);
 
 	sc->clks = rk3399_clks;
 	sc->nclks = nitems(rk3399_clks);
 
 	sc->reset_offset = 0x400;
 	sc->reset_num = 335;
 
 	return (rk_cru_attach(dev));
 }
 
 static device_method_t rk3399_cru_methods[] = {
 	/* Device interface */
 	DEVMETHOD(device_probe,		rk3399_cru_probe),
 	DEVMETHOD(device_attach,	rk3399_cru_attach),
 
 	DEVMETHOD_END
 };
 
 static devclass_t rk3399_cru_devclass;
 
 DEFINE_CLASS_1(rk3399_cru, rk3399_cru_driver, rk3399_cru_methods,
   sizeof(struct rk_cru_softc), rk_cru_driver);
 
 EARLY_DRIVER_MODULE(rk3399_cru, simplebus, rk3399_cru_driver,
     rk3399_cru_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
Index: stable/12/sys/arm64/rockchip/clk/rk3399_cru_dt.h
===================================================================
--- stable/12/sys/arm64/rockchip/clk/rk3399_cru_dt.h	(nonexistent)
+++ stable/12/sys/arm64/rockchip/clk/rk3399_cru_dt.h	(revision 358644)
@@ -0,0 +1,320 @@
+#ifndef _RK3399_DT_H_
+#define	_RK3399_DT_H_
+
+#define	PLL_APLLL				1
+#define	PLL_APLLB				2
+#define	PLL_DPLL				3
+#define	PLL_CPLL				4
+#define	PLL_GPLL				5
+#define	PLL_NPLL				6
+#define	PLL_VPLL				7
+#define	ARMCLKL					8
+#define	ARMCLKB					9
+#define	SCLK_I2C1				65
+#define	SCLK_I2C2				66
+#define	SCLK_I2C3				67
+#define	SCLK_I2C5				68
+#define	SCLK_I2C6				69
+#define	SCLK_I2C7				70
+#define	SCLK_SPI0				71
+#define	SCLK_SPI1				72
+#define	SCLK_SPI2				73
+#define	SCLK_SPI4				74
+#define	SCLK_SPI5				75
+#define	SCLK_SDMMC				76
+#define	SCLK_SDIO				77
+#define	SCLK_EMMC				78
+#define	SCLK_TSADC				79
+#define	SCLK_SARADC				80
+#define	SCLK_UART0				81
+#define	SCLK_UART1				82
+#define	SCLK_UART2				83
+#define	SCLK_UART3				84
+#define	SCLK_SPDIF_8CH				85
+#define	SCLK_I2S0_8CH				86
+#define	SCLK_I2S1_8CH				87
+#define	SCLK_I2S2_8CH				88
+#define	SCLK_I2S_8CH_OUT			89
+#define	SCLK_TIMER00				90
+#define	SCLK_TIMER01				91
+#define	SCLK_TIMER02				92
+#define	SCLK_TIMER03				93
+#define	SCLK_TIMER04				94
+#define	SCLK_TIMER05				95
+#define	SCLK_TIMER06				96
+#define	SCLK_TIMER07				97
+#define	SCLK_TIMER08				98
+#define	SCLK_TIMER09				99
+#define	SCLK_TIMER10				100
+#define	SCLK_TIMER11				101
+#define	SCLK_MACREF				102
+#define	SCLK_MAC_RX				103
+#define	SCLK_MAC_TX				104
+#define	SCLK_MAC				105
+#define	SCLK_MACREF_OUT				106
+#define	SCLK_VOP0_PWM				107
+#define	SCLK_VOP1_PWM				108
+#define	SCLK_RGA_CORE				109
+#define	SCLK_ISP0				110
+#define	SCLK_ISP1				111
+#define	SCLK_HDMI_CEC				112
+#define	SCLK_HDMI_SFR				113
+#define	SCLK_DP_CORE				114
+#define	SCLK_PVTM_CORE_L			115
+#define	SCLK_PVTM_CORE_B			116
+#define	SCLK_PVTM_GPU				117
+#define	SCLK_PVTM_DDR				118
+#define	SCLK_MIPIDPHY_REF			119
+#define	SCLK_MIPIDPHY_CFG			120
+#define	SCLK_HSICPHY				121
+#define	SCLK_USBPHY480M				122
+#define	SCLK_USB2PHY0_REF			123
+#define	SCLK_USB2PHY1_REF			124
+#define	SCLK_UPHY0_TCPDPHY_REF			125
+#define	SCLK_UPHY0_TCPDCORE			126
+#define	SCLK_UPHY1_TCPDPHY_REF			127
+#define	SCLK_UPHY1_TCPDCORE			128
+#define	SCLK_USB3OTG0_REF			129
+#define	SCLK_USB3OTG1_REF			130
+#define	SCLK_USB3OTG0_SUSPEND			131
+#define	SCLK_USB3OTG1_SUSPEND			132
+#define	SCLK_CRYPTO0				133
+#define	SCLK_CRYPTO1				134
+#define	SCLK_CCI_TRACE				135
+#define	SCLK_CS					136
+#define	SCLK_CIF_OUT				137
+#define	SCLK_PCIEPHY_REF			138
+#define	SCLK_PCIE_CORE				139
+#define	SCLK_M0_PERILP				140
+#define	SCLK_M0_PERILP_DEC			141
+#define	SCLK_CM0S				142
+#define	SCLK_DBG_NOC				143
+#define	SCLK_DBG_PD_CORE_B			144
+#define	SCLK_DBG_PD_CORE_L			145
+#define	SCLK_DFIMON0_TIMER			146
+#define	SCLK_DFIMON1_TIMER			147
+#define	SCLK_INTMEM0				148
+#define	SCLK_INTMEM1				149
+#define	SCLK_INTMEM2				150
+#define	SCLK_INTMEM3				151
+#define	SCLK_INTMEM4				152
+#define	SCLK_INTMEM5				153
+#define	SCLK_SDMMC_DRV				154
+#define	SCLK_SDMMC_SAMPLE			155
+#define	SCLK_SDIO_DRV				156
+#define	SCLK_SDIO_SAMPLE			157
+#define	SCLK_VDU_CORE				158
+#define	SCLK_VDU_CA				159
+#define	SCLK_PCIE_PM				160
+#define	SCLK_SPDIF_REC_DPTX			161
+#define	SCLK_DPHY_PLL				162
+#define	SCLK_DPHY_TX0_CFG			163
+#define	SCLK_DPHY_TX1RX1_CFG			164
+#define	SCLK_DPHY_RX0_CFG			165
+#define	SCLK_RMII_SRC				166
+#define	SCLK_PCIEPHY_REF100M			167
+#define	SCLK_DDRC				168
+#define	SCLK_TESTCLKOUT1			169
+#define	SCLK_TESTCLKOUT2			170
+#define	DCLK_VOP0				180
+#define	DCLK_VOP1				181
+#define	DCLK_VOP0_DIV				182
+#define	DCLK_VOP1_DIV				183
+#define	DCLK_M0_PERILP				184
+#define	DCLK_VOP0_FRAC				185
+#define	DCLK_VOP1_FRAC				186
+#define	FCLK_CM0S				190
+#define	ACLK_PERIHP				192
+#define	ACLK_PERIHP_NOC				193
+#define	ACLK_PERILP0				194
+#define	ACLK_PERILP0_NOC			195
+#define	ACLK_PERF_PCIE				196
+#define	ACLK_PCIE				197
+#define	ACLK_INTMEM				198
+#define	ACLK_TZMA				199
+#define	ACLK_DCF				200
+#define	ACLK_CCI				201
+#define	ACLK_CCI_NOC0				202
+#define	ACLK_CCI_NOC1				203
+#define	ACLK_CCI_GRF				204
+#define	ACLK_CENTER				205
+#define	ACLK_CENTER_MAIN_NOC			206
+#define	ACLK_CENTER_PERI_NOC			207
+#define	ACLK_GPU				208
+#define	ACLK_PERF_GPU				209
+#define	ACLK_GPU_GRF				210
+#define	ACLK_DMAC0_PERILP			211
+#define	ACLK_DMAC1_PERILP			212
+#define	ACLK_GMAC				213
+#define	ACLK_GMAC_NOC				214
+#define	ACLK_PERF_GMAC				215
+#define	ACLK_VOP0_NOC				216
+#define	ACLK_VOP0				217
+#define	ACLK_VOP1_NOC				218
+#define	ACLK_VOP1				219
+#define	ACLK_RGA				220
+#define	ACLK_RGA_NOC				221
+#define	ACLK_HDCP				222
+#define	ACLK_HDCP_NOC				223
+#define	ACLK_HDCP22				224
+#define	ACLK_IEP				225
+#define	ACLK_IEP_NOC				226
+#define	ACLK_VIO				227
+#define	ACLK_VIO_NOC				228
+#define	ACLK_ISP0				229
+#define	ACLK_ISP1				230
+#define	ACLK_ISP0_NOC				231
+#define	ACLK_ISP1_NOC				232
+#define	ACLK_ISP0_WRAPPER			233
+#define	ACLK_ISP1_WRAPPER			234
+#define	ACLK_VCODEC				235
+#define	ACLK_VCODEC_NOC				236
+#define	ACLK_VDU				237
+#define	ACLK_VDU_NOC				238
+#define	ACLK_PERI				239
+#define	ACLK_EMMC				240
+#define	ACLK_EMMC_CORE				241
+#define	ACLK_EMMC_NOC				242
+#define	ACLK_EMMC_GRF				243
+#define	ACLK_USB3				244
+#define	ACLK_USB3_NOC				245
+#define	ACLK_USB3OTG0				246
+#define	ACLK_USB3OTG1				247
+#define	ACLK_USB3_RKSOC_AXI_PERF		248
+#define	ACLK_USB3_GRF				249
+#define	ACLK_GIC				250
+#define	ACLK_GIC_NOC				251
+#define	ACLK_GIC_ADB400_CORE_L_2_GIC		252
+#define	ACLK_GIC_ADB400_CORE_B_2_GIC		253
+#define	ACLK_GIC_ADB400_GIC_2_CORE_L		254
+#define	ACLK_GIC_ADB400_GIC_2_CORE_B		255
+#define	ACLK_CORE_ADB400_CORE_L_2_CCI500	256
+#define	ACLK_CORE_ADB400_CORE_B_2_CCI500	257
+#define	ACLK_ADB400M_PD_CORE_L			258
+#define	ACLK_ADB400M_PD_CORE_B			259
+#define	ACLK_PERF_CORE_L			260
+#define	ACLK_PERF_CORE_B			261
+#define	ACLK_GIC_PRE				262
+#define	ACLK_VOP0_PRE				263
+#define	ACLK_VOP1_PRE				264
+#define	PCLK_PERIHP				320
+#define	PCLK_PERIHP_NOC				321
+#define	PCLK_PERILP0				322
+#define	PCLK_PERILP1				323
+#define	PCLK_PERILP1_NOC			324
+#define	PCLK_PERILP_SGRF			325
+#define	PCLK_PERIHP_GRF				326
+#define	PCLK_PCIE				327
+#define	PCLK_SGRF				328
+#define	PCLK_INTR_ARB				329
+#define	PCLK_CENTER_MAIN_NOC			330
+#define	PCLK_CIC				331
+#define	PCLK_COREDBG_B				332
+#define	PCLK_COREDBG_L				333
+#define	PCLK_DBG_CXCS_PD_CORE_B			334
+#define	PCLK_DCF				335
+#define	PCLK_GPIO2				336
+#define	PCLK_GPIO3				337
+#define	PCLK_GPIO4				338
+#define	PCLK_GRF				339
+#define	PCLK_HSICPHY				340
+#define	PCLK_I2C1				341
+#define	PCLK_I2C2				342
+#define	PCLK_I2C3				343
+#define	PCLK_I2C5				344
+#define	PCLK_I2C6				345
+#define	PCLK_I2C7				346
+#define	PCLK_SPI0				347
+#define	PCLK_SPI1				348
+#define	PCLK_SPI2				349
+#define	PCLK_SPI4				350
+#define	PCLK_SPI5				351
+#define	PCLK_UART0				352
+#define	PCLK_UART1				353
+#define	PCLK_UART2				354
+#define	PCLK_UART3				355
+#define	PCLK_TSADC				356
+#define	PCLK_SARADC				357
+#define	PCLK_GMAC				358
+#define	PCLK_GMAC_NOC				359
+#define	PCLK_TIMER0				360
+#define	PCLK_TIMER1				361
+#define	PCLK_EDP				362
+#define	PCLK_EDP_NOC				363
+#define	PCLK_EDP_CTRL				364
+#define	PCLK_VIO				365
+#define	PCLK_VIO_NOC				366
+#define	PCLK_VIO_GRF				367
+#define	PCLK_MIPI_DSI0				368
+#define	PCLK_MIPI_DSI1				369
+#define	PCLK_HDCP				370
+#define	PCLK_HDCP_NOC				371
+#define	PCLK_HDMI_CTRL				372
+#define	PCLK_DP_CTRL				373
+#define	PCLK_HDCP22				374
+#define	PCLK_GASKET				375
+#define	PCLK_DDR				376
+#define	PCLK_DDR_MON				377
+#define	PCLK_DDR_SGRF				378
+#define	PCLK_ISP1_WRAPPER			379
+#define	PCLK_WDT				380
+#define	PCLK_EFUSE1024NS			381
+#define	PCLK_EFUSE1024S				382
+#define	PCLK_PMU_INTR_ARB			383
+#define	PCLK_MAILBOX0				384
+#define	PCLK_USBPHY_MUX_G			385
+#define	PCLK_UPHY0_TCPHY_G			386
+#define	PCLK_UPHY0_TCPD_G			387
+#define	PCLK_UPHY1_TCPHY_G			388
+#define	PCLK_UPHY1_TCPD_G			389
+#define	PCLK_ALIVE				390
+#define	HCLK_PERIHP				448
+#define	HCLK_PERILP0				449
+#define	HCLK_PERILP1				450
+#define	HCLK_PERILP0_NOC			451
+#define	HCLK_PERILP1_NOC			452
+#define	HCLK_M0_PERILP				453
+#define	HCLK_M0_PERILP_NOC			454
+#define	HCLK_AHB1TOM				455
+#define	HCLK_HOST0				456
+#define	HCLK_HOST0_ARB				457
+#define	HCLK_HOST1				458
+#define	HCLK_HOST1_ARB				459
+#define	HCLK_HSIC				460
+#define	HCLK_SD					461
+#define	HCLK_SDMMC				462
+#define	HCLK_SDMMC_NOC				463
+#define	HCLK_M_CRYPTO0				464
+#define	HCLK_M_CRYPTO1				465
+#define	HCLK_S_CRYPTO0				466
+#define	HCLK_S_CRYPTO1				467
+#define	HCLK_I2S0_8CH				468
+#define	HCLK_I2S1_8CH				469
+#define	HCLK_I2S2_8CH				470
+#define	HCLK_SPDIF				471
+#define	HCLK_VOP0_NOC				472
+#define	HCLK_VOP0				473
+#define	HCLK_VOP1_NOC				474
+#define	HCLK_VOP1				475
+#define	HCLK_ROM				476
+#define	HCLK_IEP				477
+#define	HCLK_IEP_NOC				478
+#define	HCLK_ISP0				479
+#define	HCLK_ISP1				480
+#define	HCLK_ISP0_NOC				481
+#define	HCLK_ISP1_NOC				482
+#define	HCLK_ISP0_WRAPPER			483
+#define	HCLK_ISP1_WRAPPER			484
+#define	HCLK_RGA				485
+#define	HCLK_RGA_NOC				486
+#define	HCLK_HDCP				487
+#define	HCLK_HDCP_NOC				488
+#define	HCLK_HDCP22				489
+#define	HCLK_VCODEC				490
+#define	HCLK_VCODEC_NOC				491
+#define	HCLK_VDU				492
+#define	HCLK_VDU_NOC				493
+#define	HCLK_SDIO				494
+#define	HCLK_SDIO_NOC				495
+#define	HCLK_SDIOAUDIO_NOC			496
+#endif

Property changes on: stable/12/sys/arm64/rockchip/clk/rk3399_cru_dt.h
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: stable/12/sys/arm64/rockchip/clk/rk_clk_armclk.c
===================================================================
--- stable/12/sys/arm64/rockchip/clk/rk_clk_armclk.c	(revision 358643)
+++ stable/12/sys/arm64/rockchip/clk/rk_clk_armclk.c	(revision 358644)
@@ -1,253 +1,258 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
  * Copyright (c) 2018 Emmanuel Vadot <manu@freebsd.org>
  * All rights reserved.
  *
  * 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.
  *
  * $FreeBSD$
  */
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
 
 #include <dev/extres/clk/clk.h>
 
 #include <arm64/rockchip/clk/rk_clk_armclk.h>
 
 #include "clkdev_if.h"
 
 struct rk_clk_armclk_sc {
 	uint32_t	muxdiv_offset;
 	uint32_t	mux_shift;
 	uint32_t	mux_width;
 	uint32_t	mux_mask;
 
 	uint32_t	div_shift;
 	uint32_t	div_width;
 	uint32_t	div_mask;
 
 	uint32_t	gate_offset;
 	uint32_t	gate_shift;
 
 	uint32_t	flags;
 
 	uint32_t	main_parent;
 	uint32_t	alt_parent;
 
 	struct rk_clk_armclk_rates	*rates;
 	int		nrates;
 };
 
 #define	WRITE4(_clk, off, val)						\
 	CLKDEV_WRITE_4(clknode_get_device(_clk), off, val)
 #define	READ4(_clk, off, val)						\
 	CLKDEV_READ_4(clknode_get_device(_clk), off, val)
-#define	DEVICE_LOCK(_clk)							\
+#define	DEVICE_LOCK(_clk)						\
 	CLKDEV_DEVICE_LOCK(clknode_get_device(_clk))
 #define	DEVICE_UNLOCK(_clk)						\
 	CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk))
 
 #define	RK_ARMCLK_WRITE_MASK_SHIFT	16
 
-/* #define	dprintf(format, arg...)	printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) */
+#if 0
+#define	dprintf(format, arg...)						\
+	printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg)
+#else
 #define	dprintf(format, arg...)
+#endif
 
 static int
 rk_clk_armclk_init(struct clknode *clk, device_t dev)
 {
 	struct rk_clk_armclk_sc *sc;
 	uint32_t val, idx;
 
 	sc = clknode_get_softc(clk);
 
 	idx = 0;
 	DEVICE_LOCK(clk);
 	READ4(clk, sc->muxdiv_offset, &val);
 	DEVICE_UNLOCK(clk);
 
 	idx = (val & sc->mux_mask) >> sc->mux_shift;
 
 	clknode_init_parent_idx(clk, idx);
 
 	return (0);
 }
 
 static int
 rk_clk_armclk_set_mux(struct clknode *clk, int index)
 {
 	struct rk_clk_armclk_sc *sc;
 	uint32_t val = 0;
 
 	sc = clknode_get_softc(clk);
 
 	dprintf("Set mux to %d\n", index);
 	DEVICE_LOCK(clk);
 	val |= index << sc->mux_shift;
 	val |= sc->mux_mask << RK_ARMCLK_WRITE_MASK_SHIFT;
 	dprintf("Write: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, val);
 	WRITE4(clk, sc->muxdiv_offset, val);
 	DEVICE_UNLOCK(clk);
 
 	return (0);
 }
 
 static int
 rk_clk_armclk_recalc(struct clknode *clk, uint64_t *freq)
 {
 	struct rk_clk_armclk_sc *sc;
 	uint32_t reg, div;
 
 	sc = clknode_get_softc(clk);
 
 	DEVICE_LOCK(clk);
 
 	READ4(clk, sc->muxdiv_offset, &reg);
 	dprintf("Read: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, reg);
 
 	DEVICE_UNLOCK(clk);
 
 	div = ((reg & sc->div_mask) >> sc->div_shift) + 1;
-	dprintf("parent_freq=%lu, div=%u\n", *freq, div);
+	dprintf("parent_freq=%ju, div=%u\n", *freq, div);
 
 	*freq = *freq / div;
 
 	return (0);
 }
 
 static int
 rk_clk_armclk_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout,
     int flags, int *stop)
 {
 	struct rk_clk_armclk_sc *sc;
 	struct clknode *p_main;
 	const char **p_names;
 	uint64_t best = 0, best_p = 0;
 	uint32_t div = 0, val = 0;
 	int err, i, rate = 0;
 
 	sc = clknode_get_softc(clk);
 
-	dprintf("Finding best parent/div for target freq of %lu\n", *fout);
+	dprintf("Finding best parent/div for target freq of %ju\n", *fout);
 	p_names = clknode_get_parent_names(clk);
 	p_main = clknode_find_by_name(p_names[sc->main_parent]);
 
 	for (i = 0; i < sc->nrates; i++) {
 		if (sc->rates[i].freq == *fout) {
 			best = sc->rates[i].freq;
 			div = sc->rates[i].div;
 			best_p = best * div;
 			rate = i;
-			dprintf("Best parent %s (%d) with best freq at %lu\n",
+			dprintf("Best parent %s (%d) with best freq at %ju\n",
 			    clknode_get_name(p_main),
 			    sc->main_parent,
 			    best);
 			break;
 		}
 	}
 
 	if (rate == sc->nrates)
 		return (0);
 
 	if ((flags & CLK_SET_DRYRUN) != 0) {
 		*fout = best;
 		*stop = 1;
 		return (0);
 	}
 
-	dprintf("Changing parent (%s) freq to %lu\n", clknode_get_name(p_main), best_p);
+	dprintf("Changing parent (%s) freq to %ju\n", clknode_get_name(p_main),
+	    best_p);
 	err = clknode_set_freq(p_main, best_p, 0, 1);
 	if (err != 0)
-		printf("Cannot set %s to %lu\n",
+		printf("Cannot set %s to %ju\n",
 		    clknode_get_name(p_main),
 		    best_p);
 
 	clknode_set_parent_by_idx(clk, sc->main_parent);
 
 	clknode_get_freq(p_main, &best_p);
-	dprintf("main parent freq at %lu\n", best_p);
+	dprintf("main parent freq at %ju\n", best_p);
 	DEVICE_LOCK(clk);
 	val |= (div - 1) << sc->div_shift;
 	val |= sc->div_mask << RK_ARMCLK_WRITE_MASK_SHIFT;
 	dprintf("Write: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, val);
 	WRITE4(clk, sc->muxdiv_offset, val);
 	DEVICE_UNLOCK(clk);
 
 	*fout = best;
 	*stop = 1;
 
 	return (0);
 }
 
 static clknode_method_t rk_clk_armclk_clknode_methods[] = {
 	/* Device interface */
 	CLKNODEMETHOD(clknode_init,		rk_clk_armclk_init),
 	CLKNODEMETHOD(clknode_set_mux,		rk_clk_armclk_set_mux),
 	CLKNODEMETHOD(clknode_recalc_freq,	rk_clk_armclk_recalc),
 	CLKNODEMETHOD(clknode_set_freq,		rk_clk_armclk_set_freq),
 	CLKNODEMETHOD_END
 };
 
 DEFINE_CLASS_1(rk_clk_armclk_clknode, rk_clk_armclk_clknode_class,
     rk_clk_armclk_clknode_methods, sizeof(struct rk_clk_armclk_sc),
     clknode_class);
 
 int
 rk_clk_armclk_register(struct clkdom *clkdom, struct rk_clk_armclk_def *clkdef)
 {
 	struct clknode *clk;
 	struct rk_clk_armclk_sc *sc;
 
 	clk = clknode_create(clkdom, &rk_clk_armclk_clknode_class,
 	    &clkdef->clkdef);
 	if (clk == NULL)
 		return (1);
 
 	sc = clknode_get_softc(clk);
 
 	sc->muxdiv_offset = clkdef->muxdiv_offset;
 
 	sc->mux_shift = clkdef->mux_shift;
 	sc->mux_width = clkdef->mux_width;
 	sc->mux_mask = ((1 << clkdef->mux_width) - 1) << sc->mux_shift;
 
 	sc->div_shift = clkdef->div_shift;
 	sc->div_width = clkdef->div_width;
 	sc->div_mask = ((1 << clkdef->div_width) - 1) << sc->div_shift;
 
 	sc->flags = clkdef->flags;
 
 	sc->main_parent = clkdef->main_parent;
 	sc->alt_parent = clkdef->alt_parent;
 
 	sc->rates = clkdef->rates;
 	sc->nrates = clkdef->nrates;
 
 	clknode_register(clkdom, clk);
 
 	return (0);
 }
Index: stable/12/sys/arm64/rockchip/clk/rk_clk_composite.c
===================================================================
--- stable/12/sys/arm64/rockchip/clk/rk_clk_composite.c	(revision 358643)
+++ stable/12/sys/arm64/rockchip/clk/rk_clk_composite.c	(revision 358644)
@@ -1,299 +1,318 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
  * Copyright (c) 2018 Emmanuel Vadot <manu@freebsd.org>
  * All rights reserved.
  *
  * 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.
  *
  * $FreeBSD$
  */
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
 
 #include <dev/extres/clk/clk.h>
 
 #include <arm64/rockchip/clk/rk_clk_composite.h>
 
 #include "clkdev_if.h"
 
 struct rk_clk_composite_sc {
 	uint32_t	muxdiv_offset;
 	uint32_t	mux_shift;
 	uint32_t	mux_width;
 	uint32_t	mux_mask;
 
 	uint32_t	div_shift;
 	uint32_t	div_width;
 	uint32_t	div_mask;
 
 	uint32_t	gate_offset;
 	uint32_t	gate_shift;
 
 	uint32_t	flags;
 };
 
 #define	WRITE4(_clk, off, val)						\
 	CLKDEV_WRITE_4(clknode_get_device(_clk), off, val)
 #define	READ4(_clk, off, val)						\
 	CLKDEV_READ_4(clknode_get_device(_clk), off, val)
-#define	DEVICE_LOCK(_clk)							\
+#define	DEVICE_LOCK(_clk)						\
 	CLKDEV_DEVICE_LOCK(clknode_get_device(_clk))
 #define	DEVICE_UNLOCK(_clk)						\
 	CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk))
 
 #define	RK_CLK_COMPOSITE_MASK_SHIFT	16
 
-/* #define	dprintf(format, arg...)	printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) */
+#if 0
+#define	dprintf(format, arg...)						\
+	printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg)
+#else
 #define	dprintf(format, arg...)
+#endif
 
 static int
 rk_clk_composite_init(struct clknode *clk, device_t dev)
 {
 	struct rk_clk_composite_sc *sc;
 	uint32_t val, idx;
 
 	sc = clknode_get_softc(clk);
 
 	idx = 0;
 	if ((sc->flags & RK_CLK_COMPOSITE_HAVE_MUX) != 0) {
 		DEVICE_LOCK(clk);
 		READ4(clk, sc->muxdiv_offset, &val);
 		DEVICE_UNLOCK(clk);
 
 		idx = (val & sc->mux_mask) >> sc->mux_shift;
 	}
 
 	clknode_init_parent_idx(clk, idx);
 
 	return (0);
 }
 
 static int
 rk_clk_composite_set_gate(struct clknode *clk, bool enable)
 {
 	struct rk_clk_composite_sc *sc;
 	uint32_t val = 0;
 
 	sc = clknode_get_softc(clk);
 
 	if ((sc->flags & RK_CLK_COMPOSITE_HAVE_GATE) == 0)
 		return (0);
 
 	dprintf("%sabling gate\n", enable ? "En" : "Dis");
 	if (!enable)
 		val |= 1 << sc->gate_shift;
 	dprintf("sc->gate_shift: %x\n", sc->gate_shift);
 	val |= (1 << sc->gate_shift) << RK_CLK_COMPOSITE_MASK_SHIFT;
 	dprintf("Write: gate_offset=%x, val=%x\n", sc->gate_offset, val);
 	DEVICE_LOCK(clk);
 	WRITE4(clk, sc->gate_offset, val);
 	DEVICE_UNLOCK(clk);
 
 	return (0);
 }
 
 static int
 rk_clk_composite_set_mux(struct clknode *clk, int index)
 {
 	struct rk_clk_composite_sc *sc;
 	uint32_t val = 0;
 
 	sc = clknode_get_softc(clk);
 
 	if ((sc->flags & RK_CLK_COMPOSITE_HAVE_MUX) == 0)
 		return (0);
 
 	dprintf("Set mux to %d\n", index);
 	DEVICE_LOCK(clk);
 	val |= (index << sc->mux_shift);
 	val |= sc->mux_mask << RK_CLK_COMPOSITE_MASK_SHIFT;
 	dprintf("Write: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, val);
 	WRITE4(clk, sc->muxdiv_offset, val);
 	DEVICE_UNLOCK(clk);
 
 	return (0);
 }
 
 static int
 rk_clk_composite_recalc(struct clknode *clk, uint64_t *freq)
 {
 	struct rk_clk_composite_sc *sc;
 	uint32_t reg, div;
 
 	sc = clknode_get_softc(clk);
 
 	DEVICE_LOCK(clk);
 
 	READ4(clk, sc->muxdiv_offset, &reg);
 	dprintf("Read: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, reg);
 
 	DEVICE_UNLOCK(clk);
 
-	div = ((reg & sc->div_mask) >> sc->div_shift) + 1;
-	dprintf("parent_freq=%lu, div=%u\n", *freq, div);
+	div = ((reg & sc->div_mask) >> sc->div_shift);
+	if (sc->flags & RK_CLK_COMPOSITE_DIV_EXP)
+		div = 1 << div;
+	else
+		div += 1;
+	dprintf("parent_freq=%ju, div=%u\n", *freq, div);
 	*freq = *freq / div;
-
+	dprintf("Final freq=%ju\n", *freq);
 	return (0);
 }
 
 static uint32_t
 rk_clk_composite_find_best(struct rk_clk_composite_sc *sc, uint64_t fparent,
-    uint64_t freq)
+    uint64_t freq, uint32_t *reg)
 {
 	uint64_t best, cur;
-	uint32_t best_div, div;
+	uint32_t best_div, best_div_reg;
+	uint32_t div, div_reg;
 
-	for (best = 0, best_div = 0, div = 0;
-	     div <= ((sc->div_mask >> sc->div_shift) + 1); div++) {
+	best = 0;
+	best_div = 0;
+	best_div_reg = 0;
+
+	for (div_reg = 0;  div_reg <= ((sc->div_mask >> sc->div_shift) + 1);
+	    div_reg++) {
+		if (sc->flags == RK_CLK_COMPOSITE_DIV_EXP)
+			div = 1 << div_reg;
+		else
+			div = div_reg + 1;
 		cur = fparent / div;
 		if ((freq - cur) < (freq - best)) {
 			best = cur;
 			best_div = div;
+			best_div_reg = div_reg;
 			break;
 		}
 	}
-
+	*reg = div_reg;
 	return (best_div);
 }
 
 static int
 rk_clk_composite_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout,
     int flags, int *stop)
 {
 	struct rk_clk_composite_sc *sc;
 	struct clknode *p_clk;
 	const char **p_names;
 	uint64_t best, cur;
-	uint32_t div, best_div, val = 0;
+	uint32_t div, div_reg, best_div, best_div_reg, val;
 	int p_idx, best_parent;
 
 	sc = clknode_get_softc(clk);
-
-	dprintf("Finding best parent/div for target freq of %lu\n", *fout);
+	dprintf("Finding best parent/div for target freq of %ju\n", *fout);
 	p_names = clknode_get_parent_names(clk);
 	for (best_div = 0, best = 0, p_idx = 0;
 	     p_idx != clknode_get_parents_num(clk); p_idx++) {
 		p_clk = clknode_find_by_name(p_names[p_idx]);
 		clknode_get_freq(p_clk, &fparent);
-		dprintf("Testing with parent %s (%d) at freq %lu\n", clknode_get_name(p_clk), p_idx, fparent);
-		div = rk_clk_composite_find_best(sc, fparent, *fout);
+		dprintf("Testing with parent %s (%d) at freq %ju\n",
+		    clknode_get_name(p_clk), p_idx, fparent);
+		div = rk_clk_composite_find_best(sc, fparent, *fout, &div_reg);
 		cur = fparent / div;
 		if ((*fout - cur) < (*fout - best)) {
 			best = cur;
 			best_div = div;
+			best_div_reg = div_reg;
 			best_parent = p_idx;
-			dprintf("Best parent so far %s (%d) with best freq at %lu\n", clknode_get_name(p_clk), p_idx, best);
+			dprintf("Best parent so far %s (%d) with best freq at "
+			    "%ju\n", clknode_get_name(p_clk), p_idx, best);
 		}
 	}
 
+	*stop = 1;
 	if (best_div == 0)
-		return (0);
+		return (ERANGE);
 
-	if ((best < *fout) &&
-	  ((flags & CLK_SET_ROUND_DOWN) == 0)) {
-		*stop = 1;
+	if ((best < *fout) && ((flags & CLK_SET_ROUND_DOWN) == 0))
 		return (ERANGE);
-	}
-	if ((best > *fout) &&
-	  ((flags & CLK_SET_ROUND_UP) == 0)) {
-		*stop = 1;
+
+	if ((best > *fout) && ((flags & CLK_SET_ROUND_UP) == 0)) {
 		return (ERANGE);
 	}
 
 	if ((flags & CLK_SET_DRYRUN) != 0) {
 		*fout = best;
-		*stop = 1;
 		return (0);
 	}
 
 	p_idx = clknode_get_parent_idx(clk);
 	if (p_idx != best_parent) {
-		dprintf("Switching parent index from %d to %d\n", p_idx, best_parent);
+		dprintf("Switching parent index from %d to %d\n", p_idx,
+		    best_parent);
 		clknode_set_parent_by_idx(clk, best_parent);
 	}
 
-	dprintf("Setting divider to %d\n", best_div);
+	dprintf("Setting divider to %d (reg: %d)\n", best_div, best_div_reg);
+	dprintf(" div_mask: 0x%X, div_shift: %d\n", sc->div_mask,
+	    sc->div_shift);
+
 	DEVICE_LOCK(clk);
-	val |= (best_div - 1) << sc->div_shift;
-	val |= (sc->div_mask << sc->div_shift) << RK_CLK_COMPOSITE_MASK_SHIFT;
+	val = best_div_reg << sc->div_shift;
+	val |= sc->div_mask << RK_CLK_COMPOSITE_MASK_SHIFT;
 	dprintf("Write: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, val);
 	WRITE4(clk, sc->muxdiv_offset, val);
 	DEVICE_UNLOCK(clk);
 
 	*fout = best;
-	*stop = 1;
-
 	return (0);
 }
 
 static clknode_method_t rk_clk_composite_clknode_methods[] = {
 	/* Device interface */
 	CLKNODEMETHOD(clknode_init,		rk_clk_composite_init),
 	CLKNODEMETHOD(clknode_set_gate,		rk_clk_composite_set_gate),
 	CLKNODEMETHOD(clknode_set_mux,		rk_clk_composite_set_mux),
 	CLKNODEMETHOD(clknode_recalc_freq,	rk_clk_composite_recalc),
 	CLKNODEMETHOD(clknode_set_freq,		rk_clk_composite_set_freq),
 	CLKNODEMETHOD_END
 };
 
 DEFINE_CLASS_1(rk_clk_composite_clknode, rk_clk_composite_clknode_class,
     rk_clk_composite_clknode_methods, sizeof(struct rk_clk_composite_sc),
     clknode_class);
 
 int
-rk_clk_composite_register(struct clkdom *clkdom, struct rk_clk_composite_def *clkdef)
+rk_clk_composite_register(struct clkdom *clkdom,
+    struct rk_clk_composite_def *clkdef)
 {
 	struct clknode *clk;
 	struct rk_clk_composite_sc *sc;
 
 	clk = clknode_create(clkdom, &rk_clk_composite_clknode_class,
 	    &clkdef->clkdef);
 	if (clk == NULL)
 		return (1);
 
 	sc = clknode_get_softc(clk);
 
 	sc->muxdiv_offset = clkdef->muxdiv_offset;
 
 	sc->mux_shift = clkdef->mux_shift;
 	sc->mux_width = clkdef->mux_width;
 	sc->mux_mask = ((1 << clkdef->mux_width) - 1) << sc->mux_shift;
 
 	sc->div_shift = clkdef->div_shift;
 	sc->div_width = clkdef->div_width;
 	sc->div_mask = ((1 << clkdef->div_width) - 1) << sc->div_shift;
 
 	sc->gate_offset = clkdef->gate_offset;
 	sc->gate_shift = clkdef->gate_shift;
 
 	sc->flags = clkdef->flags;
 
 	clknode_register(clkdom, clk);
 
 	return (0);
 }
Index: stable/12/sys/arm64/rockchip/clk/rk_clk_composite.h
===================================================================
--- stable/12/sys/arm64/rockchip/clk/rk_clk_composite.h	(revision 358643)
+++ stable/12/sys/arm64/rockchip/clk/rk_clk_composite.h	(revision 358644)
@@ -1,59 +1,60 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
  * Copyright 2018 Emmanuel Vadot <manu@FreeBSD.org>
  * All rights reserved.
  *
  * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
  *
  * $FreeBSD$
  */
 
 #ifndef _RK_CLK_COMPOSITE_H_
 #define _RK_CLK_COMPOSITE_H_
 
 #include <dev/extres/clk/clk.h>
 
 struct rk_clk_composite_def {
 	struct clknode_init_def	clkdef;
 
 	uint32_t	muxdiv_offset;
 
 	uint32_t	mux_shift;
 	uint32_t	mux_width;
 
 	uint32_t	div_shift;
 	uint32_t	div_width;
 
 	uint32_t	gate_offset;
 	uint32_t	gate_shift;
 
 	uint32_t	flags;
 };
 
 #define	RK_CLK_COMPOSITE_HAVE_MUX	0x0001
 #define	RK_CLK_COMPOSITE_HAVE_GATE	0x0002
-
+#define	RK_CLK_COMPOSITE_DIV_EXP	0x0004	/* Register   0, 1, 2, 2, ... */
+						/* Divider    1, 2, 4, 8, ... */
 int rk_clk_composite_register(struct clkdom *clkdom,
     struct rk_clk_composite_def *clkdef);
 
 #endif /* _RK_CLK_COMPOSITE_H_ */
Index: stable/12/sys/arm64/rockchip/clk/rk_clk_fract.c
===================================================================
--- stable/12/sys/arm64/rockchip/clk/rk_clk_fract.c	(nonexistent)
+++ stable/12/sys/arm64/rockchip/clk/rk_clk_fract.c	(revision 358644)
@@ -0,0 +1,247 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright 2019 Michal Meloun <mmel@FreeBSD.org>
+ *
+ * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+
+#include <dev/extres/clk/clk.h>
+
+#include <arm64/rockchip/clk/rk_clk_fract.h>
+
+#include "clkdev_if.h"
+
+#define	WR4(_clk, off, val)						\
+	CLKDEV_WRITE_4(clknode_get_device(_clk), off, val)
+#define	RD4(_clk, off, val)						\
+	CLKDEV_READ_4(clknode_get_device(_clk), off, val)
+#define	MD4(_clk, off, clr, set )					\
+	CLKDEV_MODIFY_4(clknode_get_device(_clk), off, clr, set)
+#define	DEVICE_LOCK(_clk)						\
+	CLKDEV_DEVICE_LOCK(clknode_get_device(_clk))
+#define	DEVICE_UNLOCK(_clk)						\
+	CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk))
+
+static int rk_clk_fract_init(struct clknode *clk, device_t dev);
+static int rk_clk_fract_recalc(struct clknode *clk, uint64_t *req);
+static int rk_clk_fract_set_freq(struct clknode *clknode, uint64_t fin,
+    uint64_t *fout, int flag, int *stop);
+
+struct rk_clk_fract_sc {
+	uint32_t	flags;
+	uint32_t	offset;
+	uint32_t	numerator;
+	uint32_t	denominator;
+};
+
+static clknode_method_t rk_clk_fract_methods[] = {
+	/* Device interface */
+	CLKNODEMETHOD(clknode_init,		rk_clk_fract_init),
+	CLKNODEMETHOD(clknode_recalc_freq,	rk_clk_fract_recalc),
+	CLKNODEMETHOD(clknode_set_freq,		rk_clk_fract_set_freq),
+	CLKNODEMETHOD_END
+};
+DEFINE_CLASS_1(rk_clk_fract, rk_clk_fract_class, rk_clk_fract_methods,
+   sizeof(struct rk_clk_fract_sc), clknode_class);
+
+
+/*
+ * Compute best rational approximation of input fraction
+ * for fixed sized fractional divider registers.
+ * http://en.wikipedia.org/wiki/Continued_fraction
+ *
+ * - n_input, d_input	Given input fraction
+ * - n_max, d_max	Maximum vaues of divider registers
+ * - n_out, d_out	Computed approximation
+ */
+
+static void
+clk_compute_fract_div(
+	uint64_t n_input, uint64_t d_input,
+	uint64_t n_max, uint64_t d_max,
+	uint64_t *n_out, uint64_t *d_out)
+{
+	uint64_t n_prev, d_prev;	/* previous convergents */
+	uint64_t n_cur, d_cur;		/* current  convergents */
+	uint64_t n_rem, d_rem;		/* fraction remainder */
+	uint64_t tmp, fact;
+
+	/* Initialize fraction reminder */
+	n_rem = n_input;
+	d_rem = d_input;
+
+	/* Init convergents to 0/1 and 1/0 */
+	n_prev = 0;
+	d_prev = 1;
+	n_cur = 1;
+	d_cur = 0;
+
+	while (d_rem != 0 && n_cur < n_max && d_cur < d_max) {
+		/* Factor for this step. */
+		fact = n_rem / d_rem;
+
+		/* Adjust fraction reminder */
+		tmp = d_rem;
+		d_rem = n_rem % d_rem;
+		n_rem = tmp;
+
+		/* Compute new nominator and save last one */
+		tmp = n_prev + fact * n_cur;
+		n_prev = n_cur;
+		n_cur = tmp;
+
+		/* Compute new denominator and save last one */
+		tmp = d_prev + fact * d_cur;
+		d_prev = d_cur;
+		d_cur = tmp;
+	}
+
+	if (n_cur > n_max || d_cur > d_max) {
+		*n_out = n_prev;
+		*d_out = d_prev;
+	} else {
+		*n_out = n_cur;
+		*d_out = d_cur;
+	}
+}
+
+static int
+rk_clk_fract_init(struct clknode *clk, device_t dev)
+{
+	uint32_t reg;
+	struct rk_clk_fract_sc *sc;
+
+	sc = clknode_get_softc(clk);
+	DEVICE_LOCK(clk);
+	RD4(clk, sc->offset, &reg);
+	DEVICE_UNLOCK(clk);
+
+	sc->numerator  = (reg >> 16) & 0xFFFF;
+	sc->denominator  = reg & 0xFFFF;
+	clknode_init_parent_idx(clk, 0);
+
+	return(0);
+}
+
+static int
+rk_clk_fract_recalc(struct clknode *clk, uint64_t *freq)
+{
+	struct rk_clk_fract_sc *sc;
+
+	sc = clknode_get_softc(clk);
+	if (sc->denominator == 0) {
+		printf("%s: %s denominator is zero!\n", clknode_get_name(clk),
+		__func__);
+		*freq = 0;
+		return(EINVAL);
+	}
+
+	*freq *= sc->numerator;
+	*freq /= sc->denominator;
+
+	return (0);
+}
+
+static int
+rk_clk_fract_set_freq(struct clknode *clk, uint64_t fin, uint64_t *fout,
+    int flags, int *stop)
+{
+	struct rk_clk_fract_sc *sc;
+	uint64_t div_n, div_d, _fout;
+
+	sc = clknode_get_softc(clk);
+
+	clk_compute_fract_div(*fout, fin, 0xFFFF, 0xFFFF, &div_n, &div_d);
+	_fout = fin * div_n;
+	_fout /= div_d;
+
+	/* Rounding. */
+	if ((flags & CLK_SET_ROUND_UP) && (_fout < *fout)) {
+		if (div_n > div_d && div_d > 1)
+			div_n++;
+		else
+			div_d--;
+	} else if ((flags & CLK_SET_ROUND_DOWN) && (_fout > *fout)) {
+		if (div_n > div_d && div_n > 1)
+			div_n--;
+		else
+			div_d++;
+	}
+
+	/* Check range after rounding */
+	if (div_n > 0xFFFF || div_d > 0xFFFF)
+		return (ERANGE);
+
+	if (div_d == 0) {
+		printf("%s: %s divider is zero!\n",
+		     clknode_get_name(clk), __func__);
+		return(EINVAL);
+	}
+	/* Recompute final output frequency */
+	_fout = fin * div_n;
+	_fout /= div_d;
+
+	*stop = 1;
+
+	if ((flags & CLK_SET_DRYRUN) == 0) {
+		if (*stop != 0 &&
+		    (flags & (CLK_SET_ROUND_UP | CLK_SET_ROUND_DOWN)) == 0 &&
+		    *fout != _fout)
+			return (ERANGE);
+
+		sc->numerator  = (uint32_t)div_n;
+		sc->denominator = (uint32_t)div_d;
+
+		DEVICE_LOCK(clk);
+		WR4(clk, sc->offset, sc->numerator << 16 | sc->denominator);
+		DEVICE_UNLOCK(clk);
+	}
+
+	*fout = _fout;
+	return (0);
+}
+
+int
+rk_clk_fract_register(struct clkdom *clkdom, struct rk_clk_fract_def *clkdef)
+{
+	struct clknode *clk;
+	struct rk_clk_fract_sc *sc;
+
+	clk = clknode_create(clkdom, &rk_clk_fract_class, &clkdef->clkdef);
+	if (clk == NULL)
+		return (1);
+
+	sc = clknode_get_softc(clk);
+	sc->flags = clkdef->flags;
+	sc->offset = clkdef->offset;
+
+	clknode_register(clkdom, clk);
+	return (0);
+}

Property changes on: stable/12/sys/arm64/rockchip/clk/rk_clk_fract.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+FreeBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: stable/12/sys/arm64/rockchip/clk/rk_clk_fract.h
===================================================================
--- stable/12/sys/arm64/rockchip/clk/rk_clk_fract.h	(nonexistent)
+++ stable/12/sys/arm64/rockchip/clk/rk_clk_fract.h	(revision 358644)
@@ -0,0 +1,44 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright 2019 Michal Meloun <mmel@FreeBSD.org>
+ *
+ * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _RK_CLK_FRACT_H_
+#define _RK_CLK_FRACT_H_
+
+#include <dev/extres/clk/clk.h>
+
+struct rk_clk_fract_def {
+	struct clknode_init_def clkdef;
+	uint32_t		offset;
+	uint32_t		flags;
+};
+
+int rk_clk_fract_register(struct clkdom *clkdom,
+    struct rk_clk_fract_def *clkdef);
+
+#endif /* _RK_CLK_FRACT_H_ */

Property changes on: stable/12/sys/arm64/rockchip/clk/rk_clk_fract.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+FreeBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: stable/12/sys/arm64/rockchip/clk/rk_clk_gate.c
===================================================================
--- stable/12/sys/arm64/rockchip/clk/rk_clk_gate.c	(revision 358643)
+++ stable/12/sys/arm64/rockchip/clk/rk_clk_gate.c	(revision 358644)
@@ -1,135 +1,135 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
  * Copyright 2016 Michal Meloun <mmel@FreeBSD.org>
  * All rights reserved.
  *
  * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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 <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
 
 #include <dev/extres/clk/clk.h>
 
 #include <arm64/rockchip/clk/rk_clk_gate.h>
 
 #include "clkdev_if.h"
 
 #define	WR4(_clk, off, val)						\
 	CLKDEV_WRITE_4(clknode_get_device(_clk), off, val)
 #define	RD4(_clk, off, val)						\
 	CLKDEV_READ_4(clknode_get_device(_clk), off, val)
 #define	MD4(_clk, off, clr, set )					\
 	CLKDEV_MODIFY_4(clknode_get_device(_clk), off, clr, set)
-#define	DEVICE_LOCK(_clk)							\
+#define	DEVICE_LOCK(_clk)						\
 	CLKDEV_DEVICE_LOCK(clknode_get_device(_clk))
 #define	DEVICE_UNLOCK(_clk)						\
 	CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk))
 
 static int rk_clk_gate_init(struct clknode *clk, device_t dev);
 static int rk_clk_gate_set_gate(struct clknode *clk, bool enable);
 struct rk_clk_gate_sc {
 	uint32_t	offset;
 	uint32_t	shift;
 	uint32_t	mask;
 	uint32_t	on_value;
 	uint32_t	off_value;
 	int		gate_flags;
 	bool		ungated;
 };
 
 static clknode_method_t rk_clk_gate_methods[] = {
 	/* Device interface */
 	CLKNODEMETHOD(clknode_init,	rk_clk_gate_init),
 	CLKNODEMETHOD(clknode_set_gate,	rk_clk_gate_set_gate),
 	CLKNODEMETHOD_END
 };
 DEFINE_CLASS_1(rk_clk_gate, rk_clk_gate_class, rk_clk_gate_methods,
    sizeof(struct rk_clk_gate_sc), clknode_class);
 
 static int
 rk_clk_gate_init(struct clknode *clk, device_t dev)
 {
 	uint32_t reg;
 	struct rk_clk_gate_sc *sc;
 	int rv;
 
 	sc = clknode_get_softc(clk);
 	DEVICE_LOCK(clk);
 	rv = RD4(clk, sc->offset, &reg);
 	DEVICE_UNLOCK(clk);
 	if (rv != 0)
 		return (rv);
 	reg = (reg >> sc->shift) & sc->mask;
 	sc->ungated = reg == sc->on_value ? 1 : 0;
 	clknode_init_parent_idx(clk, 0);
 	return(0);
 }
 
 static int
 rk_clk_gate_set_gate(struct clknode *clk, bool enable)
 {
 	uint32_t reg;
 	struct rk_clk_gate_sc *sc;
 	int rv;
 
 	sc = clknode_get_softc(clk);
 	sc->ungated = enable;
 	DEVICE_LOCK(clk);
 	rv = MD4(clk, sc->offset, sc->mask << sc->shift,
 	    ((sc->ungated ? sc->on_value : sc->off_value) << sc->shift) |
 	    RK_CLK_GATE_MASK);
 	if (rv != 0) {
 		DEVICE_UNLOCK(clk);
 		return (rv);
 	}
 	RD4(clk, sc->offset, &reg);
 	DEVICE_UNLOCK(clk);
 	return(0);
 }
 
 int
 rk_clk_gate_register(struct clkdom *clkdom, struct rk_clk_gate_def *clkdef)
 {
 	struct clknode *clk;
 	struct rk_clk_gate_sc *sc;
 
 	clk = clknode_create(clkdom, &rk_clk_gate_class, &clkdef->clkdef);
 	if (clk == NULL)
 		return (1);
 
 	sc = clknode_get_softc(clk);
 	sc->offset = clkdef->offset;
 	sc->shift = clkdef->shift;
 	sc->mask =  clkdef->mask;
 	sc->on_value = clkdef->on_value;
 	sc->off_value = clkdef->off_value;
 	sc->gate_flags = clkdef->gate_flags;
 
 	clknode_register(clkdom, clk);
 	return (0);
 }
Index: stable/12/sys/arm64/rockchip/clk/rk_clk_mux.c
===================================================================
--- stable/12/sys/arm64/rockchip/clk/rk_clk_mux.c	(revision 358643)
+++ stable/12/sys/arm64/rockchip/clk/rk_clk_mux.c	(revision 358644)
@@ -1,139 +1,139 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
  * Copyright 2016 Michal Meloun <mmel@FreeBSD.org>
  * All rights reserved.
  *
  * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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 <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
 
 #include <sys/param.h>
 #include <sys/conf.h>
 #include <sys/bus.h>
 #include <sys/kernel.h>
 #include <sys/systm.h>
 
 #include <machine/bus.h>
 
 #include <dev/extres/clk/clk.h>
 
 #include <arm64/rockchip/clk/rk_cru.h>
 #include <arm64/rockchip/clk/rk_clk_mux.h>
 
 #include "clkdev_if.h"
 
 #define	WR4(_clk, off, val)						\
 	CLKDEV_WRITE_4(clknode_get_device(_clk), off, val)
 #define	RD4(_clk, off, val)						\
 	CLKDEV_READ_4(clknode_get_device(_clk), off, val)
 #define	MD4(_clk, off, clr, set )					\
 	CLKDEV_MODIFY_4(clknode_get_device(_clk), off, clr, set)
-#define	DEVICE_LOCK(_clk)							\
+#define	DEVICE_LOCK(_clk)						\
 	CLKDEV_DEVICE_LOCK(clknode_get_device(_clk))
 #define	DEVICE_UNLOCK(_clk)						\
 	CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk))
 
 static int rk_clk_mux_init(struct clknode *clk, device_t dev);
 static int rk_clk_mux_set_mux(struct clknode *clk, int idx);
 
 struct rk_clk_mux_sc {
 	uint32_t	offset;
 	uint32_t	shift;
 	uint32_t	mask;
 	int		mux_flags;
 };
 
 static clknode_method_t rk_clk_mux_methods[] = {
 	/* Device interface */
 	CLKNODEMETHOD(clknode_init, 	rk_clk_mux_init),
 	CLKNODEMETHOD(clknode_set_mux, 	rk_clk_mux_set_mux),
 	CLKNODEMETHOD_END
 };
 DEFINE_CLASS_1(rk_clk_mux, rk_clk_mux_class, rk_clk_mux_methods,
    sizeof(struct rk_clk_mux_sc), clknode_class);
 
 
 static int
 rk_clk_mux_init(struct clknode *clk, device_t dev)
 {
 	uint32_t reg;
 	struct rk_clk_mux_sc *sc;
 	int rv;
 
 	sc = clknode_get_softc(clk);
 
 	DEVICE_LOCK(clk);
 	rv = RD4(clk, sc->offset, &reg);
 	DEVICE_UNLOCK(clk);
 	if (rv != 0) {
 		return (rv);
 	}
 	reg = (reg >> sc->shift) & sc->mask;
 	clknode_init_parent_idx(clk, reg);
 	return(0);
 }
 
 static int
 rk_clk_mux_set_mux(struct clknode *clk, int idx)
 {
 	uint32_t reg;
 	struct rk_clk_mux_sc *sc;
 	int rv;
 
 	sc = clknode_get_softc(clk);
 
 	DEVICE_LOCK(clk);
 	rv = MD4(clk, sc->offset, sc->mask << sc->shift,
 	    ((idx & sc->mask) << sc->shift) | RK_CLK_MUX_MASK);
 	if (rv != 0) {
 		DEVICE_UNLOCK(clk);
 		return (rv);
 	}
 	RD4(clk, sc->offset, &reg);
 	DEVICE_UNLOCK(clk);
 
 	return(0);
 }
 
 int
 rk_clk_mux_register(struct clkdom *clkdom, struct rk_clk_mux_def *clkdef)
 {
 	struct clknode *clk;
 	struct rk_clk_mux_sc *sc;
 
 	clk = clknode_create(clkdom, &rk_clk_mux_class, &clkdef->clkdef);
 	if (clk == NULL)
 		return (1);
 
 	sc = clknode_get_softc(clk);
 	sc->offset = clkdef->offset;
 	sc->shift = clkdef->shift;
 	sc->mask =  (1 << clkdef->width) - 1;
 	sc->mux_flags = clkdef->mux_flags;
 
 	clknode_register(clkdom, clk);
 	return (0);
 }
Index: stable/12/sys/arm64/rockchip/clk/rk_clk_pll.c
===================================================================
--- stable/12/sys/arm64/rockchip/clk/rk_clk_pll.c	(revision 358643)
+++ stable/12/sys/arm64/rockchip/clk/rk_clk_pll.c	(revision 358644)
@@ -1,548 +1,557 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
  * Copyright (c) 2018 Emmanuel Vadot <manu@freebsd.org>
  * All rights reserved.
  *
  * 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.
  *
  * $FreeBSD$
  */
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
 
 #include <dev/extres/clk/clk.h>
 
 #include <arm64/rockchip/clk/rk_clk_pll.h>
 
 #include "clkdev_if.h"
 
 struct rk_clk_pll_sc {
 	uint32_t	base_offset;
 
 	uint32_t	gate_offset;
 	uint32_t	gate_shift;
 
 	uint32_t	mode_reg;
 	uint32_t	mode_shift;
 
 	uint32_t	flags;
 
 	struct rk_clk_pll_rate	*rates;
 	struct rk_clk_pll_rate	*frac_rates;
 
 	bool			normal_mode;
 };
 
-#define	WRITE4(_clk, off, val)					\
+#define	WRITE4(_clk, off, val)						\
 	CLKDEV_WRITE_4(clknode_get_device(_clk), off, val)
-#define	READ4(_clk, off, val)					\
+#define	READ4(_clk, off, val)						\
 	CLKDEV_READ_4(clknode_get_device(_clk), off, val)
-#define	DEVICE_LOCK(_clk)					\
+#define	DEVICE_LOCK(_clk)						\
 	CLKDEV_DEVICE_LOCK(clknode_get_device(_clk))
-#define	DEVICE_UNLOCK(_clk)					\
+#define	DEVICE_UNLOCK(_clk)						\
 	CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk))
 
 #define	RK_CLK_PLL_MASK_SHIFT	16
 
-/* #define	dprintf(format, arg...)	printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) */
+#if 0
+#define	dprintf(format, arg...)						\
+	printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg)
+#else
 #define	dprintf(format, arg...)
+#endif
 
 static int
 rk_clk_pll_set_gate(struct clknode *clk, bool enable)
 {
 	struct rk_clk_pll_sc *sc;
 	uint32_t val = 0;
 
 	sc = clknode_get_softc(clk);
 
 	if ((sc->flags & RK_CLK_PLL_HAVE_GATE) == 0)
 		return (0);
 
 	dprintf("%sabling gate\n", enable ? "En" : "Dis");
 	if (!enable)
 		val |= 1 << sc->gate_shift;
 	dprintf("sc->gate_shift: %x\n", sc->gate_shift);
 	val |= (1 << sc->gate_shift) << RK_CLK_PLL_MASK_SHIFT;
 	dprintf("Write: gate_offset=%x, val=%x\n", sc->gate_offset, val);
 	DEVICE_LOCK(clk);
 	WRITE4(clk, sc->gate_offset, val);
 	DEVICE_UNLOCK(clk);
 
 	return (0);
 }
 
 #define	RK3328_CLK_PLL_FBDIV_OFFSET	0
 #define	RK3328_CLK_PLL_FBDIV_SHIFT	0
 #define	RK3328_CLK_PLL_FBDIV_MASK	0xFFF
 
 #define	RK3328_CLK_PLL_POSTDIV1_OFFSET	0
 #define	RK3328_CLK_PLL_POSTDIV1_SHIFT	12
 #define	RK3328_CLK_PLL_POSTDIV1_MASK	0x7000
 
 #define	RK3328_CLK_PLL_DSMPD_OFFSET	4
 #define	RK3328_CLK_PLL_DSMPD_SHIFT	12
 #define	RK3328_CLK_PLL_DSMPD_MASK	0x1000
 
 #define	RK3328_CLK_PLL_REFDIV_OFFSET	4
 #define	RK3328_CLK_PLL_REFDIV_SHIFT	0
 #define	RK3328_CLK_PLL_REFDIV_MASK	0x3F
 
 #define	RK3328_CLK_PLL_POSTDIV2_OFFSET	4
 #define	RK3328_CLK_PLL_POSTDIV2_SHIFT	6
 #define	RK3328_CLK_PLL_POSTDIV2_MASK	0x1C0
 
 #define	RK3328_CLK_PLL_FRAC_OFFSET	8
 #define	RK3328_CLK_PLL_FRAC_SHIFT	0
 #define	RK3328_CLK_PLL_FRAC_MASK	0xFFFFFF
 
 #define	RK3328_CLK_PLL_LOCK_MASK	0x400
 
 #define	RK3328_CLK_PLL_MODE_SLOW	0
 #define	RK3328_CLK_PLL_MODE_NORMAL	1
 #define	RK3328_CLK_PLL_MODE_MASK	0x1
 
 static int
 rk3328_clk_pll_init(struct clknode *clk, device_t dev)
 {
 	struct rk_clk_pll_sc *sc;
 
 	sc = clknode_get_softc(clk);
 
 	clknode_init_parent_idx(clk, 0);
 
 	return (0);
 }
 
 static int
 rk3328_clk_pll_recalc(struct clknode *clk, uint64_t *freq)
 {
 	struct rk_clk_pll_sc *sc;
 	uint64_t rate;
 	uint32_t dsmpd, refdiv, fbdiv;
 	uint32_t postdiv1, postdiv2, frac;
 	uint32_t raw1, raw2, raw3;
 
 	sc = clknode_get_softc(clk);
 
 	DEVICE_LOCK(clk);
 
 	READ4(clk, sc->base_offset, &raw1);
 	READ4(clk, sc->base_offset + 4, &raw2);
 	READ4(clk, sc->base_offset + 8, &raw3);
 
 	fbdiv = (raw1 & RK3328_CLK_PLL_FBDIV_MASK) >> RK3328_CLK_PLL_FBDIV_SHIFT;
 	postdiv1 = (raw1 & RK3328_CLK_PLL_POSTDIV1_MASK) >> RK3328_CLK_PLL_POSTDIV1_SHIFT;
 
 	dsmpd = (raw2 & RK3328_CLK_PLL_DSMPD_MASK) >> RK3328_CLK_PLL_DSMPD_SHIFT;
 	refdiv = (raw2 & RK3328_CLK_PLL_REFDIV_MASK) >> RK3328_CLK_PLL_REFDIV_SHIFT;
 	postdiv2 = (raw2 & RK3328_CLK_PLL_POSTDIV2_MASK) >> RK3328_CLK_PLL_POSTDIV2_SHIFT;
 
 	frac = (raw3 & RK3328_CLK_PLL_FRAC_MASK) >> RK3328_CLK_PLL_FRAC_SHIFT;
 
 	DEVICE_UNLOCK(clk);
 
 	rate = *freq * fbdiv / refdiv;
 	if (dsmpd == 0) {
 		/* Fractional mode */
 		uint64_t frac_rate;
 
 		frac_rate = *freq * frac / refdiv;
 		rate += frac_rate >> 24;
 	}
 
 	*freq = rate / postdiv1 / postdiv2;
 
 	if (*freq % 2)
 		*freq = *freq + 1;
 
 	return (0);
 }
 
 static int
 rk3328_clk_pll_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout,
     int flags, int *stop)
 {
 	struct rk_clk_pll_rate *rates;
 	struct rk_clk_pll_sc *sc;
 	uint32_t reg;
 	int timeout;
 
 	sc = clknode_get_softc(clk);
 
 	if (sc->rates)
 		rates = sc->rates;
 	else if (sc->frac_rates)
 		rates = sc->frac_rates;
 	else
 		return (EINVAL);
 
 	for (; rates->freq; rates++) {
 		if (rates->freq == *fout)
 			break;
 	}
 	if (rates->freq == 0) {
 		*stop = 1;
 		return (EINVAL);
 	}
 
 	DEVICE_LOCK(clk);
 
 	/* Setting to slow mode during frequency change */
 	reg = (RK3328_CLK_PLL_MODE_MASK << sc->mode_shift) <<
 		RK_CLK_PLL_MASK_SHIFT;
 	dprintf("Set PLL_MODEREG to %x\n", reg);
 	WRITE4(clk, sc->mode_reg, reg);
 
 	/* Setting postdiv1 and fbdiv */
 	reg = (rates->postdiv1 << RK3328_CLK_PLL_POSTDIV1_SHIFT) |
 		(rates->fbdiv << RK3328_CLK_PLL_FBDIV_SHIFT);
 	reg |= (RK3328_CLK_PLL_POSTDIV1_MASK | RK3328_CLK_PLL_FBDIV_MASK) << 16;
 	dprintf("Set PLL_CON0 to %x\n", reg);
 	WRITE4(clk, sc->base_offset, reg);
 
 	/* Setting dsmpd, postdiv2 and refdiv */
 	reg = (rates->dsmpd << RK3328_CLK_PLL_DSMPD_SHIFT) |
 		(rates->postdiv2 << RK3328_CLK_PLL_POSTDIV2_SHIFT) |
 		(rates->refdiv << RK3328_CLK_PLL_REFDIV_SHIFT);
 	reg |= (RK3328_CLK_PLL_DSMPD_MASK |
 	    RK3328_CLK_PLL_POSTDIV2_MASK |
 	    RK3328_CLK_PLL_REFDIV_MASK) << RK_CLK_PLL_MASK_SHIFT;
 	dprintf("Set PLL_CON1 to %x\n", reg);
 	WRITE4(clk, sc->base_offset + 0x4, reg);
 
 	/* Setting frac */
 	READ4(clk, sc->base_offset + 0x8, &reg);
 	reg &= ~RK3328_CLK_PLL_FRAC_MASK;
 	reg |= rates->frac << RK3328_CLK_PLL_FRAC_SHIFT;
 	dprintf("Set PLL_CON2 to %x\n", reg);
 	WRITE4(clk, sc->base_offset + 0x8, reg);
 
 	/* Reading lock */
 	for (timeout = 1000; timeout; timeout--) {
 		READ4(clk, sc->base_offset + 0x4, &reg);
 		if ((reg & RK3328_CLK_PLL_LOCK_MASK) == 0)
 			break;
 		DELAY(1);
 	}
 
 	/* Set back to normal mode */
 	reg = (RK3328_CLK_PLL_MODE_NORMAL << sc->mode_shift);
 	reg |= (RK3328_CLK_PLL_MODE_MASK << sc->mode_shift) <<
 		RK_CLK_PLL_MASK_SHIFT;
 	dprintf("Set PLL_MODEREG to %x\n", reg);
 	WRITE4(clk, sc->mode_reg, reg);
 
 	DEVICE_UNLOCK(clk);
 
 	*stop = 1;
 	return (0);
 }
 
 static clknode_method_t rk3328_clk_pll_clknode_methods[] = {
 	/* Device interface */
 	CLKNODEMETHOD(clknode_init,		rk3328_clk_pll_init),
 	CLKNODEMETHOD(clknode_set_gate,		rk_clk_pll_set_gate),
 	CLKNODEMETHOD(clknode_recalc_freq,	rk3328_clk_pll_recalc),
 	CLKNODEMETHOD(clknode_set_freq,		rk3328_clk_pll_set_freq),
 	CLKNODEMETHOD_END
 };
 
 DEFINE_CLASS_1(rk3328_clk_pll_clknode, rk3328_clk_pll_clknode_class,
     rk3328_clk_pll_clknode_methods, sizeof(struct rk_clk_pll_sc), clknode_class);
 
 int
 rk3328_clk_pll_register(struct clkdom *clkdom, struct rk_clk_pll_def *clkdef)
 {
 	struct clknode *clk;
 	struct rk_clk_pll_sc *sc;
 
 	clk = clknode_create(clkdom, &rk3328_clk_pll_clknode_class,
 	    &clkdef->clkdef);
 	if (clk == NULL)
 		return (1);
 
 	sc = clknode_get_softc(clk);
 
 	sc->base_offset = clkdef->base_offset;
 	sc->gate_offset = clkdef->gate_offset;
 	sc->gate_shift = clkdef->gate_shift;
 	sc->mode_reg = clkdef->mode_reg;
 	sc->mode_shift = clkdef->mode_shift;
 	sc->flags = clkdef->flags;
 	sc->rates = clkdef->rates;
 	sc->frac_rates = clkdef->frac_rates;
 
 	clknode_register(clkdom, clk);
 
 	return (0);
 }
 
 #define	RK3399_CLK_PLL_FBDIV_OFFSET		0
 #define	RK3399_CLK_PLL_FBDIV_SHIFT		0
 #define	RK3399_CLK_PLL_FBDIV_MASK		0xFFF
 
 #define	RK3399_CLK_PLL_POSTDIV2_OFFSET	4
 #define	RK3399_CLK_PLL_POSTDIV2_SHIFT	12
 #define	RK3399_CLK_PLL_POSTDIV2_MASK	0x7000
 
 #define	RK3399_CLK_PLL_POSTDIV1_OFFSET	4
 #define	RK3399_CLK_PLL_POSTDIV1_SHIFT	8
 #define	RK3399_CLK_PLL_POSTDIV1_MASK	0x700
 
 #define	RK3399_CLK_PLL_REFDIV_OFFSET	4
 #define	RK3399_CLK_PLL_REFDIV_SHIFT	0
 #define	RK3399_CLK_PLL_REFDIV_MASK	0x3F
 
 #define	RK3399_CLK_PLL_FRAC_OFFSET	8
 #define	RK3399_CLK_PLL_FRAC_SHIFT	0
 #define	RK3399_CLK_PLL_FRAC_MASK	0xFFFFFF
 
 #define	RK3399_CLK_PLL_DSMPD_OFFSET	0xC
 #define	RK3399_CLK_PLL_DSMPD_SHIFT	3
 #define	RK3399_CLK_PLL_DSMPD_MASK	0x8
 
 #define	RK3399_CLK_PLL_LOCK_OFFSET	8
 #define	RK3399_CLK_PLL_LOCK_MASK	0x400
 
 #define	RK3399_CLK_PLL_MODE_OFFSET	0xC
 #define	RK3399_CLK_PLL_MODE_MASK	0x300
 #define	RK3399_CLK_PLL_MODE_SLOW	0
 #define	RK3399_CLK_PLL_MODE_NORMAL	1
 #define	RK3399_CLK_PLL_MODE_DEEPSLOW	2
 #define	RK3399_CLK_PLL_MODE_SHIFT	8
 
 #define	RK3399_CLK_PLL_WRITE_MASK	0xFFFF0000
 
 static int
 rk3399_clk_pll_init(struct clknode *clk, device_t dev)
 {
 	struct rk_clk_pll_sc *sc;
 	uint32_t reg;
 
 	sc = clknode_get_softc(clk);
 
 	if (sc->normal_mode) {
 		/* Setting to normal mode */
 		reg = RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT;
 		reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT;
 		WRITE4(clk, sc->base_offset + RK3399_CLK_PLL_MODE_OFFSET,
 		    reg | RK3399_CLK_PLL_WRITE_MASK);
 	}
 
 	clknode_init_parent_idx(clk, 0);
 
 	return (0);
 }
 
 static int
 rk3399_clk_pll_recalc(struct clknode *clk, uint64_t *freq)
 {
 	struct rk_clk_pll_sc *sc;
 	uint32_t dsmpd, refdiv, fbdiv;
 	uint32_t postdiv1, postdiv2, fracdiv;
 	uint32_t con1, con2, con3, con4;
 	uint64_t foutvco;
 	uint32_t mode;
 	sc = clknode_get_softc(clk);
 
 	DEVICE_LOCK(clk);
 	READ4(clk, sc->base_offset, &con1);
 	READ4(clk, sc->base_offset + 4, &con2);
 	READ4(clk, sc->base_offset + 8, &con3);
 	READ4(clk, sc->base_offset + 0xC, &con4);
 	DEVICE_UNLOCK(clk);
 
 	/*
 	 * if we are in slow mode the output freq
 	 * is the parent one, the 24Mhz external oscillator
 	 * if we are in deep mode the output freq is 32.768khz
 	 */
 	mode = (con4 & RK3399_CLK_PLL_MODE_MASK) >> RK3399_CLK_PLL_MODE_SHIFT;
 	if (mode == RK3399_CLK_PLL_MODE_SLOW) {
 		dprintf("pll in slow mode, con4=%x\n", con4);
 		return (0);
 	} else if (mode == RK3399_CLK_PLL_MODE_DEEPSLOW) {
 		dprintf("pll in deep slow, con4=%x\n", con4);
 		*freq = 32768;
 		return (0);
 	}
 
 	dprintf("con0: %x\n", con1);
 	dprintf("con1: %x\n", con2);
 	dprintf("con2: %x\n", con3);
 	dprintf("con3: %x\n", con4);
 
-	fbdiv = (con1 & RK3399_CLK_PLL_FBDIV_MASK) >> RK3399_CLK_PLL_FBDIV_SHIFT;
+	fbdiv = (con1 & RK3399_CLK_PLL_FBDIV_MASK)
+	    >> RK3399_CLK_PLL_FBDIV_SHIFT;
 
-	postdiv1 = (con2 & RK3399_CLK_PLL_POSTDIV1_MASK) >> RK3399_CLK_PLL_POSTDIV1_SHIFT;
-	postdiv2 = (con2 & RK3399_CLK_PLL_POSTDIV2_MASK) >> RK3399_CLK_PLL_POSTDIV2_SHIFT;
-	refdiv = (con2 & RK3399_CLK_PLL_REFDIV_MASK) >> RK3399_CLK_PLL_REFDIV_SHIFT;
+	postdiv1 = (con2 & RK3399_CLK_PLL_POSTDIV1_MASK)
+	    >> RK3399_CLK_PLL_POSTDIV1_SHIFT;
+	postdiv2 = (con2 & RK3399_CLK_PLL_POSTDIV2_MASK)
+	    >> RK3399_CLK_PLL_POSTDIV2_SHIFT;
+	refdiv = (con2 & RK3399_CLK_PLL_REFDIV_MASK)
+	    >> RK3399_CLK_PLL_REFDIV_SHIFT;
 
-	fracdiv = (con3 & RK3399_CLK_PLL_FRAC_MASK) >> RK3399_CLK_PLL_FRAC_SHIFT;
+	fracdiv = (con3 & RK3399_CLK_PLL_FRAC_MASK)
+	    >> RK3399_CLK_PLL_FRAC_SHIFT;
 	fracdiv >>= 24;
 
 	dsmpd = (con4 & RK3399_CLK_PLL_DSMPD_MASK) >> RK3399_CLK_PLL_DSMPD_SHIFT;
 
 	dprintf("fbdiv: %d\n", fbdiv);
 	dprintf("postdiv1: %d\n", postdiv1);
 	dprintf("postdiv2: %d\n", postdiv2);
 	dprintf("refdiv: %d\n", refdiv);
 	dprintf("fracdiv: %d\n", fracdiv);
 	dprintf("dsmpd: %d\n", dsmpd);
 
-	dprintf("parent freq=%lu\n", *freq);
+	dprintf("parent freq=%ju\n", *freq);
 
 	if (dsmpd == 0) {
 		/* Fractional mode */
 		foutvco = *freq / refdiv * (fbdiv + fracdiv);
 	} else {
 		/* Integer mode */
 		foutvco = *freq / refdiv * fbdiv;
 	}
-	dprintf("foutvco: %lu\n", foutvco);
+	dprintf("foutvco: %ju\n", foutvco);
 
 	*freq = foutvco / postdiv1 / postdiv2;
-	dprintf("freq: %lu\n", *freq);
+	dprintf("freq: %ju\n", *freq);
 
 	return (0);
 }
 
 static int
 rk3399_clk_pll_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout,
     int flags, int *stop)
 {
 	struct rk_clk_pll_rate *rates;
 	struct rk_clk_pll_sc *sc;
 	uint32_t reg;
 	int timeout;
 
 	sc = clknode_get_softc(clk);
 
 	if (sc->rates)
 		rates = sc->rates;
 	else if (sc->frac_rates)
 		rates = sc->frac_rates;
 	else
 		return (EINVAL);
 
 	for (; rates->freq; rates++) {
 		if (rates->freq == *fout)
 			break;
 	}
 	if (rates->freq == 0) {
 		*stop = 1;
 		return (EINVAL);
 	}
 
 	DEVICE_LOCK(clk);
 
 	/* Set to slow mode during frequency change */
 	reg = RK3399_CLK_PLL_MODE_SLOW << RK3399_CLK_PLL_MODE_SHIFT;
 	reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT;
 	WRITE4(clk, sc->base_offset + 0xC, reg);
 
 	/* Setting fbdiv */
 	reg = rates->fbdiv << RK3399_CLK_PLL_FBDIV_SHIFT;
 	reg |= RK3399_CLK_PLL_FBDIV_MASK << RK_CLK_PLL_MASK_SHIFT;
 	WRITE4(clk, sc->base_offset, reg);
 
 	/* Setting postdiv1, postdiv2 and refdiv */
 	reg = rates->postdiv1 << RK3399_CLK_PLL_POSTDIV1_SHIFT;
 	reg |= rates->postdiv2 << RK3399_CLK_PLL_POSTDIV2_SHIFT;
 	reg |= rates->refdiv << RK3399_CLK_PLL_REFDIV_SHIFT;
 	reg |= (RK3399_CLK_PLL_POSTDIV1_MASK | RK3399_CLK_PLL_POSTDIV2_MASK |
 	    RK3399_CLK_PLL_REFDIV_MASK) << RK_CLK_PLL_MASK_SHIFT;
 	WRITE4(clk, sc->base_offset + 0x4, reg);
 
 	/* Setting frac */
 	READ4(clk, sc->base_offset + 0x8, &reg);
 	reg &= ~RK3399_CLK_PLL_FRAC_MASK;
 	reg |= rates->frac << RK3399_CLK_PLL_FRAC_SHIFT;
 	WRITE4(clk, sc->base_offset + 0x8, reg | RK3399_CLK_PLL_WRITE_MASK);
 
 	/* Set dsmpd */
 	reg = rates->dsmpd << RK3399_CLK_PLL_DSMPD_SHIFT;
 	reg |= RK3399_CLK_PLL_DSMPD_MASK << RK_CLK_PLL_MASK_SHIFT;
 	WRITE4(clk, sc->base_offset + 0xC, reg);
 
 	/* Reading lock */
 	for (timeout = 1000; timeout; timeout--) {
 		READ4(clk, sc->base_offset + RK3399_CLK_PLL_LOCK_OFFSET, &reg);
 		if ((reg & RK3399_CLK_PLL_LOCK_MASK) == 0)
 			break;
 		DELAY(1);
 	}
 
 	/* Set back to normal mode */
 	reg = RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT;
 	reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT;
 	WRITE4(clk, sc->base_offset + 0xC, reg);
 
 	DEVICE_UNLOCK(clk);
 
 	*stop = 1;
 	return (0);
 }
 
 static clknode_method_t rk3399_clk_pll_clknode_methods[] = {
 	/* Device interface */
 	CLKNODEMETHOD(clknode_init,		rk3399_clk_pll_init),
 	CLKNODEMETHOD(clknode_set_gate,		rk_clk_pll_set_gate),
 	CLKNODEMETHOD(clknode_recalc_freq,	rk3399_clk_pll_recalc),
 	CLKNODEMETHOD(clknode_set_freq,		rk3399_clk_pll_set_freq),
 	CLKNODEMETHOD_END
 };
 
 DEFINE_CLASS_1(rk3399_clk_pll_clknode, rk3399_clk_pll_clknode_class,
     rk3399_clk_pll_clknode_methods, sizeof(struct rk_clk_pll_sc), clknode_class);
 
 int
 rk3399_clk_pll_register(struct clkdom *clkdom, struct rk_clk_pll_def *clkdef)
 {
 	struct clknode *clk;
 	struct rk_clk_pll_sc *sc;
 
 	clk = clknode_create(clkdom, &rk3399_clk_pll_clknode_class,
 	    &clkdef->clkdef);
 	if (clk == NULL)
 		return (1);
 
 	sc = clknode_get_softc(clk);
 
 	sc->base_offset = clkdef->base_offset;
 	sc->gate_offset = clkdef->gate_offset;
 	sc->gate_shift = clkdef->gate_shift;
 	sc->flags = clkdef->flags;
 	sc->rates = clkdef->rates;
 	sc->frac_rates = clkdef->frac_rates;
 	sc->normal_mode = clkdef->normal_mode;
 
 	clknode_register(clkdom, clk);
 
 	return (0);
 }
Index: stable/12/sys/arm64/rockchip/clk/rk_cru.c
===================================================================
--- stable/12/sys/arm64/rockchip/clk/rk_cru.c	(revision 358643)
+++ stable/12/sys/arm64/rockchip/clk/rk_cru.c	(revision 358644)
@@ -1,288 +1,305 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
  * Copyright (c) 2018 Emmanuel Vadot <manu@freebsd.org>
  * All rights reserved.
  *
  * 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.
  *
  * $FreeBSD$
  */
 
 /*
  * RockChip Clock and Reset Unit
  */
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
 #include <sys/rman.h>
 #include <sys/kernel.h>
 #include <sys/module.h>
 #include <machine/bus.h>
 
 #include <dev/fdt/simplebus.h>
 
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 
 #include <dev/extres/clk/clk.h>
 #include <dev/extres/clk/clk_gate.h>
+#include <dev/extres/clk/clk_fixed.h>
+#include <dev/extres/clk/clk_link.h>
 #include <dev/extres/hwreset/hwreset.h>
 
 #include <arm64/rockchip/clk/rk_clk_composite.h>
 #include <arm64/rockchip/clk/rk_clk_gate.h>
 #include <arm64/rockchip/clk/rk_clk_mux.h>
 #include <arm64/rockchip/clk/rk_clk_pll.h>
 #include <arm64/rockchip/clk/rk_cru.h>
 
 #include "clkdev_if.h"
 #include "hwreset_if.h"
 
 static struct resource_spec rk_cru_spec[] = {
 	{ SYS_RES_MEMORY,	0,	RF_ACTIVE },
 	{ -1, 0 }
 };
 
 #define	CCU_READ4(sc, reg)		bus_read_4((sc)->res, (reg))
 #define	CCU_WRITE4(sc, reg, val)	bus_write_4((sc)->res, (reg), (val))
 
 void	rk3328_cru_register_clocks(struct rk_cru_softc *sc);
 
 static int
 rk_cru_write_4(device_t dev, bus_addr_t addr, uint32_t val)
 {
 	struct rk_cru_softc *sc;
 
 	sc = device_get_softc(dev);
 	CCU_WRITE4(sc, addr, val);
 	return (0);
 }
 
 static int
 rk_cru_read_4(device_t dev, bus_addr_t addr, uint32_t *val)
 {
 	struct rk_cru_softc *sc;
 
 	sc = device_get_softc(dev);
 
 	*val = CCU_READ4(sc, addr);
 	return (0);
 }
 
 static int
 rk_cru_modify_4(device_t dev, bus_addr_t addr, uint32_t clr, uint32_t set)
 {
 	struct rk_cru_softc *sc;
 	uint32_t reg;
 
 	sc = device_get_softc(dev);
 
 	reg = CCU_READ4(sc, addr);
 	reg &= ~clr;
 	reg |= set;
 	CCU_WRITE4(sc, addr, reg);
 
 	return (0);
 }
 
 static int
 rk_cru_reset_assert(device_t dev, intptr_t id, bool reset)
 {
 	struct rk_cru_softc *sc;
 	uint32_t reg;
 	int bit;
 	uint32_t val;
 
 	sc = device_get_softc(dev);
 
 	if (id > sc->reset_num)
 		return (ENXIO);
 
 	reg = sc->reset_offset + id / 16 * 4;
 	bit = id % 16;
 
 	mtx_lock(&sc->mtx);
 	val = 0;
 	if (reset)
 		val = (1 << bit);
 	CCU_WRITE4(sc, reg, val | ((1 << bit) << 16));
 	mtx_unlock(&sc->mtx);
 
 	return (0);
 }
 
 static int
 rk_cru_reset_is_asserted(device_t dev, intptr_t id, bool *reset)
 {
 	struct rk_cru_softc *sc;
 	uint32_t reg;
 	int bit;
 	uint32_t val;
 
 	sc = device_get_softc(dev);
 
 	if (id > sc->reset_num)
 		return (ENXIO);
 	reg = sc->reset_offset + id / 16 * 4;
 	bit = id % 16;
 
 	mtx_lock(&sc->mtx);
 	val = CCU_READ4(sc, reg);
 	mtx_unlock(&sc->mtx);
 
 	*reset = false;
 	if (val & (1 << bit))
 		*reset = true;
 
 	return (0);
 }
 
 static void
 rk_cru_device_lock(device_t dev)
 {
 	struct rk_cru_softc *sc;
 
 	sc = device_get_softc(dev);
 	mtx_lock(&sc->mtx);
 }
 
 static void
 rk_cru_device_unlock(device_t dev)
 {
 	struct rk_cru_softc *sc;
 
 	sc = device_get_softc(dev);
 	mtx_unlock(&sc->mtx);
 }
 
 static int
 rk_cru_register_gates(struct rk_cru_softc *sc)
 {
 	struct rk_clk_gate_def def;
 	int i;
 
 	for (i = 0; i < sc->ngates; i++) {
 		if (sc->gates[i].name == NULL)
 			continue;
 		memset(&def, 0, sizeof(def));
 		def.clkdef.id = sc->gates[i].id;
 		def.clkdef.name = sc->gates[i].name;
 		def.clkdef.parent_names = &sc->gates[i].parent_name;
 		def.clkdef.parent_cnt = 1;
 		def.offset = sc->gates[i].offset;
 		def.shift = sc->gates[i].shift;
 		def.mask = 1;
 		def.on_value = 0;
 		def.off_value = 1;
 		rk_clk_gate_register(sc->clkdom, &def);
 	}
 
 	return (0);
 }
 
 int
 rk_cru_attach(device_t dev)
 {
 	struct rk_cru_softc *sc;
 	phandle_t node;
 	int	i;
 
 	sc = device_get_softc(dev);
 	sc->dev = dev;
 
 	node = ofw_bus_get_node(dev);
 
 	if (bus_alloc_resources(dev, rk_cru_spec, &sc->res) != 0) {
 		device_printf(dev, "cannot allocate resources for device\n");
 		return (ENXIO);
 	}
 
 	mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF);
 
 	sc->clkdom = clkdom_create(dev);
 	if (sc->clkdom == NULL)
 		panic("Cannot create clkdom\n");
 
 	for (i = 0; i < sc->nclks; i++) {
 		switch (sc->clks[i].type) {
 		case RK_CLK_UNDEFINED:
 			break;
 		case RK3328_CLK_PLL:
-			rk3328_clk_pll_register(sc->clkdom, sc->clks[i].clk.pll);
+			rk3328_clk_pll_register(sc->clkdom,
+			    sc->clks[i].clk.pll);
 			break;
 		case RK3399_CLK_PLL:
-			rk3399_clk_pll_register(sc->clkdom, sc->clks[i].clk.pll);
+			rk3399_clk_pll_register(sc->clkdom,
+			    sc->clks[i].clk.pll);
 			break;
 		case RK_CLK_COMPOSITE:
 			rk_clk_composite_register(sc->clkdom,
 			    sc->clks[i].clk.composite);
 			break;
 		case RK_CLK_MUX:
 			rk_clk_mux_register(sc->clkdom, sc->clks[i].clk.mux);
 			break;
 		case RK_CLK_ARMCLK:
-			rk_clk_armclk_register(sc->clkdom, sc->clks[i].clk.armclk);
+			rk_clk_armclk_register(sc->clkdom,
+			    sc->clks[i].clk.armclk);
 			break;
+		case RK_CLK_FIXED:
+			clknode_fixed_register(sc->clkdom,
+			    sc->clks[i].clk.fixed);
+			break;
+		case RK_CLK_FRACT:
+			rk_clk_fract_register(sc->clkdom,
+			    sc->clks[i].clk.fract);
+			break;
+		case RK_CLK_LINK:
+			clknode_link_register(sc->clkdom,
+			    sc->clks[i].clk.link);
+			break;
 		default:
 			device_printf(dev, "Unknown clock type\n");
 			return (ENXIO);
-			break;
 		}
 	}
+
 	if (sc->gates)
 		rk_cru_register_gates(sc);
 
 	if (clkdom_finit(sc->clkdom) != 0)
 		panic("cannot finalize clkdom initialization\n");
 
 	if (bootverbose)
 		clkdom_dump(sc->clkdom);
 
 	clk_set_assigned(dev, node);
 
 	/* register our self as a reset provider */
 	hwreset_register_ofw_provider(dev);
 
 	return (0);
 }
 
 static device_method_t rk_cru_methods[] = {
 	/* clkdev interface */
 	DEVMETHOD(clkdev_write_4,	rk_cru_write_4),
 	DEVMETHOD(clkdev_read_4,	rk_cru_read_4),
 	DEVMETHOD(clkdev_modify_4,	rk_cru_modify_4),
 	DEVMETHOD(clkdev_device_lock,	rk_cru_device_lock),
 	DEVMETHOD(clkdev_device_unlock,	rk_cru_device_unlock),
 
 	/* Reset interface */
 	DEVMETHOD(hwreset_assert,	rk_cru_reset_assert),
 	DEVMETHOD(hwreset_is_asserted,	rk_cru_reset_is_asserted),
 
 	DEVMETHOD_END
 };
 
 DEFINE_CLASS_0(rk_cru, rk_cru_driver, rk_cru_methods,
     sizeof(struct rk_cru_softc));
Index: stable/12/sys/arm64/rockchip/clk/rk_cru.h
===================================================================
--- stable/12/sys/arm64/rockchip/clk/rk_cru.h	(revision 358643)
+++ stable/12/sys/arm64/rockchip/clk/rk_cru.h	(revision 358644)
@@ -1,97 +1,253 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
  * Copyright (c) 2018 Emmanuel Vadot <manu@freebsd.org>
  * All rights reserved.
  *
  * 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.
  *
  * $FreeBSD$
  */
 
 #ifndef __RK_CRU_H__
 #define __RK_CRU_H__
 
+#include <dev/extres/clk/clk.h>
+#include <dev/extres/clk/clk_div.h>
+#include <dev/extres/clk/clk_gate.h>
+#include <dev/extres/clk/clk_fixed.h>
+#include <dev/extres/clk/clk_link.h>
+
 #include <arm64/rockchip/clk/rk_clk_armclk.h>
 #include <arm64/rockchip/clk/rk_clk_composite.h>
+#include <arm64/rockchip/clk/rk_clk_fract.h>
 #include <arm64/rockchip/clk/rk_clk_gate.h>
 #include <arm64/rockchip/clk/rk_clk_mux.h>
 #include <arm64/rockchip/clk/rk_clk_pll.h>
 
+/* Macro for defining various types of clocks. */
+/* Pure gate */
+#define	GATE(_idx, _clkname, _pname, _o, _s)				\
+{									\
+	.id = _idx,							\
+	.name = _clkname,						\
+	.parent_name = _pname,						\
+	.offset = CRU_CLKGATE_CON(_o),					\
+	.shift = _s,							\
+}
+
+/* Fixed rate clock. */
+#define	FRATE(_id, _name, _freq)					\
+{									\
+	.type = RK_CLK_FIXED,						\
+	.clk.fixed = &(struct clk_fixed_def) {				\
+		.clkdef.id = _id,					\
+		.clkdef.name = _name,					\
+		.clkdef.parent_names = NULL,				\
+		.clkdef.parent_cnt = 0,					\
+		.clkdef.flags = CLK_NODE_STATIC_STRINGS,		\
+		.freq = _freq,						\
+	},								\
+}
+
+/* Fixed factor multipier/divider. */
+#define	FFACT(_id, _name, _pname, _mult, _div)				\
+{									\
+	.type = RK_CLK_FIXED,						\
+	.clk.fixed = &(struct clk_fixed_def) {				\
+		.clkdef.id = _id,					\
+		.clkdef.name = _name,					\
+		.clkdef.parent_names = (const char *[]){_pname},	\
+		.clkdef.parent_cnt = 1,					\
+		.clkdef.flags = CLK_NODE_STATIC_STRINGS,		\
+		.mult = _mult,						\
+		.div = _div,						\
+	},								\
+}
+
+/* Linked clock. */
+#define	LINK(_name)							\
+{									\
+	.type = RK_CLK_LINK,						\
+	.clk.link = &(struct clk_link_def) {				\
+		.clkdef.id = 0,						\
+		.clkdef.name = _name,					\
+		.clkdef.parent_names = NULL,				\
+		.clkdef.parent_cnt = 0,					\
+		.clkdef.flags = CLK_NODE_STATIC_STRINGS,		\
+	},								\
+}
+
+/* Complex clock fo ARM cores. */
+#define ARMDIV(_id, _name, _pn, _r, _o, _ds, _dw, _ms, _mw, _mp, _ap)	\
+{									\
+	.type = RK_CLK_ARMCLK,						\
+	.clk.armclk = &(struct rk_clk_armclk_def) {			\
+		.clkdef.id = _id,					\
+		.clkdef.name = _name,					\
+		.clkdef.parent_names = _pn,				\
+		.clkdef.parent_cnt = nitems(_pn),			\
+		.clkdef.flags = CLK_NODE_STATIC_STRINGS,		\
+		.muxdiv_offset = CRU_CLKSEL_CON(_o),			\
+		.mux_shift = _ms,					\
+		.mux_width = _mw,					\
+		.div_shift = _ds,					\
+		.div_width = _dw,					\
+		.main_parent = _mp,					\
+		.alt_parent = _ap,					\
+		.rates = _r,						\
+		.nrates = nitems(_r),					\
+	},								\
+}
+
+/* Fractional rate multipier/divider. */
+#define	FRACT(_id, _name, _pname, _f, _o)				\
+{									\
+	.type = RK_CLK_FRACT,						\
+	.clk.fract = &(struct rk_clk_fract_def) {			\
+		.clkdef.id = _id,					\
+		.clkdef.name = _name,					\
+		.clkdef.parent_names = (const char *[]){_pname},	\
+		.clkdef.parent_cnt = 1,					\
+		.clkdef.flags = CLK_NODE_STATIC_STRINGS,		\
+		.offset = CRU_CLKSEL_CON(_o),				\
+		.flags = _f,						\
+	},								\
+}
+
+/* Full composite clock. */
+#define COMP(_id, _name, _pnames, _f,  _o,  _ds, _dw,  _ms, _mw)	\
+{									\
+	.type = RK_CLK_COMPOSITE,					\
+	.clk.composite = &(struct rk_clk_composite_def) {		\
+		.clkdef.id = _id,					\
+		.clkdef.name = _name,					\
+		.clkdef.parent_names = _pnames,				\
+		.clkdef.parent_cnt = nitems(_pnames),			\
+		.clkdef.flags = CLK_NODE_STATIC_STRINGS,		\
+		.muxdiv_offset = CRU_CLKSEL_CON(_o),			\
+		.mux_shift = _ms,					\
+		.mux_width = _mw,					\
+		.div_shift = _ds,					\
+		.div_width = _dw,					\
+		.flags = RK_CLK_COMPOSITE_HAVE_MUX | _f, 		\
+	},								\
+}
+
+/* Composite clock without mux (divider only). */
+#define CDIV(_id, _name, _pname, _f, _o, _ds, _dw)			\
+{									\
+	.type = RK_CLK_COMPOSITE,					\
+	.clk.composite = &(struct rk_clk_composite_def) {		\
+		.clkdef.id = _id,					\
+		.clkdef.name = _name,					\
+		.clkdef.parent_names = (const char *[]){_pname},	\
+		.clkdef.parent_cnt = 1,					\
+		.clkdef.flags = CLK_NODE_STATIC_STRINGS,		\
+		.muxdiv_offset = CRU_CLKSEL_CON(_o),			\
+		.div_shift = _ds,					\
+		.div_width = _dw,					\
+		.flags =  _f,						\
+	},								\
+}
+
+/* Complex clock without divider (multiplexer only). */
+#define MUX(_id, _name, _pn, _f,  _mo, _ms, _mw)			\
+{									\
+	.type = RK_CLK_MUX,						\
+	.clk.mux = &(struct rk_clk_mux_def) {				\
+		.clkdef.id = _id,					\
+		.clkdef.name = _name,					\
+		.clkdef.parent_names = _pn,				\
+		.clkdef.parent_cnt = nitems(_pn),			\
+		.clkdef.flags = CLK_NODE_STATIC_STRINGS,		\
+		.offset = CRU_CLKSEL_CON(_mo),				\
+		.shift = _ms,						\
+		.width = _mw,						\
+		.mux_flags = _f, 			\
+	},								\
+}
+
 struct rk_cru_gate {
 	const char	*name;
 	const char	*parent_name;
 	uint32_t	id;
 	uint32_t	offset;
 	uint32_t	shift;
 };
 
 #define	CRU_GATE(idx, clkname, pname, o, s)	\
 	{				\
 		.id = idx,			\
 		.name = clkname,		\
 		.parent_name = pname,		\
 		.offset = o,			\
 		.shift = s,			\
 	},
 
 enum rk_clk_type {
 	RK_CLK_UNDEFINED = 0,
 	RK3328_CLK_PLL,
 	RK3399_CLK_PLL,
 	RK_CLK_COMPOSITE,
+	RK_CLK_FIXED,
+	RK_CLK_FRACT,
 	RK_CLK_MUX,
 	RK_CLK_ARMCLK,
+	RK_CLK_LINK,
 };
 
 struct rk_clk {
 	enum rk_clk_type	type;
 	union {
 		struct rk_clk_pll_def		*pll;
 		struct rk_clk_composite_def	*composite;
 		struct rk_clk_mux_def		*mux;
 		struct rk_clk_armclk_def	*armclk;
+		struct clk_fixed_def		*fixed;
+		struct rk_clk_fract_def		*fract;
+		struct clk_link_def		*link;
 	} clk;
 };
 
 struct rk_cru_softc {
 	device_t		dev;
 	struct resource		*res;
 	struct clkdom		*clkdom;
 	struct mtx		mtx;
 	int			type;
 	uint32_t		reset_offset;
 	uint32_t		reset_num;
 	struct rk_cru_gate	*gates;
 	int			ngates;
 	struct rk_clk		*clks;
 	int			nclks;
 	struct rk_clk_armclk_def	*armclk;
 	struct rk_clk_armclk_rates	*armclk_rates;
 	int			narmclk_rates;
 };
 
 DECLARE_CLASS(rk_cru_driver);
 
 int	rk_cru_attach(device_t dev);
 
 #endif /* __RK_CRU_H__ */
Index: stable/12/sys/conf/files
===================================================================
--- stable/12/sys/conf/files	(revision 358643)
+++ stable/12/sys/conf/files	(revision 358644)
@@ -1,5040 +1,5041 @@
 # $FreeBSD$
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
 # dependency lines other than the first are silently ignored.
 #
 acpi_quirks.h			optional acpi				   \
 	dependency	"$S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" \
 	compile-with	"${AWK} -f $S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"acpi_quirks.h"
 bhnd_nvram_map.h		optional bhnd				   \
 	dependency	"$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \
 	compile-with	"sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -h" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"bhnd_nvram_map.h"
 bhnd_nvram_map_data.h		optional bhnd				   \
 	dependency	"$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \
 	compile-with	"sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -d" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"bhnd_nvram_map_data.h"
 fdt_static_dtb.h		optional fdt fdt_dtb_static \
 	compile-with "sh -c 'MACHINE=${MACHINE} $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}'" \
 	dependency	"${FDT_DTS_FILE:T:R}.dtb" \
 	no-obj no-implicit-rule before-depend \
 	clean		"fdt_static_dtb.h"
 feeder_eq_gen.h			optional sound				   \
 	dependency	"$S/tools/sound/feeder_eq_mkfilter.awk"		   \
 	compile-with	"${AWK} -f $S/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > feeder_eq_gen.h" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"feeder_eq_gen.h"
 feeder_rate_gen.h		optional sound				   \
 	dependency	"$S/tools/sound/feeder_rate_mkfilter.awk"	   \
 	compile-with	"${AWK} -f $S/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > feeder_rate_gen.h" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"feeder_rate_gen.h"
 snd_fxdiv_gen.h			optional sound				   \
 	dependency	"$S/tools/sound/snd_fxdiv_gen.awk"		   \
 	compile-with	"${AWK} -f $S/tools/sound/snd_fxdiv_gen.awk -- > snd_fxdiv_gen.h" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"snd_fxdiv_gen.h"
 miidevs.h			optional miibus | mii			   \
 	dependency	"$S/tools/miidevs2h.awk $S/dev/mii/miidevs"	   \
 	compile-with	"${AWK} -f $S/tools/miidevs2h.awk $S/dev/mii/miidevs" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"miidevs.h"
 pccarddevs.h			standard				   \
 	dependency	"$S/tools/pccarddevs2h.awk $S/dev/pccard/pccarddevs" \
 	compile-with	"${AWK} -f $S/tools/pccarddevs2h.awk $S/dev/pccard/pccarddevs" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"pccarddevs.h"
 kbdmuxmap.h			optional	kbdmux_dflt_keymap 	   \
 	compile-with	"kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${KBDMUX_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > kbdmuxmap.h" \
 	no-obj no-implicit-rule before-depend				\
 	clean		"kbdmuxmap.h"
 teken_state.h		optional sc | vt				   \
 	dependency	"$S/teken/gensequences $S/teken/sequences" \
 	compile-with	"${AWK} -f $S/teken/gensequences $S/teken/sequences > teken_state.h" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"teken_state.h"
 usbdevs.h			optional usb				   \
 	dependency	"$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \
 	compile-with	"${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -h" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"usbdevs.h"
 usbdevs_data.h			optional usb				   \
 	dependency	"$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \
 	compile-with	"${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -d" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"usbdevs_data.h"
 cam/cam.c			optional scbus
 cam/cam_compat.c		optional scbus
 cam/cam_iosched.c		optional scbus
 cam/cam_periph.c		optional scbus
 cam/cam_queue.c			optional scbus
 cam/cam_sim.c			optional scbus
 cam/cam_xpt.c			optional scbus
 cam/ata/ata_all.c		optional scbus
 cam/ata/ata_xpt.c		optional scbus
 cam/ata/ata_pmp.c		optional scbus
 cam/nvme/nvme_all.c		optional scbus
 cam/nvme/nvme_da.c		optional nda | da
 cam/nvme/nvme_xpt.c		optional scbus
 cam/scsi/scsi_xpt.c		optional scbus
 cam/scsi/scsi_all.c		optional scbus
 cam/scsi/scsi_cd.c		optional cd
 cam/scsi/scsi_ch.c		optional ch
 cam/ata/ata_da.c		optional ada | da
 cam/ctl/ctl.c			optional ctl
 cam/ctl/ctl_backend.c		optional ctl
 cam/ctl/ctl_backend_block.c	optional ctl
 cam/ctl/ctl_backend_ramdisk.c	optional ctl
 cam/ctl/ctl_cmd_table.c		optional ctl
 cam/ctl/ctl_frontend.c		optional ctl
 cam/ctl/ctl_frontend_cam_sim.c	optional ctl
 cam/ctl/ctl_frontend_ioctl.c	optional ctl
 cam/ctl/ctl_frontend_iscsi.c	optional ctl cfiscsi
 cam/ctl/ctl_ha.c		optional ctl
 cam/ctl/ctl_scsi_all.c		optional ctl
 cam/ctl/ctl_tpc.c		optional ctl
 cam/ctl/ctl_tpc_local.c		optional ctl
 cam/ctl/ctl_error.c		optional ctl
 cam/ctl/ctl_util.c		optional ctl
 cam/ctl/scsi_ctl.c		optional ctl
 cam/mmc/mmc_xpt.c		optional scbus mmccam
 cam/mmc/mmc_da.c		optional scbus mmccam da
 cam/scsi/scsi_da.c		optional da
 cam/scsi/scsi_low.c		optional ncv | nsp | stg
 cam/scsi/scsi_pass.c		optional pass
 cam/scsi/scsi_pt.c		optional pt
 cam/scsi/scsi_sa.c		optional sa
 cam/scsi/scsi_enc.c		optional ses
 cam/scsi/scsi_enc_ses.c		optional ses
 cam/scsi/scsi_enc_safte.c	optional ses
 cam/scsi/scsi_sg.c		optional sg
 cam/scsi/scsi_targ_bh.c		optional targbh
 cam/scsi/scsi_target.c		optional targ
 cam/scsi/smp_all.c		optional scbus
 # shared between zfs and dtrace
 cddl/compat/opensolaris/kern/opensolaris.c		optional zfs | dtrace compile-with "${CDDL_C}"
 cddl/compat/opensolaris/kern/opensolaris_cmn_err.c	optional zfs | dtrace compile-with "${CDDL_C}"
 cddl/compat/opensolaris/kern/opensolaris_kmem.c		optional zfs | dtrace compile-with "${CDDL_C}"
 cddl/compat/opensolaris/kern/opensolaris_misc.c		optional zfs | dtrace compile-with "${CDDL_C}"
 cddl/compat/opensolaris/kern/opensolaris_proc.c		optional zfs | dtrace compile-with "${CDDL_C}"
 cddl/compat/opensolaris/kern/opensolaris_sunddi.c	optional zfs | dtrace compile-with "${CDDL_C}"
 cddl/compat/opensolaris/kern/opensolaris_taskq.c	optional zfs | dtrace compile-with "${CDDL_C}"
 # zfs specific
 cddl/compat/opensolaris/kern/opensolaris_acl.c				optional zfs compile-with "${ZFS_C}"
 cddl/compat/opensolaris/kern/opensolaris_dtrace.c			optional zfs compile-with "${ZFS_C}"
 cddl/compat/opensolaris/kern/opensolaris_kobj.c				optional zfs compile-with "${ZFS_C}"
 cddl/compat/opensolaris/kern/opensolaris_kstat.c			optional zfs compile-with "${ZFS_C}"
 cddl/compat/opensolaris/kern/opensolaris_lookup.c			optional zfs compile-with "${ZFS_C}"
 cddl/compat/opensolaris/kern/opensolaris_policy.c			optional zfs compile-with "${ZFS_C}"
 cddl/compat/opensolaris/kern/opensolaris_string.c			optional zfs compile-with "${ZFS_C}"
 cddl/compat/opensolaris/kern/opensolaris_sysevent.c			optional zfs compile-with "${ZFS_C}"
 cddl/compat/opensolaris/kern/opensolaris_uio.c				optional zfs compile-with "${ZFS_C}"
 cddl/compat/opensolaris/kern/opensolaris_vfs.c				optional zfs compile-with "${ZFS_C}"
 cddl/compat/opensolaris/kern/opensolaris_vm.c				optional zfs compile-with "${ZFS_C}"
 cddl/compat/opensolaris/kern/opensolaris_zone.c				optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/acl/acl_common.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/avl/avl.c				optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/lz4/lz4.c				optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/nvpair/opensolaris_fnvpair.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair_alloc_fixed.c	optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/unicode/u8_textprep.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/zfs/zfeature_common.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/zfs/zfs_comutil.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/zfs/zfs_deleg.c				optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/zfs/zfs_prop.c				optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/zfs/zpool_prop.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/zfs/zprop_common.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/vnode.c				optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/blkptr.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/bplist.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/bqueue.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/cityhash.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf_stats.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c			optional zfs compile-with "${ZFS_C}" \
 	warning "kernel contains CDDL licensed ZFS filesystem"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/gzip.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c				optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/spa_checkpoint.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_births.c	optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c	optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_iter.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zle.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zthr.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/os/callb.c				optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/os/fm.c				optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/os/list.c				optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/os/nvpair_alloc_system.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/zmod/adler32.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/zmod/deflate.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/zmod/inffast.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/zmod/inflate.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/zmod/inftrees.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/zmod/opensolaris_crc32.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/zmod/trees.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/zmod/zmod.c				optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/zmod/zmod_subr.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/zmod/zutil.c			optional zfs compile-with "${ZFS_C}"
 # zfs lua support
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lapi.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lauxlib.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lbaselib.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lbitlib.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lcode.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lcompat.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lcorolib.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lctype.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ldebug.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ldo.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ldump.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lfunc.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lgc.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/llex.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lmem.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lobject.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lopcodes.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lparser.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstate.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstring.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ltable.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ltablib.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ltm.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lundump.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lvm.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lzio.c			optional zfs compile-with "${ZFS_C}"
 # dtrace specific
 cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	optional dtrace compile-with "${DTRACE_C}" \
 							warning "kernel contains CDDL licensed DTRACE"
 cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c	optional dtrace compile-with "${DTRACE_C}"
 cddl/dev/dtmalloc/dtmalloc.c		optional dtmalloc        | dtraceall compile-with "${CDDL_C}"
 cddl/dev/profile/profile.c		optional dtrace_profile  | dtraceall compile-with "${CDDL_C}"
 cddl/dev/sdt/sdt.c			optional dtrace_sdt      | dtraceall compile-with "${CDDL_C}"
 cddl/dev/fbt/fbt.c			optional dtrace_fbt      | dtraceall compile-with "${FBT_C}"
 cddl/dev/systrace/systrace.c		optional dtrace_systrace | dtraceall compile-with "${CDDL_C}"
 cddl/dev/prototype.c			optional dtrace_prototype | dtraceall compile-with "${CDDL_C}"
 fs/nfsclient/nfs_clkdtrace.c		optional dtnfscl nfscl   | dtraceall nfscl compile-with "${CDDL_C}"
 compat/cloudabi/cloudabi_clock.c	optional compat_cloudabi32 | compat_cloudabi64
 compat/cloudabi/cloudabi_errno.c	optional compat_cloudabi32 | compat_cloudabi64
 compat/cloudabi/cloudabi_fd.c		optional compat_cloudabi32 | compat_cloudabi64
 compat/cloudabi/cloudabi_file.c		optional compat_cloudabi32 | compat_cloudabi64
 compat/cloudabi/cloudabi_futex.c	optional compat_cloudabi32 | compat_cloudabi64
 compat/cloudabi/cloudabi_mem.c		optional compat_cloudabi32 | compat_cloudabi64
 compat/cloudabi/cloudabi_proc.c		optional compat_cloudabi32 | compat_cloudabi64
 compat/cloudabi/cloudabi_random.c	optional compat_cloudabi32 | compat_cloudabi64
 compat/cloudabi/cloudabi_sock.c		optional compat_cloudabi32 | compat_cloudabi64
 compat/cloudabi/cloudabi_thread.c	optional compat_cloudabi32 | compat_cloudabi64
 compat/cloudabi/cloudabi_vdso.c		optional compat_cloudabi32 | compat_cloudabi64
 compat/cloudabi32/cloudabi32_fd.c	optional compat_cloudabi32
 compat/cloudabi32/cloudabi32_module.c	optional compat_cloudabi32
 compat/cloudabi32/cloudabi32_poll.c	optional compat_cloudabi32
 compat/cloudabi32/cloudabi32_sock.c	optional compat_cloudabi32
 compat/cloudabi32/cloudabi32_syscalls.c	optional compat_cloudabi32
 compat/cloudabi32/cloudabi32_sysent.c	optional compat_cloudabi32
 compat/cloudabi32/cloudabi32_thread.c	optional compat_cloudabi32
 compat/cloudabi64/cloudabi64_fd.c	optional compat_cloudabi64
 compat/cloudabi64/cloudabi64_module.c	optional compat_cloudabi64
 compat/cloudabi64/cloudabi64_poll.c	optional compat_cloudabi64
 compat/cloudabi64/cloudabi64_sock.c	optional compat_cloudabi64
 compat/cloudabi64/cloudabi64_syscalls.c	optional compat_cloudabi64
 compat/cloudabi64/cloudabi64_sysent.c	optional compat_cloudabi64
 compat/cloudabi64/cloudabi64_thread.c	optional compat_cloudabi64
 compat/freebsd32/freebsd32_capability.c	optional compat_freebsd32
 compat/freebsd32/freebsd32_ioctl.c	optional compat_freebsd32
 compat/freebsd32/freebsd32_misc.c	optional compat_freebsd32
 compat/freebsd32/freebsd32_syscalls.c	optional compat_freebsd32
 compat/freebsd32/freebsd32_sysent.c	optional compat_freebsd32
 contrib/ck/src/ck_array.c				standard compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 contrib/ck/src/ck_barrier_centralized.c			standard compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 contrib/ck/src/ck_barrier_combining.c			standard compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 contrib/ck/src/ck_barrier_dissemination.c		standard compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 contrib/ck/src/ck_barrier_mcs.c				standard compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 contrib/ck/src/ck_barrier_tournament.c			standard compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 contrib/ck/src/ck_epoch.c				standard compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 contrib/ck/src/ck_hp.c					standard compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 contrib/ck/src/ck_hs.c					standard compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 contrib/ck/src/ck_ht.c					standard compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 contrib/ck/src/ck_rhs.c					standard compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 contrib/dev/acpica/common/ahids.c			optional acpi acpi_debug
 contrib/dev/acpica/common/ahuuids.c			optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbcmds.c		optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbconvert.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbdisply.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbexec.c		optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbhistry.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbinput.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbmethod.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbnames.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbobject.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbstats.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbtest.c		optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbutils.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbxface.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmbuffer.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmcstyle.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmdeferred.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmnames.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmopcode.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmresrc.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmresrcl.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmresrcl2.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmresrcs.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmutils.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmwalk.c	optional acpi acpi_debug
 contrib/dev/acpica/components/dispatcher/dsargs.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dscontrol.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dsdebug.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dsfield.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dsinit.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dsmethod.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dsmthdat.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dsobject.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dsopcode.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dspkginit.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dsutils.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dswexec.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dswload.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dswload2.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dswscope.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dswstate.c	optional acpi
 contrib/dev/acpica/components/events/evevent.c		optional acpi
 contrib/dev/acpica/components/events/evglock.c		optional acpi
 contrib/dev/acpica/components/events/evgpe.c		optional acpi
 contrib/dev/acpica/components/events/evgpeblk.c		optional acpi
 contrib/dev/acpica/components/events/evgpeinit.c	optional acpi
 contrib/dev/acpica/components/events/evgpeutil.c	optional acpi
 contrib/dev/acpica/components/events/evhandler.c	optional acpi
 contrib/dev/acpica/components/events/evmisc.c		optional acpi
 contrib/dev/acpica/components/events/evregion.c		optional acpi
 contrib/dev/acpica/components/events/evrgnini.c		optional acpi
 contrib/dev/acpica/components/events/evsci.c		optional acpi
 contrib/dev/acpica/components/events/evxface.c		optional acpi
 contrib/dev/acpica/components/events/evxfevnt.c		optional acpi
 contrib/dev/acpica/components/events/evxfgpe.c		optional acpi
 contrib/dev/acpica/components/events/evxfregn.c		optional acpi
 contrib/dev/acpica/components/executer/exconcat.c	optional acpi
 contrib/dev/acpica/components/executer/exconfig.c	optional acpi
 contrib/dev/acpica/components/executer/exconvrt.c	optional acpi
 contrib/dev/acpica/components/executer/excreate.c	optional acpi
 contrib/dev/acpica/components/executer/exdebug.c	optional acpi
 contrib/dev/acpica/components/executer/exdump.c		optional acpi
 contrib/dev/acpica/components/executer/exfield.c	optional acpi
 contrib/dev/acpica/components/executer/exfldio.c	optional acpi
 contrib/dev/acpica/components/executer/exmisc.c		optional acpi
 contrib/dev/acpica/components/executer/exmutex.c	optional acpi
 contrib/dev/acpica/components/executer/exnames.c	optional acpi
 contrib/dev/acpica/components/executer/exoparg1.c	optional acpi
 contrib/dev/acpica/components/executer/exoparg2.c	optional acpi
 contrib/dev/acpica/components/executer/exoparg3.c	optional acpi
 contrib/dev/acpica/components/executer/exoparg6.c	optional acpi
 contrib/dev/acpica/components/executer/exprep.c		optional acpi
 contrib/dev/acpica/components/executer/exregion.c	optional acpi
 contrib/dev/acpica/components/executer/exresnte.c	optional acpi
 contrib/dev/acpica/components/executer/exresolv.c	optional acpi
 contrib/dev/acpica/components/executer/exresop.c	optional acpi
 contrib/dev/acpica/components/executer/exserial.c	optional acpi
 contrib/dev/acpica/components/executer/exstore.c	optional acpi
 contrib/dev/acpica/components/executer/exstoren.c	optional acpi
 contrib/dev/acpica/components/executer/exstorob.c	optional acpi
 contrib/dev/acpica/components/executer/exsystem.c	optional acpi
 contrib/dev/acpica/components/executer/extrace.c	optional acpi
 contrib/dev/acpica/components/executer/exutils.c	optional acpi
 contrib/dev/acpica/components/hardware/hwacpi.c		optional acpi
 contrib/dev/acpica/components/hardware/hwesleep.c	optional acpi
 contrib/dev/acpica/components/hardware/hwgpe.c		optional acpi
 contrib/dev/acpica/components/hardware/hwpci.c		optional acpi
 contrib/dev/acpica/components/hardware/hwregs.c		optional acpi
 contrib/dev/acpica/components/hardware/hwsleep.c	optional acpi
 contrib/dev/acpica/components/hardware/hwtimer.c	optional acpi
 contrib/dev/acpica/components/hardware/hwvalid.c	optional acpi
 contrib/dev/acpica/components/hardware/hwxface.c	optional acpi
 contrib/dev/acpica/components/hardware/hwxfsleep.c	optional acpi
 contrib/dev/acpica/components/namespace/nsaccess.c	optional acpi
 contrib/dev/acpica/components/namespace/nsalloc.c	optional acpi
 contrib/dev/acpica/components/namespace/nsarguments.c	optional acpi
 contrib/dev/acpica/components/namespace/nsconvert.c	optional acpi
 contrib/dev/acpica/components/namespace/nsdump.c	optional acpi
 contrib/dev/acpica/components/namespace/nseval.c	optional acpi
 contrib/dev/acpica/components/namespace/nsinit.c	optional acpi
 contrib/dev/acpica/components/namespace/nsload.c	optional acpi
 contrib/dev/acpica/components/namespace/nsnames.c	optional acpi
 contrib/dev/acpica/components/namespace/nsobject.c	optional acpi
 contrib/dev/acpica/components/namespace/nsparse.c	optional acpi
 contrib/dev/acpica/components/namespace/nspredef.c	optional acpi
 contrib/dev/acpica/components/namespace/nsprepkg.c	optional acpi
 contrib/dev/acpica/components/namespace/nsrepair.c	optional acpi
 contrib/dev/acpica/components/namespace/nsrepair2.c	optional acpi
 contrib/dev/acpica/components/namespace/nssearch.c	optional acpi
 contrib/dev/acpica/components/namespace/nsutils.c	optional acpi
 contrib/dev/acpica/components/namespace/nswalk.c	optional acpi
 contrib/dev/acpica/components/namespace/nsxfeval.c	optional acpi
 contrib/dev/acpica/components/namespace/nsxfname.c	optional acpi
 contrib/dev/acpica/components/namespace/nsxfobj.c	optional acpi
 contrib/dev/acpica/components/parser/psargs.c		optional acpi
 contrib/dev/acpica/components/parser/psloop.c		optional acpi
 contrib/dev/acpica/components/parser/psobject.c		optional acpi
 contrib/dev/acpica/components/parser/psopcode.c		optional acpi
 contrib/dev/acpica/components/parser/psopinfo.c		optional acpi
 contrib/dev/acpica/components/parser/psparse.c		optional acpi
 contrib/dev/acpica/components/parser/psscope.c		optional acpi
 contrib/dev/acpica/components/parser/pstree.c		optional acpi
 contrib/dev/acpica/components/parser/psutils.c		optional acpi
 contrib/dev/acpica/components/parser/pswalk.c		optional acpi
 contrib/dev/acpica/components/parser/psxface.c		optional acpi
 contrib/dev/acpica/components/resources/rsaddr.c	optional acpi
 contrib/dev/acpica/components/resources/rscalc.c	optional acpi
 contrib/dev/acpica/components/resources/rscreate.c	optional acpi
 contrib/dev/acpica/components/resources/rsdump.c	optional acpi acpi_debug
 contrib/dev/acpica/components/resources/rsdumpinfo.c	optional acpi
 contrib/dev/acpica/components/resources/rsinfo.c	optional acpi
 contrib/dev/acpica/components/resources/rsio.c		optional acpi
 contrib/dev/acpica/components/resources/rsirq.c		optional acpi
 contrib/dev/acpica/components/resources/rslist.c	optional acpi
 contrib/dev/acpica/components/resources/rsmemory.c	optional acpi
 contrib/dev/acpica/components/resources/rsmisc.c	optional acpi
 contrib/dev/acpica/components/resources/rsserial.c	optional acpi
 contrib/dev/acpica/components/resources/rsutils.c	optional acpi
 contrib/dev/acpica/components/resources/rsxface.c	optional acpi
 contrib/dev/acpica/components/tables/tbdata.c		optional acpi
 contrib/dev/acpica/components/tables/tbfadt.c		optional acpi
 contrib/dev/acpica/components/tables/tbfind.c		optional acpi
 contrib/dev/acpica/components/tables/tbinstal.c		optional acpi
 contrib/dev/acpica/components/tables/tbprint.c		optional acpi
 contrib/dev/acpica/components/tables/tbutils.c		optional acpi
 contrib/dev/acpica/components/tables/tbxface.c		optional acpi
 contrib/dev/acpica/components/tables/tbxfload.c		optional acpi
 contrib/dev/acpica/components/tables/tbxfroot.c		optional acpi
 contrib/dev/acpica/components/utilities/utaddress.c	optional acpi
 contrib/dev/acpica/components/utilities/utalloc.c	optional acpi
 contrib/dev/acpica/components/utilities/utascii.c	optional acpi
 contrib/dev/acpica/components/utilities/utbuffer.c	optional acpi
 contrib/dev/acpica/components/utilities/utcache.c	optional acpi
 contrib/dev/acpica/components/utilities/utcopy.c	optional acpi
 contrib/dev/acpica/components/utilities/utdebug.c	optional acpi
 contrib/dev/acpica/components/utilities/utdecode.c	optional acpi
 contrib/dev/acpica/components/utilities/utdelete.c	optional acpi
 contrib/dev/acpica/components/utilities/uterror.c	optional acpi
 contrib/dev/acpica/components/utilities/uteval.c	optional acpi
 contrib/dev/acpica/components/utilities/utexcep.c	optional acpi
 contrib/dev/acpica/components/utilities/utglobal.c	optional acpi
 contrib/dev/acpica/components/utilities/uthex.c		optional acpi
 contrib/dev/acpica/components/utilities/utids.c		optional acpi
 contrib/dev/acpica/components/utilities/utinit.c	optional acpi
 contrib/dev/acpica/components/utilities/utlock.c	optional acpi
 contrib/dev/acpica/components/utilities/utmath.c	optional acpi
 contrib/dev/acpica/components/utilities/utmisc.c	optional acpi
 contrib/dev/acpica/components/utilities/utmutex.c	optional acpi
 contrib/dev/acpica/components/utilities/utnonansi.c	optional acpi
 contrib/dev/acpica/components/utilities/utobject.c	optional acpi
 contrib/dev/acpica/components/utilities/utosi.c		optional acpi
 contrib/dev/acpica/components/utilities/utownerid.c	optional acpi
 contrib/dev/acpica/components/utilities/utpredef.c	optional acpi
 contrib/dev/acpica/components/utilities/utresdecode.c	optional acpi acpi_debug
 contrib/dev/acpica/components/utilities/utresrc.c	optional acpi
 contrib/dev/acpica/components/utilities/utstate.c	optional acpi
 contrib/dev/acpica/components/utilities/utstring.c	optional acpi
 contrib/dev/acpica/components/utilities/utstrsuppt.c	optional acpi
 contrib/dev/acpica/components/utilities/utstrtoul64.c	optional acpi
 contrib/dev/acpica/components/utilities/utuuid.c	optional acpi acpi_debug
 contrib/dev/acpica/components/utilities/utxface.c	optional acpi
 contrib/dev/acpica/components/utilities/utxferror.c	optional acpi
 contrib/dev/acpica/components/utilities/utxfinit.c	optional acpi
 contrib/dev/acpica/os_specific/service_layers/osgendbg.c	optional acpi acpi_debug
 contrib/ipfilter/netinet/fil.c	optional ipfilter inet \
 	compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_frag.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_log.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_nat.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_proxy.c optional ipfilter inet \
 	compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_state.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_lookup.c optional ipfilter inet \
 	compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -Wno-error -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_pool.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_htable.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter ${NO_WTAUTOLOGICAL_POINTER_COMPARE}"
 contrib/ipfilter/netinet/ip_sync.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_nat6.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_rules.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_scan.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/ip_dstlist.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/radix_ipf.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
 contrib/libfdt/fdt.c		optional fdt
 contrib/libfdt/fdt_ro.c		optional fdt
 contrib/libfdt/fdt_rw.c		optional fdt
 contrib/libfdt/fdt_strerror.c	optional fdt
 contrib/libfdt/fdt_sw.c		optional fdt
 contrib/libfdt/fdt_wip.c	optional fdt
 contrib/libnv/cnvlist.c		standard
 contrib/libnv/dnvlist.c		standard
 contrib/libnv/nvlist.c		standard
 contrib/libnv/nvpair.c		standard
 contrib/ngatm/netnatm/api/cc_conn.c optional ngatm_ccatm \
 	compile-with "${NORMAL_C_NOWERROR} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/api/cc_data.c optional ngatm_ccatm \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/api/cc_dump.c optional ngatm_ccatm \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/api/cc_port.c optional ngatm_ccatm \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/api/cc_sig.c optional ngatm_ccatm \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/api/cc_user.c optional ngatm_ccatm \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/api/unisap.c optional ngatm_ccatm \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/misc/straddr.c optional ngatm_atmbase \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/misc/unimsg_common.c optional ngatm_atmbase \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/msg/traffic.c optional ngatm_atmbase \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/msg/uni_ie.c optional ngatm_atmbase \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/msg/uni_msg.c optional ngatm_atmbase \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/saal/saal_sscfu.c	optional ngatm_sscfu \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/saal/saal_sscop.c	optional ngatm_sscop \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/sig/sig_call.c optional ngatm_uni \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/sig/sig_coord.c optional ngatm_uni \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/sig/sig_party.c optional ngatm_uni \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/sig/sig_print.c optional ngatm_uni \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/sig/sig_reset.c optional ngatm_uni \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/sig/sig_uni.c optional ngatm_uni \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/sig/sig_unimsgcpy.c optional ngatm_uni \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/sig/sig_verify.c optional ngatm_uni \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 # xz
 dev/xz/xz_mod.c	optional xz \
 	compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
 contrib/xz-embedded/linux/lib/xz/xz_crc32.c	optional xz \
 	compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
 contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c	optional xz \
 	compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
 contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c	optional xz \
 	compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
 contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c optional xz \
 	compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
 # Zstd
 contrib/zstd/lib/freebsd/zstd_kmalloc.c		optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/common/zstd_common.c		optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/common/fse_decompress.c	optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/common/entropy_common.c	optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/common/error_private.c		optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/common/xxhash.c		optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/compress/zstd_compress.c	optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/compress/fse_compress.c	optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/compress/huf_compress.c	optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/compress/zstd_double_fast.c	optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/compress/zstd_fast.c		optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/compress/zstd_lazy.c		optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/compress/zstd_ldm.c		optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/compress/zstd_opt.c		optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/decompress/zstd_decompress.c	optional zstdio compile-with ${ZSTD_C}
 contrib/zstd/lib/decompress/huf_decompress.c	optional zstdio compile-with ${ZSTD_C}
 # Blake 2
 contrib/libb2/blake2b-ref.c	optional crypto | ipsec | ipsec_support \
 	compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function"
 contrib/libb2/blake2s-ref.c	optional crypto | ipsec | ipsec_support \
 	compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function"
 crypto/blake2/blake2-sw.c	optional crypto | ipsec | ipsec_support \
 	compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual"
 crypto/blowfish/bf_ecb.c	optional ipsec | ipsec_support
 crypto/blowfish/bf_skey.c	optional crypto | ipsec | ipsec_support
 crypto/camellia/camellia.c	optional crypto | ipsec | ipsec_support
 crypto/camellia/camellia-api.c	optional crypto | ipsec | ipsec_support
 crypto/chacha20/chacha.c	optional crypto | ipsec | ipsec_support
 crypto/chacha20/chacha-sw.c	optional crypto | ipsec | ipsec_support
 crypto/des/des_ecb.c		optional crypto | ipsec | ipsec_support | netsmb
 crypto/des/des_setkey.c		optional crypto | ipsec | ipsec_support | netsmb
 crypto/rc4/rc4.c		optional netgraph_mppc_encryption | kgssapi
 crypto/rijndael/rijndael-alg-fst.c optional crypto | ekcd | geom_bde | \
 	ipsec | ipsec_support | random !random_loadable | wlan_ccmp
 crypto/rijndael/rijndael-api-fst.c optional ekcd | geom_bde | random !random_loadable
 crypto/rijndael/rijndael-api.c	optional crypto | ipsec | ipsec_support | \
 	wlan_ccmp
 crypto/sha1.c			optional carp | crypto | ether | ipsec | \
 	ipsec_support | netgraph_mppc_encryption | sctp
 crypto/sha2/sha256c.c		optional crypto | ekcd | geom_bde | ipsec | \
 	ipsec_support | random !random_loadable | sctp | zfs
 crypto/sha2/sha512c.c		optional crypto | geom_bde | ipsec | \
 	ipsec_support | zfs
 crypto/skein/skein.c		optional crypto | zfs
 crypto/skein/skein_block.c	optional crypto | zfs
 crypto/siphash/siphash.c	optional inet | inet6
 crypto/siphash/siphash_test.c	optional inet | inet6
 ddb/db_access.c			optional ddb
 ddb/db_break.c			optional ddb
 ddb/db_capture.c		optional ddb
 ddb/db_command.c		optional ddb
 ddb/db_examine.c		optional ddb
 ddb/db_expr.c			optional ddb
 ddb/db_input.c			optional ddb
 ddb/db_lex.c			optional ddb
 ddb/db_main.c			optional ddb
 ddb/db_output.c			optional ddb
 ddb/db_print.c			optional ddb
 ddb/db_ps.c			optional ddb
 ddb/db_run.c			optional ddb
 ddb/db_script.c			optional ddb
 ddb/db_sym.c			optional ddb
 ddb/db_thread.c			optional ddb
 ddb/db_textdump.c		optional ddb
 ddb/db_variables.c		optional ddb
 ddb/db_watch.c			optional ddb
 ddb/db_write_cmd.c		optional ddb
 dev/aac/aac.c			optional aac
 dev/aac/aac_cam.c		optional aacp aac
 dev/aac/aac_debug.c		optional aac
 dev/aac/aac_disk.c		optional aac
 dev/aac/aac_linux.c		optional aac compat_linux
 dev/aac/aac_pci.c		optional aac pci
 dev/aacraid/aacraid.c		optional aacraid
 dev/aacraid/aacraid_cam.c	optional aacraid scbus
 dev/aacraid/aacraid_debug.c	optional aacraid
 dev/aacraid/aacraid_linux.c	optional aacraid compat_linux
 dev/aacraid/aacraid_pci.c	optional aacraid pci
 dev/acpi_support/acpi_wmi.c	optional acpi_wmi acpi
 dev/acpi_support/acpi_asus.c	optional acpi_asus acpi
 dev/acpi_support/acpi_asus_wmi.c	optional acpi_asus_wmi acpi
 dev/acpi_support/acpi_fujitsu.c	optional acpi_fujitsu acpi
 dev/acpi_support/acpi_hp.c	optional acpi_hp acpi
 dev/acpi_support/acpi_ibm.c	optional acpi_ibm acpi
 dev/acpi_support/acpi_panasonic.c optional acpi_panasonic acpi
 dev/acpi_support/acpi_sony.c	optional acpi_sony acpi
 dev/acpi_support/acpi_toshiba.c	optional acpi_toshiba acpi
 dev/acpi_support/atk0110.c	optional aibs acpi
 dev/acpica/Osd/OsdDebug.c	optional acpi
 dev/acpica/Osd/OsdHardware.c	optional acpi
 dev/acpica/Osd/OsdInterrupt.c	optional acpi
 dev/acpica/Osd/OsdMemory.c	optional acpi
 dev/acpica/Osd/OsdSchedule.c	optional acpi
 dev/acpica/Osd/OsdStream.c	optional acpi
 dev/acpica/Osd/OsdSynch.c	optional acpi
 dev/acpica/Osd/OsdTable.c	optional acpi
 dev/acpica/acpi.c		optional acpi
 dev/acpica/acpi_acad.c		optional acpi
 dev/acpica/acpi_battery.c	optional acpi
 dev/acpica/acpi_button.c	optional acpi
 dev/acpica/acpi_cmbat.c		optional acpi
 dev/acpica/acpi_cpu.c		optional acpi
 dev/acpica/acpi_ec.c		optional acpi
 dev/acpica/acpi_isab.c		optional acpi isa
 dev/acpica/acpi_lid.c		optional acpi
 dev/acpica/acpi_package.c	optional acpi
 dev/acpica/acpi_perf.c		optional acpi
 dev/acpica/acpi_powerres.c	optional acpi
 dev/acpica/acpi_quirk.c		optional acpi
 dev/acpica/acpi_resource.c	optional acpi
 dev/acpica/acpi_container.c	optional acpi
 dev/acpica/acpi_smbat.c		optional acpi
 dev/acpica/acpi_thermal.c	optional acpi
 dev/acpica/acpi_throttle.c	optional acpi
 dev/acpica/acpi_video.c		optional acpi_video acpi
 dev/acpica/acpi_dock.c		optional acpi_dock acpi
 dev/adlink/adlink.c		optional adlink
 dev/advansys/adv_pci.c		optional adv pci
 dev/advansys/advansys.c		optional adv
 dev/advansys/advlib.c		optional adv
 dev/advansys/advmcode.c		optional adv
 dev/advansys/adw_pci.c		optional adw pci
 dev/advansys/adwcam.c		optional adw
 dev/advansys/adwlib.c		optional adw
 dev/advansys/adwmcode.c		optional adw
 dev/ae/if_ae.c			optional ae pci
 dev/age/if_age.c		optional age pci
 dev/agp/agp.c			optional agp pci
 dev/agp/agp_if.m		optional agp pci
 dev/aha/aha.c			optional aha
 dev/aha/aha_isa.c		optional aha isa
 dev/ahci/ahci.c			optional ahci
 dev/ahci/ahciem.c		optional ahci
 dev/ahci/ahci_pci.c		optional ahci pci
 dev/aic/aic.c			optional aic
 dev/aic/aic_pccard.c		optional aic pccard
 dev/aic7xxx/ahc_isa.c		optional ahc isa
 dev/aic7xxx/ahc_pci.c		optional ahc pci \
 	compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}"
 dev/aic7xxx/ahd_pci.c		optional ahd pci \
 	compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}"
 dev/aic7xxx/aic7770.c		optional ahc
 dev/aic7xxx/aic79xx.c		optional ahd pci
 dev/aic7xxx/aic79xx_osm.c	optional ahd pci
 dev/aic7xxx/aic79xx_pci.c	optional ahd pci
 dev/aic7xxx/aic79xx_reg_print.c	optional ahd pci ahd_reg_pretty_print
 dev/aic7xxx/aic7xxx.c		optional ahc
 dev/aic7xxx/aic7xxx_93cx6.c	optional ahc
 dev/aic7xxx/aic7xxx_osm.c	optional ahc
 dev/aic7xxx/aic7xxx_pci.c	optional ahc pci
 dev/aic7xxx/aic7xxx_reg_print.c	optional ahc ahc_reg_pretty_print
 dev/al_eth/al_eth.c				optional al_eth	fdt	\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 dev/al_eth/al_init_eth_lm.c			optional al_eth	fdt	\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 dev/al_eth/al_init_eth_kr.c			optional al_eth	fdt	\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 contrib/alpine-hal/al_hal_iofic.c		optional al_iofic	\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 contrib/alpine-hal/al_hal_serdes_25g.c		optional al_serdes	\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 contrib/alpine-hal/al_hal_serdes_hssp.c		optional al_serdes	\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 contrib/alpine-hal/al_hal_udma_config.c		optional al_udma	\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 contrib/alpine-hal/al_hal_udma_debug.c		optional al_udma	\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 contrib/alpine-hal/al_hal_udma_iofic.c		optional al_udma	\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 contrib/alpine-hal/al_hal_udma_main.c		optional al_udma	\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 contrib/alpine-hal/al_serdes.c			optional al_serdes	\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 contrib/alpine-hal/eth/al_hal_eth_kr.c		optional al_eth		\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 contrib/alpine-hal/eth/al_hal_eth_main.c	optional al_eth		\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 dev/alc/if_alc.c		optional alc pci
 dev/ale/if_ale.c		optional ale pci
 dev/alpm/alpm.c			optional alpm pci
 dev/altera/avgen/altera_avgen.c		optional altera_avgen
 dev/altera/avgen/altera_avgen_fdt.c	optional altera_avgen fdt
 dev/altera/avgen/altera_avgen_nexus.c	optional altera_avgen
 dev/altera/msgdma/msgdma.c		optional altera_msgdma xdma
 dev/altera/sdcard/altera_sdcard.c	optional altera_sdcard
 dev/altera/sdcard/altera_sdcard_disk.c	optional altera_sdcard
 dev/altera/sdcard/altera_sdcard_io.c	optional altera_sdcard
 dev/altera/sdcard/altera_sdcard_fdt.c	optional altera_sdcard fdt
 dev/altera/sdcard/altera_sdcard_nexus.c	optional altera_sdcard
 dev/altera/softdma/softdma.c	optional altera_softdma xdma fdt
 dev/altera/pio/pio.c		optional altera_pio
 dev/altera/pio/pio_if.m		optional altera_pio
 dev/amdpm/amdpm.c		optional amdpm pci | nfpm pci
 dev/amdsmb/amdsmb.c		optional amdsmb pci
 dev/amr/amr.c			optional amr
 dev/amr/amr_cam.c		optional amrp amr
 dev/amr/amr_disk.c		optional amr
 dev/amr/amr_linux.c		optional amr compat_linux
 dev/amr/amr_pci.c		optional amr pci
 dev/an/if_an.c			optional an
 dev/an/if_an_isa.c		optional an isa
 dev/an/if_an_pccard.c		optional an pccard
 dev/an/if_an_pci.c		optional an pci
 #
 dev/ata/ata_if.m		optional ata | atacore
 dev/ata/ata-all.c		optional ata | atacore
 dev/ata/ata-dma.c		optional ata | atacore
 dev/ata/ata-lowlevel.c		optional ata | atacore
 dev/ata/ata-sata.c		optional ata | atacore
 dev/ata/ata-card.c		optional ata pccard | atapccard
 dev/ata/ata-isa.c		optional ata isa | ataisa
 dev/ata/ata-pci.c		optional ata pci | atapci
 dev/ata/chipsets/ata-acard.c	optional ata pci | ataacard
 dev/ata/chipsets/ata-acerlabs.c	optional ata pci | ataacerlabs
 dev/ata/chipsets/ata-amd.c	optional ata pci | ataamd
 dev/ata/chipsets/ata-ati.c	optional ata pci | ataati
 dev/ata/chipsets/ata-cenatek.c	optional ata pci | atacenatek
 dev/ata/chipsets/ata-cypress.c	optional ata pci | atacypress
 dev/ata/chipsets/ata-cyrix.c	optional ata pci | atacyrix
 dev/ata/chipsets/ata-highpoint.c	optional ata pci | atahighpoint
 dev/ata/chipsets/ata-intel.c	optional ata pci | ataintel
 dev/ata/chipsets/ata-ite.c	optional ata pci | ataite
 dev/ata/chipsets/ata-jmicron.c	optional ata pci | atajmicron
 dev/ata/chipsets/ata-marvell.c	optional ata pci | atamarvell
 dev/ata/chipsets/ata-micron.c	optional ata pci | atamicron
 dev/ata/chipsets/ata-national.c	optional ata pci | atanational
 dev/ata/chipsets/ata-netcell.c	optional ata pci | atanetcell
 dev/ata/chipsets/ata-nvidia.c	optional ata pci | atanvidia
 dev/ata/chipsets/ata-promise.c	optional ata pci | atapromise
 dev/ata/chipsets/ata-serverworks.c	optional ata pci | ataserverworks
 dev/ata/chipsets/ata-siliconimage.c	optional ata pci | atasiliconimage | ataati
 dev/ata/chipsets/ata-sis.c	optional ata pci | atasis
 dev/ata/chipsets/ata-via.c	optional ata pci | atavia
 #
 dev/ath/if_ath_pci.c		optional ath_pci pci \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 #
 dev/ath/if_ath_ahb.c		optional ath_ahb \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 #
 dev/ath/if_ath.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_alq.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_beacon.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_btcoex.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_btcoex_mci.c	optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_debug.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_descdma.c	optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_keycache.c	optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_ioctl.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_led.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_lna_div.c	optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_tx.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_tx_edma.c	optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_tx_ht.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_tdma.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_sysctl.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_rx.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_rx_edma.c	optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_spectral.c	optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ah_osdep.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 #
 dev/ath/ath_hal/ah.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ath_hal/ah_eeprom_v1.c	optional ath_hal | ath_ar5210 \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ath_hal/ah_eeprom_v3.c	optional ath_hal | ath_ar5211 | ath_ar5212 \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ath_hal/ah_eeprom_v14.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ath_hal/ah_eeprom_v4k.c \
 	optional ath_hal | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ath_hal/ah_eeprom_9287.c \
 	optional ath_hal | ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ath_hal/ah_regdomain.c	optional ath \
 	compile-with "${NORMAL_C} ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} -I$S/dev/ath"
 # ar5210
 dev/ath/ath_hal/ar5210/ar5210_attach.c		optional ath_hal | ath_ar5210 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5210/ar5210_beacon.c		optional ath_hal | ath_ar5210 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5210/ar5210_interrupts.c	optional ath_hal | ath_ar5210 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5210/ar5210_keycache.c	optional ath_hal | ath_ar5210 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5210/ar5210_misc.c		optional ath_hal | ath_ar5210 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5210/ar5210_phy.c		optional ath_hal | ath_ar5210 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5210/ar5210_power.c		optional ath_hal | ath_ar5210 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5210/ar5210_recv.c		optional ath_hal | ath_ar5210 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5210/ar5210_reset.c		optional ath_hal | ath_ar5210 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5210/ar5210_xmit.c		optional ath_hal | ath_ar5210 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ar5211
 dev/ath/ath_hal/ar5211/ar5211_attach.c		optional ath_hal | ath_ar5211 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5211/ar5211_beacon.c		optional ath_hal | ath_ar5211 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5211/ar5211_interrupts.c	optional ath_hal | ath_ar5211 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5211/ar5211_keycache.c	optional ath_hal | ath_ar5211 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5211/ar5211_misc.c		optional ath_hal | ath_ar5211 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5211/ar5211_phy.c		optional ath_hal | ath_ar5211 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5211/ar5211_power.c		optional ath_hal | ath_ar5211 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5211/ar5211_recv.c		optional ath_hal | ath_ar5211 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5211/ar5211_reset.c		optional ath_hal | ath_ar5211 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5211/ar5211_xmit.c		optional ath_hal | ath_ar5211 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ar5212
 dev/ath/ath_hal/ar5212/ar5212_ani.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_attach.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_beacon.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_eeprom.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_gpio.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_interrupts.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_keycache.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_misc.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_phy.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_power.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_recv.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_reset.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_rfgain.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_xmit.c \
 	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
 	ath_ar9285 ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ar5416 (depends on ar5212)
 dev/ath/ath_hal/ar5416/ar5416_ani.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_attach.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_beacon.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_btcoex.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_cal.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_cal_iq.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_cal_adcgain.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_cal_adcdc.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_eeprom.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_gpio.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_interrupts.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_keycache.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_misc.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_phy.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_power.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_radar.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_recv.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_reset.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_spectral.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_xmit.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
 	ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ar9130 (depends upon ar5416) - also requires AH_SUPPORT_AR9130
 #
 # Since this is an embedded MAC SoC, there's no need to compile it into the
 # default HAL.
 dev/ath/ath_hal/ar9001/ar9130_attach.c optional ath_ar9130 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9001/ar9130_phy.c optional ath_ar9130 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9001/ar9130_eeprom.c optional ath_ar9130 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ar9160 (depends on ar5416)
 dev/ath/ath_hal/ar9001/ar9160_attach.c optional ath_hal | ath_ar9160 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ar9280 (depends on ar5416)
 dev/ath/ath_hal/ar9002/ar9280_attach.c optional ath_hal | ath_ar9280 | \
 	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9280_olc.c optional ath_hal | ath_ar9280 | \
 	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ar9285 (depends on ar5416 and ar9280)
 dev/ath/ath_hal/ar9002/ar9285_attach.c optional ath_hal | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9285_btcoex.c optional ath_hal | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9285_reset.c optional ath_hal | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9285_cal.c optional ath_hal | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9285_phy.c optional ath_hal | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9285_diversity.c optional ath_hal | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ar9287 (depends on ar5416)
 dev/ath/ath_hal/ar9002/ar9287_attach.c optional ath_hal | ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9287_reset.c optional ath_hal | ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9287_cal.c optional ath_hal | ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9287_olc.c optional ath_hal | ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 
 # ar9300
 contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal ${NO_WCONSTANT_CONVERSION}"
 contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_keycache.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_paprd.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_power.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal ${NO_WSOMETIMES_UNINITIALIZED} -Wno-unused-function"
 contrib/dev/ath/ath_hal/ar9300/ar9300_stub.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_timer.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_xmit_ds.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 
 # rf backends
 dev/ath/ath_hal/ar5212/ar2316.c	optional ath_rf2316 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar2317.c	optional ath_rf2317 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar2413.c	optional ath_hal | ath_rf2413 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar2425.c	optional ath_hal | ath_rf2425 | ath_rf2417 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5111.c	optional ath_hal | ath_rf5111 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5112.c	optional ath_hal | ath_rf5112 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5413.c	optional ath_hal | ath_rf5413 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar2133.c optional ath_hal | ath_ar5416 | \
 	ath_ar9130 | ath_ar9160 | ath_ar9280 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9280.c optional ath_hal | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9285.c optional ath_hal | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9287.c optional ath_hal | ath_ar9287 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 
 # ath rate control algorithms
 dev/ath/ath_rate/amrr/amrr.c	optional ath_rate_amrr \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ath_rate/onoe/onoe.c	optional ath_rate_onoe \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ath_rate/sample/sample.c	optional ath_rate_sample \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 # ath DFS modules
 dev/ath/ath_dfs/null/dfs_null.c	optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 #
 dev/bce/if_bce.c			optional bce
 dev/bfe/if_bfe.c			optional bfe
 dev/bge/if_bge.c			optional bge
 dev/bhnd/bhnd.c				optional bhnd
 dev/bhnd/bhnd_erom.c			optional bhnd
 dev/bhnd/bhnd_erom_if.m			optional bhnd
 dev/bhnd/bhnd_subr.c			optional bhnd
 dev/bhnd/bhnd_bus_if.m			optional bhnd
 dev/bhnd/bhndb/bhnd_bhndb.c		optional bhndb bhnd
 dev/bhnd/bhndb/bhndb.c			optional bhndb bhnd
 dev/bhnd/bhndb/bhndb_bus_if.m		optional bhndb bhnd
 dev/bhnd/bhndb/bhndb_hwdata.c		optional bhndb bhnd
 dev/bhnd/bhndb/bhndb_if.m		optional bhndb bhnd
 dev/bhnd/bhndb/bhndb_pci.c		optional bhndb_pci bhndb bhnd pci
 dev/bhnd/bhndb/bhndb_pci_hwdata.c 	optional bhndb_pci bhndb bhnd pci
 dev/bhnd/bhndb/bhndb_pci_sprom.c	optional bhndb_pci bhndb bhnd pci
 dev/bhnd/bhndb/bhndb_subr.c		optional bhndb bhnd
 dev/bhnd/bcma/bcma.c			optional bcma bhnd
 dev/bhnd/bcma/bcma_bhndb.c		optional bcma bhnd bhndb
 dev/bhnd/bcma/bcma_erom.c		optional bcma bhnd
 dev/bhnd/bcma/bcma_subr.c		optional bcma bhnd
 dev/bhnd/cores/chipc/bhnd_chipc_if.m	optional bhnd
 dev/bhnd/cores/chipc/bhnd_sprom_chipc.c	optional bhnd
 dev/bhnd/cores/chipc/bhnd_pmu_chipc.c	optional bhnd
 dev/bhnd/cores/chipc/chipc.c		optional bhnd
 dev/bhnd/cores/chipc/chipc_cfi.c	optional bhnd cfi 
 dev/bhnd/cores/chipc/chipc_gpio.c	optional bhnd gpio
 dev/bhnd/cores/chipc/chipc_slicer.c	optional bhnd cfi | bhnd spibus
 dev/bhnd/cores/chipc/chipc_spi.c	optional bhnd spibus
 dev/bhnd/cores/chipc/chipc_subr.c	optional bhnd
 dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.c	optional bhnd
 dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_if.m	optional bhnd
 dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_hostb_if.m	optional bhnd
 dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c	optional bhnd
 dev/bhnd/cores/pci/bhnd_pci.c		optional bhnd pci
 dev/bhnd/cores/pci/bhnd_pci_hostb.c	optional bhndb bhnd pci
 dev/bhnd/cores/pci/bhnd_pcib.c		optional bhnd_pcib bhnd pci
 dev/bhnd/cores/pcie2/bhnd_pcie2.c	optional bhnd pci
 dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c	optional bhndb bhnd pci
 dev/bhnd/cores/pcie2/bhnd_pcie2b.c	optional bhnd_pcie2b bhnd pci
 dev/bhnd/cores/pmu/bhnd_pmu.c		optional bhnd
 dev/bhnd/cores/pmu/bhnd_pmu_core.c	optional bhnd
 dev/bhnd/cores/pmu/bhnd_pmu_if.m	optional bhnd
 dev/bhnd/cores/pmu/bhnd_pmu_subr.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_data.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_data_bcm.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_data_bcmraw.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_data_btxt.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_data_sprom.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_data_sprom_subr.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_data_tlv.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_if.m		optional bhnd
 dev/bhnd/nvram/bhnd_nvram_io.c		optional bhnd
 dev/bhnd/nvram/bhnd_nvram_iobuf.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_ioptr.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_iores.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_plist.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_store.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_store_subr.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_subr.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_value.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_value_fmts.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_value_prf.c	optional bhnd
 dev/bhnd/nvram/bhnd_nvram_value_subr.c	optional bhnd
 dev/bhnd/nvram/bhnd_sprom.c		optional bhnd
 dev/bhnd/siba/siba.c			optional siba bhnd
 dev/bhnd/siba/siba_bhndb.c		optional siba bhnd bhndb
 dev/bhnd/siba/siba_erom.c		optional siba bhnd
 dev/bhnd/siba/siba_subr.c		optional siba bhnd
 #
 dev/bktr/bktr_audio.c		optional bktr pci
 dev/bktr/bktr_card.c		optional bktr pci
 dev/bktr/bktr_core.c		optional bktr pci
 dev/bktr/bktr_i2c.c		optional bktr pci smbus
 dev/bktr/bktr_os.c		optional bktr pci
 dev/bktr/bktr_tuner.c		optional bktr pci
 dev/bktr/msp34xx.c		optional bktr pci
 dev/bnxt/bnxt_hwrm.c		optional bnxt iflib pci
 dev/bnxt/bnxt_sysctl.c		optional bnxt iflib pci
 dev/bnxt/bnxt_txrx.c		optional bnxt iflib pci
 dev/bnxt/if_bnxt.c		optional bnxt iflib pci
 dev/buslogic/bt.c		optional bt
 dev/buslogic/bt_isa.c		optional bt isa
 dev/buslogic/bt_pci.c		optional bt pci
 dev/bwi/bwimac.c		optional bwi
 dev/bwi/bwiphy.c		optional bwi
 dev/bwi/bwirf.c			optional bwi
 dev/bwi/if_bwi.c		optional bwi
 dev/bwi/if_bwi_pci.c		optional bwi pci
 dev/bwn/if_bwn.c		optional bwn bhnd
 dev/bwn/if_bwn_pci.c		optional bwn pci bhnd bhndb bhndb_pci
 dev/bwn/if_bwn_phy_common.c	optional bwn bhnd
 dev/bwn/if_bwn_phy_g.c		optional bwn bhnd
 dev/bwn/if_bwn_phy_lp.c		optional bwn bhnd
 dev/bwn/if_bwn_phy_n.c		optional bwn bhnd
 dev/bwn/if_bwn_util.c		optional bwn bhnd
 dev/cardbus/cardbus.c		optional cardbus
 dev/cardbus/cardbus_cis.c	optional cardbus
 dev/cardbus/cardbus_device.c	optional cardbus
 dev/cas/if_cas.c		optional cas
 dev/cfi/cfi_bus_fdt.c		optional cfi fdt
 dev/cfi/cfi_bus_nexus.c		optional cfi
 dev/cfi/cfi_core.c		optional cfi
 dev/cfi/cfi_dev.c		optional cfi
 dev/cfi/cfi_disk.c		optional cfid
 dev/chromebook_platform/chromebook_platform.c	optional chromebook_platform
 dev/ciss/ciss.c			optional ciss
 dev/cmx/cmx.c			optional cmx
 dev/cmx/cmx_pccard.c		optional cmx pccard
 dev/cpufreq/ichss.c		optional cpufreq pci
 dev/cs/if_cs.c			optional cs
 dev/cs/if_cs_isa.c		optional cs isa
 dev/cs/if_cs_pccard.c		optional cs pccard
 dev/cxgb/cxgb_main.c		optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/cxgb_sge.c		optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/common/cxgb_mc5.c	optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/common/cxgb_vsc7323.c	optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/common/cxgb_vsc8211.c	optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/common/cxgb_ael1002.c	optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/common/cxgb_aq100x.c	optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/common/cxgb_mv88e1xxx.c	optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/common/cxgb_xgmac.c	optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/common/cxgb_t3_hw.c	optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/common/cxgb_tn1010.c	optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/sys/uipc_mvec.c	optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/cxgb_t3fw.c		optional cxgb cxgb_t3fw \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgbe/t4_clip.c		optional cxgbe pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/t4_filter.c		optional cxgbe pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/t4_if.m		optional cxgbe pci
 dev/cxgbe/t4_iov.c		optional cxgbe pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/t4_mp_ring.c		optional cxgbe pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/t4_main.c		optional cxgbe pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/t4_netmap.c		optional cxgbe pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/t4_sched.c		optional cxgbe pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/t4_sge.c		optional cxgbe pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/t4_smt.c		optional cxgbe pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/t4_l2t.c		optional cxgbe pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/t4_tracer.c		optional cxgbe pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/t4_vf.c		optional cxgbev pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/common/t4_hw.c	optional cxgbe pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/common/t4vf_hw.c	optional cxgbev pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/cudbg/cudbg_common.c	optional cxgbe \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/cudbg/cudbg_flash_utils.c	optional cxgbe \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/cudbg/cudbg_lib.c	optional cxgbe \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/cudbg/cudbg_wtp.c	optional cxgbe \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/cudbg/fastlz.c	optional cxgbe \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cxgbe/cudbg/fastlz_api.c	optional cxgbe \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 t4fw_cfg.c		optional cxgbe					\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk t4fw_cfg.fw:t4fw_cfg t4fw_cfg_uwire.fw:t4fw_cfg_uwire t4fw.fw:t4fw -mt4fw_cfg -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"t4fw_cfg.c"
 t4fw_cfg.fwo		optional cxgbe					\
 	dependency	"t4fw_cfg.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"t4fw_cfg.fwo"
 t4fw_cfg.fw		optional cxgbe					\
 	dependency	"$S/dev/cxgbe/firmware/t4fw_cfg.txt"		\
 	compile-with	"${CP} ${.ALLSRC} ${.TARGET}"			\
 	no-obj no-implicit-rule						\
 	clean		"t4fw_cfg.fw"
 t4fw_cfg_uwire.fwo	optional cxgbe					\
 	dependency	"t4fw_cfg_uwire.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"t4fw_cfg_uwire.fwo"
 t4fw_cfg_uwire.fw	optional cxgbe					\
 	dependency	"$S/dev/cxgbe/firmware/t4fw_cfg_uwire.txt"	\
 	compile-with	"${CP} ${.ALLSRC} ${.TARGET}"			\
 	no-obj no-implicit-rule						\
 	clean		"t4fw_cfg_uwire.fw"
 t4fw.fwo		optional cxgbe					\
 	dependency	"t4fw.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"t4fw.fwo"
 t4fw.fw			optional cxgbe					\
 	dependency	"$S/dev/cxgbe/firmware/t4fw-1.23.0.0.bin.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"t4fw.fw"
 t5fw_cfg.c		optional cxgbe					\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk t5fw_cfg.fw:t5fw_cfg t5fw_cfg_uwire.fw:t5fw_cfg_uwire t5fw.fw:t5fw -mt5fw_cfg -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"t5fw_cfg.c"
 t5fw_cfg.fwo		optional cxgbe					\
 	dependency	"t5fw_cfg.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"t5fw_cfg.fwo"
 t5fw_cfg.fw		optional cxgbe					\
 	dependency	"$S/dev/cxgbe/firmware/t5fw_cfg.txt"		\
 	compile-with	"${CP} ${.ALLSRC} ${.TARGET}"			\
 	no-obj no-implicit-rule						\
 	clean		"t5fw_cfg.fw"
 t5fw_cfg_uwire.fwo	optional cxgbe					\
 	dependency	"t5fw_cfg_uwire.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"t5fw_cfg_uwire.fwo"
 t5fw_cfg_uwire.fw	optional cxgbe					\
 	dependency	"$S/dev/cxgbe/firmware/t5fw_cfg_uwire.txt"	\
 	compile-with	"${CP} ${.ALLSRC} ${.TARGET}"			\
 	no-obj no-implicit-rule						\
 	clean		"t5fw_cfg_uwire.fw"
 t5fw.fwo		optional cxgbe					\
 	dependency	"t5fw.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"t5fw.fwo"
 t5fw.fw			optional cxgbe					\
 	dependency	"$S/dev/cxgbe/firmware/t5fw-1.23.0.0.bin.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"t5fw.fw"
 t6fw_cfg.c		optional cxgbe					\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk t6fw_cfg.fw:t6fw_cfg t6fw_cfg_uwire.fw:t6fw_cfg_uwire t6fw.fw:t6fw -mt6fw_cfg -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"t6fw_cfg.c"
 t6fw_cfg.fwo		optional cxgbe					\
 	dependency	"t6fw_cfg.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"t6fw_cfg.fwo"
 t6fw_cfg.fw		optional cxgbe					\
 	dependency	"$S/dev/cxgbe/firmware/t6fw_cfg.txt"		\
 	compile-with	"${CP} ${.ALLSRC} ${.TARGET}"			\
 	no-obj no-implicit-rule						\
 	clean		"t6fw_cfg.fw"
 t6fw_cfg_uwire.fwo	optional cxgbe					\
 	dependency	"t6fw_cfg_uwire.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"t6fw_cfg_uwire.fwo"
 t6fw_cfg_uwire.fw	optional cxgbe					\
 	dependency	"$S/dev/cxgbe/firmware/t6fw_cfg_uwire.txt"	\
 	compile-with	"${CP} ${.ALLSRC} ${.TARGET}"			\
 	no-obj no-implicit-rule						\
 	clean		"t6fw_cfg_uwire.fw"
 t6fw.fwo		optional cxgbe					\
 	dependency	"t6fw.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"t6fw.fwo"
 t6fw.fw			optional cxgbe					\
 	dependency	"$S/dev/cxgbe/firmware/t6fw-1.23.0.0.bin.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"t6fw.fw"
 dev/cxgbe/crypto/t4_crypto.c	optional ccr \
 	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
 dev/cy/cy.c			optional cy
 dev/cy/cy_isa.c			optional cy isa
 dev/cy/cy_pci.c			optional cy pci
 dev/cyapa/cyapa.c		optional cyapa iicbus
 dev/dc/if_dc.c			optional dc pci
 dev/dc/dcphy.c			optional dc pci
 dev/dc/pnphy.c			optional dc pci
 dev/dcons/dcons.c		optional dcons
 dev/dcons/dcons_crom.c		optional dcons_crom
 dev/dcons/dcons_os.c		optional dcons
 dev/de/if_de.c			optional de pci
 dev/dme/if_dme.c		optional dme
 dev/dpt/dpt_pci.c		optional dpt pci
 dev/dpt/dpt_scsi.c		optional dpt
 dev/drm/ati_pcigart.c		optional drm
 dev/drm/drm_agpsupport.c	optional drm
 dev/drm/drm_auth.c		optional drm
 dev/drm/drm_bufs.c		optional drm
 dev/drm/drm_context.c		optional drm
 dev/drm/drm_dma.c		optional drm
 dev/drm/drm_drawable.c		optional drm
 dev/drm/drm_drv.c		optional drm
 dev/drm/drm_fops.c		optional drm
 dev/drm/drm_hashtab.c		optional drm
 dev/drm/drm_ioctl.c		optional drm
 dev/drm/drm_irq.c		optional drm
 dev/drm/drm_lock.c		optional drm
 dev/drm/drm_memory.c		optional drm
 dev/drm/drm_mm.c		optional drm
 dev/drm/drm_pci.c		optional drm
 dev/drm/drm_scatter.c		optional drm
 dev/drm/drm_sman.c		optional drm
 dev/drm/drm_sysctl.c		optional drm
 dev/drm/drm_vm.c		optional drm
 dev/drm/mach64_dma.c		optional mach64drm
 dev/drm/mach64_drv.c		optional mach64drm
 dev/drm/mach64_irq.c		optional mach64drm
 dev/drm/mach64_state.c		optional mach64drm
 dev/drm/mga_dma.c		optional mgadrm
 dev/drm/mga_drv.c		optional mgadrm
 dev/drm/mga_irq.c		optional mgadrm
 dev/drm/mga_state.c		optional mgadrm
 dev/drm/mga_warp.c		optional mgadrm
 dev/drm/r128_cce.c		optional r128drm \
 	compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}"
 dev/drm/r128_drv.c		optional r128drm
 dev/drm/r128_irq.c		optional r128drm
 dev/drm/r128_state.c		optional r128drm
 dev/drm/savage_bci.c		optional savagedrm
 dev/drm/savage_drv.c		optional savagedrm
 dev/drm/savage_state.c		optional savagedrm
 dev/drm/sis_drv.c		optional sisdrm
 dev/drm/sis_ds.c		optional sisdrm
 dev/drm/sis_mm.c		optional sisdrm
 dev/drm/tdfx_drv.c		optional tdfxdrm
 dev/drm/via_dma.c		optional viadrm
 dev/drm/via_dmablit.c		optional viadrm
 dev/drm/via_drv.c		optional viadrm
 dev/drm/via_irq.c		optional viadrm
 dev/drm/via_map.c		optional viadrm
 dev/drm/via_mm.c		optional viadrm
 dev/drm/via_verifier.c		optional viadrm
 dev/drm/via_video.c		optional viadrm
 dev/drm2/drm_agpsupport.c	optional drm2
 dev/drm2/drm_auth.c		optional drm2
 dev/drm2/drm_bufs.c		optional drm2
 dev/drm2/drm_buffer.c		optional drm2
 dev/drm2/drm_context.c		optional drm2
 dev/drm2/drm_crtc.c		optional drm2
 dev/drm2/drm_crtc_helper.c	optional drm2
 dev/drm2/drm_dma.c		optional drm2
 dev/drm2/drm_dp_helper.c	optional drm2
 dev/drm2/drm_dp_iic_helper.c	optional drm2
 dev/drm2/drm_drv.c		optional drm2
 dev/drm2/drm_edid.c		optional drm2
 dev/drm2/drm_fb_helper.c	optional drm2
 dev/drm2/drm_fops.c		optional drm2
 dev/drm2/drm_gem.c		optional drm2
 dev/drm2/drm_gem_names.c	optional drm2
 dev/drm2/drm_global.c		optional drm2
 dev/drm2/drm_hashtab.c		optional drm2
 dev/drm2/drm_ioctl.c		optional drm2
 dev/drm2/drm_irq.c		optional drm2
 dev/drm2/drm_linux_list_sort.c	optional drm2
 dev/drm2/drm_lock.c		optional drm2
 dev/drm2/drm_memory.c		optional drm2
 dev/drm2/drm_mm.c		optional drm2
 dev/drm2/drm_modes.c		optional drm2
 dev/drm2/drm_pci.c		optional drm2
 dev/drm2/drm_platform.c		optional drm2
 dev/drm2/drm_scatter.c		optional drm2
 dev/drm2/drm_stub.c		optional drm2
 dev/drm2/drm_sysctl.c		optional drm2
 dev/drm2/drm_vm.c		optional drm2
 dev/drm2/drm_os_freebsd.c	optional drm2
 dev/drm2/ttm/ttm_agp_backend.c	optional drm2
 dev/drm2/ttm/ttm_lock.c		optional drm2
 dev/drm2/ttm/ttm_object.c	optional drm2
 dev/drm2/ttm/ttm_tt.c		optional drm2
 dev/drm2/ttm/ttm_bo_util.c	optional drm2
 dev/drm2/ttm/ttm_bo.c		optional drm2
 dev/drm2/ttm/ttm_bo_manager.c	optional drm2
 dev/drm2/ttm/ttm_execbuf_util.c	optional drm2
 dev/drm2/ttm/ttm_memory.c	optional drm2
 dev/drm2/ttm/ttm_page_alloc.c	optional drm2
 dev/drm2/ttm/ttm_bo_vm.c	optional drm2
 dev/drm2/ati_pcigart.c		optional drm2 agp pci
 dev/ed/if_ed.c			optional ed
 dev/ed/if_ed_novell.c		optional ed
 dev/ed/if_ed_rtl80x9.c		optional ed
 dev/ed/if_ed_pccard.c		optional ed pccard
 dev/ed/if_ed_pci.c		optional ed pci
 dev/efidev/efidev.c		optional efirt
 dev/efidev/efirt.c		optional efirt
 dev/efidev/efirtc.c		optional efirt
 dev/e1000/if_em.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/em_txrx.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/igb_txrx.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_80003es2lan.c	optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_82540.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_82541.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_82542.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_82543.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_82571.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_82575.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_ich8lan.c	optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_i210.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_api.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_mac.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_manage.c	optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_nvm.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_phy.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_vf.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_mbx.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_osdep.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/et/if_et.c			optional et
 dev/ena/ena.c			optional ena \
 	compile-with "${NORMAL_C} -I$S/contrib"
 dev/ena/ena_sysctl.c 		optional ena \
 	compile-with "${NORMAL_C} -I$S/contrib"
 contrib/ena-com/ena_com.c	optional ena
 contrib/ena-com/ena_eth_com.c	optional ena
 dev/ep/if_ep.c			optional ep
 dev/ep/if_ep_isa.c		optional ep isa
 dev/ep/if_ep_pccard.c		optional ep pccard
 dev/esp/esp_pci.c		optional esp pci
 dev/esp/ncr53c9x.c		optional esp
 dev/etherswitch/arswitch/arswitch.c		optional arswitch
 dev/etherswitch/arswitch/arswitch_reg.c		optional arswitch
 dev/etherswitch/arswitch/arswitch_phy.c		optional arswitch
 dev/etherswitch/arswitch/arswitch_8216.c	optional arswitch
 dev/etherswitch/arswitch/arswitch_8226.c	optional arswitch
 dev/etherswitch/arswitch/arswitch_8316.c	optional arswitch
 dev/etherswitch/arswitch/arswitch_8327.c	optional arswitch
 dev/etherswitch/arswitch/arswitch_7240.c	optional arswitch
 dev/etherswitch/arswitch/arswitch_9340.c	optional arswitch
 dev/etherswitch/arswitch/arswitch_vlans.c	optional arswitch
 dev/etherswitch/etherswitch.c		optional etherswitch
 dev/etherswitch/etherswitch_if.m	optional etherswitch
 dev/etherswitch/ip17x/ip17x.c		optional ip17x
 dev/etherswitch/ip17x/ip175c.c		optional ip17x
 dev/etherswitch/ip17x/ip175d.c		optional ip17x
 dev/etherswitch/ip17x/ip17x_phy.c	optional ip17x
 dev/etherswitch/ip17x/ip17x_vlans.c	optional ip17x
 dev/etherswitch/miiproxy.c		optional miiproxy
 dev/etherswitch/rtl8366/rtl8366rb.c	optional rtl8366rb
 dev/etherswitch/e6000sw/e6000sw.c	optional e6000sw
 dev/etherswitch/e6000sw/e6060sw.c	optional e6060sw
 dev/etherswitch/infineon/adm6996fc.c	optional adm6996fc
 dev/etherswitch/micrel/ksz8995ma.c	optional ksz8995ma
 dev/etherswitch/ukswitch/ukswitch.c	optional ukswitch
 dev/evdev/cdev.c			optional evdev
 dev/evdev/evdev.c			optional evdev
 dev/evdev/evdev_mt.c			optional evdev
 dev/evdev/evdev_utils.c			optional evdev
 dev/evdev/uinput.c			optional evdev uinput
 dev/ex/if_ex.c			optional ex
 dev/ex/if_ex_isa.c		optional ex isa
 dev/ex/if_ex_pccard.c		optional ex pccard
 dev/exca/exca.c			optional cbb
 dev/extres/clk/clk.c		optional ext_resources clk fdt
 dev/extres/clk/clkdev_if.m	optional ext_resources clk fdt
 dev/extres/clk/clknode_if.m	optional ext_resources clk fdt
 dev/extres/clk/clk_bus.c	optional ext_resources clk fdt
 dev/extres/clk/clk_div.c	optional ext_resources clk fdt
 dev/extres/clk/clk_fixed.c	optional ext_resources clk fdt
 dev/extres/clk/clk_gate.c	optional ext_resources clk fdt
+dev/extres/clk/clk_link.c	optional ext_resources clk fdt
 dev/extres/clk/clk_mux.c	optional ext_resources clk fdt
 dev/extres/phy/phy.c		optional ext_resources phy fdt
 dev/extres/phy/phydev_if.m	optional ext_resources phy fdt
 dev/extres/phy/phynode_if.m	optional ext_resources phy fdt
 dev/extres/phy/phy_usb.c	optional ext_resources phy fdt
 dev/extres/phy/phynode_usb_if.m	optional ext_resources phy fdt
 dev/extres/hwreset/hwreset.c	optional ext_resources hwreset fdt
 dev/extres/hwreset/hwreset_if.m	optional ext_resources hwreset fdt
 dev/extres/nvmem/nvmem.c	optional ext_resources nvmem fdt
 dev/extres/nvmem/nvmem_if.m	optional ext_resources nvmem fdt
 dev/extres/regulator/regdev_if.m	optional ext_resources regulator fdt
 dev/extres/regulator/regnode_if.m	optional ext_resources regulator fdt
 dev/extres/regulator/regulator.c	optional ext_resources regulator fdt
 dev/extres/regulator/regulator_bus.c	optional ext_resources regulator fdt
 dev/extres/regulator/regulator_fixed.c	optional ext_resources regulator fdt
 dev/extres/syscon/syscon.c		optional ext_resources syscon
 dev/extres/syscon/syscon_generic.c	optional ext_resources syscon fdt
 dev/extres/syscon/syscon_if.m		optional ext_resources syscon
 dev/fb/fbd.c			optional fbd | vt
 dev/fb/fb_if.m			standard
 dev/fb/splash.c			optional sc splash
 dev/fdt/fdt_clock.c		optional fdt fdt_clock
 dev/fdt/fdt_clock_if.m		optional fdt fdt_clock
 dev/fdt/fdt_common.c		optional fdt
 dev/fdt/fdt_pinctrl.c		optional fdt fdt_pinctrl
 dev/fdt/fdt_pinctrl_if.m	optional fdt fdt_pinctrl
 dev/fdt/fdt_slicer.c		optional fdt cfi | fdt nand | fdt mx25l | fdt n25q | fdt at45d
 dev/fdt/fdt_static_dtb.S	optional fdt fdt_dtb_static \
 	dependency	"${FDT_DTS_FILE:T:R}.dtb"
 dev/fdt/simplebus.c		optional fdt
 dev/fdt/simple_mfd.c		optional syscon fdt
 dev/fe/if_fe.c			optional fe
 dev/fe/if_fe_pccard.c		optional fe pccard
 dev/filemon/filemon.c		optional filemon
 dev/firewire/firewire.c		optional firewire
 dev/firewire/fwcrom.c		optional firewire
 dev/firewire/fwdev.c		optional firewire
 dev/firewire/fwdma.c		optional firewire
 dev/firewire/fwmem.c		optional firewire
 dev/firewire/fwohci.c		optional firewire
 dev/firewire/fwohci_pci.c	optional firewire pci
 dev/firewire/if_fwe.c		optional fwe
 dev/firewire/if_fwip.c		optional fwip
 dev/firewire/sbp.c		optional sbp
 dev/firewire/sbp_targ.c		optional sbp_targ
 dev/flash/at45d.c		optional at45d
 dev/flash/cqspi.c		optional cqspi fdt xdma
 dev/flash/mx25l.c		optional mx25l
 dev/flash/n25q.c		optional n25q fdt
 dev/flash/qspi_if.m		optional cqspi fdt | n25q fdt
 dev/fxp/if_fxp.c		optional fxp \
 	compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS}"
 dev/fxp/inphy.c			optional fxp
 dev/gem/if_gem.c		optional gem
 dev/gem/if_gem_pci.c		optional gem pci
 dev/gem/if_gem_sbus.c		optional gem sbus
 dev/gpio/gpiobacklight.c	optional gpiobacklight fdt
 dev/gpio/gpiokeys.c		optional gpiokeys fdt
 dev/gpio/gpiokeys_codes.c	optional gpiokeys fdt
 dev/gpio/gpiobus.c		optional gpio				\
 	dependency	"gpiobus_if.h"
 dev/gpio/gpioc.c		optional gpio				\
 	dependency	"gpio_if.h"
 dev/gpio/gpioiic.c		optional gpioiic
 dev/gpio/gpioled.c		optional gpioled !fdt
 dev/gpio/gpioled_fdt.c		optional gpioled fdt
 dev/gpio/gpiopower.c		optional gpiopower fdt
 dev/gpio/gpioregulator.c	optional gpioregulator fdt ext_resources
 dev/gpio/gpiospi.c		optional gpiospi
 dev/gpio/gpioths.c		optional gpioths
 dev/gpio/gpio_if.m		optional gpio
 dev/gpio/gpiobus_if.m		optional gpio
 dev/gpio/gpiopps.c		optional gpiopps fdt
 dev/gpio/ofw_gpiobus.c		optional fdt gpio
 dev/hifn/hifn7751.c		optional hifn
 dev/hme/if_hme.c		optional hme
 dev/hme/if_hme_pci.c		optional hme pci
 dev/hme/if_hme_sbus.c		optional hme sbus
 dev/hptiop/hptiop.c		optional hptiop scbus
 dev/hwpmc/hwpmc_logging.c	optional hwpmc
 dev/hwpmc/hwpmc_mod.c		optional hwpmc
 dev/hwpmc/hwpmc_soft.c		optional hwpmc
 dev/ichiic/ig4_acpi.c		optional ig4 acpi iicbus
 dev/ichiic/ig4_iic.c		optional ig4 iicbus
 dev/ichiic/ig4_pci.c		optional ig4 pci iicbus
 dev/ichsmb/ichsmb.c		optional ichsmb
 dev/ichsmb/ichsmb_pci.c		optional ichsmb pci
 dev/ida/ida.c			optional ida
 dev/ida/ida_disk.c		optional ida
 dev/ida/ida_pci.c		optional ida pci
 dev/iicbus/ad7418.c		optional ad7418
 dev/iicbus/ads111x.c		optional ads111x
 dev/iicbus/ds1307.c		optional ds1307
 dev/iicbus/ds13rtc.c		optional ds13rtc | ds133x | ds1374
 dev/iicbus/ds1672.c		optional ds1672
 dev/iicbus/ds3231.c		optional ds3231
 dev/iicbus/rtc8583.c		optional rtc8583
 dev/iicbus/syr827.c		optional syr827 ext_resources fdt
 dev/iicbus/icee.c		optional icee
 dev/iicbus/if_ic.c		optional ic
 dev/iicbus/iic.c		optional iic
 dev/iicbus/iic_recover_bus.c	optional iicbus
 dev/iicbus/iicbb.c		optional iicbb
 dev/iicbus/iicbb_if.m		optional iicbb
 dev/iicbus/iicbus.c		optional iicbus
 dev/iicbus/iicbus_if.m		optional iicbus
 dev/iicbus/iiconf.c		optional iicbus
 dev/iicbus/iicsmb.c		optional iicsmb				\
 	dependency	"iicbus_if.h"
 dev/iicbus/iicoc.c		optional iicoc
 dev/iicbus/isl12xx.c		optional isl12xx
 dev/iicbus/lm75.c		optional lm75
 dev/iicbus/mux/iicmux.c		optional iicmux
 dev/iicbus/mux/iicmux_if.m	optional iicmux
 dev/iicbus/mux/iic_gpiomux.c	optional iic_gpiomux fdt
 dev/iicbus/mux/ltc430x.c	optional ltc430x
 dev/iicbus/nxprtc.c		optional nxprtc | pcf8563
 dev/iicbus/ofw_iicbus.c		optional fdt iicbus
 dev/iicbus/rtc8583.c		optional rtc8583
 dev/iicbus/s35390a.c		optional s35390a
 dev/iicbus/sy8106a.c		optional sy8106a ext_resources fdt
 dev/iir/iir.c			optional iir
 dev/iir/iir_ctrl.c		optional iir
 dev/iir/iir_pci.c		optional iir pci
 dev/intpm/intpm.c		optional intpm pci
 # XXX Work around clang warning, until maintainer approves fix.
 dev/ips/ips.c			optional ips \
 	compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}"
 dev/ips/ips_commands.c		optional ips
 dev/ips/ips_disk.c		optional ips
 dev/ips/ips_ioctl.c		optional ips
 dev/ips/ips_pci.c		optional ips pci
 dev/ipw/if_ipw.c		optional ipw
 ipwbssfw.c			optional ipwbssfw | ipwfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk ipw_bss.fw:ipw_bss:130 -lintel_ipw -mipw_bss -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"ipwbssfw.c"
 ipw_bss.fwo			optional ipwbssfw | ipwfw		\
 	dependency	"ipw_bss.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"ipw_bss.fwo"
 ipw_bss.fw			optional ipwbssfw | ipwfw		\
 	dependency	"$S/contrib/dev/ipw/ipw2100-1.3.fw.uu"		\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"ipw_bss.fw"
 ipwibssfw.c			optional ipwibssfw | ipwfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk ipw_ibss.fw:ipw_ibss:130 -lintel_ipw -mipw_ibss -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"ipwibssfw.c"
 ipw_ibss.fwo			optional ipwibssfw | ipwfw		\
 	dependency	"ipw_ibss.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"ipw_ibss.fwo"
 ipw_ibss.fw			optional ipwibssfw | ipwfw		\
 	dependency	"$S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"ipw_ibss.fw"
 ipwmonitorfw.c			optional ipwmonitorfw | ipwfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk ipw_monitor.fw:ipw_monitor:130 -lintel_ipw -mipw_monitor -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"ipwmonitorfw.c"
 ipw_monitor.fwo			optional ipwmonitorfw | ipwfw		\
 	dependency	"ipw_monitor.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"ipw_monitor.fwo"
 ipw_monitor.fw			optional ipwmonitorfw | ipwfw		\
 	dependency	"$S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"ipw_monitor.fw"
 dev/iscsi/icl.c			optional iscsi
 dev/iscsi/icl_conn_if.m		optional cfiscsi | iscsi
 dev/iscsi/icl_soft.c		optional iscsi
 dev/iscsi/icl_soft_proxy.c	optional iscsi
 dev/iscsi/iscsi.c		optional iscsi scbus
 dev/iscsi_initiator/iscsi.c	optional iscsi_initiator scbus
 dev/iscsi_initiator/iscsi_subr.c	optional iscsi_initiator scbus
 dev/iscsi_initiator/isc_cam.c	optional iscsi_initiator scbus
 dev/iscsi_initiator/isc_soc.c	optional iscsi_initiator scbus
 dev/iscsi_initiator/isc_sm.c	optional iscsi_initiator scbus
 dev/iscsi_initiator/isc_subr.c	optional iscsi_initiator scbus
 dev/ismt/ismt.c			optional ismt
 dev/isl/isl.c			optional isl iicbus
 dev/isp/isp.c			optional isp
 dev/isp/isp_freebsd.c		optional isp
 dev/isp/isp_library.c		optional isp
 dev/isp/isp_pci.c		optional isp pci
 dev/isp/isp_sbus.c		optional isp sbus
 dev/isp/isp_target.c		optional isp
 dev/ispfw/ispfw.c		optional ispfw
 dev/iwi/if_iwi.c		optional iwi
 iwibssfw.c			optional iwibssfw | iwifw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwi_bss.fw:iwi_bss:300 -lintel_iwi -miwi_bss -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwibssfw.c"
 iwi_bss.fwo			optional iwibssfw | iwifw		\
 	dependency	"iwi_bss.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwi_bss.fwo"
 iwi_bss.fw			optional iwibssfw | iwifw		\
 	dependency	"$S/contrib/dev/iwi/ipw2200-bss.fw.uu"		\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwi_bss.fw"
 iwiibssfw.c			optional iwiibssfw | iwifw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwi_ibss.fw:iwi_ibss:300 -lintel_iwi -miwi_ibss -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwiibssfw.c"
 iwi_ibss.fwo			optional iwiibssfw | iwifw		\
 	dependency	"iwi_ibss.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwi_ibss.fwo"
 iwi_ibss.fw			optional iwiibssfw | iwifw		\
 	dependency	"$S/contrib/dev/iwi/ipw2200-ibss.fw.uu"		\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwi_ibss.fw"
 iwimonitorfw.c			optional iwimonitorfw | iwifw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwi_monitor.fw:iwi_monitor:300 -lintel_iwi -miwi_monitor -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwimonitorfw.c"
 iwi_monitor.fwo			optional iwimonitorfw | iwifw		\
 	dependency	"iwi_monitor.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwi_monitor.fwo"
 iwi_monitor.fw			optional iwimonitorfw | iwifw		\
 	dependency	"$S/contrib/dev/iwi/ipw2200-sniffer.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwi_monitor.fw"
 dev/iwm/if_iwm.c		optional iwm
 dev/iwm/if_iwm_7000.c		optional iwm
 dev/iwm/if_iwm_8000.c		optional iwm
 dev/iwm/if_iwm_9000.c		optional iwm
 dev/iwm/if_iwm_9260.c		optional iwm
 dev/iwm/if_iwm_binding.c	optional iwm
 dev/iwm/if_iwm_fw.c		optional iwm
 dev/iwm/if_iwm_led.c		optional iwm
 dev/iwm/if_iwm_mac_ctxt.c	optional iwm
 dev/iwm/if_iwm_notif_wait.c	optional iwm
 dev/iwm/if_iwm_pcie_trans.c	optional iwm
 dev/iwm/if_iwm_phy_ctxt.c	optional iwm
 dev/iwm/if_iwm_phy_db.c		optional iwm
 dev/iwm/if_iwm_power.c		optional iwm
 dev/iwm/if_iwm_scan.c		optional iwm
 dev/iwm/if_iwm_sf.c		optional iwm
 dev/iwm/if_iwm_sta.c		optional iwm
 dev/iwm/if_iwm_time_event.c	optional iwm
 dev/iwm/if_iwm_util.c		optional iwm
 iwm3160fw.c			optional iwm3160fw | iwmfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwm3160.fw:iwm3160fw -miwm3160fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwm3160fw.c"
 iwm3160fw.fwo			optional iwm3160fw | iwmfw		\
 	dependency	"iwm3160.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwm3160fw.fwo"
 iwm3160.fw			optional iwm3160fw | iwmfw		\
 	dependency	"$S/contrib/dev/iwm/iwm-3160-17.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwm3160.fw"
 iwm3168fw.c			optional iwm3168fw | iwmfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwm3168.fw:iwm3168fw -miwm3168fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwm3168fw.c"
 iwm3168fw.fwo			optional iwm3168fw | iwmfw		\
 	dependency	"iwm3168.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwm3168fw.fwo"
 iwm3168.fw			optional iwm3168fw | iwmfw		\
 	dependency	"$S/contrib/dev/iwm/iwm-3168-22.fw.uu"		\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwm3168.fw"
 iwm7260fw.c			optional iwm7260fw | iwmfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwm7260.fw:iwm7260fw -miwm7260fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwm7260fw.c"
 iwm7260fw.fwo			optional iwm7260fw | iwmfw		\
 	dependency	"iwm7260.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwm7260fw.fwo"
 iwm7260.fw			optional iwm7260fw | iwmfw		\
 	dependency	"$S/contrib/dev/iwm/iwm-7260-17.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwm7260.fw"
 iwm7265fw.c			optional iwm7265fw | iwmfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwm7265.fw:iwm7265fw -miwm7265fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwm7265fw.c"
 iwm7265fw.fwo			optional iwm7265fw | iwmfw		\
 	dependency	"iwm7265.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwm7265fw.fwo"
 iwm7265.fw			optional iwm7265fw | iwmfw		\
 	dependency	"$S/contrib/dev/iwm/iwm-7265-17.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwm7265.fw"
 iwm7265Dfw.c			optional iwm7265Dfw | iwmfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwm7265D.fw:iwm7265Dfw -miwm7265Dfw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwm7265Dfw.c"
 iwm7265Dfw.fwo			optional iwm7265Dfw | iwmfw		\
 	dependency	"iwm7265D.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwm7265Dfw.fwo"
 iwm7265D.fw			optional iwm7265Dfw | iwmfw		\
 	dependency	"$S/contrib/dev/iwm/iwm-7265D-17.fw.uu"		\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwm7265D.fw"
 iwm8000Cfw.c			optional iwm8000Cfw | iwmfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwm8000C.fw:iwm8000Cfw -miwm8000Cfw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwm8000Cfw.c"
 iwm8000Cfw.fwo			optional iwm8000Cfw | iwmfw		\
 	dependency	"iwm8000C.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwm8000Cfw.fwo"
 iwm8000C.fw			optional iwm8000Cfw | iwmfw		\
 	dependency	"$S/contrib/dev/iwm/iwm-8000C-16.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwm8000C.fw"
 iwm8265.fw			optional iwm8265fw | iwmfw		\
 	dependency	"$S/contrib/dev/iwm/iwm-8265-22.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwm8265.fw"
 iwm8265fw.c			optional iwm8265fw | iwmfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwm8265.fw:iwm8265fw -miwm8265fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwm8265fw.c"
 iwm8265fw.fwo			optional iwm8265fw | iwmfw		\
 	dependency	"iwm8265.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwm8265fw.fwo"
 dev/iwn/if_iwn.c		optional iwn
 iwn1000fw.c			optional iwn1000fw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn1000.fw:iwn1000fw -miwn1000fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn1000fw.c"
 iwn1000fw.fwo			optional iwn1000fw | iwnfw		\
 	dependency	"iwn1000.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn1000fw.fwo"
 iwn1000.fw			optional iwn1000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn1000.fw"
 iwn100fw.c			optional iwn100fw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn100.fw:iwn100fw -miwn100fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn100fw.c"
 iwn100fw.fwo			optional iwn100fw | iwnfw		\
 	dependency	"iwn100.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn100fw.fwo"
 iwn100.fw			optional iwn100fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-100-39.31.5.1.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn100.fw"
 iwn105fw.c			optional iwn105fw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn105.fw:iwn105fw -miwn105fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn105fw.c"
 iwn105fw.fwo			optional iwn105fw | iwnfw		\
 	dependency	"iwn105.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn105fw.fwo"
 iwn105.fw			optional iwn105fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-105-6-18.168.6.1.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn105.fw"
 iwn135fw.c			optional iwn135fw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn135.fw:iwn135fw -miwn135fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn135fw.c"
 iwn135fw.fwo			optional iwn135fw | iwnfw		\
 	dependency	"iwn135.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn135fw.fwo"
 iwn135.fw			optional iwn135fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-135-6-18.168.6.1.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn135.fw"
 iwn2000fw.c			optional iwn2000fw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn2000.fw:iwn2000fw -miwn2000fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn2000fw.c"
 iwn2000fw.fwo			optional iwn2000fw | iwnfw		\
 	dependency	"iwn2000.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn2000fw.fwo"
 iwn2000.fw			optional iwn2000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-2000-18.168.6.1.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn2000.fw"
 iwn2030fw.c			optional iwn2030fw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn2030.fw:iwn2030fw -miwn2030fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn2030fw.c"
 iwn2030fw.fwo			optional iwn2030fw | iwnfw		\
 	dependency	"iwn2030.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn2030fw.fwo"
 iwn2030.fw			optional iwn2030fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwnwifi-2030-18.168.6.1.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn2030.fw"
 iwn4965fw.c			optional iwn4965fw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn4965.fw:iwn4965fw -miwn4965fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn4965fw.c"
 iwn4965fw.fwo			optional iwn4965fw | iwnfw		\
 	dependency	"iwn4965.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn4965fw.fwo"
 iwn4965.fw			optional iwn4965fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn4965.fw"
 iwn5000fw.c			optional iwn5000fw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn5000.fw:iwn5000fw -miwn5000fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn5000fw.c"
 iwn5000fw.fwo		optional iwn5000fw | iwnfw			\
 	dependency	"iwn5000.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn5000fw.fwo"
 iwn5000.fw			optional iwn5000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn5000.fw"
 iwn5150fw.c			optional iwn5150fw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn5150.fw:iwn5150fw -miwn5150fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn5150fw.c"
 iwn5150fw.fwo			optional iwn5150fw | iwnfw		\
 	dependency	"iwn5150.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn5150fw.fwo"
 iwn5150.fw			optional iwn5150fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu"\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn5150.fw"
 iwn6000fw.c			optional iwn6000fw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn6000.fw:iwn6000fw -miwn6000fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn6000fw.c"
 iwn6000fw.fwo			optional iwn6000fw | iwnfw		\
 	dependency	"iwn6000.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6000fw.fwo"
 iwn6000.fw			optional iwn6000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6000.fw"
 iwn6000g2afw.c			optional iwn6000g2afw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn6000g2a.fw:iwn6000g2afw -miwn6000g2afw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn6000g2afw.c"
 iwn6000g2afw.fwo		optional iwn6000g2afw | iwnfw		\
 	dependency	"iwn6000g2a.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6000g2afw.fwo"
 iwn6000g2a.fw			optional iwn6000g2afw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6000g2a-18.168.6.1.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6000g2a.fw"
 iwn6000g2bfw.c			optional iwn6000g2bfw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn6000g2b.fw:iwn6000g2bfw -miwn6000g2bfw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn6000g2bfw.c"
 iwn6000g2bfw.fwo		optional iwn6000g2bfw | iwnfw		\
 	dependency	"iwn6000g2b.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6000g2bfw.fwo"
 iwn6000g2b.fw			optional iwn6000g2bfw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6000g2b-18.168.6.1.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6000g2b.fw"
 iwn6050fw.c			optional iwn6050fw | iwnfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwn6050.fw:iwn6050fw -miwn6050fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"iwn6050fw.c"
 iwn6050fw.fwo			optional iwn6050fw | iwnfw		\
 	dependency	"iwn6050.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6050fw.fwo"
 iwn6050.fw			optional iwn6050fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6050.fw"
 dev/ixgbe/if_ix.c		optional ix inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP"
 dev/ixgbe/if_ixv.c		optional ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP"
 dev/ixgbe/if_bypass.c		optional ix inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/if_fdir.c		optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/if_sriov.c		optional ix inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ix_txrx.c		optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_osdep.c		optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_phy.c		optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_api.c		optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_common.c	optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_mbx.c		optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_vf.c		optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_82598.c		optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_82599.c		optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_x540.c		optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_x550.c		optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_dcb.c		optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_dcb_82598.c	optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_dcb_82599.c	optional ix inet | ixv inet \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/jedec_dimm/jedec_dimm.c	optional jedec_dimm smbus
 dev/jme/if_jme.c		optional jme pci
 dev/joy/joy.c			optional joy
 dev/joy/joy_isa.c		optional joy isa
 dev/kbd/kbd.c			optional atkbd | pckbd | sc | ukbd | vt
 dev/kbdmux/kbdmux.c		optional kbdmux
 dev/ksyms/ksyms.c		optional ksyms
 dev/le/am7990.c			optional le
 dev/le/am79900.c		optional le
 dev/le/if_le_pci.c		optional le pci
 dev/le/lance.c			optional le
 dev/led/led.c			standard
 dev/lge/if_lge.c		optional lge
 dev/liquidio/base/cn23xx_pf_device.c		optional lio	\
 	compile-with "${NORMAL_C}				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/base/lio_console.c			optional lio	\
 	compile-with "${NORMAL_C}				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/base/lio_ctrl.c			optional lio	\
 	compile-with "${NORMAL_C} 				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/base/lio_device.c			optional lio	\
 	compile-with "${NORMAL_C} 				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/base/lio_droq.c			optional lio	\
 	compile-with "${NORMAL_C} 				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/base/lio_mem_ops.c			optional lio	\
 	compile-with "${NORMAL_C} 				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/base/lio_request_manager.c		optional lio	\
 	compile-with "${NORMAL_C} 				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/base/lio_response_manager.c	optional lio	\
 	compile-with "${NORMAL_C} 				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/lio_core.c				optional lio	\
 	compile-with "${NORMAL_C} 				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/lio_ioctl.c			optional lio	\
 	compile-with "${NORMAL_C} 				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/lio_main.c				optional lio	\
 	compile-with "${NORMAL_C} 				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/lio_rss.c				optional lio	\
 	compile-with "${NORMAL_C} 				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/lio_rxtx.c				optional lio	\
 	compile-with "${NORMAL_C} 				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 dev/liquidio/lio_sysctl.c			optional lio	\
 	compile-with "${NORMAL_C} 				\
 	-I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
 lio.c	optional lio						\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk lio_23xx_nic.bin.fw:lio_23xx_nic.bin -mlio_23xx_nic.bin -c${.TARGET}" \
 	no-implicit-rule before-depend local			\
 	clean		"lio.c"
 lio_23xx_nic.bin.fw.fwo optional lio				\
 	dependency	"lio_23xx_nic.bin.fw"			\
 	compile-with	"${NORMAL_FWO}"				\
 	no-implicit-rule					\
 	clean		"lio_23xx_nic.bin.fw.fwo"
 lio_23xx_nic.bin.fw	optional lio					\
 	dependency	"$S/contrib/dev/liquidio/lio_23xx_nic.bin.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"lio_23xx_nic.bin.fw"
 dev/malo/if_malo.c		optional malo
 dev/malo/if_malohal.c		optional malo
 dev/malo/if_malo_pci.c		optional malo pci
 dev/mc146818/mc146818.c		optional mc146818
 dev/md/md.c			optional md
 dev/mdio/mdio_if.m		optional miiproxy | mdio
 dev/mdio/mdio.c			optional miiproxy | mdio
 dev/mem/memdev.c		optional mem
 dev/mem/memutil.c		optional mem
 dev/mfi/mfi.c			optional mfi
 dev/mfi/mfi_debug.c		optional mfi
 dev/mfi/mfi_pci.c		optional mfi pci
 dev/mfi/mfi_disk.c		optional mfi
 dev/mfi/mfi_syspd.c		optional mfi
 dev/mfi/mfi_tbolt.c		optional mfi
 dev/mfi/mfi_linux.c		optional mfi compat_linux
 dev/mfi/mfi_cam.c		optional mfip scbus
 dev/mii/acphy.c			optional miibus | acphy
 dev/mii/amphy.c			optional miibus | amphy
 dev/mii/atphy.c			optional miibus | atphy
 dev/mii/axphy.c			optional miibus | axphy
 dev/mii/bmtphy.c		optional miibus | bmtphy
 dev/mii/brgphy.c		optional miibus | brgphy
 dev/mii/ciphy.c			optional miibus | ciphy
 dev/mii/e1000phy.c		optional miibus | e1000phy
 dev/mii/gentbi.c		optional miibus | gentbi
 dev/mii/icsphy.c		optional miibus | icsphy
 dev/mii/ip1000phy.c		optional miibus | ip1000phy
 dev/mii/jmphy.c			optional miibus | jmphy
 dev/mii/lxtphy.c		optional miibus | lxtphy
 dev/mii/micphy.c		optional miibus fdt | micphy fdt
 dev/mii/mii.c			optional miibus | mii
 dev/mii/mii_bitbang.c		optional miibus | mii_bitbang
 dev/mii/mii_physubr.c		optional miibus | mii
 dev/mii/mii_fdt.c		optional miibus fdt | mii fdt
 dev/mii/miibus_if.m		optional miibus | mii
 dev/mii/mlphy.c			optional miibus | mlphy
 dev/mii/nsgphy.c		optional miibus | nsgphy
 dev/mii/nsphy.c			optional miibus | nsphy
 dev/mii/nsphyter.c		optional miibus | nsphyter
 dev/mii/pnaphy.c		optional miibus | pnaphy
 dev/mii/qsphy.c			optional miibus | qsphy
 dev/mii/rdcphy.c		optional miibus | rdcphy
 dev/mii/rgephy.c		optional miibus | rgephy
 dev/mii/rlphy.c			optional miibus | rlphy
 dev/mii/rlswitch.c		optional rlswitch
 dev/mii/smcphy.c		optional miibus | smcphy
 dev/mii/smscphy.c		optional miibus | smscphy
 dev/mii/tdkphy.c		optional miibus | tdkphy
 dev/mii/tlphy.c			optional miibus | tlphy
 dev/mii/truephy.c		optional miibus | truephy
 dev/mii/ukphy.c			optional miibus | mii
 dev/mii/ukphy_subr.c		optional miibus | mii
 dev/mii/vscphy.c		optional miibus | vscphy
 dev/mii/xmphy.c			optional miibus | xmphy
 dev/mk48txx/mk48txx.c		optional mk48txx
 dev/mlxfw/mlxfw_fsm.c			optional mlxfw \
 	compile-with "${MLXFW_C}"
 dev/mlxfw/mlxfw_mfa2.c			optional mlxfw \
 	compile-with "${MLXFW_C}"
 dev/mlxfw/mlxfw_mfa2_tlv_multi.c	optional mlxfw \
 	compile-with "${MLXFW_C}"
 dev/mlx/mlx.c			optional mlx
 dev/mlx/mlx_disk.c		optional mlx
 dev/mlx/mlx_pci.c		optional mlx pci
 dev/mly/mly.c			optional mly
 dev/mmc/mmc_subr.c		optional mmc | mmcsd !mmccam
 dev/mmc/mmc.c			optional mmc !mmccam
 dev/mmc/mmcbr_if.m		standard
 dev/mmc/mmcbus_if.m		standard
 dev/mmc/mmcsd.c			optional mmcsd !mmccam
 dev/mmcnull/mmcnull.c		optional mmcnull
 dev/mn/if_mn.c			optional mn pci
 dev/mpr/mpr.c			optional mpr
 dev/mpr/mpr_config.c		optional mpr
 # XXX Work around clang warning, until maintainer approves fix.
 dev/mpr/mpr_mapping.c		optional mpr \
 	compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}"
 dev/mpr/mpr_pci.c		optional mpr pci
 dev/mpr/mpr_sas.c		optional mpr \
 	compile-with "${NORMAL_C} ${NO_WUNNEEDED_INTERNAL_DECL}"
 dev/mpr/mpr_sas_lsi.c		optional mpr
 dev/mpr/mpr_table.c		optional mpr
 dev/mpr/mpr_user.c		optional mpr
 dev/mps/mps.c			optional mps
 dev/mps/mps_config.c		optional mps
 # XXX Work around clang warning, until maintainer approves fix.
 dev/mps/mps_mapping.c		optional mps \
 	compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}"
 dev/mps/mps_pci.c		optional mps pci
 dev/mps/mps_sas.c		optional mps \
 	compile-with "${NORMAL_C} ${NO_WUNNEEDED_INTERNAL_DECL}"
 dev/mps/mps_sas_lsi.c		optional mps
 dev/mps/mps_table.c		optional mps
 dev/mps/mps_user.c		optional mps
 dev/mpt/mpt.c			optional mpt
 dev/mpt/mpt_cam.c		optional mpt
 dev/mpt/mpt_debug.c		optional mpt
 dev/mpt/mpt_pci.c		optional mpt pci
 dev/mpt/mpt_raid.c		optional mpt
 dev/mpt/mpt_user.c		optional mpt
 dev/mrsas/mrsas.c		optional mrsas
 dev/mrsas/mrsas_cam.c		optional mrsas
 dev/mrsas/mrsas_ioctl.c		optional mrsas
 dev/mrsas/mrsas_fp.c		optional mrsas
 dev/msk/if_msk.c		optional msk
 dev/mvs/mvs.c			optional mvs
 dev/mvs/mvs_if.m		optional mvs
 dev/mvs/mvs_pci.c		optional mvs pci
 dev/mwl/if_mwl.c		optional mwl
 dev/mwl/if_mwl_pci.c		optional mwl pci
 dev/mwl/mwlhal.c		optional mwl
 mwlfw.c				optional mwlfw				\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk mw88W8363.fw:mw88W8363fw mwlboot.fw:mwlboot -mmwl -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"mwlfw.c"
 mw88W8363.fwo		optional mwlfw					\
 	dependency	"mw88W8363.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"mw88W8363.fwo"
 mw88W8363.fw		optional mwlfw					\
 	dependency	"$S/contrib/dev/mwl/mw88W8363.fw.uu"		\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"mw88W8363.fw"
 mwlboot.fwo		optional mwlfw					\
 	dependency	"mwlboot.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"mwlboot.fwo"
 mwlboot.fw		optional mwlfw					\
 	dependency	"$S/contrib/dev/mwl/mwlboot.fw.uu"		\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"mwlboot.fw"
 dev/mxge/if_mxge.c		optional mxge pci
 dev/mxge/mxge_eth_z8e.c		optional mxge pci
 dev/mxge/mxge_ethp_z8e.c	optional mxge pci
 dev/mxge/mxge_rss_eth_z8e.c	optional mxge pci
 dev/mxge/mxge_rss_ethp_z8e.c	optional mxge pci
 dev/my/if_my.c			optional my
 dev/nand/nand.c			optional nand
 dev/nand/nand_bbt.c		optional nand
 dev/nand/nand_cdev.c		optional nand
 dev/nand/nand_generic.c		optional nand
 dev/nand/nand_geom.c		optional nand
 dev/nand/nand_id.c		optional nand
 dev/nand/nandbus.c		optional nand
 dev/nand/nandbus_if.m		optional nand
 dev/nand/nand_if.m		optional nand
 dev/nand/nandsim.c		optional nandsim nand
 dev/nand/nandsim_chip.c		optional nandsim nand
 dev/nand/nandsim_ctrl.c		optional nandsim nand
 dev/nand/nandsim_log.c		optional nandsim nand
 dev/nand/nandsim_swap.c		optional nandsim nand
 dev/nand/nfc_if.m		optional nand
 dev/ncr/ncr.c			optional ncr pci
 dev/ncv/ncr53c500.c		optional ncv
 dev/ncv/ncr53c500_pccard.c	optional ncv pccard
 dev/netmap/if_ptnet.c		optional netmap inet
 dev/netmap/netmap.c		optional netmap
 dev/netmap/netmap_bdg.c		optional netmap
 dev/netmap/netmap_freebsd.c	optional netmap
 dev/netmap/netmap_generic.c	optional netmap
 dev/netmap/netmap_kloop.c	optional netmap
 dev/netmap/netmap_legacy.c	optional netmap
 dev/netmap/netmap_mbq.c		optional netmap
 dev/netmap/netmap_mem2.c	optional netmap
 dev/netmap/netmap_monitor.c	optional netmap
 dev/netmap/netmap_null.c	optional netmap
 dev/netmap/netmap_offloadings.c	optional netmap
 dev/netmap/netmap_pipe.c	optional netmap
 dev/netmap/netmap_vale.c	optional netmap
 # compile-with "${NORMAL_C} -Wconversion -Wextra"
 dev/nfsmb/nfsmb.c		optional nfsmb pci
 dev/nge/if_nge.c		optional nge
 dev/nmdm/nmdm.c			optional nmdm
 dev/nsp/nsp.c			optional nsp
 dev/nsp/nsp_pccard.c		optional nsp pccard
 dev/null/null.c			standard
 dev/nvd/nvd.c			optional nvd nvme
 dev/nvme/nvme.c			optional nvme
 dev/nvme/nvme_ahci.c		optional nvme ahci
 dev/nvme/nvme_ctrlr.c		optional nvme
 dev/nvme/nvme_ctrlr_cmd.c	optional nvme
 dev/nvme/nvme_ns.c		optional nvme
 dev/nvme/nvme_ns_cmd.c		optional nvme
 dev/nvme/nvme_pci.c		optional nvme pci
 dev/nvme/nvme_qpair.c		optional nvme
 dev/nvme/nvme_sim.c		optional nvme scbus
 dev/nvme/nvme_sysctl.c		optional nvme
 dev/nvme/nvme_test.c		optional nvme
 dev/nvme/nvme_util.c		optional nvme
 dev/oce/oce_hw.c		optional oce pci
 dev/oce/oce_if.c		optional oce pci
 dev/oce/oce_mbox.c		optional oce pci
 dev/oce/oce_queue.c		optional oce pci
 dev/oce/oce_sysctl.c		optional oce pci
 dev/oce/oce_util.c		optional oce pci
 dev/ocs_fc/ocs_pci.c		optional ocs_fc pci
 dev/ocs_fc/ocs_ioctl.c		optional ocs_fc pci
 dev/ocs_fc/ocs_os.c		optional ocs_fc pci
 dev/ocs_fc/ocs_utils.c		optional ocs_fc pci
 dev/ocs_fc/ocs_hw.c		optional ocs_fc pci
 dev/ocs_fc/ocs_hw_queues.c	optional ocs_fc pci
 dev/ocs_fc/sli4.c		optional ocs_fc pci
 dev/ocs_fc/ocs_sm.c		optional ocs_fc pci
 dev/ocs_fc/ocs_device.c		optional ocs_fc pci
 dev/ocs_fc/ocs_xport.c		optional ocs_fc pci
 dev/ocs_fc/ocs_domain.c		optional ocs_fc pci
 dev/ocs_fc/ocs_sport.c		optional ocs_fc pci
 dev/ocs_fc/ocs_els.c		optional ocs_fc pci
 dev/ocs_fc/ocs_fabric.c		optional ocs_fc pci
 dev/ocs_fc/ocs_io.c		optional ocs_fc pci
 dev/ocs_fc/ocs_node.c		optional ocs_fc pci
 dev/ocs_fc/ocs_scsi.c		optional ocs_fc pci
 dev/ocs_fc/ocs_unsol.c		optional ocs_fc pci
 dev/ocs_fc/ocs_ddump.c		optional ocs_fc pci
 dev/ocs_fc/ocs_mgmt.c		optional ocs_fc pci
 dev/ocs_fc/ocs_cam.c		optional ocs_fc pci
 dev/ofw/ofw_bus_if.m		optional fdt
 dev/ofw/ofw_bus_subr.c		optional fdt
 dev/ofw/ofw_cpu.c		optional fdt
 dev/ofw/ofw_fdt.c		optional fdt
 dev/ofw/ofw_if.m		optional fdt
 dev/ofw/ofw_subr.c		optional fdt
 dev/ofw/ofwbus.c		optional fdt
 dev/ofw/openfirm.c		optional fdt
 dev/ofw/openfirmio.c		optional fdt
 dev/ow/ow.c			optional ow				\
 	dependency	"owll_if.h"					\
 	dependency	"own_if.h"
 dev/ow/owll_if.m		optional ow
 dev/ow/own_if.m			optional ow
 dev/ow/ow_temp.c		optional ow_temp
 dev/ow/owc_gpiobus.c		optional owc gpio
 dev/pbio/pbio.c			optional pbio isa
 dev/pccard/card_if.m		standard
 dev/pccard/pccard.c		optional pccard
 dev/pccard/pccard_cis.c		optional pccard
 dev/pccard/pccard_cis_quirks.c	optional pccard
 dev/pccard/pccard_device.c	optional pccard
 dev/pccard/power_if.m		standard
 dev/pccbb/pccbb.c		optional cbb
 dev/pccbb/pccbb_isa.c		optional cbb isa
 dev/pccbb/pccbb_pci.c		optional cbb pci
 dev/pcf/pcf.c			optional pcf
 dev/pci/fixup_pci.c		optional pci
 dev/pci/hostb_pci.c		optional pci
 dev/pci/ignore_pci.c		optional pci
 dev/pci/isa_pci.c		optional pci isa
 dev/pci/pci.c			optional pci
 dev/pci/pci_if.m		standard
 dev/pci/pci_iov.c		optional pci pci_iov
 dev/pci/pci_iov_if.m		standard
 dev/pci/pci_iov_schema.c	optional pci pci_iov
 dev/pci/pci_pci.c		optional pci
 dev/pci/pci_subr.c		optional pci
 dev/pci/pci_user.c		optional pci
 dev/pci/pcib_if.m		standard
 dev/pci/pcib_support.c		standard
 dev/pci/vga_pci.c		optional pci
 dev/pcn/if_pcn.c		optional pcn pci
 dev/pms/freebsd/driver/ini/src/agtiapi.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/sadisc.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/mpi.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/saframe.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/sahw.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/sainit.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/saint.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/sampicmd.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/sampirsp.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/saphy.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/saport.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/sasata.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/sasmp.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/sassp.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/satimer.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/sautil.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/saioctlcmd.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/mpidebug.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/discovery/dm/dminit.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/discovery/dm/dmsmp.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/discovery/dm/dmdisc.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/discovery/dm/dmport.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/discovery/dm/dmtimer.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/discovery/dm/dmmisc.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sat/src/sminit.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sat/src/smmisc.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sat/src/smsat.c				optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sat/src/smsatcb.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sat/src/smsathw.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sat/src/smtimer.c			optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/common/tdinit.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/common/tdmisc.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/common/tdesgl.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/common/tdport.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/common/tdint.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/common/tdioctl.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/common/tdhw.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/common/ossacmnapi.c	optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/common/tddmcmnapi.c	optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/common/tdsmcmnapi.c	optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/common/tdtimers.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/sas/ini/itdcb.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/sas/ini/itdinit.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/sas/ini/itddisc.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/sata/host/sat.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/sata/host/ossasat.c	optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/tisa/sassata/sata/host/sathw.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/ppbus/if_plip.c		optional plip
 dev/ppbus/immio.c		optional vpo
 dev/ppbus/lpbb.c		optional lpbb
 dev/ppbus/lpt.c			optional lpt
 dev/ppbus/pcfclock.c		optional pcfclock
 dev/ppbus/ppb_1284.c		optional ppbus
 dev/ppbus/ppb_base.c		optional ppbus
 dev/ppbus/ppb_msq.c		optional ppbus
 dev/ppbus/ppbconf.c		optional ppbus
 dev/ppbus/ppbus_if.m		optional ppbus
 dev/ppbus/ppi.c			optional ppi
 dev/ppbus/pps.c			optional pps
 dev/ppbus/vpo.c			optional vpo
 dev/ppbus/vpoio.c		optional vpo
 dev/ppc/ppc.c			optional ppc
 dev/ppc/ppc_acpi.c		optional ppc acpi
 dev/ppc/ppc_isa.c		optional ppc isa
 dev/ppc/ppc_pci.c		optional ppc pci
 dev/ppc/ppc_puc.c		optional ppc puc
 dev/proto/proto_bus_isa.c	optional proto acpi | proto isa
 dev/proto/proto_bus_pci.c	optional proto pci
 dev/proto/proto_busdma.c	optional proto
 dev/proto/proto_core.c		optional proto
 dev/pst/pst-iop.c		optional pst
 dev/pst/pst-pci.c		optional pst pci
 dev/pst/pst-raid.c		optional pst
 dev/pty/pty.c			optional pty
 dev/puc/puc.c			optional puc
 dev/puc/puc_cfg.c		optional puc
 dev/puc/puc_pccard.c		optional puc pccard
 dev/puc/puc_pci.c		optional puc pci
 dev/pwm/pwmc.c			optional pwm | pwmc
 dev/pwm/pwmbus.c		optional pwm | pwmbus
 dev/pwm/pwmbus_if.m		optional pwm | pwmbus
 dev/pwm/ofw_pwm.c		optional pwm fdt | pwmbus fdt
 dev/pwm/ofw_pwmbus.c		optional pwm fdt | pwmbus fdt
 dev/quicc/quicc_core.c		optional quicc
 dev/ral/rt2560.c		optional ral
 dev/ral/rt2661.c		optional ral
 dev/ral/rt2860.c		optional ral
 dev/ral/if_ral_pci.c		optional ral pci
 rt2561fw.c			optional rt2561fw | ralfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rt2561.fw:rt2561fw -mrt2561 -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rt2561fw.c"
 rt2561fw.fwo			optional rt2561fw | ralfw		\
 	dependency	"rt2561.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2561fw.fwo"
 rt2561.fw			optional rt2561fw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2561.fw.uu"		\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2561.fw"
 rt2561sfw.c			optional rt2561sfw | ralfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rt2561s.fw:rt2561sfw -mrt2561s -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rt2561sfw.c"
 rt2561sfw.fwo			optional rt2561sfw | ralfw		\
 	dependency	"rt2561s.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2561sfw.fwo"
 rt2561s.fw			optional rt2561sfw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2561s.fw.uu"		\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2561s.fw"
 rt2661fw.c			optional rt2661fw | ralfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rt2661.fw:rt2661fw -mrt2661 -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rt2661fw.c"
 rt2661fw.fwo			optional rt2661fw | ralfw		\
 	dependency	"rt2661.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2661fw.fwo"
 rt2661.fw			optional rt2661fw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2661.fw.uu"		\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2661.fw"
 rt2860fw.c			optional rt2860fw | ralfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rt2860.fw:rt2860fw -mrt2860 -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rt2860fw.c"
 rt2860fw.fwo			optional rt2860fw | ralfw		\
 	dependency	"rt2860.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2860fw.fwo"
 rt2860.fw			optional rt2860fw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2860.fw.uu"		\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2860.fw"
 dev/random/random_infra.c	optional random
 dev/random/random_harvestq.c	optional random
 dev/random/randomdev.c		optional random
 dev/random/fortuna.c		optional random !random_loadable
 dev/random/hash.c		optional random
 dev/rc/rc.c			optional rc
 dev/rccgpio/rccgpio.c		optional rccgpio gpio
 dev/re/if_re.c			optional re
 dev/rl/if_rl.c			optional rl pci
 dev/rndtest/rndtest.c		optional rndtest
 dev/rp/rp.c			optional rp
 dev/rp/rp_isa.c			optional rp isa
 dev/rp/rp_pci.c			optional rp pci
 #
 dev/rtwn/if_rtwn.c		optional rtwn
 dev/rtwn/if_rtwn_beacon.c	optional rtwn
 dev/rtwn/if_rtwn_calib.c	optional rtwn
 dev/rtwn/if_rtwn_cam.c		optional rtwn
 dev/rtwn/if_rtwn_efuse.c	optional rtwn
 dev/rtwn/if_rtwn_fw.c		optional rtwn
 dev/rtwn/if_rtwn_rx.c		optional rtwn
 dev/rtwn/if_rtwn_task.c		optional rtwn
 dev/rtwn/if_rtwn_tx.c		optional rtwn
 #
 dev/rtwn/pci/rtwn_pci_attach.c	optional rtwn_pci pci
 dev/rtwn/pci/rtwn_pci_reg.c	optional rtwn_pci pci
 dev/rtwn/pci/rtwn_pci_rx.c	optional rtwn_pci pci
 dev/rtwn/pci/rtwn_pci_tx.c	optional rtwn_pci pci
 #
 dev/rtwn/usb/rtwn_usb_attach.c	optional rtwn_usb
 dev/rtwn/usb/rtwn_usb_ep.c	optional rtwn_usb
 dev/rtwn/usb/rtwn_usb_reg.c	optional rtwn_usb
 dev/rtwn/usb/rtwn_usb_rx.c	optional rtwn_usb
 dev/rtwn/usb/rtwn_usb_tx.c	optional rtwn_usb
 # RTL8188E
 dev/rtwn/rtl8188e/r88e_beacon.c	optional rtwn
 dev/rtwn/rtl8188e/r88e_calib.c	optional rtwn
 dev/rtwn/rtl8188e/r88e_chan.c	optional rtwn
 dev/rtwn/rtl8188e/r88e_fw.c	optional rtwn
 dev/rtwn/rtl8188e/r88e_init.c	optional rtwn
 dev/rtwn/rtl8188e/r88e_led.c	optional rtwn
 dev/rtwn/rtl8188e/r88e_tx.c	optional rtwn
 dev/rtwn/rtl8188e/r88e_rf.c	optional rtwn
 dev/rtwn/rtl8188e/r88e_rom.c	optional rtwn
 dev/rtwn/rtl8188e/r88e_rx.c	optional rtwn
 dev/rtwn/rtl8188e/pci/r88ee_attach.c	optional rtwn_pci pci
 dev/rtwn/rtl8188e/pci/r88ee_init.c	optional rtwn_pci pci
 dev/rtwn/rtl8188e/pci/r88ee_rx.c	optional rtwn_pci pci
 dev/rtwn/rtl8188e/usb/r88eu_attach.c	optional rtwn_usb
 dev/rtwn/rtl8188e/usb/r88eu_init.c	optional rtwn_usb
 # RTL8192C
 dev/rtwn/rtl8192c/r92c_attach.c	optional rtwn
 dev/rtwn/rtl8192c/r92c_beacon.c	optional rtwn
 dev/rtwn/rtl8192c/r92c_calib.c	optional rtwn
 dev/rtwn/rtl8192c/r92c_chan.c	optional rtwn
 dev/rtwn/rtl8192c/r92c_fw.c	optional rtwn
 dev/rtwn/rtl8192c/r92c_init.c	optional rtwn
 dev/rtwn/rtl8192c/r92c_llt.c	optional rtwn
 dev/rtwn/rtl8192c/r92c_rf.c	optional rtwn
 dev/rtwn/rtl8192c/r92c_rom.c	optional rtwn
 dev/rtwn/rtl8192c/r92c_rx.c	optional rtwn
 dev/rtwn/rtl8192c/r92c_tx.c	optional rtwn
 dev/rtwn/rtl8192c/pci/r92ce_attach.c	optional rtwn_pci pci
 dev/rtwn/rtl8192c/pci/r92ce_calib.c	optional rtwn_pci pci
 dev/rtwn/rtl8192c/pci/r92ce_fw.c	optional rtwn_pci pci
 dev/rtwn/rtl8192c/pci/r92ce_init.c	optional rtwn_pci pci
 dev/rtwn/rtl8192c/pci/r92ce_led.c	optional rtwn_pci pci
 dev/rtwn/rtl8192c/pci/r92ce_rx.c	optional rtwn_pci pci
 dev/rtwn/rtl8192c/pci/r92ce_tx.c	optional rtwn_pci pci
 dev/rtwn/rtl8192c/usb/r92cu_attach.c	optional rtwn_usb
 dev/rtwn/rtl8192c/usb/r92cu_init.c	optional rtwn_usb
 dev/rtwn/rtl8192c/usb/r92cu_led.c	optional rtwn_usb
 dev/rtwn/rtl8192c/usb/r92cu_rx.c	optional rtwn_usb
 dev/rtwn/rtl8192c/usb/r92cu_tx.c	optional rtwn_usb
 # RTL8192E
 dev/rtwn/rtl8192e/r92e_chan.c	optional rtwn
 dev/rtwn/rtl8192e/r92e_fw.c	optional rtwn
 dev/rtwn/rtl8192e/r92e_init.c	optional rtwn
 dev/rtwn/rtl8192e/r92e_led.c	optional rtwn
 dev/rtwn/rtl8192e/r92e_rf.c	optional rtwn
 dev/rtwn/rtl8192e/r92e_rom.c	optional rtwn
 dev/rtwn/rtl8192e/r92e_rx.c	optional rtwn
 dev/rtwn/rtl8192e/usb/r92eu_attach.c	optional rtwn_usb
 dev/rtwn/rtl8192e/usb/r92eu_init.c	optional rtwn_usb
 # RTL8812A
 dev/rtwn/rtl8812a/r12a_beacon.c	optional rtwn
 dev/rtwn/rtl8812a/r12a_calib.c	optional rtwn
 dev/rtwn/rtl8812a/r12a_caps.c	optional rtwn
 dev/rtwn/rtl8812a/r12a_chan.c	optional rtwn
 dev/rtwn/rtl8812a/r12a_fw.c	optional rtwn
 dev/rtwn/rtl8812a/r12a_init.c	optional rtwn
 dev/rtwn/rtl8812a/r12a_led.c	optional rtwn
 dev/rtwn/rtl8812a/r12a_rf.c	optional rtwn
 dev/rtwn/rtl8812a/r12a_rom.c	optional rtwn
 dev/rtwn/rtl8812a/r12a_rx.c	optional rtwn
 dev/rtwn/rtl8812a/r12a_tx.c	optional rtwn
 dev/rtwn/rtl8812a/usb/r12au_attach.c	optional rtwn_usb
 dev/rtwn/rtl8812a/usb/r12au_init.c	optional rtwn_usb
 dev/rtwn/rtl8812a/usb/r12au_rx.c	optional rtwn_usb
 dev/rtwn/rtl8812a/usb/r12au_tx.c	optional rtwn_usb
 # RTL8821A
 dev/rtwn/rtl8821a/r21a_beacon.c	optional rtwn
 dev/rtwn/rtl8821a/r21a_calib.c	optional rtwn
 dev/rtwn/rtl8821a/r21a_chan.c	optional rtwn
 dev/rtwn/rtl8821a/r21a_fw.c	optional rtwn
 dev/rtwn/rtl8821a/r21a_init.c	optional rtwn
 dev/rtwn/rtl8821a/r21a_led.c	optional rtwn
 dev/rtwn/rtl8821a/r21a_rom.c	optional rtwn
 dev/rtwn/rtl8821a/r21a_rx.c	optional rtwn
 dev/rtwn/rtl8821a/usb/r21au_attach.c	optional rtwn_usb
 dev/rtwn/rtl8821a/usb/r21au_dfs.c	optional rtwn_usb
 dev/rtwn/rtl8821a/usb/r21au_init.c	optional rtwn_usb
 rtwn-rtl8188eefw.c		optional rtwn-rtl8188eefw | rtwnfw	\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8188eefw.fw:rtwn-rtl8188eefw:111 -mrtwn-rtl8188eefw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rtwn-rtl8188eefw.c"
 rtwn-rtl8188eefw.fwo		optional rtwn-rtl8188eefw | rtwnfw	\
 	dependency	"rtwn-rtl8188eefw.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rtwn-rtl8188eefw.fwo"
 rtwn-rtl8188eefw.fw		optional rtwn-rtl8188eefw | rtwnfw	\
 	dependency	"$S/contrib/dev/rtwn/rtwn-rtl8188eefw.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rtwn-rtl8188eefw.fw"
 rtwn-rtl8188eufw.c		optional rtwn-rtl8188eufw | rtwnfw	\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8188eufw.fw:rtwn-rtl8188eufw:111 -mrtwn-rtl8188eufw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rtwn-rtl8188eufw.c"
 rtwn-rtl8188eufw.fwo		optional rtwn-rtl8188eufw | rtwnfw	\
 	dependency	"rtwn-rtl8188eufw.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rtwn-rtl8188eufw.fwo"
 rtwn-rtl8188eufw.fw		optional rtwn-rtl8188eufw | rtwnfw	\
 	dependency	"$S/contrib/dev/rtwn/rtwn-rtl8188eufw.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rtwn-rtl8188eufw.fw"
 rtwn-rtl8192cfwE.c		optional rtwn-rtl8192cfwE | rtwnfw	\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8192cfwE.fw:rtwn-rtl8192cfwE:111 -mrtwn-rtl8192cfwE -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rtwn-rtl8192cfwE.c"
 rtwn-rtl8192cfwE.fwo		optional rtwn-rtl8192cfwE | rtwnfw	\
 	dependency	"rtwn-rtl8192cfwE.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rtwn-rtl8192cfwE.fwo"
 rtwn-rtl8192cfwE.fw		optional rtwn-rtl8192cfwE | rtwnfw	\
 	dependency	"$S/contrib/dev/rtwn/rtwn-rtl8192cfwE.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rtwn-rtl8192cfwE.fw"
 rtwn-rtl8192cfwE_B.c		optional rtwn-rtl8192cfwE_B | rtwnfw	\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8192cfwE_B.fw:rtwn-rtl8192cfwE_B:111 -mrtwn-rtl8192cfwE_B -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rtwn-rtl8192cfwE_B.c"
 rtwn-rtl8192cfwE_B.fwo		optional rtwn-rtl8192cfwE_B | rtwnfw	\
 	dependency	"rtwn-rtl8192cfwE_B.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rtwn-rtl8192cfwE_B.fwo"
 rtwn-rtl8192cfwE_B.fw		optional rtwn-rtl8192cfwE_B | rtwnfw	\
 	dependency	"$S/contrib/dev/rtwn/rtwn-rtl8192cfwE_B.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rtwn-rtl8192cfwE_B.fw"
 rtwn-rtl8192cfwT.c		optional rtwn-rtl8192cfwT | rtwnfw	\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8192cfwT.fw:rtwn-rtl8192cfwT:111 -mrtwn-rtl8192cfwT -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rtwn-rtl8192cfwT.c"
 rtwn-rtl8192cfwT.fwo		optional rtwn-rtl8192cfwT | rtwnfw	\
 	dependency	"rtwn-rtl8192cfwT.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rtwn-rtl8192cfwT.fwo"
 rtwn-rtl8192cfwT.fw		optional rtwn-rtl8192cfwT | rtwnfw	\
 	dependency	"$S/contrib/dev/rtwn/rtwn-rtl8192cfwT.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rtwn-rtl8192cfwT.fw"
 rtwn-rtl8192cfwU.c		optional rtwn-rtl8192cfwU | rtwnfw	\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8192cfwU.fw:rtwn-rtl8192cfwU:111 -mrtwn-rtl8192cfwU -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rtwn-rtl8192cfwU.c"
 rtwn-rtl8192cfwU.fwo		optional rtwn-rtl8192cfwU | rtwnfw	\
 	dependency	"rtwn-rtl8192cfwU.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rtwn-rtl8192cfwU.fwo"
 rtwn-rtl8192cfwU.fw		optional rtwn-rtl8192cfwU | rtwnfw	\
 	dependency	"$S/contrib/dev/rtwn/rtwn-rtl8192cfwU.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rtwn-rtl8192cfwU.fw"
 rtwn-rtl8192eufw.c		optional rtwn-rtl8192eufw | rtwnfw	\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8192eufw.fw:rtwn-rtl8192eufw:111 -mrtwn-rtl8192eufw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rtwn-rtl8192eufw.c"
 rtwn-rtl8192eufw.fwo		optional rtwn-rtl8192eufw | rtwnfw	\
 	dependency	"rtwn-rtl8192eufw.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rtwn-rtl8192eufw.fwo"
 rtwn-rtl8192eufw.fw		optional rtwn-rtl8192eufw | rtwnfw	\
 	dependency	"$S/contrib/dev/rtwn/rtwn-rtl8192eufw.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rtwn-rtl8192eufw.fw"
 rtwn-rtl8812aufw.c		optional rtwn-rtl8812aufw | rtwnfw	\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8812aufw.fw:rtwn-rtl8812aufw:111 -mrtwn-rtl8812aufw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rtwn-rtl8812aufw.c"
 rtwn-rtl8812aufw.fwo		optional rtwn-rtl8812aufw | rtwnfw	\
 	dependency	"rtwn-rtl8812aufw.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rtwn-rtl8812aufw.fwo"
 rtwn-rtl8812aufw.fw		optional rtwn-rtl8812aufw | rtwnfw	\
 	dependency	"$S/contrib/dev/rtwn/rtwn-rtl8812aufw.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rtwn-rtl8812aufw.fw"
 rtwn-rtl8821aufw.c		optional rtwn-rtl8821aufw | rtwnfw	\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8821aufw.fw:rtwn-rtl8821aufw:111 -mrtwn-rtl8821aufw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rtwn-rtl8821aufw.c"
 rtwn-rtl8821aufw.fwo		optional rtwn-rtl8821aufw | rtwnfw	\
 	dependency	"rtwn-rtl8821aufw.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rtwn-rtl8821aufw.fwo"
 rtwn-rtl8821aufw.fw		optional rtwn-rtl8821aufw | rtwnfw	\
 	dependency	"$S/contrib/dev/rtwn/rtwn-rtl8821aufw.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rtwn-rtl8821aufw.fw"
 dev/safe/safe.c			optional safe
 dev/scc/scc_if.m		optional scc
 dev/scc/scc_bfe_ebus.c		optional scc ebus
 dev/scc/scc_bfe_quicc.c		optional scc quicc
 dev/scc/scc_bfe_sbus.c		optional scc fhc | scc sbus
 dev/scc/scc_core.c		optional scc
 dev/scc/scc_dev_quicc.c		optional scc quicc
 dev/scc/scc_dev_sab82532.c	optional scc
 dev/scc/scc_dev_z8530.c		optional scc
 dev/sdhci/sdhci.c		optional sdhci
 dev/sdhci/sdhci_fdt.c		optional sdhci fdt
 dev/sdhci/sdhci_fdt_gpio.c	optional sdhci fdt gpio
 dev/sdhci/sdhci_if.m		optional sdhci
 dev/sdhci/sdhci_acpi.c		optional sdhci acpi
 dev/sdhci/sdhci_pci.c		optional sdhci pci
 dev/sf/if_sf.c			optional sf pci
 dev/sge/if_sge.c		optional sge pci
 dev/siis/siis.c			optional siis pci
 dev/sis/if_sis.c		optional sis pci
 dev/sk/if_sk.c			optional sk pci
 dev/smbus/smb.c			optional smb
 dev/smbus/smbconf.c		optional smbus
 dev/smbus/smbus.c		optional smbus
 dev/smbus/smbus_if.m		optional smbus
 dev/smc/if_smc.c		optional smc
 dev/smc/if_smc_fdt.c		optional smc fdt
 dev/sn/if_sn.c			optional sn
 dev/sn/if_sn_isa.c		optional sn isa
 dev/sn/if_sn_pccard.c		optional sn pccard
 dev/snp/snp.c			optional snp
 dev/sound/clone.c		optional sound
 dev/sound/unit.c		optional sound
 dev/sound/isa/ad1816.c		optional snd_ad1816 isa
 dev/sound/isa/ess.c		optional snd_ess isa
 dev/sound/isa/gusc.c		optional snd_gusc isa
 dev/sound/isa/mss.c		optional snd_mss isa
 dev/sound/isa/sb16.c		optional snd_sb16 isa
 dev/sound/isa/sb8.c		optional snd_sb8 isa
 dev/sound/isa/sbc.c		optional snd_sbc isa
 dev/sound/isa/sndbuf_dma.c	optional sound isa
 dev/sound/pci/als4000.c		optional snd_als4000 pci
 dev/sound/pci/atiixp.c		optional snd_atiixp pci
 dev/sound/pci/cmi.c		optional snd_cmi pci
 dev/sound/pci/cs4281.c		optional snd_cs4281 pci
 dev/sound/pci/csa.c		optional snd_csa pci
 dev/sound/pci/csapcm.c		optional snd_csa pci
 dev/sound/pci/ds1.c		optional snd_ds1 pci
 dev/sound/pci/emu10k1.c		optional snd_emu10k1 pci
 dev/sound/pci/emu10kx.c		optional snd_emu10kx pci
 dev/sound/pci/emu10kx-pcm.c	optional snd_emu10kx pci
 dev/sound/pci/emu10kx-midi.c	optional snd_emu10kx pci
 dev/sound/pci/envy24.c		optional snd_envy24 pci
 dev/sound/pci/envy24ht.c	optional snd_envy24ht pci
 dev/sound/pci/es137x.c		optional snd_es137x pci
 dev/sound/pci/fm801.c		optional snd_fm801 pci
 dev/sound/pci/ich.c		optional snd_ich pci
 dev/sound/pci/maestro.c		optional snd_maestro pci
 dev/sound/pci/maestro3.c	optional snd_maestro3 pci
 dev/sound/pci/neomagic.c	optional snd_neomagic pci
 dev/sound/pci/solo.c		optional snd_solo pci
 dev/sound/pci/spicds.c		optional snd_spicds pci
 dev/sound/pci/t4dwave.c		optional snd_t4dwave pci
 dev/sound/pci/via8233.c		optional snd_via8233 pci
 dev/sound/pci/via82c686.c	optional snd_via82c686 pci
 dev/sound/pci/vibes.c		optional snd_vibes pci
 dev/sound/pci/hda/hdaa.c	optional snd_hda pci
 dev/sound/pci/hda/hdaa_patches.c	optional snd_hda pci
 dev/sound/pci/hda/hdac.c	optional snd_hda pci
 dev/sound/pci/hda/hdac_if.m	optional snd_hda pci
 dev/sound/pci/hda/hdacc.c	optional snd_hda pci
 dev/sound/pci/hdspe.c		optional snd_hdspe pci
 dev/sound/pci/hdspe-pcm.c	optional snd_hdspe pci
 dev/sound/pcm/ac97.c		optional sound
 dev/sound/pcm/ac97_if.m		optional sound
 dev/sound/pcm/ac97_patch.c	optional sound
 dev/sound/pcm/buffer.c		optional sound	\
 	dependency	"snd_fxdiv_gen.h"
 dev/sound/pcm/channel.c		optional sound
 dev/sound/pcm/channel_if.m	optional sound
 dev/sound/pcm/dsp.c		optional sound
 dev/sound/pcm/feeder.c		optional sound
 dev/sound/pcm/feeder_chain.c	optional sound
 dev/sound/pcm/feeder_eq.c	optional sound	\
 	dependency	"feeder_eq_gen.h"	\
 	dependency	"snd_fxdiv_gen.h"
 dev/sound/pcm/feeder_if.m	optional sound
 dev/sound/pcm/feeder_format.c	optional sound  \
 	dependency	"snd_fxdiv_gen.h"
 dev/sound/pcm/feeder_matrix.c	optional sound  \
 	dependency	"snd_fxdiv_gen.h"
 dev/sound/pcm/feeder_mixer.c	optional sound  \
 	dependency	"snd_fxdiv_gen.h"
 dev/sound/pcm/feeder_rate.c	optional sound	\
 	dependency	"feeder_rate_gen.h"	\
 	dependency	"snd_fxdiv_gen.h"
 dev/sound/pcm/feeder_volume.c	optional sound  \
 	dependency	"snd_fxdiv_gen.h"
 dev/sound/pcm/mixer.c		optional sound
 dev/sound/pcm/mixer_if.m	optional sound
 dev/sound/pcm/sndstat.c		optional sound
 dev/sound/pcm/sound.c		optional sound
 dev/sound/pcm/vchan.c		optional sound
 dev/sound/usb/uaudio.c		optional snd_uaudio usb
 dev/sound/usb/uaudio_pcm.c	optional snd_uaudio usb
 dev/sound/midi/midi.c		optional sound
 dev/sound/midi/mpu401.c		optional sound
 dev/sound/midi/mpu_if.m		optional sound
 dev/sound/midi/mpufoi_if.m	optional sound
 dev/sound/midi/sequencer.c	optional sound
 dev/sound/midi/synth_if.m	optional sound
 dev/spibus/ofw_spibus.c		optional fdt spibus
 dev/spibus/spibus.c		optional spibus				\
 	dependency	"spibus_if.h"
 dev/spibus/spigen.c		optional spigen
 dev/spibus/spibus_if.m		optional spibus
 dev/ste/if_ste.c		optional ste pci
 dev/stg/tmc18c30.c		optional stg
 dev/stg/tmc18c30_isa.c		optional stg isa
 dev/stg/tmc18c30_pccard.c	optional stg pccard
 dev/stg/tmc18c30_pci.c		optional stg pci
 dev/stg/tmc18c30_subr.c		optional stg
 dev/stge/if_stge.c		optional stge
 dev/sym/sym_hipd.c		optional sym				\
 	dependency	"$S/dev/sym/sym_{conf,defs}.h"
 dev/syscons/blank/blank_saver.c	optional blank_saver
 dev/syscons/daemon/daemon_saver.c optional daemon_saver
 dev/syscons/dragon/dragon_saver.c optional dragon_saver
 dev/syscons/fade/fade_saver.c	optional fade_saver
 dev/syscons/fire/fire_saver.c	optional fire_saver
 dev/syscons/green/green_saver.c	optional green_saver
 dev/syscons/logo/logo.c		optional logo_saver
 dev/syscons/logo/logo_saver.c	optional logo_saver
 dev/syscons/rain/rain_saver.c	optional rain_saver
 dev/syscons/schistory.c		optional sc
 dev/syscons/scmouse.c		optional sc
 dev/syscons/scterm.c		optional sc
 dev/syscons/scvidctl.c		optional sc
 dev/syscons/snake/snake_saver.c	optional snake_saver
 dev/syscons/star/star_saver.c	optional star_saver
 dev/syscons/syscons.c		optional sc
 dev/syscons/sysmouse.c		optional sc
 dev/syscons/warp/warp_saver.c	optional warp_saver
 dev/tcp_log/tcp_log_dev.c	optional tcp_blackbox inet | tcp_blackbox inet6
 dev/tdfx/tdfx_linux.c		optional tdfx_linux tdfx compat_linux
 dev/tdfx/tdfx_pci.c		optional tdfx pci
 dev/ti/if_ti.c			optional ti pci
 dev/tl/if_tl.c			optional tl pci
 dev/trm/trm.c			optional trm
 dev/twa/tw_cl_init.c		optional twa \
 	compile-with "${NORMAL_C} -I$S/dev/twa"
 dev/twa/tw_cl_intr.c		optional twa \
 	compile-with "${NORMAL_C} -I$S/dev/twa"
 dev/twa/tw_cl_io.c		optional twa \
 	compile-with "${NORMAL_C} -I$S/dev/twa"
 dev/twa/tw_cl_misc.c		optional twa \
 	compile-with "${NORMAL_C} -I$S/dev/twa"
 dev/twa/tw_osl_cam.c		optional twa \
 	compile-with "${NORMAL_C} -I$S/dev/twa"
 dev/twa/tw_osl_freebsd.c	optional twa \
 	compile-with "${NORMAL_C} -I$S/dev/twa"
 dev/twe/twe.c			optional twe
 dev/twe/twe_freebsd.c		optional twe
 dev/tws/tws.c			optional tws
 dev/tws/tws_cam.c		optional tws
 dev/tws/tws_hdm.c		optional tws
 dev/tws/tws_services.c		optional tws
 dev/tws/tws_user.c		optional tws
 dev/tx/if_tx.c			optional tx
 dev/txp/if_txp.c		optional txp
 dev/uart/uart_bus_acpi.c	optional uart acpi
 dev/uart/uart_bus_ebus.c	optional uart ebus
 dev/uart/uart_bus_fdt.c		optional uart fdt
 dev/uart/uart_bus_isa.c		optional uart isa
 dev/uart/uart_bus_pccard.c	optional uart pccard
 dev/uart/uart_bus_pci.c		optional uart pci
 dev/uart/uart_bus_puc.c		optional uart puc
 dev/uart/uart_bus_scc.c		optional uart scc
 dev/uart/uart_core.c		optional uart
 dev/uart/uart_cpu_acpi.c	optional uart acpi
 dev/uart/uart_dbg.c		optional uart gdb
 dev/uart/uart_dev_msm.c		optional uart uart_msm fdt
 dev/uart/uart_dev_mvebu.c	optional uart uart_mvebu
 dev/uart/uart_dev_ns8250.c	optional uart uart_ns8250 | uart uart_snps
 dev/uart/uart_dev_pl011.c	optional uart pl011
 dev/uart/uart_dev_quicc.c	optional uart quicc
 dev/uart/uart_dev_sab82532.c	optional uart uart_sab82532
 dev/uart/uart_dev_sab82532.c	optional uart scc
 dev/uart/uart_dev_snps.c	optional uart uart_snps fdt
 dev/uart/uart_dev_z8530.c	optional uart uart_z8530
 dev/uart/uart_dev_z8530.c	optional uart scc
 dev/uart/uart_if.m		optional uart
 dev/uart/uart_subr.c		optional uart
 dev/uart/uart_tty.c		optional uart
 dev/ubsec/ubsec.c		optional ubsec
 #
 # USB controller drivers
 #
 dev/usb/controller/musb_otg.c		optional musb
 dev/usb/controller/dwc_otg.c		optional dwcotg
 dev/usb/controller/dwc_otg_fdt.c	optional dwcotg fdt
 dev/usb/controller/ehci.c		optional ehci
 dev/usb/controller/ehci_msm.c		optional ehci_msm fdt
 dev/usb/controller/ehci_pci.c		optional ehci pci
 dev/usb/controller/ohci.c		optional ohci
 dev/usb/controller/ohci_pci.c		optional ohci pci
 dev/usb/controller/uhci.c		optional uhci
 dev/usb/controller/uhci_pci.c		optional uhci pci
 dev/usb/controller/xhci.c		optional xhci
 dev/usb/controller/xhci_pci.c		optional xhci pci
 dev/usb/controller/saf1761_otg.c	optional saf1761otg
 dev/usb/controller/saf1761_otg_fdt.c	optional saf1761otg fdt
 dev/usb/controller/uss820dci.c		optional uss820dci
 dev/usb/controller/usb_controller.c	optional usb
 #
 # USB storage drivers
 #
 dev/usb/storage/cfumass.c	optional cfumass ctl
 dev/usb/storage/umass.c		optional umass
 dev/usb/storage/urio.c		optional urio
 dev/usb/storage/ustorage_fs.c	optional usfs
 #
 # USB core
 #
 dev/usb/usb_busdma.c		optional usb
 dev/usb/usb_core.c		optional usb
 dev/usb/usb_debug.c		optional usb
 dev/usb/usb_dev.c		optional usb
 dev/usb/usb_device.c		optional usb
 dev/usb/usb_dynamic.c		optional usb
 dev/usb/usb_error.c		optional usb
 dev/usb/usb_fdt_support.c	optional usb fdt
 dev/usb/usb_generic.c		optional usb
 dev/usb/usb_handle_request.c	optional usb
 dev/usb/usb_hid.c		optional usb
 dev/usb/usb_hub.c		optional usb
 dev/usb/usb_if.m		optional usb
 dev/usb/usb_lookup.c		optional usb
 dev/usb/usb_mbuf.c		optional usb
 dev/usb/usb_msctest.c		optional usb
 dev/usb/usb_parse.c		optional usb
 dev/usb/usb_pf.c		optional usb
 dev/usb/usb_process.c		optional usb
 dev/usb/usb_request.c		optional usb
 dev/usb/usb_transfer.c		optional usb
 dev/usb/usb_util.c		optional usb
 #
 # USB network drivers
 #
 dev/usb/net/if_aue.c		optional aue
 dev/usb/net/if_axe.c		optional axe
 dev/usb/net/if_axge.c		optional axge
 dev/usb/net/if_cdce.c		optional cdce
 dev/usb/net/if_cdceem.c		optional cdceem
 dev/usb/net/if_cue.c		optional cue
 dev/usb/net/if_ipheth.c		optional ipheth
 dev/usb/net/if_kue.c		optional kue
 dev/usb/net/if_mos.c		optional mos
 dev/usb/net/if_muge.c		optional muge
 dev/usb/net/if_rue.c		optional rue
 dev/usb/net/if_smsc.c		optional smsc
 dev/usb/net/if_udav.c		optional udav
 dev/usb/net/if_ure.c		optional ure
 dev/usb/net/if_usie.c		optional usie
 dev/usb/net/if_urndis.c		optional urndis
 dev/usb/net/ruephy.c		optional rue
 dev/usb/net/usb_ethernet.c	optional uether | aue | axe | axge | cdce | \
 					 cdceem | cue | ipheth | kue | mos | \
 					 rue | smsc | udav | ure | urndis
 dev/usb/net/uhso.c		optional uhso
 #
 # USB WLAN drivers
 #
 dev/usb/wlan/if_rsu.c		optional rsu
 rsu-rtl8712fw.c			optional rsu-rtl8712fw | rsufw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk rsu-rtl8712fw.fw:rsu-rtl8712fw:120 -mrsu-rtl8712fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"rsu-rtl8712fw.c"
 rsu-rtl8712fw.fwo		optional rsu-rtl8712fw | rsufw		\
 	dependency	"rsu-rtl8712fw.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rsu-rtl8712fw.fwo"
 rsu-rtl8712fw.fw		optional rsu-rtl8712.fw | rsufw		\
 	dependency	"$S/contrib/dev/rsu/rsu-rtl8712fw.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rsu-rtl8712fw.fw"
 dev/usb/wlan/if_rum.c		optional rum
 dev/usb/wlan/if_run.c		optional run
 runfw.c				optional runfw							\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk run.fw:runfw -mrunfw -c${.TARGET}"	\
 	no-implicit-rule before-depend local							\
 	clean		"runfw.c"
 runfw.fwo			optional runfw							\
 	dependency	"run.fw"								\
 	compile-with	"${NORMAL_FWO}"								\
 	no-implicit-rule									\
 	clean		"runfw.fwo"
 run.fw				optional runfw							\
 	dependency	"$S/contrib/dev/run/rt2870.fw.uu"					\
 	compile-with	"${NORMAL_FW}"								\
 	no-obj no-implicit-rule									\
 	clean		"run.fw"
 dev/usb/wlan/if_uath.c		optional uath
 dev/usb/wlan/if_upgt.c		optional upgt
 dev/usb/wlan/if_ural.c		optional ural
 dev/usb/wlan/if_urtw.c		optional urtw
 dev/usb/wlan/if_zyd.c		optional zyd
 #
 # USB serial and parallel port drivers
 #
 dev/usb/serial/u3g.c		optional u3g
 dev/usb/serial/uark.c		optional uark
 dev/usb/serial/ubsa.c		optional ubsa
 dev/usb/serial/ubser.c		optional ubser
 dev/usb/serial/uchcom.c		optional uchcom
 dev/usb/serial/ucycom.c		optional ucycom
 dev/usb/serial/ufoma.c		optional ufoma
 dev/usb/serial/uftdi.c		optional uftdi
 dev/usb/serial/ugensa.c		optional ugensa
 dev/usb/serial/uipaq.c		optional uipaq
 dev/usb/serial/ulpt.c		optional ulpt
 dev/usb/serial/umcs.c		optional umcs
 dev/usb/serial/umct.c		optional umct
 dev/usb/serial/umodem.c		optional umodem
 dev/usb/serial/umoscom.c	optional umoscom
 dev/usb/serial/uplcom.c		optional uplcom
 dev/usb/serial/uslcom.c		optional uslcom
 dev/usb/serial/uvisor.c		optional uvisor
 dev/usb/serial/uvscom.c		optional uvscom
 dev/usb/serial/usb_serial.c 	optional ucom | u3g | uark | ubsa | ubser | \
 					 uchcom | ucycom | ufoma | uftdi | \
 					 ugensa | uipaq | umcs | umct | \
 					 umodem | umoscom | uplcom | usie | \
 					 uslcom | uvisor | uvscom
 #
 # USB misc drivers
 #
 dev/usb/misc/ufm.c		optional ufm
 dev/usb/misc/udbp.c		optional udbp
 dev/usb/misc/ugold.c		optional ugold
 dev/usb/misc/uled.c		optional uled
 #
 # USB input drivers
 #
 dev/usb/input/atp.c		optional atp
 dev/usb/input/uep.c		optional uep
 dev/usb/input/uhid.c		optional uhid
 dev/usb/input/uhid_snes.c	optional uhid_snes
 dev/usb/input/ukbd.c		optional ukbd
 dev/usb/input/ums.c		optional ums
 dev/usb/input/wmt.c		optional wmt
 dev/usb/input/wsp.c		optional wsp
 #
 # USB quirks
 #
 dev/usb/quirk/usb_quirk.c	optional usb
 #
 # USB templates
 #
 dev/usb/template/usb_template.c		optional usb_template
 dev/usb/template/usb_template_audio.c	optional usb_template
 dev/usb/template/usb_template_cdce.c	optional usb_template
 dev/usb/template/usb_template_kbd.c	optional usb_template
 dev/usb/template/usb_template_modem.c	optional usb_template
 dev/usb/template/usb_template_mouse.c	optional usb_template
 dev/usb/template/usb_template_msc.c	optional usb_template
 dev/usb/template/usb_template_mtp.c	optional usb_template
 dev/usb/template/usb_template_phone.c	optional usb_template
 dev/usb/template/usb_template_serialnet.c	optional usb_template
 dev/usb/template/usb_template_midi.c	optional usb_template
 dev/usb/template/usb_template_multi.c	optional usb_template
 dev/usb/template/usb_template_cdceem.c	optional usb_template
 #
 # USB video drivers
 #
 dev/usb/video/udl.c			optional udl
 #
 # USB END
 #
 dev/videomode/videomode.c		optional videomode
 dev/videomode/edid.c			optional videomode
 dev/videomode/pickmode.c		optional videomode
 dev/videomode/vesagtf.c			optional videomode
 dev/veriexec/verified_exec.c	optional veriexec mac_veriexec
 dev/vge/if_vge.c		optional vge
 dev/viapm/viapm.c		optional viapm pci
 dev/virtio/virtio.c			optional	virtio
 dev/virtio/virtqueue.c			optional	virtio
 dev/virtio/virtio_bus_if.m		optional	virtio
 dev/virtio/virtio_if.m			optional	virtio
 dev/virtio/pci/virtio_pci.c		optional	virtio_pci
 dev/virtio/mmio/virtio_mmio.c		optional	virtio_mmio fdt
 dev/virtio/mmio/virtio_mmio_if.m	optional	virtio_mmio fdt
 dev/virtio/network/if_vtnet.c		optional	vtnet
 dev/virtio/block/virtio_blk.c		optional	virtio_blk
 dev/virtio/balloon/virtio_balloon.c	optional	virtio_balloon
 dev/virtio/scsi/virtio_scsi.c		optional	virtio_scsi
 dev/virtio/random/virtio_random.c	optional	virtio_random
 dev/virtio/console/virtio_console.c	optional	virtio_console
 dev/vkbd/vkbd.c			optional vkbd
 dev/vr/if_vr.c			optional vr pci
 dev/vt/colors/vt_termcolors.c	optional vt
 dev/vt/font/vt_font_default.c	optional vt
 dev/vt/font/vt_mouse_cursor.c	optional vt
 dev/vt/hw/efifb/efifb.c		optional vt_efifb
 dev/vt/hw/fb/vt_fb.c		optional vt
 dev/vt/hw/vga/vt_vga.c		optional vt vt_vga
 dev/vt/logo/logo_freebsd.c	optional vt splash
 dev/vt/logo/logo_beastie.c	optional vt splash
 dev/vt/vt_buf.c			optional vt
 dev/vt/vt_consolectl.c		optional vt
 dev/vt/vt_core.c		optional vt
 dev/vt/vt_cpulogos.c		optional vt splash
 dev/vt/vt_font.c		optional vt
 dev/vt/vt_sysmouse.c		optional vt
 dev/vte/if_vte.c		optional vte pci
 dev/vx/if_vx.c			optional vx
 dev/vx/if_vx_pci.c		optional vx pci
 dev/watchdog/watchdog.c		standard
 dev/wb/if_wb.c			optional wb pci
 dev/wi/if_wi.c			optional wi
 dev/wi/if_wi_pccard.c		optional wi pccard
 dev/wi/if_wi_pci.c		optional wi pci
 dev/wpi/if_wpi.c		optional wpi pci
 wpifw.c			optional wpifw					\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk wpi.fw:wpifw:153229 -mwpi -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
 	clean		"wpifw.c"
 wpifw.fwo			optional wpifw				\
 	dependency	"wpi.fw"					\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"wpifw.fwo"
 wpi.fw			optional wpifw					\
 	dependency	"$S/contrib/dev/wpi/iwlwifi-3945-15.32.2.9.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"wpi.fw"
 dev/xdma/controller/pl330.c	optional xdma pl330
 dev/xdma/xdma.c			optional xdma
 dev/xdma/xdma_bank.c		optional xdma
 dev/xdma/xdma_bio.c		optional xdma
 dev/xdma/xdma_fdt_test.c	optional xdma xdma_test fdt
 dev/xdma/xdma_if.m		optional xdma
 dev/xdma/xdma_mbuf.c		optional xdma
 dev/xdma/xdma_queue.c		optional xdma
 dev/xdma/xdma_sg.c		optional xdma
 dev/xdma/xdma_sglist.c		optional xdma
 dev/xe/if_xe.c			optional xe
 dev/xe/if_xe_pccard.c		optional xe pccard
 dev/xen/balloon/balloon.c	optional xenhvm
 dev/xen/blkfront/blkfront.c	optional xenhvm
 dev/xen/blkback/blkback.c	optional xenhvm
 dev/xen/console/xen_console.c	optional xenhvm
 dev/xen/control/control.c	optional xenhvm
 dev/xen/grant_table/grant_table.c	optional xenhvm
 dev/xen/netback/netback.c	optional xenhvm
 dev/xen/netfront/netfront.c	optional xenhvm
 dev/xen/xenpci/xenpci.c		optional xenpci
 dev/xen/timer/timer.c		optional xenhvm
 dev/xen/pvcpu/pvcpu.c		optional xenhvm
 dev/xen/xenstore/xenstore.c	optional xenhvm
 dev/xen/xenstore/xenstore_dev.c	optional xenhvm
 dev/xen/xenstore/xenstored_dev.c	optional xenhvm
 dev/xen/evtchn/evtchn_dev.c	optional xenhvm
 dev/xen/privcmd/privcmd.c	optional xenhvm
 dev/xen/gntdev/gntdev.c		optional xenhvm
 dev/xen/debug/debug.c		optional xenhvm
 dev/xl/if_xl.c			optional xl pci
 dev/xl/xlphy.c			optional xl pci
 fs/autofs/autofs.c		optional autofs
 fs/autofs/autofs_vfsops.c	optional autofs
 fs/autofs/autofs_vnops.c	optional autofs
 fs/deadfs/dead_vnops.c		standard
 fs/devfs/devfs_devs.c		standard
 fs/devfs/devfs_dir.c		standard
 fs/devfs/devfs_rule.c		standard
 fs/devfs/devfs_vfsops.c		standard
 fs/devfs/devfs_vnops.c		standard
 fs/fdescfs/fdesc_vfsops.c	optional fdescfs
 fs/fdescfs/fdesc_vnops.c	optional fdescfs
 fs/fifofs/fifo_vnops.c		standard
 fs/cuse/cuse.c			optional cuse
 fs/fuse/fuse_device.c		optional fusefs
 fs/fuse/fuse_file.c		optional fusefs
 fs/fuse/fuse_internal.c		optional fusefs
 fs/fuse/fuse_io.c		optional fusefs
 fs/fuse/fuse_ipc.c		optional fusefs
 fs/fuse/fuse_main.c		optional fusefs
 fs/fuse/fuse_node.c		optional fusefs
 fs/fuse/fuse_vfsops.c		optional fusefs
 fs/fuse/fuse_vnops.c		optional fusefs
 fs/msdosfs/msdosfs_conv.c	optional msdosfs
 fs/msdosfs/msdosfs_denode.c	optional msdosfs
 fs/msdosfs/msdosfs_fat.c	optional msdosfs
 fs/msdosfs/msdosfs_iconv.c	optional msdosfs_iconv
 fs/msdosfs/msdosfs_lookup.c	optional msdosfs
 fs/msdosfs/msdosfs_vfsops.c	optional msdosfs
 fs/msdosfs/msdosfs_vnops.c	optional msdosfs
 fs/nandfs/bmap.c		optional nandfs
 fs/nandfs/nandfs_alloc.c	optional nandfs
 fs/nandfs/nandfs_bmap.c		optional nandfs
 fs/nandfs/nandfs_buffer.c	optional nandfs
 fs/nandfs/nandfs_cleaner.c	optional nandfs
 fs/nandfs/nandfs_cpfile.c	optional nandfs
 fs/nandfs/nandfs_dat.c		optional nandfs
 fs/nandfs/nandfs_dir.c		optional nandfs
 fs/nandfs/nandfs_ifile.c	optional nandfs
 fs/nandfs/nandfs_segment.c	optional nandfs
 fs/nandfs/nandfs_subr.c		optional nandfs
 fs/nandfs/nandfs_sufile.c	optional nandfs
 fs/nandfs/nandfs_vfsops.c	optional nandfs
 fs/nandfs/nandfs_vnops.c	optional nandfs
 fs/nfs/nfs_commonkrpc.c		optional nfscl | nfsd
 fs/nfs/nfs_commonsubs.c		optional nfscl | nfsd
 fs/nfs/nfs_commonport.c		optional nfscl | nfsd
 fs/nfs/nfs_commonacl.c		optional nfscl | nfsd
 fs/nfsclient/nfs_clcomsubs.c	optional nfscl
 fs/nfsclient/nfs_clsubs.c	optional nfscl
 fs/nfsclient/nfs_clstate.c	optional nfscl
 fs/nfsclient/nfs_clkrpc.c	optional nfscl
 fs/nfsclient/nfs_clrpcops.c	optional nfscl
 fs/nfsclient/nfs_clvnops.c	optional nfscl
 fs/nfsclient/nfs_clnode.c	optional nfscl
 fs/nfsclient/nfs_clvfsops.c	optional nfscl
 fs/nfsclient/nfs_clport.c	optional nfscl
 fs/nfsclient/nfs_clbio.c	optional nfscl
 fs/nfsclient/nfs_clnfsiod.c	optional nfscl
 fs/nfsserver/nfs_fha_new.c	optional nfsd inet
 fs/nfsserver/nfs_nfsdsocket.c	optional nfsd inet
 fs/nfsserver/nfs_nfsdsubs.c	optional nfsd inet
 fs/nfsserver/nfs_nfsdstate.c	optional nfsd inet
 fs/nfsserver/nfs_nfsdkrpc.c	optional nfsd inet
 fs/nfsserver/nfs_nfsdserv.c	optional nfsd inet
 fs/nfsserver/nfs_nfsdport.c	optional nfsd inet
 fs/nfsserver/nfs_nfsdcache.c	optional nfsd inet
 fs/nullfs/null_subr.c		optional nullfs
 fs/nullfs/null_vfsops.c		optional nullfs
 fs/nullfs/null_vnops.c		optional nullfs
 fs/procfs/procfs.c		optional procfs
 fs/procfs/procfs_dbregs.c	optional procfs
 fs/procfs/procfs_fpregs.c	optional procfs
 fs/procfs/procfs_ioctl.c	optional procfs
 fs/procfs/procfs_map.c		optional procfs
 fs/procfs/procfs_mem.c		optional procfs
 fs/procfs/procfs_note.c		optional procfs
 fs/procfs/procfs_osrel.c	optional procfs
 fs/procfs/procfs_regs.c		optional procfs
 fs/procfs/procfs_rlimit.c	optional procfs
 fs/procfs/procfs_status.c	optional procfs
 fs/procfs/procfs_type.c		optional procfs
 fs/pseudofs/pseudofs.c		optional pseudofs
 fs/pseudofs/pseudofs_fileno.c	optional pseudofs
 fs/pseudofs/pseudofs_vncache.c	optional pseudofs
 fs/pseudofs/pseudofs_vnops.c	optional pseudofs
 fs/smbfs/smbfs_io.c		optional smbfs
 fs/smbfs/smbfs_node.c		optional smbfs
 fs/smbfs/smbfs_smb.c		optional smbfs
 fs/smbfs/smbfs_subr.c		optional smbfs
 fs/smbfs/smbfs_vfsops.c		optional smbfs
 fs/smbfs/smbfs_vnops.c		optional smbfs
 fs/udf/osta.c			optional udf
 fs/udf/udf_iconv.c		optional udf_iconv
 fs/udf/udf_vfsops.c		optional udf
 fs/udf/udf_vnops.c		optional udf
 fs/unionfs/union_subr.c		optional unionfs
 fs/unionfs/union_vfsops.c	optional unionfs
 fs/unionfs/union_vnops.c	optional unionfs
 fs/tmpfs/tmpfs_vnops.c		optional tmpfs
 fs/tmpfs/tmpfs_fifoops.c 	optional tmpfs
 fs/tmpfs/tmpfs_vfsops.c 	optional tmpfs
 fs/tmpfs/tmpfs_subr.c 		optional tmpfs
 gdb/gdb_cons.c			optional gdb
 gdb/gdb_main.c			optional gdb
 gdb/gdb_packet.c		optional gdb
 geom/bde/g_bde.c		optional geom_bde
 geom/bde/g_bde_crypt.c		optional geom_bde
 geom/bde/g_bde_lock.c		optional geom_bde
 geom/bde/g_bde_work.c		optional geom_bde
 geom/cache/g_cache.c		optional geom_cache
 geom/concat/g_concat.c		optional geom_concat
 geom/eli/g_eli.c		optional geom_eli
 geom/eli/g_eli_crypto.c		optional geom_eli
 geom/eli/g_eli_ctl.c		optional geom_eli
 geom/eli/g_eli_hmac.c		optional geom_eli
 geom/eli/g_eli_integrity.c	optional geom_eli
 geom/eli/g_eli_key.c		optional geom_eli
 geom/eli/g_eli_key_cache.c	optional geom_eli
 geom/eli/g_eli_privacy.c	optional geom_eli
 geom/eli/pkcs5v2.c		optional geom_eli
 geom/gate/g_gate.c		optional geom_gate
 geom/geom_bsd.c			optional geom_bsd
 geom/geom_bsd_enc.c		optional geom_bsd | geom_part_bsd
 geom/geom_ccd.c			optional ccd | geom_ccd
 geom/geom_ctl.c			standard
 geom/geom_dev.c			standard
 geom/geom_disk.c		standard
 geom/geom_dump.c		standard
 geom/geom_event.c		standard
 geom/geom_fox.c			optional geom_fox
 geom/geom_flashmap.c		optional fdt cfi | fdt nand | fdt mx25l | mmcsd | fdt n25q | fdt at45d
 geom/geom_io.c			standard
 geom/geom_kern.c		standard
 geom/geom_map.c			optional geom_map
 geom/geom_mbr.c			optional geom_mbr
 geom/geom_mbr_enc.c		optional geom_mbr
 geom/geom_redboot.c		optional geom_redboot
 geom/geom_slice.c		standard
 geom/geom_subr.c		standard
 geom/geom_sunlabel.c		optional geom_sunlabel
 geom/geom_sunlabel_enc.c	optional geom_sunlabel
 geom/geom_vfs.c			standard
 geom/geom_vol_ffs.c		optional geom_vol
 geom/journal/g_journal.c	optional geom_journal
 geom/journal/g_journal_ufs.c	optional geom_journal
 geom/label/g_label.c		optional geom_label | geom_label_gpt
 geom/label/g_label_ext2fs.c	optional geom_label
 geom/label/g_label_flashmap.c	optional geom_label
 geom/label/g_label_iso9660.c	optional geom_label
 geom/label/g_label_msdosfs.c	optional geom_label
 geom/label/g_label_ntfs.c	optional geom_label
 geom/label/g_label_reiserfs.c	optional geom_label
 geom/label/g_label_ufs.c	optional geom_label
 geom/label/g_label_gpt.c	optional geom_label | geom_label_gpt
 geom/label/g_label_disk_ident.c	optional geom_label
 geom/linux_lvm/g_linux_lvm.c	optional geom_linux_lvm
 geom/mirror/g_mirror.c		optional geom_mirror
 geom/mirror/g_mirror_ctl.c	optional geom_mirror
 geom/mountver/g_mountver.c	optional geom_mountver
 geom/multipath/g_multipath.c	optional geom_multipath
 geom/nop/g_nop.c		optional geom_nop
 geom/part/g_part.c		standard
 geom/part/g_part_if.m		standard
 geom/part/g_part_apm.c		optional geom_part_apm
 geom/part/g_part_bsd.c		optional geom_part_bsd
 geom/part/g_part_bsd64.c	optional geom_part_bsd64
 geom/part/g_part_ebr.c		optional geom_part_ebr
 geom/part/g_part_gpt.c		optional geom_part_gpt
 geom/part/g_part_ldm.c		optional geom_part_ldm
 geom/part/g_part_mbr.c		optional geom_part_mbr
 geom/part/g_part_vtoc8.c	optional geom_part_vtoc8
 geom/raid/g_raid.c		optional geom_raid
 geom/raid/g_raid_ctl.c		optional geom_raid
 geom/raid/g_raid_md_if.m	optional geom_raid
 geom/raid/g_raid_tr_if.m	optional geom_raid
 geom/raid/md_ddf.c		optional geom_raid
 geom/raid/md_intel.c		optional geom_raid
 geom/raid/md_jmicron.c		optional geom_raid
 geom/raid/md_nvidia.c		optional geom_raid
 geom/raid/md_promise.c		optional geom_raid
 geom/raid/md_sii.c		optional geom_raid
 geom/raid/tr_concat.c		optional geom_raid
 geom/raid/tr_raid0.c		optional geom_raid
 geom/raid/tr_raid1.c		optional geom_raid
 geom/raid/tr_raid1e.c		optional geom_raid
 geom/raid/tr_raid5.c		optional geom_raid
 geom/raid3/g_raid3.c		optional geom_raid3
 geom/raid3/g_raid3_ctl.c	optional geom_raid3
 geom/shsec/g_shsec.c		optional geom_shsec
 geom/stripe/g_stripe.c		optional geom_stripe
 geom/uzip/g_uzip.c		optional geom_uzip
 geom/uzip/g_uzip_lzma.c		optional geom_uzip
 geom/uzip/g_uzip_wrkthr.c	optional geom_uzip
 geom/uzip/g_uzip_zlib.c		optional geom_uzip
 geom/vinum/geom_vinum.c		optional geom_vinum
 geom/vinum/geom_vinum_create.c	optional geom_vinum
 geom/vinum/geom_vinum_drive.c	optional geom_vinum
 geom/vinum/geom_vinum_plex.c	optional geom_vinum
 geom/vinum/geom_vinum_volume.c	optional geom_vinum
 geom/vinum/geom_vinum_subr.c	optional geom_vinum
 geom/vinum/geom_vinum_raid5.c	optional geom_vinum
 geom/vinum/geom_vinum_share.c	optional geom_vinum
 geom/vinum/geom_vinum_list.c	optional geom_vinum
 geom/vinum/geom_vinum_rm.c	optional geom_vinum
 geom/vinum/geom_vinum_init.c	optional geom_vinum
 geom/vinum/geom_vinum_state.c	optional geom_vinum
 geom/vinum/geom_vinum_rename.c	optional geom_vinum
 geom/vinum/geom_vinum_move.c	optional geom_vinum
 geom/vinum/geom_vinum_events.c	optional geom_vinum
 geom/virstor/binstream.c	optional geom_virstor
 geom/virstor/g_virstor.c	optional geom_virstor
 geom/virstor/g_virstor_md.c	optional geom_virstor
 geom/zero/g_zero.c		optional geom_zero
 fs/ext2fs/ext2_acl.c		optional ext2fs
 fs/ext2fs/ext2_alloc.c		optional ext2fs
 fs/ext2fs/ext2_balloc.c		optional ext2fs
 fs/ext2fs/ext2_bmap.c		optional ext2fs
 fs/ext2fs/ext2_csum.c		optional ext2fs
 fs/ext2fs/ext2_extattr.c	optional ext2fs
 fs/ext2fs/ext2_extents.c	optional ext2fs
 fs/ext2fs/ext2_inode.c		optional ext2fs
 fs/ext2fs/ext2_inode_cnv.c	optional ext2fs
 fs/ext2fs/ext2_hash.c		optional ext2fs
 fs/ext2fs/ext2_htree.c		optional ext2fs
 fs/ext2fs/ext2_lookup.c		optional ext2fs
 fs/ext2fs/ext2_subr.c		optional ext2fs
 fs/ext2fs/ext2_vfsops.c		optional ext2fs
 fs/ext2fs/ext2_vnops.c		optional ext2fs
 #
 isa/isa_if.m			standard
 isa/isa_common.c		optional isa
 isa/isahint.c			optional isa
 isa/pnp.c			optional isa isapnp
 isa/pnpparse.c			optional isa isapnp
 fs/cd9660/cd9660_bmap.c	optional cd9660
 fs/cd9660/cd9660_lookup.c	optional cd9660
 fs/cd9660/cd9660_node.c	optional cd9660
 fs/cd9660/cd9660_rrip.c	optional cd9660
 fs/cd9660/cd9660_util.c	optional cd9660
 fs/cd9660/cd9660_vfsops.c	optional cd9660
 fs/cd9660/cd9660_vnops.c	optional cd9660
 fs/cd9660/cd9660_iconv.c	optional cd9660_iconv
 kern/bus_if.m			standard
 kern/clock_if.m			standard
 kern/cpufreq_if.m		standard
 kern/device_if.m		standard
 kern/imgact_binmisc.c		optional	imagact_binmisc
 kern/imgact_elf.c		standard
 kern/imgact_elf32.c		optional compat_freebsd32
 kern/imgact_shell.c		standard
 kern/init_main.c		standard
 kern/init_sysent.c		standard
 kern/ksched.c			optional _kposix_priority_scheduling
 kern/kern_acct.c		standard
 kern/kern_alq.c			optional alq
 kern/kern_clock.c		standard
 kern/kern_condvar.c		standard
 kern/kern_conf.c		standard
 kern/kern_cons.c		standard
 kern/kern_cpu.c			standard
 kern/kern_cpuset.c		standard
 kern/kern_context.c		standard
 kern/kern_descrip.c		standard
 kern/kern_dtrace.c		optional kdtrace_hooks
 kern/kern_dump.c		standard
 kern/kern_environment.c		standard
 kern/kern_et.c			standard
 kern/kern_event.c		standard
 kern/kern_exec.c		standard
 kern/kern_exit.c		standard
 kern/kern_fail.c		standard
 kern/kern_ffclock.c		standard
 kern/kern_fork.c		standard
 kern/kern_hhook.c		standard
 kern/kern_idle.c		standard
 kern/kern_intr.c		standard
 kern/kern_jail.c		standard
 kern/kern_khelp.c		standard
 kern/kern_kthread.c		standard
 kern/kern_ktr.c			optional ktr
 kern/kern_ktrace.c		standard
 kern/kern_linker.c		standard
 kern/kern_lock.c		standard
 kern/kern_lockf.c		standard
 kern/kern_lockstat.c		optional kdtrace_hooks
 kern/kern_loginclass.c		standard
 kern/kern_malloc.c		standard
 kern/kern_mbuf.c		standard
 kern/kern_mib.c			standard
 kern/kern_module.c		standard
 kern/kern_mtxpool.c		standard
 kern/kern_mutex.c		standard
 kern/kern_ntptime.c		standard
 kern/kern_osd.c			standard
 kern/kern_physio.c		standard
 kern/kern_pmc.c			standard
 kern/kern_poll.c		optional device_polling
 kern/kern_priv.c		standard
 kern/kern_proc.c		standard
 kern/kern_procctl.c		standard
 kern/kern_prot.c		standard
 kern/kern_racct.c		standard
 kern/kern_rangelock.c		standard
 kern/kern_rctl.c		standard
 kern/kern_resource.c		standard
 kern/kern_rmlock.c		standard
 kern/kern_rwlock.c		standard
 kern/kern_sdt.c			optional kdtrace_hooks
 kern/kern_sema.c		standard
 kern/kern_sendfile.c		standard
 kern/kern_sharedpage.c		standard
 kern/kern_shutdown.c		standard
 kern/kern_sig.c			standard
 kern/kern_switch.c		standard
 kern/kern_sx.c			standard
 kern/kern_synch.c		standard
 kern/kern_syscalls.c		standard
 kern/kern_sysctl.c		standard
 kern/kern_tc.c			standard
 kern/kern_thr.c			standard
 kern/kern_thread.c		standard
 kern/kern_time.c		standard
 kern/kern_timeout.c		standard
 kern/kern_tslog.c		optional tslog
 kern/kern_umtx.c		standard
 kern/kern_uuid.c		standard
 kern/kern_xxx.c			standard
 kern/link_elf.c			standard
 kern/linker_if.m		standard
 kern/md4c.c			optional netsmb
 kern/md5c.c			standard
 kern/p1003_1b.c			standard
 kern/posix4_mib.c		standard
 kern/sched_4bsd.c		optional sched_4bsd
 kern/sched_ule.c		optional sched_ule
 kern/serdev_if.m		standard
 kern/stack_protector.c		standard \
 	compile-with "${NORMAL_C:N-fstack-protector*}"
 kern/subr_acl_nfs4.c		optional ufs_acl | zfs
 kern/subr_acl_posix1e.c		optional ufs_acl
 kern/subr_autoconf.c		standard
 kern/subr_blist.c		standard
 kern/subr_boot.c		standard
 kern/subr_bus.c			standard
 kern/subr_bus_dma.c		standard
 kern/subr_bufring.c		standard
 kern/subr_capability.c		standard
 kern/subr_clock.c		standard
 kern/subr_compressor.c		standard \
 	compile-with "${NORMAL_C} -I$S/contrib/zstd/lib/freebsd"
 kern/subr_counter.c		standard
 kern/subr_devstat.c		standard
 kern/subr_disk.c		standard
 kern/subr_early.c		standard
 kern/subr_epoch.c		standard
 kern/subr_eventhandler.c	standard
 kern/subr_fattime.c		standard
 kern/subr_firmware.c		optional firmware
 kern/subr_gtaskqueue.c		standard
 kern/subr_hash.c		standard
 kern/subr_hints.c		standard
 kern/subr_inflate.c		optional gzip
 kern/subr_kdb.c			standard
 kern/subr_kobj.c		standard
 kern/subr_lock.c		standard
 kern/subr_log.c			standard
 kern/subr_mchain.c		optional libmchain
 kern/subr_module.c		standard
 kern/subr_msgbuf.c		standard
 kern/subr_param.c		standard
 kern/subr_pcpu.c		standard
 kern/subr_pctrie.c		standard
 kern/subr_pidctrl.c		standard
 kern/subr_power.c		standard
 kern/subr_prf.c			standard
 kern/subr_prof.c		standard
 kern/subr_rangeset.c		standard
 kern/subr_rman.c		standard
 kern/subr_rtc.c			standard
 kern/subr_sbuf.c		standard
 kern/subr_scanf.c		standard
 kern/subr_sglist.c		standard
 kern/subr_sleepqueue.c		standard
 kern/subr_smp.c			standard
 kern/subr_stack.c		optional ddb | stack | ktr
 kern/subr_taskqueue.c		standard
 kern/subr_terminal.c		optional vt
 kern/subr_trap.c		standard
 kern/subr_turnstile.c		standard
 kern/subr_uio.c			standard
 kern/subr_unit.c		standard
 kern/subr_vmem.c		standard
 kern/subr_witness.c		optional witness
 kern/sys_capability.c		standard
 kern/sys_generic.c		standard
 kern/sys_getrandom.c		standard
 kern/sys_pipe.c			standard
 kern/sys_procdesc.c		standard
 kern/sys_process.c		standard
 kern/sys_socket.c		standard
 kern/syscalls.c			standard
 kern/sysv_ipc.c			standard
 kern/sysv_msg.c			optional sysvmsg
 kern/sysv_sem.c			optional sysvsem
 kern/sysv_shm.c			optional sysvshm
 kern/tty.c			standard
 kern/tty_compat.c		optional compat_43tty
 kern/tty_info.c			standard
 kern/tty_inq.c			standard
 kern/tty_outq.c			standard
 kern/tty_pts.c			standard
 kern/tty_tty.c			standard
 kern/tty_ttydisc.c		standard
 kern/uipc_accf.c		standard
 kern/uipc_debug.c		optional ddb
 kern/uipc_domain.c		standard
 kern/uipc_mbuf.c		standard
 kern/uipc_mbuf2.c		standard
 kern/uipc_mbufhash.c		standard
 kern/uipc_mqueue.c		optional p1003_1b_mqueue
 kern/uipc_sem.c			optional p1003_1b_semaphores
 kern/uipc_shm.c			standard
 kern/uipc_sockbuf.c		standard
 kern/uipc_socket.c		standard
 kern/uipc_syscalls.c		standard
 kern/uipc_usrreq.c		standard
 kern/vfs_acl.c			standard
 kern/vfs_aio.c			standard
 kern/vfs_bio.c			standard
 kern/vfs_cache.c		standard
 kern/vfs_cluster.c		standard
 kern/vfs_default.c		standard
 kern/vfs_export.c		standard
 kern/vfs_extattr.c		standard
 kern/vfs_hash.c			standard
 kern/vfs_init.c			standard
 kern/vfs_lookup.c		standard
 kern/vfs_mount.c		standard
 kern/vfs_mountroot.c		standard
 kern/vfs_subr.c			standard
 kern/vfs_syscalls.c		standard
 kern/vfs_vnops.c		standard
 #
 # Kernel GSS-API
 #
 gssd.h				optional kgssapi			\
 	dependency		"$S/kgssapi/gssd.x"			\
 	compile-with		"RPCGEN_CPP='${CPP}' rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h" \
 	no-obj no-implicit-rule before-depend local			\
 	clean			"gssd.h"
 gssd_xdr.c			optional kgssapi			\
 	dependency		"$S/kgssapi/gssd.x gssd.h"		\
 	compile-with		"RPCGEN_CPP='${CPP}' rpcgen -c $S/kgssapi/gssd.x -o gssd_xdr.c" \
 	no-implicit-rule before-depend local				\
 	clean			"gssd_xdr.c"
 gssd_clnt.c			optional kgssapi			\
 	dependency		"$S/kgssapi/gssd.x gssd.h"		\
 	compile-with		"RPCGEN_CPP='${CPP}' rpcgen -lM $S/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c" \
 	no-implicit-rule before-depend local				\
 	clean			"gssd_clnt.c"
 kgssapi/gss_accept_sec_context.c optional kgssapi
 kgssapi/gss_add_oid_set_member.c optional kgssapi
 kgssapi/gss_acquire_cred.c	optional kgssapi
 kgssapi/gss_canonicalize_name.c	optional kgssapi
 kgssapi/gss_create_empty_oid_set.c optional kgssapi
 kgssapi/gss_delete_sec_context.c optional kgssapi
 kgssapi/gss_display_status.c	optional kgssapi
 kgssapi/gss_export_name.c	optional kgssapi
 kgssapi/gss_get_mic.c		optional kgssapi
 kgssapi/gss_init_sec_context.c	optional kgssapi
 kgssapi/gss_impl.c		optional kgssapi
 kgssapi/gss_import_name.c	optional kgssapi
 kgssapi/gss_names.c		optional kgssapi
 kgssapi/gss_pname_to_uid.c	optional kgssapi
 kgssapi/gss_release_buffer.c	optional kgssapi
 kgssapi/gss_release_cred.c	optional kgssapi
 kgssapi/gss_release_name.c	optional kgssapi
 kgssapi/gss_release_oid_set.c	optional kgssapi
 kgssapi/gss_set_cred_option.c	optional kgssapi
 kgssapi/gss_test_oid_set_member.c optional kgssapi
 kgssapi/gss_unwrap.c		optional kgssapi
 kgssapi/gss_verify_mic.c	optional kgssapi
 kgssapi/gss_wrap.c		optional kgssapi
 kgssapi/gss_wrap_size_limit.c	optional kgssapi
 kgssapi/gssd_prot.c		optional kgssapi
 kgssapi/krb5/krb5_mech.c	optional kgssapi
 kgssapi/krb5/kcrypto.c		optional kgssapi
 kgssapi/krb5/kcrypto_aes.c	optional kgssapi
 kgssapi/krb5/kcrypto_arcfour.c	optional kgssapi
 kgssapi/krb5/kcrypto_des.c	optional kgssapi
 kgssapi/krb5/kcrypto_des3.c	optional kgssapi
 kgssapi/kgss_if.m		optional kgssapi
 kgssapi/gsstest.c		optional kgssapi_debug
 # These files in libkern/ are those needed by all architectures.  Some
 # of the files in libkern/ are only needed on some architectures, e.g.,
 # libkern/divdi3.c is needed by i386 but not alpha.  Also, some of these
 # routines may be optimized for a particular platform.  In either case,
 # the file should be moved to conf/files.<arch> from here.
 #
 libkern/arc4random.c		standard
 crypto/chacha20/chacha.c	standard
 libkern/asprintf.c		standard
 libkern/bcd.c			standard
 libkern/bsearch.c		standard
 libkern/crc32.c			standard
 libkern/explicit_bzero.c	standard
 libkern/fnmatch.c		standard
 libkern/iconv.c			optional libiconv
 libkern/iconv_converter_if.m	optional libiconv
 libkern/iconv_ucs.c		optional libiconv
 libkern/iconv_xlat.c		optional libiconv
 libkern/iconv_xlat16.c		optional libiconv
 libkern/inet_aton.c		standard
 libkern/inet_ntoa.c		standard
 libkern/inet_ntop.c		standard
 libkern/inet_pton.c		standard
 libkern/jenkins_hash.c		standard
 libkern/murmur3_32.c		standard
 libkern/mcount.c		optional profiling-routine
 libkern/memcchr.c		standard
 libkern/memchr.c		standard
 libkern/memmem.c		optional gdb
 libkern/qsort.c			standard
 libkern/qsort_r.c		standard
 libkern/random.c		standard
 libkern/scanc.c			standard
 libkern/strcasecmp.c		standard
 libkern/strcat.c		standard
 libkern/strchr.c		standard
 libkern/strcmp.c		standard
 libkern/strcpy.c		standard
 libkern/strcspn.c		standard
 libkern/strdup.c		standard
 libkern/strndup.c		standard
 libkern/strlcat.c		standard
 libkern/strlcpy.c		standard
 libkern/strlen.c		standard
 libkern/strncat.c		standard
 libkern/strncmp.c		standard
 libkern/strncpy.c		standard
 libkern/strnlen.c		standard
 libkern/strrchr.c		standard
 libkern/strsep.c		standard
 libkern/strspn.c		standard
 libkern/strstr.c		standard
 libkern/strtol.c		standard
 libkern/strtoq.c		standard
 libkern/strtoul.c		standard
 libkern/strtouq.c		standard
 libkern/strvalid.c		standard
 libkern/timingsafe_bcmp.c	standard
 libkern/zlib.c			optional crypto | geom_uzip | ipsec | \
 	ipsec_support | mxge | netgraph_deflate | ddb_ctf | gzio
 net/altq/altq_cbq.c		optional altq
 net/altq/altq_cdnr.c		optional altq
 net/altq/altq_codel.c		optional altq
 net/altq/altq_hfsc.c		optional altq
 net/altq/altq_fairq.c		optional altq
 net/altq/altq_priq.c		optional altq
 net/altq/altq_red.c		optional altq
 net/altq/altq_rio.c		optional altq
 net/altq/altq_rmclass.c		optional altq
 net/altq/altq_subr.c		optional altq
 net/bpf.c			standard
 net/bpf_buffer.c		optional bpf
 net/bpf_jitter.c		optional bpf_jitter
 net/bpf_filter.c		optional bpf | netgraph_bpf
 net/bpf_zerocopy.c		optional bpf
 net/bridgestp.c			optional bridge | if_bridge
 net/flowtable.c			optional flowtable inet | flowtable inet6
 net/ieee8023ad_lacp.c		optional lagg
 net/if.c			standard
 net/if_bridge.c			optional bridge inet | if_bridge inet
 net/if_clone.c			standard
 net/if_dead.c			standard
 net/if_debug.c			optional ddb
 net/if_disc.c			optional disc
 net/if_edsc.c			optional edsc
 net/if_enc.c			optional enc inet | enc inet6
 net/if_epair.c			optional epair
 net/if_ethersubr.c		optional ether
 net/if_fwsubr.c			optional fwip
 net/if_gif.c			optional gif inet | gif inet6 | \
 					 netgraph_gif inet | netgraph_gif inet6
 net/if_gre.c			optional gre inet | gre inet6
 net/if_ipsec.c			optional inet ipsec | inet6 ipsec
 net/if_lagg.c			optional lagg
 net/if_loop.c			optional loop
 net/if_llatbl.c			standard
 net/if_me.c			optional me inet
 net/if_media.c			standard
 net/if_mib.c			standard
 net/if_spppfr.c			optional sppp | netgraph_sppp
 net/if_spppsubr.c		optional sppp | netgraph_sppp
 net/if_stf.c			optional stf inet inet6
 net/if_tuntap.c			optional tuntap
 net/if_vlan.c			optional vlan
 net/if_vxlan.c			optional vxlan inet | vxlan inet6
 net/ifdi_if.m			optional ether pci iflib
 net/iflib.c			optional ether pci iflib
 net/iflib_clone.c		optional ether pci iflib
 net/mp_ring.c			optional ether iflib
 net/mppcc.c			optional netgraph_mppc_compression
 net/mppcd.c			optional netgraph_mppc_compression
 net/netisr.c			standard
 net/pfil.c			optional ether | inet
 net/radix.c			standard
 net/radix_mpath.c		standard
 net/raw_cb.c			standard
 net/raw_usrreq.c		standard
 net/route.c			standard
 net/rss_config.c		optional inet rss | inet6 rss
 net/rtsock.c			standard
 net/slcompress.c		optional netgraph_vjc | sppp | \
 					 netgraph_sppp
 net/toeplitz.c			optional inet rss | inet6 rss
 net/vnet.c			optional vimage
 net80211/ieee80211.c		optional wlan
 net80211/ieee80211_acl.c	optional wlan wlan_acl
 net80211/ieee80211_action.c	optional wlan
 net80211/ieee80211_adhoc.c	optional wlan \
 	compile-with "${NORMAL_C} -Wno-unused-function"
 net80211/ieee80211_ageq.c	optional wlan
 net80211/ieee80211_amrr.c	optional wlan | wlan_amrr
 net80211/ieee80211_crypto.c	optional wlan \
 	compile-with "${NORMAL_C} -Wno-unused-function"
 net80211/ieee80211_crypto_ccmp.c optional wlan wlan_ccmp
 net80211/ieee80211_crypto_none.c optional wlan
 net80211/ieee80211_crypto_tkip.c optional wlan wlan_tkip
 net80211/ieee80211_crypto_wep.c	optional wlan wlan_wep
 net80211/ieee80211_ddb.c	optional wlan ddb
 net80211/ieee80211_dfs.c	optional wlan
 net80211/ieee80211_freebsd.c	optional wlan
 net80211/ieee80211_hostap.c	optional wlan \
 	compile-with "${NORMAL_C} -Wno-unused-function"
 net80211/ieee80211_ht.c		optional wlan
 net80211/ieee80211_hwmp.c	optional wlan ieee80211_support_mesh
 net80211/ieee80211_input.c	optional wlan
 net80211/ieee80211_ioctl.c	optional wlan
 net80211/ieee80211_mesh.c	optional wlan ieee80211_support_mesh \
 	compile-with "${NORMAL_C} -Wno-unused-function"
 net80211/ieee80211_monitor.c	optional wlan
 net80211/ieee80211_node.c	optional wlan
 net80211/ieee80211_output.c	optional wlan
 net80211/ieee80211_phy.c	optional wlan
 net80211/ieee80211_power.c	optional wlan
 net80211/ieee80211_proto.c	optional wlan
 net80211/ieee80211_radiotap.c	optional wlan
 net80211/ieee80211_ratectl.c	optional wlan
 net80211/ieee80211_ratectl_none.c optional wlan
 net80211/ieee80211_regdomain.c	optional wlan
 net80211/ieee80211_rssadapt.c	optional wlan wlan_rssadapt
 net80211/ieee80211_scan.c	optional wlan
 net80211/ieee80211_scan_sta.c	optional wlan
 net80211/ieee80211_sta.c	optional wlan \
 	compile-with "${NORMAL_C} -Wno-unused-function"
 net80211/ieee80211_superg.c	optional wlan ieee80211_support_superg
 net80211/ieee80211_scan_sw.c	optional wlan
 net80211/ieee80211_tdma.c	optional wlan ieee80211_support_tdma
 net80211/ieee80211_vht.c	optional wlan
 net80211/ieee80211_wds.c	optional wlan
 net80211/ieee80211_xauth.c	optional wlan wlan_xauth
 net80211/ieee80211_alq.c	optional wlan ieee80211_alq
 netgraph/atm/ccatm/ng_ccatm.c	optional ngatm_ccatm \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 netgraph/atm/ngatmbase.c	optional ngatm_atmbase \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 netgraph/atm/sscfu/ng_sscfu.c	optional ngatm_sscfu \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 netgraph/atm/sscop/ng_sscop.c optional ngatm_sscop \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 netgraph/atm/uni/ng_uni.c	optional ngatm_uni \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 netgraph/bluetooth/common/ng_bluetooth.c optional netgraph_bluetooth
 netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c optional netgraph_bluetooth_bt3c
 netgraph/bluetooth/drivers/h4/ng_h4.c optional netgraph_bluetooth_h4
 netgraph/bluetooth/drivers/ubt/ng_ubt.c optional netgraph_bluetooth_ubt usb
 netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c optional netgraph_bluetooth_ubt usb
 netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c optional netgraph_bluetooth_ubtbcmfw usb
 netgraph/bluetooth/hci/ng_hci_cmds.c optional netgraph_bluetooth_hci
 netgraph/bluetooth/hci/ng_hci_evnt.c optional netgraph_bluetooth_hci
 netgraph/bluetooth/hci/ng_hci_main.c optional netgraph_bluetooth_hci
 netgraph/bluetooth/hci/ng_hci_misc.c optional netgraph_bluetooth_hci
 netgraph/bluetooth/hci/ng_hci_ulpi.c optional netgraph_bluetooth_hci
 netgraph/bluetooth/l2cap/ng_l2cap_cmds.c optional netgraph_bluetooth_l2cap
 netgraph/bluetooth/l2cap/ng_l2cap_evnt.c optional netgraph_bluetooth_l2cap
 netgraph/bluetooth/l2cap/ng_l2cap_llpi.c optional netgraph_bluetooth_l2cap
 netgraph/bluetooth/l2cap/ng_l2cap_main.c optional netgraph_bluetooth_l2cap
 netgraph/bluetooth/l2cap/ng_l2cap_misc.c optional netgraph_bluetooth_l2cap
 netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c optional netgraph_bluetooth_l2cap
 netgraph/bluetooth/socket/ng_btsocket.c optional netgraph_bluetooth_socket
 netgraph/bluetooth/socket/ng_btsocket_hci_raw.c	optional netgraph_bluetooth_socket
 netgraph/bluetooth/socket/ng_btsocket_l2cap.c optional netgraph_bluetooth_socket
 netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c optional netgraph_bluetooth_socket
 netgraph/bluetooth/socket/ng_btsocket_rfcomm.c optional netgraph_bluetooth_socket
 netgraph/bluetooth/socket/ng_btsocket_sco.c optional netgraph_bluetooth_socket
 netgraph/netflow/netflow.c	optional netgraph_netflow
 netgraph/netflow/netflow_v9.c	optional netgraph_netflow
 netgraph/netflow/ng_netflow.c	optional netgraph_netflow
 netgraph/ng_UI.c		optional netgraph_UI
 netgraph/ng_async.c		optional netgraph_async
 netgraph/ng_atmllc.c		optional netgraph_atmllc
 netgraph/ng_base.c		optional netgraph
 netgraph/ng_bpf.c		optional netgraph_bpf
 netgraph/ng_bridge.c		optional netgraph_bridge
 netgraph/ng_car.c		optional netgraph_car
 netgraph/ng_cisco.c		optional netgraph_cisco
 netgraph/ng_deflate.c		optional netgraph_deflate
 netgraph/ng_device.c		optional netgraph_device
 netgraph/ng_echo.c		optional netgraph_echo
 netgraph/ng_eiface.c		optional netgraph_eiface
 netgraph/ng_ether.c		optional netgraph_ether
 netgraph/ng_ether_echo.c	optional netgraph_ether_echo
 netgraph/ng_frame_relay.c	optional netgraph_frame_relay
 netgraph/ng_gif.c		optional netgraph_gif inet6 | netgraph_gif inet
 netgraph/ng_gif_demux.c		optional netgraph_gif_demux
 netgraph/ng_hole.c		optional netgraph_hole
 netgraph/ng_iface.c		optional netgraph_iface
 netgraph/ng_ip_input.c		optional netgraph_ip_input
 netgraph/ng_ipfw.c		optional netgraph_ipfw inet ipfirewall
 netgraph/ng_ksocket.c		optional netgraph_ksocket
 netgraph/ng_l2tp.c		optional netgraph_l2tp
 netgraph/ng_lmi.c		optional netgraph_lmi
 netgraph/ng_mppc.c		optional netgraph_mppc_compression | \
 					 netgraph_mppc_encryption
 netgraph/ng_nat.c		optional netgraph_nat inet libalias
 netgraph/ng_one2many.c		optional netgraph_one2many
 netgraph/ng_parse.c		optional netgraph
 netgraph/ng_patch.c		optional netgraph_patch
 netgraph/ng_pipe.c		optional netgraph_pipe
 netgraph/ng_ppp.c		optional netgraph_ppp
 netgraph/ng_pppoe.c		optional netgraph_pppoe
 netgraph/ng_pptpgre.c		optional netgraph_pptpgre
 netgraph/ng_pred1.c		optional netgraph_pred1
 netgraph/ng_rfc1490.c		optional netgraph_rfc1490
 netgraph/ng_socket.c		optional netgraph_socket
 netgraph/ng_split.c		optional netgraph_split
 netgraph/ng_sppp.c		optional netgraph_sppp
 netgraph/ng_tag.c		optional netgraph_tag
 netgraph/ng_tcpmss.c		optional netgraph_tcpmss
 netgraph/ng_tee.c		optional netgraph_tee
 netgraph/ng_tty.c		optional netgraph_tty
 netgraph/ng_vjc.c		optional netgraph_vjc
 netgraph/ng_vlan.c		optional netgraph_vlan
 netinet/accf_data.c		optional accept_filter_data inet
 netinet/accf_dns.c		optional accept_filter_dns inet
 netinet/accf_http.c		optional accept_filter_http inet
 netinet/if_ether.c		optional inet ether
 netinet/igmp.c			optional inet
 netinet/in.c			optional inet
 netinet/in_debug.c		optional inet ddb
 netinet/in_kdtrace.c		optional inet | inet6
 netinet/ip_carp.c		optional inet carp | inet6 carp
 netinet/in_fib.c		optional inet
 netinet/in_gif.c		optional gif inet | netgraph_gif inet
 netinet/ip_gre.c		optional gre inet
 netinet/ip_id.c			optional inet
 netinet/in_jail.c		optional inet
 netinet/in_mcast.c		optional inet
 netinet/in_pcb.c		optional inet | inet6
 netinet/in_pcbgroup.c		optional inet pcbgroup | inet6 pcbgroup
 netinet/in_prot.c		optional inet | inet6
 netinet/in_proto.c		optional inet | inet6
 netinet/in_rmx.c		optional inet
 netinet/in_rss.c		optional inet rss
 netinet/ip_divert.c		optional inet ipdivert ipfirewall
 netinet/ip_ecn.c		optional inet | inet6
 netinet/ip_encap.c		optional inet | inet6
 netinet/ip_fastfwd.c		optional inet
 netinet/ip_icmp.c		optional inet | inet6
 netinet/ip_input.c		optional inet
 netinet/ip_mroute.c		optional mrouting inet
 netinet/ip_options.c		optional inet
 netinet/ip_output.c		optional inet
 netinet/ip_reass.c		optional inet
 netinet/raw_ip.c		optional inet | inet6
 netinet/cc/cc.c			optional inet | inet6
 netinet/cc/cc_newreno.c		optional inet | inet6
 netinet/sctp_asconf.c		optional inet sctp | inet6 sctp
 netinet/sctp_auth.c		optional inet sctp | inet6 sctp
 netinet/sctp_bsd_addr.c		optional inet sctp | inet6 sctp
 netinet/sctp_cc_functions.c	optional inet sctp | inet6 sctp
 netinet/sctp_crc32.c		optional inet | inet6
 netinet/sctp_indata.c		optional inet sctp | inet6 sctp
 netinet/sctp_input.c		optional inet sctp | inet6 sctp
 netinet/sctp_kdtrace.c		optional inet sctp | inet6 sctp
 netinet/sctp_output.c		optional inet sctp | inet6 sctp
 netinet/sctp_pcb.c		optional inet sctp | inet6 sctp
 netinet/sctp_peeloff.c		optional inet sctp | inet6 sctp
 netinet/sctp_ss_functions.c	optional inet sctp | inet6 sctp
 netinet/sctp_syscalls.c		optional inet sctp | inet6 sctp
 netinet/sctp_sysctl.c		optional inet sctp | inet6 sctp
 netinet/sctp_timer.c		optional inet sctp | inet6 sctp
 netinet/sctp_usrreq.c		optional inet sctp | inet6 sctp
 netinet/sctputil.c		optional inet sctp | inet6 sctp
 netinet/siftr.c			optional inet siftr alq | inet6 siftr alq
 netinet/tcp_debug.c		optional tcpdebug
 netinet/tcp_fastopen.c		optional inet tcp_rfc7413 | inet6 tcp_rfc7413
 netinet/tcp_hostcache.c		optional inet | inet6
 netinet/tcp_input.c		optional inet | inet6
 netinet/tcp_log_buf.c		optional tcp_blackbox inet | tcp_blackbox inet6
 netinet/tcp_lro.c		optional inet | inet6
 netinet/tcp_output.c		optional inet | inet6
 netinet/tcp_offload.c		optional tcp_offload inet | tcp_offload inet6
 netinet/tcp_hpts.c              optional tcphpts inet | tcphpts inet6
 netinet/tcp_pcap.c		optional inet tcppcap | inet6 tcppcap
 netinet/tcp_reass.c		optional inet | inet6
 netinet/tcp_sack.c		optional inet | inet6
 netinet/tcp_subr.c		optional inet | inet6
 netinet/tcp_syncache.c		optional inet | inet6
 netinet/tcp_timer.c		optional inet | inet6
 netinet/tcp_timewait.c		optional inet | inet6
 netinet/tcp_usrreq.c		optional inet | inet6
 netinet/udp_usrreq.c		optional inet | inet6
 netinet/libalias/alias.c	optional libalias inet | netgraph_nat inet
 netinet/libalias/alias_db.c	optional libalias inet | netgraph_nat inet
 netinet/libalias/alias_mod.c	optional libalias | netgraph_nat
 netinet/libalias/alias_proxy.c	optional libalias inet | netgraph_nat inet
 netinet/libalias/alias_util.c	optional libalias inet | netgraph_nat inet
 netinet/libalias/alias_sctp.c	optional libalias inet | netgraph_nat inet
 netinet/netdump/netdump_client.c optional inet netdump
 netinet6/dest6.c		optional inet6
 netinet6/frag6.c		optional inet6
 netinet6/icmp6.c		optional inet6
 netinet6/in6.c			optional inet6
 netinet6/in6_cksum.c		optional inet6
 netinet6/in6_fib.c		optional inet6
 netinet6/in6_gif.c		optional gif inet6 | netgraph_gif inet6
 netinet6/in6_ifattach.c		optional inet6
 netinet6/in6_jail.c		optional inet6
 netinet6/in6_mcast.c		optional inet6
 netinet6/in6_pcb.c		optional inet6
 netinet6/in6_pcbgroup.c		optional inet6 pcbgroup
 netinet6/in6_proto.c		optional inet6
 netinet6/in6_rmx.c		optional inet6
 netinet6/in6_rss.c		optional inet6 rss
 netinet6/in6_src.c		optional inet6
 netinet6/ip6_fastfwd.c		optional inet6
 netinet6/ip6_forward.c		optional inet6
 netinet6/ip6_gre.c		optional gre inet6
 netinet6/ip6_id.c		optional inet6
 netinet6/ip6_input.c		optional inet6
 netinet6/ip6_mroute.c		optional mrouting inet6
 netinet6/ip6_output.c		optional inet6
 netinet6/mld6.c			optional inet6
 netinet6/nd6.c			optional inet6
 netinet6/nd6_nbr.c		optional inet6
 netinet6/nd6_rtr.c		optional inet6
 netinet6/raw_ip6.c		optional inet6
 netinet6/route6.c		optional inet6
 netinet6/scope6.c		optional inet6
 netinet6/sctp6_usrreq.c		optional inet6 sctp
 netinet6/udp6_usrreq.c		optional inet6
 netipsec/ipsec.c		optional ipsec inet | ipsec inet6
 netipsec/ipsec_input.c		optional ipsec inet | ipsec inet6
 netipsec/ipsec_mbuf.c		optional ipsec inet | ipsec inet6
 netipsec/ipsec_mod.c		optional ipsec inet | ipsec inet6
 netipsec/ipsec_output.c		optional ipsec inet | ipsec inet6
 netipsec/ipsec_pcb.c		optional ipsec inet | ipsec inet6 | \
 	ipsec_support inet | ipsec_support inet6
 netipsec/key.c			optional ipsec inet | ipsec inet6 | \
 	ipsec_support inet | ipsec_support inet6
 netipsec/key_debug.c		optional ipsec inet | ipsec inet6 | \
 	ipsec_support inet | ipsec_support inet6
 netipsec/keysock.c		optional ipsec inet | ipsec inet6 | \
 	ipsec_support inet | ipsec_support inet6
 netipsec/subr_ipsec.c		optional ipsec inet | ipsec inet6 | \
 	ipsec_support inet | ipsec_support inet6
 netipsec/udpencap.c		optional ipsec inet
 netipsec/xform_ah.c		optional ipsec inet | ipsec inet6
 netipsec/xform_esp.c		optional ipsec inet | ipsec inet6
 netipsec/xform_ipcomp.c		optional ipsec inet | ipsec inet6
 netipsec/xform_tcp.c		optional ipsec inet tcp_signature | \
 	 ipsec inet6 tcp_signature | ipsec_support inet tcp_signature | \
 	 ipsec_support inet6 tcp_signature
 netpfil/ipfw/dn_aqm_codel.c	optional inet dummynet
 netpfil/ipfw/dn_aqm_pie.c	optional inet dummynet
 netpfil/ipfw/dn_heap.c		optional inet dummynet
 netpfil/ipfw/dn_sched_fifo.c	optional inet dummynet
 netpfil/ipfw/dn_sched_fq_codel.c	optional inet dummynet
 netpfil/ipfw/dn_sched_fq_pie.c	optional inet dummynet
 netpfil/ipfw/dn_sched_prio.c	optional inet dummynet
 netpfil/ipfw/dn_sched_qfq.c	optional inet dummynet
 netpfil/ipfw/dn_sched_rr.c	optional inet dummynet
 netpfil/ipfw/dn_sched_wf2q.c	optional inet dummynet
 netpfil/ipfw/ip_dummynet.c	optional inet dummynet
 netpfil/ipfw/ip_dn_io.c		optional inet dummynet
 netpfil/ipfw/ip_dn_glue.c	optional inet dummynet
 netpfil/ipfw/ip_fw2.c		optional inet ipfirewall
 netpfil/ipfw/ip_fw_bpf.c	optional inet ipfirewall
 netpfil/ipfw/ip_fw_dynamic.c	optional inet ipfirewall \
 	compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 netpfil/ipfw/ip_fw_eaction.c	optional inet ipfirewall
 netpfil/ipfw/ip_fw_log.c	optional inet ipfirewall
 netpfil/ipfw/ip_fw_pfil.c	optional inet ipfirewall
 netpfil/ipfw/ip_fw_sockopt.c	optional inet ipfirewall
 netpfil/ipfw/ip_fw_table.c	optional inet ipfirewall
 netpfil/ipfw/ip_fw_table_algo.c	optional inet ipfirewall
 netpfil/ipfw/ip_fw_table_value.c	optional inet ipfirewall
 netpfil/ipfw/ip_fw_iface.c	optional inet ipfirewall
 netpfil/ipfw/ip_fw_nat.c	optional inet ipfirewall_nat
 netpfil/ipfw/nat64/ip_fw_nat64.c	optional inet inet6 ipfirewall \
 	ipfirewall_nat64
 netpfil/ipfw/nat64/nat64clat.c	optional inet inet6 ipfirewall \
 	ipfirewall_nat64
 netpfil/ipfw/nat64/nat64clat_control.c	optional inet inet6 ipfirewall \
 	ipfirewall_nat64
 netpfil/ipfw/nat64/nat64lsn.c	optional inet inet6 ipfirewall \
 	ipfirewall_nat64 compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 netpfil/ipfw/nat64/nat64lsn_control.c	optional inet inet6 ipfirewall \
 	ipfirewall_nat64 compile-with "${NORMAL_C} -I$S/contrib/ck/include"
 netpfil/ipfw/nat64/nat64stl.c	optional inet inet6 ipfirewall \
 	ipfirewall_nat64
 netpfil/ipfw/nat64/nat64stl_control.c	optional inet inet6 ipfirewall \
 	ipfirewall_nat64
 netpfil/ipfw/nat64/nat64_translate.c	optional inet inet6 ipfirewall \
 	ipfirewall_nat64
 netpfil/ipfw/nptv6/ip_fw_nptv6.c	optional inet inet6 ipfirewall \
 	ipfirewall_nptv6
 netpfil/ipfw/nptv6/nptv6.c	optional inet inet6 ipfirewall \
 	ipfirewall_nptv6
 netpfil/ipfw/pmod/ip_fw_pmod.c	optional inet ipfirewall_pmod
 netpfil/ipfw/pmod/tcpmod.c	optional inet ipfirewall_pmod
 netpfil/pf/if_pflog.c		optional pflog pf inet
 netpfil/pf/if_pfsync.c		optional pfsync pf inet
 netpfil/pf/pf.c			optional pf inet
 netpfil/pf/pf_if.c		optional pf inet
 netpfil/pf/pf_ioctl.c		optional pf inet
 netpfil/pf/pf_lb.c		optional pf inet
 netpfil/pf/pf_norm.c		optional pf inet
 netpfil/pf/pf_osfp.c		optional pf inet
 netpfil/pf/pf_ruleset.c		optional pf inet
 netpfil/pf/pf_table.c		optional pf inet
 netpfil/pf/in4_cksum.c		optional pf inet
 netsmb/smb_conn.c		optional netsmb
 netsmb/smb_crypt.c		optional netsmb
 netsmb/smb_dev.c		optional netsmb
 netsmb/smb_iod.c		optional netsmb
 netsmb/smb_rq.c			optional netsmb
 netsmb/smb_smb.c		optional netsmb
 netsmb/smb_subr.c		optional netsmb
 netsmb/smb_trantcp.c		optional netsmb
 netsmb/smb_usr.c		optional netsmb
 nfs/bootp_subr.c		optional bootp nfscl
 nfs/krpc_subr.c			optional bootp nfscl
 nfs/nfs_diskless.c		optional nfscl nfs_root
 nfs/nfs_fha.c			optional nfsd
 nfs/nfs_lock.c			optional nfscl | nfslockd | nfsd
 nfs/nfs_nfssvc.c		optional nfscl | nfsd
 nlm/nlm_advlock.c		optional nfslockd | nfsd
 nlm/nlm_prot_clnt.c		optional nfslockd | nfsd
 nlm/nlm_prot_impl.c		optional nfslockd | nfsd
 nlm/nlm_prot_server.c		optional nfslockd | nfsd
 nlm/nlm_prot_svc.c		optional nfslockd | nfsd
 nlm/nlm_prot_xdr.c		optional nfslockd | nfsd
 nlm/sm_inter_xdr.c		optional nfslockd | nfsd
 
 # Linux Kernel Programming Interface
 compat/linuxkpi/common/src/linux_kmod.c		optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_compat.c	optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_current.c	optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_hrtimer.c	optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_kthread.c	optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_lock.c		optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_page.c		optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_pci.c		optional compat_linuxkpi pci \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_tasklet.c	optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_idr.c		optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_radix.c	optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_rcu.c		optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C} -I$S/contrib/ck/include"
 compat/linuxkpi/common/src/linux_schedule.c	optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_slab.c		optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_usb.c		optional compat_linuxkpi usb \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_work.c		optional compat_linuxkpi \
 	compile-with "${LINUXKPI_C}"
 compat/linuxkpi/common/src/linux_seq_file.c	optional compat_linuxkpi | lindebugfs \
 	compile-with "${LINUXKPI_C}"
 
 compat/lindebugfs/lindebugfs.c			optional lindebugfs \
 	compile-with "${LINUXKPI_C}"
 
 # OpenFabrics Enterprise Distribution (Infiniband)
 ofed/drivers/infiniband/core/ib_addr.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_agent.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_cache.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_cm.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_cma.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_cq.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_device.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_fmr_pool.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_iwcm.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_iwpm_msg.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_iwpm_util.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_mad.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_mad_rmpp.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_multicast.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_packer.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_sa_query.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_smi.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_sysfs.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_ucm.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_ucma.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_ud_header.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_umem.c			optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_user_mad.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_uverbs_cmd.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_uverbs_main.c		optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_uverbs_marshall.c	optional ofed	\
 	compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_verbs.c			optional ofed	\
 	compile-with "${OFED_C}"
 
 ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c	optional ipoib		\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/"
 #ofed/drivers/infiniband/ulp/ipoib/ipoib_fs.c	optional ipoib		\
 #	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/"
 ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c	optional ipoib		\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/"
 ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c	optional ipoib		\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/"
 ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c	optional ipoib	\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/"
 ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c	optional ipoib		\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/"
 #ofed/drivers/infiniband/ulp/ipoib/ipoib_vlan.c	optional ipoib		\
 #	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/"
 
 ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c	optional sdp inet	\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/"
 ofed/drivers/infiniband/ulp/sdp/sdp_main.c	optional sdp inet 	\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/"
 ofed/drivers/infiniband/ulp/sdp/sdp_rx.c	optional sdp inet 	\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/"
 ofed/drivers/infiniband/ulp/sdp/sdp_cma.c	optional sdp inet 	\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/"
 ofed/drivers/infiniband/ulp/sdp/sdp_tx.c	optional sdp inet 	\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/"
 
 dev/mthca/mthca_allocator.c		optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_av.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_catas.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_cmd.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_cq.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_eq.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_mad.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_main.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_mcg.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_memfree.c		optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_mr.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_pd.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_profile.c		optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_provider.c		optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_qp.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_reset.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_srq.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 dev/mthca/mthca_uar.c			optional mthca pci ofed \
 	compile-with "${OFED_C}"
 
 dev/mlx4/mlx4_ib/mlx4_ib_alias_GUID.c		optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_ib/mlx4_ib_mcg.c			optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_ib/mlx4_ib_sysfs.c		optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_ib/mlx4_ib_cm.c			optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_ib/mlx4_ib_ah.c			optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_ib/mlx4_ib_cq.c			optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_ib/mlx4_ib_doorbell.c		optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_ib/mlx4_ib_mad.c			optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_ib/mlx4_ib_main.c			optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_ib/mlx4_ib_mr.c			optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_ib/mlx4_ib_qp.c			optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_ib/mlx4_ib_srq.c			optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_ib/mlx4_ib_wc.c			optional mlx4ib pci ofed \
 	compile-with "${OFED_C}"
 
 dev/mlx4/mlx4_core/mlx4_alloc.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_catas.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_cmd.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_cq.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_eq.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_fw.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_fw_qos.c		optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_icm.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_intf.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_main.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_mcg.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_mr.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_pd.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_port.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_profile.c		optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_qp.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_reset.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_sense.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_srq.c			optional mlx4 pci \
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_core/mlx4_resource_tracker.c	optional mlx4 pci \
 	compile-with "${OFED_C}"
 
 dev/mlx4/mlx4_en/mlx4_en_cq.c			optional mlx4en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_en/mlx4_en_main.c			optional mlx4en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_en/mlx4_en_netdev.c		optional mlx4en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_en/mlx4_en_port.c			optional mlx4en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_en/mlx4_en_resources.c		optional mlx4en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_en/mlx4_en_rx.c			optional mlx4en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx4/mlx4_en/mlx4_en_tx.c			optional mlx4en pci inet inet6	\
 	compile-with "${OFED_C}"
 
 dev/mlx5/mlx5_ib/mlx5_ib_ah.c			optional mlx5ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_ib/mlx5_ib_cong.c			optional mlx5ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_ib/mlx5_ib_cq.c			optional mlx5ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_ib/mlx5_ib_doorbell.c		optional mlx5ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_ib/mlx5_ib_gsi.c			optional mlx5ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_ib/mlx5_ib_mad.c			optional mlx5ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_ib/mlx5_ib_main.c			optional mlx5ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_ib/mlx5_ib_mem.c			optional mlx5ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_ib/mlx5_ib_mr.c			optional mlx5ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_ib/mlx5_ib_qp.c			optional mlx5ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_ib/mlx5_ib_srq.c			optional mlx5ib pci ofed \
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_ib/mlx5_ib_virt.c			optional mlx5ib pci ofed \
 	compile-with "${OFED_C}"
 
 dev/mlx5/mlx5_core/mlx5_alloc.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_cmd.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_cq.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_diagnostics.c		optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_eq.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_fs_cmd.c		optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_fs_tree.c		optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_fw.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_fwdump.c		optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_health.c		optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_mad.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_main.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_mcg.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_mpfs.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_mr.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_pagealloc.c		optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_pd.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_port.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_qp.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_rl.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_srq.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_transobj.c		optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_uar.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_vport.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_vsc.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_wq.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_lib/mlx5_gid.c			optional mlx5 pci	\
 	compile-with "${OFED_C}"
 
 dev/mlx5/mlx5_en/mlx5_en_dim.c			optional mlx5en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_en/mlx5_en_ethtool.c		optional mlx5en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_en/mlx5_en_main.c			optional mlx5en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_en/mlx5_en_tx.c			optional mlx5en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_en/mlx5_en_flow_table.c		optional mlx5en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_en/mlx5_en_rx.c			optional mlx5en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_en/mlx5_en_rl.c			optional mlx5en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_en/mlx5_en_txrx.c			optional mlx5en pci inet inet6	\
 	compile-with "${OFED_C}"
 dev/mlx5/mlx5_en/mlx5_en_port_buffer.c		optional mlx5en pci inet inet6	\
 	compile-with "${OFED_C}"
 
 # crypto support
 opencrypto/cast.c		optional crypto | ipsec | ipsec_support
 opencrypto/criov.c		optional crypto | ipsec | ipsec_support
 opencrypto/crypto.c		optional crypto | ipsec | ipsec_support
 opencrypto/cryptodev.c		optional cryptodev
 opencrypto/cryptodev_if.m	optional crypto | ipsec | ipsec_support
 opencrypto/cryptosoft.c		optional crypto | ipsec | ipsec_support
 opencrypto/cryptodeflate.c	optional crypto | ipsec | ipsec_support
 opencrypto/gmac.c		optional crypto | ipsec | ipsec_support
 opencrypto/gfmult.c		optional crypto | ipsec | ipsec_support
 opencrypto/rmd160.c		optional crypto | ipsec | ipsec_support
 opencrypto/skipjack.c		optional crypto | ipsec | ipsec_support
 opencrypto/xform.c		optional crypto | ipsec | ipsec_support
 opencrypto/xform_poly1305.c	optional crypto \
 	compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium"
 contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c \
 	optional crypto \
 	compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include/sodium -I$S/crypto/libsodium"
 contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c \
 	optional crypto \
 	compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include/sodium -I$S/crypto/libsodium"
 contrib/libsodium/src/libsodium/crypto_verify/sodium/verify.c \
 	optional crypto \
 	compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include/sodium -I$S/crypto/libsodium"
 crypto/libsodium/randombytes.c	optional crypto \
 	compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium"
 crypto/libsodium/utils.c	optional crypto \
 	compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium"
 opencrypto/cbc_mac.c		optional crypto
 opencrypto/xform_cbc_mac.c	optional crypto
 rpc/auth_none.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/auth_unix.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/authunix_prot.c		optional krpc | nfslockd | nfscl | nfsd
 rpc/clnt_bck.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/clnt_dg.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/clnt_rc.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/clnt_vc.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/getnetconfig.c		optional krpc | nfslockd | nfscl | nfsd
 rpc/replay.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/rpc_callmsg.c		optional krpc | nfslockd | nfscl | nfsd
 rpc/rpc_generic.c		optional krpc | nfslockd | nfscl | nfsd
 rpc/rpc_prot.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/rpcb_clnt.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/rpcb_prot.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/svc.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/svc_auth.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/svc_auth_unix.c		optional krpc | nfslockd | nfscl | nfsd
 rpc/svc_dg.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/svc_generic.c		optional krpc | nfslockd | nfscl | nfsd
 rpc/svc_vc.c			optional krpc | nfslockd | nfscl | nfsd
 rpc/rpcsec_gss/rpcsec_gss.c	optional krpc kgssapi | nfslockd kgssapi | nfscl kgssapi | nfsd kgssapi
 rpc/rpcsec_gss/rpcsec_gss_conf.c optional krpc kgssapi | nfslockd kgssapi | nfscl kgssapi | nfsd kgssapi
 rpc/rpcsec_gss/rpcsec_gss_misc.c optional krpc kgssapi | nfslockd kgssapi | nfscl kgssapi | nfsd kgssapi
 rpc/rpcsec_gss/rpcsec_gss_prot.c optional krpc kgssapi | nfslockd kgssapi | nfscl kgssapi | nfsd kgssapi
 rpc/rpcsec_gss/svc_rpcsec_gss.c	optional krpc kgssapi | nfslockd kgssapi | nfscl kgssapi | nfsd kgssapi
 security/audit/audit.c		optional audit
 security/audit/audit_arg.c	optional audit
 security/audit/audit_bsm.c	optional audit
 security/audit/audit_bsm_db.c	optional audit
 security/audit/audit_bsm_klib.c	optional audit
 security/audit/audit_dtrace.c	optional dtaudit audit | dtraceall audit compile-with "${CDDL_C}"
 security/audit/audit_pipe.c	optional audit
 security/audit/audit_syscalls.c	standard
 security/audit/audit_trigger.c	optional audit
 security/audit/audit_worker.c	optional audit
 security/audit/bsm_domain.c	optional audit
 security/audit/bsm_errno.c	optional audit
 security/audit/bsm_fcntl.c	optional audit
 security/audit/bsm_socket_type.c	optional audit
 security/audit/bsm_token.c	optional audit
 security/mac/mac_audit.c	optional mac audit
 security/mac/mac_cred.c		optional mac
 security/mac/mac_framework.c	optional mac
 security/mac/mac_inet.c		optional mac inet | mac inet6
 security/mac/mac_inet6.c	optional mac inet6
 security/mac/mac_label.c	optional mac
 security/mac/mac_net.c		optional mac
 security/mac/mac_pipe.c		optional mac
 security/mac/mac_posix_sem.c	optional mac
 security/mac/mac_posix_shm.c	optional mac
 security/mac/mac_priv.c		optional mac
 security/mac/mac_process.c	optional mac
 security/mac/mac_socket.c	optional mac
 security/mac/mac_syscalls.c	standard
 security/mac/mac_system.c	optional mac
 security/mac/mac_sysv_msg.c	optional mac
 security/mac/mac_sysv_sem.c	optional mac
 security/mac/mac_sysv_shm.c	optional mac
 security/mac/mac_vfs.c		optional mac
 security/mac_biba/mac_biba.c	optional mac_biba
 security/mac_bsdextended/mac_bsdextended.c	optional mac_bsdextended
 security/mac_bsdextended/ugidfw_system.c	optional mac_bsdextended
 security/mac_bsdextended/ugidfw_vnode.c		optional mac_bsdextended
 security/mac_ifoff/mac_ifoff.c	optional mac_ifoff
 security/mac_lomac/mac_lomac.c	optional mac_lomac
 security/mac_mls/mac_mls.c	optional mac_mls
 security/mac_none/mac_none.c	optional mac_none
 security/mac_ntpd/mac_ntpd.c	optional mac_ntpd
 security/mac_partition/mac_partition.c optional mac_partition
 security/mac_portacl/mac_portacl.c optional mac_portacl
 security/mac_seeotheruids/mac_seeotheruids.c optional mac_seeotheruids
 security/mac_stub/mac_stub.c	optional mac_stub
 security/mac_test/mac_test.c	optional mac_test
 security/mac_veriexec/mac_veriexec.c			optional mac_veriexec
 security/mac_veriexec/veriexec_fingerprint.c		optional mac_veriexec
 security/mac_veriexec/veriexec_metadata.c		optional mac_veriexec
 security/mac_veriexec_parser/mac_veriexec_parser.c	optional mac_veriexec mac_veriexec_parser
 security/mac_veriexec/mac_veriexec_rmd160.c		optional mac_veriexec_rmd160
 security/mac_veriexec/mac_veriexec_sha1.c		optional mac_veriexec_sha1
 security/mac_veriexec/mac_veriexec_sha256.c		optional mac_veriexec_sha256
 security/mac_veriexec/mac_veriexec_sha384.c		optional mac_veriexec_sha384
 security/mac_veriexec/mac_veriexec_sha512.c		optional mac_veriexec_sha512
 teken/teken.c			optional sc | vt
 ufs/ffs/ffs_alloc.c		optional ffs
 ufs/ffs/ffs_balloc.c		optional ffs
 ufs/ffs/ffs_inode.c		optional ffs
 ufs/ffs/ffs_snapshot.c		optional ffs
 ufs/ffs/ffs_softdep.c		optional ffs
 ufs/ffs/ffs_subr.c		optional ffs | geom_label
 ufs/ffs/ffs_tables.c		optional ffs | geom_label
 ufs/ffs/ffs_vfsops.c		optional ffs
 ufs/ffs/ffs_vnops.c		optional ffs
 ufs/ffs/ffs_rawread.c		optional ffs directio
 ufs/ffs/ffs_suspend.c		optional ffs
 ufs/ufs/ufs_acl.c		optional ffs
 ufs/ufs/ufs_bmap.c		optional ffs
 ufs/ufs/ufs_dirhash.c		optional ffs
 ufs/ufs/ufs_extattr.c		optional ffs
 ufs/ufs/ufs_gjournal.c		optional ffs UFS_GJOURNAL
 ufs/ufs/ufs_inode.c		optional ffs
 ufs/ufs/ufs_lookup.c		optional ffs
 ufs/ufs/ufs_quota.c		optional ffs
 ufs/ufs/ufs_vfsops.c		optional ffs
 ufs/ufs/ufs_vnops.c		optional ffs
 vm/default_pager.c		standard
 vm/device_pager.c		standard
 vm/phys_pager.c			standard
 vm/redzone.c			optional DEBUG_REDZONE
 vm/sg_pager.c			standard
 vm/swap_pager.c			standard
 vm/uma_core.c			standard
 vm/uma_dbg.c			standard
 vm/memguard.c			optional DEBUG_MEMGUARD
 vm/vm_domainset.c		standard
 vm/vm_fault.c			standard
 vm/vm_glue.c			standard
 vm/vm_init.c			standard
 vm/vm_kern.c			standard
 vm/vm_map.c			standard
 vm/vm_meter.c			standard
 vm/vm_mmap.c			standard
 vm/vm_object.c			standard
 vm/vm_page.c			standard
 vm/vm_pageout.c			standard
 vm/vm_pager.c			standard
 vm/vm_phys.c			standard
 vm/vm_radix.c			standard
 vm/vm_reserv.c			standard
 vm/vm_swapout.c			optional !NO_SWAPPING
 vm/vm_swapout_dummy.c		optional NO_SWAPPING
 vm/vm_unix.c			standard
 vm/vnode_pager.c		standard
 xen/features.c			optional xenhvm
 xen/xenbus/xenbus_if.m		optional xenhvm
 xen/xenbus/xenbus.c		optional xenhvm
 xen/xenbus/xenbusb_if.m		optional xenhvm
 xen/xenbus/xenbusb.c		optional xenhvm
 xen/xenbus/xenbusb_front.c	optional xenhvm
 xen/xenbus/xenbusb_back.c	optional xenhvm
 xen/xenmem/xenmem_if.m		optional xenhvm
 xdr/xdr.c			optional krpc | nfslockd | nfscl | nfsd
 xdr/xdr_array.c			optional krpc | nfslockd | nfscl | nfsd
 xdr/xdr_mbuf.c			optional krpc | nfslockd | nfscl | nfsd
 xdr/xdr_mem.c			optional krpc | nfslockd | nfscl | nfsd
 xdr/xdr_reference.c		optional krpc | nfslockd | nfscl | nfsd
 xdr/xdr_sizeof.c		optional krpc | nfslockd | nfscl | nfsd
Index: stable/12/sys/conf/files.arm64
===================================================================
--- stable/12/sys/conf/files.arm64	(revision 358643)
+++ stable/12/sys/conf/files.arm64	(revision 358644)
@@ -1,304 +1,305 @@
 # $FreeBSD$
 cloudabi32_vdso.o		optional	compat_cloudabi32	\
 	dependency	"$S/contrib/cloudabi/cloudabi_vdso_armv6_on_64bit.S"	\
 	compile-with	"${CC} -x assembler-with-cpp -m32 -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_armv6_on_64bit.S -o ${.TARGET}" \
 	no-obj no-implicit-rule						\
 	clean		"cloudabi32_vdso.o"
 #
 cloudabi32_vdso_blob.o		optional	compat_cloudabi32	\
 	dependency 	"cloudabi32_vdso.o"			\
 	compile-with	"${OBJCOPY} --input-target binary --output-target elf64-littleaarch64 --binary-architecture aarch64 cloudabi32_vdso.o ${.TARGET}" \
 	no-implicit-rule						\
 	clean		"cloudabi32_vdso_blob.o"
 #
 cloudabi64_vdso.o		optional	compat_cloudabi64	\
 	dependency	"$S/contrib/cloudabi/cloudabi_vdso_aarch64.S"	\
 	compile-with	"${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_aarch64.S -o ${.TARGET}" \
 	no-obj no-implicit-rule						\
 	clean		"cloudabi64_vdso.o"
 #
 cloudabi64_vdso_blob.o		optional	compat_cloudabi64	\
 	dependency 	"cloudabi64_vdso.o"			\
 	compile-with	"${OBJCOPY} --input-target binary --output-target elf64-littleaarch64 --binary-architecture aarch64 cloudabi64_vdso.o ${.TARGET}" \
 	no-implicit-rule						\
 	clean		"cloudabi64_vdso_blob.o"
 #
 
 # Allwinner common files
 arm/allwinner/a10_timer.c	optional	a10_timer fdt
 arm/allwinner/a10_codec.c	optional	sound a10_codec
 arm/allwinner/a31_dmac.c	optional	a31_dmac
 arm/allwinner/sunxi_dma_if.m	optional	a31_dmac
 arm/allwinner/aw_cir.c		optional	evdev aw_cir fdt
 arm/allwinner/aw_gpio.c		optional	gpio aw_gpio fdt
 arm/allwinner/aw_mmc.c		optional	mmc aw_mmc fdt | mmccam aw_mmc fdt
 arm/allwinner/aw_nmi.c		optional	aw_nmi fdt \
 	compile-with "${NORMAL_C} -I$S/gnu/dts/include"
 arm/allwinner/aw_pwm.c		optional	aw_pwm fdt
 arm/allwinner/aw_rsb.c		optional	aw_rsb fdt
 arm/allwinner/aw_rtc.c		optional	aw_rtc fdt
 arm/allwinner/aw_sid.c		optional	aw_sid nvmem fdt
 arm/allwinner/aw_spi.c		optional	aw_spi fdt
 arm/allwinner/aw_syscon.c	optional	aw_syscon ext_resources syscon fdt
 arm/allwinner/aw_thermal.c	optional	aw_thermal nvmem fdt
 arm/allwinner/aw_usbphy.c	optional	ehci aw_usbphy fdt
 arm/allwinner/aw_wdog.c		optional	aw_wdog fdt
 arm/allwinner/axp81x.c		optional	axp81x fdt
 arm/allwinner/if_awg.c		optional	awg ext_resources syscon aw_sid nvmem fdt
 
 # Allwinner clock driver
 arm/allwinner/clkng/aw_ccung.c		optional	aw_ccu fdt
 arm/allwinner/clkng/aw_clk_frac.c	optional	aw_ccu fdt
 arm/allwinner/clkng/aw_clk_m.c		optional	aw_ccu fdt
 arm/allwinner/clkng/aw_clk_mipi.c	optional	aw_ccu fdt
 arm/allwinner/clkng/aw_clk_nkmp.c	optional	aw_ccu fdt
 arm/allwinner/clkng/aw_clk_nm.c		optional	aw_ccu fdt
 arm/allwinner/clkng/aw_clk_nmm.c	optional	aw_ccu fdt
 arm/allwinner/clkng/aw_clk_np.c		optional	aw_ccu fdt
 arm/allwinner/clkng/aw_clk_prediv_mux.c	optional	aw_ccu fdt
 arm/allwinner/clkng/ccu_a64.c		optional	soc_allwinner_a64 aw_ccu fdt
 arm/allwinner/clkng/ccu_h3.c		optional	soc_allwinner_h5 aw_ccu fdt
 arm/allwinner/clkng/ccu_sun8i_r.c	optional	aw_ccu fdt
 arm/allwinner/clkng/ccu_de2.c		optional	aw_ccu fdt
 
 # Allwinner padconf files
 arm/allwinner/a64/a64_padconf.c	optional	soc_allwinner_a64 fdt
 arm/allwinner/a64/a64_r_padconf.c optional	soc_allwinner_a64 fdt
 arm/allwinner/h3/h3_padconf.c	optional	soc_allwinner_h5 fdt
 arm/allwinner/h3/h3_r_padconf.c optional	soc_allwinner_h5 fdt
 
 arm/annapurna/alpine/alpine_ccu.c		optional	al_ccu fdt
 arm/annapurna/alpine/alpine_nb_service.c	optional	al_nb_service fdt
 arm/annapurna/alpine/alpine_pci.c		optional	al_pci fdt
 arm/annapurna/alpine/alpine_pci_msix.c		optional	al_pci fdt
 arm/annapurna/alpine/alpine_serdes.c		optional al_serdes fdt		\
 	no-depend	\
 	compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}"
 arm/arm/generic_timer.c		standard
 arm/arm/gic.c			standard
 arm/arm/gic_acpi.c		optional	acpi
 arm/arm/gic_fdt.c		optional	fdt
 arm/arm/pmu.c			standard
 arm/arm/physmem.c		standard
 arm/broadcom/bcm2835/bcm2835_audio.c		optional sound vchiq fdt \
 	compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq"
 arm/broadcom/bcm2835/bcm2835_bsc.c		optional bcm2835_bsc fdt
 arm/broadcom/bcm2835/bcm2835_clkman.c		optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2835_cpufreq.c		optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2835_dma.c		optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2835_fbd.c		optional vt soc_brcm_bcm2837 fdt | vt soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2835_ft5406.c		optional evdev bcm2835_ft5406 fdt
 arm/broadcom/bcm2835/bcm2835_gpio.c		optional gpio soc_brcm_bcm2837 fdt | gpio soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2835_intr.c		optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2835_mbox.c		optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2835_rng.c		optional random soc_brcm_bcm2837 fdt | random soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2835_sdhci.c		optional sdhci soc_brcm_bcm2837 fdt | sdhci soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2835_sdhost.c		optional sdhci soc_brcm_bcm2837 fdt | sdhci soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2835_spi.c		optional bcm2835_spi fdt
 arm/broadcom/bcm2835/bcm2835_vcbus.c		optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2835_vcio.c		optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2835_wdog.c		optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm2836.c			optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt
 arm/broadcom/bcm2835/bcm283x_dwc_fdt.c		optional dwcotg fdt soc_brcm_bcm2837 | dwcotg fdt soc_brcm_bcm2838
 arm/mv/a37x0_gpio.c				optional a37x0_gpio gpio fdt
 arm/mv/gpio.c					optional mv_gpio fdt
 arm/mv/mvebu_pinctrl.c				optional mvebu_pinctrl fdt
 arm/mv/mv_cp110_icu.c				optional mv_cp110_icu fdt
 arm/mv/mv_ap806_gicp.c				optional mv_ap806_gicp fdt
 arm/mv/mv_ap806_clock.c				optional SOC_MARVELL_8K fdt
 arm/mv/mv_cp110_clock.c				optional SOC_MARVELL_8K fdt
 arm/mv/mv_thermal.c				optional SOC_MARVELL_8K mv_thermal fdt
 arm/mv/armada38x/armada38x_rtc.c		optional mv_rtc fdt
 arm/xilinx/uart_dev_cdnc.c			optional uart soc_xilinx_zynq
 arm64/acpica/acpi_iort.c	optional	acpi
 arm64/acpica/acpi_machdep.c	optional	acpi
 arm64/acpica/OsdEnvironment.c	optional	acpi
 arm64/acpica/acpi_wakeup.c	optional	acpi
 arm64/acpica/pci_cfgreg.c	optional	acpi	pci
 arm64/arm64/autoconf.c		standard
 arm64/arm64/bus_machdep.c	standard
 arm64/arm64/bus_space_asm.S	standard
 arm64/arm64/busdma_bounce.c	standard
 arm64/arm64/busdma_machdep.c	standard
 arm64/arm64/bzero.S		standard
 arm64/arm64/clock.c		standard
 arm64/arm64/copyinout.S		standard
 arm64/arm64/copystr.c		standard
 arm64/arm64/cpu_errata.c	standard
 arm64/arm64/cpufunc_asm.S	standard
 arm64/arm64/db_disasm.c		optional	ddb
 arm64/arm64/db_interface.c	optional	ddb
 arm64/arm64/db_trace.c		optional	ddb
 arm64/arm64/debug_monitor.c	optional	ddb
 arm64/arm64/disassem.c		optional	ddb
 arm64/arm64/dump_machdep.c	standard
 arm64/arm64/efirt_machdep.c	optional	efirt
 arm64/arm64/elf32_machdep.c	optional	compat_freebsd32
 arm64/arm64/elf_machdep.c	standard
 arm64/arm64/exception.S		standard
 arm64/arm64/freebsd32_machdep.c	optional	compat_freebsd32
 arm64/arm64/gicv3_its.c		optional	intrng fdt
 arm64/arm64/gic_v3.c		standard
 arm64/arm64/gic_v3_acpi.c	optional	acpi
 arm64/arm64/gic_v3_fdt.c	optional	fdt
 arm64/arm64/identcpu.c		standard
 arm64/arm64/in_cksum.c		optional	inet | inet6
 arm64/arm64/locore.S		standard	no-obj
 arm64/arm64/machdep.c		standard
 arm64/arm64/mem.c		standard
 arm64/arm64/memcpy.S		standard
 arm64/arm64/memmove.S		standard
 arm64/arm64/minidump_machdep.c	standard
 arm64/arm64/mp_machdep.c	optional	smp
 arm64/arm64/nexus.c		standard
 arm64/arm64/ofw_machdep.c	optional	fdt
 arm64/arm64/pmap.c		standard
 arm64/arm64/stack_machdep.c	optional	ddb | stack
 arm64/arm64/support.S		standard
 arm64/arm64/swtch.S		standard
 arm64/arm64/sys_machdep.c	standard
 arm64/arm64/trap.c		standard
 arm64/arm64/uio_machdep.c	standard
 arm64/arm64/uma_machdep.c	standard
 arm64/arm64/undefined.c		standard
 arm64/arm64/unwind.c		optional	ddb | kdtrace_hooks | stack
 arm64/arm64/vfp.c		standard
 arm64/arm64/vm_machdep.c	standard
 arm64/cavium/thunder_pcie_fdt.c		optional	soc_cavm_thunderx pci fdt
 arm64/cavium/thunder_pcie_pem.c		optional	soc_cavm_thunderx pci
 arm64/cavium/thunder_pcie_pem_fdt.c	optional	soc_cavm_thunderx pci fdt
 arm64/cavium/thunder_pcie_common.c	optional	soc_cavm_thunderx pci
 arm64/cloudabi32/cloudabi32_sysvec.c	optional compat_cloudabi32
 arm64/cloudabi64/cloudabi64_sysvec.c	optional compat_cloudabi64
 arm64/coresight/coresight.c			standard
 arm64/coresight/coresight_if.m			standard
 arm64/coresight/coresight-cmd.c			standard
 arm64/coresight/coresight-cpu-debug.c		standard
 arm64/coresight/coresight-dynamic-replicator.c	standard
 arm64/coresight/coresight-etm4x.c		standard
 arm64/coresight/coresight-funnel.c		standard
 arm64/coresight/coresight-tmc.c			standard
 arm64/qualcomm/qcom_gcc.c			optional qcom_gcc fdt
 contrib/vchiq/interface/compat/vchi_bsd.c	optional vchiq soc_brcm_bcm2837 \
 	compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq"
 contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c	optional vchiq soc_brcm_bcm2837 \
 	compile-with "${NORMAL_C} -Wno-unused -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq"
 contrib/vchiq/interface/vchiq_arm/vchiq_arm.c	optional vchiq soc_brcm_bcm2837 \
 	compile-with "${NORMAL_C} -Wno-unused -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq"
 contrib/vchiq/interface/vchiq_arm/vchiq_connected.c	optional vchiq soc_brcm_bcm2837 \
 	compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq"
 contrib/vchiq/interface/vchiq_arm/vchiq_core.c	optional vchiq soc_brcm_bcm2837 \
 	compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq"
 contrib/vchiq/interface/vchiq_arm/vchiq_kern_lib.c	optional vchiq soc_brcm_bcm2837 \
 	compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq"
 contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c	optional vchiq soc_brcm_bcm2837 \
 	compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq"
 contrib/vchiq/interface/vchiq_arm/vchiq_shim.c	optional vchiq soc_brcm_bcm2837 \
 	compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq"
 contrib/vchiq/interface/vchiq_arm/vchiq_util.c	optional vchiq soc_brcm_bcm2837 \
 	compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq"
 crypto/armv8/armv8_crypto.c	optional	armv8crypto
 armv8_crypto_wrap.o		optional	armv8crypto		\
 	dependency	"$S/crypto/armv8/armv8_crypto_wrap.c"		\
 	compile-with	"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ ${WERROR} ${NO_WCAST_QUAL} ${PROF} -march=armv8-a+crypto ${.IMPSRC}" \
 	no-implicit-rule						\
 	clean		"armv8_crypto_wrap.o"
 crypto/blowfish/bf_enc.c	optional	crypto | ipsec | ipsec_support
 crypto/des/des_enc.c		optional	crypto | ipsec | ipsec_support | netsmb
 dev/acpica/acpi_bus_if.m	optional	acpi
 dev/acpica/acpi_if.m		optional	acpi
 dev/acpica/acpi_pci_link.c	optional	acpi pci
 dev/acpica/acpi_pcib.c		optional	acpi pci
 dev/acpica/acpi_pxm.c		optional	acpi
 dev/ahci/ahci_generic.c		optional	ahci
 dev/axgbe/if_axgbe.c		optional	axgbe
 dev/axgbe/xgbe-desc.c		optional	axgbe
 dev/axgbe/xgbe-dev.c		optional	axgbe
 dev/axgbe/xgbe-drv.c		optional	axgbe
 dev/axgbe/xgbe-mdio.c		optional	axgbe
 dev/cpufreq/cpufreq_dt.c	optional	cpufreq fdt
 dev/iicbus/twsi/mv_twsi.c	optional	twsi fdt
 dev/iicbus/twsi/a10_twsi.c	optional	twsi fdt
 dev/iicbus/twsi/twsi.c		optional	twsi fdt
 dev/hwpmc/hwpmc_arm64.c		optional	hwpmc
 dev/hwpmc/hwpmc_arm64_md.c	optional	hwpmc
 dev/mbox/mbox_if.m		optional	soc_brcm_bcm2837
 dev/mmc/host/dwmmc.c		optional	dwmmc fdt
 dev/mmc/host/dwmmc_hisi.c	optional	dwmmc fdt soc_hisi_hi6220
 dev/mmc/host/dwmmc_rockchip.c	optional	dwmmc fdt soc_rockchip_rk3328
 dev/neta/if_mvneta_fdt.c	optional	neta fdt
 dev/neta/if_mvneta.c		optional	neta mdio mii
 dev/ofw/ofw_cpu.c		optional	fdt
 dev/ofw/ofwpci.c		optional 	fdt pci
 dev/pci/pci_host_generic.c	optional	pci
 dev/pci/pci_host_generic_acpi.c	optional	pci acpi
 dev/pci/pci_host_generic_fdt.c	optional	pci fdt
 dev/psci/psci.c			standard
 dev/psci/psci_arm64.S		standard
 dev/psci/smccc.c		standard
 dev/sdhci/sdhci_xenon.c		optional	sdhci_xenon sdhci fdt
 dev/uart/uart_cpu_arm64.c	optional	uart
 dev/uart/uart_dev_mu.c		optional	uart uart_mu
 dev/uart/uart_dev_pl011.c	optional	uart pl011
 dev/usb/controller/dwc_otg_hisi.c optional	dwcotg fdt soc_hisi_hi6220
 dev/usb/controller/ehci_mv.c	optional	ehci_mv fdt
 dev/usb/controller/generic_ehci.c optional	ehci
 dev/usb/controller/generic_ehci_acpi.c optional	ehci acpi
 dev/usb/controller/generic_ehci_fdt.c optional	ehci fdt
 dev/usb/controller/generic_ohci.c optional	ohci fdt
 dev/usb/controller/generic_usb_if.m optional	ohci fdt
 dev/usb/controller/usb_nop_xceiv.c	optional fdt ext_resources
 dev/usb/controller/generic_xhci.c	optional	xhci fdt
 dev/vnic/mrml_bridge.c		optional	vnic fdt
 dev/vnic/nic_main.c		optional	vnic pci
 dev/vnic/nicvf_main.c		optional	vnic pci pci_iov
 dev/vnic/nicvf_queues.c		optional	vnic pci pci_iov
 dev/vnic/thunder_bgx_fdt.c	optional	vnic fdt
 dev/vnic/thunder_bgx.c		optional	vnic pci
 dev/vnic/thunder_mdio_fdt.c	optional	vnic fdt
 dev/vnic/thunder_mdio.c		optional	vnic
 dev/vnic/lmac_if.m		optional	inet | inet6 | vnic
 kern/kern_clocksource.c		standard
 kern/msi_if.m			optional	intrng
 kern/pic_if.m			optional	intrng
 kern/subr_devmap.c		standard
 kern/subr_intr.c		optional	intrng
 libkern/bcmp.c			standard
 libkern/ffs.c			standard
 libkern/ffsl.c			standard
 libkern/ffsll.c			standard
 libkern/fls.c			standard
 libkern/flsl.c			standard
 libkern/flsll.c			standard
 libkern/memcmp.c		standard
 libkern/memset.c		standard
 libkern/arm64/crc32c_armv8.S	standard
 cddl/dev/dtrace/aarch64/dtrace_asm.S			optional dtrace compile-with "${DTRACE_S}"
 cddl/dev/dtrace/aarch64/dtrace_subr.c			optional dtrace compile-with "${DTRACE_C}"
 cddl/dev/fbt/aarch64/fbt_isa.c				optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
 
 # RockChip Drivers
 arm64/rockchip/rk3399_emmcphy.c		optional fdt rk_emmcphy soc_rockchip_rk3399
 arm64/rockchip/rk_dwc3.c		optional fdt rk_dwc3 soc_rockchip_rk3399
 arm64/rockchip/rk_i2c.c			optional fdt rk_i2c soc_rockchip_rk3328 | fdt rk_i2c soc_rockchip_rk3399
 arm64/rockchip/rk805.c			optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399
 arm64/rockchip/rk_grf.c			optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399
 arm64/rockchip/rk_pinctrl.c		optional fdt rk_pinctrl soc_rockchip_rk3328 | fdt rk_pinctrl soc_rockchip_rk3399
 arm64/rockchip/rk_gpio.c		optional fdt rk_gpio soc_rockchip_rk3328 | fdt rk_gpio soc_rockchip_rk3399
 arm64/rockchip/rk_spi.c			optional fdt rk_spi
 arm64/rockchip/rk_usb2phy.c		optional fdt rk_usb2phy soc_rockchip_rk3328 | soc_rockchip_rk3399
 arm64/rockchip/rk_typec_phy.c		optional fdt rk_typec_phy soc_rockchip_rk3399
 arm64/rockchip/if_dwc_rk.c		optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399
 dev/dwc/if_dwc.c			optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399
 dev/dwc/if_dwc_if.m			optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399
 
 # RockChip Clock support
 arm64/rockchip/clk/rk_cru.c		optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399
 arm64/rockchip/clk/rk_clk_armclk.c	optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399
 arm64/rockchip/clk/rk_clk_composite.c	optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399
+arm64/rockchip/clk/rk_clk_fract.c	optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399
 arm64/rockchip/clk/rk_clk_gate.c	optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399
 arm64/rockchip/clk/rk_clk_mux.c		optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399
 arm64/rockchip/clk/rk_clk_pll.c		optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399
 arm64/rockchip/clk/rk3328_cru.c		optional fdt soc_rockchip_rk3328
 arm64/rockchip/clk/rk3399_cru.c		optional fdt soc_rockchip_rk3399
 arm64/rockchip/clk/rk3399_pmucru.c	optional fdt soc_rockchip_rk3399
Index: stable/12/sys/dev/extres/clk/clk.c
===================================================================
--- stable/12/sys/dev/extres/clk/clk.c	(revision 358643)
+++ stable/12/sys/dev/extres/clk/clk.c	(revision 358644)
@@ -1,1568 +1,1642 @@
 /*-
  * Copyright 2016 Michal Meloun <mmel@FreeBSD.org>
  * All rights reserved.
  *
  * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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 <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
 #include "opt_platform.h"
 #include <sys/param.h>
 #include <sys/conf.h>
 #include <sys/bus.h>
 #include <sys/kernel.h>
 #include <sys/queue.h>
 #include <sys/kobj.h>
 #include <sys/malloc.h>
 #include <sys/mutex.h>
 #include <sys/limits.h>
 #include <sys/lock.h>
 #include <sys/sbuf.h>
 #include <sys/sysctl.h>
 #include <sys/systm.h>
 #include <sys/sx.h>
 
 #ifdef FDT
 #include <dev/fdt/fdt_common.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 #endif
 #include <dev/extres/clk/clk.h>
 
 SYSCTL_NODE(_hw, OID_AUTO, clock, CTLFLAG_RD, NULL, "Clocks");
 
 MALLOC_DEFINE(M_CLOCK, "clocks", "Clock framework");
 
 /* Forward declarations. */
 struct clk;
 struct clknodenode;
 struct clkdom;
 
 typedef TAILQ_HEAD(clknode_list, clknode) clknode_list_t;
 typedef TAILQ_HEAD(clkdom_list, clkdom) clkdom_list_t;
 
 /* Default clock methods. */
 static int clknode_method_init(struct clknode *clk, device_t dev);
 static int clknode_method_recalc_freq(struct clknode *clk, uint64_t *freq);
 static int clknode_method_set_freq(struct clknode *clk, uint64_t fin,
     uint64_t *fout, int flags, int *stop);
 static int clknode_method_set_gate(struct clknode *clk, bool enable);
 static int clknode_method_set_mux(struct clknode *clk, int idx);
 
 /*
  * Clock controller methods.
  */
 static clknode_method_t clknode_methods[] = {
 	CLKNODEMETHOD(clknode_init,		clknode_method_init),
 	CLKNODEMETHOD(clknode_recalc_freq,	clknode_method_recalc_freq),
 	CLKNODEMETHOD(clknode_set_freq,		clknode_method_set_freq),
 	CLKNODEMETHOD(clknode_set_gate,		clknode_method_set_gate),
 	CLKNODEMETHOD(clknode_set_mux,		clknode_method_set_mux),
 
 	CLKNODEMETHOD_END
 };
 DEFINE_CLASS_0(clknode, clknode_class, clknode_methods, 0);
 
 /*
  * Clock node - basic element for modeling SOC clock graph.  It holds the clock
  * provider's data about the clock, and the links for the clock's membership in
  * various lists.
  */
 struct clknode {
 	KOBJ_FIELDS;
 
 	/* Clock nodes topology. */
 	struct clkdom 		*clkdom;	/* Owning clock domain */
 	TAILQ_ENTRY(clknode)	clkdom_link;	/* Domain list entry */
 	TAILQ_ENTRY(clknode)	clklist_link;	/* Global list entry */
 
 	/* String based parent list. */
 	const char		**parent_names;	/* Array of parent names */
 	int			parent_cnt;	/* Number of parents */
 	int			parent_idx;	/* Parent index or -1 */
 
 	/* Cache for already resolved names. */
 	struct clknode		**parents;	/* Array of potential parents */
 	struct clknode		*parent;	/* Current parent */
 
 	/* Parent/child relationship links. */
 	clknode_list_t		children;	/* List of our children */
 	TAILQ_ENTRY(clknode)	sibling_link; 	/* Our entry in parent's list */
 
 	/* Details of this device. */
 	void			*softc;		/* Instance softc */
 	const char		*name;		/* Globally unique name */
 	intptr_t		id;		/* Per domain unique id */
 	int			flags;		/* CLK_FLAG_*  */
 	struct sx		lock;		/* Lock for this clock */
 	int			ref_cnt;	/* Reference counter */
 	int			enable_cnt;	/* Enabled counter */
 
 	/* Cached values. */
 	uint64_t		freq;		/* Actual frequency */
 
 	struct sysctl_ctx_list	sysctl_ctx;
 };
 
 /*
  *  Per consumer data, information about how a consumer is using a clock node.
  *  A pointer to this structure is used as a handle in the consumer interface.
  */
 struct clk {
 	device_t		dev;
 	struct clknode		*clknode;
 	int			enable_cnt;
 };
 
 /*
  * Clock domain - a group of clocks provided by one clock device.
  */
 struct clkdom {
 	device_t 		dev; 	/* Link to provider device */
 	TAILQ_ENTRY(clkdom)	link;		/* Global domain list entry */
 	clknode_list_t		clknode_list;	/* All clocks in the domain */
 
 #ifdef FDT
 	clknode_ofw_mapper_func	*ofw_mapper;	/* Find clock using FDT xref */
 #endif
 };
 
 /*
  * The system-wide list of clock domains.
  */
 static clkdom_list_t clkdom_list = TAILQ_HEAD_INITIALIZER(clkdom_list);
 
 /*
  * Each clock node is linked on a system-wide list and can be searched by name.
  */
 static clknode_list_t clknode_list = TAILQ_HEAD_INITIALIZER(clknode_list);
 
 /*
  * Locking - we use three levels of locking:
  * - First, topology lock is taken.  This one protect all lists.
  * - Second level is per clknode lock.  It protects clknode data.
  * - Third level is outside of this file, it protect clock device registers.
  * First two levels use sleepable locks; clock device can use mutex or sx lock.
  */
 static struct sx		clk_topo_lock;
 SX_SYSINIT(clock_topology, &clk_topo_lock, "Clock topology lock");
 
 #define CLK_TOPO_SLOCK()	sx_slock(&clk_topo_lock)
 #define CLK_TOPO_XLOCK()	sx_xlock(&clk_topo_lock)
 #define CLK_TOPO_UNLOCK()	sx_unlock(&clk_topo_lock)
 #define CLK_TOPO_ASSERT()	sx_assert(&clk_topo_lock, SA_LOCKED)
 #define CLK_TOPO_XASSERT()	sx_assert(&clk_topo_lock, SA_XLOCKED)
 
 #define CLKNODE_SLOCK(_sc)	sx_slock(&((_sc)->lock))
 #define CLKNODE_XLOCK(_sc)	sx_xlock(&((_sc)->lock))
 #define CLKNODE_UNLOCK(_sc)	sx_unlock(&((_sc)->lock))
 
 static void clknode_adjust_parent(struct clknode *clknode, int idx);
 
 enum clknode_sysctl_type {
 	CLKNODE_SYSCTL_PARENT,
 	CLKNODE_SYSCTL_PARENTS_LIST,
 	CLKNODE_SYSCTL_CHILDREN_LIST,
 };
 
 static int clknode_sysctl(SYSCTL_HANDLER_ARGS);
 static int clkdom_sysctl(SYSCTL_HANDLER_ARGS);
 
+static void clknode_finish(void *dummy);
+SYSINIT(clknode_finish, SI_SUB_LAST, SI_ORDER_ANY, clknode_finish, NULL);
+
 /*
  * Default clock methods for base class.
  */
 static int
 clknode_method_init(struct clknode *clknode, device_t dev)
 {
 
 	return (0);
 }
 
 static int
 clknode_method_recalc_freq(struct clknode *clknode, uint64_t *freq)
 {
 
 	return (0);
 }
 
 static int
 clknode_method_set_freq(struct clknode *clknode, uint64_t fin,  uint64_t *fout,
    int flags, int *stop)
 {
 
 	*stop = 0;
 	return (0);
 }
 
 static int
 clknode_method_set_gate(struct clknode *clk, bool enable)
 {
 
 	return (0);
 }
 
 static int
 clknode_method_set_mux(struct clknode *clk, int idx)
 {
 
 	return (0);
 }
 
 /*
  * Internal functions.
  */
 
 /*
  * Duplicate an array of parent names.
  *
  * Compute total size and allocate a single block which holds both the array of
  * pointers to strings and the copied strings themselves.  Returns a pointer to
  * the start of the block where the array of copied string pointers lives.
  *
  * XXX Revisit this, no need for the DECONST stuff.
  */
 static const char **
 strdup_list(const char **names, int num)
 {
 	size_t len, slen;
 	const char **outptr, *ptr;
 	int i;
 
 	len = sizeof(char *) * num;
 	for (i = 0; i < num; i++) {
 		if (names[i] == NULL)
 			continue;
 		slen = strlen(names[i]);
 		if (slen == 0)
 			panic("Clock parent names array have empty string");
 		len += slen + 1;
 	}
 	outptr = malloc(len, M_CLOCK, M_WAITOK | M_ZERO);
 	ptr = (char *)(outptr + num);
 	for (i = 0; i < num; i++) {
 		if (names[i] == NULL)
 			continue;
 		outptr[i] = ptr;
 		slen = strlen(names[i]) + 1;
 		bcopy(names[i], __DECONST(void *, outptr[i]), slen);
 		ptr += slen;
 	}
 	return (outptr);
 }
 
 /*
  * Recompute the cached frequency for this node and all its children.
  */
 static int
 clknode_refresh_cache(struct clknode *clknode, uint64_t freq)
 {
 	int rv;
 	struct clknode *entry;
 
 	CLK_TOPO_XASSERT();
 
 	/* Compute generated frequency. */
 	rv = CLKNODE_RECALC_FREQ(clknode, &freq);
 	if (rv != 0) {
 		 /* XXX If an error happens while refreshing children
 		  * this leaves the world in a  partially-updated state.
 		  * Panic for now.
 		  */
 		panic("clknode_refresh_cache failed for '%s'\n",
 		    clknode->name);
 		return (rv);
 	}
 	/* Refresh cache for this node. */
 	clknode->freq = freq;
 
 	/* Refresh cache for all children. */
 	TAILQ_FOREACH(entry, &(clknode->children), sibling_link) {
 		rv = clknode_refresh_cache(entry, freq);
 		if (rv != 0)
 			return (rv);
 	}
 	return (0);
 }
 
 /*
  * Public interface.
  */
 
 struct clknode *
 clknode_find_by_name(const char *name)
 {
 	struct clknode *entry;
 
 	CLK_TOPO_ASSERT();
 
 	TAILQ_FOREACH(entry, &clknode_list, clklist_link) {
 		if (strcmp(entry->name, name) == 0)
 			return (entry);
 	}
 	return (NULL);
 }
 
 struct clknode *
 clknode_find_by_id(struct clkdom *clkdom, intptr_t id)
 {
 	struct clknode *entry;
 
 	CLK_TOPO_ASSERT();
 
 	TAILQ_FOREACH(entry, &clkdom->clknode_list, clkdom_link) {
 		if (entry->id ==  id)
 			return (entry);
 	}
 
 	return (NULL);
 }
 
 /* -------------------------------------------------------------------------- */
 /*
  * Clock domain functions
  */
 
 /* Find clock domain associated to device in global list. */
 struct clkdom *
 clkdom_get_by_dev(const device_t dev)
 {
 	struct clkdom *entry;
 
 	CLK_TOPO_ASSERT();
 
 	TAILQ_FOREACH(entry, &clkdom_list, link) {
 		if (entry->dev == dev)
 			return (entry);
 	}
 	return (NULL);
 }
 
 
 #ifdef FDT
 /* Default DT mapper. */
 static int
 clknode_default_ofw_map(struct clkdom *clkdom, uint32_t ncells,
     phandle_t *cells, struct clknode **clk)
 {
 
 	CLK_TOPO_ASSERT();
 
 	if (ncells == 0)
 		*clk = clknode_find_by_id(clkdom, 1);
 	else if (ncells == 1)
 		*clk = clknode_find_by_id(clkdom, cells[0]);
 	else
 		return  (ERANGE);
 
 	if (*clk == NULL)
 		return (ENXIO);
 	return (0);
 }
 #endif
 
 /*
  * Create a clock domain.  Returns with the topo lock held.
  */
 struct clkdom *
 clkdom_create(device_t dev)
 {
 	struct clkdom *clkdom;
 
 	clkdom = malloc(sizeof(struct clkdom), M_CLOCK, M_WAITOK | M_ZERO);
 	clkdom->dev = dev;
 	TAILQ_INIT(&clkdom->clknode_list);
 #ifdef FDT
 	clkdom->ofw_mapper = clknode_default_ofw_map;
 #endif
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
 	  SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
 	  OID_AUTO, "clocks",
 	  CTLTYPE_STRING | CTLFLAG_RD,
 		    clkdom, 0, clkdom_sysctl,
 		    "A",
 		    "Clock list for the domain");
 
 	return (clkdom);
 }
 
 void
 clkdom_unlock(struct clkdom *clkdom)
 {
 
 	CLK_TOPO_UNLOCK();
 }
 
 void
 clkdom_xlock(struct clkdom *clkdom)
 {
 
 	CLK_TOPO_XLOCK();
 }
 
 /*
  * Finalize initialization of clock domain.  Releases topo lock.
  *
  * XXX Revisit failure handling.
  */
 int
 clkdom_finit(struct clkdom *clkdom)
 {
 	struct clknode *clknode;
 	int i, rv;
 #ifdef FDT
 	phandle_t node;
 
 
 	if ((node = ofw_bus_get_node(clkdom->dev)) == -1) {
 		device_printf(clkdom->dev,
 		    "%s called on not ofw based device\n", __func__);
 		return (ENXIO);
 	}
 #endif
 	rv = 0;
 
 	/* Make clock domain globally visible. */
 	CLK_TOPO_XLOCK();
 	TAILQ_INSERT_TAIL(&clkdom_list, clkdom, link);
 #ifdef FDT
 	OF_device_register_xref(OF_xref_from_node(node), clkdom->dev);
 #endif
 
 	/* Register all clock names into global list. */
 	TAILQ_FOREACH(clknode, &clkdom->clknode_list, clkdom_link) {
 		TAILQ_INSERT_TAIL(&clknode_list, clknode, clklist_link);
 	}
 	/*
 	 * At this point all domain nodes must be registered and all
 	 * parents must be valid.
 	 */
 	TAILQ_FOREACH(clknode, &clkdom->clknode_list, clkdom_link) {
 		if (clknode->parent_cnt == 0)
 			continue;
 		for (i = 0; i < clknode->parent_cnt; i++) {
 			if (clknode->parents[i] != NULL)
 				continue;
 			if (clknode->parent_names[i] == NULL)
 				continue;
 			clknode->parents[i] = clknode_find_by_name(
 			    clknode->parent_names[i]);
 			if (clknode->parents[i] == NULL) {
 				device_printf(clkdom->dev,
 				    "Clock %s have unknown parent: %s\n",
 				    clknode->name, clknode->parent_names[i]);
 				rv = ENODEV;
 			}
 		}
 
 		/* If parent index is not set yet... */
 		if (clknode->parent_idx == CLKNODE_IDX_NONE) {
 			device_printf(clkdom->dev,
 			    "Clock %s have not set parent idx\n",
 			    clknode->name);
 			rv = ENXIO;
 			continue;
 		}
 		if (clknode->parents[clknode->parent_idx] == NULL) {
 			device_printf(clkdom->dev,
 			    "Clock %s have unknown parent(idx %d): %s\n",
 			    clknode->name, clknode->parent_idx,
 			    clknode->parent_names[clknode->parent_idx]);
 			rv = ENXIO;
 			continue;
 		}
 		clknode_adjust_parent(clknode, clknode->parent_idx);
 	}
 	CLK_TOPO_UNLOCK();
 	return (rv);
 }
 
 /* Dump clock domain. */
 void
 clkdom_dump(struct clkdom * clkdom)
 {
 	struct clknode *clknode;
 	int rv;
 	uint64_t freq;
 
 	CLK_TOPO_SLOCK();
 	TAILQ_FOREACH(clknode, &clkdom->clknode_list, clkdom_link) {
 		rv = clknode_get_freq(clknode, &freq);
 		printf("Clock: %s, parent: %s(%d), freq: %ju\n", clknode->name,
 		    clknode->parent == NULL ? "(NULL)" : clknode->parent->name,
 		    clknode->parent_idx,
 		    (uintmax_t)((rv == 0) ? freq: rv));
 	}
 	CLK_TOPO_UNLOCK();
 }
 
 /*
  * Create and initialize clock object, but do not register it.
  */
 struct clknode *
 clknode_create(struct clkdom * clkdom, clknode_class_t clknode_class,
     const struct clknode_init_def *def)
 {
 	struct clknode *clknode;
 	struct sysctl_oid *clknode_oid;
+	bool replaced;
 
 	KASSERT(def->name != NULL, ("clock name is NULL"));
 	KASSERT(def->name[0] != '\0', ("clock name is empty"));
-#ifdef   INVARIANTS
+	if (def->flags & CLK_NODE_LINKED) {
+		KASSERT(def->parent_cnt == 0,
+		 ("Linked clock must not have parents"));
+		KASSERT(clknode_class->size== 0,
+		 ("Linked clock cannot have own softc"));
+	}
+
+	/* Process duplicated clocks */
 	CLK_TOPO_SLOCK();
-	if (clknode_find_by_name(def->name) != NULL)
-		panic("Duplicated clock registration: %s\n", def->name);
+	clknode = clknode_find_by_name(def->name);
 	CLK_TOPO_UNLOCK();
-#endif
+		if (clknode !=  NULL) {
+		if (!(clknode->flags & CLK_NODE_LINKED) &&
+		    def->flags & CLK_NODE_LINKED) {
+			/*
+			 * New clock is linked and real already exists.
+			 * Do nothing and return real node. It is in right
+			 * domain, enqueued in right lists and fully initialized.
+			 */
+			return (clknode);
+		} else if (clknode->flags & CLK_NODE_LINKED &&
+		   !(def->flags & CLK_NODE_LINKED)) {
+			/*
+			 * New clock is real but linked already exists.
+			 * Remove old linked node from originating domain
+			 * (real clock must be owned by another) and from
+			 * global names link (it will be added back into it
+			 * again in following clknode_register()). Then reuse
+			 * original clknode structure and reinitialize it
+			 * with new dat. By this, all lists containing this
+			 * node remains valid, but the new node virtually
+			 * replace the linked one.
+			 */
+			KASSERT(clkdom != clknode->clkdom,
+			    ("linked clock must be from another "
+			    "domain that real one"));
+			TAILQ_REMOVE(&clkdom->clknode_list, clknode,
+			    clkdom_link);
+			TAILQ_REMOVE(&clknode_list, clknode, clklist_link);
+			replaced = true;
+		} else if (clknode->flags & CLK_NODE_LINKED &&
+		   def->flags & CLK_NODE_LINKED) {
+			/*
+			 * Both clocks are linked.
+			 * Return old one, so we hold only one copy od link.
+			 */
+			return (clknode);
+		} else {
+			/* Both clocks are real */
+			panic("Duplicated clock registration: %s\n", def->name);
+		}
+	} else {
+		/* Create clknode object and initialize it. */
+		clknode = malloc(sizeof(struct clknode), M_CLOCK,
+		    M_WAITOK | M_ZERO);
+		sx_init(&clknode->lock, "Clocknode lock");
+		TAILQ_INIT(&clknode->children);
+		replaced = false;
+	}
 
-	/* Create object and initialize it. */
-	clknode = malloc(sizeof(struct clknode), M_CLOCK, M_WAITOK | M_ZERO);
 	kobj_init((kobj_t)clknode, (kobj_class_t)clknode_class);
-	sx_init(&clknode->lock, "Clocknode lock");
 
 	/* Allocate softc if required. */
 	if (clknode_class->size > 0) {
 		clknode->softc = malloc(clknode_class->size,
 		    M_CLOCK, M_WAITOK | M_ZERO);
 	}
 
 	/* Prepare array for ptrs to parent clocks. */
 	clknode->parents = malloc(sizeof(struct clknode *) * def->parent_cnt,
 	    M_CLOCK, M_WAITOK | M_ZERO);
 
 	/* Copy all strings unless they're flagged as static. */
 	if (def->flags & CLK_NODE_STATIC_STRINGS) {
 		clknode->name = def->name;
 		clknode->parent_names = def->parent_names;
 	} else {
 		clknode->name = strdup(def->name, M_CLOCK);
 		clknode->parent_names =
 		    strdup_list(def->parent_names, def->parent_cnt);
 	}
 
 	/* Rest of init. */
 	clknode->id = def->id;
 	clknode->clkdom = clkdom;
 	clknode->flags = def->flags;
 	clknode->parent_cnt = def->parent_cnt;
 	clknode->parent = NULL;
 	clknode->parent_idx = CLKNODE_IDX_NONE;
-	TAILQ_INIT(&clknode->children);
 
+	if (replaced)
+			return (clknode);
+
 	sysctl_ctx_init(&clknode->sysctl_ctx);
 	clknode_oid = SYSCTL_ADD_NODE(&clknode->sysctl_ctx,
 	    SYSCTL_STATIC_CHILDREN(_hw_clock),
 	    OID_AUTO, clknode->name,
 	    CTLFLAG_RD, 0, "A clock node");
 
 	SYSCTL_ADD_U64(&clknode->sysctl_ctx,
 	    SYSCTL_CHILDREN(clknode_oid),
 	    OID_AUTO, "frequency",
 	    CTLFLAG_RD, &clknode->freq, 0, "The clock frequency");
 	SYSCTL_ADD_PROC(&clknode->sysctl_ctx,
 	    SYSCTL_CHILDREN(clknode_oid),
 	    OID_AUTO, "parent",
 	    CTLTYPE_STRING | CTLFLAG_RD,
 	    clknode, CLKNODE_SYSCTL_PARENT, clknode_sysctl,
 	    "A",
 	    "The clock parent");
 	SYSCTL_ADD_PROC(&clknode->sysctl_ctx,
 	    SYSCTL_CHILDREN(clknode_oid),
 	    OID_AUTO, "parents",
 	    CTLTYPE_STRING | CTLFLAG_RD,
 	    clknode, CLKNODE_SYSCTL_PARENTS_LIST, clknode_sysctl,
 	    "A",
 	    "The clock parents list");
 	SYSCTL_ADD_PROC(&clknode->sysctl_ctx,
 	    SYSCTL_CHILDREN(clknode_oid),
 	    OID_AUTO, "childrens",
 	    CTLTYPE_STRING | CTLFLAG_RD,
 	    clknode, CLKNODE_SYSCTL_CHILDREN_LIST, clknode_sysctl,
 	    "A",
 	    "The clock childrens list");
 	SYSCTL_ADD_INT(&clknode->sysctl_ctx,
 	    SYSCTL_CHILDREN(clknode_oid),
 	    OID_AUTO, "enable_cnt",
 	    CTLFLAG_RD, &clknode->enable_cnt, 0, "The clock enable counter");
 
 	return (clknode);
 }
 
 /*
  * Register clock object into clock domain hierarchy.
  */
 struct clknode *
 clknode_register(struct clkdom * clkdom, struct clknode *clknode)
 {
 	int rv;
 
+	/* Skip already registered linked node */
+	if (clknode->flags & CLK_NODE_REGISTERED)
+		return(clknode);
+
 	rv = CLKNODE_INIT(clknode, clknode_get_device(clknode));
 	if (rv != 0) {
 		printf(" CLKNODE_INIT failed: %d\n", rv);
 		return (NULL);
 	}
 
 	TAILQ_INSERT_TAIL(&clkdom->clknode_list, clknode, clkdom_link);
-
+	clknode->flags |= CLK_NODE_REGISTERED;
 	return (clknode);
 }
 
+
+static void
+clknode_finish(void *dummy)
+{
+	struct clknode *clknode;
+
+	CLK_TOPO_SLOCK();
+	TAILQ_FOREACH(clknode, &clknode_list, clklist_link) {
+		if (clknode->flags & CLK_NODE_LINKED)
+			printf("Unresolved linked clock found: %s\n",
+			    clknode->name);
+	}
+	CLK_TOPO_UNLOCK();
+}
 /*
  * Clock providers interface.
  */
 
 /*
  * Reparent clock node.
  */
 static void
 clknode_adjust_parent(struct clknode *clknode, int idx)
 {
 
 	CLK_TOPO_XASSERT();
 
 	if (clknode->parent_cnt == 0)
 		return;
 	if ((idx == CLKNODE_IDX_NONE) || (idx >= clknode->parent_cnt))
 		panic("%s: Invalid parent index %d for clock %s",
 		    __func__, idx, clknode->name);
 
 	if (clknode->parents[idx] == NULL)
 		panic("%s: Invalid parent index %d for clock %s",
 		    __func__, idx, clknode->name);
 
 	/* Remove me from old children list. */
 	if (clknode->parent != NULL) {
 		TAILQ_REMOVE(&clknode->parent->children, clknode, sibling_link);
 	}
 
 	/* Insert into children list of new parent. */
 	clknode->parent_idx = idx;
 	clknode->parent = clknode->parents[idx];
 	TAILQ_INSERT_TAIL(&clknode->parent->children, clknode, sibling_link);
 }
 
 /*
  * Set parent index - init function.
  */
 void
 clknode_init_parent_idx(struct clknode *clknode, int idx)
 {
 
 	if (clknode->parent_cnt == 0) {
 		clknode->parent_idx = CLKNODE_IDX_NONE;
 		clknode->parent = NULL;
 		return;
 	}
 	if ((idx == CLKNODE_IDX_NONE) ||
 	    (idx >= clknode->parent_cnt) ||
 	    (clknode->parent_names[idx] == NULL))
 		panic("%s: Invalid parent index %d for clock %s",
 		    __func__, idx, clknode->name);
 	clknode->parent_idx = idx;
 }
 
 int
 clknode_set_parent_by_idx(struct clknode *clknode, int idx)
 {
 	int rv;
 	uint64_t freq;
 	int  oldidx;
 
 	/* We have exclusive topology lock, node lock is not needed. */
 	CLK_TOPO_XASSERT();
 
 	if (clknode->parent_cnt == 0)
 		return (0);
 
 	if (clknode->parent_idx == idx)
 		return (0);
 
 	oldidx = clknode->parent_idx;
 	clknode_adjust_parent(clknode, idx);
 	rv = CLKNODE_SET_MUX(clknode, idx);
 	if (rv != 0) {
 		clknode_adjust_parent(clknode, oldidx);
 		return (rv);
 	}
 	rv = clknode_get_freq(clknode->parent, &freq);
 	if (rv != 0)
 		return (rv);
 	rv = clknode_refresh_cache(clknode, freq);
 	return (rv);
 }
 
 int
 clknode_set_parent_by_name(struct clknode *clknode, const char *name)
 {
 	int rv;
 	uint64_t freq;
 	int  oldidx, idx;
 
 	/* We have exclusive topology lock, node lock is not needed. */
 	CLK_TOPO_XASSERT();
 
 	if (clknode->parent_cnt == 0)
 		return (0);
 
 	/*
 	 * If this node doesnt have mux, then passthrough request to parent.
 	 * This feature is used in clock domain initialization and allows us to
 	 * set clock source and target frequency on the tail node of the clock
 	 * chain.
 	 */
 	if (clknode->parent_cnt == 1) {
 		rv = clknode_set_parent_by_name(clknode->parent, name);
 		return (rv);
 	}
 
 	for (idx = 0; idx < clknode->parent_cnt; idx++) {
 		if (clknode->parent_names[idx] == NULL)
 			continue;
 		if (strcmp(clknode->parent_names[idx], name) == 0)
 			break;
 	}
 	if (idx >= clknode->parent_cnt) {
 		return (ENXIO);
 	}
 	if (clknode->parent_idx == idx)
 		return (0);
 
 	oldidx = clknode->parent_idx;
 	clknode_adjust_parent(clknode, idx);
 	rv = CLKNODE_SET_MUX(clknode, idx);
 	if (rv != 0) {
 		clknode_adjust_parent(clknode, oldidx);
 		CLKNODE_UNLOCK(clknode);
 		return (rv);
 	}
 	rv = clknode_get_freq(clknode->parent, &freq);
 	if (rv != 0)
 		return (rv);
 	rv = clknode_refresh_cache(clknode, freq);
 	return (rv);
 }
 
 struct clknode *
 clknode_get_parent(struct clknode *clknode)
 {
 
 	return (clknode->parent);
 }
 
 const char *
 clknode_get_name(struct clknode *clknode)
 {
 
 	return (clknode->name);
 }
 
 const char **
 clknode_get_parent_names(struct clknode *clknode)
 {
 
 	return (clknode->parent_names);
 }
 
 int
 clknode_get_parents_num(struct clknode *clknode)
 {
 
 	return (clknode->parent_cnt);
 }
 
 int
 clknode_get_parent_idx(struct clknode *clknode)
 {
 
 	return (clknode->parent_idx);
 }
 
 int
 clknode_get_flags(struct clknode *clknode)
 {
 
 	return (clknode->flags);
 }
 
 
 void *
 clknode_get_softc(struct clknode *clknode)
 {
 
 	return (clknode->softc);
 }
 
 device_t
 clknode_get_device(struct clknode *clknode)
 {
 
 	return (clknode->clkdom->dev);
 }
 
 #ifdef FDT
 void
 clkdom_set_ofw_mapper(struct clkdom * clkdom, clknode_ofw_mapper_func *map)
 {
 
 	clkdom->ofw_mapper = map;
 }
 #endif
 
 /*
  * Real consumers executive
  */
 int
 clknode_get_freq(struct clknode *clknode, uint64_t *freq)
 {
 	int rv;
 
 	CLK_TOPO_ASSERT();
 
 	/* Use cached value, if it exists. */
 	*freq  = clknode->freq;
 	if (*freq != 0)
 		return (0);
 
 	/* Get frequency from parent, if the clock has a parent. */
 	if (clknode->parent_cnt > 0) {
 		rv = clknode_get_freq(clknode->parent, freq);
 		if (rv != 0) {
 			return (rv);
 		}
 	}
 
 	/* And recalculate my output frequency. */
 	CLKNODE_XLOCK(clknode);
 	rv = CLKNODE_RECALC_FREQ(clknode, freq);
 	if (rv != 0) {
 		CLKNODE_UNLOCK(clknode);
 		printf("Cannot get frequency for clk: %s, error: %d\n",
 		    clknode->name, rv);
 		return (rv);
 	}
 
 	/* Save new frequency to cache. */
 	clknode->freq = *freq;
 	CLKNODE_UNLOCK(clknode);
 	return (0);
 }
 
 int
 clknode_set_freq(struct clknode *clknode, uint64_t freq, int flags,
     int enablecnt)
 {
 	int rv, done;
 	uint64_t parent_freq;
 
 	/* We have exclusive topology lock, node lock is not needed. */
 	CLK_TOPO_XASSERT();
 
 	/* Check for no change */
 	if (clknode->freq == freq)
 		return (0);
 
 	parent_freq = 0;
 
 	/*
 	 * We can set frequency only if
 	 *   clock is disabled
 	 * OR
 	 *   clock is glitch free and is enabled by calling consumer only
 	 */
 	if ((flags & CLK_SET_DRYRUN) == 0 &&
 	    clknode->enable_cnt > 1 &&
 	    clknode->enable_cnt > enablecnt &&
 	    (clknode->flags & CLK_NODE_GLITCH_FREE) == 0) {
 		return (EBUSY);
 	}
 
 	/* Get frequency from parent, if the clock has a parent. */
 	if (clknode->parent_cnt > 0) {
 		rv = clknode_get_freq(clknode->parent, &parent_freq);
 		if (rv != 0) {
 			return (rv);
 		}
 	}
 
 	/* Set frequency for this clock. */
 	rv = CLKNODE_SET_FREQ(clknode, parent_freq, &freq, flags, &done);
 	if (rv != 0) {
 		printf("Cannot set frequency for clk: %s, error: %d\n",
 		    clknode->name, rv);
 		if ((flags & CLK_SET_DRYRUN) == 0)
 			clknode_refresh_cache(clknode, parent_freq);
 		return (rv);
 	}
 
 	if (done) {
 		/* Success - invalidate frequency cache for all children. */
 		if ((flags & CLK_SET_DRYRUN) == 0) {
 			clknode->freq = freq;
 			/* Clock might have reparent during set_freq */
 			if (clknode->parent_cnt > 0) {
 				rv = clknode_get_freq(clknode->parent,
 				    &parent_freq);
 				if (rv != 0) {
 					return (rv);
 				}
 			}
 			clknode_refresh_cache(clknode, parent_freq);
 		}
 	} else if (clknode->parent != NULL) {
 		/* Nothing changed, pass request to parent. */
 		rv = clknode_set_freq(clknode->parent, freq, flags, enablecnt);
 	} else {
 		/* End of chain without action. */
 		printf("Cannot set frequency for clk: %s, end of chain\n",
 		    clknode->name);
 		rv = ENXIO;
 	}
 
 	return (rv);
 }
 
 int
 clknode_enable(struct clknode *clknode)
 {
 	int rv;
 
 	CLK_TOPO_ASSERT();
 
 	/* Enable clock for each node in chain, starting from source. */
 	if (clknode->parent_cnt > 0) {
 		rv = clknode_enable(clknode->parent);
 		if (rv != 0) {
 			return (rv);
 		}
 	}
 
 	/* Handle this node */
 	CLKNODE_XLOCK(clknode);
 	if (clknode->enable_cnt == 0) {
 		rv = CLKNODE_SET_GATE(clknode, 1);
 		if (rv != 0) {
 			CLKNODE_UNLOCK(clknode);
 			return (rv);
 		}
 	}
 	clknode->enable_cnt++;
 	CLKNODE_UNLOCK(clknode);
 	return (0);
 }
 
 int
 clknode_disable(struct clknode *clknode)
 {
 	int rv;
 
 	CLK_TOPO_ASSERT();
 	rv = 0;
 
 	CLKNODE_XLOCK(clknode);
 	/* Disable clock for each node in chain, starting from consumer. */
 	if ((clknode->enable_cnt == 1) &&
 	    ((clknode->flags & CLK_NODE_CANNOT_STOP) == 0)) {
 		rv = CLKNODE_SET_GATE(clknode, 0);
 		if (rv != 0) {
 			CLKNODE_UNLOCK(clknode);
 			return (rv);
 		}
 	}
 	clknode->enable_cnt--;
 	CLKNODE_UNLOCK(clknode);
 
 	if (clknode->parent_cnt > 0) {
 		rv = clknode_disable(clknode->parent);
 	}
 	return (rv);
 }
 
 int
 clknode_stop(struct clknode *clknode, int depth)
 {
 	int rv;
 
 	CLK_TOPO_ASSERT();
 	rv = 0;
 
 	CLKNODE_XLOCK(clknode);
 	/* The first node cannot be enabled. */
 	if ((clknode->enable_cnt != 0) && (depth == 0)) {
 		CLKNODE_UNLOCK(clknode);
 		return (EBUSY);
 	}
 	/* Stop clock for each node in chain, starting from consumer. */
 	if ((clknode->enable_cnt == 0) &&
 	    ((clknode->flags & CLK_NODE_CANNOT_STOP) == 0)) {
 		rv = CLKNODE_SET_GATE(clknode, 0);
 		if (rv != 0) {
 			CLKNODE_UNLOCK(clknode);
 			return (rv);
 		}
 	}
 	CLKNODE_UNLOCK(clknode);
 
 	if (clknode->parent_cnt > 0)
 		rv = clknode_stop(clknode->parent, depth + 1);
 	return (rv);
 }
 
 /* --------------------------------------------------------------------------
  *
  * Clock consumers interface.
  *
  */
 /* Helper function for clk_get*() */
 static clk_t
 clk_create(struct clknode *clknode, device_t dev)
 {
 	struct clk *clk;
 
 	CLK_TOPO_ASSERT();
 
 	clk =  malloc(sizeof(struct clk), M_CLOCK, M_WAITOK);
 	clk->dev = dev;
 	clk->clknode = clknode;
 	clk->enable_cnt = 0;
 	clknode->ref_cnt++;
 
 	return (clk);
 }
 
 int
 clk_get_freq(clk_t clk, uint64_t *freq)
 {
 	int rv;
 	struct clknode *clknode;
 
 	clknode = clk->clknode;
 	KASSERT(clknode->ref_cnt > 0,
 	   ("Attempt to access unreferenced clock: %s\n", clknode->name));
 
 	CLK_TOPO_SLOCK();
 	rv = clknode_get_freq(clknode, freq);
 	CLK_TOPO_UNLOCK();
 	return (rv);
 }
 
 int
 clk_set_freq(clk_t clk, uint64_t freq, int flags)
 {
 	int rv;
 	struct clknode *clknode;
 
 	flags &= CLK_SET_USER_MASK;
 	clknode = clk->clknode;
 	KASSERT(clknode->ref_cnt > 0,
 	   ("Attempt to access unreferenced clock: %s\n", clknode->name));
 
 	CLK_TOPO_XLOCK();
 	rv = clknode_set_freq(clknode, freq, flags, clk->enable_cnt);
 	CLK_TOPO_UNLOCK();
 	return (rv);
 }
 
 int
 clk_test_freq(clk_t clk, uint64_t freq, int flags)
 {
 	int rv;
 	struct clknode *clknode;
 
 	flags &= CLK_SET_USER_MASK;
 	clknode = clk->clknode;
 	KASSERT(clknode->ref_cnt > 0,
 	   ("Attempt to access unreferenced clock: %s\n", clknode->name));
 
 	CLK_TOPO_XLOCK();
 	rv = clknode_set_freq(clknode, freq, flags | CLK_SET_DRYRUN, 0);
 	CLK_TOPO_UNLOCK();
 	return (rv);
 }
 
 int
 clk_get_parent(clk_t clk, clk_t *parent)
 {
 	struct clknode *clknode;
 	struct clknode *parentnode;
 
 	clknode = clk->clknode;
 	KASSERT(clknode->ref_cnt > 0,
 	   ("Attempt to access unreferenced clock: %s\n", clknode->name));
 
 	CLK_TOPO_SLOCK();
 	parentnode = clknode_get_parent(clknode);
 	if (parentnode == NULL) {
 		CLK_TOPO_UNLOCK();
 		return (ENODEV);
 	}
 	*parent = clk_create(parentnode, clk->dev);
 	CLK_TOPO_UNLOCK();
 	return (0);
 }
 
 int
 clk_set_parent_by_clk(clk_t clk, clk_t parent)
 {
 	int rv;
 	struct clknode *clknode;
 	struct clknode *parentnode;
 
 	clknode = clk->clknode;
 	parentnode = parent->clknode;
 	KASSERT(clknode->ref_cnt > 0,
 	   ("Attempt to access unreferenced clock: %s\n", clknode->name));
 	KASSERT(parentnode->ref_cnt > 0,
 	   ("Attempt to access unreferenced clock: %s\n", clknode->name));
 	CLK_TOPO_XLOCK();
 	rv = clknode_set_parent_by_name(clknode, parentnode->name);
 	CLK_TOPO_UNLOCK();
 	return (rv);
 }
 
 int
 clk_enable(clk_t clk)
 {
 	int rv;
 	struct clknode *clknode;
 
 	clknode = clk->clknode;
 	KASSERT(clknode->ref_cnt > 0,
 	   ("Attempt to access unreferenced clock: %s\n", clknode->name));
 	CLK_TOPO_SLOCK();
 	rv = clknode_enable(clknode);
 	if (rv == 0)
 		clk->enable_cnt++;
 	CLK_TOPO_UNLOCK();
 	return (rv);
 }
 
 int
 clk_disable(clk_t clk)
 {
 	int rv;
 	struct clknode *clknode;
 
 	clknode = clk->clknode;
 	KASSERT(clknode->ref_cnt > 0,
 	   ("Attempt to access unreferenced clock: %s\n", clknode->name));
 	KASSERT(clk->enable_cnt > 0,
 	   ("Attempt to disable already disabled clock: %s\n", clknode->name));
 	CLK_TOPO_SLOCK();
 	rv = clknode_disable(clknode);
 	if (rv == 0)
 		clk->enable_cnt--;
 	CLK_TOPO_UNLOCK();
 	return (rv);
 }
 
 int
 clk_stop(clk_t clk)
 {
 	int rv;
 	struct clknode *clknode;
 
 	clknode = clk->clknode;
 	KASSERT(clknode->ref_cnt > 0,
 	   ("Attempt to access unreferenced clock: %s\n", clknode->name));
 	KASSERT(clk->enable_cnt == 0,
 	   ("Attempt to stop already enabled clock: %s\n", clknode->name));
 
 	CLK_TOPO_SLOCK();
 	rv = clknode_stop(clknode, 0);
 	CLK_TOPO_UNLOCK();
 	return (rv);
 }
 
 int
 clk_release(clk_t clk)
 {
 	struct clknode *clknode;
 
 	clknode = clk->clknode;
 	KASSERT(clknode->ref_cnt > 0,
 	   ("Attempt to access unreferenced clock: %s\n", clknode->name));
 	CLK_TOPO_SLOCK();
 	while (clk->enable_cnt > 0) {
 		clknode_disable(clknode);
 		clk->enable_cnt--;
 	}
 	CLKNODE_XLOCK(clknode);
 	clknode->ref_cnt--;
 	CLKNODE_UNLOCK(clknode);
 	CLK_TOPO_UNLOCK();
 
 	free(clk, M_CLOCK);
 	return (0);
 }
 
 const char *
 clk_get_name(clk_t clk)
 {
 	const char *name;
 	struct clknode *clknode;
 
 	clknode = clk->clknode;
 	KASSERT(clknode->ref_cnt > 0,
 	   ("Attempt to access unreferenced clock: %s\n", clknode->name));
 	name = clknode_get_name(clknode);
 	return (name);
 }
 
 int
 clk_get_by_name(device_t dev, const char *name, clk_t *clk)
 {
 	struct clknode *clknode;
 
 	CLK_TOPO_SLOCK();
 	clknode = clknode_find_by_name(name);
 	if (clknode == NULL) {
 		CLK_TOPO_UNLOCK();
 		return (ENODEV);
 	}
 	*clk = clk_create(clknode, dev);
 	CLK_TOPO_UNLOCK();
 	return (0);
 }
 
 int
 clk_get_by_id(device_t dev, struct clkdom *clkdom, intptr_t id, clk_t *clk)
 {
 	struct clknode *clknode;
 
 	CLK_TOPO_SLOCK();
 
 	clknode = clknode_find_by_id(clkdom, id);
 	if (clknode == NULL) {
 		CLK_TOPO_UNLOCK();
 		return (ENODEV);
 	}
 	*clk = clk_create(clknode, dev);
 	CLK_TOPO_UNLOCK();
 
 	return (0);
 }
 
 #ifdef FDT
 
 static void
 clk_set_assigned_parent(device_t dev, clk_t clk, int idx)
 {
 	clk_t parent;
 	const char *pname;
 	int rv;
 
 	rv = clk_get_by_ofw_index_prop(dev, 0,
 	    "assigned-clock-parents", idx, &parent);
 	if (rv != 0) {
 		device_printf(dev,
 		    "cannot get parent at idx %d\n", idx);
 		return;
 	}
 
 	pname = clk_get_name(parent);
 	rv = clk_set_parent_by_clk(clk, parent);
 	if (rv != 0)
 		device_printf(dev,
 		    "Cannot set parent %s for clock %s\n",
 		    pname, clk_get_name(clk));
 	else if (bootverbose)
 		device_printf(dev, "Set %s as the parent of %s\n",
 		    pname, clk_get_name(clk));
 	clk_release(parent);
 }
 
 static void
 clk_set_assigned_rates(device_t dev, clk_t clk, uint32_t freq)
 {
 	int rv;
 
 	rv = clk_set_freq(clk, freq, CLK_SET_ROUND_DOWN | CLK_SET_ROUND_UP);
 	if (rv != 0) {
 		device_printf(dev, "Failed to set %s to a frequency of %u\n",
 		    clk_get_name(clk), freq);
 		return;
 	}
 	if (bootverbose)
 		device_printf(dev, "Set %s to %u\n",
 		    clk_get_name(clk), freq);
 }
 
 int
 clk_set_assigned(device_t dev, phandle_t node)
 {
 	clk_t clk;
 	uint32_t *rates;
 	int rv, nclocks, nrates, nparents, i;
 
 	rv = ofw_bus_parse_xref_list_get_length(node,
 	    "assigned-clocks", "#clock-cells", &nclocks);
 
 	if (rv != 0) {
 		if (rv != ENOENT)
 			device_printf(dev,
 			    "cannot parse assigned-clock property\n");
 		return (rv);
 	}
 
 	nrates = OF_getencprop_alloc_multi(node, "assigned-clock-rates",
 	    sizeof(*rates), (void **)&rates);
 	if (nrates <= 0)
 		nrates = 0;
 
 	if (ofw_bus_parse_xref_list_get_length(node,
 	    "assigned-clock-parents", "#clock-cells", &nparents) != 0)
 		nparents = -1;
 	for (i = 0; i < nclocks; i++) {
 		/* First get the clock we are supposed to modify */
 		rv = clk_get_by_ofw_index_prop(dev, 0, "assigned-clocks",
 		    i, &clk);
 		if (rv != 0) {
 			if (bootverbose)
 				device_printf(dev,
 				    "cannot get assigned clock at idx %d\n",
 				    i);
 			continue;
 		}
 
 		/* First set it's parent if needed */
 		if (i <= nparents)
 			clk_set_assigned_parent(dev, clk, i);
 
 		/* Then set a new frequency */
 		if (i <= nrates && rates[i] != 0)
 			clk_set_assigned_rates(dev, clk, rates[i]);
 
 		clk_release(clk);
 	}
 
 	return (0);
 }
 
 int
 clk_get_by_ofw_index_prop(device_t dev, phandle_t cnode, const char *prop, int idx, clk_t *clk)
 {
 	phandle_t parent, *cells;
 	device_t clockdev;
 	int ncells, rv;
 	struct clkdom *clkdom;
 	struct clknode *clknode;
 
 	*clk = NULL;
 	if (cnode <= 0)
 		cnode = ofw_bus_get_node(dev);
 	if (cnode <= 0) {
 		device_printf(dev, "%s called on not ofw based device\n",
 		 __func__);
 		return (ENXIO);
 	}
 
 
 	rv = ofw_bus_parse_xref_list_alloc(cnode, prop, "#clock-cells", idx,
 	    &parent, &ncells, &cells);
 	if (rv != 0) {
 		return (rv);
 	}
 
 	clockdev = OF_device_from_xref(parent);
 	if (clockdev == NULL) {
 		rv = ENODEV;
 		goto done;
 	}
 
 	CLK_TOPO_SLOCK();
 	clkdom = clkdom_get_by_dev(clockdev);
 	if (clkdom == NULL){
 		CLK_TOPO_UNLOCK();
 		rv = ENXIO;
 		goto done;
 	}
 
 	rv = clkdom->ofw_mapper(clkdom, ncells, cells, &clknode);
 	if (rv == 0) {
 		*clk = clk_create(clknode, dev);
 	}
 	CLK_TOPO_UNLOCK();
 
 done:
 	if (cells != NULL)
 		OF_prop_free(cells);
 	return (rv);
 }
 
 int
 clk_get_by_ofw_index(device_t dev, phandle_t cnode, int idx, clk_t *clk)
 {
 	return (clk_get_by_ofw_index_prop(dev, cnode, "clocks", idx, clk));
 }
 
 int
 clk_get_by_ofw_name(device_t dev, phandle_t cnode, const char *name, clk_t *clk)
 {
 	int rv, idx;
 
 	if (cnode <= 0)
 		cnode = ofw_bus_get_node(dev);
 	if (cnode <= 0) {
 		device_printf(dev, "%s called on not ofw based device\n",
 		 __func__);
 		return (ENXIO);
 	}
 	rv = ofw_bus_find_string_index(cnode, "clock-names", name, &idx);
 	if (rv != 0)
 		return (rv);
 	return (clk_get_by_ofw_index(dev, cnode, idx, clk));
 }
 
 /* --------------------------------------------------------------------------
  *
  * Support functions for parsing various clock related OFW things.
  */
 
 /*
  * Get "clock-output-names" and  (optional) "clock-indices" lists.
  * Both lists are alocated using M_OFWPROP specifier.
  *
  * Returns number of items or 0.
  */
 int
 clk_parse_ofw_out_names(device_t dev, phandle_t node, const char ***out_names,
 	uint32_t **indices)
 {
 	int name_items, rv;
 
 	*out_names = NULL;
 	*indices = NULL;
 	if (!OF_hasprop(node, "clock-output-names"))
 		return (0);
 	rv = ofw_bus_string_list_to_array(node, "clock-output-names",
 	    out_names);
 	if (rv <= 0)
 		return (0);
 	name_items = rv;
 
 	if (!OF_hasprop(node, "clock-indices"))
 		return (name_items);
 	rv = OF_getencprop_alloc_multi(node, "clock-indices", sizeof (uint32_t),
 	    (void **)indices);
 	if (rv != name_items) {
 		device_printf(dev, " Size of 'clock-output-names' and "
 		    "'clock-indices' differs\n");
 		OF_prop_free(*out_names);
 		OF_prop_free(*indices);
 		return (0);
 	}
 	return (name_items);
 }
 
 /*
  * Get output clock name for single output clock node.
  */
 int
 clk_parse_ofw_clk_name(device_t dev, phandle_t node, const char **name)
 {
 	const char **out_names;
 	const char  *tmp_name;
 	int rv;
 
 	*name = NULL;
 	if (!OF_hasprop(node, "clock-output-names")) {
 		tmp_name  = ofw_bus_get_name(dev);
 		if (tmp_name == NULL)
 			return (ENXIO);
 		*name = strdup(tmp_name, M_OFWPROP);
 		return (0);
 	}
 	rv = ofw_bus_string_list_to_array(node, "clock-output-names",
 	    &out_names);
 	if (rv != 1) {
 		OF_prop_free(out_names);
 		device_printf(dev, "Malformed 'clock-output-names' property\n");
 		return (ENXIO);
 	}
 	*name = strdup(out_names[0], M_OFWPROP);
 	OF_prop_free(out_names);
 	return (0);
 }
 #endif
 
 static int
 clkdom_sysctl(SYSCTL_HANDLER_ARGS)
 {
 	struct clkdom *clkdom = arg1;
 	struct clknode *clknode;
 	struct sbuf *sb;
 	int ret;
 
 	sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
 	if (sb == NULL)
 		return (ENOMEM);
 
 	CLK_TOPO_SLOCK();
 	TAILQ_FOREACH(clknode, &clkdom->clknode_list, clkdom_link) {
 		sbuf_printf(sb, "%s ", clknode->name);
 	}
 	CLK_TOPO_UNLOCK();
 
 	ret = sbuf_finish(sb);
 	sbuf_delete(sb);
 	return (ret);
 }
 
 static int
 clknode_sysctl(SYSCTL_HANDLER_ARGS)
 {
 	struct clknode *clknode, *children;
 	enum clknode_sysctl_type type = arg2;
 	struct sbuf *sb;
 	const char **parent_names;
 	int ret, i;
 
 	clknode = arg1;
 	sb = sbuf_new_for_sysctl(NULL, NULL, 512, req);
 	if (sb == NULL)
 		return (ENOMEM);
 
 	CLK_TOPO_SLOCK();
 	switch (type) {
 	case CLKNODE_SYSCTL_PARENT:
 		if (clknode->parent)
 			sbuf_printf(sb, "%s", clknode->parent->name);
 		break;
 	case CLKNODE_SYSCTL_PARENTS_LIST:
 		parent_names = clknode_get_parent_names(clknode);
 		for (i = 0; i < clknode->parent_cnt; i++)
 			sbuf_printf(sb, "%s ", parent_names[i]);
 		break;
 	case CLKNODE_SYSCTL_CHILDREN_LIST:
 		TAILQ_FOREACH(children, &(clknode->children), sibling_link) {
 			sbuf_printf(sb, "%s ", children->name);
 		}
 		break;
 	}
 	CLK_TOPO_UNLOCK();
 
 	ret = sbuf_finish(sb);
 	sbuf_delete(sb);
 	return (ret);
 }
Index: stable/12/sys/dev/extres/clk/clk.h
===================================================================
--- stable/12/sys/dev/extres/clk/clk.h	(revision 358643)
+++ stable/12/sys/dev/extres/clk/clk.h	(revision 358644)
@@ -1,147 +1,149 @@
 /*-
  * Copyright 2016 Michal Meloun <mmel@FreeBSD.org>
  * All rights reserved.
  *
  * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
  *
  * $FreeBSD$
  */
 
 #ifndef _DEV_EXTRES_CLK_H_
 #define _DEV_EXTRES_CLK_H_
 #include "opt_platform.h"
 
 #include <sys/kobj.h>
 #ifdef FDT
 #include <dev/ofw/ofw_bus.h>
 #endif
 #include "clknode_if.h"
 
 #define CLKNODE_IDX_NONE	-1		/* Not-selected index */
 
 /* clknode flags. */
 #define	CLK_NODE_STATIC_STRINGS	0x00000001	/* Static name strings */
 #define	CLK_NODE_GLITCH_FREE	0x00000002	/* Freq can change w/o stop */
-#define	CLK_NODE_CANNOT_STOP	0x00000004	/* Clock cannot be disabled */
+#define	CLK_NODE_CANNOT_STOP	0x00000004	/* Cannot be disabled */
+#define	CLK_NODE_LINKED		0x00000008	/* Is linked clock */
+#define	CLK_NODE_REGISTERED	0x00000020	/* Is already registered */
 
 /* Flags passed to clk_set_freq() and clknode_set_freq(). */
 #define	CLK_SET_ROUND(x)	((x) & (CLK_SET_ROUND_UP | CLK_SET_ROUND_DOWN))
 #define	CLK_SET_ROUND_EXACT	0
 #define	CLK_SET_ROUND_UP	0x00000001
 #define	CLK_SET_ROUND_DOWN	0x00000002
 #define	CLK_SET_ROUND_MULTIPLE	0x00000004
 #define	CLK_SET_ROUND_ANY	(CLK_SET_ROUND_UP | CLK_SET_ROUND_DOWN)
 
 #define	CLK_SET_USER_MASK	0x0000FFFF
 #define	CLK_SET_DRYRUN		0x00010000
 
 typedef struct clk *clk_t;
 
 /* Initialization parameters for clocknode creation. */
 struct clknode_init_def {
 	const char	*name;
 	intptr_t	id;
 	const char	**parent_names;
 	int		parent_cnt;
 	int		flags;
 };
 
 /*
  * Shorthands for constructing method tables.
  */
 #define	CLKNODEMETHOD		KOBJMETHOD
 #define	CLKNODEMETHOD_END	KOBJMETHOD_END
 #define	clknode_method_t	kobj_method_t
 #define	clknode_class_t		kobj_class_t
 DECLARE_CLASS(clknode_class);
 
 /*
  *  Clock domain functions.
  */
 struct clkdom *clkdom_create(device_t dev);
 int clkdom_finit(struct clkdom *clkdom);
 void clkdom_dump(struct clkdom * clkdom);
 void clkdom_unlock(struct clkdom *clkdom);
 void clkdom_xlock(struct clkdom *clkdom);
 
 /*
  * Clock providers interface.
  */
 struct clkdom *clkdom_get_by_dev(const device_t dev);
 
 struct clknode *clknode_create(struct clkdom *clkdom,
     clknode_class_t clknode_class, const struct clknode_init_def *def);
 struct clknode *clknode_register(struct clkdom *cldom, struct clknode *clk);
 #ifdef FDT
 typedef int clknode_ofw_mapper_func(struct clkdom *clkdom, uint32_t ncells,
     phandle_t *cells, struct clknode **clk);
 void clkdom_set_ofw_mapper(struct clkdom *clkdom, clknode_ofw_mapper_func *cmp);
 #endif
 
 void clknode_init_parent_idx(struct clknode *clknode, int idx);
 int clknode_set_parent_by_idx(struct clknode *clk, int idx);
 int clknode_set_parent_by_name(struct clknode *clk, const char *name);
 const char *clknode_get_name(struct clknode *clk);
 const char **clknode_get_parent_names(struct clknode *clk);
 int clknode_get_parents_num(struct clknode *clk);
 int clknode_get_parent_idx(struct clknode *clk);
 struct clknode *clknode_get_parent(struct clknode *clk);
 int clknode_get_flags(struct clknode *clk);
 void *clknode_get_softc(struct clknode *clk);
 device_t clknode_get_device(struct clknode *clk);
 struct clknode *clknode_find_by_name(const char *name);
 struct clknode *clknode_find_by_id(struct clkdom *clkdom, intptr_t id);
 int clknode_get_freq(struct clknode *clknode, uint64_t *freq);
 int clknode_set_freq(struct clknode *clknode, uint64_t freq, int flags,
     int enablecnt);
 int clknode_enable(struct clknode *clknode);
 int clknode_disable(struct clknode *clknode);
 int clknode_stop(struct clknode *clknode, int depth);
 
 /*
  * Clock consumers interface.
  */
 int clk_get_by_name(device_t dev, const char *name, clk_t *clk);
 int clk_get_by_id(device_t dev, struct clkdom *clkdom, intptr_t id, clk_t *clk);
 int clk_release(clk_t clk);
 int clk_get_freq(clk_t clk, uint64_t *freq);
 int clk_set_freq(clk_t clk, uint64_t freq, int flags);
 int clk_test_freq(clk_t clk, uint64_t freq, int flags);
 int clk_enable(clk_t clk);
 int clk_disable(clk_t clk);
 int clk_stop(clk_t clk);
 int clk_get_parent(clk_t clk, clk_t *parent);
 int clk_set_parent_by_clk(clk_t clk, clk_t parent);
 const char *clk_get_name(clk_t clk);
 
 #ifdef FDT
 int clk_set_assigned(device_t dev, phandle_t node);
 int clk_get_by_ofw_index(device_t dev, phandle_t node, int idx, clk_t *clk);
 int clk_get_by_ofw_index_prop(device_t dev, phandle_t cnode, const char *prop, int idx, clk_t *clk);
 int clk_get_by_ofw_name(device_t dev, phandle_t node, const char *name,
      clk_t *clk);
 int clk_parse_ofw_out_names(device_t dev, phandle_t node,
     const char ***out_names, uint32_t **indices);
 int clk_parse_ofw_clk_name(device_t dev, phandle_t node, const char **name);
 #endif
 
 #endif /* _DEV_EXTRES_CLK_H_ */
Index: stable/12/sys/dev/extres/clk/clk_link.c
===================================================================
--- stable/12/sys/dev/extres/clk/clk_link.c	(nonexistent)
+++ stable/12/sys/dev/extres/clk/clk_link.c	(revision 358644)
@@ -0,0 +1,122 @@
+/*-
+ * Copyright 2016 Michal Meloun <mmel@FreeBSD.org>
+ * All rights reserved.
+ *
+ * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/conf.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/module.h>
+#include <sys/rman.h>
+#include <sys/systm.h>
+
+#include <machine/bus.h>
+
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+#include <dev/extres/clk/clk_link.h>
+
+static int clknode_link_init(struct clknode *clk, device_t dev);
+static int clknode_link_recalc(struct clknode *clk, uint64_t *freq);
+static int clknode_link_set_freq(struct clknode *clk, uint64_t fin,
+    uint64_t *fout, int flags, int *stop);
+static int clknode_link_set_mux(struct clknode *clk, int idx);
+static int clknode_link_set_gate(struct clknode *clk, bool enable);
+
+static clknode_method_t clknode_link_methods[] = {
+	/* Device interface */
+	CLKNODEMETHOD(clknode_init,	   clknode_link_init),
+	CLKNODEMETHOD(clknode_recalc_freq, clknode_link_recalc),
+	CLKNODEMETHOD(clknode_set_freq,	   clknode_link_set_freq),
+	CLKNODEMETHOD(clknode_set_gate,	   clknode_link_set_gate),
+	CLKNODEMETHOD(clknode_set_mux,	   clknode_link_set_mux),
+	CLKNODEMETHOD_END
+};
+DEFINE_CLASS_1(clknode_link, clknode_link_class, clknode_link_methods,
+   0, clknode_class);
+
+static int
+clknode_link_init(struct clknode *clk, device_t dev)
+{
+	return(0);
+}
+
+static int
+clknode_link_recalc(struct clknode *clk, uint64_t *freq)
+{
+
+	printf("%s: Attempt to use unresolved linked clock: %s\n", __func__,
+	    clknode_get_name(clk));
+	return (EBADF);
+}
+
+static int
+clknode_link_set_freq(struct clknode *clk, uint64_t fin, uint64_t *fout,
+    int flags, int *stop)
+{
+
+	printf("%s: Attempt to use unresolved linked clock: %s\n", __func__,
+	    clknode_get_name(clk));
+	return (EBADF);
+}
+
+static int
+clknode_link_set_mux(struct clknode *clk, int idx)
+{
+
+	printf("%s: Attempt to use unresolved linked clock: %s\n", __func__,
+	    clknode_get_name(clk));
+	return (EBADF);
+}
+
+static int
+clknode_link_set_gate(struct clknode *clk, bool enable)
+{
+
+	printf("%s: Attempt to use unresolved linked clock: %s\n", __func__,
+	    clknode_get_name(clk));
+	return (EBADF);
+}
+
+int
+clknode_link_register(struct clkdom *clkdom, struct clk_link_def *clkdef)
+{
+	struct clknode *clk;
+	struct clknode_init_def tmp;
+
+	tmp = clkdef->clkdef;
+	tmp.flags |= CLK_NODE_LINKED;
+	clk = clknode_create(clkdom, &clknode_link_class, &tmp);
+	if (clk == NULL)
+		return (1);
+	clknode_register(clkdom, clk);
+	return (0);
+}

Property changes on: stable/12/sys/dev/extres/clk/clk_link.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+FreeBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: stable/12/sys/dev/extres/clk/clk_link.h
===================================================================
--- stable/12/sys/dev/extres/clk/clk_link.h	(nonexistent)
+++ stable/12/sys/dev/extres/clk/clk_link.h	(revision 358644)
@@ -0,0 +1,47 @@
+/*-
+ * Copyright 2016 Michal Meloun <mmel@FreeBSD.org>
+ * All rights reserved.
+ *
+ * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _DEV_EXTRES_CLK_LINK_H_
+#define _DEV_EXTRES_CLK_LINK_H_
+
+#include <dev/extres/clk/clk.h>
+
+/*
+ * A linked clock is used as placeholder for not yet available clock.
+ * It will be replaced by equally named clock from other domain, created
+ * in future stage of system initialization.
+*/
+
+struct clk_link_def {
+	struct clknode_init_def clkdef;
+
+};
+
+int clknode_link_register(struct clkdom *clkdom, struct clk_link_def *clkdef);
+
+#endif /*_DEV_EXTRES_CLK_LINK_H_*/

Property changes on: stable/12/sys/dev/extres/clk/clk_link.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+FreeBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: stable/12
===================================================================
--- stable/12	(revision 358643)
+++ stable/12	(revision 358644)

Property changes on: stable/12
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /head:r354554-354558,355115