diff options
Diffstat (limited to 'arch/avr32')
-rw-r--r-- | arch/avr32/cpu/cpu.c | 4 | ||||
-rw-r--r-- | arch/avr32/cpu/exception.c | 6 | ||||
-rw-r--r-- | arch/avr32/cpu/interrupts.c | 6 | ||||
-rw-r--r-- | arch/avr32/include/asm/global_data.h | 34 | ||||
-rw-r--r-- | arch/avr32/lib/board.c | 2 | ||||
-rw-r--r-- | arch/avr32/lib/bootm.c | 2 |
6 files changed, 16 insertions, 38 deletions
diff --git a/arch/avr32/cpu/cpu.c b/arch/avr32/cpu/cpu.c index 7907837..9d82ca4 100644 --- a/arch/avr32/cpu/cpu.c +++ b/arch/avr32/cpu/cpu.c @@ -47,7 +47,7 @@ int cpu_init(void) { extern void _evba(void); - gd->cpu_hz = CONFIG_SYS_OSC0_HZ; + gd->arch.cpu_hz = CONFIG_SYS_OSC0_HZ; /* TODO: Move somewhere else, but needs to be run before we * increase the clock frequency. */ @@ -59,7 +59,7 @@ int cpu_init(void) clk_init(); /* Update the CPU speed according to the PLL configuration */ - gd->cpu_hz = get_cpu_clk_rate(); + gd->arch.cpu_hz = get_cpu_clk_rate(); /* Set up the exception handler table and enable exceptions */ sysreg_write(EVBA, (unsigned long)&_evba); diff --git a/arch/avr32/cpu/exception.c b/arch/avr32/cpu/exception.c index b21ef1f..828fc00 100644 --- a/arch/avr32/cpu/exception.c +++ b/arch/avr32/cpu/exception.c @@ -112,11 +112,11 @@ void do_unknown_exception(unsigned int ecr, struct pt_regs *regs) printf("CPU Mode: %s\n", cpu_modes[mode]); /* Avoid exception loops */ - if (regs->sp < (gd->stack_end - CONFIG_STACKSIZE) - || regs->sp >= gd->stack_end) + if (regs->sp < (gd->arch.stack_end - CONFIG_STACKSIZE) + || regs->sp >= gd->arch.stack_end) printf("\nStack pointer seems bogus, won't do stack dump\n"); else - dump_mem("\nStack: ", regs->sp, gd->stack_end); + dump_mem("\nStack: ", regs->sp, gd->arch.stack_end); panic("Unhandled exception\n"); } diff --git a/arch/avr32/cpu/interrupts.c b/arch/avr32/cpu/interrupts.c index 49a00f1..d87c6e1 100644 --- a/arch/avr32/cpu/interrupts.c +++ b/arch/avr32/cpu/interrupts.c @@ -46,7 +46,7 @@ static unsigned long tb_factor; unsigned long get_tbclk(void) { - return gd->cpu_hz; + return gd->arch.cpu_hz; } unsigned long long get_ticks(void) @@ -115,8 +115,8 @@ int timer_init(void) sysreg_write(COUNT, 0); tmp = (u64)CONFIG_SYS_HZ << 32; - tmp += gd->cpu_hz / 2; - do_div(tmp, gd->cpu_hz); + tmp += gd->arch.cpu_hz / 2; + do_div(tmp, gd->arch.cpu_hz); tb_factor = (u32)tmp; if (set_interrupt_handler(0, &timer_interrupt_handler, 3)) diff --git a/arch/avr32/include/asm/global_data.h b/arch/avr32/include/asm/global_data.h index bf661e2..a71f199 100644 --- a/arch/avr32/include/asm/global_data.h +++ b/arch/avr32/include/asm/global_data.h @@ -22,35 +22,13 @@ #ifndef __ASM_GLOBAL_DATA_H__ #define __ASM_GLOBAL_DATA_H__ -/* - * The following data structure is placed in some memory wich is - * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or - * some locked parts of the data cache) to allow for a minimum set of - * global variables during system initialization (until we have set - * up the memory controller so that we can use RAM). - */ - -typedef struct global_data { - bd_t *bd; - unsigned long flags; - unsigned int baudrate; - unsigned long stack_end; /* highest stack address */ - unsigned long have_console; /* serial_init() was called */ -#ifdef CONFIG_PRE_CONSOLE_BUFFER - unsigned long precon_buf_idx; /* Pre-Console buffer index */ -#endif - unsigned long reloc_off; /* Relocation Offset */ - unsigned long env_addr; /* Address of env struct */ - unsigned long env_valid; /* Checksum of env valid? */ - unsigned long cpu_hz; /* cpu core clock frequency */ -#if defined(CONFIG_LCD) - void *fb_base; /* framebuffer address */ -#endif - void **jt; /* jump table */ - char env_buf[32]; /* buffer for getenv() before reloc. */ -} gd_t; +/* Architecture-specific global data */ +struct arch_global_data { + unsigned long stack_end; /* highest stack address */ + unsigned long cpu_hz; /* cpu core clock frequency */ +}; -#include <asm-generic/global_data_flags.h> +#include <asm-generic/global_data.h> #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm("r5") diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index e3287c4..d3c8cb7 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -231,7 +231,7 @@ void board_init_f(ulong board_type) /* And finally, a new, bigger stack. */ new_sp = (unsigned long *)addr; - gd->stack_end = addr; + gd->arch.stack_end = addr; *(--new_sp) = 0; *(--new_sp) = 0; diff --git a/arch/avr32/lib/bootm.c b/arch/avr32/lib/bootm.c index 74ebeca..87f3f9c 100644 --- a/arch/avr32/lib/bootm.c +++ b/arch/avr32/lib/bootm.c @@ -109,7 +109,7 @@ static struct tag *setup_clock_tags(struct tag *params) params->hdr.size = tag_size(tag_clock); params->u.clock.clock_id = ACLOCK_BOOTCPU; params->u.clock.clock_flags = 0; - params->u.clock.clock_hz = gd->cpu_hz; + params->u.clock.clock_hz = gd->arch.cpu_hz; #ifdef CONFIG_AT32AP7000 /* |