zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 Advanced Micro Devices, Inc. |
| 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. |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <console/console.h> |
| 17 | #include <arch/io.h> |
Kyösti Mälkki | 8ae16a4 | 2014-06-19 20:44:34 +0300 | [diff] [blame] | 18 | #include <arch/acpi.h> |
Vladimir Serbinenko | 56f46d8 | 2014-10-08 22:06:27 +0200 | [diff] [blame] | 19 | #include <arch/acpigen.h> |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 20 | #include <stdint.h> |
| 21 | #include <device/device.h> |
| 22 | #include <device/pci.h> |
| 23 | #include <device/pci_ids.h> |
| 24 | #include <device/hypertransport.h> |
| 25 | #include <stdlib.h> |
| 26 | #include <string.h> |
Ronald G. Minnich | 5079a0d | 2012-11-27 11:32:38 -0800 | [diff] [blame] | 27 | #include <lib.h> |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 28 | #include <cpu/cpu.h> |
| 29 | #include <cbmem.h> |
Martin Roth | 73e86a8 | 2013-01-17 16:28:30 -0700 | [diff] [blame] | 30 | #include <AGESA.h> |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 31 | |
| 32 | #include <cpu/x86/lapic.h> |
Kyösti Mälkki | dbc4739 | 2012-08-05 12:11:40 +0300 | [diff] [blame] | 33 | #include <cpu/amd/mtrr.h> |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 34 | |
| 35 | #include <Porting.h> |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 36 | #include <Options.h> |
| 37 | #include <Topology.h> |
| 38 | #include <cpu/amd/amdfam15.h> |
| 39 | #include <cpuRegisters.h> |
Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 40 | |
Kyösti Mälkki | f21c2ac | 2014-10-19 09:35:18 +0300 | [diff] [blame] | 41 | #include <northbridge/amd/agesa/agesawrapper.h> |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 42 | #include <northbridge/amd/agesa/state_machine.h> |
Kyösti Mälkki | d610c58 | 2017-03-05 06:28:18 +0200 | [diff] [blame] | 43 | #include <northbridge/amd/agesa/agesa_helper.h> |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 44 | |
| 45 | #define MAX_NODE_NUMS (MAX_NODES * MAX_DIES) |
| 46 | |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 47 | typedef struct dram_base_mask { |
| 48 | u32 base; //[47:27] at [28:8] |
| 49 | u32 mask; //[47:27] at [28:8] and enable at bit 0 |
| 50 | } dram_base_mask_t; |
| 51 | |
| 52 | static unsigned node_nums; |
| 53 | static unsigned sblink; |
| 54 | static device_t __f0_dev[MAX_NODE_NUMS]; |
| 55 | static device_t __f1_dev[MAX_NODE_NUMS]; |
| 56 | static device_t __f2_dev[MAX_NODE_NUMS]; |
| 57 | static device_t __f4_dev[MAX_NODE_NUMS]; |
| 58 | static unsigned fx_devs = 0; |
| 59 | |
| 60 | static dram_base_mask_t get_dram_base_mask(u32 nodeid) |
| 61 | { |
| 62 | device_t dev; |
| 63 | dram_base_mask_t d; |
| 64 | dev = __f1_dev[0]; |
| 65 | u32 temp; |
| 66 | temp = pci_read_config32(dev, 0x44 + (nodeid << 3)); //[39:24] at [31:16] |
| 67 | d.mask = ((temp & 0xfff80000)>>(8+3)); // mask out DramMask [26:24] too |
| 68 | temp = pci_read_config32(dev, 0x144 + (nodeid <<3)) & 0xff; //[47:40] at [7:0] |
Elyes HAOUAS | 27e1801 | 2017-06-27 23:14:51 +0200 | [diff] [blame] | 69 | d.mask |= temp << 21; |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 70 | temp = pci_read_config32(dev, 0x40 + (nodeid << 3)); //[39:24] at [31:16] |
| 71 | d.mask |= (temp & 1); // enable bit |
| 72 | d.base = ((temp & 0xfff80000)>>(8+3)); // mask out DramBase [26:24) too |
| 73 | temp = pci_read_config32(dev, 0x140 + (nodeid <<3)) & 0xff; //[47:40] at [7:0] |
Elyes HAOUAS | 27e1801 | 2017-06-27 23:14:51 +0200 | [diff] [blame] | 74 | d.base |= temp << 21; |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 75 | return d; |
| 76 | } |
| 77 | |
| 78 | static void set_io_addr_reg(device_t dev, u32 nodeid, u32 linkn, u32 reg, |
| 79 | u32 io_min, u32 io_max) |
| 80 | { |
| 81 | u32 i; |
| 82 | u32 tempreg; |
| 83 | /* io range allocation */ |
Elyes HAOUAS | 27e1801 | 2017-06-27 23:14:51 +0200 | [diff] [blame] | 84 | tempreg = (nodeid&0xf) | ((nodeid & 0x30)<<(8-4)) | (linkn << 4) | ((io_max&0xf0)<<(12-4)); //limit |
Elyes HAOUAS | 1d8daa6 | 2016-09-18 08:50:54 +0200 | [diff] [blame] | 85 | for (i = 0; i < node_nums; i++) |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 86 | pci_write_config32(__f1_dev[i], reg+4, tempreg); |
Elyes HAOUAS | 27e1801 | 2017-06-27 23:14:51 +0200 | [diff] [blame] | 87 | tempreg = 3 /*| (3 << 4)*/ | ((io_min&0xf0)<<(12-4)); //base :ISA and VGA ? |
Elyes HAOUAS | 1d8daa6 | 2016-09-18 08:50:54 +0200 | [diff] [blame] | 88 | for (i = 0; i < node_nums; i++) |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 89 | pci_write_config32(__f1_dev[i], reg, tempreg); |
| 90 | } |
| 91 | |
| 92 | static void set_mmio_addr_reg(u32 nodeid, u32 linkn, u32 reg, u32 index, u32 mmio_min, u32 mmio_max, u32 nodes) |
| 93 | { |
| 94 | u32 i; |
| 95 | u32 tempreg; |
| 96 | /* io range allocation */ |
Elyes HAOUAS | 27e1801 | 2017-06-27 23:14:51 +0200 | [diff] [blame] | 97 | tempreg = (nodeid&0xf) | (linkn << 4) | (mmio_max&0xffffff00); //limit |
Elyes HAOUAS | 1d8daa6 | 2016-09-18 08:50:54 +0200 | [diff] [blame] | 98 | for (i = 0; i < nodes; i++) |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 99 | pci_write_config32(__f1_dev[i], reg+4, tempreg); |
| 100 | tempreg = 3 | (nodeid & 0x30) | (mmio_min&0xffffff00); |
Elyes HAOUAS | 1d8daa6 | 2016-09-18 08:50:54 +0200 | [diff] [blame] | 101 | for (i = 0; i < node_nums; i++) |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 102 | pci_write_config32(__f1_dev[i], reg, tempreg); |
| 103 | } |
| 104 | |
| 105 | static device_t get_node_pci(u32 nodeid, u32 fn) |
| 106 | { |
zbao | d462736 | 2012-07-23 19:49:40 +0800 | [diff] [blame] | 107 | #if MAX_NODE_NUMS + CONFIG_CDB >= 32 |
| 108 | if ((CONFIG_CDB + nodeid) < 32) { |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 109 | return dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB + nodeid, fn)); |
| 110 | } else { |
| 111 | return dev_find_slot(CONFIG_CBB-1, PCI_DEVFN(CONFIG_CDB + nodeid - 32, fn)); |
| 112 | } |
| 113 | #else |
| 114 | return dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB + nodeid, fn)); |
| 115 | #endif |
| 116 | } |
| 117 | |
| 118 | static void get_fx_devs(void) |
| 119 | { |
| 120 | int i; |
| 121 | for (i = 0; i < MAX_NODE_NUMS; i++) { |
| 122 | __f0_dev[i] = get_node_pci(i, 0); |
| 123 | __f1_dev[i] = get_node_pci(i, 1); |
| 124 | __f2_dev[i] = get_node_pci(i, 2); |
| 125 | __f4_dev[i] = get_node_pci(i, 4); |
| 126 | if (__f0_dev[i] != NULL && __f1_dev[i] != NULL) |
| 127 | fx_devs = i+1; |
| 128 | } |
| 129 | if (__f1_dev[0] == NULL || __f0_dev[0] == NULL || fx_devs == 0) { |
| 130 | die("Cannot find 0:0x18.[0|1]\n"); |
| 131 | } |
| 132 | printk(BIOS_DEBUG, "fx_devs=0x%x\n", fx_devs); |
| 133 | } |
| 134 | |
| 135 | static u32 f1_read_config32(unsigned reg) |
| 136 | { |
| 137 | if (fx_devs == 0) |
| 138 | get_fx_devs(); |
| 139 | return pci_read_config32(__f1_dev[0], reg); |
| 140 | } |
| 141 | |
| 142 | static void f1_write_config32(unsigned reg, u32 value) |
| 143 | { |
| 144 | int i; |
| 145 | if (fx_devs == 0) |
| 146 | get_fx_devs(); |
Elyes HAOUAS | 5a7e72f | 2016-08-23 21:36:02 +0200 | [diff] [blame] | 147 | for (i = 0; i < fx_devs; i++) { |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 148 | device_t dev; |
| 149 | dev = __f1_dev[i]; |
| 150 | if (dev && dev->enabled) { |
| 151 | pci_write_config32(dev, reg, value); |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | static u32 amdfam15_nodeid(device_t dev) |
| 157 | { |
| 158 | #if MAX_NODE_NUMS == 64 |
| 159 | unsigned busn; |
| 160 | busn = dev->bus->secondary; |
| 161 | if (busn != CONFIG_CBB) { |
| 162 | return (dev->path.pci.devfn >> 3) - CONFIG_CDB + 32; |
| 163 | } else { |
| 164 | return (dev->path.pci.devfn >> 3) - CONFIG_CDB; |
| 165 | } |
| 166 | |
| 167 | #else |
| 168 | return (dev->path.pci.devfn >> 3) - CONFIG_CDB; |
| 169 | #endif |
| 170 | } |
| 171 | |
| 172 | static void set_vga_enable_reg(u32 nodeid, u32 linkn) |
| 173 | { |
| 174 | u32 val; |
| 175 | |
Elyes HAOUAS | 27e1801 | 2017-06-27 23:14:51 +0200 | [diff] [blame] | 176 | val = 1 | (nodeid << 4) | (linkn << 12); |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 177 | /* it will routing |
| 178 | * (1)mmio 0xa0000:0xbffff |
| 179 | * (2)io 0x3b0:0x3bb, 0x3c0:0x3df |
| 180 | */ |
| 181 | f1_write_config32(0xf4, val); |
| 182 | |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * @return |
Edward O'Callaghan | ae5fd34 | 2014-11-20 19:58:09 +1100 | [diff] [blame] | 187 | * @retval 2 resoure does not exist, usable |
| 188 | * @retval 0 resource exists, not usable |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 189 | * @retval 1 resource exist, resource has been allocated before |
| 190 | */ |
| 191 | static int reg_useable(unsigned reg, device_t goal_dev, unsigned goal_nodeid, |
| 192 | unsigned goal_link) |
| 193 | { |
| 194 | struct resource *res; |
| 195 | unsigned nodeid, link = 0; |
| 196 | int result; |
| 197 | res = 0; |
| 198 | for (nodeid = 0; !res && (nodeid < fx_devs); nodeid++) { |
| 199 | device_t dev; |
| 200 | dev = __f0_dev[nodeid]; |
| 201 | if (!dev) |
| 202 | continue; |
| 203 | for (link = 0; !res && (link < 8); link++) { |
| 204 | res = probe_resource(dev, IOINDEX(0x1000 + reg, link)); |
| 205 | } |
| 206 | } |
| 207 | result = 2; |
| 208 | if (res) { |
| 209 | result = 0; |
| 210 | if ((goal_link == (link - 1)) && |
| 211 | (goal_nodeid == (nodeid - 1)) && |
| 212 | (res->flags <= 1)) { |
| 213 | result = 1; |
| 214 | } |
| 215 | } |
| 216 | return result; |
| 217 | } |
| 218 | |
| 219 | static struct resource *amdfam15_find_iopair(device_t dev, unsigned nodeid, unsigned link) |
| 220 | { |
| 221 | struct resource *resource; |
| 222 | u32 free_reg, reg; |
| 223 | resource = 0; |
| 224 | free_reg = 0; |
| 225 | for (reg = 0xc0; reg <= 0xd8; reg += 0x8) { |
| 226 | int result; |
| 227 | result = reg_useable(reg, dev, nodeid, link); |
| 228 | if (result == 1) { |
| 229 | /* I have been allocated this one */ |
| 230 | break; |
| 231 | } |
| 232 | else if (result > 1) { |
| 233 | /* I have a free register pair */ |
| 234 | free_reg = reg; |
| 235 | } |
| 236 | } |
| 237 | if (reg > 0xd8) { |
| 238 | reg = free_reg; // if no free, the free_reg still be 0 |
| 239 | } |
| 240 | |
| 241 | resource = new_resource(dev, IOINDEX(0x1000 + reg, link)); |
| 242 | |
| 243 | return resource; |
| 244 | } |
| 245 | |
| 246 | static struct resource *amdfam15_find_mempair(device_t dev, u32 nodeid, u32 link) |
| 247 | { |
| 248 | struct resource *resource; |
| 249 | u32 free_reg, reg; |
| 250 | resource = 0; |
| 251 | free_reg = 0; |
| 252 | for (reg = 0x80; reg <= 0xb8; reg += 0x8) { |
| 253 | int result; |
| 254 | result = reg_useable(reg, dev, nodeid, link); |
| 255 | if (result == 1) { |
| 256 | /* I have been allocated this one */ |
| 257 | break; |
| 258 | } |
| 259 | else if (result > 1) { |
| 260 | /* I have a free register pair */ |
| 261 | free_reg = reg; |
| 262 | } |
| 263 | } |
| 264 | if (reg > 0xb8) { |
| 265 | reg = free_reg; |
| 266 | } |
| 267 | |
| 268 | resource = new_resource(dev, IOINDEX(0x1000 + reg, link)); |
| 269 | return resource; |
| 270 | } |
| 271 | |
| 272 | static void amdfam15_link_read_bases(device_t dev, u32 nodeid, u32 link) |
| 273 | { |
| 274 | struct resource *resource; |
| 275 | |
| 276 | /* Initialize the io space constraints on the current bus */ |
| 277 | resource = amdfam15_find_iopair(dev, nodeid, link); |
| 278 | if (resource) { |
| 279 | u32 align; |
| 280 | align = log2(HT_IO_HOST_ALIGN); |
| 281 | resource->base = 0; |
| 282 | resource->size = 0; |
| 283 | resource->align = align; |
| 284 | resource->gran = align; |
| 285 | resource->limit = 0xffffUL; |
| 286 | resource->flags = IORESOURCE_IO | IORESOURCE_BRIDGE; |
| 287 | } |
| 288 | |
| 289 | /* Initialize the prefetchable memory constraints on the current bus */ |
| 290 | resource = amdfam15_find_mempair(dev, nodeid, link); |
| 291 | if (resource) { |
| 292 | resource->base = 0; |
| 293 | resource->size = 0; |
| 294 | resource->align = log2(HT_MEM_HOST_ALIGN); |
| 295 | resource->gran = log2(HT_MEM_HOST_ALIGN); |
| 296 | resource->limit = 0xffffffffffULL; |
| 297 | resource->flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; |
| 298 | resource->flags |= IORESOURCE_BRIDGE; |
| 299 | } |
| 300 | |
| 301 | /* Initialize the memory constraints on the current bus */ |
| 302 | resource = amdfam15_find_mempair(dev, nodeid, link); |
| 303 | if (resource) { |
| 304 | resource->base = 0; |
| 305 | resource->size = 0; |
| 306 | resource->align = log2(HT_MEM_HOST_ALIGN); |
| 307 | resource->gran = log2(HT_MEM_HOST_ALIGN); |
| 308 | resource->limit = 0xffffffffffULL; |
| 309 | resource->flags = IORESOURCE_MEM | IORESOURCE_BRIDGE; |
| 310 | } |
| 311 | |
| 312 | } |
| 313 | |
Steven Sherk | f434058 | 2013-01-29 16:13:35 -0700 | [diff] [blame] | 314 | static void nb_read_resources(device_t dev) |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 315 | { |
| 316 | u32 nodeid; |
| 317 | struct bus *link; |
| 318 | |
| 319 | nodeid = amdfam15_nodeid(dev); |
| 320 | for (link = dev->link_list; link; link = link->next) { |
| 321 | if (link->children) { |
| 322 | amdfam15_link_read_bases(dev, nodeid, link->link_num); |
| 323 | } |
| 324 | } |
Steven Sherk | 1cbabb0 | 2013-02-01 09:22:35 -0700 | [diff] [blame] | 325 | |
| 326 | /* |
Stefan Reinauer | 4aff445 | 2013-02-12 14:17:15 -0800 | [diff] [blame] | 327 | * This MMCONF resource must be reserved in the PCI domain. |
Steven Sherk | 1cbabb0 | 2013-02-01 09:22:35 -0700 | [diff] [blame] | 328 | * It is not honored by the coreboot resource allocator if it is in |
Stefan Reinauer | 0aa37c4 | 2013-02-12 15:20:54 -0800 | [diff] [blame] | 329 | * the CPU_CLUSTER. |
Steven Sherk | 1cbabb0 | 2013-02-01 09:22:35 -0700 | [diff] [blame] | 330 | */ |
Kyösti Mälkki | e25b5ef | 2016-12-02 08:56:05 +0200 | [diff] [blame] | 331 | mmconf_resource(dev, 0xc0010058); |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 332 | } |
| 333 | |
| 334 | static void set_resource(device_t dev, struct resource *resource, u32 nodeid) |
| 335 | { |
| 336 | resource_t rbase, rend; |
| 337 | unsigned reg, link_num; |
| 338 | char buf[50]; |
| 339 | |
| 340 | /* Make certain the resource has actually been set */ |
| 341 | if (!(resource->flags & IORESOURCE_ASSIGNED)) { |
| 342 | return; |
| 343 | } |
| 344 | |
| 345 | /* If I have already stored this resource don't worry about it */ |
| 346 | if (resource->flags & IORESOURCE_STORED) { |
| 347 | return; |
| 348 | } |
| 349 | |
| 350 | /* Only handle PCI memory and IO resources */ |
| 351 | if (!(resource->flags & (IORESOURCE_MEM | IORESOURCE_IO))) |
| 352 | return; |
| 353 | |
| 354 | /* Ensure I am actually looking at a resource of function 1 */ |
| 355 | if ((resource->index & 0xffff) < 0x1000) { |
| 356 | return; |
| 357 | } |
| 358 | /* Get the base address */ |
| 359 | rbase = resource->base; |
| 360 | |
| 361 | /* Get the limit (rounded up) */ |
| 362 | rend = resource_end(resource); |
| 363 | |
| 364 | /* Get the register and link */ |
| 365 | reg = resource->index & 0xfff; // 4k |
| 366 | link_num = IOINDEX_LINK(resource->index); |
| 367 | |
| 368 | if (resource->flags & IORESOURCE_IO) { |
| 369 | set_io_addr_reg(dev, nodeid, link_num, reg, rbase>>8, rend>>8); |
| 370 | } |
| 371 | else if (resource->flags & IORESOURCE_MEM) { |
Edward O'Callaghan | ae5fd34 | 2014-11-20 19:58:09 +1100 | [diff] [blame] | 372 | set_mmio_addr_reg(nodeid, link_num, reg, (resource->index >>24), rbase>>8, rend>>8, node_nums);// [39:8] |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 373 | } |
| 374 | resource->flags |= IORESOURCE_STORED; |
Elyes HAOUAS | 0d4b11a | 2016-10-03 21:57:21 +0200 | [diff] [blame] | 375 | snprintf(buf, sizeof(buf), " <node %x link %x>", |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 376 | nodeid, link_num); |
| 377 | report_resource_stored(dev, resource, buf); |
| 378 | } |
| 379 | |
| 380 | /** |
| 381 | * I tried to reuse the resource allocation code in set_resource() |
| 382 | * but it is too difficult to deal with the resource allocation magic. |
| 383 | */ |
| 384 | |
| 385 | static void create_vga_resource(device_t dev, unsigned nodeid) |
| 386 | { |
| 387 | struct bus *link; |
| 388 | |
| 389 | /* find out which link the VGA card is connected, |
| 390 | * we only deal with the 'first' vga card */ |
| 391 | for (link = dev->link_list; link; link = link->next) { |
| 392 | if (link->bridge_ctrl & PCI_BRIDGE_CTL_VGA) { |
Martin Roth | 77a58b9 | 2017-06-24 14:45:48 -0600 | [diff] [blame] | 393 | #if IS_ENABLED(CONFIG_MULTIPLE_VGA_ADAPTERS) |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 394 | extern device_t vga_pri; // the primary vga device, defined in device.c |
| 395 | printk(BIOS_DEBUG, "VGA: vga_pri bus num = %d bus range [%d,%d]\n", vga_pri->bus->secondary, |
| 396 | link->secondary,link->subordinate); |
| 397 | /* We need to make sure the vga_pri is under the link */ |
Elyes HAOUAS | 1d8daa6 | 2016-09-18 08:50:54 +0200 | [diff] [blame] | 398 | if ((vga_pri->bus->secondary >= link->secondary) && |
| 399 | (vga_pri->bus->secondary <= link->subordinate)) |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 400 | #endif |
| 401 | break; |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | /* no VGA card installed */ |
| 406 | if (link == NULL) |
| 407 | return; |
| 408 | |
| 409 | printk(BIOS_DEBUG, "VGA: %s (aka node %d) link %d has VGA device\n", dev_path(dev), nodeid, sblink); |
| 410 | set_vga_enable_reg(nodeid, sblink); |
| 411 | } |
| 412 | |
Steven Sherk | f434058 | 2013-01-29 16:13:35 -0700 | [diff] [blame] | 413 | static void nb_set_resources(device_t dev) |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 414 | { |
| 415 | unsigned nodeid; |
| 416 | struct bus *bus; |
| 417 | struct resource *res; |
| 418 | |
| 419 | /* Find the nodeid */ |
| 420 | nodeid = amdfam15_nodeid(dev); |
| 421 | |
| 422 | create_vga_resource(dev, nodeid); //TODO: do we need this? |
| 423 | |
| 424 | /* Set each resource we have found */ |
| 425 | for (res = dev->resource_list; res; res = res->next) { |
| 426 | set_resource(dev, res, nodeid); |
| 427 | } |
| 428 | |
| 429 | for (bus = dev->link_list; bus; bus = bus->next) { |
| 430 | if (bus->children) { |
| 431 | assign_resources(bus); |
| 432 | } |
| 433 | } |
| 434 | } |
| 435 | |
Vladimir Serbinenko | 807127f | 2014-11-09 13:36:18 +0100 | [diff] [blame] | 436 | |
| 437 | static unsigned long acpi_fill_hest(acpi_hest_t *hest) |
Vladimir Serbinenko | 56f46d8 | 2014-10-08 22:06:27 +0200 | [diff] [blame] | 438 | { |
| 439 | void *addr, *current; |
| 440 | |
| 441 | /* Skip the HEST header. */ |
| 442 | current = (void *)(hest + 1); |
| 443 | |
| 444 | addr = agesawrapper_getlateinitptr(PICK_WHEA_MCE); |
| 445 | if (addr != NULL) |
Stefan Reinauer | 77a1d1a | 2015-07-21 12:48:17 -0700 | [diff] [blame] | 446 | current += acpi_create_hest_error_source(hest, current, 0, |
| 447 | addr + 2, *(UINT16 *)addr - 2); |
Vladimir Serbinenko | 56f46d8 | 2014-10-08 22:06:27 +0200 | [diff] [blame] | 448 | |
| 449 | addr = agesawrapper_getlateinitptr(PICK_WHEA_CMC); |
| 450 | if (addr != NULL) |
Stefan Reinauer | 77a1d1a | 2015-07-21 12:48:17 -0700 | [diff] [blame] | 451 | current += acpi_create_hest_error_source(hest, current, 1, |
| 452 | addr + 2, *(UINT16 *)addr - 2); |
Vladimir Serbinenko | 56f46d8 | 2014-10-08 22:06:27 +0200 | [diff] [blame] | 453 | |
| 454 | return (unsigned long)current; |
| 455 | } |
| 456 | |
Alexander Couzens | 5eea458 | 2015-04-12 22:18:55 +0200 | [diff] [blame] | 457 | static void northbridge_fill_ssdt_generator(device_t device) |
Vladimir Serbinenko | 56f46d8 | 2014-10-08 22:06:27 +0200 | [diff] [blame] | 458 | { |
| 459 | msr_t msr; |
| 460 | char pscope[] = "\\_SB.PCI0"; |
| 461 | |
| 462 | acpigen_write_scope(pscope); |
| 463 | msr = rdmsr(TOP_MEM); |
| 464 | acpigen_write_name_dword("TOM1", msr.lo); |
| 465 | msr = rdmsr(TOP_MEM2); |
| 466 | /* |
| 467 | * Since XP only implements parts of ACPI 2.0, we can't use a qword |
| 468 | * here. |
| 469 | * See http://www.acpi.info/presentations/S01USMOBS169_OS%2520new.ppt |
| 470 | * slide 22ff. |
| 471 | * Shift value right by 20 bit to make it fit into 32bit, |
| 472 | * giving us 1MB granularity and a limit of almost 4Exabyte of memory. |
| 473 | */ |
| 474 | acpigen_write_name_dword("TOM2", (msr.hi << 12) | msr.lo >> 20); |
| 475 | acpigen_pop_len(); |
| 476 | } |
| 477 | |
Alexander Couzens | 83fc32f | 2015-04-12 22:28:37 +0200 | [diff] [blame] | 478 | static unsigned long agesa_write_acpi_tables(device_t device, |
| 479 | unsigned long current, |
Vladimir Serbinenko | 56f46d8 | 2014-10-08 22:06:27 +0200 | [diff] [blame] | 480 | acpi_rsdp_t *rsdp) |
| 481 | { |
| 482 | acpi_srat_t *srat; |
| 483 | acpi_slit_t *slit; |
| 484 | acpi_header_t *ssdt; |
| 485 | acpi_header_t *alib; |
| 486 | acpi_header_t *ivrs; |
| 487 | acpi_hest_t *hest; |
| 488 | |
| 489 | /* HEST */ |
| 490 | current = ALIGN(current, 8); |
| 491 | hest = (acpi_hest_t *)current; |
Vladimir Serbinenko | 807127f | 2014-11-09 13:36:18 +0100 | [diff] [blame] | 492 | acpi_write_hest((void *)current, acpi_fill_hest); |
Vladimir Serbinenko | 56f46d8 | 2014-10-08 22:06:27 +0200 | [diff] [blame] | 493 | acpi_add_table(rsdp, (void *)current); |
| 494 | current += ((acpi_header_t *)current)->length; |
| 495 | |
| 496 | current = ALIGN(current, 8); |
| 497 | printk(BIOS_DEBUG, "ACPI: * IVRS at %lx\n", current); |
| 498 | ivrs = agesawrapper_getlateinitptr(PICK_IVRS); |
| 499 | if (ivrs != NULL) { |
| 500 | memcpy((void *)current, ivrs, ivrs->length); |
| 501 | ivrs = (acpi_header_t *) current; |
| 502 | current += ivrs->length; |
| 503 | acpi_add_table(rsdp, ivrs); |
| 504 | } else { |
| 505 | printk(BIOS_DEBUG, " AGESA IVRS table NULL. Skipping.\n"); |
| 506 | } |
| 507 | |
| 508 | /* SRAT */ |
| 509 | current = ALIGN(current, 8); |
| 510 | printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current); |
| 511 | srat = (acpi_srat_t *) agesawrapper_getlateinitptr (PICK_SRAT); |
| 512 | if (srat != NULL) { |
| 513 | memcpy((void *)current, srat, srat->header.length); |
| 514 | srat = (acpi_srat_t *) current; |
| 515 | current += srat->header.length; |
| 516 | acpi_add_table(rsdp, srat); |
| 517 | } else { |
| 518 | printk(BIOS_DEBUG, " AGESA SRAT table NULL. Skipping.\n"); |
| 519 | } |
| 520 | |
| 521 | /* SLIT */ |
| 522 | current = ALIGN(current, 8); |
| 523 | printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current); |
| 524 | slit = (acpi_slit_t *) agesawrapper_getlateinitptr (PICK_SLIT); |
| 525 | if (slit != NULL) { |
| 526 | memcpy((void *)current, slit, slit->header.length); |
| 527 | slit = (acpi_slit_t *) current; |
| 528 | current += slit->header.length; |
| 529 | acpi_add_table(rsdp, slit); |
| 530 | } else { |
| 531 | printk(BIOS_DEBUG, " AGESA SLIT table NULL. Skipping.\n"); |
| 532 | } |
| 533 | |
| 534 | /* ALIB */ |
| 535 | current = ALIGN(current, 16); |
| 536 | printk(BIOS_DEBUG, "ACPI: * AGESA ALIB SSDT at %lx\n", current); |
| 537 | alib = (acpi_header_t *)agesawrapper_getlateinitptr (PICK_ALIB); |
| 538 | if (alib != NULL) { |
| 539 | memcpy((void *)current, alib, alib->length); |
| 540 | alib = (acpi_header_t *) current; |
| 541 | current += alib->length; |
| 542 | acpi_add_table(rsdp, (void *)alib); |
| 543 | } |
| 544 | else { |
| 545 | printk(BIOS_DEBUG, " AGESA ALIB SSDT table NULL. Skipping.\n"); |
| 546 | } |
| 547 | |
| 548 | /* this pstate ssdt may cause Blue Screen: Fixed: Keep this comment for a while. */ |
| 549 | /* SSDT */ |
| 550 | current = ALIGN(current, 16); |
| 551 | printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current); |
| 552 | ssdt = (acpi_header_t *)agesawrapper_getlateinitptr (PICK_PSTATE); |
| 553 | if (ssdt != NULL) { |
| 554 | memcpy((void *)current, ssdt, ssdt->length); |
| 555 | ssdt = (acpi_header_t *) current; |
| 556 | current += ssdt->length; |
| 557 | } |
| 558 | else { |
| 559 | printk(BIOS_DEBUG, " AGESA PState table NULL. Skipping.\n"); |
| 560 | } |
| 561 | acpi_add_table(rsdp,ssdt); |
| 562 | |
| 563 | printk(BIOS_DEBUG, "ACPI: * SSDT for PState at %lx\n", current); |
| 564 | |
| 565 | return current; |
| 566 | } |
| 567 | |
| 568 | |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 569 | static struct device_operations northbridge_operations = { |
Steven Sherk | f434058 | 2013-01-29 16:13:35 -0700 | [diff] [blame] | 570 | .read_resources = nb_read_resources, |
| 571 | .set_resources = nb_set_resources, |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 572 | .enable_resources = pci_dev_enable_resources, |
Edward O'Callaghan | d994ef1 | 2014-11-21 02:22:33 +1100 | [diff] [blame] | 573 | .init = DEVICE_NOOP, |
Vladimir Serbinenko | 56f46d8 | 2014-10-08 22:06:27 +0200 | [diff] [blame] | 574 | .acpi_fill_ssdt_generator = northbridge_fill_ssdt_generator, |
| 575 | .write_acpi_tables = agesa_write_acpi_tables, |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 576 | .enable = 0, |
| 577 | .ops_pci = 0, |
| 578 | }; |
| 579 | |
| 580 | static const struct pci_driver family15_northbridge __pci_driver = { |
| 581 | .ops = &northbridge_operations, |
| 582 | .vendor = PCI_VENDOR_ID_AMD, |
Marshall Dawson | 463f46e | 2016-10-14 20:46:08 -0600 | [diff] [blame] | 583 | .device = PCI_DEVICE_ID_AMD_15H_MODEL_101F_NB_HT, |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 584 | }; |
| 585 | |
| 586 | static const struct pci_driver family10_northbridge __pci_driver = { |
| 587 | .ops = &northbridge_operations, |
| 588 | .vendor = PCI_VENDOR_ID_AMD, |
| 589 | .device = PCI_DEVICE_ID_AMD_10H_NB_HT, |
| 590 | }; |
| 591 | |
| 592 | struct chip_operations northbridge_amd_agesa_family15tn_ops = { |
| 593 | CHIP_NAME("AMD FAM15 Northbridge") |
| 594 | .enable_dev = 0, |
| 595 | }; |
| 596 | |
| 597 | static void domain_read_resources(device_t dev) |
| 598 | { |
| 599 | unsigned reg; |
| 600 | |
| 601 | /* Find the already assigned resource pairs */ |
| 602 | get_fx_devs(); |
| 603 | for (reg = 0x80; reg <= 0xd8; reg+= 0x08) { |
| 604 | u32 base, limit; |
| 605 | base = f1_read_config32(reg); |
| 606 | limit = f1_read_config32(reg + 0x04); |
| 607 | /* Is this register allocated? */ |
| 608 | if ((base & 3) != 0) { |
| 609 | unsigned nodeid, reg_link; |
| 610 | device_t reg_dev; |
Elyes HAOUAS | 1d8daa6 | 2016-09-18 08:50:54 +0200 | [diff] [blame] | 611 | if (reg < 0xc0) { // mmio |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 612 | nodeid = (limit & 0xf) + (base&0x30); |
| 613 | } else { // io |
| 614 | nodeid = (limit & 0xf) + ((base>>4)&0x30); |
| 615 | } |
| 616 | reg_link = (limit >> 4) & 7; |
| 617 | reg_dev = __f0_dev[nodeid]; |
| 618 | if (reg_dev) { |
| 619 | /* Reserve the resource */ |
| 620 | struct resource *res; |
| 621 | res = new_resource(reg_dev, IOINDEX(0x1000 + reg, reg_link)); |
| 622 | if (res) { |
| 623 | res->flags = 1; |
| 624 | } |
| 625 | } |
| 626 | } |
| 627 | } |
| 628 | /* FIXME: do we need to check extend conf space? |
| 629 | I don't believe that much preset value */ |
| 630 | |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 631 | pci_domain_read_resources(dev); |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 632 | } |
| 633 | |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 634 | static void domain_enable_resources(device_t dev) |
| 635 | { |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 636 | #if IS_ENABLED(CONFIG_AGESA_LEGACY_WRAPPER) |
Kyösti Mälkki | 8ae16a4 | 2014-06-19 20:44:34 +0300 | [diff] [blame] | 637 | if (acpi_is_wakeup_s3()) |
Kyösti Mälkki | 1aa35c6 | 2014-10-21 14:19:04 +0300 | [diff] [blame] | 638 | agesawrapper_fchs3laterestore(); |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 639 | |
| 640 | /* Must be called after PCI enumeration and resource allocation */ |
Kyösti Mälkki | b139b5e | 2014-10-20 07:41:20 +0300 | [diff] [blame] | 641 | if (!acpi_is_wakeup_s3()) { |
| 642 | /* Enable MMIO on AMD CPU Address Map Controller */ |
Kyösti Mälkki | 48518f0 | 2014-11-25 14:20:57 +0200 | [diff] [blame] | 643 | amd_initcpuio(); |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 644 | |
Kyösti Mälkki | 1aa35c6 | 2014-10-21 14:19:04 +0300 | [diff] [blame] | 645 | agesawrapper_amdinitmid(); |
Kyösti Mälkki | b139b5e | 2014-10-20 07:41:20 +0300 | [diff] [blame] | 646 | } |
Mike Loptien | e133aab | 2013-01-30 16:00:43 -0700 | [diff] [blame] | 647 | printk(BIOS_DEBUG, " ader - leaving %s.\n", __func__); |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 648 | #endif |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 649 | } |
| 650 | |
| 651 | #if CONFIG_HW_MEM_HOLE_SIZEK != 0 |
| 652 | struct hw_mem_hole_info { |
| 653 | unsigned hole_startk; |
| 654 | int node_id; |
| 655 | }; |
| 656 | static struct hw_mem_hole_info get_hw_mem_hole_info(void) |
| 657 | { |
| 658 | struct hw_mem_hole_info mem_hole; |
| 659 | int i; |
| 660 | mem_hole.hole_startk = CONFIG_HW_MEM_HOLE_SIZEK; |
| 661 | mem_hole.node_id = -1; |
| 662 | for (i = 0; i < node_nums; i++) { |
| 663 | dram_base_mask_t d; |
| 664 | u32 hole; |
| 665 | d = get_dram_base_mask(i); |
| 666 | if (!(d.mask & 1)) continue; // no memory on this node |
| 667 | hole = pci_read_config32(__f1_dev[i], 0xf0); |
| 668 | if (hole & 1) { // we find the hole |
Elyes HAOUAS | 27e1801 | 2017-06-27 23:14:51 +0200 | [diff] [blame] | 669 | mem_hole.hole_startk = (hole & (0xff << 24)) >> 10; |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 670 | mem_hole.node_id = i; // record the node No with hole |
| 671 | break; // only one hole |
| 672 | } |
| 673 | } |
Kyösti Mälkki | 2f9b3af | 2014-06-26 05:30:54 +0300 | [diff] [blame] | 674 | |
| 675 | /* We need to double check if there is special set on base reg and limit reg |
| 676 | * are not continuous instead of hole, it will find out its hole_startk. |
| 677 | */ |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 678 | if (mem_hole.node_id == -1) { |
| 679 | resource_t limitk_pri = 0; |
Elyes HAOUAS | 1d8daa6 | 2016-09-18 08:50:54 +0200 | [diff] [blame] | 680 | for (i = 0; i < node_nums; i++) { |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 681 | dram_base_mask_t d; |
| 682 | resource_t base_k, limit_k; |
| 683 | d = get_dram_base_mask(i); |
| 684 | if (!(d.base & 1)) continue; |
| 685 | base_k = ((resource_t)(d.base & 0x1fffff00)) <<9; |
| 686 | if (base_k > 4 *1024 * 1024) break; // don't need to go to check |
| 687 | if (limitk_pri != base_k) { // we find the hole |
| 688 | mem_hole.hole_startk = (unsigned)limitk_pri; // must beblow 4G |
| 689 | mem_hole.node_id = i; |
| 690 | break; //only one hole |
| 691 | } |
zbao | 15dc3cc | 2012-08-03 15:56:21 +0800 | [diff] [blame] | 692 | limit_k = ((resource_t)(((d.mask & ~1) + 0x000FF) & 0x1fffff00)) << 9; |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 693 | limitk_pri = limit_k; |
| 694 | } |
| 695 | } |
| 696 | return mem_hole; |
| 697 | } |
| 698 | #endif |
| 699 | |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 700 | static void domain_set_resources(device_t dev) |
| 701 | { |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 702 | unsigned long mmio_basek; |
| 703 | u32 pci_tolm; |
| 704 | int i, idx; |
| 705 | struct bus *link; |
| 706 | #if CONFIG_HW_MEM_HOLE_SIZEK != 0 |
| 707 | struct hw_mem_hole_info mem_hole; |
| 708 | u32 reset_memhole = 1; |
| 709 | #endif |
| 710 | |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 711 | pci_tolm = 0xffffffffUL; |
| 712 | for (link = dev->link_list; link; link = link->next) { |
| 713 | pci_tolm = find_pci_tolm(link); |
| 714 | } |
| 715 | |
| 716 | // FIXME handle interleaved nodes. If you fix this here, please fix |
| 717 | // amdk8, too. |
| 718 | mmio_basek = pci_tolm >> 10; |
| 719 | /* Round mmio_basek to something the processor can support */ |
| 720 | mmio_basek &= ~((1 << 6) -1); |
| 721 | |
| 722 | // FIXME improve mtrr.c so we don't use up all of the mtrrs with a 64M |
| 723 | // MMIO hole. If you fix this here, please fix amdk8, too. |
| 724 | /* Round the mmio hole to 64M */ |
| 725 | mmio_basek &= ~((64*1024) - 1); |
| 726 | |
| 727 | #if CONFIG_HW_MEM_HOLE_SIZEK != 0 |
| 728 | /* if the hw mem hole is already set in raminit stage, here we will compare |
| 729 | * mmio_basek and hole_basek. if mmio_basek is bigger that hole_basek and will |
| 730 | * use hole_basek as mmio_basek and we don't need to reset hole. |
| 731 | * otherwise We reset the hole to the mmio_basek |
| 732 | */ |
| 733 | |
| 734 | mem_hole = get_hw_mem_hole_info(); |
| 735 | |
| 736 | // Use hole_basek as mmio_basek, and we don't need to reset hole anymore |
| 737 | if ((mem_hole.node_id != -1) && (mmio_basek > mem_hole.hole_startk)) { |
| 738 | mmio_basek = mem_hole.hole_startk; |
| 739 | reset_memhole = 0; |
| 740 | } |
| 741 | #endif |
| 742 | |
| 743 | idx = 0x10; |
| 744 | for (i = 0; i < node_nums; i++) { |
| 745 | dram_base_mask_t d; |
| 746 | resource_t basek, limitk, sizek; // 4 1T |
| 747 | |
| 748 | d = get_dram_base_mask(i); |
| 749 | |
| 750 | if (!(d.mask & 1)) continue; |
| 751 | basek = ((resource_t)(d.base & 0x1fffff00)) << 9; // could overflow, we may lost 6 bit here |
Edward O'Callaghan | ae5fd34 | 2014-11-20 19:58:09 +1100 | [diff] [blame] | 752 | limitk = ((resource_t)(((d.mask & ~1) + 0x000FF) & 0x1fffff00)) << 9; |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 753 | |
| 754 | sizek = limitk - basek; |
| 755 | |
| 756 | /* see if we need a hole from 0xa0000 to 0xbffff */ |
| 757 | if ((basek < ((8*64)+(8*16))) && (sizek > ((8*64)+(16*16)))) { |
| 758 | ram_resource(dev, (idx | i), basek, ((8*64)+(8*16)) - basek); |
| 759 | idx += 0x10; |
| 760 | basek = (8*64)+(16*16); |
| 761 | sizek = limitk - ((8*64)+(16*16)); |
| 762 | |
| 763 | } |
| 764 | |
Kyösti Mälkki | 26c6543 | 2014-06-26 05:30:54 +0300 | [diff] [blame] | 765 | /* split the region to accommodate pci memory space */ |
Elyes HAOUAS | 1d8daa6 | 2016-09-18 08:50:54 +0200 | [diff] [blame] | 766 | if ((basek < 4*1024*1024) && (limitk > mmio_basek)) { |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 767 | if (basek <= mmio_basek) { |
| 768 | unsigned pre_sizek; |
| 769 | pre_sizek = mmio_basek - basek; |
Elyes HAOUAS | 1d8daa6 | 2016-09-18 08:50:54 +0200 | [diff] [blame] | 770 | if (pre_sizek > 0) { |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 771 | ram_resource(dev, (idx | i), basek, pre_sizek); |
| 772 | idx += 0x10; |
| 773 | sizek -= pre_sizek; |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 774 | } |
| 775 | basek = mmio_basek; |
| 776 | } |
| 777 | if ((basek + sizek) <= 4*1024*1024) { |
| 778 | sizek = 0; |
| 779 | } |
| 780 | else { |
Siyuan Wang | 29840e2 | 2013-06-04 19:56:22 +0800 | [diff] [blame] | 781 | uint64_t topmem2 = bsp_topmem2(); |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 782 | basek = 4*1024*1024; |
Siyuan Wang | 29840e2 | 2013-06-04 19:56:22 +0800 | [diff] [blame] | 783 | sizek = topmem2/1024 - basek; |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 784 | } |
| 785 | } |
| 786 | |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 787 | ram_resource(dev, (idx | i), basek, sizek); |
| 788 | idx += 0x10; |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 789 | printk(BIOS_DEBUG, "node %d: mmio_basek=%08lx, basek=%08llx, limitk=%08llx\n", |
| 790 | i, mmio_basek, basek, limitk); |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 791 | } |
| 792 | |
Kyösti Mälkki | 61be360 | 2017-04-15 20:07:53 +0300 | [diff] [blame] | 793 | add_uma_resource_below_tolm(dev, 7); |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 794 | |
Elyes HAOUAS | 5a7e72f | 2016-08-23 21:36:02 +0200 | [diff] [blame] | 795 | for (link = dev->link_list; link; link = link->next) { |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 796 | if (link->children) { |
| 797 | assign_resources(link); |
| 798 | } |
| 799 | } |
| 800 | } |
| 801 | |
| 802 | static struct device_operations pci_domain_ops = { |
| 803 | .read_resources = domain_read_resources, |
| 804 | .set_resources = domain_set_resources, |
| 805 | .enable_resources = domain_enable_resources, |
Edward O'Callaghan | e9e1d7a | 2015-01-02 15:11:49 +1100 | [diff] [blame] | 806 | .init = DEVICE_NOOP, |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 807 | .scan_bus = pci_domain_scan_bus, |
Kyösti Mälkki | 872c922 | 2013-07-03 09:44:28 +0300 | [diff] [blame] | 808 | .ops_pci_bus = pci_bus_default_ops, |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 809 | }; |
| 810 | |
| 811 | static void sysconf_init(device_t dev) // first node |
| 812 | { |
| 813 | sblink = (pci_read_config32(dev, 0x64)>>8) & 7; // don't forget sublink1 |
| 814 | node_nums = ((pci_read_config32(dev, 0x60)>>4) & 7) + 1; //NodeCnt[2:0] |
| 815 | } |
| 816 | |
| 817 | static void add_more_links(device_t dev, unsigned total_links) |
| 818 | { |
| 819 | struct bus *link, *last = NULL; |
| 820 | int link_num; |
| 821 | |
| 822 | for (link = dev->link_list; link; link = link->next) |
| 823 | last = link; |
| 824 | |
| 825 | if (last) { |
| 826 | int links = total_links - last->link_num; |
| 827 | link_num = last->link_num; |
| 828 | if (links > 0) { |
| 829 | link = malloc(links*sizeof(*link)); |
| 830 | if (!link) |
| 831 | die("Couldn't allocate more links!\n"); |
| 832 | memset(link, 0, links*sizeof(*link)); |
| 833 | last->next = link; |
| 834 | } |
| 835 | } |
| 836 | else { |
| 837 | link_num = -1; |
| 838 | link = malloc(total_links*sizeof(*link)); |
| 839 | memset(link, 0, total_links*sizeof(*link)); |
| 840 | dev->link_list = link; |
| 841 | } |
| 842 | |
| 843 | for (link_num = link_num + 1; link_num < total_links; link_num++) { |
| 844 | link->link_num = link_num; |
| 845 | link->dev = dev; |
| 846 | link->next = link + 1; |
| 847 | last = link; |
| 848 | link = link->next; |
| 849 | } |
| 850 | last->next = NULL; |
| 851 | } |
| 852 | |
Kyösti Mälkki | 580e722 | 2015-03-19 21:04:23 +0200 | [diff] [blame] | 853 | static void cpu_bus_scan(device_t dev) |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 854 | { |
| 855 | struct bus *cpu_bus; |
| 856 | device_t dev_mc; |
| 857 | #if CONFIG_CBB |
| 858 | device_t pci_domain; |
| 859 | #endif |
| 860 | int i,j; |
| 861 | int coreid_bits; |
| 862 | int core_max = 0; |
| 863 | unsigned ApicIdCoreIdSize; |
| 864 | unsigned core_nums; |
| 865 | int siblings = 0; |
| 866 | unsigned int family; |
| 867 | |
| 868 | #if CONFIG_CBB |
| 869 | dev_mc = dev_find_slot(0, PCI_DEVFN(CONFIG_CDB, 0)); //0x00 |
| 870 | if (dev_mc && dev_mc->bus) { |
| 871 | printk(BIOS_DEBUG, "%s found", dev_path(dev_mc)); |
| 872 | pci_domain = dev_mc->bus->dev; |
Stefan Reinauer | 4aff445 | 2013-02-12 14:17:15 -0800 | [diff] [blame] | 873 | if (pci_domain && (pci_domain->path.type == DEVICE_PATH_DOMAIN)) { |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 874 | printk(BIOS_DEBUG, "\n%s move to ",dev_path(dev_mc)); |
| 875 | dev_mc->bus->secondary = CONFIG_CBB; // move to 0xff |
| 876 | printk(BIOS_DEBUG, "%s",dev_path(dev_mc)); |
| 877 | } else { |
| 878 | printk(BIOS_DEBUG, " but it is not under pci_domain directly "); |
| 879 | } |
| 880 | printk(BIOS_DEBUG, "\n"); |
| 881 | } |
| 882 | dev_mc = dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB, 0)); |
| 883 | if (!dev_mc) { |
| 884 | dev_mc = dev_find_slot(0, PCI_DEVFN(0x18, 0)); |
| 885 | if (dev_mc && dev_mc->bus) { |
| 886 | printk(BIOS_DEBUG, "%s found\n", dev_path(dev_mc)); |
| 887 | pci_domain = dev_mc->bus->dev; |
Stefan Reinauer | 4aff445 | 2013-02-12 14:17:15 -0800 | [diff] [blame] | 888 | if (pci_domain && (pci_domain->path.type == DEVICE_PATH_DOMAIN)) { |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 889 | if ((pci_domain->link_list) && (pci_domain->link_list->children == dev_mc)) { |
| 890 | printk(BIOS_DEBUG, "%s move to ",dev_path(dev_mc)); |
| 891 | dev_mc->bus->secondary = CONFIG_CBB; // move to 0xff |
| 892 | printk(BIOS_DEBUG, "%s\n",dev_path(dev_mc)); |
| 893 | while (dev_mc) { |
| 894 | printk(BIOS_DEBUG, "%s move to ",dev_path(dev_mc)); |
| 895 | dev_mc->path.pci.devfn -= PCI_DEVFN(0x18,0); |
| 896 | printk(BIOS_DEBUG, "%s\n",dev_path(dev_mc)); |
| 897 | dev_mc = dev_mc->sibling; |
| 898 | } |
| 899 | } |
| 900 | } |
| 901 | } |
| 902 | } |
| 903 | #endif |
| 904 | dev_mc = dev_find_slot(CONFIG_CBB, PCI_DEVFN(CONFIG_CDB, 0)); |
| 905 | if (!dev_mc) { |
| 906 | printk(BIOS_ERR, "%02x:%02x.0 not found", CONFIG_CBB, CONFIG_CDB); |
| 907 | die(""); |
| 908 | } |
| 909 | sysconf_init(dev_mc); |
| 910 | #if CONFIG_CBB && (MAX_NODE_NUMS > 32) |
Elyes HAOUAS | 1d8daa6 | 2016-09-18 08:50:54 +0200 | [diff] [blame] | 911 | if (node_nums > 32) { // need to put node 32 to node 63 to bus 0xfe |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 912 | if (pci_domain->link_list && !pci_domain->link_list->next) { |
| 913 | struct bus *new_link = new_link(pci_domain); |
| 914 | pci_domain->link_list->next = new_link; |
| 915 | new_link->link_num = 1; |
| 916 | new_link->dev = pci_domain; |
| 917 | new_link->children = 0; |
| 918 | printk(BIOS_DEBUG, "%s links now 2\n", dev_path(pci_domain)); |
| 919 | } |
| 920 | pci_domain->link_list->next->secondary = CONFIG_CBB - 1; |
| 921 | } |
| 922 | #endif |
| 923 | |
| 924 | /* Get Max Number of cores(MNC) */ |
| 925 | coreid_bits = (cpuid_ecx(AMD_CPUID_ASIZE_PCCOUNT) & 0x0000F000) >> 12; |
| 926 | core_max = 1 << (coreid_bits & 0x000F); //mnc |
| 927 | |
| 928 | ApicIdCoreIdSize = ((cpuid_ecx(0x80000008)>>12) & 0xF); |
| 929 | if (ApicIdCoreIdSize) { |
| 930 | core_nums = (1 << ApicIdCoreIdSize) - 1; |
| 931 | } else { |
| 932 | core_nums = 3; //quad core |
| 933 | } |
| 934 | |
| 935 | /* Find which cpus are present */ |
| 936 | cpu_bus = dev->link_list; |
| 937 | for (i = 0; i < node_nums; i++) { |
Kyösti Mälkki | cd9fc1a | 2012-07-06 19:02:56 +0300 | [diff] [blame] | 938 | device_t cdb_dev; |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 939 | unsigned busn, devn; |
| 940 | struct bus *pbus; |
| 941 | |
| 942 | busn = CONFIG_CBB; |
| 943 | devn = CONFIG_CDB + i; |
| 944 | pbus = dev_mc->bus; |
| 945 | #if CONFIG_CBB && (MAX_NODE_NUMS > 32) |
| 946 | if (i >= 32) { |
| 947 | busn--; |
| 948 | devn -= 32; |
| 949 | pbus = pci_domain->link_list->next; |
| 950 | } |
| 951 | #endif |
| 952 | |
| 953 | /* Find the cpu's pci device */ |
| 954 | cdb_dev = dev_find_slot(busn, PCI_DEVFN(devn, 0)); |
| 955 | if (!cdb_dev) { |
| 956 | /* If I am probing things in a weird order |
| 957 | * ensure all of the cpu's pci devices are found. |
| 958 | */ |
| 959 | int fn; |
Elyes HAOUAS | 5a7e72f | 2016-08-23 21:36:02 +0200 | [diff] [blame] | 960 | for (fn = 0; fn <= 5; fn++) { //FBDIMM? |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 961 | cdb_dev = pci_probe_dev(NULL, pbus, |
| 962 | PCI_DEVFN(devn, fn)); |
| 963 | } |
| 964 | cdb_dev = dev_find_slot(busn, PCI_DEVFN(devn, 0)); |
| 965 | } else { |
| 966 | /* Ok, We need to set the links for that device. |
| 967 | * otherwise the device under it will not be scanned |
| 968 | */ |
Kyösti Mälkki | 2a2d613 | 2015-02-04 13:25:37 +0200 | [diff] [blame] | 969 | add_more_links(cdb_dev, 4); |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 970 | } |
| 971 | |
| 972 | family = cpuid_eax(1); |
| 973 | family = (family >> 20) & 0xFF; |
| 974 | if (family == 1) { //f10 |
| 975 | u32 dword; |
| 976 | cdb_dev = dev_find_slot(busn, PCI_DEVFN(devn, 3)); |
| 977 | dword = pci_read_config32(cdb_dev, 0xe8); |
| 978 | siblings = ((dword & BIT15) >> 13) | ((dword & (BIT13 | BIT12)) >> 12); |
| 979 | } else if (family == 6) {//f15 |
| 980 | cdb_dev = dev_find_slot(busn, PCI_DEVFN(devn, 5)); |
| 981 | if (cdb_dev && cdb_dev->enabled) { |
| 982 | siblings = pci_read_config32(cdb_dev, 0x84); |
| 983 | siblings &= 0xFF; |
| 984 | } |
| 985 | } else { |
| 986 | siblings = 0; //default one core |
| 987 | } |
Kyösti Mälkki | cd9fc1a | 2012-07-06 19:02:56 +0300 | [diff] [blame] | 988 | int enable_node = cdb_dev && cdb_dev->enabled; |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 989 | printk(BIOS_SPEW, "%s family%xh, core_max=0x%x, core_nums=0x%x, siblings=0x%x\n", |
| 990 | dev_path(cdb_dev), 0x0f + family, core_max, core_nums, siblings); |
| 991 | |
Elyes HAOUAS | 1d8daa6 | 2016-09-18 08:50:54 +0200 | [diff] [blame] | 992 | for (j = 0; j <= siblings; j++) { |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 993 | extern CONST OPTIONS_CONFIG_TOPOLOGY ROMDATA TopologyConfiguration; |
| 994 | u32 modules = TopologyConfiguration.PlatformNumberOfModules; |
| 995 | u32 lapicid_start = 0; |
| 996 | |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 997 | /* |
| 998 | * APIC ID calucation is tightly coupled with AGESA v5 code. |
| 999 | * This calculation MUST match the assignment calculation done |
| 1000 | * in LocalApicInitializationAtEarly() function. |
| 1001 | * And reference GetLocalApicIdForCore() |
| 1002 | * |
| 1003 | * Apply apic enumeration rules |
| 1004 | * For systems with >= 16 APICs, put the IO-APICs at 0..n and |
| 1005 | * put the local-APICs at m..z |
| 1006 | * |
| 1007 | * This is needed because many IO-APIC devices only have 4 bits |
| 1008 | * for their APIC id and therefore must reside at 0..15 |
Elyes HAOUAS | 6e8b3c1 | 2016-09-02 19:22:00 +0200 | [diff] [blame] | 1009 | */ |
Kyösti Mälkki | 5003632 | 2016-05-18 13:35:21 +0300 | [diff] [blame] | 1010 | |
Elyes HAOUAS | 6e8b3c1 | 2016-09-02 19:22:00 +0200 | [diff] [blame] | 1011 | u8 plat_num_io_apics = 3; /* FIXME */ |
Kyösti Mälkki | 5003632 | 2016-05-18 13:35:21 +0300 | [diff] [blame] | 1012 | |
| 1013 | if ((node_nums * core_max) + plat_num_io_apics >= 0x10) { |
| 1014 | lapicid_start = (plat_num_io_apics - 1) / core_max; |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 1015 | lapicid_start = (lapicid_start + 1) * core_max; |
| 1016 | printk(BIOS_SPEW, "lpaicid_start=0x%x ", lapicid_start); |
| 1017 | } |
Kyösti Mälkki | c33f1e9 | 2012-08-07 17:12:11 +0300 | [diff] [blame] | 1018 | u32 apic_id = (lapicid_start * (i/modules + 1)) + ((i % modules) ? (j + (siblings + 1)) : j); |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 1019 | printk(BIOS_SPEW, "node 0x%x core 0x%x apicid=0x%x\n", |
Kyösti Mälkki | c33f1e9 | 2012-08-07 17:12:11 +0300 | [diff] [blame] | 1020 | i, j, apic_id); |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 1021 | |
Kyösti Mälkki | c33f1e9 | 2012-08-07 17:12:11 +0300 | [diff] [blame] | 1022 | device_t cpu = add_cpu_device(cpu_bus, apic_id, enable_node); |
| 1023 | if (cpu) |
| 1024 | amd_cpu_topology(cpu, i, j); |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 1025 | } //j |
| 1026 | } |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 1027 | } |
| 1028 | |
| 1029 | static void cpu_bus_init(device_t dev) |
| 1030 | { |
| 1031 | initialize_cpus(dev->link_list); |
| 1032 | } |
| 1033 | |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 1034 | static struct device_operations cpu_bus_ops = { |
Edward O'Callaghan | 2837ab2 | 2014-11-06 08:57:40 +1100 | [diff] [blame] | 1035 | .read_resources = DEVICE_NOOP, |
| 1036 | .set_resources = DEVICE_NOOP, |
Edward O'Callaghan | 812d2a4 | 2014-10-31 08:17:23 +1100 | [diff] [blame] | 1037 | .enable_resources = DEVICE_NOOP, |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 1038 | .init = cpu_bus_init, |
| 1039 | .scan_bus = cpu_bus_scan, |
| 1040 | }; |
| 1041 | |
| 1042 | static void root_complex_enable_dev(struct device *dev) |
| 1043 | { |
Kyösti Mälkki | 87213b6 | 2012-08-27 20:00:33 +0300 | [diff] [blame] | 1044 | static int done = 0; |
| 1045 | |
Kyösti Mälkki | 87213b6 | 2012-08-27 20:00:33 +0300 | [diff] [blame] | 1046 | if (!done) { |
| 1047 | setup_bsp_ramtop(); |
Kyösti Mälkki | 87213b6 | 2012-08-27 20:00:33 +0300 | [diff] [blame] | 1048 | done = 1; |
| 1049 | } |
| 1050 | |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 1051 | /* Set the operations if it is a special bus type */ |
Stefan Reinauer | 4aff445 | 2013-02-12 14:17:15 -0800 | [diff] [blame] | 1052 | if (dev->path.type == DEVICE_PATH_DOMAIN) { |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 1053 | dev->ops = &pci_domain_ops; |
Stefan Reinauer | 0aa37c4 | 2013-02-12 15:20:54 -0800 | [diff] [blame] | 1054 | } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 1055 | dev->ops = &cpu_bus_ops; |
| 1056 | } |
| 1057 | } |
| 1058 | |
| 1059 | struct chip_operations northbridge_amd_agesa_family15tn_root_complex_ops = { |
Edward O'Callaghan | ae5fd34 | 2014-11-20 19:58:09 +1100 | [diff] [blame] | 1060 | CHIP_NAME("AMD FAM15tn Root Complex") |
zbao | 2c08f6a | 2012-07-02 15:32:58 +0800 | [diff] [blame] | 1061 | .enable_dev = root_complex_enable_dev, |
| 1062 | }; |
Dave Frodin | cbf3d40 | 2012-12-05 08:20:12 -0700 | [diff] [blame] | 1063 | |
Edward O'Callaghan | ae5fd34 | 2014-11-20 19:58:09 +1100 | [diff] [blame] | 1064 | /********************************************************************* |
| 1065 | * Change the vendor / device IDs to match the generic VBIOS header. * |
| 1066 | *********************************************************************/ |
Dave Frodin | cbf3d40 | 2012-12-05 08:20:12 -0700 | [diff] [blame] | 1067 | u32 map_oprom_vendev(u32 vendev) |
| 1068 | { |
Edward O'Callaghan | ae5fd34 | 2014-11-20 19:58:09 +1100 | [diff] [blame] | 1069 | u32 new_vendev = vendev; |
Dave Frodin | cbf3d40 | 2012-12-05 08:20:12 -0700 | [diff] [blame] | 1070 | |
| 1071 | switch(vendev) { |
Bruce Griffith | 42e11f5 | 2013-07-08 18:19:08 -0600 | [diff] [blame] | 1072 | case 0x10029900: /* AMD Radeon HD 7660G (Trinity) */ |
| 1073 | case 0x10029901: /* AMD Radeon HD 7660D (Trinity) */ |
| 1074 | case 0x10029903: /* AMD Radeon HD 7640G (Trinity) */ |
| 1075 | case 0x10029904: /* AMD Radeon HD 7560D (Trinity) */ |
| 1076 | case 0x10029907: /* AMD Radeon HD 7620G (Trinity) */ |
| 1077 | case 0x10029908: /* AMD Radeon HD 7600G (Trinity) */ |
| 1078 | case 0x1002990A: /* AMD Radeon HD 7500G (Trinity) */ |
| 1079 | case 0x1002990B: /* AMD Radeon HD 8650G (Richland) */ |
| 1080 | case 0x1002990C: /* AMD Radeon HD 8670D (Richland) */ |
| 1081 | case 0x1002990D: /* AMD Radeon HD 8550G (Richland) */ |
| 1082 | case 0x1002990E: /* AMD Radeon HD 8570D (Richland) */ |
| 1083 | case 0x1002990F: /* AMD Radeon HD 8610G (Richland) */ |
| 1084 | case 0x10029910: /* AMD Radeon HD 7660G (Trinity) */ |
| 1085 | case 0x10029913: /* AMD Radeon HD 7640G (Trinity) */ |
| 1086 | case 0x10029917: /* AMD Radeon HD 7620G (Trinity) */ |
| 1087 | case 0x10029918: /* AMD Radeon HD 7600G (Trinity) */ |
| 1088 | case 0x10029919: /* AMD Radeon HD 7500G (Trinity) */ |
| 1089 | case 0x10029990: /* AMD Radeon HD 7520G (Trinity) */ |
| 1090 | case 0x10029991: /* AMD Radeon HD 7540D (Trinity) */ |
| 1091 | case 0x10029992: /* AMD Radeon HD 7420G (Trinity) */ |
| 1092 | case 0x10029993: /* AMD Radeon HD 7480D (Trinity) */ |
| 1093 | case 0x10029994: /* AMD Radeon HD 7400G (Trinity) */ |
| 1094 | case 0x10029995: /* AMD Radeon HD 8450G (Richland) */ |
| 1095 | case 0x10029996: /* AMD Radeon HD 8470D (Richland) */ |
| 1096 | case 0x10029997: /* AMD Radeon HD 8350G (Richland) */ |
| 1097 | case 0x10029998: /* AMD Radeon HD 8370D (Richland) */ |
| 1098 | case 0x10029999: /* AMD Radeon HD 8510G (Richland) */ |
| 1099 | case 0x1002999A: /* AMD Radeon HD 8410G (Richland) */ |
| 1100 | case 0x1002999B: /* AMD Radeon HD 8310G (Richland) */ |
| 1101 | case 0x1002999C: /* AMD Radeon HD 8650D (Richland) */ |
| 1102 | case 0x1002999D: /* AMD Radeon HD 8550D (Richland) */ |
| 1103 | case 0x100299A0: /* AMD Radeon HD 7520G (Trinity) */ |
| 1104 | case 0x100299A2: /* AMD Radeon HD 7420G (Trinity) */ |
| 1105 | case 0x100299A4: /* AMD Radeon HD 7400G (Trinity) */ |
Edward O'Callaghan | ae5fd34 | 2014-11-20 19:58:09 +1100 | [diff] [blame] | 1106 | new_vendev = 0x10029901; |
Dave Frodin | cbf3d40 | 2012-12-05 08:20:12 -0700 | [diff] [blame] | 1107 | break; |
| 1108 | } |
| 1109 | |
| 1110 | return new_vendev; |
| 1111 | } |