summaryrefslogtreecommitdiffstats
path: root/common/cmd_spi.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-06-27 21:31:46 +0000
committerwdenk <wdenk>2003-06-27 21:31:46 +0000
commit8bde7f776c77b343aca29b8c7b58464d915ac245 (patch)
tree20f1fd99975215e7c658454a15cdb4ed4694e2d4 /common/cmd_spi.c
parent993cad9364c6b87ae429d1ed1130d8153f6f027e (diff)
downloadtalos-obmc-uboot-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.gz
talos-obmc-uboot-8bde7f776c77b343aca29b8c7b58464d915ac245.zip
* Code cleanup:
- remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)
Diffstat (limited to 'common/cmd_spi.c')
-rw-r--r--common/cmd_spi.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/common/cmd_spi.c b/common/cmd_spi.c
index d544b27018..82cb673f5f 100644
--- a/common/cmd_spi.c
+++ b/common/cmd_spi.c
@@ -28,7 +28,6 @@
#include <common.h>
#include <command.h>
#include <spi.h>
-#include <cmd_spi.h>
#if (CONFIG_COMMANDS & CFG_CMD_SPI)
@@ -107,11 +106,11 @@ int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if ((device < 0) || (device >= spi_chipsel_cnt)) {
printf("Invalid device %d, giving up.\n", device);
return 1;
- }
+ }
if ((bitlen < 0) || (bitlen > (MAX_SPI_BYTES * 8))) {
printf("Invalid bitlen %d, giving up.\n", bitlen);
return 1;
- }
+ }
debug ("spi_chipsel[%d] = %08X\n",
device, (uint)spi_chipsel[device]);
@@ -130,4 +129,15 @@ int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return rcode;
}
+/***************************************************/
+
+cmd_tbl_t U_BOOT_CMD(SPI) = MK_CMD_ENTRY(
+ "sspi", 5, 1, do_spi,
+ "sspi - SPI utility commands\n",
+ "<device> <bit_len> <dout> - Send <bit_len> bits from <dout> out the SPI\n"
+ "<device> - Identifies the chip select of the device\n"
+ "<bit_len> - Number of bits to send (base 10)\n"
+ "<dout> - Hexadecimal string that gets sent\n"
+);
+
#endif /* CFG_CMD_SPI */
OpenPOWER on IntegriCloud