Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable power switch WDT on IT5570E boards #315

Merged
merged 1 commit into from
Jul 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/board/system76/addw2/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Enable SMBus channel 4
Expand Down
7 changes: 5 additions & 2 deletions src/board/system76/addw3/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Disable UARTs
Expand All @@ -49,8 +54,6 @@ void gpio_init() {
//TODO: what do these do?
GCR1 = 0;
GCR2 = 0;
GCR8 = 0x10;
GCR9 = 0x20;
GCR10 = 0x02;
GCR21 = 0;
GCR22 = 0x80;
Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/bonw14/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4); // renamed to EN_3V
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Enable SMBus channel 4
Expand Down
7 changes: 5 additions & 2 deletions src/board/system76/bonw15/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Disable UARTs
Expand All @@ -51,8 +56,6 @@ void gpio_init() {
//TODO: what do these do?
GCR1 = 0;
GCR2 = 0;
GCR8 = 0x10;
GCR9 = 0x20;
GCR10 = 0x02;
GCR21 = 0;
GCR22 = 0x80;
Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/darp7/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Enable SMBus channel 4
Expand Down
4 changes: 2 additions & 2 deletions src/board/system76/darp8/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);

void gpio_init(void) {
// PWRSW WDT 2 Enable 2
//GCR9 = BIT(5);
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
//GCR8 = BIT(4);
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0b10 << 1;
Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/galp5/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Enable SMBus channel 4
Expand Down
4 changes: 2 additions & 2 deletions src/board/system76/galp6/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);

void gpio_init(void) {
// PWRSW WDT 2 Enable 2
//GCR9 = BIT(5);
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
//GCR8 = BIT(4);
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0b10 << 1;
Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/gaze15/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Enable SMBus channel 4
Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/gaze16-3050/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Disable UARTs
Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/gaze16-3060/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Disable UARTs
Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/gaze17-3050/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Disable UARTs
Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/gaze17-3060/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Disable UARTs
Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/lemp10/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Enable SMBus channel 4
Expand Down
4 changes: 2 additions & 2 deletions src/board/system76/lemp11/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ void gpio_init(void) {
//GCR22 = BIT(7);

// PWRSW WDT 2 Enable 2
//GCR9 = BIT(5);
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
//GCR8 = BIT(4);
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0b10 << 1;
Expand Down
7 changes: 5 additions & 2 deletions src/board/system76/oryp11/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Disable UARTs
Expand All @@ -51,8 +56,6 @@ void gpio_init() {
//TODO: what do these do?
GCR1 = 0;
GCR2 = 0;
GCR8 = 0x10;
GCR9 = 0x20;
GCR10 = 0x02;
GCR21 = 0;
GCR22 = 0x80;
Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/oryp6/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Enable SMBus channel 4
Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/oryp7/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Enable SMBus channel 4
Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/oryp8/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ struct Gpio __code XLP_OUT = GPIO(B, 4);
// clang-format on

void gpio_init() {
// PWRSW WDT 2 Enable 2
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0x04;
// Disable UARTs
Expand Down
4 changes: 2 additions & 2 deletions src/board/system76/oryp9/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ void gpio_init(void) {
//GCR22 = BIT(7);

// PWRSW WDT 2 Enable 2
//GCR9 = BIT(5);
GCR9 = BIT(5);
// PWRSW WDT 2 Enable 1
//GCR8 = BIT(4);
GCR8 = BIT(4);

// Enable LPC reset on GPD2
GCR = 0b10 << 1;
Expand Down