]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ls1012a: net: pfe: remove pfe stop from bootcmd
authorMian Yousaf Kaukab <ykaukab@suse.de>
Wed, 14 Apr 2021 10:33:58 +0000 (12:33 +0200)
committerPriyanka Jain <priyanka.jain@nxp.com>
Wed, 16 Jun 2021 12:44:08 +0000 (18:14 +0530)
When using bootefi to boot a EFI binary, u-boot is supposed to
provide networking service for EFI application. Currently, 'pfe stop'
command is called from bootcmd before running bootefi. As a result
network stops working for EFI applications and console is flooded with
"Rx pkt not on expected port" messages.

Implement board_quiesce_devices() for ls1012a boards and call
pfe_command_stop() from it instead of calling 'pfe stop' from
*_bootcmd and bootcmd.

Tested-by: Anji Jagarlmudi <anji.jagarlmudi@nxp.com>
Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[Fixed checkpatch space error]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
board/freescale/ls1012afrdm/ls1012afrdm.c
board/freescale/ls1012aqds/ls1012aqds.c
board/freescale/ls1012ardb/ls1012ardb.c
drivers/net/pfe_eth/pfe_cmd.c
include/configs/ls1012a2g5rdb.h
include/configs/ls1012a_common.h
include/configs/ls1012afrdm.h
include/configs/ls1012afrwy.h
include/configs/ls1012aqds.h
include/configs/ls1012ardb.h
include/net/pfe_eth/pfe/pfe_hw.h

index 2cd651b943fbf5876209cf3d38fafbb06bc88180..6473ee05728487f462451694c14f945f783b6de6 100644 (file)
@@ -23,6 +23,7 @@
 #include <fsl_mmdc.h>
 #include <netdev.h>
 #include <fsl_sec.h>
+#include <net/pfe_eth/pfe/pfe_hw.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -185,6 +186,13 @@ int board_init(void)
        return 0;
 }
 
+#ifdef CONFIG_FSL_PFE
+void board_quiesce_devices(void)
+{
+       pfe_command_stop(0, NULL);
+}
+#endif
+
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
        arch_fixup_fdt(blob);
index cfe3f3360cd9414146ec02f8ef6e2149b7562728..33a0910a198a5a9a86a103d23fd524912094ebe6 100644 (file)
@@ -32,6 +32,7 @@
 #include "../common/qixis.h"
 #include "ls1012aqds_qixis.h"
 #include "ls1012aqds_pfe.h"
+#include <net/pfe_eth/pfe/pfe_hw.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -163,6 +164,13 @@ int board_init(void)
        return 0;
 }
 
+#ifdef CONFIG_FSL_PFE
+void board_quiesce_devices(void)
+{
+       pfe_command_stop(0, NULL);
+}
+#endif
+
 int esdhc_status_fixup(void *blob, const char *compat)
 {
        char esdhc0_path[] = "/soc/esdhc@1560000";
index 41bcf6f935e98050ffc222b2611c495eb61e8bdc..62e8af48cf14fc948d8a4171861a990c879fc777 100644 (file)
@@ -28,6 +28,7 @@
 #include <fsl_mmdc.h>
 #include <netdev.h>
 #include <fsl_sec.h>
+#include <net/pfe_eth/pfe/pfe_hw.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -186,6 +187,13 @@ int board_init(void)
        return 0;
 }
 
+#ifdef CONFIG_FSL_PFE
+void board_quiesce_devices(void)
+{
+       pfe_command_stop(0, NULL);
+}
+#endif
+
 #ifdef CONFIG_TARGET_LS1012ARDB
 int esdhc_status_fixup(void *blob, const char *compat)
 {
index 1e69525cb71f991f8f3206ccd1b33d5096f422ca..364750f65c75f184b33e81e641a84167ede61958 100644 (file)
@@ -418,7 +418,7 @@ static void send_dummy_pkt_to_hif(void)
        writel(buf, TMU_PHY_INQ_PKTINFO);
 }
 
