diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 501b1453c4..dfe4041567 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -36,7 +36,6 @@ dtb-$(CONFIG_ARCH_IPQ807x) += ipq807x-hk01.dtb \ ipq807x-oak02.dtb \ ipq807x-oak03.dtb \ ipq807x-hk01-c2.dtb \ - ipq807x-hk01-c3.dtb \ ipq807x-hk01-c4.dtb \ ipq807x-hk01-c5.dtb \ ipq807x-hk10-c2.dtb diff --git a/arch/arm/dts/ipq807x-hk01-c3.dts b/arch/arm/dts/ipq807x-hk01-c3.dts deleted file mode 100644 index 5c1050a11c..0000000000 --- a/arch/arm/dts/ipq807x-hk01-c3.dts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -/dts-v1/; -#include "ipq807x-soc.dtsi" -#include -/ { - machid = <0x08010200>; - config_name = "config@hk01.c3"; - - aliases { - console = "/serial@78B3000"; - uart2 = "/serial@78B0000"; - i2c0 = "/i2c@78b6000"; - pci0 = "/pci@20000000"; - pci1 = "/pci@10000000"; - mmc = "/sdhci@07824000"; - }; - ess-switch { - switch_mac_mode = <0x0>; - switch_mac_mode1 = <0xFF>; - switch_mac_mode2 = <0x2>; - aquantia_port = <5>; - aquantia_gpio = <44>; - }; -}; - diff --git a/arch/arm/include/asm/mach-types.h b/arch/arm/include/asm/mach-types.h index 86fa70a1ad..a6af4b7455 100644 --- a/arch/arm/include/asm/mach-types.h +++ b/arch/arm/include/asm/mach-types.h @@ -1146,6 +1146,8 @@ extern unsigned int __machine_arch_type; #define MACH_TYPE_IPQ6018_AP_CP01_C4 0x8030003 #define MACH_TYPE_IPQ5018_AP_MP02_1 0x8040000 #define MACH_TYPE_IPQ5018_DB_MP02_1 0X1040003 +#define MACH_TYPE_IPQ807x_AP_HK01_C1 0x8010000 +#define MACH_TYPE_IPQ807x_AP_HK01_C3 0x8010200 #ifdef CONFIG_ARCH_EBSA110 # ifdef machine_arch_type diff --git a/board/qca/arm/ipq807x/ipq807x.c b/board/qca/arm/ipq807x/ipq807x.c index 264a02e32b..3b67a6a2ed 100644 --- a/board/qca/arm/ipq807x/ipq807x.c +++ b/board/qca/arm/ipq807x/ipq807x.c @@ -1262,6 +1262,48 @@ int ipq_board_usb_init(void) } #endif +unsigned int get_dts_machid(unsigned int machid) +{ + switch (machid) + { + case MACH_TYPE_IPQ807x_AP_HK01_C3: + return MACH_TYPE_IPQ807x_AP_HK01_C1; + default: + return machid; + } +} + +void ipq_uboot_fdt_fixup(void) +{ + int ret, len; + char *config = NULL; + + switch (gd->bd->bi_arch_number) + { + case MACH_TYPE_IPQ807x_AP_HK01_C3: + config = "config@hk01.c3"; + break; + } + + if (config != NULL) + { + len = fdt_totalsize(gd->fdt_blob) + strlen(config) + 1; + + /* + * 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; +} + void ipq_fdt_fixup_socinfo(void *blob) { uint32_t cpu_type;