Skip to content

Commit 064e297

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin: (30 commits) Blackfin: SMP: fix continuation lines Blackfin: acvilon: fix timeout usage for I2C Blackfin: fix typo in BF537 IRQ comment Blackfin: unify duplicate MEM_MT48LC32M8A2_75 kconfig options Blackfin: set ARCH_KMALLOC_MINALIGN Blackfin: use atomic kmalloc in L1 alloc so it too can be atomic Blackfin: another year of changes (update copyright in boot log) Blackfin: optimize strncpy a bit Blackfin: isram: clean up ITEST_COMMAND macro and improve the selftests Blackfin: move string functions to normal lib/ assembly Blackfin: SIC: cut down on IAR MMR reads a bit Blackfin: bf537-minotaur: fix build errors due to header changes Blackfin: kgdb: pass up the CC register instead of a 0 stub Blackfin: handle HW errors in the new "FAULT" printing code Blackfin: show the whole accumulator in the pseudo DBG insn Blackfin: support all possible registers in the pseudo instructions Blackfin: add support for the DBG (debug output) pseudo insn Blackfin: change the BUG opcode to an unused 16-bit opcode Blackfin: allow NMI watchdog to be used w/RETN as a scratch reg Blackfin: add support for the DBGA (debug assert) pseudo insn ...
2 parents f137711 + db52ecc commit 064e297

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1938
-3241
lines changed

arch/blackfin/Kconfig

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ config MEM_MT48LC16M16A2TG_75
348348

349349
config MEM_MT48LC32M8A2_75
350350
bool
351-
depends on (BFIN537_STAMP || PNAV10 || BFIN538_EZKIT)
351+
depends on (BFIN518F_EZBRD || BFIN537_STAMP || PNAV10 || BFIN538_EZKIT)
352352
default y
353353

354354
config MEM_MT48LC8M32B2B5_7
@@ -361,11 +361,6 @@ config MEM_MT48LC32M16A2TG_75
361361
depends on (BFIN527_EZKIT || BFIN527_EZKIT_V2 || BFIN532_IP0X || BLACKSTAMP)
362362
default y
363363

364-
config MEM_MT48LC32M8A2_75
365-
bool
366-
depends on (BFIN518F_EZBRD)
367-
default y
368-
369364
config MEM_MT48H32M16LFCJ_75
370365
bool
371366
depends on (BFIN526_EZBRD)
@@ -791,6 +786,34 @@ config MEMCPY_L1
791786
If enabled, the memcpy function is linked
792787
into L1 instruction memory. (less latency)
793788

789+
config STRCMP_L1
790+
bool "locate strcmp function in L1 Memory"
791+
default y
792+
help
793+
If enabled, the strcmp function is linked
794+
into L1 instruction memory (less latency).
795+
796+
config STRNCMP_L1
797+
bool "locate strncmp function in L1 Memory"
798+
default y
799+
help
800+
If enabled, the strncmp function is linked
801+
into L1 instruction memory (less latency).
802+
803+
config STRCPY_L1
804+
bool "locate strcpy function in L1 Memory"
805+
default y
806+
help
807+
If enabled, the strcpy function is linked
808+
into L1 instruction memory (less latency).
809+
810+
config STRNCPY_L1
811+
bool "locate strncpy function in L1 Memory"
812+
default y
813+
help
814+
If enabled, the strncpy function is linked
815+
into L1 instruction memory (less latency).
816+
794817
config SYS_BFIN_SPINLOCK_L1
795818
bool "Locate sys_bfin_spinlock function in L1 Memory"
796819
default y
@@ -1187,32 +1210,6 @@ config PM_BFIN_SLEEP
11871210
If unsure, select "Sleep Deeper".
11881211
endchoice
11891212

