2 * This file is part of the coreboot project.
4 * Copyright (C) 2009 One Laptop per Child, Association, Inc.
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.
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.
16 void SetDQSOutputCHA(DRAM_SYS_ATTR
* DramAttr
);
17 void SetDQSOutputCHB(DRAM_SYS_ATTR
* DramAttr
);
19 /*===================================================================
20 Function : DRAMDQSOutputSearchCHA()
23 DramAttr: pointer point to DRAM_SYS_ATTR which consist the DDR and Dimm information
26 Purpose : set DQS output delay register reg70 and DQ output delay register reg71
27 ===================================================================*/
31 void DRAMDQSOutputSearch(DRAM_SYS_ATTR
* DramAttr
)
33 if (DramAttr
->RankNumChA
> 0)
34 SetDQSOutputCHA(DramAttr
);
37 /*===================================================================
38 Function : SetDQSOutputCHA()
41 DramAttr: pointer point to DRAM_SYS_ATTR which consist the DDR and Dimm information
44 Purpose : according the frequence set CHA DQS output
45 ===================================================================*/
46 void SetDQSOutputCHA(DRAM_SYS_ATTR
* DramAttr
)
51 if (DramAttr
->DramFreq
== DIMMFREQ_400
)
53 else if (DramAttr
->DramFreq
== DIMMFREQ_533
)
55 else if (DramAttr
->DramFreq
== DIMMFREQ_667
)
57 else if (DramAttr
->DramFreq
== DIMMFREQ_800
)
62 if (DramAttr
->RankNumChA
> 2) {
63 Reg70
= Fixed_DQSA_3_4_Rank_Table
[Index
][0];
64 Reg71
= Fixed_DQSA_3_4_Rank_Table
[Index
][1];
66 Reg70
= Fixed_DQSA_1_2_Rank_Table
[Index
][0];
67 Reg71
= Fixed_DQSA_1_2_Rank_Table
[Index
][1];
69 pci_write_config8(MEMCTRL
, 0x70, Reg70
);
70 pci_write_config8(MEMCTRL
, 0x71, Reg71
);
77 /*===================================================================
78 Function : DRAMDQSInputSearch()
81 DramAttr: pointer point to DRAM_SYS_ATTR which consist the DDR and Dimm information
84 Purpose : search DQS input delay for CHA/CHB
85 ===================================================================*/
87 void DRAMDQSInputSearch(DRAM_SYS_ATTR
* DramAttr
)
92 pci_write_config8(MEMCTRL
, 0x77, Data
);