diff options
Diffstat (limited to 'arch/arm/mach-tegra/p852/board-p852-sku23.c')
-rw-r--r-- | arch/arm/mach-tegra/p852/board-p852-sku23.c | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/p852/board-p852-sku23.c b/arch/arm/mach-tegra/p852/board-p852-sku23.c new file mode 100644 index 00000000000..a2bc9b4ca0b --- /dev/null +++ b/arch/arm/mach-tegra/p852/board-p852-sku23.c | |||
@@ -0,0 +1,113 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/board-p852-sku23.c | ||
3 | * | ||
4 | * Copyright (c) 2010-2011, NVIDIA Corporation. | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include "board-p852.h" | ||
18 | |||
19 | static inline void __init p852_sku23_spi_init(void) | ||
20 | { | ||
21 | p852_sku_peripherals |= P852_SKU_SPI_ENABLE; | ||
22 | p852_spi_peripherals |= | ||
23 | ((P852_SPI_SLAVE | P852_SPI_ENABLE) << P852_SPI1_SHIFT) | | ||
24 | ((P852_SPI_SLAVE | P852_SPI_ENABLE) << P852_SPI2_SHIFT) | | ||
25 | ((P852_SPI_SLAVE | P852_SPI_ENABLE) << P852_SPI3_SHIFT) | | ||
26 | ((P852_SPI_SLAVE | P852_SPI_ENABLE) << P852_SPI4_SHIFT); | ||
27 | } | ||
28 | |||
29 | static inline void p852_sku23_sdhci_init(void) | ||
30 | { | ||
31 | p852_sku_peripherals |= P852_SKU_SDHCI_ENABLE; | ||
32 | p852_sdhci_peripherals |= (P852_SDHCI_ENABLE << P852_SDHCI1_SHIFT) | | ||
33 | (P852_SDHCI_ENABLE << P852_SDHCI2_SHIFT) | | ||
34 | ((P852_SDHCI_ENABLE | P852_SDHCI_CD_EN) << P852_SDHCI3_SHIFT); | ||
35 | |||
36 | p852_sdhci_platform_data[1].is_8bit = true; | ||
37 | p852_sdhci_platform_data[2].cd_gpio = TEGRA_GPIO_PD7; | ||
38 | } | ||
39 | |||
40 | static inline void p852_sku23_i2s_init(void) | ||
41 | { | ||
42 | p852_sku_peripherals |= P852_SKU_I2S_ENABLE; | ||
43 | p852_i2s_peripherals |= | ||
44 | ((P852_I2S_TDM | P852_I2S_ENABLE) << P852_I2S1_SHIFT) | | ||
45 | ((P852_I2S_TDM | P852_I2S_ENABLE) << P852_I2S2_SHIFT); | ||
46 | } | ||
47 | |||
48 | static inline void p852_sku23_uart_init(void) | ||
49 | { | ||
50 | p852_sku_peripherals |= P852_SKU_UART_ENABLE; | ||
51 | p852_uart_peripherals |= | ||
52 | ((P852_UART_ENABLE) << P852_UARTA_SHIFT) | | ||
53 | ((P852_UART_ENABLE | P852_UART_HS) << P852_UARTB_SHIFT) | | ||
54 | ((P852_UART_ENABLE | P852_UART_DB) << P852_UARTC_SHIFT); | ||
55 | } | ||
56 | |||
57 | static inline void p852_sku23_display_init(void) | ||
58 | { | ||
59 | p852_sku_peripherals |= P852_SKU_DISPLAY_ENABLE; | ||
60 | p852_display_peripherals |= | ||
61 | (P852_DISP_ENABLE << P852_DISPA_SHIFT); | ||
62 | } | ||
63 | |||
64 | static inline void p852_sku23_i2c_init(void) | ||
65 | { | ||
66 | p852_sku_peripherals |= P852_SKU_I2C_ENABLE; | ||
67 | p852_i2c_peripherals |= | ||
68 | ((P852_I2C_ENABLE) << P852_I2C1_SHIFT) | | ||
69 | ((P852_I2C_ENABLE) << P852_I2C2_SHIFT) | | ||
70 | ((P852_I2C_ENABLE) << P852_I2C3_SHIFT) | | ||
71 | ((P852_I2C_ENABLE) << P852_I2C4_SHIFT); | ||
72 | } | ||
73 | |||
74 | #ifdef CONFIG_TEGRA_SPI_I2S | ||
75 | static struct tegra_spi_i2s_platform_data spi_i2s_data = { | ||
76 | .gpio_i2s = { | ||
77 | .gpio_no = TEGRA_GPIO_PS3, | ||
78 | .active_state = 0, | ||
79 | }, | ||
80 | .gpio_spi = { | ||
81 | .gpio_no = TEGRA_GPIO_PS4, | ||
82 | .active_state = 0, | ||
83 | }, | ||
84 | .spi_i2s_timeout_ms = 25, | ||
85 | }; | ||
86 | |||
87 | static inline void p852_sku23_spi_i2s_init(void) | ||
88 | { | ||
89 | tegra_spi_i2s_device.platform_data = &spi_i2s_data; | ||
90 | /* cpld_gpio_dir1 and cpld_gpio_dir2*/ | ||
91 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_KBCB, TEGRA_TRI_NORMAL); | ||
92 | p852_spi_i2s_init(); | ||
93 | } | ||
94 | #endif | ||
95 | |||
96 | void __init p852_sku23_init(void) | ||
97 | { | ||
98 | p852_sku_peripherals |= P852_SKU_NAND_ENABLE; | ||
99 | |||
100 | p852_sku23_spi_init(); | ||
101 | p852_sku23_i2s_init(); | ||
102 | p852_sku23_uart_init(); | ||
103 | p852_sku23_sdhci_init(); | ||
104 | p852_sku23_i2c_init(); | ||
105 | p852_sku23_display_init(); | ||
106 | |||
107 | p852_common_init(); | ||
108 | |||
109 | #ifdef CONFIG_TEGRA_SPI_I2S | ||
110 | p852_sku23_spi_i2s_init(); | ||
111 | #endif | ||
112 | } | ||
113 | |||