Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux into next

Freescale updates from Scott:

"Includes a fix for a powerpc/next mm regression on 64e, a fix for a
kernel hang on 64e when using a debugger inside a relocated kernel, a
qman fix, and misc qe improvements."

+95 -30
+20 -1
Documentation/devicetree/bindings/soc/fsl/cpm_qe/gpio.txt
··· 13 13 - #gpio-cells : Should be two. The first cell is the pin number and the 14 14 second cell is used to specify optional parameters (currently unused). 15 15 - gpio-controller : Marks the port as GPIO controller. 16 + Optional properties: 17 + - fsl,cpm1-gpio-irq-mask : For banks having interrupt capability (like port C 18 + on CPM1), this item tells which ports have an associated interrupt (ports are 19 + listed in the same order as in PCINT register) 20 + - interrupts : This property provides the list of interrupt for each GPIO having 21 + one as described by the fsl,cpm1-gpio-irq-mask property. There should be as 22 + many interrupts as number of ones in the mask property. The first interrupt in 23 + the list corresponds to the most significant bit of the mask. 24 + - interrupt-parent : Parent for the above interrupt property. 16 25 17 - Example of three SOC GPIO banks defined as gpio-controller nodes: 26 + Example of four SOC GPIO banks defined as gpio-controller nodes: 18 27 19 28 CPM1_PIO_A: gpio-controller@950 { 20 29 #gpio-cells = <2>; ··· 36 27 #gpio-cells = <2>; 37 28 compatible = "fsl,cpm1-pario-bank-b"; 38 29 reg = <0xab8 0x10>; 30 + gpio-controller; 31 + }; 32 + 33 + CPM1_PIO_C: gpio-controller@960 { 34 + #gpio-cells = <2>; 35 + compatible = "fsl,cpm1-pario-bank-c"; 36 + reg = <0x960 0x10>; 37 + fsl,cpm1-gpio-irq-mask = <0x0fff>; 38 + interrupts = <1 2 6 9 10 11 14 15 23 24 26 31>; 39 + interrupt-parent = <&CPM_PIC>; 39 40 gpio-controller; 40 41 }; 41 42
+2
arch/powerpc/include/asm/cpm1.h
··· 560 560 #define CPM_PIN_SECONDARY 2 561 561 #define CPM_PIN_GPIO 4 562 562 #define CPM_PIN_OPENDRAIN 8 563 + #define CPM_PIN_FALLEDGE 16 564 + #define CPM_PIN_ANYEDGE 0 563 565 564 566 enum cpm_port { 565 567 CPM_PORTA,
+5
arch/powerpc/include/asm/processor.h
··· 151 151 152 152 #ifdef __powerpc64__ 153 153 154 + #ifdef CONFIG_PPC_BOOK3S_64 154 155 /* Limit stack to 128TB */ 155 156 #define STACK_TOP_USER64 TASK_SIZE_128TB 157 + #else 158 + #define STACK_TOP_USER64 TASK_SIZE_USER64 159 + #endif 160 + 156 161 #define STACK_TOP_USER32 TASK_SIZE_USER32 157 162 158 163 #define STACK_TOP (is_32bit_task() ? \
+12
arch/powerpc/kernel/exceptions-64e.S
··· 735 735 andis. r15,r14,(DBSR_IC|DBSR_BT)@h 736 736 beq+ 1f 737 737 738 + #ifdef CONFIG_RELOCATABLE 739 + ld r15,PACATOC(r13) 740 + ld r14,interrupt_base_book3e@got(r15) 741 + ld r15,__end_interrupts@got(r15) 742 + #else 738 743 LOAD_REG_IMMEDIATE(r14,interrupt_base_book3e) 739 744 LOAD_REG_IMMEDIATE(r15,__end_interrupts) 745 + #endif 740 746 cmpld cr0,r10,r14 741 747 cmpld cr1,r10,r15 742 748 blt+ cr0,1f ··· 805 799 andis. r15,r14,(DBSR_IC|DBSR_BT)@h 806 800 beq+ 1f 807 801 802 + #ifdef CONFIG_RELOCATABLE 803 + ld r15,PACATOC(r13) 804 + ld r14,interrupt_base_book3e@got(r15) 805 + ld r15,__end_interrupts@got(r15) 806 + #else 808 807 LOAD_REG_IMMEDIATE(r14,interrupt_base_book3e) 809 808 LOAD_REG_IMMEDIATE(r15,__end_interrupts) 809 + #endif 810 810 cmpld cr0,r10,r14 811 811 cmpld cr1,r10,r15 812 812 blt+ cr0,1f
+25
arch/powerpc/sysdev/cpm1.c
··· 377 377 setbits16(&iop->odr_sor, pin); 378 378 else 379 379 clrbits16(&iop->odr_sor, pin); 380 + if (flags & CPM_PIN_FALLEDGE) 381 + setbits16(&iop->intr, pin); 382 + else 383 + clrbits16(&iop->intr, pin); 380 384 } 381 385 } 382 386 ··· 532 528 533 529 /* shadowed data register to clear/set bits safely */ 534 530 u16 cpdata; 531 + 532 + /* IRQ associated with Pins when relevant */ 533 + int irq[16]; 535 534 }; 536 535 537 536 static void cpm1_gpio16_save_regs(struct of_mm_gpio_chip *mm_gc) ··· 585 578 spin_unlock_irqrestore(&cpm1_gc->lock, flags); 586 579 } 587 580 581 + static int cpm1_gpio16_to_irq(struct gpio_chip *gc, unsigned int gpio) 582 + { 583 + struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); 584 + struct cpm1_gpio16_chip *cpm1_gc = gpiochip_get_data(&mm_gc->gc); 585 + 586 + return cpm1_gc->irq[gpio] ? : -ENXIO; 587 + } 588 + 588 589 static int cpm1_gpio16_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) 589 590 { 590 591 struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); ··· 633 618 struct cpm1_gpio16_chip *cpm1_gc; 634 619 struct of_mm_gpio_chip *mm_gc; 635 620 struct gpio_chip *gc; 621 + u16 mask; 636 622 637 623 cpm1_gc = kzalloc(sizeof(*cpm1_gc), GFP_KERNEL); 638 624 if (!cpm1_gc) 639 625 return -ENOMEM; 640 626 641 627 spin_lock_init(&cpm1_gc->lock); 628 + 629 + if (!of_property_read_u16(np, "fsl,cpm1-gpio-irq-mask", &mask)) { 630 + int i, j; 631 + 632 + for (i = 0, j = 0; i < 16; i++) 633 + if (mask & (1 << (15 - i))) 634 + cpm1_gc->irq[i] = irq_of_parse_and_map(np, j++); 635 + } 642 636 643 637 mm_gc = &cpm1_gc->mm_gc; 644 638 gc = &mm_gc->gc; ··· 658 634 gc->direction_output = cpm1_gpio16_dir_out; 659 635 gc->get = cpm1_gpio16_get; 660 636 gc->set = cpm1_gpio16_set; 637 + gc->to_irq = cpm1_gpio16_to_irq; 661 638 662 639 return of_mm_gpiochip_add_data(np, mm_gc, cpm1_gc); 663 640 }
+3 -5
drivers/net/ethernet/freescale/ucc_geth.c
··· 2594 2594 } else if (ugeth->ug_info->uf_info.bd_mem_part == 2595 2595 MEM_PART_MURAM) { 2596 2596 out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base, 2597 - (u32) immrbar_virt_to_phys(ugeth-> 2598 - p_tx_bd_ring[i])); 2597 + (u32)qe_muram_dma(ugeth->p_tx_bd_ring[i])); 2599 2598 out_be32(&ugeth->p_send_q_mem_reg->sqqd[i]. 2600 2599 last_bd_completed_address, 2601 - (u32) immrbar_virt_to_phys(endOfRing)); 2600 + (u32)qe_muram_dma(endOfRing)); 2602 2601 } 2603 2602 } 2604 2603 ··· 2843 2844 } else if (ugeth->ug_info->uf_info.bd_mem_part == 2844 2845 MEM_PART_MURAM) { 2845 2846 out_be32(&ugeth->p_rx_bd_qs_tbl[i].externalbdbaseptr, 2846 - (u32) immrbar_virt_to_phys(ugeth-> 2847 - p_rx_bd_ring[i])); 2847 + (u32)qe_muram_dma(ugeth->p_rx_bd_ring[i])); 2848 2848 } 2849 2849 /* rest of fields handled by QE */ 2850 2850 }
+5
drivers/soc/fsl/qbman/qman.c
··· 1344 1344 if (!qm_mc_result_timeout(&p->p, &mcr)) { 1345 1345 spin_unlock(&p->cgr_lock); 1346 1346 dev_crit(p->config->dev, "QUERYCONGESTION timeout\n"); 1347 + qman_p_irqsource_add(p, QM_PIRQ_CSCI); 1347 1348 return; 1348 1349 } 1349 1350 /* mask out the ones I'm not interested in */ ··· 1359 1358 if (cgr->cb && qman_cgrs_get(&c, cgr->cgrid)) 1360 1359 cgr->cb(p, cgr, qman_cgrs_get(&rr, cgr->cgrid)); 1361 1360 spin_unlock(&p->cgr_lock); 1361 + qman_p_irqsource_add(p, QM_PIRQ_CSCI); 1362 1362 } 1363 1363 1364 1364 static void qm_mr_process_task(struct work_struct *work) ··· 1419 1417 } 1420 1418 1421 1419 qm_mr_cci_consume(&p->p, num); 1420 + qman_p_irqsource_add(p, QM_PIRQ_MRI); 1422 1421 preempt_enable(); 1423 1422 } 1424 1423 1425 1424 static u32 __poll_portal_slow(struct qman_portal *p, u32 is) 1426 1425 { 1427 1426 if (is & QM_PIRQ_CSCI) { 1427 + qman_p_irqsource_remove(p, QM_PIRQ_CSCI); 1428 1428 queue_work_on(smp_processor_id(), qm_portal_wq, 1429 1429 &p->congestion_work); 1430 1430 } ··· 1438 1434 } 1439 1435 1440 1436 if (is & QM_PIRQ_MRI) { 1437 + qman_p_irqsource_remove(p, QM_PIRQ_MRI); 1441 1438 queue_work_on(smp_processor_id(), qm_portal_wq, 1442 1439 &p->mr_work); 1443 1440 }
+20 -5
drivers/soc/fsl/qe/qe.c
··· 66 66 67 67 static phys_addr_t qebase = -1; 68 68 69 - phys_addr_t get_qe_base(void) 69 + static phys_addr_t get_qe_base(void) 70 70 { 71 71 struct device_node *qe; 72 72 int ret; ··· 89 89 90 90 return qebase; 91 91 } 92 - 93 - EXPORT_SYMBOL(get_qe_base); 94 92 95 93 void qe_reset(void) 96 94 { ··· 161 163 */ 162 164 static unsigned int brg_clk = 0; 163 165 166 + #define CLK_GRAN (1000) 167 + #define CLK_GRAN_LIMIT (5) 168 + 164 169 unsigned int qe_get_brg_clk(void) 165 170 { 166 171 struct device_node *qe; 167 172 int size; 168 173 const u32 *prop; 174 + unsigned int mod; 169 175 170 176 if (brg_clk) 171 177 return brg_clk; ··· 187 185 188 186 of_node_put(qe); 189 187 188 + /* round this if near to a multiple of CLK_GRAN */ 189 + mod = brg_clk % CLK_GRAN; 190 + if (mod) { 191 + if (mod < CLK_GRAN_LIMIT) 192 + brg_clk -= mod; 193 + else if (mod > (CLK_GRAN - CLK_GRAN_LIMIT)) 194 + brg_clk += CLK_GRAN - mod; 195 + } 196 + 190 197 return brg_clk; 191 198 } 192 199 EXPORT_SYMBOL(qe_get_brg_clk); 200 + 201 + #define PVR_VER_836x 0x8083 202 + #define PVR_VER_832x 0x8084 193 203 194 204 /* Program the BRG to the given sampling rate and multiplier 195 205 * ··· 229 215 /* Errata QE_General4, which affects some MPC832x and MPC836x SOCs, says 230 216 that the BRG divisor must be even if you're not using divide-by-16 231 217 mode. */ 232 - if (!div16 && (divisor & 1) && (divisor > 3)) 233 - divisor++; 218 + if (pvr_version_is(PVR_VER_836x) || pvr_version_is(PVR_VER_832x)) 219 + if (!div16 && (divisor & 1) && (divisor > 3)) 220 + divisor++; 234 221 235 222 tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) | 236 223 QE_BRGC_ENABLE | div16;
+2
drivers/soc/fsl/qe/qe_tdm.c
··· 177 177 devm_iounmap(&pdev->dev, utdm->si_regs); 178 178 return ret; 179 179 } 180 + EXPORT_SYMBOL(ucc_of_parse_tdm); 180 181 181 182 void ucc_tdm_init(struct ucc_tdm *utdm, struct ucc_tdm_info *ut_info) 182 183 { ··· 275 274 break; 276 275 } 277 276 } 277 + EXPORT_SYMBOL(ucc_tdm_init);
-19
include/soc/fsl/qe/immap_qe.h
··· 464 464 } __attribute__ ((packed)); 465 465 466 466 extern struct qe_immap __iomem *qe_immr; 467 - extern phys_addr_t get_qe_base(void); 468 - 469 - /* 470 - * Returns the offset within the QE address space of the given pointer. 471 - * 472 - * Note that the QE does not support 36-bit physical addresses, so if 473 - * get_qe_base() returns a number above 4GB, the caller will probably fail. 474 - */ 475 - static inline phys_addr_t immrbar_virt_to_phys(void *address) 476 - { 477 - void *q = (void *)qe_immr; 478 - 479 - /* Is it a MURAM address? */ 480 - if ((address >= q) && (address < (q + QE_IMMAP_SIZE))) 481 - return get_qe_base() + (address - q); 482 - 483 - /* It's an address returned by kmalloc */ 484 - return virt_to_phys(address); 485 - } 486 467 487 468 #endif /* __KERNEL__ */ 488 469 #endif /* _ASM_POWERPC_IMMAP_QE_H */
+1
include/soc/fsl/qe/qe.h
··· 243 243 #define qe_muram_free cpm_muram_free 244 244 #define qe_muram_addr cpm_muram_addr 245 245 #define qe_muram_offset cpm_muram_offset 246 + #define qe_muram_dma cpm_muram_dma 246 247 247 248 #define qe_setbits32(_addr, _v) iowrite32be(ioread32be(_addr) | (_v), (_addr)) 248 249 #define qe_clrbits32(_addr, _v) iowrite32be(ioread32be(_addr) & ~(_v), (_addr))