##################################################################
# File Descriptor : CMakeLists at root directory
# Author : Lucien Yin
# History :
#          2020-03-18 Create
# Copyright : 2020 Unisoc, Incoporated. All Rights Reserved.
##################################################################
mainmenu "Unisoc SP Subsystem Build Configure"
    menu "CPU Config"
        choice CPU_ARCH
            prompt "CP CPU Arch Select"
            default CPU_ARCH_ARMV7M
            help
                This option sets ARM CPU type.

            config CPU_ARCH_ARMV7M
                bool "ARM Arch V7M"
            config CPU_ARCH_ARMV8
                bool "ARM Arch V8"
            config CPU_ARCH_ARMV8M
                bool "ARM Arch V8M"
        endchoice

        choice CPU_TYPE
            prompt "ARM CPU Select"
            default CPU_TYPE_CM4F
            help
                This option sets ARM CPU type.

            config CPU_TYPE_CM4F
                bool "ARM Cortex-M4F"
        endchoice

        config FPU_ENABLE
            bool "FPU_ENABLE"
            default y
            help
                FPU_ENABLE

        choice FPU_TYPE
            prompt "FPU TYPE Select"
            default FPU_TYPE_VFPV4SP
            depends on FPU_ENABLE
            help
                floating point operation type.

            config FPU_TYPE_NONE
                bool "This core is not intergrate fpu"
            config FPU_TYPE_SOFTVFP
                bool "This core intergrate soft fpu"
            config FPU_TYPE_VFPV2
                bool "This core intergrate fpu_v2"
            config FPU_TYPE_VFPV2
                bool "This core intergrate fpu_v2"
            config FPU_TYPE_VFPV3
                bool "This core intergrate fpu_v3"
            config FPU_TYPE_VFPV4
                bool "This core intergrate fpu_v4"
            config FPU_TYPE_VFPV4SP
                bool "This core intergrate fpu_v4sp"
        endchoice

        choice CHIP_ENDIAN
            prompt "Chip Endianess Select"
            default CHIP_ENDIAN_LITTLE
            help
                mcu endianess  Select.

            config CHIP_ENDIAN_LITTLE
                bool "Chip Endianess Select little"
            config CHIP_ENDIAN_BIG
                bool "Chip Endianess Select big"
        endchoice
    endmenu #CPU Configuration

    menu "Project Config"
        config PRODUCT_CONFIG
            string "project name"
            default "pmsys_sharkl5pro"
            help
                project name

        choice PLATFORM
            prompt "PLATFORM Select"
            default PLATFORM_PM
            help
                PLATFORM.

            config PLATFORM_PM
                bool "PLATFORM"
        endchoice

        choice CHIP_VER
            prompt "Unisoc CHIP Select"
            default CHIP_VER_SHARKL5PRO
            help
                Select unisoc chip.

            config CHIP_VER_SHARKLE
                bool "UNISOC Chip sharle(sc9832*)"
            config CHIP_VER_SHARKL3
                bool "UNISOC Chip sharl3(sc9832*)"
            config CHIP_VER_SHARKL5
                bool "UNISOC Chip sharl5(UMS312)"
            config CHIP_VER_SHARKL5PRO
                bool "UNISOC Chip sharl5pro(UMS512)"
             config CHIP_VER_ROC1
                bool "UNISOC Chip ROC1(UD710)"
            config CHIP_VER_QogirL6
                bool "UNISOC Chip qogirl6(UMS9230)"
            config CHIP_VER_QogirN6PRO
                bool "UNISOC Chip qogirn6pro(UMS9620)"
            config CHIP_VER_QogirN6Lite
                bool "UNISOC Chip qogirn6lite(UMS9621)"
        endchoice

        config SOC_ID
            string "soc id"
            default "shark"
            help
                unique soc id string

        config TARGET_SOC_QogirN6Pro
            bool "TARGET SOC QogirN6Pro"
            depends on CHIP_VER_QogirN6PRO
            default n
            help
                TARGET SOC QogirN6Pro

        config SUBSYS_CONFIG_CH
            bool "support ch subsys"
            default n
            help
                support ch subsys

        config FPGA_SUPPORT
            bool "FPGA_SUPPORT"
            default n
            help
                FPGA_SUPPORT

        config FPGA_VERIFICATION
            bool "FPGA_VERIFICATION"
            default n
            help
                FPGA_VERIFICATION

        config NEW_MEMORY_MM
            bool "new memory management"
            default y
            help
                new memory management

    endmenu #Project Config

    menu "Debug Option"
        config MEMORY_DEBUG_SUPPORT
            bool "MEMORY DEBUG SUPPORT"
            default n
            help
                MEMORY DEBUG SUPPORT

        config TRACE_INFO_SUPPORT
            bool "TRACE INFO SUPPORT"
            default n
            help
                TRACE INFO SUPPORT

        choice TRACE_TYPE
            prompt "TRACE_TYPE"
            default TRACE_TYPE_CLASSIC
            help
                floating point operation type.

            config TRACE_TYPE_CLASSIC
                bool "TRACE_TYPE_CLASSIC"
            config TRACE_TYPE_ID
                bool "TRACE_TYPE_ID"
        endchoice

        config STACK_CHECK_SUPPORT
            bool "STACK_CHECK_SUPPORT"
            default n
            help
                STACK_CHECK_SUPPORT

        config JTAG_SUPPORT
            bool "JTAG Debug support"
            default y
            help
                JTAG Debug support

        choice ASSERT_TYPE_SUPPORT
            prompt "ASSERT_TYPE_SUPPORT"
            default ASSERT_TYPE_SUPPORT_ASSERT
            help
                ASSERT_TYPE_SUPPORT.

            config ASSERT_TYPE_SUPPORT_ASSERT
                bool "ASSERT_TYPE_SUPPORT_ASSERT"
            config ASSERT_TYPE_SUPPORT_WARNING
                bool "ASSERT_TYPE_SUPPORT_WARNING"
        endchoice

        config ANALOG_SC2730
            bool "ANALOG_SC2730"
            default y
            help
                ANALOG_SC2730

        config MOCONF_RTOS_DEEP_SLEEP_NO_SIO_CHECK
                bool "MOCONF_RTOS_DEEP_SLEEP_NO_SIO_CHECK"
                default n
                help
                    MOCONF_RTOS_DEEP_SLEEP_NO_SIO_CHECK
        config MOCONF_RTOS_DUMP_MEM
                bool "support DUMP Memory or Not"
                default n
                help
                    TRUE:  support DUMP Memory
                    FALSE: not support DUMP Memory
        config PM_SAVE_ASSERT_INFO
                bool "save assert reg and info or Not"
                default y
                help
                    TRUE:  save assert reg and info
                    FALSE: not save assert reg and info
        config PM_ASSERT_NO_DEBUG
                bool "save assert reg and info or Not"
                default n
                help
                    TRUE:  No assert debug info (not enough iram can open it)
                    FALSE:
        config PM_SPRD_UART_LOG
                bool "PM_SPRD_UART_LOG"
                default n
                help
                    if open it the arm7 log will by uart, but you must config the uart pinmap
        config PM_SPRD_SIPC_LOG
                bool "enable cm4 log to ap"
                default y
                help
                    if open it the arm7 log will send to AP by sipc
        config T32_SIMULATOR
                bool "T32_SIMULATOR"
                default n
                help
                    just add it for run axf in t32 simulator
         config ANALOG_UMP9620
                bool "ANALOG_UMP9620"
                default n
                help
                    support ump9620 analog
        config ANALOG_UMP9621
                bool "ANALOG_UMP9621"
                default n
                help
                    support ump9621 analog
        config ANALOG_UMP9622
                bool "ANALOG_UMP9622"
                default n
                help
                    support ump9622 analog
        config SENSORHUB_LOG_BUFFER
                bool "SENSORHUB_LOG_BUFFER"
                default n
                help
                    support sensorhub log buffer batch
    endmenu #Debug Option

    menu "Build Config"
        choice COMPILER
            prompt "Compiler Select"
            default COMPILER_CLANG
            help
                Compiler Type Select.

            config COMPILER_GCC
                bool "Select GNU GCC as Compiler"
            config COMPILER_CLANG
                bool "Select CLANG LLVM as Compiler"
        endchoice

        choice C_LIB
            prompt "C library type Select"
            default C_LIB_NEWLIB
            help
                C library type Select.

            config C_LIB_MICROLIB
                bool "C library type MICROLIB"
            config C_LIB_STD
                bool "C library type STANDARDLIB"
            config C_LIB_NEWLIB
                bool "C library type NEWLIB"
        endchoice

        choice STD
            prompt "Determine the language standard"
            default STD_GNU99
            help
                Determine the language standard.

            config STD_C90
                bool "Language standard C90"
            config STD_C99
                bool "Language standard C99"
             config STD_GNU90
                bool "Language standard GUN90"
            config STD_GNU99
                bool "Language standard GNU99"

        endchoice


        config LTO_ENABLE
            bool "Enable LTO or Not"
            default n
            help
                This option sets compiler optimization -flto options.

        config CUSTOMER_RELEASE_ENABLE
            bool "Customer Version Enable"
            default n
            help
                Specify release customize version or not. When release customer
                version, some sprdeadtrum source code can not open, release with
                static library.

        config CPP_FEATURE_ENABLE
            bool "Enable CPP Feature or Not"
            default n
            help
                This option sets CPP feature.

        config RELEASE_INFO
            bool "RELEASE_INFO"
            default n
            help
                This option sets compiler optimization level (gcc -O argument).

        config SPRD_CUSTOMER
            bool "SPRD_CUSTOMER"
            default n
            help
                SPRD_CUSTOMER

        config PC_LINT
            bool "Product PC-Lint Target or not"
            default n
            help
                Product PC-Lint Script or Not!

        choice OPTIMIZATION_LEVEL
            prompt "Optimization Level Select"
            default OPTIMIZATION_LEVEL_Os
            help
                Select Compile Optimization Level.

            config OPTIMIZATION_LEVEL_O0
                bool "Select Compile Optimization Level-0."
            config OPTIMIZATION_LEVEL_O1
                bool "Select Compile Optimization Level-1."
            config OPTIMIZATION_LEVEL_O2
                bool "Select Compile Optimization Level-2."
            config OPTIMIZATION_LEVEL_Os
                bool "Select Compile Optimization Level-s."
            config OPTIMIZATION_LEVEL_O3
                bool "Select Compile Optimization Level-3."

        endchoice
    endmenu # Compile Options

    menu "Fusion Location Config"
        config SP_GNSS_ENABLE
            bool "Enable GNSS Code on CM4"
            default n
            help
                Enable GNSS Code on CM4

        config SENSORHUB_ENABLE
            bool "sensorhub algo support"
            default n
            help
                sensorhub algo support

        config NAVCORE_ENABLE
            bool "navcore support"
            depends on SP_GNSS_ENABLE
            default n
            help
                navcore support

        config ENABLE_PVT
            bool "pvt support"
            depends on SP_GNSS_ENABLE
            default n
            help
                pvt support

        config VDR_ENABLE
            bool "VDR support"
            depends on SP_GNSS_ENABLE
            default n
            help
                VDR support

        config LPGPS_ENABLE
            bool "low power gps support"
            depends on SP_GNSS_ENABLE
            default n
            help
                low power gps support

        config AIDGPS_ENABLE
            bool "aiding gps support"
            depends on SP_GNSS_ENABLE
            default n
            help
                aiding gps support

        config UNI_BDS_DEF
            bool "gnss debug support"
            depends on SP_GNSS_ENABLE
            default n
            help
                gnss debug support

        config SUPPORT_M3L
            bool "marlin3lite support"
            depends on SP_GNSS_ENABLE
            default n
            help
                marlin3lite support

    endmenu  # GNSS Module Configurations

    menu "rtos config"
    menu "threadx kernel config"

    choice THREADX_VERSION
        prompt "THREADX_VERSION Select"
        default THREADX_VERSION_V56
        help
            This option sets ARM CPU type.

        config THREADX_VERSION_V56
            bool "THREADX_VERSION IS V56"
        config THREADX_VERSION_V30
            bool "THREADX_VERSION IS V56"
    endchoice
    config MOCONF_RTOS_MIPS_SUPPORT
        bool "MOCONF_RTOS_MIPS_SUPPORT"
        default y
        help
            FALSE: don't support MIPS statistics
            TRUE: support MIPS statistics

    config MOCONF_RTOS_NO_SEMAPHORE
        bool "MOCONF_RTOS_NO_SEMAPHORE"
        default n
        help
            TRUE: don't support semaphore
            FALSE: support semaphore
    config MOCONF_RTOS_NO_MUTEX
        bool "MOCONF_RTOS_NO_MUTEX"
        default n
        help
            TRUE: don't support mutex
            FALSE: support mutex
    config MOCONF_RTOS_NO_QUEUE
        bool "MOCONF_RTOS_NO_QUEUE"
        default n
        help
            TRUE: don't support queue
            FALSE: support queue
    config MOCONF_RTOS_NO_EVENT_FLAGS
        bool "MOCONF_RTOS_NO_EVENT_FLAGS"
        default n
        help
            TRUE: don't support event flags
            FALSE: support event flags
    config MOCONF_RTOS_NO_BLOCK_POOL
        bool "MOCONF_RTOS_NO_BLOCK_POOL"
        default n
        help
            TRUE: don't support block pool
            FALSE: support block pool
    config MOCONF_RTOS_NO_BYTE_POOL
        bool "MOCONF_RTOS_NO_BYTE_POOL"
        default n
        help
            TRUE: don't support byte pool
            FALSE: support byte pool
    config MOCONF_RTOS_NO_OSA
        bool "MOCONF_RTOS_NO_OSA"
        default y
        help
            TRUE: OSA is not needed

    config MOCONF_RTOS_MM
        bool "MOCONF_RTOS_MM"
        default y
        help
            TRUE: support Memory management

    config MOCONF_RTOS_NO_TIMER
        bool "MOCONF_RTOS_NO_TIMER"
        default n
        help
            TRUE: don't support timer

    config SPRD_SIMPLE_HEAP
        bool "SPRD_SIMPLE_HEAP"
        default n
        help
            TRUE: support simple memory malloc

    config PRINT_SYS_PC_SUPPORT
        bool "PRINT_SYS_PC_SUPPORT"
        default n
        help
            TRUE: support print sys

    config TX_ASSERT_DEBUG
            bool "TX_ASSERT_DEBUG"
            default n
            help
                todo

    config TX_CHECK_STACK
            bool "TX_CHECK_STACK"
            default n
            help
                todo

    config MOCONF_RTOS_MAX_PRI
            hex "MOCONF_RTOS_MAX_PRI"
            default 0
            help
                Max number of task priorities. (256 by default)

    config SPRD_MINIMUM_CODE_SIZE
        bool "define sprd mininum code size"
        default n
        help
            Define sprd mininum code size

    config MAX_TX_THREAD_CLASS_NUM
            hex "MAX_TX_THREAD_CLASS_NUM"
            default 0
            help
                Max number of thread class. (8 by default)
     endmenu  # CP Module configurations

    menu "arm core's peripherial config"
    config INT_BOTTOM_HALF_SUPPORT
        bool "interrupt bottom half support"
        default n
        help
            Option1:FALSE, don't support bottom half
            Option2:TRUE, support bottom half

    config MPU_ENABLE
        bool "MPU_ENABLE"
        default n
        help
            MPU_ENABLE

    config MPU_V8_ARCH
        bool "MPU_V8_ARCH"
        default n
        depends on MPU_ENABLE
        help
            MPU_V8_ARCH

    config MPU_NO_NEED_AUTO_ADJUST
        bool "MPU_NO_NEED_AUTO_ADJUST"
        default y
        depends on MPU_ENABLE
        help
            Option1:TRUE,  don't auto adjust mpu region according code size and data size
            Option2:FALSE, auto adjust mpu region according code size and data size

    config EXTEND_NVIC_ENABLE
        bool "EXTEND_NVIC_ENABLE"
        default y
        help
            TRUE:support
            FALSE:not support

    config NANDBOOT_SUPPORT
        bool "NANDBOOT_SUPPORT"
        default n
        help
            TRUE:support
            FALSE:not support
    endmenu  # CP Module configurations
    endmenu

    menu "sensorhub config"
        config SPRD_SENSOR_HUB_SUPPORT
            bool "PMSYS SPRD_SENSOR_HUB_SUPPORT"
            default y
            help
                Option1:TRUE
                Option1:FALSE

        choice SENSOR_HUB_CODE_SELECT
            prompt "sensorhub code Select"
            depends on SPRD_SENSOR_HUB_SUPPORT
            help
                Select sensorhub source code.
            config SENSOR_HUB_CODE_SELECT_SENSOR_HUB_SPRD
                bool "SENSOR_HUB_CODE_SELECT_SENSOR_HUB_SPRD"
            config SENSOR_HUB_CODE_SELECT_SENSOR_HUB_SPRD_WATCH
                bool "SENSOR_HUB_CODE_SELECT_SENSOR_HUB_SPRD_WATCH"
            endchoice

        if SENSOR_HUB_CODE_SELECT_SENSOR_HUB_SPRD
            source "sensor_hub_sprd/public/Kconfig"
        endif
        if SENSOR_HUB_CODE_SELECT_SENSOR_HUB_SPRD_WATCH
            source "sensor_hub_sprd_watch/public/Kconfig"
        endif

        config SENSOR_HUB_IRQ_SUPPORT
            bool "PMSYS SENSOR_HUB_IRQ_SUPPORT"
            depends on SPRD_SENSOR_HUB_SUPPORT
            default n
            help
                Option1:TRUE
                Option1:FALSE
    endmenu  # sensorhub configurations

