188 str, key_path, domp->name))
189 key_dc->lh = dc->lh;
190 return (key_dc);
191 }
192 }
193 }
194 }
195
196 PPMD(D_PPMDC, ("%s: Miss(dc_path:%s)\n", str, key_path))
197 return (NULL);
198 }
199
200
201 #define PPM_DOMAIN_PROP "ppm-domains"
202 #define PPM_DEV_PROP_SUFFIX "-devices"
203 #define PPM_MODEL_PROP_SUFFIX "-model"
204 #define PPM_PROPNAME_PROP_SUFFIX "-propname"
205 #define PPM_CTRL_PROP_SUFFIX "-control"
206
207 struct ppm_domit ppm_domit_data[] = {
208 "SX", PPMD_SX, 0, PPMD_ON,
209 "CPU", PPMD_CPU, PPMD_LOCK_ALL, PPMD_ON,
210 "FET", PPMD_FET, PPMD_LOCK_ONE, PPMD_ON,
211 "PCI", PPMD_PCI, PPMD_LOCK_ONE, PPMD_ON,
212 "PCI_PROP", PPMD_PCI_PROP, PPMD_LOCK_ONE, PPMD_ON,
213 "LED", PPMD_LED, 0, PPMD_ON,
214 "PCIE", PPMD_PCIE, PPMD_LOCK_ONE, PPMD_ON,
215 NULL
216 };
217
218 /*
219 * store up platform dependent information provided by ppm.conf file
220 * into private data base
221 */
222 int
223 ppm_create_db(dev_info_t *dip)
224 {
225 #ifdef DEBUG
226 char *str = "ppm_create_db";
227 #endif
228 ppm_domain_t *domp;
229 ppm_db_t *db;
230 ppm_dc_t *dc;
231 struct ppm_cdata domdata; /* hold "ppm-domains" property */
232 struct ppm_cdata modeldata; /* hold "domain_xy-model" property */
233 struct ppm_cdata propnamedata; /* hold "domain_xy-propname" property */
234 struct ppm_cdata devdata; /* hold "domain_xy-devices" property */
235 struct ppm_cdata dcdata; /* hold "domain_xy-control" property */
1008 if (hex_ && ((*cp >= 'A') && (*cp <= 'F')))
1009 digit = (digit * base) + ((*cp - 'A') + D_BASE);
1010 else if (hex_ && ((*cp >= 'a') && (*cp <= 'f')))
1011 digit = (digit * base) + ((*cp - 'a') + D_BASE);
1012 else
1013 digit = (digit * base) + (*cp - '0');
1014 }
1015
1016 return (*val = digit);
1017 }
1018
1019 /*
1020 * ppm_convert - convert a #define symbol to its integer value,
1021 * only the #defines for ppm_dc.cmd and ppm_dc.method fields in
1022 * ppmvar.h file are recognized.
1023 */
1024 struct ppm_confdefs {
1025 char *sym;
1026 int val;
1027 } ppm_confdefs_table[] = {
1028 "ENTER_S3", PPMDC_ENTER_S3,
1029 "EXIT_S3", PPMDC_EXIT_S3,
1030 "CPU_NEXT", PPMDC_CPU_NEXT,
1031 "PRE_CHNG", PPMDC_PRE_CHNG,
1032 "CPU_GO", PPMDC_CPU_GO,
1033 "POST_CHNG", PPMDC_POST_CHNG,
1034 "FET_ON", PPMDC_FET_ON,
1035 "FET_OFF", PPMDC_FET_OFF,
1036 "CLK_OFF", PPMDC_CLK_OFF,
1037 "CLK_ON", PPMDC_CLK_ON,
1038 "LED_ON", PPMDC_LED_ON,
1039 "LED_OFF", PPMDC_LED_OFF,
1040 "KIO", PPMDC_KIO,
1041 "VCORE", PPMDC_VCORE,
1042 #ifdef sun4u
1043 "I2CKIO", PPMDC_I2CKIO,
1044 #endif
1045 "CPUSPEEDKIO", PPMDC_CPUSPEEDKIO,
1046 "PRE_PWR_OFF", PPMDC_PRE_PWR_OFF,
1047 "PRE_PWR_ON", PPMDC_PRE_PWR_ON,
1048 "POST_PWR_ON", PPMDC_POST_PWR_ON,
1049 "PWR_OFF", PPMDC_PWR_OFF,
1050 "PWR_ON", PPMDC_PWR_ON,
1051 "RESET_OFF", PPMDC_RESET_OFF,
1052 "RESET_ON", PPMDC_RESET_ON,
1053 NULL
1054 };
1055
1056
1057 /*
1058 * convert a #define'd symbol to its integer value where
1059 * input "symbol" is expected to be in form of "SYMBOL=value"
1060 */
1061 int
1062 ppm_convert(char *symbol, uint_t *val)
1063 {
1064 char *s;
1065 struct ppm_confdefs *pcfp;
1066
1067 if ((s = strchr(symbol, '=')) == NULL) {
1068 cmn_err(CE_WARN, "ppm_convert: token \"%s\" syntax error in "
1069 "ppm.conf file", symbol);
1070 return (*val = (uint_t)-1);
1071 }
1072 s++;
1073
|
188 str, key_path, domp->name))
189 key_dc->lh = dc->lh;
190 return (key_dc);
191 }
192 }
193 }
194 }
195
196 PPMD(D_PPMDC, ("%s: Miss(dc_path:%s)\n", str, key_path))
197 return (NULL);
198 }
199
200
201 #define PPM_DOMAIN_PROP "ppm-domains"
202 #define PPM_DEV_PROP_SUFFIX "-devices"
203 #define PPM_MODEL_PROP_SUFFIX "-model"
204 #define PPM_PROPNAME_PROP_SUFFIX "-propname"
205 #define PPM_CTRL_PROP_SUFFIX "-control"
206
207 struct ppm_domit ppm_domit_data[] = {
208 { "SX", PPMD_SX, 0, PPMD_ON },
209 { "CPU", PPMD_CPU, PPMD_LOCK_ALL, PPMD_ON },
210 { "FET", PPMD_FET, PPMD_LOCK_ONE, PPMD_ON },
211 { "PCI", PPMD_PCI, PPMD_LOCK_ONE, PPMD_ON },
212 { "PCI_PROP", PPMD_PCI_PROP, PPMD_LOCK_ONE, PPMD_ON },
213 { "LED", PPMD_LED, 0, PPMD_ON },
214 { "PCIE", PPMD_PCIE, PPMD_LOCK_ONE, PPMD_ON },
215 { NULL }
216 };
217
218 /*
219 * store up platform dependent information provided by ppm.conf file
220 * into private data base
221 */
222 int
223 ppm_create_db(dev_info_t *dip)
224 {
225 #ifdef DEBUG
226 char *str = "ppm_create_db";
227 #endif
228 ppm_domain_t *domp;
229 ppm_db_t *db;
230 ppm_dc_t *dc;
231 struct ppm_cdata domdata; /* hold "ppm-domains" property */
232 struct ppm_cdata modeldata; /* hold "domain_xy-model" property */
233 struct ppm_cdata propnamedata; /* hold "domain_xy-propname" property */
234 struct ppm_cdata devdata; /* hold "domain_xy-devices" property */
235 struct ppm_cdata dcdata; /* hold "domain_xy-control" property */
1008 if (hex_ && ((*cp >= 'A') && (*cp <= 'F')))
1009 digit = (digit * base) + ((*cp - 'A') + D_BASE);
1010 else if (hex_ && ((*cp >= 'a') && (*cp <= 'f')))
1011 digit = (digit * base) + ((*cp - 'a') + D_BASE);
1012 else
1013 digit = (digit * base) + (*cp - '0');
1014 }
1015
1016 return (*val = digit);
1017 }
1018
1019 /*
1020 * ppm_convert - convert a #define symbol to its integer value,
1021 * only the #defines for ppm_dc.cmd and ppm_dc.method fields in
1022 * ppmvar.h file are recognized.
1023 */
1024 struct ppm_confdefs {
1025 char *sym;
1026 int val;
1027 } ppm_confdefs_table[] = {
1028 { "ENTER_S3", PPMDC_ENTER_S3 },
1029 { "EXIT_S3", PPMDC_EXIT_S3 },
1030 { "CPU_NEXT", PPMDC_CPU_NEXT },
1031 { "PRE_CHNG", PPMDC_PRE_CHNG },
1032 { "CPU_GO", PPMDC_CPU_GO },
1033 { "POST_CHNG", PPMDC_POST_CHNG },
1034 { "FET_ON", PPMDC_FET_ON },
1035 { "FET_OFF", PPMDC_FET_OFF },
1036 { "CLK_OFF", PPMDC_CLK_OFF },
1037 { "CLK_ON", PPMDC_CLK_ON },
1038 { "LED_ON", PPMDC_LED_ON },
1039 { "LED_OFF", PPMDC_LED_OFF },
1040 { "KIO", PPMDC_KIO },
1041 { "VCORE", PPMDC_VCORE },
1042 #ifdef sun4u
1043 { "I2CKIO", PPMDC_I2CKIO },
1044 #endif
1045 { "CPUSPEEDKIO", PPMDC_CPUSPEEDKIO },
1046 { "PRE_PWR_OFF", PPMDC_PRE_PWR_OFF },
1047 { "PRE_PWR_ON", PPMDC_PRE_PWR_ON },
1048 { "POST_PWR_ON", PPMDC_POST_PWR_ON },
1049 { "PWR_OFF", PPMDC_PWR_OFF },
1050 { "PWR_ON", PPMDC_PWR_ON },
1051 { "RESET_OFF", PPMDC_RESET_OFF },
1052 { "RESET_ON", PPMDC_RESET_ON },
1053 { NULL }
1054 };
1055
1056
1057 /*
1058 * convert a #define'd symbol to its integer value where
1059 * input "symbol" is expected to be in form of "SYMBOL=value"
1060 */
1061 int
1062 ppm_convert(char *symbol, uint_t *val)
1063 {
1064 char *s;
1065 struct ppm_confdefs *pcfp;
1066
1067 if ((s = strchr(symbol, '=')) == NULL) {
1068 cmn_err(CE_WARN, "ppm_convert: token \"%s\" syntax error in "
1069 "ppm.conf file", symbol);
1070 return (*val = (uint_t)-1);
1071 }
1072 s++;
1073
|