public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data
@ 2026-01-12 22:47 Brian Masney
  2026-01-12 22:47 ` [PATCH v2 01/16] MIPS: pic32: include linux/io.h header on several files Brian Masney
                   ` (18 more replies)
  0 siblings, 19 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:47 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney, Michael Turquette,
	Stephen Boyd, linux-clk, Thomas Gleixner, Adrian Hunter,
	Ulf Hansson, linux-mmc, Linus Walleij, linux-gpio,
	Alexandre Belloni, linux-rtc, Greg Kroah-Hartman, Jiri Slaby,
	linux-serial, Guenter Roeck, Wim Van Sebroeck, linux-watchdog

There are currently some pic32 MIPS drivers that are in tree, and are
only configured to be compiled on the MIPS pic32 platform. There's a
risk of breaking some of these drivers when migrating drivers away from
legacy APIs. It happened to me with a pic32 clk driver.

Let's go ahead and move the pic32.h from the asm to the platform_data
include directory in the tree. This will make it easier, and cleaner to
enable COMPILE_TEST for some of these pic32 drivers. To do this requires
updating some includes, which I do at the beginning of this series.

This series was compile tested on a centos-stream-10 arm64 host in two
different configurations:

- native arm64 build with COMPILE_TEST (via make allmodconfig)
- MIPS cross compile on arm64 with:
      ARCH=mips CROSS_COMPILE=mips64-linux-gnu- make pic32mzda_defconfig

Note that there is a separate MIPS compile error in linux-next, and I
reported it at https://lore.kernel.org/all/aWVs2gVB418WiMVa@redhat.com/

I included a patch at the end that shows enabling COMPILE_TEST for a
pic32 clk driver.

Merge Strategy
==============
- Patches 1-15 can go through the MIPS tree.
- Patch 16 I can repost to Claudiu after patches 1-15 are in Linus's
  tree after the next merge window. There is a separate patch set that
  fixes a compiler error I unintentionally introduced via the clk tree.
  https://lore.kernel.org/linux-clk/CABx5tq+eOocJ41X-GSgkGy6S+s+Am1yCS099wqP695NtwALTmg@mail.gmail.com/T/

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
Changes in v2:
- Fix native MIPS build by updating include files
- Link to v1: https://lore.kernel.org/r/20260109-mips-pic32-header-move-v1-0-99859c55783d@redhat.com

---
Brian Masney (16):
      MIPS: pic32: include linux/io.h header on several files
      MIPS: pic32: include linux/types.h on pic32.h
      MIPS: pic32: drop unused include linux/io.h from pic32.h
      MIPS: copy pic32.h header file from asm/mach-pic32/ to include/platform-data/
      MAINTAINERS: add include/linux/platform_data/pic32.h to MIPS entry
      MIPS: update include to use pic32.h from platform_data
      clk: microchip: core: update include to use pic32.h from platform_data
      irqchip/irq-pic32-evic: update include to use pic32.h from platform_data
      mmc: sdhci-pic32: update include to use pic32.h from platform_data
      pinctrl: pic32: update include to use pic32.h from platform_data
      rtc: pic32: update include to use pic32.h from platform_data
      serial: pic32_uart: update include to use pic32.h from platform_data
      watchdog: pic32-dmt: update include to use pic32.h from platform_data
      watchdog: pic32-wdt: update include to use pic32.h from platform_data
      MIPS: drop unused pic32.h header
      clk: microchip: core: allow driver to be compiled with COMPILE_TEST

 MAINTAINERS                                             |  1 +
 arch/mips/pic32/common/reset.c                          |  3 ++-
 arch/mips/pic32/pic32mzda/config.c                      |  3 +--
 arch/mips/pic32/pic32mzda/early_clk.c                   |  3 ++-
 arch/mips/pic32/pic32mzda/early_console.c               |  3 ++-
 drivers/clk/microchip/Kconfig                           |  2 +-
 drivers/clk/microchip/clk-core.c                        |  6 +++++-
 drivers/irqchip/irq-pic32-evic.c                        |  2 +-
 drivers/mmc/host/sdhci-pic32.c                          |  2 +-
 drivers/pinctrl/pinctrl-pic32.c                         |  3 +--
 drivers/rtc/rtc-pic32.c                                 |  3 +--
 drivers/tty/serial/pic32_uart.c                         |  3 +--
 drivers/watchdog/pic32-dmt.c                            |  3 +--
 drivers/watchdog/pic32-wdt.c                            |  3 +--
 .../mach-pic32 => include/linux/platform_data}/pic32.h  | 17 ++++++++++-------
 15 files changed, 31 insertions(+), 26 deletions(-)
---
base-commit: f417b7ffcbef7d76b0d8860518f50dae0e7e5eda
change-id: 20260109-mips-pic32-header-move-6ac9965aa70a

Best regards,
-- 
Brian Masney <bmasney@redhat.com>


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH v2 01/16] MIPS: pic32: include linux/io.h header on several files
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
@ 2026-01-12 22:47 ` Brian Masney
  2026-01-12 22:47 ` [PATCH v2 02/16] MIPS: pic32: include linux/types.h on pic32.h Brian Masney
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:47 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney

The pic32.h header includes linux/io.h, however nothing from that
include file is directly used by pic32.h. Several C files that
include pic32.h indirectly depend on linux/io.h, so let's go ahead
and add the missing include so that linux/io.h can be dropped from
pic32.h.

Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 arch/mips/pic32/common/reset.c            | 1 +
 arch/mips/pic32/pic32mzda/early_clk.c     | 1 +
 arch/mips/pic32/pic32mzda/early_console.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/arch/mips/pic32/common/reset.c b/arch/mips/pic32/common/reset.c
index a5fd7a8e2800ff06cfe8c0ed91c8ff6f5996750f..19db57bfffbd314b6e75d2eb9237540c4139dd83 100644
--- a/arch/mips/pic32/common/reset.c
+++ b/arch/mips/pic32/common/reset.c
@@ -4,6 +4,7 @@
  * Copyright (C) 2015 Microchip Technology Inc.  All rights reserved.
  */
 #include <linux/init.h>
+#include <linux/io.h>
 #include <linux/pm.h>
 #include <asm/reboot.h>
 #include <asm/mach-pic32/pic32.h>
diff --git a/arch/mips/pic32/pic32mzda/early_clk.c b/arch/mips/pic32/pic32mzda/early_clk.c
index 6001e507d8e398dee77eed071f0e53f708b57a61..63727799d49a963d3b0d47d39ec5770c283047dc 100644
--- a/arch/mips/pic32/pic32mzda/early_clk.c
+++ b/arch/mips/pic32/pic32mzda/early_clk.c
@@ -3,6 +3,7 @@
  * Joshua Henderson <joshua.henderson@microchip.com>
  * Copyright (C) 2015 Microchip Technology Inc.  All rights reserved.
  */
+#include <linux/io.h>
 #include <asm/mach-pic32/pic32.h>
 
 #include "pic32mzda.h"
diff --git a/arch/mips/pic32/pic32mzda/early_console.c b/arch/mips/pic32/pic32mzda/early_console.c
index 3cd1b408fa1cb039f917f2d92e82fd00d8a44574..8afe4e636ace20b1e4269a6172fa5763afebc980 100644
--- a/arch/mips/pic32/pic32mzda/early_console.c
+++ b/arch/mips/pic32/pic32mzda/early_console.c
@@ -3,6 +3,7 @@
  * Joshua Henderson <joshua.henderson@microchip.com>
  * Copyright (C) 2015 Microchip Technology Inc.  All rights reserved.
  */
