From 4f2bbbf101f3fda0771685e0a40d6876005c2c36 Mon Sep 17 00:00:00 2001 From: Kostas Missos Date: Tue, 12 Feb 2019 00:46:06 +0200 Subject: [PATCH] Fix GPU on Linux when booting from warmboot --- bootloader/main.c | 1 + bootloader/soc/hw_init.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/bootloader/main.c b/bootloader/main.c index bca9874..6829ea8 100644 --- a/bootloader/main.c +++ b/bootloader/main.c @@ -1157,6 +1157,7 @@ extern void pivot_stack(u32 stack_top); void ipl_main() { + // Do initial HW configuration. This is compatible with consecutive reruns without a reset. config_hw(); //Pivot the stack so we have enough space. diff --git a/bootloader/soc/hw_init.c b/bootloader/soc/hw_init.c index b57ee42..a46e644 100644 --- a/bootloader/soc/hw_init.c +++ b/bootloader/soc/hw_init.c @@ -247,6 +247,10 @@ void reconfig_hw_workaround(bool extra_reconfig, u32 magic) gpio_config(GPIO_PORT_D, GPIO_PIN_1, GPIO_MODE_SPIO); gpio_config(GPIO_PORT_E, GPIO_PIN_6, GPIO_MODE_SPIO); gpio_config(GPIO_PORT_H, GPIO_PIN_6, GPIO_MODE_SPIO); + + // Fix GPU after warmboot for Linux. + i2c_send_byte(I2C_5, MAX77620_I2C_ADDR, MAX77620_REG_GPIO5, 2); + i2c_send_byte(I2C_5, MAX77620_I2C_ADDR, MAX77620_REG_GPIO6, 2); } // Power off display.