2 * arch/arm/mach-spear3xx/spear3xx.c
4 * SPEAr3XX machines common source file
6 * Copyright (C) 2009-2012 ST Microelectronics
7 * Viresh Kumar <viresh.linux@gmail.com>
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
14 #define pr_fmt(fmt) "SPEAr3xx: " fmt
16 #include <linux/amba/pl022.h>
17 #include <linux/amba/pl08x.h>
19 #include <asm/hardware/pl080.h>
20 #include <plat/pl080.h>
21 #include <mach/generic.h>
22 #include <mach/spear.h>
24 /* ssp device registration */
25 struct pl022_ssp_controller pl022_plat_data = {
28 .dma_filter = pl08x_filter_id,
29 .dma_tx_param = "ssp0_tx",
30 .dma_rx_param = "ssp0_rx",
32 * This is number of spi devices that can be connected to spi. There are
33 * two type of chipselects on which slave devices can work. One is chip
34 * select provided by spi masters other is controlled through external
35 * gpio's. We can't use chipselect provided from spi master (because as
36 * soon as FIFO becomes empty, CS is disabled and transfer ends). So
37 * this number now depends on number of gpios available for spi. each
38 * slave on each master requires a separate gpio pin.
43 /* dmac device registration */
44 struct pl08x_platform_data pl080_plat_data = {
48 (PL080_BSIZE_16 << PL080_CONTROL_SB_SIZE_SHIFT | \
49 PL080_BSIZE_16 << PL080_CONTROL_DB_SIZE_SHIFT | \
50 PL080_WIDTH_32BIT << PL080_CONTROL_SWIDTH_SHIFT | \
51 PL080_WIDTH_32BIT << PL080_CONTROL_DWIDTH_SHIFT | \
52 PL080_CONTROL_PROT_BUFF | PL080_CONTROL_PROT_CACHE | \
53 PL080_CONTROL_PROT_SYS),
55 .lli_buses = PL08X_AHB1,
56 .mem_buses = PL08X_AHB1,
57 .get_signal = pl080_get_signal,
58 .put_signal = pl080_put_signal,
62 * Following will create 16MB static virtual/physical mappings
64 * 0xD0000000 0xFD000000
65 * 0xFC000000 0xFC000000
67 struct map_desc spear3xx_io_desc[] __initdata = {
69 .virtual = VA_SPEAR3XX_ICM1_2_BASE,
70 .pfn = __phys_to_pfn(SPEAR3XX_ICM1_2_BASE),
74 .virtual = VA_SPEAR3XX_ICM3_SMI_CTRL_BASE,
75 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SMI_CTRL_BASE),
81 /* This will create static memory mapping for selected devices */
82 void __init spear3xx_map_io(void)
84 iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
87 static void __init spear3xx_timer_init(void)
89 char pclk_name[] = "pll3_clk";
90 struct clk *gpt_clk, *pclk;
94 /* get the system timer clock */
95 gpt_clk = clk_get_sys("gpt0", NULL);
96 if (IS_ERR(gpt_clk)) {
97 pr_err("%s:couldn't get clk for gpt\n", __func__);
101 /* get the suitable parent clock for timer*/
102 pclk = clk_get(NULL, pclk_name);
104 pr_err("%s:couldn't get %s as parent for gpt\n",
105 __func__, pclk_name);
109 clk_set_parent(gpt_clk, pclk);
113 spear_setup_of_timer();
116 struct sys_timer spear3xx_timer = {
117 .init = spear3xx_timer_init,