1
0
Fork 0
Commit Graph

8997 Commits (zero-gravitas)

Author SHA1 Message Date
Masahiro Yamada ac13ce49a4 pinctrl: uniphier: rename function/array names
Make function/array names match the file names for consistency.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-04-24 09:53:54 +09:00
Heiko Schocher 68fc449033 mtd, ubi: set free_count to zero before walking through erase list
Set free_count to zero before walking through ai->erase list
in wl_init().

As U-Boot has no workqueue/threads, it immediately calls
erase_worker(), which increase for each erased block
free_count. Without this patch, free_count gets after
this initialized to zero in wl_init(), so the free_count
variable always has the maybe wrong value 0.

Detected this behaviour on the dxr2 board, where the
UBI fastmap gets not written when attaching/dettaching
on an empty NAND. It drops instead the error message:

could not find any anchor PEB

With this patch, fastmap gets written on dettach.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
2016-04-22 11:47:37 +02:00
Tom Rini eb6b50f631 Merge branch 'master' of git://git.denx.de/u-boot-usb
Conflicts:
	configs/bcm28155_ap_defconfig
	configs/dra72_evm_defconfig
	configs/dra74_evm_defconfig
	configs/ma5d4evk_defconfig

Signed-off-by: Tom Rini <trini@konsulko.com>
2016-04-20 09:31:58 -04:00
Tom Rini ec3ab3f9b5 Merge branch 'master' of git://git.denx.de/u-boot-socfpga 2016-04-20 09:23:42 -04:00
Sam Protsenko e6c0bc0643 usb: gadget Move: CONFIG_G_DNL_* to Kconfig
And also reformat defconfigs using "make savedefconfig" rule.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2016-04-20 11:43:28 +02:00
Sam Protsenko b142729d03 usb: dwc3: Move CONFIG_USB_DWC3_PHY_* to Kconfig
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2016-04-20 11:43:28 +02:00
Sam Protsenko c16bf621d5 usb: dwc3: Move CONFIG_USB_DWC3_OMAP to Kconfig
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2016-04-20 11:43:28 +02:00
Sam Protsenko 65403f3010 usb: dwc3: Move CONFIG_USB_DWC3_GADGET/HOST to Kconfig
Description was borrowed from kernel dwc3 Kconfig.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2016-04-20 11:43:27 +02:00
Sam Protsenko aaa4a9e313 usb: gadget: Move CONFIG_USB_GADGET_DOWNLOAD to Kconfig
While at it, remove obsolete CONFIG_USBDOWNLOAD_GADGET option from some
config headers. This is also probably fixes am335x_baltos board.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2016-04-20 11:43:27 +02:00
Sam Protsenko 3457bbaf22 usb: gadget: Move CONFIG_USB_GADGET_DUALSPEED to Kconfig
Move CONFIG_USB_GADGET_DUALSPEED option to Kconfig and
make all UDC controllers select USB_GADGET_DUALSPEED:
  - add next options to Kconfig selecting USB_GADGET_DUALSPEED:
    - USB_GADGET_ATMEL_USBA
    - USB_GADGET_DWC2_OTG
    - USB_DWC3
    - CI_UDC
  - make USB_MUSB_GADGET select USB_GADGET_DUALSPEED

While at it, make some related fixes:
  - remove DUALSPEED from configs that don't enable gadget support:
    - kwb.h
    - tseries.h
  - add missing USB_GADGET option to next configs:
    - novena_defconfig
    - pcm051_rev*_defconfig
    - xfi3_defconfig

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2016-04-20 11:43:27 +02:00
Sam Protsenko a59a77f863 usb: gadget: Move CONFIG_USB_GADGET_VBUS_DRAW to Kconfig
The description was borrowed from kernel. Definitions were added to
defconfig files in a way that "make savedefconfig" generates exactly
the same file as used defconfig.

Boards using 0 mA as CONFIG_USB_GADGET_VBUS_DRAW value were moved to use
2 mA (as minimal allowed by Kconfig).

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2016-04-20 11:43:27 +02:00
John Tobias 5b718407ed USB: g_dnl: Change device class
The USB Mass Storage (ums) works in Windows, Linux and OS X (EL Capitan).
But, not in OS X (Yosemite). By applying the said patch, it extends
the ums support.

Signed-off-by: John Tobias <john.tobias.ph@gmail.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>

Test HW: Odroid XU3 (./test/py UMS + DFU tests)

Tested-by: John Tobias <john.tobias.ph@gmail.com>

Linux:
    - Run ums to expose all my eMMC partition - shows all correctly
    - Run ums to expose only 1 partition of my eMMC - show correctly

