* [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device
@ 2026-11-05 11:06 Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 01/16] MAINTAINERS: Add sam9/sama to (AT91) SoC support Alexander Dahl
` (15 more replies)
0 siblings, 16 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk
Hei hei,
after sitting on my todo list since February, I rebased on top of
v7.4-rc1, addressed all review comments, and now this is v4 of the
series. Motivation and changelog below:
On a custom sam9x60 based board we want to access a unique ID of the
SoC. Microchip sam-ba has a command 'readuniqueid' which returns the
content of the OTPC Product UID x Registers in that case.
(On different boards with a SAMA5D2 sam-ba and we use the Serial Number
x Register for that purpose. In the linux kernel those are exposed
through nvmem by the atmel soc driver. Those registers are not present
in the SAM9X60 series, but only for SAMA5D2/SAMA5D4 AFAIK. Neither of
those uses /sys/devices/socX for exposing the serial number.)
There is a driver for the OTPC of the SAMA7G5 and after comparing
register layouts it seems that one is almost identical to the one used
by SAM9X60. Currently that driver has no support for the UIDx
registers, but I suppose it would be the right place to implement it,
because the registers are within the OTPC register address offsets.
When developing and testing it became clear the OTPC needs explicit
enabling of certain clocks in the otpc driver. So the patch series
starts with some rework of clock bindings and clock drivers, along with
referencing that in SoC dtsi files.
The four patches for the otpc driver start with two patches with some
unrelated fixups for that driver. It follows a patch dealing the
necessary clock enablement. The last patch for the otpc driver adds an
additional nvmem device for the UIDx registers, fullfilling the initial
goal of mine.
Output of sam-ba:
adahl@ada-pc /opt/sam-ba_v3.9.1 % ./sam-ba -p serial -d sam9x60:0:1 -t 5 -a readuniqueid
SAM-BA Command Line Interface Tool v3.9.1 (linux - x86_64-little_endian-lp64)
Copyright 2025 Microchip Technology
Opening serial port 'ttyACM0' (USB)
Connection opened.
Launch readuniqueid
Executing Applet at @0x300000
UID[0] = 0x36465356
UID[1] = 0x10340637
UID[2] = 0x6036f6f0
UID[3] = 0x27b483c8
Execution time: 150 ms
Connection closed.
New Linux nvmem device content (little-endian):
root@DistroKit:~ hexdump -C /sys/bus/nvmem/devices/mchp-uid0/nvmem
00000000 56 53 46 36 37 06 34 10 f0 f6 36 60 c8 83 b4 27 |VSF67.4...6`...'|
00000010
I tested the series at runtime only on SAM9X60, not on SAMA7G5 or the
other SoCs affected, because I only have sam9x60 hardware for testing.
If someone could test on SAM9X7, SAMA7G5, and SAMA7D65, that would be
highly appreciated.
Series is build time tested for sam9, sama5, and sama7.
Last question: Should the UID be added to the device entropy pool with
add_device_randomness() as done in the SAMA5D2 sfr driver?
For detailed patch changelog see each patch, general changelog below.
Greets
Alex
(series based on v7.4-rc1)
v4:
- "re-added" more indexes related to actual hardware to the split-up
definitions in bindings, adapt other patches to this (Claudiu)
- dropped patch 5 ("clk: at91: sama7d65: Use highest PMC definition as
max index"), that was a drive-by patch for sama7d65 which is not my
department, and the discussion implied lots of extra work for a SoC
not used here
- reword some commit messages (Claudiu)
- dropped patch 8 ("dt-bindings: nvmem: microchip-otpc: Add compatible
for SAM9X60") and 12 ("nvmem: microchip-otpc: Add SAM9X60 support"),
no need for a new compatible unless driver needs different behaviour,
use sama7g5 compatible for sam9x60 as well, adapt other patches
accordingly (Claudiu)
v3:
- Reordered patch series (thanks Claudiu)
- Collected review tags plus minor commit message fixes (e.g. tag order)
- Removed clock-names from dt bindings, led to confusion on review,
and not used by the driver anyways (always enables all clocks)
- Removed redundant example from dt bindings docs
- Extended the per SoC splitup of the PMC definitions to the whole at91 family
- Add patch for a small after splitup fixup of the sama7d65 clock driver
- Add patch for removing old preprocessor definitions
- Link: https://lore.kernel.org/all/20260120143759.904013-1-ada@thorsis.com/
v2:
- Removed patch adding bad OPTC conditions warnings on probe
- Removed patch adding more register definitions (the one register
definition required was moved to the last patch adding the nvmem for
UID registers)
- Added multiple new patches handling the dt-bindings issues
- Extend the possibility to enable the main rc oscillator to all at91
SoCs with an OTPC
- Added patches to reference and enable the OTPC peripheral clock on all
capable SoCs
- Reordered patches
- Reworded commit messages
- Squashed patches with dts changes for sam9x60
- Fixed bot warnings
- Link: https://lore.kernel.org/all/20250210164506.495747-1-ada@thorsis.com/
v1:
- Link: https://lore.kernel.org/all/20240821105943.230281-1-ada@thorsis.com/
(I sent an RFC patch on this topic earlier in 2024, you'll find the
link below as a reference to the discussion. The patch itself was
trivial and not meant for applying as is anyways, so I decided to not
write a full changelog from RFC to v1.)
RFC:
- Link: https://lore.kernel.org/all/20240412140802.1571935-1-ada@thorsis.com/
Cc: linux-arm-kernel@lists.infradead.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Alexander Dahl (16):
MAINTAINERS: Add sam9/sama to (AT91) SoC support
dt-bindings: clock: at91: Split up per SoC partially
dt-bindings: clock: at91: Allow referencing main rc oscillator in DT
clk: at91: Use new per SoC PMC clock index definitions
clk: at91: Allow enabling main_rc_osc through DT
clk: at91: Add peripheral clock id for OTPC
dt-bindings: nvmem: microchip-otpc: Add required clocks
nvmem: microchip-otpc: Avoid reading a write-only register
nvmem: microchip-otpc: Fix swapped 'sleep' and 'timeout' parameters
nvmem: microchip-otpc: Enable necessary clocks
nvmem: microchip-otpc: Expose UID registers as 2nd nvmem device
ARM: dts: microchip: Use new per SoC PMC bindings
ARM: dts: microchip: sama7g5: Add OTPC clocks
ARM: dts: microchip: sam9x60: Add OTPC node
ARM: dts: microchip: sam9x60_curiosity: Enable OTP Controller
dt-bindings: clock: at91: Remove old PMC definitions
.../nvmem/microchip,sama7g5-otpc.yaml | 9 ++++
.../reset/atmel,at91sam9260-reset.yaml | 3 +-
.../bindings/usb/atmel,at91sam9rl-udc.yaml | 3 +-
MAINTAINERS | 1 +
.../dts/microchip/at91-sam9x60_curiosity.dts | 4 ++
arch/arm/boot/dts/microchip/at91rm9200.dtsi | 3 +-
arch/arm/boot/dts/microchip/at91sam9260.dtsi | 19 +++----
arch/arm/boot/dts/microchip/at91sam9261.dtsi | 7 +--
arch/arm/boot/dts/microchip/at91sam9263.dtsi | 9 ++--
arch/arm/boot/dts/microchip/at91sam9g45.dtsi | 11 ++--
arch/arm/boot/dts/microchip/at91sam9n12.dtsi | 7 +--
arch/arm/boot/dts/microchip/at91sam9rl.dtsi | 9 ++--
arch/arm/boot/dts/microchip/at91sam9x5.dtsi | 11 ++--
arch/arm/boot/dts/microchip/sam9x60.dtsi | 23 +++++---
arch/arm/boot/dts/microchip/sam9x7.dtsi | 13 ++---
arch/arm/boot/dts/microchip/sama5d2.dtsi | 25 ++++-----
arch/arm/boot/dts/microchip/sama5d3.dtsi | 9 ++--
arch/arm/boot/dts/microchip/sama5d4.dtsi | 9 ++--
arch/arm/boot/dts/microchip/sama7d65.dtsi | 15 +++---
arch/arm/boot/dts/microchip/sama7g5.dtsi | 24 +++++----
drivers/clk/at91/at91rm9200.c | 12 ++---
drivers/clk/at91/at91sam9260.c | 14 ++---
drivers/clk/at91/at91sam9g45.c | 12 ++---
drivers/clk/at91/at91sam9n12.c | 12 ++---
drivers/clk/at91/at91sam9rl.c | 12 ++---
drivers/clk/at91/at91sam9x5.c | 12 ++---
drivers/clk/at91/sam9x60.c | 16 +++---
drivers/clk/at91/sam9x7.c | 24 +++++----
drivers/clk/at91/sama5d2.c | 22 ++++----
drivers/clk/at91/sama5d3.c | 10 ++--
drivers/clk/at91/sama5d4.c | 12 ++---
drivers/clk/at91/sama7d65.c | 40 +++++++-------
drivers/clk/at91/sama7g5.c | 30 ++++++-----
drivers/nvmem/microchip-otpc.c | 53 ++++++++++++++++---
include/dt-bindings/clock/at91.h | 32 -----------
.../dt-bindings/clock/atmel,at91rm9200-pmc.h | 16 ++++++
.../dt-bindings/clock/atmel,at91sam9260-pmc.h | 16 ++++++
.../dt-bindings/clock/atmel,at91sam9g45-pmc.h | 16 ++++++
.../dt-bindings/clock/atmel,at91sam9n12-pmc.h | 16 ++++++
.../dt-bindings/clock/atmel,at91sam9rl-pmc.h | 16 ++++++
.../dt-bindings/clock/atmel,at91sam9x5-pmc.h | 16 ++++++
include/dt-bindings/clock/atmel,sama5d2-pmc.h | 20 +++++++
include/dt-bindings/clock/atmel,sama5d3-pmc.h | 16 ++++++
include/dt-bindings/clock/atmel,sama5d4-pmc.h | 17 ++++++
.../dt-bindings/clock/microchip,sam9x60-pmc.h | 16 ++++++
.../dt-bindings/clock/microchip,sam9x7-pmc.h | 20 +++++++
.../clock/microchip,sama7d65-pmc.h | 27 ++++++++++
.../dt-bindings/clock/microchip,sama7g5-pmc.h | 24 +++++++++
48 files changed, 528 insertions(+), 235 deletions(-)
create mode 100644 include/dt-bindings/clock/atmel,at91rm9200-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,at91sam9260-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,at91sam9g45-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,at91sam9n12-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,at91sam9rl-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,at91sam9x5-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,sama5d2-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,sama5d3-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,sama5d4-pmc.h
create mode 100644 include/dt-bindings/clock/microchip,sam9x60-pmc.h
create mode 100644 include/dt-bindings/clock/microchip,sam9x7-pmc.h
create mode 100644 include/dt-bindings/clock/microchip,sama7d65-pmc.h
create mode 100644 include/dt-bindings/clock/microchip,sama7g5-pmc.h
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 01/16] MAINTAINERS: Add sam9/sama to (AT91) SoC support
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 02/16] dt-bindings: clock: at91: Split up per SoC partially Alexander Dahl
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk
Will catch previously unmatched files in include/dt-bindings/*
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- no changes
v3:
- new patch, not present in v2
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 93abbb315065d..3ca145c68e0e1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3283,6 +3283,7 @@ F: include/soc/at91/
X: drivers/input/touchscreen/atmel_mxt_ts.c
N: at91
N: atmel
+N: sam[9a]
ARM/Microchip Sparx5 SoC support
M: Steen Hegelund <Steen.Hegelund@microchip.com>
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 02/16] dt-bindings: clock: at91: Split up per SoC partially
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 01/16] MAINTAINERS: Add sam9/sama to (AT91) SoC support Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 03/16] dt-bindings: clock: at91: Allow referencing main rc oscillator in DT Alexander Dahl
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Philipp Zabel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Greg Kroah-Hartman,
Stephen Boyd, Brian Masney, Jerome Brunet,
open list:USB SUBSYSTEM
Before adding even more new indexes creating more holes in the
clk at91 drivers pmc_data->chws arrays, split this up.
This is a partial split up only for some of the old PMC definitions.
Binding splitup was proposed for several reasons:
1) keep the driver code simple, readable, and efficient
2) avoid accidental array index duplication
3) avoid memory waste by creating more and more unused array members.
Old values are kept to not break dts, and to maintain dt ABI.
Link: https://lore.kernel.org/linux-devicetree/20250207-jailbird-circus-bcc04ee90e05@thorsis.com/T/#u
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- "re-added" some definitions present in hardware but not used in dt
- reword header comment (at91 -> Microchip) for newer SoCs
- PMC_UTMI was renamed where appropriate according to datasheets
v3:
- full splitup for all at91 family SoCs instead of just a few
v2:
- new patch, not present in v1
.../reset/atmel,at91sam9260-reset.yaml | 3 ++-
.../bindings/usb/atmel,at91sam9rl-udc.yaml | 3 ++-
.../dt-bindings/clock/atmel,at91rm9200-pmc.h | 16 ++++++++++++
.../dt-bindings/clock/atmel,at91sam9260-pmc.h | 16 ++++++++++++
.../dt-bindings/clock/atmel,at91sam9g45-pmc.h | 16 ++++++++++++
.../dt-bindings/clock/atmel,at91sam9n12-pmc.h | 16 ++++++++++++
.../dt-bindings/clock/atmel,at91sam9rl-pmc.h | 16 ++++++++++++
.../dt-bindings/clock/atmel,at91sam9x5-pmc.h | 16 ++++++++++++
include/dt-bindings/clock/atmel,sama5d2-pmc.h | 20 ++++++++++++++
include/dt-bindings/clock/atmel,sama5d3-pmc.h | 16 ++++++++++++
include/dt-bindings/clock/atmel,sama5d4-pmc.h | 17 ++++++++++++
.../dt-bindings/clock/microchip,sam9x60-pmc.h | 15 +++++++++++
.../dt-bindings/clock/microchip,sam9x7-pmc.h | 19 ++++++++++++++
.../clock/microchip,sama7d65-pmc.h | 26 +++++++++++++++++++
.../dt-bindings/clock/microchip,sama7g5-pmc.h | 23 ++++++++++++++++
15 files changed, 236 insertions(+), 2 deletions(-)
create mode 100644 include/dt-bindings/clock/atmel,at91rm9200-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,at91sam9260-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,at91sam9g45-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,at91sam9n12-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,at91sam9rl-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,at91sam9x5-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,sama5d2-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,sama5d3-pmc.h
create mode 100644 include/dt-bindings/clock/atmel,sama5d4-pmc.h
create mode 100644 include/dt-bindings/clock/microchip,sam9x60-pmc.h
create mode 100644 include/dt-bindings/clock/microchip,sam9x7-pmc.h
create mode 100644 include/dt-bindings/clock/microchip,sama7d65-pmc.h
create mode 100644 include/dt-bindings/clock/microchip,sama7g5-pmc.h
diff --git a/Documentation/devicetree/bindings/reset/atmel,at91sam9260-reset.yaml b/Documentation/devicetree/bindings/reset/atmel,at91sam9260-reset.yaml
index 84c4801df8d9a..8c89ccc3d6393 100644
--- a/Documentation/devicetree/bindings/reset/atmel,at91sam9260-reset.yaml
+++ b/Documentation/devicetree/bindings/reset/atmel,at91sam9260-reset.yaml
@@ -67,9 +67,10 @@ additionalProperties: false
examples:
- |
#include <dt-bindings/clock/at91.h>
+ #include <dt-bindings/clock/atmel,at91sam9260-pmc.h>
reset-controller@fffffd00 {
compatible = "atmel,at91sam9260-rstc";
reg = <0xfffffd00 0x10>;
- clocks = <&pmc PMC_TYPE_CORE PMC_SLOW>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_SLOW>;
};
diff --git a/Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml b/Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml
index cdbbd17f80363..15f5bb51fd8a7 100644
--- a/Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml
+++ b/Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml
@@ -61,13 +61,14 @@ examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/clock/at91.h>
+ #include <dt-bindings/clock/atmel,at91sam9rl-pmc.h>
#include <dt-bindings/gpio/gpio.h>
gadget@fff78000 {
compatible = "atmel,at91sam9g45-udc";
reg = <0x00600000 0x80000
0xfff78000 0x400>;
interrupts = <27 IRQ_TYPE_LEVEL_HIGH 0>;
- clocks = <&pmc PMC_TYPE_PERIPHERAL 27>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 27>, <&pmc PMC_TYPE_CORE AT91SAM9RL_PMC_UTMI>;
clock-names = "pclk", "hclk";
atmel,vbus-gpio = <&pioC 15 GPIO_ACTIVE_HIGH>;
};
diff --git a/include/dt-bindings/clock/atmel,at91rm9200-pmc.h b/include/dt-bindings/clock/atmel,at91rm9200-pmc.h
new file mode 100644
index 0000000000000..35fce34e00b82
--- /dev/null
+++ b/include/dt-bindings/clock/atmel,at91rm9200-pmc.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * at91rm9200 clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_ATMEL_AT91RM9200_PMC_H
+#define _DT_BINDINGS_CLOCK_ATMEL_AT91RM9200_PMC_H
+
+#define AT91RM9200_PMC_SLOW 0
+#define AT91RM9200_PMC_MCK 1
+#define AT91RM9200_PMC_MAIN 3
+#define AT91RM9200_PMC_PLLACK 7
+#define AT91RM9200_PMC_PLLBCK 8
+
+#endif
diff --git a/include/dt-bindings/clock/atmel,at91sam9260-pmc.h b/include/dt-bindings/clock/atmel,at91sam9260-pmc.h
new file mode 100644
index 0000000000000..6a5453cf70954
--- /dev/null
+++ b/include/dt-bindings/clock/atmel,at91sam9260-pmc.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * at91sam9260 clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_ATMEL_AT91SAM9260_PMC_H
+#define _DT_BINDINGS_CLOCK_ATMEL_AT91SAM9260_PMC_H
+
+#define AT91SAM9260_PMC_SLOW 0
+#define AT91SAM9260_PMC_MCK 1
+#define AT91SAM9260_PMC_MAIN 3
+#define AT91SAM9260_PMC_PLLACK 7
+#define AT91SAM9260_PMC_PLLBCK 8
+
+#endif
diff --git a/include/dt-bindings/clock/atmel,at91sam9g45-pmc.h b/include/dt-bindings/clock/atmel,at91sam9g45-pmc.h
new file mode 100644
index 0000000000000..44a804ff96fff
--- /dev/null
+++ b/include/dt-bindings/clock/atmel,at91sam9g45-pmc.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * at91sam9g45 clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_ATMEL_AT91SAM9G45_PMC_H
+#define _DT_BINDINGS_CLOCK_ATMEL_AT91SAM9G45_PMC_H
+
+#define AT91SAM9G45_PMC_SLOW 0
+#define AT91SAM9G45_PMC_MCK 1
+#define AT91SAM9G45_PMC_UPLLCK 2
+#define AT91SAM9G45_PMC_MAIN 3
+#define AT91SAM9G45_PMC_PLLACK 7
+
+#endif
diff --git a/include/dt-bindings/clock/atmel,at91sam9n12-pmc.h b/include/dt-bindings/clock/atmel,at91sam9n12-pmc.h
new file mode 100644
index 0000000000000..6eaef69242ee8
--- /dev/null
+++ b/include/dt-bindings/clock/atmel,at91sam9n12-pmc.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * at91sam9n12 clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_ATMEL_AT91SAM9N12_PMC_H
+#define _DT_BINDINGS_CLOCK_ATMEL_AT91SAM9N12_PMC_H
+
+#define AT91SAM9N12_PMC_SLOW 0
+#define AT91SAM9N12_PMC_MCK 1
+#define AT91SAM9N12_PMC_MAIN 3
+#define AT91SAM9N12_PMC_PLLACK 7
+#define AT91SAM9N12_PMC_PLLBCK 8
+
+#endif
diff --git a/include/dt-bindings/clock/atmel,at91sam9rl-pmc.h b/include/dt-bindings/clock/atmel,at91sam9rl-pmc.h
new file mode 100644
index 0000000000000..0bb195712f785
--- /dev/null
+++ b/include/dt-bindings/clock/atmel,at91sam9rl-pmc.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * at91sam9rl clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_ATMEL_AT91SAM9RL_PMC_H
+#define _DT_BINDINGS_CLOCK_ATMEL_AT91SAM9RL_PMC_H
+
+#define AT91SAM9RL_PMC_SLOW 0
+#define AT91SAM9RL_PMC_MCK 1
+#define AT91SAM9RL_PMC_UTMI 2
+#define AT91SAM9RL_PMC_MAIN 3
+#define AT91SAM9RL_PMC_PLLACK 7
+
+#endif
diff --git a/include/dt-bindings/clock/atmel,at91sam9x5-pmc.h b/include/dt-bindings/clock/atmel,at91sam9x5-pmc.h
new file mode 100644
index 0000000000000..d095dcc9b29ff
--- /dev/null
+++ b/include/dt-bindings/clock/atmel,at91sam9x5-pmc.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * at91sam9x5 clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_ATMEL_AT91SAM9X5_PMC_H
+#define _DT_BINDINGS_CLOCK_ATMEL_AT91SAM9X5_PMC_H
+
+#define AT91SAM9X5_PMC_SLOW 0
+#define AT91SAM9X5_PMC_MCK 1
+#define AT91SAM9X5_PMC_UPLLCK 2
+#define AT91SAM9X5_PMC_MAIN 3
+#define AT91SAM9X5_PMC_PLLACK 7
+
+#endif
diff --git a/include/dt-bindings/clock/atmel,sama5d2-pmc.h b/include/dt-bindings/clock/atmel,sama5d2-pmc.h
new file mode 100644
index 0000000000000..51bb410c699e2
--- /dev/null
+++ b/include/dt-bindings/clock/atmel,sama5d2-pmc.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * at91 sama5d2 clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_ATMEL_SAMA5D2_PMC_H
+#define _DT_BINDINGS_CLOCK_ATMEL_SAMA5D2_PMC_H
+
+#define SAMA5D2_PMC_MCK 1
+#define SAMA5D2_PMC_UPLLCK 2
+#define SAMA5D2_PMC_MAIN 3
+#define SAMA5D2_PMC_MCK2 4
+#define SAMA5D2_PMC_I2S0_MUX 5
+#define SAMA5D2_PMC_I2S1_MUX 6
+#define SAMA5D2_PMC_PLLACK 7
+#define SAMA5D2_PMC_AUDIOPLLCK 9
+#define SAMA5D2_PMC_AUDIOPINCK 10
+
+#endif
diff --git a/include/dt-bindings/clock/atmel,sama5d3-pmc.h b/include/dt-bindings/clock/atmel,sama5d3-pmc.h
new file mode 100644
index 0000000000000..92210969104d6
--- /dev/null
+++ b/include/dt-bindings/clock/atmel,sama5d3-pmc.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * at91 sama5d3 clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_ATMEL_SAMA5D3_PMC_H
+#define _DT_BINDINGS_CLOCK_ATMEL_SAMA5D3_PMC_H
+
+#define SAMA5D3_PMC_SLOW 0
+#define SAMA5D3_PMC_MCK 1
+#define SAMA5D3_PMC_UPLLCK 2
+#define SAMA5D3_PMC_MAIN 3
+#define SAMA5D3_PMC_PLLACK 7
+
+#endif
diff --git a/include/dt-bindings/clock/atmel,sama5d4-pmc.h b/include/dt-bindings/clock/atmel,sama5d4-pmc.h
new file mode 100644
index 0000000000000..53870448d6a1d
--- /dev/null
+++ b/include/dt-bindings/clock/atmel,sama5d4-pmc.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * at91 sama5d4 clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_ATMEL_SAMA5D4_PMC_H
+#define _DT_BINDINGS_CLOCK_ATMEL_SAMA5D4_PMC_H
+
+#define SAMA5D4_PMC_SLOW 0
+#define SAMA5D4_PMC_MCK 1
+#define SAMA5D4_PMC_UPLLCK 2
+#define SAMA5D4_PMC_MAIN 3
+#define SAMA5D4_PMC_MCK2 4
+#define SAMA5D4_PMC_PLLACK 7
+
+#endif
diff --git a/include/dt-bindings/clock/microchip,sam9x60-pmc.h b/include/dt-bindings/clock/microchip,sam9x60-pmc.h
new file mode 100644
index 0000000000000..050e5e774b274
--- /dev/null
+++ b/include/dt-bindings/clock/microchip,sam9x60-pmc.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * Microchip sam9x60 clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_MICROCHIP_SAM9X60_PMC_H
+#define _DT_BINDINGS_CLOCK_MICROCHIP_SAM9X60_PMC_H
+
+#define SAM9X60_PMC_MCK 1
+#define SAM9X60_PMC_UPLLCK 2
+#define SAM9X60_PMC_MAIN 3
+#define SAM9X60_PMC_PLLACK 7
+
+#endif
diff --git a/include/dt-bindings/clock/microchip,sam9x7-pmc.h b/include/dt-bindings/clock/microchip,sam9x7-pmc.h
new file mode 100644
index 0000000000000..292c5873e101e
--- /dev/null
+++ b/include/dt-bindings/clock/microchip,sam9x7-pmc.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * Microchip sam9x7 clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_MICROCHIP_SAM9X7_PMC_H
+#define _DT_BINDINGS_CLOCK_MICROCHIP_SAM9X7_PMC_H
+
+#define SAM9X7_PMC_MCK 1
+#define SAM9X7_PMC_UPLLCK 2
+#define SAM9X7_PMC_MAIN 3
+#define SAM9X7_PMC_PLLACK 7
+#define SAM9X7_PMC_AUDIOPMCPLL 9
+#define SAM9X7_PMC_AUDIOIOPLL 10
+#define SAM9X7_PMC_PLLADIV2 14
+#define SAM9X7_PMC_LVDSPLL 15
+
+#endif
diff --git a/include/dt-bindings/clock/microchip,sama7d65-pmc.h b/include/dt-bindings/clock/microchip,sama7d65-pmc.h
new file mode 100644
index 0000000000000..08581418b9115
--- /dev/null
+++ b/include/dt-bindings/clock/microchip,sama7d65-pmc.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * Microchip sama7d65 clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_MICROCHIP_SAMA7D65_PMC_H
+#define _DT_BINDINGS_CLOCK_MICROCHIP_SAMA7D65_PMC_H
+
+#define SAMA7D65_PMC_MCK0 1
+#define SAMA7D65_PMC_USBPLL 2
+#define SAMA7D65_PMC_MAIN 3
+#define SAMA7D65_PMC_CPUPLL 4
+#define SAMA7D65_PMC_SYSPLL 5
+#define SAMA7D65_PMC_DDRPLL 6
+#define SAMA7D65_PMC_GPUPLL 7
+#define SAMA7D65_PMC_BAUDPLL 8
+#define SAMA7D65_PMC_AUDIOPMCPLL 9
+#define SAMA7D65_PMC_AUDIOIOPLL 10
+#define SAMA7D65_PMC_ETHPLL 11
+#define SAMA7D65_PMC_MCK1 13
+#define SAMA7D65_PMC_LVDSPLL 15
+#define SAMA7D65_PMC_MCK3 16
+#define SAMA7D65_PMC_MCK5 17
+
+#endif
diff --git a/include/dt-bindings/clock/microchip,sama7g5-pmc.h b/include/dt-bindings/clock/microchip,sama7g5-pmc.h
new file mode 100644
index 0000000000000..27668634b0a2b
--- /dev/null
+++ b/include/dt-bindings/clock/microchip,sama7g5-pmc.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * The constants defined in this header are being used in dts and in
+ * Microchip sama7g5 clock driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_MICROCHIP_SAMA7G5_PMC_H
+#define _DT_BINDINGS_CLOCK_MICROCHIP_SAMA7G5_PMC_H
+
+#define SAMA7G5_PMC_MCK0 1
+#define SAMA7G5_PMC_UTMI 2
+#define SAMA7G5_PMC_MAIN 3
+#define SAMA7G5_PMC_CPUPLL 4
+#define SAMA7G5_PMC_SYSPLL 5
+#define SAMA7G5_PMC_DDRPLL 6
+#define SAMA7G5_PMC_IMGPLL 7
+#define SAMA7G5_PMC_BAUDPLL 8
+#define SAMA7G5_PMC_AUDIOPMCPLL 9
+#define SAMA7G5_PMC_AUDIOIOPLL 10
+#define SAMA7G5_PMC_ETHPLL 11
+#define SAMA7G5_PMC_MCK1 13
+
+#endif
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 03/16] dt-bindings: clock: at91: Allow referencing main rc oscillator in DT
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 01/16] MAINTAINERS: Add sam9/sama to (AT91) SoC support Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 02/16] dt-bindings: clock: at91: Split up per SoC partially Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 04/16] clk: at91: Use new per SoC PMC clock index definitions Alexander Dahl
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley
The main rc oscillator will be needed for the OTPC to work properly.
The new index introduced here was not used on the four affected SoC
clock drivers before.
Link: https://lore.kernel.org/linux-devicetree/20250207-jailbird-circus-bcc04ee90e05@thorsis.com/T/#u
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- change index for sama7g5 and sama7d65 after re-adding unused PLLs in patch 2
v3:
- adapt to different base changes, added lines are the same
v2:
- new patch, not present in v1
include/dt-bindings/clock/microchip,sam9x60-pmc.h | 1 +
include/dt-bindings/clock/microchip,sam9x7-pmc.h | 1 +
include/dt-bindings/clock/microchip,sama7d65-pmc.h | 1 +
include/dt-bindings/clock/microchip,sama7g5-pmc.h | 1 +
4 files changed, 4 insertions(+)
diff --git a/include/dt-bindings/clock/microchip,sam9x60-pmc.h b/include/dt-bindings/clock/microchip,sam9x60-pmc.h
index 050e5e774b274..830e247ba2532 100644
--- a/include/dt-bindings/clock/microchip,sam9x60-pmc.h
+++ b/include/dt-bindings/clock/microchip,sam9x60-pmc.h
@@ -10,6 +10,7 @@
#define SAM9X60_PMC_MCK 1
#define SAM9X60_PMC_UPLLCK 2
#define SAM9X60_PMC_MAIN 3
+#define SAM9X60_PMC_MAIN_RC 6
#define SAM9X60_PMC_PLLACK 7
#endif
diff --git a/include/dt-bindings/clock/microchip,sam9x7-pmc.h b/include/dt-bindings/clock/microchip,sam9x7-pmc.h
index 292c5873e101e..58d2a08116795 100644
--- a/include/dt-bindings/clock/microchip,sam9x7-pmc.h
+++ b/include/dt-bindings/clock/microchip,sam9x7-pmc.h
@@ -10,6 +10,7 @@
#define SAM9X7_PMC_MCK 1
#define SAM9X7_PMC_UPLLCK 2
#define SAM9X7_PMC_MAIN 3
+#define SAM9X7_PMC_MAIN_RC 6
#define SAM9X7_PMC_PLLACK 7
#define SAM9X7_PMC_AUDIOPMCPLL 9
#define SAM9X7_PMC_AUDIOIOPLL 10
diff --git a/include/dt-bindings/clock/microchip,sama7d65-pmc.h b/include/dt-bindings/clock/microchip,sama7d65-pmc.h
index 08581418b9115..17105a6bedb54 100644
--- a/include/dt-bindings/clock/microchip,sama7d65-pmc.h
+++ b/include/dt-bindings/clock/microchip,sama7d65-pmc.h
@@ -19,6 +19,7 @@
#define SAMA7D65_PMC_AUDIOIOPLL 10
#define SAMA7D65_PMC_ETHPLL 11
#define SAMA7D65_PMC_MCK1 13
+#define SAMA7D65_PMC_MAIN_RC 14
#define SAMA7D65_PMC_LVDSPLL 15
#define SAMA7D65_PMC_MCK3 16
#define SAMA7D65_PMC_MCK5 17
diff --git a/include/dt-bindings/clock/microchip,sama7g5-pmc.h b/include/dt-bindings/clock/microchip,sama7g5-pmc.h
index 27668634b0a2b..4a1c4af8ecc9a 100644
--- a/include/dt-bindings/clock/microchip,sama7g5-pmc.h
+++ b/include/dt-bindings/clock/microchip,sama7g5-pmc.h
@@ -19,5 +19,6 @@
#define SAMA7G5_PMC_AUDIOIOPLL 10
#define SAMA7G5_PMC_ETHPLL 11
#define SAMA7G5_PMC_MCK1 13
+#define SAMA7G5_PMC_MAIN_RC 14
#endif
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 04/16] clk: at91: Use new per SoC PMC clock index definitions
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (2 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 03/16] dt-bindings: clock: at91: Allow referencing main rc oscillator in DT Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 05/16] clk: at91: Allow enabling main_rc_osc through DT Alexander Dahl
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Stephen Boyd, Brian Masney,
Jerome Brunet, Mihai Sain, Manikandan Muralidharan,
Durai Manickam KR
Adding missing clocks for only some (more recent) SoCs got more and more
complex and confusing with the old common definitions, while there was
no actual need to have them common.
A splitup of the definitions in the bindings was prosoded and done per
SoC, before adding new array members for missing clocks.
Switch from the old common indexes to the new per SoC indexes.
No functional change. Old defines can be removed later.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- PMC_UTMI was renamed where appropriate according to datasheets
v3:
- extend to all SoC specific at91 clk drivers
v2:
- new patch, not present in v1
drivers/clk/at91/at91rm9200.c | 12 +++++------
drivers/clk/at91/at91sam9260.c | 14 ++++++-------
drivers/clk/at91/at91sam9g45.c | 12 +++++------
drivers/clk/at91/at91sam9n12.c | 12 +++++------
drivers/clk/at91/at91sam9rl.c | 12 +++++------
drivers/clk/at91/at91sam9x5.c | 12 +++++------
drivers/clk/at91/sam9x60.c | 14 ++++++-------
drivers/clk/at91/sam9x7.c | 22 ++++++++++----------
drivers/clk/at91/sama5d2.c | 22 ++++++++++----------
drivers/clk/at91/sama5d3.c | 10 ++++-----
drivers/clk/at91/sama5d4.c | 12 +++++------
drivers/clk/at91/sama7d65.c | 38 +++++++++++++++++-----------------
drivers/clk/at91/sama7g5.c | 28 ++++++++++++-------------
13 files changed, 110 insertions(+), 110 deletions(-)
diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c
index 3f19e737ae4d2..6f5c758ab3ec6 100644
--- a/drivers/clk/at91/at91rm9200.c
+++ b/drivers/clk/at91/at91rm9200.c
@@ -3,7 +3,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91rm9200-pmc.h>
#include "pmc.h"
@@ -100,7 +100,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
if (IS_ERR(regmap))
return;
- at91rm9200_pmc = pmc_data_allocate(PMC_PLLBCK + 1,
+ at91rm9200_pmc = pmc_data_allocate(AT91RM9200_PMC_PLLBCK + 1,
nck(at91rm9200_systemck),
nck(at91rm9200_periphck), 0, 4);
if (!at91rm9200_pmc)
@@ -117,7 +117,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91rm9200_pmc->chws[PMC_MAIN] = hw;
+ at91rm9200_pmc->chws[AT91RM9200_PMC_MAIN] = hw;
hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0,
&at91rm9200_pll_layout,
@@ -125,7 +125,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91rm9200_pmc->chws[PMC_PLLACK] = hw;
+ at91rm9200_pmc->chws[AT91RM9200_PMC_PLLACK] = hw;
hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1,
&at91rm9200_pll_layout,
@@ -133,7 +133,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91rm9200_pmc->chws[PMC_PLLBCK] = hw;
+ at91rm9200_pmc->chws[AT91RM9200_PMC_PLLBCK] = hw;
parent_names[0] = slowxtal_name;
parent_names[1] = "mainck";
@@ -155,7 +155,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91rm9200_pmc->chws[PMC_MCK] = hw;
+ at91rm9200_pmc->chws[AT91RM9200_PMC_MCK] = hw;
hw = at91rm9200_clk_register_usb(regmap, "usbck", "pllbck", usb_div);
if (IS_ERR(hw))
diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c
index 0799a13060ea4..492114c13e40d 100644
--- a/drivers/clk/at91/at91sam9260.c
+++ b/drivers/clk/at91/at91sam9260.c
@@ -3,7 +3,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91sam9260-pmc.h>
#include "pmc.h"
@@ -354,7 +354,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
if (IS_ERR(regmap))
return;
- at91sam9260_pmc = pmc_data_allocate(PMC_PLLBCK + 1,
+ at91sam9260_pmc = pmc_data_allocate(AT91SAM9260_PMC_PLLBCK + 1,
ndck(data->sck, data->num_sck),
ndck(data->pck, data->num_pck),
0, data->num_progck);
@@ -372,7 +372,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
if (IS_ERR(hw))
goto err_free;
- at91sam9260_pmc->chws[PMC_MAIN] = hw;
+ at91sam9260_pmc->chws[AT91SAM9260_PMC_MAIN] = hw;
if (data->has_slck) {
hw = clk_hw_register_fixed_rate_with_accuracy(NULL,
@@ -389,7 +389,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
if (IS_ERR(hw))
goto err_free;
- at91sam9260_pmc->chws[PMC_SLOW] = hw;
+ at91sam9260_pmc->chws[AT91SAM9260_PMC_SLOW] = hw;
slck_name = "slck";
} else {
slck_name = slowxtal_name;
@@ -401,7 +401,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
if (IS_ERR(hw))
goto err_free;
- at91sam9260_pmc->chws[PMC_PLLACK] = hw;
+ at91sam9260_pmc->chws[AT91SAM9260_PMC_PLLACK] = hw;
hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1,
data->pllb_layout,
@@ -409,7 +409,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
if (IS_ERR(hw))
goto err_free;
- at91sam9260_pmc->chws[PMC_PLLBCK] = hw;
+ at91sam9260_pmc->chws[AT91SAM9260_PMC_PLLBCK] = hw;
parent_names[0] = slck_name;
parent_names[1] = "mainck";
@@ -432,7 +432,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
if (IS_ERR(hw))
goto err_free;
- at91sam9260_pmc->chws[PMC_MCK] = hw;
+ at91sam9260_pmc->chws[AT91SAM9260_PMC_MCK] = hw;
hw = at91rm9200_clk_register_usb(regmap, "usbck", "pllbck", usb_div);
if (IS_ERR(hw))
diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c
index f45a7b80f7d8b..d665cbf1a37ac 100644
--- a/drivers/clk/at91/at91sam9g45.c
+++ b/drivers/clk/at91/at91sam9g45.c
@@ -3,7 +3,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91sam9g45-pmc.h>
#include "pmc.h"
@@ -115,7 +115,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
if (IS_ERR(regmap))
return;
- at91sam9g45_pmc = pmc_data_allocate(PMC_PLLACK + 1,
+ at91sam9g45_pmc = pmc_data_allocate(AT91SAM9G45_PMC_PLLACK + 1,
nck(at91sam9g45_systemck),
nck(at91sam9g45_periphck), 0, 2);
if (!at91sam9g45_pmc)
@@ -132,7 +132,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91sam9g45_pmc->chws[PMC_MAIN] = hw;
+ at91sam9g45_pmc->chws[AT91SAM9G45_PMC_MAIN] = hw;
hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0,
&at91rm9200_pll_layout, &plla_characteristics);
@@ -143,13 +143,13 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91sam9g45_pmc->chws[PMC_PLLACK] = hw;
+ at91sam9g45_pmc->chws[AT91SAM9G45_PMC_PLLACK] = hw;
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck", NULL);
if (IS_ERR(hw))
goto err_free;
- at91sam9g45_pmc->chws[PMC_UTMI] = hw;
+ at91sam9g45_pmc->chws[AT91SAM9G45_PMC_UPLLCK] = hw;
parent_names[0] = slck_name;
parent_names[1] = "mainck";
@@ -172,7 +172,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91sam9g45_pmc->chws[PMC_MCK] = hw;
+ at91sam9g45_pmc->chws[AT91SAM9G45_PMC_MCK] = hw;
parent_names[0] = "plladivck";
parent_names[1] = "utmick";
diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c
index 751786184ae2b..f6210fac26f39 100644
--- a/drivers/clk/at91/at91sam9n12.c
+++ b/drivers/clk/at91/at91sam9n12.c
@@ -3,7 +3,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91sam9n12-pmc.h>
#include "pmc.h"
@@ -135,7 +135,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
if (IS_ERR(regmap))
return;
- at91sam9n12_pmc = pmc_data_allocate(PMC_PLLBCK + 1,
+ at91sam9n12_pmc = pmc_data_allocate(AT91SAM9N12_PMC_PLLBCK + 1,
nck(at91sam9n12_systemck), 31, 0, 2);
if (!at91sam9n12_pmc)
return;
@@ -158,7 +158,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91sam9n12_pmc->chws[PMC_MAIN] = hw;
+ at91sam9n12_pmc->chws[AT91SAM9N12_PMC_MAIN] = hw;
hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0,
&at91rm9200_pll_layout, &plla_characteristics);
@@ -169,14 +169,14 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91sam9n12_pmc->chws[PMC_PLLACK] = hw;
+ at91sam9n12_pmc->chws[AT91SAM9N12_PMC_PLLACK] = hw;
hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1,
&at91rm9200_pll_layout, &pllb_characteristics);
if (IS_ERR(hw))
goto err_free;
- at91sam9n12_pmc->chws[PMC_PLLBCK] = hw;
+ at91sam9n12_pmc->chws[AT91SAM9N12_PMC_PLLBCK] = hw;
parent_names[0] = slck_name;
parent_names[1] = "mainck";
@@ -199,7 +199,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91sam9n12_pmc->chws[PMC_MCK] = hw;
+ at91sam9n12_pmc->chws[AT91SAM9N12_PMC_MCK] = hw;
hw = at91sam9n12_clk_register_usb(regmap, "usbck", "pllbck");
if (IS_ERR(hw))
diff --git a/drivers/clk/at91/at91sam9rl.c b/drivers/clk/at91/at91sam9rl.c
index 969f809e7d65a..4664e4afc69cf 100644
--- a/drivers/clk/at91/at91sam9rl.c
+++ b/drivers/clk/at91/at91sam9rl.c
@@ -3,7 +3,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91sam9rl-pmc.h>
#include "pmc.h"
@@ -89,7 +89,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
if (IS_ERR(regmap))
return;
- at91sam9rl_pmc = pmc_data_allocate(PMC_PLLACK + 1,
+ at91sam9rl_pmc = pmc_data_allocate(AT91SAM9RL_PMC_PLLACK + 1,
nck(at91sam9rl_systemck),
nck(at91sam9rl_periphck), 0, 2);
if (!at91sam9rl_pmc)
@@ -99,7 +99,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91sam9rl_pmc->chws[PMC_MAIN] = hw;
+ at91sam9rl_pmc->chws[AT91SAM9RL_PMC_MAIN] = hw;
hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0,
&at91rm9200_pll_layout,
@@ -107,13 +107,13 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91sam9rl_pmc->chws[PMC_PLLACK] = hw;
+ at91sam9rl_pmc->chws[AT91SAM9RL_PMC_PLLACK] = hw;
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck", NULL);
if (IS_ERR(hw))
goto err_free;
- at91sam9rl_pmc->chws[PMC_UTMI] = hw;
+ at91sam9rl_pmc->chws[AT91SAM9RL_PMC_UTMI] = hw;
parent_names[0] = slck_name;
parent_names[1] = "mainck";
@@ -135,7 +135,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- at91sam9rl_pmc->chws[PMC_MCK] = hw;
+ at91sam9rl_pmc->chws[AT91SAM9RL_PMC_MCK] = hw;
parent_names[0] = slck_name;
parent_names[1] = "mainck";
diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c
index 3b801d12fac0d..2dec7bf9c0d4f 100644
--- a/drivers/clk/at91/at91sam9x5.c
+++ b/drivers/clk/at91/at91sam9x5.c
@@ -3,7 +3,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91sam9x5-pmc.h>
#include "pmc.h"
@@ -157,7 +157,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
if (IS_ERR(regmap))
return;
- at91sam9x5_pmc = pmc_data_allocate(PMC_PLLACK + 1,
+ at91sam9x5_pmc = pmc_data_allocate(AT91SAM9X5_PMC_PLLACK + 1,
nck(at91sam9x5_systemck), 31, 0, 2);
if (!at91sam9x5_pmc)
return;
@@ -180,7 +180,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
if (IS_ERR(hw))
goto err_free;
- at91sam9x5_pmc->chws[PMC_MAIN] = hw;
+ at91sam9x5_pmc->chws[AT91SAM9X5_PMC_MAIN] = hw;
hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0,
&at91rm9200_pll_layout, &plla_characteristics);
@@ -191,13 +191,13 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
if (IS_ERR(hw))
goto err_free;
- at91sam9x5_pmc->chws[PMC_PLLACK] = hw;
+ at91sam9x5_pmc->chws[AT91SAM9X5_PMC_PLLACK] = hw;
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck", NULL);
if (IS_ERR(hw))
goto err_free;
- at91sam9x5_pmc->chws[PMC_UTMI] = hw;
+ at91sam9x5_pmc->chws[AT91SAM9X5_PMC_UPLLCK] = hw;
parent_names[0] = slck_name;
parent_names[1] = "mainck";
@@ -218,7 +218,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
if (IS_ERR(hw))
goto err_free;
- at91sam9x5_pmc->chws[PMC_MCK] = hw;
+ at91sam9x5_pmc->chws[AT91SAM9X5_PMC_MCK] = hw;
parent_names[0] = "plladivck";
parent_names[1] = "utmick";
diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c
index 18baf4a256f47..eba6e8c16044d 100644
--- a/drivers/clk/at91/sam9x60.c
+++ b/drivers/clk/at91/sam9x60.c
@@ -3,7 +3,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/microchip,sam9x60-pmc.h>
#include "pmc.h"
@@ -216,7 +216,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np)
if (IS_ERR(regmap))
return;
- sam9x60_pmc = pmc_data_allocate(PMC_PLLACK + 1,
+ sam9x60_pmc = pmc_data_allocate(SAM9X60_PMC_PLLACK + 1,
nck(sam9x60_systemck),
nck(sam9x60_periphck),
nck(sam9x60_gck), 8);
@@ -239,10 +239,10 @@ static void __init sam9x60_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sam9x60_pmc->chws[PMC_MAIN] = hw;
+ sam9x60_pmc->chws[SAM9X60_PMC_MAIN] = hw;
hw = sam9x60_clk_register_frac_pll(regmap, &pmc_pll_lock, "pllack_fracck",
- "mainck", sam9x60_pmc->chws[PMC_MAIN],
+ "mainck", sam9x60_pmc->chws[SAM9X60_PMC_MAIN],
0, &plla_characteristics,
&pll_frac_layout,
/*
@@ -265,7 +265,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sam9x60_pmc->chws[PMC_PLLACK] = hw;
+ sam9x60_pmc->chws[SAM9X60_PMC_PLLACK] = hw;
hw = sam9x60_clk_register_frac_pll(regmap, &pmc_pll_lock, "upllck_fracck",
"main_osc", main_osc_hw, 1,
@@ -283,7 +283,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sam9x60_pmc->chws[PMC_UTMI] = hw;
+ sam9x60_pmc->chws[SAM9X60_PMC_UPLLCK] = hw;
parent_names[0] = md_slck_name;
parent_names[1] = "mainck";
@@ -301,7 +301,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sam9x60_pmc->chws[PMC_MCK] = hw;
+ sam9x60_pmc->chws[SAM9X60_PMC_MCK] = hw;
parent_names[0] = "pllack_divck";
parent_names[1] = "upllck_divck";
diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c
index 8b52da194849f..1fc4b01a04abf 100644
--- a/drivers/clk/at91/sam9x7.c
+++ b/drivers/clk/at91/sam9x7.c
@@ -12,7 +12,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/microchip,sam9x7-pmc.h>
#include "pmc.h"
@@ -225,7 +225,7 @@ static const struct {
.t = PLL_TYPE_DIV,
/* This feeds CPU. It should not be disabled */
.f = CLK_IS_CRITICAL | CLK_SET_RATE_GATE,
- .eid = PMC_PLLACK,
+ .eid = SAM9X7_PMC_PLLACK,
.c = &plla_characteristics,
},
},
@@ -247,7 +247,7 @@ static const struct {
.t = PLL_TYPE_DIV,
.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
CLK_SET_RATE_PARENT,
- .eid = PMC_UTMI,
+ .eid = SAM9X7_PMC_UPLLCK,
.c = &upll_characteristics,
},
},
@@ -269,7 +269,7 @@ static const struct {
.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
CLK_SET_RATE_PARENT,
.c = &audiopll_characteristics,
- .eid = PMC_AUDIOPMCPLL,
+ .eid = SAM9X7_PMC_AUDIOPMCPLL,
.t = PLL_TYPE_DIV,
},
@@ -280,7 +280,7 @@ static const struct {
.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
CLK_SET_RATE_PARENT,
.c = &audiopll_characteristics,
- .eid = PMC_AUDIOIOPLL,
+ .eid = SAM9X7_PMC_AUDIOIOPLL,
.t = PLL_TYPE_DIV,
},
},
@@ -302,7 +302,7 @@ static const struct {
.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
CLK_SET_RATE_PARENT,
.c = &lvdspll_characteristics,
- .eid = PMC_LVDSPLL,
+ .eid = SAM9X7_PMC_LVDSPLL,
.t = PLL_TYPE_DIV,
},
},
@@ -318,7 +318,7 @@ static const struct {
*/
.f = CLK_IS_CRITICAL | CLK_SET_RATE_GATE,
.c = &plladiv2_characteristics,
- .eid = PMC_PLLADIV2,
+ .eid = SAM9X7_PMC_PLLADIV2,
.t = PLL_TYPE_DIV,
},
},
@@ -746,7 +746,7 @@ static void __init sam9x7_pmc_setup(struct device_node *np)
if (IS_ERR(regmap))
return;
- sam9x7_pmc = pmc_data_allocate(PMC_LVDSPLL + 1,
+ sam9x7_pmc = pmc_data_allocate(SAM9X7_PMC_LVDSPLL + 1,
nck(sam9x7_systemck),
nck(sam9x7_periphck),
nck(sam9x7_gck), 8);
@@ -775,7 +775,7 @@ static void __init sam9x7_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sam9x7_pmc->chws[PMC_MAIN] = hw;
+ sam9x7_pmc->chws[SAM9X7_PMC_MAIN] = hw;
for (i = 0; i < PLL_ID_MAX; i++) {
for (j = 0; j < 3; j++) {
@@ -787,7 +787,7 @@ static void __init sam9x7_pmc_setup(struct device_node *np)
switch (sam9x7_plls[i][j].t) {
case PLL_TYPE_FRAC:
if (!strcmp(sam9x7_plls[i][j].p, "mainck"))
- parent_hw = sam9x7_pmc->chws[PMC_MAIN];
+ parent_hw = sam9x7_pmc->chws[SAM9X7_PMC_MAIN];
else if (!strcmp(sam9x7_plls[i][j].p, "main_osc"))
parent_hw = main_osc_hw;
else
@@ -843,7 +843,7 @@ static void __init sam9x7_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sam9x7_pmc->chws[PMC_MCK] = hw;
+ sam9x7_pmc->chws[SAM9X7_PMC_MCK] = hw;
parent_names[0] = "plla_divpmcck";
parent_names[1] = "upll_divpmcck";
diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c
index c16594fce90c9..ea8e9a8da4da2 100644
--- a/drivers/clk/at91/sama5d2.c
+++ b/drivers/clk/at91/sama5d2.c
@@ -3,7 +3,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,sama5d2-pmc.h>
#include "pmc.h"
@@ -188,7 +188,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
if (IS_ERR(regmap))
return;
- sama5d2_pmc = pmc_data_allocate(PMC_AUDIOPINCK + 1,
+ sama5d2_pmc = pmc_data_allocate(SAMA5D2_PMC_AUDIOPINCK + 1,
nck(sama5d2_systemck),
nck(sama5d2_periph32ck),
nck(sama5d2_gck), 3);
@@ -213,7 +213,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama5d2_pmc->chws[PMC_MAIN] = hw;
+ sama5d2_pmc->chws[SAMA5D2_PMC_MAIN] = hw;
hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0,
&sama5d3_pll_layout, &plla_characteristics);
@@ -224,7 +224,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama5d2_pmc->chws[PMC_PLLACK] = hw;
+ sama5d2_pmc->chws[SAMA5D2_PMC_PLLACK] = hw;
hw = at91_clk_register_audio_pll_frac(regmap, "audiopll_fracck",
"mainck");
@@ -236,14 +236,14 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama5d2_pmc->chws[PMC_AUDIOPINCK] = hw;
+ sama5d2_pmc->chws[SAMA5D2_PMC_AUDIOPINCK] = hw;
hw = at91_clk_register_audio_pll_pmc(regmap, "audiopll_pmcck",
"audiopll_fracck");
if (IS_ERR(hw))
goto err_free;
- sama5d2_pmc->chws[PMC_AUDIOPLLCK] = hw;
+ sama5d2_pmc->chws[SAMA5D2_PMC_AUDIOPLLCK] = hw;
regmap_sfr = syscon_regmap_lookup_by_compatible("atmel,sama5d2-sfr");
if (IS_ERR(regmap_sfr))
@@ -253,7 +253,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama5d2_pmc->chws[PMC_UTMI] = hw;
+ sama5d2_pmc->chws[SAMA5D2_PMC_UPLLCK] = hw;
parent_names[0] = slck_name;
parent_names[1] = "mainck";
@@ -274,13 +274,13 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama5d2_pmc->chws[PMC_MCK] = hw;
+ sama5d2_pmc->chws[SAMA5D2_PMC_MCK] = hw;
hw = at91_clk_register_h32mx(regmap, "h32mxck", "masterck_div");
if (IS_ERR(hw))
goto err_free;
- sama5d2_pmc->chws[PMC_MCK2] = hw;
+ sama5d2_pmc->chws[SAMA5D2_PMC_MCK2] = hw;
parent_names[0] = "plladivck";
parent_names[1] = "utmick";
@@ -376,7 +376,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama5d2_pmc->chws[PMC_I2S0_MUX] = hw;
+ sama5d2_pmc->chws[SAMA5D2_PMC_I2S0_MUX] = hw;
parent_names[0] = "i2s1_clk";
parent_names[1] = "i2s1_gclk";
@@ -385,7 +385,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama5d2_pmc->chws[PMC_I2S1_MUX] = hw;
+ sama5d2_pmc->chws[SAMA5D2_PMC_I2S1_MUX] = hw;
}
of_clk_add_hw_provider(np, of_clk_hw_pmc_get, sama5d2_pmc);
diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c
index 522ce60314464..6d7bb26e08731 100644
--- a/drivers/clk/at91/sama5d3.c
+++ b/drivers/clk/at91/sama5d3.c
@@ -3,7 +3,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,sama5d3-pmc.h>
#include "pmc.h"
@@ -137,7 +137,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np)
if (IS_ERR(regmap))
return;
- sama5d3_pmc = pmc_data_allocate(PMC_PLLACK + 1,
+ sama5d3_pmc = pmc_data_allocate(SAMA5D3_PMC_PLLACK + 1,
nck(sama5d3_systemck),
nck(sama5d3_periphck), 0, 3);
if (!sama5d3_pmc)
@@ -170,13 +170,13 @@ static void __init sama5d3_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama5d3_pmc->chws[PMC_PLLACK] = hw;
+ sama5d3_pmc->chws[SAMA5D3_PMC_PLLACK] = hw;
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck", NULL);
if (IS_ERR(hw))
goto err_free;
- sama5d3_pmc->chws[PMC_UTMI] = hw;
+ sama5d3_pmc->chws[SAMA5D3_PMC_UPLLCK] = hw;
parent_names[0] = slck_name;
parent_names[1] = "mainck";
@@ -197,7 +197,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama5d3_pmc->chws[PMC_MCK] = hw;
+ sama5d3_pmc->chws[SAMA5D3_PMC_MCK] = hw;
parent_names[0] = "plladivck";
parent_names[1] = "utmick";
diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c
index 160c0bddb6a3b..87e3c30a0c313 100644
--- a/drivers/clk/at91/sama5d4.c
+++ b/drivers/clk/at91/sama5d4.c
@@ -3,7 +3,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,sama5d4-pmc.h>
#include "pmc.h"
@@ -152,7 +152,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np)
if (IS_ERR(regmap))
return;
- sama5d4_pmc = pmc_data_allocate(PMC_PLLACK + 1,
+ sama5d4_pmc = pmc_data_allocate(SAMA5D4_PMC_PLLACK + 1,
nck(sama5d4_systemck),
nck(sama5d4_periph32ck), 0, 3);
if (!sama5d4_pmc)
@@ -185,13 +185,13 @@ static void __init sama5d4_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama5d4_pmc->chws[PMC_PLLACK] = hw;
+ sama5d4_pmc->chws[SAMA5D4_PMC_PLLACK] = hw;
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck", NULL);
if (IS_ERR(hw))
goto err_free;
- sama5d4_pmc->chws[PMC_UTMI] = hw;
+ sama5d4_pmc->chws[SAMA5D4_PMC_UPLLCK] = hw;
parent_names[0] = slck_name;
parent_names[1] = "mainck";
@@ -212,13 +212,13 @@ static void __init sama5d4_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama5d4_pmc->chws[PMC_MCK] = hw;
+ sama5d4_pmc->chws[SAMA5D4_PMC_MCK] = hw;
hw = at91_clk_register_h32mx(regmap, "h32mxck", "masterck_div");
if (IS_ERR(hw))
goto err_free;
- sama5d4_pmc->chws[PMC_MCK2] = hw;
+ sama5d4_pmc->chws[SAMA5D4_PMC_MCK2] = hw;
parent_names[0] = "plladivck";
parent_names[1] = "utmick";
diff --git a/drivers/clk/at91/sama7d65.c b/drivers/clk/at91/sama7d65.c
index ba8ff413fa2c6..0b5356467fa52 100644
--- a/drivers/clk/at91/sama7d65.c
+++ b/drivers/clk/at91/sama7d65.c
@@ -11,7 +11,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/microchip,sama7d65-pmc.h>
#include "pmc.h"
@@ -225,7 +225,7 @@ static struct sama7d65_pll {
.t = PLL_TYPE_DIV,
/* This feeds CPU. It should not be disabled. */
.f = CLK_IS_CRITICAL | CLK_SET_RATE_PARENT,
- .eid = PMC_CPUPLL,
+ .eid = SAMA7D65_PMC_CPUPLL,
/*
* Safe div=15 should be safe even for switching b/w 1GHz and
* 90MHz (frac pll might go up to 1.2GHz).
@@ -260,7 +260,7 @@ static struct sama7d65_pll {
* Therefore it should not be disabled.
*/
.f = CLK_IS_CRITICAL | CLK_SET_RATE_GATE,
- .eid = PMC_SYSPLL,
+ .eid = SAMA7D65_PMC_SYSPLL,
},
},
@@ -328,7 +328,7 @@ static struct sama7d65_pll {
.t = PLL_TYPE_DIV,
.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
CLK_SET_RATE_PARENT,
- .eid = PMC_BAUDPLL,
+ .eid = SAMA7D65_PMC_BAUDPLL,
},
},
@@ -350,7 +350,7 @@ static struct sama7d65_pll {
.t = PLL_TYPE_DIV,
.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
CLK_SET_RATE_PARENT,
- .eid = PMC_AUDIOPMCPLL,
+ .eid = SAMA7D65_PMC_AUDIOPMCPLL,
},
[PLL_COMPID_DIV1] = {
@@ -361,7 +361,7 @@ static struct sama7d65_pll {
.t = PLL_TYPE_DIV,
.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
CLK_SET_RATE_PARENT,
- .eid = PMC_AUDIOIOPLL,
+ .eid = SAMA7D65_PMC_AUDIOIOPLL,
},
},
@@ -383,7 +383,7 @@ static struct sama7d65_pll {
.t = PLL_TYPE_DIV,
.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
CLK_SET_RATE_PARENT,
- .eid = PMC_ETHPLL,
+ .eid = SAMA7D65_PMC_ETHPLL,
},
},
@@ -405,7 +405,7 @@ static struct sama7d65_pll {
.t = PLL_TYPE_DIV,
.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
CLK_SET_RATE_PARENT,
- .eid = PMC_LVDSPLL,
+ .eid = SAMA7D65_PMC_LVDSPLL,
},
},
@@ -427,7 +427,7 @@ static struct sama7d65_pll {
.t = PLL_TYPE_DIV,
.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
CLK_SET_RATE_PARENT,
- .eid = PMC_UTMI,
+ .eid = SAMA7D65_PMC_USBPLL,
},
},
};
@@ -470,7 +470,7 @@ static struct {
.ep_mux_table = { 5, },
.ep_count = 1,
.ep_chg_id = INT_MIN,
- .eid = PMC_MCK1,
+ .eid = SAMA7D65_PMC_MCK1,
.c = 1, },
{ .n = "mck2",
@@ -487,7 +487,7 @@ static struct {
.ep_mux_table = { 5, 6, },
.ep_count = 2,
.ep_chg_id = INT_MIN,
- .eid = PMC_MCK3,
+ .eid = SAMA7D65_PMC_MCK3,
.c = 1, },
{ .n = "mck4",
@@ -504,7 +504,7 @@ static struct {
.ep_mux_table = { 5, },
.ep_count = 1,
.ep_chg_id = INT_MIN,
- .eid = PMC_MCK5,
+ .eid = SAMA7D65_PMC_MCK5,
.c = 1, },
{ .n = "mck6",
@@ -1154,7 +1154,7 @@ static void __init sama7d65_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama7d65_pmc->chws[PMC_MAIN] = hw;
+ sama7d65_pmc->chws[SAMA7D65_PMC_MAIN] = hw;
for (i = 0; i < PLL_ID_MAX; i++) {
for (j = 0; j < PLL_COMPID_MAX; j++) {
@@ -1167,7 +1167,7 @@ static void __init sama7d65_pmc_setup(struct device_node *np)
case PLL_TYPE_FRAC:
switch (sama7d65_plls[i][j].p) {
case SAMA7D65_PLL_PARENT_MAINCK:
- parent_hw = sama7d65_pmc->chws[PMC_MAIN];
+ parent_hw = sama7d65_pmc->chws[SAMA7D65_PMC_MAIN];
break;
case SAMA7D65_PLL_PARENT_MAIN_XTAL:
parent_hw = main_xtal_hw;
@@ -1216,12 +1216,12 @@ static void __init sama7d65_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama7d65_pmc->chws[PMC_MCK] = hw;
+ sama7d65_pmc->chws[SAMA7D65_PMC_MCK0] = hw;
sama7d65_mckx[PCK_PARENT_HW_MCK0].hw = hw;
parent_hws[0] = md_slck_hw;
parent_hws[1] = td_slck_hw;
- parent_hws[2] = sama7d65_pmc->chws[PMC_MAIN];
+ parent_hws[2] = sama7d65_pmc->chws[SAMA7D65_PMC_MAIN];
for (i = PCK_PARENT_HW_MCK1; i < ARRAY_SIZE(sama7d65_mckx); i++) {
u8 num_parents = 3 + sama7d65_mckx[i].ep_count;
struct clk_hw *tmp_parent_hws[8];
@@ -1270,7 +1270,7 @@ static void __init sama7d65_pmc_setup(struct device_node *np)
parent_hws[0] = md_slck_hw;
parent_hws[1] = td_slck_hw;
- parent_hws[2] = sama7d65_pmc->chws[PMC_MAIN];
+ parent_hws[2] = sama7d65_pmc->chws[SAMA7D65_PMC_MAIN];
parent_hws[3] = sama7d65_plls[PLL_ID_SYS][PLL_COMPID_DIV0].hw;
parent_hws[4] = sama7d65_plls[PLL_ID_DDR][PLL_COMPID_DIV0].hw;
parent_hws[5] = sama7d65_plls[PLL_ID_GPU][PLL_COMPID_DIV0].hw;
@@ -1321,8 +1321,8 @@ static void __init sama7d65_pmc_setup(struct device_node *np)
parent_hws[0] = md_slck_hw;
parent_hws[1] = td_slck_hw;
- parent_hws[2] = sama7d65_pmc->chws[PMC_MAIN];
- parent_hws[3] = sama7d65_pmc->chws[PMC_MCK1];
+ parent_hws[2] = sama7d65_pmc->chws[SAMA7D65_PMC_MAIN];
+ parent_hws[3] = sama7d65_pmc->chws[SAMA7D65_PMC_MCK1];
for (i = 0; i < ARRAY_SIZE(sama7d65_gck); i++) {
u8 num_parents = 4 + sama7d65_gck[i].pp_count;
struct clk_hw *tmp_parent_hws[8];
diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c
index 1340c2b006192..99b4c1d9bdcca 100644
--- a/drivers/clk/at91/sama7g5.c
+++ b/drivers/clk/at91/sama7g5.c
@@ -12,7 +12,7 @@
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
-#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/microchip,sama7g5-pmc.h>
#include "pmc.h"
@@ -183,7 +183,7 @@ static struct sama7g5_pll {
.t = PLL_TYPE_DIV,
/* This feeds CPU. It should not be disabled. */
.f = CLK_IS_CRITICAL | CLK_SET_RATE_PARENT,
- .eid = PMC_CPUPLL,
+ .eid = SAMA7G5_PMC_CPUPLL,
/*
* Safe div=15 should be safe even for switching b/w 1GHz and
* 90MHz (frac pll might go up to 1.2GHz).
@@ -218,7 +218,7 @@ static struct sama7g5_pll {
* Therefore it should not be disabled.
*/
.f = CLK_IS_CRITICAL | CLK_SET_RATE_GATE,
- .eid = PMC_SYSPLL,
+ .eid = SAMA7G5_PMC_SYSPLL,
},
},
@@ -306,7 +306,7 @@ static struct sama7g5_pll {
.t = PLL_TYPE_DIV,
.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
CLK_SET_RATE_PARENT,
- .eid = PMC_AUDIOPMCPLL,
+ .eid = SAMA7G5_PMC_AUDIOPMCPLL,
},
[PLL_COMPID_DIV1] = {
@@ -317,7 +317,7 @@ static struct sama7g5_pll {
.t = PLL_TYPE_DIV,
.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
CLK_SET_RATE_PARENT,
- .eid = PMC_AUDIOIOPLL,
+ .eid = SAMA7G5_PMC_AUDIOIOPLL,
},
},
@@ -381,7 +381,7 @@ static struct {
.ep_mux_table = { 5, },
.ep_count = 1,
.ep_chg_id = INT_MIN,
- .eid = PMC_MCK1,
+ .eid = SAMA7G5_PMC_MCK1,
.c = 1, },
{ .n = "mck2",
@@ -997,7 +997,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
if (IS_ERR(regmap))
return;
- sama7g5_pmc = pmc_data_allocate(PMC_MCK1 + 1,
+ sama7g5_pmc = pmc_data_allocate(SAMA7G5_PMC_MCK1 + 1,
nck(sama7g5_systemck),
nck(sama7g5_periphck),
nck(sama7g5_gck), 8);
@@ -1030,7 +1030,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama7g5_pmc->chws[PMC_MAIN] = hw;
+ sama7g5_pmc->chws[SAMA7G5_PMC_MAIN] = hw;
for (i = 0; i < PLL_ID_MAX; i++) {
for (j = 0; j < PLL_COMPID_MAX; j++) {
@@ -1043,7 +1043,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
case PLL_TYPE_FRAC:
switch (sama7g5_plls[i][j].p) {
case SAMA7G5_PLL_PARENT_MAINCK:
- parent_hw = sama7g5_pmc->chws[PMC_MAIN];
+ parent_hw = sama7g5_pmc->chws[SAMA7G5_PMC_MAIN];
break;
case SAMA7G5_PLL_PARENT_MAIN_XTAL:
parent_hw = main_xtal_hw;
@@ -1092,11 +1092,11 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama7g5_mckx[PCK_PARENT_HW_MCK0].hw = sama7g5_pmc->chws[PMC_MCK] = hw;
+ sama7g5_mckx[PCK_PARENT_HW_MCK0].hw = sama7g5_pmc->chws[SAMA7G5_PMC_MCK0] = hw;
parent_hws[0] = md_slck_hw;
parent_hws[1] = td_slck_hw;
- parent_hws[2] = sama7g5_pmc->chws[PMC_MAIN];
+ parent_hws[2] = sama7g5_pmc->chws[SAMA7G5_PMC_MAIN];
for (i = PCK_PARENT_HW_MCK1; i < ARRAY_SIZE(sama7g5_mckx); i++) {
u8 num_parents = 3 + sama7g5_mckx[i].ep_count;
struct clk_hw *tmp_parent_hws[8];
@@ -1138,11 +1138,11 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
if (IS_ERR(hw))
goto err_free;
- sama7g5_pmc->chws[PMC_UTMI] = hw;
+ sama7g5_pmc->chws[SAMA7G5_PMC_UTMI] = hw;
parent_hws[0] = md_slck_hw;
parent_hws[1] = td_slck_hw;
- parent_hws[2] = sama7g5_pmc->chws[PMC_MAIN];
+ parent_hws[2] = sama7g5_pmc->chws[SAMA7G5_PMC_MAIN];
parent_hws[3] = sama7g5_plls[PLL_ID_SYS][PLL_COMPID_DIV0].hw;
parent_hws[4] = sama7g5_plls[PLL_ID_DDR][PLL_COMPID_DIV0].hw;
parent_hws[5] = sama7g5_plls[PLL_ID_IMG][PLL_COMPID_DIV0].hw;
@@ -1192,7 +1192,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
parent_hws[0] = md_slck_hw;
parent_hws[1] = td_slck_hw;
- parent_hws[2] = sama7g5_pmc->chws[PMC_MAIN];
+ parent_hws[2] = sama7g5_pmc->chws[SAMA7G5_PMC_MAIN];
for (i = 0; i < ARRAY_SIZE(sama7g5_gck); i++) {
u8 num_parents = 3 + sama7g5_gck[i].pp_count;
struct clk_hw *tmp_parent_hws[8];
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 05/16] clk: at91: Allow enabling main_rc_osc through DT
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (3 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 04/16] clk: at91: Use new per SoC PMC clock index definitions Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 06/16] clk: at91: Add peripheral clock id for OTPC Alexander Dahl
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Stephen Boyd, Brian Masney,
Jerome Brunet, Mihai Sain, Manikandan Muralidharan,
Durai Manickam KR
SAM9X60 Datasheet (DS60001579G) Section "23.4 Product Dependencies"
states:
"The OTPC is clocked through the Power Management Controller (PMC).
The user must power on the main RC oscillator and enable the
peripheral clock of the OTPC prior to reading or writing the OTP
memory."
The code for enabling/disabling the main rc oscillator clock is already
present, however, after the at91 clock device tree binding rework in
2018 (kernel v4.19), it was no longer possible to hook it up via DT.
Export the main RC oscillator for all SoCs featuring an OTPC controller
where the main RC oscillator is required for proper operation.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- reword commit message
v3:
- no changes
v2:
- split out dt-bindings changes into separate patch
- extend to drivers for other SoCs providing the OTPC
drivers/clk/at91/sam9x60.c | 1 +
drivers/clk/at91/sam9x7.c | 1 +
drivers/clk/at91/sama7d65.c | 1 +
drivers/clk/at91/sama7g5.c | 1 +
4 files changed, 4 insertions(+)
diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c
index eba6e8c16044d..4a7ff559522eb 100644
--- a/drivers/clk/at91/sam9x60.c
+++ b/drivers/clk/at91/sam9x60.c
@@ -227,6 +227,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np)
50000000);
if (IS_ERR(hw))
goto err_free;
+ sam9x60_pmc->chws[SAM9X60_PMC_MAIN_RC] = hw;
hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, 0);
if (IS_ERR(hw))
diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c
index 1fc4b01a04abf..194a8e44aa0ec 100644
--- a/drivers/clk/at91/sam9x7.c
+++ b/drivers/clk/at91/sam9x7.c
@@ -763,6 +763,7 @@ static void __init sam9x7_pmc_setup(struct device_node *np)
50000000);
if (IS_ERR(hw))
goto err_free;
+ sam9x7_pmc->chws[SAM9X7_PMC_MAIN_RC] = hw;
hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, 0);
if (IS_ERR(hw))
diff --git a/drivers/clk/at91/sama7d65.c b/drivers/clk/at91/sama7d65.c
index 0b5356467fa52..ef54d2fa6cf40 100644
--- a/drivers/clk/at91/sama7d65.c
+++ b/drivers/clk/at91/sama7d65.c
@@ -1138,6 +1138,7 @@ static void __init sama7d65_pmc_setup(struct device_node *np)
50000000);
if (IS_ERR(main_rc_hw))
goto err_free;
+ sama7d65_pmc->chws[SAMA7D65_PMC_MAIN_RC] = hw;
bypass = of_property_read_bool(np, "atmel,osc-bypass");
diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c
index 99b4c1d9bdcca..9a6f0f30b2b7e 100644
--- a/drivers/clk/at91/sama7g5.c
+++ b/drivers/clk/at91/sama7g5.c
@@ -1014,6 +1014,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
50000000);
if (IS_ERR(main_rc_hw))
goto err_free;
+ sama7g5_pmc->chws[SAMA7G5_PMC_MAIN_RC] = hw;
bypass = of_property_read_bool(np, "atmel,osc-bypass");
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 06/16] clk: at91: Add peripheral clock id for OTPC
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (4 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 05/16] clk: at91: Allow enabling main_rc_osc through DT Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 07/16] dt-bindings: nvmem: microchip-otpc: Add required clocks Alexander Dahl
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Stephen Boyd, Brian Masney,
Jerome Brunet, Mihai Sain, Durai Manickam KR,
Manikandan Muralidharan
Add the peripheral clock IDs for OTPC.
This clock is required for proper OTPC operation.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- Reword patch title and message
v3:
- no changes
v2:
- new patch in series, was not present in v1
drivers/clk/at91/sam9x60.c | 1 +
drivers/clk/at91/sam9x7.c | 1 +
drivers/clk/at91/sama7d65.c | 1 +
drivers/clk/at91/sama7g5.c | 1 +
4 files changed, 4 insertions(+)
diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c
index 4a7ff559522eb..b4cd001782604 100644
--- a/drivers/clk/at91/sam9x60.c
+++ b/drivers/clk/at91/sam9x60.c
@@ -146,6 +146,7 @@ static const struct {
{ .n = "isi_clk", .id = 43, },
{ .n = "pioD_clk", .id = 44, },
{ .n = "tcb1_clk", .id = 45, },
+ { .n = "otpc_clk", .id = 46, },
{ .n = "dbgu_clk", .id = 47, },
/*
* mpddr_clk feeds DDR controller and is enabled by bootloader thus we
diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c
index 194a8e44aa0ec..8edf62fb9f371 100644
--- a/drivers/clk/at91/sam9x7.c
+++ b/drivers/clk/at91/sam9x7.c
@@ -407,6 +407,7 @@ static const struct {
{ .n = "isi_clk", .id = 43, },
{ .n = "pioD_clk", .id = 44, },
{ .n = "tcb1_clk", .id = 45, },
+ { .n = "otpc_clk", .id = 46, },
{ .n = "dbgu_clk", .id = 47, },
{ .n = "pmecc_clk", .id = 48, },
/*
diff --git a/drivers/clk/at91/sama7d65.c b/drivers/clk/at91/sama7d65.c
index ef54d2fa6cf40..1f3c724739133 100644
--- a/drivers/clk/at91/sama7d65.c
+++ b/drivers/clk/at91/sama7d65.c
@@ -643,6 +643,7 @@ static struct {
{ .n = "mcan2_clk", .p = PCK_PARENT_HW_MCK5, .id = 60, .r = { .max = 200000000, }, },
{ .n = "mcan3_clk", .p = PCK_PARENT_HW_MCK5, .id = 61, .r = { .max = 200000000, }, },
{ .n = "mcan4_clk", .p = PCK_PARENT_HW_MCK5, .id = 62, .r = { .max = 200000000, }, },
+ { .n = "otpc_clk", .p = PCK_PARENT_HW_MCK0, .id = 63, },
{ .n = "pdmc0_clk", .p = PCK_PARENT_HW_MCK9, .id = 64, .r = { .max = 200000000, }, },
{ .n = "pdmc1_clk", .p = PCK_PARENT_HW_MCK9, .id = 65, .r = { .max = 200000000, }, },
{ .n = "pit64b0_clk", .p = PCK_PARENT_HW_MCK7, .id = 66, },
diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c
index 9a6f0f30b2b7e..3e0cfd2613851 100644
--- a/drivers/clk/at91/sama7g5.c
+++ b/drivers/clk/at91/sama7g5.c
@@ -504,6 +504,7 @@ static struct {
{ .n = "mcan3_clk", .p = PCK_PARENT_HW_MCK1, .id = 64, .r = { .max = 200000000, }, },
{ .n = "mcan4_clk", .p = PCK_PARENT_HW_MCK1, .id = 65, .r = { .max = 200000000, }, },
{ .n = "mcan5_clk", .p = PCK_PARENT_HW_MCK1, .id = 66, .r = { .max = 200000000, }, },
+ { .n = "otpc_clk", .p = PCK_PARENT_HW_MCK0, .id = 67, },
{ .n = "pdmc0_clk", .p = PCK_PARENT_HW_MCK1, .id = 68, .r = { .max = 200000000, }, },
{ .n = "pdmc1_clk", .p = PCK_PARENT_HW_MCK1, .id = 69, .r = { .max = 200000000, }, },
{ .n = "pit64b0_clk", .p = PCK_PARENT_HW_MCK1, .id = 70, },
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 07/16] dt-bindings: nvmem: microchip-otpc: Add required clocks
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (5 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 06/16] clk: at91: Add peripheral clock id for OTPC Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 08/16] nvmem: microchip-otpc: Avoid reading a write-only register Alexander Dahl
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Srinivas Kandagatla,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
The OTPC requires both the peripheral clock through PMC and the main RC
oscillator. Seemed to work without explicitly enabling those clocks on
sama7g5 before, but did not on sam9x60.
Older datasheets were not clear and explicit about this, but recent are,
e.g. SAMA7G5 series datasheet (DS60001765B),
section 30.4.1 Power Management:
> The OTPC is clocked through the Power Management Controller (PMC).
> The user must power on the main RC oscillator and enable the
> peripheral clock of the OTPC prior to reading or writing the OTP
> memory.
Confirmed by Microchip based on vendor internal documentation (see link).
Link: https://lore.kernel.org/linux-clk/ec34efc2-2051-4b8a-b5d8-6e2fd5e08c28@microchip.com/T/#u
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- Add clocks to the required section of the binding (Claudiu)
v3:
- Removed clock-names (led to confusion, and not used by the driver anyways)
- Removed redundant example
v2:
- new patch, not present in v1
.../bindings/nvmem/microchip,sama7g5-otpc.yaml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml
index cc25f2927682e..bef0246a79f16 100644
--- a/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml
+++ b/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml
@@ -27,14 +27,22 @@ properties:
reg:
maxItems: 1
+ clocks:
+ items:
+ - description: main rc oscillator
+ - description: otpc peripheral clock
+
required:
- compatible
- reg
+ - clocks
unevaluatedProperties: false
examples:
- |
+ #include <dt-bindings/clock/at91.h>
+ #include <dt-bindings/clock/microchip,sama7g5-pmc.h>
#include <dt-bindings/nvmem/microchip,sama7g5-otpc.h>
otpc: efuse@e8c00000 {
@@ -42,6 +50,7 @@ examples:
reg = <0xe8c00000 0xec>;
#address-cells = <1>;
#size-cells = <1>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_MAIN_RC>, <&pmc PMC_TYPE_PERIPHERAL 67>;
temperature_calib: calib@1 {
reg = <OTP_PKT(1) 76>;
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 08/16] nvmem: microchip-otpc: Avoid reading a write-only register
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (6 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 07/16] dt-bindings: nvmem: microchip-otpc: Add required clocks Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 09/16] nvmem: microchip-otpc: Fix swapped 'sleep' and 'timeout' parameters Alexander Dahl
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, stable, Srinivas Kandagatla,
Greg Kroah-Hartman
The OTPC Control Register (OTPC_CR) has just write-only members.
Reading from that register leads to a warning in OTPC Write Protection
Status Register (OTPC_WPSR) in field Software Error Type (SWETYP) of
type READ_WO (A write-only register has been read (warning).)
Just create the register write content from scratch is sufficient here.
Fixes: 98830350d3fc ("nvmem: microchip-otpc: add support")
Cc: stable@vger.kernel.org
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- Add Reviewed-by tag (thanks Claudiu)
v3:
- Reorder tags
- Add stable tag
v2:
- Add Fixes tag
- Remove temporary variable usage
- Reword misleading subject (s/writing/reading/)
drivers/nvmem/microchip-otpc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/nvmem/microchip-otpc.c b/drivers/nvmem/microchip-otpc.c
index df979e8549fdb..e2851c63cc0b4 100644
--- a/drivers/nvmem/microchip-otpc.c
+++ b/drivers/nvmem/microchip-otpc.c
@@ -82,9 +82,7 @@ static int mchp_otpc_prepare_read(struct mchp_otpc *otpc,
writel_relaxed(tmp, otpc->base + MCHP_OTPC_MR);
/* Set read. */
- tmp = readl_relaxed(otpc->base + MCHP_OTPC_CR);
- tmp |= MCHP_OTPC_CR_READ;
- writel_relaxed(tmp, otpc->base + MCHP_OTPC_CR);
+ writel_relaxed(MCHP_OTPC_CR_READ, otpc->base + MCHP_OTPC_CR);
/* Wait for packet to be transferred into temporary buffers. */
return read_poll_timeout(readl_relaxed, tmp, !(tmp & MCHP_OTPC_SR_READ),
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 09/16] nvmem: microchip-otpc: Fix swapped 'sleep' and 'timeout' parameters
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (7 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 08/16] nvmem: microchip-otpc: Avoid reading a write-only register Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 10/16] nvmem: microchip-otpc: Enable necessary clocks Alexander Dahl
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, stable, Srinivas Kandagatla,
Greg Kroah-Hartman
Makes no sense to have a timeout shorter than the sleep time, it would
run into timeout right after the first sleep already.
While at it, use a more specific macro instead of the generic one, which
does exactly the same, but needs less parameters.
Fixes: 98830350d3fc ("nvmem: microchip-otpc: add support")
Cc: stable@vger.kernel.org
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- Add Reviewed-by tag (thanks Claudiu)
v3:
- Reorder tags
- Add stable tag
v2:
- Add Fixes tag
drivers/nvmem/microchip-otpc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nvmem/microchip-otpc.c b/drivers/nvmem/microchip-otpc.c
index e2851c63cc0b4..bf7e5167152cb 100644
--- a/drivers/nvmem/microchip-otpc.c
+++ b/drivers/nvmem/microchip-otpc.c
@@ -85,8 +85,8 @@ static int mchp_otpc_prepare_read(struct mchp_otpc *otpc,
writel_relaxed(MCHP_OTPC_CR_READ, otpc->base + MCHP_OTPC_CR);
/* Wait for packet to be transferred into temporary buffers. */
- return read_poll_timeout(readl_relaxed, tmp, !(tmp & MCHP_OTPC_SR_READ),
- 10000, 2000, false, otpc->base + MCHP_OTPC_SR);
+ return readl_relaxed_poll_timeout(otpc->base + MCHP_OTPC_SR, tmp,
+ !(tmp & MCHP_OTPC_SR_READ), 2000, 10000);
}
/*
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 10/16] nvmem: microchip-otpc: Enable necessary clocks
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (8 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 09/16] nvmem: microchip-otpc: Fix swapped 'sleep' and 'timeout' parameters Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 11/16] nvmem: microchip-otpc: Expose UID registers as 2nd nvmem device Alexander Dahl
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Srinivas Kandagatla
Without enabling the main rc clock, initializing the packet list leads
to a read timeout on the first packet, at least on sam9x60.
According to SAM9X60 datasheet (DS60001579G) section "23.4 Product
Dependencies" the clock must be enabled for reading and writing.
Tested on sam9x60-curiosity board.
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- Removed link from commit message and added Reviewed-by (thanks Claudiu)
v3:
- Rewrap lines
v2:
- Rewrite to enable _all_ clocks defined in dts
drivers/nvmem/microchip-otpc.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/nvmem/microchip-otpc.c b/drivers/nvmem/microchip-otpc.c
index bf7e5167152cb..4286365686563 100644
--- a/drivers/nvmem/microchip-otpc.c
+++ b/drivers/nvmem/microchip-otpc.c
@@ -8,6 +8,7 @@
*/
#include <linux/bitfield.h>
+#include <linux/clk.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/nvmem-provider.h>
@@ -241,6 +242,7 @@ static struct nvmem_config mchp_nvmem_config = {
static int mchp_otpc_probe(struct platform_device *pdev)
{
struct nvmem_device *nvmem;
+ struct clk_bulk_data *clks;
struct mchp_otpc *otpc;
u32 size;
int ret;
@@ -253,6 +255,10 @@ static int mchp_otpc_probe(struct platform_device *pdev)
if (IS_ERR(otpc->base))
return PTR_ERR(otpc->base);
+ ret = devm_clk_bulk_get_all_enabled(&pdev->dev, &clks);
+ if (ret < 0)
+ return dev_err_probe(&pdev->dev, ret, "Error getting clocks!\n");
+
otpc->dev = &pdev->dev;
ret = mchp_otpc_init_packets_list(otpc, &size);
if (ret)
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 11/16] nvmem: microchip-otpc: Expose UID registers as 2nd nvmem device
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (9 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 10/16] nvmem: microchip-otpc: Enable necessary clocks Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 12/16] ARM: dts: microchip: Use new per SoC PMC bindings Alexander Dahl
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Srinivas Kandagatla
For SAM9X60 and SAMA7G5 the Product UID x Register containing the Unique
Product ID is part of the OTPC registers. Expose this unique id as
trivial nvmem device in a similar fashion like the soc sfr driver on
SAMA5D2 does.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- Add missing include header for iomem access (thanks Claudiu)
- Reword commit message
v3:
- no changes
v2:
- Use dev_err_probe() for error reporting (thanks Claudiu)
- Move required register definition over here from removed patch
drivers/nvmem/microchip-otpc.c | 39 +++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
diff --git a/drivers/nvmem/microchip-otpc.c b/drivers/nvmem/microchip-otpc.c
index 4286365686563..e10291f59a3b7 100644
--- a/drivers/nvmem/microchip-otpc.c
+++ b/drivers/nvmem/microchip-otpc.c
@@ -9,6 +9,7 @@
#include <linux/bitfield.h>
#include <linux/clk.h>
+#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/nvmem-provider.h>
@@ -25,10 +26,14 @@
#define MCHP_OTPC_HR (0x20)
#define MCHP_OTPC_HR_SIZE GENMASK(15, 8)
#define MCHP_OTPC_DR (0x24)
+#define MCHP_OTPC_UID0R (0x60)
#define MCHP_OTPC_NAME "mchp-otpc"
#define MCHP_OTPC_SIZE (11 * 1024)
+#define MCHP_OTPC_UID_NAME "mchp-uid"
+#define MCHP_OTPC_UID_SIZE 16
+
/**
* struct mchp_otpc - OTPC private data structure
* @base: base address
@@ -230,6 +235,16 @@ static int mchp_otpc_init_packets_list(struct mchp_otpc *otpc, u32 *size)
return 0;
}
+static int mchp_otpc_uid_read(void *priv, unsigned int offset,
+ void *val, size_t bytes)
+{
+ struct mchp_otpc *otpc = priv;
+
+ memcpy_fromio(val, otpc->base + MCHP_OTPC_UID0R + offset, bytes);
+
+ return 0;
+}
+
static struct nvmem_config mchp_nvmem_config = {
.name = MCHP_OTPC_NAME,
.type = NVMEM_TYPE_OTP,
@@ -239,6 +254,15 @@ static struct nvmem_config mchp_nvmem_config = {
.reg_read = mchp_otpc_read,
};
+static struct nvmem_config mchp_otpc_uid_nvmem_config = {
+ .name = MCHP_OTPC_UID_NAME,
+ .read_only = true,
+ .word_size = 4,
+ .stride = 4,
+ .size = MCHP_OTPC_UID_SIZE,
+ .reg_read = mchp_otpc_uid_read,
+};
+
static int mchp_otpc_probe(struct platform_device *pdev)
{
struct nvmem_device *nvmem;
@@ -269,8 +293,21 @@ static int mchp_otpc_probe(struct platform_device *pdev)
mchp_nvmem_config.size = size;
mchp_nvmem_config.priv = otpc;
nvmem = devm_nvmem_register(&pdev->dev, &mchp_nvmem_config);
+ if (IS_ERR(nvmem)) {
+ return dev_err_probe(&pdev->dev, PTR_ERR(nvmem),
+ "Error registering OTP as nvmem device\n");
+ }
- return PTR_ERR_OR_ZERO(nvmem);
+ mchp_otpc_uid_nvmem_config.dev = otpc->dev;
+ mchp_otpc_uid_nvmem_config.priv = otpc;
+
+ nvmem = devm_nvmem_register(&pdev->dev, &mchp_otpc_uid_nvmem_config);
+ if (IS_ERR(nvmem)) {
+ return dev_err_probe(&pdev->dev, PTR_ERR(nvmem),
+ "Error registering UIDxR as nvmem device\n");
+ }
+
+ return 0;
}
static const struct of_device_id __maybe_unused mchp_otpc_ids[] = {
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 12/16] ARM: dts: microchip: Use new per SoC PMC bindings
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (10 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 11/16] nvmem: microchip-otpc: Expose UID registers as 2nd nvmem device Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 13/16] ARM: dts: microchip: sama7g5: Add OTPC clocks Alexander Dahl
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
The bindings were split up per SoC before adding new members for
missing clocks.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- Adapted to renamed defines
v3:
- extend to all at91 family SoCs
v2:
- new patch, not present in v1
arch/arm/boot/dts/microchip/at91rm9200.dtsi | 3 ++-
arch/arm/boot/dts/microchip/at91sam9260.dtsi | 19 ++++++++-------
arch/arm/boot/dts/microchip/at91sam9261.dtsi | 7 +++---
arch/arm/boot/dts/microchip/at91sam9263.dtsi | 9 +++----
arch/arm/boot/dts/microchip/at91sam9g45.dtsi | 11 +++++----
arch/arm/boot/dts/microchip/at91sam9n12.dtsi | 7 +++---
arch/arm/boot/dts/microchip/at91sam9rl.dtsi | 9 +++----
arch/arm/boot/dts/microchip/at91sam9x5.dtsi | 11 +++++----
arch/arm/boot/dts/microchip/sam9x60.dtsi | 15 ++++++------
arch/arm/boot/dts/microchip/sam9x7.dtsi | 13 +++++-----
arch/arm/boot/dts/microchip/sama5d2.dtsi | 25 ++++++++++----------
arch/arm/boot/dts/microchip/sama5d3.dtsi | 9 +++----
arch/arm/boot/dts/microchip/sama5d4.dtsi | 9 +++----
arch/arm/boot/dts/microchip/sama7d65.dtsi | 15 ++++++------
arch/arm/boot/dts/microchip/sama7g5.dtsi | 23 +++++++++---------
15 files changed, 100 insertions(+), 85 deletions(-)
diff --git a/arch/arm/boot/dts/microchip/at91rm9200.dtsi b/arch/arm/boot/dts/microchip/at91rm9200.dtsi
index e105ad855ce8b..f158c1d70ac2d 100644
--- a/arch/arm/boot/dts/microchip/at91rm9200.dtsi
+++ b/arch/arm/boot/dts/microchip/at91rm9200.dtsi
@@ -13,6 +13,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91rm9200-pmc.h>
#include <dt-bindings/mfd/at91-usart.h>
/ {
@@ -601,7 +602,7 @@ dbgu: serial@fffff200 {
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_dbgu>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91RM9200_PMC_MCK>;
clock-names = "usart";
status = "disabled";
};
diff --git a/arch/arm/boot/dts/microchip/at91sam9260.dtsi b/arch/arm/boot/dts/microchip/at91sam9260.dtsi
index fc0b6a73204f8..76184155e6746 100644
--- a/arch/arm/boot/dts/microchip/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/microchip/at91sam9260.dtsi
@@ -11,6 +11,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91sam9260-pmc.h>
#include <dt-bindings/mfd/at91-usart.h>
/ {
@@ -127,20 +128,20 @@ pmc: clock-controller@fffffc00 {
reset-controller@fffffd00 {
compatible = "atmel,at91sam9260-rstc";
reg = <0xfffffd00 0x10>;
- clocks = <&pmc PMC_TYPE_CORE PMC_SLOW>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_SLOW>;
};
shdwc: poweroff@fffffd10 {
compatible = "atmel,at91sam9260-shdwc";
reg = <0xfffffd10 0x10>;
- clocks = <&pmc PMC_TYPE_CORE PMC_SLOW>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_SLOW>;
};
pit: timer@fffffd30 {
compatible = "atmel,at91sam9260-pit";
reg = <0xfffffd30 0xf>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_MCK>;
};
tcb0: timer@fffa0000 {
@@ -151,7 +152,7 @@ tcb0: timer@fffa0000 {
interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>,
<18 IRQ_TYPE_LEVEL_HIGH 0>,
<19 IRQ_TYPE_LEVEL_HIGH 0>;
- clocks = <&pmc PMC_TYPE_PERIPHERAL 17>, <&pmc PMC_TYPE_PERIPHERAL 18>, <&pmc PMC_TYPE_PERIPHERAL 19>, <&pmc PMC_TYPE_CORE PMC_SLOW>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 17>, <&pmc PMC_TYPE_PERIPHERAL 18>, <&pmc PMC_TYPE_PERIPHERAL 19>, <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_SLOW>;
clock-names = "t0_clk", "t1_clk", "t2_clk", "slow_clk";
};
@@ -163,7 +164,7 @@ tcb1: timer@fffdc000 {
interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>,
<27 IRQ_TYPE_LEVEL_HIGH 0>,
<28 IRQ_TYPE_LEVEL_HIGH 0>;
- clocks = <&pmc PMC_TYPE_PERIPHERAL 26>, <&pmc PMC_TYPE_PERIPHERAL 27>, <&pmc PMC_TYPE_PERIPHERAL 28>, <&pmc PMC_TYPE_CORE PMC_SLOW>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 26>, <&pmc PMC_TYPE_PERIPHERAL 27>, <&pmc PMC_TYPE_PERIPHERAL 28>, <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_SLOW>;
clock-names = "t0_clk", "t1_clk", "t2_clk", "slow_clk";
};
@@ -537,7 +538,7 @@ dbgu: serial@fffff200 {
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_dbgu>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_MCK>;
clock-names = "usart";
status = "disabled";
};
@@ -720,7 +721,7 @@ rtc@fffffd20 {
compatible = "atmel,at91sam9260-rtt";
reg = <0xfffffd20 0x10>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
- clocks = <&pmc PMC_TYPE_CORE PMC_SLOW>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_SLOW>;
status = "disabled";
};
@@ -728,7 +729,7 @@ watchdog: watchdog@fffffd40 {
compatible = "atmel,at91sam9260-wdt";
reg = <0xfffffd40 0x10>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
- clocks = <&pmc PMC_TYPE_CORE PMC_SLOW>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_SLOW>;
atmel,watchdog-type = "hardware";
atmel,reset-type = "all";
atmel,dbg-halt;
@@ -766,7 +767,7 @@ ebi: ebi@10000000 {
0x5 0x0 0x60000000 0x10000000
0x6 0x0 0x70000000 0x10000000
0x7 0x0 0x80000000 0x10000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_MCK>;
status = "disabled";
nand_controller: nand-controller {
diff --git a/arch/arm/boot/dts/microchip/at91sam9261.dtsi b/arch/arm/boot/dts/microchip/at91sam9261.dtsi
index d1d678b77e84b..57643738b7c9a 100644
--- a/arch/arm/boot/dts/microchip/at91sam9261.dtsi
+++ b/arch/arm/boot/dts/microchip/at91sam9261.dtsi
@@ -9,6 +9,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91sam9260-pmc.h>
#include <dt-bindings/mfd/at91-usart.h>
/ {
@@ -112,7 +113,7 @@ ebi: ebi@10000000 {
0x5 0x0 0x60000000 0x10000000
0x6 0x0 0x70000000 0x10000000
0x7 0x0 0x80000000 0x10000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_MCK>;
status = "disabled";
nand_controller: nand-controller {
@@ -309,7 +310,7 @@ dbgu: serial@fffff200 {
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_dbgu>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_MCK>;
clock-names = "usart";
status = "disabled";
};
@@ -624,7 +625,7 @@ pit: timer@fffffd30 {
compatible = "atmel,at91sam9260-pit";
reg = <0xfffffd30 0xf>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_MCK>;
};
rtc@fffffd20 {
diff --git a/arch/arm/boot/dts/microchip/at91sam9263.dtsi b/arch/arm/boot/dts/microchip/at91sam9263.dtsi
index a4b5d1f228f9c..48feaa2415bb6 100644
--- a/arch/arm/boot/dts/microchip/at91sam9263.dtsi
+++ b/arch/arm/boot/dts/microchip/at91sam9263.dtsi
@@ -9,6 +9,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91sam9260-pmc.h>
#include <dt-bindings/mfd/at91-usart.h>
/ {
@@ -139,7 +140,7 @@ pit: timer@fffffd30 {
compatible = "atmel,at91sam9260-pit";
reg = <0xfffffd30 0xf>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_MCK>;
};
tcb0: timer@fff7c000 {
@@ -545,7 +546,7 @@ dbgu: serial@ffffee00 {
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_dbgu>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_MCK>;
clock-names = "usart";
status = "disabled";
};
@@ -790,7 +791,7 @@ ebi0: ebi@10000000 {
0x3 0x0 0x40000000 0x10000000
0x4 0x0 0x50000000 0x10000000
0x5 0x0 0x60000000 0x10000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_MCK>;
status = "disabled";
nand_controller0: nand-controller {
@@ -811,7 +812,7 @@ ebi1: ebi@70000000 {
reg = <0x80000000 0x20000000>;
ranges = <0x0 0x0 0x80000000 0x10000000
0x1 0x0 0x90000000 0x10000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9260_PMC_MCK>;
status = "disabled";
nand_controller1: nand-controller {
diff --git a/arch/arm/boot/dts/microchip/at91sam9g45.dtsi b/arch/arm/boot/dts/microchip/at91sam9g45.dtsi
index 4e00ed2d3ecdf..edc703e2a003d 100644
--- a/arch/arm/boot/dts/microchip/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/microchip/at91sam9g45.dtsi
@@ -13,6 +13,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91sam9g45-pmc.h>
#include <dt-bindings/mfd/at91-usart.h>
/ {
@@ -148,7 +149,7 @@ pit: timer@fffffd30 {
compatible = "atmel,at91sam9260-pit";
reg = <0xfffffd30 0xf>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9G45_PMC_MCK>;
};
@@ -681,7 +682,7 @@ dbgu: serial@ffffee00 {
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_dbgu>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9G45_PMC_MCK>;
clock-names = "usart";
status = "disabled";
};
@@ -918,7 +919,7 @@ usb2: gadget@fff78000 {
reg = <0x00600000 0x80000
0xfff78000 0x400>;
interrupts = <27 IRQ_TYPE_LEVEL_HIGH 0>;
- clocks = <&pmc PMC_TYPE_PERIPHERAL 27>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 27>, <&pmc PMC_TYPE_CORE AT91SAM9G45_PMC_UPLLCK>;
clock-names = "pclk", "hclk";
status = "disabled";
};
@@ -977,7 +978,7 @@ usb1: usb@800000 {
compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
reg = <0x00800000 0x100000>;
interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
- clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_PERIPHERAL 22>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9G45_PMC_UPLLCK>, <&pmc PMC_TYPE_PERIPHERAL 22>;
clock-names = "usb_clk", "ehci_clk";
status = "disabled";
};
@@ -995,7 +996,7 @@ ebi: ebi@10000000 {
0x3 0x0 0x40000000 0x10000000
0x4 0x0 0x50000000 0x10000000
0x5 0x0 0x60000000 0x10000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9G45_PMC_MCK>;
status = "disabled";
nand_controller: nand-controller {
diff --git a/arch/arm/boot/dts/microchip/at91sam9n12.dtsi b/arch/arm/boot/dts/microchip/at91sam9n12.dtsi
index af41c3dbb4bfb..ee7027387292f 100644
--- a/arch/arm/boot/dts/microchip/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/microchip/at91sam9n12.dtsi
@@ -11,6 +11,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91sam9n12-pmc.h>
#include <dt-bindings/mfd/at91-usart.h>
/ {
@@ -137,7 +138,7 @@ pit: timer@fffffe30 {
compatible = "atmel,at91sam9260-pit";
reg = <0xfffffe30 0xf>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9N12_PMC_MCK>;
};
poweroff@fffffe10 {
@@ -581,7 +582,7 @@ dbgu: serial@fffff200 {
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_dbgu>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9N12_PMC_MCK>;
clock-names = "usart";
status = "disabled";
};
@@ -770,7 +771,7 @@ ebi: ebi@10000000 {
0x3 0x0 0x40000000 0x10000000
0x4 0x0 0x50000000 0x10000000
0x5 0x0 0x60000000 0x10000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9N12_PMC_MCK>;
status = "disabled";
nand_controller: nand-controller {
diff --git a/arch/arm/boot/dts/microchip/at91sam9rl.dtsi b/arch/arm/boot/dts/microchip/at91sam9rl.dtsi
index de74cf2980a04..78ede09d34861 100644
--- a/arch/arm/boot/dts/microchip/at91sam9rl.dtsi
+++ b/arch/arm/boot/dts/microchip/at91sam9rl.dtsi
@@ -8,6 +8,7 @@
#include <dt-bindings/pinctrl/at91.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91sam9rl-pmc.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pwm/pwm.h>
@@ -112,7 +113,7 @@ ebi: ebi@10000000 {
0x3 0x0 0x40000000 0x10000000
0x4 0x0 0x50000000 0x10000000
0x5 0x0 0x60000000 0x10000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9RL_PMC_MCK>;
status = "disabled";
nand_controller: nand-controller {
@@ -287,7 +288,7 @@ usb0: gadget@fffd4000 {
reg = <0x00600000 0x100000>,
<0xfffd4000 0x4000>;
interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
- clocks = <&pmc PMC_TYPE_PERIPHERAL 22>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 22>, <&pmc PMC_TYPE_CORE AT91SAM9RL_PMC_UTMI>;
clock-names = "pclk", "hclk";
status = "disabled";
};
@@ -331,7 +332,7 @@ dbgu: serial@fffff200 {
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_dbgu>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9RL_PMC_MCK>;
clock-names = "usart";
status = "disabled";
};
@@ -788,7 +789,7 @@ pit: timer@fffffd30 {
compatible = "atmel,at91sam9260-pit";
reg = <0xfffffd30 0xf>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9RL_PMC_MCK>;
};
watchdog@fffffd40 {
diff --git a/arch/arm/boot/dts/microchip/at91sam9x5.dtsi b/arch/arm/boot/dts/microchip/at91sam9x5.dtsi
index 9070fd06995a0..bae6c510364cb 100644
--- a/arch/arm/boot/dts/microchip/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/microchip/at91sam9x5.dtsi
@@ -13,6 +13,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,at91sam9x5-pmc.h>
#include <dt-bindings/mfd/at91-usart.h>
/ {
@@ -151,7 +152,7 @@ pit: timer@fffffe30 {
compatible = "atmel,at91sam9260-pit";
reg = <0xfffffe30 0xf>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9X5_PMC_MCK>;
};
clk32k: clock-controller@fffffe50 {
@@ -682,7 +683,7 @@ dbgu: serial@fffff200 {
dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(8)>,
<&dma1 1 (AT91_DMA_CFG_PER_ID(9) | AT91_DMA_CFG_FIFOCFG_ASAP)>;
dma-names = "tx", "rx";
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9X5_PMC_MCK>;
clock-names = "usart";
status = "disabled";
};
@@ -852,7 +853,7 @@ usb2: gadget@f803c000 {
reg = <0x00500000 0x80000
0xf803c000 0x400>;
interrupts = <23 IRQ_TYPE_LEVEL_HIGH 0>;
- clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_PERIPHERAL 23>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9X5_PMC_UPLLCK>, <&pmc PMC_TYPE_PERIPHERAL 23>;
clock-names = "hclk", "pclk";
status = "disabled";
};
@@ -899,7 +900,7 @@ usb1: usb@700000 {
compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
reg = <0x00700000 0x100000>;
interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
- clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_PERIPHERAL 22>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9X5_PMC_UPLLCK>, <&pmc PMC_TYPE_PERIPHERAL 22>;
clock-names = "usb_clk", "ehci_clk";
status = "disabled";
};
@@ -917,7 +918,7 @@ ebi: ebi@10000000 {
0x3 0x0 0x40000000 0x10000000
0x4 0x0 0x50000000 0x10000000
0x5 0x0 0x60000000 0x10000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE AT91SAM9X5_PMC_MCK>;
status = "disabled";
nand_controller: nand-controller {
diff --git a/arch/arm/boot/dts/microchip/sam9x60.dtsi b/arch/arm/boot/dts/microchip/sam9x60.dtsi
index e708b3df4ccd3..4b777c61c1e09 100644
--- a/arch/arm/boot/dts/microchip/sam9x60.dtsi
+++ b/arch/arm/boot/dts/microchip/sam9x60.dtsi
@@ -12,6 +12,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/microchip,sam9x60-pmc.h>
#include <dt-bindings/mfd/at91-usart.h>
#include <dt-bindings/mfd/atmel-flexcom.h>
@@ -79,9 +80,9 @@ usb0: gadget@500000 {
reg = <0x00500000 0x100000
0xf803c000 0x400>;
interrupts = <23 IRQ_TYPE_LEVEL_HIGH 2>;
- clocks = <&pmc PMC_TYPE_PERIPHERAL 23>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 23>, <&pmc PMC_TYPE_CORE SAM9X60_PMC_UPLLCK>;
clock-names = "pclk", "hclk";
- assigned-clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ assigned-clocks = <&pmc PMC_TYPE_CORE SAM9X60_PMC_UPLLCK>;
assigned-clock-rates = <480000000>;
status = "disabled";
};
@@ -99,9 +100,9 @@ usb2: usb@700000 {
compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
reg = <0x00700000 0x100000>;
interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
- clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_PERIPHERAL 22>;
+ clocks = <&pmc PMC_TYPE_CORE SAM9X60_PMC_UPLLCK>, <&pmc PMC_TYPE_PERIPHERAL 22>;
clock-names = "usb_clk", "ehci_clk";
- assigned-clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ assigned-clocks = <&pmc PMC_TYPE_CORE SAM9X60_PMC_UPLLCK>;
assigned-clock-rates = <480000000>;
status = "disabled";
};
@@ -119,7 +120,7 @@ ebi: ebi@10000000 {
0x3 0x0 0x40000000 0x10000000
0x4 0x0 0x50000000 0x10000000
0x5 0x0 0x60000000 0x10000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE SAM9X60_PMC_MCK>;
status = "disabled";
nand_controller: nand-controller {
@@ -1061,7 +1062,7 @@ hlcdc: hlcdc@f8038000 {
clocks = <&pmc PMC_TYPE_PERIPHERAL 25>, <&pmc PMC_TYPE_GCK 25>, <&clk32k 1>;
clock-names = "periph_clk","sys_clk", "slow_clk";
assigned-clocks = <&pmc PMC_TYPE_GCK 25>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAM9X60_PMC_MCK>;
status = "disabled";
hlcdc-display-controller {
@@ -1367,7 +1368,7 @@ pit: timer@fffffe40 {
compatible = "atmel,at91sam9260-pit";
reg = <0xfffffe40 0x10>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE SAM9X60_PMC_MCK>;
};
clk32k: clock-controller@fffffe50 {
diff --git a/arch/arm/boot/dts/microchip/sam9x7.dtsi b/arch/arm/boot/dts/microchip/sam9x7.dtsi
index c680a5033b6b4..76294dd6c4771 100644
--- a/arch/arm/boot/dts/microchip/sam9x7.dtsi
+++ b/arch/arm/boot/dts/microchip/sam9x7.dtsi
@@ -8,6 +8,7 @@
*/
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/microchip,sam9x7-pmc.h>
#include <dt-bindings/dma/at91.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -288,7 +289,7 @@ AT91_XDMAC_DT_PERID(26))>,
clocks = <&pmc PMC_TYPE_PERIPHERAL 35>, <&pmc PMC_TYPE_GCK 35>;
clock-names = "pclk", "gclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 35>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_PLLADIV2>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAM9X7_PMC_PLLADIV2>;
status = "disabled";
};
@@ -500,9 +501,9 @@ can0: can@f8000000 {
interrupt-names = "int0", "int1";
clocks = <&pmc PMC_TYPE_PERIPHERAL 29>, <&pmc PMC_TYPE_GCK 29>;
clock-names = "hclk", "cclk";
- assigned-clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_GCK 29>;
+ assigned-clocks = <&pmc PMC_TYPE_CORE SAM9X7_PMC_UPLLCK>, <&pmc PMC_TYPE_GCK 29>;
assigned-clock-rates = <480000000>, <40000000>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAM9X7_PMC_UPLLCK>, <&pmc PMC_TYPE_CORE SAM9X7_PMC_UPLLCK>;
bosch,mram-cfg = <0x3400 0 0 64 0 0 32 32>;
status = "disabled";
};
@@ -516,9 +517,9 @@ can1: can@f8004000 {
interrupt-names = "int0", "int1";
clocks = <&pmc PMC_TYPE_PERIPHERAL 30>, <&pmc PMC_TYPE_GCK 30>;
clock-names = "hclk", "cclk";
- assigned-clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_GCK 30>;
+ assigned-clocks = <&pmc PMC_TYPE_CORE SAM9X7_PMC_UPLLCK>, <&pmc PMC_TYPE_GCK 30>;
assigned-clock-rates = <480000000>, <40000000>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAM9X7_PMC_UPLLCK>, <&pmc PMC_TYPE_CORE SAM9X7_PMC_UPLLCK>;
bosch,mram-cfg = <0x7800 0 0 64 0 0 32 32>;
status = "disabled";
};
@@ -1158,7 +1159,7 @@ pmecc: ecc-engine@ffffe000 {
mpddrc: mpddrc@ffffe800 {
compatible = "microchip,sam9x7-ddramc", "atmel,sama5d3-ddramc";
reg = <0xffffe800 0x200>;
- clocks = <&pmc PMC_TYPE_SYSTEM 2>, <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_SYSTEM 2>, <&pmc PMC_TYPE_CORE SAM9X7_PMC_MCK>;
clock-names = "ddrck", "mpddr";
};
diff --git a/arch/arm/boot/dts/microchip/sama5d2.dtsi b/arch/arm/boot/dts/microchip/sama5d2.dtsi
index fde890f18d201..f23280f04e5c6 100644
--- a/arch/arm/boot/dts/microchip/sama5d2.dtsi
+++ b/arch/arm/boot/dts/microchip/sama5d2.dtsi
@@ -9,6 +9,7 @@
#include <dt-bindings/dma/at91.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,sama5d2-pmc.h>
#include <dt-bindings/mfd/at91-usart.h>
#include <dt-bindings/iio/adc/at91-sama5d2_adc.h>
@@ -47,7 +48,7 @@ etb@740000 {
compatible = "arm,coresight-etb10", "arm,primecell";
reg = <0x740000 0x1000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA5D2_PMC_MCK>;
clock-names = "apb_pclk";
in-ports {
@@ -63,7 +64,7 @@ etm@73c000 {
compatible = "arm,coresight-etm3x", "arm,primecell";
reg = <0x73c000 0x1000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA5D2_PMC_MCK>;
clock-names = "apb_pclk";
out-ports {
@@ -133,7 +134,7 @@ usb0: gadget@300000 {
reg = <0x00300000 0x100000
0xfc02c000 0x400>;
interrupts = <42 IRQ_TYPE_LEVEL_HIGH 2>;
- clocks = <&pmc PMC_TYPE_PERIPHERAL 42>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 42>, <&pmc PMC_TYPE_CORE SAMA5D2_PMC_UPLLCK>;
clock-names = "pclk", "hclk";
status = "disabled";
};
@@ -151,7 +152,7 @@ usb2: usb@500000 {
compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
reg = <0x00500000 0x100000>;
interrupts = <41 IRQ_TYPE_LEVEL_HIGH 2>;
- clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_PERIPHERAL 41>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA5D2_PMC_UPLLCK>, <&pmc PMC_TYPE_PERIPHERAL 41>;
clock-names = "usb_clk", "ehci_clk";
status = "disabled";
};
@@ -176,7 +177,7 @@ ebi: ebi@10000000 {
0x1 0x0 0x60000000 0x10000000
0x2 0x0 0x70000000 0x10000000
0x3 0x0 0x80000000 0x10000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK2>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA5D2_PMC_MCK2>;
status = "disabled";
nand_controller: nand-controller {
@@ -195,7 +196,7 @@ sdmmc0: sdio-host@a0000000 {
compatible = "atmel,sama5d2-sdhci";
reg = <0xa0000000 0x300>;
interrupts = <31 IRQ_TYPE_LEVEL_HIGH 0>;
- clocks = <&pmc PMC_TYPE_PERIPHERAL 31>, <&pmc PMC_TYPE_GCK 31>, <&pmc PMC_TYPE_CORE PMC_MAIN>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 31>, <&pmc PMC_TYPE_GCK 31>, <&pmc PMC_TYPE_CORE SAMA5D2_PMC_MAIN>;
clock-names = "hclock", "multclk", "baseclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 31>;
assigned-clock-rates = <480000000>;
@@ -206,7 +207,7 @@ sdmmc1: sdio-host@b0000000 {
compatible = "atmel,sama5d2-sdhci";
reg = <0xb0000000 0x300>;
interrupts = <32 IRQ_TYPE_LEVEL_HIGH 0>;
- clocks = <&pmc PMC_TYPE_PERIPHERAL 32>, <&pmc PMC_TYPE_GCK 32>, <&pmc PMC_TYPE_CORE PMC_MAIN>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 32>, <&pmc PMC_TYPE_GCK 32>, <&pmc PMC_TYPE_CORE SAMA5D2_PMC_MAIN>;
clock-names = "hclock", "multclk", "baseclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 32>;
assigned-clock-rates = <480000000>;
@@ -696,7 +697,7 @@ pit: timer@f8048030 {
compatible = "atmel,at91sam9260-pit";
reg = <0xf8048030 0x10>;
interrupts = <3 IRQ_TYPE_LEVEL_HIGH 5>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK2>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA5D2_PMC_MCK2>;
};
watchdog: watchdog@f8048040 {
@@ -734,7 +735,7 @@ AT91_XDMAC_DT_PERID(31))>,
dma-names = "tx", "rx";
clocks = <&pmc PMC_TYPE_PERIPHERAL 54>, <&pmc PMC_TYPE_GCK 54>;
clock-names = "pclk", "gclk";
- assigned-clocks = <&pmc PMC_TYPE_CORE PMC_I2S0_MUX>;
+ assigned-clocks = <&pmc PMC_TYPE_CORE SAMA5D2_PMC_I2S0_MUX>;
assigned-clock-parents = <&pmc PMC_TYPE_GCK 54>;
status = "disabled";
};
@@ -749,7 +750,7 @@ can0: can@f8054000 {
clocks = <&pmc PMC_TYPE_PERIPHERAL 56>, <&pmc PMC_TYPE_GCK 56>;
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 56>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA5D2_PMC_UPLLCK>;
assigned-clock-rates = <40000000>;
bosch,mram-cfg = <0x0 0 0 64 0 0 32 32>;
status = "disabled";
@@ -1134,7 +1135,7 @@ AT91_XDMAC_DT_PERID(33))>,
dma-names = "tx", "rx";
clocks = <&pmc PMC_TYPE_PERIPHERAL 55>, <&pmc PMC_TYPE_GCK 55>;
clock-names = "pclk", "gclk";
- assigned-clocks = <&pmc PMC_TYPE_CORE PMC_I2S1_MUX>;
+ assigned-clocks = <&pmc PMC_TYPE_CORE SAMA5D2_PMC_I2S1_MUX>;
assigned-clock-parents = <&pmc PMC_TYPE_GCK 55>;
status = "disabled";
};
@@ -1149,7 +1150,7 @@ can1: can@fc050000 {
clocks = <&pmc PMC_TYPE_PERIPHERAL 57>, <&pmc PMC_TYPE_GCK 57>;
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 57>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA5D2_PMC_UPLLCK>;
assigned-clock-rates = <40000000>;
bosch,mram-cfg = <0x1c00 0 0 64 0 0 32 32>;
status = "disabled";
diff --git a/arch/arm/boot/dts/microchip/sama5d3.dtsi b/arch/arm/boot/dts/microchip/sama5d3.dtsi
index 00ba59ac1968c..cefad06cd67e0 100644
--- a/arch/arm/boot/dts/microchip/sama5d3.dtsi
+++ b/arch/arm/boot/dts/microchip/sama5d3.dtsi
@@ -12,6 +12,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,sama5d3-pmc.h>
#include <dt-bindings/mfd/at91-usart.h>
/ {
@@ -1028,7 +1029,7 @@ pit: timer@fffffe30 {
compatible = "atmel,at91sam9260-pit";
reg = <0xfffffe30 0xf>;
interrupts = <3 IRQ_TYPE_LEVEL_HIGH 5>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA5D3_PMC_MCK>;
};
watchdog: watchdog@fffffe40 {
@@ -1071,7 +1072,7 @@ usb0: gadget@500000 {
reg = <0x00500000 0x100000
0xf8030000 0x4000>;
interrupts = <33 IRQ_TYPE_LEVEL_HIGH 2>;
- clocks = <&pmc PMC_TYPE_PERIPHERAL 33>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 33>, <&pmc PMC_TYPE_CORE SAMA5D3_PMC_UPLLCK>;
clock-names = "pclk", "hclk";
status = "disabled";
};
@@ -1089,7 +1090,7 @@ usb2: usb@700000 {
compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
reg = <0x00700000 0x100000>;
interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>;
- clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_PERIPHERAL 32>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA5D3_PMC_UPLLCK>, <&pmc PMC_TYPE_PERIPHERAL 32>;
clock-names = "usb_clk", "ehci_clk";
status = "disabled";
};
@@ -1105,7 +1106,7 @@ ebi: ebi@10000000 {
0x1 0x0 0x40000000 0x10000000
0x2 0x0 0x50000000 0x10000000
0x3 0x0 0x60000000 0x10000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA5D3_PMC_MCK>;
status = "disabled";
nand_controller: nand-controller {
diff --git a/arch/arm/boot/dts/microchip/sama5d4.dtsi b/arch/arm/boot/dts/microchip/sama5d4.dtsi
index ec1d68c640dea..318d3bdb47e31 100644
--- a/arch/arm/boot/dts/microchip/sama5d4.dtsi
+++ b/arch/arm/boot/dts/microchip/sama5d4.dtsi
@@ -7,6 +7,7 @@
*/
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/atmel,sama5d4-pmc.h>
#include <dt-bindings/dma/at91.h>
#include <dt-bindings/mfd/at91-usart.h>
#include <dt-bindings/pinctrl/at91.h>
@@ -116,7 +117,7 @@ usb0: gadget@400000 {
reg = <0x00400000 0x100000
0xfc02c000 0x4000>;
interrupts = <47 IRQ_TYPE_LEVEL_HIGH 2>;
- clocks = <&pmc PMC_TYPE_PERIPHERAL 47>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 47>, <&pmc PMC_TYPE_CORE SAMA5D4_PMC_UPLLCK>;
clock-names = "pclk", "hclk";
status = "disabled";
};
@@ -134,7 +135,7 @@ usb2: usb@600000 {
compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
reg = <0x00600000 0x100000>;
interrupts = <46 IRQ_TYPE_LEVEL_HIGH 2>;
- clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_PERIPHERAL 46>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA5D4_PMC_UPLLCK>, <&pmc PMC_TYPE_PERIPHERAL 46>;
clock-names = "usb_clk", "ehci_clk";
status = "disabled";
};
@@ -159,7 +160,7 @@ ebi: ebi@10000000 {
0x1 0x0 0x60000000 0x10000000
0x2 0x0 0x70000000 0x10000000
0x3 0x0 0x80000000 0x8000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA5D4_PMC_MCK>;
status = "disabled";
nand_controller: nand-controller {
@@ -753,7 +754,7 @@ pit: timer@fc068630 {
compatible = "atmel,at91sam9260-pit";
reg = <0xfc068630 0x10>;
interrupts = <3 IRQ_TYPE_LEVEL_HIGH 5>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK2>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA5D4_PMC_MCK2>;
};
watchdog: watchdog@fc068640 {
diff --git a/arch/arm/boot/dts/microchip/sama7d65.dtsi b/arch/arm/boot/dts/microchip/sama7d65.dtsi
index ec200848c153f..aec4244f99972 100644
--- a/arch/arm/boot/dts/microchip/sama7d65.dtsi
+++ b/arch/arm/boot/dts/microchip/sama7d65.dtsi
@@ -9,6 +9,7 @@
*/
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/microchip,sama7d65-pmc.h>
#include <dt-bindings/dma/at91.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -30,7 +31,7 @@ cpu0: cpu@0 {
compatible = "arm,cortex-a7";
reg = <0x0>;
device_type = "cpu";
- clocks = <&pmc PMC_TYPE_CORE PMC_CPUPLL>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA7D65_PMC_CPUPLL>;
clock-names = "cpu";
d-cache-size = <0x8000>; // L1, 32 KB
i-cache-size = <0x8000>; // L1, 32 KB
@@ -191,7 +192,7 @@ can0: can@e0828000 {
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 58>;
assigned-clock-rates = <40000000>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7D65_PMC_USBPLL>;
bosch,mram-cfg = <0x3400 0 0 64 0 0 32 32>;
status = "disabled";
};
@@ -207,7 +208,7 @@ can1: can@e082c000 {
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 59>;
assigned-clock-rates = <40000000>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7D65_PMC_USBPLL>;
bosch,mram-cfg = <0x7800 0 0 64 0 0 32 32>;
status = "disabled";
};
@@ -223,7 +224,7 @@ can2: can@e0830000 {
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 60>;
assigned-clock-rates = <40000000>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7D65_PMC_USBPLL>;
bosch,mram-cfg = <0xbc00 0 0 64 0 0 32 32>;
status = "disabled";
};
@@ -239,7 +240,7 @@ can3: can@e0834000 {
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 61>;
assigned-clock-rates = <40000000>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7D65_PMC_USBPLL>;
bosch,mram-cfg = <0x0 0 0 64 0 0 32 32>;
status = "disabled";
};
@@ -255,7 +256,7 @@ can4: can@e0838000 {
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 62>;
assigned-clock-rates = <40000000>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7D65_PMC_USBPLL>;
bosch,mram-cfg = <0x4400 0 0 64 0 0 32 32>;
status = "disabled";
};
@@ -279,7 +280,7 @@ sdmmc1: mmc@e1208000 {
clock-names = "hclock", "multclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 76>;
assigned-clock-rates = <200000000>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_MCK1>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7D65_PMC_MCK1>;
status = "disabled";
};
diff --git a/arch/arm/boot/dts/microchip/sama7g5.dtsi b/arch/arm/boot/dts/microchip/sama7g5.dtsi
index 03ef3d9aaeec6..b8296391fc696 100644
--- a/arch/arm/boot/dts/microchip/sama7g5.dtsi
+++ b/arch/arm/boot/dts/microchip/sama7g5.dtsi
@@ -13,6 +13,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/clock/microchip,sama7g5-pmc.h>
#include <dt-bindings/dma/at91.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/mfd/at91-usart.h>
@@ -34,7 +35,7 @@ cpu0: cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a7";
reg = <0x0>;
- clocks = <&pmc PMC_TYPE_CORE PMC_CPUPLL>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_CPUPLL>;
clock-names = "cpu";
operating-points-v2 = <&cpu_opp_table>;
#cooling-cells = <2>; /* min followed by max */
@@ -202,7 +203,7 @@ ebi: ebi@40000000 {
0x1 0x0 0x48000000 0x8000000
0x2 0x0 0x50000000 0x8000000
0x3 0x0 0x58000000 0x8000000>;
- clocks = <&pmc PMC_TYPE_CORE PMC_MCK1>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_MCK1>;
status = "disabled";
nand_controller: nand-controller {
@@ -385,7 +386,7 @@ can0: can@e0828000 {
clocks = <&pmc PMC_TYPE_PERIPHERAL 61>, <&pmc PMC_TYPE_GCK 61>;
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 61>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_SYSPLL>;
assigned-clock-rates = <40000000>;
bosch,mram-cfg = <0x3400 0 0 64 0 0 32 32>;
status = "disabled";
@@ -401,7 +402,7 @@ can1: can@e082c000 {
clocks = <&pmc PMC_TYPE_PERIPHERAL 62>, <&pmc PMC_TYPE_GCK 62>;
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 62>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_SYSPLL>;
assigned-clock-rates = <40000000>;
bosch,mram-cfg = <0x7800 0 0 64 0 0 32 32>;
status = "disabled";
@@ -417,7 +418,7 @@ can2: can@e0830000 {
clocks = <&pmc PMC_TYPE_PERIPHERAL 63>, <&pmc PMC_TYPE_GCK 63>;
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 63>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_SYSPLL>;
assigned-clock-rates = <40000000>;
bosch,mram-cfg = <0xbc00 0 0 64 0 0 32 32>;
status = "disabled";
@@ -433,7 +434,7 @@ can3: can@e0834000 {
clocks = <&pmc PMC_TYPE_PERIPHERAL 64>, <&pmc PMC_TYPE_GCK 64>;
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 64>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_SYSPLL>;
assigned-clock-rates = <40000000>;
bosch,mram-cfg = <0x0 0 0 64 0 0 32 32>;
status = "disabled";
@@ -449,7 +450,7 @@ can4: can@e0838000 {
clocks = <&pmc PMC_TYPE_PERIPHERAL 65>, <&pmc PMC_TYPE_GCK 65>;
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 65>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_SYSPLL>;
assigned-clock-rates = <40000000>;
bosch,mram-cfg = <0x4400 0 0 64 0 0 32 32>;
status = "disabled";
@@ -465,7 +466,7 @@ can5: can@e083c000 {
clocks = <&pmc PMC_TYPE_PERIPHERAL 66>, <&pmc PMC_TYPE_GCK 66>;
clock-names = "hclk", "cclk";
assigned-clocks = <&pmc PMC_TYPE_GCK 66>;
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_SYSPLL>;
assigned-clock-rates = <40000000>;
bosch,mram-cfg = <0x8800 0 0 64 0 0 32 32>;
status = "disabled";
@@ -496,7 +497,7 @@ sdmmc0: mmc@e1204000 {
interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 80>, <&pmc PMC_TYPE_GCK 80>;
clock-names = "hclock", "multclk";
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_SYSPLL>;
assigned-clocks = <&pmc PMC_TYPE_GCK 80>;
assigned-clock-rates = <200000000>;
microchip,sdcal-inverted;
@@ -509,7 +510,7 @@ sdmmc1: mmc@e1208000 {
interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 81>, <&pmc PMC_TYPE_GCK 81>;
clock-names = "hclock", "multclk";
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_SYSPLL>;
assigned-clocks = <&pmc PMC_TYPE_GCK 81>;
assigned-clock-rates = <200000000>;
microchip,sdcal-inverted;
@@ -522,7 +523,7 @@ sdmmc2: mmc@e120c000 {
interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 82>, <&pmc PMC_TYPE_GCK 82>;
clock-names = "hclock", "multclk";
- assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+ assigned-clock-parents = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_SYSPLL>;
assigned-clocks = <&pmc PMC_TYPE_GCK 82>;
assigned-clock-rates = <200000000>;
microchip,sdcal-inverted;
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 13/16] ARM: dts: microchip: sama7g5: Add OTPC clocks
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (11 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 12/16] ARM: dts: microchip: Use new per SoC PMC bindings Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 14/16] ARM: dts: microchip: sam9x60: Add OTPC node Alexander Dahl
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
These clocks should be enabled, datasheet says:
> The OTPC is clocked through the Power Management Controller (PMC).
> The user must power on the main RC oscillator and enable the
> peripheral clock of the OTPC prior to reading or writing the OTP
> memory.
Earlier discussions suggest, MCK0 must be enabled, too. MCK0 is parent
of peripheral otpc_clk, so this is done implicitly.
Link: https://lore.kernel.org/linux-clk/ec34efc2-2051-4b8a-b5d8-6e2fd5e08c28@microchip.com/T/#u
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- no changes
v3:
- Removed clock-names, not part of bindings anymore, and not used by driver
v2:
- new patch, not present in v1
arch/arm/boot/dts/microchip/sama7g5.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/microchip/sama7g5.dtsi b/arch/arm/boot/dts/microchip/sama7g5.dtsi
index b8296391fc696..30193f3bf9775 100644
--- a/arch/arm/boot/dts/microchip/sama7g5.dtsi
+++ b/arch/arm/boot/dts/microchip/sama7g5.dtsi
@@ -1036,6 +1036,7 @@ otpc: efuse@e8c00000 {
reg = <0xe8c00000 0x100>;
#address-cells = <1>;
#size-cells = <1>;
+ clocks = <&pmc PMC_TYPE_CORE SAMA7G5_PMC_MAIN_RC>, <&pmc PMC_TYPE_PERIPHERAL 67>;
temperature_calib: calib@1 {
reg = <OTP_PKT(1) 76>;
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 14/16] ARM: dts: microchip: sam9x60: Add OTPC node
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (12 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 13/16] ARM: dts: microchip: sama7g5: Add OTPC clocks Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 15/16] ARM: dts: microchip: sam9x60_curiosity: Enable OTP Controller Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 16/16] dt-bindings: clock: at91: Remove old PMC definitions Alexander Dahl
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
The One-Time Programmable (OTP) Memory Controller (OTPC) is the secure
interface between the system and the OTP memory. It also features the
Unique Product ID (UID) registers containing a unique serial number.
See datasheet (DS60001579G) sections "7. Memories" and "23. OTP Memory
Controller (OTPC)" for reference.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- Dropped new microchip,sam9x60-otpc compatible,
use microchip,sama7g5-otpc instead
v3:
- Removed needless header include
- Removed clock-names, not part of bindings anymore, and not used by driver
v2:
- squashed with patch adding the clock properties
arch/arm/boot/dts/microchip/sam9x60.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/microchip/sam9x60.dtsi b/arch/arm/boot/dts/microchip/sam9x60.dtsi
index 4b777c61c1e09..996b13300ca06 100644
--- a/arch/arm/boot/dts/microchip/sam9x60.dtsi
+++ b/arch/arm/boot/dts/microchip/sam9x60.dtsi
@@ -155,6 +155,14 @@ sdmmc1: sdio-host@90000000 {
status = "disabled";
};
+ otpc: efuse@eff00000 {
+ compatible = "microchip,sama7g5-otpc", "syscon";
+ reg = <0xeff00000 0xec>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ clocks = <&pmc PMC_TYPE_CORE SAM9X60_PMC_MAIN_RC>, <&pmc PMC_TYPE_PERIPHERAL 46>;
+ };
+
apb {
compatible = "simple-bus";
#address-cells = <1>;
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 15/16] ARM: dts: microchip: sam9x60_curiosity: Enable OTP Controller
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (13 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 14/16] ARM: dts: microchip: sam9x60: Add OTPC node Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 16/16] dt-bindings: clock: at91: Remove old PMC definitions Alexander Dahl
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Allows to access the OTP memory and Product UID now.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- no changes
v3:
- Reworded commit message after reordering patches
v2:
- same as in v1, no changes
arch/arm/boot/dts/microchip/at91-sam9x60_curiosity.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/microchip/at91-sam9x60_curiosity.dts b/arch/arm/boot/dts/microchip/at91-sam9x60_curiosity.dts
index b9ffd9e5faacc..c110a8e87568a 100644
--- a/arch/arm/boot/dts/microchip/at91-sam9x60_curiosity.dts
+++ b/arch/arm/boot/dts/microchip/at91-sam9x60_curiosity.dts
@@ -252,6 +252,10 @@ ethernet-phy@0 {
};
};
+&otpc {
+ status = "okay";
+};
+
&pinctrl {
adc {
pinctrl_adc_default: adc-default {
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v4 16/16] dt-bindings: clock: at91: Remove old PMC definitions
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
` (14 preceding siblings ...)
2026-11-05 11:06 ` [PATCH v4 15/16] ARM: dts: microchip: sam9x60_curiosity: Enable OTP Controller Alexander Dahl
@ 2026-11-05 11:06 ` Alexander Dahl
15 siblings, 0 replies; 17+ messages in thread
From: Alexander Dahl @ 2026-11-05 11:06 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Nicolas Ferre, Alexandre Belloni, Ryan Wanner, linux-arm-kernel,
devicetree, linux-kernel, linux-clk, Rob Herring (Arm),
Stephen Boyd, Brian Masney, Jerome Brunet, Krzysztof Kozlowski,
Conor Dooley
Those were split up per SoC and are not used anymore.
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v4:
- Added Acked-by tag (thanks Rob)
v3:
- new patch, not present in v2
include/dt-bindings/clock/at91.h | 32 --------------------------------
1 file changed, 32 deletions(-)
diff --git a/include/dt-bindings/clock/at91.h b/include/dt-bindings/clock/at91.h
index f2a7b7d39c0d0..ebc41cb4edb92 100644
--- a/include/dt-bindings/clock/at91.h
+++ b/include/dt-bindings/clock/at91.h
@@ -14,38 +14,6 @@
#define PMC_TYPE_GCK 3
#define PMC_TYPE_PROGRAMMABLE 4
-#define PMC_SLOW 0
-#define PMC_MCK 1
-#define PMC_UTMI 2
-#define PMC_MAIN 3
-#define PMC_MCK2 4
-#define PMC_I2S0_MUX 5
-#define PMC_I2S1_MUX 6
-#define PMC_PLLACK 7
-#define PMC_PLLBCK 8
-#define PMC_AUDIOPLLCK 9
-#define PMC_AUDIOPINCK 10
-
-/* SAMA7G5 */
-#define PMC_CPUPLL (PMC_MAIN + 1)
-#define PMC_SYSPLL (PMC_MAIN + 2)
-#define PMC_DDRPLL (PMC_MAIN + 3)
-#define PMC_IMGPLL (PMC_MAIN + 4)
-#define PMC_BAUDPLL (PMC_MAIN + 5)
-#define PMC_AUDIOPMCPLL (PMC_MAIN + 6)
-#define PMC_AUDIOIOPLL (PMC_MAIN + 7)
-#define PMC_ETHPLL (PMC_MAIN + 8)
-#define PMC_CPU (PMC_MAIN + 9)
-#define PMC_MCK1 (PMC_MAIN + 10)
-
-/* SAM9X7 */
-#define PMC_PLLADIV2 (PMC_MAIN + 11)
-#define PMC_LVDSPLL (PMC_MAIN + 12)
-
-/* SAMA7D65 */
-#define PMC_MCK3 (PMC_MAIN + 13)
-#define PMC_MCK5 (PMC_MAIN + 14)
-
#ifndef AT91_PMC_MOSCS
#define AT91_PMC_MOSCS 0 /* MOSCS Flag */
#define AT91_PMC_LOCKA 1 /* PLLA Lock */
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2026-11-05 14:12 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-05 11:06 [PATCH v4 00/16] Microchip OTPC driver on SAM9X60 exposing UIDxR as additional nvmem device Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 01/16] MAINTAINERS: Add sam9/sama to (AT91) SoC support Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 02/16] dt-bindings: clock: at91: Split up per SoC partially Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 03/16] dt-bindings: clock: at91: Allow referencing main rc oscillator in DT Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 04/16] clk: at91: Use new per SoC PMC clock index definitions Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 05/16] clk: at91: Allow enabling main_rc_osc through DT Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 06/16] clk: at91: Add peripheral clock id for OTPC Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 07/16] dt-bindings: nvmem: microchip-otpc: Add required clocks Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 08/16] nvmem: microchip-otpc: Avoid reading a write-only register Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 09/16] nvmem: microchip-otpc: Fix swapped 'sleep' and 'timeout' parameters Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 10/16] nvmem: microchip-otpc: Enable necessary clocks Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 11/16] nvmem: microchip-otpc: Expose UID registers as 2nd nvmem device Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 12/16] ARM: dts: microchip: Use new per SoC PMC bindings Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 13/16] ARM: dts: microchip: sama7g5: Add OTPC clocks Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 14/16] ARM: dts: microchip: sam9x60: Add OTPC node Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 15/16] ARM: dts: microchip: sam9x60_curiosity: Enable OTP Controller Alexander Dahl
2026-11-05 11:06 ` [PATCH v4 16/16] dt-bindings: clock: at91: Remove old PMC definitions Alexander Dahl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®