Blackfin fixes for 2.6.32
cover Blackfin fixes for 2.6.32
Ignoring the updated anomaly lists, we've got a whole bunch of tiny fixes either for regressions and hardware anomalies.
André Goddard Rosa (1):
Blackfin: fix cache Kconfig typo
Graf Yang (1):
Blackfin: fix SMP build error in start_thread()
Jie Zhang (1):
Blackfin: fix typo in ptrace poking
Michael Hennerich (1):
Blackfin: fix suspend/resume failure with some on-chip ROMs
Mike Frysinger (3):
Blackfin: update anomaly lists
Blackfin: work around testset anomaly 05000477
Blackfin: check for anomaly 05000475
Roel Kluin (1):
Blackfin: fix memset in smp_send_reschedule() and -stop()
arch/blackfin/kernel/bfin_dma_5xx.c | 9 ++++++- arch/blackfin/kernel/cplb-mpu/cplbinit.c | 2 +- arch/blackfin/kernel/process.c | 2 +- arch/blackfin/kernel/ptrace.c | 2 +- arch/blackfin/mach-bf518/include/mach/anomaly.h | 18 ++++++++++++--- arch/blackfin/mach-bf527/include/mach/anomaly.h | 20 +++++++++++++---- arch/blackfin/mach-bf533/include/mach/anomaly.h | 18 ++++++++++++--- arch/blackfin/mach-bf537/include/mach/anomaly.h | 18 ++++++++++++--- arch/blackfin/mach-bf538/include/mach/anomaly.h | 18 ++++++++++++--- arch/blackfin/mach-bf548/include/mach/anomaly.h | 23 ++++++++++++++++---- arch/blackfin/mach-bf561/atomic.S | 14 +++++++++++- arch/blackfin/mach-bf561/include/mach/anomaly.h | 25 ++++++++++++++++++---- arch/blackfin/mach-common/arch_checks.c | 5 ++++ arch/blackfin/mach-common/smp.c | 6 +--- 14 files changed, 138 insertions(+), 42 deletions(-)
PATCH 1/8 Blackfin: fix suspend/resume failure with some on-chip ROMs
From: Michael Hennerich <[email protected]>
Some Blackfin on-chip ROMs utilize some MDMA channels during the suspend and resume process, but don't clean up after themselves. So manually clear all DMA channels when resuming since no DMA could have been running at this point in time. Now Linux should be able to work regardless of any laziness on the part of the on-chip ROM or boot loader.
--- arch/blackfin/kernel/bfin_dma_5xx.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
arch/blackfin/kernel/bfin_dma_5xx.c +7 -2
@@ -225,8 +225,13 @@ int blackfin_dma_suspend(void)void blackfin_dma_resume (void ) {int i; -for (i =0 ; i <MAX_DMA_SUSPEND_CHANNELS ; ++i) - dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map; + +for (i =0 ; i <MAX_DMA_CHANNELS ; ++i) { + dma_ch[i].regs->cfg =0 ; + +if (i <MAX_DMA_SUSPEND_CHANNELS ) + dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map; + } }#endif
Signature · 1 line
1.6.5.3
PATCH 2/8 Blackfin: fix cache Kconfig typo
In reply to Mike FrysingerFrom: André Goddard Rosa <[email protected]>
The Kconfig option is "BFIN_EXTMEM_WRITETHROUGH", not "..._WRITETROUGH".
--- arch/blackfin/kernel/cplb-mpu/cplbinit.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/kernel/cplb-mpu/cplbinit.c +1 -1
@@ -38,7 +38,7 @@ void __init generate_cplb_tables_cpu(unsigned int cpu)#ifdef CONFIG_BFIN_EXTMEM_DCACHEABLE d_cache =CPLB_L1_CHBL ; -#ifdef CONFIG_BFIN_EXTMEM_WRITETROUGH +#ifdef CONFIG_BFIN_EXTMEM_WRITETHROUGH d_cache |=CPLB_L1_AOW |CPLB_WT ;#endif #endif
Signature · 1 line
1.6.5.3
PATCH 3/8 Blackfin: update anomaly lists
In reply to Mike FrysingerAdd some recently documented anomalies (473, 474, 475, 477). Also stick a "do not edit" notice in here so people know these are copies of some master version.
--- arch/blackfin/mach-bf518/include/mach/anomaly.h | 18 ++++++++++++--- arch/blackfin/mach-bf527/include/mach/anomaly.h | 20 +++++++++++++---- arch/blackfin/mach-bf533/include/mach/anomaly.h | 18 ++++++++++++--- arch/blackfin/mach-bf537/include/mach/anomaly.h | 18 ++++++++++++--- arch/blackfin/mach-bf538/include/mach/anomaly.h | 18 ++++++++++++--- arch/blackfin/mach-bf548/include/mach/anomaly.h | 23 ++++++++++++++++---- arch/blackfin/mach-bf561/include/mach/anomaly.h | 25 ++++++++++++++++++---- 7 files changed, 109 insertions(+), 31 deletions(-)
arch/blackfin/mach-bf518/include/mach/anomaly.h +14 -4
@@ -1,9 +1,13 @@/* -* File: include/asm-blackfin/mach-bf518/anomaly.h -* Bugs: Enter bugs at http://blackfin.uclinux.org/ +* DO NOT EDIT THIS FILE +* This file is under version control at +* svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/ +* and can be replaced with that version at any time +* DO NOT EDIT THIS FILE * -* Copyright (C) 2004-2009 Analog Devices Inc. -* Licensed under the GPL-2 or later. +* Copyright 2004-2009 Analog Devices Inc. +* Licensed under the ADI BSD license. +* https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd */ /* This file should be up to date with:
@@ -70,6 +74,10 @@#define ANOMALY_05000461 (1)/* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */ #define ANOMALY_05000462 (1) +/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */ +#define ANOMALY_05000473 (1) +/* TESTSET Instruction Cannot Be Interrupted */ +#define ANOMALY_05000477 (1)/* Anomalies that don't exist on this proc */ #define ANOMALY_05000099 (0)
@@ -133,5 +141,7 @@#define ANOMALY_05000450 (0)#define ANOMALY_05000465 (0)#define ANOMALY_05000467 (0) +#define ANOMALY_05000474 (0) +#define ANOMALY_05000475 (0)#endif
arch/blackfin/mach-bf527/include/mach/anomaly.h +15 -5
@@ -1,14 +1,18 @@/* -* File: include/asm-blackfin/mach-bf527/anomaly.h -* Bugs: Enter bugs at http://blackfin.uclinux.org/ +* DO NOT EDIT THIS FILE +* This file is under version control at +* svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/ +* and can be replaced with that version at any time +* DO NOT EDIT THIS FILE * -* Copyright (C) 2004-2009 Analog Devices Inc. -* Licensed under the GPL-2 or later. +* Copyright 2004-2009 Analog Devices Inc. +* Licensed under the ADI BSD license. +* https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd */ /* This file should be up to date with: * - Revision D, 08/14/2009; ADSP-BF526 Blackfin Processor Anomaly List -* - Revision F, 03/03/2009; ADSP-BF527 Blackfin Processor Anomaly List +* - Revision G, 08/25/2009; ADSP-BF527 Blackfin Processor Anomaly List */ #ifndef _MACH_ANOMALY_H_
@@ -200,6 +204,10 @@#define ANOMALY_05000467 (1)/* PLL Latches Incorrect Settings During Reset */ #define ANOMALY_05000469 (1) +/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */ +#define ANOMALY_05000473 (1) +/* TESTSET Instruction Cannot Be Interrupted */ +#define ANOMALY_05000477 (1)/* Anomalies that don't exist on this proc */ #define ANOMALY_05000099 (0)
@@ -250,5 +258,7 @@#define ANOMALY_05000412 (0)#define ANOMALY_05000447 (0)#define ANOMALY_05000448 (0) +#define ANOMALY_05000474 (0) +#define ANOMALY_05000475 (0)#endif
arch/blackfin/mach-bf533/include/mach/anomaly.h +14 -4
@@ -1,9 +1,13 @@/* -* File: include/asm-blackfin/mach-bf533/anomaly.h -* Bugs: Enter bugs at http://blackfin.uclinux.org/ +* DO NOT EDIT THIS FILE +* This file is under version control at +* svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/ +* and can be replaced with that version at any time +* DO NOT EDIT THIS FILE * -* Copyright (C) 2004-2009 Analog Devices Inc. -* Licensed under the GPL-2 or later. +* Copyright 2004-2009 Analog Devices Inc. +* Licensed under the ADI BSD license. +* https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd */ /* This file should be up to date with:
@@ -202,6 +206,10 @@#define ANOMALY_05000443 (1)/* False Hardware Error when RETI Points to Invalid Memory */ #define ANOMALY_05000461 (1) +/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */ +#define ANOMALY_05000473 (1) +/* TESTSET Instruction Cannot Be Interrupted */ +#define ANOMALY_05000477 (1)/* These anomalies have been "phased" out of analog.com anomaly sheets and are * here to show running on older silicon just isn't feasible.
@@ -349,5 +357,7 @@#define ANOMALY_05000450 (0)#define ANOMALY_05000465 (0)#define ANOMALY_05000467 (0) +#define ANOMALY_05000474 (0) +#define ANOMALY_05000475 (0)#endif
arch/blackfin/mach-bf537/include/mach/anomaly.h +14 -4
@@ -1,9 +1,13 @@/* -* File: include/asm-blackfin/mach-bf537/anomaly.h -* Bugs: Enter bugs at http://blackfin.uclinux.org/ +* DO NOT EDIT THIS FILE +* This file is under version control at +* svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/ +* and can be replaced with that version at any time +* DO NOT EDIT THIS FILE * -* Copyright (C) 2004-2009 Analog Devices Inc. -* Licensed under the GPL-2 or later. +* Copyright 2004-2009 Analog Devices Inc. +* Licensed under the ADI BSD license. +* https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd */ /* This file should be up to date with:
@@ -156,6 +160,10 @@#define ANOMALY_05000443 (1)/* False Hardware Error when RETI Points to Invalid Memory */ #define ANOMALY_05000461 (1) +/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */ +#define ANOMALY_05000473 (1) +/* TESTSET Instruction Cannot Be Interrupted */ +#define ANOMALY_05000477 (1)/* Anomalies that don't exist on this proc */ #define ANOMALY_05000099 (0)
@@ -202,5 +210,7 @@#define ANOMALY_05000450 (0)#define ANOMALY_05000465 (0)#define ANOMALY_05000467 (0) +#define ANOMALY_05000474 (0) +#define ANOMALY_05000475 (0)#endif
arch/blackfin/mach-bf538/include/mach/anomaly.h +14 -4
@@ -1,9 +1,13 @@/* -* File: include/asm-blackfin/mach-bf538/anomaly.h -* Bugs: Enter bugs at http://blackfin.uclinux.org/ +* DO NOT EDIT THIS FILE +* This file is under version control at +* svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/ +* and can be replaced with that version at any time +* DO NOT EDIT THIS FILE * -* Copyright (C) 2004-2009 Analog Devices Inc. -* Licensed under the GPL-2 or later. +* Copyright 2004-2009 Analog Devices Inc. +* Licensed under the ADI BSD license. +* https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd */ /* This file should be up to date with:
@@ -128,6 +132,10 @@#define ANOMALY_05000443 (1)/* False Hardware Error when RETI Points to Invalid Memory */ #define ANOMALY_05000461 (1) +/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */ +#define ANOMALY_05000473 (1) +/* TESTSET Instruction Cannot Be Interrupted */ +#define ANOMALY_05000477 (1)/* Anomalies that don't exist on this proc */ #define ANOMALY_05000099 (0)
@@ -176,5 +184,7 @@#define ANOMALY_05000450 (0)#define ANOMALY_05000465 (0)#define ANOMALY_05000467 (0) +#define ANOMALY_05000474 (0) +#define ANOMALY_05000475 (0)#endif
arch/blackfin/mach-bf548/include/mach/anomaly.h +18 -5
@@ -1,9 +1,13 @@/* -* File: include/asm-blackfin/mach-bf548/anomaly.h -* Bugs: Enter bugs at http://blackfin.uclinux.org/ +* DO NOT EDIT THIS FILE +* This file is under version control at +* svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/ +* and can be replaced with that version at any time +* DO NOT EDIT THIS FILE * -* Copyright (C) 2004-2009 Analog Devices Inc. -* Licensed under the GPL-2 or later. +* Copyright 2004-2009 Analog Devices Inc. +* Licensed under the ADI BSD license. +* https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd */ /* This file should be up to date with:
@@ -24,6 +28,8 @@#define ANOMALY_05000119 (1)/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */ #define ANOMALY_05000122 (1) +/* Data Corruption with Cached External Memory and Non-Cached On-Chip L2 Memory */ +#define ANOMALY_05000220 (1)/* False Hardware Error from an Access in the Shadow of a Conditional Branch */ #define ANOMALY_05000245 (1)/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
@@ -200,6 +206,14 @@#define ANOMALY_05000466 (1)/* Possible RX data corruption when control & data EP FIFOs are accessed via the core */ #define ANOMALY_05000467 (1) +/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */ +#define ANOMALY_05000473 (1) +/* Access to DDR-SDRAM causes system hang under certain PLL/VR settings */ +#define ANOMALY_05000474 (1) +/* Core Hang With L2/L3 Configured in Writeback Cache Mode */ +#define ANOMALY_05000475 (1) +/* TESTSET Instruction Cannot Be Interrupted */ +#define ANOMALY_05000477 (1)/* Anomalies that don't exist on this proc */ #define ANOMALY_05000099 (0)
@@ -215,7 +229,6 @@#define ANOMALY_05000198 (0)#define ANOMALY_05000202 (0)#define ANOMALY_05000215 (0) -#define ANOMALY_05000220 (0)#define ANOMALY_05000227 (0)#define ANOMALY_05000230 (0)#define ANOMALY_05000231 (0)
arch/blackfin/mach-bf561/include/mach/anomaly.h +20 -5
@@ -1,9 +1,13 @@/* -* File: include/asm-blackfin/mach-bf561/anomaly.h -* Bugs: Enter bugs at http://blackfin.uclinux.org/ +* DO NOT EDIT THIS FILE +* This file is under version control at +* svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/ +* and can be replaced with that version at any time +* DO NOT EDIT THIS FILE * -* Copyright (C) 2004-2009 Analog Devices Inc. -* Licensed under the GPL-2 or later. +* Copyright 2004-2009 Analog Devices Inc. +* Licensed under the ADI BSD license. +* https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd */ /* This file should be up to date with:
@@ -213,7 +217,11 @@/* Disabling Peripherals with DMA Running May Cause DMA System Instability */ #define ANOMALY_05000278 (__SILICON_REVISION__ < 5)/* False Hardware Error Exception when ISR Context Is Not Restored */ -#define ANOMALY_05000281 (__SILICON_REVISION__ < 5) +/* Temporarily walk around for bug 5423 till this issue is confirmed by +* official anomaly document. It looks 05000281 still exists on bf561 +* v0.5. +*/ +#define ANOMALY_05000281 (__SILICON_REVISION__ <= 5)/* System MMR Write Is Stalled Indefinitely when Killed in a Particular Stage */ #define ANOMALY_05000283 (1)/* Reads Will Receive Incorrect Data under Certain Conditions */
@@ -280,6 +288,12 @@#define ANOMALY_05000443 (1)/* False Hardware Error when RETI Points to Invalid Memory */ #define ANOMALY_05000461 (1) +/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */ +#define ANOMALY_05000473 (1) +/* Core Hang With L2/L3 Configured in Writeback Cache Mode */ +#define ANOMALY_05000475 (__SILICON_REVISION__ < 4) +/* TESTSET Instruction Cannot Be Interrupted */ +#define ANOMALY_05000477 (1)/* Anomalies that don't exist on this proc */ #define ANOMALY_05000119 (0)
@@ -304,5 +318,6 @@#define ANOMALY_05000450 (0)#define ANOMALY_05000465 (0)#define ANOMALY_05000467 (0) +#define ANOMALY_05000474 (0)#endif
Signature · 1 line
1.6.5.3
PATCH 4/8 Blackfin: work around testset anomaly 05000477
In reply to Mike FrysingerIronically, the atomic testset instruction cannot be interrupted else it will produce incorrect results. So disable interrupts to help it out.
--- arch/blackfin/mach-bf561/atomic.S | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-)
arch/blackfin/mach-bf561/atomic.S +12 -2
@@ -19,6 +19,16 @@ \reg\().h = _corelock; .endm +.macro safe_testset addr:req, scratch:req +#if ANOMALY_05000477 + cli \scratch; + testset (\addr); + sti \scratch; +#else + testset (\addr); +#endif +.endm + /* * r0 = address of atomic data to flush and invalidate (32bit). *
@@ -33,7 +43,7 @@ ENTRY(_get_core_lock) cli r0; coreslot_loadaddr p0; .Lretry_corelock: - testset (p0); + safe_testset p0, r2; if cc jump .Ldone_corelock; SSYNC(r2); jump .Lretry_corelock
@@ -56,7 +66,7 @@ ENTRY(_get_core_lock_noflush) cli r0; coreslot_loadaddr p0; .Lretry_corelock_noflush: - testset (p0); + safe_testset p0, r2; if cc jump .Ldone_corelock_noflush; SSYNC(r2); jump .Lretry_corelock_noflush
Signature · 1 line
1.6.5.3
PATCH 5/8 Blackfin: check for anomaly 05000475
In reply to Mike FrysingerParts that have on-chip L2 SRAM cannot safely utilize writeback caching mode, so reject any attempts to use it.
--- arch/blackfin/mach-common/arch_checks.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/blackfin/mach-common/arch_checks.c +5 -0
@@ -57,3 +57,8 @@ (!defined(CONFIG_BFIN_EXTMEM_DCACHEABLE) && defined(CONFIG_BFIN_L2_WRITEBACK)))# error You are exposing Anomaly 220 in this config, either config L2 as Write Through, or make External Memory WB.#endif + +#if ANOMALY_05000475 && \ + (defined(CONFIG_BFIN_EXTMEM_WRITEBACK ) || defined(CONFIG_BFIN_L2_WRITEBACK )) +# error "Anomaly 475 does not allow you to use Write Back cache with L2 or External Memory" +#endif
Signature · 1 line
1.6.5.3
PATCH 6/8 Blackfin: fix typo in ptrace poking
In reply to Mike FrysingerFrom: Jie Zhang <[email protected]>
Commit c014e15a2f667f9 (Blackfin: convert ptrace to new memory functions) introduced a copy & paste typo in the ptrace poke data/text handling. The access_process_vm() function call was telling it to read instead of write.
--- arch/blackfin/kernel/ptrace.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/kernel/ptrace.c +1 -1
@@ -315,7 +315,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)case BFIN_MEM_ACCESS_CORE :case BFIN_MEM_ACCESS_CORE_ONLY : copied =access_process_vm (child, addr, &data, - to_copy,0 ); + to_copy,1 );if (copied)break ;
Signature · 1 line
1.6.5.3
PATCH 7/8 Blackfin: fix memset in smp_send_reschedule() and -stop()
In reply to Mike FrysingerFrom: Roel Kluin <[email protected]>
To set zeroes the sizeof the struct should be used rather than sizeof the pointer, kzalloc does that.
--- arch/blackfin/mach-common/smp.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
arch/blackfin/mach-common/smp.c +2 -4
@@ -276,10 +276,9 @@ void smp_send_reschedule(int cpu)if (cpu_is_offline (cpu))return ; - msg =kmalloc (sizeof (*msg),GFP_ATOMIC ); + msg =kzalloc (sizeof (*msg),GFP_ATOMIC );if (!msg)return ; -memset (msg,0 ,sizeof (msg));INIT_LIST_HEAD (&msg->list); msg->type =BFIN_IPI_RESCHEDULE ;
@@ -305,10 +304,9 @@ void smp_send_stop(void)if (cpus_empty (callmap))return ; - msg =kmalloc (sizeof (*msg),GFP_ATOMIC ); + msg =kzalloc (sizeof (*msg),GFP_ATOMIC );if (!msg)return ; -memset (msg,0 ,sizeof (msg));INIT_LIST_HEAD (&msg->list); msg->type =BFIN_IPI_CPU_STOP ;
Signature · 1 line
1.6.5.3
PATCH 8/8 Blackfin: fix SMP build error in start_thread()
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
Commit d5ce528c8e46fa5afb9 (Blackfin: convert irq/process to asm-generic) incorrectly merged the smp and non-smp cases of start_thread() causing the L1 stack to be setup on the SMP port instead of the UP port.
--- arch/blackfin/kernel/process.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/kernel/process.c +1 -1
@@ -151,7 +151,7 @@ void start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_ regs->pc = new_ip;if (current->mm) regs->p5 = current->mm->start_data; -#ifdef CONFIG_SMP +#ifndef CONFIG_SMP task_thread_info (current)->l1_task_info.stack_start = (void *)current->mm->context.stack_start;task_thread_info (current)->l1_task_info.lowest_sp = (void *)new_sp;
Signature · 1 line
1.6.5.3