Skip to content
Merged
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
61 changes: 7 additions & 54 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -127,39 +127,9 @@ config XT_INTERRUPT_LEVEL_5

rsource "src/Kconfig"

choice
prompt "Optimization"
default OPTIMIZE_FOR_PERFORMANCE
help
Controls how compiler should optimize binary.
This config should affect only compiler settings and is
not meant to be used for conditional compilation of code.

config OPTIMIZE_FOR_PERFORMANCE
bool "Optimize for performance"
help
Apply compiler optimizations prioritizing performance.
It means -O2 for GCC or equivalent for other compilers.

config OPTIMIZE_FOR_SIZE
bool "Optimize for size"
help
Apply compiler optimizations prioritizing binary size.
It means -Os for GCC or equivalent for other compilers.

config OPTIMIZE_FOR_DEBUG
bool "Optimize for debug"
help
Apply compiler optimizations prioritizing debugging experience.
It means -Og for GCC or equivalent for other compilers.

config OPTIMIZE_FOR_NONE
bool "Don't optimize"
help
Apply no compiler optimizations.
It means -O0 for GCC or equivalent for other compilers.

endchoice
if !ZEPHYR_SOF_MODULE
rsource "Kconfig.xtos-build"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fetched and tested this and it works but I don't understand how, can you add a comment explaining why git grep ZEPHYR_SOF_MODULES => nothing?

BTW https://docs.zephyrproject.org/latest/guides/kconfig/tips.html#lack-of-conditional-includes

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a few, auto-generated ZEPHYR_SOF_ variables but not this one at https://docs.zephyrproject.org/latest/guides/modules.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marc-hb Working on a reply. I just observed this is defined in my build .config and used it (and it works). But let me dig into where it's actually defined.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marc-hb Zephyr's build system adds this for each module. Code in here: zephyr/scripts/kconfig/kconfiglib.py
During build, e.g. ./zephyrproject/build-icl/Kconfig/Kconfig.modules is created, containing definition for CONFIG_ZEPHYR_SOF_MODULE.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @kv2019i can you please add a reference to zephyr/modules/Kconfig in a comment? I think this is not a documented feature so it deserves at least that pointer.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @kv2019i can you please add a reference to zephyr/modules/Kconfig in a comment?

Submitted in #4327

endif

menu "Debug"

Expand All @@ -175,12 +145,6 @@ config GDB_DEBUG
help
Select for GDB debugging

config DEBUG_HEAP
bool "Heap debug"
default n
help
Select for enable heap alloc debugging

config DEBUG_MEMORY_USAGE_SCAN
bool "Memory usage scan"
default y
Expand All @@ -189,15 +153,6 @@ config DEBUG_MEMORY_USAGE_SCAN
This feature does not affect standard memory operations,
especially allocation and deallocation.

config DEBUG_BLOCK_FREE
bool "Blocks freeing debug"
default n
help
It enables checking if free was called multiple times on
already freed block of memory. Enabling this feature increases
number of memory writes and reads, due to checks for memory patterns
that may be performed on allocation and deallocation.

config DEBUG_LOCKS
bool "Spinlock debug"
default n
Expand All @@ -214,12 +169,6 @@ config DEBUG_LOCKS_VERBOSE
In addition to DEBUG_LOCKS it also adds spinlock traces
every time the lock is acquired.

config BUILD_VM_ROM
bool "Build VM ROM"
default n
help
Select if you want to build VM ROM

config DEBUG_IPC_COUNTERS
bool "IPC counters"
depends on CAVS
Expand Down Expand Up @@ -248,4 +197,8 @@ config DSP_RESIDENCY_COUNTERS
R0, R1, R2 are abstract states which can be used differently
based on platform implementation.

if !ZEPHYR_SOF_MODULE
rsource "Kconfig.xtos-dbg"
endif

endmenu
43 changes: 43 additions & 0 deletions Kconfig.xtos-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SPDX-License-Identifier: BSD-3-Clause

comment "XTOS options / compiler"

choice
prompt "Optimization"
default OPTIMIZE_FOR_PERFORMANCE
help
Controls how compiler should optimize binary.
This config should affect only compiler settings and is
not meant to be used for conditional compilation of code.

config OPTIMIZE_FOR_PERFORMANCE
bool "Optimize for performance"
help
Apply compiler optimizations prioritizing performance.
It means -O2 for GCC or equivalent for other compilers.

config OPTIMIZE_FOR_SIZE
bool "Optimize for size"
help
Apply compiler optimizations prioritizing binary size.
It means -Os for GCC or equivalent for other compilers.

config OPTIMIZE_FOR_DEBUG
bool "Optimize for debug"
help
Apply compiler optimizations prioritizing debugging experience.
It means -Og for GCC or equivalent for other compilers.

config OPTIMIZE_FOR_NONE
bool "Don't optimize"
help
Apply no compiler optimizations.
It means -O0 for GCC or equivalent for other compilers.

endchoice

config BUILD_VM_ROM
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is needed for Zephyr as it's a ROM stub that jumps to SOF bootloader code in qemu. Unless Zephyr has this jump built in when building a qemu target ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgirdwood I was wondering the same, but this is not used in any of the Zephyr builds and the implementation is in xtensa specific XTOS code, so I moved this out. But let me check. @andyross and @lyakh -- is this used in in Zephyr (to boot in Qemu) via some other way I don't see.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC to run Zephyr-generated SOF in Qemu I was using VMROM, built separately by a native SOF build. But this was a few months ago so I might be wrong

bool "Build VM ROM"
default n
help
Select if you want to build VM ROM
14 changes: 14 additions & 0 deletions Kconfig.xtos-dbg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
config DEBUG_HEAP
bool "Heap debug"
default n
help
Select for enable heap alloc debugging

config DEBUG_BLOCK_FREE
bool "Blocks freeing debug"
default n
help
It enables checking if free was called multiple times on
already freed block of memory. Enabling this feature increases
number of memory writes and reads, due to checks for memory patterns
that may be performed on allocation and deallocation.