ff8bce0a5f
Support the I2C interfaces on this SOC using the Intel common lpss_i2c driver. The controllers are supported in pre-ram environments by setting a temporary base address in bootblock and in ramstage using the naturally enumerated base address. The base speed of this controller is 133MHz and the SCL/SDA timing values that are reported to the OS are calculated using that clock. This was tested on a google/reef board doing I2C transactions to the trackpad both in verstage and in ramstage. Change-Id: I0a9d62cd1007caa95cdf4754f30c30aaff9f78f9 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://review.coreboot.org/15480 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
101 lines
3.2 KiB
C
101 lines
3.2 KiB
C
/*
|
|
* This file is part of the coreboot project.
|
|
*
|
|
* Copyright (C) 2015 Intel Corp.
|
|
* (Written by Alexandru Gagniuc <alexandrux.gagniuc@intel.com> for Intel Corp.)
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#ifndef _SOC_APOLLOLAKE_CHIP_H_
|
|
#define _SOC_APOLLOLAKE_CHIP_H_
|
|
|
|
#include <soc/gpio.h>
|
|
#include <soc/intel/common/lpss_i2c.h>
|
|
#include <device/i2c.h>
|
|
|
|
#define CLKREQ_DISABLED 0xf
|
|
#define APOLLOLAKE_I2C_DEV_MAX 8
|
|
|
|
struct apollolake_i2c_config {
|
|
/* Bus should be enabled prior to ramstage with temporary base */
|
|
int early_init;
|
|
/* Bus speed in Hz, default is I2C_SPEED_FAST (400 KHz) */
|
|
enum i2c_speed speed;
|
|
/* Specific bus speed configuration */
|
|
struct lpss_i2c_speed_config speed_config[LPSS_I2C_SPEED_CONFIG_COUNT];
|
|
};
|
|
|
|
/* Serial IRQ control. SERIRQ_QUIET is the default (0). */
|
|
enum serirq_mode {
|
|
SERIRQ_QUIET,
|
|
SERIRQ_CONTINUOUS,
|
|
SERIRQ_OFF,
|
|
};
|
|
|
|
struct soc_intel_apollolake_config {
|
|
/*
|
|
* Mapping from PCIe root port to CLKREQ input on the SOC. The SOC has
|
|
* four CLKREQ inputs, but six root ports. Root ports without an
|
|
* associated CLKREQ signal must be marked with "CLKREQ_DISABLED"
|
|
*/
|
|
uint8_t pcie_rp0_clkreq_pin;
|
|
uint8_t pcie_rp1_clkreq_pin;
|
|
uint8_t pcie_rp2_clkreq_pin;
|
|
uint8_t pcie_rp3_clkreq_pin;
|
|
uint8_t pcie_rp4_clkreq_pin;
|
|
uint8_t pcie_rp5_clkreq_pin;
|
|
|
|
/* [14:8] DDR mode Number of dealy elements.Each = 125pSec.
|
|
* [6:0] SDR mode Number of dealy elements.Each = 125pSec.
|
|
*/
|
|
uint32_t emmc_tx_cmd_cntl;
|
|
|
|
/* [14:8] HS400 mode Number of dealy elements.Each = 125pSec.
|
|
* [6:0] SDR104/HS200 mode Number of dealy elements.Each = 125pSec.
|
|
*/
|
|
uint32_t emmc_tx_data_cntl1;
|
|
|
|
/* [30:24] SDR50 mode Number of dealy elements.Each = 125pSec.
|
|
* [22:16] DDR50 mode Number of dealy elements.Each = 125pSec.
|
|
* [14:8] SDR25/HS50 mode Number of dealy elements.Each = 125pSec.
|
|
* [6:0] SDR12/Compatibility mode Number of dealy elements.Each = 125pSec.
|
|
*/
|
|
uint32_t emmc_tx_data_cntl2;
|
|
|
|
/* [30:24] SDR50 mode Number of dealy elements.Each = 125pSec.
|
|
* [22:16] DDR50 mode Number of dealy elements.Each = 125pSec.
|
|
* [14:8] SDR25/HS50 mode Number of dealy elements.Each = 125pSec.
|
|
* [6:0] SDR12/Compatibility mode Number of dealy elements.Each = 125pSec.
|
|
*/
|
|
uint32_t emmc_rx_cmd_data_cntl1;
|
|
|
|
/* [14:8] HS400 mode 1 Number of dealy elements.Each = 125pSec.
|
|
* [6:0] HS400 mode 2 Number of dealy elements.Each = 125pSec.
|
|
*/
|
|
uint32_t emmc_rx_strobe_cntl;
|
|
|
|
/* [13:8] Auto Tuning mode Number of dealy elements.Each = 125pSec.
|
|
* [6:0] SDR104/HS200 Number of dealy elements.Each = 125pSec.
|
|
*/
|
|
uint32_t emmc_rx_cmd_data_cntl2;
|
|
|
|
/* Configure serial IRQ (SERIRQ) line. */
|
|
enum serirq_mode serirq_mode;
|
|
|
|
/* Integrated Sensor Hub */
|
|
uint8_t integrated_sensor_hub_enable;
|
|
|
|
/* I2C bus configuration */
|
|
struct apollolake_i2c_config i2c[APOLLOLAKE_I2C_DEV_MAX];
|
|
};
|
|
|
|
#endif /* _SOC_APOLLOLAKE_CHIP_H_ */
|