9
0
Fork 0
Commit Graph

4695 Commits

Author SHA1 Message Date
Sascha Hauer 0b47f95340 ARM: i.MX: Provide bootsource functions for early boot code
The regular bootsource functions only work in a running barebox,
provide functions for early code. This has already been done for
i.MX6, this patch adds the same functions for the other SoCs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:20:52 +02:00
Sascha Hauer cf3dfafff4 ARM: i.MX53: do not pass base address to imx*_boot_save_loc
The functions can determine the necessary base addresses
themselves since they are SoC specific anyway.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:20:52 +02:00
Sascha Hauer 712a7de9b4 ARM: i.MX53 Vincell: Add PBL console support
PBL console support is more useful than debug_ll. Add support
for it to the Vincell Board.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:20:52 +02:00
Sascha Hauer 8b4bbbbd13 ARM: i.MX53 Vincell: Adjust bbu handler partition size to real partition size
The bootloader partition size was increased to 0xe0000, so adjust
the barebox update handler partition size accordingly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:20:52 +02:00
Sascha Hauer 45325c21d7 ARM: i.MX53 Vincell: Reset phy consistently from device tree
The phy reset for the Vincell board is done from device tree whereas
the Vincell-LT resets the phy from board init code. Since both boards
share the same code base the regular Vincell board ends up with a
duplicated phy reset, with the second reset being done after the
FEC has been initialized.
Fix this by removing the phy reset from the board code and adding the
phy reset to the Vincell-LT dts file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:20:52 +02:00
Sascha Hauer 6cd4fee050 ARM: i.MX53: Add uart5 clock support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:20:52 +02:00
Uwe Kleine-König 2b7823e7de ARM: mvebu: select HAVE_DEFAULT_ENVIRONMENT_NEW
None of the available boards for mvebu has any environment additions, so
this is safe.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-16 09:35:34 +02:00
Uwe Kleine-König c786a87639 ARM: mvebu_defconfig: enable all machines, AEABI, nand and net driver
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-16 09:35:34 +02:00
Uwe Kleine-König 91d1d7c75b ARM: mvebu_defconfig: oldconfig
This is the result of
	make mvebu_defconfig
	make savedefconfig
	mv defconfig arch/arm/configs/mvebu_defconfig
.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-16 09:35:34 +02:00
Uwe Kleine-König a38b7017b3 ARM: imx6: reset PLL2's PFD2 on i.MX6D
The check for is_imx6q was introduced initially in

	f1f6d76370 ("ARM: i.MX6: correct work flow of PFDs from uboot-sources")

to differentiate between i.MX6DL+i.MX6SL and i.MX6Q. The i.MX6D must be
handled like the latter, so drop the check. i.MX6DL+i.MX6SL can be
ignored here since since

	a665962824 ("imx6: lowlevel_init: Fix workaround for new i.MX6s chips")

the PFD handling is only done for i.MX6DQ.

Update the comment to be not only logically correct but also helpful.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-15 10:01:04 +02:00
Sascha Hauer c9dbd886ef ARM: Fix calling of arm_mem_barebox_image()
arm_mem_barebox_image() is used to pick a suitable place where to
put the final image to. This is called from both the PBL uncompression
code and also from the final image. To make it work properly it is
crucial that it's called with the same arguments both times. Currently
it is called with the wrong image size from the PBL uncompression code.
The size passed to arm_mem_barebox_image() has to be the size of the
whole uncompressed image including the BSS segment size. The PBL code
calls it with the compressed image size instead and without the BSS
segment. This patch fixes this by reading the uncompressed image size
from the compressed binary (the uncompressed size is appended to the
end of the compressed binary by our compression wrappers). The size
of the BSS segment is unknown though by the PBL uncompression code,
so we introduce a maximum BSS size which is used instead.

The code before this patch worked by accident because the base address
of the final image was aligned down to a 1MiB boundary. The alignment
was sufficient already to make enough space. This breaks though when
the uncompressed image including BSS becomes bigger than 1MiB while
the compressed image is smaller.

Fixes: 65071bd0: arm: Clarify memory layout calculation

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-15 09:23:43 +02:00
Sascha Hauer 5e61dd3fb5 Add comp_copy function for use with CONFIG_IMAGE_COMPRESSION_NONE
The Makefile compression commands all append the size of the
uncompressed image. With CONFIG_IMAGE_COMPRESSION_NONE simply
'shipped' is used which does not append the size. Add and use
a special comp_copy function which adds the size. This helps
us to get the uncompressed image size in the startup code later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-15 09:23:43 +02:00
Sascha Hauer 679ded1407 ARM: i.MX6: Sabrelite: Add PBL console support
Add PBL console support to allow for better debugging.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-15 09:23:43 +02:00
Sascha Hauer 7dc3354ac8 ARM: i.MX6: Enable parent propagation for clk_gate2
Enable parent rate propagation for clk_gate2 to allow the
clock consumers to adjust their rates.
One effect of this is that the i.MX6 NAND controller now can adjust
its rate. It already called a clk_set_rate(rate, 96000000), but this
had no effect, so the clock stayed at reset default 24MHz resulting
in a rather slow timing. This became a problem when commit
"1daa3bc mtd: nand_mxs: Setup timing" introduced EDO timing mode for
faster NAND chips. EDO mode can only work properly for cycle times
< 30ns (at least that's specified in the ONFI spec). 1daa3bc resulted
in sporadic NAND read errors on some boards.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Sam Ravnborg <sam@ravnborg.org>
2016-09-14 14:39:57 +02:00
Sascha Hauer 47f72a3b78 ARM: karo-tx6: Include correct device tree
As a i.MX6dl board dts imx6dl-tx6u.dts should include imx6dl.dtsi, not
the i.MX6q variant. This fixes various pinctrl problems.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-14 10:31:23 +02:00
Sascha Hauer 7791ad2d59 defenv-1: remove unused variable kernelimage_type
kernelimage_type is used nowwhere, remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-14 10:27:07 +02:00
Sascha Hauer 074a8fdc92 Merge branch 'for-next/socfpga' 2016-09-13 14:56:06 +02:00
Sascha Hauer 0e1892b2e9 Merge branch 'for-next/rockchip' 2016-09-13 14:56:05 +02:00
Sascha Hauer dd534571bd Merge branch 'for-next/misc' 2016-09-13 14:56:05 +02:00
Sascha Hauer b2c398f440 Merge branch 'for-next/imx' 2016-09-13 14:56:04 +02:00
Sascha Hauer 0a12c71568 Merge branch 'for-next/defenv-2' 2016-09-13 14:56:03 +02:00
Alexander Kurz b12f38097b ARM i.MX50: Add iomux definitions for non-DT board implementations
Add non-DT IOMUX definitions for the i.MX50 SOC by converting linux
dts/imx50-pinfunc.h by script.
perl -we 'while(<>) {
 next unless /^#define MX50_PAD/;
 @in=split "[[:space:]]+", uc($_);
 @out=();
 @out[0..4]=@in[3, 2, 5, 4, 6];
 $out[2] =~ s/0X//;
 $out[4] =~ s/0X//;
 $out[3] = "__NA_" if $out[3] eq "0X000";
 push @out, $in[1] =~ /__UART/? "MX50_UART_PAD_CTRL": "NO_PAD_CTRL";
 $out=join(", ", @out);
 $out =~ s/0X/0x/g;
 print "#define $in[1]\t\t\tIOMUX_PAD($out)\n";
}' < dts/src/arm/imx50-pinfunc.h

