coreboot-kgpe-d16/src/soc/intel
Kapil Porwal 400f1aade8 soc/intel/common: Add support for AP initiated mode entry
Add support for AP initiated mode entry. The code flow has been
optimized as below -

Code flow when AP initiated mode entry is disabled:
          +-------+
          | Start |
          +---+---+
              |
              |
    +---------+---------+
    |wait_for_connection|
    |   Is DP ALT mode  |
    |     available?    |
    +---------+---------+
              |
              +--------------->-------+
           Yes|                 No    |
    +---------+---------+             |
    |Skip enter_dp_mode |             |
    +---------+---------+             |
              |                       |
              |                       |
  +-----------+----------+            |
  |wait_for_dp_mode_entry|            |
  |   Is DP flag set?    |            |
  +-----------+----------+            |
              |                       |
              +--------------->--------
           Yes|                 No    |
  +-----------+----------+            |
  |     wait_for_hpd     |            |
  | Is HPD_LVL flag set? |            |
  +-----------+----------+            |
              |                       |
              +--------------->--------
           Yes|                 No    |
  +-----------+----------+            |
  |    Rest of the code  |            |
  +-----------+----------+            |
              |                       |
              +---------------<-------+
              |
          +---+---+
          |  End  |
          +-------+

Code flow when AP initiated mode entry is enabled:
          +-------+
          | Start |
          +---+---+
              |
 +------------+-----------+
 |Skip wait_for_connection|
 +------------+-----------+
              |
     +--------+-------+
     |  enter_dp_mode |
     | Is USB device? |
     +--------+-------+
              |
              +--------------->-------+
           Yes|                 No    |
    +---------+---------+             |
    |   enter_dp_mode   |             |
    |    Send DP mode   |             |
    |   entry command   |             |
    +---------+---------+             |
              |                       |
  +-----------+----------+            |
  |wait_for_dp_mode_entry|            |
  |   Is DP flag set?    |            |
  |  (If not, loop wait  |            |
  |   until timed out)   |            |
  +-----------+----------+            |
              |                       |
              +--------------->--------
           Yes|                 No    |
  +-----------+----------+            |
  |     wait_for_hpd     |            |
  | Is HPD_LVL flag set? |            |
  |  (If not, loop wait  |            |
  |   until timed out)   |            |
  +-----------+----------+            |
              |                       |
              +--------------->--------
           Yes|                 No    |
  +-----------+----------+            |
  |    Rest of the code  |            |
  +-----------+----------+            |
              |                       |
              +---------------<-------+
              |
          +---+---+
          |  End  |
          +-------+

BUG=b:247670186
TEST=Verify display over TCSS and its impact on boot time for
google/rex

Time taken by enter_dp_mode / wait_for_dp+hpd / MultiPhaseSiInit
functions with this patch train:

1. When AP Mode entry is enabled
- With type-c display on C1 and SuzyQ on C0: 6.9ms / 420ms / 616ms
- With USB key on C1 and SuzyQ on C0       : 6.0ms / 505ms / 666ms
- Without any device on C1 and SuzyQ on C0 : 3.7ms /   0ms / 178ms

2. When AP Mode entry is disabled
- With type-c display on C1 and SuzyQ on C0: 1.7ms / 2.5ms / 213ms
- With USB key on C1 and SuzyQ on C0       : 0.9ms / 3.3ms / 177ms
- Without any device on C1 and SuzyQ on C0 : 0.8ms / 1.8ms / 165ms

Without this patch train, wait_for_hpd would cause a constant delay of
WAIT_FOR_HPD_TIMEOUT_MS (i.e. 3 seconds) per type-c port when there is
no device connected.

Signed-off-by: Kapil Porwal <kapilporwal@google.com>
Change-Id: I514ccbdbaf905c49585dc00746d047554d7c7a58
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76366
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-07-15 12:48:01 +00:00
..
alderlake soc/intel/adl: Add Raptor Lake-HX definitions 2023-07-14 14:31:24 +00:00
apollolake soc/intel/apl: Use newer function for resource declarations 2023-07-12 09:15:08 +00:00
baytrail soc/intel/baytrail: Use newer function for resource declarations 2023-07-13 14:13:26 +00:00
braswell soc/intel/braswell: Use newer function for resource declarations 2023-07-13 14:14:21 +00:00
broadwell soc/intel/broadwell: Use newer function for resource declarations 2023-07-12 09:14:16 +00:00
cannonlake soc/intel/cannonlake: Hook up ucode for CML-S 2023-07-14 18:49:33 +00:00
common soc/intel/common: Add support for AP initiated mode entry 2023-07-15 12:48:01 +00:00
denverton_ns acpi/gnvs.c: Drop unused pointer to the cbmem console 2023-07-06 13:54:30 +00:00
elkhartlake soc/intel: Rename pcr.asl to pch_pcr.asl 2023-07-13 16:37:56 +00:00
jasperlake soc/intel: Rename pcr.asl to pch_pcr.asl 2023-07-13 16:37:56 +00:00
meteorlake soc/intel: Rename pcr.asl to pch_pcr.asl 2023-07-13 16:37:56 +00:00
skylake soc/intel: Rename pcr.asl to pch_pcr.asl 2023-07-13 16:37:56 +00:00
tigerlake soc/intel: Rename pcr.asl to pch_pcr.asl 2023-07-13 16:37:56 +00:00
xeon_sp soc/intel: Rename pcr.asl to pch_pcr.asl 2023-07-13 16:37:56 +00:00
Makefile.inc