9
0
Fork 0
Commit Graph

7091 Commits

Author SHA1 Message Date
Steffen Trumtrar bf5eb000b3 commands: add msleep command
Add a command to sleep for n milliseconds.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:47:04 +02:00
Steffen Trumtrar f2bfcf98a1 common: fix typo cammand_var_complete
Change function name to command_var_complete in all calls and its declaration.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:47:04 +02:00
Alexander Shiyan 2b0aa00921 i.MX51: Added support for "clko" command
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:55 +02:00
Alexander Shiyan 9ec34264f0 i.MX clko: Added support for more than one CLKO outputs
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:55 +02:00
Alexander Shiyan 3e2ed9423f I.MX clko: Using strtol function instead strtoul for getting argument for clko source
This change is necessary because valid source argument for the clko command
can be negative.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:55 +02:00
Sascha Hauer 40faf584cd USB ehci: rework cache handling
We do not need to invalidate the cache in the poll loop anymore
since the corresponding bit is now in a dma coherent area. Instead,
flush cache before hardware operation and invalidate afterwards. Put
the corresponding code inline since it's shorter.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 527772ca0e partition: Use dma_alloc for allocating buffers
Drivers may use dma to transfer blocks, so put them into
dma save memory.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 9895357a71 block: use dma_alloc to allocate buffers
Drivers may use dma to transfer blocks, so put them into
dma save memory.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 9ca0e573af USB storage: use dma_alloc where appropriate
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 787fa164dd USB ehci: put fields of struct qTD directly into struct QH
This allows us to extend struct qTD with non hardware specific
fields.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 0128d99352 USB ehci: Use dma coherent buffers for qh/qtd
There's no point in syncing them manually. Instead, use
dma_alloc_coherent and skip the manual flushing/invalidating.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 0c35d2210e USB core: Allocate tmpbuf using dma_alloc
This needs to be dma save.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 95aea88175 USB core: device descriptor using dma_alloc
The device descriptor needs to be dma save.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer fc52e7e480 USB core: allocate setup_packet using dma_alloc
The setup packet needs to be dma save.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 887c7d5c38 USB gadget: Fix dma memory allocations
This is another variant of:

    USB gadget fsl: request cacheline aligned buffer

    The fsl udc driver allocates a buffer for small requests. The
    driver then calls dma_inv_range later on it. This buffer happens
    to be not cacheline aligned which means that a dma_inv_range can
    corrupt other memory around the buffer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
[mkl: use dma_alloc]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 3f7987af96 USB gadget fsl: request cacheline aligned buffer
The fsl udc driver allocates a buffer for small requests. The
driver then calls dma_inv_range later on it. This buffer happens
to be not cacheline aligned which means that a dma_inv_range can
corrupt other memory around the buffer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
[mkl: use dma_alloc]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Marc Kleine-Budde f98ebf91d6 ARM mmu: add dma_alloc
dma_alloc() allocates memory aligned to cache lines. We have to use
cache line aligned buffers if a driver calls dma_inv_range on the
buffer.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Marc Kleine-Budde 74b3f12a25 nios: add dma_alloc, asm/dma.h
This patch add dma_alloc to existing dma-mapping.h. On nios the mem is
aligned to D_ACHE_LINE_SIZE.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Marc Kleine-Budde ed2180d658 blackfin, mips, openrisc, ppc, sandbox, x86: add generic dma_alloc, dma_free inlines
Some drivers call dma_inv_range() on buffers, on arm these buffers must
be cache line aligned. This patch introduces a generic dma_alloc,
dma_free. Archs can implement in their own functions in "asm/dma.h" and add a:

	#define dma_alloc dma_alloc
	#define dma_free dma_free

On all other archs the generic versions, which translate into xmalloc
and free are used.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Marc Kleine-Budde 76df95bde1 ARM mmu: don't use CONFIG_MMU to disable mmu code, there are static inline versions
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:24 +02:00
Alexander Shiyan fe25781a1b ARM: initial ConnectCore® i.MX51 board support
This patch adds support for ConnectCore® i.MX51 board from Digi International.
A separate option includes support for debugging board for this module.
Some code taken from the bootloader U-Boot and patch from Digi.
Functional of Ethernet not tested yet.