+#include <linux/io.h>
 #include <asm/mach-pic32/pic32.h>
 #include <asm/fw/fw.h>
 #include <asm/setup.h>

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 02/16] MIPS: pic32: include linux/types.h on pic32.h
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
  2026-01-12 22:47 ` [PATCH v2 01/16] MIPS: pic32: include linux/io.h header on several files Brian Masney
@ 2026-01-12 22:47 ` Brian Masney
  2026-01-12 22:47 ` [PATCH v2 03/16] MIPS: pic32: drop unused include linux/io.h from pic32.h Brian Masney
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:47 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney

The pic32.h header file currently includes linux/io.h, however that
header is not actually used. The only header that's needed by this
C file is linux/types.h. Let's include it so that linux/io.h can be
dropped.

Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 arch/mips/include/asm/mach-pic32/pic32.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/include/asm/mach-pic32/pic32.h b/arch/mips/include/asm/mach-pic32/pic32.h
index 53918a671a4c39dba2a22121187cdd73e1935b24..e71c92a7bfde1342be6ea89a4bdf1389aa463b38 100644
--- a/arch/mips/include/asm/mach-pic32/pic32.h
+++ b/arch/mips/include/asm/mach-pic32/pic32.h
@@ -7,6 +7,7 @@
 #define _ASM_MACH_PIC32_H
 
 #include <linux/io.h>
+#include <linux/types.h>
 
 /*
  * PIC32 register offsets for SET/CLR/INV where supported.

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 03/16] MIPS: pic32: drop unused include linux/io.h from pic32.h
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
  2026-01-12 22:47 ` [PATCH v2 01/16] MIPS: pic32: include linux/io.h header on several files Brian Masney
  2026-01-12 22:47 ` [PATCH v2 02/16] MIPS: pic32: include linux/types.h on pic32.h Brian Masney
@ 2026-01-12 22:47 ` Brian Masney
  2026-01-16  7:12   ` claudiu beznea
  2026-01-12 22:47 ` [PATCH v2 04/16] MIPS: copy pic32.h header file from asm/mach-pic32/ to include/platform-data/ Brian Masney
                   ` (15 subsequent siblings)
  18 siblings, 1 reply; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:47 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney

The linux/io.h include is not used, so let's drop it from pic32.h.

Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 arch/mips/include/asm/mach-pic32/pic32.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/mips/include/asm/mach-pic32/pic32.h b/arch/mips/include/asm/mach-pic32/pic32.h
index e71c92a7bfde1342be6ea89a4bdf1389aa463b38..660fa4178b3e4e30977c8c4126df4266150062ce 100644
--- a/arch/mips/include/asm/mach-pic32/pic32.h
+++ b/arch/mips/include/asm/mach-pic32/pic32.h
@@ -6,7 +6,6 @@
 #ifndef _ASM_MACH_PIC32_H
 #define _ASM_MACH_PIC32_H
 
-#include <linux/io.h>
 #include <linux/types.h>
 
 /*

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 04/16] MIPS: copy pic32.h header file from asm/mach-pic32/ to include/platform-data/
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (2 preceding siblings ...)
  2026-01-12 22:47 ` [PATCH v2 03/16] MIPS: pic32: drop unused include linux/io.h from pic32.h Brian Masney
@ 2026-01-12 22:47 ` Brian Masney
  2026-01-12 22:47 ` [PATCH v2 05/16] MAINTAINERS: add include/linux/platform_data/pic32.h to MIPS entry Brian Masney
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:47 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney

There are currently some pic32 MIPS drivers that are in tree, and are
only configured to be compiled on the pic32 platform. There's a risk of
breaking some of these drivers when migrating drivers away from legacy
APIs. It happened to me with a pic32 clk driver.

Let's go ahead and copy the MIPS pic32.h header to
include/linux/platform_data/, and make a minor update to allow compiling
this on other architectures. This will make it easier, and cleaner to
enable COMPILE_TEST for some of these pic32 drivers.

The asm variant of the header file will be dropped once all drivers have
been updated.

Link: https://lore.kernel.org/linux-clk/CABx5tq+eOocJ41X-GSgkGy6S+s+Am1yCS099wqP695NtwALTmg@mail.gmail.com/T/
Signed-off-by: Brian Masney <bmasney@redhat.com>

---
Cc: linux-kernel@vger.kernel.org
---
 include/linux/platform_data/pic32.h | 39 +++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/include/linux/platform_data/pic32.h b/include/linux/platform_data/pic32.h
new file mode 100644
index 0000000000000000000000000000000000000000..f0b395fdb784fa8b7e19029b9ff97f761dbf1088
--- /dev/null
+++ b/include/linux/platform_data/pic32.h
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Joshua Henderson <joshua.henderson@microchip.com>
+ * Copyright (C) 2015 Microchip Technology Inc.  All rights reserved.
+ */
+#ifndef __LINUX_PLATFORM_DATA_PIC32_H
+#define __LINUX_PLATFORM_DATA_PIC32_H
+
+#include <linux/types.h>
+
+/*
+ * PIC32 register offsets for SET/CLR/INV where supported.
+ */
+#define PIC32_CLR(_reg)		((_reg) + 0x04)
+#define PIC32_SET(_reg)		((_reg) + 0x08)
+#define PIC32_INV(_reg)		((_reg) + 0x0C)
+
+/*
+ * PIC32 Base Register Offsets
+ */
+#define PIC32_BASE_CONFIG	0x1f800000
+#define PIC32_BASE_OSC		0x1f801200
+#define PIC32_BASE_RESET	0x1f801240
+#define PIC32_BASE_PPS		0x1f801400
+#define PIC32_BASE_UART		0x1f822000
+#define PIC32_BASE_PORT		0x1f860000
+#define PIC32_BASE_DEVCFG2	0x1fc4ff44
+
+#if defined(CONFIG_MACH_PIC32)
+/* Register unlock sequence required for some register access. */
+void pic32_syskey_unlock_debug(const char *fn, const ulong ln);
+#define pic32_syskey_unlock()	\
+	pic32_syskey_unlock_debug(__func__, __LINE__)
+#else
+/* COMPILE_TEST on all other architectures */
+#define pic32_syskey_unlock()
+#endif
+
+#endif /* __LINUX_PLATFORM_DATA_PIC32_H */

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 05/16] MAINTAINERS: add include/linux/platform_data/pic32.h to MIPS entry
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (3 preceding siblings ...)
  2026-01-12 22:47 ` [PATCH v2 04/16] MIPS: copy pic32.h header file from asm/mach-pic32/ to include/platform-data/ Brian Masney
@ 2026-01-12 22:47 ` Brian Masney
  2026-01-12 22:48 ` [PATCH v2 06/16] MIPS: update include to use pic32.h from platform_data Brian Masney
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:47 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney

Add the file include/linux/platform_data/pic32.h to the MIPS maintainer
entry.

Signed-off-by: Brian Masney <bmasney@redhat.com>

---
Cc: linux-kernel@vger.kernel.org
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index ecae8a5e33cce6f2cb883c1b14b7908e71dbfb5d..bc864e1d263ba8d347e6364477c51f70270467fe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -17545,6 +17545,7 @@ F:	Documentation/arch/mips/
 F:	arch/mips/
 F:	drivers/platform/mips/
 F:	include/dt-bindings/mips/
+F:	include/linux/platform_data/pic32.h
 
 MIPS BOSTON DEVELOPMENT BOARD
 M:	Paul Burton <paulburton@kernel.org>

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 06/16] MIPS: update include to use pic32.h from platform_data
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (4 preceding siblings ...)
  2026-01-12 22:47 ` [PATCH v2 05/16] MAINTAINERS: add include/linux/platform_data/pic32.h to MIPS entry Brian Masney
@ 2026-01-12 22:48 ` Brian Masney
  2026-01-12 22:48 ` [PATCH v2 07/16] clk: microchip: core: " Brian Masney
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:48 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney

Use the linux/platform_data/pic32.h include instead of
asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
is in preparation for allowing some drivers to be compiled on other
architectures with COMPILE_TEST enabled.

Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 arch/mips/pic32/common/reset.c            | 2 +-
 arch/mips/pic32/pic32mzda/config.c        | 3 +--
 arch/mips/pic32/pic32mzda/early_clk.c     | 2 +-
 arch/mips/pic32/pic32mzda/early_console.c | 2 +-
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/mips/pic32/common/reset.c b/arch/mips/pic32/common/reset.c
index 19db57bfffbd314b6e75d2eb9237540c4139dd83..230db4bad1dd14de1bc23e5ac417e890dec7bf31 100644
--- a/arch/mips/pic32/common/reset.c
+++ b/arch/mips/pic32/common/reset.c
@@ -5,9 +5,9 @@
  */
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/platform_data/pic32.h>
 #include <linux/pm.h>
 #include <asm/reboot.h>
-#include <asm/mach-pic32/pic32.h>
 
 #define PIC32_RSWRST		0x10
 
diff --git a/arch/mips/pic32/pic32mzda/config.c b/arch/mips/pic32/pic32mzda/config.c
index 73be5689e0dfb8b18c0a44ee860ca2786201471e..fc21cbc11f7d6b75b15e5c6747a1a5f34c1d5d8e 100644
--- a/arch/mips/pic32/pic32mzda/config.c
+++ b/arch/mips/pic32/pic32mzda/config.c
@@ -5,10 +5,9 @@
  */
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/platform_data/pic32.h>
 #include <linux/spinlock.h>
 
-#include <asm/mach-pic32/pic32.h>
-
 #include "pic32mzda.h"
 
 #define PIC32_CFGCON	0x0000
