9
0
Fork 0
Commit Graph

4482 Commits

Author SHA1 Message Date
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
Sascha Hauer 3fc80b8d3d scripts: imx: Generate signed images with imx-image
The imx-image tool can now generate signed images itself, so we can
switch to this mechanism:

- Move the CSF templates to header files which can be included by the
  flash config files
- remove images/Makefile.imxhabv4 which is no longer necessary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-04 08:29:17 +01:00
Sascha Hauer 0b57bfb12f scripts: imx-image: Support adding a Super Root Key to the image
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-04 08:29:16 +01:00
Sascha Hauer 2ff23512d9 imx: hab: rename driver dir to hab/
There's not only HABv4 but also HABv3. No need to put the corresponding
code in separate directories, so rename the habv4 directory to hab.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer 341d550c50 ARM: i.MX: Add HABv3 Kconfig variables
For signing i.MX images with HABv3 we need several certificates. Add
their pathes to Kconfig variables to make them available to the build
system.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Jan Luebbe ac55adb321 bootm: add initial FIT support
This implementation is inspired by U-Boot's FIT support. Instead of
using libfdt (which does not exist in barebox), configuration signatures
are verified by using a simplified DT parser based on barebox's own
code.

Currently, only signed configurations with hashed images are supported,
as the other variants are less useful for verified boot. Compatible FIT
images can be created using U-Boot's mkimage tool.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 22:45:42 +01:00
Sascha Hauer fedba5aaef crypto: add digest_alloc_by_algo()
In barebox the function digest_alloc() allocates a digest based on a string.
When a subsystem already uses an integer value to identify a digest it makes no
sense to create a string and pass it to digest_alloc(), where it is parsed
again. This patch adds the possibility to get a digest by an enum.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 22:45:41 +01:00
Sascha Hauer aded35ece4 bootm: move initrd code together
The initrd code is distributed in several places in the bootm code.
Move it all together in bootm_load_initrd().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 22:45:40 +01:00
Sascha Hauer 3f0835e074 bootm: Push dryrun to handlers
We can make the dryrun option more useful by calling into the handlers.
With this we can detect more cases that can go wrong during boot.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 22:45:36 +01:00
Enrico Jorns ba24403f24 arm: imx53-guf-vincell-lt: dts: do not specfiy fixed memory information
Setting a fixed memory size prevents from using the different board
variants with different memories equipped.

barebox is able to read RAM size informations from the imx53 RAM
controller and thus does not require this information passed via dts.

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 08:05:27 +01:00
Daniel Schultz 64a8df2f6d arm: am33xx: Master Osc clock speed handling
Setup the plls with Master Osc. clock speed from the SYSBOOT
Configuration Pin.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 08:01:06 +01:00
Daniel Schultz a4a28df47d arm: am33xx: Move function to read from Master OSC
Move the function to read the Master OSC speed from
the SYSBOOT Configuration Pin for reuse.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 08:01:06 +01:00
Uwe Kleine-König a03a3915d9 Add initial support for Netgear ReadyNAS 104
Currently only second stage booting from the vendor U-Boot is tested. I
don't want to flash barebox into NAND yet because UART-booting for
recovery doesn't work for me.

Working so far are:

 - UART
 - networking
 - nand flash

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-22 08:43:19 +01:00
Philipp Zabel 3fb0605542 ARM: cm-fx6: set proper hostname
Set the hostname to "utilite" or "cm-fx6".

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-22 08:40:44 +01:00
Sascha Hauer 80f6d5db30 ARM: bootm: Use kernel handler to start barebox image
barebox can be called with the kernel calling convention, so
we can reuse the handler instead of creating a barebox specific
handler.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-22 08:15:15 +01:00
Sascha Hauer 0bb6e4c533 bootm: introduce bootm_get_os_size
ARM do_bootm_linux is not only called with uImages but also with
raw images, so we can't use uimage_get_size() here. Introduce
bootm_get_os_size() which handles the different image types.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-22 08:15:15 +01:00
Sascha Hauer 777060edcb ARM: zImage: add missing free() in appended device tree code
oftree must be freed when the tree is successfully unflattened.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-22 08:15:14 +01:00
Lucas Stach 62c9a8c000 ARM: PXA: move HAVE_CLK select
Claiming that all of PXA has CLK implemented, while only PXA3XX
selects the relevant clock implementations causes lots of build
failures for the other PXA architectures.

