diff options
author | Ronen Shitrit <rshitrit@marvell.com> | 2008-09-15 03:40:35 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2008-09-25 16:27:21 -0400 |
commit | b2b3dc2fc41ef441610d0140f0f5ccacbd43f40c (patch) | |
tree | 70116ea6c823e5ac6a8b048ee6911257e722e5b7 /arch/arm/mach-kirkwood/common.c | |
parent | 79d4dd77f0d86e4315887edaa5dfabb0c2081ba7 (diff) |
[ARM] Kirkwood: add support for newer SoC models
Add support to the Kirkwood port for newer device models and silicon
revisions. Instead of looking at the DEVICE_ID register, the device
version is now determined by looking at the PCI-Express device ID and
revision registers, as it is done for orion5x, and this information
is used to determine the TCLK frequency, again, as it is done for
orion5x.
Signed-off-by: Ronen Shitrit <rshitrit@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Diffstat (limited to 'arch/arm/mach-kirkwood/common.c')
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 2e79dabac53c..c8516e352d1c 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -532,6 +532,12 @@ int kirkwood_tclk; | |||
532 | 532 | ||
533 | int __init kirkwood_find_tclk(void) | 533 | int __init kirkwood_find_tclk(void) |
534 | { | 534 | { |
535 | u32 dev, rev; | ||
536 | |||
537 | kirkwood_pcie_id(&dev, &rev); | ||
538 | if (dev == MV88F6281_DEV_ID && rev == MV88F6281_REV_A0) | ||
539 | return 200000000; | ||
540 | |||
535 | return 166666667; | 541 | return 166666667; |
536 | } | 542 | } |
537 | 543 | ||
@@ -549,18 +555,37 @@ struct sys_timer kirkwood_timer = { | |||
549 | /***************************************************************************** | 555 | /***************************************************************************** |
550 | * General | 556 | * General |
551 | ****************************************************************************/ | 557 | ****************************************************************************/ |
558 | /* | ||
559 | * Identify device ID and revision. | ||
560 | */ | ||
552 | static char * __init kirkwood_id(void) | 561 | static char * __init kirkwood_id(void) |
553 | { | 562 | { |
554 | switch (readl(DEVICE_ID) & 0x3) { | 563 | u32 dev, rev; |
555 | case 0: | 564 | |
556 | return "88F6180"; | 565 | kirkwood_pcie_id(&dev, &rev); |
557 | case 1: | 566 | |
558 | return "88F6192"; | 567 | if (dev == MV88F6281_DEV_ID) { |
559 | case 2: | 568 | if (rev == MV88F6281_REV_Z0) |
560 | return "88F6281"; | 569 | return "MV88F6281-Z0"; |
570 | else if (rev == MV88F6281_REV_A0) | ||
571 | return "MV88F6281-A0"; | ||
572 | else | ||
573 | return "MV88F6281-Rev-Unsupported"; | ||
574 | } else if (dev == MV88F6192_DEV_ID) { | ||
575 | if (rev == MV88F6192_REV_Z0) | ||
576 | return "MV88F6192-Z0"; | ||
577 | else if (rev == MV88F6192_REV_A0) | ||
578 | return "MV88F6192-A0"; | ||
579 | else | ||
580 | return "MV88F6192-Rev-Unsupported"; | ||
581 | } else if (dev == MV88F6180_DEV_ID) { | ||
582 | if (rev == MV88F6180_REV_A0) | ||
583 | return "MV88F6180-Rev-A0"; | ||
584 | else | ||
585 | return "MV88F6180-Rev-Unsupported"; | ||
586 | } else { | ||
587 | return "Device-Unknown"; | ||
561 | } | 588 | } |
562 | |||
563 | return "unknown 88F6000 variant"; | ||
564 | } | 589 | } |
565 | 590 | ||
566 | static int __init is_l2_writethrough(void) | 591 | static int __init is_l2_writethrough(void) |