9
0
Fork 0
Commit Graph

14562 Commits

Author SHA1 Message Date
Sascha Hauer a91ce459de blspec: push appendroot handling to bootm
The bootm code now can handle the adding of the root= option itself,
so drop the code and let bootm do it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-04 11:58:46 +02:00
Sascha Hauer f66990af3c bootm: Optionally add a root= option to Kernel command line
It becomes a common case that the Kernel is loaded from the filesystem
which later becomes the rootfs. This adds a possibility to let bootm
automatically append the root= option to the kernel command line. This
is done when global.bootm.appendroot is true.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-04 11:58:46 +02:00
Sascha Hauer a9b18674c0 parameter: Use strtobool
Use strtobool to convert the input string to a boolean type.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-04 11:58:46 +02:00
Andrey Smirnov d34b5ffc7f PCI: imx6: Add DT bindings to configure PHY Tx driver settings
The settings in GPR8 are dependent upon the particular layout of the
hardware platform.  As such, they should be configurable via the device
tree.

Look up PHY Tx driver settings from the device tree.  Fall back to the
original hard-coded values if they are not specified in the device tree.

[Andrey Smirnov: port to Barebox codebase]

Signed-off-by: Justin Waters <justin.waters@timesys.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-03 09:15:39 +02:00
Andrey Smirnov a9fe885685 PCI: imx6: Remove broken Gen2 workaround
Remove the remnants of the workaround for erratum ERR005184 which was never
completely implemented.  The checks alone don't carry any value as we don't
act properly on the result.

A workaround should be added to the lane speed change in establish_link
later.

[Andrey Smirnov: port to Barebox codebase]

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-03 09:15:39 +02:00
Andrey Smirnov 003f55844d PCI: imx6: Move PHY reset into imx6_pcie_establish_link()
This adds the PHY reset into a common error path of
imx6_pcie_establish_link(), deduplicating some of the debug prints.  Also
reduce the severity of the "no-link" message in the one place where it is
expected to be hit when no peripheral is attached.

[Andrey Smirnov: port to Barebox codebase]

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-03 09:15:39 +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 a66b7f8afd getenv_bool: use strtobool
We now have a library function to convert a string to a boolean type.
Use it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-29 11:29:25 +02:00
Sascha Hauer 22b8e9415d string: Introduce strtobool
We have at least two places which convert a string to a boolean type,
so create a common function for this. strtobool treats

- any positive (nonzero) number as true
- "0" as false
- "true" (case insensitive) as true
- "false" (case insensitive) as false

Every other value results in an error and the input *val is not
modified. The caller is expected to initialize *val with the correct
default before calling strtobool.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-29 11:29:25 +02:00
Sascha Hauer 941056dad1 globalvar: Allow to remove globalvars
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-29 11:29:25 +02:00
Sascha Hauer acd643788b Kconfig: Create Kconfig symbol for NVVAR
nvvar support not only needs globalvar, but also persistent
environment storage. Add a separate default-y option which
depends on ENV_HANDLING for this case. Make the option visible
to let the user decide whether he wants to have this option
and add a help text to make this decision easier.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:43:15 +02:00
Sascha Hauer 9a7b5d4cdc Kconfig: Make ENV_HANDLING visible
ENV_HANDLING is usable even without explicit loadenv/saveenv command
support. Instead of selecting this option from loadenv/saveenv, make
this option visible. loadenv/saveenv can then depend on ENV_HANDLING
rather than selecting it. This reduces Kconfig dependencies hassles.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:43:15 +02:00
Sascha Hauer 5c32248bec Kconfig: Make GLOBALVAR visible
Currently global environment variables are only enabled when the
"global" command is enabled. In fact, they could be used even with
the "global" command disabled, so make the GLOBALVAR option visible.
While at it, add a help text for this option.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:43:15 +02:00
Andrey Smirnov 469950f3db ATA: Implement a hook for 'devinfo'
Implement simple adapter function to serve as a hook for 'devinfo'
command.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:43:14 +02:00
Sascha Hauer 52da32ec4d scripts: Add big endian conversion macros to endian.h
Some programs need the big endian macros, add them to andian.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:43:14 +02:00
Boris Brezillon 08d0d519ec of: fix of_tree_for_each_node_from() macro
of_tree_for_each_node_from() is supposed to iterate over all DT nodes
after the one pointed by the from parameter, but with the current
of_next_node() implementation we cannot access the root node.

Patch of_next_node() to point to root_node when from is NULL.

