db1000.c 15.6 KB
Newer Older
1
/*
2
 * DBAu1000/1500/1100 PBAu1100/1500 board support
3
 *
4 5
 * Copyright 2000, 2008 MontaVista Software Inc.
 * Author: MontaVista Software, Inc. <source@mvista.com>
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 *
 * 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; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

22
#include <linux/clk.h>
23 24
#include <linux/dma-mapping.h>
#include <linux/gpio.h>
25
#include <linux/gpio/machine.h>
26
#include <linux/init.h>
27
#include <linux/interrupt.h>
M
Manuel Lauss 已提交
28 29 30
#include <linux/leds.h>
#include <linux/mmc/host.h>
#include <linux/module.h>
31
#include <linux/platform_device.h>
32
#include <linux/pm.h>
33 34 35
#include <linux/spi/spi.h>
#include <linux/spi/spi_gpio.h>
#include <linux/spi/ads7846.h>
36
#include <asm/mach-au1x00/au1000.h>
37
#include <asm/mach-au1x00/gpio-au1000.h>
38
#include <asm/mach-au1x00/au1000_dma.h>
M
Manuel Lauss 已提交
39
#include <asm/mach-au1x00/au1100_mmc.h>
40
#include <asm/mach-db1x00/bcsr.h>
41 42 43
#include <asm/reboot.h>
#include <prom.h>
#include "platform.h"
44

45 46
#define F_SWAPPED (bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT)

47
const char *get_system_type(void);
48

49
int __init db1000_board_setup(void)
50
{
51 52 53 54
	/* initialize board register space */
	bcsr_init(DB1000_BCSR_PHYS_ADDR,
		  DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);

55 56 57 58
	switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
	case BCSR_WHOAMI_DB1000:
	case BCSR_WHOAMI_DB1500:
	case BCSR_WHOAMI_DB1100:
59 60 61
	case BCSR_WHOAMI_PB1500:
	case BCSR_WHOAMI_PB1500R2:
	case BCSR_WHOAMI_PB1100:
62 63
		pr_info("AMD Alchemy %s Board\n", get_system_type());
		return 0;
64
	}
65
	return -ENODEV;
66 67
}

68
static int db1500_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
{
	if ((slot < 12) || (slot > 13) || pin == 0)
		return -1;
	if (slot == 12)
		return (pin == 1) ? AU1500_PCI_INTA : 0xff;
	if (slot == 13) {
		switch (pin) {
		case 1: return AU1500_PCI_INTA;
		case 2: return AU1500_PCI_INTB;
		case 3: return AU1500_PCI_INTC;
		case 4: return AU1500_PCI_INTD;
		}
	}
	return -1;
}

static struct resource alchemy_pci_host_res[] = {
	[0] = {
		.start	= AU1500_PCI_PHYS_ADDR,
		.end	= AU1500_PCI_PHYS_ADDR + 0xfff,
		.flags	= IORESOURCE_MEM,
	},
};

93 94
static struct alchemy_pci_platdata db1500_pci_pd = {
	.board_map_irq	= db1500_map_pci_irq,
95 96
};

97 98
static struct platform_device db1500_pci_host_dev = {
	.dev.platform_data = &db1500_pci_pd,
99 100 101 102 103 104
	.name		= "alchemy-pci",
	.id		= 0,
	.num_resources	= ARRAY_SIZE(alchemy_pci_host_res),
	.resource	= alchemy_pci_host_res,
};

105
int __init db1500_pci_setup(void)
106
{
107
	return platform_device_register(&db1500_pci_host_dev);
108
}
109

110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
static struct resource au1100_lcd_resources[] = {
	[0] = {
		.start	= AU1100_LCD_PHYS_ADDR,
		.end	= AU1100_LCD_PHYS_ADDR + 0x800 - 1,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= AU1100_LCD_INT,
		.end	= AU1100_LCD_INT,
		.flags	= IORESOURCE_IRQ,
	}
};

static u64 au1100_lcd_dmamask = DMA_BIT_MASK(32);

