blob: 1c4dca924ac0b8d2b55570255c505e8df082f742 [file] [log] [blame]
Kevin Hilmane38d92f2009-04-29 17:44:58 -07001/*
2 * Chip specific defines for DM646x SoC
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) Deep Root Systems, LLC. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#ifndef __ASM_ARCH_DM646X_H
12#define __ASM_ARCH_DM646X_H
13
14#include <mach/hardware.h>
Chaithrika U S25acf552009-06-05 06:28:08 -040015#include <mach/asp.h>
Muralidharan Karicheri85609c12009-09-16 13:15:30 -040016#include <linux/i2c.h>
17#include <linux/videodev2.h>
Sekhar Noric1978e12009-11-24 18:25:15 +053018#include <linux/clk.h>
Sriramakrishnan8ee2bf92009-11-19 15:58:25 +053019#include <linux/davinci_emac.h>
Kevin Hilmanac7b75b2009-05-07 06:19:40 -070020
21#define DM646X_EMAC_BASE (0x01C80000)
Cyril Chemparathyd22960c2010-09-15 10:11:22 -040022#define DM646X_EMAC_MDIO_BASE (DM646X_EMAC_BASE + 0x4000)
Kevin Hilmanac7b75b2009-05-07 06:19:40 -070023#define DM646X_EMAC_CNTRL_OFFSET (0x0000)
24#define DM646X_EMAC_CNTRL_MOD_OFFSET (0x1000)
25#define DM646X_EMAC_CNTRL_RAM_OFFSET (0x2000)
26#define DM646X_EMAC_MDIO_OFFSET (0x4000)
27#define DM646X_EMAC_CNTRL_RAM_SIZE (0x2000)
Kevin Hilmane38d92f2009-04-29 17:44:58 -070028
Sergei Shtylyov70342172010-04-16 21:29:11 +040029#define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000
30#define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000
31
Kevin Hilmane38d92f2009-04-29 17:44:58 -070032void __init dm646x_init(void);
Chaithrika U S25acf552009-06-05 06:28:08 -040033void __init dm646x_init_mcasp0(struct snd_platform_data *pdata);
34void __init dm646x_init_mcasp1(struct snd_platform_data *pdata);
Sekhar Noric1978e12009-11-24 18:25:15 +053035void __init dm646x_board_setup_refclk(struct clk *clk);
Rajashekhara, Sudhakarcce3ddd2010-06-29 11:35:15 +053036int __init dm646x_init_edma(struct edma_rsv_info *rsv);
Kevin Hilmane38d92f2009-04-29 17:44:58 -070037
Muralidharan Karicheri85609c12009-09-16 13:15:30 -040038void dm646x_video_init(void);
39
40enum vpif_if_type {
41 VPIF_IF_BT656,
42 VPIF_IF_BT1120,
43 VPIF_IF_RAW_BAYER
44};
45
46struct vpif_interface {
47 enum vpif_if_type if_type;
48 unsigned hd_pol:1;
49 unsigned vd_pol:1;
50 unsigned fid_pol:1;
51};
52
53struct vpif_subdev_info {
54 const char *name;
55 struct i2c_board_info board_info;
56 u32 input;
57 u32 output;
58 unsigned can_route:1;
59 struct vpif_interface vpif_if;
60};
61
62struct vpif_display_config {
63 int (*set_clock)(int, int);
64 struct vpif_subdev_info *subdevinfo;
65 int subdev_count;
66 const char **output;
67 int output_count;
68 const char *card_name;
69};
70
71struct vpif_input {
72 struct v4l2_input input;
73 const char *subdev_name;
74};
75
76#define VPIF_CAPTURE_MAX_CHANNELS 2
77
78struct vpif_capture_chan_config {
79 const struct vpif_input *inputs;
80 int input_count;
81};
82
83struct vpif_capture_config {
84 int (*setup_input_channel_mode)(int);
85 int (*setup_input_path)(int, const char *);
86 struct vpif_capture_chan_config chan_config[VPIF_CAPTURE_MAX_CHANNELS];
87 struct vpif_subdev_info *subdev_info;
88 int subdev_count;
89 const char *card_name;
90};
91
92void dm646x_setup_vpif(struct vpif_display_config *,
93 struct vpif_capture_config *);
94
Kevin Hilmane38d92f2009-04-29 17:44:58 -070095#endif /* __ASM_ARCH_DM646X_H */