]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - arch/powerpc/platforms/83xx/mpc837x_rdb.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
[mirror_ubuntu-jammy-kernel.git] / arch / powerpc / platforms / 83xx / mpc837x_rdb.c
CommitLineData
2874c5fd 1// SPDX-License-Identifier: GPL-2.0-or-later
38f66f90
KP
2/*
3 * arch/powerpc/platforms/83xx/mpc837x_rdb.c
4 *
8a56e1ee 5 * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
38f66f90
KP
6 *
7 * MPC837x RDB board specific routines
38f66f90
KP
8 */
9
10#include <linux/pci.h>
11#include <linux/of_platform.h>
12
13#include <asm/time.h>
14#include <asm/ipic.h>
15#include <asm/udbg.h>
89f37296 16#include <sysdev/fsl_soc.h>
76fe1ffc 17#include <sysdev/fsl_pci.h>
38f66f90
KP
18
19#include "mpc83xx.h"
20
89f37296
AV
21static void mpc837x_rdb_sd_cfg(void)
22{
23 void __iomem *im;
24
25 im = ioremap(get_immrbase(), 0x1000);
26 if (!im) {
27 WARN_ON(1);
28 return;
29 }
30
31 /*
32 * On RDB boards (in contrast to MDS) USBB pins are used for SD only,
33 * so we can safely mux them away from the USB block.
34 */
35 clrsetbits_be32(im + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USBB_MASK,
36 MPC837X_SICRL_SD);
37 clrsetbits_be32(im + MPC83XX_SICRH_OFFS, MPC837X_SICRH_SPI_MASK,
38 MPC837X_SICRH_SD);
39 iounmap(im);
40}
41
38f66f90
KP
42/* ************************************************************************
43 *
44 * Setup the architecture
45 *
46 */
47static void __init mpc837x_rdb_setup_arch(void)
48{
fff69fd0 49 mpc83xx_setup_arch();
38f66f90 50 mpc837x_usb_cfg();
89f37296 51 mpc837x_rdb_sd_cfg();
38f66f90
KP
52}
53
7669d58c 54machine_device_initcall(mpc837x_rdb, mpc83xx_declare_of_platform_devices);
38f66f90 55
9597abe0 56static const char * const board[] __initconst = {
a4f740cf
GL
57 "fsl,mpc8377rdb",
58 "fsl,mpc8378rdb",
59 "fsl,mpc8379rdb",
60 "fsl,mpc8377wlan",
61 NULL
62};
63
38f66f90
KP
64/*
65 * Called very early, MMU is off, device-tree isn't unflattened
66 */
67static int __init mpc837x_rdb_probe(void)
68{
56571384 69 return of_device_compatible_match(of_root, board);
38f66f90
KP
70}
71
72define_machine(mpc837x_rdb) {
fda4bd9b 73 .name = "MPC837x RDB/WLAN",
38f66f90
KP
74 .probe = mpc837x_rdb_probe,
75 .setup_arch = mpc837x_rdb_setup_arch,
d4fb5ebd 76 .init_IRQ = mpc83xx_ipic_init_IRQ,
38f66f90
KP
77 .get_irq = ipic_get_irq,
78 .restart = mpc83xx_restart,
79 .time_init = mpc83xx_time_init,
80 .calibrate_decr = generic_calibrate_decr,
81 .progress = udbg_progress,
82};