static int brcmstb_cpu_kill(u32 cpu) { u32 tmp; pr_info("SMP: Powering down CPU%d...\n", cpu); while (per_cpu_sw_state_rd(cpu)) ; /* Program zone reset */ pwr_ctrl_wr(cpu, ZONE_RESET_STATE_MASK | ZONE_BLK_RST_ASSERT_MASK | ZONE_PWR_DN_REQ_MASK); /* Verify zone reset */ tmp = pwr_ctrl_rd(cpu); if (!(tmp & ZONE_RESET_STATE_MASK)) pr_err("%s: Zone reset bit for CPU %d not asserted!\n", __func__, cpu); /* Wait for power down */ do { tmp = pwr_ctrl_rd(cpu); } while (!(tmp & ZONE_PWR_OFF_STATE_MASK)); /* Settle-time from Broadcom-internal DVT reference code */ udelay(7); /* Assert reset on the CPU */ cpu_rst_cfg_set(cpu, 1); return 1; }
void brcmstb_cpu_power_on(unsigned int cpu) { /* * The secondary cores power was cut, so we must go through * power-on initialization. */ pr_info("SMP: Powering up CPU%d...\n", cpu); if (USE_MANUAL_MODE) { pwr_ctrl_set(cpu, ZONE_MAN_ISO_CNTL_MASK, 0xffffff00); pwr_ctrl_set(cpu, ZONE_MANUAL_CONTROL_MASK, -1); pwr_ctrl_set(cpu, ZONE_RESERVED_1_MASK, -1); pwr_ctrl_set(cpu, ZONE_MAN_MEM_PWR_MASK, -1); if (pwr_ctrl_wait_tmout(cpu, 1, ZONE_MEM_PWR_STATE_MASK)) panic("ZONE_MEM_PWR_STATE_MASK set timeout"); pwr_ctrl_set(cpu, ZONE_MAN_CLKEN_MASK, -1); if (pwr_ctrl_wait_tmout(cpu, 1, ZONE_DPG_PWR_STATE_MASK)) panic("ZONE_DPG_PWR_STATE_MASK set timeout"); pwr_ctrl_clr(cpu, ZONE_MAN_ISO_CNTL_MASK, -1); pwr_ctrl_set(cpu, ZONE_MAN_RESET_CNTL_MASK, -1); } else { /* Request zone power up */ pwr_ctrl_wr(cpu, ZONE_PWR_UP_REQ_MASK); /* Wait for the power up FSM to complete */ if (pwr_ctrl_wait_tmout(cpu, 1, ZONE_PWR_ON_STATE_MASK)) panic("ZONE_PWR_ON_STATE_MASK set timeout"); } }
static void brcmstb_cpu_power_on(u32 cpu) { /* * The secondary cores power was cut, so we must go through * power-on initialization. */ u32 tmp; pr_info("SMP: Powering up CPU%d...\n", cpu); /* Request zone power up */ pwr_ctrl_wr(cpu, ZONE_PWR_UP_REQ_MASK); /* Wait for the power up FSM to complete */ do { tmp = pwr_ctrl_rd(cpu); } while (!(tmp & ZONE_PWR_ON_STATE_MASK)); per_cpu_sw_state_wr(cpu, 1); }