]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/arm/mach-kirkwood/board-km_kirkwood.c
Merge branch 'kirkwood/boards' of git://git.infradead.org/users/jcooper/linux into...
[karo-tx-linux.git] / arch / arm / mach-kirkwood / board-km_kirkwood.c
1 /*
2  * Copyright 2012 2012 KEYMILE AG, CH-3097 Bern
3  * Valentin Longchamp <valentin.longchamp@keymile.com>
4  *
5  * arch/arm/mach-kirkwood/board-km_kirkwood.c
6  *
7  * Keymile km_kirkwood Reference Desing Init for drivers not converted to
8  * flattened device tree yet.
9  *
10  * This file is licensed under the terms of the GNU General Public
11  * License version 2.  This program is licensed "as is" without any
12  * warranty of any kind, whether express or implied.
13  */
14
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/mv643xx_eth.h>
18 #include <linux/clk.h>
19 #include <linux/clk-private.h>
20 #include "common.h"
21 #include "mpp.h"
22
23 static struct mv643xx_eth_platform_data km_kirkwood_ge00_data = {
24         .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
25 };
26
27 static unsigned int km_kirkwood_mpp_config[] __initdata = {
28         MPP8_GPIO,      /* I2C SDA */
29         MPP9_GPIO,      /* I2C SCL */
30         0
31 };
32
33 void __init km_kirkwood_init(void)
34 {
35         struct clk *sata_clk;
36         /*
37          * Basic setup. Needs to be called early.
38          */
39         kirkwood_mpp_conf(km_kirkwood_mpp_config);
40
41         /*
42          * Our variant of kirkwood (integrated in the Bobcat) hangs on accessing
43          * SATA bits (14-15) of the Clock Gating Control Register. Since these
44          * devices are also not present in this variant, their clocks get
45          * disabled because unused when clk_disable_unused() gets called.
46          * That's why we change the flags to these clocks to CLK_IGNORE_UNUSED
47          */
48         sata_clk = clk_get_sys("sata_mv.0", "0");
49         if (!IS_ERR(sata_clk))
50                 sata_clk->flags |= CLK_IGNORE_UNUSED;
51         sata_clk = clk_get_sys("sata_mv.0", "1");
52         if (!IS_ERR(sata_clk))
53                 sata_clk->flags |= CLK_IGNORE_UNUSED;
54
55         kirkwood_ehci_init();
56         kirkwood_ge00_init(&km_kirkwood_ge00_data);
57 }