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" 403e6ece13SPaul Walmsley #include "sdrc.h" 41b6a4226cSPaul Walmsley #include "control.h" 423d82cbbbSTony Lindgren #include "serial.h" 43bf027ca1STony Lindgren #include "sram.h" 44c4ceedcbSPaul Walmsley #include "cm2xxx.h" 45c4ceedcbSPaul Walmsley #include "cm3xxx.h" 467632a02fSTero Kristo #include "cm33xx.h" 47ab6c9bbfSTero Kristo #include "cm44xx.h" 48d9a16f9aSPaul Walmsley #include "prm.h" 49d9a16f9aSPaul Walmsley #include "cm.h" 50d9a16f9aSPaul Walmsley #include "prcm_mpu44xx.h" 51d9a16f9aSPaul Walmsley #include "prminst44xx.h" 5263a293e0SPaul Walmsley #include "prm2xxx.h" 5363a293e0SPaul Walmsley #include "prm3xxx.h" 54d9bbe84fSTero Kristo #include "prm33xx.h" 5563a293e0SPaul Walmsley #include "prm44xx.h" 5669a1e7a1STero Kristo #include "opp2xxx.h" 571dbae815STony Lindgren 581dbae815STony Lindgren /* 59cfa9667dSTero Kristo * omap_clk_soc_init: points to a function that does the SoC-specific 60ff931c82SRajendra Nayak * clock initializations 61ff931c82SRajendra Nayak */ 62cfa9667dSTero Kristo static int (*omap_clk_soc_init)(void); 63ff931c82SRajendra Nayak 64ff931c82SRajendra Nayak /* 651dbae815STony Lindgren * The machine specific code may provide the extra mapping besides the 661dbae815STony Lindgren * default mapping provided here. 671dbae815STony Lindgren */ 68cc26b3b0SSyed Mohammed, Khasim 69e48f814eSTony Lindgren #if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430) 70cc26b3b0SSyed Mohammed, Khasim static struct map_desc omap24xx_io_desc[] __initdata = { 711dbae815STony Lindgren { 721dbae815STony Lindgren .virtual = L3_24XX_VIRT, 731dbae815STony Lindgren .pfn = __phys_to_pfn(L3_24XX_PHYS), 741dbae815STony Lindgren .length = L3_24XX_SIZE, 751dbae815STony Lindgren .type = MT_DEVICE 761dbae815STony Lindgren }, 7709f21ed4SKyungmin Park { 7809f21ed4SKyungmin Park .virtual = L4_24XX_VIRT, 7909f21ed4SKyungmin Park .pfn = __phys_to_pfn(L4_24XX_PHYS), 8009f21ed4SKyungmin Park .length = L4_24XX_SIZE, 8109f21ed4SKyungmin Park .type = MT_DEVICE 8209f21ed4SKyungmin Park }, 83cc26b3b0SSyed Mohammed, Khasim }; 84cc26b3b0SSyed Mohammed, Khasim 8559b479e0STony Lindgren #ifdef CONFIG_SOC_OMAP2420 86cc26b3b0SSyed Mohammed, Khasim static struct map_desc omap242x_io_desc[] __initdata = { 871dbae815STony Lindgren { 887adb9987SPaul Walmsley .virtual = DSP_MEM_2420_VIRT, 897adb9987SPaul Walmsley .pfn = __phys_to_pfn(DSP_MEM_2420_PHYS), 907adb9987SPaul Walmsley .length = DSP_MEM_2420_SIZE, 91c40fae95STony Lindgren .type = MT_DEVICE 92c40fae95STony Lindgren }, 93c40fae95STony Lindgren { 947adb9987SPaul Walmsley .virtual = DSP_IPI_2420_VIRT, 957adb9987SPaul Walmsley .pfn = __phys_to_pfn(DSP_IPI_2420_PHYS), 967adb9987SPaul Walmsley .length = DSP_IPI_2420_SIZE, 97c40fae95STony Lindgren .type = MT_DEVICE 98c40fae95STony Lindgren }, 99c40fae95STony Lindgren { 1007adb9987SPaul Walmsley .virtual = DSP_MMU_2420_VIRT, 1017adb9987SPaul Walmsley .pfn = __phys_to_pfn(DSP_MMU_2420_PHYS), 1027adb9987SPaul Walmsley .length = DSP_MMU_2420_SIZE, 1031dbae815STony Lindgren .type = MT_DEVICE 104cc26b3b0SSyed Mohammed, Khasim }, 1051dbae815STony Lindgren }; 1061dbae815STony Lindgren 107cc26b3b0SSyed Mohammed, Khasim #endif 108cc26b3b0SSyed Mohammed, Khasim 10959b479e0STony Lindgren #ifdef CONFIG_SOC_OMAP2430 110cc26b3b0SSyed Mohammed, Khasim static struct map_desc omap243x_io_desc[] __initdata = { 111cc26b3b0SSyed Mohammed, Khasim { 112cc26b3b0SSyed Mohammed, Khasim .virtual = L4_WK_243X_VIRT, 113cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(L4_WK_243X_PHYS), 114cc26b3b0SSyed Mohammed, Khasim .length = L4_WK_243X_SIZE, 115cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 116cc26b3b0SSyed Mohammed, Khasim }, 117cc26b3b0SSyed Mohammed, Khasim { 118cc26b3b0SSyed Mohammed, Khasim .virtual = OMAP243X_GPMC_VIRT, 119cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS), 120cc26b3b0SSyed Mohammed, Khasim .length = OMAP243X_GPMC_SIZE, 121cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 122cc26b3b0SSyed Mohammed, Khasim }, 123cc26b3b0SSyed Mohammed, Khasim { 124cc26b3b0SSyed Mohammed, Khasim .virtual = OMAP243X_SDRC_VIRT, 125cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(OMAP243X_SDRC_PHYS), 126cc26b3b0SSyed Mohammed, Khasim .length = OMAP243X_SDRC_SIZE, 127cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 128cc26b3b0SSyed Mohammed, Khasim }, 129cc26b3b0SSyed Mohammed, Khasim { 130cc26b3b0SSyed Mohammed, Khasim .virtual = OMAP243X_SMS_VIRT, 131cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(OMAP243X_SMS_PHYS), 132cc26b3b0SSyed Mohammed, Khasim .length = OMAP243X_SMS_SIZE, 133cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 134cc26b3b0SSyed Mohammed, Khasim }, 135cc26b3b0SSyed Mohammed, Khasim }; 136cc26b3b0SSyed Mohammed, Khasim #endif 137cc26b3b0SSyed Mohammed, Khasim #endif 138cc26b3b0SSyed Mohammed, Khasim 139a8eb7ca0STony Lindgren #ifdef CONFIG_ARCH_OMAP3 140cc26b3b0SSyed Mohammed, Khasim static struct map_desc omap34xx_io_desc[] __initdata = { 141cc26b3b0SSyed Mohammed, Khasim { 142cc26b3b0SSyed Mohammed, Khasim .virtual = L3_34XX_VIRT, 143cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(L3_34XX_PHYS), 144cc26b3b0SSyed Mohammed, Khasim .length = L3_34XX_SIZE, 145cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 146cc26b3b0SSyed Mohammed, Khasim }, 147cc26b3b0SSyed Mohammed, Khasim { 148cc26b3b0SSyed Mohammed, Khasim .virtual = L4_34XX_VIRT, 149cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(L4_34XX_PHYS), 150cc26b3b0SSyed Mohammed, Khasim .length = L4_34XX_SIZE, 151cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 152cc26b3b0SSyed Mohammed, Khasim }, 153cc26b3b0SSyed Mohammed, Khasim { 154cc26b3b0SSyed Mohammed, Khasim .virtual = OMAP34XX_GPMC_VIRT, 155cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS), 156cc26b3b0SSyed Mohammed, Khasim .length = OMAP34XX_GPMC_SIZE, 157cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 158cc26b3b0SSyed Mohammed, Khasim }, 159cc26b3b0SSyed Mohammed, Khasim { 160cc26b3b0SSyed Mohammed, Khasim .virtual = OMAP343X_SMS_VIRT, 161cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(OMAP343X_SMS_PHYS), 162cc26b3b0SSyed Mohammed, Khasim .length = OMAP343X_SMS_SIZE, 163cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 164cc26b3b0SSyed Mohammed, Khasim }, 165cc26b3b0SSyed Mohammed, Khasim { 166cc26b3b0SSyed Mohammed, Khasim .virtual = OMAP343X_SDRC_VIRT, 167cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(OMAP343X_SDRC_PHYS), 168cc26b3b0SSyed Mohammed, Khasim .length = OMAP343X_SDRC_SIZE, 169cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 170cc26b3b0SSyed Mohammed, Khasim }, 171cc26b3b0SSyed Mohammed, Khasim { 172cc26b3b0SSyed Mohammed, Khasim .virtual = L4_PER_34XX_VIRT, 173cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(L4_PER_34XX_PHYS), 174cc26b3b0SSyed Mohammed, Khasim .length = L4_PER_34XX_SIZE, 175cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 176cc26b3b0SSyed Mohammed, Khasim }, 177cc26b3b0SSyed Mohammed, Khasim { 178cc26b3b0SSyed Mohammed, Khasim .virtual = L4_EMU_34XX_VIRT, 179cc26b3b0SSyed Mohammed, Khasim .pfn = __phys_to_pfn(L4_EMU_34XX_PHYS), 180cc26b3b0SSyed Mohammed, Khasim .length = L4_EMU_34XX_SIZE, 181cc26b3b0SSyed Mohammed, Khasim .type = MT_DEVICE 182cc26b3b0SSyed Mohammed, Khasim }, 183cc26b3b0SSyed Mohammed, Khasim }; 184cc26b3b0SSyed Mohammed, Khasim #endif 18501001712SHemant Pedanekar 18633959553SKevin Hilman #ifdef CONFIG_SOC_TI81XX 187a920360fSHemant Pedanekar static struct map_desc omapti81xx_io_desc[] __initdata = { 18801001712SHemant Pedanekar { 18901001712SHemant Pedanekar .virtual = L4_34XX_VIRT, 19001001712SHemant Pedanekar .pfn = __phys_to_pfn(L4_34XX_PHYS), 19101001712SHemant Pedanekar .length = L4_34XX_SIZE, 19201001712SHemant Pedanekar .type = MT_DEVICE 1931e6cb146SAfzal Mohammed } 1941e6cb146SAfzal Mohammed }; 1951e6cb146SAfzal Mohammed #endif 1961e6cb146SAfzal Mohammed 197addb154aSAfzal Mohammed #if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX) 1981e6cb146SAfzal Mohammed static struct map_desc omapam33xx_io_desc[] __initdata = { 19901001712SHemant Pedanekar { 20001001712SHemant Pedanekar .virtual = L4_34XX_VIRT, 20101001712SHemant Pedanekar .pfn = __phys_to_pfn(L4_34XX_PHYS), 20201001712SHemant Pedanekar .length = L4_34XX_SIZE, 20301001712SHemant Pedanekar .type = MT_DEVICE 20401001712SHemant Pedanekar }, 2051e6cb146SAfzal Mohammed { 2061e6cb146SAfzal Mohammed .virtual = L4_WK_AM33XX_VIRT, 2071e6cb146SAfzal Mohammed .pfn = __phys_to_pfn(L4_WK_AM33XX_PHYS), 2081e6cb146SAfzal Mohammed .length = L4_WK_AM33XX_SIZE, 2091e6cb146SAfzal Mohammed .type = MT_DEVICE 2101e6cb146SAfzal Mohammed } 21101001712SHemant Pedanekar }; 21201001712SHemant Pedanekar #endif 21301001712SHemant Pedanekar 21444169075SSantosh Shilimkar #ifdef CONFIG_ARCH_OMAP4 21544169075SSantosh Shilimkar static struct map_desc omap44xx_io_desc[] __initdata = { 21644169075SSantosh Shilimkar { 21744169075SSantosh Shilimkar .virtual = L3_44XX_VIRT, 21844169075SSantosh Shilimkar .pfn = __phys_to_pfn(L3_44XX_PHYS), 21944169075SSantosh Shilimkar .length = L3_44XX_SIZE, 22044169075SSantosh Shilimkar .type = MT_DEVICE, 22144169075SSantosh Shilimkar }, 22244169075SSantosh Shilimkar { 22344169075SSantosh Shilimkar .virtual = L4_44XX_VIRT, 22444169075SSantosh Shilimkar .pfn = __phys_to_pfn(L4_44XX_PHYS), 22544169075SSantosh Shilimkar .length = L4_44XX_SIZE, 22644169075SSantosh Shilimkar .type = MT_DEVICE, 22744169075SSantosh Shilimkar }, 22844169075SSantosh Shilimkar { 22944169075SSantosh Shilimkar .virtual = L4_PER_44XX_VIRT, 23044169075SSantosh Shilimkar .pfn = __phys_to_pfn(L4_PER_44XX_PHYS), 23144169075SSantosh Shilimkar .length = L4_PER_44XX_SIZE, 23244169075SSantosh Shilimkar .type = MT_DEVICE, 23344169075SSantosh Shilimkar }, 23444169075SSantosh Shilimkar }; 23544169075SSantosh Shilimkar #endif 236cc26b3b0SSyed Mohammed, Khasim 237ea827ad5SNishanth Menon #ifdef CONFIG_SOC_OMAP5 23805e152c7SR Sricharan static struct map_desc omap54xx_io_desc[] __initdata = { 23905e152c7SR Sricharan { 24005e152c7SR Sricharan .virtual = L3_54XX_VIRT, 24105e152c7SR Sricharan .pfn = __phys_to_pfn(L3_54XX_PHYS), 24205e152c7SR Sricharan .length = L3_54XX_SIZE, 24305e152c7SR Sricharan .type = MT_DEVICE, 24405e152c7SR Sricharan }, 24505e152c7SR Sricharan { 24605e152c7SR Sricharan .virtual = L4_54XX_VIRT, 24705e152c7SR Sricharan .pfn = __phys_to_pfn(L4_54XX_PHYS), 24805e152c7SR Sricharan .length = L4_54XX_SIZE, 24905e152c7SR Sricharan .type = MT_DEVICE, 25005e152c7SR Sricharan }, 25105e152c7SR Sricharan { 25205e152c7SR Sricharan .virtual = L4_WK_54XX_VIRT, 25305e152c7SR Sricharan .pfn = __phys_to_pfn(L4_WK_54XX_PHYS), 25405e152c7SR Sricharan .length = L4_WK_54XX_SIZE, 25505e152c7SR Sricharan .type = MT_DEVICE, 25605e152c7SR Sricharan }, 25705e152c7SR Sricharan { 25805e152c7SR Sricharan .virtual = L4_PER_54XX_VIRT, 25905e152c7SR Sricharan .pfn = __phys_to_pfn(L4_PER_54XX_PHYS), 26005e152c7SR Sricharan .length = L4_PER_54XX_SIZE, 26105e152c7SR Sricharan .type = MT_DEVICE, 26205e152c7SR Sricharan }, 26305e152c7SR Sricharan }; 26405e152c7SR Sricharan #endif 26505e152c7SR Sricharan 266ea827ad5SNishanth Menon #ifdef CONFIG_SOC_DRA7XX 267ea827ad5SNishanth Menon static struct map_desc dra7xx_io_desc[] __initdata = { 268ea827ad5SNishanth Menon { 269ea827ad5SNishanth Menon .virtual = L4_CFG_MPU_DRA7XX_VIRT, 270ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L4_CFG_MPU_DRA7XX_PHYS), 271ea827ad5SNishanth Menon .length = L4_CFG_MPU_DRA7XX_SIZE, 272ea827ad5SNishanth Menon .type = MT_DEVICE, 273ea827ad5SNishanth Menon }, 274ea827ad5SNishanth Menon { 275ea827ad5SNishanth Menon .virtual = L3_MAIN_SN_DRA7XX_VIRT, 276ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L3_MAIN_SN_DRA7XX_PHYS), 277ea827ad5SNishanth Menon .length = L3_MAIN_SN_DRA7XX_SIZE, 278ea827ad5SNishanth Menon .type = MT_DEVICE, 279ea827ad5SNishanth Menon }, 280ea827ad5SNishanth Menon { 281ea827ad5SNishanth Menon .virtual = L4_PER1_DRA7XX_VIRT, 282ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L4_PER1_DRA7XX_PHYS), 283ea827ad5SNishanth Menon .length = L4_PER1_DRA7XX_SIZE, 284ea827ad5SNishanth Menon .type = MT_DEVICE, 285ea827ad5SNishanth Menon }, 286ea827ad5SNishanth Menon { 287ea827ad5SNishanth Menon .virtual = L4_PER2_DRA7XX_VIRT, 288ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L4_PER2_DRA7XX_PHYS), 289ea827ad5SNishanth Menon .length = L4_PER2_DRA7XX_SIZE, 290ea827ad5SNishanth Menon .type = MT_DEVICE, 291ea827ad5SNishanth Menon }, 292ea827ad5SNishanth Menon { 293ea827ad5SNishanth Menon .virtual = L4_PER3_DRA7XX_VIRT, 294ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L4_PER3_DRA7XX_PHYS), 295ea827ad5SNishanth Menon .length = L4_PER3_DRA7XX_SIZE, 296ea827ad5SNishanth Menon .type = MT_DEVICE, 297ea827ad5SNishanth Menon }, 298ea827ad5SNishanth Menon { 299ea827ad5SNishanth Menon .virtual = L4_CFG_DRA7XX_VIRT, 300ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L4_CFG_DRA7XX_PHYS), 301ea827ad5SNishanth Menon .length = L4_CFG_DRA7XX_SIZE, 302ea827ad5SNishanth Menon .type = MT_DEVICE, 303ea827ad5SNishanth Menon }, 304ea827ad5SNishanth Menon { 305ea827ad5SNishanth Menon .virtual = L4_WKUP_DRA7XX_VIRT, 306ea827ad5SNishanth Menon .pfn = __phys_to_pfn(L4_WKUP_DRA7XX_PHYS), 307ea827ad5SNishanth Menon .length = L4_WKUP_DRA7XX_SIZE, 308ea827ad5SNishanth Menon .type = MT_DEVICE, 309ea827ad5SNishanth Menon }, 310ea827ad5SNishanth Menon }; 311ea827ad5SNishanth Menon #endif 312ea827ad5SNishanth Menon 31359b479e0STony Lindgren #ifdef CONFIG_SOC_OMAP2420 314b6a4226cSPaul Walmsley void __init omap242x_map_io(void) 3156fbd55d0STony Lindgren { 3166fbd55d0STony Lindgren iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); 3176fbd55d0STony Lindgren iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc)); 3186fbd55d0STony Lindgren } 3196fbd55d0STony Lindgren #endif 3206fbd55d0STony Lindgren 32159b479e0STony Lindgren #ifdef CONFIG_SOC_OMAP2430 322b6a4226cSPaul Walmsley void __init omap243x_map_io(void) 3236fbd55d0STony Lindgren { 3246fbd55d0STony Lindgren iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); 3256fbd55d0STony Lindgren iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc)); 3266fbd55d0STony Lindgren } 3276fbd55d0STony Lindgren #endif 3286fbd55d0STony Lindgren 329a8eb7ca0STony Lindgren #ifdef CONFIG_ARCH_OMAP3 330b6a4226cSPaul Walmsley void __init omap3_map_io(void) 3316fbd55d0STony Lindgren { 3326fbd55d0STony Lindgren iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc)); 3336fbd55d0STony Lindgren } 3346fbd55d0STony Lindgren #endif 3356fbd55d0STony Lindgren 33633959553SKevin Hilman #ifdef CONFIG_SOC_TI81XX 337b6a4226cSPaul Walmsley void __init ti81xx_map_io(void) 33801001712SHemant Pedanekar { 339a920360fSHemant Pedanekar iotable_init(omapti81xx_io_desc, ARRAY_SIZE(omapti81xx_io_desc)); 34001001712SHemant Pedanekar } 34101001712SHemant Pedanekar #endif 34201001712SHemant Pedanekar 343addb154aSAfzal Mohammed #if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX) 344b6a4226cSPaul Walmsley void __init am33xx_map_io(void) 3451e6cb146SAfzal Mohammed { 3461e6cb146SAfzal Mohammed iotable_init(omapam33xx_io_desc, ARRAY_SIZE(omapam33xx_io_desc)); 3476fbd55d0STony Lindgren } 3486fbd55d0STony Lindgren #endif 3496fbd55d0STony Lindgren 3506fbd55d0STony Lindgren #ifdef CONFIG_ARCH_OMAP4 351b6a4226cSPaul Walmsley void __init omap4_map_io(void) 3526fbd55d0STony Lindgren { 3536fbd55d0STony Lindgren iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc)); 354f746929fSRussell King omap_barriers_init(); 3556fbd55d0STony Lindgren } 3566fbd55d0STony Lindgren #endif 3576fbd55d0STony Lindgren 358ea827ad5SNishanth Menon #ifdef CONFIG_SOC_OMAP5 359b6a4226cSPaul Walmsley void __init omap5_map_io(void) 36005e152c7SR Sricharan { 36105e152c7SR Sricharan iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc)); 362f746929fSRussell King omap_barriers_init(); 36305e152c7SR Sricharan } 36405e152c7SR Sricharan #endif 365ea827ad5SNishanth Menon 366ea827ad5SNishanth Menon #ifdef CONFIG_SOC_DRA7XX 367ea827ad5SNishanth Menon void __init dra7xx_map_io(void) 368ea827ad5SNishanth Menon { 369ea827ad5SNishanth Menon iotable_init(dra7xx_io_desc, ARRAY_SIZE(dra7xx_io_desc)); 370456e8d53SNishanth Menon omap_barriers_init(); 371ea827ad5SNishanth Menon } 372ea827ad5SNishanth Menon #endif 3732f135eafSPaul Walmsley /* 3742f135eafSPaul Walmsley * omap2_init_reprogram_sdrc - reprogram SDRC timing parameters 3752f135eafSPaul Walmsley * 3762f135eafSPaul Walmsley * Sets the CORE DPLL3 M2 divider to the same value that it's at 3772f135eafSPaul Walmsley * currently. This has the effect of setting the SDRC SDRAM AC timing 3782f135eafSPaul Walmsley * registers to the values currently defined by the kernel. Currently 3792f135eafSPaul Walmsley * only defined for OMAP3; will return 0 if called on OMAP2. Returns 3802f135eafSPaul Walmsley * -EINVAL if the dpll3_m2_ck cannot be found, 0 if called on OMAP2, 3812f135eafSPaul Walmsley * or passes along the return value of clk_set_rate(). 3822f135eafSPaul Walmsley */ 3832f135eafSPaul Walmsley static int __init _omap2_init_reprogram_sdrc(void) 3842f135eafSPaul Walmsley { 3852f135eafSPaul Walmsley struct clk *dpll3_m2_ck; 3862f135eafSPaul Walmsley int v = -EINVAL; 3872f135eafSPaul Walmsley long rate; 3882f135eafSPaul Walmsley 3892f135eafSPaul Walmsley if (!cpu_is_omap34xx()) 3902f135eafSPaul Walmsley return 0; 3912f135eafSPaul Walmsley 3922f135eafSPaul Walmsley dpll3_m2_ck = clk_get(NULL, "dpll3_m2_ck"); 393e281f7ecSAaro Koskinen if (IS_ERR(dpll3_m2_ck)) 3942f135eafSPaul Walmsley return -EINVAL; 3952f135eafSPaul Walmsley 3962f135eafSPaul Walmsley rate = clk_get_rate(dpll3_m2_ck); 3972f135eafSPaul Walmsley pr_info("Reprogramming SDRC clock to %ld Hz\n", rate); 3982f135eafSPaul Walmsley v = clk_set_rate(dpll3_m2_ck, rate); 3992f135eafSPaul Walmsley if (v) 4002f135eafSPaul Walmsley pr_err("dpll3_m2_clk rate change failed: %d\n", v); 4012f135eafSPaul Walmsley 4022f135eafSPaul Walmsley clk_put(dpll3_m2_ck); 4032f135eafSPaul Walmsley 4042f135eafSPaul Walmsley return v; 4052f135eafSPaul Walmsley } 4062f135eafSPaul Walmsley 4072092e5ccSPaul Walmsley static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data) 4082092e5ccSPaul Walmsley { 4092092e5ccSPaul Walmsley return omap_hwmod_set_postsetup_state(oh, *(u8 *)data); 4102092e5ccSPaul Walmsley } 4112092e5ccSPaul Walmsley 412293ea3d0SArnd Bergmann static void __init __maybe_unused omap_hwmod_init_postsetup(void) 413120db2cbSTony Lindgren { 4142092e5ccSPaul Walmsley u8 postsetup_state; 4152092e5ccSPaul Walmsley 4162092e5ccSPaul Walmsley /* Set the default postsetup state for all hwmods */ 417bf7c5449SRafael J. Wysocki #ifdef CONFIG_PM 4182092e5ccSPaul Walmsley postsetup_state = _HWMOD_STATE_IDLE; 4192092e5ccSPaul Walmsley #else 4202092e5ccSPaul Walmsley postsetup_state = _HWMOD_STATE_ENABLED; 4212092e5ccSPaul Walmsley #endif 4222092e5ccSPaul Walmsley omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state); 4234805734bSPaul Walmsley } 4244805734bSPaul Walmsley 42516110798SPaul Walmsley #ifdef CONFIG_SOC_OMAP2420 4268f5b5a41STony Lindgren void __init omap2420_init_early(void) 4278f5b5a41STony Lindgren { 428b6a4226cSPaul Walmsley omap2_set_globals_tap(OMAP242X_CLASS, OMAP2_L4_IO_ADDRESS(0x48014000)); 429b6a4226cSPaul Walmsley omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE), 430b6a4226cSPaul Walmsley OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE)); 4312208bf11STero Kristo omap2_control_base_init(); 4324de34f35SVaibhav Hiremath omap2xxx_check_revision(); 433ab7b2ffcSTero Kristo omap2_prcm_base_init(); 4347b250affSTony Lindgren omap2xxx_voltagedomains_init(); 4357b250affSTony Lindgren omap242x_powerdomains_init(); 4367b250affSTony Lindgren omap242x_clockdomains_init(); 4377b250affSTony Lindgren omap2420_hwmod_init(); 4387b250affSTony Lindgren omap_hwmod_init_postsetup(); 43969a1e7a1STero Kristo omap_clk_soc_init = omap2420_dt_clk_init; 44069a1e7a1STero Kristo rate_table = omap2420_rate_table; 4418f5b5a41STony Lindgren } 442bbd707acSShawn Guo 443bbd707acSShawn Guo void __init omap2420_init_late(void) 444bbd707acSShawn Guo { 445*02b83dcbSTony Lindgren omap_pm_soc_init = omap2_pm_init; 446bbd707acSShawn Guo } 44716110798SPaul Walmsley #endif 4488f5b5a41STony Lindgren 44916110798SPaul Walmsley #ifdef CONFIG_SOC_OMAP2430 4508f5b5a41STony Lindgren void __init omap2430_init_early(void) 4518f5b5a41STony Lindgren { 452b6a4226cSPaul Walmsley omap2_set_globals_tap(OMAP243X_CLASS, OMAP2_L4_IO_ADDRESS(0x4900a000)); 453b6a4226cSPaul Walmsley omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE), 454b6a4226cSPaul Walmsley OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE)); 4552208bf11STero Kristo omap2_control_base_init(); 4564de34f35SVaibhav Hiremath omap2xxx_check_revision(); 457ab7b2ffcSTero Kristo omap2_prcm_base_init(); 4587b250affSTony Lindgren omap2xxx_voltagedomains_init(); 4597b250affSTony Lindgren omap243x_powerdomains_init(); 4607b250affSTony Lindgren omap243x_clockdomains_init(); 4617b250affSTony Lindgren omap2430_hwmod_init(); 4627b250affSTony Lindgren omap_hwmod_init_postsetup(); 46369a1e7a1STero Kristo omap_clk_soc_init = omap2430_dt_clk_init; 46469a1e7a1STero Kristo rate_table = omap2430_rate_table; 4657b250affSTony Lindgren } 466bbd707acSShawn Guo 467bbd707acSShawn Guo void __init omap2430_init_late(void) 468bbd707acSShawn Guo { 469*02b83dcbSTony Lindgren omap_pm_soc_init = omap2_pm_init; 470bbd707acSShawn Guo } 471c4e2d245SSanjeev Premi #endif 4727b250affSTony Lindgren 4737b250affSTony Lindgren /* 4747b250affSTony Lindgren * Currently only board-omap3beagle.c should call this because of the 4757b250affSTony Lindgren * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT. 4767b250affSTony Lindgren */ 477c4e2d245SSanjeev Premi #ifdef CONFIG_ARCH_OMAP3 4787b250affSTony Lindgren void __init omap3_init_early(void) 4797b250affSTony Lindgren { 480b6a4226cSPaul Walmsley omap2_set_globals_tap(OMAP343X_CLASS, OMAP2_L4_IO_ADDRESS(0x4830A000)); 481b6a4226cSPaul Walmsley omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE), 482b6a4226cSPaul Walmsley OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE)); 4832208bf11STero Kristo omap2_control_base_init(); 4844de34f35SVaibhav Hiremath omap3xxx_check_revision(); 4854de34f35SVaibhav Hiremath omap3xxx_check_features(); 486ab7b2ffcSTero Kristo omap2_prcm_base_init(); 4877b250affSTony Lindgren omap3xxx_voltagedomains_init(); 4887b250affSTony Lindgren omap3xxx_powerdomains_init(); 4897b250affSTony Lindgren omap3xxx_clockdomains_init(); 4907b250affSTony Lindgren omap3xxx_hwmod_init(); 4917b250affSTony Lindgren omap_hwmod_init_postsetup(); 4928f5b5a41STony Lindgren } 4938f5b5a41STony Lindgren 4948f5b5a41STony Lindgren void __init omap3430_init_early(void) 4958f5b5a41STony Lindgren { 4967b250affSTony Lindgren omap3_init_early(); 4973e049157STero Kristo omap_clk_soc_init = omap3430_dt_clk_init; 4988f5b5a41STony Lindgren } 4998f5b5a41STony Lindgren 5008f5b5a41STony Lindgren void __init omap35xx_init_early(void) 5018f5b5a41STony Lindgren { 5027b250affSTony Lindgren omap3_init_early(); 5033e049157STero Kristo omap_clk_soc_init = omap3430_dt_clk_init; 5048f5b5a41STony Lindgren } 5058f5b5a41STony Lindgren 5068f5b5a41STony Lindgren void __init omap3630_init_early(void) 5078f5b5a41STony Lindgren { 5087b250affSTony Lindgren omap3_init_early(); 5093e049157STero Kristo omap_clk_soc_init = omap3630_dt_clk_init; 5108f5b5a41STony Lindgren } 5118f5b5a41STony Lindgren 5128f5b5a41STony Lindgren void __init am35xx_init_early(void) 5138f5b5a41STony Lindgren { 5147b250affSTony Lindgren omap3_init_early(); 5153e049157STero Kristo omap_clk_soc_init = am35xx_dt_clk_init; 5168f5b5a41STony Lindgren } 5178f5b5a41STony Lindgren 518bbd707acSShawn Guo void __init omap3_init_late(void) 519bbd707acSShawn Guo { 520*02b83dcbSTony Lindgren omap_pm_soc_init = omap3_pm_init; 521bbd707acSShawn Guo } 522bbd707acSShawn Guo 523bbd707acSShawn Guo void __init ti81xx_init_late(void) 524bbd707acSShawn Guo { 525*02b83dcbSTony Lindgren omap_pm_soc_init = omap_pm_nop_init; 526bbd707acSShawn Guo } 527c4e2d245SSanjeev Premi #endif 5288f5b5a41STony Lindgren 529a64459c4SAida Mynzhasova #ifdef CONFIG_SOC_TI81XX 530a64459c4SAida Mynzhasova void __init ti814x_init_early(void) 531a64459c4SAida Mynzhasova { 532a64459c4SAida Mynzhasova omap2_set_globals_tap(TI814X_CLASS, 533a64459c4SAida Mynzhasova OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE)); 5342208bf11STero Kristo omap2_control_base_init(); 535a64459c4SAida Mynzhasova omap3xxx_check_revision(); 536a64459c4SAida Mynzhasova ti81xx_check_features(); 537ab7b2ffcSTero Kristo omap2_prcm_base_init(); 538a64459c4SAida Mynzhasova omap3xxx_voltagedomains_init(); 539a64459c4SAida Mynzhasova omap3xxx_powerdomains_init(); 540185fde6dSTony Lindgren ti814x_clockdomains_init(); 5410f3ccb24STony Lindgren dm814x_hwmod_init(); 542a64459c4SAida Mynzhasova omap_hwmod_init_postsetup(); 5439cf705deSTony Lindgren omap_clk_soc_init = dm814x_dt_clk_init; 544a64459c4SAida Mynzhasova } 545a64459c4SAida Mynzhasova 546a64459c4SAida Mynzhasova void __init ti816x_init_early(void) 547a64459c4SAida Mynzhasova { 548a64459c4SAida Mynzhasova omap2_set_globals_tap(TI816X_CLASS, 549a64459c4SAida Mynzhasova OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE)); 5502208bf11STero Kristo omap2_control_base_init(); 551a64459c4SAida Mynzhasova omap3xxx_check_revision(); 552a64459c4SAida Mynzhasova ti81xx_check_features(); 553ab7b2ffcSTero Kristo omap2_prcm_base_init(); 554a64459c4SAida Mynzhasova omap3xxx_voltagedomains_init(); 555a64459c4SAida Mynzhasova omap3xxx_powerdomains_init(); 556185fde6dSTony Lindgren ti816x_clockdomains_init(); 5570f3ccb24STony Lindgren dm816x_hwmod_init(); 558a64459c4SAida Mynzhasova omap_hwmod_init_postsetup(); 5599cf705deSTony Lindgren omap_clk_soc_init = dm816x_dt_clk_init; 560a64459c4SAida Mynzhasova } 561a64459c4SAida Mynzhasova #endif 562a64459c4SAida Mynzhasova 56308f30989SAfzal Mohammed #ifdef CONFIG_SOC_AM33XX 56408f30989SAfzal Mohammed void __init am33xx_init_early(void) 56508f30989SAfzal Mohammed { 566b6a4226cSPaul Walmsley omap2_set_globals_tap(AM335X_CLASS, 567b6a4226cSPaul Walmsley AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE)); 5682208bf11STero Kristo omap2_control_base_init(); 56908f30989SAfzal Mohammed omap3xxx_check_revision(); 5707bcad170SVaibhav Hiremath am33xx_check_features(); 571ab7b2ffcSTero Kristo omap2_prcm_base_init(); 5723f0ea764SVaibhav Hiremath am33xx_powerdomains_init(); 5739c80f3aaSVaibhav Hiremath am33xx_clockdomains_init(); 574a2cfc509SVaibhav Hiremath am33xx_hwmod_init(); 575a2cfc509SVaibhav Hiremath omap_hwmod_init_postsetup(); 576149c09d3STero Kristo omap_clk_soc_init = am33xx_dt_clk_init; 57708f30989SAfzal Mohammed } 578765e7a06SNishanth Menon 579765e7a06SNishanth Menon void __init am33xx_init_late(void) 580765e7a06SNishanth Menon { 581*02b83dcbSTony Lindgren omap_pm_soc_init = amx3_common_pm_init; 582765e7a06SNishanth Menon } 58308f30989SAfzal Mohammed #endif 58408f30989SAfzal Mohammed 585c5107027SAfzal Mohammed #ifdef CONFIG_SOC_AM43XX 586c5107027SAfzal Mohammed void __init am43xx_init_early(void) 587c5107027SAfzal Mohammed { 588c5107027SAfzal Mohammed omap2_set_globals_tap(AM335X_CLASS, 589c5107027SAfzal Mohammed AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE)); 5902208bf11STero Kristo omap2_control_base_init(); 591c5107027SAfzal Mohammed omap3xxx_check_revision(); 5927a2e0513SAfzal Mohammed am33xx_check_features(); 593ab7b2ffcSTero Kristo omap2_prcm_base_init(); 5948835cf6eSAmbresh K am43xx_powerdomains_init(); 5958835cf6eSAmbresh K am43xx_clockdomains_init(); 5968835cf6eSAmbresh K am43xx_hwmod_init(); 5978835cf6eSAmbresh K omap_hwmod_init_postsetup(); 598d941f86fSSekhar Nori omap_l2_cache_init(); 599d22031e2STero Kristo omap_clk_soc_init = am43xx_dt_clk_init; 600c5107027SAfzal Mohammed } 601765e7a06SNishanth Menon 602765e7a06SNishanth Menon void __init am43xx_init_late(void) 603765e7a06SNishanth Menon { 604*02b83dcbSTony Lindgren omap_pm_soc_init = amx3_common_pm_init; 605765e7a06SNishanth Menon } 606c5107027SAfzal Mohammed #endif 607c5107027SAfzal Mohammed 608c4e2d245SSanjeev Premi #ifdef CONFIG_ARCH_OMAP4 6098f5b5a41STony Lindgren void __init omap4430_init_early(void) 6108f5b5a41STony Lindgren { 611b6a4226cSPaul Walmsley omap2_set_globals_tap(OMAP443X_CLASS, 612b6a4226cSPaul Walmsley OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE)); 613d9a16f9aSPaul Walmsley omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE)); 614ca125b5eSTero Kristo omap2_control_base_init(); 6154de34f35SVaibhav Hiremath omap4xxx_check_revision(); 6164de34f35SVaibhav Hiremath omap4xxx_check_features(); 617ab7b2ffcSTero Kristo omap2_prcm_base_init(); 618f4b9f40aSTony Lindgren omap4_sar_ram_init(); 6190573b957STony Lindgren omap4_mpuss_early_init(); 620de70af49SNishanth Menon omap4_pm_init_early(); 6217b250affSTony Lindgren omap44xx_voltagedomains_init(); 6227b250affSTony Lindgren omap44xx_powerdomains_init(); 6237b250affSTony Lindgren omap44xx_clockdomains_init(); 6247b250affSTony Lindgren omap44xx_hwmod_init(); 6257b250affSTony Lindgren omap_hwmod_init_postsetup(); 626b39b14e6SSekhar Nori omap_l2_cache_init(); 627c8c88d85STero Kristo omap_clk_soc_init = omap4xxx_dt_clk_init; 6288f5b5a41STony Lindgren } 629bbd707acSShawn Guo 630bbd707acSShawn Guo void __init omap4430_init_late(void) 631bbd707acSShawn Guo { 632*02b83dcbSTony Lindgren omap_pm_soc_init = omap4_pm_init; 633bbd707acSShawn Guo } 634c4e2d245SSanjeev Premi #endif 6358f5b5a41STony Lindgren 63605e152c7SR Sricharan #ifdef CONFIG_SOC_OMAP5 63705e152c7SR Sricharan void __init omap5_init_early(void) 63805e152c7SR Sricharan { 639b6a4226cSPaul Walmsley omap2_set_globals_tap(OMAP54XX_CLASS, 640b6a4226cSPaul Walmsley OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE)); 641d9a16f9aSPaul Walmsley omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); 642ca125b5eSTero Kristo omap2_control_base_init(); 643ab7b2ffcSTero Kristo omap2_prcm_base_init(); 64405e152c7SR Sricharan omap5xxx_check_revision(); 645f4b9f40aSTony Lindgren omap4_sar_ram_init(); 6468a8be46aSTony Lindgren omap4_mpuss_early_init(); 6478a8be46aSTony Lindgren omap4_pm_init_early(); 648e4020aa9SSantosh Shilimkar omap54xx_voltagedomains_init(); 649e4020aa9SSantosh Shilimkar omap54xx_powerdomains_init(); 650e4020aa9SSantosh Shilimkar omap54xx_clockdomains_init(); 651e4020aa9SSantosh Shilimkar omap54xx_hwmod_init(); 652e4020aa9SSantosh Shilimkar omap_hwmod_init_postsetup(); 653cfa9667dSTero Kristo omap_clk_soc_init = omap5xxx_dt_clk_init; 65405e152c7SR Sricharan } 655765e7a06SNishanth Menon 656765e7a06SNishanth Menon void __init omap5_init_late(void) 657765e7a06SNishanth Menon { 658*02b83dcbSTony Lindgren omap_pm_soc_init = omap4_pm_init; 659765e7a06SNishanth Menon } 66005e152c7SR Sricharan #endif 66105e152c7SR Sricharan 662a3a9384aSR Sricharan #ifdef CONFIG_SOC_DRA7XX 663a3a9384aSR Sricharan void __init dra7xx_init_early(void) 664a3a9384aSR Sricharan { 665ec490f6fSNishanth Menon omap2_set_globals_tap(DRA7XX_CLASS, 666ec490f6fSNishanth Menon OMAP2_L4_IO_ADDRESS(DRA7XX_TAP_BASE)); 667a3a9384aSR Sricharan omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); 668ca125b5eSTero Kristo omap2_control_base_init(); 6696af16a1dSRajendra Nayak omap4_pm_init_early(); 670ab7b2ffcSTero Kristo omap2_prcm_base_init(); 671733d20eeSNishanth Menon dra7xxx_check_revision(); 6727de516a6SAmbresh K dra7xx_powerdomains_init(); 6737de516a6SAmbresh K dra7xx_clockdomains_init(); 6747de516a6SAmbresh K dra7xx_hwmod_init(); 6757de516a6SAmbresh K omap_hwmod_init_postsetup(); 676f1cf498eSTero Kristo omap_clk_soc_init = dra7xx_dt_clk_init; 677a3a9384aSR Sricharan } 678765e7a06SNishanth Menon 679765e7a06SNishanth Menon void __init dra7xx_init_late(void) 680765e7a06SNishanth Menon { 681*02b83dcbSTony Lindgren omap_pm_soc_init = omap4_pm_init; 682765e7a06SNishanth Menon } 683a3a9384aSR Sricharan #endif 684a3a9384aSR Sricharan 685a3a9384aSR Sricharan 686a4ca9dbeSTony Lindgren void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, 6874805734bSPaul Walmsley struct omap_sdrc_params *sdrc_cs1) 6884805734bSPaul Walmsley { 689a66cb345STony Lindgren omap_sram_init(); 690a66cb345STony Lindgren 69101001712SHemant Pedanekar if (cpu_is_omap24xx() || omap3_has_sdrc()) { 69258cda884SJean Pihet omap2_sdrc_init(sdrc_cs0, sdrc_cs1); 6932f135eafSPaul Walmsley _omap2_init_reprogram_sdrc(); 694aa4b1f6eSKevin Hilman } 6951dbae815STony Lindgren } 696cfa9667dSTero Kristo 697cfa9667dSTero Kristo int __init omap_clk_init(void) 698cfa9667dSTero Kristo { 699cfa9667dSTero Kristo int ret = 0; 700cfa9667dSTero Kristo 701cfa9667dSTero Kristo if (!omap_clk_soc_init) 702cfa9667dSTero Kristo return 0; 703cfa9667dSTero Kristo 7048111e010STero Kristo ti_clk_init_features(); 7058111e010STero Kristo 706e9e63088STero Kristo omap2_clk_setup_ll_ops(); 707e9e63088STero Kristo 708fe87414fSTero Kristo ret = omap_control_init(); 709fe87414fSTero Kristo if (ret) 710fe87414fSTero Kristo return ret; 711fe87414fSTero Kristo 7123a1a388eSTero Kristo ret = omap_prcm_init(); 713c08ee14cSTero Kristo if (ret) 714c08ee14cSTero Kristo return ret; 715c08ee14cSTero Kristo 716c08ee14cSTero Kristo of_clk_init(NULL); 717c08ee14cSTero Kristo 718c08ee14cSTero Kristo ti_dt_clk_init_retry_clks(); 719c08ee14cSTero Kristo 720c08ee14cSTero Kristo ti_dt_clockdomains_setup(); 721c08ee14cSTero Kristo 722cfa9667dSTero Kristo ret = omap_clk_soc_init(); 723cfa9667dSTero Kristo 724cfa9667dSTero Kristo return ret; 725cfa9667dSTero Kristo } 726