U-Boot
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
May 2009
- 178 participants
- 436 discussions
please pull U-Boot/MIPS repository to pick up the following changes.
Thanks in advance,
Shinya
---
The following changes since commit a2e0ffcf2d9a22c582a93e84a4bef20fd3877f47:
Wolfgang Denk (1):
Prepare v2009.06-rc2
are available in the git repository at:
git://git.denx.de/u-boot-mips.git master
Shinya Kuribayashi (2):
MIPS: Make all extern-ed functions in bitops.h static
MIPS: lib_mips/board.c: Remove unused variables
Thomas Lange (1):
MIPS: Implement ethernet halt for au1x00
cpu/mips/au1x00_eth.c | 4 +++
include/asm-mips/bitops.h | 64 ++++++++++++++++++++++----------------------
lib_mips/board.c | 3 +-
3 files changed, 37 insertions(+), 34 deletions(-)
diff --git a/cpu/mips/au1x00_eth.c b/cpu/mips/au1x00_eth.c
index 6272a3a..5074997 100644
--- a/cpu/mips/au1x00_eth.c
+++ b/cpu/mips/au1x00_eth.c
@@ -276,6 +276,10 @@ static int au1x00_init(struct eth_device* dev, bd_t * bd){
}
static void au1x00_halt(struct eth_device* dev){
+ volatile u32 *macen = (volatile u32*)MAC0_ENABLE;
+
+ /* Put MAC0 in reset */
+ *macen = 0;
}
int au1x00_enet_initialize(bd_t *bis){
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index 56d7225..659ac9d 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -60,7 +60,7 @@
* Note that @nr may be almost arbitrarily large; this function is not
* restricted to acting on a single-word quantity.
*/
-extern __inline__ void
+static __inline__ void
set_bit(int nr, volatile void *addr)
{
unsigned long *m = ((unsigned long *) addr) + (nr >> 5);
@@ -84,7 +84,7 @@ set_bit(int nr, volatile void *addr)
* If it's called on the same region of memory simultaneously, the effect
* may be that only one operation succeeds.
*/
-extern __inline__ void __set_bit(int nr, volatile void * addr)
+static __inline__ void __set_bit(int nr, volatile void * addr)
{
unsigned long * m = ((unsigned long *) addr) + (nr >> 5);
@@ -101,7 +101,7 @@ extern __inline__ void __set_bit(int nr, volatile void * addr)
* you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit()
* in order to ensure changes are visible on other processors.
*/
-extern __inline__ void
+static __inline__ void
clear_bit(int nr, volatile void *addr)
{
unsigned long *m = ((unsigned long *) addr) + (nr >> 5);
@@ -125,7 +125,7 @@ clear_bit(int nr, volatile void *addr)
* Note that @nr may be almost arbitrarily large; this function is not
* restricted to acting on a single-word quantity.
*/
-extern __inline__ void
+static __inline__ void
change_bit(int nr, volatile void *addr)
{
unsigned long *m = ((unsigned long *) addr) + (nr >> 5);
@@ -149,7 +149,7 @@ change_bit(int nr, volatile void *addr)
* If it's called on the same region of memory simultaneously, the effect
* may be that only one operation succeeds.
*/
-extern __inline__ void __change_bit(int nr, volatile void * addr)
+static __inline__ void __change_bit(int nr, volatile void * addr)
{
unsigned long * m = ((unsigned long *) addr) + (nr >> 5);
@@ -164,7 +164,7 @@ extern __inline__ void __change_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-extern __inline__ int
+static __inline__ int
test_and_set_bit(int nr, volatile void *addr)
{
unsigned long *m = ((unsigned long *) addr) + (nr >> 5);
@@ -194,7 +194,7 @@ test_and_set_bit(int nr, volatile void *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-extern __inline__ int __test_and_set_bit(int nr, volatile void * addr)
+static __inline__ int __test_and_set_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile int *a = addr;
@@ -215,7 +215,7 @@ extern __inline__ int __test_and_set_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-extern __inline__ int
+static __inline__ int
test_and_clear_bit(int nr, volatile void *addr)
{
unsigned long *m = ((unsigned long *) addr) + (nr >> 5);
@@ -246,7 +246,7 @@ test_and_clear_bit(int nr, volatile void *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-extern __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
+static __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile int *a = addr;
@@ -267,7 +267,7 @@ extern __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-extern __inline__ int
+static __inline__ int
test_and_change_bit(int nr, volatile void *addr)
{
unsigned long *m = ((unsigned long *) addr) + (nr >> 5);
@@ -297,7 +297,7 @@ test_and_change_bit(int nr, volatile void *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-extern __inline__ int __test_and_change_bit(int nr, volatile void * addr)
+static __inline__ int __test_and_change_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile int *a = addr;
@@ -322,7 +322,7 @@ extern __inline__ int __test_and_change_bit(int nr, volatile void * addr)
* Note that @nr may be almost arbitrarily large; this function is not
* restricted to acting on a single-word quantity.
*/
-extern __inline__ void set_bit(int nr, volatile void * addr)
+static __inline__ void set_bit(int nr, volatile void * addr)
{
int mask;
volatile int *a = addr;
@@ -344,7 +344,7 @@ extern __inline__ void set_bit(int nr, volatile void * addr)
* If it's called on the same region of memory simultaneously, the effect
* may be that only one operation succeeds.
*/
-extern __inline__ void __set_bit(int nr, volatile void * addr)
+static __inline__ void __set_bit(int nr, volatile void * addr)
{
int mask;
volatile int *a = addr;
@@ -364,7 +364,7 @@ extern __inline__ void __set_bit(int nr, volatile void * addr)
* you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit()
* in order to ensure changes are visible on other processors.
*/
-extern __inline__ void clear_bit(int nr, volatile void * addr)
+static __inline__ void clear_bit(int nr, volatile void * addr)
{
int mask;
volatile int *a = addr;
@@ -386,7 +386,7 @@ extern __inline__ void clear_bit(int nr, volatile void * addr)
* Note that @nr may be almost arbitrarily large; this function is not
* restricted to acting on a single-word quantity.
*/
-extern __inline__ void change_bit(int nr, volatile void * addr)
+static __inline__ void change_bit(int nr, volatile void * addr)
{
int mask;
volatile int *a = addr;
@@ -408,7 +408,7 @@ extern __inline__ void change_bit(int nr, volatile void * addr)
* If it's called on the same region of memory simultaneously, the effect
* may be that only one operation succeeds.
*/
-extern __inline__ void __change_bit(int nr, volatile void * addr)
+static __inline__ void __change_bit(int nr, volatile void * addr)
{
unsigned long * m = ((unsigned long *) addr) + (nr >> 5);
@@ -423,7 +423,7 @@ extern __inline__ void __change_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
+static __inline__ int test_and_set_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile int *a = addr;
@@ -448,7 +448,7 @@ extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-extern __inline__ int __test_and_set_bit(int nr, volatile void * addr)
+static __inline__ int __test_and_set_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile int *a = addr;
@@ -469,7 +469,7 @@ extern __inline__ int __test_and_set_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
+static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile int *a = addr;
@@ -494,7 +494,7 @@ extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-extern __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
+static __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile int *a = addr;
@@ -515,7 +515,7 @@ extern __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
+static __inline__ int test_and_change_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile int *a = addr;
@@ -540,7 +540,7 @@ extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-extern __inline__ int __test_and_change_bit(int nr, volatile void * addr)
+static __inline__ int __test_and_change_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile int *a = addr;
@@ -565,7 +565,7 @@ extern __inline__ int __test_and_change_bit(int nr, volatile void * addr)
* @nr: bit number to test
* @addr: Address to start counting from
*/
-extern __inline__ int test_bit(int nr, volatile void *addr)
+static __inline__ int test_bit(int nr, volatile void *addr)
{
return ((1UL << (nr & 31)) & (((const unsigned int *) addr)[nr >> 5])) != 0;
}
@@ -582,7 +582,7 @@ extern __inline__ int test_bit(int nr, volatile void *addr)
* Returns the bit-number of the first zero bit, not the number of the byte
* containing a bit.
*/
-extern __inline__ int find_first_zero_bit (void *addr, unsigned size)
+static __inline__ int find_first_zero_bit (void *addr, unsigned size)
{
unsigned long dummy;
int res;
@@ -633,7 +633,7 @@ extern __inline__ int find_first_zero_bit (void *addr, unsigned size)
* @offset: The bitnumber to start searching at
* @size: The maximum size to search
*/
-extern __inline__ int find_next_zero_bit (void * addr, int size, int offset)
+static __inline__ int find_next_zero_bit (void * addr, int size, int offset)
{
unsigned int *p = ((unsigned int *) addr) + (offset >> 5);
int set = 0, bit = offset & 31, res;
@@ -679,7 +679,7 @@ extern __inline__ int find_next_zero_bit (void * addr, int size, int offset)
*
* Undefined if no zero exists, so code should check against ~0UL first.
*/
-extern __inline__ unsigned long ffz(unsigned long word)
+static __inline__ unsigned long ffz(unsigned long word)
{
unsigned int __res;
unsigned int mask = 1;
@@ -736,7 +736,7 @@ extern __inline__ unsigned long ffz(unsigned long word)
* @offset: The bitnumber to start searching at
* @size: The maximum size to search
*/
-extern __inline__ int find_next_zero_bit(void *addr, int size, int offset)
+static __inline__ int find_next_zero_bit(void *addr, int size, int offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
unsigned long result = offset & ~31UL;
@@ -785,7 +785,7 @@ found_middle:
* Returns the bit-number of the first zero bit, not the number of the byte
* containing a bit.
*/
-extern int find_first_zero_bit (void *addr, unsigned size);
+static int find_first_zero_bit (void *addr, unsigned size);
#endif
#define find_first_zero_bit(addr, size) \
@@ -796,7 +796,7 @@ extern int find_first_zero_bit (void *addr, unsigned size);
/* Now for the ext2 filesystem bit operations and helper routines. */
#ifdef __MIPSEB__
-extern __inline__ int ext2_set_bit(int nr, void * addr)
+static __inline__ int ext2_set_bit(int nr, void * addr)
{
int mask, retval, flags;
unsigned char *ADDR = (unsigned char *) addr;
@@ -810,7 +810,7 @@ extern __inline__ int ext2_set_bit(int nr, void * addr)
return retval;
}
-extern __inline__ int ext2_clear_bit(int nr, void * addr)
+static __inline__ int ext2_clear_bit(int nr, void * addr)
{
int mask, retval, flags;
unsigned char *ADDR = (unsigned char *) addr;
@@ -824,7 +824,7 @@ extern __inline__ int ext2_clear_bit(int nr, void * addr)
return retval;
}
-extern __inline__ int ext2_test_bit(int nr, const void * addr)
+static __inline__ int ext2_test_bit(int nr, const void * addr)
{
int mask;
const unsigned char *ADDR = (const unsigned char *) addr;
@@ -837,7 +837,7 @@ extern __inline__ int ext2_test_bit(int nr, const void * addr)
#define ext2_find_first_zero_bit(addr, size) \
ext2_find_next_zero_bit((addr), (size), 0)
-extern __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
+static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
unsigned long result = offset & ~31UL;
diff --git a/lib_mips/board.c b/lib_mips/board.c
index 6fc4845..061901e 100644
--- a/lib_mips/board.c
+++ b/lib_mips/board.c
@@ -323,9 +323,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
#ifndef CONFIG_ENV_IS_NOWHERE
extern char * env_name_spec;
#endif
- char *s, *e;
+ char *s;
bd_t *bd;
- int i;
gd = id;
gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
2
3
Dear Wolfgang,
The following changes since commit 89dbfe0fc21d9f2840add7b1a75bbba1bfda38e8:
Wolfgang Denk (1):
Merge branch 'master' into next
are available in the git repository at:
git://git.denx.de/u-boot-video.git next
Wolfgang Denk (2):
drv_video_init(): simplify logic
video: Add an option to skip video initialization
drivers/video/cfb_console.c | 82 ++++++++++++++++++++++--------------------
1 files changed, 43 insertions(+), 39 deletions(-)
Best regards,
Anatolij
2
1

16 May '09
This patch adds an option to skip the video initialization on for all
video drivers. This is needed for the CPCI750 which can be built as CPCI
host and adapter/target board. And the adapter board can't access the
video cards located on the CompactPCI bus.
Signed-off-by: Stefan Roese <sr(a)denx.de>
Cc: Anatolij Gustschin <agust(a)denx.de>
---
This patch replaces the previous one [video: ct6900: Add an option to skip
video initialization]. The test is now moved out of the ct6900 file into
the generic video init routine drv_video_init() as suggested by Anatolij.
Thanks,
Stefan
drivers/video/cfb_console.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 5ee2314..d3d5a6d 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -1330,11 +1330,27 @@ static int video_init (void)
/*****************************************************************************/
+/*
+ * Implement a weak default function for boards that optionally
+ * need to skip the video initialization.
+ */
+int __board_video_skip(void)
+{
+ /* As default, don't skip test */
+ return 0;
+}
+int board_video_skip(void) __attribute__((weak, alias("__board_video_skip")));
+
+
int drv_video_init (void)
{
int skip_dev_init;
device_t console_dev;
+ /* Check if video initialization should be skipped */
+ if (board_video_skip())
+ return 0;
+
skip_dev_init = 0;
/* Init video chip - returns with framebuffer cleared */
--
1.6.2.5
4
17

[U-Boot] [PATCH V3] arm: timer and interrupt init rework
by Jean-Christophe PLAGNIOL-VILLARD 16 May '09
by Jean-Christophe PLAGNIOL-VILLARD 16 May '09
16 May '09
actually the timer init use the interrupt_init as init callback
which make the interrupt and timer implementation difficult to follow
so now rename it as int timer_init(void) and use interrupt_init for interrupt
btw also remane the corresponding file to the functionnality implemented
as ixp arch implement two timer - one based on interrupt - so all the timer
related code is moved to timer.c
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj(a)jcrosoft.com>
---
v3 do not move the board_init after the time
board/armltd/integratorap/integratorap.c | 2 +-
board/armltd/integratorcp/integratorcp.c | 2 +-
board/atmel/at91cap9adk/at91cap9adk.c | 1 -
board/davinci/common/misc.h | 1 -
board/m501sk/m501sk.c | 2 +-
board/netstar/netstar.c | 2 +-
board/voiceblue/voiceblue.c | 2 +-
cpu/arm1136/mx31/Makefile | 3 +-
cpu/arm1136/mx31/{interrupts.c => timer.c} | 3 +-
cpu/arm1136/omap24xx/Makefile | 3 +-
cpu/arm1136/omap24xx/{interrupts.c => timer.c} | 3 +-
cpu/arm1176/s3c64xx/Makefile | 2 +-
cpu/arm1176/s3c64xx/{interrupts.c => timer.c} | 2 +-
cpu/arm720t/interrupts.c | 46 ++++++++++--------
cpu/arm920t/at91rm9200/Makefile | 2 +-
cpu/arm920t/at91rm9200/{interrupts.c => timer.c} | 2 +-
cpu/arm920t/imx/Makefile | 4 +-
cpu/arm920t/imx/{interrupts.c => timer.c} | 2 +-
cpu/arm920t/ks8695/Makefile | 3 +-
cpu/arm920t/ks8695/{interrupts.c => timer.c} | 12 ++---
cpu/arm920t/s3c24x0/Makefile | 5 ++-
cpu/arm920t/s3c24x0/{interrupts.c => timer.c} | 2 +-
cpu/arm925t/Makefile | 5 ++-
cpu/arm925t/{interrupts.c => timer.c} | 2 +-
cpu/arm926ejs/Makefile | 2 +-
cpu/arm926ejs/interrupts.c | 57 ----------------------
cpu/arm_cortexa8/omap3/Makefile | 2 +-
cpu/arm_cortexa8/omap3/{interrupts.c => timer.c} | 2 +-
cpu/ixp/Makefile | 6 +--
cpu/ixp/interrupts.c | 55 ++++-----------------
cpu/ixp/timer.c | 54 ++++++++++++++++++++
cpu/lh7a40x/Makefile | 2 +-
cpu/lh7a40x/{interrupts.c => timer.c} | 2 +-
cpu/pxa/Makefile | 8 +++-
cpu/pxa/{interrupts.c => timer.c} | 7 ++-
cpu/s3c44b0/Makefile | 5 ++-
cpu/s3c44b0/{interrupts.c => timer.c} | 2 +-
cpu/sa1100/Makefile | 4 +-
cpu/sa1100/{interrupts.c => timer.c} | 5 +-
include/asm-arm/u-boot-arm.h | 3 +
include/configs/ixdpg425.h | 1 +
include/configs/pdnb3.h | 1 +
lib_arm/board.c | 3 +
43 files changed, 161 insertions(+), 173 deletions(-)
rename cpu/arm1136/mx31/{interrupts.c => timer.c} (97%)
rename cpu/arm1136/omap24xx/{interrupts.c => timer.c} (97%)
rename cpu/arm1176/s3c64xx/{interrupts.c => timer.c} (99%)
rename cpu/arm920t/at91rm9200/{interrupts.c => timer.c} (99%)
rename cpu/arm920t/imx/{interrupts.c => timer.c} (99%)
rename cpu/arm920t/ks8695/{interrupts.c => timer.c} (93%)
rename cpu/arm920t/s3c24x0/{interrupts.c => timer.c} (99%)
rename cpu/arm925t/{interrupts.c => timer.c} (99%)
delete mode 100644 cpu/arm926ejs/interrupts.c
rename cpu/arm_cortexa8/omap3/{interrupts.c => timer.c} (99%)
rename cpu/lh7a40x/{interrupts.c => timer.c} (99%)
rename cpu/pxa/{interrupts.c => timer.c} (96%)
rename cpu/s3c44b0/{interrupts.c => timer.c} (98%)
rename cpu/sa1100/{interrupts.c => timer.c} (95%)
diff --git a/board/armltd/integratorap/integratorap.c b/board/armltd/integratorap/integratorap.c
index 9631967..5ececd6 100644
--- a/board/armltd/integratorap/integratorap.c
+++ b/board/armltd/integratorap/integratorap.c
@@ -540,7 +540,7 @@ static ulong div_timer = 1; /* Divisor to convert timer reading
* - the Integrator/AP timer issues an interrupt
* each time it reaches zero
*/
-int interrupt_init (void)
+int timer_init (void)
{
/* Load timer with initial value */
*(volatile ulong *)(CONFIG_SYS_TIMERBASE + 0) = TIMER_LOAD_VAL;
diff --git a/board/armltd/integratorcp/integratorcp.c b/board/armltd/integratorcp/integratorcp.c
index 72629ce..0d3afd8 100644
--- a/board/armltd/integratorcp/integratorcp.c
+++ b/board/armltd/integratorcp/integratorcp.c
@@ -163,7 +163,7 @@ static ulong timestamp; /* U-Boot ticks since startup */
/* starts up a counter
* - the Integrator/CP timer can be set up to issue an interrupt */
-int interrupt_init (void)
+int timer_init (void)
{
/* Load timer with initial value */
*(volatile ulong *)(CONFIG_SYS_TIMERBASE + 0) = TIMER_LOAD_VAL;
diff --git a/board/atmel/at91cap9adk/at91cap9adk.c b/board/atmel/at91cap9adk/at91cap9adk.c
index f52edaa..9f73df6 100644
--- a/board/atmel/at91cap9adk/at91cap9adk.c
+++ b/board/atmel/at91cap9adk/at91cap9adk.c
@@ -61,7 +61,6 @@ static void at91cap9_slowclock_hw_init(void)
if (at91_sys_read(AT91_PMC_VER) == ARCH_ID_AT91CAP9_REVC) {
unsigned i, tmp = at91_sys_read(AT91_SCKCR);
if ((tmp & AT91CAP9_SCKCR_OSCSEL) == AT91CAP9_SCKCR_OSCSEL_RC) {
- extern void timer_init(void);
timer_init();
tmp |= AT91CAP9_SCKCR_OSC32EN;
at91_sys_write(AT91_SCKCR, tmp);
diff --git a/board/davinci/common/misc.h b/board/davinci/common/misc.h
index 4a57dbb..5d29784 100644
--- a/board/davinci/common/misc.h
+++ b/board/davinci/common/misc.h
@@ -22,7 +22,6 @@
#ifndef __MISC_H
#define __MISC_H
-extern void timer_init(void);
extern int eth_hw_init(void);
void dv_display_clk_infos(void);
diff --git a/board/m501sk/m501sk.c b/board/m501sk/m501sk.c
index dc5b786..1e6a605 100644
--- a/board/m501sk/m501sk.c
+++ b/board/m501sk/m501sk.c
@@ -127,7 +127,7 @@ int board_init(void)
m501sk_gpio_init();
/* Do interrupt init here, because flash needs timers */
- interrupt_init();
+ timer_init();
flash_init();
return 0;
diff --git a/board/netstar/netstar.c b/board/netstar/netstar.c
index ee4f2cd..ffd60bf 100644
--- a/board/netstar/netstar.c
+++ b/board/netstar/netstar.c
@@ -48,7 +48,7 @@ int dram_init(void)
/* Take the Ethernet controller out of reset and wait
* for the EEPROM load to complete. */
*((volatile unsigned short *) GPIO_DATA_OUTPUT_REG) |= 0x80;
- udelay(10); /* doesn't work before interrupt_init call */
+ udelay(10); /* doesn't work before timer_init call */
*((volatile unsigned short *) GPIO_DATA_OUTPUT_REG) &= ~0x80;
udelay(500);
diff --git a/board/voiceblue/voiceblue.c b/board/voiceblue/voiceblue.c
index c8dde36..59b3310 100644
--- a/board/voiceblue/voiceblue.c
+++ b/board/voiceblue/voiceblue.c
@@ -43,7 +43,7 @@ int dram_init(void)
/* Take the Ethernet controller out of reset and wait
* for the EEPROM load to complete. */
*((volatile unsigned short *) GPIO_DATA_OUTPUT_REG) |= 0x80;
- udelay(10); /* doesn't work before interrupt_init call */
+ udelay(10); /* doesn't work before timer_init call */
*((volatile unsigned short *) GPIO_DATA_OUTPUT_REG) &= ~0x80;
udelay(500);
diff --git a/cpu/arm1136/mx31/Makefile b/cpu/arm1136/mx31/Makefile
index 0e06f0a..1e49e8d 100644
--- a/cpu/arm1136/mx31/Makefile
+++ b/cpu/arm1136/mx31/Makefile
@@ -25,7 +25,8 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(SOC).a
-COBJS = interrupts.o generic.o
+COBJS += generic.o
+COBJS += timer.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/arm1136/mx31/interrupts.c b/cpu/arm1136/mx31/timer.c
similarity index 97%
rename from cpu/arm1136/mx31/interrupts.c
rename to cpu/arm1136/mx31/timer.c
index ab7202f..29b484e 100644
--- a/cpu/arm1136/mx31/interrupts.c
+++ b/cpu/arm1136/mx31/timer.c
@@ -89,9 +89,8 @@ static inline unsigned long long us_to_tick(unsigned long long us)
}
#endif
-/* nothing really to do with interrupts, just starts up a counter. */
/* The 32768Hz 32-bit timer overruns in 131072 seconds */
-int interrupt_init (void)
+int timer_init (void)
{
int i;
diff --git a/cpu/arm1136/omap24xx/Makefile b/cpu/arm1136/omap24xx/Makefile
index f9afed7..2a79d9b 100644
--- a/cpu/arm1136/omap24xx/Makefile
+++ b/cpu/arm1136/omap24xx/Makefile
@@ -25,9 +25,10 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(SOC).a
-COBJS = interrupts.o
SOBJS = start.o
+COBJS = timer.o
+
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/arm1136/omap24xx/interrupts.c b/cpu/arm1136/omap24xx/timer.c
similarity index 97%
rename from cpu/arm1136/omap24xx/interrupts.c
rename to cpu/arm1136/omap24xx/timer.c
index 6be1262..aef0b13 100644
--- a/cpu/arm1136/omap24xx/interrupts.c
+++ b/cpu/arm1136/omap24xx/timer.c
@@ -42,8 +42,7 @@
static ulong timestamp;
static ulong lastinc;
-/* nothing really to do with interrupts, just starts up a counter. */
-int interrupt_init (void)
+int timer_init (void)
{
int32_t val;
diff --git a/cpu/arm1176/s3c64xx/Makefile b/cpu/arm1176/s3c64xx/Makefile
index fa4ee3f..4656d9a 100644
--- a/cpu/arm1176/s3c64xx/Makefile
+++ b/cpu/arm1176/s3c64xx/Makefile
@@ -28,8 +28,8 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(SOC).a
-COBJS-y = interrupts.o
COBJS-$(CONFIG_S3C6400) += cpu_init.o speed.o
+COBJS-y += timer.o
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
diff --git a/cpu/arm1176/s3c64xx/interrupts.c b/cpu/arm1176/s3c64xx/timer.c
similarity index 99%
rename from cpu/arm1176/s3c64xx/interrupts.c
rename to cpu/arm1176/s3c64xx/timer.c
index 83f3806..e3de1dc 100644
--- a/cpu/arm1176/s3c64xx/interrupts.c
+++ b/cpu/arm1176/s3c64xx/timer.c
@@ -66,7 +66,7 @@ static unsigned long lastdec;
/* Monotonic incrementing timer */
static unsigned long long timestamp;
-int interrupt_init(void)
+int timer_init(void)
{
s3c64xx_timers *const timers = s3c64xx_get_base_timers();
diff --git a/cpu/arm720t/interrupts.c b/cpu/arm720t/interrupts.c
index 39ed345..ff21314 100644
--- a/cpu/arm720t/interrupts.c
+++ b/cpu/arm720t/interrupts.c
@@ -110,9 +110,34 @@ static void timer_isr( void *data) {
static ulong timestamp;
static ulong lastdec;
+#if defined(CONFIG_USE_IRQ) && defined(CONFIG_S3C4510B)
int interrupt_init (void)
{
+ int i;
+
+ /* install default interrupt handlers */
+ for ( i = 0; i < N_IRQS; i++) {
+ IRQ_HANDLER[i].m_data = (void *)i;
+ IRQ_HANDLER[i].m_func = default_isr;
+ }
+
+ /* configure interrupts for IRQ mode */
+ PUT_REG( REG_INTMODE, 0x0);
+ /* clear any pending interrupts */
+ PUT_REG( REG_INTPEND, 0x1FFFFF);
+
+ lastdec = 0;
+
+ /* install interrupt handler for timer */
+ IRQ_HANDLER[INT_TIMER0].m_data = (void *)×tamp;
+ IRQ_HANDLER[INT_TIMER0].m_func = timer_isr;
+
+ return 0;
+}
+#endif
+int timer_init (void)
+{
#if defined(CONFIG_NETARM)
/* disable all interrupts */
IRQEN = 0;
@@ -137,25 +162,6 @@ int interrupt_init (void)
/* set timer 1 counter */
lastdec = IO_TC1D = TIMER_LOAD_VAL;
#elif defined(CONFIG_S3C4510B)
- int i;
-
- /* install default interrupt handlers */
- for ( i = 0; i < N_IRQS; i++) {
- IRQ_HANDLER[i].m_data = (void *)i;
- IRQ_HANDLER[i].m_func = default_isr;
- }
-
- /* configure interrupts for IRQ mode */
- PUT_REG( REG_INTMODE, 0x0);
- /* clear any pending interrupts */
- PUT_REG( REG_INTPEND, 0x1FFFFF);
-
- lastdec = 0;
-
- /* install interrupt handler for timer */
- IRQ_HANDLER[INT_TIMER0].m_data = (void *)×tamp;
- IRQ_HANDLER[INT_TIMER0].m_func = timer_isr;
-
/* configure free running timer 0 */
PUT_REG( REG_TMOD, 0x0);
/* Stop timer 0 */
@@ -187,7 +193,7 @@ int interrupt_init (void)
PUT32(T0TCR, 1); /* enable timer0 */
#else
-#error No interrupt_init() defined for this CPU type
+#error No timer_init() defined for this CPU type
#endif
timestamp = 0;
diff --git a/cpu/arm920t/at91rm9200/Makefile b/cpu/arm920t/at91rm9200/Makefile
index 161ca94..73aeeac 100644
--- a/cpu/arm920t/at91rm9200/Makefile
+++ b/cpu/arm920t/at91rm9200/Makefile
@@ -31,10 +31,10 @@ COBJS += bcm5221.o
COBJS += dm9161.o
COBJS += ether.o
COBJS += i2c.o
-COBJS += interrupts.o
COBJS += lxt972.o
COBJS += reset.o
COBJS += spi.o
+COBJS += timer.o
COBJS += usb.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/cpu/arm920t/at91rm9200/interrupts.c b/cpu/arm920t/at91rm9200/timer.c
similarity index 99%
rename from cpu/arm920t/at91rm9200/interrupts.c
rename to cpu/arm920t/at91rm9200/timer.c
index 4c38a9a..235d107 100644
--- a/cpu/arm920t/at91rm9200/interrupts.c
+++ b/cpu/arm920t/at91rm9200/timer.c
@@ -45,7 +45,7 @@ AT91PS_TC tmr;
static ulong timestamp;
static ulong lastinc;
-int interrupt_init (void)
+int timer_init (void)
{
tmr = AT91C_BASE_TC0;
diff --git a/cpu/arm920t/imx/Makefile b/cpu/arm920t/imx/Makefile
index d3352de..28945e2 100644
--- a/cpu/arm920t/imx/Makefile
+++ b/cpu/arm920t/imx/Makefile
@@ -25,7 +25,9 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(SOC).a
-COBJS = generic.o interrupts.o speed.o
+COBJS += generic.o
+COBJS += speed.o
+COBJS += timer.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/arm920t/imx/interrupts.c b/cpu/arm920t/imx/timer.c
similarity index 99%
rename from cpu/arm920t/imx/interrupts.c
rename to cpu/arm920t/imx/timer.c
index ddcfb34..09b4eaf 100644
--- a/cpu/arm920t/imx/interrupts.c
+++ b/cpu/arm920t/imx/timer.c
@@ -35,7 +35,7 @@
#include <arm920t.h>
#include <asm/arch/imx-regs.h>
-int interrupt_init (void)
+int timer_init (void)
{
int i;
/* setup GP Timer 1 */
diff --git a/cpu/arm920t/ks8695/Makefile b/cpu/arm920t/ks8695/Makefile
index f6b0063..f53fdc2 100644
--- a/cpu/arm920t/ks8695/Makefile
+++ b/cpu/arm920t/ks8695/Makefile
@@ -25,9 +25,10 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(SOC).a
-COBJS = interrupts.o
SOBJS = lowlevel_init.o
+COBJS = timer.o
+
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/arm920t/ks8695/interrupts.c b/cpu/arm920t/ks8695/timer.c
similarity index 93%
rename from cpu/arm920t/ks8695/interrupts.c
rename to cpu/arm920t/ks8695/timer.c
index 883d689..22987bc 100644
--- a/cpu/arm920t/ks8695/interrupts.c
+++ b/cpu/arm920t/ks8695/timer.c
@@ -29,13 +29,13 @@
#define ks8695_read(a) *((volatile ulong *) (KS8695_IO_BASE + (a)))
#define ks8695_write(a,v) *((volatile ulong *) (KS8695_IO_BASE + (a))) = (v)
-int timer_inited;
ulong timer_ticks;
-int interrupt_init (void)
+int timer_init (void)
{
- /* nothing happens here - we don't setup any IRQs */
- return (0);
+ reset_timer();
+
+ return 0;
}
/*
@@ -53,7 +53,6 @@ void reset_timer_masked(void)
ks8695_write(KS8695_TIMER1_PCOUNT, TIMER_PULSE);
ks8695_write(KS8695_TIMER_CTRL, 0x2);
timer_ticks = 0;
- timer_inited++;
}
void reset_timer(void)
@@ -87,9 +86,6 @@ void udelay(ulong usec)
ulong start = get_timer_masked();
ulong end;
- if (!timer_inited)
- reset_timer();
-
/* Only 1ms resolution :-( */
end = usec / 1000;
while (get_timer(start) < end)
diff --git a/cpu/arm920t/s3c24x0/Makefile b/cpu/arm920t/s3c24x0/Makefile
index 3afe19c..5d2be2c 100644
--- a/cpu/arm920t/s3c24x0/Makefile
+++ b/cpu/arm920t/s3c24x0/Makefile
@@ -25,7 +25,10 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(SOC).a
-COBJS = interrupts.o speed.o usb.o usb_ohci.o
+COBJS += speed.o
+COBJS += timer.o
+COBJS += usb.o
+COBJS += usb_ohci.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/arm920t/s3c24x0/interrupts.c b/cpu/arm920t/s3c24x0/timer.c
similarity index 99%
rename from cpu/arm920t/s3c24x0/interrupts.c
rename to cpu/arm920t/s3c24x0/timer.c
index 11e6804..328c652 100644
--- a/cpu/arm920t/s3c24x0/interrupts.c
+++ b/cpu/arm920t/s3c24x0/timer.c
@@ -52,7 +52,7 @@ static inline ulong READ_TIMER(void)
static ulong timestamp;
static ulong lastdec;
-int interrupt_init (void)
+int timer_init (void)
{
S3C24X0_TIMERS * const timers = S3C24X0_GetBase_TIMERS();
diff --git a/cpu/arm925t/Makefile b/cpu/arm925t/Makefile
index 0d4912c..8d0e88f 100644
--- a/cpu/arm925t/Makefile
+++ b/cpu/arm925t/Makefile
@@ -26,7 +26,10 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(CPU).a
START = start.o
-COBJS = interrupts.o cpu.o omap925.o
+
+COBJS += cpu.o
+COBJS += omap925.o
+COBJS += timer.o
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/arm925t/interrupts.c b/cpu/arm925t/timer.c
similarity index 99%
rename from cpu/arm925t/interrupts.c
rename to cpu/arm925t/timer.c
index ec2a978..069f509 100644
--- a/cpu/arm925t/interrupts.c
+++ b/cpu/arm925t/timer.c
@@ -47,7 +47,7 @@ static uint32_t timestamp;
static uint32_t lastdec;
/* nothing really to do with interrupts, just starts up a counter. */
-int interrupt_init (void)
+int timer_init (void)
{
/* Start the decrementer ticking down from 0xffffffff */
__raw_writel(TIMER_LOAD_VAL, CONFIG_SYS_TIMERBASE + LOAD_TIM);
diff --git a/cpu/arm926ejs/Makefile b/cpu/arm926ejs/Makefile
index d5ac7d3..7701b03 100644
--- a/cpu/arm926ejs/Makefile
+++ b/cpu/arm926ejs/Makefile
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(CPU).a
START = start.o
-COBJS = interrupts.o cpu.o
+COBJS = cpu.o
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))
diff --git a/cpu/arm926ejs/interrupts.c b/cpu/arm926ejs/interrupts.c
deleted file mode 100644
index 7a41f0b..0000000
--- a/cpu/arm926ejs/interrupts.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * (C) Copyright 2003
- * Texas Instruments <www.ti.com>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger(a)sysgo.de>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Alex Zuepke <azu(a)sysgo.de>
- *
- * (C) Copyright 2002-2004
- * Gary Jennejohn, DENX Software Engineering, <gj(a)denx.de>
- *
- * (C) Copyright 2004
- * Philippe Robin, ARM Ltd. <philippe.robin(a)arm.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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 2 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <arm926ejs.h>
-
-#ifdef CONFIG_INTEGRATOR
-
- /* Timer functionality supplied by Integrator board (AP or CP) */
-
-#else
-
-/* nothing really to do with interrupts, just starts up a counter. */
-int interrupt_init (void)
-{
- extern void timer_init(void);
-
- timer_init();
-
- return 0;
-}
-
-#endif /* CONFIG_INTEGRATOR */
diff --git a/cpu/arm_cortexa8/omap3/Makefile b/cpu/arm_cortexa8/omap3/Makefile
index d1e658d..edf5cb2 100644
--- a/cpu/arm_cortexa8/omap3/Makefile
+++ b/cpu/arm_cortexa8/omap3/Makefile
@@ -32,7 +32,7 @@ COBJS += clock.o
COBJS += mem.o
COBJS += syslib.o
COBJS += sys_info.o
-COBJS += interrupts.o
+COBJS += timer.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))
diff --git a/cpu/arm_cortexa8/omap3/interrupts.c b/cpu/arm_cortexa8/omap3/timer.c
similarity index 99%
rename from cpu/arm_cortexa8/omap3/interrupts.c
rename to cpu/arm_cortexa8/omap3/timer.c
index e54b67d..a73916c 100644
--- a/cpu/arm_cortexa8/omap3/interrupts.c
+++ b/cpu/arm_cortexa8/omap3/timer.c
@@ -50,7 +50,7 @@ static gptimer_t *timer_base = (gptimer_t *)CONFIG_SYS_TIMERBASE;
#define TIMER_CLOCK (V_SCLK / (2 << CONFIG_SYS_PTV))
#define TIMER_LOAD_VAL 0xffffffff
-int interrupt_init(void)
+int timer_init(void)
{
/* start the counter ticking up, reload value on overflow */
writel(TIMER_LOAD_VAL, &timer_base->tldr);
diff --git a/cpu/ixp/Makefile b/cpu/ixp/Makefile
index a673cb1..1403c4f 100644
--- a/cpu/ixp/Makefile
+++ b/cpu/ixp/Makefile
@@ -26,12 +26,10 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(CPU).a
START = start.o
+
COBJS-y += cpu.o
-ifndef CONFIG_USE_IRQ
+COBJS-$(CONFIG_USE_IRQ) += interrupts.o
COBJS-y += timer.o
-else
-COBJS-y += interrupts.o
-endif
SRCS := $(START:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
diff --git a/cpu/ixp/interrupts.c b/cpu/ixp/interrupts.c
index ee0129e..a05e439 100644
--- a/cpu/ixp/interrupts.c
+++ b/cpu/ixp/interrupts.c
@@ -33,14 +33,6 @@
#include <asm/arch/ixp425.h>
#include <asm/proc-armv/ptrace.h>
-/*
- * When interrupts are enabled, use timer 2 for time/delay generation...
- */
-
-#define FREQ 66666666
-#define CLOCK_TICK_RATE (((FREQ / CONFIG_SYS_HZ & ~IXP425_OST_RELOAD_MASK) + 1) * CONFIG_SYS_HZ)
-#define LATCH ((CLOCK_TICK_RATE + CONFIG_SYS_HZ/2) / CONFIG_SYS_HZ) /* For divider */
-
struct _irq_handler {
void *m_data;
void (*m_func)( void *data);
@@ -48,8 +40,6 @@ struct _irq_handler {
static struct _irq_handler IRQ_HANDLER[N_IRQS];
-static volatile ulong timestamp;
-
static void default_isr(void *data)
{
printf("default_isr(): called for IRQ %d, Interrupt Status=%x PR=%x\n",
@@ -61,33 +51,20 @@ static int next_irq(void)
return (((*IXP425_ICIH & 0x000000fc) >> 2) - 1);
}
-static void timer_isr(void *data)
-{
- unsigned int *pTime = (unsigned int *)data;
-
- (*pTime)++;
-
- /*
- * Reset IRQ source
- */
- *IXP425_OSST = IXP425_OSST_TIMER_2_PEND;
-}
-
-ulong get_timer (ulong base)
+void do_irq (struct pt_regs *pt_regs)
{
- return timestamp - base;
-}
+ int irq = next_irq();
-void reset_timer (void)
-{
- timestamp = 0;
+ IRQ_HANDLER[irq].m_func(IRQ_HANDLER[irq].m_data);
}
-void do_irq (struct pt_regs *pt_regs)
+void irq_install_handler (int irq, interrupt_handler_t handle_irq, void *data)
{
- int irq = next_irq();
+ if (irq >= N_IRQS || !handle_irq)
+ return;
- IRQ_HANDLER[irq].m_func(IRQ_HANDLER[irq].m_data);
+ IRQ_HANDLER[irq].m_data = data;
+ IRQ_HANDLER[irq].m_func = handle_irq;
}
int interrupt_init (void)
@@ -95,23 +72,11 @@ int interrupt_init (void)
int i;
/* install default interrupt handlers */
- for (i = 0; i < N_IRQS; i++) {
- IRQ_HANDLER[i].m_data = (void *)i;
- IRQ_HANDLER[i].m_func = default_isr;
- }
-
- /* install interrupt handler for timer */
- IRQ_HANDLER[IXP425_TIMER_2_IRQ].m_data = (void *)×tamp;
- IRQ_HANDLER[IXP425_TIMER_2_IRQ].m_func = timer_isr;
-
- /* setup the Timer counter value */
- *IXP425_OSRT2 = (LATCH & ~IXP425_OST_RELOAD_MASK) | IXP425_OST_ENABLE;
+ for (i = 0; i < N_IRQS; i++)
+ irq_install_handler(i, default_isr, (void *)i);
/* configure interrupts for IRQ mode */
*IXP425_ICLR = 0x00000000;
- /* enable timer irq */
- *IXP425_ICMR = (1 << IXP425_TIMER_2_IRQ);
-
return (0);
}
diff --git a/cpu/ixp/timer.c b/cpu/ixp/timer.c
index deb227a..6856149 100644
--- a/cpu/ixp/timer.c
+++ b/cpu/ixp/timer.c
@@ -32,6 +32,54 @@
#include <common.h>
#include <asm/arch/ixp425.h>
+#ifdef CONFIG_TIMER_IRQ
+
+#define FREQ 66666666
+#define CLOCK_TICK_RATE (((FREQ / CONFIG_SYS_HZ & ~IXP425_OST_RELOAD_MASK) + 1) * CONFIG_SYS_HZ)
+#define LATCH ((CLOCK_TICK_RATE + CONFIG_SYS_HZ/2) / CONFIG_SYS_HZ) /* For divider */
+
+/*
+ * When interrupts are enabled, use timer 2 for time/delay generation...
+ */
+
+static volatile ulong timestamp;
+
+static void timer_isr(void *data)
+{
+ unsigned int *pTime = (unsigned int *)data;
+
+ (*pTime)++;
+
+ /*
+ * Reset IRQ source
+ */
+ *IXP425_OSST = IXP425_OSST_TIMER_2_PEND;
+}
+
+ulong get_timer (ulong base)
+{
+ return timestamp - base;
+}
+
+void reset_timer (void)
+{
+ timestamp = 0;
+}
+
+int timer_init (void)
+{
+ /* install interrupt handler for timer */
+ irq_install_handler(IXP425_TIMER_2_IRQ, timer_isr, (void *)×tamp);
+
+ /* setup the Timer counter value */
+ *IXP425_OSRT2 = (LATCH & ~IXP425_OST_RELOAD_MASK) | IXP425_OST_ENABLE;
+
+ /* enable timer irq */
+ *IXP425_ICMR = (1 << IXP425_TIMER_2_IRQ);
+
+ return 0;
+}
+#else
ulong get_timer (ulong base)
{
return get_timer_masked () - base;
@@ -79,3 +127,9 @@ ulong get_timer_masked (void)
}
return (reload_constant - current);
}
+
+int timer_init(void)
+{
+ return 0;
+}
+#endif
diff --git a/cpu/lh7a40x/Makefile b/cpu/lh7a40x/Makefile
index bac2a64..b9ae76e 100644
--- a/cpu/lh7a40x/Makefile
+++ b/cpu/lh7a40x/Makefile
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(CPU).a
START = start.o
-COBJS = cpu.o speed.o interrupts.o serial.o
+COBJS = cpu.o speed.o serial.o timer.o
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/lh7a40x/interrupts.c b/cpu/lh7a40x/timer.c
similarity index 99%
rename from cpu/lh7a40x/interrupts.c
rename to cpu/lh7a40x/timer.c
index 5acfe1a..91ca6a9 100644
--- a/cpu/lh7a40x/interrupts.c
+++ b/cpu/lh7a40x/timer.c
@@ -47,7 +47,7 @@ static inline ulong READ_TIMER(void)
static ulong timestamp;
static ulong lastdec;
-int interrupt_init (void)
+int timer_init (void)
{
lh7a40x_timers_t* timers = LH7A40X_TIMERS_PTR;
lh7a40x_timer_t* timer = &timers->timer1;
diff --git a/cpu/pxa/Makefile b/cpu/pxa/Makefile
index 42903b2..5dc3a52 100644
--- a/cpu/pxa/Makefile
+++ b/cpu/pxa/Makefile
@@ -26,7 +26,13 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(CPU).a
START = start.o
-COBJS = serial.o interrupts.o cpu.o i2c.o pxafb.o usb.o
+
+COBJS += cpu.o
+COBJS += i2c.o
+COBJS += pxafb.o
+COBJS += serial.o
+COBJS += timer.o
+COBJS += usb.o
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/pxa/interrupts.c b/cpu/pxa/timer.c
similarity index 96%
rename from cpu/pxa/interrupts.c
rename to cpu/pxa/timer.c
index 2bc5c50..e2df3a5 100644
--- a/cpu/pxa/interrupts.c
+++ b/cpu/pxa/timer.c
@@ -56,10 +56,11 @@ static inline unsigned long long us_to_tick(unsigned long long us)
return us;
}
-int interrupt_init (void)
+int timer_init (void)
{
- /* nothing happens here - we don't setup any IRQs */
- return (0);
+ reset_timer();
+
+ return 0;
}
void reset_timer (void)
diff --git a/cpu/s3c44b0/Makefile b/cpu/s3c44b0/Makefile
index ae909a6..6da2016 100644
--- a/cpu/s3c44b0/Makefile
+++ b/cpu/s3c44b0/Makefile
@@ -26,7 +26,10 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(CPU).a
START = start.o
-COBJS = cache.o cpu.o interrupts.o
+
+COBJS += cache.o
+COBJS += cpu.o
+COBJS += timer.o
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/s3c44b0/interrupts.c b/cpu/s3c44b0/timer.c
similarity index 98%
rename from cpu/s3c44b0/interrupts.c
rename to cpu/s3c44b0/timer.c
index eb23e6a..34184ab 100644
--- a/cpu/s3c44b0/interrupts.c
+++ b/cpu/s3c44b0/timer.c
@@ -40,7 +40,7 @@
static ulong timestamp;
static ulong lastdec;
-int interrupt_init (void)
+int timer_init (void)
{
TCFG0 = 0x000000E9;
TCFG1 = 0x00000004;
diff --git a/cpu/sa1100/Makefile b/cpu/sa1100/Makefile
index fd696f7..28b6682 100644
--- a/cpu/sa1100/Makefile
+++ b/cpu/sa1100/Makefile
@@ -26,7 +26,9 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(CPU).a
START = start.o
-COBJS = interrupts.o cpu.o
+
+COBJS += cpu.o
+COBJS += timer.o
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/sa1100/interrupts.c b/cpu/sa1100/timer.c
similarity index 95%
rename from cpu/sa1100/interrupts.c
rename to cpu/sa1100/timer.c
index 2eff045..3f77e81 100644
--- a/cpu/sa1100/interrupts.c
+++ b/cpu/sa1100/timer.c
@@ -29,10 +29,9 @@
#include <common.h>
#include <SA-1100.h>
-int interrupt_init (void)
+int timer_init (void)
{
- /* nothing happens here - we don't setup any IRQs */
- return (0);
+ return 0;
}
void reset_timer (void)
diff --git a/include/asm-arm/u-boot-arm.h b/include/asm-arm/u-boot-arm.h
index e7d58fe..238d408 100644
--- a/include/asm-arm/u-boot-arm.h
+++ b/include/asm-arm/u-boot-arm.h
@@ -62,4 +62,7 @@ void reset_timer_masked (void);
ulong get_timer_masked (void);
void udelay_masked (unsigned long usec);
+/* cpu/.../timer.c */
+int timer_init (void);
+
#endif /* _U_BOOT_ARM_H_ */
diff --git a/include/configs/ixdpg425.h b/include/configs/ixdpg425.h
index 75707e5..0c09234 100644
--- a/include/configs/ixdpg425.h
+++ b/include/configs/ixdpg425.h
@@ -55,6 +55,7 @@
*/
#undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */
#define CONFIG_USE_IRQ 1 /* we need IRQ stuff for timer */
+#define CONFIG_TIMER_IRQ
#define CONFIG_BOOTCOUNT_LIMIT /* support for bootcount limit */
#define CONFIG_SYS_BOOTCOUNT_ADDR 0x60003000 /* inside qmrg sram */
diff --git a/include/configs/pdnb3.h b/include/configs/pdnb3.h
index edaa81b..1255f21 100644
--- a/include/configs/pdnb3.h
+++ b/include/configs/pdnb3.h
@@ -51,6 +51,7 @@
* Misc configuration options
*/
#define CONFIG_USE_IRQ 1 /* we need IRQ stuff for timer */
+#define CONFIG_TIMER_IRQ
#define CONFIG_BOOTCOUNT_LIMIT /* support for bootcount limit */
#define CONFIG_SYS_BOOTCOUNT_ADDR 0x60003000 /* inside qmrg sram */
diff --git a/lib_arm/board.c b/lib_arm/board.c
index 5d05d9b..37ed3e3 100644
--- a/lib_arm/board.c
+++ b/lib_arm/board.c
@@ -266,7 +266,10 @@ init_fnc_t *init_sequence[] = {
arch_cpu_init, /* basic arch cpu dependent setup */
#endif
board_init, /* basic board dependent setup */
+#if defined(CONFIG_USE_IRQ)
interrupt_init, /* set up exceptions */
+#endif
+ timer_init, /* initialize timer */
env_init, /* initialize environment */
init_baudrate, /* initialze baudrate settings */
serial_init, /* serial communications setup */
--
1.6.2.4
2
1
Currently the mtdparts commands are included in the jffs2 command support.
This doesn't make sense anymore since other commands (e.g. UBI) use this
infrastructure as well now. This patch separates the mtdparts commands from
the jffs2 commands making it possible to only select mtdparts when no JFFS2
support is needed.
Signed-off-by: Stefan Roese <sr(a)denx.de>
Signed-off-by: Kyungmin Park <kyungmin.park(a)samsung.com>
---
v4:
- Keep config_cmd_all.h sorted
- Add "mtd_" to the names of some now non-static functions
- Cleanup of "jffs2" names and comments in cmd_mtdparts.c
v3:
- Keep lists sorted (README, Makefile) as pointed out by Wolfgang
- Generated without find-copies-harder
v2:
This patch is based in the original version by Kyungmin Park with some
additional changes by Jean-Christophe Plagniol-Villard. Changes are
the patch description and removal of the compilation errors/warnings.
README | 1 +
board/fads/fads.h | 4 +-
common/Makefile | 1 +
common/cmd_flash.c | 18 +-
common/cmd_jffs2.c | 1731 +-------------------------------
common/{cmd_jffs2.c => cmd_mtdparts.c} | 432 +--------
common/cmd_nand.c | 10 +-
include/config_cmd_all.h | 1 +
include/configs/ADNPESC1.h | 4 +-
include/configs/Alaska8220.h | 4 +-
include/configs/BAB7xx.h | 4 +-
include/configs/BC3450.h | 2 +-
include/configs/CATcenter.h | 4 +-
include/configs/DB64360.h | 4 +-
include/configs/DB64460.h | 4 +-
include/configs/DK1C20.h | 4 +-
include/configs/DK1S10.h | 4 +-
include/configs/ELPPC.h | 4 +-
include/configs/FPS850L.h | 2 +-
include/configs/FPS860L.h | 2 +-
include/configs/LANTEC.h | 4 +-
include/configs/MHPC.h | 4 +-
include/configs/MIP405.h | 4 +-
include/configs/ML2.h | 4 +-
include/configs/MPC8266ADS.h | 4 +-
include/configs/NC650.h | 4 +-
include/configs/NETTA.h | 4 +-
include/configs/PPChameleonEVB.h | 4 +-
include/configs/R360MPI.h | 4 +-
include/configs/RBC823.h | 4 +-
include/configs/Rattler.h | 4 +-
include/configs/SIMPC8313.h | 2 +-
include/configs/SXNI855T.h | 4 +-
include/configs/TB5200.h | 2 +-
include/configs/TQM5200.h | 2 +-
include/configs/TQM823L.h | 2 +-
include/configs/TQM823M.h | 2 +-
include/configs/TQM834x.h | 2 +-
include/configs/TQM850L.h | 2 +-
include/configs/TQM850M.h | 2 +-
include/configs/TQM855L.h | 2 +-
include/configs/TQM855M.h | 2 +-
include/configs/TQM85xx.h | 4 +-
include/configs/TQM860L.h | 2 +-
include/configs/TQM860M.h | 2 +-
include/configs/TQM862L.h | 2 +-
include/configs/TQM862M.h | 2 +-
include/configs/TQM866M.h | 2 +-
include/configs/ZUMA.h | 4 +-
include/configs/apollon.h | 2 +-
include/configs/cm5200.h | 2 +-
include/configs/debris.h | 4 +-
include/configs/ep7312.h | 4 +-
include/configs/ep8260.h | 4 +-
include/configs/fx12mm.h | 2 +-
include/configs/hymod.h | 4 +-
include/configs/idmr.h | 2 +-
include/configs/impa7.h | 4 +-
include/configs/imx31_litekit.h | 2 +-
include/configs/imx31_phycore.h | 2 +-
include/configs/incaip.h | 4 +-
include/configs/innokom.h | 4 +-
include/configs/microblaze-generic.h | 2 +-
include/configs/modnet50.h | 4 +-
include/configs/motionpro.h | 2 +-
include/configs/mx1fs2.h | 4 +-
include/configs/mx31ads.h | 2 +-
include/configs/netstar.h | 2 +-
include/configs/omap2420h4.h | 4 +-
include/configs/qong.h | 2 +-
include/configs/sc3.h | 2 +-
include/configs/sc520_cdp.h | 4 +-
include/configs/sc520_spunk.h | 4 +-
include/configs/smmaco4.h | 2 +-
include/configs/trab.h | 2 +-
include/configs/v37.h | 4 +-
include/configs/vct.h | 2 +-
include/configs/virtlab2.h | 2 +-
include/configs/voiceblue.h | 2 +-
include/configs/xilinx-ppc.h | 4 +-
include/configs/xsengine.h | 4 +-
81 files changed, 164 insertions(+), 2256 deletions(-)
copy common/{cmd_jffs2.c => cmd_mtdparts.c} (82%)
diff --git a/README b/README
index 46181a4..32d9acd 100644
--- a/README
+++ b/README
@@ -636,6 +636,7 @@ The following options need to be configured:
CONFIG_CMD_MISC Misc functions like sleep etc
CONFIG_CMD_MMC * MMC memory mapped support
CONFIG_CMD_MII * MII utility commands
+ CONFIG_CMD_MTDPARTS * MTD partition support
CONFIG_CMD_NAND * NAND support
CONFIG_CMD_NET bootp, tftpboot, rarpboot
CONFIG_CMD_PCA953X * PCA953x I2C gpio commands
diff --git a/board/fads/fads.h b/board/fads/fads.h
index 24e43ea..4ab4b26 100644
--- a/board/fads/fads.h
+++ b/board/fads/fads.h
@@ -241,7 +241,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -249,7 +249,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=fads0,nor1=fads-1,nor2=fads-2,nor3=fads-3"
#define MTDPARTS_DEFAULT "mtdparts=fads-0:-@1m(user1),fads-1:-(user2),fads-2:-(user3),fads-3:-(user4)"
*/
diff --git a/common/Makefile b/common/Makefile
index f13cd11..7237ff4 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -110,6 +110,7 @@ COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
COBJS-$(CONFIG_MP) += cmd_mp.o
+COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
COBJS-y += cmd_nand.o
COBJS-$(CONFIG_CMD_NET) += cmd_net.o
COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 510654e..f1f3517 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -31,12 +31,12 @@
#include <dataflash.h>
#endif
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
#include <jffs2/jffs2.h>
/* parition handling routines */
int mtdparts_init(void);
-int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num);
+int mtd_id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num);
int find_dev_and_part(const char *id, struct mtd_device **dev,
u8 *part_num, struct part_info **part);
#endif
@@ -325,7 +325,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
flash_info_t *info;
ulong bank, addr_first, addr_last;
int n, sect_first, sect_last;
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
struct mtd_device *dev;
struct part_info *part;
u8 dev_type, dev_num, pnum;
@@ -357,9 +357,9 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return rcode;
}
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
/* erase <part-id> - erase partition */
- if ((argc == 2) && (id_parse(argv[1], NULL, &dev_type, &dev_num) == 0)) {
+ if ((argc == 2) && (mtd_id_parse(argv[1], NULL, &dev_type, &dev_num) == 0)) {
mtdparts_init();
if (find_dev_and_part(argv[1], &dev, &pnum, &part) == 0) {
if (dev->id->type == MTD_DEV_TYPE_NOR) {
@@ -470,7 +470,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#endif /* CONFIG_SYS_NO_FLASH */
ulong addr_first, addr_last;
int p;
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
struct mtd_device *dev;
struct part_info *part;
u8 dev_type, dev_num, pnum;
@@ -563,9 +563,9 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return rcode;
}
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
/* protect on/off <part-id> */
- if ((argc == 3) && (id_parse(argv[2], NULL, &dev_type, &dev_num) == 0)) {
+ if ((argc == 3) && (mtd_id_parse(argv[2], NULL, &dev_type, &dev_num) == 0)) {
mtdparts_init();
if (find_dev_and_part(argv[2], &dev, &pnum, &part) == 0) {
if (dev->id->type == MTD_DEV_TYPE_NOR) {
@@ -698,7 +698,7 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
/**************************************************/
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
# define TMP_ERASE "erase <part-id>\n - erase partition\n"
# define TMP_PROT_ON "protect on <part-id>\n - protect partition\n"
# define TMP_PROT_OFF "protect off <part-id>\n - make partition writable\n"
diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
index d0a7cea..860d1d9 100644
--- a/common/cmd_jffs2.c
+++ b/common/cmd_jffs2.c
@@ -136,40 +136,6 @@
* field for read-only partitions */
#define MTD_WRITEABLE_CMD 1
-#ifdef CONFIG_JFFS2_CMDLINE
-/* default values for mtdids and mtdparts variables */
-#if defined(MTDIDS_DEFAULT)
-static const char *const mtdids_default = MTDIDS_DEFAULT;
-#else
-#warning "MTDIDS_DEFAULT not defined!"
-static const char *const mtdids_default = NULL;
-#endif
-
-#if defined(MTDPARTS_DEFAULT)
-static const char *const mtdparts_default = MTDPARTS_DEFAULT;
-#else
-#warning "MTDPARTS_DEFAULT not defined!"
-static const char *const mtdparts_default = NULL;
-#endif
-
-/* copies of last seen 'mtdids', 'mtdparts' and 'partition' env variables */
-#define MTDIDS_MAXLEN 128
-#define MTDPARTS_MAXLEN 512
-#define PARTITION_MAXLEN 16
-static char last_ids[MTDIDS_MAXLEN];
-static char last_parts[MTDPARTS_MAXLEN];
-static char last_partition[PARTITION_MAXLEN];
-
-/* low level jffs2 cache cleaning routine */
-extern void jffs2_free_cache(struct part_info *part);
-
-/* mtdids mapping list, filled by parse_ids() */
-struct list_head mtdids;
-
-/* device/partition list, parse_cmdline() parses into here */
-struct list_head devices;
-#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
-
/* current active device and partition number */
static struct mtd_device *current_dev = NULL;
static u8 current_partnum = 0;
@@ -188,601 +154,14 @@ extern int cramfs_info (struct part_info *info);
#define cramfs_info(x) (0)
#endif
-static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int part_num);
-
-/* command line only routines */
-#ifdef CONFIG_JFFS2_CMDLINE
-
-static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_len);
-static int device_del(struct mtd_device *dev);
-
-/**
- * Parses a string into a number. The number stored at ptr is
- * potentially suffixed with K (for kilobytes, or 1024 bytes),
- * M (for megabytes, or 1048576 bytes), or G (for gigabytes, or
- * 1073741824). If the number is suffixed with K, M, or G, then
- * the return value is the number multiplied by one kilobyte, one
- * megabyte, or one gigabyte, respectively.
- *
- * @param ptr where parse begins
- * @param retptr output pointer to next char after parse completes (output)
- * @return resulting unsigned int
- */
-static unsigned long memsize_parse (const char *const ptr, const char **retptr)
-{
- unsigned long ret = simple_strtoul(ptr, (char **)retptr, 0);
-
- switch (**retptr) {
- case 'G':
- case 'g':
- ret <<= 10;
- case 'M':
- case 'm':
- ret <<= 10;
- case 'K':
- case 'k':
- ret <<= 10;
- (*retptr)++;
- default:
- break;
- }
-
- return ret;
-}
-
-/**
- * Format string describing supplied size. This routine does the opposite job
- * to memsize_parse(). Size in bytes is converted to string and if possible
- * shortened by using k (kilobytes), m (megabytes) or g (gigabytes) suffix.
- *
- * Note, that this routine does not check for buffer overflow, it's the caller
- * who must assure enough space.
- *
- * @param buf output buffer
- * @param size size to be converted to string
- */
-static void memsize_format(char *buf, u32 size)
-{
-#define SIZE_GB ((u32)1024*1024*1024)
-#define SIZE_MB ((u32)1024*1024)
-#define SIZE_KB ((u32)1024)
-
- if ((size % SIZE_GB) == 0)
- sprintf(buf, "%ug", size/SIZE_GB);
- else if ((size % SIZE_MB) == 0)
- sprintf(buf, "%um", size/SIZE_MB);
- else if (size % SIZE_KB == 0)
- sprintf(buf, "%uk", size/SIZE_KB);
- else
- sprintf(buf, "%u", size);
-}
-
-/**
- * This routine does global indexing of all partitions. Resulting index for
- * current partition is saved in 'mtddevnum'. Current partition name in
- * 'mtddevname'.
- */
-static void index_partitions(void)
-{
- char buf[16];
- u16 mtddevnum;
- struct part_info *part;
- struct list_head *dentry;
- struct mtd_device *dev;
-
- DEBUGF("--- index partitions ---\n");
-
- if (current_dev) {
- mtddevnum = 0;
- list_for_each(dentry, &devices) {
- dev = list_entry(dentry, struct mtd_device, link);
- if (dev == current_dev) {
- mtddevnum += current_partnum;
- sprintf(buf, "%d", mtddevnum);
- setenv("mtddevnum", buf);
- break;
- }
- mtddevnum += dev->num_parts;
- }
-
- part = jffs2_part_info(current_dev, current_partnum);
- setenv("mtddevname", part->name);
-
- DEBUGF("=> mtddevnum %d,\n=> mtddevname %s\n", mtddevnum, part->name);
- } else {
- setenv("mtddevnum", NULL);
- setenv("mtddevname", NULL);
-
- DEBUGF("=> mtddevnum NULL\n=> mtddevname NULL\n");
- }
-}
-
-/**
- * Save current device and partition in environment variable 'partition'.
- */
-static void current_save(void)
-{
- char buf[16];
-
- DEBUGF("--- current_save ---\n");
-
- if (current_dev) {
- sprintf(buf, "%s%d,%d", MTD_DEV_TYPE(current_dev->id->type),
- current_dev->id->num, current_partnum);
-
- setenv("partition", buf);
- strncpy(last_partition, buf, 16);
-
- DEBUGF("=> partition %s\n", buf);
- } else {
- setenv("partition", NULL);
- last_partition[0] = '\0';
-
- DEBUGF("=> partition NULL\n");
- }
- index_partitions();
-}
-
-/**
- * Performs sanity check for supplied NOR flash partition. Table of existing
- * NOR flash devices is searched and partition device is located. Alignment
- * with the granularity of NOR flash sectors is verified.
- *
- * @param id of the parent device
- * @param part partition to validate
- * @return 0 if partition is valid, 1 otherwise
- */
-static int part_validate_nor(struct mtdids *id, struct part_info *part)
-{
-#if defined(CONFIG_CMD_FLASH)
- /* info for FLASH chips */
- extern flash_info_t flash_info[];
- flash_info_t *flash;
- int offset_aligned;
- u32 end_offset, sector_size = 0;
- int i;
-
- flash = &flash_info[id->num];
-
- /* size of last sector */
- part->sector_size = flash->size -
- (flash->start[flash->sector_count-1] - flash->start[0]);
-
- offset_aligned = 0;
- for (i = 0; i < flash->sector_count; i++) {
- if ((flash->start[i] - flash->start[0]) == part->offset) {
- offset_aligned = 1;
- break;
- }
- }
- if (offset_aligned == 0) {
- printf("%s%d: partition (%s) start offset alignment incorrect\n",
- MTD_DEV_TYPE(id->type), id->num, part->name);
- return 1;
- }
-
- end_offset = part->offset + part->size;
- offset_aligned = 0;
- for (i = 0; i < flash->sector_count; i++) {
- if (i) {
- sector_size = flash->start[i] - flash->start[i-1];
- if (part->sector_size < sector_size)
- part->sector_size = sector_size;
- }
- if ((flash->start[i] - flash->start[0]) == end_offset)
- offset_aligned = 1;
- }
-
- if (offset_aligned || flash->size == end_offset)
- return 0;
-
- printf("%s%d: partition (%s) size alignment incorrect\n",
- MTD_DEV_TYPE(id->type), id->num, part->name);
-#endif
- return 1;
-}
-
-/**
- * Performs sanity check for supplied NAND flash partition. Table of existing
- * NAND flash devices is searched and partition device is located. Alignment
- * with the granularity of nand erasesize is verified.
- *
- * @param id of the parent device
- * @param part partition to validate
- * @return 0 if partition is valid, 1 otherwise
- */
-static int part_validate_nand(struct mtdids *id, struct part_info *part)
-{
-#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
- /* info for NAND chips */
- nand_info_t *nand;
-
- nand = &nand_info[id->num];
-
- part->sector_size = nand->erasesize;
-
- if ((unsigned long)(part->offset) % nand->erasesize) {
- printf("%s%d: partition (%s) start offset alignment incorrect\n",
- MTD_DEV_TYPE(id->type), id->num, part->name);
- return 1;
- }
-
- if (part->size % nand->erasesize) {
- printf("%s%d: partition (%s) size alignment incorrect\n",
- MTD_DEV_TYPE(id->type), id->num, part->name);
- return 1;
- }
-
- return 0;
-#else
- return 1;
-#endif
-}
-
-/**
- * Performs sanity check for supplied OneNAND flash partition.
- * Table of existing OneNAND flash devices is searched and partition device
- * is located. Alignment with the granularity of nand erasesize is verified.
- *
- * @param id of the parent device
- * @param part partition to validate
- * @return 0 if partition is valid, 1 otherwise
- */
-static int part_validate_onenand(struct mtdids *id, struct part_info *part)
-{
-#if defined(CONFIG_CMD_ONENAND)
- /* info for OneNAND chips */
- struct mtd_info *mtd;
-
- mtd = &onenand_mtd;
-
- part->sector_size = mtd->erasesize;
-
- if ((unsigned long)(part->offset) % mtd->erasesize) {
- printf("%s%d: partition (%s) start offset"
- "alignment incorrect\n",
- MTD_DEV_TYPE(id->type), id->num, part->name);
- return 1;
- }
-
- if (part->size % mtd->erasesize) {
- printf("%s%d: partition (%s) size alignment incorrect\n",
- MTD_DEV_TYPE(id->type), id->num, part->name);
- return 1;
- }
-
- return 0;
-#else
- return 1;
-#endif
-}
-
-
-/**
- * Performs sanity check for supplied partition. Offset and size are verified
- * to be within valid range. Partition type is checked and either
- * parts_validate_nor() or parts_validate_nand() is called with the argument
- * of part.
- *
- * @param id of the parent device
- * @param part partition to validate
- * @return 0 if partition is valid, 1 otherwise
- */
-static int part_validate(struct mtdids *id, struct part_info *part)
-{
- if (part->size == SIZE_REMAINING)
- part->size = id->size - part->offset;
-
- if (part->offset > id->size) {
- printf("%s: offset %08x beyond flash size %08x\n",
- id->mtd_id, part->offset, id->size);
- return 1;
- }
-
- if ((part->offset + part->size) <= part->offset) {
- printf("%s%d: partition (%s) size too big\n",
- MTD_DEV_TYPE(id->type), id->num, part->name);
- return 1;
- }
-
- if (part->offset + part->size > id->size) {
- printf("%s: partitioning exceeds flash size\n", id->mtd_id);
- return 1;
- }
-
- if (id->type == MTD_DEV_TYPE_NAND)
- return part_validate_nand(id, part);
- else if (id->type == MTD_DEV_TYPE_NOR)
- return part_validate_nor(id, part);
- else if (id->type == MTD_DEV_TYPE_ONENAND)
- return part_validate_onenand(id, part);
- else
- DEBUGF("part_validate: invalid dev type\n");
-
- return 1;
-}
-
-/**
- * Delete selected partition from the partion list of the specified device.
- *
- * @param dev device to delete partition from
- * @param part partition to delete
- * @return 0 on success, 1 otherwise
- */
-static int part_del(struct mtd_device *dev, struct part_info *part)
-{
- u8 current_save_needed = 0;
-
- /* if there is only one partition, remove whole device */
- if (dev->num_parts == 1)
- return device_del(dev);
-
- /* otherwise just delete this partition */
-
- if (dev == current_dev) {
- /* we are modyfing partitions for the current device,
- * update current */
- struct part_info *curr_pi;
- curr_pi = jffs2_part_info(current_dev, current_partnum);
-
- if (curr_pi) {
- if (curr_pi == part) {
- printf("current partition deleted, resetting current to 0\n");
- current_partnum = 0;
- } else if (part->offset <= curr_pi->offset) {
- current_partnum--;
- }
- current_save_needed = 1;
- }
- }
-
-#ifdef CONFIG_NAND_LEGACY
- jffs2_free_cache(part);
-#endif
- list_del(&part->link);
- free(part);
- dev->num_parts--;
-
- if (current_save_needed > 0)
- current_save();
- else
- index_partitions();
-
- return 0;
-}
-
-/**
- * Delete all partitions from parts head list, free memory.
- *
- * @param head list of partitions to delete
- */
-static void part_delall(struct list_head *head)
-{
- struct list_head *entry, *n;
- struct part_info *part_tmp;
-
- /* clean tmp_list and free allocated memory */
- list_for_each_safe(entry, n, head) {
- part_tmp = list_entry(entry, struct part_info, link);
-
-#ifdef CONFIG_NAND_LEGACY
- jffs2_free_cache(part_tmp);
-#endif
- list_del(entry);
- free(part_tmp);
- }
-}
-
-/**
- * Add new partition to the supplied partition list. Make sure partitions are
- * sorted by offset in ascending order.
- *
- * @param head list this partition is to be added to
- * @param new partition to be added
- */
-static int part_sort_add(struct mtd_device *dev, struct part_info *part)
-{
- struct list_head *entry;
- struct part_info *new_pi, *curr_pi;
-
- /* link partition to parrent dev */
- part->dev = dev;
-
- if (list_empty(&dev->parts)) {
- DEBUGF("part_sort_add: list empty\n");
- list_add(&part->link, &dev->parts);
- dev->num_parts++;
- index_partitions();
- return 0;
- }
-
- new_pi = list_entry(&part->link, struct part_info, link);
-
- /* get current partition info if we are updating current device */
- curr_pi = NULL;
- if (dev == current_dev)
- curr_pi = jffs2_part_info(current_dev, current_partnum);
-
- list_for_each(entry, &dev->parts) {
- struct part_info *pi;
-
- pi = list_entry(entry, struct part_info, link);
-
- /* be compliant with kernel cmdline, allow only one partition at offset zero */
- if ((new_pi->offset == pi->offset) && (pi->offset == 0)) {
- printf("cannot add second partition at offset 0\n");
- return 1;
- }
-
- if (new_pi->offset <= pi->offset) {
- list_add_tail(&part->link, entry);
- dev->num_parts++;
-
- if (curr_pi && (pi->offset <= curr_pi->offset)) {
- /* we are modyfing partitions for the current
- * device, update current */
- current_partnum++;
- current_save();
- } else {
- index_partitions();
- }
- return 0;
- }
- }
-
- list_add_tail(&part->link, &dev->parts);
- dev->num_parts++;
- index_partitions();
- return 0;
-}
-
-/**
- * Add provided partition to the partition list of a given device.
- *
- * @param dev device to which partition is added
- * @param part partition to be added
- * @return 0 on success, 1 otherwise
- */
-static int part_add(struct mtd_device *dev, struct part_info *part)
-{
- /* verify alignment and size */
- if (part_validate(dev->id, part) != 0)
- return 1;
-
- /* partition is ok, add it to the list */
- if (part_sort_add(dev, part) != 0)
- return 1;
-
- return 0;
-}
-
-/**
- * Parse one partition definition, allocate memory and return pointer to this
- * location in retpart.
- *
- * @param partdef pointer to the partition definition string i.e. <part-def>
- * @param ret output pointer to next char after parse completes (output)
- * @param retpart pointer to the allocated partition (output)
- * @return 0 on success, 1 otherwise
- */
-static int part_parse(const char *const partdef, const char **ret, struct part_info **retpart)
-{
- struct part_info *part;
- unsigned long size;
- unsigned long offset;
- const char *name;
- int name_len;
- unsigned int mask_flags;
- const char *p;
-
- p = partdef;
- *retpart = NULL;
- *ret = NULL;
-
- /* fetch the partition size */
- if (*p == '-') {
- /* assign all remaining space to this partition */
- DEBUGF("'-': remaining size assigned\n");
- size = SIZE_REMAINING;
- p++;
- } else {
- size = memsize_parse(p, &p);
- if (size < MIN_PART_SIZE) {
- printf("partition size too small (%lx)\n", size);
- return 1;
- }
- }
-
- /* check for offset */
- offset = OFFSET_NOT_SPECIFIED;
- if (*p == '@') {
- p++;
- offset = memsize_parse(p, &p);
- }
-
- /* now look for the name */
- if (*p == '(') {
- name = ++p;
- if ((p = strchr(name, ')')) == NULL) {
- printf("no closing ) found in partition name\n");
- return 1;
- }
- name_len = p - name + 1;
- if ((name_len - 1) == 0) {
- printf("empty partition name\n");
- return 1;
- }
- p++;
- } else {
- /* 0x00000000@0x00000000 */
- name_len = 22;
- name = NULL;
- }
-
- /* test for options */
- mask_flags = 0;
- if (strncmp(p, "ro", 2) == 0) {
- mask_flags |= MTD_WRITEABLE_CMD;
- p += 2;
- }
-
- /* check for next partition definition */
- if (*p == ',') {
- if (size == SIZE_REMAINING) {
- *ret = NULL;
- printf("no partitions allowed after a fill-up partition\n");
- return 1;
- }
- *ret = ++p;
- } else if ((*p == ';') || (*p == '\0')) {
- *ret = p;
- } else {
- printf("unexpected character '%c' at the end of partition\n", *p);
- *ret = NULL;
- return 1;
- }
-
- /* allocate memory */
- part = (struct part_info *)malloc(sizeof(struct part_info) + name_len);
- if (!part) {
- printf("out of memory\n");
- return 1;
- }
- memset(part, 0, sizeof(struct part_info) + name_len);
- part->size = size;
- part->offset = offset;
- part->mask_flags = mask_flags;
- part->name = (char *)(part + 1);
-
- if (name) {
- /* copy user provided name */
- strncpy(part->name, name, name_len - 1);
- part->auto_name = 0;
- } else {
- /* auto generated name in form of size@offset */
- sprintf(part->name, "0x%08lx@0x%08lx", size, offset);
- part->auto_name = 1;
- }
-
- part->name[name_len - 1] = '\0';
- INIT_LIST_HEAD(&part->link);
-
- DEBUGF("+ partition: name %-22s size 0x%08x offset 0x%08x mask flags %d\n",
- part->name, part->size,
- part->offset, part->mask_flags);
-
- *retpart = part;
- return 0;
-}
-#endif/* #ifdef CONFIG_JFFS2_CMDLINE */
-
+#ifndef CONFIG_CMD_MTDPARTS
/**
* Check device number to be within valid range for given device type.
*
* @param dev device to validate
* @return 0 if device is valid, 1 otherwise
*/
-static int device_validate(u8 type, u8 num, u32 *size)
+static int mtd_device_validate(u8 type, u8 num, u32 *size)
{
if (type == MTD_DEV_TYPE_NOR) {
#if defined(CONFIG_CMD_FLASH)
@@ -828,310 +207,6 @@ static int device_validate(u8 type, u8 num, u32 *size)
return 1;
}
-#ifdef CONFIG_JFFS2_CMDLINE
-/**
- * Delete all mtd devices from a supplied devices list, free memory allocated for
- * each device and delete all device partitions.
- *
- * @return 0 on success, 1 otherwise
- */
-static int device_delall(struct list_head *head)
-{
- struct list_head *entry, *n;
- struct mtd_device *dev_tmp;
-
- /* clean devices list */
- list_for_each_safe(entry, n, head) {
- dev_tmp = list_entry(entry, struct mtd_device, link);
- list_del(entry);
- part_delall(&dev_tmp->parts);
- free(dev_tmp);
- }
- INIT_LIST_HEAD(&devices);
-
- return 0;
-}
-
-/**
- * If provided device exists it's partitions are deleted, device is removed
- * from device list and device memory is freed.
- *
- * @param dev device to be deleted
- * @return 0 on success, 1 otherwise
- */
-static int device_del(struct mtd_device *dev)
-{
- part_delall(&dev->parts);
- list_del(&dev->link);
- free(dev);
-
- if (dev == current_dev) {
- /* we just deleted current device */
- if (list_empty(&devices)) {
- current_dev = NULL;
- } else {
- /* reset first partition from first dev from the
- * devices list as current */
- current_dev = list_entry(devices.next, struct mtd_device, link);
- current_partnum = 0;
- }
- current_save();
- return 0;
- }
-
- index_partitions();
- return 0;
-}
-
-/**
- * Search global device list and return pointer to the device of type and num
- * specified.
- *
- * @param type device type
- * @param num device number
- * @return NULL if requested device does not exist
- */
-static struct mtd_device* device_find(u8 type, u8 num)
-{
- struct list_head *entry;
- struct mtd_device *dev_tmp;
-
- list_for_each(entry, &devices) {
- dev_tmp = list_entry(entry, struct mtd_device, link);
-
- if ((dev_tmp->id->type == type) && (dev_tmp->id->num == num))
- return dev_tmp;
- }
-
- return NULL;
-}
-
-/**
- * Add specified device to the global device list.
- *
- * @param dev device to be added
- */
-static void device_add(struct mtd_device *dev)
-{
- u8 current_save_needed = 0;
-
- if (list_empty(&devices)) {
- current_dev = dev;
- current_partnum = 0;
- current_save_needed = 1;
- }
-
- list_add_tail(&dev->link, &devices);
-
- if (current_save_needed > 0)
- current_save();
- else
- index_partitions();
-}
-
-/**
- * Parse device type, name and mtd-id. If syntax is ok allocate memory and
- * return pointer to the device structure.
- *
- * @param mtd_dev pointer to the device definition string i.e. <mtd-dev>
- * @param ret output pointer to next char after parse completes (output)
- * @param retdev pointer to the allocated device (output)
- * @return 0 on success, 1 otherwise
- */
-static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_device **retdev)
-{
- struct mtd_device *dev;
- struct part_info *part;
- struct mtdids *id;
- const char *mtd_id;
- unsigned int mtd_id_len;
- const char *p, *pend;
- LIST_HEAD(tmp_list);
- struct list_head *entry, *n;
- u16 num_parts;
- u32 offset;
- int err = 1;
-
- p = mtd_dev;
- *retdev = NULL;
- *ret = NULL;
-
- DEBUGF("===device_parse===\n");
-
- /* fetch <mtd-id> */
- mtd_id = p;
- if (!(p = strchr(mtd_id, ':'))) {
- printf("no <mtd-id> identifier\n");
- return 1;
- }
- mtd_id_len = p - mtd_id + 1;
- p++;
-
- /* verify if we have a valid device specified */
- if ((id = id_find_by_mtd_id(mtd_id, mtd_id_len - 1)) == NULL) {
- printf("invalid mtd device '%.*s'\n", mtd_id_len - 1, mtd_id);
- return 1;
- }
-
- DEBUGF("dev type = %d (%s), dev num = %d, mtd-id = %s\n",
- id->type, MTD_DEV_TYPE(id->type),
- id->num, id->mtd_id);
- pend = strchr(p, ';');
- DEBUGF("parsing partitions %.*s\n", (pend ? pend - p : strlen(p)), p);
-
-
- /* parse partitions */
- num_parts = 0;
-
- offset = 0;
- if ((dev = device_find(id->type, id->num)) != NULL) {
- /* if device already exists start at the end of the last partition */
- part = list_entry(dev->parts.prev, struct part_info, link);
- offset = part->offset + part->size;
- }
-
- while (p && (*p != '\0') && (*p != ';')) {
- err = 1;
- if ((part_parse(p, &p, &part) != 0) || (!part))
- break;
-
- /* calculate offset when not specified */
- if (part->offset == OFFSET_NOT_SPECIFIED)
- part->offset = offset;
- else
- offset = part->offset;
-
- /* verify alignment and size */
- if (part_validate(id, part) != 0)
- break;
-
- offset += part->size;
-
- /* partition is ok, add it to the list */
- list_add_tail(&part->link, &tmp_list);
- num_parts++;
- err = 0;
- }
- if (err == 1) {
- part_delall(&tmp_list);
- return 1;
- }
-
- if (num_parts == 0) {
- printf("no partitions for device %s%d (%s)\n",
- MTD_DEV_TYPE(id->type), id->num, id->mtd_id);
- return 1;
- }
-
- DEBUGF("\ntotal partitions: %d\n", num_parts);
-
- /* check for next device presence */
- if (p) {
- if (*p == ';') {
- *ret = ++p;
- } else if (*p == '\0') {
- *ret = p;
- } else {
- printf("unexpected character '%c' at the end of device\n", *p);
- *ret = NULL;
- return 1;
- }
- }
-
- /* allocate memory for mtd_device structure */
- if ((dev = (struct mtd_device *)malloc(sizeof(struct mtd_device))) == NULL) {
- printf("out of memory\n");
- return 1;
- }
- memset(dev, 0, sizeof(struct mtd_device));
- dev->id = id;
- dev->num_parts = 0; /* part_sort_add increments num_parts */
- INIT_LIST_HEAD(&dev->parts);
- INIT_LIST_HEAD(&dev->link);
-
- /* move partitions from tmp_list to dev->parts */
- list_for_each_safe(entry, n, &tmp_list) {
- part = list_entry(entry, struct part_info, link);
- list_del(entry);
- if (part_sort_add(dev, part) != 0) {
- device_del(dev);
- return 1;
- }
- }
-
- *retdev = dev;
-
- DEBUGF("===\n\n");
- return 0;
-}
-
-/**
- * Initialize global device list.
- *
- * @return 0 on success, 1 otherwise
- */
-static int jffs2_devices_init(void)
-{
- last_parts[0] = '\0';
- current_dev = NULL;
- current_save();
-
- return device_delall(&devices);
-}
-
-/*
- * Search global mtdids list and find id of requested type and number.
- *
- * @return pointer to the id if it exists, NULL otherwise
- */
-static struct mtdids* id_find(u8 type, u8 num)
-{
- struct list_head *entry;
- struct mtdids *id;
-
- list_for_each(entry, &mtdids) {
- id = list_entry(entry, struct mtdids, link);
-
- if ((id->type == type) && (id->num == num))
- return id;
- }
-
- return NULL;
-}
-
-/**
- * Search global mtdids list and find id of a requested mtd_id.
- *
- * Note: first argument is not null terminated.
- *
- * @param mtd_id string containing requested mtd_id
- * @param mtd_id_len length of supplied mtd_id
- * @return pointer to the id if it exists, NULL otherwise
- */
-static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_len)
-{
- struct list_head *entry;
- struct mtdids *id;
-
- DEBUGF("--- id_find_by_mtd_id: '%.*s' (len = %d)\n",
- mtd_id_len, mtd_id, mtd_id_len);
-
- list_for_each(entry, &mtdids) {
- id = list_entry(entry, struct mtdids, link);
-
- DEBUGF("entry: '%s' (len = %d)\n",
- id->mtd_id, strlen(id->mtd_id));
-
- if (mtd_id_len != strlen(id->mtd_id))
- continue;
- if (strncmp(id->mtd_id, mtd_id, mtd_id_len) == 0)
- return id;
- }
-
- return NULL;
-}
-#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
-
/**
* Parse device id string <dev-id> := 'nand'|'nor'|'onenand'<dev-num>,
* return device type and number.
@@ -1142,7 +217,7 @@ static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_
* @param dev_num parsed device number (output)
* @return 0 on success, 1 otherwise
*/
-int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
+static int mtd_id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
{
const char *p = id;
@@ -1172,606 +247,6 @@ int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
return 0;
}
-#ifdef CONFIG_JFFS2_CMDLINE
-/**
- * Process all devices and generate corresponding mtdparts string describing
- * all partitions on all devices.
- *
- * @param buf output buffer holding generated mtdparts string (output)
- * @param buflen buffer size
- * @return 0 on success, 1 otherwise
- */
-static int generate_mtdparts(char *buf, u32 buflen)
-{
- struct list_head *pentry, *dentry;
- struct mtd_device *dev;
- struct part_info *part, *prev_part;
- char *p = buf;
- char tmpbuf[32];
- u32 size, offset, len, part_cnt;
- u32 maxlen = buflen - 1;
-
- DEBUGF("--- generate_mtdparts ---\n");
-
- if (list_empty(&devices)) {
- buf[0] = '\0';
- return 0;
- }
-
- sprintf(p, "mtdparts=");
- p += 9;
-
- list_for_each(dentry, &devices) {
- dev = list_entry(dentry, struct mtd_device, link);
-
- /* copy mtd_id */
- len = strlen(dev->id->mtd_id) + 1;
- if (len > maxlen)
- goto cleanup;
- memcpy(p, dev->id->mtd_id, len - 1);
- p += len - 1;
- *(p++) = ':';
- maxlen -= len;
-
- /* format partitions */
- prev_part = NULL;
- part_cnt = 0;
- list_for_each(pentry, &dev->parts) {
- part = list_entry(pentry, struct part_info, link);
- size = part->size;
- offset = part->offset;
- part_cnt++;
-
- /* partition size */
- memsize_format(tmpbuf, size);
- len = strlen(tmpbuf);
- if (len > maxlen)
- goto cleanup;
- memcpy(p, tmpbuf, len);
- p += len;
- maxlen -= len;
-
-
- /* add offset only when there is a gap between
- * partitions */
- if ((!prev_part && (offset != 0)) ||
- (prev_part && ((prev_part->offset + prev_part->size) != part->offset))) {
-
- memsize_format(tmpbuf, offset);
- len = strlen(tmpbuf) + 1;
- if (len > maxlen)
- goto cleanup;
- *(p++) = '@';
- memcpy(p, tmpbuf, len - 1);
- p += len - 1;
- maxlen -= len;
- }
-
- /* copy name only if user supplied */
- if(!part->auto_name) {
- len = strlen(part->name) + 2;
- if (len > maxlen)
- goto cleanup;
-
- *(p++) = '(';
- memcpy(p, part->name, len - 2);
- p += len - 2;
- *(p++) = ')';
- maxlen -= len;
- }
-
- /* ro mask flag */
- if (part->mask_flags && MTD_WRITEABLE_CMD) {
- len = 2;
- if (len > maxlen)
- goto cleanup;
- *(p++) = 'r';
- *(p++) = 'o';
- maxlen -= 2;
- }
-
- /* print ',' separator if there are other partitions
- * following */
- if (dev->num_parts > part_cnt) {
- if (1 > maxlen)
- goto cleanup;
- *(p++) = ',';
- maxlen--;
- }
- prev_part = part;
- }
- /* print ';' separator if there are other devices following */
- if (dentry->next != &devices) {
- if (1 > maxlen)
- goto cleanup;
- *(p++) = ';';
- maxlen--;
- }
- }
-
- /* we still have at least one char left, as we decremented maxlen at
- * the begining */
- *p = '\0';
-
- return 0;
-
-cleanup:
- last_parts[0] = '\0';
- return 1;
-}
-
-/**
- * Call generate_mtdparts to process all devices and generate corresponding
- * mtdparts string, save it in mtdparts environment variable.
- *
- * @param buf output buffer holding generated mtdparts string (output)
- * @param buflen buffer size
- * @return 0 on success, 1 otherwise
- */
-static int generate_mtdparts_save(char *buf, u32 buflen)
-{
- int ret;
-
- ret = generate_mtdparts(buf, buflen);
-
- if ((buf[0] != '\0') && (ret == 0))
- setenv("mtdparts", buf);
- else
- setenv("mtdparts", NULL);
-
- return ret;
-}
-
-/**
- * Format and print out a partition list for each device from global device
- * list.
- */
-static void list_partitions(void)
-{
- struct list_head *dentry, *pentry;
- struct part_info *part;
- struct mtd_device *dev;
- int part_num;
-
- DEBUGF("\n---list_partitions---\n");
- list_for_each(dentry, &devices) {
- dev = list_entry(dentry, struct mtd_device, link);
- printf("\ndevice %s%d <%s>, # parts = %d\n",
- MTD_DEV_TYPE(dev->id->type), dev->id->num,
- dev->id->mtd_id, dev->num_parts);
- printf(" #: name\t\t\tsize\t\toffset\t\tmask_flags\n");
-
- /* list partitions for given device */
- part_num = 0;
- list_for_each(pentry, &dev->parts) {
- part = list_entry(pentry, struct part_info, link);
- printf("%2d: %-20s0x%08x\t0x%08x\t%d\n",
- part_num, part->name, part->size,
- part->offset, part->mask_flags);
-
- part_num++;
- }
- }
- if (list_empty(&devices))
- printf("no partitions defined\n");
-
- /* current_dev is not NULL only when we have non empty device list */
- if (current_dev) {
- part = jffs2_part_info(current_dev, current_partnum);
- if (part) {
- printf("\nactive partition: %s%d,%d - (%s) 0x%08x @ 0x%08x\n",
- MTD_DEV_TYPE(current_dev->id->type),
- current_dev->id->num, current_partnum,
- part->name, part->size, part->offset);
- } else {
- printf("could not get current partition info\n\n");
- }
- }
-
- printf("\ndefaults:\n");
- printf("mtdids : %s\n", mtdids_default);
- printf("mtdparts: %s\n", mtdparts_default);
-}
-
-/**
- * Given partition identifier in form of <dev_type><dev_num>,<part_num> find
- * corresponding device and verify partition number.
- *
- * @param id string describing device and partition or partition name
- * @param dev pointer to the requested device (output)
- * @param part_num verified partition number (output)
- * @param part pointer to requested partition (output)
- * @return 0 on success, 1 otherwise
- */
-int find_dev_and_part(const char *id, struct mtd_device **dev,
- u8 *part_num, struct part_info **part)
-{
- struct list_head *dentry, *pentry;
- u8 type, dnum, pnum;
- const char *p;
-
- DEBUGF("--- find_dev_and_part ---\nid = %s\n", id);
-
- list_for_each(dentry, &devices) {
- *part_num = 0;
- *dev = list_entry(dentry, struct mtd_device, link);
- list_for_each(pentry, &(*dev)->parts) {
- *part = list_entry(pentry, struct part_info, link);
- if (strcmp((*part)->name, id) == 0)
- return 0;
- (*part_num)++;
- }
- }
-
- p = id;
- *dev = NULL;
- *part = NULL;
- *part_num = 0;
-
- if (id_parse(p, &p, &type, &dnum) != 0)
- return 1;
-
- if ((*p++ != ',') || (*p == '\0')) {
- printf("no partition number specified\n");
- return 1;
- }
- pnum = simple_strtoul(p, (char **)&p, 0);
- if (*p != '\0') {
- printf("unexpected trailing character '%c'\n", *p);
- return 1;
- }
-
- if ((*dev = device_find(type, dnum)) == NULL) {
- printf("no such device %s%d\n", MTD_DEV_TYPE(type), dnum);
- return 1;
- }
-
- if ((*part = jffs2_part_info(*dev, pnum)) == NULL) {
- printf("no such partition\n");
- *dev = NULL;
- return 1;
- }
-
- *part_num = pnum;
-
- return 0;
-}
-
-/**
- * Find and delete partition. For partition id format see find_dev_and_part().
- *
- * @param id string describing device and partition
- * @return 0 on success, 1 otherwise
- */
-static int delete_partition(const char *id)
-{
- u8 pnum;
- struct mtd_device *dev;
- struct part_info *part;
-
- if (find_dev_and_part(id, &dev, &pnum, &part) == 0) {
-
- DEBUGF("delete_partition: device = %s%d, partition %d = (%s) 0x%08lx@0x%08lx\n",
- MTD_DEV_TYPE(dev->id->type), dev->id->num, pnum,
- part->name, part->size, part->offset);
-
- if (part_del(dev, part) != 0)
- return 1;
-
- if (generate_mtdparts_save(last_parts, MTDPARTS_MAXLEN) != 0) {
- printf("generated mtdparts too long, reseting to null\n");
- return 1;
- }
- return 0;
- }
-
- printf("partition %s not found\n", id);
- return 1;
-}
-
-/**
- * Accept character string describing mtd partitions and call device_parse()
- * for each entry. Add created devices to the global devices list.
- *
- * @param mtdparts string specifing mtd partitions
- * @return 0 on success, 1 otherwise
- */
-static int parse_mtdparts(const char *const mtdparts)
-{
- const char *p = mtdparts;
- struct mtd_device *dev;
- int err = 1;
-
- DEBUGF("\n---parse_mtdparts---\nmtdparts = %s\n\n", p);
-
- /* delete all devices and partitions */
- if (jffs2_devices_init() != 0) {
- printf("could not initialise device list\n");
- return err;
- }
-
- /* re-read 'mtdparts' variable, jffs2_devices_init may be updating env */
- p = getenv("mtdparts");
-
- if (strncmp(p, "mtdparts=", 9) != 0) {
- printf("mtdparts variable doesn't start with 'mtdparts='\n");
- return err;
- }
- p += 9;
-
- while (p && (*p != '\0')) {
- err = 1;
- if ((device_parse(p, &p, &dev) != 0) || (!dev))
- break;
-
- DEBUGF("+ device: %s\t%d\t%s\n", MTD_DEV_TYPE(dev->id->type),
- dev->id->num, dev->id->mtd_id);
-
- /* check if parsed device is already on the list */
- if (device_find(dev->id->type, dev->id->num) != NULL) {
- printf("device %s%d redefined, please correct mtdparts variable\n",
- MTD_DEV_TYPE(dev->id->type), dev->id->num);
- break;
- }
-
- list_add_tail(&dev->link, &devices);
- err = 0;
- }
- if (err == 1) {
- device_delall(&devices);
- return 1;
- }
-
- return 0;
-}
-
-/**
- * Parse provided string describing mtdids mapping (see file header for mtdids
- * variable format). Allocate memory for each entry and add all found entries
- * to the global mtdids list.
- *
- * @param ids mapping string
- * @return 0 on success, 1 otherwise
- */
-static int parse_mtdids(const char *const ids)
-{
- const char *p = ids;
- const char *mtd_id;
- int mtd_id_len;
- struct mtdids *id;
- struct list_head *entry, *n;
- struct mtdids *id_tmp;
- u8 type, num;
- u32 size;
- int ret = 1;
-
- DEBUGF("\n---parse_mtdids---\nmtdids = %s\n\n", ids);
-
- /* clean global mtdids list */
- list_for_each_safe(entry, n, &mtdids) {
- id_tmp = list_entry(entry, struct mtdids, link);
- DEBUGF("mtdids del: %d %d\n", id_tmp->type, id_tmp->num);
- list_del(entry);
- free(id_tmp);
- }
- last_ids[0] = '\0';
- INIT_LIST_HEAD(&mtdids);
-
- while(p && (*p != '\0')) {
-
- ret = 1;
- /* parse 'nor'|'nand'|'onenand'<dev-num> */
- if (id_parse(p, &p, &type, &num) != 0)
- break;
-
- if (*p != '=') {
- printf("mtdids: incorrect <dev-num>\n");
- break;
- }
- p++;
-
- /* check if requested device exists */
- if (device_validate(type, num, &size) != 0)
- return 1;
-
- /* locate <mtd-id> */
- mtd_id = p;
- if ((p = strchr(mtd_id, ',')) != NULL) {
- mtd_id_len = p - mtd_id + 1;
- p++;
- } else {
- mtd_id_len = strlen(mtd_id) + 1;
- }
- if (mtd_id_len == 0) {
- printf("mtdids: no <mtd-id> identifier\n");
- break;
- }
-
- /* check if this id is already on the list */
- int double_entry = 0;
- list_for_each(entry, &mtdids) {
- id_tmp = list_entry(entry, struct mtdids, link);
- if ((id_tmp->type == type) && (id_tmp->num == num)) {
- double_entry = 1;
- break;
- }
- }
- if (double_entry) {
- printf("device id %s%d redefined, please correct mtdids variable\n",
- MTD_DEV_TYPE(type), num);
- break;
- }
-
- /* allocate mtdids structure */
- if (!(id = (struct mtdids *)malloc(sizeof(struct mtdids) + mtd_id_len))) {
- printf("out of memory\n");
- break;
- }
- memset(id, 0, sizeof(struct mtdids) + mtd_id_len);
- id->num = num;
- id->type = type;
- id->size = size;
- id->mtd_id = (char *)(id + 1);
- strncpy(id->mtd_id, mtd_id, mtd_id_len - 1);
- id->mtd_id[mtd_id_len - 1] = '\0';
- INIT_LIST_HEAD(&id->link);
-
- DEBUGF("+ id %s%d\t%16d bytes\t%s\n",
- MTD_DEV_TYPE(id->type), id->num,
- id->size, id->mtd_id);
-
- list_add_tail(&id->link, &mtdids);
- ret = 0;
- }
- if (ret == 1) {
- /* clean mtdids list and free allocated memory */
- list_for_each_safe(entry, n, &mtdids) {
- id_tmp = list_entry(entry, struct mtdids, link);
- list_del(entry);
- free(id_tmp);
- }
- return 1;
- }
-
- return 0;
-}
-
-/**
- * Parse and initialize global mtdids mapping and create global
- * device/partition list.
- *
- * @return 0 on success, 1 otherwise
- */
-int mtdparts_init(void)
-{
- static int initialized = 0;
- const char *ids, *parts;
- const char *current_partition;
- int ids_changed;
- char tmp_ep[PARTITION_MAXLEN];
-
- DEBUGF("\n---mtdparts_init---\n");
- if (!initialized) {
- INIT_LIST_HEAD(&mtdids);
- INIT_LIST_HEAD(&devices);
- memset(last_ids, 0, MTDIDS_MAXLEN);
- memset(last_parts, 0, MTDPARTS_MAXLEN);
- memset(last_partition, 0, PARTITION_MAXLEN);
- initialized = 1;
- }
-
- /* get variables */
- ids = getenv("mtdids");
- parts = getenv("mtdparts");
- current_partition = getenv("partition");
-
- /* save it for later parsing, cannot rely on current partition pointer
- * as 'partition' variable may be updated during init */
- tmp_ep[0] = '\0';
- if (current_partition)
- strncpy(tmp_ep, current_partition, PARTITION_MAXLEN);
-
- DEBUGF("last_ids : %s\n", last_ids);
- DEBUGF("env_ids : %s\n", ids);
- DEBUGF("last_parts: %s\n", last_parts);
- DEBUGF("env_parts : %s\n\n", parts);
-
- DEBUGF("last_partition : %s\n", last_partition);
- DEBUGF("env_partition : %s\n", current_partition);
-
- /* if mtdids varible is empty try to use defaults */
- if (!ids) {
- if (mtdids_default) {
- DEBUGF("mtdids variable not defined, using default\n");
- ids = mtdids_default;
- setenv("mtdids", (char *)ids);
- } else {
- printf("mtdids not defined, no default present\n");
- return 1;
- }
- }
- if (strlen(ids) > MTDIDS_MAXLEN - 1) {
- printf("mtdids too long (> %d)\n", MTDIDS_MAXLEN);
- return 1;
- }
-
- /* do no try to use defaults when mtdparts variable is not defined,
- * just check the length */
- if (!parts)
- printf("mtdparts variable not set, see 'help mtdparts'\n");
-
- if (parts && (strlen(parts) > MTDPARTS_MAXLEN - 1)) {
- printf("mtdparts too long (> %d)\n", MTDPARTS_MAXLEN);
- return 1;
- }
-
- /* check if we have already parsed those mtdids */
- if ((last_ids[0] != '\0') && (strcmp(last_ids, ids) == 0)) {
- ids_changed = 0;
- } else {
- ids_changed = 1;
-
- if (parse_mtdids(ids) != 0) {
- jffs2_devices_init();
- return 1;
- }
-
- /* ok it's good, save new ids */
- strncpy(last_ids, ids, MTDIDS_MAXLEN);
- }
-
- /* parse partitions if either mtdparts or mtdids were updated */
- if (parts && ((last_parts[0] == '\0') || ((strcmp(last_parts, parts) != 0)) || ids_changed)) {
- if (parse_mtdparts(parts) != 0)
- return 1;
-
- if (list_empty(&devices)) {
- printf("mtdparts_init: no valid partitions\n");
- return 1;
- }
-
- /* ok it's good, save new parts */
- strncpy(last_parts, parts, MTDPARTS_MAXLEN);
-
- /* reset first partition from first dev from the list as current */
- current_dev = list_entry(devices.next, struct mtd_device, link);
- current_partnum = 0;
- current_save();
-
- DEBUGF("mtdparts_init: current_dev = %s%d, current_partnum = %d\n",
- MTD_DEV_TYPE(current_dev->id->type),
- current_dev->id->num, current_partnum);
- }
-
- /* mtdparts variable was reset to NULL, delete all devices/partitions */
- if (!parts && (last_parts[0] != '\0'))
- return jffs2_devices_init();
-
- /* do not process current partition if mtdparts variable is null */
- if (!parts)
- return 0;
-
- /* is current partition set in environment? if so, use it */
- if ((tmp_ep[0] != '\0') && (strcmp(tmp_ep, last_partition) != 0)) {
- struct part_info *p;
- struct mtd_device *cdev;
- u8 pnum;
-
- DEBUGF("--- getting current partition: %s\n", tmp_ep);
-
- if (find_dev_and_part(tmp_ep, &cdev, &pnum, &p) == 0) {
- current_dev = cdev;
- current_partnum = pnum;
- current_save();
- }
- } else if (getenv("partition") == NULL) {
- DEBUGF("no partition variable set, setting...\n");
- current_save();
- }
-
- return 0;
-}
-#else /* #ifdef CONFIG_JFFS2_CMDLINE */
/*
* 'Static' version of command line mtdparts_init() routine. Single partition on
* a single device configuration.
@@ -1908,8 +383,8 @@ int mtdparts_init(void)
dev_name = "nor0";
#endif
- if ((id_parse(dev_name, NULL, &id->type, &id->num) != 0) ||
- (device_validate(id->type, id->num, &size) != 0)) {
+ if ((mtd_id_parse(dev_name, NULL, &id->type, &id->num) != 0) ||
+ (mtd_device_validate(id->type, id->num, &size) != 0)) {
printf("incorrect device: %s%d\n", MTD_DEV_TYPE(id->type), id->num);
free(current_dev);
return 1;
@@ -1958,7 +433,7 @@ int mtdparts_init(void)
return 0;
}
-#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
+#endif /* #ifndef CONFIG_CMD_MTDPARTS */
/**
* Return pointer to the partition of a requested number from a requested
@@ -2145,155 +620,6 @@ int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 1;
}
-/* command line only */
-#ifdef CONFIG_JFFS2_CMDLINE
-/**
- * Routine implementing u-boot chpart command. Sets new current partition based
- * on the user supplied partition id. For partition id format see find_dev_and_part().
- *
- * @param cmdtp command internal data
- * @param flag command flag
- * @param argc number of arguments supplied to the command
- * @param argv arguments list
- * @return 0 on success, 1 otherwise
- */
-int do_jffs2_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-/* command line only */
- struct mtd_device *dev;
- struct part_info *part;
- u8 pnum;
-
- if (mtdparts_init() !=0)
- return 1;
-
- if (argc < 2) {
- printf("no partition id specified\n");
- return 1;
- }
-
- if (find_dev_and_part(argv[1], &dev, &pnum, &part) != 0)
- return 1;
-
- current_dev = dev;
- current_partnum = pnum;
- current_save();
-
- printf("partition changed to %s%d,%d\n",
- MTD_DEV_TYPE(dev->id->type), dev->id->num, pnum);
-
- return 0;
-}
-
-/**
- * Routine implementing u-boot mtdparts command. Initialize/update default global
- * partition list and process user partition request (list, add, del).
- *
- * @param cmdtp command internal data
- * @param flag command flag
- * @param argc number of arguments supplied to the command
- * @param argv arguments list
- * @return 0 on success, 1 otherwise
- */
-int do_jffs2_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
- if (argc == 2) {
- if (strcmp(argv[1], "default") == 0) {
- setenv("mtdids", (char *)mtdids_default);
- setenv("mtdparts", (char *)mtdparts_default);
- setenv("partition", NULL);
-
- mtdparts_init();
- return 0;
- } else if (strcmp(argv[1], "delall") == 0) {
- /* this may be the first run, initialize lists if needed */
- mtdparts_init();
-
- setenv("mtdparts", NULL);
-
- /* jffs2_devices_init() calls current_save() */
- return jffs2_devices_init();
- }
- }
-
- /* make sure we are in sync with env variables */
- if (mtdparts_init() != 0)
- return 1;
-
- if (argc == 1) {
- list_partitions();
- return 0;
- }
-
- /* mtdparts add <mtd-dev> <size>[@<offset>] <name> [ro] */
- if (((argc == 5) || (argc == 6)) && (strcmp(argv[1], "add") == 0)) {
-#define PART_ADD_DESC_MAXLEN 64
- char tmpbuf[PART_ADD_DESC_MAXLEN];
- u8 type, num, len;
- struct mtd_device *dev;
- struct mtd_device *dev_tmp;
- struct mtdids *id;
- struct part_info *p;
-
- if (id_parse(argv[2], NULL, &type, &num) != 0)
- return 1;
-
- if ((id = id_find(type, num)) == NULL) {
- printf("no such device %s defined in mtdids variable\n", argv[2]);
- return 1;
- }
-
- len = strlen(id->mtd_id) + 1; /* 'mtd_id:' */
- len += strlen(argv[3]); /* size@offset */
- len += strlen(argv[4]) + 2; /* '(' name ')' */
- if (argv[5] && (strlen(argv[5]) == 2))
- len += 2; /* 'ro' */
-
- if (len >= PART_ADD_DESC_MAXLEN) {
- printf("too long partition description\n");
- return 1;
- }
- sprintf(tmpbuf, "%s:%s(%s)%s",
- id->mtd_id, argv[3], argv[4], argv[5] ? argv[5] : "");
- DEBUGF("add tmpbuf: %s\n", tmpbuf);
-
- if ((device_parse(tmpbuf, NULL, &dev) != 0) || (!dev))
- return 1;
-
- DEBUGF("+ %s\t%d\t%s\n", MTD_DEV_TYPE(dev->id->type),
- dev->id->num, dev->id->mtd_id);
-
- if ((dev_tmp = device_find(dev->id->type, dev->id->num)) == NULL) {
- device_add(dev);
- } else {
- /* merge new partition with existing ones*/
- p = list_entry(dev->parts.next, struct part_info, link);
- if (part_add(dev_tmp, p) != 0) {
- device_del(dev);
- return 1;
- }
- }
-
- if (generate_mtdparts_save(last_parts, MTDPARTS_MAXLEN) != 0) {
- printf("generated mtdparts too long, reseting to null\n");
- return 1;
- }
-
- return 0;
- }
-
- /* mtdparts del part-id */
- if ((argc == 3) && (strcmp(argv[1], "del") == 0)) {
- DEBUGF("del: part-id = %s\n", argv[2]);
-
- return delete_partition(argv[2]);
- }
-
- cmd_usage(cmdtp);
- return 1;
-}
-#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
-
/***************************************************/
U_BOOT_CMD(
fsload, 3, 0, do_jffs2_fsload,
@@ -2314,49 +640,4 @@ U_BOOT_CMD(
"print information about filesystems",
" - print information about filesystems\n"
);
-
-#ifdef CONFIG_JFFS2_CMDLINE
-U_BOOT_CMD(
- chpart, 2, 0, do_jffs2_chpart,
- "change active partition",
- "part-id\n"
- " - change active partition (e.g. part-id = nand0,1)\n"
-);
-
-U_BOOT_CMD(
- mtdparts, 6, 0, do_jffs2_mtdparts,
- "define flash/nand partitions",
- "\n"
- " - list partition table\n"
- "mtdparts delall\n"
- " - delete all partitions\n"
- "mtdparts del part-id\n"
- " - delete partition (e.g. part-id = nand0,1)\n"
- "mtdparts add <mtd-dev> <size>[@<offset>] [<name>] [ro]\n"
- " - add partition\n"
- "mtdparts default\n"
- " - reset partition table to defaults\n\n"
- "-----\n\n"
- "this command uses three environment variables:\n\n"
- "'partition' - keeps current partition identifier\n\n"
- "partition := <part-id>\n"
- "<part-id> := <dev-id>,part_num\n\n"
- "'mtdids' - linux kernel mtd device id <-> u-boot device id mapping\n\n"
- "mtdids=<idmap>[,<idmap>,...]\n\n"
- "<idmap> := <dev-id>=<mtd-id>\n"
- "<dev-id> := 'nand'|'nor'|'onenand'<dev-num>\n"
- "<dev-num> := mtd device number, 0...\n"
- "<mtd-id> := unique device tag used by linux kernel to find mtd device (mtd->name)\n\n"
- "'mtdparts' - partition list\n\n"
- "mtdparts=mtdparts=<mtd-def>[;<mtd-def>...]\n\n"
- "<mtd-def> := <mtd-id>:<part-def>[,<part-def>...]\n"
- "<mtd-id> := unique device tag used by linux kernel to find mtd device (mtd->name)\n"
- "<part-def> := <size>[@<offset>][<name>][<ro-flag>]\n"
- "<size> := standard linux memsize OR '-' to denote all remaining space\n"
- "<offset> := partition start offset within the device\n"
- "<name> := '(' NAME ')'\n"
- "<ro-flag> := when set to 'ro' makes partition read-only (not used, passed to kernel)\n"
-);
-#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
-
/***************************************************/
diff --git a/common/cmd_jffs2.c b/common/cmd_mtdparts.c
similarity index 82%
copy from common/cmd_jffs2.c
copy to common/cmd_mtdparts.c
index d0a7cea..c8bf2c6 100644
--- a/common/cmd_jffs2.c
+++ b/common/cmd_mtdparts.c
@@ -111,10 +111,10 @@
#endif
/* enable/disable debugging messages */
-#define DEBUG_JFFS
-#undef DEBUG_JFFS
+#define DEBUG_MTDPARTS
+#undef DEBUG_MTDPARTS
-#ifdef DEBUG_JFFS
+#ifdef DEBUG_MTDPARTS
# define DEBUGF(fmt, args...) printf(fmt ,##args)
#else
# define DEBUGF(fmt, args...)
@@ -136,7 +136,6 @@
* field for read-only partitions */
#define MTD_WRITEABLE_CMD 1
-#ifdef CONFIG_JFFS2_CMDLINE
/* default values for mtdids and mtdparts variables */
#if defined(MTDIDS_DEFAULT)
static const char *const mtdids_default = MTDIDS_DEFAULT;
@@ -168,31 +167,14 @@ struct list_head mtdids;
/* device/partition list, parse_cmdline() parses into here */
struct list_head devices;
-#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
/* current active device and partition number */
static struct mtd_device *current_dev = NULL;
static u8 current_partnum = 0;
-#if defined(CONFIG_CMD_CRAMFS)
-extern int cramfs_check (struct part_info *info);
-extern int cramfs_load (char *loadoffset, struct part_info *info, char *filename);
-extern int cramfs_ls (struct part_info *info, char *filename);
-extern int cramfs_info (struct part_info *info);
-#else
-/* defining empty macros for function names is ugly but avoids ifdef clutter
- * all over the code */
-#define cramfs_check(x) (0)
-#define cramfs_load(x,y,z) (-1)
-#define cramfs_ls(x,y) (0)
-#define cramfs_info(x) (0)
-#endif
-
-static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int part_num);
+static struct part_info* mtd_part_info(struct mtd_device *dev, unsigned int part_num);
/* command line only routines */
-#ifdef CONFIG_JFFS2_CMDLINE
-
static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_len);
static int device_del(struct mtd_device *dev);
@@ -285,7 +267,7 @@ static void index_partitions(void)
mtddevnum += dev->num_parts;
}
- part = jffs2_part_info(current_dev, current_partnum);
+ part = mtd_part_info(current_dev, current_partnum);
setenv("mtddevname", part->name);
DEBUGF("=> mtddevnum %d,\n=> mtddevname %s\n", mtddevnum, part->name);
@@ -523,7 +505,7 @@ static int part_del(struct mtd_device *dev, struct part_info *part)
/* we are modyfing partitions for the current device,
* update current */
struct part_info *curr_pi;
- curr_pi = jffs2_part_info(current_dev, current_partnum);
+ curr_pi = mtd_part_info(current_dev, current_partnum);
if (curr_pi) {
if (curr_pi == part) {
@@ -601,7 +583,7 @@ static int part_sort_add(struct mtd_device *dev, struct part_info *part)
/* get current partition info if we are updating current device */
curr_pi = NULL;
if (dev == current_dev)
- curr_pi = jffs2_part_info(current_dev, current_partnum);
+ curr_pi = mtd_part_info(current_dev, current_partnum);
list_for_each(entry, &dev->parts) {
struct part_info *pi;
@@ -774,7 +756,6 @@ static int part_parse(const char *const partdef, const char **ret, struct part_i
*retpart = part;
return 0;
}
-#endif/* #ifdef CONFIG_JFFS2_CMDLINE */
/**
* Check device number to be within valid range for given device type.
@@ -782,7 +763,7 @@ static int part_parse(const char *const partdef, const char **ret, struct part_i
* @param dev device to validate
* @return 0 if device is valid, 1 otherwise
*/
-static int device_validate(u8 type, u8 num, u32 *size)
+int mtd_device_validate(u8 type, u8 num, u32 *size)
{
if (type == MTD_DEV_TYPE_NOR) {
#if defined(CONFIG_CMD_FLASH)
@@ -828,7 +809,6 @@ static int device_validate(u8 type, u8 num, u32 *size)
return 1;
}
-#ifdef CONFIG_JFFS2_CMDLINE
/**
* Delete all mtd devices from a supplied devices list, free memory allocated for
* each device and delete all device partitions.
@@ -1070,7 +1050,7 @@ static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_
*
* @return 0 on success, 1 otherwise
*/
-static int jffs2_devices_init(void)
+static int mtd_devices_init(void)
{
last_parts[0] = '\0';
current_dev = NULL;
@@ -1130,7 +1110,6 @@ static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_
return NULL;
}
-#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
/**
* Parse device id string <dev-id> := 'nand'|'nor'|'onenand'<dev-num>,
@@ -1142,7 +1121,7 @@ static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_
* @param dev_num parsed device number (output)
* @return 0 on success, 1 otherwise
*/
-int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
+int mtd_id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
{
const char *p = id;
@@ -1172,7 +1151,6 @@ int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
return 0;
}
-#ifdef CONFIG_JFFS2_CMDLINE
/**
* Process all devices and generate corresponding mtdparts string describing
* all partitions on all devices.
@@ -1357,7 +1335,7 @@ static void list_partitions(void)
/* current_dev is not NULL only when we have non empty device list */
if (current_dev) {
- part = jffs2_part_info(current_dev, current_partnum);
+ part = mtd_part_info(current_dev, current_partnum);
if (part) {
printf("\nactive partition: %s%d,%d - (%s) 0x%08x @ 0x%08x\n",
MTD_DEV_TYPE(current_dev->id->type),
@@ -1408,7 +1386,7 @@ int find_dev_and_part(const char *id, struct mtd_device **dev,
*part = NULL;
*part_num = 0;
- if (id_parse(p, &p, &type, &dnum) != 0)
+ if (mtd_id_parse(p, &p, &type, &dnum) != 0)
return 1;
if ((*p++ != ',') || (*p == '\0')) {
@@ -1426,7 +1404,7 @@ int find_dev_and_part(const char *id, struct mtd_device **dev,
return 1;
}
- if ((*part = jffs2_part_info(*dev, pnum)) == NULL) {
+ if ((*part = mtd_part_info(*dev, pnum)) == NULL) {
printf("no such partition\n");
*dev = NULL;
return 1;
@@ -1485,12 +1463,12 @@ static int parse_mtdparts(const char *const mtdparts)
DEBUGF("\n---parse_mtdparts---\nmtdparts = %s\n\n", p);
/* delete all devices and partitions */
- if (jffs2_devices_init() != 0) {
+ if (mtd_devices_init() != 0) {
printf("could not initialise device list\n");
return err;
}
- /* re-read 'mtdparts' variable, jffs2_devices_init may be updating env */
+ /* re-read 'mtdparts' variable, mtd_devices_init may be updating env */
p = getenv("mtdparts");
if (strncmp(p, "mtdparts=", 9) != 0) {
@@ -1561,7 +1539,7 @@ static int parse_mtdids(const char *const ids)
ret = 1;
/* parse 'nor'|'nand'|'onenand'<dev-num> */
- if (id_parse(p, &p, &type, &num) != 0)
+ if (mtd_id_parse(p, &p, &type, &num) != 0)
break;
if (*p != '=') {
@@ -1571,7 +1549,7 @@ static int parse_mtdids(const char *const ids)
p++;
/* check if requested device exists */
- if (device_validate(type, num, &size) != 0)
+ if (mtd_device_validate(type, num, &size) != 0)
return 1;
/* locate <mtd-id> */
@@ -1712,7 +1690,7 @@ int mtdparts_init(void)
ids_changed = 1;
if (parse_mtdids(ids) != 0) {
- jffs2_devices_init();
+ mtd_devices_init();
return 1;
}
@@ -1745,7 +1723,7 @@ int mtdparts_init(void)
/* mtdparts variable was reset to NULL, delete all devices/partitions */
if (!parts && (last_parts[0] != '\0'))
- return jffs2_devices_init();
+ return mtd_devices_init();
/* do not process current partition if mtdparts variable is null */
if (!parts)
@@ -1771,194 +1749,6 @@ int mtdparts_init(void)
return 0;
}
-#else /* #ifdef CONFIG_JFFS2_CMDLINE */
-/*
- * 'Static' version of command line mtdparts_init() routine. Single partition on
- * a single device configuration.
- */
-
-/**
- * Calculate sector size.
- *
- * @return sector size
- */
-static inline u32 get_part_sector_size_nand(struct mtdids *id)
-{
-#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
-#if defined(CONFIG_NAND_LEGACY)
- extern struct nand_chip nand_dev_desc[CONFIG_SYS_MAX_NAND_DEVICE];
-
- return nand_dev_desc[id->num].erasesize;
-#else
- nand_info_t *nand;
-
- nand = &nand_info[id->num];
-
- return nand->erasesize;
-#endif
-#else
- BUG();
- return 0;
-#endif
-}
-
-static inline u32 get_part_sector_size_nor(struct mtdids *id, struct part_info *part)
-{
-#if defined(CONFIG_CMD_FLASH)
- extern flash_info_t flash_info[];
-
- u32 end_phys, start_phys, sector_size = 0, size = 0;
- int i;
- flash_info_t *flash;
-
- flash = &flash_info[id->num];
-
- start_phys = flash->start[0] + part->offset;
- end_phys = start_phys + part->size;
-
- for (i = 0; i < flash->sector_count; i++) {
- if (flash->start[i] >= end_phys)
- break;
-
- if (flash->start[i] >= start_phys) {
- if (i == flash->sector_count - 1) {
- size = flash->start[0] + flash->size - flash->start[i];
- } else {
- size = flash->start[i+1] - flash->start[i];
- }
-
- if (sector_size < size)
- sector_size = size;
- }
- }
-
- return sector_size;
-#else
- BUG();
- return 0;
-#endif
-}
-
-static inline u32 get_part_sector_size_onenand(void)
-{
-#if defined(CONFIG_CMD_ONENAND)
- struct mtd_info *mtd;
-
- mtd = &onenand_mtd;
-
- return mtd->erasesize;
-#else
- BUG();
- return 0;
-#endif
-}
-
-static inline u32 get_part_sector_size(struct mtdids *id, struct part_info *part)
-{
- if (id->type == MTD_DEV_TYPE_NAND)
- return get_part_sector_size_nand(id);
- else if (id->type == MTD_DEV_TYPE_NOR)
- return get_part_sector_size_nor(id, part);
- else if (id->type == MTD_DEV_TYPE_ONENAND)
- return get_part_sector_size_onenand();
- else
- DEBUGF("Error: Unknown device type.\n");
-
- return 0;
-}
-
-/**
- * Parse and initialize global mtdids mapping and create global
- * device/partition list.
- *
- * @return 0 on success, 1 otherwise
- */
-int mtdparts_init(void)
-{
- static int initialized = 0;
- u32 size;
- char *dev_name;
-
- DEBUGF("\n---mtdparts_init---\n");
- if (!initialized) {
- struct mtdids *id;
- struct part_info *part;
-
- initialized = 1;
- current_dev = (struct mtd_device *)
- malloc(sizeof(struct mtd_device) +
- sizeof(struct part_info) +
- sizeof(struct mtdids));
- if (!current_dev) {
- printf("out of memory\n");
- return 1;
- }
- memset(current_dev, 0, sizeof(struct mtd_device) +
- sizeof(struct part_info) + sizeof(struct mtdids));
-
- id = (struct mtdids *)(current_dev + 1);
- part = (struct part_info *)(id + 1);
-
- /* id */
- id->mtd_id = "single part";
-
-#if defined(CONFIG_JFFS2_DEV)
- dev_name = CONFIG_JFFS2_DEV;
-#else
- dev_name = "nor0";
-#endif
-
- if ((id_parse(dev_name, NULL, &id->type, &id->num) != 0) ||
- (device_validate(id->type, id->num, &size) != 0)) {
- printf("incorrect device: %s%d\n", MTD_DEV_TYPE(id->type), id->num);
- free(current_dev);
- return 1;
- }
- id->size = size;
- INIT_LIST_HEAD(&id->link);
-
- DEBUGF("dev id: type = %d, num = %d, size = 0x%08lx, mtd_id = %s\n",
- id->type, id->num, id->size, id->mtd_id);
-
- /* partition */
- part->name = "static";
- part->auto_name = 0;
-
-#if defined(CONFIG_JFFS2_PART_SIZE)
- part->size = CONFIG_JFFS2_PART_SIZE;
-#else
- part->size = SIZE_REMAINING;
-#endif
-
-#if defined(CONFIG_JFFS2_PART_OFFSET)
- part->offset = CONFIG_JFFS2_PART_OFFSET;
-#else
- part->offset = 0x00000000;
-#endif
-
- part->sector_size = get_part_sector_size(id, part);
-
- part->dev = current_dev;
- INIT_LIST_HEAD(&part->link);
-
- /* recalculate size if needed */
- if (part->size == SIZE_REMAINING)
- part->size = id->size - part->offset;
-
- DEBUGF("part : name = %s, size = 0x%08lx, offset = 0x%08lx\n",
- part->name, part->size, part->offset);
-
- /* device */
- current_dev->id = id;
- INIT_LIST_HEAD(¤t_dev->link);
- current_dev->num_parts = 1;
- INIT_LIST_HEAD(¤t_dev->parts);
- list_add(&part->link, ¤t_dev->parts);
- }
-
- return 0;
-}
-#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
/**
* Return pointer to the partition of a requested number from a requested
@@ -1968,7 +1758,7 @@ int mtdparts_init(void)
* @param part_num requested partition number
* @return pointer to the part_info, NULL otherwise
*/
-static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int part_num)
+static struct part_info* mtd_part_info(struct mtd_device *dev, unsigned int part_num)
{
struct list_head *entry;
struct part_info *part;
@@ -1977,7 +1767,7 @@ static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int pa
if (!dev)
return NULL;
- DEBUGF("\n--- jffs2_part_info: partition number %d for device %s%d (%s)\n",
+ DEBUGF("\n--- mtd_part_info: partition number %d for device %s%d (%s)\n",
part_num, MTD_DEV_TYPE(dev->id->type),
dev->id->num, dev->id->mtd_id);
@@ -2004,149 +1794,7 @@ static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int pa
/***************************************************/
/* U-boot commands */
/***************************************************/
-
-/**
- * Routine implementing fsload u-boot command. This routine tries to load
- * a requested file from jffs2/cramfs filesystem on a current partition.
- *
- * @param cmdtp command internal data
- * @param flag command flag
- * @param argc number of arguments supplied to the command
- * @param argv arguments list
- * @return 0 on success, 1 otherwise
- */
-int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
- char *fsname;
- char *filename;
- int size;
- struct part_info *part;
- ulong offset = load_addr;
-
- /* pre-set Boot file name */
- if ((filename = getenv("bootfile")) == NULL) {
- filename = "uImage";
- }
-
- if (argc == 2) {
- filename = argv[1];
- }
- if (argc == 3) {
- offset = simple_strtoul(argv[1], NULL, 16);
- load_addr = offset;
- filename = argv[2];
- }
-
- /* make sure we are in sync with env variables */
- if (mtdparts_init() !=0)
- return 1;
-
- if ((part = jffs2_part_info(current_dev, current_partnum))){
-
- /* check partition type for cramfs */
- fsname = (cramfs_check(part) ? "CRAMFS" : "JFFS2");
- printf("### %s loading '%s' to 0x%lx\n", fsname, filename, offset);
-
- if (cramfs_check(part)) {
- size = cramfs_load ((char *) offset, part, filename);
- } else {
- /* if this is not cramfs assume jffs2 */
- size = jffs2_1pass_load((char *)offset, part, filename);
- }
-
- if (size > 0) {
- char buf[10];
- printf("### %s load complete: %d bytes loaded to 0x%lx\n",
- fsname, size, offset);
- sprintf(buf, "%x", size);
- setenv("filesize", buf);
- } else {
- printf("### %s LOAD ERROR<%x> for %s!\n", fsname, size, filename);
- }
-
- return !(size > 0);
- }
- return 1;
-}
-
-/**
- * Routine implementing u-boot ls command which lists content of a given
- * directory on a current partition.
- *
- * @param cmdtp command internal data
- * @param flag command flag
- * @param argc number of arguments supplied to the command
- * @param argv arguments list
- * @return 0 on success, 1 otherwise
- */
-int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
- char *filename = "/";
- int ret;
- struct part_info *part;
-
- if (argc == 2)
- filename = argv[1];
-
- /* make sure we are in sync with env variables */
- if (mtdparts_init() !=0)
- return 1;
-
- if ((part = jffs2_part_info(current_dev, current_partnum))){
-
- /* check partition type for cramfs */
- if (cramfs_check(part)) {
- ret = cramfs_ls (part, filename);
- } else {
- /* if this is not cramfs assume jffs2 */
- ret = jffs2_1pass_ls(part, filename);
- }
-
- return ret ? 0 : 1;
- }
- return 1;
-}
-
-/**
- * Routine implementing u-boot fsinfo command. This routine prints out
- * miscellaneous filesystem informations/statistics.
- *
- * @param cmdtp command internal data
- * @param flag command flag
- * @param argc number of arguments supplied to the command
- * @param argv arguments list
- * @return 0 on success, 1 otherwise
- */
-int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
- struct part_info *part;
- char *fsname;
- int ret;
-
- /* make sure we are in sync with env variables */
- if (mtdparts_init() !=0)
- return 1;
-
- if ((part = jffs2_part_info(current_dev, current_partnum))){
-
- /* check partition type for cramfs */
- fsname = (cramfs_check(part) ? "CRAMFS" : "JFFS2");
- printf("### filesystem type is %s\n", fsname);
-
- if (cramfs_check(part)) {
- ret = cramfs_info (part);
- } else {
- /* if this is not cramfs assume jffs2 */
- ret = jffs2_1pass_info(part);
- }
-
- return ret ? 0 : 1;
- }
- return 1;
-}
-
/* command line only */
-#ifdef CONFIG_JFFS2_CMDLINE
/**
* Routine implementing u-boot chpart command. Sets new current partition based
* on the user supplied partition id. For partition id format see find_dev_and_part().
@@ -2157,7 +1805,7 @@ int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
* @param argv arguments list
* @return 0 on success, 1 otherwise
*/
-int do_jffs2_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
/* command line only */
struct mtd_device *dev;
@@ -2195,7 +1843,7 @@ int do_jffs2_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
* @param argv arguments list
* @return 0 on success, 1 otherwise
*/
-int do_jffs2_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
if (argc == 2) {
if (strcmp(argv[1], "default") == 0) {
@@ -2211,8 +1859,8 @@ int do_jffs2_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
setenv("mtdparts", NULL);
- /* jffs2_devices_init() calls current_save() */
- return jffs2_devices_init();
+ /* mtd_devices_init() calls current_save() */
+ return mtd_devices_init();
}
}
@@ -2235,7 +1883,7 @@ int do_jffs2_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
struct mtdids *id;
struct part_info *p;
- if (id_parse(argv[2], NULL, &type, &num) != 0)
+ if (mtd_id_parse(argv[2], NULL, &type, &num) != 0)
return 1;
if ((id = id_find(type, num)) == NULL) {
@@ -2292,39 +1940,17 @@ int do_jffs2_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
cmd_usage(cmdtp);
return 1;
}
-#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
/***************************************************/
U_BOOT_CMD(
- fsload, 3, 0, do_jffs2_fsload,
- "load binary file from a filesystem image",
- "[ off ] [ filename ]\n"
- " - load binary file from flash bank\n"
- " with offset 'off'\n"
-);
-U_BOOT_CMD(
- ls, 2, 1, do_jffs2_ls,
- "list files in a directory (default /)",
- "[ directory ]\n"
- " - list files in a directory.\n"
-);
-
-U_BOOT_CMD(
- fsinfo, 1, 1, do_jffs2_fsinfo,
- "print information about filesystems",
- " - print information about filesystems\n"
-);
-
-#ifdef CONFIG_JFFS2_CMDLINE
-U_BOOT_CMD(
- chpart, 2, 0, do_jffs2_chpart,
+ chpart, 2, 0, do_chpart,
"change active partition",
"part-id\n"
" - change active partition (e.g. part-id = nand0,1)\n"
);
U_BOOT_CMD(
- mtdparts, 6, 0, do_jffs2_mtdparts,
+ mtdparts, 6, 0, do_mtdparts,
"define flash/nand partitions",
"\n"
" - list partition table\n"
@@ -2357,6 +1983,4 @@ U_BOOT_CMD(
"<name> := '(' NAME ')'\n"
"<ro-flag> := when set to 'ro' makes partition read-only (not used, passed to kernel)\n"
);
-#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
-
/***************************************************/
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index e6623ca..04b3200 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -29,7 +29,7 @@
#include <jffs2/jffs2.h>
#include <nand.h>
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
/* parition handling routines */
int mtdparts_init(void);
@@ -105,7 +105,7 @@ static int
arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size)
{
int idx = nand_curr_device;
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
struct mtd_device *dev;
struct part_info *part;
u8 pnum;
@@ -153,7 +153,7 @@ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size
*size = nand->size - *off;
}
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
out:
#endif
printf("device %d ", idx);
@@ -589,7 +589,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
char *boot_device = NULL;
int idx;
ulong addr, offset = 0;
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
struct mtd_device *dev;
struct part_info *part;
u8 pnum;
@@ -634,7 +634,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
offset = simple_strtoul(argv[3], NULL, 16);
break;
default:
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
usage:
#endif
cmd_usage(cmdtp);
diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h
index 205dd1f..db1f55c 100644
--- a/include/config_cmd_all.h
+++ b/include/config_cmd_all.h
@@ -58,6 +58,7 @@
#define CONFIG_CMD_MII /* MII support */
#define CONFIG_CMD_MISC /* Misc functions like sleep etc*/
#define CONFIG_CMD_MMC /* MMC support */
+#define CONFIG_CMD_MTDPARTS /* mtd parts support */
#define CONFIG_CMD_NAND /* NAND support */
#define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
#define CONFIG_CMD_NFS /* NFS support */
diff --git a/include/configs/ADNPESC1.h b/include/configs/ADNPESC1.h
index e61a3e1..0977bee 100644
--- a/include/configs/ADNPESC1.h
+++ b/include/configs/ADNPESC1.h
@@ -673,14 +673,14 @@
*
*/
/* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
/* mtdparts command line support */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT ""
#define MTDPARTS_DEFAULT ""
*/
diff --git a/include/configs/Alaska8220.h b/include/configs/Alaska8220.h
index 2581fdf..576aa74 100644
--- a/include/configs/Alaska8220.h
+++ b/include/configs/Alaska8220.h
@@ -320,7 +320,7 @@
/* No command line, one static partition */
/*
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0x00400000
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -328,7 +328,7 @@
/* mtdparts command line support */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=alaska-0"
#define MTDPARTS_DEFAULT "mtdparts=alaska-0:4m(user)"
*/
diff --git a/include/configs/BAB7xx.h b/include/configs/BAB7xx.h
index 1910b34..40a1c40 100644
--- a/include/configs/BAB7xx.h
+++ b/include/configs/BAB7xx.h
@@ -219,7 +219,7 @@
*
*/
/* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -229,7 +229,7 @@
* Note: fake mtd_id used, no linux mtd map file
*/
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=bab7xx-0"
#define MTDPARTS_DEFAULT "mtdparts=bab7xx-0:-(jffs2)"
*/
diff --git a/include/configs/BC3450.h b/include/configs/BC3450.h
index bced118..9934f29 100644
--- a/include/configs/BC3450.h
+++ b/include/configs/BC3450.h
@@ -346,7 +346,7 @@
#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
/* Dynamic MTD partition support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM5200-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:640k(firmware)," \
"1408k(kernel)," \
diff --git a/include/configs/CATcenter.h b/include/configs/CATcenter.h
index fa9fc23..39f41e6 100644
--- a/include/configs/CATcenter.h
+++ b/include/configs/CATcenter.h
@@ -781,7 +781,7 @@
*
*/
/* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nand"
#define CONFIG_JFFS2_PART_SIZE 0x00200000
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -791,7 +791,7 @@
* Note: fake mtd_id used, no linux mtd map file
*/
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nand0=catcenter"
#define MTDPARTS_DEFAULT "mtdparts=catcenter:2m(nand)"
*/
diff --git a/include/configs/DB64360.h b/include/configs/DB64360.h
index daed934..160871b 100644
--- a/include/configs/DB64360.h
+++ b/include/configs/DB64360.h
@@ -230,7 +230,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor1"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -242,7 +242,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
* Note: fake mtd_id's used, no linux mtd map file.
*/
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor1=db64360-1"
#define MTDPARTS_DEFAULT "mtdparts=db64360-1:-(jffs2)"
*/
diff --git a/include/configs/DB64460.h b/include/configs/DB64460.h
index 604fd45..06fd157 100644
--- a/include/configs/DB64460.h
+++ b/include/configs/DB64460.h
@@ -168,7 +168,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor1"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -180,7 +180,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
* Note: fake mtd_id's used, no linux mtd map file.
*/
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor1=db64460-1"
#define MTDPARTS_DEFAULT "mtdparts=db64460-1:-(jffs2)"
*/
diff --git a/include/configs/DK1C20.h b/include/configs/DK1C20.h
index 6fdc566..db9c17d 100644
--- a/include/configs/DK1C20.h
+++ b/include/configs/DK1C20.h
@@ -539,14 +539,14 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
/* mtdparts command line support */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT ""
#define MTDPARTS_DEFAULT ""
*/
diff --git a/include/configs/DK1S10.h b/include/configs/DK1S10.h
index 1d031f1..3bd270c 100644
--- a/include/configs/DK1S10.h
+++ b/include/configs/DK1S10.h
@@ -545,14 +545,14 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
/* mtdparts command line support */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT ""
#define MTDPARTS_DEFAULT ""
*/
diff --git a/include/configs/ELPPC.h b/include/configs/ELPPC.h
index 7939266..d2aa8b9 100644
--- a/include/configs/ELPPC.h
+++ b/include/configs/ELPPC.h
@@ -196,7 +196,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -204,7 +204,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=elppc-0,nor1=elppc-1"
#define MTDPARTS_DEFAULT "mtdparts=elppc-0:-(jffs2),elppc-1:-(user)"
*/
diff --git a/include/configs/FPS850L.h b/include/configs/FPS850L.h
index 08408e2..f152230 100644
--- a/include/configs/FPS850L.h
+++ b/include/configs/FPS850L.h
@@ -216,7 +216,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
diff --git a/include/configs/FPS860L.h b/include/configs/FPS860L.h
index e5f3b60..5eaed84 100644
--- a/include/configs/FPS860L.h
+++ b/include/configs/FPS860L.h
@@ -216,7 +216,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
diff --git a/include/configs/LANTEC.h b/include/configs/LANTEC.h
index f14d945..6e8a4b8 100644
--- a/include/configs/LANTEC.h
+++ b/include/configs/LANTEC.h
@@ -352,14 +352,14 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
/* mtdparts command line support */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT ""
#define MTDPARTS_DEFAULT ""
*/
diff --git a/include/configs/MHPC.h b/include/configs/MHPC.h
index 8e7f9cd..19a288c 100644
--- a/include/configs/MHPC.h
+++ b/include/configs/MHPC.h
@@ -200,7 +200,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -208,7 +208,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=mhpc-0"
#define MTDPARTS_DEFAULT "mtdparts=mhpc-0:-(jffs2)"
*/
diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h
index c58ce05..a3869c8 100644
--- a/include/configs/MIP405.h
+++ b/include/configs/MIP405.h
@@ -243,7 +243,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -251,7 +251,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=mip405-0"
#define MTDPARTS_DEFAULT "mtdparts=mip405-0:-(jffs2)"
*/
diff --git a/include/configs/ML2.h b/include/configs/ML2.h
index 1902397..5fcc173 100644
--- a/include/configs/ML2.h
+++ b/include/configs/ML2.h
@@ -249,7 +249,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00080000
@@ -257,7 +257,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=ml2-0"
#define MTDPARTS_DEFAULT "mtdparts=ml2-0:-@512k(jffs2)"
*/
diff --git a/include/configs/MPC8266ADS.h b/include/configs/MPC8266ADS.h
index fe1cc17..4fd86d3 100644
--- a/include/configs/MPC8266ADS.h
+++ b/include/configs/MPC8266ADS.h
@@ -563,14 +563,14 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
/* mtdparts command line support */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT ""
#define MTDPARTS_DEFAULT ""
*/
diff --git a/include/configs/NC650.h b/include/configs/NC650.h
index 0b97f0c..6343cfe 100644
--- a/include/configs/NC650.h
+++ b/include/configs/NC650.h
@@ -440,13 +440,13 @@
*/
/* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nand0"
#define CONFIG_JFFS2_PART_SIZE 0x00400000
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
/* mtdparts command line support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=nc650-0,nand0=nc650-nand"
#define MTDPARTS_DEFAULT "mtdparts=nc650-0:1m(kernel1),1m(kernel2)," \
diff --git a/include/configs/NETTA.h b/include/configs/NETTA.h
index 34fdba5..724e807 100644
--- a/include/configs/NETTA.h
+++ b/include/configs/NETTA.h
@@ -702,7 +702,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nand0"
#define CONFIG_JFFS2_PART_SIZE 0x00100000
#define CONFIG_JFFS2_PART_OFFSET 0x00200000
@@ -710,7 +710,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nand0=netta-nand"
#define MTDPARTS_DEFAULT "mtdparts=netta-nand:1m@2m(jffs2)"
*/
diff --git a/include/configs/PPChameleonEVB.h b/include/configs/PPChameleonEVB.h
index d2eae1d..16baf8c 100644
--- a/include/configs/PPChameleonEVB.h
+++ b/include/configs/PPChameleonEVB.h
@@ -804,14 +804,14 @@
*/
/* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nand0"
#define CONFIG_JFFS2_PART_SIZE 0x00400000
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
/* mtdparts command line support */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=PPChameleon-0,nand0=ppchameleonevb-nand"
*/
diff --git a/include/configs/R360MPI.h b/include/configs/R360MPI.h
index bab4460..830f4bc 100644
--- a/include/configs/R360MPI.h
+++ b/include/configs/R360MPI.h
@@ -167,14 +167,14 @@
*/
/* No command line, one static partition
* use all the space starting at offset 3MB*/
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00300000
/* mtdparts command line support */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=r360-0"
#define MTDPARTS_DEFAULT "mtdparts=r360-0:-@3m(user)"
*/
diff --git a/include/configs/RBC823.h b/include/configs/RBC823.h
index 280175a..f36244d 100644
--- a/include/configs/RBC823.h
+++ b/include/configs/RBC823.h
@@ -429,7 +429,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -437,7 +437,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT ""
#define MTDPARTS_DEFAULT ""
*/
diff --git a/include/configs/Rattler.h b/include/configs/Rattler.h
index 01d0d5f..5b6f271 100644
--- a/include/configs/Rattler.h
+++ b/include/configs/Rattler.h
@@ -202,7 +202,7 @@
*
*/
/* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00100000
@@ -210,7 +210,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=rattler-0"
#define MTDPARTS_DEFAULT "mtdparts=rattler-0:-@1m(jffs2)"
*/
diff --git a/include/configs/SIMPC8313.h b/include/configs/SIMPC8313.h
index b939cfa..e20527e 100644
--- a/include/configs/SIMPC8313.h
+++ b/include/configs/SIMPC8313.h
@@ -189,7 +189,7 @@
#define CONFIG_JFFS2_DEV "nand0"
/* mtdparts command line support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nand0=nand0"
#define MTDPARTS_DEFAULT "mtdparts=nand0:2M(u-boot),6M(kernel),-(jffs2)"
diff --git a/include/configs/SXNI855T.h b/include/configs/SXNI855T.h
index 9857bf6..cac04b4 100644
--- a/include/configs/SXNI855T.h
+++ b/include/configs/SXNI855T.h
@@ -174,7 +174,7 @@
*
*/
/* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
/*
#define CONFIG_JFFS2_DEV "nor0"
@@ -189,7 +189,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=sixnet-0,nand0=sixnet-nand"
#define MTDPARTS_DEFAULT "mtdparts=sixnet-0:7680k@512k();sixnet-nand:2m(jffs2-nand)"
*/
diff --git a/include/configs/TB5200.h b/include/configs/TB5200.h
index b42d3d9..92b4fa5 100644
--- a/include/configs/TB5200.h
+++ b/include/configs/TB5200.h
@@ -275,7 +275,7 @@
(= chip selects) */
/* Dynamic MTD partition support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM5200-0"
#if defined(CONFIG_TQM5200_B)
#define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:768k(firmware)," \
diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h
index 6850eba..d374981 100644
--- a/include/configs/TQM5200.h
+++ b/include/configs/TQM5200.h
@@ -407,7 +407,7 @@
#endif
/* Dynamic MTD partition support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM5200-0"
#ifdef CONFIG_STK52XX
diff --git a/include/configs/TQM823L.h b/include/configs/TQM823L.h
index 8934d51..87e5a65 100644
--- a/include/configs/TQM823L.h
+++ b/include/configs/TQM823L.h
@@ -231,7 +231,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
diff --git a/include/configs/TQM823M.h b/include/configs/TQM823M.h
index fd41573..f666443 100644
--- a/include/configs/TQM823M.h
+++ b/include/configs/TQM823M.h
@@ -227,7 +227,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxM-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxM-0:512k(u-boot)," \
diff --git a/include/configs/TQM834x.h b/include/configs/TQM834x.h
index e126dc3..b74b404 100644
--- a/include/configs/TQM834x.h
+++ b/include/configs/TQM834x.h
@@ -537,7 +537,7 @@ extern int tqm834x_num_flash_banks;
* JFFS2 partitions
*/
/* mtdparts command line support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM834x-0"
/* default mtd partition table */
diff --git a/include/configs/TQM850L.h b/include/configs/TQM850L.h
index 77eb5a9..dc80b47 100644
--- a/include/configs/TQM850L.h
+++ b/include/configs/TQM850L.h
@@ -216,7 +216,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
diff --git a/include/configs/TQM850M.h b/include/configs/TQM850M.h
index bb8825b..2289443 100644
--- a/include/configs/TQM850M.h
+++ b/include/configs/TQM850M.h
@@ -216,7 +216,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxM-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxM-0:512k(u-boot)," \
diff --git a/include/configs/TQM855L.h b/include/configs/TQM855L.h
index 2ccbaf8..999bdaa 100644
--- a/include/configs/TQM855L.h
+++ b/include/configs/TQM855L.h
@@ -221,7 +221,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
diff --git a/include/configs/TQM855M.h b/include/configs/TQM855M.h
index 8a65183..b54967d 100644
--- a/include/configs/TQM855M.h
+++ b/include/configs/TQM855M.h
@@ -256,7 +256,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxM-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxM-0:512k(u-boot)," \
diff --git a/include/configs/TQM85xx.h b/include/configs/TQM85xx.h
index 3b2272c..72db26c 100644
--- a/include/configs/TQM85xx.h
+++ b/include/configs/TQM85xx.h
@@ -597,14 +597,14 @@
#define CONFIG_JFFS2_NAND 1
-#ifdef CONFIG_JFFS2_CMDLINE
+#ifdef CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nand0=TQM85xx-nand"
#define MTDPARTS_DEFAULT "mtdparts=TQM85xx-nand:-"
#else
#define CONFIG_JFFS2_DEV "nand0" /* NAND device jffs2 lives on */
#define CONFIG_JFFS2_PART_OFFSET 0 /* start of jffs2 partition */
#define CONFIG_JFFS2_PART_SIZE 0x200000 /* size of jffs2 partition */
-#endif /* CONFIG_JFFS2_CMDLINE */
+#endif /* CONFIG_CMD_MTDPARTS */
#endif /* CONFIG_NAND */
diff --git a/include/configs/TQM860L.h b/include/configs/TQM860L.h
index 8bd1fe0..2e2a165 100644
--- a/include/configs/TQM860L.h
+++ b/include/configs/TQM860L.h
@@ -220,7 +220,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
diff --git a/include/configs/TQM860M.h b/include/configs/TQM860M.h
index ad2c71c..1148f2e 100644
--- a/include/configs/TQM860M.h
+++ b/include/configs/TQM860M.h
@@ -221,7 +221,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxM-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxM-0:512k(u-boot)," \
diff --git a/include/configs/TQM862L.h b/include/configs/TQM862L.h
index 0a5180e..577f982 100644
--- a/include/configs/TQM862L.h
+++ b/include/configs/TQM862L.h
@@ -224,7 +224,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
diff --git a/include/configs/TQM862M.h b/include/configs/TQM862M.h
index ee6980c..69070e6 100644
--- a/include/configs/TQM862M.h
+++ b/include/configs/TQM862M.h
@@ -225,7 +225,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxM-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxM-0:512k(u-boot)," \
diff --git a/include/configs/TQM866M.h b/include/configs/TQM866M.h
index 421a2d8..bb68614 100644
--- a/include/configs/TQM866M.h
+++ b/include/configs/TQM866M.h
@@ -265,7 +265,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxM-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxM-0:512k(u-boot)," \
diff --git a/include/configs/ZUMA.h b/include/configs/ZUMA.h
index 08c4ced..b73aaa8 100644
--- a/include/configs/ZUMA.h
+++ b/include/configs/ZUMA.h
@@ -130,7 +130,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -138,7 +138,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor1=zuma-1,nor2=zuma-2"
#define MTDPARTS_DEFAULT "mtdparts=zuma-1:-(jffs2),zuma-2:-(user)"
*/
diff --git a/include/configs/apollon.h b/include/configs/apollon.h
index dff47fc..f83dd9c 100644
--- a/include/configs/apollon.h
+++ b/include/configs/apollon.h
@@ -258,7 +258,7 @@
#define CONFIG_ENV_ADDR 0x00020000
#ifdef CONFIG_SYS_USE_UBI
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "onenand0=onenand"
#define MTDPARTS_DEFAULT "mtdparts=onenand:128k(bootloader)," \
"128k(params)," \
diff --git a/include/configs/cm5200.h b/include/configs/cm5200.h
index ddcc6aa..54cf40d 100644
--- a/include/configs/cm5200.h
+++ b/include/configs/cm5200.h
@@ -222,7 +222,7 @@
/*
* MTD configuration
*/
-#define CONFIG_JFFS2_CMDLINE 1
+#define CONFIG_CMD_MTDPARTS 1
#define MTDIDS_DEFAULT "nor0=cm5200-0"
#define MTDPARTS_DEFAULT "mtdparts=cm5200-0:" \
"384k(uboot),128k(env)," \
diff --git a/include/configs/debris.h b/include/configs/debris.h
index 4d65f6a..dc59df9 100644
--- a/include/configs/debris.h
+++ b/include/configs/debris.h
@@ -234,7 +234,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -246,7 +246,7 @@
* Note: fake mtd_id's used, no linux mtd map file.
*/
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=debris-0"
#define MTDPARTS_DEFAULT "mtdparts=debris-0:-(jffs2)"
*/
diff --git a/include/configs/ep7312.h b/include/configs/ep7312.h
index 0581842..322a3ca 100644
--- a/include/configs/ep7312.h
+++ b/include/configs/ep7312.h
@@ -158,7 +158,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -166,7 +166,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=ep7312-0"
#define MTDPARTS_DEFAULT "mtdparts=ep7312-0:-(jffs2)"
*/
diff --git a/include/configs/ep8260.h b/include/configs/ep8260.h
index d49d02f..3f4425a 100644
--- a/include/configs/ep8260.h
+++ b/include/configs/ep8260.h
@@ -758,7 +758,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -766,7 +766,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT ""
#define MTDPARTS_DEFAULT ""
*/
diff --git a/include/configs/fx12mm.h b/include/configs/fx12mm.h
index 5844567..27c6e7d 100644
--- a/include/configs/fx12mm.h
+++ b/include/configs/fx12mm.h
@@ -37,7 +37,7 @@
/* cmd config */
#define CONFIG_CMD_JFFS2
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#undef CONFIG_CMD_NET
/* sdram */
diff --git a/include/configs/hymod.h b/include/configs/hymod.h
index 0fdcda2..2dacfb6 100644
--- a/include/configs/hymod.h
+++ b/include/configs/hymod.h
@@ -730,14 +730,14 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
/* mtdparts command line support */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT ""
#define MTDPARTS_DEFAULT ""
*/
diff --git a/include/configs/idmr.h b/include/configs/idmr.h
index 1dd89f9..944d06f 100644
--- a/include/configs/idmr.h
+++ b/include/configs/idmr.h
@@ -229,7 +229,7 @@
/* Dynamic MTD partition support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=idmr-0"
#define MTDPARTS_DEFAULT "mtdparts=idmr-0:128k(u-boot)," \
diff --git a/include/configs/impa7.h b/include/configs/impa7.h
index bb3c02e..a3d023f 100644
--- a/include/configs/impa7.h
+++ b/include/configs/impa7.h
@@ -160,14 +160,14 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00020000
/* mtdparts command line support */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=impA7 NOR Flash Bank #0,nor1=impA7 NOR Flash Bank #1"
#define MTDPARTS_DEFAULT "mtdparts=impA7 NOR Flash Bank #0:-(FileSystem1);impA7 NOR Flash Bank #1:-(FileSystem2)"
*/
diff --git a/include/configs/imx31_litekit.h b/include/configs/imx31_litekit.h
index 6c150ae..9ac6eec 100644
--- a/include/configs/imx31_litekit.h
+++ b/include/configs/imx31_litekit.h
@@ -170,7 +170,7 @@
/*
* JFFS2 partitions
*/
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#endif /* __CONFIG_H */
diff --git a/include/configs/imx31_phycore.h b/include/configs/imx31_phycore.h
index 2dd9e92..cbc0b92 100644
--- a/include/configs/imx31_phycore.h
+++ b/include/configs/imx31_phycore.h
@@ -175,7 +175,7 @@
/*
* JFFS2 partitions
*/
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
/* EET platform additions */
diff --git a/include/configs/incaip.h b/include/configs/incaip.h
index a18ba80..2129dfd 100644
--- a/include/configs/incaip.h
+++ b/include/configs/incaip.h
@@ -168,14 +168,14 @@
* JFFS2 partitions
*/
/* No command line, one static partition, use all space on the device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor1"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
/* mtdparts command line support */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=INCA-IP Bank 0"
#define MTDPARTS_DEFAULT "mtdparts=INCA-IP Bank 0:192k(uboot)," \
"64k(env)," \
diff --git a/include/configs/innokom.h b/include/configs/innokom.h
index d9b1555..043ae2f 100644
--- a/include/configs/innokom.h
+++ b/include/configs/innokom.h
@@ -203,7 +203,7 @@
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -211,7 +211,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=innokom-0"
*/
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h
index ac18c87..aa117c8 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -259,7 +259,7 @@
#if defined(CONFIG_CMD_JFFS2)
/* JFFS2 partitions */
-#define CONFIG_JFFS2_CMDLINE /* mtdparts command line support */
+#define CONFIG_CMD_MTDPARTS /* mtdparts command line support */
#define MTDIDS_DEFAULT "nor0=ml401-0"
/* default mtd partition table */
diff --git a/include/configs/modnet50.h b/include/configs/modnet50.h
index c4f5286..27213a8 100644
--- a/include/configs/modnet50.h
+++ b/include/configs/modnet50.h
@@ -182,7 +182,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00080000
@@ -190,7 +190,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=modnet50-0"
#define MTDPARTS_DEFAULT "mtdparts=modnet50-0:-@512k(jffs2)"
*/
diff --git a/include/configs/motionpro.h b/include/configs/motionpro.h
index e6e3729..99a02cc 100644
--- a/include/configs/motionpro.h
+++ b/include/configs/motionpro.h
@@ -275,7 +275,7 @@
/*
* MTD configuration
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=motionpro-0"
#define MTDPARTS_DEFAULT "mtdparts=motionpro-0:" \
"13m(fs),2m(kernel),256k(uboot)," \
diff --git a/include/configs/mx1fs2.h b/include/configs/mx1fs2.h
index aaa4e98..a19eb78 100644
--- a/include/configs/mx1fs2.h
+++ b/include/configs/mx1fs2.h
@@ -176,7 +176,7 @@
*/
/* No command line, one static partition, whole device */
/*
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00050000
@@ -184,7 +184,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=mx1fs2-0"
#ifdef BUS32BIT_VERSION
diff --git a/include/configs/mx31ads.h b/include/configs/mx31ads.h
index 1649f1f..c31c06a 100644
--- a/include/configs/mx31ads.h
+++ b/include/configs/mx31ads.h
@@ -194,7 +194,7 @@
/*
* JFFS2 partitions
*/
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#endif /* __CONFIG_H */
diff --git a/include/configs/netstar.h b/include/configs/netstar.h
index 3b22e48..0b38549 100644
--- a/include/configs/netstar.h
+++ b/include/configs/netstar.h
@@ -121,7 +121,7 @@
/*
* partitions (mtdparts command line support)
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=omapflash.0,nand0=omapnand.0"
#define MTDPARTS_DEFAULT "mtdparts=" \
"omapflash.0:8k@16k(env),8k(r_env),448k@576k(u-boot);" \
diff --git a/include/configs/omap2420h4.h b/include/configs/omap2420h4.h
index 92df0b4..983b5f2 100644
--- a/include/configs/omap2420h4.h
+++ b/include/configs/omap2420h4.h
@@ -296,7 +296,7 @@
* JFFS2 partitions
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor1"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -304,7 +304,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor1=omap2420-1"
#define MTDPARTS_DEFAULT "mtdparts=omap2420-1:-(jffs2)"
*/
diff --git a/include/configs/qong.h b/include/configs/qong.h
index ccc2625..a67006a 100644
--- a/include/configs/qong.h
+++ b/include/configs/qong.h
@@ -212,7 +212,7 @@
/*
* JFFS2 partitions
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=physmap-flash.0"
#define MTDPARTS_DEFAULT \
"mtdparts=physmap-flash.0:256k(U-Boot),128k(env1)," \
diff --git a/include/configs/sc3.h b/include/configs/sc3.h
index 515b097..5b68ef9 100644
--- a/include/configs/sc3.h
+++ b/include/configs/sc3.h
@@ -430,7 +430,7 @@ extern unsigned long offsetOfEnvironment;
#define CONFIG_JFFS2_NAND 1 /* jffs2 on nand support */
/* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nand0"
#define CONFIG_JFFS2_PART_SIZE 0x01000000
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
diff --git a/include/configs/sc520_cdp.h b/include/configs/sc520_cdp.h
index 9f2357b..854f619 100644
--- a/include/configs/sc520_cdp.h
+++ b/include/configs/sc520_cdp.h
@@ -155,14 +155,14 @@
* JFFS2 partitions
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
/* mtdparts command line support */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=SC520CDP Flash Bank #0"
#define MTDPARTS_DEFAULT "mtdparts=SC520CDP Flash Bank #0:-(jffs2)"
*/
diff --git a/include/configs/sc520_spunk.h b/include/configs/sc520_spunk.h
index 50af732..43dcb85 100644
--- a/include/configs/sc520_spunk.h
+++ b/include/configs/sc520_spunk.h
@@ -173,7 +173,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -181,7 +181,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=sc520_spunk-0"
#define MTDPARTS_DEFAULT "mtdparts=sc520_spunk-0:-(jffs2)"
*/
diff --git a/include/configs/smmaco4.h b/include/configs/smmaco4.h
index a3f2677..35f3e3a 100644
--- a/include/configs/smmaco4.h
+++ b/include/configs/smmaco4.h
@@ -214,7 +214,7 @@
#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
/* Dynamic MTD partition support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM5200-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:640k(firmware)," \
"1408k(kernel)," \
diff --git a/include/configs/trab.h b/include/configs/trab.h
index 0a7a73d..8f13c35 100644
--- a/include/configs/trab.h
+++ b/include/configs/trab.h
@@ -375,7 +375,7 @@
#define CONFIG_SYS_MONITOR_LEN (256 << 10)
/* Dynamic MTD partition support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=0"
/* production flash layout */
diff --git a/include/configs/v37.h b/include/configs/v37.h
index a6b0f0d..7f1670e 100644
--- a/include/configs/v37.h
+++ b/include/configs/v37.h
@@ -106,7 +106,7 @@
*
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor1"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -114,7 +114,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor1=v37-1"
#define MTDPARTS_DEFAULT "mtdparts=v37-1:-(jffs2)"
*/
diff --git a/include/configs/vct.h b/include/configs/vct.h
index 391535e..5371e2d 100644
--- a/include/configs/vct.h
+++ b/include/configs/vct.h
@@ -286,7 +286,7 @@ int vct_gpio_get(int pin);
#define CONFIG_CMD_UBI
#define CONFIG_RBTREE
#define CONFIG_MTD_PARTITIONS
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "onenand0=onenand"
#define MTDPARTS_DEFAULT "mtdparts=onenand:128k(u-boot)," \
diff --git a/include/configs/virtlab2.h b/include/configs/virtlab2.h
index 7b61c82..021012d 100644
--- a/include/configs/virtlab2.h
+++ b/include/configs/virtlab2.h
@@ -225,7 +225,7 @@
/*-----------------------------------------------------------------------
* Dynamic MTD partition support
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
#define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
diff --git a/include/configs/voiceblue.h b/include/configs/voiceblue.h
index f460610..cadd906 100644
--- a/include/configs/voiceblue.h
+++ b/include/configs/voiceblue.h
@@ -189,7 +189,7 @@
/*
* JFFS2 partitions (mtdparts command line support)
*/
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=omapflash.0"
#define MTDPARTS_DEFAULT "mtdparts=omapflash.0:256k(u-boot),64k(env),64k(r_env),16192k(data0),-(data1)"
diff --git a/include/configs/xilinx-ppc.h b/include/configs/xilinx-ppc.h
index e7daa07..e3ea84b 100644
--- a/include/configs/xilinx-ppc.h
+++ b/include/configs/xilinx-ppc.h
@@ -41,7 +41,7 @@
#define CONFIG_CMD_IRQ
#define CONFIG_CMD_REGINFO
#undef CONFIG_CMD_JFFS2
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#undef CONFIG_CMD_SPI
#undef CONFIG_CMD_I2C
#undef CONFIG_CMD_DTT
@@ -108,7 +108,7 @@
#define CONFIG_SYS_MAX_FLASH_BANKS 1
#define CONFIG_SYS_FLASH_PROTECTION
#define CONFIG_CMD_JFFS2
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#else
#define CONFIG_ENV_IS_NOWHERE
#define CONFIG_SYS_NO_FLASH
diff --git a/include/configs/xsengine.h b/include/configs/xsengine.h
index 6761438..5d13f96 100644
--- a/include/configs/xsengine.h
+++ b/include/configs/xsengine.h
@@ -62,7 +62,7 @@
* JFFS2 partitions
*/
/* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
#define CONFIG_JFFS2_DEV "nor0"
#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
#define CONFIG_JFFS2_PART_OFFSET 0x00000000
@@ -70,7 +70,7 @@
/* mtdparts command line support */
/* Note: fake mtd_id used, no linux mtd map file */
/*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
#define MTDIDS_DEFAULT "nor0=xsengine-0"
#define MTDPARTS_DEFAULT "mtdparts=xsengine-0:256k(uboot),1m(kernel1),8m(kernel2)"
*/
--
1.6.2.1
3
8

16 May '09
KB9202: Correctly define RAM, FLASH, ENV, and CFG_MALLOC variables
This patch is a forward port of the one submitted by Christian from
Kwikbyte in 06/2007
(http://lists.denx.de/pipermail/u-boot/2007-June/021950.html)
Signed-off-by: Matthias Kaehlcke <matthias(a)kaehlcke.net>
--
--- u-boot-2009.03.org/board/kb9202/kb9202.c 2009-03-21 22:04:41.000000000 +0100
+++ u-boot-2009.03/board/kb9202/kb9202.c 2009-05-15 22:30:31.000000000 +0200
@@ -31,6 +31,8 @@
#include <at91rm9200_net.h>
#include <lxt971a.h>
+extern int eth_init (bd_t * bd);
+
DECLARE_GLOBAL_DATA_PTR;
/*
@@ -64,6 +66,19 @@
return 0;
}
+int board_late_init (void)
+{
+ /* make sure MAC is set */
+#ifdef CONFIG_DRIVER_ETHER
+#ifdef CONFIG_CMD_NET
+ if (getenv ("ethaddr")) {
+ return (eth_init(gd->bd));
+ }
+#endif
+#endif
+ return 0;
+}
+
#ifdef CONFIG_DRIVER_ETHER
#if defined(CONFIG_CMD_NET)
--- u-boot-2009.03.org/include/configs/kb9202.h 2009-03-21 22:04:41.000000000 +0100
+++ u-boot-2009.03/include/configs/kb9202.h 2009-05-15 22:30:31.000000000 +0200
@@ -38,9 +38,10 @@
#define CONFIG_ARM920T 1 /* This is an ARM920T Core */
#define CONFIG_AT91RM9200 1 /* It's an Atmel AT91RM9200 SoC */
/* Only define one of the following, based on board type */
-/* #define CONFIG_KB9200 1 KwikByte KB9202 board */
-/* #define CONFIG_KB9201 1 KwikByte KB9202 board */
-#define CONFIG_KB9202 1 /* KwikByte KB9202 board */
+/* #define CONFIG_KB9200 1 KwikByte KB9200 board */
+/* #define CONFIG_KB9201 1 KwikByte KB9201 board */
+/* #define CONFIG_KB9202 1 KwikByte KB9202 board */
+#define CONFIG_KB9202B 1 /* KwikByte KB9202B board */
#define CONFIG_KB920x 1 /* Any KB920x board */
#undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */
@@ -56,13 +57,21 @@
#define CONFIG_SYS_LONGHELP
+#define BOARD_LATE_INIT
+
+#ifdef CONFIG_KB9202B
+#define CONFIG_BOOTARGS "console=ttyS0,115200 noinitrd root=/dev/mtdblock0 rootfstype=jffs2 mem=64M"
+#define CONFIG_BOOTCOMMAND "bootm 0x10000000"
+#endif
+
+
#ifndef roundup
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
#endif
/*
* Size of malloc() pool
*/
-#define CONFIG_SYS_MALLOC_LEN (roundup(CONFIG_ENV_SIZE,4096) + 128*1024)
+#define CONFIG_SYS_MALLOC_LEN (128*1024)
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
#define CONFIG_BAUDRATE 115200
@@ -80,7 +89,7 @@
#undef CONFIG_MODEM_SUPPORT /* disable modem initialization stuff */
-#define CONFIG_BOOTDELAY 3
+#define CONFIG_BOOTDELAY 1
#define CONFIG_ENV_OVERWRITE 1
@@ -99,8 +108,10 @@
#include <config_cmd_default.h>
#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
#define CONFIG_CMD_PING
#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_JFFS2
#undef CONFIG_CMD_BDI
#undef CONFIG_CMD_FPGA
@@ -109,17 +120,21 @@
#define CONFIG_NR_DRAM_BANKS 1
#define PHYS_SDRAM 0x20000000
+#ifdef CONFIG_KB9202B
+#define PHYS_SDRAM_SIZE 0x4000000 /* 64 megs */
+#else
#define PHYS_SDRAM_SIZE 0x2000000 /* 32 megs */
+#endif
#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END CONFIG_SYS_MEMTEST_START + PHYS_SDRAM_SIZE - (512*1024)
+#define CONFIG_SYS_MEMTEST_END CONFIG_SYS_MEMTEST_START + 0x1000000
#define CONFIG_DRIVER_ETHER
#define CONFIG_NET_RETRY_COUNT 20
#define CONFIG_SYS_FLASH_BASE 0x10000000
-#ifdef CONFIG_KB9202
+#if defined(CONFIG_KB9202) || defined(CONFIG_KB9202B)
#define PHYS_FLASH_SIZE 0x1000000
#else
#define PHYS_FLASH_SIZE 0x200000
@@ -132,9 +147,9 @@
#define CONFIG_ENV_IS_IN_EEPROM
-#ifdef CONFIG_KB9202
-#define CONFIG_ENV_OFFSET 0x3E00
-#define CONFIG_ENV_SIZE 0x0200
+#if defined(CONFIG_KB9202) || defined(CONFIG_KB9202B)
+#define CONFIG_ENV_OFFSET 0x2000
+#define CONFIG_ENV_SIZE 0x2000
#else
#define CONFIG_ENV_OFFSET 0x1000
#define CONFIG_ENV_SIZE 0x1000
--
Matthias Kaehlcke
Embedded Linux Engineer
Barcelona
Comunicar bichos a <bug-coreutils(a)gnu.org>
(LANG=es_ES uname --help)
.''`.
using free software / Debian GNU/Linux | http://debian.org : :' :
`. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4 `-
1
0
Hi everybody...
v2009.06-rc2 has just been released.
Please help testing, and submit fixes to the remaining problems.
Things still missing should be submitted ASAP. We accept strictly
only bug fixes now.
Please use the "next" branch as base for any new work. It will be
synced against the "master" branch every now and then. Note: Please
keep in mind that it also might be rebased without warning, although
I will try to avoid this.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd(a)denx.de
Philosophy: A route of many roads leading from nowhere to nothing.
- Ambrose Bierce
1
0
Hi Wolfgang
Please pull
The following changes since commit f8ddcd58221cab63dd25c2324dd2032487f748b1:
Graf Yang (1):
Blackfin: bf518f-ezbrd: reset ethernet PHY during init
are available in the git repository at:
git://git.denx.de/u-boot-arm.git next
David Brownell (10):
DaVinci Ethernet cleanup
DaVinci now respects SKIP_LOWLEVEL_INIT
davinci: move psc support board-->cpu
davinci: cpu-specific build uses conditional make syntax
davinci: split out some dm644x-specific bits from psc
davinci: fix dm644x buglets
davinci: add basic dm355/dm350/dm335 support
davinci: display correct clock info
davinci dm6446evm NAND update
dm355 evm support
Jean-Christophe PLAGNIOL-VILLARD (12):
arm946es: remove non used timer
arm: cleanup remaining CONFIG_INIT_CRITICAL
ixp/interrupts: Move conditional compilation to Makefile
at91rm9200: move reset code to reset.c
OMAP3: Remove dublicated interrupt code
OMAP3: Reorganize Makefile style
arm: timer and interrupt init rework
arm920/926/926: remove non needed header
ARM: Update mach-types
arm/dcc: use static support to allow to use it at anytime
arm/dcc: add xscale support
at91: regroup IP hw init in one file per soc
Sandeep Paulraj (1):
ARM DaVinci:Consolidate common u-boot.lds
Sanjeev Premi (1):
OMAP3EVM: Set default bootfile
Tom Rix (7):
ARM Add blue colour LED to status_led.
LED Add documentation describing the status_led and colour led API.
ZOOM1 Remove more legacy NAND defines.
OMAP Consolidate common u-boot.lds to cpu layer.
ZOOM2 Add initial support for Zoom2
OMAP3 Port kernel omap gpio interface.
ZOOM2 Add support for debug board detection.
s-paulraj(a)ti.com (1):
ARM DaVinci: Minor Updates to base addresses
MAINTAINERS | 4 +
MAKEALL | 2 +
Makefile | 6 +
board/armltd/integratorap/integratorap.c | 2 +-
board/armltd/integratorcp/integratorcp.c | 2 +-
board/atmel/at91cap9adk/at91cap9adk.c | 1 -
board/davinci/common/Makefile | 2 +-
board/davinci/common/misc.c | 45 +-
board/davinci/common/misc.h | 2 -
board/davinci/dm355evm/Makefile | 52 +
board/davinci/dm355evm/config.mk | 11 +
board/davinci/dm355evm/dm355evm.c | 108 ++
board/davinci/dvevm/dvevm.c | 3 -
board/davinci/schmoogie/schmoogie.c | 3 -
board/davinci/schmoogie/u-boot.lds | 52 -
board/davinci/sffsdr/sffsdr.c | 3 -
board/davinci/sffsdr/u-boot.lds | 52 -
board/davinci/sonata/sonata.c | 3 -
board/davinci/sonata/u-boot.lds | 52 -
board/m501sk/m501sk.c | 2 +-
board/netstar/netstar.c | 2 +-
board/omap3/beagle/u-boot.lds | 63 -
board/omap3/common/Makefile | 1 +
board/omap3/evm/u-boot.lds | 63 -
board/omap3/overo/u-boot.lds | 63 -
board/omap3/pandora/u-boot.lds | 63 -
board/omap3/zoom2/Makefile | 50 +
board/omap3/zoom2/config.mk | 33 +
board/omap3/zoom2/debug_board.c | 59 +
board/omap3/zoom2/zoom2.c | 76 +
board/omap3/zoom2/zoom2.h | 149 ++
board/voiceblue/voiceblue.c | 2 +-
cpu/arm1136/mx31/Makefile | 3 +-
cpu/arm1136/mx31/{interrupts.c => timer.c} | 3 +-
cpu/arm1136/omap24xx/Makefile | 3 +-
cpu/arm1136/omap24xx/{interrupts.c => timer.c} | 3 +-
cpu/arm1176/s3c64xx/Makefile | 2 +-
cpu/arm1176/s3c64xx/{interrupts.c => timer.c} | 2 +-
cpu/arm720t/interrupts.c | 46 +-
cpu/arm920t/at91rm9200/Makefile | 14 +-
cpu/arm920t/at91rm9200/reset.c | 71 +
cpu/arm920t/at91rm9200/{interrupts.c => timer.c} | 39 +-
cpu/arm920t/cpu.c | 1 -
cpu/arm920t/imx/Makefile | 4 +-
cpu/arm920t/imx/{interrupts.c => timer.c} | 3 +-
cpu/arm920t/interrupts.c | 1 -
cpu/arm920t/ks8695/Makefile | 3 +-
cpu/arm920t/ks8695/{interrupts.c => timer.c} | 12 +-
cpu/arm920t/s3c24x0/Makefile | 5 +-
cpu/arm920t/s3c24x0/{interrupts.c => timer.c} | 3 +-
cpu/arm925t/Makefile | 5 +-
cpu/arm925t/{interrupts.c => timer.c} | 2 +-
cpu/arm926ejs/Makefile | 2 +-
cpu/arm926ejs/at91/Makefile | 35 +-
cpu/arm926ejs/at91/at91cap9_devices.c | 176 ++
cpu/arm926ejs/at91/at91cap9_macb.c | 54 -
cpu/arm926ejs/at91/at91cap9_serial.c | 76 -
cpu/arm926ejs/at91/at91cap9_spi.c | 100 --
cpu/arm926ejs/at91/at91sam9260_devices.c | 184 +++
cpu/arm926ejs/at91/at91sam9260_macb.c | 63 -
cpu/arm926ejs/at91/at91sam9260_serial.c | 76 -
cpu/arm926ejs/at91/at91sam9260_spi.c | 99 --
.../{at91sam9261_spi.c => at91sam9261_devices.c} | 49 +
cpu/arm926ejs/at91/at91sam9261_serial.c | 76 -
cpu/arm926ejs/at91/at91sam9263_devices.c | 184 +++
cpu/arm926ejs/at91/at91sam9263_macb.c | 54 -
cpu/arm926ejs/at91/at91sam9263_serial.c | 76 -
cpu/arm926ejs/at91/at91sam9263_spi.c | 99 --
cpu/arm926ejs/at91/at91sam9263_usb.c | 35 -
.../{at91sam9rl_serial.c => at91sam9rl_devices.c} | 37 +
cpu/arm926ejs/at91/at91sam9rl_spi.c | 64 -
cpu/arm926ejs/cpu.c | 1 -
cpu/arm926ejs/davinci/Makefile | 16 +-
cpu/arm926ejs/davinci/config.mk | 37 +
cpu/arm926ejs/davinci/cpu.c | 131 ++
.../common/psc.h => cpu/arm926ejs/davinci/dm355.c | 33 +-
cpu/arm926ejs/davinci/dm644x.c | 96 ++
.../davinci/common => cpu/arm926ejs/davinci}/psc.c | 103 +-
cpu/arm926ejs/davinci/timer.c | 1 -
.../dvevm => cpu/arm926ejs/davinci}/u-boot.lds | 0
cpu/arm926ejs/interrupts.c | 57 -
cpu/arm926ejs/nomadik/timer.c | 1 -
cpu/arm926ejs/omap/cpuinfo.c | 1 -
cpu/arm926ejs/omap/timer.c | 1 -
cpu/arm926ejs/versatile/timer.c | 1 -
cpu/arm946es/Makefile | 3 +-
cpu/arm946es/cpu.c | 1 -
cpu/arm946es/interrupts.c | 158 --
cpu/arm946es/start.S | 4 +-
cpu/arm_cortexa8/omap3/Makefile | 9 +-
cpu/arm_cortexa8/omap3/config.mk | 2 +
cpu/arm_cortexa8/omap3/gpio.c | 185 +++
cpu/arm_cortexa8/omap3/interrupts.c | 266 ---
cpu/arm_cortexa8/omap3/timer.c | 138 ++
.../zoom1 => cpu/arm_cortexa8/omap3}/u-boot.lds | 5 -
cpu/arm_intcm/start.S | 4 +-
cpu/ixp/Makefile | 5 +-
cpu/ixp/interrupts.c | 63 +-
cpu/ixp/timer.c | 54 +
cpu/lh7a40x/Makefile | 2 +-
cpu/lh7a40x/cpu.c | 1 -
cpu/lh7a40x/{interrupts.c => timer.c} | 3 +-
cpu/pxa/Makefile | 8 +-
cpu/pxa/{interrupts.c => timer.c} | 7 +-
cpu/s3c44b0/Makefile | 5 +-
cpu/s3c44b0/{interrupts.c => timer.c} | 2 +-
cpu/sa1100/Makefile | 4 +-
cpu/sa1100/{interrupts.c => timer.c} | 5 +-
doc/README.LED | 78 +
doc/README.omap3 | 47 +-
drivers/serial/arm_dcc.c | 170 +--
include/arm920t.h | 12 -
include/arm926ejs.h | 8 -
include/arm946es.h | 8 -
include/asm-arm/arch-davinci/hardware.h | 74 +-
include/asm-arm/arch-omap3/gpio.h | 86 +
include/asm-arm/mach-types.h | 1704 +++++++++++++++++++-
include/asm-arm/u-boot-arm.h | 3 +
include/configs/SMN42.h | 2 -
include/configs/armadillo.h | 2 +-
include/configs/davinci_dm355evm.h | 190 +++
include/configs/davinci_dvevm.h | 9 +
include/configs/davinci_schmoogie.h | 2 +
include/configs/davinci_sffsdr.h | 5 +-
include/configs/davinci_sonata.h | 2 +
include/configs/gcplus.h | 2 +-
include/configs/integratorap.h | 2 +-
include/configs/ixdpg425.h | 1 +
include/configs/lpc2292sodimm.h | 2 -
include/configs/omap3_evm.h | 2 +
include/configs/omap3_zoom1.h | 13 -
include/configs/omap3_zoom2.h | 226 +++
include/configs/pdnb3.h | 1 +
include/status_led.h | 4 +
lib_arm/board.c | 7 +
135 files changed, 4571 insertions(+), 2299 deletions(-)
create mode 100644 board/davinci/dm355evm/Makefile
create mode 100644 board/davinci/dm355evm/config.mk
create mode 100644 board/davinci/dm355evm/dm355evm.c
delete mode 100644 board/davinci/schmoogie/u-boot.lds
delete mode 100644 board/davinci/sffsdr/u-boot.lds
delete mode 100644 board/davinci/sonata/u-boot.lds
delete mode 100644 board/omap3/beagle/u-boot.lds
delete mode 100644 board/omap3/evm/u-boot.lds
delete mode 100644 board/omap3/overo/u-boot.lds
delete mode 100644 board/omap3/pandora/u-boot.lds
create mode 100644 board/omap3/zoom2/Makefile
create mode 100644 board/omap3/zoom2/config.mk
create mode 100644 board/omap3/zoom2/debug_board.c
create mode 100644 board/omap3/zoom2/zoom2.c
create mode 100644 board/omap3/zoom2/zoom2.h
rename cpu/arm1136/mx31/{interrupts.c => timer.c} (97%)
rename cpu/arm1136/omap24xx/{interrupts.c => timer.c} (97%)
rename cpu/arm1176/s3c64xx/{interrupts.c => timer.c} (99%)
create mode 100644 cpu/arm920t/at91rm9200/reset.c
rename cpu/arm920t/at91rm9200/{interrupts.c => timer.c} (78%)
rename cpu/arm920t/imx/{interrupts.c => timer.c} (98%)
rename cpu/arm920t/ks8695/{interrupts.c => timer.c} (93%)
rename cpu/arm920t/s3c24x0/{interrupts.c => timer.c} (99%)
rename cpu/arm925t/{interrupts.c => timer.c} (99%)
create mode 100644 cpu/arm926ejs/at91/at91cap9_devices.c
delete mode 100644 cpu/arm926ejs/at91/at91cap9_macb.c
delete mode 100644 cpu/arm926ejs/at91/at91cap9_serial.c
delete mode 100644 cpu/arm926ejs/at91/at91cap9_spi.c
create mode 100644 cpu/arm926ejs/at91/at91sam9260_devices.c
delete mode 100644 cpu/arm926ejs/at91/at91sam9260_macb.c
delete mode 100644 cpu/arm926ejs/at91/at91sam9260_serial.c
delete mode 100644 cpu/arm926ejs/at91/at91sam9260_spi.c
rename cpu/arm926ejs/at91/{at91sam9261_spi.c => at91sam9261_devices.c} (72%)
delete mode 100644 cpu/arm926ejs/at91/at91sam9261_serial.c
create mode 100644 cpu/arm926ejs/at91/at91sam9263_devices.c
delete mode 100644 cpu/arm926ejs/at91/at91sam9263_macb.c
delete mode 100644 cpu/arm926ejs/at91/at91sam9263_serial.c
delete mode 100644 cpu/arm926ejs/at91/at91sam9263_spi.c
delete mode 100644 cpu/arm926ejs/at91/at91sam9263_usb.c
rename cpu/arm926ejs/at91/{at91sam9rl_serial.c => at91sam9rl_devices.c} (70%)
delete mode 100644 cpu/arm926ejs/at91/at91sam9rl_spi.c
create mode 100644 cpu/arm926ejs/davinci/config.mk
create mode 100644 cpu/arm926ejs/davinci/cpu.c
rename board/davinci/common/psc.h => cpu/arm926ejs/davinci/dm355.c (63%)
create mode 100644 cpu/arm926ejs/davinci/dm644x.c
rename {board/davinci/common => cpu/arm926ejs/davinci}/psc.c (56%)
rename {board/davinci/dvevm => cpu/arm926ejs/davinci}/u-boot.lds (100%)
delete mode 100644 cpu/arm926ejs/interrupts.c
delete mode 100644 cpu/arm946es/interrupts.c
create mode 100644 cpu/arm_cortexa8/omap3/gpio.c
delete mode 100644 cpu/arm_cortexa8/omap3/interrupts.c
create mode 100644 cpu/arm_cortexa8/omap3/timer.c
rename {board/omap3/zoom1 => cpu/arm_cortexa8/omap3}/u-boot.lds (90%)
rename cpu/lh7a40x/{interrupts.c => timer.c} (98%)
rename cpu/pxa/{interrupts.c => timer.c} (96%)
rename cpu/s3c44b0/{interrupts.c => timer.c} (98%)
rename cpu/sa1100/{interrupts.c => timer.c} (95%)
create mode 100644 doc/README.LED
delete mode 100644 include/arm920t.h
delete mode 100644 include/arm926ejs.h
delete mode 100644 include/arm946es.h
create mode 100644 include/asm-arm/arch-omap3/gpio.h
create mode 100644 include/configs/davinci_dm355evm.h
create mode 100644 include/configs/omap3_zoom2.h
Best Regards,
J.
2
1
Once the Davinci watchdog has been enabled, the timeout
value cannot be changed. If the timeout in use is long,
it can take a long time for card to reset. By writing
an invalid service key, we can trigger an immediate reset.
Signed-off-by: Thomas Lange <thomas(a)corelatus.se>
---
cpu/arm926ejs/davinci/reset.S | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/cpu/arm926ejs/davinci/reset.S b/cpu/arm926ejs/davinci/reset.S
index a687d44..ba0a7c3 100644
--- a/cpu/arm926ejs/davinci/reset.S
+++ b/cpu/arm926ejs/davinci/reset.S
@@ -50,6 +50,10 @@ reset_cpu:
str r1, [r0]
ldr r1, WDTCR_VAL2
str r1, [r0]
+ /* Write an invalid value to the WDKEY field to trigger
+ * an immediate watchdog reset */
+ mov r1, $0x4000
+ str r1, [r0]
nop
nop
nop
--
1.5.6.5
2
1

15 May '09
Currently only IDE busses are probed and all possible available devices
are listed in the IDE bootup log. Even when devices on the bus are not
available. This leads to the following output on the CPCI750:
IDE: Bus 0: OK Bus 1: OK
Device 0: Model: HITACHI_DK23FA-20J Firm: 00M7A0A0 Ser#: 42D182
Type: Hard Disk
Capacity: 19077.1 MB = 18.6 GB (39070080 x 512)
Device 1: Model: Firm: Ser#:
Type: # 1F #
Capacity: not available
Device 2: Model: SanDisk SDCFB-128 Firm: vde 1.10 Ser#: gmo5i311404
Type: Removable Hard Disk
Capacity: 122.5 MB = 0.1 GB (250880 x 512)
Device 3: Model: Firm: Ser#:
Type: # 1F #
Capacity: not available
Here devices 1 + 3 are listed which are not availble.
This patch now fixes this problem by skipping the device output for
non-available devices. This is the resulting log:
IDE: Bus 0: OK Bus 1: OK
Device 0: Model: HITACHI_DK23FA-20J Firm: 00M7A0A0 Ser#: 42D182
Type: Hard Disk
Capacity: 19077.1 MB = 18.6 GB (39070080 x 512)
Device 1: not available
Device 2: Model: SanDisk SDCFB-128 Firm: vde 1.10 Ser#: gmo5i311404
Type: Removable Hard Disk
Capacity: 122.5 MB = 0.1 GB (250880 x 512)
Device 3: not available
Signed-off-by: Stefan Roese <sr(a)denx.de>
---
common/cmd_ide.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 71db933..7f9217d 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -154,7 +154,7 @@ static void ide_reset(void);
#define ide_reset() /* dummy */
#endif
-static void ide_ident(block_dev_desc_t *dev_desc);
+static int ide_ident(block_dev_desc_t *dev_desc);
static uchar ide_wait(int dev, ulong t);
#define IDE_TIME_OUT 2000 /* 2 sec timeout */
@@ -714,6 +714,7 @@ skip_bus:
curr_device = -1;
for (i = 0; i < CONFIG_SYS_IDE_MAXDEVICE; ++i) {
+ int ret;
#ifdef CONFIG_IDE_LED
int led = (IDE_BUS(i) == 0) ? LED_IDE1 : LED_IDE2;
#endif
@@ -727,8 +728,12 @@ skip_bus:
if (!ide_bus_ok[IDE_BUS(i)])
continue;
ide_led(led, 1); /* LED on */
- ide_ident(&ide_dev_desc[i]);
+ ret = ide_ident(&ide_dev_desc[i]);
ide_led(led, 0); /* LED off */
+ if (ret < 0) {
+ puts("not available\n");
+ continue;
+ }
dev_print(&ide_dev_desc[i]);
if ((ide_dev_desc[i].lba > 0) && (ide_dev_desc[i].blksz > 0)) {
init_part(&ide_dev_desc[i]); /* initialize partition type */
@@ -987,7 +992,7 @@ static void input_data(int dev, ulong *sect_buf, int words)
/* -------------------------------------------------------------------------
*/
-static void ide_ident(block_dev_desc_t *dev_desc)
+static int ide_ident(block_dev_desc_t *dev_desc)
{
ulong iobuf[ATA_SECTORWORDS];
unsigned char c;
@@ -1018,7 +1023,7 @@ static void ide_ident(block_dev_desc_t *dev_desc)
max_bus_scan = CONFIG_SYS_IDE_MAXBUS;
if (device >= max_bus_scan * 2) {
dev_desc->type = DEV_TYPE_UNKNOWN;
- return;
+ return -1;
}
#endif
@@ -1087,7 +1092,7 @@ static void ide_ident(block_dev_desc_t *dev_desc)
ATA_LBA | ATA_DEVICE(device));
retries++;
#else
- return;
+ return -1;
#endif
}
#ifdef CONFIG_ATAPI
@@ -1096,7 +1101,7 @@ static void ide_ident(block_dev_desc_t *dev_desc)
} /* see above - ugly to read */
if (retries == 2) /* Not found */
- return;
+ return -1;
#endif
input_swap_data(device, iobuf, ATA_SECTORWORDS);
@@ -1161,7 +1166,7 @@ static void ide_ident(block_dev_desc_t *dev_desc)
#ifdef CONFIG_ATAPI
if (dev_desc->if_type == IF_TYPE_ATAPI) {
atapi_inquiry(dev_desc);
- return;
+ return 0;
}
#endif /* CONFIG_ATAPI */
@@ -1193,6 +1198,8 @@ static void ide_ident(block_dev_desc_t *dev_desc)
dev_desc->type = DEV_TYPE_HARDDISK;
dev_desc->blksz = ATA_BLOCKSIZE;
dev_desc->lun = 0; /* just to fill something in... */
+
+ return 0;
}
/* ------------------------------------------------------------------------- */
--
1.6.2.5
2
12