/* note: the boot mode register is configured by application(next stage bootloader, kernel, etc), and the bootrom never check this register, so we need to check it and back to bootrom at very early bootstage(before some basic configurations(such as interrupts) been changed by TPL/SPL, as the bootrom download operation relies on many default settings(such as interrupts) by itself.  */
static bool check_back_to_brom_dnl_flag(void)
/* note: the boot mode register is configured by application(next stage bootloader, kernel, etc), and the bootrom never check this register, so we need to check it and back to bootrom at very early bootstage(before some basic configurations(such as interrupts) been changed by TPL/SPL, as the bootrom download operation relies on many default settings(such as interrupts) by itself.  */
static bool check_back_to_brom_dnl_flag(void)
{
	u32 boot_mode;
	if (CONFIG_ROCKCHIP_BOOT_MODE_REG) {
		boot_mode = readl(CONFIG_ROCKCHIP_BOOT_MODE_REG);
		if (boot_mode == BOOT_BROM_DOWNLOAD) {
			writel(0, CONFIG_ROCKCHIP_BOOT_MODE_REG);
			return true;
		}
	}
	return false;
}