soc/intel/apollolake: refactor rtc failure checking

In order to prepare for checking RTC failure in the early boot
paths move the rtc failure calculation to pmutil.c and add a helper
function to determine if failure occurred.

BUG=b:63054105

Change-Id: I1b02028a1830ff9b28b23da7a4a1fd343f329f0d
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/21551
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Aaron Durbin
2017-09-15 11:48:53 -06:00
parent 118a84f8f5
commit 3118b6277d
2 changed files with 19 additions and 15 deletions

View File

@ -14,17 +14,14 @@
* GNU General Public License for more details.
*/
#include <cbmem.h>
#include <console/console.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <intelblocks/lpc_lib.h>
#include <intelblocks/rtc.h>
#include <pc80/mc146818rtc.h>
#include <soc/gpio.h>
#include <soc/pcr_ids.h>
#include <soc/pm.h>
#include <vboot/vbnv.h>
#include "chip.h"
static const struct lpc_mmio_range apl_lpc_fixed_mmio_ranges[] = {
@ -83,18 +80,6 @@ void lpc_configure_pads(void)
gpio_configure_pads(lpc_gpios, ARRAY_SIZE(lpc_gpios));
}
int soc_get_rtc_failed(void)
{
const struct chipset_power_state *ps = cbmem_find(CBMEM_ID_POWER_STATE);
if (!ps) {
printk(BIOS_ERR, "Could not find power state in cbmem, RTC init aborted\n");
return 1;
}
return !!(ps->gen_pmcon1 & RPS);
}
void lpc_init(struct device *dev)
{
const struct soc_intel_apollolake_config *cfg;