aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2020-10-24 10:21:51 -0500
committerJagan Teki <jagan@amarulasolutions.com>2020-11-16 12:34:08 +0530
commitfd795079da5b09b74d3f4f011a29f1c3c5afb04d (patch)
treea6c497497821d4c2ab2ca37a5177f3e43e4f36f7
parent0747888235627f4f3f39a306dbdaf842f542f2a7 (diff)
downloadu-boot-fd795079da5b09b74d3f4f011a29f1c3c5afb04d.zip
u-boot-fd795079da5b09b74d3f4f011a29f1c3c5afb04d.tar.gz
u-boot-fd795079da5b09b74d3f4f011a29f1c3c5afb04d.tar.bz2
sunxi: board: Simplify Pine A64 DT selection logic
Instead of using an entirely separate matching algorithm, simply update the name of the DT we want to match. Enabling this logic does not depend on the FIT config name, only on the initial guess of the board name. Importantly, the initial guess must be "sun50i-a64-pine64-plus", because otherwise the logic would trigger when "sun50i-a64-pine64-lts" was written to the SPL header. Acked-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
-rw-r--r--board/sunxi/board.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index a8a05ec..ec1920c 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -914,14 +914,10 @@ int board_fit_config_name_match(const char *name)
return 0;
}
#ifdef CONFIG_PINE64_DT_SELECTION
-/* Differentiate the two Pine64 board DTs by their DRAM size. */
- if (strstr(name, "-pine64") && strstr(best_dt_name, "-pine64")) {
- if ((gd->ram_size > 512 * 1024 * 1024))
- return !strstr(name, "plus");
- else
- return !!strstr(name, "plus");
- } else {
- return strcmp(name, best_dt_name);
+ if (strstr(best_dt_name, "-pine64-plus")) {
+ /* Differentiate the Pine A64 boards by their DRAM size. */
+ if ((gd->ram_size == 512 * 1024 * 1024))
+ best_dt_name = "sun50i-a64-pine64";
}
#endif
return strcmp(name, best_dt_name);