ARM: zynq: defconfig: Enable M25P80 SPI flash chips

Without it QSPI flash is not properly detected
and MTD partitions are not probed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
ARM: zynq: dts: Remove xlnx,qspi-mode and xlnx_fb-clk properties

They are not used by the driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
mtd: spi-nor: Changes for stacked and parallel

This patch adds support for dual parallel and stacked configurations.

The existing "is_dual" property and DUAL_STACK config options were used
to identify the hw configurations.
Added required parameters to spi_nor structure and initialized the same
in m25p80 probe or spi_nor_scan.
Added support for dual stacked and parallel in spi_nor_read/write/erase
functions by doing the following:
- Increase page_size, sector_size, erase_size and total flash size as
  applicable.
- Halve address when in parallel mode.
- When in stacked subtract lower flash address from offset when addressing
  upper chip. Update spi->master->flags so that qspi driver can change CS.

spansion_quad_enable/set_quad_mode are still left unused.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
mtd: spi-nor: Support for > 128 Mbit flash devices

This patch adds support for >128Mbit flash devices.
While the default in spi-nor.c is 4 byte addressing, this patch adds
bank selection and uses the same 3 byte read commands.
Required parameters are added in spi_nor struct.
read_ear and write_ear functions are added with support for commands
used by spansion and micron.
spi_nor_write_ext and spi_nor_read_ext will:
- Check if bank change is required for current address to be accessed and
  change the bank.
- Call spi_nor_read/spi_nor_write functions for an operations within the
  bank bounds.
- Repeat above till required transfer is completed.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
mtd: spi-nor: Check for return of wait_till_ready

Don't proceed with writing further pages if status read returns a failure.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
mtd: spi-nor: Update lock/unlock support

Update the block protect bits and their calculation for Spansion and Micron.
Add support for lock/unlock in parallel and stacked configurations.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
net: emacps: Reset the controller if HRESP error occurs on rx path

Reset the controller if HRESP error occurs on rx path.

Signed-off-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
net: xilinx: emacps: Fix receiving duplicate ping packets in 10mbps mode

The ping turnaround time measured for emacps in 10mbps mode is around 300ms.
So, increased the general purpose timeout value to 500ms for avoiding the rx
engine reset that occurs after every timer timeout and if there is no update
in the rx stat counters.

Signed-off-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: phy-zynq: Enable Vbus if port A is detected.

With the current implementation, A-device can only provide Vbus to
B-device through sysfs attribute "a_bus_req".
So, modified the driver to enable Vbus if port A is detected so that
with out userspace help the vbus can be provided to the B-device.

Signed-off-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
Tested-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynq usb: Allow use of external VBUS regulator

Add support for driving an external VBUS regulator. This makes it possible
to operate the USB in OTG mode without requiring programmable logic to drive
the VBUS controls, such as a MIO GPIO pin or external I2C regulator.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Reviewed-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
gpu: drm: xylon: Fixed compile error

Replace call to drm_fb_helper_restore_fbdev_mode() with
drm_fb_helper_restore_fbdev_mode_unlocked().

Error log:
drivers/gpu/drm/xylon/xylon_fbdev.c: In function 'xylon_drm_fbdev_restore_mode':
drivers/gpu/drm/xylon/xylon_fbdev.c:218:3: error: implicit declaration of
function 'drm_fb_helper_restore_fbdev_mode'
[-Werror=implicit-function-declaration]
   drm_fb_helper_restore_fbdev_mode(&fbdev->fb_helper);
   ^

Signed-off-by: Davor Joja <davorjoja@logicbricks.com>
Tested-by: Christian Kohn <christian.kohn@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
gpu: drm: xylon: Fixed NULL pointer dereference

Call drm_fb_helper_prepare() function for proper struct drm_fb_helper
initialization and remove manual drm_fb_helper_funcs pointer initialization.

Error log:
Unable to handle kernel NULL pointer dereference at virtual address 000001d0
pgd = 40004000
[000001d0] *pgd=00000000
Internal error: Oops - BUG: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 6 Comm: kworker/u4:0 Not tainted 3.17.0
PC is at drm_fb_helper_single_add_all_connectors+0x10/0xa8
LR is at xylon_drm_fbdev_init+0x7c/0xfc

Signed-off-by: Davor Joja <davorjoja@logicbricks.com>
Tested-by: Christian Kohn <christian.kohn@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
gpu: drm: xylon: Fixed connector register/unregister functionality

Replaced drm_sysfs_connector_add() with drm_connector_register() and
drm_sysfs_connector_remove() with drm_connector_unregister().

Signed-off-by: Davor Joja <davorjoja@logicbricks.com>
Tested-by: Christian Kohn <christian.kohn@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
gpu: drm: xylon: Removed pixel-format property

Removed ABGR pixel-format property to avoid
non-standard change of crtc pixel format.

Signed-off-by: Davor Joja <davorjoja@logicbricks.com>
Tested-by: Christian Kohn <christian.kohn@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
gpu: drm: xylon: Removed unused function argument

Removed unused struct device *dev function argument.

Signed-off-by: Davor Joja <davorjoja@logicbricks.com>
Tested-by: Christian Kohn <christian.kohn@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
gpu: drm: xylon: Fixed define name

Changed counfusing define name for data enable signal
to proper name.

Signed-off-by: Davor Joja <davorjoja@logicbricks.com>
Tested-by: Christian Kohn <christian.kohn@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>