Skip to content

Commit

Permalink
ARM: nomadik: convert to generic clock
Browse files Browse the repository at this point in the history
Remove more custom stuff by simply converting the Nomadik machine
to use generic clocks and move the driver to drivers/clk.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Mike Turquette <mturquette@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Linus Walleij committed Jun 10, 2012
1 parent b5111d9 commit 4a31bd2
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 95 deletions.
2 changes: 1 addition & 1 deletion arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ config ARCH_NOMADIK
select ARM_AMBA
select ARM_VIC
select CPU_ARM926T
select CLKDEV_LOOKUP
select COMMON_CLK
select GENERIC_CLOCKEVENTS
select PINCTRL
select MIGHT_HAVE_CACHE_L2X0
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-nomadik/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

# Object file lists.

obj-y += clock.o

# Cpu revision
obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o

Expand Down
75 changes: 0 additions & 75 deletions arch/arm/mach-nomadik/clock.c

This file was deleted.

15 changes: 0 additions & 15 deletions arch/arm/mach-nomadik/clock.h

This file was deleted.

4 changes: 2 additions & 2 deletions arch/arm/mach-nomadik/cpu-8815.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/slab.h>
#include <linux/irq.h>
#include <linux/dma-mapping.h>
#include <linux/platform_data/clk-nomadik.h>

#include <plat/gpio-nomadik.h>
#include <mach/hardware.h>
Expand All @@ -35,7 +36,6 @@
#include <asm/cacheflush.h>
#include <asm/hardware/cache-l2x0.h>

#include "clock.h"
#include "cpu-8815.h"

/* The 8815 has 4 GPIO blocks, let's register them immediately */
Expand Down Expand Up @@ -123,7 +123,7 @@ void __init cpu8815_init_irq(void)
* Init clocks here so that they are available for system timer
* initialization.
*/
clk_init();
nomadik_clk_init();
}

/*
Expand Down
1 change: 1 addition & 0 deletions drivers/clk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ obj-$(CONFIG_CLKDEV_LOOKUP) += clkdev.o
obj-$(CONFIG_COMMON_CLK) += clk.o clk-fixed-rate.o clk-gate.o \
clk-mux.o clk-divider.o clk-fixed-factor.o
# SoCs specific
obj-$(CONFIG_ARCH_NOMADIK) += clk-nomadik.o
obj-$(CONFIG_ARCH_MXS) += mxs/
obj-$(CONFIG_PLAT_SPEAR) += spear/
47 changes: 47 additions & 0 deletions drivers/clk/clk-nomadik.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/clk-provider.h>

/*
* The Nomadik clock tree is described in the STN8815A12 DB V4.2
* reference manual for the chip, page 94 ff.
*/

void __init nomadik_clk_init(void)
{
struct clk *clk;

clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT, 0);
clk_register_clkdev(clk, "apb_pclk", NULL);
clk_register_clkdev(clk, NULL, "gpio.0");
clk_register_clkdev(clk, NULL, "gpio.1");
clk_register_clkdev(clk, NULL, "gpio.2");
clk_register_clkdev(clk, NULL, "gpio.3");
clk_register_clkdev(clk, NULL, "rng");

/*
* The 2.4 MHz TIMCLK reference clock is active at boot time, this is
* actually the MXTALCLK @19.2 MHz divided by 8. This clock is used
* by the timers and watchdog. See page 105 ff.
*/
clk = clk_register_fixed_rate(NULL, "TIMCLK", NULL, CLK_IS_ROOT,
2400000);
clk_register_clkdev(clk, NULL, "mtu0");
clk_register_clkdev(clk, NULL, "mtu1");

/*
* At boot time, PLL2 is set to generate a set of fixed clocks,
* one of them is CLK48, the 48 MHz clock, routed to the UART, MMC/SD
* I2C, IrDA, USB and SSP blocks.
*/
clk = clk_register_fixed_rate(NULL, "CLK48", NULL, CLK_IS_ROOT,
48000000);
clk_register_clkdev(clk, NULL, "uart0");
clk_register_clkdev(clk, NULL, "uart1");
clk_register_clkdev(clk, NULL, "mmci");
clk_register_clkdev(clk, NULL, "ssp");
clk_register_clkdev(clk, NULL, "nmk-i2c.0");
clk_register_clkdev(clk, NULL, "nmk-i2c.1");
}
2 changes: 2 additions & 0 deletions include/linux/platform_data/clk-nomadik.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Minimal platform data header */
void nomadik_clk_init(void);

0 comments on commit 4a31bd2

Please sign in to comment.