| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/arch/arm/mach-integrator/integrator_ap.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2000-2003 Deep Blue Solutions Ltd |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | | - * (at your option) any later version. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | | - * |
|---|
| 16 | | - * You should have received a copy of the GNU General Public License |
|---|
| 17 | | - * along with this program; if not, write to the Free Software |
|---|
| 18 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 19 | 6 | */ |
|---|
| 20 | 7 | #include <linux/kernel.h> |
|---|
| 21 | 8 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 36 | 23 | #include "hardware.h" |
|---|
| 37 | 24 | #include "cm.h" |
|---|
| 38 | 25 | #include "common.h" |
|---|
| 39 | | -#include "lm.h" |
|---|
| 40 | 26 | |
|---|
| 41 | 27 | /* Regmap to the AP system controller */ |
|---|
| 42 | 28 | static struct regmap *ap_syscon_map; |
|---|
| .. | .. |
|---|
| 187 | 173 | |
|---|
| 188 | 174 | static void __init ap_init_of(void) |
|---|
| 189 | 175 | { |
|---|
| 190 | | - u32 sc_dec; |
|---|
| 191 | 176 | struct device_node *syscon; |
|---|
| 192 | | - int ret; |
|---|
| 193 | | - int i; |
|---|
| 194 | 177 | |
|---|
| 195 | 178 | of_platform_default_populate(NULL, ap_auxdata_lookup, NULL); |
|---|
| 196 | 179 | |
|---|
| .. | .. |
|---|
| 201 | 184 | if (IS_ERR(ap_syscon_map)) { |
|---|
| 202 | 185 | pr_crit("could not find Integrator/AP system controller\n"); |
|---|
| 203 | 186 | return; |
|---|
| 204 | | - } |
|---|
| 205 | | - |
|---|
| 206 | | - ret = regmap_read(ap_syscon_map, |
|---|
| 207 | | - INTEGRATOR_SC_DEC_OFFSET, |
|---|
| 208 | | - &sc_dec); |
|---|
| 209 | | - if (ret) { |
|---|
| 210 | | - pr_crit("could not read from Integrator/AP syscon\n"); |
|---|
| 211 | | - return; |
|---|
| 212 | | - } |
|---|
| 213 | | - |
|---|
| 214 | | - for (i = 0; i < 4; i++) { |
|---|
| 215 | | - struct lm_device *lmdev; |
|---|
| 216 | | - |
|---|
| 217 | | - if ((sc_dec & (16 << i)) == 0) |
|---|
| 218 | | - continue; |
|---|
| 219 | | - |
|---|
| 220 | | - lmdev = kzalloc(sizeof(struct lm_device), GFP_KERNEL); |
|---|
| 221 | | - if (!lmdev) |
|---|
| 222 | | - continue; |
|---|
| 223 | | - |
|---|
| 224 | | - lmdev->resource.start = 0xc0000000 + 0x10000000 * i; |
|---|
| 225 | | - lmdev->resource.end = lmdev->resource.start + 0x0fffffff; |
|---|
| 226 | | - lmdev->resource.flags = IORESOURCE_MEM; |
|---|
| 227 | | - lmdev->irq = irq_of_parse_and_map(syscon, i); |
|---|
| 228 | | - lmdev->id = i; |
|---|
| 229 | | - |
|---|
| 230 | | - lm_device_register(lmdev); |
|---|
| 231 | 187 | } |
|---|
| 232 | 188 | } |
|---|
| 233 | 189 | |
|---|