Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * OMAP5 Voltage Management Routines
0004  *
0005  * Based on voltagedomains44xx_data.c
0006  *
0007  * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com
0008  */
0009 #include <linux/kernel.h>
0010 #include <linux/err.h>
0011 #include <linux/init.h>
0012 
0013 #include "common.h"
0014 
0015 #include "prm54xx.h"
0016 #include "voltage.h"
0017 #include "omap_opp_data.h"
0018 #include "vc.h"
0019 #include "vp.h"
0020 
0021 static const struct omap_vfsm_instance omap5_vdd_mpu_vfsm = {
0022     .voltsetup_reg = OMAP54XX_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET,
0023 };
0024 
0025 static const struct omap_vfsm_instance omap5_vdd_mm_vfsm = {
0026     .voltsetup_reg = OMAP54XX_PRM_VOLTSETUP_MM_RET_SLEEP_OFFSET,
0027 };
0028 
0029 static const struct omap_vfsm_instance omap5_vdd_core_vfsm = {
0030     .voltsetup_reg = OMAP54XX_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET,
0031 };
0032 
0033 static struct voltagedomain omap5_voltdm_mpu = {
0034     .name = "mpu",
0035     .scalable = true,
0036     .read = omap4_prm_vcvp_read,
0037     .write = omap4_prm_vcvp_write,
0038     .rmw = omap4_prm_vcvp_rmw,
0039     .vc = &omap4_vc_mpu,
0040     .vfsm = &omap5_vdd_mpu_vfsm,
0041     .vp = &omap4_vp_mpu,
0042 };
0043 
0044 static struct voltagedomain omap5_voltdm_mm = {
0045     .name = "mm",
0046     .scalable = true,
0047     .read = omap4_prm_vcvp_read,
0048     .write = omap4_prm_vcvp_write,
0049     .rmw = omap4_prm_vcvp_rmw,
0050     .vc = &omap4_vc_iva,
0051     .vfsm = &omap5_vdd_mm_vfsm,
0052     .vp = &omap4_vp_iva,
0053 };
0054 
0055 static struct voltagedomain omap5_voltdm_core = {
0056     .name = "core",
0057     .scalable = true,
0058     .read = omap4_prm_vcvp_read,
0059     .write = omap4_prm_vcvp_write,
0060     .rmw = omap4_prm_vcvp_rmw,
0061     .vc = &omap4_vc_core,
0062     .vfsm = &omap5_vdd_core_vfsm,
0063     .vp = &omap4_vp_core,
0064 };
0065 
0066 static struct voltagedomain omap5_voltdm_wkup = {
0067     .name = "wkup",
0068 };
0069 
0070 static struct voltagedomain *voltagedomains_omap5[] __initdata = {
0071     &omap5_voltdm_mpu,
0072     &omap5_voltdm_mm,
0073     &omap5_voltdm_core,
0074     &omap5_voltdm_wkup,
0075     NULL,
0076 };
0077 
0078 static const char *const sys_clk_name __initconst = "sys_clkin";
0079 
0080 void __init omap54xx_voltagedomains_init(void)
0081 {
0082     struct voltagedomain *voltdm;
0083     int i;
0084 
0085     for (i = 0; voltdm = voltagedomains_omap5[i], voltdm; i++)
0086         voltdm->sys_clk.name = sys_clk_name;
0087 
0088     voltdm_init(voltagedomains_omap5);
0089 };