9
0
Fork 0
Commit Graph

4266 Commits

Author SHA1 Message Date
Robin van der Gracht da2ec36e7c clk: imx: clk-imx6ul: Fixed conditional for enabling USB phy clocks
Signed-off-by: Robin van der Gracht <robin@protonic.nl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-03 11:54:18 +01:00
Uwe Kleine-König faa369e9c5 nand-bb: fix writing to the end of a .bb device
As nand_bb_write_buf calls mtd_write(bb->mtd, cur_ofs, now, ...) the
limit that now should be checked against is bb->mtd->size - cur_ofs.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 08:41:53 +01:00
Alexander Kurz b225bbf295 i.MX: esdhc: fix imx-esdhc driver for non-OF boards
Commit 39f7a7ee8b ("i.MX: esdhc: Do not rely on CPU type for quirks")
made imx-esdhc dependent on OF and broke probing for all non-OF boards.
Since newer platforms like mx6 and vf610 are restricted to OF, the non-OF
probing only needs to distinguish mx5 vs earlier SoC.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-14 08:48:34 +01:00
Alexander Kurz 45164aadfa i.MX: i2c: fix i2c-fsl for non-OF boards
With commit 4ed5b778a5 ("i.MX: i2c: Add Vybrid support") i2c-fsl probe
returns -EINVAL for all non-OF boards.
Since newer planforms, especially vf610 are restricted OF-only it is safe to
assume "fsl,imx21-i2c" if CONFIG_OFDEVICE is not set.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-14 08:48:25 +01:00
Sascha Hauer 4afb09cc67 Merge branch 'for-next/net' 2017-02-13 09:26:04 +01:00
Sascha Hauer 5a30fae8c7 Merge branch 'for-next/mvebu' 2017-02-13 09:26:04 +01:00
Sascha Hauer 2cd2bad2b7 Merge branch 'for-next/misc' 2017-02-13 09:26:04 +01:00
Sascha Hauer 30139163b7 Merge branch 'for-next/imx' 2017-02-13 09:26:04 +01:00
Sascha Hauer bb1a6a2fd3 Merge branch 'for-next/efi' 2017-02-13 09:26:04 +01:00
Sascha Hauer a9ba8a1d0d Merge branch 'for-next/arm' 2017-02-13 09:26:03 +01:00
Wadim Egorov 49b321fb89 serial: ns16550: Set read/write functions depending on reg-io-width
Set proper register read/write functions depending on reg-io-width
device tree property.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-10 13:19:40 +01:00
Sascha Hauer 857f69ba8c ARM: start: Fix image size calculation
In barebox_non_pbl_start() we do not run at the address we are linked
at, so we must read linker variables using ld_var(). Since ld_var()
current is not available on arm64 we create two zero sized arrays,
one at the begin of the image and one at the end. The difference
between both is the image size we are looking for.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-08 12:03:20 +01:00
Sascha Hauer ad200f0dc3 pinctrl: i.MX7: Fix LPSR sel_imput setting
The i.MX7 has two pinmux controllers, the regular and the LPSR
controller. The LPSR pinmux controller doesn't have any sel_input
registers, instead they can be found in the regular pinmux controller.
This means whenever we want to apply the the sel_input setting for
the LPSR controller, we have to apply them to the regular controller
instead.
In barebox take the easy way out and just add the difference of the
two base addresses to the register offset. The same issue is present
in the Kernel aswell, but when the bootloader already configured
the pins correctly nobody notices when the Kernel sel_input setup
effectively is a no-op.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 11:51:20 +01:00
Sascha Hauer c82e1f90d2 clk: i.MX7: setup ethernet clocks
Reparent ethernet clocks so that they can be used by the
fec driver. The values are the same as U-Boot uses.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:41:56 +01:00
Sascha Hauer 75cb02078e clk: i.MX7: do not register PLL bypass clocks as separate clocks
In the Kernel the bypass bits in the PLLs are now registered as
separate clocks and are no longer handled in the PLL code. In
barebox we haven't made this step and there currently seems to
be no reason to do so.
This means that the bypass bits are currently modified in both
the PLL driver and in the separate clocks which does not work
properly. Drop all the bypass clocks to let the bypass bits
be handled in the PLL driver exclusively.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:41:10 +01:00
Sascha Hauer 23aa31a6d2 clk: i.MX7: Fix ethernet clocks
The original clock code from Linux registers some gates at
base + 0x44e0, 0x44f0, 0x4500, 0x4510. These are not in the reference
manual and do not seem to have any effect on the hardware. The
reference manual lists clocks at 0x4700 and 0x4710 which Linux
does not control at all. These clocks really do have an effect on
the hardware and are needed for ethernet support. Register the
existing clocks rather than the made up clocks to support
ethernet.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:40:23 +01:00
Sascha Hauer 2225c194ed clk: Add support for shared gates
Sometimes a single software control knob controls multiple gates
in hardware. This patch adds support for shared gates which help
coping this situation. The first gate is registered with the hardware
gate as usual, the others are registered as shared gates which does
not have hardware control itself, but only switches the real hardware
gate.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:34:03 +01:00
Sascha Hauer bce7942877 clk: i.MX7: do clock reparenting when all clocks are initialized
By the time the i.MX7 clock driver probes the fixed clocks which
are the roots of the clock tree are not yet present, so reparenting
especially to one of the fixed clocks does not work. Move the
tree setup to a later initcall when the fixed clocks are there.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:32:22 +01:00
Sascha Hauer f5409645e9 clk: i.MX: Pass CLK_OPS_PARENT_ENABLE where necessary
CLK_OPS_PARENT_ENABLE was missing on some i.MX7 specific clocks.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:31:48 +01:00
Sascha Hauer f573cd5e40 clk: i.MX: clk-gate2: Allow to pass flags
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:31:25 +01:00
Sascha Hauer bea07a6881 clk: implement CLK_OPS_PARENT_ENABLE
Some clocks may only be modified when their parent clocks are enabled.
The kernel has the CLK_OPS_PARENT_ENABLE flag for this purpose.
Implement it for barebox aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:31:12 +01:00
Sascha Hauer c21794d0ee clk: Keep enable count consistent over reparent
When reparenting a clock we have to make sure the new parent is enabled
when the clock was enabled on the old parent. Also we have to decrease
the old parents use counter when the clock was enabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:31:00 +01:00
Alexander Kurz 4cb70c729f ARM i.MX: Add i.MX6SL support
Most i.MX6SL infrastructure is already covered in barebox by general i.MX6
support. Missing infrastructure provided in separate commits are
* SoC type detection
* Clock infrastructure

