blob: 8766e9d180494168b4bf38f7bb89afa6412b21f7 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Troy Kisky0ca618c2012-08-15 10:31:20 +00002/*
3 * Copyright (C) 2012 Boundary Devices Inc.
Troy Kisky0ca618c2012-08-15 10:31:20 +00004 */
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)
10
Adrian Alonso2b3d9612015-09-02 13:54:19 -050011enum boot_device {
12 WEIM_NOR_BOOT,
13 ONE_NAND_BOOT,
14 PATA_BOOT,
15 SATA_BOOT,
16 I2C_BOOT,
17 SPI_NOR_BOOT,
18 SD1_BOOT,
19 SD2_BOOT,
20 SD3_BOOT,
21 SD4_BOOT,
22 MMC1_BOOT,
23 MMC2_BOOT,
24 MMC3_BOOT,
25 MMC4_BOOT,
26 NAND_BOOT,
27 QSPI_BOOT,
Peng Fanbad55092018-01-10 13:20:24 +080028 USB_BOOT,
Adrian Alonso2b3d9612015-09-02 13:54:19 -050029 UNKNOWN_BOOT,
30 BOOT_DEV_NUM = UNKNOWN_BOOT,
31};
32
Peng Fand64a3c52018-01-10 13:20:34 +080033/* Boot device type */
34#define BOOT_TYPE_SD 0x1
35#define BOOT_TYPE_MMC 0x2
36#define BOOT_TYPE_NAND 0x3
37#define BOOT_TYPE_QSPI 0x4
38#define BOOT_TYPE_WEIM 0x5
39#define BOOT_TYPE_SPINOR 0x6
40#define BOOT_TYPE_USB 0xF
41
Troy Kisky0ca618c2012-08-15 10:31:20 +000042struct boot_mode {
43 const char *name;
44 unsigned cfg_val;
45};
46
47void add_board_boot_modes(const struct boot_mode *p);
48void boot_mode_apply(unsigned cfg_val);
49extern const struct boot_mode soc_boot_modes[];
50#endif