blob: 7d2451a7494627ed633d7076181f86f9b3651f3f [file] [log] [blame]
Glenn Stroz99291c22016-07-18 11:27:37 -07001/* Copyright (c) 2014,2016 The Linux Foundation. All rights reserved.
Sundarajan Srinivasan34bbe072014-03-21 17:27:16 -07002
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of The Linux Foundation. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef __BOOT_DEVICE_H
30#define __BOOT_DEVICE_H
31
32#include <sys/types.h>
Unnati Gandhif37b3622014-11-18 18:02:45 +053033#include <platform.h>
Sundarajan Srinivasan34bbe072014-03-21 17:27:16 -070034
Channagoud Kadabic42ea322014-10-10 12:26:54 -070035#if USE_MDM_BOOT_CFG
36#define BOOT_DEVICE_MASK(val) ((val & 0x1E) >> 1)
37#else
Unnati Gandhif37b3622014-11-18 18:02:45 +053038#define BOOT_DEVICE_MASK(val) boot_device_mask(val)
Channagoud Kadabic42ea322014-10-10 12:26:54 -070039#endif
Sundarajan Srinivasan34bbe072014-03-21 17:27:16 -070040
41/* Boot device */
Channagoud Kadabic42ea322014-10-10 12:26:54 -070042#if USE_MDM_BOOT_CFG
Sundarajan Srinivasan34bbe072014-03-21 17:27:16 -070043enum boot_device
44{
Channagoud Kadabic42ea322014-10-10 12:26:54 -070045 BOOT_DEFAULT=0, /* NAND */
46 BOOT_EMMC=3,
47};
48#else
49enum boot_device
50{
51 BOOT_DEFAULT=0, /* EMMC */
Sundarajan Srinivasan34bbe072014-03-21 17:27:16 -070052 BOOT_EMMC=2,
53 BOOT_UFS=4,
Glenn Stroz99291c22016-07-18 11:27:37 -070054 BOOT_SD_ELSE_UFS=5,
Sundarajan Srinivasan34bbe072014-03-21 17:27:16 -070055};
Channagoud Kadabic42ea322014-10-10 12:26:54 -070056#endif
Sundarajan Srinivasan34bbe072014-03-21 17:27:16 -070057
58void platform_read_boot_config();
59uint32_t platform_get_boot_dev();
60uint32_t platform_boot_dev_isemmc();
61void platform_boot_dev_cmdline(char *buf);
Veera Sundaram Sankaran00181512014-12-09 11:23:39 -080062
63void *target_mmc_device();
Sundarajan Srinivasan34bbe072014-03-21 17:27:16 -070064#endif