nios2: kernel: Move the MMU initialization

The current MMU initialization consists only in the flush of all the TLB
entries. This is done based in the cpuinfo values that specify the TLB
geometry. Hence, the current calling of mmu_init() *before* the cpuinfo is
setup is wrong and doesn't perform any TLB flushing.

Fix it by moving the call to mmu_init() to be done *after* the cpuinfo has been
correctly filled.

This commit fixes soft-reboots, which are currently broken. Upon soft-reboot
(from a system that has entered userspace) the TLB would be filled and
were previously never flushed. Such systems booting from a soft-reboot
would fail to enter userpace, panic'ing like this:

  Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
RFC: nios2: Remove unneeded struct pt_regs zeroing

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
nios2: Export __muldi3 for GCC

WTF?

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
nios2: entry: Move assembler helper macros

These are only used by entry.S. It's easier for the reader
to have them on the same file they are used, so let's move them.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
nios2: irq: Use RDCTL to read ipending and ienable control regs

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
nios2: irq: s/unsigned/u32

Usage of 'unsigned' with implicit type is frowned upon.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
nios2: insnemu: Include asm-offset.h instead of entry.h

insnemu.S needs asm-offset.h instead of entry.h. Replace it
so we can get rid of the latter.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
nios2: Simplify get_thread_info implementation

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
nios2: inthandler: Use temporal registers to store r4 and r5

Instead of getting those from the the stack, save them on temporal
registers. This saves a couple of load instructions.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
nios2: entry: Remove unneeded assembler function exports

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
nios2: entry: Remove useless code

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
nios2: MMU code cleanup

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
NEEK DTS: Use NFS

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
nios2: entry: Minor code cleanup

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
nios2: Use unflatten

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>