Thang Q. Nguyen | 37bc6eb | 2020-12-23 04:45:53 +0000 | [diff] [blame^] | 1 | From c6e0470d82417b79b23f218c6db1099eb6e160af Mon Sep 17 00:00:00 2001 |
| 2 | From: "Thang Q. Nguyen" <thang@os.amperecomputing.com> |
| 3 | Date: Wed, 23 Dec 2020 04:42:21 +0000 |
| 4 | Subject: [PATCH] aspeed: Disable internal PD resistors for GPIOs |
| 5 | |
| 6 | Configure SCU8C - Multi-function pin control 4 to disable internal pull |
| 7 | down resistors for GPIOJ, GPIOG/GPIOAB, GPIOD/GPIOY, GPIOC/GPIOS as |
| 8 | external resistors are already installed. |
| 9 | |
| 10 | Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com> |
| 11 | --- |
| 12 | board/aspeed/ast-g5/ast-g5.c | 14 ++++++++++++++ |
| 13 | 1 file changed, 14 insertions(+) |
| 14 | |
| 15 | diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c |
| 16 | index fba22a728e..9bf6c905fe 100644 |
| 17 | --- a/board/aspeed/ast-g5/ast-g5.c |
| 18 | +++ b/board/aspeed/ast-g5/ast-g5.c |
| 19 | @@ -27,9 +27,23 @@ int board_init(void) |
| 20 | #ifdef CONFIG_BOARD_LATE_INIT |
| 21 | int board_late_init(void) |
| 22 | { |
| 23 | + u32 val; |
| 24 | + |
| 25 | /* Switch PWM to GPIO mode to make FAN run in max speed */ |
| 26 | ast_scu_switch_pwm_to_gpio_mode(); |
| 27 | |
| 28 | + /* |
| 29 | + * Disable internal pull down resistor for GPIOJ, |
| 30 | + * GPIOG/GPIOAB, GPIOD/GPIOY, GPIOC/GPIOS as external pull up/down |
| 31 | + * resistors are installed already. Unlock SCU regs before writing. |
| 32 | + */ |
| 33 | + writel(SCU_PROTECT_UNLOCK, AST_SCU_BASE); |
| 34 | + val = readl(AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL4) | 0x024C0000; |
| 35 | + writel(val, AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL4); |
| 36 | +#ifdef CONFIG_AST_SCU_LOCK |
| 37 | + writel(0xaa, AST_SCU_BASE); |
| 38 | +#endif |
| 39 | + |
| 40 | return 0; |
| 41 | } |
| 42 | #endif |
| 43 | -- |
| 44 | 2.25.1 |
| 45 | |