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> |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 5 | #include "raminit.h" |
Arthur Heymans | 186e9c4 | 2017-01-10 14:26:23 +0100 | [diff] [blame] | 6 | #include "i945.h" |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 7 | |
| 8 | /** |
| 9 | * sample the strobes signal |
| 10 | */ |
| 11 | static u32 sample_strobes(int channel_offset, struct sys_info *sysinfo) |
| 12 | { |
| 13 | u32 reg32, addr; |
| 14 | int i; |
| 15 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 16 | mchbar_setbits32(C0DRC1 + channel_offset, 1 << 6); |
| 17 | mchbar_clrbits32(C0DRC1 + channel_offset, 1 << 6); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 18 | |
| 19 | addr = 0; |
| 20 | |
| 21 | if (channel_offset != 0) { /* must be dual channel */ |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 22 | if (sysinfo->interleaved == 1) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 23 | addr |= (1 << 6); |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 24 | else |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 25 | addr = ((u32)mchbar_read8(C0DRB3)) << 25; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | for (i = 0; i < 28; i++) { |
Kevin Paul Herbert | bde6d30 | 2014-12-24 18:43:20 -0800 | [diff] [blame] | 29 | read32((void *)addr); |
| 30 | read32((void *)(addr + 0x80)); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 31 | } |
| 32 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 33 | reg32 = mchbar_read32(RCVENMT); |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 34 | if (channel_offset == 0) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 35 | reg32 = reg32 << 2; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 36 | |
| 37 | /** |
| 38 | * [19] = 1: all bits are high |
| 39 | * [18] = 1: all bits are low |
| 40 | * [19:18] = 00: bits are mixed high, low |
| 41 | */ |
| 42 | return reg32; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * This function sets receive enable coarse and medium timing parameters |
| 47 | */ |
| 48 | |
| 49 | static void set_receive_enable(int channel_offset, u8 medium, u8 coarse) |
| 50 | { |
| 51 | u32 reg32; |
| 52 | |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 53 | 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] | 54 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 55 | reg32 = mchbar_read32(C0DRT1 + channel_offset); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 56 | reg32 &= 0xf0ffffff; |
| 57 | reg32 |= ((u32)coarse & 0x0f) << 24; |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 58 | mchbar_write32(C0DRT1 + channel_offset, reg32); |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 59 | |
| 60 | /* This should never happen: */ |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 61 | if (coarse > 0x0f) |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 62 | printk(BIOS_DEBUG, "%s: coarse overflow: 0x%02x.\n", __func__, coarse); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 63 | |
| 64 | /* medium control |
| 65 | * |
| 66 | * 00 - 1/4 clock |
| 67 | * 01 - 1/2 clock |
| 68 | * 10 - 3/4 clock |
| 69 | * 11 - 1 clock |
| 70 | */ |
| 71 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 72 | reg32 = mchbar_read32(RCVENMT); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 73 | if (!channel_offset) { |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 74 | /* Channel 0 */ |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 75 | reg32 &= ~(3 << 2); |
| 76 | reg32 |= medium << 2; |
| 77 | } else { |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 78 | /* Channel 1 */ |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 79 | reg32 &= ~(3 << 0); |
| 80 | reg32 |= medium; |
| 81 | } |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 82 | mchbar_write32(RCVENMT, reg32); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 83 | |
| 84 | } |
| 85 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 86 | static int normalize(int channel_offset, u8 *mediumcoarse, u8 *fine) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 87 | { |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 88 | printk(BIOS_SPEW, " %s()\n", __func__); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 89 | |
| 90 | if (*fine < 0x80) |
| 91 | return 0; |
| 92 | |
| 93 | *fine -= 0x80; |
| 94 | *mediumcoarse += 1; |
| 95 | |
| 96 | if (*mediumcoarse >= 0x40) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 97 | printk(BIOS_DEBUG, "Normalize Error\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 98 | return -1; |
| 99 | } |
| 100 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 101 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 102 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 103 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 104 | |
| 105 | return 0; |
| 106 | } |
| 107 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 108 | static int find_preamble(int channel_offset, u8 *mediumcoarse, |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 109 | struct sys_info *sysinfo) |
| 110 | { |
| 111 | /* find start of the data phase */ |
| 112 | u32 reg32; |
| 113 | |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 114 | printk(BIOS_SPEW, " %s()\n", __func__); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 115 | |
| 116 | do { |
| 117 | if (*mediumcoarse < 4) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 118 | printk(BIOS_DEBUG, "No Preamble found.\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 119 | return -1; |
| 120 | } |
| 121 | *mediumcoarse -= 4; |
| 122 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 123 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 124 | |
| 125 | reg32 = sample_strobes(channel_offset, sysinfo); |
| 126 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 127 | } while (reg32 & (1 << 19)); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 128 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 129 | if (!(reg32 & (1 << 18))) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 130 | printk(BIOS_DEBUG, "No Preamble found (neither high nor low).\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 131 | return -1; |
| 132 | } |
| 133 | |
| 134 | return 0; |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * add a quarter clock to the current receive enable settings |
| 139 | */ |
| 140 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 141 | static int add_quarter_clock(int channel_offset, u8 *mediumcoarse, u8 *fine) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 142 | { |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 143 | printk(BIOS_SPEW, " %s() mediumcoarse=%02x fine=%02x\n", __func__, |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 144 | *mediumcoarse, *fine); |
| 145 | if (*fine >= 0x80) { |
| 146 | *fine -= 0x80; |
| 147 | |
| 148 | *mediumcoarse += 2; |
| 149 | if (*mediumcoarse >= 0x40) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 150 | printk(BIOS_DEBUG, "clocks at max.\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 151 | return -1; |
| 152 | } |
| 153 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 154 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 155 | } else { |
| 156 | *fine += 0x80; |
| 157 | } |
| 158 | |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 159 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 160 | |
| 161 | return 0; |
| 162 | } |
| 163 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 164 | static int find_strobes_low(int channel_offset, u8 *mediumcoarse, u8 *fine, |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 165 | struct sys_info *sysinfo) |
| 166 | { |
| 167 | u32 rcvenmt; |
| 168 | |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 169 | printk(BIOS_SPEW, " %s()\n", __func__); |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 170 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 171 | for (;;) { |
Angel Pons | 1d4044a | 2021-03-27 19:11:51 +0100 | [diff] [blame] | 172 | mchbar_write8(C0WL0REOST + channel_offset, *fine); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 173 | |
Elyes HAOUAS | 3dff32c | 2020-03-30 17:16:51 +0200 | [diff] [blame] | 174 | set_receive_enable(channel_offset, *mediumcoarse & 3, *mediumcoarse >> 2); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 175 | |
| 176 | rcvenmt = sample_strobes(channel_offset, sysinfo); |
| 177 | |
| 178 | if (((rcvenmt & (1 << 18)) != 0)) |
| 179 | return 0; |
| 180 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 181 | *fine -= 0x80; |
| 182 | if (*fine == 0) |
| 183 | continue; |
| 184 | |
| 185 | *mediumcoarse -= 2; |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 186 | if (*mediumcoarse < 0xfe) |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 187 | continue; |
| 188 | |
| 189 | break; |
| 190 | |
| 191 | } |
| 192 | |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 193 | printk(BIOS_DEBUG, "Could not find low strobe\n"); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 194 | return 0; |
| 195 | } |
| 196 | |
Arthur Heymans | 70a8e34 | 2017-03-09 11:30:23 +0100 | [diff] [blame] | 197 | static int find_strobes_edge(int channel_offset, u8 *mediumcoarse, u8 *fine, |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 198 | struct sys_info *sysinfo) |
| 199 | { |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 200 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 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 | } |