diff --git a/usbboot/src/cmd.c b/usbboot/src/cmd.c index 7a25356..edf7d5a 100644 --- a/usbboot/src/cmd.c +++ b/usbboot/src/cmd.c @@ -1,11 +1,20 @@ /* + * Copyright(C) 2009 Qi Hardware Inc., * 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 - * as published by the Free Software Foundation; either version - * 3 of the License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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, see . */ #include diff --git a/usbboot/src/cmd.h b/usbboot/src/cmd.h index ffb1df5..0b1d613 100644 --- a/usbboot/src/cmd.h +++ b/usbboot/src/cmd.h @@ -1,10 +1,19 @@ /* + * Copyright(C) 2009 Qi Hardware Inc., * 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 - * as published by the Free Software Foundation; either version - * 3 of the License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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, see . */ #ifndef __CMD_H__ diff --git a/usbboot/src/command_line.c b/usbboot/src/command_line.c index acb80c2..b2cbb36 100644 --- a/usbboot/src/command_line.c +++ b/usbboot/src/command_line.c @@ -1,10 +1,19 @@ /* + * Copyright(C) 2009 Qi Hardware Inc., * 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 - * as published by the Free Software Foundation; either version - * 3 of the License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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, see . */ #include diff --git a/usbboot/src/command_line.h b/usbboot/src/command_line.h index 3480c33..886f43b 100644 --- a/usbboot/src/command_line.h +++ b/usbboot/src/command_line.h @@ -1,10 +1,19 @@ /* + * Copyright(C) 2009 Qi Hardware Inc., * 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 - * as published by the Free Software Foundation; either version - * 3 of the License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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, see . */ #ifndef __COMMAND_LINE_H__ diff --git a/usbboot/src/ingenic_cfg.c b/usbboot/src/ingenic_cfg.c index 36f93f0..cb6fd72 100644 --- a/usbboot/src/ingenic_cfg.c +++ b/usbboot/src/ingenic_cfg.c @@ -1,10 +1,19 @@ /* + * Copyright(C) 2009 Qi Hardware Inc., * 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 - * as published by the Free Software Foundation; either version - * 3 of the License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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, see . */ #include diff --git a/usbboot/src/ingenic_cfg.h b/usbboot/src/ingenic_cfg.h index c5ab7d9..c5af31a 100644 --- a/usbboot/src/ingenic_cfg.h +++ b/usbboot/src/ingenic_cfg.h @@ -1,10 +1,19 @@ /* + * Copyright(C) 2009 Qi Hardware Inc., * 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 - * as published by the Free Software Foundation; either version - * 3 of the License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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, see . */ #ifndef __INGENIC_CFG_H__ diff --git a/usbboot/src/ingenic_usb.c b/usbboot/src/ingenic_usb.c index 0853890..c891814 100644 --- a/usbboot/src/ingenic_usb.c +++ b/usbboot/src/ingenic_usb.c @@ -1,16 +1,25 @@ /* - * Authors: Marek Lindner - * Xiangfu Liu + * Copyright(C) 2009 Qi Hardware Inc., + * 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 as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 3 of the License, or (at your option) any later version. + * 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, see . */ -#include #include #include +#include #include "usb_boot_defines.h" #include "ingenic_usb.h" diff --git a/usbboot/src/ingenic_usb.h b/usbboot/src/ingenic_usb.h index b2cf85b..9af7b72 100644 --- a/usbboot/src/ingenic_usb.h +++ b/usbboot/src/ingenic_usb.h @@ -1,11 +1,20 @@ /* + * Copyright(C) 2009 Qi Hardware Inc., * 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 - * as published by the Free Software Foundation; either version - * 3 of the License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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, see . */ #ifndef __INGENIC_USB_H__ diff --git a/usbboot/src/main.c b/usbboot/src/main.c index 12beace..5a28119 100644 --- a/usbboot/src/main.c +++ b/usbboot/src/main.c @@ -1,10 +1,19 @@ /* + * Copyright(C) 2009 Qi Hardware Inc., * 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 - * as published by the Free Software Foundation; either version - * 3 of the License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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, see . */ #include diff --git a/usbboot/src/usb_boot_defines.h b/usbboot/src/usb_boot_defines.h index c4dc779..8b11f0f 100644 --- a/usbboot/src/usb_boot_defines.h +++ b/usbboot/src/usb_boot_defines.h @@ -1,10 +1,20 @@ /* + * Copyright(C) 2009 Qi Hardware Inc., * 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 - * as published by the Free Software Foundation; either version - * 3 of the License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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, see . */ #ifndef __USB_BOOT_DEFINES_H__ diff --git a/usbboot/src/usbboot.cfg b/usbboot/src/usbboot.cfg index 55fa7fa..7ba868e 100644 --- a/usbboot/src/usbboot.cfg +++ b/usbboot/src/usbboot.cfg @@ -9,11 +9,18 @@ # Marek Lindner # Wolfgang Spraul # -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version -# 3 of the License, or (at your option) any later version. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # +# 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, see . # [PLL] EXTCLK = 12 #Define the external crystal in MHz diff --git a/usbboot/xburst_stage2/nandflash_4740.c b/usbboot/xburst_stage2/nandflash_4740.c index acfe490..447633e 100644 --- a/usbboot/xburst_stage2/nandflash_4740.c +++ b/usbboot/xburst_stage2/nandflash_4740.c @@ -262,11 +262,11 @@ static int nand_check_block(u32 block) } /* - * Read data pages from page. + * Read data pages from page. * Don't skip bad block. * Don't use HW ECC. */ -u32 nand_read_raw_4740(void *buf, u32 startpage, u32 pagenum, int option) +u32 nand_read_raw_4740(void *buf, u32 startpage, u32 pagecount, int option) { u32 cnt, j; u32 cur_page, rowaddr; @@ -276,7 +276,7 @@ u32 nand_read_raw_4740(void *buf, u32 startpage, u32 pagenum, int option) cur_page = startpage; cnt = 0; - while (cnt < pagenum) { + while (cnt < pagecount) { select_chip(cnt / ppb); if ((cur_page % ppb) == 0) { if (nand_check_block(cur_page / ppb)) { @@ -431,11 +431,11 @@ void rs_correct(unsigned char *buf, int idx, int mask) } /* - * Read data pages from page. + * Read data pages from page. * Skip bad block if detected. * HW ECC is used. */ -u32 nand_read_4740(void *buf, u32 startpage, u32 pagenum, int option) +u32 nand_read_4740(void *buf, u32 startpage, u32 pagecount, int option) { u32 j, k; u32 cur_page, cur_blk, cnt, rowaddr, ecccnt; @@ -446,7 +446,7 @@ u32 nand_read_4740(void *buf, u32 startpage, u32 pagenum, int option) tmpbuf = buf; handshake_PKT[3] = 0; - while (cnt < pagenum) { + while (cnt < pagecount) { select_chip(cnt / ppb); /* If this is the first page of the block, check for bad. */ if ((cur_page % ppb) == 0) { @@ -496,12 +496,11 @@ u32 nand_read_4740(void *buf, u32 startpage, u32 pagenum, int option) if (stat & EMC_NFINTS_ERR) { if (stat & EMC_NFINTS_UNCOR) { if (flag) { - serial_puts("\nUncorrectable error occurred\n"); + serial_puts("\nUncorrectable error occurred, Page:"); serial_put_hex(cur_page); handshake_PKT[3] = 1; } - } - else { + } else { handshake_PKT[3] = 0; u32 errcnt = (stat & EMC_NFINTS_ERRCNT_MASK) >> EMC_NFINTS_ERRCNT_BIT; switch (errcnt) { @@ -524,8 +523,7 @@ u32 nand_read_4740(void *buf, u32 startpage, u32 pagenum, int option) tmpbuf += ECC_BLOCK; } - switch (option) - { + switch (option) { case OOB_ECC: for (j = 0; j < oobsize; j++) tmpbuf[j] = oob_buf[j]; @@ -701,8 +699,8 @@ restart: /* page program error */ if (__nand_data8() & 0x01) { serial_puts("Skip a write fail block\n"); - nand_erase_4740( 1, cur/ppb, 1); //force erase before - nand_mark_bad_4740(cur/ppb); + nand_erase_4740(1, cur/ppb, 1); //force erase before + nand_mark_bad_4740(cur / ppb); spage += ppb; goto restart; } diff --git a/usbboot/xburst_stage2/serial.c b/usbboot/xburst_stage2/serial.c index f951a77..fe74bba 100644 --- a/usbboot/xburst_stage2/serial.c +++ b/usbboot/xburst_stage2/serial.c @@ -102,5 +102,4 @@ void serial_put_hex(unsigned int d) c[8] = '\n'; c[9] = 0; serial_puts(c); - }