remoteproc: refactor rproc_elf_find_rsc_table()

Refactor rproc_elf_find_rsc_table() and split out the scanning
for the section header named resource table. This is done to
prepare for loading firmware once.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[small function name change to make the code easier to read]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
remoteproc: add find_loaded_rsc_table firmware ops

Add function find_loaded_rsc_table to firmware ops. This function
returns the location of the resource table in shared memory
after loading.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[align function name with existing terminology, update commit log]
[document new function, rebase patch, small cleanups]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
remoteproc: parse STE-firmware and find resource table address

Parse the STE firmware and scan the TOC-table to find the address
of the loaded resource table.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
[rebase patch; update terminology]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
remoteproc: code cleanup of resource parsing

Combine the almost identical functions rproc_handle_virtio_rsc
and rproc_handle_boot_rsc.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[small terminology and style changes]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
hwspinlock/omap: support OMAP5 as well

OMAP5 has spinlocks, too.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
remoteproc: calculate max_notifyid by counting vrings

Simplify handling of max_notifyid by simply counting the
number of vrings.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[small terminology changes]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
remoteproc: perserve resource table data

Copy resource table from first to second firmware loading.
After firmware is loaded to memory, update the vdevs resource
pointer to the resource table kept in device memory.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[rebase, terminology and style changes]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
remoteproc: support virtio config space.

Support virtio configuration space and device status. The virtio
device can now access the resource table in shared memory.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[rebase and style changes]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
remoteproc: set vring addresses in resource table

Set the vring addresses in the resource table so that
the remote device can read the actual addresses used.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[rebase]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
remoteproc/omap: support OMAP5 too

This allows building remoteproc on OMAP5 too.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
[edit commit log]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
remoteproc: support default firmware name in rproc_alloc()

If rproc_alloc isn't given a firmware name, look for a default
one using the "rproc-%s-fw" template.

Signed-off-by: Robert Tivy <rtivy@ti.com>
[add commit log, document change, use snprintf, minor style change]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
rpmsg: process _all_ pending messages in rpmsg_recv_done

Change virtqueue callback function rpmsg_recv_done() to process all
available messages instead of just one message.

Signed-off-by: Robert Tivy <rtivy@ti.com>
[split _recv function instead of adding indentation]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
remoteproc/davinci: add a remoteproc driver for OMAP-L13x DSP

Adding a new remoteproc driver for OMAP-L13x DSP

Signed-off-by: Robert Tivy <rtivy@ti.com>
[removed 'EXPERIMENTAL' and fixed some indentation issues]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
MAINTAINERS: add rpmsg entry

People and scripts look for this.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
remoteproc: fix kconfig dependencies for VIRTIO

Fix this:

warning: (VIRTIO_PCI && VIRTIO_MMIO && REMOTEPROC && RPMSG) selects VIRTIO which has unmet direct dependencies (VIRTUALIZATION)

Cc: stable@vger.kernel.org
Signed-off-by: Suman Anna <s-anna@ti.com>
[edit commit log]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
rpmsg: fix kconfig dependencies for VIRTIO

Fix this:
warning: (VIRTIO_PCI && VIRTIO_MMIO && REMOTEPROC && RPMSG) selects VIRTIO which has unmet direct dependencies (VIRTUALIZATION)

Cc: stable@vger.kernel.org
Signed-off-by: Suman Anna <s-anna@ti.com>
[edit commit log]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
libata: change maintainer

Jeff is leaving for something more interesting and I'm inheriting the
maintainership of libata.  Thanks a lot for the good work and have
fun, Jeff!

v2: The original path forgot to update git tree URL.  Updated.
    Spotted by Sergei.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Merge branch 'for-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata

Pull libata maintainership change from Tejun Heo.

Tejun is taking over from Jeff, after many many years. Thanks Jeff.

* 'for-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
  libata: change maintainer
Merge tag 'hwspinlock-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/hwspinlock

Pullhwspinlock update from Ohad Ben-Cohen:
 "A single patch from Vincent extending OMAP's hwspinlock support to
  OMAP5"

* tag 'hwspinlock-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/hwspinlock:
  hwspinlock/omap: support OMAP5 as well
Merge tag 'rpmsg-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/rpmsg

Pull rpmsg changes from Ohad Ben-Cohen:
 "A small pull request consisting of:

   - Make rpmsg process all pending messages instead of just one, from
     Robert Tivy

   - Fix Kconfig dependency on VIRTUALIZATION, from Suman.

     Note: this was submitted late during the 3.9 rc cycle and it seemed
     appropriate to wait with it for the merge window.

   - Belated addition of an rpmsg entry to the MAINTAINERS file.  People
     seem to look for this"

* tag 'rpmsg-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/rpmsg:
  rpmsg: fix kconfig dependencies for VIRTIO
  MAINTAINERS: add rpmsg entry
  rpmsg: process _all_ pending messages in rpmsg_recv_done