AMD-8111: Add TINY_BOOTBLOCK support.
authorUwe Hermann <uwe@hermann-uwe.de>
Fri, 26 Nov 2010 22:35:11 +0000 (22:35 +0000)
committerUwe Hermann <uwe@hermann-uwe.de>
Fri, 26 Nov 2010 22:35:11 +0000 (22:35 +0000)
Also, add missing license header to amd8111_enable_rom.c, add some more code
comments and use PCI IDs from pci_ids.h instead of hardcoding.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Patrick Georgi <patrick@georgi-clan.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6124 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

21 files changed:
src/mainboard/amd/serengeti_cheetah/romstage.c
src/mainboard/amd/serengeti_cheetah_fam10/romstage.c
src/mainboard/arima/hdama/romstage.c
src/mainboard/hp/dl145_g1/romstage.c
src/mainboard/ibm/e325/romstage.c
src/mainboard/ibm/e326/romstage.c
src/mainboard/iwill/dk8_htx/romstage.c
src/mainboard/iwill/dk8s2/romstage.c
src/mainboard/iwill/dk8x/romstage.c
src/mainboard/newisys/khepri/romstage.c
src/mainboard/tyan/s2850/romstage.c
src/mainboard/tyan/s2875/romstage.c
src/mainboard/tyan/s2880/romstage.c
src/mainboard/tyan/s2881/romstage.c
src/mainboard/tyan/s2882/romstage.c
src/mainboard/tyan/s2885/romstage.c
src/mainboard/tyan/s4880/romstage.c
src/mainboard/tyan/s4882/romstage.c
src/southbridge/amd/amd8111/Kconfig
src/southbridge/amd/amd8111/amd8111_enable_rom.c
src/southbridge/amd/amd8111/bootblock.c

index 24a6525e58eeb415d3c8459bf1c75c1ccd80ab66..ee78f31c5c92bd9f9b929d0fc1bedffcc10f649a 100644 (file)
@@ -85,7 +85,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
 #include "cpu/amd/model_fxx/fidvid.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 #define RC0 ((1<<0)<<8)
@@ -126,7 +125,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 5274ef2e4aaa1aeecf25f3cbbfbc7272354dabcc..2124c284c94c07053e14a0270e7decf647d79bd1 100644 (file)
@@ -89,7 +89,6 @@ static int spd_read_byte(u32 device, u32 address)
 #include "cpu/amd/microcode/microcode.c"
 #include "cpu/amd/model_10xxx/update_microcode.c"
 #include "cpu/amd/model_10xxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdfam10/early_ht.c"
 
 static const u8 spd_addr[] = {
@@ -197,9 +196,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* mov bsp to bus 0xff when > 8 nodes */
                set_bsp_node_CHtExtNodeCfgEn();
                enumerate_ht_chain();
-
-               /* Setup the rom access for 4M */
-               amd8111_enable_rom();
        }
 
        post_code(0x30);
index 5bcc2492492af3f04302e13d054baf5f49303ea5..61a0b0e5ba12ac34bc14c9cea9a45c573779106c 100644 (file)
@@ -66,7 +66,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/dualcore/dualcore.c"
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -88,7 +87,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
        }
 
        if (bist == 0)
index 5352ccc48cb74496c5f7d714a7d1375d41ca8729..a920cc840f9f7f4acb3a88f7a6b0a8bb732ea1e5 100644 (file)
@@ -88,7 +88,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include <spd.h>
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 #define RC0 ((1<<1)<<8) // Not sure about these values
@@ -115,7 +114,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 49dce1412b5717ae23cfda400444165584497521..83f04c06b41ac6dae5f3944967a8c57193cfbe6a 100644 (file)
@@ -63,7 +63,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/dualcore/dualcore.c"
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -97,7 +96,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 48bfcc5f83e237e9bb912eaa1c6c3cf492676fa8..68e62918788356fe1fa606fe160f4605be5b1a01 100644 (file)
@@ -63,7 +63,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/dualcore/dualcore.c"
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -97,7 +96,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 75584f3090f24bbce28ee10bacd95ceef910c191..582fed392ba4a7cfb834e5c67a531d3a76214cab 100644 (file)
@@ -73,7 +73,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
 #include "cpu/amd/model_fxx/fidvid.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -96,7 +95,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 70339e82bee66d2a6a5bd69c8253c86d3329ad4a..01e747eb941152599162800ce91b1655c3e5cbca 100644 (file)
@@ -73,7 +73,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
 #include "cpu/amd/model_fxx/fidvid.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -97,7 +96,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index b8169b2b945af27002a2aa4a433696a72b45e91b..7b2db33d3817be727379e8e5121e7d363db283ba 100644 (file)
@@ -73,7 +73,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
 #include "cpu/amd/model_fxx/fidvid.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -97,7 +96,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index bd62cad9cc9c6411c18d687892c2c4601efdfe36..b6ceed1037a44a2f1834104a02410e942e1175a7 100644 (file)
