CVS commit: src/sys/arch/arm/nxp

2023-05-24 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed May 24 16:43:40 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6_platform.c

Log Message:
introduce imx6sx_platform_bootstrap(), which calls imx_platform_bootstrap()
and then checks for an "arm,cortex-a9-twd-timer" compatible entry in the
fdt. If not present, create one so that a9ptmr will attach.
We need this entry as this is the only timer we support for this platform,
but the upstream imx6sx.dtsi is missing the entry for it (and all A9 CPUs
have it anyway).

Thanks to Jared McNeill for advices and review.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/nxp/imx6_platform.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nxp/imx6_platform.c
diff -u src/sys/arch/arm/nxp/imx6_platform.c:1.8 src/sys/arch/arm/nxp/imx6_platform.c:1.9
--- src/sys/arch/arm/nxp/imx6_platform.c:1.8	Thu May  4 13:28:04 2023
+++ src/sys/arch/arm/nxp/imx6_platform.c	Wed May 24 16:43:40 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_platform.c,v 1.8 2023/05/04 13:28:04 bouyer Exp $	*/
+/*	$NetBSD: imx6_platform.c,v 1.9 2023/05/24 16:43:40 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.8 2023/05/04 13:28:04 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.9 2023/05/24 16:43:40 bouyer Exp $");
 
 #include "arml2cc.h"
 #include "opt_console.h"
@@ -175,6 +175,76 @@ imx_platform_bootstrap(void)
 	arm_fdt_cpu_bootstrap();
 }
 
+static void
+imx6sx_platform_bootstrap(void)
+{
+	void *fdt_data;
+	int ofw_root;
+	int soc_node, timer_node, intc_node, clks_node;
+	int ret;
+	fdt32_t intval[3];
+	fdt32_t clkval[2];
+	u_int val32;
+
+	imx_platform_bootstrap();
+
+	/*
+	 * if there's no entry for the TWD timer in the provided DTB, fake one.
+	 * we can't boot witthout it.
+	 * The upstream imx6sx.dtsi is missing the entry
+	 */
+
+	fdt_data = __UNCONST(fdtbus_get_data());
+	KASSERT(fdt_data != NULL);
+	ofw_root = OF_peer(0);
+	if (of_find_bycompat(ofw_root, "arm,cortex-a9-twd-timer") > 0) {
+		/* already there */
+		VPRINTF("timer already present\n");
+		return;
+	}
+	VPRINTF("creating timer fdt@%p", fdt_data);
+	soc_node = fdt_path_offset(fdt_data, "/soc");
+	VPRINTF(" soc_node %d", soc_node);
+	KASSERT(soc_node >= 0);
+
+	timer_node = fdt_add_subnode(fdt_data, soc_node, "timer@a00600");
+	VPRINTF(" timer_node %d\n", timer_node);
+	KASSERT(timer_node >= 0);
+
+	ret = fdt_setprop_string(fdt_data, timer_node, "compatible",
+	"arm,cortex-a9-twd-timer");
+	KASSERTMSG(ret == 0, "fdt_setprop(compatible) returns %d", ret);
+
+	ret = fdt_appendprop_addrrange(fdt_data, soc_node, timer_node,
+	"reg", 0x00a00600, 0x20);
+	KASSERTMSG(ret == 0, "fdt_appendprop_addrrange returns %d", ret);
+
+	intval[0] = cpu_to_fdt32(1);
+	intval[1] = cpu_to_fdt32(13);
+	intval[2] = cpu_to_fdt32(0xf01);
+	ret = fdt_setprop(fdt_data, timer_node, "interrupts",
+	intval, sizeof(intval));
+	KASSERTMSG(ret == 0, "fdt_setprop(interrupts) returns %d", ret);
+
+	intc_node = of_find_bycompat(ofw_root, "arm,cortex-a9-gic");
+	KASSERT(intc_node >= 0);
+	val32 = 0;
+	of_getprop_uint32(intc_node, "phandle", );
+	ret = fdt_setprop_u32(fdt_data, timer_node, "interrupt-parent",
+	val32);
+	KASSERTMSG(ret == 0, "fdt_setprop(interrupt-parent) returns %d", ret);
+
+	val32 = 0;
+	clks_node = of_find_bycompat(ofw_root, "fsl,imx6sx-ccm");
+	KASSERT(clks_node >= 0);
+	of_getprop_uint32(clks_node, "phandle", );
+	clkval[0] = cpu_to_fdt32(val32);
+	clkval[1] = cpu_to_fdt32(30); /* IMX6SXCLK_TWD */
+	ret = fdt_setprop(fdt_data, timer_node, "clocks",
+	clkval, sizeof(clkval));
+	KASSERTMSG(ret == 0, "fdt_setprop(clocks) returns %d", ret);
+}
+
 static int
 imx_platform_mpstart(void)
 {
@@ -256,7 +326,7 @@ static const struct fdt_platform imx6_pl
 
 static const struct fdt_platform imx6sx_platform = {
 	.fp_devmap = imx6sx_platform_devmap,
-	.fp_bootstrap = imx_platform_bootstrap,
+	.fp_bootstrap = imx6sx_platform_bootstrap,
 	.fp_init_attach_args = imx_platform_init_attach_args,
 	.fp_device_register = imx_platform_device_register,
 	.fp_reset = imx6_platform_reset,



CVS commit: src/sys/arch/arm/nxp

2023-05-24 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed May 24 16:43:40 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6_platform.c

Log Message:
introduce imx6sx_platform_bootstrap(), which calls imx_platform_bootstrap()
and then checks for an "arm,cortex-a9-twd-timer" compatible entry in the
fdt. If not present, create one so that a9ptmr will attach.
We need this entry as this is the only timer we support for this platform,
but the upstream imx6sx.dtsi is missing the entry for it (and all A9 CPUs
have it anyway).

Thanks to Jared McNeill for advices and review.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/nxp/imx6_platform.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/nxp

2023-05-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri May  5 09:34:10 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6sx_clk.c

Log Message:
remove commented out entries, leftover from the imx6q ccm code.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6sx_clk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nxp/imx6sx_clk.c
diff -u src/sys/arch/arm/nxp/imx6sx_clk.c:1.2 src/sys/arch/arm/nxp/imx6sx_clk.c:1.3
--- src/sys/arch/arm/nxp/imx6sx_clk.c:1.2	Fri May  5 09:29:35 2023
+++ src/sys/arch/arm/nxp/imx6sx_clk.c	Fri May  5 09:34:09 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6sx_clk.c,v 1.2 2023/05/05 09:29:35 bouyer Exp $	*/
+/*	$NetBSD: imx6sx_clk.c,v 1.3 2023/05/05 09:34:09 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6sx_clk.c,v 1.2 2023/05/05 09:29:35 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6sx_clk.c,v 1.3 2023/05/05 09:34:09 bouyer Exp $");
 
 #include "opt_fdt.h"
 
@@ -975,15 +975,13 @@ static const int audiovideo_div_tbl[] = 
 
 static struct imx6_clk imx6sx_clks[] = {
 	CLK_FIXED("dummy", 0),
-
 	CLK_FIXED("ckil", IMX6_CKIL_FREQ),
 	CLK_FIXED("osc", IMX6_OSC_FREQ),
 	CLK_FIXED("ipp_di0", IMX6_OSC_FREQ), 
 	CLK_FIXED("ipp_di1", IMX6_OSC_FREQ), 
 	CLK_FIXED("anaclk1", IMX6_ANACLK1_FREQ),
 	CLK_FIXED("anaclk2", IMX6_ANACLK2_FREQ),
-//#
-//#	CLK_FIXED_FACTOR("sata_ref", "pll6_enet", 5, 1),
+
 	CLK_FIXED_FACTOR("pcie_ref", "pll6_enet", 5, 1),
 	CLK_FIXED_FACTOR("pll2_198m", "pll2_pfd2_396m", 2, 1),
 	CLK_FIXED_FACTOR("pll3_120m", "pll3_usb_otg", 4, 1),
@@ -991,15 +989,12 @@ static struct imx6_clk imx6sx_clks[] = {
 	CLK_FIXED_FACTOR("pll3_60m", "pll3_usb_otg", 8, 1),
 	CLK_FIXED_FACTOR("twd", "arm", 2, 1),
 	CLK_FIXED_FACTOR("gpt_3m", "osc", 8, 1),
-//#	CLK_FIXED_FACTOR("video_27m", "pll3_pfd1_540m", 20, 1),
-//#	CLK_FIXED_FACTOR("gpu2d_axi", "mmdc_ch0_axi_podf", 1, 1),
-//#	CLK_FIXED_FACTOR("gpu3d_axi", "mmdc_ch0_axi_podf", 1, 1),
 	CLK_FIXED_FACTOR("ldb_di0_div_3_5", "ldb_di0_sel", 7, 2),
 	CLK_FIXED_FACTOR("ldb_di0_div_7", "ldb_di0_sel", 7, 1),
 	CLK_FIXED_FACTOR("ldb_di1_div_3_5", "ldb_di1_sel", 7, 2),
 	CLK_FIXED_FACTOR("ldb_di1_div_7", "ldb_di1_sel", 7, 1),
 	CLK_FIXED_FACTOR("enet_ptp_ref", "pll6_enet", 20, 1),
-//#
+
 	CLK_PFD("pll2_pfd0_352m", "pll2_bus", PFD_528, 0),
 	CLK_PFD("pll2_pfd1_594m", "pll2_bus", PFD_528, 1),
 	CLK_PFD("pll2_pfd2_396m", "pll2_bus", PFD_528, 2),
@@ -1008,7 +1003,7 @@ static struct imx6_clk imx6sx_clks[] = {
 	CLK_PFD("pll3_pfd1_540m", "pll3_usb_otg", PFD_480, 1),
 	CLK_PFD("pll3_pfd2_508m", "pll3_usb_otg", PFD_480, 2),
 	CLK_PFD("pll3_pfd3_454m", "pll3_usb_otg", PFD_480, 3),
-//#
+
 	CLK_PLL("pll1", "osc", SYS, PLL_ARM, DIV_SELECT, POWERDOWN, 0),
 	CLK_PLL("pll2", "osc", GENERIC, PLL_SYS, DIV_SELECT, POWERDOWN, 0),
 	CLK_PLL("pll3", "osc", USB, PLL_USB1, DIV_SELECT, POWER, 0),
@@ -1016,7 +1011,7 @@ static struct imx6_clk imx6sx_clks[] = {
 	CLK_PLL("pll5", "osc", AUDIO_VIDEO, PLL_VIDEO, DIV_SELECT, POWERDOWN, 0),
 	CLK_PLL("pll6", "osc", ENET, PLL_ENET, DIV_SELECT, POWERDOWN, 5),
 	CLK_PLL("pll7", "osc", USB, PLL_USB2, DIV_SELECT, POWER, 0),
-//#
+
 	CLK_DIV("periph_clk2", "periph_clk2_sel", CBCDR, PERIPH_CLK2_PODF),
 	CLK_DIV("periph2_clk2", "periph2_clk2_sel", CBCDR, PERIPH2_CLK2_PODF),
 	CLK_DIV_BUSY("ocram_podf", "ocram_sel", CBCDR, AXI_PODF, CDHIPR, AXI_PODF_BUSY),
@@ -1026,36 +1021,19 @@ static struct imx6_clk imx6sx_clks[] = {
 	CLK_DIV("lcdif1_podf", "lcdif1_pred", CBCMR, GPU2D_CORE_CLK_PODF),
 	CLK_DIV("esai_pred", "esai_sel", CS1CDR, ESAI_CLK_PRED),
 	CLK_DIV("esai_podf", "esai_pred", CS1CDR, ESAI_CLK_PODF),
-//#	CLK_DIV("asrc_pred", "asrc_sel", CDCDR, SPDIF1_CLK_PRED),
-//#	CLK_DIV("asrc_podf", "asrc_pred", CDCDR, SPDIF1_CLK_PODF),
 	CLK_DIV("spdif_pred", "spdif_sel", CDCDR, SPDIF0_CLK_PRED),
 	CLK_DIV("spdif_podf", "spdif_pred", CDCDR, SPDIF0_CLK_PODF),
 	CLK_DIV("audio_pred", "audio_sel", CDCDR, SPDIF1_CLK_PRED),
 	CLK_DIV("audio_podf", "audio_pred", CDCDR, SPDIF1_CLK_PODF),
-//#	CLK_DIV("ecspi_root", "pll3_60m", CSCDR2, ECSPI_CLK_PODF),
-//#	CLK_DIV("can_root", "pll3_60m", CSCMR2, CAN_CLK_PODF),
 	CLK_DIV("vid_podf", "vid_sel", CSCMR2, VID_CLK_PODF),
 	CLK_DIV("can_podf", "can_sel", CSCMR2, CAN_CLK_PODF),
-//#	CLK_DIV("uart_serial_podf", "pll3_80m", CSCDR1, UART_CLK_PODF),
-//#	CLK_DIV("gpu2d_core_podf", "gpu2d_core_sel", CBCMR, GPU2D_CORE_CLK_PODF),
-//#	CLK_DIV("gpu3d_core_podf", "gpu3d_core_sel", CBCMR, GPU3D_CORE_PODF),
-//#	CLK_DIV("gpu3d_shader", "gpu3d_shader_sel", CBCMR, GPU3D_SHADER_PODF),
 	CLK_DIV("display_podf", "display_sel", CSCDR3, IPU2_HSP_PODF),
 	CLK_DIV("csi_podf", "csi_sel", CSCDR3, IPU1_HSP_PODF),
-//#	CLK_DIV("ipu1_podf", "ipu1_sel", CSCDR3, IPU1_HSP_PODF),
-//#	CLK_DIV("ipu2_podf", "ipu2_sel", CSCDR3, IPU2_HSP_PODF),
-//#	CLK_DIV("ldb_di0_podf", 

CVS commit: src/sys/arch/arm/nxp

2023-05-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri May  5 09:34:10 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6sx_clk.c

Log Message:
remove commented out entries, leftover from the imx6q ccm code.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6sx_clk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/nxp

2023-05-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri May  5 09:29:35 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6sx_clk.c

Log Message:
Fix typo, preventing i2c4 from attaching


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6sx_clk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nxp/imx6sx_clk.c
diff -u src/sys/arch/arm/nxp/imx6sx_clk.c:1.1 src/sys/arch/arm/nxp/imx6sx_clk.c:1.2
--- src/sys/arch/arm/nxp/imx6sx_clk.c:1.1	Thu May  4 13:25:07 2023
+++ src/sys/arch/arm/nxp/imx6sx_clk.c	Fri May  5 09:29:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6sx_clk.c,v 1.1 2023/05/04 13:25:07 bouyer Exp $	*/
+/*	$NetBSD: imx6sx_clk.c,v 1.2 2023/05/05 09:29:35 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6sx_clk.c,v 1.1 2023/05/04 13:25:07 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6sx_clk.c,v 1.2 2023/05/05 09:29:35 bouyer Exp $");
 
 #include "opt_fdt.h"
 
@@ -1297,7 +1297,7 @@ static struct imx6_clk imx6sx_clks[] = {
 	CLK_GATE("pwm8", "perclk", CCM, CCGR6, PWM8_CLK_ENABLE),
 	CLK_GATE("vadc", "vid_podf", CCM, CCGR6, VADC_CLK_ENABLE),
 	CLK_GATE("gis", "display_podf", CCM, CCGR6, GIS_CLK_ENABLE),
-	CLK_GATE("i2cs4", "perclk", CCM, CCGR6, I2CS4_CLK_ENABLE),
+	CLK_GATE("i2c4", "perclk", CCM, CCGR6, I2CS4_CLK_ENABLE),
 	CLK_GATE("pwm5", "perclk", CCM, CCGR6, PWM5_CLK_ENABLE),
 	CLK_GATE("pwm6", "perclk", CCM, CCGR6, PWM6_CLK_ENABLE),
 	CLK_GATE("pwm7", "perclk", CCM, CCGR6, PWM7_CLK_ENABLE),



CVS commit: src/sys/arch/arm/nxp

2023-05-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri May  5 09:29:35 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6sx_clk.c

Log Message:
Fix typo, preventing i2c4 from attaching


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6sx_clk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/nxp

2023-05-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu May  4 13:29:33 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6_gpc.c imx6_iomux.c imx6_pcie.c imx6_spi.c
imx6_usb.c imx6_usbphy.c imx_sdhc.c

Log Message:
Add i.mx6sx compatible entries to drivers that should work as is.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nxp/imx6_gpc.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6_iomux.c \
src/sys/arch/arm/nxp/imx6_usbphy.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/nxp/imx6_pcie.c \
src/sys/arch/arm/nxp/imx6_usb.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nxp/imx6_spi.c \
src/sys/arch/arm/nxp/imx_sdhc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nxp/imx6_gpc.c
diff -u src/sys/arch/arm/nxp/imx6_gpc.c:1.3 src/sys/arch/arm/nxp/imx6_gpc.c:1.4
--- src/sys/arch/arm/nxp/imx6_gpc.c:1.3	Wed Jan 27 03:10:20 2021
+++ src/sys/arch/arm/nxp/imx6_gpc.c	Thu May  4 13:29:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_gpc.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $	*/
+/*	$NetBSD: imx6_gpc.c,v 1.4 2023/05/04 13:29:33 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_gpc.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_gpc.c,v 1.4 2023/05/04 13:29:33 bouyer Exp $");
 
 #include "opt_fdt.h"
 
@@ -66,6 +66,7 @@ CFATTACH_DECL_NEW(imxgpc, sizeof(struct 
 
 static const struct device_compatible_entry compat_data[] = {
 	{ .compat = "fsl,imx6q-gpc" },
+	{ .compat = "fsl,imx6sx-gpc" },
 	DEVICE_COMPAT_EOL
 };
 

Index: src/sys/arch/arm/nxp/imx6_iomux.c
diff -u src/sys/arch/arm/nxp/imx6_iomux.c:1.2 src/sys/arch/arm/nxp/imx6_iomux.c:1.3
--- src/sys/arch/arm/nxp/imx6_iomux.c:1.2	Wed Jan 27 03:10:20 2021
+++ src/sys/arch/arm/nxp/imx6_iomux.c	Thu May  4 13:29:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_iomux.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $	*/
+/*	$NetBSD: imx6_iomux.c,v 1.3 2023/05/04 13:29:33 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_iomux.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_iomux.c,v 1.3 2023/05/04 13:29:33 bouyer Exp $");
 
 #include "opt_fdt.h"
 
@@ -131,6 +131,7 @@ CFATTACH_DECL_NEW(imxiomux, sizeof(struc
 
 static const struct device_compatible_entry compat_data[] = {
 	{ .compat = "fsl,imx6q-iomuxc" },
+	{ .compat = "fsl,imx6sx-iomuxc" },
 	{ .compat = "fsl,imx7d-iomuxc" },
 	{ .compat = "fsl,imx8mq-iomuxc" },
 	DEVICE_COMPAT_EOL
Index: src/sys/arch/arm/nxp/imx6_usbphy.c
diff -u src/sys/arch/arm/nxp/imx6_usbphy.c:1.2 src/sys/arch/arm/nxp/imx6_usbphy.c:1.3
--- src/sys/arch/arm/nxp/imx6_usbphy.c:1.2	Wed Jan 27 03:10:20 2021
+++ src/sys/arch/arm/nxp/imx6_usbphy.c	Thu May  4 13:29:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_usbphy.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $	*/
+/*	$NetBSD: imx6_usbphy.c,v 1.3 2023/05/04 13:29:33 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: imx6_usbphy.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $");
+__KERNEL_RCSID(1, "$NetBSD: imx6_usbphy.c,v 1.3 2023/05/04 13:29:33 bouyer Exp $");
 
 #include "opt_fdt.h"
 
@@ -63,6 +63,7 @@ CFATTACH_DECL_NEW(imxusbphy, sizeof(stru
 
 static const struct device_compatible_entry compat_data[] = {
 	{ .compat = "fsl,imx6q-usbphy" },
+	{ .compat = "fsl,imx6sx-usbphy" },
 	DEVICE_COMPAT_EOL
 };
 

Index: src/sys/arch/arm/nxp/imx6_pcie.c
diff -u src/sys/arch/arm/nxp/imx6_pcie.c:1.6 src/sys/arch/arm/nxp/imx6_pcie.c:1.7
--- src/sys/arch/arm/nxp/imx6_pcie.c:1.6	Wed Jan 27 03:10:20 2021
+++ src/sys/arch/arm/nxp/imx6_pcie.c	Thu May  4 13:29:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_pcie.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $	*/
+/*	$NetBSD: imx6_pcie.c,v 1.7 2023/05/04 13:29:33 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_pcie.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_pcie.c,v 1.7 2023/05/04 13:29:33 bouyer Exp $");
 
 #include "opt_pci.h"
 #include "opt_fdt.h"
@@ -92,6 +92,7 @@ CFATTACH_DECL_NEW(imxpcie_fdt, sizeof(st
 static const struct device_compatible_entry compat_data[] = {
 	{ .compat = "fsl,imx6q-pcie",	.value = false },
 	{ .compat = "fsl,imx6qp-pcie",	.value = true },
+	{ .compat = "fsl,imx6sx-pcie",	.value = true },
 	DEVICE_COMPAT_EOL
 };
 
Index: src/sys/arch/arm/nxp/imx6_usb.c
diff -u src/sys/arch/arm/nxp/imx6_usb.c:1.6 src/sys/arch/arm/nxp/imx6_usb.c:1.7
--- src/sys/arch/arm/nxp/imx6_usb.c:1.6	Sat Aug  7 16:18:45 2021
+++ src/sys/arch/arm/nxp/imx6_usb.c	Thu May  4 13:29:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_usb.c,v 1.6 

CVS commit: src/sys/arch/arm/nxp

2023-05-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu May  4 13:29:33 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6_gpc.c imx6_iomux.c imx6_pcie.c imx6_spi.c
imx6_usb.c imx6_usbphy.c imx_sdhc.c

Log Message:
Add i.mx6sx compatible entries to drivers that should work as is.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nxp/imx6_gpc.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6_iomux.c \
src/sys/arch/arm/nxp/imx6_usbphy.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/nxp/imx6_pcie.c \
src/sys/arch/arm/nxp/imx6_usb.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nxp/imx6_spi.c \
src/sys/arch/arm/nxp/imx_sdhc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/nxp

2023-05-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu May  4 13:28:05 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6_platform.c imx6_reg.h

Log Message:
i.mx6sx platform support:
- the i.mx6sx has a third AIPS, so KERNEL_IO_IOREG map has to be larger
- the uart clock is at 24Mhz instead of 80.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nxp/imx6_platform.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6_reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/nxp

2023-05-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu May  4 13:28:05 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6_platform.c imx6_reg.h

Log Message:
i.mx6sx platform support:
- the i.mx6sx has a third AIPS, so KERNEL_IO_IOREG map has to be larger
- the uart clock is at 24Mhz instead of 80.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nxp/imx6_platform.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6_reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nxp/imx6_platform.c
diff -u src/sys/arch/arm/nxp/imx6_platform.c:1.7 src/sys/arch/arm/nxp/imx6_platform.c:1.8
--- src/sys/arch/arm/nxp/imx6_platform.c:1.7	Fri Apr  7 08:55:30 2023
+++ src/sys/arch/arm/nxp/imx6_platform.c	Thu May  4 13:28:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_platform.c,v 1.7 2023/04/07 08:55:30 skrll Exp $	*/
+/*	$NetBSD: imx6_platform.c,v 1.8 2023/05/04 13:28:04 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.7 2023/04/07 08:55:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.8 2023/05/04 13:28:04 bouyer Exp $");
 
 #include "arml2cc.h"
 #include "opt_console.h"
@@ -67,6 +67,7 @@ __KERNEL_RCSID(0, "$NetBSD: imx6_platfor
 #include 
 
 #define	IMX_REF_FREQ	8000
+#define	IMX6SX_REF_FREQ	2400
 
 #ifdef VERBOSE_INIT_ARM
 #define VPRINTF(...)	printf(__VA_ARGS__)
@@ -89,6 +90,18 @@ imx_platform_devmap(void)
 	return devmap;
 }
 
+static const struct pmap_devmap *
+imx6sx_platform_devmap(void)
+{
+	static const struct pmap_devmap devmap[] = {
+		DEVMAP_ENTRY(KERNEL_IO_IOREG_VBASE, IMX6_IOREG_PBASE, IMX6SX_IOREG_SIZE),
+		DEVMAP_ENTRY(KERNEL_IO_ARMCORE_VBASE, IMX6_ARMCORE_PBASE, IMX6_ARMCORE_SIZE),
+		DEVMAP_ENTRY_END
+	};
+
+	return devmap;
+}
+
 static void
 imx_platform_init_attach_args(struct fdt_attach_args *faa)
 {
@@ -140,6 +153,13 @@ imx_platform_uart_freq(void)
 	return IMX_REF_FREQ;
 }
 
+static u_int
+imx6sx_platform_uart_freq(void)
+{
+	return IMX6SX_REF_FREQ;
+}
+
+
 static void
 imx_platform_bootstrap(void)
 {
@@ -234,6 +254,18 @@ static const struct fdt_platform imx6_pl
 	.fp_mpstart = imx_platform_mpstart,
 };
 
+static const struct fdt_platform imx6sx_platform = {
+	.fp_devmap = imx6sx_platform_devmap,
+	.fp_bootstrap = imx_platform_bootstrap,
+	.fp_init_attach_args = imx_platform_init_attach_args,
+	.fp_device_register = imx_platform_device_register,
+	.fp_reset = imx6_platform_reset,
+	.fp_delay = a9ptmr_delay,
+	.fp_uart_freq = imx6sx_platform_uart_freq,
+	.fp_mpstart = imx_platform_mpstart,
+};
+
 FDT_PLATFORM(imx6dl, "fsl,imx6dl", _platform);
+FDT_PLATFORM(imx6sx, "fsl,imx6sx", _platform);
 FDT_PLATFORM(imx6q, "fsl,imx6q", _platform);
 FDT_PLATFORM(imx6qp, "fsl,imx6qp", _platform);

Index: src/sys/arch/arm/nxp/imx6_reg.h
diff -u src/sys/arch/arm/nxp/imx6_reg.h:1.1 src/sys/arch/arm/nxp/imx6_reg.h:1.2
--- src/sys/arch/arm/nxp/imx6_reg.h:1.1	Wed Dec 23 14:42:38 2020
+++ src/sys/arch/arm/nxp/imx6_reg.h	Thu May  4 13:28:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_reg.h,v 1.1 2020/12/23 14:42:38 skrll Exp $	*/
+/*	$NetBSD: imx6_reg.h,v 1.2 2023/05/04 13:28:04 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -34,6 +34,7 @@
 
 #define	IMX6_IOREG_PBASE	IMX6_AIPS1_BASE
 #define	IMX6_IOREG_SIZE		(IMX6_AIPS1_SIZE + IMX6_AIPS2_SIZE)
+#define	IMX6SX_IOREG_SIZE	(IMX6_AIPS1_SIZE + IMX6_AIPS2_SIZE + IMX6_AIPS3_SIZE)
 
 #define	IMX6_ARMCORE_PBASE	IMX6_MPCORE_BASE
 #define	IMX6_ARMCORE_SIZE	IMX6_MPCORE_SIZE
@@ -62,6 +63,9 @@
 #define	IMX6_SATA_BASE		0x0220
 #define	IMX6_SATA_SIZE		0x4000
 
+#define	IMX6_AIPS3_BASE		0x0220
+#define	IMX6_AIPS3_SIZE		0x0010
+
 #define	IMX6_AIPS2_BASE		0x0210
 #define	IMX6_AIPS2_SIZE		0x0010
 



CVS commit: src/sys/arch/arm/nxp

2023-05-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu May  4 13:25:07 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: files.imx imx6_ccm.c imx6_ccmreg.h imx6_ccmvar.h
imx6_clk.c
Added Files:
src/sys/arch/arm/nxp: imx6sx_clk.c

Log Message:
i.mx6sx CPU support in the CCM module: the clock tree si different from
the i.mx6q
- move i.mx6q-specific functions and data to imx6_clk.c
- add i.mx6sx specific imx6sx_clk.c
- add a imx6sxccm device


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/files.imx \
src/sys/arch/arm/nxp/imx6_ccmvar.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nxp/imx6_ccm.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6_ccmreg.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/nxp/imx6_clk.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/nxp/imx6sx_clk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nxp/files.imx
diff -u src/sys/arch/arm/nxp/files.imx:1.2 src/sys/arch/arm/nxp/files.imx:1.3
--- src/sys/arch/arm/nxp/files.imx:1.2	Wed Jul 20 10:01:10 2022
+++ src/sys/arch/arm/nxp/files.imx	Thu May  4 13:25:07 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: files.imx,v 1.2 2022/07/20 10:01:10 riastradh Exp $
+#	$NetBSD: files.imx,v 1.3 2023/05/04 13:25:07 bouyer Exp $
 #
 # Configuration info for the Freescale i.MX6
 #
@@ -10,6 +10,7 @@ defflag	opt_soc.hSOC_IMX
 defflag	opt_soc.hSOC_IMX6DL: SOC_IMX
 defflag	opt_soc.hSOC_IMX6Q: SOC_IMX
 defflag	opt_soc.hSOC_IMX6QDL: SOC_IMX
+defflag	opt_soc.hSOC_IMX6SX: SOC_IMX
 defflag	opt_soc.hSOC_IMX7D: SOC_IMX
 
 defflag opt_imx.hIMX6
@@ -17,9 +18,14 @@ defflag opt_imx.hIMX6
 # Clock
 device	imx6ccm : clk
 attach	imx6ccm at fdt
-file	arch/arm/nxp/imx6_ccm.c			imx6ccm
 file	arch/arm/nxp/imx6_clk.c			imx6ccm
 
+device	imx6sxccm : clk
+attach	imx6sxccm at fdt
+file	arch/arm/nxp/imx6sx_clk.c		imx6sxccm
+
+file	arch/arm/nxp/imx6_ccm.c			imx6ccm | imx6sxccm
+
 # Common FDT clock framework
 define	imx_ccm: clk
 file	arch/arm/nxp/imx_ccm.c			imx_ccm
Index: src/sys/arch/arm/nxp/imx6_ccmvar.h
diff -u src/sys/arch/arm/nxp/imx6_ccmvar.h:1.2 src/sys/arch/arm/nxp/imx6_ccmvar.h:1.3
--- src/sys/arch/arm/nxp/imx6_ccmvar.h:1.2	Fri Apr 14 17:45:59 2023
+++ src/sys/arch/arm/nxp/imx6_ccmvar.h	Thu May  4 13:25:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_ccmvar.h,v 1.2 2023/04/14 17:45:59 bouyer Exp $	*/
+/*	$NetBSD: imx6_ccmvar.h,v 1.3 2023/05/04 13:25:07 bouyer Exp $	*/
 /*
  * Copyright (c) 2012,2019  Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -42,11 +42,19 @@ struct imx6ccm_softc {
 	int sc_imx6_clksize;
 };
 
-void imx6ccm_attach_common(device_t, struct imx6_clk *, int);
+struct imxccm_init_parent;
+
+void imx6ccm_attach_common(device_t, struct imx6_clk *, int,
+struct imxccm_init_parent *);
 
 struct clk *imx6_get_clock(struct imx6ccm_softc *, const char *);
 struct imx6_clk *imx6_clk_find(struct imx6ccm_softc *sc, const char *);
 
+struct imxccm_init_parent {
+	const char *clock;
+	const char *parent;
+};
+
 
 enum imx6_clk_type {
 	IMX6_CLK_FIXED,

Index: src/sys/arch/arm/nxp/imx6_ccm.c
diff -u src/sys/arch/arm/nxp/imx6_ccm.c:1.3 src/sys/arch/arm/nxp/imx6_ccm.c:1.4
--- src/sys/arch/arm/nxp/imx6_ccm.c:1.3	Fri Apr 14 17:45:59 2023
+++ src/sys/arch/arm/nxp/imx6_ccm.c	Thu May  4 13:25:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_ccm.c,v 1.3 2023/04/14 17:45:59 bouyer Exp $	*/
+/*	$NetBSD: imx6_ccm.c,v 1.4 2023/05/04 13:25:07 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2010-2012, 2014  Genetec Corporation.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v 1.3 2023/04/14 17:45:59 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v 1.4 2023/05/04 13:25:07 bouyer Exp $");
 
 #include "opt_imx.h"
 #include "opt_cputypes.h"
@@ -52,7 +52,8 @@ __KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v
 
 #include 
 
-static void imxccm_init_clocks(struct imx6ccm_softc *);
+static void imxccm_init_clocks(struct imx6ccm_softc *,
+			   struct imxccm_init_parent *);
 static struct clk *imxccm_clk_get(void *, const char *);
 static void imxccm_clk_put(void *, struct clk *);
 static u_int imxccm_clk_get_rate(void *, struct clk *);
@@ -74,7 +75,8 @@ static const struct clk_funcs imxccm_clk
 };
 
 void
-imx6ccm_attach_common(device_t self, struct imx6_clk *imx6_clks, int size)
+imx6ccm_attach_common(device_t self, struct imx6_clk *imx6_clks, int size, 
+struct imxccm_init_parent *imxccm_init_parents)
 {
 	struct imx6ccm_softc * const sc = device_private(self);
 
@@ -90,12 +92,13 @@ imx6ccm_attach_common(device_t self, str
 		clk_attach(_clks[n].base);
 	}
 
-	imxccm_init_clocks(sc);
+	imxccm_init_clocks(sc, imxccm_init_parents);
 
 	for (int n = 0; n < size; n++) {
 		struct clk *clk = _clks[n].base;
 		struct clk *clk_parent = clk_get_parent(clk);
 		const char *parent_str = clk_parent ? clk_parent->name : 

CVS commit: src/sys/arch/arm/nxp

2023-05-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu May  4 13:25:07 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: files.imx imx6_ccm.c imx6_ccmreg.h imx6_ccmvar.h
imx6_clk.c
Added Files:
src/sys/arch/arm/nxp: imx6sx_clk.c

Log Message:
i.mx6sx CPU support in the CCM module: the clock tree si different from
the i.mx6q
- move i.mx6q-specific functions and data to imx6_clk.c
- add i.mx6sx specific imx6sx_clk.c
- add a imx6sxccm device


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/files.imx \
src/sys/arch/arm/nxp/imx6_ccmvar.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nxp/imx6_ccm.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6_ccmreg.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/nxp/imx6_clk.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/nxp/imx6sx_clk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/nxp

2023-04-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Apr 14 17:46:00 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6_ccm.c imx6_ccmvar.h imx6_clk.c

Log Message:
In preparation of imx6sx support, move imx6q-specific definitions from
imx6_ccm.c to imx6_clk.c, and prefix with IMX6Q/imx6q:
- Clock IDs and related struct imx_clock_id
- Clock Parents and Divider Tables
- struct imx6_clk
and related static functions

Add a pointer to struct imx6_clk, and it's size to imx6ccm_softc
Pass a pointer to imx6ccm_softc to all functions from imx6_ccm.c

NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6_ccm.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6_ccmvar.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/nxp/imx6_clk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nxp/imx6_ccm.c
diff -u src/sys/arch/arm/nxp/imx6_ccm.c:1.2 src/sys/arch/arm/nxp/imx6_ccm.c:1.3
--- src/sys/arch/arm/nxp/imx6_ccm.c:1.2	Tue Sep 27 06:36:42 2022
+++ src/sys/arch/arm/nxp/imx6_ccm.c	Fri Apr 14 17:45:59 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_ccm.c,v 1.2 2022/09/27 06:36:42 skrll Exp $	*/
+/*	$NetBSD: imx6_ccm.c,v 1.3 2023/04/14 17:45:59 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2010-2012, 2014  Genetec Corporation.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v 1.2 2022/09/27 06:36:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v 1.3 2023/04/14 17:45:59 bouyer Exp $");
 
 #include "opt_imx.h"
 #include "opt_cputypes.h"
@@ -52,844 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v
 
 #include 
 
-/* Clock Parents Tables */
-static const char *step_p[] = {
-	"osc",
-	"pll2_pfd2_396m"
-};
-
-static const char *pll1_sw_p[] = {
-	"pll1_sys",
-	"step"
-};
-
-static const char *periph_pre_p[] = {
-	"pll2_bus",
-	"pll2_pfd2_396m",
-	"pll2_pfd0_352m",
-	"pll2_198m"
-};
-
-static const char *periph_clk2_p[] = {
-	"pll3_usb_otg",
-	"osc",
-	"osc",
-	"dummy"
-};
-
-static const char *periph2_clk2_p[] = {
-	"pll3_usb_otg",
-	"pll2_bus"
-};
-
-static const char *axi_p[] = {
-	"periph",
-	"pll2_pfd2_396m",
-	"periph",
-	"pll3_pfd1_540m"
-};
-
-static const char *audio_p[] = {
-	"pll4_audio_div",
-	"pll3_pfd2_508m",
-	"pll3_pfd3_454m",
-	"pll3_usb_otg"
-};
-
-static const char *gpu2d_core_p[] = {
-	"axi",
-	"pll3_usb_otg",
-	"pll2_pfd0_352m",
-	"pll2_pfd2_396m"
-};
-
-static const char *gpu3d_core_p[] = {
-	"mmdc_ch0_axi",
-	"pll3_usb_otg",
-	"pll2_pfd1_594m",
-	"pll2_pfd2_396m"
-};
-
-static const char *gpu3d_shader_p[] = {
-	"mmdc_ch0_axi",
-	"pll3_usb_otg",
-	"pll2_pfd1_594m",
-	"pll3_pfd0_720m"
-};
-
-static const char *ipu_p[] = {
-	"mmdc_ch0_axi",
-	"pll2_pfd2_396m",
-	"pll3_120m",
-	"pll3_pfd1_540m"
-};
-
-static const char *pll_bypass_src_p[] = {
-	"osc",
-	"lvds1_in",
-	"lvds2_in",
-	"dummy"
-};
-
-static const char *pll1_bypass_p[] = {
-	"pll1",
-	"pll1_bypass_src"
-};
-
-static const char *pll2_bypass_p[] = {
-	"pll2",
-	"pll2_bypass_src"
-};
-
-static const char *pll3_bypass_p[] = {
-	"pll3",
-	"pll3_bypass_src"
-};
-
-static const char *pll4_bypass_p[] = {
-	"pll4",
-	"pll4_bypass_src"
-};
-
-static const char *pll5_bypass_p[] = {
-	"pll5",
-	"pll5_bypass_src"
-};
-
-static const char *pll6_bypass_p[] = {
-	"pll6",
-	"pll6_bypass_src"
-};
-
-static const char *pll7_bypass_p[] = {
-	"pll7",
-	"pll7_bypass_src"
-};
-
-static const char *ipu_di_pre_p[] = {
-	"mmdc_ch0_axi",
-	"pll3_usb_otg",
-	"pll5_video_div",
-	"pll2_pfd0_352m",
-	"pll2_pfd2_396m",
-	"pll3_pfd1_540m"
-};
-
-static const char *ipu1_di0_p[] = {
-	"ipu1_di0_pre",
-	"dummy",
-	"dummy",
-	"ldb_di0",
-	"ldb_di1"
-};
-
-static const char *ipu1_di1_p[] = {
-	"ipu1_di1_pre",
-	"dummy",
-	"dummy",
-	"ldb_di0",
-	"ldb_di1"
-};
-
-static const char *ipu2_di0_p[] = {
-	"ipu2_di0_pre",
-	"dummy",
-	"dummy",
-	"ldb_di0",
-	"ldb_di1"
-};
-
-static const char *ipu2_di1_p[] = {
-	"ipu2_di1_pre",
-	"dummy",
-	"dummy",
-	"ldb_di0",
-	"ldb_di1"
-};
-
-static const char *ldb_di_p[] = {
-	"pll5_video_div",
-	"pll2_pfd0_352m",
-	"pll2_pfd2_396m",
-	"mmdc_ch1_axi",
-	"pll3_usb_otg"
-};
-
-static const char *periph_p[] = {
-	"periph_pre",
-	"periph_clk2"
-};
-
-static const char *periph2_p[] = {
-	"periph2_pre",
-	"periph2_clk2"
-};
-
-static const char *vdo_axi_p[] = {
-	"axi",
-	"ahb"
-};
-
-static const char *vpu_axi_p[] = {
-	"axi",
-	"pll2_pfd2_396m",
-	"pll2_pfd0_352m"
-};
-
-static const char *cko1_p[] = {
-	"pll3_usb_otg",
-	"pll2_bus",
-	"pll1_sys",
-	"pll5_video_div",
-	"dummy",
-	"axi",
-	"enfc",
-	"ipu1_di0",
-	"ipu1_di1",
-	"ipu2_di0",
-	"ipu2_di1",
-	"ahb",
-	"ipg",
-	"ipg_per",
-	"ckil",
-	"pll4_audio_div"
-};
-
-static const char *cko2_p[] = {
-	"mmdc_ch0_axi",
-	"mmdc_ch1_axi",
-	"usdhc4",
-	"usdhc1",
-	"gpu2d_axi",
-	"dummy",
-	"ecspi_root",
-	"gpu3d_axi",
-	"usdhc3",
-	"dummy",
-	"arm",
-	"ipu1",
-	"ipu2",
-	"vdo_axi",
-	"osc",
-	"gpu2d_core",
-	

CVS commit: src/sys/arch/arm/nxp

2023-04-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Apr 14 17:46:00 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6_ccm.c imx6_ccmvar.h imx6_clk.c

Log Message:
In preparation of imx6sx support, move imx6q-specific definitions from
imx6_ccm.c to imx6_clk.c, and prefix with IMX6Q/imx6q:
- Clock IDs and related struct imx_clock_id
- Clock Parents and Divider Tables
- struct imx6_clk
and related static functions

Add a pointer to struct imx6_clk, and it's size to imx6ccm_softc
Pass a pointer to imx6ccm_softc to all functions from imx6_ccm.c

NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6_ccm.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6_ccmvar.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/nxp/imx6_clk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/nxp

2022-12-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Dec 27 18:55:06 UTC 2022

Modified Files:
src/sys/arch/arm/nxp: if_enet_imx.c

Log Message:
don't use uninitialised data.  should fix PR#57135's crash.

XXX: pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/nxp/if_enet_imx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nxp/if_enet_imx.c
diff -u src/sys/arch/arm/nxp/if_enet_imx.c:1.6 src/sys/arch/arm/nxp/if_enet_imx.c:1.7
--- src/sys/arch/arm/nxp/if_enet_imx.c:1.6	Wed Jan 27 03:10:20 2021
+++ src/sys/arch/arm/nxp/if_enet_imx.c	Tue Dec 27 18:55:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_enet_imx.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $	*/
+/*	$NetBSD: if_enet_imx.c,v 1.7 2022/12/27 18:55:06 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_enet_imx.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_enet_imx.c,v 1.7 2022/12/27 18:55:06 mrg Exp $");
 
 #include "opt_fdt.h"
 
@@ -175,7 +175,7 @@ enet_attach(device_t parent, device_t se
 	return;
 
 failure:
-	bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
+	bus_space_unmap(bst, bsh, size);
 	return;
 }
 



CVS commit: src/sys/arch/arm/nxp

2022-12-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Dec 27 18:55:06 UTC 2022

Modified Files:
src/sys/arch/arm/nxp: if_enet_imx.c

Log Message:
don't use uninitialised data.  should fix PR#57135's crash.

XXX: pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/nxp/if_enet_imx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/nxp

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 11:25:39 UTC 2021

Modified Files:
src/sys/arch/arm/nxp: imx6_dwhdmi.c

Log Message:
catch up with newer drm_encoder_init prototype

Author: Maya Rashish 
Committer: Taylor R Campbell 


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nxp/imx6_dwhdmi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nxp/imx6_dwhdmi.c
diff -u src/sys/arch/arm/nxp/imx6_dwhdmi.c:1.3 src/sys/arch/arm/nxp/imx6_dwhdmi.c:1.4
--- src/sys/arch/arm/nxp/imx6_dwhdmi.c:1.3	Sun Dec 19 11:25:32 2021
+++ src/sys/arch/arm/nxp/imx6_dwhdmi.c	Sun Dec 19 11:25:39 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: imx6_dwhdmi.c,v 1.3 2021/12/19 11:25:32 riastradh Exp $ */
+/* $NetBSD: imx6_dwhdmi.c,v 1.4 2021/12/19 11:25:39 riastradh Exp $ */
 /*-
  * Copyright (c) 2020 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_dwhdmi.c,v 1.3 2021/12/19 11:25:32 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_dwhdmi.c,v 1.4 2021/12/19 11:25:39 riastradh Exp $");
 
 #include 
 #include 
@@ -161,7 +161,7 @@ imx6_dwhdmi_ep_activate(device_t dev, st
 
 	sc->sc_encoder.possible_crtcs = 3; // 1U << drm_crtc_index(crtc); /* XXX */
 	drm_encoder_init(crtc->dev, >sc_encoder, _dwhdmi_encoder_funcs,
-	DRM_MODE_ENCODER_TMDS);
+	DRM_MODE_ENCODER_TMDS, NULL);
 	drm_encoder_helper_add(>sc_encoder, _dwhdmi_encoder_helper_funcs);
 
 	sc->sc_base.sc_connector.base.connector_type = DRM_MODE_CONNECTOR_HDMIA;



CVS commit: src/sys/arch/arm/nxp

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 11:25:39 UTC 2021

Modified Files:
src/sys/arch/arm/nxp: imx6_dwhdmi.c

Log Message:
catch up with newer drm_encoder_init prototype

Author: Maya Rashish 
Committer: Taylor R Campbell 


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nxp/imx6_dwhdmi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/nxp

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 11:25:32 UTC 2021

Modified Files:
src/sys/arch/arm/nxp: imx6_dwhdmi.c

Log Message:
drmP.h is no more

Author: Maya Rashish 
Committer: Taylor R Campbell 


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6_dwhdmi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nxp/imx6_dwhdmi.c
diff -u src/sys/arch/arm/nxp/imx6_dwhdmi.c:1.2 src/sys/arch/arm/nxp/imx6_dwhdmi.c:1.3
--- src/sys/arch/arm/nxp/imx6_dwhdmi.c:1.2	Wed Jan 27 03:10:20 2021
+++ src/sys/arch/arm/nxp/imx6_dwhdmi.c	Sun Dec 19 11:25:32 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: imx6_dwhdmi.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */
+/* $NetBSD: imx6_dwhdmi.c,v 1.3 2021/12/19 11:25:32 riastradh Exp $ */
 /*-
  * Copyright (c) 2020 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_dwhdmi.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_dwhdmi.c,v 1.3 2021/12/19 11:25:32 riastradh Exp $");
 
 #include 
 #include 
@@ -36,7 +36,6 @@ __KERNEL_RCSID(0, "$NetBSD: imx6_dwhdmi.
 #include 
 #include 
 
-#include 
 #include 
 
 #include 



CVS commit: src/sys/arch/arm/nxp

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 11:25:32 UTC 2021

Modified Files:
src/sys/arch/arm/nxp: imx6_dwhdmi.c

Log Message:
drmP.h is no more

Author: Maya Rashish 
Committer: Taylor R Campbell 


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6_dwhdmi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.