Shadab Naseem | c396b6f | 2018-02-20 15:58:38 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. |
Maria Yu | 5016051 | 2017-09-26 16:54:33 +0800 | [diff] [blame] | 2 | * |
| 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 Daly | 1b34fe7 | 2018-05-08 15:12:11 -0700 | [diff] [blame] | 17 | #include <linux/of_platform.h> |
Maria Yu | 5016051 | 2017-09-26 16:54:33 +0800 | [diff] [blame] | 18 | |
| 19 | static const char *msm8953_dt_match[] __initconst = { |
| 20 | "qcom,msm8953", |
Shadab Naseem | c396b6f | 2018-02-20 15:58:38 +0530 | [diff] [blame] | 21 | "qcom,apq8053", |
Maria Yu | 5016051 | 2017-09-26 16:54:33 +0800 | [diff] [blame] | 22 | NULL |
| 23 | }; |
| 24 | |
| 25 | static void __init msm8953_init(void) |
| 26 | { |
Patrick Daly | 1b34fe7 | 2018-05-08 15:12:11 -0700 | [diff] [blame] | 27 | if (IS_ENABLED(CONFIG_ARCH_MSM8953_BOOT_ORDERING)) |
| 28 | return; |
Maria Yu | 5016051 | 2017-09-26 16:54:33 +0800 | [diff] [blame] | 29 | board_dt_populate(NULL); |
| 30 | } |
| 31 | |
Patrick Daly | 1b34fe7 | 2018-05-08 15:12:11 -0700 | [diff] [blame] | 32 | #ifdef CONFIG_ARCH_MSM8953_BOOT_ORDERING |
| 33 | static 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 Daly | 33bf335 | 2018-05-22 13:00:03 -0700 | [diff] [blame] | 40 | return of_platform_populate(of_find_node_by_path("/soc"), |
| 41 | of_default_bus_match_table, NULL, NULL); |
Patrick Daly | 1b34fe7 | 2018-05-08 15:12:11 -0700 | [diff] [blame] | 42 | } |
| 43 | late_initcall(msm8953_dt_populate); |
| 44 | #endif |
| 45 | |
Maria Yu | 5016051 | 2017-09-26 16:54:33 +0800 | [diff] [blame] | 46 | DT_MACHINE_START(MSM8953_DT, |
| 47 | "Qualcomm Technologies, Inc. MSM8953 (Flattened Device Tree)") |
| 48 | .init_machine = msm8953_init, |
| 49 | .dt_compat = msm8953_dt_match, |
| 50 | MACHINE_END |