pxa3xx.c (e902be56cbf2a48d96d11d6884767e638d41c712) | pxa3xx.c (994642934d99b9a4d5447d628de7c321c4fde5fe) |
---|---|
1/* 2 * linux/arch/arm/mach-pxa/pxa3xx.c 3 * 4 * code specific to pxa3xx aka Monahans 5 * 6 * Copyright (C) 2006 Marvell International Ltd. 7 * 8 * 2007-09-02: eric miao <eric.miao@marvell.com> --- 202 unchanged lines hidden (view full) --- 211{ 212} 213 214static const struct clkops clk_dummy_ops = { 215 .enable = clk_dummy_enable, 216 .disable = clk_dummy_disable, 217}; 218 | 1/* 2 * linux/arch/arm/mach-pxa/pxa3xx.c 3 * 4 * code specific to pxa3xx aka Monahans 5 * 6 * Copyright (C) 2006 Marvell International Ltd. 7 * 8 * 2007-09-02: eric miao <eric.miao@marvell.com> --- 202 unchanged lines hidden (view full) --- 211{ 212} 213 214static const struct clkops clk_dummy_ops = { 215 .enable = clk_dummy_enable, 216 .disable = clk_dummy_disable, 217}; 218 |
219static struct clk clk_pxa3xx_pout = { 220 .ops = &clk_pout_ops, 221 .rate = 13000000, 222 .delay = 70, 223}; | 219static struct clk pxa3xx_clks[] = { 220 { 221 .name = "CLK_POUT", 222 .ops = &clk_pout_ops, 223 .rate = 13000000, 224 .delay = 70, 225 }, |
224 | 226 |
225static struct clk clk_dummy = { 226 .ops = &clk_dummy_ops, 227}; | 227 /* Power I2C clock is always on */ 228 { 229 .name = "I2CCLK", 230 .ops = &clk_dummy_ops, 231 .dev = &pxa3xx_device_i2c_power.dev, 232 }, |
228 | 233 |
229static DEFINE_PXA3_CK(pxa3xx_lcd, LCD, &clk_pxa3xx_hsio_ops); 230static DEFINE_PXA3_CK(pxa3xx_camera, CAMERA, &clk_pxa3xx_hsio_ops); 231static DEFINE_PXA3_CK(pxa3xx_ac97, AC97, &clk_pxa3xx_ac97_ops); 232static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1); 233static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1); 234static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1); 235static DEFINE_PXA3_CKEN(pxa3xx_i2c, I2C, 32842000, 0); 236static DEFINE_PXA3_CKEN(pxa3xx_udc, UDC, 48000000, 5); 237static DEFINE_PXA3_CKEN(pxa3xx_usbh, USBH, 48000000, 0); 238static DEFINE_PXA3_CKEN(pxa3xx_keypad, KEYPAD, 32768, 0); 239static DEFINE_PXA3_CKEN(pxa3xx_ssp1, SSP1, 13000000, 0); 240static DEFINE_PXA3_CKEN(pxa3xx_ssp2, SSP2, 13000000, 0); 241static DEFINE_PXA3_CKEN(pxa3xx_ssp3, SSP3, 13000000, 0); 242static DEFINE_PXA3_CKEN(pxa3xx_ssp4, SSP4, 13000000, 0); 243static DEFINE_PXA3_CKEN(pxa3xx_pwm0, PWM0, 13000000, 0); 244static DEFINE_PXA3_CKEN(pxa3xx_pwm1, PWM1, 13000000, 0); 245static DEFINE_PXA3_CKEN(pxa3xx_mmc1, MMC1, 19500000, 0); 246static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0); | 234 PXA3xx_CK("LCDCLK", LCD, &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev), 235 PXA3xx_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL), 236 PXA3xx_CK("AC97CLK", AC97, &clk_pxa3xx_ac97_ops, NULL), |
247 | 237 |
248static struct clk_lookup pxa3xx_clkregs[] = { 249 INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"), 250 /* Power I2C clock is always on */ 251 INIT_CLKREG(&clk_dummy, "pxa2xx-i2c.1", NULL), 252 INIT_CLKREG(&clk_pxa3xx_lcd, "pxa2xx-fb", NULL), 253 INIT_CLKREG(&clk_pxa3xx_camera, NULL, "CAMCLK"), 254 INIT_CLKREG(&clk_pxa3xx_ac97, NULL, "AC97CLK"), 255 INIT_CLKREG(&clk_pxa3xx_ffuart, "pxa2xx-uart.0", NULL), 256 INIT_CLKREG(&clk_pxa3xx_btuart, "pxa2xx-uart.1", NULL), 257 INIT_CLKREG(&clk_pxa3xx_stuart, "pxa2xx-uart.2", NULL), 258 INIT_CLKREG(&clk_pxa3xx_stuart, "pxa2xx-ir", "UARTCLK"), 259 INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL), 260 INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL), 261 INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL), 262 INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL), 263 INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL), 264 INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL), 265 INIT_CLKREG(&clk_pxa3xx_ssp3, "pxa27x-ssp.2", NULL), 266 INIT_CLKREG(&clk_pxa3xx_ssp4, "pxa27x-ssp.3", NULL), 267 INIT_CLKREG(&clk_pxa3xx_pwm0, "pxa27x-pwm.0", NULL), 268 INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL), 269 INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL), 270 INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL), | 238 PXA3xx_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev), 239 PXA3xx_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev), 240 PXA3xx_CKEN("UARTCLK", STUART, 14857000, 1, NULL), 241 242 PXA3xx_CKEN("I2CCLK", I2C, 32842000, 0, &pxa_device_i2c.dev), 243 PXA3xx_CKEN("UDCCLK", UDC, 48000000, 5, &pxa27x_device_udc.dev), 244 PXA3xx_CKEN("USBCLK", USBH, 48000000, 0, &pxa27x_device_ohci.dev), 245 PXA3xx_CKEN("KBDCLK", KEYPAD, 32768, 0, &pxa27x_device_keypad.dev), 246 247 PXA3xx_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev), 248 PXA3xx_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev), 249 PXA3xx_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev), 250 PXA3xx_CKEN("SSPCLK", SSP4, 13000000, 0, &pxa3xx_device_ssp4.dev), 251 PXA3xx_CKEN("PWMCLK", PWM0, 13000000, 0, &pxa27x_device_pwm0.dev), 252 PXA3xx_CKEN("PWMCLK", PWM1, 13000000, 0, &pxa27x_device_pwm1.dev), 253 254 PXA3xx_CKEN("MMCCLK", MMC1, 19500000, 0, &pxa_device_mci.dev), 255 PXA3xx_CKEN("MMCCLK", MMC2, 19500000, 0, &pxa3xx_device_mci2.dev), |
271}; 272 273#ifdef CONFIG_PM 274 275#define ISRAM_START 0x5c000000 276#define ISRAM_SIZE SZ_256K 277 278static void __iomem *sram; --- 260 unchanged lines hidden (view full) --- 539 pxa_init_irq(56, pxa3xx_set_wake); 540 pxa_init_gpio(128, NULL); 541} 542 543/* 544 * device registration specific to PXA3xx. 545 */ 546 | 256}; 257 258#ifdef CONFIG_PM 259 260#define ISRAM_START 0x5c000000 261#define ISRAM_SIZE SZ_256K 262 263static void __iomem *sram; --- 260 unchanged lines hidden (view full) --- 524 pxa_init_irq(56, pxa3xx_set_wake); 525 pxa_init_gpio(128, NULL); 526} 527 528/* 529 * device registration specific to PXA3xx. 530 */ 531 |
547static struct resource i2c_power_resources[] = { 548 { 549 .start = 0x40f500c0, 550 .end = 0x40f500d3, 551 .flags = IORESOURCE_MEM, 552 }, { 553 .start = IRQ_PWRI2C, 554 .end = IRQ_PWRI2C, 555 .flags = IORESOURCE_IRQ, 556 }, 557}; 558 559struct platform_device pxa3xx_device_i2c_power = { 560 .name = "pxa2xx-i2c", 561 .id = 1, 562 .resource = i2c_power_resources, 563 .num_resources = ARRAY_SIZE(i2c_power_resources), 564}; 565 | |
566void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info) 567{ 568 pxa3xx_device_i2c_power.dev.platform_data = info; 569} 570 571static struct platform_device *devices[] __initdata = { 572/* &pxa_device_udc, The UDC driver is PXA25x only */ 573 &pxa_device_ffuart, --- 31 unchanged lines hidden (view full) --- 605 /* 606 * clear RDH bit every time after reset 607 * 608 * Note: the last 3 bits DxS are write-1-to-clear so carefully 609 * preserve them here in case they will be referenced later 610 */ 611 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); 612 | 532void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info) 533{ 534 pxa3xx_device_i2c_power.dev.platform_data = info; 535} 536 537static struct platform_device *devices[] __initdata = { 538/* &pxa_device_udc, The UDC driver is PXA25x only */ 539 &pxa_device_ffuart, --- 31 unchanged lines hidden (view full) --- 571 /* 572 * clear RDH bit every time after reset 573 * 574 * Note: the last 3 bits DxS are write-1-to-clear so carefully 575 * preserve them here in case they will be referenced later 576 */ 577 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); 578 |
613 clks_register(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs)); | 579 clks_register(pxa3xx_clks, ARRAY_SIZE(pxa3xx_clks)); |
614 615 if ((ret = pxa_init_dma(32))) 616 return ret; 617 618 pxa3xx_init_pm(); 619 620 for (i = 0; i < ARRAY_SIZE(pxa3xx_sysdev); i++) { 621 ret = sysdev_register(&pxa3xx_sysdev[i]); 622 if (ret) 623 pr_err("failed to register sysdev[%d]\n", i); 624 } 625 626 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 627 } 628 629 return ret; 630} 631 632postcore_initcall(pxa3xx_init); | 580 581 if ((ret = pxa_init_dma(32))) 582 return ret; 583 584 pxa3xx_init_pm(); 585 586 for (i = 0; i < ARRAY_SIZE(pxa3xx_sysdev); i++) { 587 ret = sysdev_register(&pxa3xx_sysdev[i]); 588 if (ret) 589 pr_err("failed to register sysdev[%d]\n", i); 590 } 591 592 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 593 } 594 595 return ret; 596} 597 598postcore_initcall(pxa3xx_init); |