4 * Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr>
6 * SPDX-License-Identifier: GPL-2.0+
11 #include <asm/arch/sys_proto.h>
14 static u32 boot_devices[] = {
46 u32 omap_sys_boot_device(void)
48 struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
51 /* Grab the first 5 bits of the status register for SYS_BOOT. */
52 sys_boot = readl(&ctrl_base->status) & ((1 << 5) - 1);
54 if (sys_boot >= (sizeof(boot_devices) / sizeof(u32)))
55 return BOOT_DEVICE_NONE;
57 return boot_devices[sys_boot];