Commit Graph

8219 Commits

Author SHA1 Message Date
Miao Yan a40b2dff7b net: e1000: use correct helper to do endianness conversion
In struct e1000_rx_desc, field 'length' is declared as
uint16_t, so use le16_to_cpu() to do endianness conversion.

Also drop conversion on 'status' which is declared as
uint8_t.

Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-01-04 12:25:35 -05:00
Eric Nelson 1aa2d074a7 mmc: update MMC_ERASE argument to match Linux kernel.
Table 41 of the JEDEC standard for eMMC says that bit 31 of
the command argument is obsolete when issuing the ERASE
command (CMD38) on page 115 of this document:
	http://www.jedec.org/sites/default/files/docs/jesd84-B45.pdf

The SD Card Association Physical Layer Simplified Specification also
makes no mention of the use of bit 31.
	https://www.sdcard.org/downloads/pls/part1_410.pdf

The Linux kernel distinguishes between secure (bit 31 set) and
non-secure erase, and this patch copies the macro names from
include/linux/mmc/core.h.

Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Eric Nelson <eric@nelint.com>
Tested-by: Hector Palacios <hector.palacios@digi.com>
2016-01-04 11:17:43 -05:00
Tom Rini f8a3df0fbc Merge branch 'master' of git://git.denx.de/u-boot-ubi 2016-01-04 10:53:50 -05:00
Ladislav Michl 6a4595600b UBI: Fix compile error when CONFIG_UBI_SILENCE_MSG defined
drivers/mtd/ubi/io.c:1354:3: error: 'dump_len' undeclared (first use in
this function)
   dump_len = max_t(int, 128, len - i);

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-01-04 09:11:10 +01:00
Tom Rini f1993ca066 Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2016-01-03 10:32:24 -05:00
Gong Qianyu aee3fddb67 i2c: mxc: add a condition in case the parameter is NULL
This could avoid executing the code that only applies to i.MX platforms.

The bus_i2c_init() is called before relocation and will assgin value
to a static variable. If U-Boot is then still running in a flash
device, it's theoretically not allowed to write data to flash without
an erasing operation. For i.MX platforms, the U-Boot is always running
in DDR.

Actually it causes asynchronous error when the ARM64 system error
report is enabled and the flash write protect is set.

Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2016-01-03 16:01:41 +01:00
Måns Rullgård 845a57b4de net: fec_mxc: unregister mdio bus on probe error
If fecmxc_initialize_multi() fails, it frees but does not unregister
the mdio bus, causing subsequent uses of the "mii" command to crash.
Fix this by adding mdio_unregister() calls where needed.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Reviewed-by: Eric Nelson <eric@nelint.com>
2016-01-03 15:28:06 +01:00
Måns Rullgård 843a3e5893 net: fec_mxc: configure MDIO hold time
If the host clock frequency is higher than 100 MHz, the MDIO hold
time needs to be increased from its current setting of one cycle in
order to meet the specified minium of 10 ns.  Writing an appropriate
value to the HOLDTIME field of the MII_SPEED register achieves this.

Comment copied from Linux kernel.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Reviewed-by: Eric Nelson <eric@nelint.com>
2016-01-03 15:26:06 +01:00
Maximilian Schwerin 434afa809e serial_mxc: Fix setup of UARTx_UFCR register
This patch writes the default values for TXTL and RXTL to UARTx_UFCR.
Without this patch some older kernel versions crash as UARTx_UFCR was
not always correctly initialized.

Signed-off-by: Maximilian Schwerin <maximilian.schwerin@tigris.de>
2016-01-03 15:22:11 +01:00
Eric Nelson f0b5f23f32 ARM: imx: fsl_esdhc: fix usage of low 4 bits of sysctl register
The low four bits of the SYSCTL register are reserved on the USDHC
controller on i.MX6 and i.MX7 processors, but are used for clocking
operations on earlier models.

Guard against their usage by hiding the bit mask macros on those
processors.

These bits are used to prevent glitches when changing clocks on
i.MX35 et al. Use the RSTA bit instead for i.MX6 and i.MX7.

