np = of_find_compatible_node(NULL, NULL, compatible); if (!np) {
pr_err("no compatible node found for %s\n", compatible); goto out;
}
error = of_address_to_resource(np, 0, &res); if (error) {
pr_err("no valid reg found for %pOFn\n", np); goto out_put;
}
hw_regs = ioremap(res.start, resource_size(&res)); if (hw_regs) {
pr_info("%s at 0x%pa mapped to 0x%p\n", name,
&res.start, hw_regs);
}
out_put:
of_node_put(np);
out: return hw_regs;
}
staticvoid __init wii_setup_arch(void)
{
hw_ctrl = wii_ioremap_hw_regs("hw_ctrl", HW_CTRL_COMPATIBLE);
hw_gpio = wii_ioremap_hw_regs("hw_gpio", HW_GPIO_COMPATIBLE); if (hw_gpio) { /* turn off the front blue led and IR light */
clrbits32(hw_gpio + HW_GPIO_OUT(0),
HW_GPIO_SLOT_LED | HW_GPIO_SENSOR_BAR);
}
}
if (hw_gpio) { /* * set the owner of the shutdown pin to ARM, because it is * accessed through the registers for the ARM, below
*/
clrbits32(hw_gpio + HW_GPIO_OWNER, HW_GPIO_SHUTDOWN);
/* make sure that the poweroff GPIO is configured as output */
setbits32(hw_gpio + HW_GPIO_DIR(1), HW_GPIO_SHUTDOWN);
/* drive the poweroff GPIO high */
setbits32(hw_gpio + HW_GPIO_OUT(1), HW_GPIO_SHUTDOWN);
}
wii_spin();
}
staticvoid __noreturn wii_halt(void)
{ if (ppc_md.restart)
ppc_md.restart(NULL);
wii_spin();
}
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.