Re: [U-Boot] [PATCH] i2c: merge all i2c_reg_read() and i2c_reg_write() into inline functions

2008-10-19 Thread Mike Frysinger
On Tuesday 14 October 2008, Timur Tabi wrote:
 Wolfgang Denk wrote:
  What about resubmitting this patch, with adding a debug() to the new,
  common i2c_reg_read() and i2c_reg_write() funtions?

 I can do that.  First, however, I need Mike Frysinger to help me resolve
 the Blackfin version of i2c_reg_read(), which passes 0 instead of 1 as the
 length.

it's broken and i fixed it in the Blackfin i2c read write.  feel free to make 
the change and ignore the weirdness.

 I've emailed him twice about this, so I'm not sure why he's 
 ignoring me.

i havent been processing any @gentoo.org e-mail ... not really ignoring you if 
i havent read your e-mail ;)
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] i2c: merge all i2c_reg_read() and i2c_reg_write() into inline functions

2008-10-19 Thread Mike Frysinger
On Sunday 19 October 2008, Timur Tabi wrote:
 On Sun, Oct 19, 2008 at 4:18 PM, Mike Frysinger [EMAIL PROTECTED] wrote:
  it's broken and i fixed it in the Blackfin i2c read write.  feel free to
  make the change and ignore the weirdness.

 Ah, thank you!  I'll do it after WD pulls your repo.

dont wait ... it'll be a bit before i post it, so it'll be easier if i just 
rebase against that

  i havent been processing any @gentoo.org e-mail ... not really ignoring
  you if i havent read your e-mail ;)

 I don't understand - the commits to your U-Boot repo all have the
 @gentoo.org address, and your entry in the MAINTAINERS file also uses
 that address.  In fact, everywhere I look I see that address.  What
 address should I be using to contact you?

git activity doesnt correspond to e-mail activity ... that is the right e-mail 
to contact, ive just been too busy to check it lately
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot-Users] [PATCH] [resubmit] AX88180: new gigabit network driver

2008-10-19 Thread Mike Frysinger
On Sunday 12 October 2008, Ben Warren wrote:
 Wolfgang Denk wrote:
  Dear Ben,
 
  In message [EMAIL PROTECTED] you wrote:
  I don't see any responses to this latest version of the driver.
 
  Is there any special reason it was neither added nor rejected?
 
  ...
 
  No specific reasons - I should have sent a response.  The only issue I
  have is that there are no in-tree boards that use it.  I wonder if we
  should make up some dummy configs that include devices such as this, so
  that at least MAKEALL will find problems.
 
  This driver has still not been added. What exactly are we waiting
  for?
 
  I think we should at least come up with a decision what shall be done
  about this patch, and informt he submitter.

 Huh, I thought there was a strict policy of no drivers without a
 supporting board, and that this was communicated to Louis.  If this
 isn't that strict a requirement then I have no objections with this patch.

the BF537-STAMP can use it (actually, it'll probably work on most Blackfin 
boards via the addon card).
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] improved strmhz()

2008-10-21 Thread Mike Frysinger
On Tuesday 21 October 2008, Kumar Gala wrote:
 I haven't been following this thread, but can we control the number of
 significant digits.

customizable # of digits is always going to differ according to taste.  just 
lock everyone to like .3 and be done.  no point in wasting overhead on this.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH][RFC] bootm: Added CONFIG_BOOTM_{LINUX, NETBSD, RTEMS}

2008-10-21 Thread Mike Frysinger
On Tuesday 21 October 2008, Wolfgang Denk wrote:
 Dear Kumar Gala,

 In message [EMAIL PROTECTED] you 
wrote:
  Added the ability to config out bootm support for Linux, NetBSD, RTEMS
 
  Signed-off-by: Kumar Gala [EMAIL PROTECTED]
  ---
 
  Looking for suggestions on how to deal with enabling LINUX, NETBSD, and
  RTEMS.

 ...

  --- a/common/cmd_bootm.c
  +++ b/common/cmd_bootm.c
  @@ -103,13 +103,23 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag,
  int argc, char *argv[]); typedef int boot_os_fn (int flag, int argc, char
  *argv[],
  bootm_headers_t *images); /* pointers to os/initrd/fdt 
  */
 
  +#define CONFIG_BOOTM_LINUX 1
  +#define CONFIG_BOOTM_NETBSD 1
  +#define CONFIG_BOOTM_RTEMS 1

 The only somewhat reasonable thing I can come up with  is  to  add  a
 #define  CONFIG_BOOTM_LINUX  to  all  board  config  files,  so all
 support Linux by default, and leave it up to the board maintainers to
 add additioonal OS support if needed.

sounds great to me
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] [trivial] common.h: remove value from bool defines

2011-12-31 Thread Mike Frysinger
Acked-by: Mike Frysinger vap...@gentoo.org
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] [trivial] env: remove value from boolean defines

2011-12-31 Thread Mike Frysinger
Acked-by: Mike Frysinger vap...@gentoo.org
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] AES128 in U-Boot

2012-01-05 Thread Mike Frysinger
On Wednesday 21 December 2011 15:12:20 Simon Glass wrote:
 Can we use public domain code? It seems incompatible with
 the restrictions in the GPL

how so ?  public domain (by its definition) has no copyright or license to 
worry about.  so you literally could (legally) do whatever you want with it.  
thus it's fine for adding to u-boot.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Starting point of uboot learning from scratch..pls helpeom

2012-01-05 Thread Mike Frysinger
http://www.denx.de/wiki/U-Boot
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Uboot build system question

2012-01-05 Thread Mike Frysinger
On Wednesday 21 December 2011 06:21:21 Bharath H S wrote:
 I had a question regarding uboot build system.
 One starts a build for platform1 and without cleaning tree builds for
 platform2, what is the expected result?
 make platform1_config
 make platform2_config
 
 Is the final product build of platform2 or goes to inconsistent state
 or implementation dependent?

`make foo_config  make foo` should always output the same result regardless 
of the initial state.  if it isn't, post a patch to fix it.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/9] openrisc: Add cpu files

2012-01-05 Thread Mike Frysinger
On Thursday 22 December 2011 06:39:32 Stefan Kristiansson wrote:
 On Thu, Dec 22, 2011 at 10:09:30AM +0100, Michal Simek wrote:
  Stefan Kristiansson wrote:
  +
  +void dcache_enable(void)
  +{
  +  mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_DCE);
  +  asm volatile(l.nop);
  +  asm volatile(l.nop);
  +  asm volatile(l.nop);
  +  asm volatile(l.nop);
  +  asm volatile(l.nop);
  +  asm volatile(l.nop);
  +  asm volatile(l.nop);
  +  asm volatile(l.nop);
  
  This is interesting. Are there 8 nops?
  Is there any reason for that? Is it just any waiting?
  If yes, maybe it will be worth to add any comment.
 
 Yes, the number of nops are kind of arbitrary,
 they are there to add some headroom for the cache
 to startup without any load/stores in flight.
 
 But you are right, a comment about this might be in place.

this is usually why the ISA provides some sort of sync or latch mechanism.  
that way code is deterministic instead of being unsettling arbitrary (like it 
is here).
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] tools/env: fix cross-compilation

2012-01-05 Thread Mike Frysinger
On Thursday 22 December 2011 13:39:35 Grant Erickson wrote:
 This patch fixes the make infrastructure for the fw_printenv tool such
 that it is built, by default, as a cross-compilation for the target
 board when so requested with TOOLSUBDIRS on the U-Boot make command
 line.

how is this any simpler than the existing method ?
make tools HOSTCC=some-random-target-gcc

the current tools/ subdir is consistent in its handling.  this patch would 
break that.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] lib/string: added strndup

2012-01-05 Thread Mike Frysinger
On Thursday 22 December 2011 13:16:56 Grant Erickson wrote:
 +#ifndef __HAVE_ARCH_STRNDUP
 +extern char * strndup(const char *,__kernel_size_t);
 +#endif

no space after that first *, and add a space after the ,

since your definition uses size_t, then use that rather than __kernel_size_t

 --- a/lib/string.c
 +++ b/lib/string.c
 
 +#ifndef __HAVE_ARCH_STRNDUP
 +char * strndup(const char *s, size_t n)

no space after that first *

 + if ((s == NULL) ||
 + ((new = malloc (len + 1)) == NULL) ) {
 + return NULL;
 + }

please split this up such as:
if (s == NULL)
return s;

new = malloc(len + 1);
if (new == NULL)
return new;

 + strncpy (new, s, len);

no space before that (
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] stuck after redirecting stdout to nc

2012-01-05 Thread Mike Frysinger
On Monday 02 January 2012 09:50:42 ran shalit wrote:
 On uboot loading, I checking a specific environement (called consoleddev),
 to decide to rediect console to nc or staying in serial.
 I then see some strange behaviour:
 if the environment tell uboot to redirect to net console, everything works
 well, but only if the ethernet cable is connected. if it is not connected
 then I see that the kernel is not loading.

there could easily be a bug where netconsole does not work if the network is 
not available.  patches welcome to add timeouts.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Add support for MMC to fw_printenv/setenv

2012-01-05 Thread Mike Frysinger
On Monday 02 January 2012 18:49:11 Christian Daudt wrote:
 --- a/tools/env/fw_env.c
 +++ b/tools/env/fw_env.c
 
 +static int fd_is_mtd(int fd)
 ...
 + rc = ioctl (fd, MEMGETINFO, mtdinfo);

no space before the (

 + if (rc  0) {
 + // Failed MEMGETINFO, not MTD
 + return 0;
 + } else {
 + // Succeeded, MTD
 + return 1;
 + }

do not use // comments
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] lib/string: added strndup

2012-01-05 Thread Mike Frysinger
On Thursday 05 January 2012 18:25:06 Wolfgang Denk wrote:
 Mike Frysinger wrote:
   + if ((s == NULL) ||
   + ((new = malloc (len + 1)) == NULL) ) {
   + return NULL;
   + }
  
  please split this up such as:
 
 I'm OK with the splitting, but...
 
  if (s == NULL)
  return s;
  
  new = malloc(len + 1);
  if (new == NULL)
  return new;
 
 ... in both cases, a return NULL is much easier to parse for the
 human and identical for the compiler, so that should be used.

sure, np
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] Add support for MMC to fw_printenv/setenv

2012-01-05 Thread Mike Frysinger
On Thursday 05 January 2012 19:30:57 Christian Daudt wrote:
 Subject: [PATCH] Add support for MMC to fw_printenv/setenv
 
 This patch checks if the fd is MTD and if not (using an MTD-specific IOCTL)
 and skips the flash unlock/erase/lock sequence if it is not MTD.
 - fd_is_mtd function added to determine MTD/MMC
 - flash_write_block made to not try MTD operations if mtd_type ==
 MTD_ABSENT - flash_read works with MMC devices now.

