public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data
@ 2026-01-09 16:41 Brian Masney
  2026-01-09 16:41 ` [PATCH 01/13] MIPS: copy pic32.h header file from asm/mach-pic32/ to include/platform-data/ Brian Masney
                   ` (13 more replies)
  0 siblings, 14 replies; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 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, Wim Van Sebroeck, Guenter Roeck, 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.

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

Merge Strategy
==============
- Patches 1-12 can go through the MIPS tree.
- Patch 13 I can repost to Claudiu after patches 1-12 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>
---
Brian Masney (13):
      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                          |  2 +-
 arch/mips/pic32/pic32mzda/config.c                      |  3 +--
 arch/mips/pic32/pic32mzda/early_clk.c                   |  2 +-
 arch/mips/pic32/pic32mzda/early_console.c               |  2 +-
 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, 27 insertions(+), 27 deletions(-)
---
base-commit: f417b7ffcbef7d76b0d8860518f50dae0e7e5eda
change-id: 20260109-mips-pic32-header-move-6ac9965aa70a

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


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

* [PATCH 01/13] MIPS: copy pic32.h header file from asm/mach-pic32/ to include/platform-data/
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-09 16:41 ` [PATCH 02/13] MAINTAINERS: add include/linux/platform_data/pic32.h to MIPS entry Brian Masney
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 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/. 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>
---
 include/linux/platform_data/pic32.h | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/include/linux/platform_data/pic32.h b/include/linux/platform_data/pic32.h
new file mode 100644
index 0000000000000000000000000000000000000000..925b436a8541b2732c221186c5f33045ea2d669a
--- /dev/null
+++ b/include/linux/platform_data/pic32.h
@@ -0,0 +1,37 @@
+/* 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
+
+/*
+ * 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] 24+ messages in thread

* [PATCH 02/13] MAINTAINERS: add include/linux/platform_data/pic32.h to MIPS entry
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
  2026-01-09 16:41 ` [PATCH 01/13] MIPS: copy pic32.h header file from asm/mach-pic32/ to include/platform-data/ Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-09 16:41 ` [PATCH 03/13] MIPS: update include to use pic32.h from platform_data Brian Masney
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 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] 24+ messages in thread

* [PATCH 03/13] MIPS: update include to use pic32.h from platform_data
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
  2026-01-09 16:41 ` [PATCH 01/13] MIPS: copy pic32.h header file from asm/mach-pic32/ to include/platform-data/ Brian Masney
  2026-01-09 16:41 ` [PATCH 02/13] MAINTAINERS: add include/linux/platform_data/pic32.h to MIPS entry Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-09 16:41 ` [PATCH 04/13] clk: microchip: core: " Brian Masney
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 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 a5fd7a8e2800ff06cfe8c0ed91c8ff6f5996750f..d4ad5dbd61c0d06fee2c9fef2af5c3a7c4312209 100644
--- a/arch/mips/pic32/common/reset.c
+++ b/arch/mips/pic32/common/reset.c
@@ -4,9 +4,9 @@
  * Copyright (C) 2015 Microchip Technology Inc.  All rights reserved.
  */
 #include <linux/init.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 6001e507d8e398dee77eed071f0e53f708b57a61..ed8fa6e68b7b814bc184ee9bebddca08c20623c0 100644
--- a/arch/mips/pic32/pic32mzda/early_clk.c
+++ b/arch/mips/pic32/pic32mzda/early_clk.c
@@ -3,7 +3,7 @@
  * Joshua Henderson <joshua.henderson@microchip.com>
  * Copyright (C) 2015 Microchip Technology Inc.  All rights reserved.
  */
-#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 3cd1b408fa1cb039f917f2d92e82fd00d8a44574..1349c783cb640d1c0940db6deda77da882ff97fe 100644
--- a/arch/mips/pic32/pic32mzda/early_console.c
+++ b/arch/mips/pic32/pic32mzda/early_console.c
@@ -3,9 +3,9 @@
  * Joshua Henderson <joshua.henderson@microchip.com>
  * Copyright (C) 2015 Microchip Technology Inc.  All rights reserved.
  */
