You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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: (27 commits) Blackfin: hook up new rt_tgsigqueueinfo syscall Blackfin: improve CLKIN_HZ config default Blackfin: initial support for ftrace grapher Blackfin: initial support for ftrace Blackfin: enable support for LOCKDEP Blackfin: add preliminary support for STACKTRACE Blackfin: move custom sections into sections.h Blackfin: punt unused/wrong mutex-dec.h Blackfin: add support for irqflags Blackfin: add support for bzip2/lzma compressed kernel images Blackfin: convert Kconfig style to def_bool Blackfin: bf548-ezkit: update smsc911x resources Blackfin: update aedos-ipipe code to upstream 1.10-00 Blackfin: bf537-stamp: update ADP5520 resources Blackfin: bf518f-ezbrd: fix SPI CS for SPI flash Blackfin: define SPI IRQ in board resources Blackfin: do not configure the UART early if on wrong processor Blackfin: fix deadlock in SMP IPI handler Blackfin: fix flag storage for irq funcs Blackfin: push down exception oops checking ...
This commit is contained in:
+35
-29
@@ -6,59 +6,65 @@
|
||||
mainmenu "Blackfin Kernel Configuration"
|
||||
|
||||
config MMU
|
||||
bool
|
||||
default n
|
||||
def_bool n
|
||||
|
||||
config FPU
|
||||
bool
|
||||
default n
|
||||
def_bool n
|
||||
|
||||
config RWSEM_GENERIC_SPINLOCK
|
||||
bool
|
||||
default y
|
||||
def_bool y
|
||||
|
||||
config RWSEM_XCHGADD_ALGORITHM
|
||||
bool
|
||||
default n
|
||||
def_bool n
|
||||
|
||||
config BLACKFIN
|
||||
bool
|
||||
default y
|
||||
def_bool y
|
||||
select HAVE_FUNCTION_GRAPH_TRACER
|
||||
select HAVE_FUNCTION_TRACER
|
||||
select HAVE_IDE
|
||||
select HAVE_KERNEL_GZIP
|
||||
select HAVE_KERNEL_BZIP2
|
||||
select HAVE_KERNEL_LZMA
|
||||
select HAVE_OPROFILE
|
||||
select ARCH_WANT_OPTIONAL_GPIOLIB
|
||||
|
||||
config GENERIC_BUG
|
||||
def_bool y
|
||||
depends on BUG
|
||||
|
||||
config ZONE_DMA
|
||||
bool
|
||||
default y
|
||||
def_bool y
|
||||
|
||||
config GENERIC_FIND_NEXT_BIT
|
||||
bool
|
||||
default y
|
||||
def_bool y
|
||||
|
||||
config GENERIC_HWEIGHT
|
||||
bool
|
||||
default y
|
||||
def_bool y
|
||||
|
||||
config GENERIC_HARDIRQS
|
||||
bool
|
||||
default y
|
||||
def_bool y
|
||||
|
||||
config GENERIC_IRQ_PROBE
|
||||
bool
|
||||
default y
|
||||
def_bool y
|
||||
|
||||
config GENERIC_GPIO
|
||||
bool
|
||||
default y
|
||||
def_bool y
|
||||
|
||||
config FORCE_MAX_ZONEORDER
|
||||
int
|
||||
default "14"
|
||||
|
||||
config GENERIC_CALIBRATE_DELAY
|
||||
bool
|
||||
default y
|
||||
def_bool y
|
||||
|
||||
config LOCKDEP_SUPPORT
|
||||
def_bool y
|
||||
|
||||
config STACKTRACE_SUPPORT
|
||||
def_bool y
|
||||
|
||||
config TRACE_IRQFLAGS_SUPPORT
|
||||
def_bool y
|
||||
|
||||
source "init/Kconfig"
|
||||
|
||||
@@ -408,12 +414,12 @@ comment "Clock/PLL Setup"
|
||||
|
||||
config CLKIN_HZ
|
||||
int "Frequency of the crystal on the board in Hz"
|
||||
default "11059200" if BFIN533_STAMP
|
||||
default "27000000" if BFIN533_EZKIT
|
||||
default "25000000" if (BFIN537_STAMP || BFIN527_EZKIT || H8606_HVSISTEMAS || BLACKSTAMP || BFIN526_EZBRD || BFIN538_EZKIT || BFIN518F-EZBRD)
|
||||
default "30000000" if BFIN561_EZKIT
|
||||
default "24576000" if PNAV10
|
||||
default "10000000" if BFIN532_IP0X
|
||||
default "11059200" if BFIN533_STAMP
|
||||
default "24576000" if PNAV10
|
||||
default "25000000" # most people use this
|
||||
default "27000000" if BFIN533_EZKIT
|
||||
default "30000000" if BFIN561_EZKIT
|
||||
help
|
||||
The frequency of CLKIN crystal oscillator on the board in Hz.
|
||||
Warning: This value should match the crystal on the board. Otherwise,
|
||||
|
||||
@@ -137,7 +137,7 @@ archclean:
|
||||
|
||||
INSTALL_PATH ?= /tftpboot
|
||||
boot := arch/$(ARCH)/boot
|
||||
BOOT_TARGETS = vmImage
|
||||
BOOT_TARGETS = vmImage vmImage.bz2 vmImage.gz vmImage.lzma
|
||||
PHONY += $(BOOT_TARGETS) install
|
||||
KBUILD_IMAGE := $(boot)/vmImage
|
||||
|
||||
@@ -150,7 +150,10 @@ install:
|
||||
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
|
||||
|
||||
define archhelp
|
||||
echo '* vmImage - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage)'
|
||||
echo '* vmImage - Alias to selected kernel format (vmImage.gz by default)'
|
||||
echo ' vmImage.bz2 - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.bz2)'
|
||||
echo '* vmImage.gz - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.gz)'
|
||||
echo ' vmImage.lzma - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.lzma)'
|
||||
echo ' install - Install kernel using'
|
||||
echo ' (your) ~/bin/$(CROSS_COMPILE)installkernel or'
|
||||
echo ' (distribution) PATH: $(CROSS_COMPILE)installkernel or'
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
+vmImage
|
||||
vmImage*
|
||||
vmlinux*
|
||||
|
||||
@@ -8,24 +8,41 @@
|
||||
|
||||
MKIMAGE := $(srctree)/scripts/mkuboot.sh
|
||||
|
||||
targets := vmImage
|
||||
extra-y += vmlinux.bin vmlinux.gz
|
||||
targets := vmImage vmImage.bz2 vmImage.gz vmImage.lzma
|
||||
extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma
|
||||
|
||||
quiet_cmd_uimage = UIMAGE $@
|
||||
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(ARCH) -O linux -T kernel \
|
||||
-C gzip -n 'Linux-$(KERNELRELEASE)' -a $(CONFIG_BOOT_LOAD) \
|
||||
-C $(2) -n 'Linux-$(KERNELRELEASE)' -a $(CONFIG_BOOT_LOAD) \
|
||||
-e $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}') \
|
||||
-d $< $@
|
||||
|
||||
$(obj)/vmlinux.bin: vmlinux FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
|
||||
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
|
||||
$(call if_changed,gzip)
|
||||
|
||||
$(obj)/vmImage: $(obj)/vmlinux.gz
|
||||
$(call if_changed,uimage)
|
||||
@$(kecho) 'Kernel: $@ is ready'
|
||||
$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
|
||||
$(call if_changed,bzip2)
|
||||
|
||||
$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
|
||||
$(call if_changed,lzma)
|
||||
|
||||
$(obj)/vmImage.bz2: $(obj)/vmlinux.bin.bz2
|
||||
$(call if_changed,uimage,bzip2)
|
||||
|
||||
$(obj)/vmImage.gz: $(obj)/vmlinux.bin.gz
|
||||
$(call if_changed,uimage,gzip)
|
||||
|
||||
$(obj)/vmImage.lzma: $(obj)/vmlinux.bin.lzma
|
||||
$(call if_changed,uimage,lzma)
|
||||
|
||||
suffix-$(CONFIG_KERNEL_GZIP) := gz
|
||||
suffix-$(CONFIG_KERNEL_BZIP2) := bz2
|
||||
suffix-$(CONFIG_KERNEL_LZMA) := lzma
|
||||
$(obj)/vmImage: $(obj)/vmImage.$(suffix-y)
|
||||
@ln -sf $(notdir $<) $@
|
||||
|
||||
install:
|
||||
sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
|
||||
|
||||
@@ -90,7 +90,7 @@ static inline int atomic_test_mask(int mask, atomic_t *v)
|
||||
|
||||
static inline void atomic_add(int i, atomic_t *v)
|
||||
{
|
||||
long flags;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save_hw(flags);
|
||||
v->counter += i;
|
||||
@@ -99,7 +99,7 @@ static inline void atomic_add(int i, atomic_t *v)
|
||||
|
||||
static inline void atomic_sub(int i, atomic_t *v)
|
||||
{
|
||||
long flags;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save_hw(flags);
|
||||
v->counter -= i;
|
||||
@@ -110,7 +110,7 @@ static inline void atomic_sub(int i, atomic_t *v)
|
||||
static inline int atomic_add_return(int i, atomic_t *v)
|
||||
{
|
||||
int __temp = 0;
|
||||
long flags;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save_hw(flags);
|
||||
v->counter += i;
|
||||
@@ -124,7 +124,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
|
||||
static inline int atomic_sub_return(int i, atomic_t *v)
|
||||
{
|
||||
int __temp = 0;
|
||||
long flags;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save_hw(flags);
|
||||
v->counter -= i;
|
||||
@@ -136,7 +136,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
|
||||
|
||||
static inline void atomic_inc(volatile atomic_t *v)
|
||||
{
|
||||
long flags;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save_hw(flags);
|
||||
v->counter++;
|
||||
@@ -145,7 +145,7 @@ static inline void atomic_inc(volatile atomic_t *v)
|
||||
|
||||
static inline void atomic_dec(volatile atomic_t *v)
|
||||
{
|
||||
long flags;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save_hw(flags);
|
||||
v->counter--;
|
||||
@@ -154,7 +154,7 @@ static inline void atomic_dec(volatile atomic_t *v)
|
||||
|
||||
static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
|
||||
{
|
||||
long flags;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save_hw(flags);
|
||||
v->counter &= ~mask;
|
||||
@@ -163,7 +163,7 @@ static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
|
||||
|
||||
static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
|
||||
{
|
||||
long flags;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save_hw(flags);
|
||||
v->counter |= mask;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <asm-generic/sections.h>
|
||||
#include <asm/sections.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/user.h>
|
||||
#include <linux/linkage.h>
|
||||
@@ -99,15 +99,6 @@ extern const char bfin_board_name[];
|
||||
extern unsigned long bfin_sic_iwr[];
|
||||
extern unsigned vr_wakeup;
|
||||
extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
|
||||
extern unsigned long _ramstart, _ramend, _rambase;
|
||||
extern unsigned long memory_start, memory_end, physical_mem_end;
|
||||
extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
|
||||
_ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _sbss_b_l1[], _ebss_b_l1[],
|
||||
_stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[],
|
||||
_ebss_l2[], _l2_lma_start[];
|
||||
|
||||
/* only used when MTD_UCLINUX */
|
||||
extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
|
||||
|
||||
#ifdef CONFIG_BFIN_ICACHE_LOCK
|
||||
extern void cache_grab_lock(int way);
|
||||
|
||||
@@ -109,7 +109,8 @@ static inline void clear_bit(int nr, volatile unsigned long *addr)
|
||||
|
||||
static inline void change_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
int mask, flags;
|
||||
int mask;
|
||||
unsigned long flags;
|
||||
unsigned long *ADDR = (unsigned long *)addr;
|
||||
|
||||
ADDR += nr >> 5;
|
||||
|
||||
@@ -2,13 +2,58 @@
|
||||
#define _BLACKFIN_BUG_H
|
||||
|
||||
#ifdef CONFIG_BUG
|
||||
#define HAVE_ARCH_BUG
|
||||
|
||||
#define BUG() do { \
|
||||
dump_bfin_trace_buffer(); \
|
||||
printk(KERN_EMERG "BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
|
||||
panic("BUG!"); \
|
||||
} while (0)
|
||||
#define BFIN_BUG_OPCODE 0xefcd
|
||||
|
||||
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
||||
|
||||
#define _BUG_OR_WARN(flags) \
|
||||
asm volatile( \
|
||||
"1: .hword %0\n" \
|
||||
" .section __bug_table,\"a\",@progbits\n" \
|
||||
"2: .long 1b\n" \
|
||||
" .long %1\n" \
|
||||
" .short %2\n" \
|
||||
" .short %3\n" \
|
||||
" .org 2b + %4\n" \
|
||||
" .previous" \
|
||||
: \
|
||||
: "i"(BFIN_BUG_OPCODE), "i"(__FILE__), \
|
||||
"i"(__LINE__), "i"(flags), \
|
||||
"i"(sizeof(struct bug_entry)))
|
||||
|
||||
#else
|
||||
|
||||
#define _BUG_OR_WARN(flags) \
|
||||
asm volatile( \
|
||||
"1: .hword %0\n" \
|
||||
" .section __bug_table,\"a\",@progbits\n" \
|
||||
"2: .long 1b\n" \
|
||||
" .short %1\n" \
|
||||
" .org 2b + %2\n" \
|
||||
" .previous" \
|
||||
: \
|
||||
: "i"(BFIN_BUG_OPCODE), "i"(flags), \
|
||||
"i"(sizeof(struct bug_entry)))
|
||||
|
||||
#endif /* CONFIG_DEBUG_BUGVERBOSE */
|
||||
|
||||
#define BUG() \
|
||||
do { \
|
||||
_BUG_OR_WARN(0); \
|
||||
for (;;); \
|
||||
} while (0)
|
||||
|
||||
#define WARN_ON(condition) \
|
||||
({ \
|
||||
int __ret_warn_on = !!(condition); \
|
||||
if (unlikely(__ret_warn_on)) \
|
||||
_BUG_OR_WARN(BUGFLAG_WARNING); \
|
||||
unlikely(__ret_warn_on); \
|
||||
})
|
||||
|
||||
#define HAVE_ARCH_BUG
|
||||
#define HAVE_ARCH_WARN_ON
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -34,9 +34,13 @@
|
||||
#define L1_CACHE_SHIFT_MAX 5
|
||||
|
||||
#if defined(CONFIG_SMP) && \
|
||||
!defined(CONFIG_BFIN_CACHE_COHERENT) && \
|
||||
defined(CONFIG_BFIN_DCACHE)
|
||||
#define __ARCH_SYNC_CORE_DCACHE
|
||||
!defined(CONFIG_BFIN_CACHE_COHERENT)
|
||||
# if defined(CONFIG_BFIN_ICACHE)
|
||||
# define __ARCH_SYNC_CORE_ICACHE
|
||||
# endif
|
||||
# if defined(CONFIG_BFIN_DCACHE)
|
||||
# define __ARCH_SYNC_CORE_DCACHE
|
||||
# endif
|
||||
#ifndef __ASSEMBLY__
|
||||
asmlinkage void __raw_smp_mark_barrier_asm(void);
|
||||
asmlinkage void __raw_smp_check_barrier_asm(void);
|
||||
@@ -51,6 +55,7 @@ static inline void smp_check_barrier(void)
|
||||
}
|
||||
|
||||
void resync_core_dcache(void);
|
||||
void resync_core_icache(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ extern void blackfin_dcache_flush_range(unsigned long start_address, unsigned lo
|
||||
extern void blackfin_dcache_invalidate_range(unsigned long start_address, unsigned long end_address);
|
||||
extern void blackfin_dflush_page(void *page);
|
||||
extern void blackfin_invalidate_entire_dcache(void);
|
||||
extern void blackfin_invalidate_entire_icache(void);
|
||||
|
||||
#define flush_dcache_mmap_lock(mapping) do { } while (0)
|
||||
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
|
||||
@@ -97,7 +98,7 @@ do { memcpy(dst, src, len); \
|
||||
extern unsigned long reserved_mem_dcache_on;
|
||||
extern unsigned long reserved_mem_icache_on;
|
||||
|
||||
static inline int bfin_addr_dcachable(unsigned long addr)
|
||||
static inline int bfin_addr_dcacheable(unsigned long addr)
|
||||
{
|
||||
#ifdef CONFIG_BFIN_DCACHE
|
||||
if (addr < (_ramend - DMA_UNCACHED_REGION))
|
||||
|
||||
@@ -34,6 +34,7 @@ struct blackfin_cpudata {
|
||||
unsigned int dmemctl;
|
||||
unsigned long loops_per_jiffy;
|
||||
unsigned long dcache_invld_count;
|
||||
unsigned long icache_invld_count;
|
||||
};
|
||||
|
||||
DECLARE_PER_CPU(struct blackfin_cpudata, cpu_data);
|
||||
|
||||
@@ -1 +1,13 @@
|
||||
/* empty */
|
||||
/*
|
||||
* Blackfin ftrace code
|
||||
*
|
||||
* Copyright 2009 Analog Devices Inc.
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_BFIN_FTRACE_H__
|
||||
#define __ASM_BFIN_FTRACE_H__
|
||||
|
||||
#define MCOUNT_INSN_SIZE 8 /* sizeof mcount call: LINK + CALL */
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/traps.h>
|
||||
|
||||
#define IPIPE_ARCH_STRING "1.9-01"
|
||||
#define IPIPE_ARCH_STRING "1.10-00"
|
||||
#define IPIPE_MAJOR_NUMBER 1
|
||||
#define IPIPE_MINOR_NUMBER 9
|
||||
#define IPIPE_PATCH_NUMBER 1
|
||||
#define IPIPE_MINOR_NUMBER 10
|
||||
#define IPIPE_PATCH_NUMBER 0
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#error "I-pipe/blackfin: SMP not implemented"
|
||||
@@ -54,10 +54,11 @@ do { \
|
||||
|
||||
#define task_hijacked(p) \
|
||||
({ \
|
||||
int __x__ = ipipe_current_domain != ipipe_root_domain; \
|
||||
/* We would need to clear the SYNC flag for the root domain */ \
|
||||
/* over the current processor in SMP mode. */ \
|
||||
local_irq_enable_hw(); __x__; \
|
||||
int __x__ = __ipipe_root_domain_p; \
|
||||
__clear_bit(IPIPE_SYNC_FLAG, &ipipe_root_cpudom_var(status)); \
|
||||
if (__x__) \
|
||||
local_irq_enable_hw(); \
|
||||
!__x__; \
|
||||
})
|
||||
|
||||
struct ipipe_domain;
|
||||
@@ -179,23 +180,24 @@ static inline unsigned long __ipipe_ffnz(unsigned long ul)
|
||||
|
||||
#define __ipipe_run_isr(ipd, irq) \
|
||||
do { \
|
||||
if (ipd == ipipe_root_domain) { \
|
||||
if (!__ipipe_pipeline_head_p(ipd)) \
|
||||
local_irq_enable_hw(); \
|
||||
if (ipipe_virtual_irq_p(irq)) \
|
||||
if (ipd == ipipe_root_domain) { \
|
||||
if (unlikely(ipipe_virtual_irq_p(irq))) { \
|
||||
irq_enter(); \
|
||||
ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \
|
||||
else \
|
||||
irq_exit(); \
|
||||
} else \
|
||||
ipd->irqs[irq].handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs)); \
|
||||
local_irq_disable_hw(); \
|
||||
} else { \
|
||||
__clear_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \
|
||||
local_irq_enable_nohead(ipd); \
|
||||
ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \
|
||||
/* Attempt to exit the outer interrupt level before \
|
||||
* starting the deferred IRQ processing. */ \
|
||||
local_irq_disable_nohead(ipd); \
|
||||
__ipipe_run_irqtail(); \
|
||||
__set_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \
|
||||
} \
|
||||
local_irq_disable_hw(); \
|
||||
} while (0)
|
||||
|
||||
#define __ipipe_syscall_watched_p(p, sc) \
|
||||
|
||||
@@ -17,270 +17,17 @@
|
||||
#ifndef _BFIN_IRQ_H_
|
||||
#define _BFIN_IRQ_H_
|
||||
|
||||
/* SYS_IRQS and NR_IRQS are defined in <mach-bf5xx/irq.h>*/
|
||||
#include <linux/irqflags.h>
|
||||
|
||||
/* SYS_IRQS and NR_IRQS are defined in <mach-bf5xx/irq.h> */
|
||||
#include <mach/irq.h>
|
||||
#include <asm/pda.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/* Forward decl needed due to cdef inter dependencies */
|
||||
static inline uint32_t __pure bfin_dspid(void);
|
||||
# define blackfin_core_id() (bfin_dspid() & 0xff)
|
||||
# define bfin_irq_flags cpu_pda[blackfin_core_id()].imask
|
||||
#else
|
||||
extern unsigned long bfin_irq_flags;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IPIPE
|
||||
|
||||
#include <linux/ipipe_trace.h>
|
||||
|
||||
void __ipipe_unstall_root(void);
|
||||
|
||||
void __ipipe_restore_root(unsigned long flags);
|
||||
|
||||
#ifdef CONFIG_DEBUG_HWERR
|
||||
# define __all_masked_irq_flags 0x3f
|
||||
# define __save_and_cli_hw(x) \
|
||||
__asm__ __volatile__( \
|
||||
"cli %0;" \
|
||||
"sti %1;" \
|
||||
: "=&d"(x) \
|
||||
: "d" (0x3F) \
|
||||
)
|
||||
#else
|
||||
# define __all_masked_irq_flags 0x1f
|
||||
# define __save_and_cli_hw(x) \
|
||||
__asm__ __volatile__( \
|
||||
"cli %0;" \
|
||||
: "=&d"(x) \
|
||||
)
|
||||
#endif
|
||||
|
||||
#define irqs_enabled_from_flags_hw(x) ((x) != __all_masked_irq_flags)
|
||||
#define raw_irqs_disabled_flags(flags) (!irqs_enabled_from_flags_hw(flags))
|
||||
#define local_test_iflag_hw(x) irqs_enabled_from_flags_hw(x)
|
||||
|
||||
#define local_save_flags(x) \
|
||||
do { \
|
||||
(x) = __ipipe_test_root() ? \
|
||||
__all_masked_irq_flags : bfin_irq_flags; \
|
||||
barrier(); \
|
||||
} while (0)
|
||||
|
||||
#define local_irq_save(x) \
|
||||
do { \
|
||||
(x) = __ipipe_test_and_stall_root() ? \
|
||||
__all_masked_irq_flags : bfin_irq_flags; \
|
||||
barrier(); \
|
||||
} while (0)
|
||||
|
||||
static inline void local_irq_restore(unsigned long x)
|
||||
{
|
||||
barrier();
|
||||
__ipipe_restore_root(x == __all_masked_irq_flags);
|
||||
}
|
||||
|
||||
#define local_irq_disable() \
|
||||
do { \
|
||||
__ipipe_stall_root(); \
|
||||
barrier(); \
|
||||
} while (0)
|
||||
|
||||
static inline void local_irq_enable(void)
|
||||
{
|
||||
barrier();
|
||||
__ipipe_unstall_root();
|
||||
}
|
||||
|
||||
#define irqs_disabled() __ipipe_test_root()
|
||||
|
||||
#define local_save_flags_hw(x) \
|
||||
__asm__ __volatile__( \
|
||||
"cli %0;" \
|
||||
"sti %0;" \
|
||||
: "=d"(x) \
|
||||
)
|
||||
|
||||
#define irqs_disabled_hw() \
|
||||
({ \
|
||||
unsigned long flags; \
|
||||
local_save_flags_hw(flags); \
|
||||
!irqs_enabled_from_flags_hw(flags); \
|
||||
})
|
||||
|
||||
static inline unsigned long raw_mangle_irq_bits(int virt, unsigned long real)
|
||||
{
|
||||
/* Merge virtual and real interrupt mask bits into a single
|
||||
32bit word. */
|
||||
return (real & ~(1 << 31)) | ((virt != 0) << 31);
|
||||
}
|
||||
|
||||
static inline int raw_demangle_irq_bits(unsigned long *x)
|
||||
{
|
||||
int virt = (*x & (1 << 31)) != 0;
|
||||
*x &= ~(1L << 31);
|
||||
return virt;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IPIPE_TRACE_IRQSOFF
|
||||
|
||||
#define local_irq_disable_hw() \
|
||||
do { \
|
||||
int _tmp_dummy; \
|
||||
if (!irqs_disabled_hw()) \
|
||||
ipipe_trace_begin(0x80000000); \
|
||||
__asm__ __volatile__ ("cli %0;" : "=d" (_tmp_dummy) : ); \
|
||||
} while (0)
|
||||
|
||||
#define local_irq_enable_hw() \
|
||||
do { \
|
||||
if (irqs_disabled_hw()) \
|
||||
ipipe_trace_end(0x80000000); \
|
||||
__asm__ __volatile__ ("sti %0;" : : "d"(bfin_irq_flags)); \
|
||||
} while (0)
|
||||
|
||||
#define local_irq_save_hw(x) \
|
||||
do { \
|
||||
__save_and_cli_hw(x); \
|
||||
if (local_test_iflag_hw(x)) \
|
||||
ipipe_trace_begin(0x80000001); \
|
||||
} while (0)
|
||||
|
||||
#define local_irq_restore_hw(x) \
|
||||
do { \
|
||||
if (local_test_iflag_hw(x)) { \
|
||||
ipipe_trace_end(0x80000001); \
|
||||
local_irq_enable_hw_notrace(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define local_irq_disable_hw_notrace() \
|
||||
do { \
|
||||
int _tmp_dummy; \
|
||||
__asm__ __volatile__ ("cli %0;" : "=d" (_tmp_dummy) : ); \
|
||||
} while (0)
|
||||
|
||||
#define local_irq_enable_hw_notrace() \
|
||||
__asm__ __volatile__( \
|
||||
"sti %0;" \
|
||||
: \
|
||||
: "d"(bfin_irq_flags) \
|
||||
)
|
||||
|
||||
#define local_irq_save_hw_notrace(x) __save_and_cli_hw(x)
|
||||
|
||||
#define local_irq_restore_hw_notrace(x) \
|
||||
do { \
|
||||
if (local_test_iflag_hw(x)) \
|
||||
local_irq_enable_hw_notrace(); \
|
||||
} while (0)
|
||||
|
||||
#else /* CONFIG_IPIPE_TRACE_IRQSOFF */
|
||||
|
||||
#define local_irq_enable_hw() \
|
||||
__asm__ __volatile__( \
|
||||
"sti %0;" \
|
||||
: \
|
||||
: "d"(bfin_irq_flags) \
|
||||
)
|
||||
|
||||
#define local_irq_disable_hw() \
|
||||
do { \
|
||||
int _tmp_dummy; \
|
||||
__asm__ __volatile__ ( \
|
||||
"cli %0;" \
|
||||
: "=d" (_tmp_dummy)); \
|
||||
} while (0)
|
||||
|
||||
#define local_irq_restore_hw(x) \
|
||||
do { \
|
||||
if (irqs_enabled_from_flags_hw(x)) \
|
||||
local_irq_enable_hw(); \
|
||||
} while (0)
|
||||
|
||||
#define local_irq_save_hw(x) __save_and_cli_hw(x)
|
||||
|
||||
#define local_irq_disable_hw_notrace() local_irq_disable_hw()
|
||||
#define local_irq_enable_hw_notrace() local_irq_enable_hw()
|
||||
#define local_irq_save_hw_notrace(x) local_irq_save_hw(x)
|
||||
#define local_irq_restore_hw_notrace(x) local_irq_restore_hw(x)
|
||||
|
||||
#endif /* CONFIG_IPIPE_TRACE_IRQSOFF */
|
||||
|
||||
#else /* !CONFIG_IPIPE */
|
||||
|
||||
/*
|
||||
* Interrupt configuring macros.
|
||||
*/
|
||||
#define local_irq_disable() \
|
||||
do { \
|
||||
int __tmp_dummy; \
|
||||
__asm__ __volatile__( \
|
||||
"cli %0;" \
|
||||
: "=d" (__tmp_dummy) \
|
||||
); \
|
||||
} while (0)
|
||||
|
||||
#define local_irq_enable() \
|
||||
__asm__ __volatile__( \
|
||||
"sti %0;" \
|
||||
: \
|
||||
: "d" (bfin_irq_flags) \
|
||||
)
|
||||
|
||||
#ifdef CONFIG_DEBUG_HWERR
|
||||
# define __save_and_cli(x) \
|
||||
__asm__ __volatile__( \
|
||||
"cli %0;" \
|
||||
"sti %1;" \
|
||||
: "=&d" (x) \
|
||||
: "d" (0x3F) \
|
||||
)
|
||||
#else
|
||||
# define __save_and_cli(x) \
|
||||
__asm__ __volatile__( \
|
||||
"cli %0;" \
|
||||
: "=&d" (x) \
|
||||
)
|
||||
#endif
|
||||
|
||||
#define local_save_flags(x) \
|
||||
__asm__ __volatile__( \
|
||||
"cli %0;" \
|
||||
"sti %0;" \
|
||||
: "=d" (x) \
|
||||
)
|
||||
|
||||
#ifdef CONFIG_DEBUG_HWERR
|
||||
#define irqs_enabled_from_flags(x) (((x) & ~0x3f) != 0)
|
||||
#else
|
||||
#define irqs_enabled_from_flags(x) ((x) != 0x1f)
|
||||
#endif
|
||||
|
||||
#define local_irq_restore(x) \
|
||||
do { \
|
||||
if (irqs_enabled_from_flags(x)) \
|
||||
local_irq_enable(); \
|
||||
} while (0)
|
||||
|
||||
/* For spinlocks etc */
|
||||
#define local_irq_save(x) __save_and_cli(x)
|
||||
|
||||
#define irqs_disabled() \
|
||||
({ \
|
||||
unsigned long flags; \
|
||||
local_save_flags(flags); \
|
||||
!irqs_enabled_from_flags(flags); \
|
||||
})
|
||||
|
||||
#define local_irq_save_hw(x) local_irq_save(x)
|
||||
#define local_irq_restore_hw(x) local_irq_restore(x)
|
||||
#define local_irq_enable_hw() local_irq_enable()
|
||||
#define local_irq_disable_hw() local_irq_disable()
|
||||
#define irqs_disabled_hw() irqs_disabled()
|
||||
|
||||
#endif /* !CONFIG_IPIPE */
|
||||
/* Xenomai IPIPE helpers */
|
||||
#define local_irq_restore_hw(x) local_irq_restore(x)
|
||||
#define local_irq_save_hw(x) local_irq_save(x)
|
||||
#define local_irq_enable_hw(x) local_irq_enable(x)
|
||||
#define local_irq_disable_hw(x) local_irq_disable(x)
|
||||
#define irqs_disabled_hw(x) irqs_disabled(x)
|
||||
|
||||
#if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE)
|
||||
# define NOP_PAD_ANOMALY_05000244 "nop; nop;"
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* interface to Blackfin CEC
|
||||
*
|
||||
* Copyright 2009 Analog Devices Inc.
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_BFIN_IRQFLAGS_H__
|
||||
#define __ASM_BFIN_IRQFLAGS_H__
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
# include <asm/pda.h>
|
||||
# include <asm/processor.h>
|
||||
/* Forward decl needed due to cdef inter dependencies */
|
||||
static inline uint32_t __pure bfin_dspid(void);
|
||||
# define blackfin_core_id() (bfin_dspid() & 0xff)
|
||||
# define bfin_irq_flags cpu_pda[blackfin_core_id()].imask
|
||||
#else
|
||||
extern unsigned long bfin_irq_flags;
|
||||
#endif
|
||||
|
||||
static inline void bfin_sti(unsigned long flags)
|
||||
{
|
||||
asm volatile("sti %0;" : : "d" (flags));
|
||||
}
|
||||
|
||||
static inline unsigned long bfin_cli(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
asm volatile("cli %0;" : "=d" (flags));
|
||||
return flags;
|
||||
}
|
||||
|
||||
static inline void raw_local_irq_disable(void)
|
||||
{
|
||||
bfin_cli();
|
||||
}
|
||||
static inline void raw_local_irq_enable(void)
|
||||
{
|
||||
bfin_sti(bfin_irq_flags);
|
||||
}
|
||||
|
||||
#define raw_local_save_flags(flags) do { (flags) = bfin_read_IMASK(); } while (0)
|
||||
|
||||
#define raw_irqs_disabled_flags(flags) (((flags) & ~0x3f) == 0)
|
||||
|
||||
static inline void raw_local_irq_restore(unsigned long flags)
|
||||
{
|
||||
if (!raw_irqs_disabled_flags(flags))
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
static inline unsigned long __raw_local_irq_save(void)
|
||||
{
|
||||
unsigned long flags = bfin_cli();
|
||||
#ifdef CONFIG_DEBUG_HWERR
|
||||
bfin_sti(0x3f);
|
||||
#endif
|
||||
return flags;
|
||||
}
|
||||
#define raw_local_irq_save(flags) do { (flags) = __raw_local_irq_save(); } while (0)
|
||||
|
||||
#endif
|
||||
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
* include/asm-generic/mutex-dec.h
|
||||
*
|
||||
* Generic implementation of the mutex fastpath, based on atomic
|
||||
* decrement/increment.
|
||||
*/
|
||||
#ifndef _ASM_GENERIC_MUTEX_DEC_H
|
||||
#define _ASM_GENERIC_MUTEX_DEC_H
|
||||
|
||||
/**
|
||||
* __mutex_fastpath_lock - try to take the lock by moving the count
|
||||
* from 1 to a 0 value
|
||||
* @count: pointer of type atomic_t
|
||||
* @fail_fn: function to call if the original value was not 1
|
||||
*
|
||||
* Change the count from 1 to a value lower than 1, and call <fail_fn> if
|
||||
* it wasn't 1 originally. This function MUST leave the value lower than
|
||||
* 1 even when the "1" assertion wasn't true.
|
||||
*/
|
||||
static inline void
|
||||
__mutex_fastpath_lock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
|
||||
{
|
||||
if (unlikely(atomic_dec_return(count) < 0))
|
||||
fail_fn(count);
|
||||
else
|
||||
smp_mb();
|
||||
}
|
||||
|
||||
/**
|
||||
* __mutex_fastpath_lock_retval - try to take the lock by moving the count
|
||||
* from 1 to a 0 value
|
||||
* @count: pointer of type atomic_t
|
||||
* @fail_fn: function to call if the original value was not 1
|
||||
*
|
||||
* Change the count from 1 to a value lower than 1, and call <fail_fn> if
|
||||
* it wasn't 1 originally. This function returns 0 if the fastpath succeeds,
|
||||
* or anything the slow path function returns.
|
||||
*/
|
||||
static inline int
|
||||
__mutex_fastpath_lock_retval(atomic_t *count, fastcall int (*fail_fn)(atomic_t *))
|
||||
{
|
||||
if (unlikely(atomic_dec_return(count) < 0))
|
||||
return fail_fn(count);
|
||||
else {
|
||||
smp_mb();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* __mutex_fastpath_unlock - try to promote the count from 0 to 1
|
||||
* @count: pointer of type atomic_t
|
||||
* @fail_fn: function to call if the original value was not 0
|
||||
*
|
||||
* Try to promote the count from 0 to 1. If it wasn't 0, call <fail_fn>.
|
||||
* In the failure case, this function is allowed to either set the value to
|
||||
* 1, or to set it to a value lower than 1.
|
||||
*
|
||||
* If the implementation sets it to a value of lower than 1, then the
|
||||
* __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs
|
||||
* to return 0 otherwise.
|
||||
*/
|
||||
static inline void
|
||||
__mutex_fastpath_unlock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
|
||||
{
|
||||
smp_mb();
|
||||
if (unlikely(atomic_inc_return(count) <= 0))
|
||||
fail_fn(count);
|
||||
}
|
||||
|
||||
#define __mutex_slowpath_needs_to_unlock() 1
|
||||
|
||||
/**
|
||||
* __mutex_fastpath_trylock - try to acquire the mutex, without waiting
|
||||
*
|
||||
* @count: pointer of type atomic_t
|
||||
* @fail_fn: fallback function
|
||||
*
|
||||
* Change the count from 1 to a value lower than 1, and return 0 (failure)
|
||||
* if it wasn't 1 originally, or return 1 (success) otherwise. This function
|
||||
* MUST leave the value lower than 1 even when the "1" assertion wasn't true.
|
||||
* Additionally, if the value was < 0 originally, this function must not leave
|
||||
* it to 0 on failure.
|
||||
*
|
||||
* If the architecture has no effective trylock variant, it should call the
|
||||
* <fail_fn> spinlock-based trylock variant unconditionally.
|
||||
*/
|
||||
static inline int
|
||||
__mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
|
||||
{
|
||||
/*
|
||||
* We have two variants here. The cmpxchg based one is the best one
|
||||
* because it never induce a false contention state. It is included
|
||||
* here because architectures using the inc/dec algorithms over the
|
||||
* xchg ones are much more likely to support cmpxchg natively.
|
||||
*
|
||||
* If not we fall back to the spinlock based variant - that is
|
||||
* just as efficient (and simpler) as a 'destructive' probing of
|
||||
* the mutex state would be.
|
||||
*/
|
||||
#ifdef __HAVE_ARCH_CMPXCHG
|
||||
if (likely(atomic_cmpxchg(count, 1, 0) == 1)) {
|
||||
smp_mb();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
return fail_fn(count);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,4 +4,15 @@
|
||||
/* nothing to see, move along */
|
||||
#include <asm-generic/sections.h>
|
||||
|
||||
/* only used when MTD_UCLINUX */
|
||||
extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
|
||||
|
||||
extern unsigned long _ramstart, _ramend, _rambase;
|
||||
extern unsigned long memory_start, memory_end, physical_mem_end;
|
||||
|
||||
extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
|
||||
_ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _sbss_b_l1[], _ebss_b_l1[],
|
||||
_stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[],
|
||||
_ebss_l2[], _l2_lma_start[];
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
#define _BLACKFIN_SYSTEM_H
|
||||
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/irqflags.h>
|
||||
#include <mach/anomaly.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/pda.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
/*
|
||||
|
||||
@@ -380,8 +380,9 @@
|
||||
#define __NR_inotify_init1 365
|
||||
#define __NR_preadv 366
|
||||
#define __NR_pwritev 367
|
||||
#define __NR_rt_tgsigqueueinfo 368
|
||||
|
||||
#define __NR_syscall 368
|
||||
#define __NR_syscall 369
|
||||
#define NR_syscalls __NR_syscall
|
||||
|
||||
/* Old optional stuff no one actually uses */
|
||||
|
||||
@@ -15,6 +15,10 @@ else
|
||||
obj-y += time.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_FUNCTION_TRACER) += ftrace-entry.o
|
||||
obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
|
||||
CFLAGS_REMOVE_ftrace.o = -pg
|
||||
|
||||
obj-$(CONFIG_IPIPE) += ipipe.o
|
||||
obj-$(CONFIG_IPIPE_TRACE_MCOUNT) += mcount.o
|
||||
obj-$(CONFIG_BFIN_GPTIMERS) += gptimers.o
|
||||
@@ -23,6 +27,7 @@ obj-$(CONFIG_MODULES) += module.o
|
||||
obj-$(CONFIG_KGDB) += kgdb.o
|
||||
obj-$(CONFIG_KGDB_TESTS) += kgdb_test.o
|
||||
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
||||
obj-$(CONFIG_STACKTRACE) += stacktrace.o
|
||||
|
||||
# the kgdb test puts code into L2 and without linker
|
||||
# relaxation, we need to force long calls to/from it
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user