Blackfin arch updates for 2.6.31
cover Blackfin arch updates for 2.6.31
There's a bit more than normal here as we missed the 2.6.30 window due to body shuffling, but hopefully that should be settled now. At any rate, most of this is bug fixes and stabilization work. That means addressing anomalies, regressions, and all that fun crap. Can't say there is anything terribly interesting/new to be found.
Graf Yang (13):
Blackfin: fix link failure due to CONFIG_EXCEPTION_L1_SCRATCH
Blackfin: fix bug found by traps test case 21
Blackfin: add MDMA defines to make cross-variant coding easier
Blackfin: work around anomaly 05000287
Blackfin: BF518F-EZBRD: handle required portmuxing of async pins
Blackfin: annotate anomaly 05000120
Blackfin: add support for gptimer0 as a tick source
Blackfin: add workaround for anomaly 05000287
Blackfin: work around anomaly 05000220
Blackfin: drop unused reserve_pda() function
Blackfin: merge sram init functions
Blackfin: fix handling of initial L1 reservation
Blackfin: convert SMP to only use generic time framework
Mariusz Kozlowski (1):
Blackfin: fix parentheses balance and convert some tab/space mixing
Michael Hennerich (5):
Blackfin: add comment for anomaly 05000171 to init code
Blackfin: fix up PATA resource handling in bf537-stamp
Blackfin: do not error if GPIO IRQ is requested already as GPIO
Blackfin: update gptimers API
Blackfin: bf548-ezkit: add resources for ADXL345/346
Mike Frysinger (25):
Blackfin: add some help text to the EBIU_AMBCTL settings
Blackfin: fix data cache flushing when doing icache flushing
Blackfin: fix warnings with I/O port macros
Blackfin: pull updated anomaly lists from toolchain
Blackfin: set bf51x/bf52x to 0.0 rev by default and bf54x to 0.2
Blackfin: simplify the do_flush macro
Blackfin: simplify BF561 coreb driver greatly
Blackfin: fix detection of cached L2 SRAM
Blackfin: punt useless GPIO init call
Blackfin: delete unused sys_getpagesize() function
Blackfin: workaround anomaly 05000227
Blackfin: do not append newlines to panic() messages
Blackfin: rename some Blackfin drivers
Blackfin: add note about anomaly 05000242 being worked around
Blackfin: fix command line corruption with DEBUG_DOUBLEFAULT
Blackfin: override default uClinux MTD addr/size
Blackfin: check SIC defines rather than variant names
Blackfin: rename Blackfin relocs according to the toolchain
Blackfin: document the lsl variants of the L1 allocator
Blackfin: convert early_printk EVT init to a loop
Blackfin: punt duplicated search_exception_table() prototype
Blackfin: push access_ok() L1 attribute down
Blackfin: kgdb: fix up error return values
Blackfin: fix unused warnings after nommu update
Blackfin: fix sparseirq/kstat_irqs fallout
Philippe Gerum (1):
Blackfin: merge Philippe's recent ipipe patch
Robin Getz (11):
Blackfin: allow scheduler functions to be placed into L1
Blackfin: fix early L1 relocation crash
Blackfin: document anomaly 05000234 workaround
Blackfin: annotate anomaly 05000119 in core DMA code
Blackfin: make sure MPU CPLB for first 1k is marked as valid
Blackfin: make deferred hardware errors more exact
Blackfin: make sure stack is accessible before dumping it
Blackfin: add workaround for anomaly 05000461
Blackfin: include system/processor info in dump messages
Blackfin: add missing access_ok() checks to user functions
Blackfin: export the last exception cause via debugfs
Roel Kluin (1):
Blackfin: fix length checking in kgdb_ebin2mem
Sonic Zhang (4):
Blackfin: Allow bf548 ATAPI to be routed to GPIO
Blackfin: update defconfigs
Blackfin: detect anomaly 05000274
Blackfin: add SSYNC to set_dma_sg() for descriptor fetching
Yi Li (1):
Blackfin: bf527-ezkit: add support for mmc-spi
arch/blackfin/Kconfig | 84 +++- arch/blackfin/Kconfig.debug | 13 + arch/blackfin/configs/BF518F-EZBRD_defconfig | 101 +++-- arch/blackfin/configs/BF526-EZBRD_defconfig | 219 ++++++---- arch/blackfin/configs/BF527-EZKIT_defconfig | 211 ++++++---- arch/blackfin/configs/BF533-EZKIT_defconfig | 103 +++-- arch/blackfin/configs/BF533-STAMP_defconfig | 105 +++-- arch/blackfin/configs/BF537-STAMP_defconfig | 109 +++-- arch/blackfin/configs/BF538-EZKIT_defconfig | 106 +++-- arch/blackfin/configs/BF548-EZKIT_defconfig | 253 +++++------ arch/blackfin/configs/BF561-EZKIT_defconfig | 116 +++-- arch/blackfin/configs/BlackStamp_defconfig | 4 +- arch/blackfin/configs/CM-BF527_defconfig | 29 ++- arch/blackfin/configs/CM-BF533_defconfig | 12 +- arch/blackfin/configs/CM-BF537E_defconfig | 499 ++++++++++++--------- arch/blackfin/configs/CM-BF537U_defconfig | 12 +- arch/blackfin/configs/CM-BF548_defconfig | 8 +- arch/blackfin/configs/CM-BF561_defconfig | 12 +- arch/blackfin/configs/H8606_defconfig | 8 +- arch/blackfin/configs/IP0X_defconfig | 8 +- arch/blackfin/configs/PNAV-10_defconfig | 39 +- arch/blackfin/configs/SRV1_defconfig | 4 +- arch/blackfin/configs/TCM-BF537_defconfig | 27 +- arch/blackfin/include/asm/cacheflush.h | 40 +- arch/blackfin/include/asm/cplb.h | 35 +- arch/blackfin/include/asm/dma.h | 10 +- arch/blackfin/include/asm/elf.h | 84 ++-- arch/blackfin/include/asm/entry.h | 92 ++++- arch/blackfin/include/asm/gptimers.h | 43 +- arch/blackfin/include/asm/io.h | 29 +- arch/blackfin/include/asm/ipipe.h | 4 +- arch/blackfin/include/asm/pda.h | 2 - arch/blackfin/include/asm/processor.h | 4 +- arch/blackfin/include/asm/time.h | 1 + arch/blackfin/include/asm/uaccess.h | 32 +- arch/blackfin/kernel/bfin_dma_5xx.c | 86 ++++ arch/blackfin/kernel/bfin_gpio.c | 18 - arch/blackfin/kernel/bfin_ksyms.c | 1 - arch/blackfin/kernel/cplb-mpu/cacheinit.c | 9 +- arch/blackfin/kernel/cplb-mpu/cplbinit.c | 2 +- arch/blackfin/kernel/cplb-nompu/cacheinit.c | 9 +- arch/blackfin/kernel/early_printk.c | 16 +- arch/blackfin/kernel/gptimers.c | 30 +- arch/blackfin/kernel/ipipe.c | 9 +- arch/blackfin/kernel/irqchip.c | 2 + arch/blackfin/kernel/kgdb.c | 60 ++-- arch/blackfin/kernel/module.c | 22 +- arch/blackfin/kernel/process.c | 3 + arch/blackfin/kernel/setup.c | 79 ++-- arch/blackfin/kernel/sys_bfin.c | 5 - arch/blackfin/kernel/time-ts.c | 220 ++++++++-- arch/blackfin/kernel/time.c | 53 +-- arch/blackfin/kernel/traps.c | 52 ++- arch/blackfin/kernel/vmlinux.lds.S | 5 + arch/blackfin/mach-bf518/Kconfig | 1 + arch/blackfin/mach-bf518/boards/ezbrd.c | 19 +- arch/blackfin/mach-bf518/include/mach/anomaly.h | 35 ++- arch/blackfin/mach-bf518/include/mach/portmux.h | 6 +- arch/blackfin/mach-bf527/Kconfig | 1 + arch/blackfin/mach-bf527/boards/cm_bf527.c | 10 +- arch/blackfin/mach-bf527/boards/ezbrd.c | 10 +- arch/blackfin/mach-bf527/boards/ezkit.c | 28 +- arch/blackfin/mach-bf527/include/mach/anomaly.h | 168 +++++--- arch/blackfin/mach-bf533/Kconfig | 1 + arch/blackfin/mach-bf533/boards/H8606.c | 4 +- arch/blackfin/mach-bf533/boards/cm_bf533.c | 4 +- arch/blackfin/mach-bf533/boards/ezkit.c | 4 +- arch/blackfin/mach-bf533/boards/stamp.c | 6 +- arch/blackfin/mach-bf533/include/mach/anomaly.h | 88 +++- arch/blackfin/mach-bf537/Kconfig | 1 + arch/blackfin/mach-bf537/boards/cm_bf537.c | 4 +- arch/blackfin/mach-bf537/boards/pnav10.c | 8 +- arch/blackfin/mach-bf537/boards/stamp.c | 25 +- arch/blackfin/mach-bf537/boards/tcm_bf537.c | 4 +- arch/blackfin/mach-bf537/include/mach/anomaly.h | 84 +++-- arch/blackfin/mach-bf538/Kconfig | 1 + arch/blackfin/mach-bf538/include/mach/anomaly.h | 60 ++- arch/blackfin/mach-bf538/include/mach/blackfin.h | 19 - arch/blackfin/mach-bf538/include/mach/cdefBF538.h | 65 +++- arch/blackfin/mach-bf538/include/mach/defBF539.h | 56 +++ arch/blackfin/mach-bf548/Kconfig | 8 + arch/blackfin/mach-bf548/boards/ezkit.c | 85 +++- arch/blackfin/mach-bf548/include/mach/anomaly.h | 44 ++- arch/blackfin/mach-bf548/include/mach/portmux.h | 64 ++- arch/blackfin/mach-bf561/Kconfig | 16 +- arch/blackfin/mach-bf561/boards/cm_bf561.c | 4 +- arch/blackfin/mach-bf561/coreb.c | 396 ++--------------- arch/blackfin/mach-bf561/include/mach/anomaly.h | 25 +- arch/blackfin/mach-bf561/include/mach/cdefBF561.h | 29 ++ arch/blackfin/mach-bf561/include/mach/defBF561.h | 56 +++ arch/blackfin/mach-bf561/smp.c | 4 +- arch/blackfin/mach-common/arch_checks.c | 7 + arch/blackfin/mach-common/cache.S | 46 +-- arch/blackfin/mach-common/clocks-init.c | 1 + arch/blackfin/mach-common/cpufreq.c | 3 +- arch/blackfin/mach-common/entry.S | 76 ++-- arch/blackfin/mach-common/head.S | 34 +- arch/blackfin/mach-common/interrupt.S | 27 ++ arch/blackfin/mach-common/ints-priority.c | 50 +-- arch/blackfin/mach-common/smp.c | 12 +- arch/blackfin/mm/blackfin_sram.h | 1 - arch/blackfin/mm/init.c | 33 +- arch/blackfin/mm/isram-driver.c | 2 +- arch/blackfin/mm/sram-alloc.c | 21 +- 104 files changed, 2951 insertions(+), 1944 deletions(-)
PATCH 1/62 Blackfin: add comment for anomaly 05000171 to init code
From: Michael Hennerich <[email protected]>
--- arch/blackfin/mach-common/ints-priority.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/blackfin/mach-common/ints-priority.c +3 -0
@@ -1116,6 +1116,9 @@ int __init init_arch_irq(void)IMASK_IVG14 |IMASK_IVG13 |IMASK_IVG12 |IMASK_IVG11 |IMASK_IVG10 |IMASK_IVG9 |IMASK_IVG8 |IMASK_IVG7 |IMASK_IVGHW ; +/* This implicitly covers ANOMALY_05000171 +* Boot-ROM code modifies SICA_IWRx wakeup registers +*/ #ifdef SIC_IWR0 bfin_write_SIC_IWR0 (IWR_DISABLE_ALL );# ifdef SIC_IWR1
Signature · 1 line
1.6.3.1
PATCH 2/62 Blackfin: add some help text to the EBIU_AMBCTL settings
In reply to Mike Frysinger--- arch/blackfin/Kconfig | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-)
arch/blackfin/Kconfig +17 -4
@@ -1011,21 +1011,34 @@ endmenu menu "EBIU_AMBCTL Control" config BANK_0 - hex "Bank 0" + hex "Bank 0 (AMBCTL0.L)" default 0x7BB0 + help + These are the low 16 bits of the EBIU_AMBCTL0 MMR which are + used to control the Asynchronous Memory Bank 0 settings. config BANK_1 - hex "Bank 1" + hex "Bank 1 (AMBCTL0.H)" default 0x7BB0 default 0x5558 if BF54x + help + These are the high 16 bits of the EBIU_AMBCTL0 MMR which are + used to control the Asynchronous Memory Bank 1 settings. config BANK_2 - hex "Bank 2" + hex "Bank 2 (AMBCTL1.L)" default 0x7BB0 + help + These are the low 16 bits of the EBIU_AMBCTL1 MMR which are + used to control the Asynchronous Memory Bank 2 settings. config BANK_3 - hex "Bank 3" + hex "Bank 3 (AMBCTL1.H)" default 0x99B3 + help + These are the high 16 bits of the EBIU_AMBCTL1 MMR which are + used to control the Asynchronous Memory Bank 3 settings. + endmenu config EBIU_MBSCTLVAL
Signature · 1 line
1.6.3.1
PATCH 3/62 Blackfin: bf527-ezkit: add support for mmc-spi
In reply to Mike FrysingerFrom: Yi Li <[email protected]>
--- arch/blackfin/mach-bf527/boards/ezkit.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-)
arch/blackfin/mach-bf527/boards/ezkit.c +18 -0
@@ -509,6 +509,13 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = { };#endif +#if defined(CONFIG_MMC_SPI ) || defined(CONFIG_MMC_SPI_MODULE ) +static struct bfin5xx_spi_chip mmc_spi_chip_info = { + .enable_dma =0 , + .bits_per_word =8 , +}; +#endif +#if defined(CONFIG_PBX )static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { .ctl_reg = 0x4, /* send zero */
@@ -624,6 +631,17 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { .controller_data = &ad9960_spi_chip_info, },#endif +#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) + { + .modalias = "mmc_spi", + .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ + .bus_num = 0, + .chip_select = 3, + .controller_data = &mmc_spi_chip_info, + .mode = SPI_MODE_0, + }, +#endif + #if defined(CONFIG_PBX) { .modalias = "fxs-spi",
Signature · 1 line
1.6.3.1
PATCH 4/62 Blackfin: Allow bf548 ATAPI to be routed to GPIO
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
By default, it is routed to async memory address. In GPIO case, GPIO peripheral PINs should be requested in advance.
--- arch/blackfin/mach-bf548/Kconfig | 7 +++ arch/blackfin/mach-bf548/include/mach/portmux.h | 64 ++++++++++++++++------- 2 files changed, 52 insertions(+), 19 deletions(-)
arch/blackfin/mach-bf548/Kconfig +7 -0
@@ -11,6 +11,13 @@ config DEB_DMA_URGENT help Treat any DEB1, DEB2 and DEB3 request as Urgent +config BF548_ATAPI_ALTERNATIVE_PORT + bool "BF548 ATAPI alternative port via GPIO" + help + BF548 ATAPI data and address PINs can be routed through + async address or GPIO port F and G. Select y to route it + to GPIO. + comment "Interrupt Priority Assignment" menu "Priority"
arch/blackfin/mach-bf548/include/mach/portmux.h +45 -19
76 lines not on this page · raw message
Signature · 1 line
1.6.3.1
PATCH 5/62 Blackfin: allow scheduler functions to be placed into L1
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
--- arch/blackfin/kernel/vmlinux.lds.S | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/blackfin/kernel/vmlinux.lds.S +5 -0
@@ -50,7 +50,9 @@ SECTIONS _text = .; __stext = .; TEXT_TEXT +#ifndef CONFIG_SCHEDULE_L1 SCHED_TEXT +#endif LOCK_TEXT KPROBES_TEXT *(.text.*)
@@ -180,6 +182,9 @@ SECTIONS . = ALIGN(4); __stext_l1 = .; *(.l1.text) +#ifdef CONFIG_SCHEDULE_L1 + SCHED_TEXT +#endif . = ALIGN(4); __etext_l1 = .; }
Signature · 1 line
1.6.3.1
PATCH 6/62 Blackfin: fix link failure due to CONFIG_EXCEPTION_L1_SCRATCH
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
Move exception stack mess from entry.S to init.c to fix link failure when CONFIG_EXCEPTION_L1_SCRATCH is in use.
--- arch/blackfin/Kconfig | 2 +- arch/blackfin/mach-common/entry.S | 17 ----------------- arch/blackfin/mm/init.c | 14 ++++++++++++-- 3 files changed, 13 insertions(+), 20 deletions(-)
arch/blackfin/Kconfig +1 -1
@@ -808,7 +808,7 @@ config APP_STACK_L1 config EXCEPTION_L1_SCRATCH bool "Locate exception stack in L1 Scratch Memory" default n - depends on !APP_STACK_L1 && !SYSCALL_TAB_L1 + depends on !APP_STACK_L1 help Whenever an exception occurs, use the L1 Scratch memory for stack storage. You cannot place the stacks of FLAT binaries
arch/blackfin/mach-common/entry.S +0 -17
@@ -36,7 +36,6 @@ #include <linux/init.h> #include <linux/linkage.h> #include <linux/unistd.h> -#include <linux/threads.h> #include <asm/blackfin.h> #include <asm/errno.h> #include <asm/fixed_code.h>
@@ -1588,19 +1587,3 @@ ENTRY(_sys_call_table) .long _sys_ni_syscall .endr END(_sys_call_table) - -#ifdef CONFIG_EXCEPTION_L1_SCRATCH -/* .section .l1.bss.scratch */ -.set _exception_stack_top, L1_SCRATCH_START + L1_SCRATCH_LENGTH -#else -#ifdef CONFIG_SYSCALL_TAB_L1 -.section .l1.bss -#else -.bss -#endif -ENTRY(_exception_stack) - .rept 1024 * NR_CPUS - .long 0 - .endr -_exception_stack_top: -#endif
arch/blackfin/mm/init.c +12 -2
@@ -52,9 +52,14 @@ static unsigned long empty_bad_page_table;static unsigned long empty_bad_page; -unsigned long empty_zero_page; +static unsigned long empty_zero_page; -extern unsigned long exception_stack[NR_CPUS ][1024 ]; +#ifndef CONFIG_EXCEPTION_L1_SCRATCH +#if definedCONFIG_SYSCALL_TAB_L1 +__attribute__((l1_data)) +#endif +static unsigned long exception_stack[NR_CPUS ][1024 ]; +#endif struct blackfin_pda cpu_pda[NR_CPUS ];EXPORT_SYMBOL (cpu_pda);
@@ -117,7 +122,12 @@ asmlinkage void __init init_pda(void) cpu_pda[0 ].next = &cpu_pda[1 ]; cpu_pda[1 ].next = &cpu_pda[0 ]; +#ifdef CONFIG_EXCEPTION_L1_SCRATCH + cpu_pda[cpu].ex_stack = (unsigned long *)(L1_SCRATCH_START + \ +L1_SCRATCH_LENGTH ); +#else cpu_pda[cpu].ex_stack = exception_stack[cpu +1 ]; +#endif #ifdef CONFIG_SMP cpu_pda[cpu].imask =0x1f ;
Signature · 1 line
1.6.3.1
PATCH 7/62 Blackfin: fix data cache flushing when doing icache flushing
In reply to Mike FrysingerMake sure we flush all data caches and their write buffers before flushing icache, otherwise random edge cases could crop up where stale data is read into icache from external memory. As fallout, punt the combined icache + dcache flush function since we cannot safely do them back to back -- the SSYNC is needed between the dcache flush and the icache flush.
--- arch/blackfin/include/asm/cacheflush.h | 35 ++++++++++++++----------------- arch/blackfin/kernel/bfin_ksyms.c | 1 - arch/blackfin/mach-common/cache.S | 16 -------------- 3 files changed, 16 insertions(+), 36 deletions(-)
arch/blackfin/include/asm/cacheflush.h +16 -19
@@ -30,7 +30,8 @@#ifndef _BLACKFIN_CACHEFLUSH_H#define _BLACKFIN_CACHEFLUSH_H -extern void blackfin_icache_dcache_flush_range (unsigned long start_address,unsigned long end_address); +#include <asm/blackfin.h> /* for SSYNC() */ +extern void blackfin_icache_flush_range (unsigned long start_address,unsigned long end_address);extern void blackfin_dcache_flush_range (unsigned long start_address,unsigned long end_address);extern void blackfin_dcache_invalidate_range (unsigned long start_address,unsigned long end_address);
@@ -54,32 +55,28 @@ extern void blackfin_invalidate_entire_dcache(void);static inline void flush_icache_range (unsigned start,unsigned end) { -#if defined(CONFIG_BFIN_DCACHE ) && defined(CONFIG_BFIN_ICACHE ) - -# if defined(CONFIG_BFIN_WT ) -blackfin_icache_flush_range ((start), (end)); -flush_icache_range_others (start, end); -# else -blackfin_icache_dcache_flush_range ((start), (end)); -# endif - -#else +#if defined(CONFIG_BFIN_WB ) +blackfin_dcache_flush_range (start, end); +#endif -# if defined(CONFIG_BFIN_ICACHE ) -blackfin_icache_flush_range ((start), (end)); +/* Make sure all write buffers in the data side of the core +* are flushed before trying to invalidate the icache. This +* needs to be after the data flush and before the icache +* flush so that the SSYNC does the right thing in preventing +* the instruction prefetcher from hitting things in cached +* memory at the wrong time -- it runs much further ahead than +* the pipeline. +*/ +SSYNC (); +#if defined(CONFIG_BFIN_ICACHE ) +blackfin_icache_flush_range (start, end);flush_icache_range_others (start, end); -# endif -# if defined(CONFIG_BFIN_DCACHE ) -blackfin_dcache_flush_range ((start), (end)); -# endif -#endif }#define copy_to_user_page (vma, page, vaddr, dst, src, len) \ do { memcpy(dst, src, len); \ flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \ - flush_icache_range_others((unsigned long) (dst), (unsigned long) (dst) + (len));\ } while (0)#define copy_from_user_page (vma, page, vaddr, dst, src, len) memcpy(dst, src, len)
arch/blackfin/kernel/bfin_ksyms.c +0 -1
@@ -16,7 +16,6 @@ EXPORT_SYMBOL(bfin_return_from_exception);/* All the Blackfin cache functions: mach-common/cache.S */ EXPORT_SYMBOL (blackfin_dcache_invalidate_range); -EXPORT_SYMBOL (blackfin_icache_dcache_flush_range);EXPORT_SYMBOL (blackfin_icache_flush_range);EXPORT_SYMBOL (blackfin_dcache_flush_range);EXPORT_SYMBOL (blackfin_dflush_page);
arch/blackfin/mach-common/cache.S +0 -16
@@ -80,22 +80,6 @@ ENTRY(_blackfin_icache_flush_range) do_flush IFLUSH, , nop ENDPROC(_blackfin_icache_flush_range) -/* Flush all cache lines assocoiated with this area of memory. */ -ENTRY(_blackfin_icache_dcache_flush_range) -/* - * Walkaround to avoid loading wrong instruction after invalidating icache - * and following sequence is met. - * - * 1) One instruction address is cached in the instruction cache. - * 2) This instruction in SDRAM is changed. - * 3) IFLASH[P0] is executed only once in blackfin_icache_flush_range(). - * 4) This instruction is executed again, but the old one is loaded. - */ - P0 = R0; - IFLUSH[P0]; - do_flush FLUSH, IFLUSH -ENDPROC(_blackfin_icache_dcache_flush_range) - /* Throw away all D-cached data in specified region without any obligation to * write them back. Since the Blackfin ISA does not have an "invalidate" * instruction, we use flush/invalidate. Perhaps as a speed optimization we
Signature · 1 line
1.6.3.1
PATCH 8/62 Blackfin: fix bug found by traps test case 21
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
The traps test case 21 "exception 0x3f: l1_instruction_access" would make the kernel panic on BF533's because we end up calling show_stack() infinitely.
--- arch/blackfin/mm/isram-driver.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/mm/isram-driver.c +1 -1
@@ -125,7 +125,7 @@ static bool isram_check_addr(const void *addr, size_t n) {if ((addr >= (void *)L1_CODE_START ) && (addr < (void *)(L1_CODE_START +L1_CODE_LENGTH ))) { -if ((addr + n) >= (void *)(L1_CODE_START +L1_CODE_LENGTH )) { +if ((addr + n) > (void *)(L1_CODE_START +L1_CODE_LENGTH )) {show_stack (NULL ,NULL );printk (KERN_ERR "isram_memcpy: copy involving %p length " "(%zu) too long\n" , addr, n);
Signature · 1 line
1.6.3.1
PATCH 9/62 Blackfin: fix parentheses balance and convert some tab/space mixing
In reply to Mike FrysingerFrom: Mariusz Kozlowski <[email protected]>
--- arch/blackfin/mach-bf538/include/mach/cdefBF538.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/blackfin/mach-bf538/include/mach/cdefBF538.h +3 -3
@@ -67,14 +67,14 @@#define bfin_write_SIC_ISR0 (val) bfin_write32(SIC_ISR0, val)#define bfin_read_SIC_ISR1 () bfin_read32(SIC_ISR1)#define bfin_write_SIC_ISR1 (val) bfin_write32(SIC_ISR1, val) -#define bfin_read_SIC_ISR (x) bfin_read32(SIC_ISR0 + x * (SIC_ISR1 - SIC_ISR0)) +#define bfin_read_SIC_ISR (x) bfin_read32(SIC_ISR0 + x * (SIC_ISR1 - SIC_ISR0))#define bfin_write_SIC_ISR (x, val) bfin_write32(SIC_ISR0 + x * (SIC_ISR1 - SIC_ISR0), val)#define bfin_read_SIC_IWR0 () bfin_read32(SIC_IWR0)#define bfin_write_SIC_IWR0 (val) bfin_write32(SIC_IWR0, val)#define bfin_read_SIC_IWR1 () bfin_read32(SIC_IWR1)#define bfin_write_SIC_IWR1 (val) bfin_write32(SIC_IWR1, val) -#define bfin_read_SIC_IWR (x) bfin_read32(SIC_IWR0 + x * (SIC_IWR1 - SIC_IWR0)) -#define bfin_write_SIC_IWR (x, val) bfin_write32((SIC_IWR0 + x * (SIC_IWR1 - SIC_IWR0), val) +#define bfin_read_SIC_IWR (x) bfin_read32(SIC_IWR0 + x * (SIC_IWR1 - SIC_IWR0)) +#define bfin_write_SIC_IWR (x, val) bfin_write32(SIC_IWR0 + x * (SIC_IWR1 - SIC_IWR0), val)#define bfin_read_SIC_IAR0 () bfin_read32(SIC_IAR0)#define bfin_write_SIC_IAR0 (val) bfin_write32(SIC_IAR0, val)#define bfin_read_SIC_IAR1 () bfin_read32(SIC_IAR1)
Signature · 1 line
1.6.3.1
PATCH 10/62 Blackfin: fix warnings with I/O port macros
In reply to Mike FrysingerThe I/O port functions take ints, so we need to cast them up before passing to our read/write funcs to avoid ugly messes of warnings.
--- arch/blackfin/include/asm/io.h | 29 ++++++++++++++++------------- 1 files changed, 16 insertions(+), 13 deletions(-)
arch/blackfin/include/asm/io.h +16 -13
@@ -80,19 +80,22 @@ static inline unsigned int readl(const volatile void __iomem *addr)#define memcpy_fromio (a,b,c) memcpy((a),(void *)(b),(c))#define memcpy_toio (a,b,c) memcpy((void *)(a),(b),(c)) -#define inb (addr) readb(addr) -#define inw (addr) readw(addr) -#define inl (addr) readl(addr) -#define outb (x,addr) ((void) writeb(x,addr)) -#define outw (x,addr) ((void) writew(x,addr)) -#define outl (x,addr) ((void) writel(x,addr)) - -#define inb_p (addr) inb(addr) -#define inw_p (addr) inw(addr) -#define inl_p (addr) inl(addr) -#define outb_p (x,addr) outb(x,addr) -#define outw_p (x,addr) outw(x,addr) -#define outl_p (x,addr) outl(x,addr) +/* Convert "I/O port addresses" to actual addresses. i.e. ugly casts. */ +#define __io (port) ((void *)(unsigned long)(port)) + +#define inb (port) readb(__io(port)) +#define inw (port) readw(__io(port)) +#define inl (port) readl(__io(port)) +#define outb (x,port) writeb(x,__io(port)) +#define outw (x,port) writew(x,__io(port)) +#define outl (x,port) writel(x,__io(port)) + +#define inb_p (port) inb(__io(port)) +#define inw_p (port) inw(__io(port)) +#define inl_p (port) inl(__io(port)) +#define outb_p (x,port) outb(x,__io(port)) +#define outw_p (x,port) outw(x,__io(port)) +#define outl_p (x,port) outl(x,__io(port))#define ioread8_rep (a,d,c) readsb(a,d,c)#define ioread16_rep (a,d,c) readsw(a,d,c)
Signature · 1 line
1.6.3.1
PATCH 11/62 Blackfin: merge Philippe's recent ipipe patch
In reply to Mike FrysingerFrom: Philippe Gerum <[email protected]>
ipipe-2.6.28.9-blackfin-git95aafe6.patch
--- arch/blackfin/include/asm/ipipe.h | 4 ++-- arch/blackfin/kernel/ipipe.c | 9 ++++++--- arch/blackfin/mach-common/ints-priority.c | 7 ------- 3 files changed, 8 insertions(+), 12 deletions(-)
arch/blackfin/include/asm/ipipe.h +2 -2
@@ -35,10 +35,10 @@#include <asm/atomic.h> #include <asm/traps.h> -#define IPIPE_ARCH_STRING "1.9-00" +#define IPIPE_ARCH_STRING "1.9-01"#define IPIPE_MAJOR_NUMBER 1#define IPIPE_MINOR_NUMBER 9 -#define IPIPE_PATCH_NUMBER 0 +#define IPIPE_PATCH_NUMBER 1#ifdef CONFIG_SMP #error "I-pipe/blackfin: SMP not implemented"
arch/blackfin/kernel/ipipe.c +6 -3
@@ -167,7 +167,7 @@ int __ipipe_check_root(void)void __ipipe_enable_irqdesc (struct ipipe_domain *ipd,unsigned irq) {struct irq_desc *desc =irq_to_desc (irq); -int prio = desc->ic_prio; +int prio =__ipipe_get_irq_priority (irq); desc->depth =0 ; if (ipd != &ipipe_root &&
@@ -178,8 +178,7 @@ EXPORT_SYMBOL(__ipipe_enable_irqdesc);void __ipipe_disable_irqdesc (struct ipipe_domain *ipd,unsigned irq) { -struct irq_desc *desc =irq_to_desc (irq); -int prio = desc->ic_prio; +int prio =__ipipe_get_irq_priority (irq);if (ipd != &ipipe_root &&atomic_dec_and_test (&__ipipe_irq_lvdepth[prio]))
@@ -310,12 +309,16 @@ int ipipe_trigger_irq(unsigned irq) asmlinkage void __ipipe_sync_root(void) { +void (*irq_tail_hook)(void ) = (void (*)(void ))__ipipe_irq_tail_hook;unsigned long flags;BUG_ON (irqs_disabled ());local_irq_save_hw (flags); +if (irq_tail_hook) +irq_tail_hook (); +clear_thread_flag (TIF_IRQ_SYNC );if (ipipe_root_cpudom_var (irqpend_himask) !=0 )
arch/blackfin/mach-common/ints-priority.c +0 -7
@@ -1139,13 +1139,6 @@ int __init init_arch_irq(void)bfin_write_SIC_IWR (IWR_DISABLE_ALL );#endif -#ifdef CONFIG_IPIPE -for (irq =0 ; irq <NR_IRQS ; irq++) { -struct irq_desc *desc =irq_to_desc (irq); - desc->ic_prio =__ipipe_get_irq_priority (irq); - } -#endif /* CONFIG_IPIPE */ -return 0 ; }
Signature · 1 line
1.6.3.1
PATCH 12/62 Blackfin: fix up PATA resource handling in bf537-stamp
In reply to Mike FrysingerFrom: Michael Hennerich <[email protected]>
Make sure the addresses declared match reality, and make the PATA IRQ code optional.
--- arch/blackfin/mach-bf537/boards/stamp.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-)
arch/blackfin/mach-bf537/boards/stamp.c +9 -6
@@ -1358,16 +1358,18 @@ static struct resource bfin_pata_resources[] = {static struct pata_platform_info bfin_pata_platform_data = { .ioport_shift =0 , }; - +/* CompactFlash Storage Card Memory Mapped Adressing +* /REG = A11 = 1 +*/ static struct resource bfin_pata_resources[] = { { - .start =0x20211820 , - .end =0x2021183F , + .start =0x20211800 , + .end =0x20211807 , .flags =IORESOURCE_MEM , }, { - .start =0x2021181C , - .end =0x2021181F , + .start =0x2021180E ,/* Device Ctl */ + .end =0x2021180E , .flags =IORESOURCE_MEM , }, };
@@ -1527,7 +1529,8 @@ static int __init stamp_init(void)platform_add_devices (stamp_devices,ARRAY_SIZE (stamp_devices));spi_register_board_info (bfin_spi_board_info,ARRAY_SIZE (bfin_spi_board_info)); -#if defined(CONFIG_PATA_PLATFORM ) || defined(CONFIG_PATA_PLATFORM_MODULE ) +#if (defined(CONFIG_PATA_PLATFORM ) || defined(CONFIG_PATA_PLATFORM_MODULE )) \ + && defined(PATA_INT ) irq_desc[PATA_INT ].status |=IRQ_NOAUTOEN ;#endif
Signature · 1 line
1.6.3.1
PATCH 13/62 Blackfin: pull updated anomaly lists from toolchain
In reply to Mike Frysinger--- arch/blackfin/mach-bf518/include/mach/anomaly.h | 35 +++++- arch/blackfin/mach-bf527/include/mach/anomaly.h | 168 +++++++++++++++-------- arch/blackfin/mach-bf533/include/mach/anomaly.h | 88 ++++++++++-- arch/blackfin/mach-bf537/include/mach/anomaly.h | 84 +++++++----- arch/blackfin/mach-bf538/include/mach/anomaly.h | 60 +++++++-- arch/blackfin/mach-bf548/include/mach/anomaly.h | 44 +++++- arch/blackfin/mach-bf561/include/mach/anomaly.h | 25 +++- 7 files changed, 367 insertions(+), 137 deletions(-)
arch/blackfin/mach-bf518/include/mach/anomaly.h +32 -3
@@ -6,14 +6,19 @@* Licensed under the GPL-2 or later. */ -/* This file shoule be up to date with: +/* This file should be up to date with: * - Revision B, 02/03/2009; ADSP-BF512/BF514/BF516/BF518 Blackfin Processor Anomaly List */ +/* We plan on not supporting 0.0 silicon, but 0.1 isn't out yet - sorry */ +#if __SILICON_REVISION__ <0 +# error will not work on BF518 silicon version +#endif +#ifndef _MACH_ANOMALY_H_#define _MACH_ANOMALY_H_ -/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot2 Not Supported */ +/* Multi-issue instruction with dsp32shiftimm in slot1 and P-reg store in slot 2 not supported */ #define ANOMALY_05000074 (1)/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */ #define ANOMALY_05000122 (1)
@@ -47,7 +52,7 @@#define ANOMALY_05000435 (1)/* PORTx_DRIVE and PORTx_HYSTERESIS Registers Read Back Incorrect Values */ #define ANOMALY_05000438 (1) -/* Preboot Cannot be Used to Program the PLL_DIV Register */ +/* Preboot Cannot be Used to Alter the PLL_DIV Register */ #define ANOMALY_05000439 (1)/* bfrom_SysControl() Cannot be Used to Write the PLL_DIV Register */ #define ANOMALY_05000440 (1)
@@ -61,32 +66,56 @@#define ANOMALY_05000453 (1)/* PPI_FS3 is Driven One Half Cycle Later Than PPI Data */ #define ANOMALY_05000455 (1) +/* False Hardware Error when RETI points to invalid memory */ +#define ANOMALY_05000461 (1)/* Anomalies that don't exist on this proc */ +#define ANOMALY_05000099 (0) +#define ANOMALY_05000119 (0) +#define ANOMALY_05000120 (0)#define ANOMALY_05000125 (0) +#define ANOMALY_05000149 (0)#define ANOMALY_05000158 (0) +#define ANOMALY_05000171 (0) +#define ANOMALY_05000179 (0)#define ANOMALY_05000183 (0)#define ANOMALY_05000198 (0) +#define ANOMALY_05000215 (0) +#define ANOMALY_05000220 (0) +#define ANOMALY_05000227 (0)#define ANOMALY_05000230 (0) +#define ANOMALY_05000231 (0) +#define ANOMALY_05000233 (0) +#define ANOMALY_05000242 (0)#define ANOMALY_05000244 (0) +#define ANOMALY_05000248 (0) +#define ANOMALY_05000250 (0)#define ANOMALY_05000261 (0)#define ANOMALY_05000263 (0)#define ANOMALY_05000266 (0)#define ANOMALY_05000273 (0) +#define ANOMALY_05000274 (0)#define ANOMALY_05000278 (0)#define ANOMALY_05000285 (0) +#define ANOMALY_05000287 (0) +#define ANOMALY_05000301 (0)#define ANOMALY_05000305 (0)#define ANOMALY_05000307 (0)#define ANOMALY_05000311 (0)#define ANOMALY_05000312 (0)#define ANOMALY_05000323 (0)#define ANOMALY_05000353 (0) +#define ANOMALY_05000362 (1)#define ANOMALY_05000363 (0)#define ANOMALY_05000380 (0)#define ANOMALY_05000386 (0) +#define ANOMALY_05000389 (0) +#define ANOMALY_05000400 (0)#define ANOMALY_05000412 (0)#define ANOMALY_05000432 (0)#define ANOMALY_05000447 (0)#define ANOMALY_05000448 (0) +#define ANOMALY_05000456 (0) +#define ANOMALY_05000450 (0)#endif
arch/blackfin/mach-bf527/include/mach/anomaly.h +109 -59
281 lines not on this page · raw message
arch/blackfin/mach-bf533/include/mach/anomaly.h +74 -14
193 lines not on this page · raw message
arch/blackfin/mach-bf537/include/mach/anomaly.h +52 -32
171 lines not on this page · raw message
arch/blackfin/mach-bf538/include/mach/anomaly.h +47 -13
132 lines not on this page · raw message
arch/blackfin/mach-bf548/include/mach/anomaly.h +36 -8
106 lines not on this page · raw message
arch/blackfin/mach-bf561/include/mach/anomaly.h +17 -8
@@ -6,7 +6,7 @@* Licensed under the GPL-2 or later. */ -/* This file shoule be up to date with: +/* This file should be up to date with: * - Revision Q, 11/07/2008; ADSP-BF561 Blackfin Processor Anomaly List */
@@ -18,11 +18,11 @@# error will not work on BF561 silicon version 0.0, 0.1, 0.2, or 0.4#endif -/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot 2 Not Supported */ +/* Multi-issue instruction with dsp32shiftimm in slot1 and P-reg store in slot 2 not supported */ #define ANOMALY_05000074 (1)/* UART Line Status Register (UART_LSR) Bits Are Not Updated at the Same Time */ #define ANOMALY_05000099 (__SILICON_REVISION__ < 5) -/* Trace Buffers may contain errors in emulation mode and/or exception, NMI, reset handlers */ +/* Trace Buffers may record discontinuities into emulation mode and/or exception, NMI, reset handlers */ #define ANOMALY_05000116 (__SILICON_REVISION__ < 3)/* Testset instructions restricted to 32-bit aligned memory locations */ #define ANOMALY_05000120 (1)
@@ -40,7 +40,7 @@#define ANOMALY_05000136 (__SILICON_REVISION__ < 3)/* Allowing the SPORT RX FIFO to fill will cause an overflow */ #define ANOMALY_05000140 (__SILICON_REVISION__ < 3) -/* Infinite Stall may occur with a particular sequence of consecutive dual dag events */ +/* An Infinite Stall occurs with a particular sequence of consecutive dual dag events */ #define ANOMALY_05000141 (__SILICON_REVISION__ < 3)/* Interrupts may be lost when a programmable input flag is configured to be edge sensitive */ #define ANOMALY_05000142 (__SILICON_REVISION__ < 3)
@@ -80,7 +80,7 @@#define ANOMALY_05000163 (__SILICON_REVISION__ < 3)/* PPI Data Lengths Between 8 and 16 Do Not Zero Out Upper Bits */ #define ANOMALY_05000166 (1) -/* Turning Serial Ports on with External Frame Syncs */ +/* Turning SPORTs on while External Frame Sync Is Active May Corrupt Data */ #define ANOMALY_05000167 (1)/* SDRAM auto-refresh and subsequent Power Ups */ #define ANOMALY_05000168 (__SILICON_REVISION__ < 5)
@@ -164,7 +164,7 @@#define ANOMALY_05000242 (__SILICON_REVISION__ < 5)/* If I-Cache Is On, CSYNC/SSYNC/IDLE Around Change of Control Causes Failures */ #define ANOMALY_05000244 (__SILICON_REVISION__ < 5) -/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */ +/* False Hardware Error from an Access in the Shadow of a Conditional Branch */ #define ANOMALY_05000245 (__SILICON_REVISION__ < 5)/* TESTSET operation forces stall on the other core */ #define ANOMALY_05000248 (__SILICON_REVISION__ < 5)
@@ -208,7 +208,7 @@#define ANOMALY_05000275 (__SILICON_REVISION__ > 2)/* Timing Requirements Change for External Frame Sync PPI Modes with Non-Zero PPI_DELAY */ #define ANOMALY_05000276 (__SILICON_REVISION__ < 5) -/* Writes to an I/O data register one SCLK cycle after an edge is detected may clear interrupt */ +/* Writes to an I/O Data Register One SCLK Cycle after an Edge Is Detected May Clear Interrupt */ #define ANOMALY_05000277 (__SILICON_REVISION__ < 3)/* Disabling Peripherals with DMA Running May Cause DMA System Instability */ #define ANOMALY_05000278 (__SILICON_REVISION__ < 5)
@@ -232,7 +232,7 @@#define ANOMALY_05000310 (1)/* Errors When SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */ #define ANOMALY_05000312 (1) -/* PPI Is Level-Sensitive on First Transfer */ +/* PPI Is Level-Sensitive on First Transfer In Single Frame Sync Modes */ #define ANOMALY_05000313 (1)/* Killed System MMR Write Completes Erroneously On Next System MMR Access */ #define ANOMALY_05000315 (1)
@@ -276,18 +276,27 @@#define ANOMALY_05000428 (__SILICON_REVISION__ > 3)/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */ #define ANOMALY_05000443 (1) +/* False Hardware Error when RETI points to invalid memory */ +#define ANOMALY_05000461 (1)/* Anomalies that don't exist on this proc */ +#define ANOMALY_05000119 (0)#define ANOMALY_05000158 (0)#define ANOMALY_05000183 (0) +#define ANOMALY_05000233 (0)#define ANOMALY_05000273 (0)#define ANOMALY_05000311 (0)#define ANOMALY_05000353 (1)#define ANOMALY_05000380 (0)#define ANOMALY_05000386 (1) +#define ANOMALY_05000389 (0) +#define ANOMALY_05000400 (0) +#define ANOMALY_05000430 (0)#define ANOMALY_05000432 (0)#define ANOMALY_05000435 (0)#define ANOMALY_05000447 (0)#define ANOMALY_05000448 (0) +#define ANOMALY_05000456 (0) +#define ANOMALY_05000450 (0)#endif
Signature · 1 line
1.6.3.1
PATCH 14/62 Blackfin: do not error if GPIO IRQ is requested already as GPIO
In reply to Mike FrysingerFrom: Michael Hennerich <[email protected]>
Some drivers expect to be able to request both as GPIO and GPIO IRQ, so allow that use case.
--- arch/blackfin/kernel/bfin_gpio.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-)
arch/blackfin/kernel/bfin_gpio.c +0 -9
@@ -1021,15 +1021,6 @@ int bfin_gpio_irq_request(unsigned gpio, const char *label)local_irq_save_hw (flags); -if (unlikely (reserved_gpio_irq_map[gpio_bank (gpio)] &gpio_bit (gpio))) { -if (system_state ==SYSTEM_BOOTING ) -dump_stack (); -printk (KERN_ERR -"bfin-gpio: GPIO %d is already reserved as gpio-irq !\n" , - gpio); -local_irq_restore_hw (flags); -return -EBUSY ; - }if (unlikely (reserved_peri_map[gpio_bank (gpio)] &gpio_bit (gpio))) {if (system_state ==SYSTEM_BOOTING )dump_stack ();
Signature · 1 line
1.6.3.1
PATCH 15/62 Blackfin: set bf51x/bf52x to 0.0 rev by default and bf54x to 0.2
In reply to Mike FrysingerUpdate the default revs based on what we actually support (bf54x-0.[01] is too broken to use).
--- arch/blackfin/Kconfig | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/blackfin/Kconfig +2 -2
@@ -263,8 +263,8 @@ config BF_REV_MAX choice prompt "Silicon Rev" - default BF_REV_0_1 if (BF51x || BF52x || (BF54x && !BF54xM)) - default BF_REV_0_2 if (BF534 || BF536 || BF537) + default BF_REV_0_0 if (BF51x || BF52x) + default BF_REV_0_2 if (BF534 || BF536 || BF537 || (BF54x && !BF54xM)) default BF_REV_0_3 if (BF531 || BF532 || BF533 || BF54xM || BF561) config BF_REV_0_0
Signature · 1 line
1.6.3.1
PATCH 16/62 Blackfin: simplify the do_flush macro
In reply to Mike FrysingerSimplify the do_flush macro now that we don't need to take into account a second instruction being used together.
--- arch/blackfin/mach-common/cache.S | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-)
arch/blackfin/mach-common/cache.S +15 -15
@@ -15,6 +15,13 @@ .text +/* 05000443 - IFLUSH cannot be last instruction in hardware loop */ +#if ANOMALY_05000443 +# define BROK_FLUSH_INST "IFLUSH" +#else +# define BROK_FLUSH_INST "no anomaly! yeah!" +#endif + /* Since all L1 caches work the same way, we use the same method for flushing * them. Only the actual flush instruction differs. We write this in asm as * GCC can be hard to coax into writing nice hardware loops.
@@ -23,7 +30,7 @@ * R0 = start address * R1 = end address */ -.macro do_flush flushins:req optflushins optnopins label +.macro do_flush flushins:req label R2 = -L1_CACHE_BYTES;
@@ -44,22 +51,15 @@ \label : .endif P0 = R0; + LSETUP (1f, 2f) LC1 = P1; 1: -.ifnb \optflushins - \optflushins [P0]; -.endif -#if ANOMALY_05000443 -.ifb \optnopins -2: -.endif +.ifeqs "\flushins", BROK_FLUSH_INST \flushins [P0++]; -.ifnb \optnopins -2: \optnopins; -.endif -#else +2: nop; +.else 2: \flushins [P0++]; -#endif +.endif RTS; .endm
@@ -77,7 +77,7 @@ ENTRY(_blackfin_icache_flush_range) */ P0 = R0; IFLUSH[P0]; - do_flush IFLUSH, , nop + do_flush IFLUSH ENDPROC(_blackfin_icache_flush_range) /* Throw away all D-cached data in specified region without any obligation to
@@ -91,7 +91,7 @@ ENDPROC(_blackfin_dcache_invalidate_range) /* Flush all data cache lines assocoiated with this memory area */ ENTRY(_blackfin_dcache_flush_range) - do_flush FLUSH, , , .Ldfr + do_flush FLUSH, .Ldfr ENDPROC(_blackfin_dcache_flush_range) /* Our headers convert the page structure to an address, so just need to flush
Signature · 1 line
1.6.3.1
PATCH 17/62 Blackfin: update defconfigs
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
--- arch/blackfin/configs/BF518F-EZBRD_defconfig | 101 ++++-- arch/blackfin/configs/BF526-EZBRD_defconfig | 219 +++++++----- arch/blackfin/configs/BF527-EZKIT_defconfig | 211 +++++++----- arch/blackfin/configs/BF533-EZKIT_defconfig | 103 ++++-- arch/blackfin/configs/BF533-STAMP_defconfig | 105 ++++-- arch/blackfin/configs/BF537-STAMP_defconfig | 109 ++++--- arch/blackfin/configs/BF538-EZKIT_defconfig | 106 ++++--- arch/blackfin/configs/BF548-EZKIT_defconfig | 253 ++++++------- arch/blackfin/configs/BF561-EZKIT_defconfig | 116 ++++--- arch/blackfin/configs/BlackStamp_defconfig | 4 +- arch/blackfin/configs/CM-BF527_defconfig | 29 ++- arch/blackfin/configs/CM-BF533_defconfig | 12 +- arch/blackfin/configs/CM-BF537E_defconfig | 499 ++++++++++++++------------ arch/blackfin/configs/CM-BF537U_defconfig | 12 +- arch/blackfin/configs/CM-BF548_defconfig | 8 +- arch/blackfin/configs/CM-BF561_defconfig | 12 +- arch/blackfin/configs/H8606_defconfig | 8 +- arch/blackfin/configs/IP0X_defconfig | 8 +- arch/blackfin/configs/PNAV-10_defconfig | 39 +- arch/blackfin/configs/SRV1_defconfig | 4 +- arch/blackfin/configs/TCM-BF537_defconfig | 27 ++- 21 files changed, 1162 insertions(+), 823 deletions(-)
arch/blackfin/configs/BF518F-EZBRD_defconfig +66 -35
@@ -1,6 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.28.7 +# Linux kernel version: 2.6.28.10 +# Thu May 21 05:50:01 2009 # # CONFIG_MMU is not set # CONFIG_FPU is not set
@@ -42,10 +43,11 @@ CONFIG_LOG_BUF_SHIFT=14 CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -# CONFIG_SYSCTL is not set +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y CONFIG_EMBEDDED=y CONFIG_UID16=y -CONFIG_SYSCTL_SYSCALL=y +# CONFIG_SYSCTL_SYSCALL is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -53,16 +55,15 @@ CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y # CONFIG_ELF_CORE is not set -CONFIG_COMPAT_BRK=y CONFIG_BASE_FULL=y # CONFIG_FUTEX is not set -CONFIG_ANON_INODES=y CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y +# CONFIG_SIGNALFD is not set +# CONFIG_TIMERFD is not set +# CONFIG_EVENTFD is not set # CONFIG_AIO is not set CONFIG_VM_EVENT_COUNTERS=y +CONFIG_COMPAT_BRK=y CONFIG_SLAB=y # CONFIG_SLUB is not set # CONFIG_SLOB is not set
@@ -71,7 +72,6 @@ CONFIG_SLAB=y CONFIG_HAVE_OPROFILE=y # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set CONFIG_SLABINFO=y -CONFIG_RT_MUTEXES=y CONFIG_TINY_SHMEM=y CONFIG_BASE_SMALL=0 CONFIG_MODULES=y
@@ -259,7 +259,10 @@ CONFIG_HZ=250 # CONFIG_SCHED_HRTICK is not set CONFIG_GENERIC_TIME=y CONFIG_GENERIC_CLOCKEVENTS=y +# CONFIG_TICKSOURCE_GPTMR0 is not set +CONFIG_TICKSOURCE_CORETMR=y # CONFIG_CYCLES_CLOCKSOURCE is not set +# CONFIG_GPTMR0_CLOCKSOURCE is not set # CONFIG_NO_HZ is not set # CONFIG_HIGH_RES_TIMERS is not set CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
@@ -404,7 +407,7 @@ CONFIG_IP_PNP=y # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set -CONFIG_SYN_COOKIES=y +# CONFIG_SYN_COOKIES is not set # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set
@@ -688,14 +691,14 @@ CONFIG_INPUT_MISC=y # Character devices # # CONFIG_AD9960 is not set -# CONFIG_SPI_ADC_BF533 is not set -# CONFIG_BF5xx_PPIFCD is not set +CONFIG_BFIN_DMA_INTERFACE=m +# CONFIG_BFIN_PPI is not set +# CONFIG_BFIN_PPIFCD is not set # CONFIG_BFIN_SIMPLE_TIMER is not set -# CONFIG_BF5xx_PPI is not set +# CONFIG_BFIN_SPI_ADC is not set # CONFIG_BFIN_SPORT is not set # CONFIG_BFIN_TIMER_LATENCY is not set -# CONFIG_TWI_LCD is not set -CONFIG_BFIN_DMA_INTERFACE=m +# CONFIG_BFIN_TWI_LCD is not set CONFIG_SIMPLE_GPIO=m CONFIG_VT=y CONFIG_CONSOLE_TRANSLATIONS=y
@@ -802,7 +805,30 @@ CONFIG_SPI_BFIN=y # CONFIG_SPI_SPIDEV is not set # CONFIG_SPI_TLE62X0 is not set CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y -# CONFIG_GPIOLIB is not set +CONFIG_GPIOLIB=y +# CONFIG_DEBUG_GPIO is not set +CONFIG_GPIO_SYSFS=y + +# +# Memory mapped GPIO expanders: +# + +# +# I2C GPIO expanders: +# +# CONFIG_GPIO_MAX732X is not set +# CONFIG_GPIO_PCA953X is not set +# CONFIG_GPIO_PCF857X is not set + +# +# PCI GPIO expanders: +# + +# +# SPI GPIO expanders: +# +# CONFIG_GPIO_MAX7301 is not set +# CONFIG_GPIO_MCP23S08 is not set # CONFIG_W1 is not set # CONFIG_POWER_SUPPLY is not set # CONFIG_HWMON is not set
@@ -831,6 +857,7 @@ CONFIG_SSB_POSSIBLE=y # CONFIG_HTC_PASIC3 is not set # CONFIG_MFD_TMIO is not set # CONFIG_PMIC_DA903X is not set +# CONFIG_PMIC_ADP5520 is not set # CONFIG_MFD_WM8400 is not set # CONFIG_MFD_WM8350_I2C is not set # CONFIG_REGULATOR is not set
@@ -962,7 +989,8 @@ CONFIG_RTC_DRV_BFIN=y # # File systems # -# CONFIG_EXT2_FS is not set +CONFIG_EXT2_FS=m +# CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT3_FS is not set # CONFIG_EXT4_FS is not set # CONFIG_REISERFS_FS is not set
@@ -988,8 +1016,11 @@ CONFIG_INOTIFY_USER=y # # DOS/FAT/NT Filesystems # +CONFIG_FAT_FS=m # CONFIG_MSDOS_FS is not set -# CONFIG_VFAT_FS is not set +CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_NTFS_FS is not set #
@@ -1012,8 +1043,8 @@ CONFIG_SYSFS=y # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set -# CONFIG_YAFFS_FS is not set # CONFIG_JFFS2_FS is not set +# CONFIG_YAFFS_FS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_MINIX_FS is not set
@@ -1048,9 +1079,9 @@ CONFIG_SMB_FS=m # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y -CONFIG_NLS=y +CONFIG_NLS=m CONFIG_NLS_DEFAULT="iso8859-1" -CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_437=m # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set # CONFIG_NLS_CODEPAGE_850 is not set
@@ -1065,7 +1096,7 @@ CONFIG_NLS_CODEPAGE_437=y # CONFIG_NLS_CODEPAGE_865 is not set # CONFIG_NLS_CODEPAGE_866 is not set # CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set +CONFIG_NLS_CODEPAGE_936=m # CONFIG_NLS_CODEPAGE_950 is not set # CONFIG_NLS_CODEPAGE_932 is not set # CONFIG_NLS_CODEPAGE_949 is not set
@@ -1074,7 +1105,7 @@ CONFIG_NLS_CODEPAGE_437=y # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set # CONFIG_NLS_ASCII is not set -CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_1=m # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set # CONFIG_NLS_ISO8859_4 is not set
@@ -1087,7 +1118,7 @@ CONFIG_NLS_ISO8859_1=y # CONFIG_NLS_ISO8859_15 is not set # CONFIG_NLS_KOI8_R is not set # CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_UTF8 is not set +CONFIG_NLS_UTF8=m # CONFIG_DLM is not set #
@@ -1102,7 +1133,7 @@ CONFIG_FRAME_WARN=1024 CONFIG_DEBUG_FS=y # CONFIG_HEADERS_CHECK is not set CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SHIRQ is not set +CONFIG_DEBUG_SHIRQ=y CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
@@ -1111,8 +1142,6 @@ CONFIG_SCHED_DEBUG=y # CONFIG_TIMER_STATS is not set # CONFIG_DEBUG_OBJECTS is not set # CONFIG_DEBUG_SLAB is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_RT_MUTEX_TESTER is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_MUTEXES is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1132,7 +1161,6 @@ CONFIG_DEBUG_INFO=y # CONFIG_BACKTRACE_SELF_TEST is not set # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set # CONFIG_FAULT_INJECTION is not set -CONFIG_SYSCTL_SYSCALL_CHECK=y # # Tracers
@@ -1148,16 +1176,20 @@ CONFIG_HAVE_ARCH_KGDB=y # CONFIG_DEBUG_STACK_USAGE is not set CONFIG_DEBUG_VERBOSE=y CONFIG_DEBUG_MMRS=y -# CONFIG_DEBUG_HWERR is not set -# CONFIG_DEBUG_DOUBLEFAULT is not set +CONFIG_DEBUG_HWERR=y +CONFIG_EXACT_HWERR=y +CONFIG_DEBUG_DOUBLEFAULT=y +CONFIG_DEBUG_DOUBLEFAULT_PRINT=y +# CONFIG_DEBUG_DOUBLEFAULT_RESET is not set +# CONFIG_DEBUG_ICACHE_CHECK is not set CONFIG_DEBUG_HUNT_FOR_ZERO=y CONFIG_DEBUG_BFIN_HWTRACE_ON=y -CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y -# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set +# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF is not set +CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE=y # CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set -CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0 +CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=1 # CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set -# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set +CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE=y CONFIG_EARLY_PRINTK=y CONFIG_CPLB_INFO=y CONFIG_ACCESS_CHECK=y
@@ -1269,7 +1301,6 @@ CONFIG_CRC32=y # CONFIG_CRC7 is not set # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y -CONFIG_PLIST=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT=y CONFIG_HAS_DMA=y
arch/blackfin/configs/BF526-EZBRD_defconfig +132 -87
448 lines not on this page · raw message
arch/blackfin/configs/BF527-EZKIT_defconfig +127 -84
420 lines not on this page · raw message
arch/blackfin/configs/BF533-EZKIT_defconfig +64 -39
213 lines not on this page · raw message
arch/blackfin/configs/BF533-STAMP_defconfig +65 -40
215 lines not on this page · raw message
arch/blackfin/configs/BF537-STAMP_defconfig +66 -43
225 lines not on this page · raw message
arch/blackfin/configs/BF538-EZKIT_defconfig +65 -41
226 lines not on this page · raw message
arch/blackfin/configs/BF548-EZKIT_defconfig +117 -136
456 lines not on this page · raw message
arch/blackfin/configs/BF561-EZKIT_defconfig +70 -46
251 lines not on this page · raw message
arch/blackfin/configs/BlackStamp_defconfig +2 -2
@@ -46,7 +46,7 @@ CONFIG_INITRAMFS_SOURCE="" # CONFIG_SYSCTL is not set CONFIG_EMBEDDED=y CONFIG_UID16=y -CONFIG_SYSCTL_SYSCALL=y +# CONFIG_SYSCTL_SYSCALL is not set CONFIG_SYSCTL_SYSCALL_CHECK=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -381,7 +381,7 @@ CONFIG_IP_PNP=y # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set -CONFIG_SYN_COOKIES=y +# CONFIG_SYN_COOKIES is not set # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set
arch/blackfin/configs/CM-BF527_defconfig +26 -3
@@ -46,7 +46,7 @@ CONFIG_INITRAMFS_SOURCE="" # CONFIG_SYSCTL is not set CONFIG_EMBEDDED=y CONFIG_UID16=y -CONFIG_SYSCTL_SYSCALL=y +# CONFIG_SYSCTL_SYSCALL is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -411,7 +411,7 @@ CONFIG_IP_PNP=y # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set -CONFIG_SYN_COOKIES=y +# CONFIG_SYN_COOKIES is not set # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set
@@ -783,7 +783,30 @@ CONFIG_SPI_BFIN=y # CONFIG_SPI_SPIDEV is not set # CONFIG_SPI_TLE62X0 is not set CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y -# CONFIG_GPIOLIB is not set +CONFIG_GPIOLIB=y +# CONFIG_DEBUG_GPIO is not set +CONFIG_GPIO_SYSFS=y + +# +# Memory mapped GPIO expanders: +# + +# +# I2C GPIO expanders: +# +# CONFIG_GPIO_MAX732X is not set +# CONFIG_GPIO_PCA953X is not set +# CONFIG_GPIO_PCF857X is not set + +# +# PCI GPIO expanders: +# + +# +# SPI GPIO expanders: +# +# CONFIG_GPIO_MAX7301 is not set +# CONFIG_GPIO_MCP23S08 is not set # CONFIG_W1 is not set # CONFIG_POWER_SUPPLY is not set CONFIG_HWMON=y
arch/blackfin/configs/CM-BF533_defconfig +8 -4
@@ -49,7 +49,7 @@ CONFIG_LOG_BUF_SHIFT=14 # CONFIG_SYSCTL is not set CONFIG_EMBEDDED=y # CONFIG_UID16 is not set -CONFIG_SYSCTL_SYSCALL=y +# CONFIG_SYSCTL_SYSCALL is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set # CONFIG_HOTPLUG is not set
@@ -347,7 +347,7 @@ CONFIG_IP_FIB_HASH=y # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set -CONFIG_SYN_COOKIES=y +# CONFIG_SYN_COOKIES is not set # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set
@@ -547,9 +547,9 @@ CONFIG_MII=y CONFIG_SMC91X=y # CONFIG_SMSC911X is not set # CONFIG_DM9000 is not set -CONFIG_NETDEV_1000=y +# CONFIG_NETDEV_1000 is not set # CONFIG_AX88180 is not set -CONFIG_NETDEV_10000=y +# CONFIG_NETDEV_10000 is not set # # Wireless LAN
@@ -641,6 +641,10 @@ CONFIG_UNIX98_PTYS=y # CONFIG_TCG_TPM is not set # CONFIG_I2C is not set +CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_SYSFS=y + # # SPI support #
arch/blackfin/configs/CM-BF537E_defconfig +277 -222
202 lines not on this page · raw message
arch/blackfin/configs/CM-BF537U_defconfig +8 -4
Lines of this file are not shown. View the raw message.
arch/blackfin/configs/CM-BF548_defconfig +6 -2
Lines of this file are not shown. View the raw message.
arch/blackfin/configs/CM-BF561_defconfig +8 -4
Lines of this file are not shown. View the raw message.
arch/blackfin/configs/PNAV-10_defconfig +20 -19
Lines of this file are not shown. View the raw message.
arch/blackfin/configs/TCM-BF537_defconfig +25 -2
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.6.3.1
Part of the diff is not shown here. View the raw message.
PATCH 18/62 Blackfin: simplify BF561 coreb driver greatly
In reply to Mike FrysingerSince 90% of this driver can be handled in user space, move it to the corebld user space application.
--- arch/blackfin/mach-bf561/Kconfig | 15 +-- arch/blackfin/mach-bf561/coreb.c | 396 +++----------------------------------- 2 files changed, 33 insertions(+), 378 deletions(-)
arch/blackfin/mach-bf561/Kconfig +1 -14
@@ -9,22 +9,9 @@ if (!SMP) comment "Core B Support" config BF561_COREB - bool "Enable Core B support" + bool "Enable Core B loader" default y -config BF561_COREB_RESET - bool "Enable Core B reset support" - default n - help - This requires code in the application that is loaded - into Core B. In order to reset, the application needs - to install an interrupt handler for Supplemental - Interrupt 0, that sets RETI to 0xff600000 and writes - bit 11 of SICB_SYSCR when bit 5 of SICA_SYSCR is 0. - This causes Core B to stall when Supplemental Interrupt - 0 is set, and will reset PC to 0xff600000 when - COREB_SRAM_INIT is cleared. - endif comment "Interrupt Priority Assignment"
arch/blackfin/mach-bf561/coreb.c +32 -364
438 lines not on this page · raw message
Signature · 1 line
1.6.3.1
PATCH 19/62 Blackfin: fix detection of cached L2 SRAM
In reply to Mike FrysingerMake sure our bfin_addr_dcachable() function flags cached L2 SRAM properly else memory easily goes unflushed when working with DMA.
--- arch/blackfin/include/asm/cacheflush.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/blackfin/include/asm/cacheflush.h +5 -0
@@ -108,6 +108,11 @@ static inline int bfin_addr_dcachable(unsigned long addr) addr >= _ramend && addr < physical_mem_end)return 1 ; +#ifndef CONFIG_BFIN_L2_NOT_CACHED +if (addr >=L2_START && addr <L2_START +L2_LENGTH ) +return 1 ; +#endif +return 0 ; }
Signature · 1 line
1.6.3.1
PATCH 20/62 Blackfin: add MDMA defines to make cross-variant coding easier
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
Add some defines to make the BF538/BF561 look like most other Blackfin parts in that it has a MDMA0 channel available for low level init.
--- arch/blackfin/mach-bf538/include/mach/blackfin.h | 19 ------- arch/blackfin/mach-bf538/include/mach/cdefBF538.h | 59 +++++++++++++++++++++ arch/blackfin/mach-bf538/include/mach/defBF539.h | 56 +++++++++++++++++++ arch/blackfin/mach-bf561/include/mach/cdefBF561.h | 29 ++++++++++ arch/blackfin/mach-bf561/include/mach/defBF561.h | 56 +++++++++++++++++++ 5 files changed, 200 insertions(+), 19 deletions(-)
arch/blackfin/mach-bf538/include/mach/blackfin.h +0 -19
@@ -68,25 +68,6 @@#define OFFSET_SCR 0x1C/* SCR Scratch Register */ #define OFFSET_GCTL 0x24/* Global Control Register */ - -#define bfin_write_MDMA_D0_IRQ_STATUS bfin_write_MDMA0_D0_IRQ_STATUS -#define bfin_write_MDMA_D0_START_ADDR bfin_write_MDMA0_D0_START_ADDR -#define bfin_write_MDMA_S0_START_ADDR bfin_write_MDMA0_S0_START_ADDR -#define bfin_write_MDMA_D0_X_COUNT bfin_write_MDMA0_D0_X_COUNT -#define bfin_write_MDMA_S0_X_COUNT bfin_write_MDMA0_S0_X_COUNT -#define bfin_write_MDMA_D0_Y_COUNT bfin_write_MDMA0_D0_Y_COUNT -#define bfin_write_MDMA_S0_Y_COUNT bfin_write_MDMA0_S0_Y_COUNT -#define bfin_write_MDMA_D0_X_MODIFY bfin_write_MDMA0_D0_X_MODIFY -#define bfin_write_MDMA_S0_X_MODIFY bfin_write_MDMA0_S0_X_MODIFY -#define bfin_write_MDMA_D0_Y_MODIFY bfin_write_MDMA0_D0_Y_MODIFY -#define bfin_write_MDMA_S0_Y_MODIFY bfin_write_MDMA0_S0_Y_MODIFY -#define bfin_write_MDMA_S0_CONFIG bfin_write_MDMA0_S0_CONFIG -#define bfin_write_MDMA_D0_CONFIG bfin_write_MDMA0_D0_CONFIG -#define bfin_read_MDMA_S0_CONFIG bfin_read_MDMA0_S0_CONFIG -#define bfin_read_MDMA_D0_IRQ_STATUS bfin_read_MDMA0_D0_IRQ_STATUS -#define bfin_write_MDMA_S0_IRQ_STATUS bfin_write_MDMA0_S0_IRQ_STATUS - -/* DPMC*/ #define bfin_read_STOPCK_OFF () bfin_read_STOPCK()#define bfin_write_STOPCK_OFF (val) bfin_write_STOPCK(val)
arch/blackfin/mach-bf538/include/mach/cdefBF538.h +59 -0
65 lines not on this page · raw message
arch/blackfin/mach-bf538/include/mach/defBF539.h +56 -0
62 lines not on this page · raw message
arch/blackfin/mach-bf561/include/mach/cdefBF561.h +29 -0
@@ -1526,6 +1526,35 @@#define bfin_read_MDMA_D0_START_ADDR () bfin_read_MDMA1_D0_START_ADDR()#define bfin_write_MDMA_D0_START_ADDR (val) bfin_write_MDMA1_D0_START_ADDR(val) +#define bfin_read_MDMA_S1_CONFIG () bfin_read_MDMA1_S1_CONFIG() +#define bfin_write_MDMA_S1_CONFIG (val) bfin_write_MDMA1_S1_CONFIG(val) +#define bfin_read_MDMA_S1_IRQ_STATUS () bfin_read_MDMA1_S1_IRQ_STATUS() +#define bfin_write_MDMA_S1_IRQ_STATUS (val) bfin_write_MDMA1_S1_IRQ_STATUS(val) +#define bfin_read_MDMA_S1_X_MODIFY () bfin_read_MDMA1_S1_X_MODIFY() +#define bfin_write_MDMA_S1_X_MODIFY (val) bfin_write_MDMA1_S1_X_MODIFY(val) +#define bfin_read_MDMA_S1_Y_MODIFY () bfin_read_MDMA1_S1_Y_MODIFY() +#define bfin_write_MDMA_S1_Y_MODIFY (val) bfin_write_MDMA1_S1_Y_MODIFY(val) +#define bfin_read_MDMA_S1_X_COUNT () bfin_read_MDMA1_S1_X_COUNT() +#define bfin_write_MDMA_S1_X_COUNT (val) bfin_write_MDMA1_S1_X_COUNT(val) +#define bfin_read_MDMA_S1_Y_COUNT () bfin_read_MDMA1_S1_Y_COUNT() +#define bfin_write_MDMA_S1_Y_COUNT (val) bfin_write_MDMA1_S1_Y_COUNT(val) +#define bfin_read_MDMA_S1_START_ADDR () bfin_read_MDMA1_S1_START_ADDR() +#define bfin_write_MDMA_S1_START_ADDR (val) bfin_write_MDMA1_S1_START_ADDR(val) +#define bfin_read_MDMA_D1_CONFIG () bfin_read_MDMA1_D1_CONFIG() +#define bfin_write_MDMA_D1_CONFIG (val) bfin_write_MDMA1_D1_CONFIG(val) +#define bfin_read_MDMA_D1_IRQ_STATUS () bfin_read_MDMA1_D1_IRQ_STATUS() +#define bfin_write_MDMA_D1_IRQ_STATUS (val) bfin_write_MDMA1_D1_IRQ_STATUS(val) +#define bfin_read_MDMA_D1_X_MODIFY () bfin_read_MDMA1_D1_X_MODIFY() +#define bfin_write_MDMA_D1_X_MODIFY (val) bfin_write_MDMA1_D1_X_MODIFY(val) +#define bfin_read_MDMA_D1_Y_MODIFY () bfin_read_MDMA1_D1_Y_MODIFY() +#define bfin_write_MDMA_D1_Y_MODIFY (val) bfin_write_MDMA1_D1_Y_MODIFY(val) +#define bfin_read_MDMA_D1_X_COUNT () bfin_read_MDMA1_D1_X_COUNT() +#define bfin_write_MDMA_D1_X_COUNT (val) bfin_write_MDMA1_D1_X_COUNT(val) +#define bfin_read_MDMA_D1_Y_COUNT () bfin_read_MDMA1_D1_Y_COUNT() +#define bfin_write_MDMA_D1_Y_COUNT (val) bfin_write_MDMA1_D1_Y_COUNT(val) +#define bfin_read_MDMA_D1_START_ADDR () bfin_read_MDMA1_D1_START_ADDR() +#define bfin_write_MDMA_D1_START_ADDR (val) bfin_write_MDMA1_D1_START_ADDR(val) +/* These need to be last due to the cdef/linux inter-dependencies */ #include <asm/irq.h>
arch/blackfin/mach-bf561/include/mach/defBF561.h +56 -0
62 lines not on this page · raw message
Signature · 1 line
1.6.3.1
PATCH 21/62 Blackfin: fix early L1 relocation crash
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
Our early L1 relocate code may implicitly call code which lives in L1 memory. This is due to the dma_memcpy() rewrite that made the DMA code lockless and safe to be used by multiple processes. If we start the early DMA memcpy to relocate things into L1 instruction but then our DMA memcpy code calls a function that lives in L1, things fall apart. As such, create a small dedicated DMA memcpy routine that we can assume sanity at boot time.
--- arch/blackfin/include/asm/dma.h | 2 + arch/blackfin/kernel/bfin_dma_5xx.c | 81 +++++++++++++++++++++++++++++++++++ arch/blackfin/kernel/setup.c | 51 ++++++++++++---------- 3 files changed, 111 insertions(+), 23 deletions(-)
arch/blackfin/include/asm/dma.h +2 -0
@@ -253,5 +253,7 @@ static inline void clear_dma_irqstat(unsigned int channel)void *dma_memcpy (void *dest,const void *src,size_t count);void *safe_dma_memcpy (void *dest,const void *src,size_t count);void blackfin_dma_early_init (void ); +void early_dma_memcpy (void *dest,const void *src,size_t count); +void early_dma_memcpy_done (void );#endif
arch/blackfin/kernel/bfin_dma_5xx.c +81 -0
87 lines not on this page · raw message
arch/blackfin/kernel/setup.c +28 -23
68 lines not on this page · raw message
Signature · 1 line
1.6.3.1
PATCH 22/62 Blackfin: document anomaly 05000234 workaround
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
Note the reason for using CHIPD over DSPID.
--- arch/blackfin/include/asm/processor.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/blackfin/include/asm/processor.h +2 -2
@@ -131,8 +131,8 @@ unsigned long get_wchan(struct task_struct *p);/* Get the Silicon Revision of the chip */ static inline uint32_t __pure bfin_revid (void ) { -/* stored in the upper 4 bits */ -uint32_t revid =bfin_read_CHIPID () >>28 ; +/* Always use CHIPID, to work around ANOMALY_05000234 */ +uint32_t revid = (bfin_read_CHIPID () &CHIPID_VERSION ) >>28 ;#ifdef CONFIG_BF52x/* ANOMALY_05000357
Signature · 1 line
1.6.3.1
PATCH 23/62 Blackfin: annotate anomaly 05000119 in core DMA code
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
Add a reminder note to avoid the DMA_DONE bit in our DMA core code.
--- arch/blackfin/kernel/bfin_dma_5xx.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/blackfin/kernel/bfin_dma_5xx.c +5 -0
@@ -20,6 +20,11 @@#include <asm/dma.h> #include <asm/uaccess.h> +/* +* To make sure we work around 05000119 - we always check DMA_DONE bit, +* never the DMA_RUN bit +*/ +struct dma_channel dma_ch[MAX_DMA_CHANNELS ];EXPORT_SYMBOL (dma_ch);
Signature · 1 line
1.6.3.1
PATCH 24/62 Blackfin: punt useless GPIO init call
In reply to Mike FrysingerThis init code existed only to dump a printk(), and not even a useful one.
--- arch/blackfin/kernel/bfin_gpio.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-)
arch/blackfin/kernel/bfin_gpio.c +0 -9
@@ -313,15 +313,6 @@ inline void portmux_setup(unsigned short per)# define portmux_setup (...) do { } while (0)#endif -static int __init bfin_gpio_init (void ) -{ -printk (KERN_INFO "Blackfin GPIO Controller\n" ); - -return 0 ; -} -arch_initcall (bfin_gpio_init); - -#ifndef CONFIG_BF54x/*********************************************************** *
Signature · 1 line
1.6.3.1
PATCH 25/62 Blackfin: work around anomaly 05000287
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
Make sure we work around anomaly 05000287 by configuring different port preferences for the data cache.
--- arch/blackfin/kernel/cplb-mpu/cacheinit.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
arch/blackfin/kernel/cplb-mpu/cacheinit.c +8 -1
@@ -55,7 +55,14 @@ void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl) } ctrl =bfin_read_DMEM_CONTROL (); - ctrl |=DMEM_CNTR ; + +/* +* Anomaly notes: +* 05000287 - We implement workaround #2 - Change the DMEM_CONTROL +* register, so that the port preferences for DAG0 and DAG1 are set +* to port B +*/ + ctrl |=DMEM_CNTR |PORT_PREF0 | (ANOMALY_05000287 ?PORT_PREF1 :0 );bfin_write_DMEM_CONTROL (ctrl);SSYNC (); }
Signature · 1 line
1.6.3.1
PATCH 26/62 Blackfin: delete unused sys_getpagesize() function
In reply to Mike Frysinger--- arch/blackfin/kernel/sys_bfin.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
arch/blackfin/kernel/sys_bfin.c +0 -5
@@ -78,11 +78,6 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,return do_mmap2 (addr, len, prot, flags, fd, pgoff); } -asmlinkage int sys_getpagesize(void) -{ -return PAGE_SIZE ; -} - asmlinkage void *sys_sram_alloc(size_t size, unsigned long flags) {return sram_alloc_with_lsl (size, flags);
Signature · 1 line
1.6.3.1
PATCH 27/62 Blackfin: workaround anomaly 05000227
In reply to Mike FrysingerWorkaround anomaly 05000227 by only using the scratch pad for stack when absolutely necessary. The core code which reprograms clocks really only touches MMRs directly with constants.
--- arch/blackfin/mach-common/head.S | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-)
arch/blackfin/mach-common/head.S +11 -7
@@ -30,8 +30,6 @@ ENTRY(__init_clear_bss) rts; ENDPROC(__init_clear_bss) -#define INITIAL_STACK (L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12) - ENTRY(__start) /* R0: argument of command line string, passed from uboot, save it */ R7 = R0;
@@ -148,8 +146,8 @@ ENTRY(__start) #endif /* Initialize stack pointer */ - sp.l = lo(INITIAL_STACK); - sp.h = hi(INITIAL_STACK); + sp.l = _init_thread_union; + sp.h = _init_thread_union; fp = sp; usp = sp;
@@ -189,7 +187,15 @@ ENTRY(__start) /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ call _bfin_relocate_l1_mem; #ifdef CONFIG_BFIN_KERNEL_CLOCK + /* Only use on-chip scratch space for stack when absolutely required + * to avoid Anomaly 05000227 ... we know the init_clocks() func only + * uses L1 text and stack space and no other memory region. + */ +# define KERNEL_CLOCK_STACK (L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12) + sp.l = lo(KERNEL_CLOCK_STACK); + sp.h = hi(KERNEL_CLOCK_STACK); call _init_clocks; + sp = usp; /* usp hasnt been touched, so restore from there */ #endif /* This section keeps the processor in supervisor mode
@@ -243,9 +249,7 @@ ENTRY(_real_start) call _cmdline_init; /* Load the current thread pointer and stack */ - sp.l = _init_thread_union; - sp.h = _init_thread_union; - p1 = THREAD_SIZE (z); + p1 = THREAD_SIZE + 4 (z); /* +4 is for reti loading */ sp = sp + p1; usp = sp; fp = sp;
Signature · 1 line
1.6.3.1
PATCH 28/62 Blackfin: do not append newlines to panic() messages
In reply to Mike FrysingerThe panic() function already handles newlines for us.
--- arch/blackfin/kernel/setup.c | 8 ++++---- arch/blackfin/kernel/traps.c | 4 ++-- arch/blackfin/mach-bf561/smp.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
arch/blackfin/kernel/setup.c +4 -4
@@ -477,7 +477,7 @@ static __init void memory_setup(void)if (DMA_UNCACHED_REGION > (_ramend - _ramstart)) {console_init (); -panic ("DMA region exceeds memory limit: %lu.\n" , +panic ("DMA region exceeds memory limit: %lu." , _ramend - _ramstart); } memory_end = _ramend -DMA_UNCACHED_REGION ;
@@ -531,7 +531,7 @@ static __init void memory_setup(void)if (mtd_size ==0 ) {console_init (); -panic ("Don't boot kernel without rootfs attached.\n" ); +panic ("Don't boot kernel without rootfs attached." ); }/* Relocate MTD image to the top of memory after the uncached memory area */
@@ -886,7 +886,7 @@ void __init setup_arch(char **cmdline_p)printk (KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n" ,bfin_compiled_revid (),bfin_revid ());if (bfin_compiled_revid () >bfin_revid ()) -panic ("Error: you are missing anomaly workarounds for this rev\n" ); +panic ("Error: you are missing anomaly workarounds for this rev" ); } }if (bfin_revid () <CONFIG_BF_REV_MIN ||bfin_revid () >CONFIG_BF_REV_MAX )
@@ -896,7 +896,7 @@ void __init setup_arch(char **cmdline_p)/* We can't run on BF548-0.1 due to ANOMALY 05000448 */ if (bfin_cpuid () ==0x27de &&bfin_revid () ==1 ) -panic ("You can't run on this processor due to 05000448\n" ); +panic ("You can't run on this processor due to 05000448" );printk (KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n" );
arch/blackfin/kernel/traps.c +2 -2
@@ -222,7 +222,7 @@ asmlinkage void double_fault_c(struct pt_regs *fp) show_regs(fp); }#endif -panic ("Double Fault - unrecoverable event\n" ); +panic ("Double Fault - unrecoverable event" ); }
@@ -1246,5 +1246,5 @@ void panic_cplb_error(int cplb_panic, struct pt_regs *fp)dump_bfin_mem (fp);show_regs (fp);dump_stack (); -panic ("Unrecoverable event\n" ); +panic ("Unrecoverable event" ); }
arch/blackfin/mach-bf561/smp.c +1 -1
@@ -135,7 +135,7 @@ void __init platform_request_ipi(irq_handler_t handler) ret =request_irq (IRQ_SUPPLE_0 , handler,IRQF_DISABLED ,"SMP interrupt" , handler);if (ret) -panic ("Cannot request supplemental interrupt 0 for IPI service\n" ); +panic ("Cannot request supplemental interrupt 0 for IPI service" ); }void platform_send_ipi (cpumask_t callmap)
Signature · 1 line
1.6.3.1
PATCH 29/62 Blackfin: detect anomaly 05000274
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
Detect and reject operating conditions for anomaly 05000274 since the problem cannot be worked around in software.
--- arch/blackfin/kernel/setup.c | 9 ++------- arch/blackfin/mach-common/cpufreq.c | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-)
arch/blackfin/kernel/setup.c +2 -7
@@ -801,10 +801,8 @@ void __init setup_arch(char **cmdline_p) cclk =get_cclk (); sclk =get_sclk (); -#if !defined(CONFIG_BFIN_KERNEL_CLOCK ) -if (ANOMALY_05000273 && cclk == sclk) -panic ("ANOMALY 05000273, SCLK can not be same as CCLK" ); -#endif +if ((ANOMALY_05000273 ||ANOMALY_05000274 ) && (cclk >>1 ) <= sclk) +panic ("ANOMALY 05000273 or 05000274: CCLK must be >= 2*SCLK" );#ifdef BF561_FAMILY if (ANOMALY_05000266 ) {
@@ -903,9 +901,6 @@ void __init setup_arch(char **cmdline_p)printk (KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n" , cclk /1000000 , sclk /1000000 ); -if (ANOMALY_05000273 && (cclk >>1 ) <= sclk) -printk ("\n\n\nANOMALY_05000273: CCLK must be >= 2*SCLK !!!\n\n\n" ); -setup_bootmem_allocator ();paging_init ();
arch/blackfin/mach-common/cpufreq.c +2 -1
@@ -140,7 +140,8 @@ static int __init __bfin_cpu_init(struct cpufreq_policy *policy) cclk =get_cclk () /1000 ; sclk =get_sclk () /1000 ; -#if ANOMALY_05000273 || (!defined(CONFIG_BF54x) && defined(CONFIG_BFIN_DCACHE )) +#if ANOMALY_05000273 ||ANOMALY_05000274 || \ + (!defined(CONFIG_BF54x) && defined(CONFIG_BFIN_DCACHE )) min_cclk = sclk *2 ;#else min_cclk = sclk;
Signature · 1 line
1.6.3.1
PATCH 30/62 Blackfin: BF518F-EZBRD: handle required portmuxing of async pins
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
The two high address lines on the BF51x are not dedicated which means we need to handle them like any other peripheral pin if we want to access the upper 2MB of parallel flash.
--- arch/blackfin/mach-bf518/boards/ezbrd.c | 9 +++++++++ arch/blackfin/mach-bf518/include/mach/portmux.h | 6 +++++- 2 files changed, 14 insertions(+), 1 deletions(-)
arch/blackfin/mach-bf518/boards/ezbrd.c +9 -0
@@ -82,7 +82,11 @@ static struct physmap_flash_data ezbrd_flash_data = {static struct resource ezbrd_flash_resource = { .start =0x20000000 , +#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) + .end =0x202fffff , +#else .end =0x203fffff , +#endif .flags =IORESOURCE_MEM , };
@@ -678,6 +682,11 @@ static int __init ezbrd_init(void) ARRAY_SIZE(bfin_i2c_board_info));platform_add_devices (stamp_devices,ARRAY_SIZE (stamp_devices));spi_register_board_info (bfin_spi_board_info,ARRAY_SIZE (bfin_spi_board_info)); +/* setup BF518-EZBRD GPIO pin PG11 to AMS2, PG15 to AMS3. */ +peripheral_request (P_AMS2 ,"ParaFlash" ); +#if !defined(CONFIG_SPI_BFIN ) && !defined(CONFIG_SPI_BFIN_MODULE ) +peripheral_request (P_AMS3 ,"ParaFlash" ); +#endif return 0 ; }
arch/blackfin/mach-bf518/include/mach/portmux.h +5 -1
@@ -185,6 +185,10 @@#define P_PTP_PPS (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(2))#define P_PTP_CLKOUT (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(2)) -#define P_HWAIT (P_DEFINED | P_IDENT(GPIO_PG000000000) | P_FUNCT(1)) +/* AMS */ +#define P_AMS2 (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(1)) +#define P_AMS3 (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(2)) + +#define P_HWAIT (P_DEFINED | P_IDENT(GPIO_PG000000000) | P_FUNCT(1))#endif /* _MACH_PORTMUX_H_ */
Signature · 1 line
1.6.3.1
PATCH 31/62 Blackfin: annotate anomaly 05000120
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
Add some notes for anomaly 05000120 to make sure we work around it.
--- arch/blackfin/mach-common/smp.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
arch/blackfin/mach-common/smp.c +4 -0
@@ -45,6 +45,10 @@#include <asm/cpu.h> #include <linux/err.h> +/* +* Anomaly notes: +* 05000120 - we always define corelock as 32-bit integer in L2 +*/ struct corelock_slot corelock __attribute__ ((__section__(".l2.bss"))); void __cpuinitdata *init_retx_coreb, *init_saved_retx_coreb,
Signature · 1 line
1.6.3.1
PATCH 32/62 Blackfin: add support for gptimer0 as a tick source
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
For systems where the core cycles are not a usable tick source (like SMP or cycles gets updated), enable gptimer0 as an alternative.
--- arch/blackfin/Kconfig | 32 +++-- arch/blackfin/include/asm/time.h | 1 + arch/blackfin/kernel/time-ts.c | 220 ++++++++++++++++++++++++----- arch/blackfin/kernel/time.c | 10 +- arch/blackfin/mach-bf518/Kconfig | 1 + arch/blackfin/mach-bf527/Kconfig | 1 + arch/blackfin/mach-bf533/Kconfig | 1 + arch/blackfin/mach-bf537/Kconfig | 1 + arch/blackfin/mach-bf538/Kconfig | 1 + arch/blackfin/mach-bf548/Kconfig | 1 + arch/blackfin/mach-bf561/Kconfig | 1 + arch/blackfin/mach-bf561/smp.c | 2 +- arch/blackfin/mach-common/ints-priority.c | 23 +--- arch/blackfin/mach-common/smp.c | 5 +- 14 files changed, 227 insertions(+), 73 deletions(-)
arch/blackfin/Kconfig +22 -10
@@ -241,12 +241,6 @@ config IRQ_PER_CPU depends on SMP default y -config TICK_SOURCE_SYSTMR0 - bool - select BFIN_GPTIMERS - depends on SMP - default y - config BF_REV_MIN int default 0 if (BF51x || BF52x || (BF54x && !BF54xM))
@@ -607,7 +601,6 @@ source kernel/Kconfig.hz config GENERIC_TIME bool "Generic time" - depends on !SMP default y config GENERIC_CLOCKEVENTS
@@ -615,12 +608,26 @@ config GENERIC_CLOCKEVENTS depends on GENERIC_TIME default y +choice + prompt "Kernel Tick Source" + depends on GENERIC_CLOCKEVENTS + default TICKSOURCE_CORETMR + +config TICKSOURCE_GPTMR0 + bool "Gptimer0 (SCLK domain)" + select BFIN_GPTIMERS + depends on !IPIPE + +config TICKSOURCE_CORETMR + bool "Core timer (CCLK domain)" + +endchoice + config CYCLES_CLOCKSOURCE - bool "Use 'CYCLES' as a clocksource (EXPERIMENTAL)" - depends on EXPERIMENTAL + bool "Use 'CYCLES' as a clocksource" depends on GENERIC_CLOCKEVENTS depends on !BFIN_SCRATCH_REG_CYCLES - default n + depends on !SMP help If you say Y here, you will enable support for using the 'cycles' registers as a clock source. Doing so means you will be unable to
@@ -628,6 +635,11 @@ config CYCLES_CLOCKSOURCE still be able to read it (such as for performance monitoring), but writing the registers will most likely crash the kernel. +config GPTMR0_CLOCKSOURCE + bool "Use GPTimer0 as a clocksource (higher rating)" + depends on GENERIC_CLOCKEVENTS + depends on !TICKSOURCE_GPTMR0 + source kernel/time/Kconfig comment "Misc"
arch/blackfin/include/asm/time.h +1 -0
@@ -37,4 +37,5 @@ extern unsigned long long __bfin_cycles_off;extern unsigned int __bfin_cycles_mod;#endif +extern void __init setup_core_timer (void );#endif
arch/blackfin/kernel/time-ts.c +182 -38
312 lines not on this page · raw message
arch/blackfin/kernel/time.c +5 -5
@@ -31,7 +31,7 @@ static struct irqaction bfin_timer_irq = {#endif }; -#if defined(CONFIG_TICK_SOURCE_SYSTMR0 ) || defined(CONFIG_IPIPE ) +#if defined(CONFIG_TICKSOURCE_GPTMR0 ) || defined(CONFIG_IPIPE )void __init setup_system_timer0 (void ) {/* Power down the core timer, just to play safe. */
@@ -74,7 +74,7 @@ void __init setup_core_timer(void)static void __init time_sched_init (irqreturn_t (*timer_routine) (int ,void *)) { -#if defined(CONFIG_TICK_SOURCE_SYSTMR0 ) || defined(CONFIG_IPIPE ) +#if defined(CONFIG_TICKSOURCE_GPTMR0 ) || defined(CONFIG_IPIPE )setup_system_timer0 (); bfin_timer_irq.handler = timer_routine;setup_irq (IRQ_TIMER0 , &bfin_timer_irq);
@@ -94,7 +94,7 @@ static unsigned long gettimeoffset(void)unsigned long offset;unsigned long clocks_per_jiffy; -#if defined(CONFIG_TICK_SOURCE_SYSTMR0 ) || defined(CONFIG_IPIPE ) +#if defined(CONFIG_TICKSOURCE_GPTMR0 ) || defined(CONFIG_IPIPE ) clocks_per_jiffy =bfin_read_TIMER0_PERIOD (); offset =bfin_read_TIMER0_COUNTER () / \ (((clocks_per_jiffy +1 ) *HZ ) /USEC_PER_SEC );
@@ -133,7 +133,7 @@ irqreturn_t timer_interrupt(int irq, void *dummy)static long last_rtc_update;write_seqlock (&xtime_lock); -#if defined(CONFIG_TICK_SOURCE_SYSTMR0 ) && !defined(CONFIG_IPIPE ) +#if defined(CONFIG_TICKSOURCE_GPTMR0 ) && !defined(CONFIG_IPIPE )/* * TIMIL0 is latched in __ipipe_grab_irq() when the I-Pipe is * enabled.
@@ -159,7 +159,7 @@ irqreturn_t timer_interrupt(int irq, void *dummy)/* Do it again in 60s. */ last_rtc_update = xtime.tv_sec -600 ; } -#if defined(CONFIG_TICK_SOURCE_SYSTMR0 ) && !defined(CONFIG_IPIPE ) +#if defined(CONFIG_TICKSOURCE_GPTMR0 ) && !defined(CONFIG_IPIPE ) set_gptimer_status(0, TIMER_STATUS_TIMIL0); }#endif
arch/blackfin/mach-bf518/Kconfig +1 -0
@@ -156,6 +156,7 @@ config IRQ_PORTH_INTB default 11 config IRQ_TIMER0 int "IRQ_TIMER0" + default 7 if TICKSOURCE_GPTMR0 default 8 config IRQ_TIMER1 int "IRQ_TIMER1"
arch/blackfin/mach-bf527/Kconfig +1 -0
@@ -170,6 +170,7 @@ config IRQ_PORTH_INTB default 11 config IRQ_TIMER0 int "IRQ_TIMER0" + default 7 if TICKSOURCE_GPTMR0 default 8 config IRQ_TIMER1 int "IRQ_TIMER1"
arch/blackfin/mach-bf533/Kconfig +1 -0
@@ -59,6 +59,7 @@ config DMA7_UARTTX default 10 config TIMER0 int "TIMER0" + default 7 if TICKSOURCE_GPTMR0 default 8 config TIMER1 int "TIMER1"
arch/blackfin/mach-bf537/Kconfig +1 -0
@@ -66,6 +66,7 @@ config IRQ_MAC_TX default 11 config IRQ_TIMER0 int "IRQ_TIMER0" + default 7 if TICKSOURCE_GPTMR0 default 8 config IRQ_TIMER1 int "IRQ_TIMER1"
arch/blackfin/mach-bf538/Kconfig +1 -0
@@ -57,6 +57,7 @@ config IRQ_UART0_TX default 10 config IRQ_TIMER0 int "IRQ_TIMER0" + default 7 if TICKSOURCE_GPTMR0 default 8 config IRQ_TIMER1 int "IRQ_TIMER1"
arch/blackfin/mach-bf548/Kconfig +1 -0
@@ -257,6 +257,7 @@ config IRQ_OTPSEC default 11 config IRQ_TIMER0 int "IRQ_TIMER0" + default 7 if TICKSOURCE_GPTMR0 default 8 config IRQ_TIMER1 int "IRQ_TIMER1"
arch/blackfin/mach-bf561/Kconfig +1 -0
@@ -125,6 +125,7 @@ config IRQ_DMA2_11 default 9 config IRQ_TIMER0 int "TIMER 0 Interrupt" + default 7 if TICKSOURCE_GPTMR0 default 8 config IRQ_TIMER1 int "TIMER 1 Interrupt"
arch/blackfin/mach-bf561/smp.c +1 -1
@@ -133,7 +133,7 @@ void __init platform_request_ipi(irq_handler_t handler)int ret; ret =request_irq (IRQ_SUPPLE_0 , handler,IRQF_DISABLED , -"SMP interrupt" , handler); +"Supplemental Interrupt0" , handler);if (ret)panic ("Cannot request supplemental interrupt 0 for IPI service" ); }
arch/blackfin/mach-common/ints-priority.c +6 -17
@@ -1052,7 +1052,7 @@ int __init init_arch_irq(void)set_irq_chained_handler (irq, bfin_demux_error_irq);break ;#endif -#if defined(CONFIG_TICK_SOURCE_SYSTMR0 ) || defined(CONFIG_IPIPE ) +#if defined(CONFIG_TICKSOURCE_GPTMR0 )case IRQ_TIMER0 :set_irq_handler (irq, handle_percpu_irq);break ;
@@ -1232,13 +1232,9 @@ asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs)if (likely (vec ==EVT_IVTMR_P )) { irq =IRQ_CORETMR ; - goto core_tick; - } - -SSYNC (); + }else {#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561 ) - {unsigned long sic_status[3 ]; sic_status[0 ] =bfin_read_SIC_ISR0 () &bfin_read_SIC_IMASK0 ();
@@ -1254,9 +1250,7 @@ asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs)if (sic_status[(ivg->irqno -IVG7 ) /32 ] & ivg->isrflag) break; } - }#else - {unsigned long sic_status; sic_status =bfin_read_SIC_IMASK () &bfin_read_SIC_ISR ();
@@ -1268,15 +1262,13 @@ asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs) } else if (sic_status & ivg->isrflag)break ; } - }#endif - irq = ivg->irqno; + irq = ivg->irqno; + }if (irq ==IRQ_SYSTMR ) { -#ifdef CONFIG_GENERIC_CLOCKEVENTS -core_tick: -#else +#ifndef CONFIG_GENERIC_CLOCKEVENTS bfin_write_TIMER_STATUS (1 );/* Latch TIMIL0 */ #endif /* This is basically what we need from the register frame. */
@@ -1288,9 +1280,6 @@ core_tick:__raw_get_cpu_var (__ipipe_tick_regs).ipend |=0x10 ; } -#ifndef CONFIG_GENERIC_CLOCKEVENTS -core_tick: -#endif if (this_domain == ipipe_root_domain) { s =__test_and_set_bit (IPIPE_SYNCDEFER_FLAG , &p->status);barrier ();
@@ -1308,7 +1297,7 @@ core_tick: } } -return 0 ; +return 0 ; }#endif /* CONFIG_IPIPE */
arch/blackfin/mach-common/smp.c +3 -2
@@ -43,6 +43,7 @@#include <asm/processor.h> #include <asm/ptrace.h> #include <asm/cpu.h> +#include <asm/time.h> #include <linux/err.h> /*
@@ -356,7 +357,7 @@ int __cpuinit __cpu_up(unsigned int cpu)static void __cpuinit setup_secondary (unsigned int cpu) { -#if !(defined(CONFIG_TICK_SOURCE_SYSTMR0 ) || defined(CONFIG_IPIPE )) +#if !defined(CONFIG_TICKSOURCE_GPTMR0 )struct irq_desc *timer_desc;#endif unsigned long ilat;
@@ -377,7 +378,7 @@ static void __cpuinit setup_secondary(unsigned int cpu)IMASK_IVG14 |IMASK_IVG13 |IMASK_IVG12 |IMASK_IVG11 |IMASK_IVG10 |IMASK_IVG9 |IMASK_IVG8 |IMASK_IVG7 |IMASK_IVGHW ; -#if defined(CONFIG_TICK_SOURCE_SYSTMR0 ) || defined(CONFIG_IPIPE ) +#if defined(CONFIG_TICKSOURCE_GPTMR0 )/* Power down the core timer, just to play safe. */ bfin_write_TCNTL (0 );
Signature · 1 line
1.6.3.1
PATCH 33/62 Blackfin: add workaround for anomaly 05000287
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
--- arch/blackfin/kernel/cplb-nompu/cacheinit.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
arch/blackfin/kernel/cplb-nompu/cacheinit.c +8 -1
@@ -55,7 +55,14 @@ void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl) } ctrl =bfin_read_DMEM_CONTROL (); - ctrl |=DMEM_CNTR ; + +/* +* Anomaly notes: +* 05000287 - We implement workaround #2 - Change the DMEM_CONTROL +* register, so that the port preferences for DAG0 and DAG1 are set +* to port B +*/ + ctrl |=DMEM_CNTR |PORT_PREF0 | (ANOMALY_05000287 ?PORT_PREF1 :0 );bfin_write_DMEM_CONTROL (ctrl);SSYNC (); }
Signature · 1 line
1.6.3.1
PATCH 34/62 Blackfin: make sure MPU CPLB for first 1k is marked as valid
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
This way we properly catch and kill applications that jump to a NULL ptr.
--- arch/blackfin/kernel/cplb-mpu/cplbinit.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/kernel/cplb-mpu/cplbinit.c +1 -1
@@ -64,7 +64,7 @@ void __init generate_cplb_tables_cpu(unsigned int cpu) dcplb_tbl[cpu][i_d++].data =SDRAM_OOPS |PAGE_SIZE_1KB ; icplb_tbl[cpu][i_i].addr =0 ; - icplb_tbl[cpu][i_i++].data = i_cache |CPLB_USER_RD |PAGE_SIZE_1KB ; + icplb_tbl[cpu][i_i++].data =CPLB_VALID | i_cache |CPLB_USER_RD |PAGE_SIZE_1KB ;/* Cover kernel memory with 4M pages. */ addr =0 ;
Signature · 1 line
1.6.3.1
PATCH 35/62 Blackfin: rename some Blackfin drivers
In reply to Mike FrysingerTry to keep the naming conventions consistent, so:
SPI_ADC_BF533 -> BFIN_SPI_ADC TWI_LCD -> BFIN_TWI_LCD
--- arch/blackfin/mach-bf518/boards/ezbrd.c | 10 +++++----- arch/blackfin/mach-bf527/boards/cm_bf527.c | 10 +++++----- arch/blackfin/mach-bf527/boards/ezbrd.c | 10 +++++----- arch/blackfin/mach-bf527/boards/ezkit.c | 10 +++++----- arch/blackfin/mach-bf533/boards/H8606.c | 4 ++-- arch/blackfin/mach-bf533/boards/cm_bf533.c | 4 ++-- arch/blackfin/mach-bf533/boards/ezkit.c | 4 ++-- arch/blackfin/mach-bf533/boards/stamp.c | 6 +++--- arch/blackfin/mach-bf537/boards/cm_bf537.c | 4 ++-- arch/blackfin/mach-bf537/boards/pnav10.c | 8 ++++---- arch/blackfin/mach-bf537/boards/stamp.c | 10 +++++----- arch/blackfin/mach-bf537/boards/tcm_bf537.c | 4 ++-- arch/blackfin/mach-bf548/boards/ezkit.c | 2 +- arch/blackfin/mach-bf561/boards/cm_bf561.c | 4 ++-- 14 files changed, 45 insertions(+), 45 deletions(-)
arch/blackfin/mach-bf518/boards/ezbrd.c +5 -5
@@ -166,8 +166,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { };#endif -#if defined(CONFIG_SPI_ADC_BF533 ) \ - || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) \ + || defined(CONFIG_BFIN_SPI_ADC_MODULE )/* SPI ADC chip */ static struct bfin5xx_spi_chip spi_adc_chip_info = { .enable_dma = 1, /* use dma transfer with this chip*/
@@ -253,8 +253,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) \ - || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) \ + || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -518,7 +518,7 @@ static struct platform_device i2c_bfin_twi_device = {#endif static struct i2c_board_info __initdata bfin_i2c_board_info[] = { -#if defined(CONFIG_TWI_LCD ) || defined(CONFIG_TWI_LCD_MODULE ) +#if defined(CONFIG_BFIN_TWI_LCD ) || defined(CONFIG_TWI_LCD_MODULE ) { I2C_BOARD_INFO("pcf8574_lcd", 0x22), },
arch/blackfin/mach-bf527/boards/cm_bf527.c +5 -5
@@ -463,8 +463,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { };#endif -#if defined(CONFIG_SPI_ADC_BF533 ) \ - || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) \ + || defined(CONFIG_BFIN_SPI_ADC_MODULE )/* SPI ADC chip */ static struct bfin5xx_spi_chip spi_adc_chip_info = { .enable_dma = 1, /* use dma transfer with this chip*/
@@ -554,8 +554,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) \ - || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) \ + || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -789,7 +789,7 @@ static struct platform_device i2c_bfin_twi_device = {#endif static struct i2c_board_info __initdata bfin_i2c_board_info[] = { -#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) +#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) { I2C_BOARD_INFO("pcf8574_lcd", 0x22), .type = "pcf8574_lcd",
arch/blackfin/mach-bf527/boards/ezbrd.c +5 -5
@@ -247,8 +247,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { };#endif -#if defined(CONFIG_SPI_ADC_BF533 ) \ - || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) \ + || defined(CONFIG_BFIN_SPI_ADC_MODULE )/* SPI ADC chip */ static struct bfin5xx_spi_chip spi_adc_chip_info = { .enable_dma = 1, /* use dma transfer with this chip*/
@@ -354,8 +354,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) \ - || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) \ + || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -586,7 +586,7 @@ static struct platform_device i2c_bfin_twi_device = {#endif static struct i2c_board_info __initdata bfin_i2c_board_info[] = { -#if defined(CONFIG_TWI_LCD ) || defined(CONFIG_TWI_LCD_MODULE ) +#if defined(CONFIG_BFIN_TWI_LCD ) || defined(CONFIG_TWI_LCD_MODULE ) { I2C_BOARD_INFO("pcf8574_lcd", 0x22), },
arch/blackfin/mach-bf527/boards/ezkit.c +5 -5
@@ -485,8 +485,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { };#endif -#if defined(CONFIG_SPI_ADC_BF533 ) \ - || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) \ + || defined(CONFIG_BFIN_SPI_ADC_MODULE )/* SPI ADC chip */ static struct bfin5xx_spi_chip spi_adc_chip_info = { .enable_dma = 1, /* use dma transfer with this chip*/
@@ -600,8 +600,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) \ - || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) \ + || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -854,7 +854,7 @@ static struct platform_device i2c_bfin_twi_device = {#endif static struct i2c_board_info __initdata bfin_i2c_board_info[] = { -#if defined(CONFIG_TWI_LCD ) || defined(CONFIG_TWI_LCD_MODULE ) +#if defined(CONFIG_BFIN_TWI_LCD ) || defined(CONFIG_TWI_LCD_MODULE ) { I2C_BOARD_INFO("pcf8574_lcd", 0x22), },
arch/blackfin/mach-bf533/boards/H8606.c +2 -2
@@ -173,7 +173,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { };#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE )/* SPI ADC chip */ static struct bfin5xx_spi_chip spi_adc_chip_info = { .ctl_reg = 0x1000,
@@ -216,7 +216,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 4, /* actual baudrate is SCLK/(2xspeed_hz) */
arch/blackfin/mach-bf533/boards/cm_bf533.c +2 -2
@@ -82,7 +82,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {#endif /* SPI ADC chip */ -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE )static struct bfin5xx_spi_chip spi_adc_chip_info = { .enable_dma =1 ,/* use dma transfer with this chip*/ .bits_per_word = 16,
@@ -117,7 +117,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
arch/blackfin/mach-bf533/boards/ezkit.c +2 -2
@@ -118,7 +118,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { };#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE )/* SPI ADC chip */ static struct bfin5xx_spi_chip spi_adc_chip_info = { .enable_dma = 1, /* use dma transfer with this chip*/
@@ -154,7 +154,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
arch/blackfin/mach-bf533/boards/stamp.c +3 -3
@@ -192,7 +192,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { };#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE )/* SPI ADC chip */ static struct bfin5xx_spi_chip spi_adc_chip_info = { .enable_dma = 1, /* use dma transfer with this chip*/
@@ -237,7 +237,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -448,7 +448,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = { .irq = 39, },#endif -#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) +#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) { I2C_BOARD_INFO("pcf8574_lcd", 0x22), },
arch/blackfin/mach-bf537/boards/cm_bf537.c +2 -2
@@ -86,7 +86,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { };#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE )/* SPI ADC chip */ static struct bfin5xx_spi_chip spi_adc_chip_info = { .enable_dma = 1, /* use dma transfer with this chip*/
@@ -129,7 +129,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
arch/blackfin/mach-bf537/boards/pnav10.c +4 -4
@@ -265,8 +265,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { };#endif -#if defined(CONFIG_SPI_ADC_BF533 ) \ - || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) \ + || defined(CONFIG_BFIN_SPI_ADC_MODULE )/* SPI ADC chip */ static struct bfin5xx_spi_chip spi_adc_chip_info = { .enable_dma = 1, /* use dma transfer with this chip*/
@@ -333,8 +333,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) \ - || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) \ + || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
arch/blackfin/mach-bf537/boards/stamp.c +5 -5
@@ -508,8 +508,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { };#endif -#if defined(CONFIG_SPI_ADC_BF533 ) \ - || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) \ + || defined(CONFIG_BFIN_SPI_ADC_MODULE )/* SPI ADC chip */ static struct bfin5xx_spi_chip spi_adc_chip_info = { .enable_dma = 1, /* use dma transfer with this chip*/
@@ -695,8 +695,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { .mode = SPI_MODE_3, },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) \ - || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) \ + || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -1280,7 +1280,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = { .irq = IRQ_PF5, },#endif -#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) +#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) { I2C_BOARD_INFO("pcf8574_lcd", 0x22), },
arch/blackfin/mach-bf537/boards/tcm_bf537.c +2 -2
@@ -86,7 +86,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { };#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE )/* SPI ADC chip */ static struct bfin5xx_spi_chip spi_adc_chip_info = { .enable_dma = 1, /* use dma transfer with this chip*/
@@ -129,7 +129,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
arch/blackfin/mach-bf548/boards/ezkit.c +1 -1
@@ -786,7 +786,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info0[] = { #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ static struct i2c_board_info __initdata bfin_i2c_board_info1[] = { -#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) +#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) { I2C_BOARD_INFO("pcf8574_lcd", 0x22), },
arch/blackfin/mach-bf561/boards/cm_bf561.c +2 -2
@@ -83,7 +83,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { };#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE )/* SPI ADC chip */ static struct bfin5xx_spi_chip spi_adc_chip_info = { .enable_dma = 1, /* use dma transfer with this chip*/
@@ -126,7 +126,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SPI_ADC_BF533 ) || defined(CONFIG_SPI_ADC_BF533_MODULE ) +#if defined(CONFIG_BFIN_SPI_ADC ) || defined(CONFIG_BFIN_SPI_ADC_MODULE ) { .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Signature · 1 line
1.6.3.1
PATCH 36/62 Blackfin: work around anomaly 05000220
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
When possible, work around anomaly 05000220 (external memory is write back cached, but L2 is not cached). If not possible, detect the conditions at build time and reject any qualifying configurations.
--- arch/blackfin/Kconfig | 24 +++++++++++++++------ arch/blackfin/include/asm/cplb.h | 35 ++++++++++++++++-------------- arch/blackfin/mach-common/arch_checks.c | 7 ++++++ 3 files changed, 43 insertions(+), 23 deletions(-)
arch/blackfin/Kconfig +17 -7
@@ -913,7 +913,7 @@ config BFIN_ICACHE_LOCK bool "Enable Instruction Cache Locking" choice - prompt "Policy" + prompt "External memory cache policy" depends on BFIN_DCACHE default BFIN_WB if !SMP default BFIN_WT if SMP
@@ -954,12 +954,22 @@ config BFIN_WT endchoice -config BFIN_L2_CACHEABLE - bool "Cache L2 SRAM" - depends on (BFIN_DCACHE || BFIN_ICACHE) && (BF54x || (BF561 && !SMP)) - default n - help - Select to make L2 SRAM cacheable in L1 data and instruction cache. +choice + prompt "L2 SRAM cache policy" + depends on (BF54x || BF561) + default BFIN_L2_WT +config BFIN_L2_WB + bool "Write back" + depends on !SMP + +config BFIN_L2_WT + bool "Write through" + depends on !SMP + +config BFIN_L2_NOT_CACHED + bool "Not cached" + +endchoice config MPU bool "Enable the memory protection unit (EXPERIMENTAL)"
arch/blackfin/include/asm/cplb.h +19 -16
@@ -53,29 +53,32 @@#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_COMMON)#endif +#define SDRAM_DNON_CHBL (CPLB_COMMON) +#define SDRAM_EBIU (CPLB_COMMON) +#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY) +#define L1_DMEMORY (CPLB_LOCK | CPLB_COMMON)#ifdef CONFIG_SMP -#define L2_ATTR (INITIAL_T | I_CPLB | D_CPLB) -#define L2_IMEMORY (CPLB_COMMON | CPLB_LOCK) -#define L2_DMEMORY (CPLB_COMMON | CPLB_LOCK) +#define L2_ATTR (INITIAL_T | I_CPLB | D_CPLB) +#define L2_IMEMORY (CPLB_COMMON) +#define L2_DMEMORY (CPLB_LOCK | CPLB_COMMON)#else -#ifdef CONFIG_BFIN_L2_CACHEABLE -#define L2_IMEMORY (SDRAM_IGENERIC) -#define L2_DMEMORY (SDRAM_DGENERIC) -#else -#define L2_IMEMORY (CPLB_COMMON) -#define L2_DMEMORY (CPLB_COMMON) -#endif /* CONFIG_BFIN_L2_CACHEABLE */ - -#define L2_ATTR (INITIAL_T | SWITCH_T | I_CPLB | D_CPLB) +#define L2_ATTR (INITIAL_T | SWITCH_T | I_CPLB | D_CPLB) +#define L2_IMEMORY (SDRAM_IGENERIC) + +# if defined(CONFIG_BFIN_L2_WB ) +# define L2_DMEMORY (CPLB_L1_CHBL | CPLB_COMMON) +# elif defined(CONFIG_BFIN_L2_WT ) +# define L2_DMEMORY (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_COMMON) +# elif defined(CONFIG_BFIN_L2_NOT_CACHED ) +# define L2_DMEMORY (CPLB_COMMON) +# else +# define L2_DMEMORY (0) +# endif #endif /* CONFIG_SMP */ -#define SDRAM_DNON_CHBL (CPLB_COMMON) -#define SDRAM_EBIU (CPLB_COMMON) -#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY) -#define SIZE_1K 0x00000400/* 1K */ #define SIZE_4K 0x00001000/* 4K */ #define SIZE_1M 0x00100000/* 1M */
arch/blackfin/mach-common/arch_checks.c +7 -0
@@ -71,3 +71,10 @@#if ANOMALY_05000448 # error You are using a part with anomaly 05000448, this issue causes random memory read/write failures - that means random crashes.#endif + +/* if 220 exists, can not set External Memory WB and L2 not_cached, either External Memory not_cached and L2 WB */ +#if ANOMALY_05000220 && \ + ((defined(CONFIG_BFIN_WB ) && defined(CONFIG_BFIN_L2_NOT_CACHED )) || \ + (!defined(CONFIG_BFIN_DCACHE ) && defined(CONFIG_BFIN_L2_WB ))) +# error You are exposing Anomaly 220 in this config, either config L2 as Write Through, or make External Memory WB. +#endif
Signature · 1 line
1.6.3.1
PATCH 37/62 Blackfin: add note about anomaly 05000242 being worked around
In reply to Mike FrysingerDocument anomaly 05000242 workaround in source code.
--- arch/blackfin/mach-common/clocks-init.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/blackfin/mach-common/clocks-init.c +1 -0
@@ -72,6 +72,7 @@ void init_clocks(void)#endif bfin_write_PLL_LOCKCNT (0x300 );do_sync (); +/* We always write PLL_CTL thus avoiding Anomaly 05000242 */ bfin_write16 (PLL_CTL ,PLL_CTL_VAL ); __asm__ __volatile__("IDLE;" );bfin_write_PLL_DIV (CONFIG_CCLK_ACT_DIV |CONFIG_SCLK_DIV );
Signature · 1 line
1.6.3.1
PATCH 38/62 Blackfin: make deferred hardware errors more exact
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
Hardware errors on the Blackfin architecture are queued by nature of the hardware design. Things that could generate a hardware level queue up at the system interface and might not process until much later, at which point the system would send a notification back to the core.
As such, it is possible for user space code to do something that would trigger a hardware error, but have it delay long enough for the process context to switch. So when the hardware error does signal, we mistakenly evaluate it as a different process or as kernel context and panic (erp!). This makes it pretty difficult to find the offending context. But wait, there is good news somewhere.
By forcing a SSYNC in the interrupt entry, we force all pending queues at the system level to be processed and all hardware errors to be signaled. Then we check the current interrupt state to see if the hardware error is now signaled. If so, we re-queue the current interrupt and return thus allowing the higher priority hardware error interrupt to process properly. Since we haven't done any other context processing yet, the right context will be selected and killed. There is still the possibility that the exact offending instruction will be unknown, but at least we'll have a much better idea of where to look.
The downside of course is that this causes system-wide syncs at every interrupt point which results in significant performance degradation. Since this situation should not occur in any properly configured system (as hardware errors are triggered by things like bad pointers), make it a debug configuration option and disable it by default.
--- arch/blackfin/Kconfig.debug | 13 +++++ arch/blackfin/include/asm/entry.h | 92 +++++++++++++++++++++++++++++++- arch/blackfin/mach-common/entry.S | 59 +++++++++++++++------ arch/blackfin/mach-common/interrupt.S | 27 ++++++++++ 4 files changed, 170 insertions(+), 21 deletions(-)
arch/blackfin/Kconfig.debug +13 -0
@@ -54,6 +54,19 @@ config DEBUG_HWERR hardware error interrupts and need to know where they are coming from. +config EXACT_HWERR + bool "Try to make Hardware errors exact" + depends on DEBUG_HWERR + help + By default, the Blackfin hardware errors are not exact - the error + be reported multiple cycles after the error happens. This delay + can cause the wrong application, or even the kernel to receive a + signal to be killed. If you are getting HW errors in your system, + try turning this on to ensure they are at least comming from the + proper thread. + + On production systems, it is safe (and a small optimization) to say N. + config DEBUG_DOUBLEFAULT bool "Debug Double Faults" default n
arch/blackfin/include/asm/entry.h +89 -3
116 lines not on this page · raw message
arch/blackfin/mach-common/entry.S +41 -18
124 lines not on this page · raw message
arch/blackfin/mach-common/interrupt.S +27 -0
@@ -145,6 +145,14 @@ __common_int_entry: /* interrupt routine for ivhw - 5 */ ENTRY(_evt_ivhw) + /* In case a single action kicks off multiple memory transactions, (like + * a cache line fetch, - this can cause multiple hardware errors, let's + * catch them all. First - make sure all the actions are complete, and + * the core sees the hardware errors. + */ + SSYNC; + SSYNC; + SAVE_ALL_SYS #ifdef CONFIG_FRAME_POINTER fp = 0;
@@ -159,6 +167,25 @@ ENTRY(_evt_ivhw) 1: #endif + /* Handle all stacked hardware errors + * To make sure we don't hang forever, only do it 10 times + */ + R0 = 0; + R2 = 10; +1: + P0.L = LO(ILAT); + P0.H = HI(ILAT); + R1 = [P0]; + CC = BITTST(R1, EVT_IVHW_P); + IF ! CC JUMP 2f; + /* OK a hardware error is pending - clear it */ + R1 = EVT_IVHW_P; + [P0] = R1; + R0 += 1; + CC = R1 == R2; + if CC JUMP 2f; + JUMP 1b; +2: # We are going to dump something out, so make sure we print IPEND properly p2.l = lo(IPEND); p2.h = hi(IPEND);
Signature · 1 line
1.6.3.1
PATCH 39/62 Blackfin: make sure stack is accessible before dumping it
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
When displaying a crash dump, make sure accessing the stack is safe so we don't crash at the same time.
--- arch/blackfin/kernel/traps.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
arch/blackfin/kernel/traps.c +11 -0
@@ -196,6 +196,11 @@ done: asmlinkage void double_fault_c(struct pt_regs *fp) { +#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON +int j; +trace_buffer_save (j); +#endif +console_verbose (); oops_in_progress =1 ;#ifdef CONFIG_DEBUG_VERBOSE
@@ -220,6 +225,7 @@ asmlinkage void double_fault_c(struct pt_regs *fp)dump_bfin_process (fp);dump_bfin_mem (fp);show_regs (fp); + dump_bfin_trace_buffer(); }#endif panic ("Double Fault - unrecoverable event" );
@@ -832,6 +838,11 @@ void show_stack(struct task_struct *task, unsigned long *stack)decode_address (buf, (unsigned int )stack);printk (KERN_NOTICE " SP: [0x%p] %s\n" , stack, buf); +if (!access_ok (VERIFY_READ , stack, (unsigned int )endstack - (unsigned int )stack)) { +printk (KERN_NOTICE "Invalid stack pointer\n" ); +return ; + } +/* First thing is to look for a frame pointer */ for (addr = (unsigned int *)((unsigned int )stack & ~0xF ); addr < endstack; addr++) {if (*addr &0x1 )
Signature · 1 line
1.6.3.1
PATCH 40/62 Blackfin: add workaround for anomaly 05000461
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
Returning too fast with a bad RETI can trigger false errors.
--- arch/blackfin/kernel/traps.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/blackfin/kernel/traps.c +3 -0
@@ -594,6 +594,9 @@ asmlinkage void trap_c(struct pt_regs *fp)force_sig_info (sig, &info, current); } +if (ANOMALY_05000461 && trapnr ==VEC_HWERR && !access_ok (VERIFY_READ , fp->pc,8 )) + fp->pc =SAFE_USER_INSTRUCTION ; +trace_buffer_restore (j);return ; }
Signature · 1 line
1.6.3.1
PATCH 41/62 Blackfin: include system/processor info in dump messages
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
People often copy & paste crash messages without surrounding context, so include common useful information like system/processor stats in the crash summary. This should smooth over the report/test cycle a bit more.
--- arch/blackfin/kernel/traps.c | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-)
arch/blackfin/kernel/traps.c +26 -0
@@ -32,6 +32,8 @@#include <linux/module.h> #include <linux/kallsyms.h> #include <linux/fs.h> +#include <linux/compile.h> +#include <linux/utsname.h> #include <linux/rbtree.h> #include <asm/traps.h> #include <asm/cacheflush.h>
@@ -1080,6 +1082,30 @@ void show_regs(struct pt_regs *fp)unsigned int cpu =smp_processor_id ();unsigned char in_atomic = (bfin_read_IPEND () &0x10 ) ||in_atomic (); +verbose_printk (KERN_NOTICE "\n" ); +if (CPUID !=bfin_cpuid ()) +verbose_printk (KERN_NOTICE "Compiled for cpu family 0x%04x (Rev %d), " +"but running on:0x%04x (Rev %d)\n" , +CPUID ,bfin_compiled_revid (),bfin_cpuid (),bfin_revid ()); + +verbose_printk (KERN_NOTICE "ADSP-%s-0.%d" , +CPU ,bfin_compiled_revid ()); + +if (bfin_compiled_revid () !=bfin_revid ()) +verbose_printk ("(Detected 0.%d)" ,bfin_revid ()); + +verbose_printk (" %lu(MHz CCLK) %lu(MHz SCLK) (%s)\n" , +get_cclk ()/1000000 ,get_sclk ()/1000000 , +#ifdef CONFIG_MPU + "mpu on" +#else +"mpu off" +#endif + ); + +verbose_printk (KERN_NOTICE "%s version %s\n" KERN_NOTICE "Built with %s\n" , +utsname ()->sysname,utsname ()->release,LINUX_COMPILER ); +verbose_printk (KERN_NOTICE "\n" KERN_NOTICE "SEQUENCER STATUS:\t\t%s\n" ,print_tainted ());verbose_printk (KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n" , (long )fp->seqstat, fp->ipend, fp->syscfg);
Signature · 1 line
1.6.3.1
PATCH 42/62 Blackfin: update gptimers API
In reply to Mike FrysingerFrom: Michael Hennerich <[email protected]>
First we fix the prototypes for functions that return boolean values by using "int" rather than "uint16_t". Then we introduce a get_gptimer_run() function for checking the current run status of a timer, and then we add a disable_gptimers_sync() function which parallels disable_gptimers() with corresponding normal "_sync" behavior.
--- arch/blackfin/include/asm/gptimers.h | 43 +++++++++++++++++++--------------- arch/blackfin/kernel/gptimers.c | 30 +++++++++++++++++++---- 2 files changed, 49 insertions(+), 24 deletions(-)
arch/blackfin/include/asm/gptimers.h +24 -19
@@ -30,6 +30,7 @@# else # define MAX_BLACKFIN_GPTIMERS 11# define TIMER8_GROUP_REG TIMER_ENABLE1 +# define TIMER_GROUP2 1# endif # define TIMER0_GROUP_REG TIMER_ENABLE0#endif
@@ -40,10 +41,12 @@# define MAX_BLACKFIN_GPTIMERS 12# define TIMER0_GROUP_REG TMRS8_ENABLE# define TIMER8_GROUP_REG TMRS4_ENABLE +# define TIMER_GROUP2 1#endif /* * All others: 3 timers: */ +#define TIMER_GROUP1 0#if !defined(MAX_BLACKFIN_GPTIMERS )# define MAX_BLACKFIN_GPTIMERS 3# define TIMER0_GROUP_REG TIMER_ENABLE
@@ -109,8 +112,8 @@#define TIMER_ERR_PROG_PER 0x8000#define TIMER_ERR_PROG_PW 0xC000#define TIMER_EMU_RUN 0x0200 -#define TIMER_TOGGLE_HI 0x0100 -#define TIMER_CLK_SEL 0x0080 +#define TIMER_TOGGLE_HI 0x0100 +#define TIMER_CLK_SEL 0x0080#define TIMER_OUT_DIS 0x0040#define TIMER_TIN_SEL 0x0020#define TIMER_IRQ_ENA 0x0010
@@ -169,23 +172,25 @@/* The actual gptimer API */ -void set_gptimer_pwidth (int timer_id,uint32_t width); -uint32_t get_gptimer_pwidth (int timer_id); -void set_gptimer_period (int timer_id,uint32_t period); -uint32_t get_gptimer_period (int timer_id); -uint32_t get_gptimer_count (int timer_id); -uint16_t get_gptimer_intr (int timer_id); -void clear_gptimer_intr (int timer_id); -uint16_t get_gptimer_over (int timer_id); -void clear_gptimer_over (int timer_id); -void set_gptimer_config (int timer_id,uint16_t config); -uint16_t get_gptimer_config (int timer_id); -void set_gptimer_pulse_hi (int timer_id); +void set_gptimer_pwidth (int timer_id,uint32_t width); +uint32_t get_gptimer_pwidth (int timer_id); +void set_gptimer_period (int timer_id,uint32_t period); +uint32_t get_gptimer_period (int timer_id); +uint32_t get_gptimer_count (int timer_id); +int get_gptimer_intr (int timer_id); +void clear_gptimer_intr (int timer_id); +int get_gptimer_over (int timer_id); +void clear_gptimer_over (int timer_id); +void set_gptimer_config (int timer_id,uint16_t config); +uint16_t get_gptimer_config (int timer_id); +int get_gptimer_run (int timer_id); +void set_gptimer_pulse_hi (int timer_id);void clear_gptimer_pulse_hi (int timer_id); -void enable_gptimers (uint16_t mask); -void disable_gptimers (uint16_t mask); -uint16_t get_enabled_gptimers (void ); -uint32_t get_gptimer_status (int group); -void set_gptimer_status (int group,uint32_t value); +void enable_gptimers (uint16_t mask); +void disable_gptimers (uint16_t mask); +void disable_gptimers_sync (uint16_t mask); +uint16_t get_enabled_gptimers (void ); +uint32_t get_gptimer_status (int group); +void set_gptimer_status (int group,uint32_t value);#endif
arch/blackfin/kernel/gptimers.c +25 -5
@@ -189,10 +189,10 @@ void set_gptimer_status(int group, uint32_t value) }EXPORT_SYMBOL (set_gptimer_status); -uint16_t get_gptimer_intr (int timer_id) +int get_gptimer_intr (int timer_id) {tassert (timer_id <MAX_BLACKFIN_GPTIMERS ); -return (group_regs[BFIN_TIMER_OCTET (timer_id)]->status & timil_mask[timer_id]) ?1 :0 ; +return !!(group_regs[BFIN_TIMER_OCTET (timer_id)]->status & timil_mask[timer_id]); }EXPORT_SYMBOL (get_gptimer_intr);
@@ -203,10 +203,10 @@ void clear_gptimer_intr(int timer_id) }EXPORT_SYMBOL (clear_gptimer_intr); -uint16_t get_gptimer_over (int timer_id) +int get_gptimer_over (int timer_id) {tassert (timer_id <MAX_BLACKFIN_GPTIMERS ); -return (group_regs[BFIN_TIMER_OCTET (timer_id)]->status & tovf_mask[timer_id]) ?1 :0 ; +return !!(group_regs[BFIN_TIMER_OCTET (timer_id)]->status & tovf_mask[timer_id]); }EXPORT_SYMBOL (get_gptimer_over);
@@ -217,6 +217,13 @@ void clear_gptimer_over(int timer_id) }EXPORT_SYMBOL (clear_gptimer_over); +int get_gptimer_run (int timer_id) +{ +tassert (timer_id <MAX_BLACKFIN_GPTIMERS ); +return !!(group_regs[BFIN_TIMER_OCTET (timer_id)]->status & trun_mask[timer_id]); +} +EXPORT_SYMBOL (get_gptimer_run); +void set_gptimer_config (int timer_id,uint16_t config) {tassert (timer_id <MAX_BLACKFIN_GPTIMERS );
@@ -244,7 +251,7 @@ void enable_gptimers(uint16_t mask) }EXPORT_SYMBOL (enable_gptimers); -void disable_gptimers (uint16_t mask) +static void _disable_gptimers (uint16_t mask) {int i;uint16_t m = mask;
@@ -253,6 +260,12 @@ void disable_gptimers(uint16_t mask) group_regs[i]->disable = m &0xFF ; m >>=8 ; } +} + +void disable_gptimers (uint16_t mask) +{ +int i; +_disable_gptimers (mask);for (i =0 ; i <MAX_BLACKFIN_GPTIMERS ; ++i)if (mask & (1 << i)) group_regs[BFIN_TIMER_OCTET (i)]->status |= trun_mask[i];
@@ -260,6 +273,13 @@ void disable_gptimers(uint16_t mask) }EXPORT_SYMBOL (disable_gptimers); +void disable_gptimers_sync (uint16_t mask) +{ +_disable_gptimers (mask); +SSYNC (); +} +EXPORT_SYMBOL (disable_gptimers_sync); +void set_gptimer_pulse_hi (int timer_id) {tassert (timer_id <MAX_BLACKFIN_GPTIMERS );
Signature · 1 line
1.6.3.1
PATCH 43/62 Blackfin: drop unused reserve_pda() function
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
The Per-processor Data Area isn't actually reserved by this function, and all it ended up doing was issuing a printk(), so punt it.
--- arch/blackfin/include/asm/pda.h | 2 -- arch/blackfin/mach-common/smp.c | 3 --- arch/blackfin/mm/init.c | 10 ---------- 3 files changed, 0 insertions(+), 15 deletions(-)
arch/blackfin/include/asm/pda.h +0 -2
@@ -64,8 +64,6 @@ struct blackfin_pda { /* Per-processor Data Area */extern struct blackfin_pda cpu_pda[]; -void reserve_pda (void ); -#endif /* __ASSEMBLY__ */ #endif /* _ASM_BLACKFIN_PDA_H */
arch/blackfin/mach-common/smp.c +0 -3
@@ -369,9 +369,6 @@ static void __cpuinit setup_secondary(unsigned int cpu)bfin_write_ILAT (ilat);CSYNC (); -/* Reserve the PDA space for the secondary CPU. */ -reserve_pda (); -/* Enable interrupt levels IVG7-15. IARs have been already * programmed by the boot CPU. */ bfin_irq_flags |= IMASK_IVG15 |
arch/blackfin/mm/init.c +0 -10
@@ -134,12 +134,6 @@ asmlinkage void __init init_pda(void)#endif } -void __cpuinit reserve_pda (void ) -{ -printk (KERN_INFO "PDA for CPU%u reserved at %p\n" ,smp_processor_id (), - &cpu_pda[smp_processor_id ()]); -} -void __init mem_init (void ) {unsigned int codek =0 , datak =0 , initk =0 ;
@@ -186,10 +180,6 @@ static int __init sram_init(void)/* Initialize the blackfin L1 Memory. */ bfin_sram_init (); -/* Reserve the PDA space for the boot CPU right after we -* initialized the scratch memory allocator. -*/ -reserve_pda ();return 0 ; }pure_initcall (sram_init);
Signature · 1 line
1.6.3.1
PATCH 44/62 Blackfin: merge sram init functions
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
Now that the sram_init() function exists only to call the bfin_sram_init() after the punting of the reserve_pda() function, simply merge the two to avoid pointless overhead.
--- arch/blackfin/mm/blackfin_sram.h | 1 - arch/blackfin/mm/init.c | 9 --------- arch/blackfin/mm/sram-alloc.c | 5 ++++- 3 files changed, 4 insertions(+), 11 deletions(-)
arch/blackfin/mm/blackfin_sram.h +0 -1
@@ -30,7 +30,6 @@#ifndef __BLACKFIN_SRAM_H__#define __BLACKFIN_SRAM_H__ -extern void bfin_sram_init (void );extern void *l1sram_alloc (size_t );#endif
arch/blackfin/mm/init.c +0 -9
@@ -175,15 +175,6 @@ void __init mem_init(void) initk, codek, datak, DMA_UNCACHED_REGION >> 10, (reservedpages << (PAGE_SHIFT-10))); } -static int __init sram_init (void ) -{ -/* Initialize the blackfin L1 Memory. */ -bfin_sram_init (); - -return 0 ; -} -pure_initcall (sram_init); -static void __init free_init_pages (const char *what,unsigned long begin,unsigned long end) {unsigned long addr;
arch/blackfin/mm/sram-alloc.c +4 -1
@@ -223,7 +223,7 @@ static void __init l2_sram_init(void)spin_lock_init (&l2_sram_lock); } -void __init bfin_sram_init (void ) +static int __init bfin_sram_init (void ) { sram_piece_cache = kmem_cache_create("sram_piece_cache", sizeof(struct sram_piece),
@@ -233,7 +233,10 @@ void __init bfin_sram_init(void)l1_data_sram_init ();l1_inst_sram_init ();l2_sram_init (); + +return 0 ; } +pure_initcall (bfin_sram_init);/* SRAM allocate function */ static void *_sram_alloc(size_t size, struct sram_piece *pfree_head,
Signature · 1 line
1.6.3.1
PATCH 45/62 Blackfin: fix handling of initial L1 reservation
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
This restores some L1 reservation logic that was lost during the Blackfin SMP merge.
--- arch/blackfin/mm/sram-alloc.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-)
arch/blackfin/mm/sram-alloc.c +10 -2
@@ -83,6 +83,14 @@ static struct kmem_cache *sram_piece_cache;static void __init l1sram_init (void ) {unsigned int cpu; +unsigned long reserve; + +#ifdef CONFIG_SMP + reserve =0 ; +#else + reserve =sizeof (struct l1_scratch_task_info ); +#endif +for (cpu =0 ; cpu <num_possible_cpus (); ++cpu) {per_cpu (free_l1_ssram_head, cpu).next =kmem_cache_alloc (sram_piece_cache,GFP_KERNEL );
@@ -91,8 +99,8 @@ static void __init l1sram_init(void)return ; } -per_cpu (free_l1_ssram_head, cpu).next->paddr = (void *)get_l1_scratch_start_cpu (cpu); -per_cpu (free_l1_ssram_head, cpu).next->size =L1_SCRATCH_LENGTH ; +per_cpu (free_l1_ssram_head, cpu).next->paddr = (void *)get_l1_scratch_start_cpu (cpu) + reserve; +per_cpu (free_l1_ssram_head, cpu).next->size =L1_SCRATCH_LENGTH - reserve;per_cpu (free_l1_ssram_head, cpu).next->pid =0 ;per_cpu (free_l1_ssram_head, cpu).next->next =NULL ;
Signature · 1 line
1.6.3.1
PATCH 46/62 Blackfin: fix command line corruption with DEBUG_DOUBLEFAULT
In reply to Mike FrysingerCommit 6b3087c6 (which introduced Blackfin SMP) broke command line passing when the DEBUG_DOUBLEFAULT config option was enabled. Switch the code to using a scratch register and not R7 which holds the command line.
--- arch/blackfin/mach-common/head.S | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
arch/blackfin/mach-common/head.S +8 -8
@@ -124,25 +124,25 @@ ENTRY(__start) * below */ GET_PDA(p0, r0); - r7 = [p0 + PDA_RETX]; + r6 = [p0 + PDA_RETX]; p1.l = _init_saved_retx; p1.h = _init_saved_retx; - [p1] = r7; + [p1] = r6; - r7 = [p0 + PDA_DCPLB]; + r6 = [p0 + PDA_DCPLB]; p1.l = _init_saved_dcplb_fault_addr; p1.h = _init_saved_dcplb_fault_addr; - [p1] = r7; + [p1] = r6; - r7 = [p0 + PDA_ICPLB]; + r6 = [p0 + PDA_ICPLB]; p1.l = _init_saved_icplb_fault_addr; p1.h = _init_saved_icplb_fault_addr; - [p1] = r7; + [p1] = r6; - r7 = [p0 + PDA_SEQSTAT]; + r6 = [p0 + PDA_SEQSTAT]; p1.l = _init_saved_seqstat; p1.h = _init_saved_seqstat; - [p1] = r7; + [p1] = r6; #endif /* Initialize stack pointer */
Signature · 1 line
1.6.3.1
PATCH 47/62 Blackfin: override default uClinux MTD addr/size
In reply to Mike FrysingerDue to a processor anomaly (05000263 to be exact), most Blackfin parts cannot keep the embedded filesystem image directly after the kernel in RAM. Instead, the filesystem needs to be relocated to the end of memory. As such, we need to tweak the map addr/size during boot for Blackfin systems.
--- arch/blackfin/kernel/setup.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
arch/blackfin/kernel/setup.c +7 -4
@@ -18,9 +18,12 @@#include <linux/tty.h> #include <linux/pfn.h> +#ifdef CONFIG_MTD_UCLINUX +#include <linux/mtd/map.h> #include <linux/ext2_fs.h> #include <linux/cramfs_fs.h> #include <linux/romfs_fs.h> +#endif #include <asm/cplb.h> #include <asm/cacheflush.h>
@@ -45,6 +48,7 @@ EXPORT_SYMBOL(_ramend);EXPORT_SYMBOL (reserved_mem_dcache_on);#ifdef CONFIG_MTD_UCLINUX +extern struct map_info uclinux_ram_map;unsigned long memory_mtd_end, memory_mtd_start, mtd_size;unsigned long _ebss;EXPORT_SYMBOL (memory_mtd_end);
@@ -535,10 +539,9 @@ static __init void memory_setup(void) }/* Relocate MTD image to the top of memory after the uncached memory area */ -dma_memcpy ((char *)memory_end, _end, mtd_size); - - memory_mtd_start = memory_end; - _ebss = memory_mtd_start;/* define _ebss for compatible */ + uclinux_ram_map.phys = memory_mtd_start = memory_end; + uclinux_ram_map.size = mtd_size; +dma_memcpy ((void *)uclinux_ram_map.phys, _end, uclinux_ram_map.size);#endif /* CONFIG_MTD_UCLINUX */ #if (defined(CONFIG_BFIN_ICACHE ) &&ANOMALY_05000263 )
Signature · 1 line
1.6.3.1
PATCH 48/62 Blackfin: bf548-ezkit: add resources for ADXL345/346
In reply to Mike FrysingerFrom: Michael Hennerich <[email protected]>
--- arch/blackfin/mach-bf548/boards/ezkit.c | 83 +++++++++++++++++++++++++++---- 1 files changed, 73 insertions(+), 10 deletions(-)
arch/blackfin/mach-bf548/boards/ezkit.c +73 -10
@@ -208,6 +208,43 @@ static struct platform_device bfin_rotary_device = { };#endif +#if defined(CONFIG_INPUT_ADXL34X ) || defined(CONFIG_INPUT_ADXL34X_MODULE ) +#include <linux/input.h> +#include <linux/spi/adxl34x.h> +static const struct adxl34x_platform_data adxl34x_info = { + .x_axis_offset =0 , + .y_axis_offset =0 , + .z_axis_offset =0 , + .tap_threshold =0x31 , + .tap_duration =0x10 , + .tap_latency =0x60 , + .tap_window =0xF0 , + .tap_axis_control =ADXL_TAP_X_EN |ADXL_TAP_Y_EN |ADXL_TAP_Z_EN , + .act_axis_control =0xFF , + .activity_threshold =5 , + .inactivity_threshold =3 , + .inactivity_time =4 , + .free_fall_threshold =0x7 , + .free_fall_time =0x20 , + .data_rate =0x8 , + .data_range =ADXL_FULL_RES , + + .ev_type =EV_ABS , + .ev_code_x =ABS_X ,/* EV_REL */ + .ev_code_y =ABS_Y ,/* EV_REL */ + .ev_code_z =ABS_Z ,/* EV_REL */ + + .ev_code_tap_x =BTN_TOUCH ,/* EV_KEY */ + .ev_code_tap_y =BTN_TOUCH ,/* EV_KEY */ + .ev_code_tap_z =BTN_TOUCH ,/* EV_KEY */ + +/* .ev_code_ff = KEY_F,*/ /* EV_KEY */ +/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */ + .power_mode =ADXL_AUTO_SLEEP |ADXL_LINK , + .fifo_mode =ADXL_FIFO_STREAM , +}; +#endif +#if defined(CONFIG_RTC_DRV_BFIN ) || defined(CONFIG_RTC_DRV_BFIN_MODULE )static struct platform_device rtc_device = { .name = "rtc-bfin",
@@ -628,6 +665,14 @@ static struct bfin5xx_spi_chip spidev_chip_info = { };#endif +#if defined(CONFIG_INPUT_ADXL34X_SPI ) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE ) +static struct bfin5xx_spi_chip spi_adxl34x_chip_info = { + .enable_dma =0 ,/* use dma transfer with this chip*/ + .bits_per_word =8 , + .cs_change_per_word =0 , +}; +#endif + static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_MTD_M25P80 ) \ || defined(CONFIG_MTD_M25P80_MODULE )
@@ -653,15 +698,15 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) -{ - .modalias = "ad7877", - .platform_data = &bfin_ad7877_ts_info, - .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */ - .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ - .bus_num = 0, - .chip_select = 2, - .controller_data = &spi_ad7877_chip_info, -}, + { + .modalias = "ad7877", + .platform_data = &bfin_ad7877_ts_info, + .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */ + .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ + .bus_num = 0, + .chip_select = 2, + .controller_data = &spi_ad7877_chip_info, + }, #endif #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) {
@@ -672,8 +717,19 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { .controller_data = &spidev_chip_info, },#endif +#if defined(CONFIG_INPUT_ADXL34X_SPI ) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE ) + { + .modalias = "adxl34x", + .platform_data = &adxl34x_info, + .irq = IRQ_PC5, + .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ + .bus_num = 1, + .chip_select = 2, + .controller_data = &spi_adxl34x_chip_info, + .mode = SPI_MODE_3, + }, +#endif }; -#if defined(CONFIG_SPI_BFIN ) || defined(CONFIG_SPI_BFIN_MODULE )/* SPI (0) */ static struct resource bfin_spi0_resource[] = {
@@ -797,6 +853,13 @@ static struct i2c_board_info __initdata bfin_i2c_board_info1[] = { .irq = 212, }, #endif +#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE) + { + I2C_BOARD_INFO("adxl34x", 0x53), + .irq = IRQ_PC5, + .platform_data = (void *)&adxl34x_info, + }, +#endif }; #endif
Signature · 1 line
1.6.3.1
PATCH 49/62 Blackfin: convert SMP to only use generic time framework
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
--- arch/blackfin/Kconfig | 1 + arch/blackfin/kernel/time.c | 53 +++++++++++++++--------------------------- 2 files changed, 20 insertions(+), 34 deletions(-)
arch/blackfin/Kconfig +1 -0
@@ -223,6 +223,7 @@ endchoice config SMP depends on BF561 + select GENERIC_TIME bool "Symmetric multi-processing support" ---help--- This enables support for systems with more than one CPU,
arch/blackfin/kernel/time.c +19 -34
83 lines not on this page · raw message
Signature · 1 line
1.6.3.1
PATCH 50/62 Blackfin: add SSYNC to set_dma_sg() for descriptor fetching
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
Make sure the internal core buffers are flushed before telling the DMA engine to fetch the descriptor structure so that it gets the right values.
--- arch/blackfin/include/asm/dma.h | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
arch/blackfin/include/asm/dma.h +7 -1
@@ -206,10 +206,16 @@ static inline unsigned long get_dma_curr_addr(unsigned int channel)static inline void set_dma_sg (unsigned int channel,struct dmasg *sg,int ndsize) { +/* Make sure the internal data buffers in the core are drained +* so that the DMA descriptors are completely written when the +* DMA engine goes to fetch them below. +*/ +SSYNC (); + + dma_ch[channel].regs->next_desc_ptr = sg; dma_ch[channel].regs->cfg = (dma_ch[channel].regs->cfg & ~(0xf <<8 )) | ((ndsize &0xf ) <<8 ); - dma_ch[channel].regs->next_desc_ptr = sg; }static inline int dma_channel_active (unsigned int channel)
Signature · 1 line
1.6.3.1
PATCH 51/62 Blackfin: check SIC defines rather than variant names
In reply to Mike FrysingerRather than having to maintain a hard coded list of Blackfin variants, use the SIC defines themselves. This fixes build problems on BF51x/BF538 under some configurations as they were missing from one of the lists.
--- arch/blackfin/mach-common/ints-priority.c | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-)
arch/blackfin/mach-common/ints-priority.c +8 -9
@@ -1152,23 +1152,22 @@ void do_irq(int vec, struct pt_regs *fp) }else {struct ivgx *ivg = ivg7_13[vec -IVG7 ].ifirst;struct ivgx *ivg_stop = ivg7_13[vec -IVG7 ].istop; -#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561 ) \ - || defined(BF538_FAMILY ) || defined(CONFIG_BF51x) +#if defined(SIC_ISR0 ) || defined(SICA_ISR0 )unsigned long sic_status[3 ];if (smp_processor_id ()) { -#ifdef CONFIG_SMP +# ifdef SICB_ISR0 /* This will be optimized out in UP mode. */ sic_status[0 ] =bfin_read_SICB_ISR0 () &bfin_read_SICB_IMASK0 (); sic_status[1 ] =bfin_read_SICB_ISR1 () &bfin_read_SICB_IMASK1 (); -#endif +# endif }else { sic_status[0 ] =bfin_read_SIC_ISR0 () &bfin_read_SIC_IMASK0 (); sic_status[1 ] =bfin_read_SIC_ISR1 () &bfin_read_SIC_IMASK1 (); } -#ifdef CONFIG_BF54x +# ifdef SIC_ISR2 sic_status[2 ] =bfin_read_SIC_ISR2 () &bfin_read_SIC_IMASK2 (); -#endif +# endif for (;; ivg++) {if (ivg >= ivg_stop) {atomic_inc (&num_spurious);
@@ -1234,14 +1233,14 @@ asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs) irq =IRQ_CORETMR ; }else { -#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561 ) +#if defined(SIC_ISR0 ) || defined(SICA_ISR0 )unsigned long sic_status[3 ]; sic_status[0 ] =bfin_read_SIC_ISR0 () &bfin_read_SIC_IMASK0 (); sic_status[1 ] =bfin_read_SIC_ISR1 () &bfin_read_SIC_IMASK1 (); -#ifdef CONFIG_BF54x +# ifdef SIC_ISR2 sic_status[2 ] =bfin_read_SIC_ISR2 () &bfin_read_SIC_IMASK2 (); -#endif +# endif for (;; ivg++) {if (ivg >= ivg_stop) {atomic_inc (&num_spurious);
Signature · 1 line
1.6.3.1
PATCH 52/62 Blackfin: rename Blackfin relocs according to the toolchain
In reply to Mike FrysingerThe latest Blackfin toolchain has fixed its relocation scheme to match other ports: always use R_BFIN_ prefix and capitalize everything. This brings the kernel in line with those fixes.
--- arch/blackfin/include/asm/elf.h | 84 +++++++++++++++++++------------------- arch/blackfin/kernel/module.c | 22 +++++----- 2 files changed, 53 insertions(+), 53 deletions(-)
arch/blackfin/include/asm/elf.h +42 -42
@@ -55,50 +55,50 @@ do { \#define ELF_FDPIC_CORE_EFLAGS EF_BFIN_FDPIC#define ELF_EXEC_PAGESIZE 4096 -#define R_unused0 0/* relocation type 0 is not defined */ -#define R_pcrel5m2 1/*LSETUP part a */ -#define R_unused1 2/* relocation type 2 is not defined */ -#define R_pcrel10 3/* type 3, if cc jump <target> */ -#define R_pcrel12_jump 4/* type 4, jump <target> */ -#define R_rimm16 5/* type 0x5, rN = <target> */ -#define R_luimm16 6/* # 0x6, preg.l=<target> Load imm 16 to lower half */ -#define R_huimm16 7/* # 0x7, preg.h=<target> Load imm 16 to upper half */ -#define R_pcrel12_jump_s 8/* # 0x8 jump.s <target> */ -#define R_pcrel24_jump_x 9/* # 0x9 jump.x <target> */ -#define R_pcrel24 10/* # 0xa call <target> , not expandable */ -#define R_unusedb 11/* # 0xb not generated */ -#define R_unusedc 12/* # 0xc not used */ -#define R_pcrel24_jump_l 13/*0xd jump.l <target> */ -#define R_pcrel24_call_x 14/* 0xE, call.x <target> if <target> is above 24 bit limit call through P1 */ -#define R_var_eq_symb 15/* 0xf, linker should treat it same as 0x12 */ -#define R_byte_data 16/* 0x10, .byte var = symbol */ -#define R_byte2_data 17/* 0x11, .byte2 var = symbol */ -#define R_byte4_data 18/* 0x12, .byte4 var = symbol and .var var=symbol */ -#define R_pcrel11 19/* 0x13, lsetup part b */ -#define R_unused14 20/* 0x14, undefined */ -#define R_unused15 21/* not generated by VDSP 3.5 */ +#define R_BFIN_UNUSED0 0/* relocation type 0 is not defined */ +#define R_BFIN_PCREL5M2 1/* LSETUP part a */ +#define R_BFIN_UNUSED1 2/* relocation type 2 is not defined */ +#define R_BFIN_PCREL10 3/* type 3, if cc jump <target> */ +#define R_BFIN_PCREL12_JUMP 4/* type 4, jump <target> */ +#define R_BFIN_RIMM16 5/* type 0x5, rN = <target> */ +#define R_BFIN_LUIMM16 6/* # 0x6, preg.l=<target> Load imm 16 to lower half */ +#define R_BFIN_HUIMM16 7/* # 0x7, preg.h=<target> Load imm 16 to upper half */ +#define R_BFIN_PCREL12_JUMP_S 8/* # 0x8 jump.s <target> */ +#define R_BFIN_PCREL24_JUMP_X 9/* # 0x9 jump.x <target> */ +#define R_BFIN_PCREL24 10/* # 0xa call <target> , not expandable */ +#define R_BFIN_UNUSEDB 11/* # 0xb not generated */ +#define R_BFIN_UNUSEDC 12/* # 0xc not used */ +#define R_BFIN_PCREL24_JUMP_L 13/* 0xd jump.l <target> */ +#define R_BFIN_PCREL24_CALL_X 14/* 0xE, call.x <target> if <target> is above 24 bit limit call through P1 */ +#define R_BFIN_VAR_EQ_SYMB 15/* 0xf, linker should treat it same as 0x12 */ +#define R_BFIN_BYTE_DATA 16/* 0x10, .byte var = symbol */ +#define R_BFIN_BYTE2_DATA 17/* 0x11, .byte2 var = symbol */ +#define R_BFIN_BYTE4_DATA 18/* 0x12, .byte4 var = symbol and .var var=symbol */ +#define R_BFIN_PCREL11 19/* 0x13, lsetup part b */ +#define R_BFIN_UNUSED14 20/* 0x14, undefined */ +#define R_BFIN_UNUSED15 21/* not generated by VDSP 3.5 */ /* arithmetic relocations */ -#define R_push 0xE0 -#define R_const 0xE1 -#define R_add 0xE2 -#define R_sub 0xE3 -#define R_mult 0xE4 -#define R_div 0xE5 -#define R_mod 0xE6 -#define R_lshift 0xE7 -#define R_rshift 0xE8 -#define R_and 0xE9 -#define R_or 0xEA -#define R_xor 0xEB -#define R_land 0xEC -#define R_lor 0xED -#define R_len 0xEE -#define R_neg 0xEF -#define R_comp 0xF0 -#define R_page 0xF1 -#define R_hwpage 0xF2 -#define R_addr 0xF3 +#define R_BFIN_PUSH 0xE0 +#define R_BFIN_CONST 0xE1 +#define R_BFIN_ADD 0xE2 +#define R_BFIN_SUB 0xE3 +#define R_BFIN_MULT 0xE4 +#define R_BFIN_DIV 0xE5 +#define R_BFIN_MOD 0xE6 +#define R_BFIN_LSHIFT 0xE7 +#define R_BFIN_RSHIFT 0xE8 +#define R_BFIN_AND 0xE9 +#define R_BFIN_OR 0xEA +#define R_BFIN_XOR 0xEB +#define R_BFIN_LAND 0xEC +#define R_BFIN_LOR 0xED +#define R_BFIN_LEN 0xEE +#define R_BFIN_NEG 0xEF +#define R_BFIN_COMP 0xF0 +#define R_BFIN_PAGE 0xF1 +#define R_BFIN_HWPAGE 0xF2 +#define R_BFIN_ADDR 0xF3/* This is the location that an ET_DYN program is loaded if exec'ed. Typical use of this is to invoke "./ld.so someprog" to test out a new version of
arch/blackfin/kernel/module.c +11 -11
@@ -201,8 +201,8 @@ apply_relocate(Elf_Shdr * sechdrs, const char *strtab,/* Arithmetic relocations are handled. */ /* We do not expect LSETUP to be split and hence is not */ /* handled. */ -/* R_byte and R_byte2 are also not handled as the gas */ -/* does not generate it. */ +/* R_BFIN_BYTE and R_BFIN_BYTE2 are also not handled as the */ +/* gas does not generate it. */ /*************************************************************************/ int apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
@@ -243,8 +243,8 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,#endif switch (ELF32_R_TYPE (rel[i].r_info)) { -case R_pcrel24: -case R_pcrel24_jump_l: +case R_BFIN_PCREL24 : +case R_BFIN_PCREL24_JUMP_L :/* Add the value, subtract its postition */ location16 = (uint16_t *) (sechdrs[sechdrs[relsec].sh_info].
@@ -266,18 +266,18 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab, (*location16 &0xff00 ) | (value >>16 &0x00ff ); *(location16 +1 ) = value &0xffff ;break ; -case R_pcrel12_jump: -case R_pcrel12_jump_s: +case R_BFIN_PCREL12_JUMP : +case R_BFIN_PCREL12_JUMP_S : value -= (uint32_t ) location32; value >>=1 ; *location16 = (value &0xfff );break ; -case R_pcrel10: +case R_BFIN_PCREL10 : value -= (uint32_t ) location32; value >>=1 ; *location16 = (value &0x3ff );break ; -case R_luimm16: +case R_BFIN_LUIMM16 :pr_debug ("before %x after %x\n" , *location16, (value &0xffff )); tmp = (value &0xffff );
@@ -286,7 +286,7 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab, }else *location16 = tmp;break ; -case R_huimm16: +case R_BFIN_HUIMM16 :pr_debug ("before %x after %x\n" , *location16, ((value >>16 ) &0xffff )); tmp = ((value >>16 ) &0xffff );
@@ -295,10 +295,10 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab, }else *location16 = tmp;break ; -case R_rimm16: +case R_BFIN_RIMM16 : *location16 = (value &0xffff );break ; -case R_byte4_data: +case R_BFIN_BYTE4_DATA :pr_debug ("before %x after %x\n" , *location32, value); *location32 = value;break ;
Signature · 1 line
1.6.3.1
PATCH 53/62 Blackfin: document the lsl variants of the L1 allocator
In reply to Mike FrysingerMake sure the meaning of "lsl" is covered somewhere and it is clear why we somewhat duplicate the sram alloc/free functions.
--- arch/blackfin/mm/sram-alloc.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
arch/blackfin/mm/sram-alloc.c +4 -0
@@ -743,6 +743,10 @@ found: }EXPORT_SYMBOL (sram_free_with_lsl); +/* Allocate memory and keep in L1 SRAM List (lsl) so that the resources are +* tracked. These are designed for userspace so that when a process exits, +* we can safely reap their resources. +*/ void *sram_alloc_with_lsl (size_t size,unsigned long flags) {void *addr =NULL ;
Signature · 1 line
1.6.3.1
PATCH 54/62 Blackfin: convert early_printk EVT init to a loop
In reply to Mike FrysingerThe EVT registers are all contiguous in the memory map, so using a loop to initialize them all rather than hardcoding the list results in much better generated code (a hardware loop rather than a whole bunch of individual loads).
--- arch/blackfin/kernel/early_printk.c | 16 +++------------- 1 files changed, 3 insertions(+), 13 deletions(-)
arch/blackfin/kernel/early_printk.c +3 -13
@@ -178,25 +178,15 @@ int __init setup_early_printk(char *buf) asmlinkage void __init init_early_exception_vectors(void) { +u32 evt;SSYNC ();/* cannot program in software: * evt0 - emulation (jtag) * evt1 - reset */ -bfin_write_EVT2 (early_trap); -bfin_write_EVT3 (early_trap); -bfin_write_EVT5 (early_trap); -bfin_write_EVT6 (early_trap); -bfin_write_EVT7 (early_trap); -bfin_write_EVT8 (early_trap); -bfin_write_EVT9 (early_trap); -bfin_write_EVT10 (early_trap); -bfin_write_EVT11 (early_trap); -bfin_write_EVT12 (early_trap); -bfin_write_EVT13 (early_trap); -bfin_write_EVT14 (early_trap); -bfin_write_EVT15 (early_trap); +for (evt =EVT2 ; evt <=EVT15 ; evt +=4 ) +bfin_write32 (evt, early_trap);CSYNC ();/* Set all the return from interrupt, exception, NMI to a known place
Signature · 1 line
1.6.3.1
PATCH 55/62 Blackfin: add missing access_ok() checks to user functions
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
The core string/clear user functions weren't checking the user pointers which caused kernel crashes with some bad programs and tests (like LTP).
--- arch/blackfin/include/asm/uaccess.h | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-)
arch/blackfin/include/asm/uaccess.h +20 -5
@@ -233,16 +233,29 @@ strncpy_from_user(char *dst, const char *src, long count) }/* -* Return the size of a string (including the ending 0) +* Get the size of a string in user space. +* src: The string to measure +* n: The maximum valid length * -* Return 0 on exception, a value greater than N if too long +* Get the size of a NUL-terminated string in user space. +* +* Returns the size of the string INCLUDING the terminating NUL. +* On exception, returns 0. +* If the string is too long, returns a value greater than n. */ -static inline long strnlen_user (const char *src,long n) +static inline long __must_check strnlen_user (const char *src,long n) { -return (strlen (src) +1 ); +if (!access_ok (VERIFY_READ , src,1 )) +return 0 ; +return strnlen (src, n) +1 ; } -#define strlen_user (str) strnlen_user(str, 32767) +static inline long __must_check strlen_user (const char *src) +{ +if (!access_ok (VERIFY_READ , src,1 )) +return 0 ; +return strlen (src) +1 ; +}/* * Zero Userspace
@@ -251,6 +264,8 @@ static inline long strnlen_user(const char *src, long n)static inline unsigned long __must_check __clear_user (void *to,unsigned long n) { +if (!access_ok (VERIFY_WRITE , to, n)) +return n;memset (to,0 , n);return 0 ; }
Signature · 1 line
1.6.3.1
PATCH 56/62 Blackfin: punt duplicated search_exception_table() prototype
In reply to Mike FrysingerThe common code already has a prototype for this function and we don't use it anywhere in the Blackfin code, so punt it from the Blackfin headers.
--- arch/blackfin/include/asm/uaccess.h | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
arch/blackfin/include/asm/uaccess.h +0 -3
@@ -83,9 +83,6 @@ struct exception_table_entry {unsigned long insn, fixup; }; -/* Returns 0 if exception not found and fixup otherwise. */ -extern unsigned long search_exception_table (unsigned long ); -/* * These are the main single-value transfer routines. They automatically * use the right size if we just have the right pointer type.
Signature · 1 line
1.6.3.1
PATCH 57/62 Blackfin: push access_ok() L1 attribute down
In reply to Mike FrysingerThere is no need for the L1 attribute to be on the prototype of the access_ok() function as all consumers of the function do not care where it lives -- they'll always use pcrel calls to get to it. This prevents pointless recompiles of most of the system when this config option changes.
--- arch/blackfin/include/asm/uaccess.h | 4 ---- arch/blackfin/kernel/process.c | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-)
arch/blackfin/include/asm/uaccess.h +0 -4
@@ -59,12 +59,8 @@ static inline int is_in_rom(unsigned long addr)#ifndef CONFIG_ACCESS_CHECK static inline int _access_ok (unsigned long addr,unsigned long size) {return 1 ; }#else -#ifdef CONFIG_ACCESS_OK_L1 -extern int _access_ok (unsigned long addr,unsigned long size)__attribute__((l1_text)); -#else extern int _access_ok (unsigned long addr,unsigned long size);#endif -#endif /* * The exception table consists of pairs of addresses: the first is the
arch/blackfin/kernel/process.c +3 -0
@@ -322,6 +322,9 @@ void finish_atomic_sections (struct pt_regs *regs) } #if defined(CONFIG_ACCESS_CHECK) +#ifdef CONFIG_ACCESS_OK_L1 +__attribute__((l1_text)) +#endif /* Return 1 if access to memory range is OK, 0 otherwise */ int _access_ok(unsigned long addr, unsigned long size) {
Signature · 1 line
1.6.3.1
PATCH 58/62 Blackfin: kgdb: fix up error return values
In reply to Mike FrysingerThe Blackfin kgdb code was all passing back positive errno values when it really should have been using negative errno values.
--- arch/blackfin/kernel/kgdb.c | 55 +++++++++++++++++++++++------------------- 1 files changed, 30 insertions(+), 25 deletions(-)
arch/blackfin/kernel/kgdb.c +30 -25
@@ -466,7 +466,7 @@ static int validate_memory_access_address(unsigned long addr, int size)int cpu =raw_smp_processor_id ();if (size <0 ) -return EFAULT ; +return -EFAULT ;if (addr >=0x1000 && (addr + size) <= physical_mem_end)return 0 ;if (addr >=SYSMMR_BASE )
@@ -498,7 +498,7 @@ static int validate_memory_access_address(unsigned long addr, int size)if (IN_MEM (addr, size,L2_START ,L2_LENGTH ))return 0 ; -return EFAULT ; +return -EFAULT ; }/*
@@ -508,14 +508,15 @@ static int validate_memory_access_address(unsigned long addr, int size)int kgdb_mem2hex (char *mem,char *buf,int count) {char *tmp; -int err =0 ; +int err;unsigned char *pch;unsigned short mmr16;unsigned long mmr32;int cpu =raw_smp_processor_id (); -if (validate_memory_access_address ((unsigned long )mem, count)) -return EFAULT ; + err =validate_memory_access_address ((unsigned long )mem, count); +if (err) +return err;/* * We use the upper half of buf as an intermediate buffer for the
@@ -533,7 +534,7 @@ int kgdb_mem2hex(char *mem, char *buf, int count) *tmp++ = *pch++; tmp -=2 ; }else - err =EFAULT ; + err = -EFAULT ;break ;case 4 :if ((unsigned int )mem %4 ==0 ) {
@@ -545,10 +546,10 @@ int kgdb_mem2hex(char *mem, char *buf, int count) *tmp++ = *pch++; tmp -=4 ; }else - err =EFAULT ; + err = -EFAULT ;break ;default : - err =EFAULT ; + err = -EFAULT ; } } else if ((cpu == 0 && IN_MEM(mem, count, L1_CODE_START, L1_CODE_LENGTH))#ifdef CONFIG_SMP
@@ -557,7 +558,7 @@ int kgdb_mem2hex(char *mem, char *buf, int count) ) {/* access L1 instruction SRAM*/ if (dma_memcpy (tmp, mem, count) ==NULL ) - err =EFAULT ; + err = -EFAULT ; } else err =probe_kernel_read (tmp, mem, count);
@@ -585,7 +586,7 @@ int kgdb_ebin2mem(char *buf, char *mem, int count)char *tmp_new;unsigned short *mmr16;unsigned long *mmr32; -int err =0 ; +int err;int size =0 ;int cpu =raw_smp_processor_id ();
@@ -601,8 +602,9 @@ int kgdb_ebin2mem(char *buf, char *mem, int count) size++; } -if (validate_memory_access_address ((unsigned long )mem, size)) -return EFAULT ; + err =validate_memory_access_address ((unsigned long )mem, size); +if (err) +return err;if ((unsigned int )mem >=SYSMMR_BASE ) {/*access MMR registers*/ switch (size) {
@@ -611,17 +613,17 @@ int kgdb_ebin2mem(char *buf, char *mem, int count) mmr16 = (unsigned short *)buf; *(unsigned short *)mem = *mmr16; }else -return EFAULT ; + err = -EFAULT ;break ;case 4 :if ((unsigned int )mem %4 ==0 ) { mmr32 = (unsigned long *)buf; *(unsigned long *)mem = *mmr32; }else -return EFAULT ; + err = -EFAULT ;break ;default : -return EFAULT ; + err = -EFAULT ; } } else if ((cpu == 0 && IN_MEM(mem, count, L1_CODE_START, L1_CODE_LENGTH))#ifdef CONFIG_SMP
@@ -630,7 +632,7 @@ int kgdb_ebin2mem(char *buf, char *mem, int count) ) {/* access L1 instruction SRAM */ if (dma_memcpy (mem, buf, size) ==NULL ) - err =EFAULT ; + err = -EFAULT ; } else err =probe_kernel_write (mem, buf, size);
@@ -648,10 +650,12 @@ int kgdb_hex2mem(char *buf, char *mem, int count)char *tmp_hex;unsigned short *mmr16;unsigned long *mmr32; +int err;int cpu =raw_smp_processor_id (); -if (validate_memory_access_address ((unsigned long )mem, count)) -return EFAULT ; + err =validate_memory_access_address ((unsigned long )mem, count); +if (err) +return err;/* * We use the upper half of buf as an intermediate buffer for the
@@ -673,17 +677,17 @@ int kgdb_hex2mem(char *buf, char *mem, int count) mmr16 = (unsigned short *)tmp_raw; *(unsigned short *)mem = *mmr16; }else -return EFAULT ; + err = -EFAULT ;break ;case 4 :if ((unsigned int )mem %4 ==0 ) { mmr32 = (unsigned long *)tmp_raw; *(unsigned long *)mem = *mmr32; }else -return EFAULT ; + err = -EFAULT ;break ;default : -return EFAULT ; + err = -EFAULT ; } } else if ((cpu == 0 && IN_MEM(mem, count, L1_CODE_START, L1_CODE_LENGTH))#ifdef CONFIG_SMP
@@ -692,10 +696,11 @@ int kgdb_hex2mem(char *buf, char *mem, int count) ) {/* access L1 instruction SRAM */ if (dma_memcpy (mem, tmp_raw, count) ==NULL ) -return EFAULT ; + err = -EFAULT ; } else - return probe_kernel_write(mem, tmp_raw, count); -return 0 ; + err =probe_kernel_write (mem, tmp_raw, count); + +return err; }int kgdb_validate_break_address (unsigned long addr)
@@ -715,7 +720,7 @@ int kgdb_validate_break_address(unsigned long addr)if (IN_MEM (addr,BREAK_INSTR_SIZE ,L2_START ,L2_LENGTH ))return 0 ; -return EFAULT ; +return -EFAULT ; }int kgdb_arch_set_breakpoint (unsigned long addr,char *saved_instr)
Signature · 1 line
1.6.3.1
PATCH 59/62 Blackfin: fix length checking in kgdb_ebin2mem
In reply to Mike FrysingerFrom: Roel Kluin <[email protected]>
The kgdb_ebin2mem() was decrementing the count variable to do parsing, but then later still tries to use it based on its original meaning. So leave it untouched and use a different variable to walk the memory.
--- arch/blackfin/kernel/kgdb.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
arch/blackfin/kernel/kgdb.c +2 -3
@@ -587,19 +587,18 @@ int kgdb_ebin2mem(char *buf, char *mem, int count)unsigned short *mmr16;unsigned long *mmr32;int err; -int size =0 ; +int size;int cpu =raw_smp_processor_id (); tmp_old = tmp_new = buf; -while (count-- >0 ) { +for (size =0 ; size < count; ++size) {if (*tmp_old ==0x7d ) *tmp_new = *(++tmp_old) ^0x20 ;else *tmp_new = *tmp_old; tmp_new++; tmp_old++; - size++; } err =validate_memory_access_address ((unsigned long )mem, size);
Signature · 1 line
1.6.3.1
PATCH 60/62 Blackfin: export the last exception cause via debugfs
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
We have some test code that runs in userspace that exercises the exception handling of the Blackfin pretty thoroughly. Part of the validation process is checking the exact exception triggered, so export the last one seen to userspace via debugfs when debugging is enabled for the test code to check.
--- arch/blackfin/kernel/traps.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
arch/blackfin/kernel/traps.c +7 -0
@@ -70,6 +70,10 @@ ({ if (0) printk(fmt, ##arg); 0; })#endif +#ifdef CONFIG_DEBUG_MMRS +u32 last_seqstat; +#endif +/* Initiate the event table handler */ void __init trap_init (void ) {
@@ -247,6 +251,9 @@ asmlinkage void trap_c(struct pt_regs *fp)unsigned long trapnr = fp->seqstat &SEQSTAT_EXCAUSE ;trace_buffer_save (j); +#ifdef CONFIG_DEBUG_MMRS + last_seqstat = (u32 )fp->seqstat; +#endif /* Important - be very careful dereferncing pointers - will lead to * double faults if the stack has become corrupt
Signature · 1 line
1.6.3.1
PATCH 61/62 Blackfin: fix unused warnings after nommu update
In reply to Mike FrysingerThe massive nommu update (8feae131) left the local variable "vml" unused, so punt it.
--- arch/blackfin/kernel/traps.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
arch/blackfin/kernel/traps.c +0 -1
@@ -85,7 +85,6 @@ void __init trap_init(void)static void decode_address (char *buf,unsigned long address) {#ifdef CONFIG_DEBUG_VERBOSE -struct vm_list_struct *vml;struct task_struct *p;struct mm_struct *mm;unsigned long flags, offset;
Signature · 1 line
1.6.3.1
PATCH 62/62 Blackfin: fix sparseirq/kstat_irqs fallout
In reply to Mike FrysingerThe sparseirq changes (d7e51e66) played poorly with the Blackfin irqchip implementation as we're still using the old hardirq method. Our bad irq structure had a NULL kstat_irqs field so when all the common code tries to increment this field, everything goes big bada boom.
--- arch/blackfin/kernel/irqchip.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/blackfin/kernel/irqchip.c +2 -0
@@ -59,12 +59,14 @@ static struct irq_chip bad_chip = { .unmask = dummy_mask_unmask_irq, }; +static int bad_stats;static struct irq_desc bad_irq_desc = { .status =IRQ_DISABLED , .chip = &bad_chip, .handle_irq = handle_bad_irq, .depth =1 , .lock =__SPIN_LOCK_UNLOCKED (irq_desc->lock), + .kstat_irqs = &bad_stats, #ifdef CONFIG_SMP .affinity =CPU_MASK_ALL #endif
Signature · 1 line
1.6.3.1