/* This macro flattens the 2-dimensional PRCC numberspace */ #define PRCC_RESET_LINE(prcc_num, bit) \
(((prcc_num) * PRCC_PERIPHS_PER_CLUSTER) + (bit))
/* * Reset registers in each PRCC - the reset lines are active low * so what you need to do is write a bit for the peripheral you * want to put into reset into the CLEAR register, this will assert * the reset by pulling the line low. SET take the device out of * reset. The status reflects the actual state of the line.
*/ #define PRCC_K_SOFTRST_SET 0x018 #define PRCC_K_SOFTRST_CLEAR 0x01c #define PRCC_K_RST_STATUS 0x020
staticint prcc_num_to_index(unsignedint num)
{ switch (num) { case 1: return CLKRST1_INDEX; case 2: return CLKRST2_INDEX; case 3: return CLKRST3_INDEX; case 5: return CLKRST5_INDEX; case 6: return CLKRST6_INDEX;
} return -EINVAL;
}
pr_debug("PRCC cycle reset id %lu, bit %u\n", id, bit);
/* * Assert reset and then release it. The one microsecond * delay is found in the vendor reference code.
*/
writel(BIT(bit), base + PRCC_K_SOFTRST_CLEAR);
udelay(1);
writel(BIT(bit), base + PRCC_K_SOFTRST_SET);
udelay(1);
pr_debug("located reset line %d at PRCC %d bit %d\n",
PRCC_RESET_LINE(prcc_num, bit), prcc_num, bit);
return PRCC_RESET_LINE(prcc_num, bit);
}
void u8500_prcc_reset_init(struct device_node *np, struct u8500_prcc_reset *ur)
{ struct reset_controller_dev *rcdev = &ur->rcdev; int ret; int i;
for (i = 0; i < CLKRST_MAX; i++) {
ur->base[i] = ioremap(ur->phy_base[i], SZ_4K); if (!ur->base[i])
pr_err("PRCC failed to remap for reset base %d (%08x)\n",
i, ur->phy_base[i]);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.