sc520 support -- ethernet works
authorRonald G. Minnich <rminnich@gmail.com>
Fri, 23 Sep 2005 17:08:58 +0000 (17:08 +0000)
committerRonald G. Minnich <rminnich@gmail.com>
Fri, 23 Sep 2005 17:08:58 +0000 (17:08 +0000)
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2047 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

src/cpu/amd/sc520/sc520.c
src/mainboard/digitallogic/msm586seg/Config.lb
src/mainboard/digitallogic/msm586seg/irq_tables.c
src/mainboard/digitallogic/msm586seg/mainboard.c
src/stream/rom_stream.c

index 8a0334bbb32aaf63b55b025d5a03410c5e2b7f11..1199ec4b509cf6a2d83dfbf26856b51524673ddb 100644 (file)
@@ -37,11 +37,31 @@ static void cpu_init(device_t dev)
 }
 
 
+/* Ollie says: make a northbridge/amd/sc520. Ron sez: 
+ * there is no real northbridge, keep it here in cpu. 
+ * Ron wins, he's writing the code. 
+ */
+void sc520_enable_resources(struct device *dev) {
+       unsigned char command;
+
+       printk_spew("%s\n", __FUNCTION__);
+        command = pci_read_config8(dev, PCI_COMMAND);
+        printk_spew("========>%s, command 0x%x\n", __FUNCTION__, command);
+        command |= PCI_COMMAND_MEMORY | PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
+        printk_spew("========>%s, command 0x%x\n", __FUNCTION__, command);
+        pci_write_config8(dev, PCI_COMMAND, command);
+        command = pci_read_config8(dev, PCI_COMMAND);
+        printk_spew("========>%s, command 0x%x\n", __FUNCTION__, command);
+/*
+ */
+
+}
+
 
 static struct device_operations cpu_operations = {
        .read_resources   = pci_dev_read_resources,
        .set_resources    = pci_dev_set_resources,
-       .enable_resources = pci_dev_enable_resources,
+       .enable_resources = sc520_enable_resources,
        .init             = cpu_init,
        .enable           = 0,
        .ops_pci          = 0,
@@ -166,10 +186,29 @@ static unsigned int pci_domain_scan_bus(device_t dev, unsigned int max)
         return max;
 }
 
+
+static void enable_resources(device_t dev) {
+
+       printk_spew("%s\n", __FUNCTION__);
+       printk_spew("THIS IS FOR THE SC520 =============================\n");
+
+/*
+       command = pci_read_config8(dev, PCI_COMMAND);
+       printk_spew("%s, command 0x%x\n", __FUNCTION__, command);
+       command |= PCI_COMMAND_MEMORY;
+       printk_spew("%s, command 0x%x\n", __FUNCTION__, command);
+       pci_write_config8(dev, PCI_COMMAND, command);
+       command = pci_read_config8(dev, PCI_COMMAND);
+       printk_spew("%s, command 0x%x\n", __FUNCTION__, command);
+ */
+       enable_childrens_resources(dev);
+       printk_spew("%s\n", __FUNCTION__);
+}
+
 static struct device_operations pci_domain_ops = {
         .read_resources   = pci_domain_read_resources,
         .set_resources    = pci_domain_set_resources,
-        .enable_resources = enable_childrens_resources,
+        .enable_resources = enable_resources,
         .init             = 0,
         .scan_bus         = pci_domain_scan_bus,
 };  
index 99f37a723493c1dcdf704c8e3f2416e55a3593a9..8f27fe694cd7a24dd0a321105c0d32c7c98d73cd 100644 (file)
@@ -134,6 +134,9 @@ chip cpu/amd/sc520
        device pci_domain 0 on 
                device pci 0.0 on end
        
+               chip drivers/pci/onboard
+                       device pci 12.0 on end # enet
+               end
                chip drivers/pci/onboard
                        device pci 14.0 on end # 69000
                        register "rom_address" = "0x2000000"
