summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* i.MX: vf610-twr: Remove MSCM setup codeAndrey Smirnov2017-01-121-5/+0
| | | | | | | | | Recent kernel versions should have appropriate driver code that sets up interrupt rounting correctly, so there's no need for that to be done in the bootloader. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: imx-usb-misc: Add Vybrid supportAndrey Smirnov2017-01-121-0/+28
| | | | | | | | Add code to do usbmisc initialization on VF610 family of SoCs. Based on analogous code from Linux kernel. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: Default CONFIG_USB_IMX_PHY to 'y' on VybridAndrey Smirnov2017-01-121-1/+1
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: imx-usb-phy: Add VF610 OF compatiblity stringAndrey Smirnov2017-01-121-0/+2
| | | | | | | | | | From looking at analogous Linux driver code it seems that all of the differences between code "imx23-usbphy" and "vf610-usbphy" pertain to suspend/resume functionality, which shouldn't affetct Barebox. As a result this commit just adds a compatiblity string and no other code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: iomux-vf610: Add missing pad definitionsAndrey Smirnov2017-01-121-0/+4
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: vf610: Add low-level pin configuration helperAndrey Smirnov2017-01-122-5/+21
| | | | | | | | Add low-level pin configuration helper for early boot code, and convert pinctrl driver to use that code as well. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: iomuxv3: Use helper functions in iomux-v3.hAndrey Smirnov2017-01-121-34/+4
| | | | | | | Avoid code duplication by using helper functions from iomux-v3.h Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX6: sabresd: Remove magic numbers in setup_uartAndrey Smirnov2017-01-121-6/+3
| | | | | | | | Remove magic numbers in setup_uart and replace them with calls to iomuxv3 helper functions. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: iomuxv3: Add low-level pad configuration routineAndrey Smirnov2017-01-121-0/+17
| | | | | | | | Add low-level pad configuration routine that can be used by early boot code as well as leveraged by pinmux driver. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: iomuxv3: Add helper macros to deconstruct iomux_v3_cfg_t valuesAndrey Smirnov2017-01-121-0/+8
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: iomuxv3: Add low-level pad code to headersAndrey Smirnov2017-01-121-0/+28
| | | | | | | | | Add a basic low-level pad configuration function that can be used to implement early boot pin configuration code as well as shared with various iomuxv3 and vf610 drivers. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: vf610: Ramp CPU clock to maximum frequencyAndrey Smirnov2017-01-122-2/+162
| | | | | | | | | | Mask ROM leaves the CPU running at 264Mhz, so configure the clock tree such that CPU runs at maximum supported frequency. Maximum supported frequncy is determined from speed grading burned into OCOTP fusebox by the vendor. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: Add fusemap for VF610Andrey Smirnov2017-01-123-41/+65
| | | | | | | | Add fusemap header for VF610 and move out fuse definitions that are shared with i.MX6 familiy into a sperate file (ocotp-fusemap.h). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: imx6-fusemap: Fix SJC_RESP_LOCK widthAndrey Smirnov2017-01-121-1/+1
| | | | | | | | According to the datasheet SJC_RESP_LOCK is one bit wide, adjust the definition correspondingly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: ocotp: Add imx_ocotp_sense_enable()Andrey Smirnov2017-01-122-0/+8
| | | | | | | | Add imx_ocotp_sense_enable() function to allow changing that aspect of OCOTP driver behaviour before calling imx_ocotp_read_field() Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: clk: Add IMX_PLLV3_SYS_VF610 subtypeAndrey Smirnov2017-01-122-0/+113
| | | | | | | | | | Add IMX_PLLV3_SYS_VF610 subtype to pllv3 code to be able to control and re-clock PLL1 and PLL2 on Vybrid SoC. This commit also introduces imx_clk_pllv3_locked which allows the user to create PLLv3 and specify how it should be polled for "locked" status (used in .set_rate callback) Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: ocotp: Initialize OCOTP as early as possibleAndrey Smirnov2017-01-121-1/+1
| | | | | | | | | On Vybrid SoC OCOTP module contains speed grading information that is needed to correctly adjust CPU clock to its maxumum rate, so we need to have this information handy as early as possible. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: ocotp: Add provisions for storing multiple MAC addressesAndrey Smirnov2017-01-121-19/+51
| | | | | | | | | | | | i.MX SoC variants like Vybrid have more than one built-in Ethernet interface and as a consequence support storing more than one MAC address in OCOTP module. Add code to create multiple 'mac_addr<n>' parameters as well as 'mac_addr' as an "alias" to 'mac_addr0' for backwards compatibility. Acked-by: Stefan Lengfeld <s.lengfeld@phytec.de> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: ocotp: Move memory reversing into a subroutineAndrey Smirnov2017-01-121-7/+13
| | | | | | | | Move memory reversing, found in imx_ocotp_get_mac and imx_ocotp_set_mac, into a subroutine to avoid code duplication. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: esdhc: Enable host->clk during initializationAndrey Smirnov2017-01-121-0/+7
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/vybrid'Sascha Hauer2017-01-1238-126/+1485
|\
| * gpio: Add GPIO driver for VybridAndrey Smirnov2017-01-113-0/+170
| | | | | | | | | | | | | | | | Add GPIO driver for VF610 Family of SoCs (based on analogous driver from Linux kernel) Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: fec: Add support for Vybrid variantAndrey Smirnov2017-01-111-0/+3
| | | | | | | | | | | | | | Add support for Vybrid variant of this IP block Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: fec: Enable all clocks specified for FECAndrey Smirnov2017-01-112-11/+70
| | | | | | | | | | | | | | | | | | For some i.MX variants more than just "ipg" clock need to be enabled for Ethernet to function, so change the code to enable all of the clock defined for FEC node (this is what analogous Linux driver does as well). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: ocotp: Add Vybrid supportAndrey Smirnov2017-01-111-0/+16
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: ocotp: Account for shadow memory gapsAndrey Smirnov2017-01-111-3/+31
| | | | | | | | | | | | | | | | | | | | Shadow memory does not have a true 1:1 mapping to fuse address space. All i.MX6 devices, with exception of i.MX6SL have a 0x100 byte gap between banks 5 and 6 (or addresses 0x2f and 0x30), so we need to account for that when reading data from shadow memory. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: ocotp: Remove unused #defineAndrey Smirnov2017-01-111-1/+0
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: Kconfig: Enable OCOTP on VybridAndrey Smirnov2017-01-111-1/+1
| | | | | | | | | | | | | | Enable OCOTP driver on Vybrid as well as i.MX6 Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: esdhc: Request "per" clock explicitlyAndrey Smirnov2017-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling clk_get() with NULL as the second argument will give us "ipg" clock as a result. The actual clock feeding into the peripheral is "per" and, depending on the SoC, "ipg" and "per" may be separated by a clock divider, so querying "ipg"'s rate may not result in rate that does not represent the actual peripheral clock rate. Change the code to request "per" as our peripheral clock to avoid aforementioned problem. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: esdhc: Do not rely on CPU type for quirksAndrey Smirnov2017-01-111-21/+100
| | | | | | | | | | | | | | | | | | | | | | | | CPU type is not a reliable indicator of the underlying type of IP core used, since there's no 1:1 mapping between the two. As example of one such violation consider Vybrid SoC which contains IP block from i.MX53. Instead port feature flags from corresponding Linux kernel driver and use the ones that are relevant. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: i2c: Add Vybrid supportAndrey Smirnov2017-01-111-28/+122
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: i2c: Use read/write adapter functionsAndrey Smirnov2017-01-111-42/+46
| | | | | | | | | | | | | | | | | | Use read/write adapter functions instead of directly calling to readb/writeb. This is needed to prepare driver code to support Vybrid SoC's variant of this block. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: Add 'lpuart' serial driverAndrey Smirnov2017-01-113-0/+223
| | | | | | | | | | | | | | Add 'lpuart' serial driver, based on analogous driver from U-Boot Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * vf610: Give enet_osc explicit "enet_ext" nameAndrey Smirnov2017-01-111-0/+4
| | | | | | | | | | | | | | | | Give enet_osc explicit "enet_ext" name, since without it, Barebox version of clk_set_parent fails when trying to re-parent "enet_sel". Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: Add VF610 clock tree initialization codeAndrey Smirnov2017-01-112-0/+447
| | | | | | | | | | | | | | Based on analogous code from Linux kernel Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: clk: Port imx_clk_mux_flags from LinuxAndrey Smirnov2017-01-111-0/+8
| | | | | | | | | | | | | | Port imx_clk_mux_flags from Linux, to simplify clock code porting. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: clk: Port imx_check_clocks()Andrey Smirnov2017-01-113-1/+26
| | | | | | | | | | | | | | Port imx_check_clocks() from Linux kernel. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: clk: Add IMX_PLLV3_USB_VF610 supportAndrey Smirnov2017-01-112-3/+7
| | | | | | | | | | | | | | Add IMX_PLLV3_USB_VF610 PLLv3 types support clk-pllv3.c Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: clk: Port imx_clk_gate2_cgr()Andrey Smirnov2017-01-112-7/+16
| | | | | | | | | | | | | | | | Update clk-gate2 code to be able to accept arbitrary 'cgr' value and introduce imx_clk_gate2_cgr() (Used by Vybrid clock tree) Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: Move clk code from 'mach-imx' to 'drivers'Andrey Smirnov2017-01-1119-12/+31
| | | | | | | | | | | | | | | | | | Move clk code from 'mach-imx' to 'drivers' to keep the code tree structure closer to that of analogous one from Linux kernel and, arguably although subjective, to keep 'mach-imx' less cluttered. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: Port of_clk_set_defaults()Andrey Smirnov2017-01-114-1/+168
| | | | | | | | | | | | | | | | Port of_clk_set_defautls() from Linux kernel in order to support DT configurations that require it (e. g. Vybrid). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/truncate'Sascha Hauer2017-01-116-11/+40
|\ \
| * | ubi: barebox: Remove character device flag from static volumesTeresa Remmet2017-01-111-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Character device flag was set for ubi static volumes to vary the device file size. This is now done with the truncate option. So no need for the character device flag. This makes it also possible to dump a image from the static volume. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | commands: ubi: ubiupdatevol: Open device with O_TRUNCTeresa Remmet2017-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Static ubi volumes should be opend with O_TRUNC as the device file size equals the content. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | fs: Remove O_TRUNC check for devices when open filesTeresa Remmet2017-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Don't check for the file type here. Devices may have truncate callbacks. Otherwise the caller should check if O_TRUNC is possible. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ubi: Add truncate callbackTeresa Remmet2017-01-111-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | The size of static ubi volumes changes depending on the content. Add truncate callback to handle resizes. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | devfs: Add optional truncate callback for device filesTeresa Remmet2017-01-112-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Not all device files have trivial fix device sizes like static ubi volumes. Here the device file size equals the image size it contains. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | libfile: copy_file: Only open regular files with O_TRUNCTeresa Remmet2017-01-111-6/+16
| |/ | | | | | | | | | | | | | | Device files can not truncate in the most cases. Check if the destination is a regular file and open only those with O_TRUNC. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mvebu'Sascha Hauer2017-01-115-45/+102
|\ \
| * | ARM: mvebu: enable MMU in defconfigUwe Kleine-König2017-01-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Enabling the MMU (and so the caches) gives a nice performance boost, so opt in for mvebu_defconfig. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>