diff --git a/arch/mips/pic32/pic32mzda/early_clk.c b/arch/mips/pic32/pic32mzda/early_clk.c
index 63727799d49a963d3b0d47d39ec5770c283047dc..21a9f6687f6d7129cc271e7a4aae0bbca6f94630 100644
--- a/arch/mips/pic32/pic32mzda/early_clk.c
+++ b/arch/mips/pic32/pic32mzda/early_clk.c
@@ -4,7 +4,7 @@
  * Copyright (C) 2015 Microchip Technology Inc.  All rights reserved.
  */
 #include <linux/io.h>
-#include <asm/mach-pic32/pic32.h>
+#include <linux/platform_data/pic32.h>
 
 #include "pic32mzda.h"
 
diff --git a/arch/mips/pic32/pic32mzda/early_console.c b/arch/mips/pic32/pic32mzda/early_console.c
index 8afe4e636ace20b1e4269a6172fa5763afebc980..1b7631d12d1f29d580ef9087e20fd92aa99fb497 100644
--- a/arch/mips/pic32/pic32mzda/early_console.c
+++ b/arch/mips/pic32/pic32mzda/early_console.c
@@ -4,7 +4,7 @@
  * Copyright (C) 2015 Microchip Technology Inc.  All rights reserved.
  */
 #include <linux/io.h>
-#include <asm/mach-pic32/pic32.h>
+#include <linux/platform_data/pic32.h>
 #include <asm/fw/fw.h>
 #include <asm/setup.h>
 

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 07/16] clk: microchip: core: update include to use pic32.h from platform_data
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (5 preceding siblings ...)
  2026-01-12 22:48 ` [PATCH v2 06/16] MIPS: update include to use pic32.h from platform_data Brian Masney
@ 2026-01-12 22:48 ` Brian Masney
  2026-01-16  7:15   ` claudiu beznea
  2026-01-12 22:48 ` [PATCH v2 08/16] irqchip/irq-pic32-evic: " Brian Masney
                   ` (11 subsequent siblings)
  18 siblings, 1 reply; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:48 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney, Michael Turquette,
	Stephen Boyd, linux-clk

Use the linux/platform_data/pic32.h include instead of
asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
is in preparation for allowing some drivers to be compiled on other
architectures with COMPILE_TEST enabled.

Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/microchip/clk-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/microchip/clk-core.c b/drivers/clk/microchip/clk-core.c
index b34348d491f3e1b576b2b9a8a66bfddd8c2296ea..891bec5fe1bedea826ff9c3bd4099c90e2528ff9 100644
--- a/drivers/clk/microchip/clk-core.c
+++ b/drivers/clk/microchip/clk-core.c
@@ -9,7 +9,7 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>
-#include <asm/mach-pic32/pic32.h>
+#include <linux/platform_data/pic32.h>
 #include <asm/traps.h>
 
 #include "clk-core.h"

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 08/16] irqchip/irq-pic32-evic: update include to use pic32.h from platform_data
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (6 preceding siblings ...)
  2026-01-12 22:48 ` [PATCH v2 07/16] clk: microchip: core: " Brian Masney
@ 2026-01-12 22:48 ` Brian Masney
  2026-01-13  8:53   ` Thomas Gleixner
  2026-01-12 22:48 ` [PATCH v2 09/16] mmc: sdhci-pic32: " Brian Masney
                   ` (10 subsequent siblings)
  18 siblings, 1 reply; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:48 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney, Thomas Gleixner

Use the linux/platform_data/pic32.h include instead of
asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
is in preparation for allowing some drivers to be compiled on other
architectures with COMPILE_TEST enabled.

Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
---
 drivers/irqchip/irq-pic32-evic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-pic32-evic.c b/drivers/irqchip/irq-pic32-evic.c
index 5dfda8e8df10d282760c947775bcde96011b573f..d87aca73c009fd6fa4ec6a15fdb9ec68a5f99017 100644
--- a/drivers/irqchip/irq-pic32-evic.c
+++ b/drivers/irqchip/irq-pic32-evic.c
@@ -13,10 +13,10 @@
 #include <linux/io.h>
 #include <linux/irqchip.h>
 #include <linux/irq.h>
+#include <linux/platform_data/pic32.h>
 
 #include <asm/irq.h>
 #include <asm/traps.h>
-#include <asm/mach-pic32/pic32.h>
 
 #define REG_INTCON	0x0000
 #define REG_INTSTAT	0x0020

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 09/16] mmc: sdhci-pic32: update include to use pic32.h from platform_data
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (7 preceding siblings ...)
  2026-01-12 22:48 ` [PATCH v2 08/16] irqchip/irq-pic32-evic: " Brian Masney
@ 2026-01-12 22:48 ` Brian Masney
  2026-01-21  6:51   ` Adrian Hunter
  2026-01-22 17:26   ` Ulf Hansson
  2026-01-12 22:48 ` [PATCH v2 10/16] pinctrl: pic32: " Brian Masney
                   ` (9 subsequent siblings)
  18 siblings, 2 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:48 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney, Adrian Hunter,
	Ulf Hansson, linux-mmc

Use the linux/platform_data/pic32.h include instead of
asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
is in preparation for allowing some drivers to be compiled on other
architectures with COMPILE_TEST enabled.

Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/mmc/host/sdhci-pic32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-pic32.c b/drivers/mmc/host/sdhci-pic32.c
index 7ddac0befed87e6e46acfa7593203a5b540558bf..2cc632e91fe454bf29c1da22e45135d5d0267f54 100644
--- a/drivers/mmc/host/sdhci-pic32.c
+++ b/drivers/mmc/host/sdhci-pic32.c
@@ -18,6 +18,7 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/of.h>
+#include <linux/platform_data/sdhci-pic32.h>
 #include <linux/platform_device.h>
 #include <linux/pm.h>
 #include <linux/slab.h>
@@ -25,7 +26,6 @@
 #include <linux/io.h>
 #include "sdhci.h"
 #include "sdhci-pltfm.h"
-#include <linux/platform_data/sdhci-pic32.h>
 
 #define SDH_SHARED_BUS_CTRL		0x000000E0
 #define SDH_SHARED_BUS_NR_CLK_PINS_MASK	0x7

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 10/16] pinctrl: pic32: update include to use pic32.h from platform_data
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (8 preceding siblings ...)
  2026-01-12 22:48 ` [PATCH v2 09/16] mmc: sdhci-pic32: " Brian Masney
@ 2026-01-12 22:48 ` Brian Masney
  2026-01-12 22:48 ` [PATCH v2 11/16] rtc: " Brian Masney
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:48 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney, Linus Walleij, linux-gpio

Use the linux/platform_data/pic32.h include instead of
asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
is in preparation for allowing some drivers to be compiled on other
architectures with COMPILE_TEST enabled.

Acked-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Linus Walleij <linusw@kernel.org>
Cc: linux-gpio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/pinctrl/pinctrl-pic32.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-pic32.c b/drivers/pinctrl/pinctrl-pic32.c
index e8b481e87c779291a69490de1892fbb7ec9c45f1..16bbbcf7206288df5f91870e6233970582f7ef80 100644
--- a/drivers/pinctrl/pinctrl-pic32.c
+++ b/drivers/pinctrl/pinctrl-pic32.c
@@ -15,13 +15,12 @@
 #include <linux/pinctrl/pinconf-generic.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/pinctrl/pinmux.h>
+#include <linux/platform_data/pic32.h>
 #include <linux/platform_device.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 
-#include <asm/mach-pic32/pic32.h>
-
 #include "pinctrl-utils.h"
 #include "pinctrl-pic32.h"
 

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 11/16] rtc: pic32: update include to use pic32.h from platform_data
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (9 preceding siblings ...)
  2026-01-12 22:48 ` [PATCH v2 10/16] pinctrl: pic32: " Brian Masney
@ 2026-01-12 22:48 ` Brian Masney
  2026-01-12 22:48 ` [PATCH v2 12/16] serial: pic32_uart: " Brian Masney
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:48 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney, Alexandre Belloni,
	linux-rtc

Use the linux/platform_data/pic32.h include instead of
asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
is in preparation for allowing some drivers to be compiled on other
architectures with COMPILE_TEST enabled.

Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/rtc/rtc-pic32.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-pic32.c b/drivers/rtc/rtc-pic32.c
index 52c11532bc3a3696359ca56349b42860aa90c966..3c7a38a4ac08eb0f5a44ae4e470c208a9d1dd599 100644
--- a/drivers/rtc/rtc-pic32.c
+++ b/drivers/rtc/rtc-pic32.c
@@ -15,8 +15,7 @@
 #include <linux/clk.h>
 #include <linux/rtc.h>
 #include <linux/bcd.h>
