ipq4019: fdt_fixup: Delete the 'sd-ldo-gpios' property from sdhci node

power-on write protection also gets cleared during sd-ldo toggle in kernel.
This toggle is required only for SD card. So, If the boot flash type is
eMMC or NOR+eMMC sd-ldo removed from the device tree.

Change-Id: I3c7bf14a5f67df3bcef2bd6507da5146c2beffb7
Signed-off-by: Vinoth Gnanasekaran <vgnana@codeaurora.org>
This commit is contained in:
Vinoth Gnanasekaran 2018-07-16 12:01:38 +05:30 committed by Gerrit - the friendly Code Review server
parent b819be2c53
commit 2ebb44cea5
2 changed files with 30 additions and 0 deletions

View file

@ -481,6 +481,10 @@ static int ipq40xx_patch_eth_params(void *blob, unsigned long gmac_no)
return 0;
}
__weak void fdt_fixup_sd_ldo_gpios_toggle(void *blob)
{
return;
}
/*
* For newer kernel that boot with device tree (3.14+), all of memory is
@ -576,6 +580,10 @@ int ft_board_setup(void *blob, bd_t *bd)
ipq_fdt_fixup_usb_device_mode(blob);
fdt_fixup_auto_restart(blob);
if ((flash_type == SMEM_BOOT_MMC_FLASH) ||
(flash_type == SMEM_BOOT_NORPLUSEMMC))
fdt_fixup_sd_ldo_gpios_toggle(blob);
#ifdef CONFIG_QCA_MMC
board_mmc_deinit();
#endif

View file

@ -438,6 +438,28 @@ void ipq_fdt_fixup_socinfo(void *blob)
}
}
void fdt_fixup_sd_ldo_gpios_toggle(void *blob)
{
int noff;
int ret;
noff = fdt_path_offset(blob, "/soc/sdhci");
if (noff < 0) {
printf("ipq: fdt fixup unable to find node /soc/sdhci\n");
return;
}
/**
* In eMMC card, power-on write protection also gets cleared
* during sd-ldo toggle in kernel.
*/
ret = fdt_delprop(blob, noff, "sd-ldo-gpios");
if (ret < 0) {
printf("sdhci: cann't delete sd-ldo-gpios\n");
return;
}
}
void ipq_fdt_fixup_usb_device_mode(void *blob)
{
int nodeoff, ret, i;