From: Mateus Lima Alves <mateuslima.ti@gmail.com>
To: peng.fan@oss.nxp.com, alison.wang@nxp.com
Cc: Mateus Lima Alves <mateuslima.ti@gmail.com>, u-boot@lists.denx.de
Subject: [PATCH v2] armv7: Add CPLD support via IFC to the ls1021a-iot board.
Date: Tue, 13 Jan 2026 11:23:01 -0300 [thread overview]
Message-ID: <20260113142303.441190-1-mateuslima.ti@gmail.com> (raw)
This patch adds CPLD support via IFC to the ls1021a-iot board.
Signed-off-by: Mateus Lima Alves <mateuslima.ti@gmail.com>
---
Changes since v1:
Reselected CONFIG_CMD_MII in file configs/ls1021aiot_sdcard_defconfig.
---
board/freescale/ls1021aiot/ls1021aiot.c | 5 ++++
configs/ls1021aiot_sdcard_defconfig | 1 +
drivers/misc/Kconfig | 6 ++++-
include/configs/ls1021aiot.h | 34 +++++++++++++++++++++++++
4 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/board/freescale/ls1021aiot/ls1021aiot.c b/board/freescale/ls1021aiot/ls1021aiot.c
index 4eff0a3fee0..52a3c3abdb4 100644
--- a/board/freescale/ls1021aiot/ls1021aiot.c
+++ b/board/freescale/ls1021aiot/ls1021aiot.c
@@ -21,6 +21,7 @@
#include <asm/sections.h>
#include <fsl_csu.h>
#include <fsl_immap.h>
+#include <fsl_ifc.h>
#include <netdev.h>
#include <fsl_mdio.h>
#include <tsec.h>
@@ -120,6 +121,10 @@ int board_early_init_f(void)
#endif
+#ifdef CONFIG_FSL_IFC
+ init_early_memctl_regs();
+#endif
+
arch_soc_init();
return 0;
diff --git a/configs/ls1021aiot_sdcard_defconfig b/configs/ls1021aiot_sdcard_defconfig
index 6b32150e408..78b81c1895e 100644
--- a/configs/ls1021aiot_sdcard_defconfig
+++ b/configs/ls1021aiot_sdcard_defconfig
@@ -106,3 +106,4 @@ CONFIG_FSL_QSPI=y
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DWC3=y
+CONFIG_FSL_IFC=y
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index dde773ab6b1..229a50f266f 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -694,7 +694,11 @@ config ESM_PMIC
typically to reboot the board in error condition.
config FSL_IFC
- bool
+ bool "Freescale Integrated Flash Controller"
+ help
+ This driver is for the Integrated Flash Controller(IFC) module
+ available in Freescale SoCs. This controller allows to handle
+ devices such as NOR, NAND, FPGA and ASIC etc.
config SL28CPLD
bool "Enable Kontron sl28cpld multi-function driver"
diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h
index 971a393817a..59acf00b8e5 100644
--- a/include/configs/ls1021aiot.h
+++ b/include/configs/ls1021aiot.h
@@ -44,6 +44,40 @@
#define CFG_SYS_DDR_SDRAM_BASE 0x80000000UL
#define CFG_SYS_SDRAM_BASE CFG_SYS_DDR_SDRAM_BASE
+/* CPLD */
+
+#define CFG_SYS_CPLD_BASE 0x7fb00000
+#define CPLD_BASE_PHYS CFG_SYS_CPLD_BASE
+
+#define CFG_SYS_FPGA_CSPR_EXT (0x0)
+#define CFG_SYS_FPGA_CSPR (CSPR_PHYS_ADDR(CPLD_BASE_PHYS) | \
+ CSPR_PORT_SIZE_8 | \
+ CSPR_MSEL_GPCM | \
+ CSPR_V)
+#define CFG_SYS_FPGA_AMASK IFC_AMASK(64 * 1024)
+#define CFG_SYS_FPGA_CSOR (CSOR_NOR_ADM_SHIFT(4) | \
+ CSOR_NOR_NOR_MODE_AVD_NOR | \
+ CSOR_NOR_TRHZ_80)
+
+/* CPLD Timing parameters for IFC GPCM */
+#define CFG_SYS_FPGA_FTIM0 (FTIM0_GPCM_TACSE(0xf) | \
+ FTIM0_GPCM_TEADC(0xf) | \
+ FTIM0_GPCM_TEAHC(0xf))
+#define CFG_SYS_FPGA_FTIM1 (FTIM1_GPCM_TACO(0xff) | \
+ FTIM1_GPCM_TRAD(0x3f))
+#define CFG_SYS_FPGA_FTIM2 (FTIM2_GPCM_TCS(0xf) | \
+ FTIM2_GPCM_TCH(0xf) | \
+ FTIM2_GPCM_TWP(0xff))
+#define CFG_SYS_FPGA_FTIM3 0x0
+#define CFG_SYS_CSPR0_EXT CFG_SYS_FPGA_CSPR_EXT
+#define CFG_SYS_CSPR0 CFG_SYS_FPGA_CSPR
+#define CFG_SYS_AMASK0 CFG_SYS_FPGA_AMASK
+#define CFG_SYS_CSOR0 CFG_SYS_FPGA_CSOR
+#define CFG_SYS_CS0_FTIM0 CFG_SYS_FPGA_FTIM0
+#define CFG_SYS_CS0_FTIM1 CFG_SYS_FPGA_FTIM1
+#define CFG_SYS_CS0_FTIM2 CFG_SYS_FPGA_FTIM2
+#define CFG_SYS_CS0_FTIM3 CFG_SYS_FPGA_FTIM3
+
/*
* Serial Port
*/
--
2.43.0
next reply other threads:[~2026-01-13 14:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 14:23 Mateus Lima Alves [this message]
2026-01-22 3:28 ` [PATCH v2] armv7: Add CPLD support via IFC to the ls1021a-iot board Peng Fan
2026-01-22 13:12 ` Mateus Lima
2026-01-23 2:11 ` Mateus Lima
2026-01-26 2:11 ` Peng Fan
2026-01-28 16:47 ` Tom Rini
2026-01-28 17:06 ` Mateus Lima
2026-01-28 17:46 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260113142303.441190-1-mateuslima.ti@gmail.com \
--to=mateuslima.ti@gmail.com \
--cc=alison.wang@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox