Commit dc6aaa57 authored by Tony Lindgren's avatar Tony Lindgren

ARM: OMAP: Split clocks.c into plat-omap/clock.c and mach-omap1/clock.c

This patch contains the following changes:

- Move omap1 specific clock code into mach-omap1/clock.c leaving only
  common code shared between omap1 and omap2 to plat-omap/clock.c.

- Move clock.h and sram.h header files to include/asm-arm/arch-omap/

- Change clock init to register omap1 specific functions with
  plat-omap/clock.c

- Some clean-up of code

This patch makes no functional changes to omap1 clocks.
parent a56be91b
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
# Common support # Common support
obj-y := io.o id.o irq.o time.o mux.o serial.o devices.o obj-y := io.o id.o clock.o irq.o time.o mux.o serial.o devices.o
led-y := leds.o led-y := leds.o
# Specific board support # Specific board support
......
This diff is collapsed.
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <asm/arch/mux.h> #include <asm/arch/mux.h>
#include <asm/arch/tc.h> #include <asm/arch/tc.h>
extern int clk_init(void); extern int omap1_clk_init(void);
extern void omap_check_revision(void); extern void omap_check_revision(void);
extern void omap_sram_init(void); extern void omap_sram_init(void);
...@@ -88,7 +88,7 @@ static void __init _omap_map_io(void) ...@@ -88,7 +88,7 @@ static void __init _omap_map_io(void)
/* Must init clocks early to assure that timer interrupt works /* Must init clocks early to assure that timer interrupt works
*/ */
clk_init(); omap1_clk_init();
} }
/* /*
......
This diff is collapsed.
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <asm/arch/mux.h> #include <asm/arch/mux.h>
#include <asm/arch/fpga.h> #include <asm/arch/fpga.h>
#include "clock.h" #include <asm/arch/clock.h>
#define NO_LENGTH_CHECK 0xffffffff #define NO_LENGTH_CHECK 0xffffffff
......
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
#include <asm/arch/tps65010.h> #include <asm/arch/tps65010.h>
#include <asm/arch/dsp_common.h> #include <asm/arch/dsp_common.h>
#include "clock.h" #include <asm/arch/clock.h>
#include "sram.h" #include <asm/arch/sram.h>
static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE]; static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE];
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include "sram.h" #include <asm/arch/sram.h>
#define OMAP1_SRAM_BASE 0xd0000000 #define OMAP1_SRAM_BASE 0xd0000000
#define OMAP1_SRAM_START 0x20000000 #define OMAP1_SRAM_START 0x20000000
......
/* /*
* linux/arch/arm/plat-omap/clock.h * linux/include/asm-arm/arch-omap/clock.h
* *
* Copyright (C) 2004 Nokia corporation * Copyright (C) 2004 - 2005 Nokia corporation
* Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
* Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
* *
...@@ -34,15 +34,28 @@ struct clk { ...@@ -34,15 +34,28 @@ struct clk {
void (*disable)(struct clk *); void (*disable)(struct clk *);
}; };
struct clk_functions {
struct mpu_rate { int (*clk_use)(struct clk *clk);
unsigned long rate; void (*clk_unuse)(struct clk *clk);
unsigned long xtal; long (*clk_round_rate)(struct clk *clk, unsigned long rate);
unsigned long pll_rate; int (*clk_set_rate)(struct clk *clk, unsigned long rate);
__u16 ckctl_val; int (*clk_set_parent)(struct clk *clk, struct clk *parent);
__u16 dpllctl_val; struct clk * (*clk_get_parent)(struct clk *clk);
void (*clk_allow_idle)(struct clk *clk);
void (*clk_deny_idle)(struct clk *clk);
}; };
extern spinlock_t clockfw_lock;
extern int clk_init(struct clk_functions * custom_clocks);
extern int clk_register(struct clk *clk);
extern void clk_unregister(struct clk *clk);
extern void propagate_rate(struct clk *clk);
extern void followparent_recalc(struct clk * clk);
/*-------------------------------------------------------------------------
* Defines for omap1 clocks
*-------------------------------------------------------------------------*/
/* Clock flags */ /* Clock flags */
#define RATE_CKCTL 1 #define RATE_CKCTL 1
...@@ -54,9 +67,9 @@ struct mpu_rate { ...@@ -54,9 +67,9 @@ struct mpu_rate {
#define CLOCK_IN_OMAP16XX 64 #define CLOCK_IN_OMAP16XX 64
#define CLOCK_IN_OMAP1510 128 #define CLOCK_IN_OMAP1510 128
#define CLOCK_IN_OMAP730 256 #define CLOCK_IN_OMAP730 256
#define VIRTUAL_IO_ADDRESS 1024 #define VIRTUAL_IO_ADDRESS 512
#define CLOCK_IDLE_CONTROL 2048 #define CLOCK_IDLE_CONTROL 1024
#define CLOCK_NO_IDLE_PARENT 4096 #define CLOCK_NO_IDLE_PARENT 2048
/* ARM_CKCTL bit shifts */ /* ARM_CKCTL bit shifts */
#define CKCTL_PERDIV_OFFSET 0 #define CKCTL_PERDIV_OFFSET 0
...@@ -116,8 +129,9 @@ struct mpu_rate { ...@@ -116,8 +129,9 @@ struct mpu_rate {
#define SOFT_REQ_REG 0xfffe0834 #define SOFT_REQ_REG 0xfffe0834
#define SOFT_REQ_REG2 0xfffe0880 #define SOFT_REQ_REG2 0xfffe0880
int clk_register(struct clk *clk); /*-------------------------------------------------------------------------
void clk_unregister(struct clk *clk); * Defines for omap2 clocks
int clk_init(void); *-------------------------------------------------------------------------*/
#endif #endif
/* /*
* linux/arch/arm/plat-omap/sram.h * linux/include/asm-arm/arch-omap/sram.h
* *
* Interface for functions that need to be run in internal SRAM * Interface for functions that need to be run in internal SRAM
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment