rk3026: i2s add several attempts to double confirm i2s frac effect
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk3026 / board-rk3026-ft.c
1 /*\r
2  *\r
3  * Copyright (C) 2013 ROCKCHIP, Inc.\r
4  *\r
5  * This software is licensed under the terms of the GNU General Public\r
6  * License version 2, as published by the Free Software Foundation, and\r
7  * may be copied, distributed, and modified under those terms.\r
8  *\r
9  * This program is distributed in the hope that it will be useful,\r
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
12  * GNU General Public License for more details.\r
13  *\r
14  */\r
15 \r
16 #include <linux/kernel.h>\r
17 #include <linux/init.h>\r
18 #include <linux/io.h>\r
19 #include <linux/delay.h>\r
20 #include <linux/clk.h>\r
21 \r
22 #include <asm/mach-types.h>\r
23 #include <asm/mach/arch.h>\r
24 \r
25 #include <mach/board.h>\r
26 #include <mach/gpio.h>\r
27 \r
28 #define FT\r
29 \r
30 #ifdef FT\r
31 #define CONSOLE_LOGLEVEL 9\r
32 #define ARM_PLL_MHZ (312)\r
33 #else\r
34 #define CONSOLE_LOGLEVEL 9\r
35 #define ARM_PLL_MHZ (816)\r
36 #endif\r
37 \r
38 static void __init machine_rk2928_board_init(void)\r
39 {\r
40         console_loglevel = CONSOLE_LOGLEVEL;\r
41 }\r
42 \r
43 #define ft_printk(fmt, arg...) \\r
44         printk(KERN_EMERG fmt, ##arg)\r
45 \r
46 void __init board_clock_init(void)\r
47 {\r
48         rk2928_clock_data_init(periph_pll_default, codec_pll_default, RK30_CLOCKS_DEFAULT_FLAGS);\r
49         clk_set_rate(clk_get(NULL, "cpu"), ARM_PLL_MHZ * 1000 * 1000);\r
50         preset_lpj = loops_per_jiffy;\r
51 }\r
52 \r
53 static void __init ft_fixup(struct machine_desc *desc, struct tag *tags,\r
54                         char **cmdline, struct meminfo *mi)\r
55 {\r
56         mi->nr_banks = 1;\r
57         mi->bank[0].start = PLAT_PHYS_OFFSET;\r
58         mi->bank[0].size = SZ_512M;\r
59 }\r
60 \r
61 MACHINE_START(RK30, "RK30board")\r
62         .boot_params    = PLAT_PHYS_OFFSET + 0x800,\r
63         .fixup          = ft_fixup,\r
64         .map_io         = rk2928_map_io,\r
65         .init_irq       = rk2928_init_irq,\r
66         .timer          = &rk2928_timer,\r
67         .init_machine   = machine_rk2928_board_init,\r
68 MACHINE_END\r
69 \r