>From the i.MX6DQ RM:
	To prevent possible glitch on the card clock, clear the
	FRC_SDCLK_ON bit when changing clock divisor value(SDCLKFS
	or DVS in System Control Register) or setting RSTA bit.

Signed-off-by: Eric Nelson <eric@nelint.com>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Hector Palacios <hector.palacios@digi.com>
2016-01-03 15:21:21 +01:00
Tom Rini d83c25c318 Merge git://git.denx.de/u-boot-usb 2016-01-02 12:24:43 -05:00
Stefan Brüns ac3abf0b7d usb: musb: Fix hub port setting for SPLIT transactions
The ifdef'ed Linux kernel code uses the 1 based port number, whereas U-Boot
puts a 0 based port number into the register. The reason the 0 based port
number apparently works can probably be taken from the USB 2.0 spec:

8.4.2.2 Start-Split Transaction Token
... The host must correctly set the port field for single and multiple TT
hub implementations. A single TT hub implementation *may ignore* the port
field.

Actually, as far as I understand, a multi TT hub defaults to single TT
(bAlternateSetting: 0) until switched via SetInterface, so even "port 42"
would work.

The change was verified by hardcoding the port number to a wrong value,
SPLIT transactions kept working (although using a DWC2 instead of MUSB).
Tested hubs are the RPi onboard SMC9514 and an external "05e3:0608
Genesys Logic, Inc. USB-2.0 4-Port HUB". The former is a multi TT hub,
the latter single TT only.

Addendum: Tested on sunxi/MUSB by Hans de Goede

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
2015-12-31 16:16:30 +01:00
Stefan Brüns faa7db24a4 usb: Move determination of TT hub address/port into separate function
Start split and complete split tokens need the hub address and the
downstream port of the first HS hub (device view).

The core of the function was duplicated in both host/ehci_hcd and
musb-new/usb-compat.h.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
2015-12-31 16:16:29 +01:00
Stefan Brüns 5253aded46 usb: dwc2: avoid out of bounds access
flush_dcache_range may access data after priv->aligned_buffer end if
len > DWC2_DATA_BUF_SIZE.
memcpy may access data after buffer end if done > 0

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
2015-12-31 10:05:31 +01:00
Thomas Chou 8e8106dcd5 altera_qspi: allow ctrl-c to abort the erase ops
Allow ctrl-c to abort the erase ops.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2015-12-28 09:32:43 +08:00
Thomas Chou d579d38f3f altera_qspi: show erase progress
Show sector erase progress with dot and comma.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2015-12-28 09:32:43 +08:00
Thomas Chou f81a673ec4 altera_qspi: skip erase if the sector is blank
Skip erase if the sector is blank. The sector erase is slow, and
may take 0.7 sec typically or up to 3 sec worst-case.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2015-12-28 09:32:43 +08:00
Thomas Chou a1b1d7eceb altera_qspi: set fail_addr for erase ops
If the erase fails, fail_addr might indicate exactly which block
failed. If fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not
at the device level or was not specific to any particular block.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2015-12-28 09:32:43 +08:00
Thomas Chou 9e957aa4ce altera_qspi: call callback even if the erase failed
Erase is an asynchronous operation.  Device drivers are supposed
to call instr->callback() whenever the operation completes, even
if it completes with a failure.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2015-12-28 09:32:43 +08:00
Marek Vasut 2b26109219 net: designware: Zap trailing backslash
Trailing backslashes are necessary only in macros, not in the actual
code, so remove them.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
2015-12-22 04:42:27 +01:00
Thomas Chou 25af71c4bf net: eth_designware: select PHYLIB in Kconfig
Select PHYLIB in drivers/net/Kconfig. And remove CONFIG_PHYLIB
from legacy board header files.

