Hi
We are using imx8mp with android-13.0.0_1.2.0.
We wish to disable serial console and use that uart for communicating to external board.
In Uboot ,We tried console = null in boot args /include/configs/imx8mp-evk.h
In Device , BoardConfig.mk console = null
it didnt work.
please share steps to disable serial console in Android BSP
#define CONFIG_SILENT_CONSOLE
#define CONFIG_SYS_DEVICE_NULLDEV
#define CONFIG_SILENT_U_BOOT_ONLY
=> setenv bootargs 'console=null'
&uart2 {
status = "disabled";
};
BOARD_KERNEL_CMDLINE := ...
BOARD_KERNEL_CMDLINE := androidboot.console=null
#service console /system/bin/sh
# class core
# console
# disabled
# user shell
# group shell
Hi,
You need to apply below changes to silent the console:
In {ANDROID_PROJECT}/vendor/nxp-opensource/uboot-imx:
diff --git a/arch/arm/dts/imx8mp-evk.dts b/arch/arm/dts/imx8mp-evk.dts
index c3228b8ccb9..ee1a03b8a33 100644
--- a/arch/arm/dts/imx8mp-evk.dts
+++ b/arch/arm/dts/imx8mp-evk.dts
@@ -13,7 +13,7 @@
compatible = "fsl,imx8mp-evk", "fsl,imx8mp";
chosen {
- bootargs = "console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200";
+ bootargs = "console=ttynull";
stdout-path = &uart2;
};
diff --git a/configs/imx8mp_evk_android_trusty_dual_defconfig b/configs/imx8mp_evk_android_trusty_dual_defconfig
index 33553ca143e..c2f333091b6 100644
--- a/configs/imx8mp_evk_android_trusty_dual_defconfig
+++ b/configs/imx8mp_evk_android_trusty_dual_defconfig
@@ -19,7 +19,7 @@ CONFIG_DM_GPIO=y
CONFIG_SPL_TEXT_BASE=0x920000
CONFIG_USB_TCPC=y
CONFIG_TARGET_IMX8MP_EVK=y
-CONFIG_SPL_SERIAL=y
+CONFIG_SPL_SERIAL=n
CONFIG_SPL_DRIVERS_MISC=y
CONFIG_SPL=y
CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x48000000
@@ -194,3 +194,7 @@ CONFIG_ATTESTATION_ID_DEVICE="evk_8mp"
CONFIG_ATTESTATION_ID_PRODUCT="evk_8mp"
CONFIG_ATTESTATION_ID_MANUFACTURER="nxp"
CONFIG_ATTESTATION_ID_MODEL="EVK_8MP"
+CONFIG_SILENT_CONSOLE=y
+CONFIG_SYS_DEVICE_NULLDEV=y
+CONFIG_SILENT_CONSOLE_UNTIL_ENV=y
+CONFIG_SILENT_U_BOOT_ONLY=y
diff --git a/include/configs/imx8mp_evk_android.h b/include/configs/imx8mp_evk_android.h
index 09e3841908b..823d40a292a 100644
--- a/include/configs/imx8mp_evk_android.h
+++ b/include/configs/imx8mp_evk_android.h
@@ -17,6 +17,7 @@
"splashimage=0x50000000\0" \
"fdt_high=0xffffffffffffffff\0" \
"initrd_high=0xffffffffffffffff\0" \
+ "silent=1\0" \
/* Enable mcu firmware flash */
#ifdef CONFIG_FLASH_MCUFIRMWARE_SUPPORT
In {ANDROID_PROJECT}/device/nxp:
diff --git a/imx8m/evk_8mp/BoardConfig.mk b/imx8m/evk_8mp/BoardConfig.mk
index c1e9314d..3f916ddf 100644
--- a/imx8m/evk_8mp/BoardConfig.mk
+++ b/imx8m/evk_8mp/BoardConfig.mk
@@ -132,7 +132,7 @@ BOARD_KERNEL_BASE := 0x40400000
CMASIZE=1184M
# NXP default config
BOARD_KERNEL_CMDLINE := init=/init firmware_class.path=/vendor/firmware loop.max_part=7 bootconfig
-BOARD_BOOTCONFIG += androidboot.console=ttymxc1 androidboot.hardware=nxp
+BOARD_BOOTCONFIG += androidboot.hardware=nxp
# memory config
BOARD_KERNEL_CMDLINE += transparent_hugepage=never
In {ANDROID_PROJECT}/vendor/nxp-opensource/arm-trusted-firmware:
diff --git a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
index 348f90045..bb174ca49 100644
--- a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
+++ b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
@@ -208,7 +208,6 @@ static void bl31_tzc380_setup(void)
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
u_register_t arg2, u_register_t arg3)
{
- static console_t console;
unsigned int val;
unsigned int i;
@@ -230,10 +229,10 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
imx8m_caam_init();
- console_imx_uart_register(IMX_BOOT_UART_BASE, IMX_BOOT_UART_CLK_IN_HZ,
- IMX_CONSOLE_BAUDRATE, &console);
+// console_imx_uart_register(IMX_BOOT_UART_BASE, IMX_BOOT_UART_CLK_IN_HZ,
+// IMX_CONSOLE_BAUDRATE, &console);
/* This console is only used for boot stage */
- console_set_scope(&console, CONSOLE_FLAG_BOOT);
+// console_set_scope(&console, CONSOLE_FLAG_BOOT);
/*
* tell BL3-1 where the non-secure software image is located
If you are using Trusty OS then you should also silent the uart in trusty os. In {TRUSTY_OS_PROJECT}/trusty/hardware/nxp:
diff --git a/platform/imx/debug.c b/platform/imx/debug.c
index 5670125..dfa8101 100644
--- a/platform/imx/debug.c
+++ b/platform/imx/debug.c
@@ -32,7 +32,7 @@
#define SMC_SC_SHARED_CONSOLE_CTL SMC_STDCALL_NR(SMC_ENTITY_CONSOLE, 0)
#define TRUSTY_CONSOLE_DISABLE 0
#define TRUSTY_CONSOLE_ENABLE 1
-bool no_console = false;
+bool no_console = true;
static long console_stdcall(struct smc32_args* args) {
if (args->smc_nr == SMC_SC_SHARED_CONSOLE_CTL) {
@@ -50,7 +50,7 @@ static struct smc32_entity console_entity = {
};
void console_smcall_init(uint level) {
- no_console = false;
+ no_console = true;
sm_register_entity(SMC_ENTITY_CONSOLE, &console_entity);
}
void platform_dputc(char c) {
Hi,
Thanks for the changes Kernel logs stopped.
Still getting Uboot-logs
we tried to disable uboot-logs by changing the Board.h : /include/configs/imx8mp_evk.h
+#define CONFIG_DISABLE_CONSOLE
+#define CONFIG_SILENT_CONSOLE
+#define CONFIG_SYS_DEVICE_NULLDEV
Hi,
Could you confirm you have applied the u-boot changes to the right *-defconfig? imx8mp has multiple *defconfig for android, in the example I applied the changes to "imx8mp_evk_android_trusty_dual_defconfig" but yours could be different, make sure you have applied to the right config file.
Hi,
As far as I can see, you are missing below two configs:
+CONFIG_SILENT_CONSOLE_UNTIL_ENV=y
+CONFIG_SILENT_U_BOOT_ONLY=y
Please make sure you have applied all the changes in the diff file and better double confirm they are functioning by compiling standalone u-boot config and check they are desired in the generated ".config".
And in the "uboot.patch", I can see you have changes in the "configs/imx8mp_evk_android_trusty_dual_defconfig". But from the boot logs, this should not be the defconfig you are using. Please make sure these changes have been made to the right config file (imx8mp_evk_android_defconfig?).
setenv bootargs 'console=tty0 androidboot.console=tty0'
saveenv
&uart2 {
status = "okay";
// your custom config
};
BOARD_KERNEL_CMDLINE := console=tty0 androidboot.console=tty0