9
0
Fork 0
Commit Graph

12949 Commits

Author SHA1 Message Date
Sebastian Hesselbarth 868d67b0f7 ARM: mvebu: armada-xp: Limit PUP access to Armada XP
Commit 6638760c22
 ("ARM: mvebu: Enable PUP register")
correctly enables devices that are disabled after boot-up due to
some Design For Testability registers.

However, although harmless on Armada 370, call the code conditionally
on Armada XP only. While at it, move PUP register defines to SYSCTL
registers where they belong to.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-27 08:09:35 +02:00
Sebastian Hesselbarth f061acf442 ARM: mvebu: armada-xp: Fixup broken MV78230-A0 SoC ID
Marvell Armada XP MV78230-A0 incorrectly identifies itself as MV78460.
Check number of CPUs in FABRIC_CONF and fixup PCIe DEV_ID when it is
2 CPUs instead of 4.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-27 08:09:35 +02:00
Sebastian Hesselbarth 1be8c67faa ARM: mvebu: Move PCIe register defines to socid.h
To prepare PCIe device id fixups, move PCIe register defines
to a common location.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-27 08:09:35 +02:00
Sebastian Hesselbarth 60f947b494 bus: mvebu-mbus: Convert mbus platform driver to direct driver
Registering mbus driver as platform driver is a little late for
some register accesses to work. We have to make sure boot-up
mbus windows are disabled early, so call mbus driver directly
from SoC init.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-27 08:09:35 +02:00
Sebastian Hesselbarth 5e58563159 bus: mvebu-mbus: Drop device reference
Prior converting mbus driver from a platform device back to directly
called SoC driver, drop the device_d reference and covert dev_foo to
pr_foo.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-27 08:09:35 +02:00
Sebastian Hesselbarth 40827c029f bus: mvebu-mbus: Remove coherency attribute
Marvell Armada 370 and XP have some coherency fabric. We are not
interested in using it, so remove checking for it in mbus driver.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-27 08:09:34 +02:00
Sebastian Hesselbarth 301765846b spi: Add SPI GPIO bitbang driver
This adds a driver for SPI master by GPIO pins.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-27 08:09:34 +02:00
Sebastian Hesselbarth e1eb436242 spi: ath79: move spidelay from spi-bitbang-txrx
Bitbang helpers for SPI require spidelay. This should be set
by the user and not the helper itself. Move it to ath79_spi
instead.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-27 08:09:34 +02:00
Sebastian Hesselbarth 43ba8232ab gpio: Add driver for 74x164 compatible shift-registers
A 74x164 shift register can be seen as a SPI attached GPIO expander.
This adds a driver for those poor-man expanders based on the Linux
driver.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-27 08:09:34 +02:00
Sebastian Hesselbarth a553a4dc73 net: phy: Support Marvell 88E1318S PHY
This adds support for the Marvell 88E1318S Gigabit Ethernet PHY.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-27 08:09:34 +02:00
Lucas Stach 5106fcfaf9 ARM: highbank: select OFTREE
The board code uses quite a few OF functions and it doesn't seem
reasonable to run this board without DT support.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-27 08:09:34 +02:00
Marc Kleine-Budde 885a1cf27e of_path: of_find_path(): add possibility to return .bb device
This patch adds a flags argument to the of_find_path() function. The only flag
defined for now is OF_FIND_PATH_FLAGS_BB. When used on NAND devices, the
function returns the bad block aware device (the ".bb" device).

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-23 08:12:28 +02:00
Marc Kleine-Budde 0238fb4c0d ubi: cdev: remove trailing newline from debug messages
This patch removes the trailing newline "\n" from the ubi/cdev.c debug
messages, as the macro ifself already adds a newine.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-23 08:12:28 +02:00
Marc Kleine-Budde 1aa3dbfc1a timeout: factor out wait-for-key-press loop into separate file
This patch factors out the wait-for-key-press loop from the shell command
"timeout" into a sparate file, so that it can be used from C, too.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-23 08:12:28 +02:00
Marc Kleine-Budde 78caf2d171 command: timeout: add documentation for option '-v'
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-23 08:12:28 +02:00
Marc Kleine-Budde 2daf357206 command: timeout: remove unhandled '-t' option
This patch removes the option '-t', as it's unhandled in the code since it was
added to barebox.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-23 08:12:28 +02:00
Andrey Smirnov 143eb1d3b4 firmware: socfpga: Fix a bug in fpgamgr_program_write_buf()
Fix a bug in fpgamgr_program_write_buf() where .rbf file whose length
is not a multiple of 4 would cause an integer overflow which would
result in infinite loop.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-23 07:57:56 +02:00
Andrey Smirnov ffbb818808 firmware: socfpga: Add necessary dependency to Kconfig
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-21 14:28:46 +02:00
Lucas Stach dbe6023074 ARM: highbank: select OFTREE
The board code uses quite a few OF functions and it doesn't seem
reasonable to run this board without DT support.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-20 13:19:51 +02:00
Sebastian Hesselbarth c0fed5666a gpio: orion: Convert to platform_driver
With support for deferred probing, we can now relax driver
registration for Marvell Orion GPIO driver from postcore_initcall()
to normal platform_driver.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-20 07:00:21 +02:00
Sebastian Hesselbarth 4c5f742c63 led: gpio: Free GPIOs on unregister()
Free requested GPIOs on unregistration of mono-, bi-, and tri-color
GPIO leds.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-20 07:00:21 +02:00
Sascha Hauer 9d309e5a19 led: Fix led_gpio_rgb_unregister prototype
Analog to the other led_unregister prototypes this must take
the LED type specific struct.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-20 07:00:21 +02:00
Antony Pavlov f993f94ae7 i2c: mv64xxx: continue probe when clock-frequency is missing
Based on this linux kernel commit:

    commit 0ce4bc1dbdd911ae1763e2d4ff36bd1b214a59f7
    Author: Chen-Yu Tsai <wens@csie.org>
    Date:   Mon Sep 1 22:28:13 2014 +0800

        i2c: mv64xxx: continue probe when clock-frequency is missing

        The "clock-frequency" DT property is listed as optional, However,
        the current code stores the return value of of_property_read_u32 in
        the return code of mv64xxx_of_config, but then forgets to clear it
        after setting the default value of "clock-frequency". It is then
        passed out to the main probe function, resulting in a probe failure
        when "clock-frequency" is missing.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-17 07:31:35 +02:00
