1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-10-27 11:22:10 +01:00
Files
flashrom/tests/usb_unittests.h
Willie Thai db43ab2989 nv_sma_spi: Add Nvidia SMA Programmer
Add initial support for System Management Agent (SMA) programmer.
SMA is a SOC which is working as a side band management on Nvidia
server board. One of its functionality is to flash firmware to other
components.

Test:
1. Build flashrom with this change.
2. Run operation: erase, write, read
3. All operations completed with expected performance.

NV_SMA_SPI has been tested with the following SPI flash models:

w25r128jw
w25r64jv
w25q16v

Change-Id: I6b2522788db3dcee2b30faff29f605cede8c0eaf
Co-Developed-by: Gilbert Chen <gilbertc@nvidia.com>
Co-Developed-by: Willie Thai <wthai@nvidia.com>
Signed-off-by: Willie Thai <wthai@nvidia.com>
Signed-off-by: Gilbert Chen <gilbertc@nvidia.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/88816
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2025-10-26 21:25:17 +00:00

55 lines
1.4 KiB
C

/*
* This file is part of the flashrom project.
*
* SPDX-License-Identifier: GPL-2.0-only
* SPDX-FileCopyrightText: 2022 Google LLC
*/
/*
* This header provides a temporary solution to unblock build system
* work. The main goal is to remove unconditional dependency on libusb
* for unit tests. The dependency is still present, but now it is present
* only when it is needed and only when the header is present in the env.
*
* The contents of the file will be modified in a very near future.
*/
#ifndef _USB_UNITTESTS_H_
#define _USB_UNITTESTS_H_
#if CONFIG_RAIDEN_DEBUG_SPI == 1 || CONFIG_DEDIPROG == 1 || CONFIG_CH341A_SPI == 1 || CONFIG_NV_SMA_SPI == 1
#include <libusb.h>
#else
struct libusb_context;
typedef struct libusb_context libusb_context;
struct libusb_device_handle;
typedef struct libusb_device_handle libusb_device_handle;
struct libusb_device_descriptor;
typedef struct libusb_device_descriptor libusb_device_descriptor;
struct libusb_device;
typedef struct libusb_device libusb_device;
struct libusb_config_descriptor;
typedef struct libusb_config_descriptor libusb_config_descriptor;
struct libusb_interface;
typedef struct libusb_interface libusb_interface;
struct libusb_interface_descriptor;
typedef struct libusb_interface_descriptor libusb_interface_descriptor;
struct libusb_endpoint_descriptor;
typedef struct libusb_endpoint_descriptor libusb_endpoint_descriptor;
struct libusb_transfer;
#endif
#endif /* _USB_UNITTESTS_H_ */