changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: bcm: dont assume PHYSDRAM 0 in dmaaddr(), fix dmaioaddr()

changeset 7154: 0573cdc3766b
parent 7153: 7048df8bc401
child 7155: 85c4b38d9a82
author: cinap_lenrek@felloff.net
date: Thu, 11 Apr 2019 13:49:41 +0200
files: sys/src/9/bcm/dma.c
description: bcm: dont assume PHYSDRAM 0 in dmaaddr(), fix dmaioaddr()
     1.1--- a/sys/src/9/bcm/dma.c
     1.2+++ b/sys/src/9/bcm/dma.c
     1.3@@ -100,13 +100,13 @@ static u32int *dmaregs = (u32int*)DMAREG
     1.4 uintptr
     1.5 dmaaddr(void *va)
     1.6 {
     1.7-	return soc.busdram | (PTR2UINT(va) & ~KSEGM);
     1.8+	return soc.busdram | (PADDR(va) - PHYSDRAM);
     1.9 }
    1.10 
    1.11 static uintptr
    1.12 dmaioaddr(void *va)
    1.13 {
    1.14-	return soc.busio | (PTR2UINT(va) & ~VIRTIO);
    1.15+	return soc.busio | ((uintptr)va - VIRTIO);
    1.16 }
    1.17 
    1.18 static void