summaryrefslogtreecommitdiff
path: root/Makefile
AgeCommit message (Collapse)AuthorFilesLines
2023-03-01make: Add a command line option for debugging OpenSBIBin Meng1-1/+6
Add a new make command line option "make DEBUG=1" to prevent compiler optimizations using -O2. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2023-02-08Makefile: Add missing .dep files for fw_*.elf.ldJessica Clarke1-0/+9
Since we don't currently create these, changes to fw_base.ldS do not cause the preprocessed fw_*.elf.ld files to be rebuilt, and thus incremental builds can end up failing with missing symbols if crossing the recent commits that introduced _fw_rw_offset and then replaced it with _fw_rw_start. Reported-by: Ben Dooks <ben.dooks@sifive.com> Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2023-01-06Makefile: Remove -N ldflag to prevent linker RWX warningRahul Pathak1-1/+1
-N option coalesce all sections into single LOAD segment which causes data and other sections to have executable permission causing warning with new binutils ld 2.39. New ld emits warning when any segment have all three permissions RWX. ld.bfd: warning: test.elf has a LOAD segment with RWX permissions ld.bfd: warning: fw_dynamic.elf has a LOAD segment with RWX permissions ld.bfd: warning: fw_jump.elf has a LOAD segment with RWX permissions ld.bfd: warning: fw_payload.elf has a LOAD segment with RWX permissions This option was added in below commit - commit: eeab92f2423e ("Makefile: Convert to a more standard format") Removing -N option allows to have text and rodata into one LOAD segment and other sections into separate LOAD segment which prevents RWX permissions on single LOAD segment. Here X == E Current LOAD 0x0000000000000120 0x0000000080000000 0x0000000080000000 0x000000000001d4d0 0x0000000000032ed8 RWE 0x10 -N removed LOAD 0x0000000000001000 0x0000000080000000 0x0000000080000000 0x00000000000198cc 0x00000000000198cc R E 0x1000 LOAD 0x000000000001b000 0x000000008001a000 0x000000008001a000 0x00000000000034d0 0x0000000000018ed8 RW 0x1000 Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org> Tested-by: Samuel Holland <samuel@sholland.org>
2022-12-04Makefile: bugfix for handling platform pathsAlejandro Cabrera Aldaya1-1/+1
If the path where this repo is located contains the platform name on it, the original Makefile replaced its occurrences from the path making it an invalid path. This commit prevents this behavior replacing only the last part of the path as intended. Signed-off-by: Alejandro Cabrera Aldaya <aldaya@gmail.com> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2022-12-04Makefile: replace `echo` with `printf` for compatibilityKaDiWa1-1/+1
I don't know why but `echo -n` didn't work for me. macOS supports the `-n` option but it doesn't work in the makefile. What it does instead is it literally writes `-n` to the file and then also leaves a newline at the end. I'm using GNU Make 4.4 (`gmake` from Homebrew). Signed-off-by: KaDiWa <kalle.wachsmuth@gmail.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2022-10-23Makefile: Add rules for carray sources in lib/sbiVivian Wang1-0/+7
Add back the missing rules needed to build carray files in lib/sbi. This allows future usage of carray in lib/sbi. Fixes: de80e9337d81 ("Makefile: Compile lib/utils sources separately for each platform") Signed-off-by: Vivian Wang <dramforever@live.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2022-10-23Makefile: Add cscope supportTan En De1-0/+13
Add cscope support so that running `make cscope` will generate/update cscope files used for source code browsing, while running `make distclean` will remove the cscope files. Also add entry in .gitignore to ignore generated cscope files. Signed-off-by: Tan En De <ende.tan@linux.starfivetech.com> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org> Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
2022-08-08Makefile: Fix typo related to object.mkAnup Patel1-1/+1
The "object.mk" name referred in top-level makefile should be "objects.mk". Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Tested-by: Andrew Jones <ajones@ventanamicro.com> Acked-by: Atish Patra <atishp@rivosinc.com> Tested-by: Atish Patra <atishp@rivosinc.com>
2022-08-08platform: Remove redundant config.mk from all platformsAnup Patel1-3/+1
The options defined in config.mk can be specified in objects.mk of each platform so let us remove config.mk from all platforms. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Tested-by: Andrew Jones <ajones@ventanamicro.com> Acked-by: Atish Patra <atishp@rivosinc.com> Tested-by: Atish Patra <atishp@rivosinc.com>
2022-08-08Makefile: Compile lib/utils sources separately for each platformAnup Patel1-24/+24
Currently, if same build directory is used to compile two different platforms then lib/utils objects are shared for these platforms. We will be having platform specific configs to enable/disable drivers in lib/utils and select compile time options for lib/utils sources. This means lib/utils sources will now be compiled in a platform specific way. To tackle above, we update top-level Makefile as follows: 1) Don't create libsbiutils.a anymore because this can't be shared between platforms. 2) Compile lib/utils sources separately for each platform. 3) Add comments showing which make rules are for lib/sbi, lib/utils, firmware, and platform sources. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Tested-by: Andrew Jones <ajones@ventanamicro.com> Acked-by: Atish Patra <atishp@rivosinc.com> Tested-by: Atish Patra <atishp@rivosinc.com>
2022-08-08Makefile: Add initial kconfig support for each platformAnup Patel1-12/+60
We extend the top-level makefile to allow kconfig based configuration for each platform where each platform has it's own set of configs with "defconfig" being the default config. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Tested-by: Andrew Jones <ajones@ventanamicro.com> Acked-by: Atish Patra <atishp@rivosinc.com> Tested-by: Atish Patra <atishp@rivosinc.com>
2022-05-13Makefile: Add support for generating C array at compile timeAnup Patel1-0/+11
Generating C array at compile time based on details provided by objects.mk is a very useful feature which will help us compile only a subset of drivers or modules. We add a bash script (carray.sh) which takes array details and object/variable list from command-line to generate a C source containing array of object/variable pointers. We also extend top-level makefile to use carray.sh whenever specified through objects.mk. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com>
2022-05-13Makefile: Allow generated C source to be anywhere in build directoryAnup Patel1-3/+3
The generated C source could be anywhere within build directory so let us update the make rule to comple generated C source accordingly. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com>
2022-02-04Makefile: fix build with binutils 2.38Aurelien Jarno1-1/+8
From version 2.38, binutils default to ISA spec version 20191213. This means that the csr read/write (csrr*/csrw*) instructions and fence.i instruction has separated from the `I` extension, become two standalone extensions: Zicsr and Zifencei. As the kernel uses those instruction, this causes the following build failure: CC lib/sbi/sbi_tlb.o <<BUILDDIR>>/lib/sbi/sbi_tlb.c: Assembler messages: <<BUILDDIR>>/lib/sbi/sbi_tlb.c:190: Error: unrecognized opcode `fence.i' make: *** [Makefile:431: <<BUILDDIR>>/build/lib/sbi/sbi_tlb.o] Error 1 The fix is to specify those extensions explicitly in -march. However as older binutils version do not support this, we first need to detect that. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Alexandre Ghiti <alexandre.ghiti@canonical.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2021-12-16Makefile: Improve the method to disable -m(no-)save-restore optionXiang W1-4/+7
The commit 69d7e53 disables the -m(no-)save-restore option for clang, but clang11 supports this option. This patch uses the output information of the compiler to check whether the compiler supports this option. Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2021-12-11Makefile: Fix -msave-restore compile warning with CLANG-10 (or lower)Anup Patel1-4/+10
The riscv target of CLANG-10 (or lower) does not support the -m(no-)save-restore option so we get compile warnings. This patch fixes compile warning by using -m(no-)save-restore option only for GCC. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Dong Du <Dd_nirvana@sjtu.edu.cn>
2021-10-20Makefile: Add build time and compiler info stringWei Fu1-0/+31
When we are doing opensbi development, we want to know the build time and compiler info for debug purpose. To enable this message, please add "BUILD_INFO=y", like: ``` make BUILD_INFO=y ``` NOTE: Using `BUILD_INFO=y` without specifying SOURCE_DATE_EPOCH will violate "reproducible builds". So it's ONLY for development and debug purpose, and should NOT be used in a product which follows "reproducible builds". Signed-off-by: Wei Fu <wefu@redhat.com> Reviewed-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
2021-07-27Makefile: Manually forward RELAX_FLAG to the assembler when linking with LLDBin Meng1-0/+5
When generating code with -mno-relax, GCC puts .option norelax in the generated assembly, and so doesn’t bother passing on -mno-relax to the assembler. This has the unfortunate effect that, when using GCC to assemble hand-written assembly, -mno-relax does nothing, and we have to pass -Wa,-mno-relax to manually forward it to the assembler. This is an old GCC bug that was fixed [1] recently. For the time being, let's pass "-Wa,-mno-relax" to ASFLAGS for the GCC + LLD combination to work, e.g.: $ make CC=riscv64-unknown-elf-gcc LLVM=1 PLATFORM=generic [1] https://github.com/gcc-mirror/gcc/commit/3b0a7d624e64eeb81e4d5e8c62c46d86ef521857 Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2021-07-11lib: utils: Drop dependency on libgcc by importing part of FreeBSD's libquadJessica Clarke1-1/+1
We only need libgcc for 64-bit division on RV32. Whilst GCC toolchains bundle libgcc, Clang toolchains tend not to ship libclang_rt.builtins given every compiler is a cross-compiler for every target and so you would need a silly number of builds of it, with only the native library available; only vendor-provided Clang toolchains specifically for bare metal cross-compiling are likely to provide it. Thus, import part of FreeBSD's implementation of the division support functions needed and stop linking against libgcc. Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com> Reviewed-by: Anup Patel <anup.patel@wdc.com> Tested-by: Anup Patel <anup.patel@wdc.com>
2021-07-11Makefile: Support building with Clang and LLVM binutilsJessica Clarke1-7/+59
This is intended to mirror the Linux kernel. Building with CC=clang will use Clang as the compiler but default to using the existing binutils. Building with LLVM=1 will default to using Clang and LLVM binutils. Whilst GCC will accept the -N linker option and forward it on to the linker, Clang will not, and so in order to support both compilers we must use -Wl, to forward it to the linker as is required for most other linker options. Note that there is currently a bug when using Clang as the compiler and riscv64-linux-gnu-ld as the linker for FW_PIC=y. At first glance this appears to be a bug in GNU binutils, but this could also be Clang or OpenSBI at fault in some subtle way. Thus, for now, advise that this combination be avoided. Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com> Reviewed-by: Anup Patel <anup.patel@wdc.com> Tested-by: Anup Patel <anup.patel@wdc.com>
2021-07-11firmware: Only default FW_PIC to y if supportedJessica Clarke1-0/+3
Bare-metal GNU ld does not support PIE, so if using it this will result in a failure to build. Instead, default to FW_PIC=n if not supported. Note that an explicit FW_PIC=y is not overridden, to ensure the build fails rather than silently producing a position-dependent binary. Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2021-05-19Makefile: unconditionally disable SSPFabrice Fontaine1-1/+1
Though -nostdlib is passed in CFLAGS, -fno-stack-protector must also be passed to avoid linking errors related to undefined references to '__stack_chk_guard' and '__stack_chk_fail' if toolchain enforces -fstack-protector. Fixes: - https://gitlab.com/kubu93/buildroot/-/jobs/1247043359 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Xiang W <wxjstz@126.com>
2021-03-22include: headers: Replace __ASSEMBLY__ with __ASSEMBLER__Marouene Boubakri1-1/+1
GCC has already a predefined macro __ASSEMBLER__ therefore, it can be used without the need to define a new flag with -D__ASSEMBLY__. This is useful when adding the library to projects having a build system such one can build without the need to make changes. THe build system does not use the Makefile in the sources tree. Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Signed-off-by: Anup Patel <anup.patel@wdc.com>
2021-03-19firmware: Support position independent executionVincent Chen1-1/+1
Enable OpenSBI to support position independent execution. Because the position independent code will cause an additional GOT reference when accessing the global variables, it will reduce performance a bit. Therefore, the position independent execution is disabled by default. Users can through specifying "FW_PIC=y" on the make command to enable this feature. In theory, after enabling position-independent execution, the OpenSBI can run at arbitrary address with appropriate alignment. Therefore, the original relocation mechanism will be skipped. In other words, OpenSBI will directly run at the load address without any code movement. Signed-off-by: Vincent Chen <vincent.chen@sifive.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2020-11-02Makefile: Add option to use toolchain default ABI and ISA stringAnup Patel1-4/+14
When PLATFORM_RISCV_ABI and PLATFORM_RISCV_ISA are not specified, we force "-mabi=lp64 -march=rv64gc" for RV64 and force "-mabi=ilp32 -march=rv32gc" for RV32. This can prevent users from using the toolchain default "-mabi" and "-march" options. To allow using toolchain defaults, we add compile-time option PLATFORM_RISCV_TOOLCHAIN_DEFAULT which when enabled forces the top-level makefile to use toolchain default ABI and ISA string. To enable the option, pass "PLATFORM_RISCV_TOOLCHAIN_DEFAULT=1" to top-level make. Reported-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
2020-10-18Makefile: Allow padding zeros when converting DTB to C sourceHeinrich Schuchardt1-2/+5
We extend d2c.sh to allow padding zeros in output C source when converting DTB to C source. Using this feature, platforms can create extra room for in-place FDT fixups on built-in DTBs. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-10-18Makefile: Build ELF, BIN and LD script in platform build directoryAnup Patel1-9/+9
Currently, the make rules for ELF, BIN and LD script are little generic to allowing ELF, BIN and LD script to be anywhere in the build directory. For OpenSBI firmwares, the ELF, BIN, and LD script are always platform specific so we update make rules accordingly. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-10-10makefile: fix clean directiveDamien Le Moal1-0/+2
Add cleaning of compiled device tree files (.dtb files). Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2020-06-05firmware: Remove FW_PAYLOAD_FDT and related documentationAnup Patel1-2/+0
Now that no platform is using FW_PAYLOAD_FDT mechanism, we remove related code from Makefile and related documentation. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-06-05Makefile: Add mechanism for platforms to have multiple builtin DTBsAnup Patel1-0/+17
Currently, we can only include one DTB as builtin for a platform using FDT_PAYLOAD_DTB make variable in platform config.mk. This patch adds new mechanism using which we can convert any DTS file to C source and futher compile-n-link it with libplatsbi.a. The generated C source will have the DTB contents as an array "const char <varprefix>_start[]" where <varprefix> is specified in platform objects.mk makefile. Example1 -------- If we have built-in k210.dts and desired <varprefix> is "dt_k210" then specify following in platform objects.mk: platform-objs-y += k210.o platform-varprefix-k210.o = dt_k210 Example2 -------- If we have built-in abc/k210.dts and desired <varprefix> is "dt_abc_k210" then specify following in platform objects.mk: platform-objs-y += abc/k210.o platform-varprefix-abc-k210.o = dt_abc_k210 Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-06-05Makefile: Preprocess builtin DTSAnup Patel1-2/+2
In order to use GCC style defines and macros in DTS, we should preporcess builtin DTS before converting it to DTB. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-06-05Makefile: Fix builtin DTB compilation for out-of-tree platformsAnup Patel1-3/+3
The make rule for builtin DTB compilation does not consider out-of-tree platforms so this patch fixes it. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-03-13Makefile: Fix distclean make targetAnup Patel1-4/+5
The default install directory is not being removed correctly by distclean make target due to recent changes. This patch fixes distclean make target to fix default install directory removal. Fixes: 82ae8e8fe2a3 ("makefile: Do setup of the install target more flexible") Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-03-08makefile: Do setup of the install target more flexibleNikita Ermakov1-20/+47
- Add possibility to setup include, libs, firmware and docs paths. - Change the default installation paths for include, libs, firmware and docs to meet FHS [1]. [1] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html Signed-off-by: Nikita Ermakov <coffe92@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2020-02-06makefile: add support for building on macOSAlex Richardson1-3/+10
On macOS the readlink command does not include a -f flag. Instead default to using GNU readlink (which is often installed as greadlink). Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> Signed-off-by: Anup Patel <anup.patel@wdc.com>
2020-01-08build: Use -ffreestandingKhem Raj1-1/+1
this is a stand-alone/baremetal application, therefore demanding -ffreestanding would help it compile with hosted toolchains e.g. ( linux toolchains ), it also ensures that it won't be using platform optimizations like inlining mem* str* functions which gcc might decide especially with wrapper string functions in opensbi code Signed-off-by: Khem Raj <raj.khem@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2019-10-02Makefile: Minor fix in OPENSBI_VERSION_GITAnup Patel1-1/+1
Currently, if someone has forked OpenSBI repo quite sometime back and this fork is not having updated tags from upstream riscv/opensbi repo then "git describe" command can fail. To tackle this, we redirect error output of "git describe" to /dev/null. Signed-off-by: Anup Patel <anup.pate@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-08-19Include `git describe` in OpenSBIPalmer Dabbelt1-0/+4
OpenSBI includes a version, but that is only updated when tagged. For users that are using the git releases we instead end up with an ambiguous version number, which makes it hard to figure out what everyone is using. This patch checks for a git directory and prints out the result of `git describe`, which is a mix of pretty and unambiguous. Signed-off-by: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2019-06-29include: Add version info to struct sbi_platformAbner Chang1-2/+2
Add version control of sbi_platform structure - Add opensbi_version, this gives information of opensbi revision on which the sbi_platform table was created. - Add platform_version field in sbi_platform structure for platform level version control. Signed-off-by: Abner Chang <abner.chang@hpe.com> Acked-by: Anup Patel <anup.patel@wdc.com>
2019-06-19platform: Move platform common to lib/utils.Atish Patra1-10/+19
Currently, platform/common contains platform/non-platform specific common minimal drivers and libraries. This is helpful is all platforms are built within opensbi framework. Move them to lib/utils so that any external platform code also can reuse the minimalistic drivers or other common libraries. This patch doesn't introduce any functional changes. Signed-off-by: Atish Patra <atish.patra@wdc.com> Acked-by: Anup Patel <anup.patel@wdc.com>
2019-06-19lib: Move sbi core library to lib/sbiAtish Patra1-7/+7
Signed-off-by: Atish Patra <atish.patra@wdc.com> Acked-by: Anup Patel <anup.patel@wdc.com>
2019-04-30Makefile: explicitly disable PIEKarsten Merker1-0/+1
The various available RISC-V toolchains differ in their default configuration regarding PIE, e.g. the buildroot RISC-V toolchain has PIE disabled by default while the Debian toolchain has it enabled by default. OpenSBI currently doesn't support being built with PIE enabled, therefore disable it explicitly by passing "-fno-pie -no-pie" in CFLAGS. Signed-off-by: Karsten Merker <merker@debian.org> Acked-by: Anup Patel <anup.patel@wdc.com>
2019-04-09TOP: Allow building platform out-of-treeAnup Patel1-25/+49
This patch extends our current build-system for building platform sources which are not part of OpenSBI sources. For example: Let's say we have out-of-tree ABC platform sources. We place these sources under <XYZ>/ABC directory along with its config.mk and objects.mk. To build out-of-tree ABC platform from OpenSBI directory: $ make PLATFORM_DIR=<XYZ>/ABC OR $ make PLATFORM_DIR=<XYZ> PLATFORM=ABC To build out-of-tree ABC platform from <XYZ>/ABC directory: $ make PLATFORM_DIR=<XYZ>/ABC -C <path_to_opensbi> OR $ make PLATFORM_DIR=<XYZ> PLATFORM=ABC -C <path_to_opensbi> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-28Fix missing quotes in MakefileAndreas Schwab1-1/+1
2019-02-28Fix makefile dependency generationAndreas Schwab1-2/+2
2019-02-26Makefile: Set the platform variables before parsing the platformsAlistair Francis1-8/+10
Ensure the platform variable PLATFORM_RISCV_XLEN is set before we parse the platform files. This fixes the 32-bit openSBI FW_JUMP_ADDR. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-22Makefile: Rename compile_ld() to compile_elf()Anup Patel1-7/+7
The compile_ld() is actually used to create ELF files so the name is misleading hence this patch renames it to compile_elf(). We also rename LDFLAGS to ELFFLAGS because these will be used for ELF creation only. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-19Makefile: Use sed instead of awk to parse OpenSBI versionAnup Patel1-2/+2
This patch replaces use of awk with sed in top-level makefile to parse OpenSBI version from include/sbi/sbi_version.h. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-19Makefile: Fix error evaluating OPENSBI_CC_XLENAnup Patel1-25/+25
We get following error evaluating OPENSBI_CC_XLEN on Ubuntu-18.04: /bin/sh: 1: Bad substitution This patch fixes above error by using "awk" in string assigned to OPENSBI_CC_XLEN and it also moves "Setup compilation commands" before OPENSBI_CC_XLEN. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-17Makefile: Fix the assignment of OPENSBI_CC_XLENAlistair Francis1-3/+3
Previously OPENSBI_CC_XLEN was not being correctly assigned either 32 or 64. It also was not assigned before config.mk was parsed. Ensure that it will always be assigned. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>