From: Samuel Holland Date: Sat, 24 Oct 2020 15:21:51 +0000 (-0500) Subject: sunxi: board: Simplify Pine A64 DT selection logic X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=54ac5aa17461b404ff514c0276c05693069937b6;p=u-boot.git 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 Reviewed-by: Andre Przywara Signed-off-by: Samuel Holland Reviewed-by: Jagan Teki --- diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 078a881e57..3ea34bc7eb 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -916,14 +916,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);