seems reasonable, but i don't know anything about this code ;)
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] User Question

2012-01-05 Thread Mike Frysinger
On Tuesday 03 January 2012 16:26:54 Bishop, Mark wrote:
 Is this the list I can ask questions for deploying uboot to a custom
 board based off the blackfin bf548?

this is the list for anything u-boot related

 Some of my questions are not processor specific (like what is the
 approach to getting the micrel ks8995 and a smsc lan9215 talking and
 started -the ks8995 needs a spi start command)?

the bf518f-ezbrd has a ksz8803m on it, but it supports it by open-coding 
things in board/bf518f-ezbrd/bf518f-ezbrd.c.  there's a bit more logic than 
normal due to it handling different revs of the board -- older ones had the 
switch, but newer ones do not, hence it does runtime detection to support one 
binary image for all revs.

i recall seeing people post about ksz switches in general, but i don't think 
that got anywhere, so what we did for the bf518f-ezbrd is probably your best 
bet for now.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 15/16] New command bootmenu: ANSI terminal Boot Menu support

2012-01-05 Thread Mike Frysinger
On Sunday 18 December 2011 15:16:21 Pali Rohár wrote:
 On Sunday 18 December 2011 15:07:25 Mike Frysinger wrote:
  On Sunday 18 December 2011 14:12:38 Pali Rohár wrote:
   On Sunday 18 December 2011 14:07:37 Mike Frysinger wrote:
this needs checkpatch for sure

seems like this doesn't use the existing common/menu.c code ...
shouldn't it ?
   
   No my ANSI terminal bootmenu does not use common/menu.c (4 months ago,
   there was no menu.c file)
  
  so you'll be updating the patchseries to utilize common code that now
  exists ?
 
 What is implemented in that file common/menu.c? It here any info/doc?

doc/README.menu

if there are features you have/want that this code base doesn't support, the 
answer would be to enhance/extend rather than drop in an entirely new/parallel 
codebase.  i know this is more work for you, but long term, the latter would 
be much more work for everyone.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Secure update of uboot devices?

2012-01-06 Thread Mike Frysinger
On Friday 06 January 2012 06:24:50 Andreas Bäck wrote:
 Actually there seams to exsist some very old patches for this
 http://lists.denx.de/pipermail/u-boot/2006-September/016960.html
 
 Here a paper quite exact what I am after:
 http://elinux.org/images/2/28/Trusted_Boot_Loader.pdf
 
 Is there any toughts on integating this in trunk or should I try to merge
 this patch with the git trunk of my own?

i think you need to outline exactly what it is you're trying to do.  secure 
update and secure boot is way too vague.  for starters, you need to outline 
the vectors you're trying to protect against.  the arm trustzone whitepaper is 
a pretty good example of things:
http://infocenter.arm.com/help/topic/com.arm.doc.prd29-genc-009492c/PRD29-
GENC-009492C_trustzone_security_whitepaper.pdf

there are many hardware solutions out there for verifying the integrity of u-
boot itself before executing it, but they tend to be SoC/arch specific.  the 
trusted boot paper you referred to for example really only makes sense on x86 
based platforms.

the patch you referred to however is for verifying the integrity of the kernel 
image that u-boot boots.  it doesn't help with u-boot itself.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/9] openrisc: Add cpu files

2012-01-06 Thread Mike Frysinger
On Friday 06 January 2012 08:22:54 Stefan Kristiansson wrote:
 On Thu, Jan 05, 2012 at 06:15:48PM -0500, Mike Frysinger wrote:
  On Thursday 22 December 2011 06:39:32 Stefan Kristiansson wrote:
   On Thu, Dec 22, 2011 at 10:09:30AM +0100, Michal Simek wrote:
Stefan Kristiansson wrote:
+
+void dcache_enable(void)
+{
+  mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_DCE);
+  asm volatile(l.nop);
+  asm volatile(l.nop);
+  asm volatile(l.nop);
+  asm volatile(l.nop);
+  asm volatile(l.nop);
+  asm volatile(l.nop);
+  asm volatile(l.nop);
+  asm volatile(l.nop);

This is interesting. Are there 8 nops?
Is there any reason for that? Is it just any waiting?
If yes, maybe it will be worth to add any comment.
   
   Yes, the number of nops are kind of arbitrary,
   they are there to add some headroom for the cache
   to startup without any load/stores in flight.
   
   But you are right, a comment about this might be in place.
  
  this is usually why the ISA provides some sort of sync or latch
  mechanism. that way code is deterministic instead of being unsettling
  arbitrary (like it is here).
 
 The OpenRISC ISA does provide synch mechanisms, but they are unfortunately
 optional and not supported by the (currently) only open implementation
 (or1200).

sounds like a CONFIG knob for people :).  i imagine the # of nop's require 
depends heavily on how the core is laid out in hardware, the speed, etc...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 05/15] common/main.c: Fix function readline

2012-01-06 Thread Mike Frysinger
On Sunday 18 December 2011 16:34:01 Pali Rohár wrote:
  * Ignore ANSI escape codes for moving cursor, which are generated by
 keyboard

this probably should be behind an appropriate CONFIG knob.  i don't think this 
is relevant to serial users (which are the majority of boards).
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V3 2/2] ext4fs write support

2012-01-07 Thread Mike Frysinger
On Tuesday 27 December 2011 21:23:27 uma.shan...@samsung.com wrote:
 From: Uma Shankar uma.shan...@samsung.com
 
 Signed-off-by: Uma Shankar uma.shan...@samsung.com
 Signed-off-by: Manjunatha C Achar a.manjuna...@samsung.com
 Signed-off-by: Iqbal Shareef iqbal@samsung.com
 Signed-off-by: Hakgoo Lee goodguy@samsung.com

you need to note the sources of these files in the changelog

 --- a/common/cmd_ext4.c
 +++ b/common/cmd_ext4.c
  
 +int do_ext4_write(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])

static

 + char *filename = /;

const

 + int dev = 0;

considering you set dev first below, no point in setting this to 0

 + /*get the filename */

many of the comments here are missing a space after the /*

 --- /dev/null
 +++ b/fs/ext4/README

docs belong in docs/

 --- /dev/null
 +++ b/fs/ext4/crc16.c

 +/*
 + *  crc16.c
 + *
 + * This source code is licensed under the GNU General Public License,
 + * Version 2. See the file COPYING for more details.
 + */

why can't you use the existing lib/crc16.c code ?

 --- a/fs/ext4/ext4_common.c
 +++ b/fs/ext4/ext4_common.c
 
 +#if defined(CONFIG_CMD_EXT4_WRITE)
 +#include ext4_journal.h
 +#include crc16.h
 +#else
  #include ext4_common.h
 +#endif

conditional header includes are a bad idea

 +/* To convert big endian journal superblock entries to little endian */
 +unsigned int be_le(unsigned int num)
 ...
 +/* 4-byte number */
 +unsigned int le_be(unsigned int num)

we already have swap functions in include/ you should be able to use instead 
of duplicating them

 +void reset_inode_bmap(int inode_no, unsigned char *buffer, int index)
 ...
 +
 + return;
 +}

useless return - delete it

 --- a/fs/ext4/ext4_common.h
 +++ b/fs/ext4/ext4_common.h
 
 +int get_parent_inode_num(char *dirname, char *dname, int flags);
 +void update_parent_dentry(char *filename, int *p_ino, int file_type);
 +long int get_new_blk_no(void);
 +int get_new_inode_no(void);
 +void reset_block_bmap(long int blockno, unsigned char *buffer, int index);
 +int set_block_bmap(long int blockno, unsigned char *buffer, int index);
 +int set_inode_bmap(int inode_no, unsigned char *buffer, int index);
 +void reset_inode_bmap(int inode_no, unsigned char *buffer, int index);
 +int iget(int inode_no, struct ext2_inode *inode);
 +void allocate_blocks(struct ext2_inode *file_inode,
 +  unsigned int total_remaining_blocks,
 +  unsigned int *total_no_of_block);
 +void put_ext4(uint64_t off, void *buf, uint32_t size);

 --- /dev/null
 +++ b/fs/ext4/ext4_journal.h
 
 +int init_journal(void);
 +void deinit_journal(void);
 +int log_gdt(char *gd_table);
 +void update_journal(void);
 +int check_journal_state(int recovery_flag);
 +int log_journal(char *journal_buffer, long int blknr);
 +int put_metadata(char *metadata_buffer, long int blknr);
 +void dump_metadata(void);
 +void free_journal(void);
 +void free_revoke_blks(void);
 +void push_revoke_blk(char *buffer);

these are a lot of bad names.  these need to be properly namespaced if you're 
going to export them.

 --- /dev/null
 +++ b/fs/ext4/ext4_journal.c

 + journal_ptr[i] = (struct journal_log *)zalloc
 + (sizeof(struct journal_log));
 ...
 + dirty_block_ptr[i] = (struct dirty_blocks *)
 + zalloc(sizeof(struct dirty_blocks));
 ...
 + journal_ptr[gindex]-buf = (char *)zalloc(fs-blksz);
 ...
 + journal_ptr[gindex]-buf = (char *)zalloc(fs-blksz);

useless casts.  zalloc() returns void *.  there's a bunch more throughout this 
patch.

 +void free_journal(void)
 +{
 ...
 +
 + return;
 +}

useless return

 +void print_revoke_blks(char *revk_blk)
 +{
 ...
 +
 + return;
 +}

useless return

 +static struct revoke_blk_list *_get_node(void)
 +{
 ...
 +
 + return;
 +}

useless return

 +void free_revoke_blks()

needs (void)

 + return;
 +}

useless return

 +void print_jrnl_status(int recovery_flag)
 +{
 ...
 +
 + return;
 +}

useless return

 --- a/fs/ext4/ext4fs.c
 +++ b/fs/ext4/ext4fs.c
 
 +static void delete_single_indirect_block(struct ext2_inode *inode)
 +{
 ...
 +
 + return;
 +
 +}

useless return

 +static void delete_double_indirect_block(struct ext2_inode *inode)
 +{
 ...
 +
 + return;
 +}

useless return

 +static void delete_triple_indirect_block(struct ext2_inode *inode)
 +{
 ...
 +
 + return;
 +}

useless return

 +void ext4fs_deinit(void)
 +{
 ...
 +
 + return;
 +}

useless return
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V3 1/2] ext4fs ls load support

2012-01-07 Thread Mike Frysinger
NAK: you missed a bunch of my previous feedback
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Add a CBFS driver and commands to u-boot