static struct platform_device au1100_lcd_device = {
	.name		= "au1100-lcd",
	.id		= 0,
	.dev = {
		.dma_mask		= &au1100_lcd_dmamask,
		.coherent_dma_mask	= DMA_BIT_MASK(32),
	},
	.num_resources	= ARRAY_SIZE(au1100_lcd_resources),
	.resource	= au1100_lcd_resources,
};

136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
static struct resource alchemy_ac97c_res[] = {
	[0] = {
		.start	= AU1000_AC97_PHYS_ADDR,
		.end	= AU1000_AC97_PHYS_ADDR + 0xfff,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= DMA_ID_AC97C_TX,
		.end	= DMA_ID_AC97C_TX,
		.flags	= IORESOURCE_DMA,
	},
	[2] = {
		.start	= DMA_ID_AC97C_RX,
		.end	= DMA_ID_AC97C_RX,
		.flags	= IORESOURCE_DMA,
	},
};

static struct platform_device alchemy_ac97c_dev = {
	.name		= "alchemy-ac97c",
	.id		= -1,
	.resource	= alchemy_ac97c_res,
	.num_resources	= ARRAY_SIZE(alchemy_ac97c_res),
};

static struct platform_device alchemy_ac97c_dma_dev = {
	.name		= "alchemy-pcm-dma",
	.id		= 0,
};

static struct platform_device db1x00_codec_dev = {
	.name		= "ac97-codec",
	.id		= -1,
};

static struct platform_device db1x00_audio_dev = {
	.name		= "db1000-audio",
};

M
Manuel Lauss 已提交
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
/******************************************************************************/

static irqreturn_t db1100_mmc_cd(int irq, void *ptr)
{
	void (*mmc_cd)(struct mmc_host *, unsigned long);
	/* link against CONFIG_MMC=m */
	mmc_cd = symbol_get(mmc_detect_change);
	mmc_cd(ptr, msecs_to_jiffies(500));
	symbol_put(mmc_detect_change);

	return IRQ_HANDLED;
}

static int db1100_mmc_cd_setup(void *mmc_host, int en)
{
190 191 192 193 194 195
	int ret = 0, irq;

	if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
		irq = AU1100_GPIO19_INT;
	else
		irq = AU1100_GPIO14_INT;	/* PB1100 SD0 CD# */
M
Manuel Lauss 已提交
196 197

	if (en) {
198 199
		irq_set_irq_type(irq, IRQ_TYPE_EDGE_BOTH);
		ret = request_irq(irq, db1100_mmc_cd, 0,
M
Manuel Lauss 已提交
200 201
				  "sd0_cd", mmc_host);
	} else
202
		free_irq(irq, mmc_host);
M
Manuel Lauss 已提交
203 204 205 206 207
	return ret;
}

static int db1100_mmc1_cd_setup(void *mmc_host, int en)
{
208 209 210 211 212 213
	int ret = 0, irq;

	if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
		irq = AU1100_GPIO20_INT;
	else
		irq = AU1100_GPIO15_INT;	/* PB1100 SD1 CD# */
M
Manuel Lauss 已提交
214 215

	if (en) {
216 217
		irq_set_irq_type(irq, IRQ_TYPE_EDGE_BOTH);
		ret = request_irq(irq, db1100_mmc_cd, 0,
M
Manuel Lauss 已提交
218 219
				  "sd1_cd", mmc_host);
	} else
220
		free_irq(irq, mmc_host);
M
Manuel Lauss 已提交
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
	return ret;
}

static int db1100_mmc_card_readonly(void *mmc_host)
{
	/* testing suggests that this bit is inverted */
	return (bcsr_read(BCSR_STATUS) & BCSR_STATUS_SD0WP) ? 0 : 1;
}

static int db1100_mmc_card_inserted(void *mmc_host)
{
	return !alchemy_gpio_get_value(19);
}

