All of lore.kernel.org
 help / color / mirror / Atom feed
* [GITGRUB] FB driver for OLPC
@ 2009-08-16 10:03 Bean
  2009-08-17 13:22 ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 6+ messages in thread
From: Bean @ 2009-08-16 10:03 UTC (permalink / raw)
  To: The development of GRUB 2

Hi,

This patch adds fb device for i386-ieee1275 platform, the usage is
quite similar to efi fb.

BTW, openfirmware platforms reserve too little memory so that gfxterm
can't start, I increase the heap size to 8m for now.

The patch can be downloaded at:

http://github.com/bean123/grub/tree/master

-- 
Bean

gitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GITGRUB] FB driver for OLPC
  2009-08-16 10:03 [GITGRUB] FB driver for OLPC Bean
@ 2009-08-17 13:22 ` Vladimir 'phcoder' Serbinenko
  2009-08-17 14:22   ` Bean
  0 siblings, 1 reply; 6+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-08-17 13:22 UTC (permalink / raw)
  To: The development of GRUB 2

On Sun, Aug 16, 2009 at 12:03 PM, Bean<bean123ch@gmail.com> wrote:
> Hi,
>
> This patch adds fb device for i386-ieee1275 platform, the usage is
> quite similar to efi fb.
>
> BTW, openfirmware platforms reserve too little memory so that gfxterm
> can't start, I increase the heap size to 8m for now.
>

>static grub_uint32_t fb_addr;
>static grub_uint32_t fb_width;
>static grub_uint32_t fb_height;
>static grub_uint32_t fb_pitch;
These values are a duplicate of values found in framebuffer variable

>static grub_err_t
>grub_video_ofw_init (void)
>{
> check_device ();
check_device is already called on module init
>static grub_err_t
>grub_video_ofw_fini (void)
>{
>  return grub_video_fb_fini ();
>}
You can just set .fini = grub_video_fb_fini,

>  if (((! width) || (width == fb_width)) &&
>      ((! height) || (height == fb_height)) &&
>      ((! depth) || (depth == 16)))
>    {
Does OLPC support only one resolution? Is it the same for qemu with
ofw? Or coreboot+ofw?
>      framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB;
>      framebuffer.mode_info.bpp = 16;
>      framebuffer.mode_info.bytes_per_pixel = 2;
>      framebuffer.mode_info.number_of_colors = 256; /* TODO: fix me. */
>      framebuffer.mode_info.red_mask_size = 5;
>      framebuffer.mode_info.red_field_pos = 11;
>      framebuffer.mode_info.green_mask_size = 6;
>      framebuffer.mode_info.green_field_pos = 5;
>      framebuffer.mode_info.blue_mask_size = 5;
>      framebuffer.mode_info.blue_field_pos = 0;
Can this info be retrieved from OFW instead of being hardcoded?
> --
> Bean
>
> gitgrub home: http://github.com/grub/grub/
> my fork page: http://github.com/bean123/grub/
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>



-- 
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GITGRUB] FB driver for OLPC
  2009-08-17 13:22 ` Vladimir 'phcoder' Serbinenko
@ 2009-08-17 14:22   ` Bean
  2009-08-27 17:57     ` Bean
  0 siblings, 1 reply; 6+ messages in thread
From: Bean @ 2009-08-17 14:22 UTC (permalink / raw)
  To: The development of GRUB 2

On Mon, Aug 17, 2009 at 9:22 PM, Vladimir 'phcoder'
Serbinenko<phcoder@gmail.com> wrote:
> On Sun, Aug 16, 2009 at 12:03 PM, Bean<bean123ch@gmail.com> wrote:
>> Hi,
>>
>> This patch adds fb device for i386-ieee1275 platform, the usage is
>> quite similar to efi fb.
>>
>> BTW, openfirmware platforms reserve too little memory so that gfxterm
>> can't start, I increase the heap size to 8m for now.
>>
>
>>static grub_uint32_t fb_addr;
>>static grub_uint32_t fb_width;
>>static grub_uint32_t fb_height;
>>static grub_uint32_t fb_pitch;
> These values are a duplicate of values found in framebuffer variable

Hi,

These are the global settings detected in check_device, the variables
in framebuffer get zero out in init function.

>
>>static grub_err_t
>>grub_video_ofw_init (void)
>>{
>> check_device ();
> check_device is already called on module init
>>static grub_err_t
>>grub_video_ofw_fini (void)
>>{
>>  return grub_video_fb_fini ();
>>}
> You can just set .fini = grub_video_fb_fini,
>

Ok.

>>  if (((! width) || (width == fb_width)) &&
>>      ((! height) || (height == fb_height)) &&
>>      ((! depth) || (depth == 16)))
>>    {
> Does OLPC support only one resolution? Is it the same for qemu with
> ofw? Or coreboot+ofw?

I suppose it supports other modes, as there are suspicious words like
640x480 in the display device. But as I don't find docs on accessing
them, it's basically guess work and may not be portable.

>>      framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB;
>>      framebuffer.mode_info.bpp = 16;
>>      framebuffer.mode_info.bytes_per_pixel = 2;
>>      framebuffer.mode_info.number_of_colors = 256; /* TODO: fix me. */
>>      framebuffer.mode_info.red_mask_size = 5;
>>      framebuffer.mode_info.red_field_pos = 11;
>>      framebuffer.mode_info.green_mask_size = 6;
>>      framebuffer.mode_info.green_field_pos = 5;
>>      framebuffer.mode_info.blue_mask_size = 5;
>>      framebuffer.mode_info.blue_field_pos = 0;
> Can this info be retrieved from OFW instead of being hardcoded?

There seems to be explicit information on this, but there are huge
number of words in the display device, it may be be hidden somewhere.

-- 
Bean

gitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GITGRUB] FB driver for OLPC
  2009-08-17 14:22   ` Bean
@ 2009-08-27 17:57     ` Bean
  2009-08-28 12:54       ` Robert Millan
  0 siblings, 1 reply; 6+ messages in thread
From: Bean @ 2009-08-27 17:57 UTC (permalink / raw)
  To: The development of GRUB 2

Hi,

Update:

Extends the driver to support powerpc-ieee1275. It's quite similar to
i386-ieee1275, but it uses 8-bit indexed color instead of 16-bit
color.

I use the following command to generate grub.elf:

grub-mkimage -d . -m memdisk -o grub.elf minicmd cpio memdisk normal
sh ls ofw_fb font gfxterm

memdisk contains ascii.pf2 and grub.cfg:

set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
loadfont /boot/grub/ascii.pf2
terminal_output.gfxterm

menuentry "halt"  {
  halt
}

Tested ok on the following platform:

OLPC (i386-ieee1275)
OpenBIOS (powerpc-ieee1275)
PPC Mac Mini (powerpc-ieee1275)

-- 
Bean

gitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GITGRUB] FB driver for OLPC
  2009-08-27 17:57     ` Bean
@ 2009-08-28 12:54       ` Robert Millan
  2009-08-28 14:03         ` Bean
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Millan @ 2009-08-28 12:54 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, Aug 28, 2009 at 01:57:59AM +0800, Bean wrote:
> Hi,
> 
> Update:
> 
> Extends the driver to support powerpc-ieee1275. It's quite similar to
> i386-ieee1275, but it uses 8-bit indexed color instead of 16-bit
> color.

Hi,

You forgot to attach it?

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GITGRUB] FB driver for OLPC
  2009-08-28 12:54       ` Robert Millan
@ 2009-08-28 14:03         ` Bean
  0 siblings, 0 replies; 6+ messages in thread
From: Bean @ 2009-08-28 14:03 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, Aug 28, 2009 at 8:54 PM, Robert Millan<rmh@aybabtu.com> wrote:
> On Fri, Aug 28, 2009 at 01:57:59AM +0800, Bean wrote:
>> Hi,
>>
>> Update:
>>
>> Extends the driver to support powerpc-ieee1275. It's quite similar to
>> i386-ieee1275, but it uses 8-bit indexed color instead of 16-bit
>> color.
>
> Hi,
>
> You forgot to attach it?

Hi,

It's in my repo. This patch relies on the new mode_type/mode_mask
interface of phcoder's patch, so it currently can't be compiled again
svn tree.

-- 
Bean

gitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-28 14:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-16 10:03 [GITGRUB] FB driver for OLPC Bean
2009-08-17 13:22 ` Vladimir 'phcoder' Serbinenko
2009-08-17 14:22   ` Bean
2009-08-27 17:57     ` Bean
2009-08-28 12:54       ` Robert Millan
2009-08-28 14:03         ` Bean

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.