Commit Graph

27876 Commits

Author SHA1 Message Date
Alexey Brodkin
660d5f0d49 arc: move common sources in library
"reset.c" and "cpu.c" have no architecture-specific code at all.
Others are applicable to either ARC CPU.

This change is a preparation to submission of ARCv2 architecture port.

Even though ARCv1 and ARCv2 ISAs are not binary compatible most of
built-in modules still have the same programming model - AUX registers
are mapped in the same addresses and hold the same data (new featues
extend existing ones).

So only low-level assembly code (start-up, interrupt handlers) is left
as CPU(actually ISA)-specific. This significantyl simplifies maintenance
of multiple CPUs/ISAs.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
2015-01-15 22:40:49 +03:00
Alexey Brodkin
70a0442a42 arc: move linker script in arch/arc/cpu folder
This way we'll be able to use the same one script for either ARC CPU.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2015-01-15 22:40:44 +03:00
Alexey Brodkin
1c91a3d979 arc: relocate - minor refactoring and clean-up
* use better symbols for relocatable region boundaries
("__image_copy_start" instead of "CONFIG_SYS_TEXT_BASE")
 * remove useless debug messages because they will only show up in case
of both problem (when normal "if" branch won't be taken) and DEBUG take
place which is pretty rare situation.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2015-01-15 22:38:42 +03:00
Igor Guryanov
20a58ac0d8 arc: introduce separate section for interrupt vector table
Even though existing implementation works fine in preparation to
submission of ARCv2 architecture we need this change.

In case of ARCv2 interrupt vector table consists of just addresses
of corresponding handlers. And if those addresses will be in .text
section then assembler will encode them as everything in .text section
as middle-endian and then on real execution CPU will read swapped
addresses and will jump into the wild.

Once introduced new section is situated so .text section remains the
first which allows us to use common linker option for linking everything
to a specified CONFIG_SYS_TEXT_BASE.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
2015-01-15 22:38:42 +03:00
Alexey Brodkin
dcb431e723 arc: add dependences on MMU presence
Depending on MMU presence in CPU there're differences in HW behavior.
For example address of instruction that caused exception is put in
ECR register if MMU exists and in ERET register otherwise.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
2015-01-15 22:38:42 +03:00
Igor Guryanov
c0e9535e1d arc: interrupts - fix mask setup
To disable interrupts we need to reset corresponding flags in STATUS32
register. For this we need to OR flags for interrupts level1 and level2
and then AND with current value in STATUS32.

Before that implementation was incorrect.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
2015-01-15 22:38:42 +03:00
Igor Guryanov
e47d733867 arc: add ECR (exception cause register) output
Exception cause register (ECR) contains value that describes a reason
for exception that has happened. This helps a lot to figure-out what
went wrong.

Now we print this register contents when dumping registers.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
2015-01-15 22:38:42 +03:00
Igor Guryanov
f8cf3d1ebd arc: check caches existence before use
Some cache operations ({i|d}cache_{enable|disable|status} or
flush_dcache_all) are built and used even if CONFIG_SYS_{I|D}CACHE_OFF
is set.

This is required for force disable of caches on early boot.
What if something was executed before U-boot and enabled caches
(low-level bootloaders, previously run kernel etc.)?

But if CPU doesn't really have caches any attempt to access
cache-related AUX registers triggers instruction error exception.

So for convenience we'll try to avoid exceptions by checking if CPU
actually has caches (we check separately data and instruction cache
existence) at all.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
2015-01-15 22:38:42 +03:00
Tom Rini
28c4dae114 Merge branch 'next' of git://git.denx.de/u-boot-video 2015-01-14 16:26:15 -05:00
Michal Simek
16ae782722 net: Declare physical address as phys_addr_t unsigned type
Use phys_addr_t instead of int for addresses.
Addresses can't be < 0.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-01-14 11:37:39 -05:00
Michal Simek
f1075aedd2 ARM: armv8: Fix typo in commentary
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-01-14 11:37:39 -05:00
Michal Simek
421044b183 doc: ARM: Use the right function name
Trivial fix.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-01-14 11:37:39 -05:00
Alexey Brodkin
33d8818350 Kconfig: move CONFIG_SYS_CLK_FREQ to Kconfig
It makes sense to specify CONFIG_SYS_CLK_FREQ in "configs/xx_defconfig"
instead of "include/configs/xxx.h" because then header will be reusable
across boards with different CPU clocks.

Also this nice to have an ability for end user to tune this value
himself via "menuconfig".

For now I'm only applying this change to all ARC configs because
otherwise scope of change will be huge.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Tom Rini <trini@ti.com>
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Hans de Goede <hdegoede@redhat.com>
cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2015-01-14 11:37:39 -05:00
Masahiro Yamada
9f9d8704b6 spl: spl_nor: surround Linux-load code with #ifdef CONFIG_SPL_OS_BOOT
If CONFIG_SPL_NOR_SUPPORT is defined, spl_nor_load_image() requires
spl_start_uboot(), CONFIG_SYS_OS_BASE, CONFIG_SYS_SPL_ARGS_ADDR,
CONFIG_SYS_FDT_BASE to be defined even if users just want to run
U-Boot, not Linux.  This is inconvenient.

This patch is following the codying style of common/spl/spl_nand.c.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2015-01-14 11:37:39 -05:00
Marek Vasut
3811723132 image: Enable OpenRTOS booting via fitImage
Allow booting the OpenRTOS payloads via fitImage image type.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:37:39 -05:00
Marek Vasut
67ddd955fc image: bootm: Add OpenRTOS image type
Add separate image type for the Wittenstein OpenRTOS .

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:37:39 -05:00
Evgeni Dobrev
9637c4b2dd Add support for Seagate BlackArmor NAS220
Add support for Seagate BlackArmor NAS220

Signed-off-by: Evgeni Dobrev <evgeni@studio-punkt.com>
2015-01-14 11:37:39 -05:00
Bill Pringlemeir
4cf84ccbaf arm: vf610: Remove duplicate MTD defines.
Some MTD defines are repeated twice; once with UBI and then with MTD.
Remove the duplicate MTD defines from the UBI grouping.

Signed-off-by: Bill Pringlemeir <bpringlemeir@nbsps.com>
2015-01-14 11:35:44 -05:00
Simon Glass
670c0179ec lzo: Update dst_len even on error
This allows the caller to easily detect how much of the destination buffer
has been used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:35:44 -05:00
Simon Glass
9c55c54fb4 gunzip: Update lenp even on error
This allows the caller to easily detect how much of the destination buffer
has been used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:35:44 -05:00
Simon Glass
362a0e43a3 bzlib: Update destLen even on error
This allows the caller to easily detect how much of the destination buffer
has been used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:35:44 -05:00
Simon Glass
3086c055a0 bootm: Factor out common parts of image decompression code
Adjust the code so that the error reporting can all be done at the end,
and is the same for each decompression method. Try to detect when
decompression fails due to lack of space. Keep the behaviour of
resetting on failure even though there should be no memory corruption
now.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:35:43 -05:00
Simon Glass
8fd6a4b514 bootm: Use print_decomp_msg() in all cases
Refactor to allow this function to be used to announce the image being
loaded regardless of compression type and even when there is no
decompression.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:35:43 -05:00
Simon Glass
6ed4dc7876 test: Add unit tests for bootm image decompression
Use each compression method (including uncompressed). Test for normal
operation, insufficient space and corrupted data.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:35:43 -05:00
Simon Glass
ac9a215de0 test: Rename test_compression to ut_compression
Try to keep the names of the unit test commands consistent.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:35:43 -05:00
Simon Glass
081cc19747 bootm: Export bootm_decomp_image()
Export this function for testing. Also add a parameter so that values other
than CONFIG_SYS_BOOTM_LEN can be used for the maximum uncompressed size.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:35:43 -05:00
Simon Glass
cc4477289d test: Add DEBUG output option to test-fit.py
Sometimes it is useful to see the output from U-Boot, so add an option to
make this easier.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:35:43 -05:00
Simon Glass
b5493d17bd sandbox: Correct ordering of 'sb save' commands
Prior to commit d455d87 there was an inconsistency between the position of
the 'address' parameter in 'sb load' and 'sb save'. This was corrected but
it broke some tests. Fix the tests and also the help for 'sb save'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:35:43 -05:00
Simon Glass
40e5975f9a bootm: Move compression progress/error messages into a function
This code is repeated in several places, and does not detect a common
fault where the image is too large. Move it into its own function and
provide a more helpful messages in this case, for compression schemes
which support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:35:43 -05:00
Simon Glass
f6eec89fa3 lzma: fix buffer bound check error further
Commit 4d3b8a0d fixed a problem with lzma decompress where it would
run out of bytes to decompress. The algorithm needs to know how many
uncompressed bytes it is expected to produce.

However, the fix introduced a potential buffer overrun, and causes
the compression test to fail (test_compression command in sandbox).

The correct fix seems to be to use the minimum of the expected number
of uncompressed bytes and the amount of output space available. That
way things work normally when there is enough space, and return an
error (without overrunning available space) when there is not.

Signed-off-by: Antonios Vamporakis <ant@area128.com>
CC: Kees Cook <keescook@chromium.org>
CC: Simon Glass <sjg@chromium.org>
CC: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
CC: Luka Perkov <luka@openwrt.org>

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 11:35:43 -05:00
Wolfgang Denk
95099fee40 common/memsize.c: Coding style cleanup
Prepare code to make later modifications checkpatch-clean.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2015-01-14 11:35:43 -05:00
Meier, Roger
c7cb334d14 .travis.yml: build u-boot on travis-ci
Goal:
  - building all variants of U-Boot with multiple configurations
  - code quality checks and metrics
  - https://travis-ci.org/u-boot/u-boot/builds
2015-01-14 11:35:43 -05:00
Tom Rini
bd5053ffa5 Merge branch 'buildman' of git://git.denx.de/u-boot-x86
Conflicts:
	tools/buildman/control.py

Signed-off-by: Tom Rini <trini@ti.com>
2015-01-14 11:00:38 -05:00
Masahiro Yamada
ac8192a587 README.scrapyard: fill commit and date fields
This commit was generated by the following command:

    scripts/fill_scrapyard.py

The commit-ID of CPCIISER4 removal has been fixed by hand because
the board was removed by commit 3705726010 (ppc4xx: remove CPCIISER4
board), but it was added to README.scrapyard by commit 9a4018e09a
(ppc4xx: remove DP405 board).

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2015-01-14 10:58:55 -05:00
Masahiro Yamada
478d9372d1 scripts: add a utility to fill blank fields of doc/README.scrapyard
We are removing bunch of non-generic boards these days.

Updating doc/README.scrapyard is a really tedious task, but it can
be automated.  I hope this tool will make our life easier.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-01-14 10:58:49 -05:00
Hans de Goede
a90e77dbeb sunxi: usbc: Add support for usb-vbus0 controller by axp drivebus pin
The axp221 / axp223's N_VBUSEN pin can be configured as an output rather
then an input, and this is used on some boards to control usb-vbus0, add
support for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2015-01-14 14:56:40 +01:00
Hans de Goede
4458b7a6e1 sunxi: usbc: Add support for usb0 to the common usbc code
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2015-01-14 14:56:40 +01:00
Hans de Goede
0eccec4ef1 sunxi: Move usb-controller init code out of ehci-sunxi.c for reuse for otg
Most of the usb-controller init code found in ehci-sunxi.c also is necessary
to init the otg usb controller, so move it to a common place.

While at it also update various #ifdefs / defines for sun8i support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2015-01-14 14:56:40 +01:00
Hans de Goede
2abac6213d sunxi: axp221: Add support for controlling the drivebus pin
The axp221 / axp223's N_VBUSEN pin can be configured as an output rather
then an input, add axp_drivebus_enable() and _disable() functions to set
the pin in output mode and control it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2015-01-14 14:56:40 +01:00
Hans de Goede
3c781190d1 sunxi: axp221: Protect axp221_init against multiple calls
The voltage setting code knows it needs to call axp221_init before calling
the various voltage setting functions.

But users of axp utility functions like axp221_get_sid() do not know this,
so the utility functions always call axp221_init() to ensure that the
p2wi / rsb setup magic has been done.

Since doing this repeatedly is quite expensive, add a check to axp221_init
so that it only does the initialization once.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2015-01-14 14:56:40 +01:00
Chen-Yu Tsai
52755b12e3 sunxi: axp221: correct ALDO2 description for sun6i
ALDO2 is used to power LPDDR2 SDRAM on both the reference design and the
Hummingbird A31, when this type of RAM is present.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-14 14:56:40 +01:00
Chen-Yu Tsai
3097888087 sunxi: Hummingbird_A31_defconfig: Enable VGA output through external DAC
The Hummingbird A31 uses an external DAC connected to the LCD0 outputs
for the on board VGA output. The DAC has a power control that's toggled
by GPIO.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-14 14:56:40 +01:00
Chen-Yu Tsai
507e27dfc9 sunxi: video: Add support for external DAC enable pin
The external DAC for VGA output might have either a power or reset
control pin that needs to be pulled up, as is the case on the
Hummingbird A31.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-14 14:56:40 +01:00
Chen-Yu Tsai
2583d5b192 sunxi: video: Allow external DACs for VGA on platforms without TV encoders
Using an external DAC for VGA output was available on sun5i. Since
some other SoCs don't have a builtin TV encoder, but might have
use for a VGA output, enable the option for the platforms that
don't have TV encoders.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-14 14:56:40 +01:00
Siarhei Siamashka
a79250785b sunxi: Enable pre-console buffer
This allows to always have a complete log on the VGA/HDMI/LCD console.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-14 14:56:40 +01:00
Siarhei Siamashka
2766966750 console: Use pre-console buffer to get complete log on all consoles
Currently the pre-console buffer can accumulate early log messages
and flush them to the serial console as soon as it becomes available.

This patch just adds one more pre-console buffer flushing point and
does all the same for the other consoles too. This is particularly
useful for the vga/hdmi/lcd console, where we can see all the older
messages now (except for the log messages from SPL).

Naturally, we don't want to get an extra copy of the log messages
on the serial console again at the second flushing point, so the
serial console has to be explicitly filtered out.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Tom Rini <trini@ti.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-14 14:56:40 +01:00
Jan Kiszka
05c4bd3ec3 sun7i: Move psci_arch_init close to text_end
"adr rX, text_end" only works if the label is close. Adding further code
to the other functions will prevent this. So move the containing
function close to label. No functional change.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2015-01-14 14:56:40 +01:00
Jan Kiszka
602fa46c2c sun7i: Add support for taking CPUs offline via PSCI
Based on the original version by Marc Zyngier. It adds a psci_cpu_off
implementation for the A20 SoC. The mechanism works by first preparing
the calling CPU to go offline (disable and flush cache, disable SMP),
then requesting CPU 0 to pull the plug. The request is sent as FIQ on
SGI15.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2015-01-14 14:56:40 +01:00
Hans de Goede
213480e12d sunxi: video: Add lvds support
Add support for lvds lcd panels

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
2015-01-14 14:56:40 +01:00
Zoltan HERPAI
213dcbfdeb sunxi: add Linksprite pcDuino v1/v2 support
Add support for a sun4i board built by Linksprite. This addition covers
both v1 and v2 versions. As the board has been working with 408MHz memory
setting in the u-boot-sunxi branch, and has been proven to be running stable
during my tests as well, a respective new DRAM config file is added as well.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-14 14:56:39 +01:00