aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memory
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-03 19:41:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-03 19:41:38 -0400
commitff474e8ca8547d09cb82ebab56d4c96f9eea01ce (patch)
treec004122f04a405eddb7929cd0297ccdce016f1b8 /drivers/memory
parent4c92b5bb14226faa16d29a1df5752baf1ff22b53 (diff)
parent390fd5929f52bdfb9dfcc03820041ba556780f4a (diff)
Merge tag 'powerpc-4.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc updates from Michael Ellerman: - support "hybrid" iommu/direct DMA ops for coherent_mask < dma_mask from Benjamin Herrenschmidt - EEH fixes for SRIOV from Gavin - introduce rtas_get_sensor_fast() for IRQ handlers from Thomas Huth - use hardware RNG for arch_get_random_seed_* not arch_get_random_* from Paul Mackerras - seccomp filter support from Michael Ellerman - opal_cec_reboot2() handling for HMIs & machine checks from Mahesh Salgaonkar - add powerpc timebase as a trace clock source from Naveen N. Rao - misc cleanups in the xmon, signal & SLB code from Anshuman Khandual - add an inline function to update POWER8 HID0 from Gautham R. Shenoy - fix pte_pagesize_index() crash on 4K w/64K hash from Michael Ellerman - drop support for 64K local store on 4K kernels from Michael Ellerman - move dma_get_required_mask() from pnv_phb to pci_controller_ops from Andrew Donnellan - initialize distance lookup table from drconf path from Nikunj A Dadhania - enable RTC class support from Vaibhav Jain - disable automatically blocked PCI config from Gavin Shan - add LEDs driver for PowerNV platform from Vasant Hegde - fix endianness issues in the HVSI driver from Laurent Dufour - kexec endian fixes from Samuel Mendoza-Jonas - fix corrupted pdn list from Gavin Shan - fix fenced PHB caused by eeh_slot_error_detail() from Gavin Shan - Freescale updates from Scott: Highlights include 32-bit memcpy/memset optimizations, checksum optimizations, 85xx config fragments and updates, device tree updates, e6500 fixes for non-SMP, and misc cleanup and minor fixes. - a ton of cxl updates & fixes: - add explicit precision specifiers from Rasmus Villemoes - use more common format specifier from Rasmus Villemoes - destroy cxl_adapter_idr on module_exit from Johannes Thumshirn - destroy afu->contexts_idr on release of an afu from Johannes Thumshirn - compile with -Werror from Daniel Axtens - EEH support from Daniel Axtens - plug irq_bitmap getting leaked in cxl_context from Vaibhav Jain - add alternate MMIO error handling from Ian Munsie - allow release of contexts which have been OPENED but not STARTED from Andrew Donnellan - remove use of macro DEFINE_PCI_DEVICE_TABLE from Vaishali Thakkar - release irqs if memory allocation fails from Vaibhav Jain - remove racy attempt to force EEH invocation in reset from Daniel Axtens - fix + cleanup error paths in cxl_dev_context_init from Ian Munsie - fix force unmapping mmaps of contexts allocated through the kernel api from Ian Munsie - set up and enable PSL Timebase from Philippe Bergheaud * tag 'powerpc-4.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (140 commits) cxl: Set up and enable PSL Timebase cxl: Fix force unmapping mmaps of contexts allocated through the kernel api cxl: Fix + cleanup error paths in cxl_dev_context_init powerpc/eeh: Fix fenced PHB caused by eeh_slot_error_detail() powerpc/pseries: Cleanup on pci_dn_reconfig_notifier() powerpc/pseries: Fix corrupted pdn list powerpc/powernv: Enable LEDS support powerpc/iommu: Set default DMA offset in dma_dev_setup cxl: Remove racy attempt to force EEH invocation in reset cxl: Release irqs if memory allocation fails cxl: Remove use of macro DEFINE_PCI_DEVICE_TABLE powerpc/powernv: Fix mis-merge of OPAL support for LEDS driver powerpc/powernv: Reset HILE before kexec_sequence() powerpc/kexec: Reset secondary cpu endianness before kexec powerpc/hvsi: Fix endianness issues in the HVSI driver leds/powernv: Add driver for PowerNV platform powerpc/powernv: Create LED platform device powerpc/powernv: Add OPAL interfaces for accessing and modifying system LED states powerpc/powernv: Fix the log message when disabling VF cxl: Allow release of contexts which have been OPENED but not STARTED ...
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/fsl_ifc.c43
1 files changed, 30 insertions, 13 deletions
diff --git a/drivers/memory/fsl_ifc.c b/drivers/memory/fsl_ifc.c
index 410c39749872..e87459f6d686 100644
--- a/drivers/memory/fsl_ifc.c
+++ b/drivers/memory/fsl_ifc.c
@@ -62,7 +62,7 @@ int fsl_ifc_find(phys_addr_t addr_base)
62 return -ENODEV; 62 return -ENODEV;
63 63
64 for (i = 0; i < fsl_ifc_ctrl_dev->banks; i++) { 64 for (i = 0; i < fsl_ifc_ctrl_dev->banks; i++) {
65 u32 cspr = in_be32(&fsl_ifc_ctrl_dev->regs->cspr_cs[i].cspr); 65 u32 cspr = ifc_in32(&fsl_ifc_ctrl_dev->regs->cspr_cs[i].cspr);
66 if (cspr & CSPR_V && (cspr & CSPR_BA) == 66 if (cspr & CSPR_V && (cspr & CSPR_BA) ==
67 convert_ifc_address(addr_base)) 67 convert_ifc_address(addr_base))
68 return i; 68 return i;
@@ -79,16 +79,16 @@ static int fsl_ifc_ctrl_init(struct fsl_ifc_ctrl *ctrl)
79 /* 79 /*
80 * Clear all the common status and event registers 80 * Clear all the common status and event registers
81 */ 81 */
82 if (in_be32(&ifc->cm_evter_stat) & IFC_CM_EVTER_STAT_CSER) 82 if (ifc_in32(&ifc->cm_evter_stat) & IFC_CM_EVTER_STAT_CSER)
83 out_be32(&ifc->cm_evter_stat, IFC_CM_EVTER_STAT_CSER); 83 ifc_out32(IFC_CM_EVTER_STAT_CSER, &ifc->cm_evter_stat);
84 84
85 /* enable all error and events */ 85 /* enable all error and events */
86 out_be32(&ifc->cm_evter_en, IFC_CM_EVTER_EN_CSEREN); 86 ifc_out32(IFC_CM_EVTER_EN_CSEREN, &ifc->cm_evter_en);
87 87
88 /* enable all error and event interrupts */ 88 /* enable all error and event interrupts */
89 out_be32(&ifc->cm_evter_intr_en, IFC_CM_EVTER_INTR_EN_CSERIREN); 89 ifc_out32(IFC_CM_EVTER_INTR_EN_CSERIREN, &ifc->cm_evter_intr_en);
90 out_be32(&ifc->cm_erattr0, 0x0); 90 ifc_out32(0x0, &ifc->cm_erattr0);
91 out_be32(&ifc->cm_erattr1, 0x0); 91 ifc_out32(0x0, &ifc->cm_erattr1);
92 92
93 return 0; 93 return 0;
94} 94}
@@ -127,9 +127,9 @@ static u32 check_nand_stat(struct fsl_ifc_ctrl *ctrl)
127 127
128 spin_lock_irqsave(&nand_irq_lock, flags); 128 spin_lock_irqsave(&nand_irq_lock, flags);
129 129
130 stat = in_be32(&ifc->ifc_nand.nand_evter_stat); 130 stat = ifc_in32(&ifc->ifc_nand.nand_evter_stat);
131 if (stat) { 131 if (stat) {
132 out_be32(&ifc->ifc_nand.nand_evter_stat, stat); 132 ifc_out32(stat, &ifc->ifc_nand.nand_evter_stat);
133 ctrl->nand_stat = stat; 133 ctrl->nand_stat = stat;
134 wake_up(&ctrl->nand_wait); 134 wake_up(&ctrl->nand_wait);
135 } 135 }
@@ -161,16 +161,16 @@ static irqreturn_t fsl_ifc_ctrl_irq(int irqno, void *data)
161 irqreturn_t ret = IRQ_NONE; 161 irqreturn_t ret = IRQ_NONE;
162 162
163 /* read for chip select error */ 163 /* read for chip select error */
164 cs_err = in_be32(&ifc->cm_evter_stat); 164 cs_err = ifc_in32(&ifc->cm_evter_stat);
165 if (cs_err) { 165 if (cs_err) {
166 dev_err(ctrl->dev, "transaction sent to IFC is not mapped to" 166 dev_err(ctrl->dev, "transaction sent to IFC is not mapped to"
167 "any memory bank 0x%08X\n", cs_err); 167 "any memory bank 0x%08X\n", cs_err);
168 /* clear the chip select error */ 168 /* clear the chip select error */
169 out_be32(&ifc->cm_evter_stat, IFC_CM_EVTER_STAT_CSER); 169 ifc_out32(IFC_CM_EVTER_STAT_CSER, &ifc->cm_evter_stat);
170 170
171 /* read error attribute registers print the error information */ 171 /* read error attribute registers print the error information */
172 status = in_be32(&ifc->cm_erattr0); 172 status = ifc_in32(&ifc->cm_erattr0);
173 err_addr = in_be32(&ifc->cm_erattr1); 173 err_addr = ifc_in32(&ifc->cm_erattr1);
174 174
175 if (status & IFC_CM_ERATTR0_ERTYP_READ) 175 if (status & IFC_CM_ERATTR0_ERTYP_READ)
176 dev_err(ctrl->dev, "Read transaction error" 176 dev_err(ctrl->dev, "Read transaction error"
@@ -231,6 +231,23 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
231 goto err; 231 goto err;
232 } 232 }
233 233
234 version = ifc_in32(&fsl_ifc_ctrl_dev->regs->ifc_rev) &
235 FSL_IFC_VERSION_MASK;
236 banks = (version == FSL_IFC_VERSION_1_0_0) ? 4 : 8;
237 dev_info(&dev->dev, "IFC version %d.%d, %d banks\n",
238 version >> 24, (version >> 16) & 0xf, banks);
239
240 fsl_ifc_ctrl_dev->version = version;
241 fsl_ifc_ctrl_dev->banks = banks;
242
243 if (of_property_read_bool(dev->dev.of_node, "little-endian")) {
244 fsl_ifc_ctrl_dev->little_endian = true;
245 dev_dbg(&dev->dev, "IFC REGISTERS are LITTLE endian\n");
246 } else {
247 fsl_ifc_ctrl_dev->little_endian = false;
248 dev_dbg(&dev->dev, "IFC REGISTERS are BIG endian\n");
249 }
250
234 version = ioread32be(&fsl_ifc_ctrl_dev->regs->ifc_rev) & 251 version = ioread32be(&fsl_ifc_ctrl_dev->regs->ifc_rev) &
235 FSL_IFC_VERSION_MASK; 252 FSL_IFC_VERSION_MASK;
236 banks = (version == FSL_IFC_VERSION_1_0_0) ? 4 : 8; 253 banks = (version == FSL_IFC_VERSION_1_0_0) ? 4 : 8;