| ddd70f19 | 04-Nov-2024 |
Quentin Schulz <quentin.schulz@cherry.de> |
fix(rk3399): fix unquoted .incbin for clang
While GCC doesn't complain about anything for .incbin, clang does: """ <instantiation>:6:10: error: expected string in '.incbin' directive .incbin /build
fix(rk3399): fix unquoted .incbin for clang
While GCC doesn't complain about anything for .incbin, clang does: """ <instantiation>:6:10: error: expected string in '.incbin' directive .incbin /build/rk3399/release/m0/rk3399m0.bin ^ plat/rockchip/rk3399/drivers/pmu/pmu_fw.S:20:1: note: while in macro instantiation INCBIN """/build/rk3399/release/m0/rk3399m0.bin""", "rk3399m0_bin", ".sram.incbin" ^ <instantiation>:6:10: error: expected string in '.incbin' directive .incbin /build/rk3399/release/m0/rk3399m0pmu.bin ^ plat/rockchip/rk3399/drivers/pmu/pmu_fw.S:21:1: note: while in macro instantiation INCBIN """/build/rk3399/release/m0/rk3399m0pmu.bin""", "rk3399m0pmu_bin", ".pmusram.incbin" ^ """
Adding quotes around \file in .incbin fixes the clang issue but GCC now complains: """ plat/rockchip/rk3399/drivers/pmu/pmu_fw.S: Assembler messages: plat/rockchip/rk3399/drivers/pmu/pmu_fw.S:14: Error: junk at end of line, first unrecognized character is `/' plat/rockchip/rk3399/drivers/pmu/pmu_fw.S:20: Info: macro invoked from here plat/rockchip/rk3399/drivers/pmu/pmu_fw.S:14: Error: unable to include `./' plat/rockchip/rk3399/drivers/pmu/pmu_fw.S:20: Info: macro invoked from here plat/rockchip/rk3399/drivers/pmu/pmu_fw.S:14: Error: junk at end of line, first unrecognized character is `/' plat/rockchip/rk3399/drivers/pmu/pmu_fw.S:21: Info: macro invoked from here plat/rockchip/rk3399/drivers/pmu/pmu_fw.S:14: Error: unable to include `./' plat/rockchip/rk3399/drivers/pmu/pmu_fw.S:21: Info: macro invoked from here """
Considering that the symbol is defined with escaped quotes, it is probably safe to remove the double quotes around the INBCIN macro parameter, so let's do that to make both compilers happy.
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Change-Id: Id18b0341353ffc00e44e2d3c643ccdd05cc20c4f
show more ...
|
| 279cad8e | 04-Nov-2024 |
Chris Kay <chris.kay@arm.com> |
fix(rk3399): mark INCBIN-generated sections as SHF_ALLOC
When assembling with Clang, sections generated via the `INCBIN` macro are not assigned the `SHF_ALLOC` attribute, and the linker therefore do
fix(rk3399): mark INCBIN-generated sections as SHF_ALLOC
When assembling with Clang, sections generated via the `INCBIN` macro are not assigned the `SHF_ALLOC` attribute, and the linker therefore does not know to include them in the binary.
This change is simple: explicitly tell the assembler that the section should have the `SHF_ALLOC` attribute.
For reference: https://man7.org/linux/man-pages/man5/elf.5.html
> SHF_ALLOC > This section occupies memory during process execution. Some > control sections do not reside in the memory image of an object > file. This attribute is off for those sections.
Change-Id: I626162eae9030b5ffbd03af2be76f89a248af9ca Signed-off-by: Chris Kay <chris.kay@arm.com> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
show more ...
|
| e53fc040 | 31-Oct-2024 |
Quentin Schulz <quentin.schulz@cherry.de> |
build(rk3399): m0: Makefile: respect verbosity for linkerfile
All commands in the Makefile respect the verbosity except this one, so let's be consistent and respect it for that one as well.
Signed-
build(rk3399): m0: Makefile: respect verbosity for linkerfile
All commands in the Makefile respect the verbosity except this one, so let's be consistent and respect it for that one as well.
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Change-Id: I5d1af4ee321e29449b927509cfa5ece01765a99e
show more ...
|
| c0c908e1 | 31-Oct-2024 |
Quentin Schulz <quentin.schulz@cherry.de> |
build(rk3399): m0: fail linker and assembler on warnings
Match the top Makefile flags and fail on warnings for the linker (ld) and assembler (as).
Signed-off-by: Quentin Schulz <quentin.schulz@cher
build(rk3399): m0: fail linker and assembler on warnings
Match the top Makefile flags and fail on warnings for the linker (ld) and assembler (as).
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Change-Id: I53fbcbdbda109b1dfe39b390a41c1ef3fd7d3e04
show more ...
|
| 6feb164b | 31-Oct-2024 |
Quentin Schulz <quentin.schulz@cherry.de> |
build(rk3399): m0: remove redundant M0_CROSS_COMPILE
The included toolchain.mk uses M0_CROSS_COMPILE if present, or defaults to arm-none-eabi-, which is the value this variable holds in this Makefil
build(rk3399): m0: remove redundant M0_CROSS_COMPILE
The included toolchain.mk uses M0_CROSS_COMPILE if present, or defaults to arm-none-eabi-, which is the value this variable holds in this Makefile.
Let's remove it.
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Change-Id: Id805703cec0f118acdf4629e345924031b2c8c4b
show more ...
|
| 6fbec46a | 31-Oct-2024 |
Quentin Schulz <quentin.schulz@cherry.de> |
feat(build): rk3399: m0: add support for new binutils versions
c.f. 1f49db5f25cd ("feat(build): add support for new binutils versions") for the actual reasons. This commit applies the same logic but
feat(build): rk3399: m0: add support for new binutils versions
c.f. 1f49db5f25cd ("feat(build): add support for new binutils versions") for the actual reasons. This commit applies the same logic but for the m0 FW for RK3399 since it uses a different set of flags.
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Change-Id: I955b229a7d9d473892f3f3483eaf6e33ffe0e273
show more ...
|
| 5049f910 | 31-Oct-2024 |
Quentin Schulz <quentin.schulz@cherry.de> |
fix(rk3399): m0: Makefile: fix outside array bounds warning
Both GCC and clang actually complain about:
""" In file included from src/dram.c:12: src/dram.c: In function 'm0_main': include/rk3399_mc
fix(rk3399): m0: Makefile: fix outside array bounds warning
Both GCC and clang actually complain about:
""" In file included from src/dram.c:12: src/dram.c: In function 'm0_main': include/rk3399_mcu.h:15:34: warning: array subscript 0 is outside array bounds of 'volatile unsigned int[0]' [-Warray-bounds=] 15 | (*(volatile unsigned int *)(c)); __v; }) | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/rk3399_mcu.h:16:69: note: in definition of macro 'mmio_write_32' 16 | #define mmio_write_32(c, v) ((*(volatile unsigned int *)(c)) = (v)) | ^ src/dram.c:67:23: note: in expansion of macro 'mmio_read_32' 67 | mmio_read_32(PARAM_ADDR + PARAM_FREQ_SELECT)); | ^~~~~~~~~~~~ cc1: note: source object is likely at address zero In function 'ddr_set_pll', inlined from 'm0_main' at src/dram.c:71:2: include/rk3399_mcu.h:14:40: warning: array subscript 0 is outside array bounds of 'volatile unsigned int[0]' [-Warray-bounds=] 14 | #define mmio_read_32(c) ({unsigned int __v = \ | ^~~ include/rk3399_mcu.h:16:69: note: in definition of macro 'mmio_write_32' 16 | #define mmio_write_32(c, v) ((*(volatile unsigned int *)(c)) = (v)) | ^ src/dram.c:47:23: note: in expansion of macro 'mmio_read_32' 47 | mmio_read_32(PARAM_ADDR + PARAM_DPLL_CON0)); | ^~~~~~~~~~~~ In function 'm0_main': cc1: note: source object is likely at address zero In function 'ddr_set_pll', inlined from 'm0_main' at src/dram.c:71:2: include/rk3399_mcu.h:14:40: warning: array subscript 0 is outside array bounds of 'volatile unsigned int[0]' [-Warray-bounds=] 14 | #define mmio_read_32(c) ({unsigned int __v = \ | ^~~ include/rk3399_mcu.h:16:69: note: in definition of macro 'mmio_write_32' 16 | #define mmio_write_32(c, v) ((*(volatile unsigned int *)(c)) = (v)) | ^ src/dram.c:49:23: note: in expansion of macro 'mmio_read_32' 49 | mmio_read_32(PARAM_ADDR + PARAM_DPLL_CON1)); | ^~~~~~~~~~~~ In function 'm0_main': cc1: note: source object is likely at address zero include/rk3399_mcu.h:16:35: warning: array subscript 0 is outside array bounds of 'volatile unsigned int[0]' [-Warray-bounds=] 16 | #define mmio_write_32(c, v) ((*(volatile unsigned int *)(c)) = (v)) | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dram.c:80:9: note: in expansion of macro 'mmio_write_32' 80 | mmio_write_32(PARAM_ADDR + PARAM_M0_DONE, M0_DONE_FLAG); | ^~~~~~~~~~~~~ cc1: note: source object is likely at address zero """
The global Makefile defines --param=min-pagesize=0 already, so let's just apply the same fix for the m0 part of the RK3399 binary.
Suggested-by: Boyan Karatotev <boyan.karatotev@arm.com> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Change-Id: I4f29a579b9e4b01aa2540746ef46e2a382f0012e
show more ...
|
| efe45dd5 | 31-Oct-2024 |
Quentin Schulz <quentin.schulz@cherry.de> |
refactor(rk3399): m0: Makefile: use same tools as in build_macros.mk
This should make it easier to spot mistakes or reuse rules by comparing this Makefile with build_macros.mk.
Additionally, this a
refactor(rk3399): m0: Makefile: use same tools as in build_macros.mk
This should make it easier to spot mistakes or reuse rules by comparing this Makefile with build_macros.mk.
Additionally, this allows to provide flags that aren't supported by CC (e.g. --no-warn-rwx-segments).
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Change-Id: Iba121d53959ff4f8bd10a14280c4d93a710dc9db
show more ...
|
| 87577afe | 31-Oct-2024 |
Quentin Schulz <quentin.schulz@cherry.de> |
refactor(rk3399): m0: Makefile: specify ARCH to be rk3399-m0
cortex-m0 is not a recognized ARCH in our build system so most macros need to be redefined to use hardcoded strings which isn't ideal.
W
refactor(rk3399): m0: Makefile: specify ARCH to be rk3399-m0
cortex-m0 is not a recognized ARCH in our build system so most macros need to be redefined to use hardcoded strings which isn't ideal.
While this now has limited use-case, a future commit will allow to make use of this fixed variable via macros.
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Change-Id: I6d1e588d2ab27d7a60f32e5369370c43d68b3a20
show more ...
|
| f8793888 | 28-Oct-2024 |
Quentin Schulz <quentin.schulz@cherry.de> |
fix(rk3588): pmu: fix assembly symbol redefinition
Somehow cpus_pd_req_enter_wfi() gets called multiple times and clang isn't happy about redefining the same label multiple times (it is an inline fu
fix(rk3588): pmu: fix assembly symbol redefinition
Somehow cpus_pd_req_enter_wfi() gets called multiple times and clang isn't happy about redefining the same label multiple times (it is an inline function).
An option could be to force the code to not be inlined (with __attribute__((noinline))) as removing the explicit inline still made the compiler inline the code.
This is not an issue on GCC because the compiler doesn't respect the inline request[1]. If the function is forced inlined with inline __attribute__((__always_inline__)), the same build issue as found on clang happens for GCC.
Use a local label[2] instead and make the branch instruction use the latest previously defined local label instead, so that clang is happy and the code is consistent with other assembly instructions in this file which all use local labels.
This gets rid of the following build error on clang: plat/rockchip/rk3588/drivers/pmu/pmu.c:763:7: error: symbol 'wfi_loop' is already defined 763 | "wfi_loop:\n" | ^ <inline asm>:5:1: note: instantiated into assembly here 5 | wfi_loop: | ^
[1] https://www.kernel.org/doc/local/inline.html [2] https://sourceware.org/binutils/docs/as/Symbol-Names.html Local Labels section Suggested-by: Boyan Karatotev <boyan.karatotev@arm.com> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Change-Id: Ie9f55135b2f95a78deb7cbb94f9a62d3ba61e808
show more ...
|