1190-
config PM_WAKEUP_BY_GPIO
1191-
bool "Allow Wakeup from Standby by GPIO"
1192-
depends on PM && !BF54x
1193-
1194-
config PM_WAKEUP_GPIO_NUMBER
1195-
int "GPIO number"
1196-
range 0 47
1197-
depends on PM_WAKEUP_BY_GPIO
1198-
default 2
1199-
1200-
choice
1201-
prompt "GPIO Polarity"
1202-
depends on PM_WAKEUP_BY_GPIO
1203-
default PM_WAKEUP_GPIO_POLAR_H
1204-
config PM_WAKEUP_GPIO_POLAR_H
1205-
bool "Active High"
1206-
config PM_WAKEUP_GPIO_POLAR_L
1207-
bool "Active Low"
1208-
config PM_WAKEUP_GPIO_POLAR_EDGE_F
1209-
bool "Falling EDGE"
1210-
config PM_WAKEUP_GPIO_POLAR_EDGE_R
1211-
bool "Rising EDGE"
1212-
config PM_WAKEUP_GPIO_POLAR_EDGE_B
1213-
bool "Both EDGE"
1214-
endchoice
1215-
12161213
comment "Possible Suspend Mem / Hibernate Wake-Up Sources"
12171214
depends on PM
12181215

arch/blackfin/Kconfig.debug

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ config EARLY_PRINTK
238238
config NMI_WATCHDOG
239239
bool "Enable NMI watchdog to help debugging lockup on SMP"
240240
default n
241-
depends on (SMP && !BFIN_SCRATCH_REG_RETN)
241+
depends on SMP
242242
help
243243
If any CPU in the system does not execute the period local timer
244244
interrupt for more than 5 seconds, then the NMI handler dumps debug
@@ -264,4 +264,13 @@ config BFIN_ISRAM_SELF_TEST
264264
help
265265
Run some self tests of the isram driver code at boot.
266266

267+
config BFIN_PSEUDODBG_INSNS
268+
bool "Support pseudo debug instructions"
269+
default n
270+
help
271+
This option allows the kernel to emulate some pseudo instructions which
272+
allow simulator test cases to be run under Linux with no changes.
273+
274+
Most people should say N here.
275+
267276
endmenu

arch/blackfin/include/asm/bfin-global.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,15 @@ extern unsigned long sclk_to_usecs(unsigned long sclk);
3939
extern unsigned long usecs_to_sclk(unsigned long usecs);
4040

4141
struct pt_regs;
42+
#if defined(CONFIG_DEBUG_VERBOSE)
4243
extern void dump_bfin_process(struct pt_regs *regs);
4344
extern void dump_bfin_mem(struct pt_regs *regs);
4445
extern void dump_bfin_trace_buffer(void);
46+
#else
47+
#define dump_bfin_process(regs)
48+
#define dump_bfin_mem(regs)
49+
#define dump_bfin_trace_buffer()
50+
#endif
4551

4652
/* init functions only */
4753
extern int init_arch_irq(void);

arch/blackfin/include/asm/bug.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99

1010
#ifdef CONFIG_BUG
1111

12-
#define BFIN_BUG_OPCODE 0xefcd
12+
/*
13+
* This can be any undefined 16-bit opcode, meaning
14+
* ((opcode & 0xc000) != 0xc000)
15+
* Anything from 0x0001 to 0x000A (inclusive) will work
16+
*/
17+
#define BFIN_BUG_OPCODE 0x0001
1318

1419
#ifdef CONFIG_DEBUG_BUGVERBOSE
1520

arch/blackfin/include/asm/cache.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
1616
#define SMP_CACHE_BYTES L1_CACHE_BYTES
1717

18+
#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
19+
1820
#ifdef CONFIG_SMP
1921
#define __cacheline_aligned
2022
#else

arch/blackfin/include/asm/gpio.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,23 +167,23 @@ int bfin_special_gpio_request(unsigned gpio, const char *label);
167167
#endif
168168

169169
#ifdef CONFIG_PM
170+
int bfin_pm_standby_ctrl(unsigned ctrl);
170171

171-
unsigned int bfin_pm_standby_setup(void);
172-
void bfin_pm_standby_restore(void);
172+
static inline int bfin_pm_standby_setup(void)
173+
{
174+
return bfin_pm_standby_ctrl(1);
175+
}
176+
177+
static inline void bfin_pm_standby_restore(void)
178+
{
179+
bfin_pm_standby_ctrl(0);
180+
}
173181

174182
void bfin_gpio_pm_hibernate_restore(void);
175183
void bfin_gpio_pm_hibernate_suspend(void);
176184

