Files
system76-coreboot/src/drivers/system76/dgpu/bootblock.c
Jeremy Soller 9e729e44a8 Refactor DGPU support code into drivers/system76/dgpu
Change-Id: Id29d6ade82b7212a3a68f6f3c27769e17d3fdcdc
2020-07-20 11:52:44 -06:00

24 lines
499 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
//TODO: do not require this to be included in mainboard bootblock.c
#include <console/console.h>
#include <delay.h>
#include <gpio.h>
static void dgpu_power_enable(int onoff) {
printk(BIOS_DEBUG, "system76: DGPU power %d\n", onoff);
if (onoff) {
gpio_set(DGPU_RST_N, 0);
mdelay(4);
gpio_set(DGPU_PWR_EN, 1);
mdelay(4);
gpio_set(DGPU_RST_N, 1);
} else {
gpio_set(DGPU_RST_N, 0);
mdelay(4);
gpio_set(DGPU_PWR_EN, 0);
}
mdelay(50);
}