Skip to content

Instantly share code, notes, and snippets.

@gnif
gnif / vega-10-reset.c
Last active July 2, 2020 10:02
Experimental NON FUNCTIONAL vega 10 reset
static int reset_amdgpu_vega(struct pci_dev *dev, int probe) {
#define AMDGPU_MAX_USEC_TIMEOUT 100000
#define MP0_BASE 0x16000
#define mmMP0_SMN_C2PMSG_33 ((MP0_BASE + 0x0061) * 4)
#define mmMP0_SMN_C2PMSG_64 ((MP0_BASE + 0x0080) * 4)
#define mmMP0_SMN_C2PMSG_81 ((MP0_BASE + 0x0091) * 4)
resource_size_t rmmio_base, rmmio_size;
void __iomem *rmmio;
int ret;