summaryrefslogtreecommitdiffstats
path: root/commands/spi.c
Commit message (Collapse)AuthorAgeFilesLines
* commands: spi: do not restrict spi's data to be hex-formattedUlrich Ölmann2017-10-231-1/+1
| | | | | | | | | | | Change the default base to 0 to be consistent with the "mw" command and particularly allow decimally formatted data. The price to pay is needing the usual prefix "0x" for each hex-formatted number. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: spi: fix chip select validationStefan Lengfeld2016-11-081-2/+2
| | | | | | | | | The chip selects are numbered 0..(max chip selects - 1). Chip select with number <max chip selects> is invalid. Fix the check for that. Using the out of bound chip select may hang your board. Signed-off-by: Stefan Lengfeld <s.lengfeld@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+1
| | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: spi: Fix spi read procedureAlexander Shiyan2013-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Buffer for RX is set incorrectly. barebox@Phytec phyCORE-i.MX27:/ spi -r 128 -v device config bus_num = 0 max_speed_hz = 1000000 chip_select = 0 mode = 0x0 bits_per_word = 8 wrote 0 bytes 00000000: read 128 bytes 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ unable to handle paging request at address 0x4dffd3d0 pc : [<a7f05ec4>] lr : [<a7f05ebc>] sp : a7fff890 ip : a7fff860 fp : a7f68820 r10: a6ffe9bc r9 : 00000000 r8 : 00000001 r7 : a6ffe9ec r6 : a6f00000 r5 : a6ffe9ec r4 : a6ffe9e4 r3 : a6ffe9e4 r2 : a6ffe9e5 r1 : a6ffe9e4 r0 : 4dffd3cc Flags: nZCv IRQs off FIQs off Mode SVC_32 ... Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mem: add the swab (swap bytes) option to memory_display()Antony Pavlov2012-11-261-2/+2
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce spi commandJean-Christophe PLAGNIOL-VILLARD2012-11-121-0/+132
usefull to debug spi The command allow to read/write on a spi device Usage: spi [OPTION] [data to write 0xXX] write/read spi device. -b <bus_num> spi bus number (default = 0) -r <count> to read -c <cs> chip select (default = 0) -m <mode> spi mode (default = 0) -f <hz> max_speed_hz (default = 1MHz) -w <bit> bits_per_word (default = 8) -v verbose Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>