resource_34xx.h

来自「omap3 linux 2.6 用nocc去除了冗余代码」· C头文件 代码 · 共 595 行 · 第 1/2 页

H
595
字号
/* * linux/arch/arm/mach-omap3/resource.h * * Copyright (C) 2006-2007 Texas Instruments, Inc. * Rajendra Nayak <rnayak@ti.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * History: * */#define __ARCH_ARM_MACH_OMAP3_RESOURCE_H#include <linux/module.h>#include <linux/kernel.h>#include <linux/device.h>#include <asm/arch/resource.h>#include <asm/arch/prcm.h>/* Flags to denote Pool usage */#define UNUSED			0x0#define USED			0x1#define curr_arm_freq 	500#define curr_dsp_freq 	360#define curr_vdd1_opp	3#define curr_vdd2_opp	3#define min_arm_freq 	125#define max_arm_freq 	600#define min_dsp_freq 	90#define max_dsp_freq 	430#define min_vdd1_opp 	CO_VDD1_OPP1#define max_vdd1_opp 	CO_VDD1_OPP5#define min_vdd2_opp 	CO_VDD2_OPP2#define max_vdd2_opp 	CO_VDD2_OPP3extern u32 current_vdd1_opp;extern u32 current_vdd2_opp;extern struct clk *p_vdd1_clk;extern struct clk *p_vdd2_clk;extern unsigned int vdd1_opp_setting(u32 target_opp_no);extern unsigned int vdd2_opp_setting(u32 target_opp_no);extern int prcm_set_memory_resource_on_state(unsigned short state);int set_memory_resource_state(unsigned short);/* Activation/Validation functions for various shared resources */int activate_power_res(struct shared_resource *resp,		       unsigned short current_level,		       unsigned short target_level);int activate_logical_res(struct shared_resource *resp,			 unsigned short current_level,			 unsigned short target_level);int activate_memory_res(unsigned long prcm_id, unsigned short current_level,			unsigned short target_level);int activate_dpll_res(unsigned long prcm_id, unsigned short current_level,			unsigned short target_level);int validate_power_res(struct shared_resource *res,			unsigned short current_level,			unsigned short target_level);int validate_logical_res(struct shared_resource *res,			unsigned short current_level,			unsigned short target_level);int validate_memory_res(struct shared_resource *res,			unsigned short current_level,			unsigned short target_level);int validate_dpll_res(struct shared_resource *res, unsigned short current_level,			unsigned short target_level);int activate_constraint(struct shared_resource *resp,			unsigned short current_value,			unsigned short target_value);int activate_pd_constraint(struct shared_resource *resp,			   unsigned short current_value,			   unsigned short target_value);int validate_constraint(struct shared_resource *res,			unsigned short current_level,			unsigned short target_level);int activate_memory_logic(struct shared_resource *resp,			 unsigned short current_level,			 unsigned short target_level);int validate_memory_logic(struct shared_resource *resp,			 unsigned short current_level,			 unsigned short target_level);int activate_autoidle_resource(struct shared_resource *resp,			unsigned short current_level,			unsigned short target_level);int validate_autoidle_resource(struct shared_resource *resp,			unsigned short current_level,			unsigned short target_level);static struct shared_resource dss = {	.name = "dss",	.prcm_id = DOM_DSS,	.res_type = RES_POWER_DOMAIN,	.no_of_users = 0,	.curr_level = POWER_DOMAIN_OFF,	.max_levels = POWER_DOMAIN_MAXLEVEL,	.linked_res_num = 0,	.action = activate_power_res,	.validate = validate_power_res,};static struct shared_resource cam = {	.name = "cam",	.prcm_id = DOM_CAM,	.res_type = RES_POWER_DOMAIN,	.no_of_users = 0,	.curr_level = POWER_DOMAIN_OFF,	.max_levels = POWER_DOMAIN_MAXLEVEL,	.linked_res_num = 0,	.action = activate_power_res,	.validate = validate_power_res,};static struct shared_resource iva2 = {	.name = "iva2",	.prcm_id = DOM_IVA2,	.res_type = RES_POWER_DOMAIN,	.no_of_users = 0,	.curr_level = POWER_DOMAIN_OFF,	.max_levels = POWER_DOMAIN_MAXLEVEL,	.linked_res_num = 0,	.action = activate_power_res,	.validate = validate_power_res,};static struct shared_resource sgx = {	.name = "sgx",	.prcm_id = DOM_SGX,	.res_type = RES_POWER_DOMAIN,	.no_of_users = 0,	.curr_level = POWER_DOMAIN_OFF,	.max_levels = POWER_DOMAIN_MAXLEVEL,	.linked_res_num = 0,	.action = activate_power_res,	.validate = validate_power_res,};static struct shared_resource usbhost = {	.name = "usb",	.prcm_id = DOM_USBHOST,	.res_type = RES_POWER_DOMAIN,	.no_of_users = 0,	.curr_level = POWER_DOMAIN_OFF,	.max_levels = POWER_DOMAIN_MAXLEVEL,	.linked_res_num = 0,	.action = activate_power_res,	.validate = validate_power_res,};static struct shared_resource per = {	.name = "per",	.prcm_id = DOM_PER,	.res_type = RES_POWER_DOMAIN,	.no_of_users = 0,	.curr_level = POWER_DOMAIN_OFF,	.max_levels = POWER_DOMAIN_MAXLEVEL,	.linked_res_num = 0,	.action = activate_power_res,	.validate = validate_power_res,};static struct shared_resource neon  = {	.name = "neon",	.prcm_id = DOM_NEON,	.res_type = RES_POWER_DOMAIN,	.no_of_users = 0,	.curr_level = POWER_DOMAIN_OFF,	.max_levels = POWER_DOMAIN_MAXLEVEL,	.linked_res_num = 0,	.action = activate_power_res,	.validate = validate_power_res,};static struct shared_resource core = {	.name = "core",	.prcm_id = DOM_CORE1,	.res_type = RES_LOGICAL,	.no_of_users = 0,	.curr_level = LOGICAL_UNUSED,	.max_levels = LOGICAL_MAXLEVEL,	.linked_res_num = 0,	.action = activate_logical_res,	.validate = validate_logical_res,};/* Constraint resources */static struct shared_resource latency = {	.name = "latency",	.prcm_id = RES_LATENCY_CO,	.res_type = RES_LATENCY_CO,	.no_of_users = 0,	.curr_level = CO_UNUSED,	.max_levels = CO_MAXLEVEL,	.linked_res_num = 0,	.action = activate_constraint,	.validate = validate_constraint,};static struct shared_resource arm_freq = {	.name = "arm_freq",	.prcm_id = PRCM_ARMFREQ_CONSTRAINT,	.res_type = RES_FREQ_CO,	.no_of_users = 0,	.curr_level = curr_arm_freq,	.max_levels = CO_MAXLEVEL,	.linked_res_num = 0,	.action = activate_constraint,	.validate = validate_constraint,};static struct shared_resource dsp_freq = {	.name = "dsp_freq",	.prcm_id = PRCM_DSPFREQ_CONSTRAINT,	.res_type = RES_FREQ_CO,	.no_of_users = 0,	.curr_level = curr_dsp_freq,	.max_levels = CO_MAXLEVEL,	.linked_res_num = 0,	.action = activate_constraint,	.validate = validate_constraint,};static struct shared_resource vdd1_opp = {	.name = "vdd1_opp",	.prcm_id = PRCM_VDD1_CONSTRAINT,	.res_type = RES_OPP_CO,	.no_of_users = 0,	.curr_level = curr_vdd1_opp,	.max_levels = max_vdd1_opp+1,	.linked_res_num = 0,	.action = activate_constraint,	.validate = validate_constraint,};static struct shared_resource vdd2_opp = {	.name = "vdd2_opp",	.prcm_id = PRCM_VDD2_CONSTRAINT,	.res_type = RES_OPP_CO,	.no_of_users = 0,	.curr_level = curr_vdd2_opp,	.max_levels = max_vdd2_opp+1,	.linked_res_num = 0,	.action = activate_constraint,	.validate = validate_constraint,};static char *lat_dss_linked_res[] = {"dss",};static struct shared_resource lat_dss = {	.name = "lat_dss",	.prcm_id = PRCM_DSS_CONSTRAINT,	.res_type = RES_CLOCK_RAMPUP_CO,	.no_of_users = 0,	.curr_level = CO_UNUSED,	.max_levels = CO_MAXLEVEL,	.linked_res_num = sizeof(lat_dss_linked_res) /			  sizeof(lat_dss_linked_res[0]),	.linked_res_names = lat_dss_linked_res,	.action = activate_pd_constraint,	.validate = validate_constraint,};static char *lat_cam_linked_res[] = {"cam",};static struct shared_resource lat_cam = {	.name = "lat_cam",	.prcm_id = PRCM_CAM_CONSTRAINT,	.res_type = RES_CLOCK_RAMPUP_CO,	.no_of_users = 0,	.curr_level = CO_UNUSED,	.max_levels = CO_MAXLEVEL,	.linked_res_num = sizeof(lat_cam_linked_res) /			  sizeof(lat_cam_linked_res[0]),	.linked_res_names = lat_cam_linked_res,	.action = activate_pd_constraint,	.validate = validate_constraint,};static char *lat_iva2_linked_res[] = {"iva2",};static struct shared_resource lat_iva2 = {	.name = "lat_iva2",	.prcm_id = PRCM_IVA2_CONSTRAINT,	.res_type = RES_CLOCK_RAMPUP_CO,	.no_of_users = 0,	.curr_level = CO_UNUSED,	.max_levels = CO_MAXLEVEL,	.linked_res_num = sizeof(lat_iva2_linked_res) /			  sizeof(lat_iva2_linked_res[0]),	.linked_res_names = lat_iva2_linked_res,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?