[3/3] env: ti: boot: Get rid of magic numbers

Message ID 20180226211801.16060-4-semen.protsenko@linaro.org
State Accepted
Commit 2c9afab9ac17cb1d7c0861ec6d3f078e878dce13
Headers show
Series
  • Provide partition names to commands in environment
Related show

Commit Message

Sam Protsenko Feb. 26, 2018, 9:18 p.m.
Get the start address and the size of partitions using partition names
rather than partition numbers. This way we can change the partition
table further without changing the boot code.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
 include/environment/ti/boot.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Tom Rini March 14, 2018, 2:09 p.m. | #1
On Mon, Feb 26, 2018 at 11:18:01PM +0200, Sam Protsenko wrote:

> Get the start address and the size of partitions using partition names

> rather than partition numbers. This way we can change the partition

> table further without changing the boot code.

> 

> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>


Applied to u-boot/master, thanks!

-- 
Tom

Patch

diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h
index 0a2342061c..24b7783f88 100644
--- a/include/environment/ti/boot.h
+++ b/include/environment/ti/boot.h
@@ -40,15 +40,13 @@ 
 		"setenv eval_bootargs setenv bootargs $bootargs; " \
 		"run eval_bootargs; " \
 		"setenv mmcdev 1; " \
-		"setenv fdt_part 3; " \
-		"setenv boot_part 9; " \
 		"setenv machid fe6; " \
 		"mmc dev $mmcdev; " \
 		"mmc rescan; " \
-		"part start mmc ${mmcdev} ${fdt_part} fdt_start; " \
-		"part size mmc ${mmcdev} ${fdt_part} fdt_size; " \
-		"part start mmc ${mmcdev} ${boot_part} boot_start; " \
-		"part size mmc ${mmcdev} ${boot_part} boot_size; " \
+		"part start mmc ${mmcdev} environment fdt_start; " \
+		"part size mmc ${mmcdev} environment fdt_size; " \
+		"part start mmc ${mmcdev} boot boot_start; " \
+		"part size mmc ${mmcdev} boot boot_size; " \
 		"mmc read ${fdtaddr} ${fdt_start} ${fdt_size}; " \
 		"mmc read ${loadaddr} ${boot_start} ${boot_size}; " \
 		"bootm $loadaddr $loadaddr $fdtaddr;\0"