9
0
Fork 0
Commit Graph

5140 Commits

Author SHA1 Message Date
Sascha Hauer 45ad47a301 Merge branch 'for-next/ubifs' 2016-04-08 13:37:28 +02:00
Sascha Hauer 0d3f88a6db Merge branch 'for-next/imx' 2016-04-08 13:37:28 +02:00
Sascha Hauer 78c371d3e7 Merge branch 'for-next/arm' 2016-04-08 13:37:28 +02:00
Alexander Stein 013f33ac3a ARM: Add atomic.h from u-boot v2016.03
atomic-long.h:
* Replace __UBOOT__ with __BAREBOX__

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-08 13:33:18 +02:00
Sascha Hauer 68bd0e5036 PPC: atomic: remove non existing header include
linux/config.h does not exist. Remove its inclusion.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-08 13:33:18 +02:00
Sascha Hauer e92abad363 PPC: discard unused functions
Use --gc-sections to discard unused functions. This makes the image
smaller.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-08 13:33:18 +02:00
Sascha Hauer 558a388cb0 ARM: i.MX27: Fix gpt compatible for latest device trees
In v4.2-rc3 the "fsl,imx1-gpt" compatible was replaced with
"fsl,imx21-gpt" so i.MX27 currently ends up without clocksource. Fix
this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-08 13:33:18 +02:00
Michael Olbrich 2096b4f8a0 efi: let the generic relocate code handle all relocations
Part of the barebox code and variables are put in separate sections
(.barebox* and .initcall*). When this code is compiled as position
independent code then the compiler creates corresponding .rela.barebox* and
.rela.initcall* sections with the relocation table entries.
These sections don't match the .rela.data* wildcard in the linker script.
As a result, they are not added to the .rela section during linking but are
added individually after it instead. And when the EFI binary is created
from the ELF binary, these sections are not copied.
This has two side effects:

1. The corresponding relocations are not handled by the generic relocation
code. 'fixup_tables()' was added to do these relocations manually.

2. In the DYNAMIC section, the RELASZ entry contains the total size of
relocations in bytes. This includes the .rela.barebox* and .rela.initcall*
sections. This value is not modified when the EFI binary is created. So the
value is too large.
The generic relocation code in _relocate() used this value when iterating
over all relocation entries. With the wrong RELASZ value it iterates beyond
the end of the .rela section into uninitialized memory. After power-on this
memory is zero and the relocation code interprets this as 'nothing to do',
so there is no visible effect. After a soft reset, random data in that area
may produce a seemingly valid relocation entry, a random address is
modified and barebox crashes.

This patch adds the .rela.barebox* and .rela.initcall* sections to the
normal .rela section. The RELASZ now contains the correct size and the
generic relocation code works correctly. 'fixup_tables()' must be removed
at the same time to avoid relocating these entries twice.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-07 07:29:29 +02:00
Sascha Hauer f546a50feb ARM: i.MX: xload-esdhc: Find entry in image
The binary image generated by barebox contains an instruction at the
very beginning to jump over the header. However, when the image is
written to a SD card and the first 512 bytes are skipped in order to
preserve the partition table then this jump instruction is lost. Instead
of relying on the jump instruction at the image beginning calculate
the image entry from the i.MX header instead of relying on the beginning
of the image being the entry point.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-01 14:07:47 +02:00
Sascha Hauer 218af23c73 ARM: i.MX: xload-esdhc: Add debug messages
When imx6_esdhc_start_image fails print an error, otherwise print a
success message.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-01 14:07:11 +02:00
Sascha Hauer 2bca71c689 ARM: i.MX: xload-esdhc: Fix typo successul -> successful
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-01 14:06:58 +02:00
Sascha Hauer afcf169d82 ARM: i.MX: xload-esdhc: Add GPL header
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-01 14:06:48 +02:00
Sascha Hauer bf1e795d14 ARM: i.MX: remove unused imx-flash-header.h
All i.MX images are nowadays built with the imx-image tool, so we do not
need the header files and Kconfig options anymore. Remove them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-01 14:06:35 +02:00
Sascha Hauer 25ab9fcaf8 ARM: i.MX6: esdctl: Fix CS0_end for 4GiB/cs
On i.MX6 a single chipselect can have 4GiB. In this case the calculation
for CS0_end overflows the 7 bit field. Clamp it to 127, the maximum
supported value.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-01 14:06:11 +02:00
Sascha Hauer 1ff0ffbfd9 ARM: i.MX6: esdctl: Fix memsize calculation for 4GiB/cs
On i.MX6 a single chipselect can have 4GiB, which overflows a 32bit
type, so imx6_mmdc_sdram_size() must return a u64 to support this case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-01 14:05:51 +02:00
Sascha Hauer f6b77fe9f9 ARM: Rework vector table setup
The current vector table setup has some shortcomings. First of all
currently the case when the high vectors are inside SDRAM (that is,
SDRAM reaches the end of the address space) is not supported. In this
case we create a secondary page table for the section containing the
vectors which gets overwritten by the general SDRAM secondary page
table entries creation afterwards. On ARMv7 and later the exception
table setup can be improved: Here the vector table address is configurable
in the VBAR register. We can use this register to skip remapping the
vector table.

