Re: [PATCH 4/6] input: Add N64 controller driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





在 2020/12/26 15:41, Lauri Kasanen 写道:
On Sat, 26 Dec 2020 11:25:49 +0800
Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx> wrote:

+#define PIF_RAM 0x1fc007c0
+#define REG_BASE ((u32 *) CKSEG1ADDR(0xa4800000))
0xa4800000 sounds like a KSEG1 addr, I think phys should be 0x14800000?
For driver it is common to use ioremap, or at least TO_UNCAC.
TO_UNCAC looks like it wouldn't work for vr4300, the manual says
uncached 64-bit space is 0xffff ffff a000 0000, when
include/asm/mach-generic/spaces.h puts the 64bit space start at
0x9000 0000 0000 0000.

0x9000 0000 0000 0000 is a part of MIPS ISA defined "XKPHYS" unmapped
region. Accorading to "NEC VR43xx User’s Manual"[1] pp 134-135
it does exisit on VR43xx.

If it doesn't work then it means VR43xx doesn't properly implemented
Status.KX. In this case you shouldn't run a 64bit kernel as many code
in kernel assumed proper KX implementation.

TO_UNCAC is much more clear than CKSEG1ADDR for readers.


ioremap - it looked like needless overhead. Is this a blocker?

Well I assume it isn't, just a common parctice.


The 0xa uncached prefix being in the address already is harmless, it is
the same on both 32-bit and 64-bit on this cpu. I left it in because it
makes it clear to me what kind of address it is, coming from the N64
side.

Than it is not actual physical address, CKSEG1ADDR makes me confusing.

Thanks.

[1]: http://datasheets.chipdb.org/NEC/Vr-Series/Vr43xx/U10504EJ7V0UMJ1.pdf

- Jiaxun


- Lauri




[Index of Archives]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux