• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * hicpu_common.h
3  *
4  * The Flash Memory Controller v100 Device Driver for hisilicon
5  *
6  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
7  *
8  * This program is free software; you can redistribute  it and/or modify it
9  * under  the terms of  the GNU General  Public License as published by the
10  * Free Software Foundation;  either version 2 of the  License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef __HICPU_COMMON_H__
24 #define __HICPU_COMMON_H__
25 
26 #include <command.h>
27 
28 #ifdef CONFIG_EMMC
29 extern int target_dev;
30 extern int target_paratition;
31 #endif
32 
33 void reset_cpu(ulong addr);
34 void uart_early_init(void);
35 void uart_early_puts(const char *ss);
36 extern unsigned char input_data[];
37 extern unsigned char input_data_end[];
38 extern unsigned long _armboot_start;
39 extern int hisi_sdhci_add_port(int index, u32 regbase, u32 freq);
40 extern int hisi_mmc_init(int index);
41 
42 #if (CONFIG_AUTO_UPDATE == 1)
43 extern int do_auto_update(void);
44 extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]);
45 #endif /* CONFIG_AUTO_UPDATE */
46 
47 #ifdef CONFIG_GENERIC_MMC
48 extern int himci_probe(int dev_num);
49 #endif /* CONFIG_GENERIC_MMC */
50 
51 #ifdef CONFIG_SUPPORT_EMMC_BOOT
52 extern int himci_add_port(int index, u32 reg_base, u32 freq);
53 #endif /* CONFIG_SUPPORT_EMMC_BOOT */
54 
55 #ifdef CONFIG_AUTO_SD_UPDATE
56 extern int himci_add_port(int index, u32 reg_base, u32 freq);
57 #endif /* CONFIG_AUTO_SD_UPDATE */
58 
59 extern int mmc_phy_init(void);
60 
61 #ifdef CONFIG_CMD_NAND
62 extern int nand_saveenv(void);
63 extern void nand_env_relocate_spec(void);
64 #endif /* CONFIG_CMD_NAND */
65 
66 #ifdef CONFIG_ENV_IS_IN_SPI_FLASH
67 extern int sf_saveenv(void);
68 extern void sf_env_relocate_spec(void);
69 #endif /* CONFIG_ENV_IS_IN_SPI_FLASH */
70 
71 #ifdef CONFIG_ENV_IS_IN_MMC
72 extern int emmc_saveenv(void);
73 extern void emmc_env_relocate_spec(void);
74 #endif /* CONFIG_ENV_IS_IN_MMC */
75 
76 #ifdef CONFIG_ENV_IS_IN_UFS
77 extern int ufs_saveenv(void);
78 extern void ufs_env_relocate_spec(void);
79 #endif /* CONFIG_ENV_IS_IN_UFS */
80 
81 #endif /* __HICPU_COMMON_H__ */
82 
83