From 70c4c032ea112cc42aa1ce959c33fc4825eaef95 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 1 Jun 2008 01:23:48 -0400 Subject: Blackfin: enable support for nested interrupts During cpu init, make sure we initialize the CEC properly so that interrupts can fire and be handled while U-Boot is running. Signed-off-by: Mike Frysinger --- cpu/blackfin/start.S | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'cpu/blackfin/start.S') diff --git a/cpu/blackfin/start.S b/cpu/blackfin/start.S index 8303292..c4d52b4 100644 --- a/cpu/blackfin/start.S +++ b/cpu/blackfin/start.S @@ -75,7 +75,7 @@ ENTRY(_start) serial_early_puts("Init Registers"); - /* Disable nested interrupts and enable CYCLES for udelay() */ + /* Disable self-nested interrupts and enable CYCLES for udelay() */ R0 = CCEN | 0x30; SYSCFG = R0; @@ -180,7 +180,7 @@ ENTRY(_start) /* Now lower ourselves from the highest interrupt level to * the lowest. We do this by masking all interrupts but 15, - * setting the 15 handler to "board_init_f", raising the 15 + * setting the 15 handler to ".Lenable_nested", raising the 15 * interrupt, and then returning from the highest interrupt * level to the dummy "jump" until the interrupt controller * services the pending 15 interrupt. @@ -190,8 +190,8 @@ ENTRY(_start) r1 = r6; p0.l = LO(EVT15); p0.h = HI(EVT15); - p1.l = _cpu_init_f; - p1.h = _cpu_init_f; + p1.l = .Lenable_nested; + p1.h = .Lenable_nested; [p0] = p1; p2.l = LO(IMASK); p2.h = HI(IMASK); @@ -204,6 +204,12 @@ ENTRY(_start) reti = p4; rti; + /* Enable nested interrupts before continuing with cpu init */ +.Lenable_nested: + cli r7; + [--sp] = reti; + jump.l _cpu_init_f; + .LWAIT_HERE: jump .LWAIT_HERE; ENDPROC(_start) -- cgit v1.1 From 960922291c9594acb575cec7e47d7bed9b58182c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 11 Oct 2008 21:18:10 -0400 Subject: Blackfin: set initial stack correctly according to Blackfin ABI Signed-off-by: Mike Frysinger --- cpu/blackfin/start.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cpu/blackfin/start.S') diff --git a/cpu/blackfin/start.S b/cpu/blackfin/start.S index c4d52b4..f351fab 100644 --- a/cpu/blackfin/start.S +++ b/cpu/blackfin/start.S @@ -1,7 +1,7 @@ /* * U-boot - start.S Startup file for Blackfin u-boot * - * Copyright (c) 2005-2007 Analog Devices Inc. + * Copyright (c) 2005-2008 Analog Devices Inc. * * This file is based on head.S * Copyright (c) 2003 Metrowerks/Motorola @@ -49,8 +49,8 @@ ENTRY(_start) /* Set our initial stack to L1 scratch space */ - sp.l = LO(L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE); - sp.h = HI(L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE); + sp.l = LO(L1_SRAM_SCRATCH_END - 20); + sp.h = HI(L1_SRAM_SCRATCH_END - 20); #ifdef CONFIG_HW_WATCHDOG # ifndef CONFIG_HW_WATCHDOG_TIMEOUT_START -- cgit v1.1 From bd33e5c613cf70e3cb51a73fdd653fe83b942bb0 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 11 Oct 2008 21:19:39 -0400 Subject: Blackfin: small cpu init optimization while setting interrupt mask Use the sti instruction to set the initial interrupt mask rather than banging on the core IMASK MMR to save both space and time. Signed-off-by: Mike Frysinger --- cpu/blackfin/start.S | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'cpu/blackfin/start.S') diff --git a/cpu/blackfin/start.S b/cpu/blackfin/start.S index f351fab..9975a0c 100644 --- a/cpu/blackfin/start.S +++ b/cpu/blackfin/start.S @@ -193,11 +193,8 @@ ENTRY(_start) p1.l = .Lenable_nested; p1.h = .Lenable_nested; [p0] = p1; - p2.l = LO(IMASK); - p2.h = HI(IMASK); - p3.l = LO(EVT_IVG15); - p3.h = HI(EVT_IVG15); - [p2] = p3; + r7 = EVT_IVG15 (z); + sti r7; raise 15; p4.l = .LWAIT_HERE; p4.h = .LWAIT_HERE; -- cgit v1.1