2021-02-24 11:08:03 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "efifeatures.h"
|
2021-03-07 16:25:34 -08:00
|
|
|
#include "thread_priority.h"
|
2021-02-24 11:08:03 -08:00
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Conditional EFI feature settings */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
// If EFI_CAN_SUPPORT, enable CAN driver
|
|
|
|
#define HAL_USE_CAN EFI_CAN_SUPPORT
|
|
|
|
|
|
|
|
// If EFI_USB_SERIAL, enable USB features
|
|
|
|
#define HAL_USE_USB EFI_USB_SERIAL
|
|
|
|
#define HAL_USE_SERIAL_USB EFI_USB_SERIAL
|
|
|
|
|
2021-02-24 22:37:44 -08:00
|
|
|
// If EFI_FILE_LOGGING and SDC, enable SDIO/SDMMC driver
|
|
|
|
#if defined(EFI_SDC_DEVICE) && EFI_FILE_LOGGING
|
|
|
|
#define HAL_USE_SDC TRUE
|
|
|
|
#define FATFS_HAL_DEVICE EFI_SDC_DEVICE
|
|
|
|
#else
|
|
|
|
#define HAL_USE_SDC FALSE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// If EFI_FILE_LOGGING but not SDC, use SPI instead
|
|
|
|
#if !defined(EFI_SDC_DEVICE) && EFI_FILE_LOGGING
|
|
|
|
#define HAL_USE_MMC_SPI TRUE
|
|
|
|
#else
|
|
|
|
#define HAL_USE_MMC_SPI FALSE
|
|
|
|
#endif
|
2021-02-24 11:08:03 -08:00
|
|
|
|
|
|
|
// If USB and File logging, enable USB Mass Storage & community
|
|
|
|
#define HAL_USE_USB_MSD (EFI_FILE_LOGGING && EFI_USB_SERIAL)
|
2022-12-17 15:59:38 -08:00
|
|
|
#define HAL_USE_COMMUNITY (EFI_FILE_LOGGING && EFI_USB_SERIAL) || HAL_USE_EEPROM
|
2021-04-10 05:35:41 -07:00
|
|
|
#define USB_MSD_LUN_COUNT 2
|
|
|
|
|
2021-02-24 11:08:03 -08:00
|
|
|
// only the MSD driver requires USB_USE_WAIT
|
|
|
|
#define USB_USE_WAIT (EFI_FILE_LOGGING && EFI_USB_SERIAL)
|
|
|
|
|
2021-10-09 22:15:49 -07:00
|
|
|
// Ethernet
|
|
|
|
#define HAL_USE_MAC EFI_ETHERNET
|
|
|
|
|
2021-02-24 11:08:03 -08:00
|
|
|
/*===========================================================================*/
|
|
|
|
/* Required rusEFI settings */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
// Enable flags
|
|
|
|
#ifdef EFI_BOOTLOADER
|
|
|
|
// Disable stuff we don't need in the bootloader
|
|
|
|
#define HAL_USE_ADC FALSE
|
|
|
|
#define HAL_USE_GPT FALSE
|
|
|
|
#else
|
|
|
|
// We are not the bootloader, enable stuff!
|
|
|
|
#define HAL_USE_ADC TRUE
|
|
|
|
#define HAL_USE_GPT TRUE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define HAL_USE_PAL TRUE
|
|
|
|
|
|
|
|
// Options for individual drivers
|
|
|
|
|
|
|
|
// ADC
|
|
|
|
#define ADC_USE_WAIT TRUE
|
|
|
|
#define ADC_USE_MUTUAL_EXCLUSION FALSE
|
|
|
|
#define CAN_USE_SLEEP_MODE FALSE
|
|
|
|
|
|
|
|
// CAN
|
|
|
|
#define CAN_USE_SLEEP_MODE FALSE
|
|
|
|
|
|
|
|
// MMC SPI
|
|
|
|
#define MMC_NICE_WAITING TRUE
|
|
|
|
|
|
|
|
// PAL
|
|
|
|
#define PAL_USE_CALLBACKS TRUE
|
|
|
|
|
|
|
|
// USB Serial
|
2022-10-26 13:49:55 -07:00
|
|
|
#define SERIAL_USB_BUFFERS_SIZE 768
|
2021-02-24 11:08:03 -08:00
|
|
|
#define SERIAL_USB_BUFFERS_NUMBER 2
|
|
|
|
|
2021-03-07 16:25:34 -08:00
|
|
|
// USB Mass Storage
|
|
|
|
#ifdef EFI_USE_COMPRESSED_INI_MSD
|
|
|
|
// if enabled, we do gzip decompression on the MSD thread - it requires more stack space
|
2021-03-19 16:56:47 -07:00
|
|
|
#define USB_MSD_THREAD_WA_SIZE 2048
|
2021-03-07 16:25:34 -08:00
|
|
|
#endif
|
|
|
|
|
2021-02-24 11:08:03 -08:00
|
|
|
// SPI
|
|
|
|
#define SPI_USE_WAIT TRUE
|
|
|
|
#define SPI_USE_MUTUAL_EXCLUSION TRUE
|
2021-03-28 06:06:36 -07:00
|
|
|
|
|
|
|
// Extra field in the UART driver's struct to store a reference to the DMA receive buffer object
|
|
|
|
#define UART_DRIVER_EXT_FIELDS void* dmaAdapterInstance;
|
2021-10-09 22:15:49 -07:00
|
|
|
|
|
|
|
// Ethernet MAC
|
|
|
|
#define MAC_USE_ZERO_COPY FALSE
|
|
|
|
#define MAC_USE_EVENTS TRUE
|