mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-17 07:56:25 -04:00
* Back out Patch by Christian Hohnstaedt, 23 Apr 2004:
(JFFS2 speed enhancements) because of using non-public data (PHYS_FLASH_SECT_SIZE) * Patch by Travis Sawyer, 23 Apr 2004: Fix VSC/CIS 8201 phy descrambler interoperability timing due to errata from Vitesse Semiconductor.
This commit is contained in:
parent
0b8fa03b6d
commit
fc1cfcdb12
11
CHANGELOG
11
CHANGELOG
@ -2,14 +2,9 @@
|
|||||||
Changes for U-Boot 1.1.1:
|
Changes for U-Boot 1.1.1:
|
||||||
======================================================================
|
======================================================================
|
||||||
|
|
||||||
* Patch by Christian Hohnstaedt, 23 Apr 2004:
|
* Patch by Travis Sawyer, 23 Apr 2004:
|
||||||
JFFS2 speed enhancements:
|
Fix VSC/CIS 8201 phy descrambler interoperability timing due to
|
||||||
- repair header CRC calculation in jffs2_1pass.c
|
errata from Vitesse Semiconductor.
|
||||||
- add eraseblock size to the partition information to skip empty
|
|
||||||
eraseblocks if we find more then 4k of free space.
|
|
||||||
- The JFFS2 scanner is now fast enough to remove the spinning wheel
|
|
||||||
so #ifdef-ed out.
|
|
||||||
- add watchdog calls in long running loops
|
|
||||||
|
|
||||||
* Patch by Philippe Robin, 22 Apr 2004:
|
* Patch by Philippe Robin, 22 Apr 2004:
|
||||||
Fix ethernet configuration for "versatile" board
|
Fix ethernet configuration for "versatile" board
|
||||||
|
@ -80,14 +80,8 @@ jffs2_part_info(int part_num)
|
|||||||
flash_info[CFG_JFFS2_FIRST_BANK].start[0];
|
flash_info[CFG_JFFS2_FIRST_BANK].start[0];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* FIXME: Fast hack to get erase size set */
|
/* unused in current jffs2 loader */
|
||||||
|
part.erasesize = 0;
|
||||||
/* We assume that our JFFS2 partition has
|
|
||||||
* all erase blocks with the same size
|
|
||||||
* If we have a clue about the erasesize
|
|
||||||
* we can skip empty blocks
|
|
||||||
*/
|
|
||||||
part.erasesize = PHYS_FLASH_SECT_SIZE;
|
|
||||||
|
|
||||||
/* Mark the struct as ready */
|
/* Mark the struct as ready */
|
||||||
part.usr_priv=(void*)1;
|
part.usr_priv=(void*)1;
|
||||||
|
@ -437,6 +437,22 @@ static int ppc_440x_eth_init (struct eth_device *dev, bd_t * bis)
|
|||||||
*/
|
*/
|
||||||
if ( ((devnum == 2) || (devnum ==3)) && (4 == ethgroup) ) {
|
if ( ((devnum == 2) || (devnum ==3)) && (4 == ethgroup) ) {
|
||||||
miiphy_write (reg, 23, 0x1200);
|
miiphy_write (reg, 23, 0x1200);
|
||||||
|
/*
|
||||||
|
* Vitesse VSC8201/Cicada CIS8201 errata:
|
||||||
|
* Interoperability problem with Intel 82547EI phys
|
||||||
|
* This work around (provided by Vitesse) changes
|
||||||
|
* the default timer convergence from 8ms to 12ms
|
||||||
|
*/
|
||||||
|
miiphy_write (reg, 0x1f, 0x2a30);
|
||||||
|
miiphy_write (reg, 0x08, 0x0200);
|
||||||
|
miiphy_write (reg, 0x1f, 0x52b5);
|
||||||
|
miiphy_write (reg, 0x02, 0x0004);
|
||||||
|
miiphy_write (reg, 0x01, 0x0671);
|
||||||
|
miiphy_write (reg, 0x00, 0x8fae);
|
||||||
|
miiphy_write (reg, 0x1f, 0x2a30);
|
||||||
|
miiphy_write (reg, 0x08, 0x0000);
|
||||||
|
miiphy_write (reg, 0x1f, 0x0000);
|
||||||
|
/* end Vitesse/Cicada errata */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -114,7 +114,6 @@
|
|||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <watchdog.h>
|
|
||||||
#include <linux/stat.h>
|
#include <linux/stat.h>
|
||||||
#include <linux/time.h>
|
#include <linux/time.h>
|
||||||
|
|
||||||
@ -127,7 +126,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define NODE_CHUNK 1024 /* size of memory allocation chunk in b_nodes */
|
#define NODE_CHUNK 1024 /* size of memory allocation chunk in b_nodes */
|
||||||
#define SPIN_BLKSIZE 20 /* spin after having scanned 1<<BLKSIZE bytes */
|
#define SPIN_BLKSIZE 18 /* spin after having scanned 1<<BLKSIZE bytes */
|
||||||
|
|
||||||
/* Debugging switches */
|
/* Debugging switches */
|
||||||
#undef DEBUG_DIRENTS /* print directory entry list after scan */
|
#undef DEBUG_DIRENTS /* print directory entry list after scan */
|
||||||
@ -277,10 +276,8 @@ static char *compr_names[] = {
|
|||||||
"ZLIB"
|
"ZLIB"
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 0 /* Use spinning wheel */
|
|
||||||
/* Spinning wheel */
|
/* Spinning wheel */
|
||||||
static char spinner[] = { '|', '/', '-', '\\' };
|
static char spinner[] = { '|', '/', '-', '\\' };
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Memory management */
|
/* Memory management */
|
||||||
struct mem_block {
|
struct mem_block {
|
||||||
@ -457,24 +454,15 @@ jffs2_scan_empty(u32 start_offset, struct part_info *part)
|
|||||||
{
|
{
|
||||||
char *max = part->offset + part->size - sizeof(struct jffs2_raw_inode);
|
char *max = part->offset + part->size - sizeof(struct jffs2_raw_inode);
|
||||||
char *offset = part->offset + start_offset;
|
char *offset = part->offset + start_offset;
|
||||||
int cntr = 0;
|
|
||||||
u32 off;
|
u32 off;
|
||||||
|
|
||||||
while (offset < max &&
|
while (offset < max &&
|
||||||
*(u32*)get_fl_mem((u32)offset, sizeof(u32), &off) == 0xFFFFFFFF) {
|
*(u32*)get_fl_mem((u32)offset, sizeof(u32), &off) == 0xFFFFFFFF) {
|
||||||
offset += sizeof(u32);
|
offset += sizeof(u32);
|
||||||
cntr++;
|
|
||||||
#if 0 /* Use spinning wheel */
|
|
||||||
/* return if spinning is due */
|
/* return if spinning is due */
|
||||||
if (((u32)offset & ((1 << SPIN_BLKSIZE)-1)) == 0) break;
|
if (((u32)offset & ((1 << SPIN_BLKSIZE)-1)) == 0) break;
|
||||||
#endif
|
|
||||||
if (cntr > 1024 && part->erasesize > 0) { /* 4k */
|
|
||||||
/* round up to next erase block border */
|
|
||||||
(u32)offset |= part->erasesize-1;
|
|
||||||
offset++;
|
|
||||||
cntr = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return offset - part->offset;
|
return offset - part->offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -933,9 +921,6 @@ jffs2_1pass_search_list_inodes(struct b_lists * pL, const char *fname, u32 pino)
|
|||||||
for (i = 0; i < strlen(c) - 1; i++)
|
for (i = 0; i < strlen(c) - 1; i++)
|
||||||
tmp[i] = c[i + 1];
|
tmp[i] = c[i + 1];
|
||||||
tmp[i] = '\0';
|
tmp[i] = '\0';
|
||||||
|
|
||||||
WATCHDOG_RESET();
|
|
||||||
|
|
||||||
/* only a failure if we arent looking at top level */
|
/* only a failure if we arent looking at top level */
|
||||||
if (!(pino = jffs2_1pass_find_inode(pL, working_tmp, pino)) &&
|
if (!(pino = jffs2_1pass_find_inode(pL, working_tmp, pino)) &&
|
||||||
(working_tmp[0])) {
|
(working_tmp[0])) {
|
||||||
@ -1076,15 +1061,12 @@ jffs2_1pass_build_lists(struct part_info * part)
|
|||||||
{
|
{
|
||||||
struct b_lists *pL;
|
struct b_lists *pL;
|
||||||
struct jffs2_unknown_node *node;
|
struct jffs2_unknown_node *node;
|
||||||
struct jffs2_unknown_node crcnode;
|
|
||||||
u32 offset, oldoffset = 0;
|
u32 offset, oldoffset = 0;
|
||||||
u32 max = part->size - sizeof(struct jffs2_raw_inode);
|
u32 max = part->size - sizeof(struct jffs2_raw_inode);
|
||||||
u32 counter = 0;
|
u32 counter = 0;
|
||||||
u32 counter4 = 0;
|
u32 counter4 = 0;
|
||||||
u32 counterF = 0;
|
u32 counterF = 0;
|
||||||
u32 counterN = 0;
|
u32 counterN = 0;
|
||||||
u32 counterCRC = 0;
|
|
||||||
u32 counterUNK = 0;
|
|
||||||
|
|
||||||
#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
|
#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
|
||||||
nanddev = (int)part->usr_priv - 1;
|
nanddev = (int)part->usr_priv - 1;
|
||||||
@ -1105,26 +1087,14 @@ jffs2_1pass_build_lists(struct part_info * part)
|
|||||||
/* start at the beginning of the partition */
|
/* start at the beginning of the partition */
|
||||||
while (offset < max) {
|
while (offset < max) {
|
||||||
if ((oldoffset >> SPIN_BLKSIZE) != (offset >> SPIN_BLKSIZE)) {
|
if ((oldoffset >> SPIN_BLKSIZE) != (offset >> SPIN_BLKSIZE)) {
|
||||||
WATCHDOG_RESET();
|
|
||||||
#if 0 /* Use spinning wheel */
|
|
||||||
printf("\b\b%c ", spinner[counter++ % sizeof(spinner)]);
|
printf("\b\b%c ", spinner[counter++ % sizeof(spinner)]);
|
||||||
#endif
|
|
||||||
oldoffset = offset;
|
oldoffset = offset;
|
||||||
}
|
}
|
||||||
node = (struct jffs2_unknown_node *) get_node_mem((u32)part->offset + offset);
|
|
||||||
if (node->magic == JFFS2_MAGIC_BITMASK) {
|
|
||||||
/* if its a fragment add it */
|
|
||||||
/* check crc by readding a JFFS2_NODE_ACCURATE */
|
|
||||||
crcnode.magic = node->magic;
|
|
||||||
crcnode.nodetype = node->nodetype | JFFS2_NODE_ACCURATE;
|
|
||||||
crcnode.totlen = node->totlen;
|
|
||||||
crcnode.hdr_crc = node->hdr_crc;
|
|
||||||
|
|
||||||
if (!hdr_crc(&crcnode)) {
|
node = (struct jffs2_unknown_node *) get_node_mem((u32)part->offset + offset);
|
||||||
offset += 4;
|
if (node->magic == JFFS2_MAGIC_BITMASK && hdr_crc(node)) {
|
||||||
counterCRC++;
|
/* if its a fragment add it */
|
||||||
continue;
|
if (node->nodetype == JFFS2_NODETYPE_INODE &&
|
||||||
} else if (node->nodetype == JFFS2_NODETYPE_INODE &&
|
|
||||||
inode_crc((struct jffs2_raw_inode *) node)) {
|
inode_crc((struct jffs2_raw_inode *) node)) {
|
||||||
if (insert_node(&pL->frag, (u32) part->offset +
|
if (insert_node(&pL->frag, (u32) part->offset +
|
||||||
offset) == NULL) {
|
offset) == NULL) {
|
||||||
@ -1134,12 +1104,8 @@ jffs2_1pass_build_lists(struct part_info * part)
|
|||||||
} else if (node->nodetype == JFFS2_NODETYPE_DIRENT &&
|
} else if (node->nodetype == JFFS2_NODETYPE_DIRENT &&
|
||||||
dirent_crc((struct jffs2_raw_dirent *) node) &&
|
dirent_crc((struct jffs2_raw_dirent *) node) &&
|
||||||
dirent_name_crc((struct jffs2_raw_dirent *) node)) {
|
dirent_name_crc((struct jffs2_raw_dirent *) node)) {
|
||||||
if (! (counterN%128))
|
if (! (counterN%100))
|
||||||
#if 0 /* Use spinning wheel */
|
|
||||||
puts ("\b\b. ");
|
puts ("\b\b. ");
|
||||||
#else
|
|
||||||
puts (".");
|
|
||||||
#endif
|
|
||||||
if (insert_node(&pL->dir, (u32) part->offset +
|
if (insert_node(&pL->dir, (u32) part->offset +
|
||||||
offset) == NULL) {
|
offset) == NULL) {
|
||||||
put_fl_mem(node);
|
put_fl_mem(node);
|
||||||
@ -1157,7 +1123,9 @@ jffs2_1pass_build_lists(struct part_info * part)
|
|||||||
"%d < %d\n", node->totlen,
|
"%d < %d\n", node->totlen,
|
||||||
sizeof(struct jffs2_unknown_node));
|
sizeof(struct jffs2_unknown_node));
|
||||||
} else {
|
} else {
|
||||||
counterUNK++;
|
printf("Unknown node type: %x len %d "
|
||||||
|
"offset 0x%x\n", node->nodetype,
|
||||||
|
node->totlen, offset);
|
||||||
}
|
}
|
||||||
offset += ((node->totlen + 3) & ~3);
|
offset += ((node->totlen + 3) & ~3);
|
||||||
counterF++;
|
counterF++;
|
||||||
@ -1181,8 +1149,6 @@ jffs2_1pass_build_lists(struct part_info * part)
|
|||||||
putLabeledWord("frag entries = ", pL->frag.listCount);
|
putLabeledWord("frag entries = ", pL->frag.listCount);
|
||||||
putLabeledWord("+4 increments = ", counter4);
|
putLabeledWord("+4 increments = ", counter4);
|
||||||
putLabeledWord("+file_offset increments = ", counterF);
|
putLabeledWord("+file_offset increments = ", counterF);
|
||||||
putLabeledWord("Unknown node types = ", counterUNK);
|
|
||||||
putLabeledWord("Bad hdr_crc = ", counterCRC);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1238,7 +1204,6 @@ jffs2_get_list(struct part_info * part, const char *who)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WATCHDOG_RESET();
|
|
||||||
return (struct b_lists *)part->jffs2_priv;
|
return (struct b_lists *)part->jffs2_priv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1248,21 +1213,24 @@ u32
|
|||||||
jffs2_1pass_ls(struct part_info * part, const char *fname)
|
jffs2_1pass_ls(struct part_info * part, const char *fname)
|
||||||
{
|
{
|
||||||
struct b_lists *pl;
|
struct b_lists *pl;
|
||||||
|
long ret = 0;
|
||||||
u32 inode;
|
u32 inode;
|
||||||
|
|
||||||
if (! (pl = jffs2_get_list(part, "ls")))
|
if (! (pl = jffs2_get_list(part, "ls")))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
if (! (inode = jffs2_1pass_search_list_inodes(pl, fname, 1))) {
|
if (! (inode = jffs2_1pass_search_list_inodes(pl, fname, 1))) {
|
||||||
putstr("ls: Failed to scan jffs2 file structure\r\n");
|
putstr("ls: Failed to scan jffs2 file structure\r\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
putLabeledWord("found file at inode = ", inode);
|
putLabeledWord("found file at inode = ", inode);
|
||||||
putLabeledWord("read_inode returns = ", ret);
|
putLabeledWord("read_inode returns = ", ret);
|
||||||
#endif
|
#endif
|
||||||
return inode;
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user