9
0
Fork 0
Commit Graph

14388 Commits

Author SHA1 Message Date
Richard Weinberger fd87416901 UBI: Fix trivial typo in __schedule_ubi_work
s/of/if/

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Weinberger 50b3e86258 UBI: wl: Rename cancel flag to shutdown
It confused me more than once that the cancel flag of the
work function does not indicate the cancellation of a single work.
In fact it indicates the WL sub-system shutdown and therefore
worker functions have to free their wl_entries too.
That's why you cannot cancel a single work, you can only shutdown
all works.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Weinberger ed50f88648 UBI: ubi_eba_read_leb: Remove in vain variable assignment
There is no need to set err, it will be overwritten in any case
later at:
        if (scrub)
                err = ubi_wl_scrub_peb(ubi, pnum);

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Weinberger efdbc27a0f UBI: Improve comment on work_sem
Make clear what work_sem really does.

Suggested-by: Artem Bityutskiy <dedekind1@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Genoud b743e8c57a UBI: add missing kmem_cache_free() in process_pool_aeb error path
I ran into this error after a ubiupdatevol, because I forgot to backport
e9110361a9a4 UBI: fix the volumes tree sorting criteria.

UBI error: process_pool_aeb: orphaned volume in fastmap pool
UBI error: ubi_scan_fastmap: Attach by fastmap failed, doing a full scan!
kmem_cache_destroy ubi_ainf_peb_slab: Slab cache still has objects
CPU: 0 PID: 1 Comm: swapper Not tainted 3.14.18-00053-gf05cac8dbf85 #1
[<c000d298>] (unwind_backtrace) from [<c000baa8>] (show_stack+0x10/0x14)
[<c000baa8>] (show_stack) from [<c01b7a68>] (destroy_ai+0x230/0x244)
[<c01b7a68>] (destroy_ai) from [<c01b8fd4>] (ubi_attach+0x98/0x1ec)
[<c01b8fd4>] (ubi_attach) from [<c01ade90>] (ubi_attach_mtd_dev+0x2b8/0x868)
[<c01ade90>] (ubi_attach_mtd_dev) from [<c038b510>] (ubi_init+0x1dc/0x2ac)
[<c038b510>] (ubi_init) from [<c0008860>] (do_one_initcall+0x94/0x140)
[<c0008860>] (do_one_initcall) from [<c037aadc>] (kernel_init_freeable+0xe8/0x1b0)
[<c037aadc>] (kernel_init_freeable) from [<c02730ac>] (kernel_init+0x8/0xe4)
[<c02730ac>] (kernel_init) from [<c00093f0>] (ret_from_fork+0x14/0x24)
UBI: scanning is finished

Freeing the cache in the error path fixes the Slab error.

Tested on at91sam9g35 (3.14.18+fastmap backports)

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Cc: stable <stable@vger.kernel.org> # 3.10+

Use kfree instead of kmem_cache_free() for barebox.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Sascha Hauer 4178dda706 console: Fix initial value of baudrate parameter
The 'baudrate' parameter has the wrong value initially, it has to
be set to CONFIG_BAUDRATE. Otherwise a devinfo shows a baudrate of 0
until actively changed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-26 09:13:09 +02:00
Sascha Hauer 5376121774 of: Add missing include
drivers/of/device.c has the implementation for of_match_device(), so
also include the header which has the prototype.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-24 12:51:53 +02:00
Antony Pavlov fc71878c1f imd: make it work on big-endian machines
The commit

    commit 5e335773e0
    Author: Sascha Hauer <s.hauer@pengutronix.de>
    Date:   Tue Mar 29 10:06:46 2016 +0200

        imd: use struct imd_header * as argument

introduces additional imd type checks like this

    if (!imd_is_string(imd->type))
           return NULL;

These checks work incorrectly on any big-endian machine
because the imd->type field needs addition conversion
to little-endian byteorder before use.

Here is the imd command output on big-endian qemu-malta:

    barebox:/ imd /dev/nor0.barebox
    release: <NULL>
    build: <NULL>

This patch fixes the problem by adding necessary conversion
via imd_read_type().

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-23 09:33:21 +02:00
Alexander Shiyan b2b000699b ATA: platform_ide: Fix resource allocation
Fixes: 3bd69ad driver: replace dev_request_mem_region with
dev_request_mem_resource

