coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gsbi.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause */
2
3
#include <soc/gpio.h>
4
#include <
soc/gsbi.h
>
5
#include <soc/qup.h>
6
7
#define GPIO_FUNC_I2C 0x1
8
9
int
gsbi_init_board
(
gsbi_id_t
gsbi_id)
10
{
11
switch
(gsbi_id) {
12
case
GSBI_ID_7
:
13
gpio_tlmm_config_set
(8,
GPIO_FUNC_I2C
,
14
GPIO_NO_PULL
,
GPIO_2MA
, 1);
15
gpio_tlmm_config_set
(9,
GPIO_FUNC_I2C
,
16
GPIO_NO_PULL
,
GPIO_2MA
, 1);
17
break
;
18
case
GSBI_ID_4
:
19
/* Configure GPIOs 13 - SCL, 12 - SDA, 2mA gpio_en */
20
gpio_tlmm_config_set
(12,
GPIO_FUNC_I2C
,
21
GPIO_NO_PULL
,
GPIO_2MA
, 1);
22
gpio_tlmm_config_set
(13,
GPIO_FUNC_I2C
,
23
GPIO_NO_PULL
,
GPIO_2MA
, 1);
24
break
;
25
case
GSBI_ID_1
:
26
/* Configure GPIOs 54 - SCL, 53 - SDA, 2mA gpio_en */
27
gpio_tlmm_config_set
(54,
GPIO_FUNC_I2C
,
28
GPIO_NO_PULL
,
GPIO_2MA
, 1);
29
gpio_tlmm_config_set
(53,
GPIO_FUNC_I2C
,
30
GPIO_NO_PULL
,
GPIO_2MA
, 1);
31
break
;
32
default
:
33
return
1;
34
}
35
36
return
0;
37
}
gsbi.h
gsbi_id_t
gsbi_id_t
Definition:
gsbi.h:18
GSBI_ID_1
@ GSBI_ID_1
Definition:
gsbi.h:19
GSBI_ID_7
@ GSBI_ID_7
Definition:
gsbi.h:25
GSBI_ID_4
@ GSBI_ID_4
Definition:
gsbi.h:22
GPIO_FUNC_I2C
#define GPIO_FUNC_I2C
Definition:
gsbi.c:7
gsbi_init_board
int gsbi_init_board(gsbi_id_t gsbi_id)
Definition:
gsbi.c:9
GPIO_2MA
@ GPIO_2MA
Definition:
gpio_common.h:70
GPIO_NO_PULL
@ GPIO_NO_PULL
Definition:
gpio_common.h:62
gpio_tlmm_config_set
void gpio_tlmm_config_set(gpio_t gpio, unsigned int func, unsigned int pull, unsigned int drvstr, unsigned int enable)
Definition:
gpio.c:32
src
mainboard
google
storm
gsbi.c
Generated by
1.9.1