barebox 2012.05.0-00316-g4024d9c-dirty #0 Wed Jun 6 13:08:25 MSK 2012

Board: ConnectCore i.MX51
Module Variant: i.MX515@600MHz, PHY, Acceleromter (0x0b)
Module HW Rev : 02
Module Serial : B111156789
mc13xxx-spi@mc13xxx-spi0: Found MC13892 ID: 0x0045d0 [Rev: 2.0a]
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit)
Bad block table found at page 131008, version 0x01
Bad block table found at page 130944, version 0x01
nand_read_bbt: Bad block at 0x00ce0000
nand_read_bbt: Bad block at 0x05bc0000
nand_read_bbt: Bad block at 0x0bc40000
ehci@ehci0: USB EHCI 1.00
detected i.MX51 rev 3.0
imx-esdhc@mci0: registered as mci0
imx-esdhc@mci1: registered as mci1
Malloc space: 0x95f00000 -> 0x97efffff (size 32 MB)
Stack space : 0x95ef8000 -> 0x95f00000 (size 32 kB)
envfs: wrong magic on /dev/env0
no valid environment found on /dev/env0. Using default environment
running /env/bin/init...

Hit any key to stop autoboot: 3
barebox@ConnectCore i.MX51:/

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:12 +02:00
Alexander Shiyan 68b32be492 i.MX51: Synchronize iomux header file from kernel
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:12 +02:00
Alexander Shiyan 488dc91f93 Added "/dev/full" and "/dev/null" devices
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:01 +02:00
Alexander Shiyan 0e4fdcc81b Move /dev/zero to separate unit
This patch allows to present "/dev/zero" always in system and not
depending  of mem-command. Standard files allow to test other memory
devices, not only "mem", such as NOR, NAND, MCI-devices e.t.c.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:01 +02:00
Sascha Hauer c5d53f0efd defaultenv-2 ifup: create network up state file for dhcp
We store the 'up' status of a network device in /tmp/network/$interface.
Create this file for dhcp aswell to prevent doing dhcp requests each
time ifup is called.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:45:46 +02:00
Sascha Hauer 52c31adcb0 defaultenv-2: remove global.tftp.path
This variable is set in /env/init/general and then used
in /env/boot/* which is a bit confusing. Also it does not
necessarily have to be a tftp path (could be nfs aswell).
Use a local variable in the scripts using it instead to make
the meaning a bit more clear.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:45:46 +02:00
Sascha Hauer d33909c5ed defaultenv-2: mount tftp server specified in $eth0.serverip
This is always the tftp server specified in /env/network/eth0,
this could be either the one returned from a dhcp request or
a manually specified one, but in the end it's always the right
one.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:45:46 +02:00
Sascha Hauer 2ac974b541 defaultenv-2 ifup: Always overwrite eth0.serverip
if serverip is specified, also overwrite eth0.serverip in dhcp
case. This makes it possible to specify a different serverip
when the dhcp server returns the wrong ip (because the DHCP
might be a DSL router which does not provide tftp).

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:45:46 +02:00
Juergen Beisert 7d6d7c42da ARM/MXS: add a watchdog driver for i.MX28
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 15:16:34 +02:00
Juergen Beisert 2928591eab Add a simple watchdog framework
This patch adds a simple wd command which can setup, trigger and stop a watchdog
on the platform.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 15:16:34 +02:00
Antony Pavlov c325d97cfd MIPS: XBurst: use clocks_calc_mult_shift() for JZ4755's clocksource
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 10:20:00 +02:00
Antony Pavlov dbf8340727 MIPS: XBurst: fix the JZ4755's clocksource input frequency value
The 40 KHz frequency value was used to parry
__lshrdi3() error on little-endian MIPS because
the __lshrdi3() function is used in clocksource code.

The true value of the JZ4755's external clock frequency is 24 MHz.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 10:20:00 +02:00
Antony Pavlov e172909335 clocksource: move the NSEC_PER_SEC constant to common header
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 10:19:58 +02:00
Sascha Hauer 1d8134c8d2 include/linux/time.h: remove dead code
include/linux/time.h contains several unused functions derived from U-Boot
code. Since this is a file under include/linux/ it should contain only code
from the kernel, so remove all this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 10:19:25 +02:00
Sascha Hauer 5be5521146 ARM at91sam9m10g45ek: Enable lzo decompression
This results in a binary size reduction since now the default
environment gets compressed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 10:06:35 +02:00
Sascha Hauer 85d099f89c ARM defconfigs: Use TLSF malloc on defconfigs getting too big
Several boards are getting bigger than their specified maximum binary
size of 256Kb. Enable the TLSF allocator for them which is smaller
than the original dlmalloc. The changed defconfigs are:

eukrea_cpuimx25_defconfig
eukrea_cpuimx35_defconfig
eukrea_cpuimx51_defconfig
usb_a9260_defconfig
usb_a9263_128mib_defconfig
usb_a9263_defconfig
usb_a9g20_128mib_defconfig
usb_a9g20_defconfig

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 10:06:31 +02:00
Sascha Hauer 1a5503118a blackfin: Add missing fls include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-28 13:49:17 +02:00
Sascha Hauer a13829742b x86: Add missing ffs and fls include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-28 13:49:17 +02:00
Sascha Hauer abbbe22b48 nios2: Add missing ffs and fls include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-28 13:49:16 +02:00
Sascha Hauer 21895e19f8 mips: Add missing ffs and fls include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-28 13:49:16 +02:00
Sascha Hauer 271bdffbcd openrisc: link to libgcc
To get symbols like __ashrdi3.

Franck started generating these symbols from gcc assembly, which seems
to be the cleaner approach. The simpler approach for now to get additional
symbols is to link in libgcc, which is the same as the kernel does.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Franck Jullien <franck.jullien@gmail.com>
2012-06-28 13:49:16 +02:00
Sascha Hauer e2e494bc02 blackfin: add __ashrdi3
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-28 13:49:16 +02:00
Sascha Hauer 51885a7d73 Change byte order detection mechanism to kernel style
The Linux Kernel defines only one of __LITTLE_ENDIAN and
__BIG_ENDIAN. Endianess can then be tested with #ifdef __xx_ENDIAN. Userspace
always defined both __LITTLE_ENDIAN and __BIG_ENDIAN and byteorder can then
be tested with #if __BYTE_ORDER == __xx_ENDIAN.

As we tend to use a lot of Kernel code in barebox we switch to use the kernel
way of determing the byte order.

As this always causes a lot of confusion add a check to include/common.h to
make sure only one of __LITTLE_ENDIAN and __BIG_ENDIAN is defined.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-28 13:49:16 +02:00
Sascha Hauer cdd4b4f075 dos partitions: enable disk size guessing only for bios disks
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-28 12:45:39 +02:00
Sascha Hauer ee3e50f23f net: Use dev_name directly
eth_get_byname uses a selfmade dev_name, use dev_name directly instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-28 12:45:27 +02:00
Sascha Hauer 01f8ce581b menu: factor out a function to print an entry
To save a few bytes of binary space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-28 12:45:19 +02:00
Sascha Hauer a6e358b2f5 drivers/base: bail out if request_iomem_region fails
When request_iomem_region fails we have to bail out instead of
dereferencing res->start.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-27 18:31:34 +02:00
Johannes Stezenbach 54edd7cfa9 drivers/net: add designware driver
Straight forward port of Synopsys Designware ethernet
driver from u-boot v2012.04.01.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-26 17:41:12 +02:00
Sascha Hauer fd4c51aa28 Merge branch 'pu/sandbox-fixes' 2012-06-25 19:19:52 +02:00
Sascha Hauer 2ca512e592 print out resource_size_t correctly
resource_size_t can be 32bit or 64bit depending on the architecture.
Add a define for it to be able to printf a resource_size_t correctly

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-25 14:45:43 +02:00