]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
m68k: mcf5441x: create stub to use imx drivers
authorAngelo Dureghello <angelo@kernel-space.org>
Mon, 23 Mar 2026 23:14:24 +0000 (00:14 +0100)
committerAngelo Dureghello <angelo@kernel-space.org>
Mon, 4 May 2026 20:19:49 +0000 (22:19 +0200)
Some NXP imx hardware ip module as the esdhc controller are exactly the
same in some new ColdFire cpus. For the specific case, mcf5441x needs to
use the existing fsl_esdhc_imx.c driver for the esdhc device.

Create a stub to be able to use NXP "imx" serie drivers as the
fsl_esdhc_imx in the ColdFire architecture.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
arch/m68k/Kconfig
arch/m68k/include/asm/arch-mcf5445x/clock.h [new file with mode: 0644]
arch/m68k/lib/Makefile
arch/m68k/lib/clock.c [new file with mode: 0644]

index 6ce8f577e3a14cf32abeb8d9ae7d0cab79248b26..00e89bd0a6253fb3be2b61ddc0d1b9e2728fd549 100644 (file)
@@ -62,6 +62,7 @@ config MCF5441x
        select DM
         select DM_SERIAL
        select ARCH_COLDFIRE
+       select CREATE_ARCH_SYMLINK
        bool
 
 config M680x0
diff --git a/arch/m68k/include/asm/arch-mcf5445x/clock.h b/arch/m68k/include/asm/arch-mcf5445x/clock.h
new file mode 100644 (file)
index 0000000..10ceeca
--- /dev/null
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * ColdFire clock support
+ *
+ * Copyright 2026 Kernelspace.
+ * Angelo Dureghello <angelo@kernel-space.org>
+ */
+
+#ifndef __CLOCK_H
+#define __CLOCK_H
+
+/* Stub to use fsl/nxp drivers. */
+enum mxc_clock {
+       MXC_ESDHC_CLK,
+};
+
+int mxc_get_clock(enum mxc_clock clk);
+
+#endif /* __CLOCK_H */
index cf93715637a6c4e8f8ebce0c71077288fd99b04c..9ad67c4272c7233a8ac48640ca0b003978c78074 100644 (file)
@@ -9,3 +9,4 @@ lib-$(CONFIG_USE_PRIVATE_LIBGCC) += lshrdi3.o muldi3.o ashldi3.o ashrdi3.o
 
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-$(CONFIG_ARCH_COLDFIRE) += cache.o interrupts.o time.o traps.o bdinfo.o fec.o
+obj-$(CONFIG_MCF5441x) += clock.o
diff --git a/arch/m68k/lib/clock.c b/arch/m68k/lib/clock.c
new file mode 100644 (file)
index 0000000..5d9aeed
--- /dev/null
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2026 Kernelspace
+ * Angelo Dureghello <angelo@kernel-space.org>
+ */
+
+#include <config.h>
+#include <asm/arch/clock.h>
+#include <asm/global_data.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+/*
+ * Stub to use existing nxp/fsl drivers.
+ */
+int mxc_get_clock(enum mxc_clock clk)
+{
+       if (clk == MXC_ESDHC_CLK)
+               return gd->arch.sdhc_clk;
+
+       printf("Unsupported MXC CLK: %d\n", clk);
+
+       return 0;
+}