diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2009-02-19 20:31:35 -0500 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2009-02-19 22:36:42 -0500 |
commit | cfdeb6376e439c58c2d37de492d2a8c763621022 (patch) | |
tree | 19243c67ec6411797028cbe538ea88410516049d /arch/arm | |
parent | 12f4815b425b26a610e5dd9a5a5e02872f0f52c5 (diff) |
[ARM] mv78xx0: distinguish between different chip steppings
During boot, identify which chip stepping we're running on (determined
by looking at the first PCIe unit's device ID and revision registers),
and print a message with the details about what we found.
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-mv78xx0/common.c | 29 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/include/mach/mv78xx0.h | 12 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/pcie.c | 6 |
4 files changed, 48 insertions, 1 deletions
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index b0e4e0d8f506..538f8f4d4f23 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c | |||
@@ -719,6 +719,32 @@ struct sys_timer mv78xx0_timer = { | |||
719 | /***************************************************************************** | 719 | /***************************************************************************** |
720 | * General | 720 | * General |
721 | ****************************************************************************/ | 721 | ****************************************************************************/ |
722 | static char * __init mv78xx0_id(void) | ||
723 | { | ||
724 | u32 dev, rev; | ||
725 | |||
726 | mv78xx0_pcie_id(&dev, &rev); | ||
727 | |||
728 | if (dev == MV78X00_Z0_DEV_ID) { | ||
729 | if (rev == MV78X00_REV_Z0) | ||
730 | return "MV78X00-Z0"; | ||
731 | else | ||
732 | return "MV78X00-Rev-Unsupported"; | ||
733 | } else if (dev == MV78100_DEV_ID) { | ||
734 | if (rev == MV78100_REV_A0) | ||
735 | return "MV78100-A0"; | ||
736 | else | ||
737 | return "MV78100-Rev-Unsupported"; | ||
738 | } else if (dev == MV78200_DEV_ID) { | ||
739 | if (rev == MV78100_REV_A0) | ||
740 | return "MV78200-A0"; | ||
741 | else | ||
742 | return "MV78200-Rev-Unsupported"; | ||
743 | } else { | ||
744 | return "Device-Unknown"; | ||
745 | } | ||
746 | } | ||
747 | |||
722 | static int __init is_l2_writethrough(void) | 748 | static int __init is_l2_writethrough(void) |
723 | { | 749 | { |
724 | return !!(readl(CPU_CONTROL) & L2_WRITETHROUGH); | 750 | return !!(readl(CPU_CONTROL) & L2_WRITETHROUGH); |
@@ -737,7 +763,8 @@ void __init mv78xx0_init(void) | |||
737 | get_pclk_l2clk(hclk, core_index, &pclk, &l2clk); | 763 | get_pclk_l2clk(hclk, core_index, &pclk, &l2clk); |
738 | tclk = get_tclk(); | 764 | tclk = get_tclk(); |
739 | 765 | ||
740 | printk(KERN_INFO "MV78xx0 core #%d, ", core_index); | 766 | printk(KERN_INFO "%s ", mv78xx0_id()); |
767 | printk("core #%d, ", core_index); | ||
741 | printk("PCLK = %dMHz, ", (pclk + 499999) / 1000000); | 768 | printk("PCLK = %dMHz, ", (pclk + 499999) / 1000000); |
742 | printk("L2 = %dMHz, ", (l2clk + 499999) / 1000000); | 769 | printk("L2 = %dMHz, ", (l2clk + 499999) / 1000000); |
743 | printk("HCLK = %dMHz, ", (hclk + 499999) / 1000000); | 770 | printk("HCLK = %dMHz, ", (hclk + 499999) / 1000000); |
diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h index 78af5de319dd..f6274db6192d 100644 --- a/arch/arm/mach-mv78xx0/common.h +++ b/arch/arm/mach-mv78xx0/common.h | |||
@@ -29,6 +29,8 @@ void mv78xx0_setup_pcie_io_win(int window, u32 base, u32 size, | |||
29 | void mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size, | 29 | void mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size, |
30 | int maj, int min); | 30 | int maj, int min); |
31 | 31 | ||
32 | void mv78xx0_pcie_id(u32 *dev, u32 *rev); | ||
33 | |||
32 | void mv78xx0_ehci0_init(void); | 34 | void mv78xx0_ehci0_init(void); |
33 | void mv78xx0_ehci1_init(void); | 35 | void mv78xx0_ehci1_init(void); |
34 | void mv78xx0_ehci2_init(void); | 36 | void mv78xx0_ehci2_init(void); |
diff --git a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h index e930ea5330a2..328a02e029a0 100644 --- a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h +++ b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h | |||
@@ -80,6 +80,18 @@ | |||
80 | #define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0300) | 80 | #define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0300) |
81 | 81 | ||
82 | /* | 82 | /* |
83 | * Supported devices and revisions. | ||
84 | */ | ||
85 | #define MV78X00_Z0_DEV_ID 0x6381 | ||
86 | #define MV78X00_REV_Z0 1 | ||
87 | |||
88 | #define MV78100_DEV_ID 0x7810 | ||
89 | #define MV78100_REV_A0 1 | ||
90 | |||
91 | #define MV78200_DEV_ID 0x7820 | ||
92 | #define MV78200_REV_A0 1 | ||
93 | |||
94 | /* | ||
83 | * Register Map | 95 | * Register Map |
84 | */ | 96 | */ |
85 | #define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x00000) | 97 | #define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x00000) |
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c index aad3a7a2f830..a560439dcc3c 100644 --- a/arch/arm/mach-mv78xx0/pcie.c +++ b/arch/arm/mach-mv78xx0/pcie.c | |||
@@ -33,6 +33,12 @@ static struct resource pcie_io_space; | |||
33 | static struct resource pcie_mem_space; | 33 | static struct resource pcie_mem_space; |
34 | 34 | ||
35 | 35 | ||
36 | void __init mv78xx0_pcie_id(u32 *dev, u32 *rev) | ||
37 | { | ||
38 | *dev = orion_pcie_dev_id((void __iomem *)PCIE00_VIRT_BASE); | ||
39 | *rev = orion_pcie_rev((void __iomem *)PCIE00_VIRT_BASE); | ||
40 | } | ||
41 | |||
36 | static void __init mv78xx0_pcie_preinit(void) | 42 | static void __init mv78xx0_pcie_preinit(void) |
37 | { | 43 | { |
38 | int i; | 44 | int i; |