rpi: Conditionally add simple-framebuffer node
PATCH 1/1 rpi: Conditionally add simple-framebuffer node
It appears that RPi firmware has already added framebuffer node under /chosen, at least on RPi 2 versions. So check for this and don't add duplicate node.
--- board/raspberrypi/rpi/rpi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
board/raspberrypi/rpi/rpi.c +5 -6
@@ -497,12 +497,11 @@ void *board_fdt_blob_setup(void)int ft_board_setup (void *blob,struct bd_info *bd) { -/* -* For now, we simply always add the simplefb DT node. Later, we -* should be more intelligent, and e.g. only do this if no enabled DT -* node exists for the "real" graphics driver. -*/ -lcd_dt_simplefb_add_node (blob); +int node; + + node =fdt_node_offset_by_compatible (blob,-1 ,"simple-framebuffer" ); +if (node <0 ) +lcd_dt_simplefb_add_node (blob);#ifdef CONFIG_EFI_LOADER /* Reserve the spin table */
Signature · 1 line
2.32.0
Hi,
Quoting Ivan T. Ivanov (2021-08-10 17:31:14)
Quoted 21 lines
It appears that RPi firmware has already added framebuffer node under /chosen, at least on RPi 2 versions. So check for this and don't add duplicate node.
Signed-off-by Ivan T. Ivanov <[email protected]>--- board/raspberrypi/rpi/rpi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)board/raspberrypi/rpi/rpi.c +0
-4@@ -497,12 +497,11 @@ void *board_fdt_blob_setup(void)int ft_board_setup (void *blob,struct bd_info *bd) { -/* -* For now, we simply always add the simplefb DT node. Later, we -* should be more intelligent, and e.g. only do this if no enabled DT -* node exists for the "real" graphics driver.
board/raspberrypi/rpi/rpi.c void *board_fdt_blob_setup(void) · line 507
Quoted 10 lines
board/raspberrypi/rpi/rpi.c +5
-2-*/ -lcd_dt_simplefb_add_node (blob); +int node; + + node =fdt_node_offset_by_compatible (blob,-1 ,"simple-framebuffer" ); +if (node <0 ) +lcd_dt_simplefb_add_node (blob);#ifdef CONFIG_EFI_LOADER /* Reserve the spin table */
Could someone take a look into this fix, please.
BTW, original message still awaits list moderator approval.
Thank you!
Ivan
Matthias Brugger
AppliedQuoted 5 lines · Ivan T. Ivanov
It appears that RPi firmware has already added framebuffer node under /chosen, at least on RPi 2 versions. So check for this and don't add duplicate node.
Signed-off-by Ivan T. Ivanov <[email protected]>
Applied to rpi-next now.
Thanks,
Matthias
Quoted 27 lines
--- board/raspberrypi/rpi/rpi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)board/raspberrypi/rpi/rpi.c +5
-6@@ -497,12 +497,11 @@ void *board_fdt_blob_setup(void)int ft_board_setup (void *blob,struct bd_info *bd) { -/* -* For now, we simply always add the simplefb DT node. Later, we -* should be more intelligent, and e.g. only do this if no enabled DT -* node exists for the "real" graphics driver. -*/ -lcd_dt_simplefb_add_node (blob); +int node; + + node =fdt_node_offset_by_compatible (blob,-1 ,"simple-framebuffer" ); +if (node <0 ) +lcd_dt_simplefb_add_node (blob);#ifdef CONFIG_EFI_LOADER /* Reserve the spin table */