The driver trying to use memory resource, then IO resource.
The ALT register is optional.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-23 08:23:54 +02:00
Stefan Christ b47a5a7ed6 imx-bbu-nand-fcb: add missing newline character
Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-19 08:39:41 +02:00
Alexander Stein e9add3ae57 reset_source: export reset_source_set_priority
In commit 4a7534bf07 ("reset-source: Allow different priorities") the
function name changed from reset_source_set to reset_source_set_priority.
Do that change in EXPORT_SYMBOL() accordingly.
reset_source_set still exists but is a static inline now.

Fixes: 4a7534bf07 ("reset-source: Allow different priorities")
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-13 12:02:09 +02:00
Sascha Hauer ece204a8ac usb: fastboot: Fix oem exec support
Fixes: b1374a6 usb: fastboot: drop CONFIG_COMMAND_SUPPORT dependency

The correct config option to depend on is CONFIG_COMMAND_SUPPORT,
not CONFIG_COMMAND.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 10:29:50 +02:00
Sascha Hauer 06f5a7c9ad Merge branch 'for-next/ubiformat' 2016-05-09 08:50:02 +02:00
Sascha Hauer 5c83ce6091 Merge branch 'for-next/pci' 2016-05-09 08:49:50 +02:00
Sascha Hauer fd2f990204 Merge branch 'for-next/mtd' 2016-05-09 08:49:43 +02:00
Sascha Hauer 4cb8e17aa3 Merge branch 'for-next/misc' 2016-05-09 08:49:43 +02:00
Sascha Hauer 854df603da Merge branch 'for-next/include-pdata' 2016-05-09 08:49:42 +02:00
Sascha Hauer 55aca0a48c Merge branch 'for-next/include-cleanup' 2016-05-09 08:49:42 +02:00
Sascha Hauer 216f412ede Merge branch 'for-next/imx6-phytec' 2016-05-09 08:49:42 +02:00
Sascha Hauer 21981dbe6c Merge branch 'for-next/imx' 2016-05-09 08:49:42 +02:00
Sascha Hauer 8e2df29b5f Merge branch 'for-next/bootm' 2016-05-09 08:49:42 +02:00
Sascha Hauer 23debc6fd9 Merge branch 'for-next/arm' 2016-05-09 08:49:42 +02:00
Sascha Hauer f5142b8564 Release v2016.05.0
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-09 08:43:22 +02:00
Stefan Christ b66a106f34 mci: imx-esdhc: implement reset quirks for i.MX6 DualLite/Solo
First of all the reset values of MMC interfaces are differently between
Quad and DualLite/Solo SoM.

                Register VEND_SPEC2(0xC8)
    Quad:       0x0
    DualLite:   0x00000006
    default:    0x00000006    (from i.MX6 Reference Manual)

Furthermore the ROM Code of Quad and DualLite uses the MMC interfaces
differently when it loads the bootloader from that device:

                Register DLL_CTRL(0x60)  Bit 25 FBCLK_SEL (0x48)
    Quad:       0x0                      0
    DualLite:   0x01000021               1

Since the linux kernel and barebox driver doesn't reset all registers,
the MMC interface is in an inconsistent state, which leads to boot
failures for some eMMC devices on the i.MX6 DualLite SoM. The errors
look like:

    mmcblk3: error -110 sending stop command, original cmd response 0x900, card status 0x400900
    mmcblk3: error -84 transferring data, sector 24578, nr 2, cmd response 0x900, card status 0x0
    mmcblk3: retrying using single block read
    mmcblk3: error -84 transferring data, sector 24578, nr 2, cmd response 0x900, card status 0x0
    blk_update_request: I/O error, dev mmcblk3, sector 24578

It's sufficient to reset register DLL_CTRL and bit FBCLK_SEL. Register
VEND_SPEC2 has no effect.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-09 08:38:59 +02:00
Sascha Hauer 79fdb84a6b net: phy: Add fixed link support
Some network devices, especially when connected to a switch, are
connected via a fixed link. This patch adds support for a fixed phy
configured through device tree.
TODO: Add support for the "speed" and "full-duplex" properties.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Wjatscheslaw Stoljarski <wjatscheslaw.stoljarski@kiwigrid.com>
2016-05-09 08:30:28 +02:00
Stefan Christ 07511ba347 ARM: phytec-som-imx6: add automount for first partition on eMMC
For the phyCORE-i.MX6 add an automount command for the first partition
on the eMMC device.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-04 15:00:45 +02:00
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