diff options
Diffstat (limited to 'arch/mips/bcm63xx')
| -rw-r--r-- | arch/mips/bcm63xx/boards/board_bcm963xx.c | 231 | ||||
| -rw-r--r-- | arch/mips/bcm63xx/cpu.c | 5 | ||||
| -rw-r--r-- | arch/mips/bcm63xx/dev-uart.c | 66 | ||||
| -rw-r--r-- | arch/mips/bcm63xx/gpio.c | 4 |
4 files changed, 204 insertions, 102 deletions
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c index ea17941168ca..8dba8cfb752f 100644 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <asm/addrspace.h> | 18 | #include <asm/addrspace.h> |
| 19 | #include <bcm63xx_board.h> | 19 | #include <bcm63xx_board.h> |
| 20 | #include <bcm63xx_cpu.h> | 20 | #include <bcm63xx_cpu.h> |
| 21 | #include <bcm63xx_dev_uart.h> | ||
| 21 | #include <bcm63xx_regs.h> | 22 | #include <bcm63xx_regs.h> |
| 22 | #include <bcm63xx_io.h> | 23 | #include <bcm63xx_io.h> |
| 23 | #include <bcm63xx_dev_pci.h> | 24 | #include <bcm63xx_dev_pci.h> |
| @@ -40,6 +41,7 @@ static struct board_info __initdata board_96338gw = { | |||
| 40 | .name = "96338GW", | 41 | .name = "96338GW", |
| 41 | .expected_cpu_id = 0x6338, | 42 | .expected_cpu_id = 0x6338, |
| 42 | 43 | ||
| 44 | .has_uart0 = 1, | ||
| 43 | .has_enet0 = 1, | 45 | .has_enet0 = 1, |
| 44 | .enet0 = { | 46 | .enet0 = { |
| 45 | .force_speed_100 = 1, | 47 | .force_speed_100 = 1, |
| @@ -82,6 +84,7 @@ static struct board_info __initdata board_96338w = { | |||
| 82 | .name = "96338W", | 84 | .name = "96338W", |
| 83 | .expected_cpu_id = 0x6338, | 85 | .expected_cpu_id = 0x6338, |
| 84 | 86 | ||
| 87 | .has_uart0 = 1, | ||
| 85 | .has_enet0 = 1, | 88 | .has_enet0 = 1, |
| 86 | .enet0 = { | 89 | .enet0 = { |
| 87 | .force_speed_100 = 1, | 90 | .force_speed_100 = 1, |
| @@ -126,6 +129,8 @@ static struct board_info __initdata board_96338w = { | |||
| 126 | static struct board_info __initdata board_96345gw2 = { | 129 | static struct board_info __initdata board_96345gw2 = { |
| 127 | .name = "96345GW2", | 130 | .name = "96345GW2", |
| 128 | .expected_cpu_id = 0x6345, | 131 | .expected_cpu_id = 0x6345, |
| 132 | |||
| 133 | .has_uart0 = 1, | ||
| 129 | }; | 134 | }; |
| 130 | #endif | 135 | #endif |
| 131 | 136 | ||
| @@ -137,6 +142,7 @@ static struct board_info __initdata board_96348r = { | |||
| 137 | .name = "96348R", | 142 | .name = "96348R", |
| 138 | .expected_cpu_id = 0x6348, | 143 | .expected_cpu_id = 0x6348, |
| 139 | 144 | ||
| 145 | .has_uart0 = 1, | ||
| 140 | .has_enet0 = 1, | 146 | .has_enet0 = 1, |
| 141 | .has_pci = 1, | 147 | .has_pci = 1, |
| 142 | 148 | ||
| @@ -180,6 +186,7 @@ static struct board_info __initdata board_96348gw_10 = { | |||
| 180 | .name = "96348GW-10", | 186 | .name = "96348GW-10", |
| 181 | .expected_cpu_id = 0x6348, | 187 | .expected_cpu_id = 0x6348, |
| 182 | 188 | ||
| 189 | .has_uart0 = 1, | ||
| 183 | .has_enet0 = 1, | 190 | .has_enet0 = 1, |
| 184 | .has_enet1 = 1, | 191 | .has_enet1 = 1, |
| 185 | .has_pci = 1, | 192 | .has_pci = 1, |
| @@ -239,6 +246,7 @@ static struct board_info __initdata board_96348gw_11 = { | |||
| 239 | .name = "96348GW-11", | 246 | .name = "96348GW-11", |
| 240 | .expected_cpu_id = 0x6348, | 247 | .expected_cpu_id = 0x6348, |
| 241 | 248 | ||
| 249 | .has_uart0 = 1, | ||
| 242 | .has_enet0 = 1, | 250 | .has_enet0 = 1, |
| 243 | .has_enet1 = 1, | 251 | .has_enet1 = 1, |
| 244 | .has_pci = 1, | 252 | .has_pci = 1, |
| @@ -292,6 +300,7 @@ static struct board_info __initdata board_96348gw = { | |||
| 292 | .name = "96348GW", | 300 | .name = "96348GW", |
| 293 | .expected_cpu_id = 0x6348, | 301 | .expected_cpu_id = 0x6348, |
| 294 | 302 | ||
| 303 | .has_uart0 = 1, | ||
| 295 | .has_enet0 = 1, | 304 | .has_enet0 = 1, |
| 296 | .has_enet1 = 1, | 305 | .has_enet1 = 1, |
| 297 | .has_pci = 1, | 306 | .has_pci = 1, |
| @@ -349,9 +358,10 @@ static struct board_info __initdata board_FAST2404 = { | |||
| 349 | .name = "F@ST2404", | 358 | .name = "F@ST2404", |
| 350 | .expected_cpu_id = 0x6348, | 359 | .expected_cpu_id = 0x6348, |
| 351 | 360 | ||
| 352 | .has_enet0 = 1, | 361 | .has_uart0 = 1, |
| 353 | .has_enet1 = 1, | 362 | .has_enet0 = 1, |
| 354 | .has_pci = 1, | 363 | .has_enet1 = 1, |
| 364 | .has_pci = 1, | ||
| 355 | 365 | ||
| 356 | .enet0 = { | 366 | .enet0 = { |
| 357 | .has_phy = 1, | 367 | .has_phy = 1, |
| @@ -368,10 +378,30 @@ static struct board_info __initdata board_FAST2404 = { | |||
| 368 | .has_ehci0 = 1, | 378 | .has_ehci0 = 1, |
| 369 | }; | 379 | }; |
| 370 | 380 | ||
| 381 | static struct board_info __initdata board_rta1025w_16 = { | ||
| 382 | .name = "RTA1025W_16", | ||
| 383 | .expected_cpu_id = 0x6348, | ||
| 384 | |||
| 385 | .has_enet0 = 1, | ||
| 386 | .has_enet1 = 1, | ||
| 387 | .has_pci = 1, | ||
| 388 | |||
| 389 | .enet0 = { | ||
| 390 | .has_phy = 1, | ||
| 391 | .use_internal_phy = 1, | ||
| 392 | }, | ||
| 393 | .enet1 = { | ||
| 394 | .force_speed_100 = 1, | ||
| 395 | .force_duplex_full = 1, | ||
| 396 | }, | ||
| 397 | }; | ||
| 398 | |||
| 399 | |||
| 371 | static struct board_info __initdata board_DV201AMR = { | 400 | static struct board_info __initdata board_DV201AMR = { |
| 372 | .name = "DV201AMR", | 401 | .name = "DV201AMR", |
| 373 | .expected_cpu_id = 0x6348, | 402 | .expected_cpu_id = 0x6348, |
| 374 | 403 | ||
| 404 | .has_uart0 = 1, | ||
| 375 | .has_pci = 1, | 405 | .has_pci = 1, |
| 376 | .has_ohci0 = 1, | 406 | .has_ohci0 = 1, |
| 377 | 407 | ||
| @@ -391,6 +421,7 @@ static struct board_info __initdata board_96348gw_a = { | |||
| 391 | .name = "96348GW-A", | 421 | .name = "96348GW-A", |
| 392 | .expected_cpu_id = 0x6348, | 422 | .expected_cpu_id = 0x6348, |
| 393 | 423 | ||
| 424 | .has_uart0 = 1, | ||
| 394 | .has_enet0 = 1, | 425 | .has_enet0 = 1, |
| 395 | .has_enet1 = 1, | 426 | .has_enet1 = 1, |
| 396 | .has_pci = 1, | 427 | .has_pci = 1, |
| @@ -416,6 +447,7 @@ static struct board_info __initdata board_96358vw = { | |||
| 416 | .name = "96358VW", | 447 | .name = "96358VW", |
| 417 | .expected_cpu_id = 0x6358, | 448 | .expected_cpu_id = 0x6358, |
| 418 | 449 | ||
| 450 | .has_uart0 = 1, | ||
| 419 | .has_enet0 = 1, | 451 | .has_enet0 = 1, |
| 420 | .has_enet1 = 1, | 452 | .has_enet1 = 1, |
| 421 | .has_pci = 1, | 453 | .has_pci = 1, |
| @@ -467,6 +499,7 @@ static struct board_info __initdata board_96358vw2 = { | |||
| 467 | .name = "96358VW2", | 499 | .name = "96358VW2", |
| 468 | .expected_cpu_id = 0x6358, | 500 | .expected_cpu_id = 0x6358, |
| 469 | 501 | ||
| 502 | .has_uart0 = 1, | ||
| 470 | .has_enet0 = 1, | 503 | .has_enet0 = 1, |
| 471 | .has_enet1 = 1, | 504 | .has_enet1 = 1, |
| 472 | .has_pci = 1, | 505 | .has_pci = 1, |
| @@ -514,6 +547,7 @@ static struct board_info __initdata board_AGPFS0 = { | |||
| 514 | .name = "AGPF-S0", | 547 | .name = "AGPF-S0", |
| 515 | .expected_cpu_id = 0x6358, | 548 | .expected_cpu_id = 0x6358, |
| 516 | 549 | ||
| 550 | .has_uart0 = 1, | ||
| 517 | .has_enet0 = 1, | 551 | .has_enet0 = 1, |
| 518 | .has_enet1 = 1, | 552 | .has_enet1 = 1, |
| 519 | .has_pci = 1, | 553 | .has_pci = 1, |
| @@ -531,6 +565,27 @@ static struct board_info __initdata board_AGPFS0 = { | |||
| 531 | .has_ohci0 = 1, | 565 | .has_ohci0 = 1, |
| 532 | .has_ehci0 = 1, | 566 | .has_ehci0 = 1, |
| 533 | }; | 567 | }; |
| 568 | |||
| 569 | static struct board_info __initdata board_DWVS0 = { | ||
| 570 | .name = "DWV-S0", | ||
| 571 | .expected_cpu_id = 0x6358, | ||
| 572 | |||
| 573 | .has_enet0 = 1, | ||
| 574 | .has_enet1 = 1, | ||
| 575 | .has_pci = 1, | ||
| 576 | |||
| 577 | .enet0 = { | ||
| 578 | .has_phy = 1, | ||
| 579 | .use_internal_phy = 1, | ||
| 580 | }, | ||
| 581 | |||
| 582 | .enet1 = { | ||
| 583 | .force_speed_100 = 1, | ||
| 584 | .force_duplex_full = 1, | ||
| 585 | }, | ||
| 586 | |||
| 587 | .has_ohci0 = 1, | ||
| 588 | }; | ||
| 534 | #endif | 589 | #endif |
| 535 | 590 | ||
| 536 | /* | 591 | /* |
| @@ -552,16 +607,88 @@ static const struct board_info __initdata *bcm963xx_boards[] = { | |||
| 552 | &board_FAST2404, | 607 | &board_FAST2404, |
| 553 | &board_DV201AMR, | 608 | &board_DV201AMR, |
| 554 | &board_96348gw_a, | 609 | &board_96348gw_a, |
| 610 | &board_rta1025w_16, | ||
| 555 | #endif | 611 | #endif |
| 556 | 612 | ||
| 557 | #ifdef CONFIG_BCM63XX_CPU_6358 | 613 | #ifdef CONFIG_BCM63XX_CPU_6358 |
| 558 | &board_96358vw, | 614 | &board_96358vw, |
| 559 | &board_96358vw2, | 615 | &board_96358vw2, |
| 560 | &board_AGPFS0, | 616 | &board_AGPFS0, |
| 617 | &board_DWVS0, | ||
| 561 | #endif | 618 | #endif |
| 562 | }; | 619 | }; |
| 563 | 620 | ||
| 564 | /* | 621 | /* |
| 622 | * Register a sane SPROMv2 to make the on-board | ||
| 623 | * bcm4318 WLAN work | ||
| 624 | */ | ||
| 625 | #ifdef CONFIG_SSB_PCIHOST | ||
| 626 | static struct ssb_sprom bcm63xx_sprom = { | ||
| 627 | .revision = 0x02, | ||
| 628 | .board_rev = 0x17, | ||
| 629 | .country_code = 0x0, | ||
| 630 | .ant_available_bg = 0x3, | ||
| 631 | .pa0b0 = 0x15ae, | ||
| 632 | .pa0b1 = 0xfa85, | ||
| 633 | .pa0b2 = 0xfe8d, | ||
| 634 | .pa1b0 = 0xffff, | ||
| 635 | .pa1b1 = 0xffff, | ||
| 636 | .pa1b2 = 0xffff, | ||
| 637 | .gpio0 = 0xff, | ||
| 638 | .gpio1 = 0xff, | ||
| 639 | .gpio2 = 0xff, | ||
| 640 | .gpio3 = 0xff, | ||
| 641 | .maxpwr_bg = 0x004c, | ||
| 642 | .itssi_bg = 0x00, | ||
| 643 | .boardflags_lo = 0x2848, | ||
| 644 | .boardflags_hi = 0x0000, | ||
| 645 | }; | ||
| 646 | #endif | ||
| 647 | |||
| 648 | /* | ||
| 649 | * return board name for /proc/cpuinfo | ||
| 650 | */ | ||
| 651 | const char *board_get_name(void) | ||
| 652 | { | ||
| 653 | return board.name; | ||
| 654 | } | ||
| 655 | |||
| 656 | /* | ||
| 657 | * register & return a new board mac address | ||
| 658 | */ | ||
| 659 | static int board_get_mac_address(u8 *mac) | ||
| 660 | { | ||
| 661 | u8 *p; | ||
| 662 | int count; | ||
| 663 | |||
| 664 | if (mac_addr_used >= nvram.mac_addr_count) { | ||
| 665 | printk(KERN_ERR PFX "not enough mac address\n"); | ||
| 666 | return -ENODEV; | ||
| 667 | } | ||
| 668 | |||
| 669 | memcpy(mac, nvram.mac_addr_base, ETH_ALEN); | ||
| 670 | p = mac + ETH_ALEN - 1; | ||
| 671 | count = mac_addr_used; | ||
| 672 | |||
| 673 | while (count--) { | ||
| 674 | do { | ||
| 675 | (*p)++; | ||
| 676 | if (*p != 0) | ||
| 677 | break; | ||
| 678 | p--; | ||
| 679 | } while (p != mac); | ||
| 680 | } | ||
| 681 | |||
| 682 | if (p == mac) { | ||
| 683 | printk(KERN_ERR PFX "unable to fetch mac address\n"); | ||
| 684 | return -ENODEV; | ||
| 685 | } | ||
| 686 | |||
| 687 | mac_addr_used++; | ||
| 688 | return 0; | ||
| 689 | } | ||
| 690 | |||
| 691 | /* | ||
| 565 | * early init callback, read nvram data from flash and checksum it | 692 | * early init callback, read nvram data from flash and checksum it |
| 566 | */ | 693 | */ |
| 567 | void __init board_prom_init(void) | 694 | void __init board_prom_init(void) |
| @@ -659,6 +786,17 @@ void __init board_prom_init(void) | |||
| 659 | } | 786 | } |
| 660 | 787 | ||
| 661 | bcm_gpio_writel(val, GPIO_MODE_REG); | 788 | bcm_gpio_writel(val, GPIO_MODE_REG); |
| 789 | |||
| 790 | /* Generate MAC address for WLAN and | ||
| 791 | * register our SPROM */ | ||
| 792 | #ifdef CONFIG_SSB_PCIHOST | ||
| 793 | if (!board_get_mac_address(bcm63xx_sprom.il0mac)) { | ||
| 794 | memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN); | ||
| 795 | memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN); | ||
| 796 | if (ssb_arch_set_fallback_sprom(&bcm63xx_sprom) < 0) | ||
| 797 | printk(KERN_ERR "failed to register fallback SPROM\n"); | ||
| 798 | } | ||
| 799 | #endif | ||
| 662 | } | 800 | } |
| 663 | 801 | ||
| 664 | /* | 802 | /* |
| @@ -676,49 +814,6 @@ void __init board_setup(void) | |||
| 676 | panic("unexpected CPU for bcm963xx board"); | 814 | panic("unexpected CPU for bcm963xx board"); |
| 677 | } | 815 | } |
| 678 | 816 | ||
| 679 | /* | ||
| 680 | * return board name for /proc/cpuinfo | ||
| 681 | */ | ||
| 682 | const char *board_get_name(void) | ||
| 683 | { | ||
| 684 | return board.name; | ||
| 685 | } | ||
| 686 | |||
| 687 | /* | ||
| 688 | * register & return a new board mac address | ||
| 689 | */ | ||
| 690 | static int board_get_mac_address(u8 *mac) | ||
| 691 | { | ||
| 692 | u8 *p; | ||
| 693 | int count; | ||
| 694 | |||
| 695 | if (mac_addr_used >= nvram.mac_addr_count) { | ||
| 696 | printk(KERN_ERR PFX "not enough mac address\n"); | ||
| 697 | return -ENODEV; | ||
| 698 | } | ||
| 699 | |||
| 700 | memcpy(mac, nvram.mac_addr_base, ETH_ALEN); | ||
| 701 | p = mac + ETH_ALEN - 1; | ||
| 702 | count = mac_addr_used; | ||
| 703 | |||
| 704 | while (count--) { | ||
| 705 | do { | ||
| 706 | (*p)++; | ||
| 707 | if (*p != 0) | ||
| 708 | break; | ||
| 709 | p--; | ||
| 710 | } while (p != mac); | ||
| 711 | } | ||
| 712 | |||
| 713 | if (p == mac) { | ||
| 714 | printk(KERN_ERR PFX "unable to fetch mac address\n"); | ||
| 715 | return -ENODEV; | ||
| 716 | } | ||
| 717 | |||
| 718 | mac_addr_used++; | ||
| 719 | return 0; | ||
| 720 | } | ||
| 721 | |||
| 722 | static struct mtd_partition mtd_partitions[] = { | 817 | static struct mtd_partition mtd_partitions[] = { |
| 723 | { | 818 | { |
| 724 | .name = "cfe", | 819 | .name = "cfe", |
| @@ -750,33 +845,6 @@ static struct platform_device mtd_dev = { | |||
| 750 | }, | 845 | }, |
| 751 | }; | 846 | }; |
| 752 | 847 | ||
| 753 | /* | ||
| 754 | * Register a sane SPROMv2 to make the on-board | ||
| 755 | * bcm4318 WLAN work | ||
| 756 | */ | ||
| 757 | #ifdef CONFIG_SSB_PCIHOST | ||
| 758 | static struct ssb_sprom bcm63xx_sprom = { | ||
| 759 | .revision = 0x02, | ||
| 760 | .board_rev = 0x17, | ||
| 761 | .country_code = 0x0, | ||
| 762 | .ant_available_bg = 0x3, | ||
| 763 | .pa0b0 = 0x15ae, | ||
| 764 | .pa0b1 = 0xfa85, | ||
| 765 | .pa0b2 = 0xfe8d, | ||
| 766 | .pa1b0 = 0xffff, | ||
| 767 | .pa1b1 = 0xffff, | ||
| 768 | .pa1b2 = 0xffff, | ||
| 769 | .gpio0 = 0xff, | ||
| 770 | .gpio1 = 0xff, | ||
| 771 | .gpio2 = 0xff, | ||
| 772 | .gpio3 = 0xff, | ||
| 773 | .maxpwr_bg = 0x004c, | ||
| 774 | .itssi_bg = 0x00, | ||
| 775 | .boardflags_lo = 0x2848, | ||
| 776 | .boardflags_hi = 0x0000, | ||
| 777 | }; | ||
| 778 | #endif | ||
| 779 | |||
| 780 | static struct gpio_led_platform_data bcm63xx_led_data; | 848 | static struct gpio_led_platform_data bcm63xx_led_data; |
| 781 | 849 | ||
| 782 | static struct platform_device bcm63xx_gpio_leds = { | 850 | static struct platform_device bcm63xx_gpio_leds = { |
| @@ -792,6 +860,12 @@ int __init board_register_devices(void) | |||
| 792 | { | 860 | { |
| 793 | u32 val; | 861 | u32 val; |
| 794 | 862 | ||
| 863 | if (board.has_uart0) | ||
| 864 | bcm63xx_uart_register(0); | ||
| 865 | |||
| 866 | if (board.has_uart1) | ||
| 867 | bcm63xx_uart_register(1); | ||
| 868 | |||
| 795 | if (board.has_pccard) | 869 | if (board.has_pccard) |
| 796 | bcm63xx_pcmcia_register(); | 870 | bcm63xx_pcmcia_register(); |
| 797 | 871 | ||
| @@ -806,17 +880,6 @@ int __init board_register_devices(void) | |||
| 806 | if (board.has_dsp) | 880 | if (board.has_dsp) |
| 807 | bcm63xx_dsp_register(&board.dsp); | 881 | bcm63xx_dsp_register(&board.dsp); |
| 808 | 882 | ||
| 809 | /* Generate MAC address for WLAN and | ||
| 810 | * register our SPROM */ | ||
| 811 | #ifdef CONFIG_SSB_PCIHOST | ||
| 812 | if (!board_get_mac_address(bcm63xx_sprom.il0mac)) { | ||
| 813 | memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN); | ||
| 814 | memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN); | ||
| 815 | if (ssb_arch_set_fallback_sprom(&bcm63xx_sprom) < 0) | ||
| 816 | printk(KERN_ERR "failed to register fallback SPROM\n"); | ||
| 817 | } | ||
| 818 | #endif | ||
| 819 | |||
| 820 | /* read base address of boot chip select (0) */ | 883 | /* read base address of boot chip select (0) */ |
| 821 | if (BCMCPU_IS_6345()) | 884 | if (BCMCPU_IS_6345()) |
| 822 | val = 0x1fc00000; | 885 | val = 0x1fc00000; |
diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c index 70378bb5e3f9..cbb7caf86d77 100644 --- a/arch/mips/bcm63xx/cpu.c +++ b/arch/mips/bcm63xx/cpu.c | |||
| @@ -36,6 +36,7 @@ static const unsigned long bcm96338_regs_base[] = { | |||
| 36 | [RSET_TIMER] = BCM_6338_TIMER_BASE, | 36 | [RSET_TIMER] = BCM_6338_TIMER_BASE, |
| 37 | [RSET_WDT] = BCM_6338_WDT_BASE, | 37 | [RSET_WDT] = BCM_6338_WDT_BASE, |
| 38 | [RSET_UART0] = BCM_6338_UART0_BASE, | 38 | [RSET_UART0] = BCM_6338_UART0_BASE, |
| 39 | [RSET_UART1] = BCM_6338_UART1_BASE, | ||
| 39 | [RSET_GPIO] = BCM_6338_GPIO_BASE, | 40 | [RSET_GPIO] = BCM_6338_GPIO_BASE, |
| 40 | [RSET_SPI] = BCM_6338_SPI_BASE, | 41 | [RSET_SPI] = BCM_6338_SPI_BASE, |
| 41 | [RSET_OHCI0] = BCM_6338_OHCI0_BASE, | 42 | [RSET_OHCI0] = BCM_6338_OHCI0_BASE, |
| @@ -72,6 +73,7 @@ static const unsigned long bcm96345_regs_base[] = { | |||
| 72 | [RSET_TIMER] = BCM_6345_TIMER_BASE, | 73 | [RSET_TIMER] = BCM_6345_TIMER_BASE, |
| 73 | [RSET_WDT] = BCM_6345_WDT_BASE, | 74 | [RSET_WDT] = BCM_6345_WDT_BASE, |
| 74 | [RSET_UART0] = BCM_6345_UART0_BASE, | 75 | [RSET_UART0] = BCM_6345_UART0_BASE, |
| 76 | [RSET_UART1] = BCM_6345_UART1_BASE, | ||
| 75 | [RSET_GPIO] = BCM_6345_GPIO_BASE, | 77 | [RSET_GPIO] = BCM_6345_GPIO_BASE, |
| 76 | [RSET_SPI] = BCM_6345_SPI_BASE, | 78 | [RSET_SPI] = BCM_6345_SPI_BASE, |
| 77 | [RSET_UDC0] = BCM_6345_UDC0_BASE, | 79 | [RSET_UDC0] = BCM_6345_UDC0_BASE, |
| @@ -109,6 +111,7 @@ static const unsigned long bcm96348_regs_base[] = { | |||
| 109 | [RSET_TIMER] = BCM_6348_TIMER_BASE, | 111 | [RSET_TIMER] = BCM_6348_TIMER_BASE, |
| 110 | [RSET_WDT] = BCM_6348_WDT_BASE, | 112 | [RSET_WDT] = BCM_6348_WDT_BASE, |
| 111 | [RSET_UART0] = BCM_6348_UART0_BASE, | 113 | [RSET_UART0] = BCM_6348_UART0_BASE, |
| 114 | [RSET_UART1] = BCM_6348_UART1_BASE, | ||
| 112 | [RSET_GPIO] = BCM_6348_GPIO_BASE, | 115 | [RSET_GPIO] = BCM_6348_GPIO_BASE, |
| 113 | [RSET_SPI] = BCM_6348_SPI_BASE, | 116 | [RSET_SPI] = BCM_6348_SPI_BASE, |
| 114 | [RSET_OHCI0] = BCM_6348_OHCI0_BASE, | 117 | [RSET_OHCI0] = BCM_6348_OHCI0_BASE, |
| @@ -150,6 +153,7 @@ static const unsigned long bcm96358_regs_base[] = { | |||
| 150 | [RSET_TIMER] = BCM_6358_TIMER_BASE, | 153 | [RSET_TIMER] = BCM_6358_TIMER_BASE, |
| 151 | [RSET_WDT] = BCM_6358_WDT_BASE, | 154 | [RSET_WDT] = BCM_6358_WDT_BASE, |
| 152 | [RSET_UART0] = BCM_6358_UART0_BASE, | 155 | [RSET_UART0] = BCM_6358_UART0_BASE, |
| 156 | [RSET_UART1] = BCM_6358_UART1_BASE, | ||
| 153 | [RSET_GPIO] = BCM_6358_GPIO_BASE, | 157 | [RSET_GPIO] = BCM_6358_GPIO_BASE, |
| 154 | [RSET_SPI] = BCM_6358_SPI_BASE, | 158 | [RSET_SPI] = BCM_6358_SPI_BASE, |
| 155 | [RSET_OHCI0] = BCM_6358_OHCI0_BASE, | 159 | [RSET_OHCI0] = BCM_6358_OHCI0_BASE, |
| @@ -170,6 +174,7 @@ static const unsigned long bcm96358_regs_base[] = { | |||
| 170 | static const int bcm96358_irqs[] = { | 174 | static const int bcm96358_irqs[] = { |
| 171 | [IRQ_TIMER] = BCM_6358_TIMER_IRQ, | 175 | [IRQ_TIMER] = BCM_6358_TIMER_IRQ, |
| 172 | [IRQ_UART0] = BCM_6358_UART0_IRQ, | 176 | [IRQ_UART0] = BCM_6358_UART0_IRQ, |
| 177 | [IRQ_UART1] = BCM_6358_UART1_IRQ, | ||
| 173 | [IRQ_DSL] = BCM_6358_DSL_IRQ, | 178 | [IRQ_DSL] = BCM_6358_DSL_IRQ, |
| 174 | [IRQ_ENET0] = BCM_6358_ENET0_IRQ, | 179 | [IRQ_ENET0] = BCM_6358_ENET0_IRQ, |
| 175 | [IRQ_ENET1] = BCM_6358_ENET1_IRQ, | 180 | [IRQ_ENET1] = BCM_6358_ENET1_IRQ, |
diff --git a/arch/mips/bcm63xx/dev-uart.c b/arch/mips/bcm63xx/dev-uart.c index b0519461ad9b..c2963da0253e 100644 --- a/arch/mips/bcm63xx/dev-uart.c +++ b/arch/mips/bcm63xx/dev-uart.c | |||
| @@ -11,31 +11,65 @@ | |||
| 11 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
| 12 | #include <bcm63xx_cpu.h> | 12 | #include <bcm63xx_cpu.h> |
| 13 | 13 | ||
| 14 | static struct resource uart_resources[] = { | 14 | static struct resource uart0_resources[] = { |
| 15 | { | 15 | { |
| 16 | .start = -1, /* filled at runtime */ | 16 | /* start & end filled at runtime */ |
| 17 | .end = -1, /* filled at runtime */ | ||
| 18 | .flags = IORESOURCE_MEM, | 17 | .flags = IORESOURCE_MEM, |
| 19 | }, | 18 | }, |
| 20 | { | 19 | { |
| 21 | .start = -1, /* filled at runtime */ | 20 | /* start filled at runtime */ |
| 22 | .flags = IORESOURCE_IRQ, | 21 | .flags = IORESOURCE_IRQ, |
| 23 | }, | 22 | }, |
| 24 | }; | 23 | }; |
| 25 | 24 | ||
| 26 | static struct platform_device bcm63xx_uart_device = { | 25 | static struct resource uart1_resources[] = { |
| 27 | .name = "bcm63xx_uart", | 26 | { |
| 28 | .id = 0, | 27 | /* start & end filled at runtime */ |
| 29 | .num_resources = ARRAY_SIZE(uart_resources), | 28 | .flags = IORESOURCE_MEM, |
| 30 | .resource = uart_resources, | 29 | }, |
| 30 | { | ||
| 31 | /* start filled at runtime */ | ||
| 32 | .flags = IORESOURCE_IRQ, | ||
| 33 | }, | ||
| 34 | }; | ||
| 35 | |||
| 36 | static struct platform_device bcm63xx_uart_devices[] = { | ||
| 37 | { | ||
| 38 | .name = "bcm63xx_uart", | ||
| 39 | .id = 0, | ||
| 40 | .num_resources = ARRAY_SIZE(uart0_resources), | ||
| 41 | .resource = uart0_resources, | ||
| 42 | }, | ||
| 43 | |||
| 44 | { | ||
| 45 | .name = "bcm63xx_uart", | ||
| 46 | .id = 1, | ||
| 47 | .num_resources = ARRAY_SIZE(uart1_resources), | ||
| 48 | .resource = uart1_resources, | ||
| 49 | } | ||
| 31 | }; | 50 | }; |
| 32 | 51 | ||
| 33 | int __init bcm63xx_uart_register(void) | 52 | int __init bcm63xx_uart_register(unsigned int id) |
| 34 | { | 53 | { |
| 35 | uart_resources[0].start = bcm63xx_regset_address(RSET_UART0); | 54 | if (id >= ARRAY_SIZE(bcm63xx_uart_devices)) |
| 36 | uart_resources[0].end = uart_resources[0].start; | 55 | return -ENODEV; |
| 37 | uart_resources[0].end += RSET_UART_SIZE - 1; | 56 | |
| 38 | uart_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0); | 57 | if (id == 1 && !BCMCPU_IS_6358()) |
| 39 | return platform_device_register(&bcm63xx_uart_device); | 58 | return -ENODEV; |
| 59 | |||
| 60 | if (id == 0) { | ||
| 61 | uart0_resources[0].start = bcm63xx_regset_address(RSET_UART0); | ||
| 62 | uart0_resources[0].end = uart0_resources[0].start + | ||
| 63 | RSET_UART_SIZE - 1; | ||
| 64 | uart0_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0); | ||
| 65 | } | ||
| 66 | |||
| 67 | if (id == 1) { | ||
| 68 | uart1_resources[0].start = bcm63xx_regset_address(RSET_UART1); | ||
| 69 | uart1_resources[0].end = uart1_resources[0].start + | ||
| 70 | RSET_UART_SIZE - 1; | ||
| 71 | uart1_resources[1].start = bcm63xx_get_irq_number(IRQ_UART1); | ||
| 72 | } | ||
| 73 | |||
| 74 | return platform_device_register(&bcm63xx_uart_devices[id]); | ||
| 40 | } | 75 | } |
| 41 | arch_initcall(bcm63xx_uart_register); | ||
diff --git a/arch/mips/bcm63xx/gpio.c b/arch/mips/bcm63xx/gpio.c index 87ca39046334..315bc7f79ce1 100644 --- a/arch/mips/bcm63xx/gpio.c +++ b/arch/mips/bcm63xx/gpio.c | |||
| @@ -125,10 +125,10 @@ static struct gpio_chip bcm63xx_gpio_chip = { | |||
| 125 | 125 | ||
| 126 | int __init bcm63xx_gpio_init(void) | 126 | int __init bcm63xx_gpio_init(void) |
| 127 | { | 127 | { |
| 128 | gpio_out_low = bcm_gpio_readl(GPIO_DATA_LO_REG); | ||
| 129 | gpio_out_high = bcm_gpio_readl(GPIO_DATA_HI_REG); | ||
| 128 | bcm63xx_gpio_chip.ngpio = bcm63xx_gpio_count(); | 130 | bcm63xx_gpio_chip.ngpio = bcm63xx_gpio_count(); |
| 129 | pr_info("registering %d GPIOs\n", bcm63xx_gpio_chip.ngpio); | 131 | pr_info("registering %d GPIOs\n", bcm63xx_gpio_chip.ngpio); |
| 130 | 132 | ||
| 131 | return gpiochip_add(&bcm63xx_gpio_chip); | 133 | return gpiochip_add(&bcm63xx_gpio_chip); |
| 132 | } | 134 | } |
| 133 | |||
| 134 | arch_initcall(bcm63xx_gpio_init); | ||
