diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-02-14 02:44:19 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-02-14 02:44:19 +0100 |
commit | 6b2d1f0186f2e38a3b0cd6a19b5980dccb045c3c (patch) | |
tree | bba3d0a51c09b06ea36000c8123c1a2a6c44ade4 /sys/src/9/zynq/etherzynq.c | |
parent | 48c5cf1f11fb6b8b620e5ed9269a528b5f6633f4 (diff) |
zynq: do fixed mapping for ocm memory on boot and make kaddr() and paddr() work with it
map the whole ocm memory on boot so we can translate physical to
virtual addresses and back for uncached memory using KADDR() and
PADDR().
replace ualloc() with ucalloc() returning virtual address. physical
address can be acquired with PADDR() now.
as ocm is now always mapped, use KADDR() instead of tmpmap() for
mp bootstrap.
Diffstat (limited to 'sys/src/9/zynq/etherzynq.c')
-rw-r--r-- | sys/src/9/zynq/etherzynq.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/src/9/zynq/etherzynq.c b/sys/src/9/zynq/etherzynq.c index 775d219f4..c24ded981 100644 --- a/sys/src/9/zynq/etherzynq.c +++ b/sys/src/9/zynq/etherzynq.c @@ -295,7 +295,6 @@ ethinit(Ether *edev) { Ctlr *c; int i; - uintptr rxrpa, txrpa; c = edev->ctlr; c->r[NET_CTRL] = 0; @@ -306,9 +305,9 @@ ethinit(Ether *edev) c->r[SPEC_ADDR1_BOT] = edev->ea[0] | edev->ea[1] << 8 | edev->ea[2] << 16 | edev->ea[3] << 24; c->r[SPEC_ADDR1_TOP] = edev->ea[4] | edev->ea[5] << 8; c->r[DMA_CFG] = TXCHKSUMEN | (Rbsz/64) << 16 | 1 << 10 | 3 << 8 | 0x10; - - rxrpa = ualloc(8 * RXRING, &c->rxr); - txrpa = ualloc(8 * TXRING, &c->txr); + + c->rxr = ucalloc(8 * RXRING); + c->txr = ucalloc(8 * TXRING); c->rxs = xspanalloc(4 * RXRING, 4, 0); c->txs = xspanalloc(4 * TXRING, 4, 0); for(i = 0; i < 2 * RXRING; ){ @@ -324,8 +323,8 @@ ethinit(Ether *edev) c->txr[i++] = 1<<31; } c->txr[2 * (TXRING - 1)] |= 1<<30; - c->r[RX_QBAR] = rxrpa; - c->r[TX_QBAR] = txrpa; + c->r[RX_QBAR] = PADDR(c->rxr); + c->r[TX_QBAR] = PADDR(c->txr); c->r[NET_CTRL] = MDEN | TXEN | RXEN; c->r[INTR_EN] = MGMTDONE | TXUNDER | RXCOMPL | RXUSED | RXOVER; |