2 * This file is part of the coreboot project.
4 * Copyright (C) 2009 Libra Li <libra.li@technexion.com>
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; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #include "southbridge/amd/sb600/sb600.h"
29 #include <device/pci.h>
30 #include <device/pci_ids.h>
34 #include "tn_post_code.h"
39 // TechNexion's Post Code Initially.
40 void technexion_post_code_init(void)
45 // SMBus Module and ACPI Block (Device 20, Function 0)
46 dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SB600_SM), 0);
49 // This is reference SB600 RRG 4.1.1 GPIO
50 reg8_data = pmio_read(0x60);
51 reg8_data |= (1<<7); // 1: GPIO if not used by SATA
52 pmio_write(0x60, reg8_data);
54 reg8_data = pci_read_config8(dev, 0x80);
55 reg8_data = ((reg8_data | (1<<0)) & ~(1<<4));
56 pci_write_config8(dev, 0x80, reg8_data);
59 // This is reference SB600 RRG 4.1.1 GPIO
60 reg8_data = pci_read_config8(dev, 0x80);
61 reg8_data = ((reg8_data | (1<<1)) & ~(1<<5));
62 pci_write_config8(dev, 0x80, reg8_data);
65 // This is reference SB600 RRG 4.1.1 GPIO
66 reg8_data = pmio_read(0x5e);
67 reg8_data &= ~(1<<7); // 0: GPIO if not used by SATA
68 pmio_write(0x5e, reg8_data);
70 reg8_data = pci_read_config8(dev, 0xa8);
72 pci_write_config8(dev, 0xa8, reg8_data);
74 reg8_data = pci_read_config8(dev, 0xa9);
76 pci_write_config8(dev, 0xa9, reg8_data);
79 // This is reference SB600 RRG 4.1.1 GPIO
80 reg8_data = pmio_read(0x60);
81 reg8_data |= (1<<7); // 1: GPIO if not used by SATA
82 pmio_write(0x60, reg8_data);
84 reg8_data = pci_read_config8(dev, 0xa8);
86 pci_write_config8(dev, 0xa8, reg8_data);
88 reg8_data = pci_read_config8(dev, 0xa9);
90 pci_write_config8(dev, 0xa9, reg8_data);
92 // This is reference SB600 RRG 4.1.1 GPIO
93 reg8_data = pci_read_config8(dev, 0xa8);
95 pci_write_config8(dev, 0xa8, reg8_data);
97 reg8_data = pci_read_config8(dev, 0xa9);
99 pci_write_config8(dev, 0xa9, reg8_data);
102 // This is reference SB600 RRG 4.1.1 GPIO
103 reg8_data = pci_read_config8(dev, 0xa8);
105 pci_write_config8(dev, 0xa8, reg8_data);
107 reg8_data = pci_read_config8(dev, 0xa9);
108 reg8_data &= ~(1<<4);
109 pci_write_config8(dev, 0xa9, reg8_data);
112 // This is reference SB600 RRG 4.1.1 GPIO
113 reg8_data = pci_read_config8(dev, 0xab);
114 reg8_data = ((reg8_data | (1<<0)) & ~(1<<1));
115 pci_write_config8(dev, 0xab, reg8_data);
118 // This is reference SB600 RRG 4.1.1 GPIO
119 reg8_data = pmio_read(0x68);
120 reg8_data &= ~(1<<5); // 0: GPIO
121 pmio_write(0x68, reg8_data);
123 reg8_data = pci_read_config8(dev, 0x7e);
124 reg8_data = ((reg8_data | (1<<1)) & ~(1<<5));
125 pci_write_config8(dev, 0x7e, reg8_data);
131 /* TechNexion's Post Code.
133 void technexion_post_code(uint8_t udata8)
138 // SMBus Module and ACPI Block (Device 20, Function 0)
140 dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SB600_SM), 0);
142 dev = dev_find_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SB600_SM, 0);
148 u8_data = pci_read_config8(dev, 0x80);
155 pci_write_config8(dev, 0x80, u8_data);
158 u8_data = pci_read_config8(dev, 0x80);
165 pci_write_config8(dev, 0x80, u8_data);
168 u8_data = pci_read_config8(dev, 0xa8);
175 pci_write_config8(dev, 0xa8, u8_data);
178 u8_data = pci_read_config8(dev, 0xa8);
185 pci_write_config8(dev, 0xa8, u8_data);
188 u8_data = pci_read_config8(dev, 0xa8);
195 pci_write_config8(dev, 0xa8, u8_data);
198 u8_data = pci_read_config8(dev, 0xa8);
205 pci_write_config8(dev, 0xa8, u8_data);
208 u8_data = pci_read_config8(dev, 0xab);
215 pci_write_config8(dev, 0xab, u8_data);
218 u8_data = pci_read_config8(dev, 0x7e);
225 pci_write_config8(dev, 0x7e, u8_data);