Additional changes:
* typical PAD settings for UART, SPI, I2C and ESDHC
* SION bits set for all I2C MUX options

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-12 08:23:09 +02:00
Alexander Kurz f6ebdf2194 Add i.MX50 support
Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-12 08:23:09 +02:00
Alexander Kurz ed014ce301 ARM: i.MX clock: cleanup imx50 incompatibilities
Move all MX5 clock functionality which does not apply to i.MX50 to
a new mx51_mx53 related function.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-12 08:23:09 +02:00
Alexander Kurz cf4414f7a2 ARM: add common definitions for i.MX50 SOC
Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-12 08:23:09 +02:00
Andrey Smirnov da1f91422c of_unflatten_dtb(): Check return value with IS_ERR
Of_unflatten_dtb returns a ERR_PTR value so checking it against NULL is
incorrect. Fix it in all of the places where this was happening.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-05 08:29:12 +02:00
Wadim Egorov 2035fe2d6b configs: Add RK3288 defconfig
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-01 09:15:15 +02:00
Wadim Egorov c13c4e4332 ARM: Add phyCORE-RK3288 SOM support
The phyCORE-RK3288 aka PCM-059 is a SoM (System on Module)
containing a RK3288 SoC. The module can be connected to different
carrier boards.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-01 09:15:01 +02:00
Sascha Hauer d30d0e4bf6 ARM: i.MX6 Santaro: Add PBL console support
To be able to use PBL console do the usual
relocate_to_current_adr()/setup_c() dance and call pbl_set_putc() to
tell the PBL console where the UART is.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-29 17:38:04 +02:00
Sascha Hauer 180b8b6bc1 ARM: i.MX6 Santaro: Add USB support
Enable usbotg and usbh1 devices to gain USB support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-29 17:37:59 +02:00
Sascha Hauer 8f39bf5390 ARM: i.MX6 Santaro: Add enable-delay for the display
The display needs a time to settle, set an enable-delay
of 200ms to avoid flickering.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-29 17:37:53 +02:00
Sascha Hauer d3700c0e81 ARM: vector_table: Fix creation of second level page table
The second level page tables can only start at a 1MiB section boundary,
so instead of calling arm_create_pte() with the high vector address
(which is 0xffff0000, not 1MiB aligned) we have to call it with
0xfff00000 to correctly create a second level page table.
The old values broke SoCs which have peripherals in the upper 1MiB
area, like for example the Atmel AT91RM9200. On these Socs we correctly
created the vector page, but the pages around it did not have a 1:1
mapping anymore which led to unreachable peripherals.

Fixes: f6b77fe9: ARM: Rework vector table setup

Reported-by: Peter Kardos <kardos.peter.sk@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Peter Kardos <kardos.peter.sk@gmail.com>
2016-08-26 07:44:32 +02:00
Sascha Hauer 71df6f5bf1 defaultenv-2: remove unused *-menu-add-entry calls
The *-menu-add-entry functions no longer exist in defaultenv-2, so
remove the calls to these functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-26 07:35:49 +02:00
Sascha Hauer 2086c79289 defaultenv-2: remove ps1 duplicates
Some boards duplicate the PS1 initialization to add a '#' at the end
of the prompt. It's not worth duplicating this for this purpose. Remove
them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-26 07:34:06 +02:00
Wadim Egorov 4372a3ed06 ARM: rockchip: Add early debug support for RK3288
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-26 07:28:31 +02:00
Wadim Egorov 413a35395a clocksource: Add rk3288 timer driver
This driver comes from the u-boot (v2016.01).

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-26 07:28:31 +02:00
Wadim Egorov b9c57abc8c ARM: rockchip: Add basic RK3288 support
The RK3288 SoC is a low power, high performance processor for mobile phones,
personal mobile internet devices and other digital multimedia applications.
It has an integrated quad-core cortex-A17 with separate NEON coprocessor.

Prepare mach-rockchip infrastructure for Rockchip RK3288 support.
Let's seperate the RK3188 and RK3288 SoCs. Later we will have two different
configs.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-26 07:28:31 +02:00
Andrey Smirnov b65b137453 arm: Add both .lds files to CLEAN_FILES unconditionally
'clean' target is listed on 'no-dot-config-targets' list in main
Makefile so that conditional statement would yeild the same result
every time. Given how CLEAN_FILES are rm'ed with -f there should be no
harm in specifying them both unconditionally.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-24 14:02:14 +02:00
Sascha Hauer 32570fd027 ARM: i.MX25: Provide a clock for the nand controller
The clock is needed to configure optimized timings, so provide
one.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-18 16:17:04 +02:00
Steffen Trumtrar a308f2eb31 ARM: socfpga: socrates: register bbu handlers
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-18 08:19:25 +02:00
Steffen Trumtrar c926a121c0 ARM: socfpga: socrates: add qspi partitions
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-18 08:19:25 +02:00
Steffen Trumtrar 55652c147d ARM: socfpga: socrates: set alias for ethernet0
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-18 08:19:25 +02:00
Steffen Trumtrar 8a3aed7ef4 socfpga: remove dt entries that are upstream
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-18 08:19:25 +02:00
Ulrich Ölmann 80a2e48b49 ARM: socfpga: xload: support more qspi partitions
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-18 08:19:25 +02:00
Vicente Bergas 2fb0ef2053 fix ARMv8 interference with ARMv7
CONFIG_CPU_V8 is checked against 'y' and 'n', but the case when the
variable is unset is not considered.
This patch only checks the variable against a single value 'y' so the
logic is always coherent even when the variable is unset.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Tested-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-15 11:16:23 +02:00
Sascha Hauer 14e04d019b Merge branch 'for-next/imx' 2016-08-03 08:08:23 +02:00
Sascha Hauer a253879abb Merge branch 'for-next/clps711x' 2016-08-03 08:08:23 +02:00
Uwe Kleine-König 74102fdf73 ARM: i.MX: pcm043: add a flash-header.imxcfg
This creates an image that can be booted via USB.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-03 07:32:43 +02:00
Alexander Kurz 0443a43aa0 ARM i.MX31: Add i2c register convenience functions
Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-03 07:30:41 +02:00
Alexander Kurz 28a0baffb9 ARM i.MX31: add SPI support
The i.MX31 SPI interface was refered by freescale as spi_ver_0_4 in one
of their older vendor extended linux releases. spi_ver_0_4 differs only
in minor aspects to spi_ver_0_7 (i.MX35) which is already supported by
barebox.
Regarding barebox, the differences boil down to the location and length
of the CHIP SELECT and BIT COUNT/BURST LENGTH elements of CONREG. The
spi_ver_0_4 variant is limited to single word bursts with a maximum of
32 bits_per_word.

