Re: [PATCH 1/6 v2] ARM: Add basic architecture support forVIA/WonderMedia 85xx SoC's

From: Alexey Charkov
Date: Sun Nov 07 2010 - 12:08:51 EST


2010/11/7 Russell King - ARM Linux <linux@xxxxxxxxxxxxxxxx>:
> On Sun, Nov 07, 2010 at 07:28:52PM +0300, Alexey Charkov wrote:
>> +static inline void preallocate_fb(struct vt8500fb_platform_data *p,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â unsigned long align) {
>> + Â Â p->video_mem_len = (p->xres_virtual * p->yres_virtual * 4) >>
>> + Â Â Â Â Â Â Â Â Â Â (p->bpp > 16 ? 0 : (p->bpp > 8 ? 1 :
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (8 / p->bpp) + 1));
>> + Â Â p->video_mem_phys = (unsigned long)memblock_alloc(p->video_mem_len,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â align);
>> + Â Â p->video_mem_virt = phys_to_virt(p->video_mem_phys);
>> +}
> ...
>> +void __init vt8500_map_io(void)
>> +{
>> + Â Â wmt_current_regs = &wmt_regmaps[VT8500_INDEX];
>> + Â Â wmt_current_irqs = &wmt_irqs[VT8500_INDEX];
>> + Â Â set_data();
>> +#ifdef CONFIG_FB_VT8500
>> + Â Â panels[current_panel_idx].bpp = 16; /* Always use RGB565 */
>> + Â Â preallocate_fb(&panels[current_panel_idx], SZ_4M);
>> + Â Â vt8500_device_lcdc.dev.platform_data = &panels[current_panel_idx];
>> +#endif
>> + Â Â iotable_init(vt8500_io_desc, ARRAY_SIZE(vt8500_io_desc));
>> +}
> ...
>> +void __init wm8505_map_io(void)
>> +{
>> + Â Â wmt_current_regs = &wmt_regmaps[WM8505_INDEX];
>> + Â Â wmt_current_irqs = &wmt_irqs[WM8505_INDEX];
>> + Â Â set_data();
>> +#ifdef CONFIG_FB_WM8505
>> + Â Â panels[current_panel_idx].bpp = 32; /* Always use RGB888 */
>> + Â Â preallocate_fb(&panels[current_panel_idx], 32);
>> + Â Â vt8500_device_wm8505_fb.dev.platform_data = &panels[current_panel_idx];
>> +#endif
>> + Â Â iotable_init(vt8500_io_desc, ARRAY_SIZE(vt8500_io_desc));
>> +}
>
> I'd much prefer that the allocation of memblock memory is done via the
> 'reserve' machine callback, rather than trying to group it into the IO
> mapping callback. ÂIs there a reason it can't be?
>

I believe it can. Thanks for the info, I just didn't know about that.
Will fix this shortly.

Is it OK to leave resources assignment in map_io or is there a better
place to do that as well?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/