2 * Koelsch board support - Reference DT implementation
4 * Copyright (C) 2013 Renesas Electronics Corporation
5 * Copyright (C) 2013 Renesas Solutions Corp.
6 * Copyright (C) 2013 Magnus Damm
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
18 #include <linux/dma-mapping.h>
19 #include <linux/kernel.h>
20 #include <linux/of_platform.h>
21 #include <linux/platform_data/rcar-du.h>
23 #include <asm/mach/arch.h>
29 #include "rcar-gen2.h"
32 static struct rcar_du_encoder_data koelsch_du_encoders[] = {
34 .type = RCAR_DU_ENCODER_NONE,
35 .output = RCAR_DU_OUTPUT_LVDS0,
36 .connector.lvds.panel = {
40 .pixelclock = 65000000,
54 static struct rcar_du_platform_data koelsch_du_pdata = {
55 .encoders = koelsch_du_encoders,
56 .num_encoders = ARRAY_SIZE(koelsch_du_encoders),
59 static const struct resource du_resources[] __initconst = {
60 DEFINE_RES_MEM(0xfeb00000, 0x40000),
61 DEFINE_RES_MEM_NAMED(0xfeb90000, 0x1c, "lvds.0"),
62 DEFINE_RES_IRQ(gic_spi(256)),
63 DEFINE_RES_IRQ(gic_spi(268)),
66 static void __init koelsch_add_du_device(void)
68 struct platform_device_info info = {
69 .name = "rcar-du-r8a7791",
72 .num_res = ARRAY_SIZE(du_resources),
73 .data = &koelsch_du_pdata,
74 .size_data = sizeof(koelsch_du_pdata),
75 .dma_mask = DMA_BIT_MASK(32),
78 platform_device_register_full(&info);
82 * This is a really crude hack to provide clkdev support to platform
83 * devices until they get moved to DT.
85 static const struct clk_name clk_names[] __initconst = {
86 { "du0", "du.0", "rcar-du-r8a7791" },
87 { "du1", "du.1", "rcar-du-r8a7791" },
88 { "lvds0", "lvds.0", "rcar-du-r8a7791" },
91 static void __init koelsch_add_standard_devices(void)
93 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
94 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
96 koelsch_add_du_device();
99 static const char * const koelsch_boards_compat_dt[] __initconst = {
101 "renesas,koelsch-reference",
105 DT_MACHINE_START(KOELSCH_DT, "koelsch")
106 .smp = smp_ops(r8a7791_smp_ops),
107 .init_early = shmobile_init_delay,
108 .init_time = rcar_gen2_timer_init,
109 .init_machine = koelsch_add_standard_devices,
110 .init_late = shmobile_init_late,
111 .reserve = rcar_gen2_reserve,
112 .dt_compat = koelsch_boards_compat_dt,