mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* simplefb question
@ 2019-06-03  9:46 Robin van der Gracht
  2019-06-04  9:20 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Robin van der Gracht @ 2019-06-03  9:46 UTC (permalink / raw)
  To: Andre Heider, Sascha Hauer, barebox

Hello Andre, Sascha,

I'm trying to setup simplefb on my imx6 solo board, and ran into some 
issues and I'm hoping you could
clear things up.

I'm running:
  - Barebox 2018.07.0
  - Linux 4.19

I checked with latest versions but the relevant code seems unchanged.

On Barebox console I ran:

barebox@BOARD:/ of_dump /framebuffer
framebuffer {
         display = <0x5a>;
};

barebox@BOARD:/ fb0.enable=1
imx-ipuv3-crtc imx-ipuv3-crtc0: ipu_crtc_mode_set: mode->xres: 800
imx-ipuv3-crtc imx-ipuv3-crtc0: ipu_crtc_mode_set: mode->yres: 480
WARNING: imx-ipuv3-crtc imx-ipuv3-crtc0: videomode adapted for IPU 
restriction

barebox@BOARD:/ fb0.register_simplefb=1

barebox@BOARD:/ oftree -s dump.dtb
fb0: created r8g8b8 node    (I added that mode)

barebox@BOARD:/ of_dump -f dump.dtb /framebuffer
framebuffer {
         display = <0x5a>;
         compatible = "simple-framebuffer";
         reg = <0x19ca9000 0x177000>;
         width = <0x320>;
         height = <0x1e0>;
         stride = <0xc80>;
         format = "r8g8b8";
         status = "okay";
};

# Side-note: Kernel doc says this device-tree node has to in the /chosen 
section..?

The framebuffer is allocated in 'drivers/video/imx-ipu-v3/ipufb.c' 
ipufb_activate_var() with dma_alloc_writecombine().

This failed with my Barebox version, and found that Sascha fixed that 
upstream, so I applied these:
  - ARM: MMU: fix arch_remap_range() across section boundaries
  - ARM: mmu: fix cache flushing when replacing a section with a PTE
  - ARM: MMU: fix wrong dma_flush_range in arm_create_pte()

# So far so good.

When I boot Linux I get the following WARN()

[    0.071950] ------------[ cut here ]------------
[    0.071974] WARNING: CPU: 0 PID: 1 at arch/arm/mm/ioremap.c:309 
__arm_ioremap_pfn_caller+0x1ec/0x210
[    0.071980] Modules linked in:
[    0.071998] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 
4.19.0-20190401-1-00290-gd141d156c111f-dirty #1023
[    0.072007] Hardware name: Freescale i.MX6 Quad/DualLite (Device 
Tree)
[    0.072036] [<8010ffec>] (unwind_backtrace) from [<8010b8dc>] 
(show_stack+0x10/0x14)
[    0.072053] [<8010b8dc>] (show_stack) from [<8091d5fc>] 
(dump_stack+0x88/0x9c)
[    0.072074] [<8091d5fc>] (dump_stack) from [<8011e5d8>] 
(__warn+0xd4/0xf0)
[    0.072092] [<8011e5d8>] (__warn) from [<8011e634>] 
(warn_slowpath_null+0x40/0x48)
[    0.072109] [<8011e634>] (warn_slowpath_null) from [<80115230>] 
(__arm_ioremap_pfn_caller+0x1ec/0x210)
[    0.072124] [<80115230>] (__arm_ioremap_pfn_caller) from [<80115298>] 
(__arm_ioremap_caller+0x44/0x54)
[    0.072141] [<80115298>] (__arm_ioremap_caller) from [<80407900>] 
(simplefb_probe+0x1fc/0x898)
[    0.072162] [<80407900>] (simplefb_probe) from [<804ade34>] 
(platform_drv_probe+0x48/0x98)
[    0.072179] [<804ade34>] (platform_drv_probe) from [<804ac23c>] 
(really_probe+0x1f4/0x2b8)
[    0.072193] [<804ac23c>] (really_probe) from [<804ac464>] 
(driver_probe_device+0x60/0x164)
[    0.072207] [<804ac464>] (driver_probe_device) from [<804ac644>] 
(__driver_attach+0xdc/0xe0)
[    0.072224] [<804ac644>] (__driver_attach) from [<804aa540>] 
(bus_for_each_dev+0x74/0xb4)
[    0.072242] [<804aa540>] (bus_for_each_dev) from [<804ab6cc>] 
(bus_add_driver+0x1bc/0x200)
[    0.072258] [<804ab6cc>] (bus_add_driver) from [<804acf50>] 
(driver_register+0x7c/0x114)
[    0.072276] [<804acf50>] (driver_register) from [<80e1b1f8>] 
(simplefb_init+0x14/0x8c)
[    0.072293] [<80e1b1f8>] (simplefb_init) from [<80102618>] 
(do_one_initcall+0x7c/0x1a8)
[    0.072313] [<80102618>] (do_one_initcall) from [<80e00e40>] 
(kernel_init_freeable+0x148/0x1dc)
[    0.072334] [<80e00e40>] (kernel_init_freeable) from [<80930c78>] 
(kernel_init+0x8/0x110)
[    0.072349] [<80930c78>] (kernel_init) from [<801010d8>] 
(ret_from_fork+0x14/0x3c)
[    0.072358] Exception stack(0x8b84bfb0 to 0x8b84bff8)
[    0.072369] bfa0:                                     00000000 
00000000 00000000 00000000
[    0.072381] bfc0: 00000000 00000000 00000000 00000000 00000000 
00000000 00000000 00000000
[    0.072391] bfe0: 00000000 00000000 00000000 00000000 00000013 
00000000
[    0.072435] ---[ end trace d197b304a56deeb0 ]---
[    0.072463] simple-framebuffer: probe of 19ca9000.framebuffer failed 
with error -12