-
-#include <asm/mach-pic32/pic32.h>
+#include <linux/platform_data/pic32.h>
 
 #define PIC32_RTCCON		0x00
 #define PIC32_RTCCON_ON		BIT(15)

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 12/16] serial: pic32_uart: update include to use pic32.h from platform_data
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (10 preceding siblings ...)
  2026-01-12 22:48 ` [PATCH v2 11/16] rtc: " Brian Masney
@ 2026-01-12 22:48 ` Brian Masney
  2026-01-13  6:38   ` Jiri Slaby
  2026-01-12 22:48 ` [PATCH v2 13/16] watchdog: pic32-dmt: " Brian Masney
                   ` (6 subsequent siblings)
  18 siblings, 1 reply; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:48 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney, Greg Kroah-Hartman,
	Jiri Slaby, linux-serial

Use the linux/platform_data/pic32.h include instead of
asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
is in preparation for allowing some drivers to be compiled on other
architectures with COMPILE_TEST enabled.

Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-serial@vger.kernel.org
---
 drivers/tty/serial/pic32_uart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c
index 14d50bd7f1bd3575e60e51783bf5b2d821f9168d..8407f85776c07a7495688fc4f95b8672b1543bd0 100644
--- a/drivers/tty/serial/pic32_uart.c
+++ b/drivers/tty/serial/pic32_uart.c
@@ -22,8 +22,7 @@
 #include <linux/tty_flip.h>
 #include <linux/serial_core.h>
 #include <linux/delay.h>
-
-#include <asm/mach-pic32/pic32.h>
+#include <linux/platform_data/pic32.h>
 
 /* UART name and device definitions */
 #define PIC32_DEV_NAME		"pic32-uart"

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 13/16] watchdog: pic32-dmt: update include to use pic32.h from platform_data
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (11 preceding siblings ...)
  2026-01-12 22:48 ` [PATCH v2 12/16] serial: pic32_uart: " Brian Masney
@ 2026-01-12 22:48 ` Brian Masney
  2026-01-12 22:48 ` [PATCH v2 14/16] watchdog: pic32-wdt: " Brian Masney
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:48 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney, Guenter Roeck,
	Wim Van Sebroeck, linux-watchdog

Use the linux/platform_data/pic32.h include instead of
asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
is in preparation for allowing some drivers to be compiled on other
architectures with COMPILE_TEST enabled.

Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Wim Van Sebroeck <wim@linux-watchdog.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/watchdog/pic32-dmt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/watchdog/pic32-dmt.c b/drivers/watchdog/pic32-dmt.c
index ab0682492c85ad63160bb7da61cc74336698a4e9..12e3a8f63589862e3ed674ffb71ee4798755e56f 100644
--- a/drivers/watchdog/pic32-dmt.c
+++ b/drivers/watchdog/pic32-dmt.c
@@ -12,12 +12,11 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/platform_data/pic32.h>
 #include <linux/platform_device.h>
 #include <linux/pm.h>
 #include <linux/watchdog.h>
 
-#include <asm/mach-pic32/pic32.h>
-
 /* Deadman Timer Regs */
 #define DMTCON_REG	0x00
 #define DMTPRECLR_REG	0x10

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 14/16] watchdog: pic32-wdt: update include to use pic32.h from platform_data
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (12 preceding siblings ...)
  2026-01-12 22:48 ` [PATCH v2 13/16] watchdog: pic32-dmt: " Brian Masney
@ 2026-01-12 22:48 ` Brian Masney
  2026-01-12 22:48 ` [PATCH v2 15/16] MIPS: drop unused pic32.h header Brian Masney
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:48 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney, Guenter Roeck,
	Wim Van Sebroeck, linux-watchdog

Use the linux/platform_data/pic32.h include instead of
asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
is in preparation for allowing some drivers to be compiled on other
architectures with COMPILE_TEST enabled.

Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Wim Van Sebroeck <wim@linux-watchdog.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/watchdog/pic32-wdt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/watchdog/pic32-wdt.c b/drivers/watchdog/pic32-wdt.c
index 1d282de312ef1bd683529088fc88456983e8efb9..2e7186b85194645d40f32e69f198514fca83b601 100644
--- a/drivers/watchdog/pic32-wdt.c
+++ b/drivers/watchdog/pic32-wdt.c
@@ -12,12 +12,11 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/platform_data/pic32.h>
 #include <linux/platform_device.h>
 #include <linux/pm.h>
 #include <linux/watchdog.h>
 
-#include <asm/mach-pic32/pic32.h>
-
 /* Watchdog Timer Registers */
 #define WDTCON_REG		0x00
 

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 15/16] MIPS: drop unused pic32.h header
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (13 preceding siblings ...)
  2026-01-12 22:48 ` [PATCH v2 14/16] watchdog: pic32-wdt: " Brian Masney
@ 2026-01-12 22:48 ` Brian Masney
  2026-01-12 22:48 ` [PATCH v2 16/16] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Brian Masney
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:48 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney

All users of the MIPS pic32.h asm header have been migrated to
linux/platform_data/pic32.h, so let's go ahead and drop the unused asm
variant.

Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 arch/mips/include/asm/mach-pic32/pic32.h | 36 --------------------------------
 1 file changed, 36 deletions(-)

