Skip to contentSkip to conversation

(resubmit) ppc4xx: ML507: Environment in flash and MTD Support

PATCH New Ricardo Ribalda Delgado 2 participants 6 messages Jul 30, 2008 – Sep 5, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 (resubmit) ppc4xx: ML507: Environment in flash and MTD Support

-Relocate the location of u-boot in the flash -Save the environment in one sector of the flash memory -MTD Support

---
-Previus commit included files from other commit

 Makefile                         |    2 +-
 board/xilinx/ml507/xparameters.h |    2 +-
 include/configs/ml507.h          |   15 +++++++++++----
 3 files changed, 13 insertions(+), 6 deletions(-)
Makefile +1 -1
index 8f4fdd0..ea572cf 100644
@@ -1352,7 +1352,7 @@ ml300_config:	unconfig
 ml507_flash_config:	unconfig
 	@mkdir -p $(obj)include $(obj)board/xilinx/ml507
 	@cp $(obj)board/xilinx/ml507/u-boot-rom.lds  $(obj)board/xilinx/ml507/u-boot.lds
-	@echo "TEXT_BASE = 0xFE3E0000" > $(obj)board/xilinx/ml507/config.tmp
+	@echo "TEXT_BASE = 0xFE360000" > $(obj)board/xilinx/ml507/config.tmp
 	@$(MKCONFIG) $(@:_flash_config=) ppc ppc4xx ml507 xilinx
 
 ml507_config:	unconfig
board/xilinx/ml507/xparameters.h +1 -1
index 6a8e183..77d2ddf 100644
@@ -24,7 +24,7 @@
 #define XPAR_DDR2_SDRAM_MEM_BASEADDR 	0x00000000
 #define XPAR_IIC_EEPROM_BASEADDR 	0x81600000
 #define XPAR_INTC_0_BASEADDR 		0x81800000
-#define XPAR_LLTEMAC_0_BASEADDR 	0x81c00000
+#define XPAR_LLTEMAC_0_BASEADDR 	0x81C00000
 #define XPAR_UARTLITE_0_BASEADDR 	0x84000000
 #define XPAR_FLASH_MEM0_BASEADDR 	0xFE000000
 #define XPAR_PLB_CLOCK_FREQ_HZ 		100000000
include/configs/ml507.h +11 -4
index a79bc1e..c653a51 100644
@@ -33,7 +33,7 @@
 #define CFG_SDRAM_SIZE_MB	256
 #define CFG_MONITOR_BASE	TEXT_BASE
 #define CFG_MONITOR_LEN		( 192 * 1024 )
-#define CFG_MALLOC_LEN		( 128 * 1024 )
+#define CFG_MALLOC_LEN		( CFG_ENV_SIZE + 128 * 1024 )
 
 /*Uart*/
 #define CONFIG_XILINX_UARTLITE
@@ -49,6 +49,8 @@
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_JFFS2
+#define CONFIG_JFFS2_CMDLINE
 #undef CONFIG_CMD_I2C
 #undef CONFIG_CMD_DTT
 #undef CONFIG_CMD_NET
@@ -58,9 +60,11 @@
 #undef CONFIG_CMD_IMLS
 
 /*Env*/
-#define	CFG_ENV_IS_NOWHERE
-#define	CFG_ENV_SIZE		0x200
-#define CFG_ENV_OFFSET 		0x100
+#define	CFG_ENV_IS_IN_FLASH
+#define	CFG_ENV_SIZE		0x20000
+#define	CFG_ENV_SECT_SIZE	0x20000
+#define CFG_ENV_OFFSET 		0x340000
+#define CFG_ENV_ADDR 		(XPAR_FLASH_MEM0_BASEADDR+CFG_ENV_OFFSET)
 
 /*Misc*/
 #define CONFIG_BOOTDELAY	5		/* autoboot after 5 seconds     */
@@ -111,5 +115,8 @@
 #define	CFG_MAX_FLASH_BANKS	1
 #define	CFG_MAX_FLASH_SECT	259
 #define	CFG_FLASH_PROTECTION
+#define MTDIDS_DEFAULT		"nor0=ml507-flash"
+#define MTDPARTS_DEFAULT	"mtdparts=ml507-flash:-(user)"
+
 
 #endif						/* __CONFIG_H */
Signature · 1 line
1.5.6.3
#1 lore raw

PATCH 1/1 (Resend)Allows negative offset in command loads

---
Previus commit had compiling warnings

 common/cmd_load.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
common/cmd_load.c +5 -5
index 1b75a7b..ae56543 100644
@@ -38,7 +38,7 @@ static ulong load_serial_ymodem (ulong offset);
 #endif
 
 #if defined(CONFIG_CMD_LOADS)
-static ulong load_serial (ulong offset);
+static ulong load_serial (long offset);
 static int read_record (char *buf, ulong len);
 # if defined(CONFIG_CMD_SAVES)
 static int save_serial (ulong offset, ulong size);
@@ -53,7 +53,7 @@ static int do_echo = 1;
 #if defined(CONFIG_CMD_LOADS)
 int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-	ulong offset = 0;
+	long offset = 0;
 	ulong addr;
 	int i;
 	char *env_echo;
@@ -72,7 +72,7 @@ int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 #ifdef	CFG_LOADS_BAUD_CHANGE
 	if (argc >= 2) {
-		offset = simple_strtoul(argv[1], NULL, 16);
+		offset = simple_strtol(argv[1], NULL, 16);
 	}
 	if (argc == 3) {
 		load_baudrate = (int)simple_strtoul(argv[2], NULL, 10);
@@ -95,7 +95,7 @@ int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	}
 #else	/* ! CFG_LOADS_BAUD_CHANGE */
 	if (argc == 2) {
-		offset = simple_strtoul(argv[1], NULL, 16);
+		offset = simple_strtol(argv[1], NULL, 16);
 	}
 #endif	/* CFG_LOADS_BAUD_CHANGE */
 
