diff --git a/inflash/src/cmd.c b/inflash/src/cmd.c index baf0d75..cca0379 100644 --- a/inflash/src/cmd.c +++ b/inflash/src/cmd.c @@ -1,23 +1,11 @@ /* - * "Ingenic flash tool" - flash the Ingenic CPU via USB - * - * (C) Copyright 2009 - * Author: Marek Lindner - * Author: Xiangfu Liu + * Authors: Marek Lindner + * Xiangfu Liu * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * version 3 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA + * as published by the Free Software Foundation; either version + * 3 of the License, or (at your option) any later version. */ #include diff --git a/inflash/src/cmd.h b/inflash/src/cmd.h index 57d7fa4..cd3ab59 100644 --- a/inflash/src/cmd.h +++ b/inflash/src/cmd.h @@ -1,22 +1,10 @@ /* - * "Ingenic flash tool" - flash the Ingenic CPU via USB - * - * (C) Copyright 2009 - * Author: Xiangfu Liu + * Authors: Xiangfu Liu * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * version 3 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA + * as published by the Free Software Foundation; either version + * 3 of the License, or (at your option) any later version. */ #ifndef __CMD_H__ @@ -29,6 +17,7 @@ #define MAX_COMMAND_LENGTH 100 int boot(char *stage1_path, char *stage2_path); +int init_nand_in(); int nand_prog(void); int nand_query(void); int nand_erase(struct nand_in *nand_in); diff --git a/inflash/src/command_line.c b/inflash/src/command_line.c index f87714c..f43376f 100644 --- a/inflash/src/command_line.c +++ b/inflash/src/command_line.c @@ -1,22 +1,10 @@ /* - * "Ingenic flash tool" - flash the Ingenic CPU via USB - * - * (C) Copyright 2009 - * Author: Xiangfu Liu + * Authors: Xiangfu Liu * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * version 3 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA + * as published by the Free Software Foundation; either version + * 3 of the License, or (at your option) any later version. */ #include @@ -98,23 +86,9 @@ static int handle_version(void) return 1; } -static int handle_fconfig(void) -{ - if (com_argc < 3) { - printf("\n Usage:" - " fconfig (1) (2) " - "\n 1:configration file name" - "\n 2:deivce index number"); - return -1; - } - /* usb_infenic_config(atoi(com_argv[2]),com_argv[1]); */ - return 1; -} - /* need transfer two para :blk_num ,start_blk */ int handle_nerase(void) { - int i; if (com_argc < 5) { printf("\n Usage:"); printf(" nerase (1) (2) (3) (4) "); diff --git a/inflash/src/command_line.h b/inflash/src/command_line.h index e6505bc..eb9edb1 100644 --- a/inflash/src/command_line.h +++ b/inflash/src/command_line.h @@ -1,23 +1,12 @@ /* - * "Ingenic flash tool" - flash the Ingenic CPU via USB - * - * (C) Copyright 2009 - * Author: Xiangfu Liu + * Authors: Xiangfu Liu * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * version 3 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA + * as published by the Free Software Foundation; either version + * 3 of the License, or (at your option) any later version. */ + #ifndef __COMMAND_LINE_H__ #define __COMMAND_LINE_H__ diff --git a/inflash/src/ingenic_cfg.c b/inflash/src/ingenic_cfg.c index ece4d12..30d016d 100644 --- a/inflash/src/ingenic_cfg.c +++ b/inflash/src/ingenic_cfg.c @@ -1,27 +1,16 @@ /* - * put all the configure operate to this file - * - * (C) Copyright 2009 - * Author: Marek Lindner + * Authors: Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * version 3 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA + * as published by the Free Software Foundation; either version + * 3 of the License, or (at your option) any later version. */ #include #include #include +#include #include "ingenic_cfg.h" #include "usb_boot_defines.h" @@ -142,7 +131,7 @@ int check_dump_cfg(struct hand *hand) int parse_configure(struct hand *hand, char * file_path) { if (access(file_path, F_OK)) { - fprintf(stderr, "Error - can't read file: %s\n", + fprintf(stderr, "Error - can't read file %s: %s\n", file_path, strerror(errno)); return -1; } @@ -188,7 +177,7 @@ int parse_configure(struct hand *hand, char * file_path) cfg_t *cfg; cfg = cfg_init(opts, 0); if (cfg_parse(cfg, file_path) == CFG_PARSE_ERROR) { - fprintf(stderr, "Error - can't read file: %s\n", + fprintf(stderr, "Error - can't read file %s: %s\n", file_path, strerror(errno)); return -1; } diff --git a/inflash/src/ingenic_cfg.h b/inflash/src/ingenic_cfg.h index 6bc813a..1a18f02 100644 --- a/inflash/src/ingenic_cfg.h +++ b/inflash/src/ingenic_cfg.h @@ -1,22 +1,10 @@ /* - * put all the configure operate to this file - * - * (C) Copyright 2009 - * Author: Marek Lindner + * Authors: Xiangfu Liu * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * version 3 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA + * as published by the Free Software Foundation; either version + * 3 of the License, or (at your option) any later version. */ #ifndef __INGENIC_CFG_H__ diff --git a/inflash/src/ingenic_usb.c b/inflash/src/ingenic_usb.c index 5436051..56f6d7e 100644 --- a/inflash/src/ingenic_usb.c +++ b/inflash/src/ingenic_usb.c @@ -1,23 +1,11 @@ /* - * "Ingenic flash tool" - flash the Ingenic CPU via USB - * - * (C) Copyright 2009 - * Author: Marek Lindner - * Author: Xiangfu liu + * Authors: Marek Lindner + * Xiangfu Liu * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * version 3 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA + * as published by the Free Software Foundation; either version + * 3 of the License, or (at your option) any later version. */ #include "ingenic_usb.h" diff --git a/inflash/src/ingenic_usb.h b/inflash/src/ingenic_usb.h index e9da70e..5ade2b0 100644 --- a/inflash/src/ingenic_usb.h +++ b/inflash/src/ingenic_usb.h @@ -1,23 +1,13 @@ /* - * "Ingenic flash tool" - flash the Ingenic CPU via USB - * - * (C) Copyright 2009 - * Author: Marek Lindner + * Authors: Xiangfu Liu + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * version 3 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA + * as published by the Free Software Foundation; either version + * 3 of the License, or (at your option) any later version. */ + #ifndef __INGENIC_USB_H__ #define __INGENIC_USB_H__ diff --git a/inflash/src/main.c b/inflash/src/main.c index 3880869..5db57a9 100644 --- a/inflash/src/main.c +++ b/inflash/src/main.c @@ -1,27 +1,17 @@ /* - * "Ingenic flash tool" - flash the Ingenic CPU via USB - * - * (C) Copyright 2009 - * Author: Xiangfu Liu + * Authors: Xiangfu Liu * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * version 3 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA + * as published by the Free Software Foundation; either version + * 3 of the License, or (at your option) any later version. */ #include #include #include +#include +#include #include "inflash_version.h" #include "command_line.h" #include "ingenic_usb.h" diff --git a/inflash/src/usb_boot_defines.h b/inflash/src/usb_boot_defines.h index 1c62caa..2bd093c 100644 --- a/inflash/src/usb_boot_defines.h +++ b/inflash/src/usb_boot_defines.h @@ -1,22 +1,10 @@ /* - * "Ingenic flash tool" - flash the Ingenic CPU via USB - * - * (C) Copyright 2009 - * Author: Marek Lindner + * Authors: Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * version 3 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA + * as published by the Free Software Foundation; either version + * 3 of the License, or (at your option) any later version. */ #ifndef __USB_BOOT_DEFINES_H__