blob: fa5829eee0bcd9679ead6034796a324e6fa1c7df [file] [log] [blame]
Michael Walle36ba7642020-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) {
20 case 3:
21 return strcmp(name, "fsl-ls1028a-kontron-sl28-var3");
22 case 4:
23 return strcmp(name, "fsl-ls1028a-kontron-sl28-var4");
24 default:
25 return strcmp(name, "fsl-ls1028a-kontron-sl28");
26 }
27}
28
29void board_boot_order(u32 *spl_boot_list)
30{
31 spl_boot_list[0] = BOOT_DEVICE_SPI;
32}