Skip to content

Commit 4a21192

Browse files
shenkimpe
authored andcommitted
powerpc/boot: Add a boot wrapper for Microwatt
This allows microwatt's kernel to be built with an embedded device tree. Load to arch/powerpc/boot/dtbImage.microwatt to 0x500000: mw_debug -b fpga stop load arch/powerpc/boot/dtbImage.microwatt 500000 start Signed-off-by: Joel Stanley <[email protected]> Signed-off-by: Paul Mackerras <[email protected]> Reviewed-by: Segher Boessenkool <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c93f808 commit 4a21192

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

arch/powerpc/boot/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ src-plat-$(CONFIG_PPC_POWERNV) += pseries-head.S
163163
src-plat-$(CONFIG_PPC_IBM_CELL_BLADE) += pseries-head.S
164164
src-plat-$(CONFIG_MVME7100) += motload-head.S mvme7100.c
165165

166+
src-plat-$(CONFIG_PPC_MICROWATT) += fixed-head.S microwatt.c
167+
166168
src-wlib := $(sort $(src-wlib-y))
167169
src-plat := $(sort $(src-plat-y))
168170
src-boot := $(src-wlib) $(src-plat) empty.c
@@ -355,6 +357,8 @@ image-$(CONFIG_MVME5100) += dtbImage.mvme5100
355357
# Board port in arch/powerpc/platform/amigaone/Kconfig
356358
image-$(CONFIG_AMIGAONE) += cuImage.amigaone
357359

360+
image-$(CONFIG_PPC_MICROWATT) += dtbImage.microwatt
361+
358362
# For 32-bit powermacs, build the COFF and miboot images
359363
# as well as the ELF images.
360364
ifdef CONFIG_PPC32

arch/powerpc/boot/microwatt.c

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

arch/powerpc/boot/wrapper

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,11 @@ gamecube|wii)
342342
link_address='0x600000'
343343
platformo="$object/$platform-head.o $object/$platform.o"
344344
;;
345+
microwatt)
346+
link_address='0x500000'
347+
platformo="$object/fixed-head.o $object/$platform.o"
348+
binary=y
349+
;;
345350
treeboot-currituck)
346351
link_address='0x1000000'
347352
;;

0 commit comments

Comments
 (0)