@@ -141,7 +141,7 @@ int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 
 static ulong
-load_serial (ulong offset)
+load_serial (long offset)
 {
 	char	record[SREC_MAXRECLEN + 1];	/* buffer for one S-Record	*/
 	char	binbuf[SREC_MAXBINLEN];		/* buffer for binary data	*/
Signature · 1 line
1.5.6.3
#2 lore raw

PATCH 1/1 (Resend)Allows negative offset in command loads

Dear Ricardo Ribalda Delgado,

Quoted 2 lines · In message <[email protected]> you wrote:

I think it makes little sense to change only one command and leave the other, similar commands unchanged. All commands that provide similar functions should behave the same.

common/cmd_load.c static ulong load_serial_ymodem (ulong offset);

Quoted 10 lines

Previus commit had compiling warnings

 common/cmd_load.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
common/cmd_load.c +0 -0
index 1b75a7b..ae56543 100644
@@ -38,7 +38,7 @@ static ulong load_serial_ymodem (ulong offset);

----------------------------------------------------^^^^^^^^^^^^^^

So this one should be changed, too?

Maybe others as well?

Best regards,

Wolfgang Denk

Signature · 7 lines
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 at denx.de
"Pardon me for breathing, which I never do anyway so I don't know why
I bother to say it, oh God, I'm so depressed. Here's another of those
self-satisfied doors. Life! Don't talk to me about life."
                                        - Marvin the Paranoid Android
#3 lore raw

PATCH 1/1 (Resend)Allows negative offset in command loads

Hi Wolfgang:

Up to my knowledge, u-boot can load .bin, .elf and .srec binary files.

.bin files are just raw binaries with no location info. When you load this file the offset mean the "absolute address"
.srec files have info about location. The offset really mean offset, and is relative to the address specified in the file
.elf files have info about location, but right now (UTMK), u-boot does not support offsets.

I think that his patch is enough, other binaries should not be fixed because there is no reason to locate a .bin file in the address -0x234

What do you think?

Best regards

Quoted 39 lines · Wolfgang Denk

Dear Ricardo Ribalda Delgado,

Quoted 2 lines · In message <[email protected]> you wrote:

I think it makes little sense to change only one command and leave the other, similar commands unchanged. All commands that provide similar functions should behave the same.

common/cmd_load.c static ulong load_serial_ymodem (ulong offset);

Quoted 10 lines

Previus commit had compiling warnings

 common/cmd_load.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
common/cmd_load.c +0 -0
index 1b75a7b..ae56543 100644
@@ -38,7 +38,7 @@ static ulong load_serial_ymodem (ulong offset);

----------------------------------------------------^^^^^^^^^^^^^^

So this one should be changed, too?

Maybe others as well?

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 at denx.de "Pardon me for breathing, which I never do anyway so I don't know why I bother to say it, oh God, I'm so depressed. Here's another of those self-satisfied doors. Life! Don't talk to me about life."
- Marvin the Paranoid Android

Signature · 2 lines
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/
#4 lore raw

PATCH 1/1 (Resend)Allows negative offset in command loads

I think I did send this mail to the old mail list

---------- Forwarded message ----------
From: Ricardo Ribalda Delgado <[email protected]>
Date: Tue, Aug 19, 2008 at 08:59
Subject: Re: [U-Boot-Users] [PATCH] (Resend)Allows negative offset in command loads
To: Wolfgang Denk <[email protected]>
Cc: u-boot at lists.denx.de

Hi Wolfgang:

Up to my knowledge, u-boot can load .bin, .elf and .srec binary files.

.bin files are just raw binaries with no location info. When you load this file the offset mean the "absolute address"
.srec files have info about location. The offset really mean offset, and is relative to the address specified in the file
.elf files have info about location, but right now (UTMK), u-boot does not support offsets.

I think that his patch is enough, other binaries should not be fixed because there is no reason to locate a .bin file in the address -0x234

What do you think?

Best regards

Quoted 30 lines · Wolfgang Denk

Dear Ricardo Ribalda Delgado,

Quoted 2 lines · In message <[email protected]> you wrote:

I think it makes little sense to change only one command and leave the other, similar commands unchanged. All commands that provide similar functions should behave the same.

common/cmd_load.c static ulong load_serial_ymodem (ulong offset);

Quoted 10 lines

Previus commit had compiling warnings

 common/cmd_load.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
common/cmd_load.c +0 -0
index 1b75a7b..ae56543 100644
@@ -38,7 +38,7 @@ static ulong load_serial_ymodem (ulong offset);

----------------------------------------------------^^^^^^^^^^^^^^

So this one should be changed, too?

Maybe others as well?

Best regards,

Wolfgang Denk

Quoted 9 lines

--
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 at denx.de "Pardon me for breathing, which I never do anyway so I don't know why I bother to say it, oh God, I'm so depressed. Here's another of those self-satisfied doors. Life! Don't talk to me about life."
- Marvin the Paranoid Android

--
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/

Signature · 2 lines
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/
#5 lore raw

PATCH 1/1 (Resend)Allows negative offset in command loads

In reply to Ricardo Ribalda Delgado

Dear Ricardo Ribalda Delgado,

Quoted 7 lines · In message <[email protected]> you wrote:

---
Previus commit had compiling warnings

 common/cmd_load.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
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 at denx.de
2000 pounds of chinese soup                               = 1 Won Ton