Andrey Petrov | 70efecd | 2016-03-04 21:41:13 -0800 | [diff] [blame] | 1 | /* |
| 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 Roth | ebabfad | 2016-04-10 11:09:16 -0600 | [diff] [blame] | 11 | * |
| 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 Petrov | 70efecd | 2016-03-04 21:41:13 -0800 | [diff] [blame] | 16 | */ |
| 17 | |
| 18 | #ifndef _SOC_APOLLOLAKE_CHIP_H_ |
| 19 | #define _SOC_APOLLOLAKE_CHIP_H_ |
| 20 | |
Furquan Shaikh | 6e37e90 | 2016-07-28 13:44:53 -0700 | [diff] [blame] | 21 | #include <soc/gpe.h> |
Harsha Priya | d9fc5fb | 2016-07-06 12:00:49 -0700 | [diff] [blame] | 22 | #include <soc/gpio_defs.h> |
Duncan Laurie | ff8bce0 | 2016-06-27 10:57:13 -0700 | [diff] [blame] | 23 | #include <soc/gpio.h> |
| 24 | #include <soc/intel/common/lpss_i2c.h> |
| 25 | #include <device/i2c.h> |
Shaunak Saha | 5b6c5a5 | 2016-06-07 02:06:28 -0700 | [diff] [blame] | 26 | #include <soc/pm.h> |
Duncan Laurie | ff8bce0 | 2016-06-27 10:57:13 -0700 | [diff] [blame] | 27 | |
Andrey Petrov | 70efecd | 2016-03-04 21:41:13 -0800 | [diff] [blame] | 28 | #define CLKREQ_DISABLED 0xf |
Duncan Laurie | ff8bce0 | 2016-06-27 10:57:13 -0700 | [diff] [blame] | 29 | #define APOLLOLAKE_I2C_DEV_MAX 8 |
| 30 | |
Alexandru Gagniuc | 3aa34a8 | 2016-04-04 10:47:49 -0700 | [diff] [blame] | 31 | /* Serial IRQ control. SERIRQ_QUIET is the default (0). */ |
| 32 | enum serirq_mode { |
| 33 | SERIRQ_QUIET, |
| 34 | SERIRQ_CONTINUOUS, |
| 35 | SERIRQ_OFF, |
| 36 | }; |
| 37 | |
Andrey Petrov | 70efecd | 2016-03-04 21:41:13 -0800 | [diff] [blame] | 38 | struct 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 Gagniuc | 3aa34a8 | 2016-04-04 10:47:49 -0700 | [diff] [blame] | 50 | |
Zhao, Lijian | 1b8ee0b | 2016-05-17 19:01:34 -0700 | [diff] [blame] | 51 | /* [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 Gagniuc | 3aa34a8 | 2016-04-04 10:47:49 -0700 | [diff] [blame] | 85 | /* Configure serial IRQ (SERIRQ) line. */ |
| 86 | enum serirq_mode serirq_mode; |
Hannah Williams | 483004f | 2016-03-28 14:45:59 -0700 | [diff] [blame] | 87 | |
Duncan Laurie | ff8bce0 | 2016-06-27 10:57:13 -0700 | [diff] [blame] | 88 | /* I2C bus configuration */ |
Aaron Durbin | 4668ba7 | 2016-11-09 17:09:40 -0600 | [diff] [blame] | 89 | struct lpss_i2c_bus_config i2c[APOLLOLAKE_I2C_DEV_MAX]; |
Shaunak Saha | 5b6c5a5 | 2016-06-07 02:06:28 -0700 | [diff] [blame] | 90 | |
| 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 Satija | e46dbcc | 2016-05-03 15:15:31 -0700 | [diff] [blame] | 94 | |
| 95 | /* Configure LPSS S0ix Enable */ |
| 96 | uint8_t lpss_s0ix_enable; |
Shaunak Saha | cd9e1e4 | 2016-07-12 01:22:33 -0700 | [diff] [blame] | 97 | |
| 98 | /* Enable DPTF support */ |
| 99 | int dptf_enable; |
Aaron Durbin | 41a3fa6 | 2016-08-25 15:42:04 -0500 | [diff] [blame] | 100 | |
Sumeet Pawnikar | a247d8e | 2016-09-27 23:18:35 +0530 | [diff] [blame] | 101 | /* PL1 override value in mW for APL */ |
| 102 | uint16_t tdp_pl1_override_mw; |
Sumeet Pawnikar | 428f90a | 2016-12-02 18:14:19 +0530 | [diff] [blame] | 103 | /* PL2 override value in mW for APL */ |
| 104 | uint16_t tdp_pl2_override_mw; |
Sumeet Pawnikar | a247d8e | 2016-09-27 23:18:35 +0530 | [diff] [blame] | 105 | |
Venkateswarlu Vinjamuri | 88df48c | 2016-09-02 16:04:27 -0700 | [diff] [blame] | 106 | /* 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 Durbin | 41a3fa6 | 2016-08-25 15:42:04 -0500 | [diff] [blame] | 113 | /* SLP S3 minimum assertion width. */ |
| 114 | int slp_s3_assertion_width_usecs; |
Vaibhav Shankar | ef8deaf | 2016-08-23 17:56:17 -0700 | [diff] [blame] | 115 | |
| 116 | /* GPIO pin for PERST_0 */ |
| 117 | uint16_t prt0_gpio; |
Andrey Petrov | 70efecd | 2016-03-04 21:41:13 -0800 | [diff] [blame] | 118 | }; |
| 119 | |
| 120 | #endif /* _SOC_APOLLOLAKE_CHIP_H_ */ |