With this patch we first try to use the VBAR register before doing
something else. Also, when we have to use the high vectors we first
try a request_sdram_region to test if the vector table memory is already
mapped. While at it sprinkle some comments into the code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-01 14:00:29 +02:00
Sascha Hauer 75c96bd245 ARM: Do not use last 64KiB of address space for barebox
The last 64KiB of address space may be used for the vector table at
0xffff0000, so we cannot use it for barebox. The easiest way to archieve
this is to never use the last 64KiB of memory.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-01 13:58:01 +02:00
Sascha Hauer c44d92683f ARM: start: Fix wrong format specifier
Print a hex number after 0x, not a decimal number.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-01 11:44:35 +02:00
Sascha Hauer 940e04d181 ARM: pbl-multi: Fix SDRAM at end of address space
When SDRAM reaches to the end of the address space the comparison
membase + memsize evaluates to 0, so pc - membase < memsize can never
be true. Fix this by substracting membase on both sides of the
comparison.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-01 11:40:32 +02:00
Alexander Stein 3d32c620f6 ARM i.MX35: Read reset source from CCM
CCM has reset status bits with more detailed information than the
watchdog. Set reset source with higher priority.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-29 09:07:14 +02:00
Andrey Smirnov ce20b192f1 i.MX6: PL310: Adjust settings for performance
According to commit f6b6f3c7b2bb7d6277801882afdced6f2b10fc17 from
git://git.freescale.com/imx/uboot-imx.git:

	Also set Prefetch offset to 15, since it improves
	memcpy performance by 35%. Don't enable Incr double
	Linefill enable since it adversely affects memcpy
	performance by about 32MB/s and reads by 90MB/s. Tested
	with 4K to 16MB sized src and dst aligned buffer.

