blob: 4ffc37accce074fa639c1b6821f50c8c45455b47 [file] [log] [blame]
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +05301/*
2 * This file contains the processor specific definitions
3 * of the TI DM644x, DM355, DM365, and DM646x.
4 *
5 * Copyright (C) 2011 Texas Instruments Incorporated
6 * Copyright (c) 2007 Deep Root Systems, LLC
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation version 2.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17#ifndef __DAVINCI_H
18#define __DAVINCI_H
19
20#include <linux/clk.h>
21#include <linux/videodev2.h>
22#include <linux/davinci_emac.h>
23#include <linux/platform_device.h>
24#include <linux/spi/spi.h>
Hebbar, Gururaja896f66b2012-08-27 18:56:41 +053025#include <linux/platform_data/davinci_asp.h>
Matt Porter3ad7a422013-03-06 11:15:31 -050026#include <linux/platform_data/edma.h>
Arnd Bergmannec2a0832012-08-24 15:11:34 +020027#include <linux/platform_data/keyscan-davinci.h>
Manjunath Hadli5cfb19a2011-12-21 19:13:36 +053028#include <mach/hardware.h>
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +053029
30#include <media/davinci/vpfe_capture.h>
31#include <media/davinci/vpif_types.h>
Manjunath Hadliaf946f22012-02-23 15:17:45 +053032#include <media/davinci/vpss.h>
33#include <media/davinci/vpbe_types.h>
34#include <media/davinci/vpbe_venc.h>
35#include <media/davinci/vpbe.h>
36#include <media/davinci/vpbe_osd.h>
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +053037
Manjunath Hadli5cfb19a2011-12-21 19:13:36 +053038#define DAVINCI_SYSTEM_MODULE_BASE 0x01c40000
Lad, Prabhakar120c6602013-03-19 07:34:36 -030039#define SYSMOD_VDAC_CONFIG 0x2c
Manjunath Hadli5cfb19a2011-12-21 19:13:36 +053040#define SYSMOD_VIDCLKCTL 0x38
Manjunath Hadliaf946f22012-02-23 15:17:45 +053041#define SYSMOD_VPSS_CLKCTL 0x44
Manjunath Hadli5cfb19a2011-12-21 19:13:36 +053042#define SYSMOD_VDD3P3VPWDN 0x48
43#define SYSMOD_VSCLKDIS 0x6c
44#define SYSMOD_PUPDCTL1 0x7c
45
Lad, Prabhakar120c6602013-03-19 07:34:36 -030046/* VPSS CLKCTL bit definitions */
Lad, Prabhakar62a2d6c2013-04-09 10:35:05 -030047#define VPSS_MUXSEL_EXTCLK_ENABLE BIT(1)
Lad, Prabhakar120c6602013-03-19 07:34:36 -030048#define VPSS_VENCCLKEN_ENABLE BIT(3)
49#define VPSS_DACCLKEN_ENABLE BIT(4)
50#define VPSS_PLLC2SYSCLK5_ENABLE BIT(5)
51
Manjunath Hadli5cfb19a2011-12-21 19:13:36 +053052extern void __iomem *davinci_sysmod_base;
53#define DAVINCI_SYSMOD_VIRT(x) (davinci_sysmod_base + (x))
54void davinci_map_sysmod(void);
55
Philip Avinash9cc15152013-08-18 10:49:00 +053056#define DAVINCI_GPIO_BASE 0x01C67000
57int davinci_gpio_register(struct resource *res, int size, void *pdata);
58
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +053059/* DM355 base addresses */
60#define DM355_ASYNC_EMIF_CONTROL_BASE 0x01e10000
61#define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
62
63#define ASP1_TX_EVT_EN 1
64#define ASP1_RX_EVT_EN 2
65
66/* DM365 base addresses */
67#define DM365_ASYNC_EMIF_CONTROL_BASE 0x01d10000
68#define DM365_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
69#define DM365_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
70
71/* DM644x base addresses */
72#define DM644X_ASYNC_EMIF_CONTROL_BASE 0x01e00000
73#define DM644X_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
74#define DM644X_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
75#define DM644X_ASYNC_EMIF_DATA_CE2_BASE 0x06000000
76#define DM644X_ASYNC_EMIF_DATA_CE3_BASE 0x08000000
77
78/* DM646x base addresses */
79#define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000
80#define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000
81
Sekhar Nori12330902014-02-26 10:29:43 +053082int davinci_init_wdt(void);
83
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +053084/* DM355 function declarations */
Lad, Prabhakarb464e3c2013-04-01 17:03:36 +053085void dm355_init(void);
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +053086void dm355_init_spi0(unsigned chipselect_mask,
Uwe Kleine-Königd65566e2012-03-30 22:13:53 +020087 const struct spi_board_info *info, unsigned len);
Lad, Prabhakarb464e3c2013-04-01 17:03:36 +053088void dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata);
Lad, Prabhakar62a2d6c2013-04-09 10:35:05 -030089int dm355_init_video(struct vpfe_config *, struct vpbe_config *);
Philip Avinash9cc15152013-08-18 10:49:00 +053090int dm355_gpio_register(void);
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +053091
92/* DM365 function declarations */
Lad, Prabhakarb464e3c2013-04-01 17:03:36 +053093void dm365_init(void);
94void dm365_init_asp(struct snd_platform_data *pdata);
95void dm365_init_vc(struct snd_platform_data *pdata);
96void dm365_init_ks(struct davinci_ks_platform_data *pdata);
97void dm365_init_rtc(void);
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +053098void dm365_init_spi0(unsigned chipselect_mask,
Uwe Kleine-Königd65566e2012-03-30 22:13:53 +020099 const struct spi_board_info *info, unsigned len);
Lad, Prabhakar120c6602013-03-19 07:34:36 -0300100int dm365_init_video(struct vpfe_config *, struct vpbe_config *);
Philip Avinash9cc15152013-08-18 10:49:00 +0530101int dm365_gpio_register(void);
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +0530102
103/* DM644x function declarations */
Lad, Prabhakarb464e3c2013-04-01 17:03:36 +0530104void dm644x_init(void);
105void dm644x_init_asp(struct snd_platform_data *pdata);
106int dm644x_init_video(struct vpfe_config *, struct vpbe_config *);
Philip Avinash9cc15152013-08-18 10:49:00 +0530107int dm644x_gpio_register(void);
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +0530108
109/* DM646x function declarations */
Lad, Prabhakarb464e3c2013-04-01 17:03:36 +0530110void dm646x_init(void);
111void dm646x_init_mcasp0(struct snd_platform_data *pdata);
112void dm646x_init_mcasp1(struct snd_platform_data *pdata);
113int dm646x_init_edma(struct edma_rsv_info *rsv);
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +0530114void dm646x_video_init(void);
115void dm646x_setup_vpif(struct vpif_display_config *,
116 struct vpif_capture_config *);
Philip Avinash9cc15152013-08-18 10:49:00 +0530117int dm646x_gpio_register(void);
Manjunathappa, Prakashfcf71572013-06-19 14:45:42 +0530118
119extern struct platform_device dm365_serial_device[];
120extern struct platform_device dm355_serial_device[];
121extern struct platform_device dm644x_serial_device[];
122extern struct platform_device dm646x_serial_device[];
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +0530123#endif /*__DAVINCI_H */