Manjunath Hadli | 39c6d2d | 2011-12-21 19:13:35 +0530 | [diff] [blame] | 1 | /* |
| 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, Gururaja | 896f66b | 2012-08-27 18:56:41 +0530 | [diff] [blame] | 25 | #include <linux/platform_data/davinci_asp.h> |
Matt Porter | 3ad7a42 | 2013-03-06 11:15:31 -0500 | [diff] [blame] | 26 | #include <linux/platform_data/edma.h> |
Arnd Bergmann | ec2a083 | 2012-08-24 15:11:34 +0200 | [diff] [blame] | 27 | #include <linux/platform_data/keyscan-davinci.h> |
Manjunath Hadli | 5cfb19a | 2011-12-21 19:13:36 +0530 | [diff] [blame] | 28 | #include <mach/hardware.h> |
Manjunath Hadli | 39c6d2d | 2011-12-21 19:13:35 +0530 | [diff] [blame] | 29 | |
| 30 | #include <media/davinci/vpfe_capture.h> |
| 31 | #include <media/davinci/vpif_types.h> |
Manjunath Hadli | af946f2 | 2012-02-23 15:17:45 +0530 | [diff] [blame] | 32 | #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 Hadli | 39c6d2d | 2011-12-21 19:13:35 +0530 | [diff] [blame] | 37 | |
David Lechner | 2782327 | 2018-05-18 11:48:17 -0500 | [diff] [blame] | 38 | #define DAVINCI_PLL1_BASE 0x01c40800 |
| 39 | #define DAVINCI_PLL2_BASE 0x01c40c00 |
| 40 | #define DAVINCI_PWR_SLEEP_CNTRL_BASE 0x01c41000 |
| 41 | |
Manjunath Hadli | 5cfb19a | 2011-12-21 19:13:36 +0530 | [diff] [blame] | 42 | #define DAVINCI_SYSTEM_MODULE_BASE 0x01c40000 |
Lad, Prabhakar | 120c660 | 2013-03-19 07:34:36 -0300 | [diff] [blame] | 43 | #define SYSMOD_VDAC_CONFIG 0x2c |
Manjunath Hadli | 5cfb19a | 2011-12-21 19:13:36 +0530 | [diff] [blame] | 44 | #define SYSMOD_VIDCLKCTL 0x38 |
Manjunath Hadli | af946f2 | 2012-02-23 15:17:45 +0530 | [diff] [blame] | 45 | #define SYSMOD_VPSS_CLKCTL 0x44 |
Manjunath Hadli | 5cfb19a | 2011-12-21 19:13:36 +0530 | [diff] [blame] | 46 | #define SYSMOD_VDD3P3VPWDN 0x48 |
| 47 | #define SYSMOD_VSCLKDIS 0x6c |
| 48 | #define SYSMOD_PUPDCTL1 0x7c |
| 49 | |
Lad, Prabhakar | 120c660 | 2013-03-19 07:34:36 -0300 | [diff] [blame] | 50 | /* VPSS CLKCTL bit definitions */ |
Lad, Prabhakar | 62a2d6c | 2013-04-09 10:35:05 -0300 | [diff] [blame] | 51 | #define VPSS_MUXSEL_EXTCLK_ENABLE BIT(1) |
Lad, Prabhakar | 120c660 | 2013-03-19 07:34:36 -0300 | [diff] [blame] | 52 | #define VPSS_VENCCLKEN_ENABLE BIT(3) |
| 53 | #define VPSS_DACCLKEN_ENABLE BIT(4) |
| 54 | #define VPSS_PLLC2SYSCLK5_ENABLE BIT(5) |
| 55 | |
Manjunath Hadli | 5cfb19a | 2011-12-21 19:13:36 +0530 | [diff] [blame] | 56 | extern void __iomem *davinci_sysmod_base; |
| 57 | #define DAVINCI_SYSMOD_VIRT(x) (davinci_sysmod_base + (x)) |
| 58 | void davinci_map_sysmod(void); |
| 59 | |
Philip Avinash | 9cc1515 | 2013-08-18 10:49:00 +0530 | [diff] [blame] | 60 | #define DAVINCI_GPIO_BASE 0x01C67000 |
| 61 | int davinci_gpio_register(struct resource *res, int size, void *pdata); |
| 62 | |
Bartosz Golaszewski | 66ae81d | 2019-07-22 15:17:43 +0200 | [diff] [blame] | 63 | #define DAVINCI_TIMER0_BASE (IO_PHYS + 0x21400) |
| 64 | #define DAVINCI_WDOG_BASE (IO_PHYS + 0x21C00) |
| 65 | |
Manjunath Hadli | 39c6d2d | 2011-12-21 19:13:35 +0530 | [diff] [blame] | 66 | /* DM355 base addresses */ |
| 67 | #define DM355_ASYNC_EMIF_CONTROL_BASE 0x01e10000 |
| 68 | #define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 |
| 69 | |
| 70 | #define ASP1_TX_EVT_EN 1 |
| 71 | #define ASP1_RX_EVT_EN 2 |
| 72 | |
| 73 | /* DM365 base addresses */ |
| 74 | #define DM365_ASYNC_EMIF_CONTROL_BASE 0x01d10000 |
| 75 | #define DM365_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 |
| 76 | #define DM365_ASYNC_EMIF_DATA_CE1_BASE 0x04000000 |
| 77 | |
| 78 | /* DM644x base addresses */ |
| 79 | #define DM644X_ASYNC_EMIF_CONTROL_BASE 0x01e00000 |
| 80 | #define DM644X_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 |
| 81 | #define DM644X_ASYNC_EMIF_DATA_CE1_BASE 0x04000000 |
| 82 | #define DM644X_ASYNC_EMIF_DATA_CE2_BASE 0x06000000 |
| 83 | #define DM644X_ASYNC_EMIF_DATA_CE3_BASE 0x08000000 |
| 84 | |
| 85 | /* DM646x base addresses */ |
| 86 | #define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000 |
| 87 | #define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000 |
| 88 | |
Sekhar Nori | 1233090 | 2014-02-26 10:29:43 +0530 | [diff] [blame] | 89 | int davinci_init_wdt(void); |
| 90 | |
Manjunath Hadli | 39c6d2d | 2011-12-21 19:13:35 +0530 | [diff] [blame] | 91 | /* DM355 function declarations */ |
Lad, Prabhakar | b464e3c | 2013-04-01 17:03:36 +0530 | [diff] [blame] | 92 | void dm355_init(void); |
David Lechner | 96c0817 | 2018-01-19 21:20:22 -0600 | [diff] [blame] | 93 | void dm355_init_time(void); |
Bartosz Golaszewski | de4f82a | 2019-02-14 15:52:05 +0100 | [diff] [blame] | 94 | void dm355_init_irq(void); |
David Lechner | 5b19f66 | 2018-05-18 11:48:09 -0500 | [diff] [blame] | 95 | void dm355_register_clocks(void); |
Manjunath Hadli | 39c6d2d | 2011-12-21 19:13:35 +0530 | [diff] [blame] | 96 | void dm355_init_spi0(unsigned chipselect_mask, |
Uwe Kleine-König | d65566e | 2012-03-30 22:13:53 +0200 | [diff] [blame] | 97 | const struct spi_board_info *info, unsigned len); |
Petr Kulhavy | 6bce5ef | 2016-05-09 15:59:48 +0200 | [diff] [blame] | 98 | void dm355_init_asp1(u32 evt_enable); |
Lad, Prabhakar | 62a2d6c | 2013-04-09 10:35:05 -0300 | [diff] [blame] | 99 | int dm355_init_video(struct vpfe_config *, struct vpbe_config *); |
Philip Avinash | 9cc1515 | 2013-08-18 10:49:00 +0530 | [diff] [blame] | 100 | int dm355_gpio_register(void); |
Manjunath Hadli | 39c6d2d | 2011-12-21 19:13:35 +0530 | [diff] [blame] | 101 | |
| 102 | /* DM365 function declarations */ |
Lad, Prabhakar | b464e3c | 2013-04-01 17:03:36 +0530 | [diff] [blame] | 103 | void dm365_init(void); |
Bartosz Golaszewski | de4f82a | 2019-02-14 15:52:05 +0100 | [diff] [blame] | 104 | void dm365_init_irq(void); |
David Lechner | 96c0817 | 2018-01-19 21:20:22 -0600 | [diff] [blame] | 105 | void dm365_init_time(void); |
David Lechner | 21c2f47 | 2018-05-18 11:48:10 -0500 | [diff] [blame] | 106 | void dm365_register_clocks(void); |
Petr Kulhavy | 6bce5ef | 2016-05-09 15:59:48 +0200 | [diff] [blame] | 107 | void dm365_init_asp(void); |
Sekhar Nori | 933b11ae | 2016-07-12 19:46:13 +0530 | [diff] [blame] | 108 | void dm365_init_vc(void); |
Lad, Prabhakar | b464e3c | 2013-04-01 17:03:36 +0530 | [diff] [blame] | 109 | void dm365_init_ks(struct davinci_ks_platform_data *pdata); |
| 110 | void dm365_init_rtc(void); |
Manjunath Hadli | 39c6d2d | 2011-12-21 19:13:35 +0530 | [diff] [blame] | 111 | void dm365_init_spi0(unsigned chipselect_mask, |
Uwe Kleine-König | d65566e | 2012-03-30 22:13:53 +0200 | [diff] [blame] | 112 | const struct spi_board_info *info, unsigned len); |
Lad, Prabhakar | 120c660 | 2013-03-19 07:34:36 -0300 | [diff] [blame] | 113 | int dm365_init_video(struct vpfe_config *, struct vpbe_config *); |
Philip Avinash | 9cc1515 | 2013-08-18 10:49:00 +0530 | [diff] [blame] | 114 | int dm365_gpio_register(void); |
Manjunath Hadli | 39c6d2d | 2011-12-21 19:13:35 +0530 | [diff] [blame] | 115 | |
| 116 | /* DM644x function declarations */ |
Lad, Prabhakar | b464e3c | 2013-04-01 17:03:36 +0530 | [diff] [blame] | 117 | void dm644x_init(void); |
Bartosz Golaszewski | de4f82a | 2019-02-14 15:52:05 +0100 | [diff] [blame] | 118 | void dm644x_init_irq(void); |
Sekhar Nori | 8e730c7 | 2018-04-06 18:08:20 +0530 | [diff] [blame] | 119 | void dm644x_init_devices(void); |
David Lechner | 96c0817 | 2018-01-19 21:20:22 -0600 | [diff] [blame] | 120 | void dm644x_init_time(void); |
David Lechner | a5b1a87 | 2018-05-18 11:48:11 -0500 | [diff] [blame] | 121 | void dm644x_register_clocks(void); |
Petr Kulhavy | 6bce5ef | 2016-05-09 15:59:48 +0200 | [diff] [blame] | 122 | void dm644x_init_asp(void); |
Lad, Prabhakar | b464e3c | 2013-04-01 17:03:36 +0530 | [diff] [blame] | 123 | int dm644x_init_video(struct vpfe_config *, struct vpbe_config *); |
Philip Avinash | 9cc1515 | 2013-08-18 10:49:00 +0530 | [diff] [blame] | 124 | int dm644x_gpio_register(void); |
Manjunath Hadli | 39c6d2d | 2011-12-21 19:13:35 +0530 | [diff] [blame] | 125 | |
| 126 | /* DM646x function declarations */ |
Lad, Prabhakar | b464e3c | 2013-04-01 17:03:36 +0530 | [diff] [blame] | 127 | void dm646x_init(void); |
Bartosz Golaszewski | de4f82a | 2019-02-14 15:52:05 +0100 | [diff] [blame] | 128 | void dm646x_init_irq(void); |
David Lechner | 96c0817 | 2018-01-19 21:20:22 -0600 | [diff] [blame] | 129 | void dm646x_init_time(unsigned long ref_clk_rate, unsigned long aux_clkin_rate); |
David Lechner | 81df7d8 | 2018-05-18 11:48:12 -0500 | [diff] [blame] | 130 | void dm646x_register_clocks(void); |
Lad, Prabhakar | b464e3c | 2013-04-01 17:03:36 +0530 | [diff] [blame] | 131 | void dm646x_init_mcasp0(struct snd_platform_data *pdata); |
| 132 | void dm646x_init_mcasp1(struct snd_platform_data *pdata); |
| 133 | int dm646x_init_edma(struct edma_rsv_info *rsv); |
Manjunath Hadli | 39c6d2d | 2011-12-21 19:13:35 +0530 | [diff] [blame] | 134 | void dm646x_video_init(void); |
| 135 | void dm646x_setup_vpif(struct vpif_display_config *, |
| 136 | struct vpif_capture_config *); |
Philip Avinash | 9cc1515 | 2013-08-18 10:49:00 +0530 | [diff] [blame] | 137 | int dm646x_gpio_register(void); |
Manjunathappa, Prakash | fcf7157 | 2013-06-19 14:45:42 +0530 | [diff] [blame] | 138 | |
| 139 | extern struct platform_device dm365_serial_device[]; |
| 140 | extern struct platform_device dm355_serial_device[]; |
| 141 | extern struct platform_device dm644x_serial_device[]; |
| 142 | extern struct platform_device dm646x_serial_device[]; |
Manjunath Hadli | 39c6d2d | 2011-12-21 19:13:35 +0530 | [diff] [blame] | 143 | #endif /*__DAVINCI_H */ |