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>
Fri, 8 Apr 2016 02:13:03 +0000 (11:13 +0900)
commit061f5633ad7c170d5c79e7b4723efc788f794efb
treeac06c310a8b5f84b81417f28088f36174d228a54
parent4bc1693c247cea1035c67f024af1e05ca3097bca
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