Windows:
    - Run ums to expose all my eMMC partition - it detects but it prompts,
    if I want to format it (due to a non windows partition)
    - Run ums to expose only the FAT32 partition - it show the partition
      correctly.
2016-04-20 11:43:27 +02:00
Marek Vasut e026b984e6 ddr: altera: Repair DQ window centering code
The code uses a lot of signed numbers, which ended up in variables
of unsigned type, which resulted in all sorts of underflows. This
in turn caused incorrect calibration on certain boards. Moreover,
repair the readout of the DQ delay, which was being pulled from
wrong register.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Chin Liang See <clsee@altera.com>
2016-04-20 11:28:45 +02:00
Marek Vasut 85f76628a0 ddr: altera: Staticize global variables
Just staticize global variables in sequencer, since there is no
point in having these symbols available outside of the DDR code.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Chin Liang See <clsee@altera.com>
2016-04-20 11:28:45 +02:00
Marek Vasut ea9aa2414e ddr: altera: Make DLEVEL behavior inclusive
Originally, the DLEVEL selects the debug level within the sequencer code,
but only displays the messages on that particular debug level. Tweak the
handling such that for particular debug level, debug messages on that
level and lower are displayed. This allows better regulation of debug
message verbosity.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Chin Liang See <clsee@altera.com>
2016-04-20 11:28:45 +02:00
Marek Vasut 70ed80af46 ddr: altera: Zero DM IN delay in scc_mgr_zero_group()
This one last set of delay configuration registers was not properly
zeroed out originally, fix it and zero them out.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Chin Liang See <clsee@altera.com>
2016-04-20 11:28:45 +02:00
Marek Vasut f3f777cdf0 ddr: altera: Remove unnecessary ODT mode config
There is no point in resetting the ODT setting if the write test
failed, since the code will always retry the calibration and thus
reconfigure the ODT anyway OR the code will fail calibration and
halt.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Chin Liang See <clsee@altera.com>
2016-04-20 11:28:44 +02:00
Marek Vasut f5f8c411de ddr: altera: Remove unnecessary update of the SCC
Every invocation of the scc_mgr_set_dqs_en_delay_all_ranks() is
followed by SCC manager update. Moreover, only this function
triggers the SCC manager update internally. Thus, remove the
internal invocation to avoid triggering the update twice.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Chin Liang See <clsee@altera.com>
2016-04-20 11:28:44 +02:00
Marek Vasut 164eb23f49 ddr: altera: Fix DRAM end value in protection rule
The hi address bitfield in the protection rule must be set to
the last address in the region which the rule represents. The
behavior is now in-line with code generated by Quartus 15.1 .

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Chin Liang See <clsee@altera.com>
2016-04-20 11:28:44 +02:00
Marek Vasut 8e9e62c946 ddr: altera: Fix scc_mgr_set() argument order
The code should be setting registers to zero, not one register to value.
Swap the order of arguments to correct the behavior. The behavior is now
in-line with code generated by Quartus 15.1 .

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Chin Liang See <clsee@altera.com>
2016-04-20 11:28:44 +02:00
Marek Vasut bba7711092 ddr: altera: Tweak DQS tracking enable handling
In the most unlikely case the DQS tracking was to be disabled,
make sure we do not errornously re-enable it. Note that DQS
tracking is enabled on all systems observed thus far.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Chin Liang See <clsee@altera.com>
2016-04-20 11:28:44 +02:00
Marek Vasut abaf83619c ddr: altera: Replace ad-hoc constant with macro
The bit 22 is in fact DQS tracking enable bit (dqstrken) and there
is a macro for this bit already, so use it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Chin Liang See <clsee@altera.com>
2016-04-20 11:28:43 +02:00
Tang Yuantian 75e14b1ac8 ahci: flush dcache before issuing command
Ensure data the following sata command used is flushed out of dcache
and written to physical memory or timeout error may happen.