index 0b56f759206689188aa475eb47e4b5bb5c89e193..4e7a1fe82e60588da2511e9b340b494cf7661da2 100644 (file)
@@ -21,13 +21,8 @@ const struct irq_routing_table intel_irq_routing_table = {
        0x50,         /*  u8 checksum , this hase to set to some value that would give 0 after the sum of all bytes for this structure (including checksum) */
        {
                /* bus,     dev|fn,   {link, bitmap}, {link, bitmap}, {link, bitmap}, {link, bitmap},  slot, rfu */
-               {0x00,(0x09<<3)|0x0, {{0x30, 0x8e80}, {0x31, 0x8e80}, {0x32, 0x8e80}, {0x33, 0x08e80}}, 0x1, 0x0},
-               {0x00,(0x0a<<3)|0x0, {{0x31, 0x8e80}, {0x32, 0x8e80}, {0x33, 0x8e80}, {0x30, 0x08e80}}, 0x2, 0x0},
-               {0x00,(0x0b<<3)|0x0, {{0x32, 0x8e80}, {0x33, 0x8e80}, {0x30, 0x8e80}, {0x31, 0x08e80}}, 0x3, 0x0},
-               {0x00,(0x0c<<3)|0x0, {{0x33, 0x8e80}, {0x30, 0x8e80}, {0x31, 0x8e80}, {0x32, 0x08e80}}, 0x4, 0x0},
-               {0x00,(0x0f<<3)|0x0, {{0x32, 0x8e80}, {0x00, 0x8e80}, {0x00, 0x8e80}, {0x00, 0x08e80}}, 0x0, 0x0},
-               {0x00,(0x12<<3)|0x0, {{0x30, 0x8e80}, {0x00, 0x8e80}, {0x00, 0x8e80}, {0x00, 0x08e80}}, 0x0, 0x0},
-               {0x00,(0x14<<3)|0x0, {{0x30, 0x8e80}, {0x31, 0x8e80}, {0x32, 0x8e80}, {0x33, 0x08e80}}, 0x0, 0x0},
+               {0x00,(0x12<<3)|0x0, {{0x30, 0x8000}, {0x00, 0x0}, {0x00, 0x0}, {0x00, 0x00}}, 0x0, 0x0},
+               {0x00,(0x14<<3)|0x0, {{0x30, 0x8000}, {0x31, 0x0}, {0x32, 0x0}, {0x33, 0x00}}, 0x0, 0x0},
        }
 };
 unsigned long write_pirq_routing_table(unsigned long addr)
index 55607ac8c0730ef3d036c49328aabb982f096b06..13f28f43b7e716978b62bf0976ca5b5c7479c345 100644 (file)
@@ -35,6 +35,7 @@ static void irqdump()
    - set ADDDECTL (now done in raminit.c in cpu/amd/sc520
 */
 static void enable_dev(struct device *dev) {
+       extern unsigned char *rom_start, *rom_end;
        volatile struct mmcrpic *pic = MMCRPIC;
        volatile struct mmcr *mmcr = MMCRDEFAULT;
 
@@ -132,6 +133,12 @@ static void enable_dev(struct device *dev) {
         */
        /* follow fuctory here */
        mmcr->dmacontrol.extchanmapa = 0x3210;
+
+       /* hack for IDIOTIC need to fix rom_start */
+       printk_err("Patching rom_start due to sc520 limits\n");
+       rom_start = 0x2000000 + 0x40000;
+       rom_end = rom_start + PAYLOAD_SIZE - 1;
+
        
 }
 struct chip_operations mainboard_digitallogic_msm586seg_ops = {
index 5ac4cd9dbefa4e0e6ed432adf1553b7b3e95de40..7a662d019e1982e052633d7dd6e8c5b851e73309 100644 (file)
@@ -9,8 +9,18 @@
 #define CONFIG_ROM_STREAM_START 0xffff0000UL
 #endif
 
-static const unsigned char *rom_start = (void *)CONFIG_ROM_STREAM_START;
-static const unsigned char *rom_end   = (void *)(CONFIG_ROM_STREAM_START + PAYLOAD_SIZE - 1);
+/* well, this is a mess, and it will get fixed, but not right away. 
+ * until we stop using 'ld' for building the rom image, that is. 
+ * problem is, that on the sc520, ROM_STREAM_START has to be at 0x2000000. 
+ * but if you set CONFIG_ROM_STREAM_START to that, then ld will try to 
+ * build a giant image: 0x0-0x2000000, i.e. almost 4 GB. 
+ * so make this non-static, non-const for now. 
+ */
+
+/*XXXXXXXXXXXXXX */
+/*static const */unsigned char *rom_start = (void *)CONFIG_ROM_STREAM_START;
+/*static const */unsigned char *rom_end   = (void *)(CONFIG_ROM_STREAM_START + PAYLOAD_SIZE - 1);
+/*XXXXXXXXXXXXXX */
 static const unsigned char *rom;
 
 int stream_init(void)