aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-kirkwood
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r--arch/arm/mach-kirkwood/common.c43
-rw-r--r--arch/arm/mach-kirkwood/common.h2
-rw-r--r--arch/arm/mach-kirkwood/include/mach/kirkwood.h14
-rw-r--r--arch/arm/mach-kirkwood/pcie.c6
4 files changed, 56 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
533int __init kirkwood_find_tclk(void) 533int __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 */
552static char * __init kirkwood_id(void) 561static 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
566static int __init is_l2_writethrough(void) 591static int __init is_l2_writethrough(void)
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 69cd113af03a..02abef1b3219 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -28,6 +28,8 @@ void kirkwood_setup_pcie_io_win(int window, u32 base, u32 size,
28void kirkwood_setup_pcie_mem_win(int window, u32 base, u32 size, 28void kirkwood_setup_pcie_mem_win(int window, u32 base, u32 size,
29 int maj, int min); 29 int maj, int min);
30 30
31void kirkwood_pcie_id(u32 *dev, u32 *rev);
32
31void kirkwood_ehci_init(void); 33void kirkwood_ehci_init(void);
32void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data); 34void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data);
33void kirkwood_pcie_init(void); 35void kirkwood_pcie_init(void);
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index 5c69992295e8..eae42406fd86 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -68,6 +68,20 @@
68#define L2_WRITETHROUGH 0x00000010 68#define L2_WRITETHROUGH 0x00000010
69 69
70/* 70/*
71 * Supported devices and revisions.
72 */
73#define MV88F6281_DEV_ID 0x6281
74#define MV88F6281_REV_Z0 0
75#define MV88F6281_REV_A0 2
76
77#define MV88F6192_DEV_ID 0x6192
78#define MV88F6192_REV_Z0 0
79#define MV88F6192_REV_A0 2
80
81#define MV88F6180_DEV_ID 0x6180
82#define MV88F6180_REV_A0 2
83
84/*
71 * Register Map 85 * Register Map
72 */ 86 */
73#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x00000) 87#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x00000)
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index 2195fa31f6b7..f6b08f207c89 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -18,6 +18,12 @@
18 18
19#define PCIE_BASE ((void __iomem *)PCIE_VIRT_BASE) 19#define PCIE_BASE ((void __iomem *)PCIE_VIRT_BASE)
20 20
21void __init kirkwood_pcie_id(u32 *dev, u32 *rev)
22{
23 *dev = orion_pcie_dev_id(PCIE_BASE);
24 *rev = orion_pcie_rev(PCIE_BASE);
25}
26
21static int pcie_valid_config(int bus, int dev) 27static int pcie_valid_config(int bus, int dev)
22{ 28{
23 /* 29 /*