9
0
Fork 0
Commit Graph

6780 Commits

Author SHA1 Message Date
Jean-Christophe PLAGNIOL-VILLARD 7e88b6c7f1 complete: fix duplicate env eval list
this can be reproductable by this sequence

barebox:/ <TAB>
.                  ?                  [                  addpart
bootm              cat                cd                 clear
cp                 cpuinfo            crc32              delpart
devinfo            dhcp               echo               edit
erase              ethact             exit               export
false              getopt             go                 help
host               loadb              loadenv            loady
login              ls                 md                 md5sum
memcmp             memcpy             meminfo            memset
menu               mkdir              mount              mtest
mw                 nfs                passwd             ping
printenv           protect            pwd                readline
reset              rm                 rmdir              saveenv
sedit              sh                 sha1sum            sha256sum
sleep              source             test               tftp
time               timeout            true               umount
uncompress         unprotect          version            net.nameserver=
net.domainname=    cs0.baudrate=      cs0.active=        cs1.active=
cs1.ip=            cs1.port=
barebox:/ $<TAB>
$net.nameserver     $net.domainname     $cs0.baudrate
$cs0.active         $cs1.active         $cs1.ip
$cs1.port           $net.nameserver     $net.domainname
$cs0.baudrate       $cs0.active         $cs1.active
$cs1.ip             $cs1.port
barebox:/ $

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-03 20:11:51 +02:00
Sascha Hauer ce38019845 Merge branch 'next'
Conflicts:
	common/hush.c

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-03 20:10:13 +02:00
Sascha Hauer 71fadbafe2 Release v2012.05.0
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-03 09:39:33 +02:00
Sascha Hauer 61eb23d44e uimage/file_to_sdram: fix resource allocation
file_to_sdram is used to load an initrd. The resource size is
then used to pass the initrd size to Linux. This means that
the resource size must exactly match the initrd size. Currently
this is not the case since we request the sdram region in chunks
of 8 Kbytes. Fix this by adjusting the resource size when the file
is loaded.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 10:37:52 +02:00
Sascha Hauer ebde5ae5ac hush: bail out of scripts on syntax error
On a systax error we have to bail out of the shell instead of
setting inp->p to NULL and crash barebox with a NULL pointer
deref. This only happened in scripts.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

This fixes the problem I had (i.e. a boot loop caused by a stray fi in
/env/bin/init).

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2012-05-02 10:37:33 +02:00
Renaud Barbier bd20ba6798 Preparation stage to support multiple PPC architectures
arch/ppc/Kconfig is reworked to make the configuration environment
architecture neutral. All MPC5200 configuration is moved to the
MPC5200 architecture specific configuration file. These modifications
are reflected in the PCM030 board support.

arch/ppc/Makefile compilation directives are updated in preparation
for the introduction of future cpus/machines.

lib/time.c is moved to the architecture specific directory and the
building instructions updated in the Make files. The file is
cleaned up of unused code.

The definition of L1_CACHE_... is updated and CACHELINE_SIZE is
defined in ppc/include/asm/cache.h for future use by the mpc85xx.
The file mach-mpc5xxx/pci_mpc5200.c and mach-mpc5xxx/start.S are
updated accordingly.

The declaration of search_exception_table is moved in
include/asm/common.h because it is used across architectures.
mach-mpc5xxx/traps.c is also updated to reflect this change.

The definition of exception in asm/ppc_asm.tmpl is updated for future
use by the mpc85xx. The file starts.S in mach-mpc5xxx is updated
accordingly.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 10:16:30 +02:00
Sascha Hauer 84aec66a83 ppc mmu.h: update for future mpc85xx support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 10:16:04 +02:00
Sascha Hauer 9527058c81 ppc processor.h: Update for future mpc85xx support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 10:12:57 +02:00
Sascha Hauer 608a9633e4 ppc: add clr/setbits operations
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 10:09:49 +02:00
Sascha Hauer 272704fcf3 ppc: Add fls, fls64, __ilog2_u64 and ffs64 bitops
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 10:09:22 +02:00
Jean-Christophe PLAGNIOL-VILLARD d5d96ca6c3 complete: eth typo fix
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 09:36:26 +02:00
Sascha Hauer deadc3dd7e bootm: fix initrd handling
bootm_initrd tests for data->initrd, but this never becomes true because
the setting of data->initrd is inside a if(bootm_initrd()). Fix this. Also,
do not support the initrd options when initrd is disabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 08:42:41 +02:00
Sascha Hauer e4e3fbd22b improve complete support
The following patch serie improve the complete support
 by adding a complete framework to aalow commands complete support.
 
 The add also car complete support for eval and setting and executable
 file support
 
 This also include an update of the stringlist API to support asprintf
 API
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPnohsAAoJEOrjwV5ZMRf2qeIQAIC7WrIao0mB2pIB+51MqeU+
 sof7GLxUl0MWXFFc3OFEHDcY5grC867mBmB9+uDG1mvcxa/bUpw+jMRMrki5j4Kg
 mjaHQ2UCvDjMHqQi7ISc/WTyJb09mtduFIceP0EftAmG8Mb5n9XOMaKwL9r/UQHB
 ps9MijnI/QeFqbrmBZcuaCp59QsPvipYw8NMJITBu2VvWrpKTIox33qPfNATDuEV
 SzMoLwz+uD7W7dEAM/A1uFdo4K5fLyZruDVGQoQ8CRS+zW3E6rr/EakpN5mhr/66
 dVZYO1xWppBaefIJQ1RD6bvwlFvesuuvQmMtDxsCsp07fyBolEWfFzblrwdkbueY
 NPwWExV5nzbRdAKKSyhU/nHiQ2edOQQZtHDAbnM4zh5e6lK7YLrzVklzT4Dfhzn0
 GRdnjCmiQiaZdmAEHe8wte2nr3Lc01fTsj/EFVA+LYP3a9by1iG2Zn3/ChieVcN4
 R+o/2lMBdhxsTszcmwMOemdqVPlt/0VmEXrKGtjTIZEViuQyyhY8ZtEaf4C0zeln
 Jf60t0ZvkehAJc0Lo4UOygjzvErqcKoHMk7utAjP+bi1KcMgF3Q+HmtCnJJs2FHw
 c40FZj1WcLPStEiS1way7miBakxOy2zPumKi1OXx+140L25C1nvQPYu8ilOZHEyU
 opNlo+wQ8h5sG/054kYL
 =rYfw
 -----END PGP SIGNATURE-----

Merge tag 'complete_update_support' of git://git.jcrosoft.org/barebox into next

improve complete support

The following patch serie improve the complete support
by adding a complete framework to allow commands complete support.

The add also car complete support for eval and setting and executable
file support

This also include an update of the stringlist API to support asprintf
API
2012-05-01 21:41:59 +02:00
Sascha Hauer 8ca42643d4 Mips: malta add cfi flash support
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPnoKmAAoJEOrjwV5ZMRf2XHgP/RJ4UhuI6wGQt00bNIg1mrTP
 AXe3FNNReWbq4zlnOAA1CJujbU4kMhviSg8bP+KTSeM7QAgqbTGf7akXNWGXF4Zi
 9jqIBIlaWADEglMT9gpieOsG1lqpdahWWOhbJHRjCIFzRqr6ZuqpEPR20m9gTofU
 gRaNqxYrKY9b3CHe5/7AeIuMtm36wmdSXOuxNHYT7jPMWetVMx+CPgB71qFcMck+
 IXEl+0Q6u+MfwFCWj7vuQOtNjFJ595taEnOZR3m8Idbh1NOjwrgk+K3M452VV3Th
 LgvYHgORCjppmouZNJvogXGkoqp6B/pcFC9SBZnTbnKC6VdlMk8H3WZoX2NfET55
 sAAXjQEmArX9hcsObAjGb0+3gFsDEqfou+oxp6aI0K1yNLbpBAnry6fQNc9sWqsS
 7znKpQGrgRNjvqY9OyqYDoe6KPMuTn0DY9y1vv9WTemuKPIjXpkScdkWKluhXW/z
 48UEeFesRveSwcWdWKioB3p2QpRXSC1EIuX0HARBaHjMfyWF2GpPtDnLrkFGNemD
 EkEYuoUJXqf2T1f25OMvNvnDKAD7fdKx0i4IoJRNgwumN1upoVVEKg1QYjzpuRS+
 +ForHYeev4K/ylnqgCFV2PCu3Ynyxw586+tSK41JvYRkaJ7pKj0bEjIvrisG1qc1
 pR+jNzspmp8BgSyiyggD
 =caR0
 -----END PGP SIGNATURE-----

Merge tag 'malta-cfi-flash' of git://git.jcrosoft.org/barebox into next

Mips: malta add cfi flash support
2012-05-01 21:41:13 +02:00
Sascha Hauer 61269bd7c6 bootm: fix initrd handling
bootm_initrd tests for data->initrd, but this never becomes true because
the settingof data->initrd is inside a if(bootm_initrd()). Fix this. Also,
do not support the initrd options when initrd is disabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-01 21:40:41 +02:00
Sascha Hauer 4023588064 Merge branch 'pu/assorted' into next 2012-05-01 21:40:07 +02:00
Sascha Hauer 73f76d6b45 Merge branch 'work/hush' into next 2012-05-01 21:39:30 +02:00
Sascha Hauer 55d88805ed Master Fixes
usb driver name (driver_d)
 
 Menu fixes
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPl9TDAAoJEOrjwV5ZMRf24wEP/2fTLxK0JpnxcqurzOV7lySQ
 xZQLU4PoQDilYoZBlsAleyIifeeU1w2fA6mrvAE3aN822225S1pqDLNTEQBo/GRZ
 hbLACOHkpw8VbJ5PmmxXYx6m6+lGMNrAltYPks6C1m/0SdIQGfHk+YjcaucpZGnU
 CwUDS7ZMDRQo+gXNMMjVFpC0DCHVwlBpkedGXxAArrcr1wx3NAyKzapymUQtPplj
 A4NtDpFhoCyVIffZs61qIppLxx8D/9zR+nZUhULAD/3px4mnBt771X0OxY9ngzik
 YmV0VU9C1w1LRlArKIvt+CQQZ84Plks7hekrVIMPIVB15v5unNDTxlQqJvRJw+Oy
 UZGt8z2nDbcMPx1viz6G877/Aa3EmN16O1/1+U20IPVsXbfB6k1wNXJ8t96HSgLD
 WV1KhmxoXfSASQr6INBRCtmnQ9/mfbXRci6i7CfAOh01YoVWG/xlpPl7iagFk/Cl
 xa6R+Ym71bRQnkhVffLseb9/bWuxzm+LH3aom6TMHV9N3PnztuqiM+q0VcbPkIL4
 7ip29YoGV5WoV9Wf2oJKABGWADLxbFXUso++fcdWtmrTX7AVOkWjz+VQvITmDfAM
 iXM1e2Kwgi/uaAZMP3GDxrkvZwtj5UXc0SakGJJyMJ1v4GhWhlI7db05LR4bGfR5
 AyHRr4OvyQid4YFA366I
 =/CNm
 -----END PGP SIGNATURE-----

Merge tag 'j-master-fixes' of git://git.jcrosoft.org/barebox

Master Fixes

usb driver name (driver_d)

Menu fixes
2012-04-30 15:11:08 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9492976bc8 complete: add executable file support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD 7e3a16ef14 complete: add delpart complete support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD c43a087718 complete: add go and sleep support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD b7fc51bd79 complete: add eth interface complete support
use it on ethact

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD 8e6f45f54f complete: add empty complete support
for cpuinfo, clear, dhcp, false, login, lsmod, meminfo, passwd, pwd, reginfo,
reset, true, usb, version

for mach-imx and mach-mxs: dump_clocks
for u_serial: mycdev

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD 8aa463f785 complete: add help complete support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:39 +08:00
Jean-Christophe PLAGNIOL-VILLARD 1fa17ad5d4 complete: add device name complete support for devinfo
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:34 +08:00
Jean-Christophe PLAGNIOL-VILLARD 9dfb0030ee complete: add generic command complete framework
introduce generic command specific complete callback

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:29:50 +08:00
Jean-Christophe PLAGNIOL-VILLARD c3d60e6df3 complete: add var and device param complete support
with $xx or xx= or if device $xx.yy or xx.yy=

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:22:24 +08:00
Sascha Hauer f152f6a770 stringlist: implement string_list_add_asprintf
Useful for allocating a string list entry on the fly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:22:23 +08:00
Sascha Hauer 34faa2e7ca stringlist: use seperately allocated string
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>
2012-04-30 20:22:23 +08:00
Jean-Christophe PLAGNIOL-VILLARD 37a97ca3fc qemu-malta: add nor flash support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:16:28 +08:00
Jean-Christophe PLAGNIOL-VILLARD fcd65ca321 qemu-malta: rename serial.c to init.c
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>
2012-04-30 20:09:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD 7136dab1f2 mips: add in_be16/32 and out_be16/32 for cfi support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:09:05 +08:00
Antony Pavlov 6b489256ee Makefile: add barebox.srec to 'clean'
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 14:01:34 +02:00
Juergen Beisert 72a1bc9d95 netX: don't bother with variable sizes, use the intend
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 13:45:55 +02:00
Juergen Beisert 9e5d1aab6d netX: XPEC firmware is always of attribute const
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 13:45:55 +02:00
Juergen Beisert 79dc70c9ea netX/network: fix debug outputs
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>
2012-04-30 13:45:55 +02:00
Michael Trensch eecbcafa3f netX: UART may not initialize correctly.
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>
2012-04-30 13:45:55 +02:00
Juergen Beisert 3231710c52 netX: unify the device registration
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 13:45:55 +02:00
Juergen Beisert a54d366e04 netX: add a few base addresses for non on chip devices
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 13:45:55 +02:00
Jaccon Bastiaansen 8cd566f187 Increase heapsize for i.MX21ADS board again.
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>
2012-04-30 13:43:18 +02:00
Sascha Hauer e652753f95 tlsf_malloc: return valid pointer for malloc(0)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 13:31:29 +02:00
Sascha Hauer cac75c0f23 dhcp: set start time
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>
2012-04-30 13:28:56 +02:00
Sascha Hauer 47f8cf2d08 remove dlmalloc.src
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 13:28:36 +02:00
Sascha Hauer b2c48771cb edit: Add proper screen size handling
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>
2012-04-30 13:24:47 +02:00
Sascha Hauer c3822d7aaf defaultenv: remove now unnecessary hush-hack
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 13:08:55 +02:00
Sascha Hauer e21a340e39 hush: allow to run interactive shell in do_sh
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>
2012-04-30 13:08:55 +02:00
Sascha Hauer f034ed2044 hush: Fix globbing
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>
2012-04-30 13:08:55 +02:00
Sascha Hauer cace82b597 glob: activate GLOB_NOCHECK flag
Needed for hush.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 13:08:55 +02:00
Sascha Hauer f4762eb5e7 hush: pass GLOB_NOCHECK to glob
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>
2012-04-30 13:08:55 +02:00
Sascha Hauer 87681170f5 hush: simplify globhack
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>
2012-04-30 13:08:54 +02:00