diff --git a/arch/mips/include/asm/mach-pic32/pic32.h b/arch/mips/include/asm/mach-pic32/pic32.h
deleted file mode 100644
index 660fa4178b3e4e30977c8c4126df4266150062ce..0000000000000000000000000000000000000000
--- a/arch/mips/include/asm/mach-pic32/pic32.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Joshua Henderson <joshua.henderson@microchip.com>
- * Copyright (C) 2015 Microchip Technology Inc.  All rights reserved.
- */
-#ifndef _ASM_MACH_PIC32_H
-#define _ASM_MACH_PIC32_H
-
-#include <linux/types.h>
-
-/*
- * PIC32 register offsets for SET/CLR/INV where supported.
- */
-#define PIC32_CLR(_reg)		((_reg) + 0x04)
-#define PIC32_SET(_reg)		((_reg) + 0x08)
-#define PIC32_INV(_reg)		((_reg) + 0x0C)
-
-/*
- * PIC32 Base Register Offsets
- */
-#define PIC32_BASE_CONFIG	0x1f800000
-#define PIC32_BASE_OSC		0x1f801200
-#define PIC32_BASE_RESET	0x1f801240
-#define PIC32_BASE_PPS		0x1f801400
-#define PIC32_BASE_UART		0x1f822000
-#define PIC32_BASE_PORT		0x1f860000
-#define PIC32_BASE_DEVCFG2	0x1fc4ff44
-
-/*
- * Register unlock sequence required for some register access.
- */
-void pic32_syskey_unlock_debug(const char *fn, const ulong ln);
-#define pic32_syskey_unlock()	\
-	pic32_syskey_unlock_debug(__func__, __LINE__)
-
-#endif /* _ASM_MACH_PIC32_H */

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 16/16] clk: microchip: core: allow driver to be compiled with COMPILE_TEST
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (14 preceding siblings ...)
  2026-01-12 22:48 ` [PATCH v2 15/16] MIPS: drop unused pic32.h header Brian Masney
@ 2026-01-12 22:48 ` Brian Masney
  2026-01-13  5:48   ` Stephen Boyd
  2026-01-23  0:49 ` [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (2 subsequent siblings)
  18 siblings, 1 reply; 31+ messages in thread
From: Brian Masney @ 2026-01-12 22:48 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney, Michael Turquette,
	Stephen Boyd, linux-clk

This driver currently only supports builds against a PIC32 target. To
avoid future breakage in the future, let's update the Kconfig and the
driver so that it can be built with CONFIG_COMPILE_TEST enabled.

Note that with the existing asm calls is not how I'd want to do this
today if this was a new driver, however I don't have access to this
hardware. To avoid any breakage, let's keep the existing behavior.

Signed-off-by: Brian Masney <bmasney@redhat.com>

---
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/microchip/Kconfig    | 2 +-
 drivers/clk/microchip/clk-core.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/microchip/Kconfig b/drivers/clk/microchip/Kconfig
index 1b9e43eb54976b219a0277cc971f353fd6af226a..1e56a057319d97e20440fe4e107d26fa85c95ab1 100644
--- a/drivers/clk/microchip/Kconfig
+++ b/drivers/clk/microchip/Kconfig
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 config COMMON_CLK_PIC32
-	def_bool COMMON_CLK && MACH_PIC32
+	def_bool (COMMON_CLK && MACH_PIC32) || COMPILE_TEST
 
 config MCHP_CLK_MPFS
 	bool "Clk driver for PolarFire SoC"
diff --git a/drivers/clk/microchip/clk-core.c b/drivers/clk/microchip/clk-core.c
index 891bec5fe1bedea826ff9c3bd4099c90e2528ff9..ce3a24e061d145934c84843008efadc3b0e2cffa 100644
--- a/drivers/clk/microchip/clk-core.c
+++ b/drivers/clk/microchip/clk-core.c
@@ -75,6 +75,7 @@
 /* SoC specific clock needed during SPLL clock rate switch */
 static struct clk_hw *pic32_sclk_hw;
 
+#ifdef CONFIG_MATCH_PIC32
 /* add instruction pipeline delay while CPU clock is in-transition. */
 #define cpu_nop5()			\
 do {					\
@@ -84,6 +85,9 @@ do {					\
 	__asm__ __volatile__("nop");	\
 	__asm__ __volatile__("nop");	\
 } while (0)
+#else
+#define cpu_nop5()
+#endif
 
 /* Perpheral bus clocks */
 struct pic32_periph_clk {

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 16/16] clk: microchip: core: allow driver to be compiled with COMPILE_TEST
  2026-01-12 22:48 ` [PATCH v2 16/16] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Brian Masney
@ 2026-01-13  5:48   ` Stephen Boyd
  2026-01-13 11:35     ` Brian Masney
  0 siblings, 1 reply; 31+ messages in thread
From: Stephen Boyd @ 2026-01-13  5:48 UTC (permalink / raw)
  To: Brian Masney, Claudiu Beznea, Thomas Bogendoerfer
  Cc: linux-mips, linux-kernel, Brian Masney, Michael Turquette,
	linux-clk

Quoting Brian Masney (2026-01-12 15:48:10)
> diff --git a/drivers/clk/microchip/Kconfig b/drivers/clk/microchip/Kconfig
> index 1b9e43eb54976b219a0277cc971f353fd6af226a..1e56a057319d97e20440fe4e107d26fa85c95ab1 100644
> --- a/drivers/clk/microchip/Kconfig
> +++ b/drivers/clk/microchip/Kconfig
> @@ -1,7 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0
>  
>  config COMMON_CLK_PIC32
> -       def_bool COMMON_CLK && MACH_PIC32
> +       def_bool (COMMON_CLK && MACH_PIC32) || COMPILE_TEST
>  
>  config MCHP_CLK_MPFS
>         bool "Clk driver for PolarFire SoC"
> diff --git a/drivers/clk/microchip/clk-core.c b/drivers/clk/microchip/clk-core.c
> index 891bec5fe1bedea826ff9c3bd4099c90e2528ff9..ce3a24e061d145934c84843008efadc3b0e2cffa 100644
> --- a/drivers/clk/microchip/clk-core.c
> +++ b/drivers/clk/microchip/clk-core.c
> @@ -75,6 +75,7 @@
>  /* SoC specific clock needed during SPLL clock rate switch */
>  static struct clk_hw *pic32_sclk_hw;
>  
> +#ifdef CONFIG_MATCH_PIC32

CONFIG_MACH_PIC32?

>  /* add instruction pipeline delay while CPU clock is in-transition. */
>  #define cpu_nop5()                     \
>  do {                                   \

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 12/16] serial: pic32_uart: update include to use pic32.h from platform_data
  2026-01-12 22:48 ` [PATCH v2 12/16] serial: pic32_uart: " Brian Masney
@ 2026-01-13  6:38   ` Jiri Slaby
  2026-01-13 11:30     ` Brian Masney
  0 siblings, 1 reply; 31+ messages in thread
From: Jiri Slaby @ 2026-01-13  6:38 UTC (permalink / raw)
  To: Brian Masney, Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Greg Kroah-Hartman, linux-serial

On 12. 01. 26, 23:48, Brian Masney wrote:
> Use the linux/platform_data/pic32.h include instead of
> asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
> is in preparation for allowing some drivers to be compiled on other
> architectures with COMPILE_TEST enabled.

LGTM. Will you also enable the driver to be compiled?

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

> Signed-off-by: Brian Masney <bmasney@redhat.com>
> 
> ---
> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> To: Jiri Slaby <jirislaby@kernel.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-serial@vger.kernel.org
> ---
>   drivers/tty/serial/pic32_uart.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c
> index 14d50bd7f1bd3575e60e51783bf5b2d821f9168d..8407f85776c07a7495688fc4f95b8672b1543bd0 100644
> --- a/drivers/tty/serial/pic32_uart.c
> +++ b/drivers/tty/serial/pic32_uart.c
> @@ -22,8 +22,7 @@
>   #include <linux/tty_flip.h>
>   #include <linux/serial_core.h>
>   #include <linux/delay.h>
> -
> -#include <asm/mach-pic32/pic32.h>
> +#include <linux/platform_data/pic32.h>
>   
>   /* UART name and device definitions */
>   #define PIC32_DEV_NAME		"pic32-uart"
> 


-- 
js
suse labs

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 08/16] irqchip/irq-pic32-evic: update include to use pic32.h from platform_data
  2026-01-12 22:48 ` [PATCH v2 08/16] irqchip/irq-pic32-evic: " Brian Masney
@ 2026-01-13  8:53   ` Thomas Gleixner
  0 siblings, 0 replies; 31+ messages in thread
From: Thomas Gleixner @ 2026-01-13  8:53 UTC (permalink / raw)
  To: Brian Masney, Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney

On Mon, Jan 12 2026 at 17:48, Brian Masney wrote:

> Use the linux/platform_data/pic32.h include instead of
> asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
> is in preparation for allowing some drivers to be compiled on other
> architectures with COMPILE_TEST enabled.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Acked-by: Thomas Gleixner <tglx@kernel.org>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 12/16] serial: pic32_uart: update include to use pic32.h from platform_data
  2026-01-13  6:38   ` Jiri Slaby
@ 2026-01-13 11:30     ` Brian Masney
  0 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-13 11:30 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Thomas Bogendoerfer, Claudiu Beznea, linux-mips, linux-kernel,
	Greg Kroah-Hartman, linux-serial

On Tue, Jan 13, 2026 at 07:38:27AM +0100, Jiri Slaby wrote:
> On 12. 01. 26, 23:48, Brian Masney wrote:
> > Use the linux/platform_data/pic32.h include instead of
> > asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
> > is in preparation for allowing some drivers to be compiled on other
> > architectures with COMPILE_TEST enabled.
> 
> LGTM. Will you also enable the driver to be compiled?

Yes, probably in a month. I'm going to wait for this series to land in
Linus's tree first though.

Brian


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 16/16] clk: microchip: core: allow driver to be compiled with COMPILE_TEST
  2026-01-13  5:48   ` Stephen Boyd
@ 2026-01-13 11:35     ` Brian Masney
  0 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-13 11:35 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Claudiu Beznea, Thomas Bogendoerfer, linux-mips, linux-kernel,
	Michael Turquette, linux-clk

On Mon, Jan 12, 2026 at 10:48:07PM -0700, Stephen Boyd wrote:
> Quoting Brian Masney (2026-01-12 15:48:10)
> > diff --git a/drivers/clk/microchip/Kconfig b/drivers/clk/microchip/Kconfig
> > index 1b9e43eb54976b219a0277cc971f353fd6af226a..1e56a057319d97e20440fe4e107d26fa85c95ab1 100644
> > --- a/drivers/clk/microchip/Kconfig
> > +++ b/drivers/clk/microchip/Kconfig
> > @@ -1,7 +1,7 @@
> >  # SPDX-License-Identifier: GPL-2.0
> >  
> >  config COMMON_CLK_PIC32
> > -       def_bool COMMON_CLK && MACH_PIC32
> > +       def_bool (COMMON_CLK && MACH_PIC32) || COMPILE_TEST
> >  
> >  config MCHP_CLK_MPFS
> >         bool "Clk driver for PolarFire SoC"
> > diff --git a/drivers/clk/microchip/clk-core.c b/drivers/clk/microchip/clk-core.c
> > index 891bec5fe1bedea826ff9c3bd4099c90e2528ff9..ce3a24e061d145934c84843008efadc3b0e2cffa 100644
> > --- a/drivers/clk/microchip/clk-core.c
> > +++ b/drivers/clk/microchip/clk-core.c
> > @@ -75,6 +75,7 @@
> >  /* SoC specific clock needed during SPLL clock rate switch */
> >  static struct clk_hw *pic32_sclk_hw;
> >  
> > +#ifdef CONFIG_MATCH_PIC32
> 
> CONFIG_MACH_PIC32?

