diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 13:29:52 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 13:29:52 -0500 |
| commit | 9b2831704e9250269032e3b8c2ffdfca09fd2851 (patch) | |
| tree | f0707f9cb808371e185f18268a14213a2e4fc392 | |
| parent | 337e4a1ab4d736b8c39a4c3a233ac21f1a6c036f (diff) | |
| parent | 204fc390d86f7087201ec4a146bc07483186c35b (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (33 commits)
sh: Fix test of unsigned in se7722_irq_demux()
sh: mach-ecovec24: Add FSI sound support
sh: mach-ecovec24: Add mt9t112 camera support
sh: mach-ecovec24: Add tw9910 support
sh: MSIOF/mmc_spi platform data for the Ecovec24 board
sh: ms7724se: Add ak4642 support
sh: Fix up FPU build for SH5
sh: Remove old early serial console code V2
sh: sh5 scif pdata (sh5-101/sh5-103)
sh: sh4a scif pdata (sh7757/sh7763/sh7770/sh7780/sh7785/sh7786/x3)
sh: sh4a scif pdata (sh7343/sh7366/sh7722/sh7723/sh7724)
sh: sh4 scif pdata (sh7750/sh7760/sh4-202)
sh: sh3 scif pdata (sh7705/sh770x/sh7710/sh7720)
sh: sh2a scif pdata (sh7201/sh7203/sh7206/mxg)
sh: sh2 scif pdata (sh7616)
sh-sci: Extend sh-sci driver with early console V2
sh: Stub in P3 ioremap support for nommu parts.
sh: wire up vmallocinfo support in ioremap() implementations.
sh: Make the unaligned trap handler always obey notification levels.
sh: Couple kernel and user write page perm bits for CONFIG_X2TLB
...
62 files changed, 1956 insertions, 1102 deletions
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug index 55907af1dc25..12fec72fec5f 100644 --- a/arch/sh/Kconfig.debug +++ b/arch/sh/Kconfig.debug | |||
| @@ -19,50 +19,6 @@ config SH_STANDARD_BIOS | |||
| 19 | mask ROM and no flash (WindowsCE machines fall in this category). | 19 | mask ROM and no flash (WindowsCE machines fall in this category). |
| 20 | If unsure, say N. | 20 | If unsure, say N. |
| 21 | 21 | ||
| 22 | config EARLY_SCIF_CONSOLE | ||
| 23 | bool "Use early SCIF console" | ||
| 24 | help | ||
| 25 | This enables an early console using a fixed SCIF port. This can | ||
| 26 | be used by platforms that are either not running the SH | ||
| 27 | standard BIOS, or do not wish to use the BIOS callbacks for the | ||
| 28 | serial I/O. | ||
| 29 | |||
| 30 | config EARLY_SCIF_CONSOLE_PORT | ||
| 31 | hex | ||
| 32 | depends on EARLY_SCIF_CONSOLE | ||
| 33 | default "0xa4400000" if CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7705 | ||
| 34 | default "0xa4430000" if CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721 | ||
| 35 | default "0xf8420000" if CPU_SUBTYPE_SH7619 | ||
| 36 | default "0xff804000" if CPU_SUBTYPE_MXG | ||
| 37 | default "0xffc30000" if CPU_SUBTYPE_SHX3 | ||
| 38 | default "0xffe00000" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7763 || \ | ||
| 39 | CPU_SUBTYPE_SH7722 || CPU_SUBTYPE_SH7366 || \ | ||
| 40 | CPU_SUBTYPE_SH7343 | ||
| 41 | default "0xfe4c0000" if CPU_SUBTYPE_SH7757 | ||
| 42 | default "0xffeb0000" if CPU_SUBTYPE_SH7785 | ||
| 43 | default "0xffeb0000" if CPU_SUBTYPE_SH7786 | ||
| 44 | default "0xfffe8000" if CPU_SUBTYPE_SH7203 | ||
| 45 | default "0xfffe9800" if CPU_SUBTYPE_SH7206 || CPU_SUBTYPE_SH7263 | ||
| 46 | default "0xffe80000" if CPU_SH4 | ||
| 47 | default "0xa4000150" if CPU_SH3 | ||
| 48 | default "0x00000000" | ||
| 49 | |||
| 50 | config EARLY_PRINTK | ||
| 51 | bool "Early printk support" | ||
| 52 | depends on SH_STANDARD_BIOS || EARLY_SCIF_CONSOLE | ||
| 53 | help | ||
| 54 | Say Y here to redirect kernel printk messages to the serial port | ||
| 55 | used by the SH-IPL bootloader, starting very early in the boot | ||
| 56 | process and ending when the kernel's serial console is initialised. | ||
| 57 | This option is only useful porting the kernel to a new machine, | ||
| 58 | when the kernel may crash or hang before the serial console is | ||
| 59 | initialised. If unsure, say N. | ||
| 60 | |||
| 61 | On devices that are running SH-IPL and want to keep the port | ||
| 62 | initialization consistent while not using the BIOS callbacks, | ||
| 63 | select both the EARLY_SCIF_CONSOLE and SH_STANDARD_BIOS, using | ||
| 64 | the kernel command line option to toggle back and forth. | ||
| 65 | |||
| 66 | config STACK_DEBUG | 22 | config STACK_DEBUG |
| 67 | bool "Check for stack overflows" | 23 | bool "Check for stack overflows" |
| 68 | depends on DEBUG_KERNEL && SUPERH32 | 24 | depends on DEBUG_KERNEL && SUPERH32 |
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index 7a9f69663f1a..1f5fa5c44f6d 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c | |||
| @@ -323,7 +323,8 @@ static struct soc_camera_platform_info camera_info = { | |||
| 323 | .height = 480, | 323 | .height = 480, |
| 324 | }, | 324 | }, |
| 325 | .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | | 325 | .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | |
| 326 | SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, | 326 | SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8 | |
| 327 | SOCAM_DATA_ACTIVE_HIGH, | ||
| 327 | .set_capture = camera_set_capture, | 328 | .set_capture = camera_set_capture, |
| 328 | }; | 329 | }; |
| 329 | 330 | ||
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 826e62326d51..194aaca22d47 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
| @@ -19,11 +19,18 @@ | |||
| 19 | #include <linux/usb/r8a66597.h> | 19 | #include <linux/usb/r8a66597.h> |
| 20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
| 21 | #include <linux/i2c/tsc2007.h> | 21 | #include <linux/i2c/tsc2007.h> |
| 22 | #include <linux/spi/spi.h> | ||
| 23 | #include <linux/spi/sh_msiof.h> | ||
| 24 | #include <linux/spi/mmc_spi.h> | ||
| 25 | #include <linux/mmc/host.h> | ||
| 22 | #include <linux/input.h> | 26 | #include <linux/input.h> |
| 23 | #include <linux/input/sh_keysc.h> | 27 | #include <linux/input/sh_keysc.h> |
| 24 | #include <linux/mfd/sh_mobile_sdhi.h> | 28 | #include <linux/mfd/sh_mobile_sdhi.h> |
| 25 | #include <video/sh_mobile_lcdc.h> | 29 | #include <video/sh_mobile_lcdc.h> |
| 30 | #include <sound/sh_fsi.h> | ||
| 26 | #include <media/sh_mobile_ceu.h> | 31 | #include <media/sh_mobile_ceu.h> |
| 32 | #include <media/tw9910.h> | ||
| 33 | #include <media/mt9t112.h> | ||
| 27 | #include <asm/heartbeat.h> | 34 | #include <asm/heartbeat.h> |
| 28 | #include <asm/sh_eth.h> | 35 | #include <asm/sh_eth.h> |
| 29 | #include <asm/clock.h> | 36 | #include <asm/clock.h> |
| @@ -338,6 +345,12 @@ static struct platform_device ceu1_device = { | |||
| 338 | }; | 345 | }; |
| 339 | 346 | ||
| 340 | /* I2C device */ | 347 | /* I2C device */ |
| 348 | static struct i2c_board_info i2c0_devices[] = { | ||
| 349 | { | ||
| 350 | I2C_BOARD_INFO("da7210", 0x1a), | ||
| 351 | }, | ||
| 352 | }; | ||
| 353 | |||
| 341 | static struct i2c_board_info i2c1_devices[] = { | 354 | static struct i2c_board_info i2c1_devices[] = { |
| 342 | { | 355 | { |
| 343 | I2C_BOARD_INFO("r2025sd", 0x32), | 356 | I2C_BOARD_INFO("r2025sd", 0x32), |
| @@ -421,6 +434,7 @@ static struct i2c_board_info ts_i2c_clients = { | |||
| 421 | .irq = IRQ0, | 434 | .irq = IRQ0, |
| 422 | }; | 435 | }; |
| 423 | 436 | ||
| 437 | #ifdef CONFIG_MFD_SH_MOBILE_SDHI | ||
| 424 | /* SHDI0 */ | 438 | /* SHDI0 */ |
| 425 | static void sdhi0_set_pwr(struct platform_device *pdev, int state) | 439 | static void sdhi0_set_pwr(struct platform_device *pdev, int state) |
| 426 | { | 440 | { |
| @@ -493,6 +507,248 @@ static struct platform_device sdhi1_device = { | |||
| 493 | }, | 507 | }, |
| 494 | }; | 508 | }; |
| 495 | 509 | ||
| 510 | #else | ||
| 511 | |||
| 512 | static int mmc_spi_get_ro(struct device *dev) | ||
| 513 | { | ||
| 514 | return gpio_get_value(GPIO_PTY6); | ||
| 515 | } | ||
| 516 | |||
| 517 | static int mmc_spi_get_cd(struct device *dev) | ||
| 518 | { | ||
| 519 | return !gpio_get_value(GPIO_PTY7); | ||
| 520 | } | ||
| 521 | |||
| 522 | static void mmc_spi_setpower(struct device *dev, unsigned int maskval) | ||
| 523 | { | ||
| 524 | gpio_set_value(GPIO_PTB6, maskval ? 1 : 0); | ||
| 525 | } | ||
| 526 | |||
| 527 | static struct mmc_spi_platform_data mmc_spi_info = { | ||
| 528 | .get_ro = mmc_spi_get_ro, | ||
| 529 | .get_cd = mmc_spi_get_cd, | ||
| 530 | .caps = MMC_CAP_NEEDS_POLL, | ||
| 531 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* 3.3V only */ | ||
| 532 | .setpower = mmc_spi_setpower, | ||
| 533 | }; | ||
| 534 | |||
| 535 | static struct spi_board_info spi_bus[] = { | ||
| 536 | { | ||
| 537 | .modalias = "mmc_spi", | ||
| 538 | .platform_data = &mmc_spi_info, | ||
| 539 | .max_speed_hz = 5000000, | ||
| 540 | .mode = SPI_MODE_0, | ||
| 541 | .controller_data = (void *) GPIO_PTM4, | ||
| 542 | }, | ||
| 543 | }; | ||
| 544 | |||
| 545 | static struct sh_msiof_spi_info msiof0_data = { | ||
| 546 | .num_chipselect = 1, | ||
| 547 | }; | ||
| 548 | |||
| 549 | static struct resource msiof0_resources[] = { | ||
| 550 | [0] = { | ||
| 551 | .name = "MSIOF0", | ||
| 552 | .start = 0xa4c40000, | ||
| 553 | .end = 0xa4c40063, | ||
| 554 | .flags = IORESOURCE_MEM, | ||
| 555 | }, | ||
| 556 | [1] = { | ||
| 557 | .start = 84, | ||
| 558 | .flags = IORESOURCE_IRQ, | ||
| 559 | }, | ||
| 560 | }; | ||
| 561 | |||
| 562 | static struct platform_device msiof0_device = { | ||
| 563 | .name = "spi_sh_msiof", | ||
| 564 | .id = 0, /* MSIOF0 */ | ||
| 565 | .dev = { | ||
| 566 | .platform_data = &msiof0_data, | ||
| 567 | }, | ||
| 568 | .num_resources = ARRAY_SIZE(msiof0_resources), | ||
| 569 | .resource = msiof0_resources, | ||
| 570 | .archdata = { | ||
| 571 | .hwblk_id = HWBLK_MSIOF0, | ||
| 572 | }, | ||
| 573 | }; | ||
| 574 | |||
| 575 | #endif | ||
| 576 | |||
| 577 | /* I2C Video/Camera */ | ||
| 578 | static struct i2c_board_info i2c_camera[] = { | ||
| 579 | { | ||
| 580 | I2C_BOARD_INFO("tw9910", 0x45), | ||
| 581 | }, | ||
| 582 | { | ||
| 583 | /* 1st camera */ | ||
| 584 | I2C_BOARD_INFO("mt9t112", 0x3c), | ||
| 585 | }, | ||
| 586 | { | ||
| 587 | /* 2nd camera */ | ||
| 588 | I2C_BOARD_INFO("mt9t112", 0x3c), | ||
| 589 | }, | ||
| 590 | }; | ||
| 591 | |||
| 592 | /* tw9910 */ | ||
| 593 | static int tw9910_power(struct device *dev, int mode) | ||
| 594 | { | ||
| 595 | int val = mode ? 0 : 1; | ||
| 596 | |||
| 597 | gpio_set_value(GPIO_PTU2, val); | ||
| 598 | if (mode) | ||
| 599 | mdelay(100); | ||
| 600 | |||
| 601 | return 0; | ||
| 602 | } | ||
| 603 | |||
| 604 | static struct tw9910_video_info tw9910_info = { | ||
| 605 | .buswidth = SOCAM_DATAWIDTH_8, | ||
| 606 | .mpout = TW9910_MPO_FIELD, | ||
| 607 | }; | ||
| 608 | |||
| 609 | static struct soc_camera_link tw9910_link = { | ||
| 610 | .i2c_adapter_id = 0, | ||
| 611 | .bus_id = 1, | ||
| 612 | .power = tw9910_power, | ||
| 613 | .board_info = &i2c_camera[0], | ||
| 614 | .module_name = "tw9910", | ||
| 615 | .priv = &tw9910_info, | ||
| 616 | }; | ||
| 617 | |||
| 618 | /* mt9t112 */ | ||
| 619 | static int mt9t112_power1(struct device *dev, int mode) | ||
| 620 | { | ||
| 621 | gpio_set_value(GPIO_PTA3, mode); | ||
| 622 | if (mode) | ||
| 623 | mdelay(100); | ||
| 624 | |||
| 625 | return 0; | ||
| 626 | } | ||
| 627 | |||
| 628 | static struct mt9t112_camera_info mt9t112_info1 = { | ||
| 629 | .flags = MT9T112_FLAG_PCLK_RISING_EDGE | MT9T112_FLAG_DATAWIDTH_8, | ||
| 630 | .divider = { 0x49, 0x6, 0, 6, 0, 9, 9, 6, 0 }, /* for 24MHz */ | ||
| 631 | }; | ||
| 632 | |||
| 633 | static struct soc_camera_link mt9t112_link1 = { | ||
| 634 | .i2c_adapter_id = 0, | ||
| 635 | .power = mt9t112_power1, | ||
| 636 | .bus_id = 0, | ||
| 637 | .board_info = &i2c_camera[1], | ||
| 638 | .module_name = "mt9t112", | ||
| 639 | .priv = &mt9t112_info1, | ||
| 640 | }; | ||
| 641 | |||
| 642 | static int mt9t112_power2(struct device *dev, int mode) | ||
| 643 | { | ||
| 644 | gpio_set_value(GPIO_PTA4, mode); | ||
| 645 | if (mode) | ||
| 646 | mdelay(100); | ||
| 647 | |||
| 648 | return 0; | ||
| 649 | } | ||
| 650 | |||
| 651 | static struct mt9t112_camera_info mt9t112_info2 = { | ||
| 652 | .flags = MT9T112_FLAG_PCLK_RISING_EDGE | MT9T112_FLAG_DATAWIDTH_8, | ||
| 653 | .divider = { 0x49, 0x6, 0, 6, 0, 9, 9, 6, 0 }, /* for 24MHz */ | ||
| 654 | }; | ||
| 655 | |||
| 656 | static struct soc_camera_link mt9t112_link2 = { | ||
| 657 | .i2c_adapter_id = 1, | ||
| 658 | .power = mt9t112_power2, | ||
| 659 | .bus_id = 1, | ||
| 660 | .board_info = &i2c_camera[2], | ||
| 661 | .module_name = "mt9t112", | ||
| 662 | .priv = &mt9t112_info2, | ||
| 663 | }; | ||
| 664 | |||
| 665 | static struct platform_device camera_devices[] = { | ||
| 666 | { | ||
| 667 | .name = "soc-camera-pdrv", | ||
| 668 | .id = 0, | ||
| 669 | .dev = { | ||
| 670 | .platform_data = &tw9910_link, | ||
| 671 | }, | ||
| 672 | }, | ||
| 673 | { | ||
| 674 | .name = "soc-camera-pdrv", | ||
| 675 | .id = 1, | ||
| 676 | .dev = { | ||
| 677 | .platform_data = &mt9t112_link1, | ||
| 678 | }, | ||
| 679 | }, | ||
| 680 | { | ||
| 681 | .name = "soc-camera-pdrv", | ||
| 682 | .id = 2, | ||
| 683 | .dev = { | ||
| 684 | .platform_data = &mt9t112_link2, | ||
| 685 | }, | ||
| 686 | }, | ||
| 687 | }; | ||
| 688 | |||
| 689 | /* FSI */ | ||
| 690 | /* | ||
| 691 | * FSI-B use external clock which came from da7210. | ||
| 692 | * So, we should change parent of fsi | ||
| 693 | */ | ||
| 694 | #define FCLKBCR 0xa415000c | ||
| 695 | static void fsimck_init(struct clk *clk) | ||
| 696 | { | ||
| 697 | u32 status = ctrl_inl(clk->enable_reg); | ||
| 698 | |||
| 699 | /* use external clock */ | ||
| 700 | status &= ~0x000000ff; | ||
| 701 | status |= 0x00000080; | ||
| 702 | |||
| 703 | ctrl_outl(status, clk->enable_reg); | ||
| 704 | } | ||
| 705 | |||
| 706 | static struct clk_ops fsimck_clk_ops = { | ||
| 707 | .init = fsimck_init, | ||
| 708 | }; | ||
| 709 | |||
| 710 | static struct clk fsimckb_clk = { | ||
| 711 | .name = "fsimckb_clk", | ||
| 712 | .id = -1, | ||
| 713 | .ops = &fsimck_clk_ops, | ||
| 714 | .enable_reg = (void __iomem *)FCLKBCR, | ||
| 715 | .rate = 0, /* unknown */ | ||
| 716 | }; | ||
| 717 | |||
| 718 | struct sh_fsi_platform_info fsi_info = { | ||
| 719 | .portb_flags = SH_FSI_BRS_INV | | ||
| 720 | SH_FSI_OUT_SLAVE_MODE | | ||
| 721 | SH_FSI_IN_SLAVE_MODE | | ||
| 722 | SH_FSI_OFMT(I2S) | | ||
| 723 | SH_FSI_IFMT(I2S), | ||
| 724 | }; | ||
| 725 | |||
| 726 | static struct resource fsi_resources[] = { | ||
| 727 | [0] = { | ||
| 728 | .name = "FSI", | ||
| 729 | .start = 0xFE3C0000, | ||
| 730 | .end = 0xFE3C021d, | ||
| 731 | .flags = IORESOURCE_MEM, | ||
| 732 | }, | ||
| 733 | [1] = { | ||
| 734 | .start = 108, | ||
| 735 | .flags = IORESOURCE_IRQ, | ||
| 736 | }, | ||
| 737 | }; | ||
| 738 | |||
| 739 | static struct platform_device fsi_device = { | ||
| 740 | .name = "sh_fsi", | ||
| 741 | .id = 0, | ||
| 742 | .num_resources = ARRAY_SIZE(fsi_resources), | ||
| 743 | .resource = fsi_resources, | ||
| 744 | .dev = { | ||
| 745 | .platform_data = &fsi_info, | ||
| 746 | }, | ||
| 747 | .archdata = { | ||
| 748 | .hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */ | ||
| 749 | }, | ||
| 750 | }; | ||
| 751 | |||
| 496 | static struct platform_device *ecovec_devices[] __initdata = { | 752 | static struct platform_device *ecovec_devices[] __initdata = { |
| 497 | &heartbeat_device, | 753 | &heartbeat_device, |
| 498 | &nor_flash_device, | 754 | &nor_flash_device, |
| @@ -503,8 +759,16 @@ static struct platform_device *ecovec_devices[] __initdata = { | |||
| 503 | &ceu0_device, | 759 | &ceu0_device, |
| 504 | &ceu1_device, | 760 | &ceu1_device, |
| 505 | &keysc_device, | 761 | &keysc_device, |
| 762 | #ifdef CONFIG_MFD_SH_MOBILE_SDHI | ||
| 506 | &sdhi0_device, | 763 | &sdhi0_device, |
| 507 | &sdhi1_device, | 764 | &sdhi1_device, |
| 765 | #else | ||
| 766 | &msiof0_device, | ||
| 767 | #endif | ||
| 768 | &camera_devices[0], | ||
| 769 | &camera_devices[1], | ||
| 770 | &camera_devices[2], | ||
| 771 | &fsi_device, | ||
| 508 | }; | 772 | }; |
| 509 | 773 | ||
| 510 | #define EEPROM_ADDR 0x50 | 774 | #define EEPROM_ADDR 0x50 |
| @@ -560,6 +824,8 @@ extern char ecovec24_sdram_leave_end; | |||
| 560 | 824 | ||
| 561 | static int __init arch_setup(void) | 825 | static int __init arch_setup(void) |
| 562 | { | 826 | { |
| 827 | struct clk *clk; | ||
| 828 | |||
| 563 | /* register board specific self-refresh code */ | 829 | /* register board specific self-refresh code */ |
| 564 | sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, | 830 | sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, |
| 565 | &ecovec24_sdram_enter_start, | 831 | &ecovec24_sdram_enter_start, |
| @@ -773,7 +1039,8 @@ static int __init arch_setup(void) | |||
| 773 | gpio_direction_input(GPIO_PTR5); | 1039 | gpio_direction_input(GPIO_PTR5); |
| 774 | gpio_direction_input(GPIO_PTR6); | 1040 | gpio_direction_input(GPIO_PTR6); |
| 775 | 1041 | ||
| 776 | /* enable SDHI0 (needs DS2.4 set to ON) */ | 1042 | #ifdef CONFIG_MFD_SH_MOBILE_SDHI |
| 1043 | /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */ | ||
| 777 | gpio_request(GPIO_FN_SDHI0CD, NULL); | 1044 | gpio_request(GPIO_FN_SDHI0CD, NULL); |
| 778 | gpio_request(GPIO_FN_SDHI0WP, NULL); | 1045 | gpio_request(GPIO_FN_SDHI0WP, NULL); |
| 779 | gpio_request(GPIO_FN_SDHI0CMD, NULL); | 1046 | gpio_request(GPIO_FN_SDHI0CMD, NULL); |
| @@ -785,7 +1052,7 @@ static int __init arch_setup(void) | |||
| 785 | gpio_request(GPIO_PTB6, NULL); | 1052 | gpio_request(GPIO_PTB6, NULL); |
| 786 | gpio_direction_output(GPIO_PTB6, 0); | 1053 | gpio_direction_output(GPIO_PTB6, 0); |
| 787 | 1054 | ||
| 788 | /* enable SDHI1 (needs DS2.6,7 set to ON,OFF) */ | 1055 | /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */ |
| 789 | gpio_request(GPIO_FN_SDHI1CD, NULL); | 1056 | gpio_request(GPIO_FN_SDHI1CD, NULL); |
| 790 | gpio_request(GPIO_FN_SDHI1WP, NULL); | 1057 | gpio_request(GPIO_FN_SDHI1WP, NULL); |
| 791 | gpio_request(GPIO_FN_SDHI1CMD, NULL); | 1058 | gpio_request(GPIO_FN_SDHI1CMD, NULL); |
| @@ -799,8 +1066,59 @@ static int __init arch_setup(void) | |||
| 799 | 1066 | ||
| 800 | /* I/O buffer drive ability is high for SDHI1 */ | 1067 | /* I/O buffer drive ability is high for SDHI1 */ |
| 801 | ctrl_outw((ctrl_inw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); | 1068 | ctrl_outw((ctrl_inw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); |
| 1069 | #else | ||
| 1070 | /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ | ||
| 1071 | gpio_request(GPIO_FN_MSIOF0_TXD, NULL); | ||
| 1072 | gpio_request(GPIO_FN_MSIOF0_RXD, NULL); | ||
| 1073 | gpio_request(GPIO_FN_MSIOF0_TSCK, NULL); | ||
| 1074 | gpio_request(GPIO_PTM4, NULL); /* software CS control of TSYNC pin */ | ||
| 1075 | gpio_direction_output(GPIO_PTM4, 1); /* active low CS */ | ||
| 1076 | gpio_request(GPIO_PTB6, NULL); /* 3.3V power control */ | ||
| 1077 | gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */ | ||
| 1078 | gpio_request(GPIO_PTY6, NULL); /* write protect */ | ||
| 1079 | gpio_direction_input(GPIO_PTY6); | ||
| 1080 | gpio_request(GPIO_PTY7, NULL); /* card detect */ | ||
| 1081 | gpio_direction_input(GPIO_PTY7); | ||
| 1082 | |||
| 1083 | spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); | ||
| 1084 | #endif | ||
| 1085 | |||
| 1086 | /* enable Video */ | ||
| 1087 | gpio_request(GPIO_PTU2, NULL); | ||
| 1088 | gpio_direction_output(GPIO_PTU2, 1); | ||
| 1089 | |||
| 1090 | /* enable Camera */ | ||
| 1091 | gpio_request(GPIO_PTA3, NULL); | ||
| 1092 | gpio_request(GPIO_PTA4, NULL); | ||
| 1093 | gpio_direction_output(GPIO_PTA3, 0); | ||
| 1094 | gpio_direction_output(GPIO_PTA4, 0); | ||
| 1095 | |||
| 1096 | /* enable FSI */ | ||
| 1097 | gpio_request(GPIO_FN_FSIMCKB, NULL); | ||
| 1098 | gpio_request(GPIO_FN_FSIIBSD, NULL); | ||
| 1099 | gpio_request(GPIO_FN_FSIOBSD, NULL); | ||
| 1100 | gpio_request(GPIO_FN_FSIIBBCK, NULL); | ||
| 1101 | gpio_request(GPIO_FN_FSIIBLRCK, NULL); | ||
| 1102 | gpio_request(GPIO_FN_FSIOBBCK, NULL); | ||
| 1103 | gpio_request(GPIO_FN_FSIOBLRCK, NULL); | ||
| 1104 | gpio_request(GPIO_FN_CLKAUDIOBO, NULL); | ||
| 1105 | |||
| 1106 | /* change parent of FSI B */ | ||
| 1107 | clk = clk_get(NULL, "fsib_clk"); | ||
| 1108 | clk_register(&fsimckb_clk); | ||
| 1109 | clk_set_parent(clk, &fsimckb_clk); | ||
| 1110 | clk_set_rate(clk, 11000); | ||
| 1111 | clk_set_rate(&fsimckb_clk, 11000); | ||
| 1112 | clk_put(clk); | ||
| 1113 | |||
| 1114 | gpio_request(GPIO_PTU0, NULL); | ||
| 1115 | gpio_direction_output(GPIO_PTU0, 0); | ||
| 1116 | mdelay(20); | ||
| 802 | 1117 | ||
| 803 | /* enable I2C device */ | 1118 | /* enable I2C device */ |
| 1119 | i2c_register_board_info(0, i2c0_devices, | ||
| 1120 | ARRAY_SIZE(i2c0_devices)); | ||
| 1121 | |||
| 804 | i2c_register_board_info(1, i2c1_devices, | 1122 | i2c_register_board_info(1, i2c1_devices, |
| 805 | ARRAY_SIZE(i2c1_devices)); | 1123 | ARRAY_SIZE(i2c1_devices)); |
| 806 | 1124 | ||
diff --git a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c index 8ccb1cc8b589..e9b970846c41 100644 --- a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c +++ b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c | |||
| @@ -273,6 +273,12 @@ int kfr2r09_lcd_setup(void *board_data, void *sohandle, | |||
| 273 | return 0; | 273 | return 0; |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | void kfr2r09_lcd_start(void *board_data, void *sohandle, | ||
| 277 | struct sh_mobile_lcdc_sys_bus_ops *so) | ||
| 278 | { | ||
| 279 | write_memory_start(sohandle, so); | ||
| 280 | } | ||
| 281 | |||
| 276 | #define CTRL_CKSW 0x10 | 282 | #define CTRL_CKSW 0x10 |
| 277 | #define CTRL_C10 0x20 | 283 | #define CTRL_C10 0x20 |
| 278 | #define CTRL_CPSW 0x80 | 284 | #define CTRL_CPSW 0x80 |
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c index 9038d768a525..5d7b5d92475e 100644 --- a/arch/sh/boards/mach-kfr2r09/setup.c +++ b/arch/sh/boards/mach-kfr2r09/setup.c | |||
| @@ -150,6 +150,7 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = { | |||
| 150 | }, | 150 | }, |
| 151 | .board_cfg = { | 151 | .board_cfg = { |
| 152 | .setup_sys = kfr2r09_lcd_setup, | 152 | .setup_sys = kfr2r09_lcd_setup, |
| 153 | .start_transfer = kfr2r09_lcd_start, | ||
| 153 | .display_on = kfr2r09_lcd_on, | 154 | .display_on = kfr2r09_lcd_on, |
| 154 | .display_off = kfr2r09_lcd_off, | 155 | .display_off = kfr2r09_lcd_off, |
| 155 | }, | 156 | }, |
diff --git a/arch/sh/boards/mach-se/7722/irq.c b/arch/sh/boards/mach-se/7722/irq.c index 4eb31acfafef..b221b6842b0d 100644 --- a/arch/sh/boards/mach-se/7722/irq.c +++ b/arch/sh/boards/mach-se/7722/irq.c | |||
| @@ -57,15 +57,16 @@ static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
| 57 | */ | 57 | */ |
| 58 | void __init init_se7722_IRQ(void) | 58 | void __init init_se7722_IRQ(void) |
| 59 | { | 59 | { |
| 60 | int i; | 60 | int i, irq; |
| 61 | 61 | ||
| 62 | ctrl_outw(0, IRQ01_MASK); /* disable all irqs */ | 62 | ctrl_outw(0, IRQ01_MASK); /* disable all irqs */ |
| 63 | ctrl_outw(0x2000, 0xb03fffec); /* mrshpc irq enable */ | 63 | ctrl_outw(0x2000, 0xb03fffec); /* mrshpc irq enable */ |
| 64 | 64 | ||
| 65 | for (i = 0; i < SE7722_FPGA_IRQ_NR; i++) { | 65 | for (i = 0; i < SE7722_FPGA_IRQ_NR; i++) { |
| 66 | se7722_fpga_irq[i] = create_irq(); | 66 | irq = create_irq(); |
| 67 | if (se7722_fpga_irq[i] < 0) | 67 | if (irq < 0) |
| 68 | return; | 68 | return; |
| 69 | se7722_fpga_irq[i] = irq; | ||
| 69 | 70 | ||
| 70 | set_irq_chip_and_handler_name(se7722_fpga_irq[i], | 71 | set_irq_chip_and_handler_name(se7722_fpga_irq[i], |
| 71 | &se7722_irq_chip, | 72 | &se7722_irq_chip, |
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index 4b0f0c0dc2b8..5d0f70b46c97 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
| @@ -514,6 +514,13 @@ static struct platform_device *ms7724se_devices[] __initdata = { | |||
| 514 | &sdhi1_cn8_device, | 514 | &sdhi1_cn8_device, |
| 515 | }; | 515 | }; |
| 516 | 516 | ||
| 517 | /* I2C device */ | ||
| 518 | static struct i2c_board_info i2c0_devices[] = { | ||
| 519 | { | ||
| 520 | I2C_BOARD_INFO("ak4642", 0x12), | ||
| 521 | }, | ||
| 522 | }; | ||
| 523 | |||
| 517 | #define EEPROM_OP 0xBA206000 | 524 | #define EEPROM_OP 0xBA206000 |
| 518 | #define EEPROM_ADR 0xBA206004 | 525 | #define EEPROM_ADR 0xBA206004 |
| 519 | #define EEPROM_DATA 0xBA20600C | 526 | #define EEPROM_DATA 0xBA20600C |
| @@ -575,6 +582,16 @@ extern char ms7724se_sdram_enter_end; | |||
| 575 | extern char ms7724se_sdram_leave_start; | 582 | extern char ms7724se_sdram_leave_start; |
| 576 | extern char ms7724se_sdram_leave_end; | 583 | extern char ms7724se_sdram_leave_end; |
| 577 | 584 | ||
| 585 | |||
| 586 | static int __init arch_setup(void) | ||
| 587 | { | ||
| 588 | /* enable I2C device */ | ||
| 589 | i2c_register_board_info(0, i2c0_devices, | ||
| 590 | ARRAY_SIZE(i2c0_devices)); | ||
| 591 | return 0; | ||
| 592 | } | ||
| 593 | arch_initcall(arch_setup); | ||
| 594 | |||
| 578 | static int __init devices_setup(void) | 595 | static int __init devices_setup(void) |
| 579 | { | 596 | { |
| 580 | u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ | 597 | u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ |
diff --git a/arch/sh/configs/ecovec24-romimage_defconfig b/arch/sh/configs/ecovec24-romimage_defconfig index 0774924623cc..46874704e4e7 100644 --- a/arch/sh/configs/ecovec24-romimage_defconfig +++ b/arch/sh/configs/ecovec24-romimage_defconfig | |||
| @@ -203,7 +203,7 @@ CONFIG_MMU=y | |||
| 203 | CONFIG_PAGE_OFFSET=0x80000000 | 203 | CONFIG_PAGE_OFFSET=0x80000000 |
| 204 | CONFIG_FORCE_MAX_ZONEORDER=11 | 204 | CONFIG_FORCE_MAX_ZONEORDER=11 |
| 205 | CONFIG_MEMORY_START=0x08000000 | 205 | CONFIG_MEMORY_START=0x08000000 |
| 206 | CONFIG_MEMORY_SIZE=0x08000000 | 206 | CONFIG_MEMORY_SIZE=0x10000000 |
| 207 | CONFIG_29BIT=y | 207 | CONFIG_29BIT=y |
| 208 | # CONFIG_X2TLB is not set | 208 | # CONFIG_X2TLB is not set |
| 209 | CONFIG_VSYSCALL=y | 209 | CONFIG_VSYSCALL=y |
diff --git a/arch/sh/configs/ecovec24_defconfig b/arch/sh/configs/ecovec24_defconfig index ac6469718a2c..cad918437ca7 100644 --- a/arch/sh/configs/ecovec24_defconfig +++ b/arch/sh/configs/ecovec24_defconfig | |||
| @@ -204,7 +204,7 @@ CONFIG_MMU=y | |||
| 204 | CONFIG_PAGE_OFFSET=0x80000000 | 204 | CONFIG_PAGE_OFFSET=0x80000000 |
| 205 | CONFIG_FORCE_MAX_ZONEORDER=11 | 205 | CONFIG_FORCE_MAX_ZONEORDER=11 |
| 206 | CONFIG_MEMORY_START=0x08000000 | 206 | CONFIG_MEMORY_START=0x08000000 |
| 207 | CONFIG_MEMORY_SIZE=0x08000000 | 207 | CONFIG_MEMORY_SIZE=0x10000000 |
| 208 | CONFIG_29BIT=y | 208 | CONFIG_29BIT=y |
| 209 | # CONFIG_X2TLB is not set | 209 | # CONFIG_X2TLB is not set |
| 210 | CONFIG_VSYSCALL=y | 210 | CONFIG_VSYSCALL=y |
diff --git a/arch/sh/configs/rts7751r2d1_defconfig b/arch/sh/configs/rts7751r2d1_defconfig index f521e82cc19e..6f1126b3e487 100644 --- a/arch/sh/configs/rts7751r2d1_defconfig +++ b/arch/sh/configs/rts7751r2d1_defconfig | |||
| @@ -324,7 +324,7 @@ CONFIG_ENTRY_OFFSET=0x00001000 | |||
| 324 | # CONFIG_UBC_WAKEUP is not set | 324 | # CONFIG_UBC_WAKEUP is not set |
| 325 | CONFIG_CMDLINE_OVERWRITE=y | 325 | CONFIG_CMDLINE_OVERWRITE=y |
| 326 | # CONFIG_CMDLINE_EXTEND is not set | 326 | # CONFIG_CMDLINE_EXTEND is not set |
| 327 | CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 root=/dev/sda1 earlyprintk=serial" | 327 | CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 root=/dev/sda1" |
| 328 | 328 | ||
| 329 | # | 329 | # |
| 330 | # Bus options | 330 | # Bus options |
diff --git a/arch/sh/configs/rts7751r2dplus_defconfig b/arch/sh/configs/rts7751r2dplus_defconfig index a156cd1e0617..9215bbb13d6f 100644 --- a/arch/sh/configs/rts7751r2dplus_defconfig +++ b/arch/sh/configs/rts7751r2dplus_defconfig | |||
| @@ -324,7 +324,7 @@ CONFIG_ENTRY_OFFSET=0x00001000 | |||
| 324 | # CONFIG_UBC_WAKEUP is not set | 324 | # CONFIG_UBC_WAKEUP is not set |
| 325 | CONFIG_CMDLINE_OVERWRITE=y | 325 | CONFIG_CMDLINE_OVERWRITE=y |
| 326 | # CONFIG_CMDLINE_EXTEND is not set | 326 | # CONFIG_CMDLINE_EXTEND is not set |
| 327 | CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 root=/dev/sda1 earlyprintk=serial" | 327 | CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 root=/dev/sda1" |
| 328 | 328 | ||
| 329 | # | 329 | # |
| 330 | # Bus options | 330 | # Bus options |
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index 512cd3e9d0ca..026dd659a640 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h | |||
| @@ -233,11 +233,17 @@ unsigned long long poke_real_address_q(unsigned long long addr, | |||
| 233 | * doesn't exist, so everything must go through page tables. | 233 | * doesn't exist, so everything must go through page tables. |
| 234 | */ | 234 | */ |
| 235 | #ifdef CONFIG_MMU | 235 | #ifdef CONFIG_MMU |
| 236 | void __iomem *__ioremap(unsigned long offset, unsigned long size, | 236 | void __iomem *__ioremap_caller(unsigned long offset, unsigned long size, |
| 237 | unsigned long flags); | 237 | unsigned long flags, void *caller); |
| 238 | void __iounmap(void __iomem *addr); | 238 | void __iounmap(void __iomem *addr); |
| 239 | 239 | ||
| 240 | static inline void __iomem * | 240 | static inline void __iomem * |
| 241 | __ioremap(unsigned long offset, unsigned long size, unsigned long flags) | ||
| 242 | { | ||
| 243 | return __ioremap_caller(offset, size, flags, __builtin_return_address(0)); | ||
| 244 | } | ||
| 245 | |||
| 246 | static inline void __iomem * | ||
| 241 | __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags) | 247 | __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags) |
| 242 | { | 248 | { |
| 243 | #if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED) && !defined(CONFIG_PMB) | 249 | #if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED) && !defined(CONFIG_PMB) |
| @@ -271,6 +277,7 @@ __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags) | |||
| 271 | return __ioremap(offset, size, flags); | 277 | return __ioremap(offset, size, flags); |
| 272 | } | 278 | } |
| 273 | #else | 279 | #else |
| 280 | #define __ioremap(offset, size, flags) ((void __iomem *)(offset)) | ||
| 274 | #define __ioremap_mode(offset, size, flags) ((void __iomem *)(offset)) | 281 | #define __ioremap_mode(offset, size, flags) ((void __iomem *)(offset)) |
| 275 | #define __iounmap(addr) do { } while (0) | 282 | #define __iounmap(addr) do { } while (0) |
| 276 | #endif /* CONFIG_MMU */ | 283 | #endif /* CONFIG_MMU */ |
diff --git a/arch/sh/include/asm/pgtable_32.h b/arch/sh/include/asm/pgtable_32.h index b35435516203..5003ee86f67b 100644 --- a/arch/sh/include/asm/pgtable_32.h +++ b/arch/sh/include/asm/pgtable_32.h | |||
| @@ -344,7 +344,8 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
| 344 | #define pte_special(pte) ((pte).pte_low & _PAGE_SPECIAL) | 344 | #define pte_special(pte) ((pte).pte_low & _PAGE_SPECIAL) |
| 345 | 345 | ||
| 346 | #ifdef CONFIG_X2TLB | 346 | #ifdef CONFIG_X2TLB |
| 347 | #define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE) | 347 | #define pte_write(pte) \ |
| 348 | ((pte).pte_high & (_PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE)) | ||
| 348 | #else | 349 | #else |
| 349 | #define pte_write(pte) ((pte).pte_low & _PAGE_RW) | 350 | #define pte_write(pte) ((pte).pte_low & _PAGE_RW) |
| 350 | #endif | 351 | #endif |
| @@ -358,7 +359,7 @@ static inline pte_t pte_##fn(pte_t pte) { pte.pte_##h op; return pte; } | |||
| 358 | * individually toggled (and user permissions are entirely decoupled from | 359 | * individually toggled (and user permissions are entirely decoupled from |
| 359 | * kernel permissions), we attempt to couple them a bit more sanely here. | 360 | * kernel permissions), we attempt to couple them a bit more sanely here. |
| 360 | */ | 361 | */ |
| 361 | PTE_BIT_FUNC(high, wrprotect, &= ~_PAGE_EXT_USER_WRITE); | 362 | PTE_BIT_FUNC(high, wrprotect, &= ~(_PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE)); |
| 362 | PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE); | 363 | PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE); |
| 363 | PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE); | 364 | PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE); |
| 364 | #else | 365 | #else |
diff --git a/arch/sh/include/asm/unistd_32.h b/arch/sh/include/asm/unistd_32.h index f3fd1b9eb6b1..f18c4f9baf27 100644 --- a/arch/sh/include/asm/unistd_32.h +++ b/arch/sh/include/asm/unistd_32.h | |||
| @@ -345,8 +345,9 @@ | |||
| 345 | #define __NR_pwritev 334 | 345 | #define __NR_pwritev 334 |
| 346 | #define __NR_rt_tgsigqueueinfo 335 | 346 | #define __NR_rt_tgsigqueueinfo 335 |
| 347 | #define __NR_perf_event_open 336 | 347 | #define __NR_perf_event_open 336 |
| 348 | #define __NR_recvmmsg 337 | ||
| 348 | 349 | ||
| 349 | #define NR_syscalls 337 | 350 | #define NR_syscalls 338 |
| 350 | 351 | ||
| 351 | #ifdef __KERNEL__ | 352 | #ifdef __KERNEL__ |
| 352 | 353 | ||
diff --git a/arch/sh/include/asm/unistd_64.h b/arch/sh/include/asm/unistd_64.h index 343ce8f073ea..3e7645d11130 100644 --- a/arch/sh/include/asm/unistd_64.h +++ b/arch/sh/include/asm/unistd_64.h | |||
| @@ -385,10 +385,11 @@ | |||
| 385 | #define __NR_pwritev 362 | 385 | #define __NR_pwritev 362 |
| 386 | #define __NR_rt_tgsigqueueinfo 363 | 386 | #define __NR_rt_tgsigqueueinfo 363 |
| 387 | #define __NR_perf_event_open 364 | 387 | #define __NR_perf_event_open 364 |
| 388 | #define __NR_recvmmsg 365 | ||
| 388 | 389 | ||
| 389 | #ifdef __KERNEL__ | 390 | #ifdef __KERNEL__ |
| 390 | 391 | ||
| 391 | #define NR_syscalls 365 | 392 | #define NR_syscalls 366 |
| 392 | 393 | ||
| 393 | #define __ARCH_WANT_IPC_PARSE_VERSION | 394 | #define __ARCH_WANT_IPC_PARSE_VERSION |
| 394 | #define __ARCH_WANT_OLD_READDIR | 395 | #define __ARCH_WANT_OLD_READDIR |
diff --git a/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h b/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h index 174374e19547..484ef42c2fb5 100644 --- a/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h +++ b/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h | |||
| @@ -8,6 +8,8 @@ void kfr2r09_lcd_on(void *board_data); | |||
| 8 | void kfr2r09_lcd_off(void *board_data); | 8 | void kfr2r09_lcd_off(void *board_data); |
| 9 | int kfr2r09_lcd_setup(void *board_data, void *sys_ops_handle, | 9 | int kfr2r09_lcd_setup(void *board_data, void *sys_ops_handle, |
| 10 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); | 10 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); |
| 11 | void kfr2r09_lcd_start(void *board_data, void *sys_ops_handle, | ||
| 12 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); | ||
| 11 | #else | 13 | #else |
| 12 | static inline void kfr2r09_lcd_on(void *board_data) {} | 14 | static inline void kfr2r09_lcd_on(void *board_data) {} |
| 13 | static inline void kfr2r09_lcd_off(void *board_data) {} | 15 | static inline void kfr2r09_lcd_off(void *board_data) {} |
| @@ -16,6 +18,10 @@ static inline int kfr2r09_lcd_setup(void *board_data, void *sys_ops_handle, | |||
| 16 | { | 18 | { |
| 17 | return -ENODEV; | 19 | return -ENODEV; |
| 18 | } | 20 | } |
| 21 | static inline void kfr2r09_lcd_start(void *board_data, void *sys_ops_handle, | ||
| 22 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops) | ||
| 23 | { | ||
| 24 | } | ||
| 19 | #endif | 25 | #endif |
| 20 | 26 | ||
| 21 | #endif /* __ASM_SH_KFR2R09_H */ | 27 | #endif /* __ASM_SH_KFR2R09_H */ |
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile index 0471a3eb25ed..0d587da1ef12 100644 --- a/arch/sh/kernel/Makefile +++ b/arch/sh/kernel/Makefile | |||
| @@ -22,11 +22,10 @@ obj-y := debugtraps.o dma-nommu.o dumpstack.o \ | |||
| 22 | obj-y += cpu/ | 22 | obj-y += cpu/ |
| 23 | obj-$(CONFIG_VSYSCALL) += vsyscall/ | 23 | obj-$(CONFIG_VSYSCALL) += vsyscall/ |
| 24 | obj-$(CONFIG_SMP) += smp.o | 24 | obj-$(CONFIG_SMP) += smp.o |
| 25 | obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o | 25 | obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o early_printk.o |
| 26 | obj-$(CONFIG_KGDB) += kgdb.o | 26 | obj-$(CONFIG_KGDB) += kgdb.o |
| 27 | obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o | 27 | obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o |
| 28 | obj-$(CONFIG_MODULES) += sh_ksyms_$(BITS).o module.o | 28 | obj-$(CONFIG_MODULES) += sh_ksyms_$(BITS).o module.o |
| 29 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | ||
| 30 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o | 29 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o |
| 31 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | 30 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o |
| 32 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 31 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
diff --git a/arch/sh/kernel/cpu/irq/ipr.c b/arch/sh/kernel/cpu/irq/ipr.c index c1508a90fc6a..9282d965a1b6 100644 --- a/arch/sh/kernel/cpu/irq/ipr.c +++ b/arch/sh/kernel/cpu/irq/ipr.c | |||
| @@ -17,16 +17,17 @@ | |||
| 17 | * for more details. | 17 | * for more details. |
| 18 | */ | 18 | */ |
| 19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 20 | #include <linux/interrupt.h> | ||
| 21 | #include <linux/io.h> | ||
| 20 | #include <linux/irq.h> | 22 | #include <linux/irq.h> |
| 23 | #include <linux/kernel.h> | ||
| 21 | #include <linux/module.h> | 24 | #include <linux/module.h> |
| 22 | #include <linux/io.h> | ||
| 23 | #include <linux/interrupt.h> | ||
| 24 | #include <linux/topology.h> | 25 | #include <linux/topology.h> |
| 25 | 26 | ||
| 26 | static inline struct ipr_desc *get_ipr_desc(unsigned int irq) | 27 | static inline struct ipr_desc *get_ipr_desc(unsigned int irq) |
| 27 | { | 28 | { |
| 28 | struct irq_chip *chip = get_irq_chip(irq); | 29 | struct irq_chip *chip = get_irq_chip(irq); |
| 29 | return (void *)((char *)chip - offsetof(struct ipr_desc, chip)); | 30 | return container_of(chip, struct ipr_desc, chip); |
| 30 | } | 31 | } |
| 31 | 32 | ||
| 32 | static void disable_ipr_irq(unsigned int irq) | 33 | static void disable_ipr_irq(unsigned int irq) |
diff --git a/arch/sh/kernel/cpu/sh2/setup-sh7619.c b/arch/sh/kernel/cpu/sh2/setup-sh7619.c index 8555c05e8667..114c7cee7184 100644 --- a/arch/sh/kernel/cpu/sh2/setup-sh7619.c +++ b/arch/sh/kernel/cpu/sh2/setup-sh7619.c | |||
| @@ -59,32 +59,48 @@ static struct intc_prio_reg prio_registers[] __initdata = { | |||
| 59 | static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, NULL, | 59 | static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, NULL, |
| 60 | NULL, prio_registers, NULL); | 60 | NULL, prio_registers, NULL); |
| 61 | 61 | ||
| 62 | static struct plat_sci_port sci_platform_data[] = { | 62 | static struct plat_sci_port scif0_platform_data = { |
| 63 | { | 63 | .mapbase = 0xf8400000, |
| 64 | .mapbase = 0xf8400000, | 64 | .flags = UPF_BOOT_AUTOCONF, |
| 65 | .flags = UPF_BOOT_AUTOCONF, | 65 | .type = PORT_SCIF, |
| 66 | .type = PORT_SCIF, | 66 | .irqs = { 88, 88, 88, 88 }, |
| 67 | .irqs = { 88, 88, 88, 88 }, | 67 | }; |
| 68 | }, { | 68 | |
| 69 | .mapbase = 0xf8410000, | 69 | static struct platform_device scif0_device = { |
| 70 | .flags = UPF_BOOT_AUTOCONF, | 70 | .name = "sh-sci", |
| 71 | .type = PORT_SCIF, | 71 | .id = 0, |
| 72 | .irqs = { 92, 92, 92, 92 }, | 72 | .dev = { |
| 73 | }, { | 73 | .platform_data = &scif0_platform_data, |
| 74 | .mapbase = 0xf8420000, | 74 | }, |
| 75 | .flags = UPF_BOOT_AUTOCONF, | 75 | }; |
| 76 | .type = PORT_SCIF, | 76 | |
| 77 | .irqs = { 96, 96, 96, 96 }, | 77 | static struct plat_sci_port scif1_platform_data = { |
| 78 | }, { | 78 | .mapbase = 0xf8410000, |
| 79 | .flags = 0, | 79 | .flags = UPF_BOOT_AUTOCONF, |
| 80 | } | 80 | .type = PORT_SCIF, |
| 81 | }; | 81 | .irqs = { 92, 92, 92, 92 }, |
| 82 | 82 | }; | |
| 83 | static struct platform_device sci_device = { | 83 | |
| 84 | static struct platform_device scif1_device = { | ||
| 85 | .name = "sh-sci", | ||
| 86 | .id = 1, | ||
| 87 | .dev = { | ||
| 88 | .platform_data = &scif1_platform_data, | ||
| 89 | }, | ||
| 90 | }; | ||
| 91 | |||
| 92 | static struct plat_sci_port scif2_platform_data = { | ||
| 93 | .mapbase = 0xf8420000, | ||
| 94 | .flags = UPF_BOOT_AUTOCONF, | ||
| 95 | .type = PORT_SCIF, | ||
| 96 | .irqs = { 96, 96, 96, 96 }, | ||
| 97 | }; | ||
| 98 | |||
| 99 | static struct platform_device scif2_device = { | ||
| 84 | .name = "sh-sci", | 100 | .name = "sh-sci", |
| 85 | .id = -1, | 101 | .id = 2, |
| 86 | .dev = { | 102 | .dev = { |
| 87 | .platform_data = sci_platform_data, | 103 | .platform_data = &scif2_platform_data, |
| 88 | }, | 104 | }, |
| 89 | }; | 105 | }; |
| 90 | 106 | ||
| @@ -176,7 +192,9 @@ static struct platform_device cmt1_device = { | |||
| 176 | }; | 192 | }; |
| 177 | 193 | ||
| 178 | static struct platform_device *sh7619_devices[] __initdata = { | 194 | static struct platform_device *sh7619_devices[] __initdata = { |
| 179 | &sci_device, | 195 | &scif0_device, |
| 196 | &scif1_device, | ||
| 197 | &scif2_device, | ||
| 180 | ð_device, | 198 | ð_device, |
| 181 | &cmt0_device, | 199 | &cmt0_device, |
| 182 | &cmt1_device, | 200 | &cmt1_device, |
| @@ -195,6 +213,9 @@ void __init plat_irq_setup(void) | |||
| 195 | } | 213 | } |
| 196 | 214 | ||
| 197 | static struct platform_device *sh7619_early_devices[] __initdata = { | 215 | static struct platform_device *sh7619_early_devices[] __initdata = { |
| 216 | &scif0_device, | ||
| 217 | &scif1_device, | ||
| 218 | &scif2_device, | ||
| 198 | &cmt0_device, | 219 | &cmt0_device, |
| 199 | &cmt1_device, | 220 | &cmt1_device, |
| 200 | }; | 221 | }; |
diff --git a/arch/sh/kernel/cpu/sh2a/setup-mxg.c b/arch/sh/kernel/cpu/sh2a/setup-mxg.c index b67376445315..8f669dc9b0da 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-mxg.c +++ b/arch/sh/kernel/cpu/sh2a/setup-mxg.c | |||
| @@ -207,27 +207,23 @@ static struct platform_device mtu2_2_device = { | |||
| 207 | .num_resources = ARRAY_SIZE(mtu2_2_resources), | 207 | .num_resources = ARRAY_SIZE(mtu2_2_resources), |
| 208 | }; | 208 | }; |
| 209 | 209 | ||
| 210 | static struct plat_sci_port sci_platform_data[] = { | 210 | static struct plat_sci_port scif0_platform_data = { |
| 211 | { | 211 | .mapbase = 0xff804000, |
| 212 | .mapbase = 0xff804000, | 212 | .flags = UPF_BOOT_AUTOCONF, |
| 213 | .flags = UPF_BOOT_AUTOCONF, | 213 | .type = PORT_SCIF, |
| 214 | .type = PORT_SCIF, | 214 | .irqs = { 220, 220, 220, 220 }, |
| 215 | .irqs = { 220, 220, 220, 220 }, | ||
| 216 | }, { | ||
| 217 | .flags = 0, | ||
| 218 | } | ||
| 219 | }; | 215 | }; |
| 220 | 216 | ||
| 221 | static struct platform_device sci_device = { | 217 | static struct platform_device scif0_device = { |
| 222 | .name = "sh-sci", | 218 | .name = "sh-sci", |
| 223 | .id = -1, | 219 | .id = 0, |
| 224 | .dev = { | 220 | .dev = { |
| 225 | .platform_data = sci_platform_data, | 221 | .platform_data = &scif0_platform_data, |
| 226 | }, | 222 | }, |
| 227 | }; | 223 | }; |
| 228 | 224 | ||
| 229 | static struct platform_device *mxg_devices[] __initdata = { | 225 | static struct platform_device *mxg_devices[] __initdata = { |
| 230 | &sci_device, | 226 | &scif0_device, |
| 231 | &mtu2_0_device, | 227 | &mtu2_0_device, |
| 232 | &mtu2_1_device, | 228 | &mtu2_1_device, |
| 233 | &mtu2_2_device, | 229 | &mtu2_2_device, |
| @@ -246,6 +242,7 @@ void __init plat_irq_setup(void) | |||
| 246 | } | 242 | } |
| 247 | 243 | ||
| 248 | static struct platform_device *mxg_early_devices[] __initdata = { | 244 | static struct platform_device *mxg_early_devices[] __initdata = { |
| 245 | &scif0_device, | ||
| 249 | &mtu2_0_device, | 246 | &mtu2_0_device, |
| 250 | &mtu2_1_device, | 247 | &mtu2_1_device, |
| 251 | &mtu2_2_device, | 248 | &mtu2_2_device, |
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c index fbde5b75deb9..4ccfeb59eb1a 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c +++ b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c | |||
| @@ -177,57 +177,123 @@ static struct intc_mask_reg mask_registers[] __initdata = { | |||
| 177 | static DECLARE_INTC_DESC(intc_desc, "sh7201", vectors, groups, | 177 | static DECLARE_INTC_DESC(intc_desc, "sh7201", vectors, groups, |
| 178 | mask_registers, prio_registers, NULL); | 178 | mask_registers, prio_registers, NULL); |
| 179 | 179 | ||
| 180 | static struct plat_sci_port sci_platform_data[] = { | 180 | static struct plat_sci_port scif0_platform_data = { |
| 181 | { | 181 | .mapbase = 0xfffe8000, |
| 182 | .mapbase = 0xfffe8000, | 182 | .flags = UPF_BOOT_AUTOCONF, |
| 183 | .flags = UPF_BOOT_AUTOCONF, | 183 | .type = PORT_SCIF, |
| 184 | .type = PORT_SCIF, | 184 | .irqs = { 180, 180, 180, 180 } |
| 185 | .irqs = { 180, 180, 180, 180 } | 185 | }; |
| 186 | }, { | 186 | |
| 187 | .mapbase = 0xfffe8800, | 187 | static struct platform_device scif0_device = { |
| 188 | .flags = UPF_BOOT_AUTOCONF, | ||
| 189 | .type = PORT_SCIF, | ||
| 190 | .irqs = { 184, 184, 184, 184 } | ||
| 191 | }, { | ||
| 192 | .mapbase = 0xfffe9000, | ||
| 193 | .flags = UPF_BOOT_AUTOCONF, | ||
| 194 | .type = PORT_SCIF, | ||
| 195 | .irqs = { 188, 188, 188, 188 } | ||
| 196 | }, { | ||
| 197 | .mapbase = 0xfffe9800, | ||
| 198 | .flags = UPF_BOOT_AUTOCONF, | ||
| 199 | .type = PORT_SCIF, | ||
| 200 | .irqs = { 192, 192, 192, 192 } | ||
| 201 | }, { | ||
| 202 | .mapbase = 0xfffea000, | ||
| 203 | .flags = UPF_BOOT_AUTOCONF, | ||
| 204 | .type = PORT_SCIF, | ||
| 205 | .irqs = { 196, 196, 196, 196 } | ||
| 206 | }, { | ||
| 207 | .mapbase = 0xfffea800, | ||
| 208 | .flags = UPF_BOOT_AUTOCONF, | ||
| 209 | .type = PORT_SCIF, | ||
| 210 | .irqs = { 200, 200, 200, 200 } | ||
| 211 | }, { | ||
| 212 | .mapbase = 0xfffeb000, | ||
| 213 | .flags = UPF_BOOT_AUTOCONF, | ||
| 214 | .type = PORT_SCIF, | ||
| 215 | .irqs = { 204, 204, 204, 204 } | ||
| 216 | }, { | ||
| 217 | .mapbase = 0xfffeb800, | ||
| 218 | .flags = UPF_BOOT_AUTOCONF, | ||
| 219 | .type = PORT_SCIF, | ||
| 220 | .irqs = { 208, 208, 208, 208 } | ||
| 221 | }, { | ||
| 222 | .flags = 0, | ||
| 223 | } | ||
| 224 | }; | ||
| 225 | |||
| 226 | static struct platform_device sci_device = { | ||
| 227 | .name = "sh-sci", | 188 | .name = "sh-sci", |
| 228 | .id = -1, | 189 | .id = 0, |
| 190 | .dev = { | ||
| 191 | .platform_data = &scif0_platform_data, | ||
| 192 | }, | ||
| 193 | }; | ||
| 194 | |||
| 195 | static struct plat_sci_port scif1_platform_data = { | ||
| 196 | .mapbase = 0xfffe8800, | ||
| 197 | .flags = UPF_BOOT_AUTOCONF, | ||
| 198 | .type = PORT_SCIF, | ||
| 199 | .irqs = { 184, 184, 184, 184 } | ||
| 200 | }; | ||
| 201 | |||
| 202 | static struct platform_device scif1_device = { | ||
| 203 | .name = "sh-sci", | ||
| 204 | .id = 1, | ||
| 205 | .dev = { | ||
| 206 | .platform_data = &scif1_platform_data, | ||
| 207 | }, | ||
| 208 | }; | ||
| 209 | |||
| 210 | static struct plat_sci_port scif2_platform_data = { | ||
| 211 | .mapbase = 0xfffe9000, | ||
| 212 | .flags = UPF_BOOT_AUTOCONF, | ||
| 213 | .type = PORT_SCIF, | ||
| 214 | .irqs = { 188, 188, 188, 188 } | ||
| 215 | }; | ||
| 216 | |||
| 217 | static struct platform_device scif2_device = { | ||
| 218 | .name = "sh-sci", | ||
| 219 | .id = 2, | ||
| 220 | .dev = { | ||
| 221 | .platform_data = &scif2_platform_data, | ||
| 222 | }, | ||
| 223 | }; | ||
| 224 | |||
| 225 | static struct plat_sci_port scif3_platform_data = { | ||
| 226 | .mapbase = 0xfffe9800, | ||
| 227 | .flags = UPF_BOOT_AUTOCONF, | ||
| 228 | .type = PORT_SCIF, | ||
| 229 | .irqs = { 192, 192, 192, 192 } | ||
| 230 | }; | ||
| 231 | |||
| 232 | static struct platform_device scif3_device = { | ||
| 233 | .name = "sh-sci", | ||
| 234 | .id = 3, | ||
| 235 | .dev = { | ||
| 236 | .platform_data = &scif3_platform_data, | ||
| 237 | }, | ||
| 238 | }; | ||
| 239 | |||
| 240 | static struct plat_sci_port scif4_platform_data = { | ||
| 241 | .mapbase = 0xfffea000, | ||
| 242 | .flags = UPF_BOOT_AUTOCONF, | ||
| 243 | .type = PORT_SCIF, | ||
| 244 | .irqs = { 196, 196, 196, 196 } | ||
| 245 | }; | ||
| 246 | |||
| 247 | static struct platform_device scif4_device = { | ||
| 248 | .name = "sh-sci", | ||
| 249 | .id = 4, | ||
| 250 | .dev = { | ||
| 251 | .platform_data = &scif4_platform_data, | ||
| 252 | }, | ||
| 253 | }; | ||
| 254 | |||
| 255 | static struct plat_sci_port scif5_platform_data = { | ||
| 256 | .mapbase = 0xfffea800, | ||
| 257 | .flags = UPF_BOOT_AUTOCONF, | ||
| 258 | .type = PORT_SCIF, | ||
| 259 | .irqs = { 200, 200, 200, 200 } | ||
| 260 | }; | ||
| 261 | |||
| 262 | static struct platform_device scif5_device = { | ||
| 263 | .name = "sh-sci", | ||
| 264 | .id = 5, | ||
| 265 | .dev = { | ||
| 266 | .platform_data = &scif5_platform_data, | ||
| 267 | }, | ||
| 268 | }; | ||
| 269 | |||
| 270 | static struct plat_sci_port scif6_platform_data = { | ||
| 271 | .mapbase = 0xfffeb000, | ||
| 272 | .flags = UPF_BOOT_AUTOCONF, | ||
| 273 | .type = PORT_SCIF, | ||
| 274 | .irqs = { 204, 204, 204, 204 } | ||
| 275 | }; | ||
| 276 | |||
| 277 | static struct platform_device scif6_device = { | ||
| 278 | .name = "sh-sci", | ||
| 279 | .id = 6, | ||
| 280 | .dev = { | ||
| 281 | .platform_data = &scif6_platform_data, | ||
| 282 | }, | ||
| 283 | }; | ||
| 284 | |||
| 285 | static struct plat_sci_port scif7_platform_data = { | ||
| 286 | .mapbase = 0xfffeb800, | ||
| 287 | .flags = UPF_BOOT_AUTOCONF, | ||
| 288 | .type = PORT_SCIF, | ||
| 289 | .irqs = { 208, 208, 208, 208 } | ||
| 290 | }; | ||
| 291 | |||
| 292 | static struct platform_device scif7_device = { | ||
| 293 | .name = "sh-sci", | ||
| 294 | .id = 7, | ||
| 229 | .dev = { | 295 | .dev = { |
| 230 | .platform_data = sci_platform_data, | 296 | .platform_data = &scif7_platform_data, |
| 231 | }, | 297 | }, |
| 232 | }; | 298 | }; |
| 233 | 299 | ||
| @@ -345,7 +411,14 @@ static struct platform_device mtu2_2_device = { | |||
| 345 | }; | 411 | }; |
| 346 | 412 | ||
| 347 | static struct platform_device *sh7201_devices[] __initdata = { | 413 | static struct platform_device *sh7201_devices[] __initdata = { |
| 348 | &sci_device, | 414 | &scif0_device, |
| 415 | &scif1_device, | ||
| 416 | &scif2_device, | ||
| 417 | &scif3_device, | ||
| 418 | &scif4_device, | ||
| 419 | &scif5_device, | ||
| 420 | &scif6_device, | ||
| 421 | &scif7_device, | ||
| 349 | &rtc_device, | 422 | &rtc_device, |
| 350 | &mtu2_0_device, | 423 | &mtu2_0_device, |
| 351 | &mtu2_1_device, | 424 | &mtu2_1_device, |
| @@ -365,6 +438,14 @@ void __init plat_irq_setup(void) | |||
| 365 | } | 438 | } |
| 366 | 439 | ||
| 367 | static struct platform_device *sh7201_early_devices[] __initdata = { | 440 | static struct platform_device *sh7201_early_devices[] __initdata = { |
| 441 | &scif0_device, | ||
| 442 | &scif1_device, | ||
| 443 | &scif2_device, | ||
| 444 | &scif3_device, | ||
| 445 | &scif4_device, | ||
| 446 | &scif5_device, | ||
| 447 | &scif6_device, | ||
| 448 | &scif7_device, | ||
| 368 | &mtu2_0_device, | 449 | &mtu2_0_device, |
| 369 | &mtu2_1_device, | 450 | &mtu2_1_device, |
| 370 | &mtu2_2_device, | 451 | &mtu2_2_device, |
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c index d3fd536c9a84..3136966cc9b3 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c +++ b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c | |||
| @@ -173,37 +173,63 @@ static struct intc_mask_reg mask_registers[] __initdata = { | |||
| 173 | static DECLARE_INTC_DESC(intc_desc, "sh7203", vectors, groups, | 173 | static DECLARE_INTC_DESC(intc_desc, "sh7203", vectors, groups, |
| 174 | mask_registers, prio_registers, NULL); | 174 | mask_registers, prio_registers, NULL); |
| 175 | 175 | ||
| 176 | static struct plat_sci_port sci_platform_data[] = { | 176 | static struct plat_sci_port scif0_platform_data = { |
| 177 | { | 177 | .mapbase = 0xfffe8000, |
| 178 | .mapbase = 0xfffe8000, | 178 | .flags = UPF_BOOT_AUTOCONF, |
| 179 | .flags = UPF_BOOT_AUTOCONF, | 179 | .type = PORT_SCIF, |
| 180 | .type = PORT_SCIF, | 180 | .irqs = { 192, 192, 192, 192 }, |
| 181 | .irqs = { 192, 192, 192, 192 }, | ||
| 182 | }, { | ||
| 183 | .mapbase = 0xfffe8800, | ||
| 184 | .flags = UPF_BOOT_AUTOCONF, | ||
| 185 | .type = PORT_SCIF, | ||
| 186 | .irqs = { 196, 196, 196, 196 }, | ||
| 187 | }, { | ||
| 188 | .mapbase = 0xfffe9000, | ||
| 189 | .flags = UPF_BOOT_AUTOCONF, | ||
| 190 | .type = PORT_SCIF, | ||
| 191 | .irqs = { 200, 200, 200, 200 }, | ||
| 192 | }, { | ||
| 193 | .mapbase = 0xfffe9800, | ||
| 194 | .flags = UPF_BOOT_AUTOCONF, | ||
| 195 | .type = PORT_SCIF, | ||
| 196 | .irqs = { 204, 204, 204, 204 }, | ||
| 197 | }, { | ||
| 198 | .flags = 0, | ||
| 199 | } | ||
| 200 | }; | 181 | }; |
| 201 | 182 | ||
| 202 | static struct platform_device sci_device = { | 183 | static struct platform_device scif0_device = { |
| 203 | .name = "sh-sci", | 184 | .name = "sh-sci", |
| 204 | .id = -1, | 185 | .id = 0, |
| 186 | .dev = { | ||
| 187 | .platform_data = &scif0_platform_data, | ||
| 188 | }, | ||
| 189 | }; | ||
| 190 | |||
| 191 | static struct plat_sci_port scif1_platform_data = { | ||
| 192 | .mapbase = 0xfffe8800, | ||
| 193 | .flags = UPF_BOOT_AUTOCONF, | ||
| 194 | .type = PORT_SCIF, | ||
| 195 | .irqs = { 196, 196, 196, 196 }, | ||
| 196 | }; | ||
| 197 | |||
| 198 | static struct platform_device scif1_device = { | ||
| 199 | .name = "sh-sci", | ||
| 200 | .id = 1, | ||
| 201 | .dev = { | ||
| 202 | .platform_data = &scif1_platform_data, | ||
| 203 | }, | ||
| 204 | }; | ||
| 205 | |||
| 206 | static struct plat_sci_port scif2_platform_data = { | ||
| 207 | .mapbase = 0xfffe9000, | ||
| 208 | .flags = UPF_BOOT_AUTOCONF, | ||
| 209 | .type = PORT_SCIF, | ||
| 210 | .irqs = { 200, 200, 200, 200 }, | ||
| 211 | }; | ||
| 212 | |||
| 213 | static struct platform_device scif2_device = { | ||
| 214 | .name = "sh-sci", | ||
| 215 | .id = 2, | ||
| 216 | .dev = { | ||
| 217 | .platform_data = &scif2_platform_data, | ||
| 218 | }, | ||
| 219 | }; | ||
| 220 | |||
| 221 | static struct plat_sci_port scif3_platform_data = { | ||
| 222 | .mapbase = 0xfffe9800, | ||
| 223 | .flags = UPF_BOOT_AUTOCONF, | ||
| 224 | .type = PORT_SCIF, | ||
| 225 | .irqs = { 204, 204, 204, 204 }, | ||
| 226 | }; | ||
| 227 | |||
| 228 | static struct platform_device scif3_device = { | ||
| 229 | .name = "sh-sci", | ||
| 230 | .id = 3, | ||
| 205 | .dev = { | 231 | .dev = { |
| 206 | .platform_data = sci_platform_data, | 232 | .platform_data = &scif3_platform_data, |
| 207 | }, | 233 | }, |
| 208 | }; | 234 | }; |
| 209 | 235 | ||
| @@ -354,7 +380,10 @@ static struct platform_device rtc_device = { | |||
| 354 | }; | 380 | }; |
| 355 | 381 | ||
| 356 | static struct platform_device *sh7203_devices[] __initdata = { | 382 | static struct platform_device *sh7203_devices[] __initdata = { |
| 357 | &sci_device, | 383 | &scif0_device, |
| 384 | &scif1_device, | ||
| 385 | &scif2_device, | ||
| 386 | &scif3_device, | ||
| 358 | &cmt0_device, | 387 | &cmt0_device, |
| 359 | &cmt1_device, | 388 | &cmt1_device, |
| 360 | &mtu2_0_device, | 389 | &mtu2_0_device, |
| @@ -375,6 +404,10 @@ void __init plat_irq_setup(void) | |||
| 375 | } | 404 | } |
| 376 | 405 | ||
| 377 | static struct platform_device *sh7203_early_devices[] __initdata = { | 406 | static struct platform_device *sh7203_early_devices[] __initdata = { |
| 407 | &scif0_device, | ||
| 408 | &scif1_device, | ||
| 409 | &scif2_device, | ||
| 410 | &scif3_device, | ||
| 378 | &cmt0_device, | 411 | &cmt0_device, |
| 379 | &cmt1_device, | 412 | &cmt1_device, |
| 380 | &mtu2_0_device, | 413 | &mtu2_0_device, |
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c index a9ccc5e8d9e9..064873585a8b 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c +++ b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c | |||
| @@ -133,37 +133,63 @@ static struct intc_mask_reg mask_registers[] __initdata = { | |||
| 133 | static DECLARE_INTC_DESC(intc_desc, "sh7206", vectors, groups, | 133 | static DECLARE_INTC_DESC(intc_desc, "sh7206", vectors, groups, |
| 134 | mask_registers, prio_registers, NULL); | 134 | mask_registers, prio_registers, NULL); |
| 135 | 135 | ||
| 136 | static struct plat_sci_port sci_platform_data[] = { | 136 | static struct plat_sci_port scif0_platform_data = { |
| 137 | { | 137 | .mapbase = 0xfffe8000, |
| 138 | .mapbase = 0xfffe8000, | 138 | .flags = UPF_BOOT_AUTOCONF, |
| 139 | .flags = UPF_BOOT_AUTOCONF, | 139 | .type = PORT_SCIF, |
| 140 | .type = PORT_SCIF, | 140 | .irqs = { 240, 240, 240, 240 }, |
| 141 | .irqs = { 240, 240, 240, 240 }, | ||
| 142 | }, { | ||
| 143 | .mapbase = 0xfffe8800, | ||
| 144 | .flags = UPF_BOOT_AUTOCONF, | ||
| 145 | .type = PORT_SCIF, | ||
| 146 | .irqs = { 244, 244, 244, 244 }, | ||
| 147 | }, { | ||
| 148 | .mapbase = 0xfffe9000, | ||
| 149 | .flags = UPF_BOOT_AUTOCONF, | ||
| 150 | .type = PORT_SCIF, | ||
| 151 | .irqs = { 248, 248, 248, 248 }, | ||
| 152 | }, { | ||
| 153 | .mapbase = 0xfffe9800, | ||
| 154 | .flags = UPF_BOOT_AUTOCONF, | ||
| 155 | .type = PORT_SCIF, | ||
| 156 | .irqs = { 252, 252, 252, 252 }, | ||
| 157 | }, { | ||
| 158 | .flags = 0, | ||
| 159 | } | ||
| 160 | }; | 141 | }; |
| 161 | 142 | ||
| 162 | static struct platform_device sci_device = { | 143 | static struct platform_device scif0_device = { |
| 163 | .name = "sh-sci", | 144 | .name = "sh-sci", |
| 164 | .id = -1, | 145 | .id = 0, |
| 146 | .dev = { | ||
| 147 | .platform_data = &scif0_platform_data, | ||
| 148 | }, | ||
| 149 | }; | ||
| 150 | |||
| 151 | static struct plat_sci_port scif1_platform_data = { | ||
| 152 | .mapbase = 0xfffe8800, | ||
| 153 | .flags = UPF_BOOT_AUTOCONF, | ||
| 154 | .type = PORT_SCIF, | ||
| 155 | .irqs = { 244, 244, 244, 244 }, | ||
| 156 | }; | ||
| 157 | |||
| 158 | static struct platform_device scif1_device = { | ||
| 159 | .name = "sh-sci", | ||
| 160 | .id = 1, | ||
| 161 | .dev = { | ||
| 162 | .platform_data = &scif1_platform_data, | ||
| 163 | }, | ||
| 164 | }; | ||
| 165 | |||
| 166 | static struct plat_sci_port scif2_platform_data = { | ||
| 167 | .mapbase = 0xfffe9000, | ||
| 168 | .flags = UPF_BOOT_AUTOCONF, | ||
| 169 | .type = PORT_SCIF, | ||
| 170 | .irqs = { 248, 248, 248, 248 }, | ||
| 171 | }; | ||
| 172 | |||
| 173 | static struct platform_device scif2_device = { | ||
| 174 | .name = "sh-sci", | ||
| 175 | .id = 2, | ||
| 176 | .dev = { | ||
| 177 | .platform_data = &scif2_platform_data, | ||
| 178 | }, | ||
| 179 | }; | ||
| 180 | |||
| 181 | static struct plat_sci_port scif3_platform_data = { | ||
| 182 | .mapbase = 0xfffe9800, | ||
| 183 | .flags = UPF_BOOT_AUTOCONF, | ||
| 184 | .type = PORT_SCIF, | ||
| 185 | .irqs = { 252, 252, 252, 252 }, | ||
| 186 | }; | ||
| 187 | |||
| 188 | static struct platform_device scif3_device = { | ||
| 189 | .name = "sh-sci", | ||
| 190 | .id = 3, | ||
| 165 | .dev = { | 191 | .dev = { |
| 166 | .platform_data = sci_platform_data, | 192 | .platform_data = &scif3_platform_data, |
| 167 | }, | 193 | }, |
| 168 | }; | 194 | }; |
| 169 | 195 | ||
| @@ -325,7 +351,10 @@ static struct platform_device mtu2_2_device = { | |||
| 325 | }; | 351 | }; |
| 326 | 352 | ||
| 327 | static struct platform_device *sh7206_devices[] __initdata = { | 353 | static struct platform_device *sh7206_devices[] __initdata = { |
| 328 | &sci_device, | 354 | &scif0_device, |
| 355 | &scif1_device, | ||
| 356 | &scif2_device, | ||
| 357 | &scif3_device, | ||
| 329 | &cmt0_device, | 358 | &cmt0_device, |
| 330 | &cmt1_device, | 359 | &cmt1_device, |
| 331 | &mtu2_0_device, | 360 | &mtu2_0_device, |
| @@ -346,6 +375,10 @@ void __init plat_irq_setup(void) | |||
| 346 | } | 375 | } |
| 347 | 376 | ||
| 348 | static struct platform_device *sh7206_early_devices[] __initdata = { | 377 | static struct platform_device *sh7206_early_devices[] __initdata = { |
| 378 | &scif0_device, | ||
| 379 | &scif1_device, | ||
| 380 | &scif2_device, | ||
| 381 | &scif3_device, | ||
| 349 | &cmt0_device, | 382 | &cmt0_device, |
| 350 | &cmt1_device, | 383 | &cmt1_device, |
| 351 | &mtu2_0_device, | 384 | &mtu2_0_device, |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c index c23105983878..7b892d60e3a0 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c | |||
| @@ -67,27 +67,33 @@ static struct intc_prio_reg prio_registers[] __initdata = { | |||
| 67 | static DECLARE_INTC_DESC(intc_desc, "sh7705", vectors, NULL, | 67 | static DECLARE_INTC_DESC(intc_desc, "sh7705", vectors, NULL, |
| 68 | NULL, prio_registers, NULL); | 68 | NULL, prio_registers, NULL); |
| 69 | 69 | ||
| 70 | static struct plat_sci_port sci_platform_data[] = { | 70 | static struct plat_sci_port scif0_platform_data = { |
| 71 | { | 71 | .mapbase = 0xa4410000, |
| 72 | .mapbase = 0xa4410000, | 72 | .flags = UPF_BOOT_AUTOCONF, |
| 73 | .flags = UPF_BOOT_AUTOCONF, | 73 | .type = PORT_SCIF, |
| 74 | .type = PORT_SCIF, | 74 | .irqs = { 56, 56, 56 }, |
| 75 | .irqs = { 56, 56, 56 }, | 75 | }; |
| 76 | }, { | 76 | |
| 77 | .mapbase = 0xa4400000, | 77 | static struct platform_device scif0_device = { |
| 78 | .flags = UPF_BOOT_AUTOCONF, | ||
| 79 | .type = PORT_SCIF, | ||
| 80 | .irqs = { 52, 52, 52 }, | ||
| 81 | }, { | ||
| 82 | .flags = 0, | ||
| 83 | } | ||
| 84 | }; | ||
| 85 | |||
| 86 | static struct platform_device sci_device = { | ||
| 87 | .name = "sh-sci", | 78 | .name = "sh-sci", |
| 88 | .id = -1, | 79 | .id = 0, |
| 80 | .dev = { | ||
| 81 | .platform_data = &scif0_platform_data, | ||
| 82 | }, | ||
| 83 | }; | ||
| 84 | |||
| 85 | static struct plat_sci_port scif1_platform_data = { | ||
| 86 | .mapbase = 0xa4400000, | ||
| 87 | .flags = UPF_BOOT_AUTOCONF, | ||
| 88 | .type = PORT_SCIF, | ||
| 89 | .irqs = { 52, 52, 52 }, | ||
| 90 | }; | ||
| 91 | |||
| 92 | static struct platform_device scif1_device = { | ||
| 93 | .name = "sh-sci", | ||
| 94 | .id = 1, | ||
| 89 | .dev = { | 95 | .dev = { |
| 90 | .platform_data = sci_platform_data, | 96 | .platform_data = &scif1_platform_data, |
| 91 | }, | 97 | }, |
| 92 | }; | 98 | }; |
| 93 | 99 | ||
| @@ -210,10 +216,11 @@ static struct platform_device tmu2_device = { | |||
| 210 | }; | 216 | }; |
| 211 | 217 | ||
| 212 | static struct platform_device *sh7705_devices[] __initdata = { | 218 | static struct platform_device *sh7705_devices[] __initdata = { |
| 219 | &scif0_device, | ||
| 220 | &scif1_device, | ||
| 213 | &tmu0_device, | 221 | &tmu0_device, |
| 214 | &tmu1_device, | 222 | &tmu1_device, |
| 215 | &tmu2_device, | 223 | &tmu2_device, |
| 216 | &sci_device, | ||
| 217 | &rtc_device, | 224 | &rtc_device, |
| 218 | }; | 225 | }; |
| 219 | 226 | ||
| @@ -225,6 +232,8 @@ static int __init sh7705_devices_setup(void) | |||
| 225 | arch_initcall(sh7705_devices_setup); | 232 | arch_initcall(sh7705_devices_setup); |
| 226 | 233 | ||
| 227 | static struct platform_device *sh7705_early_devices[] __initdata = { | 234 | static struct platform_device *sh7705_early_devices[] __initdata = { |
| 235 | &scif0_device, | ||
| 236 | &scif1_device, | ||
| 228 | &tmu0_device, | 237 | &tmu0_device, |
| 229 | &tmu1_device, | 238 | &tmu1_device, |
| 230 | &tmu2_device, | 239 | &tmu2_device, |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c index 347ab35d0697..bc0c4f68c7c7 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c | |||
| @@ -106,44 +106,55 @@ static struct platform_device rtc_device = { | |||
| 106 | .resource = rtc_resources, | 106 | .resource = rtc_resources, |
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | static struct plat_sci_port sci_platform_data[] = { | 109 | static struct plat_sci_port scif0_platform_data = { |
| 110 | { | 110 | .mapbase = 0xfffffe80, |
| 111 | .mapbase = 0xfffffe80, | 111 | .flags = UPF_BOOT_AUTOCONF, |
| 112 | .flags = UPF_BOOT_AUTOCONF, | 112 | .type = PORT_SCI, |
| 113 | .type = PORT_SCI, | 113 | .irqs = { 23, 23, 23, 0 }, |
| 114 | .irqs = { 23, 23, 23, 0 }, | 114 | }; |
| 115 | |||
| 116 | static struct platform_device scif0_device = { | ||
| 117 | .name = "sh-sci", | ||
| 118 | .id = 0, | ||
| 119 | .dev = { | ||
| 120 | .platform_data = &scif0_platform_data, | ||
| 115 | }, | 121 | }, |
| 122 | }; | ||
| 116 | #if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ | 123 | #if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ |
| 117 | defined(CONFIG_CPU_SUBTYPE_SH7707) || \ | 124 | defined(CONFIG_CPU_SUBTYPE_SH7707) || \ |
| 118 | defined(CONFIG_CPU_SUBTYPE_SH7709) | 125 | defined(CONFIG_CPU_SUBTYPE_SH7709) |
| 119 | { | 126 | static struct plat_sci_port scif1_platform_data = { |
| 120 | .mapbase = 0xa4000150, | 127 | .mapbase = 0xa4000150, |
| 121 | .flags = UPF_BOOT_AUTOCONF, | 128 | .flags = UPF_BOOT_AUTOCONF, |
| 122 | .type = PORT_SCIF, | 129 | .type = PORT_SCIF, |
| 123 | .irqs = { 56, 56, 56, 56 }, | 130 | .irqs = { 56, 56, 56, 56 }, |
| 131 | }; | ||
| 132 | |||
| 133 | static struct platform_device scif1_device = { | ||
| 134 | .name = "sh-sci", | ||
| 135 | .id = 1, | ||
| 136 | .dev = { | ||
| 137 | .platform_data = &scif1_platform_data, | ||
| 124 | }, | 138 | }, |
| 139 | }; | ||
| 125 | #endif | 140 | #endif |
| 126 | #if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ | 141 | #if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ |
| 127 | defined(CONFIG_CPU_SUBTYPE_SH7709) | 142 | defined(CONFIG_CPU_SUBTYPE_SH7709) |
| 128 | { | 143 | static struct plat_sci_port scif2_platform_data = { |
| 129 | .mapbase = 0xa4000140, | 144 | .mapbase = 0xa4000140, |
| 130 | .flags = UPF_BOOT_AUTOCONF, | 145 | .flags = UPF_BOOT_AUTOCONF, |
| 131 | .type = PORT_IRDA, | 146 | .type = PORT_IRDA, |
| 132 | .irqs = { 52, 52, 52, 52 }, | 147 | .irqs = { 52, 52, 52, 52 }, |
| 133 | }, | ||
| 134 | #endif | ||
| 135 | { | ||
| 136 | .flags = 0, | ||
| 137 | } | ||
| 138 | }; | 148 | }; |
| 139 | 149 | ||
| 140 | static struct platform_device sci_device = { | 150 | static struct platform_device scif2_device = { |
| 141 | .name = "sh-sci", | 151 | .name = "sh-sci", |
| 142 | .id = -1, | 152 | .id = 2, |
| 143 | .dev = { | 153 | .dev = { |
| 144 | .platform_data = sci_platform_data, | 154 | .platform_data = &scif2_platform_data, |
| 145 | }, | 155 | }, |
| 146 | }; | 156 | }; |
| 157 | #endif | ||
| 147 | 158 | ||
| 148 | static struct sh_timer_config tmu0_platform_data = { | 159 | static struct sh_timer_config tmu0_platform_data = { |
| 149 | .name = "TMU0", | 160 | .name = "TMU0", |
| @@ -238,10 +249,19 @@ static struct platform_device tmu2_device = { | |||
| 238 | }; | 249 | }; |
| 239 | 250 | ||
| 240 | static struct platform_device *sh770x_devices[] __initdata = { | 251 | static struct platform_device *sh770x_devices[] __initdata = { |
| 252 | &scif0_device, | ||
| 253 | #if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ | ||
| 254 | defined(CONFIG_CPU_SUBTYPE_SH7707) || \ | ||
| 255 | defined(CONFIG_CPU_SUBTYPE_SH7709) | ||
| 256 | &scif1_device, | ||
| 257 | #endif | ||
| 258 | #if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ | ||
| 259 | defined(CONFIG_CPU_SUBTYPE_SH7709) | ||
| 260 | &scif2_device, | ||
| 261 | #endif | ||
| 241 | &tmu0_device, | 262 | &tmu0_device, |
| 242 | &tmu1_device, | 263 | &tmu1_device, |
| 243 | &tmu2_device, | 264 | &tmu2_device, |
| 244 | &sci_device, | ||
| 245 | &rtc_device, | 265 | &rtc_device, |
| 246 | }; | 266 | }; |
| 247 | 267 | ||
| @@ -253,6 +273,16 @@ static int __init sh770x_devices_setup(void) | |||
| 253 | arch_initcall(sh770x_devices_setup); | 273 | arch_initcall(sh770x_devices_setup); |
| 254 | 274 | ||
| 255 | static struct platform_device *sh770x_early_devices[] __initdata = { | 275 | static struct platform_device *sh770x_early_devices[] __initdata = { |
| 276 | &scif0_device, | ||
| 277 | #if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ | ||
| 278 | defined(CONFIG_CPU_SUBTYPE_SH7707) || \ | ||
| 279 | defined(CONFIG_CPU_SUBTYPE_SH7709) | ||
| 280 | &scif1_device, | ||
| 281 | #endif | ||
| 282 | #if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ | ||
| 283 | defined(CONFIG_CPU_SUBTYPE_SH7709) | ||
| 284 | &scif2_device, | ||
| 285 | #endif | ||
| 256 | &tmu0_device, | 286 | &tmu0_device, |
| 257 | &tmu1_device, | 287 | &tmu1_device, |
| 258 | &tmu2_device, | 288 | &tmu2_device, |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c index 717e90ae1097..0845a3ad006d 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c | |||
| @@ -96,28 +96,33 @@ static struct platform_device rtc_device = { | |||
| 96 | }, | 96 | }, |
| 97 | }; | 97 | }; |
| 98 | 98 | ||
| 99 | static struct plat_sci_port sci_platform_data[] = { | 99 | static struct plat_sci_port scif0_platform_data = { |
| 100 | { | 100 | .mapbase = 0xa4400000, |
| 101 | .mapbase = 0xa4400000, | 101 | .flags = UPF_BOOT_AUTOCONF, |
| 102 | .flags = UPF_BOOT_AUTOCONF, | 102 | .type = PORT_SCIF, |
| 103 | .type = PORT_SCIF, | 103 | .irqs = { 52, 52, 52, 52 }, |
| 104 | .irqs = { 52, 52, 52, 52 }, | 104 | }; |
| 105 | }, { | 105 | |
| 106 | .mapbase = 0xa4410000, | 106 | static struct platform_device scif0_device = { |
| 107 | .flags = UPF_BOOT_AUTOCONF, | ||
| 108 | .type = PORT_SCIF, | ||
| 109 | .irqs = { 56, 56, 56, 56 }, | ||
| 110 | }, { | ||
| 111 | |||
| 112 | .flags = 0, | ||
| 113 | } | ||
| 114 | }; | ||
| 115 | |||
| 116 | static struct platform_device sci_device = { | ||
| 117 | .name = "sh-sci", | 107 | .name = "sh-sci", |
| 118 | .id = -1, | 108 | .id = 0, |
| 109 | .dev = { | ||
| 110 | .platform_data = &scif0_platform_data, | ||
| 111 | }, | ||
| 112 | }; | ||
| 113 | |||
| 114 | static struct plat_sci_port scif1_platform_data = { | ||
| 115 | .mapbase = 0xa4410000, | ||
| 116 | .flags = UPF_BOOT_AUTOCONF, | ||
| 117 | .type = PORT_SCIF, | ||
| 118 | .irqs = { 56, 56, 56, 56 }, | ||
| 119 | }; | ||
| 120 | |||
| 121 | static struct platform_device scif1_device = { | ||
| 122 | .name = "sh-sci", | ||
| 123 | .id = 1, | ||
| 119 | .dev = { | 124 | .dev = { |
| 120 | .platform_data = sci_platform_data, | 125 | .platform_data = &scif1_platform_data, |
| 121 | }, | 126 | }, |
| 122 | }; | 127 | }; |
| 123 | 128 | ||
| @@ -214,10 +219,11 @@ static struct platform_device tmu2_device = { | |||
| 214 | }; | 219 | }; |
| 215 | 220 | ||
| 216 | static struct platform_device *sh7710_devices[] __initdata = { | 221 | static struct platform_device *sh7710_devices[] __initdata = { |
| 222 | &scif0_device, | ||
| 223 | &scif1_device, | ||
| 217 | &tmu0_device, | 224 | &tmu0_device, |
| 218 | &tmu1_device, | 225 | &tmu1_device, |
| 219 | &tmu2_device, | 226 | &tmu2_device, |
| 220 | &sci_device, | ||
| 221 | &rtc_device, | 227 | &rtc_device, |
| 222 | }; | 228 | }; |
| 223 | 229 | ||
| @@ -229,6 +235,8 @@ static int __init sh7710_devices_setup(void) | |||
| 229 | arch_initcall(sh7710_devices_setup); | 235 | arch_initcall(sh7710_devices_setup); |
| 230 | 236 | ||
| 231 | static struct platform_device *sh7710_early_devices[] __initdata = { | 237 | static struct platform_device *sh7710_early_devices[] __initdata = { |
| 238 | &scif0_device, | ||
| 239 | &scif1_device, | ||
| 232 | &tmu0_device, | 240 | &tmu0_device, |
| 233 | &tmu1_device, | 241 | &tmu1_device, |
| 234 | &tmu2_device, | 242 | &tmu2_device, |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c index 74d8baaf8e96..a718a6231091 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c | |||
| @@ -48,28 +48,33 @@ static struct platform_device rtc_device = { | |||
| 48 | }, | 48 | }, |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | static struct plat_sci_port sci_platform_data[] = { | 51 | static struct plat_sci_port scif0_platform_data = { |
| 52 | { | 52 | .mapbase = 0xa4430000, |
| 53 | .mapbase = 0xa4430000, | 53 | .flags = UPF_BOOT_AUTOCONF, |
| 54 | .flags = UPF_BOOT_AUTOCONF, | 54 | .type = PORT_SCIF, |
| 55 | .type = PORT_SCIF, | 55 | .irqs = { 80, 80, 80, 80 }, |
| 56 | .irqs = { 80, 80, 80, 80 }, | 56 | }; |
| 57 | }, { | 57 | |
| 58 | .mapbase = 0xa4438000, | 58 | static struct platform_device scif0_device = { |
| 59 | .flags = UPF_BOOT_AUTOCONF, | ||
| 60 | .type = PORT_SCIF, | ||
| 61 | .irqs = { 81, 81, 81, 81 }, | ||
| 62 | }, { | ||
| 63 | |||
| 64 | .flags = 0, | ||
| 65 | } | ||
| 66 | }; | ||
| 67 | |||
| 68 | static struct platform_device sci_device = { | ||
| 69 | .name = "sh-sci", | 59 | .name = "sh-sci", |
| 70 | .id = -1, | 60 | .id = 0, |
| 61 | .dev = { | ||
| 62 | .platform_data = &scif0_platform_data, | ||
| 63 | }, | ||
| 64 | }; | ||
| 65 | |||
| 66 | static struct plat_sci_port scif1_platform_data = { | ||
| 67 | .mapbase = 0xa4438000, | ||
| 68 | .flags = UPF_BOOT_AUTOCONF, | ||
| 69 | .type = PORT_SCIF, | ||
| 70 | .irqs = { 81, 81, 81, 81 }, | ||
| 71 | }; | ||
| 72 | |||
| 73 | static struct platform_device scif1_device = { | ||
| 74 | .name = "sh-sci", | ||
| 75 | .id = 1, | ||
| 71 | .dev = { | 76 | .dev = { |
| 72 | .platform_data = sci_platform_data, | 77 | .platform_data = &scif1_platform_data, |
| 73 | }, | 78 | }, |
| 74 | }; | 79 | }; |
| 75 | 80 | ||
| @@ -369,6 +374,8 @@ static struct platform_device tmu2_device = { | |||
| 369 | }; | 374 | }; |
| 370 | 375 | ||
| 371 | static struct platform_device *sh7720_devices[] __initdata = { | 376 | static struct platform_device *sh7720_devices[] __initdata = { |
| 377 | &scif0_device, | ||
| 378 | &scif1_device, | ||
| 372 | &cmt0_device, | 379 | &cmt0_device, |
| 373 | &cmt1_device, | 380 | &cmt1_device, |
| 374 | &cmt2_device, | 381 | &cmt2_device, |
| @@ -378,7 +385,6 @@ static struct platform_device *sh7720_devices[] __initdata = { | |||
| 378 | &tmu1_device, | 385 | &tmu1_device, |
| 379 | &tmu2_device, | 386 | &tmu2_device, |
| 380 | &rtc_device, | 387 | &rtc_device, |
| 381 | &sci_device, | ||
| 382 | &usb_ohci_device, | 388 | &usb_ohci_device, |
| 383 | &usbf_device, | 389 | &usbf_device, |
| 384 | }; | 390 | }; |
| @@ -391,6 +397,8 @@ static int __init sh7720_devices_setup(void) | |||
| 391 | arch_initcall(sh7720_devices_setup); | 397 | arch_initcall(sh7720_devices_setup); |
| 392 | 398 | ||
| 393 | static struct platform_device *sh7720_early_devices[] __initdata = { | 399 | static struct platform_device *sh7720_early_devices[] __initdata = { |
| 400 | &scif0_device, | ||
| 401 | &scif1_device, | ||
| 394 | &cmt0_device, | 402 | &cmt0_device, |
| 395 | &cmt1_device, | 403 | &cmt1_device, |
| 396 | &cmt2_device, | 404 | &cmt2_device, |
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c index de4827df19aa..4b733715cdb5 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c | |||
| @@ -15,22 +15,18 @@ | |||
| 15 | #include <linux/sh_timer.h> | 15 | #include <linux/sh_timer.h> |
| 16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
| 17 | 17 | ||
| 18 | static struct plat_sci_port sci_platform_data[] = { | 18 | static struct plat_sci_port scif0_platform_data = { |
| 19 | { | 19 | .mapbase = 0xffe80000, |
| 20 | .mapbase = 0xffe80000, | 20 | .flags = UPF_BOOT_AUTOCONF, |
| 21 | .flags = UPF_BOOT_AUTOCONF, | 21 | .type = PORT_SCIF, |
| 22 | .type = PORT_SCIF, | 22 | .irqs = { 40, 41, 43, 42 }, |
| 23 | .irqs = { 40, 41, 43, 42 }, | ||
| 24 | }, { | ||
| 25 | .flags = 0, | ||
| 26 | } | ||
| 27 | }; | 23 | }; |
| 28 | 24 | ||
| 29 | static struct platform_device sci_device = { | 25 | static struct platform_device scif0_device = { |
| 30 | .name = "sh-sci", | 26 | .name = "sh-sci", |
| 31 | .id = -1, | 27 | .id = 0, |
| 32 | .dev = { | 28 | .dev = { |
| 33 | .platform_data = sci_platform_data, | 29 | .platform_data = &scif0_platform_data, |
| 34 | }, | 30 | }, |
| 35 | }; | 31 | }; |
| 36 | 32 | ||
| @@ -127,7 +123,7 @@ static struct platform_device tmu2_device = { | |||
| 127 | }; | 123 | }; |
| 128 | 124 | ||
| 129 | static struct platform_device *sh4202_devices[] __initdata = { | 125 | static struct platform_device *sh4202_devices[] __initdata = { |
| 130 | &sci_device, | 126 | &scif0_device, |
| 131 | &tmu0_device, | 127 | &tmu0_device, |
| 132 | &tmu1_device, | 128 | &tmu1_device, |
| 133 | &tmu2_device, | 129 | &tmu2_device, |
| @@ -141,6 +137,7 @@ static int __init sh4202_devices_setup(void) | |||
| 141 | arch_initcall(sh4202_devices_setup); | 137 | arch_initcall(sh4202_devices_setup); |
| 142 | 138 | ||
| 143 | static struct platform_device *sh4202_early_devices[] __initdata = { | 139 | static struct platform_device *sh4202_early_devices[] __initdata = { |
| 140 | &scif0_device, | ||
| 144 | &tmu0_device, | 141 | &tmu0_device, |
| 145 | &tmu1_device, | 142 | &tmu1_device, |
| 146 | &tmu2_device, | 143 | &tmu2_device, |
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c index 1b8b122e8f3d..b2a9df1af64c 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c | |||
| @@ -35,29 +35,33 @@ static struct platform_device rtc_device = { | |||
| 35 | .resource = rtc_resources, | 35 | .resource = rtc_resources, |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | static struct plat_sci_port sci_platform_data[] = { | 38 | static struct plat_sci_port scif0_platform_data = { |
| 39 | { | 39 | .mapbase = 0xffe00000, |
| 40 | #ifndef CONFIG_SH_RTS7751R2D | 40 | .flags = UPF_BOOT_AUTOCONF, |
| 41 | .mapbase = 0xffe00000, | 41 | .type = PORT_SCI, |
| 42 | .flags = UPF_BOOT_AUTOCONF, | 42 | .irqs = { 23, 23, 23, 0 }, |
| 43 | .type = PORT_SCI, | ||
| 44 | .irqs = { 23, 23, 23, 0 }, | ||
| 45 | }, { | ||
| 46 | #endif | ||
| 47 | .mapbase = 0xffe80000, | ||
| 48 | .flags = UPF_BOOT_AUTOCONF, | ||
| 49 | .type = PORT_SCIF, | ||
| 50 | .irqs = { 40, 40, 40, 40 }, | ||
| 51 | }, { | ||
| 52 | .flags = 0, | ||
| 53 | } | ||
| 54 | }; | 43 | }; |
| 55 | 44 | ||
| 56 | static struct platform_device sci_device = { | 45 | static struct platform_device scif0_device = { |
| 57 | .name = "sh-sci", | 46 | .name = "sh-sci", |
| 58 | .id = -1, | 47 | .id = 0, |
| 48 | .dev = { | ||
| 49 | .platform_data = &scif0_platform_data, | ||
| 50 | }, | ||
| 51 | }; | ||
| 52 | |||
| 53 | static struct plat_sci_port scif1_platform_data = { | ||
| 54 | .mapbase = 0xffe80000, | ||
| 55 | .flags = UPF_BOOT_AUTOCONF, | ||
| 56 | .type = PORT_SCIF, | ||
| 57 | .irqs = { 40, 40, 40, 40 }, | ||
| 58 | }; | ||
| 59 | |||
| 60 | static struct platform_device scif1_device = { | ||
| 61 | .name = "sh-sci", | ||
| 62 | .id = 1, | ||
| 59 | .dev = { | 63 | .dev = { |
| 60 | .platform_data = sci_platform_data, | 64 | .platform_data = &scif1_platform_data, |
| 61 | }, | 65 | }, |
| 62 | }; | 66 | }; |
| 63 | 67 | ||
| @@ -221,8 +225,9 @@ static struct platform_device tmu4_device = { | |||
| 221 | #endif | 225 | #endif |
| 222 | 226 | ||
| 223 | static struct platform_device *sh7750_devices[] __initdata = { | 227 | static struct platform_device *sh7750_devices[] __initdata = { |
| 228 | &scif0_device, | ||
| 229 | &scif1_device, | ||
| 224 | &rtc_device, | 230 | &rtc_device, |
| 225 | &sci_device, | ||
| 226 | &tmu0_device, | 231 | &tmu0_device, |
| 227 | &tmu1_device, | 232 | &tmu1_device, |
| 228 | &tmu2_device, | 233 | &tmu2_device, |
| @@ -242,6 +247,8 @@ static int __init sh7750_devices_setup(void) | |||
| 242 | arch_initcall(sh7750_devices_setup); | 247 | arch_initcall(sh7750_devices_setup); |
| 243 | 248 | ||
| 244 | static struct platform_device *sh7750_early_devices[] __initdata = { | 249 | static struct platform_device *sh7750_early_devices[] __initdata = { |
| 250 | &scif0_device, | ||
| 251 | &scif1_device, | ||
| 245 | &tmu0_device, | 252 | &tmu0_device, |
| 246 | &tmu1_device, | 253 | &tmu1_device, |
| 247 | &tmu2_device, | 254 | &tmu2_device, |
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7760.c b/arch/sh/kernel/cpu/sh4/setup-sh7760.c index 7fbb7be9284c..5b74cc0b43da 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh7760.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh7760.c | |||
| @@ -126,37 +126,63 @@ static struct intc_vect vectors_irq[] __initdata = { | |||
| 126 | static DECLARE_INTC_DESC(intc_desc_irq, "sh7760-irq", vectors_irq, groups, | 126 | static DECLARE_INTC_DESC(intc_desc_irq, "sh7760-irq", vectors_irq, groups, |
| 127 | mask_registers, prio_registers, NULL); | 127 | mask_registers, prio_registers, NULL); |
| 128 | 128 | ||
| 129 | static struct plat_sci_port sci_platform_data[] = { | 129 | static struct plat_sci_port scif0_platform_data = { |
| 130 | { | 130 | .mapbase = 0xfe600000, |
| 131 | .mapbase = 0xfe600000, | 131 | .flags = UPF_BOOT_AUTOCONF, |
| 132 | .flags = UPF_BOOT_AUTOCONF, | 132 | .type = PORT_SCIF, |
| 133 | .type = PORT_SCIF, | 133 | .irqs = { 52, 53, 55, 54 }, |
| 134 | .irqs = { 52, 53, 55, 54 }, | 134 | }; |
| 135 | }, { | 135 | |
| 136 | .mapbase = 0xfe610000, | 136 | static struct platform_device scif0_device = { |
| 137 | .flags = UPF_BOOT_AUTOCONF, | 137 | .name = "sh-sci", |
| 138 | .type = PORT_SCIF, | 138 | .id = 0, |
| 139 | .irqs = { 72, 73, 75, 74 }, | 139 | .dev = { |
| 140 | }, { | 140 | .platform_data = &scif0_platform_data, |
| 141 | .mapbase = 0xfe620000, | 141 | }, |
| 142 | .flags = UPF_BOOT_AUTOCONF, | 142 | }; |
| 143 | .type = PORT_SCIF, | 143 | |
| 144 | .irqs = { 76, 77, 79, 78 }, | 144 | static struct plat_sci_port scif1_platform_data = { |
| 145 | }, { | 145 | .mapbase = 0xfe610000, |
| 146 | .mapbase = 0xfe480000, | 146 | .flags = UPF_BOOT_AUTOCONF, |
| 147 | .flags = UPF_BOOT_AUTOCONF, | 147 | .type = PORT_SCIF, |
| 148 | .type = PORT_SCI, | 148 | .irqs = { 72, 73, 75, 74 }, |
| 149 | .irqs = { 80, 81, 82, 0 }, | 149 | }; |
| 150 | }, { | 150 | |
| 151 | .flags = 0, | 151 | static struct platform_device scif1_device = { |
| 152 | } | 152 | .name = "sh-sci", |
| 153 | .id = 1, | ||
| 154 | .dev = { | ||
| 155 | .platform_data = &scif1_platform_data, | ||
| 156 | }, | ||
| 157 | }; | ||
| 158 | |||
| 159 | static struct plat_sci_port scif2_platform_data = { | ||
| 160 | .mapbase = 0xfe620000, | ||
| 161 | .flags = UPF_BOOT_AUTOCONF, | ||
| 162 | .type = PORT_SCIF, | ||
| 163 | .irqs = { 76, 77, 79, 78 }, | ||
| 164 | }; | ||
| 165 | |||
| 166 | static struct platform_device scif2_device = { | ||
| 167 | .name = "sh-sci", | ||
| 168 | .id = 2, | ||
| 169 | .dev = { | ||
| 170 | .platform_data = &scif2_platform_data, | ||
| 171 | }, | ||
| 172 | }; | ||
| 173 | |||
| 174 | static struct plat_sci_port scif3_platform_data = { | ||
| 175 | .mapbase = 0xfe480000, | ||
| 176 | .flags = UPF_BOOT_AUTOCONF, | ||
| 177 | .type = PORT_SCI, | ||
| 178 | .irqs = { 80, 81, 82, 0 }, | ||
| 153 | }; | 179 | }; |
| 154 | 180 | ||
| 155 | static struct platform_device sci_device = { | 181 | static struct platform_device scif3_device = { |
| 156 | .name = "sh-sci", | 182 | .name = "sh-sci", |
| 157 | .id = -1, | 183 | .id = 3, |
| 158 | .dev = { | 184 | .dev = { |
| 159 | .platform_data = sci_platform_data, | 185 | .platform_data = &scif3_platform_data, |
| 160 | }, | 186 | }, |
| 161 | }; | 187 | }; |
| 162 | 188 | ||
| @@ -254,7 +280,10 @@ static struct platform_device tmu2_device = { | |||
| 254 | 280 | ||
| 255 | 281 | ||
| 256 | static struct platform_device *sh7760_devices[] __initdata = { | 282 | static struct platform_device *sh7760_devices[] __initdata = { |
| 257 | &sci_device, | 283 | &scif0_device, |
| 284 | &scif1_device, | ||
| 285 | &scif2_device, | ||
| 286 | &scif3_device, | ||
| 258 | &tmu0_device, | 287 | &tmu0_device, |
| 259 | &tmu1_device, | 288 | &tmu1_device, |
| 260 | &tmu2_device, | 289 | &tmu2_device, |
| @@ -268,6 +297,10 @@ static int __init sh7760_devices_setup(void) | |||
| 268 | arch_initcall(sh7760_devices_setup); | 297 | arch_initcall(sh7760_devices_setup); |
| 269 | 298 | ||
| 270 | static struct platform_device *sh7760_early_devices[] __initdata = { | 299 | static struct platform_device *sh7760_early_devices[] __initdata = { |
| 300 | &scif0_device, | ||
| 301 | &scif1_device, | ||
| 302 | &scif2_device, | ||
| 303 | &scif3_device, | ||
| 271 | &tmu0_device, | 304 | &tmu0_device, |
| 272 | &tmu1_device, | 305 | &tmu1_device, |
| 273 | &tmu2_device, | 306 | &tmu2_device, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c index ac4d5672ec1a..45eb1bfd42c9 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c | |||
| @@ -15,6 +15,71 @@ | |||
| 15 | #include <linux/sh_timer.h> | 15 | #include <linux/sh_timer.h> |
| 16 | #include <asm/clock.h> | 16 | #include <asm/clock.h> |
| 17 | 17 | ||
| 18 | /* Serial */ | ||
| 19 | static struct plat_sci_port scif0_platform_data = { | ||
| 20 | .mapbase = 0xffe00000, | ||
| 21 | .flags = UPF_BOOT_AUTOCONF, | ||
| 22 | .type = PORT_SCIF, | ||
| 23 | .irqs = { 80, 80, 80, 80 }, | ||
| 24 | .clk = "scif0", | ||
| 25 | }; | ||
| 26 | |||
| 27 | static struct platform_device scif0_device = { | ||
| 28 | .name = "sh-sci", | ||
| 29 | .id = 0, | ||
| 30 | .dev = { | ||
| 31 | .platform_data = &scif0_platform_data, | ||
| 32 | }, | ||
| 33 | }; | ||
| 34 | |||
| 35 | static struct plat_sci_port scif1_platform_data = { | ||
| 36 | .mapbase = 0xffe10000, | ||
| 37 | .flags = UPF_BOOT_AUTOCONF, | ||
| 38 | .type = PORT_SCIF, | ||
| 39 | .irqs = { 81, 81, 81, 81 }, | ||
| 40 | .clk = "scif1", | ||
| 41 | }; | ||
| 42 | |||
| 43 | static struct platform_device scif1_device = { | ||
| 44 | .name = "sh-sci", | ||
| 45 | .id = 1, | ||
| 46 | .dev = { | ||
| 47 | .platform_data = &scif1_platform_data, | ||
| 48 | }, | ||
| 49 | }; | ||
| 50 | |||
| 51 | static struct plat_sci_port scif2_platform_data = { | ||
| 52 | .mapbase = 0xffe20000, | ||
| 53 | .flags = UPF_BOOT_AUTOCONF, | ||
| 54 | .type = PORT_SCIF, | ||
| 55 | .irqs = { 82, 82, 82, 82 }, | ||
| 56 | .clk = "scif2", | ||
| 57 | }; | ||
| 58 | |||
| 59 | static struct platform_device scif2_device = { | ||
| 60 | .name = "sh-sci", | ||
| 61 | .id = 2, | ||
| 62 | .dev = { | ||
| 63 | .platform_data = &scif2_platform_data, | ||
| 64 | }, | ||
| 65 | }; | ||
| 66 | |||
| 67 | static struct plat_sci_port scif3_platform_data = { | ||
| 68 | .mapbase = 0xffe30000, | ||
| 69 | .flags = UPF_BOOT_AUTOCONF, | ||
| 70 | .type = PORT_SCIF, | ||
| 71 | .irqs = { 83, 83, 83, 83 }, | ||
| 72 | .clk = "scif3", | ||
| 73 | }; | ||
| 74 | |||
| 75 | static struct platform_device scif3_device = { | ||
| 76 | .name = "sh-sci", | ||
| 77 | .id = 3, | ||
| 78 | .dev = { | ||
| 79 | .platform_data = &scif3_platform_data, | ||
| 80 | }, | ||
| 81 | }; | ||
| 82 | |||
| 18 | static struct resource iic0_resources[] = { | 83 | static struct resource iic0_resources[] = { |
| 19 | [0] = { | 84 | [0] = { |
| 20 | .name = "IIC0", | 85 | .name = "IIC0", |
| @@ -265,52 +330,17 @@ static struct platform_device tmu2_device = { | |||
| 265 | .num_resources = ARRAY_SIZE(tmu2_resources), | 330 | .num_resources = ARRAY_SIZE(tmu2_resources), |
| 266 | }; | 331 | }; |
| 267 | 332 | ||
| 268 | static struct plat_sci_port sci_platform_data[] = { | ||
| 269 | { | ||
| 270 | .mapbase = 0xffe00000, | ||
| 271 | .flags = UPF_BOOT_AUTOCONF, | ||
| 272 | .type = PORT_SCIF, | ||
| 273 | .irqs = { 80, 80, 80, 80 }, | ||
| 274 | .clk = "scif0", | ||
| 275 | }, { | ||
| 276 | .mapbase = 0xffe10000, | ||
| 277 | .flags = UPF_BOOT_AUTOCONF, | ||
| 278 | .type = PORT_SCIF, | ||
| 279 | .irqs = { 81, 81, 81, 81 }, | ||
| 280 | .clk = "scif1", | ||
| 281 | }, { | ||
| 282 | .mapbase = 0xffe20000, | ||
| 283 | .flags = UPF_BOOT_AUTOCONF, | ||
| 284 | .type = PORT_SCIF, | ||
| 285 | .irqs = { 82, 82, 82, 82 }, | ||
| 286 | .clk = "scif2", | ||
| 287 | }, { | ||
| 288 | .mapbase = 0xffe30000, | ||
| 289 | .flags = UPF_BOOT_AUTOCONF, | ||
| 290 | .type = PORT_SCIF, | ||
| 291 | .irqs = { 83, 83, 83, 83 }, | ||
| 292 | .clk = "scif3", | ||
| 293 | }, { | ||
| 294 | .flags = 0, | ||
| 295 | } | ||
| 296 | }; | ||
| 297 | |||
| 298 | static struct platform_device sci_device = { | ||
| 299 | .name = "sh-sci", | ||
| 300 | .id = -1, | ||
| 301 | .dev = { | ||
| 302 | .platform_data = sci_platform_data, | ||
| 303 | }, | ||
| 304 | }; | ||
| 305 | |||
| 306 | static struct platform_device *sh7343_devices[] __initdata = { | 333 | static struct platform_device *sh7343_devices[] __initdata = { |
| 334 | &scif0_device, | ||
| 335 | &scif1_device, | ||
| 336 | &scif2_device, | ||
| 337 | &scif3_device, | ||
| 307 | &cmt_device, | 338 | &cmt_device, |
| 308 | &tmu0_device, | 339 | &tmu0_device, |
| 309 | &tmu1_device, | 340 | &tmu1_device, |
| 310 | &tmu2_device, | 341 | &tmu2_device, |
| 311 | &iic0_device, | 342 | &iic0_device, |
| 312 | &iic1_device, | 343 | &iic1_device, |
| 313 | &sci_device, | ||
| 314 | &vpu_device, | 344 | &vpu_device, |
| 315 | &veu_device, | 345 | &veu_device, |
| 316 | &jpu_device, | 346 | &jpu_device, |
| @@ -328,6 +358,10 @@ static int __init sh7343_devices_setup(void) | |||
| 328 | arch_initcall(sh7343_devices_setup); | 358 | arch_initcall(sh7343_devices_setup); |
| 329 | 359 | ||
| 330 | static struct platform_device *sh7343_early_devices[] __initdata = { | 360 | static struct platform_device *sh7343_early_devices[] __initdata = { |
| 361 | &scif0_device, | ||
| 362 | &scif1_device, | ||
| 363 | &scif2_device, | ||
| 364 | &scif3_device, | ||
| 331 | &cmt_device, | 365 | &cmt_device, |
| 332 | &tmu0_device, | 366 | &tmu0_device, |
| 333 | &tmu1_device, | 367 | &tmu1_device, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c index 4a9010bf4fd3..c494c193e3b6 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c | |||
| @@ -18,6 +18,22 @@ | |||
| 18 | #include <linux/usb/r8a66597.h> | 18 | #include <linux/usb/r8a66597.h> |
| 19 | #include <asm/clock.h> | 19 | #include <asm/clock.h> |
| 20 | 20 | ||
| 21 | static struct plat_sci_port scif0_platform_data = { | ||
| 22 | .mapbase = 0xffe00000, | ||
| 23 | .flags = UPF_BOOT_AUTOCONF, | ||
| 24 | .type = PORT_SCIF, | ||
| 25 | .irqs = { 80, 80, 80, 80 }, | ||
| 26 | .clk = "scif0", | ||
| 27 | }; | ||
| 28 | |||
| 29 | static struct platform_device scif0_device = { | ||
| 30 | .name = "sh-sci", | ||
| 31 | .id = 0, | ||
| 32 | .dev = { | ||
| 33 | .platform_data = &scif0_platform_data, | ||
| 34 | }, | ||
| 35 | }; | ||
| 36 | |||
| 21 | static struct resource iic_resources[] = { | 37 | static struct resource iic_resources[] = { |
| 22 | [0] = { | 38 | [0] = { |
| 23 | .name = "IIC", | 39 | .name = "IIC", |
| @@ -276,33 +292,13 @@ static struct platform_device tmu2_device = { | |||
| 276 | .num_resources = ARRAY_SIZE(tmu2_resources), | 292 | .num_resources = ARRAY_SIZE(tmu2_resources), |
| 277 | }; | 293 | }; |
| 278 | 294 | ||
| 279 | static struct plat_sci_port sci_platform_data[] = { | ||
| 280 | { | ||
| 281 | .mapbase = 0xffe00000, | ||
| 282 | .flags = UPF_BOOT_AUTOCONF, | ||
| 283 | .type = PORT_SCIF, | ||
| 284 | .irqs = { 80, 80, 80, 80 }, | ||
| 285 | .clk = "scif0", | ||
| 286 | }, { | ||
| 287 | .flags = 0, | ||
| 288 | } | ||
| 289 | }; | ||
| 290 | |||
| 291 | static struct platform_device sci_device = { | ||
| 292 | .name = "sh-sci", | ||
| 293 | .id = -1, | ||
| 294 | .dev = { | ||
| 295 | .platform_data = sci_platform_data, | ||
| 296 | }, | ||
| 297 | }; | ||
| 298 | |||
| 299 | static struct platform_device *sh7366_devices[] __initdata = { | 295 | static struct platform_device *sh7366_devices[] __initdata = { |
| 296 | &scif0_device, | ||
| 300 | &cmt_device, | 297 | &cmt_device, |
| 301 | &tmu0_device, | 298 | &tmu0_device, |
| 302 | &tmu1_device, | 299 | &tmu1_device, |
| 303 | &tmu2_device, | 300 | &tmu2_device, |
| 304 | &iic_device, | 301 | &iic_device, |
| 305 | &sci_device, | ||
| 306 | &usb_host_device, | 302 | &usb_host_device, |
| 307 | &vpu_device, | 303 | &vpu_device, |
| 308 | &veu0_device, | 304 | &veu0_device, |
| @@ -321,6 +317,7 @@ static int __init sh7366_devices_setup(void) | |||
| 321 | arch_initcall(sh7366_devices_setup); | 317 | arch_initcall(sh7366_devices_setup); |
| 322 | 318 | ||
| 323 | static struct platform_device *sh7366_early_devices[] __initdata = { | 319 | static struct platform_device *sh7366_early_devices[] __initdata = { |
| 320 | &scif0_device, | ||
| 324 | &cmt_device, | 321 | &cmt_device, |
| 325 | &tmu0_device, | 322 | &tmu0_device, |
| 326 | &tmu1_device, | 323 | &tmu1_device, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index 5491b094cf05..b5335b5e309c 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c | |||
| @@ -20,6 +20,55 @@ | |||
| 20 | #include <asm/dma-sh.h> | 20 | #include <asm/dma-sh.h> |
| 21 | #include <cpu/sh7722.h> | 21 | #include <cpu/sh7722.h> |
| 22 | 22 | ||
| 23 | /* Serial */ | ||
| 24 | static struct plat_sci_port scif0_platform_data = { | ||
| 25 | .mapbase = 0xffe00000, | ||
| 26 | .flags = UPF_BOOT_AUTOCONF, | ||
| 27 | .type = PORT_SCIF, | ||
| 28 | .irqs = { 80, 80, 80, 80 }, | ||
| 29 | .clk = "scif0", | ||
| 30 | }; | ||
| 31 | |||
| 32 | static struct platform_device scif0_device = { | ||
| 33 | .name = "sh-sci", | ||
| 34 | .id = 0, | ||
| 35 | .dev = { | ||
| 36 | .platform_data = &scif0_platform_data, | ||
| 37 | }, | ||
| 38 | }; | ||
| 39 | |||
| 40 | static struct plat_sci_port scif1_platform_data = { | ||
| 41 | .mapbase = 0xffe10000, | ||
| 42 | .flags = UPF_BOOT_AUTOCONF, | ||
| 43 | .type = PORT_SCIF, | ||
| 44 | .irqs = { 81, 81, 81, 81 }, | ||
| 45 | .clk = "scif1", | ||
| 46 | }; | ||
| 47 | |||
| 48 | static struct platform_device scif1_device = { | ||
| 49 | .name = "sh-sci", | ||
| 50 | .id = 1, | ||
| 51 | .dev = { | ||
| 52 | .platform_data = &scif1_platform_data, | ||
| 53 | }, | ||
| 54 | }; | ||
| 55 | |||
| 56 | static struct plat_sci_port scif2_platform_data = { | ||
| 57 | .mapbase = 0xffe20000, | ||
| 58 | .flags = UPF_BOOT_AUTOCONF, | ||
| 59 | .type = PORT_SCIF, | ||
| 60 | .irqs = { 82, 82, 82, 82 }, | ||
| 61 | .clk = "scif2", | ||
| 62 | }; | ||
| 63 | |||
| 64 | static struct platform_device scif2_device = { | ||
| 65 | .name = "sh-sci", | ||
| 66 | .id = 2, | ||
| 67 | .dev = { | ||
| 68 | .platform_data = &scif2_platform_data, | ||
| 69 | }, | ||
| 70 | }; | ||
| 71 | |||
| 23 | static struct resource rtc_resources[] = { | 72 | static struct resource rtc_resources[] = { |
| 24 | [0] = { | 73 | [0] = { |
| 25 | .start = 0xa465fec0, | 74 | .start = 0xa465fec0, |
| @@ -339,41 +388,6 @@ static struct platform_device tmu2_device = { | |||
| 339 | }, | 388 | }, |
| 340 | }; | 389 | }; |
| 341 | 390 | ||
| 342 | static struct plat_sci_port sci_platform_data[] = { | ||
| 343 | { | ||
| 344 | .mapbase = 0xffe00000, | ||
| 345 | .flags = UPF_BOOT_AUTOCONF, | ||
| 346 | .type = PORT_SCIF, | ||
| 347 | .irqs = { 80, 80, 80, 80 }, | ||
| 348 | .clk = "scif0", | ||
| 349 | }, | ||
| 350 | { | ||
| 351 | .mapbase = 0xffe10000, | ||
| 352 | .flags = UPF_BOOT_AUTOCONF, | ||
| 353 | .type = PORT_SCIF, | ||
| 354 | .irqs = { 81, 81, 81, 81 }, | ||
| 355 | .clk = "scif1", | ||
| 356 | }, | ||
| 357 | { | ||
| 358 | .mapbase = 0xffe20000, | ||
| 359 | .flags = UPF_BOOT_AUTOCONF, | ||
| 360 | .type = PORT_SCIF, | ||
| 361 | .irqs = { 82, 82, 82, 82 }, | ||
| 362 | .clk = "scif2", | ||
| 363 | }, | ||
| 364 | { | ||
| 365 | .flags = 0, | ||
| 366 | } | ||
| 367 | }; | ||
| 368 | |||
| 369 | static struct platform_device sci_device = { | ||
| 370 | .name = "sh-sci", | ||
| 371 | .id = -1, | ||
| 372 | .dev = { | ||
| 373 | .platform_data = sci_platform_data, | ||
| 374 | }, | ||
| 375 | }; | ||
| 376 | |||
| 377 | static struct sh_dmae_pdata dma_platform_data = { | 391 | static struct sh_dmae_pdata dma_platform_data = { |
| 378 | .mode = 0, | 392 | .mode = 0, |
| 379 | }; | 393 | }; |
| @@ -387,6 +401,9 @@ static struct platform_device dma_device = { | |||
| 387 | }; | 401 | }; |
| 388 | 402 | ||
| 389 | static struct platform_device *sh7722_devices[] __initdata = { | 403 | static struct platform_device *sh7722_devices[] __initdata = { |
| 404 | &scif0_device, | ||
| 405 | &scif1_device, | ||
| 406 | &scif2_device, | ||
| 390 | &cmt_device, | 407 | &cmt_device, |
| 391 | &tmu0_device, | 408 | &tmu0_device, |
| 392 | &tmu1_device, | 409 | &tmu1_device, |
| @@ -394,7 +411,6 @@ static struct platform_device *sh7722_devices[] __initdata = { | |||
| 394 | &rtc_device, | 411 | &rtc_device, |
| 395 | &usbf_device, | 412 | &usbf_device, |
| 396 | &iic_device, | 413 | &iic_device, |
| 397 | &sci_device, | ||
| 398 | &vpu_device, | 414 | &vpu_device, |
| 399 | &veu_device, | 415 | &veu_device, |
| 400 | &jpu_device, | 416 | &jpu_device, |
| @@ -413,6 +429,9 @@ static int __init sh7722_devices_setup(void) | |||
| 413 | arch_initcall(sh7722_devices_setup); | 429 | arch_initcall(sh7722_devices_setup); |
| 414 | 430 | ||
| 415 | static struct platform_device *sh7722_early_devices[] __initdata = { | 431 | static struct platform_device *sh7722_early_devices[] __initdata = { |
| 432 | &scif0_device, | ||
| 433 | &scif1_device, | ||
| 434 | &scif2_device, | ||
| 416 | &cmt_device, | 435 | &cmt_device, |
| 417 | &tmu0_device, | 436 | &tmu0_device, |
| 418 | &tmu1_device, | 437 | &tmu1_device, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c index 4caa5a7ca86e..772b9265d0e4 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c | |||
| @@ -20,6 +20,103 @@ | |||
| 20 | #include <asm/mmzone.h> | 20 | #include <asm/mmzone.h> |
| 21 | #include <cpu/sh7723.h> | 21 | #include <cpu/sh7723.h> |
| 22 | 22 | ||
| 23 | /* Serial */ | ||
| 24 | static struct plat_sci_port scif0_platform_data = { | ||
| 25 | .mapbase = 0xffe00000, | ||
| 26 | .flags = UPF_BOOT_AUTOCONF, | ||
| 27 | .type = PORT_SCIF, | ||
| 28 | .irqs = { 80, 80, 80, 80 }, | ||
| 29 | .clk = "scif0", | ||
| 30 | }; | ||
| 31 | |||
| 32 | static struct platform_device scif0_device = { | ||
| 33 | .name = "sh-sci", | ||
| 34 | .id = 0, | ||
| 35 | .dev = { | ||
| 36 | .platform_data = &scif0_platform_data, | ||
| 37 | }, | ||
| 38 | }; | ||
| 39 | |||
| 40 | static struct plat_sci_port scif1_platform_data = { | ||
| 41 | .mapbase = 0xffe10000, | ||
| 42 | .flags = UPF_BOOT_AUTOCONF, | ||
| 43 | .type = PORT_SCIF, | ||
| 44 | .irqs = { 81, 81, 81, 81 }, | ||
| 45 | .clk = "scif1", | ||
| 46 | }; | ||
| 47 | |||
| 48 | static struct platform_device scif1_device = { | ||
| 49 | .name = "sh-sci", | ||
| 50 | .id = 1, | ||
| 51 | .dev = { | ||
| 52 | .platform_data = &scif1_platform_data, | ||
| 53 | }, | ||
| 54 | }; | ||
| 55 | |||
| 56 | static struct plat_sci_port scif2_platform_data = { | ||
| 57 | .mapbase = 0xffe20000, | ||
| 58 | .flags = UPF_BOOT_AUTOCONF, | ||
| 59 | .type = PORT_SCIF, | ||
| 60 | .irqs = { 82, 82, 82, 82 }, | ||
| 61 | .clk = "scif2", | ||
| 62 | }; | ||
| 63 | |||
| 64 | static struct platform_device scif2_device = { | ||
| 65 | .name = "sh-sci", | ||
| 66 | .id = 2, | ||
| 67 | .dev = { | ||
| 68 | .platform_data = &scif2_platform_data, | ||
| 69 | }, | ||
| 70 | }; | ||
| 71 | |||
| 72 | static struct plat_sci_port scif3_platform_data = { | ||
| 73 | .mapbase = 0xa4e30000, | ||
| 74 | .flags = UPF_BOOT_AUTOCONF, | ||
| 75 | .type = PORT_SCIFA, | ||
| 76 | .irqs = { 56, 56, 56, 56 }, | ||
| 77 | .clk = "scif3", | ||
| 78 | }; | ||
| 79 | |||
| 80 | static struct platform_device scif3_device = { | ||
| 81 | .name = "sh-sci", | ||
| 82 | .id = 3, | ||
| 83 | .dev = { | ||
| 84 | .platform_data = &scif3_platform_data, | ||
| 85 | }, | ||
| 86 | }; | ||
| 87 | |||
| 88 | static struct plat_sci_port scif4_platform_data = { | ||
| 89 | .mapbase = 0xa4e40000, | ||
| 90 | .flags = UPF_BOOT_AUTOCONF, | ||
| 91 | .type = PORT_SCIFA, | ||
| 92 | .irqs = { 88, 88, 88, 88 }, | ||
| 93 | .clk = "scif4", | ||
| 94 | }; | ||
| 95 | |||
| 96 | static struct platform_device scif4_device = { | ||
| 97 | .name = "sh-sci", | ||
| 98 | .id = 4, | ||
| 99 | .dev = { | ||
| 100 | .platform_data = &scif4_platform_data, | ||
| 101 | }, | ||
| 102 | }; | ||
| 103 | |||
| 104 | static struct plat_sci_port scif5_platform_data = { | ||
| 105 | .mapbase = 0xa4e50000, | ||
| 106 | .flags = UPF_BOOT_AUTOCONF, | ||
| 107 | .type = PORT_SCIFA, | ||
| 108 | .irqs = { 109, 109, 109, 109 }, | ||
| 109 | .clk = "scif5", | ||
| 110 | }; | ||
| 111 | |||
| 112 | static struct platform_device scif5_device = { | ||
| 113 | .name = "sh-sci", | ||
| 114 | .id = 5, | ||
| 115 | .dev = { | ||
| 116 | .platform_data = &scif5_platform_data, | ||
| 117 | }, | ||
| 118 | }; | ||
| 119 | |||
| 23 | static struct uio_info vpu_platform_data = { | 120 | static struct uio_info vpu_platform_data = { |
| 24 | .name = "VPU5", | 121 | .name = "VPU5", |
| 25 | .version = "0", | 122 | .version = "0", |
| @@ -348,56 +445,6 @@ static struct platform_device tmu5_device = { | |||
| 348 | }, | 445 | }, |
| 349 | }; | 446 | }; |
| 350 | 447 | ||
| 351 | static struct plat_sci_port sci_platform_data[] = { | ||
| 352 | { | ||
| 353 | .mapbase = 0xffe00000, | ||
| 354 | .flags = UPF_BOOT_AUTOCONF, | ||
| 355 | .type = PORT_SCIF, | ||
| 356 | .irqs = { 80, 80, 80, 80 }, | ||
| 357 | .clk = "scif0", | ||
| 358 | },{ | ||
| 359 | .mapbase = 0xffe10000, | ||
| 360 | .flags = UPF_BOOT_AUTOCONF, | ||
| 361 | .type = PORT_SCIF, | ||
| 362 | .irqs = { 81, 81, 81, 81 }, | ||
| 363 | .clk = "scif1", | ||
| 364 | },{ | ||
| 365 | .mapbase = 0xffe20000, | ||
| 366 | .flags = UPF_BOOT_AUTOCONF, | ||
| 367 | .type = PORT_SCIF, | ||
| 368 | .irqs = { 82, 82, 82, 82 }, | ||
| 369 | .clk = "scif2", | ||
| 370 | },{ | ||
| 371 | .mapbase = 0xa4e30000, | ||
| 372 | .flags = UPF_BOOT_AUTOCONF, | ||
| 373 | .type = PORT_SCIFA, | ||
| 374 | .irqs = { 56, 56, 56, 56 }, | ||
| 375 | .clk = "scif3", | ||
| 376 | },{ | ||
| 377 | .mapbase = 0xa4e40000, | ||
| 378 | .flags = UPF_BOOT_AUTOCONF, | ||
| 379 | .type = PORT_SCIFA, | ||
| 380 | .irqs = { 88, 88, 88, 88 }, | ||
| 381 | .clk = "scif4", | ||
| 382 | },{ | ||
| 383 | .mapbase = 0xa4e50000, | ||
| 384 | .flags = UPF_BOOT_AUTOCONF, | ||
| 385 | .type = PORT_SCIFA, | ||
| 386 | .irqs = { 109, 109, 109, 109 }, | ||
| 387 | .clk = "scif5", | ||
| 388 | }, { | ||
| 389 | .flags = 0, | ||
| 390 | } | ||
| 391 | }; | ||
| 392 | |||
| 393 | static struct platform_device sci_device = { | ||
| 394 | .name = "sh-sci", | ||
| 395 | .id = -1, | ||
| 396 | .dev = { | ||
| 397 | .platform_data = sci_platform_data, | ||
| 398 | }, | ||
| 399 | }; | ||
| 400 | |||
| 401 | static struct resource rtc_resources[] = { | 448 | static struct resource rtc_resources[] = { |
| 402 | [0] = { | 449 | [0] = { |
| 403 | .start = 0xa465fec0, | 450 | .start = 0xa465fec0, |
| @@ -488,6 +535,12 @@ static struct platform_device iic_device = { | |||
| 488 | }; | 535 | }; |
| 489 | 536 | ||
| 490 | static struct platform_device *sh7723_devices[] __initdata = { | 537 | static struct platform_device *sh7723_devices[] __initdata = { |
| 538 | &scif0_device, | ||
| 539 | &scif1_device, | ||
| 540 | &scif2_device, | ||
| 541 | &scif3_device, | ||
| 542 | &scif4_device, | ||
| 543 | &scif5_device, | ||
| 491 | &cmt_device, | 544 | &cmt_device, |
| 492 | &tmu0_device, | 545 | &tmu0_device, |
| 493 | &tmu1_device, | 546 | &tmu1_device, |
| @@ -495,7 +548,6 @@ static struct platform_device *sh7723_devices[] __initdata = { | |||
| 495 | &tmu3_device, | 548 | &tmu3_device, |
| 496 | &tmu4_device, | 549 | &tmu4_device, |
| 497 | &tmu5_device, | 550 | &tmu5_device, |
| 498 | &sci_device, | ||
| 499 | &rtc_device, | 551 | &rtc_device, |
| 500 | &iic_device, | 552 | &iic_device, |
| 501 | &sh7723_usb_host_device, | 553 | &sh7723_usb_host_device, |
| @@ -516,6 +568,12 @@ static int __init sh7723_devices_setup(void) | |||
| 516 | arch_initcall(sh7723_devices_setup); | 568 | arch_initcall(sh7723_devices_setup); |
| 517 | 569 | ||
| 518 | static struct platform_device *sh7723_early_devices[] __initdata = { | 570 | static struct platform_device *sh7723_early_devices[] __initdata = { |
| 571 | &scif0_device, | ||
| 572 | &scif1_device, | ||
| 573 | &scif2_device, | ||
| 574 | &scif3_device, | ||
| 575 | &scif4_device, | ||
| 576 | &scif5_device, | ||
| 519 | &cmt_device, | 577 | &cmt_device, |
| 520 | &tmu0_device, | 578 | &tmu0_device, |
| 521 | &tmu1_device, | 579 | &tmu1_device, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c index 845e89c936e7..a52f35117e82 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c | |||
| @@ -27,53 +27,99 @@ | |||
| 27 | #include <cpu/sh7724.h> | 27 | #include <cpu/sh7724.h> |
| 28 | 28 | ||
| 29 | /* Serial */ | 29 | /* Serial */ |
| 30 | static struct plat_sci_port sci_platform_data[] = { | 30 | static struct plat_sci_port scif0_platform_data = { |
| 31 | { | 31 | .mapbase = 0xffe00000, |
| 32 | .mapbase = 0xffe00000, | 32 | .flags = UPF_BOOT_AUTOCONF, |
| 33 | .flags = UPF_BOOT_AUTOCONF, | 33 | .type = PORT_SCIF, |
| 34 | .type = PORT_SCIF, | 34 | .irqs = { 80, 80, 80, 80 }, |
| 35 | .irqs = { 80, 80, 80, 80 }, | 35 | .clk = "scif0", |
| 36 | .clk = "scif0", | 36 | }; |
| 37 | }, { | 37 | |
| 38 | .mapbase = 0xffe10000, | 38 | static struct platform_device scif0_device = { |
| 39 | .flags = UPF_BOOT_AUTOCONF, | ||
| 40 | .type = PORT_SCIF, | ||
| 41 | .irqs = { 81, 81, 81, 81 }, | ||
| 42 | .clk = "scif1", | ||
| 43 | }, { | ||
| 44 | .mapbase = 0xffe20000, | ||
| 45 | .flags = UPF_BOOT_AUTOCONF, | ||
| 46 | .type = PORT_SCIF, | ||
| 47 | .irqs = { 82, 82, 82, 82 }, | ||
| 48 | .clk = "scif2", | ||
| 49 | }, { | ||
| 50 | .mapbase = 0xa4e30000, | ||
| 51 | .flags = UPF_BOOT_AUTOCONF, | ||
| 52 | .type = PORT_SCIFA, | ||
| 53 | .irqs = { 56, 56, 56, 56 }, | ||
| 54 | .clk = "scif3", | ||
| 55 | }, { | ||
| 56 | .mapbase = 0xa4e40000, | ||
| 57 | .flags = UPF_BOOT_AUTOCONF, | ||
| 58 | .type = PORT_SCIFA, | ||
| 59 | .irqs = { 88, 88, 88, 88 }, | ||
| 60 | .clk = "scif4", | ||
| 61 | }, { | ||
| 62 | .mapbase = 0xa4e50000, | ||
| 63 | .flags = UPF_BOOT_AUTOCONF, | ||
| 64 | .type = PORT_SCIFA, | ||
| 65 | .irqs = { 109, 109, 109, 109 }, | ||
| 66 | .clk = "scif5", | ||
| 67 | }, { | ||
| 68 | .flags = 0, | ||
| 69 | } | ||
| 70 | }; | ||
| 71 | |||
| 72 | static struct platform_device sci_device = { | ||
| 73 | .name = "sh-sci", | 39 | .name = "sh-sci", |
| 74 | .id = -1, | 40 | .id = 0, |
| 41 | .dev = { | ||
| 42 | .platform_data = &scif0_platform_data, | ||
| 43 | }, | ||
| 44 | }; | ||
| 45 | |||
| 46 | static struct plat_sci_port scif1_platform_data = { | ||
| 47 | .mapbase = 0xffe10000, | ||
| 48 | .flags = UPF_BOOT_AUTOCONF, | ||
| 49 | .type = PORT_SCIF, | ||
| 50 | .irqs = { 81, 81, 81, 81 }, | ||
| 51 | .clk = "scif1", | ||
| 52 | }; | ||
| 53 | |||
| 54 | static struct platform_device scif1_device = { | ||
| 55 | .name = "sh-sci", | ||
| 56 | .id = 1, | ||
| 57 | .dev = { | ||
| 58 | .platform_data = &scif1_platform_data, | ||
| 59 | }, | ||
| 60 | }; | ||
| 61 | |||
| 62 | static struct plat_sci_port scif2_platform_data = { | ||
| 63 | .mapbase = 0xffe20000, | ||
| 64 | .flags = UPF_BOOT_AUTOCONF, | ||
| 65 | .type = PORT_SCIF, | ||
| 66 | .irqs = { 82, 82, 82, 82 }, | ||
| 67 | .clk = "scif2", | ||
| 68 | }; | ||
| 69 | |||
| 70 | static struct platform_device scif2_device = { | ||
| 71 | .name = "sh-sci", | ||
| 72 | .id = 2, | ||
| 73 | .dev = { | ||
| 74 | .platform_data = &scif2_platform_data, | ||
| 75 | }, | ||
| 76 | }; | ||
| 77 | |||
| 78 | static struct plat_sci_port scif3_platform_data = { | ||
| 79 | .mapbase = 0xa4e30000, | ||
| 80 | .flags = UPF_BOOT_AUTOCONF, | ||
| 81 | .type = PORT_SCIFA, | ||
| 82 | .irqs = { 56, 56, 56, 56 }, | ||
| 83 | .clk = "scif3", | ||
| 84 | }; | ||
| 85 | |||
| 86 | static struct platform_device scif3_device = { | ||
| 87 | .name = "sh-sci", | ||
| 88 | .id = 3, | ||
| 89 | .dev = { | ||
| 90 | .platform_data = &scif3_platform_data, | ||
| 91 | }, | ||
| 92 | }; | ||
| 93 | |||
| 94 | static struct plat_sci_port scif4_platform_data = { | ||
| 95 | .mapbase = 0xa4e40000, | ||
| 96 | .flags = UPF_BOOT_AUTOCONF, | ||
| 97 | .type = PORT_SCIFA, | ||
| 98 | .irqs = { 88, 88, 88, 88 }, | ||
| 99 | .clk = "scif4", | ||
| 100 | }; | ||
| 101 | |||
| 102 | static struct platform_device scif4_device = { | ||
| 103 | .name = "sh-sci", | ||
| 104 | .id = 4, | ||
| 105 | .dev = { | ||
| 106 | .platform_data = &scif4_platform_data, | ||
| 107 | }, | ||
| 108 | }; | ||
| 109 | |||
| 110 | static struct plat_sci_port scif5_platform_data = { | ||
| 111 | .mapbase = 0xa4e50000, | ||
| 112 | .flags = UPF_BOOT_AUTOCONF, | ||
| 113 | .type = PORT_SCIFA, | ||
| 114 | .irqs = { 109, 109, 109, 109 }, | ||
| 115 | .clk = "scif5", | ||
| 116 | }; | ||
| 117 | |||
| 118 | static struct platform_device scif5_device = { | ||
| 119 | .name = "sh-sci", | ||
| 120 | .id = 5, | ||
| 75 | .dev = { | 121 | .dev = { |
| 76 | .platform_data = sci_platform_data, | 122 | .platform_data = &scif5_platform_data, |
| 77 | }, | 123 | }, |
| 78 | }; | 124 | }; |
| 79 | 125 | ||
| @@ -590,6 +636,12 @@ static struct platform_device spu1_device = { | |||
| 590 | }; | 636 | }; |
| 591 | 637 | ||
| 592 | static struct platform_device *sh7724_devices[] __initdata = { | 638 | static struct platform_device *sh7724_devices[] __initdata = { |
| 639 | &scif0_device, | ||
| 640 | &scif1_device, | ||
| 641 | &scif2_device, | ||
| 642 | &scif3_device, | ||
| 643 | &scif4_device, | ||
| 644 | &scif5_device, | ||
| 593 | &cmt_device, | 645 | &cmt_device, |
| 594 | &tmu0_device, | 646 | &tmu0_device, |
| 595 | &tmu1_device, | 647 | &tmu1_device, |
| @@ -597,7 +649,6 @@ static struct platform_device *sh7724_devices[] __initdata = { | |||
| 597 | &tmu3_device, | 649 | &tmu3_device, |
| 598 | &tmu4_device, | 650 | &tmu4_device, |
| 599 | &tmu5_device, | 651 | &tmu5_device, |
| 600 | &sci_device, | ||
| 601 | &rtc_device, | 652 | &rtc_device, |
| 602 | &iic0_device, | 653 | &iic0_device, |
| 603 | &iic1_device, | 654 | &iic1_device, |
| @@ -624,6 +675,12 @@ static int __init sh7724_devices_setup(void) | |||
| 624 | arch_initcall(sh7724_devices_setup); | 675 | arch_initcall(sh7724_devices_setup); |
| 625 | 676 | ||
| 626 | static struct platform_device *sh7724_early_devices[] __initdata = { | 677 | static struct platform_device *sh7724_early_devices[] __initdata = { |
| 678 | &scif0_device, | ||
| 679 | &scif1_device, | ||
| 680 | &scif2_device, | ||
| 681 | &scif3_device, | ||
| 682 | &scif4_device, | ||
| 683 | &scif5_device, | ||
| 627 | &cmt_device, | 684 | &cmt_device, |
| 628 | &tmu0_device, | 685 | &tmu0_device, |
| 629 | &tmu1_device, | 686 | &tmu1_device, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c index c470e15f2e03..37e32efbbaa7 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c | |||
| @@ -17,6 +17,51 @@ | |||
| 17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
| 18 | #include <linux/sh_timer.h> | 18 | #include <linux/sh_timer.h> |
| 19 | 19 | ||
| 20 | static struct plat_sci_port scif2_platform_data = { | ||
| 21 | .mapbase = 0xfe4b0000, /* SCIF2 */ | ||
| 22 | .flags = UPF_BOOT_AUTOCONF, | ||
| 23 | .type = PORT_SCIF, | ||
| 24 | .irqs = { 40, 40, 40, 40 }, | ||
| 25 | }; | ||
| 26 | |||
| 27 | static struct platform_device scif2_device = { | ||
| 28 | .name = "sh-sci", | ||
| 29 | .id = 2, | ||
| 30 | .dev = { | ||
| 31 | .platform_data = &scif2_platform_data, | ||
| 32 | }, | ||
| 33 | }; | ||
| 34 | |||
| 35 | static struct plat_sci_port scif3_platform_data = { | ||
| 36 | .mapbase = 0xfe4c0000, /* SCIF3 */ | ||
| 37 | .flags = UPF_BOOT_AUTOCONF, | ||
| 38 | .type = PORT_SCIF, | ||
| 39 | .irqs = { 76, 76, 76, 76 }, | ||
| 40 | }; | ||
| 41 | |||
| 42 | static struct platform_device scif3_device = { | ||
| 43 | .name = "sh-sci", | ||
| 44 | .id = 3, | ||
| 45 | .dev = { | ||
| 46 | .platform_data = &scif3_platform_data, | ||
| 47 | }, | ||
| 48 | }; | ||
| 49 | |||
| 50 | static struct plat_sci_port scif4_platform_data = { | ||
| 51 | .mapbase = 0xfe4d0000, /* SCIF4 */ | ||
| 52 | .flags = UPF_BOOT_AUTOCONF, | ||
| 53 | .type = PORT_SCIF, | ||
| 54 | .irqs = { 104, 104, 104, 104 }, | ||
| 55 | }; | ||
| 56 | |||
| 57 | static struct platform_device scif4_device = { | ||
| 58 | .name = "sh-sci", | ||
| 59 | .id = 4, | ||
| 60 | .dev = { | ||
| 61 | .platform_data = &scif4_platform_data, | ||
| 62 | }, | ||
| 63 | }; | ||
| 64 | |||
| 20 | static struct sh_timer_config tmu0_platform_data = { | 65 | static struct sh_timer_config tmu0_platform_data = { |
| 21 | .name = "TMU0", | 66 | .name = "TMU0", |
| 22 | .channel_offset = 0x04, | 67 | .channel_offset = 0x04, |
| @@ -79,39 +124,12 @@ static struct platform_device tmu1_device = { | |||
| 79 | .num_resources = ARRAY_SIZE(tmu1_resources), | 124 | .num_resources = ARRAY_SIZE(tmu1_resources), |
| 80 | }; | 125 | }; |
| 81 | 126 | ||
| 82 | static struct plat_sci_port sci_platform_data[] = { | ||
| 83 | { | ||
| 84 | .mapbase = 0xfe4b0000, /* SCIF2 */ | ||
| 85 | .flags = UPF_BOOT_AUTOCONF, | ||
| 86 | .type = PORT_SCIF, | ||
| 87 | .irqs = { 40, 40, 40, 40 }, | ||
| 88 | }, { | ||
| 89 | .mapbase = 0xfe4c0000, /* SCIF3 */ | ||
| 90 | .flags = UPF_BOOT_AUTOCONF, | ||
| 91 | .type = PORT_SCIF, | ||
| 92 | .irqs = { 76, 76, 76, 76 }, | ||
| 93 | }, { | ||
| 94 | .mapbase = 0xfe4d0000, /* SCIF4 */ | ||
| 95 | .flags = UPF_BOOT_AUTOCONF, | ||
| 96 | .type = PORT_SCIF, | ||
| 97 | .irqs = { 104, 104, 104, 104 }, | ||
| 98 | }, { | ||
| 99 | .flags = 0, | ||
| 100 | } | ||
| 101 | }; | ||
| 102 | |||
| 103 | static struct platform_device sci_device = { | ||
| 104 | .name = "sh-sci", | ||
| 105 | .id = -1, | ||
| 106 | .dev = { | ||
| 107 | .platform_data = sci_platform_data, | ||
| 108 | }, | ||
| 109 | }; | ||
| 110 | |||
| 111 | static struct platform_device *sh7757_devices[] __initdata = { | 127 | static struct platform_device *sh7757_devices[] __initdata = { |
| 128 | &scif2_device, | ||
| 129 | &scif3_device, | ||
| 130 | &scif4_device, | ||
| 112 | &tmu0_device, | 131 | &tmu0_device, |
| 113 | &tmu1_device, | 132 | &tmu1_device, |
| 114 | &sci_device, | ||
| 115 | }; | 133 | }; |
| 116 | 134 | ||
| 117 | static int __init sh7757_devices_setup(void) | 135 | static int __init sh7757_devices_setup(void) |
| @@ -121,6 +139,20 @@ static int __init sh7757_devices_setup(void) | |||
| 121 | } | 139 | } |
| 122 | arch_initcall(sh7757_devices_setup); | 140 | arch_initcall(sh7757_devices_setup); |
| 123 | 141 | ||
| 142 | static struct platform_device *sh7757_early_devices[] __initdata = { | ||
| 143 | &scif2_device, | ||
| 144 | &scif3_device, | ||
| 145 | &scif4_device, | ||
| 146 | &tmu0_device, | ||
| 147 | &tmu1_device, | ||
| 148 | }; | ||
| 149 | |||
| 150 | void __init plat_early_device_setup(void) | ||
| 151 | { | ||
| 152 | early_platform_add_devices(sh7757_early_devices, | ||
| 153 | ARRAY_SIZE(sh7757_early_devices)); | ||
| 154 | } | ||
| 155 | |||
| 124 | enum { | 156 | enum { |
| 125 | UNUSED = 0, | 157 | UNUSED = 0, |
| 126 | 158 | ||
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c index 4659fff6b842..6aba26fec416 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c | |||
| @@ -16,6 +16,51 @@ | |||
| 16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
| 17 | #include <linux/serial_sci.h> | 17 | #include <linux/serial_sci.h> |
| 18 | 18 | ||
| 19 | static struct plat_sci_port scif0_platform_data = { | ||
| 20 | .mapbase = 0xffe00000, | ||
| 21 | .flags = UPF_BOOT_AUTOCONF, | ||
| 22 | .type = PORT_SCIF, | ||
| 23 | .irqs = { 40, 40, 40, 40 }, | ||
| 24 | }; | ||
| 25 | |||
| 26 | static struct platform_device scif0_device = { | ||
| 27 | .name = "sh-sci", | ||
| 28 | .id = 0, | ||
| 29 | .dev = { | ||
| 30 | .platform_data = &scif0_platform_data, | ||
| 31 | }, | ||
| 32 | }; | ||
| 33 | |||
| 34 | static struct plat_sci_port scif1_platform_data = { | ||
| 35 | .mapbase = 0xffe08000, | ||
| 36 | .flags = UPF_BOOT_AUTOCONF, | ||
| 37 | .type = PORT_SCIF, | ||
| 38 | .irqs = { 76, 76, 76, 76 }, | ||
| 39 | }; | ||
| 40 | |||
| 41 | static struct platform_device scif1_device = { | ||
| 42 | .name = "sh-sci", | ||
| 43 | .id = 1, | ||
| 44 | .dev = { | ||
| 45 | .platform_data = &scif1_platform_data, | ||
| 46 | }, | ||
| 47 | }; | ||
| 48 | |||
| 49 | static struct plat_sci_port scif2_platform_data = { | ||
| 50 | .mapbase = 0xffe10000, | ||
| 51 | .flags = UPF_BOOT_AUTOCONF, | ||
| 52 | .type = PORT_SCIF, | ||
| 53 | .irqs = { 104, 104, 104, 104 }, | ||
| 54 | }; | ||
| 55 | |||
| 56 | static struct platform_device scif2_device = { | ||
| 57 | .name = "sh-sci", | ||
| 58 | .id = 2, | ||
| 59 | .dev = { | ||
| 60 | .platform_data = &scif2_platform_data, | ||
| 61 | }, | ||
| 62 | }; | ||
| 63 | |||
| 19 | static struct resource rtc_resources[] = { | 64 | static struct resource rtc_resources[] = { |
| 20 | [0] = { | 65 | [0] = { |
| 21 | .start = 0xffe80000, | 66 | .start = 0xffe80000, |
| @@ -36,35 +81,6 @@ static struct platform_device rtc_device = { | |||
| 36 | .resource = rtc_resources, | 81 | .resource = rtc_resources, |
| 37 | }; | 82 | }; |
| 38 | 83 | ||
| 39 | static struct plat_sci_port sci_platform_data[] = { | ||
| 40 | { | ||
| 41 | .mapbase = 0xffe00000, | ||
| 42 | .flags = UPF_BOOT_AUTOCONF, | ||
| 43 | .type = PORT_SCIF, | ||
| 44 | .irqs = { 40, 40, 40, 40 }, | ||
| 45 | }, { | ||
| 46 | .mapbase = 0xffe08000, | ||
| 47 | .flags = UPF_BOOT_AUTOCONF, | ||
| 48 | .type = PORT_SCIF, | ||
| 49 | .irqs = { 76, 76, 76, 76 }, | ||
| 50 | }, { | ||
| 51 | .mapbase = 0xffe10000, | ||
| 52 | .flags = UPF_BOOT_AUTOCONF, | ||
| 53 | .type = PORT_SCIF, | ||
| 54 | .irqs = { 104, 104, 104, 104 }, | ||
| 55 | }, { | ||
| 56 | .flags = 0, | ||
| 57 | } | ||
| 58 | }; | ||
| 59 | |||
| 60 | static struct platform_device sci_device = { | ||
| 61 | .name = "sh-sci", | ||
| 62 | .id = -1, | ||
| 63 | .dev = { | ||
| 64 | .platform_data = sci_platform_data, | ||
| 65 | }, | ||
| 66 | }; | ||
| 67 | |||
| 68 | static struct resource usb_ohci_resources[] = { | 84 | static struct resource usb_ohci_resources[] = { |
| 69 | [0] = { | 85 | [0] = { |
| 70 | .start = 0xffec8000, | 86 | .start = 0xffec8000, |
| @@ -297,6 +313,9 @@ static struct platform_device tmu5_device = { | |||
| 297 | }; | 313 | }; |
| 298 | 314 | ||
| 299 | static struct platform_device *sh7763_devices[] __initdata = { | 315 | static struct platform_device *sh7763_devices[] __initdata = { |
| 316 | &scif0_device, | ||
| 317 | &scif1_device, | ||
| 318 | &scif2_device, | ||
| 300 | &tmu0_device, | 319 | &tmu0_device, |
| 301 | &tmu1_device, | 320 | &tmu1_device, |
| 302 | &tmu2_device, | 321 | &tmu2_device, |
| @@ -304,7 +323,6 @@ static struct platform_device *sh7763_devices[] __initdata = { | |||
| 304 | &tmu4_device, | 323 | &tmu4_device, |
| 305 | &tmu5_device, | 324 | &tmu5_device, |
| 306 | &rtc_device, | 325 | &rtc_device, |
| 307 | &sci_device, | ||
| 308 | &usb_ohci_device, | 326 | &usb_ohci_device, |
| 309 | &usbf_device, | 327 | &usbf_device, |
| 310 | }; | 328 | }; |
| @@ -317,6 +335,9 @@ static int __init sh7763_devices_setup(void) | |||
| 317 | arch_initcall(sh7763_devices_setup); | 335 | arch_initcall(sh7763_devices_setup); |
| 318 | 336 | ||
| 319 | static struct platform_device *sh7763_early_devices[] __initdata = { | 337 | static struct platform_device *sh7763_early_devices[] __initdata = { |
| 338 | &scif0_device, | ||
| 339 | &scif1_device, | ||
| 340 | &scif2_device, | ||
| 320 | &tmu0_device, | 341 | &tmu0_device, |
| 321 | &tmu1_device, | 342 | &tmu1_device, |
| 322 | &tmu2_device, | 343 | &tmu2_device, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c index eead08d89d32..c1643bc9590d 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c | |||
| @@ -14,67 +14,153 @@ | |||
| 14 | #include <linux/sh_timer.h> | 14 | #include <linux/sh_timer.h> |
| 15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
| 16 | 16 | ||
| 17 | static struct plat_sci_port sci_platform_data[] = { | 17 | static struct plat_sci_port scif0_platform_data = { |
| 18 | { | 18 | .mapbase = 0xff923000, |
| 19 | .mapbase = 0xff923000, | 19 | .flags = UPF_BOOT_AUTOCONF, |
| 20 | .flags = UPF_BOOT_AUTOCONF, | 20 | .type = PORT_SCIF, |
| 21 | .type = PORT_SCIF, | 21 | .irqs = { 61, 61, 61, 61 }, |
| 22 | .irqs = { 61, 61, 61, 61 }, | 22 | }; |
| 23 | }, { | 23 | |
| 24 | .mapbase = 0xff924000, | 24 | static struct platform_device scif0_device = { |
| 25 | .flags = UPF_BOOT_AUTOCONF, | 25 | .name = "sh-sci", |
| 26 | .type = PORT_SCIF, | 26 | .id = 0, |
| 27 | .irqs = { 62, 62, 62, 62 }, | 27 | .dev = { |
| 28 | }, { | 28 | .platform_data = &scif0_platform_data, |
| 29 | .mapbase = 0xff925000, | 29 | }, |
| 30 | .flags = UPF_BOOT_AUTOCONF, | 30 | }; |
| 31 | .type = PORT_SCIF, | 31 | |
| 32 | .irqs = { 63, 63, 63, 63 }, | 32 | static struct plat_sci_port scif1_platform_data = { |
| 33 | }, { | 33 | .mapbase = 0xff924000, |
| 34 | .mapbase = 0xff926000, | 34 | .flags = UPF_BOOT_AUTOCONF, |
| 35 | .flags = UPF_BOOT_AUTOCONF, | 35 | .type = PORT_SCIF, |
| 36 | .type = PORT_SCIF, | 36 | .irqs = { 62, 62, 62, 62 }, |
| 37 | .irqs = { 64, 64, 64, 64 }, | 37 | }; |
| 38 | }, { | 38 | |
| 39 | .mapbase = 0xff927000, | 39 | static struct platform_device scif1_device = { |
| 40 | .flags = UPF_BOOT_AUTOCONF, | 40 | .name = "sh-sci", |
| 41 | .type = PORT_SCIF, | 41 | .id = 1, |
| 42 | .irqs = { 65, 65, 65, 65 }, | 42 | .dev = { |
| 43 | }, { | 43 | .platform_data = &scif1_platform_data, |
| 44 | .mapbase = 0xff928000, | 44 | }, |
| 45 | .flags = UPF_BOOT_AUTOCONF, | 45 | }; |
| 46 | .type = PORT_SCIF, | 46 | |
| 47 | .irqs = { 66, 66, 66, 66 }, | 47 | static struct plat_sci_port scif2_platform_data = { |
| 48 | }, { | 48 | .mapbase = 0xff925000, |
| 49 | .mapbase = 0xff929000, | 49 | .flags = UPF_BOOT_AUTOCONF, |
| 50 | .flags = UPF_BOOT_AUTOCONF, | 50 | .type = PORT_SCIF, |
| 51 | .type = PORT_SCIF, | 51 | .irqs = { 63, 63, 63, 63 }, |
| 52 | .irqs = { 67, 67, 67, 67 }, | 52 | }; |
| 53 | }, { | 53 | |
| 54 | .mapbase = 0xff92a000, | 54 | static struct platform_device scif2_device = { |
| 55 | .flags = UPF_BOOT_AUTOCONF, | 55 | .name = "sh-sci", |
| 56 | .type = PORT_SCIF, | 56 | .id = 2, |
| 57 | .irqs = { 68, 68, 68, 68 }, | 57 | .dev = { |
| 58 | }, { | 58 | .platform_data = &scif2_platform_data, |
| 59 | .mapbase = 0xff92b000, | 59 | }, |
| 60 | .flags = UPF_BOOT_AUTOCONF, | 60 | }; |
| 61 | .type = PORT_SCIF, | 61 | |
| 62 | .irqs = { 69, 69, 69, 69 }, | 62 | static struct plat_sci_port scif3_platform_data = { |
| 63 | }, { | 63 | .mapbase = 0xff926000, |
| 64 | .mapbase = 0xff92c000, | 64 | .flags = UPF_BOOT_AUTOCONF, |
| 65 | .flags = UPF_BOOT_AUTOCONF, | 65 | .type = PORT_SCIF, |
| 66 | .type = PORT_SCIF, | 66 | .irqs = { 64, 64, 64, 64 }, |
| 67 | .irqs = { 70, 70, 70, 70 }, | 67 | }; |
| 68 | }, { | 68 | |
| 69 | .flags = 0, | 69 | static struct platform_device scif3_device = { |
| 70 | } | 70 | .name = "sh-sci", |
| 71 | .id = 3, | ||
| 72 | .dev = { | ||
| 73 | .platform_data = &scif3_platform_data, | ||
| 74 | }, | ||
| 75 | }; | ||
| 76 | |||
| 77 | static struct plat_sci_port scif4_platform_data = { | ||
| 78 | .mapbase = 0xff927000, | ||
| 79 | .flags = UPF_BOOT_AUTOCONF, | ||
| 80 | .type = PORT_SCIF, | ||
| 81 | .irqs = { 65, 65, 65, 65 }, | ||
| 82 | }; | ||
| 83 | |||
| 84 | static struct platform_device scif4_device = { | ||
| 85 | .name = "sh-sci", | ||
| 86 | .id = 4, | ||
| 87 | .dev = { | ||
| 88 | .platform_data = &scif4_platform_data, | ||
| 89 | }, | ||
| 90 | }; | ||
| 91 | |||
| 92 | static struct plat_sci_port scif5_platform_data = { | ||
| 93 | .mapbase = 0xff928000, | ||
| 94 | .flags = UPF_BOOT_AUTOCONF, | ||
| 95 | .type = PORT_SCIF, | ||
| 96 | .irqs = { 66, 66, 66, 66 }, | ||
| 97 | }; | ||
| 98 | |||
| 99 | static struct platform_device scif5_device = { | ||
| 100 | .name = "sh-sci", | ||
| 101 | .id = 5, | ||
| 102 | .dev = { | ||
| 103 | .platform_data = &scif5_platform_data, | ||
| 104 | }, | ||
| 105 | }; | ||
| 106 | |||
| 107 | static struct plat_sci_port scif6_platform_data = { | ||
| 108 | .mapbase = 0xff929000, | ||
| 109 | .flags = UPF_BOOT_AUTOCONF, | ||
| 110 | .type = PORT_SCIF, | ||
| 111 | .irqs = { 67, 67, 67, 67 }, | ||
| 112 | }; | ||
| 113 | |||
| 114 | static struct platform_device scif6_device = { | ||
| 115 | .name = "sh-sci", | ||
| 116 | .id = 6, | ||
| 117 | .dev = { | ||
| 118 | .platform_data = &scif6_platform_data, | ||
| 119 | }, | ||
| 120 | }; | ||
| 121 | |||
| 122 | static struct plat_sci_port scif7_platform_data = { | ||
| 123 | .mapbase = 0xff92a000, | ||
| 124 | .flags = UPF_BOOT_AUTOCONF, | ||
| 125 | .type = PORT_SCIF, | ||
| 126 | .irqs = { 68, 68, 68, 68 }, | ||
| 127 | }; | ||
| 128 | |||
| 129 | static struct platform_device scif7_device = { | ||
| 130 | .name = "sh-sci", | ||
| 131 | .id = 7, | ||
| 132 | .dev = { | ||
| 133 | .platform_data = &scif7_platform_data, | ||
| 134 | }, | ||
| 135 | }; | ||
| 136 | |||
| 137 | static struct plat_sci_port scif8_platform_data = { | ||
| 138 | .mapbase = 0xff92b000, | ||
| 139 | .flags = UPF_BOOT_AUTOCONF, | ||
| 140 | .type = PORT_SCIF, | ||
| 141 | .irqs = { 69, 69, 69, 69 }, | ||
| 142 | }; | ||
| 143 | |||
| 144 | static struct platform_device scif8_device = { | ||
| 145 | .name = "sh-sci", | ||
| 146 | .id = 8, | ||
| 147 | .dev = { | ||
| 148 | .platform_data = &scif8_platform_data, | ||
| 149 | }, | ||
| 150 | }; | ||
| 151 | |||
| 152 | static struct plat_sci_port scif9_platform_data = { | ||
| 153 | .mapbase = 0xff92c000, | ||
| 154 | .flags = UPF_BOOT_AUTOCONF, | ||
| 155 | .type = PORT_SCIF, | ||
| 156 | .irqs = { 70, 70, 70, 70 }, | ||
| 71 | }; | 157 | }; |
| 72 | 158 | ||
| 73 | static struct platform_device sci_device = { | 159 | static struct platform_device scif9_device = { |
| 74 | .name = "sh-sci", | 160 | .name = "sh-sci", |
| 75 | .id = -1, | 161 | .id = 9, |
| 76 | .dev = { | 162 | .dev = { |
| 77 | .platform_data = sci_platform_data, | 163 | .platform_data = &scif9_platform_data, |
| 78 | }, | 164 | }, |
| 79 | }; | 165 | }; |
| 80 | 166 | ||
| @@ -351,6 +437,16 @@ static struct platform_device tmu8_device = { | |||
| 351 | }; | 437 | }; |
| 352 | 438 | ||
| 353 | static struct platform_device *sh7770_devices[] __initdata = { | 439 | static struct platform_device *sh7770_devices[] __initdata = { |
| 440 | &scif0_device, | ||
| 441 | &scif1_device, | ||
| 442 | &scif2_device, | ||
| 443 | &scif3_device, | ||
| 444 | &scif4_device, | ||
| 445 | &scif5_device, | ||
| 446 | &scif6_device, | ||
| 447 | &scif7_device, | ||
| 448 | &scif8_device, | ||
| 449 | &scif9_device, | ||
| 354 | &tmu0_device, | 450 | &tmu0_device, |
| 355 | &tmu1_device, | 451 | &tmu1_device, |
| 356 | &tmu2_device, | 452 | &tmu2_device, |
| @@ -360,7 +456,6 @@ static struct platform_device *sh7770_devices[] __initdata = { | |||
| 360 | &tmu6_device, | 456 | &tmu6_device, |
| 361 | &tmu7_device, | 457 | &tmu7_device, |
| 362 | &tmu8_device, | 458 | &tmu8_device, |
| 363 | &sci_device, | ||
| 364 | }; | 459 | }; |
| 365 | 460 | ||
| 366 | static int __init sh7770_devices_setup(void) | 461 | static int __init sh7770_devices_setup(void) |
| @@ -371,6 +466,16 @@ static int __init sh7770_devices_setup(void) | |||
| 371 | arch_initcall(sh7770_devices_setup); | 466 | arch_initcall(sh7770_devices_setup); |
| 372 | 467 | ||
| 373 | static struct platform_device *sh7770_early_devices[] __initdata = { | 468 | static struct platform_device *sh7770_early_devices[] __initdata = { |
| 469 | &scif0_device, | ||
| 470 | &scif1_device, | ||
| 471 | &scif2_device, | ||
| 472 | &scif3_device, | ||
| 473 | &scif4_device, | ||
| 474 | &scif5_device, | ||
| 475 | &scif6_device, | ||
| 476 | &scif7_device, | ||
| 477 | &scif8_device, | ||
| 478 | &scif9_device, | ||
| 374 | &tmu0_device, | 479 | &tmu0_device, |
| 375 | &tmu1_device, | 480 | &tmu1_device, |
| 376 | &tmu2_device, | 481 | &tmu2_device, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c index 12ff56f19c5c..c310558490d5 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c | |||
| @@ -15,6 +15,36 @@ | |||
| 15 | #include <linux/sh_timer.h> | 15 | #include <linux/sh_timer.h> |
| 16 | #include <asm/dma-sh.h> | 16 | #include <asm/dma-sh.h> |
| 17 | 17 | ||
| 18 | static struct plat_sci_port scif0_platform_data = { | ||
| 19 | .mapbase = 0xffe00000, | ||
| 20 | .flags = UPF_BOOT_AUTOCONF, | ||
| 21 | .type = PORT_SCIF, | ||
| 22 | .irqs = { 40, 40, 40, 40 }, | ||
| 23 | }; | ||
| 24 | |||
| 25 | static struct platform_device scif0_device = { | ||
| 26 | .name = "sh-sci", | ||
| 27 | .id = 0, | ||
| 28 | .dev = { | ||
| 29 | .platform_data = &scif0_platform_data, | ||
| 30 | }, | ||
| 31 | }; | ||
| 32 | |||
| 33 | static struct plat_sci_port scif1_platform_data = { | ||
| 34 | .mapbase = 0xffe10000, | ||
| 35 | .flags = UPF_BOOT_AUTOCONF, | ||
| 36 | .type = PORT_SCIF, | ||
| 37 | .irqs = { 76, 76, 76, 76 }, | ||
| 38 | }; | ||
| 39 | |||
| 40 | static struct platform_device scif1_device = { | ||
| 41 | .name = "sh-sci", | ||
| 42 | .id = 1, | ||
| 43 | .dev = { | ||
| 44 | .platform_data = &scif1_platform_data, | ||
| 45 | }, | ||
| 46 | }; | ||
| 47 | |||
| 18 | static struct sh_timer_config tmu0_platform_data = { | 48 | static struct sh_timer_config tmu0_platform_data = { |
| 19 | .name = "TMU0", | 49 | .name = "TMU0", |
| 20 | .channel_offset = 0x04, | 50 | .channel_offset = 0x04, |
| @@ -217,30 +247,6 @@ static struct platform_device rtc_device = { | |||
| 217 | .resource = rtc_resources, | 247 | .resource = rtc_resources, |
| 218 | }; | 248 | }; |
| 219 | 249 | ||
| 220 | static struct plat_sci_port sci_platform_data[] = { | ||
| 221 | { | ||
| 222 | .mapbase = 0xffe00000, | ||
| 223 | .flags = UPF_BOOT_AUTOCONF, | ||
| 224 | .type = PORT_SCIF, | ||
| 225 | .irqs = { 40, 40, 40, 40 }, | ||
| 226 | }, { | ||
| 227 | .mapbase = 0xffe10000, | ||
| 228 | .flags = UPF_BOOT_AUTOCONF, | ||
| 229 | .type = PORT_SCIF, | ||
| 230 | .irqs = { 76, 76, 76, 76 }, | ||
| 231 | }, { | ||
| 232 | .flags = 0, | ||
| 233 | } | ||
| 234 | }; | ||
| 235 | |||
| 236 | static struct platform_device sci_device = { | ||
| 237 | .name = "sh-sci", | ||
| 238 | .id = -1, | ||
| 239 | .dev = { | ||
| 240 | .platform_data = sci_platform_data, | ||
| 241 | }, | ||
| 242 | }; | ||
| 243 | |||
| 244 | static struct sh_dmae_pdata dma_platform_data = { | 250 | static struct sh_dmae_pdata dma_platform_data = { |
| 245 | .mode = (SHDMA_MIX_IRQ | SHDMA_DMAOR1), | 251 | .mode = (SHDMA_MIX_IRQ | SHDMA_DMAOR1), |
| 246 | }; | 252 | }; |
| @@ -254,6 +260,8 @@ static struct platform_device dma_device = { | |||
| 254 | }; | 260 | }; |
| 255 | 261 | ||
| 256 | static struct platform_device *sh7780_devices[] __initdata = { | 262 | static struct platform_device *sh7780_devices[] __initdata = { |
| 263 | &scif0_device, | ||
| 264 | &scif1_device, | ||
| 257 | &tmu0_device, | 265 | &tmu0_device, |
| 258 | &tmu1_device, | 266 | &tmu1_device, |
| 259 | &tmu2_device, | 267 | &tmu2_device, |
| @@ -261,7 +269,6 @@ static struct platform_device *sh7780_devices[] __initdata = { | |||
| 261 | &tmu4_device, | 269 | &tmu4_device, |
| 262 | &tmu5_device, | 270 | &tmu5_device, |
| 263 | &rtc_device, | 271 | &rtc_device, |
| 264 | &sci_device, | ||
| 265 | &dma_device, | 272 | &dma_device, |
| 266 | }; | 273 | }; |
| 267 | 274 | ||
| @@ -271,8 +278,9 @@ static int __init sh7780_devices_setup(void) | |||
| 271 | ARRAY_SIZE(sh7780_devices)); | 278 | ARRAY_SIZE(sh7780_devices)); |
| 272 | } | 279 | } |
| 273 | arch_initcall(sh7780_devices_setup); | 280 | arch_initcall(sh7780_devices_setup); |
| 274 | |||
| 275 | static struct platform_device *sh7780_early_devices[] __initdata = { | 281 | static struct platform_device *sh7780_early_devices[] __initdata = { |
| 282 | &scif0_device, | ||
| 283 | &scif1_device, | ||
| 276 | &tmu0_device, | 284 | &tmu0_device, |
| 277 | &tmu1_device, | 285 | &tmu1_device, |
| 278 | &tmu2_device, | 286 | &tmu2_device, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c index 7f6c718b6c36..ef26ebda6e8b 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c | |||
| @@ -16,6 +16,102 @@ | |||
| 16 | #include <linux/sh_timer.h> | 16 | #include <linux/sh_timer.h> |
| 17 | #include <asm/mmzone.h> | 17 | #include <asm/mmzone.h> |
| 18 | 18 | ||
| 19 | static struct plat_sci_port scif0_platform_data = { | ||
| 20 | .mapbase = 0xffea0000, | ||
| 21 | .flags = UPF_BOOT_AUTOCONF, | ||
| 22 | .type = PORT_SCIF, | ||
| 23 | .irqs = { 40, 40, 40, 40 }, | ||
| 24 | .clk = "scif_fck", | ||
| 25 | }; | ||
| 26 | |||
| 27 | static struct platform_device scif0_device = { | ||
| 28 | .name = "sh-sci", | ||
| 29 | .id = 0, | ||
| 30 | .dev = { | ||
| 31 | .platform_data = &scif0_platform_data, | ||
| 32 | }, | ||
| 33 | }; | ||
| 34 | |||
| 35 | static struct plat_sci_port scif1_platform_data = { | ||
| 36 | .mapbase = 0xffeb0000, | ||
| 37 | .flags = UPF_BOOT_AUTOCONF, | ||
| 38 | .type = PORT_SCIF, | ||
| 39 | .irqs = { 44, 44, 44, 44 }, | ||
| 40 | .clk = "scif_fck", | ||
| 41 | }; | ||
| 42 | |||
| 43 | static struct platform_device scif1_device = { | ||
| 44 | .name = "sh-sci", | ||
| 45 | .id = 1, | ||
| 46 | .dev = { | ||
| 47 | .platform_data = &scif1_platform_data, | ||
| 48 | }, | ||
| 49 | }; | ||
| 50 | |||
| 51 | static struct plat_sci_port scif2_platform_data = { | ||
| 52 | .mapbase = 0xffec0000, | ||
| 53 | .flags = UPF_BOOT_AUTOCONF, | ||
| 54 | .type = PORT_SCIF, | ||
| 55 | .irqs = { 60, 60, 60, 60 }, | ||
| 56 | .clk = "scif_fck", | ||
| 57 | }; | ||
| 58 | |||
| 59 | static struct platform_device scif2_device = { | ||
| 60 | .name = "sh-sci", | ||
| 61 | .id = 2, | ||
| 62 | .dev = { | ||
| 63 | .platform_data = &scif2_platform_data, | ||
| 64 | }, | ||
| 65 | }; | ||
| 66 | |||
| 67 | static struct plat_sci_port scif3_platform_data = { | ||
| 68 | .mapbase = 0xffed0000, | ||
| 69 | .flags = UPF_BOOT_AUTOCONF, | ||
| 70 | .type = PORT_SCIF, | ||
| 71 | .irqs = { 61, 61, 61, 61 }, | ||
| 72 | .clk = "scif_fck", | ||
| 73 | }; | ||
| 74 | |||
| 75 | static struct platform_device scif3_device = { | ||
| 76 | .name = "sh-sci", | ||
| 77 | .id = 3, | ||
| 78 | .dev = { | ||
| 79 | .platform_data = &scif3_platform_data, | ||
| 80 | }, | ||
| 81 | }; | ||
| 82 | |||
| 83 | static struct plat_sci_port scif4_platform_data = { | ||
| 84 | .mapbase = 0xffee0000, | ||
| 85 | .flags = UPF_BOOT_AUTOCONF, | ||
| 86 | .type = PORT_SCIF, | ||
| 87 | .irqs = { 62, 62, 62, 62 }, | ||
| 88 | .clk = "scif_fck", | ||
| 89 | }; | ||
| 90 | |||
| 91 | static struct platform_device scif4_device = { | ||
| 92 | .name = "sh-sci", | ||
| 93 | .id = 4, | ||
| 94 | .dev = { | ||
| 95 | .platform_data = &scif4_platform_data, | ||
| 96 | }, | ||
| 97 | }; | ||
| 98 | |||
| 99 | static struct plat_sci_port scif5_platform_data = { | ||
| 100 | .mapbase = 0xffef0000, | ||
| 101 | .flags = UPF_BOOT_AUTOCONF, | ||
| 102 | .type = PORT_SCIF, | ||
| 103 | .irqs = { 63, 63, 63, 63 }, | ||
| 104 | .clk = "scif_fck", | ||
| 105 | }; | ||
| 106 | |||
| 107 | static struct platform_device scif5_device = { | ||
| 108 | .name = "sh-sci", | ||
| 109 | .id = 5, | ||
| 110 | .dev = { | ||
| 111 | .platform_data = &scif5_platform_data, | ||
| 112 | }, | ||
| 113 | }; | ||
| 114 | |||
| 19 | static struct sh_timer_config tmu0_platform_data = { | 115 | static struct sh_timer_config tmu0_platform_data = { |
| 20 | .name = "TMU0", | 116 | .name = "TMU0", |
| 21 | .channel_offset = 0x04, | 117 | .channel_offset = 0x04, |
| @@ -198,64 +294,19 @@ static struct platform_device tmu5_device = { | |||
| 198 | .num_resources = ARRAY_SIZE(tmu5_resources), | 294 | .num_resources = ARRAY_SIZE(tmu5_resources), |
| 199 | }; | 295 | }; |
| 200 | 296 | ||
| 201 | static struct plat_sci_port sci_platform_data[] = { | ||
| 202 | { | ||
| 203 | .mapbase = 0xffea0000, | ||
| 204 | .flags = UPF_BOOT_AUTOCONF, | ||
| 205 | .type = PORT_SCIF, | ||
| 206 | .irqs = { 40, 40, 40, 40 }, | ||
| 207 | .clk = "scif_fck", | ||
| 208 | }, { | ||
| 209 | .mapbase = 0xffeb0000, | ||
| 210 | .flags = UPF_BOOT_AUTOCONF, | ||
| 211 | .type = PORT_SCIF, | ||
| 212 | .irqs = { 44, 44, 44, 44 }, | ||
| 213 | .clk = "scif_fck", | ||
| 214 | }, { | ||
| 215 | .mapbase = 0xffec0000, | ||
| 216 | .flags = UPF_BOOT_AUTOCONF, | ||
| 217 | .type = PORT_SCIF, | ||
| 218 | .irqs = { 60, 60, 60, 60 }, | ||
| 219 | .clk = "scif_fck", | ||
| 220 | }, { | ||
| 221 | .mapbase = 0xffed0000, | ||
| 222 | .flags = UPF_BOOT_AUTOCONF, | ||
| 223 | .type = PORT_SCIF, | ||
| 224 | .irqs = { 61, 61, 61, 61 }, | ||
| 225 | .clk = "scif_fck", | ||
| 226 | }, { | ||
| 227 | .mapbase = 0xffee0000, | ||
| 228 | .flags = UPF_BOOT_AUTOCONF, | ||
| 229 | .type = PORT_SCIF, | ||
| 230 | .irqs = { 62, 62, 62, 62 }, | ||
| 231 | .clk = "scif_fck", | ||
| 232 | }, { | ||
| 233 | .mapbase = 0xffef0000, | ||
| 234 | .flags = UPF_BOOT_AUTOCONF, | ||
| 235 | .type = PORT_SCIF, | ||
| 236 | .irqs = { 63, 63, 63, 63 }, | ||
| 237 | .clk = "scif_fck", | ||
| 238 | }, { | ||
| 239 | .flags = 0, | ||
| 240 | } | ||
| 241 | }; | ||
| 242 | |||
| 243 | static struct platform_device sci_device = { | ||
| 244 | .name = "sh-sci", | ||
| 245 | .id = -1, | ||
| 246 | .dev = { | ||
| 247 | .platform_data = sci_platform_data, | ||
| 248 | }, | ||
| 249 | }; | ||
| 250 | |||
| 251 | static struct platform_device *sh7785_devices[] __initdata = { | 297 | static struct platform_device *sh7785_devices[] __initdata = { |
| 298 | &scif0_device, | ||
| 299 | &scif1_device, | ||
| 300 | &scif2_device, | ||
| 301 | &scif3_device, | ||
| 302 | &scif4_device, | ||
| 303 | &scif5_device, | ||
| 252 | &tmu0_device, | 304 | &tmu0_device, |
| 253 | &tmu1_device, | 305 | &tmu1_device, |
| 254 | &tmu2_device, | 306 | &tmu2_device, |
| 255 | &tmu3_device, | 307 | &tmu3_device, |
| 256 | &tmu4_device, | 308 | &tmu4_device, |
| 257 | &tmu5_device, | 309 | &tmu5_device, |
| 258 | &sci_device, | ||
| 259 | }; | 310 | }; |
| 260 | 311 | ||
| 261 | static int __init sh7785_devices_setup(void) | 312 | static int __init sh7785_devices_setup(void) |
| @@ -266,6 +317,12 @@ static int __init sh7785_devices_setup(void) | |||
| 266 | arch_initcall(sh7785_devices_setup); | 317 | arch_initcall(sh7785_devices_setup); |
| 267 | 318 | ||
| 268 | static struct platform_device *sh7785_early_devices[] __initdata = { | 319 | static struct platform_device *sh7785_early_devices[] __initdata = { |
| 320 | &scif0_device, | ||
| 321 | &scif1_device, | ||
| 322 | &scif2_device, | ||
| 323 | &scif3_device, | ||
| 324 | &scif4_device, | ||
| 325 | &scif5_device, | ||
| 269 | &tmu0_device, | 326 | &tmu0_device, |
| 270 | &tmu1_device, | 327 | &tmu1_device, |
| 271 | &tmu2_device, | 328 | &tmu2_device, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c index 0104a8ec5369..71673487ace0 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c | |||
| @@ -23,51 +23,96 @@ | |||
| 23 | #include <linux/sh_timer.h> | 23 | #include <linux/sh_timer.h> |
| 24 | #include <asm/mmzone.h> | 24 | #include <asm/mmzone.h> |
| 25 | 25 | ||
| 26 | static struct plat_sci_port sci_platform_data[] = { | 26 | static struct plat_sci_port scif0_platform_data = { |
| 27 | { | 27 | .mapbase = 0xffea0000, |
| 28 | .mapbase = 0xffea0000, | 28 | .flags = UPF_BOOT_AUTOCONF, |
| 29 | .flags = UPF_BOOT_AUTOCONF, | 29 | .type = PORT_SCIF, |
| 30 | .type = PORT_SCIF, | 30 | .irqs = { 40, 41, 43, 42 }, |
| 31 | .irqs = { 40, 41, 43, 42 }, | 31 | }; |
| 32 | |||
| 33 | static struct platform_device scif0_device = { | ||
| 34 | .name = "sh-sci", | ||
| 35 | .id = 0, | ||
| 36 | .dev = { | ||
| 37 | .platform_data = &scif0_platform_data, | ||
| 32 | }, | 38 | }, |
| 33 | /* | ||
| 34 | * The rest of these all have multiplexed IRQs | ||
| 35 | */ | ||
| 36 | { | ||
| 37 | .mapbase = 0xffeb0000, | ||
| 38 | .flags = UPF_BOOT_AUTOCONF, | ||
| 39 | .type = PORT_SCIF, | ||
| 40 | .irqs = { 44, 44, 44, 44 }, | ||
| 41 | }, { | ||
| 42 | .mapbase = 0xffec0000, | ||
| 43 | .flags = UPF_BOOT_AUTOCONF, | ||
| 44 | .type = PORT_SCIF, | ||
| 45 | .irqs = { 50, 50, 50, 50 }, | ||
| 46 | }, { | ||
| 47 | .mapbase = 0xffed0000, | ||
| 48 | .flags = UPF_BOOT_AUTOCONF, | ||
| 49 | .type = PORT_SCIF, | ||
| 50 | .irqs = { 51, 51, 51, 51 }, | ||
| 51 | }, { | ||
| 52 | .mapbase = 0xffee0000, | ||
| 53 | .flags = UPF_BOOT_AUTOCONF, | ||
| 54 | .type = PORT_SCIF, | ||
| 55 | .irqs = { 52, 52, 52, 52 }, | ||
| 56 | }, { | ||
| 57 | .mapbase = 0xffef0000, | ||
| 58 | .flags = UPF_BOOT_AUTOCONF, | ||
| 59 | .type = PORT_SCIF, | ||
| 60 | .irqs = { 53, 53, 53, 53 }, | ||
| 61 | }, { | ||
| 62 | .flags = 0, | ||
| 63 | } | ||
| 64 | }; | 39 | }; |
| 65 | 40 | ||
| 66 | static struct platform_device sci_device = { | 41 | /* |
| 42 | * The rest of these all have multiplexed IRQs | ||
| 43 | */ | ||
| 44 | static struct plat_sci_port scif1_platform_data = { | ||
| 45 | .mapbase = 0xffeb0000, | ||
| 46 | .flags = UPF_BOOT_AUTOCONF, | ||
| 47 | .type = PORT_SCIF, | ||
| 48 | .irqs = { 44, 44, 44, 44 }, | ||
| 49 | }; | ||
| 50 | |||
| 51 | static struct platform_device scif1_device = { | ||
| 67 | .name = "sh-sci", | 52 | .name = "sh-sci", |
| 68 | .id = -1, | 53 | .id = 1, |
| 54 | .dev = { | ||
| 55 | .platform_data = &scif1_platform_data, | ||
| 56 | }, | ||
| 57 | }; | ||
| 58 | |||
| 59 | static struct plat_sci_port scif2_platform_data = { | ||
| 60 | .mapbase = 0xffec0000, | ||
| 61 | .flags = UPF_BOOT_AUTOCONF, | ||
| 62 | .type = PORT_SCIF, | ||
| 63 | .irqs = { 50, 50, 50, 50 }, | ||
| 64 | }; | ||
| 65 | |||
| 66 | static struct platform_device scif2_device = { | ||
| 67 | .name = "sh-sci", | ||
| 68 | .id = 2, | ||
| 69 | .dev = { | ||
| 70 | .platform_data = &scif2_platform_data, | ||
| 71 | }, | ||
| 72 | }; | ||
| 73 | |||
| 74 | static struct plat_sci_port scif3_platform_data = { | ||
| 75 | .mapbase = 0xffed0000, | ||
| 76 | .flags = UPF_BOOT_AUTOCONF, | ||
| 77 | .type = PORT_SCIF, | ||
| 78 | .irqs = { 51, 51, 51, 51 }, | ||
| 79 | }; | ||
| 80 | |||
| 81 | static struct platform_device scif3_device = { | ||
| 82 | .name = "sh-sci", | ||
| 83 | .id = 3, | ||
| 84 | .dev = { | ||
| 85 | .platform_data = &scif3_platform_data, | ||
| 86 | }, | ||
| 87 | }; | ||
| 88 | |||
| 89 | static struct plat_sci_port scif4_platform_data = { | ||
| 90 | .mapbase = 0xffee0000, | ||
| 91 | .flags = UPF_BOOT_AUTOCONF, | ||
| 92 | .type = PORT_SCIF, | ||
| 93 | .irqs = { 52, 52, 52, 52 }, | ||
| 94 | }; | ||
| 95 | |||
| 96 | static struct platform_device scif4_device = { | ||
| 97 | .name = "sh-sci", | ||
| 98 | .id = 4, | ||
| 99 | .dev = { | ||
| 100 | .platform_data = &scif4_platform_data, | ||
| 101 | }, | ||
| 102 | }; | ||
| 103 | |||
| 104 | static struct plat_sci_port scif5_platform_data = { | ||
| 105 | .mapbase = 0xffef0000, | ||
| 106 | .flags = UPF_BOOT_AUTOCONF, | ||
| 107 | .type = PORT_SCIF, | ||
| 108 | .irqs = { 53, 53, 53, 53 }, | ||
| 109 | }; | ||
| 110 | |||
| 111 | static struct platform_device scif5_device = { | ||
| 112 | .name = "sh-sci", | ||
| 113 | .id = 5, | ||
| 69 | .dev = { | 114 | .dev = { |
| 70 | .platform_data = sci_platform_data, | 115 | .platform_data = &scif5_platform_data, |
| 71 | }, | 116 | }, |
| 72 | }; | 117 | }; |
| 73 | 118 | ||
| @@ -459,6 +504,12 @@ static struct platform_device usb_ohci_device = { | |||
| 459 | }; | 504 | }; |
| 460 | 505 | ||
| 461 | static struct platform_device *sh7786_early_devices[] __initdata = { | 506 | static struct platform_device *sh7786_early_devices[] __initdata = { |
| 507 | &scif0_device, | ||
| 508 | &scif1_device, | ||
| 509 | &scif2_device, | ||
| 510 | &scif3_device, | ||
| 511 | &scif4_device, | ||
| 512 | &scif5_device, | ||
| 462 | &tmu0_device, | 513 | &tmu0_device, |
| 463 | &tmu1_device, | 514 | &tmu1_device, |
| 464 | &tmu2_device, | 515 | &tmu2_device, |
| @@ -474,7 +525,6 @@ static struct platform_device *sh7786_early_devices[] __initdata = { | |||
| 474 | }; | 525 | }; |
| 475 | 526 | ||
| 476 | static struct platform_device *sh7786_devices[] __initdata = { | 527 | static struct platform_device *sh7786_devices[] __initdata = { |
| 477 | &sci_device, | ||
| 478 | &usb_ohci_device, | 528 | &usb_ohci_device, |
| 479 | }; | 529 | }; |
| 480 | 530 | ||
diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c index c7ba9166e18a..780ba17a5599 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c | |||
| @@ -24,32 +24,48 @@ | |||
| 24 | * silicon in the first place, we just refuse to deal with the port at | 24 | * silicon in the first place, we just refuse to deal with the port at |
| 25 | * all rather than adding infrastructure to hack around it. | 25 | * all rather than adding infrastructure to hack around it. |
| 26 | */ | 26 | */ |
| 27 | static struct plat_sci_port sci_platform_data[] = { | 27 | static struct plat_sci_port scif0_platform_data = { |
| 28 | { | 28 | .mapbase = 0xffc30000, |
| 29 | .mapbase = 0xffc30000, | 29 | .flags = UPF_BOOT_AUTOCONF, |
| 30 | .flags = UPF_BOOT_AUTOCONF, | 30 | .type = PORT_SCIF, |
| 31 | .type = PORT_SCIF, | 31 | .irqs = { 40, 41, 43, 42 }, |
| 32 | .irqs = { 40, 41, 43, 42 }, | 32 | }; |
| 33 | }, { | 33 | |
| 34 | .mapbase = 0xffc40000, | 34 | static struct platform_device scif0_device = { |
| 35 | .flags = UPF_BOOT_AUTOCONF, | 35 | .name = "sh-sci", |
| 36 | .type = PORT_SCIF, | 36 | .id = 0, |
| 37 | .irqs = { 44, 45, 47, 46 }, | 37 | .dev = { |
| 38 | }, { | 38 | .platform_data = &scif0_platform_data, |
| 39 | .mapbase = 0xffc60000, | 39 | }, |
| 40 | .flags = UPF_BOOT_AUTOCONF, | 40 | }; |
| 41 | .type = PORT_SCIF, | 41 | |
| 42 | .irqs = { 52, 53, 55, 54 }, | 42 | static struct plat_sci_port scif1_platform_data = { |
| 43 | }, { | 43 | .mapbase = 0xffc40000, |
| 44 | .flags = 0, | 44 | .flags = UPF_BOOT_AUTOCONF, |
| 45 | } | 45 | .type = PORT_SCIF, |
| 46 | .irqs = { 44, 45, 47, 46 }, | ||
| 47 | }; | ||
| 48 | |||
| 49 | static struct platform_device scif1_device = { | ||
| 50 | .name = "sh-sci", | ||
| 51 | .id = 1, | ||
| 52 | .dev = { | ||
| 53 | .platform_data = &scif1_platform_data, | ||
| 54 | }, | ||
| 55 | }; | ||
| 56 | |||
| 57 | static struct plat_sci_port scif2_platform_data = { | ||
| 58 | .mapbase = 0xffc60000, | ||
| 59 | .flags = UPF_BOOT_AUTOCONF, | ||
| 60 | .type = PORT_SCIF, | ||
| 61 | .irqs = { 52, 53, 55, 54 }, | ||
| 46 | }; | 62 | }; |
| 47 | 63 | ||
| 48 | static struct platform_device sci_device = { | 64 | static struct platform_device scif2_device = { |
| 49 | .name = "sh-sci", | 65 | .name = "sh-sci", |
| 50 | .id = -1, | 66 | .id = 2, |
| 51 | .dev = { | 67 | .dev = { |
| 52 | .platform_data = sci_platform_data, | 68 | .platform_data = &scif2_platform_data, |
| 53 | }, | 69 | }, |
| 54 | }; | 70 | }; |
| 55 | 71 | ||
| @@ -236,6 +252,9 @@ static struct platform_device tmu5_device = { | |||
| 236 | }; | 252 | }; |
| 237 | 253 | ||
| 238 | static struct platform_device *shx3_early_devices[] __initdata = { | 254 | static struct platform_device *shx3_early_devices[] __initdata = { |
| 255 | &scif0_device, | ||
| 256 | &scif1_device, | ||
| 257 | &scif2_device, | ||
| 239 | &tmu0_device, | 258 | &tmu0_device, |
| 240 | &tmu1_device, | 259 | &tmu1_device, |
| 241 | &tmu2_device, | 260 | &tmu2_device, |
| @@ -244,21 +263,10 @@ static struct platform_device *shx3_early_devices[] __initdata = { | |||
| 244 | &tmu5_device, | 263 | &tmu5_device, |
| 245 | }; | 264 | }; |
| 246 | 265 | ||
| 247 | static struct platform_device *shx3_devices[] __initdata = { | ||
| 248 | &sci_device, | ||
| 249 | }; | ||
| 250 | |||
| 251 | static int __init shx3_devices_setup(void) | 266 | static int __init shx3_devices_setup(void) |
| 252 | { | 267 | { |
| 253 | int ret; | 268 | return platform_add_devices(shx3_early_devices, |
| 254 | |||
| 255 | ret = platform_add_devices(shx3_early_devices, | ||
| 256 | ARRAY_SIZE(shx3_early_devices)); | 269 | ARRAY_SIZE(shx3_early_devices)); |
| 257 | if (unlikely(ret != 0)) | ||
| 258 | return ret; | ||
| 259 | |||
| 260 | return platform_add_devices(shx3_devices, | ||
| 261 | ARRAY_SIZE(shx3_devices)); | ||
| 262 | } | 270 | } |
| 263 | arch_initcall(shx3_devices_setup); | 271 | arch_initcall(shx3_devices_setup); |
| 264 | 272 | ||
diff --git a/arch/sh/kernel/cpu/sh5/fpu.c b/arch/sh/kernel/cpu/sh5/fpu.c index dd4f51ffb50e..4648ccee6c4d 100644 --- a/arch/sh/kernel/cpu/sh5/fpu.c +++ b/arch/sh/kernel/cpu/sh5/fpu.c | |||
| @@ -34,7 +34,7 @@ static union sh_fpu_union init_fpuregs = { | |||
| 34 | } | 34 | } |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | void save_fpu(struct task_struct *tsk, struct pt_regs *regs) | 37 | void save_fpu(struct task_struct *tsk) |
| 38 | { | 38 | { |
| 39 | asm volatile("fst.p %0, (0*8), fp0\n\t" | 39 | asm volatile("fst.p %0, (0*8), fp0\n\t" |
| 40 | "fst.p %0, (1*8), fp2\n\t" | 40 | "fst.p %0, (1*8), fp2\n\t" |
| @@ -153,7 +153,7 @@ do_fpu_state_restore(unsigned long ex, struct pt_regs *regs) | |||
| 153 | enable_fpu(); | 153 | enable_fpu(); |
| 154 | if (last_task_used_math != NULL) | 154 | if (last_task_used_math != NULL) |
| 155 | /* Other processes fpu state, save away */ | 155 | /* Other processes fpu state, save away */ |
| 156 | save_fpu(last_task_used_math, regs); | 156 | save_fpu(last_task_used_math); |
| 157 | 157 | ||
| 158 | last_task_used_math = current; | 158 | last_task_used_math = current; |
| 159 | if (used_math()) { | 159 | if (used_math()) { |
diff --git a/arch/sh/kernel/cpu/sh5/setup-sh5.c b/arch/sh/kernel/cpu/sh5/setup-sh5.c index 6a0f82f70032..e7a3c1e4b604 100644 --- a/arch/sh/kernel/cpu/sh5/setup-sh5.c +++ b/arch/sh/kernel/cpu/sh5/setup-sh5.c | |||
| @@ -16,22 +16,18 @@ | |||
| 16 | #include <linux/sh_timer.h> | 16 | #include <linux/sh_timer.h> |
| 17 | #include <asm/addrspace.h> | 17 | #include <asm/addrspace.h> |
| 18 | 18 | ||
| 19 | static struct plat_sci_port sci_platform_data[] = { | 19 | static struct plat_sci_port scif0_platform_data = { |
| 20 | { | 20 | .mapbase = PHYS_PERIPHERAL_BLOCK + 0x01030000, |
| 21 | .mapbase = PHYS_PERIPHERAL_BLOCK + 0x01030000, | 21 | .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, |
| 22 | .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, | 22 | .type = PORT_SCIF, |
| 23 | .type = PORT_SCIF, | 23 | .irqs = { 39, 40, 42, 0 }, |
| 24 | .irqs = { 39, 40, 42, 0 }, | ||
| 25 | }, { | ||
| 26 | .flags = 0, | ||
| 27 | } | ||
| 28 | }; | 24 | }; |
| 29 | 25 | ||
| 30 | static struct platform_device sci_device = { | 26 | static struct platform_device scif0_device = { |
| 31 | .name = "sh-sci", | 27 | .name = "sh-sci", |
| 32 | .id = -1, | 28 | .id = 0, |
| 33 | .dev = { | 29 | .dev = { |
| 34 | .platform_data = sci_platform_data, | 30 | .platform_data = &scif0_platform_data, |
| 35 | }, | 31 | }, |
| 36 | }; | 32 | }; |
| 37 | 33 | ||
| @@ -164,13 +160,13 @@ static struct platform_device tmu2_device = { | |||
| 164 | }; | 160 | }; |
| 165 | 161 | ||
| 166 | static struct platform_device *sh5_early_devices[] __initdata = { | 162 | static struct platform_device *sh5_early_devices[] __initdata = { |
| 163 | &scif0_device, | ||
| 167 | &tmu0_device, | 164 | &tmu0_device, |
| 168 | &tmu1_device, | 165 | &tmu1_device, |
| 169 | &tmu2_device, | 166 | &tmu2_device, |
| 170 | }; | 167 | }; |
| 171 | 168 | ||
| 172 | static struct platform_device *sh5_devices[] __initdata = { | 169 | static struct platform_device *sh5_devices[] __initdata = { |
| 173 | &sci_device, | ||
| 174 | &rtc_device, | 170 | &rtc_device, |
| 175 | }; | 171 | }; |
| 176 | 172 | ||
diff --git a/arch/sh/kernel/early_printk.c b/arch/sh/kernel/early_printk.c index 81a46145ffa5..f8bb50c6e050 100644 --- a/arch/sh/kernel/early_printk.c +++ b/arch/sh/kernel/early_printk.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
| 16 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
| 17 | 17 | ||
| 18 | #ifdef CONFIG_SH_STANDARD_BIOS | ||
| 19 | #include <asm/sh_bios.h> | 18 | #include <asm/sh_bios.h> |
| 20 | 19 | ||
| 21 | /* | 20 | /* |
| @@ -57,149 +56,8 @@ static struct console bios_console = { | |||
| 57 | .flags = CON_PRINTBUFFER, | 56 | .flags = CON_PRINTBUFFER, |
| 58 | .index = -1, | 57 | .index = -1, |
| 59 | }; | 58 | }; |
| 60 | #endif | ||
| 61 | 59 | ||
| 62 | #ifdef CONFIG_EARLY_SCIF_CONSOLE | 60 | static struct console *early_console; |
| 63 | #include <linux/serial_core.h> | ||
| 64 | #include "../../../drivers/serial/sh-sci.h" | ||
| 65 | |||
| 66 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | ||
| 67 | defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
| 68 | #define EPK_SCSMR_VALUE 0x000 | ||
| 69 | #define EPK_SCBRR_VALUE 0x00C | ||
| 70 | #define EPK_FIFO_SIZE 64 | ||
| 71 | #define EPK_FIFO_BITS (0x7f00 >> 8) | ||
| 72 | #else | ||
| 73 | #define EPK_FIFO_SIZE 16 | ||
| 74 | #define EPK_FIFO_BITS (0x1f00 >> 8) | ||
| 75 | #endif | ||
| 76 | |||
| 77 | static struct uart_port scif_port = { | ||
| 78 | .type = PORT_SCIF, | ||
| 79 | .mapbase = CONFIG_EARLY_SCIF_CONSOLE_PORT, | ||
| 80 | .membase = (char __iomem *)CONFIG_EARLY_SCIF_CONSOLE_PORT, | ||
| 81 | }; | ||
| 82 | |||
| 83 | static void scif_sercon_putc(int c) | ||
| 84 | { | ||
| 85 | while (((sci_in(&scif_port, SCFDR) & EPK_FIFO_BITS) >= EPK_FIFO_SIZE)) | ||
| 86 | ; | ||
| 87 | |||
| 88 | sci_in(&scif_port, SCxSR); | ||
| 89 | sci_out(&scif_port, SCxSR, 0xf3 & ~(0x20 | 0x40)); | ||
| 90 | sci_out(&scif_port, SCxTDR, c); | ||
| 91 | |||
| 92 | while ((sci_in(&scif_port, SCxSR) & 0x40) == 0) | ||
| 93 | ; | ||
| 94 | |||
| 95 | if (c == '\n') | ||
| 96 | scif_sercon_putc('\r'); | ||
| 97 | } | ||
| 98 | |||
| 99 | static void scif_sercon_write(struct console *con, const char *s, | ||
| 100 | unsigned count) | ||
| 101 | { | ||
| 102 | while (count-- > 0) | ||
| 103 | scif_sercon_putc(*s++); | ||
| 104 | } | ||
| 105 | |||
| 106 | static int __init scif_sercon_setup(struct console *con, char *options) | ||
| 107 | { | ||
| 108 | con->cflag = CREAD | HUPCL | CLOCAL | B115200 | CS8; | ||
| 109 | |||
| 110 | return 0; | ||
| 111 | } | ||
| 112 | |||
| 113 | static struct console scif_console = { | ||
| 114 | .name = "sercon", | ||
| 115 | .write = scif_sercon_write, | ||
| 116 | .setup = scif_sercon_setup, | ||
| 117 | .flags = CON_PRINTBUFFER, | ||
| 118 | .index = -1, | ||
| 119 | }; | ||
| 120 | |||
| 121 | #if !defined(CONFIG_SH_STANDARD_BIOS) | ||
| 122 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | ||
| 123 | defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
| 124 | static void scif_sercon_init(char *s) | ||
| 125 | { | ||
| 126 | sci_out(&scif_port, SCSCR, 0x0000); /* clear TE and RE */ | ||
| 127 | sci_out(&scif_port, SCFCR, 0x4006); /* reset */ | ||
| 128 | sci_out(&scif_port, SCSCR, 0x0000); /* select internal clock */ | ||
| 129 | sci_out(&scif_port, SCSMR, EPK_SCSMR_VALUE); | ||
| 130 | sci_out(&scif_port, SCBRR, EPK_SCBRR_VALUE); | ||
| 131 | |||
| 132 | mdelay(1); /* wait 1-bit time */ | ||
| 133 | |||
| 134 | sci_out(&scif_port, SCFCR, 0x0030); /* TTRG=b'11 */ | ||
| 135 | sci_out(&scif_port, SCSCR, 0x0030); /* TE, RE */ | ||
| 136 | } | ||
| 137 | #elif defined(CONFIG_CPU_SH4) || defined(CONFIG_CPU_SH3) | ||
| 138 | #define DEFAULT_BAUD 115200 | ||
| 139 | /* | ||
| 140 | * Simple SCIF init, primarily aimed at SH7750 and other similar SH-4 | ||
| 141 | * devices that aren't using sh-ipl+g. | ||
| 142 | */ | ||
| 143 | static void scif_sercon_init(char *s) | ||
| 144 | { | ||
| 145 | struct uart_port *port = &scif_port; | ||
| 146 | unsigned baud = DEFAULT_BAUD; | ||
| 147 | unsigned int status; | ||
| 148 | char *e; | ||
| 149 | |||
| 150 | if (*s == ',') | ||
| 151 | ++s; | ||
| 152 | |||
| 153 | if (*s) { | ||
| 154 | /* ignore ioport/device name */ | ||
| 155 | s += strcspn(s, ","); | ||
| 156 | if (*s == ',') | ||
| 157 | s++; | ||
| 158 | } | ||
| 159 | |||
| 160 | if (*s) { | ||
| 161 | baud = simple_strtoul(s, &e, 0); | ||
| 162 | if (baud == 0 || s == e) | ||
| 163 | baud = DEFAULT_BAUD; | ||
| 164 | } | ||
| 165 | |||
| 166 | do { | ||
| 167 | status = sci_in(port, SCxSR); | ||
| 168 | } while (!(status & SCxSR_TEND(port))); | ||
| 169 | |||
| 170 | sci_out(port, SCSCR, 0); /* TE=0, RE=0 */ | ||
| 171 | sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); | ||
| 172 | sci_out(port, SCSMR, 0); | ||
| 173 | |||
| 174 | /* Set baud rate */ | ||
| 175 | sci_out(port, SCBRR, (CONFIG_SH_PCLK_FREQ + 16 * baud) / | ||
| 176 | (32 * baud) - 1); | ||
| 177 | udelay((1000000+(baud-1)) / baud); /* Wait one bit interval */ | ||
| 178 | |||
| 179 | sci_out(port, SCSPTR, 0); | ||
| 180 | sci_out(port, SCxSR, 0x60); | ||
| 181 | sci_out(port, SCLSR, 0); | ||
| 182 | |||
| 183 | sci_out(port, SCFCR, 0); | ||
| 184 | sci_out(port, SCSCR, 0x30); /* TE=1, RE=1 */ | ||
| 185 | } | ||
| 186 | #endif /* defined(CONFIG_CPU_SUBTYPE_SH7720) */ | ||
| 187 | #endif /* !defined(CONFIG_SH_STANDARD_BIOS) */ | ||
| 188 | #endif /* CONFIG_EARLY_SCIF_CONSOLE */ | ||
| 189 | |||
| 190 | /* | ||
| 191 | * Setup a default console, if more than one is compiled in, rely on the | ||
| 192 | * earlyprintk= parsing to give priority. | ||
| 193 | */ | ||
| 194 | static struct console *early_console = | ||
| 195 | #ifdef CONFIG_SH_STANDARD_BIOS | ||
| 196 | &bios_console | ||
| 197 | #elif defined(CONFIG_EARLY_SCIF_CONSOLE) | ||
| 198 | &scif_console | ||
| 199 | #else | ||
| 200 | NULL | ||
| 201 | #endif | ||
| 202 | ; | ||
| 203 | 61 | ||
| 204 | static int __init setup_early_printk(char *buf) | 62 | static int __init setup_early_printk(char *buf) |
| 205 | { | 63 | { |
| @@ -211,21 +69,8 @@ static int __init setup_early_printk(char *buf) | |||
| 211 | if (strstr(buf, "keep")) | 69 | if (strstr(buf, "keep")) |
| 212 | keep_early = 1; | 70 | keep_early = 1; |
| 213 | 71 | ||
| 214 | #ifdef CONFIG_SH_STANDARD_BIOS | ||
| 215 | if (!strncmp(buf, "bios", 4)) | 72 | if (!strncmp(buf, "bios", 4)) |
| 216 | early_console = &bios_console; | 73 | early_console = &bios_console; |
| 217 | #endif | ||
| 218 | #if defined(CONFIG_EARLY_SCIF_CONSOLE) | ||
| 219 | if (!strncmp(buf, "serial", 6)) { | ||
| 220 | early_console = &scif_console; | ||
| 221 | |||
| 222 | #if !defined(CONFIG_SH_STANDARD_BIOS) | ||
| 223 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_CPU_SH3) | ||
| 224 | scif_sercon_init(buf + 6); | ||
| 225 | #endif | ||
| 226 | #endif | ||
| 227 | } | ||
| 228 | #endif | ||
| 229 | 74 | ||
| 230 | if (likely(early_console)) { | 75 | if (likely(early_console)) { |
| 231 | if (keep_early) | 76 | if (keep_early) |
diff --git a/arch/sh/kernel/ftrace.c b/arch/sh/kernel/ftrace.c index b6f41c109beb..a48cdedc73b5 100644 --- a/arch/sh/kernel/ftrace.c +++ b/arch/sh/kernel/ftrace.c | |||
| @@ -401,82 +401,10 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | |||
| 401 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 401 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
| 402 | 402 | ||
| 403 | #ifdef CONFIG_FTRACE_SYSCALLS | 403 | #ifdef CONFIG_FTRACE_SYSCALLS |
| 404 | |||
| 405 | extern unsigned long __start_syscalls_metadata[]; | ||
| 406 | extern unsigned long __stop_syscalls_metadata[]; | ||
| 407 | extern unsigned long *sys_call_table; | 404 | extern unsigned long *sys_call_table; |
| 408 | 405 | ||
| 409 | static struct syscall_metadata **syscalls_metadata; | 406 | unsigned long __init arch_syscall_addr(int nr) |
| 410 | |||
| 411 | static struct syscall_metadata *find_syscall_meta(unsigned long *syscall) | ||
| 412 | { | ||
| 413 | struct syscall_metadata *start; | ||
| 414 | struct syscall_metadata *stop; | ||
| 415 | char str[KSYM_SYMBOL_LEN]; | ||
| 416 | |||
| 417 | |||
| 418 | start = (struct syscall_metadata *)__start_syscalls_metadata; | ||
| 419 | stop = (struct syscall_metadata *)__stop_syscalls_metadata; | ||
| 420 | kallsyms_lookup((unsigned long) syscall, NULL, NULL, NULL, str); | ||
| 421 | |||
| 422 | for ( ; start < stop; start++) { | ||
| 423 | if (start->name && !strcmp(start->name, str)) | ||
| 424 | return start; | ||
| 425 | } | ||
| 426 | |||
| 427 | return NULL; | ||
| 428 | } | ||
| 429 | |||
| 430 | struct syscall_metadata *syscall_nr_to_meta(int nr) | ||
| 431 | { | ||
| 432 | if (!syscalls_metadata || nr >= FTRACE_SYSCALL_MAX || nr < 0) | ||
| 433 | return NULL; | ||
| 434 | |||
| 435 | return syscalls_metadata[nr]; | ||
| 436 | } | ||
| 437 | |||
| 438 | int syscall_name_to_nr(char *name) | ||
| 439 | { | ||
| 440 | int i; | ||
| 441 | |||
| 442 | if (!syscalls_metadata) | ||
| 443 | return -1; | ||
| 444 | for (i = 0; i < NR_syscalls; i++) | ||
| 445 | if (syscalls_metadata[i]) | ||
| 446 | if (!strcmp(syscalls_metadata[i]->name, name)) | ||
| 447 | return i; | ||
| 448 | return -1; | ||
| 449 | } | ||
| 450 | |||
| 451 | void set_syscall_enter_id(int num, int id) | ||
| 452 | { | ||
| 453 | syscalls_metadata[num]->enter_id = id; | ||
| 454 | } | ||
| 455 | |||
| 456 | void set_syscall_exit_id(int num, int id) | ||
| 457 | { | ||
| 458 | syscalls_metadata[num]->exit_id = id; | ||
| 459 | } | ||
| 460 | |||
| 461 | static int __init arch_init_ftrace_syscalls(void) | ||
| 462 | { | 407 | { |
| 463 | int i; | 408 | return (unsigned long)sys_call_table[nr]; |
| 464 | struct syscall_metadata *meta; | ||
| 465 | unsigned long **psys_syscall_table = &sys_call_table; | ||
| 466 | |||
| 467 | syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * | ||
| 468 | FTRACE_SYSCALL_MAX, GFP_KERNEL); | ||
| 469 | if (!syscalls_metadata) { | ||
| 470 | WARN_ON(1); | ||
| 471 | return -ENOMEM; | ||
| 472 | } | ||
| 473 | |||
| 474 | for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { | ||
| 475 | meta = find_syscall_meta(psys_syscall_table[i]); | ||
| 476 | syscalls_metadata[i] = meta; | ||
| 477 | } | ||
| 478 | |||
| 479 | return 0; | ||
| 480 | } | 409 | } |
| 481 | arch_initcall(arch_init_ftrace_syscalls); | ||
| 482 | #endif /* CONFIG_FTRACE_SYSCALLS */ | 410 | #endif /* CONFIG_FTRACE_SYSCALLS */ |
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c index 359b8a2f4d2e..31f80c61b031 100644 --- a/arch/sh/kernel/process_64.c +++ b/arch/sh/kernel/process_64.c | |||
| @@ -404,7 +404,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) | |||
| 404 | if (fpvalid) { | 404 | if (fpvalid) { |
| 405 | if (current == last_task_used_math) { | 405 | if (current == last_task_used_math) { |
| 406 | enable_fpu(); | 406 | enable_fpu(); |
| 407 | save_fpu(tsk, regs); | 407 | save_fpu(tsk); |
| 408 | disable_fpu(); | 408 | disable_fpu(); |
| 409 | last_task_used_math = 0; | 409 | last_task_used_math = 0; |
| 410 | regs->sr |= SR_FD; | 410 | regs->sr |= SR_FD; |
| @@ -431,7 +431,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
| 431 | #ifdef CONFIG_SH_FPU | 431 | #ifdef CONFIG_SH_FPU |
| 432 | if(last_task_used_math == current) { | 432 | if(last_task_used_math == current) { |
| 433 | enable_fpu(); | 433 | enable_fpu(); |
| 434 | save_fpu(current, regs); | 434 | save_fpu(current); |
| 435 | disable_fpu(); | 435 | disable_fpu(); |
| 436 | last_task_used_math = NULL; | 436 | last_task_used_math = NULL; |
| 437 | regs->sr |= SR_FD; | 437 | regs->sr |= SR_FD; |
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c index 952da83903da..873ebdc4f98e 100644 --- a/arch/sh/kernel/ptrace_64.c +++ b/arch/sh/kernel/ptrace_64.c | |||
| @@ -82,7 +82,7 @@ get_fpu_long(struct task_struct *task, unsigned long addr) | |||
| 82 | 82 | ||
| 83 | if (last_task_used_math == task) { | 83 | if (last_task_used_math == task) { |
| 84 | enable_fpu(); | 84 | enable_fpu(); |
| 85 | save_fpu(task, regs); | 85 | save_fpu(task); |
| 86 | disable_fpu(); | 86 | disable_fpu(); |
| 87 | last_task_used_math = 0; | 87 | last_task_used_math = 0; |
| 88 | regs->sr |= SR_FD; | 88 | regs->sr |= SR_FD; |
| @@ -118,7 +118,7 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data) | |||
| 118 | set_stopped_child_used_math(task); | 118 | set_stopped_child_used_math(task); |
| 119 | } else if (last_task_used_math == task) { | 119 | } else if (last_task_used_math == task) { |
| 120 | enable_fpu(); | 120 | enable_fpu(); |
| 121 | save_fpu(task, regs); | 121 | save_fpu(task); |
| 122 | disable_fpu(); | 122 | disable_fpu(); |
| 123 | last_task_used_math = 0; | 123 | last_task_used_math = 0; |
| 124 | regs->sr |= SR_FD; | 124 | regs->sr |= SR_FD; |
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 5a947a2567e4..8b0e69792cf4 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
| @@ -423,6 +423,9 @@ void __init setup_arch(char **cmdline_p) | |||
| 423 | 423 | ||
| 424 | plat_early_device_setup(); | 424 | plat_early_device_setup(); |
| 425 | 425 | ||
| 426 | /* Let earlyprintk output early console messages */ | ||
| 427 | early_platform_driver_probe("earlyprintk", 1, 1); | ||
| 428 | |||
| 426 | sh_mv_setup(); | 429 | sh_mv_setup(); |
| 427 | 430 | ||
| 428 | /* | 431 | /* |
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c index feb3dddd3192..ce76dbdef294 100644 --- a/arch/sh/kernel/signal_64.c +++ b/arch/sh/kernel/signal_64.c | |||
| @@ -314,7 +314,7 @@ setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc) | |||
| 314 | 314 | ||
| 315 | if (current == last_task_used_math) { | 315 | if (current == last_task_used_math) { |
| 316 | enable_fpu(); | 316 | enable_fpu(); |
| 317 | save_fpu(current, regs); | 317 | save_fpu(current); |
| 318 | disable_fpu(); | 318 | disable_fpu(); |
| 319 | last_task_used_math = NULL; | 319 | last_task_used_math = NULL; |
| 320 | regs->sr |= SR_FD; | 320 | regs->sr |= SR_FD; |
diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S index 19fd11dd9871..4bd5a1146956 100644 --- a/arch/sh/kernel/syscalls_32.S +++ b/arch/sh/kernel/syscalls_32.S | |||
| @@ -353,3 +353,4 @@ ENTRY(sys_call_table) | |||
| 353 | .long sys_pwritev | 353 | .long sys_pwritev |
| 354 | .long sys_rt_tgsigqueueinfo /* 335 */ | 354 | .long sys_rt_tgsigqueueinfo /* 335 */ |
| 355 | .long sys_perf_event_open | 355 | .long sys_perf_event_open |
| 356 | .long sys_recvmmsg | ||
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c index 3da5a125d884..86639beac3a2 100644 --- a/arch/sh/kernel/traps_32.c +++ b/arch/sh/kernel/traps_32.c | |||
| @@ -452,12 +452,18 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, | |||
| 452 | rm = regs->regs[index]; | 452 | rm = regs->regs[index]; |
| 453 | 453 | ||
| 454 | /* shout about fixups */ | 454 | /* shout about fixups */ |
| 455 | if (!expected && printk_ratelimit()) | 455 | if (!expected) { |
| 456 | printk(KERN_NOTICE "Fixing up unaligned %s access " | 456 | if (user_mode(regs) && (se_usermode & 1) && printk_ratelimit()) |
| 457 | "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", | 457 | pr_notice("Fixing up unaligned userspace access " |
| 458 | user_mode(regs) ? "userspace" : "kernel", | 458 | "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", |
| 459 | current->comm, task_pid_nr(current), | 459 | current->comm, task_pid_nr(current), |
| 460 | (void *)regs->pc, instruction); | 460 | (void *)regs->pc, instruction); |
| 461 | else if (se_kernmode_warn && printk_ratelimit()) | ||
| 462 | pr_notice("Fixing up unaligned kernel access " | ||
| 463 | "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", | ||
| 464 | current->comm, task_pid_nr(current), | ||
| 465 | (void *)regs->pc, instruction); | ||
| 466 | } | ||
| 461 | 467 | ||
| 462 | ret = -EFAULT; | 468 | ret = -EFAULT; |
| 463 | switch (instruction&0xF000) { | 469 | switch (instruction&0xF000) { |
diff --git a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c index 75c0cbe2eda0..d86f5315a0c1 100644 --- a/arch/sh/kernel/traps_64.c +++ b/arch/sh/kernel/traps_64.c | |||
| @@ -600,7 +600,7 @@ static int misaligned_fpu_load(struct pt_regs *regs, | |||
| 600 | indexed by register number. */ | 600 | indexed by register number. */ |
| 601 | if (last_task_used_math == current) { | 601 | if (last_task_used_math == current) { |
| 602 | enable_fpu(); | 602 | enable_fpu(); |
| 603 | save_fpu(current, regs); | 603 | save_fpu(current); |
| 604 | disable_fpu(); | 604 | disable_fpu(); |
| 605 | last_task_used_math = NULL; | 605 | last_task_used_math = NULL; |
| 606 | regs->sr |= SR_FD; | 606 | regs->sr |= SR_FD; |
| @@ -673,7 +673,7 @@ static int misaligned_fpu_store(struct pt_regs *regs, | |||
| 673 | indexed by register number. */ | 673 | indexed by register number. */ |
| 674 | if (last_task_used_math == current) { | 674 | if (last_task_used_math == current) { |
| 675 | enable_fpu(); | 675 | enable_fpu(); |
| 676 | save_fpu(current, regs); | 676 | save_fpu(current); |
| 677 | disable_fpu(); | 677 | disable_fpu(); |
| 678 | last_task_used_math = NULL; | 678 | last_task_used_math = NULL; |
| 679 | regs->sr |= SR_FD; | 679 | regs->sr |= SR_FD; |
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index f36a08bf3d5c..560ddb6bc8a7 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c | |||
| @@ -256,8 +256,7 @@ static void sh4_flush_cache_page(void *args) | |||
| 256 | address = (unsigned long)vaddr; | 256 | address = (unsigned long)vaddr; |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | if (pages_do_alias(address, phys)) | 259 | flush_cache_one(CACHE_OC_ADDRESS_ARRAY | |
| 260 | flush_cache_one(CACHE_OC_ADDRESS_ARRAY | | ||
| 261 | (address & shm_align_mask), phys); | 260 | (address & shm_align_mask), phys); |
| 262 | 261 | ||
| 263 | if (vma->vm_flags & VM_EXEC) | 262 | if (vma->vm_flags & VM_EXEC) |
diff --git a/arch/sh/mm/ioremap_32.c b/arch/sh/mm/ioremap_32.c index a86eaa9d75a5..2141befb4f91 100644 --- a/arch/sh/mm/ioremap_32.c +++ b/arch/sh/mm/ioremap_32.c | |||
| @@ -33,10 +33,10 @@ | |||
| 33 | * have to convert them into an offset in a page-aligned mapping, but the | 33 | * have to convert them into an offset in a page-aligned mapping, but the |
| 34 | * caller shouldn't need to know that small detail. | 34 | * caller shouldn't need to know that small detail. |
| 35 | */ | 35 | */ |
| 36 | void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, | 36 | void __iomem *__ioremap_caller(unsigned long phys_addr, unsigned long size, |
| 37 | unsigned long flags) | 37 | unsigned long flags, void *caller) |
| 38 | { | 38 | { |
| 39 | struct vm_struct * area; | 39 | struct vm_struct *area; |
| 40 | unsigned long offset, last_addr, addr, orig_addr; | 40 | unsigned long offset, last_addr, addr, orig_addr; |
| 41 | pgprot_t pgprot; | 41 | pgprot_t pgprot; |
| 42 | 42 | ||
| @@ -67,7 +67,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, | |||
| 67 | /* | 67 | /* |
| 68 | * Ok, go for it.. | 68 | * Ok, go for it.. |
| 69 | */ | 69 | */ |
| 70 | area = get_vm_area(size, VM_IOREMAP); | 70 | area = get_vm_area_caller(size, VM_IOREMAP, caller); |
| 71 | if (!area) | 71 | if (!area) |
| 72 | return NULL; | 72 | return NULL; |
| 73 | area->phys_addr = phys_addr; | 73 | area->phys_addr = phys_addr; |
| @@ -103,7 +103,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, | |||
| 103 | 103 | ||
| 104 | return (void __iomem *)(offset + (char *)orig_addr); | 104 | return (void __iomem *)(offset + (char *)orig_addr); |
| 105 | } | 105 | } |
| 106 | EXPORT_SYMBOL(__ioremap); | 106 | EXPORT_SYMBOL(__ioremap_caller); |
| 107 | 107 | ||
| 108 | void __iounmap(void __iomem *addr) | 108 | void __iounmap(void __iomem *addr) |
| 109 | { | 109 | { |
diff --git a/arch/sh/mm/ioremap_64.c b/arch/sh/mm/ioremap_64.c index b16843d02b76..ef434657d428 100644 --- a/arch/sh/mm/ioremap_64.c +++ b/arch/sh/mm/ioremap_64.c | |||
| @@ -258,15 +258,15 @@ static void shmedia_unmapioaddr(unsigned long vaddr) | |||
| 258 | pte_clear(&init_mm, vaddr, ptep); | 258 | pte_clear(&init_mm, vaddr, ptep); |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | void __iomem *__ioremap(unsigned long offset, unsigned long size, | 261 | void __iomem *__ioremap_caller(unsigned long offset, unsigned long size, |
| 262 | unsigned long flags) | 262 | unsigned long flags, void *caller) |
| 263 | { | 263 | { |
| 264 | char name[14]; | 264 | char name[14]; |
| 265 | 265 | ||
| 266 | sprintf(name, "phys_%08x", (u32)offset); | 266 | sprintf(name, "phys_%08x", (u32)offset); |
| 267 | return shmedia_alloc_io(offset, size, name, flags); | 267 | return shmedia_alloc_io(offset, size, name, flags); |
| 268 | } | 268 | } |
| 269 | EXPORT_SYMBOL(__ioremap); | 269 | EXPORT_SYMBOL(__ioremap_caller); |
| 270 | 270 | ||
| 271 | void __iounmap(void __iomem *virtual) | 271 | void __iounmap(void __iomem *virtual) |
| 272 | { | 272 | { |
diff --git a/arch/sh/mm/numa.c b/arch/sh/mm/numa.c index 6c524446c0f6..422e92721878 100644 --- a/arch/sh/mm/numa.c +++ b/arch/sh/mm/numa.c | |||
| @@ -28,7 +28,7 @@ void __init setup_memory(void) | |||
| 28 | { | 28 | { |
| 29 | unsigned long free_pfn = PFN_UP(__pa(_end)); | 29 | unsigned long free_pfn = PFN_UP(__pa(_end)); |
| 30 | u64 base = min_low_pfn << PAGE_SHIFT; | 30 | u64 base = min_low_pfn << PAGE_SHIFT; |
| 31 | u64 size = (max_low_pfn << PAGE_SHIFT) - min_low_pfn; | 31 | u64 size = (max_low_pfn << PAGE_SHIFT) - base; |
| 32 | 32 | ||
| 33 | lmb_add(base, size); | 33 | lmb_add(base, size); |
| 34 | 34 | ||
| @@ -38,6 +38,15 @@ void __init setup_memory(void) | |||
| 38 | (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET)); | 38 | (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET)); |
| 39 | 39 | ||
| 40 | /* | 40 | /* |
| 41 | * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET. | ||
| 42 | */ | ||
| 43 | if (CONFIG_ZERO_PAGE_OFFSET != 0) | ||
| 44 | lmb_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET); | ||
| 45 | |||
| 46 | lmb_analyze(); | ||
| 47 | lmb_dump_all(); | ||
| 48 | |||
| 49 | /* | ||
| 41 | * Node 0 sets up its pgdat at the first available pfn, | 50 | * Node 0 sets up its pgdat at the first available pfn, |
| 42 | * and bumps it up before setting up the bootmem allocator. | 51 | * and bumps it up before setting up the bootmem allocator. |
| 43 | */ | 52 | */ |
| @@ -71,7 +80,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end) | |||
| 71 | 80 | ||
| 72 | /* Node-local pgdat */ | 81 | /* Node-local pgdat */ |
| 73 | NODE_DATA(nid) = __va(lmb_alloc_base(sizeof(struct pglist_data), | 82 | NODE_DATA(nid) = __va(lmb_alloc_base(sizeof(struct pglist_data), |
| 74 | SMP_CACHE_BYTES, end_pfn)); | 83 | SMP_CACHE_BYTES, end)); |
| 75 | memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); | 84 | memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); |
| 76 | 85 | ||
| 77 | NODE_DATA(nid)->bdata = &bootmem_node_data[nid]; | 86 | NODE_DATA(nid)->bdata = &bootmem_node_data[nid]; |
| @@ -81,7 +90,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end) | |||
| 81 | /* Node-local bootmap */ | 90 | /* Node-local bootmap */ |
| 82 | bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn); | 91 | bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn); |
| 83 | bootmem_paddr = lmb_alloc_base(bootmap_pages << PAGE_SHIFT, | 92 | bootmem_paddr = lmb_alloc_base(bootmap_pages << PAGE_SHIFT, |
| 84 | PAGE_SIZE, end_pfn); | 93 | PAGE_SIZE, end); |
| 85 | init_bootmem_node(NODE_DATA(nid), bootmem_paddr >> PAGE_SHIFT, | 94 | init_bootmem_node(NODE_DATA(nid), bootmem_paddr >> PAGE_SHIFT, |
| 86 | start_pfn, end_pfn); | 95 | start_pfn, end_pfn); |
| 87 | 96 | ||
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 7e3f4ff58cfd..68c7f6cfd728 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
| @@ -1043,10 +1043,14 @@ static void __devinit sci_init_single(struct platform_device *dev, | |||
| 1043 | sci_port->port.iotype = UPIO_MEM; | 1043 | sci_port->port.iotype = UPIO_MEM; |
| 1044 | sci_port->port.line = index; | 1044 | sci_port->port.line = index; |
| 1045 | sci_port->port.fifosize = 1; | 1045 | sci_port->port.fifosize = 1; |
| 1046 | sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL; | 1046 | |
| 1047 | sci_port->dclk = clk_get(&dev->dev, "peripheral_clk"); | 1047 | if (dev) { |
| 1048 | sci_port->enable = sci_clk_enable; | 1048 | sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL; |
| 1049 | sci_port->disable = sci_clk_disable; | 1049 | sci_port->dclk = clk_get(&dev->dev, "peripheral_clk"); |
| 1050 | sci_port->enable = sci_clk_enable; | ||
| 1051 | sci_port->disable = sci_clk_disable; | ||
| 1052 | sci_port->port.dev = &dev->dev; | ||
| 1053 | } | ||
| 1050 | 1054 | ||
| 1051 | sci_port->break_timer.data = (unsigned long)sci_port; | 1055 | sci_port->break_timer.data = (unsigned long)sci_port; |
| 1052 | sci_port->break_timer.function = sci_break_timer; | 1056 | sci_port->break_timer.function = sci_break_timer; |
| @@ -1057,7 +1061,6 @@ static void __devinit sci_init_single(struct platform_device *dev, | |||
| 1057 | 1061 | ||
| 1058 | sci_port->port.irq = p->irqs[SCIx_TXI_IRQ]; | 1062 | sci_port->port.irq = p->irqs[SCIx_TXI_IRQ]; |
| 1059 | sci_port->port.flags = p->flags; | 1063 | sci_port->port.flags = p->flags; |
| 1060 | sci_port->port.dev = &dev->dev; | ||
| 1061 | sci_port->type = sci_port->port.type = p->type; | 1064 | sci_port->type = sci_port->port.type = p->type; |
| 1062 | 1065 | ||
| 1063 | memcpy(&sci_port->irqs, &p->irqs, sizeof(p->irqs)); | 1066 | memcpy(&sci_port->irqs, &p->irqs, sizeof(p->irqs)); |
| @@ -1101,7 +1104,7 @@ static void serial_console_write(struct console *co, const char *s, | |||
| 1101 | sci_port->disable(port); | 1104 | sci_port->disable(port); |
| 1102 | } | 1105 | } |
| 1103 | 1106 | ||
| 1104 | static int __init serial_console_setup(struct console *co, char *options) | 1107 | static int __devinit serial_console_setup(struct console *co, char *options) |
| 1105 | { | 1108 | { |
| 1106 | struct sci_port *sci_port; | 1109 | struct sci_port *sci_port; |
| 1107 | struct uart_port *port; | 1110 | struct uart_port *port; |
| @@ -1119,9 +1122,14 @@ static int __init serial_console_setup(struct console *co, char *options) | |||
| 1119 | if (co->index >= SCI_NPORTS) | 1122 | if (co->index >= SCI_NPORTS) |
| 1120 | co->index = 0; | 1123 | co->index = 0; |
| 1121 | 1124 | ||
| 1122 | sci_port = &sci_ports[co->index]; | 1125 | if (co->data) { |
| 1123 | port = &sci_port->port; | 1126 | port = co->data; |
| 1124 | co->data = port; | 1127 | sci_port = to_sci_port(port); |
| 1128 | } else { | ||
| 1129 | sci_port = &sci_ports[co->index]; | ||
| 1130 | port = &sci_port->port; | ||
| 1131 | co->data = port; | ||
| 1132 | } | ||
| 1125 | 1133 | ||
| 1126 | /* | 1134 | /* |
| 1127 | * Also need to check port->type, we don't actually have any | 1135 | * Also need to check port->type, we don't actually have any |
| @@ -1165,6 +1173,15 @@ static int __init sci_console_init(void) | |||
| 1165 | return 0; | 1173 | return 0; |
| 1166 | } | 1174 | } |
| 1167 | console_initcall(sci_console_init); | 1175 | console_initcall(sci_console_init); |
| 1176 | |||
| 1177 | static struct sci_port early_serial_port; | ||
| 1178 | static struct console early_serial_console = { | ||
| 1179 | .name = "early_ttySC", | ||
| 1180 | .write = serial_console_write, | ||
| 1181 | .flags = CON_PRINTBUFFER, | ||
| 1182 | }; | ||
| 1183 | static char early_serial_buf[32]; | ||
| 1184 | |||
| 1168 | #endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */ | 1185 | #endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */ |
| 1169 | 1186 | ||
| 1170 | #if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) | 1187 | #if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) |
| @@ -1250,6 +1267,21 @@ static int __devinit sci_probe(struct platform_device *dev) | |||
| 1250 | struct sh_sci_priv *priv; | 1267 | struct sh_sci_priv *priv; |
| 1251 | int i, ret = -EINVAL; | 1268 | int i, ret = -EINVAL; |
| 1252 | 1269 | ||
| 1270 | #ifdef CONFIG_SERIAL_SH_SCI_CONSOLE | ||
| 1271 | if (is_early_platform_device(dev)) { | ||
| 1272 | if (dev->id == -1) | ||
| 1273 | return -ENOTSUPP; | ||
| 1274 | early_serial_console.index = dev->id; | ||
| 1275 | early_serial_console.data = &early_serial_port.port; | ||
| 1276 | sci_init_single(NULL, &early_serial_port, dev->id, p); | ||
| 1277 | serial_console_setup(&early_serial_console, early_serial_buf); | ||
| 1278 | if (!strstr(early_serial_buf, "keep")) | ||
| 1279 | early_serial_console.flags |= CON_BOOT; | ||
| 1280 | register_console(&early_serial_console); | ||
| 1281 | return 0; | ||
| 1282 | } | ||
| 1283 | #endif | ||
| 1284 | |||
| 1253 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 1285 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
| 1254 | if (!priv) | 1286 | if (!priv) |
| 1255 | return -ENOMEM; | 1287 | return -ENOMEM; |
| @@ -1349,6 +1381,10 @@ static void __exit sci_exit(void) | |||
| 1349 | uart_unregister_driver(&sci_uart_driver); | 1381 | uart_unregister_driver(&sci_uart_driver); |
| 1350 | } | 1382 | } |
| 1351 | 1383 | ||
| 1384 | #ifdef CONFIG_SERIAL_SH_SCI_CONSOLE | ||
| 1385 | early_platform_init_buffer("earlyprintk", &sci_driver, | ||
| 1386 | early_serial_buf, ARRAY_SIZE(early_serial_buf)); | ||
| 1387 | #endif | ||
| 1352 | module_init(sci_init); | 1388 | module_init(sci_init); |
| 1353 | module_exit(sci_exit); | 1389 | module_exit(sci_exit); |
| 1354 | 1390 | ||
diff --git a/drivers/sh/intc.c b/drivers/sh/intc.c index a7e5c2e9986c..d5d7f23c19a5 100644 --- a/drivers/sh/intc.c +++ b/drivers/sh/intc.c | |||
| @@ -806,6 +806,8 @@ static int intc_suspend(struct sys_device *dev, pm_message_t state) | |||
| 806 | if (d->state.event != PM_EVENT_FREEZE) | 806 | if (d->state.event != PM_EVENT_FREEZE) |
| 807 | break; | 807 | break; |
| 808 | for_each_irq_desc(irq, desc) { | 808 | for_each_irq_desc(irq, desc) { |
| 809 | if (desc->handle_irq == intc_redirect_irq) | ||
| 810 | continue; | ||
| 809 | if (desc->chip != &d->chip) | 811 | if (desc->chip != &d->chip) |
| 810 | continue; | 812 | continue; |
| 811 | if (desc->status & IRQ_DISABLED) | 813 | if (desc->status & IRQ_DISABLED) |
diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc.c index 841ed5030c8f..082604edc4c2 100644 --- a/drivers/sh/pfc.c +++ b/drivers/sh/pfc.c | |||
| @@ -71,7 +71,7 @@ static void gpio_write_bit(struct pinmux_data_reg *dr, | |||
| 71 | 71 | ||
| 72 | pos = dr->reg_width - (in_pos + 1); | 72 | pos = dr->reg_width - (in_pos + 1); |
| 73 | 73 | ||
| 74 | pr_debug("write_bit addr = %lx, value = %ld, pos = %ld, " | 74 | pr_debug("write_bit addr = %lx, value = %d, pos = %ld, " |
| 75 | "r_width = %ld\n", | 75 | "r_width = %ld\n", |
| 76 | dr->reg, !!value, pos, dr->reg_width); | 76 | dr->reg, !!value, pos, dr->reg_width); |
| 77 | 77 | ||
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 8a65fb6648a6..a69830d26f7f 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
| @@ -281,6 +281,7 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info, | |||
| 281 | struct list_head *pagelist) | 281 | struct list_head *pagelist) |
| 282 | { | 282 | { |
| 283 | struct sh_mobile_lcdc_chan *ch = info->par; | 283 | struct sh_mobile_lcdc_chan *ch = info->par; |
| 284 | struct sh_mobile_lcdc_board_cfg *bcfg = &ch->cfg.board_cfg; | ||
| 284 | 285 | ||
| 285 | /* enable clocks before accessing hardware */ | 286 | /* enable clocks before accessing hardware */ |
| 286 | sh_mobile_lcdc_clk_on(ch->lcdc); | 287 | sh_mobile_lcdc_clk_on(ch->lcdc); |
| @@ -305,10 +306,17 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info, | |||
| 305 | 306 | ||
| 306 | /* trigger panel update */ | 307 | /* trigger panel update */ |
| 307 | dma_map_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE); | 308 | dma_map_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE); |
| 309 | if (bcfg->start_transfer) | ||
| 310 | bcfg->start_transfer(bcfg->board_data, ch, | ||
| 311 | &sh_mobile_lcdc_sys_bus_ops); | ||
| 308 | lcdc_write_chan(ch, LDSM2R, 1); | 312 | lcdc_write_chan(ch, LDSM2R, 1); |
| 309 | dma_unmap_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE); | 313 | dma_unmap_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE); |
| 310 | } else | 314 | } else { |
| 315 | if (bcfg->start_transfer) | ||
| 316 | bcfg->start_transfer(bcfg->board_data, ch, | ||
| 317 | &sh_mobile_lcdc_sys_bus_ops); | ||
| 311 | lcdc_write_chan(ch, LDSM2R, 1); | 318 | lcdc_write_chan(ch, LDSM2R, 1); |
| 319 | } | ||
| 312 | } | 320 | } |
| 313 | 321 | ||
| 314 | static void sh_mobile_lcdc_deferred_io_touch(struct fb_info *info) | 322 | static void sh_mobile_lcdc_deferred_io_touch(struct fb_info *info) |
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 25144ab22b95..288205457713 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h | |||
| @@ -50,6 +50,8 @@ struct sh_mobile_lcdc_board_cfg { | |||
| 50 | void *board_data; | 50 | void *board_data; |
| 51 | int (*setup_sys)(void *board_data, void *sys_ops_handle, | 51 | int (*setup_sys)(void *board_data, void *sys_ops_handle, |
| 52 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); | 52 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); |
| 53 | void (*start_transfer)(void *board_data, void *sys_ops_handle, | ||
| 54 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); | ||
| 53 | void (*display_on)(void *board_data); | 55 | void (*display_on)(void *board_data); |
| 54 | void (*display_off)(void *board_data); | 56 | void (*display_off)(void *board_data); |
| 55 | }; | 57 | }; |
