]> git.karo-electronics.de Git - karo-tx-linux.git/commit
metag: Memory handling
authorJames Hogan <james.hogan@imgtec.com>
Tue, 9 Oct 2012 09:54:17 +0000 (10:54 +0100)
committerJames Hogan <james.hogan@imgtec.com>
Tue, 29 Jan 2013 12:34:21 +0000 (12:34 +0000)
commit20b2c926d9d5dc3bdaf82714c94b6060b50b57ce
tree625c3c990f84669feea05ef40bdc4da49945cd9b
parent18f41053a87355d5fd4399f69b2530fcfa9093e3
metag: Memory handling

Meta has instructions for accessing:
 - bytes        - GETB (1 byte)
 - words        - GETW (2 bytes)
 - doublewords  - GETD (4 bytes)
 - longwords    - GETL (8 bytes)

All accesses must be aligned. Unaligned accesses can be detected and
made to fault on Meta2, however it isn't possible to fix up unaligned
writes so we don't bother fixing up reads either.

This patch adds metag memory handling code including:
 - I/O memory (io.h, ioremap.c): Actually any virtual memory can be
   accessed with these helpers. A part of the non-MMUable address space
   is used for memory mapped I/O. The ioremap() function is implemented
   one to one for non-MMUable addresses.
 - User memory (uaccess.h, usercopy.c): User memory is directly
   accessible from privileged code.
 - Kernel memory (maccess.c): probe_kernel_write() needs to be
   overwridden to use the I/O functions when doing a simple aligned
   write to non-writecombined memory, otherwise the write may be split
   by the generic version.

Note that due to the fact that a portion of the virtual address space is
non-MMUable, and therefore always maps directly to the physical address
space, metag specific I/O functions are made available (metag_in32,
metag_out32 etc). These cast the address argument to a pointer so that
they can be used with raw physical addresses. These accessors are only
to be used for accessing fixed core Meta architecture registers in the
non-MMU region, and not for any SoC/peripheral registers.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
arch/metag/include/asm/io.h [new file with mode: 0644]
arch/metag/include/asm/uaccess.h [new file with mode: 0644]
arch/metag/lib/usercopy.c [new file with mode: 0644]
arch/metag/mm/ioremap.c [new file with mode: 0644]
arch/metag/mm/maccess.c [new file with mode: 0644]