2012-01-07 Thread Mike Frysinger
On Saturday 03 December 2011 06:47:01 Gabe Black wrote:
 --- /dev/null
 +++ b/common/cmd_cbfs.c

 +int do_cbfs_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])

static

 + if (argc  2) {
 + printf(usage: cbfsls [end of rom]\n);
 + return 0;
 + }

return cmd_usage(cmdtp)

 +int do_cbfs_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char *const

static

no space before that (

 + if (argc  3) {
 + printf(usage: cbfsload addr filename [bytes]\n);
 + return 1;
 + }

return cmd_usage(cmdtp)

 +int do_cbfs_ls (cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])

static

no space before that (

 + char *typeName = NULL;

const, and don't use camelCase in var names

 +int do_cbfs_fsinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *const

static

no space before that (

 + const CbfsHeader *header = file_cbfs_get_header();

camelCase ...

 + printf(\n);
 + printf(CBFS version: %#x\n, header-version);
 + printf(ROM size: %#x\n, header-romSize);
 + printf(Boot block size: %#x\n, header-bootBlockSize);
 + printf(CBFS size: %#x\n,
 + header-romSize - header-bootBlockSize - header-offset);
 + printf(Alignment: %d\n, header-align);
 + printf(Offset: %#x\n, header-offset);
 + printf(\n);

should be easy to merge into a single printf() call

 --- a/fs/Makefile
 +++ b/fs/Makefile
 
  subdirs-$(CONFIG_CMD_CRAMFS) := cramfs
 +subdirs-$(CONFIG_CMD_CBFS) += cbfs
  subdirs-$(CONFIG_CMD_EXT2) += ext2
  subdirs-$(CONFIG_CMD_FAT) += fat
  subdirs-$(CONFIG_CMD_FDOS) += fdos

unrelated, but that := is most likely wrong as it doesn't do what it is 
actually intended

 --- /dev/null
 +++ b/fs/cbfs/cbfs.c

 +const char *file_cbfs_error(void)
 +{
 + switch (file_cbfs_result) {
 + case CBFS_SUCCESS:
 + return Success;
 + case CBFS_NOT_INITIALIZED:
 + return CBFS not initialized;
 + case CBFS_BAD_HEADER:
 + return Bad CBFS header;
 + case CBFS_BAD_FILE:
 + return Bad CBFS file;
 + case CBFS_FILE_NOT_FOUND:
 + return File not found;
 + default:
 + return Unknown;
 + }
 +}

CbfsResult starts CBFS_SUCCESS at 0, so this should be easy to rewrite as an 
array of strings which this func simply indexes

 +typedef struct CbfsFileHeader {
 ...
 +} __attribute__((packed)) CbfsFileHeader;

__packed

 +typedef struct CbfsCacheNode {
 ...
 +} __attribute__((packed)) CbfsCacheNode;

__packed

 +static void file_cbfs_fill_cache(u8 *start, u32 size, u32 align)
 +{
 ...
 + newNode = (CbfsCacheNode *)malloc(sizeof(CbfsCacheNode));

useless cast

 --- /dev/null
 +++ b/include/cbfs.h

 +typedef struct CbfsHeader {
 ...
 +} __attribute__((packed)) CbfsHeader;

__packed
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] usb/gadget: add the fastboot gadget

2012-01-07 Thread Mike Frysinger
On Monday 21 November 2011 09:09:35 Sebastian Andrzej Siewior wrote:
 --- a/common/Makefile
 +++ b/common/Makefile

  COBJS-y += usb.o
  COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
  endif
 +COBJS-$(CONFIG_CMD_FASTBOOT) += cmd_fastboot.o
 +
  COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o

no newline here

 --- /dev/null
 +++ b/common/cmd_fastboot.c
 @@ -0,0 +1,28 @@
 +#include common.h
 +#include command.h
 +#include usb/fastboot.h

missing comment block with license/copyright/etc...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Remove execute permissions from source files

2012-01-07 Thread Mike Frysinger
On Saturday 07 January 2012 00:56:32 Thomas Weber wrote:
  0 files changed, 0 insertions(+), 0 deletions(-)
  mode change 100755 = 100644 arch/arm/cpu/armv7/imx-common/timer.c
  mode change 100755 = 100644 drivers/fpga/ivm_core.c
  mode change 100755 = 100644 include/lattice.h

obvious: Acked-by: Mike Frysinger vap...@gentoo.org
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] x86: Set up the PCI busses when initializing the coreboot board

2012-01-07 Thread Mike Frysinger
On Monday 05 December 2011 17:12:30 Gabe Black wrote:
 --- a/board/chromebook-x86/coreboot/coreboot_pci.c
 +++ b/board/chromebook-x86/coreboot/coreboot_pci.c

 +static struct pci_config_table pci_coreboot_config_table[] = {

const ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts

2012-01-07 Thread Mike Frysinger
On Wednesday 09 November 2011 04:52:21 Andrzej Pietrasiewicz wrote:
 --- /dev/null
 +++ b/drivers/usb/dfu/Makefile

 +ifdef CONFIG_MMC
 +COBJS-y += mmc.o
 +endif
 +
 +ifdef CONFIG_CMD_FAT
 +COBJS-y += fat.o
 +endif

COBJS-$(CONFIG_XXX) += foo.o

 --- /dev/null
 +++ b/drivers/usb/dfu/fat.c
 @@ -0,0 +1,77 @@
 +#include common.h
 +#include fat.h
 +#include dfu_backend.h

missing intro comment block

 +inline int set_fat_part_num(int pnum)

there seems to be a lot of funcs in this file and others that have misplaced 
inline markings

 --- /dev/null
 +++ b/include/dfu_backend.h

 +extern void board_dfu_init(void);
 +extern int board_dfu_cleanup(void);
 +extern int usb_gadget_handle_interrupts(void);
 +
 +extern int read_mmc(void *buf, unsigned int len, unsigned long from);
 +extern int write_mmc(void *buf, unsigned int len, unsigned long from);
 +
 +extern block_dev_desc_t *set_fat_dev(block_dev_desc_t *d);
 +extern int set_fat_part_num(int pnum);
 +extern const char *set_fat_filename(const char *fn);
 +extern int read_fat(void *buf, unsigned int len, unsigned long from);
 +extern int write_fat(void *buf, unsigned int len, unsigned long from);
 +
 +extern int read_mbr(struct mmc *mmc, struct mbr_part_data *pd, int
 *extended_lba, int mmc_mbr_dev); +
 +extern int read_block(void *ctx, unsigned int n, void *buf);
 +extern int write_block(void *ctx, unsigned int n, void *buf);
 +extern int generic_prepare(void *ctx, u8 mode);
 +extern int generic_finish(void *ctx, u8 mode);

API needs to be namespaced here with like dfu_ prefixes

 --- /dev/null
 +++ b/include/mbr.h

file needs protection against multiple inclusion

 +void set_mbr_dev(int dev);
 +void set_mbr_info(char *ramaddr, unsigned int len, unsigned int reserved);
 +void set_mbr_table(unsigned int start_addr, int parts,
 + unsigned int *blocks, unsigned int *part_offset);
 +int get_mbr_table(unsigned int *part_offset);

seems like you declare funcs here that aren't actually defined ...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] Add 'patman' patch generation, checking and submission script

2012-01-07 Thread Mike Frysinger
On Tuesday 29 November 2011 21:35:46 Simon Glass wrote:
  tools/scripts/patman/.gitignore |1 +

seems like tools/patman/ would be better.  i wonder if anyone else here uses 
it and so would be useful for actually committing ...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/4] x86: Force the lib_sysinfo structure to be in the .data section

2012-01-07 Thread Mike Frysinger
On Wednesday 30 November 2011 01:07:54 Gabe Black wrote:
 +struct sysinfo_t lib_sysinfo __attribute__((section(.data)));

seems like it should be .data.lib_sysinfo

or maybe pick a field you always init and set it to something non-zero.
struct sysinfo_t lib_sysinfo = {
/* force into .data */
.cpu_khz = 1,
};
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/14] Add AES crypto library

2012-01-07 Thread Mike Frysinger
On Monday 26 December 2011 14:32:54 Simon Glass wrote:
 --- /dev/null
 +++ b/lib/aes.c

 +static u8 sbox[256] = {
 +static u8 inv_sbox[256] = {
 +static u8 x2_sbox[256] = {
 +static u8 x3_sbox[256] = {
 +static u8 x_time_9[256] = {
 +static u8 x_time_b[256] = {
 +static u8 x_time_d[256] = {
 +static u8 x_time_e[256] = {

const

 +static void mix_sub_columns(u8 *state)
 +{
 ...
 +  x3_sbox[state[2]] ^   sbox[state[7]];

looks bad whitespace after that ^

 +static u8 rcon[11] = {

const
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 03/14] tegra: Add crypto library for warmboot code

2012-01-07 Thread Mike Frysinger
On Monday 26 December 2011 14:32:56 Simon Glass wrote:
 --- /dev/null
 +++ b/arch/arm/cpu/armv7/tegra2/crypto.c

 +#ifdef DEBUG
 +static void debug_print_vector(char *name, u32 num_bytes, u8 *data)
 +{
 + u32 i;
 +
 + printf(%s [%d] @0x%08x, name, num_bytes, (u32)data);
 + for (i = 0; i  num_bytes; i++) {
 + if (i % 16 == 0)
 + printf( = );
 + printf(%02x, data[i]);
 + if ((i+1) % 16 != 0)
 + printf( );
 + }
 + printf(\n);
 +}
 +#else
 +#define debug_print_vector(name, num_bytes, data)
 +#endif

if you used debug() instead of printf(), wouldn't this get optimized without 
the #ifdef protection ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/7] tegra: Add I2C driver

2012-01-07 Thread Mike Frysinger
On Monday 26 December 2011 13:11:48 Simon Glass wrote:
 --- /dev/null
 +++ b/drivers/i2c/tegra2_i2c.c

 +static int wait_for_tx_fifo_empty(struct i2c_control *control)
 ...
 + while (timeout_us = 0) {
 ...
 + };

no semicolon here

 +static int wait_for_rx_fifo_notempty(struct i2c_control *control)
 ...
 + while (timeout_us = 0) {
 ...
 + };

no semicolon here

 +static int wait_for_transfer_complete(struct i2c_control *control)
 ...
 + while (timeout_us = 0) {
 ...
 + };

no semicolon here
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCHv2 1/8] Strip mkenvimage

2012-01-07 Thread Mike Frysinger
Acked-by: Mike Frysinger vap...@gentoo.org
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCHv3 3/8] mkenvimage: Correct the includes and add a missing one

2012-01-07 Thread Mike Frysinger
On Thursday 05 January 2012 13:44:54 David Wagner wrote:
 --- a/tools/mkenvimage.c
 +++ b/tools/mkenvimage.c

 +#include stdlib.h

 -#include compiler.h
 +#include compiler.h

these are fine

 -#include u-boot/crc.h
 +#include u-boot/crc.h

i don't think this is necessary
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCHv2 4/8] mkenvimage: More error handling

2012-01-07 Thread Mike Frysinger
On Thursday 05 January 2012 13:44:55 David Wagner wrote:
 --- a/tools/mkenvimage.c
 +++ b/tools/mkenvimage.c

   datasize = strtol(optarg, NULL, 0);
 - break;
 + if (!errno)
 + break;
 +
 + if (errno == ERANGE)
 + fprintf(stderr, Bad integer format: %s\n,
 + optarg);
 + else
 + fprintf(stderr, Error while parsing %s: %s\n,
 + optarg, strerror(errno));
 +
 + return EXIT_FAILURE;

seems like this should be a local xstrol() helper
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCHv3 5/8] mkenvimage: Read/Write from/to stdin/out by default or if the filename is -

2012-01-07 Thread Mike Frysinger
On Thursday 05 January 2012 13:44:56 David Wagner wrote:
 + bin_fd = creat(bin_filename, S_IRUSR | S_IWUSR | S_IRGRP |
 +  S_IWGRP);

this should prob be open()
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCHv2 6/8] mkenvimage: Use mmap() when reading from a regular file

2012-01-07 Thread Mike Frysinger
On Thursday 05 January 2012 13:44:57 David Wagner wrote:
 --- a/tools/mkenvimage.c
 +++ b/tools/mkenvimage.c
 
   filesize = txt_file_stat.st_size;
 - /* Read the raw input file and transform it */
 - filebuf = malloc(sizeof(*envptr) * filesize);
 - ret = read(txt_fd, filebuf, sizeof(*envptr) * filesize);
 - if (ret != sizeof(*envptr) * filesize) {
 - fprintf(stderr, Can't read the whole input file\n);
 +
 + filebuf = mmap(NULL, sizeof(*envptr) * filesize, PROT_READ,
 +MAP_PRIVATE, txt_fd, 0);
 + ret = close(txt_fd);
 + if (filebuf == MAP_FAILED) {
 + fprintf(stderr, mmap (%ld bytes) failed: %s\n,
 + sizeof(*envptr) * filesize,
 + strerror(errno));
   return EXIT_FAILURE;
   }
 - ret = close(txt_fd);

seems like the mmap() failure shouldn't be fatal.  just have it fallback to 
the normal read()/write() logic.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] tools/env: fix cross-compilation

2012-01-07 Thread Mike Frysinger
On Thursday 05 January 2012 18:25:52 Grant Erickson wrote:
 On Jan 5, 2012, at 3:18 PM, Mike Frysinger wrote:
  On Thursday 22 December 2011 13:39:35 Grant Erickson wrote:
  This patch fixes the make infrastructure for the fw_printenv tool such
  that it is built, by default, as a cross-compilation for the target
  board when so requested with TOOLSUBDIRS on the U-Boot make command
  line.
  
  how is this any simpler than the existing method ?
  
  make tools HOSTCC=some-random-target-gcc
  
  the current tools/ subdir is consistent in its handling.  this patch
  would break that.
 
 Because it's broken with respect to how the rest of U-Boot is built. I
 already specify the cross-compiler via CROSS_COMPILE when I build
 u-boot.bin and u-boot.img, that I need to specify the same compiler in two
 different ways to build executables for the same target platform is broken
 and, it sounds like, as are the rest of the tools subdirectories.

no, you specified the toolchain that is appropriate for building bare metal 
code.  it is often times not the same as the toolchain used to build userspace 
applications for running under Linux.  this is not broken behavior.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] api: storage: Share attributes with block_dev_desc

2012-01-07 Thread Mike Frysinger
On Friday 21 October 2011 02:31:48 Che-Liang Chiou wrote:
 struct device_info in api_public.h defined its own subset of attributes
 of block_dev_desc, which limits the capability of external apps.
 
 This patch let struct device_info and block_dev_desc share the same set
 of attributes so that an external app has equal amount of information of
 block device compared to U-Boot.
 
 The export.h and _export.h have somewhat addressed the same issue. That
 is, sharing declarations between U-Boot and external apps.

NAK: any changes to api_public.h that is not backwards ABI compatible must 
increment API_SIG_VERSION.  you're changing the exported struct which is an 
ABI breakage.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 02/15] bootstage: Make use of BOOTSTAGE_ID_RUN_OS in show_boot_progress()

2012-01-08 Thread Mike Frysinger
Acked-by: Mike Frysinger vap...@gentoo.org
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 01/15] bootstage: Create an initial header for boot progress integers

2012-01-08 Thread Mike Frysinger
On Saturday 10 December 2011 16:07:53 Simon Glass wrote:
 --- /dev/null
 +++ b/include/bootstage.h

 +/*
 + * This file implements recording of each stage of the boot process. It is
 + * intended to implement timing of each stage, reporting this information
 + * to the user and passing it to the OS for logging / further analysis.
 + */

maybe it's me, but i'd expect this at the top of the file before the 
copyright/license notice


 + * progres action1

typo ?  shows up a few times ...

 +enum bootstage_id {
 + BOOTSTAGE_ID_RUN_OS = 15,   /* Exiting U-Boot, entering OS */
 +};

what relevance does this # have ?  since it gets passed to Linux, it becomes 
part of the ABI and cannot be changed, so that should be mentioned in the 
comment.

 +/*
 + * Board-specific platform code can implement show_boot_progress () if

board-specific platform is kind of redundant

also, no space before ()

 --- a/include/common.h
 +++ b/include/common.h
 @@ -801,10 +801,8 @@ int  pcmcia_init (void);
  #ifdef CONFIG_STATUS_LED
  # include status_led.h
  #endif
 -/*
 - * Board-specific Platform code can reimplement show_boot_progress () if
 needed - */
 -void show_boot_progress(int val);
 +
 +#include bootstage.h
 
  /* Multicore arch functions */
  #ifdef CONFIG_MP


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 03/15] bootstage: Use show_boot_error() for -ve progress numbers

2012-01-08 Thread Mike Frysinger
Acked-by: Mike Frysinger vap...@gentoo.org
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 04/15] bootstage: Convert progress numbers 1-9 into enums

2012-01-08 Thread Mike Frysinger
On Saturday 10 December 2011 16:07:56 Simon Glass wrote:
 --- a/include/bootstage.h
 +++ b/include/bootstage.h

  enum bootstage_id {
 + BOOTSTAGE_ID_START,
 + BOOTSTAGE_ID_CHECK_MAGIC,   /* Checking image magic */
 + BOOTSTAGE_ID_CHECK_HEADER,  /* Checking image header */
 + BOOTSTAGE_ID_CHECK_CHECKSUM,/* Checking image checksum */
 + BOOTSTAGE_ID_CHECK_ARCH,/* Checking architecture */

i know it's unlikely to ever change, but this would be good to be explicit:
BOOTSTAGE_ID_START = 0,
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 05/15] bootstage: Convert progress numbers 10-19 to enums

2012-01-08 Thread Mike Frysinger
not sure why this isn't just squashed into 04/15, but whatever

Acked-by: Mike Frysinger vap...@gentoo.org
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 11/15] bootstage: Define an optional microsecond timer

2012-01-08 Thread Mike Frysinger
On Saturday 10 December 2011 16:08:03 Simon Glass wrote:
 --- a/lib/time.c
 +++ b/lib/time.c

 +ulong __timer_get_boot_us(void)
 +{
 + static ulong base_time;
 +
 + /*
 +  * We can't implement this properly. Return 0 on the first call and
 +  * larger values after that.
 +  */
 + if (base_time)
 + return get_timer(base_time) * 1000;
 + base_time = get_timer(0);
 + return 0;
 +}
 +
 +ulong timer_get_boot_us(void)
 + __attribute__((weak, alias(__timer_get_boot_us)));

isn't this duplicating existing post_time_ms() ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 13/15] bootstage: Add microsecond boot time measurement

2012-01-08 Thread Mike Frysinger
On Saturday 10 December 2011 16:08:05 Simon Glass wrote:
 This defines the basics of a new boot time measurement feature. This allows
 logging of very accurate time measurements as the boot proceeds, by using
 an available microsecond counter.
 
 To enable the feature, define CONFIG_BOOTSTAGE in your board config file.
 Also available is CONFIG_BOOTSTAGE_REPORT which will cause a report to be
 printed just before handing off to the OS.

the summary says Add microsecond boot time measurement.  that sounds like 
extending existing functionality.  in reality, this is the core of the new 
CONFIG_BOOTSTAGE logic right ?

also, this logging framework seems to overlap the existing POST logging 
framework functionality ...

 --- a/include/bootstage.h
 +++ b/include/bootstage.h

 +static inline ulong bootstage_mark(enum bootstage_id id)
  {
 - show_boot_progress(-val);
 +#ifdef CONFIG_SHOW_BOOT_PROGRESS
 + show_boot_progress(id);
 +#endif
 + return 0;
  }
 
 +static inline ulong bootstage_error(enum bootstage_id id)
 +{
 +#ifdef CONFIG_SHOW_BOOT_PROGRESS
 + show_boot_progress(-id);
 +#endif
 + return 0;
 +}

why isn't show_boot_progress() just a stub when CONFIG_SHOW_BOOT_PROGRESS 
isn't defined ?  then you don't have to protect the call sites.

 +static inline ulong bootstage_mark_name(enum bootstage_id id, const char
 *name)
 +{ return 0; }

please unroll this
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 15/15] bootstage: arm: Add bootstage calls in board and bootm

2012-01-08 Thread Mike Frysinger
On Saturday 10 December 2011 16:08:07 Simon Glass wrote:
 --- a/arch/arm/lib/bootm.c
 +++ b/arch/arm/lib/bootm.c

  static void announce_and_cleanup(void)
  {
   printf(\nStarting kernel ...\n\n);
 + bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, start_kernel);
 +#ifdef CONFIG_BOOTSTAGE_REPORT
 + bootstage_report();
 +#endif

shouldn't the header make bootstage_report() into a stub when 
CONFIG_BOOTSTAGE_REPORT isn't defined ?  then you won't need the ifdef 
protection here.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] tegra: mmc: Support operation with dcache enabled

2012-01-08 Thread Mike Frysinger
On Wednesday 21 December 2011 16:10:16 Stephen Warren wrote:
 Simon Glass wrote at Wednesday, December 21, 2011 1:03 PM:
  When the data cache is enabled we must flush on write and invalidate
  on read. We also check that buffers are aligned to data cache lines
  boundaries. With recent work in U-Boot this should generally be the case
  but the warnings will catch problems.
 
 Conceptually this seems fine, but shouldn't the MMC driver core be doing
 the cache management, so all platforms without cache coherency can
 benefit from it?

if the driver bitbangs things out (like SPI/MMC), then the core doing it would 
be a waste wouldn't it ?

a better question might be how does Linux handle it ?  does it force the 
drivers to do it, or does the core take care of things ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 03/16] Add gpio_request() to asm-generic header