177185
#ifndef CONFIG_BF54x
178-
#define PM_WAKE_RISING 0x1
179-
#define PM_WAKE_FALLING 0x2
180-
#define PM_WAKE_HIGH 0x4
181-
#define PM_WAKE_LOW 0x8
182-
#define PM_WAKE_BOTH_EDGES (PM_WAKE_RISING | PM_WAKE_FALLING)
183-
#define PM_WAKE_IGNORE 0xF0
184-
185-
int gpio_pm_wakeup_request(unsigned gpio, unsigned char type);
186-
void gpio_pm_wakeup_free(unsigned gpio);
186+
int gpio_pm_wakeup_ctrl(unsigned gpio, unsigned ctrl);
187187

188188
struct gpio_port_s {
189189
unsigned short data;

arch/blackfin/include/asm/pgtable.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ PTE_BIT_FUNC(mkyoung, |= _PAGE_ACCESSED);
8080
* ZERO_PAGE is a global shared page that is always zero: used
8181
* for zero-mapped memory areas etc..
8282
*/
83-
#define ZERO_PAGE(vaddr) (virt_to_page(0))
83+
#define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page)
84+
extern char empty_zero_page[];
8485

8586
extern unsigned int kobjsize(const void *objp);
8687

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* header file for pseudo instructions
3+
*
4+
* Copyright 2010 Analog Devices Inc.
5+
*
6+
* Licensed under the GPL-2 or later.
7+
*/
8+
9+
#ifndef _BLACKFIN_PSEUDO_
10+
#define _BLACKFIN_PSEUDO_
11+
12+
#include <linux/types.h>
13+
#include <asm/ptrace.h>
14+
15+
extern bool execute_pseudodbg_assert(struct pt_regs *fp, unsigned int opcode);
16+
extern bool execute_pseudodbg(struct pt_regs *fp, unsigned int opcode);
17+
18+
#endif

arch/blackfin/include/asm/string.h

Lines changed: 4 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -12,121 +12,16 @@
1212
#ifdef __KERNEL__ /* only set these up for kernel code */
1313

1414
#define __HAVE_ARCH_STRCPY
15-
extern inline char *strcpy(char *dest, const char *src)
16-
{
17-
char *xdest = dest;
18-
char temp = 0;
19-
20-
__asm__ __volatile__ (
21-
"1:"
22-
"%2 = B [%1++] (Z);"
23-
"B [%0++] = %2;"
24-
"CC = %2;"
25-
"if cc jump 1b (bp);"
26-
: "+&a" (dest), "+&a" (src), "=&d" (temp)
27-
:
28-
: "memory", "CC");
29-
30-
return xdest;
31-
}
15+
extern char *strcpy(char *dest, const char *src);
3216

3317
#define __HAVE_ARCH_STRNCPY
34-
extern inline char *strncpy(char *dest, const char *src, size_t n)
35-
{
36-
char *xdest = dest;
37-
char temp = 0;
38-
39-
if (n == 0)
40-
return xdest;
41-
42-
__asm__ __volatile__ (
43-
"1:"
44-
"%3 = B [%1++] (Z);"
45-
"B [%0++] = %3;"
46-
"CC = %3;"
47-
"if ! cc jump 2f;"
48-
"%2 += -1;"
49-
"CC = %2 == 0;"
50-
"if ! cc jump 1b (bp);"
51-
"jump 4f;"
52-
"2:"
53-
/* if src is shorter than n, we need to null pad bytes now */
54-
"%3 = 0;"
55-
"3:"
56-
"%2 += -1;"
57-
"CC = %2 == 0;"
58-
"if cc jump 4f;"
59-
"B [%0++] = %3;"
60-
"jump 3b;"
61-
"4:"
62-
: "+&a" (dest), "+&a" (src), "+&da" (n), "=&d" (temp)
63-
:
64-
: "memory", "CC");
65-
66-
return xdest;
67-
}
18+
extern char *strncpy(char *dest, const char *src, size_t n);
6819

6920
#define __HAVE_ARCH_STRCMP
70-
extern inline int strcmp(const char *cs, const char *ct)
71-
{
72-
/* need to use int's here so the char's in the assembly don't get
73-
* sign extended incorrectly when we don't want them to be
74-
*/
75-
int __res1, __res2;
76-
77-
__asm__ __volatile__ (
78-
"1:"
79-
"%2 = B[%0++] (Z);" /* get *cs */
80-
"%3 = B[%1++] (Z);" /* get *ct */
81-
"CC = %2 == %3;" /* compare a byte */
82-
"if ! cc jump 2f;" /* not equal, break out */
83-
"CC = %2;" /* at end of cs? */
84-
"if cc jump 1b (bp);" /* no, keep going */
85-
"jump.s 3f;" /* strings are equal */
86-
"2:"
87-
"%2 = %2 - %3;" /* *cs - *ct */
88-
"3:"
89-
: "+&a" (cs), "+&a" (ct), "=&d" (__res1), "=&d" (__res2)
90-
:
91-
: "memory", "CC");
92-
93-
return __res1;
94-
}
21+
extern int strcmp(const char *cs, const char *ct);
9522

9623
#define __HAVE_ARCH_STRNCMP
97-
extern inline int strncmp(const char *cs, const char *ct, size_t count)
98-
{
99-
/* need to use int's here so the char's in the assembly don't get
100-
* sign extended incorrectly when we don't want them to be
101-
*/
102-
int __res1, __res2;
103-
104-
if (!count)
105-
return 0;
106-
107-
__asm__ __volatile__ (
108-
"1:"
109-
"%3 = B[%0++] (Z);" /* get *cs */
110-
"%4 = B[%1++] (Z);" /* get *ct */
111-
"CC = %3 == %4;" /* compare a byte */
112-
"if ! cc jump 3f;" /* not equal, break out */
113-
"CC = %3;" /* at end of cs? */
114-
"if ! cc jump 4f;" /* yes, all done */
115-
"%2 += -1;" /* no, adjust count */
116-
"CC = %2 == 0;"
117-
"if ! cc jump 1b;" /* more to do, keep going */
118-
"2:"
119-
"%3 = 0;" /* strings are equal */
120-
"jump.s 4f;"
121-
"3:"
122-
"%3 = %3 - %4;" /* *cs - *ct */
123-
"4:"
124-
: "+&a" (cs), "+&a" (ct), "+&da" (count), "=&d" (__res1), "=&d" (__res2)
125-
:
126-
: "memory", "CC");
127-
128-
return __res1;
129-
}
24+
extern int strncmp(const char *cs, const char *ct, size_t count);
13025

13126
#define __HAVE_ARCH_MEMSET
13227
extern void *memset(void *s, int c, size_t count);

arch/blackfin/include/asm/tlbflush.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
#include <asm-generic/tlbflush.h>
2+
#define flush_tlb_kernel_range(s, e) do { } while (0)

arch/blackfin/include/asm/trace.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
#ifndef __ASSEMBLY__
2424
extern unsigned long trace_buff_offset;
2525
extern unsigned long software_trace_buff[];
26+
#if defined(CONFIG_DEBUG_VERBOSE)
27+
extern void decode_address(char *buf, unsigned long address);
28+
extern bool get_instruction(unsigned int *val, unsigned short *address);
29+
#else
30+
static inline void decode_address(char *buf, unsigned long address) { }
31+
static inline bool get_instruction(unsigned int *val, unsigned short *address) { return false; }
32+
#endif
2633

2734
/* Trace Macros for C files */
2835

arch/blackfin/kernel/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ extra-y := init_task.o vmlinux.lds
77
obj-y := \
88
entry.o process.o bfin_ksyms.o ptrace.o setup.o signal.o \
99
sys_bfin.o traps.o irqchip.o dma-mapping.o flat.o \
10-
fixed_code.o reboot.o bfin_gpio.o bfin_dma_5xx.o
10+
fixed_code.o reboot.o bfin_gpio.o bfin_dma_5xx.o \
11+
exception.o dumpstack.o
1112

1213
ifeq ($(CONFIG_GENERIC_CLOCKEVENTS),y)
1314
obj-y += time-ts.o
@@ -29,6 +30,8 @@ obj-$(CONFIG_NMI_WATCHDOG) += nmi.o
2930
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
3031
obj-$(CONFIG_EARLY_PRINTK) += shadow_console.o
3132
obj-$(CONFIG_STACKTRACE) += stacktrace.o
33+
obj-$(CONFIG_DEBUG_VERBOSE) += trace.o
34+
obj-$(CONFIG_BFIN_PSEUDODBG_INSNS) += pseudodbg.o
3235

3336
# the kgdb test puts code into L2 and without linker
3437
# relaxation, we need to force long calls to/from it

0 commit comments

Comments
 (0)