Marc Kleine-Budde 4f315f3670 command: state: harmonize in-barebox documentation
According to this patch by Holger Schurig:

    f1f532084a commands: harmonize in-barebox documentation

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-17 07:31:35 +02:00
Marc Kleine-Budde 9e69a04222 include: add includes includes to make fdt.h, of.h and state.h self contained
Otherwise compilation may fail with:

include/fdt.h:11:15: error: unknown type name 'uint64_t'
 static inline uint64_t fdt64_to_cpu(uint64_t x)

include/of.h:22:19: error: field 'list' has incomplete type
  struct list_head list;

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-17 07:31:35 +02:00
Marc Kleine-Budde 724d8847ed environment: remove unused code
This patch removes the LIST_HEAD of_partition_list and a struct definition from
the code. This was present but unused, since the file was added to barebox.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-17 07:31:35 +02:00
Uwe Kleine-König fd678c4973 drivers/base: Mark (of|platform)_device_id data as constant
There should be no reason to ever change the data pointed to by id_table
or of_compatible. So make this offical by adding some 'const's.

In Linux the corresponding pointers are marked as const, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-17 07:31:35 +02:00
Sascha Hauer f49f067bdd pci: Do not abuse dev->priv for storing data
dev->priv is for private use of the device driver, so do not
use it in the pci core. Instead, introduce a id field in struct
pci_device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2015-04-17 07:31:21 +02:00
Sebastian Hesselbarth 62adc52ed5 led: gpio: Properly deal with deferred probing
GPIO LEDs can suffer from deferred probing due to failing gpio request.
Instead of registering each gpio led independently, pre-allocate an
array of struct gpio_led for all and tear it down properly if probing
of one leds fails. While at it, silence error messages on -EPROBE_DEFER.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-17 07:23:47 +02:00
Sebastian Hesselbarth c6a9698dc1 OF: gpio: Silence error message on -EPROBE_DEFER
With deferred probing, -EPROBE_DEFER is not worth spilling an error.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-17 07:23:47 +02:00
Sebastian Hesselbarth 9744da2e2b gpio: Return -EPROBE_DEFER on gpio_get_num()
GPIO drivers can be registered quite late in registration process
causing dependant devices to fail probing. If we know gpio_get_num
will be called with a non-NULL device, return -EPROBE_DEFER instead
of -ENODEV to allow re-probing later.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-17 07:23:46 +02:00
Sebastian Hesselbarth ab3da15bc1 base: Introduce deferred probing
As expected, we would need deferred probing sooner or later. This is
a first approach to allow devices to return -EPROBE_DEFER and get
sorted into a list of deferred devices that will be re-probed later.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-17 07:23:46 +02:00
Sebastian Hesselbarth 11045f866d USB: xHCI: Sync non-coherent DMA buffers
When working with non-coherent transfer buffers, we have to sync
device and cpu for outgoing and incoming buffers. Fix the driver where
non-coherent buffers are used in device context.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-15 14:05:42 +02:00
Marc Kleine-Budde 29abc10d44 habv4: add High Assurance Boot v4
This patch adds the code to check the HAB ROM for failures during development.
Add a cal to "habv4_get_status();" to your board file, to get the current
system state from the ROM.

