From mboxrd@z Thu Jan 1 00:00:00 1970 From: richard.gong at linux.intel.com Date: Thu, 24 Oct 2019 09:48:28 -0500 Subject: [U-Boot] [RESEND PATCHv1 3/5] arm: socfpga: stratix10: add environment variables for RSU support In-Reply-To: <1571928510-3184-1-git-send-email-richard.gong@linux.intel.com> References: <1571928510-3184-1-git-send-email-richard.gong@linux.intel.com> Message-ID: <1571928510-3184-4-git-send-email-richard.gong@linux.intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de From: Richard Gong Add two RSU environment variables: 1. rsu_log_level the variable is unsigned integer and its default value is RSU_DEBUG (7), which only show log with RSU_INFO,RSU_WARNING and RSU_ERR. To enable all logs (RSU_ERR, RSU_WARNING, RSU_INFO and RSU_DEBUG), you need set log level to 8 or above via “setenv rsu_log_level 8”. To disable all logs, you need set log level to 3 or below. 2. rsu_protected_slot by default there is no protected RSU slot, you need run "setenv rsu_protected_slot ” to set a slot protected, and “setenv rsu_protected_slot ” to unset a protected slot. Signed-off-by: Richard Gong --- arch/arm/mach-socfpga/misc_s10.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/mach-socfpga/misc_s10.c b/arch/arm/mach-socfpga/misc_s10.c index 0a5fab1..c9a6f00 100644 --- a/arch/arm/mach-socfpga/misc_s10.c +++ b/arch/arm/mach-socfpga/misc_s10.c @@ -21,6 +21,8 @@ #include +#define RSU_DEFAULT_LOG_LEVEL 7 + DECLARE_GLOBAL_DATA_PTR; static struct socfpga_system_manager *sysmgr_regs = @@ -136,10 +138,17 @@ int print_cpuinfo(void) int arch_misc_init(void) { char qspi_string[13]; + char level[4]; + + snprintf(level, sizeof(level), "%u", RSU_DEFAULT_LOG_LEVEL); sprintf(qspi_string, "<0x%08x>", cm_get_qspi_controller_clk_hz()); env_set("qspi_clock", qspi_string); + /* setup for RSU */ + env_set("rsu_protected_slot", ""); + env_set("rsu_log_level", level); + socfpga_set_phymode(); return 0; } -- 2.7.4