Skip to contentSkip to conversation

Building of FIT images does not work.

PATCH New Remy Bohmer 5 participants 28 messages Oct 28, 2009 – Nov 24, 2009

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

PATCH 1/1 Building of FIT images does not work.

The type is not set for generation of the FIT images, resulting in no images being created without printing or returning an error

---
 tools/mkimage.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
tools/mkimage.c +1 -0
index ab6ea32..8a20594 100644
@@ -229,6 +229,7 @@ main (int argc, char **argv)
 			case 'f':
 				if (--argc <= 0)
 					usage ();
+				params.type = IH_TYPE_FLATDT;
 				params.datafile = *++argv;
 				params.fflag = 1;
 				goto NXTARG;
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 Fix mingw tools build

mkimage does not build due to missing strtok_r() and getline() implementation

---
 tools/mingw_support.c |  157 +++++++++++++++++++++++++++++++++++++++++++++++++
 tools/mingw_support.h |    2 +
 2 files changed, 159 insertions(+), 0 deletions(-)
tools/mingw_support.c +157 -0
index 67cd6e1..6379710 100644
@@ -24,7 +24,9 @@
 #include "mingw_support.h"
 #include <stdio.h>
 #include <stdint.h>
+#include <string.h>
 #include <errno.h>
+#include <assert.h>
 #include <io.h>
 
 int fsync(int fd)
@@ -77,3 +79,158 @@ int munmap(void *addr, size_t len)
 
 	return 0;
 }
+
+/* Reentrant string tokenizer.  Generic version.
+   Copyright (C) 1991,1996-1999,2001,2004,2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* Parse S into tokens separated by characters in DELIM.
+   If S is NULL, the saved pointer in SAVE_PTR is used as
+   the next starting point.  For example:
+	char s[] = "-abc-=-def";
+	char *sp;
+	x = strtok_r(s, "-", &sp);	// x = "abc", sp = "=-def"
+	x = strtok_r(NULL, "-=", &sp);	// x = "def", sp = NULL
+	x = strtok_r(NULL, "=", &sp);	// x = NULL
+		// s = "abc\0-def\0"
+*/
+char *strtok_r(char *s, const char *delim, char **save_ptr)
+{
+	char *token;
+
+	if (s == NULL)
+		s = *save_ptr;
+
+	/* Scan leading delimiters.  */
+	s += strspn(s, delim);
+	if (*s == '\0') {
+		*save_ptr = s;
+		return NULL;
+	}
+
+	/* Find the end of the token.  */
+	token = s;
+	s = strpbrk (token, delim);
+	if (s == NULL) {
+		/* This token finishes the string.  */
+		*save_ptr = memchr(token, '\0', strlen(token));
+	} else {
+		/* Terminate the token and make *SAVE_PTR point past it.  */
+		*s = '\0';
+		*save_ptr = s + 1;
+	}
+	return token;
+}
+
+/* getline.c -- Replacement for GNU C library function getline
+
+Copyright (C) 1993, 1996, 2001, 2002 Free Software Foundation, Inc.
+
+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. */
+
+/* Written by Jan Brittenson, bson at gnu.ai.mit.edu.  */
+
+/* Always add at least this many bytes when extending the buffer.  */
+#define MIN_CHUNK 64
+
+/* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR
+   + OFFSET (and null-terminate it). *LINEPTR is a pointer returned from
+   malloc (or NULL), pointing to *N characters of space.  It is realloc'd
+   as necessary.  Return the number of characters read (not including the
+   null terminator), or -1 on error or EOF.
+   NOTE: There is another getstr() function declared in <curses.h>.  */
+static int getstr(char **lineptr, size_t *n, FILE *stream,
+		  char terminator, size_t offset)
+{
+	int nchars_avail;	/* Allocated but unused chars in *LINEPTR.  */
+	char *read_pos;		/* Where we're reading into *LINEPTR. */
+	int ret;
+
+	if (!lineptr || !n || !stream)
+		return -1;
+
+	if (!*lineptr) {
+		*n = MIN_CHUNK;
+		*lineptr = malloc(*n);
+		if (!*lineptr)
+			return -1;
+	}
+
+	nchars_avail = *n - offset;
+	read_pos = *lineptr + offset;
+
+	for (;;) {
+		register int c = getc(stream);
+
+		/* We always want at least one char left in the buffer, since we
+		   always (unless we get an error while reading the first char)
+		   NUL-terminate the line buffer.  */
+
+		assert(*n - nchars_avail == read_pos - *lineptr);
+		if (nchars_avail < 2) {
+			if (*n > MIN_CHUNK)
+				*n *= 2;
+			else
+				*n += MIN_CHUNK;
+
+			nchars_avail = *n + *lineptr - read_pos;
+			*lineptr = realloc(*lineptr, *n);
+			if (!*lineptr)
+				return -1;
+			read_pos = *n - nchars_avail + *lineptr;
+			assert(*n - nchars_avail == read_pos - *lineptr);
+		}
+
+		if (c == EOF || ferror (stream)) {
+			/* Return partial line, if any.  */
+			if (read_pos == *lineptr)
+				return -1;
+			else
+				break;
+		}
+
+		*read_pos++ = c;
+		nchars_avail--;
+
+		if (c == terminator)
+			/* Return the line.  */
+			break;
+	}
+
+	/* Done - NUL terminate and return the number of chars read.  */
+	*read_pos = '\0';
+
+	ret = read_pos - (*lineptr + offset);
+	return ret;
+}
+
+int getline (char **lineptr, size_t *n, FILE *stream)
+{
+	return getstr(lineptr, n, stream, '\n', 0);
+}
tools/mingw_support.h +2 -0
index 9e45e64..2793674 100644
@@ -44,5 +44,7 @@ typedef	ULONG	ulong;
 int fsync(int fd);
 void *mmap(void *, size_t, int, int, int, int);
 int munmap(void *, size_t);
