OMAP: UART: Specify DMA RX buffer size

At the moment DMA mode is disabled for UART. When enable it -- there is
continuously printing "DMA misaligned error" even though data is aligned
properly (tested with IS_ALIGNED() macro). Actually the problem is in zero
length size for RX DMA buffer.

This patch set RX DMA buffer size equals to default size to prevent futher
problems if DMA will be enabled for UART. Also it set other DMA RX fields to
their default values.

This patch inspired by OMAP5 serial board file (board-omap5evm-serial.c)
in k3.4.

Change-Id: Id73c30892b2104b4283783e740f137514be64a1f
Signed-off-by: Semen Protsenko <semen.protsenko@ti.com>
remoteproc: omap: differentiate auto-suspend from system suspend

The omap remoteproc driver sends a mailbox message to the remote
processor requesting it to save its context and then be suspended.
This can happen either through the runtime auto-suspend path or
through the system suspend.

The mailbox message being sent to the remote processor is now
differentiated between the two paths. This differentiation provides
flexibility on the remote processor to allow an application cancel
auto-suspend. This flexibility is needed as there can be some
operations wherein there is no on-going activity between the host
and the remote processor with the remote processor idle waiting for
an event that would take more time to complete than the auto-suspend
timeout.

The auto-suspend cancellation is detected by the driver on the
host-side through a timeout for the processor to be idled, and is
simply rescheduled.

Change-Id: Ifdeeb80a632ac0145194d3c20f66256226e7efd4
Signed-off-by: Shahid Akhtar <sakhtar@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
omap: ion: increase ducati memory by 2MB

The carveout size required for the ducati firmware image has
been increased by 2MB to allow an increased heap size on the
remote processor side.

This change is automatically reflected for OMAP4 Blaze, Tablet
and Panda boards.

Change-Id: I2524e481b9c753a03a32c50c30fab879b6515665
Signed-off-by: Suman Anna <s-anna@ti.com>
omap4: hwmod_data: add clocks to ipu processor devices

The ipu processor hwmod devices (ipu_c0 & ipu_c1) are defined
primarily as pseudo-hwmod devices with only reset controls.
These share the same functional clock along with the ipu hwmod
device that is mainly used for controlling the MMU. This clock
name is added to these pseudo-hwmod devices, as it will improve
the robustness to any HW_AUTO settings performed within the
hwmod framework. There is no major effect on the clock framework
itself, as the clock enable & disable will simply be reference
counted and the functionality would be identical as before.

Change-Id: I865e9690b503e601df27aa0a55cfac45622c4259
Signed-off-by: Suman Anna <s-anna@ti.com>
omap: iommu: relax constraint value to allow CSWR

The iommu driver currently requests a latency constraint,
if configured in platform data, on the power domain it is
present in. These values are required only for OMAP4 and
beyond and is done to ensure the AMMU context is maintained
when the corresponding power domain goes to a low power state
during cpuidle path. The AMMU context is retained in CSWR, but
is lost in OSWR.

The current constraint value (10) for OMAP4+ is high and
restricts the power domain to remain in ON state as long as
the processor is active. This value is relaxed to 400 to
allow a lower power CSWR state during cpuidle path.

The context is saved and restored properly when suspending
the remote processor.

Change-Id: I89fd125f2244ae1691843c3c078aa6314a7ae8a6
Signed-off-by: Miguel Vadillo <vadillo@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
omap: mailbox: relax constraint to allow powerdomain to go to CSWR

The mailbox registers can be accessed and configured by other remote
processor initiators, and hence the driver has to be responsible for
maintaining the register context when they are active. This is
achieved by the mailbox driver by requesting a latency constraint
on the power domain that it belongs to.

The current constraint value (10) is high and restricts the power
domain to remain in ON state as long as a remote processor is
active. This value is relaxed to 400 to allow a lower power CSWR
state that can still retain the context during cpuidle path and
a remote processor is active.

The constraint is completely removed when the remote processor is
suspended. The mailbox context is saved and restored properly
when suspending the remote processor.

Change-Id: I152b57e982dc8e5739808cbbbe8bd5cc96223ffa
Signed-off-by: Miguel Vadillo <vadillo@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
cpufreq: interactive governor: Fix not uniform buf filling & memory corruption

Each CPU has it's own load history buffer, but all they use shared
<history_load_index> variable, this lead to not uniform filling
of the cpu's circular buffers. Only about half of buffer is updated
during each buffer rewriting cycle that obligate governor to use
outdated data during freq tuning.

Moreover access to <history_load_index> variable is not atomic, that
create race conditions. Simultaneous increment could cause situation
where such check:

        if (++history_load_index == sampling_periods)
                history_load_index = 0;

not safe and buffer overflow will not be prevented. That will lead
to memory corruption.

To avoid such problems this patch move buffer-index variable to
<cpufreq_interactive_cpuinfo> structure, which is separate for each CPU.
Also, buffer overflow checking will be paranoidly changed.

Change-Id: I333a4462be17816372a7a57529811d87930058c0
Signed-off-by: Leonid Iziumtsev <x0153368@ti.com>
OMAP4470: OPP: Enable SGX OPP-OV for Low Power OPP set

Initial 4470 Low Power OPP set was copied from 4460 OPP set.
4460 OPP set had SGX OPP-OV disabled by
commit 919cf0ce816b626f1d836d050a31463650f54526.
This commit is reverted and 4460 SGX OPP-OV is enabled.
Same should be done for 4470.

