ARM: move interrupt_init to before relocation
Subsystems (2)
PATCH 1/10 ARM: move interrupt_init to before relocation
From: Rob Herring <[email protected]>
interrupt_init also sets up the abort stack, but is not setup before relocation. So any aborts during relocation will hang and not print out any useful information. Fix this by moving the interrupt_init to after the stack setup in board_init_f.
--- arch/arm/lib/board.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/lib/board.c +1 -0
@@ -447,6 +447,7 @@ void board_init_f(ulong bootflag) addr_sp +=128 ;/* leave 32 words for abort-stack */ gd->irq_sp = addr_sp;#endif +interrupt_init ();debug ("New Stack Pointer is: %08lx\n" , addr_sp);
Signature · 1 line
1.8.1.2
PATCH 2/10 net: calxedaxgmac: enable rx cut-thru
From: Rob Herring <[email protected]>
There is no reason to wait for the entire frame to start DMA on receive, so enable rx cut-thru for better performance.
--- drivers/net/calxedaxgmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/calxedaxgmac.c +1 -1
@@ -400,7 +400,7 @@ static int xgmac_init(struct eth_device *dev, bd_t * bis)/* set flow control parameters and store and forward mode */ value = (FIFO_MINUS_12K <<XGMAC_CORE_OMR_RFD_SHIFT ) | (FIFO_MINUS_4K <<XGMAC_CORE_OMR_RFA_SHIFT ) | -XGMAC_CORE_OMR_EFC |XGMAC_CORE_OMR_TSF |XGMAC_CORE_OMR_RSF ; +XGMAC_CORE_OMR_EFC |XGMAC_CORE_OMR_TSF ;writel (value, ®s->core_opmode);/* enable pause frames */
Signature · 1 line
1.8.1.2
PATCH 3/10 ARM: highbank: update config options
In reply to Rob HerringFrom: Rob Herring <[email protected]>
Various changes to highbank config:
Enable EFI partitions
Enable ext4 and FAT filesystems Enable bootz command and raw initrd Increase cmd and print buffer size to 1K Change serial baudrate to 115200 Enable hush shell
--- include/configs/highbank.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
include/configs/highbank.h +13 -2
@@ -18,7 +18,9 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_SYS_DCACHE_OFF #define CONFIG_L2_OFF +#define CONFIG_SYS_THUMB_BUILD #define CONFIG_SYS_NO_FLASH #define CFG_HZ 1000
@@ -26,6 +28,7 @@#define CONFIG_OF_LIBFDT #define CONFIG_FIT +#define CONFIG_SUPPORT_RAW_INITRD #define CONFIG_SYS_BOOTMAPSZ (16 << 20)/*
@@ -38,7 +41,7 @@#define CONFIG_PL01x_PORTS { (void *)(0xFFF36000) }#define CONFIG_CONS_INDEX 0 -#define CONFIG_BAUDRATE 38400 +#define CONFIG_BAUDRATE 115200#define CONFIG_BOOTCOUNT_LIMIT #define CONFIG_SYS_BOOTCOUNT_SINGLEWORD
@@ -54,6 +57,7 @@ CONFIG_SYS_SCSI_MAX_LUN)#define CONFIG_DOS_PARTITION +#define CONFIG_EFI_PARTITION #define CONFIG_CALXEDA_XGMAC
@@ -68,12 +72,15 @@#include <config_cmd_default.h> #define CONFIG_CMD_BDI +#define CONFIG_CMD_BOOTZ #define CONFIG_CMD_DHCP #define CONFIG_CMD_ELF #define CONFIG_CMD_MEMORY #define CONFIG_CMD_LOADS #define CONFIG_CMD_SCSI #define CONFIG_CMD_EXT2 +#define CONFIG_CMD_EXT4 +#define CONFIG_CMD_FAT #define CONFIG_CMD_PXE #define CONFIG_MENU
@@ -84,15 +91,19 @@#define CONFIG_CMDLINE_EDITING #define CONFIG_AUTO_COMPLETE #define CONFIG_SYS_LONGHELP /* undef to save memory */ -#define CONFIG_SYS_CBSIZE 256/* Console I/O Buffer Size */ +#define CONFIG_SYS_CBSIZE 1024/* Console I/O Buffer Size */ #define CONFIG_SYS_MAXARGS 16/* max number of cmd args */ #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE#define CONFIG_SYS_PROMPT "Highbank #" +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " +#define CONFIG_SYS_HUSH_PARSER /* Print Buffer Size */ #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ sizeof(CONFIG_SYS_PROMPT)+16)#define CONFIG_SYS_LOAD_ADDR 0x800000 +#define CONFIG_SYS_64BIT_LBA +/*----------------------------------------------------------------------- * Physical Memory Map
Signature · 1 line
1.8.1.2
PATCH 3/10 ARM: highbank: update config options
On Wed, May 15, 2013 at 02:56:09PM -0500, Rob Herring wrote:
[snip]
Quoted 1 line
+#define
CONFIG_SYS_PROMPT_HUSH_PS2"> "
Don't need this one anymore.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130516/f3a27168/attachment.pgp>
PATCH 4/10 ARM: highbank: fix get_tbclk value to timer rate
In reply to Rob HerringFrom: Rob Herring <[email protected]>
get_tbclk should return the timer's frequency, not CONFIG_SYS_HZ.
--- arch/arm/cpu/armv7/highbank/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/armv7/highbank/timer.c +1 -1
@@ -124,5 +124,5 @@ ulong get_timer_masked(void)ulong get_tbclk (void ) { -return CONFIG_SYS_HZ ; +return SYSTIMER_RATE ; }
Signature · 1 line
1.8.1.2
PATCH 5/10 ARM: highbank: set timer prescaler to 256
In reply to Rob HerringFrom: Rob Herring <[email protected]>
The 150MHz clock rate gives u-boot time functions problems and there's no benefit to a fast clock, so lower the rate.
--- arch/arm/cpu/armv7/highbank/timer.c | 6 ++++-- arch/arm/include/asm/arch-armv7/systimer.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/highbank/timer.c +4 -2
@@ -26,7 +26,7 @@#undef SYSTIMER_BASE#define SYSTIMER_BASE 0xFFF34000/* Timer 0 and 1 base */ -#define SYSTIMER_RATE 150000000 +#define SYSTIMER_RATE (150000000 / 256)static ulong timestamp;static ulong lastinc;
@@ -40,9 +40,11 @@ int timer_init(void)/* * Setup timer0 */ +writel (0 , &systimer_base->timer0control);writel (SYSTIMER_RELOAD , &systimer_base->timer0load);writel (SYSTIMER_RELOAD , &systimer_base->timer0value); -writel (SYSTIMER_EN |SYSTIMER_32BIT , &systimer_base->timer0control); +writel (SYSTIMER_EN |SYSTIMER_32BIT |SYSTIMER_PRESC_256 , + &systimer_base->timer0control);reset_timer_masked ();
arch/arm/include/asm/arch-armv7/systimer.h +2 -0
@@ -30,6 +30,8 @@#define SYSTIMER_RELOAD 0xFFFFFFFF#define SYSTIMER_EN (1 << 7)#define SYSTIMER_32BIT (1 << 1) +#define SYSTIMER_PRESC_16 (1 << 2) +#define SYSTIMER_PRESC_256 (1 << 3)struct systimer {u32 timer0load;/* 0x00 */
Signature · 1 line
1.8.1.2
PATCH 6/10 ARM: highbank: avoid bss write in timer_init
In reply to Rob HerringFrom: Rob Herring <[email protected]>
The timer_init function is called before relocation and writes to bss data were corrupting relocation data. Fix this by removing the call to reset_timer_masked. The initial timer count should be 0 or near 0 anyway, so initializing the variables are not needed.
--- arch/arm/cpu/armv7/highbank/timer.c | 2 -- 1 file changed, 2 deletions(-)
arch/arm/cpu/armv7/highbank/timer.c +0 -2
@@ -46,8 +46,6 @@ int timer_init(void)writel (SYSTIMER_EN |SYSTIMER_32BIT |SYSTIMER_PRESC_256 , &systimer_base->timer0control); -reset_timer_masked (); -return 0 ; }
Signature · 1 line
1.8.1.2
PATCH 7/10 ARM: highbank: enable reset on command timeout
In reply to Rob HerringFrom: Rob Herring <[email protected]>
Enable resetting on command timeout. The timeout is set with environment setting bootretry.
--- include/configs/highbank.h | 3 +++ 1 file changed, 3 insertions(+)
include/configs/highbank.h +3 -0
@@ -85,6 +85,9 @@#define CONFIG_MENU #define CONFIG_BOOTDELAY 2 +#define CONFIG_BOOT_RETRY_TIME -1 +#define CONFIG_RESET_TO_RETRY +/* * Miscellaneous configurable options */
Signature · 1 line
1.8.1.2
PATCH 8/10 ARM: highbank: setup peripherals based on power domain status
In reply to Rob HerringFrom: Rob Herring <[email protected]>
Accessing powered down peripherals will hang the bus, so check power domain status before initializing SATA and fixup the FDT to disable unused peripherals.
--- board/highbank/highbank.c | 29 +++++++++++++++++++++++++++-- include/configs/highbank.h | 1 + 2 files changed, 28 insertions(+), 2 deletions(-)
board/highbank/highbank.c +27 -2
@@ -25,11 +25,17 @@#define HB_SREG_A9_PWR_REQ 0xfff3cf00#define HB_SREG_A9_BOOT_SRC_STAT 0xfff3cf04 +#define HB_SREG_A9_PWRDOM_STAT 0xfff3cf20 +#define HB_PWR_SUSPEND 0#define HB_PWR_SOFT_RESET 1#define HB_PWR_HARD_RESET 2#define HB_PWR_SHUTDOWN 3 +#define PWRDOM_STAT_SATA 0x80000000 +#define PWRDOM_STAT_PCI 0x40000000 +#define PWRDOM_STAT_EMMC 0x20000000 +DECLARE_GLOBAL_DATA_PTR ;/*
@@ -58,9 +64,12 @@ int misc_init_r(void) {char envbuffer[16 ];u32 boot_choice; +u32 reg =readl (HB_SREG_A9_PWRDOM_STAT ); -ahci_init (0xffe08000 ); -scsi_scan (1 ); +if (reg &PWRDOM_STAT_SATA ) { +ahci_init (0xffe08000 ); +scsi_scan (1 ); + } boot_choice =readl (HB_SREG_A9_BOOT_SRC_STAT ) &0xff ;sprintf (envbuffer,"bootcmd%d" , boot_choice);
@@ -85,6 +94,22 @@ void dram_init_banksize(void) gd->bd->bi_dram[0 ].size =PHYS_SDRAM_1_SIZE ; } +#if defined(CONFIG_OF_BOARD_SETUP ) +void ft_board_setup (void *fdt,bd_t *bd) +{ +static const char disabled[] ="disabled" ; +u32 reg =readl (HB_SREG_A9_PWRDOM_STAT ); + +if (!(reg &PWRDOM_STAT_SATA )) +do_fixup_by_compat (fdt,"calxeda,hb-ahci" ,"status" , + disabled,sizeof (disabled),1 ); + +if (!(reg &PWRDOM_STAT_EMMC )) +do_fixup_by_compat (fdt,"calxeda,hb-sdhci" ,"status" , + disabled,sizeof (disabled),1 ); +} +#endif +void reset_cpu (ulong addr) {writel (HB_PWR_HARD_RESET ,HB_SREG_A9_PWR_REQ );
include/configs/highbank.h +1 -0
@@ -27,6 +27,7 @@#define CONFIG_SYS_HZ CFG_HZ#define CONFIG_OF_LIBFDT +#define CONFIG_OF_BOARD_SETUP #define CONFIG_FIT #define CONFIG_SUPPORT_RAW_INITRD #define CONFIG_SYS_BOOTMAPSZ (16 << 20)
Signature · 1 line
1.8.1.2
PATCH 8/10 ARM: highbank: setup peripherals based on power domain status
Quoted 5 lines · Rob Herring
From: Rob Herring <[email protected]>
Accessing powered down peripherals will hang the bus, so check power domain status before initializing SATA and fixup the FDT to disable unused peripherals.
[snip]
board/highbank/highbank.c int misc_init_r(void) · line 72
Quoted 6 lines
board/highbank/highbank.c +4
-2-ahci_init (0xffe08000 ); -scsi_scan (1 ); +if (reg &PWRDOM_STAT_SATA ) { +ahci_init (0xffe08000 ); +scsi_scan (1 ); + }
Define the magic value to something while you're in here cleaning up please, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130516/88fc6577/attachment.pgp>
PATCH 9/10 ARM: highbank: fix build with CONFIG_MISC_INIT_R turned off
In reply to Rob HerringFrom: Rob Herring <[email protected]>
--- board/highbank/highbank.c | 2 ++ 1 file changed, 2 insertions(+)
board/highbank/highbank.c +2 -0
@@ -60,6 +60,7 @@ int board_eth_init(bd_t *bis)return rc; } +#ifdef CONFIG_MISC_INIT_R int misc_init_r (void ) {char envbuffer[16 ];
@@ -81,6 +82,7 @@ int misc_init_r(void) return 0; } +#endif int dram_init (void ) {
Signature · 1 line
1.8.1.2
PATCH 9/10 ARM: highbank: fix build with CONFIG_MISC_INIT_R turned off
Hi Rob,
Quoted 3 lines · Rob Herring
From: Rob Herring <[email protected]>
Signed-off-by Rob Herring <[email protected]>
This commit could have more meaningful summary, such as "compile misc_init_r only if CONFIG_MISC_INIT_R"
Quoted 17 lines
--- board/highbank/highbank.c | 2 ++ 1 file changed, 2 insertions(+)board/highbank/highbank.c +1
-0@@ -60,6 +60,7 @@ int board_eth_init(bd_t *bis)return rc; } +#ifdef CONFIG_MISC_INIT_R int misc_init_r (void ) {char envbuffer[16 ];
board/highbank/highbank.c int misc_init_r(void) · line 88
Quoted 7 lines
board/highbank/highbank.c +1
-0@@ -81,6 +82,7 @@ int misc_init_r(void) return 0; } +#endif int dram_init (void ) {
Amicalement,
Signature · 1 line
Albert.
PATCH v2 1/1 ARM: highbank: compile misc_init_r only if CONFIG_MISC_INIT_R
In reply to Rob HerringFrom: Rob Herring <[email protected]>
Compile misc_init_r only if CONFIG_MISC_INIT_R is enabled.
--- board/highbank/highbank.c | 2 ++ 1 file changed, 2 insertions(+)
board/highbank/highbank.c +2 -0
@@ -62,6 +62,7 @@ int board_eth_init(bd_t *bis)return rc; } +#ifdef CONFIG_MISC_INIT_R int misc_init_r (void ) {char envbuffer[16 ];
@@ -83,6 +84,7 @@ int misc_init_r(void) return 0; } +#endif int dram_init (void ) {
Signature · 1 line
1.8.1.2
PATCH v2 1/1 ARM: highbank: setup peripherals based on power domain status
From: Rob Herring <[email protected]>
Accessing powered down peripherals will hang the bus, so check power domain status before initializing SATA and fixup the FDT to disable unused peripherals.
--- board/highbank/highbank.c | 31 +++++++++++++++++++++++++++++-- include/configs/highbank.h | 1 + 2 files changed, 30 insertions(+), 2 deletions(-)
board/highbank/highbank.c +29 -2
@@ -23,13 +23,21 @@#include <asm/sizes.h> #include <asm/io.h> +#define HB_AHCI_BASE 0xffe08000 +#define HB_SREG_A9_PWR_REQ 0xfff3cf00#define HB_SREG_A9_BOOT_SRC_STAT 0xfff3cf04 +#define HB_SREG_A9_PWRDOM_STAT 0xfff3cf20 +#define HB_PWR_SUSPEND 0#define HB_PWR_SOFT_RESET 1#define HB_PWR_HARD_RESET 2#define HB_PWR_SHUTDOWN 3 +#define PWRDOM_STAT_SATA 0x80000000 +#define PWRDOM_STAT_PCI 0x40000000 +#define PWRDOM_STAT_EMMC 0x20000000 +DECLARE_GLOBAL_DATA_PTR ;/*
@@ -58,9 +66,12 @@ int misc_init_r(void) {char envbuffer[16 ];u32 boot_choice; +u32 reg =readl (HB_SREG_A9_PWRDOM_STAT ); -ahci_init (0xffe08000 ); -scsi_scan (1 ); +if (reg &PWRDOM_STAT_SATA ) { +ahci_init (HB_AHCI_BASE ); +scsi_scan (1 ); + } boot_choice =readl (HB_SREG_A9_BOOT_SRC_STAT ) &0xff ;sprintf (envbuffer,"bootcmd%d" , boot_choice);
@@ -85,6 +96,22 @@ void dram_init_banksize(void) gd->bd->bi_dram[0 ].size =PHYS_SDRAM_1_SIZE ; } +#if defined(CONFIG_OF_BOARD_SETUP ) +void ft_board_setup (void *fdt,bd_t *bd) +{ +static const char disabled[] ="disabled" ; +u32 reg =readl (HB_SREG_A9_PWRDOM_STAT ); + +if (!(reg &PWRDOM_STAT_SATA )) +do_fixup_by_compat (fdt,"calxeda,hb-ahci" ,"status" , + disabled,sizeof (disabled),1 ); + +if (!(reg &PWRDOM_STAT_EMMC )) +do_fixup_by_compat (fdt,"calxeda,hb-sdhci" ,"status" , + disabled,sizeof (disabled),1 ); +} +#endif +void reset_cpu (ulong addr) {writel (HB_PWR_HARD_RESET ,HB_SREG_A9_PWR_REQ );
include/configs/highbank.h +1 -0
@@ -27,6 +27,7 @@#define CONFIG_SYS_HZ CFG_HZ#define CONFIG_OF_LIBFDT +#define CONFIG_OF_BOARD_SETUP #define CONFIG_FIT #define CONFIG_SUPPORT_RAW_INITRD #define CONFIG_SYS_BOOTMAPSZ (16 << 20)
Signature · 1 line
1.8.1.2
PATCH v2 1/1 ARM: highbank: update config options
In reply to Rob HerringFrom: Rob Herring <[email protected]>
Various changes to highbank config:
Enable EFI partitions
Enable ext4 and FAT filesystems Enable bootz command and raw initrd Increase cmd and print buffer size to 1K Change serial baudrate to 115200 Enable hush shell
--- include/configs/highbank.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
include/configs/highbank.h +12 -2
@@ -18,7 +18,9 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_SYS_DCACHE_OFF #define CONFIG_L2_OFF +#define CONFIG_SYS_THUMB_BUILD #define CONFIG_SYS_NO_FLASH #define CFG_HZ 1000
@@ -26,6 +28,7 @@#define CONFIG_OF_LIBFDT #define CONFIG_FIT +#define CONFIG_SUPPORT_RAW_INITRD #define CONFIG_SYS_BOOTMAPSZ (16 << 20)/*
@@ -38,7 +41,7 @@#define CONFIG_PL01x_PORTS { (void *)(0xFFF36000) }#define CONFIG_CONS_INDEX 0 -#define CONFIG_BAUDRATE 38400 +#define CONFIG_BAUDRATE 115200#define CONFIG_BOOTCOUNT_LIMIT #define CONFIG_SYS_BOOTCOUNT_SINGLEWORD
@@ -54,6 +57,7 @@ CONFIG_SYS_SCSI_MAX_LUN)#define CONFIG_DOS_PARTITION +#define CONFIG_EFI_PARTITION #define CONFIG_CALXEDA_XGMAC
@@ -68,12 +72,15 @@#include <config_cmd_default.h> #define CONFIG_CMD_BDI +#define CONFIG_CMD_BOOTZ #define CONFIG_CMD_DHCP #define CONFIG_CMD_ELF #define CONFIG_CMD_MEMORY #define CONFIG_CMD_LOADS #define CONFIG_CMD_SCSI #define CONFIG_CMD_EXT2 +#define CONFIG_CMD_EXT4 +#define CONFIG_CMD_FAT #define CONFIG_CMD_PXE #define CONFIG_MENU
@@ -84,15 +91,18 @@#define CONFIG_CMDLINE_EDITING #define CONFIG_AUTO_COMPLETE #define CONFIG_SYS_LONGHELP /* undef to save memory */ -#define CONFIG_SYS_CBSIZE 256/* Console I/O Buffer Size */ +#define CONFIG_SYS_CBSIZE 1024/* Console I/O Buffer Size */ #define CONFIG_SYS_MAXARGS 16/* max number of cmd args */ #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE#define CONFIG_SYS_PROMPT "Highbank #" +#define CONFIG_SYS_HUSH_PARSER /* Print Buffer Size */ #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ sizeof(CONFIG_SYS_PROMPT)+16)#define CONFIG_SYS_LOAD_ADDR 0x800000 +#define CONFIG_SYS_64BIT_LBA +/*----------------------------------------------------------------------- * Physical Memory Map
Signature · 1 line
1.8.1.2
PATCH v2 1/1 ARM: move interrupt_init to before relocation
In reply to Rob HerringFrom: Rob Herring <[email protected]>
interrupt_init also sets up the abort stack, but is not setup before relocation. So any aborts during relocation will hang and not print out any useful information. Fix this by moving the interrupt_init to after the stack setup in board_init_f.
--- arch/arm/lib/board.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/lib/board.c +1 -2
@@ -447,6 +447,7 @@ void board_init_f(ulong bootflag) addr_sp +=128 ;/* leave 32 words for abort-stack */ gd->irq_sp = addr_sp;#endif +interrupt_init ();debug ("New Stack Pointer is: %08lx\n" , addr_sp);
@@ -648,8 +649,6 @@ void board_init_r(gd_t *id, ulong dest_addr)misc_init_r ();#endif -/* set up exceptions */ -interrupt_init ();/* enable exceptions */ enable_interrupts ();
Signature · 1 line
1.8.1.2
PATCH v2 1/1 ARM: highbank: compile misc_init_r only if CONFIG_MISC_INIT_R
In reply to Rob HerringHi Rob,
Quoted 22 lines · Rob Herring
From: Rob Herring <[email protected]>
Compile
misc_init_ronly ifCONFIG_MISC_INIT_Ris enabled.Signed-off-by Rob Herring <[email protected]>--- board/highbank/highbank.c | 2 ++ 1 file changed, 2 insertions(+)board/highbank/highbank.c +1
-0@@ -62,6 +62,7 @@ int board_eth_init(bd_t *bis)return rc; } +#ifdef CONFIG_MISC_INIT_R int misc_init_r (void ) {char envbuffer[16 ];
board/highbank/highbank.c int misc_init_r(void) · line 90
Quoted 7 lines
board/highbank/highbank.c +1
-0@@ -83,6 +84,7 @@ int misc_init_r(void) return 0; } +#endif int dram_init (void ) {
This patch probably beloings to a series, only it lacks history and the post subject lacks nn/NN indications as well.
Ditto for:
http://patchwork.ozlabs.org/patch/245407/
http://patchwork.ozlabs.org/patch/245411/
http://patchwork.ozlabs.org/patch/245412/
Amicalement,
Signature · 1 line
Albert.
PATCH 10/10 highbank: enable keyed autoboot stop
In reply to Rob HerringFrom: Rob Herring <[email protected]>
Restrict autoboot interruption to "s" or "d" keys. This will prevent some unwanted stopping and also allow disabling the reset on command timeout.
--- include/configs/highbank.h | 2 ++ 1 file changed, 2 insertions(+)
include/configs/highbank.h +2 -0
@@ -88,6 +88,8 @@#define CONFIG_BOOTDELAY 2#define CONFIG_BOOT_RETRY_TIME -1#define CONFIG_RESET_TO_RETRY +#define CONFIG_AUTOBOOT_KEYED +#define CONFIG_AUTOBOOT_PROMPT "Autobooting in %d seconds...\nPress <s> to stop or <d> to delay\n", bootdelay/* * Miscellaneous configurable options
Signature · 1 line
1.8.1.2
PATCH 1/10 ARM: move interrupt_init to before relocation
In reply to Rob HerringHi Rob,
Quoted 17 lines · Rob Herring
From: Rob Herring <[email protected]>
interrupt_initalso sets up the abort stack, but is not setup before relocation. So any aborts during relocation will hang and not print out any useful information. Fix this by moving theinterrupt_initto after the stack setup inboard_init_f.Signed-off-by Rob Herring <[email protected]>--- arch/arm/lib/board.c | 1 + 1 file changed, 1 insertion(+)arch/arm/lib/board.c +0
-0
arch/arm/lib/board.c void board_init_f(ulong bootflag) · line 453
Quoted 7 lines
arch/arm/lib/board.c +1
-0@@ -447,6 +447,7 @@ void board_init_f(ulong bootflag) addr_sp +=128 ;/* leave 32 words for abort-stack */ gd->irq_sp = addr_sp;#endif +interrupt_init ();debug ("New Stack Pointer is: %08lx\n" , addr_sp);
I fail to understand how this is even supposed to work through
relocation: exception vectors are not relocated, so if they work before relocation, then they won't work any more afterward unless some code is added to relocate them.
Also: if this patch is moving interrupt_init(), then where is the line where a call to interrupt_init() is removed?
Amicalement,
Signature · 1 line
Albert.
PATCH 1/10 ARM: move interrupt_init to before relocation
Quoted 27 lines · Albert ARIBAUD
Hi Rob,
Quoted 22 lines · Rob Herring
From: Rob Herring <[email protected]>
interrupt_initalso sets up the abort stack, but is not setup before relocation. So any aborts during relocation will hang and not print out any useful information. Fix this by moving theinterrupt_initto after the stack setup inboard_init_f.Signed-off-by Rob Herring <[email protected]>--- arch/arm/lib/board.c | 1 + 1 file changed, 1 insertion(+)arch/arm/lib/board.c +1
-0@@ -447,6 +447,7 @@ void board_init_f(ulong bootflag) addr_sp +=128 ;/* leave 32 words for abort-stack */ gd->irq_sp = addr_sp;#endif +interrupt_init ();
Quoted 7 lines
arch/arm/lib/board.c void board_init_f(ulong bootflag) · line 453
Quoted 2 lines
arch/arm/lib/board.c +0
-0debug ("New Stack Pointer is: %08lx\n" , addr_sp);I fail to understand how this is even supposed to work through
relocation: exception vectors are not relocated, so if they work before relocation, then they won't work any more afterward unless some code is added to relocate them.
They work before and after in my testing. The vectors are relocated along with the rest of u-boot and the vector base is updated by c_runtime_cpu_setup. I'm simply setting up the abort stack earlier. An alternative would be to setup a different abort handler and stack before relocation. I'm open to suggestions, but as it stands now aborts before or during relocation will simply hang without this.
Quoted 2 lines
Also: if this patch is moving
interrupt_init(), then where is the line where a call tointerrupt_init()is removed?
Yes, the later call to interrupt_init should be removed assuming we keep this approach.
Rob
PATCH 1/10 ARM: move interrupt_init to before relocation
Hi Rob,
Quoted 37 lines · Rob Herring
Quoted 27 lines · Albert ARIBAUD
Hi Rob,
Quoted 22 lines · Rob Herring
From: Rob Herring <[email protected]>
interrupt_initalso sets up the abort stack, but is not setup before relocation. So any aborts during relocation will hang and not print out any useful information. Fix this by moving theinterrupt_initto after the stack setup inboard_init_f.Signed-off-by Rob Herring <[email protected]>--- arch/arm/lib/board.c | 1 + 1 file changed, 1 insertion(+)arch/arm/lib/board.c +1
-0@@ -447,6 +447,7 @@ void board_init_f(ulong bootflag) addr_sp +=128 ;/* leave 32 words for abort-stack */ gd->irq_sp = addr_sp;#endif +interrupt_init ();Quoted 7 lines
arch/arm/lib/board.c void board_init_f(ulong bootflag) · line 453
Quoted 2 lines
arch/arm/lib/board.c +0
-0debug ("New Stack Pointer is: %08lx\n" , addr_sp);I fail to understand how this is even supposed to work through
relocation: exception vectors are not relocated, so if they work before relocation, then they won't work any more afterward unless some code is added to relocate them.
Quoted 6 lines
They work before and after in my testing. The vectors are relocated along with the rest of u-boot and the vector base is updated by
c_runtime_cpu_setup. I'm simply setting up the abort stack earlier. An alternative would be to setup a different abort handler and stack before relocation. I'm open to suggestions, but as it stands now aborts before or during relocation will simply hang without this.
Thanks for the clarification.
This opens at least two quite interesting issues:
1. interrupts_init() does not initialize interrupts but stacks, and does not initialize only interrupt stacks but also exception stacks; it badly needs a rename (and so does the abort stack, BTW).
2. Much more worrying, interrupt vectors are only fixed for armv7, and only by setting VBAR. This seems to imply that for all other ARM targets, VBAR is not modified, and neither are the exception vectors at either 0x00000000 or 0xFFFF0000; and this means that exceptions are never pointed to the RAM-running U-Boot; they would work for NOR FLASH based U-Boots, but any other case I simply fail to see how it would work as intended.
But issue 2 is so big that I probably simply missed something obvious. Anyone able to show me how dumb I am here, feel free. :)
Regarding your change, Rob, it's good news anyway as I'm not going to ask you to overhaul the whole of ARM exception handling code in any case :) and I am fine with the change as it is, except:
Quoted 5 lines
Quoted 2 lines
Also: if this patch is moving
interrupt_init(), then where is the line where a call tointerrupt_init()is removed?Yes, the later call to
interrupt_initshould be removed assuming we keep this approach.
Then I would like the removal to be paired with this addition in a single commit.
Quoted 1 line
Rob
Amicalement,
Signature · 1 line
Albert.