Move gpio_debug from board to EC code
The gpio_debug() functionality depends on the ITE registers and not anything board-specific. Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
committed by
Tim Crawford
parent
f687000a4f
commit
59c386ec12
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include <board/gpio.h>
|
||||
#include <common/debug.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
@ -248,43 +247,3 @@ void gpio_init() {
|
||||
// ALERT#
|
||||
GPCRM6 = 0x86;
|
||||
}
|
||||
|
||||
#if GPIO_DEBUG
|
||||
void gpio_debug_bank(
|
||||
char *bank,
|
||||
uint8_t data,
|
||||
uint8_t mirror,
|
||||
uint8_t pot,
|
||||
volatile uint8_t *control
|
||||
) {
|
||||
for (char i = 0; i < 8; i++) {
|
||||
DEBUG(
|
||||
"%s%d: data %d mirror %d pot %d control %02X\n",
|
||||
bank,
|
||||
i,
|
||||
(data >> i) & 1,
|
||||
(mirror >> i) & 1,
|
||||
(pot >> i) & 1,
|
||||
*(control + i)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void gpio_debug(void) {
|
||||
#define bank(BANK) gpio_debug_bank(#BANK, GPDR##BANK, GPDMR##BANK, GPOT##BANK, &GPCR##BANK##0)
|
||||
bank(A);
|
||||
bank(B);
|
||||
bank(C);
|
||||
bank(D);
|
||||
bank(E);
|
||||
bank(F);
|
||||
bank(G);
|
||||
bank(H);
|
||||
bank(I);
|
||||
bank(J);
|
||||
#define GPOTM 0
|
||||
bank(M);
|
||||
#undef GPOTM
|
||||
#undef bank
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user