samsung: misc: add new feature for configure partitions layout at boot.
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Wed, 5 Nov 2014 20:09:07 +0000 (21:09 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 20 Oct 2020 00:43:31 +0000 (09:43 +0900)
commitdf83270a98d42785f52fc07927a7ca0f356a926d
treef3e732272f779a3acdb8889738af1a061b79cdcc
parentcf4fb94df78d4ea383132784d877f6fb52f73c6f
samsung: misc: add new feature for configure partitions layout at boot.

This feature requires some platform configuration data
in the environment, which is:
-${platname}_setup_N_name       - name of this setup
-${platname}_setup_N_partitions - GPT partitions or NULL if MBR
-${platname}_setup_N_alt_system - dfu_alt_info with system entities
-${platname}_setup_N_bootpart   - boot partition number for this setup
-${platname}_setup_N_rootpart   - root partition number for this setup

And for at least one setup it requires:
-${platname}_setup_cnt    - number of ${platname} configs
-${platname}_setup_chosen - chosen plaform config
-${platname}_setup_active - active platform config (autoset)

Two environment variables are used to switch/check active setup:
-${platname}_setup_chosen - can be changed manually
-${platname}_setup_active - should be the same as chosen

If chosen setup is not set, then will be automatically set on boot
by setting proper env:
- $partitions                 := ${platname}_setup_N_partitions
- $dfu_alt_system_${platname} := ${platname}_setup_N_alt_system
- $mmcbootpart                := ${platname}_setup_N_bootpart
- $mmcrootpart                := ${platname}_setup_N_rootpart
- ${platname}_setup_active    := ${platname}_setup_chosen

If ${partitions} are:
- set, then gpt write is called
- unset, e.g. when using MBR - then partition table is unchanged

Config:
- CONFIG_PLATFORM_SETUP

Changed for v2016.03:
- Replaced from vsnprintf to vsprintf

Change-Id: Ib9f90415b92ec1d67a9bf6b84e7ab5d5deea8a7d
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
board/samsung/common/misc.c
include/samsung/misc.h