9
0
Fork 0
Commit Graph

15471 Commits

Author SHA1 Message Date
Uwe Kleine-König 74f750fe65 tftp: trivial code simplification
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-03 07:15:14 +01:00
Uwe Kleine-König 2eacc573df lseek: tighten error checking and allow negative offsets for SEEK_END
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-03 07:08:40 +01:00
Lucas Stach 7497685b05 ARM: execute DMB before trying to flush cache
The CPU write buffer needs to be coherent with the cache, otherwise
we might flush stale entries with the actual data stuck in the cache.

This is really important on newer CPU core with bigger write buffers.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-03 07:06:06 +01:00
Lucas Stach d92ce9b36a ARM: correctly identify ARMv6 K/Z
The ARMv6 K/Z derivatives have a v7 compatible MMU, but all other parts
(including the cache handling) is still at v6. As we don't make use of
the more advanced features of the v7 MMU in Barebox, it's okay to just
override this to properly identify the CPU as ARMv6.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-03 07:06:06 +01:00
Lucas Stach 0d0b426a67 ARM: align exception vectors to 32 byte
On ARMv7 the exception vectors inside the barebox binary are used directly
by remapping the vectors base through the VBAR register. While VBAR allows
to remap the exception vectors freely, it still imposes a minimum alignment
of 32 byte, as the lower bits are treated as the exception vector offset.
Enforce this alignment inside the barebox binary.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-03 07:06:06 +01:00
Bastian Stender 836b99c81b i2c: mv64xxx: simplify mv64xxx_i2c_wait_for_completion
Two nested while loops are not necessary here, so integrate the read,
i2c_fsm and i2c_do_action calls into mv64xxx_i2c_wait_for_completion()
and remove the obsolete interrupt remains.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 14:03:43 +01:00
Bastian Stender 8d38b5205c i2c: mv64xxx: add software delays
As stated in Marvell's Functional Specifications in MV-S107021-U0 Rev. A
on page 420 ff. software delays are needed. "SW delay represent a delay
of at least 2 internal clock cycles". These delays are hereby
implemented.

The original kernel driver compensates the needed software delays with
the time the interrupts take.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 14:03:43 +01:00
Uwe Kleine-König 222078a38c mvebu: netgear-rn2120: make use of mvebu_get_initial_int_reg_base
This is necessary to make second stage booting work when the register
window is already moved.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2017-03-02 14:03:43 +01:00
Uwe Kleine-König 823d08e3e2 kwbimage_v1: add support to boot a mvebu image
This just starts the main image of the mvebu image assuming that the
header images just setup the RAM. The position of the internal register
window is provided in the header as introduced in the previous commit.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2017-03-02 14:03:43 +01:00
Uwe Kleine-König 0da84a9fe4 filetype: Add image type for boot images used on Armada 370 and XP 2017-03-02 14:03:43 +01:00
Uwe Kleine-König f15bb506aa mvebu: get initial position of register window from image header
A problem when using 2nd stage booting on mvebu is that the first bootloader
already switched the register window location from 0xd0000000 to
0xf1000000 by writing to 0xd0000080. When the second bootloader also
tries to do this switch it writes to the wrong location resulting in an
exception and so a boot failure.

For this reason the base address of the register window is passed in the
barebox header and picked up from there by early code. In a further
patch bootm is taught to put the actual position of the window there for
the second bootloader to finally make second stage booting work.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2017-03-02 14:03:43 +01:00
Uwe Kleine-König 7ada71351b mvebu: rn2120: Make available all RAM
binary.0 sets up all RAM but the address decoding isn't adapted accordingly
which makes barebox assume that there are only 512 MiB of RAM on a single
bank instead of two banks with 1 GiB each.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2017-03-02 14:03:43 +01:00
Uwe Kleine-König 59cce42f38 mvebu: kirkwood: simplify soc init code flow
Similar to the two previous commits, this gets rid of a of-fixup which
is strange because the soc init stuff is rerun then when a new dt for
booting into Linux is loaded.

The initcall must be postponed to post-core to ensure
of_machine_is_compatible is working correctly.

