mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-11-26 10:03:13 +02:00
cleanup the GPL info.
Signed-off-by: Xiangfu Liu <xiangfu.z@gmail.com>
This commit is contained in:
parent
e8b1b896f4
commit
0ecb32a9bc
@ -1,11 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright(C) 2009 Qi Hardware Inc.,
|
||||||
* Authors: Marek Lindner <lindner_marek@yahoo.de>
|
* Authors: Marek Lindner <lindner_marek@yahoo.de>
|
||||||
* Xiangfu Liu <xiangfu@qi-hardware.com>
|
* Xiangfu Liu <xiangfu@qi-hardware.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* modify it under the terms of the GNU General Public License
|
* it under the terms of the GNU General Public License as published by
|
||||||
* as published by the Free Software Foundation; either version
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* 3 of the License, or (at your option) any later version.
|
* (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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright(C) 2009 Qi Hardware Inc.,
|
||||||
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* modify it under the terms of the GNU General Public License
|
* it under the terms of the GNU General Public License as published by
|
||||||
* as published by the Free Software Foundation; either version
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* 3 of the License, or (at your option) any later version.
|
* (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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CMD_H__
|
#ifndef __CMD_H__
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright(C) 2009 Qi Hardware Inc.,
|
||||||
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* modify it under the terms of the GNU General Public License
|
* it under the terms of the GNU General Public License as published by
|
||||||
* as published by the Free Software Foundation; either version
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* 3 of the License, or (at your option) any later version.
|
* (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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright(C) 2009 Qi Hardware Inc.,
|
||||||
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* modify it under the terms of the GNU General Public License
|
* it under the terms of the GNU General Public License as published by
|
||||||
* as published by the Free Software Foundation; either version
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* 3 of the License, or (at your option) any later version.
|
* (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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __COMMAND_LINE_H__
|
#ifndef __COMMAND_LINE_H__
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright(C) 2009 Qi Hardware Inc.,
|
||||||
* Authors: Marek Lindner <lindner_marek@yahoo.de>
|
* Authors: Marek Lindner <lindner_marek@yahoo.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* modify it under the terms of the GNU General Public License
|
* it under the terms of the GNU General Public License as published by
|
||||||
* as published by the Free Software Foundation; either version
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* 3 of the License, or (at your option) any later version.
|
* (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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright(C) 2009 Qi Hardware Inc.,
|
||||||
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* modify it under the terms of the GNU General Public License
|
* it under the terms of the GNU General Public License as published by
|
||||||
* as published by the Free Software Foundation; either version
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* 3 of the License, or (at your option) any later version.
|
* (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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __INGENIC_CFG_H__
|
#ifndef __INGENIC_CFG_H__
|
||||||
|
@ -1,16 +1,25 @@
|
|||||||
/*
|
/*
|
||||||
* Authors: Marek Lindner <lindner_marek@yahoo.de>
|
* Copyright(C) 2009 Qi Hardware Inc.,
|
||||||
* Xiangfu Liu <xiangfu@qi-hardware.com>
|
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
||||||
|
* Marek Lindner <lindner_marek@yahoo.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* modify it under the terms of the GNU General Public License
|
* it under the terms of the GNU General Public License as published by
|
||||||
* as published by the Free Software Foundation; either version
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* 3 of the License, or (at your option) any later version.
|
* (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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <usb.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <usb.h>
|
||||||
#include "usb_boot_defines.h"
|
#include "usb_boot_defines.h"
|
||||||
#include "ingenic_usb.h"
|
#include "ingenic_usb.h"
|
||||||
|
|
||||||
|
@ -1,11 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright(C) 2009 Qi Hardware Inc.,
|
||||||
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
||||||
* Marek Lindner <lindner_marek@yahoo.de>
|
* Marek Lindner <lindner_marek@yahoo.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* modify it under the terms of the GNU General Public License
|
* it under the terms of the GNU General Public License as published by
|
||||||
* as published by the Free Software Foundation; either version
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* 3 of the License, or (at your option) any later version.
|
* (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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __INGENIC_USB_H__
|
#ifndef __INGENIC_USB_H__
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright(C) 2009 Qi Hardware Inc.,
|
||||||
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
* Authors: Xiangfu Liu <xiangfu@qi-hardware.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* modify it under the terms of the GNU General Public License
|
* it under the terms of the GNU General Public License as published by
|
||||||
* as published by the Free Software Foundation; either version
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* 3 of the License, or (at your option) any later version.
|
* (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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -1,10 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright(C) 2009 Qi Hardware Inc.,
|
||||||
* Authors: Marek Lindner <lindner_marek@yahoo.de>
|
* Authors: Marek Lindner <lindner_marek@yahoo.de>
|
||||||
|
* Xiangfu Liu <xiangfu@qi-hardware.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* modify it under the terms of the GNU General Public License
|
* it under the terms of the GNU General Public License as published by
|
||||||
* as published by the Free Software Foundation; either version
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* 3 of the License, or (at your option) any later version.
|
* (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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __USB_BOOT_DEFINES_H__
|
#ifndef __USB_BOOT_DEFINES_H__
|
||||||
|
@ -9,11 +9,18 @@
|
|||||||
# Marek Lindner <lindner_marek@yahoo.de>
|
# Marek Lindner <lindner_marek@yahoo.de>
|
||||||
# Wolfgang Spraul <wolfgang@qi-hardware.com>
|
# Wolfgang Spraul <wolfgang@qi-hardware.com>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# modify it under the terms of the GNU General Public License
|
# it under the terms of the GNU General Public License as published by
|
||||||
# as published by the Free Software Foundation; either version
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# 3 of the License, or (at your option) any later version.
|
# (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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# [PLL]
|
# [PLL]
|
||||||
EXTCLK = 12 #Define the external crystal in MHz
|
EXTCLK = 12 #Define the external crystal in MHz
|
||||||
|
@ -262,11 +262,11 @@ static int nand_check_block(u32 block)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read data <pagenum> pages from <startpage> page.
|
* Read data <pagecount> pages from <startpage> page.
|
||||||
* Don't skip bad block.
|
* Don't skip bad block.
|
||||||
* Don't use HW ECC.
|
* 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 cnt, j;
|
||||||
u32 cur_page, rowaddr;
|
u32 cur_page, rowaddr;
|
||||||
@ -276,7 +276,7 @@ u32 nand_read_raw_4740(void *buf, u32 startpage, u32 pagenum, int option)
|
|||||||
|
|
||||||
cur_page = startpage;
|
cur_page = startpage;
|
||||||
cnt = 0;
|
cnt = 0;
|
||||||
while (cnt < pagenum) {
|
while (cnt < pagecount) {
|
||||||
select_chip(cnt / ppb);
|
select_chip(cnt / ppb);
|
||||||
if ((cur_page % ppb) == 0) {
|
if ((cur_page % ppb) == 0) {
|
||||||
if (nand_check_block(cur_page / ppb)) {
|
if (nand_check_block(cur_page / ppb)) {
|
||||||
@ -431,11 +431,11 @@ void rs_correct(unsigned char *buf, int idx, int mask)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read data <pagenum> pages from <startpage> page.
|
* Read data <pagecount> pages from <startpage> page.
|
||||||
* Skip bad block if detected.
|
* Skip bad block if detected.
|
||||||
* HW ECC is used.
|
* 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 j, k;
|
||||||
u32 cur_page, cur_blk, cnt, rowaddr, ecccnt;
|
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;
|
tmpbuf = buf;
|
||||||
handshake_PKT[3] = 0;
|
handshake_PKT[3] = 0;
|
||||||
|
|
||||||
while (cnt < pagenum) {
|
while (cnt < pagecount) {
|
||||||
select_chip(cnt / ppb);
|
select_chip(cnt / ppb);
|
||||||
/* If this is the first page of the block, check for bad. */
|
/* If this is the first page of the block, check for bad. */
|
||||||
if ((cur_page % ppb) == 0) {
|
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_ERR) {
|
||||||
if (stat & EMC_NFINTS_UNCOR) {
|
if (stat & EMC_NFINTS_UNCOR) {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
serial_puts("\nUncorrectable error occurred\n");
|
serial_puts("\nUncorrectable error occurred, Page:");
|
||||||
serial_put_hex(cur_page);
|
serial_put_hex(cur_page);
|
||||||
handshake_PKT[3] = 1;
|
handshake_PKT[3] = 1;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
handshake_PKT[3] = 0;
|
handshake_PKT[3] = 0;
|
||||||
u32 errcnt = (stat & EMC_NFINTS_ERRCNT_MASK) >> EMC_NFINTS_ERRCNT_BIT;
|
u32 errcnt = (stat & EMC_NFINTS_ERRCNT_MASK) >> EMC_NFINTS_ERRCNT_BIT;
|
||||||
switch (errcnt) {
|
switch (errcnt) {
|
||||||
@ -524,8 +523,7 @@ u32 nand_read_4740(void *buf, u32 startpage, u32 pagenum, int option)
|
|||||||
tmpbuf += ECC_BLOCK;
|
tmpbuf += ECC_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (option)
|
switch (option) {
|
||||||
{
|
|
||||||
case OOB_ECC:
|
case OOB_ECC:
|
||||||
for (j = 0; j < oobsize; j++)
|
for (j = 0; j < oobsize; j++)
|
||||||
tmpbuf[j] = oob_buf[j];
|
tmpbuf[j] = oob_buf[j];
|
||||||
@ -701,8 +699,8 @@ restart:
|
|||||||
/* page program error */
|
/* page program error */
|
||||||
if (__nand_data8() & 0x01) {
|
if (__nand_data8() & 0x01) {
|
||||||
serial_puts("Skip a write fail block\n");
|
serial_puts("Skip a write fail block\n");
|
||||||
nand_erase_4740( 1, cur/ppb, 1); //force erase before
|
nand_erase_4740(1, cur/ppb, 1); //force erase before
|
||||||
nand_mark_bad_4740(cur/ppb);
|
nand_mark_bad_4740(cur / ppb);
|
||||||
spage += ppb;
|
spage += ppb;
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
|
@ -102,5 +102,4 @@ void serial_put_hex(unsigned int d)
|
|||||||
c[8] = '\n';
|
c[8] = '\n';
|
||||||
c[9] = 0;
|
c[9] = 0;
|
||||||
serial_puts(c);
|
serial_puts(c);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user