Franck Bui-Huu wrote: > > I'm really not confident with all your tricks you described. Maybe a > config that I believed to be uninsteresting and useless should be > supported still. > > Can you try the attached patch with a plain linux-mips kernel ? This > patch restore CPHYSADDR() for 64 bits kernels _only_. I guess it's ok > because we won't need to support mapped kernels on 64 bits machines... > > Could others give their opinions ? After going through all the fun to get rid of CPHYSADDR, I see no point really to bring it back. Plus that patch unnecessarily complicates those defines. As I highlighted in my original mail, O2 doesn't need CPHYSADDR added to __pa(), it just needs the conditional define for __pa_page_offset to be a little bit more flexible. Since only three machines, O2 R5xx, Indy/Indigo2 R4xx, and Cobalt will exhibit similar issues (the latter two when booting 64bit kernels), a saner method in my opinion is to introduce a flag of sorts into the conditional for __pa_page_offset to determine whether to define it strictly to PAGE_OFFSET or to the other value listed in the code. The only thing is, I'm not sure which method of the two I've thought up is cleaner. The first introduces a hidden Kconfig value, CONFIG_SYS_LOADS_IN_CKSEG0, that only turns on when BUILD_ELF64 && (SGI_IP22 || (SGI_IP32 && (CPU_R5000 || CPU_NEVADA || CPU_RM7000)) || MIPS_COBALT), and then we test for this flag in include/asm-mips/page.h when setting the value of __pa_page_offset. The other way is to define a similar flag in a new header file, memmap.h, in include/asm-mips/mach-{ip22,ip32,cobalt}/* called MIPS_USES_CKSEG0, and similarly, test for that flag in the same spot as above. With this method, though, I'm not sure where exactly to pull in the memmap.h header, so the patch for it is incomplete (but included for reference). I've tested the first patch (kconfig one), and it works fine. The second one will also work, provided I find a nice spot to pull in memmap.h, but from a semantics perspective, which one do you guys like better? --Kumba -- Gentoo/MIPS Team Lead "Such is oft the course of deeds that move the wheels of the world: small hands do them because they must, while the eyes of the great are elsewhere." --Elrond