2020-04-27 |
treewide: remove references to CREDITS
...
The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97
("Remove the CREDITS file"). Remove references to it from several files.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Uwe Kleine-König
authored
on 23 Apr 2020
Sascha Hauer
committed
on 27 Apr 2020
|
2019-10-14 |
console: disallow opening for writing when no write method defined
...
Some consoles, like the input console (usually /dev/cs0), don't feature
a puts or putc callback. Trying to echo out of them would thus crash:
barebox@Embest MarS Board i.MX6Dual:/ echo -a /dev/cs0
prefetch abort
pc : [<00000004>] lr : [<4fd05071>]
WARNING: [<...>] (fops_write+0xd/0x10)
WARNING: [<...>] (devfs_write+0x21/0x2a)
WARNING: [<...>] (__write+0xcb/0xf0)
WARNING: [<...>] (write+0x2d/0x68)
WARNING: [<...>] (dputc+0x31/0x34)
WARNING: [<...>] (do_echo+0xcb/0x144)
Fix this by only allowing open(.., O_WRONLY) or open(..., O_RDWR) when
puts is defined. Consoles defining putc are covered by this as well as
those have putc-calling __console_puts assigned as their puts when they
are registered. Now echo -a /dev/cs0 would yield:
open: Operation not permitted
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Ahmad Fatoum
authored
on 20 Sep 2019
Sascha Hauer
committed
on 14 Oct 2019
|
2019-09-09 |
console: set default console_device devname
...
Some commands (loadb/x/y) rely on console_get_by_name, which searches the list
of console devices based on console_device->devname. However, some serial
drivers do not set devname, meaning that their respective console_devices can
never be found. During console_register, ensure that a default devname is set
if one is not already explicitly set.
Signed-off-by: David Dgien <dgienda125@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
David Dgien
authored
on 8 Sep 2019
Sascha Hauer
committed
on 9 Sep 2019
|
2019-09-02 |
console: fix out-of-bounds read in dputc(/dev/*, ...)
...
Trying to output a single character via
echo -a /dev/serial0-1
currently results in garbage output after the newline, because console.c's
fops_write discards the buffer length and passes the buffer to
(struct cdev)::puts which only handles NUL-terminated strings.
Fix this by amending (struct cdev)::puts with a new nbytes parameter,
which is correctly propagated. All this functions now return at most the
nbytes parameter they were passed in. This fixes __console_puts, which
used to count new lines twice in its return value.
Fixes: b4f55fcf35 ("console: expose consoles in devfs")
Cc: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Ahmad Fatoum
authored
on 23 Aug 2019
Sascha Hauer
committed
on 2 Sep 2019
|
2019-08-05 |
console: return number of characters written in fops_write
...
struct cdev_operations write() callback is supposed to return the number
of characters written. Do this instead of returning 0 for the console
device files.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 5 Aug 2019
|
2019-04-24 |
console: forbid ctrlc during startup
...
When global.autoboot_abort_key is set to ctrl-c then the user is
expected to press ctrl-c to get to the prompt. The user might press
ctrl-c before the init script runs the "timeout" command. In this
case the init script is aborted at arbitrary places which leads to
inconsistent results depending on the place it is aborted.
This patch introduces the global.console.ctrlc_allowed variable.
When this variable is set to false ctrl-c is ignored entirely.
The variable is set to false by default and changed to true in
the init script.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 24 Apr 2019
|
Shell: Handle aborting loops better
...
It's easy to get stuck in an infinite loop in the hush shell:
while true; do sleep 1; done
The 'sleep' command will check for ctrl-c with the ctrlc() function. This
will abort the sleep command. Hush then checks for ctrl-c again in the
loop. The ctrl-c in the buffer has already been eaten by the sleep
command, so the loop will continue.
With this patch we remember the presence of a ctrl-c character in a
variable instead of checking for a new character each time. The
variable must be resetted explicitly by calling ctrlc_handled() which
will be called by the shell in the outer loop.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 24 Apr 2019
|
2018-10-18 |
drivers: Introduce dev_set_name()
...
Introduce dev_set_name() in order to hide implementation details of
setting device's name so it'd be easier to change it.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 16 Oct 2018
Sascha Hauer
committed
on 18 Oct 2018
|
2018-07-09 |
Merge branch 'for-next/dts-warnings'
Sascha Hauer
committed
on 9 Jul 2018
|
2018-06-19 |
console: remove duplicate newline conversion
...
When the console is not yet fully initialized then console_puts falls
back to print characters using console_putc. console_putc already
does newline conversion, so do not repeat it in console_puts.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 19 Jun 2018
|
console: add missing newline conversion for putc_ll
...
putc_ll doesn't do newline conversion (and it shouldn't do, as it's
a static inline function for early debugging, adding more code there
is not nice), so add newline conversion to the console code when
it uses putc_ll for printing early messages.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 19 Jun 2018
|
console: Update description for global.linux.bootargs.console
...
Replace linux,stdout-path with stdout-path as the former is deprecated.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 19 Jun 2018
|
2018-04-17 |
console: Add simplified 'serdev' framework from Linux kernel
...
Port 'serdev' UART-slave deivce framework found in recent Linux
kernels (post 4.13) in order to be able to port 'serdev' slave drivers
from Linux.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 12 Apr 2018
Sascha Hauer
committed
on 17 Apr 2018
|
2017-04-11 |
param: make parameter functions more consistent
...
This patch creates a consitent set of device parameter functions.
With this we have: dev_add_param_<type><access>
"type" is one of: int32, uint32, int64, uint64, string, mac, ipv4, enum, bitmask
The improvement here is that we now can exactly specify the width of the
int type parameters and also correctly distinguish between signed and
unsigned variables which means that a variable no longer ends up with
INT_MAX when it's assigned -1.
"access" can be empty for regular read/write parameter, "_ro" for readonly
parameters which get their value from a variable pointer in the
background or "_fixed" for parameters which are set to a fixed value
(without a pointer in the background).
Some more exotic types are not (yet) implemented, like
dev_add_param_ip_ro.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Apr 2017
|
console: Use dev_add_param_string
...
dev_add_param_string allows to pass a priv * so that the device_d *
argument is not needed and can be removed later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Apr 2017
|
2017-03-29 |
console: fix usbserial re-connect
...
With commit b4f55fcf355a ("console: expose consoles in devfs") consoles
got inserted, but never removed from devfs.
When dealing with USB consoles, barebox should be prepared for devices
spontaneously appering and disappering again (user disconnects and re-
connects the cable). If the devfs entry is not removed upon disconnect,
barebox will raise an error "device creation failed with File exists"
when the cable is connected again.
Remove devfs entries when consoles are de-registered.
Also change the error message, it's the devfs entry.
Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Alexander Kurz
authored
on 26 Mar 2017
Sascha Hauer
committed
on 29 Mar 2017
|
2017-03-13 |
fix: console: expose consoles in devfs
...
on 64bit ssize_t is not an int but a long
so use the protype for fops_write ssize_t
common/console.c: In function ‘console_register’:
common/console.c:373:22: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
newcdev->fops.write = fops_write;
in commit b4f55fc
By Bastian Stender <bst@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Jean-Christophe PLAGNIOL-VILLARD
authored
on 10 Mar 2017
Sascha Hauer
committed
on 13 Mar 2017
|
2017-02-28 |
console: expose consoles in devfs
...
This enables displaying text on e.g. a framebuffer console by issueing
echo -o /dev/fbconsole0 abc123
Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Bastian Stender
authored
on 28 Feb 2017
Sascha Hauer
committed
on 28 Feb 2017
|
console: replace set_active by open/close
...
Opening and closing consoles should be independent from setting them
active. This way it is possible to open e.g. a framebuffer console and
display text on it without showing stdout/stderr.
Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Bastian Stender
authored
on 28 Feb 2017
Sascha Hauer
committed
on 28 Feb 2017
|
2016-05-26 |
console: Fix initial value of baudrate parameter
...
The 'baudrate' parameter has the wrong value initially, it has to
be set to CONFIG_BAUDRATE. Otherwise a devinfo shows a baudrate of 0
until actively changed.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 May 2016
|
2016-04-15 |
stdio: Replace FILE functions with filedescriptor functions
...
We have defined stdin, stdout and stderr as integer file descriptors,
but normally they should be FILE *. Also fprintf, fputc and fputs take
file descriptors instead of FILE *. As FILE * are inconvenient in the
barebox environment replace the f* functions with the corresponding d*
functions. dprintf is POSIX conform whereas dputc and dputs are barebox
specific, but do not conflict with any stdc function. fgetc is unused
and can be removed without replacing it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Apr 2016
|
stdio: rename getc to getchar
...
The function we have implemented as getc has the semantics of the
standard function getchar, so rename it accorgingly.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Apr 2016
|
string: Fix (v)asprintf prototypes
...
Our asprintf and vasprintf have different prototypes than the glibc
functions. This causes trouble when we want to share barebox code
with userspace code. Change the prototypes for (v)asprintf to match
the glibc prototypes. Since the current (v)asprintf are convenient
to use change the existing functions to b(v)asprintf.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Apr 2016
|
2016-01-18 |
barebox remote control
...
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>
Sascha Hauer
committed
on 18 Jan 2016
|
2015-11-17 |
console: Set baudrate during registration
...
This makes sure that the cdev->baudrate field is always consistent with
the hardware state.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Nov 2015
|
2015-08-28 |
login: rework login mechanism
...
We used to have the login functionality in the /env/bin/init script.
This is hard to review and it's too easy to break the login functionality
with changes to this script. Move the places to ask for a password to
C code where we have only a few places where we have to ask for a password.
Mainly these are run_shell() and the menutree command.
This patch introduces a login() function which will only return if the correct
password has been entered. Following calls will return immediately without
asking for a password again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 28 Aug 2015
|
2015-07-23 |
console: When deactivating a console, flush it first
...
Otherwise the last characters may not be sent before deactivating
a console.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Jul 2015
|
2015-06-09 |
console: When switching baudrate print console name
...
Since there may be multiple consoles print the name of the console
whose baudrate shall be switched.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Jun 2015
|
console: Add functions to get/set baudrate
...
So C code can call a function rather than fiddling with device parameters.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Jun 2015
|
console: Add functions to get/set active state of console
...
Currently code needs to fiddle with the active parameter of a console
device directly to enable/disable consoles. Add console_set_active()
to set the status and console_get_active() to get the current status.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Jun 2015
|