Commit 998eaaec authored by wdenk's avatar wdenk

* Configure PPChameleon board to use redundand environment in flash

* Configure PPChameleon board to use JFFS2 NAND support.

* Added support for JFFS2 filesystem (read-only) on top of NAND flash
parent 6e592385
......@@ -2,6 +2,12 @@
Changes for U-Boot 1.1.1:
======================================================================
* Configure PPChameleon board to use redundand environment in flash
* Configure PPChameleon board to use JFFS2 NAND support.
* Added support for JFFS2 filesystem (read-only) on top of NAND flash
* Patch by Rune Torgersen, 16 Apr 2004:
LBA48 fixes
......
......@@ -73,9 +73,6 @@ SECTIONS
lib_ppc/extable.o (.text)
lib_generic/zlib.o (.text)
/* . = env_offset;*/
/* common/environment.o(.text)*/
*(.text)
*(.fixup)
*(.got1)
......@@ -142,6 +139,13 @@ SECTIONS
*(.bss)
*(COMMON)
}
. = 0xFFFF8000;
.ppcenv :
{
common/environment.o(.ppcenv);
}
_end = . ;
PROVIDE (end = .);
}
......@@ -669,8 +669,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
int i;
/* Check if Flash is (sufficiently) erased */
if ((*((volatile CFG_FLASH_WORD_SIZE *)dest) &
(CFG_FLASH_WORD_SIZE)data) != (CFG_FLASH_WORD_SIZE)data) {
if ((*((volatile ulong *)dest) & data) != data) {
return (2);
}
/* Disable interrupts which might cause a timeout here */
......
......@@ -49,6 +49,8 @@ static int part_num=0;
static struct part_info part;
#ifndef CONFIG_JFFS2_NAND
struct part_info*
jffs2_part_info(int part_num)
{
......@@ -88,6 +90,33 @@ jffs2_part_info(int part_num)
}
return 0;
}
#else /* CONFIG_JFFS2_NAND */
struct part_info*
jffs2_part_info(int part_num)
{
if(part_num==0){
if(part.usr_priv==(void*)1)
return ∂
memset(&part, 0, sizeof(part));
part.offset = CONFIG_JFFS2_NAND_OFF;
part.size = CONFIG_JFFS2_NAND_SIZE; /* the bigger size the slower jffs2 */
#ifndef CONFIG_JFFS2_NAND_DEV
#define CONFIG_JFFS2_NAND_DEV 0
#endif
/* nand device with the JFFS2 parition plus 1 */
part.usr_priv = (void*)(CONFIG_JFFS2_NAND_DEV+1);
return ∂
}
return 0;
}
#endif /* CONFIG_JFFS2_NAND */
#endif /* ifndef CFG_JFFS_CUSTOM_PART */
int
......
......@@ -232,7 +232,7 @@ int do_nand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
&total, (u_char*)addr);
printf (" %d bytes %s: %s\n", total,
(cmd & NANDRW_READ) ? "read" : "write",
(cmd & NANDRW_READ) ? "read" : "written",
ret ? "ERROR" : "OK");
return ret;
......@@ -1669,4 +1669,17 @@ static int nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc)
}
#endif
#ifdef CONFIG_JFFS2_NAND
int read_jffs2_nand(size_t start, size_t len,
size_t * retlen, u_char * buf, int nanddev)
{
return nand_rw(nand_dev_desc + nanddev, NANDRW_READ | NANDRW_JFFS2,
start, len, retlen, buf);
}
#endif /* CONFIG_JFFS2_NAND */
#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */
......@@ -53,7 +53,8 @@
defined(CONFIG_R360MPI) || \
defined(CONFIG_TQM8xxL) || \
defined(CONFIG_RRVISION) || \
defined(CONFIG_TRAB) ) && \
defined(CONFIG_TRAB) || \
defined(CONFIG_PPCHAMELEONEVB) ) && \
defined(ENV_CRC) /* Environment embedded in U-Boot .ppcenv section */
/* XXX - This only works with GNU C */
# define __PPCENV__ __attribute__ ((section(".ppcenv")))
......
JFFS2 NAND support:
To ebable, use the following #define in the board configuration file:
#define CONFIG_JFFS2_NAND 1
Configuration of partitions is similar to how this is done in U-Boot
for JFFS2 on top NOR flash. If a single parition is used, it can be
configured using the following #defines in the configuration file:
#define CONFIG_JFFS2_NAND_DEV 0 /* nand device jffs2 lives on */
#define CONFIG_JFFS2_NAND_OFF 0 /* start of jffs2 partition */
#define CONFIG_JFFS2_NAND_SIZE 2*1024*1024 /* size of jffs2 partition */
If more than a single partition is desired, the user can define a
CFG_JFFS_CUSTOM_PART macro and implement a
struct part_info* jffs2_part_info(int part_num)
function in a board-specific module. An example of such function is
available in common/cmd_jffs2.c
The default configuration for the DAVE board has a single JFFS2
partition of 2 MB size.
This diff is collapsed.
......@@ -93,7 +93,8 @@
CFG_CMD_I2C | \
CFG_CMD_IRQ | \
CFG_CMD_MII | \
CFG_CMD_NAND )
CFG_CMD_NAND | \
CFG_CMD_JFFS2)
#define CONFIG_MAC_PARTITION
#define CONFIG_DOS_PARTITION
......@@ -345,10 +346,11 @@
/*-----------------------------------------------------------------------
* Environment Variable setup
*/
#define CFG_ENV_IS_IN_EEPROM 1 /* use EEPROM for environment vars */
#define CFG_ENV_OFFSET 0x100 /* environment starts at the beginning of the EEPROM */
#define CFG_ENV_SIZE 0x700 /* 2048 bytes may be used for env vars*/
/* total size of a CAT24WC16 is 2048 bytes */
#define CFG_ENV_IS_IN_FLASH 1 /* use FLASH for environment vars */
#define CFG_ENV_ADDR 0xFFFF8000 /* environment starts at the first small sector */
#define CFG_ENV_SECT_SIZE 0x2000 /* 8196 bytes may be used for env vars*/
#define CFG_ENV_ADDR_REDUND 0xFFFFA000
#define CFG_ENV_SIZE_REDUND 0x2000
#define CFG_NVRAM_BASE_ADDR 0xF0000500 /* NVRAM base address */
#define CFG_NVRAM_SIZE 242 /* NVRAM size */
......@@ -694,4 +696,10 @@
#endif /* CONFIG_NO_SERIAL_EEPROM */
#define CONFIG_JFFS2_NAND 1 /* jffs2 on nand support */
#define CONFIG_JFFS2_NAND_DEV 0 /* nand device jffs2 lives on */
#define CONFIG_JFFS2_NAND_OFF 0 /* start of jffs2 partition */
#define CONFIG_JFFS2_NAND_SIZE 2*1024*1024 /* size of jffs2 partition */
#define NAND_CACHE_PAGES 16 /* size of nand cache in 512 bytes pages */
#endif /* __CONFIG_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment