Skip to content

Commit dcfce96

Browse files
committed
accel/habanalabs: align to latest firmware specs
Update the firmware common interface files with the latest version. Signed-off-by: Oded Gabbay <[email protected]> Reviewed-by: Ofir Bitton <[email protected]>
1 parent 314a7ff commit dcfce96

File tree

2 files changed

+16
-43
lines changed

2 files changed

+16
-43
lines changed

drivers/accel/habanalabs/include/common/cpucp_if.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ struct hl_eq_entry {
359359
union {
360360
__le64 data_placeholder;
361361
struct hl_eq_ecc_data ecc_data;
362-
struct hl_eq_hbm_ecc_data hbm_ecc_data; /* Gaudi1 HBM */
362+
struct hl_eq_hbm_ecc_data hbm_ecc_data; /* Obsolete */
363363
struct hl_eq_sm_sei_data sm_sei_data;
364364
struct cpucp_pkt_sync_err pkt_sync_err;
365365
struct hl_eq_fw_alive fw_alive;
@@ -653,7 +653,7 @@ enum pq_init_status {
653653
* which address is passed via the CpuCp packet. In addition, the host's driver
654654
* passes the max size it allows the CpuCP to write to the structure, to prevent
655655
* data corruption in case of mismatched driver/FW versions.
656-
* Relevant only to Gaudi.
656+
* Obsolete.
657657
*
658658
* CPUCP_PACKET_GENERIC_PASSTHROUGH -
659659
* Generic opcode for all firmware info that is only passed to host
@@ -868,19 +868,19 @@ struct cpucp_array_data_packet {
868868
enum cpucp_led_index {
869869
CPUCP_LED0_INDEX = 0,
870870
CPUCP_LED1_INDEX,
871-
CPUCP_LED2_INDEX
871+
CPUCP_LED2_INDEX,
872+
CPUCP_LED_MAX_INDEX = CPUCP_LED2_INDEX
872873
};
873874

874875
/*
875876
* enum cpucp_packet_rc - Error return code
876877
* @cpucp_packet_success -> in case of success.
877-
* @cpucp_packet_invalid -> this is to support Goya and Gaudi platform.
878+
* @cpucp_packet_invalid -> this is to support first generation platforms.
878879
* @cpucp_packet_fault -> in case of processing error like failing to
879880
* get device binding or semaphore etc.
880-
* @cpucp_packet_invalid_pkt -> when cpucp packet is un-supported. This is
881-
* supported Greco onwards.
881+
* @cpucp_packet_invalid_pkt -> when cpucp packet is un-supported.
882882
* @cpucp_packet_invalid_params -> when checking parameter like length of buffer
883-
* or attribute value etc. Supported Greco onwards.
883+
* or attribute value etc.
884884
* @cpucp_packet_rc_max -> It indicates size of enum so should be at last.
885885
*/
886886
enum cpucp_packet_rc {
@@ -1365,7 +1365,7 @@ struct cpucp_dev_info_signed {
13651365
#define DCORE_MON_REGS_SZ 512
13661366
/*
13671367
* struct dcore_monitor_regs_data - DCORE monitor regs data.
1368-
* the structure follows sync manager block layout. relevant only to Gaudi.
1368+
* the structure follows sync manager block layout. Obsolete.
13691369
* @mon_pay_addrl: array of payload address low bits.
13701370
* @mon_pay_addrh: array of payload address high bits.
13711371
* @mon_pay_data: array of payload data.
@@ -1380,7 +1380,7 @@ struct dcore_monitor_regs_data {
13801380
__le32 mon_status[DCORE_MON_REGS_SZ];
13811381
};
13821382

1383-
/* contains SM data for each SYNC_MNGR (relevant only to Gaudi) */
1383+
/* contains SM data for each SYNC_MNGR (Obsolete) */
13841384
struct cpucp_monitor_dump {
13851385
struct dcore_monitor_regs_data sync_mngr_w_s;
13861386
struct dcore_monitor_regs_data sync_mngr_e_s;

drivers/accel/habanalabs/include/common/hl_boot_if.h

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ enum cpu_boot_err {
3535
CPU_BOOT_ERR_TPM_FAIL = 20,
3636
CPU_BOOT_ERR_TMP_THRESH_INIT_FAIL = 21,
3737
CPU_BOOT_ERR_EEPROM_FAIL = 22,
38+
CPU_BOOT_ERR_ENG_ARC_MEM_SCRUB_FAIL = 23,
3839
CPU_BOOT_ERR_ENABLED = 31,
3940
CPU_BOOT_ERR_SCND_EN = 63,
4041
CPU_BOOT_ERR_LAST = 64 /* we have 2 registers of 32 bits */
@@ -51,6 +52,7 @@ enum cpu_boot_err {
5152
(1 << CPU_BOOT_ERR_DEVICE_UNUSABLE_FAIL) | \
5253
(1 << CPU_BOOT_ERR_BINNING_FAIL) | \
5354
(1 << CPU_BOOT_ERR_DRAM_SKIPPED) | \
55+
(1 << CPU_BOOT_ERR_ENG_ARC_MEM_SCRUB_FAIL) | \
5456
(1 << CPU_BOOT_ERR_EEPROM_FAIL))
5557

5658
/*
@@ -132,6 +134,9 @@ enum cpu_boot_err {
132134
* CPU_BOOT_ERR_EEPROM_FAIL Failed reading EEPROM data. Defaults
133135
* are used.
134136
*
137+
* CPU_BOOT_ERR_ENG_ARC_MEM_SCRUB_FAIL Failed scrubbing the Engines/ARCFarm
138+
* memories. Boot disabled until reset.
139+
*
135140
* CPU_BOOT_ERR0_ENABLED Error registers enabled.
136141
* This is a main indication that the
137142
* running FW populates the error
@@ -157,6 +162,7 @@ enum cpu_boot_err {
157162
#define CPU_BOOT_ERR0_TPM_FAIL (1 << CPU_BOOT_ERR_TPM_FAIL)
158163
#define CPU_BOOT_ERR0_TMP_THRESH_INIT_FAIL (1 << CPU_BOOT_ERR_TMP_THRESH_INIT_FAIL)
159164
#define CPU_BOOT_ERR0_EEPROM_FAIL (1 << CPU_BOOT_ERR_EEPROM_FAIL)
165+
#define CPU_BOOT_ERR0_ENG_ARC_MEM_SCRUB_FAIL (1 << CPU_BOOT_ERR_ENG_ARC_MEM_SCRUB_FAIL)
160166
#define CPU_BOOT_ERR0_ENABLED (1 << CPU_BOOT_ERR_ENABLED)
161167
#define CPU_BOOT_ERR1_ENABLED (1 << CPU_BOOT_ERR_ENABLED)
162168

@@ -744,36 +750,6 @@ struct comms_status {
744750
};
745751
};
746752

747-
/**
748-
* HL_MODULES_MAX_NUM is determined by the size of modules_mask in struct
749-
* hl_component_versions
750-
*/
751-
enum hl_modules {
752-
HL_MODULES_BOOT_INFO = 0,
753-
HL_MODULES_EEPROM,
754-
HL_MODULES_FDT,
755-
HL_MODULES_I2C,
756-
HL_MODULES_LZ4,
757-
HL_MODULES_MBEDTLS,
758-
HL_MODULES_MAX_NUM = 16
759-
};
760-
761-
/**
762-
* HL_COMPONENTS_MAX_NUM is determined by the size of components_mask in
763-
* struct cpucp_versions
764-
*/
765-
enum hl_components {
766-
HL_COMPONENTS_PID = 0,
767-
HL_COMPONENTS_MGMT,
768-
HL_COMPONENTS_PREBOOT,
769-
HL_COMPONENTS_PPBOOT,
770-
HL_COMPONENTS_ARMCP,
771-
HL_COMPONENTS_CPLD,
772-
HL_COMPONENTS_UBOOT,
773-
HL_COMPONENTS_FUSE,
774-
HL_COMPONENTS_MAX_NUM = 16
775-
};
776-
777753
#define NAME_MAX_LEN 32 /* bytes */
778754
struct hl_module_data {
779755
__u8 name[NAME_MAX_LEN];
@@ -787,8 +763,6 @@ struct hl_module_data {
787763
* @component: version of the component itself.
788764
* @fw_os: Firmware OS Version.
789765
* @comp_name: Name of the component.
790-
* @modules_mask: i'th bit (from LSB) is a flag - on if module i in enum
791-
* hl_modules is used.
792766
* @modules_counter: number of set bits in modules_mask.
793767
* @reserved: reserved for future use.
794768
* @modules: versions of the component's modules. Elborated explanation in
@@ -800,9 +774,8 @@ struct hl_component_versions {
800774
__u8 component[VERSION_MAX_LEN];
801775
__u8 fw_os[VERSION_MAX_LEN];
802776
__u8 comp_name[NAME_MAX_LEN];
803-
__le16 modules_mask;
804777
__u8 modules_counter;
805-
__u8 reserved[1];
778+
__u8 reserved[3];
806779
struct hl_module_data modules[];
807780
};
808781

0 commit comments

Comments
 (0)