diff options
author | Wu Zhangjin <wuzhangjin@gmail.com> | 2010-05-18 21:12:17 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-07-05 12:17:20 -0400 |
commit | f18b2f67eaae0dc0e3aaf1fd8ef320e2b69a514c (patch) | |
tree | 89d6968bb6f07af931ed2216c3bbb6710d0f38d3 /arch | |
parent | e1df057df814a4a70a8711c0226a1d178c33edaa (diff) |
MIPS: Loongson: CS5536: Add missing RDMSRs for IDE and USB
Add several missing RDMSRs for IDE and USB are missing to avoid the
agressive modification of the high 32 bits of the MSR.
Without this patch some usb devices may fail after printing "reset ehci
host ....." when reading the partition information.
Signed-off-by: Hu Hongbing <huhb@lemote.com>
Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: Zhang Le <r0bertz@gentoo.org>
Cc: Hu Hongbing <huhb@lemote.com>
Patchwork: http://patchwork.linux-mips.org/patch/1250/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/loongson/common/cs5536/cs5536_ehci.c | 2 | ||||
-rw-r--r-- | arch/mips/loongson/common/cs5536/cs5536_ide.c | 14 | ||||
-rw-r--r-- | arch/mips/loongson/common/cs5536/cs5536_ohci.c | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/arch/mips/loongson/common/cs5536/cs5536_ehci.c b/arch/mips/loongson/common/cs5536/cs5536_ehci.c index eaf8b86e3318..5b5cbba699b3 100644 --- a/arch/mips/loongson/common/cs5536/cs5536_ehci.c +++ b/arch/mips/loongson/common/cs5536/cs5536_ehci.c | |||
@@ -49,6 +49,8 @@ void pci_ehci_write_reg(int reg, u32 value) | |||
49 | lo |= SOFT_BAR_EHCI_FLAG; | 49 | lo |= SOFT_BAR_EHCI_FLAG; |
50 | _wrmsr(GLCP_MSR_REG(GLCP_SOFT_COM), hi, lo); | 50 | _wrmsr(GLCP_MSR_REG(GLCP_SOFT_COM), hi, lo); |
51 | } else if ((value & 0x01) == 0x00) { | 51 | } else if ((value & 0x01) == 0x00) { |
52 | _rdmsr(USB_MSR_REG(USB_EHCI), &hi, &lo); | ||
53 | lo = value; | ||
52 | _wrmsr(USB_MSR_REG(USB_EHCI), hi, lo); | 54 | _wrmsr(USB_MSR_REG(USB_EHCI), hi, lo); |
53 | 55 | ||
54 | value &= 0xfffffff0; | 56 | value &= 0xfffffff0; |
diff --git a/arch/mips/loongson/common/cs5536/cs5536_ide.c b/arch/mips/loongson/common/cs5536/cs5536_ide.c index 9a96b5664c78..7ebf17a949a9 100644 --- a/arch/mips/loongson/common/cs5536/cs5536_ide.c +++ b/arch/mips/loongson/common/cs5536/cs5536_ide.c | |||
@@ -51,6 +51,7 @@ void pci_ide_write_reg(int reg, u32 value) | |||
51 | lo |= SOFT_BAR_IDE_FLAG; | 51 | lo |= SOFT_BAR_IDE_FLAG; |
52 | _wrmsr(GLCP_MSR_REG(GLCP_SOFT_COM), hi, lo); | 52 | _wrmsr(GLCP_MSR_REG(GLCP_SOFT_COM), hi, lo); |
53 | } else if (value & 0x01) { | 53 | } else if (value & 0x01) { |
54 | _rdmsr(IDE_MSR_REG(IDE_IO_BAR), &hi, &lo); | ||
54 | lo = (value & 0xfffffff0) | 0x1; | 55 | lo = (value & 0xfffffff0) | 0x1; |
55 | _wrmsr(IDE_MSR_REG(IDE_IO_BAR), hi, lo); | 56 | _wrmsr(IDE_MSR_REG(IDE_IO_BAR), hi, lo); |
56 | 57 | ||
@@ -65,19 +66,30 @@ void pci_ide_write_reg(int reg, u32 value) | |||
65 | _rdmsr(DIVIL_MSR_REG(DIVIL_BALL_OPTS), &hi, &lo); | 66 | _rdmsr(DIVIL_MSR_REG(DIVIL_BALL_OPTS), &hi, &lo); |
66 | lo |= 0x01; | 67 | lo |= 0x01; |
67 | _wrmsr(DIVIL_MSR_REG(DIVIL_BALL_OPTS), hi, lo); | 68 | _wrmsr(DIVIL_MSR_REG(DIVIL_BALL_OPTS), hi, lo); |
68 | } else | 69 | } else { |
70 | _rdmsr(IDE_MSR_REG(IDE_CFG), &hi, &lo); | ||
71 | lo = value; | ||
69 | _wrmsr(IDE_MSR_REG(IDE_CFG), hi, lo); | 72 | _wrmsr(IDE_MSR_REG(IDE_CFG), hi, lo); |
73 | } | ||
70 | break; | 74 | break; |
71 | case PCI_IDE_DTC_REG: | 75 | case PCI_IDE_DTC_REG: |
76 | _rdmsr(IDE_MSR_REG(IDE_DTC), &hi, &lo); | ||
77 | lo = value; | ||
72 | _wrmsr(IDE_MSR_REG(IDE_DTC), hi, lo); | 78 | _wrmsr(IDE_MSR_REG(IDE_DTC), hi, lo); |
73 | break; | 79 | break; |
74 | case PCI_IDE_CAST_REG: | 80 | case PCI_IDE_CAST_REG: |
81 | _rdmsr(IDE_MSR_REG(IDE_CAST), &hi, &lo); | ||
82 | lo = value; | ||
75 | _wrmsr(IDE_MSR_REG(IDE_CAST), hi, lo); | 83 | _wrmsr(IDE_MSR_REG(IDE_CAST), hi, lo); |
76 | break; | 84 | break; |
77 | case PCI_IDE_ETC_REG: | 85 | case PCI_IDE_ETC_REG: |
86 | _rdmsr(IDE_MSR_REG(IDE_ETC), &hi, &lo); | ||
87 | lo = value; | ||
78 | _wrmsr(IDE_MSR_REG(IDE_ETC), hi, lo); | 88 | _wrmsr(IDE_MSR_REG(IDE_ETC), hi, lo); |
79 | break; | 89 | break; |
80 | case PCI_IDE_PM_REG: | 90 | case PCI_IDE_PM_REG: |
91 | _rdmsr(IDE_MSR_REG(IDE_INTERNAL_PM), &hi, &lo); | ||
92 | lo = value; | ||
81 | _wrmsr(IDE_MSR_REG(IDE_INTERNAL_PM), hi, lo); | 93 | _wrmsr(IDE_MSR_REG(IDE_INTERNAL_PM), hi, lo); |
82 | break; | 94 | break; |
83 | default: | 95 | default: |
diff --git a/arch/mips/loongson/common/cs5536/cs5536_ohci.c b/arch/mips/loongson/common/cs5536/cs5536_ohci.c index db5900aadd6b..bdedf512baf7 100644 --- a/arch/mips/loongson/common/cs5536/cs5536_ohci.c +++ b/arch/mips/loongson/common/cs5536/cs5536_ohci.c | |||
@@ -49,6 +49,8 @@ void pci_ohci_write_reg(int reg, u32 value) | |||
49 | lo |= SOFT_BAR_OHCI_FLAG; | 49 | lo |= SOFT_BAR_OHCI_FLAG; |
50 | _wrmsr(GLCP_MSR_REG(GLCP_SOFT_COM), hi, lo); | 50 | _wrmsr(GLCP_MSR_REG(GLCP_SOFT_COM), hi, lo); |
51 | } else if ((value & 0x01) == 0x00) { | 51 | } else if ((value & 0x01) == 0x00) { |
52 | _rdmsr(USB_MSR_REG(USB_OHCI), &hi, &lo); | ||
53 | lo = value; | ||
52 | _wrmsr(USB_MSR_REG(USB_OHCI), hi, lo); | 54 | _wrmsr(USB_MSR_REG(USB_OHCI), hi, lo); |
53 | 55 | ||
54 | value &= 0xfffffff0; | 56 | value &= 0xfffffff0; |