-#include <asm/mach-pic32/pic32.h>
 #include <asm/fw/fw.h>
 #include <asm/setup.h>
+#include <linux/platform_data/pic32.h>
 
 #include "pic32mzda.h"
 #include "early_pin.h"

-- 
2.52.0


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

* [PATCH 04/13] clk: microchip: core: update include to use pic32.h from platform_data
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (2 preceding siblings ...)
  2026-01-09 16:41 ` [PATCH 03/13] MIPS: update include to use pic32.h from platform_data Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-09 16:41 ` [PATCH 05/13] irqchip/irq-pic32-evic: " Brian Masney
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 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] 24+ messages in thread

* [PATCH 05/13] irqchip/irq-pic32-evic: update include to use pic32.h from platform_data
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (3 preceding siblings ...)
  2026-01-09 16:41 ` [PATCH 04/13] clk: microchip: core: " Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-09 16:41 ` [PATCH 06/13] mmc: sdhci-pic32: " Brian Masney
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 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] 24+ messages in thread

* [PATCH 06/13] mmc: sdhci-pic32: update include to use pic32.h from platform_data
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (4 preceding siblings ...)
  2026-01-09 16:41 ` [PATCH 05/13] irqchip/irq-pic32-evic: " Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-12  8:40   ` Adrian Hunter
  2026-01-09 16:41 ` [PATCH 07/13] pinctrl: pic32: " Brian Masney
                   ` (7 subsequent siblings)
  13 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 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] 24+ messages in thread

* [PATCH 07/13] pinctrl: pic32: update include to use pic32.h from platform_data
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (5 preceding siblings ...)
  2026-01-09 16:41 ` [PATCH 06/13] mmc: sdhci-pic32: " Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-09 23:25   ` Linus Walleij
  2026-01-09 16:41 ` [PATCH 08/13] rtc: " Brian Masney
                   ` (6 subsequent siblings)
  13 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 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.

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] 24+ messages in thread

* [PATCH 08/13] rtc: pic32: update include to use pic32.h from platform_data
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (6 preceding siblings ...)
  2026-01-09 16:41 ` [PATCH 07/13] pinctrl: pic32: " Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-09 17:42   ` Alexandre Belloni
  2026-01-09 16:41 ` [PATCH 09/13] serial: pic32_uart: " Brian Masney
                   ` (5 subsequent siblings)
  13 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 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.

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] 24+ messages in thread

* [PATCH 09/13] serial: pic32_uart: update include to use pic32.h from platform_data
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (7 preceding siblings ...)
  2026-01-09 16:41 ` [PATCH 08/13] rtc: " Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-09 16:41 ` [PATCH 10/13] watchdog: pic32-dmt: " Brian Masney
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 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] 24+ messages in thread

* [PATCH 10/13] watchdog: pic32-dmt: update include to use pic32.h from platform_data
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (8 preceding siblings ...)
  2026-01-09 16:41 ` [PATCH 09/13] serial: pic32_uart: " Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-09 17:08   ` Guenter Roeck
  2026-01-09 16:41 ` [PATCH 11/13] watchdog: pic32-wdt: " Brian Masney
                   ` (3 subsequent siblings)
  13 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney, Wim Van Sebroeck,
	Guenter Roeck, 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.

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] 24+ messages in thread

* [PATCH 11/13] watchdog: pic32-wdt: update include to use pic32.h from platform_data
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (9 preceding siblings ...)
  2026-01-09 16:41 ` [PATCH 10/13] watchdog: pic32-dmt: " Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-09 17:09   ` Guenter Roeck
  2026-01-09 16:41 ` [PATCH 12/13] MIPS: drop unused pic32.h header Brian Masney
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Brian Masney, Wim Van Sebroeck,
	Guenter Roeck, 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.

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] 24+ messages in thread

* [PATCH 12/13] MIPS: drop unused pic32.h header
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (10 preceding siblings ...)
  2026-01-09 16:41 ` [PATCH 11/13] watchdog: pic32-wdt: " Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-10 15:28   ` Claudiu Beznea
  2026-01-09 16:41 ` [PATCH 13/13] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Brian Masney
  2026-01-09 17:14 ` [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
  13 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 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 53918a671a4c39dba2a22121187cdd73e1935b24..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/io.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] 24+ messages in thread

