Add support for sam9x7 SoC and SAM9X75 Curiosity board
Subsystems (5)
v3 cover Add support for sam9x7 SoC and SAM9X75 Curiosity board
This patch series adds support for the new SoC family - sam9x7.
- sam9x7 SoC is added
- Clock driver for sam9x7 is added
- Target board SAM9X75 Curiosity is added with its differences in DT and MMC config support
----
changes in v3:
- 1/8 - rename at91.h to at91-pmc-status.h, update the SoC DTs and MAINTAINERS file respectively
- 4/8 - update header from clk/at91.h to clock/at91.h
changes in v2:
- 1/8 - add additional PMC clock definition to support the sam9x7 upstream DT
- 6/8 - Remove support for SoC DT and board DTS as they are already available in dts/upstream
- add the differences in DT files between upstream Linux DT and U-Boot DT to at91-sam9x75_curiosity-u-boot.dtsi
- 7/8 - Add OF_UPSTREAM support for sam9x75 curiosity board
- 8/8 - update the DEFAULT_DEVICE_TREE config to <vendor/name>
----
Manikandan Muralidharan (4):
dt-bindings: clock: rename at91.h to at91-pmc-status.h
ARM: dts: at91: sam9x75_curiosity: add tweaks for sam9x75 curiosity
board
board: sam9x75_curiosity: Add support for sam9x75 curiosity
configs: sam9x75_curiosity: Add initial mmc default config
Varshini Rajendran (4):
clk: at91: sam9x60-pll: add support for core clock frequency inputs
clk: at91: sam9x60-pll: add support for HW PLL freq dividers
clk: at91: sam9x7: add pmc driver for sam9x7 SoC family
ARM: at91: Add sam9x7 soc
MAINTAINERS | 2 +-
.../dts/at91-sam9x75_curiosity-u-boot.dtsi | 107 ++
arch/arm/dts/at91-sama7g5ek-u-boot.dtsi | 2 +-
arch/arm/dts/at91sam9260.dtsi | 2 +-
arch/arm/dts/at91sam9261.dtsi | 2 +-
arch/arm/dts/at91sam9263.dtsi | 2 +-
arch/arm/dts/at91sam9g45.dtsi | 2 +-
arch/arm/dts/at91sam9n12.dtsi | 2 +-
arch/arm/dts/at91sam9rl.dtsi | 2 +-
arch/arm/dts/at91sam9x5.dtsi | 2 +-
arch/arm/dts/sama5d3.dtsi | 2 +-
arch/arm/dts/sama5d3_mci2.dtsi | 2 +-
arch/arm/dts/sama5d3_tcb1.dtsi | 2 +-
arch/arm/dts/sama5d3_uart.dtsi | 2 +-
arch/arm/dts/sama5d4.dtsi | 2 +-
arch/arm/mach-at91/Kconfig | 12 +
arch/arm/mach-at91/arm926ejs/Makefile | 1 +
arch/arm/mach-at91/arm926ejs/sam9x7_devices.c | 49 +
arch/arm/mach-at91/include/mach/hardware.h | 2 +
arch/arm/mach-at91/include/mach/sam9x7.h | 172 +++
board/atmel/sam9x75_curiosity/Kconfig | 15 +
board/atmel/sam9x75_curiosity/MAINTAINERS | 7 +
board/atmel/sam9x75_curiosity/Makefile | 7 +
.../sam9x75_curiosity/sam9x75_curiosity.c | 66 +
configs/sam9x75_curiosity_mmc_defconfig | 73 ++
drivers/clk/at91/Makefile | 1 +
drivers/clk/at91/clk-sam9x60-pll.c | 55 +-
drivers/clk/at91/pmc.h | 2 +
drivers/clk/at91/sam9x60.c | 7 +
drivers/clk/at91/sam9x7.c | 1094 +++++++++++++++++
drivers/clk/at91/sama7g5.c | 6 +
include/configs/sam9x75_curiosity.h | 23 +
.../clock/{at91.h => at91-pmc-status.h} | 0
33 files changed, 1703 insertions(+), 24 deletions(-)
create mode 100644 arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi
create mode 100644 arch/arm/mach-at91/arm926ejs/sam9x7_devices.c
create mode 100644 arch/arm/mach-at91/include/mach/sam9x7.h
create mode 100644 board/atmel/sam9x75_curiosity/Kconfig
create mode 100644 board/atmel/sam9x75_curiosity/MAINTAINERS
create mode 100644 board/atmel/sam9x75_curiosity/Makefile
create mode 100644 board/atmel/sam9x75_curiosity/sam9x75_curiosity.c
create mode 100644 configs/sam9x75_curiosity_mmc_defconfig
create mode 100644 drivers/clk/at91/sam9x7.c
create mode 100644 include/configs/sam9x75_curiosity.h
rename include/dt-bindings/clock/{at91.h => at91-pmc-status.h} (100%)Signature · 1 line
2.25.1
PATCH v3 1/8 dt-bindings: clock: rename at91.h to at91-pmc-status.h
Rename the include at91.h to at91-pmc-status.h to avoid conflicts with the upstream bindings that has the same file and update the relevant legacy SoC Device Trees to reflect this change.
This is useful while compiling the DT and driver of the new SoC files with OF_UPSTREAM enabled.
---
MAINTAINERS | 2 +-
arch/arm/dts/at91-sama7g5ek-u-boot.dtsi | 2 +-
arch/arm/dts/at91sam9260.dtsi | 2 +-
arch/arm/dts/at91sam9261.dtsi | 2 +-
arch/arm/dts/at91sam9263.dtsi | 2 +-
arch/arm/dts/at91sam9g45.dtsi | 2 +-
arch/arm/dts/at91sam9n12.dtsi | 2 +-
arch/arm/dts/at91sam9rl.dtsi | 2 +-
arch/arm/dts/at91sam9x5.dtsi | 2 +-
arch/arm/dts/sama5d3.dtsi | 2 +-
arch/arm/dts/sama5d3_mci2.dtsi | 2 +-
arch/arm/dts/sama5d3_tcb1.dtsi | 2 +-
arch/arm/dts/sama5d3_uart.dtsi | 2 +-
arch/arm/dts/sama5d4.dtsi | 2 +-
include/dt-bindings/clock/{at91.h => at91-pmc-status.h} | 0
15 files changed, 14 insertions(+), 14 deletions(-)
rename include/dt-bindings/clock/{at91.h => at91-pmc-status.h} (100%)MAINTAINERS +1 -1
@@ -464,7 +464,7 @@ F: drivers/memory/atmel-ebi.c F: drivers/misc/microchip_flexcom.c F: drivers/timer/atmel_tcb_timer.c F: include/dt-bindings/clk/at91.h -F: include/dt-bindings/clock/at91.h +F: include/dt-bindings/clock/at91-pmc-status.h F: include/dt-bindings/dma/at91.h F: include/dt-bindings/mfd/at91-usart.h F: include/dt-bindings/mfd/atmel-flexcom.h
arch/arm/dts/at91-sama7g5ek-u-boot.dtsi +1 -1
@@ -12,7 +12,7 @@ #include "sama7g5-pinfunc.h" #include <dt-bindings/reset/sama7g5-reset.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { chosen {
arch/arm/dts/at91sam9260.dtsi +1 -1
@@ -12,7 +12,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9260 family SoC";
arch/arm/dts/at91sam9261.dtsi +1 -1
@@ -10,7 +10,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9261 family SoC";
arch/arm/dts/at91sam9263.dtsi +1 -1
@@ -10,7 +10,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9263 family SoC";
arch/arm/dts/at91sam9g45.dtsi +1 -1
@@ -14,7 +14,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9G45 family SoC";
arch/arm/dts/at91sam9n12.dtsi +1 -1
@@ -12,7 +12,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9N12 SoC";
arch/arm/dts/at91sam9rl.dtsi +1 -1
@@ -8,7 +8,7 @@ #include "skeleton.dtsi" #include <dt-bindings/pinctrl/at91.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/pwm/pwm.h>
arch/arm/dts/at91sam9x5.dtsi +1 -1
@@ -14,7 +14,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9x5 family SoC";
arch/arm/dts/sama5d3.dtsi +1 -1
@@ -13,7 +13,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel SAMA5D3 family SoC";
arch/arm/dts/sama5d3_mci2.dtsi +1 -1
@@ -9,7 +9,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { ahb {
arch/arm/dts/sama5d3_tcb1.dtsi +1 -1
@@ -9,7 +9,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { aliases {
arch/arm/dts/sama5d3_uart.dtsi +1 -1
@@ -9,7 +9,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { aliases {
arch/arm/dts/sama5d4.dtsi +1 -1
@@ -44,7 +44,7 @@ */ #include "skeleton.dtsi" -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> #include <dt-bindings/dma/at91.h> #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h>
include/dt-bindings/clock/at91-pmc-status.h renamed from include/dt-bindings/clock/at91.h +0 -0
Signature · 1 line
2.25.1
Re: [PATCH v3 1/8] dt-bindings: clock: rename at91.h to at91-pmc-status.h
Hi Manikandan,
Quoted 17 lines · Manikandan Muralidharan
Rename the include
at91.htoat91-pmc-status.hto avoid conflicts with the upstream bindings that has the same file and update the relevant legacy SoC Device Trees to reflect this change.
This is useful while compiling the DT and driver of the new SoC files withOF_UPSTREAMenabled.Signed-off-by Manikandan Muralidharan <[email protected]>--- MAINTAINERS | 2 +- arch/arm/dts/at91-sama7g5ek-u-boot.dtsi | 2 +- arch/arm/dts/at91sam9260.dtsi | 2 +- arch/arm/dts/at91sam9261.dtsi | 2 +- arch/arm/dts/at91sam9263.dtsi | 2 +- arch/arm/dts/at91sam9g45.dtsi | 2 +- arch/arm/dts/at91sam9n12.dtsi | 2 +- arch/arm/dts/at91sam9rl.dtsi | 2 +- arch/arm/dts/at91sam9x5.dtsi | 2 +-
Quoted 9 lines
arch/arm/dts/sama5d3.dtsi | 2 +-
arch/arm/dts/sama5d3_mci2.dtsi | 2 +-
arch/arm/dts/sama5d3_tcb1.dtsi | 2 +-
arch/arm/dts/sama5d3_uart.dtsi | 2 +-
arch/arm/dts/sama5d4.dtsi | 2 +-
include/dt-bindings/clock/{at91.h => at91-pmc-status.h} | 0
15 files changed, 14 insertions(+), 14 deletions(-)
rename include/dt-bindings/clock/{at91.h => at91-pmc-status.h} (100%)AFAICS, include/dt-bindings/clock/at91.h is just a subset of dts/upstream/include/dt-bindings/clock/at91.h. If that's true then we should just be able to drop local include/dt-bindings/clock/at91.h from U-Boot tree. Won't that just work fine?
-Sumit
Quoted 189 lines
MAINTAINERS +1
-1@@ -464,7 +464,7 @@ F: drivers/memory/atmel-ebi.c F: drivers/misc/microchip_flexcom.c F: drivers/timer/atmel_tcb_timer.c F: include/dt-bindings/clk/at91.h -F: include/dt-bindings/clock/at91.h +F: include/dt-bindings/clock/at91-pmc-status.h F: include/dt-bindings/dma/at91.h F: include/dt-bindings/mfd/at91-usart.h F: include/dt-bindings/mfd/atmel-flexcom.harch/arm/dts/at91-sama7g5ek-u-boot.dtsi +1
-1@@ -12,7 +12,7 @@ #include "sama7g5-pinfunc.h" #include <dt-bindings/reset/sama7g5-reset.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { chosen {arch/arm/dts/at91sam9260.dtsi +1
-1@@ -12,7 +12,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9260 family SoC";arch/arm/dts/at91sam9261.dtsi +1
-1@@ -10,7 +10,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9261 family SoC";arch/arm/dts/at91sam9263.dtsi +1
-1@@ -10,7 +10,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9263 family SoC";arch/arm/dts/at91sam9g45.dtsi +1
-1@@ -14,7 +14,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9G45 family SoC";arch/arm/dts/at91sam9n12.dtsi +1
-1@@ -12,7 +12,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9N12 SoC";arch/arm/dts/at91sam9rl.dtsi +1
-1@@ -8,7 +8,7 @@ #include "skeleton.dtsi" #include <dt-bindings/pinctrl/at91.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/pwm/pwm.h>arch/arm/dts/at91sam9x5.dtsi +1
-1@@ -14,7 +14,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9x5 family SoC";arch/arm/dts/sama5d3.dtsi +1
-1@@ -13,7 +13,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel SAMA5D3 family SoC";arch/arm/dts/sama5d3_mci2.dtsi +1
-1@@ -9,7 +9,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { ahb {arch/arm/dts/sama5d3_tcb1.dtsi +1
-1@@ -9,7 +9,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { aliases {arch/arm/dts/sama5d3_uart.dtsi +1
-1@@ -9,7 +9,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { aliases {arch/arm/dts/sama5d4.dtsi +1
-1@@ -44,7 +44,7 @@ */ #include "skeleton.dtsi" -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> #include <dt-bindings/dma/at91.h> #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h>include/dt-bindings/clock/at91-pmc-status.h renamed from include/dt-bindings/clock/at91.h +0
-0Signature · 1 line
2.25.1
Re: [PATCH v3 1/8] dt-bindings: clock: rename at91.h to at91-pmc-status.h
Hi Sumit,
Quoted 34 lines · Sumit Garg
[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Hi Manikandan,
Quoted 24 lines · Manikandan Muralidharan
Rename the include
at91.htoat91-pmc-status.hto avoid conflicts with the upstream bindings that has the same file and update the relevant legacy SoC Device Trees to reflect this change.
This is useful while compiling the DT and driver of the new SoC files withOF_UPSTREAMenabled.Signed-off-by Manikandan Muralidharan <[email protected]>--- MAINTAINERS | 2 +- arch/arm/dts/at91-sama7g5ek-u-boot.dtsi | 2 +- arch/arm/dts/at91sam9260.dtsi | 2 +- arch/arm/dts/at91sam9261.dtsi | 2 +- arch/arm/dts/at91sam9263.dtsi | 2 +- arch/arm/dts/at91sam9g45.dtsi | 2 +- arch/arm/dts/at91sam9n12.dtsi | 2 +- arch/arm/dts/at91sam9rl.dtsi | 2 +- arch/arm/dts/at91sam9x5.dtsi | 2 +- arch/arm/dts/sama5d3.dtsi | 2 +- arch/arm/dts/sama5d3_mci2.dtsi | 2 +- arch/arm/dts/sama5d3_tcb1.dtsi | 2 +- arch/arm/dts/sama5d3_uart.dtsi | 2 +- arch/arm/dts/sama5d4.dtsi | 2 +- include/dt-bindings/clock/{at91.h => at91-pmc-status.h} | 0 15 files changed, 14 insertions(+), 14 deletions(-)Quoted 2 lines
rename
include/dt-bindings/clock/{at91.h=>at91-pmc-status.h} (100%)
Quoted 4 lines
AFAICS,
include/dt-bindings/clock/at91.his just a subset ofdts/upstream/include/dt-bindings/clock/at91.h. If that's true then we should just be able to drop localinclude/dt-bindings/clock/at91.hfrom U-Boot tree. Won't that just work fine?
Yes, you're right. It's a subset of the upstream at91.h. However, we must retain it due to dependencies with legacy SoC files that haven't yet been migrated to OF_UPSTREAM. I believe migrating those files now would introduce a significant number of changes w.r.t Device Tree files."
Quoted 192 lines
-Sumit
Quoted 189 lines
MAINTAINERS +1
-1@@ -464,7 +464,7 @@ F: drivers/memory/atmel-ebi.c F: drivers/misc/microchip_flexcom.c F: drivers/timer/atmel_tcb_timer.c F: include/dt-bindings/clk/at91.h -F: include/dt-bindings/clock/at91.h +F: include/dt-bindings/clock/at91-pmc-status.h F: include/dt-bindings/dma/at91.h F: include/dt-bindings/mfd/at91-usart.h F: include/dt-bindings/mfd/atmel-flexcom.harch/arm/dts/at91-sama7g5ek-u-boot.dtsi +1
-1@@ -12,7 +12,7 @@ #include "sama7g5-pinfunc.h" #include <dt-bindings/reset/sama7g5-reset.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { chosen {arch/arm/dts/at91sam9260.dtsi +1
-1@@ -12,7 +12,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9260 family SoC";arch/arm/dts/at91sam9261.dtsi +1
-1@@ -10,7 +10,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9261 family SoC";arch/arm/dts/at91sam9263.dtsi +1
-1@@ -10,7 +10,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9263 family SoC";arch/arm/dts/at91sam9g45.dtsi +1
-1@@ -14,7 +14,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9G45 family SoC";arch/arm/dts/at91sam9n12.dtsi +1
-1@@ -12,7 +12,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9N12 SoC";arch/arm/dts/at91sam9rl.dtsi +1
-1@@ -8,7 +8,7 @@ #include "skeleton.dtsi" #include <dt-bindings/pinctrl/at91.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/pwm/pwm.h>arch/arm/dts/at91sam9x5.dtsi +1
-1@@ -14,7 +14,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9x5 family SoC";arch/arm/dts/sama5d3.dtsi +1
-1@@ -13,7 +13,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel SAMA5D3 family SoC";arch/arm/dts/sama5d3_mci2.dtsi +1
-1@@ -9,7 +9,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { ahb {arch/arm/dts/sama5d3_tcb1.dtsi +1
-1@@ -9,7 +9,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { aliases {arch/arm/dts/sama5d3_uart.dtsi +1
-1@@ -9,7 +9,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { aliases {arch/arm/dts/sama5d4.dtsi +1
-1@@ -44,7 +44,7 @@ */ #include "skeleton.dtsi" -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> #include <dt-bindings/dma/at91.h> #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h>include/dt-bindings/clock/at91-pmc-status.h renamed from include/dt-bindings/clock/at91.h +0
-1--2.25.1
Signature · 2 lines
Thanks and Regards, Manikandan M.
Re: [PATCH v3 1/8] dt-bindings: clock: rename at91.h to at91-pmc-status.h
Quoted 43 lines · On Thu, Mar 06, 2025 at 10:39:28AM +0000, [email protected] wrote:
Hi Sumit,
Quoted 34 lines · Sumit Garg
[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Hi Manikandan,
Quoted 24 lines · Manikandan Muralidharan
Rename the include
at91.htoat91-pmc-status.hto avoid conflicts with the upstream bindings that has the same file and update the relevant legacy SoC Device Trees to reflect this change.
This is useful while compiling the DT and driver of the new SoC files withOF_UPSTREAMenabled.Signed-off-by Manikandan Muralidharan <[email protected]>--- MAINTAINERS | 2 +- arch/arm/dts/at91-sama7g5ek-u-boot.dtsi | 2 +- arch/arm/dts/at91sam9260.dtsi | 2 +- arch/arm/dts/at91sam9261.dtsi | 2 +- arch/arm/dts/at91sam9263.dtsi | 2 +- arch/arm/dts/at91sam9g45.dtsi | 2 +- arch/arm/dts/at91sam9n12.dtsi | 2 +- arch/arm/dts/at91sam9rl.dtsi | 2 +- arch/arm/dts/at91sam9x5.dtsi | 2 +- arch/arm/dts/sama5d3.dtsi | 2 +- arch/arm/dts/sama5d3_mci2.dtsi | 2 +- arch/arm/dts/sama5d3_tcb1.dtsi | 2 +- arch/arm/dts/sama5d3_uart.dtsi | 2 +- arch/arm/dts/sama5d4.dtsi | 2 +- include/dt-bindings/clock/{at91.h => at91-pmc-status.h} | 0 15 files changed, 14 insertions(+), 14 deletions(-)Quoted 2 lines
rename
include/dt-bindings/clock/{at91.h=>at91-pmc-status.h} (100%)Quoted 4 lines
AFAICS,
include/dt-bindings/clock/at91.his just a subset ofdts/upstream/include/dt-bindings/clock/at91.h. If that's true then we should just be able to drop localinclude/dt-bindings/clock/at91.hfrom U-Boot tree. Won't that just work fine?
Quoted 5 lines
Yes, you're right. It's a subset of the upstream
at91.h. However, we must retain it due to dependencies with legacy SoC files that haven't yet been migrated toOF_UPSTREAM. I believe migrating those files now would introduce a significant number of changes w.r.t Device Tree files."
It's not required for SoCs to be migrated to OF_UPSTREAM to start using upstream bindings. The DT bindings headers are meant to be stable and reusable such that we don't have to maintain duplicated headers.
-Sumit
Re: [PATCH v3 1/8] dt-bindings: clock: rename at91.h to at91-pmc-status.h
Hi Sumit,
Quoted 54 lines · Sumit Garg
[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Quoted 43 lines · On Thu, Mar 06, 2025 at 10:39:28AM +0000, [email protected] wrote:
Hi Sumit,
Quoted 34 lines · Sumit Garg
[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Hi Manikandan,
Quoted 24 lines · Manikandan Muralidharan
Rename the include
at91.htoat91-pmc-status.hto avoid conflicts with the upstream bindings that has the same file and update the relevant legacy SoC Device Trees to reflect this change.
This is useful while compiling the DT and driver of the new SoC files withOF_UPSTREAMenabled.Signed-off-by Manikandan Muralidharan <[email protected]>--- MAINTAINERS | 2 +- arch/arm/dts/at91-sama7g5ek-u-boot.dtsi | 2 +- arch/arm/dts/at91sam9260.dtsi | 2 +- arch/arm/dts/at91sam9261.dtsi | 2 +- arch/arm/dts/at91sam9263.dtsi | 2 +- arch/arm/dts/at91sam9g45.dtsi | 2 +- arch/arm/dts/at91sam9n12.dtsi | 2 +- arch/arm/dts/at91sam9rl.dtsi | 2 +- arch/arm/dts/at91sam9x5.dtsi | 2 +- arch/arm/dts/sama5d3.dtsi | 2 +- arch/arm/dts/sama5d3_mci2.dtsi | 2 +- arch/arm/dts/sama5d3_tcb1.dtsi | 2 +- arch/arm/dts/sama5d3_uart.dtsi | 2 +- arch/arm/dts/sama5d4.dtsi | 2 +- include/dt-bindings/clock/{at91.h => at91-pmc-status.h} | 0 15 files changed, 14 insertions(+), 14 deletions(-)Quoted 2 lines
rename
include/dt-bindings/clock/{at91.h=>at91-pmc-status.h} (100%)Quoted 4 lines
AFAICS,
include/dt-bindings/clock/at91.his just a subset ofdts/upstream/include/dt-bindings/clock/at91.h. If that's true then we should just be able to drop localinclude/dt-bindings/clock/at91.hfrom U-Boot tree. Won't that just work fine?Quoted 5 lines
Yes, you're right. It's a subset of the upstream
at91.h. However, we must retain it due to dependencies with legacy SoC files that haven't yet been migrated toOF_UPSTREAM. I believe migrating those files now would introduce a significant number of changes w.r.t Device Tree files."
Quoted 3 lines
It's not required for SoCs to be migrated to
OF_UPSTREAMto start using upstream bindings. The DT bindings headers are meant to be stable and reusable such that we don't have to maintain duplicated headers.
Thanks for the insights. I will drop the local clock/at91.h and other SoCs can continue to use local clk/at91.h, which will be migrated and addressed in the future.
Quoted 2 lines
-Sumit
Signature · 2 lines
Thanks and Regards, Manikandan M.
Re: [PATCH v3 1/8] dt-bindings: clock: rename at91.h to at91-pmc-status.h
In reply to [email protected]Quoted 43 lines · On 3/6/25 12:39, [email protected] wrote:
Hi Sumit,
Quoted 34 lines · Sumit Garg
[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Hi Manikandan,
Quoted 24 lines · Manikandan Muralidharan
Rename the include
at91.htoat91-pmc-status.hto avoid conflicts with the upstream bindings that has the same file and update the relevant legacy SoC Device Trees to reflect this change.
This is useful while compiling the DT and driver of the new SoC files withOF_UPSTREAMenabled.Signed-off-by Manikandan Muralidharan <[email protected]>--- MAINTAINERS | 2 +- arch/arm/dts/at91-sama7g5ek-u-boot.dtsi | 2 +- arch/arm/dts/at91sam9260.dtsi | 2 +- arch/arm/dts/at91sam9261.dtsi | 2 +- arch/arm/dts/at91sam9263.dtsi | 2 +- arch/arm/dts/at91sam9g45.dtsi | 2 +- arch/arm/dts/at91sam9n12.dtsi | 2 +- arch/arm/dts/at91sam9rl.dtsi | 2 +- arch/arm/dts/at91sam9x5.dtsi | 2 +- arch/arm/dts/sama5d3.dtsi | 2 +- arch/arm/dts/sama5d3_mci2.dtsi | 2 +- arch/arm/dts/sama5d3_tcb1.dtsi | 2 +- arch/arm/dts/sama5d3_uart.dtsi | 2 +- arch/arm/dts/sama5d4.dtsi | 2 +- include/dt-bindings/clock/{at91.h => at91-pmc-status.h} | 0 15 files changed, 14 insertions(+), 14 deletions(-)Quoted 2 lines
rename
include/dt-bindings/clock/{at91.h=>at91-pmc-status.h} (100%)Quoted 4 lines
AFAICS,
include/dt-bindings/clock/at91.his just a subset ofdts/upstream/include/dt-bindings/clock/at91.h. If that's true then we should just be able to drop localinclude/dt-bindings/clock/at91.hfrom U-Boot tree. Won't that just work fine?
Quoted 5 lines
Yes, you're right. It's a subset of the upstream
at91.h. However, we must retain it due to dependencies with legacy SoC files that haven't yet been migrated toOF_UPSTREAM. I believe migrating those files now would introduce a significant number of changes w.r.t Device Tree files."
What kind of dependencies ? If current at91.h is a subset of upstream at91.h, then you could include the upstream at91.h, which would only bring extra defines which would be unused.
Are there more problems other than just being a subset ? From what I remember, some defines were different versus upstream, and this could cause problems.
Eugen
Quoted 193 lines
Quoted 192 lines
-Sumit
Quoted 189 lines
MAINTAINERS +1
-1@@ -464,7 +464,7 @@ F: drivers/memory/atmel-ebi.c F: drivers/misc/microchip_flexcom.c F: drivers/timer/atmel_tcb_timer.c F: include/dt-bindings/clk/at91.h -F: include/dt-bindings/clock/at91.h +F: include/dt-bindings/clock/at91-pmc-status.h F: include/dt-bindings/dma/at91.h F: include/dt-bindings/mfd/at91-usart.h F: include/dt-bindings/mfd/atmel-flexcom.harch/arm/dts/at91-sama7g5ek-u-boot.dtsi +1
-1@@ -12,7 +12,7 @@ #include "sama7g5-pinfunc.h" #include <dt-bindings/reset/sama7g5-reset.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { chosen {arch/arm/dts/at91sam9260.dtsi +1
-1@@ -12,7 +12,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9260 family SoC";arch/arm/dts/at91sam9261.dtsi +1
-1@@ -10,7 +10,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9261 family SoC";arch/arm/dts/at91sam9263.dtsi +1
-1@@ -10,7 +10,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9263 family SoC";arch/arm/dts/at91sam9g45.dtsi +1
-1@@ -14,7 +14,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9G45 family SoC";arch/arm/dts/at91sam9n12.dtsi +1
-1@@ -12,7 +12,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9N12 SoC";arch/arm/dts/at91sam9rl.dtsi +1
-1@@ -8,7 +8,7 @@ #include "skeleton.dtsi" #include <dt-bindings/pinctrl/at91.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/pwm/pwm.h>arch/arm/dts/at91sam9x5.dtsi +1
-1@@ -14,7 +14,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel AT91SAM9x5 family SoC";arch/arm/dts/sama5d3.dtsi +1
-1@@ -13,7 +13,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { model = "Atmel SAMA5D3 family SoC";arch/arm/dts/sama5d3_mci2.dtsi +1
-1@@ -9,7 +9,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { ahb {arch/arm/dts/sama5d3_tcb1.dtsi +1
-1@@ -9,7 +9,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { aliases {arch/arm/dts/sama5d3_uart.dtsi +1
-1@@ -9,7 +9,7 @@ #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> / { aliases {arch/arm/dts/sama5d4.dtsi +1
-1@@ -44,7 +44,7 @@ */ #include "skeleton.dtsi" -#include <dt-bindings/clock/at91.h> +#include <dt-bindings/clock/at91-pmc-status.h> #include <dt-bindings/dma/at91.h> #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h>include/dt-bindings/clock/at91-pmc-status.h renamed from include/dt-bindings/clock/at91.h +0
-1--2.25.1
PATCH v3 2/8 clk: at91: sam9x60-pll: add support for core clock frequency inputs
In reply to Manikandan MuralidharanFrom: Varshini Rajendran <[email protected]>
Add support for different core clock frequency input ranges for different PLL IDs in the PLL driver and align sam9x60, sama7g5 SOC platforms.
--- drivers/clk/at91/clk-sam9x60-pll.c | 17 ++++++++--------- drivers/clk/at91/pmc.h | 1 + drivers/clk/at91/sam9x60.c | 7 +++++++ drivers/clk/at91/sama7g5.c | 6 ++++++ 4 files changed, 22 insertions(+), 9 deletions(-)
drivers/clk/at91/clk-sam9x60-pll.c +8 -9
@@ -31,9 +31,6 @@#define UPLL_DIV 2#define PLL_MUL_MAX (FIELD_GET(PMC_PLL_CTRL1_MUL_MSK, UINT_MAX) + 1) -#define FCORE_MIN (600000000) -#define FCORE_MAX (1200000000) -#define PLL_MAX_ID 7struct sam9x60_pll {
@@ -55,14 +52,15 @@ static inline bool sam9x60_pll_ready(void __iomem *base, int id)return !!(status &BIT (id)); } -static long sam9x60_frac_pll_compute_mul_frac (u32 *mul,u32 *frac,ulong rate, +static long sam9x60_frac_pll_compute_mul_frac (const struct clk_range *core_clk, +u32 *mul,u32 *frac,ulong rate,ulong parent_rate) {unsigned long tmprate, remainder;unsigned long nmul =0 ;unsigned long nfrac =0 ; -if (rate <FCORE_MIN || rate >FCORE_MAX ) +if (rate < core_clk->min || rate > core_clk->max)return -ERANGE ;/*
@@ -82,7 +80,7 @@ static long sam9x60_frac_pll_compute_mul_frac(u32 *mul, u32 *frac, ulong rate, }/* Check if resulted rate is valid. */ -if (tmprate <FCORE_MIN || tmprate >FCORE_MAX ) +if (tmprate < core_clk[0 ].min || tmprate > core_clk[0 ].max)return -ERANGE ; *mul = nmul -1 ;
@@ -103,8 +101,8 @@ static ulong sam9x60_frac_pll_set_rate(struct clk *clk, ulong rate)if (!parent_rate)return 0 ; - ret =sam9x60_frac_pll_compute_mul_frac (&nmul, &nfrac, rate, - parent_rate); + ret =sam9x60_frac_pll_compute_mul_frac (pll->characteristics->core_output, + &nmul, &nfrac, rate, parent_rate);if (ret <0 )return 0 ;
@@ -163,7 +161,8 @@ static int sam9x60_frac_pll_enable(struct clk *clk)ulong crate; crate =sam9x60_frac_pll_get_rate (clk); -if (crate <FCORE_MIN || crate >FCORE_MAX ) +if (crate < pll->characteristics->core_output[0 ].min || + crate > pll->characteristics->core_output[0 ].max)return -ERANGE ; pmc_update_bits(base, AT91_PMC_PLL_UPDT, AT91_PMC_PLL_UPDT_ID_MSK,
drivers/clk/at91/pmc.h +1 -0
@@ -38,6 +38,7 @@ struct clk_pll_characteristics {struct clk_range input;int num_output;const struct clk_range *output; +const struct clk_range *core_output;u16 *icpll;u8 *out; u8 upll : 1;
drivers/clk/at91/sam9x60.c +7 -0
@@ -112,17 +112,24 @@ static const struct clk_range upll_outputs[] = { { .min = 300000000, .max = 500000000 }, }; +/* Fractional PLL core output range. */ +static const struct clk_range core_outputs[] = { + { .min =600000000 , .max =1200000000 }, +}; +/* PLL characteristics. */ static const struct clk_pll_characteristics apll_characteristics = { .input = { .min =12000000 , .max =48000000 }, .num_output =ARRAY_SIZE (plla_outputs), .output = plla_outputs, + .core_output = core_outputs, };static const struct clk_pll_characteristics upll_characteristics = { .input = { .min =12000000 , .max =48000000 }, .num_output =ARRAY_SIZE (upll_outputs), .output = upll_outputs, + .core_output = core_outputs, .upll = true, };
drivers/clk/at91/sama7g5.c +6 -0
@@ -158,11 +158,17 @@ static const struct clk_range pll_outputs[] = { { .min = 2343750, .max = 1200000000 }, }; +/* Fractional PLL core output range. */ +static const struct clk_range core_outputs[] = { + { .min =600000000 , .max =1200000000 }, +}; +/* PLL characteristics. */ static const struct clk_pll_characteristics pll_characteristics = { .input = { .min =12000000 , .max =50000000 }, .num_output =ARRAY_SIZE (pll_outputs), .output = pll_outputs, + .core_output = core_outputs, };/* Layout for fractional PLLs. */
Signature · 1 line
2.25.1
PATCH v3 3/8 clk: at91: sam9x60-pll: add support for HW PLL freq dividers
In reply to Manikandan MuralidharanFrom: Varshini Rajendran <[email protected]>
Add support for hardware dividers for PLL IDs.In sam9x7 SoC, PLL_ID_PLLA and PLL_ID_PLLA_DIV2 has /2 hardware dividers each.
fcorepllack -----> HW Div = 2 -+--> fpllack
|
+--> HW Div = 2 ---> fplladiv2ck--- drivers/clk/at91/clk-sam9x60-pll.c | 38 +++++++++++++++++++++++++++++- drivers/clk/at91/pmc.h | 1 + 2 files changed, 38 insertions(+), 1 deletion(-)
drivers/clk/at91/clk-sam9x60-pll.c +37 -1
@@ -22,6 +22,7 @@#define UBOOT_DM_CLK_AT91_SAM9X60_DIV_PLL "at91-sam9x60-div-pll-clk"#define UBOOT_DM_CLK_AT91_SAM9X60_FRAC_PLL "at91-sam9x60-frac-pll-clk" +#define UBOOT_DM_CLK_AT91_SAM9X60_FIXED_DIV_PLL "at91-sam9x60-fixed-div-pll-clk"#define PMC_PLL_CTRL0_DIV_MSK GENMASK(7, 0)#define PMC_PLL_CTRL1_MUL_MSK GENMASK(31, 24)
@@ -140,6 +141,7 @@ static ulong sam9x60_frac_pll_get_rate(struct clk *clk)void __iomem *base = pll->base;ulong parent_rate =clk_get_parent_rate (clk);u32 mul, frac, val; +ulong pll_rate;if (!parent_rate)return 0 ;
@@ -149,8 +151,12 @@ static ulong sam9x60_frac_pll_get_rate(struct clk *clk)pmc_read (base,AT91_PMC_PLL_CTRL1 , &val); mul = (val & pll->layout->mul_mask) >> pll->layout->mul_shift; frac = (val & pll->layout->frac_mask) >> pll->layout->frac_shift; + pll_rate = (parent_rate * (mul +1 ) + ((u64 )parent_rate * frac >>22 )); -return (parent_rate * (mul +1 ) + ((u64 )parent_rate * frac >>22 )); +if (pll->layout->div2) + pll_rate >>=1 ; + +return pll_rate; }static int sam9x60_frac_pll_enable (struct clk *clk)
@@ -359,6 +365,16 @@ static ulong sam9x60_div_pll_get_rate(struct clk *clk)return parent_rate / (div +1 ); } +static ulong sam9x60_fixed_div_pll_get_rate (struct clk *clk) +{ +ulong parent_rate =clk_get_parent_rate (clk); + +if (!parent_rate) +return 0 ; + +return parent_rate >>1 ; +} +static const struct clk_ops sam9x60_div_pll_ops = { .enable = sam9x60_div_pll_enable, .disable = sam9x60_div_pll_disable,
@@ -366,6 +382,12 @@ static const struct clk_ops sam9x60_div_pll_ops = { .get_rate = sam9x60_div_pll_get_rate, }; +static const struct clk_ops sam9x60_fixed_div_pll_ops = { + .enable = sam9x60_div_pll_enable, + .disable = sam9x60_div_pll_disable, + .get_rate = sam9x60_fixed_div_pll_get_rate, +}; +static struct clk * sam9x60_clk_register_pll(void __iomem *base, const char *type, const char *name, const char *parent_name, u8 id,
@@ -406,6 +428,13 @@ sam9x60_clk_register_div_pll(void __iomem *base, const char *name,const struct clk_pll_characteristics *characteristics, const struct clk_pll_layout *layout, bool critical) { + if (layout->div2) { + return sam9x60_clk_register_pll(base, +UBOOT_DM_CLK_AT91_SAM9X60_FIXED_DIV_PLL ,name ,parent_name , +id ,characteristics ,layout , + CLK_GET_RATE_NOCACHE | (critical ? CLK_IS_CRITICAL : 0)); + } + return sam9x60_clk_register_pll(base, UBOOT_DM_CLK_AT91_SAM9X60_DIV_PLL, name, parent_name, id, characteristics, layout,
@@ -431,6 +460,13 @@ U_BOOT_DRIVER(at91_sam9x60_div_pll_clk) = { .flags = DM_FLAG_PRE_RELOC, }; +U_BOOT_DRIVER (at91_sam9x60_fixed_div_pll_clk) = { + .name =UBOOT_DM_CLK_AT91_SAM9X60_FIXED_DIV_PLL , + .id =UCLASS_CLK , + .ops = &sam9x60_fixed_div_pll_ops, + .flags =DM_FLAG_PRE_RELOC , +}; +U_BOOT_DRIVER (at91_sam9x60_frac_pll_clk) = { .name =UBOOT_DM_CLK_AT91_SAM9X60_FRAC_PLL , .id =UCLASS_CLK ,
drivers/clk/at91/pmc.h +1 -0
@@ -54,6 +54,7 @@ struct clk_pll_layout {u8 frac_shift;u8 div_shift;u8 endiv_shift; +u8 div2; };struct clk_programmable_layout {
Signature · 1 line
2.25.1
PATCH v3 4/8 clk: at91: sam9x7: add pmc driver for sam9x7 SoC family
In reply to Manikandan MuralidharanFrom: Varshini Rajendran <[email protected]>
Add PMC driver support for sam9x7 SoC family
--- drivers/clk/at91/Makefile | 1 + drivers/clk/at91/sam9x7.c | 1094 +++++++++++++++++++++++++++++++++++++ 2 files changed, 1095 insertions(+) create mode 100644 drivers/clk/at91/sam9x7.c
drivers/clk/at91/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_AT91_SAM9X60_PLL) += clk-sam9x60-pll.o obj-$(CONFIG_AT91_SAM9X60_USB) += clk-sam9x60-usb.o obj-$(CONFIG_SAMA7G5) += sama7g5.o obj-$(CONFIG_SAM9X60) += sam9x60.o +obj-$(CONFIG_SAM9X7) += sam9x7.o else obj-y += compat.o endif
drivers/clk/at91/sam9x7.c new file +1094 -0
1,094 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v3 5/8 ARM: at91: Add sam9x7 soc
In reply to Manikandan MuralidharanFrom: Varshini Rajendran <[email protected]>
Add new Microchip sam9x7 SoC based on an ARM926.
--- arch/arm/mach-at91/Kconfig | 4 + arch/arm/mach-at91/arm926ejs/Makefile | 1 + arch/arm/mach-at91/arm926ejs/sam9x7_devices.c | 49 +++++ arch/arm/mach-at91/include/mach/hardware.h | 2 + arch/arm/mach-at91/include/mach/sam9x7.h | 172 ++++++++++++++++++ 5 files changed, 228 insertions(+) create mode 100644 arch/arm/mach-at91/arm926ejs/sam9x7_devices.c create mode 100644 arch/arm/mach-at91/include/mach/sam9x7.h
arch/arm/mach-at91/Kconfig +4 -0
@@ -43,6 +43,10 @@ config SAM9X60 bool select CPU_ARM926EJS +config SAM9X7 + bool + select CPU_ARM926EJS + config SAMA7G5 bool select CPU_V7A
arch/arm/mach-at91/arm926ejs/Makefile +1 -0
@@ -14,6 +14,7 @@ obj-$(CONFIG_AT91SAM9G45) += at91sam9m10g45_devices.o obj-$(CONFIG_AT91SAM9N12) += at91sam9n12_devices.o obj-$(CONFIG_AT91SAM9X5) += at91sam9x5_devices.o obj-$(CONFIG_SAM9X60) += sam9x60_devices.o +obj-$(CONFIG_SAM9X7) += sam9x7_devices.o obj-y += clock.o obj-y += cpu.o ifndef CONFIG_$(PHASE_)SYSRESET
arch/arm/mach-at91/arm926ejs/sam9x7_devices.c new file +49 -0
49 lines not on this page · raw message
arch/arm/mach-at91/include/mach/hardware.h +2 -0
@@ -23,6 +23,8 @@# include <asm/arch/at91sam9x5.h> #elif defined(CONFIG_SAM9X60 )# include <asm/arch/sam9x60.h> +#elif defined(CONFIG_SAM9X7 ) +# include <asm/arch/sam9x7.h> #elif defined(CONFIG_SAMA7G5 )# include <asm/arch/sama7g5.h> #elif defined(CONFIG_SAMA5D2 )
arch/arm/mach-at91/include/mach/sam9x7.h new file +172 -0
172 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v3 6/8 ARM: dts: at91: sam9x75_curiosity: add tweaks for sam9x75 curiosity board
In reply to Manikandan MuralidharanSince the SoC and board DT are already available in dts/upstream, add the difference from upstream DTS to at91-sam9x75_curiosity-u-boot.dtsi
--- .../dts/at91-sam9x75_curiosity-u-boot.dtsi | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi
arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi new file +107 -0
@@ -0,0 +1,107 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * at91-sam9x75_curiosity-u-boot.dtsi - Device Tree file for SAM9X75 + * CURIOSITY board. + * + * Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries + * + * Author: Manikandan Muralidharan <[email protected]> + */ + +/ { + cpus { + cpu@0 { + clocks = <&pmc PMC_TYPE_CORE 25>, <&pmc PMC_TYPE_CORE 17>, <&main_xtal>; + clock-names = "cpu", "master", "xtal"; + }; + }; + + clocks { + slow_rc_osc: slow_rc_osc { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <18500>; + }; + + main_rc: main_rc { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <12000000>; + }; + }; + + ahb { + bootph-all; + + apb { + bootph-all; + + pinctrl { + bootph-all; + }; + }; + }; + + chosen { + bootph-all; + }; +}; + +&clk32k { + bootph-all; + clocks = <&slow_rc_osc>, <&slow_xtal>; +}; + +&dbgu { + bootph-all; +}; + +&gmac { + compatible = "microchip,sam9x7-gem", "cdns,sama7g5-gem"; +}; + +&main_rc { + bootph-all; +}; + +&main_xtal { + bootph-all; +}; + +&pinctrl_dbgu_default { + bootph-all; +}; + +&pinctrl_sdmmc0_default { + bootph-all; +}; + +&pioA { + bootph-all; +}; + +&pioB { + bootph-all; +}; + +&pit64b0 { + bootph-all; +}; + +&pmc { + bootph-all; + clocks = <&clk32k 1>, <&clk32k 0>, <&main_xtal>, <&main_rc>; + clock-names = "td_slck", "md_slck", "main_xtal", "main_rc"; +}; + +&sdmmc0 { + bootph-all; +}; + +&slow_xtal { + bootph-all; +}; + +&slow_rc_osc { + bootph-all; +};
Signature · 1 line
2.25.1
PATCH v3 7/8 board: sam9x75_curiosity: Add support for sam9x75 curiosity
In reply to Manikandan MuralidharanAdd board specific functions for sam9x75 curiosity
--- arch/arm/mach-at91/Kconfig | 8 +++ board/atmel/sam9x75_curiosity/Kconfig | 15 +++++ board/atmel/sam9x75_curiosity/MAINTAINERS | 6 ++ board/atmel/sam9x75_curiosity/Makefile | 7 ++ .../sam9x75_curiosity/sam9x75_curiosity.c | 66 +++++++++++++++++++ include/configs/sam9x75_curiosity.h | 23 +++++++ 6 files changed, 125 insertions(+) create mode 100644 board/atmel/sam9x75_curiosity/Kconfig create mode 100644 board/atmel/sam9x75_curiosity/MAINTAINERS create mode 100644 board/atmel/sam9x75_curiosity/Makefile create mode 100644 board/atmel/sam9x75_curiosity/sam9x75_curiosity.c create mode 100644 include/configs/sam9x75_curiosity.h
arch/arm/mach-at91/Kconfig +8 -0
@@ -158,6 +158,13 @@ config TARGET_SAM9X60_CURIOSITY select BOARD_EARLY_INIT_F select BOARD_LATE_INIT +config TARGET_SAM9X75_CURIOSITY + bool "SAM9X75 CURIOSITY board" + select SAM9X7 + select BOARD_EARLY_INIT_F + select BOARD_LATE_INIT + imply OF_UPSTREAM + config TARGET_SAMA5D2_PTC_EK bool "SAMA5D2 PTC EK board" select BOARD_EARLY_INIT_F
@@ -355,6 +362,7 @@ source "board/atmel/at91sam9rlek/Kconfig" source "board/atmel/at91sam9x5ek/Kconfig" source "board/atmel/sam9x60ek/Kconfig" source "board/atmel/sam9x60_curiosity/Kconfig" +source "board/atmel/sam9x75_curiosity/Kconfig" source "board/atmel/sama7g5ek/Kconfig" source "board/atmel/sama7g54_curiosity/Kconfig" source "board/atmel/sama5d2_ptc_ek/Kconfig"
board/atmel/sam9x75_curiosity/Kconfig new file +15 -0
@@ -0,0 +1,15 @@ +if TARGET_SAM9X75_CURIOSITY + +config SYS_BOARD + default "sam9x75_curiosity" + +config SYS_VENDOR + default "atmel" + +config SYS_SOC + default "at91" + +config SYS_CONFIG_NAME + default "sam9x75_curiosity" + +endif
board/atmel/sam9x75_curiosity/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +SAM9X75 CURIOSITY BOARD +M: Manikandan Muralidharan <[email protected]> +S: Maintained +F: board/atmel/sam9x75_curiosity/ +F: include/configs/sam9x75_curiosity.h +F: arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi
board/atmel/sam9x75_curiosity/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries +# +# Author: Manikandan Muralidharan <[email protected]> + +obj-y += sam9x75_curiosity.o
board/atmel/sam9x75_curiosity/sam9x75_curiosity.c new file +66 -0
66 lines not on this page · raw message
include/configs/sam9x75_curiosity.h new file +23 -0
@@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Configuration settings for the SAM9X75 CURIOSITY board. +* +* Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries +* +* Author: Manikandan Muralidharan <[email protected]> +*/ + +#ifndef __CONFIG_H__ +#define __CONFIG_H__ + +#define CFG_SYS_AT91_SLOW_CLOCK 32768 +#define CFG_SYS_AT91_MAIN_CLOCK 24000000/* 24 MHz crystal */ + +#define CFG_USART_BASE ATMEL_BASE_DBGU +#define CFG_USART_ID 0/* ignored in arm */ + +/* SDRAM */ +#define CFG_SYS_SDRAM_BASE 0x20000000 +#define CFG_SYS_SDRAM_SIZE 0x10000000/* 256 megs */ + +#endif
Signature · 1 line
2.25.1
PATCH v3 8/8 configs: sam9x75_curiosity: Add initial mmc default config
In reply to Manikandan MuralidharanAdd default configuration for sd-card to boot the linux kernel.
--- board/atmel/sam9x75_curiosity/MAINTAINERS | 1 + configs/sam9x75_curiosity_mmc_defconfig | 73 +++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 configs/sam9x75_curiosity_mmc_defconfig
board/atmel/sam9x75_curiosity/MAINTAINERS +1 -0
@@ -4,3 +4,4 @@ S: Maintained F: board/atmel/sam9x75_curiosity/ F: include/configs/sam9x75_curiosity.h F: arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi +F: configs/sam9x75_curiosity_mmc_defconfig
configs/sam9x75_curiosity_mmc_defconfig new file +73 -0
73 lines not on this page · raw message
Signature · 1 line
2.25.1