blob: d4bff0b3f21b167cb0bf545524e331d1c7280364 [file] [log] [blame]
Damien Zammit75a3d1f2016-11-28 00:29:10 +11001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2016 Damien Zammit <damien@zamaudio.com>
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.
14 */
15
16#ifndef INIT_CPUS_H
17#define INIT_CPUS_H
18
19#include <stdlib.h>
20#include <console/console.h>
21#include <arch/cpu.h>
22#include <cpu/x86/lapic.h>
23#include <cpu/x86/mtrr.h>
24#include <cpu/amd/msr.h>
25#include <cpu/amd/multicore.h>
26#include <reset.h>
27#include <northbridge/amd/amdfam10/raminit.h>
28#include "defaults.h"
29
30#define NODE_HT(x) NODE_PCI(x,0)
31#define NODE_MP(x) NODE_PCI(x,1)
32#define NODE_MC(x) NODE_PCI(x,3)
33#define NODE_LC(x) NODE_PCI(x,4)
34
35unsigned int get_sbdn(unsigned bus);
36void cpuSetAMDMSR(uint8_t node_id);
37
38typedef void (*process_ap_t) (u32 apicid, void *gp);
39
40uint32_t get_boot_apic_id(uint8_t node, uint32_t core);
41u32 init_cpus(u32 cpu_init_detectedx, struct sys_info *sysinfo);
42uint8_t set_apicid_cpuid_lo(void);
43void real_start_other_core(uint32_t nodeid, uint32_t cores);
44void finalize_node_setup(struct sys_info *sysinfo);
45uint32_t wait_cpu_state(uint32_t apicid, uint32_t state, uint32_t state2);
46void start_other_cores(uint32_t bsp_apicid);
47u32 get_core_num_in_bsp(u32 nodeid);
48
49void update_microcode(u32 cpu_deviceid);
50
51/* fidvid.c */
52void init_fidvid_stage2(u32 apicid, u32 nodeid);
53void prep_fid_change(void);
54int init_fidvid_bsp(u32 bsp_apicid, u32 nodes);
55
56#endif