Allocate the string in string list seperately instead of
embedding a zero length string into struct stringlist.
Besides looking cleaner this allows us to implement a
string_list_asprintf.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
as the garbage collector will remove the empty function and the
add_ns16550_device is a empty inline if the driver is not enabled.
This will simplify add device adding.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
If DEBUG is defined it fails due to wrong variable names
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The netX internal UART latches register settings and internally uses
them only if written in the correct order. Other orders may work, but
sometimes the UART gets stuck, as the baudrate has not correctly been
set.
Signed-off-by: Michael Trensch <MTrensch@gmail.com>
Acked-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Barebox cannot boot the recent mainline Linux kernels for the
i.MX21ADS board anymore when using TFTP, because the heap is too
small.
Signed-off-by: Jaccon Bastiaansen <jaccon.bastiaansen@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The dhcp command starts with an unitialized start time. The start
time is often long in the past which results in an immediate timeout
and resend of the dhcp packet. Fix this by initializing the start time
correctly.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We used to have a quite slow algorithm to detect the screen size
which was unused for long time. This patch changes this to first
set the cursor to x=999, y=999 and the read back the actual cursor
position. Since I am not confident that this works on all terminals
this is only used when edit is called as 'sedit'.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This allows to call 'sh' in scripts without arguments in which
case an interactive shell will be started.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
hush has a long standing and anoying glob bug. hush expands wildcards
during parsing of the script or command stream. When the command stream
begins to execute the wildcards are already expanded which leads to:
mkdir /tmp
cd /tmp
mkdir foo; ls *
ls: *: No such file or directory
To fix this expand wildcards right before executing the command. Since
'for' loops are not executed in commands, we have to keep the old behaviour
in here so that 'for i in *' still works.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
By doing so glob will not return GLOB_NOMATCH anymore but instead
just does what fake_glob would do.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
hush used to escape '*' '[' '?' during parsing because the quotes
got removed in the first parsing loop.
globhack is used to remove these escapes again for glob. Since we now
keep the quotes until the end of parsing and we no longer escape glob
wildcards, we do no longer have to remove any quotes. With this globhack
can be much simpler.
While at it, change the prototype to match the one from glob() and rename
the function to fake_glob, because that's what it is: it just copies the
input string into the output struct without actually globbing.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
hush removes the quotes from strings too early. This leads to some bugs.
When hush executes
echo "hello sascha"
it correctly results in:
argv[0] = "echo"
argv[1] = "hello sascha"
However, the following behaves incorrect:
a="hello sascha"
echo "$a"
results in:
argv[0] = "echo"
argv[1] = "hello"
argv[2] = "sascha"
This is because hush removes the quotes and inserts variable values in a
single loop, so
echo "$a"
becomes:
echo hello sascha
after the loop.
Instead, keep the quotes until all variables are inserted and remove them
at the end.
This also fixes that echo \" resulted in \" instead of ".
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
General coding style cleanup
- add some blank lines
- add whitespaces on on both sides of operators
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The MD2 add:
- uart 2
- ethernet
- usb
- spi
- i2c
so fix just add uart and ethernet
update defconfig
always enable the motherboard and drop the SHA256 support (to fix in the
256KiB).
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Instead of directly accessing the struct member of struct param_d
use the provided getter function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Some phys need board specific fixups. To be able to do this
from board code add mii_open/mii_close functions so that the
board can use the regular mii_read/mii_write functions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Currently only 100Mb/s is tested. Freescale's U-Boot suggests that
there are some additional adjustments necessary for Gigabit support.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>