+char *strtok_r(char *s, const char *delim, char **save_ptr);
+int getline(char **lineptr, size_t *n, FILE *stream);
 
 #endif /* __MINGW_SUPPORT_H_ */
Signature · 1 line
1.6.0.4
#2 lore raw

PATCH 1/1 Add support for CS2 dataflash for Atmel-SPI.

The only missing chipselect line support is CS2, and I need it on CS2...

---
 drivers/spi/atmel_dataflash_spi.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
drivers/spi/atmel_dataflash_spi.c +16 -2
index 614965c..3a648e6 100644
@@ -30,7 +30,8 @@
 #include <dataflash.h>
 
 #define AT91_SPI_PCS0_DATAFLASH_CARD	0xE	/* Chip Select 0: NPCS0%1110 */
-#define AT91_SPI_PCS1_DATAFLASH_CARD	0xD	/* Chip Select 0: NPCS0%1101 */
+#define AT91_SPI_PCS1_DATAFLASH_CARD	0xD	/* Chip Select 1: NPCS1%1101 */
+#define AT91_SPI_PCS2_DATAFLASH_CARD	0xB	/* Chip Select 2: NPCS2%1011 */
 #define AT91_SPI_PCS3_DATAFLASH_CARD	0x7	/* Chip Select 3: NPCS3%0111 */
 
 void AT91F_SpiInit(void)
@@ -57,7 +58,14 @@ void AT91F_SpiInit(void)
 	       ((get_mck_clk_rate() / AT91_SPI_CLK) << 8),
 	       AT91_BASE_SPI + AT91_SPI_CSR(1));
 #endif
