Re: [coreboot] Coreboot bug?

2009-11-11 Thread Stefan Reinauer
Peter Stuge wrote: > Stefan Reinauer wrote: > >>> Right, but what checks that the data is not colliding with something >>> else. >>> >> Like? >> > > Like another table? Or is this the first thing written - and > everything afterwards is simply appended? > The coreboot table is wri

[coreboot] Ubiquiti embedded boards and Atheros chipset

2009-11-11 Thread Chao, Shane (Contr)
Peter, If I want to port coreboot to Atheros chipset, can you please point me to a general direction on getting started? Thanks, Shane -- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Peter Stuge
Stefan Reinauer wrote: > > Right, but what checks that the data is not colliding with something > > else. > > Like? Like another table? Or is this the first thing written - and everything afterwards is simply appended? //Peter -- coreboot mailing list: coreboot@coreboot.org http://www.coreboo

Re: [coreboot] [PATCH]clean up bootblocksize handling in cbfstool, kconfig

2009-11-11 Thread Kevin O'Connor
On Wed, Nov 11, 2009 at 10:32:40PM +0100, Patrick Georgi wrote: > Ideally, it will become some automatic "as small as possible" > configuration. Unfortunately ld doesn't allow to align everything to an > upper boundary, so this requires the link-twice trick or so. Just as a random note, the ab

Re: [coreboot] [PATCH]clean up bootblocksize handling in cbfstool, kconfig

2009-11-11 Thread Maciej Pijanka
On 12/11/2009, Stefan Reinauer wrote: > Myles Watson wrote: >> On Wed, Nov 11, 2009 at 4:57 PM, Maciej Pijanka >> wrote: >> >>> On 12/11/2009, Myles Watson wrote: >>> >> This doesn't seem like it should be a config option any more. >> > Ideally, it will become some automatic "as smal

Re: [coreboot] [PATCH]clean up bootblocksize handling in cbfstool, kconfig

2009-11-11 Thread Stefan Reinauer
Myles Watson wrote: > On Wed, Nov 11, 2009 at 4:57 PM, Maciej Pijanka > wrote: > >> On 12/11/2009, Myles Watson wrote: >> > This doesn't seem like it should be a config option any more. > Ideally, it will become some automatic "as small as possible" configurat

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Stefan Reinauer
Peter Stuge wrote: > Myles Watson wrote: > >>> It is completely unclear to me why it is safe to write beyond the >>> struct lb_record >>> >> lb_record is just the header. The data follows it, but isn't a >> member of the struct. >> > > Right, but what checks that the data is not col

Re: [coreboot] Coreboot bug?

2009-11-11 Thread ron minnich
nice. Acked-by: Ronald G. Minnich -- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Myles Watson
> memcpy(0518, 0010d91c, c) > > I have no idea why 12.  I reverted it. It turns out that option_table is actually a struct cmos_option_table in the header file. Here's a better fix: Index: src/arch/i386/boot/coreboot_table.c ===

Re: [coreboot] [PATCH]clean up bootblocksize handling in cbfstool, kconfig

2009-11-11 Thread Myles Watson
On Wed, Nov 11, 2009 at 4:57 PM, Maciej Pijanka wrote: > On 12/11/2009, Myles Watson wrote: This doesn't seem like it should be a config option any more. >>> >>> Ideally, it will become some automatic "as small as possible" >>> configuration. >>> Unfortunately ld doesn't allow to align every

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Myles Watson
On Wed, Nov 11, 2009 at 4:46 PM, ron minnich wrote: > On Wed, Nov 11, 2009 at 3:37 PM, Peter Stuge wrote: >> ron minnich wrote: >>> >>> -             memcpy(rec_dest,  rec_src, rec_src->size); >>> >>> +             memcpy(rec_dest,  &option_table, sizeof(option_table)); >>> >>> completely changes

Re: [coreboot] [PATCH]clean up bootblocksize handling in cbfstool, kconfig

2009-11-11 Thread Maciej Pijanka
On 12/11/2009, Myles Watson wrote: >>> This doesn't seem like it should be a config option any more. >> >> Ideally, it will become some automatic "as small as possible" >> configuration. >> Unfortunately ld doesn't allow to align everything to an upper boundary, >> so >> this requires the link-twi

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Myles Watson
On Wed, Nov 11, 2009 at 4:37 PM, Peter Stuge wrote: > ron minnich wrote: >> >>> -             memcpy(rec_dest,  rec_src, rec_src->size); >> >>> +             memcpy(rec_dest,  &option_table, sizeof(option_table)); >> >> completely changes the behavior of the code and is wrong. >> >> I'm willing to

