mb/system76/cml-u/dt: Make use of chipset devicetree
[coreboot.git] / src / soc / qualcomm / qcs405 / blsp.c
blob7fb495477b61aae3ae0f4f2fe55df21475714047
1 /* SPDX-License-Identifier: BSD-3-Clause */
3 #include <device/mmio.h>
4 #include <soc/blsp.h>
5 #include <soc/gpio.h>
6 #include <soc/iomap.h>
7 #include <soc/clock.h>
9 blsp_return_t blsp_i2c_init(blsp_qup_id_t id)
11 void *base;
13 switch (id) {
14 case BLSP_QUP_ID_1:
15 gpio_configure
16 (GPIO(24), 2, GPIO_PULL_UP, GPIO_2MA, GPIO_OUTPUT);
17 gpio_configure
18 (GPIO(25), 2, GPIO_PULL_UP, GPIO_2MA, GPIO_OUTPUT);
19 break;
20 default:
21 return BLSP_ID_ERROR;
24 clock_configure_i2c(19200000);
25 clock_enable_i2c();
27 base = blsp_qup_base(id);
29 if (!base)
30 return BLSP_ID_ERROR;
32 /* Configure Mini core to I2C core */
33 clrsetbits32(base, BLSP_MINI_CORE_MASK, BLSP_MINI_CORE_I2C);
35 return BLSP_SUCCESS;