Skip to content

Commit

Permalink
drivers: media: pci: Update Hailo accelerator device driver to v4.20
Browse files Browse the repository at this point in the history
  • Loading branch information
naushir committed Jan 23, 2025
1 parent fed8a09 commit 3c880f4
Show file tree
Hide file tree
Showing 15 changed files with 997 additions and 249 deletions.
4 changes: 2 additions & 2 deletions drivers/media/pci/hailo/common/fw_validation.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ int FW_VALIDATION__validate_fw_header(uintptr_t firmware_base_address,
case HAILO_BOARD_TYPE_HAILO10H:
expected_firmware_magic = FIRMWARE_HEADER_MAGIC_HAILO15;
break;
case HAILO_BOARD_TYPE_PLUTO:
expected_firmware_magic = FIRMWARE_HEADER_MAGIC_PLUTO;
case HAILO_BOARD_TYPE_HAILO15L:

Check failure on line 44 in drivers/media/pci/hailo/common/fw_validation.c

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: please, no spaces at the start of a line
expected_firmware_magic = FIRMWARE_HEADER_MAGIC_HAILO15L;

Check failure on line 45 in drivers/media/pci/hailo/common/fw_validation.c

View workflow job for this annotation

GitHub Actions / checkpatch review

ERROR: code indent should use tabs where possible

Check failure on line 45 in drivers/media/pci/hailo/common/fw_validation.c

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: please, no spaces at the start of a line
break;
default:
err = -EINVAL;
Expand Down
14 changes: 4 additions & 10 deletions drivers/media/pci/hailo/common/fw_validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@
#include "hailo_ioctl_common.h"
#include <linux/types.h>

#define FIRMWARE_HEADER_MAGIC_HAILO8 (0x1DD89DE0)
#define FIRMWARE_HEADER_MAGIC_HAILO15 (0xE905DAAB)
#define FIRMWARE_HEADER_MAGIC_PLUTO (0xF94739AB)

#ifndef HAILO_EMULATOR
#define FIRMWARE_WAIT_TIMEOUT_MS (5000)
#else /* ifndef HAILO_EMULATOR */
#define FIRMWARE_WAIT_TIMEOUT_MS (500000)
#endif /* ifndef HAILO_EMULATOR */
#define FIRMWARE_HEADER_MAGIC_HAILO8 (0x1DD89DE0)
#define FIRMWARE_HEADER_MAGIC_HAILO15 (0xE905DAAB)
#define FIRMWARE_HEADER_MAGIC_HAILO15L (0xF94739AB)

typedef enum {
FIRMWARE_HEADER_VERSION_INITIAL = 0,
Expand Down Expand Up @@ -61,4 +55,4 @@ int FW_VALIDATION__validate_fw_header(uintptr_t firmware_base_address,
int FW_VALIDATION__validate_cert_header(uintptr_t firmware_base_address,
size_t firmware_size, u32 *outer_consumed_firmware_offset, secure_boot_certificate_header_t **out_firmware_cert);

#endif
#endif
10 changes: 7 additions & 3 deletions drivers/media/pci/hailo/common/hailo_ioctl_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define _HAILO_IOCTL_COMMON_H_

#define HAILO_DRV_VER_MAJOR 4
#define HAILO_DRV_VER_MINOR 19
#define HAILO_DRV_VER_MINOR 20
#define HAILO_DRV_VER_REVISION 0

#define _STRINGIFY_EXPANDED( x ) #x
Expand All @@ -22,6 +22,7 @@
#define MAX_VDMA_ENGINES (3)
#define SIZE_OF_VDMA_DESCRIPTOR (16)
#define VDMA_DEST_CHANNELS_START (16)
#define MAX_SG_DESCS_COUNT (64 * 1024u)

#define HAILO_VDMA_MAX_ONGOING_TRANSFERS (128)
#define HAILO_VDMA_MAX_ONGOING_TRANSFERS_MASK (HAILO_VDMA_MAX_ONGOING_TRANSFERS - 1)
Expand All @@ -38,6 +39,10 @@
#define FW_ACCESS_APP_CPU_CONTROL_MASK (1 << FW_ACCESS_CONTROL_INTERRUPT_SHIFT)
#define FW_ACCESS_DRIVER_SHUTDOWN_SHIFT (2)
#define FW_ACCESS_DRIVER_SHUTDOWN_MASK (1 << FW_ACCESS_DRIVER_SHUTDOWN_SHIFT)
// HRT-15790 TODO: separate nnc interrupts and soc interrupts
#define FW_ACCESS_SOFT_RESET_SHIFT (3)
#define FW_ACCESS_SOFT_RESET_MASK (1 << FW_ACCESS_SOFT_RESET_SHIFT)

#define FW_ACCESS_SOC_CONTROL_SHIFT (3)
#define FW_ACCESS_SOC_CONTROL_MASK (1 << FW_ACCESS_SOC_CONTROL_SHIFT)

Expand Down Expand Up @@ -184,7 +189,6 @@ enum hailo_dma_data_direction {
};

// Enum that states what type of buffer we are working with in the driver
// TODO: HRT-13580 - Add specific type for user allocated and for driver allocated
enum hailo_dma_buffer_type {
HAILO_DMA_USER_PTR_BUFFER = 0,
HAILO_DMA_DMABUF_BUFFER = 1,
Expand Down Expand Up @@ -399,7 +403,7 @@ struct hailo_d2h_notification {
enum hailo_board_type {
HAILO_BOARD_TYPE_HAILO8 = 0,
HAILO_BOARD_TYPE_HAILO15,
HAILO_BOARD_TYPE_PLUTO,
HAILO_BOARD_TYPE_HAILO15L,

Check failure on line 406 in drivers/media/pci/hailo/common/hailo_ioctl_common.h

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: please, no spaces at the start of a line
HAILO_BOARD_TYPE_HAILO10H,
HAILO_BOARD_TYPE_HAILO10H_LEGACY,
HAILO_BOARD_TYPE_COUNT,
Expand Down
Loading

0 comments on commit 3c880f4

Please sign in to comment.