diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-07-02 21:04:01 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-07-02 21:04:01 +0200 |
commit | bd23963c8f359d0a3c802f7cd96b51b4d36b01ac (patch) | |
tree | 9122acd927e56b1b477eec87f6566b28e10e7b5e /sys/src/9/bcm | |
parent | 91c277a724d5fdfbc37eb85b69250220150fe232 (diff) |
bcm64: fix usb xhci controller on pi4 8GB variant (thanks richard miller)
On the 8GB variant of the raspberry pi 4,
the eeprom chip for the xhci controller is missing and
instead loaded from sdram (by the gpu firmware).
for this, the gpu firmware needs to be notified of
the xhci controllers pci bus address (after reset)
that was assigned by our pci enumeration code.
Diffstat (limited to 'sys/src/9/bcm')
-rw-r--r-- | sys/src/9/bcm/vcore.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/src/9/bcm/vcore.c b/sys/src/9/bcm/vcore.c index 818c12a35..91cc7dcf9 100644 --- a/sys/src/9/bcm/vcore.c +++ b/sys/src/9/bcm/vcore.c @@ -53,6 +53,7 @@ enum { TagSetEgpioConf = 0x00038043, TagGettemp = 0x00030006, + TagXhciReset = 0x00030058, TagFballoc = 0x00040001, TagFbfree = 0x00048001, TagFbblank = 0x00040002, @@ -413,3 +414,19 @@ egpset(uint port, int on) buf[1] = on; vcreq(TagSetEgpioState, buf, sizeof(buf), sizeof(buf)); } + +/* + * Notify gpu that xhci firmware might need loading. This is for some + * pi4 board versions which are missing the eeprom chip for the vl805, + * requiring its firmware to come from the boot eeprom instead. + */ +int +xhcireset(int devaddr) +{ + u32int buf[1]; + + buf[0] = devaddr; + if(vcreq(TagXhciReset, buf, sizeof(buf), sizeof(buf[0])) == sizeof(buf[0])) + return buf[0]; + return -1; +} |