microwatt.c 549 B

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