Signed-off-by: Tang Yuantian <yuantian.tang@nxp.com>
2016-04-18 17:11:48 -04:00
Stephen Warren e3a46e3ee2 serial: bcm283x_mu: make pending values more explicit
dm_serial_ops.pending should return the number of characters, not just a
valid C Boolean integer value. The existing code does already does this,
but only as an accident since BCM283X_MU_LSR_RX_READY happens to be
BIT(0). Enhance the code to be more explicit about the values it returns.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
2016-04-18 17:11:47 -04:00
Lokesh Vutla 8f69523213 memory: Move TI_AEMIF config to KCONFIG
Not all Keystone2 devices has AEMIF NAND controller. So adding Kconfig
entry for CONFIG_TI_AEMIF and enabling it in respective defconfigs on
platforms with AEMIF controller.

Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-18 17:11:43 -04:00
Tom Rini 3bfc8152b2 drivers/power/pmic/pm8916.c: Make usid be uint32_t
If get_dev_addr fails it will return FDT_ADDR_T_NONE and:
>>>     "priv->usid == 4294967295U" is always false regardless of the values of its operands. This occurs as the logical operand of if.

Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reported-by: Coverity (CID: 143914)
Signed-off-by: Tom Rini <trini@konsulko.com>
2016-04-18 17:11:42 -04:00
Tom Rini aa997d1d77 drivers/gpio/pm8916_gpio.c: Make pid be uint32_t
If get_dev_addr fails it will return FDT_ADDR_T_NONE and:
>>>     "priv->pid == 4294967295U" is always false regardless of the values of its operands. This occurs as the logical operand of if.

Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reported-by: Coverity (CID: 143913)
Signed-off-by: Tom Rini <trini@konsulko.com>
2016-04-18 17:11:42 -04:00
Mugunthan V N 5cc6a2458e drivers: mmc: omap_hsmmc: request cd and wp gpios when DM_MMC is defined
Add request gpio for CD and WP gpios, so that the gpio can be
used for the respective purposes.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-18 12:29:16 -04:00
Mugunthan V N 4bc5e19e12 drivers: mmc: omap_hsmmc: Fix conversion of address to a pointer
omap_hsmmc driver directly typecasts fdt_addr_t to a pointer.
This is not strictly correct, as it gives a build warning when
fdt_addr_t is u64. So, use map_physmem for a proper typecasts.

