public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jerry Van Baren <gerald.vanbaren@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] RFC: Some improvements for the FPGA subsystem
Date: Mon, 12 Nov 2007 08:24:24 -0500	[thread overview]
Message-ID: <47385408.3040106@ge.com> (raw)
In-Reply-To: <200711111745.02822.matthias.fuchs@esd-electronics.com>

Matthias Fuchs wrote:
> Hi,
> 
> we had some discussions about the FPGA subsystem some days (and also 
> a couple of months) before on this list. I have also some local improvements 
> for the FPGA subsystem.

[snip]

> Matthias

Hi Matthias,

[massive snip]

> diff --git a/common/spartan3.c b/common/spartan3.c
> index c0f2b05..4fe3e89 100644
> --- a/common/spartan3.c
> +++ b/common/spartan3.c
> @@ -30,7 +30,7 @@
>  #include <common.h>		/* core U-Boot definitions */
>  #include <spartan3.h>		/* Spartan-II device family */
>  
> -#if (CONFIG_FPGA & (CFG_XILINX | CFG_SPARTAN3))
> +#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_SPARTAN3)
>  
>  /* Define FPGA_DEBUG to get debug printf's */
>  #ifdef	FPGA_DEBUG
> @@ -446,7 +446,7 @@ static int Spartan3_ss_load (Xilinx_desc * desc, void *buf, size_t bsize)
>  	int ret_val = FPGA_FAIL;	/* assume the worst */
>  	Xilinx_Spartan3_Slave_Serial_fns *fn = desc->iface_fns;
>  	int i;
> -	char  val;
> +	unsigned char val;

Trivia: This change should not be necessary since you fixed the 
conditional (below) to do a bit-wise & 0x80 rather than a signed compare 
that has portability and aesthetic problems.

>  	PRINTF ("%s: start with interface functions @ 0x%p\n",
>  			__FUNCTION__, fn);
> @@ -514,6 +514,7 @@ static int Spartan3_ss_load (Xilinx_desc * desc, void *buf, size_t bsize)
>  				puts ("** CRC error during FPGA load.\n");
>  				return (FPGA_FAIL);
>  			}
> +
>  			val = data [bytecount ++];
>  			i = 8;
>  			do {
> @@ -521,7 +522,7 @@ static int Spartan3_ss_load (Xilinx_desc * desc, void *buf, size_t bsize)
>  				(*fn->clk) (FALSE, TRUE, cookie);
>  				CONFIG_FPGA_DELAY ();
>  				/* Write data */
> -				(*fn->wr) ((val < 0), TRUE, cookie);
> +				(*fn->wr) ((val & 0x80), TRUE, cookie);

Thank you, that makes my aesthetics radar much happier!  :-)  Now it 
should be immaterial whether val is signed or unsigned.

Painting the bike shed blue,
gvb

[snip]

Ref:
<http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING>

  parent reply	other threads:[~2007-11-12 13:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-11 16:45 [U-Boot-Users] RFC: Some improvements for the FPGA subsystem Matthias Fuchs
2007-11-12  0:17 ` Grant Likely
2007-11-12  9:15 ` w.wegner at astro-kom.de
2007-11-12  9:45   ` Matthias Fuchs
2007-11-12 10:06     ` w.wegner at astro-kom.de
2007-11-12 13:24 ` Jerry Van Baren [this message]
2007-11-12 14:51   ` Matthias Fuchs
2007-11-12 15:00     ` Jerry Van Baren
2007-12-10 12:04     ` w.wegner at astro-kom.de
2007-12-11 17:00       ` Matthias Fuchs
2007-12-12 10:44         ` w.wegner at astro-kom.de
2007-12-13  9:23           ` Matthias Fuchs
2007-11-12 22:55 ` Bruce_Leonard at selinc.com
2007-11-12 23:09   ` Grant Likely
2007-11-13  8:34   ` Matthias Fuchs
2007-11-13 18:15     ` Bruce_Leonard at selinc.com
2007-11-14  7:56       ` Matthias Fuchs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47385408.3040106@ge.com \
    --to=gerald.vanbaren@ge.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox