Date:2010-02-19 02:52:16 (10 years 3 months ago)
Author:Lars C.
Commit:fdf493c0cb8cfb4ea4e5364e066ec833d0d47663
Message:foo

Files: usbboot/src/ingenic_cfg.c (3 diffs)

Change Details

usbboot/src/ingenic_cfg.c
143143
144144int parse_configure(struct hand *hand, char * file_path)
145145{
146    int cpu_speed;
146    long cpu_speed;
147147    if (access(file_path, F_OK)) {
148148        fprintf(stderr, "Error - can't read configure file %s.\n",
149149            file_path);
...... 
155155
156156    cfg_opt_t opts[] = {
157157        CFG_INT("BOUDRATE", 57600, CFGF_NONE),
158        CFG_SIMPLE_INT("EXTCLK", &hand->fw_args.ext_clk),
159        CFG_SIMPLE_INT("CPUSPEED", &cpu_speed),
160        CFG_SIMPLE_INT("PHMDIV", &hand->fw_args.phm_div),
161        CFG_SIMPLE_INT("USEUART", &hand->fw_args.use_uart),
162
163        CFG_SIMPLE_INT("BUSWIDTH", &hand->fw_args.bus_width),
164        CFG_SIMPLE_INT("BANKS", &hand->fw_args.bank_num),
165        CFG_SIMPLE_INT("ROWADDR", &hand->fw_args.row_addr),
166        CFG_SIMPLE_INT("COLADDR", &hand->fw_args.col_addr),
167
168        CFG_SIMPLE_INT("ISMOBILE", &hand->fw_args.is_mobile),
169        CFG_SIMPLE_INT("ISBUSSHARE", &hand->fw_args.is_busshare),
170        CFG_SIMPLE_INT("DEBUGOPS", &hand->fw_args.debug_ops),
171        CFG_SIMPLE_INT("PINNUM", &hand->fw_args.pin_num),
172        CFG_SIMPLE_INT("START", &hand->fw_args.start),
173        CFG_SIMPLE_INT("SIZE", &hand->fw_args.size),
174
175        CFG_SIMPLE_INT("NAND_BUSWIDTH", &hand->nand_bw),
176        CFG_SIMPLE_INT("NAND_ROWCYCLES", &hand->nand_rc),
177        CFG_SIMPLE_INT("NAND_PAGESIZE", &hand->nand_ps),
178        CFG_SIMPLE_INT("NAND_PAGEPERBLOCK", &hand->nand_ppb),
179        CFG_SIMPLE_INT("NAND_FORCEERASE", &hand->nand_force_erase),
180        CFG_SIMPLE_INT("NAND_OOBSIZE", &hand->nand_os),
181        CFG_SIMPLE_INT("NAND_ECCPOS", &hand->nand_eccpos),
182        CFG_SIMPLE_INT("NAND_BADBLOCKPOS", &hand->nand_bbpos),
183        CFG_SIMPLE_INT("NAND_BADBLOCKPAGE", &hand->nand_bbpage),
184        CFG_SIMPLE_INT("NAND_PLANENUM", &hand->nand_plane),
185        CFG_SIMPLE_INT("NAND_BCHBIT", &hand->nand_bchbit),
186        CFG_SIMPLE_INT("NAND_WPPIN", &hand->nand_wppin),
187        CFG_SIMPLE_INT("NAND_BLOCKPERCHIP", &hand->nand_bpc),
158        CFG_INT("EXTCLK", 0, CFGF_NONE),
159        CFG_INT("CPUSPEED", 0, CFGF_NONE),
160        CFG_INT("PHMDIV", 0, CFGF_NONE),
161        CFG_INT("USEUART", 0, CFGF_NONE),
162
163        CFG_INT("BUSWIDTH", 0, CFGF_NONE),
164        CFG_INT("BANKS", 0, CFGF_NONE),
165        CFG_INT("ROWADDR", 0, CFGF_NONE),
166        CFG_INT("COLADDR", 0, CFGF_NONE),
167
168        CFG_INT("ISMOBILE", 0, CFGF_NONE),
169        CFG_INT("ISBUSSHARE", 0, CFGF_NONE),
170        CFG_INT("DEBUGOPS", 0, CFGF_NONE),
171        CFG_INT("PINNUM", 0, CFGF_NONE),
172        CFG_INT("START", 0, CFGF_NONE),
173        CFG_INT("SIZE", 0, CFGF_NONE),
174
175        CFG_INT("NAND_BUSWIDTH", 0, CFGF_NONE),
176        CFG_INT("NAND_ROWCYCLES", 0, CFGF_NONE),
177        CFG_INT("NAND_PAGESIZE", 0, CFGF_NONE),
178        CFG_INT("NAND_PAGEPERBLOCK", 0, CFGF_NONE),
179        CFG_INT("NAND_FORCEERASE", 0, CFGF_NONE),
180        CFG_INT("NAND_OOBSIZE", 0, CFGF_NONE),
181        CFG_INT("NAND_ECCPOS", 0, CFGF_NONE),
182        CFG_INT("NAND_BADBLOCKPOS", 0, CFGF_NONE),
183        CFG_INT("NAND_BADBLOCKPAGE", 0, CFGF_NONE),
184        CFG_INT("NAND_PLANENUM", 0, CFGF_NONE),
185        CFG_INT("NAND_BCHBIT", 0, CFGF_NONE),
186        CFG_INT("NAND_WPPIN", 0, CFGF_NONE),
187        CFG_INT("NAND_BLOCKPERCHIP", 0, CFGF_NONE),
188188
189189        CFG_END()
190190    };
...... 
195195        return -1;
196196
197197    hand->fw_args.boudrate = cfg_getint(cfg, "BOUDRATE");
198    hand->fw_args.ext_clk = cfg_getint(cfg, "EXTCLK");
199    cpu_speed = cfg_getint(cfg, "CPUSPEED");
200    hand->fw_args.phm_div = cfg_getint(cfg, "PHMDIV");
201    hand->fw_args.use_uart = cfg_getint(cfg, "USEUART");
202
203    hand->fw_args.bus_width = cfg_getint(cfg, "BUSWIDTH");
204    hand->fw_args.bank_num = cfg_getint(cfg, "BANKS");
205    hand->fw_args.row_addr = cfg_getint(cfg, "ROWADDR");
206    hand->fw_args.col_addr = cfg_getint(cfg, "COLADDR");
207
208    hand->fw_args.is_mobile = cfg_getint(cfg, "ISMOBILE");
209    hand->fw_args.is_busshare = cfg_getint(cfg, "ISBUSSHARE");
210    hand->fw_args.debug_ops = cfg_getint(cfg, "DEBUGOPS");
211    hand->fw_args.pin_num = cfg_getint(cfg, "PINNUM");
212    hand->fw_args.start = cfg_getint(cfg, "START");
213    hand->fw_args.size = cfg_getint(cfg, "SIZE");
214
215    hand->nand_bw = cfg_getint(cfg, "NAND_BUSWIDTH");
216    hand->nand_rc = cfg_getint(cfg, "NAND_ROWCYCLES");
217    hand->nand_ps = cfg_getint(cfg, "NAND_PAGESIZE");
218    hand->nand_ppb = cfg_getint(cfg, "NAND_PAGEPERBLOCK");
219    hand->nand_force_erase = cfg_getint(cfg, "NAND_FORCEERASE");
220    hand->nand_os = cfg_getint(cfg, "NAND_OOBSIZE");
221    hand->nand_eccpos = cfg_getint(cfg, "NAND_ECCPOS");
222    hand->nand_bbpos = cfg_getint(cfg, "NAND_BADBLOCKPOS");
223    hand->nand_bbpage = cfg_getint(cfg, "NAND_BADBLOCKPAGE");
224    hand->nand_plane = cfg_getint(cfg, "NAND_PLANENUM");
225    hand->nand_bchbit = cfg_getint(cfg, "NAND_BCHBIT");
226    hand->nand_wppin = cfg_getint(cfg, "NAND_WPPIN");
227    hand->nand_bpc = cfg_getint(cfg, "NAND_BLOCKPERCHIP");
228
198229    cfg_free(cfg);
199230
200231    hand->fw_args.cpu_id = 0x4740;

Archive Download the corresponding diff file



interactive