diff mbox

[U-Boot,v2] spl: consolidate arch/arm/include/asm/arch-*/spl.h

Message ID 1398255643-2192-1-git-send-email-yamada.m@jp.panasonic.com
State Accepted
Delegated to: Stefano Babic
Headers show

Commit Message

Masahiro Yamada April 23, 2014, 12:20 p.m. UTC
arch/arm/include/asm/spl.h requires all SoCs to have
arch/arm/include/asm/arch-*/spl.h.

But many of them just define BOOT_DEVICE_* macros.

Those macros are used in the "switch (boot_device) { ... }"
statement in common/spl/spl.c.

So they should not be archtecture specific, but be described as
a simpile enumeration.

This commit merges most of arch/arm/include/asm/arch-*/spl.h
into arch/arm/include/asm/spl.h.

With a little more effort, arch-zynq/spl.h and arch-socfpga/spl.h
will be merged, while I am not sure about OMAP and Exynos.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Tom Warren <twarren@nvidia.com>
CC: Stefano Babic <sbabic@denx.de>
CC: Minkyu Kang <mk7.kang@samsung.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
Acked-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stefano Babic <sbabic@denx.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Tim Harvey <tharvey@gateworks.com>
Tested-by: Bo Shen <voice.shen@atmel.com> [on sama5d3xek board for at91 part]
---

Changes in v2:
  - Add BOOT_DEVICE_SATA (request from Tim Harvey)
  - Add "|| defined(CONFIG_EXYNOS4210)"
    Most exynos boards define CONFIG_EXYNOS4 or CONFIG_EXYNOS5.
    But there is one exception: smdkv310.
    This board defines neither CONFIG_EXYNOS4 nor CONFIG_EXYNOS5.
    For this board, "if defined(CONFIG_EXYNOS4210)" should be checked.

 arch/arm/cpu/arm720t/tegra-common/spl.c  |  2 +-
 arch/arm/include/asm/arch-at91/spl.h     | 24 ------------------------
 arch/arm/include/asm/arch-davinci/spl.h  | 16 ----------------
 arch/arm/include/asm/arch-mx35/spl.h     | 22 ----------------------
 arch/arm/include/asm/arch-mx5/spl.h      | 13 -------------
 arch/arm/include/asm/arch-tegra114/spl.h | 22 ----------------------
 arch/arm/include/asm/arch-tegra124/spl.h | 13 -------------
 arch/arm/include/asm/arch-tegra20/spl.h  | 12 ------------
 arch/arm/include/asm/arch-tegra30/spl.h  | 12 ------------
 arch/arm/include/asm/spl.h               | 20 ++++++++++++++++++++
 board/denx/m53evk/m53evk.c               |  2 +-
 11 files changed, 22 insertions(+), 136 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-at91/spl.h
 delete mode 100644 arch/arm/include/asm/arch-davinci/spl.h
 delete mode 100644 arch/arm/include/asm/arch-mx35/spl.h
 delete mode 100644 arch/arm/include/asm/arch-mx5/spl.h
 delete mode 100644 arch/arm/include/asm/arch-tegra114/spl.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/spl.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/spl.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/spl.h

Comments

Stephen Warren April 23, 2014, 4:16 p.m. UTC | #1
On 04/23/2014 06:20 AM, Masahiro Yamada wrote:
> arch/arm/include/asm/spl.h requires all SoCs to have
> arch/arm/include/asm/arch-*/spl.h.
> 
> But many of them just define BOOT_DEVICE_* macros.
> 
> Those macros are used in the "switch (boot_device) { ... }"
> statement in common/spl/spl.c.
> 
> So they should not be archtecture specific, but be described as
> a simpile enumeration.
> 
> This commit merges most of arch/arm/include/asm/arch-*/spl.h
> into arch/arm/include/asm/spl.h.
> 
> With a little more effort, arch-zynq/spl.h and arch-socfpga/spl.h
> will be merged, while I am not sure about OMAP and Exynos.

