Blame view
arch/arm/mach-omap2/board-am335xevm.c
56.3 KB
433039582 arm:omap:am33xx: ... |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
/* * Code for AM335X EVM. * * Copyright (C) 2011 Texas Instruments, Inc. - http://www.ti.com/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation version 2. * * This program is distributed "as is" WITHOUT ANY WARRANTY of any * kind, whether express or implied; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <linux/kernel.h> #include <linux/init.h> |
385ed291a arm:omap:am33xx: ... |
17 |
#include <linux/i2c.h> |
1ca8aed50 arm:omap:am33xx: ... |
18 |
#include <linux/i2c/at24.h> |
17bd4260b arm:omap:am33xx: ... |
19 |
#include <linux/phy.h> |
6de8f7503 ARM:omap:am33xx: ... |
20 |
#include <linux/gpio.h> |
636a1595c AM335x: SPI devic... |
21 22 |
#include <linux/spi/spi.h> #include <linux/spi/flash.h> |
5edc297a6 AM335XEVM: Matrix... |
23 |
#include <linux/input.h> |
c55c452a6 arm:omap:am335x: ... |
24 |
#include <linux/gpio_keys.h> |
5edc297a6 AM335XEVM: Matrix... |
25 |
#include <linux/input/matrix_keypad.h> |
3fd0e971c AM335X: NAND: NAN... |
26 27 28 29 |
#include <linux/mtd/mtd.h> #include <linux/mtd/nand.h> #include <linux/mtd/partitions.h> #include <linux/platform_device.h> |
3a52314ec AM335x:LCDC funct... |
30 31 |
#include <linux/clk.h> #include <linux/err.h> |
9d01c45e9 board-am335xevm: ... |
32 |
#include <linux/wl12xx.h> |
72e9d5232 ARM:omap:am335x: ... |
33 |
#include <linux/ethtool.h> |
276a52f8b arm:omap:am33xx: ... |
34 |
#include <linux/mfd/tps65910.h> |
433039582 arm:omap:am33xx: ... |
35 |
|
f80c8a5f2 arm:omap:am33xx: ... |
36 37 |
/* LCD controller is similar to DA850 */ #include <video/da8xx-fb.h> |
433039582 arm:omap:am33xx: ... |
38 |
#include <mach/hardware.h> |
609691c19 ARM:omap:am33xx: ... |
39 |
#include <mach/board-am335xevm.h> |
433039582 arm:omap:am33xx: ... |
40 41 42 |
#include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> |
a83ee205d arm:omap:am33xx: ... |
43 |
#include <asm/hardware/asp.h> |
433039582 arm:omap:am33xx: ... |
44 45 46 47 |
#include <plat/irqs.h> #include <plat/board.h> #include <plat/common.h> |
b2471dff7 AM335X: Enable LC... |
48 |
#include <plat/lcdc.h> |
eb3dad1ce am335x: add musb ... |
49 |
#include <plat/usb.h> |
9ba3872ab arm:omap:am33xx: ... |
50 |
#include <plat/mmc.h> |
b2471dff7 AM335X: Enable LC... |
51 |
|
a83ee205d arm:omap:am33xx: ... |
52 |
#include "board-flash.h" |
57abae34c arm:omap:am335x: ... |
53 |
#include "cpuidle33xx.h" |
a83ee205d arm:omap:am33xx: ... |
54 55 |
#include "mux.h" #include "devices.h" |
9ba3872ab arm:omap:am33xx: ... |
56 |
#include "hsmmc.h" |
a83ee205d arm:omap:am33xx: ... |
57 |
|
17bd4260b arm:omap:am33xx: ... |
58 59 60 |
/* TLK PHY IDs */ #define TLK110_PHY_ID 0x2000A201 #define TLK110_PHY_MASK 0xfffffff0 |
72e9d5232 ARM:omap:am335x: ... |
61 62 63 |
/* BBB PHY IDs */ #define BBB_PHY_ID 0x7c0f1 #define BBB_PHY_MASK 0xfffffffe |
17bd4260b arm:omap:am33xx: ... |
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
/* TLK110 PHY register offsets */ #define TLK110_COARSEGAIN_REG 0x00A3 #define TLK110_LPFHPF_REG 0x00AC #define TLK110_SPAREANALOG_REG 0x00B9 #define TLK110_VRCR_REG 0x00D0 #define TLK110_SETFFE_REG 0x0107 #define TLK110_FTSP_REG 0x0154 #define TLK110_ALFATPIDL_REG 0x002A #define TLK110_PSCOEF21_REG 0x0096 #define TLK110_PSCOEF3_REG 0x0097 #define TLK110_ALFAFACTOR1_REG 0x002C #define TLK110_ALFAFACTOR2_REG 0x0023 #define TLK110_CFGPS_REG 0x0095 #define TLK110_FTSPTXGAIN_REG 0x0150 #define TLK110_SWSCR3_REG 0x000B #define TLK110_SCFALLBACK_REG 0x0040 #define TLK110_PHYRCR_REG 0x001F /* TLK110 register writes values */ #define TLK110_COARSEGAIN_VAL 0x0000 #define TLK110_LPFHPF_VAL 0x8000 #define TLK110_SPANALOG_VAL 0x0000 #define TLK110_VRCR_VAL 0x0008 #define TLK110_SETFFE_VAL 0x0605 #define TLK110_FTSP_VAL 0x0255 #define TLK110_ALFATPIDL_VAL 0x7998 #define TLK110_PSCOEF21_VAL 0x3A20 #define TLK110_PSCOEF3_VAL 0x003F #define TLK110_ALFACTOR1_VAL 0xFF80 #define TLK110_ALFACTOR2_VAL 0x021C #define TLK110_CFGPS_VAL 0x0000 #define TLK110_FTSPTXGAIN_VAL 0x6A88 #define TLK110_SWSCR3_VAL 0x0000 #define TLK110_SCFALLBACK_VAL 0xC11D #define TLK110_PHYRCR_VAL 0x4000 #ifdef CONFIG_TLK110_WORKAROUND #define am335x_tlk110_phy_init()\ do { \ phy_register_fixup_for_uid(TLK110_PHY_ID,\ TLK110_PHY_MASK,\ am335x_tlk110_phy_fixup);\ } while (0); #else #define am335x_tlk110_phy_init() do { } while (0); #endif |
f80ad5875 ARM:omaP:am33xx; ... |
110 111 |
/* Convert GPIO signal to GPIO pin number */ #define GPIO_TO_PIN(bank, gpio) (32 * (bank) + (gpio)) |
b2471dff7 AM335X: Enable LC... |
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
static const struct display_panel disp_panel = { WVGA, 32, 32, COLOR_ACTIVE, }; static struct lcd_ctrl_config lcd_cfg = { &disp_panel, .ac_bias = 255, .ac_bias_intrpt = 0, .dma_burst_sz = 16, .bpp = 32, .fdd = 0x80, .tft_alt_mode = 0, .stn_565_mode = 0, .mono_8bit_mode = 0, .invert_line_clock = 1, .invert_frm_clock = 1, .sync_edge = 0, .sync_ctrl = 1, .raster_order = 0, }; struct da8xx_lcdc_platform_data TFC_S9700RTWV35TR_01B_pdata = { .manu_name = "ThreeFive", .controller_data = &lcd_cfg, .type = "TFC_S9700RTWV35TR_01B", }; |
433039582 arm:omap:am33xx: ... |
141 |
|
1da3d8fa1 arm:omap:am33xx: ... |
142 143 |
/* TSc controller */ #include <linux/input/ti_tscadc.h> |
e2f95aab9 am335x: lis33ldlh... |
144 |
#include <linux/lis3lv02d.h> |
1da3d8fa1 arm:omap:am33xx: ... |
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
static struct resource tsc_resources[] = { [0] = { .start = AM33XX_TSC_BASE, .end = AM33XX_TSC_BASE + SZ_8K - 1, .flags = IORESOURCE_MEM, }, [1] = { .start = AM33XX_IRQ_ADC_GEN, .end = AM33XX_IRQ_ADC_GEN, .flags = IORESOURCE_IRQ, }, }; static struct tsc_data am335x_touchscreen_data = { .wires = 4, |
ad57d1c8b AM335x: Add suppo... |
161 |
.x_plate_resistance = 200, |
1da3d8fa1 arm:omap:am33xx: ... |
162 163 164 165 166 167 168 169 170 171 172 |
}; static struct platform_device tsc_device = { .name = "tsc", .id = -1, .dev = { .platform_data = &am335x_touchscreen_data, }, .num_resources = ARRAY_SIZE(tsc_resources), .resource = tsc_resources, }; |
a83ee205d arm:omap:am33xx: ... |
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
static u8 am335x_iis_serializer_direction1[] = { INACTIVE_MODE, INACTIVE_MODE, TX_MODE, RX_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, }; static struct snd_platform_data am335x_evm_snd_data1 = { .tx_dma_offset = 0x46400000, /* McASP1 */ .rx_dma_offset = 0x46400000, .op_mode = DAVINCI_MCASP_IIS_MODE, .num_serializer = ARRAY_SIZE(am335x_iis_serializer_direction1), .tdm_slots = 2, .serial_dir = am335x_iis_serializer_direction1, .asp_chan_q = EVENTQ_2, .version = MCASP_VERSION_3, .txnumevt = 1, .rxnumevt = 1, }; |
385ed291a arm:omap:am33xx: ... |
192 |
|
9ba3872ab arm:omap:am33xx: ... |
193 194 195 196 |
static struct omap2_hsmmc_info am335x_mmc[] __initdata = { { .mmc = 1, .caps = MMC_CAP_4_BIT_DATA, |
f80ad5875 ARM:omaP:am33xx; ... |
197 198 |
.gpio_cd = GPIO_TO_PIN(0, 6), .gpio_wp = GPIO_TO_PIN(3, 18), |
9ba3872ab arm:omap:am33xx: ... |
199 200 201 202 203 204 205 206 207 208 |
.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* 3V3 */ }, { .mmc = 0, /* will be set at runtime */ }, { .mmc = 0, /* will be set at runtime */ }, {} /* Terminator */ }; |
385ed291a arm:omap:am33xx: ... |
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
#ifdef CONFIG_OMAP_MUX static struct omap_board_mux board_mux[] __initdata = { AM33XX_MUX(I2C0_SDA, OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW | AM33XX_INPUT_EN | AM33XX_PIN_OUTPUT), AM33XX_MUX(I2C0_SCL, OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW | AM33XX_INPUT_EN | AM33XX_PIN_OUTPUT), { .reg_offset = OMAP_MUX_TERMINATOR }, }; #else #define board_mux NULL #endif /* module pin mux structure */ struct pinmux_config { const char *string_name; /* signal name format */ int val; /* Options for the mux register value */ }; |
609691c19 ARM:omap:am33xx: ... |
226 227 |
struct evm_dev_cfg { void (*device_init)(int evm_id, int profile); |
385ed291a arm:omap:am33xx: ... |
228 |
/* |
609691c19 ARM:omap:am33xx: ... |
229 230 |
* If the device is required on both baseboard & daughter board (ex i2c), * specify DEV_ON_BASEBOARD |
385ed291a arm:omap:am33xx: ... |
231 |
*/ |
609691c19 ARM:omap:am33xx: ... |
232 233 234 |
#define DEV_ON_BASEBOARD 0 #define DEV_ON_DGHTR_BRD 1 u32 device_on; |
385ed291a arm:omap:am33xx: ... |
235 |
|
609691c19 ARM:omap:am33xx: ... |
236 237 |
u32 profile; /* Profiles (0-7) in which the module is present */ }; |
385ed291a arm:omap:am33xx: ... |
238 |
|
609691c19 ARM:omap:am33xx: ... |
239 240 241 242 243 244 245 246 247 |
/* AM335X - CPLD Register Offsets */ #define CPLD_DEVICE_HDR 0x00 /* CPLD Header */ #define CPLD_DEVICE_ID 0x04 /* CPLD identification */ #define CPLD_DEVICE_REV 0x0C /* Revision of the CPLD code */ #define CPLD_CFG_REG 0x10 /* Configuration Register */ static struct i2c_client *cpld_client; static u32 am335x_evm_id; |
385ed291a arm:omap:am33xx: ... |
248 |
|
433039582 arm:omap:am33xx: ... |
249 250 |
static struct omap_board_config_kernel am335x_evm_config[] __initdata = { }; |
1ca8aed50 arm:omap:am33xx: ... |
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
/* * EVM Config held in On-Board eeprom device. * * Header Format * * Name Size Contents * (Bytes) *------------------------------------------------------------- * Header 4 0xAA, 0x55, 0x33, 0xEE * * Board Name 8 Name for board in ASCII. * example "A33515BB" = "AM335X Low Cost EVM board" * * Version 4 Hardware version code for board in * in ASCII. "1.0A" = rev.01.0A * * Serial Number 12 Serial number of the board. This is a 12 * character string which is WWYY4P16nnnn, where * WW = 2 digit week of the year of production * YY = 2 digit year of production * nnnn = incrementing board number * * Configuration option 32 Codes(TBD) to show the configuration * setup on this board. * * Available 32720 Available space for other non-volatile * data. */ struct am335x_evm_eeprom_config { u32 header; u8 name[8]; |
c8f997ab0 ARM:omap:am335x: ... |
283 |
char version[4]; |
1ca8aed50 arm:omap:am33xx: ... |
284 285 286 287 288 289 |
u8 serial[12]; u8 opt[32]; }; static struct am335x_evm_eeprom_config config; static bool daughter_brd_detected; |
c44f9ec7c ARM:omap:am33xx: ... |
290 |
#define GP_EVM_REV_IS_1_0 0x1 |
f375e5d52 ARM: OMAP: AM335x... |
291 292 293 |
#define GP_EVM_REV_IS_1_1A 0x2 #define GP_EVM_REV_IS_UNKNOWN 0xFF static unsigned int gp_evm_revision = GP_EVM_REV_IS_UNKNOWN; |
dfb4c854f arm:omap:cpsw: En... |
294 |
unsigned int gigabit_enable = 1; |
f375e5d52 ARM: OMAP: AM335x... |
295 |
|
17bd4260b arm:omap:am33xx: ... |
296 297 298 |
#define EEPROM_MAC_ADDRESS_OFFSET 60 /* 4+8+4+12+32 */ #define EEPROM_NO_OF_MAC_ADDR 3 static char am335x_mac_addr[EEPROM_NO_OF_MAC_ADDR][ETH_ALEN]; |
1ca8aed50 arm:omap:am33xx: ... |
299 |
#define AM335X_EEPROM_HEADER 0xEE3355AA |
609691c19 ARM:omap:am33xx: ... |
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
/* current profile if exists else PROFILE_0 on error */ static u32 am335x_get_profile_selection(void) { int val = 0; if (!cpld_client) /* error checking is not done in func's calling this routine. so return profile 0 on error */ return 0; val = i2c_smbus_read_word_data(cpld_client, CPLD_CFG_REG); if (val < 0) return 0; /* default to Profile 0 on Error */ else return val & 0x7; } |
b2471dff7 AM335X: Enable LC... |
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
/* Module pin mux for LCDC */ static struct pinmux_config lcdc_pin_mux[] = { {"lcd_data0.lcd_data0", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data1.lcd_data1", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data2.lcd_data2", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data3.lcd_data3", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data4.lcd_data4", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data5.lcd_data5", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data6.lcd_data6", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data7.lcd_data7", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data8.lcd_data8", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data9.lcd_data9", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data10.lcd_data10", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data11.lcd_data11", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data12.lcd_data12", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data13.lcd_data13", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data14.lcd_data14", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data15.lcd_data15", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"gpmc_ad8.lcd_data16", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad9.lcd_data17", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad10.lcd_data18", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad11.lcd_data19", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad12.lcd_data20", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad13.lcd_data21", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad14.lcd_data22", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad15.lcd_data23", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"lcd_vsync.lcd_vsync", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {"lcd_hsync.lcd_hsync", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {"lcd_pclk.lcd_pclk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {"lcd_ac_bias_en.lcd_ac_bias_en", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {NULL, 0}, }; |
1da3d8fa1 arm:omap:am33xx: ... |
364 365 366 367 368 369 370 371 372 |
static struct pinmux_config tsc_pin_mux[] = { {"ain0.ain0", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, {"ain1.ain1", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, {"ain2.ain2", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, {"ain3.ain3", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, {"vrefp.vrefp", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, {"vrefn.vrefn", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, {NULL, 0}, }; |
3fd0e971c AM335X: NAND: NAN... |
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
/* Pin mux for nand flash module */ static struct pinmux_config nand_pin_mux[] = { {"gpmc_ad0.gpmc_ad0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad1.gpmc_ad1", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad2.gpmc_ad2", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad3.gpmc_ad3", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad4.gpmc_ad4", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad5.gpmc_ad5", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad6.gpmc_ad6", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad7.gpmc_ad7", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_wait0.gpmc_wait0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_wpn.gpmc_wpn", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_csn0.gpmc_csn0", OMAP_MUX_MODE0 | AM33XX_PULL_DISA}, {"gpmc_advn_ale.gpmc_advn_ale", OMAP_MUX_MODE0 | AM33XX_PULL_DISA}, {"gpmc_oen_ren.gpmc_oen_ren", OMAP_MUX_MODE0 | AM33XX_PULL_DISA}, {"gpmc_wen.gpmc_wen", OMAP_MUX_MODE0 | AM33XX_PULL_DISA}, {"gpmc_ben0_cle.gpmc_ben0_cle", OMAP_MUX_MODE0 | AM33XX_PULL_DISA}, {NULL, 0}, }; |
636a1595c AM335x: SPI devic... |
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 |
/* Module pin mux for SPI fash */ static struct pinmux_config spi0_pin_mux[] = { {"spi0_sclk.spi0_sclk", OMAP_MUX_MODE0 | AM33XX_PULL_ENBL | AM33XX_INPUT_EN}, {"spi0_d0.spi0_d0", OMAP_MUX_MODE0 | AM33XX_PULL_ENBL | AM33XX_PULL_UP | AM33XX_INPUT_EN}, {"spi0_d1.spi0_d1", OMAP_MUX_MODE0 | AM33XX_PULL_ENBL | AM33XX_INPUT_EN}, {"spi0_cs0.spi0_cs0", OMAP_MUX_MODE0 | AM33XX_PULL_ENBL | AM33XX_PULL_UP | AM33XX_INPUT_EN}, {NULL, 0}, }; /* Module pin mux for SPI flash */ static struct pinmux_config spi1_pin_mux[] = { {"mcasp0_aclkx.spi1_sclk", OMAP_MUX_MODE3 | AM33XX_PULL_ENBL | AM33XX_INPUT_EN}, {"mcasp0_fsx.spi1_d0", OMAP_MUX_MODE3 | AM33XX_PULL_ENBL | AM33XX_PULL_UP | AM33XX_INPUT_EN}, {"mcasp0_axr0.spi1_d1", OMAP_MUX_MODE3 | AM33XX_PULL_ENBL | AM33XX_INPUT_EN}, {"mcasp0_ahclkr.spi1_cs0", OMAP_MUX_MODE3 | AM33XX_PULL_ENBL | AM33XX_PULL_UP | AM33XX_INPUT_EN}, {NULL, 0}, }; |
1da3d8fa1 arm:omap:am33xx: ... |
417 |
|
2b2bcf286 AM335X: CPSW pinm... |
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 |
/* Module pin mux for rgmii1 */ static struct pinmux_config rgmii1_pin_mux[] = { {"mii1_txen.rgmii1_tctl", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, {"mii1_rxdv.rgmii1_rctl", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_txd3.rgmii1_td3", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, {"mii1_txd2.rgmii1_td2", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, {"mii1_txd1.rgmii1_td1", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, {"mii1_txd0.rgmii1_td0", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, {"mii1_txclk.rgmii1_tclk", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, {"mii1_rxclk.rgmii1_rclk", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_rxd3.rgmii1_rd3", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_rxd2.rgmii1_rd2", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_rxd1.rgmii1_rd1", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_rxd0.rgmii1_rd0", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN}, {"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT_PULLUP}, {NULL, 0}, }; /* Module pin mux for rgmii2 */ static struct pinmux_config rgmii2_pin_mux[] = { {"gpmc_a0.rgmii2_tctl", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, {"gpmc_a1.rgmii2_rctl", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN}, {"gpmc_a2.rgmii2_td3", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, {"gpmc_a3.rgmii2_td2", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, {"gpmc_a4.rgmii2_td1", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, {"gpmc_a5.rgmii2_td0", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, {"gpmc_a6.rgmii2_tclk", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, {"gpmc_a7.rgmii2_rclk", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN}, {"gpmc_a8.rgmii2_rd3", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN}, {"gpmc_a9.rgmii2_rd2", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN}, {"gpmc_a10.rgmii2_rd1", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN}, {"gpmc_a11.rgmii2_rd0", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN}, {"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT_PULLUP}, {NULL, 0}, }; /* Module pin mux for mii1 */ static struct pinmux_config mii1_pin_mux[] = { {"mii1_rxerr.mii1_rxerr", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_txen.mii1_txen", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {"mii1_rxdv.mii1_rxdv", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_txd3.mii1_txd3", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {"mii1_txd2.mii1_txd2", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {"mii1_txd1.mii1_txd1", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {"mii1_txd0.mii1_txd0", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {"mii1_txclk.mii1_txclk", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_rxclk.mii1_rxclk", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_rxd3.mii1_rxd3", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_rxd2.mii1_rxd2", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_rxd1.mii1_rxd1", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_rxd0.mii1_rxd0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN}, {"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT_PULLUP}, {NULL, 0}, }; |
f1e12bb92 arm:omap:am33xx: ... |
475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
/* Module pin mux for rmii1 */ static struct pinmux_config rmii1_pin_mux[] = { {"mii1_crs.rmii1_crs_dv", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_rxerr.mii1_rxerr", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_txen.mii1_txen", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"mii1_txd1.mii1_txd1", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"mii1_txd0.mii1_txd0", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"mii1_rxd1.mii1_rxd1", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_rxd0.mii1_rxd0", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN}, {"rmii1_refclk.rmii1_refclk", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN}, {"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT_PULLUP}, {NULL, 0}, }; |
b5c4f8f49 arm:omap:am33xx: ... |
489 490 491 492 493 494 495 |
static struct pinmux_config i2c1_pin_mux[] = { {"spi0_d1.i2c1_sda", OMAP_MUX_MODE2 | AM33XX_SLEWCTRL_SLOW | AM33XX_PULL_ENBL | AM33XX_INPUT_EN}, {"spi0_cs0.i2c1_scl", OMAP_MUX_MODE2 | AM33XX_SLEWCTRL_SLOW | AM33XX_PULL_ENBL | AM33XX_INPUT_EN}, {NULL, 0}, }; |
3fd0e971c AM335X: NAND: NAN... |
496 |
|
a83ee205d arm:omap:am33xx: ... |
497 498 499 500 501 502 503 504 505 |
/* Module pin mux for mcasp1 */ static struct pinmux_config mcasp1_pin_mux[] = { {"mii1_crs.mcasp1_aclkx", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_rxerr.mcasp1_fsx", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN}, {"mii1_col.mcasp1_axr2", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN}, {"rmii1_refclk.mcasp1_axr3", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN}, {NULL, 0}, }; |
9ba3872ab arm:omap:am33xx: ... |
506 507 508 509 510 511 512 513 514 |
/* Module pin mux for mmc0 */ static struct pinmux_config mmc0_pin_mux[] = { {"mmc0_dat3.mmc0_dat3", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mmc0_dat2.mmc0_dat2", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mmc0_dat1.mmc0_dat1", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mmc0_dat0.mmc0_dat0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mmc0_clk.mmc0_clk", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mmc0_cmd.mmc0_cmd", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, |
f80ad5875 ARM:omaP:am33xx; ... |
515 516 |
{"mcasp0_aclkr.mmc0_sdwp", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP}, {"spi0_cs1.mmc0_sdcd", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP}, |
9ba3872ab arm:omap:am33xx: ... |
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 |
{NULL, 0}, }; static struct pinmux_config mmc0_no_cd_pin_mux[] = { {"mmc0_dat3.mmc0_dat3", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mmc0_dat2.mmc0_dat2", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mmc0_dat1.mmc0_dat1", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mmc0_dat0.mmc0_dat0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mmc0_clk.mmc0_clk", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mmc0_cmd.mmc0_cmd", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"mcasp0_aclkr.mmc0_sdwp", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN}, {NULL, 0}, }; /* Module pin mux for mmc1 */ static struct pinmux_config mmc1_pin_mux[] = { {"gpmc_ad7.mmc1_dat7", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad6.mmc1_dat6", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad5.mmc1_dat5", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad4.mmc1_dat4", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad3.mmc1_dat3", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad2.mmc1_dat2", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad1.mmc1_dat1", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ad0.mmc1_dat0", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_csn1.mmc1_clk", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_csn2.mmc1_cmd", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP}, |
f375e5d52 ARM: OMAP: AM335x... |
543 544 |
{"gpmc_csn0.mmc1_sdwp", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_advn_ale.mmc1_sdcd", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP}, |
9ba3872ab arm:omap:am33xx: ... |
545 546 |
{NULL, 0}, }; |
06b9f00bc arm:omap:am33xx: ... |
547 548 549 550 551 552 |
/* Module pin mux for uart3 */ static struct pinmux_config uart3_pin_mux[] = { {"spi0_cs1.uart3_rxd", AM33XX_PIN_INPUT_PULLUP}, {"ecap0_in_pwm0_out.uart3_txd", AM33XX_PULL_ENBL}, {NULL, 0}, }; |
416aa8d89 can: d_can: am335... |
553 554 555 556 557 558 559 560 561 562 563 |
static struct pinmux_config d_can_gp_pin_mux[] = { {"uart0_ctsn.d_can1_tx", OMAP_MUX_MODE2 | AM33XX_PULL_ENBL}, {"uart0_rtsn.d_can1_rx", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP}, {NULL, 0}, }; static struct pinmux_config d_can_ia_pin_mux[] = { {"uart0_rxd.d_can0_tx", OMAP_MUX_MODE2 | AM33XX_PULL_ENBL}, {"uart0_txd.d_can0_rx", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP}, {NULL, 0}, }; |
94082f358 arm:omap:am335x -... |
564 565 566 567 568 569 570 571 572 |
/* Module pin mux for uart2 */ static struct pinmux_config uart2_pin_mux[] = { {"spi0_sclk.uart2_rxd", OMAP_MUX_MODE1 | AM33XX_SLEWCTRL_SLOW | AM33XX_PIN_INPUT_PULLUP}, {"spi0_d0.uart2_txd", OMAP_MUX_MODE1 | AM33XX_PULL_UP | AM33XX_PULL_DISA | AM33XX_SLEWCTRL_SLOW}, {NULL, 0}, }; |
609691c19 ARM:omap:am33xx: ... |
573 574 575 576 577 578 579 580 581 582 583 584 |
/* * @pin_mux - single module pin-mux structure which defines pin-mux * details for all its pins. */ static void setup_pin_mux(struct pinmux_config *pin_mux) { int i; for (i = 0; pin_mux->string_name != NULL; pin_mux++) omap_mux_init_signal(pin_mux->string_name, pin_mux->val); } |
5edc297a6 AM335XEVM: Matrix... |
585 |
/* Matrix GPIO Keypad Support for profile-0 only: TODO */ |
5edc297a6 AM335XEVM: Matrix... |
586 587 588 589 |
/* pinmux for keypad device */ static struct pinmux_config matrix_keypad_pin_mux[] = { {"gpmc_a5.gpio1_21", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, |
99fb0d852 arm:omap:am33xx: ... |
590 |
{"gpmc_a6.gpio1_22", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, |
5edc297a6 AM335XEVM: Matrix... |
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 |
{"gpmc_a9.gpio1_25", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, {"gpmc_a10.gpio1_26", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, {"gpmc_a11.gpio1_27", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, {NULL, 0}, }; /* Keys mapping */ static const uint32_t am335x_evm_matrix_keys[] = { KEY(0, 0, KEY_MENU), KEY(1, 0, KEY_BACK), KEY(2, 0, KEY_LEFT), KEY(0, 1, KEY_RIGHT), KEY(1, 1, KEY_ENTER), KEY(2, 1, KEY_DOWN), }; const struct matrix_keymap_data am335x_evm_keymap_data = { .keymap = am335x_evm_matrix_keys, .keymap_size = ARRAY_SIZE(am335x_evm_matrix_keys), }; static const unsigned int am335x_evm_keypad_row_gpios[] = { GPIO_TO_PIN(1, 25), GPIO_TO_PIN(1, 26), GPIO_TO_PIN(1, 27) }; static const unsigned int am335x_evm_keypad_col_gpios[] = { |
008890328 arm:omap:am335x: ... |
618 |
GPIO_TO_PIN(1, 21), GPIO_TO_PIN(1, 22) |
5edc297a6 AM335XEVM: Matrix... |
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 |
}; static struct matrix_keypad_platform_data am335x_evm_keypad_platform_data = { .keymap_data = &am335x_evm_keymap_data, .row_gpios = am335x_evm_keypad_row_gpios, .num_row_gpios = ARRAY_SIZE(am335x_evm_keypad_row_gpios), .col_gpios = am335x_evm_keypad_col_gpios, .num_col_gpios = ARRAY_SIZE(am335x_evm_keypad_col_gpios), .active_low = false, .debounce_ms = 5, .col_scan_delay_us = 2, }; static struct platform_device am335x_evm_keyboard = { .name = "matrix-keypad", .id = -1, .dev = { .platform_data = &am335x_evm_keypad_platform_data, }, }; static void matrix_keypad_init(int evm_id, int profile) { int err; setup_pin_mux(matrix_keypad_pin_mux); err = platform_device_register(&am335x_evm_keyboard); if (err) { pr_err("failed to register matrix keypad (2x3) device "); } } |
18c89c1a1 AM335XEVM: Volume... |
651 |
|
18c89c1a1 AM335XEVM: Volume... |
652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 |
/* pinmux for keypad device */ static struct pinmux_config volume_keys_pin_mux[] = { {"spi0_sclk.gpio0_2", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, {"spi0_d0.gpio0_3", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, {NULL, 0}, }; /* Configure GPIOs for Volume Keys */ static struct gpio_keys_button am335x_evm_volume_gpio_buttons[] = { { .code = KEY_VOLUMEUP, .gpio = GPIO_TO_PIN(0, 2), .active_low = true, .desc = "volume-up", .type = EV_KEY, .wakeup = 1, }, { .code = KEY_VOLUMEDOWN, .gpio = GPIO_TO_PIN(0, 3), .active_low = true, .desc = "volume-down", .type = EV_KEY, .wakeup = 1, }, }; static struct gpio_keys_platform_data am335x_evm_volume_gpio_key_info = { .buttons = am335x_evm_volume_gpio_buttons, .nbuttons = ARRAY_SIZE(am335x_evm_volume_gpio_buttons), }; static struct platform_device am335x_evm_volume_keys = { .name = "gpio-keys", .id = -1, .dev = { .platform_data = &am335x_evm_volume_gpio_key_info, }, }; static void volume_keys_init(int evm_id, int profile) { int err; setup_pin_mux(volume_keys_pin_mux); err = platform_device_register(&am335x_evm_volume_keys); if (err) pr_err("failed to register matrix keypad (2x3) device "); } |
18c89c1a1 AM335XEVM: Volume... |
702 |
|
609691c19 ARM:omap:am33xx: ... |
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 |
/* * @evm_id - evm id which needs to be configured * @dev_cfg - single evm structure which includes * all module inits, pin-mux defines * @profile - if present, else PROFILE_NONE * @dghtr_brd_flg - Whether Daughter board is present or not */ static void _configure_device(int evm_id, struct evm_dev_cfg *dev_cfg, int profile) { int i; /* * Only General Purpose & Industrial Auto Motro Control * EVM has profiles. So check if this evm has profile. * If not, ignore the profile comparison */ /* * If the device is on baseboard, directly configure it. Else (device on * Daughter board), check if the daughter card is detected. */ if (profile == PROFILE_NONE) { for (i = 0; dev_cfg->device_init != NULL; dev_cfg++) { if (dev_cfg->device_on == DEV_ON_BASEBOARD) dev_cfg->device_init(evm_id, profile); else if (daughter_brd_detected == true) dev_cfg->device_init(evm_id, profile); } } else { for (i = 0; dev_cfg->device_init != NULL; dev_cfg++) { if (dev_cfg->profile & profile) { if (dev_cfg->device_on == DEV_ON_BASEBOARD) dev_cfg->device_init(evm_id, profile); else if (daughter_brd_detected == true) dev_cfg->device_init(evm_id, profile); } } } } |
6de8f7503 ARM:omap:am33xx: ... |
743 |
#define AM335X_LCD_BL_PIN GPIO_TO_PIN(0, 7) |
eb3dad1ce am335x: add musb ... |
744 745 746 747 748 749 750 751 752 753 754 |
/* pinmux for usb0 drvvbus */ static struct pinmux_config usb0_pin_mux[] = { {"usb0_drvvbus.usb0_drvvbus", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {NULL, 0}, }; /* pinmux for usb1 drvvbus */ static struct pinmux_config usb1_pin_mux[] = { {"usb1_drvvbus.usb1_drvvbus", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {NULL, 0}, }; |
cf20e3c5a ARM:OMAP:AM33XX: ... |
755 756 757 758 759 760 761 |
/* pinmux for profibus */ static struct pinmux_config profibus_pin_mux[] = { {"uart1_rxd.pr1_uart0_rxd_mux1", OMAP_MUX_MODE5 | AM33XX_PIN_INPUT}, {"uart1_txd.pr1_uart0_txd_mux1", OMAP_MUX_MODE5 | AM33XX_PIN_OUTPUT}, {"mcasp0_fsr.pr1_pru0_pru_r30_5", OMAP_MUX_MODE5 | AM33XX_PIN_OUTPUT}, {NULL, 0}, }; |
6de8f7503 ARM:omap:am33xx: ... |
762 763 764 765 766 |
/* Module pin mux for eCAP0 */ static struct pinmux_config ecap0_pin_mux[] = { {"ecap0_in_pwm0_out.gpio0_7", AM33XX_PIN_OUTPUT}, {NULL, 0}, }; |
9d01c45e9 board-am335xevm: ... |
767 |
#define AM335XEVM_WLAN_IRQ_GPIO GPIO_TO_PIN(3, 17) |
9d01c45e9 board-am335xevm: ... |
768 |
|
ff56fdbc6 arm:omap:am33xx:F... |
769 |
struct wl12xx_platform_data am335xevm_wlan_data = { |
9d01c45e9 board-am335xevm: ... |
770 |
.irq = OMAP_GPIO_IRQ(AM335XEVM_WLAN_IRQ_GPIO), |
26920977c board-am335xevm: ... |
771 |
.board_ref_clock = WL12XX_REFCLOCK_38_XTAL, /* 38.4Mhz */ |
9d01c45e9 board-am335xevm: ... |
772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 |
}; /* Module pin mux for wlan and bluetooth */ static struct pinmux_config mmc2_wl12xx_pin_mux[] = { {"gpmc_a1.mmc2_dat0", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_a2.mmc2_dat1", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_a3.mmc2_dat2", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_ben1.mmc2_dat3", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_csn3.mmc2_cmd", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP}, {"gpmc_clk.mmc2_clk", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP}, {NULL, 0}, }; static struct pinmux_config uart1_wl12xx_pin_mux[] = { {"uart1_ctsn.uart1_ctsn", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {"uart1_rtsn.uart1_rtsn", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT}, {"uart1_rxd.uart1_rxd", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP}, {"uart1_txd.uart1_txd", OMAP_MUX_MODE0 | AM33XX_PULL_ENBL}, {NULL, 0}, }; |
a7cb0a4c2 am335x-evm: wl12x... |
792 793 794 |
static struct pinmux_config wl12xx_pin_mux_evm_rev1_1a[] = { {"gpmc_a0.gpio1_16", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, {"mcasp0_ahclkr.gpio3_17", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, |
12ad41c22 am335x-evm: beta ... |
795 |
{"mcasp0_ahclkx.gpio3_21", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, |
a7cb0a4c2 am335x-evm: wl12x... |
796 797 798 799 |
{NULL, 0}, }; static struct pinmux_config wl12xx_pin_mux_evm_rev1_0[] = { |
9d01c45e9 board-am335xevm: ... |
800 801 802 803 804 |
{"gpmc_csn1.gpio1_30", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, {"mcasp0_ahclkr.gpio3_17", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, {"gpmc_csn2.gpio1_31", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, {NULL, 0}, }; |
d88fde8d0 AM335x: Backlight... |
805 806 807 |
static int backlight_enable = false; static void enable_ecap0(int evm_id, int profile) |
6de8f7503 ARM:omap:am33xx: ... |
808 |
{ |
d88fde8d0 AM335x: Backlight... |
809 810 |
backlight_enable = true; } |
6de8f7503 ARM:omap:am33xx: ... |
811 |
|
d88fde8d0 AM335x: Backlight... |
812 813 814 |
static int __init ecap0_init(void) { int status = 0; |
6de8f7503 ARM:omap:am33xx: ... |
815 |
|
d88fde8d0 AM335x: Backlight... |
816 817 |
if (backlight_enable) { setup_pin_mux(ecap0_pin_mux); |
6de8f7503 ARM:omap:am33xx: ... |
818 |
|
d88fde8d0 AM335x: Backlight... |
819 820 821 822 823 824 825 826 827 |
status = gpio_request(AM335X_LCD_BL_PIN, "lcd bl "); if (status < 0) pr_warn("Failed to request gpio for LCD backlight "); gpio_direction_output(AM335X_LCD_BL_PIN, 1); } return status; |
6de8f7503 ARM:omap:am33xx: ... |
828 |
} |
d88fde8d0 AM335x: Backlight... |
829 |
late_initcall(ecap0_init); |
6de8f7503 ARM:omap:am33xx: ... |
830 |
|
b2471dff7 AM335X: Enable LC... |
831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 |
static int __init conf_disp_pll(int rate) { struct clk *disp_pll; int ret = -EINVAL; disp_pll = clk_get(NULL, "dpll_disp_ck"); if (IS_ERR(disp_pll)) { pr_err("Cannot clk_get disp_pll "); goto out; } ret = clk_set_rate(disp_pll, rate); clk_put(disp_pll); out: return ret; } static void lcdc_init(int evm_id, int profile) { setup_pin_mux(lcdc_pin_mux); if (conf_disp_pll(300000000)) { pr_info("Failed configure display PLL, not attempting to" "register LCDC "); return; } if (am33xx_register_lcdc(&TFC_S9700RTWV35TR_01B_pdata)) pr_info("Failed to register LCDC device "); return; } |
1da3d8fa1 arm:omap:am33xx: ... |
866 867 868 |
static void tsc_init(int evm_id, int profile) { int err; |
7aec251bf AM335x: Add suppo... |
869 870 871 872 873 874 875 876 877 878 |
if (gp_evm_revision == GP_EVM_REV_IS_1_1A) { am335x_touchscreen_data.analog_input = 1; pr_info("TSC connected to beta GP EVM "); } else { am335x_touchscreen_data.analog_input = 0; pr_info("TSC connected to alpha GP EVM "); } |
1da3d8fa1 arm:omap:am33xx: ... |
879 880 881 882 883 884 |
setup_pin_mux(tsc_pin_mux); err = platform_device_register(&tsc_device); if (err) pr_err("failed to register touchscreen device "); } |
2b2bcf286 AM335X: CPSW pinm... |
885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 |
static void rgmii1_init(int evm_id, int profile) { setup_pin_mux(rgmii1_pin_mux); return; } static void rgmii2_init(int evm_id, int profile) { setup_pin_mux(rgmii2_pin_mux); return; } static void mii1_init(int evm_id, int profile) { setup_pin_mux(mii1_pin_mux); return; } |
b2471dff7 AM335X: Enable LC... |
902 |
|
f1e12bb92 arm:omap:am33xx: ... |
903 904 905 906 907 |
static void rmii1_init(int evm_id, int profile) { setup_pin_mux(rmii1_pin_mux); return; } |
eb3dad1ce am335x: add musb ... |
908 909 910 911 912 913 914 915 916 917 918 |
static void usb0_init(int evm_id, int profile) { setup_pin_mux(usb0_pin_mux); return; } static void usb1_init(int evm_id, int profile) { setup_pin_mux(usb1_pin_mux); return; } |
06b9f00bc arm:omap:am33xx: ... |
919 920 921 922 923 924 |
/* setup uart3 */ static void uart3_init(int evm_id, int profile) { setup_pin_mux(uart3_pin_mux); return; } |
94082f358 arm:omap:am335x -... |
925 926 927 928 929 930 |
/* setup uart2 */ static void uart2_init(int evm_id, int profile) { setup_pin_mux(uart2_pin_mux); return; } |
3fd0e971c AM335X: NAND: NAN... |
931 932 933 934 |
/* NAND partition information */ static struct mtd_partition am335x_nand_partitions[] = { /* All the partition sizes are listed in terms of NAND block size */ { |
d69e113a9 arm:omap:am335x: ... |
935 936 937 |
.name = "SPL", .offset = 0, /* Offset = 0x0 */ .size = SZ_128K, |
d69e113a9 arm:omap:am335x: ... |
938 939 940 941 942 |
}, { .name = "SPL.backup1", .offset = MTDPART_OFS_APPEND, /* Offset = 0x20000 */ .size = SZ_128K, |
d69e113a9 arm:omap:am335x: ... |
943 944 945 946 947 |
}, { .name = "SPL.backup2", .offset = MTDPART_OFS_APPEND, /* Offset = 0x40000 */ .size = SZ_128K, |
d69e113a9 arm:omap:am335x: ... |
948 949 950 951 952 |
}, { .name = "SPL.backup3", .offset = MTDPART_OFS_APPEND, /* Offset = 0x60000 */ .size = SZ_128K, |
3fd0e971c AM335X: NAND: NAN... |
953 954 955 |
}, { .name = "U-Boot", |
d69e113a9 arm:omap:am335x: ... |
956 957 |
.offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ .size = 15 * SZ_128K, |
3fd0e971c AM335X: NAND: NAN... |
958 959 960 |
}, { .name = "U-Boot Env", |
d69e113a9 arm:omap:am335x: ... |
961 |
.offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */ |
3fd0e971c AM335X: NAND: NAN... |
962 963 964 965 |
.size = 1 * SZ_128K, }, { .name = "Kernel", |
d69e113a9 arm:omap:am335x: ... |
966 967 |
.offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */ .size = 40 * SZ_128K, |
3fd0e971c AM335X: NAND: NAN... |
968 969 970 |
}, { .name = "File System", |
d69e113a9 arm:omap:am335x: ... |
971 |
.offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */ |
3fd0e971c AM335X: NAND: NAN... |
972 973 974 |
.size = MTDPART_SIZ_FULL, }, }; |
636a1595c AM335x: SPI devic... |
975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 |
/* SPI 0/1 Platform Data */ /* SPI flash information */ static struct mtd_partition am335x_spi_partitions[] = { /* All the partition sizes are listed in terms of erase size */ { .name = "U-Boot-min", .offset = 0, .size = SZ_128K, .mask_flags = MTD_WRITEABLE, /* force read-only */ }, { .name = "U-Boot", .offset = MTDPART_OFS_APPEND, .size = 2 * SZ_128K, .mask_flags = MTD_WRITEABLE, /* force read-only */ }, { .name = "U-Boot Env", .offset = MTDPART_OFS_APPEND, .size = 2 * SZ_4K, }, { .name = "Kernel", .offset = MTDPART_OFS_APPEND, |
e5f3cf5b9 arm:omap:am33xx -... |
999 |
.size = 28 * SZ_128K, |
636a1595c AM335x: SPI devic... |
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 |
}, { .name = "File System", .offset = MTDPART_OFS_APPEND, .size = MTDPART_SIZ_FULL, /* size ~= 1.1 MiB */ } }; static const struct flash_platform_data am335x_spi_flash = { .type = "w25q64", .name = "spi_flash", .parts = am335x_spi_partitions, .nr_parts = ARRAY_SIZE(am335x_spi_partitions), }; /* * SPI Flash works at 80Mhz however SPI Controller works at 48MHz. * So setup Max speed to be less than that of Controller speed */ static struct spi_board_info am335x_spi0_slave_info[] = { { .modalias = "m25p80", .platform_data = &am335x_spi_flash, .irq = -1, |
4068883a3 arm:omap:am33xx -... |
1024 |
.max_speed_hz = 24000000, |
636a1595c AM335x: SPI devic... |
1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 |
.bus_num = 1, .chip_select = 0, }, }; static struct spi_board_info am335x_spi1_slave_info[] = { { .modalias = "m25p80", .platform_data = &am335x_spi_flash, .irq = -1, .max_speed_hz = 12000000, .bus_num = 2, .chip_select = 0, }, }; |
3fd0e971c AM335X: NAND: NAN... |
1040 1041 1042 1043 1044 1045 |
static void evm_nand_init(int evm_id, int profile) { setup_pin_mux(nand_pin_mux); board_nand_init(am335x_nand_partitions, ARRAY_SIZE(am335x_nand_partitions), 0, 0); } |
e2f95aab9 am335x: lis33ldlh... |
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 |
static struct lis3lv02d_platform_data lis331dlh_pdata = { .click_flags = LIS3_CLICK_SINGLE_X | LIS3_CLICK_SINGLE_Y | LIS3_CLICK_SINGLE_Z, .wakeup_flags = LIS3_WAKEUP_X_LO | LIS3_WAKEUP_X_HI | LIS3_WAKEUP_Y_LO | LIS3_WAKEUP_Y_HI | LIS3_WAKEUP_Z_LO | LIS3_WAKEUP_Z_HI, .irq_cfg = LIS3_IRQ1_CLICK | LIS3_IRQ2_CLICK, .wakeup_thresh = 10, .click_thresh_x = 10, .click_thresh_y = 10, .click_thresh_z = 10, .g_range = 2, .st_min_limits[0] = 120, .st_min_limits[1] = 120, .st_min_limits[2] = 140, .st_max_limits[0] = 550, .st_max_limits[1] = 550, .st_max_limits[2] = 750, }; |
ff56fdbc6 arm:omap:am33xx:F... |
1066 |
static struct i2c_board_info am335x_i2c_boardinfo1[] = { |
b5c4f8f49 arm:omap:am33xx: ... |
1067 |
{ |
a83ee205d arm:omap:am33xx: ... |
1068 |
I2C_BOARD_INFO("tlv320aic3x", 0x1b), |
ff56fdbc6 arm:omap:am33xx:F... |
1069 |
}, |
e2f95aab9 am335x: lis33ldlh... |
1070 1071 1072 1073 |
{ I2C_BOARD_INFO("lis331dlh", 0x18), .platform_data = &lis331dlh_pdata, }, |
8ba5b2f8e am335x: tmp275: A... |
1074 |
{ |
be0ad0697 am335x: tsl2550: ... |
1075 1076 1077 |
I2C_BOARD_INFO("tsl2550", 0x39), }, { |
8ba5b2f8e am335x: tmp275: A... |
1078 1079 |
I2C_BOARD_INFO("tmp275", 0x48), }, |
b5c4f8f49 arm:omap:am33xx: ... |
1080 1081 1082 1083 1084 1085 1086 1087 1088 |
}; static void i2c1_init(int evm_id, int profile) { setup_pin_mux(i2c1_pin_mux); omap_register_i2c_bus(2, 100, am335x_i2c_boardinfo1, ARRAY_SIZE(am335x_i2c_boardinfo1)); return; } |
a83ee205d arm:omap:am33xx: ... |
1089 1090 1091 1092 1093 1094 1095 1096 |
/* Setup McASP 1 */ static void mcasp1_init(int evm_id, int profile) { /* Configure McASP */ setup_pin_mux(mcasp1_pin_mux); am335x_register_mcasp1(&am335x_evm_snd_data1); return; } |
9ba3872ab arm:omap:am33xx: ... |
1097 1098 1099 1100 1101 1102 |
static void mmc1_init(int evm_id, int profile) { setup_pin_mux(mmc1_pin_mux); am335x_mmc[1].mmc = 2; am335x_mmc[1].caps = MMC_CAP_4_BIT_DATA; |
998350632 arm:omap:am335x: ... |
1103 1104 |
am335x_mmc[1].gpio_cd = GPIO_TO_PIN(2, 2); am335x_mmc[1].gpio_wp = GPIO_TO_PIN(1, 29); |
9ba3872ab arm:omap:am33xx: ... |
1105 1106 1107 1108 1109 |
am335x_mmc[1].ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34; /* 3V3 */ /* mmc will be initialized when mmc0_init is called */ return; } |
9d01c45e9 board-am335xevm: ... |
1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 |
static void mmc2_wl12xx_init(int evm_id, int profile) { setup_pin_mux(mmc2_wl12xx_pin_mux); am335x_mmc[1].mmc = 3; am335x_mmc[1].name = "wl1271"; am335x_mmc[1].caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD | MMC_PM_KEEP_POWER; am335x_mmc[1].nonremovable = true; am335x_mmc[1].gpio_cd = -EINVAL; am335x_mmc[1].gpio_wp = -EINVAL; am335x_mmc[1].ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34; /* 3V3 */ /* mmc will be initialized when mmc0_init is called */ return; } static void uart1_wl12xx_init(int evm_id, int profile) { setup_pin_mux(uart1_wl12xx_pin_mux); } static void wl12xx_bluetooth_enable(void) { |
a7cb0a4c2 am335x-evm: wl12x... |
1134 1135 1136 |
int status = gpio_request(am335xevm_wlan_data.bt_enable_gpio, "bt_en "); |
9d01c45e9 board-am335xevm: ... |
1137 1138 |
if (status < 0) pr_err("Failed to request gpio for bt_enable"); |
26920977c board-am335xevm: ... |
1139 1140 |
pr_info("Configure Bluetooth Enable pin... "); |
a7cb0a4c2 am335x-evm: wl12x... |
1141 |
gpio_direction_output(am335xevm_wlan_data.bt_enable_gpio, 0); |
9d01c45e9 board-am335xevm: ... |
1142 1143 1144 1145 |
} static int wl12xx_set_power(struct device *dev, int slot, int on, int vdd) { |
12ad41c22 am335x-evm: beta ... |
1146 |
if (on) { |
a7cb0a4c2 am335x-evm: wl12x... |
1147 |
gpio_set_value(am335xevm_wlan_data.wlan_enable_gpio, 1); |
12ad41c22 am335x-evm: beta ... |
1148 1149 |
mdelay(70); } |
9d01c45e9 board-am335xevm: ... |
1150 |
else |
a7cb0a4c2 am335x-evm: wl12x... |
1151 |
gpio_set_value(am335xevm_wlan_data.wlan_enable_gpio, 0); |
9d01c45e9 board-am335xevm: ... |
1152 1153 1154 1155 1156 1157 1158 1159 1160 |
return 0; } static void wl12xx_init(int evm_id, int profile) { struct device *dev; struct omap_mmc_platform_data *pdata; int ret; |
a7cb0a4c2 am335x-evm: wl12x... |
1161 1162 1163 |
/* Register WLAN and BT enable pins based on the evm board revision */ if (gp_evm_revision == GP_EVM_REV_IS_1_1A) { am335xevm_wlan_data.wlan_enable_gpio = GPIO_TO_PIN(1, 16); |
12ad41c22 am335x-evm: beta ... |
1164 |
am335xevm_wlan_data.bt_enable_gpio = GPIO_TO_PIN(3, 21); |
a7cb0a4c2 am335x-evm: wl12x... |
1165 1166 1167 1168 1169 |
} else { am335xevm_wlan_data.wlan_enable_gpio = GPIO_TO_PIN(1, 30); am335xevm_wlan_data.bt_enable_gpio = GPIO_TO_PIN(1, 31); } |
9d01c45e9 board-am335xevm: ... |
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 |
wl12xx_bluetooth_enable(); if (wl12xx_set_platform_data(&am335xevm_wlan_data)) pr_err("error setting wl12xx data "); dev = am335x_mmc[1].dev; if (!dev) { pr_err("wl12xx mmc device initialization failed "); goto out; } pdata = dev->platform_data; if (!pdata) { pr_err("Platfrom data of wl12xx device not set "); goto out; } |
a7cb0a4c2 am335x-evm: wl12x... |
1189 1190 |
ret = gpio_request_one(am335xevm_wlan_data.wlan_enable_gpio, GPIOF_OUT_INIT_LOW, "wlan_en"); |
9d01c45e9 board-am335xevm: ... |
1191 1192 1193 1194 1195 |
if (ret) { pr_err("Error requesting wlan enable gpio: %d ", ret); goto out; } |
a7cb0a4c2 am335x-evm: wl12x... |
1196 1197 1198 1199 |
if (gp_evm_revision == GP_EVM_REV_IS_1_1A) setup_pin_mux(wl12xx_pin_mux_evm_rev1_1a); else setup_pin_mux(wl12xx_pin_mux_evm_rev1_0); |
9d01c45e9 board-am335xevm: ... |
1200 1201 1202 1203 1204 |
pdata->slots[0].set_power = wl12xx_set_power; out: return; } |
416aa8d89 can: d_can: am335... |
1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 |
static void d_can_init(int evm_id, int profile) { switch (evm_id) { case IND_AUT_MTR_EVM: if ((profile == PROFILE_0) || (profile == PROFILE_1)) { setup_pin_mux(d_can_ia_pin_mux); /* Instance Zero */ am33xx_d_can_init(0); } break; case GEN_PURP_EVM: if (profile == PROFILE_1) { setup_pin_mux(d_can_gp_pin_mux); /* Instance One */ am33xx_d_can_init(1); } break; default: break; } } |
9ba3872ab arm:omap:am33xx: ... |
1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 |
static void mmc0_init(int evm_id, int profile) { setup_pin_mux(mmc0_pin_mux); omap2_hsmmc_init(am335x_mmc); return; } static void mmc0_no_cd_init(int evm_id, int profile) { setup_pin_mux(mmc0_no_cd_pin_mux); omap2_hsmmc_init(am335x_mmc); return; } |
636a1595c AM335x: SPI devic... |
1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 |
/* setup spi0 */ static void spi0_init(int evm_id, int profile) { setup_pin_mux(spi0_pin_mux); spi_register_board_info(am335x_spi0_slave_info, ARRAY_SIZE(am335x_spi0_slave_info)); return; } /* setup spi1 */ static void spi1_init(int evm_id, int profile) { setup_pin_mux(spi1_pin_mux); spi_register_board_info(am335x_spi1_slave_info, ARRAY_SIZE(am335x_spi1_slave_info)); return; } |
72e9d5232 ARM:omap:am335x: ... |
1258 1259 1260 1261 1262 1263 1264 1265 |
static int beaglebone_phy_fixup(struct phy_device *phydev) { phydev->supported &= ~(SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full); return 0; } |
17bd4260b arm:omap:am33xx: ... |
1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 |
#ifdef CONFIG_TLK110_WORKAROUND static int am335x_tlk110_phy_fixup(struct phy_device *phydev) { unsigned int val; /* This is done as a workaround to support TLK110 rev1.0 phy */ val = phy_read(phydev, TLK110_COARSEGAIN_REG); phy_write(phydev, TLK110_COARSEGAIN_REG, (val | TLK110_COARSEGAIN_VAL)); val = phy_read(phydev, TLK110_LPFHPF_REG); phy_write(phydev, TLK110_LPFHPF_REG, (val | TLK110_LPFHPF_VAL)); val = phy_read(phydev, TLK110_SPAREANALOG_REG); phy_write(phydev, TLK110_SPAREANALOG_REG, (val | TLK110_SPANALOG_VAL)); val = phy_read(phydev, TLK110_VRCR_REG); phy_write(phydev, TLK110_VRCR_REG, (val | TLK110_VRCR_VAL)); val = phy_read(phydev, TLK110_SETFFE_REG); phy_write(phydev, TLK110_SETFFE_REG, (val | TLK110_SETFFE_VAL)); val = phy_read(phydev, TLK110_FTSP_REG); phy_write(phydev, TLK110_FTSP_REG, (val | TLK110_FTSP_VAL)); val = phy_read(phydev, TLK110_ALFATPIDL_REG); phy_write(phydev, TLK110_ALFATPIDL_REG, (val | TLK110_ALFATPIDL_VAL)); val = phy_read(phydev, TLK110_PSCOEF21_REG); phy_write(phydev, TLK110_PSCOEF21_REG, (val | TLK110_PSCOEF21_VAL)); val = phy_read(phydev, TLK110_PSCOEF3_REG); phy_write(phydev, TLK110_PSCOEF3_REG, (val | TLK110_PSCOEF3_VAL)); val = phy_read(phydev, TLK110_ALFAFACTOR1_REG); phy_write(phydev, TLK110_ALFAFACTOR1_REG, (val | TLK110_ALFACTOR1_VAL)); val = phy_read(phydev, TLK110_ALFAFACTOR2_REG); phy_write(phydev, TLK110_ALFAFACTOR2_REG, (val | TLK110_ALFACTOR2_VAL)); val = phy_read(phydev, TLK110_CFGPS_REG); phy_write(phydev, TLK110_CFGPS_REG, (val | TLK110_CFGPS_VAL)); val = phy_read(phydev, TLK110_FTSPTXGAIN_REG); phy_write(phydev, TLK110_FTSPTXGAIN_REG, (val | TLK110_FTSPTXGAIN_VAL)); val = phy_read(phydev, TLK110_SWSCR3_REG); phy_write(phydev, TLK110_SWSCR3_REG, (val | TLK110_SWSCR3_VAL)); val = phy_read(phydev, TLK110_SCFALLBACK_REG); phy_write(phydev, TLK110_SCFALLBACK_REG, (val | TLK110_SCFALLBACK_VAL)); val = phy_read(phydev, TLK110_PHYRCR_REG); phy_write(phydev, TLK110_PHYRCR_REG, (val | TLK110_PHYRCR_VAL)); return 0; } #endif |
cf20e3c5a ARM:OMAP:AM33XX: ... |
1323 1324 1325 1326 1327 |
static void profibus_init(int evm_id, int profile) { setup_pin_mux(profibus_pin_mux); return; } |
17bd4260b arm:omap:am33xx: ... |
1328 |
|
609691c19 ARM:omap:am33xx: ... |
1329 1330 |
/* Low-Cost EVM */ static struct evm_dev_cfg low_cost_evm_dev_cfg[] = { |
2b2bcf286 AM335X: CPSW pinm... |
1331 |
{rgmii1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, |
eb3dad1ce am335x: add musb ... |
1332 1333 |
{usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, |
3fd0e971c AM335X: NAND: NAN... |
1334 |
{evm_nand_init, DEV_ON_BASEBOARD, PROFILE_NONE}, |
609691c19 ARM:omap:am33xx: ... |
1335 1336 1337 1338 1339 |
{NULL, 0, 0}, }; /* General Purpose EVM */ static struct evm_dev_cfg gen_purp_evm_dev_cfg[] = { |
d88fde8d0 AM335x: Backlight... |
1340 |
{enable_ecap0, DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 | |
6de8f7503 ARM:omap:am33xx: ... |
1341 |
PROFILE_2 | PROFILE_7) }, |
b2471dff7 AM335X: Enable LC... |
1342 1343 |
{lcdc_init, DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 | PROFILE_2 | PROFILE_7) }, |
1da3d8fa1 arm:omap:am33xx: ... |
1344 1345 |
{tsc_init, DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 | PROFILE_2 | PROFILE_7) }, |
2b2bcf286 AM335X: CPSW pinm... |
1346 1347 1348 |
{rgmii1_init, DEV_ON_BASEBOARD, PROFILE_ALL}, {rgmii2_init, DEV_ON_DGHTR_BRD, (PROFILE_1 | PROFILE_2 | PROFILE_4 | PROFILE_6) }, |
eb3dad1ce am335x: add musb ... |
1349 1350 |
{usb0_init, DEV_ON_BASEBOARD, PROFILE_ALL}, {usb1_init, DEV_ON_BASEBOARD, PROFILE_ALL}, |
3fd0e971c AM335X: NAND: NAN... |
1351 1352 |
{evm_nand_init, DEV_ON_DGHTR_BRD, (PROFILE_ALL & ~PROFILE_2 & ~PROFILE_3)}, |
e2f95aab9 am335x: lis33ldlh... |
1353 |
{i2c1_init, DEV_ON_DGHTR_BRD, (PROFILE_ALL & ~PROFILE_2)}, |
f375e5d52 ARM: OMAP: AM335x... |
1354 |
{mcasp1_init, DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_3 | PROFILE_7) }, |
9ba3872ab arm:omap:am33xx: ... |
1355 |
{mmc1_init, DEV_ON_DGHTR_BRD, PROFILE_2}, |
fba07502c arm:omap:am33xx: ... |
1356 |
{mmc2_wl12xx_init, DEV_ON_BASEBOARD, (PROFILE_0 | PROFILE_3 | |
2753ad8ee ARM:omap:am33xx: ... |
1357 |
PROFILE_5)}, |
9ba3872ab arm:omap:am33xx: ... |
1358 1359 |
{mmc0_init, DEV_ON_BASEBOARD, (PROFILE_ALL & ~PROFILE_5)}, {mmc0_no_cd_init, DEV_ON_BASEBOARD, PROFILE_5}, |
636a1595c AM335x: SPI devic... |
1360 |
{spi0_init, DEV_ON_DGHTR_BRD, PROFILE_2}, |
fba07502c arm:omap:am33xx: ... |
1361 |
{uart1_wl12xx_init, DEV_ON_BASEBOARD, (PROFILE_0 | PROFILE_3 | |
2753ad8ee ARM:omap:am33xx: ... |
1362 1363 |
PROFILE_5)}, {wl12xx_init, DEV_ON_BASEBOARD, (PROFILE_0 | PROFILE_3 | PROFILE_5)}, |
416aa8d89 can: d_can: am335... |
1364 |
{d_can_init, DEV_ON_DGHTR_BRD, PROFILE_1}, |
5edc297a6 AM335XEVM: Matrix... |
1365 |
{matrix_keypad_init, DEV_ON_DGHTR_BRD, PROFILE_0}, |
18c89c1a1 AM335XEVM: Volume... |
1366 |
{volume_keys_init, DEV_ON_DGHTR_BRD, PROFILE_0}, |
94082f358 arm:omap:am335x -... |
1367 |
{uart2_init, DEV_ON_DGHTR_BRD, PROFILE_3}, |
609691c19 ARM:omap:am33xx: ... |
1368 1369 1370 1371 1372 |
{NULL, 0, 0}, }; /* Industrial Auto Motor Control EVM */ static struct evm_dev_cfg ind_auto_mtrl_evm_dev_cfg[] = { |
2b2bcf286 AM335X: CPSW pinm... |
1373 |
{mii1_init, DEV_ON_DGHTR_BRD, PROFILE_ALL}, |
eb3dad1ce am335x: add musb ... |
1374 1375 |
{usb0_init, DEV_ON_BASEBOARD, PROFILE_ALL}, {usb1_init, DEV_ON_BASEBOARD, PROFILE_ALL}, |
cf20e3c5a ARM:OMAP:AM33XX: ... |
1376 |
{profibus_init, DEV_ON_DGHTR_BRD, PROFILE_ALL}, |
3fd0e971c AM335X: NAND: NAN... |
1377 |
{evm_nand_init, DEV_ON_DGHTR_BRD, PROFILE_ALL}, |
636a1595c AM335x: SPI devic... |
1378 |
{spi1_init, DEV_ON_DGHTR_BRD, PROFILE_ALL}, |
06b9f00bc arm:omap:am33xx: ... |
1379 |
{uart3_init, DEV_ON_DGHTR_BRD, PROFILE_ALL}, |
62704725a arm:omap:am33xx: ... |
1380 1381 |
{i2c1_init, DEV_ON_BASEBOARD, PROFILE_ALL}, {mmc0_no_cd_init, DEV_ON_BASEBOARD, PROFILE_ALL}, |
609691c19 ARM:omap:am33xx: ... |
1382 1383 1384 1385 1386 |
{NULL, 0, 0}, }; /* IP-Phone EVM */ static struct evm_dev_cfg ip_phn_evm_dev_cfg[] = { |
d88fde8d0 AM335x: Backlight... |
1387 |
{enable_ecap0, DEV_ON_DGHTR_BRD, PROFILE_NONE}, |
b2471dff7 AM335X: Enable LC... |
1388 |
{lcdc_init, DEV_ON_DGHTR_BRD, PROFILE_NONE}, |
1da3d8fa1 arm:omap:am33xx: ... |
1389 |
{tsc_init, DEV_ON_DGHTR_BRD, PROFILE_NONE}, |
2b2bcf286 AM335X: CPSW pinm... |
1390 1391 |
{rgmii1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {rgmii2_init, DEV_ON_DGHTR_BRD, PROFILE_NONE}, |
eb3dad1ce am335x: add musb ... |
1392 1393 |
{usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, |
3fd0e971c AM335X: NAND: NAN... |
1394 |
{evm_nand_init, DEV_ON_DGHTR_BRD, PROFILE_NONE}, |
b5c4f8f49 arm:omap:am33xx: ... |
1395 |
{i2c1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, |
a83ee205d arm:omap:am33xx: ... |
1396 |
{mcasp1_init, DEV_ON_DGHTR_BRD, PROFILE_NONE}, |
9ba3872ab arm:omap:am33xx: ... |
1397 |
{mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, |
609691c19 ARM:omap:am33xx: ... |
1398 1399 |
{NULL, 0, 0}, }; |
c8f997ab0 ARM:omap:am335x: ... |
1400 1401 |
/* Beaglebone < Rev A3 */ static struct evm_dev_cfg beaglebone_old_dev_cfg[] = { |
f1e12bb92 arm:omap:am33xx: ... |
1402 1403 1404 1405 |
{rmii1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, |
f1e12bb92 arm:omap:am33xx: ... |
1406 1407 |
{NULL, 0, 0}, }; |
c8f997ab0 ARM:omap:am335x: ... |
1408 1409 1410 1411 1412 1413 1414 1415 |
/* Beaglebone Rev A3 and after */ static struct evm_dev_cfg beaglebone_dev_cfg[] = { {mii1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {NULL, 0, 0}, }; |
609691c19 ARM:omap:am33xx: ... |
1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 |
static void setup_low_cost_evm(void) { pr_info("The board is a AM335x Low Cost EVM. "); _configure_device(LOW_COST_EVM, low_cost_evm_dev_cfg, PROFILE_NONE); } static void setup_general_purpose_evm(void) { u32 prof_sel = am335x_get_profile_selection(); |
609691c19 ARM:omap:am33xx: ... |
1427 1428 |
pr_info("The board is general purpose EVM in profile %d ", prof_sel); |
f375e5d52 ARM: OMAP: AM335x... |
1429 |
if (!strncmp("1.1A", config.version, 4)) { |
f375e5d52 ARM: OMAP: AM335x... |
1430 |
gp_evm_revision = GP_EVM_REV_IS_1_1A; |
c44f9ec7c ARM:omap:am33xx: ... |
1431 1432 |
} else if (!strncmp("1.0", config.version, 3)) { gp_evm_revision = GP_EVM_REV_IS_1_0; |
f375e5d52 ARM: OMAP: AM335x... |
1433 |
} else { |
0a9d7ad2d arm:omap:am33xx: ... |
1434 |
pr_err("Found invalid GP EVM revision, falling back to Rev1.1A"); |
f375e5d52 ARM: OMAP: AM335x... |
1435 1436 |
gp_evm_revision = GP_EVM_REV_IS_1_1A; } |
c44f9ec7c ARM:omap:am33xx: ... |
1437 |
if (gp_evm_revision == GP_EVM_REV_IS_1_0) |
dfb4c854f arm:omap:cpsw: En... |
1438 1439 1440 |
gigabit_enable = 0; else if (gp_evm_revision == GP_EVM_REV_IS_1_1A) gigabit_enable = 1; |
609691c19 ARM:omap:am33xx: ... |
1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 |
_configure_device(GEN_PURP_EVM, gen_purp_evm_dev_cfg, (1L << prof_sel)); } static void setup_ind_auto_motor_ctrl_evm(void) { u32 prof_sel = am335x_get_profile_selection(); pr_info("The board is an industrial automation EVM in profile %d ", prof_sel); /* Only Profile 0 is supported */ if ((1L << prof_sel) != PROFILE_0) { pr_err("AM335X: Only Profile 0 is supported "); pr_err("Assuming profile 0 & continuing "); prof_sel = PROFILE_0; } _configure_device(IND_AUT_MTR_EVM, ind_auto_mtrl_evm_dev_cfg, PROFILE_0); |
17bd4260b arm:omap:am33xx: ... |
1463 1464 1465 1466 1467 |
/* Fillup global evmid */ am33xx_evmid_fillup(IND_AUT_MTR_EVM); /* Initialize TLK110 PHY registers for phy version 1.0 */ am335x_tlk110_phy_init(); |
609691c19 ARM:omap:am33xx: ... |
1468 1469 1470 1471 1472 1473 1474 1475 1476 |
} static void setup_ip_phone_evm(void) { pr_info("The board is an IP phone EVM "); _configure_device(IP_PHN_EVM, ip_phn_evm_dev_cfg, PROFILE_NONE); } |
c8f997ab0 ARM:omap:am335x: ... |
1477 1478 |
/* BeagleBone < Rev A3 */ static void setup_beaglebone_old(void) |
f1e12bb92 arm:omap:am33xx: ... |
1479 |
{ |
c8f997ab0 ARM:omap:am335x: ... |
1480 1481 |
pr_info("The board is a AM335x Beaglebone < Rev A3. "); |
f1e12bb92 arm:omap:am33xx: ... |
1482 |
|
c8f997ab0 ARM:omap:am335x: ... |
1483 |
/* Beagle Bone has Micro-SD slot which doesn't have Write Protect pin */ |
49bf9b22b ARM:omap:am33xx: ... |
1484 |
am335x_mmc[0].gpio_wp = -EINVAL; |
c8f997ab0 ARM:omap:am335x: ... |
1485 |
_configure_device(LOW_COST_EVM, beaglebone_old_dev_cfg, PROFILE_NONE); |
72e9d5232 ARM:omap:am335x: ... |
1486 1487 1488 |
phy_register_fixup_for_uid(BBB_PHY_ID, BBB_PHY_MASK, beaglebone_phy_fixup); |
f1e12bb92 arm:omap:am33xx: ... |
1489 |
} |
c8f997ab0 ARM:omap:am335x: ... |
1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 |
/* BeagleBone after Rev A3 */ static void setup_beaglebone(void) { pr_info("The board is a AM335x Beaglebone. "); /* Beagle Bone has Micro-SD slot which doesn't have Write Protect pin */ am335x_mmc[0].gpio_wp = -EINVAL; _configure_device(LOW_COST_EVM, beaglebone_dev_cfg, PROFILE_NONE); } |
1ca8aed50 arm:omap:am33xx: ... |
1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 |
static void am335x_setup_daughter_board(struct memory_accessor *m, void *c) { u8 tmp; int ret; /* * try reading a byte from the EEPROM to see if it is * present. We could read a lot more, but that would * just slow the boot process and we have all the information * we need from the EEPROM on the base board anyway. */ ret = m->read(m, &tmp, 0, sizeof(u8)); if (ret == sizeof(u8)) { pr_info("Detected a daughter card on AM335x EVM.."); daughter_brd_detected = true; } else { pr_info("No daughter card found "); daughter_brd_detected = false; } } static void am335x_evm_setup(struct memory_accessor *mem_acc, void *context) { int ret; char tmp[10]; |
17bd4260b arm:omap:am33xx: ... |
1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 |
/* 1st get the MAC address from EEPROM */ ret = mem_acc->read(mem_acc, (char *)&am335x_mac_addr, EEPROM_MAC_ADDRESS_OFFSET, sizeof(am335x_mac_addr)); if (ret != sizeof(am335x_mac_addr)) { pr_warning("AM335X: EVM Config read fail: %d ", ret); return; } /* Fillup global mac id */ am33xx_cpsw_macidfillup(&am335x_mac_addr[0][0], &am335x_mac_addr[1][0]); |
1ca8aed50 arm:omap:am33xx: ... |
1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 |
/* get board specific data */ ret = mem_acc->read(mem_acc, (char *)&config, 0, sizeof(config)); if (ret != sizeof(config)) { pr_warning("AM335X EVM config read fail, read %d bytes ", ret); return; } if (config.header != AM335X_EEPROM_HEADER) { pr_warning("AM335X: wrong header 0x%x, expected 0x%x ", config.header, AM335X_EEPROM_HEADER); |
609691c19 ARM:omap:am33xx: ... |
1552 |
goto out; |
1ca8aed50 arm:omap:am33xx: ... |
1553 1554 1555 1556 1557 1558 |
} if (strncmp("A335", config.name, 4)) { pr_err("Board %s doesn't look like an AM335x board ", config.name); |
609691c19 ARM:omap:am33xx: ... |
1559 |
goto out; |
1ca8aed50 arm:omap:am33xx: ... |
1560 |
} |
c8f997ab0 ARM:omap:am335x: ... |
1561 |
snprintf(tmp, sizeof(config.name) + 1, "%s", config.name); |
1ca8aed50 arm:omap:am33xx: ... |
1562 1563 |
pr_info("Board name: %s ", tmp); |
c8f997ab0 ARM:omap:am335x: ... |
1564 1565 1566 |
snprintf(tmp, sizeof(config.version) + 1, "%s", config.version); pr_info("Board version: %s ", tmp); |
f1e12bb92 arm:omap:am33xx: ... |
1567 1568 |
if (!strncmp("A335BONE", config.name, 8)) { daughter_brd_detected = false; |
c8f997ab0 ARM:omap:am335x: ... |
1569 1570 1571 1572 1573 |
if(!strncmp("00A1", config.version, 4) || !strncmp("00A2", config.version, 4)) setup_beaglebone_old(); else setup_beaglebone(); |
f1e12bb92 arm:omap:am33xx: ... |
1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 |
} else { /* only 6 characters of options string used for now */ snprintf(tmp, 7, "%s", config.opt); pr_info("SKU: %s ", tmp); if (!strncmp("SKU#00", config.opt, 6)) setup_low_cost_evm(); else if (!strncmp("SKU#01", config.opt, 6)) setup_general_purpose_evm(); else if (!strncmp("SKU#02", config.opt, 6)) setup_ind_auto_motor_ctrl_evm(); else if (!strncmp("SKU#03", config.opt, 6)) setup_ip_phone_evm(); else goto out; } |
2b2bcf286 AM335X: CPSW pinm... |
1591 1592 1593 1594 |
/* Initialize cpsw after board detection is completed as board * information is required for configuring phy address and hence * should be call only after board detection */ |
dfb4c854f arm:omap:cpsw: En... |
1595 |
am33xx_cpsw_init(gigabit_enable); |
2b2bcf286 AM335X: CPSW pinm... |
1596 |
|
1ca8aed50 arm:omap:am33xx: ... |
1597 |
return; |
609691c19 ARM:omap:am33xx: ... |
1598 1599 |
out: /* |
f1e12bb92 arm:omap:am33xx: ... |
1600 |
* If the EEPROM hasn't been programed or an incorrect header |
c8f997ab0 ARM:omap:am335x: ... |
1601 1602 |
* or board name are read, assume this is an old beaglebone board * (< Rev A3) |
609691c19 ARM:omap:am33xx: ... |
1603 1604 |
*/ pr_err("Could not detect any board, falling back to: " |
c8f997ab0 ARM:omap:am335x: ... |
1605 1606 |
"Beaglebone (< Rev A3) with no daughter card connected "); |
f1e12bb92 arm:omap:am33xx: ... |
1607 |
daughter_brd_detected = false; |
c8f997ab0 ARM:omap:am335x: ... |
1608 |
setup_beaglebone_old(); |
609691c19 ARM:omap:am33xx: ... |
1609 |
|
2b2bcf286 AM335X: CPSW pinm... |
1610 1611 1612 1613 |
/* Initialize cpsw after board detection is completed as board * information is required for configuring phy address and hence * should be call only after board detection */ |
dfb4c854f arm:omap:cpsw: En... |
1614 1615 |
am33xx_cpsw_init(gigabit_enable); |
1ca8aed50 arm:omap:am33xx: ... |
1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 |
} static struct at24_platform_data am335x_daughter_board_eeprom_info = { .byte_len = (256*1024) / 8, .page_size = 64, .flags = AT24_FLAG_ADDR16, .setup = am335x_setup_daughter_board, .context = (void *)NULL, }; static struct at24_platform_data am335x_baseboard_eeprom_info = { .byte_len = (256*1024) / 8, .page_size = 64, .flags = AT24_FLAG_ADDR16, .setup = am335x_evm_setup, .context = (void *)NULL, }; |
276a52f8b arm:omap:am33xx: ... |
1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 |
static struct regulator_init_data am335x_dummy; static struct regulator_consumer_supply am335x_vdd1_supply[] = { REGULATOR_SUPPLY("mpu", "mpu.0"), }; static struct regulator_init_data am335x_vdd1 = { .constraints = { .min_uV = 600000, .max_uV = 1500000, .valid_modes_mask = REGULATOR_MODE_NORMAL, .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, .always_on = 1, }, .num_consumer_supplies = ARRAY_SIZE(am335x_vdd1_supply), .consumer_supplies = am335x_vdd1_supply, }; static struct tps65910_board am335x_tps65910_info = { .tps65910_pmic_init_data[TPS65910_REG_VRTC] = &am335x_dummy, .tps65910_pmic_init_data[TPS65910_REG_VIO] = &am335x_dummy, .tps65910_pmic_init_data[TPS65910_REG_VDD1] = &am335x_vdd1, .tps65910_pmic_init_data[TPS65910_REG_VDD2] = &am335x_dummy, .tps65910_pmic_init_data[TPS65910_REG_VDD3] = &am335x_dummy, .tps65910_pmic_init_data[TPS65910_REG_VDIG1] = &am335x_dummy, .tps65910_pmic_init_data[TPS65910_REG_VDIG2] = &am335x_dummy, .tps65910_pmic_init_data[TPS65910_REG_VPLL] = &am335x_dummy, .tps65910_pmic_init_data[TPS65910_REG_VDAC] = &am335x_dummy, .tps65910_pmic_init_data[TPS65910_REG_VAUX1] = &am335x_dummy, .tps65910_pmic_init_data[TPS65910_REG_VAUX2] = &am335x_dummy, .tps65910_pmic_init_data[TPS65910_REG_VAUX33] = &am335x_dummy, .tps65910_pmic_init_data[TPS65910_REG_VMMC] = &am335x_dummy, }; |
1ca8aed50 arm:omap:am33xx: ... |
1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 |
/* * Daughter board Detection. * Every board has a ID memory (EEPROM) on board. We probe these devices at * machine init, starting from daughter board and ending with baseboard. * Assumptions : * 1. probe for i2c devices are called in the order they are included in * the below struct. Daughter boards eeprom are probed 1st. Baseboard * eeprom probe is called last. */ static struct i2c_board_info __initdata am335x_i2c_boardinfo[] = { { /* Daughter Board EEPROM */ I2C_BOARD_INFO("24c256", DAUG_BOARD_I2C_ADDR), .platform_data = &am335x_daughter_board_eeprom_info, }, { /* Baseboard board EEPROM */ I2C_BOARD_INFO("24c256", BASEBOARD_I2C_ADDR), .platform_data = &am335x_baseboard_eeprom_info, }, { I2C_BOARD_INFO("cpld_reg", 0x35), }, { I2C_BOARD_INFO("tlc59108", 0x40), }, |
276a52f8b arm:omap:am33xx: ... |
1692 1693 1694 1695 |
{ I2C_BOARD_INFO("tps65910", TPS65910_I2C_ID1), .platform_data = &am335x_tps65910_info, }, |
1ca8aed50 arm:omap:am33xx: ... |
1696 1697 |
}; |
eb3dad1ce am335x: add musb ... |
1698 1699 1700 1701 1702 1703 |
static struct omap_musb_board_data musb_board_data = { .interface_type = MUSB_INTERFACE_ULPI, .mode = MUSB_OTG, .power = 500, .instances = 1, }; |
609691c19 ARM:omap:am33xx: ... |
1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 |
static int cpld_reg_probe(struct i2c_client *client, const struct i2c_device_id *id) { cpld_client = client; return 0; } static int __devexit cpld_reg_remove(struct i2c_client *client) { cpld_client = NULL; return 0; } static const struct i2c_device_id cpld_reg_id[] = { { "cpld_reg", 0 }, { } }; static struct i2c_driver cpld_reg_driver = { .driver = { .name = "cpld_reg", }, .probe = cpld_reg_probe, .remove = cpld_reg_remove, .id_table = cpld_reg_id, }; static void evm_init_cpld(void) { i2c_add_driver(&cpld_reg_driver); } |
1ca8aed50 arm:omap:am33xx: ... |
1735 1736 |
static void __init am335x_evm_i2c_init(void) { |
609691c19 ARM:omap:am33xx: ... |
1737 1738 1739 1740 |
/* Initially assume Low Cost EVM Config */ am335x_evm_id = LOW_COST_EVM; evm_init_cpld(); |
1ca8aed50 arm:omap:am33xx: ... |
1741 1742 1743 |
omap_register_i2c_bus(1, 100, am335x_i2c_boardinfo, ARRAY_SIZE(am335x_i2c_boardinfo)); } |
95d86ef9d ARM:omap3:am335x ... |
1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 |
static struct resource am335x_rtc_resources[] = { { .start = AM33XX_RTC_BASE, .end = AM33XX_RTC_BASE + SZ_4K - 1, .flags = IORESOURCE_MEM, }, { /* timer irq */ .start = AM33XX_IRQ_RTC_TIMER, .end = AM33XX_IRQ_RTC_TIMER, .flags = IORESOURCE_IRQ, }, { /* alarm irq */ .start = AM33XX_IRQ_RTC_ALARM, .end = AM33XX_IRQ_RTC_ALARM, .flags = IORESOURCE_IRQ, }, }; static struct platform_device am335x_rtc_device = { .name = "omap_rtc", .id = -1, .num_resources = ARRAY_SIZE(am335x_rtc_resources), .resource = am335x_rtc_resources, }; static int am335x_rtc_init(void) { void __iomem *base; struct clk *clk; clk = clk_get(NULL, "rtc_fck"); if (IS_ERR(clk)) { pr_err("rtc : Failed to get RTC clock "); return -1; } if (clk_enable(clk)) { pr_err("rtc: Clock Enable Failed "); return -1; } base = ioremap(AM33XX_RTC_BASE, SZ_4K); if (WARN_ON(!base)) return -ENOMEM; /* Unlock the rtc's registers */ __raw_writel(0x83e70b13, base + 0x6c); __raw_writel(0x95a4f1e0, base + 0x70); /* * Enable the 32K OSc * TODO: Need a better way to handle this * Since we want the clock to be running before mmc init * we need to do it before the rtc probe happens */ __raw_writel(0x48, base + 0x54); iounmap(base); return platform_device_register(&am335x_rtc_device); } /* Enable clkout2 */ static struct pinmux_config clkout2_pin_mux[] = { {"xdma_event_intr1.clkout2", OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT}, |
ca0024b85 arm:omap:am33xx: ... |
1812 |
{NULL, 0}, |
95d86ef9d ARM:omap3:am335x ... |
1813 1814 1815 1816 1817 1818 1819 |
}; static void __init clkout2_enable(void) { struct clk *ck_32; ck_32 = clk_get(NULL, "clkout2_ck"); |
ca0024b85 arm:omap:am33xx: ... |
1820 |
if (IS_ERR(ck_32)) { |
95d86ef9d ARM:omap3:am335x ... |
1821 1822 |
pr_err("Cannot clk_get ck_32 "); |
ca0024b85 arm:omap:am33xx: ... |
1823 1824 |
return; } |
95d86ef9d ARM:omap3:am335x ... |
1825 1826 1827 1828 1829 |
clk_enable(ck_32); setup_pin_mux(clkout2_pin_mux); } |
57abae34c arm:omap:am335x: ... |
1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 |
void __iomem * __init am33xx_get_mem_ctlr(void) { void __iomem *am33xx_emif_base; am33xx_emif_base = ioremap(AM33XX_EMIF0_BASE, SZ_32K); if (!am33xx_emif_base) pr_warning("%s: Unable to map DDR2 controller", __func__); return am33xx_emif_base; } static struct resource am33xx_cpuidle_resources[] = { { .start = AM33XX_EMIF0_BASE, .end = AM33XX_EMIF0_BASE + SZ_32K - 1, .flags = IORESOURCE_MEM, }, }; /* AM33XX devices support DDR2 power down */ static struct am33xx_cpuidle_config am33xx_cpuidle_pdata = { .ddr2_pdown = 1, }; static struct platform_device am33xx_cpuidle_device = { .name = "cpuidle-am33xx", .num_resources = ARRAY_SIZE(am33xx_cpuidle_resources), .resource = am33xx_cpuidle_resources, .dev = { .platform_data = &am33xx_cpuidle_pdata, }, }; static void __init am33xx_cpuidle_init(void) { int ret; am33xx_cpuidle_pdata.emif_base = am33xx_get_mem_ctlr(); ret = platform_device_register(&am33xx_cpuidle_device); if (ret) pr_warning("AM33XX cpuidle registration failed "); } |
433039582 arm:omap:am33xx: ... |
1877 1878 |
static void __init am335x_evm_init(void) { |
57abae34c arm:omap:am335x: ... |
1879 |
am33xx_cpuidle_init(); |
385ed291a arm:omap:am33xx: ... |
1880 |
am33xx_mux_init(board_mux); |
433039582 arm:omap:am33xx: ... |
1881 |
omap_serial_init(); |
95d86ef9d ARM:omap3:am335x ... |
1882 1883 |
am335x_rtc_init(); clkout2_enable(); |
1ca8aed50 arm:omap:am33xx: ... |
1884 |
am335x_evm_i2c_init(); |
433039582 arm:omap:am33xx: ... |
1885 |
omap_sdrc_init(NULL, NULL); |
eb3dad1ce am335x: add musb ... |
1886 |
usb_musb_init(&musb_board_data); |
433039582 arm:omap:am33xx: ... |
1887 1888 |
omap_board_config = am335x_evm_config; omap_board_config_size = ARRAY_SIZE(am335x_evm_config); |
057284410 arm:omap:am33xx: ... |
1889 1890 1891 1892 |
/* Create an alias for icss clock */ if (clk_add_alias("pruss", NULL, "icss_uart_gclk", NULL)) pr_err("failed to create an alias: icss_uart_gclk --> pruss "); |
851690ee0 arm:omap:am33xx: ... |
1893 1894 1895 1896 |
/* Create an alias for gfx/sgx clock */ if (clk_add_alias("sgx_ck", NULL, "gfx_fclk", NULL)) pr_err("failed to create an alias: gfx_fclk --> sgx_ck "); |
433039582 arm:omap:am33xx: ... |
1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 |
} static void __init am335x_evm_map_io(void) { omap2_set_globals_am33xx(); omapam33xx_map_common_io(); } MACHINE_START(AM335XEVM, "am335xevm") /* Maintainer: Texas Instruments */ .atag_offset = 0x100, .map_io = am335x_evm_map_io, |
433039582 arm:omap:am33xx: ... |
1909 |
.init_irq = ti816x_init_irq, |
1ca8aed50 arm:omap:am33xx: ... |
1910 |
.init_early = am335x_init_early, |
433039582 arm:omap:am33xx: ... |
1911 1912 1913 |
.timer = &omap3_am33xx_timer, .init_machine = am335x_evm_init, MACHINE_END |
67feecc90 arm:omap:am33xx: ... |
1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 |
MACHINE_START(AM335XIAEVM, "am335xiaevm") /* Maintainer: Texas Instruments */ .atag_offset = 0x100, .map_io = am335x_evm_map_io, .init_irq = ti816x_init_irq, .init_early = am335x_init_early, .timer = &omap3_am33xx_timer, .init_machine = am335x_evm_init, MACHINE_END |