2012-01-08 Thread Mike Frysinger
On Tuesday 06 December 2011 20:24:02 Simon Glass wrote:
 +int gpio_request(unsigned gpio, const char *label);

should add gpio_free too
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] sandbox: Add tap based networking

2012-01-08 Thread Mike Frysinger
were you going to post an updated version ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/9] sandbox: sort header files in os.c

2012-01-08 Thread Mike Frysinger
On Thursday 05 January 2012 22:54:53 Simon Glass wrote:
 --- a/arch/sandbox/cpu/os.c
 +++ b/arch/sandbox/cpu/os.c
 
 +#include errno.h
  #include fcntl.h
 +#include linux/types.h
  #include stdlib.h
  #include termios.h
 -#include unistd.h
  #include time.h
 -#include errno.h
 -#include sys/types.h
 -#include sys/stat.h
 +#include unistd.h
  #include sys/mman.h
 -#include linux/types.h
 +#include sys/stat.h
 +#include sys/types.h


the order should generally be:
- stuff in include/
- stuff in sys/
- stuff in linux/
- stuff in asm/
each sub-region can be sorted, but i don't think we should go against the 
subdir rule
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/9] sandbox: Add required header to os.c

2012-01-08 Thread Mike Frysinger
On Thursday 05 January 2012 22:54:54 Simon Glass wrote:
 --- a/arch/sandbox/cpu/os.c
 +++ b/arch/sandbox/cpu/os.c

  #include unistd.h
  #include sys/mman.h
  #include sys/stat.h
 +#include sys/time.h
  #include sys/types.h
 
  #include os.h

