ipq95xx: emmc fdt fixup for kernel 6.1

if board has emmc flash type,
Ehable EMMC and disable NAND flash in
kernel device tree during kernel bootup

Change-Id: Ibbe197c39c4c4e47d97c33fa9a48d068e85917ab
Signed-off-by: Gurumoorthy Santhakumar <quic_gsanthak@quicinc.com>
This commit is contained in:
Gurumoorthy Santhakumar 2023-05-24 09:56:43 +05:30 committed by Gerrit - the friendly Code Review server
parent 249b847702
commit d751fa3e3e

View file

@ -33,6 +33,11 @@
#define DLOAD_MAGIC_COOKIE 0x10
#define DLOAD_DISABLED 0x40
#define LINUX6_1_NAND_DTS "/soc@0/nand@79b0000/"
#define LINUX6_1_MMC_DTS "/soc@0/mmc@7804000/"
#define STATUS_OK "status%?okay"
#define STATUS_DISABLED "status%?disabled"
DECLARE_GLOBAL_DATA_PTR;
struct sdhci_host mmc_host;
@ -44,6 +49,24 @@ static int aq_phy_initialised = 0;
extern int qca_scm_dpr(u32, u32, void *, size_t);
void fdt_fixup_flash(void *blob)
{
uint32_t flash_type = SMEM_BOOT_NO_FLASH;
int nand_nodeoff = fdt_path_offset(blob, LINUX6_1_NAND_DTS);
int mmc_nodeoff = fdt_path_offset(blob, LINUX6_1_MMC_DTS);
get_current_flash_type(&flash_type);
if (flash_type == SMEM_BOOT_NORPLUSEMMC ||
flash_type == SMEM_BOOT_MMC_FLASH ) {
if(nand_nodeoff >= 0)
parse_fdt_fixup(LINUX6_1_NAND_DTS"%"STATUS_DISABLED,
blob);
if(mmc_nodeoff >= 0)
parse_fdt_fixup(LINUX6_1_MMC_DTS"%"STATUS_OK, blob);
}
return;
}
void qca_serial_init(struct ipq_serial_platdata *plat)
{
int ret;