]> Zhao Yanbai Git Server - minix.git/commitdiff
kernel:export board to userland. 82/1182/4
authorKees Jongenburger <kees.jongenburger@gmail.com>
Fri, 29 Nov 2013 13:31:31 +0000 (14:31 +0100)
committerKees Jongenburger <kees.jongenburger@gmail.com>
Tue, 3 Dec 2013 08:19:50 +0000 (09:19 +0100)
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

kernel/arch/earm/pre_init.c
kernel/arch/i386/pre_init.c

index 5c39ad05ab31b77516f9bf8d8de4c1dea2a84351..7360bd6610b2f3956013e5e94c09a76913a578db 100644 (file)
@@ -7,6 +7,7 @@
 #include <minix/minlib.h>
 #include <minix/const.h>
 #include <minix/type.h>
+#include <minix/board.h>
 #include <minix/com.h>
 #include <sys/types.h>
 #include <sys/param.h>
@@ -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
index d63575e480f7612a1380bf887d126a3e9058e45f..d6ad07f97261cf6c93a745fffc38d6e0aa038892 100644 (file)
@@ -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