Skip to content

Fix build for QEMU board and PPC 970. #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions board-qemu/config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BOARD=qemu
TARG=ppc64
export FLAG="-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C "
export CPUARCH=ppcp7
export CPUARCHDEF=-DCPU_PPCP7
export CPUARCH=ppc970
export CPUARCHDEF=-DCPU_PPC970
#export SNK_BIOSEMU_APPS=1
FLASH_SIZE=8388608
5 changes: 3 additions & 2 deletions include/ppc970/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ cache_inhibited_access(uint64_t, 64)
{ \
t *s1 = (s), *d1 = (d); \
register t tmp; \
while (size > 0) { \
tmp = *s1++; SET_CI; *d1++ = tmp; CLR_CI; size -= sizeof(t); \
register t tmp_size = size; \
while (tmp_size > 0) { \
tmp = *s1++; SET_CI; *d1++ = tmp; CLR_CI; tmp_size -= sizeof(t); \
} \
}

Expand Down
3 changes: 3 additions & 0 deletions include/ppc970/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ static inline void flush_cache(void* r, long n)
asm volatile(EXPAND(FLUSH_CACHE(%0, %1)) : "+r"(r), "+r"(n) :: "memory", "cc", "r0", "ctr");
}

#define SET_CI set_ci()
#define CLR_CI clr_ci()

#endif /* __ASSEMBLER__ */

#endif
5 changes: 4 additions & 1 deletion lib/libhvcall/rfill.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
#include <cache.h>
#include <string.h>

typedef unsigned long type_u;
typedef unsigned char type_c; // 1 byte
typedef unsigned short type_w; // 2 bytes
typedef unsigned int type_l; // 4 bytes
typedef unsigned long type_u; // cell size

/**
* fast_rfill is the implementation of the FAST_RFILL macro with h-calls.
Expand Down
4 changes: 2 additions & 2 deletions make.rules
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# CROSS is the prefix of your cross-compiler.
# You can override this variable in your environment (export CROSS=...).
ARCH := $(shell uname -p)
ARCH := $(shell uname -m)

# Auto-detect ppc64
ifeq (ppc64,$(findstring ppc64,$(ARCH)))
Expand All @@ -26,7 +26,7 @@ ifeq (ppc64,$(findstring ppc64,$(ARCH)))
endif
CROSS ?=
else
CROSS ?= powerpc64-linux-
CROSS ?= powerpc64-unknown-linux-gnu-
endif

CELLSIZE ?= 64
Expand Down