Add support for the i.MX31 SPI interface to the barebox spi_ver_0_7
implementation.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-03 07:30:41 +02:00
Lucas Stach 0c61905025 ARM: nitrogen: rename to nitrogen6
Now that the MAX variant of the board is also supported by the
same code, rename the board directory to the more generic nitrogen6.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-03 07:30:41 +02:00
Lucas Stach b82e9f62d9 ARM: add support for Nitrogen6MAX QP variant
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-03 07:30:41 +02:00
Lucas Stach 550442a1a4 ARM: nitrogen6x: disable address mirroring
The Nitrogen boards don't need it and it's actively wrong
on the 4GB variants of those boards.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-03 07:30:41 +02:00
Lucas Stach ab3697d1de ARM: nitrogen6x: use imx6q_barebox_entry
Saves some boilerplate code by calculating the DRAM size
automatically.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-03 07:30:41 +02:00
Lucas Stach 470c90aa21 ARM: nitrogen6x: use upstream DTs
This gets rid of the (mostly) stub top level DTs in barebox
and switches the compatible to the proper "boundary" one.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-03 07:30:41 +02:00
Lucas Stach 4154abe271 ARM: imx: add QP as supported i.MX6 variant
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-03 07:30:41 +02:00
Ulrich Ölmann ea31b22e2e ARM: dts: i.MX6: update RIoTboard device tree
Barebox and kernel version diverged therefore bring the device tree up to date
with respect to the kernel being the reference.

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-03 07:30:40 +02:00
Sascha Hauer 4d85cb974a include: Move bulk of boot.h to bootm.h
The majority of the stuff currently in include/boot.h is about bootm
code implemented common/bootm.c. To be more consistent move it to a
new file include/bootm.h.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-26 08:31:31 +02:00
Andrey Smirnov 80c91b67cc i.MX: ocotp: Register regmap against orignal device
Register regmap against orignal device passed to probe, this way further
in the code/call-chain cdev's device_node will be correctly populated
and it will be discoverable via cdev_by_device_node()

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-19 06:50:34 +02:00
Alexander Shiyan 30f03f8b09 ARM: clps711x: clep7212: Register board env during runtime
Register the board specific environment during runtime using
defaultenv_append_directory(). Also this patch updates default config.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-18 08:15:45 +02:00
Alexander Shiyan c0eb6dbb94 ARM: clps711x: Sync CLK susbsystem with kernel
Refactoring of CLPS711X CLK driver code to be compatible with
the current kernel. This change a bit makes easy of initializing
devices using CLKs.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-18 08:15:45 +02:00
Alexander Shiyan 3ef2d78de6 ARM: clps711x: clep7212: Increase the wait state for chip select 3
CS3 is used for a variety of external bus devices.
Increase the wait state for this chip select for the possibility
of more widespread use.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-18 08:15:45 +02:00
Teresa Remmet a78f42079b ARM: phytec-som-am335x: Remove kernel and oftree partiton in NAND
We store kernel and oftree in static UBI volumes now. No need
for seperate partitions any more.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-13 07:22:39 +02:00
Sascha Hauer 50543054eb Merge branch 'for-next/ubi' 2016-07-11 07:58:34 +02:00
Sascha Hauer 4daa7a20c9 Merge branch 'for-next/omap' 2016-07-11 07:58:34 +02:00
Sascha Hauer f64075972b Merge branch 'for-next/misc' 2016-07-11 07:58:33 +02:00
Sascha Hauer e2da792a52 Merge branch 'for-next/imx' 2016-07-11 07:58:33 +02:00
Sascha Hauer 3203cdfa7b Merge branch 'for-next/arm64' 2016-07-11 07:58:32 +02:00
Sascha Hauer 28d7f7878c Merge branch 'for-next/arm' 2016-07-11 07:58:32 +02:00
Alexander Kurz 4f0abb8db0 ARM i.MX35: Add support for the Amazon Kindle3
The Amazon Model No. D00901 Kindle3 is an E-Book reader based on the
i.MX35 SOC. The device boots in internal boot mode from a build-in eMMC,
alternatively the device may be set into USB-downloader mode when the
Vol+ key is pressed on startup.

Add support for this device and make barebox a drop-in replacement for
the factory shipped u-boot image.
Constraints for the use as drop-in replacement:
- imximg header (offset 0x400) has a maximum size of 2kB minus 16 byte
  since the last 16 bytes are used to store a vendor specific hardware
  desctription identifier
- the bootloader space (application plus env) is limited to 256kB minus
  16 bytes when installed with offset of 4kB (the u-boot offset was 3kB).
  A vendor specific device identifier is stored in the gap between
  application and kernel. The vendor specific identifiers should not
  be overwritten.

Notable features:
- Support for eMMC, USB, UART, I2C, SPI and Keys (except keyboard)
- Full support for vendor specific ATAGs
- usbserial barebox console access by pressing Select button at startup,
  alternatively full console support on connector J14.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-11 07:51:44 +02:00
Uwe Kleine-König a157195b73 ARM: imx_defconfig: enable NAND_IMX_BBM and NAND_ALLOW_ERASE_BAD
The first is important for imx systems with NAND. The second is a useful
debug aid that doesn't change behaviour without being explicitly enabled
at runtime. So both should be safe.

