Angel Pons | 4b42983 | 2020-04-02 23:48:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 2 | |
Arthur Heymans | 186e9c4 | 2017-01-10 14:26:23 +0100 | [diff] [blame] | 3 | #include <console/console.h> |
Kyösti Mälkki | 13f6650 | 2019-03-03 08:01:05 +0200 | [diff] [blame] | 4 | #include <device/mmio.h> |
Elyes Haouas | 7132b62 | 2022-10-02 13:50:23 +0200 | [diff] [blame] | 5 | #include <types.h> |
| 6 | |
Arthur Heymans | 186e9c4 | 2017-01-10 14:26:23 +0100 | [diff] [blame] | 7 | #include "i945.h" |
Elyes Haouas | 7132b62 | 2022-10-02 13:50:23 +0200 | [diff] [blame] | 8 | #include "raminit.h" |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 9 | |
| 10 | /** |
| 11 | * sample the strobes signal |
| 12 | */ |
| 13 | static u32 sample_strobes(int channel_offset, struct sys_info *sysinfo) |
| 14 | { |
Elyes HAOUAS | 964055d | 2022-01-14 18:56:49 +0100 | [diff] [blame] | 15 | u32 reg32; |
| 16 | uintptr_t addr; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 17 | int i; |
| 18 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 19 | mchbar_setbits32(C0DRC1 + channel_offset, 1 << 6); |
| 20 | mchbar_clrbits32(C0DRC1 + channel_offset, 1 << 6); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 21 | |
| 22 | addr = 0; |
| 23 | |
| 24 | if (channel_offset != 0) { /* must be dual channel */ |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 25 | if (sysinfo->interleaved == 1) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 26 | addr |= (1 << 6); |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 27 | else |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 28 | addr = ((u32)mchbar_read8(C0DRB3)) << 25; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | for (i = 0; i < 28; i++) { |
Elyes Haouas | 60bdb32 | 2022-10-03 15:40:00 +0200 | [diff] [blame] | 32 | read32p(addr); |
| 33 | read32p(addr + 0x80); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 34 | } |
| 35 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 36 | reg32 = mchbar_read32(RCVENMT); |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 37 | if (channel_offset == 0) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 38 | reg32 = reg32 << 2; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 39 | |
| 40 | /** |
| 41 | * [19] = 1: all bits are high |
| 42 | * [18] = 1: all bits are low |
| 43 | * [19:18] = 00: bits are mixed high, low |
| 44 | */ |
| 45 | return reg32; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * This function sets receive enable coarse and medium timing parameters |
| 50 | */ |
| 51 | |
| 52 | static void set_receive_enable(int channel_offset, u8 medium, u8 coarse) |
| 53 | { |
| 54 | u32 reg32; |
| 55 | |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 56 | printk(BIOS_SPEW, " %s() medium=0x%x, coarse=0x%x\n", __func__, medium, coarse); |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 57 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 58 | reg32 = mchbar_read32(C0DRT1 + channel_offset); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 59 | reg32 &= 0xf0ffffff; |
| 60 | reg32 |= ((u32)coarse & 0x0f) << 24; |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 61 | mchbar_write32(C0DRT1 + channel_offset, reg32); |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 62 | |
| 63 | /* This should never happen: */ |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 64 | if (coarse > 0x0f) |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 65 | printk(BIOS_DEBUG, "%s: coarse overflow: 0x%02x.\n", __func__, coarse); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 66 | |
| 67 | /* medium control |
| 68 | * |
| 69 | * 00 - 1/4 clock |
| 70 | * 01 - 1/2 clock |
| 71 | * 10 - 3/4 clock |
| 72 | * 11 - 1 clock |
| 73 | */ |
| 74 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 75 | reg32 = mchbar_read32(RCVENMT); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 76 | if (!channel_offset) { |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 77 | /* Channel 0 */ |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 78 | reg32 &= ~(3 << 2); |
| 79 | reg32 |= medium << 2; |
| 80 | } else { |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 81 | /* Channel 1 */ |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 82 | reg32 &= ~(3 << 0); |
| 83 | reg32 |= medium; |
| 84 | } |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 85 | mchbar_write32(RCVENMT, reg32); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 86 | |
| 87 | } |
| 88 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 89 | static int normalize(int channel_offset, u8 *mediumcoarse, u8 *fine) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 90 | { |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 91 | printk(BIOS_SPEW, " %s()\n", __func__); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 92 | |
| 93 | if (*fine < 0x80) |
| 94 | return 0; |
| 95 | |
| 96 | *fine -= 0x80; |
| 97 | *mediumcoarse += 1; |
| 98 | |
| 99 | if (*mediumcoarse >= 0x40) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 100 | printk(BIOS_DEBUG, "Normalize Error\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 101 | return -1; |
| 102 | } |
| 103 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 104 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 105 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 106 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 107 | |
| 108 | return 0; |
| 109 | } |
| 110 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 111 | static int find_preamble(int channel_offset, u8 *mediumcoarse, |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 112 | struct sys_info *sysinfo) |
| 113 | { |
| 114 | /* find start of the data phase */ |
| 115 | u32 reg32; |
| 116 | |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 117 | printk(BIOS_SPEW, " %s()\n", __func__); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 118 | |
| 119 | do { |
| 120 | if (*mediumcoarse < 4) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 121 | printk(BIOS_DEBUG, "No Preamble found.\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 122 | return -1; |
| 123 | } |
| 124 | *mediumcoarse -= 4; |
| 125 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 126 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 127 | |
| 128 | reg32 = sample_strobes(channel_offset, sysinfo); |
| 129 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 130 | } while (reg32 & (1 << 19)); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 131 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 132 | if (!(reg32 & (1 << 18))) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 133 | printk(BIOS_DEBUG, "No Preamble found (neither high nor low).\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 134 | return -1; |
| 135 | } |
| 136 | |
| 137 | return 0; |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * add a quarter clock to the current receive enable settings |
| 142 | */ |
| 143 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 144 | static int add_quarter_clock(int channel_offset, u8 *mediumcoarse, u8 *fine) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 145 | { |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 146 | printk(BIOS_SPEW, " %s() mediumcoarse=%02x fine=%02x\n", __func__, |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 147 | *mediumcoarse, *fine); |
| 148 | if (*fine >= 0x80) { |
| 149 | *fine -= 0x80; |
| 150 | |
| 151 | *mediumcoarse += 2; |
| 152 | if (*mediumcoarse >= 0x40) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 153 | printk(BIOS_DEBUG, "clocks at max.\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 154 | return -1; |
| 155 | } |
| 156 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 157 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 158 | } else { |
| 159 | *fine += 0x80; |
| 160 | } |
| 161 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 162 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 163 | |
| 164 | return 0; |
| 165 | } |
| 166 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 167 | static int find_strobes_low(int channel_offset, u8 *mediumcoarse, u8 *fine, |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 168 | struct sys_info *sysinfo) |
| 169 | { |
| 170 | u32 rcvenmt; |
| 171 | |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 172 | printk(BIOS_SPEW, " %s()\n", __func__); |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 173 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 174 | for (;;) { |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 175 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 176 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 177 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 178 | |
| 179 | rcvenmt = sample_strobes(channel_offset, sysinfo); |
| 180 | |
| 181 | if (((rcvenmt & (1 << 18)) != 0)) |
| 182 | return 0; |
| 183 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 184 | *fine -= 0x80; |
| 185 | if (*fine == 0) |
| 186 | continue; |
| 187 | |
| 188 | *mediumcoarse -= 2; |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 189 | if (*mediumcoarse < 0xfe) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 190 | continue; |
| 191 | |
| 192 | break; |
| 193 | |
| 194 | } |
| 195 | |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 196 | printk(BIOS_DEBUG, "Could not find low strobe\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 197 | return 0; |
| 198 | } |
| 199 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 200 | static int find_strobes_edge(int channel_offset, u8 *mediumcoarse, u8 *fine, |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 201 | struct sys_info *sysinfo) |
| 202 | { |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 203 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 204 | int counter; |
| 205 | u32 rcvenmt; |
| 206 | |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 207 | printk(BIOS_SPEW, " %s()\n", __func__); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 208 | |
| 209 | counter = 8; |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 210 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 211 | |
| 212 | for (;;) { |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 213 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 214 | rcvenmt = sample_strobes(channel_offset, sysinfo); |
| 215 | |
| 216 | if ((rcvenmt & (1 << 19)) == 0) { |
| 217 | counter = 8; |
| 218 | } else { |
| 219 | counter--; |
| 220 | if (!counter) |
| 221 | break; |
| 222 | } |
| 223 | |
| 224 | *fine = *fine + 1; |
| 225 | if (*fine < 0xf8) { |
| 226 | if (*fine & (1 << 3)) { |
| 227 | *fine &= ~(1 << 3); |
| 228 | *fine += 0x10; |
| 229 | } |
| 230 | continue; |
| 231 | } |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 232 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 233 | *fine = 0; |
| 234 | *mediumcoarse += 2; |
| 235 | if (*mediumcoarse <= 0x40) { |
| 236 | set_receive_enable(channel_offset, *mediumcoarse & 3, |
| 237 | *mediumcoarse >> 2); |
| 238 | continue; |
| 239 | } |
| 240 | |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 241 | printk(BIOS_DEBUG, "Could not find rising edge.\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 242 | return -1; |
| 243 | } |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 244 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 245 | *fine -= 7; |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 246 | if (*fine >= 0xf9) { |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 247 | *mediumcoarse -= 2; |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 248 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 249 | } |
| 250 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 251 | *fine &= ~(1 << 3); |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 252 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 253 | |
| 254 | return 0; |
| 255 | } |
| 256 | |
| 257 | /** |
Angel Pons | 22aeed3 | 2020-06-11 13:28:03 +0200 | [diff] [blame] | 258 | * Here we use a trick. The RCVEN channel 1 registers are all at an |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 259 | * offset of 0x80 to the channel 0 registers. We don't want to waste |
Elyes HAOUAS | 12df950 | 2016-08-23 21:29:48 +0200 | [diff] [blame] | 260 | * a lot of if ()s so let's just pass 0 or 0x80 for the channel offset. |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 261 | */ |
| 262 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 263 | static int receive_enable_autoconfig(int channel_offset, struct sys_info *sysinfo) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 264 | { |
| 265 | u8 mediumcoarse; |
| 266 | u8 fine; |
| 267 | |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 268 | printk(BIOS_SPEW, "%s() for channel %d\n", __func__, channel_offset ? 1 : 0); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 269 | |
| 270 | /* Set initial values */ |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 271 | mediumcoarse = (sysinfo->cas << 2) | 3; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 272 | fine = 0; |
| 273 | |
| 274 | if (find_strobes_low(channel_offset, &mediumcoarse, &fine, sysinfo)) |
| 275 | return -1; |
| 276 | |
| 277 | if (find_strobes_edge(channel_offset, &mediumcoarse, &fine, sysinfo)) |
| 278 | return -1; |
| 279 | |
| 280 | if (add_quarter_clock(channel_offset, &mediumcoarse, &fine)) |
| 281 | return -1; |
| 282 | |
| 283 | if (find_preamble(channel_offset, &mediumcoarse, sysinfo)) |
| 284 | return -1; |
| 285 | |
| 286 | if (add_quarter_clock(channel_offset, &mediumcoarse, &fine)) |
| 287 | return -1; |
| 288 | |
| 289 | if (normalize(channel_offset, &mediumcoarse, &fine)) |
| 290 | return -1; |
| 291 | |
| 292 | /* This is a debug check to see if the rcven code is fully working. |
| 293 | * It can be removed when the output message is not printed anymore |
| 294 | */ |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 295 | if (mchbar_read8(C0WL0REOST + channel_offset) == 0) |
Angel Pons | 3049257 | 2020-06-11 13:24:54 +0200 | [diff] [blame] | 296 | printk(BIOS_DEBUG, "Weird. No C%sWL0REOST\n", channel_offset ? "1" : "0"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 297 | |
| 298 | return 0; |
| 299 | } |
| 300 | |
| 301 | void receive_enable_adjust(struct sys_info *sysinfo) |
| 302 | { |
| 303 | /* Is channel 0 populated? */ |
| 304 | if (sysinfo->dimm[0] != SYSINFO_DIMM_NOT_POPULATED |
| 305 | || sysinfo->dimm[1] != SYSINFO_DIMM_NOT_POPULATED) |
| 306 | if (receive_enable_autoconfig(0, sysinfo)) |
| 307 | return; |
| 308 | |
| 309 | /* Is channel 1 populated? */ |
| 310 | if (sysinfo->dimm[2] != SYSINFO_DIMM_NOT_POPULATED |
| 311 | || sysinfo->dimm[3] != SYSINFO_DIMM_NOT_POPULATED) |
| 312 | if (receive_enable_autoconfig(0x80, sysinfo)) |
| 313 | return; |
| 314 | } |