static void db1100_mmc_set_power(void *mmc_host, int state)
{
237 238 239 240 241 242 243
	int bit;

	if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
		bit = BCSR_BOARD_SD0PWR;
	else
		bit = BCSR_BOARD_PB1100_SD0PWR;

M
Manuel Lauss 已提交
244
	if (state) {
245
		bcsr_mod(BCSR_BOARD, 0, bit);
M
Manuel Lauss 已提交
246 247
		msleep(400);	/* stabilization time */
	} else
248
		bcsr_mod(BCSR_BOARD, bit, 0);
M
Manuel Lauss 已提交
249 250 251 252 253 254 255 256 257 258 259
}

static void db1100_mmcled_set(struct led_classdev *led, enum led_brightness b)
{
	if (b != LED_OFF)
		bcsr_mod(BCSR_LEDS, BCSR_LEDS_LED0, 0);
	else
		bcsr_mod(BCSR_LEDS, 0, BCSR_LEDS_LED0);
}

static struct led_classdev db1100_mmc_led = {
R
Ralf Baechle 已提交
260
	.brightness_set = db1100_mmcled_set,
M
Manuel Lauss 已提交
261 262 263 264 265 266 267 268 269 270 271 272 273 274
};

static int db1100_mmc1_card_readonly(void *mmc_host)
{
	return (bcsr_read(BCSR_BOARD) & BCSR_BOARD_SD1WP) ? 1 : 0;
}

static int db1100_mmc1_card_inserted(void *mmc_host)
{
	return !alchemy_gpio_get_value(20);
}

static void db1100_mmc1_set_power(void *mmc_host, int state)
{
275 276 277 278 279 280 281
	int bit;

	if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
		bit = BCSR_BOARD_SD1PWR;
	else
		bit = BCSR_BOARD_PB1100_SD1PWR;

M
Manuel Lauss 已提交
282
	if (state) {
283
		bcsr_mod(BCSR_BOARD, 0, bit);
M
Manuel Lauss 已提交
284 285
		msleep(400);	/* stabilization time */
	} else
286
		bcsr_mod(BCSR_BOARD, bit, 0);
M
Manuel Lauss 已提交
287 288 289 290 291 292 293 294 295 296 297
}

static void db1100_mmc1led_set(struct led_classdev *led, enum led_brightness b)
{
	if (b != LED_OFF)
		bcsr_mod(BCSR_LEDS, BCSR_LEDS_LED1, 0);
	else
		bcsr_mod(BCSR_LEDS, 0, BCSR_LEDS_LED1);
}

static struct led_classdev db1100_mmc1_led = {
R
Ralf Baechle 已提交
298
	.brightness_set = db1100_mmc1led_set,
M
Manuel Lauss 已提交
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 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
};

static struct au1xmmc_platform_data db1100_mmc_platdata[2] = {
	[0] = {
		.cd_setup	= db1100_mmc_cd_setup,
		.set_power	= db1100_mmc_set_power,
		.card_inserted	= db1100_mmc_card_inserted,
		.card_readonly	= db1100_mmc_card_readonly,
		.led		= &db1100_mmc_led,
	},
	[1] = {
		.cd_setup	= db1100_mmc1_cd_setup,
		.set_power	= db1100_mmc1_set_power,
		.card_inserted	= db1100_mmc1_card_inserted,
		.card_readonly	= db1100_mmc1_card_readonly,
		.led		= &db1100_mmc1_led,
	},
};

static struct resource au1100_mmc0_resources[] = {
	[0] = {
		.start	= AU1100_SD0_PHYS_ADDR,
		.end	= AU1100_SD0_PHYS_ADDR + 0xfff,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= AU1100_SD_INT,
		.end	= AU1100_SD_INT,
		.flags	= IORESOURCE_IRQ,
	},
	[2] = {
		.start	= DMA_ID_SD0_TX,
		.end	= DMA_ID_SD0_TX,
		.flags	= IORESOURCE_DMA,
	},
	[3] = {
		.start	= DMA_ID_SD0_RX,
		.end	= DMA_ID_SD0_RX,
		.flags	= IORESOURCE_DMA,
	}
};

R
Ralf Baechle 已提交
341
static u64 au1xxx_mmc_dmamask =	 DMA_BIT_MASK(32);
M
Manuel Lauss 已提交
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389