-
+#ifdef CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS2
+	/* Configure CS2 */
+	writel(AT91_SPI_NCPHA |
+	       (AT91_SPI_DLYBS & DATAFLASH_TCSS) |
+	       (AT91_SPI_DLYBCT & DATAFLASH_TCHS) |
+	       ((get_mck_clk_rate() / AT91_SPI_CLK) << 8),
+	       AT91_BASE_SPI + AT91_SPI_CSR(2));
+#endif
 #ifdef CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3
 	/* Configure CS3 */
 	writel(AT91_SPI_NCPHA |
@@ -99,6 +107,12 @@ void AT91F_SpiEnable(int cs)
 		writel(mode | ((AT91_SPI_PCS1_DATAFLASH_CARD<<16) & AT91_SPI_PCS),
 		       AT91_BASE_SPI + AT91_SPI_MR);
 		break;
+	case 2:	/* Configure SPI CS2 for Serial DataFlash AT45DBxx */
+		mode = readl(AT91_BASE_SPI + AT91_SPI_MR);
+		mode &= 0xFFF0FFFF;
+		writel(mode | ((AT91_SPI_PCS2_DATAFLASH_CARD<<16) & AT91_SPI_PCS),
+		       AT91_BASE_SPI + AT91_SPI_MR);
+		break;
 	case 3:
 		mode = readl(AT91_BASE_SPI + AT91_SPI_MR);
 		mode &= 0xFFF0FFFF;
Signature · 1 line
1.6.0.4
#3 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

The current generic code for handling unaligned access assumes that the processor can properly handle unaligned accesses itself. This is at least not the case for ARM, which results in runtime errors.

Rewrite it such that it works for ARM as well.

---
 include/linux/unaligned/access_ok.h |   48 ++++++++++++++++++++++++----------
 1 files changed, 34 insertions(+), 14 deletions(-)
include/linux/unaligned/access_ok.h +34 -14
index 5f46eee..172124f 100644
@@ -1,66 +1,86 @@
 #ifndef _LINUX_UNALIGNED_ACCESS_OK_H
 #define _LINUX_UNALIGNED_ACCESS_OK_H
 
-#include <asm/byteorder.h>
-
 static inline u16 get_unaligned_le16(const void *p)
 {
-	return le16_to_cpup((__le16 *)p);
+	const u8 *__p = p;
+	return __p[0] | __p[1] << 8;
 }
 
 static inline u32 get_unaligned_le32(const void *p)
 {
-	return le32_to_cpup((__le32 *)p);
+	const u8 *__p = p;
+	return __p[0] | __p[1] << 8 | __p[2] << 16 | __p[3] << 24;
 }
 
 static inline u64 get_unaligned_le64(const void *p)
 {
-	return le64_to_cpup((__le64 *)p);
+	const u8 *__p = p;
+	return (unsigned long long)
+		get_unaligned_le32((__p + 4)) << 32 |
+		get_unaligned_le32(__p);
 }
 
 static inline u16 get_unaligned_be16(const void *p)
 {
-	return be16_to_cpup((__be16 *)p);
+	const u8 *__p = p;
+	return __p[0] << 8 | __p[1];
 }
 
 static inline u32 get_unaligned_be32(const void *p)
 {
-	return be32_to_cpup((__be32 *)p);
+	const u8 *__p = p;
+	return __p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3];
 }
 
 static inline u64 get_unaligned_be64(const void *p)
 {
-	return be64_to_cpup((__be64 *)p);
+	const u8 *__p = p;
+	return (unsigned long long)
+		get_unaligned_be32(__p) << 32 |
+		get_unaligned_be32((__p + 4));
 }
 
 static inline void put_unaligned_le16(u16 val, void *p)
 {
-	*((__le16 *)p) = cpu_to_le16(val);
+	u8 *__p = p;
+	*__p++ = val;
+	*__p++ = val >> 8;
 }
 
 static inline void put_unaligned_le32(u32 val, void *p)
 {
-	*((__le32 *)p) = cpu_to_le32(val);
+	u8 *__p = p;
+	put_unaligned_le16(val >> 16, __p + 2);
+	put_unaligned_le16(val, __p);
 }
 
 static inline void put_unaligned_le64(u64 val, void *p)
 {
-	*((__le64 *)p) = cpu_to_le64(val);
+	u8 *__p = p;
+	put_unaligned_le32(val >> 32, __p + 4);
+	put_unaligned_le32(val, __p);
 }
 
 static inline void put_unaligned_be16(u16 val, void *p)
 {
-	*((__be16 *)p) = cpu_to_be16(val);
+	u8 *__p = p;
+	*__p++ = val >> 8;
+	*__p++ = val;
 }
 
 static inline void put_unaligned_be32(u32 val, void *p)
 {
-	*((__be32 *)p) = cpu_to_be32(val);
+	u8 *__p = p;
+	put_unaligned_be16(val >> 16, __p);
+	put_unaligned_be16(val, __p + 2);
 }
 
 static inline void put_unaligned_be64(u64 val, void *p)
 {
-	*((__be64 *)p) = cpu_to_be64(val);
+	u8 *__p = p;
+	put_unaligned_be32(val >> 32, __p);
+	put_unaligned_be32(val, __p + 4);
 }
 
 #endif /* _LINUX_UNALIGNED_ACCESS_OK_H */
Signature · 1 line
1.6.0.4
#4 lore raw

PATCH 1/1 Repair the 'netry=once' option.

'netretry = once' does the same as 'netretry = yes', because it is not stored when it was tried once.

---
 net/net.c |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)
net/net.c +24 -8
index cab4b2d..fd13cd9 100644
@@ -197,6 +197,8 @@ volatile uchar *NetTxPacket = 0;	/* THE transmit packet			*/
 
 static int net_check_prereq (proto_t protocol);
 
+static int NetTryCount;
+
 /**********************************************************************/
 
 IPaddr_t	NetArpWaitPacketIP;
@@ -320,6 +322,7 @@ NetLoop(proto_t protocol)
 	NetArpWaitReplyIP = 0;
 	NetArpWaitTxPacket = NULL;
 	NetTxPacket = NULL;
