ipq807x:Add support to avoid identical device-tree

We had identical device-tree for different RDPs
though they are the same except for machid.

This change enables reuse of a single device-tree
across RDPs with same configurations.

Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
Change-Id: If81b431e4a6afe54e427fe0a52de275fdd29df00
This commit is contained in:
Gokul Sriram Palanisamy 2020-05-12 12:19:54 +05:30 committed by Gerrit - the friendly Code Review server
parent 7a4fd1204d
commit c8365407da
4 changed files with 44 additions and 38 deletions

View file

@ -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

View file

@ -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 <dt-bindings/qcom/gpio-ipq807x.h>
/ {
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>;
};
};

View file

@ -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

View file

@ -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;