This fixed the warnings when both ALTERA_TSE and ETH_DESIGNWARE
are selected.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Pavel Machek <pavel@denx.de>
Acked-by: Chin Liang See <clsee@altera.com>
Acked-by: Pavel Machek <pavel@denx.de>
Tested-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-12-22 04:42:27 +01:00
Tom Rini 34059d8f50 Merge branch 'master' of git://www.denx.de/git/u-boot-socfpga 2015-12-19 22:05:31 -05:00
Dinh Nguyen a1684b6105 arm: socfpga: fix up a questionable macro for SDMMC
Move the macro into the socfpga_dwmci_clksel().

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Marek Vasut <marex@denx.de>
[fix parenthesis in the sdmmc_mask]
2015-12-20 03:44:56 +01:00
Marek Vasut 22854bda80 net: phy: micrel: Configure KSZ9021/KSZ9031 skew from OF
Add code to process the KSZ9021/KSZ9031 OF props if they are present
and configure skew registers based on the information from the OF.
This code is only enabled if the DM support for ethernet is also
enabled.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>

V2: - Implement struct ksz90x1_reg_field to describe the skew register
      fields more accurately.
    - Fix RXDV/TXEN skew register default value and offset.
2015-12-20 03:36:49 +01:00
Thomas Chou 1c0e84ca82 altera_qspi: initialize instr.mtd in flash_erase
Initialize instr.mtd in flash_erase(). This fixes the system
hang issue when CONFIG_MTD_PARTITIONS is selected.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
2015-12-19 09:51:19 +08:00
Tom Rini 4832e17787 Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze 2015-12-18 07:28:24 -05:00
Michal Simek 7bccc75a2b net: gem: Add driver dependencies to PHYLIB
Clear driver dependecies via Kconfig. Remove PHYLIB dependency from
the driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-12-18 13:15:58 +01:00
Michal Simek c942810787 net: gem: Fix typo in Kconfig entry
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2015-12-18 13:15:58 +01:00
Michal Simek 9d9211ac11 net: gem: Separate recv and free_pkt functions
Use core to call net_process_received_packet() instead of call inside
the driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2015-12-18 13:15:58 +01:00
Michal Simek da872d7c13 net: gem: Fix return value from recv
recv function should return 0 instead of frame_len not to
proceed the same packet again in core.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2015-12-18 13:15:58 +01:00
Michal Simek bcdfef7a26 net: gem: Setup default phy address to -1
Undefined phy address is -1 not 0.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2015-12-18 13:15:58 +01:00
Nathan Rossi 04a44d3671 spi: zynq_qspi: Add configuration to disable LQSPI feature
When the Zynq Boot ROM code loads the payload from QSPI it uses the
LQSPI feature of the QSPI device, however it does not clean up its
configuration before handing over to the payload which leaves the device
confgured to by-pass the standard non-linear operating mode.

This ensures the Linear QSPI mode is disabled before re-enabling the
device.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Cc: Jagan Teki <jteki@openedev.com>
Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-12-18 13:15:57 +01:00
Tom Rini 123b701779 Merge branch 'master' of git://git.denx.de/u-boot-usb 2015-12-17 21:46:04 -05:00
Alexey Brodkin fee331f66c usb: add support of generic OHCI devices
This driver is meant to be used with any OHCI-compatible host
controller in case if there's no need for platform-specific
glue such as setup of controller or PHY's power mode via
GPIOs etc.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Marek Vasut <marex@denx.de>
2015-12-17 21:54:41 +01:00
Lukasz Majewski 70cc443d58 usb: host: ehci: samsung: Move hcor initialization after usb phy setup
With the old order of initialization the hcor pointer has been setup to
the same address as Exynos EHCI base address (0x12110000 instead of
0x12110010).
Such behaviour was caused by reading value of 0 instead of 0x10 from EHCI
HCCPBASE register without doing proper clock initialization before.

To fix this problem hcor initialization has been moved after USB PHY setup.
Now ehci_readl(&ctx->hcd->cr_capbase) returns correct value.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2015-12-17 21:54:41 +01:00
Marek Vasut 5d5716eebc usb: s3c-otg: Rename usb/s3c_udc.h to usb/dwc2_udc.h
The driver is actually for the Designware DWC2 controller.
This patch renames the global s3c_udc.h header to dwc2_udc.h.

