summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap/omap_devices.c
blob: beae59f74da74e0fbdc527f2a6a04e193dedeec7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// SPDX-License-Identifier: GPL-2.0-only

#include <driver.h>
#include <platform_data/serial-ns16550.h>
#include <asm/armlinux.h>

#include <mach/omap3-devices.h>

void omap_add_ram0(resource_size_t size)
{
	arm_add_mem_device("ram0", 0x80000000, size);
}

void omap_add_sram0(resource_size_t base, resource_size_t size)
{
	add_mem_device("sram0", base, size, IORESOURCE_MEM_WRITEABLE);
}

static struct NS16550_plat serial_plat = {
	.clock = 48000000,      /* 48MHz (APLL96/2) */
	.shift = 2,
};

struct device_d *omap_add_uart(int id, unsigned long base)
{
	return add_generic_device("omap-uart", id, NULL, base, 1024,
				  IORESOURCE_MEM | IORESOURCE_MEM_8BIT, &serial_plat);
}

#if defined(CONFIG_DRIVER_VIDEO_OMAP)
static struct resource omapfb_resources[] = {
	{
		.name	= "omap4_dss",
		.start	= 0x48040000,
		.end	= 0x48040000 + 512 - 1,
		.flags	= IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
	}, {
		.name	= "omap4_dispc",
		.start	= 0x48041000,
		.end	= 0x48041000 + 3072 - 1,
		.flags	= IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
	},
};

struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata)
{
	return add_generic_device_res("omap_fb", -1,
				      omapfb_resources,
				      ARRAY_SIZE(omapfb_resources),
				      o_pdata);
}
#else
struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata)
{
	return NULL;
}
#endif