fdt: add new fdt_fixup_display function to configure display
PATCH 1/1 fdt: add new fdt_fixup_display function to configure display
Add 'fdt_fixup_display' function to fixup device-tree for a specific display. This is useful if a device-tree has configurations for multiple display timings for undetectable displays.
--- common/fdt_support.c | 31 +++++++++++++++++++++++++++++++ include/fdt_support.h | 1 + 2 files changed, 32 insertions(+)
common/fdt_support.c +31 -0
@@ -1560,3 +1560,34 @@ int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width,return 0 ; } + +/* +* Update native-mode in display-timings from display environment variable. +* The node to update are specified by path. +*/ +int fdt_fixup_display (void *blob,const char *path,const char *display) +{ +int off, toff; + +if (!display || !path) +return -1 ; + + toff =fdt_path_offset (blob, path); +if (toff >=0 ) + toff =fdt_subnode_offset (blob, toff,"display-timings" ); +if (toff <0 ) +return toff; + +for (off =fdt_first_subnode (blob, toff); + off >=0 ; + off =fdt_next_subnode (blob, off)) { +uint32_t handle =fdt_get_phandle (blob, off); +debug ("%s:0x%x\n" ,fdt_get_name (blob, off,NULL ), +fdt32_to_cpu (handle)); +if (strcasecmp (fdt_get_name (blob, off,NULL ), display) ==0 ) { +fdt_setprop_u32 (blob, toff,"native-mode" , handle); +break ; + } + } +return toff; +}
include/fdt_support.h +1 -0
@@ -46,6 +46,7 @@ void fdt_fixup_ethernet(void *fdt);int fdt_find_and_setprop (void *fdt,const char *node,const char *prop,const void *val,int len,int create);void fdt_fixup_qe_firmware (void *fdt); +int fdt_fixup_display (void *blob,const char *path,const char *display);#if defined(CONFIG_HAS_FSL_DR_USB ) || defined(CONFIG_HAS_FSL_MPH_USB )void fdt_fixup_dr_usb (void *blob,bd_t *bd);
Signature · 1 line
1.9.1
PATCH 1/1 fdt: add new fdt_fixup_display function to configure display
Hi Tim,
Quoted 20 lines · Tim Harvey
Add '
fdt_fixup_display' function to fixup device-tree for a specific display. This is useful if a device-tree has configurations for multiple display timings for undetectable displays.Signed-off-by Tim Harvey <[email protected]>--- common/fdt_support.c | 31 +++++++++++++++++++++++++++++++ include/fdt_support.h | 1 + 2 files changed, 32 insertions(+)common/fdt_support.c +1
-0@@ -1560,3 +1560,34 @@ int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width,return 0 ; } +
common/fdt_support.c int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width, · line 1573
Quoted 10 lines
common/fdt_support.c +10
-0+/* +* Update native-mode in display-timings from display environment variable. +* The node to update are specified by path. +*/ +int fdt_fixup_display (void *blob,const char *path,const char *display) +{ +int off, toff; + +if (!display || !path) +return -1 ;
This is -FDT_ERR_NOTFOUND. Better to be explicit.
Quoted 5 lines
common/fdt_support.c +5
-0+ + toff =fdt_path_offset (blob, path); +if (toff >=0 ) + toff =fdt_subnode_offset (blob, toff,"display-timings" ); +if (toff <0 )
common/fdt_support.c int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width, · line 1588
Quoted 10 lines
common/fdt_support.c +10
-0+return toff; + +for (off =fdt_first_subnode (blob, toff); + off >=0 ; + off =fdt_next_subnode (blob, off)) { +uint32_t handle =fdt_get_phandle (blob, off); +debug ("%s:0x%x\n" ,fdt_get_name (blob, off,NULL ), +fdt32_to_cpu (handle)); +if (strcasecmp (fdt_get_name (blob, off,NULL ), display) ==0 ) { +fdt_setprop_u32 (blob, toff,"native-mode" , handle);
Error checking.
Quoted 10 lines
common/fdt_support.c +5
-0+break ; + } + } +return toff; +}include/fdt_support.h +0
-0
include/fdt_support.h void fdt_fixup_ethernet(void *fdt); · line 49
Quoted 4 lines
include/fdt_support.h +1
-0@@ -46,6 +46,7 @@ void fdt_fixup_ethernet(void *fdt);int fdt_find_and_setprop (void *fdt,const char *node,const char *prop,const void *val,int len,int create);void fdt_fixup_qe_firmware (void *fdt); +int fdt_fixup_display (void *blob,const char *path,const char *display);
Function comment for this please - see ft_board_setup() as an example. Remember to document the return value.
Quoted 6 lines
include/fdt_support.h +0
-1#if defined(CONFIG_HAS_FSL_DR_USB ) || defined(CONFIG_HAS_FSL_MPH_USB )void fdt_fixup_dr_usb (void *blob,bd_t *bd); --1.9.1
Regards,
Simon
PATCH v2 1/1 fdt: add new fdt_fixup_display function to configure display
Add 'fdt_fixup_display' function to fixup device-tree native-mode property of display-timings node to select timings for a specific display. This is useful if a device-tree has configurations for multiple display timings for undetectable displays.
see kernel Documentation/devicetree/bindings/video/display-timing.txt
---
v2:
- use explicit error code
- return fdt_setprop_u32 to all error checking by caller
- add comments to function prototype
- added more verbosity to commit log
--- common/fdt_support.c | 29 +++++++++++++++++++++++++++++ include/fdt_support.h | 13 +++++++++++++ 2 files changed, 42 insertions(+)
common/fdt_support.c +29 -0
@@ -1560,3 +1560,32 @@ int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width,return 0 ; } + +/* +* Update native-mode in display-timings from display environment variable. +* The node to update are specified by path. +*/ +int fdt_fixup_display (void *blob,const char *path,const char *display) +{ +int off, toff; + +if (!display || !path) +return -FDT_ERR_NOTFOUND ; + + toff =fdt_path_offset (blob, path); +if (toff >=0 ) + toff =fdt_subnode_offset (blob, toff,"display-timings" ); +if (toff <0 ) +return toff; + +for (off =fdt_first_subnode (blob, toff); + off >=0 ; + off =fdt_next_subnode (blob, off)) { +uint32_t h =fdt_get_phandle (blob, off); +debug ("%s:0x%x\n" ,fdt_get_name (blob, off,NULL ), +fdt32_to_cpu (h)); +if (strcasecmp (fdt_get_name (blob, off,NULL ), display) ==0 ) +return fdt_setprop_u32 (blob, toff,"native-mode" , h); + } +return toff; +}
include/fdt_support.h +13 -0
@@ -47,6 +47,19 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop, const void *val, int len, int create);void fdt_fixup_qe_firmware (void *fdt); +/** +* Update native-mode property of display-timings node to the phandle +* of the timings matching a display by name (case insensitive). +* +* see kernel Documentation/devicetree/bindings/video/display-timing.txt +* +* @param blob FDT blob to update +* @param path path within dt +* @param display name of display timing to match +* @return 0 if ok, or -FDT_ERR_... on error +*/ +int fdt_fixup_display (void *blob,const char *path,const char *display); +#if defined(CONFIG_HAS_FSL_DR_USB ) || defined(CONFIG_HAS_FSL_MPH_USB )void fdt_fixup_dr_usb (void *blob,bd_t *bd);#else
Signature · 1 line
1.9.1
PATCH v2 1/1 fdt: add new fdt_fixup_display function to configure display
Hi Tim,
Quoted 15 lines · Tim Harvey
Add '
fdt_fixup_display' function to fixup device-tree native-mode property of display-timings node to select timings for a specific display. This is useful if a device-tree has configurations for multiple display timings for undetectable displays.see kernel
Documentation/devicetree/bindings/video/display-timing.txtSigned-off-by Tim Harvey <[email protected]>---
v2:
- use explicit error code
- returnfdt_setprop_u32to all error checking by caller
- add comments to function prototype
- added more verbosity to commit log
Quoted 4 lines
--- common/fdt_support.c | 29 +++++++++++++++++++++++++++++ include/fdt_support.h | 13 +++++++++++++ 2 files changed, 42 insertions(+)
Is that binding file already in U-Boot?
Regards,
Simon
PATCH v2 1/1 fdt: add new fdt_fixup_display function to configure display
Quoted 5 lines · Simon Glass
Acked-by Simon Glass <[email protected]>Is that binding file already in U-Boot?
Simon,
No - I don't think it is. I see now that there is a doc/device-tree-bindings/ dir in U-Boot. Is this for bindings that U-Boot itself 'uses' as far as using a device-tree U-Boot or just that U-Boot supports for fixups when booting Linux in ways like I'm doing with this patch?
Tim
PATCH v2 1/1 fdt: add new fdt_fixup_display function to configure display
Hi Tim,
Quoted 7 lines · Tim Harvey
Quoted 5 lines · Simon Glass
Acked-by Simon Glass <[email protected]>Is that binding file already in U-Boot?
Quoted 7 lines
Simon,
No - I don't think it is. I see now that there is a doc/device-tree-bindings/ dir in U-Boot. Is this for bindings that U-Boot itself 'uses' as far as using a device-tree U-Boot or just that U-Boot supports for fixups when booting Linux in ways like I'm doing with this patch?
The former, so actually I don't think we need to add it.
Regards,
Simon
PATCH v2 1/1 fdt: add new fdt_fixup_display function to configure display
In reply to Simon GlassQuoted 23 lines · Simon Glass
Hi Tim,
Quoted 15 lines · Tim Harvey
Add '
fdt_fixup_display' function to fixup device-tree native-mode property of display-timings node to select timings for a specific display. This is useful if a device-tree has configurations for multiple display timings for undetectable displays.see kernel
Documentation/devicetree/bindings/video/display-timing.txtSigned-off-by Tim Harvey <[email protected]>---
v2:
- use explicit error code
- returnfdt_setprop_u32to all error checking by caller
- add comments to function prototype
- added more verbosity to commit logQuoted 4 lines
--- common/fdt_support.c | 29 +++++++++++++++++++++++++++++ include/fdt_support.h | 13 +++++++++++++ 2 files changed, 42 insertions(+)
Quoted 1 line
Acked-by Simon Glass <[email protected]>
Simon,
I thought you were the maintainer for common/fdt_support.c. Can you commit this or do I need anyone else's ack?
It's a dependency of a set of IMX patches that Stefano is waiting on.
Regards,
Tim
PATCH v2 1/1 fdt: add new fdt_fixup_display function to configure display
Hi Tim,
Quoted 24 lines · Tim Harvey
Quoted 23 lines · Simon Glass
Hi Tim,
Quoted 19 lines · Tim Harvey
Add '
fdt_fixup_display' function to fixup device-tree native-mode property of display-timings node to select timings for a specific display. This is useful if a device-tree has configurations for multiple display timings for undetectable displays.see kernel
Documentation/devicetree/bindings/video/display-timing.txtSigned-off-by Tim Harvey <[email protected]>---
v2:
- use explicit error code
- returnfdt_setprop_u32to all error checking by caller
- add comments to function prototype
- added more verbosity to commit log--- common/fdt_support.c | 29 +++++++++++++++++++++++++++++ include/fdt_support.h | 13 +++++++++++++ 2 files changed, 42 insertions(+)
Quoted 9 lines
Quoted 1 line
Acked-by Simon Glass <[email protected]>Simon,
I thought you were the maintainer for
common/fdt_support.c. Can you commit this or do I need anyone else's ack?It's a dependency of a set of IMX patches that Stefano is waiting on.
Simon has already acked this patch. I can pick it up before the ventana series.
Regards,
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 1/1 fdt: add new fdt_fixup_display function to configure display
Hi,
Quoted 32 lines · Stefano Babic
Hi Tim,
Quoted 28 lines · Tim Harvey
Quoted 23 lines · Simon Glass
Hi Tim,
Quoted 15 lines · Tim Harvey
Add '
fdt_fixup_display' function to fixup device-tree native-mode property of display-timings node to select timings for a specific display. This is useful if a device-tree has configurations for multiple display timings for undetectable displays.see kernel
Documentation/devicetree/bindings/video/display-timing.txtSigned-off-by Tim Harvey <[email protected]>---
v2:
- use explicit error code
- returnfdt_setprop_u32to all error checking by caller
- add comments to function prototype
- added more verbosity to commit logQuoted 4 lines
--- common/fdt_support.c | 29 +++++++++++++++++++++++++++++ include/fdt_support.h | 13 +++++++++++++ 2 files changed, 42 insertions(+)Quoted 1 line
Acked-by Simon Glass <[email protected]>Simon,
Quoted 8 lines
Quoted 5 lines
I thought you were the maintainer for
common/fdt_support.c. Can you commit this or do I need anyone else's ack?It's a dependency of a set of IMX patches that Stefano is waiting on.
Simon has already acked this patch. I can pick it up before the ventana series.
Sounds good. I acked it but it is not in my patchwork TODO list so I did not apply it.
Regards,
Simon
PATCH v2 1/1 fdt: add new fdt_fixup_display function to configure display
Quoted 38 lines · Simon Glass
Hi,
Quoted 35 lines · Stefano Babic
Hi Tim,
Quoted 31 lines · Tim Harvey
Quoted 23 lines · Simon Glass
Hi Tim,
Quoted 15 lines · Tim Harvey
Add '
fdt_fixup_display' function to fixup device-tree native-mode property of display-timings node to select timings for a specific display. This is useful if a device-tree has configurations for multiple display timings for undetectable displays.see kernel
Documentation/devicetree/bindings/video/display-timing.txtSigned-off-by Tim Harvey <[email protected]>---
v2:
- use explicit error code
- returnfdt_setprop_u32to all error checking by caller
- add comments to function prototype
- added more verbosity to commit logQuoted 4 lines
--- common/fdt_support.c | 29 +++++++++++++++++++++++++++++ include/fdt_support.h | 13 +++++++++++++ 2 files changed, 42 insertions(+)Quoted 1 line
Acked-by Simon Glass <[email protected]>Simon,
I thought you were the maintainer for
common/fdt_support.c. Can you commit this or do I need anyone else's ack?
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
It's a dependency of a set of IMX patches that Stefano is waiting on.
Simon has already acked this patch. I can pick it up before the ventana series.
Sounds good. I acked it but it is not in my patchwork TODO list so I did not apply it.
For the record, everyone, pleae consider patchwork assignments a "rough sort" of some kind. If a patch is assigned to one person but another custodian feels it might be better in their tree, or that it's assigned to them but should be someone elses, please take or reassign. I'm generally just trying to keep the unassigned patches list empty.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150422/ca2d112d/attachment.sig>