* [PATCH 13/13] clk: microchip: core: allow driver to be compiled with COMPILE_TEST
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (11 preceding siblings ...)
  2026-01-09 16:41 ` [PATCH 12/13] MIPS: drop unused pic32.h header Brian Masney
@ 2026-01-09 16:41 ` Brian Masney
  2026-01-09 17:14 ` [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
  13 siblings, 0 replies; 24+ messages in thread
From: Brian Masney @ 2026-01-09 16:41 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] 24+ messages in thread

* Re: [PATCH 10/13] watchdog: pic32-dmt: update include to use pic32.h from platform_data
  2026-01-09 16:41 ` [PATCH 10/13] watchdog: pic32-dmt: " Brian Masney
@ 2026-01-09 17:08   ` Guenter Roeck
  2026-01-09 17:11     ` Brian Masney
  0 siblings, 1 reply; 24+ messages in thread
From: Guenter Roeck @ 2026-01-09 17:08 UTC (permalink / raw)
  To: Brian Masney
  Cc: Thomas Bogendoerfer, Claudiu Beznea, linux-mips, linux-kernel,
	Wim Van Sebroeck, linux-watchdog

On Fri, Jan 09, 2026 at 11:41:23AM -0500, 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>
> 

linux/platform_data/pic32.h doesn't exist upstream, and I was not
copied on the patch introducing it, so I'll just blindly asume that
this works.

Acked-by: Guenter Roeck <linux@roeck-us.net>

Guenter
> ---
> 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	[flat|nested] 24+ messages in thread

* Re: [PATCH 11/13] watchdog: pic32-wdt: update include to use pic32.h from platform_data
  2026-01-09 16:41 ` [PATCH 11/13] watchdog: pic32-wdt: " Brian Masney
@ 2026-01-09 17:09   ` Guenter Roeck
  0 siblings, 0 replies; 24+ messages in thread
From: Guenter Roeck @ 2026-01-09 17:09 UTC (permalink / raw)
  To: Brian Masney
  Cc: Thomas Bogendoerfer, Claudiu Beznea, linux-mips, linux-kernel,
	Wim Van Sebroeck, linux-watchdog

On Fri, Jan 09, 2026 at 11:41:24AM -0500, 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>
> 

Same as with previous patch.

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
> 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	[flat|nested] 24+ messages in thread

* Re: [PATCH 10/13] watchdog: pic32-dmt: update include to use pic32.h from platform_data
  2026-01-09 17:08   ` Guenter Roeck
@ 2026-01-09 17:11     ` Brian Masney
  0 siblings, 0 replies; 24+ messages in thread
From: Brian Masney @ 2026-01-09 17:11 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Thomas Bogendoerfer, Claudiu Beznea, linux-mips, linux-kernel,
	Wim Van Sebroeck, linux-watchdog

On Fri, Jan 09, 2026 at 09:08:37AM -0800, Guenter Roeck wrote:
> On Fri, Jan 09, 2026 at 11:41:23AM -0500, 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>
> > 
> 
> linux/platform_data/pic32.h doesn't exist upstream, and I was not
> copied on the patch introducing it, so I'll just blindly asume that
> this works.
> 
> Acked-by: Guenter Roeck <linux@roeck-us.net>

I didn't CC everyone on all of the patches to reduce the spam in your
mailboxes.

It was introduced in patch 1 of this series when I copied it over
from the asm directory. I'll reply to the cover letter as a heads up to
everyone else.

Thanks!

Brian


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

