blob: 5f8fed9a56f6b2801980d7b7188c42d6affba200 [file] [log] [blame]
Andrey Petrov70efecd2016-03-04 21:41:13 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2015 Intel Corp.
5 * (Written by Alexandru Gagniuc <alexandrux.gagniuc@intel.com> for Intel Corp.)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
Martin Rothebabfad2016-04-10 11:09:16 -060011 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
Andrey Petrov70efecd2016-03-04 21:41:13 -080016 */
17
18#ifndef _SOC_APOLLOLAKE_CHIP_H_
19#define _SOC_APOLLOLAKE_CHIP_H_
20
Furquan Shaikh6e37e902016-07-28 13:44:53 -070021#include <soc/gpe.h>
Harsha Priyad9fc5fb2016-07-06 12:00:49 -070022#include <soc/gpio_defs.h>
Duncan Laurieff8bce02016-06-27 10:57:13 -070023#include <soc/gpio.h>
24#include <soc/intel/common/lpss_i2c.h>
25#include <device/i2c.h>
Shaunak Saha5b6c5a52016-06-07 02:06:28 -070026#include <soc/pm.h>
Duncan Laurieff8bce02016-06-27 10:57:13 -070027
Andrey Petrov70efecd2016-03-04 21:41:13 -080028#define CLKREQ_DISABLED 0xf
Duncan Laurieff8bce02016-06-27 10:57:13 -070029#define APOLLOLAKE_I2C_DEV_MAX 8
30
Alexandru Gagniuc3aa34a82016-04-04 10:47:49 -070031/* Serial IRQ control. SERIRQ_QUIET is the default (0). */
32enum serirq_mode {
33 SERIRQ_QUIET,
34 SERIRQ_CONTINUOUS,
35 SERIRQ_OFF,
36};
37
Andrey Petrov70efecd2016-03-04 21:41:13 -080038struct soc_intel_apollolake_config {
39 /*
40 * Mapping from PCIe root port to CLKREQ input on the SOC. The SOC has
41 * four CLKREQ inputs, but six root ports. Root ports without an
42 * associated CLKREQ signal must be marked with "CLKREQ_DISABLED"
43 */
44 uint8_t pcie_rp0_clkreq_pin;
45 uint8_t pcie_rp1_clkreq_pin;
46 uint8_t pcie_rp2_clkreq_pin;
47 uint8_t pcie_rp3_clkreq_pin;
48 uint8_t pcie_rp4_clkreq_pin;
49 uint8_t pcie_rp5_clkreq_pin;
Alexandru Gagniuc3aa34a82016-04-04 10:47:49 -070050
Zhao, Lijian1b8ee0b2016-05-17 19:01:34 -070051 /* [14:8] DDR mode Number of dealy elements.Each = 125pSec.
52 * [6:0] SDR mode Number of dealy elements.Each = 125pSec.
53 */
54 uint32_t emmc_tx_cmd_cntl;
55
56 /* [14:8] HS400 mode Number of dealy elements.Each = 125pSec.
57 * [6:0] SDR104/HS200 mode Number of dealy elements.Each = 125pSec.
58 */
59 uint32_t emmc_tx_data_cntl1;
60
61 /* [30:24] SDR50 mode Number of dealy elements.Each = 125pSec.
62 * [22:16] DDR50 mode Number of dealy elements.Each = 125pSec.
63 * [14:8] SDR25/HS50 mode Number of dealy elements.Each = 125pSec.
64 * [6:0] SDR12/Compatibility mode Number of dealy elements.Each = 125pSec.
65 */
66 uint32_t emmc_tx_data_cntl2;
67
68 /* [30:24] SDR50 mode Number of dealy elements.Each = 125pSec.
69 * [22:16] DDR50 mode Number of dealy elements.Each = 125pSec.
70 * [14:8] SDR25/HS50 mode Number of dealy elements.Each = 125pSec.
71 * [6:0] SDR12/Compatibility mode Number of dealy elements.Each = 125pSec.
72 */
73 uint32_t emmc_rx_cmd_data_cntl1;
74
75 /* [14:8] HS400 mode 1 Number of dealy elements.Each = 125pSec.
76 * [6:0] HS400 mode 2 Number of dealy elements.Each = 125pSec.
77 */
78 uint32_t emmc_rx_strobe_cntl;
79
80 /* [13:8] Auto Tuning mode Number of dealy elements.Each = 125pSec.
81 * [6:0] SDR104/HS200 Number of dealy elements.Each = 125pSec.
82 */
83 uint32_t emmc_rx_cmd_data_cntl2;
84
Alexandru Gagniuc3aa34a82016-04-04 10:47:49 -070085 /* Configure serial IRQ (SERIRQ) line. */
86 enum serirq_mode serirq_mode;
Hannah Williams483004f2016-03-28 14:45:59 -070087
Duncan Laurieff8bce02016-06-27 10:57:13 -070088 /* I2C bus configuration */
Aaron Durbin4668ba72016-11-09 17:09:40 -060089 struct lpss_i2c_bus_config i2c[APOLLOLAKE_I2C_DEV_MAX];
Shaunak Saha5b6c5a52016-06-07 02:06:28 -070090
91 uint8_t gpe0_dw1; /* GPE0_63_32 STS/EN */
92 uint8_t gpe0_dw2; /* GPE0_95_64 STS/EN */
93 uint8_t gpe0_dw3; /* GPE0_127_96 STS/EN */
Saurabh Satijae46dbcc2016-05-03 15:15:31 -070094
95 /* Configure LPSS S0ix Enable */
96 uint8_t lpss_s0ix_enable;
Shaunak Sahacd9e1e42016-07-12 01:22:33 -070097
98 /* Enable DPTF support */
99 int dptf_enable;
Aaron Durbin41a3fa62016-08-25 15:42:04 -0500100
Sumeet Pawnikara247d8e2016-09-27 23:18:35 +0530101 /* PL1 override value in mW for APL */
102 uint16_t tdp_pl1_override_mw;
Sumeet Pawnikar428f90a2016-12-02 18:14:19 +0530103 /* PL2 override value in mW for APL */
104 uint16_t tdp_pl2_override_mw;
Sumeet Pawnikara247d8e2016-09-27 23:18:35 +0530105
Venkateswarlu Vinjamuri88df48c2016-09-02 16:04:27 -0700106 /* Configure Audio clk gate and power gate
107 * IOSF-SB port ID 92 offset 0x530 [5] and [3]
108 */
109 uint8_t hdaudio_clk_gate_enable;
110 uint8_t hdaudio_pwr_gate_enable;
111 uint8_t hdaudio_bios_config_lockdown;
112
Aaron Durbin41a3fa62016-08-25 15:42:04 -0500113 /* SLP S3 minimum assertion width. */
114 int slp_s3_assertion_width_usecs;
Vaibhav Shankaref8deaf2016-08-23 17:56:17 -0700115
116 /* GPIO pin for PERST_0 */
117 uint16_t prt0_gpio;
Andrey Petrov70efecd2016-03-04 21:41:13 -0800118};
119
120#endif /* _SOC_APOLLOLAKE_CHIP_H_ */