From de3e3d848b88709a98efde55e90b25ce2595aaa9 Mon Sep 17 00:00:00 2001 From: Srinivas Ramana Date: Tue, 31 May 2016 11:11:52 +0530 Subject: [PATCH] mach-qcom: add support to populate dt nodes for 32-bit platforms Add support to populate device tree nodes for the new 32-bit platforms under under mach-qcom. Change-Id: I5fd747de84917c16f28f3f72d7b34b5db157637c Signed-off-by: Srinivas Ramana Signed-off-by: Tengfei Fan Signed-off-by: Jeevan Shriram --- arch/arm/mach-qcom/Makefile | 1 + arch/arm/mach-qcom/board-dt.c | 21 +++++++++++++++++++++ arch/arm/mach-qcom/board-dt.h | 8 ++++++++ 3 files changed, 30 insertions(+) create mode 100644 arch/arm/mach-qcom/board-dt.c create mode 100644 arch/arm/mach-qcom/board-dt.h diff --git a/arch/arm/mach-qcom/Makefile b/arch/arm/mach-qcom/Makefile index b839201c9802..8c3a333a46fa 100644 --- a/arch/arm/mach-qcom/Makefile +++ b/arch/arm/mach-qcom/Makefile @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_SMP) += platsmp.o +obj-$(CONFIG_USE_OF) += board-dt.o diff --git a/arch/arm/mach-qcom/board-dt.c b/arch/arm/mach-qcom/board-dt.c new file mode 100644 index 000000000000..1e3d1468544a --- /dev/null +++ b/arch/arm/mach-qcom/board-dt.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. + */ + +#include +#include +#include + +#include "board-dt.h" + +void __init board_dt_populate(struct of_dev_auxdata *adata) +{ + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); + + /* Explicitly parent the /soc devices to the root node to preserve + * the kernel ABI (sysfs structure, etc) until userspace is updated + */ + of_platform_populate(of_find_node_by_path("/soc"), + of_default_bus_match_table, adata, NULL); +} diff --git a/arch/arm/mach-qcom/board-dt.h b/arch/arm/mach-qcom/board-dt.h new file mode 100644 index 000000000000..7ca9f994c0a2 --- /dev/null +++ b/arch/arm/mach-qcom/board-dt.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. + */ + +#include + +void __init board_dt_populate(struct of_dev_auxdata *adata);