ARM: at91: move to common clk framework
Subsystems (19)
cover ARM: at91: move to common clk framework
Hello,
Sorry for the noise, the first submission has been filtered.
This patch series is a proposal to move at91 clock implementation to common clk framework.
Most of the clock provided by the PMC (Power Management Controller) are implemented :
- main clock (main oscillator)
- pll clocks
- master clock
- programmable clocks
- utmi clock
- peripheral clocks
- system clocks
This implementation is compatible with device tree: the goal is to define the whole clock tree in the device tree (all currently available dt SoCs and boards are patched to support dt clocks). Please feel free to comment the dt bindinds (I'm not sure about the name I choose or the position of clock nodes: children of pmc node).
I removed the register_clocks function in SoC supporting dt boards only:
- at91sam9x5 SoCs
- at91sam9n12 SoC
- sama5d3 SoCs
This patch series also update at91 drivers calling clk_enable/disable instead of the preferred clk_prepare_enable/disable_unprepare functions.
I know there are a lot of cleanup in progress for at91 arch, so please tell me if you think this transition to common clk framework should wait.
This patch series has been tested on Kizbox (sam9g20 SoC) board using device tree. It compiles for other SoCs and both with and without dt support, but it has not been tested.
The clocks rate/parent change has not been tested.
Best Regards,
Boris
Boris BREZILLON (50):
ARM: at91: move at91_pmc.h to include/linux/clk/at91.h
ARM: at91: add PMC main clock
ARM: at91: add PMC pll clocks
ARM: at91: add PMC master clock
ARM: at91: add PMC system clocks
ARM: at91: add PMC peripheral clocks
ARM: at91: add PMC programmable clocks
ARM: at91: add PMC utmi clock support
ARM: at91: add PMC usb clock support
ARM: at91: add PMC smd clock support
ARM: at91: add PMC clk device tree binding doc
ARM: at91: move to common clk framework
ARM: at91: move at91rm9200 SoC to new at91 clk implem
ARM: at91: move at91sam9260 SoC to new at91 clk implem
ARM: at91: move at91sam9263 SoC to new at91 clk implem
ARM: at91: move at91sam9263 SoC to new at91 clk implem
ARM: at91: move at91sam9g45 SoC to new at91 clk implem
ARM: at91: move at91sam9n12 SoC to new at91 clk implem
ARM: at91: move at91sam9rl SoC to new at91 clk implem
ARM: at91: move at91sam9x5 SoCs to new at91 clk implem
ARM: at91: move at91sam9 SoCs to new at91 clk implem
ARM: at91: move sama5d3 SoCs to new at91 clk implem
ARM: at91: move at91rm9200 boards to new at91 clk implem
ARM: at91: move at91sam9 boards to new at91 clk implem
ARM: at91: move pit timer to common clk framework
ARM: at91/tc/clocksource: prepare clk before calling enable
at_hdmac: prepare clk before calling enable
ASoC: atmel-ssc: prepare clk before calling enable
mmc: atmel-mci: prepare clk before calling enable
pwm: atmel-tcb: prepare clk before calling enable
tty: atmel_serial: prepare clk before calling enable
usb: gadget: at91_udc: prepare clk before calling enable ehci-atmel.c: prepare clk before calling enable
USB: ohci-at91: prepare clk before calling enable at91/avr32/atmel_lcdfb: prepare clk before calling enable
ARM: at91/dt: move at91rm9200 SoC to new at91 clk implem
ARM: at91/dt: move at91sam9260 SoC to new at91 clk implem
ARM: at91/dt: move at91sam9263 SoC to new at91 clk implem
ARM: at91/dt: move at91sam9g45 SoC to new at91 clk implem
ARM: at91/dt: move at91sam9n12 SoC to new at91 clk implem
ARM: at91/dt: move at91sam9x5 SoCs to new at91 clk implem
ARM: at91/dt: move at91sam9g20 SoC to new at91 clk implem
ARM: at91/dt: move sama5d3 SoCs to to new at91 clk implem
ARM: at91/dt: move sam9260/sam9g20 boards to new at91 clk implem
ARM: at91/dt: move rm9200 boards to new at91 clk implem
ARM: at91/dt: move sam9263 boards to new at91 clk implem
ARM: at91/dt: move sam9g45 boards to new at91 clk implem
ARM: at91/dt: move sam9n12 boards to new at91 clk implem
ARM: at91/dt: move sam9x5 boards to new at91 clk implem
ARM: at91/dt: move sama5d3 boards to new at91 clk implem
.../devicetree/bindings/clock/at91-clock.txt | 247 +++++ arch/arm/boot/dts/animeo_ip.dts | 17 +- arch/arm/boot/dts/at91-ariag25.dts | 17 +- arch/arm/boot/dts/at91rm9200.dtsi | 133 +++ arch/arm/boot/dts/at91rm9200ek.dts | 17 +- arch/arm/boot/dts/at91sam9260.dtsi | 144 ++- arch/arm/boot/dts/at91sam9263.dtsi | 135 +++ arch/arm/boot/dts/at91sam9263ek.dts | 17 +- arch/arm/boot/dts/at91sam9g15.dtsi | 11 + arch/arm/boot/dts/at91sam9g20.dtsi | 37 + arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 17 +- arch/arm/boot/dts/at91sam9g25.dtsi | 3 + arch/arm/boot/dts/at91sam9g35.dtsi | 23 + arch/arm/boot/dts/at91sam9g45.dtsi | 157 ++++ arch/arm/boot/dts/at91sam9m10g45ek.dts | 17 +- arch/arm/boot/dts/at91sam9n12.dtsi | 153 ++++ arch/arm/boot/dts/at91sam9n12ek.dts | 17 +- arch/arm/boot/dts/at91sam9x25.dtsi | 25 +- arch/arm/boot/dts/at91sam9x35.dtsi | 3 + arch/arm/boot/dts/at91sam9x5.dtsi | 226 +++-- arch/arm/boot/dts/at91sam9x5_can.dtsi | 24 + arch/arm/boot/dts/at91sam9x5_isi.dtsi | 24 + arch/arm/boot/dts/at91sam9x5_lcdc.dtsi | 32 + arch/arm/boot/dts/at91sam9x5_macb0.dtsi | 68 ++ arch/arm/boot/dts/at91sam9x5_macb1.dtsi | 56 ++ arch/arm/boot/dts/at91sam9x5_usart3.dtsi | 60 ++ arch/arm/boot/dts/ge863-pro3.dtsi | 16 +- arch/arm/boot/dts/kizbox.dts | 5 + arch/arm/boot/dts/mpa1600.dts | 16 +- arch/arm/boot/dts/pm9g45.dts | 16 +- arch/arm/boot/dts/sama5d3.dtsi | 358 ++++---- arch/arm/boot/dts/sama5d31ek.dts | 4 + arch/arm/boot/dts/sama5d33ek.dts | 2 + arch/arm/boot/dts/sama5d34ek.dts | 4 + arch/arm/boot/dts/sama5d35ek.dts | 6 + arch/arm/boot/dts/sama5d3_can.dtsi | 67 ++ arch/arm/boot/dts/sama5d3_emac.dtsi | 56 ++ arch/arm/boot/dts/sama5d3_gmac.dtsi | 89 ++ arch/arm/boot/dts/sama5d3_lcd.dtsi | 73 ++ arch/arm/boot/dts/sama5d3_mci2.dtsi | 59 ++ arch/arm/boot/dts/sama5d3_tcb1.dtsi | 39 + arch/arm/boot/dts/sama5d3_uart.dtsi | 42 + arch/arm/boot/dts/sama5d3xcm.dtsi | 17 +- arch/arm/boot/dts/tny_a9260_common.dtsi | 17 +- arch/arm/boot/dts/tny_a9263.dts | 17 +- arch/arm/boot/dts/usb_a9260_common.dtsi | 17 +- arch/arm/boot/dts/usb_a9263.dts | 17 +- arch/arm/mach-at91/Kconfig | 26 + arch/arm/mach-at91/Makefile | 2 +- arch/arm/mach-at91/at91rm9200.c | 578 +++++++----- arch/arm/mach-at91/at91sam9260.c | 694 +++++++++----- arch/arm/mach-at91/at91sam9261.c | 581 ++++++++---- arch/arm/mach-at91/at91sam9263.c | 599 +++++++----- arch/arm/mach-at91/at91sam926x_time.c | 21 +- arch/arm/mach-at91/at91sam9g45.c | 705 ++++++++------ arch/arm/mach-at91/at91sam9g45_devices.c | 1 - arch/arm/mach-at91/at91sam9n12.c | 196 +--- arch/arm/mach-at91/at91sam9rl.c | 514 +++++++---- arch/arm/mach-at91/at91sam9x5.c | 291 +----- arch/arm/mach-at91/board-1arm.c | 12 +- arch/arm/mach-at91/board-afeb-9260v1.c | 11 +- arch/arm/mach-at91/board-cam60.c | 13 +- arch/arm/mach-at91/board-carmeva.c | 13 +- arch/arm/mach-at91/board-cpu9krea.c | 12 +- arch/arm/mach-at91/board-cpuat91.c | 12 +- arch/arm/mach-at91/board-csb337.c | 11 +- arch/arm/mach-at91/board-csb637.c | 11 +- arch/arm/mach-at91/board-dt-rm9200.c | 9 +- arch/arm/mach-at91/board-dt-sam9.c | 9 +- arch/arm/mach-at91/board-dt-sama5.c | 9 +- arch/arm/mach-at91/board-eb9200.c | 11 +- arch/arm/mach-at91/board-ecbat91.c | 12 +- arch/arm/mach-at91/board-eco920.c | 13 +- arch/arm/mach-at91/board-flexibity.c | 12 +- arch/arm/mach-at91/board-foxg20.c | 12 +- arch/arm/mach-at91/board-gsia18s.c | 8 +- arch/arm/mach-at91/board-kafa.c | 12 +- arch/arm/mach-at91/board-kb9202.c | 12 +- arch/arm/mach-at91/board-pcontrol-g20.c | 9 +- arch/arm/mach-at91/board-picotux200.c | 11 +- arch/arm/mach-at91/board-qil-a9260.c | 11 +- arch/arm/mach-at91/board-rm9200dk.c | 11 +- arch/arm/mach-at91/board-rm9200ek.c | 11 +- arch/arm/mach-at91/board-rsi-ews.c | 12 +- arch/arm/mach-at91/board-sam9-l9260.c | 11 +- arch/arm/mach-at91/board-sam9260ek.c | 11 +- arch/arm/mach-at91/board-sam9261ek.c | 15 +- arch/arm/mach-at91/board-sam9263ek.c | 11 +- arch/arm/mach-at91/board-sam9g20ek.c | 15 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 11 +- arch/arm/mach-at91/board-sam9rlek.c | 11 +- arch/arm/mach-at91/board-snapper9260.c | 12 +- arch/arm/mach-at91/board-stamp9g20.c | 15 +- arch/arm/mach-at91/board-yl-9200.c | 12 +- arch/arm/mach-at91/clock.c | 961 -------------------- arch/arm/mach-at91/clock.h | 49 - arch/arm/mach-at91/generic.h | 10 +- arch/arm/mach-at91/pm.c | 2 +- arch/arm/mach-at91/pm_slowclock.S | 2 +- arch/arm/mach-at91/pmc.c | 58 ++ arch/arm/mach-at91/sama5d3.c | 344 +------ arch/arm/mach-at91/setup.c | 38 +- arch/arm/mach-at91/stamp9g20.h | 2 +- drivers/clk/Makefile | 1 + drivers/clk/at91/Makefile | 11 + drivers/clk/at91/clk-main.c | 106 +++ drivers/clk/at91/clk-master.c | 317 +++++++ drivers/clk/at91/clk-peripheral.c | 376 ++++++++ drivers/clk/at91/clk-pll.c | 438 +++++++++ drivers/clk/at91/clk-plldiv.c | 125 +++ drivers/clk/at91/clk-programmable.c | 370 ++++++++ drivers/clk/at91/clk-smd.c | 157 ++++ drivers/clk/at91/clk-system.c | 189 ++++ drivers/clk/at91/clk-usb.c | 303 ++++++ drivers/clk/at91/clk-utmi.c | 114 +++ drivers/clocksource/tcb_clksrc.c | 10 +- drivers/dma/at_hdmac.c | 12 +- drivers/misc/atmel-ssc.c | 8 +- drivers/mmc/host/atmel-mci.c | 16 +- drivers/pwm/pwm-atmel-tcb.c | 4 +- drivers/tty/serial/atmel_serial.c | 35 +- drivers/usb/gadget/at91_udc.c | 12 +- drivers/usb/gadget/atmel_usba_udc.c | 2 +- drivers/usb/host/ehci-atmel.c | 8 +- drivers/usb/host/ohci-at91.c | 12 +- drivers/video/atmel_lcdfb.c | 8 +- .../mach/at91_pmc.h => include/linux/clk/at91.h | 122 ++- 127 files changed, 7588 insertions(+), 3862 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/at91-clock.txt create mode 100644 arch/arm/boot/dts/at91sam9x5_can.dtsi create mode 100644 arch/arm/boot/dts/at91sam9x5_isi.dtsi create mode 100644 arch/arm/boot/dts/at91sam9x5_lcdc.dtsi create mode 100644 arch/arm/boot/dts/at91sam9x5_macb0.dtsi create mode 100644 arch/arm/boot/dts/at91sam9x5_macb1.dtsi create mode 100644 arch/arm/boot/dts/at91sam9x5_usart3.dtsi create mode 100644 arch/arm/boot/dts/sama5d3_can.dtsi create mode 100644 arch/arm/boot/dts/sama5d3_emac.dtsi create mode 100644 arch/arm/boot/dts/sama5d3_gmac.dtsi create mode 100644 arch/arm/boot/dts/sama5d3_lcd.dtsi create mode 100644 arch/arm/boot/dts/sama5d3_mci2.dtsi create mode 100644 arch/arm/boot/dts/sama5d3_tcb1.dtsi create mode 100644 arch/arm/boot/dts/sama5d3_uart.dtsi delete mode 100644 arch/arm/mach-at91/clock.c delete mode 100644 arch/arm/mach-at91/clock.h create mode 100644 arch/arm/mach-at91/pmc.c create mode 100644 drivers/clk/at91/Makefile create mode 100644 drivers/clk/at91/clk-main.c create mode 100644 drivers/clk/at91/clk-master.c create mode 100644 drivers/clk/at91/clk-peripheral.c create mode 100644 drivers/clk/at91/clk-pll.c create mode 100644 drivers/clk/at91/clk-plldiv.c create mode 100644 drivers/clk/at91/clk-programmable.c create mode 100644 drivers/clk/at91/clk-smd.c create mode 100644 drivers/clk/at91/clk-system.c create mode 100644 drivers/clk/at91/clk-usb.c create mode 100644 drivers/clk/at91/clk-utmi.c rename arch/arm/mach-at91/include/mach/at91_pmc.h => include/linux/clk/at91.h (76%)
Signature · 1 line
1.7.9.5
RFC PATCH 1/50 ARM: at91: move at91_pmc.h to include/linux/clk/at91.h
This patch moves at91_pmc.h header from machine specific directory (arch/arm/mach-at91/include/mach/at91_pmc.h) to clk include directory (include/linux/clk/at91.h).
We need this to avoid reference to machine specific headers in clk drivers.
--- arch/arm/mach-at91/at91rm9200.c | 2 +- arch/arm/mach-at91/at91sam9260.c | 2 +- arch/arm/mach-at91/at91sam9261.c | 2 +- arch/arm/mach-at91/at91sam9263.c | 2 +- arch/arm/mach-at91/at91sam9g45.c | 2 +- arch/arm/mach-at91/at91sam9n12.c | 2 +- arch/arm/mach-at91/at91sam9rl.c | 2 +- arch/arm/mach-at91/at91sam9x5.c | 2 +- arch/arm/mach-at91/clock.c | 2 +- arch/arm/mach-at91/pm.c | 2 +- arch/arm/mach-at91/pm_slowclock.S | 2 +- arch/arm/mach-at91/sama5d3.c | 2 +- arch/arm/mach-at91/setup.c | 2 +- drivers/usb/gadget/atmel_usba_udc.c | 2 +- .../mach/at91_pmc.h => include/linux/clk/at91.h | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-)
arch/arm/mach-at91/at91rm9200.c +1 -1
@@ -11,13 +11,13 @@*/ #include <linux/module.h> +#include <linux/clk/at91.h> #include <asm/irq.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/system_misc.h> #include <mach/at91rm9200.h> -#include <mach/at91_pmc.h> #include <mach/at91_st.h> #include <mach/cpu.h>
arch/arm/mach-at91/at91sam9260.c +1 -1
@@ -11,6 +11,7 @@*/ #include <linux/module.h> +#include <linux/clk/at91.h> #include <asm/proc-fns.h> #include <asm/irq.h>
@@ -20,7 +21,6 @@#include <mach/cpu.h> #include <mach/at91_dbgu.h> #include <mach/at91sam9260.h> -#include <mach/at91_pmc.h> #include "at91_aic.h" #include "at91_rstc.h"
arch/arm/mach-at91/at91sam9261.c +1 -1
@@ -11,6 +11,7 @@*/ #include <linux/module.h> +#include <linux/clk/at91.h> #include <asm/proc-fns.h> #include <asm/irq.h>
@@ -19,7 +20,6 @@#include <asm/system_misc.h> #include <mach/cpu.h> #include <mach/at91sam9261.h> -#include <mach/at91_pmc.h> #include "at91_aic.h" #include "at91_rstc.h"
arch/arm/mach-at91/at91sam9263.c +1 -1
@@ -11,6 +11,7 @@*/ #include <linux/module.h> +#include <linux/clk/at91.h> #include <asm/proc-fns.h> #include <asm/irq.h>
@@ -18,7 +19,6 @@#include <asm/mach/map.h> #include <asm/system_misc.h> #include <mach/at91sam9263.h> -#include <mach/at91_pmc.h> #include "at91_aic.h" #include "at91_rstc.h"
arch/arm/mach-at91/at91sam9g45.c +1 -1
@@ -12,13 +12,13 @@#include <linux/module.h> #include <linux/dma-mapping.h> +#include <linux/clk/at91.h> #include <asm/irq.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/system_misc.h> #include <mach/at91sam9g45.h> -#include <mach/at91_pmc.h> #include <mach/cpu.h> #include "at91_aic.h"
arch/arm/mach-at91/at91sam9n12.c +1 -1
@@ -8,12 +8,12 @@#include <linux/module.h> #include <linux/dma-mapping.h> +#include <linux/clk/at91.h> #include <asm/irq.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <mach/at91sam9n12.h> -#include <mach/at91_pmc.h> #include <mach/cpu.h> #include "board.h"
arch/arm/mach-at91/at91sam9rl.c +1 -1
@@ -10,6 +10,7 @@*/ #include <linux/module.h> +#include <linux/clk/at91.h> #include <asm/proc-fns.h> #include <asm/irq.h>
@@ -19,7 +20,6 @@#include <mach/cpu.h> #include <mach/at91_dbgu.h> #include <mach/at91sam9rl.h> -#include <mach/at91_pmc.h> #include "at91_aic.h" #include "at91_rstc.h"
arch/arm/mach-at91/at91sam9x5.c +1 -1
@@ -8,12 +8,12 @@#include <linux/module.h> #include <linux/dma-mapping.h> +#include <linux/clk/at91.h> #include <asm/irq.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <mach/at91sam9x5.h> -#include <mach/at91_pmc.h> #include <mach/cpu.h> #include "board.h"
arch/arm/mach-at91/clock.c +1 -1
@@ -24,9 +24,9 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/of_address.h> +#include <linux/clk/at91.h> #include <mach/hardware.h> -#include <mach/at91_pmc.h> #include <mach/cpu.h> #include <asm/proc-fns.h>
arch/arm/mach-at91/pm.c +1 -1
@@ -19,13 +19,13 @@#include <linux/module.h> #include <linux/platform_device.h> #include <linux/io.h> +#include <linux/clk/at91.h> #include <asm/irq.h> #include <linux/atomic.h> #include <asm/mach/time.h> #include <asm/mach/irq.h> -#include <mach/at91_pmc.h> #include <mach/cpu.h> #include "at91_aic.h"
arch/arm/mach-at91/pm_slowclock.S +1 -1
@@ -13,8 +13,8 @@ */ #include <linux/linkage.h> +#include <linux/clk/at91.h> #include <mach/hardware.h> -#include <mach/at91_pmc.h> #include <mach/at91_ramc.h>
arch/arm/mach-at91/sama5d3.c +1 -1
@@ -9,12 +9,12 @@#include <linux/module.h> #include <linux/dma-mapping.h> +#include <linux/clk/at91.h> #include <asm/irq.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <mach/sama5d3.h> -#include <mach/at91_pmc.h> #include <mach/cpu.h> #include "soc.h"
arch/arm/mach-at91/setup.c +1 -1
@@ -11,6 +11,7 @@#include <linux/pm.h> #include <linux/of_address.h> #include <linux/pinctrl/machine.h> +#include <linux/clk/at91.h> #include <asm/system_misc.h> #include <asm/mach/map.h>
@@ -18,7 +19,6 @@#include <mach/hardware.h> #include <mach/cpu.h> #include <mach/at91_dbgu.h> -#include <mach/at91_pmc.h> #include "at91_shdwc.h" #include "soc.h"
drivers/usb/gadget/atmel_usba_udc.c +1 -1
@@ -328,7 +328,7 @@ static int vbus_is_present(struct usba_udc *udc)#if defined(CONFIG_ARCH_AT91SAM9RL ) -#include <mach/at91_pmc.h> +#include <linux/clk/at91.h> static void toggle_bias (int is_on) {
include/linux/clk/at91.h renamed from arch/arm/mach-at91/include/mach/at91_pmc.h +1 -1
@@ -1,5 +1,5 @@/* -* arch/arm/mach-at91/include/mach/at91_pmc.h +* include/linux/clk/at91.h * * Copyright (C) 2005 Ivan Kokshaysky * Copyright (C) SAN People
Signature · 1 line
1.7.9.5
RFC PATCH 2/50 ARM: at91: add PMC main clock
In reply to Boris BREZILLONThis is the at91 main oscillator clock implementation using common clk framework.
If rate is not provided during clock registraction it is computed using the slow clock (main clk parent in this case) rate and the MCFR register.
--- drivers/clk/at91/Makefile | 5 ++ drivers/clk/at91/clk-main.c | 106 +++++++++++++++++++++++++++++++++++++++++++ include/linux/clk/at91.h | 10 ++++ 3 files changed, 121 insertions(+)
drivers/clk/at91/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for at91 specific clk +# + +obj-y += clk-main.o
drivers/clk/at91/clk-main.c new file +106 -0
106 lines not on this page · raw message
include/linux/clk/at91.h +10 -0
@@ -16,6 +16,8 @@#ifndef AT91_PMC_H #define AT91_PMC_H +#include <linux/clk-provider.h> +#ifndef __ASSEMBLY__extern void __iomem *at91_pmc_base;
@@ -184,4 +186,12 @@ extern void __iomem *at91_pmc_base;#define AT91_PMC_PCR_DIV8 0x8/* Peripheral clock is MCK/8 */ #define AT91_PMC_PCR_EN (0x1 << 28)/* Enable */ + + + +struct clk *__init +at91_clk_register_main (const char *name, +const char *parent_name, +unsigned long rate); +#endif
Signature · 1 line
1.7.9.5
Re: [RFC PATCH 02/50] ARM: at91: add PMC main clock
Dear Boris BREZILLON,
Quoted 1 line · Boris BREZILLON
+ * This mainram is free software; you can redistribute it and/or modify
Looks like you did some funky 'sed' over your source files. In every clk driver, instead of "program" you have "<name of clock>ram" :-)
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Re: [RFC PATCH 02/50] ARM: at91: add PMC main clock
Quoted 7 lines · Thomas Petazzoni
Dear Boris BREZILLON,
Quoted 1 line · Boris BREZILLON
+ * This mainram is free software; you can redistribute it and/or modify
Looks like you did some funky 'sed' over your source files. In every clk driver, instead of "program" you have "<name of clock>ram" :-)
Oups.
I based all my implementations on programmable clocks and replaced every instance
of the "prog" pattern by the clock name.
That's why "program" is replaced by "<name of clock>ram".
I'll fix it.
Thanks
Quoted 2 lines
Thomas
RFC PATCH 3/50 ARM: at91: add PMC pll clocks
In reply to Boris BREZILLONThis is the at91 pll clock implementation using common clk framework.
The pll clock layout describe the PLLX register layout. There's four pll clock layouts:
- at91rm9200
- at91sam9g20
- at91sam9g45
- sama5d3
PLL clocks are given characteristics:
- min/max clock source rate
- ranges of valid clock output rates
- values to set in out and icpll fields for each supported output range
These characteristics are checked during rate change to avoid over/underclocking.
These characteristics are described in atmel's SoC datasheet in "Electrical Characteristics" paragraph.
--- drivers/clk/at91/Makefile | 2 +- drivers/clk/at91/clk-pll.c | 438 +++++++++++++++++++++++++++++++++++++++++ drivers/clk/at91/clk-plldiv.c | 125 ++++++++++++ include/linux/clk/at91.h | 39 ++++ 4 files changed, 603 insertions(+), 1 deletion(-)
drivers/clk/at91/Makefile +1 -1
@@ -2,4 +2,4 @@ # Makefile for at91 specific clk # -obj-y += clk-main.o +obj-y += clk-main.o clk-pll.o clk-plldiv.o
drivers/clk/at91/clk-pll.c new file +438 -0
438 lines not on this page · raw message
drivers/clk/at91/clk-plldiv.c new file +125 -0
125 lines not on this page · raw message
include/linux/clk/at91.h +39 -0
@@ -163,6 +163,8 @@ extern void __iomem *at91_pmc_base;#define AT91_PMC_CFDEV (1 << 18)/* Clock Failure Detector Event [some SAM9] */ #define AT91_PMC_IMR 0x6c/* Interrupt Mask Register */ +#define AT91_PMC_PLLICPR 0x80/* PLL Charge Pump Current Register */ +#define AT91_PMC_PROT 0xe4/* Write Protect Mode Register [some SAM9] */ #define AT91_PMC_WPEN (0x1 << 0)/* Write Protect Enable */ #define AT91_PMC_WPKEY (0xffffff << 8)/* Write Protect Key */
@@ -187,6 +189,26 @@ extern void __iomem *at91_pmc_base;#define AT91_PMC_PCR_EN (0x1 << 28)/* Enable */ +struct clk_range { +unsigned long min; +unsigned long max; +}; + +#define CLK_RANGE (MIN ,MAX ) {.min = MIN, .max = MAX,} + +struct clk_pll_characteristics { +struct clk_range input; +int num_output; +struct clk_range *output; +u16 *icpll; +u8 *out; +}; + +struct clk_pll_layout { +u32 pllr_mask; +u16 mul_mask; +u8 mul_shift; +}; struct clk * __init
@@ -194,4 +216,21 @@ at91_clk_register_main(const char *name,const char *parent_name, unsigned long rate); + +extern struct clk_pll_layout at91rm9200_pll_layout; + +extern struct clk_pll_layout at91sam9g45_pll_layout; + +extern struct clk_pll_layout at91sam9g20_pllb_layout; + +extern struct clk_pll_layout sama5d3_pll_layout; + +struct clk *__init +at91_clk_register_pll (const char *name,const char *parent_name,u8 id, +struct clk_pll_layout *layout, +struct clk_pll_characteristics *characteristics); + +struct clk *__init +at91_clk_register_plldiv (const char *name,const char *parent_name); +#endif
Signature · 1 line
1.7.9.5
RFC PATCH 4/50 ARM: at91: add PMC master clock
In reply to Boris BREZILLONThis is the at91 master clock implementation using common clk framework.
The pll clock layout describe the MCKR register layout. There's four pll clock layouts:
- at91rm9200
- at91sam9x5
Master clocks are given characteristics:
- min/max clock output rate
These characteristics are checked during rate change to avoid over/underclocking.
These characteristics are described in atmel's SoC datasheet in "Electrical Characteristics" paragraph.
--- drivers/clk/at91/Makefile | 2 +- drivers/clk/at91/clk-master.c | 317 +++++++++++++++++++++++++++++++++++++++++ include/linux/clk/at91.h | 23 +++ 3 files changed, 341 insertions(+), 1 deletion(-)
drivers/clk/at91/Makefile +1 -1
@@ -2,4 +2,4 @@ # Makefile for at91 specific clk # -obj-y += clk-main.o clk-pll.o clk-plldiv.o +obj-y += clk-main.o clk-pll.o clk-plldiv.o clk-master.o
drivers/clk/at91/clk-master.c new file +317 -0
317 lines not on this page · raw message
include/linux/clk/at91.h +23 -0
@@ -210,6 +210,17 @@ struct clk_pll_layout {u8 mul_shift; }; +struct clk_master_characteristics { +struct clk_range output; +u32 divisors[4 ]; +u8 have_div3_pres; +}; + +struct clk_master_layout { +u32 mask; +u8 pres_shift; +}; +struct clk *__init at91_clk_register_main(const char *name,
@@ -233,4 +244,16 @@ at91_clk_register_pll(const char *name, const char *parent_name, u8 id,struct clk *__init at91_clk_register_plldiv (const char *name,const char *parent_name); + +extern struct clk_master_layout at91rm9200_master_layout; + +extern struct clk_master_layout at91sam9x5_master_layout; + +struct clk *__init +at91_clk_register_master (const char *name,int num_parents, +const char **parent_names, +struct clk_master_layout *layout, +struct clk_master_characteristics *characteristics); + +#endif
Signature · 1 line
1.7.9.5
RFC PATCH 5/50 ARM: at91: add PMC system clocks
In reply to Boris BREZILLONThis is the at91 system clock implementation using common clk framework.
Some peripheral needs to enable a "system" clock in order to work properly. Each system clock is given an id which is the bit offset used in SCER/SCDR registers.
--- drivers/clk/at91/Makefile | 1 + drivers/clk/at91/clk-system.c | 189 +++++++++++++++++++++++++++++++++++++++++ include/linux/clk/at91.h | 3 + 3 files changed, 193 insertions(+)
drivers/clk/at91/Makefile +1 -0
@@ -3,3 +3,4 @@ # obj-y += clk-main.o clk-pll.o clk-plldiv.o clk-master.o +obj-y += clk-system.o
drivers/clk/at91/clk-system.c new file +189 -0
189 lines not on this page · raw message
include/linux/clk/at91.h +3 -0
@@ -256,4 +256,7 @@ at91_clk_register_master(const char *name, int num_parents, struct clk_master_characteristics *characteristics); +struct clk *__init +at91_clk_register_system (const char *name,const char *parent_name,u8 id); +#endif
Signature · 1 line
1.7.9.5
RFC PATCH 6/50 ARM: at91: add PMC peripheral clocks
In reply to Boris BREZILLONThis is the at91 peripheral clock implementation using common clk framework.
Almost all peripherals provided by an at91 SoC need a clock to work properly. This clock is enabled/disabled using PCER/PCDR resgisters.
Each peripheral is given an id (see atmel's datasheets) which is used as bit position in SCER/SCDR registers.
Some new SoCs (at91sam9x5 and sama5d3) provide a new register (PCR) where you can configure the peripheral clock as a division of the master clock. This will help reducing the peripherals power comsumption.
This patch fixes erronous AT91_PMC_PCR_DIV values.
--- drivers/clk/at91/Makefile | 2 +- drivers/clk/at91/clk-peripheral.c | 376 +++++++++++++++++++++++++++++++++++++ include/linux/clk/at91.h | 14 +- 3 files changed, 388 insertions(+), 4 deletions(-)
drivers/clk/at91/Makefile +1 -1
@@ -3,4 +3,4 @@ # obj-y += clk-main.o clk-pll.o clk-plldiv.o clk-master.o -obj-y += clk-system.o +obj-y += clk-system.o clk-peripheral.o
drivers/clk/at91/clk-peripheral.c new file +376 -0
376 lines not on this page · raw message
include/linux/clk/at91.h +11 -3
@@ -183,9 +183,9 @@ extern void __iomem *at91_pmc_base;#define AT91_PMC_PCR_CMD (0x1 << 12)/* Command (read=0, write=1) */ #define AT91_PMC_PCR_DIV (n) ((n) << 16)/* Divisor Value */ #define AT91_PMC_PCR_DIV0 0x0/* Peripheral clock is MCK */ -#define AT91_PMC_PCR_DIV2 0x2/* Peripheral clock is MCK/2 */ -#define AT91_PMC_PCR_DIV4 0x4/* Peripheral clock is MCK/4 */ -#define AT91_PMC_PCR_DIV8 0x8/* Peripheral clock is MCK/8 */ +#define AT91_PMC_PCR_DIV2 0x1/* Peripheral clock is MCK/2 */ +#define AT91_PMC_PCR_DIV4 0x2/* Peripheral clock is MCK/4 */ +#define AT91_PMC_PCR_DIV8 0x3/* Peripheral clock is MCK/8 */ #define AT91_PMC_PCR_EN (0x1 << 28)/* Enable */
@@ -259,4 +259,12 @@ at91_clk_register_master(const char *name, int num_parents,struct clk *__init at91_clk_register_system (const char *name,const char *parent_name,u8 id); +struct clk *__init +at91_clk_register_peripheral (const char *name,const char *parent_name, +u32 id); + +struct clk *__init +at91_clk_register_sam9x5_peripheral (const char *name,const char *parent_name, +u32 id,u32 default_div); +#endif
Signature · 1 line
1.7.9.5
RFC PATCH 7/50 ARM: at91: add PMC programmable clocks
In reply to Boris BREZILLONThis is the at91 programmable clocks implementation using common clk framework.
A programmable clock is a clock which can be exported on a given pin to clock external devices.
Each programmable clock is given an id (from 0 to 8).
The number of available programmable clocks depends on the SoC you're using. Programmable clock driver only implements the clock setting (clock rate and parent setting). It must be chained to a system clock in order to enable/disable the generated clock.
The PCKX pins used to output the clock signals must be assigned to the appropriate peripheral (see atmel's datasheets).
--- drivers/clk/at91/Makefile | 2 + drivers/clk/at91/clk-programmable.c | 370 +++++++++++++++++++++++++++++++++++ include/linux/clk/at91.h | 18 ++ 3 files changed, 390 insertions(+)
drivers/clk/at91/Makefile +2 -0
@@ -4,3 +4,5 @@ obj-y += clk-main.o clk-pll.o clk-plldiv.o clk-master.o obj-y += clk-system.o clk-peripheral.o + +obj-$(CONFIG_AT91_PROGRAMMABLE_CLOCKS) += clk-programmable.o
drivers/clk/at91/clk-programmable.c new file +370 -0
370 lines not on this page · raw message
include/linux/clk/at91.h +18 -0
@@ -221,6 +221,12 @@ struct clk_master_layout {u8 pres_shift; }; +struct clk_programmable_layout { +u8 pres_shift; +u8 css_mask; +u8 have_slck_mck; +}; +struct clk *__init at91_clk_register_main(const char *name,
@@ -267,4 +273,16 @@ struct clk * __init at91_clk_register_sam9x5_peripheral(const char *name, const char *parent_name, u32 id, u32 default_div); + +extern struct clk_programmable_layout at91rm9200_programmable_layout; + +extern struct clk_programmable_layout at91sam9g45_programmable_layout; + +extern struct clk_programmable_layout at91sam9x5_programmable_layout; + +struct clk *__init +at91_clk_register_programmable (const char *name,const char **parent_names, +u8 num_parents,u8 id, +struct clk_programmable_layout *layout); +#endif
Signature · 1 line
1.7.9.5
RFC PATCH 8/50 ARM: at91: add PMC utmi clock
In reply to Boris BREZILLONThis is the at91 utmi clock implementation using common clk framework.
This clock is a pll with a fixed factor (x40).
It is used as a source for usb clock.
--- arch/arm/mach-at91/Kconfig | 7 +++ drivers/clk/at91/Makefile | 1 + drivers/clk/at91/clk-utmi.c | 114 +++++++++++++++++++++++++++++++++++++++++++ include/linux/clk/at91.h | 4 ++ 4 files changed, 126 insertions(+)
arch/arm/mach-at91/Kconfig +7 -0
@@ -1,5 +1,8 @@ if ARCH_AT91 +config HAVE_AT91_UTMI + bool + config HAVE_AT91_DBGU0 bool
@@ -65,6 +68,7 @@ config SOC_SAMA5D3 select SOC_SAMA5 select HAVE_FB_ATMEL select HAVE_AT91_DBGU1 + select HAVE_AT91_UTMI help Select this if you are using one of Atmel's SAMA5D3 family SoC. This support covers SAMA5D31, SAMA5D33, SAMA5D34, SAMA5D35.
@@ -106,12 +110,14 @@ config SOC_AT91SAM9RL select HAVE_AT91_DBGU0 select HAVE_FB_ATMEL select SOC_AT91SAM9 + select HAVE_AT91_UTMI config SOC_AT91SAM9G45 bool "AT91SAM9G45 or AT91SAM9M10 families" select HAVE_AT91_DBGU1 select HAVE_FB_ATMEL select SOC_AT91SAM9 + select HAVE_AT91_UTMI help Select this if you are using one of Atmel's AT91SAM9G45 family SoC. This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
@@ -121,6 +127,7 @@ config SOC_AT91SAM9X5 select HAVE_AT91_DBGU0 select HAVE_FB_ATMEL select SOC_AT91SAM9 + select HAVE_AT91_UTMI help Select this if you are using one of Atmel's AT91SAM9x5 family SoC. This means that your SAM9 name finishes with a '5' (except if it is
drivers/clk/at91/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-y += clk-main.o clk-pll.o clk-plldiv.o clk-master.o obj-y += clk-system.o clk-peripheral.o obj-$(CONFIG_AT91_PROGRAMMABLE_CLOCKS) += clk-programmable.o +obj-$(CONFIG_HAVE_AT91_UTMI) += clk-utmi.o
drivers/clk/at91/clk-utmi.c new file +114 -0
114 lines not on this page · raw message
include/linux/clk/at91.h +4 -0
@@ -285,4 +285,8 @@ at91_clk_register_programmable(const char *name, const char **parent_names, u8 num_parents, u8 id, struct clk_programmable_layout *layout); + +struct clk *__init +at91_clk_register_utmi (const char *name,const char *parent_name); +#endif
Signature · 1 line
1.7.9.5
RFC PATCH 9/50 ARM: at91: add PMC usb clock
In reply to Boris BREZILLONThis is the at91 usb clock implementation using common clk framework. This clock is used to clock usb ports (ohci, ehci and udc).
--- arch/arm/mach-at91/Kconfig | 11 ++ drivers/clk/at91/Makefile | 1 + drivers/clk/at91/clk-usb.c | 303 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/clk/at91.h | 9 ++ 4 files changed, 324 insertions(+)
arch/arm/mach-at91/Kconfig +11 -0
@@ -3,6 +3,9 @@ if ARCH_AT91 config HAVE_AT91_UTMI bool +config HAVE_AT91_USB_CLK + bool + config HAVE_AT91_DBGU0 bool
@@ -69,6 +72,7 @@ config SOC_SAMA5D3 select HAVE_FB_ATMEL select HAVE_AT91_DBGU1 select HAVE_AT91_UTMI + select HAVE_AT91_USB_CLK help Select this if you are using one of Atmel's SAMA5D3 family SoC. This support covers SAMA5D31, SAMA5D33, SAMA5D34, SAMA5D35.
@@ -82,11 +86,13 @@ config SOC_AT91RM9200 select HAVE_AT91_DBGU0 select MULTI_IRQ_HANDLER select SPARSE_IRQ + select HAVE_AT91_USB_CLK config SOC_AT91SAM9260 bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20" select HAVE_AT91_DBGU0 select SOC_AT91SAM9 + select HAVE_AT91_USB_CLK help Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE or AT91SAM9G20 SoC.
@@ -96,6 +102,7 @@ config SOC_AT91SAM9261 select HAVE_AT91_DBGU0 select HAVE_FB_ATMEL select SOC_AT91SAM9 + select HAVE_AT91_USB_CLK help Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
@@ -104,6 +111,7 @@ config SOC_AT91SAM9263 select HAVE_AT91_DBGU1 select HAVE_FB_ATMEL select SOC_AT91SAM9 + select HAVE_AT91_USB_CLK config SOC_AT91SAM9RL bool "AT91SAM9RL"
@@ -118,6 +126,7 @@ config SOC_AT91SAM9G45 select HAVE_FB_ATMEL select SOC_AT91SAM9 select HAVE_AT91_UTMI + select HAVE_AT91_USB_CLK help Select this if you are using one of Atmel's AT91SAM9G45 family SoC. This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
@@ -128,6 +137,7 @@ config SOC_AT91SAM9X5 select HAVE_FB_ATMEL select SOC_AT91SAM9 select HAVE_AT91_UTMI + select HAVE_AT91_USB_CLK help Select this if you are using one of Atmel's AT91SAM9x5 family SoC. This means that your SAM9 name finishes with a '5' (except if it is
@@ -140,6 +150,7 @@ config SOC_AT91SAM9N12 select HAVE_AT91_DBGU0 select HAVE_FB_ATMEL select SOC_AT91SAM9 + select HAVE_AT91_USB_CLK help Select this if you are using Atmel's AT91SAM9N12 SoC.
drivers/clk/at91/Makefile +1 -0
@@ -7,3 +7,4 @@ obj-y += clk-system.o clk-peripheral.o obj-$(CONFIG_AT91_PROGRAMMABLE_CLOCKS) += clk-programmable.o obj-$(CONFIG_HAVE_AT91_UTMI) += clk-utmi.o +obj-$(CONFIG_HAVE_AT91_USB_CLK) += clk-usb.o
drivers/clk/at91/clk-usb.c new file +303 -0
303 lines not on this page · raw message
include/linux/clk/at91.h +9 -0
@@ -289,4 +289,13 @@ at91_clk_register_programmable(const char *name, const char **parent_names,struct clk *__init at91_clk_register_utmi (const char *name,const char *parent_name); + +struct clk *__init +at91rm9200_clk_register_usb (const char *name,const char *parent_name, +const u32 *divisors); + +struct clk *__init +at91sam9x5_clk_register_usb (const char *name,const char **parent_names, +u8 num_parents,u8 usbs0_unused); +#endif
Signature · 1 line
1.7.9.5
RFC PATCH 10/50 ARM: at91: add PMC smd clock
In reply to Boris BREZILLONThis is the at91 smd (Soft Modem) clock implementation using common clk framework.
Not used by any driver right now.
--- arch/arm/mach-at91/Kconfig | 5 ++ drivers/clk/at91/Makefile | 1 + drivers/clk/at91/clk-smd.c | 157 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 163 insertions(+)
arch/arm/mach-at91/Kconfig +5 -0
@@ -27,6 +27,9 @@ config AT91_SAM9G45_RESET config AT91_SAM9_TIME bool +config HAVE_AT91_SMD + bool + config SOC_AT91SAM9 bool select AT91_SAM9_TIME
@@ -72,6 +75,7 @@ config SOC_SAMA5D3 select HAVE_FB_ATMEL select HAVE_AT91_DBGU1 select HAVE_AT91_UTMI + select HAVE_AT91_SMD select HAVE_AT91_USB_CLK help Select this if you are using one of Atmel's SAMA5D3 family SoC.
@@ -137,6 +141,7 @@ config SOC_AT91SAM9X5 select HAVE_FB_ATMEL select SOC_AT91SAM9 select HAVE_AT91_UTMI + select HAVE_AT91_SMD select HAVE_AT91_USB_CLK help Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
drivers/clk/at91/Makefile +1 -0
@@ -8,3 +8,4 @@ obj-y += clk-system.o clk-peripheral.o obj-$(CONFIG_AT91_PROGRAMMABLE_CLOCKS) += clk-programmable.o obj-$(CONFIG_HAVE_AT91_UTMI) += clk-utmi.o obj-$(CONFIG_HAVE_AT91_USB_CLK) += clk-usb.o +obj-$(CONFIG_HAVE_AT91_SMD) += clk-smd.o
drivers/clk/at91/clk-smd.c new file +157 -0
157 lines not on this page · raw message
Signature · 1 line
1.7.9.5
RFC PATCH 11/50 ARM: at91: add PMC clk device tree binding doc.
In reply to Boris BREZILLONThis is the documentation of the dt bindings used by at91 clks.
--- .../devicetree/bindings/clock/at91-clock.txt | 247 ++++++++++++++++++++ 1 file changed, 247 insertions(+)
Documentation/devicetree/bindings/clock/at91-clock.txt new file +247 -0
@@ -0,0 +1,247 @@ +Device Tree Clock bindings for arch-at91 + +This binding uses the common clock binding[1]. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be one of the following: + "atmel,at91rm9200-clk-main": + at91 main oscillator + + "atmel,at91rm9200-clk-master" or + "atmel,at91sam9x5-clk-master": + at91 master clock + + "atmel,at91sam9x5-clk-peripheral" or + "atmel,at91rm9200-clk-peripheral": + at91 peripheral clocks + + "atmel,at91rm9200-clk-pll" or + "atmel,at91sam9g45-clk-pll" or + "atmel,at91sam9g20-clk-pllb" or + "atmel,sama5d3-clk-pll": + at91 pll clocks + + "atmel,at91sam9x5-clk-plldiv": + at91 plla divisor + + "atmel,at91rm9200-clk-programmable" or + "atmel,at91sam9g45-clk-programmable" or + "atmel,at91sam9x5-clk-programmable": + at91 programmable clocks + + "atmel,at91sam9x5-clk-smd": + at91 SMD (Soft Modem) clock + + "atmel,at91rm9200-clk-system": + at91 system clocks + + "atmel,at91rm9200-clk-usb" or + "atmel,at91sam9x5-clk-usb": + at91 usb clock + + "atmel,at91sam9x5-clk-utmi": + at91 utmi clock + + +Required properties for main clock: +- #clock-cells : from common clock binding; shall be set to 0. +- clocks (optional if clock-frequency is provided) : shall be the slow clock + phandle. This clock is used to compute the main clock rate if + "clock-frequency" is not provided. +- clock-frequency: the main oscillator frequency.Prefer the use of + "clock-frequency" over automatic clock rate computation. + +For example: + main: mainck { + compatible = "atmel,at91rm9200-clk-main"; + #clock-cells = <0>; + clocks = <&ck32k>; + clock-frequency = <18432000>; + }; + +Required properties for master clock: +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : shall be the master clock sources (see atmel datasheet) phandles. + e.g. "<&ck32k>, <&main>, <&plla>, <&pllb>". +- characteristics : device tree node describing master clock characteristics. + You can find these characteristics in atmel's SoC datasheets. + * output : minimum and maximum clock frequency (two u32 fields). + e.g. output = <0 133000000>; <=> 0 to 133MHz. + * divisors : master clock divisors table (four u32 fields). + 0 <=> reserved value. + e.g. divisors = <1 2 4 6>; + * have-div3-pres : some SoC use the reserved value 7 in the PRES field + as CLOCK_DIV3 (e.g sam9x5). + +For example: + mck: mck { + compatible = "atmel,at91rm9200-clk-master"; + #clock-cells = <0>; + characteristics = { + output = <0 133000000>; + divisors = <1 2 4 0>; + }; + }; + +Required properties for peripheral clocks: +- #clock-cells : from common clock binding; shall be set to 1. The second cell + is used to encode the peripheral id. Peripheral ids are defined in + atmel's SoC datasheets. +- clocks : shall be the master clock phandle. + e.g. clocks = <&mck>; +- ids : peripheral ids (u32 array). +- clock-output-names : name of clocks. These are the name used during clock + registration. +- "default-divisors" (optional, only available for + "atmel,at91sam9x5-clk-peripheral") : sam9x5 and sama5d3 SoC provides + configurable peripheral clock divisors. If you define this property + (u32 array), the default divisor will be applied when enabling + peripheral clock. If not provided the peripheral clock is not divided. + +For example: + periph: periphck { + compatible = "atmel,at91sam9x5-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <2 6 7>; + clock-output-names = "pioA_clk", "pioB_clk", "pioB_clk"; + default-divisors = <1 2 2>; + }; + + +Required properties for pll clocks: +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : shall be the main clock phandle. +- id : pll id + * 0 <=> plla + * 1 <=> pllb +- characteristics : device tree node describing pll clock characteristics. + You can find these characteristics in atmel's SoC datasheets. + * input : minimum and maximum source clock frequency (two u32 fields). + e.g. input = <1 32000000>; <=> 1 to 32MHz. + * output : output frequency ranges. + * out: out field value for output frequency ranges. + * icpll (not available on some SoC): icpll field value for output + frequency ranges. + +For example: + plla: pllack { + compatible = "atmel,at91sam9g45-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <0>; + input = <2000000 32000000>; + output = <74500000 800000000 + 69500000 750000000 + 64500000 700000000 + 59500000 650000000 + 54500000 600000000 + 49500000 550000000 + 44500000 500000000 + 40000000 450000000>; + out = <0 1 2 3 0 1 2 3>; + icpll = <0 0 0 0 1 1 1 1>; + }; + +Required properties for plldiv clocks: +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : shall be the plla clock phandle. + +For example: + plladiv: plladivck { + compatible = "atmel,at91sam9x5-clk-plldiv"; + #clock-cells = <0>; + clocks = <&plla>; + }; + +Required properties for programmable clocks: +- #clock-cells : from common clock binding; shall be set to 1. The second cell + is used to encode the programmable clock id. + Peripheral ids are in atmel's SoC + datasheets. +- clocks : shall be the programmable clock source phandles. + e.g. clocks = <&clk32k>, <&main>, <&plla>, <&pllb>; +- ids : programmable clock ids (u32 array). +- clock-output-names : name of clocks. These names are used during clock + registration. + +For example: + prog: progck { + compatible = "atmel,at91sam9g45-clk-programmable"; + #clock-cells = <1>; + ids = <0 1>; + clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>, <&mck>; + clock-output-names = "prog0", "prog1"; + }; + + +Required properties for smd clock: +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : shall be the smd clock source phandles. + e.g. clocks = <&plladiv>, <&utmi>; + +For example: + smd: smdck { + compatible = "atmel,at91sam9x5-clk-smd"; + #clock-cells = <0>; + clocks = <&plladiv>, <&utmi>; + }; + +Required properties for system clocks: +- #clock-cells : from common clock binding; shall be set to 1. The second cell + is used to encode the system clock id (bit used in SCER/SCDR register). +- clocks : shall be the system clock source phandle. + e.g. clocks = <&usb>; +- ids : peripheral ids (u32 array). +- clock-output-names : name of clocks. These names are used during clock + registration. + +For example: + system: systemck { + compatible = "atmel,at91rm9200-clk-system"; + #clock-cells = <1>; + ids = <2 4 6 7 8 9 10>; + clocks = <&mck>, <&smd>, <&usb>, <&usb>, + <&prog 0>, <&prog 1>, <&prog 2>; + clock-output-names = "ddrck", "smdck", "uhpck", "udpck", + "pck0", "pck1", "pck2"; + }; + + +Required properties for usb clock: +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : shall be the smd clock source phandles. + e.g. clocks = <&pllb>; +- divisors (only available for "atmel,at91rm9200-clk-usb"): + usb clock divisor table. + e.g. divisors = <1 2 4 0>; +- usbs0-unused (only available for "atmel,at91sam9x5-clk-usb"): + Some SoC (sam9n12) use usb source 0 to disable the usb clock. + +For example: + usb: usbck { + compatible = "atmel,at91sam9x5-clk-usb"; + #clock-cells = <0>; + clocks = <&plladiv>, <&utmi>; + }; + + usb: usbck { + compatible = "atmel,at91rm9200-clk-usb"; + #clock-cells = <0>; + clocks = <&pllb>; + divisors = <1 2 4 0>; + }; + + +Required properties for utmi clock: +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : shall be the main clock source phandle. + +For example: + utmi: utmick { + compatible = "atmel,at91sam9x5-clk-utmi"; + #clock-cells = <0>; + clocks = <&main>; + };
Signature · 1 line
1.7.9.5
RFC PATCH 12/50 ARM: at91: move to common clk framework
In reply to Boris BREZILLONThis patch removes the old at91 clk implementation, and keep the PMC initialization and sam9idle functions in pmc.c.
The at91_initialize function no longer initiliaze at91 clks: the new clk registration process requires kzalloc which is not available when early_init is called.
The clk registration is moved to at91_clk_init function which should be called before timer_init (pit timer request at91 master clock).
--- arch/arm/mach-at91/Makefile | 2 +- arch/arm/mach-at91/clock.c | 961 ------------------------------------------ arch/arm/mach-at91/clock.h | 49 --- arch/arm/mach-at91/generic.h | 10 +- arch/arm/mach-at91/pmc.c | 58 +++ arch/arm/mach-at91/setup.c | 36 +- drivers/clk/Makefile | 1 + 7 files changed, 86 insertions(+), 1031 deletions(-)
arch/arm/mach-at91/Makefile +1 -1
@@ -7,7 +7,7 @@ obj-m := obj-n := obj- := -obj-$(CONFIG_AT91_PMC_UNIT) += clock.o +obj-$(CONFIG_AT91_PMC_UNIT) += pmc.o obj-$(CONFIG_AT91_SAM9_ALT_RESET) += at91sam9_alt_reset.o obj-$(CONFIG_AT91_SAM9G45_RESET) += at91sam9g45_reset.o obj-$(CONFIG_AT91_SAM9_TIME) += at91sam926x_time.o
arch/arm/mach-at91/clock.c deleted +0 -961
961 lines not on this page · raw message
arch/arm/mach-at91/clock.h deleted +0 -49
49 lines not on this page · raw message
arch/arm/mach-at91/generic.h +6 -4
@@ -18,10 +18,12 @@ extern void __init at91_init_sram(int bank, unsigned long base,/* Processors */ extern void __init at91rm9200_set_type (int type); -extern void __init at91_initialize (unsigned long main_clock); +extern void __init at91_initialize (void ); +extern void __init at91_clk_init (unsigned long main_clock);extern void __init at91x40_initialize (unsigned long main_clock);extern void __init at91rm9200_dt_initialize (void );extern void __init at91_dt_initialize (void ); +extern void __init at91_dt_clk_init (void );/* Interrupts */ extern void __init at91_init_irq_default (void );
@@ -44,10 +46,10 @@ extern void at91x40_timer_init(void);/* Clocks */ #ifdef CONFIG_AT91_PMC_UNIT -extern int __init at91_clock_init (unsigned long main_clock); -extern int __init at91_dt_clock_init (void ); +extern int __init at91_pmc_init (void ); +extern int __init at91_dt_pmc_init (void );#else -static int inline at91_clock_init (unsigned long main_clock) {return 0 ; } +static int inline at91_pmc_init () {return 0 ; }#endif struct device ;
arch/arm/mach-at91/pmc.c new file +58 -0
58 lines not on this page · raw message
arch/arm/mach-at91/setup.c +20 -16
@@ -479,41 +479,45 @@ void __init at91rm9200_dt_initialize(void) {at91_dt_ramc (); -/* Init clock subsystem */ -at91_dt_clock_init (); - -/* Register the processor-specific clocks */ - at91_boot_soc.register_clocks (); +at91_dt_pmc_init (); at91_boot_soc.init (); } -void __init at91_dt_initialize (void ) +void __init at91_dt_initialize () {at91_dt_rstc ();at91_dt_ramc ();at91_dt_shdwc (); -/* Init clock subsystem */ -at91_dt_clock_init (); - -/* Register the processor-specific clocks */ - at91_boot_soc.register_clocks (); +at91_dt_pmc_init ();if (at91_boot_soc.init) at91_boot_soc.init (); } -#endif -void __init at91_initialize (unsigned long main_clock) +void __init at91_dt_clk_init (void ) { - at91_boot_soc.ioremap_registers (); +of_clk_init (NULL ); +} +#endif -/* Init clock subsystem */ -at91_clock_init (main_clock); +void __init at91_clk_init (unsigned long main_clock) +{ +clk_register_fixed_rate (NULL ,"clk32k" ,NULL ,CLK_IS_ROOT , +AT91_SLOW_CLOCK ); +at91_clk_register_main ("main" ,"clk32k" , main_clock);/* Register the processor-specific clocks */ at91_boot_soc.register_clocks (); +} + +void __init at91_initialize (void ) +{ + at91_boot_soc.ioremap_registers (); + +/* Init clock subsystem */ +at91_pmc_init (); at91_boot_soc.init ();
drivers/clk/Makefile +1 -0
@@ -30,6 +30,7 @@ obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o obj-$(CONFIG_ARCH_ZYNQ) += clk-zynq.o obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-$(CONFIG_PLAT_SAMSUNG) += samsung/ +obj-$(CONFIG_ARCH_AT91) += at91/ obj-$(CONFIG_X86) += x86/
Signature · 1 line
1.7.9.5
RFC PATCH 13/50 ARM: at91: move at91rm9200 SoC to new at91 clk implem
In reply to Boris BREZILLONThis patch removes all references to the old at91 clks implementation and make use of the new at91 clk implem for at91rm9200 SoC.
All dt specific lookups are removed (handled in clk device tree binding).
--- arch/arm/mach-at91/Kconfig | 1 + arch/arm/mach-at91/at91rm9200.c | 576 ++++++++++++++++++++++++--------------- 2 files changed, 351 insertions(+), 226 deletions(-)
arch/arm/mach-at91/Kconfig +1 -0
@@ -85,6 +85,7 @@ endif if SOC_SAM_V4_V5 config SOC_AT91RM9200 bool "AT91RM9200" + select COMMON_CLK select CPU_ARM920T select GENERIC_CLOCKEVENTS select HAVE_AT91_DBGU0
arch/arm/mach-at91/at91rm9200.c +350 -226
608 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Re: [RFC PATCH 13/50] ARM: at91: move at91rm9200 SoC to new at91 clk implem
Quoting Boris BREZILLON (2013-06-07 08:11:03)
arch/arm/mach-at91/at91rm9200.c line 40
Quoted 4 lines
arch/arm/mach-at91/at91rm9200.c +4
-0+static struct clk_lookup pioA_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioA_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioA" ,NULL ), +};
It would be great to get rid of this clkdev data from the kernel as well. Have you looked into encoding the aliases into your DT bindings?
Or have you looked into using of_clk_get?
Regards,
Mike
Re: [RFC PATCH 13/50] ARM: at91: move at91rm9200 SoC to new at91 clk implem
Hello,
Quoted 7 lines · Mike Turquette
Quoting Boris BREZILLON (2013-06-07 08:11:03)
arch/arm/mach-at91/at91rm9200.c line 40
Quoted 4 lines
arch/arm/mach-at91/at91rm9200.c +4
-0+static struct clk_lookup pioA_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioA_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioA" ,NULL ), +};It would be great to get rid of this clkdev data from the kernel as well. Have you looked into encoding the aliases into your DT bindings?
I already switched all dt boards to dt clk definition (see patch 36 to 50). These definition are kept for all non-dt boards (see in arch/arm/mach-at91/board-xxx.c).
This will be cleaned as soon as all non-dt boards are moved to dt.
Quoted 2 lines
Or have you looked into using
of_clk_get?
If I remember correctly, the clk_get function first tries to get the clk from dt binding.
Then if it fails it uses the clk_lookup info. Am I right ? If so, I don't need to use of_clk_get in drivers calling clk_get with a non NULL device
parameter.
The only place where I use of_clk_get is in init timer driver (at91sam926x_time.c).
I first try to retrieve the clk from dt, then if it fails (or if dt is not supported),
I use clk_get with a NULL device param, which will lead to clk_lookup search.
Tell me if I misunderstood the API.
Quoted 3 lines
Regards,
Mike
Best Regards,
Boris
RFC PATCH 14/50 ARM: at91: move at91sam9260 SoC to new at91 clk implem
In reply to Boris BREZILLONThis patch removes all references to the old at91 clks implementation and make use of the new at91 clk implem for at91sam9260 SoC.
All dt specific lookups are removed (handled in clk device tree binding).
--- arch/arm/mach-at91/at91sam9260.c | 692 +++++++++++++++++++++++++------------- 1 file changed, 457 insertions(+), 235 deletions(-)
arch/arm/mach-at91/at91sam9260.c +457 -235
@@ -26,7 +26,6 @@#include "at91_rstc.h" #include "soc.h" #include "generic.h" -#include "clock.h" #include "sam9_smc.h" /* --------------------------------------------------------------------
@@ -36,255 +35,478 @@/* * The peripheral clocks. */ -static struct clk pioA_clk = { - .name ="pioA_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_PIOA , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioB_clk = { - .name ="pioB_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_PIOB , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioC_clk = { - .name ="pioC_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_PIOC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk adc_clk = { - .name ="adc_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_ADC , - .type =CLK_TYPE_PERIPHERAL , -}; - -static struct clk adc_op_clk = { - .name ="adc_op_clk" , - .type =CLK_TYPE_PERIPHERAL , - .rate_hz =5000000 , -}; - -static struct clk usart0_clk = { - .name ="usart0_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_US0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart1_clk = { - .name ="usart1_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_US1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart2_clk = { - .name ="usart2_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_US2 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk mmc_clk = { - .name ="mci_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_MCI , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk udc_clk = { - .name ="udc_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_UDP , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twi_clk = { - .name ="twi_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_TWI , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi0_clk = { - .name ="spi0_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_SPI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi1_clk = { - .name ="spi1_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_SPI1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ssc_clk = { - .name ="ssc_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_SSC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tc0_clk = { - .name ="tc0_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_TC0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tc1_clk = { - .name ="tc1_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_TC1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tc2_clk = { - .name ="tc2_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_TC2 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ohci_clk = { - .name ="ohci_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_UHP , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk macb_clk = { - .name ="pclk" , - .pmc_mask =1 <<AT91SAM9260_ID_EMAC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk isi_clk = { - .name ="isi_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_ISI , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart3_clk = { - .name ="usart3_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_US3 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart4_clk = { - .name ="usart4_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_US4 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart5_clk = { - .name ="usart5_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_US5 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tc3_clk = { - .name ="tc3_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_TC3 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tc4_clk = { - .name ="tc4_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_TC4 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tc5_clk = { - .name ="tc5_clk" , - .pmc_mask =1 <<AT91SAM9260_ID_TC5 , - .type =CLK_TYPE_PERIPHERAL , -}; - -static struct clk *periph_clocks[]__initdata = { - &pioA_clk, - &pioB_clk, - &pioC_clk, - &adc_clk, - &adc_op_clk, - &usart0_clk, - &usart1_clk, - &usart2_clk, - &mmc_clk, - &udc_clk, - &twi_clk, - &spi0_clk, - &spi1_clk, - &ssc_clk, - &tc0_clk, - &tc1_clk, - &tc2_clk, - &ohci_clk, - &macb_clk, - &isi_clk, - &usart3_clk, - &usart4_clk, - &usart5_clk, - &tc3_clk, - &tc4_clk, - &tc5_clk, -// irq0 .. irq2 -}; - -static struct clk_lookup periph_clocks_lookups[] = { -/* One additional fake clock for macb_hclk */ -CLKDEV_CON_ID ("hclk" , &macb_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"atmel_spi.0" , &spi0_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"atmel_spi.1" , &spi1_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"atmel_tcb.0" , &tc0_clk), -CLKDEV_CON_DEV_ID ("t1_clk" ,"atmel_tcb.0" , &tc1_clk), -CLKDEV_CON_DEV_ID ("t2_clk" ,"atmel_tcb.0" , &tc2_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"atmel_tcb.1" , &tc3_clk), -CLKDEV_CON_DEV_ID ("t1_clk" ,"atmel_tcb.1" , &tc4_clk), -CLKDEV_CON_DEV_ID ("t2_clk" ,"atmel_tcb.1" , &tc5_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"at91rm9200_ssc.0" , &ssc_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"fffbc000.ssc" , &ssc_clk), -CLKDEV_CON_DEV_ID (NULL ,"i2c-at91sam9260.0" , &twi_clk), -CLKDEV_CON_DEV_ID (NULL ,"i2c-at91sam9g20.0" , &twi_clk), -/* more usart lookup table for DT entries */ -CLKDEV_CON_DEV_ID ("usart" ,"fffff200.serial" , &mck), -CLKDEV_CON_DEV_ID ("usart" ,"fffb0000.serial" , &usart0_clk), -CLKDEV_CON_DEV_ID ("usart" ,"fffb4000.serial" , &usart1_clk), -CLKDEV_CON_DEV_ID ("usart" ,"fffb8000.serial" , &usart2_clk), -CLKDEV_CON_DEV_ID ("usart" ,"fffd0000.serial" , &usart3_clk), -CLKDEV_CON_DEV_ID ("usart" ,"fffd4000.serial" , &usart4_clk), -CLKDEV_CON_DEV_ID ("usart" ,"fffd8000.serial" , &usart5_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffac000.i2c" , &twi_clk), -/* more tc lookup table for DT entries */ -CLKDEV_CON_DEV_ID ("t0_clk" ,"fffa0000.timer" , &tc0_clk), -CLKDEV_CON_DEV_ID ("t1_clk" ,"fffa0000.timer" , &tc1_clk), -CLKDEV_CON_DEV_ID ("t2_clk" ,"fffa0000.timer" , &tc2_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"fffdc000.timer" , &tc3_clk), -CLKDEV_CON_DEV_ID ("t1_clk" ,"fffdc000.timer" , &tc4_clk), -CLKDEV_CON_DEV_ID ("t2_clk" ,"fffdc000.timer" , &tc5_clk), -CLKDEV_CON_DEV_ID ("hclk" ,"500000.ohci" , &ohci_clk), -CLKDEV_CON_DEV_ID ("mci_clk" ,"fffa8000.mmc" , &mmc_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"fffc8000.spi" , &spi0_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"fffcc000.spi" , &spi1_clk), -/* fake hclk clock */ -CLKDEV_CON_DEV_ID ("hclk" ,"at91_ohci" , &ohci_clk), -CLKDEV_CON_ID ("pioA" , &pioA_clk), -CLKDEV_CON_ID ("pioB" , &pioB_clk), -CLKDEV_CON_ID ("pioC" , &pioC_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff400.gpio" , &pioA_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff600.gpio" , &pioB_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff800.gpio" , &pioC_clk), -}; - -static struct clk_lookup usart_clocks_lookups[] = { -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.0" , &mck), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.1" , &usart0_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.2" , &usart1_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.3" , &usart2_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.4" , &usart3_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.5" , &usart4_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.6" , &usart5_clk), +static struct clk_lookup pioA_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioA_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioA" ,NULL ), +}; + +static struct clk_lookup pioB_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioB_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioB" ,NULL ), +}; + +static struct clk_lookup pioC_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioC_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioC" ,NULL ), +}; + +static struct clk_lookup adc_clk_lookup[] = { +CLKDEV_INIT (NULL ,"adc_clk" ,NULL ), +}; + +static struct clk_lookup usart0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart0_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.1" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart1_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.2" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart2_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart2_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.3" ,"usart" ,NULL ), +}; + +static struct clk_lookup mci_clk_lookup[] = { +CLKDEV_INIT (NULL ,"mci_clk" ,NULL ), +}; + +static struct clk_lookup udc_clk_lookup[] = { +CLKDEV_INIT (NULL ,"udc_clk" ,NULL ), +}; + +static struct clk_lookup twi_clk_lookup[] = { +CLKDEV_INIT (NULL ,"twi_clk" ,NULL ), +CLKDEV_INIT ("i2c-at91sam9260.0" ,NULL ,NULL ), +CLKDEV_INIT ("i2c-at91sam9g20.0" ,NULL ,NULL ), +}; + +static struct clk_lookup spi0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"spi0_clk" ,NULL ), +CLKDEV_INIT ("atmel_spi.0" ,"spi_clk" ,NULL ), +}; + +static struct clk_lookup spi1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"spi1_clk" ,NULL ), +CLKDEV_INIT ("atmel_spi.1" ,"spi_clk" ,NULL ), +}; + +static struct clk_lookup ssc_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ssc_clk" ,NULL ), +CLKDEV_INIT ("at91rm9200_ssc.0" ,"pclk" ,NULL ), +}; + +static struct clk_lookup tc0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tc0_clk" ,NULL ), +CLKDEV_INIT ("atmel_tcb.0" ,"t0_clk" ,NULL ), +}; + +static struct clk_lookup tc1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tc1_clk" ,NULL ), +CLKDEV_INIT ("atmel_tcb.0" ,"t1_clk" ,NULL ), +}; + +static struct clk_lookup tc2_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tc2_clk" ,NULL ), +CLKDEV_INIT ("atmel_tcb.0" ,"t2_clk" ,NULL ), +}; + +static struct clk_lookup ohci_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ohci_clk" ,NULL ), +CLKDEV_INIT ("at91_ohci" ,"hclk" ,NULL ), +}; + +static struct clk_lookup macb_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pclk" ,NULL ), +CLKDEV_INIT (NULL ,"hclk" ,NULL ), +}; + +static struct clk_lookup usart3_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart3_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.4" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart4_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart4_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.5" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart5_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart5_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.6" ,"usart" ,NULL ), +}; + +static struct clk_lookup tc3_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tc3_clk" ,NULL ), +CLKDEV_INIT ("t0_clk" ,"atmel_tcb.1" ,NULL ), +}; + +static struct clk_lookup tc4_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tc4_clk" ,NULL ), +CLKDEV_INIT ("t1_clk" ,"atmel_tcb.1" ,NULL ), +}; + +static struct clk_lookup tc5_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tc5_clk" ,NULL ), +CLKDEV_INIT ("t2_clk" ,"atmel_tcb.1" ,NULL ), +}; + +static size_t periph_clock_lookup_sizes[]__initdata = { +0 , +0 , +ARRAY_SIZE (pioA_clk_lookup), +ARRAY_SIZE (pioB_clk_lookup), +ARRAY_SIZE (pioC_clk_lookup), +ARRAY_SIZE (adc_clk_lookup), +ARRAY_SIZE (usart0_clk_lookup), +ARRAY_SIZE (usart1_clk_lookup), +ARRAY_SIZE (usart2_clk_lookup), +ARRAY_SIZE (mci_clk_lookup), +ARRAY_SIZE (udc_clk_lookup), +ARRAY_SIZE (twi_clk_lookup), +0 , +ARRAY_SIZE (spi0_clk_lookup), +ARRAY_SIZE (spi1_clk_lookup), +ARRAY_SIZE (ssc_clk_lookup), +0 , +0 , +ARRAY_SIZE (tc0_clk_lookup), +ARRAY_SIZE (tc1_clk_lookup), +ARRAY_SIZE (tc2_clk_lookup), +ARRAY_SIZE (ohci_clk_lookup), +ARRAY_SIZE (macb_clk_lookup), +0 , +ARRAY_SIZE (usart3_clk_lookup), +ARRAY_SIZE (usart4_clk_lookup), +ARRAY_SIZE (usart5_clk_lookup), +ARRAY_SIZE (tc3_clk_lookup), +ARRAY_SIZE (tc4_clk_lookup), +ARRAY_SIZE (tc5_clk_lookup), +}; + +static struct clk_lookup *periph_clock_lookups[]__initdata = { +NULL , +NULL , + pioA_clk_lookup, + pioB_clk_lookup, + pioC_clk_lookup, + adc_clk_lookup, + usart0_clk_lookup, + usart1_clk_lookup, + usart2_clk_lookup, + mci_clk_lookup, + udc_clk_lookup, + twi_clk_lookup, +NULL , + spi0_clk_lookup, + spi1_clk_lookup, + ssc_clk_lookup, +NULL , +NULL , + tc0_clk_lookup, + tc1_clk_lookup, + tc2_clk_lookup, + ohci_clk_lookup, + macb_clk_lookup, +NULL , + usart3_clk_lookup, + usart4_clk_lookup, + usart5_clk_lookup, + tc3_clk_lookup, + tc4_clk_lookup, + tc5_clk_lookup, +}; + + +/* +* The system clocks. +*/ +static struct clk_lookup udp_clk_lookup[] = { +CLKDEV_INIT (NULL ,"udpck" ,NULL ), +}; + +static struct clk_lookup uhp_clk_lookup[] = { +CLKDEV_INIT (NULL ,"uhpck" ,NULL ), +}; + +static struct clk_lookup pck0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck0" ,NULL ), +}; + +static struct clk_lookup pck1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck1" ,NULL ), +}; + +static size_t system_clock_lookup_sizes[]__initdata = { +0 , +0 , +0 , +0 , +0 , +0 , +ARRAY_SIZE (uhp_clk_lookup), +ARRAY_SIZE (udp_clk_lookup), +ARRAY_SIZE (pck0_clk_lookup), +ARRAY_SIZE (pck1_clk_lookup), +}; + +static struct clk_lookup *system_clock_lookups[]__initdata = { +NULL , +NULL , +NULL , +NULL , +NULL , +NULL , + uhp_clk_lookup, + udp_clk_lookup, + pck0_clk_lookup, + pck1_clk_lookup, +}; + +static const char *system_clock_parent_names[]__initdata = { +NULL , +NULL , +NULL , +NULL , +NULL , +NULL , +"usbck" , +"usbck" , +"prog0" , +"prog1" , +"prog2" , +"prog3" , };/* * The two programmable clocks. * You must configure pin multiplexing to bring these signals out. */ -static struct clk pck0 = { - .name ="pck0" , - .pmc_mask =AT91_PMC_PCK0 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =0 , +static const char *prog_clock_parent_names[]__initdata = { +"clk32k" , +"main" , +"plla" , +"pllb" , }; -static struct clk pck1 = { - .name ="pck1" , - .pmc_mask =AT91_PMC_PCK1 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =1 , + +/* +* The pll clocks. +*/ +static struct clk_lookup pll_clk_lookup[] = { +CLKDEV_INIT (NULL ,"plla" ,NULL ), +CLKDEV_INIT (NULL ,"pllb" ,NULL ), }; +static struct clk_range at91sam9260_plla_output[] = { +CLK_RANGE (80000000 ,160000000 ), +CLK_RANGE (150000000 ,240000000 ), +}; +static u8 at91sam9260_plla_out[] = {0 ,2 }; + +static struct clk_range at91sam9260_pllb_output[] = { +CLK_RANGE (70000000 ,130000000 ), +}; +static u8 at91sam9260_pllb_out[] = {1 ,}; + +struct clk_pll_characteristics at91sam9260_pll_characteristics[] = { + { + .input =CLK_RANGE (1000000 ,32000000 ), + .num_output =ARRAY_SIZE (at91sam9260_plla_output), + .output = at91sam9260_plla_output, + .out = at91sam9260_plla_out, + }, + { + .input =CLK_RANGE (1000000 ,5000000 ), + .num_output =ARRAY_SIZE (at91sam9260_pllb_output), + .output = at91sam9260_pllb_output, + .out = at91sam9260_pllb_out, + }, +}; + +static struct clk_range at91sam9xe_plla_output[] = { +CLK_RANGE (80000000 ,160000000 ), +CLK_RANGE (150000000 ,220000000 ), +}; + +struct clk_pll_characteristics at91sam9xe_pll_characteristics[] = { + { + .input =CLK_RANGE (1000000 ,32000000 ), + .num_output =ARRAY_SIZE (at91sam9xe_plla_output), + .output = at91sam9xe_plla_output, + .out = at91sam9260_plla_out, + }, + { + .input =CLK_RANGE (1000000 ,5000000 ), + .num_output =ARRAY_SIZE (at91sam9260_pllb_output), + .output = at91sam9260_pllb_output, + .out = at91sam9260_pllb_out, + }, +}; + +static struct clk_range at91sam9g20_plla_output[] = { +CLK_RANGE (745000000 ,800000000 ), +CLK_RANGE (695000000 ,750000000 ), +CLK_RANGE (645000000 ,700000000 ), +CLK_RANGE (595000000 ,650000000 ), +CLK_RANGE (545000000 ,600000000 ), +CLK_RANGE (495000000 ,550000000 ), +CLK_RANGE (445000000 ,500000000 ), +CLK_RANGE (400000000 ,450000000 ), +}; +static u8 at91sam9g20_plla_out[] = {0 ,1 ,2 ,3 ,0 ,1 ,2 ,3 }; +static u16 at91sam9g20_plla_icpll[] = {0 ,0 ,0 ,0 ,1 ,1 ,1 ,1 }; + +static struct clk_range at91sam9g20_pllb_output[] = { +CLK_RANGE (30000000 ,100000000 ), +}; +static u8 at91sam9g20_pllb_out[] = {0 }; + +struct clk_pll_characteristics at91sam9g20_pll_characteristics[] = { + { + .input =CLK_RANGE (2000000 ,32000000 ), + .num_output =ARRAY_SIZE (at91sam9g20_plla_output), + .output = at91sam9g20_plla_output, + .out = at91sam9g20_plla_out, + .icpll = at91sam9g20_plla_icpll, + }, + { + .input =CLK_RANGE (2000000 ,32000000 ), + .num_output =ARRAY_SIZE (at91sam9g20_pllb_output), + .output = at91sam9g20_pllb_output, + .out = at91sam9g20_pllb_out, + }, +}; + + +/* +* The master clock. +*/ +static struct clk_lookup mck_clk_lookup[] = { +CLKDEV_INIT (NULL ,"mck" ,NULL ), +CLKDEV_INIT ("atmel_usart.0" ,"usart" ,NULL ), +}; + +struct clk_master_characteristics at91sam9260_master_characteristics = { + .output =CLK_RANGE (0 ,105000000 ), + .have_div3_pres =0 , + .divisors = {1 ,2 ,4 ,0 }, +}; + +struct clk_master_characteristics at91sam9xe_master_characteristics = { + .output =CLK_RANGE (0 ,90000000 ), + .have_div3_pres =0 , + .divisors = {1 ,2 ,4 ,0 }, +}; + +struct clk_master_characteristics at91sam9g20_master_characteristics = { + .output =CLK_RANGE (0 ,133000000 ), + .have_div3_pres =0 , + .divisors = {1 ,2 ,4 ,6 }, +}; + +static const char *master_clock_parent_names[]__initdata = { +"clk32k" , +"main" , +"plla" , +"pllb" , +}; + +/* +* The USB clock. +*/ +static u32 usb_divisors[] = {1 ,2 ,4 ,0 }; +static void __init at91sam9260_register_clocks (void ) {int i; +int k; +size_t size; +struct clk *clk; +const char *name; +struct clk_lookup *lookup; +struct clk_pll_characteristics *pll_characteristics; +struct clk_pll_layout *pll_layout; +struct clk_master_characteristics *master_characteristics; + +if (cpu_is_at91sam9xe ()) { + pll_characteristics = at91sam9xe_pll_characteristics; + master_characteristics = &at91sam9xe_master_characteristics; + }else if (cpu_is_at91sam9g20 ()) { + pll_characteristics = at91sam9g20_pll_characteristics; + master_characteristics = &at91sam9g20_master_characteristics; + }else { + pll_characteristics = at91sam9260_pll_characteristics; + master_characteristics = &at91sam9260_master_characteristics; + } + +for (i =0 ; i <ARRAY_SIZE (pll_clk_lookup); i++) { + name = pll_clk_lookup[i].con_id; + pll_layout = &at91rm9200_pll_layout; +if (cpu_is_at91sam9g20 ()) { +if (!i) + pll_layout = &at91sam9g45_pll_layout; +else + pll_layout = &at91sam9g20_pllb_layout; + } + clk =at91_clk_register_pll (name,"main" , i, pll_layout, + &pll_characteristics[i]); + pll_clk_lookup[i].clk = clk; + } +clkdev_add_table (pll_clk_lookup,ARRAY_SIZE (pll_clk_lookup)); + + clk =at91_clk_register_master ("mck" , +ARRAY_SIZE (master_clock_parent_names), + master_clock_parent_names, + &at91rm9200_master_layout, + master_characteristics); +for (i =0 ; i <ARRAY_SIZE (mck_clk_lookup); i++) + mck_clk_lookup[i].clk = clk; +clkdev_add_table (mck_clk_lookup,ARRAY_SIZE (mck_clk_lookup)); + +for (i =0 ; i <ARRAY_SIZE (periph_clock_lookup_sizes); i++) { + size = periph_clock_lookup_sizes[i]; + lookup = periph_clock_lookups[i]; +if (!size || !lookup) +continue ; + name = periph_clock_lookups[i][0 ].con_id; +if (!name) +continue ; + clk =at91_clk_register_peripheral (name,"mck" , i); + +for (k =0 ; k < size; k++) + lookup[k].clk = clk; +clkdev_add_table (lookup, size); + } + +for (i =0 ; i <2 ; i++) { + name = system_clock_parent_names[8 + i]; + clk =at91_clk_register_programmable (name, + prog_clock_parent_names, +ARRAY_SIZE (prog_clock_parent_names), + i, &at91rm9200_programmable_layout); + } -for (i =0 ; i <ARRAY_SIZE (periph_clocks); i++) -clk_register (periph_clocks[i]); + clk =at91rm9200_clk_register_usb ("usbck" ,"pllb" , usb_divisors); -clkdev_add_table (periph_clocks_lookups, -ARRAY_SIZE (periph_clocks_lookups)); -clkdev_add_table (usart_clocks_lookups, -ARRAY_SIZE (usart_clocks_lookups)); +for (i =0 ; i <ARRAY_SIZE (system_clock_lookup_sizes); i++) { + size = system_clock_lookup_sizes[i]; + lookup = system_clock_lookups[i]; +if (!size || !lookup) +continue ; + name = system_clock_lookups[i][0 ].con_id; +if (!name || !system_clock_parent_names[i]) +continue ; + clk =at91_clk_register_system (name, + system_clock_parent_names[i], + i); +for (k =0 ; k < size; k++) + lookup[k].clk = clk; +clkdev_add_table (lookup, size); + } -clk_register (&pck0); -clk_register (&pck1); +clk_register_fixed_rate (NULL ,"adc_op_clk" ,"mck" ,0 ,5000000 ); }/* --------------------------------------------------------------------
Signature · 1 line
1.7.9.5
RFC PATCH 15/50 ARM: at91: move at91sam9261 SoC to new at91 clk implem
In reply to Boris BREZILLONThis patch removes all references to the old at91 clks implementation and make use of the new at91 clk implem for at91sam9261 SoC.
All dt specific lookups are removed (handled in clk device tree binding).
--- arch/arm/mach-at91/at91sam9261.c | 579 +++++++++++++++++++++++++------------- 1 file changed, 383 insertions(+), 196 deletions(-)
arch/arm/mach-at91/at91sam9261.c +383 -196
@@ -25,7 +25,6 @@#include "at91_rstc.h" #include "soc.h" #include "generic.h" -#include "clock.h" #include "sam9_smc.h" /* --------------------------------------------------------------------
@@ -35,216 +34,404 @@/* * The peripheral clocks. */ -static struct clk pioA_clk = { - .name ="pioA_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_PIOA , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioB_clk = { - .name ="pioB_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_PIOB , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioC_clk = { - .name ="pioC_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_PIOC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart0_clk = { - .name ="usart0_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_US0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart1_clk = { - .name ="usart1_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_US1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart2_clk = { - .name ="usart2_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_US2 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk mmc_clk = { - .name ="mci_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_MCI , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk udc_clk = { - .name ="udc_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_UDP , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twi_clk = { - .name ="twi_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_TWI , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi0_clk = { - .name ="spi0_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_SPI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi1_clk = { - .name ="spi1_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_SPI1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ssc0_clk = { - .name ="ssc0_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_SSC0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ssc1_clk = { - .name ="ssc1_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_SSC1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ssc2_clk = { - .name ="ssc2_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_SSC2 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tc0_clk = { - .name ="tc0_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_TC0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tc1_clk = { - .name ="tc1_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_TC1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tc2_clk = { - .name ="tc2_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_TC2 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ohci_clk = { - .name ="ohci_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_UHP , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk lcdc_clk = { - .name ="lcdc_clk" , - .pmc_mask =1 <<AT91SAM9261_ID_LCDC , - .type =CLK_TYPE_PERIPHERAL , -}; - -/* HClocks */ -static struct clk hck0 = { - .name ="hck0" , - .pmc_mask =AT91_PMC_HCK0 , - .type =CLK_TYPE_SYSTEM , - .id =0 , -}; -static struct clk hck1 = { - .name ="hck1" , - .pmc_mask =AT91_PMC_HCK1 , - .type =CLK_TYPE_SYSTEM , - .id =1 , -}; - -static struct clk *periph_clocks[]__initdata = { - &pioA_clk, - &pioB_clk, - &pioC_clk, - &usart0_clk, - &usart1_clk, - &usart2_clk, - &mmc_clk, - &udc_clk, - &twi_clk, - &spi0_clk, - &spi1_clk, - &ssc0_clk, - &ssc1_clk, - &ssc2_clk, - &tc0_clk, - &tc1_clk, - &tc2_clk, - &ohci_clk, - &lcdc_clk, -// irq0 .. irq2 -}; - -static struct clk_lookup periph_clocks_lookups[] = { -CLKDEV_CON_DEV_ID ("hclk" ,"at91sam9261-lcdfb.0" , &hck1), -CLKDEV_CON_DEV_ID ("hclk" ,"at91sam9g10-lcdfb.0" , &hck1), -CLKDEV_CON_DEV_ID ("spi_clk" ,"atmel_spi.0" , &spi0_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"atmel_spi.1" , &spi1_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"atmel_tcb.0" , &tc0_clk), -CLKDEV_CON_DEV_ID ("t1_clk" ,"atmel_tcb.0" , &tc1_clk), -CLKDEV_CON_DEV_ID ("t2_clk" ,"atmel_tcb.0" , &tc2_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"at91rm9200_ssc.0" , &ssc0_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"at91rm9200_ssc.1" , &ssc1_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"at91rm9200_ssc.2" , &ssc2_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"fffbc000.ssc" , &ssc0_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"fffc0000.ssc" , &ssc1_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"fffc4000.ssc" , &ssc2_clk), -CLKDEV_CON_DEV_ID ("hclk" ,"at91_ohci" , &hck0), -CLKDEV_CON_DEV_ID (NULL ,"i2c-at91sam9261.0" , &twi_clk), -CLKDEV_CON_DEV_ID (NULL ,"i2c-at91sam9g10.0" , &twi_clk), -CLKDEV_CON_ID ("pioA" , &pioA_clk), -CLKDEV_CON_ID ("pioB" , &pioB_clk), -CLKDEV_CON_ID ("pioC" , &pioC_clk), -}; - -static struct clk_lookup usart_clocks_lookups[] = { -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.0" , &mck), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.1" , &usart0_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.2" , &usart1_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.3" , &usart2_clk), +static struct clk_lookup pioA_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioA_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioA" ,NULL ), +}; + +static struct clk_lookup pioB_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioB_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioB" ,NULL ), +}; + +static struct clk_lookup pioC_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioB_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioB" ,NULL ), +}; + +static struct clk_lookup usart0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart0_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.1" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart1_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.2" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart2_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart2_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.3" ,"usart" ,NULL ), +}; + +static struct clk_lookup mci_clk_lookup[] = { +CLKDEV_INIT (NULL ,"mci_clk" ,NULL ), +}; + +static struct clk_lookup udc_clk_lookup[] = { +CLKDEV_INIT (NULL ,"udc_clk" ,NULL ), +}; + +static struct clk_lookup twi_clk_lookup[] = { +CLKDEV_INIT (NULL ,"twi_clk" ,NULL ), +CLKDEV_INIT ("i2c-at91sam9261.0" ,NULL ,NULL ), +CLKDEV_INIT ("i2c-at91sam9g10.0" ,NULL ,NULL ), +}; + +static struct clk_lookup spi0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"spi0_clk" ,NULL ), +CLKDEV_INIT ("atmel_spi.0" ,"spi_clk" ,NULL ), +}; + +static struct clk_lookup spi1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"spi1_clk" ,NULL ), +CLKDEV_INIT ("atmel_spi.1" ,"spi_clk" ,NULL ), +}; + +static struct clk_lookup ssc0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ssc0_clk" ,NULL ), +CLKDEV_INIT ("at91rm9200_ssc.0" ,"pclk" ,NULL ), +}; + +static struct clk_lookup ssc1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ssc1_clk" ,NULL ), +CLKDEV_INIT ("at91rm9200_ssc.1" ,"pclk" ,NULL ), +}; + +static struct clk_lookup ssc2_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ssc2_clk" ,NULL ), +CLKDEV_INIT ("at91rm9200_ssc.2" ,"pclk" ,NULL ), +}; + +static struct clk_lookup tc0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tc0_clk" ,NULL ), +CLKDEV_INIT ("atmel_tcb.0" ,"t0_clk" ,NULL ), +}; + +static struct clk_lookup tc1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tc1_clk" ,NULL ), +CLKDEV_INIT ("atmel_tcb.0" ,"t1_clk" ,NULL ), +}; + +static struct clk_lookup tc2_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tc2_clk" ,NULL ), +CLKDEV_INIT ("atmel_tcb.2" ,"t2_clk" ,NULL ), +}; + +static struct clk_lookup ohci_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ohci_clk" ,NULL ), +}; + +static struct clk_lookup lcdc_clk_lookup[] = { +CLKDEV_INIT (NULL ,"lcdc_clk" ,NULL ), +}; + +static size_t periph_clock_lookup_sizes[]__initdata = { +0 , +0 , +ARRAY_SIZE (pioA_clk_lookup), +ARRAY_SIZE (pioB_clk_lookup), +ARRAY_SIZE (pioC_clk_lookup), +0 , +ARRAY_SIZE (usart0_clk_lookup), +ARRAY_SIZE (usart1_clk_lookup), +ARRAY_SIZE (usart2_clk_lookup), +ARRAY_SIZE (mci_clk_lookup), +ARRAY_SIZE (udc_clk_lookup), +ARRAY_SIZE (twi_clk_lookup), +ARRAY_SIZE (spi0_clk_lookup), +ARRAY_SIZE (spi1_clk_lookup), +ARRAY_SIZE (ssc0_clk_lookup), +ARRAY_SIZE (ssc1_clk_lookup), +ARRAY_SIZE (ssc2_clk_lookup), +ARRAY_SIZE (tc0_clk_lookup), +ARRAY_SIZE (tc1_clk_lookup), +ARRAY_SIZE (tc2_clk_lookup), +ARRAY_SIZE (ohci_clk_lookup), +ARRAY_SIZE (lcdc_clk_lookup), +}; + +static struct clk_lookup *periph_clock_lookups[]__initdata = { +NULL , +NULL , + pioA_clk_lookup, + pioB_clk_lookup, + pioC_clk_lookup, +NULL , + usart0_clk_lookup, + usart1_clk_lookup, + usart2_clk_lookup, + mci_clk_lookup, + udc_clk_lookup, + twi_clk_lookup, + spi0_clk_lookup, + spi1_clk_lookup, + ssc0_clk_lookup, + ssc1_clk_lookup, + ssc2_clk_lookup, + tc0_clk_lookup, + tc1_clk_lookup, + tc2_clk_lookup, + ohci_clk_lookup, + lcdc_clk_lookup, +}; + + +/* +* The system clocks. +*/ +static struct clk_lookup udp_clk_lookup[] = { +CLKDEV_INIT (NULL ,"udpck" ,NULL ), +}; + +static struct clk_lookup uhp_clk_lookup[] = { +CLKDEV_INIT (NULL ,"uhpck" ,NULL ), +}; + +static struct clk_lookup pck0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck0" ,NULL ), +}; + +static struct clk_lookup pck1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck1" ,NULL ), +}; + +static struct clk_lookup pck2_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck2" ,NULL ), +}; + +static struct clk_lookup pck3_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck3" ,NULL ), +}; + +static struct clk_lookup hck0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"hck0" ,NULL ), +CLKDEV_INIT ("at91_ohci" ,"hclk" ,NULL ), +}; + +static struct clk_lookup hck1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"hck1" ,NULL ), +CLKDEV_INIT ("at91sam9261-lcdfb.0" ,"hclk" ,NULL ), +CLKDEV_INIT ("at91sam9g10-lcdfb.0" ,"hclk" ,NULL ), +}; + +static size_t system_clock_lookup_sizes[]__initdata = { +0 , +0 , +0 , +0 , +0 , +0 , +ARRAY_SIZE (uhp_clk_lookup), +ARRAY_SIZE (udp_clk_lookup), +ARRAY_SIZE (pck0_clk_lookup), +ARRAY_SIZE (pck1_clk_lookup), +ARRAY_SIZE (pck2_clk_lookup), +ARRAY_SIZE (pck3_clk_lookup), +0 , +0 , +0 , +0 , +ARRAY_SIZE (hck0_clk_lookup), +ARRAY_SIZE (hck1_clk_lookup), +}; + +static struct clk_lookup *system_clock_lookups[]__initdata = { +NULL , +NULL , +NULL , +NULL , +NULL , +NULL , + uhp_clk_lookup, + udp_clk_lookup, + pck0_clk_lookup, + pck1_clk_lookup, + pck2_clk_lookup, + pck3_clk_lookup, +NULL , +NULL , +NULL , +NULL , + hck0_clk_lookup, + hck1_clk_lookup, +}; + +static const char *system_clock_parent_names[]__initdata = { +NULL , +NULL , +NULL , +NULL , +NULL , +NULL , +"usbck" , +"usbck" , +"prog0" , +"prog1" , +"prog2" , +"prog3" , +NULL , +NULL , +NULL , +NULL , +"mck" , +"mck" , };/* * The four programmable clocks. * You must configure pin multiplexing to bring these signals out. */ -static struct clk pck0 = { - .name ="pck0" , - .pmc_mask =AT91_PMC_PCK0 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =0 , -}; -static struct clk pck1 = { - .name ="pck1" , - .pmc_mask =AT91_PMC_PCK1 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =1 , -}; -static struct clk pck2 = { - .name ="pck2" , - .pmc_mask =AT91_PMC_PCK2 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =2 , -}; -static struct clk pck3 = { - .name ="pck3" , - .pmc_mask =AT91_PMC_PCK3 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =3 , +static const char *prog_clock_parent_names[]__initdata = { +"clk32k" , +"main" , +"plla" , +"pllb" , +}; + +/* +* The pll clocks. +*/ +static struct clk_lookup pll_clk_lookup[] = { +CLKDEV_INIT (NULL ,"plla" ,NULL ), +CLKDEV_INIT (NULL ,"pllb" ,NULL ), +}; + +static struct clk_range at91sam9261_pll_output[] = { +CLK_RANGE (80000000 ,200000000 ), +CLK_RANGE (190000000 ,240000000 ), +}; +static u8 at91sam9261_pll_out[] = {0 ,2 }; + +struct clk_pll_characteristics at91sam9261_pll_characteristics = { + .input =CLK_RANGE (1000000 ,32000000 ), + .num_output =ARRAY_SIZE (at91sam9261_pll_output), + .output = at91sam9261_pll_output, + .out = at91sam9261_pll_out, +}; + +static struct clk_range at91sam9g10_pll_output[] = { +CLK_RANGE (80000000 ,266000000 ), +}; +static u8 at91sam9g10_pll_out[] = {0 }; + +struct clk_pll_characteristics at91sam9g10_pll_characteristics = { + .input =CLK_RANGE (1000000 ,32000000 ), + .num_output =ARRAY_SIZE (at91sam9g10_pll_output), + .output = at91sam9g10_pll_output, + .out = at91sam9g10_pll_out, +}; + + +/* +* The master clock. +*/ +static struct clk_lookup mck_clk_lookup[] = { +CLKDEV_INIT (NULL ,"mck" ,NULL ), +CLKDEV_INIT ("atmel_usart.0" ,"usart" ,NULL ), +}; + +struct clk_master_characteristics at91sam9261_master_characteristics = { + .output =CLK_RANGE (0 ,94000000 ), + .have_div3_pres =0 , + .divisors = {1 ,2 ,4 ,0 }, +}; + +struct clk_master_characteristics at91sam9g10_master_characteristics = { + .output =CLK_RANGE (0 ,133000000 ), + .have_div3_pres =0 , + .divisors = {1 ,2 ,4 ,0 }, }; +static const char *master_clock_parent_names[]__initdata = { +"clk32k" , +"main" , +"plla" , +"pllb" , +}; + +/* +* The USB clock. +*/ +static u32 usb_divisors[] = {1 ,2 ,4 ,0 }; +static void __init at91sam9261_register_clocks (void ) {int i; +int k; +size_t size; +struct clk *clk; +const char *name; +struct clk_lookup *lookup; +struct clk_pll_characteristics *pll_characteristics; +struct clk_master_characteristics *master_characteristics; + +if (cpu_is_at91sam9g10 ()) { + pll_characteristics = &at91sam9g10_pll_characteristics; + master_characteristics = &at91sam9g10_master_characteristics; + }else { + pll_characteristics = &at91sam9261_pll_characteristics; + master_characteristics = &at91sam9261_master_characteristics; + } -for (i =0 ; i <ARRAY_SIZE (periph_clocks); i++) -clk_register (periph_clocks[i]); +for (i =0 ; i <ARRAY_SIZE (pll_clk_lookup); i++) { + name = pll_clk_lookup[i].con_id; + clk =at91_clk_register_pll (name,"main" , i, + &at91rm9200_pll_layout, + &pll_characteristics[i]); + pll_clk_lookup[i].clk = clk; + } +clkdev_add_table (pll_clk_lookup,ARRAY_SIZE (pll_clk_lookup)); + + clk =at91_clk_register_master ("mck" , +ARRAY_SIZE (master_clock_parent_names), + master_clock_parent_names, + &at91rm9200_master_layout, + master_characteristics); +for (i =0 ; i <ARRAY_SIZE (mck_clk_lookup); i++) + mck_clk_lookup[i].clk = clk; +clkdev_add_table (mck_clk_lookup,ARRAY_SIZE (mck_clk_lookup)); -clkdev_add_table (periph_clocks_lookups, -ARRAY_SIZE (periph_clocks_lookups)); -clkdev_add_table (usart_clocks_lookups, -ARRAY_SIZE (usart_clocks_lookups)); +for (i =0 ; i <ARRAY_SIZE (periph_clock_lookup_sizes); i++) { + size = periph_clock_lookup_sizes[i]; + lookup = periph_clock_lookups[i]; +if (!size || !lookup) +continue ; + name = periph_clock_lookups[i][0 ].con_id; +if (!name) +continue ; + clk =at91_clk_register_peripheral (name,"mck" , i); -clk_register (&pck0); -clk_register (&pck1); -clk_register (&pck2); -clk_register (&pck3); +for (k =0 ; k < size; k++) + lookup[k].clk = clk; +clkdev_add_table (lookup, size); + } -clk_register (&hck0); -clk_register (&hck1); +for (i =0 ; i <4 ; i++) { + name = system_clock_parent_names[8 + i]; + clk =at91_clk_register_programmable (name, + prog_clock_parent_names, +ARRAY_SIZE (prog_clock_parent_names), + i, &at91rm9200_programmable_layout); + } + + clk =at91rm9200_clk_register_usb ("usbck" ,"pllb" , usb_divisors); + +for (i =0 ; i <ARRAY_SIZE (system_clock_lookup_sizes); i++) { + size = system_clock_lookup_sizes[i]; + lookup = system_clock_lookups[i]; +if (!size || !lookup) +continue ; + name = system_clock_lookups[i][0 ].con_id; +if (!name || !system_clock_parent_names[i]) +continue ; + clk =at91_clk_register_system (name, + system_clock_parent_names[i], + i); +for (k =0 ; k < size; k++) + lookup[k].clk = clk; +clkdev_add_table (lookup, size); + } }/* --------------------------------------------------------------------
Signature · 1 line
1.7.9.5
RFC PATCH 16/50 ARM: at91: move at91sam9263 SoC to new at91 clk implem
In reply to Boris BREZILLONThis patch removes all references to the old at91 clks implementation and make use of the new at91 clk implem for at91sam9263 SoC.
All dt specific lookups are removed (handled in clk device tree binding).
--- arch/arm/mach-at91/at91sam9263.c | 597 +++++++++++++++++++++++--------------- 1 file changed, 368 insertions(+), 229 deletions(-)
arch/arm/mach-at91/at91sam9263.c +368 -229
@@ -24,7 +24,6 @@#include "at91_rstc.h" #include "soc.h" #include "generic.h" -#include "clock.h" #include "sam9_smc.h" /* --------------------------------------------------------------------
@@ -34,248 +33,388 @@/* * The peripheral clocks. */ -static struct clk pioA_clk = { - .name ="pioA_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_PIOA , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioB_clk = { - .name ="pioB_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_PIOB , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioCDE_clk = { - .name ="pioCDE_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_PIOCDE , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart0_clk = { - .name ="usart0_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_US0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart1_clk = { - .name ="usart1_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_US1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart2_clk = { - .name ="usart2_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_US2 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk mmc0_clk = { - .name ="mci0_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_MCI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk mmc1_clk = { - .name ="mci1_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_MCI1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk can_clk = { - .name ="can_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_CAN , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twi_clk = { - .name ="twi_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_TWI , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi0_clk = { - .name ="spi0_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_SPI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi1_clk = { - .name ="spi1_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_SPI1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ssc0_clk = { - .name ="ssc0_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_SSC0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ssc1_clk = { - .name ="ssc1_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_SSC1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ac97_clk = { - .name ="ac97_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_AC97C , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tcb_clk = { - .name ="tcb_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_TCB , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pwm_clk = { - .name ="pwm_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_PWMC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk macb_clk = { - .name ="pclk" , - .pmc_mask =1 <<AT91SAM9263_ID_EMAC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk dma_clk = { - .name ="dma_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_DMA , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twodge_clk = { - .name ="2dge_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_2DGE , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk udc_clk = { - .name ="udc_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_UDP , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk isi_clk = { - .name ="isi_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_ISI , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk lcdc_clk = { - .name ="lcdc_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_LCDC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ohci_clk = { - .name ="ohci_clk" , - .pmc_mask =1 <<AT91SAM9263_ID_UHP , - .type =CLK_TYPE_PERIPHERAL , -}; - -static struct clk *periph_clocks[]__initdata = { - &pioA_clk, - &pioB_clk, - &pioCDE_clk, - &usart0_clk, - &usart1_clk, - &usart2_clk, - &mmc0_clk, - &mmc1_clk, - &can_clk, - &twi_clk, - &spi0_clk, - &spi1_clk, - &ssc0_clk, - &ssc1_clk, - &ac97_clk, - &tcb_clk, - &pwm_clk, - &macb_clk, - &twodge_clk, - &udc_clk, - &isi_clk, - &lcdc_clk, - &dma_clk, - &ohci_clk, -// irq0 .. irq1 -}; - -static struct clk_lookup periph_clocks_lookups[] = { -/* One additional fake clock for macb_hclk */ -CLKDEV_CON_ID ("hclk" , &macb_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"at91rm9200_ssc.0" , &ssc0_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"at91rm9200_ssc.1" , &ssc1_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"fff98000.ssc" , &ssc0_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"fff9c000.ssc" , &ssc1_clk), -CLKDEV_CON_DEV_ID ("hclk" ,"at91sam9263-lcdfb.0" , &lcdc_clk), -CLKDEV_CON_DEV_ID ("mci_clk" ,"atmel_mci.0" , &mmc0_clk), -CLKDEV_CON_DEV_ID ("mci_clk" ,"atmel_mci.1" , &mmc1_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"atmel_spi.0" , &spi0_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"atmel_spi.1" , &spi1_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"atmel_tcb.0" , &tcb_clk), -CLKDEV_CON_DEV_ID (NULL ,"i2c-at91sam9260.0" , &twi_clk), -/* fake hclk clock */ -CLKDEV_CON_DEV_ID ("hclk" ,"at91_ohci" , &ohci_clk), -CLKDEV_CON_ID ("pioA" , &pioA_clk), -CLKDEV_CON_ID ("pioB" , &pioB_clk), -CLKDEV_CON_ID ("pioC" , &pioCDE_clk), -CLKDEV_CON_ID ("pioD" , &pioCDE_clk), -CLKDEV_CON_ID ("pioE" , &pioCDE_clk), -/* more usart lookup table for DT entries */ -CLKDEV_CON_DEV_ID ("usart" ,"ffffee00.serial" , &mck), -CLKDEV_CON_DEV_ID ("usart" ,"fff8c000.serial" , &usart0_clk), -CLKDEV_CON_DEV_ID ("usart" ,"fff90000.serial" , &usart1_clk), -CLKDEV_CON_DEV_ID ("usart" ,"fff94000.serial" , &usart2_clk), -/* more tc lookup table for DT entries */ -CLKDEV_CON_DEV_ID ("t0_clk" ,"fff7c000.timer" , &tcb_clk), -CLKDEV_CON_DEV_ID ("hclk" ,"a00000.ohci" , &ohci_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"fffa4000.spi" , &spi0_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"fffa8000.spi" , &spi1_clk), -CLKDEV_CON_DEV_ID ("mci_clk" ,"fff80000.mmc" , &mmc0_clk), -CLKDEV_CON_DEV_ID ("mci_clk" ,"fff84000.mmc" , &mmc1_clk), -CLKDEV_CON_DEV_ID (NULL ,"fff88000.i2c" , &twi_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff200.gpio" , &pioA_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff400.gpio" , &pioB_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff600.gpio" , &pioCDE_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff800.gpio" , &pioCDE_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffffa00.gpio" , &pioCDE_clk), -}; - -static struct clk_lookup usart_clocks_lookups[] = { -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.0" , &mck), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.1" , &usart0_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.2" , &usart1_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.3" , &usart2_clk), +static struct clk_lookup pioA_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioA_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioA" ,NULL ), +}; + +static struct clk_lookup pioB_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioB_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioB" ,NULL ), +}; + +static struct clk_lookup pioCDE_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioCDE_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioC" ,NULL ), +CLKDEV_INIT (NULL ,"pioD" ,NULL ), +CLKDEV_INIT (NULL ,"pioE" ,NULL ), +}; + +static struct clk_lookup usart0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart0_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.1" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart1_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.2" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart2_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart2_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.3" ,"usart" ,NULL ), +}; + +static struct clk_lookup mci0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"mci0_clk" ,NULL ), +CLKDEV_INIT ("atmel_mci.0" ,"mci_clk" ,NULL ), +}; + +static struct clk_lookup mci1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"mci1_clk" ,NULL ), +CLKDEV_INIT ("atmel_mci.1" ,"mci_clk" ,NULL ), +}; + +static struct clk_lookup can_clk_lookup[] = { +CLKDEV_INIT (NULL ,"can_clk" ,NULL ), +}; + +static struct clk_lookup twi_clk_lookup[] = { +CLKDEV_INIT (NULL ,"twi_clk" ,NULL ), +CLKDEV_INIT ("i2c-at91sam9260.0" ,NULL ,NULL ), +}; + +static struct clk_lookup spi0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"spi0_clk" ,NULL ), +CLKDEV_INIT ("atmel_spi.0" ,"spi_clk" ,NULL ), +}; + +static struct clk_lookup spi1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"spi1_clk" ,NULL ), +CLKDEV_INIT ("atmel_spi.1" ,"spi_clk" ,NULL ), +}; + +static struct clk_lookup ssc0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ssc0_clk" ,NULL ), +CLKDEV_INIT ("at91rm9200_ssc.0" ,"pclk" ,NULL ), +}; + +static struct clk_lookup ssc1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ssc1_clk" ,NULL ), +CLKDEV_INIT ("at91rm9200_ssc.1" ,"pclk" ,NULL ), +}; + +static struct clk_lookup ac97_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ac97_clk" ,NULL ), +}; + +static struct clk_lookup tcb_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tcb_clk" ,NULL ), +CLKDEV_INIT ("atmel_tcb.0" ,"t0_clk" ,NULL ), +}; + +static struct clk_lookup pwm_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pwm_clk" ,NULL ), +}; + +static struct clk_lookup macb_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pclk" ,NULL ), +CLKDEV_INIT (NULL ,"hclk" ,NULL ), +}; + +static struct clk_lookup twodge_clk_lookup[] = { +CLKDEV_INIT (NULL ,"2dge_clk" ,NULL ), +}; + +static struct clk_lookup udc_clk_lookup[] = { +CLKDEV_INIT (NULL ,"udc_clk" ,NULL ), +}; + +static struct clk_lookup isi_clk_lookup[] = { +CLKDEV_INIT (NULL ,"isi_clk" ,NULL ), +}; + +static struct clk_lookup lcdc_clk_lookup[] = { +CLKDEV_INIT (NULL ,"lcdc_clk" ,NULL ), +CLKDEV_INIT ("at91sam9263-lcdfb.0" ,"hclk" ,NULL ), +}; + +static struct clk_lookup dma_clk_lookup[] = { +CLKDEV_INIT (NULL ,"dma_clk" ,NULL ), +}; + +static struct clk_lookup ohci_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ohci_clk" ,NULL ), +CLKDEV_INIT ("at91_ohci" ,"hclk" ,NULL ), +}; + +static size_t periph_clock_lookup_sizes[]__initdata = { +0 , +0 , +ARRAY_SIZE (pioA_clk_lookup), +ARRAY_SIZE (pioB_clk_lookup), +ARRAY_SIZE (pioCDE_clk_lookup), +0 , +0 , +ARRAY_SIZE (usart0_clk_lookup), +ARRAY_SIZE (usart1_clk_lookup), +ARRAY_SIZE (usart2_clk_lookup), +ARRAY_SIZE (mci0_clk_lookup), +ARRAY_SIZE (mci1_clk_lookup), +ARRAY_SIZE (can_clk_lookup), +ARRAY_SIZE (twi_clk_lookup), +ARRAY_SIZE (spi0_clk_lookup), +ARRAY_SIZE (spi1_clk_lookup), +ARRAY_SIZE (ssc0_clk_lookup), +ARRAY_SIZE (ssc1_clk_lookup), +ARRAY_SIZE (ac97_clk_lookup), +ARRAY_SIZE (tcb_clk_lookup), +ARRAY_SIZE (pwm_clk_lookup), +ARRAY_SIZE (macb_clk_lookup), +0 , +ARRAY_SIZE (twodge_clk_lookup), +ARRAY_SIZE (udc_clk_lookup), +ARRAY_SIZE (isi_clk_lookup), +ARRAY_SIZE (lcdc_clk_lookup), +ARRAY_SIZE (dma_clk_lookup), +0 , +ARRAY_SIZE (ohci_clk_lookup), +}; + +static struct clk_lookup *periph_clock_lookups[]__initdata = { +NULL , +NULL , + pioA_clk_lookup, + pioB_clk_lookup, + pioCDE_clk_lookup, +NULL , +NULL , + usart0_clk_lookup, + usart1_clk_lookup, + usart2_clk_lookup, + mci0_clk_lookup, + mci1_clk_lookup, + can_clk_lookup, + twi_clk_lookup, + spi0_clk_lookup, + spi1_clk_lookup, + ssc0_clk_lookup, + ssc1_clk_lookup, + ac97_clk_lookup, + tcb_clk_lookup, + pwm_clk_lookup, + macb_clk_lookup, +NULL , + twodge_clk_lookup, + udc_clk_lookup, + isi_clk_lookup, + lcdc_clk_lookup, + dma_clk_lookup, +NULL , + ohci_clk_lookup, +}; + + +/* +* The system clocks. +*/ +static struct clk_lookup udp_clk_lookup[] = { +CLKDEV_INIT (NULL ,"udpck" ,NULL ), +}; + +static struct clk_lookup uhp_clk_lookup[] = { +CLKDEV_INIT (NULL ,"uhpck" ,NULL ), +}; + +static struct clk_lookup pck0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck0" ,NULL ), +}; + +static struct clk_lookup pck1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck1" ,NULL ), +}; + +static struct clk_lookup pck2_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck2" ,NULL ), +}; + +static struct clk_lookup pck3_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck3" ,NULL ), +}; + +static size_t system_clock_lookup_sizes[]__initdata = { +0 , +0 , +0 , +0 , +0 , +0 , +ARRAY_SIZE (uhp_clk_lookup), +ARRAY_SIZE (udp_clk_lookup), +ARRAY_SIZE (pck0_clk_lookup), +ARRAY_SIZE (pck1_clk_lookup), +ARRAY_SIZE (pck2_clk_lookup), +ARRAY_SIZE (pck3_clk_lookup), +}; + +static struct clk_lookup *system_clock_lookups[]__initdata = { +NULL , +NULL , +NULL , +NULL , +NULL , +NULL , + uhp_clk_lookup, + udp_clk_lookup, + pck0_clk_lookup, + pck1_clk_lookup, + pck2_clk_lookup, + pck3_clk_lookup, +}; + +static const char *system_clock_parent_names[]__initdata = { +NULL , +NULL , +NULL , +NULL , +NULL , +NULL , +"usbck" , +"usbck" , +"prog0" , +"prog1" , +"prog2" , +"prog3" , };/* * The four programmable clocks. * You must configure pin multiplexing to bring these signals out. */ -static struct clk pck0 = { - .name ="pck0" , - .pmc_mask =AT91_PMC_PCK0 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =0 , -}; -static struct clk pck1 = { - .name ="pck1" , - .pmc_mask =AT91_PMC_PCK1 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =1 , -}; -static struct clk pck2 = { - .name ="pck2" , - .pmc_mask =AT91_PMC_PCK2 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =2 , -}; -static struct clk pck3 = { - .name ="pck3" , - .pmc_mask =AT91_PMC_PCK3 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =3 , +static const char *prog_clock_parent_names[]__initdata = { +"clk32k" , +"main" , +"plla" , +"pllb" , +}; + + +/* +* The pll clocks. +*/ +static struct clk_lookup pll_clk_lookup[] = { +CLKDEV_INIT (NULL ,"plla" ,NULL ), +CLKDEV_INIT (NULL ,"pllb" ,NULL ), +}; + +static struct clk_range at91sam9263_pll_output[] = { +CLK_RANGE (80000000 ,200000000 ), +CLK_RANGE (190000000 ,240000000 ), +}; +static u8 at91sam9263_pll_out[] = {0 ,2 }; + +struct clk_pll_characteristics at91sam9263_pll_characteristics = { + .input =CLK_RANGE (2000000 ,32000000 ), + .num_output =ARRAY_SIZE (at91sam9263_pll_output), + .output = at91sam9263_pll_output, + .out = at91sam9263_pll_out, +}; + +struct clk_master_characteristics at91sam9263_master_characteristics = { + .output =CLK_RANGE (0 ,120000000 ), + .have_div3_pres =0 , + .divisors = {1 ,2 ,4 ,0 }, +}; + + +/* +* The master clock. +*/ +static struct clk_lookup mck_clk_lookup[] = { +CLKDEV_INIT (NULL ,"mck" ,NULL ), +CLKDEV_INIT ("atmel_usart.0" ,"usart" ,NULL ), }; +static const char *master_clock_parent_names[]__initdata = { +"clk32k" , +"main" , +"plla" , +"pllb" , +}; + + +/* +* The USB clock. +*/ +static u32 usb_divisors[] = {1 ,2 ,4 ,0 }; +static void __init at91sam9263_register_clocks (void ) {int i; +int k; +size_t size; +struct clk *clk; +const char *name; +struct clk_lookup *lookup; + +for (i =0 ; i <ARRAY_SIZE (pll_clk_lookup); i++) { + name = pll_clk_lookup[i].con_id; + clk =at91_clk_register_pll (name,"main" , i, + &at91rm9200_pll_layout, + &at91sam9263_pll_characteristics); + pll_clk_lookup[i].clk = clk; + } +clkdev_add_table (pll_clk_lookup,ARRAY_SIZE (pll_clk_lookup)); + + clk =at91_clk_register_master ("mck" , +ARRAY_SIZE (master_clock_parent_names), + master_clock_parent_names, + &at91rm9200_master_layout, + &at91sam9263_master_characteristics); +for (i =0 ; i <ARRAY_SIZE (mck_clk_lookup); i++) + mck_clk_lookup[i].clk = clk; +clkdev_add_table (mck_clk_lookup,ARRAY_SIZE (mck_clk_lookup)); -for (i =0 ; i <ARRAY_SIZE (periph_clocks); i++) -clk_register (periph_clocks[i]); +for (i =0 ; i <ARRAY_SIZE (periph_clock_lookup_sizes); i++) { + size = periph_clock_lookup_sizes[i]; + lookup = periph_clock_lookups[i]; +if (!size || !lookup) +continue ; + name = periph_clock_lookups[i][0 ].con_id; +if (!name) +continue ; + clk =at91_clk_register_peripheral (name,"mck" , i); -clkdev_add_table (periph_clocks_lookups, -ARRAY_SIZE (periph_clocks_lookups)); -clkdev_add_table (usart_clocks_lookups, -ARRAY_SIZE (usart_clocks_lookups)); +for (k =0 ; k < size; k++) + lookup[k].clk = clk; +clkdev_add_table (lookup, size); + } -clk_register (&pck0); -clk_register (&pck1); -clk_register (&pck2); -clk_register (&pck3); +for (i =0 ; i <4 ; i++) { + name = system_clock_parent_names[8 + i]; + clk =at91_clk_register_programmable (name, + prog_clock_parent_names, +ARRAY_SIZE (prog_clock_parent_names), + i, &at91rm9200_programmable_layout); + } + + clk =at91rm9200_clk_register_usb ("usbck" ,"pllb" , usb_divisors); + +for (i =0 ; i <ARRAY_SIZE (system_clock_lookup_sizes); i++) { + size = system_clock_lookup_sizes[i]; + lookup = system_clock_lookups[i]; +if (!size || !lookup) +continue ; + name = system_clock_lookups[i][0 ].con_id; +if (!name || !system_clock_parent_names[i]) +continue ; + clk =at91_clk_register_system (name, + system_clock_parent_names[i], + i); +for (k =0 ; k < size; k++) + lookup[k].clk = clk; +clkdev_add_table (lookup, size); + } }/* --------------------------------------------------------------------
Signature · 1 line
1.7.9.5
RFC PATCH 17/50 ARM: at91: move at91sam9g45 SoC to new at91 clk implem
In reply to Boris BREZILLONThis patch removes all references to the old at91 clks implementation and make use of the new at91 clk implem for at91sam9g45 SoC.
All dt specific lookups are removed (handled in clk device tree binding).
--- arch/arm/mach-at91/at91sam9g45.c | 703 ++++++++++++++++++------------ arch/arm/mach-at91/at91sam9g45_devices.c | 1 - 2 files changed, 427 insertions(+), 277 deletions(-)
arch/arm/mach-at91/at91sam9g45.c +427 -276
@@ -24,7 +24,6 @@#include "at91_aic.h" #include "soc.h" #include "generic.h" -#include "clock.h" #include "sam9_smc.h" /* --------------------------------------------------------------------
@@ -34,297 +33,449 @@/* * The peripheral clocks. */ -static struct clk pioA_clk = { - .name ="pioA_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_PIOA , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioB_clk = { - .name ="pioB_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_PIOB , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioC_clk = { - .name ="pioC_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_PIOC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioDE_clk = { - .name ="pioDE_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_PIODE , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk trng_clk = { - .name ="trng_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_TRNG , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart0_clk = { - .name ="usart0_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_US0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart1_clk = { - .name ="usart1_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_US1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart2_clk = { - .name ="usart2_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_US2 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart3_clk = { - .name ="usart3_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_US3 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk mmc0_clk = { - .name ="mci0_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_MCI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twi0_clk = { - .name ="twi0_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_TWI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twi1_clk = { - .name ="twi1_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_TWI1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi0_clk = { - .name ="spi0_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_SPI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi1_clk = { - .name ="spi1_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_SPI1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ssc0_clk = { - .name ="ssc0_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_SSC0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ssc1_clk = { - .name ="ssc1_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_SSC1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tcb0_clk = { - .name ="tcb0_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_TCB , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pwm_clk = { - .name ="pwm_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_PWMC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tsc_clk = { - .name ="tsc_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_TSC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk dma_clk = { - .name ="dma_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_DMA , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk uhphs_clk = { - .name ="uhphs_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_UHPHS , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk lcdc_clk = { - .name ="lcdc_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_LCDC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ac97_clk = { - .name ="ac97_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_AC97C , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk macb_clk = { - .name ="pclk" , - .pmc_mask =1 <<AT91SAM9G45_ID_EMAC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk isi_clk = { - .name ="isi_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_ISI , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk udphs_clk = { - .name ="udphs_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_UDPHS , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk mmc1_clk = { - .name ="mci1_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_MCI1 , - .type =CLK_TYPE_PERIPHERAL , -}; - -/* Video decoder clock - Only for sam9m10/sam9m11 */ -static struct clk vdec_clk = { - .name ="vdec_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_VDEC , - .type =CLK_TYPE_PERIPHERAL , -}; - -static struct clk adc_op_clk = { - .name ="adc_op_clk" , - .type =CLK_TYPE_PERIPHERAL , - .rate_hz =13200000 , -}; - -/* AES/TDES/SHA clock - Only for sam9m11/sam9g56 */ -static struct clk aestdessha_clk = { - .name ="aestdessha_clk" , - .pmc_mask =1 <<AT91SAM9G45_ID_AESTDESSHA , - .type =CLK_TYPE_PERIPHERAL , -}; - -static struct clk *periph_clocks[]__initdata = { - &pioA_clk, - &pioB_clk, - &pioC_clk, - &pioDE_clk, - &trng_clk, - &usart0_clk, - &usart1_clk, - &usart2_clk, - &usart3_clk, - &mmc0_clk, - &twi0_clk, - &twi1_clk, - &spi0_clk, - &spi1_clk, - &ssc0_clk, - &ssc1_clk, - &tcb0_clk, - &pwm_clk, - &tsc_clk, - &dma_clk, - &uhphs_clk, - &lcdc_clk, - &ac97_clk, - &macb_clk, - &isi_clk, - &udphs_clk, - &mmc1_clk, - &adc_op_clk, - &aestdessha_clk, -// irq0 -}; - -static struct clk_lookup periph_clocks_lookups[] = { -/* One additional fake clock for macb_hclk */ -CLKDEV_CON_ID ("hclk" , &macb_clk), -/* One additional fake clock for ohci */ -CLKDEV_CON_ID ("ohci_clk" , &uhphs_clk), -CLKDEV_CON_DEV_ID ("hclk" ,"at91sam9g45-lcdfb.0" , &lcdc_clk), -CLKDEV_CON_DEV_ID ("hclk" ,"at91sam9g45es-lcdfb.0" , &lcdc_clk), -CLKDEV_CON_DEV_ID ("ehci_clk" ,"atmel-ehci" , &uhphs_clk), -CLKDEV_CON_DEV_ID ("hclk" ,"atmel_usba_udc" , &utmi_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"atmel_usba_udc" , &udphs_clk), -CLKDEV_CON_DEV_ID ("mci_clk" ,"atmel_mci.0" , &mmc0_clk), -CLKDEV_CON_DEV_ID ("mci_clk" ,"atmel_mci.1" , &mmc1_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"atmel_spi.0" , &spi0_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"atmel_spi.1" , &spi1_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"atmel_tcb.0" , &tcb0_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"atmel_tcb.1" , &tcb0_clk), -CLKDEV_CON_DEV_ID (NULL ,"i2c-at91sam9g10.0" , &twi0_clk), -CLKDEV_CON_DEV_ID (NULL ,"i2c-at91sam9g10.1" , &twi1_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"at91sam9g45_ssc.0" , &ssc0_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"at91sam9g45_ssc.1" , &ssc1_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"fff9c000.ssc" , &ssc0_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"fffa0000.ssc" , &ssc1_clk), -CLKDEV_CON_DEV_ID (NULL ,"atmel-trng" , &trng_clk), -CLKDEV_CON_DEV_ID (NULL ,"atmel_sha" , &aestdessha_clk), -CLKDEV_CON_DEV_ID (NULL ,"atmel_tdes" , &aestdessha_clk), -CLKDEV_CON_DEV_ID (NULL ,"atmel_aes" , &aestdessha_clk), -/* more usart lookup table for DT entries */ -CLKDEV_CON_DEV_ID ("usart" ,"ffffee00.serial" , &mck), -CLKDEV_CON_DEV_ID ("usart" ,"fff8c000.serial" , &usart0_clk), -CLKDEV_CON_DEV_ID ("usart" ,"fff90000.serial" , &usart1_clk), -CLKDEV_CON_DEV_ID ("usart" ,"fff94000.serial" , &usart2_clk), -CLKDEV_CON_DEV_ID ("usart" ,"fff98000.serial" , &usart3_clk), -/* more tc lookup table for DT entries */ -CLKDEV_CON_DEV_ID ("t0_clk" ,"fff7c000.timer" , &tcb0_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"fffd4000.timer" , &tcb0_clk), -CLKDEV_CON_DEV_ID ("hclk" ,"700000.ohci" , &uhphs_clk), -CLKDEV_CON_DEV_ID ("ehci_clk" ,"800000.ehci" , &uhphs_clk), -CLKDEV_CON_DEV_ID ("mci_clk" ,"fff80000.mmc" , &mmc0_clk), -CLKDEV_CON_DEV_ID ("mci_clk" ,"fffd0000.mmc" , &mmc1_clk), -CLKDEV_CON_DEV_ID (NULL ,"fff84000.i2c" , &twi0_clk), -CLKDEV_CON_DEV_ID (NULL ,"fff88000.i2c" , &twi1_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"fffa4000.spi" , &spi0_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"fffa8000.spi" , &spi1_clk), -/* fake hclk clock */ -CLKDEV_CON_DEV_ID ("hclk" ,"at91_ohci" , &uhphs_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff200.gpio" , &pioA_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff400.gpio" , &pioB_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff600.gpio" , &pioC_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff800.gpio" , &pioDE_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffffa00.gpio" , &pioDE_clk), - -CLKDEV_CON_ID ("pioA" , &pioA_clk), -CLKDEV_CON_ID ("pioB" , &pioB_clk), -CLKDEV_CON_ID ("pioC" , &pioC_clk), -CLKDEV_CON_ID ("pioD" , &pioDE_clk), -CLKDEV_CON_ID ("pioE" , &pioDE_clk), -/* Fake adc clock */ -CLKDEV_CON_ID ("adc_clk" , &tsc_clk), -}; - -static struct clk_lookup usart_clocks_lookups[] = { -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.0" , &mck), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.1" , &usart0_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.2" , &usart1_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.3" , &usart2_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.4" , &usart3_clk), +static struct clk_lookup pioA_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioA_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioA" ,NULL ), +}; + +static struct clk_lookup pioB_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioB_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioB" ,NULL ), +}; + +static struct clk_lookup pioC_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioC_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioC" ,NULL ), +}; + +static struct clk_lookup pioDE_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioDE_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioD" ,NULL ), +CLKDEV_INIT (NULL ,"pioE" ,NULL ), +}; + +static struct clk_lookup trng_clk_lookup[] = { +CLKDEV_INIT (NULL ,"trng_clk" ,NULL ), +CLKDEV_INIT ("atmel-trng" ,NULL ,NULL ), +}; + +static struct clk_lookup usart0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart0_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.1" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart1_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.2" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart2_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart2_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.3" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart3_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart3_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.4" ,"usart" ,NULL ), +}; + +static struct clk_lookup mci0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"mci0_clk" ,NULL ), +CLKDEV_INIT ("atmel_mci.0" ,"mci_clk" ,NULL ), +}; + +static struct clk_lookup twi0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"twi0_clk" ,NULL ), +CLKDEV_INIT ("i2c-at91sam9g10.0" ,NULL ,NULL ), +}; + +static struct clk_lookup twi1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"twi1_clk" ,NULL ), +CLKDEV_INIT ("i2c-at91sam9g10.1" ,NULL ,NULL ), +}; + +static struct clk_lookup spi0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"spi0_clk" ,NULL ), +CLKDEV_INIT ("atmel_spi.0" ,"spi_clk" ,NULL ), +}; + +static struct clk_lookup spi1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"spi0_clk" ,NULL ), +CLKDEV_INIT ("atmel_spi.1" ,"spi_clk" ,NULL ), +}; + +static struct clk_lookup ssc0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ssc0_clk" ,NULL ), +CLKDEV_INIT ("at91sam9g45_ssc.0" ,"pclk" ,NULL ), +}; + +static struct clk_lookup ssc1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ssc1_clk" ,NULL ), +CLKDEV_INIT ("at91sam9g45_ssc.0" ,"pclk" ,NULL ), +}; + +static struct clk_lookup tcb0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tcb0_clk" ,NULL ), +CLKDEV_INIT ("atmel_tcb.0" ,"t0_clk" ,NULL ), +CLKDEV_INIT ("atmel_tcb.1" ,"t0_clk" ,NULL ), +}; + +static struct clk_lookup pwm_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pwm_clk" ,NULL ), +}; + +static struct clk_lookup tsc_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tsc_clk" ,NULL ), +CLKDEV_INIT ("adc_clk" ,NULL ,NULL ), +}; + +static struct clk_lookup dma_clk_lookup[] = { +CLKDEV_INIT (NULL ,"dma_clk" ,NULL ), +}; + +static struct clk_lookup uhphs_clk_lookup[] = { +CLKDEV_INIT (NULL ,"uhphs_clk" ,NULL ), +CLKDEV_INIT (NULL ,"ohci_clk" ,NULL ), +CLKDEV_INIT ("atmel-ehci" ,"ehci_clk" ,NULL ), +CLKDEV_INIT ("at91_ohci" ,"hclk" ,NULL ), +}; + +static struct clk_lookup lcdc_clk_lookup[] = { +CLKDEV_INIT (NULL ,"lcdc_clk" ,NULL ), +CLKDEV_INIT ("hclk" ,"at91sam9g45-lcdfb.0" ,NULL ), +CLKDEV_INIT ("hclk" ,"at91sam9g45es-lcdfb.0" ,NULL ), +}; + +static struct clk_lookup ac97_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ac97_clk" ,NULL ), +}; + +static struct clk_lookup macb_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pclk" ,NULL ), +CLKDEV_INIT (NULL ,"hclk" ,NULL ), +}; + +static struct clk_lookup isi_clk_lookup[] = { +CLKDEV_INIT (NULL ,"isi_clk" ,NULL ), +}; + +static struct clk_lookup udphs_clk_lookup[] = { +CLKDEV_INIT (NULL ,"udphs_clk" ,NULL ), +CLKDEV_INIT ("atmel_usba_udc" ,"pclk" ,NULL ), +}; + +static struct clk_lookup aestdessha_clk_lookup[] = { +CLKDEV_INIT ("atmel_sha" ,NULL ,NULL ), +CLKDEV_INIT ("atmel_tdes" ,NULL ,NULL ), +CLKDEV_INIT ("atmel_aes" ,NULL ,NULL ), +}; + +static struct clk_lookup mci1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"mci1_clk" ,NULL ), +CLKDEV_INIT ("atmel_mci.1" ,"mci_clk" ,NULL ), +}; + +static struct clk_lookup vdec_clk_lookup[] = { +CLKDEV_INIT (NULL ,"vdec_clk" ,NULL ), +}; + +static size_t periph_clock_lookup_sizes[]__initdata = { +0 , +0 , +ARRAY_SIZE (pioA_clk_lookup), +ARRAY_SIZE (pioB_clk_lookup), +ARRAY_SIZE (pioC_clk_lookup), +ARRAY_SIZE (pioDE_clk_lookup), +ARRAY_SIZE (trng_clk_lookup), +ARRAY_SIZE (usart0_clk_lookup), +ARRAY_SIZE (usart1_clk_lookup), +ARRAY_SIZE (usart2_clk_lookup), +ARRAY_SIZE (usart3_clk_lookup), +ARRAY_SIZE (mci0_clk_lookup), +ARRAY_SIZE (twi0_clk_lookup), +ARRAY_SIZE (twi1_clk_lookup), +ARRAY_SIZE (spi0_clk_lookup), +ARRAY_SIZE (spi1_clk_lookup), +ARRAY_SIZE (ssc0_clk_lookup), +ARRAY_SIZE (ssc1_clk_lookup), +ARRAY_SIZE (tcb0_clk_lookup), +ARRAY_SIZE (pwm_clk_lookup), +ARRAY_SIZE (tsc_clk_lookup), +ARRAY_SIZE (dma_clk_lookup), +ARRAY_SIZE (uhphs_clk_lookup), +ARRAY_SIZE (lcdc_clk_lookup), +ARRAY_SIZE (ac97_clk_lookup), +ARRAY_SIZE (macb_clk_lookup), +ARRAY_SIZE (isi_clk_lookup), +ARRAY_SIZE (udphs_clk_lookup), +0 , +ARRAY_SIZE (mci1_clk_lookup), +}; + +static struct clk_lookup *periph_clock_lookups[]__initdata = { +NULL , +NULL , + pioA_clk_lookup, + pioB_clk_lookup, + pioC_clk_lookup, + pioDE_clk_lookup, + trng_clk_lookup, + usart0_clk_lookup, + usart1_clk_lookup, + usart2_clk_lookup, + usart3_clk_lookup, + mci0_clk_lookup, + twi0_clk_lookup, + twi1_clk_lookup, + spi0_clk_lookup, + spi1_clk_lookup, + ssc0_clk_lookup, + ssc1_clk_lookup, + tcb0_clk_lookup, + pwm_clk_lookup, + tsc_clk_lookup, + dma_clk_lookup, + uhphs_clk_lookup, + lcdc_clk_lookup, + ac97_clk_lookup, + macb_clk_lookup, + isi_clk_lookup, + udphs_clk_lookup, +NULL , + mci1_clk_lookup, +}; + + +/* +* The system clocks. +*/ +static struct clk_lookup ddr_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ddrck" ,NULL ), +}; + +static struct clk_lookup uhp_clk_lookup[] = { +CLKDEV_INIT (NULL ,"uhpck" ,NULL ), +}; + +static struct clk_lookup pck0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck0" ,NULL ), +}; + +static struct clk_lookup pck1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck1" ,NULL ), +}; + +static size_t system_clock_lookup_sizes[]__initdata = { +0 , +0 , +ARRAY_SIZE (ddr_clk_lookup), +0 , +0 , +0 , +ARRAY_SIZE (uhp_clk_lookup), +0 , +ARRAY_SIZE (pck0_clk_lookup), +ARRAY_SIZE (pck1_clk_lookup), +}; + +static struct clk_lookup *system_clock_lookups[]__initdata = { +NULL , +NULL , + ddr_clk_lookup, +NULL , +NULL , +NULL , + uhp_clk_lookup, +NULL , + pck0_clk_lookup, + pck1_clk_lookup, +}; + +static const char *system_clock_parent_names[]__initdata = { +NULL , +NULL , +"mck" , +NULL , +NULL , +NULL , +"usbck" , +NULL , +"prog0" , +"prog1" , };/* * The two programmable clocks. * You must configure pin multiplexing to bring these signals out. */ -static struct clk pck0 = { - .name ="pck0" , - .pmc_mask =AT91_PMC_PCK0 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =0 , +static const char *prog_clock_parent_names[]__initdata = { +"clk32k" , +"main" , +"plladiv" , +"utmi_clk" , +"mck" , +}; + +/* +* The pll clocks. +*/ +static struct clk_lookup pll_clk_lookup[] = { +CLKDEV_INIT (NULL ,"plla" ,NULL ), +}; + +static struct clk_range at91sam9g45_plla_output[] = { +CLK_RANGE (745000000 ,800000000 ), +CLK_RANGE (695000000 ,750000000 ), +CLK_RANGE (645000000 ,700000000 ), +CLK_RANGE (595000000 ,650000000 ), +CLK_RANGE (545000000 ,600000000 ), +CLK_RANGE (495000000 ,550000000 ), +CLK_RANGE (445000000 ,500000000 ), +CLK_RANGE (400000000 ,450000000 ), +}; +static u8 at91sam9g45_plla_out[] = {0 ,1 ,2 ,3 ,0 ,1 ,2 ,3 }; +static u16 at91sam9g45_plla_icpll[] = {0 ,0 ,0 ,0 ,1 ,1 ,1 ,1 }; + +struct clk_pll_characteristics at91sam9g45_plla_characteristics = { + .input =CLK_RANGE (2000000 ,32000000 ), + .num_output =ARRAY_SIZE (at91sam9g45_plla_output), + .output = at91sam9g45_plla_output, + .out = at91sam9g45_plla_out, + .icpll = at91sam9g45_plla_icpll, +}; + + +/* +* The master clock. +*/ +static struct clk_lookup mck_clk_lookup[] = { +CLKDEV_INIT (NULL ,"mck" ,NULL ), +CLKDEV_INIT ("atmel_usart.0" ,"usart" ,NULL ), +}; + +struct clk_master_characteristics at91sam9g45_master_characteristics = { + .output =CLK_RANGE (0 ,133000000 ), + .have_div3_pres =0 , + .divisors = {1 ,2 ,4 ,3 }, +}; + +static const char *master_clock_parent_names[]__initdata = { +"clk32k" , +"main" , +"plladiv" , +"utmi_clk" , +}; + +/* +* UTMI clock. +*/ +static struct clk_lookup utmi_clk_lookup[] = { +CLKDEV_INIT (NULL ,"utmi_clk" ,NULL ), +CLKDEV_INIT ("atmel_usba_udc" ,"hclk" ,NULL ), }; -static struct clk pck1 = { - .name ="pck1" , - .pmc_mask =AT91_PMC_PCK1 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =1 , + +/* +* USB clock. +*/ +static const char *usb_clock_parent_names[]__initdata = { +"plladiv" , +"utmi_clk" , };static void __init at91sam9g45_register_clocks (void ) {int i; +int k; +size_t size; +struct clk *clk; +const char *name; +struct clk_lookup *lookup; + + clk =at91_clk_register_pll ("plla" ,"main" ,0 , + &at91sam9g45_pll_layout, + &at91sam9g45_plla_characteristics); +for (i =0 ; i <ARRAY_SIZE (pll_clk_lookup); i++) + pll_clk_lookup[i].clk = clk; +clkdev_add_table (pll_clk_lookup,ARRAY_SIZE (pll_clk_lookup)); + clk =at91_clk_register_plldiv ("plladiv" ,"plla" ); -for (i =0 ; i <ARRAY_SIZE (periph_clocks); i++) -clk_register (periph_clocks[i]); + clk =at91_clk_register_utmi ("utmi_clk" ,"main" ); +for (i =0 ; i <ARRAY_SIZE (utmi_clk_lookup); i++) + utmi_clk_lookup[i].clk = clk; +clkdev_add_table (utmi_clk_lookup,ARRAY_SIZE (utmi_clk_lookup)); -clkdev_add_table (periph_clocks_lookups, -ARRAY_SIZE (periph_clocks_lookups)); -clkdev_add_table (usart_clocks_lookups, -ARRAY_SIZE (usart_clocks_lookups)); + clk =at91_clk_register_master ("mck" , +ARRAY_SIZE (master_clock_parent_names), + master_clock_parent_names, + &at91rm9200_master_layout, + &at91sam9g45_master_characteristics); +for (i =0 ; i <ARRAY_SIZE (mck_clk_lookup); i++) + mck_clk_lookup[i].clk = clk; +clkdev_add_table (mck_clk_lookup,ARRAY_SIZE (mck_clk_lookup)); -if (cpu_is_at91sam9m10 () ||cpu_is_at91sam9m11 ()) -clk_register (&vdec_clk); +for (i =0 ; i <ARRAY_SIZE (periph_clock_lookup_sizes); i++) { + size = periph_clock_lookup_sizes[i]; + lookup = periph_clock_lookups[i]; +if (!size || !lookup) +continue ; + name = periph_clock_lookups[i][0 ].con_id; +if (!name) +continue ; + clk =at91_clk_register_peripheral (name,"mck" , i); + +for (k =0 ; k < size; k++) + lookup[k].clk = clk; +clkdev_add_table (lookup, size); + } + +if (cpu_is_at91sam9m10 () ||cpu_is_at91sam9m11 ()) { + clk =at91_clk_register_peripheral (vdec_clk_lookup[0 ].con_id, +"mck" , +AT91SAM9G45_ID_VDEC ); +for (k =0 ; k <ARRAY_SIZE (vdec_clk_lookup); k++) + vdec_clk_lookup[k].clk = clk; +clkdev_add_table (vdec_clk_lookup,ARRAY_SIZE (vdec_clk_lookup)); + } + +if (cpu_is_at91sam9m11 () ||cpu_is_at91sam9g46 ()) { + clk =at91_clk_register_peripheral (vdec_clk_lookup[0 ].con_id, +"mck" , +AT91SAM9G45_ID_AESTDESSHA ); +for (k =0 ; k <ARRAY_SIZE (aestdessha_clk_lookup); k++) + aestdessha_clk_lookup[k].clk = clk; +clkdev_add_table (vdec_clk_lookup, +ARRAY_SIZE (aestdessha_clk_lookup)); + } + +for (i =0 ; i <2 ; i++) { + name = system_clock_parent_names[8 + i]; + clk =at91_clk_register_programmable (name, + prog_clock_parent_names, +ARRAY_SIZE (prog_clock_parent_names), + i, &at91sam9g45_programmable_layout); + } + + clk =at91sam9x5_clk_register_usb ("usbck" , usb_clock_parent_names, +ARRAY_SIZE (usb_clock_parent_names), +0 ); + +for (i =0 ; i <ARRAY_SIZE (system_clock_lookup_sizes); i++) { + size = system_clock_lookup_sizes[i]; + lookup = system_clock_lookups[i]; +if (!size || !lookup) +continue ; + name = system_clock_lookups[i][0 ].con_id; +if (!name || !system_clock_parent_names[i]) +continue ; + clk =at91_clk_register_system (name, + system_clock_parent_names[i], + i); +for (k =0 ; k < size; k++) + lookup[k].clk = clk; +clkdev_add_table (lookup, size); + } -clk_register (&pck0); -clk_register (&pck1); +clk_register_fixed_rate (NULL ,"adc_op_clk" ,"mck" ,0 ,13200000 ); }/* --------------------------------------------------------------------
arch/arm/mach-at91/at91sam9g45_devices.c +0 -1
@@ -37,7 +37,6 @@#include "board.h" #include "generic.h" -#include "clock.h" /* --------------------------------------------------------------------
Signature · 1 line
1.7.9.5
RFC PATCH 18/50 ARM: at91: move at91sam9n12 SoC to new at91 clk implem
In reply to Boris BREZILLONThis patch removes all references to the old at91 clks for at91sam9n12 SoC. This SoC only supports dt boards: we can remove register_clocks (all clocks are defined in dt).
--- arch/arm/mach-at91/at91sam9n12.c | 194 -------------------------------------- 1 file changed, 194 deletions(-)
arch/arm/mach-at91/at91sam9n12.c +0 -194
@@ -19,202 +19,9 @@#include "board.h" #include "soc.h" #include "generic.h" -#include "clock.h" #include "sam9_smc.h" /* -------------------------------------------------------------------- -* Clocks -* -------------------------------------------------------------------- */ - -/* -* The peripheral clocks. -*/ -static struct clk pioAB_clk = { - .name ="pioAB_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_PIOAB , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioCD_clk = { - .name ="pioCD_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_PIOCD , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart0_clk = { - .name ="usart0_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_USART0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart1_clk = { - .name ="usart1_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_USART1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart2_clk = { - .name ="usart2_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_USART2 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart3_clk = { - .name ="usart3_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_USART3 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twi0_clk = { - .name ="twi0_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_TWI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twi1_clk = { - .name ="twi1_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_TWI1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk mmc_clk = { - .name ="mci_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_MCI , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi0_clk = { - .name ="spi0_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_SPI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi1_clk = { - .name ="spi1_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_SPI1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk uart0_clk = { - .name ="uart0_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_UART0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk uart1_clk = { - .name ="uart1_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_UART1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tcb_clk = { - .name ="tcb_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_TCB , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pwm_clk = { - .name ="pwm_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_PWM , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk adc_clk = { - .name ="adc_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_ADC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk dma_clk = { - .name ="dma_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_DMA , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk uhp_clk = { - .name ="uhp" , - .pmc_mask =1 <<AT91SAM9N12_ID_UHP , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk udp_clk = { - .name ="udp_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_UDP , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk lcdc_clk = { - .name ="lcdc_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_LCDC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ssc_clk = { - .name ="ssc_clk" , - .pmc_mask =1 <<AT91SAM9N12_ID_SSC , - .type =CLK_TYPE_PERIPHERAL , -}; - -static struct clk *periph_clocks[]__initdata = { - &pioAB_clk, - &pioCD_clk, - &usart0_clk, - &usart1_clk, - &usart2_clk, - &usart3_clk, - &twi0_clk, - &twi1_clk, - &mmc_clk, - &spi0_clk, - &spi1_clk, - &lcdc_clk, - &uart0_clk, - &uart1_clk, - &tcb_clk, - &pwm_clk, - &adc_clk, - &dma_clk, - &uhp_clk, - &udp_clk, - &ssc_clk, -}; - -static struct clk_lookup periph_clocks_lookups[] = { -/* lookup table for DT entries */ -CLKDEV_CON_DEV_ID ("usart" ,"fffff200.serial" , &mck), -CLKDEV_CON_DEV_ID ("usart" ,"f801c000.serial" , &usart0_clk), -CLKDEV_CON_DEV_ID ("usart" ,"f8020000.serial" , &usart1_clk), -CLKDEV_CON_DEV_ID ("usart" ,"f8024000.serial" , &usart2_clk), -CLKDEV_CON_DEV_ID ("usart" ,"f8028000.serial" , &usart3_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"f8008000.timer" , &tcb_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"f800c000.timer" , &tcb_clk), -CLKDEV_CON_DEV_ID ("mci_clk" ,"f0008000.mmc" , &mmc_clk), -CLKDEV_CON_DEV_ID ("dma_clk" ,"ffffec00.dma-controller" , &dma_clk), -CLKDEV_CON_DEV_ID (NULL ,"f8010000.i2c" , &twi0_clk), -CLKDEV_CON_DEV_ID (NULL ,"f8014000.i2c" , &twi1_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"f0000000.spi" , &spi0_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"f0004000.spi" , &spi1_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff400.gpio" , &pioAB_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff600.gpio" , &pioAB_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff800.gpio" , &pioCD_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffffa00.gpio" , &pioCD_clk), -/* additional fake clock for macb_hclk */ -CLKDEV_CON_DEV_ID ("hclk" ,"500000.ohci" , &uhp_clk), -CLKDEV_CON_DEV_ID ("ohci_clk" ,"500000.ohci" , &uhp_clk), -}; - -/* -* The two programmable clocks. -* You must configure pin multiplexing to bring these signals out. -*/ -static struct clk pck0 = { - .name ="pck0" , - .pmc_mask =AT91_PMC_PCK0 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =0 , -}; -static struct clk pck1 = { - .name ="pck1" , - .pmc_mask =AT91_PMC_PCK1 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =1 , -}; - -static void __init at91sam9n12_register_clocks (void ) -{ -int i; - -for (i =0 ; i <ARRAY_SIZE (periph_clocks); i++) -clk_register (periph_clocks[i]); -clk_register (&pck0); -clk_register (&pck1); - -clkdev_add_table (periph_clocks_lookups, -ARRAY_SIZE (periph_clocks_lookups)); - -} - -/* -------------------------------------------------------------------- * AT91SAM9N12 processor initialization * -------------------------------------------------------------------- */
@@ -230,6 +37,5 @@ void __init at91sam9n12_initialize(void)AT91_SOC_START (at91sam9n12) .map_io = at91sam9n12_map_io, - .register_clocks = at91sam9n12_register_clocks, .init = at91sam9n12_initialize,AT91_SOC_END
Signature · 1 line
1.7.9.5
RFC PATCH 19/50 ARM: at91: move at91sam9rl SoC to new at91 clk implem
In reply to Boris BREZILLONThis patch removes all references to the old at91 clks implementation and make use of the new at91 clk implem for at91sam9rl SoC.
All dt specific lookups are removed (handled in clk device tree binding).
--- arch/arm/mach-at91/at91sam9rl.c | 512 ++++++++++++++++++++++++--------------- 1 file changed, 323 insertions(+), 189 deletions(-)
arch/arm/mach-at91/at91sam9rl.c +323 -189
@@ -25,7 +25,6 @@#include "at91_rstc.h" #include "soc.h" #include "generic.h" -#include "clock.h" #include "sam9_smc.h" /* --------------------------------------------------------------------
@@ -35,207 +34,342 @@/* * The peripheral clocks. */ -static struct clk pioA_clk = { - .name ="pioA_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_PIOA , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioB_clk = { - .name ="pioB_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_PIOB , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioC_clk = { - .name ="pioC_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_PIOC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioD_clk = { - .name ="pioD_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_PIOD , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart0_clk = { - .name ="usart0_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_US0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart1_clk = { - .name ="usart1_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_US1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart2_clk = { - .name ="usart2_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_US2 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart3_clk = { - .name ="usart3_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_US3 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk mmc_clk = { - .name ="mci_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_MCI , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twi0_clk = { - .name ="twi0_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_TWI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twi1_clk = { - .name ="twi1_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_TWI1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi_clk = { - .name ="spi_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_SPI , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ssc0_clk = { - .name ="ssc0_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_SSC0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ssc1_clk = { - .name ="ssc1_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_SSC1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tc0_clk = { - .name ="tc0_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_TC0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tc1_clk = { - .name ="tc1_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_TC1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tc2_clk = { - .name ="tc2_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_TC2 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pwm_clk = { - .name ="pwm_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_PWMC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tsc_clk = { - .name ="tsc_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_TSC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk dma_clk = { - .name ="dma_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_DMA , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk udphs_clk = { - .name ="udphs_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_UDPHS , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk lcdc_clk = { - .name ="lcdc_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_LCDC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ac97_clk = { - .name ="ac97_clk" , - .pmc_mask =1 <<AT91SAM9RL_ID_AC97C , - .type =CLK_TYPE_PERIPHERAL , -}; - -static struct clk *periph_clocks[]__initdata = { - &pioA_clk, - &pioB_clk, - &pioC_clk, - &pioD_clk, - &usart0_clk, - &usart1_clk, - &usart2_clk, - &usart3_clk, - &mmc_clk, - &twi0_clk, - &twi1_clk, - &spi_clk, - &ssc0_clk, - &ssc1_clk, - &tc0_clk, - &tc1_clk, - &tc2_clk, - &pwm_clk, - &tsc_clk, - &dma_clk, - &udphs_clk, - &lcdc_clk, - &ac97_clk, -// irq0 -}; - -static struct clk_lookup periph_clocks_lookups[] = { -CLKDEV_CON_DEV_ID ("hclk" ,"at91sam9rl-lcdfb.0" , &lcdc_clk), -CLKDEV_CON_DEV_ID ("hclk" ,"atmel_usba_udc" , &utmi_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"atmel_usba_udc" , &udphs_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"atmel_tcb.0" , &tc0_clk), -CLKDEV_CON_DEV_ID ("t1_clk" ,"atmel_tcb.0" , &tc1_clk), -CLKDEV_CON_DEV_ID ("t2_clk" ,"atmel_tcb.0" , &tc2_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"at91rm9200_ssc.0" , &ssc0_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"at91rm9200_ssc.1" , &ssc1_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"fffc0000.ssc" , &ssc0_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"fffc4000.ssc" , &ssc1_clk), -CLKDEV_CON_DEV_ID (NULL ,"i2c-at91sam9g20.0" , &twi0_clk), -CLKDEV_CON_DEV_ID (NULL ,"i2c-at91sam9g20.1" , &twi1_clk), -CLKDEV_CON_ID ("pioA" , &pioA_clk), -CLKDEV_CON_ID ("pioB" , &pioB_clk), -CLKDEV_CON_ID ("pioC" , &pioC_clk), -CLKDEV_CON_ID ("pioD" , &pioD_clk), -}; - -static struct clk_lookup usart_clocks_lookups[] = { -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.0" , &mck), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.1" , &usart0_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.2" , &usart1_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.3" , &usart2_clk), -CLKDEV_CON_DEV_ID ("usart" ,"atmel_usart.4" , &usart3_clk), +static struct clk_lookup pioA_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioA_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioA" ,NULL ), }; +static struct clk_lookup pioB_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioB_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioB" ,NULL ), +}; + +static struct clk_lookup pioC_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioC_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioC" ,NULL ), +}; + +static struct clk_lookup pioD_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pioD_clk" ,NULL ), +CLKDEV_INIT (NULL ,"pioD" ,NULL ), +}; + +static struct clk_lookup usart0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart0_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.1" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart1_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.2" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart2_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart2_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.3" ,"usart" ,NULL ), +}; + +static struct clk_lookup usart3_clk_lookup[] = { +CLKDEV_INIT (NULL ,"usart3_clk" ,NULL ), +CLKDEV_INIT ("atmel_usart.4" ,"usart" ,NULL ), +}; + +static struct clk_lookup mci_clk_lookup[] = { +CLKDEV_INIT (NULL ,"mci_clk" ,NULL ), +}; + +static struct clk_lookup twi0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"twi0_clk" ,NULL ), +CLKDEV_INIT ("i2c-at91sam9g20.0" ,NULL ,NULL ), +}; + +static struct clk_lookup twi1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"twi1_clk" ,NULL ), +CLKDEV_INIT ("i2c-at91sam9g20.1" ,NULL ,NULL ), +}; + +static struct clk_lookup spi_clk_lookup[] = { +CLKDEV_INIT (NULL ,"spi_clk" ,NULL ), +}; + +static struct clk_lookup ssc0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ssc0_clk" ,NULL ), +CLKDEV_INIT ("at91rm9200_ssc.0" ,"pclk" ,NULL ), +}; + +static struct clk_lookup ssc1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ssc1_clk" ,NULL ), +CLKDEV_INIT ("at91rm9200_ssc.1" ,"pclk" ,NULL ), +}; + +static struct clk_lookup tc0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tc0_clk" ,NULL ), +CLKDEV_INIT ("atmel_tcb.0" ,"t0_clk" ,NULL ), +}; + +static struct clk_lookup tc1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tc1_clk" ,NULL ), +CLKDEV_INIT ("atmel_tcb.0" ,"t1_clk" ,NULL ), +}; + +static struct clk_lookup tc2_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tc2_clk" ,NULL ), +CLKDEV_INIT ("atmel_tcb.0" ,"t2_clk" ,NULL ), +}; + +static struct clk_lookup pwm_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pwm_clk" ,NULL ), +}; + +static struct clk_lookup tsc_clk_lookup[] = { +CLKDEV_INIT (NULL ,"tsc_clk" ,NULL ), +}; + +static struct clk_lookup dma_clk_lookup[] = { +CLKDEV_INIT (NULL ,"dma_clk" ,NULL ), +}; + +static struct clk_lookup udphs_clk_lookup[] = { +CLKDEV_INIT (NULL ,"udphs_clk" ,NULL ), +CLKDEV_INIT ("atmel_usba_udc" ,"pclk" ,NULL ), +}; + +static struct clk_lookup lcdc_clk_lookup[] = { +CLKDEV_INIT (NULL ,"lcdc_clk" ,NULL ), +CLKDEV_INIT ("at91sam9rl-lcdfb.0" ,"hclk" ,NULL ), +}; + +static struct clk_lookup ac97_clk_lookup[] = { +CLKDEV_INIT (NULL ,"ac97_clk" ,NULL ), +}; + +static size_t periph_clock_lookup_sizes[]__initdata = { +0 , +0 , +ARRAY_SIZE (pioA_clk_lookup), +ARRAY_SIZE (pioB_clk_lookup), +ARRAY_SIZE (pioC_clk_lookup), +ARRAY_SIZE (pioD_clk_lookup), +ARRAY_SIZE (usart0_clk_lookup), +ARRAY_SIZE (usart1_clk_lookup), +ARRAY_SIZE (usart2_clk_lookup), +ARRAY_SIZE (usart3_clk_lookup), +ARRAY_SIZE (mci_clk_lookup), +ARRAY_SIZE (twi0_clk_lookup), +ARRAY_SIZE (twi1_clk_lookup), +ARRAY_SIZE (spi_clk_lookup), +ARRAY_SIZE (ssc0_clk_lookup), +ARRAY_SIZE (ssc1_clk_lookup), +ARRAY_SIZE (tc0_clk_lookup), +ARRAY_SIZE (tc1_clk_lookup), +ARRAY_SIZE (tc2_clk_lookup), +ARRAY_SIZE (pwm_clk_lookup), +ARRAY_SIZE (tsc_clk_lookup), +ARRAY_SIZE (dma_clk_lookup), +ARRAY_SIZE (udphs_clk_lookup), +ARRAY_SIZE (lcdc_clk_lookup), +ARRAY_SIZE (ac97_clk_lookup), +}; + +static struct clk_lookup *periph_clock_lookups[]__initdata = { +NULL , +NULL , + pioA_clk_lookup, + pioB_clk_lookup, + pioC_clk_lookup, + pioD_clk_lookup, + usart0_clk_lookup, + usart1_clk_lookup, + usart2_clk_lookup, + usart3_clk_lookup, + mci_clk_lookup, + twi0_clk_lookup, + twi1_clk_lookup, + spi_clk_lookup, + ssc0_clk_lookup, + ssc1_clk_lookup, + tc0_clk_lookup, + tc1_clk_lookup, + tc2_clk_lookup, + pwm_clk_lookup, + tsc_clk_lookup, + dma_clk_lookup, + udphs_clk_lookup, + lcdc_clk_lookup, + ac97_clk_lookup, +}; + + +/* +* The system clocks. +*/ +static struct clk_lookup pck0_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck0" ,NULL ), +}; + +static struct clk_lookup pck1_clk_lookup[] = { +CLKDEV_INIT (NULL ,"pck1" ,NULL ), +}; + +static size_t system_clock_lookup_sizes[]__initdata = { +0 , +0 , +0 , +0 , +0 , +0 , +0 , +0 , +ARRAY_SIZE (pck0_clk_lookup), +ARRAY_SIZE (pck1_clk_lookup), +}; + +static struct clk_lookup *system_clock_lookups[]__initdata = { +NULL , +NULL , +NULL , +NULL , +NULL , +NULL , +NULL , +NULL , + pck0_clk_lookup, + pck1_clk_lookup, +}; + +static const char *system_clock_parent_names[]__initdata = { +NULL , +NULL , +NULL , +NULL , +NULL , +NULL , +NULL , +NULL , +"prog0" , +"prog1" , +}; + + +/* +* The pll clocks. +*/ +static struct clk_lookup pll_clk_lookup[] = { +CLKDEV_INIT (NULL ,"plla" ,NULL ), +}; + +static struct clk_range at91sam9rl_pll_output[] = { +CLK_RANGE (80000000 ,200000000 ), +CLK_RANGE (190000000 ,240000000 ), +}; +static u8 at91sam9rl_pll_out[] = {0 ,2 ,}; + +struct clk_pll_characteristics at91sam9rl_pll_characteristics = { + .input =CLK_RANGE (1000000 ,32000000 ), + .num_output =ARRAY_SIZE (at91sam9rl_pll_output), + .output = at91sam9rl_pll_output, + .out = at91sam9rl_pll_out, +}; + +/* -* The two programmable clocks. -* You must configure pin multiplexing to bring these signals out. +* The master clock. */ -static struct clk pck0 = { - .name ="pck0" , - .pmc_mask =AT91_PMC_PCK0 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =0 , +static struct clk_lookup mck_clk_lookup[] = { +CLKDEV_INIT (NULL ,"mck" ,NULL ), +CLKDEV_INIT ("atmel_usart.0" ,"usart" ,NULL ), +}; + +struct clk_master_characteristics at91sam9rl_master_characteristics = { + .output =CLK_RANGE (0 ,100000000 ), + .have_div3_pres =0 , + .divisors = {1 ,2 ,4 ,0 }, +}; + +static const char *master_prog_clock_parent_names[]__initdata = { +"clk32k" , +"main" , +"plla" , }; -static struct clk pck1 = { - .name ="pck1" , - .pmc_mask =AT91_PMC_PCK1 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =1 , + + +/* +* UTMI clock. +*/ +static struct clk_lookup utmi_clk_lookup[] = { +CLKDEV_INIT (NULL ,"utmi_clk" ,NULL ), +CLKDEV_INIT ("atmel_usba_udc" ,"hclk" ,NULL ), }; +static void __init at91sam9rl_register_clocks (void ) {int i; +int k; +size_t size; +struct clk *clk; +const char *name; +struct clk_lookup *lookup; + + clk =at91_clk_register_pll ("plla" ,"main" ,0 , + &at91rm9200_pll_layout, + &at91sam9rl_pll_characteristics); +for (i =0 ; i <ARRAY_SIZE (pll_clk_lookup); i++) + pll_clk_lookup[i].clk = clk; +clkdev_add_table (pll_clk_lookup,ARRAY_SIZE (pll_clk_lookup)); -for (i =0 ; i <ARRAY_SIZE (periph_clocks); i++) -clk_register (periph_clocks[i]); + clk =at91_clk_register_utmi ("utmi_clk" ,"main" ); +for (i =0 ; i <ARRAY_SIZE (utmi_clk_lookup); i++) + utmi_clk_lookup[i].clk = clk; +clkdev_add_table (utmi_clk_lookup,ARRAY_SIZE (utmi_clk_lookup)); -clkdev_add_table (periph_clocks_lookups, -ARRAY_SIZE (periph_clocks_lookups)); -clkdev_add_table (usart_clocks_lookups, -ARRAY_SIZE (usart_clocks_lookups)); + clk =at91_clk_register_master ("mck" , +ARRAY_SIZE (master_prog_clock_parent_names), + master_prog_clock_parent_names, + &at91rm9200_master_layout, + &at91sam9rl_master_characteristics); +for (i =0 ; i <ARRAY_SIZE (mck_clk_lookup); i++) + mck_clk_lookup[i].clk = clk; +clkdev_add_table (mck_clk_lookup,ARRAY_SIZE (mck_clk_lookup)); -clk_register (&pck0); -clk_register (&pck1); +for (i =0 ; i <ARRAY_SIZE (periph_clock_lookup_sizes); i++) { + size = periph_clock_lookup_sizes[i]; + lookup = periph_clock_lookups[i]; +if (!size || !lookup) +continue ; + name = periph_clock_lookups[i][0 ].con_id; +if (!name) +continue ; + clk =at91_clk_register_peripheral (name,"mck" , i); + +for (k =0 ; k < size; k++) + lookup[k].clk = clk; +clkdev_add_table (lookup, size); + } + +for (i =0 ; i <2 ; i++) { + name = system_clock_parent_names[8 + i]; + clk =at91_clk_register_programmable (name, + master_prog_clock_parent_names, +ARRAY_SIZE (master_prog_clock_parent_names), + i, &at91rm9200_programmable_layout); + } + +for (i =0 ; i <ARRAY_SIZE (system_clock_lookup_sizes); i++) { + size = system_clock_lookup_sizes[i]; + lookup = system_clock_lookups[i]; +if (!size || !lookup) +continue ; + name = system_clock_lookups[i][0 ].con_id; +if (!name || !system_clock_parent_names[i]) +continue ; + clk =at91_clk_register_system (name, + system_clock_parent_names[i], + i); +for (k =0 ; k < size; k++) + lookup[k].clk = clk; +clkdev_add_table (lookup, size); + } }/* --------------------------------------------------------------------
Signature · 1 line
1.7.9.5
RFC PATCH 20/50 ARM: at91: move at91sam9x5 SoCs to new at91 clk implem
In reply to Boris BREZILLONThis patch removes all references to the old at91 clks for at91sam9x5 SoCs. These SoCs only supports dt boards: we can remove register_clocks (all clocks are defined in dt).
--- arch/arm/mach-at91/at91sam9x5.c | 289 --------------------------------------- 1 file changed, 289 deletions(-)
arch/arm/mach-at91/at91sam9x5.c +0 -289
@@ -19,297 +19,9 @@#include "board.h" #include "soc.h" #include "generic.h" -#include "clock.h" #include "sam9_smc.h" /* -------------------------------------------------------------------- -* Clocks -* -------------------------------------------------------------------- */ - -/* -* The peripheral clocks. -*/ -static struct clk pioAB_clk = { - .name ="pioAB_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_PIOAB , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pioCD_clk = { - .name ="pioCD_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_PIOCD , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk smd_clk = { - .name ="smd_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_SMD , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart0_clk = { - .name ="usart0_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_USART0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart1_clk = { - .name ="usart1_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_USART1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk usart2_clk = { - .name ="usart2_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_USART2 , - .type =CLK_TYPE_PERIPHERAL , -}; -/* USART3 clock - Only for sam9g25/sam9x25 */ -static struct clk usart3_clk = { - .name ="usart3_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_USART3 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twi0_clk = { - .name ="twi0_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_TWI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twi1_clk = { - .name ="twi1_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_TWI1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk twi2_clk = { - .name ="twi2_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_TWI2 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk mmc0_clk = { - .name ="mci0_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_MCI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi0_clk = { - .name ="spi0_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_SPI0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk spi1_clk = { - .name ="spi1_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_SPI1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk uart0_clk = { - .name ="uart0_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_UART0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk uart1_clk = { - .name ="uart1_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_UART1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk tcb0_clk = { - .name ="tcb0_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_TCB , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk pwm_clk = { - .name ="pwm_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_PWM , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk adc_clk = { - .name ="adc_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_ADC , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk adc_op_clk = { - .name ="adc_op_clk" , - .type =CLK_TYPE_PERIPHERAL , - .rate_hz =5000000 , -}; -static struct clk dma0_clk = { - .name ="dma0_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_DMA0 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk dma1_clk = { - .name ="dma1_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_DMA1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk uhphs_clk = { - .name ="uhphs" , - .pmc_mask =1 <<AT91SAM9X5_ID_UHPHS , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk udphs_clk = { - .name ="udphs_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_UDPHS , - .type =CLK_TYPE_PERIPHERAL , -}; -/* emac0 clock - Only for sam9g25/sam9x25/sam9g35/sam9x35 */ -static struct clk macb0_clk = { - .name ="pclk" , - .pmc_mask =1 <<AT91SAM9X5_ID_EMAC0 , - .type =CLK_TYPE_PERIPHERAL , -}; -/* lcd clock - Only for sam9g15/sam9g35/sam9x35 */ -static struct clk lcdc_clk = { - .name ="lcdc_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_LCDC , - .type =CLK_TYPE_PERIPHERAL , -}; -/* isi clock - Only for sam9g25 */ -static struct clk isi_clk = { - .name ="isi_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_ISI , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk mmc1_clk = { - .name ="mci1_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_MCI1 , - .type =CLK_TYPE_PERIPHERAL , -}; -/* emac1 clock - Only for sam9x25 */ -static struct clk macb1_clk = { - .name ="pclk" , - .pmc_mask =1 <<AT91SAM9X5_ID_EMAC1 , - .type =CLK_TYPE_PERIPHERAL , -}; -static struct clk ssc_clk = { - .name ="ssc_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_SSC , - .type =CLK_TYPE_PERIPHERAL , -}; -/* can0 clock - Only for sam9x35 */ -static struct clk can0_clk = { - .name ="can0_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_CAN0 , - .type =CLK_TYPE_PERIPHERAL , -}; -/* can1 clock - Only for sam9x35 */ -static struct clk can1_clk = { - .name ="can1_clk" , - .pmc_mask =1 <<AT91SAM9X5_ID_CAN1 , - .type =CLK_TYPE_PERIPHERAL , -}; - -static struct clk *periph_clocks[]__initdata = { - &pioAB_clk, - &pioCD_clk, - &smd_clk, - &usart0_clk, - &usart1_clk, - &usart2_clk, - &twi0_clk, - &twi1_clk, - &twi2_clk, - &mmc0_clk, - &spi0_clk, - &spi1_clk, - &uart0_clk, - &uart1_clk, - &tcb0_clk, - &pwm_clk, - &adc_clk, - &adc_op_clk, - &dma0_clk, - &dma1_clk, - &uhphs_clk, - &udphs_clk, - &mmc1_clk, - &ssc_clk, -// irq0 -}; - -static struct clk_lookup periph_clocks_lookups[] = { -/* lookup table for DT entries */ -CLKDEV_CON_DEV_ID ("usart" ,"fffff200.serial" , &mck), -CLKDEV_CON_DEV_ID ("usart" ,"f801c000.serial" , &usart0_clk), -CLKDEV_CON_DEV_ID ("usart" ,"f8020000.serial" , &usart1_clk), -CLKDEV_CON_DEV_ID ("usart" ,"f8024000.serial" , &usart2_clk), -CLKDEV_CON_DEV_ID ("usart" ,"f8028000.serial" , &usart3_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"f8008000.timer" , &tcb0_clk), -CLKDEV_CON_DEV_ID ("t0_clk" ,"f800c000.timer" , &tcb0_clk), -CLKDEV_CON_DEV_ID ("mci_clk" ,"f0008000.mmc" , &mmc0_clk), -CLKDEV_CON_DEV_ID ("mci_clk" ,"f000c000.mmc" , &mmc1_clk), -CLKDEV_CON_DEV_ID ("dma_clk" ,"ffffec00.dma-controller" , &dma0_clk), -CLKDEV_CON_DEV_ID ("dma_clk" ,"ffffee00.dma-controller" , &dma1_clk), -CLKDEV_CON_DEV_ID ("pclk" ,"f0010000.ssc" , &ssc_clk), -CLKDEV_CON_DEV_ID (NULL ,"f8010000.i2c" , &twi0_clk), -CLKDEV_CON_DEV_ID (NULL ,"f8014000.i2c" , &twi1_clk), -CLKDEV_CON_DEV_ID (NULL ,"f8018000.i2c" , &twi2_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"f0000000.spi" , &spi0_clk), -CLKDEV_CON_DEV_ID ("spi_clk" ,"f0004000.spi" , &spi1_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff400.gpio" , &pioAB_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff600.gpio" , &pioAB_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffff800.gpio" , &pioCD_clk), -CLKDEV_CON_DEV_ID (NULL ,"fffffa00.gpio" , &pioCD_clk), -/* additional fake clock for macb_hclk */ -CLKDEV_CON_DEV_ID ("hclk" ,"f802c000.ethernet" , &macb0_clk), -CLKDEV_CON_DEV_ID ("hclk" ,"f8030000.ethernet" , &macb1_clk), -CLKDEV_CON_DEV_ID ("hclk" ,"600000.ohci" , &uhphs_clk), -CLKDEV_CON_DEV_ID ("ohci_clk" ,"600000.ohci" , &uhphs_clk), -CLKDEV_CON_DEV_ID ("ehci_clk" ,"700000.ehci" , &uhphs_clk), -}; - -/* -* The two programmable clocks. -* You must configure pin multiplexing to bring these signals out. -*/ -static struct clk pck0 = { - .name ="pck0" , - .pmc_mask =AT91_PMC_PCK0 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =0 , -}; -static struct clk pck1 = { - .name ="pck1" , - .pmc_mask =AT91_PMC_PCK1 , - .type =CLK_TYPE_PROGRAMMABLE , - .id =1 , -}; - -static void __init at91sam9x5_register_clocks (void ) -{ -int i; - -for (i =0 ; i <ARRAY_SIZE (periph_clocks); i++) -clk_register (periph_clocks[i]); - -clkdev_add_table (periph_clocks_lookups, -ARRAY_SIZE (periph_clocks_lookups)); - -if (cpu_is_at91sam9g25 () - ||cpu_is_at91sam9x25 ()) -clk_register (&usart3_clk); - -if (cpu_is_at91sam9g25 () - ||cpu_is_at91sam9x25 () - ||cpu_is_at91sam9g35 () - ||cpu_is_at91sam9x35 ()) -clk_register (&macb0_clk); - -if (cpu_is_at91sam9g15 () - ||cpu_is_at91sam9g35 () - ||cpu_is_at91sam9x35 ()) -clk_register (&lcdc_clk); - -if (cpu_is_at91sam9g25 ()) -clk_register (&isi_clk); - -if (cpu_is_at91sam9x25 ()) -clk_register (&macb1_clk); - -if (cpu_is_at91sam9x25 () - ||cpu_is_at91sam9x35 ()) { -clk_register (&can0_clk); -clk_register (&can1_clk); - } - -clk_register (&pck0); -clk_register (&pck1); -} - -/* -------------------------------------------------------------------- * AT91SAM9x5 processor initialization * -------------------------------------------------------------------- */
@@ -324,5 +36,4 @@ static void __init at91sam9x5_map_io(void)AT91_SOC_START (at91sam9x5) .map_io = at91sam9x5_map_io, - .register_clocks = at91sam9x5_register_clocks,AT91_SOC_END
Signature · 1 line
1.7.9.5
RFC PATCH 21/50 ARM: at91: move at91sam9 SoCs to new at91 clk implem
In reply to Boris BREZILLONMake use of common clk framework for all at91sam9 SoCs
--- arch/arm/mach-at91/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-at91/Kconfig +1 -0
@@ -32,6 +32,7 @@ config HAVE_AT91_SMD config SOC_AT91SAM9 bool + select COMMON_CLK select AT91_SAM9_TIME select CPU_ARM926T select GENERIC_CLOCKEVENTS
Signature · 1 line
1.7.9.5
RFC PATCH 22/50 ARM: at91: move sama5d3 SoCs to new at91 clk implem
In reply to Boris BREZILLONThis patch removes all references to the old at91 clks for sama5d3 SoCs. These SoCs only supports dt boards: we can remove register_clocks (all clocks are defined in dt).
--- arch/arm/mach-at91/Kconfig | 1 + arch/arm/mach-at91/sama5d3.c | 342 ------------------------------------------ 2 files changed, 1 insertion(+), 342 deletions(-)
arch/arm/mach-at91/Kconfig +1 -0
@@ -41,6 +41,7 @@ config SOC_AT91SAM9 config SOC_SAMA5 bool + select COMMON_CLK select AT91_SAM9_TIME select CPU_V7 select GENERIC_CLOCKEVENTS
arch/arm/mach-at91/sama5d3.c +0 -342
355 lines not on this page · raw message
Signature · 1 line
1.7.9.5
RFC PATCH 23/50 ARM: at91: move at91rm9200 boards to new at91 clk implem
In reply to Boris BREZILLONMove at91 clk init from early_init to timer_init for all at91rm9200 non dt boards.
--- arch/arm/mach-at91/board-1arm.c | 12 ++++++++++-- arch/arm/mach-at91/board-carmeva.c | 13 ++++++++----- arch/arm/mach-at91/board-cpuat91.c | 12 ++++++++++-- arch/arm/mach-at91/board-csb337.c | 11 +++++++---- arch/arm/mach-at91/board-csb637.c | 11 +++++++---- arch/arm/mach-at91/board-dt-rm9200.c | 9 ++++++++- arch/arm/mach-at91/board-eb9200.c | 11 +++++++---- arch/arm/mach-at91/board-ecbat91.c | 12 ++++++++++-- arch/arm/mach-at91/board-eco920.c | 13 +++++++++++-- arch/arm/mach-at91/board-kafa.c | 12 ++++++++++-- arch/arm/mach-at91/board-kb9202.c | 12 ++++++++++-- arch/arm/mach-at91/board-picotux200.c | 11 +++++++---- arch/arm/mach-at91/board-rm9200dk.c | 11 +++++++---- arch/arm/mach-at91/board-rm9200ek.c | 11 +++++++---- arch/arm/mach-at91/board-rsi-ews.c | 12 ++++++++---- arch/arm/mach-at91/board-yl-9200.c | 12 ++++++++++-- 16 files changed, 137 insertions(+), 48 deletions(-)
arch/arm/mach-at91/board-1arm.c +10 -2
@@ -46,8 +46,16 @@ static void __init onearm_init_early(void)/* Set cpu type: PQFP */ at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); +at91_initialize (); +} + +static void __init onearm_timer_init (void ) +{/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata onearm_eth_data = {
@@ -90,7 +98,7 @@ static void __init onearm_board_init(void)MACHINE_START (ONEARM ,"Ajeco 1ARM single board computer" )/* Maintainer: Lennert Buytenhek <[email protected]> */ - .init_time = at91rm9200_timer_init, + .init_time = onearm_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, .init_early = onearm_init_early,
arch/arm/mach-at91/board-carmeva.c +8 -5
@@ -41,10 +41,13 @@#include "generic.h" -static void __init carmeva_init_early (void ) +static void __init carmeva_timer_init (void ) { -/* Initialize processor: 20.000 MHz crystal */ -at91_initialize (20000000 ); +/* Initialize processor: 18.432 MHz crystal */ +at91_clk_init (20000000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata carmeva_eth_data = {
@@ -157,10 +160,10 @@ static void __init carmeva_board_init(void)MACHINE_START (CARMEVA ,"Carmeva" )/* Maintainer: Conitec Datasystems */ - .init_time = at91rm9200_timer_init, + .init_time = carmeva_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = carmeva_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = carmeva_board_init,MACHINE_END
arch/arm/mach-at91/board-cpuat91.c +10 -2
@@ -58,8 +58,16 @@ static void __init cpuat91_init_early(void)/* Set cpu type: PQFP */ at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); +at91_initialize (); +} + +static void __init cpuat91_timer_init (void ) +{/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata cpuat91_eth_data = {
@@ -178,7 +186,7 @@ static void __init cpuat91_board_init(void)MACHINE_START (CPUAT91 ,"Eukrea" )/* Maintainer: Eric Benard - EUKREA Electromatique */ - .init_time = at91rm9200_timer_init, + .init_time = cpuat91_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, .init_early = cpuat91_init_early,
arch/arm/mach-at91/board-csb337.c +7 -4
@@ -44,10 +44,13 @@#include "generic.h" -static void __init csb337_init_early (void ) +static void __init csb337_timer_init (void ) {/* Initialize processor: 3.6864 MHz crystal */ -at91_initialize (3686400 ); +at91_clk_init (3686400 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata csb337_eth_data = {
@@ -251,10 +254,10 @@ static void __init csb337_board_init(void)MACHINE_START (CSB337 ,"Cogent CSB337" )/* Maintainer: Bill Gatliff */ - .init_time = at91rm9200_timer_init, + .init_time = csb337_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = csb337_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = csb337_board_init,MACHINE_END
arch/arm/mach-at91/board-csb637.c +7 -4
@@ -41,10 +41,13 @@#include "generic.h" -static void __init csb637_init_early (void ) +static void __init csb637_timer_init (void ) {/* Initialize processor: 3.6864 MHz crystal */ -at91_initialize (3686400 ); +at91_clk_init (3686400 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata csb637_eth_data = {
@@ -132,10 +135,10 @@ static void __init csb637_board_init(void)MACHINE_START (CSB637 ,"Cogent CSB637" )/* Maintainer: Bill Gatliff */ - .init_time = at91rm9200_timer_init, + .init_time = csb637_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = csb637_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = csb637_board_init,MACHINE_END
arch/arm/mach-at91/board-dt-rm9200.c +8 -1
@@ -15,6 +15,7 @@#include <linux/of.h> #include <linux/of_irq.h> #include <linux/of_platform.h> +#include <linux/clk-provider.h> #include <asm/setup.h> #include <asm/irq.h>
@@ -26,6 +27,12 @@#include "generic.h" +static void __init at91rm9200_dt_timer_init (void ) +{ +of_clk_init (NULL ); +at91rm9200_timer_init (); +} +static const struct of_device_id irq_of_match[]__initconst = { { .compatible ="atmel,at91rm9200-aic" , .data = at91_aic_of_init }, {/*sentinel*/ }
@@ -47,7 +54,7 @@ static const char *at91rm9200_dt_board_compat[] __initdata = { };DT_MACHINE_START (at91rm9200_dt,"Atmel AT91RM9200 (Device Tree)" ) - .init_time = at91rm9200_timer_init, + .init_time = at91rm9200_dt_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, .init_early = at91rm9200_dt_initialize,
arch/arm/mach-at91/board-eb9200.c +7 -4
@@ -40,10 +40,13 @@#include "generic.h" -static void __init eb9200_init_early (void ) +static void __init eb9200_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata eb9200_eth_data = {
@@ -116,10 +119,10 @@ static void __init eb9200_board_init(void) }MACHINE_START (ATEB9200 ,"Embest ATEB9200" ) - .init_time = at91rm9200_timer_init, + .init_time = eb9200_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = eb9200_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = eb9200_board_init,MACHINE_END
arch/arm/mach-at91/board-ecbat91.c +10 -2
@@ -49,8 +49,16 @@ static void __init ecb_at91init_early(void)/* Set cpu type: PQFP */ at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); +at91_initialize (); +} + +static void __init ecbat91_timer_init (void ) +{/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata ecb_at91eth_data = {
@@ -181,7 +189,7 @@ static void __init ecb_at91board_init(void)MACHINE_START (ECBAT91 ,"emQbit's ECB_AT91" )/* Maintainer: emQbit.com */ - .init_time = at91rm9200_timer_init, + .init_time = ecbat91_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, .init_early = ecb_at91init_early,
arch/arm/mach-at91/board-eco920.c +11 -2
@@ -37,7 +37,16 @@ static void __init eco920_init_early(void)/* Set cpu type: PQFP */ at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); -at91_initialize (18432000 ); +at91_initialize (); +} + +static void __init eco920_timer_init (void ) +{ +/* Initialize processor: 18.432 MHz crystal */ +at91_clk_init (18432000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata eco920_eth_data = {
@@ -149,7 +158,7 @@ static void __init eco920_board_init(void)MACHINE_START (ECO920 ,"eco920" )/* Maintainer: Sascha Hauer */ - .init_time = at91rm9200_timer_init, + .init_time = eco920_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, .init_early = eco920_init_early,
arch/arm/mach-at91/board-kafa.c +10 -2
@@ -46,8 +46,16 @@ static void __init kafa_init_early(void)/* Set cpu type: PQFP */ at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); +at91_initialize (); +} + +static void __init kafa_timer_init (void ) +{/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata kafa_eth_data = {
@@ -103,7 +111,7 @@ static void __init kafa_board_init(void)MACHINE_START (KAFA ,"Sperry-Sun KAFA" )/* Maintainer: Sergei Sharonov */ - .init_time = at91rm9200_timer_init, + .init_time = kafa_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, .init_early = kafa_init_early,
arch/arm/mach-at91/board-kb9202.c +10 -2
@@ -49,8 +49,16 @@ static void __init kb9202_init_early(void)/* Set cpu type: PQFP */ at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); +at91_initialize (); +} + +static void __init kafa_timer_init (void ) +{/* Initialize processor: 10 MHz crystal */ -at91_initialize (10000000 ); +at91_clk_init (10000000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata kb9202_eth_data = {
@@ -149,7 +157,7 @@ static void __init kb9202_board_init(void)MACHINE_START (KB9200 ,"KB920x" )/* Maintainer: KwikByte, Inc. */ - .init_time = at91rm9200_timer_init, + .init_time = kafa_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, .init_early = kb9202_init_early,
arch/arm/mach-at91/board-picotux200.c +7 -4
@@ -45,10 +45,13 @@#include "generic.h" -static void __init picotux200_init_early (void ) +static void __init picotux200_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata picotux200_eth_data = {
@@ -119,10 +122,10 @@ static void __init picotux200_board_init(void)MACHINE_START (PICOTUX2XX ,"picotux 200" )/* Maintainer: Kleinhenz Elektronik GmbH */ - .init_time = at91rm9200_timer_init, + .init_time = picotux200_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = picotux200_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = picotux200_board_init,MACHINE_END
arch/arm/mach-at91/board-rm9200dk.c +7 -4
@@ -47,10 +47,13 @@#include "generic.h" -static void __init dk_init_early (void ) +static void __init dk_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata dk_eth_data = {
@@ -219,10 +222,10 @@ static void __init dk_board_init(void)MACHINE_START (AT91RM9200DK ,"Atmel AT91RM9200-DK" )/* Maintainer: SAN People/Atmel */ - .init_time = at91rm9200_timer_init, + .init_time = dk_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = dk_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = dk_board_init,MACHINE_END
arch/arm/mach-at91/board-rm9200ek.c +7 -4
@@ -47,10 +47,13 @@#include "generic.h" -static void __init ek_init_early (void ) +static void __init ek_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }static struct macb_platform_data __initdata ek_eth_data = {
@@ -186,10 +189,10 @@ static void __init ek_board_init(void)MACHINE_START (AT91RM9200EK ,"Atmel AT91RM9200-EK" )/* Maintainer: SAN People/Atmel */ - .init_time = at91rm9200_timer_init, + .init_time = ek_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = ek_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-rsi-ews.c +8 -4
@@ -32,10 +32,14 @@#include "board.h" #include "generic.h" -static void __init rsi_ews_init_early (void ) + +static void __init rsi_ews_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }/*
@@ -222,10 +226,10 @@ static void __init rsi_ews_board_init(void)MACHINE_START (RSI_EWS ,"RSI EWS" )/* Maintainer: Josef Holzmayr <[email protected]> */ - .init_time = at91rm9200_timer_init, + .init_time = rsi_ews_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = rsi_ews_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = rsi_ews_board_init,MACHINE_END
arch/arm/mach-at91/board-yl-9200.c +10 -2
@@ -57,8 +57,16 @@ static void __init yl9200_init_early(void)/* Set cpu type: PQFP */ at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); +at91_initialize (); +} + +static void __init yl9200_timer_init (void ) +{/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init rm9200 timer */ +at91rm9200_timer_init (); }/*
@@ -587,7 +595,7 @@ static void __init yl9200_board_init(void)MACHINE_START (YL9200 ,"uCdragon YL-9200" )/* Maintainer: S.Birtles */ - .init_time = at91rm9200_timer_init, + .init_time = yl9200_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, .init_early = yl9200_init_early,
Signature · 1 line
1.7.9.5
RFC PATCH 24/50 ARM: at91: move at91sam9 boards to new at91 clk implem
In reply to Boris BREZILLONMove at91 clk init from early_init to timer_init for all at91sam9 non dt boards.
--- arch/arm/mach-at91/board-afeb-9260v1.c | 11 +++++++---- arch/arm/mach-at91/board-cam60.c | 13 ++++++++----- arch/arm/mach-at91/board-cpu9krea.c | 12 ++++++++---- arch/arm/mach-at91/board-dt-sam9.c | 9 ++++++++- arch/arm/mach-at91/board-dt-sama5.c | 9 ++++++++- arch/arm/mach-at91/board-flexibity.c | 12 ++++++++---- arch/arm/mach-at91/board-foxg20.c | 12 +++++++----- arch/arm/mach-at91/board-gsia18s.c | 8 ++------ arch/arm/mach-at91/board-pcontrol-g20.c | 9 ++------- arch/arm/mach-at91/board-qil-a9260.c | 11 +++++++---- arch/arm/mach-at91/board-sam9-l9260.c | 11 +++++++---- arch/arm/mach-at91/board-sam9260ek.c | 11 +++++++---- arch/arm/mach-at91/board-sam9261ek.c | 15 +++++++++------ arch/arm/mach-at91/board-sam9263ek.c | 11 +++++++---- arch/arm/mach-at91/board-sam9g20ek.c | 15 +++++++++------ arch/arm/mach-at91/board-sam9m10g45ek.c | 11 +++++++---- arch/arm/mach-at91/board-sam9rlek.c | 11 +++++++---- arch/arm/mach-at91/board-snapper9260.c | 12 ++++++++---- arch/arm/mach-at91/board-stamp9g20.c | 15 +++++++++------ arch/arm/mach-at91/stamp9g20.h | 2 +- 20 files changed, 136 insertions(+), 84 deletions(-)
arch/arm/mach-at91/board-afeb-9260v1.c +7 -4
@@ -48,10 +48,13 @@#include "generic.h" -static void __init afeb9260_init_early (void ) +static void __init afeb9260_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -210,10 +213,10 @@ static void __init afeb9260_board_init(void)MACHINE_START (AFEB9260 ,"Custom afeb9260 board" )/* Maintainer: Sergey Lapin <[email protected]> */ - .init_time = at91sam926x_pit_init, + .init_time = afeb9260_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = afeb9260_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = afeb9260_board_init,MACHINE_END
arch/arm/mach-at91/board-cam60.c +8 -5
@@ -46,10 +46,13 @@#include "generic.h" -static void __init cam60_init_early (void ) +static void __init cam60_timer_init (void ) { -/* Initialize processor: 10 MHz crystal */ -at91_initialize (10000000 ); +/* Initialize processor: 18.432 MHz crystal */ +at91_clk_init (10000000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -187,10 +190,10 @@ static void __init cam60_board_init(void)MACHINE_START (CAM60 ,"KwikByte CAM60" )/* Maintainer: KwikByte */ - .init_time = at91sam926x_pit_init, + .init_time = cam60_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = cam60_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = cam60_board_init,MACHINE_END
arch/arm/mach-at91/board-cpu9krea.c +8 -4
@@ -49,10 +49,14 @@#include "sam9_smc.h" #include "generic.h" -static void __init cpu9krea_init_early (void ) + +static void __init cpu9krea_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -374,10 +378,10 @@ MACHINE_START(CPUAT9260, "Eukrea CPU9260")MACHINE_START (CPUAT9G20 ,"Eukrea CPU9G20" ) #endif/* Maintainer: Eric Benard - EUKREA Electromatique */ - .init_time = at91sam926x_pit_init, + .init_time = cpu9krea_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = cpu9krea_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = cpu9krea_board_init,MACHINE_END
arch/arm/mach-at91/board-dt-sam9.c +8 -1
@@ -14,6 +14,7 @@#include <linux/of.h> #include <linux/of_irq.h> #include <linux/of_platform.h> +#include <linux/clk-provider.h> #include <asm/setup.h> #include <asm/irq.h>
@@ -26,6 +27,12 @@#include "generic.h" +static void __init at91sam_dt_timer_init (void ) +{ +of_clk_init (NULL ); +at91sam926x_pit_init (); +} +static const struct of_device_id irq_of_match[]__initconst = { { .compatible ="atmel,at91rm9200-aic" , .data = at91_aic_of_init },
@@ -49,7 +56,7 @@ static const char *at91_dt_board_compat[] __initdata = {DT_MACHINE_START (at91sam_dt,"Atmel AT91SAM (Device Tree)" )/* Maintainer: Atmel */ - .init_time = at91sam926x_pit_init, + .init_time = at91sam_dt_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, .init_early = at91_dt_initialize,
arch/arm/mach-at91/board-dt-sama5.c +8 -1
@@ -16,6 +16,7 @@#include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/phy.h> +#include <linux/clk-provider.h> #include <asm/setup.h> #include <asm/irq.h>
@@ -27,6 +28,12 @@#include "generic.h" +static void __init at91sama5_dt_timer_init (void ) +{ +of_clk_init (NULL ); +at91sam926x_pit_init (); +} +static const struct of_device_id irq_of_match[]__initconst = { { .compatible ="atmel,sama5d3-aic" , .data = at91_aic5_of_init },
@@ -76,7 +83,7 @@ static const char *sama5_dt_board_compat[] __initdata = {DT_MACHINE_START (sama5_dt,"Atmel SAMA5 (Device Tree)" )/* Maintainer: Atmel */ - .init_time = at91sam926x_pit_init, + .init_time = at91sama5_dt_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic5_handle_irq, .init_early = at91_dt_initialize,
arch/arm/mach-at91/board-flexibity.c +8 -4
@@ -38,10 +38,14 @@#include "board.h" #include "generic.h" -static void __init flexibity_init_early (void ) + +static void __init flexibity_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/* USB Host port */
@@ -159,10 +163,10 @@ static void __init flexibity_board_init(void)MACHINE_START (FLEXIBITY ,"Flexibity Connect" )/* Maintainer: Maxim Osipov */ - .init_time = at91sam926x_pit_init, + .init_time = flexibity_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = flexibity_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = flexibity_board_init,MACHINE_END
arch/arm/mach-at91/board-foxg20.c +7 -5
@@ -57,11 +57,13 @@* For more info visit: http://www.acmesystems.it/foxg20 */ - -static void __init foxg20_init_early (void ) +static void __init foxg20_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -262,10 +264,10 @@ static void __init foxg20_board_init(void)MACHINE_START (ACMENETUSFOXG20 ,"Acme Systems srl FOX Board G20" )/* Maintainer: Sergio Tanzilli */ - .init_time = at91sam926x_pit_init, + .init_time = foxg20_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = foxg20_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = foxg20_board_init,MACHINE_END
arch/arm/mach-at91/board-gsia18s.c +2 -6
@@ -39,10 +39,6 @@#include "gsia18s.h" #include "stamp9g20.h" -static void __init gsia18s_init_early (void ) -{ -stamp9g20_init_early (); -}/* * Two USB Host ports
@@ -574,10 +570,10 @@ static void __init gsia18s_board_init(void) }MACHINE_START (GSIA18S ,"GS_IA18_S" ) - .init_time = at91sam926x_pit_init, + .init_time = stamp9g20_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = gsia18s_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = gsia18s_board_init,MACHINE_END
arch/arm/mach-at91/board-pcontrol-g20.c +2 -7
@@ -38,11 +38,6 @@#include "stamp9g20.h" -static void __init pcontrol_g20_init_early (void ) -{ -stamp9g20_init_early (); -} -static struct sam9_smc_config __initdata pcontrol_smc_config[2 ] = { { .ncs_read_setup =16 , .nrd_setup =18 ,
@@ -217,10 +212,10 @@ static void __init pcontrol_g20_board_init(void)MACHINE_START (PCONTROL_G20 ,"PControl G20" )/* Maintainer: pgsellmann at portner-elektronik.at */ - .init_time = at91sam926x_pit_init, + .init_time = stamp9g20_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = pcontrol_g20_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = pcontrol_g20_board_init,MACHINE_END
arch/arm/mach-at91/board-qil-a9260.c +7 -4
@@ -49,10 +49,13 @@#include "generic.h" -static void __init ek_init_early (void ) +static void __init ek_timer_init (void ) {/* Initialize processor: 12.000 MHz crystal */ -at91_initialize (12000000 ); +at91_clk_init (12000000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -257,10 +260,10 @@ static void __init ek_board_init(void)MACHINE_START (QIL_A9260 ,"CALAO QIL_A9260" )/* Maintainer: calao-systems */ - .init_time = at91sam926x_pit_init, + .init_time = ek_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = ek_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9-l9260.c +7 -4
@@ -45,10 +45,13 @@#include "generic.h" -static void __init ek_init_early (void ) +static void __init ek_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -218,10 +221,10 @@ static void __init ek_board_init(void)MACHINE_START (SAM9_L9260 ,"Olimex SAM9-L9260" )/* Maintainer: Olimex */ - .init_time = at91sam926x_pit_init, + .init_time = ek_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = ek_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9260ek.c +7 -4
@@ -51,10 +51,13 @@#include "generic.h" -static void __init ek_init_early (void ) +static void __init ek_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -343,10 +346,10 @@ static void __init ek_board_init(void)MACHINE_START (AT91SAM9260EK ,"Atmel AT91SAM9260-EK" )/* Maintainer: Atmel */ - .init_time = at91sam926x_pit_init, + .init_time = ek_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = ek_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9261ek.c +9 -6
@@ -55,10 +55,13 @@#include "generic.h" -static void __init ek_init_early (void ) +static void __init ek_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -602,20 +605,20 @@ static void __init ek_board_init(void)MACHINE_START (AT91SAM9261EK ,"Atmel AT91SAM9261-EK" )/* Maintainer: Atmel */ - .init_time = at91sam926x_pit_init, + .init_time = ek_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = ek_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = ek_board_init, MACHINE_ENDMACHINE_START (AT91SAM9G10EK ,"Atmel AT91SAM9G10-EK" )/* Maintainer: Atmel */ - .init_time = at91sam926x_pit_init, + .init_time = ek_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = ek_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9263ek.c +7 -4
@@ -54,10 +54,13 @@#include "generic.h" -static void __init ek_init_early (void ) +static void __init ek_timer_init (void ) {/* Initialize processor: 16.367 MHz crystal */ -at91_initialize (16367660 ); +at91_clk_init (16367660 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -443,10 +446,10 @@ static void __init ek_board_init(void)MACHINE_START (AT91SAM9263EK ,"Atmel AT91SAM9263-EK" )/* Maintainer: Atmel */ - .init_time = at91sam926x_pit_init, + .init_time = ek_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = ek_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9g20ek.c +9 -6
@@ -64,10 +64,13 @@ static int inline ek_have_2mmc(void) } -static void __init ek_init_early (void ) +static void __init ek_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -409,20 +412,20 @@ static void __init ek_board_init(void)MACHINE_START (AT91SAM9G20EK ,"Atmel AT91SAM9G20-EK" )/* Maintainer: Atmel */ - .init_time = at91sam926x_pit_init, + .init_time = ek_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = ek_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = ek_board_init, MACHINE_ENDMACHINE_START (AT91SAM9G20EK_2MMC ,"Atmel AT91SAM9G20-EK 2 MMC Slot Mod" )/* Maintainer: Atmel */ - .init_time = at91sam926x_pit_init, + .init_time = ek_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = ek_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9m10g45ek.c +7 -4
@@ -52,10 +52,13 @@#include "generic.h" -static void __init ek_init_early (void ) +static void __init ek_timer_init (void ) {/* Initialize processor: 12.000 MHz crystal */ -at91_initialize (12000000 ); +at91_clk_init (12000000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -502,10 +505,10 @@ static void __init ek_board_init(void)MACHINE_START (AT91SAM9M10G45EK ,"Atmel AT91SAM9M10G45-EK" )/* Maintainer: Atmel */ - .init_time = at91sam926x_pit_init, + .init_time = ek_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = ek_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9rlek.c +7 -4
@@ -40,10 +40,13 @@#include "generic.h" -static void __init ek_init_early (void ) +static void __init ek_timer_init (void ) {/* Initialize processor: 12.000 MHz crystal */ -at91_initialize (12000000 ); +at91_clk_init (12000000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -320,10 +323,10 @@ static void __init ek_board_init(void)MACHINE_START (AT91SAM9RLEK ,"Atmel AT91SAM9RL-EK" )/* Maintainer: Atmel */ - .init_time = at91sam926x_pit_init, + .init_time = ek_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = ek_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-snapper9260.c +8 -4
@@ -41,9 +41,13 @@#define SNAPPER9260_IO_EXP_GPIO (x) (NR_BUILTIN_GPIO + (x)) -static void __init snapper9260_init_early (void ) +static void __init snapper9260_timer_init (void ) { -at91_initialize (18432000 ); +/* Initialize processor: 18.432 MHz crystal */ +at91_clk_init (18432000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }static struct at91_usbh_data __initdata snapper9260_usbh_data = {
@@ -177,10 +181,10 @@ static void __init snapper9260_board_init(void) }MACHINE_START (SNAPPER_9260 ,"Bluewater Systems Snapper 9260/9G20 module" ) - .init_time = at91sam926x_pit_init, + .init_time = snapper9260_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = snapper9260_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = snapper9260_board_init,MACHINE_END
arch/arm/mach-at91/board-stamp9g20.c +9 -6
@@ -33,10 +33,13 @@#include "generic.h" -void __init stamp9g20_init_early (void ) +void __init stamp9g20_timer_init (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91_initialize (18432000 ); +at91_clk_init (18432000 ); + +/* Init sam9 PIT timer */ +at91sam926x_pit_init (); }/*
@@ -273,20 +276,20 @@ static void __init stamp9g20evb_board_init(void)MACHINE_START (PORTUXG20 ,"taskit PortuxG20" )/* Maintainer: taskit GmbH */ - .init_time = at91sam926x_pit_init, + .init_time = stamp9g20_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = stamp9g20_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = portuxg20_board_init, MACHINE_ENDMACHINE_START (STAMP9G20 ,"taskit Stamp9G20" )/* Maintainer: taskit GmbH */ - .init_time = at91sam926x_pit_init, + .init_time = stamp9g20_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, - .init_early = stamp9g20_init_early, + .init_early = at91_initialize, .init_irq = at91_init_irq_default, .init_machine = stamp9g20evb_board_init,MACHINE_END
arch/arm/mach-at91/stamp9g20.h +1 -1
@@ -1,7 +1,7 @@#ifndef __MACH_STAMP9G20_H#define __MACH_STAMP9G20_H -void stamp9g20_init_early (void ); +void stamp9g20_timer_init (void );void stamp9g20_board_init (void );#endif
Signature · 1 line
1.7.9.5
RFC PATCH 25/50 ARM: at91: move pit timer to common clk framework
In reply to Boris BREZILLONUse device tree to get the source clock of the PIT (Periodic Interval Timer). If the clock is not found in device tree (or dt is not enabled) we'll try to get it using clk_lookup definitions.
--- arch/arm/mach-at91/at91sam926x_time.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
arch/arm/mach-at91/at91sam926x_time.c +19 -2
@@ -39,6 +39,7 @@static u32 pit_cycle;/* write-once */ static u32 pit_cnt;/* access only w/system irq blocked */ static void __iomem *pit_base_addr__read_mostly ; +static struct clk *mck;static inline unsigned int pit_read (unsigned int reg_offset) {
@@ -186,6 +187,7 @@ static int __init of_at91sam926x_pit_init(void) {struct device_node *np;int ret; +int err = -EINVAL ; np =of_find_matching_node (NULL , pit_timer_ids);if (!np)
@@ -195,10 +197,19 @@ static int __init of_at91sam926x_pit_init(void)if (!pit_base_addr) goto node_err; + mck =of_clk_get (np,0 ); +if (IS_ERR (mck)) { + err =PTR_RET (mck); + mck =NULL ; +pr_crit ("AT91: PIT: Unable to get mck clk from DT\n" ); + goto ioremap_err; + } +/* Get the interrupts property */ ret =irq_of_parse_and_map (np,0 );if (!ret) {pr_crit ("AT91: PIT: Unable to get IRQ from DT\n" ); +clk_put (mck); goto ioremap_err; } at91sam926x_pit_irq.irq = ret;
@@ -212,7 +223,7 @@ ioremap_err: node_err:of_node_put (np); err: - return -EINVAL; + return err; }#else static int __init of_at91sam926x_pit_init (void )
@@ -237,7 +248,13 @@ void __init at91sam926x_pit_init(void)* Use our actual MCK to figure out how many MCK/16 ticks per * 1/HZ period (instead of a compile-time constant LATCH). */ - pit_rate =clk_get_rate (clk_get (NULL ,"mck" )) /16 ; +if (!mck) + mck =clk_get (NULL ,"mck" ); + +if (IS_ERR (mck)) +panic ("AT91: PIT: Unable to get mck clk\n" ); + pit_rate =clk_get_rate (mck) /16 ; +pr_notice ("AT91: PIT: mck rate = %lu\n" , pit_rate); pit_cycle = (pit_rate +HZ /2 ) /HZ ;WARN_ON (((pit_cycle -1 ) & ~AT91_PIT_PIV ) !=0 );
Signature · 1 line
1.7.9.5
RFC PATCH 26/50 ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare.
In reply to Boris BREZILLONReplace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
--- drivers/clocksource/tcb_clksrc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/clocksource/tcb_clksrc.c +5 -5
@@ -100,7 +100,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d) || tcd->clkevt.mode == CLOCK_EVT_MODE_ONESHOT) {__raw_writel (0xff , regs +ATMEL_TC_REG (2 ,IDR ));__raw_writel (ATMEL_TC_CLKDIS , regs +ATMEL_TC_REG (2 ,CCR )); -clk_disable (tcd->clk); +clk_disable_unprepare (tcd->clk); }switch (m) {
@@ -109,7 +109,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)* of oneshot, we get lower overhead and improved accuracy. */ case CLOCK_EVT_MODE_PERIODIC : -clk_enable (tcd->clk); +clk_prepare_enable (tcd->clk);/* slow clock, count up to RC, then irq and restart */ __raw_writel(timer_clock
@@ -126,7 +126,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)break ;case CLOCK_EVT_MODE_ONESHOT : -clk_enable (tcd->clk); +clk_prepare_enable (tcd->clk);/* slow clock, count up to RC, then irq and stop */ __raw_writel(timer_clock | ATMEL_TC_CPCSTOP
@@ -275,7 +275,7 @@ static int __init tcb_clksrc_init(void) pdev = tc->pdev; t0_clk = tc->clk[0 ]; -clk_enable (t0_clk); +clk_prepare_enable (t0_clk);/* How fast will we be counting? Pick something over 5 MHz. */ rate = (u32 )clk_get_rate (t0_clk);
@@ -313,7 +313,7 @@ static int __init tcb_clksrc_init(void)/* tclib will give us three clocks no matter what the * underlying platform supports. */ -clk_enable (tc->clk[1 ]); +clk_prepare_enable (tc->clk[1 ]);/* setup both channel 0 & 1 */ tcb_setup_dual_chan (tc, best_divisor_idx); }
Signature · 1 line
1.7.9.5
RFC PATCH 27/50 at_hdmac: prepare clk before calling enable
In reply to Boris BREZILLONReplace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
--- drivers/dma/at_hdmac.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/dma/at_hdmac.c +6 -6
@@ -1374,7 +1374,7 @@ static int __init at_dma_probe(struct platform_device *pdev) err =PTR_ERR (atdma->clk); goto err_clk; } -clk_enable (atdma->clk); +clk_prepare_enable (atdma->clk);/* force dma off, just in case */ at_dma_off (atdma);
@@ -1475,7 +1475,7 @@ err_pool_create:platform_set_drvdata (pdev,NULL );free_irq (platform_get_irq (pdev,0 ), atdma); err_irq: -clk_disable (atdma->clk); +clk_disable_unprepare (atdma->clk);clk_put (atdma->clk); err_clk:iounmap (atdma->regs);
@@ -1512,7 +1512,7 @@ static int at_dma_remove(struct platform_device *pdev)list_del (&chan->device_node); } -clk_disable (atdma->clk); +clk_disable_unprepare (atdma->clk);clk_put (atdma->clk);iounmap (atdma->regs);
@@ -1531,7 +1531,7 @@ static void at_dma_shutdown(struct platform_device *pdev)struct at_dma *atdma =platform_get_drvdata (pdev);at_dma_off (platform_get_drvdata (pdev)); -clk_disable (atdma->clk); +clk_disable_unprepare (atdma->clk); }static int at_dma_prepare (struct device *dev)
@@ -1588,7 +1588,7 @@ static int at_dma_suspend_noirq(struct device *dev)/* disable DMA controller */ at_dma_off (atdma); -clk_disable (atdma->clk); +clk_disable_unprepare (atdma->clk);return 0 ; }
@@ -1618,7 +1618,7 @@ static int at_dma_resume_noirq(struct device *dev)struct dma_chan *chan, *_chan;/* bring back DMA controller */ -clk_enable (atdma->clk); +clk_prepare_enable (atdma->clk);dma_writel (atdma,EN ,AT_DMA_ENABLE );/* clear any pending interrupt */
Signature · 1 line
1.7.9.5
Re: [RFC PATCH 27/50] at_hdmac: prepare clk before calling enable
Quoted 13 lines · Boris BREZILLON
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
Signed-off-by Boris BREZILLON <[email protected]>--- drivers/dma/at_hdmac.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/dma/at_hdmac.c +0
-0
drivers/dma/at_hdmac.c static int __init at_dma_probe(struct platform_device *pdev) · line 1377
Quoted 5 lines
drivers/dma/at_hdmac.c +1
-1@@ -1374,7 +1374,7 @@ static int __init at_dma_probe(struct platform_device *pdev) err =PTR_ERR (atdma->clk); goto err_clk; } -clk_enable (atdma->clk); +clk_prepare_enable (atdma->clk);
Can you add checks for return value in the driver as well
Quoted 40 lines
drivers/dma/at_hdmac.c +4
-4/* force dma off, just in case */ at_dma_off (atdma);@@ -1475,7 +1475,7 @@ err_pool_create:platform_set_drvdata (pdev,NULL );free_irq (platform_get_irq (pdev,0 ), atdma); err_irq: -clk_disable (atdma->clk); +clk_disable_unprepare (atdma->clk);clk_put (atdma->clk); err_clk:iounmap (atdma->regs);@@ -1512,7 +1512,7 @@ static int at_dma_remove(struct platform_device *pdev)list_del (&chan->device_node); } -clk_disable (atdma->clk); +clk_disable_unprepare (atdma->clk);clk_put (atdma->clk);iounmap (atdma->regs);@@ -1531,7 +1531,7 @@ static void at_dma_shutdown(struct platform_device *pdev)struct at_dma *atdma =platform_get_drvdata (pdev);at_dma_off (platform_get_drvdata (pdev)); -clk_disable (atdma->clk); +clk_disable_unprepare (atdma->clk); }static int at_dma_prepare (struct device *dev)@@ -1588,7 +1588,7 @@ static int at_dma_suspend_noirq(struct device *dev)/* disable DMA controller */ at_dma_off (atdma); -clk_disable (atdma->clk); +clk_disable_unprepare (atdma->clk);return 0 ; }
drivers/dma/at_hdmac.c static int at_dma_resume_noirq(struct device *dev) · line 1624
Quoted 8 lines
drivers/dma/at_hdmac.c +1
-1@@ -1618,7 +1618,7 @@ static int at_dma_resume_noirq(struct device *dev)struct dma_chan *chan, *_chan;/* bring back DMA controller */ -clk_enable (atdma->clk); +clk_prepare_enable (atdma->clk);dma_writel (atdma,EN ,AT_DMA_ENABLE );/* clear any pending interrupt */
--
~Vinod
Re: [RFC PATCH 27/50] at_hdmac: prepare clk before calling enable
Quoted 9 lines · Vinod Koul
Quoted 8 lines · Boris BREZILLON
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
Signed-off-by Boris BREZILLON <[email protected]>--- drivers/dma/at_hdmac.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Quoted 11 lines
drivers/dma/at_hdmac.c static int __init at_dma_probe(struct platform_device *pdev) · line 1377
Quoted 10 lines
drivers/dma/at_hdmac.c +1
-1@@ -1374,7 +1374,7 @@ static int __init at_dma_probe(struct platform_device *pdev) err =PTR_ERR (atdma->clk); goto err_clk; } -clk_enable (atdma->clk); +clk_prepare_enable (atdma->clk);Can you add checks for return value in the driver as well
Sure. I'll add it in the next version.
Quoted 50 lines
Quoted 40 lines
drivers/dma/at_hdmac.c +4
-4/* force dma off, just in case */ at_dma_off (atdma);@@ -1475,7 +1475,7 @@ err_pool_create:platform_set_drvdata (pdev,NULL );free_irq (platform_get_irq (pdev,0 ), atdma); err_irq: -clk_disable (atdma->clk); +clk_disable_unprepare (atdma->clk);clk_put (atdma->clk); err_clk:iounmap (atdma->regs);@@ -1512,7 +1512,7 @@ static int at_dma_remove(struct platform_device *pdev)list_del (&chan->device_node); } -clk_disable (atdma->clk); +clk_disable_unprepare (atdma->clk);clk_put (atdma->clk);iounmap (atdma->regs);@@ -1531,7 +1531,7 @@ static void at_dma_shutdown(struct platform_device *pdev)struct at_dma *atdma =platform_get_drvdata (pdev);at_dma_off (platform_get_drvdata (pdev)); -clk_disable (atdma->clk); +clk_disable_unprepare (atdma->clk); }static int at_dma_prepare (struct device *dev)@@ -1588,7 +1588,7 @@ static int at_dma_suspend_noirq(struct device *dev)/* disable DMA controller */ at_dma_off (atdma); -clk_disable (atdma->clk); +clk_disable_unprepare (atdma->clk);return 0 ; }drivers/dma/at_hdmac.c static int at_dma_resume_noirq(struct device *dev) · line 1624
Quoted 8 lines
drivers/dma/at_hdmac.c +1
-1@@ -1618,7 +1618,7 @@ static int at_dma_resume_noirq(struct device *dev)struct dma_chan *chan, *_chan;/* bring back DMA controller */ -clk_enable (atdma->clk); +clk_prepare_enable (atdma->clk);dma_writel (atdma,EN ,AT_DMA_ENABLE );/* clear any pending interrupt */ --
~Vinod
RFC PATCH 28/50 ASoC: atmel-ssc: prepare clk before calling enable
In reply to Boris BREZILLONReplace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
--- drivers/misc/atmel-ssc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/misc/atmel-ssc.c +4 -4
@@ -58,7 +58,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num) ssc->user++;spin_unlock (&user_lock); -clk_enable (ssc->clk); +clk_prepare_enable (ssc->clk);return ssc; }
@@ -69,7 +69,7 @@ void ssc_free(struct ssc_device *ssc)spin_lock (&user_lock);if (ssc->user) { ssc->user--; -clk_disable (ssc->clk); +clk_disable_unprepare (ssc->clk); }else {dev_dbg (&ssc->pdev->dev,"device already free\n" ); }
@@ -172,10 +172,10 @@ static int ssc_probe(struct platform_device *pdev) }/* disable all interrupts */ -clk_enable (ssc->clk); +clk_prepare_enable (ssc->clk);ssc_writel (ssc->regs,IDR ,-1 );ssc_readl (ssc->regs,SR ); -clk_disable (ssc->clk); +clk_disable_unprepare (ssc->clk); ssc->irq =platform_get_irq (pdev,0 );if (!ssc->irq) {
Signature · 1 line
1.7.9.5
Re: [RFC PATCH 28/50] ASoC: atmel-ssc: prepare clk before calling enable
Quoted 2 lines · Boris BREZILLON
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
Applied since I happened to notice this on he list but you should
*always* CC maintainers on patches otherwise they're likely to get
missed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130607/5e116406/attachment-0001.sig>
Re: [RFC PATCH 28/50] ASoC: atmel-ssc: prepare clk before calling enable
Quoted 8 lines · Mark Brown
Quoted 2 lines · Boris BREZILLON
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
Applied since I happened to notice this on he list but you should *always* CC maintainers on patches otherwise they're likely to get missed.
I used get_mainainer script and it returns:
Arnd Bergmann <[email protected]> (supporter:CHAR and MISC DRI...) Greg Kroah-Hartman <[email protected]> (supporter:CHAR and MISC DRI...)
linux-kernel at vger.kernel.org (open list)
Please tell me if misuse this script or if I should use something else.
Best regards,
Boris
Quoted 7 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [RFC PATCH 28/50] ASoC: atmel-ssc: prepare clk before calling enable
Quoted 9 lines · Boris BREZILLON
Quoted 7 lines · Mark Brown
Quoted 2 lines · Boris BREZILLON
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
Applied since I happened to notice this on he list but you should *always* CC maintainers on patches otherwise they're likely to get missed.
Quoted 8 lines
I used
get_mainainerscript and it returns:Arnd Bergmann <[email protected]> (supporter:CHAR and MISC DRI...) Greg Kroah-Hartman <[email protected]> (supporter:CHAR and MISC DRI...)
linux-kernel at vger.kernel.org (open list)Please tell me if misuse this script or if I should use something else.
I suspect you only ran this on some of the patches as that's missing
pretty much all of the subsystem maintainers, but in general you always
have to think about the output of get_maintainer.pl - it isn't terribly
reliable.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130610/4298c9b7/attachment.sig>
Re: [RFC PATCH 28/50] ASoC: atmel-ssc: prepare clk before calling enable
Quoted 14 lines · Mark Brown
Quoted 7 lines · Boris BREZILLON
Quoted 6 lines · Mark Brown
Quoted 2 lines · Boris BREZILLON
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
Applied since I happened to notice this on he list but you should *always* CC maintainers on patches otherwise they're likely to get missed.
Quoted 6 lines
I used
get_mainainerscript and it returns:
Arnd Bergmann <[email protected]> (supporter:CHAR and MISC DRI...) Greg Kroah-Hartman <[email protected]> (supporter:CHAR and MISC DRI...)
linux-kernel at vger.kernel.org (open list)
Please tell me if misuse this script or if I should use something else.
Quoted 4 lines
I suspect you only ran this on some of the patches as that's missing pretty much all of the subsystem maintainers, but in general you always have to think about the output of get_maintainer.pl - it isn't terribly reliable.
I use a script to add "cc" and "to" fields to each patch:
to.sh:
#!/bin/bash
opts="--nogit --nogit-fallback --norolestats --pattern-depth=1"
if [[ $(basename $1) =~ ^0000- ]] ; then
./scripts/get_maintainer.pl --nom $opts $(dirname $1)/*
else
maint=$(./scripts/get_maintainer.pl --nol $opts $1)
if [ "$maint" == "" ] ; then
echo "[hidden email]"
else
echo "$maint"
fifi
cc.sh:
#!/bin/bash
opts="--nogit --nogit-fallback --norolestats"
if [[ $(basename $1) =~ ^0000- ]] ; then
./scripts/get_maintainer.pl --nom $opts $(dirname $1)/*
else
./scripts/get_maintainer.pl $opts $1
fi
But I guess it does not handle subsystem maintainers.
I'll check it before sending patch series next time.
BTW thanks for applying this patch.
Best Regards,
Boris
RFC PATCH 29/50 mmc: atmel-mci: prepare clk before calling enable
In reply to Boris BREZILLONReplace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
--- drivers/mmc/host/atmel-mci.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/mmc/host/atmel-mci.c +13 -3
@@ -380,6 +380,8 @@ static int atmci_regs_show(struct seq_file *s, void *v) {struct atmel_mci *host = s->private;u32 *buf; +int ret; + buf =kmalloc (ATMCI_REGS_SIZE ,GFP_KERNEL );if (!buf)
@@ -391,7 +393,11 @@ static int atmci_regs_show(struct seq_file *s, void *v)* consistent. */ spin_lock_bh (&host->lock); -clk_enable (host->mck); + ret =clk_enable (host->mck); +if (ret) { +kfree (buf); +return ret; + }memcpy_fromio (buf, host->regs,ATMCI_REGS_SIZE );clk_disable (host->mck);spin_unlock_bh (&host->lock);
@@ -2379,7 +2385,9 @@ static int __init atmci_probe(struct platform_device *pdev)if (!host->regs) goto err_ioremap; -clk_enable (host->mck); + ret =clk_prepare_enable (host->mck); +if (ret) + goto err_clk_prepare_enable;atmci_writel (host,ATMCI_CR ,ATMCI_CR_SWRST ); host->bus_hz =clk_get_rate (host->mck);clk_disable (host->mck);
@@ -2463,6 +2471,8 @@ err_init_slot:dma_release_channel (host->dma.chan);free_irq (irq, host); err_request_irq: +clk_unprepare (host->mck); +err_clk_prepare_enable:iounmap (host->regs); err_ioremap:clk_put (host->mck);
@@ -2491,7 +2501,7 @@ static int __exit atmci_remove(struct platform_device *pdev)atmci_writel (host,ATMCI_IDR , ~0UL );atmci_writel (host,ATMCI_CR ,ATMCI_CR_MCIDIS );atmci_readl (host,ATMCI_SR ); -clk_disable (host->mck); +clk_disable_unprepare (host->mck);if (host->dma.chan)dma_release_channel (host->dma.chan);
Signature · 1 line
1.7.9.5
RFC PATCH 30/50 pwm: atmel-tcb: prepare clk before calling enable
In reply to Boris BREZILLONReplace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
--- drivers/pwm/pwm-atmel-tcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pwm/pwm-atmel-tcb.c +2 -2
@@ -76,7 +76,7 @@ static int atmel_tcb_pwm_request(struct pwm_chip *chip,if (!tcbpwm)return -ENOMEM ; - ret =clk_enable (tc->clk[group]); + ret =clk_prepare_enable (tc->clk[group]);if (ret) {devm_kfree (chip->dev, tcbpwm);return ret;
@@ -124,7 +124,7 @@ static void atmel_tcb_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)struct atmel_tcb_pwm_device *tcbpwm =pwm_get_chip_data (pwm);struct atmel_tc *tc = tcbpwmc->tc; -clk_disable (tc->clk[pwm->hwpwm /2 ]); +clk_disable_unprepare (tc->clk[pwm->hwpwm /2 ]); tcbpwmc->pwms[pwm->hwpwm] =NULL ;devm_kfree (chip->dev, tcbpwm); }
Signature · 1 line
1.7.9.5
Thierry Reding
AppliedRe: [RFC PATCH 30/50] pwm: atmel-tcb: prepare clk before calling enable
Quoted 7 lines · Boris BREZILLON
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
Signed-off-by Boris BREZILLON <[email protected]>--- drivers/pwm/pwm-atmel-tcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130612/ec99b2b3/attachment.sig>
RFC PATCH 31/50 tty: atmel_serial: prepare clk before calling enable
In reply to Boris BREZILLONReplace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
--- drivers/tty/serial/atmel_serial.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-)
drivers/tty/serial/atmel_serial.c +28 -7
@@ -1458,9 +1458,10 @@ static void atmel_of_init_port(struct atmel_uart_port *atmel_port,/* * Configure the port from the platform device resource info. */ -static void atmel_init_port (struct atmel_uart_port *atmel_port, +static int atmel_init_port (struct atmel_uart_port *atmel_port,struct platform_device *pdev) { +int ret;struct uart_port *port = &atmel_port->uart;struct atmel_uart_data *pdata = pdev->dev.platform_data;
@@ -1496,7 +1497,17 @@ static void atmel_init_port(struct atmel_uart_port *atmel_port,/* for console, the clock could already be configured */ if (!atmel_port->clk) { atmel_port->clk =clk_get (&pdev->dev,"usart" ); -clk_enable (atmel_port->clk); +if (IS_ERR (atmel_port->clk)) { + ret =PTR_ERR (atmel_port->clk); + atmel_port->clk =NULL ; +return ret; + } + ret =clk_prepare_enable (atmel_port->clk); +if (ret) { +clk_put (atmel_port->clk); + atmel_port->clk =NULL ; +return ret; + } port->uartclk =clk_get_rate (atmel_port->clk);clk_disable (atmel_port->clk);/* only enable clock when USART is in use */
@@ -1511,6 +1522,8 @@ static void atmel_init_port(struct atmel_uart_port *atmel_port, }else { atmel_port->tx_done_mask =ATMEL_US_TXRDY ; } + +return 0 ; }struct platform_device *atmel_default_console_device;/* the serial console device */
@@ -1601,6 +1614,7 @@ static void __init atmel_console_get_options(struct uart_port *port, int *baud,static int __init atmel_console_setup (struct console *co,char *options) { +int ret;struct uart_port *port = &atmel_ports[co->index].uart;int baud =115200 ;int bits =8 ;
@@ -1612,7 +1626,9 @@ static int __init atmel_console_setup(struct console *co, char *options)return -ENODEV ; } -clk_enable (atmel_ports[co->index].clk); + ret =clk_enable (atmel_ports[co->index].clk); +if (ret) +return ret;UART_PUT_IDR (port,-1 );UART_PUT_CR (port,ATMEL_US_RSTSTA |ATMEL_US_RSTRX );
@@ -1645,6 +1661,7 @@ static struct console atmel_console = {*/ static int __init atmel_console_init (void ) { +int ret;if (atmel_default_console_device) {struct atmel_uart_data *pdata = atmel_default_console_device->dev.platform_data;
@@ -1655,7 +1672,9 @@ static int __init atmel_console_init(void) port->uart.line = id;add_preferred_console (ATMEL_DEVICENAME , id,NULL ); -atmel_init_port (port, atmel_default_console_device); + ret =atmel_init_port (port, atmel_default_console_device); +if (ret) +return ret;register_console (&atmel_console); }
@@ -1786,7 +1805,9 @@ static int atmel_serial_probe(struct platform_device *pdev) port->backup_imr =0 ; port->uart.line = ret; -atmel_init_port (port, pdev); + ret =atmel_init_port (port, pdev); +if (ret) + goto err; pinctrl =devm_pinctrl_get_select_default (&pdev->dev);if (IS_ERR (pinctrl)) {
@@ -1812,9 +1833,9 @@ static int atmel_serial_probe(struct platform_device *pdev) && ATMEL_CONSOLE_DEVICE->flags & CON_ENABLED) {/* * The serial core enabled the clock for us, so undo -* the clk_enable() in atmel_console_setup() +* the clk_prepare_enable() in atmel_console_setup() */ -clk_disable (port->clk); +clk_disable_unprepare (port->clk); }#endif
Signature · 1 line
1.7.9.5
RFC PATCH 32/50 usb: gadget: at91_udc: prepare clk before calling enable
In reply to Boris BREZILLONReplace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
--- drivers/usb/gadget/at91_udc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/usb/gadget/at91_udc.c +6 -6
@@ -870,8 +870,8 @@ static void clk_on(struct at91_udc *udc)if (udc->clocked)return ; udc->clocked =1 ; -clk_enable (udc->iclk); -clk_enable (udc->fclk); +clk_prepare_enable (udc->iclk); +clk_prepare_enable (udc->fclk); }static void clk_off (struct at91_udc *udc)
@@ -880,8 +880,8 @@ static void clk_off(struct at91_udc *udc)return ; udc->clocked =0 ; udc->gadget.speed =USB_SPEED_UNKNOWN ; -clk_disable (udc->fclk); -clk_disable (udc->iclk); +clk_disable_unprepare (udc->fclk); +clk_disable_unprepare (udc->iclk); }/*
@@ -1782,12 +1782,12 @@ static int at91udc_probe(struct platform_device *pdev) }/* don't do anything until we have both gadget driver and VBUS */ -clk_enable (udc->iclk); +clk_prepare_enable (udc->iclk);at91_udp_write (udc,AT91_UDP_TXVC ,AT91_UDP_TXVC_TXVDIS );at91_udp_write (udc,AT91_UDP_IDR ,0xffffffff );/* Clear all pending interrupts - UDP may be used by bootloader. */ at91_udp_write (udc,AT91_UDP_ICR ,0xffffffff ); -clk_disable (udc->iclk); +clk_disable_unprepare (udc->iclk);/* request UDC and maybe VBUS irqs */ udc->udp_irq =platform_get_irq (pdev,0 );
Signature · 1 line
1.7.9.5
Re: [RFC PATCH 32/50] usb: gadget: at91_udc: prepare clk before calling enable
Quoted 4 lines · Boris BREZILLON
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
Signed-off-by Boris BREZILLON <[email protected]>
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130612/cdc9a63f/attachment.sig>
RFC PATCH 33/50 ehci-atmel.c: prepare clk before calling enable
In reply to Boris BREZILLONReplace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
--- drivers/usb/host/ehci-atmel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/usb/host/ehci-atmel.c +4 -4
@@ -37,15 +37,15 @@ static int clocked;static void atmel_start_clock (void ) { -clk_enable (iclk); -clk_enable (fclk); +clk_prepare_enable (iclk); +clk_prepare_enable (fclk); clocked =1 ; }static void atmel_stop_clock (void ) { -clk_disable (fclk); -clk_disable (iclk); +clk_disable_unprepare (fclk); +clk_disable_unprepare (iclk); clocked =0 ; }
Signature · 1 line
1.7.9.5
RFC PATCH 34/50 USB: ohci-at91: prepare clk before calling enable
In reply to Boris BREZILLONReplace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
--- drivers/usb/host/ohci-at91.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/usb/host/ohci-at91.c +6 -6
@@ -41,17 +41,17 @@ extern int usb_disabled(void);static void at91_start_clock (void ) { -clk_enable (hclk); -clk_enable (iclk); -clk_enable (fclk); +clk_prepare_enable (hclk); +clk_prepare_enable (iclk); +clk_prepare_enable (fclk); clocked =1 ; }static void at91_stop_clock (void ) { -clk_disable (fclk); -clk_disable (iclk); -clk_disable (hclk); +clk_disable_unprepare (fclk); +clk_disable_unprepare (iclk); +clk_disable_unprepare (hclk); clocked =0 ; }
Signature · 1 line
1.7.9.5
RFC PATCH 35/50 at91/avr32/atmel_lcdfb: prepare clk before calling enable
In reply to Boris BREZILLONReplace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings.
--- drivers/video/atmel_lcdfb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/video/atmel_lcdfb.c +4 -4
@@ -893,14 +893,14 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)static void atmel_lcdfb_start_clock (struct atmel_lcdfb_info *sinfo) { -clk_enable (sinfo->bus_clk); -clk_enable (sinfo->lcdc_clk); +clk_prepare_enable (sinfo->bus_clk); +clk_prepare_enable (sinfo->lcdc_clk); }static void atmel_lcdfb_stop_clock (struct atmel_lcdfb_info *sinfo) { -clk_disable (sinfo->bus_clk); -clk_disable (sinfo->lcdc_clk); +clk_disable_unprepare (sinfo->bus_clk); +clk_disable_unprepare (sinfo->lcdc_clk); }
Signature · 1 line
1.7.9.5
RFC PATCH 36/50 ARM: at91/dt: move at91rm9200 SoC to new at91 clk implem
In reply to Boris BREZILLONDefine at91rm9200 clocks in at91rm9200 device tree. Add references to the appropriate clocks in each peripheral.
--- arch/arm/boot/dts/at91rm9200.dtsi | 133 +++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+)
arch/arm/boot/dts/at91rm9200.dtsi +133 -0
@@ -75,6 +75,106 @@ pmc: pmc at fffffc00 { compatible = "atmel,at91rm9200-pmc"; reg = <0xfffffc00 0x100>; + + clk32k: slck { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + main: mainck { + compatible = "atmel,at91rm9200-clk-main", "fixed-clock"; + #clock-cells = <0>; + clocks = <&clk32k>; + }; + + plla: pllack { + compatible = "atmel,at91rm9200-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <0>; + input = <1000000 32000000>; + output = <80000000 160000000 + 150000000 180000000>; + out = <0 2>; + }; + + pllb: pllbck { + compatible = "atmel,at91rm9200-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <1>; + input = <1000000 32000000>; + output = <80000000 160000000 + 150000000 180000000>; + out = <0 2>; + }; + + mck: masterck { + compatible = "atmel,at91rm9200-clk-master"; + #clock-cells = <0>; + clocks = <&clk32k>, <&main>, <&plla>, <&pllb>; + output = <0 80000000>; + divisors = <1 2 3 4>; + }; + + usb: usbck { + compatible = "atmel,at91rm9200-clk-usb"; + #clock-cells = <0>; + clocks = <&pllb>; + divisors = <1 2 0 0>; + }; + + prog: progck { + compatible = "atmel,at91rm9200-clk-programmable"; + #clock-cells = <1>; + ids = <0 1 2 3>; + clocks = <&clk32k>, <&main>, <&plla>, <&pllb>; + clock-output-names = "prog0", "prog1", "prog2", "prog3"; + }; + + system: systemck { + compatible = "atmel,at91rm9200-clk-system"; + #clock-cells = <1>; + ids = <1 4 8 9 10 11>; + clocks = <&usb>, <&usb>, + <&prog 0>, <&prog 1>, + <&prog 2>, <&prog 3>; + clock-output-names = "udpck", "uhpck", + "pck0", "pck1", + "pck2", "pck3"; + }; + + periph: periphck { + compatible = "atmel,at91rm9200-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <2 3 4 5 6 7 8 9 10 11 12 13 14 17 + 18 19 20 21 22 23 24 25 26 27 28>; + clock-output-names = "pioA_clk", + "pioB_clk", + "pioC_clk", + "pioD_clk", + "usart0_clk", + "usart1_clk", + "usart2_clk", + "usart3_clk", + "mci_clk", + "udc_clk", + "twi_clk", + "spi_clk", + "ssc0_clk", + "ssc1_clk", + "ssc2_clk", + "tc0_clk", + "tc1_clk", + "tc2_clk", + "tc3_clk", + "tc4_clk", + "tc5_clk", + "ohci_clk", + "pclk"; + }; }; st: timer at fffffd00 {
@@ -89,6 +189,8 @@ interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0 18 IRQ_TYPE_LEVEL_HIGH 0 19 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 17>, <&periph 18>, <&periph 19>; + clock-names = "t0_clk", "t1_clk", "t2_clk"; }; tcb1: timer at fffa4000 {
@@ -97,6 +199,8 @@ interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0 21 IRQ_TYPE_LEVEL_HIGH 0 22 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 20>, <&periph 21>, <&periph 22>; + clock-names = "t0_clk", "t1_clk", "t2_clk"; }; i2c0: i2c at fffb8000 {
@@ -107,6 +211,7 @@ pinctrl-0 = <&pinctrl_twi>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 12>; status = "disabled"; };
@@ -116,6 +221,8 @@ interrupts = <10 IRQ_TYPE_LEVEL_HIGH 0>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 10>; + clock-names = "mci_clk"; status = "disabled"; };
@@ -125,6 +232,8 @@ interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; + clocks = <&periph 14>; + clock-names = "pclk"; status = "disable"; };
@@ -134,6 +243,8 @@ interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>; + clocks = <&periph 15>; + clock-names = "pclk"; status = "disable"; };
@@ -143,6 +254,8 @@ interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc2_tx &pinctrl_ssc2_rx>; + clocks = <&periph 16>; + clock-names = "pclk"; status = "disable"; };
@@ -153,6 +266,8 @@ phy-mode = "rmii"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_macb_rmii>; + clocks = <&periph 24>, <&periph 24>; + clock-names = "hclk", "pclk"; status = "disabled"; };
@@ -482,6 +597,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 2>; }; pioB: gpio at fffff600 {
@@ -492,6 +608,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 3>; }; pioC: gpio at fffff800 {
@@ -502,6 +619,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 4>; }; pioD: gpio at fffffa00 {
@@ -512,6 +630,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 5>; }; };
@@ -521,6 +640,8 @@ interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_dbgu>; + clocks = <&mck>; + clock-names = "usart"; status = "disabled"; };
@@ -532,6 +653,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart0>; + clocks = <&periph 6>; + clock-names = "usart"; status = "disabled"; };
@@ -543,6 +666,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>; + clocks = <&periph 7>; + clock-names = "usart"; status = "disabled"; };
@@ -554,6 +679,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart2>; + clocks = <&periph 8>; + clock-names = "usart"; status = "disabled"; };
@@ -565,6 +692,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart3>; + clocks = <&periph 9>; + clock-names = "usart"; status = "disabled"; };
@@ -572,6 +701,8 @@ compatible = "atmel,at91rm9200-udc"; reg = <0xfffb0000 0x4000>; interrupts = <11 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 11>, <&system 1>; + clock-names = "udc_clk", "udpck"; status = "disabled"; }; };
@@ -597,6 +728,8 @@ compatible = "atmel,at91rm9200-ohci", "usb-ohci"; reg = <0x00300000 0x100000>; interrupts = <23 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 23>, <&periph 23>, <&system 4>; + clock-names = "ohci_clk", "hclk", "uhpck"; status = "disabled"; }; };
Signature · 1 line
1.7.9.5
RFC PATCH 37/50 ARM: at91/dt: move at91sam9260 SoC to new at91 clk implem
In reply to Boris BREZILLONDefine at91sam9260 clocks in at91sam9260 device tree. Add references to the appropriate clocks in each peripheral.
--- arch/arm/boot/dts/at91sam9260.dtsi | 144 +++++++++++++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 1 deletion(-)
arch/arm/boot/dts/at91sam9260.dtsi +143 -1
@@ -72,6 +72,109 @@ pmc: pmc at fffffc00 { compatible = "atmel,at91rm9200-pmc"; reg = <0xfffffc00 0x100>; + + clk32k: slck { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + main: mainck { + compatible = "atmel,at91rm9200-clk-main", "fixed-clock"; + #clock-cells = <0>; + clocks = <&clk32k>; + }; + + plla: pllack { + compatible = "atmel,at91rm9200-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <0>; + input = <1000000 32000000>; + output = <80000000 160000000 + 150000000 240000000>; + out = <0 2>; + }; + + pllb: pllbck { + compatible = "atmel,at91rm9200-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <1>; + input = <1000000 5000000>; + output = <70000000 130000000>; + out = <1>; + }; + + mck: masterck { + compatible = "atmel,at91rm9200-clk-master"; + #clock-cells = <0>; + clocks = <&clk32k>, <&main>, <&plla>, <&pllb>; + output = <0 105000000>; + divisors = <1 2 4 0>; + }; + + usb: usbck { + compatible = "atmel,at91rm9200-clk-usb"; + #clock-cells = <0>; + clocks = <&pllb>; + divisors = <1 2 4 0>; + }; + + prog: progck { + compatible = "atmel,at91rm9200-clk-programmable"; + #clock-cells = <1>; + ids = <0 1>; + clocks = <&clk32k>, <&main>, <&plla>, <&pllb>; + clock-output-names = "prog0", "prog1"; + }; + + system: systemck { + compatible = "atmel,at91rm9200-clk-system"; + #clock-cells = <1>; + ids = <6 7 8 9>; + clocks = <&usb>, <&usb>, <&prog 0>, <&prog 1>; + clock-output-names = "udpck", "uhpck", "pck0", "pck1"; + }; + + periph: periphck { + compatible = "atmel,at91rm9200-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <2 3 4 5 6 7 8 9 10 11 12 13 14 17 + 18 19 20 21 22 23 24 25 26 27 28>; + clock-output-names = "pioA_clk", + "pioB_clk", + "pioC_clk", + "adc_clk", + "usart0_clk", + "usart1_clk", + "usart2_clk", + "mci_clk", + "udc_clk", + "twi_clk", + "spi0_clk", + "spi1_clk", + "ssc_clk", + "tc0_clk", + "tc1_clk", + "tc2_clk", + "ohci_clk", + "pclk", + "isi_clk", + "usart3_clk", + "usart4_clk", + "usart5_clk", + "tc3_clk", + "tc4_clk", + "tc5_clk"; + + adc_op_clk: adc_op_clk{ + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <5000000>; + }; + }; }; rstc at fffffd00 {
@@ -88,6 +191,7 @@ compatible = "atmel,at91sam9260-pit"; reg = <0xfffffd30 0xf>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&mck>; }; tcb0: timer at fffa0000 {
@@ -96,6 +200,8 @@ interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0 18 IRQ_TYPE_LEVEL_HIGH 0 19 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 17>, <&periph 18>, <&periph 19>; + clock-names = "t0_clk", "t1_clk", "t2_clk"; }; tcb1: timer at fffdc000 {
@@ -104,6 +210,8 @@ interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0 27 IRQ_TYPE_LEVEL_HIGH 0 28 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 26>, <&periph 27>, <&periph 28>; + clock-names = "t0_clk", "t1_clk", "t2_clk"; }; pinctrl at fffff400 {
@@ -271,7 +379,7 @@ atmel,pins = <AT91_PIOA 10 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA10 periph B */ AT91_PIOA 11 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA11 periph B */ - AT91_PIOA 24 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA24 periph B */ + AT91_PIOA 22 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA22 periph B */ AT91_PIOA 25 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA25 periph B */ AT91_PIOA 26 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA26 periph B */ AT91_PIOA 27 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA27 periph B */
@@ -439,6 +547,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 2>; }; pioB: gpio at fffff600 {
@@ -449,6 +558,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 3>; }; pioC: gpio at fffff800 {
@@ -459,6 +569,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 4>; }; };
@@ -468,6 +579,8 @@ interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_dbgu>; + clocks = <&mck>; + clock-names = "usart"; status = "disabled"; };
@@ -479,6 +592,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart0>; + clocks = <&periph 6>; + clock-names = "usart"; status = "disabled"; };
@@ -490,6 +605,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart1>; + clocks = <&periph 7>; + clock-names = "usart"; status = "disabled"; };
@@ -501,6 +618,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart2>; + clocks = <&periph 8>; + clock-names = "usart"; status = "disabled"; };
@@ -512,6 +631,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart3>; + clocks = <&periph 23>; + clock-names = "usart"; status = "disabled"; };
@@ -523,6 +644,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart0>; + clocks = <&periph 24>; + clock-names = "usart"; status = "disabled"; };
@@ -534,6 +657,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>; + clocks = <&periph 25>; + clock-names = "usart"; status = "disabled"; };
@@ -543,6 +668,8 @@ interrupts = <21 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_macb_rmii>; + clocks = <&periph 21>, <&periph 21>; + clock-names = "hclk", "pclk"; status = "disabled"; };
@@ -550,6 +677,8 @@ compatible = "atmel,at91rm9200-udc"; reg = <0xfffa4000 0x4000>; interrupts = <10 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 10>, <&system 6>; + clock-names = "udc_clk", "udpck"; status = "disabled"; };
@@ -559,6 +688,7 @@ interrupts = <11 IRQ_TYPE_LEVEL_HIGH 6>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 11>; status = "disabled"; };
@@ -568,6 +698,8 @@ interrupts = <9 IRQ_TYPE_LEVEL_HIGH 0>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 9>; + clock-names = "mci_clk"; status = "disabled"; };
@@ -577,6 +709,8 @@ interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; + clocks = <&periph 14>; + clock-names = "pclk"; status = "disabled"; };
@@ -588,6 +722,8 @@ interrupts = <12 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi0>; + clocks = <&periph 12>; + clock-names = "spi_clk"; status = "disabled"; };
@@ -599,6 +735,8 @@ interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi1>; + clocks = <&periph 13>; + clock-names = "spi_clk"; status = "disabled"; };
@@ -606,6 +744,8 @@ compatible = "atmel,at91sam9260-adc"; reg = <0xfffe0000 0x100>; interrupts = <5 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 5>, <&adc_op_clk>; + clock-names = "adc_clk", "adc_op_clk"; atmel,adc-use-external-triggers; atmel,adc-channels-used = <0xf>; atmel,adc-vref = <3300>;
@@ -669,6 +809,8 @@ compatible = "atmel,at91rm9200-ohci", "usb-ohci"; reg = <0x00500000 0x100000>; interrupts = <20 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 20>, <&periph 20>, <&system 7>; + clock-names = "ohci_clk", "hclk", "uhpck"; status = "disabled"; }; };
Signature · 1 line
1.7.9.5
RFC PATCH 37/50 ARM: at91/dt: move at91sam9260 SoC to new at91 clk implem
In reply to Boris BREZILLONDefine at91sam9260 clocks in at91sam9260 device tree. Add references to the appropriate clocks in each peripheral.
--- arch/arm/boot/dts/at91sam9260.dtsi | 144 +++++++++++++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 1 deletion(-)
arch/arm/boot/dts/at91sam9260.dtsi +143 -1
@@ -72,6 +72,109 @@ pmc: pmc at fffffc00 { compatible = "atmel,at91rm9200-pmc"; reg = <0xfffffc00 0x100>; + + clk32k: slck { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + main: mainck { + compatible = "atmel,at91rm9200-clk-main", "fixed-clock"; + #clock-cells = <0>; + clocks = <&clk32k>; + }; + + plla: pllack { + compatible = "atmel,at91rm9200-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <0>; + input = <1000000 32000000>; + output = <80000000 160000000 + 150000000 240000000>; + out = <0 2>; + }; + + pllb: pllbck { + compatible = "atmel,at91rm9200-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <1>; + input = <1000000 5000000>; + output = <70000000 130000000>; + out = <1>; + }; + + mck: masterck { + compatible = "atmel,at91rm9200-clk-master"; + #clock-cells = <0>; + clocks = <&clk32k>, <&main>, <&plla>, <&pllb>; + output = <0 105000000>; + divisors = <1 2 4 0>; + }; + + usb: usbck { + compatible = "atmel,at91rm9200-clk-usb"; + #clock-cells = <0>; + clocks = <&pllb>; + divisors = <1 2 4 0>; + }; + + prog: progck { + compatible = "atmel,at91rm9200-clk-programmable"; + #clock-cells = <1>; + ids = <0 1>; + clocks = <&clk32k>, <&main>, <&plla>, <&pllb>; + clock-output-names = "prog0", "prog1"; + }; + + system: systemck { + compatible = "atmel,at91rm9200-clk-system"; + #clock-cells = <1>; + ids = <6 7 8 9>; + clocks = <&usb>, <&usb>, <&prog 0>, <&prog 1>; + clock-output-names = "udpck", "uhpck", "pck0", "pck1"; + }; + + periph: periphck { + compatible = "atmel,at91rm9200-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <2 3 4 5 6 7 8 9 10 11 12 13 14 17 + 18 19 20 21 22 23 24 25 26 27 28>; + clock-output-names = "pioA_clk", + "pioB_clk", + "pioC_clk", + "adc_clk", + "usart0_clk", + "usart1_clk", + "usart2_clk", + "mci_clk", + "udc_clk", + "twi_clk", + "spi0_clk", + "spi1_clk", + "ssc_clk", + "tc0_clk", + "tc1_clk", + "tc2_clk", + "ohci_clk", + "pclk", + "isi_clk", + "usart3_clk", + "usart4_clk", + "usart5_clk", + "tc3_clk", + "tc4_clk", + "tc5_clk"; + + adc_op_clk: adc_op_clk{ + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <5000000>; + }; + }; }; rstc at fffffd00 {
@@ -88,6 +191,7 @@ compatible = "atmel,at91sam9260-pit"; reg = <0xfffffd30 0xf>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&mck>; }; tcb0: timer at fffa0000 {
@@ -96,6 +200,8 @@ interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0 18 IRQ_TYPE_LEVEL_HIGH 0 19 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 17>, <&periph 18>, <&periph 19>; + clock-names = "t0_clk", "t1_clk", "t2_clk"; }; tcb1: timer at fffdc000 {
@@ -104,6 +210,8 @@ interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0 27 IRQ_TYPE_LEVEL_HIGH 0 28 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 26>, <&periph 27>, <&periph 28>; + clock-names = "t0_clk", "t1_clk", "t2_clk"; }; pinctrl at fffff400 {
@@ -271,7 +379,7 @@ atmel,pins = <AT91_PIOA 10 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA10 periph B */ AT91_PIOA 11 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA11 periph B */ - AT91_PIOA 24 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA24 periph B */ + AT91_PIOA 22 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA22 periph B */ AT91_PIOA 25 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA25 periph B */ AT91_PIOA 26 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA26 periph B */ AT91_PIOA 27 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA27 periph B */
@@ -439,6 +547,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 2>; }; pioB: gpio at fffff600 {
@@ -449,6 +558,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 3>; }; pioC: gpio at fffff800 {
@@ -459,6 +569,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 4>; }; };
@@ -468,6 +579,8 @@ interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_dbgu>; + clocks = <&mck>; + clock-names = "usart"; status = "disabled"; };
@@ -479,6 +592,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart0>; + clocks = <&periph 6>; + clock-names = "usart"; status = "disabled"; };
@@ -490,6 +605,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart1>; + clocks = <&periph 7>; + clock-names = "usart"; status = "disabled"; };
@@ -501,6 +618,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart2>; + clocks = <&periph 8>; + clock-names = "usart"; status = "disabled"; };
@@ -512,6 +631,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart3>; + clocks = <&periph 23>; + clock-names = "usart"; status = "disabled"; };
@@ -523,6 +644,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart0>; + clocks = <&periph 24>; + clock-names = "usart"; status = "disabled"; };
@@ -534,6 +657,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>; + clocks = <&periph 25>; + clock-names = "usart"; status = "disabled"; };
@@ -543,6 +668,8 @@ interrupts = <21 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_macb_rmii>; + clocks = <&periph 21>, <&periph 21>; + clock-names = "hclk", "pclk"; status = "disabled"; };
@@ -550,6 +677,8 @@ compatible = "atmel,at91rm9200-udc"; reg = <0xfffa4000 0x4000>; interrupts = <10 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 10>, <&system 6>; + clock-names = "udc_clk", "udpck"; status = "disabled"; };
@@ -559,6 +688,7 @@ interrupts = <11 IRQ_TYPE_LEVEL_HIGH 6>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 11>; status = "disabled"; };
@@ -568,6 +698,8 @@ interrupts = <9 IRQ_TYPE_LEVEL_HIGH 0>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 9>; + clock-names = "mci_clk"; status = "disabled"; };
@@ -577,6 +709,8 @@ interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; + clocks = <&periph 14>; + clock-names = "pclk"; status = "disabled"; };
@@ -588,6 +722,8 @@ interrupts = <12 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi0>; + clocks = <&periph 12>; + clock-names = "spi_clk"; status = "disabled"; };
@@ -599,6 +735,8 @@ interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi1>; + clocks = <&periph 13>; + clock-names = "spi_clk"; status = "disabled"; };
@@ -606,6 +744,8 @@ compatible = "atmel,at91sam9260-adc"; reg = <0xfffe0000 0x100>; interrupts = <5 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 5>, <&adc_op_clk>; + clock-names = "adc_clk", "adc_op_clk"; atmel,adc-use-external-triggers; atmel,adc-channels-used = <0xf>; atmel,adc-vref = <3300>;
@@ -669,6 +809,8 @@ compatible = "atmel,at91rm9200-ohci", "usb-ohci"; reg = <0x00500000 0x100000>; interrupts = <20 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 20>, <&periph 20>, <&system 7>; + clock-names = "ohci_clk", "hclk", "uhpck"; status = "disabled"; }; };
Signature · 1 line
1.7.9.5
RFC PATCH 37/50 ARM: at91/dt: move at91sam9260 SoC to new at91 clk implem
In reply to Boris BREZILLONDefine at91sam9260 clocks in at91sam9260 device tree. Add references to the appropriate clocks in each peripheral.
--- arch/arm/boot/dts/at91sam9260.dtsi | 144 +++++++++++++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 1 deletion(-)
arch/arm/boot/dts/at91sam9260.dtsi +143 -1
@@ -72,6 +72,109 @@ pmc: pmc at fffffc00 { compatible = "atmel,at91rm9200-pmc"; reg = <0xfffffc00 0x100>; + + clk32k: slck { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + main: mainck { + compatible = "atmel,at91rm9200-clk-main", "fixed-clock"; + #clock-cells = <0>; + clocks = <&clk32k>; + }; + + plla: pllack { + compatible = "atmel,at91rm9200-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <0>; + input = <1000000 32000000>; + output = <80000000 160000000 + 150000000 240000000>; + out = <0 2>; + }; + + pllb: pllbck { + compatible = "atmel,at91rm9200-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <1>; + input = <1000000 5000000>; + output = <70000000 130000000>; + out = <1>; + }; + + mck: masterck { + compatible = "atmel,at91rm9200-clk-master"; + #clock-cells = <0>; + clocks = <&clk32k>, <&main>, <&plla>, <&pllb>; + output = <0 105000000>; + divisors = <1 2 4 0>; + }; + + usb: usbck { + compatible = "atmel,at91rm9200-clk-usb"; + #clock-cells = <0>; + clocks = <&pllb>; + divisors = <1 2 4 0>; + }; + + prog: progck { + compatible = "atmel,at91rm9200-clk-programmable"; + #clock-cells = <1>; + ids = <0 1>; + clocks = <&clk32k>, <&main>, <&plla>, <&pllb>; + clock-output-names = "prog0", "prog1"; + }; + + system: systemck { + compatible = "atmel,at91rm9200-clk-system"; + #clock-cells = <1>; + ids = <6 7 8 9>; + clocks = <&usb>, <&usb>, <&prog 0>, <&prog 1>; + clock-output-names = "udpck", "uhpck", "pck0", "pck1"; + }; + + periph: periphck { + compatible = "atmel,at91rm9200-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <2 3 4 5 6 7 8 9 10 11 12 13 14 17 + 18 19 20 21 22 23 24 25 26 27 28>; + clock-output-names = "pioA_clk", + "pioB_clk", + "pioC_clk", + "adc_clk", + "usart0_clk", + "usart1_clk", + "usart2_clk", + "mci_clk", + "udc_clk", + "twi_clk", + "spi0_clk", + "spi1_clk", + "ssc_clk", + "tc0_clk", + "tc1_clk", + "tc2_clk", + "ohci_clk", + "pclk", + "isi_clk", + "usart3_clk", + "usart4_clk", + "usart5_clk", + "tc3_clk", + "tc4_clk", + "tc5_clk"; + + adc_op_clk: adc_op_clk{ + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <5000000>; + }; + }; }; rstc at fffffd00 {
@@ -88,6 +191,7 @@ compatible = "atmel,at91sam9260-pit"; reg = <0xfffffd30 0xf>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&mck>; }; tcb0: timer at fffa0000 {
@@ -96,6 +200,8 @@ interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0 18 IRQ_TYPE_LEVEL_HIGH 0 19 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 17>, <&periph 18>, <&periph 19>; + clock-names = "t0_clk", "t1_clk", "t2_clk"; }; tcb1: timer at fffdc000 {
@@ -104,6 +210,8 @@ interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0 27 IRQ_TYPE_LEVEL_HIGH 0 28 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 26>, <&periph 27>, <&periph 28>; + clock-names = "t0_clk", "t1_clk", "t2_clk"; }; pinctrl at fffff400 {
@@ -271,7 +379,7 @@ atmel,pins = <AT91_PIOA 10 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA10 periph B */ AT91_PIOA 11 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA11 periph B */ - AT91_PIOA 24 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA24 periph B */ + AT91_PIOA 22 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA22 periph B */ AT91_PIOA 25 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA25 periph B */ AT91_PIOA 26 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA26 periph B */ AT91_PIOA 27 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA27 periph B */
@@ -439,6 +547,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 2>; }; pioB: gpio at fffff600 {
@@ -449,6 +558,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 3>; }; pioC: gpio at fffff800 {
@@ -459,6 +569,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 4>; }; };
@@ -468,6 +579,8 @@ interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_dbgu>; + clocks = <&mck>; + clock-names = "usart"; status = "disabled"; };
@@ -479,6 +592,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart0>; + clocks = <&periph 6>; + clock-names = "usart"; status = "disabled"; };
@@ -490,6 +605,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart1>; + clocks = <&periph 7>; + clock-names = "usart"; status = "disabled"; };
@@ -501,6 +618,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart2>; + clocks = <&periph 8>; + clock-names = "usart"; status = "disabled"; };
@@ -512,6 +631,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart3>; + clocks = <&periph 23>; + clock-names = "usart"; status = "disabled"; };
@@ -523,6 +644,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart0>; + clocks = <&periph 24>; + clock-names = "usart"; status = "disabled"; };
@@ -534,6 +657,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>; + clocks = <&periph 25>; + clock-names = "usart"; status = "disabled"; };
@@ -543,6 +668,8 @@ interrupts = <21 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_macb_rmii>; + clocks = <&periph 21>, <&periph 21>; + clock-names = "hclk", "pclk"; status = "disabled"; };
@@ -550,6 +677,8 @@ compatible = "atmel,at91rm9200-udc"; reg = <0xfffa4000 0x4000>; interrupts = <10 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 10>, <&system 6>; + clock-names = "udc_clk", "udpck"; status = "disabled"; };
@@ -559,6 +688,7 @@ interrupts = <11 IRQ_TYPE_LEVEL_HIGH 6>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 11>; status = "disabled"; };
@@ -568,6 +698,8 @@ interrupts = <9 IRQ_TYPE_LEVEL_HIGH 0>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 9>; + clock-names = "mci_clk"; status = "disabled"; };
@@ -577,6 +709,8 @@ interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; + clocks = <&periph 14>; + clock-names = "pclk"; status = "disabled"; };
@@ -588,6 +722,8 @@ interrupts = <12 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi0>; + clocks = <&periph 12>; + clock-names = "spi_clk"; status = "disabled"; };
@@ -599,6 +735,8 @@ interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi1>; + clocks = <&periph 13>; + clock-names = "spi_clk"; status = "disabled"; };
@@ -606,6 +744,8 @@ compatible = "atmel,at91sam9260-adc"; reg = <0xfffe0000 0x100>; interrupts = <5 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 5>, <&adc_op_clk>; + clock-names = "adc_clk", "adc_op_clk"; atmel,adc-use-external-triggers; atmel,adc-channels-used = <0xf>; atmel,adc-vref = <3300>;
@@ -669,6 +809,8 @@ compatible = "atmel,at91rm9200-ohci", "usb-ohci"; reg = <0x00500000 0x100000>; interrupts = <20 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 20>, <&periph 20>, <&system 7>; + clock-names = "ohci_clk", "hclk", "uhpck"; status = "disabled"; }; };
Signature · 1 line
1.7.9.5
RFC PATCH 38/50 ARM: at91/dt: move at91sam9263 SoC to new at91 clk implem
In reply to Boris BREZILLONDefine at91sam9263 clocks in at91sam9263 device tree. Add references to the appropriate clocks in each peripheral.
--- arch/arm/boot/dts/at91sam9263.dtsi | 135 ++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+)
arch/arm/boot/dts/at91sam9263.dtsi +135 -0
@@ -64,6 +64,106 @@ pmc: pmc at fffffc00 { compatible = "atmel,at91rm9200-pmc"; reg = <0xfffffc00 0x100>; + + clk32k: slck { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + main: mainck { + compatible = "atmel,at91rm9200-clk-main", "fixed-clock"; + #clock-cells = <0>; + clocks = <&clk32k>; + }; + + plla: pllack { + compatible = "atmel,at91rm9200-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <0>; + input = <1000000 32000000>; + output = <80000000 200000000 + 190000000 240000000>; + out = <0 2>; + }; + + pllb: pllbck { + compatible = "atmel,at91rm9200-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <1>; + input = <1000000 32000000>; + output = <80000000 200000000 + 190000000 240000000>; + out = <0 2>; + }; + + mck: masterck { + compatible = "atmel,at91rm9200-clk-master"; + #clock-cells = <0>; + clocks = <&clk32k>, <&main>, <&plla>, <&pllb>; + output = <0 120000000>; + divisors = <1 2 4 0>; + }; + + usb: usbck { + compatible = "atmel,at91rm9200-clk-usb"; + #clock-cells = <0>; + clocks = <&pllb>; + divisors = <1 2 4 0>; + }; + + prog: progck { + compatible = "atmel,at91rm9200-clk-programmable"; + #clock-cells = <1>; + ids = <0 1 2 3>; + clocks = <&clk32k>, <&main>, <&plla>, <&pllb>; + clock-output-names = "prog0", "prog1", "prog2", "prog3"; + }; + + system: systemck { + compatible = "atmel,at91rm9200-clk-system"; + #clock-cells = <1>; + ids = <6 7 8 9 10 11>; + clocks = <&usb>, <&usb>, <&prog 0>, <&prog 1>, <&prog 2>, + <&prog 3>; + clock-output-names = "udpck", "uhpck", "pck0", "pck1", + "pck2", "pck3"; + }; + + periph: periphck { + compatible = "atmel,at91rm9200-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <2 3 4 7 8 9 10 11 12 13 14 15 16 + 17 18 19 20 21 23 24 25 26 27 29>; + clock-output-names = "pioA_clk", + "pioB_clk", + "pioCDE_clk", + "usart0_clk", + "usart1_clk", + "usart2_clk", + "mci0_clk", + "mci1_clk", + "can_clk", + "twi_clk", + "spi0_clk", + "spi1_clk", + "ssc0_clk", + "ssc1_clk", + "ac97_clk", + "tcb_clk", + "pwm_clk", + "pclk", + "2dge_clk", + "udc_clk", + "isi_clk", + "lcdc_clk", + "dma_clk", + "ohci_clk"; + + }; }; ramc: ramc at ffffe200 {
@@ -76,12 +176,15 @@ compatible = "atmel,at91sam9260-pit"; reg = <0xfffffd30 0xf>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&mck>; }; tcb0: timer at fff7c000 { compatible = "atmel,at91rm9200-tcb"; reg = <0xfff7c000 0x100>; interrupts = <19 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 19>; + clock-names = "t0_clk"; }; rstc at fffffd00 {
@@ -370,6 +473,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 2>; }; pioB: gpio at fffff400 {
@@ -380,6 +484,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 3>; }; pioC: gpio at fffff600 {
@@ -390,6 +495,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 4>; }; pioD: gpio at fffff800 {
@@ -400,6 +506,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 4>; }; pioE: gpio at fffffa00 {
@@ -410,6 +517,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 4>; }; };
@@ -419,6 +527,8 @@ interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_dbgu>; + clocks = <&mck>; + clock-names = "usart"; status = "disabled"; };
@@ -430,6 +540,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart0>; + clocks = <&periph 7>; + clock-names = "usart"; status = "disabled"; };
@@ -441,6 +553,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart1>; + clocks = <&periph 8>; + clock-names = "usart"; status = "disabled"; };
@@ -452,6 +566,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart2>; + clocks = <&periph 9>; + clock-names = "usart"; status = "disabled"; };
@@ -461,6 +577,8 @@ interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; + clocks = <&periph 16>; + clock-names = "pclk"; status = "disabled"; };
@@ -470,6 +588,8 @@ interrupts = <17 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>; + clocks = <&periph 17>; + clock-names = "pclk"; status = "disabled"; };
@@ -479,6 +599,8 @@ interrupts = <21 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_macb_rmii>; + clocks = <&periph 21>, <&periph 21>; + clock-names = "hclk", "pclk"; status = "disabled"; };
@@ -486,6 +608,8 @@ compatible = "atmel,at91rm9200-udc"; reg = <0xfff78000 0x4000>; interrupts = <24 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 24>, <&system 7>; + clock-names = "udc_clk", "udpck"; status = "disabled"; };
@@ -495,6 +619,7 @@ interrupts = <13 IRQ_TYPE_LEVEL_HIGH 6>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 13>; status = "disabled"; };
@@ -504,6 +629,8 @@ interrupts = <10 IRQ_TYPE_LEVEL_HIGH 0>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 10>; + clock-names = "mci_clk"; status = "disabled"; };
@@ -513,6 +640,8 @@ interrupts = <11 IRQ_TYPE_LEVEL_HIGH 0>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 11>; + clock-names = "mci_clk"; status = "disabled"; };
@@ -530,6 +659,8 @@ interrupts = <14 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi0>; + clocks = <&periph 14>; + clock-names = "spi_clk"; status = "disabled"; };
@@ -541,6 +672,8 @@ interrupts = <15 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi1>; + clocks = <&periph 15>; + clock-names = "spi_clk"; status = "disabled"; }; };
@@ -567,6 +700,8 @@ compatible = "atmel,at91rm9200-ohci", "usb-ohci"; reg = <0x00a00000 0x100000>; interrupts = <29 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 29>, <&periph 29>, <&system 6>; + clock-names = "ohci_clk", "hclk", "uhpck"; status = "disabled"; }; };
Signature · 1 line
1.7.9.5
RFC PATCH 39/50 ARM: at91/dt: move at91sam9g45 SoC to new at91 clk implem
In reply to Boris BREZILLONDefine at91sam9g45 clocks in at91sam9g45 device tree. Add references to the appropriate clocks in each peripheral.
--- arch/arm/boot/dts/at91sam9g45.dtsi | 157 ++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+)
arch/arm/boot/dts/at91sam9g45.dtsi +157 -0
@@ -76,6 +76,119 @@ pmc: pmc at fffffc00 { compatible = "atmel,at91rm9200-pmc"; reg = <0xfffffc00 0x100>; + + clk32k: slck { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + main: mainck { + compatible = "atmel,at91rm9200-clk-main", "fixed-clock"; + #clock-cells = <0>; + clocks = <&clk32k>; + }; + + plla: pllack { + compatible = "atmel,at91sam9g45-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <0>; + input = <2000000 32000000>; + output = <74500000 800000000 + 69500000 750000000 + 64500000 700000000 + 59500000 650000000 + 54500000 600000000 + 49500000 550000000 + 44500000 500000000 + 40000000 450000000>; + out = <0 1 2 3 0 1 2 3>; + icpll = <0 0 0 0 1 1 1 1>; + }; + + plladiv: plladivck { + compatible = "atmel,at91sam9x5-clk-plldiv"; + #clock-cells = <0>; + clocks = <&plla>; + }; + + utmi: utmick { + compatible = "atmel,at91sam9x5-clk-utmi"; + #clock-cells = <0>; + clocks = <&main>; + }; + + mck: masterck { + compatible = "atmel,at91rm9200-clk-master"; + #clock-cells = <0>; + clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>; + output = <0 133000000>; + divisors = <1 2 4 3>; + }; + + usb: usbck { + compatible = "atmel,at91sam9x5-clk-usb"; + #clock-cells = <0>; + clocks = <&plladiv>, <&utmi>; + }; + + prog: progck { + compatible = "atmel,at91sam9g45-clk-programmable"; + #clock-cells = <1>; + ids = <0 1>; + clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>, <&mck>; + clock-output-names = "prog0", "prog1"; + }; + + system: systemck { + compatible = "atmel,at91rm9200-clk-system"; + #clock-cells = <1>; + ids = <2 6 8 9>; + clocks = <&mck>, <&usb>, <&prog 0>, <&prog 1>; + clock-output-names = "ddrck", "uhpck", "pck0", "pck1"; + }; + + periph: periphck { + compatible = "atmel,at91rm9200-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + 17 18 19 20 21 22 23 24 25 26 27 29>; + clock-output-names = "pioA_clk", + "pioB_clk", + "pioC_clk", + "pioDE_clk", + "trng_clk", + "usart0_clk", + "usart1_clk", + "usart2_clk", + "usart3_clk", + "mci0_clk", + "twi0_clk", + "twi1_clk", + "spi0_clk", + "spi1_clk", + "ssc0_clk", + "ssc1_clk", + "tcb0_clk", + "pwm_clk", + "tsc_clk", + "dma_clk", + "uhphs_clk", + "lcdc_clk", + "ac97_clk", + "pclk", + "isi_clk", + "udphs_clk", + "mci1_clk"; + + adc_op_clk: adc_op_clk{ + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <13200000>; + }; + }; }; rstc at fffffd00 {
@@ -87,6 +200,7 @@ compatible = "atmel,at91sam9260-pit"; reg = <0xfffffd30 0xf>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&mck>; };
@@ -99,12 +213,16 @@ compatible = "atmel,at91rm9200-tcb"; reg = <0xfff7c000 0x100>; interrupts = <18 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 18>; + clock-names = "t0_clk"; }; tcb1: timer at fffd4000 { compatible = "atmel,at91rm9200-tcb"; reg = <0xfffd4000 0x100>; interrupts = <18 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 18>; + clock-names = "t0_clk"; }; dma: dma-controller at ffffec00 {
@@ -112,6 +230,8 @@ reg = <0xffffec00 0x200>; interrupts = <21 IRQ_TYPE_LEVEL_HIGH 0>; #dma-cells = <2>; + clocks = <&periph 21>; + clock-names = "dma_clk"; }; pinctrl at fffff200 {
@@ -428,6 +548,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 2>; }; pioB: gpio at fffff400 {
@@ -438,6 +559,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 3>; }; pioC: gpio at fffff600 {
@@ -448,6 +570,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 4>; }; pioD: gpio at fffff800 {
@@ -458,6 +581,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 5>; }; pioE: gpio at fffffa00 {
@@ -468,6 +592,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 5>; }; };
@@ -477,6 +602,8 @@ interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_dbgu>; + clocks = <&mck>; + clock-names = "usart"; status = "disabled"; };
@@ -488,6 +615,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart0>; + clocks = <&periph 7>; + clock-names = "usart"; status = "disabled"; };
@@ -499,6 +628,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart1>; + clocks = <&periph 8>; + clock-names = "usart"; status = "disabled"; };
@@ -510,6 +641,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart2>; + clocks = <&periph 9>; + clock-names = "usart"; status = "disabled"; };
@@ -521,6 +654,8 @@ atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart3>; + clocks = <&periph 10>; + clock-names = "usart"; status = "disabled"; };
@@ -530,6 +665,8 @@ interrupts = <25 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_macb_rmii>; + clocks = <&periph 25>, <&periph 25>; + clock-names = "hclk", "pclk"; status = "disabled"; };
@@ -539,6 +676,7 @@ interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 12>; status = "disabled"; };
@@ -548,6 +686,7 @@ interrupts = <13 IRQ_TYPE_LEVEL_HIGH 6>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 13>; status = "disabled"; };
@@ -557,6 +696,8 @@ interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; + clocks = <&periph 16>; + clock-names = "pclk"; status = "disabled"; };
@@ -566,6 +707,8 @@ interrupts = <17 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>; + clocks = <&periph 17>; + clock-names = "pclk"; status = "disabled"; };
@@ -573,6 +716,8 @@ compatible = "atmel,at91sam9260-adc"; reg = <0xfffb0000 0x100>; interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 20>, <&adc_op_clk>; + clock-names = "adc_clk", "adc_op_clk"; atmel,adc-use-external-triggers; atmel,adc-channels-used = <0xff>; atmel,adc-vref = <3300>;
@@ -617,6 +762,8 @@ dma-names = "rxtx"; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 29>; + clock-names = "mci_clk"; status = "disabled"; };
@@ -628,6 +775,8 @@ dma-names = "rxtx"; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 29>; + clock-names = "mci_clk"; status = "disabled"; };
@@ -645,6 +794,8 @@ interrupts = <14 4 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi0>; + clocks = <&periph 14>; + clock-names = "spi_clk"; status = "disabled"; };
@@ -656,6 +807,8 @@ interrupts = <15 4 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi1>; + clocks = <&periph 15>; + clock-names = "spi_clk"; status = "disabled"; }; };
@@ -682,6 +835,8 @@ compatible = "atmel,at91rm9200-ohci", "usb-ohci"; reg = <0x00700000 0x100000>; interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 22>, <&periph 22>, <&system 6>; + clock-names = "ohci_clk", "hclk", "uhpck"; status = "disabled"; };
@@ -689,6 +844,8 @@ compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; reg = <0x00800000 0x100000>; interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 22>, <&system 6>; + clock-names = "ehci_clk", "uhpck"; status = "disabled"; }; };
Signature · 1 line
1.7.9.5
RFC PATCH 40/50 ARM: at91/dt: move at91sam9n12 SoC to new at91 clk implem
In reply to Boris BREZILLONDefine at91sam9n12 clocks in at91sam9n12 device tree. Add references to the appropriate clocks in each peripheral.
--- arch/arm/boot/dts/at91sam9n12.dtsi | 153 ++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+)
arch/arm/boot/dts/at91sam9n12.dtsi +153 -0
@@ -70,6 +70,126 @@ pmc: pmc at fffffc00 { compatible = "atmel,at91rm9200-pmc"; reg = <0xfffffc00 0x100>; + + clk32k: slck { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + main: mainck { + compatible = "atmel,at91rm9200-clk-main", "fixed-clock"; + #clock-cells = <0>; + clocks = <&clk32k>; + }; + + plla: pllack { + compatible = "atmel,at91rm9200-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <0>; + input = <2000000 32000000>; + output = <74500000 800000000 + 69500000 750000000 + 64500000 700000000 + 59500000 650000000 + 54500000 600000000 + 49500000 550000000 + 44500000 500000000 + 40000000 450000000>; + out = <0 1 2 3 0 1 2 3>; + icpll = <0 0 0 0 1 1 1 1>; + }; + + pllb: pllbck { + compatible = "atmel,at91rm9200-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <1>; + input = <2000000 32000000>; + output = <74500000 800000000 + 69500000 750000000 + 64500000 700000000 + 59500000 650000000 + 54500000 600000000 + 49500000 550000000 + 44500000 500000000 + 40000000 450000000>; + out = <0 1 2 3 0 1 2 3>; + icpll = <0 0 0 0 1 1 1 1>; + }; + + plladiv: plladivck { + compatible = "atmel,at91sam9x5-clk-plldiv"; + #clock-cells = <0>; + clocks = <&plla>; + }; + + mck: masterck { + compatible = "atmel,at91sam9x5-clk-master"; + #clock-cells = <0>; + clocks = <&clk32k>, <&main>, <&plladiv>, <&pllb>; + output = <0 133000000>; + divisors = <1 2 4 3>; + }; + + usb: usbck { + compatible = "atmel,at91sam9x5-clk-usb"; + #clock-cells = <0>; + clocks = <&pllb>; + usbs0-unused; + }; + + prog: progck { + compatible = "atmel,at91rm9200-clk-programmable"; + #clock-cells = <1>; + ids = <0 1>; + clocks = <&clk32k>, <&main>, <&plladiv>, <&pllb>, <&mck>; + clock-output-names = "prog0", "prog1"; + }; + + system: systemck { + compatible = "atmel,at91rm9200-clk-system"; + #clock-cells = <1>; + ids = <2 3 6 7 8 9>; + clocks = <&mck>, <&mck>, <&usb>, <&usb>, + <&prog 0>, <&prog 1>; + clock-output-names = "ddrck", "lcdck", "uhpck", "udpck", + "pck0", "pck1"; + }; + + periph: periphck { + compatible = "atmel,at91rm9200-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <2 3 4 5 6 7 8 9 10 12 13 14 15 16 + 17 18 19 20 22 23 25 27 28 29 30>; + clock-output-names = "pioAB_clk", + "pioCD_clk", + "fuse_clk", + "usart0_clk", + "usart1_clk", + "usart2_clk", + "usart3_clk", + "twi0_ck", + "twi1_ck", + "hsmci_clk", + "spi0_clk", + "spi1_clk", + "uart0_clk", + "uart1_clk", + "tcb_clk", + "pwm_clk", + "adc_clk", + "dma_clk", + "uhp_clk", + "udc_clk", + "lcdc_clk", + "sha_clk", + "ssc_clk", + "aes_clk", + "trng_clk"; + }; }; rstc at fffffe00 {
@@ -81,6 +201,7 @@ compatible = "atmel,at91sam9260-pit"; reg = <0xfffffe30 0xf>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&mck>; }; shdwc at fffffe10 {
@@ -96,6 +217,8 @@ dma-names = "rxtx"; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 12>; + clock-names = "mci_clk"; status = "disabled"; };
@@ -103,12 +226,16 @@ compatible = "atmel,at91sam9x5-tcb"; reg = <0xf8008000 0x100>; interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 17>; + clock-names = "t0_clk"; }; tcb1: timer at f800c000 { compatible = "atmel,at91sam9x5-tcb"; reg = <0xf800c000 0x100>; interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 17>; + clock-names = "t0_clk"; }; dma: dma-controller at ffffec00 {
@@ -116,6 +243,8 @@ reg = <0xffffec00 0x200>; interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>; #dma-cells = <2>; + clocks = <&periph 20>; + clock-names = "dma_clk"; }; pinctrl at fffff400 {
@@ -369,6 +498,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 2>; }; pioB: gpio at fffff600 {
@@ -379,6 +509,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 2>; }; pioC: gpio at fffff800 {
@@ -389,6 +520,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 3>; }; pioD: gpio at fffffa00 {
@@ -399,6 +531,7 @@ gpio-controller; interrupt-controller; #interrupt-cells = <2>; + clocks = <&periph 3>; }; };
@@ -408,6 +541,8 @@ interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_dbgu>; + clocks = <&mck>; + clock-names = "usart"; status = "disabled"; };
@@ -417,6 +552,8 @@ interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; + clocks = <&periph 28>; + clock-names = "pclk"; status = "disabled"; };
@@ -426,6 +563,8 @@ interrupts = <5 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart0>; + clocks = <&periph 5>; + clock-names = "usart"; status = "disabled"; };
@@ -435,6 +574,8 @@ interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart1>; + clocks = <&periph 6>; + clock-names = "usart"; status = "disabled"; };
@@ -444,6 +585,8 @@ interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart2>; + clocks = <&periph 7>; + clock-names = "usart"; status = "disabled"; };
@@ -453,6 +596,8 @@ interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart3>; + clocks = <&periph 8>; + clock-names = "usart"; status = "disabled"; };
@@ -465,6 +610,7 @@ dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 10>; status = "disabled"; };
@@ -477,6 +623,7 @@ dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 9>; status = "disabled"; };
@@ -488,6 +635,8 @@ interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi0>; + clocks = <&periph 13>; + clock-names = "spi_clk"; status = "disabled"; };
@@ -499,6 +648,8 @@ interrupts = <14 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi1>; + clocks = <&periph 14>; + clock-names = "spi_clk"; status = "disabled"; };
@@ -534,6 +685,8 @@ compatible = "atmel,at91rm9200-ohci", "usb-ohci"; reg = <0x00500000 0x00100000>; interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 22>, <&periph 22>, <&system 6>; + clock-names = "ohci_clk", "hclk", "uhpck"; status = "disabled"; }; };
Signature · 1 line
1.7.9.5
RFC PATCH 41/50 ARM: at91/dt: move at91sam9x5 SoCs to new at91 clk implem
In reply to Boris BREZILLONDefine at91sam9x5 clocks in at91sam9x5 device tree.
Add references to the appropriate clocks in each peripheral. Split optional sam9x5 peripherals in several device tree files. These files are included by each SoC according to it's availability.
--- arch/arm/boot/dts/at91sam9g15.dtsi | 11 ++ arch/arm/boot/dts/at91sam9g25.dtsi | 3 + arch/arm/boot/dts/at91sam9g35.dtsi | 23 +++ arch/arm/boot/dts/at91sam9x25.dtsi | 25 +--- arch/arm/boot/dts/at91sam9x35.dtsi | 3 + arch/arm/boot/dts/at91sam9x5.dtsi | 226 +++++++++++++++++++++--------- arch/arm/boot/dts/at91sam9x5_can.dtsi | 24 ++++ arch/arm/boot/dts/at91sam9x5_isi.dtsi | 24 ++++ arch/arm/boot/dts/at91sam9x5_lcdc.dtsi | 32 +++++ arch/arm/boot/dts/at91sam9x5_macb0.dtsi | 68 +++++++++ arch/arm/boot/dts/at91sam9x5_macb1.dtsi | 56 ++++++++ arch/arm/boot/dts/at91sam9x5_usart3.dtsi | 60 ++++++++ 12 files changed, 467 insertions(+), 88 deletions(-)
arch/arm/boot/dts/at91sam9g15.dtsi +11 -0
@@ -7,6 +7,7 @@ */ #include "at91sam9x5.dtsi" +#include "at91sam9x5_lcdc.dtsi" / { model = "Atmel AT91SAM9G15 SoC";
@@ -23,6 +24,16 @@ 0x003fffff 0x003f8000 0x00000000 /* pioD */ >; }; + + pmc: pmc at fffffc00 { + at91sam9g15periph: at91sam9g15periphck { + compatible = "atmel,at91sam9x5-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <25>; + clock-output-names = "lcdc_clk"; + }; + }; }; }; };
arch/arm/boot/dts/at91sam9g25.dtsi +3 -0
@@ -7,6 +7,9 @@ */ #include "at91sam9x5.dtsi" +#include "at91sam9x5_usart3.dtsi" +#include "at91sam9x5_macb0.dtsi" +#include "at91sam9x5_isi.dtsi" / { model = "Atmel AT91SAM9G25 SoC";
arch/arm/boot/dts/at91sam9g35.dtsi +23 -0
@@ -7,6 +7,8 @@ */ #include "at91sam9x5.dtsi" +#include "at91sam9x5_macb0.dtsi" +#include "at91sam9x5_isi.dtsi" / { model = "Atmel AT91SAM9G35 SoC";
@@ -23,6 +25,27 @@ 0x003fffff 0x003f8000 0x00000000 /* pioD */ >; }; + + pmc: pmc at fffffc00 { + at91sam9g35periph: at91sam9g35periphck { + compatible = "atmel,at91sam9x5-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <24 25>; + clock-output-names = "macb_clk", "isi_clk"; + }; + }; + + macb0: ethernet at f802c000 { + compatible = "cdns,at32ap7000-macb", "cdns,macb"; + reg = <0xf802c000 0x100>; + interrupts = <24 4 3>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_macb0_rmii>; + clocks = <&at91sam9g35periph 24>, <&at91sam9g35periph 24>; + clock-names = "hclk", "pclk"; + status = "disabled"; + }; }; }; };
arch/arm/boot/dts/at91sam9x25.dtsi +4 -21
@@ -7,6 +7,10 @@ */ #include "at91sam9x5.dtsi" +#include "at91sam9x5_usart3.dtsi" +#include "at91sam9x5_macb0.dtsi" +#include "at91sam9x5_macb1.dtsi" +#include "at91sam9x5_can.dtsi" / { model = "Atmel AT91SAM9X25 SoC";
@@ -22,27 +26,6 @@ 0x80000000 0xfffd0000 0xb83fffff /* pioC */ 0x003fffff 0x003f8000 0x00000000 /* pioD */ >; - - macb1 { - pinctrl_macb1_rmii: macb1_rmii-0 { - atmel,pins = - <AT91_PIOC 16 AT91_PERIPH_B AT91_PINCTRL_NONE /* PC16 periph B */ - AT91_PIOC 18 AT91_PERIPH_B AT91_PINCTRL_NONE /* PC18 periph B */ - AT91_PIOC 19 AT91_PERIPH_B AT91_PINCTRL_NONE /* PC19 periph B */ - AT91_PIOC 20 AT91_PERIPH_B AT91_PINCTRL_NONE /* PC20 periph B */ - AT91_PIOC 21 AT91_PERIPH_B AT91_PINCTRL_NONE /* PC21 periph B */ - AT91_PIOC 27 AT91_PERIPH_B AT91_PINCTRL_NONE /* PC27 periph B */ - AT91_PIOC 28 AT91_PERIPH_B AT91_PINCTRL_NONE /* PC28 periph B */ - AT91_PIOC 29 AT91_PERIPH_B AT91_PINCTRL_NONE /* PC29 periph B */ - AT91_PIOC 30 AT91_PERIPH_B AT91_PINCTRL_NONE /* PC30 periph B */ - AT91_PIOC 31 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PC31 periph B */ - }; - }; - }; - - macb1: ethernet at f8030000 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_macb1_rmii>; }; }; };
arch/arm/boot/dts/at91sam9x35.dtsi +3 -0
@@ -7,6 +7,9 @@ */ #include "at91sam9x5.dtsi" +#include "at91sam9x5_macb0.dtsi" +#include "at91sam9x5_lcdc.dtsi" +#include "at91sam9x5_can.dtsi" / { model = "Atmel AT91SAM9X35 SoC";
arch/arm/boot/dts/at91sam9x5.dtsi +159 -67
388 lines not on this page · raw message
arch/arm/boot/dts/at91sam9x5_can.dtsi new file +24 -0
@@ -0,0 +1,24 @@ +/* + * at91sam9x5_can.dtsi - Device Tree Include file for AT91SAM9x5 SoC with + * CAN support. + * + * Copyright (C) 2013 Boris BREZILLON <[email protected]> + * + * Licensed under GPLv2. + */ + +/ { + ahb { + apb { + pmc: pmc at fffffc00 { + isiperiph: isiperiphck { + compatible = "atmel,at91sam9x5-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <29 30>; + clock-output-names = "can0_clk", "can1_clk"; + }; + }; + }; + }; +};
arch/arm/boot/dts/at91sam9x5_isi.dtsi new file +24 -0
@@ -0,0 +1,24 @@ +/* + * at91sam9x5_isi.dtsi - Device Tree Include file for AT91SAM9x5 SoC with + * ISI (Image Sensor Interface) support. + * + * Copyright (C) 2013 Boris BREZILLON <[email protected]> + * + * Licensed under GPLv2. + */ + +/ { + ahb { + apb { + pmc: pmc at fffffc00 { + isiperiph: isiperiphck { + compatible = "atmel,at91sam9x5-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <25>; + clock-output-names = "isi_clk"; + }; + }; + }; + }; +};
arch/arm/boot/dts/at91sam9x5_lcdc.dtsi new file +32 -0
@@ -0,0 +1,32 @@ +/* + * at91sam9x5_lcdc.dtsi - Device Tree Include file for AT91SAM9x5 SoC with + * LCDC (LCD controller) support. + * + * Copyright (C) 2013 Boris BREZILLON <[email protected]> + * + * Licensed under GPLv2. + */ + +/ { + ahb { + apb { + pmc: pmc at fffffc00 { + lcdsys: lcdsysck { + compatible = "atmel,at91rm9200-clk-system"; + #clock-cells = <1>; + ids = <3>; + clocks = <&mck>; + clock-output-names = "lcdck"; + }; + + lcdcperiph: lcdcperiphck { + compatible = "atmel,at91sam9x5-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <25>; + clock-output-names = "lcdc_clk"; + }; + }; + }; + }; +};
arch/arm/boot/dts/at91sam9x5_macb0.dtsi new file +68 -0
68 lines not on this page · raw message
arch/arm/boot/dts/at91sam9x5_macb1.dtsi new file +56 -0
56 lines not on this page · raw message
arch/arm/boot/dts/at91sam9x5_usart3.dtsi new file +60 -0
60 lines not on this page · raw message
Signature · 1 line
1.7.9.5
RFC PATCH 42/50 ARM: at91/dt: move at91sam9g20 SoC to new at91 clk implem
In reply to Boris BREZILLONDefine at91sam9g20 clocks in at91sam9g20 device tree. Add references to the appropriate clocks in each peripheral.
--- arch/arm/boot/dts/at91sam9g20.dtsi | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)
arch/arm/boot/dts/at91sam9g20.dtsi +37 -0
@@ -25,6 +25,43 @@ adc0: adc at fffe0000 { atmel,adc-startup-time = <40>; }; + + pmc: pmc at fffffc00 { + plla: pllack { + compatible = "atmel,at91sam9g45-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <0>; + input = <2000000 32000000>; + output = <74500000 800000000 + 69500000 750000000 + 64500000 700000000 + 59500000 650000000 + 54500000 600000000 + 49500000 550000000 + 44500000 500000000 + 40000000 450000000>; + out = <0 1 2 3 0 1 2 3>; + icpll = <0 0 0 0 1 1 1 1>; + }; + + pllb: pllbck { + compatible = "atmel,at91sam9g20-clk-pllb"; + #clock-cells = <0>; + clocks = <&main>; + id = <1>; + input = <2000000 32000000>; + output = <30000000 100000000>; + out = <0>; + }; + + mck: masterck { + #clock-cells = <0>; + clocks = <&clk32k>, <&main>, <&plla>, <&pllb>; + output = <0 133000000>; + divisors = <1 2 4 6>; + }; + }; }; }; };
Signature · 1 line
1.7.9.5
RFC PATCH 43/50 ARM: at91/dt: move sama5d3 SoCs to new at91 clk implem
In reply to Boris BREZILLONDefine sama5d3 clocks in sama5d3 device tree.
Add references to the appropriate clocks in each peripheral. Split optional sam9x5 peripherals in several device tree files. These files are included by each SoC according to it's availability.
--- arch/arm/boot/dts/sama5d3.dtsi | 358 +++++++++++++++-------------------- arch/arm/boot/dts/sama5d3_can.dtsi | 67 +++++++ arch/arm/boot/dts/sama5d3_emac.dtsi | 56 ++++++ arch/arm/boot/dts/sama5d3_gmac.dtsi | 89 +++++++++ arch/arm/boot/dts/sama5d3_lcd.dtsi | 73 +++++++ arch/arm/boot/dts/sama5d3_mci2.dtsi | 59 ++++++ arch/arm/boot/dts/sama5d3_tcb1.dtsi | 39 ++++ arch/arm/boot/dts/sama5d3_uart.dtsi | 42 ++++ 8 files changed, 580 insertions(+), 203 deletions(-)
arch/arm/boot/dts/sama5d3.dtsi +155 -203
@@ -30,7 +30,6 @@ gpio3 = &pioD; gpio4 = &pioE; tcb0 = &tcb0; - tcb1 = &tcb1; i2c0 = &i2c0; i2c1 = &i2c1; i2c2 = &i2c2;
@@ -70,6 +69,8 @@ status = "disabled"; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 21>; + clock-names = "mci_clk"; }; spi0: spi at f0004000 {
@@ -85,6 +86,8 @@ >; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi0>; + clocks = <&periph 24>; + clock-names = "spi_clk"; status = "disabled"; };
@@ -94,15 +97,8 @@ interrupts = <38 IRQ_TYPE_LEVEL_HIGH 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; - status = "disabled"; - }; - - can0: can at f000c000 { - compatible = "atmel,at91sam9x5-can"; - reg = <0xf000c000 0x300>; - interrupts = <40 IRQ_TYPE_LEVEL_HIGH 3>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_can0_rx_tx>; + clocks = <&periph 38>; + clock-names = "pclk"; status = "disabled"; };
@@ -110,6 +106,8 @@ compatible = "atmel,at91sam9x5-tcb"; reg = <0xf0010000 0x100>; interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&periph 26>; + clock-names = "t0_clk"; }; i2c0: i2c at f0014000 {
@@ -123,6 +121,7 @@ pinctrl-0 = <&pinctrl_i2c0>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 18>; status = "disabled"; };
@@ -137,6 +136,7 @@ pinctrl-0 = <&pinctrl_i2c1>; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 19>; status = "disabled"; };
@@ -146,6 +146,8 @@ interrupts = <12 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart0>; + clocks = <&periph 12>; + clock-names = "usart"; status = "disabled"; };
@@ -155,15 +157,8 @@ interrupts = <13 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart1>; - status = "disabled"; - }; - - macb0: ethernet at f0028000 { - compatible = "cnds,pc302-gem", "cdns,gem"; - reg = <0xf0028000 0x100>; - interrupts = <34 IRQ_TYPE_LEVEL_HIGH 3>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_macb0_data_rgmii &pinctrl_macb0_signal_rgmii>; + clocks = <&periph 13>; + clock-names = "usart"; status = "disabled"; };
@@ -187,19 +182,6 @@ #size-cells = <0>; }; - mmc2: mmc at f8004000 { - compatible = "atmel,hsmci"; - reg = <0xf8004000 0x600>; - interrupts = <23 IRQ_TYPE_LEVEL_HIGH 0>; - dmas = <&dma1 2 1>; - dma-names = "rxtx"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_mmc2_clk_cmd_dat0 &pinctrl_mmc2_dat1_3>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - spi1: spi at f8008000 { #address-cells = <1>; #size-cells = <0>;
@@ -213,6 +195,8 @@ >; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi1>; + clocks = <&periph 25>; + clock-names = "spi_clk"; status = "disabled"; };
@@ -222,23 +206,11 @@ interrupts = <39 IRQ_TYPE_LEVEL_HIGH 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>; + clocks = <&periph 39>; + clock-names = "pclk"; status = "disabled"; }; - can1: can at f8010000 { - compatible = "atmel,at91sam9x5-can"; - reg = <0xf8010000 0x300>; - interrupts = <41 IRQ_TYPE_LEVEL_HIGH 3>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_can1_rx_tx>; - }; - - tcb1: timer at f8014000 { - compatible = "atmel,at91sam9x5-tcb"; - reg = <0xf8014000 0x100>; - interrupts = <27 IRQ_TYPE_LEVEL_HIGH 0>; - }; - adc0: adc at f8018000 { compatible = "atmel,at91sam9260-adc"; reg = <0xf8018000 0x100>;
@@ -259,6 +231,8 @@ &pinctrl_adc0_ad10 &pinctrl_adc0_ad11 >; + clocks = <&periph 29>, <&adc_op_clk>; + clock-names = "adc_clk", "adc_op_clk"; atmel,adc-channel-base = <0x50>; atmel,adc-channels-used = <0xfff>; atmel,adc-drdy-mask = <0x1000000>;
@@ -314,6 +288,7 @@ dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; + clocks = <&periph 20>; status = "disabled"; };
@@ -323,6 +298,8 @@ interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart2>; + clocks = <&periph 14>; + clock-names = "usart"; status = "disabled"; };
@@ -332,15 +309,8 @@ interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart3>; - status = "disabled"; - }; - - macb1: ethernet at f802c000 { - compatible = "cdns,at32ap7000-macb", "cdns,macb"; - reg = <0xf802c000 0x100>; - interrupts = <35 IRQ_TYPE_LEVEL_HIGH 3>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_macb1_rmii>; + clocks = <&periph 15>; + clock-names = "usart"; status = "disabled"; };
@@ -367,6 +337,8 @@ reg = <0xffffe600 0x200>; interrupts = <30 IRQ_TYPE_LEVEL_HIGH 0>; #dma-cells = <2>; + clocks = <&periph 30>; + clock-names = "dma_clk"; }; dma1: dma-controller at ffffe800 {
@@ -374,6 +346,8 @@ reg = <0xffffe800 0x200>; interrupts = <31 IRQ_TYPE_LEVEL_HIGH 0>; #dma-cells = <2>; + clocks = <&periph 31>; + clock-names = "dma_clk"; }; ramc0: ramc at ffffea00 {
@@ -387,6 +361,8 @@ interrupts = <2 IRQ_TYPE_LEVEL_HIGH 7>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_dbgu>; + clocks = <&periph 2>; + clock-names = "usart"; status = "disabled"; };
@@ -468,22 +444,6 @@ }; }; - can0 { - pinctrl_can0_rx_tx: can0_rx_tx { - atmel,pins = - <AT91_PIOD 14 AT91_PERIPH_C AT91_PINCTRL_NONE /* PD14 periph C RX, conflicts with SCK0, SPI0_NPCS1 */ - AT91_PIOD 15 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PD15 periph C TX, conflicts with CTS0, SPI0_NPCS2 */ - }; - }; - - can1 { - pinctrl_can1_rx_tx: can1_rx_tx { - atmel,pins = - <AT91_PIOB 14 AT91_PERIPH_B AT91_PINCTRL_NONE /* PB14 periph B RX, conflicts with GCRS */ - AT91_PIOB 15 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB15 periph B TX, conflicts with GCOL */ - }; - }; - dbgu { pinctrl_dbgu: dbgu-0 { atmel,pins =
@@ -531,107 +491,6 @@ }; }; - lcd { - pinctrl_lcd: lcd-0 { - atmel,pins = - <AT91_PIOA 24 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA24 periph A LCDPWM */ - AT91_PIOA 26 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA26 periph A LCDVSYNC */ - AT91_PIOA 27 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA27 periph A LCDHSYNC */ - AT91_PIOA 25 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA25 periph A LCDDISP */ - AT91_PIOA 29 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA29 periph A LCDDEN */ - AT91_PIOA 28 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA28 periph A LCDPCK */ - AT91_PIOA 0 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA0 periph A LCDD0 pin */ - AT91_PIOA 1 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA1 periph A LCDD1 pin */ - AT91_PIOA 2 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA2 periph A LCDD2 pin */ - AT91_PIOA 3 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA3 periph A LCDD3 pin */ - AT91_PIOA 4 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA4 periph A LCDD4 pin */ - AT91_PIOA 5 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA5 periph A LCDD5 pin */ - AT91_PIOA 6 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA6 periph A LCDD6 pin */ - AT91_PIOA 7 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA7 periph A LCDD7 pin */ - AT91_PIOA 8 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA8 periph A LCDD8 pin */ - AT91_PIOA 9 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA9 periph A LCDD9 pin */ - AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA10 periph A LCDD10 pin */ - AT91_PIOA 11 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA11 periph A LCDD11 pin */ - AT91_PIOA 12 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA12 periph A LCDD12 pin */ - AT91_PIOA 13 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA13 periph A LCDD13 pin */ - AT91_PIOA 14 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA14 periph A LCDD14 pin */ - AT91_PIOA 15 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA15 periph A LCDD15 pin */ - AT91_PIOC 14 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC14 periph C LCDD16 pin */ - AT91_PIOC 13 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC13 periph C LCDD17 pin */ - AT91_PIOC 12 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC12 periph C LCDD18 pin */ - AT91_PIOC 11 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC11 periph C LCDD19 pin */ - AT91_PIOC 10 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC10 periph C LCDD20 pin */ - AT91_PIOC 15 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC15 periph C LCDD21 pin */ - AT91_PIOE 27 AT91_PERIPH_C AT91_PINCTRL_NONE /* PE27 periph C LCDD22 pin */ - AT91_PIOE 28 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PE28 periph C LCDD23 pin */ - }; - }; - - macb0 { - pinctrl_macb0_data_rgmii: macb0_data_rgmii { - atmel,pins = - <AT91_PIOB 0 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB0 periph A GTX0, conflicts with PWMH0 */ - AT91_PIOB 1 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB1 periph A GTX1, conflicts with PWML0 */ - AT91_PIOB 2 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB2 periph A GTX2, conflicts with TK1 */ - AT91_PIOB 3 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB3 periph A GTX3, conflicts with TF1 */ - AT91_PIOB 4 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB4 periph A GRX0, conflicts with PWMH1 */ - AT91_PIOB 5 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB5 periph A GRX1, conflicts with PWML1 */ - AT91_PIOB 6 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB6 periph A GRX2, conflicts with TD1 */ - AT91_PIOB 7 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB7 periph A GRX3, conflicts with RK1 */ - }; - pinctrl_macb0_data_gmii: macb0_data_gmii { - atmel,pins = - <AT91_PIOB 19 AT91_PERIPH_B AT91_PINCTRL_NONE /* PB19 periph B GTX4, conflicts with MCI1_CDA */ - AT91_PIOB 20 AT91_PERIPH_B AT91_PINCTRL_NONE /* PB20 periph B GTX5, conflicts with MCI1_DA0 */ - AT91_PIOB 21 AT91_PERIPH_B AT91_PINCTRL_NONE /* PB21 periph B GTX6, conflicts with MCI1_DA1 */ - AT91_PIOB 22 AT91_PERIPH_B AT91_PINCTRL_NONE /* PB22 periph B GTX7, conflicts with MCI1_DA2 */ - AT91_PIOB 23 AT91_PERIPH_B AT91_PINCTRL_NONE /* PB23 periph B GRX4, conflicts with MCI1_DA3 */ - AT91_PIOB 24 AT91_PERIPH_B AT91_PINCTRL_NONE /* PB24 periph B GRX5, conflicts with MCI1_CK */ - AT91_PIOB 25 AT91_PERIPH_B AT91_PINCTRL_NONE /* PB25 periph B GRX6, conflicts with SCK1 */ - AT91_PIOB 26 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB26 periph B GRX7, conflicts with CTS1 */ - }; - pinctrl_macb0_signal_rgmii: macb0_signal_rgmii { - atmel,pins = - <AT91_PIOB 8 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB8 periph A GTXCK, conflicts with PWMH2 */ - AT91_PIOB 9 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB9 periph A GTXEN, conflicts with PWML2 */ - AT91_PIOB 11 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB11 periph A GRXCK, conflicts with RD1 */ - AT91_PIOB 13 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB13 periph A GRXER, conflicts with PWML3 */ - AT91_PIOB 16 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB16 periph A GMDC */ - AT91_PIOB 17 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB17 periph A GMDIO */ - AT91_PIOB 18 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB18 periph A G125CK */ - }; - pinctrl_macb0_signal_gmii: macb0_signal_gmii { - atmel,pins = - <AT91_PIOB 9 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB9 periph A GTXEN, conflicts with PWML2 */ - AT91_PIOB 10 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB10 periph A GTXER, conflicts with RF1 */ - AT91_PIOB 11 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB11 periph A GRXCK, conflicts with RD1 */ - AT91_PIOB 12 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB12 periph A GRXDV, conflicts with PWMH3 */ - AT91_PIOB 13 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB13 periph A GRXER, conflicts with PWML3 */ - AT91_PIOB 14 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB14 periph A GCRS, conflicts with CANRX1 */ - AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB15 periph A GCOL, conflicts with CANTX1 */ - AT91_PIOB 16 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB16 periph A GMDC */ - AT91_PIOB 17 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB17 periph A GMDIO */ - AT91_PIOB 27 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB27 periph B G125CKO */ - }; - - }; - - macb1 { - pinctrl_macb1_rmii: macb1_rmii-0 { - atmel,pins = - <AT91_PIOC 0 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC0 periph A ETX0, conflicts with TIOA3 */ - AT91_PIOC 1 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC1 periph A ETX1, conflicts with TIOB3 */ - AT91_PIOC 2 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC2 periph A ERX0, conflicts with TCLK3 */ - AT91_PIOC 3 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC3 periph A ERX1, conflicts with TIOA4 */ - AT91_PIOC 4 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC4 periph A ETXEN, conflicts with TIOB4 */ - AT91_PIOC 5 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC5 periph A ECRSDV,conflicts with TCLK4 */ - AT91_PIOC 6 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC6 periph A ERXER, conflicts with TIOA5 */ - AT91_PIOC 7 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC7 periph A EREFCK, conflicts with TIOB5 */ - AT91_PIOC 8 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC8 periph A EMDC, conflicts with TCLK5 */ - AT91_PIOC 9 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PC9 periph A EMDIO */ - }; - }; - mmc0 { pinctrl_mmc0_clk_cmd_dat0: mmc0_clk_cmd_dat0 { atmel,pins =
@@ -669,21 +528,6 @@ }; }; - mmc2 { - pinctrl_mmc2_clk_cmd_dat0: mmc2_clk_cmd_dat0 { - atmel,pins = - <AT91_PIOC 15 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC15 periph A MCI2_CK, conflicts with PCK2 */ - AT91_PIOC 10 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PC10 periph A MCI2_CDA with pullup */ - AT91_PIOC 11 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* PC11 periph A MCI2_DA0 with pullup */ - }; - pinctrl_mmc2_dat1_3: mmc2_dat1_3 { - atmel,pins = - <AT91_PIOC 12 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC12 periph A MCI2_DA1 with pullup, conflicts with TIOA1 */ - AT91_PIOC 13 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC13 periph A MCI2_DA2 with pullup, conflicts with TIOB1 */ - AT91_PIOC 14 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PC14 periph A MCI2_DA3 with pullup, conflicts with TCLK1 */ - }; - }; - nand0 { pinctrl_nand0_ale_cle: nand0_ale_cle-0 { atmel,pins =
@@ -742,22 +586,6 @@ }; }; - uart0 { - pinctrl_uart0: uart0-0 { - atmel,pins = - <AT91_PIOC 29 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC29 periph A, conflicts with PWMFI2, ISI_D8 */ - AT91_PIOC 30 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* PC30 periph A with pullup, conflicts with ISI_PCK */ - }; - }; - - uart1 { - pinctrl_uart1: uart1-0 { - atmel,pins = - <AT91_PIOA 30 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA30 periph B, conflicts with TWD0, ISI_VSYNC */ - AT91_PIOA 31 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>; /* PA31 periph B with pullup, conflicts with TWCK0, ISI_HSYNC */ - }; - }; - usart0 { pinctrl_usart0: usart0-0 { atmel,pins =
@@ -869,6 +697,125 @@ pmc: pmc at fffffc00 { compatible = "atmel,at91rm9200-pmc"; reg = <0xfffffc00 0x120>; + + clk32k: slck { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + main: mainck { + compatible = "atmel,at91rm9200-clk-main", "fixed-clock"; + #clock-cells = <0>; + clocks = <&clk32k>; + }; + + plla: pllack { + compatible = "atmel,sama5d3-clk-pll"; + #clock-cells = <0>; + clocks = <&main>; + id = <0>; + input = <8000000 50000000>; + output = <400000000 1000000000>; + out = <0>; + icpll = <0>; + }; + + plladiv: plladivck { + compatible = "atmel,at91sam9x5-clk-plldiv"; + #clock-cells = <0>; + clocks = <&plla>; + }; + + utmi: utmick { + compatible = "atmel,at91sam9x5-clk-utmi"; + #clock-cells = <0>; + clocks = <&main>; + }; + + mck: masterck { + compatible = "atmel,at91sam9x5-clk-master"; + #clock-cells = <0>; + clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>; + output = <0 166000000>; + divisors = <1 2 4 3>; + }; + + usb: usbck { + compatible = "atmel,at91sam9x5-clk-usb"; + #clock-cells = <0>; + clocks = <&plladiv>, <&utmi>; + }; + + prog: progck { + compatible = "atmel,at91sam9x5-clk-programmable"; + #clock-cells = <1>; + ids = <0 1 2>; + clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>, <&mck>; + clock-output-names = "prog0", "prog1", "prog2"; + }; + + smd: smdck { + compatible = "atmel,at91sam9x5-clk-smd"; + #clock-cells = <0>; + clocks = <&plladiv>, <&utmi>; + }; + + system: systemck { + compatible = "atmel,at91rm9200-clk-system"; + #clock-cells = <1>; + ids = <2 4 6 7 8 9 10>; + clocks = <&mck>, <&smd>, <&usb>, <&usb>, + <&prog 0>, <&prog 1>, <&prog 2>; + clock-output-names = "ddrck", "smdck", "uhpck", "udpck", + "pck0", "pck1", "pck2"; + }; + + periph: periphck { + compatible = "atmel,at91sam9x5-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <2 6 7 8 9 10 12 13 14 15 18 19 20 21 22 23 24 + 25 26 28 29 37 38 39 42 43 44 45 48>; + clock-output-names = "pioA_clk", + "pioB_clk", + "pioB_clk", + "pioD_clk", + "pioE_clk", + "usart0_clk", + "usart1_clk", + "usart2_clk", + "usart3_clk", + "twi0_clk", + "twi1_clk", + "twi2_clk", + "mci0_clk", + "mci1_clk", + "mci2_clk", + "spi0_clk", + "spi1_clk", + "tcb0_clk", + "pwm_clk", + "adc_clk", + "dma0_clk", + "dma1_clk", + "uhphs_clk", + "udphs_clk", + "isi_clk", + "ssc0_clk", + "ssc1_clk", + "sha_clk", + "aes_clk", + "tdes_clk", + "trng_clk", + "fuse_clk"; + + adc_op_clk: adc_op_clk{ + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <20000000>; + }; + }; }; rstc at fffffe00 {
@@ -880,6 +827,7 @@ compatible = "atmel,at91sam9260-pit"; reg = <0xfffffe30 0xf>; interrupts = <3 IRQ_TYPE_LEVEL_HIGH 5>; + clocks = <&mck>; }; watchdog at fffffe40 {
@@ -1014,6 +962,8 @@ compatible = "atmel,at91rm9200-ohci", "usb-ohci"; reg = <0x00600000 0x100000>; interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 32>, <&periph 32>, <&system 6>; + clock-names = "ohci_clk", "hclk", "uhpck"; status = "disabled"; };
@@ -1021,6 +971,8 @@ compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; reg = <0x00700000 0x100000>; interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&periph 32>, <&system 6>; + clock-names = "ehci_clk", "uhpck"; status = "disabled"; };
arch/arm/boot/dts/sama5d3_can.dtsi new file +67 -0
67 lines not on this page · raw message
arch/arm/boot/dts/sama5d3_emac.dtsi new file +56 -0
56 lines not on this page · raw message
arch/arm/boot/dts/sama5d3_gmac.dtsi new file +89 -0
89 lines not on this page · raw message
arch/arm/boot/dts/sama5d3_lcd.dtsi new file +73 -0
73 lines not on this page · raw message
arch/arm/boot/dts/sama5d3_mci2.dtsi new file +59 -0
59 lines not on this page · raw message
arch/arm/boot/dts/sama5d3_tcb1.dtsi new file +39 -0
@@ -0,0 +1,39 @@ +/* + * at91sama5d3_tcb1.dtsi - Device Tree Include file for AT91SAM9x5 SoC with + * 2 TC blocks. + * + * Copyright (C) 2013 Boris BREZILLON <[email protected]> + * + * Licensed under GPLv2. + */ + +#include <dt-bindings/pinctrl/at91.h> +#include <dt-bindings/interrupt-controller/irq.h> + +/ { + aliases { + tcb1 = &tcb1; + }; + + ahb { + apb { + pmc: pmc at fffffc00 { + tcb1periph: tcb1periphck { + compatible = "atmel,at91sam9x5-clk-peripheral"; + #clock-cells = <1>; + clocks = <&mck>; + ids = <27>; + clock-output-names = "tcb1_clk"; + }; + }; + + tcb1: timer at f8014000 { + compatible = "atmel,at91sam9x5-tcb"; + reg = <0xf8014000 0x100>; + interrupts = <27 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&tcb1periph 27>; + clock-names = "t0_clk"; + }; + }; + }; +};
arch/arm/boot/dts/sama5d3_uart.dtsi new file +42 -0
42 lines not on this page · raw message
Signature · 1 line
1.7.9.5
RFC PATCH 44/50 ARM: at91/dt: move sam9260/sam9g20 to new at91 clk implem
In reply to Boris BREZILLONDefine the main clock frequency in every sam9260/sam9g20 boards. Remove the old main clock definition.
--- arch/arm/boot/dts/animeo_ip.dts | 17 ++++++----------- arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 17 ++++++----------- arch/arm/boot/dts/ge863-pro3.dtsi | 16 ++++++---------- arch/arm/boot/dts/kizbox.dts | 5 +++++ arch/arm/boot/dts/tny_a9260_common.dtsi | 17 ++++++----------- arch/arm/boot/dts/usb_a9260_common.dtsi | 17 ++++++----------- 6 files changed, 35 insertions(+), 54 deletions(-)
arch/arm/boot/dts/animeo_ip.dts +6 -11
@@ -31,17 +31,6 @@ reg = <0x20000000 0x4000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <18432000>; - }; - }; - ahb { apb { usart0: serial at fffb0000 {
@@ -82,6 +71,12 @@ watchdog at fffffd40 { status = "okay"; }; + + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <18432000>; + }; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/at91sam9g20ek_common.dtsi +6 -11
@@ -17,17 +17,6 @@ reg = <0x20000000 0x4000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <18432000>; - }; - }; - ahb { apb { pinctrl at fffff400 {
@@ -108,6 +97,12 @@ watchdog at fffffd40 { status = "okay"; }; + + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <18432000>; + }; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/ge863-pro3.dtsi +6 -10
@@ -10,22 +10,18 @@ #include "at91sam9260.dtsi" / { - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <6000000>; - }; - }; ahb { apb { dbgu: serial at fffff200 { status = "okay"; }; + + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <6000000>; + }; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/kizbox.dts +5 -0
@@ -53,6 +53,11 @@ status = "okay"; }; + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <18432000>; + }; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/tny_a9260_common.dtsi +6 -11
@@ -15,22 +15,17 @@ reg = <0x20000000 0x4000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <12000000>; - }; - }; - ahb { apb { dbgu: serial at fffff200 { status = "okay"; }; + + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <12000000>; + }; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/usb_a9260_common.dtsi +6 -11
@@ -7,17 +7,6 @@ */ / { - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <12000000>; - }; - }; - ahb { apb { dbgu: serial at fffff200 {
@@ -33,6 +22,12 @@ atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>; status = "okay"; }; + + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <12000000>; + }; + }; }; nand0: nand at 40000000 {
Signature · 1 line
1.7.9.5
RFC PATCH 45/50 ARM: at91/dt: move rm9200 boards to new at91 clk implem
In reply to Boris BREZILLONDefine the main clock frequency in every at91rm9200 boards. Remove the old main clock definition.
--- arch/arm/boot/dts/at91rm9200ek.dts | 17 ++++++----------- arch/arm/boot/dts/mpa1600.dts | 16 +++++----------- 2 files changed, 11 insertions(+), 22 deletions(-)
arch/arm/boot/dts/at91rm9200ek.dts +6 -11
@@ -16,19 +16,14 @@ reg = <0x20000000 0x4000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <18432000>; - }; - }; - ahb { apb { + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <18432000>; + }; + }; + dbgu: serial at fffff200 { status = "okay"; };
arch/arm/boot/dts/mpa1600.dts +5 -11
@@ -16,17 +16,6 @@ reg = <0x20000000 0x4000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <18432000>; - }; - }; - ahb { apb { dbgu: serial at fffff200 {
@@ -45,6 +34,11 @@ ssc1: ssc at fffd4000 { status = "okay"; }; + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <18432000>; + }; + }; }; usb0: ohci at 00300000 {
Signature · 1 line
1.7.9.5
RFC PATCH 45/50 ARM: at91/dt: move rm9200 boards to new at91 clk implem
In reply to Boris BREZILLONDefine the main clock frequency in every at91rm9200 boards. Remove the old main clock definition.
--- arch/arm/boot/dts/at91rm9200ek.dts | 17 ++++++----------- arch/arm/boot/dts/mpa1600.dts | 16 +++++----------- 2 files changed, 11 insertions(+), 22 deletions(-)
arch/arm/boot/dts/at91rm9200ek.dts +6 -11
@@ -16,19 +16,14 @@ reg = <0x20000000 0x4000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <18432000>; - }; - }; - ahb { apb { + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <18432000>; + }; + }; + dbgu: serial at fffff200 { status = "okay"; };
arch/arm/boot/dts/mpa1600.dts +5 -11
@@ -16,17 +16,6 @@ reg = <0x20000000 0x4000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <18432000>; - }; - }; - ahb { apb { dbgu: serial at fffff200 {
@@ -45,6 +34,11 @@ ssc1: ssc at fffd4000 { status = "okay"; }; + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <18432000>; + }; + }; }; usb0: ohci at 00300000 {
Signature · 1 line
1.7.9.5
RFC PATCH 46/50 ARM: at91/dt: move sam9263 boards to new at91 clk implem
In reply to Boris BREZILLONDefine the main clock frequency in every at91sam9263 boards. Remove the old main clock definition.
--- arch/arm/boot/dts/at91sam9263ek.dts | 17 ++++++----------- arch/arm/boot/dts/tny_a9263.dts | 17 ++++++----------- arch/arm/boot/dts/usb_a9263.dts | 17 ++++++----------- 3 files changed, 18 insertions(+), 33 deletions(-)
arch/arm/boot/dts/at91sam9263ek.dts +6 -11
@@ -20,17 +20,6 @@ reg = <0x20000000 0x4000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <16367660>; - }; - }; - ahb { apb { dbgu: serial at ffffee00 {
@@ -93,6 +82,12 @@ watchdog at fffffd40 { status = "okay"; }; + + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <16367660>; + }; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/tny_a9263.dts +6 -11
@@ -20,17 +20,6 @@ reg = <0x20000000 0x4000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <12000000>; - }; - }; - ahb { apb { dbgu: serial at ffffee00 {
@@ -41,6 +30,12 @@ atmel,vbus-gpio = <&pioB 11 GPIO_ACTIVE_HIGH>; status = "okay"; }; + + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <12000000>; + }; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/usb_a9263.dts +6 -11
@@ -20,17 +20,6 @@ reg = <0x20000000 0x4000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <12000000>; - }; - }; - ahb { apb { dbgu: serial at ffffee00 {
@@ -61,6 +50,12 @@ atmel,wakeup-counter = <10>; atmel,wakeup-rtt-timer; }; + + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <12000000>; + }; + }; }; nand0: nand at 40000000 {
Signature · 1 line
1.7.9.5
RFC PATCH 47/50 ARM: at91/dt: move sam9g45 boards to new at91 clk implem
In reply to Boris BREZILLONDefine the main clock frequency in every at91sam9g45 boards. Remove the old main clock definition.
--- arch/arm/boot/dts/at91sam9m10g45ek.dts | 17 ++++++----------- arch/arm/boot/dts/pm9g45.dts | 16 +++++----------- 2 files changed, 11 insertions(+), 22 deletions(-)
arch/arm/boot/dts/at91sam9m10g45ek.dts +6 -11
@@ -21,17 +21,6 @@ reg = <0x70000000 0x4000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <12000000>; - }; - }; - ahb { apb { dbgu: serial at ffffee00 {
@@ -116,6 +105,12 @@ reg = <0>; }; }; + + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <12000000>; + }; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/pm9g45.dts +5 -11
@@ -20,17 +20,6 @@ reg = <0x70000000 0x8000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <12000000>; - }; - }; - ahb { apb { dbgu: serial at ffffee00 {
@@ -73,6 +62,11 @@ status = "okay"; }; + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <12000000>; + }; + }; }; nand0: nand at 40000000 {
Signature · 1 line
1.7.9.5
RFC PATCH 48/50 ARM: at91/dt: move sam9n12 boards to new at91 clk implem
In reply to Boris BREZILLONDefine the main clock frequency in every at91sam9n12 boards. Remove the old main clock definition.
--- arch/arm/boot/dts/at91sam9n12ek.dts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
arch/arm/boot/dts/at91sam9n12ek.dts +6 -11
@@ -21,17 +21,6 @@ reg = <0x20000000 0x10000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <16000000>; - }; - }; - ahb { apb { dbgu: serial at fffff200 {
@@ -81,6 +70,12 @@ watchdog at fffffe40 { status = "okay"; }; + + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <16000000>; + }; + }; }; nand0: nand at 40000000 {
Signature · 1 line
1.7.9.5
RFC PATCH 49/50 ARM: at91/dt: move sam9x5 boards to new at91 clk implem
In reply to Boris BREZILLONDefine the main clock frequency in every at91sam9x5 boards. Remove the old main clock definition.
--- arch/arm/boot/dts/at91-ariag25.dts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
arch/arm/boot/dts/at91-ariag25.dts +6 -11
@@ -33,17 +33,6 @@ reg = <0x20000000 0x8000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <12000000>; - }; - }; - ahb { apb { mmc0: mmc at f0008000 {
@@ -147,6 +136,12 @@ rtc at fffffeb0 { status = "okay"; }; + + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <12000000>; + }; + }; }; usb0: ohci at 00600000 {
Signature · 1 line
1.7.9.5
RFC PATCH 50/50 ARM: at91/dt: move sama5d3 boards to new at91 clk implem
In reply to Boris BREZILLONDefine the main clock frequency in every sama5d3 boards. Remove the old main clock definition.
Include the appropriate peripheral options according to peripherals availability.
--- arch/arm/boot/dts/sama5d31ek.dts | 4 ++++ arch/arm/boot/dts/sama5d33ek.dts | 2 ++ arch/arm/boot/dts/sama5d34ek.dts | 4 ++++ arch/arm/boot/dts/sama5d35ek.dts | 6 ++++++ arch/arm/boot/dts/sama5d3xcm.dtsi | 17 ++++++----------- 5 files changed, 22 insertions(+), 11 deletions(-)
arch/arm/boot/dts/sama5d31ek.dts +4 -0
@@ -7,6 +7,10 @@ * Licensed under GPLv2 or later. */ /dts-v1/; +#include "sama5d3_lcd.dtsi" +#include "sama5d3_emac.dtsi" +#include "sama5d3_mci2.dtsi" +#include "sama5d3_uart.dtsi" #include "sama5d3xmb.dtsi" #include "sama5d3xdm.dtsi"
arch/arm/boot/dts/sama5d33ek.dts +2 -0
@@ -7,6 +7,8 @@ * Licensed under GPLv2 or later. */ /dts-v1/; +#include "sama5d3_lcd.dtsi" +#include "sama5d3_gmac.dtsi" #include "sama5d3xmb.dtsi" #include "sama5d3xdm.dtsi"
arch/arm/boot/dts/sama5d34ek.dts +4 -0
@@ -7,6 +7,10 @@ * Licensed under GPLv2 or later. */ /dts-v1/; +#include "sama5d3_lcd.dtsi" +#include "sama5d3_gmac.dtsi" +#include "sama5d3_can.dtsi" +#include "sama5d3_mci2.dtsi" #include "sama5d3xmb.dtsi" #include "sama5d3xdm.dtsi"
arch/arm/boot/dts/sama5d35ek.dts +6 -0
@@ -7,6 +7,12 @@ * Licensed under GPLv2 or later. */ /dts-v1/; +#include "sama5d3_gmac.dtsi" +#include "sama5d3_emac.dtsi" +#include "sama5d3_can.dtsi" +#include "sama5d3_mci2.dtsi" +#include "sama5d3_uart.dtsi" +#include "sama5d3_tcb1.dtsi" #include "sama5d3xmb.dtsi" / {
arch/arm/boot/dts/sama5d3xcm.dtsi +6 -11
@@ -19,22 +19,17 @@ reg = <0x20000000 0x20000000>; }; - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - main_clock: clock at 0 { - compatible = "atmel,osc", "fixed-clock"; - clock-frequency = <12000000>; - }; - }; - ahb { apb { macb0: ethernet at f0028000 { phy-mode = "rgmii"; }; + + pmc: pmc at fffffc00 { + main: mainck { + clock-frequency = <12000000>; + }; + }; }; nand0: nand at 60000000 {
Signature · 1 line
1.7.9.5