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