xref: /linux/arch/powerpc/boot/microwatt.c (revision 4a21192e2796c3338c4b0083b494a84a61311aaf)
1*4a21192eSJoel Stanley // SPDX-License-Identifier: GPL-2.0-or-later
2*4a21192eSJoel Stanley 
3*4a21192eSJoel Stanley #include <stddef.h>
4*4a21192eSJoel Stanley #include "stdio.h"
5*4a21192eSJoel Stanley #include "types.h"
6*4a21192eSJoel Stanley #include "io.h"
7*4a21192eSJoel Stanley #include "ops.h"
8*4a21192eSJoel Stanley 
9*4a21192eSJoel Stanley BSS_STACK(8192);
10*4a21192eSJoel Stanley 
11*4a21192eSJoel Stanley void platform_init(unsigned long r3, unsigned long r4, unsigned long r5)
12*4a21192eSJoel Stanley {
13*4a21192eSJoel Stanley 	unsigned long heapsize = 16*1024*1024 - (unsigned long)_end;
14*4a21192eSJoel Stanley 
15*4a21192eSJoel Stanley 	/*
16*4a21192eSJoel Stanley 	 * Disable interrupts and turn off MSR_RI, since we'll
17*4a21192eSJoel Stanley 	 * shortly be overwriting the interrupt vectors.
18*4a21192eSJoel Stanley 	 */
19*4a21192eSJoel Stanley 	__asm__ volatile("mtmsrd %0,1" : : "r" (0));
20*4a21192eSJoel Stanley 
21*4a21192eSJoel Stanley 	simple_alloc_init(_end, heapsize, 32, 64);
22*4a21192eSJoel Stanley 	fdt_init(_dtb_start);
23*4a21192eSJoel Stanley 	serial_console_init();
24*4a21192eSJoel Stanley }
25