Skip to contentSkip to conversation

preparation to intriduce keystone support

PATCH New Murali Karicheri 4 participants 20 messages Jan 20, 2014 – Feb 21, 2014 4 messages not in the archive

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

cover preparation to intriduce keystone support

The Texas Instruments Keystone SOC u-boot support requires some common code modifications to be done before introducing the support itself.

This series of patches makes these modifications.

Murali Karicheri (5):
tools: mkimage: add support for gpimage format
ubifs: fix checkpatch warning
ubifs: return filesize from ubifs load operations
arm: add support for arch timer
NAND: DaVinci: allow forced disable of subpage writes

 arch/arm/lib/Makefile           |    1 +
 arch/arm/lib/arch_timer.c       |   69 ++++++++++++++++++++++++++
 common/cmd_ubifs.c              |   16 ++----
 common/image.c                  |    1 +
 drivers/mtd/nand/davinci_nand.c |    3 ++
 fs/ubifs/ubifs.c                |   14 +++---
 fs/ubifs/ubifs.h                |    7 +++
 include/image.h                 |    1 +
 tools/Makefile                  |    6 +++
 tools/gpheader.h                |   41 ++++++++++++++++
 tools/gpimage-common.c          |  103 +++++++++++++++++++++++++++++++++++++++
 tools/gpimage.c                 |   78 +++++++++++++++++++++++++++++
 tools/imagetool.c               |    2 +
 tools/imagetool.h               |    1 +
 tools/omapimage.c               |   97 ++++++------------------------------
 tools/omapimage.h               |    5 --
 16 files changed, 340 insertions(+), 105 deletions(-)
 create mode 100644 arch/arm/lib/arch_timer.c
 create mode 100644 tools/gpheader.h
 create mode 100644 tools/gpimage-common.c
 create mode 100644 tools/gpimage.c
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/5 tools: mkimage: add support for gpimage format

This patch add support for gpimage format as a preparatory patch for porting u-boot for keystone2 devices and is based on omapimage format. It re-uses gph header to store the size and loadaddr as done in omapimage.c

---
- Tested only on keystone. Need help to test on OMAP since this is impacted.

 common/image.c         |    1 +
 include/image.h        |    1 +
 tools/Makefile         |    6 +++
 tools/gpheader.h       |   41 +++++++++++++++++++
 tools/gpimage-common.c |  103 ++++++++++++++++++++++++++++++++++++++++++++++++
 tools/gpimage.c        |   78 ++++++++++++++++++++++++++++++++++++
 tools/imagetool.c      |    2 +
 tools/imagetool.h      |    1 +
 tools/omapimage.c      |   97 +++++++--------------------------------------
 tools/omapimage.h      |    5 ---
 10 files changed, 248 insertions(+), 87 deletions(-)
 create mode 100644 tools/gpheader.h
 create mode 100644 tools/gpimage-common.c
 create mode 100644 tools/gpimage.c