[coreboot] [commit] r4936 - trunk/src/arch/i386/boot

2009-11-11 Thread svn
Author: myles Date: 2009-11-12 00:59:19 +0100 (Thu, 12 Nov 2009) New Revision: 4936 Modified: trunk/src/arch/i386/boot/coreboot_table.c Log: Revert my too-hasty commit. Signed-off-by: Myles Watson Acked-by: Myles Watson Modified: trunk/src/arch/i386/boot/coreboot_table.c =

Re: [coreboot] Coreboot bug?

2009-11-11 Thread ron minnich
On Wed, Nov 11, 2009 at 3:37 PM, Peter Stuge wrote: > ron minnich wrote: >> >>> -             memcpy(rec_dest,  rec_src, rec_src->size); >> >>> +             memcpy(rec_dest,  &option_table, sizeof(option_table)); >> >> completely changes the behavior of the code and is wrong. >> >> I'm willing to

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Peter Stuge
ron minnich wrote: > >>> - memcpy(rec_dest, rec_src, rec_src->size); > >>> + memcpy(rec_dest, &option_table, sizeof(option_table)); > > completely changes the behavior of the code and is wrong. > > I'm willing to be convinced. But sizeof(option_table) is 8 How can that

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Peter Stuge
Myles Watson wrote: > > It is completely unclear to me why it is safe to write beyond the > > struct lb_record > > lb_record is just the header. The data follows it, but isn't a > member of the struct. Right, but what checks that the data is not colliding with something else. > > (maybe it is

Re: [coreboot] Coreboot bug?

2009-11-11 Thread ron minnich
On Wed, Nov 11, 2009 at 3:31 PM, Myles Watson wrote: > On Wed, Nov 11, 2009 at 4:06 PM, Peter Stuge wrote: >> Myles Watson wrote: >>> How about this: >>> >>> Index: src/arch/i386/boot/coreboot_table.c >>> === >>> --- src/arch/i386/bo

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Myles Watson
On Wed, Nov 11, 2009 at 4:06 PM, Peter Stuge wrote: > Myles Watson wrote: >> How about this: >> >> Index: src/arch/i386/boot/coreboot_table.c >> === >> --- src/arch/i386/boot/coreboot_table.c       (revision 4931) >> +++ src/arch/i386

[coreboot] [commit] r4935 - trunk/src/arch/i386/boot

