blob: 9a82e3a3ffd7aa27f29d954f09319c98c5ba2a5e [file] [log] [blame]
Shadab Naseemc396b6f2018-02-20 15:58:38 +05301/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
Maria Yu50160512017-09-26 16:54:33 +08002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include <linux/kernel.h>
14#include "board-dt.h"
15#include <asm/mach/map.h>
16#include <asm/mach/arch.h>
Patrick Daly1b34fe72018-05-08 15:12:11 -070017#include <linux/of_platform.h>
Maria Yu50160512017-09-26 16:54:33 +080018
19static const char *msm8953_dt_match[] __initconst = {
20 "qcom,msm8953",
Shadab Naseemc396b6f2018-02-20 15:58:38 +053021 "qcom,apq8053",
Maria Yu50160512017-09-26 16:54:33 +080022 NULL
23};
24
25static void __init msm8953_init(void)
26{
Patrick Daly1b34fe72018-05-08 15:12:11 -070027 if (IS_ENABLED(CONFIG_ARCH_MSM8953_BOOT_ORDERING))
28 return;
Maria Yu50160512017-09-26 16:54:33 +080029 board_dt_populate(NULL);
30}
31
Patrick Daly1b34fe72018-05-08 15:12:11 -070032#ifdef CONFIG_ARCH_MSM8953_BOOT_ORDERING
33static int __init msm8953_dt_populate(void)
34{
35 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
36
37 /* Explicitly parent the /soc devices to the root node to preserve
38 * the kernel ABI (sysfs structure, etc) until userspace is updated
39 */
Patrick Daly33bf3352018-05-22 13:00:03 -070040 return of_platform_populate(of_find_node_by_path("/soc"),
41 of_default_bus_match_table, NULL, NULL);
Patrick Daly1b34fe72018-05-08 15:12:11 -070042}
43late_initcall(msm8953_dt_populate);
44#endif
45
Maria Yu50160512017-09-26 16:54:33 +080046DT_MACHINE_START(MSM8953_DT,
47 "Qualcomm Technologies, Inc. MSM8953 (Flattened Device Tree)")
48 .init_machine = msm8953_init,
49 .dt_compat = msm8953_dt_match,
50MACHINE_END