summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* remove now unused libmtdSascha Hauer2016-04-063-372/+0
| | | | | | | The only user of libmtd was ubiformat which now uses the mtd-peb API, so remove the now unused libmtd. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubiformat: Use mtd-peb APISascha Hauer2016-04-062-30/+21
| | | | | | | | This changes ubiformat from the libmtd API to the mtd-peb API. This makes the libmtd API unnecessary and it can be removed in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: rename mtd_all_ff -> mtd_buf_all_ffSascha Hauer2016-03-151-1/+1
| | | | | | | To make clear this function checks a given buffer and not data on a mtd device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* process_escape_sequence: add support for \uPhilipp Zabel2016-02-171-0/+6
| | | | | | | | Expand the \u escape sequence to the user currently set in the $global.user variable. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ratp'Sascha Hauer2016-02-084-0/+1851
|\
| * barebox remote controlSascha Hauer2016-01-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the ability to control barebox over serial lines. The regular console is designed for human input and is unsuitable for controlling barebox from scripts since characters can be lost on both ends, the data stream contains escape sequences and the prompt cannot be easily matched upon. This approach is based on the RATP protocol. RATP packages start with a binary 0x01 which does not occur in normal console data. Whenever a 0x01 character is detected in the console barebox goes into RATP mode. The RATP packets contain a simple structure with a command/respone type and data for that type. Currently defined types are: BB_RATP_TYPE_COMMAND (host->barebox): Execute a command in the shell BB_RATP_TYPE_COMMAND_RETURN (barebox->host) Sends return value of the command back to the host, also means barebox is ready for the next command BB_RATP_TYPE_CONSOLEMSG (barebox->host) Console message from barebox Planned but not yet implemented are: BB_RATP_TYPE_PING (host->barebox) BB_RATP_TYPE_PONG (barebox->host) For testing purposes BB_RATP_TYPE_GETENV (host->barebox) BB_RATP_TYPE_GETENV_RETURN (barebox->host) Get values of environment variables Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Andrey Smirnov <andrew.smirnov@gmail.com>
| * Add Reliable Asynchronous Transfer ProtocolSascha Hauer2016-01-183-0/+1843
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Reliable Asynchronous Transfer Protocol (RATP) as described in RFC916. Communication over RS232 is often unreliable as characters are lost or misinterpreted. This protocol allows for a reliable packet based communication over serial lines. The implementation simply follows the state machine described in the RFC text with one exception. RFC916 uses a plain checksum for the transferred data. We decided to use CRC16 for greater robustness. Since this is the only RFC916 implementation we currently know of interoperability with other implementations should not matter. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Andrey Smirnov <andrew.smirnov@gmail.com>
* | vsprintf: Add support for %paSascha Hauer2016-01-151-0/+27
| | | | | | | | | | | | | | Add support for the %pa format specifier to print phys_addr_t, dma_addr_t and resource_size_t. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/pstore'Sascha Hauer2016-01-117-0/+728
|\ \
| * | lib: Import reed solomon code from kernelMarkus Pargmann2015-12-106-0/+704
| | | | | | | | | | | | | | | | | | | | | | | | reed solomon code is used by RAMOOPS to check and fix data stored in volatile memory. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | vsprintf: Add scnprintf from kernelMarkus Pargmann2015-12-101-0/+24
| |/ | | | | | | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-01-113-5/+6
|\ \
| * | readline: Fix potential buffer overflow in command historySascha Hauer2016-01-081-1/+2
| | | | | | | | | | | | | | | | | | | | | Cursor up copies the last line into the buffer without checking if it fits into the current buffer. Fix this using safe_strncpy. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | readline: Fix potential buffer overflowSascha Hauer2016-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | cread_add_char doesn't take the trailing '\0' into account, so adding it at the end of readline can overflow the buffer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootstrap: constify stringsTrent Piepho2016-01-082-3/+3
| |/ | | | | | | | | | | | | Various parameters for device names, etc. should be const strings. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / bootstrap: Boot barebox with kernel calling conventionTrent Piepho2015-12-141-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | In commit 8e3ddc13eb8239177ed20f119e3a3d02518b941d the bootm code was changed to boot barebox using the same calling convention as the kernel. Which on ARM is to pass three arguments which are zero, an architecture code, and a params pointer. A 2nd stage barebox can be booted using lib/bootstrap, which is different code from bootm. This code just leaves garbage in the first three parameters and so doesn't follow the convention. Change it to be compatible with the ARM kernel booting convention. This just sends a zero for the architecture, since the code for architectures depends on boot[zmu] and something using bootstrap wouldn't have those too. And it just passes NULL for the params since we don't have a way to pass a device tree from the preloader. All users of bootstrap are ARM based, but the code is in lib so a non-ARM board might someday make use of it. If the current code would work for them, then the change here will be ok too. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-12-082-1/+12
|\
| * make_directory: fix warning: no previous prototypeSergey Koshechkin2015-11-181-1/+4
| | | | | | | | | | Signed-off-by: Sergey Koshechkin <serge.koshechkin@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * lib: readline support ctrl-l to clear screenDu Huanpeng2015-11-171-0/+8
| | | | | | | | | | | | | | | | maybe it is easier to press ctrl-l to clear the screen than type 'clear' command. Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2015-12-081-0/+4
|\ \
| * | graphics_utils: check for valid framebuffer before creating a screenSascha Hauer2015-11-131-0/+4
| |/ | | | | | | | | | | Otherwise we crash later when we try to print on that screen. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | font: fbconsole: add custom font supportsDu Huanpeng2015-11-234-0/+79
| | | | | | | | | | Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fbconsole: register fonts dynamicallySascha Hauer2015-11-134-33/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having a fixed array of fonts register the fonts dynamically. This allows easier adding of fonts to the tree since only one file per font has to be added and no other files modified. Currently we have to register the fonts very early before the first framebuffer is registered. This is because of our limited dev_add_param_enum() which wants to know the number of elements when called, so we can't add elements once after we've called dev_add_param_enum(). Maybe a dev_add_param_array() has to be created whithout this limitation, but that's left for a future exercise. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | lib: fix coding styleDu Huanpeng2015-11-091-3/+3
|/ | | | | Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* logo: Makefile: remove debug outputSascha Hauer2015-10-151-1/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* logo: Kconfig: make BAREBOX_LOGO_* depend on BAREBOX_LOGOAntony Pavlov2015-09-141-0/+4
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/param'Sascha Hauer2015-09-011-4/+8
|\
| * param_enum: protect against invalid valuesSascha Hauer2015-08-261-2/+6
| | | | | | | | | | | | | | | | Since dev_add_param_enum is passed a pointer containing the actual value it can contain an invalid value. Protect against it so that we do not access invalid array elements. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * param_enum: Make name strings constSascha Hauer2015-08-261-2/+2
| | | | | | | | | | | | | | | | Not only the array containing the pointers should be const but also the strings themselves, so instead of using const char ** use const char * const *. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-09-011-3/+3
|\ \
| * | lib: libfile: Do not ignore errors in close()Andrey Smirnov2015-08-191-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | Some character devices may perform meaningful operations in their implementation of close() -- a good example would be socfpga.c which checks if the FPGA was programmed succesfully in it's close() method -- so ignoring return value of this call may cause false positives in checking exit status for success. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gui: implement blitting screen areasSascha Hauer2015-08-201-0/+19
| | | | | | | | | | | | | | So far we only supported blitting the whole screen from the shadow fb to the framebuffer. Add a function to blit areas. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gui: Use fb provided shadowfb for offscreen renderingSascha Hauer2015-08-201-17/+7
| | | | | | | | | | | | | | The fb core now has builtin support for offscreen rendering, use this and drop offscreen handling in the gui code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fb: return original fb_info in FBIOGET_SCREENINFOSascha Hauer2015-08-201-4/+2
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/logo'Sascha Hauer2015-08-066-0/+151
|\
| * Add new barebox logo to the treeSascha Hauer2015-07-206-0/+151
| | | | | | | | | | | | | | | | This adds the new barebox logo to the tree. This is added as svg image which is converted to different png images during build time. The logo can be found under /logo/barebox-logo-<width>.png in the running barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/fbcon'Sascha Hauer2015-08-0611-56/+11150
|\ \
| * | graphics_utils: Let fb_open allocate the screenSascha Hauer2015-07-203-35/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allocate the screen dynamically in fb_open. This opens the way to create a fb_create_screen function which takes a struct fb_info * instead of a filename. This is suitable for the framebuffer console which already has a struct fb_info *. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | fonts: Add 7x14 fontSascha Hauer2015-07-204-0/+4125
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | lib/fonts: add "MINI4x6" fontAntony Pavlov2015-07-164-0/+2164
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | import lib/fonts framework from linux kernelAntony Pavlov2015-07-166-0/+4730
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | graphics_utils: add function to create pixel from rgb tripletSascha Hauer2015-07-161-6/+26
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | graphics_utils: Export get_pixelSascha Hauer2015-07-161-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_pixel converts a 32bit trgb color into framebuffer format. This is useful for other code aswell, so export it. Other functions in the graphics utils code use the name get/set_pixel aswell, but instead of converting data they get a pixel from the framebuffer or set a pixel on the framebuffer. To separate from these rename the function to gu_hex_to_pixel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | graphics_utils: Add function to invert an areaSascha Hauer2015-07-161-0/+19
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | gui: Fix typo in function nameSascha Hauer2015-07-152-2/+2
| | | | | | | | | | | | | | | | | | It's a render buffer, not a redering buffer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | graphic_utils: Add a common namespace to functionsSascha Hauer2015-07-153-14/+14
| |/ | | | | | | | | | | | | This adds a common namespace to the graphic functions. We use gu_ for graphic_utils. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | xfuncs: add wrapper for wchar strdup functionsMichael Olbrich2015-07-231-0/+31
| | | | | | | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | xfuncs: add xasprintf() and xvasprintf()Michael Olbrich2015-07-231-0/+24
|/ | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2015-07-032-1/+23
|\
| * xfuncs: import xstrndup() from busyboxMarc Kleine-Budde2015-06-181-0/+22
| | | | | | | | | | | | | | | | This function is needed for the fixed length string feature in the state framework. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>