The other changes result from MFD_MC13XXX and SPI_IMX being selected by
MACH_PCM038 since 4bd07a1039 ("arm: imx: select MFD_MC13XXX for all
boards that need it") and a move of a few Kconfig definitions in
7839011f61 ("bootm: Move bootm options to common/Kconfig").

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-11 07:49:23 +02:00
Alexander Shiyan 9d7abf2792 mfd: mc13xxx: VGEN1 and VGEN2 voltage bits positioned in "Regulator Setting 0" register
The bits VGEN10-11 and VGEN20-22 is positioned in the Regulator Setting 0
register. This patch fixes these definitions and board (Efika MX), which
uses this voltages.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-07 09:48:58 +02:00
Lucas Stach b06ecabed9 ARM: i.MX: iim: fix potential out of bounds array access
The check is off-by-one.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-07 09:44:46 +02:00
Sascha Hauer 8c8b38efbb ARM: i.MX: karo-tx6: Add support for the 512MiB i.MX6s variant
This adds support for the TX6S-8x35 board variant.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 16:27:20 +02:00
Raphael Poggi 10bf671754 arm: include: swab: use rigth assembly for armv8
Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 11:23:50 +02:00
Raphael Poggi ac04e93326 arm: boards: add mach-qemu and virt64 board
Introduce mach-qemu and add qemu virt64 board which emulates arm64 board.

Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 11:23:49 +02:00
Raphael Poggi 7cc98fbb61 arm: cpu: add basic arm64 mmu support
This commit adds basic mmu support, ie:
        - DMA cache handling is not supported
        - Remapping memory region also

The current mmu setting is:
        - 4KB granularity
        - 3 level lookup (skipping L0)
        - 33 bits per VA

This is based on coreboot and u-boot mmu configuration.

Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 11:23:49 +02:00
Raphael Poggi ada79ea079 arm: cpu: disable code portion in armv8 case
Enclosed by #if directive OMAP specific code
and mmu_disable (ARMv8 code will implemented it somewhere else).

Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 11:23:49 +02:00
Raphael Poggi 9159f08ae7 arm: cpu: cpuinfo: add armv8 support
Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 11:23:49 +02:00
Raphael Poggi c606a266b7 arm: include: system_info: add armv8 identification
Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 11:23:49 +02:00
Raphael Poggi 9ff1fbde76 arm: include: bitops: arm64 use generic __fls
Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 11:23:49 +02:00
Raphael Poggi a5501914e6 arm: include: system: add arm64 helper functions
Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 11:23:49 +02:00
Raphael Poggi 928cc6f4ee arm: cpu: add arm64 specific code
This patch adds arm64 specific codes, which are:
	- exception support
	- cache support
	- rework Makefile to support arm64

Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 11:23:48 +02:00
Raphael Poggi e1287b1a8b arm: rework lib directory to support arm64
This commit create a common directory, lib/,
for arm and arm64 common code.

It also create lib32/ and lib64/ for 32bit
and 64bit code respectively.

Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 11:23:48 +02:00
Raphael Poggi 375170a3c9 arm: Makefile: rework makefile to handle armv8
Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 10:21:16 +02:00
Raphael Poggi 053957b306 arm64: add armv8 Kconfig entries
Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-06 10:21:16 +02:00
Sascha Hauer e9edf7f61b ARM: bootm: Fix compiler warning
fixes:
arch/arm/lib/bootm.c:92:137: warning: comparison of distinct pointer
types lacks a cast

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-05 21:29:38 +02:00
Alexander Kurz 3f9c7ea2d8 ARM i.MX31 iomux: remove duplicates with alternate name
Three iomux were accessinble with two distinct names, typo?
Remove the unused duplicates.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-04 11:48:03 +02:00
Alexander Kurz 492ce4431d ARM i.MX31 iomux: remove obvious duplicates
No need to define some of the iomux twice, remove the duplicates.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-04 11:48:03 +02:00
Alexander Kurz ca07b91eff imx35-regs: add and use common CGR element shifters
Add some missing Clock Gate Register element shifters which were implemented
as magic numbers in the arm/boards directory. Use the new shifters for
inproved code readability.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-04 11:47:58 +02:00
Stefan Müller-Klieser 6a218d456c ARM: bootm: recalculate decompression space
According to the kernel documentation it is recommended to place the
compressed image between 32 MiB and 128 MiB. The DTB and initrd should
be placed above 128 MiB. We will follow the recommendation as long as we
have enough RAM. If this is not the case, we fall back to the scheme.
This change is required because of the ARM default kernel config changes
regarding RODATA layout, which lead to an increased compression factor
of the kernel image.
This should be regarded as an intermediate solution until there is a
mechanism for the kernel image to report the decompressed layout
requirements to the bootloader.

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-04 11:31:05 +02:00
Alexander Kurz 59a2582df5 eukrea-cpuimx35: Fix wrong clock gating for ESDHC1
With commit 962d8b89d2 ("imx35-regs: add defines for USB and SD") the
shifter argument for the iMX35 ESDHC1 CGR instance has been erroneously
assigned to CGR1 instead of CGR0. Fix this for the eukrea-cpuimx35 board.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-04 09:32:56 +02:00
Alexander Kurz 2a760a7c1e ARM i.MX: de-duplicate PLL initializer macros
Macros for three PLL setups got cloned in different board specific subdirs.
Re-unify those macros into a common place and avoid checkpatch 80-char
warnings when creating a new board subdir.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-04 09:31:41 +02:00
Alexander Kurz 7e97af8858 ARM: i.MX: central SOC type definition
Move the definition of iMX CPU types to an individual file to allow
on-purpose inclusion. Eliminate magic number CPU type encoding in the
scripts/imx subdir using the new include file.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-04 09:30:56 +02:00
Alexander Shiyan 22247f0976 ARM: i.MX clk-pllv1: Do not use a negative value for the unsigned variable
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-30 08:45:59 +02:00
Alexander Shiyan 65a12abb52 ARM: i.MX clk-pllv2: Do not use a negative value for the unsigned variable
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-30 08:45:46 +02:00
Teresa Remmet 53bad16e00 ARM: phytec-som-am335x: Add backup partition for barebox
Add a redundant barebox partition to improve nand safety at
least a little bit.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-30 08:37:24 +02:00
Teresa Remmet 3368a42e72 OMAP: am33xx_bbu_nand: Extent barebox update handler
Make it possible to write barebox image to multiple partitions
like xload partitions.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-30 08:37:24 +02:00
Teresa Remmet 7bfb94f978 OMAP: xload: nand: Check for redundant barebox partition
Add a support for a redundant barebox backup partition if loading
barebox image from first barebox partitions fails.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-30 08:37:24 +02:00
Teresa Remmet 3280bc6331 OMAP: xload: Factor out reading image from mtd partition
Remove code duplication of reading images out of mtd partitions.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-30 08:37:24 +02:00
Alexander Kurz 0544df5be6 ARM: boot: add prepend option for board specific ATAGs
Board specific ATAGs might be passed to vendor provided kernels via the
ARM_BOARD_APPEND_ATAG option. In this case, the board specific ATAGs will
be appended to the end of the ATAG list.
Anyway, some vendor provided kernels might crop the ATAG list at ATAG_MEM,
also chopping off the board specific ATAGs, see linux squash_mem_tags() as
reference. The Kindle-3 kernel is one example.

This conflict might be solved by a) making ATAG_MEM optional which might break
the existing behavour around squash_mem_tags() or b) by allowing the insertion
of board specific ATAGs in front of ATAG_MEM which violates the requirement
from Documentation/arm/Booting to order ATAGs by increasing address.

Add option to insert board specific ATAGs in front of ATAG_MEM.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-29 08:20:28 +02:00
Teresa Remmet 2c310bd8a9 ARM: am335x_defconfig: Enable ubi fastmap and ubifs
Enable support for ubifs and ubi fastmap.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-28 07:34:27 +02:00
Alexander Kurz db77cf3486 ARM iMX53: avoid magic number addressing for internal RAM
The imx53 SOC features 128kB of internal SRAM which is commonly used in
early stages of barebox to store the stack. Avoid magic numbers while
addressing this RAM.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-27 11:04:14 +02:00
Alexander Kurz 02ac9feb3d ARM: imx_v7_defconfig: enable LED_GPIO_OF
GPIO leds are widely used in imx_v7 related dts files. Enable support
to parse this data and enable blinking LED by defconfig on e.g. iMX53qsb.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-27 11:01:45 +02:00
Alexander Shiyan 34e6fd9189 ARM: i.MX: Remove unused procedure imx25_setup_weimcs
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-27 08:52:35 +02:00
Alexander Shiyan 6de2627a41 ARM: boards: variscite-mx6: Remove the excess assignment
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-20 08:34:16 +02:00
Sascha Hauer 849cd5cdb4 ARM: start: drop unnecessary variable
No need anymore to store arm_head_bottom globally as it's only used
in barebox_non_pbl_start(). Also rename the variable to malloc_end
which is more meaningful.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-20 08:30:34 +02:00
Sascha Hauer 0aa0bfc944 ARM: start: simplify board_data sdram allocation
We already have a pointer for barebox_boarddata, so use it to
request the corresponding SDRAM region instead of calculating
it again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-20 08:30:34 +02:00
Sascha Hauer 1e992a195c ARM: start: do not change barebox_boarddata
barebox_boarddata should stay the original boarddata and not
be modified. Keep a local pointer in barebox_arm_boot_dtb()
instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-20 08:30:34 +02:00
Sascha Hauer 22d7d604f1 ARM: start: Fix arm_mem_barebox_image for !CONFIG_RELOCATABLE
Fixes: 65071bd arm: Clarify memory layout calculation

