Blackfin updates for 2.6.32
Subsystems (2)
cover Blackfin updates for 2.6.32
Minor highlights:
- shadow console to help with really early kernel output
- proper decoding of double fault handling
Otherwise, we've got the normal bug fixes, IPIPE updates, and clean ups.
Barry Song (9):
Blackfin: bf537-stamp: add resources for AD1938 audio card
Blackfin: bf538: add bfin_clear_PPI_STATUS() helper
Blackfin: bf537-stamp: update AD714x resources
Blackfin: bf537-stamp: drop ATA interrupt probe workaround
Blackfin: cm-bf527/bf537-stamp: fix dm9000 resources
Blackfin: bf538-ezkit: add resources for parallel flash
Blackfin: bf537-stamp: update ad1836 resources
Blackfin: delete '-spi' suffix in ad1836/ad1938 driver name
Blackfin: bf538-ezkit: add SPI IRQ resources
Bernd Schmidt (1):
Blackfin: add ICPLB coverage for async banks
Cliff Cai (1):
Blackfin: bf533-stamp: fix typo in SPI frequency for ad1836 codec
Graf Yang (5):
Blackfin: fix MPU handling of invalid memory accesses
Blackfin: improve double fault debug handling
Blackfin: SMP port does not yet support cpu frequency scaling
Blackfin: handle the core timer interrupt with handle_percpu_irq on
SMP
Blackfin: swap clocksource ratings for gptimer/cycles
Harald Krapfenbauer (2):
Blackfin: cm-bf537u: split board from cm-bf537e
Blackfin: update cm board resources
Ingo Molnar (1):
Blackfin: Fix link errors with binutils 2.19 and GCC 4.3
Jean Delvare (1):
Blackfin: clean up duplicate I2C device type definitions
Michael Hennerich (6):
Blackfin: bf537-stamp: update ADP5588 header name
Blackfin: rename PCF8574 driver config
Blackfin: convert boards to use platform data with smc91x
Blackfin: remove useless duplicated assignment in gpio code
Blackfin: fix spelling in a few comments
Blackfin: bf537-stamp: add adp5588 gpio resources
Mike Frysinger (15):
Blackfin: cleanup traps decode_address() a bit
Blackfin: convert ptrace to new memory functions
Blackfin: cleanup printk() usage in module code
Blackfin: convert malloc()/memset() to zalloc() in module code
Blackfin: cleanup module section checking
Blackfin: fix module reloc handling for all memory regions
Blackfin: push SRAM locks down into related ifdefs
Blackfin: add support for common FDPIC ptrace requests
Blackfin: drop unused MMR defines that only cause bad code to be
written
Blackfin: fix BF522/BF523 max VCO mixup
Blackfin: drop board resources for dead devices (pbx/ad9960)
Blackfin: punt dead cache locking code
Blackfin: optimize fixed code handling for the most common case
Blackfin: add some isram-driver self tests
Blackfin: update ftrace_push_return_trace() breakage
Mingquan Pan (1):
Blackfin: use KERN_ALERT in all kgdb_test output
Philippe Gerum (10):
Blackfin: checkpatch --file arch/blackfin/kernel/ipipe.c
Blackfin: fix misnomer of some I-pipe helpers
Blackfin: export show_stack() to modules
Blackfin: allow high priority domains to preempt schedule_tail()
Blackfin: use generic name for EVT14 handler
Blackfin: reuse evt_evt14 handler to perform irqtail epilogue
Blackfin: allow EVT5 to preempt irqtail prologue (CONFIG_DEBUG_HWERR)
Blackfin: document __ipipe_call_irqtail
Blackfin: sanitize manual control of IPEND[4]
Blackfin: inline I-pipe bypass code in ret_from_exception
Robin Getz (7):
Blackfin: make EVT3->EVT5 lowering more robust wrt IPEND[4]
Blackfin: reject outdated/unused/wrong relocation types
Blackfin: clean up early memory setup code
Blackfin: add an early shadow console
Blackfin: catch hardware errors earlier during booting
Blackfin: workaround anomaly 05000283
Blackfin: fix typo in isram_write()
Roel Kluin (1):
Blackfin: fix read buffer overflow
Sonic Zhang (3):
Blackfin: unify duplicated SMP checks in L2 cache kconfig
Blackfin: do not try displaying the end of the stack
Blackfin: increase default async timings for parallel flashes
Stefan Pledl (2):
Blackfin: fix BF548 UART0 DMA IRQ translation
Blackfin: bf548-ezkit: fix incorrect LCD size parameters
Yi Li (7):
Blackfin: bf537-stamp: declare SPI IRQ resources
Blackfin: bf533-stamp: add resources for mmc_spi card
Blackfin: update anomaly lists
Blackfin: cleanup sync handling when enabling/disabling cplbs
Blackfin: do not trace the exception handler
Blackfin: use raw_smp_processor_id() in exception code
Blackfin: fix BF54x SPI CS resources
arch/blackfin/Kconfig | 25 +- arch/blackfin/Kconfig.debug | 6 + arch/blackfin/configs/BF518F-EZBRD_defconfig | 4 +- arch/blackfin/configs/BF526-EZBRD_defconfig | 4 +- arch/blackfin/configs/BF527-EZKIT_defconfig | 4 +- arch/blackfin/configs/BF548-EZKIT_defconfig | 2 +- arch/blackfin/include/asm/bfin-global.h | 6 - arch/blackfin/include/asm/bfin5xx_spi.h | 1 + arch/blackfin/include/asm/cplb.h | 46 ++- arch/blackfin/include/asm/early_printk.h | 24 + arch/blackfin/include/asm/entry.h | 30 +- arch/blackfin/include/asm/ipipe.h | 7 - arch/blackfin/include/asm/irq_handler.h | 1 + arch/blackfin/include/asm/mmu_context.h | 6 +- arch/blackfin/include/asm/pda.h | 7 + arch/blackfin/kernel/Makefile | 1 + arch/blackfin/kernel/asm-offsets.c | 7 + arch/blackfin/kernel/bfin_dma_5xx.c | 14 +- arch/blackfin/kernel/bfin_gpio.c | 1 - arch/blackfin/kernel/cplb-mpu/cacheinit.c | 6 +- arch/blackfin/kernel/cplb-mpu/cplbmgr.c | 63 +-- arch/blackfin/kernel/cplb-nompu/cacheinit.c | 6 +- arch/blackfin/kernel/cplb-nompu/cplbinit.c | 11 +- arch/blackfin/kernel/cplb-nompu/cplbmgr.c | 35 +- arch/blackfin/kernel/early_printk.c | 74 ++- arch/blackfin/kernel/entry.S | 24 +- arch/blackfin/kernel/ftrace.c | 2 +- arch/blackfin/kernel/ipipe.c | 83 ++-- arch/blackfin/kernel/kgdb_test.c | 2 +- arch/blackfin/kernel/module.c | 266 ++++---- arch/blackfin/kernel/process.c | 10 +- arch/blackfin/kernel/ptrace.c | 155 +++-- arch/blackfin/kernel/setup.c | 120 ++--- arch/blackfin/kernel/shadow_console.c | 113 ++++ arch/blackfin/kernel/time-ts.c | 4 +- arch/blackfin/kernel/traps.c | 88 ++- arch/blackfin/kernel/vmlinux.lds.S | 4 +- arch/blackfin/lib/ins.S | 4 +- arch/blackfin/mach-bf518/boards/ezbrd.c | 29 +- arch/blackfin/mach-bf518/include/mach/anomaly.h | 1 + arch/blackfin/mach-bf518/include/mach/blackfin.h | 10 - arch/blackfin/mach-bf527/boards/cm_bf527.c | 164 ++--- arch/blackfin/mach-bf527/boards/ezbrd.c | 29 +- arch/blackfin/mach-bf527/boards/ezkit.c | 58 +-- arch/blackfin/mach-bf527/include/mach/anomaly.h | 13 +- arch/blackfin/mach-bf527/include/mach/blackfin.h | 10 - arch/blackfin/mach-bf533/boards/H8606.c | 39 +- arch/blackfin/mach-bf533/boards/blackstamp.c | 11 + arch/blackfin/mach-bf533/boards/cm_bf533.c | 127 ++++- arch/blackfin/mach-bf533/boards/ezkit.c | 13 +- arch/blackfin/mach-bf533/boards/stamp.c | 83 ++- arch/blackfin/mach-bf533/dma.c | 8 +- arch/blackfin/mach-bf533/include/mach/blackfin.h | 7 - arch/blackfin/mach-bf537/boards/Kconfig | 12 +- arch/blackfin/mach-bf537/boards/Makefile | 3 +- arch/blackfin/mach-bf537/boards/cm_bf537.c | 638 ------------------ arch/blackfin/mach-bf537/boards/cm_bf537e.c | 727 +++++++++++++++++++++ arch/blackfin/mach-bf537/boards/cm_bf537u.c | 633 ++++++++++++++++++ arch/blackfin/mach-bf537/boards/pnav10.c | 29 +- arch/blackfin/mach-bf537/boards/stamp.c | 249 ++++++-- arch/blackfin/mach-bf537/boards/tcm_bf537.c | 43 +- arch/blackfin/mach-bf537/dma.c | 8 +- arch/blackfin/mach-bf537/include/mach/anomaly.h | 2 +- arch/blackfin/mach-bf537/include/mach/blackfin.h | 90 --- arch/blackfin/mach-bf538/boards/ezkit.c | 65 ++ arch/blackfin/mach-bf538/include/mach/anomaly.h | 2 +- arch/blackfin/mach-bf538/include/mach/blackfin.h | 10 - arch/blackfin/mach-bf538/include/mach/cdefBF538.h | 1 + arch/blackfin/mach-bf548/boards/cm_bf548.c | 19 +- arch/blackfin/mach-bf548/boards/ezkit.c | 12 +- arch/blackfin/mach-bf548/dma.c | 8 +- arch/blackfin/mach-bf548/include/mach/anomaly.h | 21 +- arch/blackfin/mach-bf548/include/mach/blackfin.h | 89 --- arch/blackfin/mach-bf561/boards/cm_bf561.c | 141 ++++- arch/blackfin/mach-bf561/boards/ezkit.c | 13 +- arch/blackfin/mach-bf561/include/mach/anomaly.h | 2 + arch/blackfin/mach-bf561/secondary.S | 28 +- arch/blackfin/mach-common/Makefile | 1 - arch/blackfin/mach-common/entry.S | 191 +++--- arch/blackfin/mach-common/head.S | 19 +- arch/blackfin/mach-common/interrupt.S | 78 ++-- arch/blackfin/mach-common/ints-priority.c | 19 +- arch/blackfin/mach-common/lock.S | 223 ------- arch/blackfin/mach-common/pm.c | 64 +-- arch/blackfin/mm/init.c | 3 + arch/blackfin/mm/isram-driver.c | 222 ++++++- arch/blackfin/mm/sram-alloc.c | 30 +- 87 files changed, 3329 insertions(+), 2234 deletions(-) create mode 100644 arch/blackfin/kernel/shadow_console.c delete mode 100644 arch/blackfin/mach-bf537/boards/cm_bf537.c create mode 100644 arch/blackfin/mach-bf537/boards/cm_bf537e.c create mode 100644 arch/blackfin/mach-bf537/boards/cm_bf537u.c delete mode 100644 arch/blackfin/mach-common/lock.S
PATCH 1/72 Blackfin: bf537-stamp: update ADP5588 header name
From: Michael Hennerich <[email protected]>
--- arch/blackfin/mach-bf537/boards/stamp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/mach-bf537/boards/stamp.c +1 -1
@@ -1089,7 +1089,7 @@ static struct platform_device i2c_bfin_twi_device = {#if defined(CONFIG_KEYBOARD_ADP5588 ) || defined(CONFIG_KEYBOARD_ADP5588_MODULE )#include <linux/input.h> -#include <linux/i2c/adp5588_keys.h> +#include <linux/i2c/adp5588.h> static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE ] = { [0 ] =KEY_GRAVE , [1] = KEY_1,
Signature · 1 line
1.6.4.2
PATCH 2/72 Blackfin: bf537-stamp: declare SPI IRQ resources
In reply to Mike FrysingerFrom: Yi Li <[email protected]>
--- arch/blackfin/include/asm/bfin5xx_spi.h | 1 + arch/blackfin/mach-bf537/boards/stamp.c | 6 ++++++ 2 files changed, 7 insertions(+), 0 deletions(-)
arch/blackfin/include/asm/bfin5xx_spi.h +1 -0
@@ -127,6 +127,7 @@ struct bfin5xx_spi_chip {u32 cs_gpio;/* Value to send if no TX value is supplied, usually 0x0 or 0xFFFF */ u16 idle_tx_val; + u8 pio_interrupt; /* Enable spi data irq */ };#endif /* _SPI_CHANNEL_H_ */
arch/blackfin/mach-bf537/boards/stamp.c +6 -0
@@ -555,6 +555,7 @@ static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {static struct bfin5xx_spi_chip mmc_spi_chip_info = { .enable_dma =0 , .bits_per_word =8 , + .pio_interrupt =0 , };#endif
@@ -864,6 +865,11 @@ static struct resource bfin_spi0_resource[] = { [1 ] = { .start =CH_SPI , .end =CH_SPI , + .flags =IORESOURCE_DMA , + }, + [2 ] = { + .start =IRQ_SPI , + .end =IRQ_SPI , .flags =IORESOURCE_IRQ , }, };
Signature · 1 line
1.6.4.2
PATCH 3/72 Blackfin: bf537-stamp: add resources for AD1938 audio card
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- arch/blackfin/mach-bf537/boards/stamp.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-)
arch/blackfin/mach-bf537/boards/stamp.c +21 -0
@@ -524,6 +524,15 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = { };#endif +#if defined(CONFIG_SND_BF5XX_SOC_AD1938 ) \ + || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE ) +static struct bfin5xx_spi_chip ad1938_spi_chip_info = { + .enable_dma =0 , + .bits_per_word =8 , + .cs_gpio =GPIO_PF5 , +}; +#endif +#if defined(CONFIG_AD9960 ) || defined(CONFIG_AD9960_MODULE )static struct bfin5xx_spi_chip ad9960_spi_chip_info = { .enable_dma = 0,
@@ -754,6 +763,18 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { .controller_data = &ad1836_spi_chip_info, },#endif + +#if defined(CONFIG_SND_BF5XX_SOC_AD1938) || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE) + { + .modalias = "ad1938-spi", + .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ + .bus_num = 0, + .chip_select = 0,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */ + .controller_data = &ad1938_spi_chip_info, + .mode = SPI_MODE_3, + }, +#endif + #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) { .modalias = "ad9960-spi",
Signature · 1 line
1.6.4.2
PATCH 4/72 Blackfin: make EVT3->EVT5 lowering more robust wrt IPEND[4]
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
We handle many exceptions at EVT5 (hardware error level) so that we can catch exceptions in our exception handling code. Today - if the global interrupt enable bit (IPEND[4]) is set (interrupts disabled) our trap handling code goes into a infinite loop, since we need interrupts to be on to defer things to EVT5.
Normal kernel code should not trigger this for any reason as IPEND[4] gets cleared early (when doing an interrupt context save) and the kernel stack there should be sane (or something much worse is happening in the system). But there have been a few times where this has happened, so this change makes sure we dump a proper crash message even when things have gone south.
--- arch/blackfin/include/asm/pda.h | 1 + arch/blackfin/kernel/asm-offsets.c | 1 + arch/blackfin/kernel/traps.c | 19 ++++---- arch/blackfin/mach-common/entry.S | 86 ++++++++++++++++++++++------------- 4 files changed, 66 insertions(+), 41 deletions(-)
arch/blackfin/include/asm/pda.h +1 -0
@@ -50,6 +50,7 @@ struct blackfin_pda { /* Per-processor Data Area */unsigned long ex_optr;unsigned long ex_buf[4 ];unsigned long ex_imask;/* Saved imask from exception */ +unsigned long ex_ipend;/* Saved IPEND from exception */ unsigned long *ex_stack;/* Exception stack space */ #ifdef ANOMALY_05000261
arch/blackfin/kernel/asm-offsets.c +1 -0
@@ -145,6 +145,7 @@ int main(void)DEFINE (PDA_EXBUF , offsetof(struct blackfin_pda , ex_buf));DEFINE (PDA_EXIMASK , offsetof(struct blackfin_pda , ex_imask));DEFINE (PDA_EXSTACK , offsetof(struct blackfin_pda , ex_stack)); +DEFINE (PDA_EXIPEND , offsetof(struct blackfin_pda , ex_ipend));#ifdef ANOMALY_05000261 DEFINE (PDA_LFRETX , offsetof(struct blackfin_pda , last_cplb_fault_retx));#endif
arch/blackfin/kernel/traps.c +10 -9
@@ -267,11 +267,6 @@ asmlinkage void trap_c(struct pt_regs *fp)* double faults if the stack has become corrupt */ -#ifndef CONFIG_KGDB -/* IPEND is skipped if KGDB isn't enabled (see entry code) */ - fp->ipend =bfin_read_IPEND (); -#endif -/* trap_c() will be called for exceptions. During exceptions * processing, the pc value should be set with retx value. * With this change we can cleanup some code in signal.c- TODO
@@ -1116,10 +1111,16 @@ void show_regs(struct pt_regs *fp)verbose_printk (KERN_NOTICE "%s" , linux_banner); -verbose_printk (KERN_NOTICE "\nSEQUENCER 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); +verbose_printk (KERN_NOTICE "\nSEQUENCER STATUS:\t\t%s\n" ,print_tainted ()); +verbose_printk (KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx IMASK: %04lx SYSCFG: %04lx\n" , + (long )fp->seqstat, fp->ipend, cpu_pda[smp_processor_id ()].ex_imask, fp->syscfg); +if (fp->ipend &EVT_IRPTEN ) +verbose_printk (KERN_NOTICE " Global Interrupts Disabled (IPEND[4])\n" ); +if (!(cpu_pda[smp_processor_id ()].ex_imask & (EVT_IVG13 |EVT_IVG12 |EVT_IVG11 | +EVT_IVG10 |EVT_IVG9 |EVT_IVG8 |EVT_IVG7 |EVT_IVTMR ))) +verbose_printk (KERN_NOTICE " Peripheral interrupts masked off\n" ); +if (!(cpu_pda[smp_processor_id ()].ex_imask & (EVT_IVG15 |EVT_IVG14 ))) +verbose_printk (KERN_NOTICE " Kernel interrupts masked off\n" );if ((fp->seqstat &SEQSTAT_EXCAUSE ) ==VEC_HWERR ) {verbose_printk (KERN_NOTICE " HWERRCAUSE: 0x%lx\n" , (fp->seqstat &SEQSTAT_HWERRCAUSE ) >>14 );
arch/blackfin/mach-common/entry.S +54 -32
143 lines not on this page · raw message
Signature · 1 line
1.6.4.2
PATCH 5/72 Blackfin: checkpatch --file arch/blackfin/kernel/ipipe.c
In reply to Mike FrysingerFrom: Philippe Gerum <[email protected]>
--- arch/blackfin/kernel/ipipe.c | 36 +++++++++++++++++++----------------- 1 files changed, 19 insertions(+), 17 deletions(-)
arch/blackfin/kernel/ipipe.c +19 -17
@@ -30,10 +30,10 @@#include <linux/slab.h> #include <linux/errno.h> #include <linux/kthread.h> -#include <asm/unistd.h> +#include <linux/unistd.h> +#include <linux/io.h> #include <asm/system.h> #include <asm/atomic.h> -#include <asm/io.h> DEFINE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
@@ -90,6 +90,7 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs)struct ipipe_percpu_domain_data *p =ipipe_root_cpudom_ptr ();struct ipipe_domain *this_domain, *next_domain;struct list_head *head, *pos; +struct ipipe_irqdesc *idesc;int m_ack, s =-1 ;/*
@@ -100,17 +101,20 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs)*/ m_ack = (regs ==NULL || irq ==IRQ_SYSTMR || irq ==IRQ_CORETMR ); this_domain = __ipipe_current_domain; + idesc = &this_domain->irqs[irq]; -if (unlikely (test_bit (IPIPE_STICKY_FLAG , &this_domain->irqs[irq].control))) +if (unlikely (test_bit (IPIPE_STICKY_FLAG , &idesc->control))) head = &this_domain->p_link;else { head = __ipipe_pipeline.next; next_domain = list_entry(head, struct ipipe_domain, p_link); -if (likely (test_bit (IPIPE_WIRED_FLAG , &next_domain->irqs[irq].control))) { -if (!m_ack && next_domain->irqs[irq].acknowledge !=NULL ) - next_domain->irqs[irq].acknowledge (irq,irq_to_desc (irq)); + idesc = &next_domain->irqs[irq]; +if (likely (test_bit (IPIPE_WIRED_FLAG , &idesc->control))) { +if (!m_ack && idesc->acknowledge !=NULL ) + idesc->acknowledge (irq,irq_to_desc (irq));if (test_bit (IPIPE_SYNCDEFER_FLAG , &p->status)) - s =__test_and_set_bit (IPIPE_STALL_FLAG , &p->status); + s =__test_and_set_bit (IPIPE_STALL_FLAG , + &p->status);__ipipe_dispatch_wired (next_domain, irq); goto out; }
@@ -121,14 +125,15 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs) pos = head;while (pos != &__ipipe_pipeline) { next_domain = list_entry(pos, struct ipipe_domain, p_link); -if (test_bit (IPIPE_HANDLE_FLAG , &next_domain->irqs[irq].control)) { + idesc = &next_domain->irqs[irq]; +if (test_bit (IPIPE_HANDLE_FLAG , &idesc->control)) {__ipipe_set_irq_pending (next_domain, irq); -if (!m_ack && next_domain->irqs[irq].acknowledge !=NULL ) { - next_domain->irqs[irq].acknowledge (irq,irq_to_desc (irq)); +if (!m_ack && idesc->acknowledge !=NULL ) { + idesc->acknowledge (irq,irq_to_desc (irq)); m_ack =1 ; } } -if (!test_bit (IPIPE_PASS_FLAG , &next_domain->irqs[irq].control)) +if (!test_bit (IPIPE_PASS_FLAG , &idesc->control))break ; pos = next_domain->p_link.next; }
@@ -333,12 +338,9 @@ asmlinkage void __ipipe_sync_root(void)void ___ipipe_sync_pipeline (unsigned long syncmask) { -if (__ipipe_root_domain_p) { -if (test_bit (IPIPE_SYNCDEFER_FLAG , &ipipe_root_cpudom_var (status))) -return ; - } +if (__ipipe_root_domain_p && +test_bit (IPIPE_SYNCDEFER_FLAG , &ipipe_root_cpudom_var (status))) +return ;__ipipe_sync_stage (syncmask); } - -EXPORT_SYMBOL (show_stack);
Signature · 1 line
1.6.4.2
PATCH 6/72 Blackfin: fix misnomer of some I-pipe helpers
In reply to Mike FrysingerFrom: Philippe Gerum <[email protected]>
__ipipe_{stall, unstall}_root_raw() identifiers may leave the reader under the impression that only the virtual state is affected by these operations, which is wrong. Pick names following the convention used throughout the interrupt pipeline code.
--- arch/blackfin/include/asm/ipipe.h | 7 ------ arch/blackfin/kernel/ipipe.c | 44 ++++++++++++++++-------------------- arch/blackfin/lib/ins.S | 4 +- 3 files changed, 22 insertions(+), 33 deletions(-)
arch/blackfin/include/asm/ipipe.h +0 -7
@@ -145,10 +145,6 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs);int __ipipe_get_irq_priority (unsigned irq); -void __ipipe_stall_root_raw (void ); - -void __ipipe_unstall_root_raw (void ); -void __ipipe_serial_debug (const char *fmt, ...); asmlinkage void __ipipe_call_irqtail(unsigned long addr);
@@ -234,9 +230,6 @@ int ipipe_start_irq_thread(unsigned irq, struct irq_desc *desc);#define task_hijacked (p) 0#define ipipe_trap_notify (t, r) 0 -#define __ipipe_stall_root_raw () do { } while (0) -#define __ipipe_unstall_root_raw () do { } while (0) -#define ipipe_init_irq_threads () do { } while (0)#define ipipe_start_irq_thread (irq, desc) 0
arch/blackfin/kernel/ipipe.c +20 -24
53 lines not on this page · raw message
arch/blackfin/lib/ins.S +2 -2
@@ -16,7 +16,7 @@ [--sp] = rets; \ [--sp] = (P5:0); \ sp += -12; \ - call ___ipipe_stall_root_raw; \ + call ___ipipe_disable_root_irqs_hw; \ sp += 12; \ (P5:0) = [sp++]; # define CLI_INNER_NOP
@@ -28,7 +28,7 @@ #ifdef CONFIG_IPIPE # define DO_STI \ sp += -12; \ - call ___ipipe_unstall_root_raw; \ + call ___ipipe_enable_root_irqs_hw; \ sp += 12; \ 2: rets = [sp++]; #else
Signature · 1 line
1.6.4.2
PATCH 7/72 Blackfin: export show_stack() to modules
In reply to Mike FrysingerFrom: Philippe Gerum <[email protected]>
--- arch/blackfin/kernel/traps.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/blackfin/kernel/traps.c +1 -0
@@ -944,6 +944,7 @@ void show_stack(struct task_struct *task, unsigned long *stack) }#endif } +EXPORT_SYMBOL (show_stack);void dump_stack (void ) {
Signature · 1 line
1.6.4.2
PATCH 8/72 Blackfin: allow high priority domains to preempt schedule_tail()
In reply to Mike FrysingerFrom: Philippe Gerum <[email protected]>
ret_from_fork is always entered with hw interrupts off, which prevents real-time domains to preempt the Linux kernel during part of the initial context switch to the new task, which could in turn raise the worst-case latency figures.
To avoid this, stall the root domain stage in the interrupt pipeline to keep the scheduling tail code free from Linux-handled IRQs, then enable hardware interrupts again.
--- arch/blackfin/kernel/entry.S | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-)
arch/blackfin/kernel/entry.S +22 -2
@@ -43,8 +43,28 @@ ENTRY(_ret_from_fork) #ifdef CONFIG_IPIPE - [--sp] = reti; /* IRQs on. */ - SP += 4; + /* + * Hw IRQs are off on entry, and we don't want the scheduling tail + * code to starve high priority domains from interrupts while it + * runs. Therefore we first stall the root stage to have the + * virtual interrupt state reflect IMASK. + */ + p0.l = ___ipipe_root_status; + p0.h = ___ipipe_root_status; + r4 = [p0]; + bitset(r4, 0); + [p0] = r4; + /* + * Then we may enable hw IRQs, allowing preemption from high + * priority domains. schedule_tail() will do local_irq_enable() + * since Blackfin does not define __ARCH_WANT_UNLOCKED_CTXSW, so + * there is no need to unstall the root domain by ourselves + * afterwards. + */ + p0.l = _bfin_irq_flags; + p0.h = _bfin_irq_flags; + r4 = [p0]; + sti r4; #endif /* CONFIG_IPIPE */ SP += -12; call _schedule_tail;
Signature · 1 line
1.6.4.2
PATCH 9/72 Blackfin: use generic name for EVT14 handler
In reply to Mike FrysingerFrom: Philippe Gerum <[email protected]>
The purpose of the EVT14 handler may depend on whether CONFIG_IPIPE is enabled, albeit its implementation can be the same in both cases. When the interrupt pipeline is enabled, EVT14 can be used to raise the core priority level for the running code; when CONFIG_IPIPE is off, EVT14 can be used to lower this level before running softirq handlers.
Rename evt14_softirq to evt_evt14 to pick an identifier that fits both, which allows to reuse the same vector setup code as well.
--- arch/blackfin/include/asm/bfin-global.h | 1 - arch/blackfin/include/asm/irq_handler.h | 1 + arch/blackfin/mach-common/entry.S | 8 ++++---- arch/blackfin/mach-common/ints-priority.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)
arch/blackfin/include/asm/bfin-global.h +0 -1
@@ -66,7 +66,6 @@ extern void program_IAR(void); extern asmlinkage void lower_to_irq14(void); extern asmlinkage void bfin_return_from_exception(void); -extern asmlinkage void evt14_softirq(void); extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);extern int bfin_internal_set_wake (unsigned int irq,unsigned int state);
arch/blackfin/include/asm/irq_handler.h +1 -0
@@ -17,6 +17,7 @@ asmlinkage void evt_evt10(void); asmlinkage void evt_evt11(void); asmlinkage void evt_evt12(void); asmlinkage void evt_evt13(void); +asmlinkage void evt_evt14(void); asmlinkage void evt_soft_int1(void); asmlinkage void evt_system_call(void); asmlinkage void init_exception_buff(void);
arch/blackfin/mach-common/entry.S +4 -4
@@ -975,10 +975,10 @@ ENTRY(_lower_to_irq14) #endif #ifdef CONFIG_DEBUG_HWERR - /* enable irq14 & hwerr interrupt, until we transition to _evt14_softirq */ + /* enable irq14 & hwerr interrupt, until we transition to _evt_evt14 */ r0 = (EVT_IVG14 | EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU); #else - /* Only enable irq14 interrupt, until we transition to _evt14_softirq */ + /* Only enable irq14 interrupt, until we transition to _evt_evt14 */ r0 = (EVT_IVG14 | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU); #endif sti r0;
@@ -986,7 +986,7 @@ ENTRY(_lower_to_irq14) rti; ENDPROC(_lower_to_irq14) -ENTRY(_evt14_softirq) +ENTRY(_evt_evt14) #ifdef CONFIG_DEBUG_HWERR r0 = (EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU); sti r0;
@@ -996,7 +996,7 @@ ENTRY(_evt14_softirq) [--sp] = RETI; SP += 4; rts; -ENDPROC(_evt14_softirq) +ENDPROC(_evt_evt14) ENTRY(_schedule_and_signal_from_int) /* To end up here, vector 15 was changed - so we have to change it
arch/blackfin/mach-common/ints-priority.c +1 -1
@@ -967,7 +967,7 @@ void __cpuinit init_exception_vectors(void)bfin_write_EVT11 (evt_evt11);bfin_write_EVT12 (evt_evt12);bfin_write_EVT13 (evt_evt13); -bfin_write_EVT14 (evt14_softirq); +bfin_write_EVT14 (evt_evt14);bfin_write_EVT15 (evt_system_call);CSYNC (); }
Signature · 1 line
1.6.4.2
PATCH 10/72 Blackfin: reuse evt_evt14 handler to perform irqtail epilogue
In reply to Mike FrysingerFrom: Philippe Gerum <[email protected]>
--- arch/blackfin/mach-common/interrupt.S | 24 +----------------------- 1 files changed, 1 insertions(+), 23 deletions(-)
arch/blackfin/mach-common/interrupt.S +1 -23
@@ -276,33 +276,11 @@ ENTRY(___ipipe_call_irqtail) ( r7:4, p5:3 ) = [sp++]; rets = [sp++]; - [--sp] = reti; - reti = [sp++]; /* IRQs are off. */ - r0.h = 3f; - r0.l = 3f; - p0.l = lo(EVT14); - p0.h = hi(EVT14); - [p0] = r0; - csync; r0 = 0x401f (z); sti r0; - raise 14; - [--sp] = reti; /* IRQs on. */ + raise 14; /* Branches to _evt_evt14 */ 2: jump 2b; /* Likely paranoid. */ -3: - sp += 4; /* Discard saved RETI */ - r0.h = _evt14_softirq; - r0.l = _evt14_softirq; - p0.l = lo(EVT14); - p0.h = hi(EVT14); - [p0] = r0; - csync; - p0.l = _bfin_irq_flags; - p0.h = _bfin_irq_flags; - r0 = [p0]; - sti r0; - rts; ENDPROC(___ipipe_call_irqtail) #endif /* CONFIG_IPIPE */
Signature · 1 line
1.6.4.2
PATCH 11/72 Blackfin: allow EVT5 to preempt irqtail prologue (CONFIG_DEBUG_HWERR)
In reply to Mike FrysingerFrom: Philippe Gerum <[email protected]>
--- arch/blackfin/mach-common/interrupt.S | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
arch/blackfin/mach-common/interrupt.S +9 -1
@@ -276,7 +276,15 @@ ENTRY(___ipipe_call_irqtail) ( r7:4, p5:3 ) = [sp++]; rets = [sp++]; - r0 = 0x401f (z); +#ifdef CONFIG_DEBUG_HWERR + /* enable irq14 & hwerr interrupt, until we transition to _evt_evt14 */ + r0 = (EVT_IVG14 | EVT_IVHW | \ + EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU); +#else + /* Only enable irq14 interrupt, until we transition to _evt_evt14 */ + r0 = (EVT_IVG14 | \ + EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU); +#endif sti r0; raise 14; /* Branches to _evt_evt14 */ 2:
Signature · 1 line
1.6.4.2
PATCH 12/72 Blackfin: document __ipipe_call_irqtail
In reply to Mike FrysingerFrom: Philippe Gerum <[email protected]>
--- arch/blackfin/mach-common/interrupt.S | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-)
arch/blackfin/mach-common/interrupt.S +25 -0
@@ -261,6 +261,31 @@ ENTRY(_evt_system_call) ENDPROC(_evt_system_call) #ifdef CONFIG_IPIPE +/* + * __ipipe_call_irqtail: lowers the current priority level to EVT15 + * before running a user-defined routine, then raises the priority + * level to EVT14 to prepare the caller for a normal interrupt + * return through RTI. + * + * We currently use this facility in two occasions: + * + * - to branch to __ipipe_irq_tail_hook as requested by a high + * priority domain after the pipeline delivered an interrupt, + * e.g. such as Xenomai, in order to start its rescheduling + * procedure, since we may not switch tasks when IRQ levels are + * nested on the Blackfin, so we have to fake an interrupt return + * so that we may reschedule immediately. + * + * - to branch to sync_root_irqs, in order to play any interrupt + * pending for the root domain (i.e. the Linux kernel). This lowers + * the core priority level enough so that Linux IRQ handlers may + * never delay interrupts handled by high priority domains; we defer + * those handlers until this point instead. This is a substitute + * to using a threaded interrupt model for the Linux kernel. + * + * r0: address of user-defined routine + * context: caller must have preempted EVT15, hw interrupts must be off. + */ ENTRY(___ipipe_call_irqtail) p0 = r0; r0.l = 1f;
Signature · 1 line
1.6.4.2
PATCH 13/72 Blackfin: sanitize manual control of IPEND[4]
In reply to Mike FrysingerFrom: Philippe Gerum <[email protected]>
Cleanup is performed in two ways:
- remove extraneous updates of IPEND[4] w/ CONFIG_IPIPE, and document remaining use.
- substitute pop-reg-from-stack instructions with plain SP fixups in all save-RETI-then-discard patterns.
--- arch/blackfin/mach-common/entry.S | 25 +++++++++++-------------- 1 files changed, 11 insertions(+), 14 deletions(-)
arch/blackfin/mach-common/entry.S +11 -14
@@ -708,8 +708,14 @@ ENTRY(_system_call) #ifdef CONFIG_IPIPE cc = BITTST(r7, TIF_IRQ_SYNC); if !cc jump .Lsyscall_no_irqsync; + /* + * Clear IPEND[4] manually to undo what resume_userspace_1 just did; + * we need this so that high priority domain interrupts may still + * preempt the current domain while the pipeline log is being played + * back. + */ [--sp] = reti; - r0 = [sp++]; + SP += 4; /* don't merge with next insn to keep the pattern obvious */ SP += -12; call ___ipipe_sync_root; SP += 12;
@@ -721,7 +727,7 @@ ENTRY(_system_call) /* Reenable interrupts. */ [--sp] = reti; - r0 = [sp++]; + sp += 4; SP += -12; call _schedule;
@@ -737,7 +743,7 @@ ENTRY(_system_call) .Lsyscall_do_signals: /* Reenable interrupts. */ [--sp] = reti; - r0 = [sp++]; + sp += 4; r0 = sp; SP += -12;
@@ -747,10 +753,6 @@ ENTRY(_system_call) .Lsyscall_really_exit: r5 = [sp + PT_RESERVED]; rets = r5; -#ifdef CONFIG_IPIPE - [--sp] = reti; - r5 = [sp++]; -#endif /* CONFIG_IPIPE */ rts; ENDPROC(_system_call)
@@ -904,14 +906,9 @@ ENDPROC(_ret_from_exception) #ifdef CONFIG_IPIPE -_sync_root_irqs: - [--sp] = reti; /* Reenable interrupts */ - r0 = [sp++]; - jump.l ___ipipe_sync_root - _resume_kernel_from_int: - r0.l = _sync_root_irqs - r0.h = _sync_root_irqs + r0.l = ___ipipe_sync_root; + r0.h = ___ipipe_sync_root; [--sp] = rets; [--sp] = ( r7:4, p5:3 ); SP += -12;
Signature · 1 line
1.6.4.2
PATCH 14/72 Blackfin: inline I-pipe bypass code in ret_from_exception
In reply to Mike FrysingerFrom: Philippe Gerum <[email protected]>
--- arch/blackfin/kernel/ipipe.c | 5 ----- arch/blackfin/mach-common/entry.S | 14 +++++++------- 2 files changed, 7 insertions(+), 12 deletions(-)
arch/blackfin/kernel/ipipe.c +0 -5
@@ -164,11 +164,6 @@ out:__clear_bit (IPIPE_STALL_FLAG , &p->status); } -int __ipipe_check_root (void ) -{ -return ipipe_root_domain_p; -} -void __ipipe_enable_irqdesc (struct ipipe_domain *ipd,unsigned irq) {struct irq_desc *desc =irq_to_desc (irq);
arch/blackfin/mach-common/entry.S +7 -7
@@ -840,13 +840,13 @@ ENDPROC(_resume) ENTRY(_ret_from_exception) #ifdef CONFIG_IPIPE - [--sp] = rets; - SP += -12; - call ___ipipe_check_root - SP += 12 - rets = [sp++]; - cc = r0 == 0; - if cc jump 4f; /* not on behalf of Linux, get out */ + p2.l = _per_cpu__ipipe_percpu_domain; + p2.h = _per_cpu__ipipe_percpu_domain; + r0.l = _ipipe_root; + r0.h = _ipipe_root; + r2 = [p2]; + cc = r0 == r2; + if !cc jump 4f; /* not on behalf of the root domain, get out */ #endif /* CONFIG_IPIPE */ p2.l = lo(IPEND); p2.h = hi(IPEND);
Signature · 1 line
1.6.4.2
PATCH 15/72 Blackfin: cleanup traps decode_address() a bit
In reply to Mike FrysingerUnify the address display to shrink the code, and add missing decoding of a few special Blackfin-specific regions (L1 ROM and MMRs).
--- arch/blackfin/kernel/traps.c | 48 ++++++++++++++++++++++++++--------------- 1 files changed, 30 insertions(+), 18 deletions(-)
arch/blackfin/kernel/traps.c +30 -18
@@ -100,7 +100,11 @@ static void decode_address(char *buf, unsigned long address)char *modname;char *delim =":" ;char namebuf[128 ]; +#endif + + buf +=sprintf (buf,"<0x%08lx> " , address); +#ifdef CONFIG_KALLSYMS /* look up the address and see if we are in kernel space */ symname =kallsyms_lookup (address, &symsize, &offset, &modname, namebuf);
@@ -108,23 +112,33 @@ static void decode_address(char *buf, unsigned long address)/* yeah! kernel space! */ if (!modname) modname = delim ="" ; -sprintf (buf,"<0x%p> { %s%s%s%s + 0x%lx }" , - (void *)address, delim, modname, delim, symname, - (unsigned long )offset); +sprintf (buf,"{ %s%s%s%s + 0x%lx }" , + delim, modname, delim, symname, + (unsigned long )offset); return; - }#endif -/* Problem in fixed code section? */ if (address >=FIXED_CODE_START && address <FIXED_CODE_END ) { -sprintf (buf,"<0x%p> /* Maybe fixed code section */" , (void *)address); +/* Problem in fixed code section? */ +strcat (buf,"/* Maybe fixed code section */" ); +return ; + + }else if (address <CONFIG_BOOT_LOAD ) { +/* Problem somewhere before the kernel start address */ +strcat (buf,"/* Maybe null pointer? */" ); +return ; + + }else if (address >=COREMMR_BASE ) { +strcat (buf,"/* core mmrs */" ); +return ; + + }else if (address >=SYSMMR_BASE ) { +strcat (buf,"/* system mmrs */" );return ; - } -/* Problem somewhere before the kernel start address */ -if (address <CONFIG_BOOT_LOAD ) { -sprintf (buf,"<0x%p> /* Maybe null pointer? */" , (void *)address); + }else if (address >=L1_ROM_START && address <L1_ROM_START +L1_ROM_LENGTH ) { +strcat (buf,"/* on-chip L1 ROM */" );return ; }
@@ -172,18 +186,16 @@ static void decode_address(char *buf, unsigned long address) offset = (address - vma->vm_start) + (vma->vm_pgoff <<PAGE_SHIFT ); -sprintf (buf,"<0x%p> [ %s + 0x%lx ]" , - (void *)address, name, offset); +sprintf (buf,"[ %s + 0x%lx ]" , name, offset); }else -sprintf (buf,"<0x%p> [ %s vma:0x%lx-0x%lx]" , - (void *)address, name, - vma->vm_start, vma->vm_end); +sprintf (buf,"[ %s vma:0x%lx-0x%lx]" , + name, vma->vm_start, vma->vm_end);if (!in_atomic)mmput (mm); -if (!strlen (buf)) -sprintf (buf,"<0x%p> [ %s ] dynamic memory" , (void *)address, name); +if (buf[0 ] =='\0' ) +sprintf (buf,"[ %s ] dynamic memory" , name); goto done; }
@@ -193,7 +205,7 @@ static void decode_address(char *buf, unsigned long address) }/* we were unable to find this address anywhere */ -sprintf (buf,"<0x%p> /* kernel dynamic memory */" , (void *)address); +sprintf (buf,"/* kernel dynamic memory */" ); done:write_unlock_irqrestore (&tasklist_lock, flags);
Signature · 1 line
1.6.4.2
PATCH 16/72 Blackfin: convert ptrace to new memory functions
In reply to Mike FrysingerNow that we have a Blackfin memory function to figure out how to properly access the different regions, drop the custom memory range checks in our ptrace code and use that. It makes the code nicer and fixes bugs where the ptrace logic wasn't handling all the different regions.
--- arch/blackfin/kernel/ptrace.c | 129 +++++++++++++++++++++++------------------ 1 files changed, 72 insertions(+), 57 deletions(-)
arch/blackfin/kernel/ptrace.c +72 -57
@@ -206,6 +206,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) {int ret;unsigned long __user *datap = (unsigned long __user *)data; +void *paddr = (void *)addr;switch (request) {/* when I and D space are separate, these will need to be fixed. */
@@ -215,42 +216,49 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)case PTRACE_PEEKTEXT :/* read word at location addr. */ {unsigned long tmp =0 ; -int copied; +int copied =0 , to_copy =sizeof (tmp); ret = -EIO ; -pr_debug ("ptrace: PEEKTEXT at addr 0x%08lx + %ld\n" , addr,sizeof (data)); -if (is_user_addr_valid (child, addr,sizeof (tmp)) <0 ) +pr_debug ("ptrace: PEEKTEXT at addr 0x%08lx + %i\n" , addr, to_copy); +if (is_user_addr_valid (child, addr, to_copy) <0 )break ;pr_debug ("ptrace: user address is valid\n" ); -if (L1_CODE_LENGTH !=0 && addr >=get_l1_code_start () - && addr +sizeof (tmp) <=get_l1_code_start () +L1_CODE_LENGTH ) { -safe_dma_memcpy (&tmp, (const void *)(addr),sizeof (tmp)); - copied =sizeof (tmp); - - }else if (L1_DATA_A_LENGTH !=0 && addr >=L1_DATA_A_START - && addr +sizeof (tmp) <=L1_DATA_A_START +L1_DATA_A_LENGTH ) { -memcpy (&tmp, (const void *)(addr),sizeof (tmp)); - copied =sizeof (tmp); - - }else if (L1_DATA_B_LENGTH !=0 && addr >=L1_DATA_B_START - && addr +sizeof (tmp) <=L1_DATA_B_START +L1_DATA_B_LENGTH ) { -memcpy (&tmp, (const void *)(addr),sizeof (tmp)); - copied =sizeof (tmp); - - }else if (addr >=FIXED_CODE_START - && addr +sizeof (tmp) <=FIXED_CODE_END ) { -copy_from_user_page (0 ,0 ,0 , &tmp, (const void *)(addr),sizeof (tmp)); - copied =sizeof (tmp); - - }else +switch (bfin_mem_access_type (addr, to_copy)) { +case BFIN_MEM_ACCESS_CORE : +case BFIN_MEM_ACCESS_CORE_ONLY : copied =access_process_vm (child, addr, &tmp, -sizeof (tmp),0 ); + to_copy,0 ); +if (copied) +break ; + +/* hrm, why didn't that work ... maybe no mapping */ +if (addr >=FIXED_CODE_START && + addr + to_copy <=FIXED_CODE_END ) { +copy_from_user_page (0 ,0 ,0 , &tmp, paddr, to_copy); + copied = to_copy; + }else if (addr >=BOOT_ROM_START ) { +memcpy (&tmp, paddr, to_copy); + copied = to_copy; + } -pr_debug ("ptrace: copied size %d [0x%08lx]\n" , copied, tmp); -if (copied !=sizeof (tmp))break ; - ret =put_user (tmp, datap); +case BFIN_MEM_ACCESS_DMA : +if (safe_dma_memcpy (&tmp, paddr, to_copy)) + copied = to_copy; +break ; +case BFIN_MEM_ACCESS_ITEST : +if (isram_memcpy (&tmp, paddr, to_copy)) + copied = to_copy; +break ; +default : + copied =0 ; +break ; + } + +pr_debug ("ptrace: copied size %d [0x%08lx]\n" , copied, tmp); +if (copied == to_copy) + ret =put_user (tmp, datap);break ; }
@@ -294,43 +302,50 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)/* fall through */ case PTRACE_POKETEXT :/* write the word at location addr. */ { -int copied; +int copied =0 , to_copy =sizeof (data); ret = -EIO ; -pr_debug ("ptrace: POKETEXT at addr 0x%08lx + %ld bytes %lx\n" , - addr,sizeof (data), data); -if (is_user_addr_valid (child, addr,sizeof (data)) <0 ) +pr_debug ("ptrace: POKETEXT at addr 0x%08lx + %i bytes %lx\n" , + addr, to_copy, data); +if (is_user_addr_valid (child, addr, to_copy) <0 )break ;pr_debug ("ptrace: user address is valid\n" ); -if (L1_CODE_LENGTH !=0 && addr >=get_l1_code_start () - && addr +sizeof (data) <=get_l1_code_start () +L1_CODE_LENGTH ) { -safe_dma_memcpy ((void *)(addr), &data,sizeof (data)); - copied =sizeof (data); - - }else if (L1_DATA_A_LENGTH !=0 && addr >=L1_DATA_A_START - && addr +sizeof (data) <=L1_DATA_A_START +L1_DATA_A_LENGTH ) { -memcpy ((void *)(addr), &data,sizeof (data)); - copied =sizeof (data); - - }else if (L1_DATA_B_LENGTH !=0 && addr >=L1_DATA_B_START - && addr +sizeof (data) <=L1_DATA_B_START +L1_DATA_B_LENGTH ) { -memcpy ((void *)(addr), &data,sizeof (data)); - copied =sizeof (data); - - }else if (addr >=FIXED_CODE_START - && addr +sizeof (data) <=FIXED_CODE_END ) { -copy_to_user_page (0 ,0 ,0 , (void *)(addr), &data,sizeof (data)); - copied =sizeof (data); - - }else +switch (bfin_mem_access_type (addr, to_copy)) { +case BFIN_MEM_ACCESS_CORE : +case BFIN_MEM_ACCESS_CORE_ONLY : copied =access_process_vm (child, addr, &data, -sizeof (data),1 ); + to_copy,0 ); +if (copied) +break ; + +/* hrm, why didn't that work ... maybe no mapping */ +if (addr >=FIXED_CODE_START && + addr + to_copy <=FIXED_CODE_END ) { +copy_to_user_page (0 ,0 ,0 , paddr, &data, to_copy); + copied = to_copy; + }else if (addr >=BOOT_ROM_START ) { +memcpy (paddr, &data, to_copy); + copied = to_copy; + } -pr_debug ("ptrace: copied size %d\n" , copied); -if (copied !=sizeof (data))break ; - ret =0 ; +case BFIN_MEM_ACCESS_DMA : +if (safe_dma_memcpy (paddr, &data, to_copy)) + copied = to_copy; +break ; +case BFIN_MEM_ACCESS_ITEST : +if (isram_memcpy (paddr, &data, to_copy)) + copied = to_copy; +break ; +default : + copied =0 ; +break ; + } + +pr_debug ("ptrace: copied size %d\n" , copied); +if (copied == to_copy) + ret =0 ;break ; }
Signature · 1 line
1.6.4.2
PATCH 17/72 Blackfin: reject outdated/unused/wrong relocation types
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
All kernel modules are required to be built with -mlong-calls and thus should not generate any of these relocations. If they do, it means the module has not been compiled properly, so rather than trying to handle them (and running into random run time errors) just error out on module load to force the module to be compiled correctly.
--- arch/blackfin/kernel/module.c | 42 +++++++--------------------------------- 1 files changed, 8 insertions(+), 34 deletions(-)
arch/blackfin/kernel/module.c +8 -34
@@ -243,40 +243,6 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,#endif switch (ELF32_R_TYPE (rel[i].r_info)) { -case R_BFIN_PCREL24 : -case R_BFIN_PCREL24_JUMP_L : -/* Add the value, subtract its postition */ - location16 = - (uint16_t *) (sechdrs[sechdrs[relsec].sh_info]. - sh_addr + rel[i].r_offset -2 ); - location32 = (uint32_t *) location16; - value -= (uint32_t ) location32; - value >>=1 ; -if ((value &0xFF000000 ) !=0 && - (value &0xFF000000 ) !=0xFF000000 ) { -printk (KERN_ERR "module %s: relocation overflow\n" , - mod->name); -return -ENOEXEC ; - } -pr_debug ("value is %x, before %x-%x after %x-%x\n" , value, - *location16, *(location16 +1 ), - (*location16 &0xff00 ) | (value >>16 &0x00ff ), - value &0xffff ); - *location16 = - (*location16 &0xff00 ) | (value >>16 &0x00ff ); - *(location16 +1 ) = value &0xffff ; -break ; -case R_BFIN_PCREL12_JUMP : -case R_BFIN_PCREL12_JUMP_S : - value -= (uint32_t ) location32; - value >>=1 ; - *location16 = (value &0xfff ); -break ; -case R_BFIN_PCREL10 : - value -= (uint32_t ) location32; - value >>=1 ; - *location16 = (value &0x3ff ); -break ;case R_BFIN_LUIMM16 :pr_debug ("before %x after %x\n" , *location16, (value &0xffff ));
@@ -302,6 +268,14 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,pr_debug ("before %x after %x\n" , *location32, value); *location32 = value;break ; +case R_BFIN_PCREL24 : +case R_BFIN_PCREL24_JUMP_L : +case R_BFIN_PCREL12_JUMP : +case R_BFIN_PCREL12_JUMP_S : +case R_BFIN_PCREL10 : +printk (KERN_ERR "module %s: Unsupported relocation: %u (no -mlong-calls?)\n" + mod->name,ELF32_R_TYPE (rel[i].r_info)); +return -ENOEXEC ;default :printk (KERN_ERR "module %s: Unknown relocation: %u\n" , mod->name,ELF32_R_TYPE (rel[i].r_info));
Signature · 1 line
1.6.4.2
PATCH 18/72 Blackfin: cleanup printk() usage in module code
In reply to Mike FrysingerConvert all printk() statements to use the common pr_xxx() funcs and use the new pr_fmt() function to standardize all of the output.
--- arch/blackfin/kernel/module.c | 59 +++++++++++++++++----------------------- 1 files changed, 25 insertions(+), 34 deletions(-)
arch/blackfin/kernel/module.c +25 -34
@@ -27,6 +27,7 @@* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#define pr_fmt (fmt) "module %s: " fmt#include <linux/moduleloader.h> #include <linux/elf.h>
@@ -72,9 +73,8 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs, dest =l1_inst_sram_alloc (s->sh_size); mod->arch.text_l1 = dest;if (dest ==NULL ) { -printk (KERN_ERR -"module %s: L1 instruction memory allocation failed\n" , - mod->name); +pr_err ("L1 inst memory allocation failed\n" , + mod->name);return -1 ; }dma_memcpy (dest, (void *)s->sh_addr, s->sh_size);
@@ -87,8 +87,7 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs, dest =l1_data_sram_alloc (s->sh_size); mod->arch.data_a_l1 = dest;if (dest ==NULL ) { -printk (KERN_ERR -"module %s: L1 data memory allocation failed\n" , +pr_err ("L1 data memory allocation failed\n" , mod->name);return -1 ; }
@@ -102,8 +101,7 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs, dest =l1_data_sram_alloc (s->sh_size); mod->arch.bss_a_l1 = dest;if (dest ==NULL ) { -printk (KERN_ERR -"module %s: L1 data memory allocation failed\n" , +pr_err ("L1 data memory allocation failed\n" , mod->name);return -1 ; }
@@ -115,8 +113,7 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs, dest =l1_data_B_sram_alloc (s->sh_size); mod->arch.data_b_l1 = dest;if (dest ==NULL ) { -printk (KERN_ERR -"module %s: L1 data memory allocation failed\n" , +pr_err ("L1 data memory allocation failed\n" , mod->name);return -1 ; }
@@ -128,8 +125,7 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs, dest =l1_data_B_sram_alloc (s->sh_size); mod->arch.bss_b_l1 = dest;if (dest ==NULL ) { -printk (KERN_ERR -"module %s: L1 data memory allocation failed\n" , +pr_err ("L1 data memory allocation failed\n" , mod->name);return -1 ; }
@@ -143,9 +139,8 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs, dest =l2_sram_alloc (s->sh_size); mod->arch.text_l2 = dest;if (dest ==NULL ) { -printk (KERN_ERR -"module %s: L2 SRAM allocation failed\n" , - mod->name); +pr_err ("L2 SRAM allocation failed\n" , + mod->name);return -1 ; }memcpy (dest, (void *)s->sh_addr, s->sh_size);
@@ -158,8 +153,7 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs, dest =l2_sram_alloc (s->sh_size); mod->arch.data_l2 = dest;if (dest ==NULL ) { -printk (KERN_ERR -"module %s: L2 SRAM allocation failed\n" , +pr_err ("L2 SRAM allocation failed\n" , mod->name);return -1 ; }
@@ -173,8 +167,7 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs, dest =l2_sram_alloc (s->sh_size); mod->arch.bss_l2 = dest;if (dest ==NULL ) { -printk (KERN_ERR -"module %s: L2 SRAM allocation failed\n" , +pr_err ("L2 SRAM allocation failed\n" , mod->name);return -1 ; }
@@ -190,7 +183,7 @@ int apply_relocate(Elf_Shdr * sechdrs, const char *strtab, unsigned int symindex, unsigned int relsec, struct module *me) { -printk (KERN_ERR "module %s: .rel unsupported\n" , me->name); +pr_err (".rel unsupported\n" , me->name);return -ENOEXEC ; }
@@ -217,8 +210,8 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,uint16_t *location16;uint32_t value; -pr_debug ("Applying relocate section %u to %u\n" , relsec, - sechdrs[relsec].sh_info); +pr_debug ("applying relocate section %u to %u\n" , mod->name, + relsec, sechdrs[relsec].sh_info);for (i =0 ; i < sechdrs[relsec].sh_size /sizeof (*rel); i++) {/* This is where to make the change */ location16 =
@@ -231,21 +224,22 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab, +ELF32_R_SYM (rel[i].r_info); value = sym->st_value; value += rel[i].r_addend; -pr_debug ("location is %x, value is %x type is %d \n" , - (unsigned int ) location32, value, -ELF32_R_TYPE (rel[i].r_info)); +#ifdef CONFIG_SMP if ((unsigned long )location16 >=COREB_L1_DATA_A_START ) { -printk (KERN_ERR "module %s: cannot relocate in L1: %u (SMP kernel)" , - mod->name,ELF32_R_TYPE (rel[i].r_info)); +pr_err ("cannot relocate in L1: %u (SMP kernel)" , + mod->name,ELF32_R_TYPE (rel[i].r_info));return -ENOEXEC ; }#endif + +pr_debug ("location is %lx, value is %x type is %d\n" , + mod->name, (unsigned long )location32, value, +ELF32_R_TYPE (rel[i].r_info)); +switch (ELF32_R_TYPE (rel[i].r_info)) {case R_BFIN_LUIMM16 : -pr_debug ("before %x after %x\n" , *location16, - (value &0xffff )); tmp = (value &0xffff );if ((unsigned long )location16 >=L1_CODE_START ) {dma_memcpy (location16, &tmp,2 );
@@ -253,8 +247,6 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab, *location16 = tmp;break ;case R_BFIN_HUIMM16 : -pr_debug ("before %x after %x\n" , *location16, - ((value >>16 ) &0xffff )); tmp = ((value >>16 ) &0xffff );if ((unsigned long )location16 >=L1_CODE_START ) {dma_memcpy (location16, &tmp,2 );
@@ -265,7 +257,6 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab, *location16 = (value &0xffff );break ;case R_BFIN_BYTE4_DATA : -pr_debug ("before %x after %x\n" , *location32, value); *location32 = value;break ;case R_BFIN_PCREL24 :
@@ -273,12 +264,12 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,case R_BFIN_PCREL12_JUMP :case R_BFIN_PCREL12_JUMP_S :case R_BFIN_PCREL10 : -printk (KERN_ERR "module %s: Unsupported relocation: %u (no -mlong-calls?)\n" +pr_err ("unsupported relocation: %u (no -mlong-calls?)\n" , mod->name,ELF32_R_TYPE (rel[i].r_info));return -ENOEXEC ;default : -printk (KERN_ERR "module %s: Unknown relocation: %u\n" , - mod->name,ELF32_R_TYPE (rel[i].r_info)); +pr_err ("unknown relocation: %u\n" , mod->name, +ELF32_R_TYPE (rel[i].r_info));return -ENOEXEC ; } }
Signature · 1 line
1.6.4.2
PATCH 19/72 Blackfin: convert malloc()/memset() to zalloc() in module code
In reply to Mike Frysinger--- arch/blackfin/kernel/module.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
arch/blackfin/kernel/module.c +2 -4
@@ -98,14 +98,13 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,if (strcmp (".l1.bss" , secstrings + s->sh_name) ==0 || ((strcmp (".bss" , secstrings + s->sh_name) ==0 ) && (hdr->e_flags &EF_BFIN_DATA_IN_L1 ) && (s->sh_size >0 ))) { - dest =l1_data_sram_alloc (s->sh_size); + dest =l1_data_sram_zalloc (s->sh_size); mod->arch.bss_a_l1 = dest;if (dest ==NULL ) {pr_err ("L1 data memory allocation failed\n" , mod->name);return -1 ; } -memset (dest,0 , s->sh_size); s->sh_flags &= ~SHF_ALLOC ; s->sh_addr = (unsigned long )dest; }
@@ -164,14 +163,13 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,if (strcmp (".l2.bss" , secstrings + s->sh_name) ==0 || ((strcmp (".bss" , secstrings + s->sh_name) ==0 ) && (hdr->e_flags &EF_BFIN_DATA_IN_L2 ) && (s->sh_size >0 ))) { - dest =l2_sram_alloc (s->sh_size); + dest =l2_sram_zalloc (s->sh_size); mod->arch.bss_l2 = dest;if (dest ==NULL ) {pr_err ("L2 SRAM allocation failed\n" , mod->name);return -1 ; } -memset (dest,0 , s->sh_size); s->sh_flags &= ~SHF_ALLOC ; s->sh_addr = (unsigned long )dest; }
Signature · 1 line
1.6.4.2
PATCH 20/72 Blackfin: cleanup module section checking
In reply to Mike FrysingerThe current module section handling code has a lot of verbose statements copied and pasted throughout which makes it pretty hard to digest at a glance. By unifying all of these up front, it is a lot easier to quickly get an idea of what is actually going on.
--- arch/blackfin/kernel/module.c | 111 ++++++++++++++++++++++------------------- 1 files changed, 60 insertions(+), 51 deletions(-)
arch/blackfin/kernel/module.c +60 -51
@@ -53,7 +53,7 @@ void module_free(struct module *mod, void *module_region)/* Transfer the section to the L1 memory */ int -module_frob_arch_sections (Elf_Ehdr * hdr,Elf_Shdr * sechdrs, +module_frob_arch_sections (Elf_Ehdr *hdr,Elf_Shdr *sechdrs,char *secstrings,struct module *mod) {/*
@@ -64,12 +64,18 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,* NOTE: this breaks the semantic of mod->arch structure. */ Elf_Shdr *s, *sechdrs_end = sechdrs + hdr->e_shnum; -void *dest =NULL ; +void *dest;for (s = sechdrs; s < sechdrs_end; ++s) { -if ((strcmp (".l1.text" , secstrings + s->sh_name) ==0 ) || - ((strcmp (".text" , secstrings + s->sh_name) ==0 ) && - (hdr->e_flags &EF_BFIN_CODE_IN_L1 ) && (s->sh_size >0 ))) { +const char *shname = secstrings + s->sh_name; + +if (s->sh_size ==0 ) +continue ; + +if (!strcmp (".l1.text" , shname) || + (!strcmp (".text" , shname) && + (hdr->e_flags &EF_BFIN_CODE_IN_L1 ))) { + dest =l1_inst_sram_alloc (s->sh_size); mod->arch.text_l1 = dest;if (dest ==NULL ) {
@@ -78,12 +84,11 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,return -1 ; }dma_memcpy (dest, (void *)s->sh_addr, s->sh_size); - s->sh_flags &= ~SHF_ALLOC ; - s->sh_addr = (unsigned long )dest; - } -if ((strcmp (".l1.data" , secstrings + s->sh_name) ==0 ) || - ((strcmp (".data" , secstrings + s->sh_name) ==0 ) && - (hdr->e_flags &EF_BFIN_DATA_IN_L1 ) && (s->sh_size >0 ))) { + + }else if (!strcmp (".l1.data" , shname) || + (!strcmp (".data" , shname) && + (hdr->e_flags &EF_BFIN_DATA_IN_L1 ))) { + dest =l1_data_sram_alloc (s->sh_size); mod->arch.data_a_l1 = dest;if (dest ==NULL ) {
@@ -92,12 +97,11 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,return -1 ; }memcpy (dest, (void *)s->sh_addr, s->sh_size); - s->sh_flags &= ~SHF_ALLOC ; - s->sh_addr = (unsigned long )dest; - } -if (strcmp (".l1.bss" , secstrings + s->sh_name) ==0 || - ((strcmp (".bss" , secstrings + s->sh_name) ==0 ) && - (hdr->e_flags &EF_BFIN_DATA_IN_L1 ) && (s->sh_size >0 ))) { + + }else if (!strcmp (".l1.bss" , shname) || + (!strcmp (".bss" , shname) && + (hdr->e_flags &EF_BFIN_DATA_IN_L1 ))) { + dest =l1_data_sram_zalloc (s->sh_size); mod->arch.bss_a_l1 = dest;if (dest ==NULL ) {
@@ -105,10 +109,9 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs, mod->name);return -1 ; } - s->sh_flags &= ~SHF_ALLOC ; - s->sh_addr = (unsigned long )dest; - } -if (strcmp (".l1.data.B" , secstrings + s->sh_name) ==0 ) { + + }else if (!strcmp (".l1.data.B" , shname)) { + dest =l1_data_B_sram_alloc (s->sh_size); mod->arch.data_b_l1 = dest;if (dest ==NULL ) {
@@ -117,10 +120,9 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,return -1 ; }memcpy (dest, (void *)s->sh_addr, s->sh_size); - s->sh_flags &= ~SHF_ALLOC ; - s->sh_addr = (unsigned long )dest; - } -if (strcmp (".l1.bss.B" , secstrings + s->sh_name) ==0 ) { + + }else if (!strcmp (".l1.bss.B" , shname)) { + dest =l1_data_B_sram_alloc (s->sh_size); mod->arch.bss_b_l1 = dest;if (dest ==NULL ) {
@@ -129,12 +131,11 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,return -1 ; }memset (dest,0 , s->sh_size); - s->sh_flags &= ~SHF_ALLOC ; - s->sh_addr = (unsigned long )dest; - } -if ((strcmp (".l2.text" , secstrings + s->sh_name) ==0 ) || - ((strcmp (".text" , secstrings + s->sh_name) ==0 ) && - (hdr->e_flags &EF_BFIN_CODE_IN_L2 ) && (s->sh_size >0 ))) { + + }else if (!strcmp (".l2.text" , shname) || + (!strcmp (".text" , shname) && + (hdr->e_flags &EF_BFIN_CODE_IN_L2 ))) { + dest =l2_sram_alloc (s->sh_size); mod->arch.text_l2 = dest;if (dest ==NULL ) {
@@ -143,12 +144,11 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,return -1 ; }memcpy (dest, (void *)s->sh_addr, s->sh_size); - s->sh_flags &= ~SHF_ALLOC ; - s->sh_addr = (unsigned long )dest; - } -if ((strcmp (".l2.data" , secstrings + s->sh_name) ==0 ) || - ((strcmp (".data" , secstrings + s->sh_name) ==0 ) && - (hdr->e_flags &EF_BFIN_DATA_IN_L2 ) && (s->sh_size >0 ))) { + + }else if (!strcmp (".l2.data" , shname) || + (!strcmp (".data" , shname) && + (hdr->e_flags &EF_BFIN_DATA_IN_L2 ))) { + dest =l2_sram_alloc (s->sh_size); mod->arch.data_l2 = dest;if (dest ==NULL ) {
@@ -157,12 +157,11 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,return -1 ; }memcpy (dest, (void *)s->sh_addr, s->sh_size); - s->sh_flags &= ~SHF_ALLOC ; - s->sh_addr = (unsigned long )dest; - } -if (strcmp (".l2.bss" , secstrings + s->sh_name) ==0 || - ((strcmp (".bss" , secstrings + s->sh_name) ==0 ) && - (hdr->e_flags &EF_BFIN_DATA_IN_L2 ) && (s->sh_size >0 ))) { + + }else if (!strcmp (".l2.bss" , shname) || + (!strcmp (".bss" , shname) && + (hdr->e_flags &EF_BFIN_DATA_IN_L2 ))) { + dest =l2_sram_zalloc (s->sh_size); mod->arch.bss_l2 = dest;if (dest ==NULL ) {
@@ -170,10 +169,14 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs, mod->name);return -1 ; } - s->sh_flags &= ~SHF_ALLOC ; - s->sh_addr = (unsigned long )dest; - } + + }else +continue ; + + s->sh_flags &= ~SHF_ALLOC ; + s->sh_addr = (unsigned long )dest; } +return 0 ; }
@@ -295,22 +298,28 @@ module_finalize(const Elf_Ehdr * hdr,for (i =1 ; i < hdr->e_shnum; i++) {const char *strtab = (char *)sechdrs[strindex].sh_addr;unsigned int info = sechdrs[i].sh_info; +const char *shname = secstrings + sechdrs[i].sh_name;/* Not a valid relocation section? */ if (info >= hdr->e_shnum)continue ; -if ((sechdrs[i].sh_type ==SHT_RELA ) && - ((strcmp (".rela.l2.text" , secstrings + sechdrs[i].sh_name) ==0 ) || - (strcmp (".rela.l1.text" , secstrings + sechdrs[i].sh_name) ==0 ) || - ((strcmp (".rela.text" , secstrings + sechdrs[i].sh_name) ==0 ) && - (hdr->e_flags & (EF_BFIN_CODE_IN_L1 |EF_BFIN_CODE_IN_L2 ))))) { +/* Only support RELA relocation types */ +if (sechdrs[i].sh_type !=SHT_RELA ) +continue ; + +if (!strcmp (".rela.l2.text" , shname) || + !strcmp (".rela.l1.text" , shname) || + (!strcmp (".rela.text" , shname) && + (hdr->e_flags & (EF_BFIN_CODE_IN_L1 |EF_BFIN_CODE_IN_L2 )))) { + err =apply_relocate_add ((Elf_Shdr *) sechdrs, strtab, symindex, i, mod);if (err <0 )return -ENOEXEC ; } } +return 0 ; }
Signature · 1 line
1.6.4.2
PATCH 21/72 Blackfin: fix module reloc handling for all memory regions
In reply to Mike FrysingerThe current module relocation code has spotty handling wrt different memory regions (like L1 instruction). Rather than try to fix each little spot, use the new common memory functions to greatly simplify everything and make sure it is always correct.
--- arch/blackfin/kernel/module.c | 62 ++++++++++++++++++++++------------------ 1 files changed, 34 insertions(+), 28 deletions(-)
arch/blackfin/kernel/module.c +34 -28
@@ -37,6 +37,7 @@#include <linux/kernel.h> #include <asm/dma.h> #include <asm/cacheflush.h> +#include <asm/uaccess.h> void *module_alloc (unsigned long size) {
@@ -199,26 +200,23 @@ apply_relocate(Elf_Shdr * sechdrs, const char *strtab,/* gas does not generate it. */ /*************************************************************************/ int -apply_relocate_add (Elf_Shdr * sechdrs,const char *strtab, +apply_relocate_add (Elf_Shdr *sechdrs,const char *strtab,unsigned int symindex,unsigned int relsec,struct module *mod) {unsigned int i; -unsigned short tmp;Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr;Elf32_Sym *sym; -uint32_t *location32; -uint16_t *location16; -uint32_t value; +unsigned long location, value, size;pr_debug ("applying relocate section %u to %u\n" , mod->name, relsec, sechdrs[relsec].sh_info); +for (i =0 ; i < sechdrs[relsec].sh_size /sizeof (*rel); i++) {/* This is where to make the change */ - location16 = - (uint16_t *) (sechdrs[sechdrs[relsec].sh_info].sh_addr + - rel[i].r_offset); - location32 = (uint32_t *) location16; + location = sechdrs[sechdrs[relsec].sh_info].sh_addr + + rel[i].r_offset; +/* This is the symbol it is referring to. Note that all undefined symbols have been resolved. */ sym = (Elf32_Sym *) sechdrs[symindex].sh_addr
@@ -227,39 +225,28 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab, value += rel[i].r_addend;#ifdef CONFIG_SMP -if ((unsigned long )location16 >=COREB_L1_DATA_A_START ) { +if (location >=COREB_L1_DATA_A_START ) {pr_err ("cannot relocate in L1: %u (SMP kernel)" , mod->name,ELF32_R_TYPE (rel[i].r_info));return -ENOEXEC ; }#endif -pr_debug ("location is %lx, value is %x type is %d\n" , - mod->name, (unsigned long )location32, value, -ELF32_R_TYPE (rel[i].r_info)); +pr_debug ("location is %lx, value is %lx type is %d\n" , + mod->name, location, value,ELF32_R_TYPE (rel[i].r_info));switch (ELF32_R_TYPE (rel[i].r_info)) { -case R_BFIN_LUIMM16 : - tmp = (value &0xffff ); -if ((unsigned long )location16 >=L1_CODE_START ) { -dma_memcpy (location16, &tmp,2 ); - }else - *location16 = tmp; -break ;case R_BFIN_HUIMM16 : - tmp = ((value >>16 ) &0xffff ); -if ((unsigned long )location16 >=L1_CODE_START ) { -dma_memcpy (location16, &tmp,2 ); - }else - *location16 = tmp; -break ; + value >>=16 ; +case R_BFIN_LUIMM16 :case R_BFIN_RIMM16 : - *location16 = (value &0xffff ); + size =2 ;break ;case R_BFIN_BYTE4_DATA : - *location32 = value; + size =4 ;break ; +case R_BFIN_PCREL24 :case R_BFIN_PCREL24_JUMP_L :case R_BFIN_PCREL12_JUMP :
@@ -268,12 +255,31 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,pr_err ("unsupported relocation: %u (no -mlong-calls?)\n" , mod->name,ELF32_R_TYPE (rel[i].r_info));return -ENOEXEC ; +default :pr_err ("unknown relocation: %u\n" , mod->name,ELF32_R_TYPE (rel[i].r_info));return -ENOEXEC ; } + +switch (bfin_mem_access_type (location, size)) { +case BFIN_MEM_ACCESS_CORE : +case BFIN_MEM_ACCESS_CORE_ONLY : +memcpy ((void *)location, &value, size); +break ; +case BFIN_MEM_ACCESS_DMA : +dma_memcpy ((void *)location, &value, size); +break ; +case BFIN_MEM_ACCESS_ITEST : +isram_memcpy ((void *)location, &value, size); +break ; +default : +pr_err ("invalid relocation for %#lx\n" , + mod->name, location); +return -ENOEXEC ; + } } +return 0 ; }
Signature · 1 line
1.6.4.2
PATCH 22/72 Blackfin: clean up early memory setup code
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
Remove code duplication, and only print out memory warnings when they are an actual problem.
--- arch/blackfin/kernel/setup.c | 60 ++++++++++++++++++++++------------------- 1 files changed, 32 insertions(+), 28 deletions(-)
arch/blackfin/kernel/setup.c +32 -28
@@ -511,6 +511,7 @@ static __init void memory_setup(void)#ifdef CONFIG_MTD_UCLINUX unsigned long mtd_phys =0 ;#endif +unsigned long max_mem; _rambase = (unsigned long )_stext; _ramstart = (unsigned long )_end;
@@ -520,7 +521,22 @@ static __init void memory_setup(void)panic ("DMA region exceeds memory limit: %lu." , _ramend - _ramstart); } - memory_end = _ramend -DMA_UNCACHED_REGION ; + max_mem = memory_end = _ramend -DMA_UNCACHED_REGION ; + +#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE ) &&ANOMALY_05000263 ) +/* Due to a Hardware Anomaly we need to limit the size of usable +* instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on +* 05000263 - Hardware loop corrupted when taking an ICPLB exception +*/ +# if (defined(CONFIG_DEBUG_HUNT_FOR_ZERO )) +if (max_mem >=56 *1024 *1024 ) + max_mem =56 *1024 *1024 ; +# else +if (max_mem >=60 *1024 *1024 ) + max_mem =60 *1024 *1024 ; +# endif /* CONFIG_DEBUG_HUNT_FOR_ZERO */ +#endif /* ANOMALY_05000263 */ +#ifdef CONFIG_MPU /* Round up to multiple of 4MB */
@@ -549,22 +565,16 @@ static __init void memory_setup(void)# if defined(CONFIG_ROMFS_FS )if (((unsigned long *)mtd_phys)[0 ] ==ROMSB_WORD0 - && ((unsigned long *)mtd_phys)[1 ] ==ROMSB_WORD1 ) + && ((unsigned long *)mtd_phys)[1 ] ==ROMSB_WORD1 ) { mtd_size =PAGE_ALIGN (be32_to_cpu (((unsigned long *)mtd_phys)[2 ])); -# if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE ) &&ANOMALY_05000263 ) -/* Due to a Hardware Anomaly we need to limit the size of usable -* instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on -* 05000263 - Hardware loop corrupted when taking an ICPLB exception -*/ -# if (defined(CONFIG_DEBUG_HUNT_FOR_ZERO )) -if (memory_end >=56 *1024 *1024 ) - memory_end =56 *1024 *1024 ; -# else -if (memory_end >=60 *1024 *1024 ) - memory_end =60 *1024 *1024 ; -# endif /* CONFIG_DEBUG_HUNT_FOR_ZERO */ -# endif /* ANOMALY_05000263 */ + +/* ROM_FS is XIP, so if we found it, we need to limit memory */ +if (memory_end > max_mem) { +pr_info ("Limiting kernel memory to %liMB due to anomaly 05000263\n" , max_mem >>20 ); + memory_end = max_mem; + } + }# endif /* CONFIG_ROMFS_FS */ /* Since the default MTD_UCLINUX has no magic number, we just blindly
@@ -586,20 +596,14 @@ static __init void memory_setup(void) }#endif /* CONFIG_MTD_UCLINUX */ -#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE ) &&ANOMALY_05000263 ) -/* Due to a Hardware Anomaly we need to limit the size of usable -* instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on -* 05000263 - Hardware loop corrupted when taking an ICPLB exception +/* We need lo limit memory, since everything could have a text section +* of userspace in it, and expose anomaly 05000263. If the anomaly +* doesn't exist, or we don't need to - then dont. */ -#if (defined(CONFIG_DEBUG_HUNT_FOR_ZERO )) -if (memory_end >=56 *1024 *1024 ) - memory_end =56 *1024 *1024 ; -#else -if (memory_end >=60 *1024 *1024 ) - memory_end =60 *1024 *1024 ; -#endif /* CONFIG_DEBUG_HUNT_FOR_ZERO */ -printk (KERN_NOTICE "Warning: limiting memory to %liMB due to hardware anomaly 05000263\n" , memory_end >>20 ); -#endif /* ANOMALY_05000263 */ +if (memory_end > max_mem) { +pr_info ("Limiting kernel memory to %liMB due to anomaly 05000263\n" , max_mem >>20 ); + memory_end = max_mem; + }#ifdef CONFIG_MPU page_mask_nelts = ((_ramend >>PAGE_SHIFT ) +31 ) /32 ;
Signature · 1 line
1.6.4.2
PATCH 23/72 Blackfin: rename PCF8574 driver config
In reply to Mike FrysingerFrom: Michael Hennerich <[email protected]>
The "TWI_KEYPAD" driver was renamed to "INPUT_PCF8574", so update the defines in the board resources accordingly.
--- arch/blackfin/mach-bf518/boards/ezbrd.c | 2 +- arch/blackfin/mach-bf527/boards/cm_bf527.c | 2 +- arch/blackfin/mach-bf527/boards/ezbrd.c | 2 +- arch/blackfin/mach-bf527/boards/ezkit.c | 2 +- arch/blackfin/mach-bf533/boards/stamp.c | 2 +- arch/blackfin/mach-bf537/boards/stamp.c | 2 +- arch/blackfin/mach-bf548/boards/ezkit.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-)
arch/blackfin/mach-bf518/boards/ezbrd.c +1 -1
@@ -539,7 +539,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = { I2C_BOARD_INFO("pcf8574_lcd", 0x22), },#endif -#if defined(CONFIG_TWI_KEYPAD ) || defined(CONFIG_TWI_KEYPAD_MODULE ) +#if defined(CONFIG_INPUT_PCF8574 ) || defined(CONFIG_INPUT_PCF8574_MODULE ) { I2C_BOARD_INFO("pcf8574_keypad", 0x27), .irq = IRQ_PF8,
arch/blackfin/mach-bf527/boards/cm_bf527.c +1 -1
@@ -799,7 +799,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = { .type = "pcf8574_lcd", },#endif -#if defined(CONFIG_TWI_KEYPAD ) || defined(CONFIG_TWI_KEYPAD_MODULE ) +#if defined(CONFIG_INPUT_PCF8574 ) || defined(CONFIG_INPUT_PCF8574_MODULE ) { I2C_BOARD_INFO("pcf8574_keypad", 0x27), .type = "pcf8574_keypad",
arch/blackfin/mach-bf527/boards/ezbrd.c +1 -1
@@ -596,7 +596,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = { I2C_BOARD_INFO("pcf8574_lcd", 0x22), },#endif -#if defined(CONFIG_TWI_KEYPAD ) || defined(CONFIG_TWI_KEYPAD_MODULE ) +#if defined(CONFIG_INPUT_PCF8574 ) || defined(CONFIG_INPUT_PCF8574_MODULE ) { I2C_BOARD_INFO("pcf8574_keypad", 0x27), .irq = IRQ_PF8,
arch/blackfin/mach-bf527/boards/ezkit.c +1 -1
@@ -863,7 +863,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = { I2C_BOARD_INFO("pcf8574_lcd", 0x22), },#endif -#if defined(CONFIG_TWI_KEYPAD ) || defined(CONFIG_TWI_KEYPAD_MODULE ) +#if defined(CONFIG_INPUT_PCF8574 ) || defined(CONFIG_INPUT_PCF8574_MODULE ) { I2C_BOARD_INFO("pcf8574_keypad", 0x27), .irq = IRQ_PF8,
arch/blackfin/mach-bf533/boards/stamp.c +1 -1
@@ -458,7 +458,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = { I2C_BOARD_INFO("pcf8574_lcd", 0x22), },#endif -#if defined(CONFIG_TWI_KEYPAD ) || defined(CONFIG_TWI_KEYPAD_MODULE ) +#if defined(CONFIG_INPUT_PCF8574 ) || defined(CONFIG_INPUT_PCF8574_MODULE ) { I2C_BOARD_INFO("pcf8574_keypad", 0x27), .irq = 39,
arch/blackfin/mach-bf537/boards/stamp.c +1 -1
@@ -1348,7 +1348,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = { I2C_BOARD_INFO("pcf8574_lcd", 0x22), },#endif -#if defined(CONFIG_TWI_KEYPAD ) || defined(CONFIG_TWI_KEYPAD_MODULE ) +#if defined(CONFIG_INPUT_PCF8574 ) || defined(CONFIG_INPUT_PCF8574_MODULE ) { I2C_BOARD_INFO("pcf8574_keypad", 0x27), .irq = IRQ_PG6,
arch/blackfin/mach-bf548/boards/ezkit.c +1 -1
@@ -869,7 +869,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info1[] = { I2C_BOARD_INFO("pcf8574_lcd", 0x22), },#endif -#if defined(CONFIG_TWI_KEYPAD ) || defined(CONFIG_TWI_KEYPAD_MODULE ) +#if defined(CONFIG_INPUT_PCF8574 ) || defined(CONFIG_INPUT_PCF8574_MODULE ) { I2C_BOARD_INFO("pcf8574_keypad", 0x27), .irq = 212,
Signature · 1 line
1.6.4.2
PATCH 24/72 Blackfin: unify duplicated SMP checks in L2 cache kconfig
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
--- arch/blackfin/Kconfig | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
arch/blackfin/Kconfig +1 -3
@@ -987,7 +987,7 @@ endchoice config BFIN_L2_DCACHEABLE bool "Enable DCACHE for L2 SRAM" depends on BFIN_DCACHE - depends on BF54x || BF561 + depends on (BF54x || BF561) && !SMP default n choice prompt "L2 SRAM DCACHE policy"
@@ -995,11 +995,9 @@ choice default BFIN_L2_WRITEBACK config BFIN_L2_WRITEBACK bool "Write back" - depends on !SMP config BFIN_L2_WRITETHROUGH bool "Write through" - depends on !SMP endchoice
Signature · 1 line
1.6.4.2
PATCH 25/72 Blackfin: push SRAM locks down into related ifdefs
In reply to Mike FrysingerRather than defining the locks and initializing them all the time, only do so when we actually need them (i.e. the SRAM regions exist). This avoids dead data and code bloat during runtime.
--- arch/blackfin/mm/sram-alloc.c | 30 +++++++++++++++++------------- 1 files changed, 17 insertions(+), 13 deletions(-)
arch/blackfin/mm/sram-alloc.c +17 -13
@@ -42,11 +42,6 @@#include <asm/mem_map.h> #include "blackfin_sram.h" -static DEFINE_PER_CPU(spinlock_t, l1sram_lock) ____cacheline_aligned_in_smp; -static DEFINE_PER_CPU(spinlock_t, l1_data_sram_lock) ____cacheline_aligned_in_smp; -static DEFINE_PER_CPU(spinlock_t, l1_inst_sram_lock) ____cacheline_aligned_in_smp; -static spinlock_t l2_sram_lock____cacheline_aligned_in_smp ; -/* the data structure for L1 scratchpad and DATA SRAM */ struct sram_piece {void *paddr;
@@ -55,6 +50,7 @@ struct sram_piece {struct sram_piece *next; }; +static DEFINE_PER_CPU(spinlock_t, l1sram_lock) ____cacheline_aligned_in_smp; static DEFINE_PER_CPU(struct sram_piece, free_l1_ssram_head); static DEFINE_PER_CPU(struct sram_piece, used_l1_ssram_head);
@@ -68,12 +64,18 @@ static DEFINE_PER_CPU(struct sram_piece, free_l1_data_B_sram_head); static DEFINE_PER_CPU(struct sram_piece, used_l1_data_B_sram_head);#endif +#if L1_DATA_A_LENGTH ||L1_DATA_B_LENGTH +static DEFINE_PER_CPU(spinlock_t, l1_data_sram_lock) ____cacheline_aligned_in_smp; +#endif +#if L1_CODE_LENGTH !=0 +static DEFINE_PER_CPU(spinlock_t, l1_inst_sram_lock) ____cacheline_aligned_in_smp; static DEFINE_PER_CPU(struct sram_piece, free_l1_inst_sram_head); static DEFINE_PER_CPU(struct sram_piece, used_l1_inst_sram_head);#endif #if L2_LENGTH !=0 +static spinlock_t l2_sram_lock____cacheline_aligned_in_smp ;static struct sram_piece free_l2_sram_head, used_l2_sram_head;#endif
@@ -225,10 +227,10 @@ static void __init l2_sram_init(void)printk (KERN_INFO "Blackfin L2 SRAM: %d KB (%d KB free)\n" ,L2_LENGTH >>10 , free_l2_sram_head.next->size >>10 ); -#endif /* mutex initialize */ spin_lock_init (&l2_sram_lock); +#endif }static int __init bfin_sram_init (void )
@@ -416,18 +418,17 @@ EXPORT_SYMBOL(sram_free);void *l1_data_A_sram_alloc (size_t size) { +#if L1_DATA_A_LENGTH !=0 unsigned long flags; -void *addr =NULL ; +void *addr;unsigned int cpu; cpu =get_cpu ();/* add mutex operation */ spin_lock_irqsave (&per_cpu (l1_data_sram_lock, cpu), flags); -#if L1_DATA_A_LENGTH !=0 addr =_sram_alloc (size, &per_cpu (free_l1_data_A_sram_head, cpu), &per_cpu (used_l1_data_A_sram_head, cpu)); -#endif /* add mutex operation */ spin_unlock_irqrestore (&per_cpu (l1_data_sram_lock, cpu), flags);
@@ -437,11 +438,15 @@ void *l1_data_A_sram_alloc(size_t size) (long unsigned int)addr, size);return addr; +#else +return NULL ; +#endif }EXPORT_SYMBOL (l1_data_A_sram_alloc);int l1_data_A_sram_free (const void *addr) { +#if L1_DATA_A_LENGTH !=0 unsigned long flags;int ret;unsigned int cpu;
@@ -450,18 +455,17 @@ int l1_data_A_sram_free(const void *addr)/* add mutex operation */ spin_lock_irqsave (&per_cpu (l1_data_sram_lock, cpu), flags); -#if L1_DATA_A_LENGTH !=0 ret =_sram_free (addr, &per_cpu (free_l1_data_A_sram_head, cpu), &per_cpu (used_l1_data_A_sram_head, cpu)); -#else - ret =-1 ; -#endif /* add mutex operation */ spin_unlock_irqrestore (&per_cpu (l1_data_sram_lock, cpu), flags);put_cpu ();return ret; +#else +return -1 ; +#endif }EXPORT_SYMBOL (l1_data_A_sram_free);
Signature · 1 line
1.6.4.2
PATCH 26/72 Blackfin: add support for common FDPIC ptrace requests
In reply to Mike FrysingerThe FDPIC arches support a standard set of ptrace requests so rather than define our own custom API, hook up those requests for common code to leverage.
--- arch/blackfin/kernel/ptrace.c | 26 ++++++++++++++++++++++++-- 1 files changed, 24 insertions(+), 2 deletions(-)
arch/blackfin/kernel/ptrace.c +24 -2
@@ -285,9 +285,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) tmp = child->mm->start_data; #ifdef CONFIG_BINFMT_ELF_FDPIC }else if (addr == (sizeof (struct pt_regs ) +12 )) { - tmp = child->mm->context.exec_fdpic_loadmap; + goto case_PTRACE_GETFDPIC_EXEC; }else if (addr == (sizeof (struct pt_regs ) +16 )) { - tmp = child->mm->context.interp_fdpic_loadmap; + goto case_PTRACE_GETFDPIC_INTERP;#endif }else { tmp =get_reg (child, addr);
@@ -296,6 +296,28 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)break ; } +#ifdef CONFIG_BINFMT_ELF_FDPIC +case PTRACE_GETFDPIC : { +unsigned long tmp =0 ; + +switch (addr) { + case_PTRACE_GETFDPIC_EXEC: +case PTRACE_GETFDPIC_EXEC : + tmp = child->mm->context.exec_fdpic_loadmap; +break ; + case_PTRACE_GETFDPIC_INTERP: +case PTRACE_GETFDPIC_INTERP : + tmp = child->mm->context.interp_fdpic_loadmap; +break ; +default : +break ; + } + + ret =put_user (tmp, datap); +break ; + } +#endif +/* when I and D space are separate, this will have to be fixed. */ case PTRACE_POKEDATA :pr_debug ("ptrace: PTRACE_PEEKDATA\n" );
Signature · 1 line
1.6.4.2
PATCH 27/72 Blackfin: add an early shadow console
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
Add a memory based shadow console to keep a copy of the printk buffer in a location which can be found externally. This allows bootloaders to locate and utilize the log buffer in case of silent (early/resume/etc...) crashes.
--- arch/blackfin/include/asm/early_printk.h | 2 + arch/blackfin/kernel/Makefile | 1 + arch/blackfin/kernel/setup.c | 2 + arch/blackfin/kernel/shadow_console.c | 78 ++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 0 deletions(-) create mode 100644 arch/blackfin/kernel/shadow_console.c
arch/blackfin/include/asm/early_printk.h +2 -0
@@ -23,6 +23,8 @@#ifdef CONFIG_EARLY_PRINTK extern int setup_early_printk (char *); +extern void enable_shadow_console (void );#else #define setup_early_printk (fmt) do { } while (0) +#define enable_shadow_console (fmt) do { } while (0)#endif /* CONFIG_EARLY_PRINTK */
arch/blackfin/kernel/Makefile +1 -0
@@ -26,6 +26,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_EARLY_PRINTK) += shadow_console.o obj-$(CONFIG_STACKTRACE) += stacktrace.o # the kgdb test puts code into L2 and without linker
arch/blackfin/kernel/setup.c +2 -0
@@ -810,6 +810,8 @@ void __init setup_arch(char **cmdline_p) {unsigned long sclk, cclk; +enable_shadow_console (); +/* Check to make sure we are running on the right processor */ if (unlikely (CPUID !=bfin_cpuid ())) printk(KERN_ERR "ERROR: Not running on ADSP-%s: unknown CPUID 0x%04x Rev 0.%d\n",
arch/blackfin/kernel/shadow_console.c new file +78 -0
78 lines not on this page · raw message
Signature · 1 line
1.6.4.2
PATCH 28/72 Blackfin: catch hardware errors earlier during booting
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
Allow hardware errors to be caught during early portions of booting, and leave something in the shadow console that people can use to debug their system with (to be printed out by the bootloader on next reset).
This enables the hardare error interrupts in head.S, allowing us to find hardware errors when they happen (well, as much as you can with a hardware error) and prints out the trace if it is enabled. This will catch errors (like booting the wrong image on a 533) which previously resulted in a infinite loop/hang, as well as random hardware errors before before setup_arch().
To disable this debug only feature - turn off EARLY_PRINTK.
--- arch/blackfin/include/asm/early_printk.h | 22 +++++++++ arch/blackfin/kernel/bfin_dma_5xx.c | 6 ++ arch/blackfin/kernel/early_printk.c | 74 ++++++++++++++++++++++++++++-- arch/blackfin/kernel/setup.c | 3 + arch/blackfin/kernel/shadow_console.c | 51 +++++++++++++++++--- arch/blackfin/mach-common/head.S | 11 ++++ arch/blackfin/mm/init.c | 3 + 7 files changed, 158 insertions(+), 12 deletions(-)
arch/blackfin/include/asm/early_printk.h +22 -0
@@ -21,10 +21,32 @@* GNU General Public License for more details. */ + +#ifndef __ASM_EARLY_PRINTK_H__ +#define __ASM_EARLY_PRINTK_H__ +#ifdef CONFIG_EARLY_PRINTK +/* For those that don't include it already */ +#include <linux/console.h> +extern int setup_early_printk (char *);extern void enable_shadow_console (void ); +extern int shadow_console_enabled (void ); +extern void mark_shadow_error (void ); +extern void early_shadow_reg (unsigned long reg,unsigned int n); +extern void early_shadow_write (struct console *con,const char *s, +unsigned int n) __attribute__((nonnull (2 ))); +#define early_shadow_puts (str) early_shadow_write(NULL, str, strlen(str)) +#define early_shadow_stamp () \ + do { \ + early_shadow_puts(__FILE__ " : " __stringify(__LINE__) " ["); \ + early_shadow_puts(__func__); \ + early_shadow_puts("]\n"); \ + } while (0)#else #define setup_early_printk (fmt) do { } while (0)#define enable_shadow_console (fmt) do { } while (0) +#define early_shadow_stamp () do { } while (0)#endif /* CONFIG_EARLY_PRINTK */ + +#endif /* __ASM_EARLY_PRINTK_H__ */
arch/blackfin/kernel/bfin_dma_5xx.c +6 -0
@@ -19,6 +19,7 @@#include <asm/cacheflush.h> #include <asm/dma.h> #include <asm/uaccess.h> +#include <asm/early_printk.h> /* * To make sure we work around 05000119 - we always check DMA_DONE bit,
@@ -236,6 +237,7 @@ void blackfin_dma_resume(void)*/ void __init blackfin_dma_early_init (void ) { +early_shadow_stamp ();bfin_write_MDMA_S0_CONFIG (0 );bfin_write_MDMA_S1_CONFIG (0 ); }
@@ -246,6 +248,8 @@ void __init early_dma_memcpy(void *pdst, const void *psrc, size_t size)unsigned long src = (unsigned long )psrc;struct dma_register *dst_ch, *src_ch; +early_shadow_stamp (); +/* We assume that everything is 4 byte aligned, so include * a basic sanity check */
@@ -300,6 +304,8 @@ void __init early_dma_memcpy(void *pdst, const void *psrc, size_t size)void __init early_dma_memcpy_done (void ) { +early_shadow_stamp (); +while ((bfin_read_MDMA_S0_CONFIG () && !(bfin_read_MDMA_D0_IRQ_STATUS () &DMA_DONE )) || (bfin_read_MDMA_S1_CONFIG () && !(bfin_read_MDMA_D1_IRQ_STATUS () &DMA_DONE )))continue ;
arch/blackfin/kernel/early_printk.c +70 -4
98 lines not on this page · raw message
arch/blackfin/kernel/setup.c +3 -0
@@ -187,6 +187,8 @@ void __init bfin_relocate_l1_mem(void)unsigned long l1_data_b_length;unsigned long l2_length; +early_shadow_stamp (); +/* * due to the ALIGN(4) in the arch/blackfin/kernel/vmlinux.lds.S * we know that everything about l1 text/data is nice and aligned,
@@ -1352,6 +1354,7 @@ const struct seq_operations cpuinfo_op = {void __init cmdline_init (const char *r0) { +early_shadow_stamp ();if (r0)strncpy (command_line, r0,COMMAND_LINE_SIZE ); }
arch/blackfin/kernel/shadow_console.c +43 -8
82 lines not on this page · raw message
arch/blackfin/mach-common/head.S +11 -0
@@ -153,6 +153,8 @@ ENTRY(__start) #ifdef CONFIG_EARLY_PRINTK call _init_early_exception_vectors; + r0 = (EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU); + sti r0; #endif r0 = 0 (x);
@@ -212,12 +214,21 @@ ENTRY(__start) [p0] = p1; csync; +#ifdef CONFIG_EARLY_PRINTK + r0 = (EVT_IVG15 | EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU) (z); +#else r0 = EVT_IVG15 (z); +#endif sti r0; raise 15; +#ifdef CONFIG_EARLY_PRINTK + p0.l = _early_trap; + p0.h = _early_trap; +#else p0.l = .LWAIT_HERE; p0.h = .LWAIT_HERE; +#endif reti = p0; #if ANOMALY_05000281 nop; nop; nop;
arch/blackfin/mm/init.c +3 -0
@@ -33,6 +33,7 @@#include <asm/bfin-global.h> #include <asm/pda.h> #include <asm/cplbinit.h> +#include <asm/early_printk.h> #include "blackfin_sram.h" /*
@@ -113,6 +114,8 @@ asmlinkage void __init init_pda(void) {unsigned int cpu =raw_smp_processor_id (); +early_shadow_stamp (); +/* Initialize the PDA fields holding references to other parts of the memory. The content of such memory is still undefined at the time of the call, we are only setting up
Signature · 1 line
1.6.4.2
PATCH 29/72 Blackfin: fix BF548 UART0 DMA IRQ translation
In reply to Mike FrysingerFrom: Stefan Pledl <[email protected]>
The initial BF54x port included some defines to keep code simple across different processors, but it just ended up causing the UART0 DMA IRQs to be set to the UART1 channels.
--- arch/blackfin/mach-bf548/dma.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
arch/blackfin/mach-bf548/dma.c +4 -4
@@ -91,16 +91,16 @@ int channel2irq(unsigned int channel) ret_irq =IRQ_SPI1 ;break ;case CH_UART0_RX : - ret_irq =IRQ_UART_RX ; + ret_irq =IRQ_UART0_RX ;break ;case CH_UART0_TX : - ret_irq =IRQ_UART_TX ; + ret_irq =IRQ_UART0_TX ;break ;case CH_UART1_RX : - ret_irq =IRQ_UART_RX ; + ret_irq =IRQ_UART1_RX ;break ;case CH_UART1_TX : - ret_irq =IRQ_UART_TX ; + ret_irq =IRQ_UART1_TX ;break ;case CH_EPPI0 : ret_irq =IRQ_EPPI0 ;
Signature · 1 line
1.6.4.2
PATCH 30/72 Blackfin: bf538: add bfin_clear_PPI_STATUS() helper
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
Add the bf538 version of bfin_clear_PPI_STATUS() to match all other ports.
--- arch/blackfin/mach-bf538/include/mach/cdefBF538.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/blackfin/mach-bf538/include/mach/cdefBF538.h +1 -0
@@ -1310,6 +1310,7 @@#define bfin_write_PPI_CONTROL (val) bfin_write16(PPI_CONTROL, val)#define bfin_read_PPI_STATUS () bfin_read16(PPI_STATUS)#define bfin_write_PPI_STATUS (val) bfin_write16(PPI_STATUS, val) +#define bfin_clear_PPI_STATUS () bfin_read_PPI_STATUS()#define bfin_read_PPI_DELAY () bfin_read16(PPI_DELAY)#define bfin_write_PPI_DELAY (val) bfin_write16(PPI_DELAY, val)#define bfin_read_PPI_COUNT () bfin_read16(PPI_COUNT)
Signature · 1 line
1.6.4.2
PATCH 31/72 Blackfin: bf533-stamp: add resources for mmc_spi card
In reply to Mike FrysingerFrom: Yi Li <[email protected]>
--- arch/blackfin/mach-bf533/boards/stamp.c | 40 +++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-)
arch/blackfin/mach-bf533/boards/stamp.c +40 -0
@@ -35,6 +35,7 @@#include <linux/mtd/physmap.h> #include <linux/spi/spi.h> #include <linux/spi/flash.h> +#include <linux/spi/mmc_spi.h> #if defined(CONFIG_USB_ISP1362_HCD ) || defined(CONFIG_USB_ISP1362_HCD_MODULE )#include <linux/usb/isp1362.h> #endif
@@ -223,6 +224,34 @@ static struct bfin5xx_spi_chip spidev_chip_info = { };#endif +#if defined(CONFIG_MMC_SPI ) || defined(CONFIG_MMC_SPI_MODULE ) +#define MMC_SPI_CARD_DETECT_INT IRQ_PF5 +static int bfin_mmc_spi_init (struct device *dev, +irqreturn_t (*detect_int)(int ,void *),void *data) +{ +return request_irq (MMC_SPI_CARD_DETECT_INT , detect_int, +IRQF_TRIGGER_FALLING |IRQF_TRIGGER_RISING , +"mmc-spi-detect" , data); +} + +static void bfin_mmc_spi_exit (struct device *dev,void *data) +{ +free_irq (MMC_SPI_CARD_DETECT_INT , data); +} + +static struct mmc_spi_platform_data bfin_mmc_spi_pdata = { + .init = bfin_mmc_spi_init, + .exit = bfin_mmc_spi_exit, + .detect_delay =100 ,/* msecs */ +}; + +static struct bfin5xx_spi_chip mmc_spi_chip_info = { + .enable_dma =0 , + .bits_per_word =8 , + .pio_interrupt =0 , +}; +#endif + static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_MTD_M25P80 ) || defined(CONFIG_MTD_M25P80_MODULE ) {
@@ -286,6 +315,17 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { .controller_data = &spidev_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 = 4, + .platform_data = &bfin_mmc_spi_pdata, + .controller_data = &mmc_spi_chip_info, + .mode = SPI_MODE_3, + }, +#endif };#if defined(CONFIG_SPI_BFIN ) || defined(CONFIG_SPI_BFIN_MODULE )
Signature · 1 line
1.6.4.2
PATCH 32/72 Blackfin: do not try displaying the end of the stack
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
The end of the stack may not be valid (and that could be OK), so do not attempt to parse it. If we do, we might use a bad pointer in kernel space which makes things panic().
--- arch/blackfin/kernel/traps.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/kernel/traps.c +1 -1
@@ -911,7 +911,7 @@ void show_stack(struct task_struct *task, unsigned long *stack) frame_no =0 ;for (addr = (unsigned int *)((unsigned int )stack & ~0xF ), i =0 ; - addr <= endstack; addr++, i++) { + addr < endstack; addr++, i++) { ret_addr =0 ;if (!j && i %8 ==0 )
Signature · 1 line
1.6.4.2
PATCH 33/72 Blackfin: bf537-stamp: update AD714x resources
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
Push the device table to the board resources as data interpretation can be changed on a per-board basis.
--- arch/blackfin/mach-bf537/boards/stamp.c | 133 ++++++++++++++++++++++++++++++- 1 files changed, 131 insertions(+), 2 deletions(-)
arch/blackfin/mach-bf537/boards/stamp.c +131 -2
@@ -540,6 +540,120 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = { };#endif +#if defined(CONFIG_INPUT_EVAL_AD7147EBZ ) +#include <linux/input.h> +#include <linux/input/ad714x.h> +static struct bfin5xx_spi_chip ad7147_spi_chip_info = { + .enable_dma =0 , + .bits_per_word =16 , +}; + +static struct ad714x_slider_plat slider_plat[] = { + { + .start_stage =0 , + .end_stage =7 , + .max_coord =128 , + }, +}; + +static struct ad714x_button_plat button_plat[] = { + { + .keycode =BTN_FORWARD , + .l_mask =0 , + .h_mask =0x600 , + }, + { + .keycode =BTN_LEFT , + .l_mask =0 , + .h_mask =0x500 , + }, + { + .keycode =BTN_MIDDLE , + .l_mask =0 , + .h_mask =0x800 , + }, + { + .keycode =BTN_RIGHT , + .l_mask =0x100 , + .h_mask =0x400 , + }, + { + .keycode =BTN_BACK , + .l_mask =0x200 , + .h_mask =0x400 , + }, +}; +static struct ad714x_platform_data ad7147_platfrom_data = { + .slider_num =1 , + .button_num =5 , + .slider = slider_plat, + .button = button_plat, + .stage_cfg_reg = { + {0xFBFF ,0x1FFF ,0 ,0x2626 ,1600 ,1600 ,1600 ,1600 }, + {0xEFFF ,0x1FFF ,0 ,0x2626 ,1650 ,1650 ,1650 ,1650 }, + {0xFFFF ,0x1FFE ,0 ,0x2626 ,1650 ,1650 ,1650 ,1650 }, + {0xFFFF ,0x1FFB ,0 ,0x2626 ,1650 ,1650 ,1650 ,1650 }, + {0xFFFF ,0x1FEF ,0 ,0x2626 ,1650 ,1650 ,1650 ,1650 }, + {0xFFFF ,0x1FBF ,0 ,0x2626 ,1650 ,1650 ,1650 ,1650 }, + {0xFFFF ,0x1EFF ,0 ,0x2626 ,1650 ,1650 ,1650 ,1650 }, + {0xFFFF ,0x1BFF ,0 ,0x2626 ,1600 ,1600 ,1600 ,1600 }, + {0xFF7B ,0x3FFF ,0x506 ,0x2626 ,1100 ,1100 ,1150 ,1150 }, + {0xFDFE ,0x3FFF ,0x606 ,0x2626 ,1100 ,1100 ,1150 ,1150 }, + {0xFEBA ,0x1FFF ,0x1400 ,0x2626 ,1200 ,1200 ,1300 ,1300 }, + {0xFFEF ,0x1FFF ,0x0 ,0x2626 ,1100 ,1100 ,1150 ,1150 }, + }, + .sys_cfg_reg = {0x2B2 ,0x0 ,0x3233 ,0x819 ,0x832 ,0xCFF ,0xCFF ,0x0 }, +}; +#endif + +#if defined(CONFIG_INPUT_EVAL_AD7142EB ) +#include <linux/input.h> +#include <linux/input/ad714x.h> +static struct ad714x_button_plat button_plat[] = { + { + .keycode =BTN_1 , + .l_mask =0 , + .h_mask =0x1 , + }, + { + .keycode =BTN_2 , + .l_mask =0 , + .h_mask =0x2 , + }, + { + .keycode =BTN_3 , + .l_mask =0 , + .h_mask =0x4 , + }, + { + .keycode =BTN_4 , + .l_mask =0x0 , + .h_mask =0x8 , + }, +}; +static struct ad714x_platform_data ad7142_platfrom_data = { + .button_num =4 , + .button = button_plat, + .stage_cfg_reg = { +/* fixme: figure out right setting for all comoponent according +* to hardware feature of EVAL-AD7142EB board */ + {0xE7FF ,0x3FFF ,0x0005 ,0x2626 ,0x01F4 ,0x01F4 ,0x028A ,0x028A }, + {0xFDBF ,0x3FFF ,0x0001 ,0x2626 ,0x01F4 ,0x01F4 ,0x028A ,0x028A }, + {0xFFFF ,0x2DFF ,0x0001 ,0x2626 ,0x01F4 ,0x01F4 ,0x028A ,0x028A }, + {0xFFFF ,0x37BF ,0x0001 ,0x2626 ,0x01F4 ,0x01F4 ,0x028A ,0x028A }, + {0xFFFF ,0x3FFF ,0x0000 ,0x0606 ,0x01F4 ,0x01F4 ,0x0320 ,0x0320 }, + {0xFFFF ,0x3FFF ,0x0000 ,0x0606 ,0x01F4 ,0x01F4 ,0x0320 ,0x0320 }, + {0xFFFF ,0x3FFF ,0x0000 ,0x0606 ,0x01F4 ,0x01F4 ,0x0320 ,0x0320 }, + {0xFFFF ,0x3FFF ,0x0000 ,0x0606 ,0x01F4 ,0x01F4 ,0x0320 ,0x0320 }, + {0xFFFF ,0x3FFF ,0x0000 ,0x0606 ,0x01F4 ,0x01F4 ,0x0320 ,0x0320 }, + {0xFFFF ,0x3FFF ,0x0000 ,0x0606 ,0x01F4 ,0x01F4 ,0x0320 ,0x0320 }, + {0xFFFF ,0x3FFF ,0x0000 ,0x0606 ,0x01F4 ,0x01F4 ,0x0320 ,0x0320 }, + {0xFFFF ,0x3FFF ,0x0000 ,0x0606 ,0x01F4 ,0x01F4 ,0x0320 ,0x0320 }, + }, + .sys_cfg_reg = {0x0B2 ,0x0 ,0x690 ,0x664 ,0x290F ,0xF ,0xF ,0x0 }, +}; +#endif +#if defined(CONFIG_MMC_SPI ) || defined(CONFIG_MMC_SPI_MODULE )#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
@@ -784,6 +898,20 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { .controller_data = &ad9960_spi_chip_info, },#endif + +#if defined(CONFIG_INPUT_EVAL_AD7147EBZ) + { + .modalias = "ad714x_captouch", + .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ + .irq = IRQ_PF4, + .bus_num = 0, + .chip_select = 5, + .mode = SPI_MODE_3, + .platform_data = &ad7147_platfrom_data, + .controller_data = &ad7147_spi_chip_info, + }, +#endif + #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) { .modalias = "mmc_spi",
@@ -1337,10 +1465,11 @@ static struct adp5520_platform_data adp5520_pdev_data = {#endif static struct i2c_board_info __initdata bfin_i2c_board_info[] = { -#if defined(CONFIG_JOYSTICK_AD7142 ) || defined(CONFIG_JOYSTICK_AD7142_MODULE ) +#if defined(CONFIG_INPUT_EVAL_AD7142EB ) { - I2C_BOARD_INFO("ad7142_joystick", 0x2C), + I2C_BOARD_INFO("ad7142_captouch", 0x2C), .irq = IRQ_PG5, + .platform_data = (void *)&ad7142_platfrom_data, },#endif #if defined(CONFIG_BFIN_TWI_LCD ) || defined(CONFIG_BFIN_TWI_LCD_MODULE )
Signature · 1 line
1.6.4.2
PATCH 34/72 Blackfin: clean up duplicate I2C device type definitions
In reply to Mike FrysingerFrom: Jean Delvare <[email protected]>
I2C_BOARD_INFO() already sets .type, no need to set it again.
--- arch/blackfin/mach-bf527/boards/cm_bf527.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
arch/blackfin/mach-bf527/boards/cm_bf527.c +0 -2
@@ -796,13 +796,11 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {#if defined(CONFIG_BFIN_TWI_LCD ) || defined(CONFIG_BFIN_TWI_LCD_MODULE ) { I2C_BOARD_INFO("pcf8574_lcd", 0x22), - .type = "pcf8574_lcd", },#endif #if defined(CONFIG_INPUT_PCF8574 ) || defined(CONFIG_INPUT_PCF8574_MODULE ) { I2C_BOARD_INFO("pcf8574_keypad", 0x27), - .type = "pcf8574_keypad", .irq = IRQ_PF8, },#endif
Signature · 1 line
1.6.4.2
PATCH 35/72 Blackfin: fix MPU handling of invalid memory accesses
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
The protect_page() function was incorrectly setting up the hardware tables based on possible access capabilities rather than the actual requested values. This means we would grant more access to mmap-ed pages than we should have. Once we fix this, we need to tweak the signal generated by such accesses to aline ourselves with other ports. This allows the LTP mmap0{5,6,7} cases to run properly.
--- arch/blackfin/include/asm/mmu_context.h | 6 +++--- arch/blackfin/kernel/traps.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/blackfin/include/asm/mmu_context.h +3 -3
@@ -127,17 +127,17 @@ static inline void protect_page(struct mm_struct *mm, unsigned long addr,unsigned long idx = page >>5 ;unsigned long bit =1 << (page &31 ); -if (flags &VM_MAYREAD ) +if (flags &VM_READ ) mask[idx] |= bit;else mask[idx] &= ~bit; mask += page_mask_nelts; -if (flags &VM_MAYWRITE ) +if (flags &VM_WRITE ) mask[idx] |= bit;else mask[idx] &= ~bit; mask += page_mask_nelts; -if (flags &VM_MAYEXEC ) +if (flags &VM_EXEC ) mask[idx] |= bit;else mask[idx] &= ~bit;
arch/blackfin/kernel/traps.c +1 -1
@@ -411,7 +411,7 @@ asmlinkage void trap_c(struct pt_regs *fp)/* 0x23 - Data CPLB protection violation, handled here */ case VEC_CPLB_VL : info.si_code =ILL_CPLB_VI ; - sig =SIGBUS ; + sig =SIGSEGV ; strerror = KERN_NOTICE EXC_0x23(KERN_NOTICE);CHK_DEBUGGER_TRAP_MAYBE ();break ;
Signature · 1 line
1.6.4.2
PATCH 36/72 Blackfin: bf533-stamp: fix typo in SPI frequency for ad1836 codec
In reply to Mike FrysingerFrom: Cliff Cai <[email protected]>
One too many zeros means we run way faster than the codec can handle.
--- arch/blackfin/mach-bf533/boards/stamp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/mach-bf533/boards/stamp.c +1 -1
@@ -280,7 +280,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { .modalias = "ad1836-spi", - .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */ + .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, .controller_data = &ad1836_spi_chip_info,
Signature · 1 line
1.6.4.2
PATCH 37/72 Blackfin: improve double fault debug handling
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
Since the hardware only provides reporting for the last exception handled, and the values are valid only when executing the exception handler, we need to save the context for reporting at a later point. While we do this for one exception, it doesn't work properly when handling a second one as the original exception is clobbered by the double fault. So when double fault debugging is enabled, create a dedicated shadow of these values and save/restore out of there. Now the crash report properly displays the first exception as well as the second one.
--- arch/blackfin/include/asm/pda.h | 6 ++++++ arch/blackfin/kernel/asm-offsets.c | 6 ++++++ arch/blackfin/kernel/traps.c | 8 ++++---- arch/blackfin/mach-bf561/secondary.S | 8 ++++---- arch/blackfin/mach-common/entry.S | 22 +++++++++++++--------- arch/blackfin/mach-common/head.S | 8 ++++---- 6 files changed, 37 insertions(+), 21 deletions(-)
arch/blackfin/include/asm/pda.h +6 -0
@@ -61,6 +61,12 @@ struct blackfin_pda { /* Per-processor Data Area */unsigned long retx;unsigned long seqstat;unsigned int __nmi_count;/* number of times NMI asserted on this CPU */ +#ifdef CONFIG_DEBUG_DOUBLEFAULT +unsigned long dcplb_doublefault_addr; +unsigned long icplb_doublefault_addr; +unsigned long retx_doublefault; +unsigned long seqstat_doublefault; +#endif };extern struct blackfin_pda cpu_pda[];
arch/blackfin/kernel/asm-offsets.c +6 -0
@@ -153,6 +153,12 @@ int main(void)DEFINE (PDA_ICPLB , offsetof(struct blackfin_pda , icplb_fault_addr));DEFINE (PDA_RETX , offsetof(struct blackfin_pda , retx));DEFINE (PDA_SEQSTAT , offsetof(struct blackfin_pda , seqstat)); +#ifdef CONFIG_DEBUG_DOUBLEFAULT +DEFINE (PDA_DF_DCPLB , offsetof(struct blackfin_pda , dcplb_doublefault_addr)); +DEFINE (PDA_DF_ICPLB , offsetof(struct blackfin_pda , icplb_doublefault_addr)); +DEFINE (PDA_DF_SEQSTAT , offsetof(struct blackfin_pda , seqstat_doublefault)); +DEFINE (PDA_DF_RETX , offsetof(struct blackfin_pda , retx_doublefault)); +#endif #ifdef CONFIG_SMP /* Inter-core lock (in L2 SRAM) */ DEFINE (SIZEOF_CORELOCK ,sizeof (struct corelock_slot ));
arch/blackfin/kernel/traps.c +4 -4
@@ -229,12 +229,12 @@ asmlinkage void double_fault_c(struct pt_regs *fp)if (((long )fp->seqstat &SEQSTAT_EXCAUSE ) ==VEC_UNCOV ) {unsigned int cpu =smp_processor_id ();char buf[150 ]; -decode_address (buf, cpu_pda[cpu].retx); +decode_address (buf, cpu_pda[cpu].retx_doublefault);printk (KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n" , - (unsigned int )cpu_pda[cpu].seqstat &SEQSTAT_EXCAUSE , buf); -decode_address (buf, cpu_pda[cpu].dcplb_fault_addr); + (unsigned int )cpu_pda[cpu].seqstat_doublefault &SEQSTAT_EXCAUSE , buf); +decode_address (buf, cpu_pda[cpu].dcplb_doublefault_addr);printk (KERN_NOTICE " DCPLB_FAULT_ADDR: %s\n" , buf); -decode_address (buf, cpu_pda[cpu].icplb_fault_addr); +decode_address (buf, cpu_pda[cpu].icplb_doublefault_addr);printk (KERN_NOTICE " ICPLB_FAULT_ADDR: %s\n" , buf);decode_address (buf, fp->retx);
arch/blackfin/mach-bf561/secondary.S +4 -4
@@ -126,22 +126,22 @@ ENTRY(_coreb_trampoline_start) * below */ GET_PDA(p0, r0); - r7 = [p0 + PDA_RETX]; + r7 = [p0 + PDA_DF_RETX]; p1.l = _init_saved_retx_coreb; p1.h = _init_saved_retx_coreb; [p1] = r7; - r7 = [p0 + PDA_DCPLB]; + r7 = [p0 + PDA_DF_DCPLB]; p1.l = _init_saved_dcplb_fault_addr_coreb; p1.h = _init_saved_dcplb_fault_addr_coreb; [p1] = r7; - r7 = [p0 + PDA_ICPLB]; + r7 = [p0 + PDA_DF_ICPLB]; p1.l = _init_saved_icplb_fault_addr_coreb; p1.h = _init_saved_icplb_fault_addr_coreb; [p1] = r7; - r7 = [p0 + PDA_SEQSTAT]; + r7 = [p0 + PDA_DF_SEQSTAT]; p1.l = _init_saved_seqstat_coreb; p1.h = _init_saved_seqstat_coreb; [p1] = r7;
arch/blackfin/mach-common/entry.S +13 -9
@@ -326,8 +326,6 @@ ENTRY(_ex_trap_c) [p4] = r7; csync; -#ifndef CONFIG_DEBUG_DOUBLEFAULT - /* * Save these registers, as they are only valid in exception context * (where we are now - as soon as we defer to IRQ5, they can change)
@@ -347,7 +345,10 @@ ENTRY(_ex_trap_c) r6 = retx; [p5 + PDA_RETX] = r6; -#endif + + r6 = SEQSTAT; + [p5 + PDA_SEQSTAT] = r6; + /* Save the state of single stepping */ r6 = SYSCFG; [p5 + PDA_SYSCFG] = r6;
@@ -444,6 +445,9 @@ ENTRY(_exception_to_level5) r6 = [p5 + PDA_SYSCFG]; [sp + PT_SYSCFG] = r6; + r6 = [p5 + PDA_SEQSTAT]; /* Read back seqstat */ + [sp + PT_SEQSTAT] = r6; + /* Restore the hardware error vector. */ r7.h = _evt_ivhw; r7.l = _evt_ivhw;
@@ -496,7 +500,7 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/ */ EX_SCRATCH_REG = sp; GET_PDA_SAFE(sp); - sp = [sp + PDA_EXSTACK] + sp = [sp + PDA_EXSTACK]; /* Try to deal with syscalls quickly. */ [--sp] = ASTAT; [--sp] = (R7:6,P5:4);
@@ -532,18 +536,18 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/ p4.l = lo(DCPLB_FAULT_ADDR); p4.h = hi(DCPLB_FAULT_ADDR); r7 = [p4]; - [p5 + PDA_DCPLB] = r7; + [p5 + PDA_DF_DCPLB] = r7; p4.l = lo(ICPLB_FAULT_ADDR); p4.h = hi(ICPLB_FAULT_ADDR); r7 = [p4]; - [p5 + PDA_ICPLB] = r7; + [p5 + PDA_DF_ICPLB] = r7; - r6 = retx; - [p5 + PDA_RETX] = r6; + r7 = retx; + [p5 + PDA_DF_RETX] = r7; r7 = SEQSTAT; /* reason code is in bit 5:0 */ - [p5 + PDA_SEQSTAT] = r7; + [p5 + PDA_DF_SEQSTAT] = r7; #else r7 = SEQSTAT; /* reason code is in bit 5:0 */ #endif
arch/blackfin/mach-common/head.S +4 -4
@@ -124,22 +124,22 @@ ENTRY(__start) * below */ GET_PDA(p0, r0); - r6 = [p0 + PDA_RETX]; + r6 = [p0 + PDA_DF_RETX]; p1.l = _init_saved_retx; p1.h = _init_saved_retx; [p1] = r6; - r6 = [p0 + PDA_DCPLB]; + r6 = [p0 + PDA_DF_DCPLB]; p1.l = _init_saved_dcplb_fault_addr; p1.h = _init_saved_dcplb_fault_addr; [p1] = r6; - r6 = [p0 + PDA_ICPLB]; + r6 = [p0 + PDA_DF_ICPLB]; p1.l = _init_saved_icplb_fault_addr; p1.h = _init_saved_icplb_fault_addr; [p1] = r6; - r6 = [p0 + PDA_SEQSTAT]; + r6 = [p0 + PDA_DF_SEQSTAT]; p1.l = _init_saved_seqstat; p1.h = _init_saved_seqstat; [p1] = r6;
Signature · 1 line
1.6.4.2
PATCH 38/72 Blackfin: bf537-stamp: drop ATA interrupt probe workaround
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
The interrupt probe workaround doesn't work without hacks to common code, and the add-on card only needs a simple resistor to fix the problem, so drop the board-specific hack.
--- arch/blackfin/mach-bf537/boards/stamp.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
arch/blackfin/mach-bf537/boards/stamp.c +0 -5
@@ -1728,11 +1728,6 @@ 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 )) \ - && defined(PATA_INT ) - irq_desc[PATA_INT ].status |=IRQ_NOAUTOEN ; -#endif -return 0 ; }
Signature · 1 line
1.6.4.2
PATCH 39/72 Blackfin: convert boards to use platform data with smc91x
In reply to Mike FrysingerFrom: Michael Hennerich <[email protected]>
Latest smc91x driver allows you to specify settings in board resources rather than needing CONFIG_BLACKFIN in the drivers/net/smc91x.h header.
--- arch/blackfin/mach-bf527/boards/cm_bf527.c | 11 +++++++++++ arch/blackfin/mach-bf527/boards/ezkit.c | 11 +++++++++++ arch/blackfin/mach-bf533/boards/H8606.c | 11 +++++++++++ arch/blackfin/mach-bf533/boards/blackstamp.c | 11 +++++++++++ arch/blackfin/mach-bf533/boards/cm_bf533.c | 11 +++++++++++ arch/blackfin/mach-bf533/boards/ezkit.c | 11 +++++++++++ arch/blackfin/mach-bf533/boards/stamp.c | 11 +++++++++++ arch/blackfin/mach-bf537/boards/cm_bf537.c | 11 +++++++++++ arch/blackfin/mach-bf537/boards/pnav10.c | 11 +++++++++++ arch/blackfin/mach-bf537/boards/stamp.c | 11 +++++++++++ arch/blackfin/mach-bf537/boards/tcm_bf537.c | 11 +++++++++++ arch/blackfin/mach-bf538/boards/ezkit.c | 11 +++++++++++ arch/blackfin/mach-bf561/boards/cm_bf561.c | 10 ++++++++++ arch/blackfin/mach-bf561/boards/ezkit.c | 11 +++++++++++ 14 files changed, 153 insertions(+), 0 deletions(-)
arch/blackfin/mach-bf527/boards/cm_bf527.c +11 -0
@@ -275,6 +275,14 @@ static struct platform_device rtc_device = {#endif #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .name = "smc91x-regs",
@@ -293,6 +301,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf527/boards/ezkit.c +11 -0
@@ -292,6 +292,14 @@ static struct platform_device rtc_device = {#endif #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .name = "smc91x-regs",
@@ -310,6 +318,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf533/boards/H8606.c +11 -0
@@ -88,6 +88,14 @@ static struct platform_device dm9000_device = {#endif #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .name = "smc91x-regs",
@@ -110,6 +118,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf533/boards/blackstamp.c +11 -0
@@ -48,6 +48,14 @@ static struct platform_device rtc_device = {* Driver needs to know address, irq and flag pin. */ #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .name = "smc91x-regs",
@@ -66,6 +74,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf533/boards/cm_bf533.c +11 -0
@@ -195,6 +195,14 @@ static struct platform_device rtc_device = {#endif #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .start = 0x20200300,
@@ -211,6 +219,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf533/boards/ezkit.c +11 -0
@@ -67,6 +67,14 @@ static struct platform_device bfin_fb_adv7393_device = {* Driver needs to know address, irq and flag pin. */ #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .name = "smc91x-regs",
@@ -84,6 +92,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf533/boards/stamp.c +11 -0
@@ -63,6 +63,14 @@ static struct platform_device rtc_device = {* Driver needs to know address, irq and flag pin. */ #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .name = "smc91x-regs",
@@ -81,6 +89,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf537/boards/cm_bf537.c +11 -0
@@ -223,6 +223,14 @@ static struct platform_device hitachi_fb_device = {#endif #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .start = 0x20200300,
@@ -240,6 +248,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf537/boards/pnav10.c +11 -0
@@ -92,6 +92,14 @@ static struct platform_device rtc_device = {#endif #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .name = "smc91x-regs",
@@ -110,6 +118,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf537/boards/stamp.c +11 -0
@@ -171,6 +171,14 @@ static struct platform_device rtc_device = {#endif #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .name = "smc91x-regs",
@@ -189,6 +197,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf537/boards/tcm_bf537.c +11 -0
@@ -223,6 +223,14 @@ static struct platform_device hitachi_fb_device = {#endif #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .start = 0x20200300,
@@ -240,6 +248,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf538/boards/ezkit.c +11 -0
@@ -177,6 +177,14 @@ static struct platform_device bfin_sir2_device = {* Driver needs to know address, irq and flag pin. */ #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .name = "smc91x-regs",
@@ -194,6 +202,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf561/boards/cm_bf561.c +10 -0
@@ -213,6 +213,13 @@ static struct platform_device hitachi_fb_device = { #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_32BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; static struct resource smc91x_resources[] = { {
@@ -231,6 +238,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
arch/blackfin/mach-bf561/boards/ezkit.c +11 -0
@@ -147,6 +147,14 @@ static struct platform_device net2272_bfin_device = {* Driver needs to know address, irq and flag pin. */ #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#include <linux/smc91x.h> + +static struct smc91x_platdata smc91x_info = { + .flags = SMC91X_USE_32BIT | SMC91X_NOWAIT, + .leda = RPC_LED_100_10, + .ledb = RPC_LED_TX_RX, +}; + static struct resource smc91x_resources[] = { { .name = "smc91x-regs",
@@ -166,6 +174,9 @@ static struct platform_device smc91x_device = { .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, + .dev = { + .platform_data = &smc91x_info, + }, };#endif
Signature · 1 line
1.6.4.2
PATCH 40/72 Blackfin: drop unused MMR defines that only cause bad code to be written
In reply to Mike Frysinger--- arch/blackfin/mach-bf518/include/mach/blackfin.h | 10 --- arch/blackfin/mach-bf527/include/mach/blackfin.h | 10 --- arch/blackfin/mach-bf533/dma.c | 8 +- arch/blackfin/mach-bf533/include/mach/blackfin.h | 7 -- arch/blackfin/mach-bf537/dma.c | 8 +- arch/blackfin/mach-bf537/include/mach/blackfin.h | 90 ---------------------- arch/blackfin/mach-bf538/include/mach/blackfin.h | 10 --- arch/blackfin/mach-bf548/include/mach/blackfin.h | 89 --------------------- 8 files changed, 8 insertions(+), 224 deletions(-)
arch/blackfin/mach-bf518/include/mach/blackfin.h +0 -10
@@ -68,11 +68,6 @@#endif #endif -/* UART_IIR Register */ -#define STATUS (x) ((x << 1) & 0x06) -#define STATUS_P1 0x02 -#define STATUS_P0 0x01 -#define BFIN_UART_NR_PORTS 2#define OFFSET_THR 0x00/* Transmit Holding register */
@@ -88,11 +83,6 @@#define OFFSET_SCR 0x1C/* SCR Scratch Register */ #define OFFSET_GCTL 0x24/* Global Control Register */ -/* DPMC*/ -#define bfin_read_STOPCK_OFF () bfin_read_STOPCK() -#define bfin_write_STOPCK_OFF (val) bfin_write_STOPCK(val) -#define STOPCK_OFF STOPCK -/* PLL_DIV Masks */ #define CCLK_DIV1 CSEL_DIV1/* CCLK = VCO / 1 */ #define CCLK_DIV2 CSEL_DIV2/* CCLK = VCO / 2 */
arch/blackfin/mach-bf527/include/mach/blackfin.h +0 -10
@@ -56,11 +56,6 @@#endif #endif -/* UART_IIR Register */ -#define STATUS (x) ((x << 1) & 0x06) -#define STATUS_P1 0x02 -#define STATUS_P0 0x01 -#define BFIN_UART_NR_PORTS 2#define OFFSET_THR 0x00/* Transmit Holding register */
@@ -76,11 +71,6 @@#define OFFSET_SCR 0x1C/* SCR Scratch Register */ #define OFFSET_GCTL 0x24/* Global Control Register */ -/* DPMC*/ -#define bfin_read_STOPCK_OFF () bfin_read_STOPCK() -#define bfin_write_STOPCK_OFF (val) bfin_write_STOPCK(val) -#define STOPCK_OFF STOPCK -/* PLL_DIV Masks */ #define CCLK_DIV1 CSEL_DIV1/* CCLK = VCO / 1 */ #define CCLK_DIV2 CSEL_DIV2/* CCLK = VCO / 2 */
arch/blackfin/mach-bf533/dma.c +4 -4
@@ -76,12 +76,12 @@ int channel2irq(unsigned int channel) ret_irq =IRQ_SPI ;break ; -case CH_UART_RX : - ret_irq =IRQ_UART_RX ; +case CH_UART0_RX : + ret_irq =IRQ_UART0_RX ;break ; -case CH_UART_TX : - ret_irq =IRQ_UART_TX ; +case CH_UART0_TX : + ret_irq =IRQ_UART0_TX ;break ;case CH_MEM_STREAM0_SRC :
arch/blackfin/mach-bf533/include/mach/blackfin.h +0 -7
@@ -43,13 +43,6 @@#define BFIN_UART_NR_PORTS 1 -#define CH_UART_RX CH_UART0_RX -#define CH_UART_TX CH_UART0_TX - -#define IRQ_UART_ERROR IRQ_UART0_ERROR -#define IRQ_UART_RX IRQ_UART0_RX -#define IRQ_UART_TX IRQ_UART0_TX -#define OFFSET_THR 0x00/* Transmit Holding register */ #define OFFSET_RBR 0x00/* Receive Buffer register */ #define OFFSET_DLL 0x00/* Divisor Latch (Low-Byte) */
arch/blackfin/mach-bf537/dma.c +4 -4
@@ -96,12 +96,12 @@ int channel2irq(unsigned int channel) ret_irq =IRQ_SPI ;break ; -case CH_UART_RX : - ret_irq =IRQ_UART_RX ; +case CH_UART0_RX : + ret_irq =IRQ_UART0_RX ;break ; -case CH_UART_TX : - ret_irq =IRQ_UART_TX ; +case CH_UART0_TX : + ret_irq =IRQ_UART0_TX ;break ;case CH_MEM_STREAM0_SRC :
arch/blackfin/mach-bf537/include/mach/blackfin.h +0 -90
107 lines not on this page · raw message
arch/blackfin/mach-bf538/include/mach/blackfin.h +0 -10
@@ -47,11 +47,6 @@#endif #endif -/* UART_IIR Register */ -#define STATUS (x) ((x << 1) & 0x06) -#define STATUS_P1 0x02 -#define STATUS_P0 0x01 -#define BFIN_UART_NR_PORTS 3#define OFFSET_THR 0x00/* Transmit Holding register */
@@ -67,11 +62,6 @@#define OFFSET_SCR 0x1C/* SCR Scratch Register */ #define OFFSET_GCTL 0x24/* Global Control Register */ -/* DPMC*/ -#define bfin_read_STOPCK_OFF () bfin_read_STOPCK() -#define bfin_write_STOPCK_OFF (val) bfin_write_STOPCK(val) -#define STOPCK_OFF STOPCK -/* PLL_DIV Masks */ #define CCLK_DIV1 CSEL_DIV1/* CCLK = VCO / 1 */ #define CCLK_DIV2 CSEL_DIV2/* CCLK = VCO / 2 */
arch/blackfin/mach-bf548/include/mach/blackfin.h +0 -89
97 lines not on this page · raw message
Signature · 1 line
1.6.4.2
PATCH 41/72 Blackfin: cm-bf527/bf537-stamp: fix dm9000 resources
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
The dm9000 driver expects two IORESOURCE_MEM to get at the device, so make sure we declare things properly.
--- arch/blackfin/mach-bf527/boards/cm_bf527.c | 7 ++++++- arch/blackfin/mach-bf537/boards/stamp.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-)
arch/blackfin/mach-bf527/boards/cm_bf527.c +6 -1
@@ -311,10 +311,15 @@ static struct platform_device smc91x_device = {static struct resource dm9000_resources[] = { [0 ] = { .start =0x203FB800 , - .end =0x203FB800 +8 , + .end =0x203FB800 +1 , .flags =IORESOURCE_MEM , }, [1 ] = { + .start =0x203FB804 , + .end =0x203FB804 +1 , + .flags =IORESOURCE_MEM , + }, + [2 ] = { .start =IRQ_PF9 , .end =IRQ_PF9 , .flags = (IORESOURCE_IRQ |IORESOURCE_IRQ_HIGHEDGE ),
arch/blackfin/mach-bf537/boards/stamp.c +6 -1
@@ -207,10 +207,15 @@ static struct platform_device smc91x_device = {static struct resource dm9000_resources[] = { [0 ] = { .start =0x203FB800 , - .end =0x203FB800 +8 , + .end =0x203FB800 +1 , .flags =IORESOURCE_MEM , }, [1 ] = { + .start =0x203FB804 , + .end =0x203FB804 +1 , + .flags =IORESOURCE_MEM , + }, + [2 ] = { .start =IRQ_PF9 , .end =IRQ_PF9 , .flags = (IORESOURCE_IRQ |IORESOURCE_IRQ_HIGHEDGE ),
Signature · 1 line
1.6.4.2
PATCH 42/72 Blackfin: bf548-ezkit: fix incorrect LCD size parameters
In reply to Mike FrysingerFrom: Stefan Pledl <[email protected]>
I think we have to use the physical dimensions [mm] of the display for .width and .heigth in struct bfin_bf54xfb_mach_info bf54x_lq043_data which are copied to fbinfo->var.height/.width in bf54x-lq043fb.c.
linux/fb.h describes this values as 'height/weight of picture in mm'
Otherwise QT calcs the wrong dpi value and the displayed fonts are very small.
--- arch/blackfin/mach-bf548/boards/ezkit.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/blackfin/mach-bf548/boards/ezkit.c +2 -2
@@ -99,8 +99,8 @@ static struct platform_device bfin_isp1760_device = {#include <mach/bf54x-lq043.h> static struct bfin_bf54xfb_mach_info bf54x_lq043_data = { - .width =480 , - .height =272 , + .width =95 , + .height =54 , .xres = {480 ,480 ,480 }, .yres = {272 ,272 ,272 }, .bpp = {24 ,24 ,24 },
Signature · 1 line
1.6.4.2
PATCH 43/72 Blackfin: fix read buffer overflow
In reply to Mike FrysingerFrom: Roel Kluin <[email protected]>
Check whether index is within bounds before testing the element.
--- arch/blackfin/kernel/bfin_dma_5xx.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
arch/blackfin/kernel/bfin_dma_5xx.c +4 -4
@@ -147,8 +147,8 @@ EXPORT_SYMBOL(request_dma);int set_dma_callback (unsigned int channel,irq_handler_t callback,void *data) { -BUG_ON (!(dma_ch[channel].chan_status !=DMA_CHANNEL_FREE - && channel <MAX_DMA_CHANNELS )); +BUG_ON (channel >=MAX_DMA_CHANNELS || + dma_ch[channel].chan_status ==DMA_CHANNEL_FREE );if (callback !=NULL ) {int ret;
@@ -182,8 +182,8 @@ static void clear_dma_buffer(unsigned int channel)void free_dma (unsigned int channel) {pr_debug ("freedma() : BEGIN \n" ); -BUG_ON (!(dma_ch[channel].chan_status !=DMA_CHANNEL_FREE - && channel <MAX_DMA_CHANNELS )); +BUG_ON (channel >=MAX_DMA_CHANNELS || + dma_ch[channel].chan_status ==DMA_CHANNEL_FREE );/* Halt the DMA */ disable_dma (channel);
Signature · 1 line
1.6.4.2
PATCH 44/72 Blackfin: bf538-ezkit: add resources for parallel flash
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
The board has some parallel flash hooked up to the async banks, so add appropriate physmap resources for it.
--- arch/blackfin/mach-bf538/boards/ezkit.c | 49 +++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-)
arch/blackfin/mach-bf538/boards/ezkit.c +49 -0
@@ -31,6 +31,7 @@#include <linux/device.h> #include <linux/platform_device.h> #include <linux/mtd/mtd.h> +#include <linux/mtd/physmap.h> #include <linux/mtd/partitions.h> #include <linux/spi/spi.h> #include <linux/spi/flash.h>
@@ -561,6 +562,50 @@ static struct platform_device bfin_dpmc = { }, }; +#if defined(CONFIG_MTD_PHYSMAP ) || defined(CONFIG_MTD_PHYSMAP_MODULE ) +static struct mtd_partition ezkit_partitions[] = { + { + .name ="bootloader(nor)" , + .size =0x40000 , + .offset =0 , + }, { + .name ="linux kernel(nor)" , + .size =0x180000 , + .offset =MTDPART_OFS_APPEND , + }, { + .name ="file system(nor)" , + .size =MTDPART_SIZ_FULL , + .offset =MTDPART_OFS_APPEND , + } +}; + +static struct physmap_flash_data ezkit_flash_data = { + .width =2 , + .parts = ezkit_partitions, + .nr_parts =ARRAY_SIZE (ezkit_partitions), +}; + +static struct resource ezkit_flash_resource = { + .start =0x20000000 , +#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) + .end =0x202fffff , +#else + .end =0x203fffff , +#endif + .flags =IORESOURCE_MEM , +}; + +static struct platform_device ezkit_flash_device = { + .name ="physmap-flash" , + .id =0 , + .dev = { + .platform_data = &ezkit_flash_data, + }, + .num_resources =1 , + .resource = &ezkit_flash_resource, +}; +#endif +static struct platform_device *cm_bf538_devices[]__initdata = { &bfin_dpmc,
@@ -609,6 +654,10 @@ static struct platform_device *cm_bf538_devices[] __initdata = {#endif &bfin_gpios_device, + +#if defined(CONFIG_MTD_PHYSMAP ) || defined(CONFIG_MTD_PHYSMAP_MODULE ) + &ezkit_flash_device, +#endif };static int __init ezkit_init (void )
Signature · 1 line
1.6.4.2
PATCH 45/72 Blackfin: update anomaly lists
In reply to Mike FrysingerFrom: Yi Li <[email protected]>
--- arch/blackfin/mach-bf518/include/mach/anomaly.h | 1 + arch/blackfin/mach-bf527/include/mach/anomaly.h | 13 +++++++++++-- arch/blackfin/mach-bf537/include/mach/anomaly.h | 2 +- arch/blackfin/mach-bf538/include/mach/anomaly.h | 2 +- arch/blackfin/mach-bf548/include/mach/anomaly.h | 21 +++++++++++++++++++-- arch/blackfin/mach-bf561/include/mach/anomaly.h | 2 ++ 6 files changed, 35 insertions(+), 6 deletions(-)
arch/blackfin/mach-bf518/include/mach/anomaly.h +1 -0
@@ -124,6 +124,7 @@#define ANOMALY_05000386 (0)#define ANOMALY_05000389 (0)#define ANOMALY_05000400 (0) +#define ANOMALY_05000402 (0)#define ANOMALY_05000412 (0)#define ANOMALY_05000432 (0)#define ANOMALY_05000447 (0)
arch/blackfin/mach-bf527/include/mach/anomaly.h +11 -2
@@ -7,7 +7,7 @@*/ /* This file should be up to date with: -* - Revision C, 03/13/2009; ADSP-BF526 Blackfin Processor Anomaly List +* - Revision D, 08/14/2009; ADSP-BF526 Blackfin Processor Anomaly List * - Revision F, 03/03/2009; ADSP-BF527 Blackfin Processor Anomaly List */
@@ -176,7 +176,7 @@#define ANOMALY_05000443 (1)/* The WURESET Bit in the SYSCR Register is not Functional */ #define ANOMALY_05000445 (1) -/* USB DMA Short Packet Data Corruption */ +/* USB DMA Mode 1 Short Packet Data Corruption */ #define ANOMALY_05000450 (1)/* BCODE_QUICKBOOT, BCODE_ALLBOOT, and BCODE_FULLBOOT Settings in SYSCR Register Not Functional */ #define ANOMALY_05000451 (1)
@@ -186,12 +186,20 @@#define ANOMALY_05000456 (1)/* Host DMA Port Responds to Certain Bus Activity Without HOST_CE Assertion */ #define ANOMALY_05000457 (1) +/* USB DMA Mode 1 Failure When Multiple USB DMA Channels Are Concurrently Enabled */ +#define ANOMALY_05000460 (1)/* False Hardware Error when RETI Points to Invalid Memory */ #define ANOMALY_05000461 (1) +/* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */ +#define ANOMALY_05000462 (1)/* USB Rx DMA hang */ #define ANOMALY_05000465 (1) +/* TxPktRdy Bit Not Set for Transmit Endpoint When Core and DMA Access USB Endpoint FIFOs Simultaneously */ +#define ANOMALY_05000466 (1)/* Possible RX data corruption when control & data EP FIFOs are accessed via the core */ #define ANOMALY_05000467 (1) +/* PLL Latches Incorrect Settings During Reset */ +#define ANOMALY_05000469 (1)/* Anomalies that don't exist on this proc */ #define ANOMALY_05000099 (0)
@@ -238,6 +246,7 @@#define ANOMALY_05000362 (1)#define ANOMALY_05000363 (0)#define ANOMALY_05000400 (0) +#define ANOMALY_05000402 (0)#define ANOMALY_05000412 (0)#define ANOMALY_05000447 (0)#define ANOMALY_05000448 (0)
arch/blackfin/mach-bf537/include/mach/anomaly.h +1 -1
@@ -143,7 +143,7 @@/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */ #define ANOMALY_05000371 (1)/* SSYNC Stalls Processor when Executed from Non-Cacheable Memory */ -#define ANOMALY_05000402 (__SILICON_REVISION__ >= 5) +#define ANOMALY_05000402 (__SILICON_REVISION__ == 2)/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */ #define ANOMALY_05000403 (1)/* Speculative Fetches Can Cause Undesired External FIFO Operations */
arch/blackfin/mach-bf538/include/mach/anomaly.h +1 -1
@@ -113,7 +113,7 @@/* GPIO Pins PC1 and PC4 Can Function as Normal Outputs */ #define ANOMALY_05000375 (__SILICON_REVISION__ < 4)/* SSYNC Stalls Processor when Executed from Non-Cacheable Memory */ -#define ANOMALY_05000402 (__SILICON_REVISION__ < 4) +#define ANOMALY_05000402 (__SILICON_REVISION__ == 3)/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */ #define ANOMALY_05000403 (1)/* Speculative Fetches Can Cause Undesired External FIFO Operations */
arch/blackfin/mach-bf548/include/mach/anomaly.h +19 -2
@@ -7,7 +7,7 @@*/ /* This file should be up to date with: -* - Revision H, 01/16/2009; ADSP-BF542/BF544/BF547/BF548/BF549 Blackfin Processor Anomaly List +* - Revision I, 07/23/2009; ADSP-BF542/BF544/BF547/BF548/BF549 Blackfin Processor Anomaly List */ #ifndef _MACH_ANOMALY_H_
@@ -162,6 +162,8 @@#define ANOMALY_05000430 (__SILICON_REVISION__ >= 2)/* Incorrect Use of Stack in Lockbox Firmware During Authentication */ #define ANOMALY_05000431 (__SILICON_REVISION__ < 3) +/* SW Breakpoints Ignored Upon Return From Lockbox Authentication */ +#define ANOMALY_05000434 (1)/* OTP Write Accesses Not Supported */ #define ANOMALY_05000442 (__SILICON_REVISION__ < 1)/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
@@ -176,12 +178,26 @@#define ANOMALY_05000449 (__SILICON_REVISION__ == 1)/* USB DMA Mode 1 Short Packet Data Corruption */ #define ANOMALY_05000450 (1) +/* Incorrect Default Hysteresis Setting for RESET, NMI, and BMODE Signals */ +#define ANOMALY_05000452 (__SILICON_REVISION__ < 1)/* USB Receive Interrupt Is Not Generated in DMA Mode 1 */ -#define ANOMALY_05000456 (__SILICON_REVISION__ < 3) +#define ANOMALY_05000456 (1) +/* Host DMA Port Responds to Certain Bus Activity Without HOST_CE Assertion */ +#define ANOMALY_05000457 (1) +/* USB DMA Mode 1 Failure When Multiple USB DMA Channels Are Concurrently Enabled */ +#define ANOMALY_05000460 (1)/* False Hardware Error when RETI Points to Invalid Memory */ #define ANOMALY_05000461 (1) +/* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */ +#define ANOMALY_05000462 (1) +/* USB DMA RX Data Corruption */ +#define ANOMALY_05000463 (1) +/* USB TX DMA Hang */ +#define ANOMALY_05000464 (1)/* USB Rx DMA hang */ #define ANOMALY_05000465 (1) +/* TxPktRdy Bit Not Set for Transmit Endpoint When Core and DMA Access USB Endpoint FIFOs Simultaneously */ +#define ANOMALY_05000466 (1)/* Possible RX data corruption when control & data EP FIFOs are accessed via the core */ #define ANOMALY_05000467 (1)
@@ -230,6 +246,7 @@#define ANOMALY_05000364 (0)#define ANOMALY_05000380 (0)#define ANOMALY_05000400 (0) +#define ANOMALY_05000402 (0)#define ANOMALY_05000412 (0)#define ANOMALY_05000432 (0)#define ANOMALY_05000435 (0)
arch/blackfin/mach-bf561/include/mach/anomaly.h +2 -0
@@ -262,6 +262,8 @@#define ANOMALY_05000366 (1)/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */ #define ANOMALY_05000371 (1) +/* SSYNC Stalls Processor when Executed from Non-Cacheable Memory */ +#define ANOMALY_05000402 (__SILICON_REVISION__ == 4)/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */ #define ANOMALY_05000403 (1)/* TESTSET Instruction Causes Data Corruption with Writeback Data Cache Enabled */
Signature · 1 line
1.6.4.2
PATCH 46/72 Blackfin: bf537-stamp: update ad1836 resources
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
Update the ad1836 resources for the new ASoC driver.
--- arch/blackfin/mach-bf537/boards/stamp.c | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-)
arch/blackfin/mach-bf537/boards/stamp.c +17 -5
@@ -532,8 +532,8 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = { };#endif -#if defined(CONFIG_SND_BLACKFIN_AD1836 ) \ - || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) +#if defined(CONFIG_SND_BF5XX_SOC_AD1836 ) \ + || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE )static struct bfin5xx_spi_chip ad1836_spi_chip_info = { .enable_dma =0 , .bits_per_word = 16,
@@ -883,14 +883,15 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_SND_BLACKFIN_AD1836) \ - || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) +#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \ + || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE) { .modalias = "ad1836-spi", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, - .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, + .chip_select = 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */ .controller_data = &ad1836_spi_chip_info, + .mode = SPI_MODE_3, }, #endif
@@ -1628,6 +1629,13 @@ static struct platform_device bfin_dpmc = { }, }; +#if defined(CONFIG_SND_BF5XX_TDM ) || defined(CONFIG_SND_BF5XX_TDM_MODULE ) +static struct platform_device bfin_tdm = { + .name ="bfin-tdm" , +/* TODO: add platform data here */ +}; +#endif +static struct platform_device *stamp_devices[]__initdata = { &bfin_dpmc,
@@ -1733,6 +1741,10 @@ static struct platform_device *stamp_devices[] __initdata = {#if defined(CONFIG_MTD_PHYSMAP ) || defined(CONFIG_MTD_PHYSMAP_MODULE ) &stamp_flash_device,#endif + +#if defined(CONFIG_SND_BF5XX_TDM ) || defined(CONFIG_SND_BF5XX_TDM_MODULE ) + &bfin_tdm, +#endif };static int __init stamp_init (void )
Signature · 1 line
1.6.4.2
PATCH 47/72 Blackfin: cleanup sync handling when enabling/disabling cplbs
In reply to Mike FrysingerFrom: Yi Li <[email protected]>
The handling of updating the [DI]MEM_CONTROL MMRs does not follow proper sync procedures as laid out in the Blackfin programming manual. So rather than audit/fix every call location, create helper functions that do the right things in order to safely update these MMRs. Then convert all call sites to use these new helper functions.
While we're fixing the code, drop the workaround for anomaly 05000125 as that anomaly applies to old versions of silicon that we do not support.
--- arch/blackfin/include/asm/cplb.h | 46 +++++++++++++++++++- arch/blackfin/kernel/cplb-mpu/cacheinit.c | 6 ++- arch/blackfin/kernel/cplb-mpu/cplbmgr.c | 61 +++++--------------------- arch/blackfin/kernel/cplb-nompu/cacheinit.c | 6 ++- arch/blackfin/kernel/cplb-nompu/cplbmgr.c | 33 ++------------ arch/blackfin/mach-bf561/secondary.S | 20 ++------- arch/blackfin/mach-common/entry.S | 14 ++---- arch/blackfin/mach-common/pm.c | 64 +++----------------------- 8 files changed, 84 insertions(+), 166 deletions(-)
arch/blackfin/include/asm/cplb.h +45 -1
@@ -125,4 +125,48 @@#define FAULT_USERSUPV (1 << 17)#define FAULT_CPLBBITS 0x0000ffff -#endif /* _CPLB_H */ +#ifndef __ASSEMBLY__ + +static inline void _disable_cplb (u32 mmr,u32 mask) +{ +u32 ctrl =bfin_read32 (mmr) & ~mask; +/* CSYNC to ensure load store ordering */ +__builtin_bfin_csync (); +bfin_write32 (mmr, ctrl); +__builtin_bfin_ssync (); +} +static inline void disable_cplb (u32 mmr,u32 mask) +{ +u32 ctrl =bfin_read32 (mmr) & ~mask; +CSYNC (); +bfin_write32 (mmr, ctrl); +SSYNC (); +} +#define _disable_dcplb () _disable_cplb(DMEM_CONTROL, ENDCPLB) +#define disable_dcplb () disable_cplb(DMEM_CONTROL, ENDCPLB) +#define _disable_icplb () _disable_cplb(IMEM_CONTROL, ENICPLB) +#define disable_icplb () disable_cplb(IMEM_CONTROL, ENICPLB) + +static inline void _enable_cplb (u32 mmr,u32 mask) +{ +u32 ctrl =bfin_read32 (mmr) | mask; +/* CSYNC to ensure load store ordering */ +__builtin_bfin_csync (); +bfin_write32 (mmr, ctrl); +__builtin_bfin_ssync (); +} +static inline void enable_cplb (u32 mmr,u32 mask) +{ +u32 ctrl =bfin_read32 (mmr) | mask; +CSYNC (); +bfin_write32 (mmr, ctrl); +SSYNC (); +} +#define _enable_dcplb () _enable_cplb(DMEM_CONTROL, ENDCPLB) +#define enable_dcplb () enable_cplb(DMEM_CONTROL, ENDCPLB) +#define _enable_icplb () _enable_cplb(IMEM_CONTROL, ENICPLB) +#define enable_icplb () enable_cplb(IMEM_CONTROL, ENICPLB) + +#endif /* __ASSEMBLY__ */ + +#endif /* _CPLB_H */
arch/blackfin/kernel/cplb-mpu/cacheinit.c +4 -2
@@ -30,13 +30,14 @@ void __cpuinit bfin_icache_init(struct cplb_entry *icplb_tbl)unsigned long ctrl;int i; -SSYNC ();for (i =0 ; i <MAX_CPLBS ; i++) {bfin_write32 (ICPLB_ADDR0 + i *4 , icplb_tbl[i].addr);bfin_write32 (ICPLB_DATA0 + i *4 , icplb_tbl[i].data); } ctrl =bfin_read_IMEM_CONTROL (); ctrl |=IMC |ENICPLB ; +/* CSYNC to ensure load store ordering */ +CSYNC ();bfin_write_IMEM_CONTROL (ctrl);SSYNC (); }
@@ -48,7 +49,6 @@ void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl)unsigned long ctrl;int i; -SSYNC ();for (i =0 ; i <MAX_CPLBS ; i++) {bfin_write32 (DCPLB_ADDR0 + i *4 , dcplb_tbl[i].addr);bfin_write32 (DCPLB_DATA0 + i *4 , dcplb_tbl[i].data);
@@ -63,6 +63,8 @@ void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl)* to port B */ ctrl |=DMEM_CNTR |PORT_PREF0 | (ANOMALY_05000287 ?PORT_PREF1 :0 ); +/* CSYNC to ensure load store ordering */ +CSYNC ();bfin_write_DMEM_CONTROL (ctrl);SSYNC (); }
arch/blackfin/kernel/cplb-mpu/cplbmgr.c +11 -50
115 lines not on this page · raw message
arch/blackfin/kernel/cplb-nompu/cacheinit.c +4 -2
@@ -30,13 +30,14 @@ void __cpuinit bfin_icache_init(struct cplb_entry *icplb_tbl)unsigned long ctrl;int i; -SSYNC ();for (i =0 ; i <MAX_CPLBS ; i++) {bfin_write32 (ICPLB_ADDR0 + i *4 , icplb_tbl[i].addr);bfin_write32 (ICPLB_DATA0 + i *4 , icplb_tbl[i].data); } ctrl =bfin_read_IMEM_CONTROL (); ctrl |=IMC |ENICPLB ; +/* CSYNC to ensure load store ordering */ +CSYNC ();bfin_write_IMEM_CONTROL (ctrl);SSYNC (); }
@@ -48,7 +49,6 @@ void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl)unsigned long ctrl;int i; -SSYNC ();for (i =0 ; i <MAX_CPLBS ; i++) {bfin_write32 (DCPLB_ADDR0 + i *4 , dcplb_tbl[i].addr);bfin_write32 (DCPLB_DATA0 + i *4 , dcplb_tbl[i].data);
@@ -63,6 +63,8 @@ void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl)* to port B */ ctrl |=DMEM_CNTR |PORT_PREF0 | (ANOMALY_05000287 ?PORT_PREF1 :0 ); +/* CSYNC to ensure load store ordering */ +CSYNC ();bfin_write_DMEM_CONTROL (ctrl);SSYNC (); }
arch/blackfin/kernel/cplb-nompu/cplbmgr.c +4 -29
@@ -48,36 +48,13 @@ int nr_cplb_flush[NR_CPUS], nr_dcplb_prot[NR_CPUS];#define MGR_ATTR #endif -/* -* We're in an exception handler. The normal cli nop nop workaround -* isn't going to do very much, as the only thing that can interrupt -* us is an NMI, and the cli isn't going to stop that. -*/ -#define NOWA_SSYNC __asm__ __volatile__ ("ssync;") - -/* Anomaly handlers provide SSYNCs, so avoid extra if anomaly is present */ -#if ANOMALY_05000125 - -#define bfin_write_DMEM_CONTROL_SSYNC (v) bfin_write_DMEM_CONTROL(v) -#define bfin_write_IMEM_CONTROL_SSYNC (v) bfin_write_IMEM_CONTROL(v) - -#else - -#define bfin_write_DMEM_CONTROL_SSYNC (v) \ - do { NOWA_SSYNC; bfin_write_DMEM_CONTROL(v); NOWA_SSYNC; } while (0) -#define bfin_write_IMEM_CONTROL_SSYNC (v) \ - do { NOWA_SSYNC; bfin_write_IMEM_CONTROL(v); NOWA_SSYNC; } while (0) - -#endif -static inline void write_dcplb_data (int cpu,int idx,unsigned long data,unsigned long addr) { -unsigned long ctrl =bfin_read_DMEM_CONTROL (); -bfin_write_DMEM_CONTROL_SSYNC (ctrl & ~ENDCPLB ); +_disable_dcplb ();bfin_write32 (DCPLB_DATA0 + idx *4 , data);bfin_write32 (DCPLB_ADDR0 + idx *4 , addr); -bfin_write_DMEM_CONTROL_SSYNC (ctrl); +_enable_dcplb ();#ifdef CONFIG_CPLB_INFO dcplb_tbl[cpu][idx].addr = addr;
@@ -88,12 +65,10 @@ static inline void write_dcplb_data(int cpu, int idx, unsigned long data,static inline void write_icplb_data (int cpu,int idx,unsigned long data,unsigned long addr) { -unsigned long ctrl =bfin_read_IMEM_CONTROL (); - -bfin_write_IMEM_CONTROL_SSYNC (ctrl & ~ENICPLB ); +_disable_icplb ();bfin_write32 (ICPLB_DATA0 + idx *4 , data);bfin_write32 (ICPLB_ADDR0 + idx *4 , addr); -bfin_write_IMEM_CONTROL_SSYNC (ctrl); +_enable_icplb ();#ifdef CONFIG_CPLB_INFO icplb_tbl[cpu][idx].addr = addr;
arch/blackfin/mach-bf561/secondary.S +4 -16
@@ -85,16 +85,10 @@ ENTRY(_coreb_trampoline_start) R0 = ~ENICPLB; R0 = R0 & R1; - /* Anomaly 05000125 */ -#ifdef ANOMALY_05000125 - CLI R2; - SSYNC; -#endif + /* Disabling of CPLBs should be proceeded by a CSYNC */ + CSYNC; [p0] = R0; SSYNC; -#ifdef ANOMALY_05000125 - STI R2; -#endif /* Turn off the dcache */ p0.l = LO(DMEM_CONTROL);
@@ -103,16 +97,10 @@ ENTRY(_coreb_trampoline_start) R0 = ~ENDCPLB; R0 = R0 & R1; - /* Anomaly 05000125 */ -#ifdef ANOMALY_05000125 - CLI R2; - SSYNC; -#endif + /* Disabling of CPLBs should be proceeded by a CSYNC */ + CSYNC; [p0] = R0; SSYNC; -#ifdef ANOMALY_05000125 - STI R2; -#endif /* in case of double faults, save a few things */ p0.l = _init_retx_coreb;
arch/blackfin/mach-common/entry.S +4 -10
@@ -397,8 +397,7 @@ ENTRY(_double_fault) R5 = [P4]; /* Control Register*/ BITCLR(R5,ENICPLB_P); - SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */ - .align 8; + CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */ [P4] = R5; SSYNC;
@@ -406,8 +405,7 @@ ENTRY(_double_fault) P4.H = HI(DMEM_CONTROL); R5 = [P4]; BITCLR(R5,ENDCPLB_P); - SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */ - .align 8; + CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */ [P4] = R5; SSYNC;
@@ -1146,9 +1144,7 @@ ENTRY(_early_trap) R5 = [P4]; /* Control Register*/ BITCLR(R5,ENICPLB_P); - CLI R1; - SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */ - .align 8; + CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */ [P4] = R5; SSYNC;
@@ -1156,11 +1152,9 @@ ENTRY(_early_trap) P4.H = HI(DMEM_CONTROL); R5 = [P4]; BITCLR(R5,ENDCPLB_P); - SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */ - .align 8; + CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */ [P4] = R5; SSYNC; - STI R1; r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */ r1 = RETX;
arch/blackfin/mach-common/pm.c +8 -56
88 lines not on this page · raw message
Signature · 1 line
1.6.4.2
PATCH 48/72 Blackfin: SMP port does not yet support cpu frequency scaling
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
We have an item to get this fixed, but in the mean time, disable selection via Kconfig dependencies.
--- arch/blackfin/Kconfig | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
arch/blackfin/Kconfig +3 -1
@@ -1152,11 +1152,12 @@ source "fs/Kconfig.binfmt" endmenu menu "Power management options" + depends on !SMP + source "kernel/power/Kconfig" config ARCH_SUSPEND_POSSIBLE def_bool y - depends on !SMP choice prompt "Standby Power Saving Mode"
@@ -1244,6 +1245,7 @@ config PM_BFIN_WAKE_GP endmenu menu "CPU Frequency scaling" + depends on !SMP source "drivers/cpufreq/Kconfig"
Signature · 1 line
1.6.4.2
PATCH 49/72 Blackfin: fix BF522/BF523 max VCO mixup
In reply to Mike FrysingerThe BF522 and BF523 had their real max VCO values swapped.
--- arch/blackfin/Kconfig | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/blackfin/Kconfig +2 -2
@@ -574,8 +574,8 @@ config MAX_VCO_HZ default 400000000 if BF514 default 400000000 if BF516 default 400000000 if BF518 - default 600000000 if BF522 - default 400000000 if BF523 + default 400000000 if BF522 + default 600000000 if BF523 default 400000000 if BF524 default 600000000 if BF525 default 400000000 if BF526
Signature · 1 line
1.6.4.2
PATCH 50/72 Blackfin: do not trace the exception handler
In reply to Mike FrysingerFrom: Yi Li <[email protected]>
Since the exception handler cannot cause exceptions, we cannot trace it without easily causing double faults and crashing the system.
--- arch/blackfin/kernel/traps.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/kernel/traps.c +1 -1
@@ -257,7 +257,7 @@ static int kernel_mode_regs(struct pt_regs *regs)return regs->ipend &0xffc0 ; } -asmlinkage void trap_c(struct pt_regs *fp) +asmlinkage notrace void trap_c(struct pt_regs *fp) {#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON int j;
Signature · 1 line
1.6.4.2
PATCH 51/72 Blackfin: drop board resources for dead devices (pbx/ad9960)
In reply to Mike FrysingerThese hardware devices are dead and the drivers never cleaned up/merged, so punt the useless board resource info.
--- arch/blackfin/mach-bf518/boards/ezbrd.c | 27 ---------------- arch/blackfin/mach-bf527/boards/cm_bf527.c | 43 -------------------------- arch/blackfin/mach-bf527/boards/ezbrd.c | 27 ---------------- arch/blackfin/mach-bf527/boards/ezkit.c | 43 -------------------------- arch/blackfin/mach-bf533/boards/H8606.c | 26 ---------------- arch/blackfin/mach-bf533/boards/stamp.c | 28 ----------------- arch/blackfin/mach-bf537/boards/cm_bf537.c | 17 ---------- arch/blackfin/mach-bf537/boards/pnav10.c | 16 ---------- arch/blackfin/mach-bf537/boards/stamp.c | 44 --------------------------- arch/blackfin/mach-bf537/boards/tcm_bf537.c | 17 ---------- arch/blackfin/mach-bf561/boards/cm_bf561.c | 16 ---------- 11 files changed, 0 insertions(+), 304 deletions(-)
arch/blackfin/mach-bf518/boards/ezbrd.c +0 -27
@@ -199,15 +199,6 @@ static struct bfin5xx_spi_chip mmc_spi_chip_info = { };#endif -#if defined(CONFIG_PBX ) -static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { - .ctl_reg =0x4 ,/* send zero */ - .enable_dma =0 , - .bits_per_word =8 , - .cs_change_per_word =1 , -}; -#endif -#if defined(CONFIG_TOUCHSCREEN_AD7877 ) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE )static struct bfin5xx_spi_chip spi_ad7877_chip_info = { .enable_dma = 0,
@@ -296,24 +287,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { .mode = SPI_MODE_3, },#endif -#if defined(CONFIG_PBX) - { - .modalias = "fxs-spi", - .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ - .bus_num = 0, - .chip_select = 8 - CONFIG_J11_JUMPER, - .controller_data = &spi_si3xxx_chip_info, - .mode = SPI_MODE_3, - }, - { - .modalias = "fxo-spi", - .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ - .bus_num = 0, - .chip_select = 8 - CONFIG_J19_JUMPER, - .controller_data = &spi_si3xxx_chip_info, - .mode = SPI_MODE_3, - }, -#endif#if defined(CONFIG_TOUCHSCREEN_AD7877 ) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE ) { .modalias = "ad7877",
arch/blackfin/mach-bf527/boards/cm_bf527.c +0 -43
67 lines not on this page · raw message
arch/blackfin/mach-bf527/boards/ezbrd.c +0 -27
@@ -263,15 +263,6 @@ static struct bfin5xx_spi_chip mmc_spi_chip_info = { };#endif -#if defined(CONFIG_PBX ) -static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { - .ctl_reg =0x4 ,/* send zero */ - .enable_dma =0 , - .bits_per_word =8 , - .cs_change_per_word =1 , -}; -#endif -#if defined(CONFIG_TOUCHSCREEN_AD7877 ) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE )static struct bfin5xx_spi_chip spi_ad7877_chip_info = { .enable_dma = 0,
@@ -376,24 +367,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { .mode = SPI_MODE_3, },#endif -#if defined(CONFIG_PBX) - { - .modalias = "fxs-spi", - .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ - .bus_num = 0, - .chip_select = 8 - CONFIG_J11_JUMPER, - .controller_data = &spi_si3xxx_chip_info, - .mode = SPI_MODE_3, - }, - { - .modalias = "fxo-spi", - .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ - .bus_num = 0, - .chip_select = 8 - CONFIG_J19_JUMPER, - .controller_data = &spi_si3xxx_chip_info, - .mode = SPI_MODE_3, - }, -#endif#if defined(CONFIG_TOUCHSCREEN_AD7877 ) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE ) { .modalias = "ad7877",
arch/blackfin/mach-bf527/boards/ezkit.c +0 -43
67 lines not on this page · raw message
arch/blackfin/mach-bf533/boards/H8606.c +0 -26
@@ -201,15 +201,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = { };#endif -#if defined(CONFIG_PBX ) -static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { - .ctl_reg =0x1c04 , - .enable_dma =0 , - .bits_per_word =8 , - .cs_change_per_word =1 , -}; -#endif -/* Notice: for blackfin, the speed_hz is the value of register * SPI_BAUD, not the real baudrate */ static struct spi_board_info bfin_spi_board_info[]__initdata = {
@@ -248,23 +239,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_PBX) - { - .modalias = "fxs-spi", - .max_speed_hz = 4, - .bus_num = 1, - .chip_select = 3, - .controller_data = &spi_si3xxx_chip_info, - }, - - { - .modalias = "fxo-spi", - .max_speed_hz = 4, - .bus_num = 1, - .chip_select = 2, - .controller_data = &spi_si3xxx_chip_info, - }, -#endif };/* SPI (0) */
arch/blackfin/mach-bf533/boards/stamp.c +0 -28
@@ -219,15 +219,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = { };#endif -#if defined(CONFIG_PBX ) -static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { - .ctl_reg =0x4 ,/* send zero */ - .enable_dma =0 , - .bits_per_word =8 , - .cs_change_per_word =1 , -}; -#endif -#if defined(CONFIG_SPI_SPIDEV ) || defined(CONFIG_SPI_SPIDEV_MODULE )static struct bfin5xx_spi_chip spidev_chip_info = { .enable_dma = 0,
@@ -298,25 +289,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_PBX) - { - .modalias = "fxs-spi", - .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ - .bus_num = 0, - .chip_select = 8 - CONFIG_J11_JUMPER, - .controller_data = &spi_si3xxx_chip_info, - .mode = SPI_MODE_3, - }, - { - .modalias = "fxo-spi", - .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ - .bus_num = 0, - .chip_select = 8 - CONFIG_J19_JUMPER, - .controller_data = &spi_si3xxx_chip_info, - .mode = SPI_MODE_3, - }, -#endif -#if defined(CONFIG_SPI_SPIDEV ) || defined(CONFIG_SPI_SPIDEV_MODULE ) { .modalias = "spidev",
arch/blackfin/mach-bf537/boards/cm_bf537.c +0 -17
@@ -101,13 +101,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = { };#endif -#if defined(CONFIG_AD9960 ) || defined(CONFIG_AD9960_MODULE ) -static struct bfin5xx_spi_chip ad9960_spi_chip_info = { - .enable_dma =0 , - .bits_per_word =16 , -}; -#endif -#if defined(CONFIG_MMC_SPI ) || defined(CONFIG_MMC_SPI_MODULE )static struct bfin5xx_spi_chip mmc_spi_chip_info = { .enable_dma = 0,
@@ -150,16 +143,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) - { - .modalias = "ad9960-spi", - .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ - .bus_num = 0, - .chip_select = 1, - .controller_data = &ad9960_spi_chip_info, - }, -#endif -#if defined(CONFIG_MMC_SPI ) || defined(CONFIG_MMC_SPI_MODULE ) { .modalias = "mmc_spi",
arch/blackfin/mach-bf537/boards/pnav10.c +0 -16
@@ -293,13 +293,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = { };#endif -#if defined(CONFIG_AD9960 ) || defined(CONFIG_AD9960_MODULE ) -static struct bfin5xx_spi_chip ad9960_spi_chip_info = { - .enable_dma =0 , - .bits_per_word =16 , -}; -#endif -#if defined(CONFIG_MMC_SPI ) || defined(CONFIG_MMC_SPI_MODULE )static struct bfin5xx_spi_chip mmc_spi_chip_info = { .enable_dma = 0,
@@ -366,15 +359,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { .controller_data = &ad1836_spi_chip_info, },#endif -#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) - { - .modalias = "ad9960-spi", - .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ - .bus_num = 0, - .chip_select = 1, - .controller_data = &ad9960_spi_chip_info, - }, -#endif#if defined(CONFIG_MMC_SPI ) || defined(CONFIG_MMC_SPI_MODULE ) { .modalias = "mmc_spi",
arch/blackfin/mach-bf537/boards/stamp.c +0 -44
68 lines not on this page · raw message
arch/blackfin/mach-bf537/boards/tcm_bf537.c +0 -17
@@ -101,13 +101,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = { };#endif -#if defined(CONFIG_AD9960 ) || defined(CONFIG_AD9960_MODULE ) -static struct bfin5xx_spi_chip ad9960_spi_chip_info = { - .enable_dma =0 , - .bits_per_word =16 , -}; -#endif -#if defined(CONFIG_MMC_SPI ) || defined(CONFIG_MMC_SPI_MODULE )static struct bfin5xx_spi_chip mmc_spi_chip_info = { .enable_dma = 0,
@@ -150,16 +143,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { },#endif -#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) - { - .modalias = "ad9960-spi", - .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ - .bus_num = 0, - .chip_select = 1, - .controller_data = &ad9960_spi_chip_info, - }, -#endif -#if defined(CONFIG_MMC_SPI ) || defined(CONFIG_MMC_SPI_MODULE ) { .modalias = "mmc_spi",
arch/blackfin/mach-bf561/boards/cm_bf561.c +0 -16
@@ -98,13 +98,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = { };#endif -#if defined(CONFIG_AD9960 ) || defined(CONFIG_AD9960_MODULE ) -static struct bfin5xx_spi_chip ad9960_spi_chip_info = { - .enable_dma =0 , - .bits_per_word =16 , -}; -#endif -#if defined(CONFIG_MMC_SPI ) || defined(CONFIG_MMC_SPI_MODULE )static struct bfin5xx_spi_chip mmc_spi_chip_info = { .enable_dma = 0,
@@ -146,15 +139,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { .controller_data = &ad1836_spi_chip_info, },#endif -#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) - { - .modalias = "ad9960-spi", - .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ - .bus_num = 0, - .chip_select = 1, - .controller_data = &ad9960_spi_chip_info, - }, -#endif#if defined(CONFIG_MMC_SPI ) || defined(CONFIG_MMC_SPI_MODULE ) { .modalias = "mmc_spi",
Signature · 1 line
1.6.4.2
PATCH 52/72 Blackfin: punt dead cache locking code
In reply to Mike FrysingerNo one uses these functions, and some are duplicate of existing C code. So just punt the whole thing.
--- arch/blackfin/Kconfig | 4 - arch/blackfin/include/asm/bfin-global.h | 5 - arch/blackfin/kernel/setup.c | 51 ------- arch/blackfin/mach-common/Makefile | 1 - arch/blackfin/mach-common/lock.S | 223 ------------------------------- 5 files changed, 0 insertions(+), 284 deletions(-) delete mode 100644 arch/blackfin/mach-common/lock.S
arch/blackfin/Kconfig +0 -4
@@ -917,10 +917,6 @@ comment "Cache Support" config BFIN_ICACHE bool "Enable ICACHE" default y -config BFIN_ICACHE_LOCK - bool "Enable Instruction Cache Locking" - depends on BFIN_ICACHE - default n config BFIN_EXTMEM_ICACHEABLE bool "Enable ICACHE for external memory" depends on BFIN_ICACHE
arch/blackfin/include/asm/bfin-global.h +0 -5
@@ -99,11 +99,6 @@ extern unsigned long bfin_sic_iwr[];extern unsigned vr_wakeup;extern u16 _bfin_swrst;/* shadow for Software Reset Register (SWRST) */ -#ifdef CONFIG_BFIN_ICACHE_LOCK -extern void cache_grab_lock (int way); -extern void bfin_cache_lock (int way); -#endif -#endif #endif /* _BLACKFIN_H_ */
arch/blackfin/kernel/setup.c +0 -51
57 lines not on this page · raw message
arch/blackfin/mach-common/Makefile +0 -1
@@ -6,7 +6,6 @@ obj-y := \ cache.o cache-c.o entry.o head.o \ interrupt.o arch_checks.o ints-priority.o -obj-$(CONFIG_BFIN_ICACHE_LOCK) += lock.o obj-$(CONFIG_PM) += pm.o dpmc_modes.o obj-$(CONFIG_CPU_FREQ) += cpufreq.o obj-$(CONFIG_CPU_VOLTAGE) += dpmc.o
arch/blackfin/mach-common/lock.S deleted +0 -223
223 lines not on this page · raw message
Signature · 1 line
1.6.4.2
PATCH 53/72 Blackfin: delete '-spi' suffix in ad1836/ad1938 driver name
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
The ASoC drivers have dropped the redundant "-spi" suffix in the driver name, so update the board resources accordingly.
--- arch/blackfin/mach-bf527/boards/cm_bf527.c | 2 +- arch/blackfin/mach-bf527/boards/ezkit.c | 2 +- arch/blackfin/mach-bf533/boards/H8606.c | 2 +- arch/blackfin/mach-bf533/boards/cm_bf533.c | 2 +- arch/blackfin/mach-bf533/boards/ezkit.c | 2 +- arch/blackfin/mach-bf533/boards/stamp.c | 2 +- arch/blackfin/mach-bf537/boards/cm_bf537.c | 2 +- arch/blackfin/mach-bf537/boards/pnav10.c | 2 +- arch/blackfin/mach-bf537/boards/stamp.c | 4 ++-- arch/blackfin/mach-bf537/boards/tcm_bf537.c | 2 +- arch/blackfin/mach-bf548/boards/ezkit.c | 2 +- arch/blackfin/mach-bf561/boards/cm_bf561.c | 2 +- arch/blackfin/mach-bf561/boards/ezkit.c | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-)
arch/blackfin/mach-bf527/boards/cm_bf527.c +1 -1
@@ -568,7 +568,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) \ || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
arch/blackfin/mach-bf527/boards/ezkit.c +1 -1
@@ -609,7 +609,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) \ || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
arch/blackfin/mach-bf533/boards/H8606.c +1 -1
@@ -231,7 +231,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 16, .bus_num = 1, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
arch/blackfin/mach-bf533/boards/cm_bf533.c +1 -1
@@ -130,7 +130,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
arch/blackfin/mach-bf533/boards/ezkit.c +1 -1
@@ -274,7 +274,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
arch/blackfin/mach-bf533/boards/stamp.c +1 -1
@@ -281,7 +281,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
arch/blackfin/mach-bf537/boards/cm_bf537.c +1 -1
@@ -135,7 +135,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
arch/blackfin/mach-bf537/boards/pnav10.c +1 -1
@@ -352,7 +352,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) \ || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
arch/blackfin/mach-bf537/boards/stamp.c +2 -2
@@ -870,7 +870,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BF5XX_SOC_AD1836 ) \ || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
@@ -881,7 +881,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BF5XX_SOC_AD1938 ) || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE ) { - .modalias = "ad1938-spi", + .modalias = "ad1938", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = 0,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
arch/blackfin/mach-bf537/boards/tcm_bf537.c +1 -1
@@ -135,7 +135,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
arch/blackfin/mach-bf548/boards/ezkit.c +1 -1
@@ -702,7 +702,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) \ || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 1, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
arch/blackfin/mach-bf561/boards/cm_bf561.c +1 -1
@@ -132,7 +132,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
arch/blackfin/mach-bf561/boards/ezkit.c +1 -1
@@ -345,7 +345,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {#if defined(CONFIG_SND_BLACKFIN_AD1836 ) \ || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE ) { - .modalias = "ad1836-spi", + .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
Signature · 1 line
1.6.4.2
PATCH 54/72 Blackfin: optimize fixed code handling for the most common case
In reply to Mike FrysingerThe majority of the time we are returning to user space, it is not in the fixed atomic code region. So rather than branch to a function where we check the PC and return, do the check inline and branch only when needed.
Also, tweak some of the fixed code handling based on assumptions we are aware of but cannot be expressed in C.
--- arch/blackfin/kernel/process.c | 10 ++-------- arch/blackfin/mach-common/entry.S | 6 ++++++ 2 files changed, 8 insertions(+), 8 deletions(-)
arch/blackfin/kernel/process.c +2 -8
@@ -282,25 +282,19 @@ void finish_atomic_sections (struct pt_regs *regs) {int __user *up0 = (int __user *)regs->p0; -if (regs->pc <ATOMIC_SEQS_START || regs->pc >=ATOMIC_SEQS_END ) -return ; -switch (regs->pc) {case ATOMIC_XCHG32 +2 :put_user (regs->r1, up0); - regs->pc +=2 ; + regs->pc =ATOMIC_XCHG32 +4 ;break ;case ATOMIC_CAS32 +2 :case ATOMIC_CAS32 +4 :if (regs->r0 == regs->r1) +case ATOMIC_CAS32 +6 :put_user (regs->r2, up0); regs->pc =ATOMIC_CAS32 +8 ;break ; -case ATOMIC_CAS32 +6 : -put_user (regs->r2, up0); - regs->pc +=2 ; -break ;case ATOMIC_ADD32 +2 : regs->r0 = regs->r1 + regs->r0;
arch/blackfin/mach-common/entry.S +6 -0
@@ -1025,6 +1025,12 @@ ENTRY(_schedule_and_signal_from_int) #endif sti r0; + /* finish the userspace "atomic" functions for it */ + r1 = FIXED_CODE_END; + r2 = [sp + PT_PC]; + cc = r1 <= r2; + if cc jump .Lresume_userspace (bp); + r0 = sp; sp += -12; call _finish_atomic_sections;
Signature · 1 line
1.6.4.2
PATCH 55/72 Blackfin: handle the core timer interrupt with handle_percpu_irq on SMP
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
--- arch/blackfin/mach-common/ints-priority.c | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-)
arch/blackfin/mach-common/ints-priority.c +10 -7
@@ -1052,18 +1052,26 @@ int __init init_arch_irq(void)set_irq_chained_handler (irq, bfin_demux_error_irq);break ;#endif +#ifdef CONFIG_SMP +#ifdef CONFIG_TICKSOURCE_GPTMR0 +case IRQ_TIMER0 : +#endif +#ifdef CONFIG_TICKSOURCE_CORETMR +case IRQ_CORETMR : +#endif case IRQ_SUPPLE_0 :case IRQ_SUPPLE_1 :set_irq_handler (irq, handle_percpu_irq);break ;#endif +#ifdef CONFIG_IPIPE #ifndef CONFIG_TICKSOURCE_CORETMR case IRQ_TIMER0 :set_irq_handler (irq, handle_simple_irq);break ; -#endif /* !CONFIG_TICKSOURCE_CORETMR */ +#endif case IRQ_CORETMR :set_irq_handler (irq, handle_simple_irq);break ;
@@ -1071,15 +1079,10 @@ int __init init_arch_irq(void)set_irq_handler (irq, handle_level_irq);break ;#else /* !CONFIG_IPIPE */ -#ifdef CONFIG_TICKSOURCE_GPTMR0 -case IRQ_TIMER0 : -set_irq_handler (irq, handle_percpu_irq); -break ; -#endif /* CONFIG_TICKSOURCE_GPTMR0 */ default :set_irq_handler (irq, handle_simple_irq);break ; -#endif /* !CONFIG_IPIPE */ +#endif /* !CONFIG_IPIPE */ } }
Signature · 1 line
1.6.4.2
PATCH 56/72 Blackfin: Fix link errors with binutils 2.19 and GCC 4.3
In reply to Mike FrysingerFrom: Ingo Molnar <[email protected]>
Not sure whether this has been reported/fixed before.
Today I built a Blackfin tool-chain from scratch for -tip testing, and it triggers:
arch/blackfin/kernel/vmlinux.lds:1238: undefined section `.data_a_l1' referenced in expression
and:
arch/blackfin/kernel/vmlinux.lds:1238: undefined section `.text_data_l1'
referenced in expression
Now i dont have any way to test this linker script, but it now at least builds fine after fixing what appears to be typos in those assert statements.
--- arch/blackfin/kernel/vmlinux.lds.S | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/blackfin/kernel/vmlinux.lds.S +2 -2
@@ -221,7 +221,7 @@ SECTIONS . = ALIGN(4); __ebss_l1 = .; } - ASSERT (SIZEOF(.data_a_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!") + ASSERT (SIZEOF(.data_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!") .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1)) {
@@ -262,7 +262,7 @@ SECTIONS . = ALIGN(4); __ebss_l2 = .; } - ASSERT (SIZEOF(.text_data_l1) <= L2_LENGTH, "L2 overflow!") + ASSERT (SIZEOF(.text_data_l2) <= L2_LENGTH, "L2 overflow!") /* Force trailing alignment of our init section so that when we * free our init memory, we don't leave behind a partial page.
Signature · 1 line
1.6.4.2
PATCH 57/72 Blackfin: remove useless duplicated assignment in gpio code
In reply to Mike FrysingerFrom: Michael Hennerich <[email protected]>
--- arch/blackfin/kernel/bfin_gpio.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
arch/blackfin/kernel/bfin_gpio.c +0 -1
@@ -722,7 +722,6 @@ void bfin_gpio_pm_hibernate_suspend(void) gpio_bank_saved[bank].fer = gpio_array[bank]->port_fer; gpio_bank_saved[bank].mux = gpio_array[bank]->port_mux; gpio_bank_saved[bank].data = gpio_array[bank]->data; - gpio_bank_saved[bank].data = gpio_array[bank]->data; gpio_bank_saved[bank].inen = gpio_array[bank]->inen; gpio_bank_saved[bank].dir = gpio_array[bank]->dir_set; }
Signature · 1 line
1.6.4.2
PATCH 58/72 Blackfin: use raw_smp_processor_id() in exception code
In reply to Mike FrysingerFrom: Yi Li <[email protected]>
When preempt debugging is enabled, smp_processor_id() may utilize the "current" structure. This may not be safe to access under all exceptions due to it being in dynamically allocated memory. So in exception code, make sure we use raw_smp_processor_id() instead to get at the real value directly.
--- arch/blackfin/kernel/cplb-mpu/cplbmgr.c | 2 +- arch/blackfin/kernel/cplb-nompu/cplbmgr.c | 2 +- arch/blackfin/kernel/traps.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-)
arch/blackfin/kernel/cplb-mpu/cplbmgr.c +1 -1
@@ -280,7 +280,7 @@ static noinline int dcplb_protection_fault(unsigned int cpu)int cplb_hdr (int seqstat,struct pt_regs *regs) {int cause = seqstat &0x3f ; -unsigned int cpu =smp_processor_id (); +unsigned int cpu =raw_smp_processor_id ();switch (cause) {case 0x23 :return dcplb_protection_fault (cpu);
arch/blackfin/kernel/cplb-nompu/cplbmgr.c +1 -1
@@ -202,7 +202,7 @@ MGR_ATTR static int dcplb_miss(int cpu) MGR_ATTR int cplb_hdr(int seqstat, struct pt_regs *regs) {int cause = seqstat &0x3f ; -unsigned int cpu =smp_processor_id (); +unsigned int cpu =raw_smp_processor_id ();switch (cause) {case VEC_CPLB_I_M :return icplb_miss (cpu);
arch/blackfin/kernel/traps.c +6 -6
@@ -227,7 +227,7 @@ asmlinkage void double_fault_c(struct pt_regs *fp)printk (KERN_EMERG "Double Fault\n" );#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT if (((long )fp->seqstat &SEQSTAT_EXCAUSE ) ==VEC_UNCOV ) { -unsigned int cpu =smp_processor_id (); +unsigned int cpu =raw_smp_processor_id ();char buf[150 ];decode_address (buf, cpu_pda[cpu].retx_doublefault); printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n",
@@ -263,7 +263,7 @@ asmlinkage notrace void trap_c(struct pt_regs *fp)int j;#endif #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO -unsigned int cpu =smp_processor_id (); +unsigned int cpu =raw_smp_processor_id ();#endif const char *strerror =NULL ;int sig =0 ;
@@ -1098,7 +1098,7 @@ void show_regs(struct pt_regs *fp)struct irqaction *action;unsigned int i;unsigned long flags =0 ; -unsigned int cpu =smp_processor_id (); +unsigned int cpu =raw_smp_processor_id ();unsigned char in_atomic = (bfin_read_IPEND () &0x10 ) ||in_atomic ();verbose_printk (KERN_NOTICE "\n" );
@@ -1126,13 +1126,13 @@ void show_regs(struct pt_regs *fp)verbose_printk (KERN_NOTICE "\nSEQUENCER STATUS:\t\t%s\n" ,print_tainted ());verbose_printk (KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx IMASK: %04lx SYSCFG: %04lx\n" , - (long )fp->seqstat, fp->ipend, cpu_pda[smp_processor_id ()].ex_imask, fp->syscfg); + (long )fp->seqstat, fp->ipend, cpu_pda[raw_smp_processor_id ()].ex_imask, fp->syscfg);if (fp->ipend &EVT_IRPTEN )verbose_printk (KERN_NOTICE " Global Interrupts Disabled (IPEND[4])\n" ); -if (!(cpu_pda[smp_processor_id ()].ex_imask & (EVT_IVG13 |EVT_IVG12 |EVT_IVG11 | +if (!(cpu_pda[raw_smp_processor_id ()].ex_imask & (EVT_IVG13 |EVT_IVG12 |EVT_IVG11 |EVT_IVG10 |EVT_IVG9 |EVT_IVG8 |EVT_IVG7 |EVT_IVTMR )))verbose_printk (KERN_NOTICE " Peripheral interrupts masked off\n" ); -if (!(cpu_pda[smp_processor_id ()].ex_imask & (EVT_IVG15 |EVT_IVG14 ))) +if (!(cpu_pda[raw_smp_processor_id ()].ex_imask & (EVT_IVG15 |EVT_IVG14 )))verbose_printk (KERN_NOTICE " Kernel interrupts masked off\n" );if ((fp->seqstat &SEQSTAT_EXCAUSE ) ==VEC_HWERR ) { verbose_printk(KERN_NOTICE " HWERRCAUSE: 0x%lx\n",
Signature · 1 line
1.6.4.2
PATCH 59/72 Blackfin: fix spelling in a few comments
In reply to Mike FrysingerFrom: Michael Hennerich <[email protected]>
--- arch/blackfin/kernel/setup.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/blackfin/kernel/setup.c +2 -2
@@ -112,7 +112,7 @@ void __cpuinit bfin_setup_caches(unsigned int cpu)/* * In cache coherence emulation mode, we need to have the * D-cache enabled before running any atomic operation which -* might invove cache invalidation (i.e. spinlock, rwlock). +* might involve cache invalidation (i.e. spinlock, rwlock). * So printk's are deferred until then. */ #ifdef CONFIG_BFIN_ICACHE
@@ -699,7 +699,7 @@ static __init void setup_bootmem_allocator(void)sanitize_memmap (bfin_memmap.map, &bfin_memmap.nr_map);print_memory_map ("boot memmap" ); -/* intialize globals in linux/bootmem.h */ +/* initialize globals in linux/bootmem.h */ find_min_max_pfn ();/* pfn of the last usable page frame */ if (max_pfn > memory_end >>PAGE_SHIFT )
Signature · 1 line
1.6.4.2
PATCH 60/72 Blackfin: workaround anomaly 05000283
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
Make sure our interrupt entry code with exact hardware errors handles anomaly 05000283 (infinite stall in system MMR kill) so we don't stall while under load.
--- arch/blackfin/include/asm/entry.h | 30 ++++++++++++++++++++++++++---- arch/blackfin/mach-common/entry.S | 18 ++---------------- arch/blackfin/mach-common/interrupt.S | 19 +++---------------- 3 files changed, 31 insertions(+), 36 deletions(-)
arch/blackfin/include/asm/entry.h +26 -4
@@ -36,6 +36,21 @@# define LOAD_IPIPE_IPEND #endif +/* +* Workaround for anomalies 05000283 and 05000315 +*/ +#if ANOMALY_05000283 ||ANOMALY_05000315 +# define ANOMALY_283_315_WORKAROUND (preg, dreg) \ + cc = dreg == dreg; \ + preg.h = HI(CHIPID); \ + preg.l = LO(CHIPID); \ + if cc jump 1f; \ + dreg.l = W[preg]; \ +1: +#else +# define ANOMALY_283_315_WORKAROUND (preg, dreg) +#endif /* ANOMALY_05000283 || ANOMALY_05000315 */ +#ifndef CONFIG_EXACT_HWERR /* As a debugging aid - we save IPEND when DEBUG_KERNEL is on, * otherwise it is a waste of cycles.
@@ -88,17 +103,22 @@* As you can see by the code - we actually need to do two SSYNCS - one to * make sure the read/writes complete, and another to make sure the hardware * error is recognized by the core. +* +* The extra nop before the SSYNC is to make sure we work around 05000244, +* since the 283/315 workaround includes a branch to the end */ #define INTERRUPT_ENTRY(N) \ - SSYNC; \ - SSYNC; \ [--sp] = SYSCFG; \ [--sp] = P0; /*orig_p0*/ \ [--sp] = R0; /*orig_r0*/ \ [--sp] = (R7:0,P5:0); \ R1 = ASTAT; \ + ANOMALY_283_315_WORKAROUND(p0, r0) \ P0.L = LO(ILAT); \ P0.H = HI(ILAT); \ + NOP; \ + SSYNC; \ + SSYNC; \ R0 = [P0]; \ CC = BITTST(R0, EVT_IVHW_P); \ IF CC JUMP 1f; \
@@ -118,15 +138,17 @@RTI ; #define TIMER_INTERRUPT_ENTRY(N) \ - SSYNC; \ - SSYNC; \ [--sp] = SYSCFG; \ [--sp] = P0; /*orig_p0*/ \ [--sp] = R0; /*orig_r0*/ \ [--sp] = (R7:0,P5:0); \ R1 = ASTAT; \ + ANOMALY_283_315_WORKAROUND(p0, r0) \ P0.L = LO(ILAT); \ P0.H = HI(ILAT); \ + NOP; \ + SSYNC; \ + SSYNC; \ R0 = [P0]; \ CC = BITTST(R0, EVT_IVHW_P); \ IF CC JUMP 1f; \
arch/blackfin/mach-common/entry.S +2 -16
@@ -513,14 +513,7 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/ ssync; #endif -#if ANOMALY_05000283 || ANOMALY_05000315 - cc = r7 == r7; - p5.h = HI(CHIPID); - p5.l = LO(CHIPID); - if cc jump 1f; - r7.l = W[p5]; -1: -#endif + ANOMALY_283_315_WORKAROUND(p5, r7) #ifdef CONFIG_DEBUG_DOUBLEFAULT /*
@@ -1134,14 +1127,7 @@ ENTRY(_early_trap) SAVE_ALL_SYS trace_buffer_stop(p0,r0); -#if ANOMALY_05000283 || ANOMALY_05000315 - cc = r5 == r5; - p4.h = HI(CHIPID); - p4.l = LO(CHIPID); - if cc jump 1f; - r5.l = W[p4]; -1: -#endif + ANOMALY_283_315_WORKAROUND(p4, r5) /* Turn caches off, to ensure we don't get double exceptions */
arch/blackfin/mach-common/interrupt.S +3 -16
@@ -119,14 +119,8 @@ __common_int_entry: fp = 0; #endif -#if ANOMALY_05000283 || ANOMALY_05000315 - cc = r7 == r7; - p5.h = HI(CHIPID); - p5.l = LO(CHIPID); - if cc jump 1f; - r7.l = W[p5]; -1: -#endif + ANOMALY_283_315_WORKAROUND(p5, r7) + r1 = sp; SP += -12; #ifdef CONFIG_IPIPE
@@ -158,14 +152,7 @@ ENTRY(_evt_ivhw) fp = 0; #endif -#if ANOMALY_05000283 || ANOMALY_05000315 - cc = r7 == r7; - p5.h = HI(CHIPID); - p5.l = LO(CHIPID); - if cc jump 1f; - r7.l = W[p5]; -1: -#endif + ANOMALY_283_315_WORKAROUND(p5, r7) /* Handle all stacked hardware errors * To make sure we don't hang forever, only do it 10 times
Signature · 1 line
1.6.4.2
PATCH 61/72 Blackfin: add some isram-driver self tests
In reply to Mike FrysingerMake it easy to figure out if code changes here are correct.
--- arch/blackfin/Kconfig.debug | 6 + arch/blackfin/mm/isram-driver.c | 212 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 216 insertions(+), 2 deletions(-)
arch/blackfin/Kconfig.debug +6 -0
@@ -252,4 +252,10 @@ config ACCESS_CHECK Say N here to disable that check to improve the performance. +config BFIN_ISRAM_SELF_TEST + bool "isram boot self tests" + default n + help + Run some self tests of the isram driver code at boot. + endmenu
arch/blackfin/mm/isram-driver.c +210 -2
233 lines not on this page · raw message
Signature · 1 line
1.6.4.2
PATCH 62/72 Blackfin: bf537-stamp: add adp5588 gpio resources
In reply to Mike FrysingerFrom: Michael Hennerich <[email protected]>
For the adp5588 GPIO daughter card.
--- arch/blackfin/mach-bf537/boards/stamp.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
arch/blackfin/mach-bf537/boards/stamp.c +14 -0
@@ -1437,6 +1437,14 @@ static struct adp5520_platform_data adp5520_pdev_data = {#endif +#if defined(CONFIG_GPIO_ADP5588 ) || defined(CONFIG_GPIO_ADP5588_MODULE ) +#include <linux/i2c/adp5588.h> +static struct adp5588_gpio_platfrom_data adp5588_gpio_data = { + .gpio_start =50 , + .pullup_dis_mask =0 , +}; +#endif + static struct i2c_board_info __initdata bfin_i2c_board_info[] = { #if defined(CONFIG_INPUT_EVAL_AD7142EB) {
@@ -1484,6 +1492,12 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = { .platform_data = (void *)&adxl34x_info, },#endif +#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE) + { + I2C_BOARD_INFO("adp5588-gpio", 0x34), + .platform_data = (void *)&adp5588_gpio_data, + }, +#endif }; #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Signature · 1 line
1.6.4.2
PATCH 63/72 Blackfin: fix typo in isram_write()
In reply to Mike FrysingerFrom: Robin Getz <[email protected]>
The DTEST write bit is 2, not 1. Improve comments in the related macro while we're here.
--- arch/blackfin/mm/isram-driver.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
arch/blackfin/mm/isram-driver.c +6 -4
@@ -53,10 +53,12 @@ static DEFINE_SPINLOCK(dtest_lock);#define IADDR2DTEST (x) \ ({ unsigned long __addr = (unsigned long)(x); \ (__addr & 0x47F8) |/* address bits 14 & 10:3 */ \ + (__addr &0x8000 ) <<23 |/* Bank A/B */ \ (__addr &0x0800 ) <<15 |/* address bit 11 */ \ - (__addr &0x3000 ) <<4 |/* address bits 13:12 */ \ - (__addr &0x8000 ) <<8 |/* address bit 15 */ \ - (0x1000004 );/* isram access */ \ + (__addr &0x3000 ) <<4 |/* address bits 13:12 */ \ + (__addr &0x8000 ) <<8 |/* address bit 15 */ \ + (0x1000000 ) |/* instruction access = 1 */ \ + (0x4 );/* data array = 1 */ \ })/* Takes a pointer, and returns the offset (in bits) which things should be shifted */
@@ -73,7 +75,7 @@ static void isram_write(const void *addr, uint64_t data)if (addr >= (void *)(L1_CODE_START +L1_CODE_LENGTH ))return ; - cmd =IADDR2DTEST (addr) |1 ;/* write */ + cmd =IADDR2DTEST (addr) |2 ;/* write */ /* * Writes to DTEST_DATA[0:1] need to be atomic with write to DTEST_COMMAND
Signature · 1 line
1.6.4.2
PATCH 64/72 Blackfin: fix BF54x SPI CS resources
In reply to Mike FrysingerFrom: Yi Li <[email protected]>
The BF54x has three slave select signals for SPI0/SPI1, not eight.
--- arch/blackfin/mach-bf548/boards/cm_bf548.c | 4 ++-- arch/blackfin/mach-bf548/boards/ezkit.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/blackfin/mach-bf548/boards/cm_bf548.c +2 -2
@@ -642,7 +642,7 @@ static struct resource bfin_spi1_resource[] = {/* SPI controller data */ static struct bfin5xx_spi_master bf54x_spi_master_info0 = { - .num_chipselect =8 , + .num_chipselect =3 , .enable_dma =1 ,/* master has the ability to do dma transfer */ .pin_req = {P_SPI0_SCK ,P_SPI0_MISO ,P_SPI0_MOSI ,0 }, };
@@ -658,7 +658,7 @@ static struct platform_device bf54x_spi_master0 = { };static struct bfin5xx_spi_master bf54x_spi_master_info1 = { - .num_chipselect =8 , + .num_chipselect =3 , .enable_dma =1 ,/* master has the ability to do dma transfer */ .pin_req = {P_SPI1_SCK ,P_SPI1_MISO ,P_SPI1_MOSI ,0 }, };
arch/blackfin/mach-bf548/boards/ezkit.c +2 -2
@@ -783,7 +783,7 @@ static struct resource bfin_spi1_resource[] = {/* SPI controller data */ static struct bfin5xx_spi_master bf54x_spi_master_info0 = { - .num_chipselect =8 , + .num_chipselect =3 , .enable_dma =1 ,/* master has the ability to do dma transfer */ .pin_req = {P_SPI0_SCK ,P_SPI0_MISO ,P_SPI0_MOSI ,0 }, };
@@ -799,7 +799,7 @@ static struct platform_device bf54x_spi_master0 = { };static struct bfin5xx_spi_master bf54x_spi_master_info1 = { - .num_chipselect =8 , + .num_chipselect =3 , .enable_dma =1 ,/* master has the ability to do dma transfer */ .pin_req = {P_SPI1_SCK ,P_SPI1_MISO ,P_SPI1_MOSI ,0 }, };
Signature · 1 line
1.6.4.2
PATCH 65/72 Blackfin: use KERN_ALERT in all kgdb_test output
In reply to Mike FrysingerFrom: Mingquan Pan <[email protected]>
Most messages are already using KERN_ALERT, so be consistent to make things easier to check with test scripts.
--- arch/blackfin/kernel/kgdb_test.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/kernel/kgdb_test.c +1 -1
@@ -54,7 +54,7 @@ void kgdb_l2_test(void)int kgdb_test (char *name,int len,int count,int z) { -printk (KERN_DEBUG "kgdb name(%d): %s, %d, %d\n" , len, name, count, z); +printk (KERN_ALERT "kgdb name(%d): %s, %d, %d\n" , len, name, count, z); count = z;return count; }
Signature · 1 line
1.6.4.2
PATCH 66/72 Blackfin: add ICPLB coverage for async banks
In reply to Mike FrysingerFrom: Bernd Schmidt <[email protected]>
When doing XIP, we need to execute out of the async banks, so we need ICPLBs to allow this.
--- arch/blackfin/kernel/cplb-nompu/cplbinit.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-)
arch/blackfin/kernel/cplb-nompu/cplbinit.c +9 -2
@@ -36,7 +36,7 @@ int first_switched_icplb PDT_ATTR; int first_switched_dcplb PDT_ATTR; struct cplb_boundary dcplb_bounds[9] PDT_ATTR; -struct cplb_boundary icplb_bounds[7] PDT_ATTR; +struct cplb_boundary icplb_bounds[9] PDT_ATTR; int icplb_nr_bounds PDT_ATTR; int dcplb_nr_bounds PDT_ATTR;
@@ -167,14 +167,21 @@ void __init generate_cplb_tables_all(void) icplb_bounds[i_i++].data = (reserved_mem_icache_on ?SDRAM_IGENERIC :SDRAM_INON_CHBL ); } +/* Addressing hole up to the async bank. */ + icplb_bounds[i_i].eaddr =ASYNC_BANK0_BASE ; + icplb_bounds[i_i++].data =0 ; +/* ASYNC banks. */ + icplb_bounds[i_i].eaddr =ASYNC_BANK3_BASE +ASYNC_BANK3_SIZE ; + icplb_bounds[i_i++].data =SDRAM_EBIU ;/* Addressing hole up to BootROM. */ icplb_bounds[i_i].eaddr =BOOT_ROM_START ; icplb_bounds[i_i++].data =0 ;/* BootROM -- largest one should be less than 1 meg. */ icplb_bounds[i_i].eaddr =BOOT_ROM_START + (1 *1024 *1024 ); icplb_bounds[i_i++].data =SDRAM_IGENERIC ; +if (L2_LENGTH ) { -/* Addressing hole up to L2 SRAM, including the async bank. */ +/* Addressing hole up to L2 SRAM. */ icplb_bounds[i_i].eaddr =L2_START ; icplb_bounds[i_i++].data =0 ;/* L2 SRAM. */
Signature · 1 line
1.6.4.2
PATCH 67/72 Blackfin: increase default async timings for parallel flashes
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
The default async timings are a little too fast for the parallel flash that is attached by default to the async banks. So slow things down a bit so accessing the hardware is stable.
--- arch/blackfin/configs/BF518F-EZBRD_defconfig | 4 ++-- arch/blackfin/configs/BF526-EZBRD_defconfig | 4 ++-- arch/blackfin/configs/BF527-EZKIT_defconfig | 4 ++-- arch/blackfin/configs/BF548-EZKIT_defconfig | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
arch/blackfin/configs/BF518F-EZBRD_defconfig +2 -2
@@ -358,9 +358,9 @@ CONFIG_C_AMBEN_ALL=y # EBIU_AMBCTL Control # CONFIG_BANK_0=0x7BB0 -CONFIG_BANK_1=0x5554 +CONFIG_BANK_1=0x7BB0 CONFIG_BANK_2=0x7BB0 -CONFIG_BANK_3=0xFFC0 +CONFIG_BANK_3=0x99B2 # # Bus options (PCI, PCMCIA, EISA, MCA, ISA)
arch/blackfin/configs/BF526-EZBRD_defconfig +2 -2
@@ -359,9 +359,9 @@ CONFIG_C_AMBEN_ALL=y # EBIU_AMBCTL Control # CONFIG_BANK_0=0x7BB0 -CONFIG_BANK_1=0x5554 +CONFIG_BANK_1=0x7BB0 CONFIG_BANK_2=0x7BB0 -CONFIG_BANK_3=0xFFC0 +CONFIG_BANK_3=0x99B2 # # Bus options (PCI, PCMCIA, EISA, MCA, ISA)
arch/blackfin/configs/BF527-EZKIT_defconfig +2 -2
@@ -363,9 +363,9 @@ CONFIG_C_AMBEN_ALL=y # EBIU_AMBCTL Control # CONFIG_BANK_0=0x7BB0 -CONFIG_BANK_1=0x5554 +CONFIG_BANK_1=0x7BB0 CONFIG_BANK_2=0x7BB0 -CONFIG_BANK_3=0xFFC0 +CONFIG_BANK_3=0x99B2 # # Bus options (PCI, PCMCIA, EISA, MCA, ISA)
arch/blackfin/configs/BF548-EZKIT_defconfig +1 -1
@@ -400,7 +400,7 @@ CONFIG_C_AMBEN_ALL=y # EBIU_AMBCTL Control # CONFIG_BANK_0=0x7BB0 -CONFIG_BANK_1=0x5554 +CONFIG_BANK_1=0x7BB0 CONFIG_BANK_2=0x7BB0 CONFIG_BANK_3=0x99B2 CONFIG_EBIU_MBSCTLVAL=0x0
Signature · 1 line
1.6.4.2
PATCH 68/72 Blackfin: bf538-ezkit: add SPI IRQ resources
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- arch/blackfin/mach-bf538/boards/ezkit.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/blackfin/mach-bf538/boards/ezkit.c +5 -0
@@ -402,6 +402,11 @@ static struct resource bfin_spi2_resource[] = { [1 ] = { .start =CH_SPI2 , .end =CH_SPI2 , + .flags =IORESOURCE_DMA , + }, + [2 ] = { + .start =IRQ_SPI2 , + .end =IRQ_SPI2 , .flags =IORESOURCE_IRQ , } };
Signature · 1 line
1.6.4.2
PATCH 69/72 Blackfin: cm-bf537u: split board from cm-bf537e
In reply to Mike FrysingerFrom: Harald Krapfenbauer <[email protected]>
The cm-bf537u module, while similar to the cm-bf537e, is different enough to warrant its own resources. It has a USB controller but no PHY.
--- arch/blackfin/Kconfig | 7 +- arch/blackfin/mach-bf537/boards/Kconfig | 12 +- arch/blackfin/mach-bf537/boards/Makefile | 3 +- arch/blackfin/mach-bf537/boards/cm_bf537.c | 632 ----------------------- arch/blackfin/mach-bf537/boards/cm_bf537e.c | 727 +++++++++++++++++++++++++++ arch/blackfin/mach-bf537/boards/cm_bf537u.c | 633 +++++++++++++++++++++++ 6 files changed, 1375 insertions(+), 639 deletions(-) delete mode 100644 arch/blackfin/mach-bf537/boards/cm_bf537.c create mode 100644 arch/blackfin/mach-bf537/boards/cm_bf537e.c create mode 100644 arch/blackfin/mach-bf537/boards/cm_bf537u.c
arch/blackfin/Kconfig +4 -3
@@ -342,8 +342,9 @@ config MEM_MT48LC64M4A2FB_7E config MEM_MT48LC16M16A2TG_75 bool depends on (BFIN533_EZKIT || BFIN561_EZKIT \ - || BFIN533_BLUETECHNIX_CM || BFIN537_BLUETECHNIX_CM \ - || H8606_HVSISTEMAS || BFIN527_BLUETECHNIX_CM) + || BFIN533_BLUETECHNIX_CM || BFIN537_BLUETECHNIX_CM_E \ + || BFIN537_BLUETECHNIX_CM_U || H8606_HVSISTEMAS \ + || BFIN527_BLUETECHNIX_CM) default y config MEM_MT48LC32M8A2_75
@@ -459,7 +460,7 @@ config VCO_MULT default "45" if BFIN533_STAMP default "20" if (BFIN537_STAMP || BFIN527_EZKIT || BFIN548_EZKIT || BFIN548_BLUETECHNIX_CM || BFIN538_EZKIT) default "22" if BFIN533_BLUETECHNIX_CM - default "20" if (BFIN537_BLUETECHNIX_CM || BFIN527_BLUETECHNIX_CM || BFIN561_BLUETECHNIX_CM) + default "20" if (BFIN537_BLUETECHNIX_CM_E || BFIN537_BLUETECHNIX_CM_U || BFIN527_BLUETECHNIX_CM || BFIN561_BLUETECHNIX_CM) default "20" if BFIN561_EZKIT default "16" if (H8606_HVSISTEMAS || BLACKSTAMP || BFIN526_EZBRD || BFIN518F_EZBRD) help
arch/blackfin/mach-bf537/boards/Kconfig +9 -3
@@ -9,11 +9,17 @@ config BFIN537_STAMP help BF537-STAMP board support. -config BFIN537_BLUETECHNIX_CM - bool "Bluetechnix CM-BF537" +config BFIN537_BLUETECHNIX_CM_E + bool "Bluetechnix CM-BF537E" depends on (BF537) help - CM-BF537 support for EVAL- and DEV-Board. + CM-BF537E support for EVAL- and DEV-Board. + +config BFIN537_BLUETECHNIX_CM_U + bool "Bluetechnix CM-BF537U" + depends on (BF537) + help + CM-BF537U support for EVAL- and DEV-Board. config BFIN537_BLUETECHNIX_TCM bool "Bluetechnix TCM-BF537"
arch/blackfin/mach-bf537/boards/Makefile +2 -1
@@ -3,7 +3,8 @@ # obj-$(CONFIG_BFIN537_STAMP) += stamp.o -obj-$(CONFIG_BFIN537_BLUETECHNIX_CM) += cm_bf537.o +obj-$(CONFIG_BFIN537_BLUETECHNIX_CM_E) += cm_bf537e.o +obj-$(CONFIG_BFIN537_BLUETECHNIX_CM_U) += cm_bf537u.o obj-$(CONFIG_BFIN537_BLUETECHNIX_TCM) += tcm_bf537.o obj-$(CONFIG_PNAV10) += pnav10.o obj-$(CONFIG_CAMSIG_MINOTAUR) += minotaur.o
arch/blackfin/mach-bf537/boards/cm_bf537.c deleted +0 -632
632 lines not on this page · raw message
arch/blackfin/mach-bf537/boards/cm_bf537e.c new file +727 -0
727 lines not on this page · raw message
arch/blackfin/mach-bf537/boards/cm_bf537u.c new file +633 -0
633 lines not on this page · raw message
Signature · 1 line
1.6.4.2
PATCH 70/72 Blackfin: update cm board resources
In reply to Mike FrysingerFrom: Harald Krapfenbauer <[email protected]>
--- arch/blackfin/mach-bf527/boards/cm_bf527.c | 97 ++++++++++++---------- arch/blackfin/mach-bf533/boards/cm_bf533.c | 114 ++++++++++++++++++++++++++- arch/blackfin/mach-bf537/boards/tcm_bf537.c | 13 ++-- arch/blackfin/mach-bf548/boards/cm_bf548.c | 15 +++- arch/blackfin/mach-bf561/boards/cm_bf561.c | 113 ++++++++++++++++++++++++++- 5 files changed, 297 insertions(+), 55 deletions(-)
arch/blackfin/mach-bf527/boards/cm_bf527.c +53 -44
@@ -151,46 +151,6 @@ static struct platform_device musb_device = { };#endif -#if defined(CONFIG_MTD_PHYSMAP ) || defined(CONFIG_MTD_PHYSMAP_MODULE ) -static struct mtd_partition ezkit_partitions[] = { - { - .name ="bootloader(nor)" , - .size =0x40000 , - .offset =0 , - }, { - .name ="linux kernel(nor)" , - .size =0x1C0000 , - .offset =MTDPART_OFS_APPEND , - }, { - .name ="file system(nor)" , - .size =MTDPART_SIZ_FULL , - .offset =MTDPART_OFS_APPEND , - } -}; - -static struct physmap_flash_data ezkit_flash_data = { - .width =2 , - .parts = ezkit_partitions, - .nr_parts =ARRAY_SIZE (ezkit_partitions), -}; - -static struct resource ezkit_flash_resource = { - .start =0x20000000 , - .end =0x201fffff , - .flags =IORESOURCE_MEM , -}; - -static struct platform_device ezkit_flash_device = { - .name ="physmap-flash" , - .id =0 , - .dev = { - .platform_data = &ezkit_flash_data, - }, - .num_resources =1 , - .resource = &ezkit_flash_resource, -}; -#endif - #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) static struct mtd_partition partition_info[] = { {
@@ -662,6 +622,55 @@ static struct platform_device bfin_fb_adv7393_device = { };#endif +#if defined(CONFIG_MTD_GPIO_ADDR ) || defined(CONFIG_MTD_GPIO_ADDR_MODULE ) +static struct mtd_partition cm_partitions[] = { + { + .name ="bootloader(nor)" , + .size =0x40000 , + .offset =0 , + }, { + .name ="linux kernel(nor)" , + .size =0x100000 , + .offset =MTDPART_OFS_APPEND , + }, { + .name ="file system(nor)" , + .size =MTDPART_SIZ_FULL , + .offset =MTDPART_OFS_APPEND , + } +}; + +static struct physmap_flash_data cm_flash_data = { + .width =2 , + .parts = cm_partitions, + .nr_parts =ARRAY_SIZE (cm_partitions), +}; + +static unsigned cm_flash_gpios[] = {GPIO_PH9 ,GPIO_PG11 }; + +static struct resource cm_flash_resource[] = { + { + .name ="cfi_probe" , + .start =0x20000000 , + .end =0x201fffff , + .flags =IORESOURCE_MEM , + }, { + .start = (unsigned long )cm_flash_gpios, + .end =ARRAY_SIZE (cm_flash_gpios), + .flags =IORESOURCE_IRQ , + } +}; + +static struct platform_device cm_flash_device = { + .name ="gpio-addr-flash" , + .id =0 , + .dev = { + .platform_data = &cm_flash_data, + }, + .num_resources =ARRAY_SIZE (cm_flash_resource), + .resource = cm_flash_resource, +}; +#endif +#if defined(CONFIG_SERIAL_BFIN ) || defined(CONFIG_SERIAL_BFIN_MODULE ) static struct resource bfin_uart_resources[] = {#ifdef CONFIG_SERIAL_BFIN_UART0
@@ -847,7 +856,7 @@ static struct platform_device bfin_dpmc = { }, }; -static struct platform_device *stamp_devices[]__initdata = { +static struct platform_device *cmbf527_devices[]__initdata = { &bfin_dpmc,
@@ -930,8 +939,8 @@ static struct platform_device *stamp_devices[] __initdata = { &bfin_device_gpiokeys,#endif -#if defined(CONFIG_MTD_PHYSMAP ) || defined(CONFIG_MTD_PHYSMAP_MODULE ) - &ezkit_flash_device, +#if defined(CONFIG_MTD_GPIO_ADDR ) || defined(CONFIG_MTD_GPIO_ADDR_MODULE ) + &cm_flash_device, #endif &bfin_gpios_device,
@@ -942,7 +951,7 @@ static int __init cm_init(void)printk (KERN_INFO "%s(): registering device resources\n" , __func__);i2c_register_board_info (0 , bfin_i2c_board_info,ARRAY_SIZE (bfin_i2c_board_info)); -platform_add_devices (stamp_devices,ARRAY_SIZE (stamp_devices)); +platform_add_devices (cmbf527_devices,ARRAY_SIZE (cmbf527_devices));spi_register_board_info (bfin_spi_board_info,ARRAY_SIZE (bfin_spi_board_info));return 0 ; }
arch/blackfin/mach-bf533/boards/cm_bf533.c +112 -2
151 lines not on this page · raw message
arch/blackfin/mach-bf537/boards/tcm_bf537.c +7 -6
@@ -45,6 +45,7 @@#include <asm/bfin5xx_spi.h> #include <asm/portmux.h> #include <asm/dpmc.h> +#include <linux/spi/mmc_spi.h> /* * Name the Board for the /proc/cpuinfo
@@ -148,7 +149,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { .modalias = "mmc_spi", .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, - .chip_select = 5, + .chip_select = 1, .controller_data = &mmc_spi_chip_info, .mode = SPI_MODE_3, },
@@ -279,12 +280,12 @@ static struct platform_device isp1362_hcd_device = {#if defined(CONFIG_USB_NET2272 ) || defined(CONFIG_USB_NET2272_MODULE )static struct resource net2272_bfin_resources[] = { { - .start =0x20200000 , - .end =0x20200000 +0x100 , + .start =0x20300000 , + .end =0x20300000 +0x100 , .flags =IORESOURCE_MEM , }, { - .start =IRQ_PH14 , - .end =IRQ_PH14 , + .start =IRQ_PG13 , + .end =IRQ_PG13 , .flags =IORESOURCE_IRQ |IORESOURCE_IRQ_HIGHLEVEL , }, };
@@ -318,7 +319,7 @@ static struct mtd_partition cm_partitions[] = { .offset = 0, }, { .name = "linux kernel(nor)", - .size = 0xE0000, + .size = 0x100000, .offset = MTDPART_OFS_APPEND, }, { .name = "file system(nor)",
arch/blackfin/mach-bf548/boards/cm_bf548.c +14 -1
@@ -291,6 +291,8 @@ static struct platform_device bfin_sir3_device = {#endif #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) +#include <linux/smsc911x.h> + static struct resource smsc911x_resources[] = { { .name = "smsc911x-memory",
@@ -304,11 +306,22 @@ static struct resource smsc911x_resources[] = { .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, }, }; + +static struct smsc911x_platform_config smsc911x_config = { + .flags =SMSC911X_USE_16BIT , + .irq_polarity =SMSC911X_IRQ_POLARITY_ACTIVE_LOW , + .irq_type =SMSC911X_IRQ_TYPE_OPEN_DRAIN , + .phy_interface =PHY_INTERFACE_MODE_MII , +}; +static struct platform_device smsc911x_device = { .name ="smsc911x" , .id =0 , .num_resources =ARRAY_SIZE (smsc911x_resources), .resource = smsc911x_resources, + .dev = { + .platform_data = &smsc911x_config, + }, };#endif
@@ -473,7 +486,7 @@ static struct mtd_partition para_partitions[] = { .offset = 0, }, { .name = "linux kernel(nor)", - .size = 0x400000, + .size = 0x100000, .offset = MTDPART_OFS_APPEND, }, { .name = "file system(nor)",
arch/blackfin/mach-bf561/boards/cm_bf561.c +111 -2
150 lines not on this page · raw message
Signature · 1 line
1.6.4.2
PATCH 71/72 Blackfin: update ftrace_push_return_trace() breakage
In reply to Mike FrysingerCommit 71e308a239c updated ftrace_push_return_trace() prototype but didn't update the Blackfin ftrace code, so things broke. Since we don't support the new stuff yet, call it with stub values.
--- arch/blackfin/kernel/ftrace.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/kernel/ftrace.c +1 -1
@@ -24,7 +24,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)if (unlikely (atomic_read (¤t->tracing_graph_pause)))return ; -if (ftrace_push_return_trace (*parent, self_addr, &trace.depth) == -EBUSY ) +if (ftrace_push_return_trace (*parent, self_addr, &trace.depth,0 ) == -EBUSY )return ; trace.func = self_addr;
Signature · 1 line
1.6.4.2
PATCH 72/72 Blackfin: swap clocksource ratings for gptimer/cycles
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
The cycles clocksource is a higher resolution than the gptimer one, so make sure the ratings field reflects this.
--- arch/blackfin/Kconfig | 2 +- arch/blackfin/kernel/time-ts.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/blackfin/Kconfig +1 -1
@@ -648,7 +648,7 @@ config CYCLES_CLOCKSOURCE writing the registers will most likely crash the kernel. config GPTMR0_CLOCKSOURCE - bool "Use GPTimer0 as a clocksource (higher rating)" + bool "Use GPTimer0 as a clocksource" select BFIN_GPTIMERS depends on GENERIC_CLOCKEVENTS depends on !TICKSOURCE_GPTMR0
arch/blackfin/kernel/time-ts.c +2 -2
@@ -66,7 +66,7 @@ static cycle_t bfin_read_cycles(struct clocksource *cs)static struct clocksource bfin_cs_cycles = { .name ="bfin_cs_cycles" , - .rating =350 , + .rating =400 , .read = bfin_read_cycles, .mask =CLOCKSOURCE_MASK (64 ), .shift =22 ,
@@ -115,7 +115,7 @@ static cycle_t bfin_read_gptimer0(void)static struct clocksource bfin_cs_gptimer0 = { .name ="bfin_cs_gptimer0" , - .rating =400 , + .rating =350 , .read = bfin_read_gptimer0, .mask =CLOCKSOURCE_MASK (32 ), .shift =22 ,
Signature · 1 line
1.6.4.2
Quoted 6 lines · Mike Frysinger
Minor highlights:
- shadow console to help with really early kernel output
- proper decoding of double fault handlingOtherwise, we've got the normal bug fixes, IPIPE updates, and clean ups.
Patches 15, 16, 20, 21, and 61 all have checkpatch errors some with several errors.. Could you clean those up those errors before sending this up stream?
Daniel
Quoted 11 lines · Daniel Walker
Quoted 6 lines · Mike Frysinger
Minor highlights:
- shadow console to help with really early kernel output
- proper decoding of double fault handlingOtherwise, we've got the normal bug fixes, IPIPE updates, and clean ups.
Patches 15, 16, 20, 21, and 61 all have checkpatch errors some with several errors.. Could you clean those up those errors before sending this up stream?
i already checked/reviewed the output in the series -mike
Quoted 6 lines · Mike Frysinger
Quoted 5 lines · Daniel Walker
Quoted 4 lines · Mike Frysinger
Minor highlights:
- shadow console to help with really early kernel output
- proper decoding of double fault handling
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Otherwise, we've got the normal bug fixes, IPIPE updates, and clean ups.
Patches 15, 16, 20, 21, and 61 all have checkpatch errors some with several errors.. Could you clean those up those errors before sending this up stream?
i already checked/reviewed the output in the series
The remaining problems can be fixed .. Why did you leave those errors ?
Daniel
Quoted 10 lines · Daniel Walker
Quoted 9 lines · Mike Frysinger
Quoted 8 lines · Daniel Walker
Quoted 6 lines · Mike Frysinger
Minor highlights:
- shadow console to help with really early kernel output
- proper decoding of double fault handlingOtherwise, we've got the normal bug fixes, IPIPE updates, and clean ups.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Patches 15, 16, 20, 21, and 61 all have checkpatch errors some with several errors.. Could you clean those up those errors before sending this up stream?
i already checked/reviewed the output in the series
The remaining problems can be fixed .. Why did you leave those errors ?
i'm not going to sweat 80 col warnings when the line is 81 cols with tabs of 8 spaces
as for the other errors, you probably didnt read the code. you saw "error" and assumed checkpatch was correct. it isnt always as it isnt a C parser.
-mike
Quoted 15 lines · Mike Frysinger
Quoted 14 lines · Daniel Walker
Quoted 13 lines · Mike Frysinger
Quoted 11 lines · Daniel Walker
Quoted 6 lines · Mike Frysinger
Minor highlights:
- shadow console to help with really early kernel output
- proper decoding of double fault handlingOtherwise, we've got the normal bug fixes, IPIPE updates, and clean ups.
Patches 15, 16, 20, 21, and 61 all have checkpatch errors some with several errors.. Could you clean those up those errors before sending this up stream?
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
i already checked/reviewed the output in the series
The remaining problems can be fixed .. Why did you leave those errors ?
i'm not going to sweat 80 col warnings when the line is 81 cols with tabs of 8 spaces
The line length ones I'm not worried about, those are just warnings..
Quoted 3 lines
as for the other errors, you probably didnt read the code. you saw "error" and assumed checkpatch was correct. it isnt always as it isnt a C parser.
Checkpatch is finding real issues with your patches.. You have indentations issues in several of the patches. Your removing good formatting and replacing it improper formatting. For instance,
ERROR: code indent should use tabs where possible
#115: FILE: arch/blackfin/kernel/module.c:102:
+^I^I (!strcmp(".bss", shname) &&$
The line your removing had the proper formatting, but this new line has improper formatting.. You have several of these issues, you must think they aren't important but checkpatch has the WARNING and ERROR classification for a reason .. The errors are actual style violation that really need to be either cleaned up or explained..
They can be trivially fixed, it's just a matter of adding the proper indentation ..
Daniel
Quoted 37 lines · Daniel Walker
Quoted 15 lines · Mike Frysinger
Quoted 14 lines · Daniel Walker
Quoted 13 lines · Mike Frysinger
Quoted 11 lines · Daniel Walker
Quoted 6 lines · Mike Frysinger
Minor highlights:
- shadow console to help with really early kernel output
- proper decoding of double fault handlingOtherwise, we've got the normal bug fixes, IPIPE updates, and clean ups.
Patches 15, 16, 20, 21, and 61 all have checkpatch errors some with several errors.. Could you clean those up those errors before sending this up stream?
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
i already checked/reviewed the output in the series
The remaining problems can be fixed .. Why did you leave those errors ?
i'm not going to sweat 80 col warnings when the line is 81 cols with tabs of 8 spaces
The line length ones I'm not worried about, those are just warnings..
Quoted 3 lines
as for the other errors, you probably didnt read the code. you saw "error" and assumed checkpatch was correct. it isnt always as it isnt a C parser.
Checkpatch is finding real issues with your patches.. You have indentations issues in several of the patches. Your removing good formatting and replacing it improper formatting. For instance,
ERROR: code indent should use tabs where possible
#115: FILE:arch/blackfin/kernel/module.c:102:
+^I^I (!strcmp(".bss", shname) &&$
Quoted 8 lines
The line your removing had the proper formatting, but this new line has improper formatting.. You have several of these issues, you must think they aren't important but checkpatch has the WARNING and ERROR classification for a reason .. The errors are actual style violation that really need to be either cleaned up or explained..
They can be trivially fixed, it's just a matter of adding the proper indentation ..
this code i had rewritten and as fallout, the style changed. looks fine to me, and no, this particular checpatch "error" is not always worthwhile (like in this case).
-mike
Quoted 4 lines · Mike Frysinger
this code i had rewritten and as fallout, the style changed. looks fine to me, and no, this particular checpatch "error" is not always worthwhile (like in this case).
Have you read Documentation/CodingStyle ? Can you better explain why your don't want to follow that document ? Most people accept that to be the style of code in Linux, and that is what checkpatch checks for..
We also have this quote from Documentation/SubmittingPatches
"4) Style check your changes.
Check your patch for basic style violations, details of which can be found in Documentation/CodingStyle. Failure to do so simply wastes the reviewers time and will get your patch rejected, probably without even being read.
At a minimum you should check your patches with the patch style checker prior to submission (scripts/checkpatch.pl). You should be able to justify all violations that remain in your patch."
If you ultimately don't correct these changes, I'd ask that in the future you submit pull requests for the blackfin architecture instead of sending individual patches ..
Daniel
Quoted 8 lines · Daniel Walker
Quoted 3 lines · Mike Frysinger
this code i had rewritten and as fallout, the style changed. looks fine to me, and no, this particular checpatch "error" is not always worthwhile (like in this case).
Have you read
Documentation/CodingStyle? Can you better explain why your don't want to follow that document ? Most people accept that to be the style of code in Linux, and that is what checkpatch checks for..
sorry, never heard of Documentation/
-mike
Quoted 3 lines · Daniel Walker
If you ultimately don't correct these changes, I'd ask that in the future you submit pull requests for the blackfin architecture instead of sending individual patches ..
you havent been following anything related to how Blackfin (or any arch?) patches are merged. this patch series is for review only from my tree. no one is picking these up because they've already been picked up.
-mike
Quoted 9 lines · Mike Frysinger
Quoted 3 lines · Daniel Walker
If you ultimately don't correct these changes, I'd ask that in the future you submit pull requests for the blackfin architecture instead of sending individual patches ..
you havent been following anything related to how Blackfin (or any arch?) patches are merged. this patch series is for review only from my tree. no one is picking these up because they've already been picked up.
Picked up by Linus? You know this isn't the "blackfin" list right? You don't seem to care too about review your getting from _this_ list. So why in the world are you sending your patches (all 72 of them!) here ..
Daniel
Quoted 6 lines · Daniel Walker
Quoted 5 lines · Mike Frysinger
Quoted 3 lines · Daniel Walker
If you ultimately don't correct these changes, I'd ask that in the future you submit pull requests for the blackfin architecture instead of sending individual patches ..
Quoted 8 lines
Quoted 4 lines
you havent been following anything related to how Blackfin (or any arch?) patches are merged. this patch series is for review only from my tree. no one is picking these up because they've already been picked up.
Picked up by Linus? You know this isn't the "blackfin" list right? You don't seem to care too about review your getting from _this_ list. So why in the world are you sending your patches (all 72 of them!) here ..
Linus doesnt pick up random patches, he does pull requests. Blackfin patches already get reviewed on the Blackfin list (during original commit and later merge). i post all the patches for sanity checking things we may have missed (it happens). any sane mailer makes it trivial to delete/ignore a single thread, and for anyone reading LKML, not using a sane mailer is a poor excuse. i'm open to review of real issues with the code (locking / leaks / design problems / etc...). forcing a respin of patches for a minor style difference is noise. -mike
Quoted 16 lines · Mike Frysinger
Quoted 6 lines · Daniel Walker
Quoted 5 lines · Mike Frysinger
Quoted 3 lines · Daniel Walker
If you ultimately don't correct these changes, I'd ask that in the future you submit pull requests for the blackfin architecture instead of sending individual patches ..
Quoted 8 lines
Quoted 4 lines
you havent been following anything related to how Blackfin (or any arch?) patches are merged. this patch series is for review only from my tree. no one is picking these up because they've already been picked up.
Picked up by Linus? You know this isn't the "blackfin" list right? You don't seem to care too about review your getting from _this_ list. So why in the world are you sending your patches (all 72 of them!) here ..
Quoted 8 lines
Linus doesnt pick up random patches, he does pull requests. Blackfin patches already get reviewed on the Blackfin list (during original commit and later merge). i post all the patches for sanity checking things we may have missed (it happens). any sane mailer makes it trivial to delete/ignore a single thread, and for anyone reading LKML, not using a sane mailer is a poor excuse. i'm open to review of real issues with the code (locking / leaks / design problems / etc...). forcing a respin of patches for a minor style difference is noise.
I read all of LKML, sane mailer or not _your_ patches are noise .. You have your own mailing list. You have no good reason to post that many patches here, and it's more than likely no one is reviewing them (except me, and your ignoring my valid comments) .. If you have specific patches that have questionable "locking, leaks, or design problems" that's welcome, but not what your doing..
Daniel
Quoted 26 lines · Daniel Walker
Quoted 16 lines · Mike Frysinger
Quoted 6 lines · Daniel Walker
Quoted 5 lines · Mike Frysinger
Quoted 3 lines · Daniel Walker
If you ultimately don't correct these changes, I'd ask that in the future you submit pull requests for the blackfin architecture instead of sending individual patches ..
Quoted 8 lines
Quoted 4 lines
you havent been following anything related to how Blackfin (or any arch?) patches are merged. this patch series is for review only from my tree. no one is picking these up because they've already been picked up.
Picked up by Linus? You know this isn't the "blackfin" list right? You don't seem to care too about review your getting from _this_ list. So why in the world are you sending your patches (all 72 of them!) here ..
Quoted 8 lines
Linus doesnt pick up random patches, he does pull requests. Blackfin patches already get reviewed on the Blackfin list (during original commit and later merge). i post all the patches for sanity checking things we may have missed (it happens). any sane mailer makes it trivial to delete/ignore a single thread, and for anyone reading LKML, not using a sane mailer is a poor excuse. i'm open to review of real issues with the code (locking / leaks / design problems / etc...). forcing a respin of patches for a minor style difference is noise.
Quoted 6 lines
I read all of LKML, sane mailer or not _your_ patches are noise .. You have your own mailing list. You have no good reason to post that many patches here, and it's more than likely no one is reviewing them (except me, and your ignoring my valid comments) .. If you have specific patches that have questionable "locking, leaks, or design problems" that's welcome, but not what your doing..
if i thought something had questionable code, i'd of fixed it myself, or specifically asked someone. if the larger lkml community would prefer to not see the patch series for review, i have no program refraining, but i havent seen a negative response so far. i have seen some random fixes which were certainly nice.
-mike