coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
blsp.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause */
2
3
#include <
device/mmio.h
>
4
#include <soc/blsp.h>
5
#include <soc/clock.h>
6
7
blsp_return_t
blsp_i2c_init
(
blsp_qup_id_t
id
)
8
{
9
void
*
base
=
blsp_qup_base
(
id
);
10
11
if
(!
base
)
12
return
BLSP_ID_ERROR
;
13
14
if
(
blsp_i2c_clock_config
(
id
) != 0)
15
return
BLSP_ID_ERROR
;
16
17
if
(
blsp_i2c_init_board
(
id
))
18
return
BLSP_UNSUPPORTED
;
19
20
/* Configure Mini core to I2C core */
21
clrsetbits32
(
base
,
BLSP_MINI_CORE_MASK
,
BLSP_MINI_CORE_I2C
);
22
23
return
BLSP_SUCCESS
;
24
}
mmio.h
clrsetbits32
#define clrsetbits32(addr, clear, set)
Definition:
mmio.h:16
blsp_qup_id_t
blsp_qup_id_t
Definition:
blsp.h:6
blsp_return_t
blsp_return_t
Definition:
blsp.h:13
BLSP_UNSUPPORTED
@ BLSP_UNSUPPORTED
Definition:
blsp.h:17
BLSP_ID_ERROR
@ BLSP_ID_ERROR
Definition:
blsp.h:15
BLSP_SUCCESS
@ BLSP_SUCCESS
Definition:
blsp.h:14
blsp_i2c_init_board
int blsp_i2c_init_board(blsp_qup_id_t id)
Definition:
blsp.c:41
BLSP_MINI_CORE_MASK
#define BLSP_MINI_CORE_MASK
Definition:
iomap.h:116
blsp_qup_base
static void * blsp_qup_base(blsp_qup_id_t id)
Definition:
iomap.h:103
BLSP_MINI_CORE_I2C
#define BLSP_MINI_CORE_I2C
Definition:
iomap.h:115
base
uintptr_t base
Definition:
uart.c:17
blsp_i2c_init
blsp_return_t blsp_i2c_init(blsp_qup_id_t id)
Definition:
blsp.c:7
blsp_i2c_clock_config
int blsp_i2c_clock_config(blsp_qup_id_t id)
Definition:
clock.c:91
src
soc
qualcomm
ipq40xx
blsp.c
Generated by
1.9.1