On Nov 17, 2008 2:47pm, Joseph Smith <joe@settoplinux.org> wrote:<br />> <br />> <br />> <br />> <br />> <br />> <br />> On Mon, 17 Nov 2008 06:13:16 +0200, "Elia Yehuda" <br />> <br />> wrote:<br />> <br />> > On Mon, Nov 17, 2008 at 5:30 AM, Joseph Smith <br />> <br />> wrote:<br />> <br />> ><br />> <br />> >><br />> <br />> >><br />> <br />> >><br />> <br />> >> On Mon, 17 Nov 2008 04:25:34 +0200, "Elia Yehuda" <br />> <br />> >> wrote:<br />> <br />> >> > Those 2 patches are one step towards having a working Onboard-VGA<br />> <br />> >> > and 512MB (the max for i810). The raminit.c patch fixes some<br />> <br />> >> > misconfigurations and probes the DIMMs correctly (all dual-sided are<br />> <br />> >> > now recognized properly), and also set buffer_strength to handle 2<br />> <br />> >> > DIMMs although atm this doesn't work. The i82810/northbridge.c patch<br />> <br />> >> > takes care of allocating Onboard-VGA memory.<br />> <br />> >> ><br />> <br />> >> > Signed-off-by: Elia Yehuda <br />> <br />> >><br />> <br />> >> Sorry I'm going to have to nack your northbridge.patch.<br />> <br />> >><br />> <br />> >> Your VGA memory has to be subtracted from tomk in kb,like this:<br />> <br />> >><br />> <br />> >> #ifdef CONFIG_VIDEO_MB<br />> <br />> >>                /* check for VGA reserved memory<br />> <br />> >>                 * possible CONFIG_VIDEO_MB values are 512(kb) and 1(mb)<br />> <br />> >>                 */<br />> <br />> >>                if (CONFIG_VIDEO_MB == 512) {<br />> <br />> >>                        tomk -= 512;<br />> <br />> >>                } else if (CONFIG_VIDEO_MB == 1) {<br />> <br />> >>                        tomk -= 1024;<br />> <br />> >>                } else {<br />> <br />> >>                           /* assume no vga if incorrect value */<br />> <br />> >>                        tomk == tomk;<br />> <br />> >> #endif<br />> <br />> >><br />> <br />> ><br />> <br />> ><br />> <br />> > the place ive added this is when tomk is still set as MBs. Ofcourse i can<br />> <br />> > move<br />> <br />> > this a few lines down after tomk is converted to KBs. Ive just put it<br />> <br />> > there<br />> <br />> > to be<br />> <br />> > before the printk_debug("Setting RAM size to %d MB\n", tomk) so we can<br />> <br />> see<br />> <br />> > how much MBs are subtracted from tomk.<br />> <br />> ><br />> <br />> You will have to do that to make the 512 work. Or, what is the point in<br />> <br />> showing it in MB's, just for user aesthetics? It would be much more<br />> <br />> accurate to show it in kb's correct? Especially if your only subtracting<br />> <br />> 512kb. I would recomend changing this to kb's in the first place, that is<br />> <br />> what tomk stands for (top of memory in kb's).<br />> <br />> <br />> <br />> tomk += ((unsigned long)(translate_i82810_to_mb[drp_value]) * 1024);<br /><br />k, i'll put that after tomk is converted to KBs, and report of the subtracted KBs<br />with another printk_debug() - its too important to ignore (to make sure VGA<br />memory is allocated).<br /><br />> <br />> ><br />> <br />> ><br />> <br />> ---------------------------------------------------------------------------------<br />> <br />> ><br />> <br />> >     /* set System Management RAM Control Register / Graphics Mode Select<br />> <br />> > */<br />> <br />> >     value = pci_read_config8(ctrl->d0, SMRAM);<br />> <br />> >     /* Set size for Onboard-VGA framebuffer. */<br />> <br />> >     switch (CONFIG_VIDEO_MB) {<br />> <br />> >     case 512: /* 512K of memory */<br />> <br />> >         val = 0x2;<br />> <br />> >         break;<br />> <br />> >     case 1: /* 1M of memory */<br />> <br />> >         val = 0x3;<br />> <br />> >         break;<br />> <br />> >     default: /* No VGA memory */<br />> <br />> >         /* Preserve bits except for GMS */<br />> <br />> >         value &= 0x3f;<br />> <br />> >         pci_write_config16(ctrl->d0, SMRAM, value);<br />> <br />> >         val = 0x0;<br />> <br />> >     }<br />> <br />> >         value |= val  <br />> >     /* set AB segment Enabled as SMM RAM */<br />> <br />> >     value |= 0x0C;<br />> <br />> >     pci_write_config8(ctrl->d0, SMRAM, value);<br />> <br />> ><br />> <br />> ><br />> <br />> Yup that looks good, of course I haven't a chance to compaire it to the<br />> <br />> datasheet. So make sure you test it. This should go in raminit.c where you<br />> <br />> set the SMRAM register.<br /><br />yep, here is the revised and tested code :<br /><br />    /* set System Management RAM Control Register / Graphics Mode Select */<br />     value = pci_read_config8(ctrl->d0, SMRAM);<br />       /* Set size for Onboard-VGA framebuffer. */<br /> switch (CONFIG_VIDEO_MB) {<br />  case 512: /* 512K of memory */<br />              val = 0x2;<br />          break;<br />      case 1: /* 1M of memory */<br />          val = 0x3;<br />          break;<br />      default: /* No VGA memory */<br />                /* Preserve bits except for GMS */<br />          value &= 0x3f;<br />          val = 0x0;<br />          break;<br />      }<br />   value |= val << 6;<br />    /* set AB segment Enabled as SMM RAM */<br />     value |= 0x0C;<br />      pci_write_config8(ctrl->d0, SMRAM, value);<br /><br /><br />many thanks for your advices.<br /><br />also, if someone else could test the patches or have any insight regarding the<br />2nd DIMM issue i'll appreciate it.<br /><br />Elia.<br /><br />> <br />> <br />> <br />> --<br />> <br />> Thanks,<br />> <br />> Joseph Smith<br />> <br />> Set-Top-Linux<br />> <br />> www.settoplinux.org<br />> <br />> <br />>