Commit 46b2e7ce authored by Timothy Pearson's avatar Timothy Pearson
Browse files

xen: add files needed for minimal ppc64 build


Add arch-specific makefiles and configs needed to build for
ppc64. Also add a minimal head.S that is a simple infinite loop.
head.o can be built with

$ make XEN_TARGET_ARCH=ppc64 KBUILD_DEFCONFIG=tiny64_defconfig arch/powerpc/ppc64/head.o
Signed-off-by: Timothy Pearson's avatarTimothy Pearson <tpearson@raptorengineering.com>
parent 90ba9a2d
......@@ -454,6 +454,12 @@ M: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
S: Supported
F: tools/python
POWERPC64
M: Timothy Pearson <tpearson@raptorengineering.com>
S: Supported
F: config/ppc64.mk
F: xen/arch/powerpc/
QEMU-DM
S: Supported
T: git https://xenbits.xenproject.org/git-http/qemu-xen-traditional.git
......
CONFIG_POWERPC := y
CONFIG_POWERPC_64 := y
CONFIG_POWERPC_$(XEN_OS) := y
CONFIG_XEN_INSTALL_SUFFIX :=
......@@ -38,7 +38,7 @@ EFI_MOUNTPOINT ?= $(BOOT_DIR)/efi
ARCH=$(XEN_TARGET_ARCH)
SRCARCH=$(shell echo $(ARCH) | \
sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g' \
-e s'/riscv.*/riscv/g')
-e s'/ppc64/powerpc/g' -e s'/riscv.*/riscv/g')
export ARCH SRCARCH
# Allow someone to change their config file
......@@ -241,7 +241,7 @@ include $(XEN_ROOT)/Config.mk
export TARGET_SUBARCH := $(XEN_TARGET_ARCH)
export TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \
sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g' \
-e s'/riscv.*/riscv/g')
-e s'/ppc64/powerpc/g' -e s'/riscv.*/riscv/g')
export CONFIG_SHELL := $(SHELL)
export YACC = $(if $(BISON),$(BISON),bison)
......@@ -533,6 +533,7 @@ _clean:
$(Q)$(MAKE) $(clean)=xsm
$(Q)$(MAKE) $(clean)=crypto
$(Q)$(MAKE) $(clean)=arch/arm
$(Q)$(MAKE) $(clean)=arch/powerpc
$(Q)$(MAKE) $(clean)=arch/riscv
$(Q)$(MAKE) $(clean)=arch/x86
$(Q)$(MAKE) $(clean)=test
......
......@@ -5,6 +5,7 @@ config NR_CPUS
int "Maximum number of CPUs"
range 1 4095
default "256" if X86
default "512" if POWERPC
default "8" if ARM && RCAR3
default "4" if ARM && QEMU
default "4" if ARM && MPSOC
......
config POWERPC
def_bool y
config POWERPC_64
def_bool y
select 64BIT
config ARCH_DEFCONFIG
string
default "arch/powerpc/configs/tiny64_defconfig"
menu "Architecture Features"
source "arch/Kconfig"
endmenu
menu "ISA Selection"
choice
prompt "Base ISA"
default POWERPC_ISA_3_0 if POWERPC_64
help
This selects the base ISA extensions that Xen will target.
config POWERPC_ISA_3_0
bool "3.0"
help
Use the POWER 3.0 base ISA (POWER9)
endchoice
endmenu
source "common/Kconfig"
source "drivers/Kconfig"
.PHONY: include
include:
########################################
# PowerPC-specific definitions
CFLAGS-$(CONFIG_POWERPC_64) += -m64 -mabi=elfv2
powerpc-mcpu-$(CONFIG_POWERPC_ISA_3_0) := power9
# Note that -mcmodel=medany is used so that Xen can be mapped
# into the upper half _or_ the lower half of the address space.
# -mcmodel=medlow would force Xen into the lower half.
CFLAGS += -mcpu=$(powerpc-mcpu-y) -mstrict-align -mcmodel=medium
CFLAGS += -I$(BASEDIR)/include
# CONFIG_SCHED_CREDIT is not set
# CONFIG_SCHED_RTDS is not set
# CONFIG_SCHED_NULL is not set
# CONFIG_SCHED_ARINC653 is not set
# CONFIG_TRACEBUFFER is not set
# CONFIG_HYPFS is not set
# CONFIG_GRANT_TABLE is not set
# CONFIG_SPECULATIVE_HARDEN_ARRAY is not set
CONFIG_POWERPC_64=y
CONFIG_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_EXPERT=y
#ifndef __ARCH_POWERPC_CACHE_H
#define __ARCH_POWERPC_CACHE_H
/* L1 cache line size */
#define L1_CACHE_SHIFT (CONFIG_POWERPC_L1_CACHE_SHIFT)
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
#define __read_mostly __section(".data.read_mostly")
#ifndef __ASSEMBLY__
void cache_writeback(const void *addr, unsigned int size);
#endif
#endif
/******************************************************************************
* config.h
*
* A Linux-style configuration list.
*/
#ifndef __POWERPC_CONFIG_H__
#define __POWERPC_CONFIG_H__
#if defined(CONFIG_POWERPC_64)
# define LONG_BYTEORDER 3
# define ELFSIZE 64
# define MAX_VIRT_CPUS 512u
#else
# error "Unsupported PowerPC variant"
#endif
#define BYTES_PER_LONG (1 << LONG_BYTEORDER)
#define BITS_PER_LONG (BYTES_PER_LONG << 3)
#define POINTER_ALIGN BYTES_PER_LONG
#define BITS_PER_LLONG 64
/* xen_ulong_t is always 64 bits */
#define BITS_PER_XEN_ULONG 64
#define CONFIG_POWERPC_L1_CACHE_SHIFT 15
#define CONFIG_PAGEALLOC_MAX_ORDER 18
#define CONFIG_DOMU_MAX_ORDER 9
#define CONFIG_HWDOM_MAX_ORDER 10
#define OPT_CONSOLE_STR "dtuart"
#define INVALID_VCPU_ID MAX_VIRT_CPUS
/* Linkage for PowerPC */
#ifdef __ASSEMBLY__
#define ALIGN .align 8
#define ENTRY(name) \
.globl name; \
ALIGN; \
name:
#endif
#endif /* __POWERPC_CONFIG_H__ */
/*
* Local variables:
* mode: C
* c-file-style: "BSD"
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/
#ifndef __POWERPC_STRING_H__
#define __POWERPC_STRING_H__
#endif /* __POWERPC_STRING_H__ */
/*
* Local variables:
* mode: C
* c-file-style: "BSD"
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/
#ifndef __POWERPC_TYPES_H__
#define __POWERPC_TYPES_H__
#ifndef __ASSEMBLY__
typedef __signed__ char __s8;
typedef unsigned char __u8;
typedef __signed__ short __s16;
typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __signed__ long __s64;
typedef unsigned long __u64;
#endif
typedef signed char s8;
typedef unsigned char u8;
typedef signed short s16;
typedef unsigned short u16;
typedef signed int s32;
typedef unsigned int u32;
typedef signed long s64;
typedef unsigned long u64;
typedef unsigned long paddr_t;
#define INVALID_PADDR (~0UL)
#define PRIpaddr "016lx"
#if defined(__SIZE_TYPE__)
typedef __SIZE_TYPE__ size_t;
#else
typedef unsigned long size_t;
#endif
typedef signed long ssize_t;
#if defined(__PTRDIFF_TYPE__)
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#else
typedef signed long ptrdiff_t;
#endif
#endif /* __ASSEMBLY__ */
#endif /* __POWERPC_TYPES_H__ */
extra-y += head.o
#include <asm/config.h>
.text
ENTRY(start)
b start
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment