of: Fix endless loop in of_add_memory

of_add_memory is stuck in an endless loop when a memory bank with zero
size is passed. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
globalvar: add missing include

include/globalvar.h needs struct param_d, so include <param.h>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
of: base.c: Use correct device-tree in of_add_initrd()

Otherwise only the internal DT is modified, not necessarily the one passed
to the kernel.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>