blob: 6dc58559680a15882b7f0aeb53516e628a839aa3 [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)
Marek Vasut6b17c852020-08-05 15:34:05 +020010#define MAKE_CFGVAL_PRIMARY_BOOT 0xfffffff0
11#define MAKE_CFGVAL_SECONDARY_BOOT 0xffffffff
Troy Kisky0ca618c2012-08-15 10:31:20 +000012
Adrian Alonso2b3d9612015-09-02 13:54:19 -050013enum 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 Fan0576f9b2018-10-18 14:28:13 +020030 FLEXSPI_BOOT,
Peng Fanbad55092018-01-10 13:20:24 +080031 USB_BOOT,
Adrian Alonso2b3d9612015-09-02 13:54:19 -050032 UNKNOWN_BOOT,
33 BOOT_DEV_NUM = UNKNOWN_BOOT,
34};
35
Peng Fand64a3c52018-01-10 13:20:34 +080036/* Boot device type */
37#define BOOT_TYPE_SD 0x1
38#define BOOT_TYPE_MMC 0x2
39#define BOOT_TYPE_NAND 0x3
40#define BOOT_TYPE_QSPI 0x4
41#define BOOT_TYPE_WEIM 0x5
42#define BOOT_TYPE_SPINOR 0x6
43#define BOOT_TYPE_USB 0xF
44
Troy Kisky0ca618c2012-08-15 10:31:20 +000045struct boot_mode {
46 const char *name;
47 unsigned cfg_val;
48};
49
50void add_board_boot_modes(const struct boot_mode *p);
51void boot_mode_apply(unsigned cfg_val);
52extern const struct boot_mode soc_boot_modes[];
53#endif