+	NetTryCount = 1;
 
 	if (!NetTxPacket) {
 		int	i;
@@ -558,17 +561,30 @@ startAgainHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
 void NetStartAgain (void)
 {
 	char *nretry;
-	int noretry = 0, once = 0;
+	int retry_forever = 0;
+	unsigned long retrycnt = 0;
+
+	nretry = getenv("netretry");
+	if (nretry) {
+		if (!strcmp(nretry, "yes"))
+			retry_forever = 1;
+		else if (!strcmp(nretry, "no"))
+			retrycnt = 0;
+		else if (!strcmp(nretry, "once"))
+			retrycnt = 1;
+		else
+			retrycnt = simple_strtoul(nretry, NULL, 0);
+	} else
+		retry_forever = 1;
 
-	if ((nretry = getenv ("netretry")) != NULL) {
-		noretry = (strcmp (nretry, "no") == 0);
-		once = (strcmp (nretry, "once") == 0);
-	}
-	if (noretry) {
-		eth_halt ();
+	if ((!retry_forever) && (NetTryCount >= retrycnt)) {
+		eth_halt();
 		NetState = NETLOOP_FAIL;
 		return;
 	}
+
+	NetTryCount++;
+
 #ifndef CONFIG_NET_MULTI
 	NetSetTimeout (10000UL, startAgainTimeout);
 	NetSetHandler (startAgainHandler);
@@ -580,7 +596,7 @@ void NetStartAgain (void)
 	eth_init (gd->bd);
 	if (NetRestartWrap) {
 		NetRestartWrap = 0;
-		if (NetDevExists && !once) {
+		if (NetDevExists) {
 			NetSetTimeout (10000UL, startAgainTimeout);
 			NetSetHandler (startAgainHandler);
 		} else {
Signature · 1 line
1.6.0.4
#5 lore raw

PATCH 1/1 Add error codes/handling for TFTP-server

---
 net/tftp.c |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)
net/tftp.c +29 -3
index cc60a3b..d254f49 100644
@@ -47,6 +47,16 @@ static int TftpTimeoutCountMax = TIMEOUT_COUNT;
 ulong TftpRRQTimeoutMSecs = TIMEOUT;
 int TftpRRQTimeoutCountMax = TIMEOUT_COUNT;
 
+enum {
+	TFTP_ERR_UNDEFINED           = 0,
+	TFTP_ERR_FILE_NOT_FOUND      = 1,
+	TFTP_ERR_ACCESS_DENIED       = 2,
+	TFTP_ERR_DISK_FULL           = 3,
+	TFTP_ERR_UNEXPECTED_OPCODE   = 4,
+	TFT_ERR_UNKNOWN_TRANSFER_ID  = 5,
+	TFTP_ERR_FILE_ALREADY_EXISTS = 6,
+};
+
 static IPaddr_t TftpServerIP;
 static int	TftpServerPort;		/* The UDP port at their end		*/
 static int	TftpOurPort;		/* The UDP port at our end		*/
@@ -472,11 +482,27 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
 	case TFTP_ERROR:
 		printf ("\nTFTP error: '%s' (%d)\n",
 					pkt + 2, ntohs(*(ushort *)pkt));
-		puts ("Starting again\n\n");
+
+		switch (ntohs(*(ushort *)pkt)) {
+		case TFTP_ERR_FILE_NOT_FOUND:
+		case TFTP_ERR_ACCESS_DENIED:
+			puts("Not retrying...\n");
+			eth_halt();
+			NetState = NETLOOP_FAIL;
+			break;
+		case TFTP_ERR_UNDEFINED:
+		case TFTP_ERR_DISK_FULL:
+		case TFTP_ERR_UNEXPECTED_OPCODE:
+		case TFT_ERR_UNKNOWN_TRANSFER_ID:
+		case TFTP_ERR_FILE_ALREADY_EXISTS:
+		default:
+			puts("Starting again\n\n");
 #ifdef CONFIG_MCAST_TFTP
-		mcast_cleanup();
+			mcast_cleanup();
 #endif
-		NetStartAgain ();
+			NetStartAgain();
+			break;
+		}
 		break;
 	}
 }
Signature · 1 line
1.6.0.4
#6 lore raw

PATCH 1/1 Repair build failure in case PPC is not defined and FIT is beng used.

---
 common/cmd_bootm.c |    2 +-
 common/image.c     |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)
common/cmd_bootm.c +1 -1
index 8f83598..32fd9bb 100644
@@ -524,7 +524,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		}
 			break;
 #endif
-#ifdef CONFIG_OF_LIBFDT
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_SYS_BOOTMAPSZ)
 		case BOOTM_STATE_FDT:
 		{
 			ulong bootmap_base = getenv_bootm_low();
common/image.c +2 -0
index 6eaf41e..41b584d 100644
@@ -1506,9 +1506,11 @@ int boot_get_fdt (int flag, int argc, char *argv[], bootm_headers_t *images,
 					fdt_blob = (char *)data;
 				}
 
+#if defined(CONFIG_PPC)
 				images->fit_hdr_fdt = fit_hdr;
 				images->fit_uname_fdt = fit_uname_fdt;
 				images->fit_noffset_fdt = fdt_noffset;
+#endif
 				break;
 			} else
 #endif
