From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Larmour To: Ling Su Cc: ecos-discuss@sources.redhat.com Subject: Re: [ECOS] Memory mapping Question on NECvrc4373 Date: Sun, 10 Sep 2000 20:28:00 -0000 Message-id: <39BC5163.D09E04BD@redhat.com> References: <001e01c019ed$ff9f56f0$1201a8c0@crusoe> X-SW-Source: 2000-09/msg00118.html > Ling Su wrote: > > I found on the DDB-NECvrc4373 board manual, the physical address of PCI > slots if from 0x0C000000, and the Virtual address for the PROM is mapped > to 0xAC000000. In the eCos HAL layer "plf_io.h" for VRC4373, the > HAL_PCI_PHYSICAL_MEMORY_BASE is 0xC000000, which is different from the > 0x0C000000 phyiscal address on the manual. (I assume you meant to say that HAL_PCI_PHYSICAL_MEMORY_BASE is 0xC0000000.) I don't really know on what basis the board manual says that - perhaps it is specific to pmon and pmon differs here? The thing is that the way PCI works (someone correct me if I'm wrong here) is that memory/IO regions on cards have to be mapped into the CPU address space at a certain address. The important issue is that the address is of the CPU's choosing. When the CPU chooses the address, it tells the PCI controller what address the device was assigned. From then on, that is the device's address. > The comment for the > HAL_PCI_PHYSICAL_MEMORY_BASE is "where the PCI spaces are mapped in the > CPU's (virtual) address space", I don't quiet understand this differnece > and the comment actually. According to my understanding the > HAL_PCI_PHYSICAL_MEMORY_BASE should be the phyiscal address space on > board, is that correct? There is no address space on the board really - or at least that doesn't matter. All that matters is that the PCI card said it had e.g. 64Kb of memory. The PCI library code then maps this into memory starting at 0xC0000000. The next card would be mapped into memory starting at 0xC0000000+64Kb, for example. The other thing to say is that the physical address space is just mapped 1 for 1 in the virtual address space. There are no MMU tricks to move it around - so when you write to the virtual address of 0xC0000000, that's what should be what comes out the processor address bus. Nick, any comments on the above? Jifl -- Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762 "Plan to be spontaneous tomorrow." || These opinions are all my own fault