Line 213... |
Line 213... |
if ((addr = mfspr(SPR_ICBLR))) {
|
if ((addr = mfspr(SPR_ICBLR))) {
|
mtspr(SPR_ICBLR, 0);
|
mtspr(SPR_ICBLR, 0);
|
}
|
}
|
}
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|
|
/*-----------------------------------------------------[ IC configuration ]---*/
|
|
void ic_enabled(union param_val val, void *dat)
|
|
{
|
|
config.ic.enabled = val.int_val;
|
|
setsprbits (SPR_UPR, SPR_UPR_ICP, val.int_val ? 1 : 0);
|
|
}
|
|
|
|
void ic_nsets(union param_val val, void *dat)
|
|
{
|
|
if (is_power2(val.int_val) && val.int_val <= MAX_IC_SETS)
|
|
config.ic.nsets = val.int_val;
|
|
else {
|
|
char tmp[200];
|
|
sprintf (tmp, "value of power of two and lower or equal than %i expected.", MAX_IC_SETS);
|
|
CONFIG_ERROR(tmp);
|
|
}
|
|
}
|
|
|
|
void ic_nways(union param_val val, void *dat)
|
|
{
|
|
if (val.int_val >= 1 && val.int_val <= MAX_IC_WAYS)
|
|
config.ic.nways = val.int_val;
|
|
else
|
|
CONFIG_ERROR("value 1, 2, 3 or 4 expected.");
|
|
}
|
|
|
|
void ic_blocksize(union param_val val, void *dat)
|
|
{
|
|
if (is_power2(val.int_val))
|
|
config.ic.blocksize = val.int_val;
|
|
else
|
|
CONFIG_ERROR("value of power of two expected.");
|
|
}
|
|
|
|
void ic_ustates(union param_val val, void *dat)
|
|
{
|
|
if (val.int_val >= 2 && val.int_val <= 4)
|
|
config.ic.ustates = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid USTATE.");
|
|
}
|
|
|
|
void ic_missdelay(union param_val val, void *dat)
|
|
{
|
|
config.ic.missdelay = val.int_val;
|
|
}
|
|
|
|
void ic_hitdelay(union param_val val, void *dat)
|
|
{
|
|
config.ic.hitdelay = val.int_val;
|
|
}
|
|
|
|
void reg_ic_sec(void)
|
|
{
|
|
struct config_sections *sec = reg_config_sec("ic", NULL, NULL);
|
|
|
|
reg_config_param(sec, "enabled", paramt_int, ic_enabled);
|
|
reg_config_param(sec, "nsets", paramt_int, ic_nsets);
|
|
reg_config_param(sec, "nways", paramt_int, ic_nways);
|
|
reg_config_param(sec, "blocksize", paramt_int, ic_blocksize);
|
|
reg_config_param(sec, "ustates", paramt_int, ic_ustates);
|
|
reg_config_param(sec, "missdelay", paramt_int, ic_missdelay);
|
|
reg_config_param(sec, "hitdelay", paramt_int, ic_hitdelay);
|
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|