guess this will need a rebase once 5/9 is rewritten
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/14] Add AES crypto library

2012-01-08 Thread Mike Frysinger
On Sunday 08 January 2012 03:57:47 Marek Vasut wrote:
  On Monday 26 December 2011 14:32:54 Simon Glass wrote:
   --- /dev/null
   +++ b/lib/aes.c
   
   +static u8 sbox[256] = {
   +static u8 inv_sbox[256] = {
   +static u8 x2_sbox[256] = {
   +static u8 x3_sbox[256] = {
   +static u8 x_time_9[256] = {
   +static u8 x_time_b[256] = {
   +static u8 x_time_d[256] = {
   +static u8 x_time_e[256] = {
  
  const
  
   +static void mix_sub_columns(u8 *state)
   +{
   ...
   +  x3_sbox[state[2]] ^   sbox[state[7]];
  
  looks bad whitespace after that ^
  
   +static u8 rcon[11] = {
  
  const
 
 We already have checkpatch in tools ... run it on the series.

i don't think checkpatch catches const
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] lzma: fix printf warnings

2012-01-08 Thread Mike Frysinger
Fix size_t printf format warnings:

LzmaTools.c: In function 'lzmaBuffToBuffDecompress':
LzmaTools.c:110:5: warning: format '%x' expects type 'unsigned int',
but argument 2 has type 'SizeT'
LzmaTools.c:111:5: warning: format '%x' expects type 'unsigned int',
but argument 2 has type 'SizeT'

Signed-off-by: Mike Frysinger vap...@gentoo.org
---
 lib/lzma/LzmaTools.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/lzma/LzmaTools.c b/lib/lzma/LzmaTools.c
index 2eafad2..28a8aef 100644
--- a/lib/lzma/LzmaTools.c
+++ b/lib/lzma/LzmaTools.c
@@ -107,8 +107,8 @@ int lzmaBuffToBuffDecompress (unsigned char *outStream, 
SizeT *uncompressedSize,
 }
 }
 
-debug (LZMA: Uncompresed size 0x%x\n, outSizeFull);
-debug (LZMA: Compresed size.. 0x%x\n, compressedSize);
+debug(LZMA: Uncompresed size 0x%zx\n, outSizeFull);
+debug(LZMA: Compresed size.. 0x%zx\n, compressedSize);
 
 g_Alloc.Alloc = SzAlloc;
 g_Alloc.Free = SzFree;
-- 
1.7.8.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Blackfin: add in/out le32 variants

2012-01-08 Thread Mike Frysinger
These are rarely used, but the post code does currently, so add small
redirect hacks for that.

Signed-off-by: Mike Frysinger vap...@gentoo.org
---
 arch/blackfin/include/asm/io.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/blackfin/include/asm/io.h b/arch/blackfin/include/asm/io.h
index 75244a0..69f08bc 100644
--- a/arch/blackfin/include/asm/io.h
+++ b/arch/blackfin/include/asm/io.h
@@ -134,9 +134,11 @@ static inline unsigned int readl(const volatile void 
__iomem *addr)
 #define inb(port)readb(__io(port))
 #define inw(port)readw(__io(port))
 #define inl(port)readl(__io(port))
+#define in_le32(port) inl(port)
 #define outb(x, port) writeb(x, __io(port))
 #define outw(x, port) writew(x, __io(port))
 #define outl(x, port) writel(x, __io(port))
+#define out_le32(x, port) outl(x, port)
 
 #define inb_p(port)inb(__io(port))
 #define inw_p(port)inw(__io(port))
-- 
1.7.8.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] post: add blackfin to the post_time_ms list

2012-01-08 Thread Mike Frysinger
Signed-off-by: Mike Frysinger vap...@gentoo.org
---
 post/post.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/post/post.c b/post/post.c
index d62f10a..8705b12 100644
--- a/post/post.c
+++ b/post/post.c
@@ -495,7 +495,8 @@ void post_reloc(void)
  */
 unsigned long post_time_ms(unsigned long base)
 {
-#if defined(CONFIG_PPC) || defined(CONFIG_ARM)  !defined(CONFIG_KIRKWOOD)
+#if defined(CONFIG_PPC) || defined(CONFIG_BLACKFIN) || \
+(defined(CONFIG_ARM)  !defined(CONFIG_KIRKWOOD))
return (unsigned long)lldiv(get_ticks(), get_tbclk() / CONFIG_SYS_HZ)
- base;
 #else
-- 
1.7.8.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Blackfin: br4: new board port

2012-01-08 Thread Mike Frysinger
On Monday 28 November 2011 10:33:39 Wolfgang Denk wrote:
 Dimitar Penev wrote:
 +#define CONFIG_TFTP_BLOCKSIZE 4404
 ...
   I have to admit that I'm not sure i having the last ine is a clever
   idea, but in any case it's not my problem.
  
  I have not dug in the code to understand the impact in details but what I
  have observed is that the
  tftp transfer in our local network is getting speeded up few times with
  the last line added.
  It is for the files in the 10 MB size range in case it matters.
  
  Probably you can just mention the expected negative side of this line?
 
 Not all networks may support such a big MTU ?

almost no one does, but we have CONFIG_IP set, so it should work
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] Blackfin: br4: new board port

2012-01-08 Thread Mike Frysinger
From: Dimitar Penev d...@switchfin.org

This adds support for the BR4 Appliance.  It is a quad channel ISDN BRI
board based on Blackfin BF537 CPU.

Signed-off-by: Dimitar Penev d...@switchfin.org
Signed-off-by: Mike Frysinger vap...@gentoo.org
---
v2
- rebased and applied feedback from Wolfgang

 MAINTAINERS   |1 +
 board/br4/Makefile|   50 
 board/br4/br4.c   |   30 +
 board/br4/config.mk   |   30 +
 boards.cfg|1 +
 include/configs/br4.h |  157 +
 6 files changed, 269 insertions(+), 0 deletions(-)
 create mode 100644 board/br4/Makefile
 create mode 100644 board/br4/br4.c
 create mode 100644 board/br4/config.mk
 create mode 100644 include/configs/br4.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 3f83189..93249c2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1156,6 +1156,7 @@ Chong Huang chu...@ucrobotics.com
 
 Dimitar Penev d...@switchfin.org
 
+   BR4 Appliance   BF537
PR1 Appliance   BF537
 
 #
diff --git a/board/br4/Makefile b/board/br4/Makefile
new file mode 100644
index 000..6ae998f
--- /dev/null
+++ b/board/br4/Makefile
@@ -0,0 +1,50 @@
+#
+# U-boot - Makefile
+#
+# Copyright (c) Switchfin Org. d...@switchfin.org
+#
+# Copyright (c) 2005-2007 Analog Device Inc.
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS-y:= $(BOARD).o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/br4/br4.c b/board/br4/br4.c
new file mode 100644
index 000..bc034e3
--- /dev/null
+++ b/board/br4/br4.c
@@ -0,0 +1,30 @@
+/*
+ * U-boot - main board file
+ *
+ * Copyright (c) Switchfin Org. d...@switchfin.org
+ *
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ *
+ * (C) Copyright 2000-2004
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include common.h
+#include net.h
+#include netdev.h
+
+int checkboard(void)
+{
+   printf(Board: Switchvoice BR4 Appliance\n);
+   printf(   Support: http://www.switchvoice.com/\n;);
+   return 0;
+}
+
+#ifdef CONFIG_BFIN_MAC
+int board_eth_init(bd_t *bis)
+{
+   return bfin_EMAC_initialize(bis);
+}
+#endif
diff --git a/board/br4/config.mk b/board/br4/config.mk
new file mode 100644
index 000..9d66d26
--- /dev/null
+++ b/board/br4/config.mk
@@ -0,0 +1,30 @@
+#
+# Copyright (c) Switchfin Org. d...@switchfin.org 
+#
+# Copyright (c) 2005-2008 Analog Device Inc.
+#
+# (C) Copyright 2001
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# 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
+#
+
+CFLAGS_lib += -O2
+CFLAGS_lib/lzma += -O2
+CFLAGS_lib/zlib += -O2
diff --git a/boards.cfg b/boards.cfg
index 2e819e9..6d45438 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -277,6 +277,7 @@ bf561-acvilonblackfinblackfin

Re: [U-Boot] [PATCH 2/9] Fix strict-aliasing warning in dlmalloc

2012-01-08 Thread Mike Frysinger
On Friday 06 January 2012 15:39:08 Simon Glass wrote:
 On Thu, Jan 5, 2012 at 10:48 PM, Wolfgang Denk wrote:
  Simon Glass wrote:
  This fixes the following warnings in dlmalloc seen with my gcc 4.6.
  
  Which exact version is this?
  
  dlmalloc.c: In function 'malloc_bin_reloc':
  dlmalloc.c:1493: warning: dereferencing pointer 'p' does break
  strict-aliasing rules dlmalloc.c:1493: warning: dereferencing pointer
  'p' does break strict-aliasing rules dlmalloc.c:1490: note: initialized
  from here
  dlmalloc.c:1493: note: initialized from here
  
  Can you please tell me at least one board configuration that throws
  this error (preferrably ppc, arm or mips) ?
 
 I can't see one with those architectures. It does happen for others though:

yes, there have been reports and patches posted in the past iirc.  first by 
Kumar i think.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 9/9] ppc: Change memsz variable to signed char

2012-01-08 Thread Mike Frysinger
Acked-by: Mike Frysinger vap...@gentoo.org
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 8/9] m68k: Change memsz to a signed char to avoid warning

2012-01-08 Thread Mike Frysinger
Acked-by: Mike Frysinger vap...@gentoo.org
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/9] usb: Fix strict-aliasing warning in host/ohci-hcd.c

2012-01-08 Thread Mike Frysinger
On Thursday 05 January 2012 22:54:49 Simon Glass wrote:
   len = min_t(int, len, leni);
 - if (data != databuf.ptr)
 - memcpy(data, databuf.ptr, len);
 + if (dataptr)
 + memcpy(data, dataptr, len);
 + else
 + memcpy(data, databuf, len);

this doesn't seem to be equivalent ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] NAND: Allow nand_ids and nand_bbt to be compiled in SPL

2012-01-08 Thread Mike Frysinger
On Wednesday 04 January 2012 18:56:23 Scott Wood wrote:
 On 12/05/2011 05:17 PM, Marek Vasut wrote:
  This will be beneficial for the PXA3XX NAND driver, which uses the NAND
  IDs to identify the chip and configure the controller accordingly.
  
  --- a/drivers/mtd/nand/Makefile
  +++ b/drivers/mtd/nand/Makefile
  
   endif
   else
   COBJS-y += nand.o
  -COBJS-y += nand_bbt.o
  -COBJS-y += nand_ids.o
   COBJS-y += nand_util.o
   endif
  +COBJS-y += nand_bbt.o
  +COBJS-y += nand_ids.o
   COBJS-y += nand_ecc.o
   COBJS-y += nand_base.o
 
 So, in theory with gc-sections this shouldn't increase the size of any
 SPL that currently successfully links (at least in the absence of things
 like weak symbols).  However, I observed a devkit8000 build go from this:
 
textdata bss dec hex filename
   407091792  197764  240265   3aa89 /tmp/u-boot-arm/spl/u-boot-spl
 
 to this:
 
textdata bss dec hex filename
   422771792  197764  241833   3b0a9 /tmp/u-boot-arm/spl/u-boot-spl
 
 I verified that --function-sections/-fdata-sections/--gc-sections are
 being used on the SPL.  It looks like strings are not getting dropped.

specifically, anonymous strings (or whatever the term is).  it could be made 
to work, but it'd be ugly.  something like:

--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -22,6 +22,12 @@
 +  256 256 Byte page size
 *  512 512 Byte page size
 */
+
+static const char nand_16mib_18v_8bit[] = NAND 16MiB 1,8V 8-bit;
+static const char nand_16mib_33v_8bit[] = NAND 16MiB 3,3V 8-bit;
+static const char nand_16mib_18v_16bit[] = NAND 16MiB 1,8V 16-bit;
+static const char nand_16mib_33v_16bit[] = NAND 16MiB 3,3V 16-bit;
+
 const struct nand_flash_dev nand_flash_ids[] = {
 
 #ifdef CONFIG_MTD_NAND_MUSEUM_IDS
@@ -42,10 +48,10 @@
{NAND 8MiB 3,3V 16-bit,   0x59, 512, 8, 0x2000, NAND_BUSWIDTH_16},
 #endif
 
-   {NAND 16MiB 1,8V 8-bit,   0x33, 512, 16, 0x4000, 0},
-   {NAND 16MiB 3,3V 8-bit,   0x73, 512, 16, 0x4000, 0},
-   {NAND 16MiB 1,8V 16-bit,  0x43, 512, 16, 0x4000, 
NAND_BUSWIDTH_16},
-   {NAND 16MiB 3,3V 16-bit,  0x53, 512, 16, 0x4000, 
NAND_BUSWIDTH_16},
+   {nand_16mib_18v_8bit,   0x33, 512, 16, 0x4000, 0},
+   {nand_16mib_33v_8bit,   0x73, 512, 16, 0x4000, 0},
+   {nand_16mib_18v_16bit,  0x43, 512, 16, 0x4000, NAND_BUSWIDTH_16},
+   {nand_16mib_33v_16bit,  0x53, 512, 16, 0x4000, NAND_BUSWIDTH_16},
 
{NAND 32MiB 1,8V 8-bit,   0x35, 512, 32, 0x4000, 0},
{NAND 32MiB 3,3V 8-bit,   0x75, 512, 32, 0x4000, 0},
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCHv4 3/8] mkenvimage: Correct an include and add a missing one

2012-01-08 Thread Mike Frysinger
Acked-by: Mike Frysinger vap...@gentoo.org
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCHv3 4/8] mkenvimage: More error handling

2012-01-08 Thread Mike Frysinger
On Sunday 08 January 2012 09:25:21 David Wagner wrote:
 --- a/tools/mkenvimage.c
 +++ b/tools/mkenvimage.c
 
 +long int xstrtol(char *s)

const

 +{
 + long int tmp;
 +
 + tmp = strtol(s, NULL, 0);
 + if (!errno)
 + return tmp;

you should manually clear errno before calling strtol.  it'll set the value, 
but won't clear it.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCHv3 5/8] mkenvimage: Read/Write from/to stdin/out by default or if the filename is -

2012-01-08 Thread Mike Frysinger
On Sunday 08 January 2012 07:02:40 David Wagner wrote:
 Le 08/01/2012 07:50, Mike Frysinger a écrit :
  On Thursday 05 January 2012 13:44:56 David Wagner wrote:
  +  bin_fd = creat(bin_filename, S_IRUSR | S_IWUSR | S_IRGRP |
  +   S_IWGRP);
  
  this should prob be open()
 
 What is wrong with creat() ?

nothings wrong with it per-say ... just unusual ;).  if you really want to 
keep it, then it's fine.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 01/15] bootstage: Create an initial header for boot progress integers

2012-01-08 Thread Mike Frysinger
On Sunday 08 January 2012 12:22:54 Simon Glass wrote:
 On Sun, Jan 8, 2012 at 12:26 AM, Mike Frysinger wrote:
  On Saturday 10 December 2011 16:07:53 Simon Glass wrote:
  +enum bootstage_id {
  + BOOTSTAGE_ID_RUN_OS = 15,   /* Exiting U-Boot, entering OS */
  +};
  
  what relevance does this # have ?  since it gets passed to Linux, it
  becomes part of the ABI and cannot be changed, so that should be
  mentioned in the comment.
 
 The number is currently open-coded in U-Boot but this series turns all
 these occurrences into a global enum.

yes, but the enum's have a numeric value :)

 Actually I don't plan that the
 number be passed to Linux, or at least that Linux can rely on it being
 anything in particular.

ok, as long as the end goal has the # not being part of the ABI, that's good
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 11/15] bootstage: Define an optional microsecond timer

2012-01-08 Thread Mike Frysinger
On Sunday 08 January 2012 12:33:34 Simon Glass wrote:
 On Sun, Jan 8, 2012 at 12:30 AM, Mike Frysinger wrote:
  On Saturday 10 December 2011 16:08:03 Simon Glass wrote:
  --- a/lib/time.c
  +++ b/lib/time.c
  
  +ulong __timer_get_boot_us(void)
  +{
  + static ulong base_time;
  +
  + /*
  +  * We can't implement this properly. Return 0 on the first call
  and +  * larger values after that.
  +  */
  + if (base_time)
  + return get_timer(base_time) * 1000;
  + base_time = get_timer(0);
  + return 0;
  +}
  +
  +ulong timer_get_boot_us(void)
  + __attribute__((weak, alias(__timer_get_boot_us)));
  
  isn't this duplicating existing post_time_ms() ?
 
 Yes I am aware of the post stuff, but I have already expended great
 effort integrating the boot progress stuff and I don't want to do
 everything at once!
 
 There is some scope to join bootstage and post, but for now they are
 separate things with separate CONFIGs, and you don't have to enable
 one to get the other.

ok.  i'd change the bootstage: part of your commit message though to 
something like timer: add microsecond boot func.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 15/15] bootstage: arm: Add bootstage calls in board and bootm

2012-01-08 Thread Mike Frysinger
On Sunday 08 January 2012 12:43:09 Simon Glass wrote:
 On Sun, Jan 8, 2012 at 12:36 AM, Mike Frysinger wrote:
  On Saturday 10 December 2011 16:08:07 Simon Glass wrote:
  --- a/arch/arm/lib/bootm.c
  +++ b/arch/arm/lib/bootm.c
  
   static void announce_and_cleanup(void)
   {
printf(\nStarting kernel ...\n\n);
  + bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, start_kernel);
  +#ifdef CONFIG_BOOTSTAGE_REPORT
  + bootstage_report();
  +#endif
  
  shouldn't the header make bootstage_report() into a stub when
  CONFIG_BOOTSTAGE_REPORT isn't defined ?  then you won't need the ifdef
  protection here.
 
 Well maybe. I am hoping for a link error if someone calls it without
 defining that CONFIG. Otherwise it could be very confusing for people
 that they can't get a report!

i'm not sure we need worry about that
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts

2012-01-09 Thread Mike Frysinger
On Monday 09 January 2012 02:50:00 Andrzej Pietrasiewicz wrote:
 However, Wolfgang Denk was not convinced about introducing dfu
 support to u-boot the way it was proposed. Are there any new
 circumstances?

i just had the thread marked unread, so i read it  reviewed for some high 
level details.  that's all.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 15/15] bootstage: arm: Add bootstage calls in board and bootm

2012-01-09 Thread Mike Frysinger
On Sunday 08 January 2012 18:48:18 Simon Glass wrote:
 On Sun, Jan 8, 2012 at 11:58 AM, Mike Frysinger wrote:
  On Sunday 08 January 2012 12:43:09 Simon Glass wrote:
  On Sun, Jan 8, 2012 at 12:36 AM, Mike Frysinger wrote:
   On Saturday 10 December 2011 16:08:07 Simon Glass wrote:
   --- a/arch/arm/lib/bootm.c
   +++ b/arch/arm/lib/bootm.c
   
static void announce_and_cleanup(void)
{
 printf(\nStarting kernel ...\n\n);
   + bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF,
   start_kernel); +#ifdef CONFIG_BOOTSTAGE_REPORT
   + bootstage_report();
   +#endif
   
   shouldn't the header make bootstage_report() into a stub when
   CONFIG_BOOTSTAGE_REPORT isn't defined ?  then you won't need the ifdef
   protection here.
  
  Well maybe. I am hoping for a link error if someone calls it without
  defining that CONFIG. Otherwise it could be very confusing for people
  that they can't get a report!
  
  i'm not sure we need worry about that
 
 I have had another look at this. The idea is that anyone can call
 bootstage_report() to get a report, but if they define
 CONFIG_BOOTSTAGE_REPORT then one is printing automatically by U-Boot
 just before jumping to the kernel.
 
 So I don't want this define to remove the ability to print a report,
 just to enable printing a report at a time which is hopefully
 suitable.
 
 Does that make sense?

ok, so we have:
#ifdef CONFIG_BOOTSTAGE
extern void bootstage_report(void);
#else
#define bootstage_report()
#endif

and CONFIG_BOOTSTAGE_REPORT controls the automatic calls to the report func

is the arm-specific bootm hooks the best place for this ?  wouldn't putting 
this into the common bootm code be better ?
-mike 


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 13/15] bootstage: Add microsecond boot time measurement

2012-01-09 Thread Mike Frysinger
On Sunday 08 January 2012 12:42:02 Simon Glass wrote:
 On Sun, Jan 8, 2012 at 12:35 AM, Mike Frysinger wrote:
  On Saturday 10 December 2011 16:08:05 Simon Glass wrote:
  --- a/include/bootstage.h
  +++ b/include/bootstage.h
  
  +static inline ulong bootstage_mark(enum bootstage_id id)
   {
  - show_boot_progress(-val);
  +#ifdef CONFIG_SHOW_BOOT_PROGRESS
  + show_boot_progress(id);
  +#endif
  + return 0;
   }
  
  +static inline ulong bootstage_error(enum bootstage_id id)
  +{
  +#ifdef CONFIG_SHOW_BOOT_PROGRESS
  + show_boot_progress(-id);
  +#endif
  + return 0;
  +}
  
  why isn't show_boot_progress() just a stub when CONFIG_SHOW_BOOT_PROGRESS
  isn't defined ?  then you don't have to protect the call sites.
 
 show_boot_progress() has been part of U-Boot for a while. Quite a lot
 of boards define this function with the expectation that they can turn
 CONFIG_SHOW_BOOT_PROGRESS on and off independently. So If I do what
 you suggest I will break that expectation.
 
 One fix would be to bracket all show_boot_progress() function
 implementations in the boards with CONFIG_SHOW_BOOT_PROGRESS, but I
 haven't done that.

it seemed like part of your clean up series was to merge show_boot_progress() 
into your new bootstage framework.  in which case, we have full control over 
it now, and ifdef bracketing for it should go away ...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] Flush the date cache before disabling it.

2012-01-09 Thread Mike Frysinger
On Monday 09 January 2012 13:25:50 Sughosh Ganu wrote:
  arch/arm/cpu/arm926ejs/start.S |   10 +++---

your patch summary should include a relevant prefix.  something like arm:  or 
arm926: .  that way non-arm people can ignore this.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] NAND: Allow nand_ids and nand_bbt to be compiled in SPL

2012-01-09 Thread Mike Frysinger
On Monday 09 January 2012 14:41:07 Scott Wood wrote:
 Unless/until the toolchain can properly GC anonymous strings, I think
 finer-grained conditional compilation is the way to go.

i think we should use GC when it works (we've found 1 case so far where it 
doesn't), and add fine grained compilation when it doesn't (with a note with 
expected working versions).  i think this is a bug in the linker and have been 
trying to make a reduced test case that i can post to the GNU binutils peeps.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 5/9] sandbox: sort header files in os.c

2012-01-10 Thread Mike Frysinger
On Monday 09 January 2012 17:25:15 Simon Glass wrote:
 --- a/arch/sandbox/cpu/os.c
 +++ b/arch/sandbox/cpu/os.c
 
 +#include errno.h
  #include fcntl.h
 +#include os.h
  #include stdlib.h
  #include termios.h
 -#include unistd.h
  #include time.h
 -#include errno.h
 -#include sys/types.h
 -#include sys/stat.h
 +#include unistd.h
  #include sys/mman.h
 +#include sys/stat.h
 +#include sys/types.h
  #include linux/types.h
 
 -#include os.h

this is a u-boot header, so it should be last :)

