-/* $OpenBSD: cn30xxpow.c,v 1.6 2014/08/11 18:29:56 miod Exp $ */
+/* $OpenBSD: cn30xxpow.c,v 1.7 2014/08/11 18:56:49 miod Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
return (result & POW_IOBDMA_GET_WORK_RESULT_NO_WORK) ?
NULL :
- (uint64_t *)PHYS_TO_CKSEG0(
- result & POW_IOBDMA_GET_WORK_RESULT_ADDR);
+ (uint64_t *)PHYS_TO_XKPHYS(
+ result & POW_IOBDMA_GET_WORK_RESULT_ADDR, CCA_CACHED);
}
/* ---- status by coreid */
printf("wqe\n");
- word0 = *(uint64_t *)PHYS_TO_CKSEG0(ptr);
+ word0 = *(uint64_t *)PHYS_TO_XKPHYS(ptr, CCA_CACHED);
printf("\t%-24s: %16llx\n", "word0", word0);
- word1 = *(uint64_t *)PHYS_TO_CKSEG0(ptr + 8);
+ word1 = *(uint64_t *)PHYS_TO_XKPHYS(ptr + 8, CCA_CACHED);
printf("\t%-24s: %16llx\n", "word1", word1);
}
#endif
-/* $OpenBSD: if_cnmac.c,v 1.17 2014/08/11 18:29:56 miod Exp $ */
+/* $OpenBSD: if_cnmac.c,v 1.18 2014/08/11 18:56:49 miod Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
octeon_eth_send_queue_del(sc, &m, &gbuf);
- cn30xxfpa_buf_put_paddr(octeon_eth_fb_sg, CKSEG0_TO_PHYS(gbuf));
+ cn30xxfpa_buf_put_paddr(octeon_eth_fb_sg, XKPHYS_TO_PHYS(gbuf));
m_freem(m);
}
paddr_t addr;
paddr_t start_buffer;
- addr = CKSEG0_TO_PHYS(work[3] & PIP_WQE_WORD3_ADDR);
+ addr = XKPHYS_TO_PHYS(work[3] & PIP_WQE_WORD3_ADDR);
start_buffer = addr & ~(2048 - 1);
cn30xxfpa_buf_put_paddr(octeon_eth_fb_pkt, start_buffer);
}
- cn30xxfpa_buf_put_paddr(octeon_eth_fb_wqe, CKSEG0_TO_PHYS(work));
+ cn30xxfpa_buf_put_paddr(octeon_eth_fb_wqe, XKPHYS_TO_PHYS(work));
return 0;
}
uint64_t *work = (void *)arg;
int s = splnet();
- cn30xxfpa_buf_put_paddr(octeon_eth_fb_wqe, CKSEG0_TO_PHYS(work));
+ cn30xxfpa_buf_put_paddr(octeon_eth_fb_wqe, XKPHYS_TO_PHYS(work));
splx(s);
}
uint64_t *work = (void *)arg;
int s = splnet();
- cn30xxfpa_buf_put_paddr(octeon_eth_fb_wqe, CKSEG0_TO_PHYS(work));
- cn30xxfpa_buf_put_paddr(octeon_eth_fb_pkt, CKSEG0_TO_PHYS(buf));
+ cn30xxfpa_buf_put_paddr(octeon_eth_fb_wqe, XKPHYS_TO_PHYS(work));
+ cn30xxfpa_buf_put_paddr(octeon_eth_fb_pkt, XKPHYS_TO_PHYS(buf));
splx(s);
}
(segs == 1) ? m->m_pkthdr.len : segs,
(segs == 1) ?
KVTOPHYS(m->m_data) :
- CKSEG0_TO_PHYS(gbuf));
+ XKPHYS_TO_PHYS(gbuf));
*rpko_cmd_w0 = pko_cmd_w0;
*rpko_cmd_w1 = pko_cmd_w1;
uint64_t *cmdptr;
int result = 0;
- cmdptr = (uint64_t *)PHYS_TO_CKSEG0(sc->sc_cmdptr.cmdptr);
+ cmdptr = (uint64_t *)PHYS_TO_XKPHYS(sc->sc_cmdptr.cmdptr, CCA_CACHED);
cmdptr += sc->sc_cmdptr.cmdptr_idx;
OCTEON_ETH_KASSERT(cmdptr != NULL);
result = 1;
goto done;
}
- gbuf = (uint64_t *)(uintptr_t)PHYS_TO_CKSEG0(gaddr);
+ gbuf = (uint64_t *)(uintptr_t)PHYS_TO_XKPHYS(gaddr, CCA_CACHED);
error = octeon_eth_send_buf(sc, m, gbuf);
if (error != 0) {
vaddr_t addr;
vaddr_t start_buffer;
- addr = PHYS_TO_CKSEG0(word3 & PIP_WQE_WORD3_ADDR);
+ addr = PHYS_TO_XKPHYS(word3 & PIP_WQE_WORD3_ADDR, CCA_CACHED);
start_buffer = addr & ~(2048 - 1);
ext_free = octeon_eth_buf_ext_free_ext;
-/* $OpenBSD: machdep.c,v 1.60 2014/07/21 17:25:47 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.61 2014/08/11 18:56:49 miod Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
extern void xtlb_miss;
boot_desc = (struct boot_desc *)a3;
- boot_info =
- (struct boot_info *)PHYS_TO_CKSEG0(boot_desc->boot_info_addr);
+ boot_info = (struct boot_info *)
+ PHYS_TO_XKPHYS(boot_desc->boot_info_addr, CCA_CACHED);
#ifdef MULTIPROCESSOR
/*
* explicitly pass the rootdevice.
*/
for (i = 1; i < octeon_boot_desc->argc; i++ ) {
- const char *arg =
- (const char*)PHYS_TO_CKSEG0(octeon_boot_desc->argv[i]);
+ const char *arg = (const char*)
+ PHYS_TO_XKPHYS(octeon_boot_desc->argv[i], CCA_CACHED);
- if (arg == NULL)
+ if (octeon_boot_desc->argv[i] == 0)
continue;
#ifdef DEBUG
- printf("boot_desc->argv[%d] = %s\n",
- i, (const char *)PHYS_TO_CKSEG0(octeon_boot_desc->argv[i]));
+ printf("boot_desc->argv[%d] = %s\n", i, arg);
#endif
/*