From 46aa33b2ac22f2ea44a3cb766ba4f70cf39e04bf Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Sun, 9 Feb 2014 21:21:10 +0000 Subject: [PATCH] If someone tries to boot a generic ATMEL kernel that has no board_init() routine compiled in, print a friendly error message about it rather than mysteriously hanging while trying to init 4GB of nonexistant ram. --- sys/arm/at91/at91_machdep.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/arm/at91/at91_machdep.c b/sys/arm/at91/at91_machdep.c index a6600b01326..f9a85e29efb 100644 --- a/sys/arm/at91/at91_machdep.c +++ b/sys/arm/at91/at91_machdep.c @@ -590,6 +590,11 @@ initarm(struct arm_boot_params *abp) printf("Warning: No soc support for %s found.\n", soc_info.name); memsize = board_init(); + if (memsize == -1) { + printf("board_init() failed, cannot determine ram size; " + "assuming 16MB\n"); + memsize = 16 * 1024 * 1024; + } /* * Pages were allocated during the secondary bootstrap for the