blob: 75d5dd79fb7901842b98ca0cd39fd11e4af76187 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*
2 * (C) Copyright 2016 ZXIC Inc.
3 */
4#include <asm/io.h>
5#include <asm/arch/top_clock.h>
6
7#include "flash.h"
8
9struct flash_type flash;
10
11/*
12 ******************************************************************************
13 * Function:
14 * Description:
15 * Parameters:
16 * Input:
17 * Output:
18 * Returns:
19 * Others:
20 *******************************************************************************
21 */
22char get_boot_mode(void)
23{
24 char boot_info = 0;
25
26 boot_info = readl(BOOTSEL_INFO);
27
28 if(((boot_info >> 4)&0x3) == 0x3)
29 {
30 return NOR_BOOT;
31 }
32 else
33 {
34 if(((boot_info & 0x7) == 0x0) || ((boot_info & 0x7) == 0x1))
35 {
36 return NAND_BOOT;
37 }
38 else if(((boot_info & 0x7) == 0x4) || ((boot_info & 0x7) == 0x5))
39 {
40 return SPI_NAND_BOOT;
41 }
42 else
43 {
44 return OTHER_BOOT;
45 }
46 }
47}
48
49
50