Skip to contentSkip to conversation

zynq: Add support for U-BOOT SPL

PATCH New Michal Simek 3 participants 4 messages Feb 7, 2014 – Feb 10, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 zynq: Add support for U-BOOT SPL

SPL is using ps7_init.c/h files which are generated from design tools which have to be copied to boards/xilinx/zynq folder before compilation.

BSS section is moved to SDRAM because fat support
requires more space than SRAM size.

Added:
- MMC and QSPI support
- Boot OS directly from SPL
- Enable SPL command

---

 arch/arm/cpu/armv7/zynq/Makefile       |  1 +
 arch/arm/cpu/armv7/zynq/cpu.c          |  4 +-
 arch/arm/cpu/armv7/zynq/spl.c          | 69 ++++++++++++++++++++++++++++++
 arch/arm/cpu/armv7/zynq/u-boot-spl.lds | 61 +++++++++++++++++++++++++++
 arch/arm/include/asm/arch-zynq/spl.h   | 18 ++++++++
 board/xilinx/zynq/Makefile             |  1 +
 board/xilinx/zynq/ps7_init.c           | 12 ++++++
 include/configs/zynq-common.h          | 77 ++++++++++++++++++++++++++++++++++
 8 files changed, 241 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/zynq/spl.c
 create mode 100644 arch/arm/cpu/armv7/zynq/u-boot-spl.lds
 create mode 100644 arch/arm/include/asm/arch-zynq/spl.h
 create mode 100644 board/xilinx/zynq/ps7_init.c
arch/arm/cpu/armv7/zynq/Makefile +1 -0
index 3374789..3363a3c 100644
@@ -13,3 +13,4 @@ obj-y	+= cpu.o
 obj-y	+= ddrc.o
 obj-y	+= slcr.o
 obj-y	+= clk.o
+obj-$(CONFIG_SPL_BUILD)	+= spl.o
arch/arm/cpu/armv7/zynq/cpu.c +2 -2
index 5d505dd..7626b5c 100644
@@ -17,7 +17,7 @@ void lowlevel_init(void)
 int arch_cpu_init(void)
 {
 	zynq_slcr_unlock();
-
+#ifndef CONFIG_SPL_BUILD
 	/* Device config APB, unlock the PCAP */
 	writel(0x757BDF0D, &devcfg_base->unlock);
 	writel(0xFFFFFFFF, &devcfg_base->rom_shadow);
@@ -35,7 +35,7 @@ int arch_cpu_init(void)
 	/* Urgent write, ports S2/S3 */
 	writel(0xC, &slcr_base->ddr_urgent);
 #endif
-
+#endif
 	zynq_clk_early_init();
 	zynq_slcr_lock();
 
arch/arm/cpu/armv7/zynq/spl.c new file +69 -0

69 lines not on this page · raw message

arch/arm/cpu/armv7/zynq/u-boot-spl.lds new file +61 -0

61 lines not on this page · raw message

arch/arm/include/asm/arch-zynq/spl.h new file +18 -0
new file mode 100644
index 0000000..5789d28
@@ -0,0 +1,18 @@
+/*
+ * (C) Copyright 2014 Xilinx, Inc. Michal Simek
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+#ifndef	_ASM_ARCH_SPL_H_
+#define	_ASM_ARCH_SPL_H_
+
+extern void ps7_init(void);
+
+#define BOOT_DEVICE_NONE	0
+#define BOOT_DEVICE_RAM		1
+#define BOOT_DEVICE_SPI		2
+#define BOOT_DEVICE_MMC1	3
+#define BOOT_DEVICE_MMC2	4
+#define BOOT_DEVICE_MMC2_2	5
+
+#endif
board/xilinx/zynq/Makefile +1 -0
index 6301a8c..3f19a1c 100644
@@ -6,3 +6,4 @@
 #
 
 obj-y	:= board.o
+obj-$(CONFIG_SPL_BUILD)	+= ps7_init.o
board/xilinx/zynq/ps7_init.c new file +12 -0
new file mode 100644
index 0000000..c47da09
@@ -0,0 +1,12 @@
+/*
+ * (C) Copyright 2014 Xilinx, Inc. Michal Simek
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+#include <common.h>
+#include <asm/arch/spl.h>
+
+__weak void ps7_init(void)
+{
+	puts("Please copy ps7_init.c/h from hw project\n");
+}
include/configs/zynq-common.h +77 -0

81 lines not on this page · raw message

--
1.8.2.3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140207/7a88424e/attachment.pgp>

#1 lore raw

PATCH 1/1 zynq: Add support for U-BOOT SPL

Quoted 7 lines · Michal Simek

SPL is using ps7_init.c/h files which are generated from design tools which have to be copied to boards/xilinx/zynq folder before compilation.

BSS section is moved to SDRAM because fat support requires more space than SRAM size.

Quoted 6 lines

Added:
- MMC and QSPI support
- Boot OS directly from SPL
- Enable SPL command

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/20140207/cdc8175a/attachment.pgp>
#2 lore raw

PATCH 1/1 zynq: Add support for U-BOOT SPL

Hi Michal,

Quoted 9 lines · Tom Rini
Quoted 7 lines · Michal Simek

SPL is using ps7_init.c/h files which are generated from design tools which have to be copied to boards/xilinx/zynq folder before compilation.

BSS section is moved to SDRAM because fat support requires more space than SRAM size.

Quoted 8 lines
Quoted 6 lines

Added:
- MMC and QSPI support
- Boot OS directly from SPL
- Enable SPL command

This does not seem to apply cleanly to current u-boot-arm/master or u-boot/master. Does this depend on other patches or on some not-yet-applied PR?

Amicalement,

Signature · 1 line
Albert.
#3 lore raw

PATCH 1/1 zynq: Add support for U-BOOT SPL

Quoted 18 lines · Albert ARIBAUD

Hi Michal,

Quoted 14 lines · Tom Rini
Quoted 12 lines · Michal Simek

SPL is using ps7_init.c/h files which are generated from design tools which have to be copied to boards/xilinx/zynq folder before compilation.

BSS section is moved to SDRAM because fat support requires more space than SRAM size.

Added:
- MMC and QSPI support
- Boot OS directly from SPL
- Enable SPL command

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

This does not seem to apply cleanly to current u-boot-arm/master or u-boot/master. Does this depend on other patches or on some not-yet-applied PR?

Yes. It depends on previous patches. I am going to send you zynq pull request today with all these patches.

Thanks,
Michal