public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] MIPS: about the function of the octeon_twsi_set_addr8
@ 2008-05-27 13:14 wangjiankun820624
  0 siblings, 0 replies; only message in thread
From: wangjiankun820624 @ 2008-05-27 13:14 UTC (permalink / raw)
  To: u-boot

 
 
hello!
the field of [31:0] in the register MIO_TWS_SW_TWSI is data field, in the following function the low-8-bit of the 16-bit address is loaded in the MIO_TWS_SW_TWSI[7:0]. WHY? 
int octeon_twsi_set_addr8(uint8_t dev_addr, uint16_t addr)
{
    /* 16 bit internal address ONLY */
    uint64_t val;
    octeon_write64(CVMX_MIO_TWS_SW_TWSI,0x8000000000000000ull | ( 0x0ull << 57) | (((uint64_t)dev_addr) << 40) | (addr & 0xff)); // tell twsii to do the read
    while (octeon_read64(CVMX_MIO_TWS_SW_TWSI)&0x8000000000000000ull);
    val = octeon_read64(CVMX_MIO_TWS_SW_TWSI);
    if (!(val & 0x0100000000000000ull)) {
        return -1;
    }
    return(0);
}
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20080527/b06daccf/attachment.htm 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-27 13:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-27 13:14 [U-Boot-Users] MIPS: about the function of the octeon_twsi_set_addr8 wangjiankun820624

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox