[coreboot] [commit] r6253 - in trunk: src/arch/x86 src/mainboard/getac/p470 src/mainboard/kontron/986lcd-m src/mainboard/roda/rk886ex src/pc80 util/cbfstool

Stefan Reinauer stefan.reinauer at coreboot.org
Wed Jan 19 07:37:09 CET 2011


* Peter Stuge <peter at stuge.se> [110117 03:25]:
> repository service wrote:
> > +++ trunk/src/pc80/mc146818rtc_early.c	Fri Jan 14 08:40:24 2011	(r6253)
> ..
> >  static inline int do_normal_boot(void)
> >  {
> > +	char *cmos_default = cbfs_find_file("cmos.default", 0xaa);
> >  	unsigned char byte;
> > +	int i;
> >  
> >  	if (cmos_error() || !cmos_chksum_valid()) {
> > +		if (cmos_default) {
> > +			printk_warning("WARNING - CMOS CORRUPTED. RESTORING DEFAULTS.\n");
> > +			/* First 14 bytes are reserved for
> > +			   RTC and ignored by nvramtool, too.
> > +			   Only 128 bytes: 128+ requires cmos configuration and
> > +			   contains only suspend-to-ram data, which isn't part
> > +			   of the recovery procedure. */
> > +			for (i = 14; i < 128; i++) {
> > +				cmos_write(cmos_default[i], i);
> > +			}
> > +			/* Now reboot to run with default cmos. */
> > +			outb(0x06, 0xcf9);
> > +			for (;;) asm("hlt"); /* Wait for reset! */
> 
> Isn't this kinda ugly to have in the rtc code? We could at least have
> some kind of reset/reboot function..
 
agreed. Is this possible? Maybe romcc makes it harder ...

 




More information about the coreboot mailing list