Change-Id: I7483a8669da79479303453495c0d41f959daa9ad
Signed-off-by: Taras Kondratiuk <taras@ti.com>
blaze_defconfig: enable USB networking

USB network adapters are widely used for many cases.
Enable USB networking so rebuild of kernel will not be
required for USB network adapters usage.

Change-Id: Ic45ff71922538be6b0404c3674ac9002a838ae3a
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
OMAPDSS: DSSCOMP: Fix incorrect num_ovls check

In setup manager IOCTL, the check to validate the number of overlays
is incorrect. Hence when all overlays are passed to setup manager IOCTL
with enable/disable, error was returned. Fix the same.

Change-Id: I8ec1a6dee9f074ebf83a39bdf113a97e2543cc70
Signed-off-by: Varadarajan, Charulatha <charu@ti.com>
i2c: omap: implement shutdown handler

Once i2c driver shutdown has been called, ignore any more
transfer requests. This patch adds the missing callback.

Leave the PMIC i2c (i2c-1) alive, since power_off case needs it
well after shutdown handlers have been called for power_off case.

Change-Id: I4f4553327e5c024f78acb8501864dd9beb1883c3
Signed-off-by: Semen Protsenko <semen.protsenko@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Revert ducati 2.1.13 prerequisites: 6d2d426 and 1289289.

This reverts commits:
6d2d426 "remoteproc: omap: differentiate auto-suspend from system suspend"
1289289 "omap: ion: increase ducati memory by 2MB"

Change-Id: Ib3d14d9ca859bcc60f35734552bae41eaa874436
Signed-off-by: Roman Shaposhnikov <x0166637@ti.com>
Revert "Revert ducati 2.1.13 prerequisites: 6d2d426 and 1289289."

This reverts commit 15ff8652b93e43d0eb0a65a3f31d47b97dde6290.

Change-Id: I3a8468c8ebb22ea46aedc57bcb90a0b98f5bb5f8
Signed-off-by: Dmytro Kedrovskyi <x0169235@ti.com>
[Media:Radio] wl12xx: Fix for overflow while getting irq status

->dlen is 8 bit long and so while memcpy there is a chance
that fmdev->irq_info.flag will overflow.

So this patch removes memcpy and instead copies the 16bit flag
register value from skb->data to fmdev->irq_info.flag directly.

Change-Id: I37604b91b2777ed9e56a7e1c1ecefe32e9024170
Signed-off-by: Manjunatha Halli <x0130808@ti.com>
[Media:Radio] WiLink: Add support for Russian Band

This patch adds support for russian band (frequency range
65.8 MHz to 74 MHz).

This frequency range comes under OIRT FM broadcast band which is
currently used by Russia,Belarus,Moldova and Ukraine.

User app has to write "2" to "/sys/class/video4linux/radio0/fmrx_band"
to switch to Russian/OIRT band.

Change-Id: I26ea5b54afab10eb1769e0b07421d0b98ca24eee
Signed-off-by: Manjunatha Halli <x0130808@ti.com>
[Media:Radio] WiLink: Miscellaneous fixes for FM Receiver

This patch fixes below small issues with FM RX,
	1) Enables the support for FM Alternate Frequency
	2) Modifies Wrap_Seek such that seek will try for one time
	   and if it didn't get a good station within, then returns
	   the default frequency according to band.

Change-Id: Id9ca57451847617fade8959154f205cfff06faee
Signed-off-by: Manjunatha Halli <x0130808@ti.com>
[Media:Radio] WiLink: Add support for complete scan

This patch adds support for complete scan feature.

To start/stop/read complete scan user has to write to
'/sys/class/video4linux/radio0/fmrx_comp_scan'

After complete scan read on /dev/radio will give the
scanned results

Change-Id: Ic02408cfbfcea3c10623da8f377a0224ce7b4c31
Signed-off-by: Manjunatha Halli <x0130808@ti.com>
asix: asix_rx_fixup surgery to reduce skb truesizes

asix_rx_fixup() is complex, and does some unnecessary memory copies (at
least on x86 where NET_IP_ALIGN is 0)

Also, it tends to provide skbs with a big truesize (4096+256 with
MTU=1500) to upper stack, so incoming trafic consume a lot of memory and
I noticed early packet drops because we hit socket rcvbuf too fast.

Switch to a different strategy, using copybreak so that we provide nice
skbs to upper stack (including the NET_SKB_PAD to avoid future head
reallocations in some paths)

With this patch, I no longer see packets drops or tcp collapses on
various tcp workload with a AX88772 adapter.

Backported from opensource a9e0aca4b37885b5599e52211f098bd7f565e749

Change-Id: I203aee15c4d924610cc4a07ae87a653963eab45b
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Aurelien Jacobs <aurel@gnuage.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Trond Wuellner <trond@chromium.org>
Cc: Grant Grundler <grundler@chromium.org>
Cc: Paul Stewart <pstew@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
asix: remove extra memory allocation in asix_rx_fixup

asix_rx_fixup() does extra memory allocation, so incoming
traffic consume a lot of memory.

Switch to a different strategy: instead of creating new
skbs just modify existing.

Change-Id: Ia1b6101fafee7ee379c8d3181f4d6be7202ae9f5
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
net: usbnet: limit 'tx' and 'done' queue size

The dev->done queue size was not controlled
Thus under heavy load (usually UDP transfers)
if upper layer reads the data from this queue
slowly, it may be increased to fatal size, eating
all accessible memory.

Now the 'done' queue size is limited by RX_QLEN + TX_QLEN

Change-Id: Iaff012eef1b669b4a8d684ddbfb1bdd5335e1dc0
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>