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

Blackfin arch: add missing implementations SIC_IWR crosses several registers

SIC_IWR crosses several registers
- add missing implementations
- make sure SIC_IWR is SET after boot

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>

authored by

Michael Hennerich and committed by
Bryan Wu
1c5d2265 f8ffe652

+40 -4
+3
arch/blackfin/mach-common/ints-priority-dc.c
··· 371 371 bfin_write_SICA_IMASK1(SIC_UNMASK_ALL); 372 372 SSYNC(); 373 373 374 + bfin_write_SICA_IWR0(IWR_ENABLE_ALL); 375 + bfin_write_SICA_IWR1(IWR_ENABLE_ALL); 376 + 374 377 local_irq_disable(); 375 378 376 379 init_exception_buff();
+4
arch/blackfin/mach-common/ints-priority-sc.c
··· 472 472 bfin_write_SIC_IMASK0(SIC_UNMASK_ALL); 473 473 bfin_write_SIC_IMASK1(SIC_UNMASK_ALL); 474 474 bfin_write_SIC_IMASK2(SIC_UNMASK_ALL); 475 + bfin_write_SIC_IWR0(IWR_ENABLE_ALL); 476 + bfin_write_SIC_IWR1(IWR_ENABLE_ALL); 477 + bfin_write_SIC_IWR2(IWR_ENABLE_ALL); 475 478 #else 476 479 bfin_write_SIC_IMASK(SIC_UNMASK_ALL); 480 + bfin_write_SIC_IWR(IWR_ENABLE_ALL); 477 481 #endif 478 482 479 483 SSYNC();
+26 -1
include/asm-blackfin/mach-bf548/cdefBF54x_base.h
··· 32 32 #define _CDEF_BF54X_H 33 33 34 34 #include "defBF54x_base.h" 35 + #include <asm/system.h> 35 36 36 37 /* ************************************************************** */ 37 38 /* SYSTEM & MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF54x */ ··· 45 44 #define bfin_read_PLL_DIV() bfin_read16(PLL_DIV) 46 45 #define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val) 47 46 #define bfin_read_VR_CTL() bfin_read16(VR_CTL) 48 - #define bfin_write_VR_CTL(val) bfin_write16(VR_CTL, val) 47 + /* Writing to VR_CTL initiates a PLL relock sequence. */ 48 + static __inline__ void bfin_write_VR_CTL(unsigned int val) 49 + { 50 + unsigned long flags, iwr0, iwr1, iwr2; 51 + 52 + /* Enable the PLL Wakeup bit in SIC IWR */ 53 + iwr0 = bfin_read32(SIC_IWR0); 54 + iwr1 = bfin_read32(SIC_IWR1); 55 + iwr2 = bfin_read32(SIC_IWR2); 56 + /* Only allow PPL Wakeup) */ 57 + bfin_write32(SIC_IWR0, IWR_ENABLE(0)); 58 + bfin_write32(SIC_IWR1, 0); 59 + bfin_write32(SIC_IWR2, 0); 60 + 61 + bfin_write16(VR_CTL, val); 62 + __builtin_bfin_ssync(); 63 + 64 + local_irq_save(flags); 65 + asm("IDLE;"); 66 + local_irq_restore(flags); 67 + bfin_write32(SIC_IWR0, iwr0); 68 + bfin_write32(SIC_IWR1, iwr1); 69 + bfin_write32(SIC_IWR2, iwr2); 70 + 71 + } 49 72 #define bfin_read_PLL_STAT() bfin_read16(PLL_STAT) 50 73 #define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val) 51 74 #define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
+7 -3
include/asm-blackfin/mach-bf561/cdefBF561.h
··· 57 57 /* Writing to VR_CTL initiates a PLL relock sequence. */ 58 58 static __inline__ void bfin_write_VR_CTL(unsigned int val) 59 59 { 60 - unsigned long flags, iwr; 60 + unsigned long flags, iwr0, iwr1; 61 61 62 62 /* Enable the PLL Wakeup bit in SIC IWR */ 63 - iwr = bfin_read32(SICA_IWR0); 63 + iwr0 = bfin_read32(SICA_IWR0); 64 + iwr1 = bfin_read32(SICA_IWR1); 64 65 /* Only allow PPL Wakeup) */ 65 66 bfin_write32(SICA_IWR0, IWR_ENABLE(0)); 67 + bfin_write32(SICA_IWR1, 0); 66 68 67 69 bfin_write16(VR_CTL, val); 68 70 __builtin_bfin_ssync(); ··· 72 70 local_irq_save(flags); 73 71 asm("IDLE;"); 74 72 local_irq_restore(flags); 75 - bfin_write32(SICA_IWR0, iwr); 73 + bfin_write32(SICA_IWR0, iwr0); 74 + bfin_write32(SICA_IWR1, iwr1); 75 + 76 76 } 77 77 #define bfin_read_PLL_STAT() bfin_read16(PLL_STAT) 78 78 #define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)