--- Quote Start ---
originally posted by smalllight@Oct 19 2006, 02:00 PM
tank you for you replies.
i have readed the ioremap.c
the __ioremap's code as follow:
__ioremap() in file arch/nios2nommu/mm/ioremap.c
/*
* map some physical address range into the kernel address space.
*/
void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag)
{
return (void *)(physaddr);
}
hippo can you tell me why you change the code to "return (void *)(physaddr|0x80000000); "?
i will regard your comment ,thank you
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=18786)
--- quote end ---
--- Quote End ---
Smcnutt had noted ioremap() in this thread,
http://forum.niosforum.com/forum/index.php...=735&hl=ioremap (
http://forum.niosforum.com/forum/index.php?showtopic=735&hl=ioremap)
Next, look at the cfi flash map driver, linux-2.6.x/drivers/mtd/maps/altera.c
nt __init init_alteramap(void)
{
static const char *rom_probe_types[] = {"cfi_probe", "jedec_probe", 0 };
const char **type;
ndk_amd_map.virt = (unsigned long *)ioremap_nocache(WINDOW_ADDR, WINDOW_SIZE);
Look at the ioremap() and ioremap_nocache() in linux-2.6.x/include/asm-nios2nommu/io.h
they all want the return be uncached address.
Though the mtd map use the uncached functions (from io.h) to access memory, linux-2.6.x/include/linux/mtd/map.h
Actually, the original code did not do anything about uncache.
I could agree with that, if all the access are consistent.
ie, always use the uncached functions (from io.h) to access memory,
and never mix access with the cached virt address .