menu "chip_driver_common"
    config CM4_GNSS_CACHE_R3P0_RECFG_ENABLE
        bool "CM4_GNSS_CACHE_R3P0_RECFG_ENABLE"
        default n if SP_GNSS_ENABLE
        depends on SP_GNSS_ENABLE
        help
            Option1:
            TRUE  Reconfig gnss ddr cache RO/RW region at the phase of init
            Option2:
            FALSE  don't Reconfig gnss ddr cache RO/RW region at the phase of init

    config PM_SLEEP_REMOVE
        bool "remove pm sleep"
        default y
        help
            remove pm sleep , the relase version can't open ot

    config SPRD_MAILBOX_SP
        bool "support sp mailbox"
        default y
        help
            support sp mailbox

    config MAILBOX_SUPPORT
        bool "MAILBOX_SUPPORT"
        default y if SPRD_MAILBOX_SP
        help
            MAILBOX_SUPPORT

    config MOCONF_REF_TEST
        bool "MOCONF_REF_TEST"
        default n
        help
            TRUE: Turn on the test program. The test program will test various
            periperals and functions including timer, UART and message queue.

    config MOCONF_POWER_DEBUG
        bool "turn on power debugging function"
        default y
        help
            TRUE: turn on power debugging function

    config PM_SPRD_UART
        bool "PM_SPRD_UART"
        default y if PM_SPRD_UART_LOG || MOCONF_CONSOLE_DEBUG || MOCONF_POWER_DEBUG
        help
            PM_SPRD_UART

    config MOCONF_CHIP_DRV_I2C
        bool "MOCONF_CHIP_DRV_I2C"
        default n
        help
            MOCONF_CHIP_DRV_I2C

    config SIO_ZERO_COPY
        bool "SIO_ZERO_COPY"
        help
            SIO_ZERO_COPY

    config DMC_RETENTION
        bool "DMC_RETENTION"
        help
            DMC_RETENTION

    config DFS_SUPPORT
        bool "support ddr dfs driver"
        default y
        help
            TRUE: support ddr dfs driver

    config AUTO_DFS
        bool "support auto ddr dfs"
        default y
        help
            support auto ddr dfs

    config DDR_REINI
        bool "support ddr reinit"
        default y
        help
            support ddr reinit

    config MOCONF_WDT_CTRL
        bool "Enable the wathcdog function"
        default y
        help
            TRUE: Turn on the wathcdog function
            OFF: Turn off the wathcdog function

    config FIREWALL_SUPPORT
        bool "Enable the firewall function"
        default y
        help
            TRUE: Turn on the firewall function
            OFF: Turn off the firewall function

    config SPRD_SPI_SUPPORT
        bool "SPRD_SPI_SUPPORT"
        default n
        help
            TRUE:support
            FALSE:not support

	config SPRD_APB_PROT
		bool "SPRD APB PROT Config"
		default n
		help
			TRUE:support
			FALSE:not support
endmenu  # chip_driver_common

    if SUBSYS_CONFIG_CH
    source "chip_drv_ch/Kconfig"
    endif

    if !SUBSYS_CONFIG_CH
    source "chip_drv_pm/Kconfig"
    endif

    source "project/Kconfig"
    source "ms_customize/Kconfig"
    source "ms_ref/Kconfig"
    source "common/Kconfig"
    source "version/Kconfig"

