#
# Snapshot Boot related configurations
#

menuconfig SNSC_SSBOOT
	bool "Snapshot Boot support"
	depends on !HIBERNATION
	depends on SUSPEND
	depends on SNSC
	depends on X86_64 || ARM || ARM64
	depends on SWAP
	default n
	help
	  Enables Snapshot Boot support.

if SNSC_SSBOOT

config SNSC_SSBOOT_DEBUG
	bool "Snapshot Boot debugging support"
	default n
	help
	  Displays detailed debug information when a snapshot image is
	  generated.

config SNSC_SSBOOT_DEBUG_SECTION
	bool "Show section information"
	depends on SNSC_SSBOOT_DEBUG
	default n
	help
	  Displays a table of information about the sections which will be
	  written into the image file.

config SNSC_SSBOOT_PAGE_STAT
	bool "Show page statistics information"
	default y
	help
	  Displays the count and total size of various types of pages
	  included in the image when it is generated.

config SNSC_SSBOOT_NO_KERNEL
	bool "Exclude kernel R/O sections"
	default n
	help
	  Allows to exclude the read-only area of kernel from a Snapshot
	  Boot image.
	  When this option is enabled, a separate kernel unit needs to be
	  loaded  for the boot loader when the Snapshot Boot is started.

config SNSC_SSBOOT_DETECT_ZERO_PAGES
	bool "Find zero cleared pages"
	default n
	help
	  Special handling for pages filled completely with zeros.
	  Zero sections are created for these pages and they are excluded
	  from the normal and the critical sections in the image file.

config SNSC_SSBOOT_PAGE_ATTR_DUMP
	tristate "Page Attr Dump Writer support"
	default n
	help
	  This module enables the output of detailed information about
	  all the pages included in the image during snapshot process to
	  a dump file whose path is specified by
	  SNSC_SSBOOT_PAGE_ATTR_DUMP_FILE_NAME.

	  Refer the following document for more details:
	    Sony.INTERNAL/common/doc/scel-ssboot/ssboot-page_attr_dump_en.txt

config SNSC_SSBOOT_PAGE_ATTR_DUMP_FILE_NAME
	string "Page Attr Dump Writer filename"
	depends on SNSC_SSBOOT_PAGE_ATTR_DUMP
	default "/tmp/page_attr_dump.txt"
	help
	  The path to the file which dump writer will use for the output.

config SNSC_SSBOOT_IMGVER
	bool "Embed version information into images"
	default n
	help
	  Creates a procfs entry for specifying a custom name, release and
	  version for the operating system and the kernel (obtainable from
	  `uname`) in the image file.

	  The maximum character limit is 255.

config SNSC_SSBOOT_CMDLINEINFO
	bool "Support parsing command line options"
	default n
	help
	  Enables support to parse command line information from boot loader.
	  After booting Snapshot Boot image, the kernel determines the
	  behaviour of boot using this information.

	  Refer to the following document for more details:
	    Sony.INTERNAL/common/doc/scel-ssboot/howto-create-ssboot-optimized-image_en.txt
	    (Sec. 6.3)

config SNSC_SSBOOT_ENABLE_FORCE_CLEAR_PAGE_BY_DEFAULT
	bool "Enable force-clear-page mode by default"
	default n
	help
	  Garbage on memory may decrease compression ratio of Snapshot
	  Boot image. To deal with it, enabling force-clear-page mode
	  forces __GFP_ZERO on page allocation, and it's disabled
	  automatically after resume from Snapshot Boot
	  image. Although you can enable/disable it via
	  /proc/ssboot/force_clear_page or kernel paremter
	  (ssboot_force_clear_page=), this configuration enables it by
	  default.
	  This mode is disabled while the snapshot image is being written
	  to a file.

config SNSC_SSBOOT_SBI
	tristate "SBI writer support"
	default y
	help
	  Enables the generation of a Snapshot Boot image in the SBI format.
	  Image compression and encryption are supported.

	  Refer to the following document for more details:
	    Sony.INTERNAL/common/doc/scel-ssboot/ssboot-sbi-format_en.txt

config SNSC_SSBOOT_SBI_FILE
	tristate "Generic SBI file writer"
	depends on SNSC_SSBOOT_SBI
	help
	  Enable the file writer for SBI format.

config SNSC_SSBOOT_SBI_FILE_NAME
	string "Default SBI filename"
	depends on SNSC_SSBOOT_SBI_FILE
	default "/ssboot.sbi"
	help
	  The path to the file which SBI file writer will use for creating
	  a snapshot.
	  This value can be accessed from the read-only procfs entry
	  /proc/ssboot/sbiname

	  Refer to the following document for more details:
	    Sony.INTERNAL/common/doc/scel-ssboot/internal/ssboot-sbi-writer-if.txt
	    (Sec. 3.1)

config SNSC_SSBOOT_SBI_SECTION_ENCRYPTION
	bool "SBI section encryption"
	depends on SNSC_SSBOOT_SBI
	default n
	help
	  Enabled SBI writer to encrypt sections and section list in the
	  image.

	  Refer to the following document for more details:
	    Sony.INTERNAL/common/doc/scel-ssboot/internal/ssboot-sbi-writer-if.txt
	    (Sec. 3.2)

config SNSC_SSBOOT_SBI_DECRYPTION_SELF_TEST
	bool "SBI section decryption self test"
	depends on SNSC_SSBOOT_SBI_SECTION_ENCRYPTION
	default n

config SNSC_SSBOOT_SBI_CKSUM
	bool "Add checksum to SBI images"
	depends on SNSC_SSBOOT_SBI
	default n
	help
	  Enable CRC32 checksums for header, section list and page data in
	  the snapshot image.

	  Refer to the following document for more details:
	    Sony.INTERNAL/common/doc/scel-ssboot/ssboot-sbi-format_en.txt
	    (Sec. 2.1.3.5)

choice
	prompt "Image optimizer"
	default SNSC_SSBOOT_BASIC_OPTIMIZER
	help
	  Enable the optimization of Snapshot Boot image.

	  Snapshot Boot time can reduced by restricting the pages included
	  in the image file to those which are referred during the boot-up.

	  Refer to the following document for more details:
	    Sony.INTERNAL/common/doc/scel-ssboot/howto-create-ssboot-optimized-image_en.txt

config SNSC_SSBOOT_SAMPLE_OPTIMIZER
	bool "Sample image optimizer support"

config SNSC_SSBOOT_BASIC_OPTIMIZER
	bool "Basic image optimizer support"
	help
	  Enables the image optimization function "Basic Optimizer".
	  To achieve this optimization, a 3-step boot-up sequence has to
	  be performed.

endchoice

config SNSC_SSBOOT_BASIC_OPTIMIZER_PROFILE_NAME
	string "Default profiling data file name for basic optimizer"
	depends on SNSC_SSBOOT_BASIC_OPTIMIZER
	default "/ssboot_prof.bin"
	help
	  Allows to specify the file name where the profile information of
	  "Basic Optimizer" image optimization function will be saved.
	  It is necessary to have the same path name during profiling and
	  when an optimized image is created.

config SNSC_SSBOOT_DEBUG_BASIC_OPTIMIZER
	bool "Snapshot Boot debugging support for basic optimizer"
	depends on SNSC_SSBOOT_BASIC_OPTIMIZER
	default n
	help
	  Displays detailed debug information for "Basic Optimizer".

endif
