artik: common: enable factory_info command
authorChanho Park <chanho61.park@samsung.com>
Tue, 1 Dec 2015 12:21:19 +0000 (21:21 +0900)
committerChanho Park <chanho61.park@samsung.com>
Wed, 2 Dec 2015 02:39:17 +0000 (11:39 +0900)
This patch enables the factory_info command which is to
retrieve some factory information such as board S/N.
The default location to store the data is early offset of eMMC
because we don't use the location for any other purpose.

"run factory_load" command will load the information from eMMC
and configure them into environment variables.
"ethaddr" is ethernet mac address and it will be passed to kernel.
"bd_addr" is bluetooth address and it also be passed to kernel.

Change-Id: Ifa5660c3e765be84d00732593ca2005a5fc9f749
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
include/configs/artik_common.h

index ecf5d0a4b76146f2f02b4cb09b03b470a2612718..cf23916234d307291b2ddc16ef0996ed9a138498 100644 (file)
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_BOARD_LATE_INIT
 
+/* FACTORY_INFO */
+#define CONFIG_FACTORY_INFO
+#define CONFIG_FACTORY_INFO_BUF_ADDR           (0x48000000)
+
 /* FASTBOOT */
 #define CONFIG_FASTBOOT
 #define CFG_FASTBOOT_SDMMCBSP
        "partitions=" PARTS_DEFAULT                                     \
        "partitions_android=" PARTS_ANDROID                             \
        "partitions_tizen=" PARTS_TIZEN                                 \
+       "emmc_dev=0\0"                                                  \
        "rootdev=" __stringify(CONFIG_ROOT_DEV) "\0"                    \
        "rootpart=" __stringify(CONFIG_ROOT_PART) "\0"                  \
        "bootpart=" __stringify(CONFIG_BOOT_PART) "\0"                  \
        "initrd_file=uInitrd\0"                                         \
        "initrd_addr=43000000\0"                                        \
        "sdrecovery=sdfuse format; sdfuse flashall 3\0"                 \
+       "factory_load=factory_info load mmc ${emmc_dev} 0x80 0x8\0"     \
+       "factory_save=factory_info save mmc ${emmc_dev} 0x80 0x8\0"     \
        "boot_cmd=fatload mmc 0:1 $kernel_addr $kernel_file;"           \
                "fatload mmc 0:1 $fdtaddr $fdtfile;"                    \
                "bootz $kernel_addr - $fdtaddr\0"                       \
                "mmc rescan; fastboot\0"                                \
        "recoveryboot=run sdrecovery; setenv recoverymode recovery;"    \
                "run ramfsboot\0"                                       \
-       "ramfsboot=setenv bootargs ${console} "                         \
+       "ramfsboot=run factory_load; setenv bootargs ${console} "       \
                "root=/dev/mmcblk${rootdev}p${rootpart} ${root_rw} "    \
-               "rootfstype=ext4 ${opts} ${recoverymode};"              \
+               "rootfstype=ext4 ${opts} ${recoverymode} "              \
+               "asix.macaddr=${ethaddr} bd_addr=${bd_addr};"           \
                "run boot_cmd_initrd\0"                                 \
        "mmcboot=setenv bootargs ${console} "                           \
                "root=/dev/mmcblk${rootdev}p${rootpart} ${root_rw} "    \