Re: Problem mapping physical address (0xC0000000) on Arm Integrator by bmhsieh
bmhsieh
Mon Aug 11 12:25:16 CDT 2003
you should always use 0x8xxxxxx instead of 0xaxxxxxxx addresss in
OEMAddressTable. Kernel will automatically create 2 mappings (cached, and
uncached) and you can use 0xaxxxxxxx address to access it uncached.
Also, please make sure you don't have any overlap in the OEMAddressTable.
You should already be able to access 0xa1900000 - 0xa1a00000 if you're in
KMode. Have you try that and does it work?
BTW, calling MMMapIoSpace with "Virtual Address" will produce incorrect
mapping, and will not work.
-- Bor-Ming
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. Microsoft Corporation. All rights
reserved.
--------------------
| From: Iya Lifshits <arkad_ilkin@yahoo.com>
| Newsgroups: microsoft.public.windowsce.platbuilder
| Subject: Re: Problem mapping physical address (0xC0000000) on Arm
Integrator
| Date: Tue, 29 Jul 2003 17:29:52 +0200
| Organization: NetVision InterNetNews site
| Lines: 80
| Message-ID: <3F2692F0.6000501@yahoo.com>
| References: <bfttjl$hef$1@news2.netvision.net.il>
| NNTP-Posting-Host: 194.90.113.98
| Mime-Version: 1.0
| Content-Type: text/plain; charset=us-ascii; format=flowed
| Content-Transfer-Encoding: 7bit
| X-Trace: news2.netvision.net.il 1059489166 15798 194.90.113.98 (29 Jul
2003 14:32:46 GMT)
| X-Complaints-To: usenet@netvision.net.il
| NNTP-Posting-Date: Tue, 29 Jul 2003 14:32:46 +0000 (UTC)
| Cc: jeffgla@windows.microsoft.com
| User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2.1)
Gecko/20021130
| X-Accept-Language: en-us, en
| In-Reply-To: <bfttjl$hef$1@news2.netvision.net.il>
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.co
m!nntp.abs.net!ash.uu.net!news2.netvision.net.il!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.windowsce.platbuilder:36835
| X-Tomcat-NG: microsoft.public.windowsce.platbuilder
|
| I have narrowed the problem; I have created static mapping using
| OEMAddressTable:
|
| PA_TEST_BASE EQU 0xc0000000
| VA_TEST_BASE EQU 0x81900000
|
| DCD VA_TEST_BASE, PA_TEST_BASE, 1
|
| I am able to use the virtual address and to map it using MmMapIOSpace
| with cache flag enabled. I want to map it as non-cached; MmMapIOSpace
| succeeds but accessing the returned address causes:
|
| Unhandled exception dfff0123:
| 0x8bfc5384: NK Kernel: DEBUGCHK failed in file
| d:\mckendric\private\winceos\coreos\nk\kernel\arm\mdarm.c at line 1039
|
| Accessing other areas in the 0xa??????? areas work fine, for example LED
| access. When we try mapping our 0xc0000000 to oxa1900000 we fail as
| above. Any idea how can I do similar non-cached mapping ? Is this the
| right way ?
|
| Ilya
|
|
|
| Ilya wrote:
| > hi,
| > I posted this message before (through google) but it's seem like it's
| > appears only on google I can't see it using my newsreader so I repost it
| > again
| > here it's go :
| >
| > I have a device with memory registers in physical address 0xc0000000,
| > for which I am porting a driver from Linux to CE 4.2 using PB. The
| > device is connected to the logic module stack on an Arm Integrator
| > board running ARM920T CPU.
| > I have tried mapping this memory into virtual address using the
| > following:
| >
| > ....
| > addr = 0xc0000000;
| > PHYSICAL_ADDRESS mapped, port = {addr, 0};
| > ULONG inIoSpace = 0;
| > PUCHAR ioPortBase;
| >
| > if (!TransBusAddrToVirtual(Internal, 0, port, size, &inIoSpace,
| > &mapped))
| > printf("Error translating I/O Ports.\r\n");
| > ...
| >
| > Debugging into TransBusAddrToVirtual showed that the debugger was
| > disconnected inside the call for VitualCopy (in MmMapIoSpace).
| > The Linux driver maps (by ioremap) and uses this address successfully.
| > Does anyone know what could be causing this problem?
| > I tried also to statically map this address by modifying
| > OEMAddressTable (after finding out that CreateStaticMapping function
| > isn't implemented on Arm), but couldn't access VA_TEST.
| >
| > ...
| > VA_TEST EQU 0xa5000000 ;first availble after VA_SC_BASE
| >
| > EXPORT OEMAddressTable[DATA]
| >
| > OEMAddressTable
| > ...
| > DCD VA_TEST, 0xc0000000, 1
| > ...
| > ;
| > ; End of Table (MUST BE ZERO!)
| > ;
| > DCD 0, 0, 0
| >
| > AFAIK, there is no need for static mapping, using
| > TransBusAddrToVirtual should do the job for any user-mode driver.
| >
| > Any help will be appreciated,
| > Ilya.
| >
| >
|
|