arm_mem_barebox_image() shall return the beginning of the barebox
image (and thus the end of the malloc region). For relocatable
images we can return a suitable location, but for non relocatable
images we do not have a choice: We must return TEXT_BASE. If TEXT_BASE
happens to be outside the memory region between membase and endmem
we can return the base of the ramoops area.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Markus Pargmann <mpa@pengutronix.de>
2016-06-20 08:30:22 +02:00
Sascha Hauer d395a2d561 Merge branch 'for-next/mxs' 2016-06-14 09:13:41 +02:00
Sascha Hauer 0fcd7fdbb9 Merge branch 'for-next/imx' 2016-06-14 09:13:40 +02:00
Sascha Hauer 8b9a7f6dd9 Merge branch 'for-next/dts' 2016-06-14 09:13:39 +02:00
Sascha Hauer 2b948a834c Merge branch 'for-next/bootm' 2016-06-14 09:13:35 +02:00
Sascha Hauer bfcdde1553 Merge branch 'for-next/arm' 2016-06-14 09:13:26 +02:00
Sascha Hauer 86186c2322 dts: update to v4.7-rc1
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-13 12:43:53 +02:00
Lucas Stach 688c3035eb ARM: mba53: include barebox TQMa53 overlay DT
The barebox specific properties have not been applied as
the TQMa53 overlay DT has not been included. Fix this.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-01 09:28:09 +02:00
Alexander Shiyan fd5f9fc3ab MCI: imx-esdhc: Allow to use 1-bit bus width in board files
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-31 08:23:45 +02:00
Alexander Shiyan 268e2cee78 ARM: clps711x: Simplify clock initialization
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-23 09:51:13 +02:00
Alexander Shiyan 1b47607e89 ARM: imx51: Remove stale comment
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-23 09:49:41 +02:00
Sascha Hauer f2b07274d5 ARM: i.MX: iim: Remove debug printk
The dev_info is a debug leftover that was never intended to go upstream.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-20 07:59:35 +02:00
Andrey Smirnov ccebda1d4c aiodev: Add TEMPMON driver
Port TEMPMON driver from U-Boot

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-18 07:48:09 +02:00
Sascha Hauer daa1c4d511 ARM: i.MX: HABv3: Set to production mode
The HABv3 images for engineering mode do not work on a production device
and the images for production mode do not work on an engineering device.

When in engineering mode the ROM checks the images, but does not stop
booting when the signatures are wrong. This means a production image
can still be booted on an engineering device. This device can be
temporarily put into production mode by writing to the HAB_TYPE shadow
fuse register. After a reset the device will come up in production mode
and the image can be tested for validity. This means that if we have to
decide between production mode images and engineering images, the
production images are a better decision. Change this accordingly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-17 11:04:06 +02:00
Sascha Hauer aee7f5c561 ARM: i.MX: IIM: Add function to enable permanent write
This adds a function to enable/disable permanent write for the IIM
module so that C users no longer have to fiddle with device parameters.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-17 11:03:59 +02:00
Sascha Hauer 11e32a5a46 ARM: i.MX: IIM: Add functions to access fuses field wise
Accessing the IIM registers is cumbersome. The fuses are documented with
different register strides and there is no header file available, so the
different fields have to be read in the datasheets and translated into
the barebox format over and over again. This patch adds a header file
which has defines for the various fuses (for i.MX25 only so far, but
others can be added later) along with C functions to read/write the
fields.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-17 11:03:54 +02:00
Sascha Hauer 7839011f61 bootm: Move bootm options to common/Kconfig
bootm has a C API, so the bootm options have to depend on the
option providing the bootm code (CONFIG_BOOTM), not on the
option providing the command (CONFIG_CMD_BOOTM). Fixing the
dependencies makes it possible to fully use bootm from C without
enabling the bootm command support.
This also removes the CMD_ prefix from the options which means
we have to update the defconfigs aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 14:51:58 +02:00
Uwe Kleine-König 5399f211e6 ARM: mxs: add parameter to mx28_mem_init to allow custom memory config
Rename the already global array of default memory settings to make the
intended usage more obvious.

Also make generous use of the const keyword.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 08:13:48 +02:00
Sascha Hauer fd2f990204 Merge branch 'for-next/mtd' 2016-05-09 08:49:43 +02:00
Sascha Hauer 4cb8e17aa3 Merge branch 'for-next/misc' 2016-05-09 08:49:43 +02:00
Sascha Hauer 854df603da Merge branch 'for-next/include-pdata' 2016-05-09 08:49:42 +02:00
Sascha Hauer 55aca0a48c Merge branch 'for-next/include-cleanup' 2016-05-09 08:49:42 +02:00
Sascha Hauer 216f412ede Merge branch 'for-next/imx6-phytec' 2016-05-09 08:49:42 +02:00
Sascha Hauer 21981dbe6c Merge branch 'for-next/imx' 2016-05-09 08:49:42 +02:00
Sascha Hauer 23debc6fd9 Merge branch 'for-next/arm' 2016-05-09 08:49:42 +02:00
Stefan Christ 07511ba347 ARM: phytec-som-imx6: add automount for first partition on eMMC
For the phyCORE-i.MX6 add an automount command for the first partition
on the eMMC device.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-04 15:00:45 +02:00
Stefan Christ 95e1132633 ARM: phytec-som-imx6: add NOR for phycore-imx6 emmc
Enable NOR for phyCORE-i.MX6 DualLite and Quad eMMC variants.

Furthermore add an extra 'status = "disabled"' in the flash node.  It
has no functional effect, because the SPI bus node 'ecspi1' is disabled,
too.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:14:15 +02:00
Stefan Christ a6ec1b51a9 ARM: phytec-som-imx6: adapt main update handler for eMMC
Some phyCORE-i.MX6 variants have eMMC instead of a NAND chip. Provide an
update_handler for them.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:14:14 +02:00
Stefan Christ ac02c15b89 ARM: phytec-som-imx6: rename environment folder
The extra environment folder for the phyCORE-i.MX6 had the suffix
'-mira'. That's the name of a baseboard. Since the bootloader is generic
for all baseboards, use a generic suffix for the environment folder.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:14:12 +02:00
Stefan Christ da3938fbb8 ARM: phytec-som-imx6: update RAM calibration for phycore-imx6dl
Update RAM calibration values in the flashheader file for phyCORE-i.MX6
DualLite/Solo. These are verified and tested in the climatic chamber for
commercial, extended commercial, industrial and automotive i.MX6
variants.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:13:00 +02:00
Stefan Christ 313e01f83f ARM: phytec-som-imx6: add phyCORE-i.MX6 DualLite
Add Phytec phyCORE-i.MX6 SOM.
  Support:
   - imx6dl-phytec-phycore-som-emmc:
      - 1GB RAM on 1 Bank with 64Bit
      - 10/100MBit Ethernet
      - SPI NOR
      - eMMC
      - SD
      - UART

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:13:00 +02:00
Christian Hemp cb3fc0d022 ARM: phytec-som-imx6: add phyCORE-i.MX6 Quad 2GiB RAM
Add new Phytec phyCORE-i.MX6 SOM:
  Support:
    - imx6q-phytec-phycore-som-emmc:
       - 2GiB RAM on 1 Bank with 64Bit
       - 1GBit Ethernet
       - SPI NOR
       - eMMC
       - SD
       - UART

Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:13:00 +02:00
Stefan Christ c3318ae77f ARM: phytec-som-imx6: fix bootsource for phyCORE-i.MX6
The phyCORE-i.MX6 has either a NAND or EMMC storage device and an
external SD-Card interface. The automatic bootsource detection in the
barebox environment should reflect that.

- If the board was booted from the external SD-Card interface, it should
  continue loading the kernel and device tree from it.

- If the board was booted from EMMC, it should load kernel and device
  tree from the boot partition on the EMMC.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:13:00 +02:00