the rest look good now
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] da850evm: drop NET_MULTI reference

2012-01-10 Thread Mike Frysinger
Acked-by: Mike Frysinger vap...@gentoo.org
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] NAND: Allow nand_ids and nand_bbt to be compiled in SPL

2012-01-10 Thread Mike Frysinger
On Monday 09 January 2012 16:27:44 Scott Wood wrote:
 On 01/09/2012 03:21 PM, Mike Frysinger wrote:
  On Monday 09 January 2012 14:41:07 Scott Wood wrote:
  Unless/until the toolchain can properly GC anonymous strings, I think
  finer-grained conditional compilation is the way to go.
  
  i think we should use GC when it works (we've found 1 case so far where
  it doesn't), and add fine grained compilation when it doesn't (with a
  note with expected working versions).
 
 Anonymous strings are hardly a rare occurance.

it isn't all anonymous strings.  there's something more going on here that is 
tickling the bug.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] NAND: Allow nand_ids and nand_bbt to be compiled in SPL

2012-01-10 Thread Mike Frysinger
On Monday 09 January 2012 16:25:41 Tom Rini wrote:
 On Mon, Jan 9, 2012 at 2:23 PM, Tom Rini tom.r...@gmail.com wrote:
  On Mon, Jan 9, 2012 at 2:21 PM, Mike Frysinger vap...@gentoo.org wrote:
  On Monday 09 January 2012 14:41:07 Scott Wood wrote:
  Unless/until the toolchain can properly GC anonymous strings, I think
  finer-grained conditional compilation is the way to go.
  
  i think we should use GC when it works (we've found 1 case so far where
  it doesn't), and add fine grained compilation when it doesn't (with a
  note with expected working versions).  i think this is a bug in the
  linker and have been trying to make a reduced test case that i can post
  to the GNU binutils peeps.
  
  We've found two cases, at least.  Functions aren't being dropped out
  either.
 
 To be clear,
 https://github.com/trini/u-boot/commit/3a7c313125eff000ac73e38d220e5f9615c
 1abbe shows switching everything to the normal nand codebase, but with a
 gain of only 170 bytes.  The reason it's such an otherwise small delta is
 that I added some #ifndef CONFIG_SPL_BUILD to drop out unused code that
 the linker should have been dropping for us, but wasn't.

how exactly do i reproduce the issue ?  what do i `make xxx` ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] bootm: Move silencing of linux console to deprecated config option.

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 14:16:58 Doug Anderson wrote:
 --- a/README
 +++ b/README
 @@ -606,9 +606,8 @@ The following options need to be configured:
   environment 'console=serial'.
 
   When CONFIG_SILENT_CONSOLE is defined, all console
 - messages (by U-Boot and Linux!) can be silenced with
 - the silent environment variable. See
 - doc/README.silent for more information.
 + messages can be silenced with the silent environment
 + variable. See doc/README.silent for more information.

