All of lore.kernel.org
 help / color / mirror / Atom feed
From: Angelo Dureghello <angelo@kernel-space.org>
To: trini@konsulko.com
Cc: visitorckw@gmail.com, u-boot@lists.denx.de, sjg@chromium.org,
	Angelo Dureghello <angelo@kernel-space.org>
Subject: [PATCH 8/9] m68k: mcf5441x: create stub to use imx drivers
Date: Thu, 16 Apr 2026 14:14:30 +0200	[thread overview]
Message-ID: <20260416121431.20852-8-angelo@kernel-space.org> (raw)
In-Reply-To: <20260416121431.20852-1-angelo@kernel-space.org>

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                           |  1 +
 arch/m68k/include/asm/arch-mcf5445x/clock.h | 19 +++++++++++++++++
 arch/m68k/lib/Makefile                      |  1 +
 arch/m68k/lib/clock.c                       | 23 +++++++++++++++++++++
 4 files changed, 44 insertions(+)
 create mode 100644 arch/m68k/include/asm/arch-mcf5445x/clock.h
 create mode 100644 arch/m68k/lib/clock.c

diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 6ce8f577e3a..00e89bd0a62 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -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
index 00000000000..10ceecafcea
--- /dev/null
+++ b/arch/m68k/include/asm/arch-mcf5445x/clock.h
@@ -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 */
diff --git a/arch/m68k/lib/Makefile b/arch/m68k/lib/Makefile
index cf93715637a..9ad67c4272c 100644
--- a/arch/m68k/lib/Makefile
+++ b/arch/m68k/lib/Makefile
@@ -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
index 00000000000..5d9aeed96c3
--- /dev/null
+++ b/arch/m68k/lib/clock.c
@@ -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;
+}
-- 
2.53.0


  parent reply	other threads:[~2026-04-16 12:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 12:14 [PATCH 1/9] m68k: dts: mcf5441x: add mmc device for mcf5441x Angelo Dureghello
2026-04-16 12:14 ` [PATCH 2/9] m68k: dts: stmark2: enable esdhc Angelo Dureghello
2026-04-16 12:14 ` [PATCH 3/9] board: stmark2: add sd boot command Angelo Dureghello
2026-04-16 12:14 ` [PATCH 4/9] board: stmark2: remove old garbage Angelo Dureghello
2026-04-25 16:26   ` Kuan-Wei Chiu
2026-04-25 16:31     ` Kuan-Wei Chiu
2026-04-16 12:14 ` [PATCH 5/9] configs: stmark2: add support for mmc Angelo Dureghello
2026-04-25 17:02   ` Kuan-Wei Chiu
2026-04-16 12:14 ` [PATCH 6/9] configs: stmark2: add bdinfo command Angelo Dureghello
2026-04-16 12:14 ` [PATCH 7/9] mmc: Kconfig: allows m68k to use esdhc imx driver Angelo Dureghello
2026-04-16 12:14 ` Angelo Dureghello [this message]
2026-04-16 12:14 ` [PATCH 9/9] m68k: set proper u-boot image size for initial boot Angelo Dureghello

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=20260416121431.20852-8-angelo@kernel-space.org \
    --to=angelo@kernel-space.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=visitorckw@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.