Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Troy Kisky | 0ca618c | 2012-08-15 10:31:20 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2012 Boundary Devices Inc. |
Troy Kisky | 0ca618c | 2012-08-15 10:31:20 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _ASM_BOOT_MODE_H |
| 7 | #define _ASM_BOOT_MODE_H |
| 8 | #define MAKE_CFGVAL(cfg1, cfg2, cfg3, cfg4) \ |
| 9 | ((cfg4) << 24) | ((cfg3) << 16) | ((cfg2) << 8) | (cfg1) |
Marek Vasut | 6b17c85 | 2020-08-05 15:34:05 +0200 | [diff] [blame] | 10 | #define MAKE_CFGVAL_PRIMARY_BOOT 0xfffffff0 |
| 11 | #define MAKE_CFGVAL_SECONDARY_BOOT 0xffffffff |
Troy Kisky | 0ca618c | 2012-08-15 10:31:20 +0000 | [diff] [blame] | 12 | |
Adrian Alonso | 2b3d961 | 2015-09-02 13:54:19 -0500 | [diff] [blame] | 13 | enum boot_device { |
| 14 | WEIM_NOR_BOOT, |
| 15 | ONE_NAND_BOOT, |
| 16 | PATA_BOOT, |
| 17 | SATA_BOOT, |
| 18 | I2C_BOOT, |
| 19 | SPI_NOR_BOOT, |
| 20 | SD1_BOOT, |
| 21 | SD2_BOOT, |
| 22 | SD3_BOOT, |
| 23 | SD4_BOOT, |
| 24 | MMC1_BOOT, |
| 25 | MMC2_BOOT, |
| 26 | MMC3_BOOT, |
| 27 | MMC4_BOOT, |
| 28 | NAND_BOOT, |
| 29 | QSPI_BOOT, |
Peng Fan | 0576f9b | 2018-10-18 14:28:13 +0200 | [diff] [blame] | 30 | FLEXSPI_BOOT, |
Peng Fan | bad5509 | 2018-01-10 13:20:24 +0800 | [diff] [blame] | 31 | USB_BOOT, |
Peng Fan | 4f3099b | 2022-07-26 16:40:38 +0800 | [diff] [blame^] | 32 | USB2_BOOT, |
Adrian Alonso | 2b3d961 | 2015-09-02 13:54:19 -0500 | [diff] [blame] | 33 | UNKNOWN_BOOT, |
| 34 | BOOT_DEV_NUM = UNKNOWN_BOOT, |
| 35 | }; |
| 36 | |
Peng Fan | d64a3c5 | 2018-01-10 13:20:34 +0800 | [diff] [blame] | 37 | /* Boot device type */ |
| 38 | #define BOOT_TYPE_SD 0x1 |
| 39 | #define BOOT_TYPE_MMC 0x2 |
| 40 | #define BOOT_TYPE_NAND 0x3 |
| 41 | #define BOOT_TYPE_QSPI 0x4 |
| 42 | #define BOOT_TYPE_WEIM 0x5 |
| 43 | #define BOOT_TYPE_SPINOR 0x6 |
| 44 | #define BOOT_TYPE_USB 0xF |
| 45 | |
Troy Kisky | 0ca618c | 2012-08-15 10:31:20 +0000 | [diff] [blame] | 46 | struct boot_mode { |
| 47 | const char *name; |
| 48 | unsigned cfg_val; |
| 49 | }; |
| 50 | |
| 51 | void add_board_boot_modes(const struct boot_mode *p); |
| 52 | void boot_mode_apply(unsigned cfg_val); |
| 53 | extern const struct boot_mode soc_boot_modes[]; |
| 54 | #endif |