IO Mem Phys Addr for NIC w/ 1MB

IO Mem Phys Addr for NIC w/ 1MB

Post by Trevor Mend » Wed, 31 Aug 1994 04:17:42

I am writing a device driver for a network interface card that has 1 MB of
on-board memory which needs to be mapped into the kernel's address space.
Since 1 MB is larger than I/O memory hole (0x0a0000 --> 0x100000) it's not clear
where the memory should be mapped.  I tried mapping it somewhere above the
kernel's RAM, but kvtop() crashes (null pointer) when indirectly called to
convert the address passed to the driver's probe routine to a physical address.

Platform:       FreeBSD 1.1; i486 50 MHz w/ 16MB RAM
IO Space:       IO MEM: 0x0a0000  -> 0x100000
                RAM:    0x0000000 -> 0x1000000
NIC:            EISA Card w/ 1 MB RAM
                (Defualt setting address is 16 MB, manufacture says the settting
                must be on a 1 MB boundary).
MISC:           16k Ethernet card mapped at 0xd8000

Attempted Config:
        device va0 at isa? port 0x1000 net irq 9 iomem 0x1000000 vector vaintr

                isdp->id_maddr = 0x1000000;
                isdp->id_maddr = 0xa0000;
                isdp->id_maddr += atdevbase;


                phys = vtophys(isa->id_maddr); /* crashes in kvtop() */



1. driver: mmap from phys addr

OKay, I googled, and found Bruce's old post about how calling
hat_getkfpnum() on the result of ddi_regs_map was never kosher, etc. etc.
(even though the sample 'pviv' framebuffer driver uses that method,
 and so does vgatext)

So i have an inkling of why my current attempts to use mmap to my driver
are getting Bus Errors.
Trouble is, the alternative of using devmap/segmap is waaay more hassle
to code.

If I know the physical address that the thing has been mapped to
 (by parsing the assigned-addresses property)
is there an easy way to return the appropriate value from the
 mmap(9e) driver entrypoint?

[Trim the no-bots from my address to reply to me by email!]
[ Do NOT email-CC me on posts. Pick one or the other.]

2. Support for Promise 20376 FastTrack controller???

3. Can I limit phys mem of process in SunOS 4.1.1?

4. Netscape Navigator Javascript

5. How can i alloc a big phys mem for DMA?

6. NEW: Component-based Programming with Connective C++

7. phys to virt and virt to phys help please

8. Asynchronous I/O changes for V5.1

9. MEM/IO base of PCI video cards?

10. 4.8 startx can't open /dev/io (or /dev/mem)

11. system call for CPU,mem,IO (SVR4, AIX)

12. convert /proc/io{mem,ports} to seq_file

13. 3com nic, 100TX-HD, only 1MB/Sec