arm: spear: Fix booting - relocate vector table to 0 (low-vector)
Subsystems (4)
PATCH 1/5 arm: spear: Fix booting - relocate vector table to 0 (low-vector)
Booting SPEAr600 eval board doesn't work with current mainline U-Boot. With this patch the low-vector bit is left to '0'. Resulting in the common relocation of the vectors to 0 (SDRAM) to work correctly.
Tested on the SPEAr600 EVB.
--- board/spear/common/spr_lowlevel_init.S | 5 ----- 1 file changed, 5 deletions(-)
board/spear/common/spr_lowlevel_init.S +0 -5
@@ -14,11 +14,6 @@ */ .globl lowlevel_init lowlevel_init: - /* By default, U-Boot switches CPU to low-vector */ - /* Revert this as we work in high vector even in U-Boot */ - mrc p15, 0, r0, c1, c0, 0 - orr r0, r0, #0x00002000 - mcr p15, 0, r0, c1, c0, 0 mov pc, lr /* void setfreq(unsigned int device, unsigned int frequency) */
Signature · 1 line
2.4.8
PATCH 2/5 arm: spear: Move to common SPL infrastructure
The SPL implementation for SPEAr600 is older than the common SPL infrastructure. This patch now moves the SPEAr600 SPL over to the common SPL code.
Tested on the only SPEAr board that currently uses SPL in mainline U-Boot, the x600.
--- arch/arm/cpu/arm926ejs/spear/Makefile | 2 +- arch/arm/cpu/arm926ejs/spear/spear600.c | 23 ++-- arch/arm/cpu/arm926ejs/spear/spl.c | 74 ++++++------ arch/arm/cpu/arm926ejs/spear/spl_boot.c | 181 ---------------------------- arch/arm/cpu/arm926ejs/spear/start.S | 3 +- arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds | 54 +++------ arch/arm/include/asm/arch-spear/spr_defs.h | 2 - include/configs/x600.h | 17 ++- 8 files changed, 85 insertions(+), 271 deletions(-) delete mode 100644 arch/arm/cpu/arm926ejs/spear/spl_boot.c
arch/arm/cpu/arm926ejs/spear/Makefile +1 -1
@@ -10,7 +10,7 @@ obj-y := cpu.o \ timer.o ifdef CONFIG_SPL_BUILD -obj-y += spl.o spl_boot.o +obj-y += spl.o obj-$(CONFIG_SPEAR600) += spear600.o obj-$(CONFIG_DDR_MT47H64M16) += spr600_mt47h64m16_3_333_cl5_psync.o obj-$(CONFIG_DDR_MT47H32M16) += spr600_mt47h32m16_333_cl5_psync.o
arch/arm/cpu/arm926ejs/spear/spear600.c +15 -8
@@ -12,6 +12,21 @@#include <asm/arch/spr_misc.h> #include <asm/arch/spr_defs.h> +void spear_late_init (void ) +{ +struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE ; + +writel (0x80000007 , &misc_p->arb_icm_ml1); +writel (0x80000007 , &misc_p->arb_icm_ml2); +writel (0x80000007 , &misc_p->arb_icm_ml3); +writel (0x80000007 , &misc_p->arb_icm_ml4); +writel (0x80000007 , &misc_p->arb_icm_ml5); +writel (0x80000007 , &misc_p->arb_icm_ml6); +writel (0x80000007 , &misc_p->arb_icm_ml7); +writel (0x80000007 , &misc_p->arb_icm_ml8); +writel (0x80000007 , &misc_p->arb_icm_ml9); +} +static void sel_1v8 (void ) {struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE ;
@@ -104,14 +119,6 @@ void plat_ddr_init(void) }/* -* soc_init: -*/ -void soc_init (void ) -{ -/* Nothing to be done for SPEAr600 */ -} - -/* * xxx_boot_selected: * * return true if the particular booting option is selected
arch/arm/cpu/arm926ejs/spear/spl.c +36 -38
103 lines not on this page · raw message
arch/arm/cpu/arm926ejs/spear/spl_boot.c deleted +0 -181
181 lines not on this page · raw message
arch/arm/cpu/arm926ejs/spear/start.S +1 -2
@@ -45,7 +45,6 @@ reset: * BSS area lies in the DDR location which is not yet initialized * bss is assumed to be uninitialized. */ - bl spl_boot ldmia sp!, {r0-r12,pc} /*
@@ -77,5 +76,5 @@ cpu_init_crit: * Go setup Memory and board specific bits prior to relocation. */ stmdb sp!, {lr} - bl lowlevel_init /* go setup pll,mux,memory */ + bl _main /* _main will call board_init_f */ ldmia sp!, {pc}
arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds +20 -34
83 lines not on this page · raw message
arch/arm/include/asm/arch-spear/spr_defs.h +0 -2
@@ -13,9 +13,7 @@ extern void setfreq(unsigned int, unsigned int);extern unsigned int setfreq_sz;void plat_ddr_init (void ); -void soc_init (void );void spear_late_init (void ); -void plat_late_init (void );int snor_boot_selected (void );int nand_boot_selected (void );
include/configs/x600.h +12 -5
@@ -2,7 +2,7 @@* (C) Copyright 2009 * Vipin Kumar, STMicroelectronics, <[email protected]> * -* Copyright (C) 2012 Stefan Roese <[email protected]> +* Copyright (C) 2012, 2015 Stefan Roese <[email protected]> * * SPDX-License-Identifier: GPL-2.0+ */
@@ -162,7 +162,8 @@/* Use last 2 lwords in internal SRAM for bootcounter */ #define CONFIG_BOOTCOUNT_LIMIT -#define CONFIG_SYS_BOOTCOUNT_ADDR 0xd2801ff8 +#define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SRAM_BASE + \ + CONFIG_SRAM_SIZE)#define CONFIG_HOSTNAME x600#define CONFIG_UBI_PART ubi0
@@ -248,8 +249,11 @@#define PHYS_SDRAM_1_MAXSIZE 0x40000000#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 -#define CONFIG_SYS_INIT_RAM_ADDR 0xD2800000 -#define CONFIG_SYS_INIT_RAM_SIZE 0x2000 +#define CONFIG_SRAM_BASE 0xd2800000 +/* Preserve the last 2 lwords for the boot-counter */ +#define CONFIG_SRAM_SIZE ((8 << 10) - 0x8) +#define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SRAM_BASE +#define CONFIG_SYS_INIT_RAM_SIZE CONFIG_SRAM_SIZE#define CONFIG_SYS_INIT_SP_OFFSET \ (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
@@ -260,10 +264,13 @@/* * SPL related defines */ -#define CONFIG_SPL_TEXT_BASE 0xd2800b00 +#define CONFIG_SPL_TEXT_BASE 0xd2800b00 +#define CONFIG_SPL_MAX_SIZE (CONFIG_SRAM_SIZE - 0xb00)#define CONFIG_SPL_START_S_PATH "arch/arm/cpu/arm926ejs/spear"#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds" +#define CONFIG_SPL_FRAMEWORK +#define CONFIG_SPL_NOR_SUPPORT #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPL_LIBCOMMON_SUPPORT /* image.c */ #define CONFIG_SPL_LIBGENERIC_SUPPORT /* string.c */
Signature · 1 line
2.4.8
PATCH 2/5 arm: spear: Move to common SPL infrastructure
Quoted 10 lines · Stefan Roese
The SPL implementation for SPEAr600 is older than the common SPL infrastructure. This patch now moves the SPEAr600 SPL over to the common SPL code.
Tested on the only SPEAr board that currently uses SPL in mainline U-Boot, the x600.
Signed-off-by Stefan Roese <[email protected]>Cc Viresh Kumar <[email protected]>Cc Vipin Kumar <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150828/4f57cae0/attachment.sig>
PATCH 3/5 usb: spear: Add support for both SPEAr600 EHCI controllers
In reply to Stefan RoeseUSB EHCI on SPEAr600 has not been tested for a while. The base controller addresses are missing. This patch adds the defines to the header. And adds the missing code.
--- arch/arm/cpu/arm926ejs/spear/cpu.c | 4 ++++ arch/arm/include/asm/arch-spear/hardware.h | 2 ++ drivers/usb/host/ehci-spear.c | 38 +++++++++++++++++++++++++++--- 3 files changed, 41 insertions(+), 3 deletions(-)
arch/arm/cpu/arm926ejs/spear/cpu.c +4 -0
@@ -47,8 +47,12 @@ int arch_cpu_init(void)#if defined(CONFIG_NAND_FSMC ) periph1_clken |=MISC_FSMCENB ;#endif +#if defined(CONFIG_USB_EHCI_SPEAR ) + periph1_clken |=PERIPH_USBH1 |PERIPH_USBH2 ; +#endif writel (periph1_clken, &misc_p->periph1_clken); +return 0 ; }
arch/arm/include/asm/arch-spear/hardware.h +2 -0
@@ -11,6 +11,8 @@#define CONFIG_SYS_USBD_BASE 0xE1100000#define CONFIG_SYS_PLUG_BASE 0xE1200000#define CONFIG_SYS_FIFO_BASE 0xE1000800 +#define CONFIG_SYS_UHC0_EHCI_BASE 0xE1800000 +#define CONFIG_SYS_UHC1_EHCI_BASE 0xE2000000#define CONFIG_SYS_SMI_BASE 0xFC000000#define CONFIG_SPEAR_SYSCNTLBASE 0xFCA00000#define CONFIG_SPEAR_TIMERBASE 0xFC800000
drivers/usb/host/ehci-spear.c +35 -3
@@ -14,7 +14,21 @@#include <usb.h> #include "ehci.h" #include <asm/arch/hardware.h> +#include <asm/arch/spr_misc.h> +static void spear6xx_usbh_stop (void ) +{ +struct misc_regs *const misc_p = + (struct misc_regs *)CONFIG_SPEAR_MISCBASE ; +u32 periph1_rst =readl (misc_p->periph1_rst); + + periph1_rst |=PERIPH_USBH1 |PERIPH_USBH2 ; +writel (periph1_rst, misc_p->periph1_rst); + +udelay (1000 ); + periph1_rst &= ~(PERIPH_USBH1 |PERIPH_USBH2 ); +writel (periph1_rst, misc_p->periph1_rst); +}/* * Create the appropriate control structures to manage
@@ -23,9 +37,23 @@int ehci_hcd_init (int index,enum usb_init_type init,struct ehci_hccr **hccr,struct ehci_hcor **hcor) { - *hccr = (struct ehci_hccr *)(CONFIG_SYS_UHC0_EHCI_BASE +0x100 ); - *hcor = (struct ehci_hcor *)((uint32_t )*hccr - +HC_LENGTH (ehci_readl (&(*hccr)->cr_capbase))); +u32 ehci =0 ; + +switch (index) { +case 0 : + ehci =CONFIG_SYS_UHC0_EHCI_BASE ; +break ; +case 1 : + ehci =CONFIG_SYS_UHC1_EHCI_BASE ; +break ; +default : +printf ("ERROR: wrong controller index!\n" ); +break ; + }; + + *hccr = (struct ehci_hccr *)(ehci +0x100 ); + *hcor = (struct ehci_hcor *)((uint32_t ) *hccr + +HC_LENGTH (ehci_readl (&(*hccr)->cr_capbase))); debug("SPEAr-ehci: init hccr %x and hcor %x hc_length %d\n", (uint32_t)*hccr, (uint32_t)*hcor,
@@ -40,5 +68,9 @@ int ehci_hcd_init(int index, enum usb_init_type init,*/ int ehci_hcd_stop (int index) { +#if defined(CONFIG_SPEAR600 ) +spear6xx_usbh_stop (); +#endif +return 0 ; }
Signature · 1 line
2.4.8
PATCH 3/5 usb: spear: Add support for both SPEAr600 EHCI controllers
Quoted 8 lines · Stefan Roese
USB EHCI on SPEAr600 has not been tested for a while. The base controller addresses are missing. This patch adds the defines to the header. And adds the missing code.
Signed-off-by Stefan Roese <[email protected]>Cc Viresh Kumar <[email protected]>Cc Vipin Kumar <[email protected]>Cc Marek Vasut <[email protected]>
Applied to u-boot-usb/master, thanks
Best regards,
Marek Vasut
PATCH 3/5 usb: spear: Add support for both SPEAr600 EHCI controllers
In reply to Stefan RoeseQuoted 8 lines · Stefan Roese
USB EHCI on SPEAr600 has not been tested for a while. The base controller addresses are missing. This patch adds the defines to the header. And adds the missing code.
Signed-off-by Stefan Roese <[email protected]>Cc Viresh Kumar <[email protected]>Cc Vipin Kumar <[email protected]>Cc Marek Vasut <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150828/7d2a97ec/attachment.sig>
PATCH 3/5 usb: spear: Add support for both SPEAr600 EHCI controllers
Quoted 11 lines · Tom Rini
Quoted 8 lines · Stefan Roese
USB EHCI on SPEAr600 has not been tested for a while. The base controller addresses are missing. This patch adds the defines to the header. And adds the missing code.
Signed-off-by Stefan Roese <[email protected]>Cc Viresh Kumar <[email protected]>Cc Vipin Kumar <[email protected]>Cc Marek Vasut <[email protected]>Applied to u-boot/master, thanks!
I see this in mainline already:
e8d0569 | Stefan Roese | usb: spear: Add support for both SPEAr600 EHCI controllers
Best regards,
Marek Vasut
PATCH 4/5 arm: spear: Enable caches on SPEAr
In reply to Stefan RoeseThe designware ethernet driver supports d-cache now. So there is nothing stopping us now to enable the caches completely on SPEAr.
Tested on SPEAr600 x600 board.
--- arch/arm/cpu/arm926ejs/spear/cpu.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/cpu/arm926ejs/spear/cpu.c +10 -0
@@ -56,6 +56,16 @@ int arch_cpu_init(void)return 0 ; } +void enable_caches (void ) +{ +#ifndef CONFIG_SYS_ICACHE_OFF +icache_enable (); +#endif +#ifndef CONFIG_SYS_DCACHE_OFF +dcache_enable (); +#endif +} +#ifdef CONFIG_DISPLAY_CPUINFO int print_cpuinfo (void ) {
Signature · 1 line
2.4.8
PATCH 4/5 arm: spear: Enable caches on SPEAr
Quoted 8 lines · Stefan Roese
The designware ethernet driver supports d-cache now. So there is nothing stopping us now to enable the caches completely on SPEAr.
Tested on SPEAr600 x600 board.
Signed-off-by Stefan Roese <[email protected]>Cc Viresh Kumar <[email protected]>Cc Vipin Kumar <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150828/07e49732/attachment.sig>
PATCH 5/5 arm: spear: Some changes / updates to the x600 config header
In reply to Stefan RoeseThis patch brings the following changes to the x600 board support:
- Add USB EHCI support
- Add VFAT support for USB key file access
- Increase malloc size (for UBI / UBIFS usage)
- Enable Thumb mode to save some image space
- Remove unreferenced CONFIG_STACKSIZE
- Remove unreferenced CONFIG_SPL_NO_PRINTF
--- include/configs/x600.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
include/configs/x600.h +16 -5
@@ -30,6 +30,7 @@#define CONFIG_SYS_SPL_LEN CONFIG_SPL_PAD_TO#define CONFIG_SYS_UBOOT_BASE (CONFIG_SYS_FLASH_BASE + \ CONFIG_SYS_SPL_LEN) +#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE#define CONFIG_SYS_MONITOR_LEN 0x60000
@@ -98,6 +99,12 @@#define CONFIG_FPGA_SPARTAN3 #define CONFIG_FPGA_COUNT 1 +/* USB EHCI options */ +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_SPEAR +#define CONFIG_USB_STORAGE +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 +/* * Command support defines */
@@ -105,7 +112,9 @@#define CONFIG_CMD_DATE #define CONFIG_CMD_DHCP #define CONFIG_CMD_ENV +#define CONFIG_CMD_FAT #define CONFIG_CMD_FPGA_LOADMK +#define CONFIG_CMD_FS_GENERIC #define CONFIG_CMD_GPIO #define CONFIG_CMD_I2C #define CONFIG_CMD_MII
@@ -115,8 +124,13 @@#define CONFIG_CMD_SAVES #define CONFIG_CMD_UBI #define CONFIG_CMD_UBIFS +#define CONFIG_CMD_USB #define CONFIG_LZO +/* Filesystem support (for USB key) */ +#define CONFIG_SUPPORT_VFAT +#define CONFIG_DOS_PARTITION +#define CONFIG_BOOTDELAY 3#define CONFIG_SYS_HUSH_PARSER /* Use the HUSH parser */
@@ -148,10 +162,11 @@#define CONFIG_SYS_MEMTEST_START 0x00800000#define CONFIG_SYS_MEMTEST_END 0x04000000 -#define CONFIG_SYS_MALLOC_LEN (1024 * 1024) +#define CONFIG_SYS_MALLOC_LEN (8 << 20)#define CONFIG_IDENT_STRING "-SPEAr"#define CONFIG_SYS_LONGHELP #define CONFIG_CMDLINE_EDITING +#define CONFIG_AUTO_COMPLETE #define CONFIG_SYS_CBSIZE 256#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ sizeof(CONFIG_SYS_PROMPT) + 16)
@@ -240,9 +255,6 @@"bootcmd=run nand_ubifs\0" \"\0" -/* Stack sizes */ -#define CONFIG_STACKSIZE (512 * 1024) - /* Physical Memory Map */#define CONFIG_NR_DRAM_BANKS 1#define PHYS_SDRAM_1 0x00000000
@@ -274,7 +286,6 @@#define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPL_LIBCOMMON_SUPPORT /* image.c */ #define CONFIG_SPL_LIBGENERIC_SUPPORT /* string.c */ -#define CONFIG_SPL_NO_PRINTF /* * Please select/define only one of the following
Signature · 1 line
2.4.8
PATCH 5/5 arm: spear: Some changes / updates to the x600 config header
Quoted 9 lines · Stefan Roese
This patch brings the following changes to the x600 board support:
- Add USB EHCI support
- Add VFAT support for USB key file access
- Increase malloc size (for UBI / UBIFS usage)
- Enable Thumb mode to save some image space
- Remove unreferencedCONFIG_STACKSIZE
- Remove unreferencedCONFIG_SPL_NO_PRINTF
Quoted 3 lines
Signed-off-by Stefan Roese <[email protected]>Cc Viresh Kumar <[email protected]>Cc Vipin Kumar <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150828/05addd52/attachment.sig>
PATCH 1/5 arm: spear: Fix booting - relocate vector table to 0 (low-vector)
In reply to Stefan RoeseQuoted 19 lines · Stefan Roese
Booting SPEAr600 eval board doesn't work with current mainline U-Boot. With this patch the low-vector bit is left to '0'. Resulting in the common relocation of the vectors to 0 (SDRAM) to work correctly.
Tested on the SPEAr600 EVB.
Signed-off-by Stefan Roese <[email protected]>Cc Viresh Kumar <[email protected]>Cc Vipin Kumar <[email protected]>--- board/spear/common/spr_lowlevel_init.S | 5 ----- 1 file changed, 5 deletions(-)board/spear/common/spr_lowlevel_init.S +0
-0@@ -14,11 +14,6 @@ */
board/spear/common/spr_lowlevel_init.S line 19
Quoted 10 lines
board/spear/common/spr_lowlevel_init.S +0
-5.globl lowlevel_init lowlevel_init: - /* By default, U-Boot switches CPU to low-vector */ - /* Revert this as we work in high vector even in U-Boot */ - mrc p15, 0, r0, c1, c0, 0 - orr r0, r0, #0x00002000 - mcr p15, 0, r0, c1, c0, 0 mov pc, lr /* void setfreq(unsigned int device, unsigned int frequency) */
For the complete series:
Signature · 1 line
viresh
PATCH 1/5 arm: spear: Fix booting - relocate vector table to 0 (low-vector)
In reply to Stefan RoeseQuoted 10 lines · Stefan Roese
Booting SPEAr600 eval board doesn't work with current mainline U-Boot. With this patch the low-vector bit is left to '0'. Resulting in the common relocation of the vectors to 0 (SDRAM) to work correctly.
Tested on the SPEAr600 EVB.
Signed-off-by Stefan Roese <[email protected]>Cc Viresh Kumar <[email protected]>Cc Vipin Kumar <[email protected]>Acked-by Viresh Kumar <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150828/51c995bc/attachment.sig>