1a7ed099fSArnd Bergmann /* 2a7ed099fSArnd Bergmann * arch/arm/mach-spear6xx/spear6xx.c 3a7ed099fSArnd Bergmann * 4a7ed099fSArnd Bergmann * SPEAr6XX machines common source file 5a7ed099fSArnd Bergmann * 6a7ed099fSArnd Bergmann * Copyright (C) 2009 ST Microelectronics 7a7ed099fSArnd Bergmann * Rajeev Kumar<rajeev-dlh.kumar@st.com> 8a7ed099fSArnd Bergmann * 9a7ed099fSArnd Bergmann * Copyright 2012 Stefan Roese <sr@denx.de> 10a7ed099fSArnd Bergmann * 11a7ed099fSArnd Bergmann * This file is licensed under the terms of the GNU General Public 12a7ed099fSArnd Bergmann * License version 2. This program is licensed "as is" without any 13a7ed099fSArnd Bergmann * warranty of any kind, whether express or implied. 14a7ed099fSArnd Bergmann */ 15a7ed099fSArnd Bergmann 16a7ed099fSArnd Bergmann #include <linux/amba/pl08x.h> 17a7ed099fSArnd Bergmann #include <linux/clk.h> 18a7ed099fSArnd Bergmann #include <linux/err.h> 19a7ed099fSArnd Bergmann #include <linux/of.h> 20a7ed099fSArnd Bergmann #include <linux/of_address.h> 21a7ed099fSArnd Bergmann #include <linux/of_platform.h> 22a7ed099fSArnd Bergmann #include <linux/amba/pl080.h> 23a7ed099fSArnd Bergmann #include <asm/mach/arch.h> 24a7ed099fSArnd Bergmann #include <asm/mach/time.h> 25a7ed099fSArnd Bergmann #include <asm/mach/map.h> 262b9c613cSArnd Bergmann #include "pl080.h" 272b9c613cSArnd Bergmann #include "generic.h" 28a7ed099fSArnd Bergmann #include <mach/spear.h> 29d9909ebeSArnd Bergmann #include <mach/misc_regs.h> 30a7ed099fSArnd Bergmann 31a7ed099fSArnd Bergmann /* dmac device registration */ 32a7ed099fSArnd Bergmann static struct pl08x_channel_data spear600_dma_info[] = { 33a7ed099fSArnd Bergmann { 34a7ed099fSArnd Bergmann .bus_id = "ssp1_rx", 35a7ed099fSArnd Bergmann .min_signal = 0, 36a7ed099fSArnd Bergmann .max_signal = 0, 37a7ed099fSArnd Bergmann .muxval = 0, 38a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 39a7ed099fSArnd Bergmann }, { 40a7ed099fSArnd Bergmann .bus_id = "ssp1_tx", 41a7ed099fSArnd Bergmann .min_signal = 1, 42a7ed099fSArnd Bergmann .max_signal = 1, 43a7ed099fSArnd Bergmann .muxval = 0, 44a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 45a7ed099fSArnd Bergmann }, { 46a7ed099fSArnd Bergmann .bus_id = "uart0_rx", 47a7ed099fSArnd Bergmann .min_signal = 2, 48a7ed099fSArnd Bergmann .max_signal = 2, 49a7ed099fSArnd Bergmann .muxval = 0, 50a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 51a7ed099fSArnd Bergmann }, { 52a7ed099fSArnd Bergmann .bus_id = "uart0_tx", 53a7ed099fSArnd Bergmann .min_signal = 3, 54a7ed099fSArnd Bergmann .max_signal = 3, 55a7ed099fSArnd Bergmann .muxval = 0, 56a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 57a7ed099fSArnd Bergmann }, { 58a7ed099fSArnd Bergmann .bus_id = "uart1_rx", 59a7ed099fSArnd Bergmann .min_signal = 4, 60a7ed099fSArnd Bergmann .max_signal = 4, 61a7ed099fSArnd Bergmann .muxval = 0, 62a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 63a7ed099fSArnd Bergmann }, { 64a7ed099fSArnd Bergmann .bus_id = "uart1_tx", 65a7ed099fSArnd Bergmann .min_signal = 5, 66a7ed099fSArnd Bergmann .max_signal = 5, 67a7ed099fSArnd Bergmann .muxval = 0, 68a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 69a7ed099fSArnd Bergmann }, { 70a7ed099fSArnd Bergmann .bus_id = "ssp2_rx", 71a7ed099fSArnd Bergmann .min_signal = 6, 72a7ed099fSArnd Bergmann .max_signal = 6, 73a7ed099fSArnd Bergmann .muxval = 0, 74a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 75a7ed099fSArnd Bergmann }, { 76a7ed099fSArnd Bergmann .bus_id = "ssp2_tx", 77a7ed099fSArnd Bergmann .min_signal = 7, 78a7ed099fSArnd Bergmann .max_signal = 7, 79a7ed099fSArnd Bergmann .muxval = 0, 80a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 81a7ed099fSArnd Bergmann }, { 82a7ed099fSArnd Bergmann .bus_id = "ssp0_rx", 83a7ed099fSArnd Bergmann .min_signal = 8, 84a7ed099fSArnd Bergmann .max_signal = 8, 85a7ed099fSArnd Bergmann .muxval = 0, 86a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 87a7ed099fSArnd Bergmann }, { 88a7ed099fSArnd Bergmann .bus_id = "ssp0_tx", 89a7ed099fSArnd Bergmann .min_signal = 9, 90a7ed099fSArnd Bergmann .max_signal = 9, 91a7ed099fSArnd Bergmann .muxval = 0, 92a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 93a7ed099fSArnd Bergmann }, { 94a7ed099fSArnd Bergmann .bus_id = "i2c_rx", 95a7ed099fSArnd Bergmann .min_signal = 10, 96a7ed099fSArnd Bergmann .max_signal = 10, 97a7ed099fSArnd Bergmann .muxval = 0, 98a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 99a7ed099fSArnd Bergmann }, { 100a7ed099fSArnd Bergmann .bus_id = "i2c_tx", 101a7ed099fSArnd Bergmann .min_signal = 11, 102a7ed099fSArnd Bergmann .max_signal = 11, 103a7ed099fSArnd Bergmann .muxval = 0, 104a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 105a7ed099fSArnd Bergmann }, { 106a7ed099fSArnd Bergmann .bus_id = "irda", 107a7ed099fSArnd Bergmann .min_signal = 12, 108a7ed099fSArnd Bergmann .max_signal = 12, 109a7ed099fSArnd Bergmann .muxval = 0, 110a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 111a7ed099fSArnd Bergmann }, { 112a7ed099fSArnd Bergmann .bus_id = "adc", 113a7ed099fSArnd Bergmann .min_signal = 13, 114a7ed099fSArnd Bergmann .max_signal = 13, 115a7ed099fSArnd Bergmann .muxval = 0, 116a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 117a7ed099fSArnd Bergmann }, { 118a7ed099fSArnd Bergmann .bus_id = "to_jpeg", 119a7ed099fSArnd Bergmann .min_signal = 14, 120a7ed099fSArnd Bergmann .max_signal = 14, 121a7ed099fSArnd Bergmann .muxval = 0, 122a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 123a7ed099fSArnd Bergmann }, { 124a7ed099fSArnd Bergmann .bus_id = "from_jpeg", 125a7ed099fSArnd Bergmann .min_signal = 15, 126a7ed099fSArnd Bergmann .max_signal = 15, 127a7ed099fSArnd Bergmann .muxval = 0, 128a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 129a7ed099fSArnd Bergmann }, { 130a7ed099fSArnd Bergmann .bus_id = "ras0_rx", 131a7ed099fSArnd Bergmann .min_signal = 0, 132a7ed099fSArnd Bergmann .max_signal = 0, 133a7ed099fSArnd Bergmann .muxval = 1, 134a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 135a7ed099fSArnd Bergmann }, { 136a7ed099fSArnd Bergmann .bus_id = "ras0_tx", 137a7ed099fSArnd Bergmann .min_signal = 1, 138a7ed099fSArnd Bergmann .max_signal = 1, 139a7ed099fSArnd Bergmann .muxval = 1, 140a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 141a7ed099fSArnd Bergmann }, { 142a7ed099fSArnd Bergmann .bus_id = "ras1_rx", 143a7ed099fSArnd Bergmann .min_signal = 2, 144a7ed099fSArnd Bergmann .max_signal = 2, 145a7ed099fSArnd Bergmann .muxval = 1, 146a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 147a7ed099fSArnd Bergmann }, { 148a7ed099fSArnd Bergmann .bus_id = "ras1_tx", 149a7ed099fSArnd Bergmann .min_signal = 3, 150a7ed099fSArnd Bergmann .max_signal = 3, 151a7ed099fSArnd Bergmann .muxval = 1, 152a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 153a7ed099fSArnd Bergmann }, { 154a7ed099fSArnd Bergmann .bus_id = "ras2_rx", 155a7ed099fSArnd Bergmann .min_signal = 4, 156a7ed099fSArnd Bergmann .max_signal = 4, 157a7ed099fSArnd Bergmann .muxval = 1, 158a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 159a7ed099fSArnd Bergmann }, { 160a7ed099fSArnd Bergmann .bus_id = "ras2_tx", 161a7ed099fSArnd Bergmann .min_signal = 5, 162a7ed099fSArnd Bergmann .max_signal = 5, 163a7ed099fSArnd Bergmann .muxval = 1, 164a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 165a7ed099fSArnd Bergmann }, { 166a7ed099fSArnd Bergmann .bus_id = "ras3_rx", 167a7ed099fSArnd Bergmann .min_signal = 6, 168a7ed099fSArnd Bergmann .max_signal = 6, 169a7ed099fSArnd Bergmann .muxval = 1, 170a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 171a7ed099fSArnd Bergmann }, { 172a7ed099fSArnd Bergmann .bus_id = "ras3_tx", 173a7ed099fSArnd Bergmann .min_signal = 7, 174a7ed099fSArnd Bergmann .max_signal = 7, 175a7ed099fSArnd Bergmann .muxval = 1, 176a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 177a7ed099fSArnd Bergmann }, { 178a7ed099fSArnd Bergmann .bus_id = "ras4_rx", 179a7ed099fSArnd Bergmann .min_signal = 8, 180a7ed099fSArnd Bergmann .max_signal = 8, 181a7ed099fSArnd Bergmann .muxval = 1, 182a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 183a7ed099fSArnd Bergmann }, { 184a7ed099fSArnd Bergmann .bus_id = "ras4_tx", 185a7ed099fSArnd Bergmann .min_signal = 9, 186a7ed099fSArnd Bergmann .max_signal = 9, 187a7ed099fSArnd Bergmann .muxval = 1, 188a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 189a7ed099fSArnd Bergmann }, { 190a7ed099fSArnd Bergmann .bus_id = "ras5_rx", 191a7ed099fSArnd Bergmann .min_signal = 10, 192a7ed099fSArnd Bergmann .max_signal = 10, 193a7ed099fSArnd Bergmann .muxval = 1, 194a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 195a7ed099fSArnd Bergmann }, { 196a7ed099fSArnd Bergmann .bus_id = "ras5_tx", 197a7ed099fSArnd Bergmann .min_signal = 11, 198a7ed099fSArnd Bergmann .max_signal = 11, 199a7ed099fSArnd Bergmann .muxval = 1, 200a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 201a7ed099fSArnd Bergmann }, { 202a7ed099fSArnd Bergmann .bus_id = "ras6_rx", 203a7ed099fSArnd Bergmann .min_signal = 12, 204a7ed099fSArnd Bergmann .max_signal = 12, 205a7ed099fSArnd Bergmann .muxval = 1, 206a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 207a7ed099fSArnd Bergmann }, { 208a7ed099fSArnd Bergmann .bus_id = "ras6_tx", 209a7ed099fSArnd Bergmann .min_signal = 13, 210a7ed099fSArnd Bergmann .max_signal = 13, 211a7ed099fSArnd Bergmann .muxval = 1, 212a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 213a7ed099fSArnd Bergmann }, { 214a7ed099fSArnd Bergmann .bus_id = "ras7_rx", 215a7ed099fSArnd Bergmann .min_signal = 14, 216a7ed099fSArnd Bergmann .max_signal = 14, 217a7ed099fSArnd Bergmann .muxval = 1, 218a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 219a7ed099fSArnd Bergmann }, { 220a7ed099fSArnd Bergmann .bus_id = "ras7_tx", 221a7ed099fSArnd Bergmann .min_signal = 15, 222a7ed099fSArnd Bergmann .max_signal = 15, 223a7ed099fSArnd Bergmann .muxval = 1, 224a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB1, 225a7ed099fSArnd Bergmann }, { 226a7ed099fSArnd Bergmann .bus_id = "ext0_rx", 227a7ed099fSArnd Bergmann .min_signal = 0, 228a7ed099fSArnd Bergmann .max_signal = 0, 229a7ed099fSArnd Bergmann .muxval = 2, 230a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 231a7ed099fSArnd Bergmann }, { 232a7ed099fSArnd Bergmann .bus_id = "ext0_tx", 233a7ed099fSArnd Bergmann .min_signal = 1, 234a7ed099fSArnd Bergmann .max_signal = 1, 235a7ed099fSArnd Bergmann .muxval = 2, 236a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 237a7ed099fSArnd Bergmann }, { 238a7ed099fSArnd Bergmann .bus_id = "ext1_rx", 239a7ed099fSArnd Bergmann .min_signal = 2, 240a7ed099fSArnd Bergmann .max_signal = 2, 241a7ed099fSArnd Bergmann .muxval = 2, 242a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 243a7ed099fSArnd Bergmann }, { 244a7ed099fSArnd Bergmann .bus_id = "ext1_tx", 245a7ed099fSArnd Bergmann .min_signal = 3, 246a7ed099fSArnd Bergmann .max_signal = 3, 247a7ed099fSArnd Bergmann .muxval = 2, 248a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 249a7ed099fSArnd Bergmann }, { 250a7ed099fSArnd Bergmann .bus_id = "ext2_rx", 251a7ed099fSArnd Bergmann .min_signal = 4, 252a7ed099fSArnd Bergmann .max_signal = 4, 253a7ed099fSArnd Bergmann .muxval = 2, 254a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 255a7ed099fSArnd Bergmann }, { 256a7ed099fSArnd Bergmann .bus_id = "ext2_tx", 257a7ed099fSArnd Bergmann .min_signal = 5, 258a7ed099fSArnd Bergmann .max_signal = 5, 259a7ed099fSArnd Bergmann .muxval = 2, 260a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 261a7ed099fSArnd Bergmann }, { 262a7ed099fSArnd Bergmann .bus_id = "ext3_rx", 263a7ed099fSArnd Bergmann .min_signal = 6, 264a7ed099fSArnd Bergmann .max_signal = 6, 265a7ed099fSArnd Bergmann .muxval = 2, 266a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 267a7ed099fSArnd Bergmann }, { 268a7ed099fSArnd Bergmann .bus_id = "ext3_tx", 269a7ed099fSArnd Bergmann .min_signal = 7, 270a7ed099fSArnd Bergmann .max_signal = 7, 271a7ed099fSArnd Bergmann .muxval = 2, 272a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 273a7ed099fSArnd Bergmann }, { 274a7ed099fSArnd Bergmann .bus_id = "ext4_rx", 275a7ed099fSArnd Bergmann .min_signal = 8, 276a7ed099fSArnd Bergmann .max_signal = 8, 277a7ed099fSArnd Bergmann .muxval = 2, 278a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 279a7ed099fSArnd Bergmann }, { 280a7ed099fSArnd Bergmann .bus_id = "ext4_tx", 281a7ed099fSArnd Bergmann .min_signal = 9, 282a7ed099fSArnd Bergmann .max_signal = 9, 283a7ed099fSArnd Bergmann .muxval = 2, 284a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 285a7ed099fSArnd Bergmann }, { 286a7ed099fSArnd Bergmann .bus_id = "ext5_rx", 287a7ed099fSArnd Bergmann .min_signal = 10, 288a7ed099fSArnd Bergmann .max_signal = 10, 289a7ed099fSArnd Bergmann .muxval = 2, 290a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 291a7ed099fSArnd Bergmann }, { 292a7ed099fSArnd Bergmann .bus_id = "ext5_tx", 293a7ed099fSArnd Bergmann .min_signal = 11, 294a7ed099fSArnd Bergmann .max_signal = 11, 295a7ed099fSArnd Bergmann .muxval = 2, 296a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 297a7ed099fSArnd Bergmann }, { 298a7ed099fSArnd Bergmann .bus_id = "ext6_rx", 299a7ed099fSArnd Bergmann .min_signal = 12, 300a7ed099fSArnd Bergmann .max_signal = 12, 301a7ed099fSArnd Bergmann .muxval = 2, 302a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 303a7ed099fSArnd Bergmann }, { 304a7ed099fSArnd Bergmann .bus_id = "ext6_tx", 305a7ed099fSArnd Bergmann .min_signal = 13, 306a7ed099fSArnd Bergmann .max_signal = 13, 307a7ed099fSArnd Bergmann .muxval = 2, 308a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 309a7ed099fSArnd Bergmann }, { 310a7ed099fSArnd Bergmann .bus_id = "ext7_rx", 311a7ed099fSArnd Bergmann .min_signal = 14, 312a7ed099fSArnd Bergmann .max_signal = 14, 313a7ed099fSArnd Bergmann .muxval = 2, 314a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 315a7ed099fSArnd Bergmann }, { 316a7ed099fSArnd Bergmann .bus_id = "ext7_tx", 317a7ed099fSArnd Bergmann .min_signal = 15, 318a7ed099fSArnd Bergmann .max_signal = 15, 319a7ed099fSArnd Bergmann .muxval = 2, 320a7ed099fSArnd Bergmann .periph_buses = PL08X_AHB2, 321a7ed099fSArnd Bergmann }, 322a7ed099fSArnd Bergmann }; 323a7ed099fSArnd Bergmann 324553e7f75SArnd Bergmann static struct pl08x_platform_data spear6xx_pl080_plat_data = { 325a7ed099fSArnd Bergmann .memcpy_channel = { 326a7ed099fSArnd Bergmann .bus_id = "memcpy", 327a7ed099fSArnd Bergmann .cctl_memcpy = 328a7ed099fSArnd Bergmann (PL080_BSIZE_16 << PL080_CONTROL_SB_SIZE_SHIFT | \ 329a7ed099fSArnd Bergmann PL080_BSIZE_16 << PL080_CONTROL_DB_SIZE_SHIFT | \ 330a7ed099fSArnd Bergmann PL080_WIDTH_32BIT << PL080_CONTROL_SWIDTH_SHIFT | \ 331a7ed099fSArnd Bergmann PL080_WIDTH_32BIT << PL080_CONTROL_DWIDTH_SHIFT | \ 332a7ed099fSArnd Bergmann PL080_CONTROL_PROT_BUFF | PL080_CONTROL_PROT_CACHE | \ 333a7ed099fSArnd Bergmann PL080_CONTROL_PROT_SYS), 334a7ed099fSArnd Bergmann }, 335a7ed099fSArnd Bergmann .lli_buses = PL08X_AHB1, 336a7ed099fSArnd Bergmann .mem_buses = PL08X_AHB1, 337d7cabeedSMark Brown .get_xfer_signal = pl080_get_signal, 338d7cabeedSMark Brown .put_xfer_signal = pl080_put_signal, 339a7ed099fSArnd Bergmann .slave_channels = spear600_dma_info, 340a7ed099fSArnd Bergmann .num_slave_channels = ARRAY_SIZE(spear600_dma_info), 341a7ed099fSArnd Bergmann }; 342a7ed099fSArnd Bergmann 343a7ed099fSArnd Bergmann /* 344a7ed099fSArnd Bergmann * Following will create 16MB static virtual/physical mappings 345a7ed099fSArnd Bergmann * PHYSICAL VIRTUAL 346a7ed099fSArnd Bergmann * 0xF0000000 0xF0000000 347a7ed099fSArnd Bergmann * 0xF1000000 0xF1000000 348a7ed099fSArnd Bergmann * 0xD0000000 0xFD000000 349a7ed099fSArnd Bergmann * 0xFC000000 0xFC000000 350a7ed099fSArnd Bergmann */ 351a7ed099fSArnd Bergmann struct map_desc spear6xx_io_desc[] __initdata = { 352a7ed099fSArnd Bergmann { 353d9909ebeSArnd Bergmann .virtual = (unsigned long)VA_SPEAR6XX_ML_CPU_BASE, 354a7ed099fSArnd Bergmann .pfn = __phys_to_pfn(SPEAR_ICM3_ML1_2_BASE), 355a7ed099fSArnd Bergmann .length = 2 * SZ_16M, 356a7ed099fSArnd Bergmann .type = MT_DEVICE 357a7ed099fSArnd Bergmann }, { 358d9909ebeSArnd Bergmann .virtual = (unsigned long)VA_SPEAR_ICM1_2_BASE, 359a7ed099fSArnd Bergmann .pfn = __phys_to_pfn(SPEAR_ICM1_2_BASE), 360a7ed099fSArnd Bergmann .length = SZ_16M, 361a7ed099fSArnd Bergmann .type = MT_DEVICE 362a7ed099fSArnd Bergmann }, { 363d9909ebeSArnd Bergmann .virtual = (unsigned long)VA_SPEAR_ICM3_SMI_CTRL_BASE, 364a7ed099fSArnd Bergmann .pfn = __phys_to_pfn(SPEAR_ICM3_SMI_CTRL_BASE), 365a7ed099fSArnd Bergmann .length = SZ_16M, 366a7ed099fSArnd Bergmann .type = MT_DEVICE 367a7ed099fSArnd Bergmann }, 368a7ed099fSArnd Bergmann }; 369a7ed099fSArnd Bergmann 370a7ed099fSArnd Bergmann /* This will create static memory mapping for selected devices */ 371a7ed099fSArnd Bergmann void __init spear6xx_map_io(void) 372a7ed099fSArnd Bergmann { 373a7ed099fSArnd Bergmann iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc)); 374a7ed099fSArnd Bergmann } 375a7ed099fSArnd Bergmann 376a7ed099fSArnd Bergmann void __init spear6xx_timer_init(void) 377a7ed099fSArnd Bergmann { 378a7ed099fSArnd Bergmann char pclk_name[] = "pll3_clk"; 379a7ed099fSArnd Bergmann struct clk *gpt_clk, *pclk; 380a7ed099fSArnd Bergmann 381d9909ebeSArnd Bergmann spear6xx_clk_init(MISC_BASE); 382a7ed099fSArnd Bergmann 383a7ed099fSArnd Bergmann /* get the system timer clock */ 384a7ed099fSArnd Bergmann gpt_clk = clk_get_sys("gpt0", NULL); 385a7ed099fSArnd Bergmann if (IS_ERR(gpt_clk)) { 386a7ed099fSArnd Bergmann pr_err("%s:couldn't get clk for gpt\n", __func__); 387a7ed099fSArnd Bergmann BUG(); 388a7ed099fSArnd Bergmann } 389a7ed099fSArnd Bergmann 390a7ed099fSArnd Bergmann /* get the suitable parent clock for timer*/ 391a7ed099fSArnd Bergmann pclk = clk_get(NULL, pclk_name); 392a7ed099fSArnd Bergmann if (IS_ERR(pclk)) { 393a7ed099fSArnd Bergmann pr_err("%s:couldn't get %s as parent for gpt\n", 394a7ed099fSArnd Bergmann __func__, pclk_name); 395a7ed099fSArnd Bergmann BUG(); 396a7ed099fSArnd Bergmann } 397a7ed099fSArnd Bergmann 398a7ed099fSArnd Bergmann clk_set_parent(gpt_clk, pclk); 399a7ed099fSArnd Bergmann clk_put(gpt_clk); 400a7ed099fSArnd Bergmann clk_put(pclk); 401a7ed099fSArnd Bergmann 402a7ed099fSArnd Bergmann spear_setup_of_timer(); 403a7ed099fSArnd Bergmann } 404a7ed099fSArnd Bergmann 405a7ed099fSArnd Bergmann /* Add auxdata to pass platform data */ 406a7ed099fSArnd Bergmann struct of_dev_auxdata spear6xx_auxdata_lookup[] __initdata = { 407a7ed099fSArnd Bergmann OF_DEV_AUXDATA("arm,pl080", SPEAR_ICM3_DMA_BASE, NULL, 408553e7f75SArnd Bergmann &spear6xx_pl080_plat_data), 409a7ed099fSArnd Bergmann {} 410a7ed099fSArnd Bergmann }; 411a7ed099fSArnd Bergmann 412a7ed099fSArnd Bergmann static void __init spear600_dt_init(void) 413a7ed099fSArnd Bergmann { 414435ebcbcSKefeng Wang of_platform_default_populate(NULL, spear6xx_auxdata_lookup, NULL); 415a7ed099fSArnd Bergmann } 416a7ed099fSArnd Bergmann 417a7ed099fSArnd Bergmann static const char *spear600_dt_board_compat[] = { 418a7ed099fSArnd Bergmann "st,spear600", 419a7ed099fSArnd Bergmann NULL 420a7ed099fSArnd Bergmann }; 421a7ed099fSArnd Bergmann 422a7ed099fSArnd Bergmann DT_MACHINE_START(SPEAR600_DT, "ST SPEAr600 (Flattened Device Tree)") 423a7ed099fSArnd Bergmann .map_io = spear6xx_map_io, 424a7ed099fSArnd Bergmann .init_time = spear6xx_timer_init, 425a7ed099fSArnd Bergmann .init_machine = spear600_dt_init, 426a7ed099fSArnd Bergmann .restart = spear_restart, 427a7ed099fSArnd Bergmann .dt_compat = spear600_dt_board_compat, 428a7ed099fSArnd Bergmann MACHINE_END 429