Stefan Christ 0a7a5e73aa ARM: phytec-som-imx6: add barebox partitions for MMC
Add missing MMC barebox environment partitions for the phyCORE-i.MX6
with EMMC. Otherwise the barebox cannot find the environment, when the
board is boot from sd-card.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:10:15 +02:00
Stefan Christ 52fdd510de ARM: dts: pfla02: use long enough reset for ethernet phy
Use a longer reset time for ethernet phy Micrel KSZ9031RNX.  Otherwise a
small percentage of modules have 'transmission timeouts' errors like

   barebox@Phytec phyFLEX-i.MX6 Quad Carrier-Board:/ ifup eth0
   warning: No MAC address set. Using random address 7e:94:4d:02:f8:f3
   eth0: 1000Mbps full duplex link detected
   eth0: transmission timeout
   T eth0: transmission timeout
   T eth0: transmission timeout
   T eth0: transmission timeout
   T eth0: transmission timeout

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:10:15 +02:00
Stefan Christ 90b2fa7e38 ARM: dts: imx6: phyboards: reduce clock speed for usdhc3
Due to hardware issues the usdhc3 interface on phyBOARD-ALCOR i.MX6 and
phyBOARD-SUBRA i.MX6 doesn't work reliable at 50Mhz.  You get
communication errors like

    barebox@Phytec phyBOARD SUBRA:/ ls /mnt/mmc/
    mmc2: detected SD card version 2.0
    mmc2: registered mmc2
    imx-esdhc 2198000.usdhc: timeout 2
    mmc2: Cannot read MBR/partition table

Therefore reduce the maximum clock speed to avoid these problems.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:10:15 +02:00
Jan Remmet 6444998184 imx6qdl-phytec-pfla02.dtsi: add i2c eeprom
add atmel,24c32 mounted on module

Signed-off-by: Jan Remmet <j.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:10:15 +02:00
Stefan Christ ca5964bf0b ARM: imx6q: add support for phyBOARD-SUBRA-i.MX6 Quad
Add support for phyBOARD-SUBRA-i.MX6 with phyFLEX-i.MX6 Quad 1GiB on one
bank. This patch factors out the common device tree nodes for the Quad
and Solo variant into 'imx6qdl-phytec-phyboard-subra.dtsi'.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:10:01 +02:00
Stefan Christ 8b0a448300 ARM: imx_v7_defconfig: add command mmc_extcsd
Enable the mmc_extcsd command to read and write MMC/eMMC registers.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:10:01 +02:00
Stefan Christ 075de1e537 ARM: imx_v7_defconfig: enable NANDTEST command
Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-02 08:10:01 +02:00
Sascha Hauer 9d5cf8d427 ARM: i.MX: karo-tx6: Add support for the 2GiB i.MX6q+ board variant
Different SDRAM setup, but same board otherwise.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:15:54 +02:00
Sascha Hauer 3fb70de496 ARM: i.MX: increase barebox partition sizes
After doing a 'saveenv' command, it is no longer possible to boot.

The reason for this behaviour is that the 'barebox' partition has
currently
a size of 0x80000 (512 kB), which is not sufficient to store the barebox
binary. This causes the 'barebox' and 'barebox-environment' partitions
to overlap.

Fix this problem by increasing the size of the 'barebox' partition and
by placing the 'barebox-environment' right after it.

This patch increases the barebox partition for all i.MX boards to
0xe0000

Reported-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-27 15:39:28 +02:00
Sascha Hauer 76007a8ed4 ARM: GuF Vincell: run code for LT variant aswell
The LT variant has a different compatible, yet we want to run the
code on this variant aswell. Add the corresponding test.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-27 15:37:37 +02:00
Sascha Hauer 339ea9f586 ARM: dts: Fix partition names
Partition names shouldn't be continuously numbered, instead the part
behind the '@' should match the reg property. Fix this for all ARM
device trees.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2016-04-27 11:16:10 +02:00
Sascha Hauer bbdb04b03f ARM: Bootm: FIT image handler depends on CONFIG_FITIMAGE
CONFIG_FITIMAGE is the variable to depend on, not
CONFIG_CMD_BOOTM_FITIMAGE which is only a wrapper option to
let CONFIG_FITIMAGE select from the bootm Kconfig menu.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-25 13:36:08 +02:00
Du Huanpeng fe03b34fbe whole tree: remove trailing whitespaces
Signed-off-by: Du Huanpeng <u74147@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-21 15:17:52 +02:00
Jason Cobham b8efd857b0 ARM: i.MX53: ccxmx53: Fix memory detection.
This patch fixes memory detection on the Digi ccxmx53 board.
Also updates dts to support nand.
Cleaned up whitespace?

Signed-off-by: Jason Cobham <cobham.jason@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-21 15:07:04 +02:00
Sascha Hauer 82a0c58680 ARM: bootm: Move mem_free calculation into get_kernel_addresses()
The callers of get_kernel_addresses() are not interested in the
spacing after the kernel image, they are interested in the
place where they can put device tree and initrd, so pass
a pointer to mem_free to get_kernel_addresses().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-20 08:34:25 +02:00
Sascha Hauer 3ae96610c5 ARM: bootm: Let get_kernel_addresses() determine SDRAM region itself
Move the call to sdram_start_and_size() into get_kernel_addresses() and
remove the now unnecessary parameter mem_start.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-20 07:51:41 +02:00
Sascha Hauer cb8cf33ce8 fix erasing/protecting flashes with unspecified size
fixes: 81737c1 mtd: Fix erasing of devices >4GiB

