blob: 92f8342c45f00ca0f88487da6712b0f24b703532 [file] [log] [blame]
Michael Walle4ceb5c62020-10-15 23:08:57 +02001// SPDX-License-Identifier: GPL-2.0+
2
3#include <common.h>
4#include <asm/io.h>
5#include <asm/spl.h>
6
7#define DCFG_RCWSR25 0x160
8#define GPINFO_HW_VARIANT_MASK 0xff
9
10int sl28_variant(void)
11{
12 return in_le32(DCFG_BASE + DCFG_RCWSR25) & GPINFO_HW_VARIANT_MASK;
13}
14
15int board_fit_config_name_match(const char *name)
16{
17 int variant = sl28_variant();
18
19 switch (variant) {
Michael Walle4029d352021-01-08 00:08:57 +010020 case 1:
21 return strcmp(name, "fsl-ls1028a-kontron-sl28-var1");
Michael Walle4ceb5c62020-10-15 23:08:57 +020022 case 3:
23 return strcmp(name, "fsl-ls1028a-kontron-sl28-var3");
24 case 4:
25 return strcmp(name, "fsl-ls1028a-kontron-sl28-var4");
26 default:
27 return strcmp(name, "fsl-ls1028a-kontron-sl28");
28 }
29}
30
31void board_boot_order(u32 *spl_boot_list)
32{
33 spl_boot_list[0] = BOOT_DEVICE_SPI;
34}