static struct platform_device db1100_mmc0_dev = {
	.name		= "au1xxx-mmc",
	.id		= 0,
	.dev = {
		.dma_mask		= &au1xxx_mmc_dmamask,
		.coherent_dma_mask	= DMA_BIT_MASK(32),
		.platform_data		= &db1100_mmc_platdata[0],
	},
	.num_resources	= ARRAY_SIZE(au1100_mmc0_resources),
	.resource	= au1100_mmc0_resources,
};

static struct resource au1100_mmc1_res[] = {
	[0] = {
		.start	= AU1100_SD1_PHYS_ADDR,
		.end	= AU1100_SD1_PHYS_ADDR + 0xfff,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= AU1100_SD_INT,
		.end	= AU1100_SD_INT,
		.flags	= IORESOURCE_IRQ,
	},
	[2] = {
		.start	= DMA_ID_SD1_TX,
		.end	= DMA_ID_SD1_TX,
		.flags	= IORESOURCE_DMA,
	},
	[3] = {
		.start	= DMA_ID_SD1_RX,
		.end	= DMA_ID_SD1_RX,
		.flags	= IORESOURCE_DMA,
	}
};

static struct platform_device db1100_mmc1_dev = {
	.name		= "au1xxx-mmc",
	.id		= 1,
	.dev = {
		.dma_mask		= &au1xxx_mmc_dmamask,
		.coherent_dma_mask	= DMA_BIT_MASK(32),
		.platform_data		= &db1100_mmc_platdata[1],
	},
	.num_resources	= ARRAY_SIZE(au1100_mmc1_res),
	.resource	= au1100_mmc1_res,
};

390 391 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 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440
/******************************************************************************/

static void db1000_irda_set_phy_mode(int mode)
{
	unsigned short mask = BCSR_RESETS_IRDA_MODE_MASK | BCSR_RESETS_FIR_SEL;

	switch (mode) {
	case AU1000_IRDA_PHY_MODE_OFF:
		bcsr_mod(BCSR_RESETS, mask, BCSR_RESETS_IRDA_MODE_OFF);
		break;
	case AU1000_IRDA_PHY_MODE_SIR:
		bcsr_mod(BCSR_RESETS, mask, BCSR_RESETS_IRDA_MODE_FULL);
		break;
	case AU1000_IRDA_PHY_MODE_FIR:
		bcsr_mod(BCSR_RESETS, mask, BCSR_RESETS_IRDA_MODE_FULL |
					    BCSR_RESETS_FIR_SEL);
		break;
	}
}

static struct au1k_irda_platform_data db1000_irda_platdata = {
	.set_phy_mode	= db1000_irda_set_phy_mode,
};

