/* Copyright (c) 2012-2014, 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. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "board-dt.h" #include "clock.h" #include "platsmp.h" static struct of_dev_auxdata msm_hsic_host_adata[] = { OF_DEV_AUXDATA("qcom,hsic-host", 0xF9A00000, "msm_hsic_host", NULL), {} }; static struct of_dev_auxdata msm8226_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("qcom,sdhci-msm", 0xF9824900, \ "msm_sdcc.1", NULL), OF_DEV_AUXDATA("qcom,sdhci-msm", 0xF98A4900, \ "msm_sdcc.2", NULL), OF_DEV_AUXDATA("qcom,sdhci-msm", 0xF9864900, \ "msm_sdcc.3", NULL), OF_DEV_AUXDATA("qcom,hsic-host", 0xF9A00000, "msm_hsic_host", NULL), OF_DEV_AUXDATA("qcom,hsic-smsc-hub", 0, "msm_smsc_hub", msm_hsic_host_adata), {} }; static void __init msm8226_reserve(void) { of_scan_flat_dt(dt_scan_for_memory_reserve, NULL); } /* * Used to satisfy dependencies for devices that need to be * run early or in a particular order. Most likely your device doesn't fall * into this category, and thus the driver should not be added here. The * EPROBE_DEFER can satisfy most dependency problems. */ void __init msm8226_add_drivers(void) { msm_smd_init(); msm_rpm_driver_init(); msm_spm_device_init(); msm_pm_sleep_status_init(); rpm_smd_regulator_driver_init(); qpnp_regulator_init(); spm_regulator_init(); msm_gcc_8226_init(); msm_bus_fabric_init_driver(); qup_i2c_init_driver(); ncp6335d_regulator_init(); fan53555_regulator_init(); cpr_regulator_init(); } void __init msm8226_init(void) { struct of_dev_auxdata *adata = msm8226_auxdata_lookup; /* * populate devices from DT first so smem probe will get called as part * of msm_smem_init. socinfo_init needs smem support so call * msm_smem_init before it. msm8226_init_gpiomux needs socinfo so * call socinfo_init before it. */ board_dt_populate(adata); msm_smem_init(); if (socinfo_init() < 0) pr_err("%s: socinfo_init() failed\n", __func__); msm8226_init_gpiomux(); msm8226_add_drivers(); } static const char *msm8226_dt_match[] __initconst = { "qcom,msm8226", "qcom,msm8926", "qcom,apq8026", NULL }; DT_MACHINE_START(MSM8226_DT, "Qualcomm Technologies, Inc. MSM 8226 (Flattened Device Tree)") .map_io = msm_map_msm8226_io, .init_machine = msm8226_init, .dt_compat = msm8226_dt_match, .reserve = msm8226_reserve, .smp = &arm_smp_ops, MACHINE_END