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 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 88 | static int normalize(int channel_offset, u8 *mediumcoarse, u8 *fine) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 89 | { |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 90 | printk(BIOS_SPEW, " %s()\n", __func__); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 91 | |
| 92 | if (*fine < 0x80) |
| 93 | return 0; |
| 94 | |
| 95 | *fine -= 0x80; |
| 96 | *mediumcoarse += 1; |
| 97 | |
| 98 | if (*mediumcoarse >= 0x40) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 99 | printk(BIOS_DEBUG, "Normalize Error\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 100 | return -1; |
| 101 | } |
| 102 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 103 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 104 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 105 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 106 | |
| 107 | return 0; |
| 108 | } |
| 109 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 110 | static int find_preamble(int channel_offset, u8 *mediumcoarse, |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 111 | struct sys_info *sysinfo) |
| 112 | { |
| 113 | /* find start of the data phase */ |
| 114 | u32 reg32; |
| 115 | |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 116 | printk(BIOS_SPEW, " %s()\n", __func__); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 117 | |
| 118 | do { |
| 119 | if (*mediumcoarse < 4) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 120 | printk(BIOS_DEBUG, "No Preamble found.\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 121 | return -1; |
| 122 | } |
| 123 | *mediumcoarse -= 4; |
| 124 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 125 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 126 | |
| 127 | reg32 = sample_strobes(channel_offset, sysinfo); |
| 128 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 129 | } while (reg32 & (1 << 19)); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 130 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 131 | if (!(reg32 & (1 << 18))) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 132 | printk(BIOS_DEBUG, "No Preamble found (neither high nor low).\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 133 | return -1; |
| 134 | } |
| 135 | |
| 136 | return 0; |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * add a quarter clock to the current receive enable settings |
| 141 | */ |
| 142 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 143 | static int add_quarter_clock(int channel_offset, u8 *mediumcoarse, u8 *fine) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 144 | { |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 145 | printk(BIOS_SPEW, " %s() mediumcoarse=%02x fine=%02x\n", __func__, |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 146 | *mediumcoarse, *fine); |
| 147 | if (*fine >= 0x80) { |
| 148 | *fine -= 0x80; |
| 149 | |
| 150 | *mediumcoarse += 2; |
| 151 | if (*mediumcoarse >= 0x40) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 152 | printk(BIOS_DEBUG, "clocks at max.\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 153 | return -1; |
| 154 | } |
| 155 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 156 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 157 | } else { |
| 158 | *fine += 0x80; |
| 159 | } |
| 160 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 161 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 162 | |
| 163 | return 0; |
| 164 | } |
| 165 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 166 | static int find_strobes_low(int channel_offset, u8 *mediumcoarse, u8 *fine, |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 167 | struct sys_info *sysinfo) |
| 168 | { |
| 169 | u32 rcvenmt; |
| 170 | |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 171 | printk(BIOS_SPEW, " %s()\n", __func__); |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 172 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 173 | for (;;) { |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 174 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 175 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 176 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 177 | |
| 178 | rcvenmt = sample_strobes(channel_offset, sysinfo); |
| 179 | |
| 180 | if (((rcvenmt & (1 << 18)) != 0)) |
| 181 | return 0; |
| 182 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 183 | *fine -= 0x80; |
| 184 | if (*fine == 0) |
| 185 | continue; |
| 186 | |
| 187 | *mediumcoarse -= 2; |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 188 | if (*mediumcoarse < 0xfe) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 189 | continue; |
| 190 | |
| 191 | break; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 192 | } |
| 193 | |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 194 | printk(BIOS_DEBUG, "Could not find low strobe\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 195 | return 0; |
| 196 | } |
| 197 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 198 | static int find_strobes_edge(int channel_offset, u8 *mediumcoarse, u8 *fine, |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 199 | struct sys_info *sysinfo) |
| 200 | { |
| 201 | int counter; |
| 202 | u32 rcvenmt; |
| 203 | |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 204 | printk(BIOS_SPEW, " %s()\n", __func__); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 205 | |
| 206 | counter = 8; |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 207 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 208 | |
| 209 | for (;;) { |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 210 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 211 | rcvenmt = sample_strobes(channel_offset, sysinfo); |
| 212 | |
| 213 | if ((rcvenmt & (1 << 19)) == 0) { |
| 214 | counter = 8; |
| 215 | } else { |
| 216 | counter--; |
| 217 | if (!counter) |
| 218 | break; |
| 219 | } |
| 220 | |
| 221 | *fine = *fine + 1; |
| 222 | if (*fine < 0xf8) { |
| 223 | if (*fine & (1 << 3)) { |
| 224 | *fine &= ~(1 << 3); |
| 225 | *fine += 0x10; |
| 226 | } |
| 227 | continue; |
| 228 | } |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 229 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 230 | *fine = 0; |
| 231 | *mediumcoarse += 2; |
| 232 | if (*mediumcoarse <= 0x40) { |
| 233 | set_receive_enable(channel_offset, *mediumcoarse & 3, |
| 234 | *mediumcoarse >> 2); |
| 235 | continue; |
| 236 | } |
| 237 | |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 238 | printk(BIOS_DEBUG, "Could not find rising edge.\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 239 | return -1; |
| 240 | } |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 241 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 242 | *fine -= 7; |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 243 | if (*fine >= 0xf9) { |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 244 | *mediumcoarse -= 2; |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 245 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 246 | } |
| 247 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 248 | *fine &= ~(1 << 3); |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 249 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 250 | |
| 251 | return 0; |
| 252 | } |
| 253 | |
| 254 | /** |
Angel Pons | 22aeed3 | 2020-06-11 13:28:03 +0200 | [diff] [blame] | 255 | * 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] | 256 | * 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] | 257 | * 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] | 258 | */ |
| 259 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 260 | static int receive_enable_autoconfig(int channel_offset, struct sys_info *sysinfo) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 261 | { |
| 262 | u8 mediumcoarse; |
| 263 | u8 fine; |
| 264 | |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 265 | 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] | 266 | |
| 267 | /* Set initial values */ |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 268 | mediumcoarse = (sysinfo->cas << 2) | 3; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 269 | fine = 0; |
| 270 | |
| 271 | if (find_strobes_low(channel_offset, &mediumcoarse, &fine, sysinfo)) |
| 272 | return -1; |
| 273 | |
| 274 | if (find_strobes_edge(channel_offset, &mediumcoarse, &fine, sysinfo)) |
| 275 | return -1; |
| 276 | |
| 277 | if (add_quarter_clock(channel_offset, &mediumcoarse, &fine)) |
| 278 | return -1; |
| 279 | |
| 280 | if (find_preamble(channel_offset, &mediumcoarse, sysinfo)) |
| 281 | return -1; |
| 282 | |
| 283 | if (add_quarter_clock(channel_offset, &mediumcoarse, &fine)) |
| 284 | return -1; |
| 285 | |
| 286 | if (normalize(channel_offset, &mediumcoarse, &fine)) |
| 287 | return -1; |
| 288 | |
| 289 | /* This is a debug check to see if the rcven code is fully working. |
| 290 | * It can be removed when the output message is not printed anymore |
| 291 | */ |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 292 | if (mchbar_read8(C0WL0REOST + channel_offset) == 0) |
Angel Pons | 3049257 | 2020-06-11 13:24:54 +0200 | [diff] [blame] | 293 | printk(BIOS_DEBUG, "Weird. No C%sWL0REOST\n", channel_offset ? "1" : "0"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 294 | |
| 295 | return 0; |
| 296 | } |
| 297 | |
| 298 | void receive_enable_adjust(struct sys_info *sysinfo) |
| 299 | { |
| 300 | /* Is channel 0 populated? */ |
| 301 | if (sysinfo->dimm[0] != SYSINFO_DIMM_NOT_POPULATED |
| 302 | || sysinfo->dimm[1] != SYSINFO_DIMM_NOT_POPULATED) |
| 303 | if (receive_enable_autoconfig(0, sysinfo)) |
| 304 | return; |
| 305 | |
| 306 | /* Is channel 1 populated? */ |
| 307 | if (sysinfo->dimm[2] != SYSINFO_DIMM_NOT_POPULATED |
| 308 | || sysinfo->dimm[3] != SYSINFO_DIMM_NOT_POPULATED) |
| 309 | if (receive_enable_autoconfig(0x80, sysinfo)) |
| 310 | return; |
| 311 | } |