> Il 11 febbraio 2020 alle 5.11 Lokesh Vutla <lokeshvu...@ti.com> ha scritto:
> 
> 
> 
> 
> On 11/02/20 1:49 AM, dario...@libero.it wrote:
> > Hi Lokesh
> > 
> >> Il 10 febbraio 2020 alle 5.22 Lokesh Vutla <lokeshvu...@ti.com> ha scritto:
> >>
> >>
> >>
> >>
> >> On 10/02/20 12:17 AM, Dario Binacchi wrote:
> >>> Add the "u-boot,dm-pre-reloc" property to the "ti,tilcdc,panel"
> >>> compatible node. In this way the video-uclass module can allocate the
> >>> amount of memory needed to be assigned to the frame buffer.
> >>
> >> hmm..why do you need to add pre-reloc for allocating the memory? pre-reloc 
> >> flag
> >> is needed only when probing before relocation.
> >>
> > u-boot told me with an error message. 
> > Following the message I arrived at the video-uclass.c:
> > 
> >             /* Device tree node may need the 'u-boot,dm-pre-reloc' or
> >              * 'u-boot,dm-pre-proper' tag
> >              */
> >             printf("Video device '%s' cannot allocate frame buffer memory 
> > -ensure the device is set up before relocation\n",
> >                    dev->name);
> >             return -ENOSPC;
> 
> When does your driver gets probed?
The driver is probed in 
int board_late_init(void)
{
        ret = uclass_get_device(UCLASS_VIDEO, 0, &dev);
        if (ret)
                printf("Unable to get VIDEO device (%d)\n", ret);

        ret = uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con);
        if (ret)
                printf("Unable to get VIDEO CONSOLE device (%d)\n", ret);

        snprintf(buf, sizeof(buf), "%s\n%s\n", U_BOOT_VERSION, corp);
        vidconsole_position_cursor(con, 0, 0);
        for (s = buf; *s; s++)
                vidconsole_put_char(con, *s);

}

but, without the "u-boot,dm-pre-reloc" property, the error occurs early, during 
the video device post_binding.
I enabled debug messages in :
- drivers/core/device.c
- drivers/core/uclass.c
- drivers/video/video-uclass.c
and this is what is displayed by u-boot console:
U-Boot SPL 2018.11-rc2 (Feb 11 2020 - 17:34:58 +0100)
Trying to boot from NAND
## Checking hash(es) for Image uboot ... sha1+ OK
## Checking hash(es) for Image fdt ... sha1+ OK


U-Boot 2018.11-rc2 (Feb 11 2020 - 17:34:58 +0100)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x
DRAM:  Video frame buffers from 8fff0000 to 8fff0000
256 MiB
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
   - -1 -1 'root_driver'
   - not found
Bound device mod_exp_sw to root_driver
Bound device scm@210000 to l4_wkup@44c00000
Bound device l4_wkup@44c00000 to ocp
Bound device gpio@44e07000 to ocp
Bound device gpio@4804c000 to ocp
Bound device gpio@481ac000 to ocp
Bound device gpio@481ae000 to ocp
Bound device serial@44e09000 to ocp
Bound device serial@48022000 to ocp
Bound device serial@48024000 to ocp
Bound device serial@481a6000 to ocp
Bound device i2c@44e0b000 to ocp
Bound device i2c@4802a000 to ocp
Bound device mmc@48060000 to ocp
Bound device timer@48040000 to ocp
Bound device timer@48042000 to ocp
Bound device timer@48044000 to ocp
Bound device timer@48046000 to ocp
Bound device timer@48048000 to ocp
Bound device timer@4804a000 to ocp
Bound device usb@47401000 to usb@47400000
Bound device usb@47401800 to usb@47400000
Bound device usb@47400000 to ocp
Bound device ethernet@4a100000 to ocp
Bound device ocp to root_driver
Video device 'panel' cannot allocate frame buffer memory -ensure the device is 
set up before relocation
Error binding driver 'am335x_fb': -28
Some drivers failed to bind
initcall sequence 8ffca898 failed at call 8080f71f (err=-28)
### ERROR ### Please RESET the board ###  

Thanks
Best Regards
Dario 
> 
> Thanks and regards,
> Lokesh
> 
> >>>
> >>> Signed-off-by: Dario Binacchi <dario...@libero.it>
> >>
> >> $subject should be : arm: dts: am335x:
> > Ok. I will change it.
> > 
> >>
> >>> ---
> >>>
> >>>  arch/arm/dts/am335x-brppt1-mmc.dts  | 2 ++
> >>>  arch/arm/dts/am335x-brppt1-nand.dts | 2 ++
> >>>  arch/arm/dts/am335x-brppt1-spi.dts  | 2 ++
> >>>  arch/arm/dts/am335x-brsmarc1.dts    | 1 +
> >>>  arch/arm/dts/am335x-brxre1.dts      | 2 ++
> >>>  arch/arm/dts/am335x-evm.dts         | 1 +
> >>>  arch/arm/dts/am335x-evmsk.dts       | 1 +
> >>>  arch/arm/dts/am335x-guardian.dts    | 1 +
> >>>  arch/arm/dts/am335x-pdu001.dts      | 1 +
> >>>  arch/arm/dts/am335x-pxm50.dts       | 1 +
> >>>  arch/arm/dts/am335x-rut.dts         | 1 +
> >>>  arch/arm/dts/da850-evm.dts          | 1 +
> >>>  12 files changed, 16 insertions(+)
> >>>
> >>> diff --git a/arch/arm/dts/am335x-brppt1-mmc.dts 
> >>> b/arch/arm/dts/am335x-brppt1-mmc.dts
> >>> index 9be34d9da0..6f919711f0 100644
> >>> --- a/arch/arm/dts/am335x-brppt1-mmc.dts
> >>> +++ b/arch/arm/dts/am335x-brppt1-mmc.dts
> >>> @@ -53,6 +53,8 @@
> >>>           bkl-pwm = <&pwmbacklight>;
> >>>           bkl-tps = <&tps_bl>;
> >>>  
> >>> +         u-boot,dm-pre-reloc;
> >>
> >> This is u-boot specific dt flag. Please use it under *-u-boot.dtsi file.
> > Ok. I will fix it.
> > 
> > ---
> > Dario
> >>
> >> Thanks and regards,
> >> Lokesh

Reply via email to