* Re: [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data
  2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
                   ` (12 preceding siblings ...)
  2026-01-09 16:41 ` [PATCH 13/13] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Brian Masney
@ 2026-01-09 17:14 ` Brian Masney
  13 siblings, 0 replies; 24+ messages in thread
From: Brian Masney @ 2026-01-09 17:14 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, Wim Van Sebroeck,
	Guenter Roeck, linux-watchdog

On Fri, Jan 09, 2026 at 11:41:13AM -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.
> 
> I included a patch at the end that shows enabling COMPILE_TEST for a
> pic32 clk driver.

I didn't CC everyone on patch 1 to this series that copes pic32.h from
the MIPS ASM directory to linux/platform_data/pic32.h. It's available at
the following location if you want to see it:

https://lore.kernel.org/linux-mips/20260109-mips-pic32-header-move-v1-0-99859c55783d@redhat.com/T/#m1e0e50adfe2ea4bf430025660fada7b1468d0fbf

Patch 12 of this series is where I remove the asm variant of pic32.h.

Brian


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

* Re: [PATCH 08/13] rtc: pic32: update include to use pic32.h from platform_data
  2026-01-09 16:41 ` [PATCH 08/13] rtc: " Brian Masney
@ 2026-01-09 17:42   ` Alexandre Belloni
  0 siblings, 0 replies; 24+ messages in thread
From: Alexandre Belloni @ 2026-01-09 17:42 UTC (permalink / raw)
  To: Brian Masney
  Cc: Thomas Bogendoerfer, Claudiu Beznea, linux-mips, linux-kernel,
	linux-rtc

On 09/01/2026 11:41:21-0500, 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: Alexandre Belloni <alexandre.belloni@bootlin.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
> 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 07/13] pinctrl: pic32: update include to use pic32.h from platform_data
  2026-01-09 16:41 ` [PATCH 07/13] pinctrl: pic32: " Brian Masney
@ 2026-01-09 23:25   ` Linus Walleij
  0 siblings, 0 replies; 24+ messages in thread
From: Linus Walleij @ 2026-01-09 23:25 UTC (permalink / raw)
  To: Brian Masney
  Cc: Thomas Bogendoerfer, Claudiu Beznea, linux-mips, linux-kernel,
	linux-gpio

On Fri, Jan 9, 2026 at 5:42 PM 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>

Fair enough, if the whole series is OK:

Acked-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij

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

* Re: [PATCH 12/13] MIPS: drop unused pic32.h header
  2026-01-09 16:41 ` [PATCH 12/13] MIPS: drop unused pic32.h header Brian Masney
@ 2026-01-10 15:28   ` Claudiu Beznea
  2026-01-12 20:41     ` Brian Masney
  0 siblings, 1 reply; 24+ messages in thread
From: Claudiu Beznea @ 2026-01-10 15:28 UTC (permalink / raw)
  To: Brian Masney, Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel

Hi, Brian,

On 1/9/26 18:41, Brian Masney wrote:
> 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 53918a671a4c39dba2a22121187cdd73e1935b24..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/io.h>
> -

There are compilation errors when building pic32mzda_defconfig (see 
below) and I presume those are related to the fact that this include was 
dropped from include/linux/platform_data/pic32.h:

../arch/mips/pic32/common/reset.c: In function 'pic32_machine_restart':
../arch/mips/pic32/common/reset.c:27:17: error: implicit declaration of 
function 'ioremap' [-Wimplicit-function-declaration]
    27 |                 ioremap(PIC32_BASE_RESET + PIC32_RSWRST, 
sizeof(u32));
       |                 ^~~~~~~
../arch/mips/pic32/common/reset.c:27:17: error: initialization of 'void 
*' from 'int' makes pointer from integer without a cast [-Wint-conversion]
../arch/mips/pic32/common/reset.c:32:9: error: implicit declaration of 
function '__raw_writel'; did you mean '_raw_write_lock'? 
[-Wimplicit-function-declaration]
    32 |         __raw_writel(1, reg);
       |         ^~~~~~~~~~~~
       |         _raw_write_lock
   CC      fs/iomap/iter.o
../arch/mips/pic32/common/reset.c:33:15: error: implicit declaration of 
function '__raw_readl'; did you mean '_raw_read_lock'? 
[-Wimplicit-function-declaration]
    33 |         (void)__raw_readl(reg);
       |               ^~~~~~~~~~~
       |               _raw_read_lock
   CC      arch/mips/vdso/vgettimeofday.o
make[6]: *** [../scripts/Makefile.build:287: 
arch/mips/pic32/common/reset.o] Error 1
   CC      arch/mips/pic32/pic32mzda/early_clk.o
In file included from ../arch/mips/pic32/pic32mzda/early_clk.c:6:
../include/linux/platform_data/pic32.h:29:54: error: unknown type name 
'ulong'; did you mean 'long'?
    29 | void pic32_syskey_unlock_debug(const char *fn, const ulong ln);
       |                                                      ^~~~~
       |                                                      long
In file included from ../arch/mips/pic32/pic32mzda/early_clk.c:8:
../arch/mips/pic32/pic32mzda/pic32mzda.h:10:1: error: unknown type name 
'u32'
    10 | u32 pic32_get_pbclk(int bus);
       | ^~~
../arch/mips/pic32/pic32mzda/pic32mzda.h:11:1: error: unknown type name 
'u32'
    11 | u32 pic32_get_sysclk(void);
       | ^~~
../arch/mips/pic32/pic32mzda/pic32mzda.h:14:13: error: expected '=', 
',', ';', 'asm' or '__attribute__' before 'pic32_config_init'
    14 | void __init pic32_config_init(void);
       |             ^~~~~~~~~~~~~~~~~
../arch/mips/pic32/pic32mzda/pic32mzda.h:16:41: error: unknown type name 
'u32'
    16 | int pic32_set_sdhci_adma_fifo_threshold(u32 rthrs, u32 wthrs);
       |                                         ^~~
../arch/mips/pic32/pic32mzda/pic32mzda.h:16:52: error: unknown type name 
'u32'
    16 | int pic32_set_sdhci_adma_fifo_threshold(u32 rthrs, u32 wthrs);
       |                                                    ^~~
../arch/mips/pic32/pic32mzda/pic32mzda.h:17:1: error: unknown type name 
'u32'
    17 | u32 pic32_get_boot_status(void);
       | ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:28:1: error: unknown type name 
'u32'
    28 | u32 pic32_get_sysclk(void)
       | ^~~
../arch/mips/pic32/pic32mzda/early_clk.c: In function 'pic32_get_sysclk':
../arch/mips/pic32/pic32mzda/early_clk.c:30:9: error: unknown type name 
'u32'
    30 |         u32 osc_freq = 0;
       |         ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:31:9: error: unknown type name 
'u32'
    31 |         u32 pllclk;
       |         ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:32:9: error: unknown type name 
'u32'
    32 |         u32 frcdivn;
       |         ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:33:9: error: unknown type name 
'u32'
    33 |         u32 osccon;
       |         ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:34:9: error: unknown type name 
'u32'
    34 |         u32 spllcon;
       |         ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:37:9: error: unknown type name 
'u32'
    37 |         u32 plliclk;
       |         ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:38:9: error: unknown type name 
'u32'
    38 |         u32 pllidiv;
       |         ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:39:9: error: unknown type name 
'u32'
    39 |         u32 pllodiv;
       |         ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:40:9: error: unknown type name 
'u32'
    40 |         u32 pllmult;
       |         ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:41:9: error: unknown type name 
'u32'
    41 |         u32 frcdiv;
       |         ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:43:34: error: implicit 
declaration of function 'ioremap' [-Wimplicit-function-declaration]
    43 |         void __iomem *osc_base = ioremap(PIC32_BASE_OSC, 0x200);
       |                                  ^~~~~~~
../arch/mips/pic32/pic32mzda/early_clk.c:43:34: error: initialization of 
'void *' from 'int' makes pointer from integer without a cast 
[-Wint-conversion]
../arch/mips/pic32/pic32mzda/early_clk.c:45:18: error: implicit 
declaration of function '__raw_readl' [-Wimplicit-function-declaration]
    45 |         osccon = __raw_readl(osc_base + OSCCON);
       |                  ^~~~~~~~~~~
../arch/mips/pic32/pic32mzda/early_clk.c:81:9: error: implicit 
declaration of function 'iounmap' [-Wimplicit-function-declaration]
    81 |         iounmap(osc_base);
       |         ^~~~~~~
../arch/mips/pic32/pic32mzda/early_clk.c: At top level:
../arch/mips/pic32/pic32mzda/early_clk.c:86:1: error: unknown type name 
'u32'
    86 | u32 pic32_get_pbclk(int bus)
       | ^~~
../arch/mips/pic32/pic32mzda/early_clk.c: In function 'pic32_get_pbclk':
../arch/mips/pic32/pic32mzda/early_clk.c:88:9: error: unknown type name 
'u32'
    88 |         u32 clk_freq;
       |         ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:89:34: error: initialization of 
'void *' from 'int' makes pointer from integer without a cast 
[-Wint-conversion]
    89 |         void __iomem *osc_base = ioremap(PIC32_BASE_OSC, 0x200);
       |                                  ^~~~~~~
../arch/mips/pic32/pic32mzda/early_clk.c:90:9: error: unknown type name 
'u32'
    90 |         u32 pbxdiv = PB1DIV + ((bus - 1) * 0x10);
       |         ^~~
../arch/mips/pic32/pic32mzda/early_clk.c:91:9: error: unknown type name 
'u32'
    91 |         u32 pbdiv = (__raw_readl(osc_base + pbxdiv) & PB_MASK) + 1;
       |         ^~~
make[6]: *** [../scripts/Makefile.build:287: 
arch/mips/pic32/pic32mzda/early_clk.o] Error 1


Thank you,
Claudiu

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

* Re: [PATCH 06/13] mmc: sdhci-pic32: update include to use pic32.h from platform_data
  2026-01-09 16:41 ` [PATCH 06/13] mmc: sdhci-pic32: " Brian Masney
@ 2026-01-12  8:40   ` Adrian Hunter
  2026-01-12 20:54     ` Brian Masney
  0 siblings, 1 reply; 24+ messages in thread
From: Adrian Hunter @ 2026-01-12  8:40 UTC (permalink / raw)
  To: Brian Masney, Thomas Bogendoerfer, Claudiu Beznea
  Cc: linux-mips, linux-kernel, Ulf Hansson, linux-mmc

On 09/01/2026 18:41, 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>

Seemed to compile on x86 with COMPILE_TEST, so please also add
COMPILE_TEST for sdhci-pic32.

> 
> ---
> 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] 24+ messages in thread

* Re: [PATCH 12/13] MIPS: drop unused pic32.h header
  2026-01-10 15:28   ` Claudiu Beznea
@ 2026-01-12 20:41     ` Brian Masney
  0 siblings, 0 replies; 24+ messages in thread
From: Brian Masney @ 2026-01-12 20:41 UTC (permalink / raw)
  To: Claudiu Beznea; +Cc: Thomas Bogendoerfer, linux-mips, linux-kernel

Hi Claudiu,

On Sat, Jan 10, 2026 at 05:28:32PM +0200, Claudiu Beznea wrote:
> On 1/9/26 18:41, Brian Masney wrote:
> > 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 53918a671a4c39dba2a22121187cdd73e1935b24..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/io.h>
> > -
> 
> There are compilation errors when building pic32mzda_defconfig (see below)
> and I presume those are related to the fact that this include was dropped
> from include/linux/platform_data/pic32.h:
> 
> ../arch/mips/pic32/common/reset.c: In function 'pic32_machine_restart':
> ../arch/mips/pic32/common/reset.c:27:17: error: implicit declaration of
> function 'ioremap' [-Wimplicit-function-declaration]
>    27 |                 ioremap(PIC32_BASE_RESET + PIC32_RSWRST,
> sizeof(u32));

[snip]

I only tried compiling this on arm64, and that compiles fine. I setup
a mips cross compiler on a arm64 box and I can reproduce the compiler
errors.

So linux/io.h is not directly used by this header file. I think the
correct thing to do here is to update the files where it's actually
needed. There's 3 files that need linux/io.h, and one file needs
linux/types.h. I'll send a version two of this series with the cleanups.

Thanks,

Brian


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

* Re: [PATCH 06/13] mmc: sdhci-pic32: update include to use pic32.h from platform_data
  2026-01-12  8:40   ` Adrian Hunter
@ 2026-01-12 20:54     ` Brian Masney
  0 siblings, 0 replies; 24+ messages in thread
From: Brian Masney @ 2026-01-12 20:54 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Thomas Bogendoerfer, Claudiu Beznea, linux-mips, linux-kernel,
	Ulf Hansson, linux-mmc

Hi Adrian,

On Mon, Jan 12, 2026 at 10:40:03AM +0200, Adrian Hunter wrote:
> On 09/01/2026 18:41, 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>
> 
> Seemed to compile on x86 with COMPILE_TEST, so please also add
> COMPILE_TEST for sdhci-pic32.

I can do that in a later series once this series that moves the header
file and updates the includes lands in Linus' tree. These are low
priority fixes, and I don't want to create extra work for the various
subsystem maintainers with all of these cross tree merges, and
immutable branches.

If patches across the tree get merged in the wrong order, then Linus
will get some build warnings, and I'd really like to avoid that. :)

I'm sending out a v2 of this series in a few hours. Hopefully the MIPS
maintainers can merge this for v6.20 / v7.0, and in about a month, I'll
post patches to various subsystems that enable COMPILE_TEST for these
pic32 drivers. Based on the clk driver, there's likely to be other
cleanup pathces that will be required as well, such as to fix sparse
errors that will be newly introduced since the drivers will appear as
"new".

Brian


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

end of thread, other threads:[~2026-01-12 20:54 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-09 16:41 [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney
2026-01-09 16:41 ` [PATCH 01/13] MIPS: copy pic32.h header file from asm/mach-pic32/ to include/platform-data/ Brian Masney
2026-01-09 16:41 ` [PATCH 02/13] MAINTAINERS: add include/linux/platform_data/pic32.h to MIPS entry Brian Masney
2026-01-09 16:41 ` [PATCH 03/13] MIPS: update include to use pic32.h from platform_data Brian Masney
2026-01-09 16:41 ` [PATCH 04/13] clk: microchip: core: " Brian Masney
2026-01-09 16:41 ` [PATCH 05/13] irqchip/irq-pic32-evic: " Brian Masney
2026-01-09 16:41 ` [PATCH 06/13] mmc: sdhci-pic32: " Brian Masney
2026-01-12  8:40   ` Adrian Hunter
2026-01-12 20:54     ` Brian Masney
2026-01-09 16:41 ` [PATCH 07/13] pinctrl: pic32: " Brian Masney
2026-01-09 23:25   ` Linus Walleij
2026-01-09 16:41 ` [PATCH 08/13] rtc: " Brian Masney
2026-01-09 17:42   ` Alexandre Belloni
2026-01-09 16:41 ` [PATCH 09/13] serial: pic32_uart: " Brian Masney
2026-01-09 16:41 ` [PATCH 10/13] watchdog: pic32-dmt: " Brian Masney
2026-01-09 17:08   ` Guenter Roeck
2026-01-09 17:11     ` Brian Masney
2026-01-09 16:41 ` [PATCH 11/13] watchdog: pic32-wdt: " Brian Masney
2026-01-09 17:09   ` Guenter Roeck
2026-01-09 16:41 ` [PATCH 12/13] MIPS: drop unused pic32.h header Brian Masney
2026-01-10 15:28   ` Claudiu Beznea
2026-01-12 20:41     ` Brian Masney
2026-01-09 16:41 ` [PATCH 13/13] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Brian Masney
2026-01-09 17:14 ` [PATCH 00/13] MIPS: move pic32.h header file from asm to platform_data Brian Masney

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