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
|
2015-01-13 |
console: allow to specify the device id
...
so we can use dynamic number id with specific devname
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 13 Jan 2015
Sascha Hauer
committed
on 13 Jan 2015
|
2014-12-17 |
console: Add set_active callback
...
The netconsole needs to be able to deny activation when the network
has not been enabled. Add an optional callback to the console for
this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Dec 2014
|
2014-08-07 |
Merge branch 'for-next/efi'
...
Conflicts:
.gitignore
Makefile
drivers/serial/Makefile
Sascha Hauer
committed
on 7 Aug 2014
|
2014-07-11 |
console: Allow persistent device names
...
Add a devname field to struct console_device so that the device
name can be set by the driver. This makes it possible to have
persistent device names.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Jul 2014
|
console: Add puts callback to console devices
...
Some devices may have a much more efficient way to output strings
rather than single characters. Let console devices implement a
callback for this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Jul 2014
|
2014-01-22 |
console: Set Linux console parameter automatically
...
Linux specifies the linux,stdout-path property in the /chosen node
in the devicetree. Unfortunately this is ignored in most cases.
For cases in which barebox uses this property for its own use we
translate this into a Linux boot arg with:
- the console name provided by the serial driver
- the the instance from the 'serial' alias
- the baudrate from the actual baudrate.
So with this it's for devicetee enabled boards no longer necessary
to manually assign a console= parameter. Should a user not want
to use the automatically assigned parameter it should do:
global.linux.bootargs.console=
in the environment.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Jan 2014
|
2013-11-08 |
treewide: Add missing includes
...
A lot of files rely on include/driver.h including include/of.h (and
this including include/errno.h. include the files explicitly so we can
eventually get rid of including of.h from driver.h
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Nov 2013
|
2013-10-07 |
Merge branch 'for-next/login'
...
Conflicts:
include/console.h
Sascha Hauer
committed
on 7 Oct 2013
|
2013-09-21 |
console: drop f_caps and check the function pointer getc/putc instead
...
None of the driver make the difference between STDOUT and STDERR.
So we just need to check if putc or getc are filled in the console_device
save 32 bytes on versatilepb
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 19 Sep 2013
Sascha Hauer
committed
on 21 Sep 2013
|
2013-09-19 |
login: disable input console if password wrong
...
so we guarantee that barebox is secured again user interaction
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 16 Sep 2013
Sascha Hauer
committed
on 19 Sep 2013
|
2013-09-05 |
Merge branch 'for-next/omap'
...
Conflicts:
arch/arm/boards/pcm051/env/config
Sascha Hauer
committed
on 5 Sep 2013
|
rework debug_ll
...
Convert to static inline functions and use lower case letters for function
names. Also, include mach/debug_ll.h when an architecture provides support
for debug_ll, not only when it's actually enabled. This allows architecures
to put some UART initialization code into mach/debug_ll.h which is compiled
out when debug_ll is disabled.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 5 Sep 2013
|
2013-08-26 |
console: fix console without CONFIG_PARAMETER
...
If CONFIG_PARAMETER is not set, dev_set_param() does not call the setter
function. Call it directly instead in this case.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Jan Luebbe
authored
on 15 Apr 2013
Sascha Hauer
committed
on 26 Aug 2013
|