[U-Boot,v2,3/4] sunxi: Add default partition scheme

Message ID 03c9617e8dc759633a3300d8d16c13648d06d891.1512489372.git-series.maxime.ripard@free-electrons.com
State Accepted
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series
  • sunxi: Ease eMMC usage and flashing
Related show

Commit Message

Maxime Ripard Dec. 5, 2017, 3:56 p.m.
The partitions variable is especially useful to create a partition table
from U-Boot, either directly from the U-Boot shell, or through flashing
tools like fastboot and its oem format command.

This is especially useful on devices with an eMMC you can't take out to
flash from another system, and booting a Linux system first to flash our
system then is not really practical.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 include/configs/sunxi-common.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Andre Przywara Dec. 6, 2017, 1:01 a.m. | #1
Hi,

On 05/12/17 15:56, Maxime Ripard wrote:
> The partitions variable is especially useful to create a partition table
> from U-Boot, either directly from the U-Boot shell, or through flashing
> tools like fastboot and its oem format command.
> 
> This is especially useful on devices with an eMMC you can't take out to
> flash from another system, and booting a Linux system first to flash our
> system then is not really practical.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Thanks!
Andre.

> ---
>  include/configs/sunxi-common.h | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index 4391a8cbc824..786155f1e15e 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -493,6 +493,20 @@ extern int soft_i2c_gpio_scl;
>  #define SUNXI_MTDPARTS_DEFAULT
>  #endif
>  
> +#define PARTS_DEFAULT \
> +	"name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};" \
> +	"name=loader2,size=984k,uuid=${uuid_gpt_loader2};" \
> +	"name=esp,size=128M,bootable,uuid=${uuid_gpt_esp};" \
> +	"name=system,size=-,uuid=${uuid_gpt_system};"
> +
> +#define UUID_GPT_ESP "c12a7328-f81f-11d2-ba4b-00a0c93ec93b"
> +
> +#ifdef CONFIG_ARM64
> +#define UUID_GPT_SYSTEM "b921b045-1df0-41c3-af44-4c6f280d3fae"
> +#else
> +#define UUID_GPT_SYSTEM "69dad710-2ce4-4e3c-b16c-21a1d49abed3"
> +#endif
> +
>  #define CONSOLE_ENV_SETTINGS \
>  	CONSOLE_STDIN_SETTINGS \
>  	CONSOLE_STDOUT_SETTINGS
> @@ -511,6 +525,9 @@ extern int soft_i2c_gpio_scl;
>  	"console=ttyS0,115200\0" \
>  	SUNXI_MTDIDS_DEFAULT \
>  	SUNXI_MTDPARTS_DEFAULT \
> +	"uuid_gpt_esp=" UUID_GPT_ESP "\0" \
> +	"uuid_gpt_system=" UUID_GPT_SYSTEM "\0" \
> +	"partitions=" PARTS_DEFAULT "\0" \
>  	BOOTCMD_SUNXI_COMPAT \
>  	BOOTENV
>  
>

Patch

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 4391a8cbc824..786155f1e15e 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -493,6 +493,20 @@  extern int soft_i2c_gpio_scl;
 #define SUNXI_MTDPARTS_DEFAULT
 #endif
 
+#define PARTS_DEFAULT \
+	"name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};" \
+	"name=loader2,size=984k,uuid=${uuid_gpt_loader2};" \
+	"name=esp,size=128M,bootable,uuid=${uuid_gpt_esp};" \
+	"name=system,size=-,uuid=${uuid_gpt_system};"
+
+#define UUID_GPT_ESP "c12a7328-f81f-11d2-ba4b-00a0c93ec93b"
+
+#ifdef CONFIG_ARM64
+#define UUID_GPT_SYSTEM "b921b045-1df0-41c3-af44-4c6f280d3fae"
+#else
+#define UUID_GPT_SYSTEM "69dad710-2ce4-4e3c-b16c-21a1d49abed3"
+#endif
+
 #define CONSOLE_ENV_SETTINGS \
 	CONSOLE_STDIN_SETTINGS \
 	CONSOLE_STDOUT_SETTINGS
@@ -511,6 +525,9 @@  extern int soft_i2c_gpio_scl;
 	"console=ttyS0,115200\0" \
 	SUNXI_MTDIDS_DEFAULT \
 	SUNXI_MTDPARTS_DEFAULT \
+	"uuid_gpt_esp=" UUID_GPT_ESP "\0" \
+	"uuid_gpt_system=" UUID_GPT_SYSTEM "\0" \
+	"partitions=" PARTS_DEFAULT "\0" \
 	BOOTCMD_SUNXI_COMPAT \
 	BOOTENV