Ugh... :/ This compiles on arm64 since nop is a valid assembly
instruction.

I'm going to hold off on posting a v3 for now unless there's an issue
with one of the earlier patches. This patch can't go in until all of
the other patches in this series land in Linus's tree.

Brian


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 03/16] MIPS: pic32: drop unused include linux/io.h from pic32.h
  2026-01-12 22:47 ` [PATCH v2 03/16] MIPS: pic32: drop unused include linux/io.h from pic32.h Brian Masney
@ 2026-01-16  7:12   ` claudiu beznea
  2026-01-16 15:14     ` Brian Masney
  0 siblings, 1 reply; 31+ messages in thread
From: claudiu beznea @ 2026-01-16  7:12 UTC (permalink / raw)
  To: Brian Masney, Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel

Hi, Brian,

On 1/13/26 00:47, Brian Masney wrote:
> The linux/io.h include is not used, so let's drop it from pic32.h.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> 
> ---
> To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: linux-mips@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
>   arch/mips/include/asm/mach-pic32/pic32.h | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/arch/mips/include/asm/mach-pic32/pic32.h b/arch/mips/include/asm/mach-pic32/pic32.h
> index e71c92a7bfde1342be6ea89a4bdf1389aa463b38..660fa4178b3e4e30977c8c4126df4266150062ce 100644
> --- a/arch/mips/include/asm/mach-pic32/pic32.h
> +++ b/arch/mips/include/asm/mach-pic32/pic32.h
> @@ -6,7 +6,6 @@
>   #ifndef _ASM_MACH_PIC32_H
>   #define _ASM_MACH_PIC32_H
>   
> -#include <linux/io.h>

Can't this be squashed this with patch 02/16 ?

>   #include <linux/types.h>
>   
>   /*
> 


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 07/16] clk: microchip: core: update include to use pic32.h from platform_data
  2026-01-12 22:48 ` [PATCH v2 07/16] clk: microchip: core: " Brian Masney
@ 2026-01-16  7:15   ` claudiu beznea
  0 siblings, 0 replies; 31+ messages in thread
From: claudiu beznea @ 2026-01-16  7:15 UTC (permalink / raw)
  To: Brian Masney, Thomas Bogendoerfer
  Cc: linux-mips, linux-kernel, Michael Turquette, Stephen Boyd,
	linux-clk



On 1/13/26 00:48, Brian Masney wrote:
> Use the linux/platform_data/pic32.h include instead of
> asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
> is in preparation for allowing some drivers to be compiled on other
> architectures with COMPILE_TEST enabled.
> 
> Signed-off-by: Brian Masney<bmasney@redhat.com>

Acked-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 03/16] MIPS: pic32: drop unused include linux/io.h from pic32.h
  2026-01-16  7:12   ` claudiu beznea
@ 2026-01-16 15:14     ` Brian Masney
  0 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-16 15:14 UTC (permalink / raw)
  To: claudiu beznea; +Cc: Thomas Bogendoerfer, linux-mips, linux-kernel

On Fri, Jan 16, 2026 at 09:12:45AM +0200, claudiu beznea wrote:
> On 1/13/26 00:47, Brian Masney wrote:
> > The linux/io.h include is not used, so let's drop it from pic32.h.
> > 
> > Signed-off-by: Brian Masney <bmasney@redhat.com>
> > 
> > ---
> > To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > Cc: linux-mips@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > ---
> >   arch/mips/include/asm/mach-pic32/pic32.h | 1 -
> >   1 file changed, 1 deletion(-)
> > 
> > diff --git a/arch/mips/include/asm/mach-pic32/pic32.h b/arch/mips/include/asm/mach-pic32/pic32.h
> > index e71c92a7bfde1342be6ea89a4bdf1389aa463b38..660fa4178b3e4e30977c8c4126df4266150062ce 100644
> > --- a/arch/mips/include/asm/mach-pic32/pic32.h
> > +++ b/arch/mips/include/asm/mach-pic32/pic32.h
> > @@ -6,7 +6,6 @@
> >   #ifndef _ASM_MACH_PIC32_H
> >   #define _ASM_MACH_PIC32_H
> > -#include <linux/io.h>
> 
> Can't this be squashed this with patch 02/16 ?

I made it a separate patch because generally if the commit message
listing all of the changes has 'and' then that's maybe a hint that
it should be split out into it's own commit.

That said, if people really want, I can push out a new series with
it squashed.

Brian


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 09/16] mmc: sdhci-pic32: update include to use pic32.h from platform_data
  2026-01-12 22:48 ` [PATCH v2 09/16] mmc: sdhci-pic32: " Brian Masney
@ 2026-01-21  6:51   ` Adrian Hunter
  2026-01-22 17:26   ` Ulf Hansson
  1 sibling, 0 replies; 31+ messages in thread
From: Adrian Hunter @ 2026-01-21  6:51 UTC (permalink / raw)
  To: Brian Masney, Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Ulf Hansson, linux-mmc

On 13/01/2026 00:48, Brian Masney wrote:
> Use the linux/platform_data/pic32.h include instead of
> asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
> is in preparation for allowing some drivers to be compiled on other
> architectures with COMPILE_TEST enabled.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> 
> ---
> To: Adrian Hunter <adrian.hunter@intel.com>
> To: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: linux-mmc@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  drivers/mmc/host/sdhci-pic32.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pic32.c b/drivers/mmc/host/sdhci-pic32.c
> index 7ddac0befed87e6e46acfa7593203a5b540558bf..2cc632e91fe454bf29c1da22e45135d5d0267f54 100644
> --- a/drivers/mmc/host/sdhci-pic32.c
> +++ b/drivers/mmc/host/sdhci-pic32.c
> @@ -18,6 +18,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/irq.h>
>  #include <linux/of.h>
> +#include <linux/platform_data/sdhci-pic32.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm.h>
>  #include <linux/slab.h>
> @@ -25,7 +26,6 @@
>  #include <linux/io.h>
>  #include "sdhci.h"
>  #include "sdhci-pltfm.h"
> -#include <linux/platform_data/sdhci-pic32.h>
>  
>  #define SDH_SHARED_BUS_CTRL		0x000000E0
>  #define SDH_SHARED_BUS_NR_CLK_PINS_MASK	0x7
> 


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 09/16] mmc: sdhci-pic32: update include to use pic32.h from platform_data
  2026-01-12 22:48 ` [PATCH v2 09/16] mmc: sdhci-pic32: " Brian Masney
  2026-01-21  6:51   ` Adrian Hunter
@ 2026-01-22 17:26   ` Ulf Hansson
  1 sibling, 0 replies; 31+ messages in thread
From: Ulf Hansson @ 2026-01-22 17:26 UTC (permalink / raw)
  To: Brian Masney
  Cc: Thomas Bogendoerfer, Claudiu Beznea, linux-mips, linux-kernel,
	Adrian Hunter, linux-mmc

On Mon, 12 Jan 2026 at 23:49, Brian Masney <bmasney@redhat.com> wrote:
>
> Use the linux/platform_data/pic32.h include instead of
> asm/mach-pic32/pic32.h so that the asm variant can be dropped. This
> is in preparation for allowing some drivers to be compiled on other
> architectures with COMPILE_TEST enabled.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

I noticed Adrian has acked this already, but if not too late, feel
free to add my ack too.

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

>
> ---
> To: Adrian Hunter <adrian.hunter@intel.com>
> To: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: linux-mmc@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  drivers/mmc/host/sdhci-pic32.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci-pic32.c b/drivers/mmc/host/sdhci-pic32.c
> index 7ddac0befed87e6e46acfa7593203a5b540558bf..2cc632e91fe454bf29c1da22e45135d5d0267f54 100644
> --- a/drivers/mmc/host/sdhci-pic32.c
> +++ b/drivers/mmc/host/sdhci-pic32.c
> @@ -18,6 +18,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/irq.h>
>  #include <linux/of.h>
> +#include <linux/platform_data/sdhci-pic32.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm.h>
>  #include <linux/slab.h>
> @@ -25,7 +26,6 @@
>  #include <linux/io.h>
>  #include "sdhci.h"
>  #include "sdhci-pltfm.h"
> -#include <linux/platform_data/sdhci-pic32.h>
>
>  #define SDH_SHARED_BUS_CTRL            0x000000E0
>  #define SDH_SHARED_BUS_NR_CLK_PINS_MASK        0x7
>
> --
> 2.52.0
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (15 preceding siblings ...)
  2026-01-12 22:48 ` [PATCH v2 16/16] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Brian Masney
