11 #include <linux/kernel.h>
23 #include <asm/timex.h>
24 #include <asm/kexec.h>
28 #include <mach/bridge-regs.h>
34 #include <plat/common.h>
61 static void enable_sata0(
void)
69 static void disable_sata0(
void)
77 static void enable_sata1(
void)
85 static void disable_sata1(
void)
93 static void disable_pcie0(
void)
102 static void disable_pcie1(
void)
126 #define to_clk_gate_fn(_gate) container_of(_gate, struct clk_gate_fn, gate)
127 #define to_clk_gate(_hw) container_of(_hw, struct clk_gate, hw)
129 static int clk_gate_fn_enable(
struct clk_hw *
hw)
136 if (!ret && gate_fn->
fn_en)
142 static void clk_gate_fn_disable(
struct clk_hw *
hw)
153 static struct clk_ops clk_gate_fn_ops;
157 const char *parent_name,
unsigned long flags,
160 void (*fn_en)(
void),
void (*fn_dis)(
void))
164 struct clk_init_data
init;
168 pr_err(
"%s: could not allocate gated clk\n", __func__);
173 init.ops = &clk_gate_fn_ops;
175 init.parent_names = (parent_name ? &parent_name :
NULL);
176 init.num_parents = (parent_name ? 1 : 0);
179 gate_fn->gate.reg =
reg;
180 gate_fn->gate.bit_idx = bit_idx;
181 gate_fn->gate.flags = clk_gate_flags;
182 gate_fn->gate.lock = lock;
183 gate_fn->gate.hw.init = &
init;
184 gate_fn->fn_en = fn_en;
185 gate_fn->fn_dis = fn_dis;
188 if (clk_gate_fn_ops.enable != clk_gate_fn_enable ||
189 clk_gate_fn_ops.disable != clk_gate_fn_disable) {
191 clk_gate_fn_ops.enable = clk_gate_fn_enable;
192 clk_gate_fn_ops.disable = clk_gate_fn_disable;
204 static struct clk *tclk;
206 static struct clk
__init *kirkwood_register_gate(
const char *name,
u8 bit_idx)
209 bit_idx, 0, &gating_lock);
212 static struct clk
__init *kirkwood_register_gate_fn(
const char *name,
215 void (*fn_dis)(
void))
218 bit_idx, 0, &gating_lock, fn_en, fn_dis);
221 static struct clk *ge0, *ge1;
225 struct clk *runit, *sata0, *sata1, *
usb0, *sdio;
226 struct clk *crypto, *xor0, *xor1, *pex0, *pex1, *
audio;
235 enable_sata0, disable_sata0);
237 enable_sata1, disable_sata1);
244 NULL, disable_pcie0);
246 NULL, disable_pcie1);
273 clk_prepare_enable(runit);
295 clk_prepare_enable(ge0);
307 clk_prepare_enable(ge1);
323 static struct resource kirkwood_nand_resource = {
337 .name =
"orion_nand",
340 .platform_data = &kirkwood_nand_data,
342 .resource = &kirkwood_nand_resource,
349 kirkwood_nand_data.
parts = parts;
350 kirkwood_nand_data.
nr_parts = nr_parts;
356 int (*dev_ready)(
struct mtd_info *))
358 kirkwood_nand_data.
parts = parts;
359 kirkwood_nand_data.
nr_parts = nr_parts;
360 kirkwood_nand_data.
dev_ready = dev_ready;
367 static void __init kirkwood_rtc_init(
void)
385 static struct resource mvsdio_resources[] = {
404 .dma_mask = &mvsdio_dmamask,
407 .num_resources =
ARRAY_SIZE(mvsdio_resources),
408 .resource = mvsdio_resources,
417 mvsdio_data->
clock = 100000000;
419 mvsdio_data->
clock = 200000000;
420 kirkwood_sdio.
dev.platform_data = mvsdio_data;
514 init_dma_coherent_pool_size(
SZ_1M);
519 static int __init kirkwood_find_tclk(
void)
532 static void __init kirkwood_timer_init(
void)
534 kirkwood_tclk = kirkwood_find_tclk();
541 .init = kirkwood_timer_init,
547 static struct resource kirkwood_i2s_resources[] = {
565 .name =
"kirkwood-i2s",
567 .num_resources =
ARRAY_SIZE(kirkwood_i2s_resources),
568 .resource = kirkwood_i2s_resources,
570 .platform_data = &kirkwood_i2s_data,
575 .name =
"kirkwood-pcm-audio",
599 return "MV88F6281-Z0";
601 return "MV88F6281-A0";
603 return "MV88F6281-A1";
605 return "MV88F6281-Rev-Unsupported";
608 return "MV88F6192-Z0";
610 return "MV88F6192-A0";
612 return "MV88F6192-A1";
614 return "MV88F6192-Rev-Unsupported";
617 return "MV88F6180-Rev-A0";
619 return "MV88F6180-Rev-A1";
621 return "MV88F6180-Rev-Unsupported";
624 return "MV88F6282-Rev-A0";
626 return "MV88F6282-Rev-A1";
628 return "MV88F6282-Rev-Unsupported";
630 return "Device-Unknown";
636 #ifdef CONFIG_CACHE_FEROCEON_L2
637 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH