1 // SPDX-License-Identifier: GPL-2.0-only
3 * arch/arm/mach-spear3xx/spear3xx.c
5 * SPEAr3XX machines common source file
7 * Copyright (C) 2009-2012 ST Microelectronics
8 * Viresh Kumar <vireshk@kernel.org>
11 #define pr_fmt(fmt) "SPEAr3xx: " fmt
13 #include <linux/amba/pl022.h>
14 #include <linux/amba/pl080.h>
15 #include <linux/clk.h>
16 #include <linux/clk/spear.h>
18 #include <asm/mach/map.h>
22 #include "misc_regs.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",
33 /* dmac device registration */
34 struct pl08x_platform_data pl080_plat_data
= {
35 .memcpy_burst_size
= PL08X_BURST_SZ_16
,
36 .memcpy_bus_width
= PL08X_BUS_WIDTH_32_BITS
,
37 .memcpy_prot_buff
= true,
38 .memcpy_prot_cache
= true,
39 .lli_buses
= PL08X_AHB1
,
40 .mem_buses
= PL08X_AHB1
,
41 .get_xfer_signal
= pl080_get_signal
,
42 .put_xfer_signal
= pl080_put_signal
,
46 * Following will create 16MB static virtual/physical mappings
48 * 0xD0000000 0xFD000000
49 * 0xFC000000 0xFC000000
51 struct map_desc spear3xx_io_desc
[] __initdata
= {
53 .virtual = (unsigned long)VA_SPEAR_ICM1_2_BASE
,
54 .pfn
= __phys_to_pfn(SPEAR_ICM1_2_BASE
),
58 .virtual = (unsigned long)VA_SPEAR_ICM3_SMI_CTRL_BASE
,
59 .pfn
= __phys_to_pfn(SPEAR_ICM3_SMI_CTRL_BASE
),
65 /* This will create static memory mapping for selected devices */
66 void __init
spear3xx_map_io(void)
68 iotable_init(spear3xx_io_desc
, ARRAY_SIZE(spear3xx_io_desc
));
71 void __init
spear3xx_timer_init(void)
73 char pclk_name
[] = "pll3_clk";
74 struct clk
*gpt_clk
, *pclk
;
76 spear3xx_clk_init(MISC_BASE
, VA_SPEAR320_SOC_CONFIG_BASE
);
78 /* get the system timer clock */
79 gpt_clk
= clk_get_sys("gpt0", NULL
);
80 if (IS_ERR(gpt_clk
)) {
81 pr_err("%s:couldn't get clk for gpt\n", __func__
);
85 /* get the suitable parent clock for timer*/
86 pclk
= clk_get(NULL
, pclk_name
);
88 pr_err("%s:couldn't get %s as parent for gpt\n",
93 clk_set_parent(gpt_clk
, pclk
);
97 spear_setup_of_timer();