Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/nxp i.mx6sx platform support:



details:   https://anonhg.NetBSD.org/src/rev/228c9f30d392
branches:  trunk
changeset: 374564:228c9f30d392
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu May 04 13:28:04 2023 +0000

description:
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.

diffstat:

 sys/arch/arm/nxp/imx6_platform.c |  36 ++++++++++++++++++++++++++++++++++--
 sys/arch/arm/nxp/imx6_reg.h      |   6 +++++-
 2 files changed, 39 insertions(+), 3 deletions(-)

diffs (105 lines):

diff -r 3ffdbc1361a1 -r 228c9f30d392 sys/arch/arm/nxp/imx6_platform.c
--- a/sys/arch/arm/nxp/imx6_platform.c  Thu May 04 13:25:07 2023 +0000
+++ b/sys/arch/arm/nxp/imx6_platform.c  Thu May 04 13:28:04 2023 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
 #include <libfdt.h>
 
 #define        IMX_REF_FREQ    80000000
+#define        IMX6SX_REF_FREQ 24000000
 
 #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", &imx6_platform);
+FDT_PLATFORM(imx6sx, "fsl,imx6sx", &imx6sx_platform);
 FDT_PLATFORM(imx6q, "fsl,imx6q", &imx6_platform);
 FDT_PLATFORM(imx6qp, "fsl,imx6qp", &imx6_platform);
diff -r 3ffdbc1361a1 -r 228c9f30d392 sys/arch/arm/nxp/imx6_reg.h
--- a/sys/arch/arm/nxp/imx6_reg.h       Thu May 04 13:25:07 2023 +0000
+++ b/sys/arch/arm/nxp/imx6_reg.h       Thu May 04 13:28:04 2023 +0000
@@ -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          0x02200000
 #define        IMX6_SATA_SIZE          0x00004000
 
+#define        IMX6_AIPS3_BASE         0x02200000
+#define        IMX6_AIPS3_SIZE         0x00100000
+
 #define        IMX6_AIPS2_BASE         0x02100000
 #define        IMX6_AIPS2_SIZE         0x00100000
 



Home | Main Index | Thread Index | Old Index