The call to mvebu_mbus_add_range is moved to drivers/bus/mvebu-mbus.c to
ensure it's registered early enough.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 14:03:43 +01:00
Uwe Kleine-König f8d4f622c9 mvebu: dove: simplify soc init code flow
Similar to the previous commit, this gets rid of a of-fixup which is
strange because the soc init stuff is rerun then when a new dt for
booting into Linux is loaded.

The initcall must be postponed to post-core to ensure
of_machine_is_compatible is working correctly.

The call to mvebu_mbus_add_range is moved to drivers/bus/mvebu-mbus.c to
ensure it's registered early enough.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 14:03:43 +01:00
Uwe Kleine-König 8a5edc9e99 mvebu: armada-370-xp: simplify soc init code flow
This gets rid of a of-fixup which is strange because the soc init stuff
is rerun then when a new dt for booting into Linux is loaded.

The initcall must be postponed to post-core to ensure
of_machine_is_compatible is working correctly.

The call to mvebu_mbus_add_range is moved to drivers/bus/mvebu-mbus.c to
ensure it's registered early enough.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 14:03:43 +01:00
Uwe Kleine-König f3acd214a1 ata: new driver to support the internal sata controller on Armada-XP
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 14:03:43 +01:00
Sascha Hauer e2805b5ee5 scripts: mxsimage: Fix build with OpenSSL < 1.1.x
Move the compatibility wrapper functions up so that they
are defined before they are used.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 13:54:49 +01:00
Lucas Stach e8fab18835 ARM: rpi: switch to DT probe and multi-image build
This commit switches the RaspberryPi arch over to probe Barebox
from the builtin DT and enables multi-image builds.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 09:11:24 +01:00
Lucas Stach e0e2a4d8cc ARM: rpi: move debug UART base selection to Kconfig
To let the user select the right base, when building multi-image.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 09:11:24 +01:00
Lucas Stach cf2448a584 ARM: rpi: always build relocatable image
Makes more space available for the malloc area and will allow
to switch to multi-image later on.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 09:11:24 +01:00
Enrico Joerns dc9ef03ecb mci-bcm2835: enable devicetree probing
Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 09:11:24 +01:00
Enrico Joerns 6b4f5b6448 clocksource: bcm2835: use clock-frequency property when available
If the clock frequency is given by a DT property, use this and don't
try to use the clock handle.

Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 09:11:24 +01:00
Lucas Stach 26bf828036 ARM: rpi: convert watchdog/reset to regular driver
This way it can be probed from DT later on.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 09:11:23 +01:00
Lucas Stach 63e67a9633 ARM: rpi: convert mailbox interface to regular driver
In prepareation for devicetree probing.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 09:11:23 +01:00
Lucas Stach fe506e132c ARM: rpi: move model detection before console init
This way we can print the correct model in the Barebox banner.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 09:11:23 +01:00
Enrico Joerns 5d5e1c112a ARM: rpi: move model initialisation to rpi-common
The Raspberry PIs use different versions schemes for the older and newer
variants. The decoding arrays for these schemes were split up in rpi.c
and rpi2.c. This is not required, as the appropriate versioning scheme
can be determined programmatically.

Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 09:11:23 +01:00
Uwe Kleine-König faa369e9c5 nand-bb: fix writing to the end of a .bb device
As nand_bb_write_buf calls mtd_write(bb->mtd, cur_ofs, now, ...) the
limit that now should be checked against is bb->mtd->size - cur_ofs.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 08:41:53 +01:00
Uwe Kleine-König e0ff988ad8 memcmp: fix comparison on short read
read() might return less than $count bytes which is only an upper limit.
The user is supposed to repeat the command to fill a buffer completely.

So use the convenience wrapper read_full in memcmp.

This fixes memcmp on /dev/nand0 on an Armada XP.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 08:39:58 +01:00
Uwe Kleine-König 711bb18961 lseek: ensure errno is set on failure and return -1
All error paths before calling the driver's lseek callback return -1 and
set errno. Do the same if the callback returns an error.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 08:38:29 +01:00
Daniel Schultz 6d76aaf1bc arm: boards: phytec-som-am335x: Remove 1GB RAM type
This machine was a prototype and was never shipped to customers.