this now becomes vague for anyone who is used to the old behavior/description.  
i'd have the new wording say U-Boot messages rather than messages, and 
then add a tip that people have to manually add console= themselves to the 
kernel's bootargs in order for messages there to be silenced.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/2] Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 14:16:56 Doug Anderson wrote:
 As discussed previously on the U-Boot mailing list (see comments on
 Fix fixup_silent_linux() buffer overrun patchset), relying on
 bootm to mangle the Linux bootargs is not a suggested way to go.
 We now officially deprecate it and provide a way to avoid it (but
 still get the other CONFIG_SILENT_CONSOLE behavior).

personally i found the current behavior useful, but the code to implement it 
is crappy.  oh well.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/2] Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 16:04:27 Doug Anderson wrote:
 I believe that you can do a script something like this (where
 normal_bootargs is the old bootargs without the console= part,
 console_args is the non-silent console settings, and old_bootcmd is
 the old bootcmd):

it's not exactly the same behavior, but should be sufficient for everyone's 
needs

 Hopefully this works for you.  I'll add it to the documentation, too.

that'd be good
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/2] bootm: Move silencing of linux console to deprecated config option.

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 16:36:20 Doug Anderson wrote:
 --- a/common/cmd_bootm.c
 +++ b/common/cmd_bootm.c

 +static void fixup_silent_linux(void) __attribute__ ((deprecated));

__deprecated (from linux/compiler.h)

 --- a/doc/README.silent
 +++ b/doc/README.silent

 +CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE with the warning that using

s/warning/caveat/

 +the option opens you up to a buffer overrun if your linux bootargs
 +can be 256 bytes.

s/can be/are/

 +also silence the Linux console, a script like this may help you (where

the pedant in me says: s/may/might/
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/2] config: Add CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 16:36:19 Doug Anderson wrote:
  include/configs/bfin_adi_common.h  |1 +

don't bother.  we didn't enable silent=1 by default in any of the Blackfin 
boards.  just made the functionality available to people if they wanted to 
test things out with it when prototyping on dev boards.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 3/3] config: Remove Blackfin CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 17:26:22 Doug Anderson wrote:
 As Mike Frysinger writes:
   We didn't enable silent=1 by default in any of the Blackfin boards
   Just made the functionality available to people if they wanted to
   test things out with it when prototyping on dev boards.
 
 --- a/include/configs/bfin_adi_common.h
 +++ b/include/configs/bfin_adi_common.h
 @@ -108,7 +108,6 @@
  #define CONFIG_LOADS_ECHO1
  #define CONFIG_JTAG_CONSOLE
  #define CONFIG_SILENT_CONSOLE
 -#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
  #ifndef CONFIG_BAUDRATE
  # define CONFIG_BAUDRATE 57600
  #endif