static struct resource au1000_irda_res[] = {
	[0] = {
		.start	= AU1000_IRDA_PHYS_ADDR,
		.end	= AU1000_IRDA_PHYS_ADDR + 0x0fff,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= AU1000_IRDA_TX_INT,
		.end	= AU1000_IRDA_TX_INT,
		.flags	= IORESOURCE_IRQ,
	},
	[2] = {
		.start	= AU1000_IRDA_RX_INT,
		.end	= AU1000_IRDA_RX_INT,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct platform_device db1000_irda_dev = {
	.name	= "au1000-irda",
	.id	= -1,
	.dev	= {
		.platform_data = &db1000_irda_platdata,
	},
	.resource	= au1000_irda_res,
	.num_resources	= ARRAY_SIZE(au1000_irda_res),
};
M
Manuel Lauss 已提交
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
/******************************************************************************/

static struct ads7846_platform_data db1100_touch_pd = {
	.model		= 7846,
	.vref_mv	= 3300,
	.gpio_pendown	= 21,
};

static struct spi_gpio_platform_data db1100_spictl_pd = {
	.num_chipselect = 1,
};

static struct spi_board_info db1100_spi_info[] __initdata = {
	[0] = {
		.modalias	 = "ads7846",
		.max_speed_hz	 = 3250000,
		.bus_num	 = 0,
		.chip_select	 = 0,
		.mode		 = 0,
		.irq		 = AU1100_GPIO21_INT,
		.platform_data	 = &db1100_touch_pd,
	},
};

static struct platform_device db1100_spi_dev = {
	.name		= "spi_gpio",
	.id		= 0,
	.dev		= {
		.platform_data	= &db1100_spictl_pd,
	},
};

474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491
/*
 * Alchemy GPIO 2 has its base at 200 so the GPIO lines
 * 207 thru 210 are GPIOs at offset 7 thru 10 at this chip.
 */
static struct gpiod_lookup_table db1100_spi_gpiod_table = {
	.dev_id         = "spi_gpio",
	.table          = {
		GPIO_LOOKUP("alchemy-gpio2", 9,
			    "sck", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("alchemy-gpio2", 8,
			    "mosi", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("alchemy-gpio2", 7,
			    "miso", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("alchemy-gpio2", 10,
			    "cs", GPIO_ACTIVE_HIGH),
		{ },
	},
};
492

493 494 495 496 497 498 499
static struct platform_device *db1x00_devs[] = {
	&db1x00_codec_dev,
	&alchemy_ac97c_dma_dev,
	&alchemy_ac97c_dev,
	&db1x00_audio_dev,
};

500 501 502 503
static struct platform_device *db1000_devs[] = {
	&db1000_irda_dev,
};

504 505
static struct platform_device *db1100_devs[] = {
	&au1100_lcd_device,
M
Manuel Lauss 已提交
506 507
	&db1100_mmc0_dev,
	&db1100_mmc1_dev,
508
	&db1000_irda_dev,
509 510
};

511
int __init db1000_dev_setup(void)
512
{
513
	int board = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
514
	int c0, c1, d0, d1, s0, s1, flashsize = 32,  twosocks = 1;
515
	unsigned long pfc;
516
	struct clk *c, *p;
517 518 519 520

	if (board == BCSR_WHOAMI_DB1500) {
		c0 = AU1500_GPIO2_INT;
		c1 = AU1500_GPIO5_INT;
521 522
		d0 = 0;	/* GPIO number, NOT irq! */
		d1 = 3; /* GPIO number, NOT irq! */
523 524 525 526 527
		s0 = AU1500_GPIO1_INT;
		s1 = AU1500_GPIO4_INT;
	} else if (board == BCSR_WHOAMI_DB1100) {
		c0 = AU1100_GPIO2_INT;
		c1 = AU1100_GPIO5_INT;
528 529
		d0 = 0; /* GPIO number, NOT irq! */
		d1 = 3; /* GPIO number, NOT irq! */
530 531
		s0 = AU1100_GPIO1_INT;
		s1 = AU1100_GPIO4_INT;
M
Manuel Lauss 已提交
532

533 534
		gpio_request(19, "sd0_cd");
		gpio_request(20, "sd1_cd");
M
Manuel Lauss 已提交
535 536
		gpio_direction_input(19);	/* sd0 cd# */
		gpio_direction_input(20);	/* sd1 cd# */
537 538

		/* spi_gpio on SSI0 pins */
539
		pfc = alchemy_rdsys(AU1000_SYS_PINFUNC);
540
		pfc |= (1 << 0);	/* SSI0 pins as GPIOs */
541
		alchemy_wrsys(pfc, AU1000_SYS_PINFUNC);
542 543 544

		spi_register_board_info(db1100_spi_info,
					ARRAY_SIZE(db1100_spi_info));
M
Manuel Lauss 已提交
545

546 547 548 549 550 551 552 553 554 555 556 557
		/* link LCD clock to AUXPLL */
		p = clk_get(NULL, "auxpll_clk");
		c = clk_get(NULL, "lcd_intclk");
		if (!IS_ERR(c) && !IS_ERR(p)) {
			clk_set_parent(c, p);
			clk_set_rate(c, clk_get_rate(p));
		}
		if (!IS_ERR(c))
			clk_put(c);
		if (!IS_ERR(p))
			clk_put(p);

558
		platform_add_devices(db1100_devs, ARRAY_SIZE(db1100_devs));
559
		gpiod_add_lookup_table(&db1100_spi_gpiod_table);
560
		platform_device_register(&db1100_spi_dev);
561 562 563
	} else if (board == BCSR_WHOAMI_DB1000) {
		c0 = AU1000_GPIO2_INT;
		c1 = AU1000_GPIO5_INT;
564 565
		d0 = 0; /* GPIO number, NOT irq! */
		d1 = 3; /* GPIO number, NOT irq! */
566 567
		s0 = AU1000_GPIO1_INT;
		s1 = AU1000_GPIO4_INT;
568
		platform_add_devices(db1000_devs, ARRAY_SIZE(db1000_devs));
569 570 571
	} else if ((board == BCSR_WHOAMI_PB1500) ||
		   (board == BCSR_WHOAMI_PB1500R2)) {
		c0 = AU1500_GPIO203_INT;
572
		d0 = 1; /* GPIO number, NOT irq! */
573 574 575 576 577 578 579
		s0 = AU1500_GPIO202_INT;
		twosocks = 0;
		flashsize = 64;
		/* RTC and daughtercard irqs */
		irq_set_irq_type(AU1500_GPIO204_INT, IRQ_TYPE_LEVEL_LOW);
		irq_set_irq_type(AU1500_GPIO205_INT, IRQ_TYPE_LEVEL_LOW);
		/* EPSON S1D13806 0x1b000000
R
Ralf Baechle 已提交
580
		 * SRAM 1MB/2MB	  0x1a000000
581 582 583 584
		 * DS1693 RTC	  0x0c000000
		 */
	} else if (board == BCSR_WHOAMI_PB1100) {
		c0 = AU1100_GPIO11_INT;
585
		d0 = 9; /* GPIO number, NOT irq! */
586 587 588 589 590 591 592 593
		s0 = AU1100_GPIO10_INT;
		twosocks = 0;
		flashsize = 64;
		/* pendown, rtc, daughtercard irqs */
		irq_set_irq_type(AU1100_GPIO8_INT, IRQ_TYPE_LEVEL_LOW);
		irq_set_irq_type(AU1100_GPIO12_INT, IRQ_TYPE_LEVEL_LOW);
		irq_set_irq_type(AU1100_GPIO13_INT, IRQ_TYPE_LEVEL_LOW);
		/* EPSON S1D13806 0x1b000000
R
Ralf Baechle 已提交
594
		 * SRAM 1MB/2MB	  0x1a000000
595 596 597 598
		 * DiskOnChip	  0x0d000000
		 * DS1693 RTC	  0x0c000000
		 */
		platform_add_devices(db1100_devs, ARRAY_SIZE(db1100_devs));
599 600 601 602 603
	} else
		return 0; /* unknown board, no further dev setup to do */

	irq_set_irq_type(c0, IRQ_TYPE_LEVEL_LOW);
	irq_set_irq_type(s0, IRQ_TYPE_LEVEL_LOW);
604

605 606 607 608 609 610 611
	db1x_register_pcmcia_socket(
		AU1000_PCMCIA_ATTR_PHYS_ADDR,
		AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
		AU1000_PCMCIA_MEM_PHYS_ADDR,
		AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x000400000 - 1,
		AU1000_PCMCIA_IO_PHYS_ADDR,
		AU1000_PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
R
Ralf Baechle 已提交
612
		c0, d0, /*s0*/0, 0, 0);
613

614 615 616 617 618 619 620 621 622 623 624
	if (twosocks) {
		irq_set_irq_type(c1, IRQ_TYPE_LEVEL_LOW);
		irq_set_irq_type(s1, IRQ_TYPE_LEVEL_LOW);

		db1x_register_pcmcia_socket(
			AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
			AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
			AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x004000000,
			AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x004400000 - 1,
			AU1000_PCMCIA_IO_PHYS_ADDR   + 0x004000000,
			AU1000_PCMCIA_IO_PHYS_ADDR   + 0x004010000 - 1,
R
Ralf Baechle 已提交
625
			c1, d1, /*s1*/0, 0, 1);
626
	}
627

628
	platform_add_devices(db1x00_devs, ARRAY_SIZE(db1x00_devs));
629
	db1x_register_norflash(flashsize << 20, 4 /* 32bit */, F_SWAPPED);
630 631
	return 0;
}