Starting with your C code, it now looks quite manageable.  Using bottom
up coding, poll_pci() appears to be the first thing to implement.  So,
we need ports.

I dug up a previous discussion
http://readlist.com/lists/duskglow.com/open-graphics/1/6252.html.
After trimming the long identifiers and incorporating your suggestion of
encoding byte enables in the lower part of the port address, I ended up
with the attached file.

BTW, do we use MIT/X11 license for all HQ code?
;; PCI Ports
;; =========

let _PCI_B = -0x20 ; base address for PCI ports

;; Master Command
let PCI_M_CMD           = _PCI_B + 0x00 ; out - direction and count
let PCI_M_CMD_FREE      = _PCI_B + 0x01 ; in - number of commands we can write

;; Master Write
let PCI_M_WRITE_FREE    = _PCI_B + 0x02 ; in - how many data words we can write
let PCI_M_WRITE_DATA_0000=_PCI_B + 0x10 ; out - 16 ports for data word, where
                                        ; lower 4 address bits are byte enables
let PCI_M_WRITE_DATA_1111 = PCI_M_WRITE_DATA_0000 + 15 ; for convenience

;; Master Read
let PCI_M_READ_DATA     = _PCI_B + 0x04 ; in - data word
let PCI_M_READ_COUNT    = _PCI_B + 0x05 ; in - number of words available to read

;; Target Write
let PCI_T_WRITE_COUNT   = _PCI_B + 0x08 ; in - number of words in write queue
let PCI_T_WRITE_ADDR_FL = _PCI_B + 0x09 ; in - address and flags for a write
let PCI_T_WRITE_DATA    = _PCI_B + 0x0a ; in - data of write word

;; Target Read
let PCI_T_READ_PENDING  = _PCI_B + 0x0b ; in - nonzero if pending read
let PCI_T_READ_ADDR     = _PCI_B + 0x0c ; in - the one address that is pending
let PCI_T_READ_DATA     = _PCI_B + 0x0d ; out - where we write the one word


;; Memory Ports
;; ============

let _MEM_B = -0x40 ; base address for memory ports

let MEM_READREQ_FREE    = _MEM_B + 0x00 ; in - Free slots in command pipe.
let MEM_READREQ_ADDR_TRIG=_MEM_B + 0x01 ; out - First address to read.
let MEM_READREQ_COUNT   = _MEM_B + 0x02 ; out - Number of words to read.
let MEM_READREPLY_DATA  = _MEM_B + 0x03 ; in - Data stream from memory.
let MEM_READREPLY_AVAIL = _MEM_B + 0x04 ; in - Number of words in FIFO.

let MEM_WRITE_ADDR      = _MEM_B + 0x05 ; out - Start address.
let MEM_WRITE_FREE      = _MEM_B + 0x06 ; in - Free slots in output FIFO.
let MEM_WRITE_DATA_0000 = _MEM_B + 0x10 ; out - 16 ports for data stream, where
                                        ; lower 4 address bits are enables.
let MEM_WRITE_DATA_1111 = MEM_WRITE_DATA_0000 + 15 ; for convenience
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to