Add the missing fsl,imx6sl-mmdc, so it will not be catched by fsl,imx6q-mmdc
and the remaining bits and pieces to provide barebox i.MX6SL SoC support.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-02 08:13:07 +01:00
Alexander Kurz cb3a2b7be8 ARM: i.MX6SL: import clock infrastructure from linux
Import i.MX6SL clock infrastructure from linux clk-imx6sl.c

To save space, clocks beeing unlikely usefull for bootloader purposes
(SSI, SPDIF, EXTERN_AUDIO) were not imported.
Further, the fixup code from linux mainline commits
a49e6c4b8204 ("ARM: imx: add common clock support for fixup mux")
cbe7fc8aaeef ("ARM: imx: add common clock support for fixup div")
was ignored for this commit.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-02 08:13:07 +01:00
Andrey Smirnov 45e9299b8f spi: i.MX: Add driver for DSPI
Add driver for DSPI - SPI IP core found on various Freescale/NXP
products (including Vybrid/VF610).

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-30 08:09:39 +01:00
Peter Mamonov 6d205422e5 usb: ehci: pass full speed devices to companion controller
According to the "Enhanced Host Controller Interface Specification for
Universal Serial Bus" after a USB port reset the EHCI Driver checks the
PortEnable bit in the PORTSC register. If set to a one, the connected device is
a high-speed device [...]. At the time the EHCI Driver receives the port reset
and enable request the LineStatus bits might indicate a low-speed device.
Additionally, when the port reset process is complete, the PortEnable field may
indicate that a full-speed device is attached. In either case the EHCI driver
sets the PortOwner bit in the PORTSC register to a one to release port
ownership to a companion host controller.

Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-30 07:29:02 +01:00
Peter Mamonov db791c7fb2 mtd: spi-nor: add support for s25fl208k
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-30 07:27:11 +01:00
Alexander Kurz e0d4355b4b ARM i.MX31 clk: add pll_ref_clk and MCU PLL bypass select
The three MX31 PLL may be clocked from either CKIH or a frequency-multiplied
derivate of CKIL generated by the Frequency Pre Multiplier FPM.

