summaryrefslogtreecommitdiff
path: root/cpu/amd/geode_lx/gplvsa_ii/sysmgr/vsa_init.c
blob: 9bcbb239420557838a2317a31cb3a6dd1e34661a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
* Copyright (c) 2006-2008 Advanced Micro Devices,Inc. ("AMD").
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
*
* This code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.

* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA 
*/

//*	 Function:                                                          *
//*     Implements the initialization code for System Manager 

#include "VSA2.H"
#include "SYSMGR.H"
#include "PROTOS.H"
#include "VR.H"
#include "CHIPSET.H"



// External function prototypes
extern void Initialize_Events(void);
extern void Install_SMI_Routines(void);
extern void Initialize_History(void);
extern void InitChipset(void);
extern void Init_MBus(void);
extern void VirtualPCI_EarlyInit(void);
extern void Init_Virtual_Regs(void);
extern void Record_VSM_Locations(void);
extern void Broadcast_SysMgr_Msg (MSG, UCHAR);
extern Hardware HardwareInfo;

//***********************************************************************
// Gets called from early VSA init, but after VSMs have initialized.
//***********************************************************************
void Post_VSM_InitInit(void) 
{

}



//*****************************************************************************
//
// Initialize the System Manager
//
//*****************************************************************************
void Init_SysMgr(void)
{

  // Initialize the array of registered events
  Initialize_Events();

  // Initialize the history buffers
  Initialize_History();


  // Install SMI routines appropriate to chipset
  Install_SMI_Routines();


  // Initialize MBus related structures & MSRs
  Init_MBus();


  // Initialize virtual PCI headers and MBUS
  VirtualPCI_EarlyInit();

  // Initialize chipset-specific registers
  InitChipset();


  // Initialize virtual register trapping
  Init_Virtual_Regs();


  // Register System Manager as handler for A20
  Register_Event(EVENT_A20, MAX_PRIORITY, SysMgr_VSM, 0, 0);



  // Register System Manager as handler of VRC_MISCELLANEOUS
  Register_Event(EVENT_VIRTUAL_REGISTER, MAX_PRIORITY, SysMgr_VSM, VRC_MISCELLANEOUS, GET_DESCR_INFO);


  // Record locations of VSMs requiring special handling
  Record_VSM_Locations();


  // Schedule control after VSMs have performed initialization
  Schedule_VSM((USHORT)Post_VSM_InitInit);



  //
  // Send a phase 0 initialization message to each VSM
  //
  Broadcast_SysMgr_Msg(MSG_INITIALIZE, EARLY_INIT);


}