The rename is done automatically:
	$ sed -i "s/s3c_udc\.h/dwc2_udc.h/g" \
		`git grep "s3c_udc\.h" | cut -d : -f 1`

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:41 +01:00
Marek Vasut a4bb9b3636 usb: s3c-otg: Rename s3c_udc_probe() function
The driver is actually for the Designware DWC2 controller.
This patch is the second and final to rename global symbol,
the s3c_udc_probe() function.

The rename is done automatically:
	$ sed -i "s/s3c_udc_probe/dwc2_udc_probe/g" \
		`git grep s3c_udc_probe | cut -d : -f 1`

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:40 +01:00
Marek Vasut c0982871df usb: s3c-otg: Rename struct s3c_plat_otg_data
The driver is actually for the Designware DWC2 controller.
This patch is the first to rename global symbol, the struct
s3c_plat_otg_data.

The rename is done automatically:
	$ sed -i "s/s3c_plat_otg_data/dwc2_plat_otg_data/g" \
		`git grep s3c_plat_otg_data | cut -d : -f 1`

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:40 +01:00
Marek Vasut e30824f439 usb: s3c-otg: Rename USB_GADGET_S3C_UDC_OTG* to USB_GADGET_DWC2_OTG*
The s3c-otg IP block is in fact a DWC2 OTG one, so finally rename the
config option to make it less misleading. No functional change, just
a mechanical change done using the following script:

  git grep USB_GADGET_S3C_UDC_OTG | cut -d : -f 1 | sort -u | \
  while read line ; do
    sed -i "s/USB_GADGET_S3C_UDC_OTG/USB_GADGET_DWC2_OTG/g" $line ;
  done

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:40 +01:00
Marek Vasut e179cedd09 usb: s3c-otg: Tweak the comments
The driver is actually for the Designware DWC2 controller.
Tweak the comments in the driver to reflect this fact.

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:40 +01:00
Marek Vasut 507e677bc4 usb: s3c-otg: Rename remaining macros
The driver is actually for the Designware DWC2 controller.
This patch renames the remaining S3C_* macros to match the
DWC2 naming.

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:40 +01:00
Marek Vasut be5e4bdced usb: s3c-otg: Rename sources to dwc2_*c
The driver is actually for the Designware DWC2 controller.
This patch renames the local source files to dwc2_*c and
adjusts the Makefile to use the new names.

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:40 +01:00
Marek Vasut f4d9bd06f7 usb: s3c-otg: Rename local headers to dwc2_*h
The driver is actually for the Designware DWC2 controller.
This patch renames the local header files to dwc2_*h and
adjusts the sources to use the new names.

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:40 +01:00
Marek Vasut 06cb6ccd8e usb: s3c-otg: Change the driver name to dwc2-udc
Just change the driver name.

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:40 +01:00
Marek Vasut 193979e2fe usb: s3c-otg: Zap useless externs
The extern statements are useless, remove them. Also remove the
extern ... controller, which is completely useless.

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:40 +01:00
Marek Vasut 155e740f73 usb: s3c-otg: Rename remaining local s3c_*() functions
The driver is actually for the Designware DWC2 controller.
This patch renames the remaining local s3c_*() functions
to reflect this.

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:39 +01:00
Marek Vasut f52dd802cc usb: s3c-otg: Rename s3c_udc_*() functions
The driver is actually for the Designware DWC2 controller.
This patch renames the s3c_ep_*() functions to reflect this.
The function s3c_udc_probe() is a special case and is not
renamed by this patch yet.

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:39 +01:00
Marek Vasut ae1f2f0c4a usb: s3c-otg: Rename s3c_ep_*() functions
The driver is actually for the Designware DWC2 controller.
This patch renames the s3c_ep_*() functions to reflect this.

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:39 +01:00
Marek Vasut 28b9774808 usb: s3c-otg: Rename s3c_ep0_*() functions
The driver is actually for the Designware DWC2 controller.
This patch renames the s3c_ep0_*() functions to reflect this.

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:39 +01:00
Marek Vasut de578e22d4 usb: s3c-otg: Staticize functions in s3c_udc_otg_xfer_dma.c
Just staticize the functions, they are not used outside of the file.

Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17 21:54:39 +01:00