From: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Fix MSB check in Xilinx Spartan slave serial mode
Date: Mon, 12 Nov 2007 18:19:00 +0100 [thread overview]
Message-ID: <11948879422702-git-send-email-matthias.fuchs@esd-electronics.com> (raw)
In-Reply-To: <1194887941159-git-send-email-matthias.fuchs@esd-electronics.com>
Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
---
common/spartan2.c | 4 ++--
common/spartan3.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/common/spartan2.c b/common/spartan2.c
index 724ad0d..2f1ea2c 100644
--- a/common/spartan2.c
+++ b/common/spartan2.c
@@ -441,7 +441,7 @@ static int Spartan2_ss_load (Xilinx_desc * desc, void *buf, size_t bsize)
int ret_val = FPGA_FAIL; /* assume the worst */
Xilinx_Spartan2_Slave_Serial_fns *fn = desc->iface_fns;
int i;
- char val;
+ unsigned char val;
PRINTF ("%s: start with interface functions @ 0x%p\n",
__FUNCTION__, fn);
@@ -516,7 +516,7 @@ static int Spartan2_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);
CONFIG_FPGA_DELAY ();
/* Assert the clock */
(*fn->clk) (TRUE, TRUE, cookie);
diff --git a/common/spartan3.c b/common/spartan3.c
index 20edc0c..d329e70 100644
--- a/common/spartan3.c
+++ b/common/spartan3.c
@@ -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;
PRINTF ("%s: start with interface functions @ 0x%p\n",
__FUNCTION__, fn);
@@ -521,7 +521,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);
CONFIG_FPGA_DELAY ();
/* Assert the clock */
(*fn->clk) (TRUE, TRUE, cookie);
--
1.5.3
next prev parent reply other threads:[~2007-11-12 17:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-12 17:18 [U-Boot-Users] [PATCH] Improve configuration of FPGA subsystem Matthias Fuchs
2007-11-12 17:18 ` [U-Boot-Users] [PATCH] Add pre and post configuration callbacks for Spartan FPGAs Matthias Fuchs
2007-11-12 17:18 ` [U-Boot-Users] [PATCH] Add new Xilinx Spartan FPGA types Matthias Fuchs
2007-11-12 17:19 ` Matthias Fuchs [this message]
2007-11-12 17:19 ` [U-Boot-Users] [PATCH] Remove bit swapping in Xilinx Spartan bitfile loading 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=11948879422702-git-send-email-matthias.fuchs@esd-electronics.com \
--to=matthias.fuchs@esd-electronics.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.