| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2006-2010, 2012-2013 Freescale Semiconductor, Inc. |
|---|
| 3 | 4 | * All rights reserved. |
|---|
| .. | .. |
|---|
| 10 | 11 | * |
|---|
| 11 | 12 | * Description: |
|---|
| 12 | 13 | * MPC85xx MDS board specific routines. |
|---|
| 13 | | - * |
|---|
| 14 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 15 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 16 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 17 | | - * option) any later version. |
|---|
| 18 | 14 | */ |
|---|
| 19 | 15 | |
|---|
| 20 | 16 | #include <linux/stddef.h> |
|---|
| .. | .. |
|---|
| 47 | 43 | #include <asm/udbg.h> |
|---|
| 48 | 44 | #include <sysdev/fsl_soc.h> |
|---|
| 49 | 45 | #include <sysdev/fsl_pci.h> |
|---|
| 50 | | -#include <sysdev/simple_gpio.h> |
|---|
| 51 | 46 | #include <soc/fsl/qe/qe.h> |
|---|
| 52 | | -#include <soc/fsl/qe/qe_ic.h> |
|---|
| 53 | 47 | #include <asm/mpic.h> |
|---|
| 54 | 48 | #include <asm/swiotlb.h> |
|---|
| 55 | 49 | #include "smp.h" |
|---|
| .. | .. |
|---|
| 242 | 236 | { |
|---|
| 243 | 237 | struct device_node *np; |
|---|
| 244 | 238 | |
|---|
| 245 | | - mpc85xx_qe_init(); |
|---|
| 246 | 239 | mpc85xx_qe_par_io_init(); |
|---|
| 247 | 240 | mpc85xx_mds_reset_ucc_phys(); |
|---|
| 248 | 241 | |
|---|
| .. | .. |
|---|
| 274 | 267 | } |
|---|
| 275 | 268 | } |
|---|
| 276 | 269 | |
|---|
| 277 | | -static void __init mpc85xx_mds_qeic_init(void) |
|---|
| 278 | | -{ |
|---|
| 279 | | - struct device_node *np; |
|---|
| 280 | | - |
|---|
| 281 | | - np = of_find_compatible_node(NULL, NULL, "fsl,qe"); |
|---|
| 282 | | - if (!of_device_is_available(np)) { |
|---|
| 283 | | - of_node_put(np); |
|---|
| 284 | | - return; |
|---|
| 285 | | - } |
|---|
| 286 | | - |
|---|
| 287 | | - np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); |
|---|
| 288 | | - if (!np) { |
|---|
| 289 | | - np = of_find_node_by_type(NULL, "qeic"); |
|---|
| 290 | | - if (!np) |
|---|
| 291 | | - return; |
|---|
| 292 | | - } |
|---|
| 293 | | - |
|---|
| 294 | | - if (machine_is(p1021_mds)) |
|---|
| 295 | | - qe_ic_init(np, 0, qe_ic_cascade_low_mpic, |
|---|
| 296 | | - qe_ic_cascade_high_mpic); |
|---|
| 297 | | - else |
|---|
| 298 | | - qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, NULL); |
|---|
| 299 | | - of_node_put(np); |
|---|
| 300 | | -} |
|---|
| 301 | 270 | #else |
|---|
| 302 | 271 | static void __init mpc85xx_mds_qe_init(void) { } |
|---|
| 303 | | -static void __init mpc85xx_mds_qeic_init(void) { } |
|---|
| 304 | 272 | #endif /* CONFIG_QUICC_ENGINE */ |
|---|
| 305 | 273 | |
|---|
| 306 | 274 | static void __init mpc85xx_mds_setup_arch(void) |
|---|
| .. | .. |
|---|
| 355 | 323 | |
|---|
| 356 | 324 | static int __init mpc85xx_publish_devices(void) |
|---|
| 357 | 325 | { |
|---|
| 358 | | - if (machine_is(mpc8568_mds)) |
|---|
| 359 | | - simple_gpiochip_init("fsl,mpc8568mds-bcsr-gpio"); |
|---|
| 360 | | - if (machine_is(mpc8569_mds)) |
|---|
| 361 | | - simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio"); |
|---|
| 362 | | - |
|---|
| 363 | 326 | return mpc85xx_common_publish_devices(); |
|---|
| 364 | 327 | } |
|---|
| 365 | 328 | |
|---|
| 366 | 329 | machine_arch_initcall(mpc8568_mds, mpc85xx_publish_devices); |
|---|
| 367 | 330 | machine_arch_initcall(mpc8569_mds, mpc85xx_publish_devices); |
|---|
| 368 | 331 | machine_arch_initcall(p1021_mds, mpc85xx_common_publish_devices); |
|---|
| 369 | | - |
|---|
| 370 | | -machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier); |
|---|
| 371 | | -machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier); |
|---|
| 372 | | -machine_arch_initcall(p1021_mds, swiotlb_setup_bus_notifier); |
|---|
| 373 | 332 | |
|---|
| 374 | 333 | static void __init mpc85xx_mds_pic_init(void) |
|---|
| 375 | 334 | { |
|---|
| .. | .. |
|---|
| 379 | 338 | BUG_ON(mpic == NULL); |
|---|
| 380 | 339 | |
|---|
| 381 | 340 | mpic_init(mpic); |
|---|
| 382 | | - mpc85xx_mds_qeic_init(); |
|---|
| 383 | 341 | } |
|---|
| 384 | 342 | |
|---|
| 385 | 343 | static int __init mpc85xx_mds_probe(void) |
|---|