spl: exynos: make spl_boot common for all exynos based platforms
Subsystems (2)
PATCH 1/1 spl: exynos: make spl_boot common for all exynos based platforms
The spl_boot.c which copies the u-boot from the booting device to ram is made common for all the exynos based platforms. To do so:
1. Moved smdk5250/spl_boot.c to common armv7/exynos folder and updated to make it common for exynos4 and exynos5
2. Introduced a CONFIG_SPL_BOOTING option as only exynos5250 supports booting from SPI device
3. Renamed some config options to make them common between exynos5250, origen and smdkv310.
SD/MMC booting: tested on exynos4210 based origen, exynos5250 based Arndale and SMDK5250 boards.
SPI booting: tested on SMDK5250 board
---
It depends on the patchset at [1] as it provides the infrastructure to detect the SOC type and revision in spl at runtime.
[1] http://www.mail-archive.com/u-boot at lists.denx.de/msg108301.html
arch/arm/cpu/armv7/exynos/Makefile | 4 ++
.../arm/cpu/armv7/exynos}/spl_boot.c | 33 +++++++----
board/samsung/origen/Makefile | 4 --
board/samsung/origen/mmc_boot.c | 58 -------------------
board/samsung/smdk5250/Makefile | 4 --
board/samsung/smdkv310/Makefile | 4 --
board/samsung/smdkv310/mmc_boot.c | 60 --------------------
include/configs/exynos5250-dt.h | 10 ++--
include/configs/origen.h | 21 +++----
include/configs/smdkv310.h | 21 +++----
10 files changed, 54 insertions(+), 165 deletions(-)
rename {board/samsung/smdk5250 => arch/arm/cpu/armv7/exynos}/spl_boot.c (73%)
delete mode 100644 board/samsung/origen/mmc_boot.c
delete mode 100644 board/samsung/smdkv310/mmc_boot.carch/arm/cpu/armv7/exynos/Makefile +4 -0
@@ -24,6 +24,10 @@ LIB = $(obj)lib$(SOC).o COBJS += clock.o power.o soc.o system.o pinmux.o tzpc_init.o +ifdef CONFIG_SPL_BUILD +COBJS += spl_boot.o +endif + SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))
arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +22 -11
@@ -23,6 +23,8 @@#include <common.h> #include <config.h> +#define OM_STAT (0x1f << 1) +enum boot_mode {BOOT_MODE_MMC =4 ,BOOT_MODE_SERIAL =20 ,
@@ -31,8 +33,6 @@ enum boot_mode { BOOT_MODE_USB, /* Boot using USB download */ }; -typedef u32 (*spi_copy_func_t )(u32 offset,u32 nblock,u32 dst); -/* * Copy U-boot from mmc to RAM: * COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains
@@ -40,26 +40,37 @@ enum boot_mode {*/ void copy_uboot_to_ram (void ) { -spi_copy_func_t spi_copy;enum boot_mode bootmode; -u32 (*copy_bl2)(u32, u32, u32); +u32 (*copy_bl2)(u32, u32, u32) =NULL ; +u32 offset =0 , size =0 ; - bootmode =readl (EXYNOS5_POWER_BASE ) &OM_STAT ; + bootmode =readl (samsung_get_base_power ()) &OM_STAT ;switch (bootmode) { +#ifdef CONFIG_SPI_BOOTING case BOOT_MODE_SERIAL : - spi_copy = *(spi_copy_func_t *)EXYNOS_COPY_SPI_FNPTR_ADDR ; -spi_copy (SPI_FLASH_UBOOT_POS ,CONFIG_BL2_SIZE , -CONFIG_SYS_TEXT_BASE ); + offset =CONFIG_BL2_OFFSET -CONFIG_RES_BLOCK_SIZE ; + size =CONFIG_BL2_SIZE ; + copy_bl2 = (void *) *(u32 *)EXYNOS_COPY_SPI_FNPTR_ADDR ;break ; +#endif case BOOT_MODE_MMC : - copy_bl2 = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR ; -copy_bl2 (BL2_START_OFFSET ,BL2_SIZE_BLOC_COUNT , -CONFIG_SYS_TEXT_BASE ); + offset =CONFIG_BL2_BLOCK_OFFSET ; + size =CONFIG_BL2_SIZE_BLOCK_COUNT ; + +/* Only SMDKv310 EVT0 directly jumps to BootROM copy function */ +if (s5p_get_cpu_rev ()) + copy_bl2 = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR ; +else + copy_bl2 = (void *)COPY_BL2_FNPTR_ADDR ; +break ;default :break ; } + +if (copy_bl2) +copy_bl2 (offset, size,CONFIG_SYS_TEXT_BASE ); }void board_init_f (unsigned long bootflag)
board/samsung/origen/Makefile +0 -4
@@ -31,10 +31,6 @@ ifndef CONFIG_SPL_BUILD COBJS += origen.o endif -ifdef CONFIG_SPL_BUILD -COBJS += mmc_boot.o -endif - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))
board/samsung/origen/mmc_boot.c deleted +0 -58
58 lines not on this page · raw message
board/samsung/smdk5250/Makefile +0 -4
@@ -38,10 +38,6 @@ COBJS += smdk5250.o endif endif -ifdef CONFIG_SPL_BUILD -COBJS += spl_boot.o -endif - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))
board/samsung/smdkv310/Makefile +0 -4
@@ -30,10 +30,6 @@ ifndef CONFIG_SPL_BUILD COBJS += smdkv310.o endif -ifdef CONFIG_SPL_BUILD -COBJS += mmc_boot.o -endif - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))
board/samsung/smdkv310/mmc_boot.c deleted +0 -60
60 lines not on this page · raw message
include/configs/exynos5250-dt.h +6 -4
@@ -206,12 +206,14 @@#define CONFIG_ENV_OFFSET (CONFIG_BL2_OFFSET + CONFIG_BL2_SIZE)/* U-boot copy size from boot Media to DRAM.*/ -#define BL2_START_OFFSET (CONFIG_BL2_OFFSET/512) -#define BL2_SIZE_BLOC_COUNT (CONFIG_BL2_SIZE/512) +#define CONFIG_BL2_BLOCK_OFFSET (CONFIG_BL2_OFFSET/512) +#define CONFIG_BL2_SIZE_BLOCK_COUNT (CONFIG_BL2_SIZE/512) -#define OM_STAT (0x1f << 1) +#define CONFIG_SPI_BOOTING + +#ifdef CONFIG_SPI_BOOTING #define EXYNOS_COPY_SPI_FNPTR_ADDR 0x02020058 -#define SPI_FLASH_UBOOT_POS (CONFIG_SEC_FW_SIZE + CONFIG_BL1_SIZE) +#endif #define CONFIG_DOS_PARTITION
include/configs/origen.h +11 -10
@@ -139,20 +139,21 @@/* MIU (Memory Interleaving Unit) */ #define CONFIG_MIU_2BIT_21_7_INTERLEAVED -#define CONFIG_ENV_IS_IN_MMC 1 -#define CONFIG_SYS_MMC_ENV_DEV 0 -#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ -#define RESERVE_BLOCK_SIZE (512) -#define BL1_SIZE (16 << 10)/*16 K reserved for BL1*/ -#define CONFIG_ENV_OFFSET (RESERVE_BLOCK_SIZE + BL1_SIZE) -#define CONFIG_DOS_PARTITION 1 +#define CONFIG_ENV_IS_IN_MMC 1 +#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ +#define CONFIG_RES_BLOCK_SIZE (512) +#define CONFIG_BL1_SIZE (16 << 10)/*16 K reserved for BL1*/ +#define CONFIG_ENV_OFFSET (CONFIG_RES_BLOCK_SIZE + CONFIG_BL1_SIZE) +#define CONFIG_BL2_OFFSET (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) +#define CONFIG_DOS_PARTITION 1#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - GENERATED_GBL_DATA_SIZE)/* U-boot copy size from boot Media to DRAM.*/ -#define COPY_BL2_SIZE 0x80000 -#define BL2_START_OFFSET ((CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)/512) -#define BL2_SIZE_BLOC_COUNT (COPY_BL2_SIZE/512) +#define CONFIG_BL2_SIZE 0x80000 +#define CONFIG_BL2_BLOCK_OFFSET (CONFIG_BL2_OFFSET/512) +#define CONFIG_BL2_SIZE_BLOCK_COUNT (CONFIG_BL2_SIZE/512)/* Enable devicetree support */ #define CONFIG_OF_LIBFDT
include/configs/smdkv310.h +11 -10
@@ -138,20 +138,21 @@/* MIU (Memory Interleaving Unit) */ #define CONFIG_MIU_2BIT_INTERLEAVED -#define CONFIG_ENV_IS_IN_MMC 1 -#define CONFIG_SYS_MMC_ENV_DEV 0 -#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ -#define RESERVE_BLOCK_SIZE (512) -#define BL1_SIZE (16 << 10)/*16 K reserved for BL1*/ -#define CONFIG_ENV_OFFSET (RESERVE_BLOCK_SIZE + BL1_SIZE) -#define CONFIG_DOS_PARTITION 1 +#define CONFIG_ENV_IS_IN_MMC 1 +#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ +#define CONFIG_RES_BLOCK_SIZE (512) +#define CONFIG_BL1_SIZE (16 << 10)/*16 K reserved for BL1*/ +#define CONFIG_ENV_OFFSET (CONFIG_RES_BLOCK_SIZE + CONFIG_BL1_SIZE) +#define CONFIG_BL2_OFFSET (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) +#define CONFIG_DOS_PARTITION 1#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - GENERATED_GBL_DATA_SIZE)/* U-boot copy size from boot Media to DRAM.*/ -#define COPY_BL2_SIZE 0x80000 -#define BL2_START_OFFSET ((CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)/512) -#define BL2_SIZE_BLOC_COUNT (COPY_BL2_SIZE/512) +#define CONFIG_BL2_SIZE 0x80000 +#define CONFIG_BL2_BLOCK_OFFSET (CONFIG_BL2_OFFSET/512) +#define CONFIG_BL2_SIZE_BLOCK_COUNT (CONFIG_BL2_SIZE/512)/* Ethernet Controllor Driver */ #ifdef CONFIG_CMD_NET
Signature · 1 line
1.7.9.5
PATCH 1/1 spl: exynos: make spl_boot common for all exynos based platforms
Dear Minkyu,
Please let me know if you have any comments for this patch.
With Regards,
Inder
Quoted 396 lines · Inderpal Singh
The
spl_boot.cwhich copies the u-boot from the booting device to ram is made common for all the exynos based platforms. To do so:1. Moved
smdk5250/spl_boot.cto common armv7/exynos folder and updated to make it common for exynos4 and exynos5
2. Introduced aCONFIG_SPL_BOOTINGoption as only exynos5250 supports booting from SPI device
3. Renamed some config options to make them common between exynos5250, origen and smdkv310.SD/MMC booting: tested on exynos4210 based origen, exynos5250 based Arndale and SMDK5250 boards.
SPI booting: tested on SMDK5250 boardSigned-off-by Inderpal Singh <[email protected]>---
It depends on the patchset at [1] as it provides the infrastructure to detect the SOC type and revision in spl at runtime.[1] http://www.mail-archive.com/u-boot at lists.denx.de/msg108301.html
arch/arm/cpu/armv7/exynos/Makefile | 4 ++ .../arm/cpu/armv7/exynos}/spl_boot.c | 33 +++++++---- board/samsung/origen/Makefile | 4 -- board/samsung/origen/mmc_boot.c | 58 ------------------- board/samsung/smdk5250/Makefile | 4 -- board/samsung/smdkv310/Makefile | 4 -- board/samsung/smdkv310/mmc_boot.c | 60 -------------------- include/configs/exynos5250-dt.h | 10 ++-- include/configs/origen.h | 21 +++---- include/configs/smdkv310.h | 21 +++---- 10 files changed, 54 insertions(+), 165 deletions(-) rename {board/samsung/smdk5250 => arch/arm/cpu/armv7/exynos}/spl_boot.c (73%) delete mode 100644 board/samsung/origen/mmc_boot.c delete mode 100644 board/samsung/smdkv310/mmc_boot.carch/arm/cpu/armv7/exynos/Makefile +4
-0@@ -24,6 +24,10 @@ LIB = $(obj)lib$(SOC).o COBJS += clock.o power.o soc.o system.o pinmux.o tzpc_init.o +ifdef CONFIG_SPL_BUILD +COBJS += spl_boot.o +endif + SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +22
-11@@ -23,6 +23,8 @@#include <common.h> #include <config.h> +#define OM_STAT (0x1f << 1) +enum boot_mode {BOOT_MODE_MMC =4 ,BOOT_MODE_SERIAL =20 ,@@ -31,8 +33,6 @@ enum boot_mode { BOOT_MODE_USB, /* Boot using USB download */ }; -typedef u32 (*spi_copy_func_t )(u32 offset,u32 nblock,u32 dst); -/* * Copy U-boot from mmc to RAM: * COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains @@ -40,26 +40,37 @@ enum boot_mode {*/ void copy_uboot_to_ram (void ) { -spi_copy_func_t spi_copy;enum boot_mode bootmode; -u32 (*copy_bl2)(u32, u32, u32); +u32 (*copy_bl2)(u32, u32, u32) =NULL ; +u32 offset =0 , size =0 ; - bootmode =readl (EXYNOS5_POWER_BASE ) &OM_STAT ; + bootmode =readl (samsung_get_base_power ()) &OM_STAT ;switch (bootmode) { +#ifdef CONFIG_SPI_BOOTING case BOOT_MODE_SERIAL : - spi_copy = *(spi_copy_func_t *)EXYNOS_COPY_SPI_FNPTR_ADDR ; -spi_copy (SPI_FLASH_UBOOT_POS ,CONFIG_BL2_SIZE , -CONFIG_SYS_TEXT_BASE ); + offset =CONFIG_BL2_OFFSET -CONFIG_RES_BLOCK_SIZE ; + size =CONFIG_BL2_SIZE ; + copy_bl2 = (void *) *(u32 *)EXYNOS_COPY_SPI_FNPTR_ADDR ;break ; +#endif case BOOT_MODE_MMC : - copy_bl2 = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR ; -copy_bl2 (BL2_START_OFFSET ,BL2_SIZE_BLOC_COUNT , -CONFIG_SYS_TEXT_BASE ); + offset =CONFIG_BL2_BLOCK_OFFSET ; + size =CONFIG_BL2_SIZE_BLOCK_COUNT ; + +/* Only SMDKv310 EVT0 directly jumps to BootROM copy function */ +if (s5p_get_cpu_rev ()) + copy_bl2 = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR ; +else + copy_bl2 = (void *)COPY_BL2_FNPTR_ADDR ; +break ;default :break ; } + +if (copy_bl2) +copy_bl2 (offset, size,CONFIG_SYS_TEXT_BASE ); }void board_init_f (unsigned long bootflag)board/samsung/origen/Makefile +0
-4@@ -31,10 +31,6 @@ ifndef CONFIG_SPL_BUILD COBJS += origen.o endif -ifdef CONFIG_SPL_BUILD -COBJS += mmc_boot.o -endif - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))board/samsung/origen/mmc_boot.c deleted +0
-58@@ -1,58 +0,0 @@ -/* -* Copyright (C) 2011 Samsung Electronics -* -* See file CREDITS for list of people who contributed to this -* project. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, -* MA 02111-1307 USA -*/ - -#include <common.h> -#include <config.h> - -/* -* Copy U-boot from mmc to RAM: -* COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains -* Pointer to API (Data transfer from mmc to ram) -*/ -void copy_uboot_to_ram (void ) -{ -u32 (*copy_bl2)(u32, u32, u32) = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR ; - -copy_bl2 (BL2_START_OFFSET ,BL2_SIZE_BLOC_COUNT ,CONFIG_SYS_TEXT_BASE ); -} - -void board_init_f (unsigned long bootflag) -{ - __attribute__((noreturn))void (*uboot)(void ); -copy_uboot_to_ram (); - -/* Jump to U-Boot image */ - uboot = (void *)CONFIG_SYS_TEXT_BASE ; - (*uboot)(); -/* Never returns Here */ -} - -/* Place Holders */ -void board_init_r (gd_t *id,ulong dest_addr) -{ -/* Function attribute is no-return */ -/* This Function never executes */ -while (1 ) - ; -} - -void save_boot_params (u32 r0,u32 r1,u32 r2,u32 r3) {}board/samsung/smdk5250/Makefile +0
-4@@ -38,10 +38,6 @@ COBJS += smdk5250.o endif endif -ifdef CONFIG_SPL_BUILD -COBJS += spl_boot.o -endif - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))board/samsung/smdkv310/Makefile +0
-4@@ -30,10 +30,6 @@ ifndef CONFIG_SPL_BUILD COBJS += smdkv310.o endif -ifdef CONFIG_SPL_BUILD -COBJS += mmc_boot.o -endif - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))board/samsung/smdkv310/mmc_boot.c deleted +0
-60@@ -1,60 +0,0 @@ -/* -* Copyright (C) 2011 Samsung Electronics -* -* See file CREDITS for list of people who contributed to this -* project. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, -* MA 02111-1307 USA -*/ - -#include <common.h> -#include <config.h> - -/* -* Copy U-boot from mmc to RAM: -* COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains -* API (Data transfer from mmc to ram) -*/ -void copy_uboot_to_ram (void ) -{ -u32 (*copy_bl2)(u32, u32, u32) = (void *)COPY_BL2_FNPTR_ADDR ; - -copy_bl2 (BL2_START_OFFSET ,BL2_SIZE_BLOC_COUNT ,CONFIG_SYS_TEXT_BASE ); -} - -void board_init_f (unsigned long bootflag) -{ - __attribute__((noreturn))void (*uboot)(void ); -copy_uboot_to_ram (); - -/* Jump to U-Boot image */ - uboot = (void *)CONFIG_SYS_TEXT_BASE ; - (*uboot)(); -/* Never returns Here */ -} - -/* Place Holders */ -void board_init_r (gd_t *id,ulong dest_addr) -{ -/*Function attribute is no-return*/ -/*This Function never executes*/ -while (1 ) - ; -} - -void save_boot_params (u32 r0,u32 r1,u32 r2,u32 r3) -{ -}include/configs/exynos5250-dt.h +6
-4@@ -206,12 +206,14 @@#define CONFIG_ENV_OFFSET (CONFIG_BL2_OFFSET + CONFIG_BL2_SIZE)/* U-boot copy size from boot Media to DRAM.*/ -#define BL2_START_OFFSET (CONFIG_BL2_OFFSET/512) -#define BL2_SIZE_BLOC_COUNT (CONFIG_BL2_SIZE/512) +#define CONFIG_BL2_BLOCK_OFFSET (CONFIG_BL2_OFFSET/512) +#define CONFIG_BL2_SIZE_BLOCK_COUNT (CONFIG_BL2_SIZE/512) -#define OM_STAT (0x1f << 1) +#define CONFIG_SPI_BOOTING + +#ifdef CONFIG_SPI_BOOTING #define EXYNOS_COPY_SPI_FNPTR_ADDR 0x02020058 -#define SPI_FLASH_UBOOT_POS (CONFIG_SEC_FW_SIZE + CONFIG_BL1_SIZE) +#endif #define CONFIG_DOS_PARTITION include/configs/origen.h +11
-10@@ -139,20 +139,21 @@/* MIU (Memory Interleaving Unit) */ #define CONFIG_MIU_2BIT_21_7_INTERLEAVED -#define CONFIG_ENV_IS_IN_MMC 1 -#define CONFIG_SYS_MMC_ENV_DEV 0 -#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ -#define RESERVE_BLOCK_SIZE (512) -#define BL1_SIZE (16 << 10)/*16 K reserved for BL1*/ -#define CONFIG_ENV_OFFSET (RESERVE_BLOCK_SIZE + BL1_SIZE) -#define CONFIG_DOS_PARTITION 1 +#define CONFIG_ENV_IS_IN_MMC 1 +#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ +#define CONFIG_RES_BLOCK_SIZE (512) +#define CONFIG_BL1_SIZE (16 << 10)/*16 K reserved for BL1*/ +#define CONFIG_ENV_OFFSET (CONFIG_RES_BLOCK_SIZE + CONFIG_BL1_SIZE) +#define CONFIG_BL2_OFFSET (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) +#define CONFIG_DOS_PARTITION 1#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - GENERATED_GBL_DATA_SIZE)/* U-boot copy size from boot Media to DRAM.*/ -#define COPY_BL2_SIZE 0x80000 -#define BL2_START_OFFSET ((CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)/512) -#define BL2_SIZE_BLOC_COUNT (COPY_BL2_SIZE/512) +#define CONFIG_BL2_SIZE 0x80000 +#define CONFIG_BL2_BLOCK_OFFSET (CONFIG_BL2_OFFSET/512) +#define CONFIG_BL2_SIZE_BLOCK_COUNT (CONFIG_BL2_SIZE/512)/* Enable devicetree support */ #define CONFIG_OF_LIBFDT include/configs/smdkv310.h +11
-11@@ -138,20 +138,21 @@/* MIU (Memory Interleaving Unit) */ #define CONFIG_MIU_2BIT_INTERLEAVED -#define CONFIG_ENV_IS_IN_MMC 1 -#define CONFIG_SYS_MMC_ENV_DEV 0 -#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ -#define RESERVE_BLOCK_SIZE (512) -#define BL1_SIZE (16 << 10)/*16 K reserved for BL1*/ -#define CONFIG_ENV_OFFSET (RESERVE_BLOCK_SIZE + BL1_SIZE) -#define CONFIG_DOS_PARTITION 1 +#define CONFIG_ENV_IS_IN_MMC 1 +#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ +#define CONFIG_RES_BLOCK_SIZE (512) +#define CONFIG_BL1_SIZE (16 << 10)/*16 K reserved for BL1*/ +#define CONFIG_ENV_OFFSET (CONFIG_RES_BLOCK_SIZE + CONFIG_BL1_SIZE) +#define CONFIG_BL2_OFFSET (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) +#define CONFIG_DOS_PARTITION 1#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - GENERATED_GBL_DATA_SIZE)/* U-boot copy size from boot Media to DRAM.*/ -#define COPY_BL2_SIZE 0x80000 -#define BL2_START_OFFSET ((CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)/512) -#define BL2_SIZE_BLOC_COUNT (COPY_BL2_SIZE/512) +#define CONFIG_BL2_SIZE 0x80000 +#define CONFIG_BL2_BLOCK_OFFSET (CONFIG_BL2_OFFSET/512) +#define CONFIG_BL2_SIZE_BLOCK_COUNT (CONFIG_BL2_SIZE/512)/* Ethernet Controllor Driver */ #ifdef CONFIG_CMD_NET --1.7.9.5
PATCH 1/1 spl: exynos: make spl_boot common for all exynos based platforms
Dear Inderpal Singh,
Quoted 43 lines · Inderpal Singh
Dear Minkyu,
Please let me know if you have any comments for this patch.
With Regards,
InderQuoted 35 lines · Inderpal Singh
The
spl_boot.cwhich copies the u-boot from the booting device to ram is made common for all the exynos based platforms. To do so:1. Moved
smdk5250/spl_boot.cto common armv7/exynos folder and updated to make it common for exynos4 and exynos5
2. Introduced aCONFIG_SPL_BOOTINGoption as only exynos5250 supports booting from SPI device
3. Renamed some config options to make them common between exynos5250, origen and smdkv310.SD/MMC booting: tested on exynos4210 based origen, exynos5250 based Arndale and SMDK5250 boards.
SPI booting: tested on SMDK5250 boardSigned-off-by Inderpal Singh <[email protected]>---
It depends on the patchset at [1] as it provides the infrastructure to detect the SOC type and revision in spl at runtime.[1] http://www.mail-archive.com/u-boot at lists.denx.de/msg108301.html
arch/arm/cpu/armv7/exynos/Makefile | 4 ++ .../arm/cpu/armv7/exynos}/spl_boot.c | 33 +++++++---- board/samsung/origen/Makefile | 4 -- board/samsung/origen/mmc_boot.c | 58 ------------------- board/samsung/smdk5250/Makefile | 4 -- board/samsung/smdkv310/Makefile | 4 -- board/samsung/smdkv310/mmc_boot.c | 60 -------------------- include/configs/exynos5250-dt.h | 10 ++-- include/configs/origen.h | 21 +++---- include/configs/smdkv310.h | 21 +++---- 10 files changed, 54 insertions(+), 165 deletions(-) rename {board/samsung/smdk5250 => arch/arm/cpu/armv7/exynos}/spl_boot.c (73%) delete mode 100644 board/samsung/origen/mmc_boot.c delete mode 100644 board/samsung/smdkv310/mmc_boot.c
Since this patch had wait too long on queue, need to rebase. I'm sorry to late review.
Quoted 51 lines
Quoted 51 lines
arch/arm/cpu/armv7/exynos/Makefile +4
-0@@ -24,6 +24,10 @@ LIB = $(obj)lib$(SOC).o COBJS += clock.o power.o soc.o system.o pinmux.o tzpc_init.o +ifdef CONFIG_SPL_BUILD +COBJS += spl_boot.o +endif + SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +4
-4@@ -23,6 +23,8 @@#include <common.h> #include <config.h> +#define OM_STAT (0x1f << 1) +enum boot_mode {BOOT_MODE_MMC =4 ,BOOT_MODE_SERIAL =20 ,@@ -31,8 +33,6 @@ enum boot_mode { BOOT_MODE_USB, /* Boot using USB download */ }; -typedef u32 (*spi_copy_func_t )(u32 offset,u32 nblock,u32 dst); -/* * Copy U-boot from mmc to RAM: * COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains @@ -40,26 +40,37 @@ enum boot_mode {*/ void copy_uboot_to_ram (void ) { -spi_copy_func_t spi_copy;enum boot_mode bootmode; -u32 (*copy_bl2)(u32, u32, u32); +u32 (*copy_bl2)(u32, u32, u32) =NULL ; +u32 offset =0 , size =0 ;
Quoted 5 lines
arch/arm/cpu/armv7/exynos/spl_boot.c enum boot_mode { · line 50
Quoted 5 lines
arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +2
-1- bootmode =readl (EXYNOS5_POWER_BASE ) &OM_STAT ; + bootmode =readl (samsung_get_base_power ()) &OM_STAT ;switch (bootmode) { +#ifdef CONFIG_SPI_BOOTING
Is this ifdef needs?
Quoted 10 lines
Quoted 10 lines
arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +4
-3case BOOT_MODE_SERIAL : - spi_copy = *(spi_copy_func_t *)EXYNOS_COPY_SPI_FNPTR_ADDR ; -spi_copy (SPI_FLASH_UBOOT_POS ,CONFIG_BL2_SIZE , -CONFIG_SYS_TEXT_BASE ); + offset =CONFIG_BL2_OFFSET -CONFIG_RES_BLOCK_SIZE ; + size =CONFIG_BL2_SIZE ; + copy_bl2 = (void *) *(u32 *)EXYNOS_COPY_SPI_FNPTR_ADDR ;break ; +#endif case BOOT_MODE_MMC :
Quoted 8 lines
arch/arm/cpu/armv7/exynos/spl_boot.c enum boot_mode { · line 62
Quoted 8 lines
arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +5
-3- copy_bl2 = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR ; -copy_bl2 (BL2_START_OFFSET ,BL2_SIZE_BLOC_COUNT , -CONFIG_SYS_TEXT_BASE ); + offset =CONFIG_BL2_BLOCK_OFFSET ; + size =CONFIG_BL2_SIZE_BLOCK_COUNT ; + +/* Only SMDKv310 EVT0 directly jumps to BootROM copy function */ +if (s5p_get_cpu_rev ())
According to your comment, you should check cpu_ids.
Quoted 202 lines
Quoted 202 lines
arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +7
-0+ copy_bl2 = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR ; + else + copy_bl2 = (void *)COPY_BL2_FNPTR_ADDR ; +break ;default :break ; } + +if (copy_bl2) +copy_bl2 (offset, size,CONFIG_SYS_TEXT_BASE ); }void board_init_f (unsigned long bootflag)board/samsung/origen/Makefile +0
-4@@ -31,10 +31,6 @@ ifndef CONFIG_SPL_BUILD COBJS += origen.o endif -ifdef CONFIG_SPL_BUILD -COBJS += mmc_boot.o -endif - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))board/samsung/origen/mmc_boot.c deleted +0
-58@@ -1,58 +0,0 @@ -/* -* Copyright (C) 2011 Samsung Electronics -* -* See file CREDITS for list of people who contributed to this -* project. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, -* MA 02111-1307 USA -*/ - -#include <common.h> -#include <config.h> - -/* -* Copy U-boot from mmc to RAM: -* COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains -* Pointer to API (Data transfer from mmc to ram) -*/ -void copy_uboot_to_ram (void ) -{ -u32 (*copy_bl2)(u32, u32, u32) = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR ; - -copy_bl2 (BL2_START_OFFSET ,BL2_SIZE_BLOC_COUNT ,CONFIG_SYS_TEXT_BASE ); -} - -void board_init_f (unsigned long bootflag) -{ - __attribute__((noreturn))void (*uboot)(void ); -copy_uboot_to_ram (); - -/* Jump to U-Boot image */ - uboot = (void *)CONFIG_SYS_TEXT_BASE ; - (*uboot)(); -/* Never returns Here */ -} - -/* Place Holders */ -void board_init_r (gd_t *id,ulong dest_addr) -{ -/* Function attribute is no-return */ -/* This Function never executes */ -while (1 ) - ; -} - -void save_boot_params (u32 r0,u32 r1,u32 r2,u32 r3) {}board/samsung/smdk5250/Makefile +0
-4@@ -38,10 +38,6 @@ COBJS += smdk5250.o endif endif -ifdef CONFIG_SPL_BUILD -COBJS += spl_boot.o -endif - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))board/samsung/smdkv310/Makefile +0
-4@@ -30,10 +30,6 @@ ifndef CONFIG_SPL_BUILD COBJS += smdkv310.o endif -ifdef CONFIG_SPL_BUILD -COBJS += mmc_boot.o -endif - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))board/samsung/smdkv310/mmc_boot.c deleted +0
-60@@ -1,60 +0,0 @@ -/* -* Copyright (C) 2011 Samsung Electronics -* -* See file CREDITS for list of people who contributed to this -* project. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, -* MA 02111-1307 USA -*/ - -#include <common.h> -#include <config.h> - -/* -* Copy U-boot from mmc to RAM: -* COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains -* API (Data transfer from mmc to ram) -*/ -void copy_uboot_to_ram (void ) -{ -u32 (*copy_bl2)(u32, u32, u32) = (void *)COPY_BL2_FNPTR_ADDR ; - -copy_bl2 (BL2_START_OFFSET ,BL2_SIZE_BLOC_COUNT ,CONFIG_SYS_TEXT_BASE ); -} - -void board_init_f (unsigned long bootflag) -{ - __attribute__((noreturn))void (*uboot)(void ); -copy_uboot_to_ram (); - -/* Jump to U-Boot image */ - uboot = (void *)CONFIG_SYS_TEXT_BASE ; - (*uboot)(); -/* Never returns Here */ -} - -/* Place Holders */ -void board_init_r (gd_t *id,ulong dest_addr) -{ -/*Function attribute is no-return*/ -/*This Function never executes*/ -while (1 ) - ; -} - -void save_boot_params (u32 r0,u32 r1,u32 r2,u32 r3) -{ -}include/configs/exynos5250-dt.h +2
-2@@ -206,12 +206,14 @@#define CONFIG_ENV_OFFSET (CONFIG_BL2_OFFSET + CONFIG_BL2_SIZE)/* U-boot copy size from boot Media to DRAM.*/ -#define BL2_START_OFFSET (CONFIG_BL2_OFFSET/512) -#define BL2_SIZE_BLOC_COUNT (CONFIG_BL2_SIZE/512) +#define CONFIG_BL2_BLOCK_OFFSET (CONFIG_BL2_OFFSET/512) +#define CONFIG_BL2_SIZE_BLOCK_COUNT (CONFIG_BL2_SIZE/512)
Quoted 4 lines
include/configs/exynos5250-dt.h line 214
Quoted 4 lines
include/configs/exynos5250-dt.h +3
-1-#define OM_STAT (0x1f << 1) +#define CONFIG_SPI_BOOTING + +#ifdef CONFIG_SPI_BOOTING
I think this ifdef is unnecessary.
You already know that we will use spi booting on this board.
Quoted 76 lines
Quoted 76 lines
include/configs/exynos5250-dt.h +1
-1#define EXYNOS_COPY_SPI_FNPTR_ADDR 0x02020058 -#define SPI_FLASH_UBOOT_POS (CONFIG_SEC_FW_SIZE + CONFIG_BL1_SIZE) +#endif #define CONFIG_DOS_PARTITION include/configs/origen.h +11
-10@@ -139,20 +139,21 @@/* MIU (Memory Interleaving Unit) */ #define CONFIG_MIU_2BIT_21_7_INTERLEAVED -#define CONFIG_ENV_IS_IN_MMC 1 -#define CONFIG_SYS_MMC_ENV_DEV 0 -#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ -#define RESERVE_BLOCK_SIZE (512) -#define BL1_SIZE (16 << 10)/*16 K reserved for BL1*/ -#define CONFIG_ENV_OFFSET (RESERVE_BLOCK_SIZE + BL1_SIZE) -#define CONFIG_DOS_PARTITION 1 +#define CONFIG_ENV_IS_IN_MMC 1 +#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ +#define CONFIG_RES_BLOCK_SIZE (512) +#define CONFIG_BL1_SIZE (16 << 10)/*16 K reserved for BL1*/ +#define CONFIG_ENV_OFFSET (CONFIG_RES_BLOCK_SIZE + CONFIG_BL1_SIZE) +#define CONFIG_BL2_OFFSET (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) +#define CONFIG_DOS_PARTITION 1#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - GENERATED_GBL_DATA_SIZE)/* U-boot copy size from boot Media to DRAM.*/ -#define COPY_BL2_SIZE 0x80000 -#define BL2_START_OFFSET ((CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)/512) -#define BL2_SIZE_BLOC_COUNT (COPY_BL2_SIZE/512) +#define CONFIG_BL2_SIZE 0x80000 +#define CONFIG_BL2_BLOCK_OFFSET (CONFIG_BL2_OFFSET/512) +#define CONFIG_BL2_SIZE_BLOCK_COUNT (CONFIG_BL2_SIZE/512)/* Enable devicetree support */ #define CONFIG_OF_LIBFDT include/configs/smdkv310.h +11
-10@@ -138,20 +138,21 @@/* MIU (Memory Interleaving Unit) */ #define CONFIG_MIU_2BIT_INTERLEAVED -#define CONFIG_ENV_IS_IN_MMC 1 -#define CONFIG_SYS_MMC_ENV_DEV 0 -#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ -#define RESERVE_BLOCK_SIZE (512) -#define BL1_SIZE (16 << 10)/*16 K reserved for BL1*/ -#define CONFIG_ENV_OFFSET (RESERVE_BLOCK_SIZE + BL1_SIZE) -#define CONFIG_DOS_PARTITION 1 +#define CONFIG_ENV_IS_IN_MMC 1 +#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ +#define CONFIG_RES_BLOCK_SIZE (512) +#define CONFIG_BL1_SIZE (16 << 10)/*16 K reserved for BL1*/ +#define CONFIG_ENV_OFFSET (CONFIG_RES_BLOCK_SIZE + CONFIG_BL1_SIZE) +#define CONFIG_BL2_OFFSET (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) +#define CONFIG_DOS_PARTITION 1#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - GENERATED_GBL_DATA_SIZE)/* U-boot copy size from boot Media to DRAM.*/ -#define COPY_BL2_SIZE 0x80000 -#define BL2_START_OFFSET ((CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)/512) -#define BL2_SIZE_BLOC_COUNT (COPY_BL2_SIZE/512) +#define CONFIG_BL2_SIZE 0x80000 +#define CONFIG_BL2_BLOCK_OFFSET (CONFIG_BL2_OFFSET/512) +#define CONFIG_BL2_SIZE_BLOCK_COUNT (CONFIG_BL2_SIZE/512)
Quoted 6 lines
Quoted 5 lines
include/configs/smdkv310.h +0
-1/* Ethernet Controllor Driver */ #ifdef CONFIG_CMD_NET --1.7.9.5
This patch needs to test.
Please help to test this patch and let me know.
Thanks,
Minkyu Kang.
PATCH 1/1 spl: exynos: make spl_boot common for all exynos based platforms
Dear Minkyu Kang,
Thanks for the review.
Quoted 108 lines · Minkyu Kang
Dear Inderpal Singh,
Quoted 8 lines · Inderpal Singh
Dear Minkyu,
Please let me know if you have any comments for this patch.
With Regards,
InderOn 16 March 2013 14:16, Inderpal Singh <[email protected]>
Quoted 11 lines · wrote:
Quoted 11 lines
The
spl_boot.cwhich copies the u-boot from the booting device to ram is made common for all the exynos based platforms. To do so:1. Moved
smdk5250/spl_boot.cto common armv7/exynos folder and updated to make it common for exynos4 and exynos5
2. Introduced aCONFIG_SPL_BOOTINGoption as only exynos5250 supports booting from SPI device
3. Renamed some config options to make them common between exynos5250, origen and smdkv310.SD/MMC booting: tested on exynos4210 based origen, exynos5250 based
Arndale
Quoted 8 lines
Quoted 8 lines
and SMDK5250 boards.
SPI booting: tested on SMDK5250 boardSigned-off-by Inderpal Singh <[email protected]>---
It depends on the patchset at [1] as it provides the infrastructure to detect the SOC type and revision in spl at runtime.Quoted 6 lines
Quoted 6 lines
[1] http://www.mail-archive.com/u-boot at lists.denx.de/msg108301.html
arch/arm/cpu/armv7/exynos/Makefile | 4 ++ .../arm/cpu/armv7/exynos}/spl_boot.c | 33 +++++++---- board/samsung/origen/Makefile | 4 -- board/samsung/origen/mmc_boot.c | 58-------------------
Quoted 3 lines
Quoted 3 lines
board/samsung/smdk5250/Makefile | 4 -- board/samsung/smdkv310/Makefile | 4 -- board/samsung/smdkv310/mmc_boot.c | 60--------------------
Quoted 5 lines
Quoted 5 lines
include/configs/exynos5250-dt.h | 10 ++-- include/configs/origen.h | 21 +++---- include/configs/smdkv310.h | 21 +++---- 10 files changed, 54 insertions(+), 165 deletions(-) rename {board/samsung/smdk5250 =>
arch/arm/cpu/armv7/exynos}/spl_boot.c(73%)Quoted 2 lines
Quoted 2 lines
delete mode 100644 board/samsung/origen/mmc_boot.c delete mode 100644 board/samsung/smdkv310/mmc_boot.cSince this patch had wait too long on queue, need to rebase. I'm sorry to late review.
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +0
-0b/arch/arm/cpu/armv7/exynos/Makefile
Quoted 7 lines
Quoted 7 lines
index b9cf921..c507608 100644
arch/arm/cpu/armv7/exynos/Makefile +0
-0@@ -24,6 +24,10 @@ LIB = $(obj)lib$(SOC).o COBJS += clock.o power.o soc.o system.o pinmux.o tzpc_init.oQuoted 8 lines
Review
Quoted 8 lines
arch/arm/cpu/armv7/exynos/Makefile +4
-0+ifdef CONFIG_SPL_BUILD +COBJS += spl_boot.o +endif + SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))(quoted diff) +0
-0
b/arch/arm/cpu/armv7/exynos/spl_boot.cQuoted 34 lines
Quoted 34 lines
similarity index 73%
rename fromboard/samsung/smdk5250/spl_boot.c
rename toarch/arm/cpu/armv7/exynos/spl_boot.c
index d8f3c1e..e970ff6 100644arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +4
-4@@ -23,6 +23,8 @@#include <common.h> #include <config.h> +#define OM_STAT (0x1f << 1) +enum boot_mode {BOOT_MODE_MMC =4 ,BOOT_MODE_SERIAL =20 ,@@ -31,8 +33,6 @@ enum boot_mode { BOOT_MODE_USB, /* Boot using USB download */ }; -typedef u32 (*spi_copy_func_t )(u32 offset,u32 nblock,u32 dst); -/* * Copy U-boot from mmc to RAM: * COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains @@ -40,26 +40,37 @@ enum boot_mode {*/ void copy_uboot_to_ram (void ) { -spi_copy_func_t spi_copy;enum boot_mode bootmode; -u32 (*copy_bl2)(u32, u32, u32); +u32 (*copy_bl2)(u32, u32, u32) =NULL ; +u32 offset =0 , size =0 ;
Quoted 8 lines
Quoted 5 lines
arch/arm/cpu/armv7/exynos/spl_boot.c enum boot_mode { · line 50
Quoted 5 lines
arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +2
-1- bootmode =readl (EXYNOS5_POWER_BASE ) &OM_STAT ; + bootmode =readl (samsung_get_base_power ()) &OM_STAT ;switch (bootmode) { +#ifdef CONFIG_SPI_BOOTING Is this ifdef needs?
I introduced this ifdef because only exynos5250 has EXYNOS_COPY_SPI_FNPTR_ADDR defined.
If i don't use this ifdef, It won't compile for origen, smdkv310 etc.
Quoted 19 lines
Quoted 2 lines
arch/arm/cpu/armv7/exynos/spl_boot.c enum boot_mode { · line 51
Quoted 2 lines
arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +0
-1case BOOT_MODE_SERIAL : - spi_copy = *(spi_copy_func_t*)EXYNOS_COPY_SPI_FNPTR_ADDR;
Quoted 7 lines
Quoted 7 lines
arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +4
-2-spi_copy (SPI_FLASH_UBOOT_POS ,CONFIG_BL2_SIZE , -CONFIG_SYS_TEXT_BASE ); + offset =CONFIG_BL2_OFFSET -CONFIG_RES_BLOCK_SIZE ; + size =CONFIG_BL2_SIZE ; + copy_bl2 = (void *) *(u32 *)EXYNOS_COPY_SPI_FNPTR_ADDR ;break ; +#endif Quoted 8 lines
arch/arm/cpu/armv7/exynos/spl_boot.c enum boot_mode {
Quoted 8 lines
arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +4
-3case BOOT_MODE_MMC : - copy_bl2 = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR ; -copy_bl2 (BL2_START_OFFSET ,BL2_SIZE_BLOC_COUNT , -CONFIG_SYS_TEXT_BASE ); + offset =CONFIG_BL2_BLOCK_OFFSET ; + size =CONFIG_BL2_SIZE_BLOCK_COUNT ; + +/* Only SMDKv310 EVT0 directly jumps to BootROM copy function */
Quoted 4 lines
Quoted 1 line
arch/arm/cpu/armv7/exynos/spl_boot.c enum boot_mode { · line 62
Quoted 1 line
arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +1
-0+if (s5p_get_cpu_rev ())According to your comment, you should check
cpu_ids.
The s5p_cpu_rev is being set to zero only for Exynos4210 EVT0, hence I thought only revision check is sufficient.
That's, perhaps, not very clear. I will change it to check both cpuid as well as cpu_rev.
Quoted 212 lines
Quoted 14 lines
Quoted 14 lines
arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +7
-0+ copy_bl2 = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR ; + else + copy_bl2 = (void *)COPY_BL2_FNPTR_ADDR ; +break ;default :break ; } + +if (copy_bl2) +copy_bl2 (offset, size,CONFIG_SYS_TEXT_BASE ); }Quoted 2 lines
Review
Quoted 2 lines
arch/arm/cpu/armv7/exynos/spl_boot.c renamed from board/samsung/smdk5250/spl_boot.c +0
-0void board_init_f (unsigned long bootflag)(quoted diff) +0
-0b/board/samsung/origen/Makefile
Quoted 7 lines
Quoted 7 lines
index 3a885a5..6133b26 100644
board/samsung/origen/Makefile +0
-0@@ -31,10 +31,6 @@ ifndef CONFIG_SPL_BUILD COBJS += origen.o endifQuoted 8 lines
Review
Quoted 8 lines
board/samsung/origen/Makefile +0
-4-ifdef CONFIG_SPL_BUILD -COBJS += mmc_boot.o -endif - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))(quoted diff) +0
-0
b/board/samsung/origen/mmc_boot.cQuoted 30 lines
Quoted 30 lines
deleted file mode 100644
index 072f161..0000000board/samsung/origen/mmc_boot.c deleted +0
-25@@ -1,58 +0,0 @@ -/* -* Copyright (C) 2011 Samsung Electronics -* -* See file CREDITS for list of people who contributed to this -* project. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, -* MA 02111-1307 USA -*/ - -#include <common.h> -#include <config.h> -Quoted 8 lines
board/samsung/origen/mmc_boot.c
Quoted 8 lines
board/samsung/origen/mmc_boot.c deleted +0
-8-/* -* Copy U-boot from mmc to RAM: -* COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains -* Pointer to API (Data transfer from mmc to ram) -*/ -void copy_uboot_to_ram (void ) -{ - u32 (*copy_bl2)(u32, u32, u32) = (void *) *(u32*)COPY_BL2_FNPTR_ADDR;
Quoted 2 lines
board/samsung/origen/mmc_boot.c line 35
Quoted 2 lines
board/samsung/origen/mmc_boot.c deleted +0
-2- - copy_bl2(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT,
CONFIG_SYS_TEXT_BASE);Quoted 16 lines
Quoted 16 lines
board/samsung/origen/mmc_boot.c deleted +0
-16-} - -void board_init_f (unsigned long bootflag) -{ - __attribute__((noreturn))void (*uboot)(void ); -copy_uboot_to_ram (); - -/* Jump to U-Boot image */ - uboot = (void *)CONFIG_SYS_TEXT_BASE ; - (*uboot)(); -/* Never returns Here */ -} - -/* Place Holders */ -void board_init_r (gd_t *id,ulong dest_addr) -{Quoted 8 lines
Review
Quoted 8 lines
board/samsung/origen/mmc_boot.c deleted +0
-7-/* Function attribute is no-return */ -/* This Function never executes */ -while (1 ) - ; -} - -void save_boot_params (u32 r0,u32 r1,u32 r2,u32 r3) {}(quoted diff) +0
-0b/board/samsung/smdk5250/Makefile
Quoted 7 lines
Quoted 7 lines
index f2c32ee..075b1a7 100644
board/samsung/smdk5250/Makefile +0
-0@@ -38,10 +38,6 @@ COBJS += smdk5250.o endif endifQuoted 8 lines
Review
Quoted 8 lines
board/samsung/smdk5250/Makefile +0
-4-ifdef CONFIG_SPL_BUILD -COBJS += spl_boot.o -endif - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))(quoted diff) +0
-0b/board/samsung/smdkv310/Makefile
Quoted 7 lines
Quoted 7 lines
index 56e0c16..e79045d 100644
board/samsung/smdkv310/Makefile +0
-0@@ -30,10 +30,6 @@ ifndef CONFIG_SPL_BUILD COBJS += smdkv310.o endifQuoted 8 lines
Review
Quoted 8 lines
board/samsung/smdkv310/Makefile +0
-4-ifdef CONFIG_SPL_BUILD -COBJS += mmc_boot.o -endif - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))(quoted diff) +0
-0
b/board/samsung/smdkv310/mmc_boot.cQuoted 32 lines
Quoted 32 lines
deleted file mode 100644
index d3fc18d..0000000board/samsung/smdkv310/mmc_boot.c deleted +0
-27@@ -1,60 +0,0 @@ -/* -* Copyright (C) 2011 Samsung Electronics -* -* See file CREDITS for list of people who contributed to this -* project. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, -* MA 02111-1307 USA -*/ - -#include <common.h> -#include <config.h> - -/* -* Copy U-boot from mmc to RAM: Quoted 8 lines
board/samsung/smdkv310/mmc_boot.c
Quoted 8 lines
board/samsung/smdkv310/mmc_boot.c deleted +0
-8-* COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains -* API (Data transfer from mmc to ram) -*/ -void copy_uboot_to_ram (void ) -{ -u32 (*copy_bl2)(u32, u32, u32) = (void *)COPY_BL2_FNPTR_ADDR ; - - copy_bl2(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT,
CONFIG_SYS_TEXT_BASE);Quoted 18 lines
Quoted 18 lines
board/samsung/smdkv310/mmc_boot.c deleted +0
-18-} - -void board_init_f (unsigned long bootflag) -{ - __attribute__((noreturn))void (*uboot)(void ); -copy_uboot_to_ram (); - -/* Jump to U-Boot image */ - uboot = (void *)CONFIG_SYS_TEXT_BASE ; - (*uboot)(); -/* Never returns Here */ -} - -/* Place Holders */ -void board_init_r (gd_t *id,ulong dest_addr) -{ -/*Function attribute is no-return*/ -/*This Function never executes*/ Quoted 8 lines
Review
Quoted 8 lines
board/samsung/smdkv310/mmc_boot.c deleted +0
-7-while (1 ) - ; -} - -void save_boot_params (u32 r0,u32 r1,u32 r2,u32 r3) -{ -}(quoted diff) +0
-0
b/include/configs/exynos5250-dt.hQuoted 12 lines
Quoted 12 lines
index 16d3ab1..7308522 100644
include/configs/exynos5250-dt.h +2
-2@@ -206,12 +206,14 @@#define CONFIG_ENV_OFFSET (CONFIG_BL2_OFFSET + CONFIG_BL2_SIZE)/* U-boot copy size from boot Media to DRAM.*/ -#define BL2_START_OFFSET (CONFIG_BL2_OFFSET/512) -#define BL2_SIZE_BLOC_COUNT (CONFIG_BL2_SIZE/512) +#define CONFIG_BL2_BLOCK_OFFSET (CONFIG_BL2_OFFSET/512) +#define CONFIG_BL2_SIZE_BLOCK_COUNT (CONFIG_BL2_SIZE/512)
Quoted 8 lines
Quoted 4 lines
include/configs/exynos5250-dt.h line 214
Quoted 4 lines
include/configs/exynos5250-dt.h +3
-1-#define OM_STAT (0x1f << 1) +#define CONFIG_SPI_BOOTING + +#ifdef CONFIG_SPI_BOOTING I think this ifdef is unnecessary.
You already know that we will use spi booting on this board.
As this is consolidation patch, I introduced this to solve the compilation issue for other boards as mentioned above.
Now, the USB download boot mode is also supported on exynos5250 and it has one more EXYNOS_COPY_USB_FNPTR_ADDR. The other boards won't have this as well.
Let me know your thinking about handling this issue for spl_boot.c consolidation.
With Regards,
Inder
Quoted 103 lines
Quoted 3 lines
include/configs/exynos5250-dt.h line 214
Quoted 3 lines
include/configs/exynos5250-dt.h +0
-1#define EXYNOS_COPY_SPI_FNPTR_ADDR 0x02020058 -#define SPI_FLASH_UBOOT_POS (CONFIG_SEC_FW_SIZE +
CONFIG_BL1_SIZE)Quoted 12 lines
Quoted 12 lines
include/configs/exynos5250-dt.h +1
-0+#endif #define CONFIG_DOS_PARTITION include/configs/origen.h +0
-0@@ -139,20 +139,21 @@/* MIU (Memory Interleaving Unit) */ #define CONFIG_MIU_2BIT_21_7_INTERLEAVED Quoted 3 lines
include/configs/origen.h
Quoted 3 lines
include/configs/origen.h +0
-3-#define CONFIG_ENV_IS_IN_MMC 1 -#define CONFIG_SYS_MMC_ENV_DEV 0 -#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */
Quoted 2 lines
include/configs/origen.h line 146
Quoted 2 lines
include/configs/origen.h +0
-2-#define RESERVE_BLOCK_SIZE (512) -#define BL1_SIZE (16 << 10)/*16 K reserved for BL1*/
Quoted 7 lines
include/configs/origen.h
Quoted 7 lines
include/configs/origen.h +5
-2-#define CONFIG_ENV_OFFSET (RESERVE_BLOCK_SIZE + BL1_SIZE) -#define CONFIG_DOS_PARTITION 1 +#define CONFIG_ENV_IS_IN_MMC 1 +#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ +#define CONFIG_RES_BLOCK_SIZE (512) +#define CONFIG_BL1_SIZE (16 << 10)/*16 K reserved for BL1*/
Quoted 1 line
include/configs/origen.h line 147
Quoted 1 line
include/configs/origen.h +1
-0+#define CONFIG_ENV_OFFSET (CONFIG_RES_BLOCK_SIZE +
CONFIG_BL1_SIZE)Quoted 4 lines
include/configs/origen.h
Quoted 4 lines
include/configs/origen.h +2
-0+#define CONFIG_BL2_OFFSET (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) +#define CONFIG_DOS_PARTITION 1#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR -
GENERATED_GBL_DATA_SIZE)Quoted 4 lines
include/configs/origen.h
Quoted 4 lines
include/configs/origen.h +0
-2/* U-boot copy size from boot Media to DRAM.*/ -#define COPY_BL2_SIZE 0x80000 -#define BL2_START_OFFSET ((CONFIG_ENV_OFFSET +CONFIG_ENV_SIZE)/512)
Quoted 15 lines
Quoted 15 lines
include/configs/origen.h +3
-1-#define BL2_SIZE_BLOC_COUNT (COPY_BL2_SIZE/512) +#define CONFIG_BL2_SIZE 0x80000 +#define CONFIG_BL2_BLOCK_OFFSET (CONFIG_BL2_OFFSET/512) +#define CONFIG_BL2_SIZE_BLOCK_COUNT (CONFIG_BL2_SIZE/512)/* Enable devicetree support */ #define CONFIG_OF_LIBFDT include/configs/smdkv310.h +0
-0@@ -138,20 +138,21 @@/* MIU (Memory Interleaving Unit) */ #define CONFIG_MIU_2BIT_INTERLEAVED Quoted 3 lines
include/configs/smdkv310.h line 143
Quoted 3 lines
include/configs/smdkv310.h +0
-3-#define CONFIG_ENV_IS_IN_MMC 1 -#define CONFIG_SYS_MMC_ENV_DEV 0 -#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */
Quoted 2 lines
include/configs/smdkv310.h line 145
Quoted 2 lines
include/configs/smdkv310.h +0
-2-#define RESERVE_BLOCK_SIZE (512) -#define BL1_SIZE (16 << 10)/*16 K reserved for BL1*/
Quoted 7 lines
include/configs/smdkv310.h line 145
Quoted 7 lines
include/configs/smdkv310.h +5
-2-#define CONFIG_ENV_OFFSET (RESERVE_BLOCK_SIZE + BL1_SIZE) -#define CONFIG_DOS_PARTITION 1 +#define CONFIG_ENV_IS_IN_MMC 1 +#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_ENV_SIZE (16 << 10)/* 16 KB */ +#define CONFIG_RES_BLOCK_SIZE (512) +#define CONFIG_BL1_SIZE (16 << 10)/*16 K reserved for BL1*/
Quoted 1 line
include/configs/smdkv310.h line 146
Quoted 1 line
include/configs/smdkv310.h +1
-0+#define CONFIG_ENV_OFFSET (CONFIG_RES_BLOCK_SIZE +
CONFIG_BL1_SIZE)Quoted 4 lines
include/configs/smdkv310.h line 150
Quoted 4 lines
include/configs/smdkv310.h +2
-0+#define CONFIG_BL2_OFFSET (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) +#define CONFIG_DOS_PARTITION 1#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR -
GENERATED_GBL_DATA_SIZE)Quoted 4 lines
include/configs/smdkv310.h line 152
Quoted 4 lines
include/configs/smdkv310.h +0
-2/* U-boot copy size from boot Media to DRAM.*/ -#define COPY_BL2_SIZE 0x80000 -#define BL2_START_OFFSET ((CONFIG_ENV_OFFSET +CONFIG_ENV_SIZE)/512)
Quoted 11 lines
Quoted 10 lines
include/configs/smdkv310.h +3
-2-#define BL2_SIZE_BLOC_COUNT (COPY_BL2_SIZE/512) +#define CONFIG_BL2_SIZE 0x80000 +#define CONFIG_BL2_BLOCK_OFFSET (CONFIG_BL2_OFFSET/512) +#define CONFIG_BL2_SIZE_BLOCK_COUNT (CONFIG_BL2_SIZE/512)/* Ethernet Controllor Driver */ #ifdef CONFIG_CMD_NET --1.7.9.5
This patch needs to test.
Please help to test this patch and let me know.Thanks,
Minkyu Kang.
PATCH 1/1 spl: exynos: make spl_boot common for all exynos based platforms
In reply to Inderpal SinghQuoted 1 line
[1] http://www.mail-archive.com/u-boot <at> lists.denx.de/msg108301.html
This gives 404 not found...