Since it has no dependencies to any image, it can be removed.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-01 16:08:40 +01:00
Sascha Hauer 019606ddc3 commands/mmc_extcsd: Relicense under GPLv2+
GPLv3 is incompatible with the projects license. Relicense file
under GPLv2+

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Daniel Schultz <d.schultz@phytec.de>
2017-03-01 08:04:06 +01:00
Bastian Stender b9cf45f00c fb: introduce flush for virtual framebuffer
Some drivers need an explicit sync method to flush the virtual
framebuffer to the display. It is called fb_flush().

fb_flush() gets called on fbc_putc, on fb_close and in the pattern cycle
in the fbtest command.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 15:52:53 +01:00
Bastian Stender b4f55fcf35 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>
2017-02-28 15:52:35 +01:00
Bastian Stender 1233570798 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>
2017-02-28 15:52:35 +01:00
Bastian Stender 3cade5ec3a fbconsole: implement vt100 cursor shown/hidden
This implements the vt100 show cursor command '[?25h' and the hide
cursor command '[?25l'. It is useful for displaying text on a non-active
(no stdout/stdin/stderr) console with 'echo'.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 07:45:38 +01:00
Bastian Stender 1e2f65d72a fbconsole: check cursor position before moving
Moving the cursor to x=2, y=2 with "\e[3;3H" on a 12x2 framebuffer
console lead to a barebox crash while drawing the cursor. If the
cursor position is out of bounds clip the cursor to the corresponding
edge.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 07:44:59 +01:00
Jean-Christophe PLAGNIOL-VILLARD 4c29a9511b efi: move x86 efi boot support to x86 arch
prepare to drop the efi arch as efi boot up is not arch sepecific

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-27 08:33:14 +01:00
Bastian Stender 41c3c713c4 lib/fonts: add VGA8x8 font
Ported from Linux v4.10.

This font is ideal for displaying a framebuffer console on a small display.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:25:44 +01:00
Bastian Stender ab5a26ef14 2d-primitives: check dimensions in __illuminate
gl_draw_circle draws outside of the screen if the resolution is too low.
This lead to memory corruption. Check the dimensions before drawing.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:24:35 +01:00
Bastian Stender 43f2decf5b graphic_utils: do not allocate info in fb_open
info was errorneously allocated, but it really is a pointer to a fb_info
struct from the framebuffer. This fixes a memory leak.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:24:35 +01:00
Bastian Stender 11f1728318 graphic_utils: implement 8 bpp color depth in gu_set_pixel
Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:24:35 +01:00
Jean-Christophe PLAGNIOL-VILLARD 64db2d497c x86: move bios bootup code to arch/x86/bios
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:21:33 +01:00
Jean-Christophe PLAGNIOL-VILLARD c3931154de efi: move startup and payload to common/efi
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:21:33 +01:00
Jean-Christophe PLAGNIOL-VILLARD c7263b02f8 efi: move debug_ll.h to include/efi
so other arch could include it too

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:21:33 +01:00
Jean-Christophe PLAGNIOL-VILLARD 3858b78c1b efi: move bus driver to driver/efi
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:21:33 +01:00
Jean-Christophe PLAGNIOL-VILLARD 5596f405ff efi: move clocksource out of arch
as efi is not an arch but a boot mode from where barebox is started

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:21:33 +01:00
Jean-Christophe PLAGNIOL-VILLARD 40c5c3f8fc efi: move block io driver to driver/block
so it can be reused on any ARCH

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:21:33 +01:00
Sascha Hauer fc6ce94cda usb: gadget: fastboot: close fd after download
The fd for the downloaded file is never closed. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-23 14:49:52 +01:00
Yegor Yefremov 68ba1f1536 lib: xz: add support for bcj filters
Add missing configuration options for various bcj filters. Without
these options the lib/xz/xz_dec_bcj.c file will be compiled, but all
filters will be disabled.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-23 13:43:52 +01:00
Alexander Kurz f0a2d7f036 scripts: imx-usb-loader: implement DCD v2 check command
The DCD v2 check command supported by i.MX53 and later SoC polls a given
memory location as long as a given condition is true.
Enable imx-usb-loader to perform this check. When the timeout is hit,
imx-usb-loader returns an error. For practical reasons the timeout
computation will differ from the native implementation, since performing
check commands via USB will be much slower compared to native processing.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-22 09:18:30 +01:00