_NOTE_: On i.MX6 this has to happen before barebox starts the MMU, because the
        HAB ROM vector table is placed at 0x94, which is not accessible after the
	MMU has setup the zero page.

This patch contains code ported from u-boot patches [1][2] by Shaojun Wang [3]
which were found in the "Mx28 Secure Boot" and "Mx6 HAB (High Assurance Boot)"
thread on the freescale community forum [4][5].

[1] https://community.freescale.com/servlet/JiveServlet/download/370047-269174/0001-enable-mx28-u-boot-hab.patch.txt.zip
[1] https://community.freescale.com/servlet/JiveServlet/download/96451-11-266175/0001-u-boot-enable-mx6-hab.patch.zip
[2] https://community.freescale.com/people/ShaojunWang
[3] https://community.freescale.com/thread/317254
[3] https://community.freescale.com/docs/DOC-96451

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-15 07:12:17 +02:00
Marc Kleine-Budde d3be1ab1fc images: add HABv4 support for i.MX6
This patch adds high assurance boot support (HABv4) image generation to
barebox, currently tested on i.MX6 only.

In order to build a signed barebox image, add a new image target to
images/Makefile.imx as illustrated in the diff below:

- - - a/images/Makefile.imx
+ + + b/images/Makefile.imx
@@ -163,10 +163,14 @@ image-$(CONFIG_MACH_SABRELITE) += barebox-freescale-imx6dl-sabrelite.img
 pblx-$(CONFIG_MACH_SABRESD) += start_imx6q_sabresd
 CFG_start_imx6q_sabresd.pblx.imximg = $(board)/freescale-mx6-sabresd/flash-header-mx6-sabresd.imxcfg
 FILE_barebox-freescale-imx6q-sabresd.img = start_imx6q_sabresd.pblx.imximg
 image-$(CONFIG_MACH_SABRESD) += barebox-freescale-imx6q-sabresd.img

+CSF_start_imx6q_sabresd.pblx.imximg = $(havb4_imx6csf)
+FILE_barebox-freescale-imx6q-sabresd-signed.img = start_imx6q_sabresd.pblx.imximg.signed
+image-$(CONFIG_MACH_SABRESD) += barebox-freescale-imx6q-sabresd-signed.img
+

Here the default i.MX6 CSF file $(havb4_imx6csf) is used, it's generated during
build on from the template "scripts/habv4/habv4-imx6.csf.in". You can configure
the paths to the SRK table and certificates via: System Type -> i.MX specific
settings -> HABv4 support.

The proprietary tool "cst" by Freescale tool is expected in the PATH.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-15 07:12:17 +02:00
Marc Kleine-Budde b6c786528b imx-image: add option to prepare image for HAB signing
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-15 07:12:17 +02:00
Antony Pavlov bd3e501134 mtd: m25p80: import ID for Winbond W25Q128FVSSI from linux
Winbond W25Q128FVSSI chip is used in Black Swift board,
(see http://www.black-swift.com for details).

Black Swift can run barebox for TP-LINK MR3020.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-14 20:49:19 +02:00
Andrey Smirnov 16df434592 spi: i.MX: Respect the value of 'cs_change'
Add the code to correctly handle 'cs_change' field in 'struct
spi_transfer'(base on the similar code from altera_spi.c)

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-14 20:47:49 +02:00
Sascha Hauer 11491a18a1 ARM: i.MX6: Add support for clko clocks
the clko pins are general purpose clock outputs. Add support for them.

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>
2015-04-14 20:31:15 +02:00
Sascha Hauer ee0035e5cc Merge branch 'for-next/state' 2015-04-13 12:57:14 +02:00
Sascha Hauer a76a6bc8fd Merge branch 'for-next/pxa' 2015-04-13 12:57:13 +02:00
Sascha Hauer 9c4cf7d3b6 Merge branch 'for-next/pci' 2015-04-13 12:57:13 +02:00
Sascha Hauer c41b60fe6a Merge branch 'for-next/net' 2015-04-13 12:57:13 +02:00
Sascha Hauer 9f13039b55 Merge branch 'for-next/misc' 2015-04-13 12:57:13 +02:00
Sascha Hauer 1ef7837c37 Merge branch 'for-next/imx' 2015-04-13 12:57:13 +02:00
Sascha Hauer 3506a2331d Merge branch 'for-next/dts' 2015-04-13 12:57:13 +02:00
Sascha Hauer 4e1ac4a872 Merge branch 'for-next/driver' 2015-04-13 12:57:12 +02:00
Sascha Hauer 909dbe5334 Merge branch 'for-next/crypto' 2015-04-13 12:57:12 +02:00
Sascha Hauer 881d2e4ac6 Merge branch 'for-next/at91' 2015-04-13 12:57:12 +02:00
Sascha Hauer e894f9e85b .mailmap: Fix Juergens name
It's Juergen Borleis now, not Beisert.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-13 11:32:34 +02:00