not sure why you don't just squash it into 1/3 and never bother defining it ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] bootm: Avoid 256-byte overflow in fixup_silent_linux()

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 17:28:05 Wolfgang Denk wrote:
 Doug Anderson wrote:
  This makes fixup_silent_linux() use malloc() to allocate its
  working space, meaning that our maximum kernel command line
  should only be limited by malloc().  Previously it was silently
  overflowing the stack.
 
 ...
 
   static void fixup_silent_linux(void)
   {
  
  -   char buf[256], *start, *end;
 
 Are you sure that the kernel's buffer is long enough?
 
 For example on PowerPC, there is a current hard limit on 512
 characters:
 
   arch/powerpc/boot/ops.h:#define COMMAND_LINE_SIZE   512
   arch/powerpc/kernel/setup-common.c:char cmd_line[COMMAND_LINE_SIZE];
 
 On SPARC, we have 256 bytes hard limit, see arch/sparc/prom/bootstr_64.c:
 
   #define BARG_LEN  256
   ...
   prom_getstring(prom_chosen_node, bootargs,
   bootstr_info.bootstr_buf, BARG_LEN);

i think this does len checking ...

 I think your patch is likely to break all these architectures?

i don't know about others, but on Blackfin, we don't care.  we just copy the 
first COMMAND_LINE_SIZE bytes out and ignore the rest.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] bootm: Avoid 256-byte overflow in fixup_silent_linux()

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 17:51:15 Doug Anderson wrote:
 On Tue, Jan 10, 2012 at 2:28 PM, Wolfgang Denk wrote:
  I think your patch is likely to break all these architectures?
 
 I'm not sure how my patch would break these architectures.

if the kernel doesn't do len checking on the input string and only looks for 
trailing NUL byte, you could trigger a buffer overflow in the kernel.  
personally, i'd say that's poor behavior on the part of the kernel, but we 
should still be nice if possible ...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cmd_source: introduce run_script()

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 18:04:19 Michael Walle wrote:
 --- a/common/cmd_source.c
 +++ b/common/cmd_source.c
 
 +/*
 + * Run a series of commands, separated by '\n'.
 + * Beware, the contents of script may be modified while it is parsed.
 + */
 +int run_script(char *script)

const

also, we already have run_command and run_command2, and they're both in 
common/main.c.  how about naming this source_commands and also putting it 
into common/main.c ?

although i wonder if it'd be possible to merge this into existing 
run_commands2() ... do we allow newlines now in variables that get run ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 3/3] config: Remove Blackfin CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 18:38:07 Doug Anderson wrote:
 3. Something else (?)

getenv returns a writable buffer, so i wonder if things couldn't be avoided 
easily all around.  after all, you're just deleting bytes here, not adding new 
ones.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 5/9] sandbox: sort header files in os.c

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 18:54:05 Simon Glass wrote:
 Tidy this up as the list is long and likely to get longer.

added to my sandbox branch
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 6/9] sandbox: Add required header to os.c

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 18:54:06 Simon Glass wrote:
 We should include the sys/time.h header to avoid warnings.

added to my sandbox branch
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 3/3] config: Remove Blackfin CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 18:48:12 Doug Anderson wrote:
 On Tue, Jan 10, 2012 at 3:44 PM, Mike Frysinger vap...@gentoo.org wrote:
  On Tuesday 10 January 2012 18:38:07 Doug Anderson wrote:
  getenv returns a writable buffer, so i wonder if things couldn't be
  avoided easily all around.  after all, you're just deleting bytes here,
  not adding new ones.
 
 Actually, that's not quite true.  The current code will add console=
 in the case that it finds no console argument.

true ... we could still relegate the strdup/free to that step ...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] linkage.h: move from blackfin to common includes

2012-01-10 Thread Mike Frysinger
On Thursday 01 December 2011 13:05:42 Mike Frysinger wrote:
 On Wednesday 30 November 2011 23:32:10 Macpaul Lin wrote:
  1. Add linkage.h support from blackfin to common include,
  
 which is a reduced version from Linux.
  
  2. Add architecture part support of linkage.h into blackfin
  3. Fix include path of in blackfin related to linkage.h
  
 due to header file movement.
 
 i'll test it out and run it through my Blackfin tree.  let's see if any one
 else has any feedback ...

FYI, i'll be including it as part of my Blackfin merge when the window closes
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] linkage.h: move from blackfin to common includes

2012-01-10 Thread Mike Frysinger
On Tuesday 10 January 2012 21:05:35 Fabio Estevam wrote:
 On Wed, Nov 30, 2011 at 5:23 AM, Macpaul Lin macp...@andestech.com wrote:
  Add linkage.h support from blackfin to common include,
  which is a reduced version from Linux.
  
  Signed-off-by: Macpaul Lin macp...@andestech.com
  ---
   arch/blackfin/include/asm/linkage.h |   74
  --- include/linux/linkage.h
  |   72 ++ 2 files changed, 72
  insertions(+), 74 deletions(-)
   delete mode 100644 arch/blackfin/include/asm/linkage.h
   create mode 100644 include/linux/linkage.h
 
 You can use the -M git option to properly do the filename change.

the -M option is display of the changeset only ... it doesn't affect what gets 
committed/merged.  but using -C/-M when sending patches would be nice as it's 
easier to review.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] configs: Remove CONFIG_NET_MULTI from board files

2012-01-14 Thread Mike Frysinger
On Wednesday 11 January 2012 07:47:31 Fabio Estevam wrote:
 CONFIG_NET_MULTI is not used anymore, so remove it from board files.

NAK: idea: good.  actual patch: buggy :(.

 --- a/include/configs/P1010RDB.h
 +++ b/include/configs/P1010RDB.h
 
 -#if defined(CONFIG_TSEC_ENET)
 -#ifndef CONFIG_NET_MULTI
 -#define CONFIG_NET_MULTI
 -#endif
 -
  #define CONFIG_MII   /* MII PHY management */
  #define CONFIG_MII_DEFAULT_TSEC  1   /* Allow unregistered phys */
  #define CONFIG_TSEC1 1

you sure this is correct ?  looks like you deleted 2 if statements but only 1 
endif.

 --- a/include/configs/p1_p2_rdb_pc.h
 +++ b/include/configs/p1_p2_rdb_pc.h

  #define CONFIG_DOS_PARTITION
  #endif /* CONFIG_PCI */
 
 -#if defined(CONFIG_TSEC_ENET)
 -
 -#ifndef CONFIG_NET_MULTI
 -#define CONFIG_NET_MULTI
 -#endif
 -
  #define CONFIG_MII   /* MII PHY management */
  #define CONFIG_TSEC1
  #define CONFIG_TSEC1_NAMEeTSEC1

same issue here
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5] miiphyutil: Add Micrel KSZ9021 support to miiphy_speed

2012-01-14 Thread Mike Frysinger
On Friday 13 January 2012 07:10:02 Dirk Behme wrote:
  common/miiphyutil.c |   18 +-
  1 files changed, 17 insertions(+), 1 deletions(-)

this is dead code ... i think we're pushing people to use the name phy 
framework rather than fixing/extending the old one.

 --- a/common/miiphyutil.c
 +++ b/common/miiphyutil.c

 +#ifdef CONFIG_PHY_MICREL_KSZ9021
 +#define MII_PHY_CTL  0x1f
 +#define MII_PHY_CTL_1000 (1  6)
 +#define MII_PHY_CTL_100  (1  5)
 +#define MII_PHY_CTL_10   (1  4)

are you sure there aren't defines already in linux/mii.h for these ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] SPI: Add i.MX ECSPI driver

2012-01-14 Thread Mike Frysinger
On Thursday 12 January 2012 10:27:13 Dirk Behme wrote:
 +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
 + unsigned int max_hz, unsigned int mode)
 +{
 + struct imx_spi_dev_t *imx_spi_slave = NULL;

setting to NULL is kind of pointless when you init it immediately below

 + imx_spi_slave = (struct imx_spi_dev_t *)
 + calloc(sizeof(struct imx_spi_dev_t), 1);

no need for that cast on the return of calloc

 + spi_get_cfg(imx_spi_slave);
 + spi_io_init(imx_spi_slave, 0);

i don't see these funcs defined anywhere in this patch.  since they aren't part 
of the common SPI API, you should namespace them accordingly (like with an SoC 
prefix or something).

 + spi_reset((imx_spi_slave-slave));

the inner params are not needed.  also, programming of hardware does not 
happen in the spi_setup_slave() step.  that's what the spi_claim_bus() is for.

 + return (imx_spi_slave-slave);

drop the paren

 +void spi_free_slave(struct spi_slave *slave)
 +{
 + struct imx_spi_dev_t *imx_spi_slave;
 +
 + if (slave) {
 + imx_spi_slave = to_imx_spi_slave(slave);
 + free(imx_spi_slave);
 + }
 +}

the NULL check on slave is not necessary.  we assume everywhere else that it 
is valid ahead of time.

 +int spi_xchg_single(struct spi_slave *slave, unsigned int bitlen,
 + const u8 *dout, u8 *din, unsigned long flags)

static

 + if (spi_reg-ctrl_reg == 0) {
 + printf(Error: spi(base=0x%x) has not been initialized yet\n,
 + dev-base);

not necessary either ... we don't bother supporting broken callers in the bus 
drivers

 +int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void
 + *dout, void *din, unsigned long flags)
 ...
 + if (!slave)
 + return -1;

not necessary either

 +int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 +{
 + return 1;
 +}

this can't be right ...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] i.mx6q: SabreLite: Add SPI NOR support

2012-01-14 Thread Mike Frysinger
On Thursday 12 January 2012 10:27:14 Dirk Behme wrote:
 +#ifdef CONFIG_CMD_SF
 + #define CONFIG_FSL_SF   1
 + #define CONFIG_SPI_FLASH   1
 + #define CONFIG_SPI_FLASH_SST1
 + #define CONFIG_SPI_FLASH_CS 1
 + #define CONFIG_IMX_ECSPI
 + #define IMX_CSPI_VER_2_31

don't indent the #
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] i.mx6q: SabreLite: Add SPI NOR support

2012-01-14 Thread Mike Frysinger
On Thursday 12 January 2012 10:38:40 Marek Vasut wrote:
  From: Eric Nelson eric.nel...@boundarydevices.com
  +#ifdef CONFIG_IMX_ECSPI
  +s32 spi_get_cfg(struct imx_spi_dev_t *dev)
  +{
  +   int rval = 0 ;
  +   if (1 == dev-slave.cs) {
  +   dev-base = ECSPI1_BASE_ADDR;
  +   dev-ss = 1 ;
 
  ; again.
 
 Also, Do you even need the ecspi thing? Doesn't uboot support some kind of
 imx spi driver already?

when you reply, please delete all unnecessary context.  there was like ~170 
lines of context when you only needed ~10.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   3   4   5   6   7   8   9   10   >