Patchwork Boot issues (CBFS?) on VIA pc2500e

login
register
about
Submitter Myles Watson
Date 2009-10-14 18:33:18
Message ID <2831fecf0910141133q51090284rdd3079f807766418@mail.gmail.com>
Download mbox | patch
Permalink /patch/408/
State Accepted
Headers show

Comments

Myles Watson - 2009-10-14 18:33:18
> +7: entries 24, mpc_length 158, mpe_length 0
>  Wrote the mp table end at: 000f0410 - 000f0568
> +0: entries 0, mpc_length ffff, mpe_length 0
> +1: entries ffff, mpc_length ffff, mpe_length ffff
Something else is writing here.  I looked back in the log and found this :

Setting variable MTRR 3, base:  448MB, range:   32MB, type WB

It looks like you have 32MB of video memory, so the high tables have
to be lower than 480 MB for it to work.

Can you try the attached patch?  It's mostly the same debug, but it
adds the code to fix the placement of the tables.

Signed-off-by: Myles Watson <mylesgw@gmail.com>

Thanks,
Myles
Uwe Hermann - 2009-10-14 20:36:12
On Wed, Oct 14, 2009 at 12:33:18PM -0600, Myles Watson wrote:
> > +7: entries 24, mpc_length 158, mpe_length 0
> >  Wrote the mp table end at: 000f0410 - 000f0568
> > +0: entries 0, mpc_length ffff, mpe_length 0
> > +1: entries ffff, mpc_length ffff, mpe_length ffff
> Something else is writing here.  I looked back in the log and found this :
> 
> Setting variable MTRR 3, base:  448MB, range:   32MB, type WB
> 
> It looks like you have 32MB of video memory, so the high tables have
> to be lower than 480 MB for it to work.

Indeed, there's "default CONFIG_VIDEO_MB = 32" in Options.lb.


> Can you try the attached patch?  It's mostly the same debug, but it
> adds the code to fix the placement of the tables.
> 
> Signed-off-by: Myles Watson <mylesgw@gmail.com>

Yep, works great, thanks! The board boots to FILO now.

Feel free to commit the northbridge.c fix (without the mptable debug code).

Acked-by: Uwe Hermann <uwe@hermann-uwe.de>


We need to check all other northbridges, I assume a few others will have
the same problem.


Uwe.
Myles Watson - 2009-10-14 20:52:21
> Yep, works great, thanks! The board boots to FILO now.
>
> Feel free to commit the northbridge.c fix (without the mptable debug code).
 :)

> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Rev 4775.

> We need to check all other northbridges, I assume a few others will have
> the same problem.
Yes.

Thanks,
Myles

Patch

Index: svn/src/mainboard/via/pc2500e/mptable.c
===================================================================
--- svn.orig/src/mainboard/via/pc2500e/mptable.c
+++ svn/src/mainboard/via/pc2500e/mptable.c
@@ -47,10 +47,16 @@  void *smp_write_config_table(void *v)
 
 	memcpy(mc->mpc_signature, sig, sizeof(sig));
 	mc->mpc_length = sizeof(*mc);	/* initially just the header */
+	printk_debug("mpc_length %x should be %x\n",
+		     mc->mpc_length, sizeof(*mc));
 	mc->mpc_spec = 0x04;
 	mc->mpc_checksum = 0;	/* not yet computed */
 	memcpy(mc->mpc_oem, oem, sizeof(oem));
+	printk_debug("after oem mpc_length %x should be %x\n",
+		     mc->mpc_length, sizeof(*mc));
 	memcpy(mc->mpc_productid, productid, sizeof(productid));
+	printk_debug("after productid mpc_length %x should be %x\n",
+		     mc->mpc_length, sizeof(*mc));
 	mc->mpc_oemptr = 0;
 	mc->mpc_oemsize = 0;
 	mc->mpc_entry_count = 0;	/* No entries yet... */
@@ -59,8 +65,12 @@  void *smp_write_config_table(void *v)
 	mc->mpe_checksum = 0;
 	mc->reserved = 0;
 
