Attached patch removes unnecessary IRQ routing info (for ACPI, mptable etc needs to be fixed too). The devicetree.cb changes should reflect now the real board configuration. It has one 16x slot and 1x slot (GPP device 9) and GPP device a is onboard ethernet. The mainboard.c now presents the board name and
I removed the gpio asserts - I think those are not used here.

The pcie 1x slot works, the x1 card I have does not work in 16x slot, but in orig bios I cannot see it any slot, so it is kind of better.

The classic PCI slot works fine too. However it seems SATA has some issues.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz> 
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5720 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
diff --git a/src/mainboard/asrock/939a785gmh/mainboard.c b/src/mainboard/asrock/939a785gmh/mainboard.c
index 9e29546..bd8b25e 100644
--- a/src/mainboard/asrock/939a785gmh/mainboard.c
+++ b/src/mainboard/asrock/939a785gmh/mainboard.c
@@ -35,34 +35,12 @@
 void set_pcie_dereset(void);
 void set_pcie_reset(void);
 u8 is_dev3_present(void);
-/*
- * Mahogany uses GPIO 6 as PCIe slot reset, GPIO4 as GFX slot reset. We need to
- * pull it up before training the slot.
- ***/
 void set_pcie_dereset()
 {
-	u16 word;
-	device_t sm_dev;
-	/* GPIO 6 reset PCIe slot, GPIO 4 reset GFX PCIe */
-	sm_dev = dev_find_slot(0, PCI_DEVFN(0x14, 0));
-
-	word = pci_read_config16(sm_dev, 0xA8);
-	word |= (1 << 0) | (1 << 2);	/* Set Gpio6,4 as output */
-	word &= ~((1 << 8) | (1 << 10));
-	pci_write_config16(sm_dev, 0xA8, word);
 }
 
 void set_pcie_reset()
 {
-	u16 word;
-	device_t sm_dev;
-	/* GPIO 6 reset PCIe slot, GPIO 4 reset GFX PCIe */
-	sm_dev = dev_find_slot(0, PCI_DEVFN(0x14, 0));
-
-	word = pci_read_config16(sm_dev, 0xA8);
-	word &= ~((1 << 0) | (1 << 2));	/* Set Gpio6,4 as output */
-	word &= ~((1 << 8) | (1 << 10));
-	pci_write_config16(sm_dev, 0xA8, word);
 }
 
 #if 0	     /* not tested yet */
@@ -103,13 +81,13 @@
 * enable the dedicated function in mahogany board.
 * This function called early than rs780_enable.
 *************************************************/
-static void mahogany_enable(device_t dev)
+static void mb_enable(device_t dev)
 {
 	/* Leave it for future. */
 	/* struct mainboard_config *mainboard =
 	   (struct mainboard_config *)dev->chip_info;*/
 
-	printk(BIOS_INFO, "Mainboard MAHOGANY Enable. dev=0x%p\n", dev);
+	printk(BIOS_INFO, "Mainboard 939A785GMH/128M Enable. dev=0x%p\n", dev);
 
 #if (CONFIG_GFXUMA == 1)
 	msr_t msr, msr2;
@@ -170,6 +148,6 @@
 }
 
 struct chip_operations mainboard_ops = {
-	CHIP_NAME("AMD MAHOGANY   Mainboard")
-	.enable_dev = mahogany_enable,
+	CHIP_NAME("Asrock 939A785GMH/128M Mainboard")
+	.enable_dev = mb_enable,
 };