bcb: disable bcb write cmd by default [1/1]

PD#SWPL-148949

Problem:
change bcb by uboot cmd is unsafe

Solution:
disable bcb write cmd by default

Verify:
local

Change-Id: Iee8cbf863d20b4695d466337761eddce7518d2e5
Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
diff --git a/cmd/amlogic/Kconfig b/cmd/amlogic/Kconfig
index 8a5ee76..64120fa 100644
--- a/cmd/amlogic/Kconfig
+++ b/cmd/amlogic/Kconfig
@@ -52,6 +52,13 @@
 	help
 	  used for recovery and the bootloader to talk to each other
 
+config CMD_BCB
+	bool "bcd cmd"
+	depends on !AML_PRODUCT_MODE
+	help
+	  Say Y here if you want to change bcb cmds
+	  by serial cmds.
+
 config CMD_BOOTCTOL_AVB
 	bool "avb cmd"
 	default n
diff --git a/cmd/amlogic/cmd_bcb.c b/cmd/amlogic/cmd_bcb.c
index 69274cd..2d21427 100644
--- a/cmd/amlogic/cmd_bcb.c
+++ b/cmd/amlogic/cmd_bcb.c
@@ -48,6 +48,7 @@
     char reserved[192];
 };
 
+#if (IS_ENABLED(CONFIG_CMD_BCB))
 static bool env_command_check(const char *cmd)
 {
     int index = 0;
@@ -97,6 +98,7 @@
     strcopy = NULL;
     return true;
 }
+#endif
 
 static int clear_misc_partition(char *clearbuf, int size)
 {
@@ -278,6 +280,7 @@
         return 0;
     }
 
+#if (IS_ENABLED(CONFIG_CMD_BCB))
     //uboot-command only valid once, not matter success or not
     if (clear_misc_partition(clearbuf, sizeof(clearbuf)) < 0) {
 	printf("clear misc partition failed.\n");
@@ -308,6 +311,7 @@
         printf("command mark(%s) not match %s,don't execute.\n",
             command_mark, command);
     }
+#endif
 
     return 0;