Several places erased a complete flash partition passing ~0 as count to
erase(). With the above commit count to erase was changed from an unsigned
type to a signed type, so the (count > f->size - offset) check in
erase() no longer triggers and the ~0 count is no longer adjusted to the whole
device size. Among other things this results in saveenv failures on NOR
flashes.
This patch fixes this by introducing an explicit macro for erasing the
whole device which is tested for in erase(). All other negative values
are rejected.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Giorgio <giorgio.nicole@arcor.de>
2016-04-19 08:26:51 +02:00
Teresa Remmet 6ccfd8c9e9 ARM: board: phytec-som-am335x: RAM timings for phycore-r2 1GB
Add new RAM Timings for phyCORE R2 with MT41K512M16HA-125IT
1024MB mounted.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-19 08:22:46 +02:00
Sascha Hauer 01f8f60cf0 stdio: rename getc to getchar
The function we have implemented as getc has the semantics of the
standard function getchar, so rename it accorgingly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-15 12:21:46 +02:00
Sascha Hauer 947fb5adf8 string: Fix (v)asprintf prototypes
Our asprintf and vasprintf have different prototypes than the glibc
functions. This causes trouble when we want to share barebox code
with userspace code. Change the prototypes for (v)asprintf to match
the glibc prototypes. Since the current (v)asprintf are convenient
to use change the existing functions to b(v)asprintf.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-15 12:21:45 +02:00
Sascha Hauer dd8244a422 include: Move ide platform_data to include/platform_data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-15 08:44:42 +02:00
Sascha Hauer a45ab7100c include: Move smc911x eth platform_data to include/platform_data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-15 08:44:42 +02:00
Sascha Hauer 044058fe90 include: Move dm9000 eth platform_data to include/platform_data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-15 08:44:42 +02:00
Sascha Hauer 041155f11c include: Move ns16550 serial platform_data to include/platform_data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-15 08:44:42 +02:00
Sascha Hauer 51b03f4844 include: Move fec eth platform_data to include/platform_data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-15 08:44:41 +02:00
Sascha Hauer 423204c619 include: Move designware eth platform_data to include/platform_data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-15 08:44:41 +02:00
Sascha Hauer a1c43792a5 include: Move smc91111 eth platform_data to include/platform_data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-15 08:44:41 +02:00
Sascha Hauer 472e36c752 include: Move ep93xx eth platform_data to include/platform_data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-15 08:44:41 +02:00
Lucas Stach 1bef2e8e8d ARM: tegra: set up stack before calling maincluster entry
Allows this code to work correct regardless of the used compiler
optimizations.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-14 08:50:36 +02:00
Sascha Hauer 0d12b0c82c ARM: i.MX: esdctl: Fix wrong driver name
The driver should be named imx_esdctl_driver, not imx_serial_driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-13 13:00:55 +02:00
Teresa Remmet d316cda736 mtd: nand: omap_gpmc: Remove BCH4 support
This has no users and seems to be untested. Removed it.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-12 08:16:03 +02:00
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
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 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
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 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
Sascha Hauer 43ab267ee0 ARM: i.MX: karo-tx6: add pr_fmt
Add pr_fmt to print tx6 specific messages with a proper prefix.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-07 09:07:17 +01:00
Sascha Hauer 2f5fa777cf ARM: i.MX: karo-tx6: disable power button
The power button is not part of the CPU module and can be triggered
wrongly on other baseboards. Disable it since we do not need it
currently.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-07 09:07:17 +01:00
Sascha Hauer 5f1b877591 ARM: i.MX: karo-tx6: Setup other PMICs
The TX6 boards come with 3 different PMIC variants from which we
currently only support the ltc3673. Detect the other two by i2c
address and set them up correctly. The code is based on the karo
U-Boot port.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-07 09:07:17 +01:00
Sascha Hauer 3bd69ad077 driver: replace dev_request_mem_region with dev_request_mem_resource
dev_request_mem_region doesn't work properly one some SoCs on which
PTR_ERR() values clash with valid return values from dev_request_mem_region.
Replace them with dev_request_mem_resource where possible.

This patch has been generated with the following semantic patch:

// <smpl>
@@
expression d;
expression n;
expression io;
identifier func;
@@
func(...) {
+struct resource *iores;
<+...
-io = dev_request_mem_region(d, n);
-if (IS_ERR(io)) {
+iores = dev_request_mem_resource(d, n);
+if (IS_ERR(iores)) {
...
-	return PTR_ERR(io);
-}
+	return PTR_ERR(iores);
+}
+io = IOMEM(iores->start);
...+>
}

@@
expression d;
expression n;
expression io;
identifier func;
@@
func(...) {
+struct resource *iores;
<+...
-io = dev_request_mem_region(d, n);
-if (IS_ERR(io)) {
+iores = dev_request_mem_resource(d, n);
+if (IS_ERR(iores))
-	return PTR_ERR(io);
-}
+	return PTR_ERR(iores);
+io = IOMEM(iores->start);
...+>
}

