Hi Chris,
Thanks for the excellent support! Following your instructions, I believe I am almost there. I've created a 320x240 16bbp framebuffer ( /dev/fb1 ) and I can disable fb0.
I boot the board and run the following commands:
cat /dev/zero > /dev/fb0
cd /sys/devices/platform/vdc5fb.0/graphics/fb0/
cat modes > mode
mem w l fcff7704 0
mem w l fcff7700 111
cat /dev/urandom > /dev/fb1
The only remaining problem is that when I run "cat /dev/urandom > /dev/fb1", the random data is put on the subsection of the display, but then immediately the kernel panics.
I've put a picture of the display here to show you:
Here are the relevant sections of the code that I modified. Do you have any suggestions? I think it has to do with gr3_fb. Thanks alot.
//#if 1 /* FLOATING LAYER SAMPLE */
/* Graphics 3 - Image Synthesizer */
/* Creates a 200x200 32-bit ARGB floating layer */
//#if XIP_KERNEL_WITHOUT_EXTERNAL_RAM
//uint8_t gr3_fb[ 320*240*4 ] __attribute__ ((aligned (PAGE_SIZE)));
//#else
#define gr3_fb 0x60600000 /* hard coded */
//#endif
//#endif
/* BOARD: You should rename this strucutre to match your LCD panel */
/* This structure passing info to the VDC5 driver */
static const struct vdc5fb_pdata vdc5fb_gwp0700cnwv04_pdata = {
.name = "gwp0700cnwv04",
.videomode = &videomode_gwp0700cnwv04,
.panel_icksel = ICKSEL_P1CLK, /* see include/video/vdc5fb.h */
.bpp = VDC5_0_BPP,
.panel_width = 154, /* mm, unused */
.panel_height = 86, /* mm, unused */
.flm_max = 1,
.out_format = OUT_FORMAT_RGB888,
.use_lvds = 0,
.tcon_sel = {
[LCD_TCON0] = TCON_SEL_UNUSED, /* MODE */
[LCD_TCON1] = TCON_SEL_UNUSED, /* DITH */
[LCD_TCON2] = TCON_SEL_DE, /* RGB_EN */
[LCD_TCON3] = TCON_SEL_STH, /* RGB_HSYNC */
[LCD_TCON4] = TCON_SEL_STVA, /* RGB_VSYNC */
[LCD_TCON5] = TCON_SEL_UNUSED, /* LR_INV */
[LCD_TCON6] = TCON_SEL_UNUSED, /* UD_INV */
},
.pinmux = vdc5fb_0_pinmux,
.layers = {
/* Graphics 2 - Image Synthesizer */
/* Full LCD Panel - will be /dev/fb0 */
[2].xres = 800,
[2].yres = 480,
[2].x_offset = 0,
[2].y_offset = 0,
#if VDC5_0_BPP == 16
[2].format = GR_FORMAT(GR_FORMAT_RGB565) | GR_RDSWA(6),
#else
[2].format = GR_FORMAT(GR_FORMAT_ARGB8888) | GR_RDSWA(4),
#endif
[2].bpp = VDC5_0_BPP,
[2].base = VDC5_0_FB_ADDR,
[2].blend = 0,
#if 1 /* FLOATING LAYER SAMPLE */
/* Graphics 3 - Image Synthesizer */
/* Creates a 320x240 32-bit ARGB floating layer */
[3].xres = 320,
[3].yres = 240,
[3].x_offset = 100,
[3].y_offset = 100,
[3].format = GR_FORMAT(GR_FORMAT_ARGB8888) | GR_RDSWA(4),
[3].bpp = 32,
[3].base = (u32)gr3_fb,
[3].blend = 1,
#endif
},
};
static const struct platform_device_info vdc5fb0_info __initconst = {
.name = "vdc5fb",
.id = 0, /* ch 0 */
.res = vdc5fb0_resources,
.num_res = ARRAY_SIZE(vdc5fb0_resources),
.data = &vdc5fb_gwp0700cnwv04_pdata,
.size_data = sizeof(vdc5fb_gwp0700cnwv04_pdata),
.dma_mask = DMA_BIT_MASK(32), /* only needed if not hardcoding fb */
};
#if 1 /* FLOATING LAYER SAMPLE */
/* Graphics 3 - Image Synthesizer */
/* Map our floating layer as /dev/fb1 */
#ifndef CONFIG_FB_SIMPLE
#error Requires CONFIG_FB_SIMPLE=y
#endif
/* simple-framebuffer */
static const struct resource simplefb_resources[] __initconst = {
DEFINE_RES_MEM_NAMED(gr3_fb, 320*240*4, "vdc5_alpha.0: fb"),
};
static const struct simplefb_platform_data simplefb_pdata = {
.width = 320,
.height = 240,
.stride = 240 * 4,
.format = "a8r8g8b8",
};
static const struct platform_device_info simplefb_info __initconst = {
.parent = &platform_bus,
.name = "simple-framebuffer",
.id = -1,
.res = simplefb_resources,
.num_res = ARRAY_SIZE(simplefb_resources),
.data = &simplefb_pdata,
.size_data = sizeof(simplefb_pdata),
};
#endif /* FLOATING LAYER SAMPLE */
Phil
UPDATE:
Here is the beginning of the Kernel traceback:
BUG: Bad page map in process cat pte:3063e91e pmd:20833831
addr:b6f6d000 vm_flags:00100073 anon_vma:c045a468 mapping: (null) index:b6f6d
CPU: 0 PID: 562 Comm: cat Not tainted 3.14.28-ltsi #39
[<bf009a40>] (unwind_backtrace) from [<bf0080e8>] (show_stack+0x10/0x14)
[<bf0080e8>] (show_stack) from [<bf06e864>] (print_bad_pte+0x158/0x18c)
[<bf06e864>] (print_bad_pte) from [<bf0714f0>] (handle_mm_fault+0x1a8/0x6ac)
[<bf0714f0>] (handle_mm_fault) from [<bf00d500>] (do_page_fault+0x10c/0x368)
[<bf00d500>] (do_page_fault) from [<bf000398>] (do_DataAbort+0x34/0x98)
[<bf000398>] (do_DataAbort) from [<bf008c74>] (__dabt_usr+0x34/0x40)
Exception stack(0xc0847fb0 to 0xc0847ff8)
7fa0: b6f6d4c0 0000001c 000000f0 00001000
7fc0: 000a59f0 00000001 beaf2b88 00001000 00000001 00000000 00000001 00000003
7fe0: 00000000 beaf2b50 00010974 b6e847d0 20070030 ffffffff
Disabling lock debugging due to kernel taint
BUG: Bad page map in process cat pte:075d44ce pmd:20833831
addr:b6e6e000 vm_flags:10004075 anon_vma: (null) mapping:c0010ca4 index:1
vma->vm_ops->fault: axfs_fault+0x0/0x104
vma->vm_file->f_op->mmap: axfs_mmap+0x0/0x24
CPU: 0 PID: 562 Comm: cat Tainted: G B 3.14.28-ltsi #39
[<bf009a40>] (unwind_backtrace) from [<bf0080e8>] (show_stack+0x10/0x14)
[<bf0080e8>] (show_stack) from [<bf06e864>] (print_bad_pte+0x158/0x18c)
[<bf06e864>] (print_bad_pte) from [<bf06f6d8>] (unmap_single_vma+0x478/0x54c)
[<bf06f6d8>] (unmap_single_vma) from [<bf070490>] (unmap_vmas+0x44/0x54)
[<bf070490>] (unmap_vmas) from [<bf075434>] (exit_mmap+0xc4/0x1e8)
[<bf075434>] (exit_mmap) from [<bf011650>] (mmput+0x34/0xa4)
[<bf011650>] (mmput) from [<bf014ba4>] (do_exit+0x2d0/0x778)
[<bf014ba4>] (do_exit) from [<bf0150c4>] (do_group_exit+0x4c/0xa0)
[<bf0150c4>] (do_group_exit) from [<bf01ea04>] (get_signal_to_deliver+0x420/0x464)
[<bf01ea04>] (get_signal_to_deliver) from [<bf0079ac>] (do_signal+0xa8/0x39c)
[<bf0079ac>] (do_signal) from [<bf007de8>] (do_work_pending+0x54/0xa4)
[<bf007de8>] (do_work_pending) from [<bf0054c0>] (work_pending+0xc/0x20)
BUG: Bad page map in process cat pte:4a86a8f4 pmd:20833831
addr:b6e72000 vm_flags:10004075 anon_vma: (null) mapping:c0010ca4 index:5
vma->vm_ops->fault: axfs_fault+0x0/0x104
vma->vm_file->f_op->mmap: axfs_mmap+0x0/0x24
CPU: 0 PID: 562 Comm: cat Tainted: G B 3.14.28-ltsi #39
[<bf009a40>] (unwind_backtrace) from [<bf0080e8>] (show_stack+0x10/0x14)
[<bf0080e8>] (show_stack) from [<bf06e864>] (print_bad_pte+0x158/0x18c)
[<bf06e864>] (print_bad_pte) from [<bf06f6d8>] (unmap_single_vma+0x478/0x54c)
[<bf06f6d8>] (unmap_single_vma) from [<bf070490>] (unmap_vmas+0x44/0x54)
[<bf070490>] (unmap_vmas) from [<bf075434>] (exit_mmap+0xc4/0x1e8)
[<bf075434>] (exit_mmap) from [<bf011650>] (mmput+0x34/0xa4)
[<bf011650>] (mmput) from [<bf014ba4>] (do_exit+0x2d0/0x778)
[<bf014ba4>] (do_exit) from [<bf0150c4>] (do_group_exit+0x4c/0xa0)
[<bf0150c4>] (do_group_exit) from [<bf01ea04>] (get_signal_to_deliver+0x420/0x464)
[<bf01ea04>] (get_signal_to_deliver) from [<bf0079ac>] (do_signal+0xa8/0x39c)
[<bf0079ac>] (do_signal) from [<bf007de8>] (do_work_pending+0x54/0xa4)
[<bf007de8>] (do_work_pending) from [<bf0054c0>] (work_pending+0xc/0x20)
Unable to handle kernel paging request at virtual address de4bd700
pgd = c012c00