diff options
author | Francois Retief <fgretief@spaceteq.co.za> | 2015-10-28 15:48:41 +0200 |
---|---|---|
committer | Francois Retief <fgretief@spaceteq.co.za> | 2015-12-03 13:15:48 +0200 |
commit | d67269ba70f471a33ea64fcddc698cacce14e14a (patch) | |
tree | 5ea50d9136511b171503ad91d81b212a85e4a568 /arch/sparc/cpu/leon3/cpu_init.c | |
parent | e17c5200c7e9a802783a53d4f4457fa68f7fa074 (diff) |
sparc: leon3: Move snoop detection from startup.S to arch_cpu_init()
Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>
Diffstat (limited to 'arch/sparc/cpu/leon3/cpu_init.c')
-rw-r--r-- | arch/sparc/cpu/leon3/cpu_init.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/sparc/cpu/leon3/cpu_init.c b/arch/sparc/cpu/leon3/cpu_init.c index a0526cd36c5..421859e0e2c 100644 --- a/arch/sparc/cpu/leon3/cpu_init.c +++ b/arch/sparc/cpu/leon3/cpu_init.c @@ -30,7 +30,6 @@ DECLARE_GLOBAL_DATA_PTR; ambapp_dev_irqmp *irqmp = NULL; ambapp_dev_gptimer *gptimer = NULL; unsigned int gptimer_irq = 0; -int leon3_snooping_avail = 0; /* * Breath some life into the CPU... @@ -63,12 +62,24 @@ void cpu_init_f2(void) ambapp_bus_init(CONFIG_AMBAPP_IOAREA, CONFIG_SYS_CLK_FREQ, &ambapp_plb); } +/* If cache snooping is available in hardware the result will be set + * to 0x800000, otherwise 0. + */ +static unsigned int snoop_detect(void) +{ + unsigned int result; + asm("lda [%%g0] 2, %0" : "=r"(result)); + return result & 0x00800000; +} + int arch_cpu_init(void) { gd->cpu_clk = CONFIG_SYS_CLK_FREQ; gd->bus_clk = CONFIG_SYS_CLK_FREQ; gd->ram_size = CONFIG_SYS_SDRAM_SIZE; + gd->arch.snooping_available = snoop_detect(); + return 0; } |