2
* linux/arch/arm/mach-pxa/mxm8x10.c
4
* Support for the Embedian MXM-8x10 Computer on Module
6
* Copyright (C) 2006 Marvell International Ltd.
7
* Copyright (C) 2009 Embedian Inc.
8
* Copyright (C) 2009 TMT Services & Supplies (Pty) Ltd.
10
* 2007-09-04: eric miao <eric.y.miao@gmail.com>
11
* rewrite to align with latest kernel
13
* 2010-01-09: Edwin Peer <epeer@tmtservices.co.za>
14
* Hennie van der Merwe <hvdmerwe@tmtservices.co.za>
15
* rework for upstream merge
17
* This program is free software; you can redistribute it and/or modify
18
* it under the terms of the GNU General Public License version 2 as
19
* published by the Free Software Foundation.
22
#include <linux/serial_8250.h>
23
#include <linux/dm9000.h>
24
#include <linux/gpio.h>
27
#include <plat/pxa3xx_nand.h>
29
#include <mach/pxafb.h>
31
#include <mach/ohci.h>
32
#include <mach/pxa320.h>
34
#include <mach/mxm8x10.h>
39
/* GPIO pin definition
41
External device stuff - Leave unconfigured for now...
43
GPIO0 - DREQ (External DMA Request)
44
GPIO3 - nGCS2 (External Chip Select) Where is nGCS0; nGCS1; nGCS4; nGCS5 ?
66
GPIO87 - VCCIO_PWREN (External Device PWREN)
68
Dallas 1-Wire - Leave unconfigured for now...
78
Keypad - Leave unconfigured by for now...
101
Data Bus - Leave unconfigured for now...
103
GPIO2 - nWait (Data Bus)
107
GPIO4_2 - USBD_PULLUP
108
GPIO10 - UTM_CLK (USB Device UTM Clk)
109
GPIO49 - USB 2.0 Device UTM_DATA0
110
GPIO50 - USB 2.0 Device UTM_DATA1
111
GPIO51 - USB 2.0 Device UTM_DATA2
112
GPIO52 - USB 2.0 Device UTM_DATA3
113
GPIO53 - USB 2.0 Device UTM_DATA4
114
GPIO54 - USB 2.0 Device UTM_DATA5
115
GPIO55 - USB 2.0 Device UTM_DATA6
116
GPIO56 - USB 2.0 Device UTM_DATA7
117
GPIO58 - UTM_RXVALID (USB 2.0 Device)
118
GPIO59 - UTM_RXACTIVE (USB 2.0 Device)
122
GPIO71 - USBD_INT (USB Device?)
123
GPIO73 - UTM_TXREADY (USB 2.0 Device)
124
GPIO83 - UTM_TXVALID (USB 2.0 Device)
125
GPIO98 - UTM_RESET (USB 2.0 device)
126
GPIO99 - UTM_XCVR_SELECT
127
GPIO100 - UTM_TERM_SELECT
128
GPIO101 - UTM_SUSPENDM_X
129
GPIO102 - UTM_LINESTATE0
130
GPIO103 - UTM_LINESTATE1
132
Card-Bus Interface - Leave unconfigured for now...
134
GPIO5 - nPIOR (I/O space output enable)
135
GPIO6 - nPIOW (I/O space write enable)
136
GPIO7 - nIOS16 (Input from I/O space telling size of data bus)
137
GPIO8 - nPWAIT (Input for inserting wait states)
153
GPIO63 - LDD8 (CPU LCD)
154
GPIO64 - LDD9 (CPU LCD)
155
GPIO65 - LDD10 (CPU LCD)
156
GPIO66 - LDD11 (CPU LCD)
157
GPIO67 - LDD12 (CPU LCD)
158
GPIO68 - LDD13 (CPU LCD)
159
GPIO69 - LDD14 (CPU LCD)
160
GPIO70 - LDD15 (CPU LCD)
161
GPIO88 - VCCLCD_PWREN (LCD Panel PWREN)
162
GPIO97 - BACKLIGHT_EN
165
PWM - Leave unconfigured for now...
181
GPIO84 - SD_nIRQ_CD (SD-Card)
190
GPIO35 - AC97_SDATA_IN
191
GPIO37 - AC97_SDATA_OUT
221
SSP3 - Leave unconfigured for now...
235
static mfp_cfg_t mfp_cfg[] __initdata = {
238
GPIO49_U2D_PHYDATA_0,
239
GPIO50_U2D_PHYDATA_1,
240
GPIO51_U2D_PHYDATA_2,
241
GPIO52_U2D_PHYDATA_3,
242
GPIO53_U2D_PHYDATA_4,
243
GPIO54_U2D_PHYDATA_5,
244
GPIO55_U2D_PHYDATA_6,
245
GPIO56_U2D_PHYDATA_7,
251
GPIO71_GPIO, /* USBD_INT */
256
GPIO100_U2D_TERM_SEL,
258
GPIO102_UTM_LINESTATE_0,
259
GPIO103_UTM_LINESTATE_1,
260
GPIO4_2_GPIO | MFP_PULL_HIGH, /* UTM_PULLUP */
268
GPIO35_AC97_SDATA_IN_0,
269
GPIO37_AC97_SDATA_OUT,
272
GPIO40_AC97_nACRESET,
310
GPIO72_GPIO | MFP_PULL_HIGH, /* Card Detect */
311
GPIO84_GPIO | MFP_PULL_LOW, /* Write Protect */
314
GPIO74_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ1 */
315
GPIO75_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ2 */
316
GPIO76_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ3 */
317
GPIO77_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ4 */
318
GPIO78_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ5 */
319
GPIO79_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ6 */
320
GPIO80_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ7 */
321
GPIO81_GPIO | MFP_LPM_EDGE_RISE /* EXT_IRQ8 */
324
/* MMC/MCI Support */
325
#if defined(CONFIG_MMC)
326
static struct pxamci_platform_data mxm_8x10_mci_platform_data = {
327
.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
328
.detect_delay_ms = 10,
329
.gpio_card_detect = MXM_8X10_SD_nCD,
330
.gpio_card_ro = MXM_8X10_SD_WP,
334
void __init mxm_8x10_mmc_init(void)
336
pxa_set_mci_info(&mxm_8x10_mci_platform_data);
340
/* USB Open Host Controller Interface */
341
static struct pxaohci_platform_data mxm_8x10_ohci_platform_data = {
342
.port_mode = PMM_NPS_MODE,
343
.flags = ENABLE_PORT_ALL
346
void __init mxm_8x10_usb_host_init(void)
348
pxa_set_ohci_info(&mxm_8x10_ohci_platform_data);
351
/* AC97 Sound Support */
352
static struct platform_device mxm_8x10_ac97_device = {
353
.name = "pxa2xx-ac97"
356
void __init mxm_8x10_ac97_init(void)
358
platform_device_register(&mxm_8x10_ac97_device);
361
/* NAND flash Support */
362
#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE)
363
#define NAND_BLOCK_SIZE SZ_128K
364
#define NB(x) (NAND_BLOCK_SIZE * (x))
365
static struct mtd_partition mxm_8x10_nand_partitions[] = {
370
.mask_flags = MTD_WRITEABLE
376
.mask_flags = MTD_WRITEABLE
387
.mask_flags = MTD_WRITEABLE
391
static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = {
394
.parts = mxm_8x10_nand_partitions,
395
.nr_parts = ARRAY_SIZE(mxm_8x10_nand_partitions)
398
static void __init mxm_8x10_nand_init(void)
400
pxa3xx_set_nand_info(&mxm_8x10_nand_info);
403
static inline void mxm_8x10_nand_init(void) {}
404
#endif /* CONFIG_MTD_NAND_PXA3xx || CONFIG_MTD_NAND_PXA3xx_MODULE */
406
/* Ethernet support: Davicom DM9000 */
407
static struct resource dm9k_resources[] = {
409
.start = MXM_8X10_ETH_PHYS + 0x300,
410
.end = MXM_8X10_ETH_PHYS + 0x300,
411
.flags = IORESOURCE_MEM
414
.start = MXM_8X10_ETH_PHYS + 0x308,
415
.end = MXM_8X10_ETH_PHYS + 0x308,
416
.flags = IORESOURCE_MEM
419
.start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)),
420
.end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)),
421
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE
425
static struct dm9000_plat_data dm9k_plat_data = {
426
.flags = DM9000_PLATF_16BITONLY
429
static struct platform_device dm9k_device = {
432
.num_resources = ARRAY_SIZE(dm9k_resources),
433
.resource = dm9k_resources,
435
.platform_data = &dm9k_plat_data
439
static void __init mxm_8x10_ethernet_init(void)
441
platform_device_register(&dm9k_device);
445
static void __init mxm_8x10_uarts_init(void)
447
pxa_set_ffuart_info(NULL);
448
pxa_set_btuart_info(NULL);
449
pxa_set_stuart_info(NULL);
452
/* I2C and Real Time Clock */
453
static struct i2c_board_info __initdata mxm_8x10_i2c_devices[] = {
455
I2C_BOARD_INFO("ds1337", 0x68)
459
static void __init mxm_8x10_i2c_init(void)
461
i2c_register_board_info(0, mxm_8x10_i2c_devices,
462
ARRAY_SIZE(mxm_8x10_i2c_devices));
463
pxa_set_i2c_info(NULL);
466
void __init mxm_8x10_barebones_init(void)
468
pxa3xx_mfp_config(ARRAY_AND_SIZE(mfp_cfg));
470
mxm_8x10_uarts_init();
471
mxm_8x10_nand_init();
473
mxm_8x10_ethernet_init();