| // SPDX-License-Identifier: GPL-2.0+ |
| * Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr> |
| #include <asm/arch/sys_proto.h> |
| static u32 boot_devices[] = { |
| u32 omap_sys_boot_device(void) |
| struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE; |
| /* Grab the first 5 bits of the status register for SYS_BOOT. */ |
| sys_boot = readl(&ctrl_base->status) & ((1 << 5) - 1); |
| if (sys_boot >= (sizeof(boot_devices) / sizeof(u32))) |
| return boot_devices[sys_boot]; |
| int omap_reboot_mode(char *mode, unsigned int length) |
| reboot_mode = readl((u32 *)(OMAP34XX_SCRATCHPAD + |
| OMAP_REBOOT_REASON_OFFSET)); |
| c = (reboot_mode >> 24) & 0xff; |
| c = (reboot_mode >> 16) & 0xff; |
| int omap_reboot_mode_clear(void) |
| writel(0, (u32 *)(OMAP34XX_SCRATCHPAD + OMAP_REBOOT_REASON_OFFSET)); |
| int omap_reboot_mode_store(char *mode) |
| reboot_mode = 'B' << 24 | 'M' << 16 | mode[0]; |
| writel(reboot_mode, (u32 *)(OMAP34XX_SCRATCHPAD + |
| OMAP_REBOOT_REASON_OFFSET)); |