From c428f8eb2f473963585b0c0a31cb33dccad62b9a Mon Sep 17 00:00:00 2001 From: Bob Liu Date: Thu, 20 Dec 2012 15:13:48 +0800 Subject: blackfin: mem_init: update dmc config register Update dmc config register to increase memory performance. Signed-off-by: Bob Liu diff --git a/arch/blackfin/include/asm/mem_init.h b/arch/blackfin/include/asm/mem_init.h index f019e9b..9b33e72 100644 --- a/arch/blackfin/include/asm/mem_init.h +++ b/arch/blackfin/include/asm/mem_init.h @@ -411,7 +411,7 @@ static struct ddr_config ddr_config_table[] __attribute__((section(".data_l1"))) .dmc_ddrcfg = 0x00000422, .dmc_ddrtr0 = 0x20E0A424, .dmc_ddrtr1 = 0x3020079E, - .dmc_ddrtr2 = 0x0032020D, + .dmc_ddrtr2 = 0x0032050D, .dmc_ddrmr = 0x00000842, .dmc_ddrmr1 = 0x4, }, -- cgit v0.10.2 From c73bc7026d7785fc627a8da7bbdd9d172001a59f Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Sun, 25 Nov 2012 16:48:23 +0900 Subject: blackfin: use bitmap library functions The bitmap library provides more efficient functions than accessing individual bits with bitops. This uses bitmap_find_next_zero_area() to find a continuing zero area, and uses bitmap_set()/bitmap_clear() to set/clear specified bit area. Signed-off-by: Akinobu Mita Cc: Mike Frysinger Cc: uclinux-dist-devel@blackfin.uclinux.org Signed-off-by: Bob Liu diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c index e7be653..df437e5 100644 --- a/arch/blackfin/kernel/dma-mapping.c +++ b/arch/blackfin/kernel/dma-mapping.c @@ -13,6 +13,7 @@ #include #include #include +#include static spinlock_t dma_page_lock; static unsigned long *dma_page; @@ -46,24 +47,17 @@ static inline unsigned int get_pages(size_t size) static unsigned long __alloc_dma_pages(unsigned int pages) { unsigned long ret = 0, flags; - int i, count = 0; + unsigned long start; if (dma_initialized == 0) dma_alloc_init(_ramend - DMA_UNCACHED_REGION, _ramend); spin_lock_irqsave(&dma_page_lock, flags); - for (i = 0; i < dma_pages;) { - if (test_bit(i++, dma_page) == 0) { - if (++count == pages) { - while (count--) - __set_bit(--i, dma_page); - - ret = dma_base + (i << PAGE_SHIFT); - break; - } - } else - count = 0; + start = bitmap_find_next_zero_area(dma_page, dma_pages, 0, pages, 0); + if (start < dma_pages) { + ret = dma_base + (start << PAGE_SHIFT); + bitmap_set(dma_page, start, pages); } spin_unlock_irqrestore(&dma_page_lock, flags); return ret; @@ -73,7 +67,6 @@ static void __free_dma_pages(unsigned long addr, unsigned int pages) { unsigned long page = (addr - dma_base) >> PAGE_SHIFT; unsigned long flags; - int i; if ((page + pages) > dma_pages) { printk(KERN_ERR "%s: freeing outside range.\n", __func__); @@ -81,9 +74,7 @@ static void __free_dma_pages(unsigned long addr, unsigned int pages) } spin_lock_irqsave(&dma_page_lock, flags); - for (i = page; i < page + pages; i++) - __clear_bit(i, dma_page); - + bitmap_clear(dma_page, page, pages); spin_unlock_irqrestore(&dma_page_lock, flags); } -- cgit v0.10.2 From 293be8de49a05ca510069e7ab2d5057c728dd155 Mon Sep 17 00:00:00 2001 From: Sonic Zhang Date: Thu, 31 Jan 2013 16:34:53 +0800 Subject: blackfin: sync data in blackfin write buffer Sync data in blackfin write buffer to DRAM before return from copy_to_user. Otherwise, application may read wrong data from stat syscall occasionally. Signed-off-by: Sonic Zhang Signed-off-by: Bob Liu diff --git a/arch/blackfin/include/asm/uaccess.h b/arch/blackfin/include/asm/uaccess.h index 461bb54..57701c3 100644 --- a/arch/blackfin/include/asm/uaccess.h +++ b/arch/blackfin/include/asm/uaccess.h @@ -191,6 +191,7 @@ copy_to_user(void __user *to, const void *from, unsigned long n) memcpy((void __force *)to, from, n); else return n; + SSYNC(); return 0; } -- cgit v0.10.2 From 36c4723983a48525f8a3477215edabb17456eff9 Mon Sep 17 00:00:00 2001 From: Steven Miao Date: Fri, 21 Dec 2012 14:34:16 +0800 Subject: blackfin: pm: fix build error Only register pm ops when defined CONFIG_PM. Signed-off-by: Steven Miao Signed-off-by: Bob Liu diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index 83ff311..6c0c681 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c @@ -1195,6 +1195,7 @@ static struct syscore_ops sec_pm_syscore_ops = { .suspend = sec_suspend, .resume = sec_resume, }; + #endif #else # define bfin_gpio_set_wake NULL @@ -1596,7 +1597,10 @@ int __init init_arch_irq(void) bfin_write_SEC_SCI(1, SEC_CCTL, SEC_CCTL_EN | SEC_CCTL_NMI_EN); init_software_driven_irq(); + +#ifdef CONFIG_PM register_syscore_ops(&sec_pm_syscore_ops); +#endif return 0; } -- cgit v0.10.2 From f656c240ae07c48ddf8552e83b64692121044c42 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Tue, 18 Dec 2012 15:01:45 -0800 Subject: blackfin: time-ts: Remove duplicate assignment It seems that this assignment is done twice in a row. Remove the duplicate assignment. Signed-off-by: Stephen Boyd Cc: Steven Miao Cc: trivial@kernel.org Signed-off-by: Bob Liu diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c index f608f02..cb0a484 100644 --- a/arch/blackfin/kernel/time-ts.c +++ b/arch/blackfin/kernel/time-ts.c @@ -329,12 +329,6 @@ void bfin_coretmr_clockevent_init(void) evt->broadcast = smp_timer_broadcast; #endif - -#ifdef CONFIG_SMP - evt->broadcast = smp_timer_broadcast; -#endif - - evt->name = "bfin_core_timer"; evt->rating = 350; evt->irq = -1; -- cgit v0.10.2