Huge Makefile rework

This will allow to compartimentize more the source code makefiles, and ease the
library integrations.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Align malloc sizes to 32bits

If a size was passed that was not a multiple of 4, malloc was returning a
non-aligned memory address the next time it was called, resulting in a data
abort.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Add dumb free function

We don't really need to reclaim the memory for now, so just implement it, but
without doing anything.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Define additionnal integer types

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Add trivial memcpy, strcmp and strlen functions

Those will be needed when we will need to parse the FEX file

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Implement assert()

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Add the fex parsing library

Copied from sunxi-tools, and adapted to our environment

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Parse the FEX file at boot

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Ignore temp files

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Add a Makefile function to register the objects to build

This also fixes a bug that would make whenever we have nested makefile
includes only take the last makefile into account.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Update the CFLAGS

That allows both to gain access to the usual kernel's definitions, and to not
rely on anything but our own include files.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Implement additional string.h function

memchr, memcmp, memmove, memset and strchr are all needed by the libfdt.
Provide some dumb implementation.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Integrate libfdt

Taken for git://git.kernel.org/pub/scm/linux/kernel/git/jdl/dtc.git, version
1.4.0, with some minor adjustments to compile with babelfish.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>