2010-04-01 11:30:58 +00:00
|
|
|
/*
|
|
|
|
* arch/arm/mach-spear3xx/spear3xx.c
|
|
|
|
*
|
|
|
|
* SPEAr3XX machines common source file
|
|
|
|
*
|
2012-03-22 18:47:43 +00:00
|
|
|
* Copyright (C) 2009-2012 ST Microelectronics
|
2015-07-17 23:23:50 +00:00
|
|
|
* Viresh Kumar <vireshk@kernel.org>
|
2010-04-01 11:30:58 +00:00
|
|
|
*
|
|
|
|
* This file is licensed under the terms of the GNU General Public
|
|
|
|
* License version 2. This program is licensed "as is" without any
|
|
|
|
* warranty of any kind, whether express or implied.
|
|
|
|
*/
|
|
|
|
|
2012-03-26 05:09:43 +00:00
|
|
|
#define pr_fmt(fmt) "SPEAr3xx: " fmt
|
|
|
|
|
2012-03-22 18:47:43 +00:00
|
|
|
#include <linux/amba/pl022.h>
|
2013-03-12 16:00:03 +00:00
|
|
|
#include <linux/amba/pl080.h>
|
|
|
|
#include <linux/clk.h>
|
2010-04-01 11:30:58 +00:00
|
|
|
#include <linux/io.h>
|
2013-03-12 16:00:03 +00:00
|
|
|
#include <asm/mach/map.h>
|
2012-12-02 14:49:04 +00:00
|
|
|
#include "pl080.h"
|
|
|
|
#include "generic.h"
|
2012-04-11 17:30:11 +00:00
|
|
|
#include <mach/spear.h>
|
2012-12-02 16:59:57 +00:00
|
|
|
#include <mach/misc_regs.h>
|
2010-04-01 11:30:58 +00:00
|
|
|
|
2012-03-22 18:47:43 +00:00
|
|
|
/* ssp device registration */
|
|
|
|
struct pl022_ssp_controller pl022_plat_data = {
|
|
|
|
.bus_id = 0,
|
|
|
|
.enable_dma = 1,
|
|
|
|
.dma_filter = pl08x_filter_id,
|
|
|
|
.dma_tx_param = "ssp0_tx",
|
|
|
|
.dma_rx_param = "ssp0_rx",
|
|
|
|
};
|
|
|
|
|
2012-03-26 04:59:23 +00:00
|
|
|
/* dmac device registration */
|
|
|
|
struct pl08x_platform_data pl080_plat_data = {
|
2017-05-20 21:42:50 +00:00
|
|
|
.memcpy_burst_size = PL08X_BURST_SZ_16,
|
|
|
|
.memcpy_bus_width = PL08X_BUS_WIDTH_32_BITS,
|
|
|
|
.memcpy_prot_buff = true,
|
|
|
|
.memcpy_prot_cache = true,
|
2012-03-26 04:59:23 +00:00
|
|
|
.lli_buses = PL08X_AHB1,
|
|
|
|
.mem_buses = PL08X_AHB1,
|
2013-06-19 19:38:28 +00:00
|
|
|
.get_xfer_signal = pl080_get_signal,
|
|
|
|
.put_xfer_signal = pl080_put_signal,
|
2010-04-01 11:30:58 +00:00
|
|
|
};
|
|
|
|
|
2012-03-22 18:47:43 +00:00
|
|
|
/*
|
|
|
|
* Following will create 16MB static virtual/physical mappings
|
|
|
|
* PHYSICAL VIRTUAL
|
|
|
|
* 0xD0000000 0xFD000000
|
|
|
|
* 0xFC000000 0xFC000000
|
|
|
|
*/
|
2010-04-01 11:30:58 +00:00
|
|
|
struct map_desc spear3xx_io_desc[] __initdata = {
|
|
|
|
{
|
2012-12-02 16:59:57 +00:00
|
|
|
.virtual = (unsigned long)VA_SPEAR_ICM1_2_BASE,
|
2012-12-02 13:45:27 +00:00
|
|
|
.pfn = __phys_to_pfn(SPEAR_ICM1_2_BASE),
|
2012-03-22 18:47:43 +00:00
|
|
|
.length = SZ_16M,
|
2010-04-01 11:30:58 +00:00
|
|
|
.type = MT_DEVICE
|
|
|
|
}, {
|
2012-12-02 16:59:57 +00:00
|
|
|
.virtual = (unsigned long)VA_SPEAR_ICM3_SMI_CTRL_BASE,
|
2012-12-02 13:45:27 +00:00
|
|
|
.pfn = __phys_to_pfn(SPEAR_ICM3_SMI_CTRL_BASE),
|
2012-03-22 18:47:43 +00:00
|
|
|
.length = SZ_16M,
|
2010-04-01 11:30:58 +00:00
|
|
|
.type = MT_DEVICE
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* This will create static memory mapping for selected devices */
|
|
|
|
void __init spear3xx_map_io(void)
|
|
|
|
{
|
|
|
|
iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
|
|
|
|
}
|
2010-04-01 11:31:29 +00:00
|
|
|
|
2012-11-08 19:40:59 +00:00
|
|
|
void __init spear3xx_timer_init(void)
|
2011-02-16 06:40:32 +00:00
|
|
|
{
|
2012-07-10 11:42:45 +00:00
|
|
|
char pclk_name[] = "pll3_clk";
|
2011-02-16 06:40:32 +00:00
|
|
|
struct clk *gpt_clk, *pclk;
|
|
|
|
|
2012-12-02 16:59:57 +00:00
|
|
|
spear3xx_clk_init(MISC_BASE, VA_SPEAR320_SOC_CONFIG_BASE);
|
2012-04-10 03:32:35 +00:00
|
|
|
|
2011-02-16 06:40:32 +00:00
|
|
|
/* get the system timer clock */
|
|
|
|
gpt_clk = clk_get_sys("gpt0", NULL);
|
|
|
|
if (IS_ERR(gpt_clk)) {
|
|
|
|
pr_err("%s:couldn't get clk for gpt\n", __func__);
|
|
|
|
BUG();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* get the suitable parent clock for timer*/
|
|
|
|
pclk = clk_get(NULL, pclk_name);
|
|
|
|
if (IS_ERR(pclk)) {
|
|
|
|
pr_err("%s:couldn't get %s as parent for gpt\n",
|
|
|
|
__func__, pclk_name);
|
|
|
|
BUG();
|
|
|
|
}
|
|
|
|
|
|
|
|
clk_set_parent(gpt_clk, pclk);
|
|
|
|
clk_put(gpt_clk);
|
|
|
|
clk_put(pclk);
|
|
|
|
|
2012-04-21 07:45:37 +00:00
|
|
|
spear_setup_of_timer();
|
2011-02-16 06:40:32 +00:00
|
|
|
}
|