This commit ports those chagnes from U-Boot.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-17 08:23:05 +01:00
Andrey Smirnov 5127d80137 i.MX6: Apply PL310 errata base on PL310's revision
I.MX6Q Plus parts have r3p2 revision of PL310 so double linefill
errata no longer applies for all of the i.MX6Q SoCs. Change the code to
use PL310's revision inforation to determine if workaround needs to be
applied.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-17 08:23:05 +01:00
Andrey Smirnov 1414c55f82 L2x0: i.MX6: Replace magic numbers with constants
Use constants instead of magic numbers for PL301 registers bits in
imx6_mmu_init()

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-17 08:23:05 +01:00
Andrey Smirnov f65c093abc i.MX6: Apply errata 845369 workaround
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-17 08:23:05 +01:00
Andrey Smirnov 1d6283d6c1 ARM: Add errata 845369 workaround
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-17 08:23:05 +01:00
Andrey Smirnov 9791ea8f11 i.MX: Add revision detection for i.MX6D/Q Plus
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-17 08:23:05 +01:00
Sascha Hauer 0832e4008f ARM: i.MX27: Fix gpt compatible for latest device trees
In v4.2-rc3 the "fsl,imx1-gpt" compatible was replaced with
"fsl,imx21-gpt" so i.MX27 currently ends up without clocksource. Fix
this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-16 09:29:33 +01:00
Andrey Smirnov f88e78572b clk-imx6: Call clk_enable on mmdc_ch0_axi_podf
Call clk_enable on mmdc_ch0_axi_podf in order to properly increase
reference counters for all of the nodes in this particular clock
path. Otherwise it becomes possible for peripherals, located on other
branches stemming from "periph", to shut down the whole clock tree (up
to "pll2_bus") when they try to manage their own local clocks.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-16 08:23:46 +01:00
Andrey Smirnov 4249f24e2c i.MX6: dts: Include local .dtsi's last
Make sure that Barebox specific .dtsi files are included after .dtsi
files imported from Linux kernel. This way those local .dtsi files can
reference phandles defined in Linux kernel files.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-16 08:23:46 +01:00
Sascha Hauer 034d4ddcb6 Merge branch 'for-next/misc' 2016-03-11 10:49:50 +01:00
Sascha Hauer 7991fe1b8e Merge branch 'for-next/mips' 2016-03-11 10:49:49 +01:00
Sascha Hauer 66037e9ed9 Merge branch 'for-next/imx' 2016-03-11 10:49:49 +01:00
Sascha Hauer 690ec1804c Merge branch 'for-next/driver' 2016-03-11 10:49:48 +01:00
Sascha Hauer c41f840f4b Merge branch 'for-next/caam' 2016-03-11 10:49:35 +01:00
Sascha Hauer aaad4dad23 Merge branch 'for-next/arm' 2016-03-11 10:49:34 +01:00
Sascha Hauer e809777b95 Merge branch 'for-next/am335x' 2016-03-11 10:49:34 +01:00
Antony Pavlov 559dac9268 MIPS: tplink-mr3020: fix "WPS" and "3G" LEDs
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-10 09:39:15 +01:00
Antony Pavlov e2f0f35d2b MIPS: black-swift_defconfig: enable gpio-related stuff
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-10 09:39:14 +01:00
Antony Pavlov 550c66ee8e MIPS: black-swift: enable GPIO key
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-10 09:39:12 +01:00
Antony Pavlov 8ad12bb132 MIPS: black-swift: enable GPIO LED
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-09 19:58:51 +01:00
Antony Pavlov d752908d28 MIPS: ath79: pbl: add pbl_ar9331_mdio_gpio_enable macro
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-09 19:58:51 +01:00
Antony Pavlov 30f171a94c MIPS: black-swift_defconfig: use cached memory region
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-09 19:58:51 +01:00
Antony Pavlov ff1d2fda11 MIPS: tplink-mr3020_defconfig: use cached memory region
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-09 19:58:51 +01:00
Peter Mamonov 1e838c4fb0 MIPS: dtb: register only one memory bank
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-09 19:58:50 +01:00
Peter Mamonov 28e71b932d MIPS: implement dma_sync_* functions
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-09 19:58:50 +01:00
Antony Pavlov 0076383a13 MIPS: flush cache on shutdown
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-09 19:58:50 +01:00
Antony Pavlov e3fbe5e85d MIPS: add initial R4000-style cache support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-09 19:58:50 +01:00
Antony Pavlov 6d352cacb8 MIPS: tplink-mr3020: pbl: init cache
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-09 08:29:42 +01:00
Antony Pavlov 1d974f501f MIPS: black-swift: pbl: init cache
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-09 08:29:42 +01:00
Antony Pavlov 5668487525 MIPS: pbl: import cache init code from U-Boot v2016.01-212-ga3ab2ae
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-09 08:29:42 +01:00