diff --git a/sys/src/9/bcm/bootargs.c b/sys/src/9/bcm/bootargs.c index 445e0baef..9b6c13a83 100644 --- a/sys/src/9/bcm/bootargs.c +++ b/sys/src/9/bcm/bootargs.c @@ -12,6 +12,7 @@ static char *confname[MAXCONF]; static char *confval[MAXCONF]; static int nconf; static char maxmem[256]; +static char emmc2bus[38]; static char pciwin[38], pcidmawin[38]; static int @@ -114,6 +115,16 @@ devtreeprop(char *path, char *key, void *val, int len) } return; } + if(strcmp(path, "/emmc2bus") == 0 && strcmp(key, "dma-ranges") == 0 && len == (2*4 + 2*4 + 1*4)){ + if(findconf("*emmc2bus") < 0){ + addr = (uvlong)beget4(p+0*4)<<32 | beget4(p+1*4); + addr -= (uvlong)beget4(p+2*4)<<32 | beget4(p+3*4); + size = beget4(p+4*4); + snprint(emmc2bus, sizeof(emmc2bus), "%#llux %#llux", addr, addr+size); + addconf("*emmc2bus", emmc2bus); + } + return; + } if(strncmp(path, "/scb/pcie@", 10) == 0 && len == (3*4 + 4*4)){ if((beget4(p) & 0x3000000) == 0x2000000){ size = (uvlong)beget4(p+5*4)<<32 | beget4(p+5*4+4);