Doing that also simplifies users of of_tree_for_each_node_from() which
were duplicating the logic to point to the root_node when from is NULL.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:43:14 +02:00
Sascha Hauer b61d301cf6 state: Fix Kconfig dependencies
State support does not need OF_BAREBOX_DRIVERS and never did, so drop
the dependency there. It's the state driver which needs of_find_path(),
since this symbol now is always enabled when OF is enabled, we don't
have to add the dependency to the state driver, but instead can depend
on OFDEVICE. We could depend on OF instead, but compiling the state
driver without OFDEVICE makes no sense.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:43:14 +02:00
Sascha Hauer 5e94c658e4 drivers/of: Always compile of_path.c with OF support
of_find_path() is a OF specific library function, so always
compile it when OF support is enabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:43:14 +02:00
Andrey Smirnov 005cd22b30 sata-imx: Fix a typo
It looks like comma operator was accidentaly used instead of regular
semicolon. Fix this to avoid confusing future readers of the code.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:40:14 +02:00
Andrey Smirnov 18f0d2221a commands: mmc_extcsd: Fix incorrect usage of sprintf
In a number of places print_field_ge_v7() and print_field() function
would call sprintf() without providing is with appropriate output
buffer (str is initialized to NULL). Replace the sprintf() with
basprintf() to fix that.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:36:28 +02:00
Andreas Geisenhainer 4e3e8e6d19 documentation: i2c_read() does not expect any "DATA".
Remove information about DATA from help text.

Signed-off-by: Andreas Geisenhainer <Andreas.Geisenhainer@atsonline.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:33:19 +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 854ba3f912 scripts: imx-usb-loader: support set_bits/clear_bits
Now that we can use set_bits/clear_bits in the DCD tables, add support
for this in the imx-usb-loader aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:08:38 +02:00
Sascha Hauer 471893d020 scripts: imx-usb-loader: make debug output more useful
- print write_memory message only in verbose mode, but in all
  cases when memory is written
- print more information about the DCD section just executed

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:08:34 +02:00
Sascha Hauer f1d34c2738 scripts: imx: support set_bits/clear_bits
The i.MX SoCs support setting bits and clearing bits in their DCD table.
This adds commands for these in the imx-image tool.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 16:08:28 +02:00
Andrey Smirnov 69919d895a PCI: imx6: Move imx6_pcie_reset_phy() near other PHY handling functions
Move imx6_pcie_reset_phy() near the other PHY related functions in the
file.  This is a cosmetic change, but also allows to do the following
changes without introducing needless forward declarations.

[Andrey Smirnov: port to Barebox codebase]

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 07:44:28 +02:00
Fabio Estevam 7ed3258eab PCI: imx6: Simplify a trivial if-return sequence
Simplify a trivial if-return sequence by combining it with a preceding
function call.

The semantic patch that makes this change is available in
scripts/coccinelle/misc/simple_return.cocci.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 07:44:21 +02:00
Andrey Smirnov ea13b82ae3 PCI: imx6: Rename imx6_pcie_start_link() to imx6_pcie_establish_link()
Rename imx6_pcie_start_link() to imx6_pcie_establish_link() to follow the
convention of other DesignWare-based host drivers.  No functional change.

[Andrey Smirnov: port to BB codebase]
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 07:44:15 +02:00
Andrey Smirnov 015ec0a528 PCI: imx6: Add proper i.MX6+ reset sequence
I.MX6+ version of the silicon exposed PCIe core's reset signal as a bit
in one of the control registers. As a result using old, pre-i.MX6+,
reset sequence on i.MX6+ leads to Barebox hanging during startup. Using
exposed reset bit instead solves the problem.

This commit is based on portions of commit

c34068d48273e24d392d9a49a38be807954420ed

in http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 07:44:10 +02:00
Andrey Smirnov bd55401e97 OF: Port of_match_device() and of_device_get_match_data()
Port of_match_device() and of_device_get_match_data() from Linux kernel
code.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 07:44:04 +02:00
Andrey Smirnov 9aa9049cfd PCI: imx6: Simplify imx6_pcie_remove()
Instead of manualy flipping the bits call imx6_pcie_assert_core_reset()
to give the code, executing after BB, a clean slate. This also makes the
function match similar code in Linux kernel driver.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-28 07:43:49 +02:00
Uwe Kleine-König 63ae16da82 serial_auart: make dt aware
This allows to instantiate devices from an oftree and so allows
to select the console using /chosen/stdout-path.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-27 15:39:37 +02:00
Ulrich Ölmann 9ac2ef5789 images: Makefile.socfpga: fix typo
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-27 15:39:37 +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 c17e8cf262 ubiformat: use default values for ubi_ver and image_seq
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-26 09:24:57 +02:00