Add the pll_ref_clk selection infrastructure and support for MCU PLL bypass
to support clock switching and boards not clocked CKIH.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-26 08:00:06 +01:00
Michael Olbrich 23a90fe3d7 serial: efi: improve input handling
0x08 is the scan-code for 'backspace' not 'delete'.
0x17 indicates the start of an escape sequence, such as "[3~" for
'delete'.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-24 09:34:11 +01:00
Andrey Gusakov 280c65107c video: tc358767: add copyright lines
Add copyright lines for Zodiac who paid for driver development.

Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-20 09:10:31 +01:00
Sascha Hauer 25342f997f regulator: Add pfuze driver
This is not yet a regulator driver, only the register map is
exported as /dev/pfuze* so the registers can be accessed for
debugging purposes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-20 09:10:31 +01:00
Juergen Borleis 99a464413e pinmmux: i.MX: add pin mux support for i.MX7
Signed-off-by Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-20 09:10:30 +01:00
Sascha Hauer 043bc98c4b watchdog: i.MX: Fix internal/external reset
The watchdog can either reset only the SoC or assert the WDOG_B
output signal instead. On some boards it's necessary to use the
external WDOG_B output to make sure that external devices like the
PMIC are also properly resetted. This has been fixed in the Linux
driver which honours a fsl,ext-reset-output device tree property
to select between both ways. Do the same in the barebox driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-20 09:10:30 +01:00
Sascha Hauer aadb845958 watchdog: i.MX: add soc_reset operation
On i.MX21 watchdog type the reset operation is really different
from the watchdog enable/set timeout operation, so create an
extra callback for this instead of folding both things together.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-20 09:10:30 +01:00
Juergen Borleis 626408b487 serial: i.MX: add i.MX7 support
Signed-off-by Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 16:25:54 +01:00
Sascha Hauer f5af044cf0 clk: i.MX7: Add missing USB clocks
The USB clocks are missing in the Kernel clock code. Add them here.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:23:10 +01:00
Juergen Borleis fdd14bde52 clk: i.MX: Add clock support for i.MX7
Signed-off-by Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:23:04 +01:00
Sascha Hauer 9a89ed9d28 clk: imx: Add clk-cpu support
Taken from the kernel as of 4.10-rc3. Needed for i.MX7

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:22:59 +01:00
Sascha Hauer 0ada0c03af clk: i.MX: pllv3: Add support for the i.MX7 enet pll
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:22:45 +01:00
Sascha Hauer cf6b508794 mci: imx-esdhci: remove wrong write protection test
Testing for the write protection bit to determine if a card is write
protected or not is wrong. The bit may have the wrong value for
permanently plugged cards (eMMC) or for boards using a GPIO for
write protection detection.
Since the core will test for write protection before actually
calling into the driver this test can just be removed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:21:40 +01:00
Sascha Hauer 6e9a87b394 mci: Allow to partition eMMC boot partitions
So far the eMMC boot partitions cannot be partitioned from the
device tree. Since they are often 4MiB in size they are big enough
to hold a barebox image and the environment. Add partition parsing
to the boot partitions to allow this usecase.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:21:33 +01:00
Sascha Hauer 32da9097e7 of: partitions: force "partitions" subnode
The binding states that a subnode containing partition subnodes
should have the name "partitions". Enforce this so that we do not
parse nodes with other names which may have partition descriptions
for other disks.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:21:29 +01:00
Sascha Hauer 1b3fde3983 phy: usb-nop-xceiv: Add clock support
As stated in the FIXME comment this is needed. Get and
enable a "main_clk" just like the kernel does.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:21:21 +01:00
Sascha Hauer bbe0df90b8 usb: imx: Add clock support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:21:14 +01:00
Sascha Hauer 2eb99b610b usb: imx: Add usbmisc support for i.MX7
Taken directly from Linux-4.10-rc3

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:20:50 +01:00
Sascha Hauer fc10539f7d usb: imx: Make usb-misc multi instance safe
i.MX7 has two usbmisc devices, so we cannot use global instance
variables anymore. Create a driver private data struct for it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:16:30 +01:00
Sascha Hauer 1bcd04831e serial: i.MX: Enable clock
For architectures which do not enable all clocks during initialization.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:16:25 +01:00
Sascha Hauer 61c6c24958 mci: imx-esdhc: Enable clock
For architectures which do not enable all clocks during initialization.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:16:21 +01:00
Sascha Hauer 27940deb9a i2c: i.MX: Enable clock
For architectures which do not enable all clocks during initialization.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-19 15:16:15 +01:00
Uwe Kleine-König 55d2952514 ata: ide-sff: don't call free for ide_port in error path
The ide_port is provided by the caller so it's not in the responsibility
of this function to free this memory in case of error.
Actually all callers do the free themselves, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-18 12:01:38 +01:00