Michael Walle | 4ceb5c6 | 2020-10-15 23:08:57 +0200 | [diff] [blame] | 1 | // 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 | |
| 10 | int sl28_variant(void) |
| 11 | { |
| 12 | return in_le32(DCFG_BASE + DCFG_RCWSR25) & GPINFO_HW_VARIANT_MASK; |
| 13 | } |
| 14 | |
| 15 | int board_fit_config_name_match(const char *name) |
| 16 | { |
| 17 | int variant = sl28_variant(); |
| 18 | |
| 19 | switch (variant) { |
Michael Walle | 4029d35 | 2021-01-08 00:08:57 +0100 | [diff] [blame^] | 20 | case 1: |
| 21 | return strcmp(name, "fsl-ls1028a-kontron-sl28-var1"); |
Michael Walle | 4ceb5c6 | 2020-10-15 23:08:57 +0200 | [diff] [blame] | 22 | 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 | |
| 31 | void board_boot_order(u32 *spl_boot_list) |
| 32 | { |
| 33 | spl_boot_list[0] = BOOT_DEVICE_SPI; |
| 34 | } |