@@ -69,7 +69,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/dualcore/dualcore.c"
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -91,7 +90,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 4f78797030b665a560bccf2570bb64fd8cfe03c5..b7f071679656ba0c6bc70f86e1e7629238a35e8b 100644 (file)
@@ -59,7 +59,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/dualcore/dualcore.c"
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -82,7 +81,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 55448bd381a9e3f15f02cd427c5061adbed95be9..db54927e9b9a0650afd73fc8624a8d34d60aeaf7 100644 (file)
@@ -59,7 +59,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/dualcore/dualcore.c"
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -93,7 +92,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 9ecf09bd3e3e17fc0f8ee2deba2e2e34a47b2bf8..2ab663b0d11263146d8e5b9e3ff1e03a1e380111 100644 (file)
@@ -59,7 +59,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/dualcore/dualcore.c"
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -93,7 +92,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 9a20be7089baad968ce712790ca1257a68839dfc..6645c9de24c369548cfe4ab091c25a6b8d459428 100644 (file)
@@ -58,7 +58,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/dualcore/dualcore.c"
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -80,7 +79,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 9ecf09bd3e3e17fc0f8ee2deba2e2e34a47b2bf8..2ab663b0d11263146d8e5b9e3ff1e03a1e380111 100644 (file)
@@ -59,7 +59,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/dualcore/dualcore.c"
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -93,7 +92,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 3ebe6b5698e61f82a76f5fd086e2ab2b996f8f3d..a4b7d076d1a25c1a22ca9f5934fd305ace40a28f 100644 (file)
@@ -58,7 +58,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include "cpu/amd/dualcore/dualcore.c"
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
@@ -80,7 +79,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index b542bfdbe54fa01206ecd11de4c9c22494400a11..cfa061313f6173da27b096886d768c5a4e44ea5e 100644 (file)
@@ -78,7 +78,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include <spd.h>
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 #define RC0 ((1<<2)<<8)
@@ -140,7 +139,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 7750750ca19ed5b7fdd519ca72fc0e8c36a57eb4..d83c21a8935d7b8a5c07868b7a7a68c52e509641 100644 (file)
@@ -86,7 +86,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 #include <spd.h>
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
-#include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 
 #define RC0 ((1<<2)<<8)
@@ -119,7 +118,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                /* Nothing special needs to be done to find bus 0 */
                /* Allow the HT devices to be found */
                enumerate_ht_chain();
-               amd8111_enable_rom();
         }
 
         if (bist == 0)
index 1f75ed9f501cc77d8a413d15c3d062cd6697ca11..666c7d5ef138e956ce6f332d7eaf10dda6909749 100644 (file)
@@ -20,8 +20,9 @@
 config SOUTHBRIDGE_AMD_AMD8111
        bool
        select IOAPIC
+       select TINY_BOOTBLOCK
 
 config BOOTBLOCK_SOUTHBRIDGE_INIT
-        string
-        default "southbridge/amd/amd8111/bootblock.c"
-        depends on SOUTHBRIDGE_AMD_AMD8111
+       string
+       default "southbridge/amd/amd8111/bootblock.c"
+       depends on SOUTHBRIDGE_AMD_AMD8111
index b8cc5b1a84ae30c3f4912575b0fb440732807c43..3e73112b4799195e2bd98de3a4d6a3f90a2743a9 100644 (file)
@@ -1,15 +1,42 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2003 Linux Networx
+ * (Written by Eric Biederman <ebiederman@lnxi.com> for Linux Networx)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
 
+#include <stdint.h>
+#include <arch/io.h>
+#include <arch/romcc_io.h>
+#include <device/pci_ids.h>
+
+/* Enable 5MB ROM access at 0xFFB00000 - 0xFFFFFFFF. */
 static void amd8111_enable_rom(void)
 {
-       unsigned char byte;
+       u8 byte;
        device_t dev;
 
-       /* Enable 5MB rom access at 0xFFB00000 - 0xFFFFFFFF */
-       /* Locate the amd8111 */
-       dev = pci_io_locate_device(PCI_ID(0x1022, 0x7468), 0);
+       dev = pci_io_locate_device(PCI_ID(PCI_VENDOR_ID_AMD,
+                                         PCI_DEVICE_ID_AMD_8111_ISA), 0);
+
+       /* Note: The 0xFFFF0000 - 0xFFFFFFFF range is always enabled. */
 
-       /* Set the 5MB enable bits */
+       /* Set the 5MB enable bits. */
        byte = pci_io_read_config8(dev, 0x43);
-       byte |= 0xC0;
+       byte |= (1 << 7); /* Enable 0xFFC00000-0xFFFFFFFF (4MB). */
+       byte |= (1 << 6); /* Enable 0xFFB00000-0xFFBFFFFF (1MB). */
        pci_io_write_config8(dev, 0x43, byte);
 }
index 72a4903ca981373aab7a2e7a8d3b793278e08f31..695f49898bdd54475a8c2c2e09bf5e075987a054 100644 (file)
@@ -1,6 +1,6 @@
 #include "southbridge/amd/amd8111/amd8111_enable_rom.c"
 
-static void bootblock_southbridge_init(void) {
-       /* Setup the rom access for 4M */
+static void bootblock_southbridge_init(void)
+{
        amd8111_enable_rom();
 }