coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
spi.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 /*
4  * This file is created based on MT8186 Functional Specification
5  * Chapter number: 5.6
6  */
7 
8 #ifndef MTK_MT8186_SPI_H
9 #define MTK_MT8186_SPI_H
10 
11 #include <soc/spi_common.h>
12 
13 #define SPI_BUS_NUMBER 6
14 
15 #define GET_SCK_REG(x) x->spi_cfg2_reg
16 
17 DEFINE_BITFIELD(SPI_CFG_CS_HOLD, 15, 0)
18 DEFINE_BITFIELD(SPI_CFG_CS_SETUP, 31, 16)
19 
20 DEFINE_BITFIELD(SPI_CFG_SCK_LOW, 15, 0)
21 DEFINE_BITFIELD(SPI_CFG_SCK_HIGH, 31, 16)
22 
23 DEFINE_BITFIELD(SPI_CFG1_CS_IDLE, 7, 0)
24 DEFINE_BITFIELD(SPI_CFG1_PACKET_LOOP, 15, 8)
25 DEFINE_BITFIELD(SPI_CFG1_PACKET_LENGTH, 28, 16)
26 DEFINE_BITFIELD(SPI_CFG1_TICK_DLY, 31, 29)
27 
28 enum {
32 };
33 
34 void mtk_snfc_init(int gpio_set);
35 
36 #endif
#define DEFINE_BITFIELD(name, high_bit, low_bit)
Definition: mmio.h:124
void gpio_set(gpio_t gpio, int value)
Definition: gpio.c:174
@ SPI_NOR_GPIO_SET0
Definition: spi.h:29
@ SPI_NOR_GPIO_SET_NUM
Definition: spi.h:31
@ SPI_NOR_GPIO_SET1
Definition: spi.h:30
void mtk_snfc_init(int gpio_set)
Definition: spi.c:141