On 5/20/05, Eric Smith <[EMAIL PROTECTED]> wrote:
> Timothy wrote:
> > It appears that the extent of I/O space that is reserved for VGA is
> > 3B4h to 3DAh.  Are they all bytes?  Or are any 16-bit?
> 
> AFAIK, they are all 8 bit.

I think it won't be hard to deal with if someone does a 16-bit
transaction, or even 32.

> 
> > Is it okay to accept any I/O transations that aren't defined but
> > within that space?
> 
> No.  Other legacy devices may have addresses inside that range, most
> notably a parallel printer port at 3BCh..3BFh.
> 
> I think it's OK to claim all of 3C0h..3CFh, though 3CBh and 3CDh don't
> appear to be used.  Beyond that, a VGA card should claim 3x4h..3x5h
> and 3xAh, where x is B or D depending on whether the VGA is emulating
> an MDA or CGA card.  It's not recommended to claim both; I'd either
> claim the CGA registers or make it configurable.  It's useful at times
> to use an MDA card as an auxilliary monitor for debugging.

Is B==MDA and D==CGA?

> 
> > Is it okay to accept any transactions that are not within that space?
> 
> Definitely not.  That would interfere with other legacy devices.
> 
> > I think the ONLY I/O space that I will decode is VGA.
> 
> With AGP/PCI/PCI-Express, things are complicated by the fact that you
> can have more than one legacy card.  As I understand it, all the legacy
> VGA cards will try to claim that I/O space, but BIOS will only set the
> I/O space enable bit for one of them.  The VGA registers should be
> dual-mapped to both the I/O space and to a memory-mapped region
> controlled by a Base Address register, so that the software can access
> the VGA registers on cards other than the default one.

Easy enough.

> IIRC, this is somewhat tersely described in an appendix of the PCI
> standard.
> 
> There's definitely no reason to I/O-map any registers other than the
> legacy VGA registers.  Anything new you define should be memory-mapped.

Ok, here's the logic to decode VGA I/O addresses... let me know if it's right:

reg VGAI_v;
always @(address_last or VGAI_en or MDA_en or CGA_en) begin
    case (address_last[6:0])
        'h34, 'h35, 'h3a: VGAI_v = VGAI_en && MDA_en;
        'h54, 'h55, 'h5a: VGAI_v = VGAI_en && CGA_en;
        'h40, 'h41, 'h42, 'h44, 'h45, 'h47, 'h48, 'h49, 'h4a,
        'h4c, 'h4e, 'h4f: VGAI_v = VGAI_en;
        default: VGAI_v = 0;
    endcase
    VGAI_v = VGAI_v && (address_last[31:7] == 7);
end

_______________________________________________
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