9
0
Fork 0
Commit Graph

14562 Commits

Author SHA1 Message Date
Alexander Shiyan 1b47607e89 ARM: imx51: Remove stale comment
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-23 09:49:41 +02:00
Trent Piepho 123bb5ff51 socfpga: Stop putting 512 byte header on SocFPGA images
Since images without the extra header now boot correctly, stop adding
it.  This makes the image 512 bytes smaller.

It also gives the image a correct barebox header.  The 512 byte extra
header looked like a barebox header (had a "barebox\n" signature) but
had incorrect size and text start fields.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-23 09:48:46 +02:00
Trent Piepho 4763fac31c socfpga: correct start vector when not using extra barebox header
The barebox ARM image has a 0x50 byte header that consists of:
Bytes 0x00 - 0x0a:  Instruction(s) to jump to start of code
Bytes 0x20 - 0x2f:  Signature and some other data
The rest of header is basically padding.

On SocFPGA, the ROM bootloader expects the 2nd stage bootloader
(barebox) to have a 0x40 byte header with the following fields:
Bytes 0x40 - 0x4b:  Signature and some other data
Bytes 0x4c - 0x4f:  Instruction to jump to start of code

These two headers are compatible, as everything defined in the SocFPGA
header is at a location that is padding the barebox header.

socfpga_mkimage has two methods for creating a SocFPGA image.  One method
prepends an extra 512 byte header to the barebox image, which contains the
SoCFPGA header described above.  The start vector at 0x4c is hard coded to
jump to offset 512, where the barebox header's start vector will be.

socfpga_mkimage can also not prepend this additional header and instead
modify the barebox header to be SoCFPGA compatible.  But it only writes
bytes 0x40-0x4b and not the start vector at 0x4c, leaving that word as
padding.  And so this image will not boot when the ROM bootloader runs it.

This changes the SoCFPGA header creator to write a correct start vector for
both methods.  It will create a branch instruction at 0x4c that jumps to the
start of the barebox image, whether it be at offset 0 or offset 512 (or any
other location).

This makes SoCFPGA images without the extra header bootable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-23 09:48:46 +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
Trent Piepho a2f8644d71 rtc: ds1307: Add ds1308 to driver's ID list
As far as the driver is concerned, it's the same as a 1338.  It's too
bad the i2c drivers can't make use of OF compatible properties with a
list of compatible devices.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-23 08:29:46 +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
Sascha Hauer f2b07274d5 ARM: i.MX: iim: Remove debug printk
The dev_info is a debug leftover that was never intended to go upstream.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-20 07:59:35 +02:00
Sascha Hauer 3dca2b0bf7 ubiformat: Fix formatting devices with unreadable areas
When parts of a Nand device are not readable due to excessive bit flips
we should not bail out with an error as this means we can never repair
the device by flashing a fresh image using ubiformat. Instead, treat a
failed read as a corrupt block and ignore the read failure.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-20 07:58:07 +02:00
Sascha Hauer 821de09b1f ubiformat: Ignore bitflip errors
Fixes: 1d88c66 ubiformat: Use mtd-peb API

bit flips are no error, when encountering them during scanning of a
device just ignore them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-20 07:57:59 +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
Sascha Hauer f7c9c149e5 aiodev: Add basic LM75 temperature driver
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-18 07:48:13 +02:00
Andrey Smirnov ccebda1d4c aiodev: Add TEMPMON driver
Port TEMPMON driver from U-Boot

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-18 07:48:09 +02:00
Andrey Smirnov c203958f3b syscon: Decrease driver registration priority
A number of devices on i.MX6 list "syscon" as second compatibility
string, among them, most importantly, is "iomuxv3" pinmux driver, which
gets probed at "postcore_initcall". Probing this driver at
"core_initcall" results in "syscon" driver usurping pinmux device and
preventing "iomuxv3" driver from loading and correctly initializing
pinmux of the system (which in turn results in a lot of sadness).

Moving this driver to be initialized at "device_initcall" time resolves
the issue.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-18 07:47:51 +02:00
Andrey Smirnov a6c67f15ac syscon: Do not return NULL when driver is not selected
Both syscon_base_lookup_by_pdevname() and
syscon_base_lookup_by_phandle(), when implemented, do not return NULL,
so none of the code using those function is written to check for that.

