Enable power switch WDT on IT5570E boards

Enable PWRSW WDT 2 and use the default timeout of 10 seconds.

Allows forcing an EC reset in case it gets into an invalid state.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2023-07-19 09:26:10 -06:00
committed by Jeremy Soller
parent 45520646aa
commit 8a1adc2bdc
20 changed files with 88 additions and 14 deletions

View File

@ -43,6 +43,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Enable SMBus channel 4 // Enable SMBus channel 4

View File

@ -35,6 +35,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Disable UARTs // Disable UARTs
@ -49,8 +54,6 @@ void gpio_init() {
//TODO: what do these do? //TODO: what do these do?
GCR1 = 0; GCR1 = 0;
GCR2 = 0; GCR2 = 0;
GCR8 = 0x10;
GCR9 = 0x20;
GCR10 = 0x02; GCR10 = 0x02;
GCR21 = 0; GCR21 = 0;
GCR22 = 0x80; GCR22 = 0x80;

View File

@ -42,6 +42,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4); // renamed to EN_3V
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Enable SMBus channel 4 // Enable SMBus channel 4

View File

@ -37,6 +37,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Disable UARTs // Disable UARTs
@ -51,8 +56,6 @@ void gpio_init() {
//TODO: what do these do? //TODO: what do these do?
GCR1 = 0; GCR1 = 0;
GCR2 = 0; GCR2 = 0;
GCR8 = 0x10;
GCR9 = 0x20;
GCR10 = 0x02; GCR10 = 0x02;
GCR21 = 0; GCR21 = 0;
GCR22 = 0x80; GCR22 = 0x80;

View File

@ -43,6 +43,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Enable SMBus channel 4 // Enable SMBus channel 4

View File

@ -41,9 +41,9 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
void gpio_init(void) { void gpio_init(void) {
// PWRSW WDT 2 Enable 2 // PWRSW WDT 2 Enable 2
//GCR9 = BIT(5); GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1 // PWRSW WDT 2 Enable 1
//GCR8 = BIT(4); GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0b10 << 1; GCR = 0b10 << 1;

View File

@ -44,6 +44,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Enable SMBus channel 4 // Enable SMBus channel 4

View File

@ -43,9 +43,9 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
void gpio_init(void) { void gpio_init(void) {
// PWRSW WDT 2 Enable 2 // PWRSW WDT 2 Enable 2
//GCR9 = BIT(5); GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1 // PWRSW WDT 2 Enable 1
//GCR8 = BIT(4); GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0b10 << 1; GCR = 0b10 << 1;

View File

@ -41,6 +41,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Enable SMBus channel 4 // Enable SMBus channel 4

View File

@ -39,6 +39,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Disable UARTs // Disable UARTs

View File

@ -40,6 +40,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Disable UARTs // Disable UARTs

View File

@ -39,6 +39,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Disable UARTs // Disable UARTs

View File

@ -39,6 +39,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Disable UARTs // Disable UARTs

View File

@ -42,6 +42,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Enable SMBus channel 4 // Enable SMBus channel 4

View File

@ -43,9 +43,9 @@ void gpio_init(void) {
//GCR22 = BIT(7); //GCR22 = BIT(7);
// PWRSW WDT 2 Enable 2 // PWRSW WDT 2 Enable 2
//GCR9 = BIT(5); GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1 // PWRSW WDT 2 Enable 1
//GCR8 = BIT(4); GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0b10 << 1; GCR = 0b10 << 1;

View File

@ -37,6 +37,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Disable UARTs // Disable UARTs
@ -51,8 +56,6 @@ void gpio_init() {
//TODO: what do these do? //TODO: what do these do?
GCR1 = 0; GCR1 = 0;
GCR2 = 0; GCR2 = 0;
GCR8 = 0x10;
GCR9 = 0x20;
GCR10 = 0x02; GCR10 = 0x02;
GCR21 = 0; GCR21 = 0;
GCR22 = 0x80; GCR22 = 0x80;

View File

@ -41,6 +41,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Enable SMBus channel 4 // Enable SMBus channel 4

View File

@ -40,6 +40,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Enable SMBus channel 4 // Enable SMBus channel 4

View File

@ -38,6 +38,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on // clang-format on
void gpio_init() { void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0x04; GCR = 0x04;
// Disable UARTs // Disable UARTs

View File

@ -45,9 +45,9 @@ void gpio_init(void) {
//GCR22 = BIT(7); //GCR22 = BIT(7);
// PWRSW WDT 2 Enable 2 // PWRSW WDT 2 Enable 2
//GCR9 = BIT(5); GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1 // PWRSW WDT 2 Enable 1
//GCR8 = BIT(4); GCR8 = BIT(4);
// Enable LPC reset on GPD2 // Enable LPC reset on GPD2
GCR = 0b10 << 1; GCR = 0b10 << 1;