common/image.c +1 -0
index ae95c3f..52ee840 100644
@@ -137,6 +137,7 @@ static const table_entry_t uimage_type[] = {
 	{	IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
 	{	IH_TYPE_UBLIMAGE,   "ublimage",   "Davinci UBL image",},
 	{	IH_TYPE_MXSIMAGE,   "mxsimage",   "Freescale MXS Boot Image",},
+	{	IH_TYPE_GPIMAGE,    "gpimage",    "TI KeyStone SPL Image",},
 	{	-1,		    "",		  "",			},
 };
 
include/image.h +1 -0
index 7de2bb2..0a3d346 100644
@@ -214,6 +214,7 @@ struct lmb;
 #define IH_TYPE_KERNEL_NOLOAD	14	/* OS Kernel Image, can run from any load address */
 #define IH_TYPE_PBLIMAGE	15	/* Freescale PBL Boot Image	*/
 #define IH_TYPE_MXSIMAGE	16	/* Freescale MXSBoot Image	*/
+#define IH_TYPE_GPIMAGE		17	/* TI Keystone GPHeader Image	*/
 
 /*
  * Compression Types
tools/Makefile +6 -0
index 328cea3..cbbe479 100644
@@ -84,7 +84,9 @@ NOPED_OBJ_FILES-y += imagetool.o
 NOPED_OBJ_FILES-y += mkenvimage.o
 NOPED_OBJ_FILES-y += mkimage.o
 NOPED_OBJ_FILES-y += mxsimage.o
+NOPED_OBJ_FILES-y += gpimage-common.o
 NOPED_OBJ_FILES-y += omapimage.o
+NOPED_OBJ_FILES-y += gpimage.o
 NOPED_OBJ_FILES-y += os_support.o
 NOPED_OBJ_FILES-y += pblimage.o
 NOPED_OBJ_FILES-y += proftool.o
@@ -219,7 +221,9 @@ $(obj)dumpimage$(SFX):	$(obj)aisimage.o \
 			$(obj)dumpimage.o \
 			$(obj)md5.o \
 			$(obj)mxsimage.o \
+			$(obj)gpimage-common.o \
 			$(obj)omapimage.o \
+			$(obj)gpimage.o \
 			$(obj)os_support.o \
 			$(obj)pblimage.o \
 			$(obj)sha1.o \
@@ -248,7 +252,9 @@ $(obj)mkimage$(SFX):	$(obj)aisimage.o \
 			$(obj)md5.o \
 			$(obj)mkimage.o \
 			$(obj)mxsimage.o \
+			$(obj)gpimage-common.o \
 			$(obj)omapimage.o \
+			$(obj)gpimage.o \
 			$(obj)os_support.o \
 			$(obj)pblimage.o \
 			$(obj)sha1.o \
tools/gpheader.h new file +41 -0

41 lines not on this page · raw message

tools/gpimage-common.c new file +103 -0

103 lines not on this page · raw message

tools/gpimage.c new file +78 -0

78 lines not on this page · raw message

tools/imagetool.c +2 -0
index 29d2189..da72115 100644
@@ -45,6 +45,8 @@ void register_image_tool(imagetool_register_t image_register)
 	init_ubl_image_type();
 	/* Init Davinci AIS support */
 	init_ais_image_type();
+	/* Init TI Keystone boot image generation/list support */
+	init_gpimage_type();
 }
 
 /*
tools/imagetool.h +1 -0
index c2c9aea..a3e9d30 100644
@@ -167,6 +167,7 @@ void init_mxs_image_type(void);
 void init_fit_image_type(void);
 void init_ubl_image_type(void);
 void init_omap_image_type(void);
+void init_gpimage_type(void);
 
 void pbl_load_uboot(int fd, struct image_tool_params *mparams);
 
tools/omapimage.c +15 -82

172 lines not on this page · raw message

tools/omapimage.h +0 -5
index 45d14ea..8744ae7 100644
@@ -25,10 +25,5 @@ struct ch_settings {
 	uint32_t flags;
 };
 
-struct gp_header {
-	uint32_t size;
-	uint32_t load_addr;
-};
-
 #define KEY_CHSETTINGS 0xC0C0C0C1
 #endif /* _OMAPIMAGE_H_ */
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/5 tools: mkimage: add support for gpimage format

Dear Murali Karicheri,

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

This patch add support for gpimage format as a preparatory patch for porting u-boot for keystone2 devices and is based on omapimage format. It re-uses gph header to store the size and loadaddr as done in omapimage.c

...