If I understand correctly, this is due to the use of ioremap_wc on a RAM 
region. I was hoping you could tell me what I'm doing wrong here, or if 
I'm looking at a bug.

My mtype = MT_DEVICE_WC. (Due to the in kernel use of ioremap_wc())
My pfn = 0x19ca9

In my kernel .config i have:
CONFIG_HAVE_ARCH_PFN_VALID=y

Kind regards,

Robin van der Gracht

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: simplefb question
  2019-06-03  9:46 simplefb question Robin van der Gracht
@ 2019-06-04  9:20 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2019-06-04  9:20 UTC (permalink / raw)
  To: Robin van der Gracht; +Cc: barebox, Andre Heider

Hi Robin,

On Mon, Jun 03, 2019 at 11:46:05AM +0200, Robin van der Gracht wrote:
> # So far so good.
> 
> When I boot Linux I get the following WARN()
> 
> [    0.071950] ------------[ cut here ]------------
> [    0.071974] WARNING: CPU: 0 PID: 1 at arch/arm/mm/ioremap.c:309
> __arm_ioremap_pfn_caller+0x1ec/0x210
> [    0.071980] Modules linked in:
> [    0.071998] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
> 4.19.0-20190401-1-00290-gd141d156c111f-dirty #1023
> [    0.072007] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> [    0.072036] [<8010ffec>] (unwind_backtrace) from [<8010b8dc>]
> (show_stack+0x10/0x14)
> [    0.072053] [<8010b8dc>] (show_stack) from [<8091d5fc>]
> (dump_stack+0x88/0x9c)
> [    0.072074] [<8091d5fc>] (dump_stack) from [<8011e5d8>]
> (__warn+0xd4/0xf0)
> [    0.072092] [<8011e5d8>] (__warn) from [<8011e634>]
> (warn_slowpath_null+0x40/0x48)
> [    0.072109] [<8011e634>] (warn_slowpath_null) from [<80115230>]
> (__arm_ioremap_pfn_caller+0x1ec/0x210)
> [    0.072124] [<80115230>] (__arm_ioremap_pfn_caller) from [<80115298>]
> (__arm_ioremap_caller+0x44/0x54)
> [    0.072141] [<80115298>] (__arm_ioremap_caller) from [<80407900>]
> (simplefb_probe+0x1fc/0x898)
> [    0.072162] [<80407900>] (simplefb_probe) from [<804ade34>]
> (platform_drv_probe+0x48/0x98)
> [    0.072179] [<804ade34>] (platform_drv_probe) from [<804ac23c>]
> (really_probe+0x1f4/0x2b8)
> [    0.072193] [<804ac23c>] (really_probe) from [<804ac464>]
> (driver_probe_device+0x60/0x164)
> [    0.072207] [<804ac464>] (driver_probe_device) from [<804ac644>]
> (__driver_attach+0xdc/0xe0)
> [    0.072224] [<804ac644>] (__driver_attach) from [<804aa540>]
> (bus_for_each_dev+0x74/0xb4)
> [    0.072242] [<804aa540>] (bus_for_each_dev) from [<804ab6cc>]
> (bus_add_driver+0x1bc/0x200)
> [    0.072258] [<804ab6cc>] (bus_add_driver) from [<804acf50>]
> (driver_register+0x7c/0x114)
> [    0.072276] [<804acf50>] (driver_register) from [<80e1b1f8>]
> (simplefb_init+0x14/0x8c)
> [    0.072293] [<80e1b1f8>] (simplefb_init) from [<80102618>]
> (do_one_initcall+0x7c/0x1a8)
> [    0.072313] [<80102618>] (do_one_initcall) from [<80e00e40>]
> (kernel_init_freeable+0x148/0x1dc)
> [    0.072334] [<80e00e40>] (kernel_init_freeable) from [<80930c78>]
> (kernel_init+0x8/0x110)
> [    0.072349] [<80930c78>] (kernel_init) from [<801010d8>]
> (ret_from_fork+0x14/0x3c)
> [    0.072358] Exception stack(0x8b84bfb0 to 0x8b84bff8)
> [    0.072369] bfa0:                                     00000000 00000000
> 00000000 00000000
> [    0.072381] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000
> 00000000 00000000
> [    0.072391] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
> [    0.072435] ---[ end trace d197b304a56deeb0 ]---
> [    0.072463] simple-framebuffer: probe of 19ca9000.framebuffer failed with
> error -12
> 
> If I understand correctly, this is due to the use of ioremap_wc on a RAM
> region. I was hoping you could tell me what I'm doing wrong here, or if I'm
> looking at a bug.
> 
> My mtype = MT_DEVICE_WC. (Due to the in kernel use of ioremap_wc())
> My pfn = 0x19ca9
> 
> In my kernel .config i have:
> CONFIG_HAVE_ARCH_PFN_VALID=y

The barebox simplefb driver does a:

   of_add_reserve_entry((u32)fbi->screen_base,
                        (u32)fbi->screen_base + fbi->screen_size);

So at least the kernel shouldn't overwrite the framebuffer.

Maybe this is not enough though. It may be that you have to decrease
the memory regions and put the framebuffer in the free space.
Unfortunately the barebox IPUv3 driver doesn't support using a board
provided framebuffer.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2019-06-04  9:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-03  9:46 simplefb question Robin van der Gracht
2019-06-04  9:20 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox