samsung: common: add get_plat_name()/get_board_model()
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Wed, 12 Nov 2014 13:49:35 +0000 (14:49 +0100)
committerPrzemyslaw Marczak <p.marczak@samsung.com>
Mon, 18 May 2015 09:54:53 +0000 (11:54 +0200)
This patch introduce some cleanup in set_board_info(),
related to the listed code changes:
Change 1:
The name of function get_board_type() was unclear,
so now it is changed to get_board_model().

Change 2:
The previous version of get_board_name() was returning
the platform name - now it returns full boardname.

Change 3:
Add new function get_plat_name() - returns platform name.
This is useful for platform common usage like environment
settings.

Change 4:
Update odroid.c by change get_board_type() to get_board_model().

Change 5:
samsung: misc: set env ${platname} in set_board_info()

Change-Id: Iba16e917f9c88458e1af21892d84ded121aa12cf
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
board/samsung/common/board.c
board/samsung/common/misc.c
board/samsung/odroid/odroid.c
include/samsung/misc.h

index d52a8af4fed86173fe2c01514919de1d2cb0ff0d..6d2115fd0880effae2413f2701530ca00704f3aa 100644 (file)
@@ -337,7 +337,7 @@ int checkboard(void)
        board_info = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
        printf("Board: %s\n", board_info ? board_info : "unknown");
 #ifdef CONFIG_BOARD_TYPES
-       board_info = get_board_type();
+       board_info = get_board_model();
 
        printf("Model: %s\n", board_info ? board_info : "unknown");
 #endif
index 2ba3d071ac1e46d3d568a836bc67233b4eb2343e..183789caaa98f56de9fb4e40b075cefca5a447f2 100644 (file)
@@ -77,19 +77,19 @@ void set_board_info(void)
        setenv("board_rev", info);
 #endif
 #ifdef CONFIG_OF_LIBFDT
-       const char *bdtype = "";
        const char *bdname = CONFIG_SYS_BOARD;
 
 #ifdef CONFIG_BOARD_TYPES
-       bdtype = get_board_type();
 #ifdef CONFIG_OF_MULTI
+       const char *platname = get_plat_name();
        bdname = get_board_name();
+
+       setenv("platname", platname);
 #endif
-       sprintf(info, "%s%s", bdname, bdtype);
-       setenv("boardname", info);
+       setenv("boardname", bdname);
 #endif
-       snprintf(info, ARRAY_SIZE(info),  "%s%x-%s%s.dtb",
-                CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype);
+       snprintf(info, ARRAY_SIZE(info),  "%s%x-%s.dtb",
+                CONFIG_SYS_SOC, s5p_cpu_id, bdname);
        setenv("fdtfile", info);
 #endif
 }
index ae41c29d9254d162a8ba702c0d4e968eb673a7ec..684fd7803b619965d53820a8c599c8604414e1a4 100644 (file)
@@ -53,11 +53,11 @@ void set_board_type(void)
                gd->board_type = ODROID_TYPE_U3;
 }
 
-const char *get_board_type(void)
+const char *get_board_model(void)
 {
-       const char *board_type[] = {"u3", "x2"};
+       const char *board_model[] = {"u3", "x2"};
 
-       return board_type[gd->board_type];
+       return board_model[gd->board_type];
 }
 #endif
 
index 693cb7c14e87e68649b2ff60dfebe3a698cc563c..574d30ec159d019c29f469299dddb9d57d5abf81 100644 (file)
@@ -65,8 +65,9 @@ char *get_dfu_alt_boot(char *interface, char *devstr);
 #endif
 #ifdef CONFIG_BOARD_TYPES
 void set_board_type(void);
-const char *get_board_type(void);
+const char *get_board_model(void);
 #ifdef CONFIG_OF_MULTI
+const char *get_plat_name(void);
 const char *get_board_name(void);
 #endif
 #endif