common/image.c static const table_entry_t uimage_type[] = { · line 141

Quoted 8 lines
common/image.c +1 -0
@@ -137,6 +137,7 @@ static const table_entry_t uimage_type[] = {
 	{	IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
 	{	IH_TYPE_UBLIMAGE,   "ublimage",   "Davinci UBL image",},
 	{	IH_TYPE_MXSIMAGE,   "mxsimage",   "Freescale MXS Boot Image",},
+	{	IH_TYPE_GPIMAGE,    "gpimage",    "TI KeyStone SPL Image",},
 	{	-1,		    "",		  "",			},

Please keep the list sorted. While you are at it, please also fi the incorrect placement of the IH_TYPE_MXSIMAGE entry.

tools/Makefile NOPED_OBJ_FILES-y += imagetool.o · line 90

Quoted 10 lines
tools/Makefile +2 -0
@@ -84,7 +84,9 @@ NOPED_OBJ_FILES-y += imagetool.o
 NOPED_OBJ_FILES-y += mkenvimage.o
 NOPED_OBJ_FILES-y += mkimage.o
 NOPED_OBJ_FILES-y += mxsimage.o
+NOPED_OBJ_FILES-y += gpimage-common.o
 NOPED_OBJ_FILES-y += omapimage.o
+NOPED_OBJ_FILES-y += gpimage.o
 NOPED_OBJ_FILES-y += os_support.o

Please keep the list sorted.

tools/Makefile $(obj)dumpimage$(SFX): $(obj)aisimage.o \ · line 226

Quoted 7 lines
tools/Makefile +2 -0
@@ -219,7 +221,9 @@ $(obj)dumpimage$(SFX):	$(obj)aisimage.o \
 			$(obj)dumpimage.o \
 			$(obj)md5.o \
 			$(obj)mxsimage.o \
+			$(obj)gpimage-common.o \
 			$(obj)omapimage.o \
+			$(obj)gpimage.o \

Ditto. Please fix this issue globally.

tools/Makefile $(obj)dumpimage$(SFX): $(obj)aisimage.o \

Quoted 4 lines
tools/Makefile +4 -0
+uint32_t gpimage_swap32(uint32_t data)
+{
+	return cpu_to_be32(data);
+}

The function name is misleading. Also it is not clear why you need this function at all. You can use cpu_to_be32() directly - that will make the code much easier to read.

tools/Makefile

Quoted 10 lines
tools/Makefile +10 -0
+/* TODO: do we need the below 2 functions?? */
+int valid_gph_size(uint32_t size)
+{
+	return size;
+}
+
+int valid_gph_load_addr(uint32_t load_addr)
+{
+	return load_addr;
+}

These functions are obviously bogus. Please dump them.

tools/Makefile

Quoted 11 lines
tools/Makefile +11 -0
+int gph_verify_header(struct gp_header *gph, int do_swap32)
+{
+	uint32_t gph_size, gph_load_addr;
+
+	if (do_swap32) {
+		gph_size = gpimage_swap32(gph->size);
+		gph_load_addr = gpimage_swap32(gph->load_addr);
+	} else {
+		gph_size = gph->size;
+		gph_load_addr = gph->load_addr;
+	}

I think it should be possible top write this code in such a way that you can avoid both the if-else and passing the do_swap32 parameter. It is my impression that the whole endianess handling needs some refinemant.

Actually I cannot see a place where do_swap32=0 is used..

tools/Makefile

Quoted 11 lines
tools/Makefile +11 -0
+void gph_print_header(const struct gp_header *gph, int do_swap32)
+{
+	uint32_t gph_size, gph_load_addr;
+
+	if (do_swap32) {
+		gph_size = gpimage_swap32(gph->size);
+		gph_load_addr = gpimage_swap32(gph->load_addr);
+	} else {
+		gph_size = gph->size;
+		gph_load_addr = gph->load_addr;
+	}

This is repeasted code. Get rid of it.

tools/Makefile

Quoted 10 lines
tools/Makefile +10 -0
+void gph_set_header(struct gp_header *gph, uint32_t size, uint32_t load_addr,
+	int do_swap32)
+{
+	if (do_swap32) {
+		gph->size = gpimage_swap32(size);
+		gph->load_addr = gpimage_swap32(load_addr);
+	} else {
+		gph->size = size;
+		gph->load_addr = load_addr;
+	}

And again.

Best regards,

Wolfgang Denk

Signature · 5 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
"The X11 source code style is ATROCIOUS and should not be used  as  a
model."                                                   - Doug Gwyn
#3 lore raw

PATCH 1/5 tools: mkimage: add support for gpimage format

Quoted 83 lines · Wolfgang Denk

Dear Murali Karicheri,

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

This patch add support for gpimage format as a preparatory patch for porting u-boot for keystone2 devices and is based on omapimage format. It re-uses gph header to store the size and loadaddr as done in omapimage.c

...

common/image.c static const table_entry_t uimage_type[] = { · line 141

Quoted 8 lines
common/image.c +1 -0
@@ -137,6 +137,7 @@ static const table_entry_t uimage_type[] = {
 	{	IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
 	{	IH_TYPE_UBLIMAGE,   "ublimage",   "Davinci UBL image",},
 	{	IH_TYPE_MXSIMAGE,   "mxsimage",   "Freescale MXS Boot Image",},
+	{	IH_TYPE_GPIMAGE,    "gpimage",    "TI KeyStone SPL Image",},
 	{	-1,		    "",		  "",			},

Please keep the list sorted. While you are at it, please also fi the incorrect placement of the IH_TYPE_MXSIMAGE entry.

tools/Makefile NOPED_OBJ_FILES-y += imagetool.o · line 90

Quoted 10 lines
tools/Makefile +2 -0
@@ -84,7 +84,9 @@ NOPED_OBJ_FILES-y += imagetool.o
 NOPED_OBJ_FILES-y += mkenvimage.o
 NOPED_OBJ_FILES-y += mkimage.o
 NOPED_OBJ_FILES-y += mxsimage.o
+NOPED_OBJ_FILES-y += gpimage-common.o
 NOPED_OBJ_FILES-y += omapimage.o
+NOPED_OBJ_FILES-y += gpimage.o
 NOPED_OBJ_FILES-y += os_support.o

Please keep the list sorted.

tools/Makefile $(obj)dumpimage$(SFX): $(obj)aisimage.o \ · line 226

Quoted 7 lines
tools/Makefile +2 -0
@@ -219,7 +221,9 @@ $(obj)dumpimage$(SFX):	$(obj)aisimage.o \
 			$(obj)dumpimage.o \
 			$(obj)md5.o \
 			$(obj)mxsimage.o \
+			$(obj)gpimage-common.o \
 			$(obj)omapimage.o \
+			$(obj)gpimage.o \

Ditto. Please fix this issue globally.

tools/Makefile $(obj)dumpimage$(SFX): $(obj)aisimage.o \

Quoted 4 lines
tools/Makefile +4 -0
+uint32_t gpimage_swap32(uint32_t data)
+{
+	return cpu_to_be32(data);
+}

The function name is misleading. Also it is not clear why you need this function at all. You can use cpu_to_be32() directly - that will make the code much easier to read.

tools/Makefile

Quoted 10 lines
tools/Makefile +10 -0
+/* TODO: do we need the below 2 functions?? */
+int valid_gph_size(uint32_t size)
+{
+	return size;
+}
+
+int valid_gph_load_addr(uint32_t load_addr)
+{
+	return load_addr;
+}

These functions are obviously bogus. Please dump them.

tools/Makefile

Quoted 11 lines
tools/Makefile +11 -0
+int gph_verify_header(struct gp_header *gph, int do_swap32)
+{
+	uint32_t gph_size, gph_load_addr;
+
+	if (do_swap32) {
+		gph_size = gpimage_swap32(gph->size);
+		gph_load_addr = gpimage_swap32(gph->load_addr);
+	} else {
+		gph_size = gph->size;
+		gph_load_addr = gph->load_addr;
+	}

I think it should be possible top write this code in such a way that you can avoid both the if-else and passing the do_swap32 parameter. It is my impression that the whole endianess handling needs some refinemant.

Quoted 1 line

Actually I cannot see a place where do_swap32=0 is used..

This appears to be a blind re-use of the omap code where we do have a case where we have to do this kind of swap.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140120/474b3cc0/attachment.pgp>

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

PATCH 1/5 tools: mkimage: add support for gpimage format

Dear Murali,

Quoted 13 lines · In message <[email protected]> you…
Quoted 13 lines

tools/gpimage-common.c line 52

Quoted 8 lines
tools/gpimage-common.c new file +7 -0
+	if (do_swap32) {
+		gph_size = gpimage_swap32(gph->size);
+		gph_load_addr = gpimage_swap32(gph->load_addr);
+	} else {
+		gph_size = gph->size;
+		gph_load_addr = gph->load_addr;
+	}

I think it should be possible top write this code in such a way that you can avoid both the if- else and passing the do_swap32 parameter.
It is my impression that the whole endianess handling needs some refinemant.

Quoted 3 lines
Quoted 1 line

Actually I cannot see a place where do_swap32=0 is used..

This is done to keep the omapimage usage of this variable.

Is this actually used? It appear the omapimage handling would set do_swap32=1 only when imagename == "byteswap" (see "tools/omapimage.c"). Is this a practical usecase anywhere?

Best regards,

Wolfgang Denk

Signature · 5 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
Q:  Do you know what the death rate around here is?
A:  One per person.
#6 lore raw

PATCH 1/5 tools: mkimage: add support for gpimage format

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 15 lines · Wolfgang Denk

Dear Murali,

In message <[email protected]> you

Quoted 10 lines · wrote:
Quoted 10 lines
Quoted 4 lines
(quoted diff) +1 -0
+	if (do_swap32) { +		gph_size = gpimage_swap32(gph->size); +

gph_load_addr = gpimage_swap32(gph->load_addr); + } else { +
gph_size = gph->size; + gph_load_addr = gph->load_addr; + }

I think it should be possible top write this code in such a way that you can avoid both the if- else and passing the do_swap32 parameter. It is my impression that the whole endianess handling needs some refinemant.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Actually I cannot see a place where do_swap32=0 is used..

This is done to keep the omapimage usage of this variable.

Is this actually used? It appear the omapimage handling would set do_swap32=1 only when imagename == "byteswap" (see "tools/omapimage.c"). Is this a practical usecase anywhere?

In omapimage? Yes. On gpimage? I doubt it.

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJS3uVpAAoJENk4IS6UOR1WzoUP/1SFGSUOUV+T9F/2qFTpftNf Wt/3d+Pel7YFxzswZcj2Tmgdf8dpN6/3VUXByRxvru7MPOXvKLkVgr6m94s0a5lH T6i/492u5H+BdHVBXfQlSqULMOExWk6CEtRzIydEqrLmS6PehTCcuvDLrPYBeegk xncOap21YoPzfA8cvFhZ8y+ucVCbS7U/zHhLoNw69pc+AW0aZjTzOgEBdTHagkCX KV4WxfTAmBnOl+u7Pn38GPU9zfvVre4UDINiVN+/Qr6vru9B5MYAUIdOAb9a9O6x a00Yoh9xRfW9PbAyguW+EoURX5aIhoLFTTEDJ6HKyvmt4qhw+riG2/GrkXaRYJPD kifL1wfkQOYHD5E59soJ5XV1GqIfocvEO4aCmdNmizJlXsjlLNgeIklRdv1dA1Dt f2RaSlip/B1+joLyxthCqG9VfU2PKz3m6+Wy2SxIO1lf2cGbgKFJY6oGi5gGpTCy +TbpZx+1ltF36zKIFIdKqHc9w9xMc05VYZfSqfOBmGe3NTuR1tRB2FvrBdEYOqIW LNOLAz0od/mTxG0tiP+BkGNx+ZwYMhck3zZIXdWBOmCigu0RFFG5SSIF0uGoAv/z Th3y3qhCDJ2YGef+euWJvQwz1oxXb7WdV23p+zmDPSyQUpl0eKDyiMrq0ooo/TZI pplaUIOfbd5sumSZC4E2
=X3XI
-----END PGP SIGNATURE-----

#7 lore raw

PATCH 2/5 ubifs: fix checkpatch warning

In reply to Murali Karicheri

Fix the following checkpatch warning:-

WARNING: externs should be avoided in .c files

---
 common/cmd_ubifs.c |    9 ---------
 fs/ubifs/ubifs.h   |    7 +++++++
 2 files changed, 7 insertions(+), 9 deletions(-)
common/cmd_ubifs.c +0 -9
index d9af023..fdc8bfe 100644
@@ -21,15 +21,6 @@
 static int ubifs_initialized;
 static int ubifs_mounted;
 
-extern struct super_block *ubifs_sb;
-
-/* Prototypes */
-int ubifs_init(void);
-int ubifs_mount(char *vol_name);
-void ubifs_umount(struct ubifs_info *c);
-int ubifs_ls(char *dir_name);
-int ubifs_load(char *filename, u32 addr, u32 size);
-
 int do_ubifs_mount(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *vol_name;
fs/ubifs/ubifs.h +7 -0
index 633631e..2213201 100644
@@ -2137,6 +2137,13 @@ void ubifs_compress(const void *in_buf, int in_len, void *out_buf, int *out_len,
 int ubifs_decompress(const void *buf, int len, void *out, int *out_len,
 		     int compr_type);
 
+/* these are used in cmd_ubifs.c */
+int ubifs_init(void);
+int ubifs_mount(char *vol_name);
+void ubifs_umount(struct ubifs_info *c);
+int ubifs_ls(char *dir_name);
+int ubifs_load(char *filename, u32 addr, u32 size);
+
 #include "debug.h"
 #include "misc.h"
 #include "key.h"
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH 2/5 ubifs: fix checkpatch warning

Quoted 5 lines · Muralidharan

Fix the following checkpatch warning:-

WARNING: externs should be avoided in .c files

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140221/b26ff6b6/attachment.pgp>
#9 lore raw

PATCH 3/5 ubifs: return filesize from ubifs load operations

In reply to Murali Karicheri

This patch extends the ubifs load implementation to return the size of the file loaded from the filesystem. The ubifs command implementation has also been modified to set the filesize environment variable accordingly.

---
 common/cmd_ubifs.c |    7 +++++--
 fs/ubifs/ubifs.c   |   14 +++++++-------
 fs/ubifs/ubifs.h   |    2 +-
 3 files changed, 13 insertions(+), 10 deletions(-)
common/cmd_ubifs.c +5 -2
index fdc8bfe..a2926e0 100644
@@ -110,6 +110,7 @@ int do_ubifs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	int ret;
 	u32 addr;
 	u32 size = 0;
+	char buf[32];
 
 	if (!ubifs_mounted) {
 		printf("UBIFS not mounted, use ubifs mount to mount volume first!\n");
@@ -132,12 +133,14 @@ int do_ubifs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	}
 	debug("Loading file '%s' to address 0x%08x (size %d)\n", filename, addr, size);
 
-	ret = ubifs_load(filename, addr, size);
+	ret = ubifs_load(filename, addr, &size);
 	if (ret) {
 		printf("** File not found %s **\n", filename);
 		ret = CMD_RET_FAILURE;
+	} else {
+		sprintf(buf, "%X", size);
+		setenv("filesize", buf);
 	}
-
 	return ret;
 }
 
fs/ubifs/ubifs.c +7 -7
index 273c0a9..4f1d5c7 100644
@@ -677,7 +677,7 @@ error:
 	return err;
 }
 
-int ubifs_load(char *filename, u32 addr, u32 size)
+int ubifs_load(char *filename, u32 addr, u32 *size)
 {
 	struct ubifs_info *c = ubifs_sb->s_fs_info;
 	unsigned long inum;
@@ -711,12 +711,12 @@ int ubifs_load(char *filename, u32 addr, u32 size)
 	 * If no size was specified or if size bigger than filesize
 	 * set size to filesize
 	 */
-	if ((size == 0) || (size > inode->i_size))
-		size = inode->i_size;
+	if ((*size == 0) || (*size > inode->i_size))
+		*size = inode->i_size;
 
-	count = (size + UBIFS_BLOCK_SIZE - 1) >> UBIFS_BLOCK_SHIFT;
+	count = (*size + UBIFS_BLOCK_SIZE - 1) >> UBIFS_BLOCK_SHIFT;
 	printf("Loading file '%s' to addr 0x%08x with size %d (0x%08x)...\n",
-	       filename, addr, size, size);
+	       filename, addr, *size, *size);
 
 	page.addr = (void *)addr;
 	page.index = 0;
@@ -725,8 +725,8 @@ int ubifs_load(char *filename, u32 addr, u32 size)
 		/*
 		 * Make sure to not read beyond the requested size
 		 */
-		if (((i + 1) == count) && (size < inode->i_size))
-			last_block_size = size - (i * PAGE_SIZE);
+		if (((i + 1) == count) && (*size < inode->i_size))
+			last_block_size = *size - (i * PAGE_SIZE);
 
 		err = do_readpage(c, inode, &page, last_block_size);
 		if (err)
fs/ubifs/ubifs.h +1 -1
index 2213201..00485b3 100644
@@ -2142,7 +2142,7 @@ int ubifs_init(void);
 int ubifs_mount(char *vol_name);
 void ubifs_umount(struct ubifs_info *c);
 int ubifs_ls(char *dir_name);
-int ubifs_load(char *filename, u32 addr, u32 size);
+int ubifs_load(char *filename, u32 addr, u32 *size);
 
 #include "debug.h"
 #include "misc.h"
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH 3/5 ubifs: return filesize from ubifs load operations

Quoted 7 lines · Murali Karicheri

This patch extends the ubifs load implementation to return the size of the file loaded from the filesystem. The ubifs command implementation has also been modified to set the filesize environment variable accordingly.

But we already have code to do this, which now produces warnings when this patch is applied. Can you confirm that we are in fact not setting filesize already when loading from ubifs? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140221/3656df77/attachment.pgp>
#11 lore raw

PATCH 4/5 arm: add support for arch timer

In reply to Murali Karicheri

This patch add basic support for the architecture timer found on recent ARMv7 based SoCs.

---
 arch/arm/lib/Makefile     |    1 +
 arch/arm/lib/arch_timer.c |   69 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+)
 create mode 100644 arch/arm/lib/arch_timer.c
arch/arm/lib/Makefile +1 -0
index 321997c..58d58f8 100644
@@ -42,6 +42,7 @@ obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
 else
 obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
 endif
+COBJS-$(CONFIG_SYS_ARCH_TIMER) += arch_timer.o
 
 ifdef CONFIG_ARM64
 obj-y	+= interrupts_64.o
arch/arm/lib/arch_timer.c new file +69 -0

69 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#12 lore raw

PATCH 4/5 arm: add support for arch timer

Dear Murali Karicheri,

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

This patch add basic support for the architecture timer found on recent ARMv7 based SoCs.

Are we adding dead code here? Or where exactly is this code being used?

Quoted 10 lines
arch/arm/lib/arch_timer.c new file +7 -0
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2012, Texas Instruments <www.ti.com>
+ *
+ * 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.

arch/arm/lib/arch_timer.c line 17

Quoted 10 lines
arch/arm/lib/arch_timer.c new file +10 -0
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */

Please use SPDX License tag instead.

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
The world is coming to an end -- save your buffers!

A message that is not in the archive (sent off-list or not yet received): [email protected]

#14 lore raw

PATCH 4/5 arm: add support for arch timer

Dear Murali,

Quoted 6 lines · In message <[email protected]> you…
Quoted 3 lines

Are we adding dead code here? Or where exactly is this code being used?

This is a preparatory patch for keystone port that we are currently working on. I can repost the reworked code along with patch for the port if it can't be merged without the user code.

I cannot see any logical reason to include this patch in this series, so please resubmit when adding code that uses this feature.

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
It's not an optical illusion, it just looks like one.   -- Phil White
#15 lore raw

PATCH 5/5 NAND: DaVinci: allow forced disable of subpage writes

In reply to Murali Karicheri

This patch introduces a configurable mechanism to disable subpage writes in the DaVinci NAND driver.

---
 drivers/mtd/nand/davinci_nand.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/mtd/nand/davinci_nand.c +3 -0
index 5b17d7b..75b03a7 100644
@@ -609,6 +609,9 @@ void davinci_nand_init(struct nand_chip *nand)
 #ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
 	nand->bbt_options	  |= NAND_BBT_USE_FLASH;
 #endif
+#ifdef CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+	nand->options	  |= NAND_NO_SUBPAGE_WRITE;
+#endif
 #ifdef CONFIG_SYS_NAND_HW_ECC
 	nand->ecc.mode = NAND_ECC_HW;
 	nand->ecc.size = 512;
Signature · 1 line
1.7.9.5
#16 lore raw

PATCH 5/5 NAND: DaVinci: allow forced disable of subpage writes

Dear Murali Karicheri,

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

This patch introduces a configurable mechanism to disable subpage writes in the DaVinci NAND driver.

---
 drivers/mtd/nand/davinci_nand.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/mtd/nand/davinci_nand.c +0 -0
index 5b17d7b..75b03a7 100644

drivers/mtd/nand/davinci_nand.c void davinci_nand_init(struct nand_chip *nand) · line 617

Quoted 9 lines
drivers/mtd/nand/davinci_nand.c +3 -0
@@ -609,6 +609,9 @@ void davinci_nand_init(struct nand_chip *nand)
 #ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
 	nand->bbt_options	  |= NAND_BBT_USE_FLASH;
 #endif
+#ifdef CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+	nand->options	  |= NAND_NO_SUBPAGE_WRITE;
+#endif
 #ifdef CONFIG_SYS_NAND_HW_ECC
 	nand->ecc.mode = NAND_ECC_HW;
 	nand->ecc.size = 512;

New CONFIG_ options MUSt be documented in the README.

Also, you are just adding dead code. There are no users for this option.

Best regards,

Wolfgang Denk

Signature · 5 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
While most peoples' opinions change, the conviction of their correct-
ness never does.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#18 lore raw

PATCH 5/5 NAND: DaVinci: allow forced disable of subpage writes

Dear Murali,

Quoted 11 lines · In message <[email protected]> you…
Quoted 2 lines

New CONFIG_ options MUSt be documented in the README.

Will do.

Quoted 1 line

Also, you are just adding dead code. There are no users for this option.

This is a preparatory patch for keystone u-boot port and will bundle with it if it make more sense. But this looks harmless since this option allow users to disable subpage write. So I want to merge this right away after adding the option name to README. Any issues?

The adding of the documentation to the README and of the code should be in a single patch, not one after the other. And the patch should be art of a series that actually uses this feature. It has no logical place in the current patch series.

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
That Microsoft, the Trabant of the operating  system  world,  may  be
glancing  over the Berlin Wall at the Audis and BMWs and Mercedes. In
their own universe Trabants and Ladas were mainstream too...
                                                   -- Evan Leibovitch
#19 lore raw

PATCH 5/5 NAND: DaVinci: allow forced disable of subpage writes

In reply to Murali Karicheri
Quoted 14 lines · Murali Karicheri

This patch introduces a configurable mechanism to disable subpage writes in the DaVinci NAND driver.

---
 drivers/mtd/nand/davinci_nand.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/mtd/nand/davinci_nand.c +0 -0
index 5b17d7b..75b03a7 100644

drivers/mtd/nand/davinci_nand.c void davinci_nand_init(struct nand_chip *nand) · line 617

Quoted 9 lines
drivers/mtd/nand/davinci_nand.c +3 -0
@@ -609,6 +609,9 @@ void davinci_nand_init(struct nand_chip *nand)
 #ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
 	nand->bbt_options	  |= NAND_BBT_USE_FLASH;
 #endif
+#ifdef CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+	nand->options	  |= NAND_NO_SUBPAGE_WRITE;
+#endif
 #ifdef CONFIG_SYS_NAND_HW_ECC
 	nand->ecc.mode = NAND_ECC_HW;
 	nand->ecc.size = 512;

Why does it need to be configurable?

-Scott

A message that is not in the archive (sent off-list or not yet received): [email protected]

#21 lore raw

PATCH 5/5 NAND: DaVinci: allow forced disable of subpage writes

Quoted 35 lines · Muralidharan
Quoted 17 lines

-----Original Message-----
From: Scott Wood [mailto:scottwood at freescale.com]
Sent: Wednesday, January 22, 2014 3:48 PM
To: Karicheri, Muralidharan
Cc: u-boot at lists.denx.de; Rini, Tom; Andrianov, Vitaly
Subject: Re: [U-Boot] [PATCH 5/5] NAND: DaVinci: allow forced disable of subpage writes

Quoted 9 lines · Murali Karicheri

This patch introduces a configurable mechanism to disable subpage writes in the DaVinci NAND driver.

---
 drivers/mtd/nand/davinci_nand.c |    3 +++
 1 file changed, 3 insertions(+)
Quoted 17 lines
Quoted 5 lines
(quoted diff) +0 -0

b/drivers/mtd/nand/davinci_nand.c index 5b17d7b..75b03a7 100644

drivers/mtd/nand/davinci_nand.c void davinci_nand_init(struct nand_chip *nand) · line 617

Quoted 9 lines
drivers/mtd/nand/davinci_nand.c +3 -0
@@ -609,6 +609,9 @@ void davinci_nand_init(struct nand_chip *nand)
 #ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
 	nand->bbt_options	  |= NAND_BBT_USE_FLASH;
 #endif
+#ifdef CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+	nand->options	  |= NAND_NO_SUBPAGE_WRITE;
+#endif
 #ifdef CONFIG_SYS_NAND_HW_ECC
 	nand->ecc.mode = NAND_ECC_HW;
 	nand->ecc.size = 512;

Why does it need to be configurable?

Quoted 2 lines

Same driver used in multiple platforms, and on some platforms like the one I work with doesn't support subpage writes and has to be disabled.

The option needs to be documented, and it should be either named in a davinci-specific manner, or the documentation should clearly list which drivers pay attention to it.

It seems odd though, that the ability to support subpage writes is an independent thing rather than a consequence of some other variable such as controller version.

-Scott

#22 lore raw

PATCH 5/5 NAND: DaVinci: allow forced disable of subpage writes

Quoted 37 lines · Scott Wood
Quoted 35 lines · Muralidharan
Quoted 34 lines

-----Original Message-----
From: Scott Wood [mailto:scottwood at freescale.com]
Sent: Wednesday, January 22, 2014 3:48 PM
To: Karicheri, Muralidharan
Cc: u-boot at lists.denx.de; Rini, Tom; Andrianov, Vitaly
Subject: Re: [U-Boot] [PATCH 5/5] NAND: DaVinci: allow forced disable of subpage writes

Quoted 14 lines · Murali Karicheri

This patch introduces a configurable mechanism to disable subpage writes in the DaVinci NAND driver.

---
 drivers/mtd/nand/davinci_nand.c |    3 +++
 1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/mtd/nand/davinci_nand.c index 5b17d7b..75b03a7 100644

drivers/mtd/nand/davinci_nand.c void davinci_nand_init(struct nand_chip *nand) · line 617

Quoted 9 lines
drivers/mtd/nand/davinci_nand.c +3 -0
@@ -609,6 +609,9 @@ void davinci_nand_init(struct nand_chip *nand)
 #ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
 	nand->bbt_options	  |= NAND_BBT_USE_FLASH;
 #endif
+#ifdef CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+	nand->options	  |= NAND_NO_SUBPAGE_WRITE;
+#endif
 #ifdef CONFIG_SYS_NAND_HW_ECC
 	nand->ecc.mode = NAND_ECC_HW;
 	nand->ecc.size = 512;

Why does it need to be configurable?

Quoted 6 lines
Quoted 2 lines

Same driver used in multiple platforms, and on some platforms like the one I work with doesn't support subpage writes and has to be disabled.

The option needs to be documented, and it should be either named in a davinci-specific manner, or the documentation should clearly list which drivers pay attention to it.

Agreed.

Quoted 3 lines

It seems odd though, that the ability to support subpage writes is an independent thing rather than a consequence of some other variable such as controller version.

I suspect this is similar to the OMAP driver where we could support subpages but it gets tricky coordinating with the HW ECC engine for BCH8 and higher. Perhaps there are davinci targets with smaller ECC levels where it works out OK but keystone is doing BCH8 or 16 and it's not worth the savings.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140218/c75a2a56/attachment.pgp>
#23 lore raw

PATCH 5/5 NAND: DaVinci: allow forced disable of subpage writes

Quoted 42 lines · Tom
Quoted 34 lines · Scott Wood
Quoted 33 lines · Muralidharan
Quoted 33 lines

-----Original Message-----
From: Scott Wood [mailto:scottwood at freescale.com]
Sent: Wednesday, January 22, 2014 3:48 PM
To: Karicheri, Muralidharan
Cc: u-boot at lists.denx.de; Rini, Tom; Andrianov, Vitaly
Subject: Re: [U-Boot] [PATCH 5/5] NAND: DaVinci: allow forced disable of subpage writes

Quoted 14 lines · Murali Karicheri

This patch introduces a configurable mechanism to disable subpage writes in the DaVinci NAND driver.

---
  drivers/mtd/nand/davinci_nand.c |    3 +++
  1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/mtd/nand/davinci_nand.c index 5b17d7b..75b03a7 100644

drivers/mtd/nand/davinci_nand.c void davinci_nand_init(struct nand_chip *nand) · line 617

Quoted 9 lines
drivers/mtd/nand/davinci_nand.c +3 -0
@@ -609,6 +609,9 @@ void davinci_nand_init(struct nand_chip *nand)
 #ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
  	nand->bbt_options	  |= NAND_BBT_USE_FLASH;
  #endif
+#ifdef CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+	nand->options	  |= NAND_NO_SUBPAGE_WRITE;
+#endif
  #ifdef CONFIG_SYS_NAND_HW_ECC
  	nand->ecc.mode = NAND_ECC_HW;
  	nand->ecc.size = 512;

Why does it need to be configurable?

Quoted 5 lines
Quoted 2 lines

Same driver used in multiple platforms, and on some platforms like the one I work with doesn't support subpage writes and has to be disabled.

The option needs to be documented, and it should be either named in a davinci-specific manner, or the documentation should clearly list which drivers pay attention to it.

Agreed.

Quoted 8 lines
Quoted 3 lines

It seems odd though, that the ability to support subpage writes is an independent thing rather than a consequence of some other variable such as controller version.

I suspect this is similar to the OMAP driver where we could support subpages but it gets tricky coordinating with the HW ECC engine for BCH8 and higher. Perhaps there are davinci targets with smaller ECC levels where it works out OK but keystone is doing BCH8 or 16 and it's not worth the savings.

Tom/Scott,

My next version of the series will have readme updated with this option (no change in name
as this can be used by other drivers as well) and mention that davinci_nand driver is the
driver that currently uses this option.

Murali