# Copyright (C) 2023, Advanced Micro Devices, Inc.  All rights reserved.
#
# SPDX-License-Identifier: MIT
#

menu "DTG Settings"
config SUBSYSTEM_MACHINE_NAME
        string "MACHINE_NAME"
        default "template"
        help
	 Keep empty or specify auto/AUTO it will point to DTG machine name based on the
	 yocto machine name specified in config.
         This is machine name or board name. Ex: zcu102, zc702
         This is used to create board related nodes.
         Change this only when you also change the corresponding hardware design.
         Change of hardware design or Machine_name between same architecture is allowed

config SUBSYSTEM_DT_XSCT_WORKSPACE
	string "Device-tree workspace"
	help
	  Provide the location to use as Device-tree XSCT workspace location.

config SUBSYSTEM_DTB_PADDING_SIZE
	hex "DTB padding size"
	default 0x1000
	help
	  Set this value for DTB padding size

if SUBSYSTEM_DISTRO_PETALINUX
if SUBSYSTEM_AUTOCONFIG_DEVICE__TREE
config SUBSYSTEM_EXTRA_DT_FILES
	string "Extra dts/dtsi files"
	default ""
	help
	  Provide the extra dt files path separated with space.
	  This config should be set with dts/dtsi absolute/full path.
	  Provided dts/dtsi will be build as part of device-tree and deploy into /boot/devicetree.
	  NOTE: All dtsi files should be added to this config which are included in dts file.
	  Example: /extra-dt-path/can.dtsi /extra-dt-path/test.dtsi

menu "Kernel Bootargs"
config SUBSYSTEM_BOOTARGS_AUTO
	bool "generate boot args automatically"
	default y
	depends on !SUBSYSTEM_SERIAL_MANUAL_SELECT
	help
	  Generates the default bootargs.

config SUBSYSTEM_USER_CMDLINE
	string "user set kernel bootargs"
	default ""
	depends on !SUBSYSTEM_BOOTARGS_AUTO
	help
	  Specify any commandline arguments you wish to pass to the kernel
	  at boot.

config SUBSYSTEM_BOOTARGS_EARLYPRINTK
	bool "enable kernel earlyprintk"
	default y
	depends on SUBSYSTEM_BOOTARGS_AUTO
	help
	  Select this option to enable kernel earlyprintk.

config SUBSYSTEM_BOOTARGS_GENERATED
	string "Auto generated bootargs (NO EDIT!)"
	default ""
	depends on SUBSYSTEM_BOOTARGS_AUTO
	help
	  system auto generated bootargs.
	  WARNING: Do not edit, your changes will be lost.
	  Disable SUBSYSTEM_BOOTARGS_AUTO to edit bootargs through SUBSYSTEM_USER_CMDLINE option

config SUBSYSTEM_EXTRA_BOOTARGS
	string "Add extra boot args"
	default ""
	depends on SUBSYSTEM_BOOTARGS_AUTO
	help
	  Select this option to append extra bootargs

endmenu
endif
config SUBSYSTEM_DEVICETREE_COMPILER_FLAGS
	string "Devicetree compiler flags"
	default ""
	help
	  Mention device-tree compiler flags.
	  These will be passed to dtc while compiling device-trees.
	  Ex: -@

if !SUBSYSTEM_ARCH_MICROBLAZE
config SUBSYSTEM_DTB_OVERLAY
       bool "Devicetree overlay"
       default n
       help
         Select this option to separate pl from base dtb
         and build the pl.dtsi to generate pl.dtbo.

config SUBSYSTEM_REMOVE_PL_DTB
       bool "Remove PL from devicetree"
       default n
       help
	Remove PL nodes if user doesn't depend on the PL IPs and
	if any PL IP in DTG generates an error then user can
	simply enable this flag and DTG won't generate any PL nodes.

endif

if !SUBSYSTEM_ARCH_MICROBLAZE && !SUBSYSTEM_ARCH_ARM && !SUBSYSTEM_SDT_FLOW
config SUBSYSTEM_ENABLE_OPENAMP_DTSI
    bool "Enable openamp dtsi"
    default n
    help
     Enable this config to automatically add OpenAmp device tree nodes (openamp.dtsi)
     to the final system.dtb

endif

if !SUBSYSTEM_ARCH_MICROBLAZE && !SUBSYSTEM_ARCH_ARM
config SUBSYSTEM_ENABLE_XEN_HW_DTSI
	bool "Enable xen hardware dtsi"
	default n
	help
	 Enable this config to automatically add Xen hardware related
	 device tree nodes (xen.dtsi) to the final system.dtb

config SUBSYSTEM_ENABLE_XEN_QEMU_DTSI
	bool "Enable xen QEMU dtsi"
	default n
	help
	 Enable this config to automatically add Xen qemu related
	 device tree nodes (xen-qemu.dtsi) to the final system.dtb

endif

if !SUBSYSTEM_SDT_FLOW
config SUBSYSTEM_ENABLE_NO_ALIAS
	bool "Enable board specific aliases"
	default n
	help
	 Enable board specific aliases defined in DT machine file for different evluation boards.

config SUBSYSTEM_ENABLE_DTG_ALIAS
	bool "Enable aliases generated by DTG"
	default n
	help
	 Enable this option to get DTG generated aliases.
	 NOTE: This will not effect if ENABLE_NO_ALIAS selected So final DT will have board aliases.

config SUBSYSTEM_ENABLE_NO_LABELS
	bool "Disable labels For Partial DT files"
	default n
	depends on SUBSYSTEM_FPGA_MANAGER
	help
	 Enable this option to not generated the labels in partial dtbo files.
	 There will not be any Changes in base dtb or PL dtb or dtbo files.
	 User should take care of the nodes if any build failures.

config SUBSYSTEM_ENABLE_DT_VERBOSE
	bool "Enable dt verbose"
	default n
	help
	 Enable this option to get additional logs for device-tree.
	 These debug prints can be seen in log.do_configure which will be saved in device-tree workspace directory.

if !SUBSYSTEM_ENABLE_NO_ALIAS
config SUBSYSTEM_ADD_EEPROM_ALIAS
	bool "Enable eeprom alias"
	default n
	help
	 Enable this option to add eeprom in aliases node
	 E.g: nvmem0 = &eeprom

config SUBSYSTEM_ADD_RTC_ALIAS
	bool "Enable rtc alias"
	default n
	help
	 Enable this option to add rtc in alias node
	 E.g: rtc0 = &rtc
endif
endif
endif
endmenu

if !SUBSYSTEM_ARCH_MICROBLAZE
menu "FPGA Manager"
config SUBSYSTEM_FPGA_MANAGER
        bool "Fpga Manager"
        help
	 Select this option to provides an interface to the Linux for configuring the programmable logic(PL).

if SUBSYSTEM_FPGA_MANAGER && SUBSYSTEM_SDT_FLOW
choice
	prompt "PL Device-Tree Overlay Type"

config SUBSYSTEM_PL_DT_OVERLAY_FULL
	bool "full"

config SUBSYSTEM_PL_DT_OVERLAY_DFX
	bool "dfx"

endchoice
endif
endmenu
endif
