From: Geert U. <ge...@li...> - 2000-10-18 16:26:23
|
On Tue, 17 Oct 2000 fh...@at... wrote: > In <Pine.LNX.4.10.10010171602340.394-100000@cassiopeia.home>, on 10/17/00 > at 04:09 PM, Geert Uytterhoeven <ge...@li...> said: > > >On Tue, 17 Oct 2000 fh...@at... wrote: > >> So, have I got this right? Setup has: > >To find out that unknown location, you can replace the `7' by some easy > >to find unique value (whatever that may mean, e.g. 0xdeadbeef or > >0xdeadcode or 0xfAedbeef (looks like Fredbeef :-)) and search for it in > >memory after running the DSP script. > > How to I search the memory? grep deadcode /dev/kmem ? No, you search from 0xc0000000 to 0xc4000000 in your driver. > >> So, why is the physical address of the script at the top of memory but the > >> physical address of ncr_cache down at the bottom of memory? > > >Indeed weird. Perhaps the DSP doesn't have access to all memory. > > The script code is allocated by a different method then the ncb structure. > (I think.) The cache variable is in the ncb structure. > > >That 64 MB RAM is on the CSPPC and not on your A4000 motherboard, right? > > I have 64MB of RAM on the CSPPC. > > >> Are virt_to_bus() and virt_to_phys() the same on your platform? > > >I don't think we know that yet... > > What should be the difference? A virtual address is an address as seen by the CPU after translation by the A physical address is an address as seen by the CPU before translation by the MMU. MMU. A bus address is an address as seen by a controller on the bus. Example: the NCR53c770 on the CSPPC - Physical: 0x00f4000 (in Zorro II space)0 - Virtual: ZTWO_VADDR(0x00f4000) = 0x80f4000 - Bus address: not needed here Example: your RAM on the CSPPC. - Physical: 0x08000000-0x0bffffff - Virtual: 0xc0000000-0xc3ffffff - Bus address, as seen from the NCR53c770: we're not really sure about that To make sure the NCR53c770 can transfer data to/from memory using DMA, it needs to be given the _bus_ address of the buffer in memory you want to use, hence you need to convert the virtual address of the buffer as seen by the CPU in kernel mode to the bus address using virt_to_bus(). The driver should take care of that. Other example: 32 kB of RAM on the Ariadne Ethernet card at offset 0x8000 on the card. Let's assume the card is at physical 0x00e90000, so the RAM is at - Physical: 0x00e98000 (in Zorro II space). - Virtual: ZTWO_VADDR(0x00e98000) = 0x80e98000 - Bus address, as seen from the Ethernet chip: 0x00080000 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |