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

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin: (37 commits)
Blackfin: use new common PERCPU_INPUT define
MAINTAINERS: Fix Analog Devices mailinglist address
Blackfin: boards: update ASoC resources after machine driver overhaul
Blackfin: work around anomaly 05000480
Blackfin: fix addr type with bfin_write_{or,and} helpers
Blackfin: convert /proc/sram to seq_file
Blackfin: switch /proc/gpio to seq_file
Blackfin: fix indentation with bfin_read() helper
Blackfin: convert old cpumask API to new one
Blackfin: don't touch task->cpus_allowed directly
Blackfin: don't touch cpu_possible_map and cpu_present_map directly
Blackfin: bf548-ezkit/bf561-ezkit: update nor flash layout
Blackfin: initial perf_event support
Blackfin: update anomaly lists to latest public info
Blackfin: use on-chip reset func with newer parts
Blackfin: bf533-stamp/bf537-stamp: drop ad1980 from defconfigs
Blackfin: optimize MMR reads during startup a bit
Blackfin: bf537: demux port H mask A and emac rx ints
Blackfin: bf537: fix excessive gpio int demuxing
Blackfin: bf54x: drop unused pm gpio handling
...

+3989 -1649
+10 -10
MAINTAINERS
··· 287 287 288 288 AD525X ANALOG DEVICES DIGITAL POTENTIOMETERS DRIVER 289 289 M: Michael Hennerich <michael.hennerich@analog.com> 290 - L: device-driver-devel@blackfin.uclinux.org 290 + L: device-drivers-devel@blackfin.uclinux.org 291 291 W: http://wiki.analog.com/AD5254 292 292 S: Supported 293 293 F: drivers/misc/ad525x_dpot.c 294 294 295 295 AD5398 CURRENT REGULATOR DRIVER (AD5398/AD5821) 296 296 M: Michael Hennerich <michael.hennerich@analog.com> 297 - L: device-driver-devel@blackfin.uclinux.org 297 + L: device-drivers-devel@blackfin.uclinux.org 298 298 W: http://wiki.analog.com/AD5398 299 299 S: Supported 300 300 F: drivers/regulator/ad5398.c 301 301 302 302 AD714X CAPACITANCE TOUCH SENSOR DRIVER (AD7142/3/7/8/7A) 303 303 M: Michael Hennerich <michael.hennerich@analog.com> 304 - L: device-driver-devel@blackfin.uclinux.org 304 + L: device-drivers-devel@blackfin.uclinux.org 305 305 W: http://wiki.analog.com/AD7142 306 306 S: Supported 307 307 F: drivers/input/misc/ad714x.c 308 308 309 309 AD7877 TOUCHSCREEN DRIVER 310 310 M: Michael Hennerich <michael.hennerich@analog.com> 311 - L: device-driver-devel@blackfin.uclinux.org 311 + L: device-drivers-devel@blackfin.uclinux.org 312 312 W: http://wiki.analog.com/AD7877 313 313 S: Supported 314 314 F: drivers/input/touchscreen/ad7877.c 315 315 316 316 AD7879 TOUCHSCREEN DRIVER (AD7879/AD7889) 317 317 M: Michael Hennerich <michael.hennerich@analog.com> 318 - L: device-driver-devel@blackfin.uclinux.org 318 + L: device-drivers-devel@blackfin.uclinux.org 319 319 W: http://wiki.analog.com/AD7879 320 320 S: Supported 321 321 F: drivers/input/touchscreen/ad7879.c ··· 341 341 342 342 ADP5520 BACKLIGHT DRIVER WITH IO EXPANDER (ADP5520/ADP5501) 343 343 M: Michael Hennerich <michael.hennerich@analog.com> 344 - L: device-driver-devel@blackfin.uclinux.org 344 + L: device-drivers-devel@blackfin.uclinux.org 345 345 W: http://wiki.analog.com/ADP5520 346 346 S: Supported 347 347 F: drivers/mfd/adp5520.c ··· 352 352 353 353 ADP5588 QWERTY KEYPAD AND IO EXPANDER DRIVER (ADP5588/ADP5587) 354 354 M: Michael Hennerich <michael.hennerich@analog.com> 355 - L: device-driver-devel@blackfin.uclinux.org 355 + L: device-drivers-devel@blackfin.uclinux.org 356 356 W: http://wiki.analog.com/ADP5588 357 357 S: Supported 358 358 F: drivers/input/keyboard/adp5588-keys.c ··· 360 360 361 361 ADP8860 BACKLIGHT DRIVER (ADP8860/ADP8861/ADP8863) 362 362 M: Michael Hennerich <michael.hennerich@analog.com> 363 - L: device-driver-devel@blackfin.uclinux.org 363 + L: device-drivers-devel@blackfin.uclinux.org 364 364 W: http://wiki.analog.com/ADP8860 365 365 S: Supported 366 366 F: drivers/video/backlight/adp8860_bl.c ··· 387 387 388 388 ADXL34X THREE-AXIS DIGITAL ACCELEROMETER DRIVER (ADXL345/ADXL346) 389 389 M: Michael Hennerich <michael.hennerich@analog.com> 390 - L: device-driver-devel@blackfin.uclinux.org 390 + L: device-drivers-devel@blackfin.uclinux.org 391 391 W: http://wiki.analog.com/ADXL345 392 392 S: Supported 393 393 F: drivers/input/misc/adxl34x.c ··· 526 526 F: drivers/infiniband/hw/amso1100/ 527 527 528 528 ANALOG DEVICES INC ASOC CODEC DRIVERS 529 - L: device-driver-devel@blackfin.uclinux.org 529 + L: device-drivers-devel@blackfin.uclinux.org 530 530 L: alsa-devel@alsa-project.org (moderated for non-subscribers) 531 531 W: http://wiki.analog.com/ 532 532 S: Supported
+2
arch/blackfin/Kconfig
··· 24 24 select HAVE_FUNCTION_TRACER 25 25 select HAVE_FUNCTION_TRACE_MCOUNT_TEST 26 26 select HAVE_IDE 27 + select HAVE_IRQ_WORK 27 28 select HAVE_KERNEL_GZIP if RAMKERNEL 28 29 select HAVE_KERNEL_BZIP2 if RAMKERNEL 29 30 select HAVE_KERNEL_LZMA if RAMKERNEL 30 31 select HAVE_KERNEL_LZO if RAMKERNEL 31 32 select HAVE_OPROFILE 33 + select HAVE_PERF_EVENTS 32 34 select ARCH_WANT_OPTIONAL_GPIOLIB 33 35 select HAVE_GENERIC_HARDIRQS 34 36 select GENERIC_ATOMIC64
+1 -1
arch/blackfin/Kconfig.debug
··· 23 23 Most people should say N here. 24 24 25 25 config DEBUG_MMRS 26 - bool "Generate Blackfin MMR tree" 26 + tristate "Generate Blackfin MMR tree" 27 27 select DEBUG_FS 28 28 help 29 29 Create a tree of Blackfin MMRs via the debugfs tree. If
+5 -7
arch/blackfin/configs/BF527-EZKIT-V2_defconfig
··· 121 121 # CONFIG_LOGO_LINUX_VGA16 is not set 122 122 # CONFIG_LOGO_LINUX_CLUT224 is not set 123 123 # CONFIG_LOGO_BLACKFIN_VGA16 is not set 124 - CONFIG_SOUND=m 125 - CONFIG_SND=m 126 - CONFIG_SND_SOC=m 127 - CONFIG_SND_BF5XX_I2S=m 128 - CONFIG_SND_BF5XX_SOC_SSM2602=m 129 - CONFIG_SND_BF5XX_AC97=m 130 - CONFIG_SND_BF5XX_SOC_AD1980=m 124 + CONFIG_SOUND=y 125 + CONFIG_SND=y 126 + CONFIG_SND_SOC=y 127 + CONFIG_SND_BF5XX_I2S=y 128 + CONFIG_SND_BF5XX_SOC_SSM2602=y 131 129 CONFIG_HID_A4TECH=y 132 130 CONFIG_HID_APPLE=y 133 131 CONFIG_HID_BELKIN=y
+6 -8
arch/blackfin/configs/BF527-EZKIT_defconfig
··· 96 96 # CONFIG_HW_RANDOM is not set 97 97 CONFIG_I2C=y 98 98 CONFIG_I2C_CHARDEV=m 99 - CONFIG_I2C_BLACKFIN_TWI=m 99 + CONFIG_I2C_BLACKFIN_TWI=y 100 100 CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100 101 101 CONFIG_SPI=y 102 102 CONFIG_SPI_BFIN=y ··· 115 115 # CONFIG_LOGO_LINUX_VGA16 is not set 116 116 # CONFIG_LOGO_LINUX_CLUT224 is not set 117 117 # CONFIG_LOGO_BLACKFIN_VGA16 is not set 118 - CONFIG_SOUND=m 119 - CONFIG_SND=m 120 - CONFIG_SND_SOC=m 121 - CONFIG_SND_BF5XX_I2S=m 122 - CONFIG_SND_BF5XX_SOC_SSM2602=m 123 - CONFIG_SND_BF5XX_AC97=m 124 - CONFIG_SND_BF5XX_SOC_AD1980=m 118 + CONFIG_SOUND=y 119 + CONFIG_SND=y 120 + CONFIG_SND_SOC=y 121 + CONFIG_SND_BF5XX_I2S=y 122 + CONFIG_SND_BF5XX_SOC_SSM2602=y 125 123 CONFIG_HID_A4TECH=y 126 124 CONFIG_HID_APPLE=y 127 125 CONFIG_HID_BELKIN=y
-2
arch/blackfin/configs/BF533-STAMP_defconfig
··· 99 99 CONFIG_SND_SOC=m 100 100 CONFIG_SND_BF5XX_I2S=m 101 101 CONFIG_SND_BF5XX_SOC_AD73311=m 102 - CONFIG_SND_BF5XX_AC97=m 103 - CONFIG_SND_BF5XX_SOC_AD1980=m 104 102 # CONFIG_USB_SUPPORT is not set 105 103 CONFIG_RTC_CLASS=y 106 104 CONFIG_RTC_DRV_BFIN=y
-2
arch/blackfin/configs/BF537-STAMP_defconfig
··· 110 110 CONFIG_SND_SOC=m 111 111 CONFIG_SND_BF5XX_I2S=m 112 112 CONFIG_SND_BF5XX_SOC_AD73311=m 113 - CONFIG_SND_BF5XX_AC97=m 114 - CONFIG_SND_BF5XX_SOC_AD1980=m 115 113 # CONFIG_USB_SUPPORT is not set 116 114 CONFIG_RTC_CLASS=y 117 115 CONFIG_RTC_DRV_BFIN=y
-10
arch/blackfin/include/asm/bfin-global.h
··· 49 49 #define dump_bfin_trace_buffer() 50 50 #endif 51 51 52 - /* init functions only */ 53 - extern int init_arch_irq(void); 54 - extern void init_exception_vectors(void); 55 - extern void program_IAR(void); 56 - 57 - extern asmlinkage void lower_to_irq14(void); 58 - extern asmlinkage void bfin_return_from_exception(void); 59 - extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs); 60 - extern int bfin_internal_set_wake(unsigned int irq, unsigned int state); 61 - 62 52 extern void *l1_data_A_sram_alloc(size_t); 63 53 extern void *l1_data_B_sram_alloc(size_t); 64 54 extern void *l1_inst_sram_alloc(size_t);
+44
arch/blackfin/include/asm/bfin_pfmon.h
··· 1 + /* 2 + * Blackfin Performance Monitor definitions 3 + * 4 + * Copyright 2005-2011 Analog Devices Inc. 5 + * 6 + * Licensed under the ADI BSD license or GPL-2 (or later). 7 + */ 8 + 9 + #ifndef __ASM_BFIN_PFMON_H__ 10 + #define __ASM_BFIN_PFMON_H__ 11 + 12 + /* PFCTL Masks */ 13 + #define PFMON_MASK 0xff 14 + #define PFCEN_MASK 0x3 15 + #define PFCEN_DISABLE 0x0 16 + #define PFCEN_ENABLE_USER 0x1 17 + #define PFCEN_ENABLE_SUPV 0x2 18 + #define PFCEN_ENABLE_ALL (PFCEN_ENABLE_USER | PFCEN_ENABLE_SUPV) 19 + 20 + #define PFPWR_P 0 21 + #define PEMUSW0_P 2 22 + #define PFCEN0_P 3 23 + #define PFMON0_P 5 24 + #define PEMUSW1_P 13 25 + #define PFCEN1_P 14 26 + #define PFMON1_P 16 27 + #define PFCNT0_P 24 28 + #define PFCNT1_P 25 29 + 30 + #define PFPWR (1 << PFPWR_P) 31 + #define PEMUSW(n, x) ((x) << ((n) ? PEMUSW1_P : PEMUSW0_P)) 32 + #define PEMUSW0 PEMUSW(0, 1) 33 + #define PEMUSW1 PEMUSW(1, 1) 34 + #define PFCEN(n, x) ((x) << ((n) ? PFCEN1_P : PFCEN0_P)) 35 + #define PFCEN0 PFCEN(0, PFCEN_MASK) 36 + #define PFCEN1 PFCEN(1, PFCEN_MASK) 37 + #define PFCNT(n, x) ((x) << ((n) ? PFCNT1_P : PFCNT0_P)) 38 + #define PFCNT0 PFCNT(0, 1) 39 + #define PFCNT1 PFCNT(1, 1) 40 + #define PFMON(n, x) ((x) << ((n) ? PFMON1_P : PFMON0_P)) 41 + #define PFMON0 PFMON(0, PFMON_MASK) 42 + #define PFMON1 PFMON(1, PFMON_MASK) 43 + 44 + #endif
+4
arch/blackfin/include/asm/bfin_sport.h
··· 100 100 }; 101 101 #undef __BFP 102 102 103 + struct bfin_snd_platform_data { 104 + const unsigned short *pin_req; 105 + }; 106 + 103 107 #define bfin_read_sport_rx32(base) \ 104 108 ({ \ 105 109 struct sport_register *__mmrs = (void *)base; \
+18 -5
arch/blackfin/include/asm/cacheflush.h
··· 39 39 40 40 static inline void flush_icache_range(unsigned start, unsigned end) 41 41 { 42 - #if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK) 43 - blackfin_dcache_flush_range(start, end); 42 + #if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) 43 + if (end <= physical_mem_end) 44 + blackfin_dcache_flush_range(start, end); 45 + #endif 46 + #if defined(CONFIG_BFIN_L2_WRITEBACK) 47 + if (start >= L2_START && end <= L2_START + L2_LENGTH) 48 + blackfin_dcache_flush_range(start, end); 44 49 #endif 45 50 46 51 /* Make sure all write buffers in the data side of the core ··· 57 52 * the pipeline. 58 53 */ 59 54 SSYNC(); 60 - #if defined(CONFIG_BFIN_ICACHE) 61 - blackfin_icache_flush_range(start, end); 62 - flush_icache_range_others(start, end); 55 + #if defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) 56 + if (end <= physical_mem_end) { 57 + blackfin_icache_flush_range(start, end); 58 + flush_icache_range_others(start, end); 59 + } 60 + #endif 61 + #if defined(CONFIG_BFIN_L2_ICACHEABLE) 62 + if (start >= L2_START && end <= L2_START + L2_LENGTH) { 63 + blackfin_icache_flush_range(start, end); 64 + flush_icache_range_others(start, end); 65 + } 63 66 #endif 64 67 } 65 68
-3
arch/blackfin/include/asm/cpu.h
··· 10 10 11 11 #include <linux/percpu.h> 12 12 13 - struct task_struct; 14 - 15 13 struct blackfin_cpudata { 16 14 struct cpu cpu; 17 - struct task_struct *idle; 18 15 unsigned int imemctl; 19 16 unsigned int dmemctl; 20 17 };
+6 -6
arch/blackfin/include/asm/def_LPBlackfin.h
··· 52 52 53 53 #define bfin_read(addr) \ 54 54 ({ \ 55 - sizeof(*(addr)) == 1 ? bfin_read8(addr) : \ 56 - sizeof(*(addr)) == 2 ? bfin_read16(addr) : \ 57 - sizeof(*(addr)) == 4 ? bfin_read32(addr) : \ 58 - ({ BUG(); 0; }); \ 55 + sizeof(*(addr)) == 1 ? bfin_read8(addr) : \ 56 + sizeof(*(addr)) == 2 ? bfin_read16(addr) : \ 57 + sizeof(*(addr)) == 4 ? bfin_read32(addr) : \ 58 + ({ BUG(); 0; }); \ 59 59 }) 60 60 #define bfin_write(addr, val) \ 61 61 do { \ ··· 69 69 70 70 #define bfin_write_or(addr, bits) \ 71 71 do { \ 72 - void *__addr = (void *)(addr); \ 72 + typeof(addr) __addr = (addr); \ 73 73 bfin_write(__addr, bfin_read(__addr) | (bits)); \ 74 74 } while (0) 75 75 76 76 #define bfin_write_and(addr, bits) \ 77 77 do { \ 78 - void *__addr = (void *)(addr); \ 78 + typeof(addr) __addr = (addr); \ 79 79 bfin_write(__addr, bfin_read(__addr) & (bits)); \ 80 80 } while (0) 81 81
+25
arch/blackfin/include/asm/irq_handler.h
··· 10 10 #include <linux/types.h> 11 11 #include <linux/linkage.h> 12 12 13 + /* init functions only */ 14 + extern int __init init_arch_irq(void); 15 + extern void init_exception_vectors(void); 16 + extern void __init program_IAR(void); 17 + #ifdef init_mach_irq 18 + extern void __init init_mach_irq(void); 19 + #else 20 + # define init_mach_irq() 21 + #endif 22 + 13 23 /* BASE LEVEL interrupt handler routines */ 14 24 asmlinkage void evt_exception(void); 15 25 asmlinkage void trap(void); ··· 46 36 47 37 extern int bfin_request_exception(unsigned int exception, void (*handler)(void)); 48 38 extern int bfin_free_exception(unsigned int exception, void (*handler)(void)); 39 + 40 + extern asmlinkage void lower_to_irq14(void); 41 + extern asmlinkage void bfin_return_from_exception(void); 42 + extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs); 43 + extern int bfin_internal_set_wake(unsigned int irq, unsigned int state); 44 + 45 + struct irq_data; 46 + extern void bfin_handle_irq(unsigned irq); 47 + extern void bfin_ack_noop(struct irq_data *); 48 + extern void bfin_internal_mask_irq(unsigned int irq); 49 + extern void bfin_internal_unmask_irq(unsigned int irq); 50 + 51 + struct irq_desc; 52 + extern void bfin_demux_mac_status_irq(unsigned int, struct irq_desc *); 53 + extern void bfin_demux_gpio_irq(unsigned int, struct irq_desc *); 49 54 50 55 #endif
+5 -1
arch/blackfin/include/asm/kgdb.h
··· 103 103 asm("EXCPT 2;"); 104 104 } 105 105 #define BREAK_INSTR_SIZE 2 106 - #define CACHE_FLUSH_IS_SAFE 1 106 + #ifdef CONFIG_SMP 107 + # define CACHE_FLUSH_IS_SAFE 0 108 + #else 109 + # define CACHE_FLUSH_IS_SAFE 1 110 + #endif 107 111 #define HW_INST_WATCHPOINT_NUM 6 108 112 #define HW_WATCHPOINT_NUM 8 109 113 #define TYPE_INST_WATCHPOINT 0
+1
arch/blackfin/include/asm/perf_event.h
··· 1 + #define MAX_HWEVENTS 2
-2
arch/blackfin/include/asm/ptrace.h
··· 108 108 extern void show_regs(struct pt_regs *); 109 109 110 110 #define arch_has_single_step() (1) 111 - extern void user_enable_single_step(struct task_struct *child); 112 - extern void user_disable_single_step(struct task_struct *child); 113 111 /* common code demands this function */ 114 112 #define ptrace_disable(child) user_disable_single_step(child) 115 113
+57
arch/blackfin/include/mach-common/irq.h
··· 1 + /* 2 + * Common Blackfin IRQ definitions (i.e. the CEC) 3 + * 4 + * Copyright 2005-2011 Analog Devices Inc. 5 + * 6 + * Licensed under the GPL-2 or later 7 + */ 8 + 9 + #ifndef _MACH_COMMON_IRQ_H_ 10 + #define _MACH_COMMON_IRQ_H_ 11 + 12 + /* 13 + * Core events interrupt source definitions 14 + * 15 + * Event Source Event Name 16 + * Emulation EMU 0 (highest priority) 17 + * Reset RST 1 18 + * NMI NMI 2 19 + * Exception EVX 3 20 + * Reserved -- 4 21 + * Hardware Error IVHW 5 22 + * Core Timer IVTMR 6 23 + * Peripherals IVG7 7 24 + * Peripherals IVG8 8 25 + * Peripherals IVG9 9 26 + * Peripherals IVG10 10 27 + * Peripherals IVG11 11 28 + * Peripherals IVG12 12 29 + * Peripherals IVG13 13 30 + * Softirq IVG14 14 31 + * System Call IVG15 15 (lowest priority) 32 + */ 33 + 34 + /* The ABSTRACT IRQ definitions */ 35 + #define IRQ_EMU 0 /* Emulation */ 36 + #define IRQ_RST 1 /* reset */ 37 + #define IRQ_NMI 2 /* Non Maskable */ 38 + #define IRQ_EVX 3 /* Exception */ 39 + #define IRQ_UNUSED 4 /* - unused interrupt */ 40 + #define IRQ_HWERR 5 /* Hardware Error */ 41 + #define IRQ_CORETMR 6 /* Core timer */ 42 + 43 + #define BFIN_IRQ(x) ((x) + 7) 44 + 45 + #define IVG7 7 46 + #define IVG8 8 47 + #define IVG9 9 48 + #define IVG10 10 49 + #define IVG11 11 50 + #define IVG12 12 51 + #define IVG13 13 52 + #define IVG14 14 53 + #define IVG15 15 54 + 55 + #define NR_IRQS (NR_MACH_IRQS + NR_SPARE_IRQS) 56 + 57 + #endif
+3
arch/blackfin/kernel/Makefile
··· 33 33 obj-$(CONFIG_STACKTRACE) += stacktrace.o 34 34 obj-$(CONFIG_DEBUG_VERBOSE) += trace.o 35 35 obj-$(CONFIG_BFIN_PSEUDODBG_INSNS) += pseudodbg.o 36 + obj-$(CONFIG_PERF_EVENTS) += perf_event.o 36 37 37 38 # the kgdb test puts code into L2 and without linker 38 39 # relaxation, we need to force long calls to/from it 39 40 CFLAGS_kgdb_test.o := -mlong-calls -O0 41 + 42 + obj-$(CONFIG_DEBUG_MMRS) += debug-mmrs.o
+5
arch/blackfin/kernel/bfin_dma_5xx.c
··· 36 36 37 37 printk(KERN_INFO "Blackfin DMA Controller\n"); 38 38 39 + 40 + #if ANOMALY_05000480 41 + bfin_write_DMAC_TC_PER(0x0111); 42 + #endif 43 + 39 44 for (i = 0; i < MAX_DMA_CHANNELS; i++) { 40 45 atomic_set(&dma_ch[i].chan_status, 0); 41 46 dma_ch[i].regs = dma_io_base_addr[i];
+22 -12
arch/blackfin/kernel/bfin_gpio.c
··· 10 10 #include <linux/module.h> 11 11 #include <linux/err.h> 12 12 #include <linux/proc_fs.h> 13 + #include <linux/seq_file.h> 13 14 #include <asm/blackfin.h> 14 15 #include <asm/gpio.h> 15 16 #include <asm/portmux.h> 16 17 #include <linux/irq.h> 18 + #include <asm/irq_handler.h> 17 19 18 20 #if ANOMALY_05000311 || ANOMALY_05000323 19 21 enum { ··· 536 534 #if defined(BF533_FAMILY) 537 535 IRQ_PROG_INTB 538 536 #elif defined(BF537_FAMILY) 539 - IRQ_PROG_INTB, IRQ_PORTG_INTB, IRQ_MAC_TX 537 + IRQ_PF_INTB_WATCH, IRQ_PORTG_INTB, IRQ_PH_INTB_MAC_TX 540 538 #elif defined(BF538_FAMILY) 541 539 IRQ_PORTF_INTB 542 540 #elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x) ··· 1205 1203 } 1206 1204 1207 1205 #if defined(CONFIG_PROC_FS) 1208 - static int gpio_proc_read(char *buf, char **start, off_t offset, 1209 - int len, int *unused_i, void *unused_v) 1206 + static int gpio_proc_show(struct seq_file *m, void *v) 1210 1207 { 1211 - int c, irq, gpio, outlen = 0; 1208 + int c, irq, gpio; 1212 1209 1213 1210 for (c = 0; c < MAX_RESOURCES; c++) { 1214 1211 irq = is_reserved(gpio_irq, c, 1); 1215 1212 gpio = is_reserved(gpio, c, 1); 1216 1213 if (!check_gpio(c) && (gpio || irq)) 1217 - len = sprintf(buf, "GPIO_%d: \t%s%s \t\tGPIO %s\n", c, 1214 + seq_printf(m, "GPIO_%d: \t%s%s \t\tGPIO %s\n", c, 1218 1215 get_label(c), (gpio && irq) ? " *" : "", 1219 1216 get_gpio_dir(c) ? "OUTPUT" : "INPUT"); 1220 1217 else if (is_reserved(peri, c, 1)) 1221 - len = sprintf(buf, "GPIO_%d: \t%s \t\tPeripheral\n", c, get_label(c)); 1218 + seq_printf(m, "GPIO_%d: \t%s \t\tPeripheral\n", c, get_label(c)); 1222 1219 else 1223 1220 continue; 1224 - buf += len; 1225 - outlen += len; 1226 1221 } 1227 - return outlen; 1222 + 1223 + return 0; 1228 1224 } 1225 + 1226 + static int gpio_proc_open(struct inode *inode, struct file *file) 1227 + { 1228 + return single_open(file, gpio_proc_show, NULL); 1229 + } 1230 + 1231 + static const struct file_operations gpio_proc_ops = { 1232 + .open = gpio_proc_open, 1233 + .read = seq_read, 1234 + .llseek = seq_lseek, 1235 + .release = single_release, 1236 + }; 1229 1237 1230 1238 static __init int gpio_register_proc(void) 1231 1239 { 1232 1240 struct proc_dir_entry *proc_gpio; 1233 1241 1234 - proc_gpio = create_proc_entry("gpio", S_IRUGO, NULL); 1235 - if (proc_gpio) 1236 - proc_gpio->read_proc = gpio_proc_read; 1242 + proc_gpio = proc_create("gpio", S_IRUGO, NULL, &gpio_proc_ops); 1237 1243 return proc_gpio != NULL; 1238 1244 } 1239 1245 __initcall(gpio_register_proc);
+1
arch/blackfin/kernel/bfin_ksyms.c
··· 11 11 12 12 #include <asm/cacheflush.h> 13 13 #include <asm/io.h> 14 + #include <asm/irq_handler.h> 14 15 15 16 /* Allow people to have their own Blackfin exception handler in a module */ 16 17 EXPORT_SYMBOL(bfin_return_from_exception);
+1860
arch/blackfin/kernel/debug-mmrs.c
··· 1 + /* 2 + * debugfs interface to core/system MMRs 3 + * 4 + * Copyright 2007-2011 Analog Devices Inc. 5 + * 6 + * Licensed under the GPL-2 or later 7 + */ 8 + 9 + #include <linux/debugfs.h> 10 + #include <linux/fs.h> 11 + #include <linux/kernel.h> 12 + #include <linux/module.h> 13 + 14 + #include <asm/blackfin.h> 15 + #include <asm/gpio.h> 16 + #include <asm/bfin_can.h> 17 + #include <asm/bfin_dma.h> 18 + #include <asm/bfin_ppi.h> 19 + #include <asm/bfin_serial.h> 20 + #include <asm/bfin5xx_spi.h> 21 + #include <asm/bfin_twi.h> 22 + 23 + /* Common code defines PORT_MUX on us, so redirect the MMR back locally */ 24 + #ifdef BFIN_PORT_MUX 25 + #undef PORT_MUX 26 + #define PORT_MUX BFIN_PORT_MUX 27 + #endif 28 + 29 + #define _d(name, bits, addr, perms) debugfs_create_x##bits(name, perms, parent, (u##bits *)addr) 30 + #define d(name, bits, addr) _d(name, bits, addr, S_IRUSR|S_IWUSR) 31 + #define d_RO(name, bits, addr) _d(name, bits, addr, S_IRUSR) 32 + #define d_WO(name, bits, addr) _d(name, bits, addr, S_IWUSR) 33 + 34 + #define D_RO(name, bits) d_RO(#name, bits, name) 35 + #define D_WO(name, bits) d_WO(#name, bits, name) 36 + #define D32(name) d(#name, 32, name) 37 + #define D16(name) d(#name, 16, name) 38 + 39 + #define REGS_OFF(peri, mmr) offsetof(struct bfin_##peri##_regs, mmr) 40 + #define __REGS(peri, sname, rname) \ 41 + do { \ 42 + struct bfin_##peri##_regs r; \ 43 + void *addr = (void *)(base + REGS_OFF(peri, rname)); \ 44 + strcpy(_buf, sname); \ 45 + if (sizeof(r.rname) == 2) \ 46 + debugfs_create_x16(buf, S_IRUSR|S_IWUSR, parent, addr); \ 47 + else \ 48 + debugfs_create_x32(buf, S_IRUSR|S_IWUSR, parent, addr); \ 49 + } while (0) 50 + #define REGS_STR_PFX(buf, pfx, num) \ 51 + ({ \ 52 + buf + (num >= 0 ? \ 53 + sprintf(buf, #pfx "%i_", num) : \ 54 + sprintf(buf, #pfx "_")); \ 55 + }) 56 + #define REGS_STR_PFX_C(buf, pfx, num) \ 57 + ({ \ 58 + buf + (num >= 0 ? \ 59 + sprintf(buf, #pfx "%c_", 'A' + num) : \ 60 + sprintf(buf, #pfx "_")); \ 61 + }) 62 + 63 + /* 64 + * Core registers (not memory mapped) 65 + */ 66 + extern u32 last_seqstat; 67 + 68 + static int debug_cclk_get(void *data, u64 *val) 69 + { 70 + *val = get_cclk(); 71 + return 0; 72 + } 73 + DEFINE_SIMPLE_ATTRIBUTE(fops_debug_cclk, debug_cclk_get, NULL, "0x%08llx\n"); 74 + 75 + static int debug_sclk_get(void *data, u64 *val) 76 + { 77 + *val = get_sclk(); 78 + return 0; 79 + } 80 + DEFINE_SIMPLE_ATTRIBUTE(fops_debug_sclk, debug_sclk_get, NULL, "0x%08llx\n"); 81 + 82 + #define DEFINE_SYSREG(sr, pre, post) \ 83 + static int sysreg_##sr##_get(void *data, u64 *val) \ 84 + { \ 85 + unsigned long tmp; \ 86 + pre; \ 87 + __asm__ __volatile__("%0 = " #sr ";" : "=d"(tmp)); \ 88 + *val = tmp; \ 89 + return 0; \ 90 + } \ 91 + static int sysreg_##sr##_set(void *data, u64 val) \ 92 + { \ 93 + unsigned long tmp = val; \ 94 + __asm__ __volatile__(#sr " = %0;" : : "d"(tmp)); \ 95 + post; \ 96 + return 0; \ 97 + } \ 98 + DEFINE_SIMPLE_ATTRIBUTE(fops_sysreg_##sr, sysreg_##sr##_get, sysreg_##sr##_set, "0x%08llx\n") 99 + 100 + DEFINE_SYSREG(cycles, , ); 101 + DEFINE_SYSREG(cycles2, __asm__ __volatile__("%0 = cycles;" : "=d"(tmp)), ); 102 + DEFINE_SYSREG(emudat, , ); 103 + DEFINE_SYSREG(seqstat, , ); 104 + DEFINE_SYSREG(syscfg, , CSYNC()); 105 + #define D_SYSREG(sr) debugfs_create_file(#sr, S_IRUSR|S_IWUSR, parent, NULL, &fops_sysreg_##sr) 106 + 107 + /* 108 + * CAN 109 + */ 110 + #define CAN_OFF(mmr) REGS_OFF(can, mmr) 111 + #define __CAN(uname, lname) __REGS(can, #uname, lname) 112 + static void __init __maybe_unused 113 + bfin_debug_mmrs_can(struct dentry *parent, unsigned long base, int num) 114 + { 115 + static struct dentry *am, *mb; 116 + int i, j; 117 + char buf[32], *_buf = REGS_STR_PFX(buf, CAN, num); 118 + 119 + if (!am) { 120 + am = debugfs_create_dir("am", parent); 121 + mb = debugfs_create_dir("mb", parent); 122 + } 123 + 124 + __CAN(MC1, mc1); 125 + __CAN(MD1, md1); 126 + __CAN(TRS1, trs1); 127 + __CAN(TRR1, trr1); 128 + __CAN(TA1, ta1); 129 + __CAN(AA1, aa1); 130 + __CAN(RMP1, rmp1); 131 + __CAN(RML1, rml1); 132 + __CAN(MBTIF1, mbtif1); 133 + __CAN(MBRIF1, mbrif1); 134 + __CAN(MBIM1, mbim1); 135 + __CAN(RFH1, rfh1); 136 + __CAN(OPSS1, opss1); 137 + 138 + __CAN(MC2, mc2); 139 + __CAN(MD2, md2); 140 + __CAN(TRS2, trs2); 141 + __CAN(TRR2, trr2); 142 + __CAN(TA2, ta2); 143 + __CAN(AA2, aa2); 144 + __CAN(RMP2, rmp2); 145 + __CAN(RML2, rml2); 146 + __CAN(MBTIF2, mbtif2); 147 + __CAN(MBRIF2, mbrif2); 148 + __CAN(MBIM2, mbim2); 149 + __CAN(RFH2, rfh2); 150 + __CAN(OPSS2, opss2); 151 + 152 + __CAN(CLOCK, clock); 153 + __CAN(TIMING, timing); 154 + __CAN(DEBUG, debug); 155 + __CAN(STATUS, status); 156 + __CAN(CEC, cec); 157 + __CAN(GIS, gis); 158 + __CAN(GIM, gim); 159 + __CAN(GIF, gif); 160 + __CAN(CONTROL, control); 161 + __CAN(INTR, intr); 162 + __CAN(VERSION, version); 163 + __CAN(MBTD, mbtd); 164 + __CAN(EWR, ewr); 165 + __CAN(ESR, esr); 166 + /*__CAN(UCREG, ucreg); no longer exists */ 167 + __CAN(UCCNT, uccnt); 168 + __CAN(UCRC, ucrc); 169 + __CAN(UCCNF, uccnf); 170 + __CAN(VERSION2, version2); 171 + 172 + for (i = 0; i < 32; ++i) { 173 + sprintf(_buf, "AM%02iL", i); 174 + debugfs_create_x16(buf, S_IRUSR|S_IWUSR, am, 175 + (u16 *)(base + CAN_OFF(msk[i].aml))); 176 + sprintf(_buf, "AM%02iH", i); 177 + debugfs_create_x16(buf, S_IRUSR|S_IWUSR, am, 178 + (u16 *)(base + CAN_OFF(msk[i].amh))); 179 + 180 + for (j = 0; j < 3; ++j) { 181 + sprintf(_buf, "MB%02i_DATA%i", i, j); 182 + debugfs_create_x16(buf, S_IRUSR|S_IWUSR, mb, 183 + (u16 *)(base + CAN_OFF(chl[i].data[j*2]))); 184 + } 185 + sprintf(_buf, "MB%02i_LENGTH", i); 186 + debugfs_create_x16(buf, S_IRUSR|S_IWUSR, mb, 187 + (u16 *)(base + CAN_OFF(chl[i].dlc))); 188 + sprintf(_buf, "MB%02i_TIMESTAMP", i); 189 + debugfs_create_x16(buf, S_IRUSR|S_IWUSR, mb, 190 + (u16 *)(base + CAN_OFF(chl[i].tsv))); 191 + sprintf(_buf, "MB%02i_ID0", i); 192 + debugfs_create_x16(buf, S_IRUSR|S_IWUSR, mb, 193 + (u16 *)(base + CAN_OFF(chl[i].id0))); 194 + sprintf(_buf, "MB%02i_ID1", i); 195 + debugfs_create_x16(buf, S_IRUSR|S_IWUSR, mb, 196 + (u16 *)(base + CAN_OFF(chl[i].id1))); 197 + } 198 + } 199 + #define CAN(num) bfin_debug_mmrs_can(parent, CAN##num##_MC1, num) 200 + 201 + /* 202 + * DMA 203 + */ 204 + #define __DMA(uname, lname) __REGS(dma, #uname, lname) 205 + static void __init __maybe_unused 206 + bfin_debug_mmrs_dma(struct dentry *parent, unsigned long base, int num, char mdma, const char *pfx) 207 + { 208 + char buf[32], *_buf; 209 + 210 + if (mdma) 211 + _buf = buf + sprintf(buf, "%s_%c%i_", pfx, mdma, num); 212 + else 213 + _buf = buf + sprintf(buf, "%s%i_", pfx, num); 214 + 215 + __DMA(NEXT_DESC_PTR, next_desc_ptr); 216 + __DMA(START_ADDR, start_addr); 217 + __DMA(CONFIG, config); 218 + __DMA(X_COUNT, x_count); 219 + __DMA(X_MODIFY, x_modify); 220 + __DMA(Y_COUNT, y_count); 221 + __DMA(Y_MODIFY, y_modify); 222 + __DMA(CURR_DESC_PTR, curr_desc_ptr); 223 + __DMA(CURR_ADDR, curr_addr); 224 + __DMA(IRQ_STATUS, irq_status); 225 + __DMA(PERIPHERAL_MAP, peripheral_map); 226 + __DMA(CURR_X_COUNT, curr_x_count); 227 + __DMA(CURR_Y_COUNT, curr_y_count); 228 + } 229 + #define _DMA(num, base, mdma, pfx) bfin_debug_mmrs_dma(parent, base, num, mdma, pfx "DMA") 230 + #define DMA(num) _DMA(num, DMA##num##_NEXT_DESC_PTR, 0, "") 231 + #define _MDMA(num, x) \ 232 + do { \ 233 + _DMA(num, x##DMA_D##num##_CONFIG, 'D', #x); \ 234 + _DMA(num, x##DMA_S##num##_CONFIG, 'S', #x); \ 235 + } while (0) 236 + #define MDMA(num) _MDMA(num, M) 237 + #define IMDMA(num) _MDMA(num, IM) 238 + 239 + /* 240 + * EPPI 241 + */ 242 + #define __EPPI(uname, lname) __REGS(eppi, #uname, lname) 243 + static void __init __maybe_unused 244 + bfin_debug_mmrs_eppi(struct dentry *parent, unsigned long base, int num) 245 + { 246 + char buf[32], *_buf = REGS_STR_PFX(buf, EPPI, num); 247 + __EPPI(STATUS, status); 248 + __EPPI(HCOUNT, hcount); 249 + __EPPI(HDELAY, hdelay); 250 + __EPPI(VCOUNT, vcount); 251 + __EPPI(VDELAY, vdelay); 252 + __EPPI(FRAME, frame); 253 + __EPPI(LINE, line); 254 + __EPPI(CLKDIV, clkdiv); 255 + __EPPI(CONTROL, control); 256 + __EPPI(FS1W_HBL, fs1w_hbl); 257 + __EPPI(FS1P_AVPL, fs1p_avpl); 258 + __EPPI(FS2W_LVB, fs2w_lvb); 259 + __EPPI(FS2P_LAVF, fs2p_lavf); 260 + __EPPI(CLIP, clip); 261 + } 262 + #define EPPI(num) bfin_debug_mmrs_eppi(parent, EPPI##num##_STATUS, num) 263 + 264 + /* 265 + * General Purpose Timers 266 + */ 267 + #define GPTIMER_OFF(mmr) (TIMER0_##mmr - TIMER0_CONFIG) 268 + #define __GPTIMER(name) \ 269 + do { \ 270 + strcpy(_buf, #name); \ 271 + debugfs_create_x16(buf, S_IRUSR|S_IWUSR, parent, (u16 *)(base + GPTIMER_OFF(name))); \ 272 + } while (0) 273 + static void __init __maybe_unused 274 + bfin_debug_mmrs_gptimer(struct dentry *parent, unsigned long base, int num) 275 + { 276 + char buf[32], *_buf = REGS_STR_PFX(buf, TIMER, num); 277 + __GPTIMER(CONFIG); 278 + __GPTIMER(COUNTER); 279 + __GPTIMER(PERIOD); 280 + __GPTIMER(WIDTH); 281 + } 282 + #define GPTIMER(num) bfin_debug_mmrs_gptimer(parent, TIMER##num##_CONFIG, num) 283 + 284 + /* 285 + * Handshake MDMA 286 + */ 287 + #define __HMDMA(uname, lname) __REGS(hmdma, #uname, lname) 288 + static void __init __maybe_unused 289 + bfin_debug_mmrs_hmdma(struct dentry *parent, unsigned long base, int num) 290 + { 291 + char buf[32], *_buf = REGS_STR_PFX(buf, HMDMA, num); 292 + __HMDMA(CONTROL, control); 293 + __HMDMA(ECINIT, ecinit); 294 + __HMDMA(BCINIT, bcinit); 295 + __HMDMA(ECURGENT, ecurgent); 296 + __HMDMA(ECOVERFLOW, ecoverflow); 297 + __HMDMA(ECOUNT, ecount); 298 + __HMDMA(BCOUNT, bcount); 299 + } 300 + #define HMDMA(num) bfin_debug_mmrs_hmdma(parent, HMDMA##num##_CONTROL, num) 301 + 302 + /* 303 + * Port/GPIO 304 + */ 305 + #define bfin_gpio_regs gpio_port_t 306 + #define __PORT(uname, lname) __REGS(gpio, #uname, lname) 307 + static void __init __maybe_unused 308 + bfin_debug_mmrs_port(struct dentry *parent, unsigned long base, int num) 309 + { 310 + char buf[32], *_buf; 311 + #ifdef __ADSPBF54x__ 312 + _buf = REGS_STR_PFX_C(buf, PORT, num); 313 + __PORT(FER, port_fer); 314 + __PORT(SET, data_set); 315 + __PORT(CLEAR, data_clear); 316 + __PORT(DIR_SET, dir_set); 317 + __PORT(DIR_CLEAR, dir_clear); 318 + __PORT(INEN, inen); 319 + __PORT(MUX, port_mux); 320 + #else 321 + _buf = buf + sprintf(buf, "PORT%cIO_", num); 322 + __PORT(CLEAR, data_clear); 323 + __PORT(SET, data_set); 324 + __PORT(TOGGLE, toggle); 325 + __PORT(MASKA, maska); 326 + __PORT(MASKA_CLEAR, maska_clear); 327 + __PORT(MASKA_SET, maska_set); 328 + __PORT(MASKA_TOGGLE, maska_toggle); 329 + __PORT(MASKB, maskb); 330 + __PORT(MASKB_CLEAR, maskb_clear); 331 + __PORT(MASKB_SET, maskb_set); 332 + __PORT(MASKB_TOGGLE, maskb_toggle); 333 + __PORT(DIR, dir); 334 + __PORT(POLAR, polar); 335 + __PORT(EDGE, edge); 336 + __PORT(BOTH, both); 337 + __PORT(INEN, inen); 338 + #endif 339 + _buf[-1] = '\0'; 340 + d(buf, 16, base + REGS_OFF(gpio, data)); 341 + } 342 + #define PORT(base, num) bfin_debug_mmrs_port(parent, base, num) 343 + 344 + /* 345 + * PPI 346 + */ 347 + #define __PPI(uname, lname) __REGS(ppi, #uname, lname) 348 + static void __init __maybe_unused 349 + bfin_debug_mmrs_ppi(struct dentry *parent, unsigned long base, int num) 350 + { 351 + char buf[32], *_buf = REGS_STR_PFX(buf, PPI, num); 352 + __PPI(CONTROL, control); 353 + __PPI(STATUS, status); 354 + __PPI(COUNT, count); 355 + __PPI(DELAY, delay); 356 + __PPI(FRAME, frame); 357 + } 358 + #define PPI(num) bfin_debug_mmrs_ppi(parent, PPI##num##_STATUS, num) 359 + 360 + /* 361 + * SPI 362 + */ 363 + #define __SPI(uname, lname) __REGS(spi, #uname, lname) 364 + static void __init __maybe_unused 365 + bfin_debug_mmrs_spi(struct dentry *parent, unsigned long base, int num) 366 + { 367 + char buf[32], *_buf = REGS_STR_PFX(buf, SPI, num); 368 + __SPI(CTL, ctl); 369 + __SPI(FLG, flg); 370 + __SPI(STAT, stat); 371 + __SPI(TDBR, tdbr); 372 + __SPI(RDBR, rdbr); 373 + __SPI(BAUD, baud); 374 + __SPI(SHADOW, shadow); 375 + } 376 + #define SPI(num) bfin_debug_mmrs_spi(parent, SPI##num##_REGBASE, num) 377 + 378 + /* 379 + * SPORT 380 + */ 381 + static inline int sport_width(void *mmr) 382 + { 383 + unsigned long lmmr = (unsigned long)mmr; 384 + if ((lmmr & 0xff) == 0x10) 385 + /* SPORT#_TX has 0x10 offset -> SPORT#_TCR2 has 0x04 offset */ 386 + lmmr -= 0xc; 387 + else 388 + /* SPORT#_RX has 0x18 offset -> SPORT#_RCR2 has 0x24 offset */ 389 + lmmr += 0xc; 390 + /* extract SLEN field from control register 2 and add 1 */ 391 + return (bfin_read16(lmmr) & 0x1f) + 1; 392 + } 393 + static int sport_set(void *mmr, u64 val) 394 + { 395 + unsigned long flags; 396 + local_irq_save(flags); 397 + if (sport_width(mmr) <= 16) 398 + bfin_write16(mmr, val); 399 + else 400 + bfin_write32(mmr, val); 401 + local_irq_restore(flags); 402 + return 0; 403 + } 404 + static int sport_get(void *mmr, u64 *val) 405 + { 406 + unsigned long flags; 407 + local_irq_save(flags); 408 + if (sport_width(mmr) <= 16) 409 + *val = bfin_read16(mmr); 410 + else 411 + *val = bfin_read32(mmr); 412 + local_irq_restore(flags); 413 + return 0; 414 + } 415 + DEFINE_SIMPLE_ATTRIBUTE(fops_sport, sport_get, sport_set, "0x%08llx\n"); 416 + /*DEFINE_SIMPLE_ATTRIBUTE(fops_sport_ro, sport_get, NULL, "0x%08llx\n");*/ 417 + DEFINE_SIMPLE_ATTRIBUTE(fops_sport_wo, NULL, sport_set, "0x%08llx\n"); 418 + #define SPORT_OFF(mmr) (SPORT0_##mmr - SPORT0_TCR1) 419 + #define _D_SPORT(name, perms, fops) \ 420 + do { \ 421 + strcpy(_buf, #name); \ 422 + debugfs_create_file(buf, perms, parent, (void *)(base + SPORT_OFF(name)), fops); \ 423 + } while (0) 424 + #define __SPORT_RW(name) _D_SPORT(name, S_IRUSR|S_IWUSR, &fops_sport) 425 + #define __SPORT_RO(name) _D_SPORT(name, S_IRUSR, &fops_sport_ro) 426 + #define __SPORT_WO(name) _D_SPORT(name, S_IWUSR, &fops_sport_wo) 427 + #define __SPORT(name, bits) \ 428 + do { \ 429 + strcpy(_buf, #name); \ 430 + debugfs_create_x##bits(buf, S_IRUSR|S_IWUSR, parent, (u##bits *)(base + SPORT_OFF(name))); \ 431 + } while (0) 432 + static void __init __maybe_unused 433 + bfin_debug_mmrs_sport(struct dentry *parent, unsigned long base, int num) 434 + { 435 + char buf[32], *_buf = REGS_STR_PFX(buf, SPORT, num); 436 + __SPORT(CHNL, 16); 437 + __SPORT(MCMC1, 16); 438 + __SPORT(MCMC2, 16); 439 + __SPORT(MRCS0, 32); 440 + __SPORT(MRCS1, 32); 441 + __SPORT(MRCS2, 32); 442 + __SPORT(MRCS3, 32); 443 + __SPORT(MTCS0, 32); 444 + __SPORT(MTCS1, 32); 445 + __SPORT(MTCS2, 32); 446 + __SPORT(MTCS3, 32); 447 + __SPORT(RCLKDIV, 16); 448 + __SPORT(RCR1, 16); 449 + __SPORT(RCR2, 16); 450 + __SPORT(RFSDIV, 16); 451 + __SPORT_RW(RX); 452 + __SPORT(STAT, 16); 453 + __SPORT(TCLKDIV, 16); 454 + __SPORT(TCR1, 16); 455 + __SPORT(TCR2, 16); 456 + __SPORT(TFSDIV, 16); 457 + __SPORT_WO(TX); 458 + } 459 + #define SPORT(num) bfin_debug_mmrs_sport(parent, SPORT##num##_TCR1, num) 460 + 461 + /* 462 + * TWI 463 + */ 464 + #define __TWI(uname, lname) __REGS(twi, #uname, lname) 465 + static void __init __maybe_unused 466 + bfin_debug_mmrs_twi(struct dentry *parent, unsigned long base, int num) 467 + { 468 + char buf[32], *_buf = REGS_STR_PFX(buf, TWI, num); 469 + __TWI(CLKDIV, clkdiv); 470 + __TWI(CONTROL, control); 471 + __TWI(SLAVE_CTL, slave_ctl); 472 + __TWI(SLAVE_STAT, slave_stat); 473 + __TWI(SLAVE_ADDR, slave_addr); 474 + __TWI(MASTER_CTL, master_ctl); 475 + __TWI(MASTER_STAT, master_stat); 476 + __TWI(MASTER_ADDR, master_addr); 477 + __TWI(INT_STAT, int_stat); 478 + __TWI(INT_MASK, int_mask); 479 + __TWI(FIFO_CTL, fifo_ctl); 480 + __TWI(FIFO_STAT, fifo_stat); 481 + __TWI(XMT_DATA8, xmt_data8); 482 + __TWI(XMT_DATA16, xmt_data16); 483 + __TWI(RCV_DATA8, rcv_data8); 484 + __TWI(RCV_DATA16, rcv_data16); 485 + } 486 + #define TWI(num) bfin_debug_mmrs_twi(parent, TWI##num##_CLKDIV, num) 487 + 488 + /* 489 + * UART 490 + */ 491 + #define __UART(uname, lname) __REGS(uart, #uname, lname) 492 + static void __init __maybe_unused 493 + bfin_debug_mmrs_uart(struct dentry *parent, unsigned long base, int num) 494 + { 495 + char buf[32], *_buf = REGS_STR_PFX(buf, UART, num); 496 + #ifdef BFIN_UART_BF54X_STYLE 497 + __UART(DLL, dll); 498 + __UART(DLH, dlh); 499 + __UART(GCTL, gctl); 500 + __UART(LCR, lcr); 501 + __UART(MCR, mcr); 502 + __UART(LSR, lsr); 503 + __UART(MSR, msr); 504 + __UART(SCR, scr); 505 + __UART(IER_SET, ier_set); 506 + __UART(IER_CLEAR, ier_clear); 507 + __UART(THR, thr); 508 + __UART(RBR, rbr); 509 + #else 510 + __UART(DLL, dll); 511 + __UART(THR, thr); 512 + __UART(RBR, rbr); 513 + __UART(DLH, dlh); 514 + __UART(IER, ier); 515 + __UART(IIR, iir); 516 + __UART(LCR, lcr); 517 + __UART(MCR, mcr); 518 + __UART(LSR, lsr); 519 + __UART(MSR, msr); 520 + __UART(SCR, scr); 521 + __UART(GCTL, gctl); 522 + #endif 523 + } 524 + #define UART(num) bfin_debug_mmrs_uart(parent, UART##num##_DLL, num) 525 + 526 + /* 527 + * The actual debugfs generation 528 + */ 529 + static struct dentry *debug_mmrs_dentry; 530 + 531 + static int __init bfin_debug_mmrs_init(void) 532 + { 533 + struct dentry *top, *parent; 534 + 535 + pr_info("debug-mmrs: setting up Blackfin MMR debugfs\n"); 536 + 537 + top = debugfs_create_dir("blackfin", NULL); 538 + if (top == NULL) 539 + return -1; 540 + 541 + parent = debugfs_create_dir("core_regs", top); 542 + debugfs_create_file("cclk", S_IRUSR, parent, NULL, &fops_debug_cclk); 543 + debugfs_create_file("sclk", S_IRUSR, parent, NULL, &fops_debug_sclk); 544 + debugfs_create_x32("last_seqstat", S_IRUSR, parent, &last_seqstat); 545 + D_SYSREG(cycles); 546 + D_SYSREG(cycles2); 547 + D_SYSREG(emudat); 548 + D_SYSREG(seqstat); 549 + D_SYSREG(syscfg); 550 + 551 + /* Core MMRs */ 552 + parent = debugfs_create_dir("ctimer", top); 553 + D32(TCNTL); 554 + D32(TCOUNT); 555 + D32(TPERIOD); 556 + D32(TSCALE); 557 + 558 + parent = debugfs_create_dir("cec", top); 559 + D32(EVT0); 560 + D32(EVT1); 561 + D32(EVT2); 562 + D32(EVT3); 563 + D32(EVT4); 564 + D32(EVT5); 565 + D32(EVT6); 566 + D32(EVT7); 567 + D32(EVT8); 568 + D32(EVT9); 569 + D32(EVT10); 570 + D32(EVT11); 571 + D32(EVT12); 572 + D32(EVT13); 573 + D32(EVT14); 574 + D32(EVT15); 575 + D32(EVT_OVERRIDE); 576 + D32(IMASK); 577 + D32(IPEND); 578 + D32(ILAT); 579 + D32(IPRIO); 580 + 581 + parent = debugfs_create_dir("debug", top); 582 + D32(DBGSTAT); 583 + D32(DSPID); 584 + 585 + parent = debugfs_create_dir("mmu", top); 586 + D32(SRAM_BASE_ADDRESS); 587 + D32(DCPLB_ADDR0); 588 + D32(DCPLB_ADDR10); 589 + D32(DCPLB_ADDR11); 590 + D32(DCPLB_ADDR12); 591 + D32(DCPLB_ADDR13); 592 + D32(DCPLB_ADDR14); 593 + D32(DCPLB_ADDR15); 594 + D32(DCPLB_ADDR1); 595 + D32(DCPLB_ADDR2); 596 + D32(DCPLB_ADDR3); 597 + D32(DCPLB_ADDR4); 598 + D32(DCPLB_ADDR5); 599 + D32(DCPLB_ADDR6); 600 + D32(DCPLB_ADDR7); 601 + D32(DCPLB_ADDR8); 602 + D32(DCPLB_ADDR9); 603 + D32(DCPLB_DATA0); 604 + D32(DCPLB_DATA10); 605 + D32(DCPLB_DATA11); 606 + D32(DCPLB_DATA12); 607 + D32(DCPLB_DATA13); 608 + D32(DCPLB_DATA14); 609 + D32(DCPLB_DATA15); 610 + D32(DCPLB_DATA1); 611 + D32(DCPLB_DATA2); 612 + D32(DCPLB_DATA3); 613 + D32(DCPLB_DATA4); 614 + D32(DCPLB_DATA5); 615 + D32(DCPLB_DATA6); 616 + D32(DCPLB_DATA7); 617 + D32(DCPLB_DATA8); 618 + D32(DCPLB_DATA9); 619 + D32(DCPLB_FAULT_ADDR); 620 + D32(DCPLB_STATUS); 621 + D32(DMEM_CONTROL); 622 + D32(DTEST_COMMAND); 623 + D32(DTEST_DATA0); 624 + D32(DTEST_DATA1); 625 + 626 + D32(ICPLB_ADDR0); 627 + D32(ICPLB_ADDR1); 628 + D32(ICPLB_ADDR2); 629 + D32(ICPLB_ADDR3); 630 + D32(ICPLB_ADDR4); 631 + D32(ICPLB_ADDR5); 632 + D32(ICPLB_ADDR6); 633 + D32(ICPLB_ADDR7); 634 + D32(ICPLB_ADDR8); 635 + D32(ICPLB_ADDR9); 636 + D32(ICPLB_ADDR10); 637 + D32(ICPLB_ADDR11); 638 + D32(ICPLB_ADDR12); 639 + D32(ICPLB_ADDR13); 640 + D32(ICPLB_ADDR14); 641 + D32(ICPLB_ADDR15); 642 + D32(ICPLB_DATA0); 643 + D32(ICPLB_DATA1); 644 + D32(ICPLB_DATA2); 645 + D32(ICPLB_DATA3); 646 + D32(ICPLB_DATA4); 647 + D32(ICPLB_DATA5); 648 + D32(ICPLB_DATA6); 649 + D32(ICPLB_DATA7); 650 + D32(ICPLB_DATA8); 651 + D32(ICPLB_DATA9); 652 + D32(ICPLB_DATA10); 653 + D32(ICPLB_DATA11); 654 + D32(ICPLB_DATA12); 655 + D32(ICPLB_DATA13); 656 + D32(ICPLB_DATA14); 657 + D32(ICPLB_DATA15); 658 + D32(ICPLB_FAULT_ADDR); 659 + D32(ICPLB_STATUS); 660 + D32(IMEM_CONTROL); 661 + if (!ANOMALY_05000481) { 662 + D32(ITEST_COMMAND); 663 + D32(ITEST_DATA0); 664 + D32(ITEST_DATA1); 665 + } 666 + 667 + parent = debugfs_create_dir("perf", top); 668 + D32(PFCNTR0); 669 + D32(PFCNTR1); 670 + D32(PFCTL); 671 + 672 + parent = debugfs_create_dir("trace", top); 673 + D32(TBUF); 674 + D32(TBUFCTL); 675 + D32(TBUFSTAT); 676 + 677 + parent = debugfs_create_dir("watchpoint", top); 678 + D32(WPIACTL); 679 + D32(WPIA0); 680 + D32(WPIA1); 681 + D32(WPIA2); 682 + D32(WPIA3); 683 + D32(WPIA4); 684 + D32(WPIA5); 685 + D32(WPIACNT0); 686 + D32(WPIACNT1); 687 + D32(WPIACNT2); 688 + D32(WPIACNT3); 689 + D32(WPIACNT4); 690 + D32(WPIACNT5); 691 + D32(WPDACTL); 692 + D32(WPDA0); 693 + D32(WPDA1); 694 + D32(WPDACNT0); 695 + D32(WPDACNT1); 696 + D32(WPSTAT); 697 + 698 + /* System MMRs */ 699 + #ifdef ATAPI_CONTROL 700 + parent = debugfs_create_dir("atapi", top); 701 + D16(ATAPI_CONTROL); 702 + D16(ATAPI_DEV_ADDR); 703 + D16(ATAPI_DEV_RXBUF); 704 + D16(ATAPI_DEV_TXBUF); 705 + D16(ATAPI_DMA_TFRCNT); 706 + D16(ATAPI_INT_MASK); 707 + D16(ATAPI_INT_STATUS); 708 + D16(ATAPI_LINE_STATUS); 709 + D16(ATAPI_MULTI_TIM_0); 710 + D16(ATAPI_MULTI_TIM_1); 711 + D16(ATAPI_MULTI_TIM_2); 712 + D16(ATAPI_PIO_TFRCNT); 713 + D16(ATAPI_PIO_TIM_0); 714 + D16(ATAPI_PIO_TIM_1); 715 + D16(ATAPI_REG_TIM_0); 716 + D16(ATAPI_SM_STATE); 717 + D16(ATAPI_STATUS); 718 + D16(ATAPI_TERMINATE); 719 + D16(ATAPI_UDMAOUT_TFRCNT); 720 + D16(ATAPI_ULTRA_TIM_0); 721 + D16(ATAPI_ULTRA_TIM_1); 722 + D16(ATAPI_ULTRA_TIM_2); 723 + D16(ATAPI_ULTRA_TIM_3); 724 + D16(ATAPI_UMAIN_TFRCNT); 725 + D16(ATAPI_XFER_LEN); 726 + #endif 727 + 728 + #if defined(CAN_MC1) || defined(CAN0_MC1) || defined(CAN1_MC1) 729 + parent = debugfs_create_dir("can", top); 730 + # ifdef CAN_MC1 731 + bfin_debug_mmrs_can(parent, CAN_MC1, -1); 732 + # endif 733 + # ifdef CAN0_MC1 734 + CAN(0); 735 + # endif 736 + # ifdef CAN1_MC1 737 + CAN(1); 738 + # endif 739 + #endif 740 + 741 + #ifdef CNT_COMMAND 742 + parent = debugfs_create_dir("counter", top); 743 + D16(CNT_COMMAND); 744 + D16(CNT_CONFIG); 745 + D32(CNT_COUNTER); 746 + D16(CNT_DEBOUNCE); 747 + D16(CNT_IMASK); 748 + D32(CNT_MAX); 749 + D32(CNT_MIN); 750 + D16(CNT_STATUS); 751 + #endif 752 + 753 + parent = debugfs_create_dir("dmac", top); 754 + #ifdef DMA_TC_CNT 755 + D16(DMAC_TC_CNT); 756 + D16(DMAC_TC_PER); 757 + #endif 758 + #ifdef DMAC0_TC_CNT 759 + D16(DMAC0_TC_CNT); 760 + D16(DMAC0_TC_PER); 761 + #endif 762 + #ifdef DMAC1_TC_CNT 763 + D16(DMAC1_TC_CNT); 764 + D16(DMAC1_TC_PER); 765 + #endif 766 + #ifdef DMAC1_PERIMUX 767 + D16(DMAC1_PERIMUX); 768 + #endif 769 + 770 + #ifdef __ADSPBF561__ 771 + /* XXX: should rewrite the MMR map */ 772 + # define DMA0_NEXT_DESC_PTR DMA2_0_NEXT_DESC_PTR 773 + # define DMA1_NEXT_DESC_PTR DMA2_1_NEXT_DESC_PTR 774 + # define DMA2_NEXT_DESC_PTR DMA2_2_NEXT_DESC_PTR 775 + # define DMA3_NEXT_DESC_PTR DMA2_3_NEXT_DESC_PTR 776 + # define DMA4_NEXT_DESC_PTR DMA2_4_NEXT_DESC_PTR 777 + # define DMA5_NEXT_DESC_PTR DMA2_5_NEXT_DESC_PTR 778 + # define DMA6_NEXT_DESC_PTR DMA2_6_NEXT_DESC_PTR 779 + # define DMA7_NEXT_DESC_PTR DMA2_7_NEXT_DESC_PTR 780 + # define DMA8_NEXT_DESC_PTR DMA2_8_NEXT_DESC_PTR 781 + # define DMA9_NEXT_DESC_PTR DMA2_9_NEXT_DESC_PTR 782 + # define DMA10_NEXT_DESC_PTR DMA2_10_NEXT_DESC_PTR 783 + # define DMA11_NEXT_DESC_PTR DMA2_11_NEXT_DESC_PTR 784 + # define DMA12_NEXT_DESC_PTR DMA1_0_NEXT_DESC_PTR 785 + # define DMA13_NEXT_DESC_PTR DMA1_1_NEXT_DESC_PTR 786 + # define DMA14_NEXT_DESC_PTR DMA1_2_NEXT_DESC_PTR 787 + # define DMA15_NEXT_DESC_PTR DMA1_3_NEXT_DESC_PTR 788 + # define DMA16_NEXT_DESC_PTR DMA1_4_NEXT_DESC_PTR 789 + # define DMA17_NEXT_DESC_PTR DMA1_5_NEXT_DESC_PTR 790 + # define DMA18_NEXT_DESC_PTR DMA1_6_NEXT_DESC_PTR 791 + # define DMA19_NEXT_DESC_PTR DMA1_7_NEXT_DESC_PTR 792 + # define DMA20_NEXT_DESC_PTR DMA1_8_NEXT_DESC_PTR 793 + # define DMA21_NEXT_DESC_PTR DMA1_9_NEXT_DESC_PTR 794 + # define DMA22_NEXT_DESC_PTR DMA1_10_NEXT_DESC_PTR 795 + # define DMA23_NEXT_DESC_PTR DMA1_11_NEXT_DESC_PTR 796 + #endif 797 + parent = debugfs_create_dir("dma", top); 798 + DMA(0); 799 + DMA(1); 800 + DMA(1); 801 + DMA(2); 802 + DMA(3); 803 + DMA(4); 804 + DMA(5); 805 + DMA(6); 806 + DMA(7); 807 + #ifdef DMA8_NEXT_DESC_PTR 808 + DMA(8); 809 + DMA(9); 810 + DMA(10); 811 + DMA(11); 812 + #endif 813 + #ifdef DMA12_NEXT_DESC_PTR 814 + DMA(12); 815 + DMA(13); 816 + DMA(14); 817 + DMA(15); 818 + DMA(16); 819 + DMA(17); 820 + DMA(18); 821 + DMA(19); 822 + #endif 823 + #ifdef DMA20_NEXT_DESC_PTR 824 + DMA(20); 825 + DMA(21); 826 + DMA(22); 827 + DMA(23); 828 + #endif 829 + 830 + parent = debugfs_create_dir("ebiu_amc", top); 831 + D32(EBIU_AMBCTL0); 832 + D32(EBIU_AMBCTL1); 833 + D16(EBIU_AMGCTL); 834 + #ifdef EBIU_MBSCTL 835 + D16(EBIU_MBSCTL); 836 + D32(EBIU_ARBSTAT); 837 + D32(EBIU_MODE); 838 + D16(EBIU_FCTL); 839 + #endif 840 + 841 + #ifdef EBIU_SDGCTL 842 + parent = debugfs_create_dir("ebiu_sdram", top); 843 + # ifdef __ADSPBF561__ 844 + D32(EBIU_SDBCTL); 845 + # else 846 + D16(EBIU_SDBCTL); 847 + # endif 848 + D32(EBIU_SDGCTL); 849 + D16(EBIU_SDRRC); 850 + D16(EBIU_SDSTAT); 851 + #endif 852 + 853 + #ifdef EBIU_DDRACCT 854 + parent = debugfs_create_dir("ebiu_ddr", top); 855 + D32(EBIU_DDRACCT); 856 + D32(EBIU_DDRARCT); 857 + D32(EBIU_DDRBRC0); 858 + D32(EBIU_DDRBRC1); 859 + D32(EBIU_DDRBRC2); 860 + D32(EBIU_DDRBRC3); 861 + D32(EBIU_DDRBRC4); 862 + D32(EBIU_DDRBRC5); 863 + D32(EBIU_DDRBRC6); 864 + D32(EBIU_DDRBRC7); 865 + D32(EBIU_DDRBWC0); 866 + D32(EBIU_DDRBWC1); 867 + D32(EBIU_DDRBWC2); 868 + D32(EBIU_DDRBWC3); 869 + D32(EBIU_DDRBWC4); 870 + D32(EBIU_DDRBWC5); 871 + D32(EBIU_DDRBWC6); 872 + D32(EBIU_DDRBWC7); 873 + D32(EBIU_DDRCTL0); 874 + D32(EBIU_DDRCTL1); 875 + D32(EBIU_DDRCTL2); 876 + D32(EBIU_DDRCTL3); 877 + D32(EBIU_DDRGC0); 878 + D32(EBIU_DDRGC1); 879 + D32(EBIU_DDRGC2); 880 + D32(EBIU_DDRGC3); 881 + D32(EBIU_DDRMCCL); 882 + D32(EBIU_DDRMCEN); 883 + D32(EBIU_DDRQUE); 884 + D32(EBIU_DDRTACT); 885 + D32(EBIU_ERRADD); 886 + D16(EBIU_ERRMST); 887 + D16(EBIU_RSTCTL); 888 + #endif 889 + 890 + #ifdef EMAC_ADDRHI 891 + parent = debugfs_create_dir("emac", top); 892 + D32(EMAC_ADDRHI); 893 + D32(EMAC_ADDRLO); 894 + D32(EMAC_FLC); 895 + D32(EMAC_HASHHI); 896 + D32(EMAC_HASHLO); 897 + D32(EMAC_MMC_CTL); 898 + D32(EMAC_MMC_RIRQE); 899 + D32(EMAC_MMC_RIRQS); 900 + D32(EMAC_MMC_TIRQE); 901 + D32(EMAC_MMC_TIRQS); 902 + D32(EMAC_OPMODE); 903 + D32(EMAC_RXC_ALIGN); 904 + D32(EMAC_RXC_ALLFRM); 905 + D32(EMAC_RXC_ALLOCT); 906 + D32(EMAC_RXC_BROAD); 907 + D32(EMAC_RXC_DMAOVF); 908 + D32(EMAC_RXC_EQ64); 909 + D32(EMAC_RXC_FCS); 910 + D32(EMAC_RXC_GE1024); 911 + D32(EMAC_RXC_LNERRI); 912 + D32(EMAC_RXC_LNERRO); 913 + D32(EMAC_RXC_LONG); 914 + D32(EMAC_RXC_LT1024); 915 + D32(EMAC_RXC_LT128); 916 + D32(EMAC_RXC_LT256); 917 + D32(EMAC_RXC_LT512); 918 + D32(EMAC_RXC_MACCTL); 919 + D32(EMAC_RXC_MULTI); 920 + D32(EMAC_RXC_OCTET); 921 + D32(EMAC_RXC_OK); 922 + D32(EMAC_RXC_OPCODE); 923 + D32(EMAC_RXC_PAUSE); 924 + D32(EMAC_RXC_SHORT); 925 + D32(EMAC_RXC_TYPED); 926 + D32(EMAC_RXC_UNICST); 927 + D32(EMAC_RX_IRQE); 928 + D32(EMAC_RX_STAT); 929 + D32(EMAC_RX_STKY); 930 + D32(EMAC_STAADD); 931 + D32(EMAC_STADAT); 932 + D32(EMAC_SYSCTL); 933 + D32(EMAC_SYSTAT); 934 + D32(EMAC_TXC_1COL); 935 + D32(EMAC_TXC_ABORT); 936 + D32(EMAC_TXC_ALLFRM); 937 + D32(EMAC_TXC_ALLOCT); 938 + D32(EMAC_TXC_BROAD); 939 + D32(EMAC_TXC_CRSERR); 940 + D32(EMAC_TXC_DEFER); 941 + D32(EMAC_TXC_DMAUND); 942 + D32(EMAC_TXC_EQ64); 943 + D32(EMAC_TXC_GE1024); 944 + D32(EMAC_TXC_GT1COL); 945 + D32(EMAC_TXC_LATECL); 946 + D32(EMAC_TXC_LT1024); 947 + D32(EMAC_TXC_LT128); 948 + D32(EMAC_TXC_LT256); 949 + D32(EMAC_TXC_LT512); 950 + D32(EMAC_TXC_MACCTL); 951 + D32(EMAC_TXC_MULTI); 952 + D32(EMAC_TXC_OCTET); 953 + D32(EMAC_TXC_OK); 954 + D32(EMAC_TXC_UNICST); 955 + D32(EMAC_TXC_XS_COL); 956 + D32(EMAC_TXC_XS_DFR); 957 + D32(EMAC_TX_IRQE); 958 + D32(EMAC_TX_STAT); 959 + D32(EMAC_TX_STKY); 960 + D32(EMAC_VLAN1); 961 + D32(EMAC_VLAN2); 962 + D32(EMAC_WKUP_CTL); 963 + D32(EMAC_WKUP_FFCMD); 964 + D32(EMAC_WKUP_FFCRC0); 965 + D32(EMAC_WKUP_FFCRC1); 966 + D32(EMAC_WKUP_FFMSK0); 967 + D32(EMAC_WKUP_FFMSK1); 968 + D32(EMAC_WKUP_FFMSK2); 969 + D32(EMAC_WKUP_FFMSK3); 970 + D32(EMAC_WKUP_FFOFF); 971 + # ifdef EMAC_PTP_ACCR 972 + D32(EMAC_PTP_ACCR); 973 + D32(EMAC_PTP_ADDEND); 974 + D32(EMAC_PTP_ALARMHI); 975 + D32(EMAC_PTP_ALARMLO); 976 + D16(EMAC_PTP_CTL); 977 + D32(EMAC_PTP_FOFF); 978 + D32(EMAC_PTP_FV1); 979 + D32(EMAC_PTP_FV2); 980 + D32(EMAC_PTP_FV3); 981 + D16(EMAC_PTP_ID_OFF); 982 + D32(EMAC_PTP_ID_SNAP); 983 + D16(EMAC_PTP_IE); 984 + D16(EMAC_PTP_ISTAT); 985 + D32(EMAC_PTP_OFFSET); 986 + D32(EMAC_PTP_PPS_PERIOD); 987 + D32(EMAC_PTP_PPS_STARTHI); 988 + D32(EMAC_PTP_PPS_STARTLO); 989 + D32(EMAC_PTP_RXSNAPHI); 990 + D32(EMAC_PTP_RXSNAPLO); 991 + D32(EMAC_PTP_TIMEHI); 992 + D32(EMAC_PTP_TIMELO); 993 + D32(EMAC_PTP_TXSNAPHI); 994 + D32(EMAC_PTP_TXSNAPLO); 995 + # endif 996 + #endif 997 + 998 + #if defined(EPPI0_STATUS) || defined(EPPI1_STATUS) || defined(EPPI2_STATUS) 999 + parent = debugfs_create_dir("eppi", top); 1000 + # ifdef EPPI0_STATUS 1001 + EPPI(0); 1002 + # endif 1003 + # ifdef EPPI1_STATUS 1004 + EPPI(1); 1005 + # endif 1006 + # ifdef EPPI2_STATUS 1007 + EPPI(2); 1008 + # endif 1009 + #endif 1010 + 1011 + parent = debugfs_create_dir("gptimer", top); 1012 + #ifdef TIMER_DISABLE 1013 + D16(TIMER_DISABLE); 1014 + D16(TIMER_ENABLE); 1015 + D32(TIMER_STATUS); 1016 + #endif 1017 + #ifdef TIMER_DISABLE0 1018 + D16(TIMER_DISABLE0); 1019 + D16(TIMER_ENABLE0); 1020 + D32(TIMER_STATUS0); 1021 + #endif 1022 + #ifdef TIMER_DISABLE1 1023 + D16(TIMER_DISABLE1); 1024 + D16(TIMER_ENABLE1); 1025 + D32(TIMER_STATUS1); 1026 + #endif 1027 + /* XXX: Should convert BF561 MMR names */ 1028 + #ifdef TMRS4_DISABLE 1029 + D16(TMRS4_DISABLE); 1030 + D16(TMRS4_ENABLE); 1031 + D32(TMRS4_STATUS); 1032 + D16(TMRS8_DISABLE); 1033 + D16(TMRS8_ENABLE); 1034 + D32(TMRS8_STATUS); 1035 + #endif 1036 + GPTIMER(0); 1037 + GPTIMER(1); 1038 + GPTIMER(2); 1039 + #ifdef TIMER3_CONFIG 1040 + GPTIMER(3); 1041 + GPTIMER(4); 1042 + GPTIMER(5); 1043 + GPTIMER(6); 1044 + GPTIMER(7); 1045 + #endif 1046 + #ifdef TIMER8_CONFIG 1047 + GPTIMER(8); 1048 + GPTIMER(9); 1049 + GPTIMER(10); 1050 + #endif 1051 + #ifdef TIMER11_CONFIG 1052 + GPTIMER(11); 1053 + #endif 1054 + 1055 + #ifdef HMDMA0_CONTROL 1056 + parent = debugfs_create_dir("hmdma", top); 1057 + HMDMA(0); 1058 + HMDMA(1); 1059 + #endif 1060 + 1061 + #ifdef HOST_CONTROL 1062 + parent = debugfs_create_dir("hostdp", top); 1063 + D16(HOST_CONTROL); 1064 + D16(HOST_STATUS); 1065 + D16(HOST_TIMEOUT); 1066 + #endif 1067 + 1068 + #ifdef IMDMA_S0_CONFIG 1069 + parent = debugfs_create_dir("imdma", top); 1070 + IMDMA(0); 1071 + IMDMA(1); 1072 + #endif 1073 + 1074 + #ifdef KPAD_CTL 1075 + parent = debugfs_create_dir("keypad", top); 1076 + D16(KPAD_CTL); 1077 + D16(KPAD_PRESCALE); 1078 + D16(KPAD_MSEL); 1079 + D16(KPAD_ROWCOL); 1080 + D16(KPAD_STAT); 1081 + D16(KPAD_SOFTEVAL); 1082 + #endif 1083 + 1084 + parent = debugfs_create_dir("mdma", top); 1085 + MDMA(0); 1086 + MDMA(1); 1087 + #ifdef MDMA_D2_CONFIG 1088 + MDMA(2); 1089 + MDMA(3); 1090 + #endif 1091 + 1092 + #ifdef MXVR_CONFIG 1093 + parent = debugfs_create_dir("mxvr", top); 1094 + D16(MXVR_CONFIG); 1095 + # ifdef MXVR_PLL_CTL_0 1096 + D32(MXVR_PLL_CTL_0); 1097 + # endif 1098 + D32(MXVR_STATE_0); 1099 + D32(MXVR_STATE_1); 1100 + D32(MXVR_INT_STAT_0); 1101 + D32(MXVR_INT_STAT_1); 1102 + D32(MXVR_INT_EN_0); 1103 + D32(MXVR_INT_EN_1); 1104 + D16(MXVR_POSITION); 1105 + D16(MXVR_MAX_POSITION); 1106 + D16(MXVR_DELAY); 1107 + D16(MXVR_MAX_DELAY); 1108 + D32(MXVR_LADDR); 1109 + D16(MXVR_GADDR); 1110 + D32(MXVR_AADDR); 1111 + D32(MXVR_ALLOC_0); 1112 + D32(MXVR_ALLOC_1); 1113 + D32(MXVR_ALLOC_2); 1114 + D32(MXVR_ALLOC_3); 1115 + D32(MXVR_ALLOC_4); 1116 + D32(MXVR_ALLOC_5); 1117 + D32(MXVR_ALLOC_6); 1118 + D32(MXVR_ALLOC_7); 1119 + D32(MXVR_ALLOC_8); 1120 + D32(MXVR_ALLOC_9); 1121 + D32(MXVR_ALLOC_10); 1122 + D32(MXVR_ALLOC_11); 1123 + D32(MXVR_ALLOC_12); 1124 + D32(MXVR_ALLOC_13); 1125 + D32(MXVR_ALLOC_14); 1126 + D32(MXVR_SYNC_LCHAN_0); 1127 + D32(MXVR_SYNC_LCHAN_1); 1128 + D32(MXVR_SYNC_LCHAN_2); 1129 + D32(MXVR_SYNC_LCHAN_3); 1130 + D32(MXVR_SYNC_LCHAN_4); 1131 + D32(MXVR_SYNC_LCHAN_5); 1132 + D32(MXVR_SYNC_LCHAN_6); 1133 + D32(MXVR_SYNC_LCHAN_7); 1134 + D32(MXVR_DMA0_CONFIG); 1135 + D32(MXVR_DMA0_START_ADDR); 1136 + D16(MXVR_DMA0_COUNT); 1137 + D32(MXVR_DMA0_CURR_ADDR); 1138 + D16(MXVR_DMA0_CURR_COUNT); 1139 + D32(MXVR_DMA1_CONFIG); 1140 + D32(MXVR_DMA1_START_ADDR); 1141 + D16(MXVR_DMA1_COUNT); 1142 + D32(MXVR_DMA1_CURR_ADDR); 1143 + D16(MXVR_DMA1_CURR_COUNT); 1144 + D32(MXVR_DMA2_CONFIG); 1145 + D32(MXVR_DMA2_START_ADDR); 1146 + D16(MXVR_DMA2_COUNT); 1147 + D32(MXVR_DMA2_CURR_ADDR); 1148 + D16(MXVR_DMA2_CURR_COUNT); 1149 + D32(MXVR_DMA3_CONFIG); 1150 + D32(MXVR_DMA3_START_ADDR); 1151 + D16(MXVR_DMA3_COUNT); 1152 + D32(MXVR_DMA3_CURR_ADDR); 1153 + D16(MXVR_DMA3_CURR_COUNT); 1154 + D32(MXVR_DMA4_CONFIG); 1155 + D32(MXVR_DMA4_START_ADDR); 1156 + D16(MXVR_DMA4_COUNT); 1157 + D32(MXVR_DMA4_CURR_ADDR); 1158 + D16(MXVR_DMA4_CURR_COUNT); 1159 + D32(MXVR_DMA5_CONFIG); 1160 + D32(MXVR_DMA5_START_ADDR); 1161 + D16(MXVR_DMA5_COUNT); 1162 + D32(MXVR_DMA5_CURR_ADDR); 1163 + D16(MXVR_DMA5_CURR_COUNT); 1164 + D32(MXVR_DMA6_CONFIG); 1165 + D32(MXVR_DMA6_START_ADDR); 1166 + D16(MXVR_DMA6_COUNT); 1167 + D32(MXVR_DMA6_CURR_ADDR); 1168 + D16(MXVR_DMA6_CURR_COUNT); 1169 + D32(MXVR_DMA7_CONFIG); 1170 + D32(MXVR_DMA7_START_ADDR); 1171 + D16(MXVR_DMA7_COUNT); 1172 + D32(MXVR_DMA7_CURR_ADDR); 1173 + D16(MXVR_DMA7_CURR_COUNT); 1174 + D16(MXVR_AP_CTL); 1175 + D32(MXVR_APRB_START_ADDR); 1176 + D32(MXVR_APRB_CURR_ADDR); 1177 + D32(MXVR_APTB_START_ADDR); 1178 + D32(MXVR_APTB_CURR_ADDR); 1179 + D32(MXVR_CM_CTL); 1180 + D32(MXVR_CMRB_START_ADDR); 1181 + D32(MXVR_CMRB_CURR_ADDR); 1182 + D32(MXVR_CMTB_START_ADDR); 1183 + D32(MXVR_CMTB_CURR_ADDR); 1184 + D32(MXVR_RRDB_START_ADDR); 1185 + D32(MXVR_RRDB_CURR_ADDR); 1186 + D32(MXVR_PAT_DATA_0); 1187 + D32(MXVR_PAT_EN_0); 1188 + D32(MXVR_PAT_DATA_1); 1189 + D32(MXVR_PAT_EN_1); 1190 + D16(MXVR_FRAME_CNT_0); 1191 + D16(MXVR_FRAME_CNT_1); 1192 + D32(MXVR_ROUTING_0); 1193 + D32(MXVR_ROUTING_1); 1194 + D32(MXVR_ROUTING_2); 1195 + D32(MXVR_ROUTING_3); 1196 + D32(MXVR_ROUTING_4); 1197 + D32(MXVR_ROUTING_5); 1198 + D32(MXVR_ROUTING_6); 1199 + D32(MXVR_ROUTING_7); 1200 + D32(MXVR_ROUTING_8); 1201 + D32(MXVR_ROUTING_9); 1202 + D32(MXVR_ROUTING_10); 1203 + D32(MXVR_ROUTING_11); 1204 + D32(MXVR_ROUTING_12); 1205 + D32(MXVR_ROUTING_13); 1206 + D32(MXVR_ROUTING_14); 1207 + # ifdef MXVR_PLL_CTL_1 1208 + D32(MXVR_PLL_CTL_1); 1209 + # endif 1210 + D16(MXVR_BLOCK_CNT); 1211 + # ifdef MXVR_CLK_CTL 1212 + D32(MXVR_CLK_CTL); 1213 + # endif 1214 + # ifdef MXVR_CDRPLL_CTL 1215 + D32(MXVR_CDRPLL_CTL); 1216 + # endif 1217 + # ifdef MXVR_FMPLL_CTL 1218 + D32(MXVR_FMPLL_CTL); 1219 + # endif 1220 + # ifdef MXVR_PIN_CTL 1221 + D16(MXVR_PIN_CTL); 1222 + # endif 1223 + # ifdef MXVR_SCLK_CNT 1224 + D16(MXVR_SCLK_CNT); 1225 + # endif 1226 + #endif 1227 + 1228 + #ifdef NFC_ADDR 1229 + parent = debugfs_create_dir("nfc", top); 1230 + D_WO(NFC_ADDR, 16); 1231 + D_WO(NFC_CMD, 16); 1232 + D_RO(NFC_COUNT, 16); 1233 + D16(NFC_CTL); 1234 + D_WO(NFC_DATA_RD, 16); 1235 + D_WO(NFC_DATA_WR, 16); 1236 + D_RO(NFC_ECC0, 16); 1237 + D_RO(NFC_ECC1, 16); 1238 + D_RO(NFC_ECC2, 16); 1239 + D_RO(NFC_ECC3, 16); 1240 + D16(NFC_IRQMASK); 1241 + D16(NFC_IRQSTAT); 1242 + D_WO(NFC_PGCTL, 16); 1243 + D_RO(NFC_READ, 16); 1244 + D16(NFC_RST); 1245 + D_RO(NFC_STAT, 16); 1246 + #endif 1247 + 1248 + #ifdef OTP_CONTROL 1249 + parent = debugfs_create_dir("otp", top); 1250 + D16(OTP_CONTROL); 1251 + D16(OTP_BEN); 1252 + D16(OTP_STATUS); 1253 + D32(OTP_TIMING); 1254 + D32(OTP_DATA0); 1255 + D32(OTP_DATA1); 1256 + D32(OTP_DATA2); 1257 + D32(OTP_DATA3); 1258 + #endif 1259 + 1260 + #ifdef PIXC_CTL 1261 + parent = debugfs_create_dir("pixc", top); 1262 + D16(PIXC_CTL); 1263 + D16(PIXC_PPL); 1264 + D16(PIXC_LPF); 1265 + D16(PIXC_AHSTART); 1266 + D16(PIXC_AHEND); 1267 + D16(PIXC_AVSTART); 1268 + D16(PIXC_AVEND); 1269 + D16(PIXC_ATRANSP); 1270 + D16(PIXC_BHSTART); 1271 + D16(PIXC_BHEND); 1272 + D16(PIXC_BVSTART); 1273 + D16(PIXC_BVEND); 1274 + D16(PIXC_BTRANSP); 1275 + D16(PIXC_INTRSTAT); 1276 + D32(PIXC_RYCON); 1277 + D32(PIXC_GUCON); 1278 + D32(PIXC_BVCON); 1279 + D32(PIXC_CCBIAS); 1280 + D32(PIXC_TC); 1281 + #endif 1282 + 1283 + parent = debugfs_create_dir("pll", top); 1284 + D16(PLL_CTL); 1285 + D16(PLL_DIV); 1286 + D16(PLL_LOCKCNT); 1287 + D16(PLL_STAT); 1288 + D16(VR_CTL); 1289 + D32(CHIPID); /* it's part of this hardware block */ 1290 + 1291 + #if defined(PPI_STATUS) || defined(PPI0_STATUS) || defined(PPI1_STATUS) 1292 + parent = debugfs_create_dir("ppi", top); 1293 + # ifdef PPI_STATUS 1294 + bfin_debug_mmrs_ppi(parent, PPI_STATUS, -1); 1295 + # endif 1296 + # ifdef PPI0_STATUS 1297 + PPI(0); 1298 + # endif 1299 + # ifdef PPI1_STATUS 1300 + PPI(1); 1301 + # endif 1302 + #endif 1303 + 1304 + #ifdef PWM_CTRL 1305 + parent = debugfs_create_dir("pwm", top); 1306 + D16(PWM_CTRL); 1307 + D16(PWM_STAT); 1308 + D16(PWM_TM); 1309 + D16(PWM_DT); 1310 + D16(PWM_GATE); 1311 + D16(PWM_CHA); 1312 + D16(PWM_CHB); 1313 + D16(PWM_CHC); 1314 + D16(PWM_SEG); 1315 + D16(PWM_SYNCWT); 1316 + D16(PWM_CHAL); 1317 + D16(PWM_CHBL); 1318 + D16(PWM_CHCL); 1319 + D16(PWM_LSI); 1320 + D16(PWM_STAT2); 1321 + #endif 1322 + 1323 + #ifdef RSI_CONFIG 1324 + parent = debugfs_create_dir("rsi", top); 1325 + D32(RSI_ARGUMENT); 1326 + D16(RSI_CEATA_CONTROL); 1327 + D16(RSI_CLK_CONTROL); 1328 + D16(RSI_COMMAND); 1329 + D16(RSI_CONFIG); 1330 + D16(RSI_DATA_CNT); 1331 + D16(RSI_DATA_CONTROL); 1332 + D16(RSI_DATA_LGTH); 1333 + D32(RSI_DATA_TIMER); 1334 + D16(RSI_EMASK); 1335 + D16(RSI_ESTAT); 1336 + D32(RSI_FIFO); 1337 + D16(RSI_FIFO_CNT); 1338 + D32(RSI_MASK0); 1339 + D32(RSI_MASK1); 1340 + D16(RSI_PID0); 1341 + D16(RSI_PID1); 1342 + D16(RSI_PID2); 1343 + D16(RSI_PID3); 1344 + D16(RSI_PWR_CONTROL); 1345 + D16(RSI_RD_WAIT_EN); 1346 + D32(RSI_RESPONSE0); 1347 + D32(RSI_RESPONSE1); 1348 + D32(RSI_RESPONSE2); 1349 + D32(RSI_RESPONSE3); 1350 + D16(RSI_RESP_CMD); 1351 + D32(RSI_STATUS); 1352 + D_WO(RSI_STATUSCL, 16); 1353 + #endif 1354 + 1355 + #ifdef RTC_ALARM 1356 + parent = debugfs_create_dir("rtc", top); 1357 + D32(RTC_ALARM); 1358 + D16(RTC_ICTL); 1359 + D16(RTC_ISTAT); 1360 + D16(RTC_PREN); 1361 + D32(RTC_STAT); 1362 + D16(RTC_SWCNT); 1363 + #endif 1364 + 1365 + #ifdef SDH_CFG 1366 + parent = debugfs_create_dir("sdh", top); 1367 + D32(SDH_ARGUMENT); 1368 + D16(SDH_CFG); 1369 + D16(SDH_CLK_CTL); 1370 + D16(SDH_COMMAND); 1371 + D_RO(SDH_DATA_CNT, 16); 1372 + D16(SDH_DATA_CTL); 1373 + D16(SDH_DATA_LGTH); 1374 + D32(SDH_DATA_TIMER); 1375 + D16(SDH_E_MASK); 1376 + D16(SDH_E_STATUS); 1377 + D32(SDH_FIFO); 1378 + D_RO(SDH_FIFO_CNT, 16); 1379 + D32(SDH_MASK0); 1380 + D32(SDH_MASK1); 1381 + D_RO(SDH_PID0, 16); 1382 + D_RO(SDH_PID1, 16); 1383 + D_RO(SDH_PID2, 16); 1384 + D_RO(SDH_PID3, 16); 1385 + D_RO(SDH_PID4, 16); 1386 + D_RO(SDH_PID5, 16); 1387 + D_RO(SDH_PID6, 16); 1388 + D_RO(SDH_PID7, 16); 1389 + D16(SDH_PWR_CTL); 1390 + D16(SDH_RD_WAIT_EN); 1391 + D_RO(SDH_RESPONSE0, 32); 1392 + D_RO(SDH_RESPONSE1, 32); 1393 + D_RO(SDH_RESPONSE2, 32); 1394 + D_RO(SDH_RESPONSE3, 32); 1395 + D_RO(SDH_RESP_CMD, 16); 1396 + D_RO(SDH_STATUS, 32); 1397 + D_WO(SDH_STATUS_CLR, 16); 1398 + #endif 1399 + 1400 + #ifdef SECURE_CONTROL 1401 + parent = debugfs_create_dir("security", top); 1402 + D16(SECURE_CONTROL); 1403 + D16(SECURE_STATUS); 1404 + D32(SECURE_SYSSWT); 1405 + #endif 1406 + 1407 + parent = debugfs_create_dir("sic", top); 1408 + D16(SWRST); 1409 + D16(SYSCR); 1410 + D16(SIC_RVECT); 1411 + D32(SIC_IAR0); 1412 + D32(SIC_IAR1); 1413 + D32(SIC_IAR2); 1414 + #ifdef SIC_IAR3 1415 + D32(SIC_IAR3); 1416 + #endif 1417 + #ifdef SIC_IAR4 1418 + D32(SIC_IAR4); 1419 + D32(SIC_IAR5); 1420 + D32(SIC_IAR6); 1421 + #endif 1422 + #ifdef SIC_IAR7 1423 + D32(SIC_IAR7); 1424 + #endif 1425 + #ifdef SIC_IAR8 1426 + D32(SIC_IAR8); 1427 + D32(SIC_IAR9); 1428 + D32(SIC_IAR10); 1429 + D32(SIC_IAR11); 1430 + #endif 1431 + #ifdef SIC_IMASK 1432 + D32(SIC_IMASK); 1433 + D32(SIC_ISR); 1434 + D32(SIC_IWR); 1435 + #endif 1436 + #ifdef SIC_IMASK0 1437 + D32(SIC_IMASK0); 1438 + D32(SIC_IMASK1); 1439 + D32(SIC_ISR0); 1440 + D32(SIC_ISR1); 1441 + D32(SIC_IWR0); 1442 + D32(SIC_IWR1); 1443 + #endif 1444 + #ifdef SIC_IMASK2 1445 + D32(SIC_IMASK2); 1446 + D32(SIC_ISR2); 1447 + D32(SIC_IWR2); 1448 + #endif 1449 + #ifdef SICB_RVECT 1450 + D16(SICB_SWRST); 1451 + D16(SICB_SYSCR); 1452 + D16(SICB_RVECT); 1453 + D32(SICB_IAR0); 1454 + D32(SICB_IAR1); 1455 + D32(SICB_IAR2); 1456 + D32(SICB_IAR3); 1457 + D32(SICB_IAR4); 1458 + D32(SICB_IAR5); 1459 + D32(SICB_IAR6); 1460 + D32(SICB_IAR7); 1461 + D32(SICB_IMASK0); 1462 + D32(SICB_IMASK1); 1463 + D32(SICB_ISR0); 1464 + D32(SICB_ISR1); 1465 + D32(SICB_IWR0); 1466 + D32(SICB_IWR1); 1467 + #endif 1468 + 1469 + parent = debugfs_create_dir("spi", top); 1470 + #ifdef SPI0_REGBASE 1471 + SPI(0); 1472 + #endif 1473 + #ifdef SPI1_REGBASE 1474 + SPI(1); 1475 + #endif 1476 + #ifdef SPI2_REGBASE 1477 + SPI(2); 1478 + #endif 1479 + 1480 + parent = debugfs_create_dir("sport", top); 1481 + #ifdef SPORT0_STAT 1482 + SPORT(0); 1483 + #endif 1484 + #ifdef SPORT1_STAT 1485 + SPORT(1); 1486 + #endif 1487 + #ifdef SPORT2_STAT 1488 + SPORT(2); 1489 + #endif 1490 + #ifdef SPORT3_STAT 1491 + SPORT(3); 1492 + #endif 1493 + 1494 + #if defined(TWI_CLKDIV) || defined(TWI0_CLKDIV) || defined(TWI1_CLKDIV) 1495 + parent = debugfs_create_dir("twi", top); 1496 + # ifdef TWI_CLKDIV 1497 + bfin_debug_mmrs_twi(parent, TWI_CLKDIV, -1); 1498 + # endif 1499 + # ifdef TWI0_CLKDIV 1500 + TWI(0); 1501 + # endif 1502 + # ifdef TWI1_CLKDIV 1503 + TWI(1); 1504 + # endif 1505 + #endif 1506 + 1507 + parent = debugfs_create_dir("uart", top); 1508 + #ifdef BFIN_UART_DLL 1509 + bfin_debug_mmrs_uart(parent, BFIN_UART_DLL, -1); 1510 + #endif 1511 + #ifdef UART0_DLL 1512 + UART(0); 1513 + #endif 1514 + #ifdef UART1_DLL 1515 + UART(1); 1516 + #endif 1517 + #ifdef UART2_DLL 1518 + UART(2); 1519 + #endif 1520 + #ifdef UART3_DLL 1521 + UART(3); 1522 + #endif 1523 + 1524 + #ifdef USB_FADDR 1525 + parent = debugfs_create_dir("usb", top); 1526 + D16(USB_FADDR); 1527 + D16(USB_POWER); 1528 + D16(USB_INTRTX); 1529 + D16(USB_INTRRX); 1530 + D16(USB_INTRTXE); 1531 + D16(USB_INTRRXE); 1532 + D16(USB_INTRUSB); 1533 + D16(USB_INTRUSBE); 1534 + D16(USB_FRAME); 1535 + D16(USB_INDEX); 1536 + D16(USB_TESTMODE); 1537 + D16(USB_GLOBINTR); 1538 + D16(USB_GLOBAL_CTL); 1539 + D16(USB_TX_MAX_PACKET); 1540 + D16(USB_CSR0); 1541 + D16(USB_TXCSR); 1542 + D16(USB_RX_MAX_PACKET); 1543 + D16(USB_RXCSR); 1544 + D16(USB_COUNT0); 1545 + D16(USB_RXCOUNT); 1546 + D16(USB_TXTYPE); 1547 + D16(USB_NAKLIMIT0); 1548 + D16(USB_TXINTERVAL); 1549 + D16(USB_RXTYPE); 1550 + D16(USB_RXINTERVAL); 1551 + D16(USB_TXCOUNT); 1552 + D16(USB_EP0_FIFO); 1553 + D16(USB_EP1_FIFO); 1554 + D16(USB_EP2_FIFO); 1555 + D16(USB_EP3_FIFO); 1556 + D16(USB_EP4_FIFO); 1557 + D16(USB_EP5_FIFO); 1558 + D16(USB_EP6_FIFO); 1559 + D16(USB_EP7_FIFO); 1560 + D16(USB_OTG_DEV_CTL); 1561 + D16(USB_OTG_VBUS_IRQ); 1562 + D16(USB_OTG_VBUS_MASK); 1563 + D16(USB_LINKINFO); 1564 + D16(USB_VPLEN); 1565 + D16(USB_HS_EOF1); 1566 + D16(USB_FS_EOF1); 1567 + D16(USB_LS_EOF1); 1568 + D16(USB_APHY_CNTRL); 1569 + D16(USB_APHY_CALIB); 1570 + D16(USB_APHY_CNTRL2); 1571 + D16(USB_PHY_TEST); 1572 + D16(USB_PLLOSC_CTRL); 1573 + D16(USB_SRP_CLKDIV); 1574 + D16(USB_EP_NI0_TXMAXP); 1575 + D16(USB_EP_NI0_TXCSR); 1576 + D16(USB_EP_NI0_RXMAXP); 1577 + D16(USB_EP_NI0_RXCSR); 1578 + D16(USB_EP_NI0_RXCOUNT); 1579 + D16(USB_EP_NI0_TXTYPE); 1580 + D16(USB_EP_NI0_TXINTERVAL); 1581 + D16(USB_EP_NI0_RXTYPE); 1582 + D16(USB_EP_NI0_RXINTERVAL); 1583 + D16(USB_EP_NI0_TXCOUNT); 1584 + D16(USB_EP_NI1_TXMAXP); 1585 + D16(USB_EP_NI1_TXCSR); 1586 + D16(USB_EP_NI1_RXMAXP); 1587 + D16(USB_EP_NI1_RXCSR); 1588 + D16(USB_EP_NI1_RXCOUNT); 1589 + D16(USB_EP_NI1_TXTYPE); 1590 + D16(USB_EP_NI1_TXINTERVAL); 1591 + D16(USB_EP_NI1_RXTYPE); 1592 + D16(USB_EP_NI1_RXINTERVAL); 1593 + D16(USB_EP_NI1_TXCOUNT); 1594 + D16(USB_EP_NI2_TXMAXP); 1595 + D16(USB_EP_NI2_TXCSR); 1596 + D16(USB_EP_NI2_RXMAXP); 1597 + D16(USB_EP_NI2_RXCSR); 1598 + D16(USB_EP_NI2_RXCOUNT); 1599 + D16(USB_EP_NI2_TXTYPE); 1600 + D16(USB_EP_NI2_TXINTERVAL); 1601 + D16(USB_EP_NI2_RXTYPE); 1602 + D16(USB_EP_NI2_RXINTERVAL); 1603 + D16(USB_EP_NI2_TXCOUNT); 1604 + D16(USB_EP_NI3_TXMAXP); 1605 + D16(USB_EP_NI3_TXCSR); 1606 + D16(USB_EP_NI3_RXMAXP); 1607 + D16(USB_EP_NI3_RXCSR); 1608 + D16(USB_EP_NI3_RXCOUNT); 1609 + D16(USB_EP_NI3_TXTYPE); 1610 + D16(USB_EP_NI3_TXINTERVAL); 1611 + D16(USB_EP_NI3_RXTYPE); 1612 + D16(USB_EP_NI3_RXINTERVAL); 1613 + D16(USB_EP_NI3_TXCOUNT); 1614 + D16(USB_EP_NI4_TXMAXP); 1615 + D16(USB_EP_NI4_TXCSR); 1616 + D16(USB_EP_NI4_RXMAXP); 1617 + D16(USB_EP_NI4_RXCSR); 1618 + D16(USB_EP_NI4_RXCOUNT); 1619 + D16(USB_EP_NI4_TXTYPE); 1620 + D16(USB_EP_NI4_TXINTERVAL); 1621 + D16(USB_EP_NI4_RXTYPE); 1622 + D16(USB_EP_NI4_RXINTERVAL); 1623 + D16(USB_EP_NI4_TXCOUNT); 1624 + D16(USB_EP_NI5_TXMAXP); 1625 + D16(USB_EP_NI5_TXCSR); 1626 + D16(USB_EP_NI5_RXMAXP); 1627 + D16(USB_EP_NI5_RXCSR); 1628 + D16(USB_EP_NI5_RXCOUNT); 1629 + D16(USB_EP_NI5_TXTYPE); 1630 + D16(USB_EP_NI5_TXINTERVAL); 1631 + D16(USB_EP_NI5_RXTYPE); 1632 + D16(USB_EP_NI5_RXINTERVAL); 1633 + D16(USB_EP_NI5_TXCOUNT); 1634 + D16(USB_EP_NI6_TXMAXP); 1635 + D16(USB_EP_NI6_TXCSR); 1636 + D16(USB_EP_NI6_RXMAXP); 1637 + D16(USB_EP_NI6_RXCSR); 1638 + D16(USB_EP_NI6_RXCOUNT); 1639 + D16(USB_EP_NI6_TXTYPE); 1640 + D16(USB_EP_NI6_TXINTERVAL); 1641 + D16(USB_EP_NI6_RXTYPE); 1642 + D16(USB_EP_NI6_RXINTERVAL); 1643 + D16(USB_EP_NI6_TXCOUNT); 1644 + D16(USB_EP_NI7_TXMAXP); 1645 + D16(USB_EP_NI7_TXCSR); 1646 + D16(USB_EP_NI7_RXMAXP); 1647 + D16(USB_EP_NI7_RXCSR); 1648 + D16(USB_EP_NI7_RXCOUNT); 1649 + D16(USB_EP_NI7_TXTYPE); 1650 + D16(USB_EP_NI7_TXINTERVAL); 1651 + D16(USB_EP_NI7_RXTYPE); 1652 + D16(USB_EP_NI7_RXINTERVAL); 1653 + D16(USB_EP_NI7_TXCOUNT); 1654 + D16(USB_DMA_INTERRUPT); 1655 + D16(USB_DMA0CONTROL); 1656 + D16(USB_DMA0ADDRLOW); 1657 + D16(USB_DMA0ADDRHIGH); 1658 + D16(USB_DMA0COUNTLOW); 1659 + D16(USB_DMA0COUNTHIGH); 1660 + D16(USB_DMA1CONTROL); 1661 + D16(USB_DMA1ADDRLOW); 1662 + D16(USB_DMA1ADDRHIGH); 1663 + D16(USB_DMA1COUNTLOW); 1664 + D16(USB_DMA1COUNTHIGH); 1665 + D16(USB_DMA2CONTROL); 1666 + D16(USB_DMA2ADDRLOW); 1667 + D16(USB_DMA2ADDRHIGH); 1668 + D16(USB_DMA2COUNTLOW); 1669 + D16(USB_DMA2COUNTHIGH); 1670 + D16(USB_DMA3CONTROL); 1671 + D16(USB_DMA3ADDRLOW); 1672 + D16(USB_DMA3ADDRHIGH); 1673 + D16(USB_DMA3COUNTLOW); 1674 + D16(USB_DMA3COUNTHIGH); 1675 + D16(USB_DMA4CONTROL); 1676 + D16(USB_DMA4ADDRLOW); 1677 + D16(USB_DMA4ADDRHIGH); 1678 + D16(USB_DMA4COUNTLOW); 1679 + D16(USB_DMA4COUNTHIGH); 1680 + D16(USB_DMA5CONTROL); 1681 + D16(USB_DMA5ADDRLOW); 1682 + D16(USB_DMA5ADDRHIGH); 1683 + D16(USB_DMA5COUNTLOW); 1684 + D16(USB_DMA5COUNTHIGH); 1685 + D16(USB_DMA6CONTROL); 1686 + D16(USB_DMA6ADDRLOW); 1687 + D16(USB_DMA6ADDRHIGH); 1688 + D16(USB_DMA6COUNTLOW); 1689 + D16(USB_DMA6COUNTHIGH); 1690 + D16(USB_DMA7CONTROL); 1691 + D16(USB_DMA7ADDRLOW); 1692 + D16(USB_DMA7ADDRHIGH); 1693 + D16(USB_DMA7COUNTLOW); 1694 + D16(USB_DMA7COUNTHIGH); 1695 + #endif 1696 + 1697 + #ifdef WDOG_CNT 1698 + parent = debugfs_create_dir("watchdog", top); 1699 + D32(WDOG_CNT); 1700 + D16(WDOG_CTL); 1701 + D32(WDOG_STAT); 1702 + #endif 1703 + #ifdef WDOGA_CNT 1704 + parent = debugfs_create_dir("watchdog", top); 1705 + D32(WDOGA_CNT); 1706 + D16(WDOGA_CTL); 1707 + D32(WDOGA_STAT); 1708 + D32(WDOGB_CNT); 1709 + D16(WDOGB_CTL); 1710 + D32(WDOGB_STAT); 1711 + #endif 1712 + 1713 + /* BF533 glue */ 1714 + #ifdef FIO_FLAG_D 1715 + #define PORTFIO FIO_FLAG_D 1716 + #endif 1717 + /* BF561 glue */ 1718 + #ifdef FIO0_FLAG_D 1719 + #define PORTFIO FIO0_FLAG_D 1720 + #endif 1721 + #ifdef FIO1_FLAG_D 1722 + #define PORTGIO FIO1_FLAG_D 1723 + #endif 1724 + #ifdef FIO2_FLAG_D 1725 + #define PORTHIO FIO2_FLAG_D 1726 + #endif 1727 + parent = debugfs_create_dir("port", top); 1728 + #ifdef PORTFIO 1729 + PORT(PORTFIO, 'F'); 1730 + #endif 1731 + #ifdef PORTGIO 1732 + PORT(PORTGIO, 'G'); 1733 + #endif 1734 + #ifdef PORTHIO 1735 + PORT(PORTHIO, 'H'); 1736 + #endif 1737 + 1738 + #ifdef __ADSPBF51x__ 1739 + D16(PORTF_FER); 1740 + D16(PORTF_DRIVE); 1741 + D16(PORTF_HYSTERESIS); 1742 + D16(PORTF_MUX); 1743 + 1744 + D16(PORTG_FER); 1745 + D16(PORTG_DRIVE); 1746 + D16(PORTG_HYSTERESIS); 1747 + D16(PORTG_MUX); 1748 + 1749 + D16(PORTH_FER); 1750 + D16(PORTH_DRIVE); 1751 + D16(PORTH_HYSTERESIS); 1752 + D16(PORTH_MUX); 1753 + 1754 + D16(MISCPORT_DRIVE); 1755 + D16(MISCPORT_HYSTERESIS); 1756 + #endif /* BF51x */ 1757 + 1758 + #ifdef __ADSPBF52x__ 1759 + D16(PORTF_FER); 1760 + D16(PORTF_DRIVE); 1761 + D16(PORTF_HYSTERESIS); 1762 + D16(PORTF_MUX); 1763 + D16(PORTF_SLEW); 1764 + 1765 + D16(PORTG_FER); 1766 + D16(PORTG_DRIVE); 1767 + D16(PORTG_HYSTERESIS); 1768 + D16(PORTG_MUX); 1769 + D16(PORTG_SLEW); 1770 + 1771 + D16(PORTH_FER); 1772 + D16(PORTH_DRIVE); 1773 + D16(PORTH_HYSTERESIS); 1774 + D16(PORTH_MUX); 1775 + D16(PORTH_SLEW); 1776 + 1777 + D16(MISCPORT_DRIVE); 1778 + D16(MISCPORT_HYSTERESIS); 1779 + D16(MISCPORT_SLEW); 1780 + #endif /* BF52x */ 1781 + 1782 + #ifdef BF537_FAMILY 1783 + D16(PORTF_FER); 1784 + D16(PORTG_FER); 1785 + D16(PORTH_FER); 1786 + D16(PORT_MUX); 1787 + #endif /* BF534 BF536 BF537 */ 1788 + 1789 + #ifdef BF538_FAMILY 1790 + D16(PORTCIO_FER); 1791 + D16(PORTCIO); 1792 + D16(PORTCIO_CLEAR); 1793 + D16(PORTCIO_SET); 1794 + D16(PORTCIO_TOGGLE); 1795 + D16(PORTCIO_DIR); 1796 + D16(PORTCIO_INEN); 1797 + 1798 + D16(PORTDIO); 1799 + D16(PORTDIO_CLEAR); 1800 + D16(PORTDIO_DIR); 1801 + D16(PORTDIO_FER); 1802 + D16(PORTDIO_INEN); 1803 + D16(PORTDIO_SET); 1804 + D16(PORTDIO_TOGGLE); 1805 + 1806 + D16(PORTEIO); 1807 + D16(PORTEIO_CLEAR); 1808 + D16(PORTEIO_DIR); 1809 + D16(PORTEIO_FER); 1810 + D16(PORTEIO_INEN); 1811 + D16(PORTEIO_SET); 1812 + D16(PORTEIO_TOGGLE); 1813 + #endif /* BF538 BF539 */ 1814 + 1815 + #ifdef __ADSPBF54x__ 1816 + { 1817 + int num; 1818 + unsigned long base; 1819 + char *_buf, buf[32]; 1820 + 1821 + base = PORTA_FER; 1822 + for (num = 0; num < 10; ++num) { 1823 + PORT(base, num); 1824 + base += sizeof(struct bfin_gpio_regs); 1825 + } 1826 + 1827 + #define __PINT(uname, lname) __REGS(pint, #uname, lname) 1828 + parent = debugfs_create_dir("pint", top); 1829 + base = PINT0_MASK_SET; 1830 + for (num = 0; num < 4; ++num) { 1831 + _buf = REGS_STR_PFX(buf, PINT, num); 1832 + __PINT(MASK_SET, mask_set); 1833 + __PINT(MASK_CLEAR, mask_clear); 1834 + __PINT(IRQ, irq); 1835 + __PINT(ASSIGN, assign); 1836 + __PINT(EDGE_SET, edge_set); 1837 + __PINT(EDGE_CLEAR, edge_clear); 1838 + __PINT(INVERT_SET, invert_set); 1839 + __PINT(INVERT_CLEAR, invert_clear); 1840 + __PINT(PINSTATE, pinstate); 1841 + __PINT(LATCH, latch); 1842 + base += sizeof(struct bfin_pint_regs); 1843 + } 1844 + 1845 + } 1846 + #endif /* BF54x */ 1847 + 1848 + debug_mmrs_dentry = top; 1849 + 1850 + return 0; 1851 + } 1852 + module_init(bfin_debug_mmrs_init); 1853 + 1854 + static void __exit bfin_debug_mmrs_exit(void) 1855 + { 1856 + debugfs_remove_recursive(debug_mmrs_dentry); 1857 + } 1858 + module_exit(bfin_debug_mmrs_exit); 1859 + 1860 + MODULE_LICENSE("GPL");
+1
arch/blackfin/kernel/ipipe.c
··· 33 33 #include <linux/io.h> 34 34 #include <asm/system.h> 35 35 #include <asm/atomic.h> 36 + #include <asm/irq_handler.h> 36 37 37 38 DEFINE_PER_CPU(struct pt_regs, __ipipe_tick_regs); 38 39
+1
arch/blackfin/kernel/irqchip.c
··· 11 11 #include <linux/kallsyms.h> 12 12 #include <linux/interrupt.h> 13 13 #include <linux/irq.h> 14 + #include <asm/irq_handler.h> 14 15 #include <asm/trace.h> 15 16 #include <asm/pda.h> 16 17
+4 -4
arch/blackfin/kernel/nmi.c
··· 145 145 { 146 146 unsigned int this_cpu = smp_processor_id(); 147 147 unsigned int cpu; 148 + cpumask_t mask; 148 149 149 - cpumask_t mask = cpu_online_map; 150 - 150 + cpumask_copy(&mask, cpu_online_mask); 151 151 if (!atomic_read(&nmi_touched[this_cpu])) 152 152 return 0; 153 153 154 154 atomic_set(&nmi_touched[this_cpu], 0); 155 155 156 - cpu_clear(this_cpu, mask); 157 - for_each_cpu_mask(cpu, mask) { 156 + cpumask_clear_cpu(this_cpu, &mask); 157 + for_each_cpu(cpu, &mask) { 158 158 invalidate_dcache_range((unsigned long)(&nmi_touched[cpu]), 159 159 (unsigned long)(&nmi_touched[cpu])); 160 160 if (!atomic_read(&nmi_touched[cpu]))
+498
arch/blackfin/kernel/perf_event.c
··· 1 + /* 2 + * Blackfin performance counters 3 + * 4 + * Copyright 2011 Analog Devices Inc. 5 + * 6 + * Ripped from SuperH version: 7 + * 8 + * Copyright (C) 2009 Paul Mundt 9 + * 10 + * Heavily based on the x86 and PowerPC implementations. 11 + * 12 + * x86: 13 + * Copyright (C) 2008 Thomas Gleixner <tglx@linutronix.de> 14 + * Copyright (C) 2008-2009 Red Hat, Inc., Ingo Molnar 15 + * Copyright (C) 2009 Jaswinder Singh Rajput 16 + * Copyright (C) 2009 Advanced Micro Devices, Inc., Robert Richter 17 + * Copyright (C) 2008-2009 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com> 18 + * Copyright (C) 2009 Intel Corporation, <markus.t.metzger@intel.com> 19 + * 20 + * ppc: 21 + * Copyright 2008-2009 Paul Mackerras, IBM Corporation. 22 + * 23 + * Licensed under the GPL-2 or later. 24 + */ 25 + 26 + #include <linux/kernel.h> 27 + #include <linux/init.h> 28 + #include <linux/perf_event.h> 29 + #include <asm/bfin_pfmon.h> 30 + 31 + /* 32 + * We have two counters, and each counter can support an event type. 33 + * The 'o' is PFCNTx=1 and 's' is PFCNTx=0 34 + * 35 + * 0x04 o pc invariant branches 36 + * 0x06 o mispredicted branches 37 + * 0x09 o predicted branches taken 38 + * 0x0B o EXCPT insn 39 + * 0x0C o CSYNC/SSYNC insn 40 + * 0x0D o Insns committed 41 + * 0x0E o Interrupts taken 42 + * 0x0F o Misaligned address exceptions 43 + * 0x80 o Code memory fetches stalled due to DMA 44 + * 0x83 o 64bit insn fetches delivered 45 + * 0x9A o data cache fills (bank a) 46 + * 0x9B o data cache fills (bank b) 47 + * 0x9C o data cache lines evicted (bank a) 48 + * 0x9D o data cache lines evicted (bank b) 49 + * 0x9E o data cache high priority fills 50 + * 0x9F o data cache low priority fills 51 + * 0x00 s loop 0 iterations 52 + * 0x01 s loop 1 iterations 53 + * 0x0A s CSYNC/SSYNC stalls 54 + * 0x10 s DAG read/after write hazards 55 + * 0x13 s RAW data hazards 56 + * 0x81 s code TAG stalls 57 + * 0x82 s code fill stalls 58 + * 0x90 s processor to memory stalls 59 + * 0x91 s data memory stalls not hidden by 0x90 60 + * 0x92 s data store buffer full stalls 61 + * 0x93 s data memory write buffer full stalls due to high->low priority 62 + * 0x95 s data memory fill buffer stalls 63 + * 0x96 s data TAG collision stalls 64 + * 0x97 s data collision stalls 65 + * 0x98 s data stalls 66 + * 0x99 s data stalls sent to processor 67 + */ 68 + 69 + static const int event_map[] = { 70 + /* use CYCLES cpu register */ 71 + [PERF_COUNT_HW_CPU_CYCLES] = -1, 72 + [PERF_COUNT_HW_INSTRUCTIONS] = 0x0D, 73 + [PERF_COUNT_HW_CACHE_REFERENCES] = -1, 74 + [PERF_COUNT_HW_CACHE_MISSES] = 0x83, 75 + [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x09, 76 + [PERF_COUNT_HW_BRANCH_MISSES] = 0x06, 77 + [PERF_COUNT_HW_BUS_CYCLES] = -1, 78 + }; 79 + 80 + #define C(x) PERF_COUNT_HW_CACHE_##x 81 + 82 + static const int cache_events[PERF_COUNT_HW_CACHE_MAX] 83 + [PERF_COUNT_HW_CACHE_OP_MAX] 84 + [PERF_COUNT_HW_CACHE_RESULT_MAX] = 85 + { 86 + [C(L1D)] = { /* Data bank A */ 87 + [C(OP_READ)] = { 88 + [C(RESULT_ACCESS)] = 0, 89 + [C(RESULT_MISS) ] = 0x9A, 90 + }, 91 + [C(OP_WRITE)] = { 92 + [C(RESULT_ACCESS)] = 0, 93 + [C(RESULT_MISS) ] = 0, 94 + }, 95 + [C(OP_PREFETCH)] = { 96 + [C(RESULT_ACCESS)] = 0, 97 + [C(RESULT_MISS) ] = 0, 98 + }, 99 + }, 100 + 101 + [C(L1I)] = { 102 + [C(OP_READ)] = { 103 + [C(RESULT_ACCESS)] = 0, 104 + [C(RESULT_MISS) ] = 0x83, 105 + }, 106 + [C(OP_WRITE)] = { 107 + [C(RESULT_ACCESS)] = -1, 108 + [C(RESULT_MISS) ] = -1, 109 + }, 110 + [C(OP_PREFETCH)] = { 111 + [C(RESULT_ACCESS)] = 0, 112 + [C(RESULT_MISS) ] = 0, 113 + }, 114 + }, 115 + 116 + [C(LL)] = { 117 + [C(OP_READ)] = { 118 + [C(RESULT_ACCESS)] = -1, 119 + [C(RESULT_MISS) ] = -1, 120 + }, 121 + [C(OP_WRITE)] = { 122 + [C(RESULT_ACCESS)] = -1, 123 + [C(RESULT_MISS) ] = -1, 124 + }, 125 + [C(OP_PREFETCH)] = { 126 + [C(RESULT_ACCESS)] = -1, 127 + [C(RESULT_MISS) ] = -1, 128 + }, 129 + }, 130 + 131 + [C(DTLB)] = { 132 + [C(OP_READ)] = { 133 + [C(RESULT_ACCESS)] = -1, 134 + [C(RESULT_MISS) ] = -1, 135 + }, 136 + [C(OP_WRITE)] = { 137 + [C(RESULT_ACCESS)] = -1, 138 + [C(RESULT_MISS) ] = -1, 139 + }, 140 + [C(OP_PREFETCH)] = { 141 + [C(RESULT_ACCESS)] = -1, 142 + [C(RESULT_MISS) ] = -1, 143 + }, 144 + }, 145 + 146 + [C(ITLB)] = { 147 + [C(OP_READ)] = { 148 + [C(RESULT_ACCESS)] = -1, 149 + [C(RESULT_MISS) ] = -1, 150 + }, 151 + [C(OP_WRITE)] = { 152 + [C(RESULT_ACCESS)] = -1, 153 + [C(RESULT_MISS) ] = -1, 154 + }, 155 + [C(OP_PREFETCH)] = { 156 + [C(RESULT_ACCESS)] = -1, 157 + [C(RESULT_MISS) ] = -1, 158 + }, 159 + }, 160 + 161 + [C(BPU)] = { 162 + [C(OP_READ)] = { 163 + [C(RESULT_ACCESS)] = -1, 164 + [C(RESULT_MISS) ] = -1, 165 + }, 166 + [C(OP_WRITE)] = { 167 + [C(RESULT_ACCESS)] = -1, 168 + [C(RESULT_MISS) ] = -1, 169 + }, 170 + [C(OP_PREFETCH)] = { 171 + [C(RESULT_ACCESS)] = -1, 172 + [C(RESULT_MISS) ] = -1, 173 + }, 174 + }, 175 + }; 176 + 177 + const char *perf_pmu_name(void) 178 + { 179 + return "bfin"; 180 + } 181 + EXPORT_SYMBOL(perf_pmu_name); 182 + 183 + int perf_num_counters(void) 184 + { 185 + return ARRAY_SIZE(event_map); 186 + } 187 + EXPORT_SYMBOL(perf_num_counters); 188 + 189 + static u64 bfin_pfmon_read(int idx) 190 + { 191 + return bfin_read32(PFCNTR0 + (idx * 4)); 192 + } 193 + 194 + static void bfin_pfmon_disable(struct hw_perf_event *hwc, int idx) 195 + { 196 + bfin_write_PFCTL(bfin_read_PFCTL() & ~PFCEN(idx, PFCEN_MASK)); 197 + } 198 + 199 + static void bfin_pfmon_enable(struct hw_perf_event *hwc, int idx) 200 + { 201 + u32 val, mask; 202 + 203 + val = PFPWR; 204 + if (idx) { 205 + mask = ~(PFCNT1 | PFMON1 | PFCEN1 | PEMUSW1); 206 + /* The packed config is for event0, so shift it to event1 slots */ 207 + val |= (hwc->config << (PFMON1_P - PFMON0_P)); 208 + val |= (hwc->config & PFCNT0) << (PFCNT1_P - PFCNT0_P); 209 + bfin_write_PFCNTR1(0); 210 + } else { 211 + mask = ~(PFCNT0 | PFMON0 | PFCEN0 | PEMUSW0); 212 + val |= hwc->config; 213 + bfin_write_PFCNTR0(0); 214 + } 215 + 216 + bfin_write_PFCTL((bfin_read_PFCTL() & mask) | val); 217 + } 218 + 219 + static void bfin_pfmon_disable_all(void) 220 + { 221 + bfin_write_PFCTL(bfin_read_PFCTL() & ~PFPWR); 222 + } 223 + 224 + static void bfin_pfmon_enable_all(void) 225 + { 226 + bfin_write_PFCTL(bfin_read_PFCTL() | PFPWR); 227 + } 228 + 229 + struct cpu_hw_events { 230 + struct perf_event *events[MAX_HWEVENTS]; 231 + unsigned long used_mask[BITS_TO_LONGS(MAX_HWEVENTS)]; 232 + }; 233 + DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events); 234 + 235 + static int hw_perf_cache_event(int config, int *evp) 236 + { 237 + unsigned long type, op, result; 238 + int ev; 239 + 240 + /* unpack config */ 241 + type = config & 0xff; 242 + op = (config >> 8) & 0xff; 243 + result = (config >> 16) & 0xff; 244 + 245 + if (type >= PERF_COUNT_HW_CACHE_MAX || 246 + op >= PERF_COUNT_HW_CACHE_OP_MAX || 247 + result >= PERF_COUNT_HW_CACHE_RESULT_MAX) 248 + return -EINVAL; 249 + 250 + ev = cache_events[type][op][result]; 251 + if (ev == 0) 252 + return -EOPNOTSUPP; 253 + if (ev == -1) 254 + return -EINVAL; 255 + *evp = ev; 256 + return 0; 257 + } 258 + 259 + static void bfin_perf_event_update(struct perf_event *event, 260 + struct hw_perf_event *hwc, int idx) 261 + { 262 + u64 prev_raw_count, new_raw_count; 263 + s64 delta; 264 + int shift = 0; 265 + 266 + /* 267 + * Depending on the counter configuration, they may or may not 268 + * be chained, in which case the previous counter value can be 269 + * updated underneath us if the lower-half overflows. 270 + * 271 + * Our tactic to handle this is to first atomically read and 272 + * exchange a new raw count - then add that new-prev delta 273 + * count to the generic counter atomically. 274 + * 275 + * As there is no interrupt associated with the overflow events, 276 + * this is the simplest approach for maintaining consistency. 277 + */ 278 + again: 279 + prev_raw_count = local64_read(&hwc->prev_count); 280 + new_raw_count = bfin_pfmon_read(idx); 281 + 282 + if (local64_cmpxchg(&hwc->prev_count, prev_raw_count, 283 + new_raw_count) != prev_raw_count) 284 + goto again; 285 + 286 + /* 287 + * Now we have the new raw value and have updated the prev 288 + * timestamp already. We can now calculate the elapsed delta 289 + * (counter-)time and add that to the generic counter. 290 + * 291 + * Careful, not all hw sign-extends above the physical width 292 + * of the count. 293 + */ 294 + delta = (new_raw_count << shift) - (prev_raw_count << shift); 295 + delta >>= shift; 296 + 297 + local64_add(delta, &event->count); 298 + } 299 + 300 + static void bfin_pmu_stop(struct perf_event *event, int flags) 301 + { 302 + struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 303 + struct hw_perf_event *hwc = &event->hw; 304 + int idx = hwc->idx; 305 + 306 + if (!(event->hw.state & PERF_HES_STOPPED)) { 307 + bfin_pfmon_disable(hwc, idx); 308 + cpuc->events[idx] = NULL; 309 + event->hw.state |= PERF_HES_STOPPED; 310 + } 311 + 312 + if ((flags & PERF_EF_UPDATE) && !(event->hw.state & PERF_HES_UPTODATE)) { 313 + bfin_perf_event_update(event, &event->hw, idx); 314 + event->hw.state |= PERF_HES_UPTODATE; 315 + } 316 + } 317 + 318 + static void bfin_pmu_start(struct perf_event *event, int flags) 319 + { 320 + struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 321 + struct hw_perf_event *hwc = &event->hw; 322 + int idx = hwc->idx; 323 + 324 + if (WARN_ON_ONCE(idx == -1)) 325 + return; 326 + 327 + if (flags & PERF_EF_RELOAD) 328 + WARN_ON_ONCE(!(event->hw.state & PERF_HES_UPTODATE)); 329 + 330 + cpuc->events[idx] = event; 331 + event->hw.state = 0; 332 + bfin_pfmon_enable(hwc, idx); 333 + } 334 + 335 + static void bfin_pmu_del(struct perf_event *event, int flags) 336 + { 337 + struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 338 + 339 + bfin_pmu_stop(event, PERF_EF_UPDATE); 340 + __clear_bit(event->hw.idx, cpuc->used_mask); 341 + 342 + perf_event_update_userpage(event); 343 + } 344 + 345 + static int bfin_pmu_add(struct perf_event *event, int flags) 346 + { 347 + struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 348 + struct hw_perf_event *hwc = &event->hw; 349 + int idx = hwc->idx; 350 + int ret = -EAGAIN; 351 + 352 + perf_pmu_disable(event->pmu); 353 + 354 + if (__test_and_set_bit(idx, cpuc->used_mask)) { 355 + idx = find_first_zero_bit(cpuc->used_mask, MAX_HWEVENTS); 356 + if (idx == MAX_HWEVENTS) 357 + goto out; 358 + 359 + __set_bit(idx, cpuc->used_mask); 360 + hwc->idx = idx; 361 + } 362 + 363 + bfin_pfmon_disable(hwc, idx); 364 + 365 + event->hw.state = PERF_HES_UPTODATE | PERF_HES_STOPPED; 366 + if (flags & PERF_EF_START) 367 + bfin_pmu_start(event, PERF_EF_RELOAD); 368 + 369 + perf_event_update_userpage(event); 370 + ret = 0; 371 + out: 372 + perf_pmu_enable(event->pmu); 373 + return ret; 374 + } 375 + 376 + static void bfin_pmu_read(struct perf_event *event) 377 + { 378 + bfin_perf_event_update(event, &event->hw, event->hw.idx); 379 + } 380 + 381 + static int bfin_pmu_event_init(struct perf_event *event) 382 + { 383 + struct perf_event_attr *attr = &event->attr; 384 + struct hw_perf_event *hwc = &event->hw; 385 + int config = -1; 386 + int ret; 387 + 388 + if (attr->exclude_hv || attr->exclude_idle) 389 + return -EPERM; 390 + 391 + /* 392 + * All of the on-chip counters are "limited", in that they have 393 + * no interrupts, and are therefore unable to do sampling without 394 + * further work and timer assistance. 395 + */ 396 + if (hwc->sample_period) 397 + return -EINVAL; 398 + 399 + ret = 0; 400 + switch (attr->type) { 401 + case PERF_TYPE_RAW: 402 + config = PFMON(0, attr->config & PFMON_MASK) | 403 + PFCNT(0, !(attr->config & 0x100)); 404 + break; 405 + case PERF_TYPE_HW_CACHE: 406 + ret = hw_perf_cache_event(attr->config, &config); 407 + break; 408 + case PERF_TYPE_HARDWARE: 409 + if (attr->config >= ARRAY_SIZE(event_map)) 410 + return -EINVAL; 411 + 412 + config = event_map[attr->config]; 413 + break; 414 + } 415 + 416 + if (config == -1) 417 + return -EINVAL; 418 + 419 + if (!attr->exclude_kernel) 420 + config |= PFCEN(0, PFCEN_ENABLE_SUPV); 421 + if (!attr->exclude_user) 422 + config |= PFCEN(0, PFCEN_ENABLE_USER); 423 + 424 + hwc->config |= config; 425 + 426 + return ret; 427 + } 428 + 429 + static void bfin_pmu_enable(struct pmu *pmu) 430 + { 431 + struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 432 + struct perf_event *event; 433 + struct hw_perf_event *hwc; 434 + int i; 435 + 436 + for (i = 0; i < MAX_HWEVENTS; ++i) { 437 + event = cpuc->events[i]; 438 + if (!event) 439 + continue; 440 + hwc = &event->hw; 441 + bfin_pfmon_enable(hwc, hwc->idx); 442 + } 443 + 444 + bfin_pfmon_enable_all(); 445 + } 446 + 447 + static void bfin_pmu_disable(struct pmu *pmu) 448 + { 449 + bfin_pfmon_disable_all(); 450 + } 451 + 452 + static struct pmu pmu = { 453 + .pmu_enable = bfin_pmu_enable, 454 + .pmu_disable = bfin_pmu_disable, 455 + .event_init = bfin_pmu_event_init, 456 + .add = bfin_pmu_add, 457 + .del = bfin_pmu_del, 458 + .start = bfin_pmu_start, 459 + .stop = bfin_pmu_stop, 460 + .read = bfin_pmu_read, 461 + }; 462 + 463 + static void bfin_pmu_setup(int cpu) 464 + { 465 + struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu); 466 + 467 + memset(cpuhw, 0, sizeof(struct cpu_hw_events)); 468 + } 469 + 470 + static int __cpuinit 471 + bfin_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) 472 + { 473 + unsigned int cpu = (long)hcpu; 474 + 475 + switch (action & ~CPU_TASKS_FROZEN) { 476 + case CPU_UP_PREPARE: 477 + bfin_write_PFCTL(0); 478 + bfin_pmu_setup(cpu); 479 + break; 480 + 481 + default: 482 + break; 483 + } 484 + 485 + return NOTIFY_OK; 486 + } 487 + 488 + static int __init bfin_pmu_init(void) 489 + { 490 + int ret; 491 + 492 + ret = perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW); 493 + if (!ret) 494 + perf_cpu_notifier(bfin_pmu_notifier); 495 + 496 + return ret; 497 + } 498 + early_initcall(bfin_pmu_init);
+2 -4
arch/blackfin/kernel/process.c
··· 171 171 unsigned long newsp; 172 172 173 173 #ifdef __ARCH_SYNC_CORE_DCACHE 174 - if (current->rt.nr_cpus_allowed == num_possible_cpus()) { 175 - current->cpus_allowed = cpumask_of_cpu(smp_processor_id()); 176 - current->rt.nr_cpus_allowed = 1; 177 - } 174 + if (current->rt.nr_cpus_allowed == num_possible_cpus()) 175 + set_cpus_allowed_ptr(current, cpumask_of(smp_processor_id())); 178 176 #endif 179 177 180 178 /* syscall2 puts clone_flags in r0 and usp in r1 */
+31 -34
arch/blackfin/kernel/reboot.c
··· 23 23 __attribute__ ((__l1_text__, __noreturn__)) 24 24 static void bfin_reset(void) 25 25 { 26 + if (!ANOMALY_05000353 && !ANOMALY_05000386) 27 + bfrom_SoftReset((void *)(L1_SCRATCH_START + L1_SCRATCH_LENGTH - 20)); 28 + 26 29 /* Wait for completion of "system" events such as cache line 27 30 * line fills so that we avoid infinite stalls later on as 28 31 * much as possible. This code is in L1, so it won't trigger ··· 33 30 */ 34 31 __builtin_bfin_ssync(); 35 32 36 - /* The bootrom checks to see how it was reset and will 37 - * automatically perform a software reset for us when 38 - * it starts executing after the core reset. 33 + /* Initiate System software reset. */ 34 + bfin_write_SWRST(0x7); 35 + 36 + /* Due to the way reset is handled in the hardware, we need 37 + * to delay for 10 SCLKS. The only reliable way to do this is 38 + * to calculate the CCLK/SCLK ratio and multiply 10. For now, 39 + * we'll assume worse case which is a 1:15 ratio. 39 40 */ 40 - if (ANOMALY_05000353 || ANOMALY_05000386) { 41 - /* Initiate System software reset. */ 42 - bfin_write_SWRST(0x7); 41 + asm( 42 + "LSETUP (1f, 1f) LC0 = %0\n" 43 + "1: nop;" 44 + : 45 + : "a" (15 * 10) 46 + : "LC0", "LB0", "LT0" 47 + ); 43 48 44 - /* Due to the way reset is handled in the hardware, we need 45 - * to delay for 10 SCLKS. The only reliable way to do this is 46 - * to calculate the CCLK/SCLK ratio and multiply 10. For now, 47 - * we'll assume worse case which is a 1:15 ratio. 48 - */ 49 - asm( 50 - "LSETUP (1f, 1f) LC0 = %0\n" 51 - "1: nop;" 52 - : 53 - : "a" (15 * 10) 54 - : "LC0", "LB0", "LT0" 55 - ); 49 + /* Clear System software reset */ 50 + bfin_write_SWRST(0); 56 51 57 - /* Clear System software reset */ 58 - bfin_write_SWRST(0); 59 - 60 - /* The BF526 ROM will crash during reset */ 52 + /* The BF526 ROM will crash during reset */ 61 53 #if defined(__ADSPBF522__) || defined(__ADSPBF524__) || defined(__ADSPBF526__) 62 - bfin_read_SWRST(); 54 + bfin_read_SWRST(); 63 55 #endif 64 56 65 - /* Wait for the SWRST write to complete. Cannot rely on SSYNC 66 - * though as the System state is all reset now. 67 - */ 68 - asm( 69 - "LSETUP (1f, 1f) LC1 = %0\n" 70 - "1: nop;" 71 - : 72 - : "a" (15 * 1) 73 - : "LC1", "LB1", "LT1" 74 - ); 75 - } 57 + /* Wait for the SWRST write to complete. Cannot rely on SSYNC 58 + * though as the System state is all reset now. 59 + */ 60 + asm( 61 + "LSETUP (1f, 1f) LC1 = %0\n" 62 + "1: nop;" 63 + : 64 + : "a" (15 * 1) 65 + : "LC1", "LB1", "LT1" 66 + ); 76 67 77 68 while (1) 78 69 /* Issue core reset */
+26 -28
arch/blackfin/kernel/setup.c
··· 29 29 #include <asm/cpu.h> 30 30 #include <asm/fixed_code.h> 31 31 #include <asm/early_printk.h> 32 + #include <asm/irq_handler.h> 32 33 33 34 u16 _bfin_swrst; 34 35 EXPORT_SYMBOL(_bfin_swrst); ··· 106 105 bfin_dcache_init(dcplb_tbl[cpu]); 107 106 #endif 108 107 108 + bfin_setup_cpudata(cpu); 109 + 109 110 /* 110 111 * In cache coherence emulation mode, we need to have the 111 112 * D-cache enabled before running any atomic operation which ··· 166 163 { 167 164 struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu); 168 165 169 - cpudata->idle = current; 170 166 cpudata->imemctl = bfin_read_IMEM_CONTROL(); 171 167 cpudata->dmemctl = bfin_read_DMEM_CONTROL(); 172 168 } ··· 853 851 854 852 void __init setup_arch(char **cmdline_p) 855 853 { 854 + u32 mmr; 856 855 unsigned long sclk, cclk; 857 856 858 857 native_machine_early_platform_add_devices(); ··· 905 902 bfin_write_EBIU_FCTL(CONFIG_EBIU_FCTLVAL); 906 903 #endif 907 904 #ifdef CONFIG_BFIN_HYSTERESIS_CONTROL 908 - bfin_write_PORTF_HYSTERISIS(HYST_PORTF_0_15); 909 - bfin_write_PORTG_HYSTERISIS(HYST_PORTG_0_15); 910 - bfin_write_PORTH_HYSTERISIS(HYST_PORTH_0_15); 911 - bfin_write_MISCPORT_HYSTERISIS((bfin_read_MISCPORT_HYSTERISIS() & 905 + bfin_write_PORTF_HYSTERESIS(HYST_PORTF_0_15); 906 + bfin_write_PORTG_HYSTERESIS(HYST_PORTG_0_15); 907 + bfin_write_PORTH_HYSTERESIS(HYST_PORTH_0_15); 908 + bfin_write_MISCPORT_HYSTERESIS((bfin_read_MISCPORT_HYSTERESIS() & 912 909 ~HYST_NONEGPIO_MASK) | HYST_NONEGPIO); 913 910 #endif 914 911 ··· 924 921 bfin_read_IMDMA_D1_IRQ_STATUS(); 925 922 } 926 923 #endif 927 - printk(KERN_INFO "Hardware Trace "); 928 - if (bfin_read_TBUFCTL() & 0x1) 929 - printk(KERN_CONT "Active "); 930 - else 931 - printk(KERN_CONT "Off "); 932 - if (bfin_read_TBUFCTL() & 0x2) 933 - printk(KERN_CONT "and Enabled\n"); 934 - else 935 - printk(KERN_CONT "and Disabled\n"); 936 924 937 - printk(KERN_INFO "Boot Mode: %i\n", bfin_read_SYSCR() & 0xF); 925 + mmr = bfin_read_TBUFCTL(); 926 + printk(KERN_INFO "Hardware Trace %s and %sabled\n", 927 + (mmr & 0x1) ? "active" : "off", 928 + (mmr & 0x2) ? "en" : "dis"); 929 + 930 + mmr = bfin_read_SYSCR(); 931 + printk(KERN_INFO "Boot Mode: %i\n", mmr & 0xF); 938 932 939 933 /* Newer parts mirror SWRST bits in SYSCR */ 940 934 #if defined(CONFIG_BF53x) || defined(CONFIG_BF561) || \ ··· 939 939 _bfin_swrst = bfin_read_SWRST(); 940 940 #else 941 941 /* Clear boot mode field */ 942 - _bfin_swrst = bfin_read_SYSCR() & ~0xf; 942 + _bfin_swrst = mmr & ~0xf; 943 943 #endif 944 944 945 945 #ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT ··· 1036 1036 static int __init topology_init(void) 1037 1037 { 1038 1038 unsigned int cpu; 1039 - /* Record CPU-private information for the boot processor. */ 1040 - bfin_setup_cpudata(0); 1041 1039 1042 1040 for_each_possible_cpu(cpu) { 1043 1041 register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu); ··· 1281 1283 dsup_banks, BFIN_DSUBBANKS, BFIN_DWAYS, 1282 1284 BFIN_DLINES); 1283 1285 #ifdef __ARCH_SYNC_CORE_DCACHE 1284 - seq_printf(m, "SMP Dcache Flushes\t: %lu\n\n", dcache_invld_count[cpu_num]); 1286 + seq_printf(m, "dcache flushes\t: %lu\n", dcache_invld_count[cpu_num]); 1285 1287 #endif 1286 1288 #ifdef __ARCH_SYNC_CORE_ICACHE 1287 - seq_printf(m, "SMP Icache Flushes\t: %lu\n\n", icache_invld_count[cpu_num]); 1289 + seq_printf(m, "icache flushes\t: %lu\n", icache_invld_count[cpu_num]); 1288 1290 #endif 1291 + 1292 + seq_printf(m, "\n"); 1289 1293 1290 1294 if (cpu_num != num_possible_cpus() - 1) 1291 1295 return 0; ··· 1312 1312 " in data cache\n"); 1313 1313 } 1314 1314 seq_printf(m, "board name\t: %s\n", bfin_board_name); 1315 - seq_printf(m, "board memory\t: %ld kB (0x%p -> 0x%p)\n", 1316 - physical_mem_end >> 10, (void *)0, (void *)physical_mem_end); 1317 - seq_printf(m, "kernel memory\t: %d kB (0x%p -> 0x%p)\n", 1315 + seq_printf(m, "board memory\t: %ld kB (0x%08lx -> 0x%08lx)\n", 1316 + physical_mem_end >> 10, 0ul, physical_mem_end); 1317 + seq_printf(m, "kernel memory\t: %d kB (0x%08lx -> 0x%08lx)\n", 1318 1318 ((int)memory_end - (int)_rambase) >> 10, 1319 - (void *)_rambase, 1320 - (void *)memory_end); 1321 - seq_printf(m, "\n"); 1319 + _rambase, memory_end); 1322 1320 1323 1321 return 0; 1324 1322 } ··· 1324 1326 static void *c_start(struct seq_file *m, loff_t *pos) 1325 1327 { 1326 1328 if (*pos == 0) 1327 - *pos = first_cpu(cpu_online_map); 1329 + *pos = cpumask_first(cpu_online_mask); 1328 1330 if (*pos >= num_online_cpus()) 1329 1331 return NULL; 1330 1332 ··· 1333 1335 1334 1336 static void *c_next(struct seq_file *m, void *v, loff_t *pos) 1335 1337 { 1336 - *pos = next_cpu(*pos, cpu_online_map); 1338 + *pos = cpumask_next(*pos, cpu_online_mask); 1337 1339 1338 1340 return c_start(m, pos); 1339 1341 }
+1 -7
arch/blackfin/kernel/vmlinux.lds.S
··· 155 155 SECURITY_INITCALL 156 156 INIT_RAM_FS 157 157 158 - . = ALIGN(4); 159 158 ___per_cpu_load = .; 160 - ___per_cpu_start = .; 161 - *(.data.percpu.first) 162 - *(.data.percpu.page_aligned) 163 - *(.data.percpu) 164 - *(.data.percpu.shared_aligned) 165 - ___per_cpu_end = .; 159 + PERCPU_INPUT(32) 166 160 167 161 EXIT_DATA 168 162 __einitdata = .;
+3 -1
arch/blackfin/mach-bf518/include/mach/anomaly.h
··· 5 5 * and can be replaced with that version at any time 6 6 * DO NOT EDIT THIS FILE 7 7 * 8 - * Copyright 2004-2010 Analog Devices Inc. 8 + * Copyright 2004-2011 Analog Devices Inc. 9 9 * Licensed under the ADI BSD license. 10 10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd 11 11 */ ··· 141 141 #define ANOMALY_05000364 (0) 142 142 #define ANOMALY_05000371 (0) 143 143 #define ANOMALY_05000380 (0) 144 + #define ANOMALY_05000383 (0) 144 145 #define ANOMALY_05000386 (0) 145 146 #define ANOMALY_05000389 (0) 146 147 #define ANOMALY_05000400 (0) ··· 156 155 #define ANOMALY_05000467 (0) 157 156 #define ANOMALY_05000474 (0) 158 157 #define ANOMALY_05000475 (0) 158 + #define ANOMALY_05000480 (0) 159 159 #define ANOMALY_05000485 (0) 160 160 161 161 #endif
+8 -8
arch/blackfin/mach-bf518/include/mach/cdefBF512.h
··· 990 990 #define bfin_write_PORTG_SLEW(val) bfin_write16(PORTG_SLEW, val) 991 991 #define bfin_read_PORTH_SLEW() bfin_read16(PORTH_SLEW) 992 992 #define bfin_write_PORTH_SLEW(val) bfin_write16(PORTH_SLEW, val) 993 - #define bfin_read_PORTF_HYSTERISIS() bfin_read16(PORTF_HYSTERISIS) 994 - #define bfin_write_PORTF_HYSTERISIS(val) bfin_write16(PORTF_HYSTERISIS, val) 995 - #define bfin_read_PORTG_HYSTERISIS() bfin_read16(PORTG_HYSTERISIS) 996 - #define bfin_write_PORTG_HYSTERISIS(val) bfin_write16(PORTG_HYSTERISIS, val) 997 - #define bfin_read_PORTH_HYSTERISIS() bfin_read16(PORTH_HYSTERISIS) 998 - #define bfin_write_PORTH_HYSTERISIS(val) bfin_write16(PORTH_HYSTERISIS, val) 993 + #define bfin_read_PORTF_HYSTERESIS() bfin_read16(PORTF_HYSTERESIS) 994 + #define bfin_write_PORTF_HYSTERESIS(val) bfin_write16(PORTF_HYSTERESIS, val) 995 + #define bfin_read_PORTG_HYSTERESIS() bfin_read16(PORTG_HYSTERESIS) 996 + #define bfin_write_PORTG_HYSTERESIS(val) bfin_write16(PORTG_HYSTERESIS, val) 997 + #define bfin_read_PORTH_HYSTERESIS() bfin_read16(PORTH_HYSTERESIS) 998 + #define bfin_write_PORTH_HYSTERESIS(val) bfin_write16(PORTH_HYSTERESIS, val) 999 999 #define bfin_read_MISCPORT_DRIVE() bfin_read16(MISCPORT_DRIVE) 1000 1000 #define bfin_write_MISCPORT_DRIVE(val) bfin_write16(MISCPORT_DRIVE, val) 1001 1001 #define bfin_read_MISCPORT_SLEW() bfin_read16(MISCPORT_SLEW) 1002 1002 #define bfin_write_MISCPORT_SLEW(val) bfin_write16(MISCPORT_SLEW, val) 1003 - #define bfin_read_MISCPORT_HYSTERISIS() bfin_read16(MISCPORT_HYSTERISIS) 1004 - #define bfin_write_MISCPORT_HYSTERISIS(val) bfin_write16(MISCPORT_HYSTERISIS, val) 1003 + #define bfin_read_MISCPORT_HYSTERESIS() bfin_read16(MISCPORT_HYSTERESIS) 1004 + #define bfin_write_MISCPORT_HYSTERESIS(val) bfin_write16(MISCPORT_HYSTERESIS, val) 1005 1005 1006 1006 /* HOST Port Registers */ 1007 1007
+4 -4
arch/blackfin/mach-bf518/include/mach/defBF512.h
··· 561 561 #define PORTF_SLEW 0xFFC03230 /* Port F slew control */ 562 562 #define PORTG_SLEW 0xFFC03234 /* Port G slew control */ 563 563 #define PORTH_SLEW 0xFFC03238 /* Port H slew control */ 564 - #define PORTF_HYSTERISIS 0xFFC03240 /* Port F Schmitt trigger control */ 565 - #define PORTG_HYSTERISIS 0xFFC03244 /* Port G Schmitt trigger control */ 566 - #define PORTH_HYSTERISIS 0xFFC03248 /* Port H Schmitt trigger control */ 564 + #define PORTF_HYSTERESIS 0xFFC03240 /* Port F Schmitt trigger control */ 565 + #define PORTG_HYSTERESIS 0xFFC03244 /* Port G Schmitt trigger control */ 566 + #define PORTH_HYSTERESIS 0xFFC03248 /* Port H Schmitt trigger control */ 567 567 #define MISCPORT_DRIVE 0xFFC03280 /* Misc Port drive strength control */ 568 568 #define MISCPORT_SLEW 0xFFC03284 /* Misc Port slew control */ 569 - #define MISCPORT_HYSTERISIS 0xFFC03288 /* Misc Port Schmitt trigger control */ 569 + #define MISCPORT_HYSTERESIS 0xFFC03288 /* Misc Port Schmitt trigger control */ 570 570 571 571 572 572 /***********************************************************************************
+103 -143
arch/blackfin/mach-bf518/include/mach/irq.h
··· 7 7 #ifndef _BF518_IRQ_H_ 8 8 #define _BF518_IRQ_H_ 9 9 10 - /* 11 - * Interrupt source definitions 12 - Event Source Core Event Name 13 - Core Emulation ** 14 - Events (highest priority) EMU 0 15 - Reset RST 1 16 - NMI NMI 2 17 - Exception EVX 3 18 - Reserved -- 4 19 - Hardware Error IVHW 5 20 - Core Timer IVTMR 6 * 10 + #include <mach-common/irq.h> 21 11 22 - ..... 23 - 24 - Software Interrupt 1 IVG14 31 25 - Software Interrupt 2 -- 26 - (lowest priority) IVG15 32 * 27 - */ 28 - 29 - #define NR_PERI_INTS (2 * 32) 30 - 31 - /* The ABSTRACT IRQ definitions */ 32 - /** the first seven of the following are fixed, the rest you change if you need to **/ 33 - #define IRQ_EMU 0 /* Emulation */ 34 - #define IRQ_RST 1 /* reset */ 35 - #define IRQ_NMI 2 /* Non Maskable */ 36 - #define IRQ_EVX 3 /* Exception */ 37 - #define IRQ_UNUSED 4 /* - unused interrupt */ 38 - #define IRQ_HWERR 5 /* Hardware Error */ 39 - #define IRQ_CORETMR 6 /* Core timer */ 40 - 41 - #define BFIN_IRQ(x) ((x) + 7) 12 + #define NR_PERI_INTS (2 * 32) 42 13 43 14 #define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */ 44 15 #define IRQ_DMA0_ERROR BFIN_IRQ(1) /* DMA Error 0 (generic) */ ··· 25 54 #define IRQ_UART0_ERROR BFIN_IRQ(12) /* UART0 Status */ 26 55 #define IRQ_UART1_ERROR BFIN_IRQ(13) /* UART1 Status */ 27 56 #define IRQ_RTC BFIN_IRQ(14) /* RTC */ 28 - #define IRQ_PPI BFIN_IRQ(15) /* DMA Channel 0 (PPI) */ 57 + #define IRQ_PPI BFIN_IRQ(15) /* DMA Channel 0 (PPI) */ 29 58 #define IRQ_SPORT0_RX BFIN_IRQ(16) /* DMA 3 Channel (SPORT0 RX) */ 30 59 #define IRQ_SPORT0_TX BFIN_IRQ(17) /* DMA 4 Channel (SPORT0 TX) */ 31 60 #define IRQ_RSI BFIN_IRQ(17) /* DMA 4 Channel (RSI) */ 32 61 #define IRQ_SPORT1_RX BFIN_IRQ(18) /* DMA 5 Channel (SPORT1 RX/SPI) */ 33 62 #define IRQ_SPI1 BFIN_IRQ(18) /* DMA 5 Channel (SPI1) */ 34 63 #define IRQ_SPORT1_TX BFIN_IRQ(19) /* DMA 6 Channel (SPORT1 TX) */ 35 - #define IRQ_TWI BFIN_IRQ(20) /* TWI */ 36 - #define IRQ_SPI0 BFIN_IRQ(21) /* DMA 7 Channel (SPI0) */ 37 - #define IRQ_UART0_RX BFIN_IRQ(22) /* DMA8 Channel (UART0 RX) */ 38 - #define IRQ_UART0_TX BFIN_IRQ(23) /* DMA9 Channel (UART0 TX) */ 39 - #define IRQ_UART1_RX BFIN_IRQ(24) /* DMA10 Channel (UART1 RX) */ 40 - #define IRQ_UART1_TX BFIN_IRQ(25) /* DMA11 Channel (UART1 TX) */ 41 - #define IRQ_OPTSEC BFIN_IRQ(26) /* OTPSEC Interrupt */ 42 - #define IRQ_CNT BFIN_IRQ(27) /* GP Counter */ 43 - #define IRQ_MAC_RX BFIN_IRQ(28) /* DMA1 Channel (MAC RX) */ 44 - #define IRQ_PORTH_INTA BFIN_IRQ(29) /* Port H Interrupt A */ 64 + #define IRQ_TWI BFIN_IRQ(20) /* TWI */ 65 + #define IRQ_SPI0 BFIN_IRQ(21) /* DMA 7 Channel (SPI0) */ 66 + #define IRQ_UART0_RX BFIN_IRQ(22) /* DMA8 Channel (UART0 RX) */ 67 + #define IRQ_UART0_TX BFIN_IRQ(23) /* DMA9 Channel (UART0 TX) */ 68 + #define IRQ_UART1_RX BFIN_IRQ(24) /* DMA10 Channel (UART1 RX) */ 69 + #define IRQ_UART1_TX BFIN_IRQ(25) /* DMA11 Channel (UART1 TX) */ 70 + #define IRQ_OPTSEC BFIN_IRQ(26) /* OTPSEC Interrupt */ 71 + #define IRQ_CNT BFIN_IRQ(27) /* GP Counter */ 72 + #define IRQ_MAC_RX BFIN_IRQ(28) /* DMA1 Channel (MAC RX) */ 73 + #define IRQ_PORTH_INTA BFIN_IRQ(29) /* Port H Interrupt A */ 45 74 #define IRQ_MAC_TX BFIN_IRQ(30) /* DMA2 Channel (MAC TX) */ 46 75 #define IRQ_PORTH_INTB BFIN_IRQ(31) /* Port H Interrupt B */ 47 76 #define IRQ_TIMER0 BFIN_IRQ(32) /* Timer 0 */ ··· 67 96 #define IRQ_PWM_SYNC BFIN_IRQ(54) /* PWM Sync Interrupt */ 68 97 #define IRQ_PTP_STAT BFIN_IRQ(55) /* PTP Stat Interrupt */ 69 98 70 - #define SYS_IRQS BFIN_IRQ(63) /* 70 */ 99 + #define SYS_IRQS BFIN_IRQ(63) /* 70 */ 71 100 72 - #define IRQ_PF0 71 73 - #define IRQ_PF1 72 74 - #define IRQ_PF2 73 75 - #define IRQ_PF3 74 76 - #define IRQ_PF4 75 77 - #define IRQ_PF5 76 78 - #define IRQ_PF6 77 79 - #define IRQ_PF7 78 80 - #define IRQ_PF8 79 81 - #define IRQ_PF9 80 82 - #define IRQ_PF10 81 83 - #define IRQ_PF11 82 84 - #define IRQ_PF12 83 85 - #define IRQ_PF13 84 86 - #define IRQ_PF14 85 87 - #define IRQ_PF15 86 101 + #define IRQ_PF0 71 102 + #define IRQ_PF1 72 103 + #define IRQ_PF2 73 104 + #define IRQ_PF3 74 105 + #define IRQ_PF4 75 106 + #define IRQ_PF5 76 107 + #define IRQ_PF6 77 108 + #define IRQ_PF7 78 109 + #define IRQ_PF8 79 110 + #define IRQ_PF9 80 111 + #define IRQ_PF10 81 112 + #define IRQ_PF11 82 113 + #define IRQ_PF12 83 114 + #define IRQ_PF13 84 115 + #define IRQ_PF14 85 116 + #define IRQ_PF15 86 88 117 89 - #define IRQ_PG0 87 90 - #define IRQ_PG1 88 91 - #define IRQ_PG2 89 92 - #define IRQ_PG3 90 93 - #define IRQ_PG4 91 94 - #define IRQ_PG5 92 95 - #define IRQ_PG6 93 96 - #define IRQ_PG7 94 97 - #define IRQ_PG8 95 98 - #define IRQ_PG9 96 99 - #define IRQ_PG10 97 100 - #define IRQ_PG11 98 101 - #define IRQ_PG12 99 102 - #define IRQ_PG13 100 103 - #define IRQ_PG14 101 104 - #define IRQ_PG15 102 118 + #define IRQ_PG0 87 119 + #define IRQ_PG1 88 120 + #define IRQ_PG2 89 121 + #define IRQ_PG3 90 122 + #define IRQ_PG4 91 123 + #define IRQ_PG5 92 124 + #define IRQ_PG6 93 125 + #define IRQ_PG7 94 126 + #define IRQ_PG8 95 127 + #define IRQ_PG9 96 128 + #define IRQ_PG10 97 129 + #define IRQ_PG11 98 130 + #define IRQ_PG12 99 131 + #define IRQ_PG13 100 132 + #define IRQ_PG14 101 133 + #define IRQ_PG15 102 105 134 106 - #define IRQ_PH0 103 107 - #define IRQ_PH1 104 108 - #define IRQ_PH2 105 109 - #define IRQ_PH3 106 110 - #define IRQ_PH4 107 111 - #define IRQ_PH5 108 112 - #define IRQ_PH6 109 113 - #define IRQ_PH7 110 114 - #define IRQ_PH8 111 115 - #define IRQ_PH9 112 116 - #define IRQ_PH10 113 117 - #define IRQ_PH11 114 118 - #define IRQ_PH12 115 119 - #define IRQ_PH13 116 120 - #define IRQ_PH14 117 121 - #define IRQ_PH15 118 135 + #define IRQ_PH0 103 136 + #define IRQ_PH1 104 137 + #define IRQ_PH2 105 138 + #define IRQ_PH3 106 139 + #define IRQ_PH4 107 140 + #define IRQ_PH5 108 141 + #define IRQ_PH6 109 142 + #define IRQ_PH7 110 143 + #define IRQ_PH8 111 144 + #define IRQ_PH9 112 145 + #define IRQ_PH10 113 146 + #define IRQ_PH11 114 147 + #define IRQ_PH12 115 148 + #define IRQ_PH13 116 149 + #define IRQ_PH14 117 150 + #define IRQ_PH15 118 122 151 123 - #define GPIO_IRQ_BASE IRQ_PF0 152 + #define GPIO_IRQ_BASE IRQ_PF0 124 153 125 - #define IRQ_MAC_PHYINT 119 /* PHY_INT Interrupt */ 126 - #define IRQ_MAC_MMCINT 120 /* MMC Counter Interrupt */ 127 - #define IRQ_MAC_RXFSINT 121 /* RX Frame-Status Interrupt */ 128 - #define IRQ_MAC_TXFSINT 122 /* TX Frame-Status Interrupt */ 129 - #define IRQ_MAC_WAKEDET 123 /* Wake-Up Interrupt */ 130 - #define IRQ_MAC_RXDMAERR 124 /* RX DMA Direction Error Interrupt */ 131 - #define IRQ_MAC_TXDMAERR 125 /* TX DMA Direction Error Interrupt */ 132 - #define IRQ_MAC_STMDONE 126 /* Station Mgt. Transfer Done Interrupt */ 154 + #define IRQ_MAC_PHYINT 119 /* PHY_INT Interrupt */ 155 + #define IRQ_MAC_MMCINT 120 /* MMC Counter Interrupt */ 156 + #define IRQ_MAC_RXFSINT 121 /* RX Frame-Status Interrupt */ 157 + #define IRQ_MAC_TXFSINT 122 /* TX Frame-Status Interrupt */ 158 + #define IRQ_MAC_WAKEDET 123 /* Wake-Up Interrupt */ 159 + #define IRQ_MAC_RXDMAERR 124 /* RX DMA Direction Error Interrupt */ 160 + #define IRQ_MAC_TXDMAERR 125 /* TX DMA Direction Error Interrupt */ 161 + #define IRQ_MAC_STMDONE 126 /* Station Mgt. Transfer Done Interrupt */ 133 162 134 - #define NR_MACH_IRQS (IRQ_MAC_STMDONE + 1) 135 - #define NR_IRQS (NR_MACH_IRQS + NR_SPARE_IRQS) 136 - 137 - #define IVG7 7 138 - #define IVG8 8 139 - #define IVG9 9 140 - #define IVG10 10 141 - #define IVG11 11 142 - #define IVG12 12 143 - #define IVG13 13 144 - #define IVG14 14 145 - #define IVG15 15 163 + #define NR_MACH_IRQS (IRQ_MAC_STMDONE + 1) 146 164 147 165 /* IAR0 BIT FIELDS */ 148 166 #define IRQ_PLL_WAKEUP_POS 0 149 167 #define IRQ_DMA0_ERROR_POS 4 150 - #define IRQ_DMAR0_BLK_POS 8 151 - #define IRQ_DMAR1_BLK_POS 12 152 - #define IRQ_DMAR0_OVR_POS 16 153 - #define IRQ_DMAR1_OVR_POS 20 154 - #define IRQ_PPI_ERROR_POS 24 155 - #define IRQ_MAC_ERROR_POS 28 168 + #define IRQ_DMAR0_BLK_POS 8 169 + #define IRQ_DMAR1_BLK_POS 12 170 + #define IRQ_DMAR0_OVR_POS 16 171 + #define IRQ_DMAR1_OVR_POS 20 172 + #define IRQ_PPI_ERROR_POS 24 173 + #define IRQ_MAC_ERROR_POS 28 156 174 157 175 /* IAR1 BIT FIELDS */ 158 176 #define IRQ_SPORT0_ERROR_POS 0 159 177 #define IRQ_SPORT1_ERROR_POS 4 160 178 #define IRQ_PTP_ERROR_POS 8 161 - #define IRQ_UART0_ERROR_POS 16 162 - #define IRQ_UART1_ERROR_POS 20 163 - #define IRQ_RTC_POS 24 164 - #define IRQ_PPI_POS 28 179 + #define IRQ_UART0_ERROR_POS 16 180 + #define IRQ_UART1_ERROR_POS 20 181 + #define IRQ_RTC_POS 24 182 + #define IRQ_PPI_POS 28 165 183 166 184 /* IAR2 BIT FIELDS */ 167 185 #define IRQ_SPORT0_RX_POS 0 ··· 159 199 #define IRQ_SPORT1_RX_POS 8 160 200 #define IRQ_SPI1_POS 8 161 201 #define IRQ_SPORT1_TX_POS 12 162 - #define IRQ_TWI_POS 16 163 - #define IRQ_SPI0_POS 20 164 - #define IRQ_UART0_RX_POS 24 165 - #define IRQ_UART0_TX_POS 28 202 + #define IRQ_TWI_POS 16 203 + #define IRQ_SPI0_POS 20 204 + #define IRQ_UART0_RX_POS 24 205 + #define IRQ_UART0_TX_POS 28 166 206 167 207 /* IAR3 BIT FIELDS */ 168 - #define IRQ_UART1_RX_POS 0 169 - #define IRQ_UART1_TX_POS 4 170 - #define IRQ_OPTSEC_POS 8 171 - #define IRQ_CNT_POS 12 172 - #define IRQ_MAC_RX_POS 16 208 + #define IRQ_UART1_RX_POS 0 209 + #define IRQ_UART1_TX_POS 4 210 + #define IRQ_OPTSEC_POS 8 211 + #define IRQ_CNT_POS 12 212 + #define IRQ_MAC_RX_POS 16 173 213 #define IRQ_PORTH_INTA_POS 20 174 - #define IRQ_MAC_TX_POS 24 214 + #define IRQ_MAC_TX_POS 24 175 215 #define IRQ_PORTH_INTB_POS 28 176 216 177 217 /* IAR4 BIT FIELDS */ ··· 187 227 /* IAR5 BIT FIELDS */ 188 228 #define IRQ_PORTG_INTA_POS 0 189 229 #define IRQ_PORTG_INTB_POS 4 190 - #define IRQ_MEM_DMA0_POS 8 191 - #define IRQ_MEM_DMA1_POS 12 192 - #define IRQ_WATCH_POS 16 230 + #define IRQ_MEM_DMA0_POS 8 231 + #define IRQ_MEM_DMA1_POS 12 232 + #define IRQ_WATCH_POS 16 193 233 #define IRQ_PORTF_INTA_POS 20 194 234 #define IRQ_PORTF_INTB_POS 24 195 - #define IRQ_SPI0_ERROR_POS 28 235 + #define IRQ_SPI0_ERROR_POS 28 196 236 197 237 /* IAR6 BIT FIELDS */ 198 - #define IRQ_SPI1_ERROR_POS 0 199 - #define IRQ_RSI_INT0_POS 12 200 - #define IRQ_RSI_INT1_POS 16 201 - #define IRQ_PWM_TRIP_POS 20 202 - #define IRQ_PWM_SYNC_POS 24 203 - #define IRQ_PTP_STAT_POS 28 238 + #define IRQ_SPI1_ERROR_POS 0 239 + #define IRQ_RSI_INT0_POS 12 240 + #define IRQ_RSI_INT1_POS 16 241 + #define IRQ_PWM_TRIP_POS 20 242 + #define IRQ_PWM_SYNC_POS 24 243 + #define IRQ_PTP_STAT_POS 28 204 244 205 - #endif /* _BF518_IRQ_H_ */ 245 + #endif
+72 -2
arch/blackfin/mach-bf527/boards/ezkit.c
··· 26 26 #include <asm/portmux.h> 27 27 #include <asm/dpmc.h> 28 28 #include <linux/spi/ad7877.h> 29 + #include <asm/bfin_sport.h> 29 30 30 31 /* 31 32 * Name the Board for the /proc/cpuinfo ··· 527 526 }; 528 527 #endif 529 528 529 + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 530 + defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) 531 + 532 + static const u16 bfin_snd_pin[][7] = { 533 + {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, 534 + P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0, 0}, 535 + {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, 536 + P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_TFS, 0}, 537 + }; 538 + 539 + static struct bfin_snd_platform_data bfin_snd_data[] = { 540 + { 541 + .pin_req = &bfin_snd_pin[0][0], 542 + }, 543 + { 544 + .pin_req = &bfin_snd_pin[1][0], 545 + }, 546 + }; 547 + 548 + #define BFIN_SND_RES(x) \ 549 + [x] = { \ 550 + { \ 551 + .start = SPORT##x##_TCR1, \ 552 + .end = SPORT##x##_TCR1, \ 553 + .flags = IORESOURCE_MEM \ 554 + }, \ 555 + { \ 556 + .start = CH_SPORT##x##_RX, \ 557 + .end = CH_SPORT##x##_RX, \ 558 + .flags = IORESOURCE_DMA, \ 559 + }, \ 560 + { \ 561 + .start = CH_SPORT##x##_TX, \ 562 + .end = CH_SPORT##x##_TX, \ 563 + .flags = IORESOURCE_DMA, \ 564 + }, \ 565 + { \ 566 + .start = IRQ_SPORT##x##_ERROR, \ 567 + .end = IRQ_SPORT##x##_ERROR, \ 568 + .flags = IORESOURCE_IRQ, \ 569 + } \ 570 + } 571 + 572 + static struct resource bfin_snd_resources[][4] = { 573 + BFIN_SND_RES(0), 574 + BFIN_SND_RES(1), 575 + }; 576 + 577 + static struct platform_device bfin_pcm = { 578 + .name = "bfin-pcm-audio", 579 + .id = -1, 580 + }; 581 + #endif 582 + 530 583 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 531 584 static struct platform_device bfin_i2s = { 532 585 .name = "bfin-i2s", 533 586 .id = CONFIG_SND_BF5XX_SPORT_NUM, 534 - /* TODO: add platform data here */ 587 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 588 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 589 + .dev = { 590 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 591 + }, 535 592 }; 536 593 #endif 537 594 ··· 597 538 static struct platform_device bfin_tdm = { 598 539 .name = "bfin-tdm", 599 540 .id = CONFIG_SND_BF5XX_SPORT_NUM, 600 - /* TODO: add platform data here */ 541 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 542 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 543 + .dev = { 544 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 545 + }, 601 546 }; 602 547 #endif 603 548 ··· 646 583 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 647 584 .bus_num = 0, 648 585 .chip_select = 4, 586 + .platform_data = "ad1836", 649 587 .controller_data = &ad1836_spi_chip_info, 588 + .mode = SPI_MODE_3, 650 589 }, 651 590 #endif 652 591 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) ··· 1274 1209 1275 1210 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 1276 1211 &ezkit_flash_device, 1212 + #endif 1213 + 1214 + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 1215 + defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) 1216 + &bfin_pcm, 1277 1217 #endif 1278 1218 1279 1219 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
+6 -2
arch/blackfin/mach-bf527/include/mach/anomaly.h
··· 5 5 * and can be replaced with that version at any time 6 6 * DO NOT EDIT THIS FILE 7 7 * 8 - * Copyright 2004-2010 Analog Devices Inc. 8 + * Copyright 2004-2011 Analog Devices Inc. 9 9 * Licensed under the ADI BSD license. 10 10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd 11 11 */ 12 12 13 13 /* This file should be up to date with: 14 14 * - Revision E, 03/15/2010; ADSP-BF526 Blackfin Processor Anomaly List 15 - * - Revision G, 08/25/2009; ADSP-BF527 Blackfin Processor Anomaly List 15 + * - Revision H, 04/29/2010; ADSP-BF527 Blackfin Processor Anomaly List 16 16 */ 17 17 18 18 #ifndef _MACH_ANOMALY_H_ ··· 220 220 #define ANOMALY_05000483 (1) 221 221 /* PLL_CTL Change Using bfrom_SysControl() Can Result in Processor Overclocking */ 222 222 #define ANOMALY_05000485 (_ANOMALY_BF526_BF527(< 2, < 3)) 223 + /* The CODEC Zero-Cross Detect Feature is not Functional */ 224 + #define ANOMALY_05000487 (1) 223 225 /* IFLUSH sucks at life */ 224 226 #define ANOMALY_05000491 (1) 225 227 ··· 270 268 #define ANOMALY_05000323 (0) 271 269 #define ANOMALY_05000362 (1) 272 270 #define ANOMALY_05000363 (0) 271 + #define ANOMALY_05000383 (0) 273 272 #define ANOMALY_05000400 (0) 274 273 #define ANOMALY_05000402 (0) 275 274 #define ANOMALY_05000412 (0) 276 275 #define ANOMALY_05000447 (0) 277 276 #define ANOMALY_05000448 (0) 278 277 #define ANOMALY_05000474 (0) 278 + #define ANOMALY_05000480 (0) 279 279 280 280 #endif
+8 -8
arch/blackfin/mach-bf527/include/mach/cdefBF522.h
··· 1007 1007 #define bfin_write_PORTG_SLEW(val) bfin_write16(PORTG_SLEW, val) 1008 1008 #define bfin_read_PORTH_SLEW() bfin_read16(PORTH_SLEW) 1009 1009 #define bfin_write_PORTH_SLEW(val) bfin_write16(PORTH_SLEW, val) 1010 - #define bfin_read_PORTF_HYSTERISIS() bfin_read16(PORTF_HYSTERISIS) 1011 - #define bfin_write_PORTF_HYSTERISIS(val) bfin_write16(PORTF_HYSTERISIS, val) 1012 - #define bfin_read_PORTG_HYSTERISIS() bfin_read16(PORTG_HYSTERISIS) 1013 - #define bfin_write_PORTG_HYSTERISIS(val) bfin_write16(PORTG_HYSTERISIS, val) 1014 - #define bfin_read_PORTH_HYSTERISIS() bfin_read16(PORTH_HYSTERISIS) 1015 - #define bfin_write_PORTH_HYSTERISIS(val) bfin_write16(PORTH_HYSTERISIS, val) 1010 + #define bfin_read_PORTF_HYSTERESIS() bfin_read16(PORTF_HYSTERESIS) 1011 + #define bfin_write_PORTF_HYSTERESIS(val) bfin_write16(PORTF_HYSTERESIS, val) 1012 + #define bfin_read_PORTG_HYSTERESIS() bfin_read16(PORTG_HYSTERESIS) 1013 + #define bfin_write_PORTG_HYSTERESIS(val) bfin_write16(PORTG_HYSTERESIS, val) 1014 + #define bfin_read_PORTH_HYSTERESIS() bfin_read16(PORTH_HYSTERESIS) 1015 + #define bfin_write_PORTH_HYSTERESIS(val) bfin_write16(PORTH_HYSTERESIS, val) 1016 1016 #define bfin_read_MISCPORT_DRIVE() bfin_read16(MISCPORT_DRIVE) 1017 1017 #define bfin_write_MISCPORT_DRIVE(val) bfin_write16(MISCPORT_DRIVE, val) 1018 1018 #define bfin_read_MISCPORT_SLEW() bfin_read16(MISCPORT_SLEW) 1019 1019 #define bfin_write_MISCPORT_SLEW(val) bfin_write16(MISCPORT_SLEW, val) 1020 - #define bfin_read_MISCPORT_HYSTERISIS() bfin_read16(MISCPORT_HYSTERISIS) 1021 - #define bfin_write_MISCPORT_HYSTERISIS(val) bfin_write16(MISCPORT_HYSTERISIS, val) 1020 + #define bfin_read_MISCPORT_HYSTERESIS() bfin_read16(MISCPORT_HYSTERESIS) 1021 + #define bfin_write_MISCPORT_HYSTERESIS(val) bfin_write16(MISCPORT_HYSTERESIS, val) 1022 1022 1023 1023 /* HOST Port Registers */ 1024 1024
+4 -4
arch/blackfin/mach-bf527/include/mach/defBF522.h
··· 562 562 #define PORTF_SLEW 0xFFC03230 /* Port F slew control */ 563 563 #define PORTG_SLEW 0xFFC03234 /* Port G slew control */ 564 564 #define PORTH_SLEW 0xFFC03238 /* Port H slew control */ 565 - #define PORTF_HYSTERISIS 0xFFC03240 /* Port F Schmitt trigger control */ 566 - #define PORTG_HYSTERISIS 0xFFC03244 /* Port G Schmitt trigger control */ 567 - #define PORTH_HYSTERISIS 0xFFC03248 /* Port H Schmitt trigger control */ 565 + #define PORTF_HYSTERESIS 0xFFC03240 /* Port F Schmitt trigger control */ 566 + #define PORTG_HYSTERESIS 0xFFC03244 /* Port G Schmitt trigger control */ 567 + #define PORTH_HYSTERESIS 0xFFC03248 /* Port H Schmitt trigger control */ 568 568 #define MISCPORT_DRIVE 0xFFC03280 /* Misc Port drive strength control */ 569 569 #define MISCPORT_SLEW 0xFFC03284 /* Misc Port slew control */ 570 - #define MISCPORT_HYSTERISIS 0xFFC03288 /* Misc Port Schmitt trigger control */ 570 + #define MISCPORT_HYSTERESIS 0xFFC03288 /* Misc Port Schmitt trigger control */ 571 571 572 572 573 573 /***********************************************************************************
+105 -145
arch/blackfin/mach-bf527/include/mach/irq.h
··· 7 7 #ifndef _BF527_IRQ_H_ 8 8 #define _BF527_IRQ_H_ 9 9 10 - /* 11 - * Interrupt source definitions 12 - Event Source Core Event Name 13 - Core Emulation ** 14 - Events (highest priority) EMU 0 15 - Reset RST 1 16 - NMI NMI 2 17 - Exception EVX 3 18 - Reserved -- 4 19 - Hardware Error IVHW 5 20 - Core Timer IVTMR 6 * 10 + #include <mach-common/irq.h> 21 11 22 - ..... 23 - 24 - Software Interrupt 1 IVG14 31 25 - Software Interrupt 2 -- 26 - (lowest priority) IVG15 32 * 27 - */ 28 - 29 - #define NR_PERI_INTS (2 * 32) 30 - 31 - /* The ABSTRACT IRQ definitions */ 32 - /** the first seven of the following are fixed, the rest you change if you need to **/ 33 - #define IRQ_EMU 0 /* Emulation */ 34 - #define IRQ_RST 1 /* reset */ 35 - #define IRQ_NMI 2 /* Non Maskable */ 36 - #define IRQ_EVX 3 /* Exception */ 37 - #define IRQ_UNUSED 4 /* - unused interrupt */ 38 - #define IRQ_HWERR 5 /* Hardware Error */ 39 - #define IRQ_CORETMR 6 /* Core timer */ 40 - 41 - #define BFIN_IRQ(x) ((x) + 7) 12 + #define NR_PERI_INTS (2 * 32) 42 13 43 14 #define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */ 44 15 #define IRQ_DMA0_ERROR BFIN_IRQ(1) /* DMA Error 0 (generic) */ ··· 24 53 #define IRQ_UART0_ERROR BFIN_IRQ(12) /* UART0 Status */ 25 54 #define IRQ_UART1_ERROR BFIN_IRQ(13) /* UART1 Status */ 26 55 #define IRQ_RTC BFIN_IRQ(14) /* RTC */ 27 - #define IRQ_PPI BFIN_IRQ(15) /* DMA Channel 0 (PPI/NAND) */ 56 + #define IRQ_PPI BFIN_IRQ(15) /* DMA Channel 0 (PPI/NAND) */ 28 57 #define IRQ_SPORT0_RX BFIN_IRQ(16) /* DMA 3 Channel (SPORT0 RX) */ 29 58 #define IRQ_SPORT0_TX BFIN_IRQ(17) /* DMA 4 Channel (SPORT0 TX) */ 30 59 #define IRQ_SPORT1_RX BFIN_IRQ(18) /* DMA 5 Channel (SPORT1 RX) */ 31 60 #define IRQ_SPORT1_TX BFIN_IRQ(19) /* DMA 6 Channel (SPORT1 TX) */ 32 - #define IRQ_TWI BFIN_IRQ(20) /* TWI */ 33 - #define IRQ_SPI BFIN_IRQ(21) /* DMA 7 Channel (SPI) */ 34 - #define IRQ_UART0_RX BFIN_IRQ(22) /* DMA8 Channel (UART0 RX) */ 35 - #define IRQ_UART0_TX BFIN_IRQ(23) /* DMA9 Channel (UART0 TX) */ 36 - #define IRQ_UART1_RX BFIN_IRQ(24) /* DMA10 Channel (UART1 RX) */ 37 - #define IRQ_UART1_TX BFIN_IRQ(25) /* DMA11 Channel (UART1 TX) */ 38 - #define IRQ_OPTSEC BFIN_IRQ(26) /* OTPSEC Interrupt */ 39 - #define IRQ_CNT BFIN_IRQ(27) /* GP Counter */ 40 - #define IRQ_MAC_RX BFIN_IRQ(28) /* DMA1 Channel (MAC RX/HDMA) */ 41 - #define IRQ_PORTH_INTA BFIN_IRQ(29) /* Port H Interrupt A */ 61 + #define IRQ_TWI BFIN_IRQ(20) /* TWI */ 62 + #define IRQ_SPI BFIN_IRQ(21) /* DMA 7 Channel (SPI) */ 63 + #define IRQ_UART0_RX BFIN_IRQ(22) /* DMA8 Channel (UART0 RX) */ 64 + #define IRQ_UART0_TX BFIN_IRQ(23) /* DMA9 Channel (UART0 TX) */ 65 + #define IRQ_UART1_RX BFIN_IRQ(24) /* DMA10 Channel (UART1 RX) */ 66 + #define IRQ_UART1_TX BFIN_IRQ(25) /* DMA11 Channel (UART1 TX) */ 67 + #define IRQ_OPTSEC BFIN_IRQ(26) /* OTPSEC Interrupt */ 68 + #define IRQ_CNT BFIN_IRQ(27) /* GP Counter */ 69 + #define IRQ_MAC_RX BFIN_IRQ(28) /* DMA1 Channel (MAC RX/HDMA) */ 70 + #define IRQ_PORTH_INTA BFIN_IRQ(29) /* Port H Interrupt A */ 42 71 #define IRQ_MAC_TX BFIN_IRQ(30) /* DMA2 Channel (MAC TX/NAND) */ 43 72 #define IRQ_NFC BFIN_IRQ(30) /* DMA2 Channel (MAC TX/NAND) */ 44 73 #define IRQ_PORTH_INTB BFIN_IRQ(31) /* Port H Interrupt B */ ··· 67 96 #define IRQ_USB_INT2 BFIN_IRQ(54) /* USB_INT2 Interrupt */ 68 97 #define IRQ_USB_DMA BFIN_IRQ(55) /* USB_DMAINT Interrupt */ 69 98 70 - #define SYS_IRQS BFIN_IRQ(63) /* 70 */ 99 + #define SYS_IRQS BFIN_IRQ(63) /* 70 */ 71 100 72 - #define IRQ_PF0 71 73 - #define IRQ_PF1 72 74 - #define IRQ_PF2 73 75 - #define IRQ_PF3 74 76 - #define IRQ_PF4 75 77 - #define IRQ_PF5 76 78 - #define IRQ_PF6 77 79 - #define IRQ_PF7 78 80 - #define IRQ_PF8 79 81 - #define IRQ_PF9 80 82 - #define IRQ_PF10 81 83 - #define IRQ_PF11 82 84 - #define IRQ_PF12 83 85 - #define IRQ_PF13 84 86 - #define IRQ_PF14 85 87 - #define IRQ_PF15 86 101 + #define IRQ_PF0 71 102 + #define IRQ_PF1 72 103 + #define IRQ_PF2 73 104 + #define IRQ_PF3 74 105 + #define IRQ_PF4 75 106 + #define IRQ_PF5 76 107 + #define IRQ_PF6 77 108 + #define IRQ_PF7 78 109 + #define IRQ_PF8 79 110 + #define IRQ_PF9 80 111 + #define IRQ_PF10 81 112 + #define IRQ_PF11 82 113 + #define IRQ_PF12 83 114 + #define IRQ_PF13 84 115 + #define IRQ_PF14 85 116 + #define IRQ_PF15 86 88 117 89 - #define IRQ_PG0 87 90 - #define IRQ_PG1 88 91 - #define IRQ_PG2 89 92 - #define IRQ_PG3 90 93 - #define IRQ_PG4 91 94 - #define IRQ_PG5 92 95 - #define IRQ_PG6 93 96 - #define IRQ_PG7 94 97 - #define IRQ_PG8 95 98 - #define IRQ_PG9 96 99 - #define IRQ_PG10 97 100 - #define IRQ_PG11 98 101 - #define IRQ_PG12 99 102 - #define IRQ_PG13 100 103 - #define IRQ_PG14 101 104 - #define IRQ_PG15 102 118 + #define IRQ_PG0 87 119 + #define IRQ_PG1 88 120 + #define IRQ_PG2 89 121 + #define IRQ_PG3 90 122 + #define IRQ_PG4 91 123 + #define IRQ_PG5 92 124 + #define IRQ_PG6 93 125 + #define IRQ_PG7 94 126 + #define IRQ_PG8 95 127 + #define IRQ_PG9 96 128 + #define IRQ_PG10 97 129 + #define IRQ_PG11 98 130 + #define IRQ_PG12 99 131 + #define IRQ_PG13 100 132 + #define IRQ_PG14 101 133 + #define IRQ_PG15 102 105 134 106 - #define IRQ_PH0 103 107 - #define IRQ_PH1 104 108 - #define IRQ_PH2 105 109 - #define IRQ_PH3 106 110 - #define IRQ_PH4 107 111 - #define IRQ_PH5 108 112 - #define IRQ_PH6 109 113 - #define IRQ_PH7 110 114 - #define IRQ_PH8 111 115 - #define IRQ_PH9 112 116 - #define IRQ_PH10 113 117 - #define IRQ_PH11 114 118 - #define IRQ_PH12 115 119 - #define IRQ_PH13 116 120 - #define IRQ_PH14 117 121 - #define IRQ_PH15 118 135 + #define IRQ_PH0 103 136 + #define IRQ_PH1 104 137 + #define IRQ_PH2 105 138 + #define IRQ_PH3 106 139 + #define IRQ_PH4 107 140 + #define IRQ_PH5 108 141 + #define IRQ_PH6 109 142 + #define IRQ_PH7 110 143 + #define IRQ_PH8 111 144 + #define IRQ_PH9 112 145 + #define IRQ_PH10 113 146 + #define IRQ_PH11 114 147 + #define IRQ_PH12 115 148 + #define IRQ_PH13 116 149 + #define IRQ_PH14 117 150 + #define IRQ_PH15 118 122 151 123 - #define GPIO_IRQ_BASE IRQ_PF0 152 + #define GPIO_IRQ_BASE IRQ_PF0 124 153 125 - #define IRQ_MAC_PHYINT 119 /* PHY_INT Interrupt */ 126 - #define IRQ_MAC_MMCINT 120 /* MMC Counter Interrupt */ 127 - #define IRQ_MAC_RXFSINT 121 /* RX Frame-Status Interrupt */ 128 - #define IRQ_MAC_TXFSINT 122 /* TX Frame-Status Interrupt */ 129 - #define IRQ_MAC_WAKEDET 123 /* Wake-Up Interrupt */ 130 - #define IRQ_MAC_RXDMAERR 124 /* RX DMA Direction Error Interrupt */ 131 - #define IRQ_MAC_TXDMAERR 125 /* TX DMA Direction Error Interrupt */ 132 - #define IRQ_MAC_STMDONE 126 /* Station Mgt. Transfer Done Interrupt */ 154 + #define IRQ_MAC_PHYINT 119 /* PHY_INT Interrupt */ 155 + #define IRQ_MAC_MMCINT 120 /* MMC Counter Interrupt */ 156 + #define IRQ_MAC_RXFSINT 121 /* RX Frame-Status Interrupt */ 157 + #define IRQ_MAC_TXFSINT 122 /* TX Frame-Status Interrupt */ 158 + #define IRQ_MAC_WAKEDET 123 /* Wake-Up Interrupt */ 159 + #define IRQ_MAC_RXDMAERR 124 /* RX DMA Direction Error Interrupt */ 160 + #define IRQ_MAC_TXDMAERR 125 /* TX DMA Direction Error Interrupt */ 161 + #define IRQ_MAC_STMDONE 126 /* Station Mgt. Transfer Done Interrupt */ 133 162 134 - #define NR_MACH_IRQS (IRQ_MAC_STMDONE + 1) 135 - #define NR_IRQS (NR_MACH_IRQS + NR_SPARE_IRQS) 136 - 137 - #define IVG7 7 138 - #define IVG8 8 139 - #define IVG9 9 140 - #define IVG10 10 141 - #define IVG11 11 142 - #define IVG12 12 143 - #define IVG13 13 144 - #define IVG14 14 145 - #define IVG15 15 163 + #define NR_MACH_IRQS (IRQ_MAC_STMDONE + 1) 146 164 147 165 /* IAR0 BIT FIELDS */ 148 166 #define IRQ_PLL_WAKEUP_POS 0 149 167 #define IRQ_DMA0_ERROR_POS 4 150 - #define IRQ_DMAR0_BLK_POS 8 151 - #define IRQ_DMAR1_BLK_POS 12 152 - #define IRQ_DMAR0_OVR_POS 16 153 - #define IRQ_DMAR1_OVR_POS 20 154 - #define IRQ_PPI_ERROR_POS 24 155 - #define IRQ_MAC_ERROR_POS 28 168 + #define IRQ_DMAR0_BLK_POS 8 169 + #define IRQ_DMAR1_BLK_POS 12 170 + #define IRQ_DMAR0_OVR_POS 16 171 + #define IRQ_DMAR1_OVR_POS 20 172 + #define IRQ_PPI_ERROR_POS 24 173 + #define IRQ_MAC_ERROR_POS 28 156 174 157 175 /* IAR1 BIT FIELDS */ 158 176 #define IRQ_SPORT0_ERROR_POS 0 159 177 #define IRQ_SPORT1_ERROR_POS 4 160 - #define IRQ_UART0_ERROR_POS 16 161 - #define IRQ_UART1_ERROR_POS 20 162 - #define IRQ_RTC_POS 24 163 - #define IRQ_PPI_POS 28 178 + #define IRQ_UART0_ERROR_POS 16 179 + #define IRQ_UART1_ERROR_POS 20 180 + #define IRQ_RTC_POS 24 181 + #define IRQ_PPI_POS 28 164 182 165 183 /* IAR2 BIT FIELDS */ 166 184 #define IRQ_SPORT0_RX_POS 0 167 185 #define IRQ_SPORT0_TX_POS 4 168 186 #define IRQ_SPORT1_RX_POS 8 169 187 #define IRQ_SPORT1_TX_POS 12 170 - #define IRQ_TWI_POS 16 171 - #define IRQ_SPI_POS 20 172 - #define IRQ_UART0_RX_POS 24 173 - #define IRQ_UART0_TX_POS 28 188 + #define IRQ_TWI_POS 16 189 + #define IRQ_SPI_POS 20 190 + #define IRQ_UART0_RX_POS 24 191 + #define IRQ_UART0_TX_POS 28 174 192 175 193 /* IAR3 BIT FIELDS */ 176 - #define IRQ_UART1_RX_POS 0 177 - #define IRQ_UART1_TX_POS 4 178 - #define IRQ_OPTSEC_POS 8 179 - #define IRQ_CNT_POS 12 180 - #define IRQ_MAC_RX_POS 16 194 + #define IRQ_UART1_RX_POS 0 195 + #define IRQ_UART1_TX_POS 4 196 + #define IRQ_OPTSEC_POS 8 197 + #define IRQ_CNT_POS 12 198 + #define IRQ_MAC_RX_POS 16 181 199 #define IRQ_PORTH_INTA_POS 20 182 - #define IRQ_MAC_TX_POS 24 200 + #define IRQ_MAC_TX_POS 24 183 201 #define IRQ_PORTH_INTB_POS 28 184 202 185 203 /* IAR4 BIT FIELDS */ ··· 184 224 /* IAR5 BIT FIELDS */ 185 225 #define IRQ_PORTG_INTA_POS 0 186 226 #define IRQ_PORTG_INTB_POS 4 187 - #define IRQ_MEM_DMA0_POS 8 188 - #define IRQ_MEM_DMA1_POS 12 189 - #define IRQ_WATCH_POS 16 227 + #define IRQ_MEM_DMA0_POS 8 228 + #define IRQ_MEM_DMA1_POS 12 229 + #define IRQ_WATCH_POS 16 190 230 #define IRQ_PORTF_INTA_POS 20 191 231 #define IRQ_PORTF_INTB_POS 24 192 - #define IRQ_SPI_ERROR_POS 28 232 + #define IRQ_SPI_ERROR_POS 28 193 233 194 234 /* IAR6 BIT FIELDS */ 195 - #define IRQ_NFC_ERROR_POS 0 196 - #define IRQ_HDMA_ERROR_POS 4 197 - #define IRQ_HDMA_POS 8 198 - #define IRQ_USB_EINT_POS 12 199 - #define IRQ_USB_INT0_POS 16 200 - #define IRQ_USB_INT1_POS 20 201 - #define IRQ_USB_INT2_POS 24 202 - #define IRQ_USB_DMA_POS 28 235 + #define IRQ_NFC_ERROR_POS 0 236 + #define IRQ_HDMA_ERROR_POS 4 237 + #define IRQ_HDMA_POS 8 238 + #define IRQ_USB_EINT_POS 12 239 + #define IRQ_USB_INT0_POS 16 240 + #define IRQ_USB_INT1_POS 20 241 + #define IRQ_USB_INT2_POS 24 242 + #define IRQ_USB_DMA_POS 28 203 243 204 - #endif /* _BF527_IRQ_H_ */ 244 + #endif
+9 -2
arch/blackfin/mach-bf533/include/mach/anomaly.h
··· 5 5 * and can be replaced with that version at any time 6 6 * DO NOT EDIT THIS FILE 7 7 * 8 - * Copyright 2004-2010 Analog Devices Inc. 8 + * Copyright 2004-2011 Analog Devices Inc. 9 9 * Licensed under the ADI BSD license. 10 10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd 11 11 */ 12 12 13 13 /* This file should be up to date with: 14 - * - Revision E, 09/18/2008; ADSP-BF531/BF532/BF533 Blackfin Processor Anomaly List 14 + * - Revision F, 05/25/2010; ADSP-BF531/BF532/BF533 Blackfin Processor Anomaly List 15 15 */ 16 16 17 17 #ifndef _MACH_ANOMALY_H_ ··· 206 206 #define ANOMALY_05000443 (1) 207 207 /* False Hardware Error when RETI Points to Invalid Memory */ 208 208 #define ANOMALY_05000461 (1) 209 + /* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */ 210 + #define ANOMALY_05000462 (1) 211 + /* Boot Failure When SDRAM Control Signals Toggle Coming Out Of Reset */ 212 + #define ANOMALY_05000471 (1) 209 213 /* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */ 210 214 #define ANOMALY_05000473 (1) 211 215 /* Possible Lockup Condition whem Modifying PLL from External Memory */ ··· 355 351 #define ANOMALY_05000362 (1) 356 352 #define ANOMALY_05000364 (0) 357 353 #define ANOMALY_05000380 (0) 354 + #define ANOMALY_05000383 (0) 358 355 #define ANOMALY_05000386 (1) 359 356 #define ANOMALY_05000389 (0) 360 357 #define ANOMALY_05000412 (0) 361 358 #define ANOMALY_05000430 (0) 362 359 #define ANOMALY_05000432 (0) 363 360 #define ANOMALY_05000435 (0) 361 + #define ANOMALY_05000440 (0) 364 362 #define ANOMALY_05000447 (0) 365 363 #define ANOMALY_05000448 (0) 366 364 #define ANOMALY_05000456 (0) ··· 370 364 #define ANOMALY_05000465 (0) 371 365 #define ANOMALY_05000467 (0) 372 366 #define ANOMALY_05000474 (0) 367 + #define ANOMALY_05000480 (0) 373 368 #define ANOMALY_05000485 (0) 374 369 375 370 #endif
+55 -113
arch/blackfin/mach-bf533/include/mach/irq.h
··· 7 7 #ifndef _BF533_IRQ_H_ 8 8 #define _BF533_IRQ_H_ 9 9 10 - /* 11 - * Interrupt source definitions 12 - Event Source Core Event Name 13 - Core Emulation ** 14 - Events (highest priority) EMU 0 15 - Reset RST 1 16 - NMI NMI 2 17 - Exception EVX 3 18 - Reserved -- 4 19 - Hardware Error IVHW 5 20 - Core Timer IVTMR 6 * 21 - PLL Wakeup Interrupt IVG7 7 22 - DMA Error (generic) IVG7 8 23 - PPI Error Interrupt IVG7 9 24 - SPORT0 Error Interrupt IVG7 10 25 - SPORT1 Error Interrupt IVG7 11 26 - SPI Error Interrupt IVG7 12 27 - UART Error Interrupt IVG7 13 28 - RTC Interrupt IVG8 14 29 - DMA0 Interrupt (PPI) IVG8 15 30 - DMA1 (SPORT0 RX) IVG9 16 31 - DMA2 (SPORT0 TX) IVG9 17 32 - DMA3 (SPORT1 RX) IVG9 18 33 - DMA4 (SPORT1 TX) IVG9 19 34 - DMA5 (PPI) IVG10 20 35 - DMA6 (UART RX) IVG10 21 36 - DMA7 (UART TX) IVG10 22 37 - Timer0 IVG11 23 38 - Timer1 IVG11 24 39 - Timer2 IVG11 25 40 - PF Interrupt A IVG12 26 41 - PF Interrupt B IVG12 27 42 - DMA8/9 Interrupt IVG13 28 43 - DMA10/11 Interrupt IVG13 29 44 - Watchdog Timer IVG13 30 10 + #include <mach-common/irq.h> 45 11 46 - Softirq IVG14 31 47 - System Call -- 48 - (lowest priority) IVG15 32 * 49 - */ 50 - #define SYS_IRQS 31 51 - #define NR_PERI_INTS 24 12 + #define NR_PERI_INTS 24 52 13 53 - /* The ABSTRACT IRQ definitions */ 54 - /** the first seven of the following are fixed, the rest you change if you need to **/ 55 - #define IRQ_EMU 0 /*Emulation */ 56 - #define IRQ_RST 1 /*reset */ 57 - #define IRQ_NMI 2 /*Non Maskable */ 58 - #define IRQ_EVX 3 /*Exception */ 59 - #define IRQ_UNUSED 4 /*- unused interrupt*/ 60 - #define IRQ_HWERR 5 /*Hardware Error */ 61 - #define IRQ_CORETMR 6 /*Core timer */ 14 + #define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */ 15 + #define IRQ_DMA_ERROR BFIN_IRQ(1) /* DMA Error (general) */ 16 + #define IRQ_PPI_ERROR BFIN_IRQ(2) /* PPI Error Interrupt */ 17 + #define IRQ_SPORT0_ERROR BFIN_IRQ(3) /* SPORT0 Error Interrupt */ 18 + #define IRQ_SPORT1_ERROR BFIN_IRQ(4) /* SPORT1 Error Interrupt */ 19 + #define IRQ_SPI_ERROR BFIN_IRQ(5) /* SPI Error Interrupt */ 20 + #define IRQ_UART0_ERROR BFIN_IRQ(6) /* UART Error Interrupt */ 21 + #define IRQ_RTC BFIN_IRQ(7) /* RTC Interrupt */ 22 + #define IRQ_PPI BFIN_IRQ(8) /* DMA0 Interrupt (PPI) */ 23 + #define IRQ_SPORT0_RX BFIN_IRQ(9) /* DMA1 Interrupt (SPORT0 RX) */ 24 + #define IRQ_SPORT0_TX BFIN_IRQ(10) /* DMA2 Interrupt (SPORT0 TX) */ 25 + #define IRQ_SPORT1_RX BFIN_IRQ(11) /* DMA3 Interrupt (SPORT1 RX) */ 26 + #define IRQ_SPORT1_TX BFIN_IRQ(12) /* DMA4 Interrupt (SPORT1 TX) */ 27 + #define IRQ_SPI BFIN_IRQ(13) /* DMA5 Interrupt (SPI) */ 28 + #define IRQ_UART0_RX BFIN_IRQ(14) /* DMA6 Interrupt (UART RX) */ 29 + #define IRQ_UART0_TX BFIN_IRQ(15) /* DMA7 Interrupt (UART TX) */ 30 + #define IRQ_TIMER0 BFIN_IRQ(16) /* Timer 0 */ 31 + #define IRQ_TIMER1 BFIN_IRQ(17) /* Timer 1 */ 32 + #define IRQ_TIMER2 BFIN_IRQ(18) /* Timer 2 */ 33 + #define IRQ_PROG_INTA BFIN_IRQ(19) /* Programmable Flags A (8) */ 34 + #define IRQ_PROG_INTB BFIN_IRQ(20) /* Programmable Flags B (8) */ 35 + #define IRQ_MEM_DMA0 BFIN_IRQ(21) /* DMA8/9 Interrupt (Memory DMA Stream 0) */ 36 + #define IRQ_MEM_DMA1 BFIN_IRQ(22) /* DMA10/11 Interrupt (Memory DMA Stream 1) */ 37 + #define IRQ_WATCH BFIN_IRQ(23) /* Watch Dog Timer */ 62 38 63 - #define IRQ_PLL_WAKEUP 7 /*PLL Wakeup Interrupt */ 64 - #define IRQ_DMA_ERROR 8 /*DMA Error (general) */ 65 - #define IRQ_PPI_ERROR 9 /*PPI Error Interrupt */ 66 - #define IRQ_SPORT0_ERROR 10 /*SPORT0 Error Interrupt */ 67 - #define IRQ_SPORT1_ERROR 11 /*SPORT1 Error Interrupt */ 68 - #define IRQ_SPI_ERROR 12 /*SPI Error Interrupt */ 69 - #define IRQ_UART0_ERROR 13 /*UART Error Interrupt */ 70 - #define IRQ_RTC 14 /*RTC Interrupt */ 71 - #define IRQ_PPI 15 /*DMA0 Interrupt (PPI) */ 72 - #define IRQ_SPORT0_RX 16 /*DMA1 Interrupt (SPORT0 RX) */ 73 - #define IRQ_SPORT0_TX 17 /*DMA2 Interrupt (SPORT0 TX) */ 74 - #define IRQ_SPORT1_RX 18 /*DMA3 Interrupt (SPORT1 RX) */ 75 - #define IRQ_SPORT1_TX 19 /*DMA4 Interrupt (SPORT1 TX) */ 76 - #define IRQ_SPI 20 /*DMA5 Interrupt (SPI) */ 77 - #define IRQ_UART0_RX 21 /*DMA6 Interrupt (UART RX) */ 78 - #define IRQ_UART0_TX 22 /*DMA7 Interrupt (UART TX) */ 79 - #define IRQ_TIMER0 23 /*Timer 0 */ 80 - #define IRQ_TIMER1 24 /*Timer 1 */ 81 - #define IRQ_TIMER2 25 /*Timer 2 */ 82 - #define IRQ_PROG_INTA 26 /*Programmable Flags A (8) */ 83 - #define IRQ_PROG_INTB 27 /*Programmable Flags B (8) */ 84 - #define IRQ_MEM_DMA0 28 /*DMA8/9 Interrupt (Memory DMA Stream 0) */ 85 - #define IRQ_MEM_DMA1 29 /*DMA10/11 Interrupt (Memory DMA Stream 1) */ 86 - #define IRQ_WATCH 30 /*Watch Dog Timer */ 39 + #define SYS_IRQS 31 87 40 88 41 #define IRQ_PF0 33 89 42 #define IRQ_PF1 34 ··· 58 105 #define GPIO_IRQ_BASE IRQ_PF0 59 106 60 107 #define NR_MACH_IRQS (IRQ_PF15 + 1) 61 - #define NR_IRQS (NR_MACH_IRQS + NR_SPARE_IRQS) 62 108 63 - #define IVG7 7 64 - #define IVG8 8 65 - #define IVG9 9 66 - #define IVG10 10 67 - #define IVG11 11 68 - #define IVG12 12 69 - #define IVG13 13 70 - #define IVG14 14 71 - #define IVG15 15 109 + /* IAR0 BIT FIELDS */ 110 + #define RTC_ERROR_POS 28 111 + #define UART_ERROR_POS 24 112 + #define SPORT1_ERROR_POS 20 113 + #define SPI_ERROR_POS 16 114 + #define SPORT0_ERROR_POS 12 115 + #define PPI_ERROR_POS 8 116 + #define DMA_ERROR_POS 4 117 + #define PLLWAKE_ERROR_POS 0 72 118 73 - /* IAR0 BIT FIELDS*/ 74 - #define RTC_ERROR_POS 28 75 - #define UART_ERROR_POS 24 76 - #define SPORT1_ERROR_POS 20 77 - #define SPI_ERROR_POS 16 78 - #define SPORT0_ERROR_POS 12 79 - #define PPI_ERROR_POS 8 80 - #define DMA_ERROR_POS 4 81 - #define PLLWAKE_ERROR_POS 0 119 + /* IAR1 BIT FIELDS */ 120 + #define DMA7_UARTTX_POS 28 121 + #define DMA6_UARTRX_POS 24 122 + #define DMA5_SPI_POS 20 123 + #define DMA4_SPORT1TX_POS 16 124 + #define DMA3_SPORT1RX_POS 12 125 + #define DMA2_SPORT0TX_POS 8 126 + #define DMA1_SPORT0RX_POS 4 127 + #define DMA0_PPI_POS 0 82 128 83 - /* IAR1 BIT FIELDS*/ 84 - #define DMA7_UARTTX_POS 28 85 - #define DMA6_UARTRX_POS 24 86 - #define DMA5_SPI_POS 20 87 - #define DMA4_SPORT1TX_POS 16 88 - #define DMA3_SPORT1RX_POS 12 89 - #define DMA2_SPORT0TX_POS 8 90 - #define DMA1_SPORT0RX_POS 4 91 - #define DMA0_PPI_POS 0 129 + /* IAR2 BIT FIELDS */ 130 + #define WDTIMER_POS 28 131 + #define MEMDMA1_POS 24 132 + #define MEMDMA0_POS 20 133 + #define PFB_POS 16 134 + #define PFA_POS 12 135 + #define TIMER2_POS 8 136 + #define TIMER1_POS 4 137 + #define TIMER0_POS 0 92 138 93 - /* IAR2 BIT FIELDS*/ 94 - #define WDTIMER_POS 28 95 - #define MEMDMA1_POS 24 96 - #define MEMDMA0_POS 20 97 - #define PFB_POS 16 98 - #define PFA_POS 12 99 - #define TIMER2_POS 8 100 - #define TIMER1_POS 4 101 - #define TIMER0_POS 0 102 - 103 - #endif /* _BF533_IRQ_H_ */ 139 + #endif
+97 -9
arch/blackfin/mach-bf537/boards/stamp.c
··· 35 35 #include <asm/reboot.h> 36 36 #include <asm/portmux.h> 37 37 #include <asm/dpmc.h> 38 + #include <asm/bfin_sport.h> 38 39 #ifdef CONFIG_REGULATOR_FIXED_VOLTAGE 39 40 #include <linux/regulator/fixed.h> 40 41 #endif ··· 2586 2585 }, 2587 2586 }; 2588 2587 2589 - #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 2588 + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 2589 + defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \ 2590 + defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2591 + 2592 + #define SPORT_REQ(x) \ 2593 + [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \ 2594 + P_SPORT##x##_RFS, P_SPORT##x##_DRPRI, P_SPORT##x##_RSCLK, 0} 2595 + 2596 + static const u16 bfin_snd_pin[][7] = { 2597 + SPORT_REQ(0), 2598 + SPORT_REQ(1), 2599 + }; 2600 + 2601 + static struct bfin_snd_platform_data bfin_snd_data[] = { 2602 + { 2603 + .pin_req = &bfin_snd_pin[0][0], 2604 + }, 2605 + { 2606 + .pin_req = &bfin_snd_pin[1][0], 2607 + }, 2608 + }; 2609 + 2610 + #define BFIN_SND_RES(x) \ 2611 + [x] = { \ 2612 + { \ 2613 + .start = SPORT##x##_TCR1, \ 2614 + .end = SPORT##x##_TCR1, \ 2615 + .flags = IORESOURCE_MEM \ 2616 + }, \ 2617 + { \ 2618 + .start = CH_SPORT##x##_RX, \ 2619 + .end = CH_SPORT##x##_RX, \ 2620 + .flags = IORESOURCE_DMA, \ 2621 + }, \ 2622 + { \ 2623 + .start = CH_SPORT##x##_TX, \ 2624 + .end = CH_SPORT##x##_TX, \ 2625 + .flags = IORESOURCE_DMA, \ 2626 + }, \ 2627 + { \ 2628 + .start = IRQ_SPORT##x##_ERROR, \ 2629 + .end = IRQ_SPORT##x##_ERROR, \ 2630 + .flags = IORESOURCE_IRQ, \ 2631 + } \ 2632 + } 2633 + 2634 + static struct resource bfin_snd_resources[][4] = { 2635 + BFIN_SND_RES(0), 2636 + BFIN_SND_RES(1), 2637 + }; 2638 + 2639 + static struct platform_device bfin_pcm = { 2640 + .name = "bfin-pcm-audio", 2641 + .id = -1, 2642 + }; 2643 + #endif 2644 + 2645 + #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE) 2646 + static struct platform_device bfin_ad73311_codec_device = { 2647 + .name = "ad73311", 2648 + .id = -1, 2649 + }; 2650 + #endif 2651 + 2652 + #if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) 2590 2653 static struct platform_device bfin_i2s = { 2591 2654 .name = "bfin-i2s", 2592 2655 .id = CONFIG_SND_BF5XX_SPORT_NUM, 2593 - /* TODO: add platform data here */ 2656 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 2657 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 2658 + .dev = { 2659 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 2660 + }, 2594 2661 }; 2595 2662 #endif 2596 2663 2597 - #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) 2664 + #if defined(CONFIG_SND_BF5XX_SOC_TDM) || defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE) 2598 2665 static struct platform_device bfin_tdm = { 2599 2666 .name = "bfin-tdm", 2600 2667 .id = CONFIG_SND_BF5XX_SPORT_NUM, 2601 - /* TODO: add platform data here */ 2668 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 2669 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 2670 + .dev = { 2671 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 2672 + }, 2602 2673 }; 2603 2674 #endif 2604 2675 2605 - #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2676 + #if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) 2606 2677 static struct platform_device bfin_ac97 = { 2607 2678 .name = "bfin-ac97", 2608 2679 .id = CONFIG_SND_BF5XX_SPORT_NUM, 2609 - /* TODO: add platform data here */ 2680 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 2681 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 2682 + .dev = { 2683 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 2684 + }, 2610 2685 }; 2611 2686 #endif 2612 2687 ··· 2873 2796 &stamp_flash_device, 2874 2797 #endif 2875 2798 2876 - #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 2799 + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 2800 + defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \ 2801 + defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2802 + &bfin_pcm, 2803 + #endif 2804 + 2805 + #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE) 2806 + &bfin_ad73311_codec_device, 2807 + #endif 2808 + 2809 + #if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) 2877 2810 &bfin_i2s, 2878 2811 #endif 2879 2812 2880 - #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) 2813 + #if defined(CONFIG_SND_BF5XX_SOC_TDM) || defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE) 2881 2814 &bfin_tdm, 2882 2815 #endif 2883 2816 2884 - #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2817 + #if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) 2885 2818 &bfin_ac97, 2886 2819 #endif 2820 + 2887 2821 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE) 2888 2822 #if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \ 2889 2823 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
+8 -2
arch/blackfin/mach-bf537/include/mach/anomaly.h
··· 5 5 * and can be replaced with that version at any time 6 6 * DO NOT EDIT THIS FILE 7 7 * 8 - * Copyright 2004-2010 Analog Devices Inc. 8 + * Copyright 2004-2011 Analog Devices Inc. 9 9 * Licensed under the ADI BSD license. 10 10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd 11 11 */ 12 12 13 13 /* This file should be up to date with: 14 - * - Revision D, 09/18/2008; ADSP-BF534/ADSP-BF536/ADSP-BF537 Blackfin Processor Anomaly List 14 + * - Revision E, 05/25/2010; ADSP-BF534/ADSP-BF536/ADSP-BF537 Blackfin Processor Anomaly List 15 15 */ 16 16 17 17 #ifndef _MACH_ANOMALY_H_ ··· 160 160 #define ANOMALY_05000443 (1) 161 161 /* False Hardware Error when RETI Points to Invalid Memory */ 162 162 #define ANOMALY_05000461 (1) 163 + /* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */ 164 + #define ANOMALY_05000462 (1) 163 165 /* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */ 164 166 #define ANOMALY_05000473 (1) 165 167 /* Possible Lockup Condition whem Modifying PLL from External Memory */ 166 168 #define ANOMALY_05000475 (1) 167 169 /* TESTSET Instruction Cannot Be Interrupted */ 168 170 #define ANOMALY_05000477 (1) 171 + /* Multiple Simultaneous Urgent DMA Requests May Cause DMA System Instability */ 172 + #define ANOMALY_05000480 (__SILICON_REVISION__ < 3) 169 173 /* Reads of ITEST_COMMAND and ITEST_DATA Registers Cause Cache Corruption */ 170 174 #define ANOMALY_05000481 (1) 171 175 /* IFLUSH sucks at life */ ··· 208 204 #define ANOMALY_05000363 (0) 209 205 #define ANOMALY_05000364 (0) 210 206 #define ANOMALY_05000380 (0) 207 + #define ANOMALY_05000383 (0) 211 208 #define ANOMALY_05000386 (1) 212 209 #define ANOMALY_05000389 (0) 213 210 #define ANOMALY_05000400 (0) ··· 216 211 #define ANOMALY_05000430 (0) 217 212 #define ANOMALY_05000432 (0) 218 213 #define ANOMALY_05000435 (0) 214 + #define ANOMALY_05000440 (0) 219 215 #define ANOMALY_05000447 (0) 220 216 #define ANOMALY_05000448 (0) 221 217 #define ANOMALY_05000456 (0)
+159 -174
arch/blackfin/mach-bf537/include/mach/irq.h
··· 7 7 #ifndef _BF537_IRQ_H_ 8 8 #define _BF537_IRQ_H_ 9 9 10 - /* 11 - * Interrupt source definitions 12 - * Event Source Core Event Name 13 - * Core Emulation ** 14 - * Events (highest priority) EMU 0 15 - * Reset RST 1 16 - * NMI NMI 2 17 - * Exception EVX 3 18 - * Reserved -- 4 19 - * Hardware Error IVHW 5 20 - * Core Timer IVTMR 6 21 - * ..... 22 - * 23 - * Softirq IVG14 24 - * System Call -- 25 - * (lowest priority) IVG15 26 - */ 10 + #include <mach-common/irq.h> 27 11 28 - #define SYS_IRQS 39 29 - #define NR_PERI_INTS 32 12 + #define NR_PERI_INTS 32 30 13 31 - /* The ABSTRACT IRQ definitions */ 32 - /** the first seven of the following are fixed, the rest you change if you need to **/ 33 - #define IRQ_EMU 0 /*Emulation */ 34 - #define IRQ_RST 1 /*reset */ 35 - #define IRQ_NMI 2 /*Non Maskable */ 36 - #define IRQ_EVX 3 /*Exception */ 37 - #define IRQ_UNUSED 4 /*- unused interrupt*/ 38 - #define IRQ_HWERR 5 /*Hardware Error */ 39 - #define IRQ_CORETMR 6 /*Core timer */ 14 + #define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */ 15 + #define IRQ_DMA_ERROR BFIN_IRQ(1) /* DMA Error (general) */ 16 + #define IRQ_GENERIC_ERROR BFIN_IRQ(2) /* GENERIC Error Interrupt */ 17 + #define IRQ_RTC BFIN_IRQ(3) /* RTC Interrupt */ 18 + #define IRQ_PPI BFIN_IRQ(4) /* DMA0 Interrupt (PPI) */ 19 + #define IRQ_SPORT0_RX BFIN_IRQ(5) /* DMA3 Interrupt (SPORT0 RX) */ 20 + #define IRQ_SPORT0_TX BFIN_IRQ(6) /* DMA4 Interrupt (SPORT0 TX) */ 21 + #define IRQ_SPORT1_RX BFIN_IRQ(7) /* DMA5 Interrupt (SPORT1 RX) */ 22 + #define IRQ_SPORT1_TX BFIN_IRQ(8) /* DMA6 Interrupt (SPORT1 TX) */ 23 + #define IRQ_TWI BFIN_IRQ(9) /* TWI Interrupt */ 24 + #define IRQ_SPI BFIN_IRQ(10) /* DMA7 Interrupt (SPI) */ 25 + #define IRQ_UART0_RX BFIN_IRQ(11) /* DMA8 Interrupt (UART0 RX) */ 26 + #define IRQ_UART0_TX BFIN_IRQ(12) /* DMA9 Interrupt (UART0 TX) */ 27 + #define IRQ_UART1_RX BFIN_IRQ(13) /* DMA10 Interrupt (UART1 RX) */ 28 + #define IRQ_UART1_TX BFIN_IRQ(14) /* DMA11 Interrupt (UART1 TX) */ 29 + #define IRQ_CAN_RX BFIN_IRQ(15) /* CAN Receive Interrupt */ 30 + #define IRQ_CAN_TX BFIN_IRQ(16) /* CAN Transmit Interrupt */ 31 + #define IRQ_PH_INTA_MAC_RX BFIN_IRQ(17) /* Port H Interrupt A & DMA1 Interrupt (Ethernet RX) */ 32 + #define IRQ_PH_INTB_MAC_TX BFIN_IRQ(18) /* Port H Interrupt B & DMA2 Interrupt (Ethernet TX) */ 33 + #define IRQ_TIMER0 BFIN_IRQ(19) /* Timer 0 */ 34 + #define IRQ_TIMER1 BFIN_IRQ(20) /* Timer 1 */ 35 + #define IRQ_TIMER2 BFIN_IRQ(21) /* Timer 2 */ 36 + #define IRQ_TIMER3 BFIN_IRQ(22) /* Timer 3 */ 37 + #define IRQ_TIMER4 BFIN_IRQ(23) /* Timer 4 */ 38 + #define IRQ_TIMER5 BFIN_IRQ(24) /* Timer 5 */ 39 + #define IRQ_TIMER6 BFIN_IRQ(25) /* Timer 6 */ 40 + #define IRQ_TIMER7 BFIN_IRQ(26) /* Timer 7 */ 41 + #define IRQ_PF_INTA_PG_INTA BFIN_IRQ(27) /* Ports F&G Interrupt A */ 42 + #define IRQ_PORTG_INTB BFIN_IRQ(28) /* Port G Interrupt B */ 43 + #define IRQ_MEM_DMA0 BFIN_IRQ(29) /* (Memory DMA Stream 0) */ 44 + #define IRQ_MEM_DMA1 BFIN_IRQ(30) /* (Memory DMA Stream 1) */ 45 + #define IRQ_PF_INTB_WATCH BFIN_IRQ(31) /* Watchdog & Port F Interrupt B */ 40 46 41 - #define IRQ_PLL_WAKEUP 7 /*PLL Wakeup Interrupt */ 42 - #define IRQ_DMA_ERROR 8 /*DMA Error (general) */ 43 - #define IRQ_GENERIC_ERROR 9 /*GENERIC Error Interrupt */ 44 - #define IRQ_RTC 10 /*RTC Interrupt */ 45 - #define IRQ_PPI 11 /*DMA0 Interrupt (PPI) */ 46 - #define IRQ_SPORT0_RX 12 /*DMA3 Interrupt (SPORT0 RX) */ 47 - #define IRQ_SPORT0_TX 13 /*DMA4 Interrupt (SPORT0 TX) */ 48 - #define IRQ_SPORT1_RX 14 /*DMA5 Interrupt (SPORT1 RX) */ 49 - #define IRQ_SPORT1_TX 15 /*DMA6 Interrupt (SPORT1 TX) */ 50 - #define IRQ_TWI 16 /*TWI Interrupt */ 51 - #define IRQ_SPI 17 /*DMA7 Interrupt (SPI) */ 52 - #define IRQ_UART0_RX 18 /*DMA8 Interrupt (UART0 RX) */ 53 - #define IRQ_UART0_TX 19 /*DMA9 Interrupt (UART0 TX) */ 54 - #define IRQ_UART1_RX 20 /*DMA10 Interrupt (UART1 RX) */ 55 - #define IRQ_UART1_TX 21 /*DMA11 Interrupt (UART1 TX) */ 56 - #define IRQ_CAN_RX 22 /*CAN Receive Interrupt */ 57 - #define IRQ_CAN_TX 23 /*CAN Transmit Interrupt */ 58 - #define IRQ_MAC_RX 24 /*DMA1 (Ethernet RX) Interrupt */ 59 - #define IRQ_MAC_TX 25 /*DMA2 (Ethernet TX) Interrupt */ 60 - #define IRQ_TIMER0 26 /*Timer 0 */ 61 - #define IRQ_TIMER1 27 /*Timer 1 */ 62 - #define IRQ_TIMER2 28 /*Timer 2 */ 63 - #define IRQ_TIMER3 29 /*Timer 3 */ 64 - #define IRQ_TIMER4 30 /*Timer 4 */ 65 - #define IRQ_TIMER5 31 /*Timer 5 */ 66 - #define IRQ_TIMER6 32 /*Timer 6 */ 67 - #define IRQ_TIMER7 33 /*Timer 7 */ 68 - #define IRQ_PROG_INTA 34 /* PF Ports F&G (PF15:0) Interrupt A */ 69 - #define IRQ_PORTG_INTB 35 /* PF Port G (PF15:0) Interrupt B */ 70 - #define IRQ_MEM_DMA0 36 /*(Memory DMA Stream 0) */ 71 - #define IRQ_MEM_DMA1 37 /*(Memory DMA Stream 1) */ 72 - #define IRQ_PROG_INTB 38 /* PF Ports F (PF15:0) Interrupt B */ 73 - #define IRQ_WATCH 38 /*Watch Dog Timer */ 47 + #define SYS_IRQS 39 74 48 75 - #define IRQ_PPI_ERROR 42 /*PPI Error Interrupt */ 76 - #define IRQ_CAN_ERROR 43 /*CAN Error Interrupt */ 77 - #define IRQ_MAC_ERROR 44 /*MAC Status/Error Interrupt */ 78 - #define IRQ_SPORT0_ERROR 45 /*SPORT0 Error Interrupt */ 79 - #define IRQ_SPORT1_ERROR 46 /*SPORT1 Error Interrupt */ 80 - #define IRQ_SPI_ERROR 47 /*SPI Error Interrupt */ 81 - #define IRQ_UART0_ERROR 48 /*UART Error Interrupt */ 82 - #define IRQ_UART1_ERROR 49 /*UART Error Interrupt */ 49 + #define IRQ_PPI_ERROR 42 /* PPI Error Interrupt */ 50 + #define IRQ_CAN_ERROR 43 /* CAN Error Interrupt */ 51 + #define IRQ_MAC_ERROR 44 /* MAC Status/Error Interrupt */ 52 + #define IRQ_SPORT0_ERROR 45 /* SPORT0 Error Interrupt */ 53 + #define IRQ_SPORT1_ERROR 46 /* SPORT1 Error Interrupt */ 54 + #define IRQ_SPI_ERROR 47 /* SPI Error Interrupt */ 55 + #define IRQ_UART0_ERROR 48 /* UART Error Interrupt */ 56 + #define IRQ_UART1_ERROR 49 /* UART Error Interrupt */ 83 57 84 - #define IRQ_PF0 50 85 - #define IRQ_PF1 51 86 - #define IRQ_PF2 52 87 - #define IRQ_PF3 53 88 - #define IRQ_PF4 54 89 - #define IRQ_PF5 55 90 - #define IRQ_PF6 56 91 - #define IRQ_PF7 57 92 - #define IRQ_PF8 58 93 - #define IRQ_PF9 59 94 - #define IRQ_PF10 60 95 - #define IRQ_PF11 61 96 - #define IRQ_PF12 62 97 - #define IRQ_PF13 63 98 - #define IRQ_PF14 64 99 - #define IRQ_PF15 65 58 + #define IRQ_PF0 50 59 + #define IRQ_PF1 51 60 + #define IRQ_PF2 52 61 + #define IRQ_PF3 53 62 + #define IRQ_PF4 54 63 + #define IRQ_PF5 55 64 + #define IRQ_PF6 56 65 + #define IRQ_PF7 57 66 + #define IRQ_PF8 58 67 + #define IRQ_PF9 59 68 + #define IRQ_PF10 60 69 + #define IRQ_PF11 61 70 + #define IRQ_PF12 62 71 + #define IRQ_PF13 63 72 + #define IRQ_PF14 64 73 + #define IRQ_PF15 65 100 74 101 - #define IRQ_PG0 66 102 - #define IRQ_PG1 67 103 - #define IRQ_PG2 68 104 - #define IRQ_PG3 69 105 - #define IRQ_PG4 70 106 - #define IRQ_PG5 71 107 - #define IRQ_PG6 72 108 - #define IRQ_PG7 73 109 - #define IRQ_PG8 74 110 - #define IRQ_PG9 75 111 - #define IRQ_PG10 76 112 - #define IRQ_PG11 77 113 - #define IRQ_PG12 78 114 - #define IRQ_PG13 79 115 - #define IRQ_PG14 80 116 - #define IRQ_PG15 81 75 + #define IRQ_PG0 66 76 + #define IRQ_PG1 67 77 + #define IRQ_PG2 68 78 + #define IRQ_PG3 69 79 + #define IRQ_PG4 70 80 + #define IRQ_PG5 71 81 + #define IRQ_PG6 72 82 + #define IRQ_PG7 73 83 + #define IRQ_PG8 74 84 + #define IRQ_PG9 75 85 + #define IRQ_PG10 76 86 + #define IRQ_PG11 77 87 + #define IRQ_PG12 78 88 + #define IRQ_PG13 79 89 + #define IRQ_PG14 80 90 + #define IRQ_PG15 81 117 91 118 - #define IRQ_PH0 82 119 - #define IRQ_PH1 83 120 - #define IRQ_PH2 84 121 - #define IRQ_PH3 85 122 - #define IRQ_PH4 86 123 - #define IRQ_PH5 87 124 - #define IRQ_PH6 88 125 - #define IRQ_PH7 89 126 - #define IRQ_PH8 90 127 - #define IRQ_PH9 91 128 - #define IRQ_PH10 92 129 - #define IRQ_PH11 93 130 - #define IRQ_PH12 94 131 - #define IRQ_PH13 95 132 - #define IRQ_PH14 96 133 - #define IRQ_PH15 97 92 + #define IRQ_PH0 82 93 + #define IRQ_PH1 83 94 + #define IRQ_PH2 84 95 + #define IRQ_PH3 85 96 + #define IRQ_PH4 86 97 + #define IRQ_PH5 87 98 + #define IRQ_PH6 88 99 + #define IRQ_PH7 89 100 + #define IRQ_PH8 90 101 + #define IRQ_PH9 91 102 + #define IRQ_PH10 92 103 + #define IRQ_PH11 93 104 + #define IRQ_PH12 94 105 + #define IRQ_PH13 95 106 + #define IRQ_PH14 96 107 + #define IRQ_PH15 97 134 108 135 - #define GPIO_IRQ_BASE IRQ_PF0 109 + #define GPIO_IRQ_BASE IRQ_PF0 136 110 137 - #define IRQ_MAC_PHYINT 98 /* PHY_INT Interrupt */ 138 - #define IRQ_MAC_MMCINT 99 /* MMC Counter Interrupt */ 139 - #define IRQ_MAC_RXFSINT 100 /* RX Frame-Status Interrupt */ 140 - #define IRQ_MAC_TXFSINT 101 /* TX Frame-Status Interrupt */ 141 - #define IRQ_MAC_WAKEDET 102 /* Wake-Up Interrupt */ 142 - #define IRQ_MAC_RXDMAERR 103 /* RX DMA Direction Error Interrupt */ 143 - #define IRQ_MAC_TXDMAERR 104 /* TX DMA Direction Error Interrupt */ 144 - #define IRQ_MAC_STMDONE 105 /* Station Mgt. Transfer Done Interrupt */ 111 + #define IRQ_MAC_PHYINT 98 /* PHY_INT Interrupt */ 112 + #define IRQ_MAC_MMCINT 99 /* MMC Counter Interrupt */ 113 + #define IRQ_MAC_RXFSINT 100 /* RX Frame-Status Interrupt */ 114 + #define IRQ_MAC_TXFSINT 101 /* TX Frame-Status Interrupt */ 115 + #define IRQ_MAC_WAKEDET 102 /* Wake-Up Interrupt */ 116 + #define IRQ_MAC_RXDMAERR 103 /* RX DMA Direction Error Interrupt */ 117 + #define IRQ_MAC_TXDMAERR 104 /* TX DMA Direction Error Interrupt */ 118 + #define IRQ_MAC_STMDONE 105 /* Station Mgt. Transfer Done Interrupt */ 145 119 146 - #define NR_MACH_IRQS (IRQ_MAC_STMDONE + 1) 147 - #define NR_IRQS (NR_MACH_IRQS + NR_SPARE_IRQS) 120 + #define IRQ_MAC_RX 106 /* DMA1 Interrupt (Ethernet RX) */ 121 + #define IRQ_PORTH_INTA 107 /* Port H Interrupt A */ 148 122 149 - #define IVG7 7 150 - #define IVG8 8 151 - #define IVG9 9 152 - #define IVG10 10 153 - #define IVG11 11 154 - #define IVG12 12 155 - #define IVG13 13 156 - #define IVG14 14 157 - #define IVG15 15 123 + #if 0 /* No Interrupt B support (yet) */ 124 + #define IRQ_MAC_TX 108 /* DMA2 Interrupt (Ethernet TX) */ 125 + #define IRQ_PORTH_INTB 109 /* Port H Interrupt B */ 126 + #else 127 + #define IRQ_MAC_TX IRQ_PH_INTB_MAC_TX 128 + #endif 158 129 159 - /* IAR0 BIT FIELDS*/ 160 - #define IRQ_PLL_WAKEUP_POS 0 161 - #define IRQ_DMA_ERROR_POS 4 162 - #define IRQ_ERROR_POS 8 163 - #define IRQ_RTC_POS 12 164 - #define IRQ_PPI_POS 16 165 - #define IRQ_SPORT0_RX_POS 20 166 - #define IRQ_SPORT0_TX_POS 24 167 - #define IRQ_SPORT1_RX_POS 28 130 + #define IRQ_PORTF_INTA 110 /* Port F Interrupt A */ 131 + #define IRQ_PORTG_INTA 111 /* Port G Interrupt A */ 168 132 169 - /* IAR1 BIT FIELDS*/ 170 - #define IRQ_SPORT1_TX_POS 0 171 - #define IRQ_TWI_POS 4 172 - #define IRQ_SPI_POS 8 173 - #define IRQ_UART0_RX_POS 12 174 - #define IRQ_UART0_TX_POS 16 175 - #define IRQ_UART1_RX_POS 20 176 - #define IRQ_UART1_TX_POS 24 177 - #define IRQ_CAN_RX_POS 28 133 + #if 0 /* No Interrupt B support (yet) */ 134 + #define IRQ_WATCH 112 /* Watchdog Timer */ 135 + #define IRQ_PORTF_INTB 113 /* Port F Interrupt B */ 136 + #else 137 + #define IRQ_WATCH IRQ_PF_INTB_WATCH 138 + #endif 178 139 179 - /* IAR2 BIT FIELDS*/ 180 - #define IRQ_CAN_TX_POS 0 181 - #define IRQ_MAC_RX_POS 4 182 - #define IRQ_MAC_TX_POS 8 183 - #define IRQ_TIMER0_POS 12 184 - #define IRQ_TIMER1_POS 16 185 - #define IRQ_TIMER2_POS 20 186 - #define IRQ_TIMER3_POS 24 187 - #define IRQ_TIMER4_POS 28 140 + #define NR_MACH_IRQS (113 + 1) 188 141 189 - /* IAR3 BIT FIELDS*/ 190 - #define IRQ_TIMER5_POS 0 191 - #define IRQ_TIMER6_POS 4 192 - #define IRQ_TIMER7_POS 8 193 - #define IRQ_PROG_INTA_POS 12 194 - #define IRQ_PORTG_INTB_POS 16 195 - #define IRQ_MEM_DMA0_POS 20 196 - #define IRQ_MEM_DMA1_POS 24 197 - #define IRQ_WATCH_POS 28 142 + /* IAR0 BIT FIELDS */ 143 + #define IRQ_PLL_WAKEUP_POS 0 144 + #define IRQ_DMA_ERROR_POS 4 145 + #define IRQ_ERROR_POS 8 146 + #define IRQ_RTC_POS 12 147 + #define IRQ_PPI_POS 16 148 + #define IRQ_SPORT0_RX_POS 20 149 + #define IRQ_SPORT0_TX_POS 24 150 + #define IRQ_SPORT1_RX_POS 28 198 151 199 - #endif /* _BF537_IRQ_H_ */ 152 + /* IAR1 BIT FIELDS */ 153 + #define IRQ_SPORT1_TX_POS 0 154 + #define IRQ_TWI_POS 4 155 + #define IRQ_SPI_POS 8 156 + #define IRQ_UART0_RX_POS 12 157 + #define IRQ_UART0_TX_POS 16 158 + #define IRQ_UART1_RX_POS 20 159 + #define IRQ_UART1_TX_POS 24 160 + #define IRQ_CAN_RX_POS 28 161 + 162 + /* IAR2 BIT FIELDS */ 163 + #define IRQ_CAN_TX_POS 0 164 + #define IRQ_MAC_RX_POS 4 165 + #define IRQ_MAC_TX_POS 8 166 + #define IRQ_TIMER0_POS 12 167 + #define IRQ_TIMER1_POS 16 168 + #define IRQ_TIMER2_POS 20 169 + #define IRQ_TIMER3_POS 24 170 + #define IRQ_TIMER4_POS 28 171 + 172 + /* IAR3 BIT FIELDS */ 173 + #define IRQ_TIMER5_POS 0 174 + #define IRQ_TIMER6_POS 4 175 + #define IRQ_TIMER7_POS 8 176 + #define IRQ_PROG_INTA_POS 12 177 + #define IRQ_PORTG_INTB_POS 16 178 + #define IRQ_MEM_DMA0_POS 20 179 + #define IRQ_MEM_DMA1_POS 24 180 + #define IRQ_WATCH_POS 28 181 + 182 + #define init_mach_irq init_mach_irq 183 + 184 + #endif
+163
arch/blackfin/mach-bf537/ints-priority.c
··· 10 10 #include <linux/irq.h> 11 11 #include <asm/blackfin.h> 12 12 13 + #include <asm/irq_handler.h> 14 + #include <asm/bfin5xx_spi.h> 15 + #include <asm/bfin_sport.h> 16 + #include <asm/bfin_can.h> 17 + #include <asm/bfin_dma.h> 18 + #include <asm/dpmc.h> 19 + 13 20 void __init program_IAR(void) 14 21 { 15 22 /* Program the IAR0 Register with the configured priority */ ··· 57 50 ((CONFIG_IRQ_WATCH - 7) << IRQ_WATCH_POS)); 58 51 59 52 SSYNC(); 53 + } 54 + 55 + #define SPI_ERR_MASK (BIT_STAT_TXCOL | BIT_STAT_RBSY | BIT_STAT_MODF | BIT_STAT_TXE) /* SPI_STAT */ 56 + #define SPORT_ERR_MASK (ROVF | RUVF | TOVF | TUVF) /* SPORT_STAT */ 57 + #define PPI_ERR_MASK (0xFFFF & ~FLD) /* PPI_STATUS */ 58 + #define EMAC_ERR_MASK (PHYINT | MMCINT | RXFSINT | TXFSINT | WAKEDET | RXDMAERR | TXDMAERR | STMDONE) /* EMAC_SYSTAT */ 59 + #define UART_ERR_MASK (0x6) /* UART_IIR */ 60 + #define CAN_ERR_MASK (EWTIF | EWRIF | EPIF | BOIF | WUIF | UIAIF | AAIF | RMLIF | UCEIF | EXTIF | ADIF) /* CAN_GIF */ 61 + 62 + static int error_int_mask; 63 + 64 + static void bf537_generic_error_mask_irq(struct irq_data *d) 65 + { 66 + error_int_mask &= ~(1L << (d->irq - IRQ_PPI_ERROR)); 67 + if (!error_int_mask) 68 + bfin_internal_mask_irq(IRQ_GENERIC_ERROR); 69 + } 70 + 71 + static void bf537_generic_error_unmask_irq(struct irq_data *d) 72 + { 73 + bfin_internal_unmask_irq(IRQ_GENERIC_ERROR); 74 + error_int_mask |= 1L << (d->irq - IRQ_PPI_ERROR); 75 + } 76 + 77 + static struct irq_chip bf537_generic_error_irqchip = { 78 + .name = "ERROR", 79 + .irq_ack = bfin_ack_noop, 80 + .irq_mask_ack = bf537_generic_error_mask_irq, 81 + .irq_mask = bf537_generic_error_mask_irq, 82 + .irq_unmask = bf537_generic_error_unmask_irq, 83 + }; 84 + 85 + static void bf537_demux_error_irq(unsigned int int_err_irq, 86 + struct irq_desc *inta_desc) 87 + { 88 + int irq = 0; 89 + 90 + #if (defined(CONFIG_BF537) || defined(CONFIG_BF536)) 91 + if (bfin_read_EMAC_SYSTAT() & EMAC_ERR_MASK) 92 + irq = IRQ_MAC_ERROR; 93 + else 94 + #endif 95 + if (bfin_read_SPORT0_STAT() & SPORT_ERR_MASK) 96 + irq = IRQ_SPORT0_ERROR; 97 + else if (bfin_read_SPORT1_STAT() & SPORT_ERR_MASK) 98 + irq = IRQ_SPORT1_ERROR; 99 + else if (bfin_read_PPI_STATUS() & PPI_ERR_MASK) 100 + irq = IRQ_PPI_ERROR; 101 + else if (bfin_read_CAN_GIF() & CAN_ERR_MASK) 102 + irq = IRQ_CAN_ERROR; 103 + else if (bfin_read_SPI_STAT() & SPI_ERR_MASK) 104 + irq = IRQ_SPI_ERROR; 105 + else if ((bfin_read_UART0_IIR() & UART_ERR_MASK) == UART_ERR_MASK) 106 + irq = IRQ_UART0_ERROR; 107 + else if ((bfin_read_UART1_IIR() & UART_ERR_MASK) == UART_ERR_MASK) 108 + irq = IRQ_UART1_ERROR; 109 + 110 + if (irq) { 111 + if (error_int_mask & (1L << (irq - IRQ_PPI_ERROR))) 112 + bfin_handle_irq(irq); 113 + else { 114 + 115 + switch (irq) { 116 + case IRQ_PPI_ERROR: 117 + bfin_write_PPI_STATUS(PPI_ERR_MASK); 118 + break; 119 + #if (defined(CONFIG_BF537) || defined(CONFIG_BF536)) 120 + case IRQ_MAC_ERROR: 121 + bfin_write_EMAC_SYSTAT(EMAC_ERR_MASK); 122 + break; 123 + #endif 124 + case IRQ_SPORT0_ERROR: 125 + bfin_write_SPORT0_STAT(SPORT_ERR_MASK); 126 + break; 127 + 128 + case IRQ_SPORT1_ERROR: 129 + bfin_write_SPORT1_STAT(SPORT_ERR_MASK); 130 + break; 131 + 132 + case IRQ_CAN_ERROR: 133 + bfin_write_CAN_GIS(CAN_ERR_MASK); 134 + break; 135 + 136 + case IRQ_SPI_ERROR: 137 + bfin_write_SPI_STAT(SPI_ERR_MASK); 138 + break; 139 + 140 + default: 141 + break; 142 + } 143 + 144 + pr_debug("IRQ %d:" 145 + " MASKED PERIPHERAL ERROR INTERRUPT ASSERTED\n", 146 + irq); 147 + } 148 + } else 149 + pr_err("%s: IRQ ?: PERIPHERAL ERROR INTERRUPT ASSERTED BUT NO SOURCE FOUND\n", 150 + __func__); 151 + 152 + } 153 + 154 + #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 155 + static int mac_rx_int_mask; 156 + 157 + static void bf537_mac_rx_mask_irq(struct irq_data *d) 158 + { 159 + mac_rx_int_mask &= ~(1L << (d->irq - IRQ_MAC_RX)); 160 + if (!mac_rx_int_mask) 161 + bfin_internal_mask_irq(IRQ_PH_INTA_MAC_RX); 162 + } 163 + 164 + static void bf537_mac_rx_unmask_irq(struct irq_data *d) 165 + { 166 + bfin_internal_unmask_irq(IRQ_PH_INTA_MAC_RX); 167 + mac_rx_int_mask |= 1L << (d->irq - IRQ_MAC_RX); 168 + } 169 + 170 + static struct irq_chip bf537_mac_rx_irqchip = { 171 + .name = "ERROR", 172 + .irq_ack = bfin_ack_noop, 173 + .irq_mask_ack = bf537_mac_rx_mask_irq, 174 + .irq_mask = bf537_mac_rx_mask_irq, 175 + .irq_unmask = bf537_mac_rx_unmask_irq, 176 + }; 177 + 178 + static void bf537_demux_mac_rx_irq(unsigned int int_irq, 179 + struct irq_desc *desc) 180 + { 181 + if (bfin_read_DMA1_IRQ_STATUS() & (DMA_DONE | DMA_ERR)) 182 + bfin_handle_irq(IRQ_MAC_RX); 183 + else 184 + bfin_demux_gpio_irq(int_irq, desc); 185 + } 186 + #endif 187 + 188 + void __init init_mach_irq(void) 189 + { 190 + int irq; 191 + 192 + #if defined(CONFIG_BF537) || defined(CONFIG_BF536) 193 + /* Clear EMAC Interrupt Status bits so we can demux it later */ 194 + bfin_write_EMAC_SYSTAT(-1); 195 + #endif 196 + 197 + irq_set_chained_handler(IRQ_GENERIC_ERROR, bf537_demux_error_irq); 198 + for (irq = IRQ_PPI_ERROR; irq <= IRQ_UART1_ERROR; irq++) 199 + irq_set_chip_and_handler(irq, &bf537_generic_error_irqchip, 200 + handle_level_irq); 201 + 202 + #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 203 + irq_set_chained_handler(IRQ_PH_INTA_MAC_RX, bf537_demux_mac_rx_irq); 204 + irq_set_chip_and_handler(IRQ_MAC_RX, &bf537_mac_rx_irqchip, handle_level_irq); 205 + irq_set_chip_and_handler(IRQ_PORTH_INTA, &bf537_mac_rx_irqchip, handle_level_irq); 206 + 207 + irq_set_chained_handler(IRQ_MAC_ERROR, bfin_demux_mac_status_irq); 208 + #endif 60 209 }
+6 -3
arch/blackfin/mach-bf538/include/mach/anomaly.h
··· 5 5 * and can be replaced with that version at any time 6 6 * DO NOT EDIT THIS FILE 7 7 * 8 - * Copyright 2004-2010 Analog Devices Inc. 8 + * Copyright 2004-2011 Analog Devices Inc. 9 9 * Licensed under the ADI BSD license. 10 10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd 11 11 */ 12 12 13 13 /* This file should be up to date with: 14 - * - Revision H, 07/10/2009; ADSP-BF538/BF538F Blackfin Processor Anomaly List 15 - * - Revision M, 07/10/2009; ADSP-BF539/BF539F Blackfin Processor Anomaly List 14 + * - Revision I, 05/25/2010; ADSP-BF538/BF538F Blackfin Processor Anomaly List 15 + * - Revision N, 05/25/2010; ADSP-BF539/BF539F Blackfin Processor Anomaly List 16 16 */ 17 17 18 18 #ifndef _MACH_ANOMALY_H_ ··· 179 179 #define ANOMALY_05000363 (0) 180 180 #define ANOMALY_05000364 (0) 181 181 #define ANOMALY_05000380 (0) 182 + #define ANOMALY_05000383 (0) 182 183 #define ANOMALY_05000386 (1) 183 184 #define ANOMALY_05000389 (0) 184 185 #define ANOMALY_05000400 (0) ··· 187 186 #define ANOMALY_05000430 (0) 188 187 #define ANOMALY_05000432 (0) 189 188 #define ANOMALY_05000435 (0) 189 + #define ANOMALY_05000440 (0) 190 190 #define ANOMALY_05000447 (0) 191 191 #define ANOMALY_05000448 (0) 192 192 #define ANOMALY_05000456 (0) ··· 195 193 #define ANOMALY_05000465 (0) 196 194 #define ANOMALY_05000467 (0) 197 195 #define ANOMALY_05000474 (0) 196 + #define ANOMALY_05000480 (0) 198 197 #define ANOMALY_05000485 (0) 199 198 200 199 #endif
+22 -61
arch/blackfin/mach-bf538/include/mach/irq.h
··· 7 7 #ifndef _BF538_IRQ_H_ 8 8 #define _BF538_IRQ_H_ 9 9 10 - /* 11 - * Interrupt source definitions 12 - Event Source Core Event Name 13 - Core Emulation ** 14 - Events (highest priority) EMU 0 15 - Reset RST 1 16 - NMI NMI 2 17 - Exception EVX 3 18 - Reserved -- 4 19 - Hardware Error IVHW 5 20 - Core Timer IVTMR 6 * 10 + #include <mach-common/irq.h> 21 11 22 - ..... 23 - 24 - Software Interrupt 1 IVG14 31 25 - Software Interrupt 2 -- 26 - (lowest priority) IVG15 32 * 27 - */ 28 - 29 - #define NR_PERI_INTS (2 * 32) 30 - 31 - /* The ABSTRACT IRQ definitions */ 32 - /** the first seven of the following are fixed, the rest you change if you need to **/ 33 - #define IRQ_EMU 0 /* Emulation */ 34 - #define IRQ_RST 1 /* reset */ 35 - #define IRQ_NMI 2 /* Non Maskable */ 36 - #define IRQ_EVX 3 /* Exception */ 37 - #define IRQ_UNUSED 4 /* - unused interrupt */ 38 - #define IRQ_HWERR 5 /* Hardware Error */ 39 - #define IRQ_CORETMR 6 /* Core timer */ 40 - 41 - #define BFIN_IRQ(x) ((x) + 7) 12 + #define NR_PERI_INTS (2 * 32) 42 13 43 14 #define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */ 44 15 #define IRQ_DMA0_ERROR BFIN_IRQ(1) /* DMA Error 0 (generic) */ ··· 62 91 63 92 #define SYS_IRQS BFIN_IRQ(63) /* 70 */ 64 93 65 - #define IRQ_PF0 71 66 - #define IRQ_PF1 72 67 - #define IRQ_PF2 73 68 - #define IRQ_PF3 74 69 - #define IRQ_PF4 75 70 - #define IRQ_PF5 76 71 - #define IRQ_PF6 77 72 - #define IRQ_PF7 78 73 - #define IRQ_PF8 79 74 - #define IRQ_PF9 80 75 - #define IRQ_PF10 81 76 - #define IRQ_PF11 82 77 - #define IRQ_PF12 83 78 - #define IRQ_PF13 84 79 - #define IRQ_PF14 85 80 - #define IRQ_PF15 86 94 + #define IRQ_PF0 71 95 + #define IRQ_PF1 72 96 + #define IRQ_PF2 73 97 + #define IRQ_PF3 74 98 + #define IRQ_PF4 75 99 + #define IRQ_PF5 76 100 + #define IRQ_PF6 77 101 + #define IRQ_PF7 78 102 + #define IRQ_PF8 79 103 + #define IRQ_PF9 80 104 + #define IRQ_PF10 81 105 + #define IRQ_PF11 82 106 + #define IRQ_PF12 83 107 + #define IRQ_PF13 84 108 + #define IRQ_PF14 85 109 + #define IRQ_PF15 86 81 110 82 - #define GPIO_IRQ_BASE IRQ_PF0 111 + #define GPIO_IRQ_BASE IRQ_PF0 83 112 84 - #define NR_MACH_IRQS (IRQ_PF15 + 1) 85 - #define NR_IRQS (NR_MACH_IRQS + NR_SPARE_IRQS) 86 - 87 - #define IVG7 7 88 - #define IVG8 8 89 - #define IVG9 9 90 - #define IVG10 10 91 - #define IVG11 11 92 - #define IVG12 12 93 - #define IVG13 13 94 - #define IVG14 14 95 - #define IVG15 15 113 + #define NR_MACH_IRQS (IRQ_PF15 + 1) 96 114 97 115 /* IAR0 BIT FIELDS */ 98 116 #define IRQ_PLL_WAKEUP_POS 0 ··· 144 184 #define IRQ_CAN_TX_POS 0 145 185 #define IRQ_MEM1_DMA0_POS 4 146 186 #define IRQ_MEM1_DMA1_POS 8 147 - #endif /* _BF538_IRQ_H_ */ 187 + 188 + #endif
+109 -7
arch/blackfin/mach-bf548/boards/ezkit.c
··· 22 22 #include <asm/gpio.h> 23 23 #include <asm/nand.h> 24 24 #include <asm/dpmc.h> 25 + #include <asm/bfin_sport.h> 25 26 #include <asm/portmux.h> 26 27 #include <asm/bfin_sdh.h> 27 28 #include <mach/bf54x_keys.h> ··· 957 956 .offset = MTDPART_OFS_APPEND, 958 957 }, { 959 958 .name = "file system(nor)", 960 - .size = MTDPART_SIZ_FULL, 959 + .size = 0x1000000 - 0x80000 - 0x400000 - 0x8000 * 4, 960 + .offset = MTDPART_OFS_APPEND, 961 + }, { 962 + .name = "config(nor)", 963 + .size = 0x8000 * 3, 964 + .offset = MTDPART_OFS_APPEND, 965 + }, { 966 + .name = "u-boot env(nor)", 967 + .size = 0x8000, 961 968 .offset = MTDPART_OFS_APPEND, 962 969 } 963 970 }; ··· 1321 1312 }, 1322 1313 }; 1323 1314 1324 - #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 1315 + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 1316 + defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \ 1317 + defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 1318 + 1319 + #define SPORT_REQ(x) \ 1320 + [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \ 1321 + P_SPORT##x##_RFS, P_SPORT##x##_DRPRI, P_SPORT##x##_RSCLK, 0} 1322 + 1323 + static const u16 bfin_snd_pin[][7] = { 1324 + SPORT_REQ(0), 1325 + SPORT_REQ(1), 1326 + }; 1327 + 1328 + static struct bfin_snd_platform_data bfin_snd_data[] = { 1329 + { 1330 + .pin_req = &bfin_snd_pin[0][0], 1331 + }, 1332 + { 1333 + .pin_req = &bfin_snd_pin[1][0], 1334 + }, 1335 + }; 1336 + 1337 + #define BFIN_SND_RES(x) \ 1338 + [x] = { \ 1339 + { \ 1340 + .start = SPORT##x##_TCR1, \ 1341 + .end = SPORT##x##_TCR1, \ 1342 + .flags = IORESOURCE_MEM \ 1343 + }, \ 1344 + { \ 1345 + .start = CH_SPORT##x##_RX, \ 1346 + .end = CH_SPORT##x##_RX, \ 1347 + .flags = IORESOURCE_DMA, \ 1348 + }, \ 1349 + { \ 1350 + .start = CH_SPORT##x##_TX, \ 1351 + .end = CH_SPORT##x##_TX, \ 1352 + .flags = IORESOURCE_DMA, \ 1353 + }, \ 1354 + { \ 1355 + .start = IRQ_SPORT##x##_ERROR, \ 1356 + .end = IRQ_SPORT##x##_ERROR, \ 1357 + .flags = IORESOURCE_IRQ, \ 1358 + } \ 1359 + } 1360 + 1361 + static struct resource bfin_snd_resources[][4] = { 1362 + BFIN_SND_RES(0), 1363 + BFIN_SND_RES(1), 1364 + }; 1365 + 1366 + static struct platform_device bfin_pcm = { 1367 + .name = "bfin-pcm-audio", 1368 + .id = -1, 1369 + }; 1370 + #endif 1371 + 1372 + #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE) 1373 + static struct platform_device bfin_ad73311_codec_device = { 1374 + .name = "ad73311", 1375 + .id = -1, 1376 + }; 1377 + #endif 1378 + 1379 + #if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE) 1380 + static struct platform_device bfin_ad1980_codec_device = { 1381 + .name = "ad1980", 1382 + .id = -1, 1383 + }; 1384 + #endif 1385 + 1386 + #if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) 1325 1387 static struct platform_device bfin_i2s = { 1326 1388 .name = "bfin-i2s", 1327 1389 .id = CONFIG_SND_BF5XX_SPORT_NUM, 1328 - /* TODO: add platform data here */ 1390 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 1391 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 1392 + .dev = { 1393 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 1394 + }, 1329 1395 }; 1330 1396 #endif 1331 1397 1332 - #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) 1398 + #if defined(CONFIG_SND_BF5XX_SOC_TDM) || defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE) 1333 1399 static struct platform_device bfin_tdm = { 1334 1400 .name = "bfin-tdm", 1335 1401 .id = CONFIG_SND_BF5XX_SPORT_NUM, 1336 - /* TODO: add platform data here */ 1402 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 1403 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 1404 + .dev = { 1405 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 1406 + }, 1337 1407 }; 1338 1408 #endif 1339 1409 1340 - #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 1410 + #if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) 1341 1411 static struct platform_device bfin_ac97 = { 1342 1412 .name = "bfin-ac97", 1343 1413 .id = CONFIG_SND_BF5XX_SPORT_NUM, 1344 - /* TODO: add platform data here */ 1414 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 1415 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 1416 + .dev = { 1417 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 1418 + }, 1345 1419 }; 1346 1420 #endif 1347 1421 ··· 1540 1448 1541 1449 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 1542 1450 &ezkit_flash_device, 1451 + #endif 1452 + 1453 + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 1454 + defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \ 1455 + defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 1456 + &bfin_pcm, 1457 + #endif 1458 + 1459 + #if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE) 1460 + &bfin_ad1980_codec_device, 1543 1461 #endif 1544 1462 1545 1463 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
+6 -2
arch/blackfin/mach-bf548/include/mach/anomaly.h
··· 5 5 * and can be replaced with that version at any time 6 6 * DO NOT EDIT THIS FILE 7 7 * 8 - * Copyright 2004-2010 Analog Devices Inc. 8 + * Copyright 2004-2011 Analog Devices Inc. 9 9 * Licensed under the ADI BSD license. 10 10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd 11 11 */ 12 12 13 13 /* This file should be up to date with: 14 - * - Revision I, 07/23/2009; ADSP-BF542/BF544/BF547/BF548/BF549 Blackfin Processor Anomaly List 14 + * - Revision J, 06/03/2010; ADSP-BF542/BF544/BF547/BF548/BF549 Blackfin Processor Anomaly List 15 15 */ 16 16 17 17 #ifndef _MACH_ANOMALY_H_ ··· 220 220 #define ANOMALY_05000481 (1) 221 221 /* Possible USB Data Corruption When Multiple Endpoints Are Accessed by the Core */ 222 222 #define ANOMALY_05000483 (1) 223 + /* DDR Trim May Not Be Performed for Certain VLEV Values in OTP Page PBS00L */ 224 + #define ANOMALY_05000484 (__SILICON_REVISION__ < 3) 223 225 /* PLL_CTL Change Using bfrom_SysControl() Can Result in Processor Overclocking */ 224 226 #define ANOMALY_05000485 (__SILICON_REVISION__ >= 2) 225 227 /* IFLUSH sucks at life */ ··· 276 274 #define ANOMALY_05000412 (0) 277 275 #define ANOMALY_05000432 (0) 278 276 #define ANOMALY_05000435 (0) 277 + #define ANOMALY_05000440 (0) 279 278 #define ANOMALY_05000475 (0) 279 + #define ANOMALY_05000480 (0) 280 280 281 281 #endif
+24 -65
arch/blackfin/mach-bf548/include/mach/irq.h
··· 7 7 #ifndef _BF548_IRQ_H_ 8 8 #define _BF548_IRQ_H_ 9 9 10 - /* 11 - * Interrupt source definitions 12 - Event Source Core Event Name 13 - Core Emulation ** 14 - Events (highest priority) EMU 0 15 - Reset RST 1 16 - NMI NMI 2 17 - Exception EVX 3 18 - Reserved -- 4 19 - Hardware Error IVHW 5 20 - Core Timer IVTMR 6 * 10 + #include <mach-common/irq.h> 21 11 22 - ..... 23 - 24 - Software Interrupt 1 IVG14 31 25 - Software Interrupt 2 -- 26 - (lowest priority) IVG15 32 * 27 - */ 28 - 29 - #define NR_PERI_INTS (32 * 3) 30 - 31 - /* The ABSTRACT IRQ definitions */ 32 - /** the first seven of the following are fixed, the rest you change if you need to **/ 33 - #define IRQ_EMU 0 /* Emulation */ 34 - #define IRQ_RST 1 /* reset */ 35 - #define IRQ_NMI 2 /* Non Maskable */ 36 - #define IRQ_EVX 3 /* Exception */ 37 - #define IRQ_UNUSED 4 /* - unused interrupt*/ 38 - #define IRQ_HWERR 5 /* Hardware Error */ 39 - #define IRQ_CORETMR 6 /* Core timer */ 40 - 41 - #define BFIN_IRQ(x) ((x) + 7) 12 + #define NR_PERI_INTS (3 * 32) 42 13 43 14 #define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */ 44 15 #define IRQ_DMAC0_ERROR BFIN_IRQ(1) /* DMAC0 Status Interrupt */ ··· 282 311 #define IRQ_PJ14 BFIN_PJ_IRQ(14) /* N/A */ 283 312 #define IRQ_PJ15 BFIN_PJ_IRQ(15) /* N/A */ 284 313 285 - #define GPIO_IRQ_BASE IRQ_PA0 314 + #define GPIO_IRQ_BASE IRQ_PA0 286 315 287 - #define NR_MACH_IRQS (IRQ_PJ15 + 1) 288 - #define NR_IRQS (NR_MACH_IRQS + NR_SPARE_IRQS) 316 + #define NR_MACH_IRQS (IRQ_PJ15 + 1) 289 317 290 318 /* For compatibility reasons with existing code */ 291 319 292 - #define IRQ_DMAC0_ERR IRQ_DMAC0_ERROR 293 - #define IRQ_EPPI0_ERR IRQ_EPPI0_ERROR 320 + #define IRQ_DMAC0_ERR IRQ_DMAC0_ERROR 321 + #define IRQ_EPPI0_ERR IRQ_EPPI0_ERROR 294 322 #define IRQ_SPORT0_ERR IRQ_SPORT0_ERROR 295 323 #define IRQ_SPORT1_ERR IRQ_SPORT1_ERROR 296 - #define IRQ_SPI0_ERR IRQ_SPI0_ERROR 297 - #define IRQ_UART0_ERR IRQ_UART0_ERROR 298 - #define IRQ_DMAC1_ERR IRQ_DMAC1_ERROR 324 + #define IRQ_SPI0_ERR IRQ_SPI0_ERROR 325 + #define IRQ_UART0_ERR IRQ_UART0_ERROR 326 + #define IRQ_DMAC1_ERR IRQ_DMAC1_ERROR 299 327 #define IRQ_SPORT2_ERR IRQ_SPORT2_ERROR 300 328 #define IRQ_SPORT3_ERR IRQ_SPORT3_ERROR 301 - #define IRQ_SPI1_ERR IRQ_SPI1_ERROR 302 - #define IRQ_SPI2_ERR IRQ_SPI2_ERROR 303 - #define IRQ_UART1_ERR IRQ_UART1_ERROR 304 - #define IRQ_UART2_ERR IRQ_UART2_ERROR 305 - #define IRQ_CAN0_ERR IRQ_CAN0_ERROR 306 - #define IRQ_MXVR_ERR IRQ_MXVR_ERROR 307 - #define IRQ_EPPI1_ERR IRQ_EPPI1_ERROR 308 - #define IRQ_EPPI2_ERR IRQ_EPPI2_ERROR 309 - #define IRQ_UART3_ERR IRQ_UART3_ERROR 310 - #define IRQ_HOST_ERR IRQ_HOST_ERROR 311 - #define IRQ_PIXC_ERR IRQ_PIXC_ERROR 312 - #define IRQ_NFC_ERR IRQ_NFC_ERROR 313 - #define IRQ_ATAPI_ERR IRQ_ATAPI_ERROR 314 - #define IRQ_CAN1_ERR IRQ_CAN1_ERROR 329 + #define IRQ_SPI1_ERR IRQ_SPI1_ERROR 330 + #define IRQ_SPI2_ERR IRQ_SPI2_ERROR 331 + #define IRQ_UART1_ERR IRQ_UART1_ERROR 332 + #define IRQ_UART2_ERR IRQ_UART2_ERROR 333 + #define IRQ_CAN0_ERR IRQ_CAN0_ERROR 334 + #define IRQ_MXVR_ERR IRQ_MXVR_ERROR 335 + #define IRQ_EPPI1_ERR IRQ_EPPI1_ERROR 336 + #define IRQ_EPPI2_ERR IRQ_EPPI2_ERROR 337 + #define IRQ_UART3_ERR IRQ_UART3_ERROR 338 + #define IRQ_HOST_ERR IRQ_HOST_ERROR 339 + #define IRQ_PIXC_ERR IRQ_PIXC_ERROR 340 + #define IRQ_NFC_ERR IRQ_NFC_ERROR 341 + #define IRQ_ATAPI_ERR IRQ_ATAPI_ERROR 342 + #define IRQ_CAN1_ERR IRQ_CAN1_ERROR 315 343 #define IRQ_HS_DMA_ERR IRQ_HS_DMA_ERROR 316 - 317 - 318 - #define IVG7 7 319 - #define IVG8 8 320 - #define IVG9 9 321 - #define IVG10 10 322 - #define IVG11 11 323 - #define IVG12 12 324 - #define IVG13 13 325 - #define IVG14 14 326 - #define IVG15 15 327 344 328 345 /* IAR0 BIT FIELDS */ 329 346 #define IRQ_PLL_WAKEUP_POS 0 ··· 451 492 452 493 #endif 453 494 454 - #endif /* _BF548_IRQ_H_ */ 495 + #endif
+9 -1
arch/blackfin/mach-bf561/boards/ezkit.c
··· 247 247 .offset = MTDPART_OFS_APPEND, 248 248 }, { 249 249 .name = "file system(nor)", 250 - .size = MTDPART_SIZ_FULL, 250 + .size = 0x800000 - 0x40000 - 0x1C0000 - 0x2000 * 8, 251 + .offset = MTDPART_OFS_APPEND, 252 + }, { 253 + .name = "config(nor)", 254 + .size = 0x2000 * 7, 255 + .offset = MTDPART_OFS_APPEND, 256 + }, { 257 + .name = "u-boot env(nor)", 258 + .size = 0x2000, 251 259 .offset = MTDPART_OFS_APPEND, 252 260 } 253 261 };
+12 -3
arch/blackfin/mach-bf561/include/mach/anomaly.h
··· 5 5 * and can be replaced with that version at any time 6 6 * DO NOT EDIT THIS FILE 7 7 * 8 - * Copyright 2004-2010 Analog Devices Inc. 8 + * Copyright 2004-2011 Analog Devices Inc. 9 9 * Licensed under the ADI BSD license. 10 10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd 11 11 */ 12 12 13 13 /* This file should be up to date with: 14 - * - Revision Q, 11/07/2008; ADSP-BF561 Blackfin Processor Anomaly List 14 + * - Revision R, 05/25/2010; ADSP-BF561 Blackfin Processor Anomaly List 15 15 */ 16 16 17 17 #ifndef _MACH_ANOMALY_H_ ··· 290 290 #define ANOMALY_05000428 (__SILICON_REVISION__ > 3) 291 291 /* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */ 292 292 #define ANOMALY_05000443 (1) 293 + /* SCKELOW Feature Is Not Functional */ 294 + #define ANOMALY_05000458 (1) 293 295 /* False Hardware Error when RETI Points to Invalid Memory */ 294 296 #define ANOMALY_05000461 (1) 297 + /* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */ 298 + #define ANOMALY_05000462 (1) 299 + /* Boot Failure When SDRAM Control Signals Toggle Coming Out Of Reset */ 300 + #define ANOMALY_05000471 (1) 295 301 /* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */ 296 302 #define ANOMALY_05000473 (1) 297 303 /* Possible Lockup Condition whem Modifying PLL from External Memory */ 298 - #define ANOMALY_05000475 (__SILICON_REVISION__ < 4) 304 + #define ANOMALY_05000475 (1) 299 305 /* TESTSET Instruction Cannot Be Interrupted */ 300 306 #define ANOMALY_05000477 (1) 301 307 /* Reads of ITEST_COMMAND and ITEST_DATA Registers Cause Cache Corruption */ ··· 320 314 #define ANOMALY_05000353 (1) 321 315 #define ANOMALY_05000364 (0) 322 316 #define ANOMALY_05000380 (0) 317 + #define ANOMALY_05000383 (0) 323 318 #define ANOMALY_05000386 (1) 324 319 #define ANOMALY_05000389 (0) 325 320 #define ANOMALY_05000400 (0) 326 321 #define ANOMALY_05000430 (0) 327 322 #define ANOMALY_05000432 (0) 328 323 #define ANOMALY_05000435 (0) 324 + #define ANOMALY_05000440 (0) 329 325 #define ANOMALY_05000447 (0) 330 326 #define ANOMALY_05000448 (0) 331 327 #define ANOMALY_05000456 (0) ··· 335 327 #define ANOMALY_05000465 (0) 336 328 #define ANOMALY_05000467 (0) 337 329 #define ANOMALY_05000474 (0) 330 + #define ANOMALY_05000480 (0) 338 331 #define ANOMALY_05000485 (0) 339 332 340 333 #endif
+167 -354
arch/blackfin/mach-bf561/include/mach/irq.h
··· 7 7 #ifndef _BF561_IRQ_H_ 8 8 #define _BF561_IRQ_H_ 9 9 10 - /*********************************************************************** 11 - * Interrupt source definitions: 12 - Event Source Core Event Name IRQ No 13 - (highest priority) 14 - Emulation Events EMU 0 15 - Reset RST 1 16 - NMI NMI 2 17 - Exception EVX 3 18 - Reserved -- 4 19 - Hardware Error IVHW 5 20 - Core Timer IVTMR 6 * 10 + #include <mach-common/irq.h> 21 11 22 - PLL Wakeup Interrupt IVG7 7 23 - DMA1 Error (generic) IVG7 8 24 - DMA2 Error (generic) IVG7 9 25 - IMDMA Error (generic) IVG7 10 26 - PPI1 Error Interrupt IVG7 11 27 - PPI2 Error Interrupt IVG7 12 28 - SPORT0 Error Interrupt IVG7 13 29 - SPORT1 Error Interrupt IVG7 14 30 - SPI Error Interrupt IVG7 15 31 - UART Error Interrupt IVG7 16 32 - Reserved Interrupt IVG7 17 12 + #define NR_PERI_INTS (2 * 32) 33 13 34 - DMA1 0 Interrupt(PPI1) IVG8 18 35 - DMA1 1 Interrupt(PPI2) IVG8 19 36 - DMA1 2 Interrupt IVG8 20 37 - DMA1 3 Interrupt IVG8 21 38 - DMA1 4 Interrupt IVG8 22 39 - DMA1 5 Interrupt IVG8 23 40 - DMA1 6 Interrupt IVG8 24 41 - DMA1 7 Interrupt IVG8 25 42 - DMA1 8 Interrupt IVG8 26 43 - DMA1 9 Interrupt IVG8 27 44 - DMA1 10 Interrupt IVG8 28 45 - DMA1 11 Interrupt IVG8 29 46 - 47 - DMA2 0 (SPORT0 RX) IVG9 30 48 - DMA2 1 (SPORT0 TX) IVG9 31 49 - DMA2 2 (SPORT1 RX) IVG9 32 50 - DMA2 3 (SPORT2 TX) IVG9 33 51 - DMA2 4 (SPI) IVG9 34 52 - DMA2 5 (UART RX) IVG9 35 53 - DMA2 6 (UART TX) IVG9 36 54 - DMA2 7 Interrupt IVG9 37 55 - DMA2 8 Interrupt IVG9 38 56 - DMA2 9 Interrupt IVG9 39 57 - DMA2 10 Interrupt IVG9 40 58 - DMA2 11 Interrupt IVG9 41 59 - 60 - TIMER 0 Interrupt IVG10 42 61 - TIMER 1 Interrupt IVG10 43 62 - TIMER 2 Interrupt IVG10 44 63 - TIMER 3 Interrupt IVG10 45 64 - TIMER 4 Interrupt IVG10 46 65 - TIMER 5 Interrupt IVG10 47 66 - TIMER 6 Interrupt IVG10 48 67 - TIMER 7 Interrupt IVG10 49 68 - TIMER 8 Interrupt IVG10 50 69 - TIMER 9 Interrupt IVG10 51 70 - TIMER 10 Interrupt IVG10 52 71 - TIMER 11 Interrupt IVG10 53 72 - 73 - Programmable Flags0 A (8) IVG11 54 74 - Programmable Flags0 B (8) IVG11 55 75 - Programmable Flags1 A (8) IVG11 56 76 - Programmable Flags1 B (8) IVG11 57 77 - Programmable Flags2 A (8) IVG11 58 78 - Programmable Flags2 B (8) IVG11 59 79 - 80 - MDMA1 0 write/read INT IVG8 60 81 - MDMA1 1 write/read INT IVG8 61 82 - 83 - MDMA2 0 write/read INT IVG9 62 84 - MDMA2 1 write/read INT IVG9 63 85 - 86 - IMDMA 0 write/read INT IVG12 64 87 - IMDMA 1 write/read INT IVG12 65 88 - 89 - Watch Dog Timer IVG13 66 90 - 91 - Reserved interrupt IVG7 67 92 - Reserved interrupt IVG7 68 93 - Supplemental interrupt 0 IVG7 69 94 - supplemental interrupt 1 IVG7 70 95 - 96 - Softirq IVG14 97 - System Call -- 98 - (lowest priority) IVG15 99 - 100 - **********************************************************************/ 14 + #define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */ 15 + #define IRQ_DMA1_ERROR BFIN_IRQ(1) /* DMA1 Error (general) */ 16 + #define IRQ_DMA_ERROR IRQ_DMA1_ERROR /* DMA1 Error (general) */ 17 + #define IRQ_DMA2_ERROR BFIN_IRQ(2) /* DMA2 Error (general) */ 18 + #define IRQ_IMDMA_ERROR BFIN_IRQ(3) /* IMDMA Error Interrupt */ 19 + #define IRQ_PPI1_ERROR BFIN_IRQ(4) /* PPI1 Error Interrupt */ 20 + #define IRQ_PPI_ERROR IRQ_PPI1_ERROR /* PPI1 Error Interrupt */ 21 + #define IRQ_PPI2_ERROR BFIN_IRQ(5) /* PPI2 Error Interrupt */ 22 + #define IRQ_SPORT0_ERROR BFIN_IRQ(6) /* SPORT0 Error Interrupt */ 23 + #define IRQ_SPORT1_ERROR BFIN_IRQ(7) /* SPORT1 Error Interrupt */ 24 + #define IRQ_SPI_ERROR BFIN_IRQ(8) /* SPI Error Interrupt */ 25 + #define IRQ_UART_ERROR BFIN_IRQ(9) /* UART Error Interrupt */ 26 + #define IRQ_RESERVED_ERROR BFIN_IRQ(10) /* Reversed */ 27 + #define IRQ_DMA1_0 BFIN_IRQ(11) /* DMA1 0 Interrupt(PPI1) */ 28 + #define IRQ_PPI IRQ_DMA1_0 /* DMA1 0 Interrupt(PPI1) */ 29 + #define IRQ_PPI0 IRQ_DMA1_0 /* DMA1 0 Interrupt(PPI1) */ 30 + #define IRQ_DMA1_1 BFIN_IRQ(12) /* DMA1 1 Interrupt(PPI2) */ 31 + #define IRQ_PPI1 IRQ_DMA1_1 /* DMA1 1 Interrupt(PPI2) */ 32 + #define IRQ_DMA1_2 BFIN_IRQ(13) /* DMA1 2 Interrupt */ 33 + #define IRQ_DMA1_3 BFIN_IRQ(14) /* DMA1 3 Interrupt */ 34 + #define IRQ_DMA1_4 BFIN_IRQ(15) /* DMA1 4 Interrupt */ 35 + #define IRQ_DMA1_5 BFIN_IRQ(16) /* DMA1 5 Interrupt */ 36 + #define IRQ_DMA1_6 BFIN_IRQ(17) /* DMA1 6 Interrupt */ 37 + #define IRQ_DMA1_7 BFIN_IRQ(18) /* DMA1 7 Interrupt */ 38 + #define IRQ_DMA1_8 BFIN_IRQ(19) /* DMA1 8 Interrupt */ 39 + #define IRQ_DMA1_9 BFIN_IRQ(20) /* DMA1 9 Interrupt */ 40 + #define IRQ_DMA1_10 BFIN_IRQ(21) /* DMA1 10 Interrupt */ 41 + #define IRQ_DMA1_11 BFIN_IRQ(22) /* DMA1 11 Interrupt */ 42 + #define IRQ_DMA2_0 BFIN_IRQ(23) /* DMA2 0 (SPORT0 RX) */ 43 + #define IRQ_SPORT0_RX IRQ_DMA2_0 /* DMA2 0 (SPORT0 RX) */ 44 + #define IRQ_DMA2_1 BFIN_IRQ(24) /* DMA2 1 (SPORT0 TX) */ 45 + #define IRQ_SPORT0_TX IRQ_DMA2_1 /* DMA2 1 (SPORT0 TX) */ 46 + #define IRQ_DMA2_2 BFIN_IRQ(25) /* DMA2 2 (SPORT1 RX) */ 47 + #define IRQ_SPORT1_RX IRQ_DMA2_2 /* DMA2 2 (SPORT1 RX) */ 48 + #define IRQ_DMA2_3 BFIN_IRQ(26) /* DMA2 3 (SPORT2 TX) */ 49 + #define IRQ_SPORT1_TX IRQ_DMA2_3 /* DMA2 3 (SPORT2 TX) */ 50 + #define IRQ_DMA2_4 BFIN_IRQ(27) /* DMA2 4 (SPI) */ 51 + #define IRQ_SPI IRQ_DMA2_4 /* DMA2 4 (SPI) */ 52 + #define IRQ_DMA2_5 BFIN_IRQ(28) /* DMA2 5 (UART RX) */ 53 + #define IRQ_UART_RX IRQ_DMA2_5 /* DMA2 5 (UART RX) */ 54 + #define IRQ_DMA2_6 BFIN_IRQ(29) /* DMA2 6 (UART TX) */ 55 + #define IRQ_UART_TX IRQ_DMA2_6 /* DMA2 6 (UART TX) */ 56 + #define IRQ_DMA2_7 BFIN_IRQ(30) /* DMA2 7 Interrupt */ 57 + #define IRQ_DMA2_8 BFIN_IRQ(31) /* DMA2 8 Interrupt */ 58 + #define IRQ_DMA2_9 BFIN_IRQ(32) /* DMA2 9 Interrupt */ 59 + #define IRQ_DMA2_10 BFIN_IRQ(33) /* DMA2 10 Interrupt */ 60 + #define IRQ_DMA2_11 BFIN_IRQ(34) /* DMA2 11 Interrupt */ 61 + #define IRQ_TIMER0 BFIN_IRQ(35) /* TIMER 0 Interrupt */ 62 + #define IRQ_TIMER1 BFIN_IRQ(36) /* TIMER 1 Interrupt */ 63 + #define IRQ_TIMER2 BFIN_IRQ(37) /* TIMER 2 Interrupt */ 64 + #define IRQ_TIMER3 BFIN_IRQ(38) /* TIMER 3 Interrupt */ 65 + #define IRQ_TIMER4 BFIN_IRQ(39) /* TIMER 4 Interrupt */ 66 + #define IRQ_TIMER5 BFIN_IRQ(40) /* TIMER 5 Interrupt */ 67 + #define IRQ_TIMER6 BFIN_IRQ(41) /* TIMER 6 Interrupt */ 68 + #define IRQ_TIMER7 BFIN_IRQ(42) /* TIMER 7 Interrupt */ 69 + #define IRQ_TIMER8 BFIN_IRQ(43) /* TIMER 8 Interrupt */ 70 + #define IRQ_TIMER9 BFIN_IRQ(44) /* TIMER 9 Interrupt */ 71 + #define IRQ_TIMER10 BFIN_IRQ(45) /* TIMER 10 Interrupt */ 72 + #define IRQ_TIMER11 BFIN_IRQ(46) /* TIMER 11 Interrupt */ 73 + #define IRQ_PROG0_INTA BFIN_IRQ(47) /* Programmable Flags0 A (8) */ 74 + #define IRQ_PROG_INTA IRQ_PROG0_INTA /* Programmable Flags0 A (8) */ 75 + #define IRQ_PROG0_INTB BFIN_IRQ(48) /* Programmable Flags0 B (8) */ 76 + #define IRQ_PROG_INTB IRQ_PROG0_INTB /* Programmable Flags0 B (8) */ 77 + #define IRQ_PROG1_INTA BFIN_IRQ(49) /* Programmable Flags1 A (8) */ 78 + #define IRQ_PROG1_INTB BFIN_IRQ(50) /* Programmable Flags1 B (8) */ 79 + #define IRQ_PROG2_INTA BFIN_IRQ(51) /* Programmable Flags2 A (8) */ 80 + #define IRQ_PROG2_INTB BFIN_IRQ(52) /* Programmable Flags2 B (8) */ 81 + #define IRQ_DMA1_WRRD0 BFIN_IRQ(53) /* MDMA1 0 write/read INT */ 82 + #define IRQ_DMA_WRRD0 IRQ_DMA1_WRRD0 /* MDMA1 0 write/read INT */ 83 + #define IRQ_MEM_DMA0 IRQ_DMA1_WRRD0 84 + #define IRQ_DMA1_WRRD1 BFIN_IRQ(54) /* MDMA1 1 write/read INT */ 85 + #define IRQ_DMA_WRRD1 IRQ_DMA1_WRRD1 /* MDMA1 1 write/read INT */ 86 + #define IRQ_MEM_DMA1 IRQ_DMA1_WRRD1 87 + #define IRQ_DMA2_WRRD0 BFIN_IRQ(55) /* MDMA2 0 write/read INT */ 88 + #define IRQ_MEM_DMA2 IRQ_DMA2_WRRD0 89 + #define IRQ_DMA2_WRRD1 BFIN_IRQ(56) /* MDMA2 1 write/read INT */ 90 + #define IRQ_MEM_DMA3 IRQ_DMA2_WRRD1 91 + #define IRQ_IMDMA_WRRD0 BFIN_IRQ(57) /* IMDMA 0 write/read INT */ 92 + #define IRQ_IMEM_DMA0 IRQ_IMDMA_WRRD0 93 + #define IRQ_IMDMA_WRRD1 BFIN_IRQ(58) /* IMDMA 1 write/read INT */ 94 + #define IRQ_IMEM_DMA1 IRQ_IMDMA_WRRD1 95 + #define IRQ_WATCH BFIN_IRQ(59) /* Watch Dog Timer */ 96 + #define IRQ_RESERVED_1 BFIN_IRQ(60) /* Reserved interrupt */ 97 + #define IRQ_RESERVED_2 BFIN_IRQ(61) /* Reserved interrupt */ 98 + #define IRQ_SUPPLE_0 BFIN_IRQ(62) /* Supplemental interrupt 0 */ 99 + #define IRQ_SUPPLE_1 BFIN_IRQ(63) /* supplemental interrupt 1 */ 101 100 102 101 #define SYS_IRQS 71 103 - #define NR_PERI_INTS 64 104 - 105 - /* 106 - * The ABSTRACT IRQ definitions 107 - * the first seven of the following are fixed, 108 - * the rest you change if you need to. 109 - */ 110 - /* IVG 0-6*/ 111 - #define IRQ_EMU 0 /* Emulation */ 112 - #define IRQ_RST 1 /* Reset */ 113 - #define IRQ_NMI 2 /* Non Maskable Interrupt */ 114 - #define IRQ_EVX 3 /* Exception */ 115 - #define IRQ_UNUSED 4 /* Reserved interrupt */ 116 - #define IRQ_HWERR 5 /* Hardware Error */ 117 - #define IRQ_CORETMR 6 /* Core timer */ 118 - 119 - #define IVG_BASE 7 120 - /* IVG 7 */ 121 - #define IRQ_PLL_WAKEUP (IVG_BASE + 0) /* PLL Wakeup Interrupt */ 122 - #define IRQ_DMA1_ERROR (IVG_BASE + 1) /* DMA1 Error (general) */ 123 - #define IRQ_DMA_ERROR IRQ_DMA1_ERROR /* DMA1 Error (general) */ 124 - #define IRQ_DMA2_ERROR (IVG_BASE + 2) /* DMA2 Error (general) */ 125 - #define IRQ_IMDMA_ERROR (IVG_BASE + 3) /* IMDMA Error Interrupt */ 126 - #define IRQ_PPI1_ERROR (IVG_BASE + 4) /* PPI1 Error Interrupt */ 127 - #define IRQ_PPI_ERROR IRQ_PPI1_ERROR /* PPI1 Error Interrupt */ 128 - #define IRQ_PPI2_ERROR (IVG_BASE + 5) /* PPI2 Error Interrupt */ 129 - #define IRQ_SPORT0_ERROR (IVG_BASE + 6) /* SPORT0 Error Interrupt */ 130 - #define IRQ_SPORT1_ERROR (IVG_BASE + 7) /* SPORT1 Error Interrupt */ 131 - #define IRQ_SPI_ERROR (IVG_BASE + 8) /* SPI Error Interrupt */ 132 - #define IRQ_UART_ERROR (IVG_BASE + 9) /* UART Error Interrupt */ 133 - #define IRQ_RESERVED_ERROR (IVG_BASE + 10) /* Reversed Interrupt */ 134 - /* IVG 8 */ 135 - #define IRQ_DMA1_0 (IVG_BASE + 11) /* DMA1 0 Interrupt(PPI1) */ 136 - #define IRQ_PPI IRQ_DMA1_0 /* DMA1 0 Interrupt(PPI1) */ 137 - #define IRQ_PPI0 IRQ_DMA1_0 /* DMA1 0 Interrupt(PPI1) */ 138 - #define IRQ_DMA1_1 (IVG_BASE + 12) /* DMA1 1 Interrupt(PPI2) */ 139 - #define IRQ_PPI1 IRQ_DMA1_1 /* DMA1 1 Interrupt(PPI2) */ 140 - #define IRQ_DMA1_2 (IVG_BASE + 13) /* DMA1 2 Interrupt */ 141 - #define IRQ_DMA1_3 (IVG_BASE + 14) /* DMA1 3 Interrupt */ 142 - #define IRQ_DMA1_4 (IVG_BASE + 15) /* DMA1 4 Interrupt */ 143 - #define IRQ_DMA1_5 (IVG_BASE + 16) /* DMA1 5 Interrupt */ 144 - #define IRQ_DMA1_6 (IVG_BASE + 17) /* DMA1 6 Interrupt */ 145 - #define IRQ_DMA1_7 (IVG_BASE + 18) /* DMA1 7 Interrupt */ 146 - #define IRQ_DMA1_8 (IVG_BASE + 19) /* DMA1 8 Interrupt */ 147 - #define IRQ_DMA1_9 (IVG_BASE + 20) /* DMA1 9 Interrupt */ 148 - #define IRQ_DMA1_10 (IVG_BASE + 21) /* DMA1 10 Interrupt */ 149 - #define IRQ_DMA1_11 (IVG_BASE + 22) /* DMA1 11 Interrupt */ 150 - /* IVG 9 */ 151 - #define IRQ_DMA2_0 (IVG_BASE + 23) /* DMA2 0 (SPORT0 RX) */ 152 - #define IRQ_SPORT0_RX IRQ_DMA2_0 /* DMA2 0 (SPORT0 RX) */ 153 - #define IRQ_DMA2_1 (IVG_BASE + 24) /* DMA2 1 (SPORT0 TX) */ 154 - #define IRQ_SPORT0_TX IRQ_DMA2_1 /* DMA2 1 (SPORT0 TX) */ 155 - #define IRQ_DMA2_2 (IVG_BASE + 25) /* DMA2 2 (SPORT1 RX) */ 156 - #define IRQ_SPORT1_RX IRQ_DMA2_2 /* DMA2 2 (SPORT1 RX) */ 157 - #define IRQ_DMA2_3 (IVG_BASE + 26) /* DMA2 3 (SPORT2 TX) */ 158 - #define IRQ_SPORT1_TX IRQ_DMA2_3 /* DMA2 3 (SPORT2 TX) */ 159 - #define IRQ_DMA2_4 (IVG_BASE + 27) /* DMA2 4 (SPI) */ 160 - #define IRQ_SPI IRQ_DMA2_4 /* DMA2 4 (SPI) */ 161 - #define IRQ_DMA2_5 (IVG_BASE + 28) /* DMA2 5 (UART RX) */ 162 - #define IRQ_UART_RX IRQ_DMA2_5 /* DMA2 5 (UART RX) */ 163 - #define IRQ_DMA2_6 (IVG_BASE + 29) /* DMA2 6 (UART TX) */ 164 - #define IRQ_UART_TX IRQ_DMA2_6 /* DMA2 6 (UART TX) */ 165 - #define IRQ_DMA2_7 (IVG_BASE + 30) /* DMA2 7 Interrupt */ 166 - #define IRQ_DMA2_8 (IVG_BASE + 31) /* DMA2 8 Interrupt */ 167 - #define IRQ_DMA2_9 (IVG_BASE + 32) /* DMA2 9 Interrupt */ 168 - #define IRQ_DMA2_10 (IVG_BASE + 33) /* DMA2 10 Interrupt */ 169 - #define IRQ_DMA2_11 (IVG_BASE + 34) /* DMA2 11 Interrupt */ 170 - /* IVG 10 */ 171 - #define IRQ_TIMER0 (IVG_BASE + 35) /* TIMER 0 Interrupt */ 172 - #define IRQ_TIMER1 (IVG_BASE + 36) /* TIMER 1 Interrupt */ 173 - #define IRQ_TIMER2 (IVG_BASE + 37) /* TIMER 2 Interrupt */ 174 - #define IRQ_TIMER3 (IVG_BASE + 38) /* TIMER 3 Interrupt */ 175 - #define IRQ_TIMER4 (IVG_BASE + 39) /* TIMER 4 Interrupt */ 176 - #define IRQ_TIMER5 (IVG_BASE + 40) /* TIMER 5 Interrupt */ 177 - #define IRQ_TIMER6 (IVG_BASE + 41) /* TIMER 6 Interrupt */ 178 - #define IRQ_TIMER7 (IVG_BASE + 42) /* TIMER 7 Interrupt */ 179 - #define IRQ_TIMER8 (IVG_BASE + 43) /* TIMER 8 Interrupt */ 180 - #define IRQ_TIMER9 (IVG_BASE + 44) /* TIMER 9 Interrupt */ 181 - #define IRQ_TIMER10 (IVG_BASE + 45) /* TIMER 10 Interrupt */ 182 - #define IRQ_TIMER11 (IVG_BASE + 46) /* TIMER 11 Interrupt */ 183 - /* IVG 11 */ 184 - #define IRQ_PROG0_INTA (IVG_BASE + 47) /* Programmable Flags0 A (8) */ 185 - #define IRQ_PROG_INTA IRQ_PROG0_INTA /* Programmable Flags0 A (8) */ 186 - #define IRQ_PROG0_INTB (IVG_BASE + 48) /* Programmable Flags0 B (8) */ 187 - #define IRQ_PROG_INTB IRQ_PROG0_INTB /* Programmable Flags0 B (8) */ 188 - #define IRQ_PROG1_INTA (IVG_BASE + 49) /* Programmable Flags1 A (8) */ 189 - #define IRQ_PROG1_INTB (IVG_BASE + 50) /* Programmable Flags1 B (8) */ 190 - #define IRQ_PROG2_INTA (IVG_BASE + 51) /* Programmable Flags2 A (8) */ 191 - #define IRQ_PROG2_INTB (IVG_BASE + 52) /* Programmable Flags2 B (8) */ 192 - /* IVG 8 */ 193 - #define IRQ_DMA1_WRRD0 (IVG_BASE + 53) /* MDMA1 0 write/read INT */ 194 - #define IRQ_DMA_WRRD0 IRQ_DMA1_WRRD0 /* MDMA1 0 write/read INT */ 195 - #define IRQ_MEM_DMA0 IRQ_DMA1_WRRD0 196 - #define IRQ_DMA1_WRRD1 (IVG_BASE + 54) /* MDMA1 1 write/read INT */ 197 - #define IRQ_DMA_WRRD1 IRQ_DMA1_WRRD1 /* MDMA1 1 write/read INT */ 198 - #define IRQ_MEM_DMA1 IRQ_DMA1_WRRD1 199 - /* IVG 9 */ 200 - #define IRQ_DMA2_WRRD0 (IVG_BASE + 55) /* MDMA2 0 write/read INT */ 201 - #define IRQ_MEM_DMA2 IRQ_DMA2_WRRD0 202 - #define IRQ_DMA2_WRRD1 (IVG_BASE + 56) /* MDMA2 1 write/read INT */ 203 - #define IRQ_MEM_DMA3 IRQ_DMA2_WRRD1 204 - /* IVG 12 */ 205 - #define IRQ_IMDMA_WRRD0 (IVG_BASE + 57) /* IMDMA 0 write/read INT */ 206 - #define IRQ_IMEM_DMA0 IRQ_IMDMA_WRRD0 207 - #define IRQ_IMDMA_WRRD1 (IVG_BASE + 58) /* IMDMA 1 write/read INT */ 208 - #define IRQ_IMEM_DMA1 IRQ_IMDMA_WRRD1 209 - /* IVG 13 */ 210 - #define IRQ_WATCH (IVG_BASE + 59) /* Watch Dog Timer */ 211 - /* IVG 7 */ 212 - #define IRQ_RESERVED_1 (IVG_BASE + 60) /* Reserved interrupt */ 213 - #define IRQ_RESERVED_2 (IVG_BASE + 61) /* Reserved interrupt */ 214 - #define IRQ_SUPPLE_0 (IVG_BASE + 62) /* Supplemental interrupt 0 */ 215 - #define IRQ_SUPPLE_1 (IVG_BASE + 63) /* supplemental interrupt 1 */ 216 102 217 103 #define IRQ_PF0 73 218 104 #define IRQ_PF1 74 ··· 152 266 #define GPIO_IRQ_BASE IRQ_PF0 153 267 154 268 #define NR_MACH_IRQS (IRQ_PF47 + 1) 155 - #define NR_IRQS (NR_MACH_IRQS + NR_SPARE_IRQS) 156 - 157 - #define IVG7 7 158 - #define IVG8 8 159 - #define IVG9 9 160 - #define IVG10 10 161 - #define IVG11 11 162 - #define IVG12 12 163 - #define IVG13 13 164 - #define IVG14 14 165 - #define IVG15 15 166 - 167 - /* 168 - * DEFAULT PRIORITIES: 169 - */ 170 - 171 - #define CONFIG_DEF_PLL_WAKEUP 7 172 - #define CONFIG_DEF_DMA1_ERROR 7 173 - #define CONFIG_DEF_DMA2_ERROR 7 174 - #define CONFIG_DEF_IMDMA_ERROR 7 175 - #define CONFIG_DEF_PPI1_ERROR 7 176 - #define CONFIG_DEF_PPI2_ERROR 7 177 - #define CONFIG_DEF_SPORT0_ERROR 7 178 - #define CONFIG_DEF_SPORT1_ERROR 7 179 - #define CONFIG_DEF_SPI_ERROR 7 180 - #define CONFIG_DEF_UART_ERROR 7 181 - #define CONFIG_DEF_RESERVED_ERROR 7 182 - #define CONFIG_DEF_DMA1_0 8 183 - #define CONFIG_DEF_DMA1_1 8 184 - #define CONFIG_DEF_DMA1_2 8 185 - #define CONFIG_DEF_DMA1_3 8 186 - #define CONFIG_DEF_DMA1_4 8 187 - #define CONFIG_DEF_DMA1_5 8 188 - #define CONFIG_DEF_DMA1_6 8 189 - #define CONFIG_DEF_DMA1_7 8 190 - #define CONFIG_DEF_DMA1_8 8 191 - #define CONFIG_DEF_DMA1_9 8 192 - #define CONFIG_DEF_DMA1_10 8 193 - #define CONFIG_DEF_DMA1_11 8 194 - #define CONFIG_DEF_DMA2_0 9 195 - #define CONFIG_DEF_DMA2_1 9 196 - #define CONFIG_DEF_DMA2_2 9 197 - #define CONFIG_DEF_DMA2_3 9 198 - #define CONFIG_DEF_DMA2_4 9 199 - #define CONFIG_DEF_DMA2_5 9 200 - #define CONFIG_DEF_DMA2_6 9 201 - #define CONFIG_DEF_DMA2_7 9 202 - #define CONFIG_DEF_DMA2_8 9 203 - #define CONFIG_DEF_DMA2_9 9 204 - #define CONFIG_DEF_DMA2_10 9 205 - #define CONFIG_DEF_DMA2_11 9 206 - #define CONFIG_DEF_TIMER0 10 207 - #define CONFIG_DEF_TIMER1 10 208 - #define CONFIG_DEF_TIMER2 10 209 - #define CONFIG_DEF_TIMER3 10 210 - #define CONFIG_DEF_TIMER4 10 211 - #define CONFIG_DEF_TIMER5 10 212 - #define CONFIG_DEF_TIMER6 10 213 - #define CONFIG_DEF_TIMER7 10 214 - #define CONFIG_DEF_TIMER8 10 215 - #define CONFIG_DEF_TIMER9 10 216 - #define CONFIG_DEF_TIMER10 10 217 - #define CONFIG_DEF_TIMER11 10 218 - #define CONFIG_DEF_PROG0_INTA 11 219 - #define CONFIG_DEF_PROG0_INTB 11 220 - #define CONFIG_DEF_PROG1_INTA 11 221 - #define CONFIG_DEF_PROG1_INTB 11 222 - #define CONFIG_DEF_PROG2_INTA 11 223 - #define CONFIG_DEF_PROG2_INTB 11 224 - #define CONFIG_DEF_DMA1_WRRD0 8 225 - #define CONFIG_DEF_DMA1_WRRD1 8 226 - #define CONFIG_DEF_DMA2_WRRD0 9 227 - #define CONFIG_DEF_DMA2_WRRD1 9 228 - #define CONFIG_DEF_IMDMA_WRRD0 12 229 - #define CONFIG_DEF_IMDMA_WRRD1 12 230 - #define CONFIG_DEF_WATCH 13 231 - #define CONFIG_DEF_RESERVED_1 7 232 - #define CONFIG_DEF_RESERVED_2 7 233 - #define CONFIG_DEF_SUPPLE_0 7 234 - #define CONFIG_DEF_SUPPLE_1 7 235 269 236 270 /* IAR0 BIT FIELDS */ 237 - #define IRQ_PLL_WAKEUP_POS 0 238 - #define IRQ_DMA1_ERROR_POS 4 239 - #define IRQ_DMA2_ERROR_POS 8 240 - #define IRQ_IMDMA_ERROR_POS 12 241 - #define IRQ_PPI0_ERROR_POS 16 242 - #define IRQ_PPI1_ERROR_POS 20 243 - #define IRQ_SPORT0_ERROR_POS 24 244 - #define IRQ_SPORT1_ERROR_POS 28 245 - /* IAR1 BIT FIELDS */ 246 - #define IRQ_SPI_ERROR_POS 0 247 - #define IRQ_UART_ERROR_POS 4 248 - #define IRQ_RESERVED_ERROR_POS 8 249 - #define IRQ_DMA1_0_POS 12 250 - #define IRQ_DMA1_1_POS 16 251 - #define IRQ_DMA1_2_POS 20 252 - #define IRQ_DMA1_3_POS 24 253 - #define IRQ_DMA1_4_POS 28 254 - /* IAR2 BIT FIELDS */ 255 - #define IRQ_DMA1_5_POS 0 256 - #define IRQ_DMA1_6_POS 4 257 - #define IRQ_DMA1_7_POS 8 258 - #define IRQ_DMA1_8_POS 12 259 - #define IRQ_DMA1_9_POS 16 260 - #define IRQ_DMA1_10_POS 20 261 - #define IRQ_DMA1_11_POS 24 262 - #define IRQ_DMA2_0_POS 28 263 - /* IAR3 BIT FIELDS */ 264 - #define IRQ_DMA2_1_POS 0 265 - #define IRQ_DMA2_2_POS 4 266 - #define IRQ_DMA2_3_POS 8 267 - #define IRQ_DMA2_4_POS 12 268 - #define IRQ_DMA2_5_POS 16 269 - #define IRQ_DMA2_6_POS 20 270 - #define IRQ_DMA2_7_POS 24 271 - #define IRQ_DMA2_8_POS 28 272 - /* IAR4 BIT FIELDS */ 273 - #define IRQ_DMA2_9_POS 0 274 - #define IRQ_DMA2_10_POS 4 275 - #define IRQ_DMA2_11_POS 8 276 - #define IRQ_TIMER0_POS 12 277 - #define IRQ_TIMER1_POS 16 278 - #define IRQ_TIMER2_POS 20 279 - #define IRQ_TIMER3_POS 24 280 - #define IRQ_TIMER4_POS 28 281 - /* IAR5 BIT FIELDS */ 282 - #define IRQ_TIMER5_POS 0 283 - #define IRQ_TIMER6_POS 4 284 - #define IRQ_TIMER7_POS 8 285 - #define IRQ_TIMER8_POS 12 286 - #define IRQ_TIMER9_POS 16 287 - #define IRQ_TIMER10_POS 20 288 - #define IRQ_TIMER11_POS 24 289 - #define IRQ_PROG0_INTA_POS 28 290 - /* IAR6 BIT FIELDS */ 291 - #define IRQ_PROG0_INTB_POS 0 292 - #define IRQ_PROG1_INTA_POS 4 293 - #define IRQ_PROG1_INTB_POS 8 294 - #define IRQ_PROG2_INTA_POS 12 295 - #define IRQ_PROG2_INTB_POS 16 296 - #define IRQ_DMA1_WRRD0_POS 20 297 - #define IRQ_DMA1_WRRD1_POS 24 298 - #define IRQ_DMA2_WRRD0_POS 28 299 - /* IAR7 BIT FIELDS */ 300 - #define IRQ_DMA2_WRRD1_POS 0 301 - #define IRQ_IMDMA_WRRD0_POS 4 302 - #define IRQ_IMDMA_WRRD1_POS 8 303 - #define IRQ_WDTIMER_POS 12 304 - #define IRQ_RESERVED_1_POS 16 305 - #define IRQ_RESERVED_2_POS 20 306 - #define IRQ_SUPPLE_0_POS 24 307 - #define IRQ_SUPPLE_1_POS 28 271 + #define IRQ_PLL_WAKEUP_POS 0 272 + #define IRQ_DMA1_ERROR_POS 4 273 + #define IRQ_DMA2_ERROR_POS 8 274 + #define IRQ_IMDMA_ERROR_POS 12 275 + #define IRQ_PPI0_ERROR_POS 16 276 + #define IRQ_PPI1_ERROR_POS 20 277 + #define IRQ_SPORT0_ERROR_POS 24 278 + #define IRQ_SPORT1_ERROR_POS 28 308 279 309 - #endif /* _BF561_IRQ_H_ */ 280 + /* IAR1 BIT FIELDS */ 281 + #define IRQ_SPI_ERROR_POS 0 282 + #define IRQ_UART_ERROR_POS 4 283 + #define IRQ_RESERVED_ERROR_POS 8 284 + #define IRQ_DMA1_0_POS 12 285 + #define IRQ_DMA1_1_POS 16 286 + #define IRQ_DMA1_2_POS 20 287 + #define IRQ_DMA1_3_POS 24 288 + #define IRQ_DMA1_4_POS 28 289 + 290 + /* IAR2 BIT FIELDS */ 291 + #define IRQ_DMA1_5_POS 0 292 + #define IRQ_DMA1_6_POS 4 293 + #define IRQ_DMA1_7_POS 8 294 + #define IRQ_DMA1_8_POS 12 295 + #define IRQ_DMA1_9_POS 16 296 + #define IRQ_DMA1_10_POS 20 297 + #define IRQ_DMA1_11_POS 24 298 + #define IRQ_DMA2_0_POS 28 299 + 300 + /* IAR3 BIT FIELDS */ 301 + #define IRQ_DMA2_1_POS 0 302 + #define IRQ_DMA2_2_POS 4 303 + #define IRQ_DMA2_3_POS 8 304 + #define IRQ_DMA2_4_POS 12 305 + #define IRQ_DMA2_5_POS 16 306 + #define IRQ_DMA2_6_POS 20 307 + #define IRQ_DMA2_7_POS 24 308 + #define IRQ_DMA2_8_POS 28 309 + 310 + /* IAR4 BIT FIELDS */ 311 + #define IRQ_DMA2_9_POS 0 312 + #define IRQ_DMA2_10_POS 4 313 + #define IRQ_DMA2_11_POS 8 314 + #define IRQ_TIMER0_POS 12 315 + #define IRQ_TIMER1_POS 16 316 + #define IRQ_TIMER2_POS 20 317 + #define IRQ_TIMER3_POS 24 318 + #define IRQ_TIMER4_POS 28 319 + 320 + /* IAR5 BIT FIELDS */ 321 + #define IRQ_TIMER5_POS 0 322 + #define IRQ_TIMER6_POS 4 323 + #define IRQ_TIMER7_POS 8 324 + #define IRQ_TIMER8_POS 12 325 + #define IRQ_TIMER9_POS 16 326 + #define IRQ_TIMER10_POS 20 327 + #define IRQ_TIMER11_POS 24 328 + #define IRQ_PROG0_INTA_POS 28 329 + 330 + /* IAR6 BIT FIELDS */ 331 + #define IRQ_PROG0_INTB_POS 0 332 + #define IRQ_PROG1_INTA_POS 4 333 + #define IRQ_PROG1_INTB_POS 8 334 + #define IRQ_PROG2_INTA_POS 12 335 + #define IRQ_PROG2_INTB_POS 16 336 + #define IRQ_DMA1_WRRD0_POS 20 337 + #define IRQ_DMA1_WRRD1_POS 24 338 + #define IRQ_DMA2_WRRD0_POS 28 339 + 340 + /* IAR7 BIT FIELDS */ 341 + #define IRQ_DMA2_WRRD1_POS 0 342 + #define IRQ_IMDMA_WRRD0_POS 4 343 + #define IRQ_IMDMA_WRRD1_POS 8 344 + #define IRQ_WDTIMER_POS 12 345 + #define IRQ_RESERVED_1_POS 16 346 + #define IRQ_RESERVED_2_POS 20 347 + #define IRQ_SUPPLE_0_POS 24 348 + #define IRQ_SUPPLE_1_POS 28 349 + 350 + #endif
+10 -7
arch/blackfin/mach-bf561/smp.c
··· 24 24 25 25 void __init platform_init_cpus(void) 26 26 { 27 - cpu_set(0, cpu_possible_map); /* CoreA */ 28 - cpu_set(1, cpu_possible_map); /* CoreB */ 27 + struct cpumask mask; 28 + 29 + cpumask_set_cpu(0, &mask); /* CoreA */ 30 + cpumask_set_cpu(1, &mask); /* CoreB */ 31 + init_cpu_possible(&mask); 29 32 } 30 33 31 34 void __init platform_prepare_cpus(unsigned int max_cpus) 32 35 { 36 + struct cpumask mask; 37 + 33 38 bfin_relocate_coreb_l1_mem(); 34 39 35 40 /* Both cores ought to be present on a bf561! */ 36 - cpu_set(0, cpu_present_map); /* CoreA */ 37 - cpu_set(1, cpu_present_map); /* CoreB */ 41 + cpumask_set_cpu(0, &mask); /* CoreA */ 42 + cpumask_set_cpu(1, &mask); /* CoreB */ 43 + init_cpu_present(&mask); 38 44 } 39 45 40 46 int __init setup_profiling_timer(unsigned int multiplier) /* not supported */ ··· 67 61 bfin_write_SICB_IWR0(IWR_DISABLE_ALL); 68 62 bfin_write_SICB_IWR1(IWR_DISABLE_ALL); 69 63 SSYNC(); 70 - 71 - /* Store CPU-private information to the cpu_data array. */ 72 - bfin_setup_cpudata(cpu); 73 64 74 65 /* We are done with local CPU inits, unblock the boot CPU. */ 75 66 set_cpu_online(cpu, true);
+4 -3
arch/blackfin/mach-common/dpmc.c
··· 85 85 { 86 86 unsigned int cpu; 87 87 unsigned int this_cpu = smp_processor_id(); 88 - cpumask_t mask = cpu_online_map; 88 + cpumask_t mask; 89 89 90 - cpu_clear(this_cpu, mask); 91 - for_each_cpu_mask(cpu, mask) 90 + cpumask_copy(&mask, cpu_online_mask); 91 + cpumask_clear_cpu(this_cpu, &mask); 92 + for_each_cpu(cpu, &mask) 92 93 platform_send_ipi_cpu(cpu, IRQ_SUPPLE_0); 93 94 } 94 95
+136 -350
arch/blackfin/mach-common/ints-priority.c
··· 19 19 #ifdef CONFIG_IPIPE 20 20 #include <linux/ipipe.h> 21 21 #endif 22 - #ifdef CONFIG_KGDB 23 - #include <linux/kgdb.h> 24 - #endif 25 22 #include <asm/traps.h> 26 23 #include <asm/blackfin.h> 27 24 #include <asm/gpio.h> 28 25 #include <asm/irq_handler.h> 29 26 #include <asm/dpmc.h> 30 - #include <asm/bfin5xx_spi.h> 31 - #include <asm/bfin_sport.h> 32 - #include <asm/bfin_can.h> 33 27 34 28 #define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1)) 35 - 36 - #ifdef BF537_FAMILY 37 - # define BF537_GENERIC_ERROR_INT_DEMUX 38 - # define SPI_ERR_MASK (BIT_STAT_TXCOL | BIT_STAT_RBSY | BIT_STAT_MODF | BIT_STAT_TXE) /* SPI_STAT */ 39 - # define SPORT_ERR_MASK (ROVF | RUVF | TOVF | TUVF) /* SPORT_STAT */ 40 - # define PPI_ERR_MASK (0xFFFF & ~FLD) /* PPI_STATUS */ 41 - # define EMAC_ERR_MASK (PHYINT | MMCINT | RXFSINT | TXFSINT | WAKEDET | RXDMAERR | TXDMAERR | STMDONE) /* EMAC_SYSTAT */ 42 - # define UART_ERR_MASK (0x6) /* UART_IIR */ 43 - # define CAN_ERR_MASK (EWTIF | EWRIF | EPIF | BOIF | WUIF | UIAIF | AAIF | RMLIF | UCEIF | EXTIF | ADIF) /* CAN_GIF */ 44 - #else 45 - # undef BF537_GENERIC_ERROR_INT_DEMUX 46 - #endif 47 29 48 30 /* 49 31 * NOTES: ··· 45 63 EXPORT_SYMBOL(bfin_irq_flags); 46 64 #endif 47 65 48 - /* The number of spurious interrupts */ 49 - atomic_t num_spurious; 50 - 51 66 #ifdef CONFIG_PM 52 67 unsigned long bfin_sic_iwr[3]; /* Up to 3 SIC_IWRx registers */ 53 68 unsigned vr_wakeup; 54 69 #endif 55 70 56 - struct ivgx { 71 + static struct ivgx { 57 72 /* irq number for request_irq, available in mach-bf5xx/irq.h */ 58 73 unsigned int irqno; 59 74 /* corresponding bit in the SIC_ISR register */ 60 75 unsigned int isrflag; 61 76 } ivg_table[NR_PERI_INTS]; 62 77 63 - struct ivg_slice { 78 + static struct ivg_slice { 64 79 /* position of first irq in ivg_table for given ivg */ 65 80 struct ivgx *ifirst; 66 81 struct ivgx *istop; ··· 104 125 * This is for core internal IRQs 105 126 */ 106 127 107 - static void bfin_ack_noop(struct irq_data *d) 128 + void bfin_ack_noop(struct irq_data *d) 108 129 { 109 130 /* Dummy function. */ 110 131 } ··· 133 154 return; 134 155 } 135 156 136 - static void bfin_internal_mask_irq(unsigned int irq) 157 + void bfin_internal_mask_irq(unsigned int irq) 137 158 { 138 - unsigned long flags; 159 + unsigned long flags = hard_local_irq_save(); 139 160 140 - #ifdef CONFIG_BF53x 141 - flags = hard_local_irq_save(); 142 - bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() & 143 - ~(1 << SIC_SYSIRQ(irq))); 144 - #else 145 - unsigned mask_bank, mask_bit; 146 - flags = hard_local_irq_save(); 147 - mask_bank = SIC_SYSIRQ(irq) / 32; 148 - mask_bit = SIC_SYSIRQ(irq) % 32; 161 + #ifdef SIC_IMASK0 162 + unsigned mask_bank = SIC_SYSIRQ(irq) / 32; 163 + unsigned mask_bit = SIC_SYSIRQ(irq) % 32; 149 164 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) & 150 165 ~(1 << mask_bit)); 151 - #ifdef CONFIG_SMP 166 + # ifdef CONFIG_SMP 152 167 bfin_write_SICB_IMASK(mask_bank, bfin_read_SICB_IMASK(mask_bank) & 153 168 ~(1 << mask_bit)); 169 + # endif 170 + #else 171 + bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() & 172 + ~(1 << SIC_SYSIRQ(irq))); 154 173 #endif 155 - #endif 174 + 156 175 hard_local_irq_restore(flags); 157 176 } 158 177 ··· 163 186 static void bfin_internal_unmask_irq_affinity(unsigned int irq, 164 187 const struct cpumask *affinity) 165 188 #else 166 - static void bfin_internal_unmask_irq(unsigned int irq) 189 + void bfin_internal_unmask_irq(unsigned int irq) 167 190 #endif 168 191 { 169 - unsigned long flags; 192 + unsigned long flags = hard_local_irq_save(); 170 193 171 - #ifdef CONFIG_BF53x 172 - flags = hard_local_irq_save(); 173 - bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() | 174 - (1 << SIC_SYSIRQ(irq))); 175 - #else 176 - unsigned mask_bank, mask_bit; 177 - flags = hard_local_irq_save(); 178 - mask_bank = SIC_SYSIRQ(irq) / 32; 179 - mask_bit = SIC_SYSIRQ(irq) % 32; 180 - #ifdef CONFIG_SMP 194 + #ifdef SIC_IMASK0 195 + unsigned mask_bank = SIC_SYSIRQ(irq) / 32; 196 + unsigned mask_bit = SIC_SYSIRQ(irq) % 32; 197 + # ifdef CONFIG_SMP 181 198 if (cpumask_test_cpu(0, affinity)) 182 - #endif 199 + # endif 183 200 bfin_write_SIC_IMASK(mask_bank, 184 201 bfin_read_SIC_IMASK(mask_bank) | 185 202 (1 << mask_bit)); 186 - #ifdef CONFIG_SMP 203 + # ifdef CONFIG_SMP 187 204 if (cpumask_test_cpu(1, affinity)) 188 205 bfin_write_SICB_IMASK(mask_bank, 189 206 bfin_read_SICB_IMASK(mask_bank) | 190 207 (1 << mask_bit)); 208 + # endif 209 + #else 210 + bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() | 211 + (1 << SIC_SYSIRQ(irq))); 191 212 #endif 192 - #endif 213 + 193 214 hard_local_irq_restore(flags); 194 215 } 195 216 ··· 270 295 { 271 296 return bfin_internal_set_wake(d->irq, state); 272 297 } 298 + #else 299 + # define bfin_internal_set_wake_chip NULL 273 300 #endif 274 301 275 302 static struct irq_chip bfin_core_irqchip = { ··· 292 315 #ifdef CONFIG_SMP 293 316 .irq_set_affinity = bfin_internal_set_affinity, 294 317 #endif 295 - #ifdef CONFIG_PM 296 318 .irq_set_wake = bfin_internal_set_wake_chip, 297 - #endif 298 319 }; 299 320 300 - static void bfin_handle_irq(unsigned irq) 321 + void bfin_handle_irq(unsigned irq) 301 322 { 302 323 #ifdef CONFIG_IPIPE 303 324 struct pt_regs regs; /* Contents not used. */ ··· 306 331 generic_handle_irq(irq); 307 332 #endif /* !CONFIG_IPIPE */ 308 333 } 309 - 310 - #ifdef BF537_GENERIC_ERROR_INT_DEMUX 311 - static int error_int_mask; 312 - 313 - static void bfin_generic_error_mask_irq(struct irq_data *d) 314 - { 315 - error_int_mask &= ~(1L << (d->irq - IRQ_PPI_ERROR)); 316 - if (!error_int_mask) 317 - bfin_internal_mask_irq(IRQ_GENERIC_ERROR); 318 - } 319 - 320 - static void bfin_generic_error_unmask_irq(struct irq_data *d) 321 - { 322 - bfin_internal_unmask_irq(IRQ_GENERIC_ERROR); 323 - error_int_mask |= 1L << (d->irq - IRQ_PPI_ERROR); 324 - } 325 - 326 - static struct irq_chip bfin_generic_error_irqchip = { 327 - .name = "ERROR", 328 - .irq_ack = bfin_ack_noop, 329 - .irq_mask_ack = bfin_generic_error_mask_irq, 330 - .irq_mask = bfin_generic_error_mask_irq, 331 - .irq_unmask = bfin_generic_error_unmask_irq, 332 - }; 333 - 334 - static void bfin_demux_error_irq(unsigned int int_err_irq, 335 - struct irq_desc *inta_desc) 336 - { 337 - int irq = 0; 338 - 339 - #if (defined(CONFIG_BF537) || defined(CONFIG_BF536)) 340 - if (bfin_read_EMAC_SYSTAT() & EMAC_ERR_MASK) 341 - irq = IRQ_MAC_ERROR; 342 - else 343 - #endif 344 - if (bfin_read_SPORT0_STAT() & SPORT_ERR_MASK) 345 - irq = IRQ_SPORT0_ERROR; 346 - else if (bfin_read_SPORT1_STAT() & SPORT_ERR_MASK) 347 - irq = IRQ_SPORT1_ERROR; 348 - else if (bfin_read_PPI_STATUS() & PPI_ERR_MASK) 349 - irq = IRQ_PPI_ERROR; 350 - else if (bfin_read_CAN_GIF() & CAN_ERR_MASK) 351 - irq = IRQ_CAN_ERROR; 352 - else if (bfin_read_SPI_STAT() & SPI_ERR_MASK) 353 - irq = IRQ_SPI_ERROR; 354 - else if ((bfin_read_UART0_IIR() & UART_ERR_MASK) == UART_ERR_MASK) 355 - irq = IRQ_UART0_ERROR; 356 - else if ((bfin_read_UART1_IIR() & UART_ERR_MASK) == UART_ERR_MASK) 357 - irq = IRQ_UART1_ERROR; 358 - 359 - if (irq) { 360 - if (error_int_mask & (1L << (irq - IRQ_PPI_ERROR))) 361 - bfin_handle_irq(irq); 362 - else { 363 - 364 - switch (irq) { 365 - case IRQ_PPI_ERROR: 366 - bfin_write_PPI_STATUS(PPI_ERR_MASK); 367 - break; 368 - #if (defined(CONFIG_BF537) || defined(CONFIG_BF536)) 369 - case IRQ_MAC_ERROR: 370 - bfin_write_EMAC_SYSTAT(EMAC_ERR_MASK); 371 - break; 372 - #endif 373 - case IRQ_SPORT0_ERROR: 374 - bfin_write_SPORT0_STAT(SPORT_ERR_MASK); 375 - break; 376 - 377 - case IRQ_SPORT1_ERROR: 378 - bfin_write_SPORT1_STAT(SPORT_ERR_MASK); 379 - break; 380 - 381 - case IRQ_CAN_ERROR: 382 - bfin_write_CAN_GIS(CAN_ERR_MASK); 383 - break; 384 - 385 - case IRQ_SPI_ERROR: 386 - bfin_write_SPI_STAT(SPI_ERR_MASK); 387 - break; 388 - 389 - default: 390 - break; 391 - } 392 - 393 - pr_debug("IRQ %d:" 394 - " MASKED PERIPHERAL ERROR INTERRUPT ASSERTED\n", 395 - irq); 396 - } 397 - } else 398 - printk(KERN_ERR 399 - "%s : %s : LINE %d :\nIRQ ?: PERIPHERAL ERROR" 400 - " INTERRUPT ASSERTED BUT NO SOURCE FOUND\n", 401 - __func__, __FILE__, __LINE__); 402 - 403 - } 404 - #endif /* BF537_GENERIC_ERROR_INT_DEMUX */ 405 334 406 335 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 407 336 static int mac_stat_int_mask; ··· 347 468 unsigned int irq = d->irq; 348 469 349 470 mac_stat_int_mask &= ~(1L << (irq - IRQ_MAC_PHYINT)); 350 - #ifdef BF537_GENERIC_ERROR_INT_DEMUX 471 + #ifdef BF537_FAMILY 351 472 switch (irq) { 352 473 case IRQ_MAC_PHYINT: 353 474 bfin_write_EMAC_SYSCTL(bfin_read_EMAC_SYSCTL() & ~PHYIE); ··· 366 487 { 367 488 unsigned int irq = d->irq; 368 489 369 - #ifdef BF537_GENERIC_ERROR_INT_DEMUX 490 + #ifdef BF537_FAMILY 370 491 switch (irq) { 371 492 case IRQ_MAC_PHYINT: 372 493 bfin_write_EMAC_SYSCTL(bfin_read_EMAC_SYSCTL() | PHYIE); ··· 384 505 #ifdef CONFIG_PM 385 506 int bfin_mac_status_set_wake(struct irq_data *d, unsigned int state) 386 507 { 387 - #ifdef BF537_GENERIC_ERROR_INT_DEMUX 508 + #ifdef BF537_FAMILY 388 509 return bfin_internal_set_wake(IRQ_GENERIC_ERROR, state); 389 510 #else 390 511 return bfin_internal_set_wake(IRQ_MAC_ERROR, state); 391 512 #endif 392 513 } 514 + #else 515 + # define bfin_mac_status_set_wake NULL 393 516 #endif 394 517 395 518 static struct irq_chip bfin_mac_status_irqchip = { ··· 400 519 .irq_mask_ack = bfin_mac_status_mask_irq, 401 520 .irq_mask = bfin_mac_status_mask_irq, 402 521 .irq_unmask = bfin_mac_status_unmask_irq, 403 - #ifdef CONFIG_PM 404 522 .irq_set_wake = bfin_mac_status_set_wake, 405 - #endif 406 523 }; 407 524 408 - static void bfin_demux_mac_status_irq(unsigned int int_err_irq, 409 - struct irq_desc *inta_desc) 525 + void bfin_demux_mac_status_irq(unsigned int int_err_irq, 526 + struct irq_desc *inta_desc) 410 527 { 411 528 int i, irq = 0; 412 529 u32 status = bfin_read_EMAC_SYSTAT(); ··· 559 680 } 560 681 561 682 #ifdef CONFIG_PM 562 - int bfin_gpio_set_wake(struct irq_data *d, unsigned int state) 683 + static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state) 563 684 { 564 685 return gpio_pm_wakeup_ctrl(irq_to_gpio(d->irq), state); 565 686 } 687 + #else 688 + # define bfin_gpio_set_wake NULL 566 689 #endif 567 690 568 - static void bfin_demux_gpio_irq(unsigned int inta_irq, 569 - struct irq_desc *desc) 691 + static void bfin_demux_gpio_block(unsigned int irq) 570 692 { 571 - unsigned int i, gpio, mask, irq, search = 0; 693 + unsigned int gpio, mask; 694 + 695 + gpio = irq_to_gpio(irq); 696 + mask = get_gpiop_data(gpio) & get_gpiop_maska(gpio); 697 + 698 + while (mask) { 699 + if (mask & 1) 700 + bfin_handle_irq(irq); 701 + irq++; 702 + mask >>= 1; 703 + } 704 + } 705 + 706 + void bfin_demux_gpio_irq(unsigned int inta_irq, 707 + struct irq_desc *desc) 708 + { 709 + unsigned int irq; 572 710 573 711 switch (inta_irq) { 574 - #if defined(CONFIG_BF53x) 575 - case IRQ_PROG_INTA: 576 - irq = IRQ_PF0; 577 - search = 1; 712 + #if defined(BF537_FAMILY) 713 + case IRQ_PF_INTA_PG_INTA: 714 + bfin_demux_gpio_block(IRQ_PF0); 715 + irq = IRQ_PG0; 578 716 break; 579 - # if defined(BF537_FAMILY) && !(defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)) 580 - case IRQ_MAC_RX: 717 + case IRQ_PH_INTA_MAC_RX: 581 718 irq = IRQ_PH0; 582 719 break; 583 - # endif 584 - #elif defined(CONFIG_BF538) || defined(CONFIG_BF539) 720 + #elif defined(BF533_FAMILY) 721 + case IRQ_PROG_INTA: 722 + irq = IRQ_PF0; 723 + break; 724 + #elif defined(BF538_FAMILY) 585 725 case IRQ_PORTF_INTA: 586 726 irq = IRQ_PF0; 587 727 break; ··· 630 732 return; 631 733 } 632 734 633 - if (search) { 634 - for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { 635 - irq += i; 636 - 637 - mask = get_gpiop_data(i) & get_gpiop_maska(i); 638 - 639 - while (mask) { 640 - if (mask & 1) 641 - bfin_handle_irq(irq); 642 - irq++; 643 - mask >>= 1; 644 - } 645 - } 646 - } else { 647 - gpio = irq_to_gpio(irq); 648 - mask = get_gpiop_data(gpio) & get_gpiop_maska(gpio); 649 - 650 - do { 651 - if (mask & 1) 652 - bfin_handle_irq(irq); 653 - irq++; 654 - mask >>= 1; 655 - } while (mask); 656 - } 657 - 735 + bfin_demux_gpio_block(irq); 658 736 } 659 737 660 738 #else /* CONFIG_BF54x */ ··· 848 974 } 849 975 850 976 #ifdef CONFIG_PM 851 - u32 pint_saved_masks[NR_PINT_SYS_IRQS]; 852 - u32 pint_wakeup_masks[NR_PINT_SYS_IRQS]; 853 - 854 - int bfin_gpio_set_wake(struct irq_data *d, unsigned int state) 977 + static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state) 855 978 { 856 979 u32 pint_irq; 857 980 u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; 858 981 u32 bank = PINT_2_BANK(pint_val); 859 - u32 pintbit = PINT_BIT(pint_val); 860 982 861 983 switch (bank) { 862 984 case 0: ··· 873 1003 874 1004 bfin_internal_set_wake(pint_irq, state); 875 1005 876 - if (state) 877 - pint_wakeup_masks[bank] |= pintbit; 878 - else 879 - pint_wakeup_masks[bank] &= ~pintbit; 880 - 881 1006 return 0; 882 1007 } 883 - 884 - u32 bfin_pm_setup(void) 885 - { 886 - u32 val, i; 887 - 888 - for (i = 0; i < NR_PINT_SYS_IRQS; i++) { 889 - val = pint[i]->mask_clear; 890 - pint_saved_masks[i] = val; 891 - if (val ^ pint_wakeup_masks[i]) { 892 - pint[i]->mask_clear = val; 893 - pint[i]->mask_set = pint_wakeup_masks[i]; 894 - } 895 - } 896 - 897 - return 0; 898 - } 899 - 900 - void bfin_pm_restore(void) 901 - { 902 - u32 i, val; 903 - 904 - for (i = 0; i < NR_PINT_SYS_IRQS; i++) { 905 - val = pint_saved_masks[i]; 906 - if (val ^ pint_wakeup_masks[i]) { 907 - pint[i]->mask_clear = pint[i]->mask_clear; 908 - pint[i]->mask_set = val; 909 - } 910 - } 911 - } 1008 + #else 1009 + # define bfin_gpio_set_wake NULL 912 1010 #endif 913 1011 914 - static void bfin_demux_gpio_irq(unsigned int inta_irq, 915 - struct irq_desc *desc) 1012 + void bfin_demux_gpio_irq(unsigned int inta_irq, 1013 + struct irq_desc *desc) 916 1014 { 917 1015 u32 bank, pint_val; 918 1016 u32 request, irq; ··· 929 1091 .irq_set_type = bfin_gpio_irq_type, 930 1092 .irq_startup = bfin_gpio_irq_startup, 931 1093 .irq_shutdown = bfin_gpio_irq_shutdown, 932 - #ifdef CONFIG_PM 933 1094 .irq_set_wake = bfin_gpio_set_wake, 934 - #endif 935 1095 }; 936 1096 937 1097 void __cpuinit init_exception_vectors(void) ··· 963 1127 { 964 1128 int irq; 965 1129 unsigned long ilat = 0; 1130 + 966 1131 /* Disable all the peripheral intrs - page 4-29 HW Ref manual */ 967 - #if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) \ 968 - || defined(BF538_FAMILY) || defined(CONFIG_BF51x) 1132 + #ifdef SIC_IMASK0 969 1133 bfin_write_SIC_IMASK0(SIC_UNMASK_ALL); 970 1134 bfin_write_SIC_IMASK1(SIC_UNMASK_ALL); 971 - # ifdef CONFIG_BF54x 1135 + # ifdef SIC_IMASK2 972 1136 bfin_write_SIC_IMASK2(SIC_UNMASK_ALL); 973 1137 # endif 974 1138 # ifdef CONFIG_SMP ··· 980 1144 #endif 981 1145 982 1146 local_irq_disable(); 983 - 984 - #if (defined(CONFIG_BF537) || defined(CONFIG_BF536)) 985 - /* Clear EMAC Interrupt Status bits so we can demux it later */ 986 - bfin_write_EMAC_SYSTAT(-1); 987 - #endif 988 1147 989 1148 #ifdef CONFIG_BF54x 990 1149 # ifdef CONFIG_PINTx_REASSIGN ··· 999 1168 irq_set_chip(irq, &bfin_internal_irqchip); 1000 1169 1001 1170 switch (irq) { 1002 - #if defined(CONFIG_BF53x) 1171 + #if defined(BF537_FAMILY) 1172 + case IRQ_PH_INTA_MAC_RX: 1173 + case IRQ_PF_INTA_PG_INTA: 1174 + #elif defined(BF533_FAMILY) 1003 1175 case IRQ_PROG_INTA: 1004 - # if defined(BF537_FAMILY) && !(defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)) 1005 - case IRQ_MAC_RX: 1006 - # endif 1007 1176 #elif defined(CONFIG_BF54x) 1008 1177 case IRQ_PINT0: 1009 1178 case IRQ_PINT1: ··· 1017 1186 case IRQ_PROG0_INTA: 1018 1187 case IRQ_PROG1_INTA: 1019 1188 case IRQ_PROG2_INTA: 1020 - #elif defined(CONFIG_BF538) || defined(CONFIG_BF539) 1189 + #elif defined(BF538_FAMILY) 1021 1190 case IRQ_PORTF_INTA: 1022 1191 #endif 1023 1192 irq_set_chained_handler(irq, bfin_demux_gpio_irq); 1024 1193 break; 1025 - #ifdef BF537_GENERIC_ERROR_INT_DEMUX 1026 - case IRQ_GENERIC_ERROR: 1027 - irq_set_chained_handler(irq, bfin_demux_error_irq); 1028 - break; 1029 - #endif 1030 1194 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 1031 1195 case IRQ_MAC_ERROR: 1032 1196 irq_set_chained_handler(irq, ··· 1039 1213 case IRQ_CORETMR: 1040 1214 # ifdef CONFIG_SMP 1041 1215 irq_set_handler(irq, handle_percpu_irq); 1042 - break; 1043 1216 # else 1044 1217 irq_set_handler(irq, handle_simple_irq); 1045 - break; 1046 1218 # endif 1219 + break; 1047 1220 #endif 1048 1221 1049 1222 #ifdef CONFIG_TICKSOURCE_GPTMR0 ··· 1051 1226 break; 1052 1227 #endif 1053 1228 1229 + default: 1054 1230 #ifdef CONFIG_IPIPE 1055 - default: 1056 1231 irq_set_handler(irq, handle_level_irq); 1057 - break; 1058 - #else /* !CONFIG_IPIPE */ 1059 - default: 1232 + #else 1060 1233 irq_set_handler(irq, handle_simple_irq); 1234 + #endif 1061 1235 break; 1062 - #endif /* !CONFIG_IPIPE */ 1063 1236 } 1064 1237 } 1065 1238 1066 - #ifdef BF537_GENERIC_ERROR_INT_DEMUX 1067 - for (irq = IRQ_PPI_ERROR; irq <= IRQ_UART1_ERROR; irq++) 1068 - irq_set_chip_and_handler(irq, &bfin_generic_error_irqchip, 1069 - handle_level_irq); 1070 - #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 1071 - irq_set_chained_handler(IRQ_MAC_ERROR, bfin_demux_mac_status_irq); 1072 - #endif 1073 - #endif 1239 + init_mach_irq(); 1074 1240 1075 1241 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 1076 1242 for (irq = IRQ_MAC_PHYINT; irq <= IRQ_MAC_STMDONE; irq++) ··· 1123 1307 #ifdef CONFIG_DO_IRQ_L1 1124 1308 __attribute__((l1_text)) 1125 1309 #endif 1310 + static int vec_to_irq(int vec) 1311 + { 1312 + struct ivgx *ivg = ivg7_13[vec - IVG7].ifirst; 1313 + struct ivgx *ivg_stop = ivg7_13[vec - IVG7].istop; 1314 + unsigned long sic_status[3]; 1315 + 1316 + if (likely(vec == EVT_IVTMR_P)) 1317 + return IRQ_CORETMR; 1318 + 1319 + #ifdef SIC_ISR 1320 + sic_status[0] = bfin_read_SIC_IMASK() & bfin_read_SIC_ISR(); 1321 + #else 1322 + if (smp_processor_id()) { 1323 + # ifdef SICB_ISR0 1324 + /* This will be optimized out in UP mode. */ 1325 + sic_status[0] = bfin_read_SICB_ISR0() & bfin_read_SICB_IMASK0(); 1326 + sic_status[1] = bfin_read_SICB_ISR1() & bfin_read_SICB_IMASK1(); 1327 + # endif 1328 + } else { 1329 + sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0(); 1330 + sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1(); 1331 + } 1332 + #endif 1333 + #ifdef SIC_ISR2 1334 + sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2(); 1335 + #endif 1336 + 1337 + for (;; ivg++) { 1338 + if (ivg >= ivg_stop) 1339 + return -1; 1340 + #ifdef SIC_ISR 1341 + if (sic_status[0] & ivg->isrflag) 1342 + #else 1343 + if (sic_status[(ivg->irqno - IVG7) / 32] & ivg->isrflag) 1344 + #endif 1345 + return ivg->irqno; 1346 + } 1347 + } 1348 + 1349 + #ifdef CONFIG_DO_IRQ_L1 1350 + __attribute__((l1_text)) 1351 + #endif 1126 1352 void do_irq(int vec, struct pt_regs *fp) 1127 1353 { 1128 - if (vec == EVT_IVTMR_P) { 1129 - vec = IRQ_CORETMR; 1130 - } else { 1131 - struct ivgx *ivg = ivg7_13[vec - IVG7].ifirst; 1132 - struct ivgx *ivg_stop = ivg7_13[vec - IVG7].istop; 1133 - #if defined(SIC_ISR0) 1134 - unsigned long sic_status[3]; 1135 - 1136 - if (smp_processor_id()) { 1137 - # ifdef SICB_ISR0 1138 - /* This will be optimized out in UP mode. */ 1139 - sic_status[0] = bfin_read_SICB_ISR0() & bfin_read_SICB_IMASK0(); 1140 - sic_status[1] = bfin_read_SICB_ISR1() & bfin_read_SICB_IMASK1(); 1141 - # endif 1142 - } else { 1143 - sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0(); 1144 - sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1(); 1145 - } 1146 - # ifdef SIC_ISR2 1147 - sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2(); 1148 - # endif 1149 - for (;; ivg++) { 1150 - if (ivg >= ivg_stop) { 1151 - atomic_inc(&num_spurious); 1152 - return; 1153 - } 1154 - if (sic_status[(ivg->irqno - IVG7) / 32] & ivg->isrflag) 1155 - break; 1156 - } 1157 - #else 1158 - unsigned long sic_status; 1159 - 1160 - sic_status = bfin_read_SIC_IMASK() & bfin_read_SIC_ISR(); 1161 - 1162 - for (;; ivg++) { 1163 - if (ivg >= ivg_stop) { 1164 - atomic_inc(&num_spurious); 1165 - return; 1166 - } else if (sic_status & ivg->isrflag) 1167 - break; 1168 - } 1169 - #endif 1170 - vec = ivg->irqno; 1171 - } 1172 - asm_do_IRQ(vec, fp); 1354 + int irq = vec_to_irq(vec); 1355 + if (irq == -1) 1356 + return; 1357 + asm_do_IRQ(irq, fp); 1173 1358 } 1174 1359 1175 1360 #ifdef CONFIG_IPIPE ··· 1208 1391 struct ivgx *ivg = ivg7_13[vec-IVG7].ifirst; 1209 1392 int irq, s = 0; 1210 1393 1211 - if (likely(vec == EVT_IVTMR_P)) 1212 - irq = IRQ_CORETMR; 1213 - else { 1214 - #if defined(SIC_ISR0) 1215 - unsigned long sic_status[3]; 1216 - 1217 - sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0(); 1218 - sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1(); 1219 - # ifdef SIC_ISR2 1220 - sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2(); 1221 - # endif 1222 - for (;; ivg++) { 1223 - if (ivg >= ivg_stop) { 1224 - atomic_inc(&num_spurious); 1225 - return 0; 1226 - } 1227 - if (sic_status[(ivg->irqno - IVG7) / 32] & ivg->isrflag) 1228 - break; 1229 - } 1230 - #else 1231 - unsigned long sic_status; 1232 - 1233 - sic_status = bfin_read_SIC_IMASK() & bfin_read_SIC_ISR(); 1234 - 1235 - for (;; ivg++) { 1236 - if (ivg >= ivg_stop) { 1237 - atomic_inc(&num_spurious); 1238 - return 0; 1239 - } else if (sic_status & ivg->isrflag) 1240 - break; 1241 - } 1242 - #endif 1243 - irq = ivg->irqno; 1244 - } 1394 + irq = vec_to_irq(vec); 1395 + if (irq == -1) 1396 + return 0; 1245 1397 1246 1398 if (irq == IRQ_SYSTMR) { 1247 1399 #if !defined(CONFIG_GENERIC_CLOCKEVENTS) || defined(CONFIG_TICKSOURCE_GPTMR0)
+15 -13
arch/blackfin/mach-common/smp.c
··· 25 25 #include <linux/slab.h> 26 26 #include <asm/atomic.h> 27 27 #include <asm/cacheflush.h> 28 + #include <asm/irq_handler.h> 28 29 #include <asm/mmu_context.h> 29 30 #include <asm/pgtable.h> 30 31 #include <asm/pgalloc.h> ··· 97 96 dump_stack(); 98 97 spin_unlock(&stop_lock); 99 98 100 - cpu_clear(cpu, cpu_online_map); 99 + set_cpu_online(cpu, false); 101 100 102 101 local_irq_disable(); 103 102 ··· 147 146 */ 148 147 resync_core_dcache(); 149 148 #endif 150 - cpu_clear(cpu, *msg->call_struct.waitmask); 149 + cpumask_clear_cpu(cpu, msg->call_struct.waitmask); 151 150 } 152 151 } 153 152 ··· 223 222 struct ipi_message_queue *msg_queue; 224 223 struct ipi_message *msg; 225 224 unsigned long flags, next_msg; 226 - cpumask_t waitmask = callmap; /* waitmask is shared by all cpus */ 225 + cpumask_t waitmask; /* waitmask is shared by all cpus */ 227 226 228 - for_each_cpu_mask(cpu, callmap) { 227 + cpumask_copy(&waitmask, &callmap); 228 + for_each_cpu(cpu, &callmap) { 229 229 msg_queue = &per_cpu(ipi_msg_queue, cpu); 230 230 spin_lock_irqsave(&msg_queue->lock, flags); 231 231 if (msg_queue->count < BFIN_IPI_MSGQ_LEN) { ··· 248 246 } 249 247 250 248 if (wait) { 251 - while (!cpus_empty(waitmask)) 249 + while (!cpumask_empty(&waitmask)) 252 250 blackfin_dcache_invalidate_range( 253 251 (unsigned long)(&waitmask), 254 252 (unsigned long)(&waitmask)); ··· 267 265 cpumask_t callmap; 268 266 269 267 preempt_disable(); 270 - callmap = cpu_online_map; 271 - cpu_clear(smp_processor_id(), callmap); 272 - if (!cpus_empty(callmap)) 268 + cpumask_copy(&callmap, cpu_online_mask); 269 + cpumask_clear_cpu(smp_processor_id(), &callmap); 270 + if (!cpumask_empty(&callmap)) 273 271 smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); 274 272 275 273 preempt_enable(); ··· 286 284 287 285 if (cpu_is_offline(cpu)) 288 286 return 0; 289 - cpus_clear(callmap); 290 - cpu_set(cpu, callmap); 287 + cpumask_clear(&callmap); 288 + cpumask_set_cpu(cpu, &callmap); 291 289 292 290 smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); 293 291 ··· 310 308 cpumask_t callmap; 311 309 312 310 preempt_disable(); 313 - callmap = cpu_online_map; 314 - cpu_clear(smp_processor_id(), callmap); 315 - if (!cpus_empty(callmap)) 311 + cpumask_copy(&callmap, cpu_online_mask); 312 + cpumask_clear_cpu(smp_processor_id(), &callmap); 313 + if (!cpumask_empty(&callmap)) 316 314 smp_send_message(callmap, BFIN_IPI_CPU_STOP, NULL, NULL, 0); 317 315 318 316 preempt_enable();
+26 -17
arch/blackfin/mm/sram-alloc.c
··· 15 15 #include <linux/init.h> 16 16 #include <linux/poll.h> 17 17 #include <linux/proc_fs.h> 18 + #include <linux/seq_file.h> 18 19 #include <linux/spinlock.h> 19 20 #include <linux/rtc.h> 20 21 #include <linux/slab.h> ··· 765 764 /* Need to keep line of output the same. Currently, that is 44 bytes 766 765 * (including newline). 767 766 */ 768 - static int _sram_proc_read(char *buf, int *len, int count, const char *desc, 767 + static int _sram_proc_show(struct seq_file *m, const char *desc, 769 768 struct sram_piece *pfree_head, 770 769 struct sram_piece *pused_head) 771 770 { ··· 774 773 if (!pfree_head || !pused_head) 775 774 return -1; 776 775 777 - *len += sprintf(&buf[*len], "--- SRAM %-14s Size PID State \n", desc); 776 + seq_printf(m, "--- SRAM %-14s Size PID State \n", desc); 778 777 779 778 /* search the relevant memory slot */ 780 779 pslot = pused_head->next; 781 780 782 781 while (pslot != NULL) { 783 - *len += sprintf(&buf[*len], "%p-%p %10i %5i %-10s\n", 782 + seq_printf(m, "%p-%p %10i %5i %-10s\n", 784 783 pslot->paddr, pslot->paddr + pslot->size, 785 784 pslot->size, pslot->pid, "ALLOCATED"); 786 785 ··· 790 789 pslot = pfree_head->next; 791 790 792 791 while (pslot != NULL) { 793 - *len += sprintf(&buf[*len], "%p-%p %10i %5i %-10s\n", 792 + seq_printf(m, "%p-%p %10i %5i %-10s\n", 794 793 pslot->paddr, pslot->paddr + pslot->size, 795 794 pslot->size, pslot->pid, "FREE"); 796 795 ··· 799 798 800 799 return 0; 801 800 } 802 - static int sram_proc_read(char *buf, char **start, off_t offset, int count, 803 - int *eof, void *data) 801 + static int sram_proc_show(struct seq_file *m, void *v) 804 802 { 805 - int len = 0; 806 803 unsigned int cpu; 807 804 808 805 for (cpu = 0; cpu < num_possible_cpus(); ++cpu) { 809 - if (_sram_proc_read(buf, &len, count, "Scratchpad", 806 + if (_sram_proc_show(m, "Scratchpad", 810 807 &per_cpu(free_l1_ssram_head, cpu), &per_cpu(used_l1_ssram_head, cpu))) 811 808 goto not_done; 812 809 #if L1_DATA_A_LENGTH != 0 813 - if (_sram_proc_read(buf, &len, count, "L1 Data A", 810 + if (_sram_proc_show(m, "L1 Data A", 814 811 &per_cpu(free_l1_data_A_sram_head, cpu), 815 812 &per_cpu(used_l1_data_A_sram_head, cpu))) 816 813 goto not_done; 817 814 #endif 818 815 #if L1_DATA_B_LENGTH != 0 819 - if (_sram_proc_read(buf, &len, count, "L1 Data B", 816 + if (_sram_proc_show(m, "L1 Data B", 820 817 &per_cpu(free_l1_data_B_sram_head, cpu), 821 818 &per_cpu(used_l1_data_B_sram_head, cpu))) 822 819 goto not_done; 823 820 #endif 824 821 #if L1_CODE_LENGTH != 0 825 - if (_sram_proc_read(buf, &len, count, "L1 Instruction", 822 + if (_sram_proc_show(m, "L1 Instruction", 826 823 &per_cpu(free_l1_inst_sram_head, cpu), 827 824 &per_cpu(used_l1_inst_sram_head, cpu))) 828 825 goto not_done; 829 826 #endif 830 827 } 831 828 #if L2_LENGTH != 0 832 - if (_sram_proc_read(buf, &len, count, "L2", &free_l2_sram_head, 833 - &used_l2_sram_head)) 829 + if (_sram_proc_show(m, "L2", &free_l2_sram_head, &used_l2_sram_head)) 834 830 goto not_done; 835 831 #endif 836 - *eof = 1; 837 832 not_done: 838 - return len; 833 + return 0; 839 834 } 835 + 836 + static int sram_proc_open(struct inode *inode, struct file *file) 837 + { 838 + return single_open(file, sram_proc_show, NULL); 839 + } 840 + 841 + static const struct file_operations sram_proc_ops = { 842 + .open = sram_proc_open, 843 + .read = seq_read, 844 + .llseek = seq_lseek, 845 + .release = single_release, 846 + }; 840 847 841 848 static int __init sram_proc_init(void) 842 849 { 843 850 struct proc_dir_entry *ptr; 844 - ptr = create_proc_entry("sram", S_IFREG | S_IRUGO, NULL); 851 + 852 + ptr = proc_create("sram", S_IRUGO, NULL, &sram_proc_ops); 845 853 if (!ptr) { 846 854 printk(KERN_WARNING "unable to create /proc/sram\n"); 847 855 return -1; 848 856 } 849 - ptr->read_proc = sram_proc_read; 850 857 return 0; 851 858 } 852 859 late_initcall(sram_proc_init);