/* * if any usb phy is still on(GRF_SIDDQ==0), that means we need the * function of usb wakeup, so do not switch to 32khz, since the usb phy * clk does not connect to 32khz osc
*/ for (i = 0; i < ARRAY_SIZE(reg_offset); i++) {
regmap_read(grf_regmap, reg_offset[i], ®); if (!(reg & GRF_SIDDQ)) returnfalse;
}
/* * SGRF_FAST_BOOT_EN - system to boot from FAST_BOOT_ADDR * PCLK_WDT_GATE - disable WDT during suspend.
*/
regmap_write(sgrf_regmap, RK3288_SGRF_SOC_CON0,
SGRF_PCLK_WDT_GATE | SGRF_FAST_BOOT_EN
| SGRF_PCLK_WDT_GATE_WRITE | SGRF_FAST_BOOT_EN_WRITE);
/* * The dapswjdp can not auto reset before resume, that cause it may * access some illegal address during resume. Let's disable it before * suspend, and the MASKROM will enable it back.
*/
regmap_write(sgrf_regmap, RK3288_SGRF_CPU_CON0, SGRF_DAPDEVICEEN_WRITE);
/* booting address of resuming system is from this register value */
regmap_write(sgrf_regmap, RK3288_SGRF_FAST_BOOT_ADDR,
rk3288_bootram_phy);
/* * In deep suspend we use PMU_PMU_USE_LF to let the rk3288 * switch its main clock supply to the alternative 32kHz * source. Therefore set 30ms on a 32kHz clock for pmic * stabilization. Similar 30ms on 24MHz for the other * mode below.
*/
regmap_write(pmu_regmap, RK3288_PMU_STABL_CNT, 32 * 30);
/* only wait for stabilization, if we turned the osc off */
regmap_write(pmu_regmap, RK3288_PMU_OSC_CNT,
osc_disable ? 32 * 30 : 0);
} else { /* * arm off, logic normal * if pmu_clk_core_src_gate_en is not set, * wakeup will be error
*/
mode_set |= BIT(PMU_CLK_CORE_SRC_GATE_EN);
pmu_regmap = syscon_node_to_regmap(np); if (IS_ERR(pmu_regmap)) {
pr_err("%s: could not find pmu regmap\n", __func__); return PTR_ERR(pmu_regmap);
}
sgrf_regmap = syscon_regmap_lookup_by_compatible( "rockchip,rk3288-sgrf"); if (IS_ERR(sgrf_regmap)) {
pr_err("%s: could not find sgrf regmap\n", __func__); return PTR_ERR(sgrf_regmap);
}
grf_regmap = syscon_regmap_lookup_by_compatible( "rockchip,rk3288-grf"); if (IS_ERR(grf_regmap)) {
pr_err("%s: could not find grf regmap\n", __func__); return PTR_ERR(grf_regmap);
}
sram_np = of_find_compatible_node(NULL, NULL, "rockchip,rk3288-pmu-sram"); if (!sram_np) {
pr_err("%s: could not find bootram dt node\n", __func__); return -ENODEV;
}
rk3288_bootram_base = of_iomap(sram_np, 0); if (!rk3288_bootram_base) {
pr_err("%s: could not map bootram base\n", __func__);
of_node_put(sram_np); return -ENOMEM;
}
ret = of_address_to_resource(sram_np, 0, &res); if (ret) {
pr_err("%s: could not get bootram phy addr\n", __func__);
of_node_put(sram_np); return ret;
}
rk3288_bootram_phy = res.start;
of_node_put(sram_np);
rk3288_config_bootdata();
/* copy resume code and data to bootsram */
memcpy(rk3288_bootram_base, rockchip_slp_cpu_resume,
rk3288_bootram_sz);
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.