18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * linux/arch/arm/mach-omap2/io.c 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * OMAP2 I/O mapping code 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Copyright (C) 2005 Nokia Corporation 88c2ecf20Sopenharmony_ci * Copyright (C) 2007-2009 Texas Instruments 98c2ecf20Sopenharmony_ci * 108c2ecf20Sopenharmony_ci * Author: 118c2ecf20Sopenharmony_ci * Juha Yrjola <juha.yrjola@nokia.com> 128c2ecf20Sopenharmony_ci * Syed Khasim <x0khasim@ti.com> 138c2ecf20Sopenharmony_ci * 148c2ecf20Sopenharmony_ci * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> 158c2ecf20Sopenharmony_ci */ 168c2ecf20Sopenharmony_ci#include <linux/module.h> 178c2ecf20Sopenharmony_ci#include <linux/kernel.h> 188c2ecf20Sopenharmony_ci#include <linux/init.h> 198c2ecf20Sopenharmony_ci#include <linux/io.h> 208c2ecf20Sopenharmony_ci#include <linux/clk.h> 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci#include <asm/tlb.h> 238c2ecf20Sopenharmony_ci#include <asm/mach/map.h> 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci#include <linux/omap-dma.h> 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci#include "omap_hwmod.h" 288c2ecf20Sopenharmony_ci#include "soc.h" 298c2ecf20Sopenharmony_ci#include "iomap.h" 308c2ecf20Sopenharmony_ci#include "voltage.h" 318c2ecf20Sopenharmony_ci#include "powerdomain.h" 328c2ecf20Sopenharmony_ci#include "clockdomain.h" 338c2ecf20Sopenharmony_ci#include "common.h" 348c2ecf20Sopenharmony_ci#include "clock.h" 358c2ecf20Sopenharmony_ci#include "clock2xxx.h" 368c2ecf20Sopenharmony_ci#include "clock3xxx.h" 378c2ecf20Sopenharmony_ci#include "sdrc.h" 388c2ecf20Sopenharmony_ci#include "control.h" 398c2ecf20Sopenharmony_ci#include "serial.h" 408c2ecf20Sopenharmony_ci#include "sram.h" 418c2ecf20Sopenharmony_ci#include "cm2xxx.h" 428c2ecf20Sopenharmony_ci#include "cm3xxx.h" 438c2ecf20Sopenharmony_ci#include "cm33xx.h" 448c2ecf20Sopenharmony_ci#include "cm44xx.h" 458c2ecf20Sopenharmony_ci#include "prm.h" 468c2ecf20Sopenharmony_ci#include "cm.h" 478c2ecf20Sopenharmony_ci#include "prcm_mpu44xx.h" 488c2ecf20Sopenharmony_ci#include "prminst44xx.h" 498c2ecf20Sopenharmony_ci#include "prm2xxx.h" 508c2ecf20Sopenharmony_ci#include "prm3xxx.h" 518c2ecf20Sopenharmony_ci#include "prm33xx.h" 528c2ecf20Sopenharmony_ci#include "prm44xx.h" 538c2ecf20Sopenharmony_ci#include "opp2xxx.h" 548c2ecf20Sopenharmony_ci#include "omap-secure.h" 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci/* 578c2ecf20Sopenharmony_ci * omap_clk_soc_init: points to a function that does the SoC-specific 588c2ecf20Sopenharmony_ci * clock initializations 598c2ecf20Sopenharmony_ci */ 608c2ecf20Sopenharmony_cistatic int (*omap_clk_soc_init)(void); 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci/* 638c2ecf20Sopenharmony_ci * The machine specific code may provide the extra mapping besides the 648c2ecf20Sopenharmony_ci * default mapping provided here. 658c2ecf20Sopenharmony_ci */ 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci#if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430) 688c2ecf20Sopenharmony_cistatic struct map_desc omap24xx_io_desc[] __initdata = { 698c2ecf20Sopenharmony_ci { 708c2ecf20Sopenharmony_ci .virtual = L3_24XX_VIRT, 718c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L3_24XX_PHYS), 728c2ecf20Sopenharmony_ci .length = L3_24XX_SIZE, 738c2ecf20Sopenharmony_ci .type = MT_DEVICE 748c2ecf20Sopenharmony_ci }, 758c2ecf20Sopenharmony_ci { 768c2ecf20Sopenharmony_ci .virtual = L4_24XX_VIRT, 778c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_24XX_PHYS), 788c2ecf20Sopenharmony_ci .length = L4_24XX_SIZE, 798c2ecf20Sopenharmony_ci .type = MT_DEVICE 808c2ecf20Sopenharmony_ci }, 818c2ecf20Sopenharmony_ci}; 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_OMAP2420 848c2ecf20Sopenharmony_cistatic struct map_desc omap242x_io_desc[] __initdata = { 858c2ecf20Sopenharmony_ci { 868c2ecf20Sopenharmony_ci .virtual = DSP_MEM_2420_VIRT, 878c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(DSP_MEM_2420_PHYS), 888c2ecf20Sopenharmony_ci .length = DSP_MEM_2420_SIZE, 898c2ecf20Sopenharmony_ci .type = MT_DEVICE 908c2ecf20Sopenharmony_ci }, 918c2ecf20Sopenharmony_ci { 928c2ecf20Sopenharmony_ci .virtual = DSP_IPI_2420_VIRT, 938c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(DSP_IPI_2420_PHYS), 948c2ecf20Sopenharmony_ci .length = DSP_IPI_2420_SIZE, 958c2ecf20Sopenharmony_ci .type = MT_DEVICE 968c2ecf20Sopenharmony_ci }, 978c2ecf20Sopenharmony_ci { 988c2ecf20Sopenharmony_ci .virtual = DSP_MMU_2420_VIRT, 998c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(DSP_MMU_2420_PHYS), 1008c2ecf20Sopenharmony_ci .length = DSP_MMU_2420_SIZE, 1018c2ecf20Sopenharmony_ci .type = MT_DEVICE 1028c2ecf20Sopenharmony_ci }, 1038c2ecf20Sopenharmony_ci}; 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci#endif 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_OMAP2430 1088c2ecf20Sopenharmony_cistatic struct map_desc omap243x_io_desc[] __initdata = { 1098c2ecf20Sopenharmony_ci { 1108c2ecf20Sopenharmony_ci .virtual = L4_WK_243X_VIRT, 1118c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_WK_243X_PHYS), 1128c2ecf20Sopenharmony_ci .length = L4_WK_243X_SIZE, 1138c2ecf20Sopenharmony_ci .type = MT_DEVICE 1148c2ecf20Sopenharmony_ci }, 1158c2ecf20Sopenharmony_ci { 1168c2ecf20Sopenharmony_ci .virtual = OMAP243X_GPMC_VIRT, 1178c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS), 1188c2ecf20Sopenharmony_ci .length = OMAP243X_GPMC_SIZE, 1198c2ecf20Sopenharmony_ci .type = MT_DEVICE 1208c2ecf20Sopenharmony_ci }, 1218c2ecf20Sopenharmony_ci { 1228c2ecf20Sopenharmony_ci .virtual = OMAP243X_SDRC_VIRT, 1238c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(OMAP243X_SDRC_PHYS), 1248c2ecf20Sopenharmony_ci .length = OMAP243X_SDRC_SIZE, 1258c2ecf20Sopenharmony_ci .type = MT_DEVICE 1268c2ecf20Sopenharmony_ci }, 1278c2ecf20Sopenharmony_ci { 1288c2ecf20Sopenharmony_ci .virtual = OMAP243X_SMS_VIRT, 1298c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(OMAP243X_SMS_PHYS), 1308c2ecf20Sopenharmony_ci .length = OMAP243X_SMS_SIZE, 1318c2ecf20Sopenharmony_ci .type = MT_DEVICE 1328c2ecf20Sopenharmony_ci }, 1338c2ecf20Sopenharmony_ci}; 1348c2ecf20Sopenharmony_ci#endif 1358c2ecf20Sopenharmony_ci#endif 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_ci#ifdef CONFIG_ARCH_OMAP3 1388c2ecf20Sopenharmony_cistatic struct map_desc omap34xx_io_desc[] __initdata = { 1398c2ecf20Sopenharmony_ci { 1408c2ecf20Sopenharmony_ci .virtual = L3_34XX_VIRT, 1418c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L3_34XX_PHYS), 1428c2ecf20Sopenharmony_ci .length = L3_34XX_SIZE, 1438c2ecf20Sopenharmony_ci .type = MT_DEVICE 1448c2ecf20Sopenharmony_ci }, 1458c2ecf20Sopenharmony_ci { 1468c2ecf20Sopenharmony_ci .virtual = L4_34XX_VIRT, 1478c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_34XX_PHYS), 1488c2ecf20Sopenharmony_ci .length = L4_34XX_SIZE, 1498c2ecf20Sopenharmony_ci .type = MT_DEVICE 1508c2ecf20Sopenharmony_ci }, 1518c2ecf20Sopenharmony_ci { 1528c2ecf20Sopenharmony_ci .virtual = OMAP34XX_GPMC_VIRT, 1538c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS), 1548c2ecf20Sopenharmony_ci .length = OMAP34XX_GPMC_SIZE, 1558c2ecf20Sopenharmony_ci .type = MT_DEVICE 1568c2ecf20Sopenharmony_ci }, 1578c2ecf20Sopenharmony_ci { 1588c2ecf20Sopenharmony_ci .virtual = OMAP343X_SMS_VIRT, 1598c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(OMAP343X_SMS_PHYS), 1608c2ecf20Sopenharmony_ci .length = OMAP343X_SMS_SIZE, 1618c2ecf20Sopenharmony_ci .type = MT_DEVICE 1628c2ecf20Sopenharmony_ci }, 1638c2ecf20Sopenharmony_ci { 1648c2ecf20Sopenharmony_ci .virtual = OMAP343X_SDRC_VIRT, 1658c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(OMAP343X_SDRC_PHYS), 1668c2ecf20Sopenharmony_ci .length = OMAP343X_SDRC_SIZE, 1678c2ecf20Sopenharmony_ci .type = MT_DEVICE 1688c2ecf20Sopenharmony_ci }, 1698c2ecf20Sopenharmony_ci { 1708c2ecf20Sopenharmony_ci .virtual = L4_PER_34XX_VIRT, 1718c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_PER_34XX_PHYS), 1728c2ecf20Sopenharmony_ci .length = L4_PER_34XX_SIZE, 1738c2ecf20Sopenharmony_ci .type = MT_DEVICE 1748c2ecf20Sopenharmony_ci }, 1758c2ecf20Sopenharmony_ci { 1768c2ecf20Sopenharmony_ci .virtual = L4_EMU_34XX_VIRT, 1778c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_EMU_34XX_PHYS), 1788c2ecf20Sopenharmony_ci .length = L4_EMU_34XX_SIZE, 1798c2ecf20Sopenharmony_ci .type = MT_DEVICE 1808c2ecf20Sopenharmony_ci }, 1818c2ecf20Sopenharmony_ci}; 1828c2ecf20Sopenharmony_ci#endif 1838c2ecf20Sopenharmony_ci 1848c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_TI81XX 1858c2ecf20Sopenharmony_cistatic struct map_desc omapti81xx_io_desc[] __initdata = { 1868c2ecf20Sopenharmony_ci { 1878c2ecf20Sopenharmony_ci .virtual = L4_34XX_VIRT, 1888c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_34XX_PHYS), 1898c2ecf20Sopenharmony_ci .length = L4_34XX_SIZE, 1908c2ecf20Sopenharmony_ci .type = MT_DEVICE 1918c2ecf20Sopenharmony_ci } 1928c2ecf20Sopenharmony_ci}; 1938c2ecf20Sopenharmony_ci#endif 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci#if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX) 1968c2ecf20Sopenharmony_cistatic struct map_desc omapam33xx_io_desc[] __initdata = { 1978c2ecf20Sopenharmony_ci { 1988c2ecf20Sopenharmony_ci .virtual = L4_34XX_VIRT, 1998c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_34XX_PHYS), 2008c2ecf20Sopenharmony_ci .length = L4_34XX_SIZE, 2018c2ecf20Sopenharmony_ci .type = MT_DEVICE 2028c2ecf20Sopenharmony_ci }, 2038c2ecf20Sopenharmony_ci { 2048c2ecf20Sopenharmony_ci .virtual = L4_WK_AM33XX_VIRT, 2058c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_WK_AM33XX_PHYS), 2068c2ecf20Sopenharmony_ci .length = L4_WK_AM33XX_SIZE, 2078c2ecf20Sopenharmony_ci .type = MT_DEVICE 2088c2ecf20Sopenharmony_ci } 2098c2ecf20Sopenharmony_ci}; 2108c2ecf20Sopenharmony_ci#endif 2118c2ecf20Sopenharmony_ci 2128c2ecf20Sopenharmony_ci#ifdef CONFIG_ARCH_OMAP4 2138c2ecf20Sopenharmony_cistatic struct map_desc omap44xx_io_desc[] __initdata = { 2148c2ecf20Sopenharmony_ci { 2158c2ecf20Sopenharmony_ci .virtual = L3_44XX_VIRT, 2168c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L3_44XX_PHYS), 2178c2ecf20Sopenharmony_ci .length = L3_44XX_SIZE, 2188c2ecf20Sopenharmony_ci .type = MT_DEVICE, 2198c2ecf20Sopenharmony_ci }, 2208c2ecf20Sopenharmony_ci { 2218c2ecf20Sopenharmony_ci .virtual = L4_44XX_VIRT, 2228c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_44XX_PHYS), 2238c2ecf20Sopenharmony_ci .length = L4_44XX_SIZE, 2248c2ecf20Sopenharmony_ci .type = MT_DEVICE, 2258c2ecf20Sopenharmony_ci }, 2268c2ecf20Sopenharmony_ci { 2278c2ecf20Sopenharmony_ci .virtual = L4_PER_44XX_VIRT, 2288c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_PER_44XX_PHYS), 2298c2ecf20Sopenharmony_ci .length = L4_PER_44XX_SIZE, 2308c2ecf20Sopenharmony_ci .type = MT_DEVICE, 2318c2ecf20Sopenharmony_ci }, 2328c2ecf20Sopenharmony_ci}; 2338c2ecf20Sopenharmony_ci#endif 2348c2ecf20Sopenharmony_ci 2358c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_OMAP5 2368c2ecf20Sopenharmony_cistatic struct map_desc omap54xx_io_desc[] __initdata = { 2378c2ecf20Sopenharmony_ci { 2388c2ecf20Sopenharmony_ci .virtual = L3_54XX_VIRT, 2398c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L3_54XX_PHYS), 2408c2ecf20Sopenharmony_ci .length = L3_54XX_SIZE, 2418c2ecf20Sopenharmony_ci .type = MT_DEVICE, 2428c2ecf20Sopenharmony_ci }, 2438c2ecf20Sopenharmony_ci { 2448c2ecf20Sopenharmony_ci .virtual = L4_54XX_VIRT, 2458c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_54XX_PHYS), 2468c2ecf20Sopenharmony_ci .length = L4_54XX_SIZE, 2478c2ecf20Sopenharmony_ci .type = MT_DEVICE, 2488c2ecf20Sopenharmony_ci }, 2498c2ecf20Sopenharmony_ci { 2508c2ecf20Sopenharmony_ci .virtual = L4_WK_54XX_VIRT, 2518c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_WK_54XX_PHYS), 2528c2ecf20Sopenharmony_ci .length = L4_WK_54XX_SIZE, 2538c2ecf20Sopenharmony_ci .type = MT_DEVICE, 2548c2ecf20Sopenharmony_ci }, 2558c2ecf20Sopenharmony_ci { 2568c2ecf20Sopenharmony_ci .virtual = L4_PER_54XX_VIRT, 2578c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_PER_54XX_PHYS), 2588c2ecf20Sopenharmony_ci .length = L4_PER_54XX_SIZE, 2598c2ecf20Sopenharmony_ci .type = MT_DEVICE, 2608c2ecf20Sopenharmony_ci }, 2618c2ecf20Sopenharmony_ci}; 2628c2ecf20Sopenharmony_ci#endif 2638c2ecf20Sopenharmony_ci 2648c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_DRA7XX 2658c2ecf20Sopenharmony_cistatic struct map_desc dra7xx_io_desc[] __initdata = { 2668c2ecf20Sopenharmony_ci { 2678c2ecf20Sopenharmony_ci .virtual = L4_CFG_MPU_DRA7XX_VIRT, 2688c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_CFG_MPU_DRA7XX_PHYS), 2698c2ecf20Sopenharmony_ci .length = L4_CFG_MPU_DRA7XX_SIZE, 2708c2ecf20Sopenharmony_ci .type = MT_DEVICE, 2718c2ecf20Sopenharmony_ci }, 2728c2ecf20Sopenharmony_ci { 2738c2ecf20Sopenharmony_ci .virtual = L3_MAIN_SN_DRA7XX_VIRT, 2748c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L3_MAIN_SN_DRA7XX_PHYS), 2758c2ecf20Sopenharmony_ci .length = L3_MAIN_SN_DRA7XX_SIZE, 2768c2ecf20Sopenharmony_ci .type = MT_DEVICE, 2778c2ecf20Sopenharmony_ci }, 2788c2ecf20Sopenharmony_ci { 2798c2ecf20Sopenharmony_ci .virtual = L4_PER1_DRA7XX_VIRT, 2808c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_PER1_DRA7XX_PHYS), 2818c2ecf20Sopenharmony_ci .length = L4_PER1_DRA7XX_SIZE, 2828c2ecf20Sopenharmony_ci .type = MT_DEVICE, 2838c2ecf20Sopenharmony_ci }, 2848c2ecf20Sopenharmony_ci { 2858c2ecf20Sopenharmony_ci .virtual = L4_PER2_DRA7XX_VIRT, 2868c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_PER2_DRA7XX_PHYS), 2878c2ecf20Sopenharmony_ci .length = L4_PER2_DRA7XX_SIZE, 2888c2ecf20Sopenharmony_ci .type = MT_DEVICE, 2898c2ecf20Sopenharmony_ci }, 2908c2ecf20Sopenharmony_ci { 2918c2ecf20Sopenharmony_ci .virtual = L4_PER3_DRA7XX_VIRT, 2928c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_PER3_DRA7XX_PHYS), 2938c2ecf20Sopenharmony_ci .length = L4_PER3_DRA7XX_SIZE, 2948c2ecf20Sopenharmony_ci .type = MT_DEVICE, 2958c2ecf20Sopenharmony_ci }, 2968c2ecf20Sopenharmony_ci { 2978c2ecf20Sopenharmony_ci .virtual = L4_CFG_DRA7XX_VIRT, 2988c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_CFG_DRA7XX_PHYS), 2998c2ecf20Sopenharmony_ci .length = L4_CFG_DRA7XX_SIZE, 3008c2ecf20Sopenharmony_ci .type = MT_DEVICE, 3018c2ecf20Sopenharmony_ci }, 3028c2ecf20Sopenharmony_ci { 3038c2ecf20Sopenharmony_ci .virtual = L4_WKUP_DRA7XX_VIRT, 3048c2ecf20Sopenharmony_ci .pfn = __phys_to_pfn(L4_WKUP_DRA7XX_PHYS), 3058c2ecf20Sopenharmony_ci .length = L4_WKUP_DRA7XX_SIZE, 3068c2ecf20Sopenharmony_ci .type = MT_DEVICE, 3078c2ecf20Sopenharmony_ci }, 3088c2ecf20Sopenharmony_ci}; 3098c2ecf20Sopenharmony_ci#endif 3108c2ecf20Sopenharmony_ci 3118c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_OMAP2420 3128c2ecf20Sopenharmony_civoid __init omap242x_map_io(void) 3138c2ecf20Sopenharmony_ci{ 3148c2ecf20Sopenharmony_ci iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); 3158c2ecf20Sopenharmony_ci iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc)); 3168c2ecf20Sopenharmony_ci} 3178c2ecf20Sopenharmony_ci#endif 3188c2ecf20Sopenharmony_ci 3198c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_OMAP2430 3208c2ecf20Sopenharmony_civoid __init omap243x_map_io(void) 3218c2ecf20Sopenharmony_ci{ 3228c2ecf20Sopenharmony_ci iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); 3238c2ecf20Sopenharmony_ci iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc)); 3248c2ecf20Sopenharmony_ci} 3258c2ecf20Sopenharmony_ci#endif 3268c2ecf20Sopenharmony_ci 3278c2ecf20Sopenharmony_ci#ifdef CONFIG_ARCH_OMAP3 3288c2ecf20Sopenharmony_civoid __init omap3_map_io(void) 3298c2ecf20Sopenharmony_ci{ 3308c2ecf20Sopenharmony_ci iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc)); 3318c2ecf20Sopenharmony_ci} 3328c2ecf20Sopenharmony_ci#endif 3338c2ecf20Sopenharmony_ci 3348c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_TI81XX 3358c2ecf20Sopenharmony_civoid __init ti81xx_map_io(void) 3368c2ecf20Sopenharmony_ci{ 3378c2ecf20Sopenharmony_ci iotable_init(omapti81xx_io_desc, ARRAY_SIZE(omapti81xx_io_desc)); 3388c2ecf20Sopenharmony_ci} 3398c2ecf20Sopenharmony_ci#endif 3408c2ecf20Sopenharmony_ci 3418c2ecf20Sopenharmony_ci#if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX) 3428c2ecf20Sopenharmony_civoid __init am33xx_map_io(void) 3438c2ecf20Sopenharmony_ci{ 3448c2ecf20Sopenharmony_ci iotable_init(omapam33xx_io_desc, ARRAY_SIZE(omapam33xx_io_desc)); 3458c2ecf20Sopenharmony_ci} 3468c2ecf20Sopenharmony_ci#endif 3478c2ecf20Sopenharmony_ci 3488c2ecf20Sopenharmony_ci#ifdef CONFIG_ARCH_OMAP4 3498c2ecf20Sopenharmony_civoid __init omap4_map_io(void) 3508c2ecf20Sopenharmony_ci{ 3518c2ecf20Sopenharmony_ci iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc)); 3528c2ecf20Sopenharmony_ci omap_barriers_init(); 3538c2ecf20Sopenharmony_ci} 3548c2ecf20Sopenharmony_ci#endif 3558c2ecf20Sopenharmony_ci 3568c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_OMAP5 3578c2ecf20Sopenharmony_civoid __init omap5_map_io(void) 3588c2ecf20Sopenharmony_ci{ 3598c2ecf20Sopenharmony_ci iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc)); 3608c2ecf20Sopenharmony_ci omap_barriers_init(); 3618c2ecf20Sopenharmony_ci} 3628c2ecf20Sopenharmony_ci#endif 3638c2ecf20Sopenharmony_ci 3648c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_DRA7XX 3658c2ecf20Sopenharmony_civoid __init dra7xx_map_io(void) 3668c2ecf20Sopenharmony_ci{ 3678c2ecf20Sopenharmony_ci iotable_init(dra7xx_io_desc, ARRAY_SIZE(dra7xx_io_desc)); 3688c2ecf20Sopenharmony_ci omap_barriers_init(); 3698c2ecf20Sopenharmony_ci} 3708c2ecf20Sopenharmony_ci#endif 3718c2ecf20Sopenharmony_ci/* 3728c2ecf20Sopenharmony_ci * omap2_init_reprogram_sdrc - reprogram SDRC timing parameters 3738c2ecf20Sopenharmony_ci * 3748c2ecf20Sopenharmony_ci * Sets the CORE DPLL3 M2 divider to the same value that it's at 3758c2ecf20Sopenharmony_ci * currently. This has the effect of setting the SDRC SDRAM AC timing 3768c2ecf20Sopenharmony_ci * registers to the values currently defined by the kernel. Currently 3778c2ecf20Sopenharmony_ci * only defined for OMAP3; will return 0 if called on OMAP2. Returns 3788c2ecf20Sopenharmony_ci * -EINVAL if the dpll3_m2_ck cannot be found, 0 if called on OMAP2, 3798c2ecf20Sopenharmony_ci * or passes along the return value of clk_set_rate(). 3808c2ecf20Sopenharmony_ci */ 3818c2ecf20Sopenharmony_cistatic int __init _omap2_init_reprogram_sdrc(void) 3828c2ecf20Sopenharmony_ci{ 3838c2ecf20Sopenharmony_ci struct clk *dpll3_m2_ck; 3848c2ecf20Sopenharmony_ci int v = -EINVAL; 3858c2ecf20Sopenharmony_ci long rate; 3868c2ecf20Sopenharmony_ci 3878c2ecf20Sopenharmony_ci if (!cpu_is_omap34xx()) 3888c2ecf20Sopenharmony_ci return 0; 3898c2ecf20Sopenharmony_ci 3908c2ecf20Sopenharmony_ci dpll3_m2_ck = clk_get(NULL, "dpll3_m2_ck"); 3918c2ecf20Sopenharmony_ci if (IS_ERR(dpll3_m2_ck)) 3928c2ecf20Sopenharmony_ci return -EINVAL; 3938c2ecf20Sopenharmony_ci 3948c2ecf20Sopenharmony_ci rate = clk_get_rate(dpll3_m2_ck); 3958c2ecf20Sopenharmony_ci pr_info("Reprogramming SDRC clock to %ld Hz\n", rate); 3968c2ecf20Sopenharmony_ci v = clk_set_rate(dpll3_m2_ck, rate); 3978c2ecf20Sopenharmony_ci if (v) 3988c2ecf20Sopenharmony_ci pr_err("dpll3_m2_clk rate change failed: %d\n", v); 3998c2ecf20Sopenharmony_ci 4008c2ecf20Sopenharmony_ci clk_put(dpll3_m2_ck); 4018c2ecf20Sopenharmony_ci 4028c2ecf20Sopenharmony_ci return v; 4038c2ecf20Sopenharmony_ci} 4048c2ecf20Sopenharmony_ci 4058c2ecf20Sopenharmony_cistatic int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data) 4068c2ecf20Sopenharmony_ci{ 4078c2ecf20Sopenharmony_ci return omap_hwmod_set_postsetup_state(oh, *(u8 *)data); 4088c2ecf20Sopenharmony_ci} 4098c2ecf20Sopenharmony_ci 4108c2ecf20Sopenharmony_cistatic void __init __maybe_unused omap_hwmod_init_postsetup(void) 4118c2ecf20Sopenharmony_ci{ 4128c2ecf20Sopenharmony_ci u8 postsetup_state = _HWMOD_STATE_DEFAULT; 4138c2ecf20Sopenharmony_ci 4148c2ecf20Sopenharmony_ci /* Set the default postsetup state for all hwmods */ 4158c2ecf20Sopenharmony_ci omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state); 4168c2ecf20Sopenharmony_ci} 4178c2ecf20Sopenharmony_ci 4188c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_OMAP2420 4198c2ecf20Sopenharmony_civoid __init omap2420_init_early(void) 4208c2ecf20Sopenharmony_ci{ 4218c2ecf20Sopenharmony_ci omap2_set_globals_tap(OMAP242X_CLASS, OMAP2_L4_IO_ADDRESS(0x48014000)); 4228c2ecf20Sopenharmony_ci omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE), 4238c2ecf20Sopenharmony_ci OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE)); 4248c2ecf20Sopenharmony_ci omap2_control_base_init(); 4258c2ecf20Sopenharmony_ci omap2xxx_check_revision(); 4268c2ecf20Sopenharmony_ci omap2_prcm_base_init(); 4278c2ecf20Sopenharmony_ci omap2xxx_voltagedomains_init(); 4288c2ecf20Sopenharmony_ci omap242x_powerdomains_init(); 4298c2ecf20Sopenharmony_ci omap242x_clockdomains_init(); 4308c2ecf20Sopenharmony_ci omap2420_hwmod_init(); 4318c2ecf20Sopenharmony_ci omap_hwmod_init_postsetup(); 4328c2ecf20Sopenharmony_ci omap_clk_soc_init = omap2420_dt_clk_init; 4338c2ecf20Sopenharmony_ci rate_table = omap2420_rate_table; 4348c2ecf20Sopenharmony_ci} 4358c2ecf20Sopenharmony_ci 4368c2ecf20Sopenharmony_civoid __init omap2420_init_late(void) 4378c2ecf20Sopenharmony_ci{ 4388c2ecf20Sopenharmony_ci omap_pm_soc_init = omap2_pm_init; 4398c2ecf20Sopenharmony_ci} 4408c2ecf20Sopenharmony_ci#endif 4418c2ecf20Sopenharmony_ci 4428c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_OMAP2430 4438c2ecf20Sopenharmony_civoid __init omap2430_init_early(void) 4448c2ecf20Sopenharmony_ci{ 4458c2ecf20Sopenharmony_ci omap2_set_globals_tap(OMAP243X_CLASS, OMAP2_L4_IO_ADDRESS(0x4900a000)); 4468c2ecf20Sopenharmony_ci omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE), 4478c2ecf20Sopenharmony_ci OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE)); 4488c2ecf20Sopenharmony_ci omap2_control_base_init(); 4498c2ecf20Sopenharmony_ci omap2xxx_check_revision(); 4508c2ecf20Sopenharmony_ci omap2_prcm_base_init(); 4518c2ecf20Sopenharmony_ci omap2xxx_voltagedomains_init(); 4528c2ecf20Sopenharmony_ci omap243x_powerdomains_init(); 4538c2ecf20Sopenharmony_ci omap243x_clockdomains_init(); 4548c2ecf20Sopenharmony_ci omap2430_hwmod_init(); 4558c2ecf20Sopenharmony_ci omap_hwmod_init_postsetup(); 4568c2ecf20Sopenharmony_ci omap_clk_soc_init = omap2430_dt_clk_init; 4578c2ecf20Sopenharmony_ci rate_table = omap2430_rate_table; 4588c2ecf20Sopenharmony_ci} 4598c2ecf20Sopenharmony_ci 4608c2ecf20Sopenharmony_civoid __init omap2430_init_late(void) 4618c2ecf20Sopenharmony_ci{ 4628c2ecf20Sopenharmony_ci omap_pm_soc_init = omap2_pm_init; 4638c2ecf20Sopenharmony_ci} 4648c2ecf20Sopenharmony_ci#endif 4658c2ecf20Sopenharmony_ci 4668c2ecf20Sopenharmony_ci/* 4678c2ecf20Sopenharmony_ci * Currently only board-omap3beagle.c should call this because of the 4688c2ecf20Sopenharmony_ci * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT. 4698c2ecf20Sopenharmony_ci */ 4708c2ecf20Sopenharmony_ci#ifdef CONFIG_ARCH_OMAP3 4718c2ecf20Sopenharmony_civoid __init omap3_init_early(void) 4728c2ecf20Sopenharmony_ci{ 4738c2ecf20Sopenharmony_ci omap2_set_globals_tap(OMAP343X_CLASS, OMAP2_L4_IO_ADDRESS(0x4830A000)); 4748c2ecf20Sopenharmony_ci omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE), 4758c2ecf20Sopenharmony_ci OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE)); 4768c2ecf20Sopenharmony_ci omap2_control_base_init(); 4778c2ecf20Sopenharmony_ci omap3xxx_check_revision(); 4788c2ecf20Sopenharmony_ci omap3xxx_check_features(); 4798c2ecf20Sopenharmony_ci omap2_prcm_base_init(); 4808c2ecf20Sopenharmony_ci omap3xxx_voltagedomains_init(); 4818c2ecf20Sopenharmony_ci omap3xxx_powerdomains_init(); 4828c2ecf20Sopenharmony_ci omap3xxx_clockdomains_init(); 4838c2ecf20Sopenharmony_ci omap3xxx_hwmod_init(); 4848c2ecf20Sopenharmony_ci omap_hwmod_init_postsetup(); 4858c2ecf20Sopenharmony_ci omap_secure_init(); 4868c2ecf20Sopenharmony_ci} 4878c2ecf20Sopenharmony_ci 4888c2ecf20Sopenharmony_civoid __init omap3430_init_early(void) 4898c2ecf20Sopenharmony_ci{ 4908c2ecf20Sopenharmony_ci omap3_init_early(); 4918c2ecf20Sopenharmony_ci omap_clk_soc_init = omap3430_dt_clk_init; 4928c2ecf20Sopenharmony_ci} 4938c2ecf20Sopenharmony_ci 4948c2ecf20Sopenharmony_civoid __init omap35xx_init_early(void) 4958c2ecf20Sopenharmony_ci{ 4968c2ecf20Sopenharmony_ci omap3_init_early(); 4978c2ecf20Sopenharmony_ci omap_clk_soc_init = omap3430_dt_clk_init; 4988c2ecf20Sopenharmony_ci} 4998c2ecf20Sopenharmony_ci 5008c2ecf20Sopenharmony_civoid __init omap3630_init_early(void) 5018c2ecf20Sopenharmony_ci{ 5028c2ecf20Sopenharmony_ci omap3_init_early(); 5038c2ecf20Sopenharmony_ci omap_clk_soc_init = omap3630_dt_clk_init; 5048c2ecf20Sopenharmony_ci} 5058c2ecf20Sopenharmony_ci 5068c2ecf20Sopenharmony_civoid __init am35xx_init_early(void) 5078c2ecf20Sopenharmony_ci{ 5088c2ecf20Sopenharmony_ci omap3_init_early(); 5098c2ecf20Sopenharmony_ci omap_clk_soc_init = am35xx_dt_clk_init; 5108c2ecf20Sopenharmony_ci} 5118c2ecf20Sopenharmony_ci 5128c2ecf20Sopenharmony_civoid __init omap3_init_late(void) 5138c2ecf20Sopenharmony_ci{ 5148c2ecf20Sopenharmony_ci omap_pm_soc_init = omap3_pm_init; 5158c2ecf20Sopenharmony_ci} 5168c2ecf20Sopenharmony_ci 5178c2ecf20Sopenharmony_civoid __init ti81xx_init_late(void) 5188c2ecf20Sopenharmony_ci{ 5198c2ecf20Sopenharmony_ci omap_pm_soc_init = omap_pm_nop_init; 5208c2ecf20Sopenharmony_ci} 5218c2ecf20Sopenharmony_ci#endif 5228c2ecf20Sopenharmony_ci 5238c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_TI81XX 5248c2ecf20Sopenharmony_civoid __init ti814x_init_early(void) 5258c2ecf20Sopenharmony_ci{ 5268c2ecf20Sopenharmony_ci omap2_set_globals_tap(TI814X_CLASS, 5278c2ecf20Sopenharmony_ci OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE)); 5288c2ecf20Sopenharmony_ci omap2_control_base_init(); 5298c2ecf20Sopenharmony_ci omap3xxx_check_revision(); 5308c2ecf20Sopenharmony_ci ti81xx_check_features(); 5318c2ecf20Sopenharmony_ci omap2_prcm_base_init(); 5328c2ecf20Sopenharmony_ci omap3xxx_voltagedomains_init(); 5338c2ecf20Sopenharmony_ci omap3xxx_powerdomains_init(); 5348c2ecf20Sopenharmony_ci ti814x_clockdomains_init(); 5358c2ecf20Sopenharmony_ci dm814x_hwmod_init(); 5368c2ecf20Sopenharmony_ci omap_hwmod_init_postsetup(); 5378c2ecf20Sopenharmony_ci omap_clk_soc_init = dm814x_dt_clk_init; 5388c2ecf20Sopenharmony_ci omap_secure_init(); 5398c2ecf20Sopenharmony_ci} 5408c2ecf20Sopenharmony_ci 5418c2ecf20Sopenharmony_civoid __init ti816x_init_early(void) 5428c2ecf20Sopenharmony_ci{ 5438c2ecf20Sopenharmony_ci omap2_set_globals_tap(TI816X_CLASS, 5448c2ecf20Sopenharmony_ci OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE)); 5458c2ecf20Sopenharmony_ci omap2_control_base_init(); 5468c2ecf20Sopenharmony_ci omap3xxx_check_revision(); 5478c2ecf20Sopenharmony_ci ti81xx_check_features(); 5488c2ecf20Sopenharmony_ci omap2_prcm_base_init(); 5498c2ecf20Sopenharmony_ci omap3xxx_voltagedomains_init(); 5508c2ecf20Sopenharmony_ci omap3xxx_powerdomains_init(); 5518c2ecf20Sopenharmony_ci ti816x_clockdomains_init(); 5528c2ecf20Sopenharmony_ci dm816x_hwmod_init(); 5538c2ecf20Sopenharmony_ci omap_hwmod_init_postsetup(); 5548c2ecf20Sopenharmony_ci omap_clk_soc_init = dm816x_dt_clk_init; 5558c2ecf20Sopenharmony_ci omap_secure_init(); 5568c2ecf20Sopenharmony_ci} 5578c2ecf20Sopenharmony_ci#endif 5588c2ecf20Sopenharmony_ci 5598c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_AM33XX 5608c2ecf20Sopenharmony_civoid __init am33xx_init_early(void) 5618c2ecf20Sopenharmony_ci{ 5628c2ecf20Sopenharmony_ci omap2_set_globals_tap(AM335X_CLASS, 5638c2ecf20Sopenharmony_ci AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE)); 5648c2ecf20Sopenharmony_ci omap2_control_base_init(); 5658c2ecf20Sopenharmony_ci omap3xxx_check_revision(); 5668c2ecf20Sopenharmony_ci am33xx_check_features(); 5678c2ecf20Sopenharmony_ci omap2_prcm_base_init(); 5688c2ecf20Sopenharmony_ci am33xx_powerdomains_init(); 5698c2ecf20Sopenharmony_ci am33xx_clockdomains_init(); 5708c2ecf20Sopenharmony_ci am33xx_hwmod_init(); 5718c2ecf20Sopenharmony_ci omap_hwmod_init_postsetup(); 5728c2ecf20Sopenharmony_ci omap_clk_soc_init = am33xx_dt_clk_init; 5738c2ecf20Sopenharmony_ci omap_secure_init(); 5748c2ecf20Sopenharmony_ci} 5758c2ecf20Sopenharmony_ci 5768c2ecf20Sopenharmony_civoid __init am33xx_init_late(void) 5778c2ecf20Sopenharmony_ci{ 5788c2ecf20Sopenharmony_ci omap_pm_soc_init = amx3_common_pm_init; 5798c2ecf20Sopenharmony_ci} 5808c2ecf20Sopenharmony_ci#endif 5818c2ecf20Sopenharmony_ci 5828c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_AM43XX 5838c2ecf20Sopenharmony_civoid __init am43xx_init_early(void) 5848c2ecf20Sopenharmony_ci{ 5858c2ecf20Sopenharmony_ci omap2_set_globals_tap(AM335X_CLASS, 5868c2ecf20Sopenharmony_ci AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE)); 5878c2ecf20Sopenharmony_ci omap2_control_base_init(); 5888c2ecf20Sopenharmony_ci omap3xxx_check_revision(); 5898c2ecf20Sopenharmony_ci am33xx_check_features(); 5908c2ecf20Sopenharmony_ci omap2_prcm_base_init(); 5918c2ecf20Sopenharmony_ci am43xx_powerdomains_init(); 5928c2ecf20Sopenharmony_ci am43xx_clockdomains_init(); 5938c2ecf20Sopenharmony_ci am43xx_hwmod_init(); 5948c2ecf20Sopenharmony_ci omap_hwmod_init_postsetup(); 5958c2ecf20Sopenharmony_ci omap_l2_cache_init(); 5968c2ecf20Sopenharmony_ci omap_clk_soc_init = am43xx_dt_clk_init; 5978c2ecf20Sopenharmony_ci omap_secure_init(); 5988c2ecf20Sopenharmony_ci} 5998c2ecf20Sopenharmony_ci 6008c2ecf20Sopenharmony_civoid __init am43xx_init_late(void) 6018c2ecf20Sopenharmony_ci{ 6028c2ecf20Sopenharmony_ci omap_pm_soc_init = amx3_common_pm_init; 6038c2ecf20Sopenharmony_ci} 6048c2ecf20Sopenharmony_ci#endif 6058c2ecf20Sopenharmony_ci 6068c2ecf20Sopenharmony_ci#ifdef CONFIG_ARCH_OMAP4 6078c2ecf20Sopenharmony_civoid __init omap4430_init_early(void) 6088c2ecf20Sopenharmony_ci{ 6098c2ecf20Sopenharmony_ci omap2_set_globals_tap(OMAP443X_CLASS, 6108c2ecf20Sopenharmony_ci OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE)); 6118c2ecf20Sopenharmony_ci omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE)); 6128c2ecf20Sopenharmony_ci omap2_control_base_init(); 6138c2ecf20Sopenharmony_ci omap4xxx_check_revision(); 6148c2ecf20Sopenharmony_ci omap4xxx_check_features(); 6158c2ecf20Sopenharmony_ci omap2_prcm_base_init(); 6168c2ecf20Sopenharmony_ci omap4_sar_ram_init(); 6178c2ecf20Sopenharmony_ci omap4_mpuss_early_init(); 6188c2ecf20Sopenharmony_ci omap4_pm_init_early(); 6198c2ecf20Sopenharmony_ci omap44xx_voltagedomains_init(); 6208c2ecf20Sopenharmony_ci omap44xx_powerdomains_init(); 6218c2ecf20Sopenharmony_ci omap44xx_clockdomains_init(); 6228c2ecf20Sopenharmony_ci omap44xx_hwmod_init(); 6238c2ecf20Sopenharmony_ci omap_hwmod_init_postsetup(); 6248c2ecf20Sopenharmony_ci omap_l2_cache_init(); 6258c2ecf20Sopenharmony_ci omap_clk_soc_init = omap4xxx_dt_clk_init; 6268c2ecf20Sopenharmony_ci omap_secure_init(); 6278c2ecf20Sopenharmony_ci} 6288c2ecf20Sopenharmony_ci 6298c2ecf20Sopenharmony_civoid __init omap4430_init_late(void) 6308c2ecf20Sopenharmony_ci{ 6318c2ecf20Sopenharmony_ci omap_pm_soc_init = omap4_pm_init; 6328c2ecf20Sopenharmony_ci} 6338c2ecf20Sopenharmony_ci#endif 6348c2ecf20Sopenharmony_ci 6358c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_OMAP5 6368c2ecf20Sopenharmony_civoid __init omap5_init_early(void) 6378c2ecf20Sopenharmony_ci{ 6388c2ecf20Sopenharmony_ci omap2_set_globals_tap(OMAP54XX_CLASS, 6398c2ecf20Sopenharmony_ci OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE)); 6408c2ecf20Sopenharmony_ci omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); 6418c2ecf20Sopenharmony_ci omap2_control_base_init(); 6428c2ecf20Sopenharmony_ci omap2_prcm_base_init(); 6438c2ecf20Sopenharmony_ci omap5xxx_check_revision(); 6448c2ecf20Sopenharmony_ci omap4_sar_ram_init(); 6458c2ecf20Sopenharmony_ci omap4_mpuss_early_init(); 6468c2ecf20Sopenharmony_ci omap4_pm_init_early(); 6478c2ecf20Sopenharmony_ci omap54xx_voltagedomains_init(); 6488c2ecf20Sopenharmony_ci omap54xx_powerdomains_init(); 6498c2ecf20Sopenharmony_ci omap54xx_clockdomains_init(); 6508c2ecf20Sopenharmony_ci omap54xx_hwmod_init(); 6518c2ecf20Sopenharmony_ci omap_hwmod_init_postsetup(); 6528c2ecf20Sopenharmony_ci omap_clk_soc_init = omap5xxx_dt_clk_init; 6538c2ecf20Sopenharmony_ci omap_secure_init(); 6548c2ecf20Sopenharmony_ci} 6558c2ecf20Sopenharmony_ci 6568c2ecf20Sopenharmony_civoid __init omap5_init_late(void) 6578c2ecf20Sopenharmony_ci{ 6588c2ecf20Sopenharmony_ci omap_pm_soc_init = omap4_pm_init; 6598c2ecf20Sopenharmony_ci} 6608c2ecf20Sopenharmony_ci#endif 6618c2ecf20Sopenharmony_ci 6628c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_DRA7XX 6638c2ecf20Sopenharmony_civoid __init dra7xx_init_early(void) 6648c2ecf20Sopenharmony_ci{ 6658c2ecf20Sopenharmony_ci omap2_set_globals_tap(DRA7XX_CLASS, 6668c2ecf20Sopenharmony_ci OMAP2_L4_IO_ADDRESS(DRA7XX_TAP_BASE)); 6678c2ecf20Sopenharmony_ci omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); 6688c2ecf20Sopenharmony_ci omap2_control_base_init(); 6698c2ecf20Sopenharmony_ci omap4_pm_init_early(); 6708c2ecf20Sopenharmony_ci omap2_prcm_base_init(); 6718c2ecf20Sopenharmony_ci dra7xxx_check_revision(); 6728c2ecf20Sopenharmony_ci dra7xx_powerdomains_init(); 6738c2ecf20Sopenharmony_ci dra7xx_clockdomains_init(); 6748c2ecf20Sopenharmony_ci dra7xx_hwmod_init(); 6758c2ecf20Sopenharmony_ci omap_hwmod_init_postsetup(); 6768c2ecf20Sopenharmony_ci omap_clk_soc_init = dra7xx_dt_clk_init; 6778c2ecf20Sopenharmony_ci omap_secure_init(); 6788c2ecf20Sopenharmony_ci} 6798c2ecf20Sopenharmony_ci 6808c2ecf20Sopenharmony_civoid __init dra7xx_init_late(void) 6818c2ecf20Sopenharmony_ci{ 6828c2ecf20Sopenharmony_ci omap_pm_soc_init = omap4_pm_init; 6838c2ecf20Sopenharmony_ci} 6848c2ecf20Sopenharmony_ci#endif 6858c2ecf20Sopenharmony_ci 6868c2ecf20Sopenharmony_ci 6878c2ecf20Sopenharmony_civoid __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, 6888c2ecf20Sopenharmony_ci struct omap_sdrc_params *sdrc_cs1) 6898c2ecf20Sopenharmony_ci{ 6908c2ecf20Sopenharmony_ci omap_sram_init(); 6918c2ecf20Sopenharmony_ci 6928c2ecf20Sopenharmony_ci if (cpu_is_omap24xx() || omap3_has_sdrc()) { 6938c2ecf20Sopenharmony_ci omap2_sdrc_init(sdrc_cs0, sdrc_cs1); 6948c2ecf20Sopenharmony_ci _omap2_init_reprogram_sdrc(); 6958c2ecf20Sopenharmony_ci } 6968c2ecf20Sopenharmony_ci} 6978c2ecf20Sopenharmony_ci 6988c2ecf20Sopenharmony_ciint __init omap_clk_init(void) 6998c2ecf20Sopenharmony_ci{ 7008c2ecf20Sopenharmony_ci int ret = 0; 7018c2ecf20Sopenharmony_ci 7028c2ecf20Sopenharmony_ci if (!omap_clk_soc_init) 7038c2ecf20Sopenharmony_ci return 0; 7048c2ecf20Sopenharmony_ci 7058c2ecf20Sopenharmony_ci ti_clk_init_features(); 7068c2ecf20Sopenharmony_ci 7078c2ecf20Sopenharmony_ci omap2_clk_setup_ll_ops(); 7088c2ecf20Sopenharmony_ci 7098c2ecf20Sopenharmony_ci ret = omap_control_init(); 7108c2ecf20Sopenharmony_ci if (ret) 7118c2ecf20Sopenharmony_ci return ret; 7128c2ecf20Sopenharmony_ci 7138c2ecf20Sopenharmony_ci ret = omap_prcm_init(); 7148c2ecf20Sopenharmony_ci if (ret) 7158c2ecf20Sopenharmony_ci return ret; 7168c2ecf20Sopenharmony_ci 7178c2ecf20Sopenharmony_ci of_clk_init(NULL); 7188c2ecf20Sopenharmony_ci 7198c2ecf20Sopenharmony_ci ti_dt_clk_init_retry_clks(); 7208c2ecf20Sopenharmony_ci 7218c2ecf20Sopenharmony_ci ti_dt_clockdomains_setup(); 7228c2ecf20Sopenharmony_ci 7238c2ecf20Sopenharmony_ci ret = omap_clk_soc_init(); 7248c2ecf20Sopenharmony_ci 7258c2ecf20Sopenharmony_ci return ret; 7268c2ecf20Sopenharmony_ci} 727