aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2021-09-30 16:48:14 +1000
committerAlexey Kardashevskiy <aik@ozlabs.ru>2021-10-01 14:19:58 +1000
commit0705a5cc1df7ad6bd3c2a7dfb1faccd3b44269c1 (patch)
treeee9720426e1ba130936c7304d69941d734cadc65
parent6903c037a6b45140a495a6541ef92a0aabc7a30c (diff)
downloadSLOF-0705a5cc1df7ad6bd3c2a7dfb1faccd3b44269c1.zip
SLOF-0705a5cc1df7ad6bd3c2a7dfb1faccd3b44269c1.tar.gz
SLOF-0705a5cc1df7ad6bd3c2a7dfb1faccd3b44269c1.tar.bz2
js2x: Fix compile and cleanup
This moves shared symbols out from the header file and leaves only the minimum in bmc.h. This fixes a "while (...); {" bug spotted by the modern gcc. This fixes cleanup as otherwise the board-js2x/Makefile's "clean" tries cleaning "rtas" which tries cleaning all libs (not just the ones it uses) and that in turn triggers generation of lib/libtpm/Makefile.dep which fails due to missing ./board-js2x/include/version.h. This fixes create_reloc_table.sh to build with newer toolchains which otherwise fail with: ld: cannot use executable file 'reloc_table.o' as input to a link This adds js2x compile to the travis script to know when it breaks again. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
-rw-r--r--.travis.yml2
-rw-r--r--board-js2x/include/bmc.h14
-rw-r--r--board-js2x/rtas/rtas_board.c15
-rw-r--r--lib/Makefile4
-rwxr-xr-xtools/create_reloc_table.sh2
5 files changed, 21 insertions, 16 deletions
diff --git a/.travis.yml b/.travis.yml
index 0f3b871..59af7a7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,6 +10,8 @@ script:
- export PATH="/opt/at14.0/bin:$PATH"
- make -j2 qemu
- ./lib/libtpm/test.sh
+ - make -j2 distclean
+ - make -j2 js2x
jobs:
include:
diff --git a/board-js2x/include/bmc.h b/board-js2x/include/bmc.h
index 39dff80..7879379 100644
--- a/board-js2x/include/bmc.h
+++ b/board-js2x/include/bmc.h
@@ -13,17 +13,7 @@
#ifndef __BMC_H
#define __BMC_H
-void (*bmc_system_reboot) (void);
-void (*bmc_power_off) (void);
-
-short (*bmc_set_flashside) (short mode);
-short (*bmc_get_flashside) (void);
-int (*bmc_stop_bootwatchdog) (void);
-int (*bmc_set_bootwatchdog) (unsigned short);
-
-uint32_t(*bmc_read_vpd) (uint8_t * dst, uint32_t len, uint32_t offset);
-uint32_t(*bmc_write_vpd) (uint8_t * src, uint32_t len, uint32_t offset);
-
-uint32_t(*bmc_get_blade_descr) (uint8_t * dst, uint32_t maxlen, uint32_t * len);
+extern short (*bmc_set_flashside) (short mode);
+extern short (*bmc_get_flashside) (void);
#endif /* __BMC_H */
diff --git a/board-js2x/rtas/rtas_board.c b/board-js2x/rtas/rtas_board.c
index 7f7409d..531bb1f 100644
--- a/board-js2x/rtas/rtas_board.c
+++ b/board-js2x/rtas/rtas_board.c
@@ -23,6 +23,19 @@ void io_init(void);
short reg_get_flashside(void);
void rtas_init(void);
+void (*bmc_system_reboot) (void);
+void (*bmc_power_off) (void);
+
+short (*bmc_set_flashside) (short mode);
+short (*bmc_get_flashside) (void);
+int (*bmc_stop_bootwatchdog) (void);
+int (*bmc_set_bootwatchdog) (unsigned short);
+
+uint32_t(*bmc_read_vpd) (uint8_t * dst, uint32_t len, uint32_t offset);
+uint32_t(*bmc_write_vpd) (uint8_t * src, uint32_t len, uint32_t offset);
+
+uint32_t(*bmc_get_blade_descr) (uint8_t * dst, uint32_t maxlen, uint32_t * len);
+
typedef struct {
uint64_t r3;
uint64_t addr;
@@ -36,7 +49,7 @@ rtas_slave_loop(volatile slave_t * pIface)
{
uint64_t mask = pIface->id;
pIface->id = 0;
- while (pIface->id != mask); {
+ while (pIface->id != mask) {
int dly = 0x1000;
while (dly--);
}
diff --git a/lib/Makefile b/lib/Makefile
index 7369894..fbc4eec 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -25,11 +25,11 @@ $(SUBDIRS):
# Rules for making clean:
clean:
- @for dir in $(SUBDIRS); do \
+ @for dir in $(COMMON_LIBS); do \
$(MAKE) -C $$dir clean || exit 1; \
done
distclean:
- @for dir in $(SUBDIRS); do \
+ @for dir in $(COMMON_LIBS); do \
$(MAKE) -C $$dir distclean || exit 1; \
done
diff --git a/tools/create_reloc_table.sh b/tools/create_reloc_table.sh
index 8cacb74..d4790dd 100755
--- a/tools/create_reloc_table.sh
+++ b/tools/create_reloc_table.sh
@@ -54,7 +54,7 @@ $OBJCOPY -O binary $TMP2.o $TMP2.bin || exit -1
# Create the relocation table with gen_reloc_table:
$DIRNAME/gen_reloc_table $TMP1.bin $TMP2.bin reloc_table.bin
-$LD -o reloc_table.o -bbinary reloc_table.bin -e0 || exit -1
+$LD -r -o reloc_table.o -bbinary reloc_table.bin -e0 || exit -1
$OBJCOPY --rename-section .data=.reloc reloc_table.o reloc_table.o || exit -1
rm -f $TMP1.o $TMP2.o $TMP1.bin $TMP2.bin reloc_table.bin