This is inspired by commit 167efe01bc ("dm: ns16550: Use an address
instead of a pointer for the uart base")

drivers/mmc/omap_hsmmc.c: In function ‘omap_hsmmc_ofdata_to_platdata’:
drivers/mmc/omap_hsmmc.c:776:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  priv->base_addr = (struct hsmmc *)dev_get_addr(dev);
                      ^

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-18 12:29:15 -04:00
Tom Rini 7e019daf7a drivers/tpm/tpm_tis_sandbox.c: Fix uninitialized variable use
In rollback_space_kernel we were not initializing the reserved fields
which should be for safety sake, and doing memset here means we don't
need to set the version field specifically either.

Reported-by: Coverity (CID: 143917)
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2016-04-15 08:14:37 -06:00
Stephen Warren 43c4d44e33 fdt: implement dev_get_addr_name()
This function parses the reg property based on an index found in the
reg-names property. This is required for bindings that are written
using reg-names rather than hard-coding indices in reg.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
2016-04-15 08:14:37 -06:00
Stefan Roese 770eb30ed9 dm: device.c: Minor coding-style fix
Fix multi-line comment indentation in device_bind()

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-04-14 11:51:39 -06:00
Peng Fan c3ab985362 dm: core: device: set pinctrl state for pinctrl device
We may have pinmux settings for pinctrl device, like the following
example:
"
&iomuxc {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_hog_1>;
	imx6ul-evk {
		pinctrl_hog_1: hoggrp-1 {
			fsl,pins = <
				MX6UL_PAD_UART1_RTS_B__GPIO1_IO19	0x17059 /* SD1 CD */
				MX6UL_PAD_GPIO1_IO05__USDHC1_VSELECT	0x17059 /* SD1 VSELECT */
				MX6UL_PAD_GPIO1_IO09__GPIO1_IO09        0x17059 /* SD1 RESET */
				MX6UL_PAD_SNVS_TAMPER0__GPIO5_IO00	0x80000000
			>;
		};
	[......]
};
"

We should not only select pinctrl state for non pinctrl devices, we
need also to handle pin mux settings such as pinctrl_log for pinctrl
devices.

So at the end of probing process of pinctrl device, select the default
state of pinctrl device.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-04-14 11:51:39 -06:00
Tom Rini 541c9be880 Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze 2016-04-13 12:53:11 -04:00
Moritz Fischer fdec2d21ef dm: i2c: Add driver for Cadence I2C IP
This is a possible drop in replacement for drivers/i2c/zynq-i2c.c

Since this is cadence IP it has been renamed to cdns-i2c,
to make sense with the compatible string.

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-13 18:29:07 +02:00
Michal Simek 01b2a69907 GPIO: pca953x: Remove compilation warnings on arm64
Warnings:
w+../drivers/gpio/pca953x.c: In function ‘do_pca953x’:
w+../drivers/gpio/pca953x.c:220:5: warning: cast from pointer to integer
of different size [-Wpointer-to-int-cast]
w+../drivers/gpio/pca953x.c:233:10: warning: cast from pointer to
integer of different size [-Wpointer-to-int-cast]

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-13 18:29:06 +02:00
Siva Durga Prasad Paladugu 251ab06d26 zynqmp: Kconfig: Enable ZYNQ_GPIO for ZynqMP
Enable ZYNQ_GPIO for ZynqMP using Kconfig. It enables the GPIO
driver support for ZynqMP.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-13 18:29:06 +02:00
Siva Durga Prasad Paladugu 404a00c7c9 gpio: zynqmp: Add GPIO driver support for ZynqMP
Add GPIO driver support for ZynqMP platform

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-13 18:29:06 +02:00
Siva Durga Prasad Paladugu f17abcaedb gpio: zynq: Move the definitions to driver file
Move all the gpio definitions to driver file as
there is no use of them in other files.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-13 18:29:06 +02:00
Siva Durga Prasad Paladugu de77a03bf2 gpio: zynq: Remove non driver model code
Remove non driver model support as it moved
to driver model. Dont need non driver model
anymore.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-13 18:29:06 +02:00
Siva Durga Prasad Paladugu 2978ae23fa gpio: Kconfig: Enable Zynq GPIO driver using kconfig
Enable DM GPIO and ZYNQ GPIO using kconfig instead of the board
config file.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-13 18:29:06 +02:00
Siva Durga Prasad Paladugu 68c7026e8d gpio: zynq: Convert Zynq GPIO to driver model
Convert Zynq GPIO driver to driver model

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-13 18:29:06 +02:00
Rouven Behr 7570a0cc75 mtd: cfi: Unlock current sector instead of sector 0 before buffered write
Unlock current sector instead of sector 0 before buffered write.

[Patch subject and commit text slightly reworded, Stefan]

Signed-off-by: Rouven Behr <u-boot@behr-iss.de>
Signed-off-by: Stefan Roese <sr@denx.de>
2016-04-13 13:43:37 +02:00
Tom Rini 39fbd98716 Merge git://www.denx.de/git/u-boot-marvell 2016-04-12 09:10:54 -04:00
Stefan Roese b23005cec3 gpio: mvebu_gpio: Add missing out value set to gpio_direction_output()
This patch adds the missing configuration of the output value to the
gpio_direction_output() function. Without this, calling
gpio_direction_output() does not set the out-value at all and only
configures the gpio as output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Kevin Smith <kevin.smith@elecsyscorp.com>
Reviewed-by: Kevin Smith <kevin.smith@elecsyscorp.com>
2016-04-12 11:13:33 +02:00
Hans de Goede fb3bfbb24a sunxi: H3: Do not clear usb companion clk-gate / reset on remove
On the H3 we need to enable the clk and de-assert the reset of the
companion to be able to talk to the actual usb host controller.

Before this commit we were also disabling the companion clk-gate /
asserting its reset on remove, causing the later remove callback of
the companion itself to (sometimes) fail with:

ERROR: USB HC reset timed out!

This commit fixes this by not disabling the companion's clk-gate nor
asserting its reset on remove.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2016-04-12 08:58:03 +02:00
Tom Rini 5fee9489f6 Merge branch 'master' of git://git.denx.de/u-boot-arc 2016-04-11 20:48:28 -04:00
Stefan Roese 456ecd08ec lib/crc8: Add crc start value
To make the usage of this function more flexible, lets add the CRC start
value as parameter to this function. This way it can be used by other
functions requiring different start values than 0 as well.

For non-zero CRC start values to work, I've reworked the function a bit.
The new implementation is copied from the Linux version in
drivers/i2c/i2c-core.c / i2c_smbus_pec(). Which supports non-zero
CRC stating values.

I've double-checked that the results for zero starting values are
identical to the results from the original version of this function.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-04-11 20:48:26 -04:00
Stefan Roese 20adda4cf8 bootcounter_ram: Flush dcache after data is written into SDRAM
This patch adds a call to flush_dcache_range() to bootcount_store() to
make sure, that the bootcounter data (including the patterns) is
written to memory. Without this, platforms with dcache enabled may not
have the bootcounter updated upon reset.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
2016-04-11 20:48:25 -04:00
Vikas Manocha 9082517a85 stm32: stm32_flash: add memory barrier during flash write
After writing data to flash space, next instruction is checking if flash
controller is busy writing to the flash memory. Memory barrier is required here
to avoid transaction re-ordering for data write and busy status check.

Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
2016-04-11 20:48:23 -04:00
Mateusz Kulikowski aafa64827f spmi: Fix sandbox spmi driver memory corruption
There is off-by-one error in sandbox_emul_gpio that causes
segfault of certain tests.

EMUL_GPIO_REG_END is the address of last valid (emulated) register.
This patch fixed this (by adding one more element to emulated register array).

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2016-04-11 20:48:22 -04:00
Alexey Brodkin 8b15010b1f arc: get rid of running_on_hw
ISS is obsolete now and nSIM is used for simulation instead.
In its turn nSIM properly handles baud-rate settings so get rid
of now useless check.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2016-04-11 10:20:30 -07:00
Tom Rini 9dbdc6ebd4 Merge branch 'master' of git://git.denx.de/u-boot-socfpga 2016-04-10 19:55:25 -04:00
Marek Vasut dafd5792a8 arm: socfpga: Nuke useless include
The dwmmc.h include was forgotten during the migration of dwmmc
probing to DM. Since the shiny DM is in place now, remove this
relic of the past.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Chin Liang See <clsee@altera.com>
2016-04-10 17:19:49 +02:00
Hans de Goede bf31323064 musb: Properly call musb_stop() on probe failure
musb_lowlevelinit(): if no device is plugged in / detected call
musb_stop() to undo the preceding musb_start() call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-04-10 17:18:43 +02:00
Hans de Goede 38b4a3e143 musb: sunxi: Do not allocate musb struct multiple times
The probe function of the musb host driver can be called multiple
times. The code assumes that it can save the pointer to the allocated
musb struct in the driver model priv_auto_alloc data, but this data
gets free-ed on a probe failure or on removal, so we must save the
pointer elsewhere.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-04-10 17:18:43 +02:00
Steve Rae cf12547385 usb: bcm_udc_otg: enable clocks
Turn on the USB OTG clocks.

Signed-off-by: Steve Rae <srae@broadcom.com>
2016-04-10 17:18:43 +02:00
Sriram Dash 47435e5b18 drivers:usb:common:fsl-dt-fixup: fix return value of fdt_usb_get_node_type
Changes the return type of fdt_usb_get_node_type from char* to int

Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
2016-04-10 17:18:43 +02:00
Sriram Dash b9f6786a88 drivers:usb:common:fsl-dt-fixup: Add device-tree fixup support for xhci controller
Enables usb device-tree fixup code to incorporate xhci controller

Signed-off-by: Ramneek Mehresh <ramneek.mehresh@nxp.com>
Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
2016-04-10 17:18:42 +02:00
Sriram Dash 469e72bc5d drivers:usb:common:fsl-dt-fixup: Remove code duplication for fdt_usb_get_node_type
Call fdt_usb_get_node_type() from fdt_fixup_usb_mode_phy_type() to
avoid code duplication.

Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Acked-by: Marek Vasut <marex@denx.de>
2016-04-10 17:18:42 +02:00
Sriram Dash 93eb8f39d2 drivers:usb:common:fsl-dt-fixup: Move device-tree fixup framework to common file
Move usb device-tree fixup framework from ehci-fsl.c to common place so
that it can be used by other drivers as well (xhci-fsl.c).

Signed-off-by: Ramneek Mehresh <ramneek.mehresh@nxp.com>
Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
Acked-by: Marek Vasut <marex@denx.de>
2016-04-10 17:18:42 +02:00
Mateusz Kulikowski cfb3f1cd0e usb: ehci-hcd: Fix crash when no ops are provided to ehci_register()
This commit fixes crash on BananaPi (and possibly others)
casued by 3f9f8a5b83.

Crash reason:
When no ops were passed to ehci_register(), USB host driver caused
NULL pointer dereference.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
2016-04-10 17:18:42 +02:00
Purna Chandra Mandal 03b8e04632 drivers: musb-new: Add USB DRC driver for Microchip PIC32 OTG controller.
This driver adds support of PIC32 MUSB OTG controller as dual role device.
It implements platform specific glue to reuse musb core.

Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
2016-04-10 17:18:41 +02:00
Purna Chandra Mandal 6d9481047e drivers: remove writes{b,w,l,q} and reads{b,w,l,q}.
Definition of writes{bwlq}, reads{bwlq} are now added into arch specific
asm/io.h. So removing them from driver to fix re-definition error

Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
2016-04-10 17:18:41 +02:00
Tom Rini 43d3fb5c06 Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq 2016-04-06 14:17:22 -04:00
York Sun 3c1d218a1d armv8: LS2080A: Consolidate LS2080A and LS2085A
LS2080A is the primary SoC, and LS2085A is a personality with AIOP
and DPAA DDR. The RDB and QDS boards support both personality. By
detecting the SVR at runtime, a single image per board can support
both SoCs. It gives users flexibility to swtich SoC without the need
to reprogram the board.

Signed-off-by: York Sun <york.sun@nxp.com>
CC: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2016-04-06 10:26:46 -07:00
Codrin Ciubotariu 9101a68c15 drivers: net: vsc9953: Fix bug when PVID is shown for disabled ports only
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: York Sun <york.sun@nxp.com>
2016-04-06 08:34:44 -07:00
Codrin Ciubotariu 02c00f265d drivers: net: vsc9953: Do not configure disabled ports
Some SerDes protocols might not enable all l2switch ports. In this case,
these ports should not be configured to perform Rx/Tx operations.
This also fixes an issue when flooded frames were also switched to
disabled ports and frames start to accumulate, consuming memory
and eventually causing head-of-line blocking for other frames.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: York Sun <york.sun@nxp.com>
2016-04-06 08:34:18 -07:00
Peng Fan 96f0407b00 fsl: esdhc: support driver model
Support Driver Model for fsl esdhc driver.

1. Introduce a new structure struct fsl_esdhc_priv
2. Refactor fsl_esdhc_initialize which is originally used by board code.
   - Introduce fsl_esdhc_init to be common usage for DM and non-DM
   - Introduce fsl_esdhc_cfg_to_priv to build the bridge for non-DM part.
   - The original API for board code is still there, but we use
     'fsl_esdhc_cfg_to_priv' and 'fsl_esdhc_init' to serve it.
3. All the functions are changed to use 'struct fsl_esdhc_priv', except
   fsl_esdhc_initialize.
4. Since clk driver is not implemented, use mxc_get_clock to geth
   the clk and fill 'priv->sdhc_clk'.

Has been tested on i.MX6UL 14X14 EVK board:
"
=>dm tree
....
 simple_bus  [ + ]    |   `-- aips-bus@02100000
  mmc        [ + ]    |       |-- usdhc@02190000
  mmc        [ + ]    |       |-- usdhc@02194000
....
=> mmc list
FSL_SDHC: 0 (SD)
FSL_SDHC: 1 (SD)
"

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Yangbo Lu <yangbo.lu@nxp.com>
Cc: Hector Palacios <hector.palacios@digi.com>
Cc: Eric Nelson <eric@nelint.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Simon Glass <sjg@chromium.org>
Tested-By: Eric Nelson <eric@nelint.com>
Reviewed-by: York Sun <york.sun@nxp.com>
2016-04-06 08:33:37 -07:00
Chris Packham 46a16bd895 kirkwood_nand: claim MPP pins on the fly
Claim the MPP pins for the NAND flash controller only when it's actually
being used. This allows the pins to be shared with the SPI interface
which already supports an equivalent on-access MPP reconfiguration.

Reviewed-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Acked-by: Scott Wood <oss@buserror.net>
Signed-off-by: Stefan Roese <sr@denx.de>
2016-04-06 15:40:33 +02:00
Stefan Roese 9fc56631a4 spi: kirkwood_spi: Add support for multiple chip-selects on MVEBU
Currently only chip-select 0 is supported by the kirkwood SPI driver.
The Armada XP / 38x SoCs also use this driver and support multiple chip
selects. This patch adds support for multiple CS on MVEBU.

The register definitions are restructured a bit with this patch. Grouping
them to the corresponding registers.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Reviewed-by: Jagan Teki <jteki@openedev.com>
2016-04-06 15:38:56 +02:00
Tom Rini 4ed6ed3c27 Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze 2016-04-04 14:34:09 -04:00
Siva Durga Prasad Paladugu 845ee5f623 net: zynq_gem: Add SGMII support for zynqMP
PCS auto negotaiation bit should be enabled
along with SGMII autonegotation enabled
in phy.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-04 20:28:39 +02:00
Siva Durga Prasad Paladugu 85b949f40b net: phy: Add SGMII support for TI phy
Add support of SGMII to TI phy dp838367
Enable the SGMII and PCS settings in phy
control, CFG2 and BIST registers

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-04 20:28:39 +02:00
Siva Durga Prasad Paladugu e76d2dcaeb net: zynq_gem: Return error incase of invalid phy address
Return error from probe in case of invalid phy address.
This fixes the issue of uboot crash if phy is not detected.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-04 20:28:39 +02:00
Michal Simek 679b994a2b block: Add support for Ceva sata
Initial Ceva Sata init code.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-04 20:28:39 +02:00
Michal Simek ceb04e1a5d net: axi_emac: Report phy-node error message permanently
Do not use debug() when printing error message. Use printf instead.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-04 20:28:38 +02:00
Joe Hershberger a509a1d402 net: gem: Allow to set the MAC from an EEPROM
Provide board specific option how to read MAC address from ROM.
Do it in generic way to be reusable by differnet boards.
If this is not enough board specific functions can be created.

Signed-off-by: Joe Hershberger <joe.hershberger@gmail.com> # driver part
Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-04 20:27:54 +02:00
Siva Durga Prasad Paladugu 8964f24179 net: xilinx_axi: Clear Isolate bit if found during phy setup
In SGMII cases the isolate bit might set after DMA and
ethernet resets and hence check and clear during
setup_phy if it was set.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-04 20:10:44 +02:00
Siva Durga Prasad Paladugu 9c0da76220 net: xilinx_axi: Use interface type instead of zero
Pass appropriate interface type to phy_connect
instead of zero.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-04 20:10:44 +02:00
Siva Durga Prasad Paladugu a06c341faa net: zynq_gem: Add support for SGMII interface
Add support of SGMII interface for zynq GEM.
Read xlnx,emio property from DT.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-04 20:10:44 +02:00
Siva Durga Prasad Paladugu ed6fad3e25 phy: Add phy driver support for xilinx PCS/PMA core
Add phy driver support for xilinx PCS/PMA core

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-04-04 20:10:44 +02:00
Stefan Roese 99d4c6d3b2 net: mvpp2.c: Add Marvell mvpp2 network driver for Armada 375
This patch adds support for the mvpp2 ethernet controller which is integrated
in the Marvell Armada 375 SoC. This port is based on the Linux driver (v4.4),
which has been stripped of the in U-Boot unused portions.

Tested on the Marvell Armada 375 eval board db-88f6720.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Acked-by: Joe Hershberger <joe.hershberger@gmail.com>
2016-04-04 11:21:40 +02:00
Stefan Roese 951f1b5f37 spi: kirkwood_spi.c: Add compatible match ID for Armada 375
This enables this driver for the Marvell Armada 375 SoC.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Reviwer-by: Jagan Teki <jteki@openedev.com>
2016-04-04 11:21:27 +02:00
Karsten Merker 563d8d9358 net: phy: Realtek RTL8211B/C PHY ID fix
The RTL8211B_driver structure in drivers/net/phy/realtek.c contains a
wrong PHY ID (0x1cc910 instead of 0x1cc912) in the uid field.

The lowest four bits of the PHY ID encode the chip revision (B+C/D/E/F)
of the RTL8211 and the code originally applied a mask of 0xfffff0 to
the PHY ID, so that matching the PHY ID to the appropriate driver code
was only done on the chip type (RTL8211), but not on a specific
revision.

After introduction of support for the RTL8211E, which needed another
startup function than the older chip revisions, commit
4220504767 changed the mask to 0xffffff
to make the chip revision relevant for the match, but didn't provide
the now-relevant lower bits of the uid field for the RTL8211B/C.

Fix this by setting the full PHY ID in the RTL8211B_driver uid field.

Fixes: 4220504767 ("net/phy: realtek: Fix the PHY ID mask to ensure the correct Realtek PHY is detected")
Signed-off-by: Karsten Merker <merker@debian.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2016-04-02 19:26:08 -04:00
Eric Nelson e40cf34a29 drivers: block: add block device cache
Add a block device cache to speed up repeated reads of block devices by
various filesystems.

This small amount of cache can dramatically speed up filesystem
operations by skipping repeated reads of common areas of a block
device (typically directory structures).

This has shown to have some benefit on FAT filesystem operations of
loading a kernel and RAM disk, but more dramatic benefits on ext4
filesystems when the kernel and/or RAM disk are spread across
multiple extent header structures as described in commit fc0fc50.

The cache is implemented through a minimal list (block_cache) maintained
in most-recently-used order and count of the current number of entries
(cache_count). It uses a maximum block count setting to prevent copies
of large block reads and an upper bound on the number of cached areas.

The maximum number of entries in the cache defaults to 32 and the maximum
number of blocks per cache entry has a default of 2, which has shown to
produce the best results on testing of ext4 and FAT filesystems.

The 'blkcache' command (enabled through CONFIG_CMD_BLOCK_CACHE) allows
changing these values and can be used to tune for a particular filesystem
layout.

Signed-off-by: Eric Nelson <eric@nelint.com>
2016-04-01 17:18:27 -04:00
Mateusz Kulikowski 120800df72 gpio: Add support for Qualcomm PM8916 gpios
This driver supports GPIOs present on PM8916 PMIC.
There are 2 device drivers inside:
- GPIO driver (4 "generic" GPIOs)
- Keypad driver that presents itself as GPIO with 2 inputs (power and reset)

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2016-04-01 17:18:13 -04:00
Mateusz Kulikowski c2f74c8f53 pmic: Add support for Qualcomm PM8916 PMIC
This PMIC is connected on SPMI bus so needs SPMI support enabled.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2016-04-01 17:18:13 -04:00
Mateusz Kulikowski 5b47271c18 drivers: spmi: Add support for Qualcomm SPMI bus driver
Support SPMI arbiter on Qualcomm Snapdragon devices.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2016-04-01 17:18:12 -04:00
Mateusz Kulikowski d33776e43d spmi: Add sandbox test driver
This patch adds emulated spmi bus controller with part of
pm8916 pmic on it to sandbox and tests validating SPMI uclass.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-04-01 17:18:12 -04:00
Mateusz Kulikowski 04868b407b drivers: Add SPMI bus uclass
Qualcom processors use proprietary bus to talk with PMIC devices -
SPMI (System Power Management Interface).
On wiring level it is similar to I2C, but on protocol level, it's
multi-master and has simple autodetection capabilities.
This commit adds simple uclass that provides bus read/write interface.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2016-04-01 17:18:12 -04:00
Mateusz Kulikowski 5a8221181e ehci: Add support for Qualcomm EHCI
This driver is able to reconfigure OTG controller into HOST mode.
Board can add board-specific initialization as board_prepare_usb().
It requires USB_ULPI_VIEWPORT enabled in board configuration.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
Tested-by: Simon Glass <sjg@chromium.org>
2016-04-01 17:18:11 -04:00
Mateusz Kulikowski d144f96a48 ehci-ci.h: drop generic USBCMD fields
Use definitions from ehci.h instead.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
Tested-by: Simon Glass <sjg@chromium.org>
2016-04-01 17:18:11 -04:00
Mateusz Kulikowski e162c6b1a7 usb: Rename ehci-fsl.h to ehci-ci.h
Most of ehci-fsl header describe USB controller
designed by Chipidea and used by various SoC vendors.

This patch renames it to a generic header: ehci-ci.h
Contents of file are not changed (so it contains several
references to freescale SoCs).

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
Tested-by: Simon Glass <sjg@chromium.org>
2016-04-01 17:18:10 -04:00
Mateusz Kulikowski 64160a545d eth: asix88179: Print packet length properly
Debug printf used '%u' to print size_t variable.
This caused warnings on 64-bit machines.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2016-04-01 17:18:10 -04:00
Mateusz Kulikowski d3d844f84a usb: ulpi: Fix compile warning in read/write on 64-bit machines.
ulpi_read and ulpi_write are used to read/write registers via ULPI bus.
Code generates compilation warnings on 64-bit machines where pointer
is cast to u32.

This patch drops all but last 8 bits of register address.
It is possible, because addresses on ULPI bus are 6- or 8-bit.

It is not possible (according to ULPI 1.1 spec) to have more
than 8-bit addressing.

This patch should not cause regressions as all calls to
ulpi_read/write use either structure pointer (@ address 0) or integer
offsets cast to pointer - addresses requested are way below 8-bit range.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
2016-04-01 17:18:09 -04:00
Mateusz Kulikowski 6b14fbbdc6 usb: ulpi: Add Kconfig options for ULPI
The following options can be now enabled via defconfig:
- CONFIG_USB_ULPI
- CONFIG_USB_ULPI_VIEWPORT
- CONFIG_USB_ULPI_VIEWPORT_OMAP

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
2016-04-01 17:18:08 -04:00
Mateusz Kulikowski 3f9f8a5b83 ehci-hcd: Add init_after_reset
Some host controllers need addidional initialization after ehci_reset()
In non-dm implementation it is possible to use CONFIG_EHCI_HCD_INIT_AFTER_RESET.
This patch adds similar option to ehci drivers using dm.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2016-04-01 17:18:08 -04:00
Mateusz Kulikowski 9d11d12a16 mmc: Add support for Qualcomm SDHCI controller
Add support for SD/eMMC controller present on some Qualcomm Snapdragon
devices. This controller implements SDHCI 2.0 interface but requires
vendor-specific initialization.
Driver works in PIO mode as ADMA is not supported by U-Boot (yet).

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2016-04-01 17:18:08 -04:00
Mateusz Kulikowski 81a87e1894 gpio: Add support for Qualcomm gpio controller
Add support for gpio controllers on Qualcomm Snapdragon devices.
This devices are usually called Top Level Mode Multiplexing in
Qualcomm documentation.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2016-04-01 17:18:07 -04:00