From: Kees Jongenburger Date: Fri, 29 Nov 2013 13:31:31 +0000 (+0100) Subject: kernel:export board to userland. X-Git-Tag: v3.3.0~663 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/index.css?a=commitdiff_plain;h=refs%2Fchanges%2F82%2F1182%2F4;p=minix.git kernel:export board to userland. Export the board variable to userland using sysenv. This allows rc-scrips to perform device specific initialisation. The board variable follows the following pattern [ARCH]-[ARCHVARIANT]-[VENDOR]-[BOARD]-[BOARDVARIANT] We currently we support the following boards: X86-I586-GENERIC-GENERIC-GENERIC ARM-ARMV7-TI-BBXM-GENERIC ARM-ARMV7-TI-BB-WHITE ARM-ARMV7-TI-BB-BLACK Change-Id: I9e5f5f24f9a71cc9797cacb1aafb19499613f0be --- diff --git a/kernel/arch/earm/pre_init.c b/kernel/arch/earm/pre_init.c index 5c39ad05a..7360bd661 100644 --- a/kernel/arch/earm/pre_init.c +++ b/kernel/arch/earm/pre_init.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -195,6 +196,21 @@ void get_parameters(u32_t ebx, kinfo_t *cbi) /* let higher levels know what we are booting on */ mb_set_param(cbi->param_buf, ARCHVARNAME, "earm", cbi); +#ifdef AM335X + int id = get_board_id_by_short_name("A335BONE"); + printf("BOARD ID=0x%08x\n",id); + const char * boardname = get_board_name(id); + printf("BOARD NAME=%s\n",boardname); + mb_set_param(cbi->param_buf, BOARDVARNAME,(char *) boardname, cbi); +#endif +#ifdef DM337x + int id = get_board_id_by_short_name("BBXM"); + printf("BOARD ID=0x%08x\n",id); + const char * boardname = get_board_name(id); + printf("BOARD NAME=%s\n",boardname); + mb_set_param(cbi->param_buf, BOARDVARNAME,(char *) boardname, cbi); +#endif + /* round user stack down to leave a gap to catch kernel * stack overflow; and to distinguish kernel and user addresses diff --git a/kernel/arch/i386/pre_init.c b/kernel/arch/i386/pre_init.c index d63575e48..d6ad07f97 100644 --- a/kernel/arch/i386/pre_init.c +++ b/kernel/arch/i386/pre_init.c @@ -154,6 +154,7 @@ void get_parameters(u32_t ebx, kinfo_t *cbi) /* let higher levels know what we are booting on */ mb_set_param(cbi->param_buf, ARCHVARNAME, "i386", cbi); + mb_set_param(cbi->param_buf, BOARDVARNAME, "i586", cbi); /* round user stack down to leave a gap to catch kernel * stack overflow; and to distinguish kernel and user addresses