2009-11-11 Thread svn
Author: myles Date: 2009-11-12 00:32:36 +0100 (Thu, 12 Nov 2009) New Revision: 4935 Modified: trunk/src/arch/i386/boot/coreboot_table.c Log: Silence an ugly-looking warning. Two casts were not enough, so just don't cast it. Trust the option_table generator to get the length correct. Signed-o

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Peter Stuge
Myles Watson wrote: > How about this: > > Index: src/arch/i386/boot/coreboot_table.c > === > --- src/arch/i386/boot/coreboot_table.c (revision 4931) > +++ src/arch/i386/boot/coreboot_table.c (working copy) > @@ -485,11 +48

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Myles Watson
On Wed, Nov 11, 2009 at 3:50 PM, Myles Watson wrote: > On Wed, Nov 11, 2009 at 3:49 PM, ron minnich wrote: >> On Wed, Nov 11, 2009 at 2:39 PM, Myles Watson wrote: >> >>> -               memcpy(rec_dest,  rec_src, rec_src->size); >>> +               memcpy(rec_dest,  &option_table, sizeof(option_

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Myles Watson
On Wed, Nov 11, 2009 at 3:49 PM, ron minnich wrote: > On Wed, Nov 11, 2009 at 2:39 PM, Myles Watson wrote: > >> -               memcpy(rec_dest,  rec_src, rec_src->size); >> +               memcpy(rec_dest,  &option_table, sizeof(option_table)); > > how can this be right? rec_src->size is 1160, a

Re: [coreboot] Coreboot bug?

2009-11-11 Thread ron minnich
On Wed, Nov 11, 2009 at 2:39 PM, Myles Watson wrote: > -               memcpy(rec_dest,  rec_src, rec_src->size); > +               memcpy(rec_dest,  &option_table, sizeof(option_table)); how can this be right? rec_src->size is 1160, and sizeof(option_table) is 8? ron -- coreboot mailing list

Re: [coreboot] [PATCH]clean up bootblocksize handling in cbfstool, kconfig

2009-11-11 Thread Myles Watson
>> This doesn't seem like it should be a config option any more. >> > > Ideally, it will become some automatic "as small as possible" configuration. > Unfortunately ld doesn't allow to align everything to an upper boundary, so > this requires the link-twice trick or so. > So for now, I'd like to ke

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Myles Watson
On Wed, Nov 11, 2009 at 3:21 PM, Peter Stuge wrote: > Stefan Reinauer wrote: >> > Maybe make a type with struct lb_record followed by unsigned char [], >> > then it is more clear what is going on. >> >> Or just get the length via read32. > > I was thinking about how the source code looks, not so m

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Peter Stuge
Stefan Reinauer wrote: > > Maybe make a type with struct lb_record followed by unsigned char [], > > then it is more clear what is going on. > > Or just get the length via read32. I was thinking about how the source code looks, not so much what happens at run time. But that could also be an impro

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Stefan Reinauer
Peter Stuge wrote: > Myles Watson wrote: > unsigned char option_table[] = { 0xc8,0x00,0x00,0x00,0x88,0x04,0x00,0x00,0x0c,0x00, >>> Second 32 bits 0x88,0x04,0x00,0x00 is the length. We're small endian. >>> So it's 0x488 or 1160 bytes. Does that match? >>> >>

Re: [coreboot] [PATCH]clean up bootblocksize handling in cbfstool, kconfig

2009-11-11 Thread Patrick Georgi
Am 11.11.2009 21:28, schrieb Myles Watson: On Wed, Nov 11, 2009 at 1:16 PM, Patrick Georgi wrote: 3. CONFIG_ROMBASE in kconfig isn't set to the ROM size, but to 4GB-64KB, ie. the standard start address of the bootblock. That's how it's used anyway (which didn't show because the linker scri

[coreboot] [commit] r4934 - in trunk: src/arch/i386 util/cbfstool util/newconfig

2009-11-11 Thread svn
Author: oxygene Date: 2009-11-11 21:32:23 + (Wed, 11 Nov 2009) New Revision: 4934 Modified: trunk/src/arch/i386/Kconfig trunk/src/arch/i386/Makefile.inc trunk/util/cbfstool/cbfstool.c trunk/util/newconfig/config.g Log: Rework bootblock size handling: - don't pretend to create a boo

Re: [coreboot] [v2] r4925 makes my linux hang

2009-11-11 Thread Stefan Reinauer
Myles Watson wrote: >> The good news is: >> chip southbridge/amd/rs780 unconditionally pulls in the graphics driver >> which is still executed per PCI ID, and not per notation of static.c >> >> So it's completely enough to drop the graphics device from >> Config.lb/devicetree.cb and say >> >> chip

Re: [coreboot] [v2] r4925 makes my linux hang

2009-11-11 Thread Myles Watson
On Wed, Nov 11, 2009 at 2:26 PM, Stefan Reinauer wrote: > Myles Watson wrote: >>> The good news is: >>> chip southbridge/amd/rs780 unconditionally pulls in the graphics driver >>> which is still executed per PCI ID, and not per notation of static.c >>> >>> So it's completely enough to drop the gra

Re: [coreboot] Coreboot bug?

2009-11-11 Thread ron minnich
On Wed, Nov 11, 2009 at 1:21 PM, Peter Stuge wrote: > Myles Watson wrote: >> >> unsigned char option_table[] = { >> >>        0xc8,0x00,0x00,0x00,0x88,0x04,0x00,0x00,0x0c,0x00, >> > >> > Second 32 bits 0x88,0x04,0x00,0x00 is the length. We're small endian. >> > So it's 0x488 or 1160 bytes. Does th

Re: [coreboot] [v2] r4925 makes my linux hang

2009-11-11 Thread Stefan Reinauer
Myles Watson wrote: >> The good news is: >> chip southbridge/amd/rs780 unconditionally pulls in the graphics driver >> which is still executed per PCI ID, and not per notation of static.c >> >> So it's completely enough to drop the graphics device from >> Config.lb/devicetree.cb and say >> >> chip

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Peter Stuge
Myles Watson wrote: > >> unsigned char option_table[] = { > >>        0xc8,0x00,0x00,0x00,0x88,0x04,0x00,0x00,0x0c,0x00, > > > > Second 32 bits 0x88,0x04,0x00,0x00 is the length. We're small endian. > > So it's 0x488 or 1160 bytes. Does that match? > > Yes, it matches. There are 116 10-byte lines

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Myles Watson
On Wed, Nov 11, 2009 at 1:50 PM, ron minnich wrote: > It's not my favorite piece of code. :) >> unsigned char option_table[] = { >>        0xc8,0x00,0x00,0x00,0x88,0x04,0x00,0x00,0x0c,0x00, > > Second 32 bits 0x88,0x04,0x00,0x00 is the length. We're small endian. > So it's 0x488 or 1160 bytes. Doe

Re: [coreboot] Coreboot bug?

2009-11-11 Thread ron minnich
It's not my favorite piece of code. > unsigned char option_table[] = { >0xc8,0x00,0x00,0x00,0x88,0x04,0x00,0x00,0x0c,0x00, Second 32 bits 0x88,0x04,0x00,0x00 is the length. We're small endian. So it's 0x488 or 1160 bytes. Does that match? So this struct: > struct lb_record { >uint

Re: [coreboot] Coreboot bug?

2009-11-11 Thread Myles Watson
On Wed, Nov 11, 2009 at 12:31 PM, Myles Watson wrote: > src/arch/i386/boot/coreboot_table.c: In function 'write_coreboot_table': > src/arch/i386/boot/coreboot_table.c:492: warning: dereferencing > pointer 'rec_src' does break strict-aliasing rules > src/arch/i386/boot/coreboot_table.c:491: note: i

Re: [coreboot] [PATCH]clean up bootblocksize handling in cbfstool, kconfig

2009-11-11 Thread Peter Stuge
Patrick Georgi wrote: > attached patch cleans up the bootblock size handling: > > Signed-off-by: Patrick Georgi Acked-by: Peter Stuge -- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] [PATCH]clean up bootblocksize handling in cbfstool, kconfig

2009-11-11 Thread Myles Watson
On Wed, Nov 11, 2009 at 1:16 PM, Patrick Georgi wrote: > 3. CONFIG_ROMBASE in kconfig isn't set to the ROM size, but to 4GB-64KB, ie. > the standard start address of the bootblock. That's how it's used anyway > (which didn't show because the linker script moves into top 64K if > necessary) This d

[coreboot] [PATCH]clean up bootblocksize handling in cbfstool, kconfig

2009-11-11 Thread Patrick Georgi
Hi, attached patch cleans up the bootblock size handling: 1. cbfstool create does no longer take a value it doesn't parse anyway (bootblocksize), but creates a bootblock of the size of the file that's filled in. 2. kconfig and newconfig are adapted to not pass the value 3. CONFIG_ROMBASE in

[coreboot] [commit] r4933 - trunk/src/lib

2009-11-11 Thread svn
Author: oxygene Date: 2009-11-11 19:31:53 + (Wed, 11 Nov 2009) New Revision: 4933 Modified: trunk/src/lib/cbfs.c Log: Help track down enable_rom issues in CBFS. If the magic looks like unmapped memory, point to the wiki page with more information. Signed-off-by: Patrick Georgi Acked-by: P

Re: [coreboot] [PATCH]More helpful error if cbfs header magic is 0xffffffff

2009-11-11 Thread Patrick Georgi
Am 11.11.2009 14:35, schrieb Carl-Daniel Hailfinger: Wouldn't this cause the warning to be printed multiple times if a contiguous section is all 0xff? That test merely validates the master header. If that one is wrong, CBFS goes boom, without any further lookup. And even if it printed the me

[coreboot] Coreboot bug?

2009-11-11 Thread Myles Watson
src/arch/i386/boot/coreboot_table.c: In function 'write_coreboot_table': src/arch/i386/boot/coreboot_table.c:492: warning: dereferencing pointer 'rec_src' does break strict-aliasing rules src/arch/i386/boot/coreboot_table.c:491: note: initialized from here #if (CONFIG_HAVE_OPTION_TABLE == 1)

Re: [coreboot] [PATCH] Seabios on Virtutech Simics x86-440bx model

2009-11-11 Thread Peter Stuge
Magnus Christensson wrote: >> How are you using coreboot+SeaBIOS? Are you using the QEMU coreboot >> target? Maybe that isn't good enough for Simics? > > I'm using naked SeaBIOS. Ah, ok. That makes sense. Thanks! //Peter -- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/m

Re: [coreboot] [PATCH]More helpful error if cbfs header magic is 0xffffffff

2009-11-11 Thread Peter Stuge
Patrick Georgi wrote: > attached patch hopefully helps track down issues related to late > enable_rom calls. > > Signed-off-by: Patrick Georgi Acked-by: Peter Stuge -- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] [PATCH] Seabios on Virtutech Simics x86-440bx model

2009-11-11 Thread Magnus Christensson
Peter Stuge wrote: Magnus Christensson wrote: I'm not sure how work is divided between Coreboot and Seabios. Does Coreboot do all the machine specific initialization? This is the idea. Ok. Then the LINT LVTs should already have been initialized. How are you using coreboot+

Re: [coreboot] [PATCH] Seabios on Virtutech Simics x86-440bx model

2009-11-11 Thread Magnus Christensson
Kevin O'Connor wrote: Hi Magnus, Is: for (i = 0, actual_cpu_count = 0; i < MaxCountCPUs; i++) { int log_cpus = (ebx >> 16) & 0xff; log_cpus = 1UL << fls(log_cpus - 1); /* round up to power of 2 */ if ((cpuid_features & (1 << 28)) && (i & (log_cpus - 1)) != 0)

Re: [coreboot] [v2] r4925 makes my linux hang

2009-11-11 Thread Myles Watson
> The good news is: > chip southbridge/amd/rs780 unconditionally pulls in the graphics driver > which is still executed per PCI ID, and not per notation of static.c > > So it's completely enough to drop the graphics device from > Config.lb/devicetree.cb and say > > chip southbridge/amd/rs780 >

Re: [coreboot] [PATCH] Seabios on Virtutech Simics x86-440bx model

2009-11-11 Thread Kevin O'Connor
Hi Magnus, Is: for (i = 0, actual_cpu_count = 0; i < MaxCountCPUs; i++) { int log_cpus = (ebx >> 16) & 0xff; log_cpus = 1UL << fls(log_cpus - 1); /* round up to power of 2 */ if ((cpuid_features & (1 << 28)) && (i & (log_cpus - 1)) != 0) continue; equivale

Re: [coreboot] [PATCH] Seabios on Virtutech Simics x86-440bx model

2009-11-11 Thread Kevin O'Connor
On Tue, Nov 10, 2009 at 09:30:47AM +0100, Magnus Christensson wrote: > I'm not sure how work is divided between Coreboot and Seabios. Does > Coreboot do all the machine specific initialization? Then the LINT LVTs > should already have been initialized. Yes. Coreboot is tasked with initializin

Re: [coreboot] [PATCH]More helpful error if cbfs header magic is 0xffffffff

2009-11-11 Thread Carl-Daniel Hailfinger
On 11.11.2009 13:55, Patrick Georgi wrote: > attached patch hopefully helps track down issues related to late > enable_rom calls. > If the CBFS header magic is 0x, chances are that this is > because the lower parts of the ROM aren't mapped yet. Point to > http://www.coreboot.org/Infrastruct

[coreboot] [PATCH]More helpful error if cbfs header magic is 0xffffffff

2009-11-11 Thread Patrick Georgi
Hi, attached patch hopefully helps track down issues related to late enable_rom calls. If the CBFS header magic is 0x, chances are that this is because the lower parts of the ROM aren't mapped yet. Point to http://www.coreboot.org/Infrastructure_Projects#CBFS, which provides some desc

Re: [coreboot] [v2] r4925 makes my linux hang

2009-11-11 Thread Stefan Reinauer
Peter Stuge wrote: > Config.lb_mahogany_k8 > >> chip southbridge/amd/rs780 >> device pci 0.0 on end # HT 0x9600 >> device pci 1.0 on # Internal Graphics P2P bridge 0x9602 >> chip drivers/pci/onboard >> device pci 5.0 on end # Internal Graphics