mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-27 06:50:37 +00:00

The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> [mpe: Fixup maple/setup.c which needs platform_device] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230724210247.778034-1-robh@kernel.org
44 lines
861 B
C
44 lines
861 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Routines common to most mpc86xx-based boards.
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
#include <linux/mod_devicetable.h>
|
|
#include <linux/of_platform.h>
|
|
#include <asm/reg.h>
|
|
#include <asm/synch.h>
|
|
|
|
#include "mpc86xx.h"
|
|
|
|
static const struct of_device_id mpc86xx_common_ids[] __initconst = {
|
|
{ .type = "soc", },
|
|
{ .compatible = "soc", },
|
|
{ .compatible = "simple-bus", },
|
|
{ .name = "localbus", },
|
|
{ .compatible = "gianfar", },
|
|
{ .compatible = "fsl,mpc8641-pcie", },
|
|
{},
|
|
};
|
|
|
|
int __init mpc86xx_common_publish_devices(void)
|
|
{
|
|
return of_platform_bus_probe(NULL, mpc86xx_common_ids, NULL);
|
|
}
|
|
|
|
long __init mpc86xx_time_init(void)
|
|
{
|
|
unsigned int temp;
|
|
|
|
/* Set the time base to zero */
|
|
mtspr(SPRN_TBWL, 0);
|
|
mtspr(SPRN_TBWU, 0);
|
|
|
|
temp = mfspr(SPRN_HID0);
|
|
temp |= HID0_TBEN;
|
|
mtspr(SPRN_HID0, temp);
|
|
isync();
|
|
|
|
return 0;
|
|
}
|