From fedd981dfd386210947413680b9a433753f3d911 Mon Sep 17 00:00:00 2001 From: Antony Arun T Date: Thu, 27 Jun 2019 13:03:13 +0530 Subject: [PATCH] ipq6018: Adding support for ipq6018-AP-CP01-C2 Change-Id: Ibf0771ad18d7d6cd52ddb92a5950053d25f3132d Signed-off-by: Antony Arun T --- arch/arm/include/asm/mach-types.h | 2 ++ board/qca/arm/ipq6018/ipq6018.c | 34 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/arch/arm/include/asm/mach-types.h b/arch/arm/include/asm/mach-types.h index aa021fa5b2..32743f45e0 100644 --- a/arch/arm/include/asm/mach-types.h +++ b/arch/arm/include/asm/mach-types.h @@ -1139,6 +1139,8 @@ extern unsigned int __machine_arch_type; #define MACH_TYPE_IPQ40XX_DB_DK02_1_C1 0x1010003 #define MACH_TYPE_IPQ40XX_TB832 0x1010004 #define MACH_TYPE_IPQ40XX_AP_DK04_1_C6 0x8010501 +#define MACH_TYPE_IPQ6018_AP_CP01_C1 0x8030000 +#define MACH_TYPE_IPQ6018_AP_CP01_C2 0x8030001 #ifdef CONFIG_ARCH_EBSA110 # ifdef machine_arch_type diff --git a/board/qca/arm/ipq6018/ipq6018.c b/board/qca/arm/ipq6018/ipq6018.c index a121708b42..4a6e7cb54a 100644 --- a/board/qca/arm/ipq6018/ipq6018.c +++ b/board/qca/arm/ipq6018/ipq6018.c @@ -1231,3 +1231,37 @@ int bring_sec_core_up(unsigned int cpuid, unsigned int entry, unsigned int arg) printf("Enabled CPU%d via psci successfully!\n", cpuid); return 0; } + +unsigned int get_dts_machid(unsigned int machid) +{ + switch (machid) + { + case MACH_TYPE_IPQ6018_AP_CP01_C2: + return MACH_TYPE_IPQ6018_AP_CP01_C1; + default: + return machid; + } +} + +void ipq_uboot_fdt_fixup(void) +{ + int ret, len; + const char *config = "config@cp01-c2"; + len = fdt_totalsize(gd->fdt_blob) + strlen(config) + 1; + + if (gd->bd->bi_arch_number == MACH_TYPE_IPQ6018_AP_CP01_C2) + { + /* + * Open in place with a new length. + */ + ret = fdt_open_into(gd->fdt_blob, (void *)gd->fdt_blob, len); + if (ret) + printf("uboot-fdt-fixup: Cannot expand FDT: %s\n", fdt_strerror(ret)); + + ret = fdt_setprop((void *)gd->fdt_blob, 0, "config_name", + config, (strlen(config)+1)); + if (ret) + printf("uboot-fdt-fixup: unable to set config_name(%d)\n", ret); + } + return; +}