Acked-by: Stephen Warren <swarren@nvidia.com>
(Not that I'm the Tegra maintainer)
Stefano Babic May 28, 2014, 3:17 p.m. UTC | #2
On 23/04/2014 14:20, Masahiro Yamada wrote:
> arch/arm/include/asm/spl.h requires all SoCs to have
> arch/arm/include/asm/arch-*/spl.h.
> 
> But many of them just define BOOT_DEVICE_* macros.
> 
> Those macros are used in the "switch (boot_device) { ... }"
> statement in common/spl/spl.c.
> 
> So they should not be archtecture specific, but be described as
> a simpile enumeration.
> 
> This commit merges most of arch/arm/include/asm/arch-*/spl.h
> into arch/arm/include/asm/spl.h.
> 
> With a little more effort, arch-zynq/spl.h and arch-socfpga/spl.h
> will be merged, while I am not sure about OMAP and Exynos.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Tom Rini <trini@ti.com>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: Andreas Bießmann <andreas.devel@googlemail.com>
> Cc: Stephen Warren <swarren@nvidia.com>
> Cc: Tom Warren <twarren@nvidia.com>
> CC: Stefano Babic <sbabic@denx.de>
> CC: Minkyu Kang <mk7.kang@samsung.com>
> Cc: Dinh Nguyen <dinguyen@altera.com>
> Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
> Acked-by: Michal Simek <monstr@monstr.eu>
> Acked-by: Stefano Babic <sbabic@denx.de>
> Acked-by: Stephen Warren <swarren@nvidia.com>
> Acked-by: Tim Harvey <tharvey@gateworks.com>
> Tested-by: Bo Shen <voice.shen@atmel.com> [on sama5d3xek board for at91 part]
> ---

Tested-by: Stefano Babic <sbabic@denx.de> [applying Tim's i.MX6 patches]

Tom, what about this patch ? Tim's patchset for SPL on i.MX6 depends on
this. Is it appliable ?

Stefano
Tom Rini June 5, 2014, 6:14 p.m. UTC | #3
On Wed, May 28, 2014 at 05:17:33PM +0200, Stefano Babic wrote:
> On 23/04/2014 14:20, Masahiro Yamada wrote:
> > arch/arm/include/asm/spl.h requires all SoCs to have
> > arch/arm/include/asm/arch-*/spl.h.
> > 
> > But many of them just define BOOT_DEVICE_* macros.
> > 
> > Those macros are used in the "switch (boot_device) { ... }"
> > statement in common/spl/spl.c.
> > 
> > So they should not be archtecture specific, but be described as
> > a simpile enumeration.
> > 
> > This commit merges most of arch/arm/include/asm/arch-*/spl.h
> > into arch/arm/include/asm/spl.h.
> > 
> > With a little more effort, arch-zynq/spl.h and arch-socfpga/spl.h
> > will be merged, while I am not sure about OMAP and Exynos.
> > 
> > Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> > Cc: Tom Rini <trini@ti.com>
> > Cc: Michal Simek <michal.simek@xilinx.com>
> > Cc: Andreas Bießmann <andreas.devel@googlemail.com>
> > Cc: Stephen Warren <swarren@nvidia.com>
> > Cc: Tom Warren <twarren@nvidia.com>
> > CC: Stefano Babic <sbabic@denx.de>
> > CC: Minkyu Kang <mk7.kang@samsung.com>
> > Cc: Dinh Nguyen <dinguyen@altera.com>
> > Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
> > Acked-by: Michal Simek <monstr@monstr.eu>
> > Acked-by: Stefano Babic <sbabic@denx.de>
> > Acked-by: Stephen Warren <swarren@nvidia.com>
> > Acked-by: Tim Harvey <tharvey@gateworks.com>
> > Tested-by: Bo Shen <voice.shen@atmel.com> [on sama5d3xek board for at91 part]
> > ---
> 
> Tested-by: Stefano Babic <sbabic@denx.de> [applying Tim's i.MX6 patches]
> 
> Tom, what about this patch ? Tim's patchset for SPL on i.MX6 depends on
> this. Is it appliable ?

Acked-by: Tom Rini <trini@ti.com>

Go ahead and bring it in via the imx tree.
Stefano Babic June 6, 2014, 8:09 a.m. UTC | #4
Hi Masahiro,

On 23/04/2014 14:20, Masahiro Yamada wrote:
> arch/arm/include/asm/spl.h requires all SoCs to have
> arch/arm/include/asm/arch-*/spl.h.
> 
> But many of them just define BOOT_DEVICE_* macros.
> 
> Those macros are used in the "switch (boot_device) { ... }"
> statement in common/spl/spl.c.
> 
> So they should not be archtecture specific, but be described as
> a simpile enumeration.
> 
> This commit merges most of arch/arm/include/asm/arch-*/spl.h
> into arch/arm/include/asm/spl.h.
> 
> With a little more effort, arch-zynq/spl.h and arch-socfpga/spl.h
> will be merged, while I am not sure about OMAP and Exynos.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Tom Rini <trini@ti.com>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: Andreas Bießmann <andreas.devel@googlemail.com>
> Cc: Stephen Warren <swarren@nvidia.com>
> Cc: Tom Warren <twarren@nvidia.com>
> CC: Stefano Babic <sbabic@denx.de>
> CC: Minkyu Kang <mk7.kang@samsung.com>
> Cc: Dinh Nguyen <dinguyen@altera.com>
> Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
> Acked-by: Michal Simek <monstr@monstr.eu>
> Acked-by: Stefano Babic <sbabic@denx.de>
> Acked-by: Stephen Warren <swarren@nvidia.com>
> Acked-by: Tim Harvey <tharvey@gateworks.com>
> Tested-by: Bo Shen <voice.shen@atmel.com> [on sama5d3xek board for at91 part]
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/arch/arm/cpu/arm720t/tegra-common/spl.c b/arch/arm/cpu/arm720t/tegra-common/spl.c
index 5171a8f..8147806 100644
--- a/arch/arm/cpu/arm720t/tegra-common/spl.c
+++ b/arch/arm/cpu/arm720t/tegra-common/spl.c
@@ -14,7 +14,7 @@ 
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/board.h>
-#include <asm/arch/spl.h>
+#include <asm/spl.h>
 #include "cpu.h"
 
 void spl_board_init(void)
diff --git a/arch/arm/include/asm/arch-at91/spl.h b/arch/arm/include/asm/arch-at91/spl.h
deleted file mode 100644
index d8a87da..0000000
--- a/arch/arm/include/asm/arch-at91/spl.h
+++ /dev/null
@@ -1,24 +0,0 @@ 
-/*
- * Copyright (C) 2013 Atmel Corporation
- *		      Bo Shen <voice.shen@atmel.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#ifndef	_ASM_ARCH_SPL_H_
-#define	_ASM_ARCH_SPL_H_
-
-enum {
-	BOOT_DEVICE_NONE,
-#ifdef CONFIG_SYS_USE_MMC
-	BOOT_DEVICE_MMC1,
-	BOOT_DEVICE_MMC2,
-	BOOT_DEVICE_MMC2_2,
-#elif CONFIG_SYS_USE_NANDFLASH
-	BOOT_DEVICE_NAND,
-#elif CONFIG_SYS_USE_SERIALFLASH
-	BOOT_DEVICE_SPI,
-#endif
-};
-
-#endif
diff --git a/arch/arm/include/asm/arch-davinci/spl.h b/arch/arm/include/asm/arch-davinci/spl.h
deleted file mode 100644
index 5afe0d4..0000000
--- a/arch/arm/include/asm/arch-davinci/spl.h
+++ /dev/null
@@ -1,16 +0,0 @@ 
-/*
- * (C) Copyright 2012
- * Texas Instruments, <www.ti.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-#ifndef	_ASM_ARCH_SPL_H_
-#define	_ASM_ARCH_SPL_H_
-
-#define BOOT_DEVICE_NAND	1
-#define BOOT_DEVICE_SPI		2
-#define BOOT_DEVICE_MMC1	3
-#define BOOT_DEVICE_MMC2	4	/* dummy */
-#define BOOT_DEVICE_MMC2_2	5	/* dummy */
-
-#endif
diff --git a/arch/arm/include/asm/arch-mx35/spl.h b/arch/arm/include/asm/arch-mx35/spl.h
deleted file mode 100644
index d0efec2..0000000
--- a/arch/arm/include/asm/arch-mx35/spl.h
+++ /dev/null
@@ -1,22 +0,0 @@ 
-/*
- * (C) Copyright 2012
- * Texas Instruments, <www.ti.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-#ifndef	_ASM_ARCH_SPL_H_
-#define	_ASM_ARCH_SPL_H_
-
-#define BOOT_DEVICE_NONE	0
-#define BOOT_DEVICE_XIP		1
-#define BOOT_DEVICE_XIPWAIT	2
-#define BOOT_DEVICE_NAND	3
-#define BOOT_DEVICE_ONENAND	4
-#define BOOT_DEVICE_MMC1	5
-#define BOOT_DEVICE_MMC2	6
-#define BOOT_DEVICE_MMC2_2	7
-#define BOOT_DEVICE_NOR		8
-#define BOOT_DEVICE_I2C		9
-#define BOOT_DEVICE_SPI		10
-
-#endif
diff --git a/arch/arm/include/asm/arch-mx5/spl.h b/arch/arm/include/asm/arch-mx5/spl.h
deleted file mode 100644
index 20c6cae..0000000
--- a/arch/arm/include/asm/arch-mx5/spl.h
+++ /dev/null
@@ -1,13 +0,0 @@ 
-/*
- * Copyright (C) 2013 Marek Vasut <marex@denx.de>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#ifndef __ASM_ARCH_SPL_H__
-#define __ASM_ARCH_SPL_H__
-
-#define BOOT_DEVICE_NONE	0
-#define BOOT_DEVICE_NAND	1
-
-#endif	/* __ASM_ARCH_SPL_H__ */
diff --git a/arch/arm/include/asm/arch-tegra114/spl.h b/arch/arm/include/asm/arch-tegra114/spl.h
deleted file mode 100644
index ebb16fe..0000000
--- a/arch/arm/include/asm/arch-tegra114/spl.h
+++ /dev/null
@@ -1,22 +0,0 @@ 
-/*
- * Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef	_ASM_ARCH_SPL_H_
-#define	_ASM_ARCH_SPL_H_
-
-#define BOOT_DEVICE_RAM         1
-
-#endif
diff --git a/arch/arm/include/asm/arch-tegra124/spl.h b/arch/arm/include/asm/arch-tegra124/spl.h
deleted file mode 100644
index e266395..0000000
--- a/arch/arm/include/asm/arch-tegra124/spl.h
+++ /dev/null
@@ -1,13 +0,0 @@ 
-/*
- * (C) Copyright 2010-2013
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#ifndef _ASM_ARCH_SPL_H_
-#define _ASM_ARCH_SPL_H_
-
-#define BOOT_DEVICE_RAM 1
-
-#endif /* _ASM_ARCH_SPL_H_ */
diff --git a/arch/arm/include/asm/arch-tegra20/spl.h b/arch/arm/include/asm/arch-tegra20/spl.h
deleted file mode 100644
index 8953b00..0000000
--- a/arch/arm/include/asm/arch-tegra20/spl.h
+++ /dev/null
@@ -1,12 +0,0 @@ 
-/*
- * (C) Copyright 2012
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-#ifndef	_ASM_ARCH_SPL_H_
-#define	_ASM_ARCH_SPL_H_
-
-#define BOOT_DEVICE_RAM         1
-
-#endif
diff --git a/arch/arm/include/asm/arch-tegra30/spl.h b/arch/arm/include/asm/arch-tegra30/spl.h
deleted file mode 100644
index 8953b00..0000000
--- a/arch/arm/include/asm/arch-tegra30/spl.h
+++ /dev/null
@@ -1,12 +0,0 @@ 
-/*
- * (C) Copyright 2012
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-#ifndef	_ASM_ARCH_SPL_H_
-#define	_ASM_ARCH_SPL_H_
-
-#define BOOT_DEVICE_RAM         1
-
-#endif
diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h
index 90e5a9d..18a319d 100644
--- a/arch/arm/include/asm/spl.h
+++ b/arch/arm/include/asm/spl.h
@@ -7,9 +7,29 @@ 
 #ifndef	_ASM_SPL_H_
 #define	_ASM_SPL_H_
 
+#if defined(CONFIG_OMAP) || defined(CONFIG_SOCFPGA) || defined(CONFIG_ZYNQ) \
+	|| defined(CONFIG_EXYNOS4) || defined(CONFIG_EXYNOS5) \
+	|| defined(CONFIG_EXYNOS4210)
 /* Platform-specific defines */
 #include <asm/arch/spl.h>
 
+#else
+enum {
+	BOOT_DEVICE_RAM,
+	BOOT_DEVICE_MMC1,
+	BOOT_DEVICE_MMC2,
+	BOOT_DEVICE_MMC2_2,
+	BOOT_DEVICE_NAND,
+	BOOT_DEVICE_ONENAND,
+	BOOT_DEVICE_NOR,
+	BOOT_DEVICE_UART,
+	BOOT_DEVICE_SPI,
+	BOOT_DEVICE_SATA,
+	BOOT_DEVICE_I2C,
+	BOOT_DEVICE_NONE
+};
+#endif
+
 /* Linker symbols. */
 extern char __bss_start[], __bss_end[];
 
diff --git a/board/denx/m53evk/m53evk.c b/board/denx/m53evk/m53evk.c
index 74f9501..5dd6cdd 100644
--- a/board/denx/m53evk/m53evk.c
+++ b/board/denx/m53evk/m53evk.c
@@ -14,7 +14,7 @@ 
 #include <asm/arch/clock.h>
 #include <asm/arch/iomux-mx53.h>
 #include <asm/imx-common/mx5_video.h>
-#include <asm/arch/spl.h>
+#include <asm/spl.h>
 #include <asm/errno.h>
 #include <netdev.h>
 #include <i2c.h>