Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 1 | /* |
Stefan Reinauer | 7e61e45 | 2008-01-18 10:35:56 +0000 | [diff] [blame] | 2 | * This file is part of the coreboot project. |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2007 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. |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #ifndef AMDFAM10_SYSCONF_H |
| 17 | #define AMDFAM10_SYSCONF_H |
| 18 | |
stepan | 8301d83 | 2010-12-08 07:07:33 +0000 | [diff] [blame] | 19 | #include "northbridge/amd/amdfam10/nums.h" |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 20 | |
| 21 | #include <cpu/x86/msr.h> |
| 22 | |
| 23 | struct p_state_t { |
Lee Leahy | 0ca2a06 | 2017-03-06 18:01:04 -0800 | [diff] [blame^] | 24 | unsigned int corefreq; |
| 25 | unsigned int power; |
| 26 | unsigned int transition_lat; |
| 27 | unsigned int busmaster_lat; |
| 28 | unsigned int control; |
| 29 | unsigned int status; |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | struct amdfam10_sysconf_t { |
| 33 | //ht |
Lee Leahy | 0ca2a06 | 2017-03-06 18:01:04 -0800 | [diff] [blame^] | 34 | unsigned int hc_possible_num; |
| 35 | unsigned int pci1234[HC_POSSIBLE_NUM]; |
| 36 | unsigned int hcdn[HC_POSSIBLE_NUM]; |
| 37 | unsigned int hcid[HC_POSSIBLE_NUM]; //record ht chain type |
| 38 | unsigned int sbdn; |
| 39 | unsigned int sblk; |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 40 | |
Lee Leahy | 0ca2a06 | 2017-03-06 18:01:04 -0800 | [diff] [blame^] | 41 | unsigned int nodes; |
| 42 | unsigned int ht_c_num; // we only can have 32 ht chain at most |
| 43 | unsigned int ht_c_conf_bus[HC_NUMS]; // 4-->32: 4:segn, 8:bus_max, 8:bus_min, 4:linkn, 6: nodeid, 2: enable |
| 44 | unsigned int io_addr_num; |
| 45 | unsigned int conf_io_addr[HC_NUMS]; |
| 46 | unsigned int conf_io_addrx[HC_NUMS]; |
| 47 | unsigned int mmio_addr_num; |
| 48 | unsigned int conf_mmio_addr[HC_NUMS*2]; // mem and pref mem |
| 49 | unsigned int conf_mmio_addrx[HC_NUMS*2]; |
| 50 | unsigned int segbit; |
| 51 | unsigned int hcdn_reg[HC_NUMS]; // it will be used by get_pci1234 |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 52 | |
| 53 | msr_t msr_pstate[NODE_NUMS * 5]; // quad cores all cores in one node should be the same, and p0,..p5 |
Lee Leahy | 0ca2a06 | 2017-03-06 18:01:04 -0800 | [diff] [blame^] | 54 | unsigned int needs_update_pstate_msrs; |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 55 | |
Lee Leahy | 0ca2a06 | 2017-03-06 18:01:04 -0800 | [diff] [blame^] | 56 | unsigned int bsp_apicid; |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 57 | int enabled_apic_ext_id; |
Lee Leahy | 0ca2a06 | 2017-03-06 18:01:04 -0800 | [diff] [blame^] | 58 | unsigned int lift_bsp_apicid; |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 59 | int apicid_offset; |
| 60 | |
Martin Roth | 0cb07e3 | 2013-07-09 21:46:01 -0600 | [diff] [blame] | 61 | void *mb; // pointer for mb related struct |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 62 | |
| 63 | }; |
| 64 | |
| 65 | extern struct amdfam10_sysconf_t sysconf; |
| 66 | |
Stefan Reinauer | e9de1e2 | 2010-04-07 15:30:11 +0000 | [diff] [blame] | 67 | void get_sblk_pci1234(void); |
| 68 | void get_bus_conf(void); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 69 | #endif |