@ 2026-01-23  0:49 ` Brian Masney
  2026-01-30 14:37 ` Thomas Bogendoerfer
  2026-02-10 12:42 ` Brian Masney
  18 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2026-01-23  0:49 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Michael Turquette, Stephen Boyd,
	linux-clk, Thomas Gleixner, Adrian Hunter, Ulf Hansson, linux-mmc,
	Linus Walleij, linux-gpio, Alexandre Belloni, linux-rtc,
	Greg Kroah-Hartman, Jiri Slaby, linux-serial, Guenter Roeck,
	Wim Van Sebroeck, linux-watchdog

Hi Thomas,

On Mon, Jan 12, 2026 at 05:47:54PM -0500, Brian Masney wrote:
> There are currently some pic32 MIPS drivers that are in tree, and are
> only configured to be compiled on the MIPS pic32 platform. There's a
> risk of breaking some of these drivers when migrating drivers away from
> legacy APIs. It happened to me with a pic32 clk driver.
> 
> Let's go ahead and move the pic32.h from the asm to the platform_data
> include directory in the tree. This will make it easier, and cleaner to
> enable COMPILE_TEST for some of these pic32 drivers. To do this requires
> updating some includes, which I do at the beginning of this series.
> 
> This series was compile tested on a centos-stream-10 arm64 host in two
> different configurations:
> 
> - native arm64 build with COMPILE_TEST (via make allmodconfig)
> - MIPS cross compile on arm64 with:
>       ARCH=mips CROSS_COMPILE=mips64-linux-gnu- make pic32mzda_defconfig
> 
> Note that there is a separate MIPS compile error in linux-next, and I
> reported it at https://lore.kernel.org/all/aWVs2gVB418WiMVa@redhat.com/
> 
> I included a patch at the end that shows enabling COMPILE_TEST for a
> pic32 clk driver.
> 
> Merge Strategy
> ==============
> - Patches 1-15 can go through the MIPS tree.

I'm just checking if you'll be able to take patches 1-15 this
development cycle before the merge window opens?

If this series goes to Linus during this upcoming merge window, then
I have 17 patches ready to post in a month for the next development
cycle that can go to various individual subsystems that allows all
of these pic32 MIPS drivers to be compiled on all architectures. The
patches also fix some issues in those drivers that were found by
kernel CI.

This merge strategy makes it so that we won't have to deal with any
cross tree merge issues, or immutable branches.

Thanks,

Brian


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (16 preceding siblings ...)
  2026-01-23  0:49 ` [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
@ 2026-01-30 14:37 ` Thomas Bogendoerfer
  2026-02-10 12:42 ` Brian Masney
  18 siblings, 0 replies; 31+ messages in thread
From: Thomas Bogendoerfer @ 2026-01-30 14:37 UTC (permalink / raw)
  To: Brian Masney
  Cc: Claudiu Beznea, linux-mips, linux-kernel, Michael Turquette,
	Stephen Boyd, linux-clk, Thomas Gleixner, Adrian Hunter,
	Ulf Hansson, linux-mmc, Linus Walleij, linux-gpio,
	Alexandre Belloni, linux-rtc, Greg Kroah-Hartman, Jiri Slaby,
	linux-serial, Guenter Roeck, Wim Van Sebroeck, linux-watchdog

On Mon, Jan 12, 2026 at 05:47:54PM -0500, Brian Masney wrote:
> There are currently some pic32 MIPS drivers that are in tree, and are
> only configured to be compiled on the MIPS pic32 platform. There's a
> risk of breaking some of these drivers when migrating drivers away from
> legacy APIs. It happened to me with a pic32 clk driver.
> 
> Let's go ahead and move the pic32.h from the asm to the platform_data
> include directory in the tree. This will make it easier, and cleaner to
> enable COMPILE_TEST for some of these pic32 drivers. To do this requires
> updating some includes, which I do at the beginning of this series.
> 
> This series was compile tested on a centos-stream-10 arm64 host in two
> different configurations:
> 
> - native arm64 build with COMPILE_TEST (via make allmodconfig)
> - MIPS cross compile on arm64 with:
>       ARCH=mips CROSS_COMPILE=mips64-linux-gnu- make pic32mzda_defconfig
> 
> Note that there is a separate MIPS compile error in linux-next, and I
> reported it at https://lore.kernel.org/all/aWVs2gVB418WiMVa@redhat.com/
> 
> I included a patch at the end that shows enabling COMPILE_TEST for a
> pic32 clk driver.
> 
> Merge Strategy
> ==============
> - Patches 1-15 can go through the MIPS tree.
> - Patch 16 I can repost to Claudiu after patches 1-15 are in Linus's
>   tree after the next merge window. There is a separate patch set that
>   fixes a compiler error I unintentionally introduced via the clk tree.
>   https://lore.kernel.org/linux-clk/CABx5tq+eOocJ41X-GSgkGy6S+s+Am1yCS099wqP695NtwALTmg@mail.gmail.com/T/
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
> Changes in v2:
> - Fix native MIPS build by updating include files
> - Link to v1: https://lore.kernel.org/r/20260109-mips-pic32-header-move-v1-0-99859c55783d@redhat.com
> 
> ---
> Brian Masney (16):
>       MIPS: pic32: include linux/io.h header on several files
>       MIPS: pic32: include linux/types.h on pic32.h
>       MIPS: pic32: drop unused include linux/io.h from pic32.h
>       MIPS: copy pic32.h header file from asm/mach-pic32/ to include/platform-data/
>       MAINTAINERS: add include/linux/platform_data/pic32.h to MIPS entry
>       MIPS: update include to use pic32.h from platform_data
>       clk: microchip: core: update include to use pic32.h from platform_data
>       irqchip/irq-pic32-evic: update include to use pic32.h from platform_data
>       mmc: sdhci-pic32: update include to use pic32.h from platform_data
>       pinctrl: pic32: update include to use pic32.h from platform_data
>       rtc: pic32: update include to use pic32.h from platform_data
>       serial: pic32_uart: update include to use pic32.h from platform_data
>       watchdog: pic32-dmt: update include to use pic32.h from platform_data
>       watchdog: pic32-wdt: update include to use pic32.h from platform_data
>       MIPS: drop unused pic32.h header
>       clk: microchip: core: allow driver to be compiled with COMPILE_TEST
> 
>  MAINTAINERS                                             |  1 +
>  arch/mips/pic32/common/reset.c                          |  3 ++-
>  arch/mips/pic32/pic32mzda/config.c                      |  3 +--
>  arch/mips/pic32/pic32mzda/early_clk.c                   |  3 ++-
>  arch/mips/pic32/pic32mzda/early_console.c               |  3 ++-
>  drivers/clk/microchip/Kconfig                           |  2 +-
>  drivers/clk/microchip/clk-core.c                        |  6 +++++-
>  drivers/irqchip/irq-pic32-evic.c                        |  2 +-
>  drivers/mmc/host/sdhci-pic32.c                          |  2 +-
>  drivers/pinctrl/pinctrl-pic32.c                         |  3 +--
>  drivers/rtc/rtc-pic32.c                                 |  3 +--
>  drivers/tty/serial/pic32_uart.c                         |  3 +--
>  drivers/watchdog/pic32-dmt.c                            |  3 +--
>  drivers/watchdog/pic32-wdt.c                            |  3 +--
>  .../mach-pic32 => include/linux/platform_data}/pic32.h  | 17 ++++++++++-------
>  15 files changed, 31 insertions(+), 26 deletions(-)
> ---
> base-commit: f417b7ffcbef7d76b0d8860518f50dae0e7e5eda
> change-id: 20260109-mips-pic32-header-move-6ac9965aa70a

