OpenBIC
OpenSource Bridge-IC
plat_spi.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef PLAT_SPI_H
18#define PLAT_SPI_H
19
20#define CPLD_ADDR 0x21
21#define CPLD_SPI_OOB_CONTROL_REG 0x0B
22#define CPLD_SPI_OOB_FROM_CPU 0x02
23#define CPLD_SPI_OOB_FROM_BIC 0x0B
24#define FLASH_COPY_STACK_SIZE 1024
25
29};
30
39};
40
41typedef struct _flash_copy_info_ {
42 uint8_t copy_type;
43 uint32_t src_offset;
44 uint32_t dest_offset;
45 uint32_t total_length;
46 uint8_t status;
48 uint32_t current_len;
50
51uint8_t start_flash_copy(uint8_t copy_type, uint32_t src_offset, uint32_t dest_offset,
52 uint32_t length);
54
55#endif
uint32_t length
Definition: pldm_firmware_update.h:1
Definition: plat_spi.h:41
uint8_t status
Definition: plat_spi.h:46
uint8_t completion_code
Definition: plat_spi.h:47
uint32_t current_len
Definition: plat_spi.h:48
uint32_t dest_offset
Definition: plat_spi.h:44
uint8_t copy_type
Definition: plat_spi.h:42
uint32_t total_length
Definition: plat_spi.h:45
uint32_t src_offset
Definition: plat_spi.h:43
flash_copy_status
Definition: plat_spi.h:26
@ COPY_STATUS_BUSY
Definition: plat_spi.h:28
@ COPY_STATUS_IDEL
Definition: plat_spi.h:27
void get_flash_copy_info(FLASH_COPY_INFO *copy_info)
Definition: plat_spi.c:154
flash_copy_completion_code
Definition: plat_spi.h:31
@ COPY_FLASH_SUCCESS
Definition: plat_spi.h:32
@ COPY_FLASH_WRITE_ERROR
Definition: plat_spi.h:37
@ COPY_FLASH_INIT_FAIL
Definition: plat_spi.h:34
@ COPY_FLASH_MALLOC_FAIL
Definition: plat_spi.h:36
@ COPY_FLASH_UNSUPPORTED_TYPE
Definition: plat_spi.h:33
@ COPY_FLASH_READ_ERROR
Definition: plat_spi.h:38
@ COPY_FLASH_OUT_OF_RANGE
Definition: plat_spi.h:35
struct _flash_copy_info_ FLASH_COPY_INFO
uint8_t start_flash_copy(uint8_t copy_type, uint32_t src_offset, uint32_t dest_offset, uint32_t length)
Definition: plat_spi.c:131