Fix it by moving the HAVE_CLK select to the one PXA arch, that
actually has it.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-19 17:23:00 +01:00
Lucas Stach 20ce1814bf ARM: tegra: clean up lowlevel entry
The lowlevel startup function jumps directly to the main
cluster if we are already running there. This allows for a
significant cleanup of the board startup code by directly
using the FDT address available there.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-18 08:22:23 +01:00
Sascha Hauer 30b7c5ead3 input: gpio-keys: Use KEY_* keycodes
The gpio-keys driver takes ascii key codes from platform_data and Linux
keycodes from device tree. Convert the ascii keys over to Linux
keycodes to get rid of the special cases in the driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-13 16:28:08 +01:00
Sascha Hauer 6639c98acc input: move matrix_keypad_build_keymap() to C file
Future additions will make the function too big to live as a static
inline function. Move to a C file and while at it, move matrix_keypad.h
to include/input/ where it belongs to.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-13 16:28:06 +01:00
Fabio Estevam 53a573c014 imx233-olinuxino: Fix mx23_power_init() arguments
Commit 4d70da6 ("ARM: MXS: power-init: Add parameters to
mx28_power_init()") causes imx233-olinuxino to not boot anymore.

imx233-olinuxino is commonly powered from external input supply,
so adjust the mx23_power_init() arguments to reflect that.

Reported-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-12 09:41:37 +01:00
Sascha Hauer 96b115be94 Merge branch 'for-next/socfpga' 2016-01-11 13:11:08 +01:00
Sascha Hauer 70ef1cef5c Merge branch 'for-next/pstore' 2016-01-11 13:11:07 +01:00
Sascha Hauer b9a2512aaa Merge branch 'for-next/misc' 2016-01-11 13:11:06 +01:00
Sascha Hauer b1ebbe76eb Merge branch 'for-next/imx' 2016-01-11 13:11:06 +01:00
Sascha Hauer a7964180e1 Merge branch 'for-next/gcc5' 2016-01-11 13:11:06 +01:00
Sascha Hauer ae33625512 Merge branch 'for-next/dts' 2016-01-11 13:11:05 +01:00
Andrey Smirnov dba6b4919e ARM: Fix exception table setup in MMU-less mode
Add code necessary for correct initialization of exception vector
table when MMU is disabled.

Note: Only ARMv7 support is implemented

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-11 11:48:40 +01:00
Andrey Smirnov 5e246885da ARM: mmu: Add VBAR setup
Add code to make sure that normal vector exception table, when it is
used due to unavailability of the high vector table, was not re-mapped
from 0x0 via VBAR by someone else before us.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-11 11:43:07 +01:00
Andrey Smirnov 78bca28702 ARM: asm: Add convenience fucntions to access VBAR
Add two functions to get/set VBAR register.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-11 11:43:07 +01:00
Trent Piepho 85464314b1 OF: Fix fixups to fix Linux DT instead of Barebox DT
OF fixups cm_cogent_fixup() and hb_fixup() are supposed to modify the
Linux device tree.  And they did originally, but commit
e520a8cc46 changed them to use
for_each_compatible_node(), which iterates through the Barebox DT.
Use new for_each_compatible_node_from() to specify the Linux DT root
as the start point.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-08 08:30:56 +01:00
Trent Piepho 76b059f311 socfpga: Find partition with environment via device tree
socfpga would load the environment from a file named "barebox.env"
located on the device "/dev/mmc0.1".  Both those names are hard-coded
in the socfpga code and can't be changed.

Barebox supports selecting the location of the environment using a
"barebox,environment" node in device tree's "chosen" node.  And
recently supports specifying that the env should come from a file on
this device.

Change socfpga to use this mechanism by adding the appropriate device
node.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-08 08:30:56 +01:00
Trent Piepho 94a4dc04d4 cdev: When creating a new cdev, initialize device_node
If a new cdev doesn't have a device_node defined when passed to
devfs_create(), set it to the device_node of the parent device, if one
exists.

For non-partitions, like ocotp or eeprom devices, this is the correct
thing to do.  Partitions need to use, and do use, a different node.

The code from commit 274e0b8dc4 to set
device_node in ocotp can be removed.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-08 08:30:55 +01:00
Alexander Aring 3a0f397e9c arm: bcm283x: add rpi2 support
This patch adds Raspberry Pi 2 support in barebox. The features should
be the same like the current RPi status in barebox.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-07 12:35:25 +01:00
Alexander Aring 8430b90330 rpi: sync revision detection with u-boot
This patch adds parts from u-boot code for doing RPi revision detection
and take care about the "warranty bit". I got this bit on my RPi2.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-04 09:38:12 +01:00
Alexander Aring 801a8d40c1 bcm283x: mbox: align to cachesize
This patch change the align of mbox stack resource to 32. The reason is
that I had some experience with bcm2836 and the mbox implementation,
after setting the align to 64(on bcm2836) the issues was gone.

I found these values inside the u-boot implementation, they use 32
(bcm2835) and 64 (bcm2836).

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-04 09:38:12 +01:00
Alexander Aring 295d6763bf bcm2835: introduce mach-bcm283x
This patch changes the most part of mach-bcm2835 to mach-bcm283x. This
prepares to add RPi2 support which is a bcm2836. This patch changes the
Kconfig entry namens to BCM283X for drivers only. These drivers should
working the same in bcm2836.

While updating defconfig I added LED support/trigger option.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-04 09:38:12 +01:00
Alexander Aring 9bdfe1ff7f arm: bcm2835: fix indentation
This patch fix indentation in core.h of mach-bcm2835.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-04 09:38:12 +01:00
Trent Piepho c44e12f0bd socfpga: Allow setting partition xloader boots from for mmc
The xloader boots the 2nd stage barebox from socfpga_barebox_part when
using NOR.  But when using MMC it boots from a hardcoded "disk0.1".
Add the mmc device name to the partition description and use it for
mmc booting.

Add an extern declaration of socfpga_barebox_part to the socfpga
header so that a board can change it to use a different partition.

Initialize socfpga_barebox_part to the default value instead of NULL to
avoid the NULL check later.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-14 11:32:30 +01:00
Trent Piepho 1d31baf145 bootstrap: Boot barebox with kernel calling convention
In commit 8e3ddc13eb the bootm code was
changed to boot barebox using the same calling convention as the
kernel.  Which on ARM is to pass three arguments which are zero, an
architecture code, and a params pointer.

A 2nd stage barebox can be booted using lib/bootstrap, which is
different code from bootm.  This code just leaves garbage in the first
three parameters and so doesn't follow the convention.

Change it to be compatible with the ARM kernel booting convention.
This just sends a zero for the architecture, since the code for
architectures depends on boot[zmu] and something using bootstrap
wouldn't have those too.  And it just passes NULL for the params since
we don't have a way to pass a device tree from the preloader.

All users of bootstrap are ARM based, but the code is in lib so a
non-ARM board might someday make use of it.  If the current code would
work for them, then the change here will be ok too.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-14 11:13:32 +01:00
Andrey Panov 0c348c3f44 ARM: i.MX6Q: Embedsky E9: Convert environment paths in DTS to a new bindings
Signed-off-by: Andrey Panov <rockford@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-11 08:06:17 +01:00
Sascha Hauer a9e7e68279 ARM: dts: Add *.dtb.lzo to clean files
*.dtb.lzo are generated during compilatiion, delete them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-11 08:02:04 +01:00
Sascha Hauer 5e11907b7b ARM: Omap3: Remove useless inline
Silences gcc5 warning:

In file included from arch/arm/mach-omap/gpmc.c:31:0:
arch/arm/mach-omap/include/mach/sys_info.h:93:83:
warning: inline function 'get_sysboot_value' declared but never defined

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 11:05:49 +01:00
Lucas Stach 21854348c8 ARM: ccxmx53: properly guard initcall for multiimage
Make sure to not run this board specific initcall on any
other board.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 08:50:56 +01:00
Markus Pargmann 6c42710ae0 arm: Add RAMOOPS memory area
RAMOOPS is a driver that uses a reserved static memory region to store
the data from the last panic or boot. This helps to debug crashes at the
next boot while preserving the boot messages.

To guarantee a memory area that is not altered by barebox or the kernel,
this area is located at the end of the RAM right after barebox and
before the STACK. This ensures that changing barebox sizes do not
interfere with RAMOOPS.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 08:49:52 +01:00
Markus Pargmann 9280600522 arm: start: Add visible sdram region for barebox board data
This helps to understand and find problems with the memory layout of
barebox. It adds another entry for the board data that barebox
allocated.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 08:49:52 +01:00
Markus Pargmann 65071bd091 arm: Clarify memory layout calculation
The memory calculations used are all hardcoded into three different
files, start-pbl.c, uncompress.c and start.c. To make this more readable
and reliable, this patch gathers these information in barebox-arm.h with
static inline functions for the calculation of the memory offsets.

This patch also adds proper handling of different barebox/board data
sizes. Currently only 1MB+Alignment of RAM is reserved for Barebox and
board data. This could be too small for bigger devicetrees and barebox.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 08:49:52 +01:00
Markus Pargmann 2ab52a7b67 arm: boards: karo-tx6x remove definition of DIV_ROUND_UP
DIV_ROUND_UP is defined in include/linux/kernel.h. Use that instead.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 08:49:52 +01:00
Sascha Hauer a05d5c206c dts: update to v4.3-rc1
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 08:48:39 +01:00
Sascha Hauer fab8198323 Merge branch 'for-next/socfpga' 2015-12-08 08:28:58 +01:00
Sascha Hauer 9fdf56c8d4 Merge branch 'for-next/omap' 2015-12-08 08:28:41 +01:00
Sascha Hauer d10a05b410 Merge branch 'for-next/mtd' 2015-12-08 08:28:27 +01:00
Sascha Hauer 4b1430b653 Merge branch 'for-next/mmc' 2015-12-08 08:28:20 +01:00
Sascha Hauer 29ac6ac467 Merge branch 'for-next/imx' 2015-12-08 08:27:47 +01:00
Sascha Hauer fe68ba4526 Merge branch 'for-next/arm' 2015-12-08 08:27:08 +01:00
Andrey Smirnov 274e0b8dc4 imx: ocotp: Add code to initialize 'cdev->device_node'
In order for cdev_by_device_node() to be able to return approprate
character device for <&ocotp> phandle cdev->device_node needs to be
initialized with dev->device_node. This patche takes care of that

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-07 10:59:13 +01:00
Robert Jarzmik a964acd625 ARM: pxa: pxa2xx use PSPR for resume address
Both lubbock and mainstone suspend to RAM were broken by the same
typo. The linux kernel saves the resume address to PSPR, ie. the scratch
pad register, while it was PSSR which was checked in barebox.

Fixing this typo was tested on mainstone where resume from S3 works.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-07 10:48:11 +01:00
Trent Piepho a2b3a25417 ARM: Remove do_execute and thumb2_execute
In commit 104a6a7ccf support was added
for Thumb2.  It added do_execute() as a way to provide arch dependent
calling veneers for use in "go" and thumb2_execute() as the thumb2 to
arm veneer.

But thumb2_execute() isn't necessary as gcc generates a proper calling
sequence from a standard function pointer call.  Thumb2 barebox is
compiled with the AAPCS ABI which requires this.

It also had a bug and didn't pass the arguments properly, but code
execute via "go" rarely uses arguments so this wasn't very noticeable.

Since thumb2 was always the only user of do_execute(), go ahead and
delete that too.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-07 10:44:45 +01:00
Trent Piepho de7a09bb43 ARM: Remove kernel booting call for thumb2 mode
The asm code to do the actual call into the kernel (or another
barebox) when compiled in thumb2 mode isn't necessary.  gcc generates
a perfectly good calling sequence from a normal function pointer call.
If it didn't, the code in bootstrap_boot() that uses a function
pointer to jump to the 2nd stage barebox from an xloader wouldn't
work.

It appears to be allowed that the call to kernel() could return, as
neither start_linux() nor kernel() are marked noreturn, and there is
code after calls to start_linux().

The asm code has a bug in this case, as it uses bx and not blx, and
thus doesn't set the link register.  Since it's a tail call, this
would be okay, but only if the LR value from the start of
start_linux() (and the callee-saved registers) are restored
beforehand, which isn't done.  The gcc generated call sequence will do
this.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-04 08:15:23 +01:00
Florian Vallee 839aebc4fe eukrea-cpuimx35: update defconfig
enable chipidea usb driver

Signed-off-by: Florian Vallee <fvallee@eukrea.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-02 07:55:26 +01:00
Florian Vallee b4368c7437 eukrea-cpuimx35: setup usb through chipidea-imx driver
OTG and HOST port are tested with a mass storage device.

Signed-off-by: Florian Vallee <fvallee@eukrea.fr>
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-02 07:55:26 +01:00
Florian Vallee 3958e366fe imx35: register usb-misc by default
Signed-off-by: Florian Vallee <fvallee@eukrea.fr>
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-02 07:55:26 +01:00
Sascha Hauer 7da99e58bd video: i.MX IPUv3: Set ldb clocks correctly
The clocks for the LVDS display bridge have a fixed /3.5 and a
configurable /1,/2 divider in their path. The configurable divider has
to be explicitly configured for single/dual channel support, so we can't
rely on clock rate parent propagation here. Clear the
CLK_SET_RATE_PARENT flag for the configurable divider and configure the
clock explicitly in the ldb driver.
Tested on a custom i.MX6 board, currently untested on i.MX53.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-30 08:22:31 +01:00
Lucas Stach e7a8519963 ARM: mx6sx-sabresdb: set proper hostname
Also move the initcall to the level matching the name of the
function.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-30 08:22:30 +01:00
Lucas Stach c5478e10de ARM: mx6sx-sabresdb: drop unneeded makefile rules
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-30 08:22:30 +01:00
Sebastian Hesselbarth e67b4b1d02 arm: pxa: Remove pxa_get_nandclk()
With a common clock provided for NAND controller, get rid of the
mach/clock.h way of getting the NAND clock.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:00:09 +01:00
Sebastian Hesselbarth ad46a08f82 arm: pxa: Add clock for Zylonite NFC
Add a clock with clk_add_physbase for the NAND flash controller on
Zylonite board.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:00:09 +01:00
Sebastian Hesselbarth 968701de69 arm: pxa: Prepare for NAND clkdev lookup on PXA3xx
To allow PXA3xx nand driver to be reused on Marvell Armada 370/XP,
prepare to provide a common clock for the NAND driver on PXA3xx.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:00:09 +01:00
Trent Piepho 5537d653d2 mci: dw_mmc: socfpga: Supply bus-width in platform_data
Since there is no OF support in the xloader on socfpga it uses the
platform_data system.  There needs to be a way to supply the
equivalent of the DT property bus-width this way to support devices
that need to use a smaller bus.

So that we don't need to put every flag that might get added to the
MMC_CAP list into platform_data, just put the bus width ones into
platform_data.

The socfpga dts sources specify a bus-width of 4 so use that in the
platform_data for socfpga.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:52:10 +01:00
Marek Vasut edc1bfa1fe imx6-mmdc: Fix MAPSR usage
The commit ea1fb2f75d by Eric Nelson
imx6-mmdc: fix automatic power down enable in write level calibration

fixed the incorrect usage of the MAPSR register, but there is one more
place where the MAPSR is misused in the exact same way, so fix that as
well.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-13 10:34:54 +01:00
Sascha Hauer 63b8d87744 ARM: Fix bug in remap_range
remap_range takes generic MAP_CACHED/MAP_UNCACHED flags which are then
translated into the corresponding ARM specific bits. We call remap_range
internally from dma_alloc_* aswell, but instead of passing the generic
flags we pass the ARM specific bits.
Fix this by creating an internal __remap_range function which takes the
ARM specific bits and use it where appropriate.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-13 08:52:40 +01:00
Lucas Stach 8331fc5c1e ARM: ventana: remove unneeded clock init in DCD
The clock driver will overwrite those values anyway, so no
point in setting them in the DCD.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-13 08:06:25 +01:00
Sascha Hauer d925f1ed32 ARM: calculate compressed dtb len correctly
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-11 15:41:32 +01:00
Trent Piepho 3c8f016d9b socfpga: Initialize emac physels to RGMII correctly
A comment in the socfpga init said that it was "Clearing emac0 PHY
interface select to 0", but this was doubly incorrect.  It was setting
physel for emac1, not emac0, and it was setting physel to 1 (RGMII)
not 0 (GMII).  All supported socfpga boards use RGMII, and use emac1,
so fix the comment to reflect the code.  But then extend the code to
set the physel for both emac0 and emac1, so it can work on boards that
use either or both emacs (which are called gmac0/1 in the dts).

The Cyclone V datasheet, page 17-60 "EMAC HPS Interface
Initialization", says to set physel while the EMAC is in reset.  So
place the EMAC in reset while changing physel.  The emacs are not in
reset as code earlier in the boot has already taken most of the
modules out of reset.  So put them back in reset while the physel is
changed.  The Linux kernel does it this way too.

If barebox has no network support, there is not much point in
configuring the emac physel lines.  This would be the case for the
xloader pre-bootloader config, which configures physel, doesn't use
the network, loads the main barebox, which then reconfigures physel
again.  Make this code depend on CONFIG_NET so it's just done in the
main barebox.  The Linux kernel does not need barebox to do this
initialization to use networking.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-11 09:06:26 +01:00
Christian Hemp e4c00a8b11 ARM: imx6dl: Add support for Phytec phyCORE-i.MX6 SOM
Add Phytec phyCORE-i.MX6 SOM.
     - imx6dl-phytec-phycore-som-nand
        - 256GB RAM on 1 Bank with 32Bit
        - 10/100MBit Ethernet
        - NAND
        - SD
        - UART

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>
2015-11-11 08:39:41 +01:00
Sascha Hauer 99c9da2817 ARM: omap: Use correct device to mount on /boot
The current code tests if a partition (i.e. disk0.0) exists and instead
of mounting boot from this partition it uses the whole device (disk0).
This only works because the the FAT code accepts a MBR as input and
automatically skips it.

Let the code use the partition to mount /boot instead as it was
intended. We don't have to stat() the partition device, since this
error will be caught by mount() anyway, so remove the unnecessary
stat().

Reported-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-10 09:03:06 +01:00
Uwe Kleine-König acc017737f ARM: don't let the unwinder depend on exception handling
To be able to use dump_stack() without support exception handling the
definition of dump_stack has to move to a file that is actually compiled
without ARM_EXCEPTIONS.

Fixes: d332597c7c ("ARM: make exception handling optional")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:50:07 +01:00
Christian Hemp 813d5e00bf ARM: imx6q: Add support for Phytec phyCORE-i.MX6 SOM
Add Phytec phyCORE-i.MX6 SOM.
    Support:
     - imx6q-phytec-phycore-som-nand:
        - 1GB RAM on 1 Bank with 64Bit
        - 1GBit Ethernet
        - SPI NOR
        - NAND
        - SD
        - UART

     - imx6q-phytec-phycore-som-emmc
        - 1GB 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: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:38:53 +01:00
Stefan Christ d2bd828451 ARM: imx6q: pfla02: add phyFLEX-i.MX6 DualLite 1GiB on one bank
Add support for phyFLEX-i.MX6 DualLite 1GiB on one bank with NOR.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:38:53 +01:00
Stefan Christ ec8b0e4afd ARM: imx6dl: pfla02: Add support for 128MB and 256MB RAM
Add support for phyFLEX-i.MX6 Solo with 128MB and 256MB RAM on one
memory bank.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:38:53 +01:00
Stefan Christ fecd788e56 ARM: imx6q: pfla02: Add support for 512MiB RAM on one bank
Add support for phyFLEX-i.MX6 Quad 512MiB RAM on one bank.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:38:53 +01:00
Stefan Christ 4efef862d8 ARM: pfla02: append suffix 1bank
In the current naming schema the phyFLEX-i.MX6 variants which only use
one bank for memory have the suffix "1bank". The variants which use two
banks of memory have no suffix.

The patch fixes the name of the phyFLEX-i.MX6 Solo variant with 512MiB
on one bank. So the name of the image file changes from
    barebox-phytec-pbab01s-512mb.img
    barebox-phytec-phyboard-subra-512mb.img
to
    barebox-phytec-pbab01s-512mb-1bank.img
    barebox-phytec-phyboard-subra-512mb-1bank.img

This patch touches the phyFLEX-i.MX6 Kit variant and the
phyBOARD-SUBRA-i.MX6 which shares the same phyFLEX-i.MX6 module.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:38:53 +01:00
Christian Hemp d44ee9e242 ARM: phytec-som-imx6: update environment
Rename sd-ext3 to mmc, remove filesystem type from bootargs and remove
bootargs-ip. Add init script 'bootsource' to set boot source priority
and bootscript 'spi' for SPI NOR.

Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:38:53 +01:00
Stefan Christ 40150d43c7 ARM: phytec-som-imx6: set loadaddr to start of DDR memory.
The loadaddr in the flash-headers for the phyFLEX/phyCARD-i.MX6 was set
to 0x20000000 (512MiB). The start of the DDR memory in CPU's memory map
is 0x10000000 (256MiB). So the ROM loader loads the barebox image at the
memory position 256MiB and higher in the DDR memory.

This is a problem when the module doesn't have more than 256MiB of
memory. Therefore the loadaddr is set to the start of the DDR memory.

The patch was tested on a phyFLEX-i.MX6 Quad with 1GiB RAM on one bank
and on a phyCARD-i.MX6 Quad 1GiB RAM on two banks.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:38:53 +01:00
Stefan Christ a540c30359 boards: Add phytec-som-imx6
The main idea behind this patch is to avoid redundant code.  Because of
the module similarities of all i.MX6 based phytec boards, we can merge
its code.

The phytec-som-imx6 merges the code of all i.MX6 based phytec SOMs.  So
we will have only one "board" in the barebox for phyCARD-i.MX6 and
phyFLEX-i.MX6.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:38:53 +01:00
Stefan Christ 54f9f8564f ARM: imx6: phycard: use numeric suffix in device tree
Use numeric suffix for 'environment-sd3' in device tree.  This patch
prepares phytec-phycard-imx6 for the SOM unification.

Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:38:53 +01:00
Lucas Stach 713bff852e ARM: microsom: get MAC address from fuses
The production models have the MAC fuses blown, so we can use a
real MAC address instead of a random one.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:32:27 +01:00
Lucas Stach b4b3706960 ARM: microsom: make ETH work on production modules
The pre-production modules had an external crystal to generate the PHY
reference clock. Production modules rely on the i.MX6 to output the
correct clock.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:32:27 +01:00
Lucas Stach 4641ece146 ARM: microsom: add full set of module variants on Hummingboard
Now that we have a full set of DRAM configuration entries we can
build images for the full set of modules on Hummingboard.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:32:27 +01:00
Lucas Stach c28e522b0d ARM: microsom: import DCD from SolidRun U-Boot
This is a complete set of DRAM configuration values for all of the
MicroSOM variants extracted from SolidRun U-Boot.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:31:31 +01:00
Lucas Stach 1071a1d78a ARM: microsom: change barebox image name for Hummingboard
To reflect that the current image is in fact for a combination of a
MicroSOM i1 with a Hummingboard baseboard.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:31:31 +01:00
Lucas Stach 2fb71a0ce7 ARM: microsom: delete cargo-cult from Makefile
No need to carry this cruft around. It's not needed anymore.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:31:08 +01:00
Lucas Stach 95e8fa01d9 ARM: imx6: add MMDC arbitration control register define
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:31:08 +01:00
Sascha Hauer b5c7b09c8a Merge branch 'for-next/mvebu' 2015-11-06 16:10:44 +01:00
Sascha Hauer 1d9295b344 Merge branch 'for-next/misc' 2015-11-06 16:10:42 +01:00
Sascha Hauer 3cdd30342b Merge branch 'for-next/memtest' 2015-11-06 16:10:37 +01:00
Sascha Hauer 5b476ef5e5 Merge branch 'for-next/imx' 2015-11-06 16:10:35 +01:00
Sascha Hauer 812a0fd6b8 Merge branch 'for-next/arm' 2015-11-06 16:10:29 +01:00
Anton Bondarenko 080a713d31 embedsky-e9: enable barebox_update command for booter update
Simplify booter update with barebox_update command using special
IMX6 MMC BBU handler.

Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-05 09:05:07 +01:00
Trent Piepho a341b4d813 omap socfpga: Switch in flash env loading to use different config
On these systems, the base arch has code to load the in flash
environment from a file located in a FAT filesystem.  This was
controlled by the config option DEFAULT_ENVIRONMENT.  However, that
option turns on compiling the env into the barebox binary itself, as a
backup if the in flash env can't be loaded.

Most other boards have in flash env support unconditionally.  But omap
and socfpga also have xloader configurations, which aren't supposed to
have environment support, either in flash or compiled in.  If the in
flash env code were unconditional, then the xloaders would gain it.

So the code depends on ENV_HANDLING, which is only set on those boards
that are supposed to have an in flash env and not set on all the
boards that aren't supposed to have it.

If someone wanted to create a board that did have a saved env, but
used an alternate to this generic omap/socfpga file in FAT method,
then they'd probably want to create a new config option to control
this code and have it not be enabled for their board.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-05 09:03:17 +01:00
Teresa Remmet e6b5597ac6 ARM: am335x_defconfig: Enable SMSC phy driver
The phyCORE-AM335x has a SMSC phy mounted. Enabled the driver for it.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-05 08:59:43 +01:00
Teresa Remmet b3ff4794e3 dts: phyFLEX-AM335x: Disable second ethernet interface
There are phyFLEX modules with only the first eth phy mounted.
As barebox only supports the first interface anyway, disable
the second interface for now.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-05 08:59:43 +01:00
Sascha Hauer b792124a7d rework remap_range
remap_range is for remapping regions with different cache attributes.
It is implemented for ARM and PowerPC only, the other architectures only
provide stubs.
Currently the new cache attributes are passed in an architecture specific
way and the attributes have to be retrieved by calls to
mmu_get_pte_cached_flags() and mmu_get_pte_uncached_flags().
Make this simpler by providing architecture independent flags which can
be directly passed to remap_range()
Also provide a MAP_ARCH_DEFAULT flag and a arch_can_remap() function.
The MAP_ARCH_DEFAULT defaults to whatever caching type the architecture
has as default. the arch_can_remap() function returns true if the
architecture can change the cache attributes, false otherwise. This
allows the memtest code to better find out what it has to do.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 07:27:44 +01:00
Anton Bondarenko 79b813851f embedsky-e9: cleanup and reorder DTS nodes
Removed duplicate ldb node. Removed disabled nodes

Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-02 09:22:45 +01:00
Andrey Smirnov 33d482fdd3 arm/cpu: Avoid multiple definitions of barebox_arm_entry
All versions of barebox_arm_entry (in uncompress.c, start.c and
start-pbl.c) appear to be doing exacty the same thing. So move the
definition into a separate file and use IS_ENABLED macro to avoid
re-definition.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-02 08:39:22 +01:00
Andrey Smirnov 2c68f4e53c arm/cpu/start.c: Distil some common code in __start().
Both barebox_boarddata and barebox_boot_dtb perform essentially the
same function -- hold a pointer to a chunk of private data. Since only
one variable is ever used at any given time we may as well merge those
two variable into one. This also allows us to share more code between
two boot paths (board data vs. device tree)

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-02 08:31:58 +01:00
Andrey Smirnov 48d6151029 ARM: Add support for semihosting
Add semihosting API implementation and implement a filesystem driver
to access debugging host filesystem using it.

Tested on Freescale SabreSD board (i.MX6Q) using OpenOCD

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-30 08:06:03 +01:00
Lucas Stach 33d3286460 ARM: imx6: add OF fixup to delete nonexistent CPU cores
Make sure that the DT passed to Linux reflects the actual number of CPU
cores present in the system by reading the SCU configuration. As both
the Q and DL variants of the MX6 have versions with cores fused away,
but the DTs have the maximum number of cores specified, this just deletes
any nonexistent CPU core nodes.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-27 17:08:02 +01:00
Michael Grzeschik 97d5514a02 ARM: i.MX6: add Technexion Wandboard support
This adds support support for the i.MX6 Technexion Wandboard. The
board comes in different SoC variants and different amounts of RAM.
The baord type is autodetected based on the SoC type, so all boards
can be supported by the same binary image.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-27 11:13:08 +01:00
Sascha Hauer cfcb530075 ARM: i.MX6dl: dts: include arm/imx6dl.dtsi from board files
Otherwise boards cannot include board files from the kernel dts
without getting the file ordering wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-27 10:52:29 +01:00
Sascha Hauer 58eae8361c ARM: Allow compressed dtb binaries
In the current multi image build process the DTBs end up uncompressed
in the PBL. This can be annoying because the PBL is often very size
constrained.
This patch allows to put the DTBs in as lzo compressed binary into
the PBL. Since lzo offers quite good compression ratios for DTBs no
other compression algorithm has been implemented for now.
Boards which want to use the compressed DTBs only have to change
the __dtb_ prefix in the DTB name to __dtb_z_. Also they should select
ARM_USE_COMPRESSED_DTB to make sure barebox supports uncompressing
the DTB.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-27 10:02:28 +01:00
Sascha Hauer fcc6020164 ARM: Eltec-hypercam: Add missing dcdofd in flash header
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-27 08:34:40 +01:00
Lucas Stach 1678dcf7ca ARM: imx: clocksource: add new DT compatible
The i.MX6 DL/S DT has been changed to use more specific compatibles as
GPTv2 has a different programming model for modes used in Linux. This
difference doesn't matter for Barebox, but the old mx31 compatible has
been dropped from the DT, so we need to match on the one still present.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-26 15:06:58 +01:00
Eric Nelson 52cadd7ec3 imx6-mmdc: restore RALAT/WALAT in MMDC0, not MMDC1
Signed-off-by: Eric Nelson <eric@nelint.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-26 07:54:41 +01:00
Eric Nelson ea1fb2f75d imx6-mmdc: fix automatic power down enable in write level calibration
Bit 0 of the MAPSR register controls auto power down.

Explicitly clear this bit instead of reserved bit when
exiting from mmdc_do_write_level_calibration().

Signed-off-by: Eric Nelson <eric@nelint.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-26 07:51:43 +01:00
Sascha Hauer fe89df4ed9 scripts/kwbimage: Make BINARY files relative to config file
The BINARY files given in the config files are expected to be relative
to the place kwbimage is called from. This is bad since it breaks where
kwbimage is called from the build directory and not the source
directory.
It makes more sense to make the paths in the config files relative
to the config files which works with out of tree builds and is also
more what a user normally expects.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-19 08:39:25 +02:00
Andrey Smirnov 4ef026c304 arm: Disable unaligned accesses
From reading ARM architecture related documentation if appears that
while unaligned memory access is supported by the processor in general
it is not supported if MMU is disabled.

The problem in question can be easily reproduced by building the code
without this patch, MMU disabled, and trying to run 'memtest'
command. Which would in turn call mem_test() which would eventually
call show_progress(). That last function, if build without
-mno-unaligned-access would result in unaligned memory access which
would result in Barebox hanging.

This patch instructs the compiler to not generate any unaligned
accesses to memory thus avoiding the problem.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-15 08:56:21 +02:00
Lucas Stach 611e86d581 ARM: imx6: set shared attribute override bit in PL310
In order to make the system compliant to the ARMv7 ARM RevC clarifications
regarding conflicting memory aliases the shared override bit needs to be
set. This needs to be done in the bootloader, as the kernel will not apply
any modifications to the AUX_CTRL register by default, as it is a secure only
register.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-13 10:44:55 +02:00
Lucas Stach 95dfa1a847 ARM: imx6: use l2x0 header for register definitions
Instead of using a redundant definition. This makes things a bit cleaner
and also avoids to introduce another private define in the next patch.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-13 10:44:55 +02:00
Lucas Stach 37a81422fd ARM: l2x0: move outer cache flush on disable to user
There are systems like the Calxeda Highbank, which need to do SMC
calls in order to access the secure L2C registers, which means they
want to replace the outer cache disable function with their own.

As the cache flush before entering the boot target is still needed
and to avoid exposing L2C internals to the architectures move the
flush before disable into the only current user.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-13 10:44:55 +02:00
Lucas Stach b4e1bdbb50 ARM: l2x0: correct indentation
This is a trivial commit.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-13 10:44:55 +02:00
Andrey Smirnov 707ca96a1f freescale-mx6-sabresd: Add CONFIG_DEBUG_LL support
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-12 11:37:58 +02:00
Sascha Hauer dd4da6d328 Merge branch 'for-next/omap' 2015-10-07 08:23:45 +02:00
Sascha Hauer 181bb315d0 Merge branch 'for-next/mtd' 2015-10-07 08:23:45 +02:00
Sascha Hauer ddd7031b97 Merge branch 'for-next/imx-ldb' 2015-10-07 01:01:06 +02:00
Sascha Hauer 160bd3b360 Merge branch 'for-next/imx' 2015-10-07 01:01:06 +02:00
Vicente Bergas f54c032120 xload: be more flexible when searching for second stage bootloader.
A first stage bootloader can read fat and ext4 filesystems, and
even both can be compiled-in at the same time.
But then xload has a hardcoded fat filesystem mount option which
renders ext4 unusable.
This patch tries to mount it as ext4 if the fat attempt fails.

Then, a typical use case of an ext4 formatted filesystem
is it to be a standard linux filesystem, which contains
boot-related files in /boot. So, when searching for the second stage
bootloader, try /boot/barebox.bin after not finding it in /barebox.bin

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-02 09:10:16 +02:00
Edoardo Scaglia 49a1eeb04b at91sam9x5: fix ROM base address (bugfix for nand ECC)i
The ROM base address in the 9x5 processors lives at 1M, not 4M,
where SMD is, as defined later in the same file.

The ROM includes some tables that are used to build error-correction data
for NAND memory.  By using the wrong address, we get wrong data and
the result is undetected bit flips (data at 0x408000 is all zeroes).

Thus, even though our kernel was fixing bit errors in NAND, barebox
was not fixing them. With UBI (our situation) we got I/O errors because
the checksum verification for data nodes failed.

Using the proper address corrects the problem: barebox reports a
"bitflip" message, consistent with the kernel message for the same
file, and the files are properly loaded and booted.

Note: the kernel has the same wrong define, but then the magic number
0x00108000 as spelled in arch/arm/boot/dts/at91sam9x5.dtsi is used
instead of the symbolic name.

Signed-off-by: Edoardo Scaglia <scaglia@amelchem.com>
Signed-off-by: Federico Braghiroli <braghiroli@amelchem.com>
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-02 09:03:43 +02:00
Sascha Hauer a55684a9a0 ARM: i.MX: GuF Santaro: Fix panel support
The backlight enable gpio is in both the ldb node and the panel node.
Remove it from the ldb node where is was unused and fix the polarity
in the panel node. Also make the panel compatible to simple-panel to
let the driver match it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:08 +02:00
Sascha Hauer 6d39ac3158 ARM: i.MX: GuF Santaro: enable PWM
The PWMs now have to be enabled to use them. Enable the backlight PWM.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:08 +02:00
Wadim Egorov bdb26b1727 ARM: am33xx: Enable ethernet node on NET boot
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-29 09:35:13 +02:00
Wadim Egorov 7f89b686e0 ARM: dts: am335x-phytec-phycore-som: Disable mac node.
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-29 09:35:12 +02:00
Eric Bénard 46c14545cf eukrea-cpuimx25: update defconfig
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-29 08:47:27 +02:00
Eric Bénard d7f19aad72 eukrea-cpuimx25: enable dfu sequence conditionaly
this can be useful on the evaluation board but we don't want
the sequence to launch on custom board when there is not the
switch button on gpio 82

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-29 08:47:27 +02:00
Florian Vallee a266d5940c eukrea-cpuimx25: setup usb through chipidea-imx driver
OTG and HOST port are tested with a mass storage device.

Signed-off-by: Florian Vallee <fvallee@eukrea.fr>
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-29 08:47:26 +02:00
Eric Bénard 4f04790758 imx25: register usb-misc by default
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-29 08:47:26 +02:00
Florian Vallee 6b3bf88b7c eukrea-cpuimx25: fix boot
we need to disable second SD chip select properly else the SDRAM size
detection will detect it but there is no memory connected so the boot
will fail

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Florian Vallee <fvallee@eukrea.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-29 08:47:25 +02:00
Vicente Bergas 08f991ab21 archosg9: add display
Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-29 08:34:57 +02:00
Vicente Bergas 0b7bfa5253 archosg9: Use defaultenv-2-menu
Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-29 08:34:57 +02:00
Vicente Bergas 1fe4abeaf5 archosg9: re-generate defconfigs with "make savedefconfig"
Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-29 08:34:56 +02:00
Enrico Scholz 29986f9ff4 ARM: MMU: fixed calculation of number of PTEs
barebox uses 4KiB pages so that number of PTEs is 'size >> 12', not
'size >> 10'.

Thie 'size >> 10' limit is not an immediate problem because it allocates
too much PTEs only which are not used.  But it can overflow an integer
multiplication ('i * PAGE_SIZE') which causes undefined behaviour with
gcc5.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-21 08:11:35 +02:00
Enrico Scholz 485ef5279e ARM: MMU: fixed dma_flush_range() call
dma_flush_range() expects an address as second argument, not a size.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-21 08:11:20 +02:00
Lucas Stach 15c41beb5b ARM: add implementation for dma_alloc_writecombine for !CONFIG_MMU
This fixes build failures in builds without MMU support by providing
a fallback implementation.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-14 07:59:11 +02:00
Daniel Schultz afba8f9223 ARM: dts: Include strip file to Phytec am335x MLOs
This patch disables the clocks in the Phytec am335x MLOs and reduce the MLO
size by 9kb.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-09 08:59:51 +02:00
Daniel Schultz 62ab2e6e1e ARM: dts: Add include to strip am33xx clocks
Include this file to disable all clocks.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-09 08:59:46 +02:00
Daniel Schultz 758630aefc ARM: am335x: Register eMMC MLO handler
Register the eMMC MLO handler to the barebox_update command.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-09 08:59:38 +02:00
Daniel Schultz b9672eb87d ARM: am33xx: Add barebox_update eMMC option
With this patch the barebox_update command will be extended by the possibility
to flash the MLO to eMMC devices.

The MLO will be flashed to the following addresses:
0x00000
0x20000
0x40000
0x60000

Because the first 512 Bytes of the MLO are reserved for the CHSETTINGS header
and this only use ~80 Bytes, there is space for the partition table in the
header.

The command will overwrite the bootstrap code area and will hold the
partition table and the Boot signature.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-09 08:59:28 +02:00
Sascha Hauer f4f0bc9091 Merge branch 'for-next/socfpga' 2015-09-01 09:43:55 +02:00
Sascha Hauer 67e0a30e77 Merge branch 'for-next/restart' 2015-09-01 09:43:55 +02:00
Sascha Hauer e582374ce3 Merge branch 'for-next/of_path' 2015-09-01 09:43:54 +02:00
Sascha Hauer 69dccb494a Merge branch 'for-next/misc' 2015-09-01 09:43:54 +02:00
Sascha Hauer feeb128788 Merge branch 'for-next/imx' 2015-09-01 09:43:54 +02:00
Sascha Hauer fae6eea0e6 Merge branch 'for-next/gpio' 2015-09-01 09:43:53 +02:00
Sascha Hauer f387bc96bb Merge branch 'for-next/fb-imx-ipu-v3' 2015-09-01 09:43:53 +02:00
Sascha Hauer 2df4ac1f8d Merge branch 'for-next/arm-l2x0' 2015-09-01 09:43:53 +02:00
Sascha Hauer 2b53005fe1 ARM: do not ignore data aborts initially
arm_ignore_data_abort can be set to nonzero to ignore data aborts. The
default should be not to ignore data aborts. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-01 09:12:03 +02:00
Sascha Hauer 1a17643433 ARM: dts: directly point to partitions in the barebox,environment binding
We can now directly point to the partitions in the barebox,environment
binding. Convert some boards over to it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-01 08:14:29 +02:00
Lucas Stach 89ca3fcaad ARM: imx53: vincell: guard board initcall
Make sure that the initcall only executes on the expected board.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 08:59:22 +02:00
Sascha Hauer 83b0a5ae05 restart: replace reset_cpu with registered restart handlers
This replaces the reset_cpu() function which every SoC or board must
provide with registered handlers. This makes it possible to have multiple
reset functions for boards which have multiple ways to reset the machine.
Also boards which have no way at all to reset the machine no longer
have to provide a dummy reset_cpu() function.

The problem this solves is that some machines have external PMICs or
similar to reset the system which have to be preferred over the
internal SoC reset, because the PMIC can reset not only the SoC but also
the external devices.

To pick the right way to reset a machine each handler has a priority. The
default priority is 100 and all currently existing restart handlers are
registered with this priority. of_get_restart_priority() allows to retrieve
the priority from the device tree which makes it possible for boards to
give certain restart handlers a higher priority in order to use this one
instead of the default one.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-27 21:37:03 +02:00
Philipp Zabel 2eb7fb71ae ARM: pfla02: Add notice about the used environment partition
Also, use the barebox partition on mmc2.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2015-08-26 14:45:37 +02:00
Christian Hemp d9f08b058b ARM: pfla02: Add module revison detection
The pin SD4_DAT4 until SD4_DAT7 are used as revison control.
The pins will be internally pulled up so we read a 1111 for revison 1.
For revison two the first pin (bit) is pulled down (see schematic pfla-02
page 4 "SDIO, NAND-Flash".
On Module rev 1 the pins are connected to the NAND but we have only 8bit NAND
also the i.MX6 only can handle 8bit NAND flashs.

Revisions:
	Rev 1:  0xF
	Rev 2:  0xE
		.
		.
		.
	Rev 15: 0x1
	Rev 16: 0x0

Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 14:43:14 +02:00
Lucas Stach a3bb6eacbe ARM: socfpga: select OFTREE and OFDEVICE
SoCFPGA is completely multi-image enabled and probes the barebox
from a built-in DT, so there is no point in building a barebox
image that isn't able to probe from DT.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 12:52:49 +02:00
Sascha Hauer 8a6bd111d9 ARM: socfpga: Configure console from device tree
Add the missing stdout-path properties for the socfpga boards and
enable CONFIG_CONSOLE_ACTIVATE_NONE.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 11:04:45 +02:00
Sascha Hauer 0d14bc0ec4 gpio: Drop asm-generic/gpio.h
Since we no longer have custom gpio function prototypes we can
drop the prototypes from asm-generic/gpio.h can add them to
include/gpio.h instead. While at it add static inline dummy wrappers
for !CONFIG_GENERIC_GPIO so that code using gpios can compile without
gpio support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 07:47:11 +02:00
Robert Jarzmik 011b6bf8d5 ARM: pxa: zylonite: convert to generic default environment
Convert zylonite board to the generic environment, and make consistent
with lubbock and mainstone boards.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 16:47:35 +02:00
Steffen Trumtrar 8c2f1929c7 ARM: dts: remove most of socfpga barebox-specific dt code
Instead of using internal devicetree files, use the official ones from
/dts/src/arm.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:56:29 +02:00
Lucas Stach 32c5211ae8 ARM: imx6: select OFTREE
i.MX6 is fully DT enabled and the already selected
COMMON_CLK_OF_PROVIDER needs OFTREE support to build properly.

Fixes:
arch/arm/mach-imx/clk-imx6.c: In function 'imx6_ccm_probe':
arch/arm/mach-imx/clk-imx6.c:500:2: error:
    invalid use of undefined type 'struct clk_onecell_data'
arch/arm/mach-imx/clk-imx6.c:502:2: error:
    implicit declaration of function 'of_clk_add_provider'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:52:03 +02:00
Philipp Zabel 706503e774 ARM: pbab01: align with and include mainline DT
Align with the mainline device tree, include it,
and remove all unchanged nodes and properties.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:38:27 +02:00
Philipp Zabel 32a07fa9d1 ARM: pfla02: align with and include mainline DT
Align with the mainline device tree, include it,
and remove all unchanged nodes and properties.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:38:27 +02:00
Sascha Hauer 3a375c99af ARM: i.MX6: Enable l2 cache
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-08 16:45:29 +02:00
Sascha Hauer e6f0899822 ARM: l2x0: Add some informational debug messages
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-08 16:45:29 +02:00
Sascha Hauer 543b221ac5 ARM: l2x0: Flush cache before disabling it
Otherwise entries may still be in the cache and never reach memory.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-08 16:45:29 +02:00
Sascha Hauer 3f7e890da7 ARM: l2x0: Implement L310 support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-08 16:45:29 +02:00
Sascha Hauer 85008e5542 ARM: boards: include gpio.h instead of mach/gpio.h
For getting the gpio functions include/gpio.h is the correct
header file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-08 11:16:02 +02:00
Sascha Hauer 3c76d02aeb implement dma_alloc_writecombine
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-07 15:42:55 +02:00
Sascha Hauer 9a56bfa95d ARM: MMU: Fix order when flushing inner/outer cache
When flushing the cache L1 has to be flushed before L2, not the
other way round.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-07 15:34:02 +02:00
Sascha Hauer 74fe5182a8 ARM: PXA: use generic gpio prototypes
PXA is the only architecture that uses its own prototypes for
the gpio functions because it uses static inline variants of
these functions. For the sake of streamlining with other architectures
move them to a C file and use the generic gpio prototypes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-07 09:21:04 +02:00
Sascha Hauer 98b5672c4d Merge branch 'for-next/vpl' 2015-08-07 07:55:00 +02:00
Sascha Hauer 0c5c47b511 Merge branch 'for-next/vincell' 2015-08-07 07:54:46 +02:00
Sascha Hauer 19afbd285e Merge branch 'for-next/video' 2015-08-06 12:33:26 +02:00
Sascha Hauer 4ee01d2b46 Merge branch 'for-next/misc' 2015-08-06 12:33:15 +02:00
Sascha Hauer a8525f691d Merge branch 'for-next/imx' 2015-08-06 12:33:06 +02:00
Sascha Hauer ebd6f26412 Merge branch 'for-next/exitcall' 2015-08-06 12:33:06 +02:00
Sascha Hauer 563468c1ec Merge branch 'for-next/am335x' 2015-08-06 12:33:05 +02:00
Teresa Remmet bc4ec43ede ARM: dts: beaglebone: Strip MLO device tree
Reduce size of beaglebone MLO image.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Tested-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-31 10:21:51 +02:00
Stefan Christ 60427aac46 ARM: [phyFLEX,phyCARD]-i.MX6: rename define in flash-headers
The files flash-header-*.imxfg contains two defines which are use in
include files flash-header-phytec-*.h. The first define is SETUP_MDCFG0.
In the second define name some RAM size value were used, e.g.
SETUP_S_DL_512MB_1GB or SETUP_1GIB_2GIB_4GIB.

It's better to name also the second define after the register names,
here MMDC1_MDCTL and MMDC1_MDASP, because these values changes for every
RAM configurations and it's consistent with the first define.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-31 08:49:44 +02:00
Philipp Zabel f3f8e8fd87 ARM: imx6: rename SPI NOR device to /dev/spinor0
Barebox currently names the SPI NOR device "/dev/sst25vf016b",
but the barebox update handler still points to "/dev/m25p80",
causing barebox_update to fail.
Choose a descriptive name instead.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-31 08:49:43 +02:00
Sascha Hauer 459c7f3213 ARM: i.MX6 cm-fx6: Fix area for get_ram_size
for bank2_size get_ram_size must be called with the CS1 area. With the
recent fix to calculate CS1 start this now starts at 0x90000000 and no
longer at 0x80000000.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-31 08:49:43 +02:00
Sascha Hauer 44dfce99f5 ARM: i.MX6 cm-fx6: Fix Chip density for DDR_64BIT_2GB case
DDR_64BIT_2GB corresponds to two chip selects (ncs = 2) with 1GiB
each. In this case cs_density must be configured to 8Gb (1GiB).

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-31 08:49:43 +02:00
Sascha Hauer a5003e4eff ARM: imx6-mmdc: Fix cs0_end calculation
The current calculation does not take the 0x10000000 offset where
SDRAM starts into account. For example with a 1GiB chip density
the current code calculates cs1 start to 0x40000000, but it
has to be 0x10000000 + 0x40000000 = 0x50000000. Add the missing
8 32MiB chunks.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-31 08:49:43 +02:00
Sascha Hauer 3c9b56e90b ARM: initial cm-fx6 support
The cm-fx6 board is a module from Compulab with different i.MX6 SoCs.
This module is also found in the Utilite Mini Computer this patch
also adds support for.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-31 08:49:43 +02:00
Sascha Hauer 8d48e07c4d ARM: i.MX: make early UART functions independent of DEBUG_LL
We have functions to setup the i.MX uart for early use, but these all
depend on DEBUG_LL. Move them to imx-uart.h to make them usable for
the regular PBL console.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-31 08:49:43 +02:00
Sascha Hauer 37b8e17135 ARM: i.MX: xload: implement esdhc xload for i.MX6
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-31 08:46:20 +02:00
Sascha Hauer 493d20a200 ARM: i.MX6: Add DDR setup code from U-Boot
Several i.MX6 boards like to do their SDRAM setup in code rather than
in DCD tables. Add the SDRAM setup code from U-Boot to make it easy
to adopt the SDRAM setup from the U-Boot port of these boards.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-29 09:16:20 +02:00
Sascha Hauer 2fd7d15426 ARM: i.MX: Add SPI xload code
Add PBL xload code to load an image from SPI NOR flash. Currently implemented
for i.MX6.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-29 09:16:19 +02:00
Lucas Stach 9624f66652 ARM: imx: guf-neso: only try to enable USB if USB_ULPI is configured
Avoids a build failure if the config does not include ULPI support.
This is similar to what has been done to the PCA100 board.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-29 08:01:15 +02:00
Michael Grzeschik f53a2c1bfa xload: fix use after free
The variable partname is used in the error path for debugging.
We have to free it after this use.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-27 07:38:10 +02:00
Lucas Stach 55c78fd8b9 ARM: don't allow Thumb2 on AT91
AT91 has a custom barebox head that doesn't support Thumb2.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-24 09:25:17 +02:00
Lucas Stach dd77403260 ARM: rockchip: depend on OFTREE
The current supported Rockchip board is initialized from a
builtin DTB and I suppose all future boards will do the same.

Fixes various missing functions and prototypes in Rockchip clk
driver.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-24 09:25:17 +02:00
Lucas Stach b560c2b45d ARM: pxa: move mainstone TEXTBASE to Kconfig
So we can drop it from the defconfig and stop bothering
the user with this choice by default.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-24 09:25:17 +02:00
Michael Grzeschik a2d81f787a ARM: OMAP: AM33xx: add uart1 pinmux setup
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-24 09:22:06 +02:00
Stefan Christ a385f657e9 ARM: i.MX6: clarify usage of /dev/imx-ocotp
Explain the relationship between the OCOTP addresses from the i.MX6
Reference Manual and the file offset in '/dev/imx-ocotp'.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:39:07 +02:00
Daniel Schultz 7dc53b3bb2 ARM: am335x: Changed timer
The 32KHz from dmtimer0 is derived from a SoC internal RC oscillator
which is quite inaccurate. Switch to dmtimer2 which is driven from
the high frequency oscillator clock.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:33:11 +02:00
Teresa Remmet b59822ecef ARM: dts: Add support for all phyFLEX-AM335x options
Add support for all possible combinations of phyFLEX-AM335x modules.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:13:50 +02:00
Teresa Remmet c474615225 ARM: dts: Add support for all phyCORE-AM335x options
Add support for all possible combinations of phyCORE-AM335x
modules.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:13:50 +02:00
Teresa Remmet dd2586033c ARM: phytec-som-am335x: Add support for 1024MiB RAM on one chip
Added support for IM8G16D3FBBG15EI 1024MiB RAM on one chip.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:13:50 +02:00
Teresa Remmet c1e1c45f72 ARM: dts: phyFLEX-AM335x-som: Disable eeprom on default
Only enable eeprom when populated. So disable it in dtsi
file and enable if needed in board dts.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:13:50 +02:00
Teresa Remmet 5688dea052 ARM: dts: am335x-phytec boards: Fixup spi flash node name
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:13:49 +02:00
Sascha Hauer 5c7cd570a8 ARM: i.MX6: create cpu_is() functions for use in PBL
The current cpu_is_mx6x() functions need the imx6_cpu_type variable
which make them unsuitable for PBL. Add a set of cpu_mx6_is_mx6x()
functions which can be called from PBL aswell. Unlike the cpu_is_mx6x()
functions the cpu_mx6_is_mx6x() functions assume that they are called on
i.MX6 only.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:46:02 +02:00
Sascha Hauer 8f25597491 ARM: i.MX: compile boot.c for pbl aswell
As boot.c now contains code for the pbl compile compile it there
awell. While at it move esdctl.c to obj-pbl-y.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:46:02 +02:00
Sascha Hauer 23232d89e2 ARM: i.MX6: add function to get bootsource in pbl
In the pbl the regular bootsource_get cannot be used. Add a function
which returns the bootsource directly with values from the hardware.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:46:01 +02:00
Sascha Hauer 2b8d21dec4 ARM: i.MX6: remove unnecessary includes
Most files including imx6-mmdc.h do not actually use anything from
it. Clean this up.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:46:01 +02:00
Sascha Hauer 9435c2ede6 ARM: i.MX6: Add i.MX6 entry function
Add a i.MX6 specific entry function which automatically detects the SDRAM
size. The prototype has already been present, but it was never implemented.
Rename it to imx6q_ since the other variants need other functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:46:01 +02:00