Signature · 1 line
1.6.0.4
#7 lore raw

PATCH 1/1 Repair build failure in case PPC is not defined and FIT is beng used.

Dear Remy Bohmer,

please pay a little more attention to the commit subjects (here:
s/beng/being/, please); also, make sure the subject is short enough for a commit message title line.

Quoted 24 lines · In message <[email protected]> you wrote:
---
 common/cmd_bootm.c |    2 +-
 common/image.c     |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)
common/cmd_bootm.c +1 -1
index 8f83598..32fd9bb 100644
@@ -524,7 +524,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		}
 			break;
 #endif
-#ifdef CONFIG_OF_LIBFDT
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_SYS_BOOTMAPSZ)
 		case BOOTM_STATE_FDT:
 		{
 			ulong bootmap_base = getenv_bootm_low();
common/image.c +0 -0
index 6eaf41e..41b584d 100644

common/image.c int boot_get_fdt (int flag, int argc, char *argv[], bootm_headers_t *images, · line 1513

Quoted 8 lines
common/image.c +2 -0
@@ -1506,9 +1506,11 @@ int boot_get_fdt (int flag, int argc, char *argv[], bootm_headers_t *images,
 					fdt_blob = (char *)data;
 				}
 
+#if defined(CONFIG_PPC)
 				images->fit_hdr_fdt = fit_hdr;
 				images->fit_uname_fdt = fit_uname_fdt;
 				images->fit_noffset_fdt = fdt_noffset;
+#endif

NAK. This code is in no way dependent on the Power architecture, so CONFIG_PPC is definitly the wrong thing to check for.

Best regards,

Wolfgang Denk

Signature · 6 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 years of peak mental activity are undoubtedly between the ages of
four and eighteen. At four we know all the questions, at eighteen all
the answers.
#8 lore raw

PATCH 1/1 Repair build failure in case PPC is not defined and FIT is beng used.

Hi Wolfgang,

2009/10/29 Wolfgang Denk <[email protected]>:

Quoted 5 lines

Dear Remy Bohmer,

please pay a little more attention to the commit subjects (here:
s/beng/being/, please); also, make sure the subject is short enough for a commit message title line.

OK.

Quoted 9 lines
Quoted 6 lines

+#if defined(CONFIG_PPC)
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? images->fit_hdr_fdt = fit_hdr; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? images->fit_uname_fdt = fit_uname_fdt; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? images->fit_noffset_fdt = fdt_noffset; +#endif

NAK. This code is in no way dependent on the Power architecture, so CONFIG_PPC is definitly the wrong thing to check for.

Well, in include/image.h, line 223 this is listed:
-------------------------------------------------------------------------------
#if defined(CONFIG_PPC)

        void            *fit_hdr_fdt;   /* FDT blob FIT image header */
        const char      *fit_uname_fdt; /* FDT blob subimage node unit name */
        int             fit_noffset_fdt;/* FDT blob subimage node offset */

#endif
-------------------------------------------------------------------------------

So, you are saying the bug is in the header as well? (I just made the code compliant to the ifdef in the header ;-) )

Kind regards,

Remy

#9 lore raw

PATCH 1/1 Repair build failure in case PPC is not defined and FIT is beng used.

Dear Remy,

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

NAK. This code is in no way dependent on the Power architecture, so CONFIG_PPC is definitly the wrong thing to check for.

Well, in include/image.h, line 223 this is listed:

...

Quoted 3 lines

So, you are saying the bug is in the header as well? (I just made the code compliant to the ifdef in the header ;-) )

If you could clean up that part, too, it wouldbe welcome.

Best regards,

Wolfgang Denk

Signature · 6 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
If you want strict real-time behavior, run in the real  time  schedu-
ling class.  But there are no seatbelts or airbags;  main(){for(;;);}
can hard hang your system.                          -- Bart Smaalders
Applied
#10 lore raw

PATCH 1/1 Add error codes/handling for TFTP-server

In reply to Remy Bohmer
Quoted 11 lines · Remy Bohmer
---
 net/tftp.c |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)
net/tftp.c +0 -0
index cc60a3b..d254f49 100644
@@ -47,6 +47,16 @@ static int TftpTimeoutCountMax = TIMEOUT_COUNT;
 ulong TftpRRQTimeoutMSecs = TIMEOUT;

net/tftp.c static int TftpTimeoutCountMax = TIMEOUT_COUNT; · line 57