@@
expression d;
expression n;
expression io;
identifier func;
@@
func(...) {
+struct resource *iores;
<+...
-io = dev_request_mem_region(d, n);
-if (IS_ERR(io)) {
-	ret = PTR_ERR(io);
+iores = dev_request_mem_resource(d, n);
+if (IS_ERR(iores)) {
+	ret = PTR_ERR(iores);
...
}
+io = IOMEM(iores->start);
...+>
}

@@
expression d;
expression n;
expression io;
identifier func;
@@
func(...) {
+struct resource *iores;
<+...
-io = dev_request_mem_region(d, n);
+iores = dev_request_mem_resource(d, n);
+if (IS_ERR(iores))
+	return PTR_ERR(iores);
+io = IOMEM(iores->start);
...+>
}

@@
identifier func;
@@
func(...) {
<+...
struct resource *iores;
-struct resource *iores;
...+>
}
// </smpl>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-07 08:57:56 +01:00
Alexander Kurz 7fb798c2d3 arm/cpu/lowlevel: fix: possible processor mode change
This is a re-application of fix 17644b55.
arm_cpu_lowlevel_init() will set the processor mode to 0x13 (supervisor).
When this function is entered via a different processor mode, register
banking will happen to lr (r14), resulting in an invalid return address.
This fix will preserve the return address manually.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-04 07:58:48 +01:00
Sascha Hauer 0fef066433 ARM: i.MX: bbu-internal: detect device before writing to it
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Stefan Christ <s.christ@phytec.de>
2016-03-02 19:51:23 +01:00
Sascha Hauer c46988f380 ARM: i.MX: karo-tx6: Generalize 801x support
The device tree for the 801x variant only contains displays. The
displays are not part of the SoM, but instead of the baseboard,
so they should be described in a baseboard dts. With this patch
we rather include the common tx6x dtsi file and drop 801x from
the barebox device tree names.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-02 16:11:31 +01:00
Sascha Hauer bb0d5080d5 ARM: i.MX: karo-tx6: Add support for the i.MX6q 1GiB variant
The i.MX6q variant is basically the same as the i.MX6dl variant, just
with another SoC and the usual i.MX6q/i.MX6dl adjustments.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-02 16:07:27 +01:00
Sascha Hauer 572cfe6b52 ARM: i.MX: karo-tx6: Support eMMC board variants
The TX6 board come with either NAND flash or eMMC as primary
storage medium. This adds support for the eMMC variants.
We can detect if we have NAND or eMMC by looking at the
bootsource which will be configured accordingly. This
way we can modify the device tree during runtime and do
not have to create a new image.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-02 15:59:23 +01:00
Sascha Hauer 294beb87b1 ARM: i.MX: karo-tx6: Factor out a common tx6 dtsi file
The stuff we currently have in the i.MX6q dts file can be reused for
the i.MX6dl variants, so factor out a common dtsi file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-02 15:57:39 +01:00
Lucas Stach c44669e2b2 ARM: tegra: use dynamic malloc area size
Remove the fixed malloc area size from the defconfig and allow
barebox to calculate the size dynamically.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-01 10:14:42 +01:00
Lucas Stach cc4aa4e200 ARM: tegra: beaver: add missing serial alias
Upstream has dropped those from the base dtsi, as long as we can't
fully switch to the upstream board DT add the correct alias to the
barebox copy.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-01 10:14:42 +01:00
Tim Sander f3b493750a Terasic DE0-Nano-SoC: add support
v7: eof whitespace fixes

A Patch for supporting the Terasic DE0 NANO-SoC with barebox.
The pretty similar Socrates Board was taken as a starting point with pulling
in the memory timings/pinmux from
http://rocketboards.org/foswiki/view/Documentation/AtlasSoCCompileHardwareDesign

Signed-off-by: Tim Sander <tim@krieglstein.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-01 10:13:47 +01:00
Teresa Remmet a4bffb2313 ARM: am335x_defconfig: Enable the of_fixup_status command
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-01 08:25:48 +01:00
Sascha Hauer 3838a998c1 ARM: i.MX53-qsb: Fix gpio button polarity
Since 253fb33 (input: gpio-keys: convert to input framework) the
gpio-buttons are registered with the input framework which has the
side effect that they are activated during boot and no longer have
to be activated manually by activating the input device console.
This reveals that the gpio-button polarities are wrong: The autoboot
is no longer running through since a gpio button press is wrongly
detected.
Fix the polarities in the barebox dts for now to get back a working
board. A proper fix has been sent upstream to the kernel. Once this
has landed and propagated back to barebox this patch can be reverted.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-01 08:14:49 +01:00
Lucas Stach b731a61ab5 arm: bootm: be more clever about kernel spacing
When the kernel load address is chosen by the user/image we need
to check if the kernel needs to relocate itself before decompression.
If that's the case the spacing behind the kernel must allow for this
relocation without overwriting anything placed behind the kernel.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-01 07:32:13 +01:00
Lucas Stach a324fb5ace arm: bootm: unify kernel load address calculation
Instead of having the same logic for uImage and zImage types duplicated
in the code, split it out into a separate function. This does not change
the behavior of the calculation.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-01 07:32:13 +01:00
Alexander Kurz c8db6508d8 Kconfig: avoid tabs in help text
Tabs in kconfig help text will create unwanted indention artefacs when
the help text is scrolled horizontally. Replacing tabs with spaces.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-25 09:45:05 +01:00
Alexander Kurz f4594878f5 edb9302 eth: provide proper phy config
The evaluation boards EDB9302 and  Olimex-CS-E9302 both use a
KS8721BL transceiver in default strapping which is phy_addr=1

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-25 09:42:48 +01:00
Sascha Hauer 68a5d9c0eb ARM: socfpga: terasic sockit: Make locally used sys_mgr_init_table static
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-18 16:40:40 +01:00
Teresa Remmet 48921a46eb ARM: AM335x: Make use of ARM_USE_COMPRESSED_DTB
Use ARM_USE_COMPRESSED_DTB for all AM335x based board,
to reduce the image size even more.

Saves about 9kB in MLO image and 20kB in barebox image.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-17 08:20:59 +01:00
Teresa Remmet 49376db41d ARM: dts: beaglebone: Strip clocks in MLO device tree
Reduce even more size of beaglebone MLO device tree with stripping
the clocks.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-17 08:20:59 +01:00
Teresa Remmet b522f515f8 ARM: boards: phytec-som-am335x: New RAM Timings for phyCORE-AM335x-R2
Add RAM timings for phyCORE-AM335x-R2 256MB RAM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-17 08:20:59 +01:00
Arnd Beuscher b8755c1362 ARM: board: phytec-som-am335x: RAM timings for phyCORE-AM335x-R2
Add RAM Timings for new phyCORE-AM335x-R2 SoM with
512MB (MT41K256M16TW107IT).

Signed-off-by: Arnd Beuscher <a.beuscher@phytec.de>
Sigend-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-17 08:20:59 +01:00
Jan Remmet 9d8c6bbc7d ARM: dts: am335x-phytec: eeprom name
use eeprom as name like in the kernel. This is needed if you use the
state framework.
phycard: also fix index, it has address 0x54

Signed-off-by: Jan Remmet <j.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-17 08:20:59 +01:00
Teresa Remmet 1061650b26 ARM: am335x_defconfig: Enable watchdog support
Enable wdt driver and command.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-17 08:20:59 +01:00
Wadim Egorov b93b636c83 ARM: am335x_defconfig: Enable NANDTEST command
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-17 08:20:59 +01:00
Stefan Christ 233a2fbd9f ARM: imx6: physom: fix phyflex workaround on Dual and Solo
Since commit 764ae1647c ("ARM: i.MX: Add correct SoC type detection
for i.MX6") the definition of the function cpu_is_mx6q and cpu_is_mx6dl
has changed.  Before that change they match the SoM family Quad/Dual and
DualLite/Solo. After that change they are SoM specific. They match only
Quad and DualLite. There are extra functions cpu_is_mx6d and cpu_is_mx6s
for SoM Dual and Solo.

We have not seen any real world consequences of this problem yet.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-17 08:06:53 +01:00
Stefan Christ 41305f025e ARM: imx: clocksource: add new DT compatible
Since commit 0ff58575c9 ("dts: update to v4.5-rc1") the compatible
"fsl,imx6q-gpt" was removed from imx6dl.dtsi. Now there is only the
Solo/DualLite specific compatible "fsl,imx6dl-gpt".  Adapt the driver
for that change.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-17 08:06:53 +01:00
Stefan Christ 113e230d68 ARM: i.MX6: add function cpu_is_mx6s()
The cpu_is_mx6* function for the i.MX6 Solo was missing. All other
functions are already defined.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-17 08:06:53 +01:00
Steffen Trumtrar 1bfe0f66d7 ARM: imx6: add caam clks
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-12 15:55:55 +01:00
Sascha Hauer 7482ab4de1 Merge branch 'for-next/regmap' 2016-02-08 08:27:03 +01:00
Sascha Hauer 05261801e9 Merge branch 'for-next/input' 2016-02-08 08:26:35 +01:00
Sascha Hauer 6435fb09d8 Merge branch 'for-next/hab' 2016-02-08 08:26:35 +01:00
Sascha Hauer 129fb7d893 Merge branch 'for-next/fit' 2016-02-08 08:26:35 +01:00
Sascha Hauer e229ce086c Merge branch 'for-next/dts' 2016-02-08 08:26:32 +01:00
Sascha Hauer 6f04ca2d07 Merge branch 'for-next/arm' 2016-02-08 08:26:31 +01:00
Sascha Hauer 2ee6bb3504 ARM: i.MX: ocotp: Switch to regmap support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-05 15:13:29 +01:00
Sascha Hauer 09db5f43f9 ARM: i.MX: ocotp: Fix error bit handling
Instead of returning an error when a locked region is read, fill
the result with 0xbadabada to indicate a locked region is read.
This way a md -s /dev/imx-ocotp does not abort when it encounters
locked regions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-05 15:13:28 +01:00
Sascha Hauer 01cf83ba9c ARM: i.MX: ocotp: make priv the first argument of functions
Throughout our codebase the private context pointer is the first
argument to a function. Do this for the ocotp driver aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-05 15:13:28 +01:00
Sascha Hauer 07d45903e3 ARM: i.MX: ocotp: Explicitly access control register
Even when the control register has offset 0x0 it's still nice
to use a register define for it. Accessing priv->base directly
just looks wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-05 15:13:28 +01:00
Sascha Hauer a17adf3369 ARM: i.MX: ocotp: Fix fusebox size
All i.MX6 SoCs except the i.MX6SL have 4kbit fuses. The i.MX6SL has
2kbit fuses. Fix the device size accordingly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-05 15:13:28 +01:00
Sascha Hauer 9064a935cd ARM: i.MX: iim: Switch to regmap support
To provide consumers easier access to the IIM.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-05 15:13:28 +01:00
Sascha Hauer 796694c0b2 Make: i.MX: Allow to pass config file to cmd_imx_image
Pass the config file to cmd_imx_image as arguments to make it more
flexible. Also add the possibility for another arg containing additional
options.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-04 14:38:29 +01:00
Steffen Trumtrar c07b5e5964 ARM: i.MX25: fixup broken DryIce GPR
Fixup the DryIce Non-Non-Volatile-Memory GPR register.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-04 08:45:16 +01:00
Sascha Hauer 73b35531b7 ARM: i.MX53: CCXMX53: Move device tree out of dts/
The dts files accidently have been added to dts/. Move them to a proper
place.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-04 08:39:47 +01:00