mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
8787bc51a7
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it was 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> Link: https://lore.kernel.org/r/20230720172751.2918776-1-robh@kernel.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230814114051.25840-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
72 lines
1.7 KiB
C
72 lines
1.7 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
//
|
|
// Samsung's S5PC110/S5PV210 flattened device tree enabled machine.
|
|
//
|
|
// Copyright (c) 2013-2014 Samsung Electronics Co., Ltd.
|
|
// Mateusz Krawczuk <m.krawczuk@partner.samsung.com>
|
|
// Tomasz Figa <t.figa@samsung.com>
|
|
|
|
#include <linux/of_fdt.h>
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <asm/mach/arch.h>
|
|
#include <asm/mach/map.h>
|
|
#include <asm/system_misc.h>
|
|
|
|
#include "common.h"
|
|
#include "regs-clock.h"
|
|
|
|
static int __init s5pv210_fdt_map_sys(unsigned long node, const char *uname,
|
|
int depth, void *data)
|
|
{
|
|
struct map_desc iodesc;
|
|
const __be32 *reg;
|
|
int len;
|
|
|
|
if (!of_flat_dt_is_compatible(node, "samsung,s5pv210-clock"))
|
|
return 0;
|
|
|
|
reg = of_get_flat_dt_prop(node, "reg", &len);
|
|
if (reg == NULL || len != (sizeof(unsigned long) * 2))
|
|
return 0;
|
|
|
|
iodesc.pfn = __phys_to_pfn(be32_to_cpu(reg[0]));
|
|
iodesc.length = be32_to_cpu(reg[1]) - 1;
|
|
iodesc.virtual = (unsigned long)S3C_VA_SYS;
|
|
iodesc.type = MT_DEVICE;
|
|
iotable_init(&iodesc, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
static void __init s5pv210_dt_map_io(void)
|
|
{
|
|
debug_ll_io_init();
|
|
|
|
of_scan_flat_dt(s5pv210_fdt_map_sys, NULL);
|
|
}
|
|
|
|
static void s5pv210_dt_restart(enum reboot_mode mode, const char *cmd)
|
|
{
|
|
__raw_writel(0x1, S5P_SWRESET);
|
|
}
|
|
|
|
static void __init s5pv210_dt_init_late(void)
|
|
{
|
|
platform_device_register_simple("s5pv210-cpufreq", -1, NULL, 0);
|
|
s5pv210_pm_init();
|
|
}
|
|
|
|
static char const *const s5pv210_dt_compat[] __initconst = {
|
|
"samsung,s5pc110",
|
|
"samsung,s5pv210",
|
|
NULL
|
|
};
|
|
|
|
DT_MACHINE_START(S5PV210_DT, "Samsung S5PC110/S5PV210-based board")
|
|
.dt_compat = s5pv210_dt_compat,
|
|
.map_io = s5pv210_dt_map_io,
|
|
.restart = s5pv210_dt_restart,
|
|
.init_late = s5pv210_dt_init_late,
|
|
MACHINE_END
|