Quoted 10 lines
net/tftp.c +7 -0
 int TftpRRQTimeoutCountMax = TIMEOUT_COUNT;
 
+enum {
+	TFTP_ERR_UNDEFINED           = 0,
+	TFTP_ERR_FILE_NOT_FOUND      = 1,
+	TFTP_ERR_ACCESS_DENIED       = 2,
+	TFTP_ERR_DISK_FULL           = 3,
+	TFTP_ERR_UNEXPECTED_OPCODE   = 4,
+	TFT_ERR_UNKNOWN_TRANSFER_ID  = 5,
 

Applied to net/next after fixing typo in last enum

regards,
Ben

Applied
#11 lore raw

PATCH 1/1 Repair the 'netry=once' option.

In reply to Remy Bohmer

Hi Remy,

Quoted 8 lines · Remy Bohmer

'netretry = once' does the same as 'netretry = yes', because it is not stored when it was tried once.

---
 net/net.c |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)

Applied to net/next.

thanks,
Ben

#12 lore raw

PATCH 1/1 Repair the 'netry=once' option.

Dear Ben Warren,

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

Hi Remy,

Quoted 3 lines · Remy Bohmer

'netretry = once' does the same as 'netretry = yes', because it is not stored when it was tried once.

Quoted 6 lines
Quoted 5 lines
---
 net/net.c |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)

Applied to net/next.

I think this is a bug fix and should go into this release (with a fix of the typo (s/netry/netretry/) in the Subject, of course).

Can you please do that? Thanks.

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
"Love is an ideal thing, marriage a real thing; a  confusion  of  the
real with the ideal never goes unpunished."                  - Goethe
#13 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

In reply to Remy Bohmer

Hi Remy,

Quoted 6 lines · On Wednesday 28 October 2009 22:13:38 Remy Bohmer wrote:

The current generic code for handling unaligned access assumes that the processor can properly handle unaligned accesses itself. This is at least not the case for ARM, which results in runtime errors.

Rewrite it such that it works for ARM as well.

I introduced this header some time ago for UBIFS support (for PowerPC). As you may have noticed, it's a copy from the Linux version. And I would like to keep it this way if possible. Looking at the Linux ARM version, the basic difference seems to be the header "include/asm-arm/unaligned.h" which includes this file. The Linux version of "unaligned.h" does *not* include "access_ok.h" at all. It includes "le_byteshift.h" and "be_byteshift.h" instead. And I would really like to keep this in sync with Linux if possible.

So why not do it this way (totally untested):

#14 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

Hi,

2009/10/29 Stefan Roese <[email protected]>:

Quoted 8 lines

Hi Remy,

Quoted 5 lines · On Wednesday 28 October 2009 22:13:38 Remy Bohmer wrote:

The current generic code for handling unaligned access assumes that the processor can properly handle unaligned accesses itself. This is at least not the case for ARM, which results in runtime errors.

Quoted 4 lines
Quoted 1 line

Rewrite it such that it works for ARM as well.

I introduced this header some time ago for UBIFS support (for PowerPC). As you may have noticed, it's a copy from the Linux version. And I

Yep, I noticed that.

Quoted 1 line

would like to keep it this way if possible.

I understand that, but still the code in there is not _generic_, it might work on Linux since the data-abort trapcode is handling this exception that occurs on unaligned accesses...

Quoted 13 lines

Looking at the Linux ARM
version, the basic difference seems to be the header "include/asm-arm/unaligned.h" which includes this file. The Linux version of "unaligned.h" does *not* include "access_ok.h" at all. It includes "le_byteshift.h" and "be_byteshift.h" instead. And I would really like to keep this in sync with Linux if possible.

So why not do it this way (totally untested):
From 3e9aa23a66041f05b94f94b1326941331248a487 Mon Sep 17 00:00:00 2001
From: Stefan Roese <[email protected]>
Date: Thu, 29 Oct 2009 05:57:53 +0100
Subject: [PATCH] arm: Use Linux version for unaligned access code

Quoted 8 lines
---
 include/asm-arm/unaligned.h            |    3 +-
 include/linux/unaligned/be_byteshift.h |   70 ++++++++++++++++++++++++++++++++
 include/linux/unaligned/le_byteshift.h |   70 ++++++++++++++++++++++++++++++++
 3 files changed, 142 insertions(+), 1 deletions(-)
 create mode 100644 include/linux/unaligned/be_byteshift.h
 create mode 100644 include/linux/unaligned/le_byteshift.h

Indeed, this looks cleaner for ARM and it works as well... (hmm, looks more like the old code I was using which I removed from my USB-CDC-tree since the unaligned.h code was added to mainline...)

Quoted 5 lines

Please give it a try and feel free to submit this patch with a better commit text if it works for you.

