Browse Source

Merge "for 3A3000-7a1000: Remove RTC enable. Configure RTC and APCI low power mode."

master
张宝祺 4 years ago
committed by Gerrit Code Review
parent
commit
086efdff8d
  1. 13
      Targets/Bonito3a3000_7a/Bonito/tgt_machdep.c
  2. 1
      Targets/Bonito3a3000_7a/include/ls7a.h

13
Targets/Bonito3a3000_7a/Bonito/tgt_machdep.c

@ -150,6 +150,7 @@ void ad_err2(unsigned long *adr, unsigned long bad);
void ad_err1(unsigned long *adr1, unsigned long *adr2, unsigned long good, unsigned long bad);
void mv_error(unsigned long *adr, unsigned long good, unsigned long bad);
static void init_acpi(void);
static void init_legacy_rtc(void);
#ifdef INTERFACE_3A780E
@ -285,6 +286,7 @@ void initmips(unsigned int raw_memsz)
* Probe clock frequencys so delays will work properly.
*/
ls7a_pwm(5000, 10000);
init_acpi();
tgt_cpufreq();
SBD_DISPLAY("DONE",0);
/*
@ -717,10 +719,19 @@ static void ls7a_pwm(int x,int y)
readl(LS7A_PWM3_CTRL) |= 1;
}
static void init_acpi(void)
{
if (ls7a_version ()) {
do {
readl(LS7A_ACPI_PMCON_RTC_REG) |= (0x3 << 9);
} while (((readl(LS7A_ACPI_PMCON_RTC_REG) >> 9) & 0x3) != 0x3);
}
}
static void init_legacy_rtc(void)
{
int year, month, date, hour, min, sec, val;
val = (1 << 13) | (1 << 11) | (1 << 8);
val = (1 << 11) | (1 << 8);
outl(LS7A_RTC_CTRL_REG, val);
outl(LS7A_TOY_TRIM_REG, 0);

1
Targets/Bonito3a3000_7a/include/ls7a.h

@ -21,6 +21,7 @@
#define LS7A_RTC_MATCH2_REG (LS7A_RTC_REG_BASE + 0x0074)
#define LS7A_ACPI_REG_BASE (LS7A_MISC_BASE + 0x50000)
#define LS7A_ACPI_PMCON_RTC_REG (LS7A_ACPI_REG_BASE + 0x8)
#define LS7A_ACPI_PM1_STS_REG (LS7A_ACPI_REG_BASE + 0xc)
#define LS7A_ACPI_PM1_CNT_REG (LS7A_ACPI_REG_BASE + 0x14)
#define LS7A_ACPI_RST_CNT_REG (LS7A_ACPI_REG_BASE + 0x30)

Loading…
Cancel
Save