-static void pfe_command_stop(int argc, char *const argv[])
+void pfe_command_stop(int argc, char *const argv[])
 {
        int pfe_pe_id, hif_stop_loop = 10;
        u32 rx_status;
index 9962b9872af545a4f94e2fa5d8794c8c6fdc2c5c..9fbeecf1e735ffe043095d62a40ec78e7c854204 100644 (file)
@@ -72,7 +72,7 @@
        "installer=load mmc 0:2 $load_addr "    \
                   "/flex_installer_arm64.itb; "        \
                   "bootm $load_addr#$board\0"  \
-       "qspi_bootcmd=pfe stop; echo Trying load from qspi..;"  \
+       "qspi_bootcmd=echo Trying load from qspi..;"    \
                "sf probe && sf read $load_addr "       \
                "$kernel_addr $kernel_size; env exists secureboot "     \
                "&& sf read $kernelheader_addr_r $kernelheader_addr "   \
 #undef CONFIG_BOOTCOMMAND
 #ifdef CONFIG_TFABOOT
 #undef QSPI_NOR_BOOTCOMMAND
-#define QSPI_NOR_BOOTCOMMAND "pfe stop;run distro_bootcmd; run qspi_bootcmd; " \
+#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \
                             "env exists secureboot && esbc_halt;"
 #else
 #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
-#define CONFIG_BOOTCOMMAND "pfe stop;run distro_bootcmd; run qspi_bootcmd; " \
+#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \
                           "env exists secureboot && esbc_halt;"
 #endif
 #endif
index a908b0acb098ddd30cea920e15008f3e29ae8b3d..6f55acc7db11f60c88c8eade19125d304767b7e9 100644 (file)
 
 #undef CONFIG_BOOTCOMMAND
 #ifdef CONFIG_TFABOOT
-#define QSPI_NOR_BOOTCOMMAND   "pfe stop; sf probe 0:0; sf read $kernel_load "\
+#define QSPI_NOR_BOOTCOMMAND   "sf probe 0:0; sf read $kernel_load "\
                                "$kernel_start $kernel_size && "\
                                "bootm $kernel_load"
 #else
-#define CONFIG_BOOTCOMMAND     "pfe stop; sf probe 0:0; sf read $kernel_load "\
+#define CONFIG_BOOTCOMMAND     "sf probe 0:0; sf read $kernel_load "\
                                "$kernel_start $kernel_size && "\
                                "bootm $kernel_load"
 #endif
index 02dd59892bcce6f286c91625cb323130316c1630..2711f651d7190be9ebda04758903741f5cd7a2fc 100644 (file)
        "installer=load usb 0:2 $load_addr "    \
                   "/flex_installer_arm64.itb; "        \
                   "bootm $load_addr#$board\0"  \
-       "qspi_bootcmd=pfe stop; echo Trying load from qspi..;"  \
+       "qspi_bootcmd=echo Trying load from qspi..;"    \
                "sf probe && sf read $load_addr "       \
                "$kernel_addr $kernel_size && bootm $load_addr#$board\0"
 
 #undef CONFIG_BOOTCOMMAND
 #ifdef CONFIG_TFABOOT
 #undef QSPI_NOR_BOOTCOMMAND
-#define QSPI_NOR_BOOTCOMMAND "pfe stop;run distro_bootcmd;run qspi_bootcmd"
+#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd;run qspi_bootcmd"
 #else
-#define CONFIG_BOOTCOMMAND "pfe stop;run distro_bootcmd;run qspi_bootcmd"
+#define CONFIG_BOOTCOMMAND "run distro_bootcmd;run qspi_bootcmd"
 #endif
 
 #endif /* __LS1012ARDB_H__ */
index ba152834d5ac02f8ea0c984d081be897b3d5d624..beb7440c2711df9f6c9c9d3677e87de7bad6c142 100644 (file)
@@ -89,7 +89,7 @@
                        "env exists secureboot "        \
                        "&& esbc_validate ${scripthdraddr};"    \
                "source ${scriptaddr}\0"          \
-       "sd_bootcmd=pfe stop; echo Trying load from sd card..;"         \
+       "sd_bootcmd=echo Trying load from sd card..;"           \
                "mmcinfo; mmc read $load_addr "                 \
                "$kernel_addr_sd $kernel_size_sd ;"             \
                "env exists secureboot && mmc read $kernelheader_addr_r "\
 #undef CONFIG_BOOTCOMMAND
 #ifdef CONFIG_TFABOOT
 #undef QSPI_NOR_BOOTCOMMAND
-#define QSPI_NOR_BOOTCOMMAND "pfe stop; run distro_bootcmd; run sd_bootcmd; "\
+#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd; run sd_bootcmd; "\
                             "env exists secureboot && esbc_halt;"
 #else
-#define CONFIG_BOOTCOMMAND "pfe stop; run distro_bootcmd; run sd_bootcmd; "\
+#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run sd_bootcmd; "\
                           "env exists secureboot && esbc_halt;"
 #endif
 
index 36be8f42c978b031bf743836e28fb2602fb033a7..bdcb8d6af6bf5ad0f3a705f7e86a59b9162f1b69 100644 (file)
                        "env exists secureboot "        \
                        "&& esbc_validate ${scripthdraddr};"    \
                "source ${scriptaddr}\0"          \
-       "qspi_bootcmd=pfe stop; echo Trying load from qspi..;"  \
+       "qspi_bootcmd=echo Trying load from qspi..;"    \
                "sf probe 0:0 && sf read $load_addr "   \
                "$kernel_addr $kernel_size; env exists secureboot "     \
                "&& sf read $kernelheader_addr_r $kernelheader_addr "   \
 #undef CONFIG_BOOTCOMMAND
 #ifdef CONFIG_TFABOOT
 #undef QSPI_NOR_BOOTCOMMAND
-#define QSPI_NOR_BOOTCOMMAND "pfe stop; run distro_bootcmd; run qspi_bootcmd; "\
+#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; "\
                             "env exists secureboot && esbc_halt;"
 #else
-#define CONFIG_BOOTCOMMAND "pfe stop; run distro_bootcmd; run qspi_bootcmd; "\
+#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; "\
                           "env exists secureboot && esbc_halt;"
 #endif
 
index 582945b2ab1988f054079d1dcfe30a6483c71919..efa0284a50a956a8ace127ff0b7e3ee75623d488 100644 (file)
@@ -91,7 +91,7 @@
        "installer=load mmc 0:2 $load_addr "    \
                   "/flex_installer_arm64.itb; "        \
                   "bootm $load_addr#$board\0"  \
-       "qspi_bootcmd=pfe stop; echo Trying load from qspi..;"  \
+       "qspi_bootcmd=echo Trying load from qspi..;"    \
                "sf probe && sf read $load_addr "       \
                "$kernel_addr $kernel_size; env exists secureboot "     \
                "&& sf read $kernelheader_addr_r $kernelheader_addr "   \
 #undef CONFIG_BOOTCOMMAND
 #ifdef CONFIG_TFABOOT
 #undef QSPI_NOR_BOOTCOMMAND
-#define QSPI_NOR_BOOTCOMMAND "pfe stop; run distro_bootcmd; run qspi_bootcmd; "\
+#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; "\
                             "env exists secureboot && esbc_halt;"
 #else
-#define CONFIG_BOOTCOMMAND "pfe stop; run distro_bootcmd; run qspi_bootcmd; "\
+#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; "\
                           "env exists secureboot && esbc_halt;"
 #endif
 
index c69fc69130cc44e7333d8e44ce4d7558edb2a6b3..71e4115afa0c18f29eeeddf4f9d70da8a3430c15 100644 (file)
@@ -160,4 +160,10 @@ void hif_rx_enable(void);
 void hif_rx_disable(void);
 void hif_rx_desc_disable(void);
 
+#ifdef PFE_RESET_WA
+void pfe_command_stop(int argc, char *const argv[]);
+#else
+static void pfe_command_stop(int argc, char *const argv[]) {}
+#endif
+
 #endif /* _PFE_H_ */