11dbae815STony Lindgren /* 21dbae815STony Lindgren * linux/arch/arm/mach-omap2/io.c 31dbae815STony Lindgren * 41dbae815STony Lindgren * OMAP2 I/O mapping code 51dbae815STony Lindgren * 61dbae815STony Lindgren * Copyright (C) 2005 Nokia Corporation 744169075SSantosh Shilimkar * Copyright (C) 2007-2009 Texas Instruments 8646e3ed1STony Lindgren * 9646e3ed1STony Lindgren * Author: 10646e3ed1STony Lindgren * Juha Yrjola <juha.yrjola@nokia.com> 11646e3ed1STony Lindgren * Syed Khasim <x0khasim@ti.com> 121dbae815STony Lindgren * 1344169075SSantosh Shilimkar * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> 1444169075SSantosh Shilimkar * 151dbae815STony Lindgren * This program is free software; you can redistribute it and/or modify 161dbae815STony Lindgren * it under the terms of the GNU General Public License version 2 as 171dbae815STony Lindgren * published by the Free Software Foundation. 181dbae815STony Lindgren */ 191dbae815STony Lindgren #include <linux/module.h> 201dbae815STony Lindgren #include <linux/kernel.h> 211dbae815STony Lindgren #include <linux/init.h> 22fced80c7SRussell King #include <linux/io.h> 232f135eafSPaul Walmsley #include <linux/clk.h> 241dbae815STony Lindgren 25120db2cbSTony Lindgren #include <asm/tlb.h> 26120db2cbSTony Lindgren #include <asm/mach/map.h> 27120db2cbSTony Lindgren 2845c3eb7dSTony Lindgren #include <linux/omap-dma.h> 29646e3ed1STony Lindgren 30dc843280STony Lindgren #include "omap_hwmod.h" 31dbc04161STony Lindgren #include "soc.h" 32ee0839c2STony Lindgren #include "iomap.h" 33ee0839c2STony Lindgren #include "voltage.h" 34ee0839c2STony Lindgren #include "powerdomain.h" 35ee0839c2STony Lindgren #include "clockdomain.h" 36ee0839c2STony Lindgren #include "common.h" 37e30384abSVaibhav Hiremath #include "clock.h" 38e80a9729SPaul Walmsley #include "clock2xxx.h" 39657ebfadSPaul Walmsley #include "clock3xxx.h" 401d5aef49STony Lindgren #include "omap-pm.h" 413e6ece13SPaul Walmsley #include "sdrc.h" 42b6a4226cSPaul Walmsley #include "control.h" 433d82cbbbSTony Lindgren #include "serial.h" 44bf027ca1STony Lindgren #include "sram.h" 45c4ceedcbSPaul Walmsley #include "cm2xxx.h" 46c4ceedcbSPaul Walmsley #include "cm3xxx.h" 477632a02fSTero Kristo #include "cm33xx.h" 48ab6c9bbfSTero Kristo #include "cm44xx.h" 49d9a16f9aSPaul Walmsley #include "prm.h" 50d9a16f9aSPaul Walmsley #include "cm.h" 51d9a16f9aSPaul Walmsley #include "prcm_mpu44xx.h" 52d9a16f9aSPaul Walmsley #include "prminst44xx.h" 5363a293e0SPaul Walmsley #include "prm2xxx.h" 5463a293e0SPaul Walmsley #include "prm3xxx.h" 55d9bbe84fSTero Kristo #include "prm33xx.h" 5663a293e0SPaul Walmsley #include "prm44xx.h" 5769a1e7a1STero Kristo #include "opp2xxx.h" 581dbae815STony Lindgren 591dbae815STony Lindgren /* 60cfa9667dSTero Kristo * omap_clk_soc_init: points to a function that does the SoC-specific 61ff931c82SRajendra Nayak * clock initializations 62ff931c82SRajendra Nayak */ 63cfa9667dSTero Kristo static int (*omap_clk_soc_init)(void); 64ff931c82SRajendra Nayak 65ff931c82SRajendra Nayak /* 661dbae815STony Lindgren * The machine specific code may provide the extra mapping besides the 671dbae815STony Lindgren * default mapping provided here. 681dbae815STony Lindgren */ 69cc26b3b0SSyed Mohammed, Khasim 70e48f814eSTony Lindgren #if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430) 71cc26b3b0SSyed Mohammed, Khasim static struct map_desc omap24xx_io_desc[] __initdata = { 721dbae815STony Lindgren { 731dbae815STony Lindgren .virtual = L3_24XX_VIRT, 741dbae815STony Lindgren .pfn = __phys_to_pfn(L3_24XX_PHYS), 751dbae815STony Lindgren .length = L3_24XX_SIZE, 761dbae815STony Lindgren .type = MT_DEVICE 771dbae815STony Lindgren }, 7809f21ed4SKyungmin Park { 7909f21ed4SKyungmin Park .virtual = L4_24XX_VIRT, 8009f21ed4SKyungmin Park .pfn = __phys_to_pfn(L4_24XX_PHYS), 8109f21ed4SKyungmin Park .length = L4_24XX_SIZE, 8209f21ed4SKyungmin Park .type = MT_DEVICE 8309f21ed4SKyungmin Park }, 84cc26b3b0SSyed Mohammed, Khasim }; 85cc26b3b0SSyed Mohammed, Khasim 8659b479e0STony Lindgren #ifdef CONFIG_SOC_OMAP2420 87cc26b3b0SSyed Mohammed, Khasim static struct map_desc omap242x_io_desc[] __initdata = { 881dbae815STony Lindgren { 897adb9987SPaul Walmsley .virtual = DSP_MEM_2420_VIRT, 907adb9987SPaul Walmsley .pfn = __phys_to_pfn(DSP_MEM_2420_PHYS), 917adb9987SPaul Walmsley .length = DSP_MEM_2420_SIZE, 92c40fae95STony Lindgren .type = MT_DEVICE 93c40fae95STony Lindgren }, 94c40fae95STony Lindgren { 957adb9987SPaul Walmsley .virtual = DSP_IPI_2420_VIRT, 967adb9987SPaul Walmsley .pfn = __phys_to_pfn(DSP_IPI_2420_PHYS), 977adb9987SPaul Walmsley .length = DSP_IPI_2420_SIZE, 98c40fae95STony Lindgren .type = MT_DEVICE 99c40fae95STony Lindgren }, 100c40fae95STony Lindgren { 1017adb9987SPaul Walmsley .virtual = DSP_MMU_2420_VIRT, 1027adb9987SPaul Walmsley .pfn = __phys_to_pfn(DSP_MMU_2420_PHYS), 1037adb9987SPaul Walmsley .length = DSP_MMU_2420_SIZE, 1041dbae815STony Lindgren .type = MT_DEVICE 105cc26b3b0SSyed Mohammed, Khasim }, 1061dbae815STony Lindgren }; 1071dbae815STony Lindgren 108cc26b3b0SSyed Mohammed, Khasim #endif 109cc26b3b0SSyed Mohammed, Khasim 11059b479e0STony Lindgren #ifdef CONFIG_SOC_OMAP2430 111cc26b3b0SSyed Mohammed, Khasim static struct map_desc omap243x_io_desc[] __initdata = { 112cc26b3b0SSyed Mohammed, Khasim { 113cc26b3b0SSyed Mohammed, Khasim .virtual = L4_WK_243X_VIRT, 114cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(L4_WK_243X_PHYS), 115cc26b3b0SSyed Mohammed, Khasim .length = L4_WK_243X_SIZE, 116cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 117cc26b3b0SSyed Mohammed, Khasim }, 118cc26b3b0SSyed Mohammed, Khasim { 119cc26b3b0SSyed Mohammed, Khasim .virtual = OMAP243X_GPMC_VIRT, 120cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS), 121cc26b3b0SSyed Mohammed, Khasim .length = OMAP243X_GPMC_SIZE, 122cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 123cc26b3b0SSyed Mohammed, Khasim }, 124cc26b3b0SSyed Mohammed, Khasim { 125cc26b3b0SSyed Mohammed, Khasim .virtual = OMAP243X_SDRC_VIRT, 126cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(OMAP243X_SDRC_PHYS), 127cc26b3b0SSyed Mohammed, Khasim .length = OMAP243X_SDRC_SIZE, 128cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 129cc26b3b0SSyed Mohammed, Khasim }, 130cc26b3b0SSyed Mohammed, Khasim { 131cc26b3b0SSyed Mohammed, Khasim .virtual = OMAP243X_SMS_VIRT, 132cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(OMAP243X_SMS_PHYS), 133cc26b3b0SSyed Mohammed, Khasim .length = OMAP243X_SMS_SIZE, 134cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 135cc26b3b0SSyed Mohammed, Khasim }, 136cc26b3b0SSyed Mohammed, Khasim }; 137cc26b3b0SSyed Mohammed, Khasim #endif 138cc26b3b0SSyed Mohammed, Khasim #endif 139cc26b3b0SSyed Mohammed, Khasim 140a8eb7ca0STony Lindgren #ifdef CONFIG_ARCH_OMAP3 141cc26b3b0SSyed Mohammed, Khasim static struct map_desc omap34xx_io_desc[] __initdata = { 142cc26b3b0SSyed Mohammed, Khasim { 143cc26b3b0SSyed Mohammed, Khasim .virtual = L3_34XX_VIRT, 144cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(L3_34XX_PHYS), 145cc26b3b0SSyed Mohammed, Khasim .length = L3_34XX_SIZE, 146cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 147cc26b3b0SSyed Mohammed, Khasim }, 148cc26b3b0SSyed Mohammed, Khasim { 149cc26b3b0SSyed Mohammed, Khasim .virtual = L4_34XX_VIRT, 150cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(L4_34XX_PHYS), 151cc26b3b0SSyed Mohammed, Khasim .length = L4_34XX_SIZE, 152cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 153cc26b3b0SSyed Mohammed, Khasim }, 154cc26b3b0SSyed Mohammed, Khasim { 155cc26b3b0SSyed Mohammed, Khasim .virtual = OMAP34XX_GPMC_VIRT, 156cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS), 157cc26b3b0SSyed Mohammed, Khasim .length = OMAP34XX_GPMC_SIZE, 158cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 159cc26b3b0SSyed Mohammed, Khasim }, 160cc26b3b0SSyed Mohammed, Khasim { 161cc26b3b0SSyed Mohammed, Khasim .virtual = OMAP343X_SMS_VIRT, 162cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(OMAP343X_SMS_PHYS), 163cc26b3b0SSyed Mohammed, Khasim .length = OMAP343X_SMS_SIZE, 164cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 165cc26b3b0SSyed Mohammed, Khasim }, 166cc26b3b0SSyed Mohammed, Khasim { 167cc26b3b0SSyed Mohammed, Khasim .virtual = OMAP343X_SDRC_VIRT, 168cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(OMAP343X_SDRC_PHYS), 169cc26b3b0SSyed Mohammed, Khasim .length = OMAP343X_SDRC_SIZE, 170cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 171cc26b3b0SSyed Mohammed, Khasim }, 172cc26b3b0SSyed Mohammed, Khasim { 173cc26b3b0SSyed Mohammed, Khasim .virtual = L4_PER_34XX_VIRT, 174cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(L4_PER_34XX_PHYS), 175cc26b3b0SSyed Mohammed, Khasim .length = L4_PER_34XX_SIZE, 176cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 177cc26b3b0SSyed Mohammed, Khasim }, 178cc26b3b0SSyed Mohammed, Khasim { 179cc26b3b0SSyed Mohammed, Khasim .virtual = L4_EMU_34XX_VIRT, 180cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(L4_EMU_34XX_PHYS), 181cc26b3b0SSyed Mohammed, Khasim .length = L4_EMU_34XX_SIZE, 182cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 183cc26b3b0SSyed Mohammed, Khasim }, 184cc26b3b0SSyed Mohammed, Khasim }; 185cc26b3b0SSyed Mohammed, Khasim #endif 18601001712SHemant Pedanekar 18733959553SKevin Hilman #ifdef CONFIG_SOC_TI81XX 188a920360fSHemant Pedanekar static struct map_desc omapti81xx_io_desc[] __initdata = { 18901001712SHemant Pedanekar { 19001001712SHemant Pedanekar .virtual = L4_34XX_VIRT, 19101001712SHemant Pedanekar .pfn = __phys_to_pfn(L4_34XX_PHYS), 19201001712SHemant Pedanekar .length = L4_34XX_SIZE, 19301001712SHemant Pedanekar .type = MT_DEVICE 1941e6cb146SAfzal Mohammed } 1951e6cb146SAfzal Mohammed }; 1961e6cb146SAfzal Mohammed #endif 1971e6cb146SAfzal Mohammed 198addb154aSAfzal Mohammed #if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX) 1991e6cb146SAfzal Mohammed static struct map_desc omapam33xx_io_desc[] __initdata = { 20001001712SHemant Pedanekar { 20101001712SHemant Pedanekar .virtual = L4_34XX_VIRT, 20201001712SHemant Pedanekar .pfn = __phys_to_pfn(L4_34XX_PHYS), 20301001712SHemant Pedanekar .length = L4_34XX_SIZE, 20401001712SHemant Pedanekar .type = MT_DEVICE 20501001712SHemant Pedanekar }, 2061e6cb146SAfzal Mohammed { 2071e6cb146SAfzal Mohammed .virtual = L4_WK_AM33XX_VIRT, 2081e6cb146SAfzal Mohammed .pfn = __phys_to_pfn(L4_WK_AM33XX_PHYS), 2091e6cb146SAfzal Mohammed .length = L4_WK_AM33XX_SIZE, 2101e6cb146SAfzal Mohammed .type = MT_DEVICE 2111e6cb146SAfzal Mohammed } 21201001712SHemant Pedanekar }; 21301001712SHemant Pedanekar #endif 21401001712SHemant Pedanekar 21544169075SSantosh Shilimkar #ifdef CONFIG_ARCH_OMAP4 21644169075SSantosh Shilimkar static struct map_desc omap44xx_io_desc[] __initdata = { 21744169075SSantosh Shilimkar { 21844169075SSantosh Shilimkar .virtual = L3_44XX_VIRT, 21944169075SSantosh Shilimkar .pfn = __phys_to_pfn(L3_44XX_PHYS), 22044169075SSantosh Shilimkar .length = L3_44XX_SIZE, 22144169075SSantosh Shilimkar .type = MT_DEVICE, 22244169075SSantosh Shilimkar }, 22344169075SSantosh Shilimkar { 22444169075SSantosh Shilimkar .virtual = L4_44XX_VIRT, 22544169075SSantosh Shilimkar .pfn = __phys_to_pfn(L4_44XX_PHYS), 22644169075SSantosh Shilimkar .length = L4_44XX_SIZE, 22744169075SSantosh Shilimkar .type = MT_DEVICE, 22844169075SSantosh Shilimkar }, 22944169075SSantosh Shilimkar { 23044169075SSantosh Shilimkar .virtual = L4_PER_44XX_VIRT, 23144169075SSantosh Shilimkar .pfn = __phys_to_pfn(L4_PER_44XX_PHYS), 23244169075SSantosh Shilimkar .length = L4_PER_44XX_SIZE, 23344169075SSantosh Shilimkar .type = MT_DEVICE, 23444169075SSantosh Shilimkar }, 23544169075SSantosh Shilimkar }; 23644169075SSantosh Shilimkar #endif 237cc26b3b0SSyed Mohammed, Khasim 238ea827ad5SNishanth Menon #ifdef CONFIG_SOC_OMAP5 23905e152c7SR Sricharan static struct map_desc omap54xx_io_desc[] __initdata = { 24005e152c7SR Sricharan { 24105e152c7SR Sricharan .virtual = L3_54XX_VIRT, 24205e152c7SR Sricharan .pfn = __phys_to_pfn(L3_54XX_PHYS), 24305e152c7SR Sricharan .length = L3_54XX_SIZE, 24405e152c7SR Sricharan .type = MT_DEVICE, 24505e152c7SR Sricharan }, 24605e152c7SR Sricharan { 24705e152c7SR Sricharan .virtual = L4_54XX_VIRT, 24805e152c7SR Sricharan .pfn = __phys_to_pfn(L4_54XX_PHYS), 24905e152c7SR Sricharan .length = L4_54XX_SIZE, 25005e152c7SR Sricharan .type = MT_DEVICE, 25105e152c7SR Sricharan }, 25205e152c7SR Sricharan { 25305e152c7SR Sricharan .virtual = L4_WK_54XX_VIRT, 25405e152c7SR Sricharan .pfn = __phys_to_pfn(L4_WK_54XX_PHYS), 25505e152c7SR Sricharan .length = L4_WK_54XX_SIZE, 25605e152c7SR Sricharan .type = MT_DEVICE, 25705e152c7SR Sricharan }, 25805e152c7SR Sricharan { 25905e152c7SR Sricharan .virtual = L4_PER_54XX_VIRT, 26005e152c7SR Sricharan .pfn = __phys_to_pfn(L4_PER_54XX_PHYS), 26105e152c7SR Sricharan .length = L4_PER_54XX_SIZE, 26205e152c7SR Sricharan .type = MT_DEVICE, 26305e152c7SR Sricharan }, 26405e152c7SR Sricharan }; 26505e152c7SR Sricharan #endif 26605e152c7SR Sricharan 267ea827ad5SNishanth Menon #ifdef CONFIG_SOC_DRA7XX 268ea827ad5SNishanth Menon static struct map_desc dra7xx_io_desc[] __initdata = { 269ea827ad5SNishanth Menon { 270ea827ad5SNishanth Menon .virtual = L4_CFG_MPU_DRA7XX_VIRT, 271ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L4_CFG_MPU_DRA7XX_PHYS), 272ea827ad5SNishanth Menon .length = L4_CFG_MPU_DRA7XX_SIZE, 273ea827ad5SNishanth Menon .type = MT_DEVICE, 274ea827ad5SNishanth Menon }, 275ea827ad5SNishanth Menon { 276ea827ad5SNishanth Menon .virtual = L3_MAIN_SN_DRA7XX_VIRT, 277ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L3_MAIN_SN_DRA7XX_PHYS), 278ea827ad5SNishanth Menon .length = L3_MAIN_SN_DRA7XX_SIZE, 279ea827ad5SNishanth Menon .type = MT_DEVICE, 280ea827ad5SNishanth Menon }, 281ea827ad5SNishanth Menon { 282ea827ad5SNishanth Menon .virtual = L4_PER1_DRA7XX_VIRT, 283ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L4_PER1_DRA7XX_PHYS), 284ea827ad5SNishanth Menon .length = L4_PER1_DRA7XX_SIZE, 285ea827ad5SNishanth Menon .type = MT_DEVICE, 286ea827ad5SNishanth Menon }, 287ea827ad5SNishanth Menon { 288ea827ad5SNishanth Menon .virtual = L4_PER2_DRA7XX_VIRT, 289ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L4_PER2_DRA7XX_PHYS), 290ea827ad5SNishanth Menon .length = L4_PER2_DRA7XX_SIZE, 291ea827ad5SNishanth Menon .type = MT_DEVICE, 292ea827ad5SNishanth Menon }, 293ea827ad5SNishanth Menon { 294ea827ad5SNishanth Menon .virtual = L4_PER3_DRA7XX_VIRT, 295ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L4_PER3_DRA7XX_PHYS), 296ea827ad5SNishanth Menon .length = L4_PER3_DRA7XX_SIZE, 297ea827ad5SNishanth Menon .type = MT_DEVICE, 298ea827ad5SNishanth Menon }, 299ea827ad5SNishanth Menon { 300ea827ad5SNishanth Menon .virtual = L4_CFG_DRA7XX_VIRT, 301ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L4_CFG_DRA7XX_PHYS), 302ea827ad5SNishanth Menon .length = L4_CFG_DRA7XX_SIZE, 303ea827ad5SNishanth Menon .type = MT_DEVICE, 304ea827ad5SNishanth Menon }, 305ea827ad5SNishanth Menon { 306ea827ad5SNishanth Menon .virtual = L4_WKUP_DRA7XX_VIRT, 307ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L4_WKUP_DRA7XX_PHYS), 308ea827ad5SNishanth Menon .length = L4_WKUP_DRA7XX_SIZE, 309ea827ad5SNishanth Menon .type = MT_DEVICE, 310ea827ad5SNishanth Menon }, 311ea827ad5SNishanth Menon }; 312ea827ad5SNishanth Menon #endif 313ea827ad5SNishanth Menon 31459b479e0STony Lindgren #ifdef CONFIG_SOC_OMAP2420 315b6a4226cSPaul Walmsley void __init omap242x_map_io(void) 3166fbd55d0STony Lindgren { 3176fbd55d0STony Lindgren iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); 3186fbd55d0STony Lindgren iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc)); 3196fbd55d0STony Lindgren } 3206fbd55d0STony Lindgren #endif 3216fbd55d0STony Lindgren 32259b479e0STony Lindgren #ifdef CONFIG_SOC_OMAP2430 323b6a4226cSPaul Walmsley void __init omap243x_map_io(void) 3246fbd55d0STony Lindgren { 3256fbd55d0STony Lindgren iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); 3266fbd55d0STony Lindgren iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc)); 3276fbd55d0STony Lindgren } 3286fbd55d0STony Lindgren #endif 3296fbd55d0STony Lindgren 330a8eb7ca0STony Lindgren #ifdef CONFIG_ARCH_OMAP3 331b6a4226cSPaul Walmsley void __init omap3_map_io(void) 3326fbd55d0STony Lindgren { 3336fbd55d0STony Lindgren iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc)); 3346fbd55d0STony Lindgren } 3356fbd55d0STony Lindgren #endif 3366fbd55d0STony Lindgren 33733959553SKevin Hilman #ifdef CONFIG_SOC_TI81XX 338b6a4226cSPaul Walmsley void __init ti81xx_map_io(void) 33901001712SHemant Pedanekar { 340a920360fSHemant Pedanekar iotable_init(omapti81xx_io_desc, ARRAY_SIZE(omapti81xx_io_desc)); 34101001712SHemant Pedanekar } 34201001712SHemant Pedanekar #endif 34301001712SHemant Pedanekar 344addb154aSAfzal Mohammed #if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX) 345b6a4226cSPaul Walmsley void __init am33xx_map_io(void) 3461e6cb146SAfzal Mohammed { 3471e6cb146SAfzal Mohammed iotable_init(omapam33xx_io_desc, ARRAY_SIZE(omapam33xx_io_desc)); 3486fbd55d0STony Lindgren } 3496fbd55d0STony Lindgren #endif 3506fbd55d0STony Lindgren 3516fbd55d0STony Lindgren #ifdef CONFIG_ARCH_OMAP4 352b6a4226cSPaul Walmsley void __init omap4_map_io(void) 3536fbd55d0STony Lindgren { 3546fbd55d0STony Lindgren iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc)); 355f746929fSRussell King omap_barriers_init(); 3566fbd55d0STony Lindgren } 3576fbd55d0STony Lindgren #endif 3586fbd55d0STony Lindgren 359ea827ad5SNishanth Menon #ifdef CONFIG_SOC_OMAP5 360b6a4226cSPaul Walmsley void __init omap5_map_io(void) 36105e152c7SR Sricharan { 36205e152c7SR Sricharan iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc)); 363f746929fSRussell King omap_barriers_init(); 36405e152c7SR Sricharan } 36505e152c7SR Sricharan #endif 366ea827ad5SNishanth Menon 367ea827ad5SNishanth Menon #ifdef CONFIG_SOC_DRA7XX 368ea827ad5SNishanth Menon void __init dra7xx_map_io(void) 369ea827ad5SNishanth Menon { 370ea827ad5SNishanth Menon iotable_init(dra7xx_io_desc, ARRAY_SIZE(dra7xx_io_desc)); 371*456e8d53SNishanth Menon omap_barriers_init(); 372ea827ad5SNishanth Menon } 373ea827ad5SNishanth Menon #endif 3742f135eafSPaul Walmsley /* 3752f135eafSPaul Walmsley * omap2_init_reprogram_sdrc - reprogram SDRC timing parameters 3762f135eafSPaul Walmsley * 3772f135eafSPaul Walmsley * Sets the CORE DPLL3 M2 divider to the same value that it's at 3782f135eafSPaul Walmsley * currently. This has the effect of setting the SDRC SDRAM AC timing 3792f135eafSPaul Walmsley * registers to the values currently defined by the kernel. Currently 3802f135eafSPaul Walmsley * only defined for OMAP3; will return 0 if called on OMAP2. Returns 3812f135eafSPaul Walmsley * -EINVAL if the dpll3_m2_ck cannot be found, 0 if called on OMAP2, 3822f135eafSPaul Walmsley * or passes along the return value of clk_set_rate(). 3832f135eafSPaul Walmsley */ 3842f135eafSPaul Walmsley static int __init _omap2_init_reprogram_sdrc(void) 3852f135eafSPaul Walmsley { 3862f135eafSPaul Walmsley struct clk *dpll3_m2_ck; 3872f135eafSPaul Walmsley int v = -EINVAL; 3882f135eafSPaul Walmsley long rate; 3892f135eafSPaul Walmsley 3902f135eafSPaul Walmsley if (!cpu_is_omap34xx()) 3912f135eafSPaul Walmsley return 0; 3922f135eafSPaul Walmsley 3932f135eafSPaul Walmsley dpll3_m2_ck = clk_get(NULL, "dpll3_m2_ck"); 394e281f7ecSAaro Koskinen if (IS_ERR(dpll3_m2_ck)) 3952f135eafSPaul Walmsley return -EINVAL; 3962f135eafSPaul Walmsley 3972f135eafSPaul Walmsley rate = clk_get_rate(dpll3_m2_ck); 3982f135eafSPaul Walmsley pr_info("Reprogramming SDRC clock to %ld Hz\n", rate); 3992f135eafSPaul Walmsley v = clk_set_rate(dpll3_m2_ck, rate); 4002f135eafSPaul Walmsley if (v) 4012f135eafSPaul Walmsley pr_err("dpll3_m2_clk rate change failed: %d\n", v); 4022f135eafSPaul Walmsley 4032f135eafSPaul Walmsley clk_put(dpll3_m2_ck); 4042f135eafSPaul Walmsley 4052f135eafSPaul Walmsley return v; 4062f135eafSPaul Walmsley } 4072f135eafSPaul Walmsley 4082092e5ccSPaul Walmsley static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data) 4092092e5ccSPaul Walmsley { 4102092e5ccSPaul Walmsley return omap_hwmod_set_postsetup_state(oh, *(u8 *)data); 4112092e5ccSPaul Walmsley } 4122092e5ccSPaul Walmsley 4137b250affSTony Lindgren static void __init omap_hwmod_init_postsetup(void) 414120db2cbSTony Lindgren { 4152092e5ccSPaul Walmsley u8 postsetup_state; 4162092e5ccSPaul Walmsley 4172092e5ccSPaul Walmsley /* Set the default postsetup state for all hwmods */ 418bf7c5449SRafael J. Wysocki #ifdef CONFIG_PM 4192092e5ccSPaul Walmsley postsetup_state = _HWMOD_STATE_IDLE; 4202092e5ccSPaul Walmsley #else 4212092e5ccSPaul Walmsley postsetup_state = _HWMOD_STATE_ENABLED; 4222092e5ccSPaul Walmsley #endif 4232092e5ccSPaul Walmsley omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state); 42455d2cb08SBenoit Cousson 42553da4ce2SKevin Hilman omap_pm_if_early_init(); 4264805734bSPaul Walmsley } 4274805734bSPaul Walmsley 428069d0a78SArnd Bergmann static void __init __maybe_unused omap_common_late_init(void) 4294ed12be0SRuslan Bilovol { 4304ed12be0SRuslan Bilovol omap_mux_late_init(); 4314ed12be0SRuslan Bilovol omap2_common_pm_late_init(); 4326770b211SRuslan Bilovol omap_soc_device_init(); 4334ed12be0SRuslan Bilovol } 4344ed12be0SRuslan Bilovol 43516110798SPaul Walmsley #ifdef CONFIG_SOC_OMAP2420 4368f5b5a41STony Lindgren void __init omap2420_init_early(void) 4378f5b5a41STony Lindgren { 438b6a4226cSPaul Walmsley omap2_set_globals_tap(OMAP242X_CLASS, OMAP2_L4_IO_ADDRESS(0x48014000)); 439b6a4226cSPaul Walmsley omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE), 440b6a4226cSPaul Walmsley OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE)); 4412208bf11STero Kristo omap2_control_base_init(); 4424de34f35SVaibhav Hiremath omap2xxx_check_revision(); 443ab7b2ffcSTero Kristo omap2_prcm_base_init(); 4447b250affSTony Lindgren omap2xxx_voltagedomains_init(); 4457b250affSTony Lindgren omap242x_powerdomains_init(); 4467b250affSTony Lindgren omap242x_clockdomains_init(); 4477b250affSTony Lindgren omap2420_hwmod_init(); 4487b250affSTony Lindgren omap_hwmod_init_postsetup(); 44969a1e7a1STero Kristo omap_clk_soc_init = omap2420_dt_clk_init; 45069a1e7a1STero Kristo rate_table = omap2420_rate_table; 4518f5b5a41STony Lindgren } 452bbd707acSShawn Guo 453bbd707acSShawn Guo void __init omap2420_init_late(void) 454bbd707acSShawn Guo { 4554ed12be0SRuslan Bilovol omap_common_late_init(); 456bbd707acSShawn Guo omap2_pm_init(); 45723fb8ba3SRajendra Nayak omap2_clk_enable_autoidle_all(); 458bbd707acSShawn Guo } 45916110798SPaul Walmsley #endif 4608f5b5a41STony Lindgren 46116110798SPaul Walmsley #ifdef CONFIG_SOC_OMAP2430 4628f5b5a41STony Lindgren void __init omap2430_init_early(void) 4638f5b5a41STony Lindgren { 464b6a4226cSPaul Walmsley omap2_set_globals_tap(OMAP243X_CLASS, OMAP2_L4_IO_ADDRESS(0x4900a000)); 465b6a4226cSPaul Walmsley omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE), 466b6a4226cSPaul Walmsley OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE)); 4672208bf11STero Kristo omap2_control_base_init(); 4684de34f35SVaibhav Hiremath omap2xxx_check_revision(); 469ab7b2ffcSTero Kristo omap2_prcm_base_init(); 4707b250affSTony Lindgren omap2xxx_voltagedomains_init(); 4717b250affSTony Lindgren omap243x_powerdomains_init(); 4727b250affSTony Lindgren omap243x_clockdomains_init(); 4737b250affSTony Lindgren omap2430_hwmod_init(); 4747b250affSTony Lindgren omap_hwmod_init_postsetup(); 47569a1e7a1STero Kristo omap_clk_soc_init = omap2430_dt_clk_init; 47669a1e7a1STero Kristo rate_table = omap2430_rate_table; 4777b250affSTony Lindgren } 478bbd707acSShawn Guo 479bbd707acSShawn Guo void __init omap2430_init_late(void) 480bbd707acSShawn Guo { 4814ed12be0SRuslan Bilovol omap_common_late_init(); 482bbd707acSShawn Guo omap2_pm_init(); 48323fb8ba3SRajendra Nayak omap2_clk_enable_autoidle_all(); 484bbd707acSShawn Guo } 485c4e2d245SSanjeev Premi #endif 4867b250affSTony Lindgren 4877b250affSTony Lindgren /* 4887b250affSTony Lindgren * Currently only board-omap3beagle.c should call this because of the 4897b250affSTony Lindgren * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT. 4907b250affSTony Lindgren */ 491c4e2d245SSanjeev Premi #ifdef CONFIG_ARCH_OMAP3 4927b250affSTony Lindgren void __init omap3_init_early(void) 4937b250affSTony Lindgren { 494b6a4226cSPaul Walmsley omap2_set_globals_tap(OMAP343X_CLASS, OMAP2_L4_IO_ADDRESS(0x4830A000)); 495b6a4226cSPaul Walmsley omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE), 496b6a4226cSPaul Walmsley OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE)); 4972208bf11STero Kristo /* XXX: remove these once OMAP3 is DT only */ 4982208bf11STero Kristo if (!of_have_populated_dt()) { 4992208bf11STero Kristo omap2_set_globals_control( 500efde2346STero Kristo OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE)); 501d9a16f9aSPaul Walmsley omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE)); 5022208bf11STero Kristo omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE), 5032208bf11STero Kristo NULL); 5042208bf11STero Kristo } 5052208bf11STero Kristo omap2_control_base_init(); 5064de34f35SVaibhav Hiremath omap3xxx_check_revision(); 5074de34f35SVaibhav Hiremath omap3xxx_check_features(); 508ab7b2ffcSTero Kristo omap2_prcm_base_init(); 509425dc8b2STero Kristo /* XXX: remove these once OMAP3 is DT only */ 510425dc8b2STero Kristo if (!of_have_populated_dt()) { 511ab7b2ffcSTero Kristo omap3xxx_prm_init(NULL); 512425dc8b2STero Kristo omap3xxx_cm_init(NULL); 513425dc8b2STero Kristo } 5147b250affSTony Lindgren omap3xxx_voltagedomains_init(); 5157b250affSTony Lindgren omap3xxx_powerdomains_init(); 5167b250affSTony Lindgren omap3xxx_clockdomains_init(); 5177b250affSTony Lindgren omap3xxx_hwmod_init(); 5187b250affSTony Lindgren omap_hwmod_init_postsetup(); 519eded36feSTero Kristo if (!of_have_populated_dt()) { 5202208bf11STero Kristo omap3_control_legacy_iomap_init(); 521eded36feSTero Kristo if (soc_is_am35xx()) 522eded36feSTero Kristo omap_clk_soc_init = am35xx_clk_legacy_init; 523eded36feSTero Kristo else if (cpu_is_omap3630()) 524eded36feSTero Kristo omap_clk_soc_init = omap36xx_clk_legacy_init; 525eded36feSTero Kristo else if (omap_rev() == OMAP3430_REV_ES1_0) 526eded36feSTero Kristo omap_clk_soc_init = omap3430es1_clk_legacy_init; 527eded36feSTero Kristo else 528eded36feSTero Kristo omap_clk_soc_init = omap3430_clk_legacy_init; 529eded36feSTero Kristo } 5308f5b5a41STony Lindgren } 5318f5b5a41STony Lindgren 5328f5b5a41STony Lindgren void __init omap3430_init_early(void) 5338f5b5a41STony Lindgren { 5347b250affSTony Lindgren omap3_init_early(); 5353e049157STero Kristo if (of_have_populated_dt()) 5363e049157STero Kristo omap_clk_soc_init = omap3430_dt_clk_init; 5378f5b5a41STony Lindgren } 5388f5b5a41STony Lindgren 5398f5b5a41STony Lindgren void __init omap35xx_init_early(void) 5408f5b5a41STony Lindgren { 5417b250affSTony Lindgren omap3_init_early(); 5423e049157STero Kristo if (of_have_populated_dt()) 5433e049157STero Kristo omap_clk_soc_init = omap3430_dt_clk_init; 5448f5b5a41STony Lindgren } 5458f5b5a41STony Lindgren 5468f5b5a41STony Lindgren void __init omap3630_init_early(void) 5478f5b5a41STony Lindgren { 5487b250affSTony Lindgren omap3_init_early(); 5493e049157STero Kristo if (of_have_populated_dt()) 5503e049157STero Kristo omap_clk_soc_init = omap3630_dt_clk_init; 5518f5b5a41STony Lindgren } 5528f5b5a41STony Lindgren 5538f5b5a41STony Lindgren void __init am35xx_init_early(void) 5548f5b5a41STony Lindgren { 5557b250affSTony Lindgren omap3_init_early(); 5563e049157STero Kristo if (of_have_populated_dt()) 5573e049157STero Kristo omap_clk_soc_init = am35xx_dt_clk_init; 5588f5b5a41STony Lindgren } 5598f5b5a41STony Lindgren 560bbd707acSShawn Guo void __init omap3_init_late(void) 561bbd707acSShawn Guo { 5624ed12be0SRuslan Bilovol omap_common_late_init(); 563bbd707acSShawn Guo omap3_pm_init(); 56423fb8ba3SRajendra Nayak omap2_clk_enable_autoidle_all(); 565bbd707acSShawn Guo } 566bbd707acSShawn Guo 567bbd707acSShawn Guo void __init omap3430_init_late(void) 568bbd707acSShawn Guo { 5694ed12be0SRuslan Bilovol omap_common_late_init(); 570bbd707acSShawn Guo omap3_pm_init(); 57123fb8ba3SRajendra Nayak omap2_clk_enable_autoidle_all(); 572bbd707acSShawn Guo } 573bbd707acSShawn Guo 574bbd707acSShawn Guo void __init omap35xx_init_late(void) 575bbd707acSShawn Guo { 5764ed12be0SRuslan Bilovol omap_common_late_init(); 577bbd707acSShawn Guo omap3_pm_init(); 57823fb8ba3SRajendra Nayak omap2_clk_enable_autoidle_all(); 579bbd707acSShawn Guo } 580bbd707acSShawn Guo 581bbd707acSShawn Guo void __init omap3630_init_late(void) 582bbd707acSShawn Guo { 5834ed12be0SRuslan Bilovol omap_common_late_init(); 584bbd707acSShawn Guo omap3_pm_init(); 58523fb8ba3SRajendra Nayak omap2_clk_enable_autoidle_all(); 586bbd707acSShawn Guo } 587bbd707acSShawn Guo 588bbd707acSShawn Guo void __init am35xx_init_late(void) 589bbd707acSShawn Guo { 5904ed12be0SRuslan Bilovol omap_common_late_init(); 591bbd707acSShawn Guo omap3_pm_init(); 59223fb8ba3SRajendra Nayak omap2_clk_enable_autoidle_all(); 593bbd707acSShawn Guo } 594bbd707acSShawn Guo 595bbd707acSShawn Guo void __init ti81xx_init_late(void) 596bbd707acSShawn Guo { 5974ed12be0SRuslan Bilovol omap_common_late_init(); 59823fb8ba3SRajendra Nayak omap2_clk_enable_autoidle_all(); 599bbd707acSShawn Guo } 600c4e2d245SSanjeev Premi #endif 6018f5b5a41STony Lindgren 602a64459c4SAida Mynzhasova #ifdef CONFIG_SOC_TI81XX 603a64459c4SAida Mynzhasova void __init ti814x_init_early(void) 604a64459c4SAida Mynzhasova { 605a64459c4SAida Mynzhasova omap2_set_globals_tap(TI814X_CLASS, 606a64459c4SAida Mynzhasova OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE)); 6072208bf11STero Kristo omap2_control_base_init(); 608a64459c4SAida Mynzhasova omap3xxx_check_revision(); 609a64459c4SAida Mynzhasova ti81xx_check_features(); 610ab7b2ffcSTero Kristo omap2_prcm_base_init(); 611a64459c4SAida Mynzhasova omap3xxx_voltagedomains_init(); 612a64459c4SAida Mynzhasova omap3xxx_powerdomains_init(); 613185fde6dSTony Lindgren ti814x_clockdomains_init(); 6140f3ccb24STony Lindgren dm814x_hwmod_init(); 615a64459c4SAida Mynzhasova omap_hwmod_init_postsetup(); 6169cf705deSTony Lindgren omap_clk_soc_init = dm814x_dt_clk_init; 617a64459c4SAida Mynzhasova } 618a64459c4SAida Mynzhasova 619a64459c4SAida Mynzhasova void __init ti816x_init_early(void) 620a64459c4SAida Mynzhasova { 621a64459c4SAida Mynzhasova omap2_set_globals_tap(TI816X_CLASS, 622a64459c4SAida Mynzhasova OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE)); 6232208bf11STero Kristo omap2_control_base_init(); 624a64459c4SAida Mynzhasova omap3xxx_check_revision(); 625a64459c4SAida Mynzhasova ti81xx_check_features(); 626ab7b2ffcSTero Kristo omap2_prcm_base_init(); 627a64459c4SAida Mynzhasova omap3xxx_voltagedomains_init(); 628a64459c4SAida Mynzhasova omap3xxx_powerdomains_init(); 629185fde6dSTony Lindgren ti816x_clockdomains_init(); 6300f3ccb24STony Lindgren dm816x_hwmod_init(); 631a64459c4SAida Mynzhasova omap_hwmod_init_postsetup(); 632a64459c4SAida Mynzhasova if (of_have_populated_dt()) 6339cf705deSTony Lindgren omap_clk_soc_init = dm816x_dt_clk_init; 634a64459c4SAida Mynzhasova } 635a64459c4SAida Mynzhasova #endif 636a64459c4SAida Mynzhasova 63708f30989SAfzal Mohammed #ifdef CONFIG_SOC_AM33XX 63808f30989SAfzal Mohammed void __init am33xx_init_early(void) 63908f30989SAfzal Mohammed { 640b6a4226cSPaul Walmsley omap2_set_globals_tap(AM335X_CLASS, 641b6a4226cSPaul Walmsley AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE)); 6422208bf11STero Kristo omap2_control_base_init(); 64308f30989SAfzal Mohammed omap3xxx_check_revision(); 6447bcad170SVaibhav Hiremath am33xx_check_features(); 645ab7b2ffcSTero Kristo omap2_prcm_base_init(); 6463f0ea764SVaibhav Hiremath am33xx_powerdomains_init(); 6479c80f3aaSVaibhav Hiremath am33xx_clockdomains_init(); 648a2cfc509SVaibhav Hiremath am33xx_hwmod_init(); 649a2cfc509SVaibhav Hiremath omap_hwmod_init_postsetup(); 650149c09d3STero Kristo omap_clk_soc_init = am33xx_dt_clk_init; 65108f30989SAfzal Mohammed } 652765e7a06SNishanth Menon 653765e7a06SNishanth Menon void __init am33xx_init_late(void) 654765e7a06SNishanth Menon { 655765e7a06SNishanth Menon omap_common_late_init(); 656765e7a06SNishanth Menon } 65708f30989SAfzal Mohammed #endif 65808f30989SAfzal Mohammed 659c5107027SAfzal Mohammed #ifdef CONFIG_SOC_AM43XX 660c5107027SAfzal Mohammed void __init am43xx_init_early(void) 661c5107027SAfzal Mohammed { 662c5107027SAfzal Mohammed omap2_set_globals_tap(AM335X_CLASS, 663c5107027SAfzal Mohammed AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE)); 6642208bf11STero Kristo omap2_control_base_init(); 665c5107027SAfzal Mohammed omap3xxx_check_revision(); 6667a2e0513SAfzal Mohammed am33xx_check_features(); 667ab7b2ffcSTero Kristo omap2_prcm_base_init(); 6688835cf6eSAmbresh K am43xx_powerdomains_init(); 6698835cf6eSAmbresh K am43xx_clockdomains_init(); 6708835cf6eSAmbresh K am43xx_hwmod_init(); 6718835cf6eSAmbresh K omap_hwmod_init_postsetup(); 672d941f86fSSekhar Nori omap_l2_cache_init(); 673d22031e2STero Kristo omap_clk_soc_init = am43xx_dt_clk_init; 674c5107027SAfzal Mohammed } 675765e7a06SNishanth Menon 676765e7a06SNishanth Menon void __init am43xx_init_late(void) 677765e7a06SNishanth Menon { 678765e7a06SNishanth Menon omap_common_late_init(); 67908224a7dSDave Gerlach omap2_clk_enable_autoidle_all(); 680765e7a06SNishanth Menon } 681c5107027SAfzal Mohammed #endif 682c5107027SAfzal Mohammed 683c4e2d245SSanjeev Premi #ifdef CONFIG_ARCH_OMAP4 6848f5b5a41STony Lindgren void __init omap4430_init_early(void) 6858f5b5a41STony Lindgren { 686b6a4226cSPaul Walmsley omap2_set_globals_tap(OMAP443X_CLASS, 687b6a4226cSPaul Walmsley OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE)); 688d9a16f9aSPaul Walmsley omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE)); 689ca125b5eSTero Kristo omap2_control_base_init(); 6904de34f35SVaibhav Hiremath omap4xxx_check_revision(); 6914de34f35SVaibhav Hiremath omap4xxx_check_features(); 692ab7b2ffcSTero Kristo omap2_prcm_base_init(); 693de70af49SNishanth Menon omap4_pm_init_early(); 6947b250affSTony Lindgren omap44xx_voltagedomains_init(); 6957b250affSTony Lindgren omap44xx_powerdomains_init(); 6967b250affSTony Lindgren omap44xx_clockdomains_init(); 6977b250affSTony Lindgren omap44xx_hwmod_init(); 6987b250affSTony Lindgren omap_hwmod_init_postsetup(); 699b39b14e6SSekhar Nori omap_l2_cache_init(); 700c8c88d85STero Kristo omap_clk_soc_init = omap4xxx_dt_clk_init; 7018f5b5a41STony Lindgren } 702bbd707acSShawn Guo 703bbd707acSShawn Guo void __init omap4430_init_late(void) 704bbd707acSShawn Guo { 7054ed12be0SRuslan Bilovol omap_common_late_init(); 706bbd707acSShawn Guo omap4_pm_init(); 70723fb8ba3SRajendra Nayak omap2_clk_enable_autoidle_all(); 708bbd707acSShawn Guo } 709c4e2d245SSanjeev Premi #endif 7108f5b5a41STony Lindgren 71105e152c7SR Sricharan #ifdef CONFIG_SOC_OMAP5 71205e152c7SR Sricharan void __init omap5_init_early(void) 71305e152c7SR Sricharan { 714b6a4226cSPaul Walmsley omap2_set_globals_tap(OMAP54XX_CLASS, 715b6a4226cSPaul Walmsley OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE)); 716d9a16f9aSPaul Walmsley omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); 717ca125b5eSTero Kristo omap2_control_base_init(); 718628ed471SSantosh Shilimkar omap4_pm_init_early(); 719ab7b2ffcSTero Kristo omap2_prcm_base_init(); 72005e152c7SR Sricharan omap5xxx_check_revision(); 721e4020aa9SSantosh Shilimkar omap54xx_voltagedomains_init(); 722e4020aa9SSantosh Shilimkar omap54xx_powerdomains_init(); 723e4020aa9SSantosh Shilimkar omap54xx_clockdomains_init(); 724e4020aa9SSantosh Shilimkar omap54xx_hwmod_init(); 725e4020aa9SSantosh Shilimkar omap_hwmod_init_postsetup(); 726cfa9667dSTero Kristo omap_clk_soc_init = omap5xxx_dt_clk_init; 72705e152c7SR Sricharan } 728765e7a06SNishanth Menon 729765e7a06SNishanth Menon void __init omap5_init_late(void) 730765e7a06SNishanth Menon { 731765e7a06SNishanth Menon omap_common_late_init(); 732628ed471SSantosh Shilimkar omap4_pm_init(); 733628ed471SSantosh Shilimkar omap2_clk_enable_autoidle_all(); 734765e7a06SNishanth Menon } 73505e152c7SR Sricharan #endif 73605e152c7SR Sricharan 737a3a9384aSR Sricharan #ifdef CONFIG_SOC_DRA7XX 738a3a9384aSR Sricharan void __init dra7xx_init_early(void) 739a3a9384aSR Sricharan { 740a3a9384aSR Sricharan omap2_set_globals_tap(-1, OMAP2_L4_IO_ADDRESS(DRA7XX_TAP_BASE)); 741a3a9384aSR Sricharan omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); 742ca125b5eSTero Kristo omap2_control_base_init(); 7436af16a1dSRajendra Nayak omap4_pm_init_early(); 744ab7b2ffcSTero Kristo omap2_prcm_base_init(); 745733d20eeSNishanth Menon dra7xxx_check_revision(); 7467de516a6SAmbresh K dra7xx_powerdomains_init(); 7477de516a6SAmbresh K dra7xx_clockdomains_init(); 7487de516a6SAmbresh K dra7xx_hwmod_init(); 7497de516a6SAmbresh K omap_hwmod_init_postsetup(); 750f1cf498eSTero Kristo omap_clk_soc_init = dra7xx_dt_clk_init; 751a3a9384aSR Sricharan } 752765e7a06SNishanth Menon 753765e7a06SNishanth Menon void __init dra7xx_init_late(void) 754765e7a06SNishanth Menon { 755765e7a06SNishanth Menon omap_common_late_init(); 7566af16a1dSRajendra Nayak omap4_pm_init(); 7576af16a1dSRajendra Nayak omap2_clk_enable_autoidle_all(); 758765e7a06SNishanth Menon } 759a3a9384aSR Sricharan #endif 760a3a9384aSR Sricharan 761a3a9384aSR Sricharan 762a4ca9dbeSTony Lindgren void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, 7634805734bSPaul Walmsley struct omap_sdrc_params *sdrc_cs1) 7644805734bSPaul Walmsley { 765a66cb345STony Lindgren omap_sram_init(); 766a66cb345STony Lindgren 76701001712SHemant Pedanekar if (cpu_is_omap24xx() || omap3_has_sdrc()) { 76858cda884SJean Pihet omap2_sdrc_init(sdrc_cs0, sdrc_cs1); 7692f135eafSPaul Walmsley _omap2_init_reprogram_sdrc(); 770aa4b1f6eSKevin Hilman } 7711dbae815STony Lindgren } 772cfa9667dSTero Kristo 773cfa9667dSTero Kristo int __init omap_clk_init(void) 774cfa9667dSTero Kristo { 775cfa9667dSTero Kristo int ret = 0; 776cfa9667dSTero Kristo 777cfa9667dSTero Kristo if (!omap_clk_soc_init) 778cfa9667dSTero Kristo return 0; 779cfa9667dSTero Kristo 7808111e010STero Kristo ti_clk_init_features(); 7818111e010STero Kristo 782e9e63088STero Kristo omap2_clk_setup_ll_ops(); 783e9e63088STero Kristo 784eded36feSTero Kristo if (of_have_populated_dt()) { 785fe87414fSTero Kristo ret = omap_control_init(); 786fe87414fSTero Kristo if (ret) 787fe87414fSTero Kristo return ret; 788fe87414fSTero Kristo 7893a1a388eSTero Kristo ret = omap_prcm_init(); 790c08ee14cSTero Kristo if (ret) 791c08ee14cSTero Kristo return ret; 792c08ee14cSTero Kristo 793c08ee14cSTero Kristo of_clk_init(NULL); 794c08ee14cSTero Kristo 795c08ee14cSTero Kristo ti_dt_clk_init_retry_clks(); 796c08ee14cSTero Kristo 797c08ee14cSTero Kristo ti_dt_clockdomains_setup(); 798eded36feSTero Kristo } 799c08ee14cSTero Kristo 800cfa9667dSTero Kristo ret = omap_clk_soc_init(); 801cfa9667dSTero Kristo 802cfa9667dSTero Kristo return ret; 803cfa9667dSTero Kristo } 804