common: socinfo: Fix nomenclature on Silicon Revisions
[k3conf/k3conf.git] / common / socinfo.c
index a7bd37945269a9f9969d4f7b96f601d1ca340ed3..f975bc529d47b21b163eff98c05ab394bce601c3 100644 (file)
 #include <string.h>
 #include <sec_proxy.h>
 #include <soc/am65x/am65x_host_info.h>
+#include <soc/am65x/am65x_sec_proxy_info.h>
+#include <soc/am65x/am65x_processors_info.h>
+#include <soc/am65x/am65x_devices_info.h>
+#include <soc/am65x/am65x_clocks_info.h>
+#include <soc/j721e/j721e_host_info.h>
+#include <soc/j721e/j721e_sec_proxy_info.h>
+#include <soc/j721e/j721e_processors_info.h>
+#include <soc/j721e/j721e_devices_info.h>
+#include <soc/j721e/j721e_clocks_info.h>
 
 /* Assuming these addresses and definitions stay common across K3 devices */
 #define CTRLMMR_WKUP_JTAG_DEVICE_ID    0x43000018
@@ -83,9 +92,37 @@ static void am654_init(void)
 
        sci_info->host_info = am65x_host_info;
        sci_info->num_hosts = AM65X_MAX_HOST_IDS;
+       sci_info->sp_info[MAIN_SEC_PROXY] = am65x_main_sp_info;
+       sci_info->num_sp_threads[MAIN_SEC_PROXY] = AM65X_MAIN_SEC_PROXY_THREADS;
+       sci_info->sp_info[MCU_SEC_PROXY] = am65x_mcu_sp_info;
+       sci_info->num_sp_threads[MCU_SEC_PROXY] = AM65X_MCU_SEC_PROXY_THREADS;
+       sci_info->processors_info = am65x_processors_info;
+       sci_info->num_processors = AM65X_MAX_PROCESSORS_IDS;
+       sci_info->devices_info = am65x_devices_info;
+       sci_info->num_devices = AM65X_MAX_DEVICES;
+       sci_info->clocks_info = am65x_clocks_info;
+       sci_info->num_clocks = AM65X_MAX_CLOCKS;
 }
 
-int soc_init(void)
+static void j721e_init(void)
+{
+       struct ti_sci_info *sci_info = &soc_info.sci_info;
+
+       sci_info->host_info = j721e_host_info;
+       sci_info->num_hosts = J721E_MAX_HOST_IDS;
+       sci_info->sp_info[MAIN_SEC_PROXY] = j721e_main_sp_info;
+       sci_info->num_sp_threads[MAIN_SEC_PROXY] = J721E_MAIN_SEC_PROXY_THREADS;
+       sci_info->sp_info[MCU_SEC_PROXY] = j721e_mcu_sp_info;
+       sci_info->num_sp_threads[MCU_SEC_PROXY] = J721E_MCU_SEC_PROXY_THREADS;
+       sci_info->processors_info = j721e_processors_info;
+       sci_info->num_processors = J721E_MAX_PROCESSORS_IDS;
+       sci_info->devices_info = j721e_devices_info;
+       sci_info->num_devices = J721E_MAX_DEVICES;
+       sci_info->clocks_info = j721e_clocks_info;
+       sci_info->num_clocks = J721E_MAX_CLOCKS;
+}
+
+int soc_init(uint32_t host_id)
 {
        memset(&soc_info, 0, sizeof(soc_info));
 
@@ -106,13 +143,15 @@ int soc_init(void)
 
        strncpy(soc_info.soc_full_name, "", sizeof(soc_info.soc_full_name));
        strcat(soc_info.soc_full_name, soc_name[soc_info.soc]);
-       strcat(soc_info.soc_full_name, " PG");
+       strcat(soc_info.soc_full_name, " SR");
        strcat(soc_info.soc_full_name, soc_revision[soc_info.rev]);
 
-       soc_info.host_id = DEFAULT_HOST_ID;
+       soc_info.host_id = host_id;
 
        if (soc_info.soc == AM654)
                am654_init();
+       else if (soc_info.soc == J721E)
+               j721e_init();
 
        /* ToDo: Add error if sec_proxy_init/sci_init is failed */
        if(!k3_sec_proxy_init())