Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2014 Vladimir Serbinenko <phcoder@gmail.com> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | #include <console/console.h> |
| 17 | #include <northbridge/intel/sandybridge/sandybridge.h> |
| 18 | #include <southbridge/intel/bd82x6x/pch.h> |
| 19 | |
| 20 | void early_init_dmi(void) |
| 21 | { |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 22 | int i; |
| 23 | |
| 24 | DMIBAR32(0x0914) |= 0x80000000; |
| 25 | DMIBAR32(0x0934) |= 0x80000000; |
| 26 | |
| 27 | for (i = 0; i < 4; i++) { |
| 28 | DMIBAR32(0x0a00 + (i << 4)) &= 0xf3ffffff; |
| 29 | DMIBAR32(0x0a04 + (i << 4)) |= 0x800; |
| 30 | } |
| 31 | DMIBAR32(0x0c30) = (DMIBAR32(0x0c30) & 0xfffffff) | 0x40000000; |
| 32 | |
| 33 | for (i = 0; i < 2; i++) { |
| 34 | DMIBAR32(0x0904 + (i << 5)) &= 0xfe3fffff; |
| 35 | DMIBAR32(0x090c + (i << 5)) &= 0xfff1ffff; |
| 36 | } |
| 37 | |
| 38 | DMIBAR32(0x090c) &= 0xfe1fffff; |
| 39 | DMIBAR32(0x092c) &= 0xfe1fffff; |
| 40 | |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 41 | DMIBAR32(0x0904); // !!! = 0x7a1842ec |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 42 | DMIBAR32(0x0904) = 0x7a1842ec; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 43 | DMIBAR32(0x090c); // !!! = 0x00000208 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 44 | DMIBAR32(0x090c) = 0x00000128; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 45 | DMIBAR32(0x0924); // !!! = 0x7a1842ec |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 46 | DMIBAR32(0x0924) = 0x7a1842ec; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 47 | DMIBAR32(0x092c); // !!! = 0x00000208 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 48 | DMIBAR32(0x092c) = 0x00000128; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 49 | DMIBAR32(0x0700); // !!! = 0x46139008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 50 | DMIBAR32(0x0700) = 0x46139008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 51 | DMIBAR32(0x0720); // !!! = 0x46139008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 52 | DMIBAR32(0x0720) = 0x46139008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 53 | DMIBAR32(0x0c04); // !!! = 0x2e680008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 54 | DMIBAR32(0x0c04) = 0x2e680008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 55 | DMIBAR32(0x0904); // !!! = 0x7a1842ec |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 56 | DMIBAR32(0x0904) = 0x3a1842ec; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 57 | DMIBAR32(0x0924); // !!! = 0x7a1842ec |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 58 | DMIBAR32(0x0924) = 0x3a1842ec; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 59 | DMIBAR32(0x0910); // !!! = 0x00006300 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 60 | DMIBAR32(0x0910) = 0x00004300; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 61 | DMIBAR32(0x0930); // !!! = 0x00006300 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 62 | DMIBAR32(0x0930) = 0x00004300; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 63 | DMIBAR32(0x0a00); // !!! = 0x03042010 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 64 | DMIBAR32(0x0a00) = 0x03042018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 65 | DMIBAR32(0x0a10); // !!! = 0x03042010 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 66 | DMIBAR32(0x0a10) = 0x03042018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 67 | DMIBAR32(0x0a20); // !!! = 0x03042010 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 68 | DMIBAR32(0x0a20) = 0x03042018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 69 | DMIBAR32(0x0a30); // !!! = 0x03042010 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 70 | DMIBAR32(0x0a30) = 0x03042018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 71 | DMIBAR32(0x0c00); // !!! = 0x29700c08 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 72 | DMIBAR32(0x0c00) = 0x29700c08; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 73 | DMIBAR32(0x0a04); // !!! = 0x0c0708f0 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 74 | DMIBAR32(0x0a04) = 0x0c0718f0; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 75 | DMIBAR32(0x0a14); // !!! = 0x0c0708f0 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 76 | DMIBAR32(0x0a14) = 0x0c0718f0; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 77 | DMIBAR32(0x0a24); // !!! = 0x0c0708f0 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 78 | DMIBAR32(0x0a24) = 0x0c0718f0; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 79 | DMIBAR32(0x0a34); // !!! = 0x0c0708f0 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 80 | DMIBAR32(0x0a34) = 0x0c0718f0; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 81 | DMIBAR32(0x0900); // !!! = 0x50000000 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 82 | DMIBAR32(0x0900) = 0x50000000; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 83 | DMIBAR32(0x0920); // !!! = 0x50000000 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 84 | DMIBAR32(0x0920) = 0x50000000; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 85 | DMIBAR32(0x0908); // !!! = 0x51ffffff |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 86 | DMIBAR32(0x0908) = 0x51ffffff; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 87 | DMIBAR32(0x0928); // !!! = 0x51ffffff |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 88 | DMIBAR32(0x0928) = 0x51ffffff; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 89 | DMIBAR32(0x0a00); // !!! = 0x03042018 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 90 | DMIBAR32(0x0a00) = 0x03042018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 91 | DMIBAR32(0x0a10); // !!! = 0x03042018 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 92 | DMIBAR32(0x0a10) = 0x03042018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 93 | DMIBAR32(0x0a20); // !!! = 0x03042018 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 94 | DMIBAR32(0x0a20) = 0x03042018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 95 | DMIBAR32(0x0a30); // !!! = 0x03042018 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 96 | DMIBAR32(0x0a30) = 0x03042018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 97 | DMIBAR32(0x0700); // !!! = 0x46139008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 98 | DMIBAR32(0x0700) = 0x46139008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 99 | DMIBAR32(0x0720); // !!! = 0x46139008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 100 | DMIBAR32(0x0720) = 0x46139008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 101 | DMIBAR32(0x0904); // !!! = 0x3a1842ec |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 102 | DMIBAR32(0x0904) = 0x3a1846ec; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 103 | DMIBAR32(0x0924); // !!! = 0x3a1842ec |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 104 | DMIBAR32(0x0924) = 0x3a1846ec; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 105 | DMIBAR32(0x0a00); // !!! = 0x03042018 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 106 | DMIBAR32(0x0a00) = 0x03042018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 107 | DMIBAR32(0x0a10); // !!! = 0x03042018 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 108 | DMIBAR32(0x0a10) = 0x03042018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 109 | DMIBAR32(0x0a20); // !!! = 0x03042018 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 110 | DMIBAR32(0x0a20) = 0x03042018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 111 | DMIBAR32(0x0a30); // !!! = 0x03042018 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 112 | DMIBAR32(0x0a30) = 0x03042018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 113 | DMIBAR32(0x0908); // !!! = 0x51ffffff |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 114 | DMIBAR32(0x0908) = 0x51ffffff; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 115 | DMIBAR32(0x0928); // !!! = 0x51ffffff |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 116 | DMIBAR32(0x0928) = 0x51ffffff; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 117 | DMIBAR32(0x0c00); // !!! = 0x29700c08 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 118 | DMIBAR32(0x0c00) = 0x29700c08; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 119 | DMIBAR32(0x0c0c); // !!! = 0x16063400 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 120 | DMIBAR32(0x0c0c) = 0x00063400; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 121 | DMIBAR32(0x0700); // !!! = 0x46139008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 122 | DMIBAR32(0x0700) = 0x46339008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 123 | DMIBAR32(0x0720); // !!! = 0x46139008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 124 | DMIBAR32(0x0720) = 0x46339008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 125 | DMIBAR32(0x0700); // !!! = 0x46339008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 126 | DMIBAR32(0x0700) = 0x45339008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 127 | DMIBAR32(0x0720); // !!! = 0x46339008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 128 | DMIBAR32(0x0720) = 0x45339008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 129 | DMIBAR32(0x0700); // !!! = 0x45339008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 130 | DMIBAR32(0x0700) = 0x453b9008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 131 | DMIBAR32(0x0720); // !!! = 0x45339008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 132 | DMIBAR32(0x0720) = 0x453b9008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 133 | DMIBAR32(0x0700); // !!! = 0x453b9008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 134 | DMIBAR32(0x0700) = 0x45bb9008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 135 | DMIBAR32(0x0720); // !!! = 0x453b9008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 136 | DMIBAR32(0x0720) = 0x45bb9008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 137 | DMIBAR32(0x0700); // !!! = 0x45bb9008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 138 | DMIBAR32(0x0700) = 0x45fb9008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 139 | DMIBAR32(0x0720); // !!! = 0x45bb9008 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 140 | DMIBAR32(0x0720) = 0x45fb9008; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 141 | DMIBAR32(0x0914); // !!! = 0x9021a080 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 142 | DMIBAR32(0x0914) = 0x9021a280; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 143 | DMIBAR32(0x0934); // !!! = 0x9021a080 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 144 | DMIBAR32(0x0934) = 0x9021a280; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 145 | DMIBAR32(0x0914); // !!! = 0x9021a280 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 146 | DMIBAR32(0x0914) = 0x9821a280; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 147 | DMIBAR32(0x0934); // !!! = 0x9021a280 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 148 | DMIBAR32(0x0934) = 0x9821a280; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 149 | DMIBAR32(0x0a00); // !!! = 0x03042018 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 150 | DMIBAR32(0x0a00) = 0x03242018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 151 | DMIBAR32(0x0a10); // !!! = 0x03042018 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 152 | DMIBAR32(0x0a10) = 0x03242018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 153 | DMIBAR32(0x0a20); // !!! = 0x03042018 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 154 | DMIBAR32(0x0a20) = 0x03242018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 155 | DMIBAR32(0x0a30); // !!! = 0x03042018 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 156 | DMIBAR32(0x0a30) = 0x03242018; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 157 | DMIBAR32(0x0258); // !!! = 0x40000600 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 158 | DMIBAR32(0x0258) = 0x60000600; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 159 | DMIBAR32(0x0904); // !!! = 0x3a1846ec |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 160 | DMIBAR32(0x0904) = 0x2a1846ec; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 161 | DMIBAR32(0x0914); // !!! = 0x9821a280 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 162 | DMIBAR32(0x0914) = 0x98200280; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 163 | DMIBAR32(0x0924); // !!! = 0x3a1846ec |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 164 | DMIBAR32(0x0924) = 0x2a1846ec; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 165 | DMIBAR32(0x0934); // !!! = 0x9821a280 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 166 | DMIBAR32(0x0934) = 0x98200280; |
Elyes HAOUAS | fa1f721 | 2019-05-22 15:40:54 +0200 | [diff] [blame^] | 167 | DMIBAR32(0x022c); // !!! = 0x00c26460 |
Patrick Rudolph | 6aca7e6 | 2019-03-26 18:22:36 +0100 | [diff] [blame] | 168 | DMIBAR32(0x022c) = 0x00c2403c; |
| 169 | |
| 170 | early_pch_init_native_dmi_pre(); |
| 171 | |
| 172 | /* Write once settings. */ |
| 173 | DMIBAR32(DMILCAP) = (DMIBAR32(DMILCAP) & ~0x3f00f) | |
| 174 | (2 << 0) | // 5GT/s |
| 175 | (2 << 12) | // L0s 128 ns to less than 256 ns |
| 176 | (2 << 15); // L1 2 us to less than 4 us |
| 177 | |
| 178 | DMIBAR8(DMILCTL) |= 0x20; // Retrain link |
| 179 | while (DMIBAR16(DMILSTS) & TXTRN) |
| 180 | ; |
| 181 | |
| 182 | DMIBAR8(DMILCTL) |= 0x20; // Retrain link |
| 183 | while (DMIBAR16(DMILSTS) & TXTRN) |
| 184 | ; |
| 185 | |
| 186 | const u8 w = (DMIBAR16(DMILSTS) >> 4) & 0x1f; |
| 187 | const u16 t = (DMIBAR16(DMILSTS) & 0xf) * 2500; |
| 188 | |
| 189 | printk(BIOS_DEBUG, "DMI: Running at X%x @ %dMT/s\n", w, t); |
| 190 | /* |
| 191 | * Virtual Channel resources must match settings in RCBA! |
| 192 | * |
| 193 | * Channel Vp and Vm are documented in |
| 194 | * "Desktop 4th Generation Intel Core Processor Family, Desktop Intel |
| 195 | * Pentium Processor Family, and Desktop Intel Celeron Processor Family |
| 196 | * Vol. 2" |
| 197 | */ |
| 198 | |
| 199 | /* Channel 0: Enable, Set ID to 0, map TC0 and TC3 and TC4 to VC0. */ |
| 200 | DMIBAR32(DMIVC0RCTL) = (1 << 31) | (0 << 24) | (0x0c << 1) | 1; |
| 201 | /* Channel 1: Enable, Set ID to 1, map TC1 and TC5 to VC1. */ |
| 202 | DMIBAR32(DMIVC1RCTL) = (1 << 31) | (1 << 24) | (0x11 << 1); |
| 203 | /* Channel p: Enable, Set ID to 2, map TC2 and TC6 to VCp */ |
| 204 | DMIBAR32(DMIVCPRCTL) = (1 << 31) | (2 << 24) | (0x22 << 1); |
| 205 | /* Channel m: Enable, Set ID to 0, map TC7 to VCm */ |
| 206 | DMIBAR32(DMIVCMRCTL) = (1 << 31) | (7 << 24) | (0x40 << 1); |
| 207 | |
| 208 | /* Set Extended VC Count (EVCC) to 1 as Channel 1 is active. */ |
| 209 | DMIBAR8(DMIPVCCAP1) |= 1; |
| 210 | |
| 211 | early_pch_init_native_dmi_post(); |
| 212 | |
| 213 | /* |
| 214 | * BIOS Requirement: Check if DMI VC Negotiation was successful. |
| 215 | * Wait for virtual channels negotiation pending. |
| 216 | */ |
| 217 | while (DMIBAR16(DMIVC0RSTS) & VC0NP) |
| 218 | ; |
| 219 | while (DMIBAR16(DMIVC1RSTS) & VC1NP) |
| 220 | ; |
| 221 | while (DMIBAR16(DMIVCPRSTS) & VCPNP) |
| 222 | ; |
| 223 | while (DMIBAR16(DMIVCMRSTS) & VCMNP) |
| 224 | ; |
| 225 | } |