series applied to mips-next
Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data
  2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (17 preceding siblings ...)
  2026-01-30 14:37 ` Thomas Bogendoerfer
@ 2026-02-10 12:42 ` Brian Masney
  2026-02-10 15:50   ` Thomas Bogendoerfer
  18 siblings, 1 reply; 31+ messages in thread
From: Brian Masney @ 2026-02-10 12:42 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Michael Turquette, Stephen Boyd,
	linux-clk, Thomas Gleixner, Adrian Hunter, Ulf Hansson, linux-mmc,
	Linus Walleij, linux-gpio, Alexandre Belloni, linux-rtc,
	Greg Kroah-Hartman, Jiri Slaby, linux-serial, Guenter Roeck,
	Wim Van Sebroeck, linux-watchdog, Lukas Bulwahn

Hi Thomas,

On Mon, Jan 12, 2026 at 05:47:54PM -0500, Brian Masney wrote:
> There are currently some pic32 MIPS drivers that are in tree, and are
> only configured to be compiled on the MIPS pic32 platform. There's a
> risk of breaking some of these drivers when migrating drivers away from
> legacy APIs. It happened to me with a pic32 clk driver.
> 
> Let's go ahead and move the pic32.h from the asm to the platform_data
> include directory in the tree. This will make it easier, and cleaner to
> enable COMPILE_TEST for some of these pic32 drivers. To do this requires
> updating some includes, which I do at the beginning of this series.
> 
> This series was compile tested on a centos-stream-10 arm64 host in two
> different configurations:
> 
> - native arm64 build with COMPILE_TEST (via make allmodconfig)
> - MIPS cross compile on arm64 with:
>       ARCH=mips CROSS_COMPILE=mips64-linux-gnu- make pic32mzda_defconfig
> 
> Note that there is a separate MIPS compile error in linux-next, and I
> reported it at https://lore.kernel.org/all/aWVs2gVB418WiMVa@redhat.com/
> 
> I included a patch at the end that shows enabling COMPILE_TEST for a
> pic32 clk driver.
> 
> Merge Strategy
> ==============
> - Patches 1-15 can go through the MIPS tree.
> - Patch 16 I can repost to Claudiu after patches 1-15 are in Linus's
>   tree after the next merge window. There is a separate patch set that
>   fixes a compiler error I unintentionally introduced via the clk tree.
>   https://lore.kernel.org/linux-clk/CABx5tq+eOocJ41X-GSgkGy6S+s+Am1yCS099wqP695NtwALTmg@mail.gmail.com/T/

Sorry about the duplicate message. I just wanted to reply to the series
with MIPS in the header so this message isn't lost.

Can you back out these two patches from your tree in linux-next, and not
send these to Linus?

clk: microchip: core: allow driver to be compiled with COMPILE_TEST
https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git/commit/?id=026d70dcfe5de1543bb8edb8e50d22dc16863e6b

clk: microchip: fix typo in reference to a config option
https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git/commit/?id=a6ab150deb4b740334721d18e02ad400a9d888f5

See
https://lore.kernel.org/oe-kbuild-all/202602100954.BAVYq6aC-lkp@intel.com/

All of the other patches with the include changes are good. I have
patches queued to send out in two weeks to other subsystems once the
include changes land in Linus's tree.

Thanks,

Brian


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data
  2026-02-10 12:42 ` Brian Masney
@ 2026-02-10 15:50   ` Thomas Bogendoerfer
  0 siblings, 0 replies; 31+ messages in thread
From: Thomas Bogendoerfer @ 2026-02-10 15:50 UTC (permalink / raw)
  To: Brian Masney
  Cc: Claudiu Beznea, linux-mips, linux-kernel, Michael Turquette,
	Stephen Boyd, linux-clk, Thomas Gleixner, Adrian Hunter,
	Ulf Hansson, linux-mmc, Linus Walleij, linux-gpio,
	Alexandre Belloni, linux-rtc, Greg Kroah-Hartman, Jiri Slaby,
	linux-serial, Guenter Roeck, Wim Van Sebroeck, linux-watchdog,
	Lukas Bulwahn

On Tue, Feb 10, 2026 at 07:42:25AM -0500, Brian Masney wrote:
> Hi Thomas,
> 
> On Mon, Jan 12, 2026 at 05:47:54PM -0500, Brian Masney wrote:
> > There are currently some pic32 MIPS drivers that are in tree, and are
> > only configured to be compiled on the MIPS pic32 platform. There's a
> > risk of breaking some of these drivers when migrating drivers away from
> > legacy APIs. It happened to me with a pic32 clk driver.
> > 
> > Let's go ahead and move the pic32.h from the asm to the platform_data
> > include directory in the tree. This will make it easier, and cleaner to
> > enable COMPILE_TEST for some of these pic32 drivers. To do this requires
> > updating some includes, which I do at the beginning of this series.
> > 
> > This series was compile tested on a centos-stream-10 arm64 host in two
> > different configurations:
> > 
> > - native arm64 build with COMPILE_TEST (via make allmodconfig)
> > - MIPS cross compile on arm64 with:
> >       ARCH=mips CROSS_COMPILE=mips64-linux-gnu- make pic32mzda_defconfig
> > 
> > Note that there is a separate MIPS compile error in linux-next, and I
> > reported it at https://lore.kernel.org/all/aWVs2gVB418WiMVa@redhat.com/
> > 
> > I included a patch at the end that shows enabling COMPILE_TEST for a
> > pic32 clk driver.
> > 
> > Merge Strategy
> > ==============
> > - Patches 1-15 can go through the MIPS tree.
> > - Patch 16 I can repost to Claudiu after patches 1-15 are in Linus's
> >   tree after the next merge window. There is a separate patch set that
> >   fixes a compiler error I unintentionally introduced via the clk tree.
> >   https://lore.kernel.org/linux-clk/CABx5tq+eOocJ41X-GSgkGy6S+s+Am1yCS099wqP695NtwALTmg@mail.gmail.com/T/
> 
> Sorry about the duplicate message. I just wanted to reply to the series
> with MIPS in the header so this message isn't lost.
> 
> Can you back out these two patches from your tree in linux-next, and not
> send these to Linus?
> 
> clk: microchip: core: allow driver to be compiled with COMPILE_TEST
> https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git/commit/?id=026d70dcfe5de1543bb8edb8e50d22dc16863e6b
> 
> clk: microchip: fix typo in reference to a config option
> https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git/commit/?id=a6ab150deb4b740334721d18e02ad400a9d888f5

I've reverted both patches in mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2026-02-10 15:50 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-12 22:47 [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
2026-01-12 22:47 ` [PATCH v2 01/16] MIPS: pic32: include linux/io.h header on several files Brian Masney
2026-01-12 22:47 ` [PATCH v2 02/16] MIPS: pic32: include linux/types.h on pic32.h Brian Masney
2026-01-12 22:47 ` [PATCH v2 03/16] MIPS: pic32: drop unused include linux/io.h from pic32.h Brian Masney
2026-01-16  7:12   ` claudiu beznea
2026-01-16 15:14     ` Brian Masney
2026-01-12 22:47 ` [PATCH v2 04/16] MIPS: copy pic32.h header file from asm/mach-pic32/ to include/platform-data/ Brian Masney
2026-01-12 22:47 ` [PATCH v2 05/16] MAINTAINERS: add include/linux/platform_data/pic32.h to MIPS entry Brian Masney
2026-01-12 22:48 ` [PATCH v2 06/16] MIPS: update include to use pic32.h from platform_data Brian Masney
2026-01-12 22:48 ` [PATCH v2 07/16] clk: microchip: core: " Brian Masney
2026-01-16  7:15   ` claudiu beznea
2026-01-12 22:48 ` [PATCH v2 08/16] irqchip/irq-pic32-evic: " Brian Masney
2026-01-13  8:53   ` Thomas Gleixner
2026-01-12 22:48 ` [PATCH v2 09/16] mmc: sdhci-pic32: " Brian Masney
2026-01-21  6:51   ` Adrian Hunter
2026-01-22 17:26   ` Ulf Hansson
2026-01-12 22:48 ` [PATCH v2 10/16] pinctrl: pic32: " Brian Masney
2026-01-12 22:48 ` [PATCH v2 11/16] rtc: " Brian Masney
2026-01-12 22:48 ` [PATCH v2 12/16] serial: pic32_uart: " Brian Masney
2026-01-13  6:38   ` Jiri Slaby
2026-01-13 11:30     ` Brian Masney
2026-01-12 22:48 ` [PATCH v2 13/16] watchdog: pic32-dmt: " Brian Masney
2026-01-12 22:48 ` [PATCH v2 14/16] watchdog: pic32-wdt: " Brian Masney
2026-01-12 22:48 ` [PATCH v2 15/16] MIPS: drop unused pic32.h header Brian Masney
2026-01-12 22:48 ` [PATCH v2 16/16] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Brian Masney
2026-01-13  5:48   ` Stephen Boyd
2026-01-13 11:35     ` Brian Masney
2026-01-23  0:49 ` [PATCH v2 00/16] MIPS: move pic32.h header file from asm to platform_data Brian Masney
2026-01-30 14:37 ` Thomas Bogendoerfer
2026-02-10 12:42 ` Brian Masney
2026-02-10 15:50   ` Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox