aboutsummaryrefslogtreecommitdiff
path: root/arch/blackfin/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c6
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c14
-rw-r--r--arch/blackfin/kernel/entry.S5
-rw-r--r--arch/blackfin/kernel/irqchip.c2
-rw-r--r--arch/blackfin/kernel/setup.c248
-rw-r--r--arch/blackfin/kernel/traps.c2
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S166
7 files changed, 205 insertions, 238 deletions
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index 0ccb0dc3f83..069a896a8f2 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -595,7 +595,7 @@ unsigned short get_dma_curr_ycount(unsigned int channel)
}
EXPORT_SYMBOL(get_dma_curr_ycount);
-void *_dma_memcpy(void *dest, const void *src, size_t size)
+static void *__dma_memcpy(void *dest, const void *src, size_t size)
{
int direction; /* 1 - address decrease, 0 - address increase */
int flag_align; /* 1 - address aligned, 0 - address unaligned */
@@ -744,8 +744,8 @@ void *dma_memcpy(void *dest, const void *src, size_t size)
bulk = (size >> 16) << 16;
rest = size - bulk;
if (bulk)
- _dma_memcpy(dest, src, bulk);
- addr = _dma_memcpy(dest+bulk, src+bulk, rest);
+ __dma_memcpy(dest, src, bulk);
+ addr = __dma_memcpy(dest+bulk, src+bulk, rest);
return addr;
}
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 3f49fae1cb1..bb1f4fb2467 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -138,7 +138,7 @@ static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG0_INT
inline int check_gpio(unsigned short gpio)
{
- if (gpio > MAX_BLACKFIN_GPIOS)
+ if (gpio >= MAX_BLACKFIN_GPIOS)
return -EINVAL;
return 0;
}
@@ -494,19 +494,24 @@ u32 gpio_pm_setup(void)
gpio_bank_saved[bank].dir = gpio_bankb[bank]->dir;
gpio_bank_saved[bank].edge = gpio_bankb[bank]->edge;
gpio_bank_saved[bank].both = gpio_bankb[bank]->both;
+ gpio_bank_saved[bank].reserved = reserved_map[bank];
gpio = i;
while (mask) {
if (mask & 1) {
- bfin_gpio_wakeup_type(gpio, wakeup_flags_map[gpio]);
+ reserved_map[gpio_bank(gpio)] |=
+ gpio_bit(gpio);
+ bfin_gpio_wakeup_type(gpio,
+ wakeup_flags_map[gpio]);
set_gpio_data(gpio, 0); /*Clear*/
}
gpio++;
mask >>= 1;
}
- sic_iwr |= 1 << (sic_iwr_irqs[bank] - (IRQ_CORETMR + 1));
+ sic_iwr |= 1 <<
+ (sic_iwr_irqs[bank] - (IRQ_CORETMR + 1));
gpio_bankb[bank]->maskb_set = wakeup_map[gpio_bank(i)];
}
}
@@ -535,6 +540,9 @@ void gpio_pm_restore(void)
gpio_bankb[bank]->polar = gpio_bank_saved[bank].polar;
gpio_bankb[bank]->edge = gpio_bank_saved[bank].edge;
gpio_bankb[bank]->both = gpio_bank_saved[bank].both;
+
+ reserved_map[bank] = gpio_bank_saved[bank].reserved;
+
}
gpio_bankb[bank]->maskb = gpio_bank_saved[bank].maskb;
diff --git a/arch/blackfin/kernel/entry.S b/arch/blackfin/kernel/entry.S
index 5880b270bd5..65c5ba4260b 100644
--- a/arch/blackfin/kernel/entry.S
+++ b/arch/blackfin/kernel/entry.S
@@ -58,10 +58,12 @@ ENTRY(_ret_from_fork)
RESTORE_ALL_SYS
p0 = reti;
jump (p0);
+ENDPROC(_ret_from_fork)
ENTRY(_sys_fork)
r0 = -EINVAL;
rts;
+ENDPROC(_sys_fork)
ENTRY(_sys_vfork)
r0 = sp;
@@ -72,6 +74,7 @@ ENTRY(_sys_vfork)
SP += 12;
rets = [sp++];
rts;
+ENDPROC(_sys_vfork)
ENTRY(_sys_clone)
r0 = sp;
@@ -82,6 +85,7 @@ ENTRY(_sys_clone)
SP += 12;
rets = [sp++];
rts;
+ENDPROC(_sys_clone)
ENTRY(_sys_rt_sigreturn)
r0 = sp;
@@ -92,3 +96,4 @@ ENTRY(_sys_rt_sigreturn)
SP += 12;
rets = [sp++];
rts;
+ENDPROC(_sys_rt_sigreturn)
diff --git a/arch/blackfin/kernel/irqchip.c b/arch/blackfin/kernel/irqchip.c
index df5bf022cf7..80996a1a94c 100644
--- a/arch/blackfin/kernel/irqchip.c
+++ b/arch/blackfin/kernel/irqchip.c
@@ -91,7 +91,7 @@ int show_interrupts(struct seq_file *p, void *v)
}
/*
- * do_IRQ handles all hardware IRQ's. Decoded IRQs should not
+ * do_IRQ handles all hardware IRQs. Decoded IRQs should not
* come via this function. Instead, they should provide their
* own 'handler'
*/
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 02dc7430192..a24fa1ab802 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -61,7 +61,7 @@ EXPORT_SYMBOL(memory_mtd_start);
EXPORT_SYMBOL(mtd_size);
#endif
-char command_line[COMMAND_LINE_SIZE];
+char __initdata command_line[COMMAND_LINE_SIZE];
#if defined(CONFIG_BLKFIN_DCACHE) || defined(CONFIG_BLKFIN_CACHE)
static void generate_cpl_tables(void);
@@ -90,7 +90,7 @@ void __init bf53x_cache_init(void)
#endif
}
-void bf53x_relocate_l1_mem(void)
+void __init bf53x_relocate_l1_mem(void)
{
unsigned long l1_code_length;
unsigned long l1_data_a_length;
@@ -205,7 +205,6 @@ void __init setup_arch(char **cmdline_p)
#endif
#if defined(CONFIG_CMDLINE_BOOL)
- memset(command_line, 0, sizeof(command_line));
strncpy(&command_line[0], CONFIG_CMDLINE, sizeof(command_line));
command_line[sizeof(command_line) - 1] = 0;
#endif
@@ -213,7 +212,7 @@ void __init setup_arch(char **cmdline_p)
/* Keep a copy of command line */
*cmdline_p = &command_line[0];
memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
- boot_command_line[COMMAND_LINE_SIZE - 1] = 0;
+ boot_command_line[COMMAND_LINE_SIZE - 1] = '\0';
/* setup memory defaults from the user config */
physical_mem_end = 0;
@@ -411,7 +410,7 @@ static int __init topology_init(void)
subsys_initcall(topology_init);
#if defined(CONFIG_BLKFIN_DCACHE) || defined(CONFIG_BLKFIN_CACHE)
-u16 lock_kernel_check(u32 start, u32 end)
+static u16 __init lock_kernel_check(u32 start, u32 end)
{
if ((start <= (u32) _stext && end >= (u32) _end)
|| (start >= (u32) _stext && end <= (u32) _end))
@@ -471,6 +470,67 @@ close_cplbtab(struct cplb_tab *table)
return 0;
}
+/* helper function */
+static void __fill_code_cplbtab(struct cplb_tab *t, int i,
+ u32 a_start, u32 a_end)
+{
+ if (cplb_data[i].psize) {
+ fill_cplbtab(t,
+ cplb_data[i].start,
+ cplb_data[i].end,
+ cplb_data[i].psize,
+ cplb_data[i].i_conf);
+ } else {
+#if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263))
+ if (i == SDRAM_KERN) {
+ fill_cplbtab(t,
+ cplb_data[i].start,
+ cplb_data[i].end,
+ SIZE_4M,
+ cplb_data[i].i_conf);
+ } else {
+#endif
+ fill_cplbtab(t,
+ cplb_data[i].start,
+ a_start,
+ SIZE_1M,
+ cplb_data[i].i_conf);
+ fill_cplbtab(t,
+ a_start,
+ a_end,
+ SIZE_4M,
+ cplb_data[i].i_conf);
+ fill_cplbtab(t, a_end,
+ cplb_data[i].end,
+ SIZE_1M,
+ cplb_data[i].i_conf);
+ }
+ }
+}
+
+static void __fill_data_cplbtab(struct cplb_tab *t, int i,
+ u32 a_start, u32 a_end)
+{
+ if (cplb_data[i].psize) {
+ fill_cplbtab(t,
+ cplb_data[i].start,
+ cplb_data[i].end,
+ cplb_data[i].psize,
+ cplb_data[i].d_conf);
+ } else {
+ fill_cplbtab(t,
+ cplb_data[i].start,
+ a_start, SIZE_1M,
+ cplb_data[i].d_conf);
+ fill_cplbtab(t, a_start,
+ a_end, SIZE_4M,
+ cplb_data[i].d_conf);
+ fill_cplbtab(t, a_end,
+ cplb_data[i].end,
+ SIZE_1M,
+ cplb_data[i].d_conf);
+ }
+}
static void __init generate_cpl_tables(void)
{
@@ -540,130 +600,78 @@ static void __init generate_cpl_tables(void)
cplb_data[RES_MEM].i_conf = SDRAM_INON_CHBL;
for (i = ZERO_P; i <= L2_MEM; i++) {
+ if (!cplb_data[i].valid)
+ continue;
- if (cplb_data[i].valid) {
+ as_1m = cplb_data[i].start % SIZE_1M;
- as_1m = cplb_data[i].start % SIZE_1M;
+ /*
+ * We need to make sure all sections are properly 1M aligned
+ * However between Kernel Memory and the Kernel mtd section,
+ * depending on the rootfs size, there can be overlapping
+ * memory areas.
+ */
- /* We need to make sure all sections are properly 1M aligned
- * However between Kernel Memory and the Kernel mtd section, depending on the
- * rootfs size, there can be overlapping memory areas.
- */
-
- if (as_1m && i!=L1I_MEM && i!=L1D_MEM) {
+ if (as_1m && i != L1I_MEM && i != L1D_MEM) {
#ifdef CONFIG_MTD_UCLINUX
- if (i == SDRAM_RAM_MTD) {
- if ((cplb_data[SDRAM_KERN].end + 1) > cplb_data[SDRAM_RAM_MTD].start)
- cplb_data[SDRAM_RAM_MTD].start = (cplb_data[i].start & (-2*SIZE_1M)) + SIZE_1M;
- else
- cplb_data[SDRAM_RAM_MTD].start = (cplb_data[i].start & (-2*SIZE_1M));
- } else
+ if (i == SDRAM_RAM_MTD) {
+ if ((cplb_data[SDRAM_KERN].end + 1) >
+ cplb_data[SDRAM_RAM_MTD].start)
+ cplb_data[SDRAM_RAM_MTD].start =
+ (cplb_data[i].start &
+ (-2*SIZE_1M)) + SIZE_1M;
+ else
+ cplb_data[SDRAM_RAM_MTD].start =
+ (cplb_data[i].start &
+ (-2*SIZE_1M));
+ } else
#endif
- printk(KERN_WARNING "Unaligned Start of %s at 0x%X\n",
- cplb_data[i].name, cplb_data[i].start);
- }
+ printk(KERN_WARNING
+ "Unaligned Start of %s at 0x%X\n",
+ cplb_data[i].name, cplb_data[i].start);
+ }
- as = cplb_data[i].start % SIZE_4M;
- ae = cplb_data[i].end % SIZE_4M;
-
- if (as)
- a_start = cplb_data[i].start + (SIZE_4M - (as));
- else
- a_start = cplb_data[i].start;
-
- a_end = cplb_data[i].end - ae;
-
- for (j = INITIAL_T; j <= SWITCH_T; j++) {
-
- switch (j) {
- case INITIAL_T:
- if (cplb_data[i].attr & INITIAL_T) {
- t_i = &cplb.init_i;
- t_d = &cplb.init_d;
- process = 1;
- } else
- process = 0;
- break;
- case SWITCH_T:
- if (cplb_data[i].attr & SWITCH_T) {
- t_i = &cplb.switch_i;
- t_d = &cplb.switch_d;
- process = 1;
- } else
- process = 0;
- break;
- default:
- process = 0;
- break;
- }
+ as = cplb_data[i].start % SIZE_4M;
+ ae = cplb_data[i].end % SIZE_4M;
- if (process) {
- if (cplb_data[i].attr & I_CPLB) {
-
- if (cplb_data[i].psize) {
- fill_cplbtab(t_i,
- cplb_data[i].start,
- cplb_data[i].end,
- cplb_data[i].psize,
- cplb_data[i].i_conf);
- } else {
- /*icplb_table */
-#if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263))
- if (i == SDRAM_KERN) {
- fill_cplbtab(t_i,
- cplb_data[i].start,
- cplb_data[i].end,
- SIZE_4M,
- cplb_data[i].i_conf);
- } else
-#endif
- {
- fill_cplbtab(t_i,
- cplb_data[i].start,
- a_start,
- SIZE_1M,
- cplb_data[i].i_conf);
- fill_cplbtab(t_i,
- a_start,
- a_end,
- SIZE_4M,
- cplb_data[i].i_conf);
- fill_cplbtab(t_i, a_end,
- cplb_data[i].end,
- SIZE_1M,
- cplb_data[i].i_conf);
- }
- }
+ if (as)
+ a_start = cplb_data[i].start + (SIZE_4M - (as));
+ else
+ a_start = cplb_data[i].start;
- }
- if (cplb_data[i].attr & D_CPLB) {
-
- if (cplb_data[i].psize) {
- fill_cplbtab(t_d,
- cplb_data[i].start,
- cplb_data[i].end,
- cplb_data[i].psize,
- cplb_data[i].d_conf);
- } else {
-/*dcplb_table*/
- fill_cplbtab(t_d,
- cplb_data[i].start,
- a_start, SIZE_1M,
- cplb_data[i].d_conf);
- fill_cplbtab(t_d, a_start,
- a_end, SIZE_4M,
- cplb_data[i].d_conf);
- fill_cplbtab(t_d, a_end,
- cplb_data[i].end,
- SIZE_1M,
- cplb_data[i].d_conf);
+ a_end = cplb_data[i].end - ae;
- }
+ for (j = INITIAL_T; j <= SWITCH_T; j++) {
- }
- }
+ switch (j) {
+ case INITIAL_T:
+ if (cplb_data[i].attr & INITIAL_T) {
+ t_i = &cplb.init_i;
+ t_d = &cplb.init_d;
+ process = 1;
+ } else
+ process = 0;
+ break;
+ case SWITCH_T:
+ if (cplb_data[i].attr & SWITCH_T) {
+ t_i = &cplb.switch_i;
+ t_d = &cplb.switch_d;
+ process = 1;
+ } else
+ process = 0;
+ break;
+ default:
+ process = 0;
+ break;
}
+ if (!process)
+ continue;
+ if (cplb_data[i].attr & I_CPLB)
+ __fill_code_cplbtab(t_i, i, a_start, a_end);
+
+ if (cplb_data[i].attr & D_CPLB)
+ __fill_data_cplbtab(t_d, i, a_start, a_end);
}
}
@@ -681,7 +689,7 @@ static void __init generate_cpl_tables(void)
#endif
-static inline u_long get_vco(void)
+static u_long get_vco(void)
{
u_long msel;
u_long vco;
@@ -889,8 +897,8 @@ struct seq_operations cpuinfo_op = {
.show = show_cpuinfo,
};
-void cmdline_init(unsigned long r0)
+void __init cmdline_init(const char *r0)
{
if (r0)
- strncpy(command_line, (char *)r0, COMMAND_LINE_SIZE);
+ strncpy(command_line, r0, COMMAND_LINE_SIZE);
}
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 9932edee8cb..5ab87b0b92d 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -557,7 +557,7 @@ void dump_bfin_regs(struct pt_regs *fp, void *retaddr)
break;
#ifndef CONFIG_DEBUG_HWERR
/* If one of the last few instructions was a STI
- * it is likily that the error occured awhile ago
+ * it is likely that the error occured awhile ago
* and we just noticed
*/
if (x >= 0x0040 && x <= 0x0047 && i <= 0)
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 86fe6799580..1ef1e36b395 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -7,7 +7,7 @@
* Description: Master linker script for blackfin architecture
*
* Modified:
- * Copyright 2004-2006 Analog Devices Inc.
+ * Copyright 2004-2007 Analog Devices Inc.
*
* Bugs: Enter bugs at http://blackfin.uclinux.org/
*
@@ -32,97 +32,54 @@
#include <asm-generic/vmlinux.lds.h>
#include <asm/mem_map.h>
-
OUTPUT_FORMAT("elf32-bfin")
ENTRY(__start)
_jiffies = _jiffies_64;
-MEMORY
-{
- ram : ORIGIN = CONFIG_BOOT_LOAD, LENGTH = (CONFIG_MEM_SIZE * 1024 * 1024) - (CONFIG_BOOT_LOAD)
- l1_data_a : ORIGIN = L1_DATA_A_START, LENGTH = L1_DATA_A_LENGTH
- l1_data_b : ORIGIN = L1_DATA_B_START, LENGTH = L1_DATA_B_LENGTH
- l1_code : ORIGIN = L1_CODE_START, LENGTH = L1_CODE_LENGTH
- l1_scratch : ORIGIN = L1_SCRATCH_START, LENGTH = L1_SCRATCH_LENGTH
-}
-
SECTIONS
{
. = CONFIG_BOOT_LOAD;
-
.text :
{
- _text = .;
- __stext = .;
+ __text = .;
+ _text = .;
+ __stext = .;
TEXT_TEXT
SCHED_TEXT
+ LOCK_TEXT
*(.text.lock)
+ *(.fixup)
+
. = ALIGN(16);
- ___start___ex_table = .;
+ ___start___ex_table = .;
*(__ex_table)
- ___stop___ex_table = .;
-
- *($code)
- *(.rodata)
- *(.rodata.*)
- *(__vermagic) /* Kernel version magic */
- *(.rodata1)
- *(.fixup)
- *(.spinlock.text)
+ ___stop___ex_table = .;
- /* Kernel symbol table: Normal symbols */
. = ALIGN(4);
- ___start___ksymtab = .;
- *(__ksymtab)
- ___stop___ksymtab = .;
-
- /* Kernel symbol table: GPL-only symbols */
- ___start___ksymtab_gpl = .;
- *(__ksymtab_gpl)
- ___stop___ksymtab_gpl = .;
-
- /* Kernel symbol table: Normal unused symbols */ \
- ___start___ksymtab_unused = .;
- *(__ksymtab_unused)
- ___stop___ksymtab_unused = .;
-
- /* Kernel symbol table: GPL-only unused symbols */
- ___start___ksymtab_unused_gpl = .;
- *(__ksymtab_unused_gpl)
- ___stop___ksymtab_unused_gpl = .;
-
-
- /* Kernel symbol table: GPL-future symbols */
- ___start___ksymtab_gpl_future = .;
- *(__ksymtab_gpl_future)
- ___stop___ksymtab_gpl_future = .;
-
- /* Kernel symbol table: Normal symbols */
- ___start___kcrctab = .;
- *(__kcrctab)
- ___stop___kcrctab = .;
-
- /* Kernel symbol table: GPL-only symbols */
- ___start___kcrctab_gpl = .;
- *(__kcrctab_gpl)
- ___stop___kcrctab_gpl = .;
-
- /* Kernel symbol table: GPL-future symbols */
- ___start___kcrctab_gpl_future = .;
- *(__kcrctab_gpl_future)
- ___stop___kcrctab_gpl_future = .;
-
- /* Kernel symbol table: strings */
- *(__ksymtab_strings)
-
- . = ALIGN(4);
__etext = .;
- } > ram
+ }
+
+ RODATA
+
+ .data :
+ {
+ __sdata = .;
+ . = ALIGN(0x2000);
+ *(.data.init_task)
+ DATA_DATA
+ CONSTRUCTORS
+
+ . = ALIGN(32);
+ *(.data.cacheline_aligned)
+
+ . = ALIGN(0x2000);
+ __edata = .;
+ }
+ ___init_begin = .;
.init :
{
. = ALIGN(4096);
- ___init_begin = .;
__sinittext = .;
*(.init.text)
__einittext = .;
@@ -148,39 +105,39 @@ SECTIONS
*(.init.ramfs)
___initramfs_end = .;
. = ALIGN(4);
- ___init_end = .;
- } > ram
+ }
- __l1_lma_start = .;
+ __l1_lma_start = .;
- .text_l1 :
+ .text_l1 L1_CODE_START : AT(LOADADDR(.init) + SIZEOF(.init))
{
. = ALIGN(4);
- __stext_l1 = .;
+ __stext_l1 = .;
*(.l1.text)
. = ALIGN(4);
- __etext_l1 = .;
- } > l1_code AT > ram
+ __etext_l1 = .;
+ }
- .data_l1 :
+ .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
{
. = ALIGN(4);
- __sdata_l1 = .;
+ __sdata_l1 = .;
*(.l1.data)
- __edata_l1 = .;
+ __edata_l1 = .;
. = ALIGN(4);
- __sbss_l1 = .;
+ __sbss_l1 = .;
*(.l1.bss)
. = ALIGN(32);
*(.data_l1.cacheline_aligned)
. = ALIGN(4);
- __ebss_l1 = .;
- } > l1_data_a AT > ram
- .data_b_l1 :
+ __ebss_l1 = .;
+ }
+
+ .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
{
. = ALIGN(4);
__sdata_b_l1 = .;
@@ -193,36 +150,25 @@ SECTIONS
. = ALIGN(4);
__ebss_b_l1 = .;
- } > l1_data_b AT > ram
+ }
- .data :
- {
- __sdata = .;
- . = ALIGN(0x2000);
- *(.data.init_task)
- DATA_DATA
+ ___init_end = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
- . = ALIGN(32);
- *(.data.cacheline_aligned)
-
- . = ALIGN(0x2000);
- __edata = .;
- } > ram
-
- /DISCARD/ : { /* Exit code and data*/
- *(.exit.text)
- *(.exit.data)
- *(.exitcall.exit)
- } > ram
-
- .bss :
+ .bss LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1) :
{
. = ALIGN(4);
- ___bss_start = .;
+ ___bss_start = .;
*(.bss)
*(COMMON)
. = ALIGN(4);
- ___bss_stop = .;
- __end = . ;
- } > ram
+ ___bss_stop = .;
+ __end = .;
+ }
+
+ /DISCARD/ :
+ {
+ *(.exit.text)
+ *(.exit.data)
+ *(.exitcall.exit)
+ }
}