Root/usbboot/src/cmd.h

1/*
2 * Copyright(C) 2009 Qi Hardware Inc.,
3 * Authors: Xiangfu Liu <xiangfu@sharism.cc>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef __CMD_H__
20#define __CMD_H__
21
22#include "usb_boot_defines.h"
23
24#define COMMAND_NUM 31
25
26struct ingenic_dev ingenic_dev;
27struct hand hand;
28struct sdram_in sdram_in;
29struct nand_in nand_in;
30
31unsigned int total_size;
32unsigned char code_buf[4 * 512 * 1024];
33unsigned char check_buf[4 * 512 * 1024];
34unsigned char cs[16];
35unsigned char ret[8];
36
37static const char IMAGE_TYPE[][30] = {
38    "with oob and ecc",
39    "with oob and without ecc",
40    "without oob",
41};
42
43int boot(char *stage1_path, char *stage2_path);
44int init_nand_in();
45int nand_read(int mode);
46int nand_prog(void);
47int nand_query(void);
48int nand_erase(struct nand_in *nand_in);
49int debug_memory(unsigned int start, unsigned int size);
50int debug_gpio(unsigned char ops, unsigned char pin);
51int debug_go(void);
52int device_reset(int ops);
53int nand_markbad(struct nand_in *nand_in);
54int sdram_load_file(struct sdram_in *sdram_in, char *file_path);
55
56#endif /* __CMD_H__ */
57

Archive Download this file



interactive