Change returns to ERR_PTR(-ENOSYS), to avoid having that problem.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-18 07:47:51 +02:00
Andrey Smirnov 0462427436 commands: Add 'hwmon' command
Add 'hwmon' command which allows to display the readings of all
hardware monitoring sensors registered with Barebox.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-18 07:47:51 +02:00
Sascha Hauer 914480a542 drivers: Introduce AIODEV subsystem
AIODEV/Aiodevice is a analog I/O framework that can be thought of as a
simplified hybrid between 'hwmon' and 'IIO' subsystems of Linux kernel

This commit is very heavily based on 'iodevice' framework proposal
written by Sascha Hauer.

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

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

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

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

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-17 11:03:54 +02:00
Teresa Remmet adfc28f904 net: phy: micrel: KSZ9081/KSZ8091: Disable broadcast mode
KSZ9081 only supports two phy ids 0x0 and 0x3. 0x0 is also
used as broadcast address. Disable broadcast, so that id 0x0
can be used as unique address on a shared bus.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-13 12:06:33 +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 d323e9f6e7 bootm: make verbosity controllable via global variable
When the bootm code is not called directly by the bootm command it is
useful to control the verbosity with a globalvar. This introduces
global.bootm.verbose for this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-11 08:16:31 +02:00
Sascha Hauer 403c5169e9 bootm: Move magicvar descriptions to common/bootm.c
Now that the bootm code can be used without the command, we have to
move the magicvar descriptions from the command code to the common
bootm code aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-11 08:11:26 +02:00
Sascha Hauer 6922e0f005 bootm: Add verify mode "available"
The verify "available" mode checks whatever is available in the
booted image, so when an image has a signature, it is checked and
must be correct and when an image is hashed, it is also checked
for correctness.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 16:02:13 +02:00
Sascha Hauer b9b0fd6c75 bootm: set bootm_verify_mode to correct value
When CONFIG_BOOTM_FORCE_SIGNED_IMAGES is enabled bootm_verify_mode
shall be forced to "signature", so set bootm_verify_mode to this
value during startup. Otherwise it shows up as "<NULL>" in devinfo.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 16:00:04 +02:00
Sascha Hauer f55bf3c280 bootm: fit: Print error when image is not signed
when fit is configured to force signed images then print an error
message when an unsigned image is opened to give the user a clue
what went wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 15:36:45 +02:00
Sascha Hauer c06573f9d1 bootm: fit: Print error when image is not hashed
When fit is configured to check hashes print an error when an image
does not contain hashes instead of failing silently.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 15:35:36 +02:00
Sascha Hauer 97cfccda76 bootm: Add missing BOOTM_FORCE_SIGNED_IMAGES option
The code already tests for this option, but it does not
yet exist. Add the option to force using signed images.

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

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 14:51:58 +02:00
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 51061a9884 mtd: nand: nand_mxs: Add subpage read support
subpage read support can significantly speed up scanning UBI volumes, so
add support for it. This is inspired by the corresponding Kernel commit.
Unlike in the kernel we add subpage read support for i.MX28 aswell.
Testing it on i.MX28 revealed no problems.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 08:24:27 +02:00
Sascha Hauer 18ea7385fb mtd: nand: Enable subpage reads
Until now we did not support subpage reads for smaller binary sizes.
Scanning UBI volumes on large page NANDs can be painfully slow,
subpage reads can speed this up significantly, so enable subpage reads.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 08:20:43 +02:00
Sascha Hauer ec21c89112 mtd: nand: Pass page argument to read_subpage hook
Similar to what the kernel does in e004debda (mtd: nand: add "page" argument for
read_subpage hook).

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 08:18:39 +02:00
Sascha Hauer 7ba65d2417 mtd: nand: nand_mxs: Factor out BCH setup function
The BCH setup has to be changed during runtime with the following
patches, so factor out a function for it.

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

Also make generous use of the const keyword.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 08:13:48 +02:00
Uwe Kleine-König 9efa564805 partitions: dos: add partuuid string for logical partitions
Commit bc31d85c6e ("cdev: Add partuuid string to struct cdev") added
partuuid strings for dos partitions but only for the (up to) four
primary partitions. Do the same for the logical partitions. Their
numbers start at 5 independently of the number of available primary
partitions.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-10 08:13:33 +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