Build: Makefile and config.bld cleanup

Cleanup and refactor config.bld to better scale to multiple targets.

Signed-off-by: Chris Ring <cring@ti.com>
Merge pull request #5 from cringthis/build_cleanup

Build: Makefile and config.bld cleanup
Synchronize hard coded base addr to the new Linux 3.3 values:

    "On 3.3 the System RAM is truncated earlier than it was before,
    due to an increase in the vmalloc region to 240MB (from 120MB);
    see commit 0536bdf33faff4d940ac094c77998cfac368cfff "ARM: move
    iotable mappings within the vmalloc region".

    Adapt the rproc CMA region to accomodate that (otherwise some of the pages
    will elicit invalid pfn warnings when the cma regions are activated)."

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Revert "init: temporarily delay tasks init to avoid race"

This reverts commit 6d91e0256063d392ce566e617775da7a70766f58.

It's no longer needed in 3.3.

Either way, it's quite horrid, and it should be fixed otherwise.

Conflicts:

	src/ti/examples/srvmgr/ping_tasks.c
rsc_table: put the fixed-size array behind

The array approach was very limiting: all members had to have
the same size and members, and this didn't work quite well
since some members are very small, where others quite big.

Move to a type-value approach, where each resource entry has
its own dedicated structure.

In addition, create a simple header which contains the number
of entries and their offsets within the table: this helps parsing code
to do fast browsing through the table.

And - add a version field so hosts can verify we have the image
format they expect.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
quick example of CIO filesystem skeleton
rsc_table: add a vdev console resource entry

Add a new resource entry that describes a console vdev.

This creates two dedicated vrings that will be used by the Linux
virtio_console driver.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
VirtQueue: extend vq API

1. Add a vqid parameter to VirtQueue_create to make the index of the vq
   explicit and not depending on the invocation order

2. Add a len param to VirtQueue_addUsedBuf so users can control it

3. Add a *len param to VirtQueue_getAvailBuf so users are notified with
   amount of received data

4. Adapt MessageQCopy to start using the new API

While we're at it, remove the VRING_USED_F_NO_NOTIFY optimization from
VirtQueue.

It isn't implemented correctly, and it causes much grief in debugging
with little, if any, benefit. It can be added later if really needed.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
rpmsgcio: hook up RpmsgCio to the virtio console device

This way sys/bios stdin/stdout will be routed to the Linux virtio
console.

This is just a preliminary implementation, mainly for demonstration
sake. known bugs that have to be fixed: vrings protection against
concurrent access, fix delicate races that might exist in the code, ..

IOW - this is not a product quality. just a prototype.

While at it, add a 'dump' command which Linux can send, which triggers
a dumping of accumulated early logs.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
apps: add some stdout prints

Until we route the Log_printf output to stdout, just temporarily add
some explicit stdout printouts (by means of printf) to make the virtio
console more interesting.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
rsc_table: add reserved members

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
main: delay sys/bios boot

A hacky workaround that still seem to be needed.

Can't use Task_sleep here. Chris says: "The BIOS scheduler isn't running
until you call BIOS_start() (which never returns).  That's why Task_sleep()
isn't working."

Should be reverted as soon as possible once a solid solution is in place.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
rsc_table: add notifyid fields to the virtio resource entries

Linux needs a way to notify SYS/BIOS if a vring has pending messages, or if the status of a certain vdev changes.

This is done by sending the notifyid of that specific vring/vdev over the mailbox payload.

This patch adds a notifyid member to the relevant resource entries, which will be used to synchronize the notify index of that specific object.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>