Cheers,
Stefan

I will clean it up and repost that patch. This patch can be ignored.

Kind Regards,

Remy

#15 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

Quoted 15 lines · Remy Bohmer

Hi,

2009/10/29 Stefan Roese <[email protected]>:

Quoted 11 lines

Hi Remy,

Quoted 6 lines · On Wednesday 28 October 2009 22:13:38 Remy Bohmer wrote:

The current generic code for handling unaligned access assumes that the processor can properly handle unaligned accesses itself. This is at least not the case for ARM, which results in runtime errors.

Rewrite it such that it works for ARM as well.

I introduced this header some time ago for UBIFS support (for PowerPC). As you may have noticed, it's a copy from the Linux version. And I

Quoted 16 lines

Yep, I noticed that.

Quoted 1 line

would like to keep it this way if possible.

I understand that, but still the code in there is not _generic_, it might work on Linux since the data-abort trapcode is handling this exception that occurs on unaligned accesses...

Quoted 8 lines

Looking at the Linux ARM
version, the basic difference seems to be the header "include/asm-arm/unaligned.h" which includes this file. The Linux version of "unaligned.h" does *not* include "access_ok.h" at all. It includes "le_byteshift.h" and "be_byteshift.h" instead. And I would really like to keep this in sync with Linux if possible.

So why not do it this way (totally untested):

I see the patch has been reposted.
Has it been tested ?

Tom

#16 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

Hi Tom,

Quoted 11 lines
Quoted 8 lines
Quoted 8 lines

Looking at the Linux ARM
version, the basic difference seems to be the header "include/asm-arm/unaligned.h" which includes this file. The Linux version of "unaligned.h" does *not* include "access_ok.h" at all. It includes "le_byteshift.h" and "be_byteshift.h" instead. And I would really like to keep this in sync with Linux if possible.

So why not do it this way (totally untested):

I see the patch has been reposted.
Has it been tested ?

Yes, I have tested it, that is why I reposted it according to the suggestion of Stefan... :-)

Remy

#17 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

Quoted 9 lines · Remy Bohmer

Hi Tom,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Looking at the Linux ARM
version, the basic difference seems to be the header "include/asm-arm/unaligned.h" which includes this file. The Linux version of "unaligned.h" does *not* include "access_ok.h" at all. It includes "le_byteshift.h" and "be_byteshift.h" instead. And I would really like to keep this in sync with Linux if possible. So why not do it this way (totally untested):

Quoted 7 lines
Quoted 2 lines

I see the patch has been reposted.
Has it been tested ?

Yes, I have tested it, that is why I reposted it according to the suggestion of Stefan... :-)

Remy

No MAKEALL arm regressions.
pushed to arm/next.

Thanks,
Tom

#18 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

Hi Tom,

Quoted 2 lines

No MAKEALL arm regressions.
pushed to arm/next.

Did you notice this is a bug fix?
Shouldn't it go in this release?

Remy

#19 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

Quoted 5 lines · On Thursday 29 October 2009 16:34:43 Remy Bohmer wrote:
Quoted 2 lines

No MAKEALL arm regressions.
pushed to arm/next.

Did you notice this is a bug fix?
Shouldn't it go in this release?

Yes, I would recommend to push this into this release as well.

Cheers,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

#20 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

Quoted 8 lines · Stefan Roese
Quoted 4 lines · On Thursday 29 October 2009 16:34:43 Remy Bohmer wrote:
Quoted 2 lines

No MAKEALL arm regressions.
pushed to arm/next.

Did you notice this is a bug fix?
Shouldn't it go in this release?

Yes, I would recommend to push this into this release as well.

This is fine with me.
Tom

Quoted 7 lines

Cheers,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

#21 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

In reply to Remy Bohmer

Dear Remy Bohmer,

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

The current generic code for handling unaligned access assumes that the processor can properly handle unaligned accesses itself. This is at least not the case for ARM, which results in runtime errors.

Rewrite it such that it works for ARM as well.

---
 include/linux/unaligned/access_ok.h |   48 ++++++++++++++++++++++++----------
 1 files changed, 34 insertions(+), 14 deletions(-)

Applied, thanks.

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
Humans do claim a great deal for that particular emotion (love).
	-- Spock, "The Lights of Zetar", stardate 5725.6
#22 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

Hi Wolfgang,

Quoted 10 lines · On Monday 23 November 2009 23:46:38 Wolfgang Denk wrote:

Dear Remy Bohmer,

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

The current generic code for handling unaligned access assumes that the processor can properly handle unaligned accesses itself. This is at least not the case for ARM, which results in runtime errors.

Rewrite it such that it works for ARM as well.

