diff options
author | Paul Irofti <pirofti@cvs.openbsd.org> | 2013-10-30 19:33:07 +0000 |
---|---|---|
committer | Paul Irofti <pirofti@cvs.openbsd.org> | 2013-10-30 19:33:07 +0000 |
commit | 2e9b617dcf51567cbd44ad4eac48d781a5d95cd4 (patch) | |
tree | 90577106122f217369e70f5146460d0cb70e669a /sys | |
parent | cda679841068b77db450df3ca73826f2661ef5fd (diff) |
It seems an immediate read is necessary when doing a write to an RSL
register in order to complete the write.
Okay miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/octeon/include/octeonvar.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/arch/octeon/include/octeonvar.h b/sys/arch/octeon/include/octeonvar.h index bf73bbd83e9..0316fdddc6e 100644 --- a/sys/arch/octeon/include/octeonvar.h +++ b/sys/arch/octeon/include/octeonvar.h @@ -312,10 +312,32 @@ octeon_xkphys_read_8(paddr_t address) return (*p); } +#define MIO_BOOT_BIST_STAT 0x00011800000000f8ULL static inline void octeon_xkphys_write_8(paddr_t address, uint64_t value) { *(volatile uint64_t *)(PHYS_TO_XKPHYS(address, CCA_NC)) = value; + + /* + * It seems an immediate read is necessary when doing a write to an RSL + * register in order to complete the write. + * We use MIO_BOOT_BIST_STAT because it's apparently the fastest + * write. + */ + + /* + * XXX + * This if would be better writen as: + * if ((address & 0xffffff0000000000ULL) == OCTEON_MIO_BOOT_BASE) { + * but octeonreg.h can't be included here and we want this inlined + * + * Note that the SDK masks with 0x7ffff but that doesn't make sense. + * This is a physical address. + */ + if (((address >> 40) & 0xfffff) == (0x118)) { + value = *(volatile uint64_t *) + (PHYS_TO_XKPHYS(MIO_BOOT_BIST_STAT, CCA_NC)); + } } static inline void |