/* * Firmware indices for the old power domains interface. Only a few * of them were actually implemented.
*/ #define RPI_OLD_POWER_DOMAIN_USB 3 #define RPI_OLD_POWER_DOMAIN_V3D 10
/* * Packet definition used by RPI_FIRMWARE_SET_POWER_STATE and * RPI_FIRMWARE_SET_DOMAIN_STATE
*/ struct rpi_power_domain_packet {
u32 domain;
u32 state;
};
/* * Asks the firmware to enable or disable power on a specific power * domain.
*/ staticint rpi_firmware_set_power(struct generic_pm_domain *domain, bool on)
{ struct rpi_power_domain *rpi_domain =
container_of(domain, struct rpi_power_domain, base); bool old_interface = rpi_domain->old_interface; struct rpi_power_domain_packet packet; int ret;
/* * Treat all power domains as off at boot. * * The firmware itself may be keeping some domains on, but * from Linux's perspective all we control is the refcounts * that we give to the firmware, and we can't ask the firmware * to turn off something that we haven't ourselves turned on.
*/
pm_genpd_init(&dom->base, NULL, true);
/* * Detects whether the firmware supports the new power domains interface. * * The firmware doesn't actually return an error on an unknown tag, * and just skips over it, so we do the detection by putting an * unexpected value in the return field and checking if it was * unchanged.
*/ staticbool
rpi_has_new_domain_support(struct rpi_power_domains *rpi_domains)
{ struct rpi_power_domain_packet packet; int ret;
/* * Use the old firmware interface for USB power, so that we * can turn it on even if the firmware hasn't been updated.
*/
rpi_init_old_power_domain(rpi_domains, RPI_POWER_DOMAIN_USB,
RPI_OLD_POWER_DOMAIN_USB, "USB");
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.