Quoted 7 lines
Quoted 5 lines
---
 include/linux/unaligned/access_ok.h |   48

++++++++++++++++++++++++---------- 1 files changed, 34 insertions(+), 14 deletions(-)

Applied, thanks.

This shouldn't have been applied. Remy did send a different version of this patch (according to my suggestion), which is already included:

commit 25793f76bf9a7be59c9415ef0f78d034e8d53dae

Author: Remy Bohmer <[email protected]>
Date:   Thu Oct 29 12:29:37 2009 +0100

ARM: Use Linux version for unaligned access code

The asm-arm/unaligned.h includes linux/unaligned/access_ok.h This file is unsafe to be used on ARM, since it does an unaligned memory accesses which fails on ARM.

Lookin at Linux the basic difference seems to be the header "include/asm-arm/unaligned.h". The Linux version of "unaligned.h" does *not* include "access_ok.h" at all. It includes "le_byteshift.h" and "be_byteshift.h" instead.

Remy, please correct me if I'm wrong here.

Cheers,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

#23 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

Hi Stefan,

2009/11/24 Stefan Roese <[email protected]>:

Quoted 40 lines

Hi Wolfgang,

Quoted 10 lines · On Monday 23 November 2009 23:46:38 Wolfgang Denk wrote:

Dear Remy Bohmer,

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

The current generic code for handling unaligned access assumes that the processor can properly handle unaligned accesses itself. This is at least not the case for ARM, which results in runtime errors.

Rewrite it such that it works for ARM as well.

Quoted 7 lines
Quoted 5 lines

---
?include/linux/unaligned/access_ok.h | ? 48 ++++++++++++++++++++++++---------- 1 files changed, 34 insertions(+), 14 deletions(-)

Applied, thanks.

This shouldn't have been applied. Remy did send a different version of this patch (according to my suggestion), which is already included:

commit 25793f76bf9a7be59c9415ef0f78d034e8d53dae
Author: Remy Bohmer <[email protected]>
Date: ? Thu Oct 29 12:29:37 2009 +0100

? ?ARM: Use Linux version for unaligned access code

? ?The asm-arm/unaligned.h includes linux/unaligned/access_ok.h ? ?This file is unsafe to be used on ARM, since it does an unaligned memory ? ?accesses which fails on ARM.

? ?Lookin at Linux the basic difference seems to be the header ? ?"include/asm-arm/unaligned.h". The Linux version of "unaligned.h" ? ?does *not* include "access_ok.h" at all. It includes "le_byteshift.h" ? ?and "be_byteshift.h" instead.

Quoted 6 lines

? ?Signed-off-by: Remy Bohmer <[email protected]>
? ?Signed-off-by: Stefan Roese <[email protected]>

Remy, please correct me if I'm wrong here.

You are right.
This patch should not have been applied. The other patch was better.

Kind regards,

Remy

#24 lore raw

PATCH 1/1 Make the generic unaligned access code safe for unaligned access

In reply to Stefan Roese

Dear Stefan Roese,

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

This shouldn't have been applied. Remy did send a different version of this patch (according to my suggestion), which is already included:

Argh... Thanks for pointing out. Fortunately no damage was done as I did not push this from my working repo upstream yet while I was still running some tests. I killed it there.

Thanks 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
People seldom know what they want until you give them what  they  ask
for.
#25 lore raw

PATCH 1/1 Add support for CS2 dataflash for Atmel-SPI.

In reply to Remy Bohmer

Dear Remy Bohmer,

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

The only missing chipselect line support is CS2, and I need it on CS2...

---
 drivers/spi/atmel_dataflash_spi.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

Applied, thanks.

Tom, I hope this is OK with you - seems harmless enough.

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
"Have you lived in this village all your life?"        "No, not yet."
#26 lore raw

PATCH 1/1 Fix mingw tools build

In reply to Remy Bohmer

Dear Remy Bohmer,

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

mkimage does not build due to missing strtok_r() and getline() implementation

---
 tools/mingw_support.c |  157 +++++++++++++++++++++++++++++++++++++++++++++++++
 tools/mingw_support.h |    2 +
 2 files changed, 159 insertions(+), 0 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
Any technology distinguishable from magic is insufficiently advanced.
#27 lore raw

PATCH 1/1 Building of FIT images does not work.

In reply to Remy Bohmer

Dear Remy Bohmer,

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

The type is not set for generation of the FIT images, resulting in no images being created without printing or returning an error

---
 tools/mkimage.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Applied, thanks.

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
The management question ... is not _whether_ to build a pilot  system
and  throw  it away. You _will_ do that. The only question is whether
to plan in advance to build a throwaway, or to promise to deliver the
throwaway to customers.       - Fred Brooks, "The Mythical Man Month"