+	printk_debug("0: entries %x, mpc_length %x, mpe_length %x\n",
+		     mc->mpc_entry_count, mc->mpc_length, mc->mpe_length);
 	smp_write_processors(mc);
 
+	printk_debug("1: entries %x, mpc_length %x, mpe_length %x\n",
+		     mc->mpc_entry_count, mc->mpc_length, mc->mpe_length);
 
 /* Bus:		Bus ID	Type*/
 	/* define numbers for pci and isa bus */
@@ -69,16 +79,22 @@  void *smp_write_config_table(void *v)
 	}
 	smp_write_bus(mc, bus_isa, "ISA   ");
 
+	printk_debug("2: entries %x, mpc_length %x, mpe_length %x\n",
+		     mc->mpc_entry_count, mc->mpc_length, mc->mpe_length);
 
 /* I/O APICs:	APIC ID	Version	State		Address*/
 	smp_write_ioapic(mc, VT8237R_APIC_ID, 0x20, VT8237R_APIC_BASE);
 
+	printk_debug("3: entries %x, mpc_length %x, mpe_length %x\n",
+		     mc->mpc_entry_count, mc->mpc_length, mc->mpe_length);
 	/* Now, assemble the table. */
 
 	smp_write_intsrc(mc, mp_ExtINT,
 			 MP_IRQ_TRIGGER_EDGE | MP_IRQ_POLARITY_HIGH,
 			 bus_isa, 0x0, VT8237R_APIC_ID, 0x0);
 
+	printk_debug("4: entries %x, mpc_length %x, mpe_length %x\n",
+		     mc->mpc_entry_count, mc->mpc_length, mc->mpe_length);
 #define ISA_INT(intr, pin) \
 	smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, \
 		bus_isa, (intr), VT8237R_APIC_ID, (pin))
@@ -98,6 +114,8 @@  void *smp_write_config_table(void *v)
 	ISA_INT(0xe, 0xe);
 	ISA_INT(0xf, 0xf);
 
+	printk_debug("5: entries %x, mpc_length %x, mpe_length %x\n",
+		     mc->mpc_entry_count, mc->mpc_length, mc->mpe_length);
 #define PCI_INT(bus, dev, fn, pin) \
 	smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, \
 		bus, (((dev)<<2)|(fn)), VT8237R_APIC_ID, (pin))
@@ -132,6 +150,8 @@  void *smp_write_config_table(void *v)
 	/* Onboard VGA */
 	PCI_INT(1, 0, 0, 16);
 
+	printk_debug("6: entries %x, mpc_length %x, mpe_length %x\n",
+		     mc->mpc_entry_count, mc->mpc_length, mc->mpe_length);
 /*Local Ints:	Type	Polarity    Trigger	Bus ID	 IRQ	APIC ID	PIN#*/
 	smp_write_lintsrc(mc, mp_ExtINT,
 			 MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT,
@@ -139,6 +159,8 @@  void *smp_write_config_table(void *v)
 	smp_write_lintsrc(mc, mp_NMI,
 			 MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT,
 			 0, 0x0, MP_APIC_ALL, 0x1);
+	printk_debug("7: entries %x, mpc_length %x, mpe_length %x\n",
+		     mc->mpc_entry_count, mc->mpc_length, mc->mpe_length);
 
 	/* There is no extension information... */
 
Index: svn/src/northbridge/via/cn700/northbridge.c
===================================================================
--- svn.orig/src/northbridge/via/cn700/northbridge.c
+++ svn/src/northbridge/via/cn700/northbridge.c
@@ -186,8 +186,8 @@  static void pci_domain_set_resources(dev
 		}
 
 #if CONFIG_HAVE_HIGH_TABLES == 1
-		high_tables_base = (tolmk - HIGH_TABLES_SIZE) * 1024;
-		high_tables_size = HIGH_TABLES_SIZE* 1024;
+		high_tables_base = (tolmk - CONFIG_VIDEO_MB * 1024 - HIGH_TABLES_SIZE) * 1024;
+		high_tables_size = HIGH_TABLES_SIZE * 1024;
 		printk_debug("tom: %lx, high_tables_base: %llx, high_tables_size: %llx\n", tomk*1024, high_tables_base, high_tables_size);
 #endif