From bd5d0327570716bc6b77e22814d515c0779acf8c Mon Sep 17 00:00:00 2001 From: Robin Gong Date: Wed, 4 Sep 2013 15:21:03 +0800 Subject: ENGR00277895-2 ARM: mx6: check the property setting of "fsl,ldo-bypass" Check the right property setting of "fsl,ldo-bypass" in dts to know what ldo mode we need use(ldo-bypass or ldo-enable). Before only check the presence of "fsl,ldo-bypass", now change to check whether "fsl,ldo-bypass = <1>" in dts. If yes, switch to ldo-bypass mode. If "fsl,ldo-bypass = <0>" or no "fsl, ldo-bypass" property, u-boot keep in ldo-enable mode. Signed-off-by: Robin Gong --- arch/arm/cpu/armv7/mx6/soc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index e3f4377..930e96d 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -451,7 +451,7 @@ void s_init(void) DECLARE_GLOBAL_DATA_PTR; int check_ldo_bypass(void) { - int ret = 0; + const int *ldo_mode; int node; /* get the right fdt_addr */ @@ -461,11 +461,15 @@ int check_ldo_bypass(void) node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "fsl,imx6q-gpc"); if (node < 0) { - printf("gpc: No node for gpc in device tree,%d\n", node); - return ret; + printf("No gpc device node %d, force to ldo-enable.\n", node); + return 0; } - ret = fdt_getprop(gd->fdt_blob, node, "fsl,ldo-bypass", NULL); - return ret; + ldo_mode = fdt_getprop(gd->fdt_blob, node, "fsl,ldo-bypass", NULL); + /* + * return 1 if "fsl,ldo-bypass = <1>", else return 0 if + * "fsl,ldo-bypass = <0>" or no "fsl,ldo-bypass" property + */ + return fdt32_to_cpu(*ldo_mode) == 1 ? 1 : 0; } int check_1_2G(void) -- cgit v1.1