Skip to contentSkip to conversation

S3C24XX: Add support to MINI2416 board

PATCH Superseded José Miguel Gonçalves 8 participants 50 messages Sep 19, 2012 – Sep 23, 2012

Subsystems (6)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover S3C24XX: Add support to MINI2416 board

Support for the MINI2416 board based on a Samsung's S3C2416 SoC with 64MB DDR2 SDRAM, 256MB NAND Flash, a LAN9220 Ethernet Controller and a WM8731 Audio CODEC.

Changes for v2:
- Coding style cleanup
- Removed new serial and rtc drivers
- Use of in-tree serial and rtc drivers

Changes for v3:
- Rebased on new SPL framework:
http://github.com/trini/u-boot WIP/spl-improvements
- Removed patch "ARM: fix relocation on ARM926EJS"
- Add patch to configure printf() inclusion on SPL
- Changed new binary target name from u-boot-ubl.bin to u-boot-pad.bin
- Removed magic numbers
- Checkpatch clean except:
- False positive:
ERROR: spaces required around that ':' (ctx:VxV) #692: FILE: include/configs/mini2416.h:165:
+#define CONFIG_ETHADDR FE:11:22:33:44:55
- Following preexistent coding style:
WARNING: please, no spaces at the start of a line #1716: FILE: include/common.h:631:
+ defined(CONFIG_S3C24XX) || \$

Changes for v4:
- NAND Flash driver cleanup and optimization

Jos? Miguel Gon?alves (11):
Add configuration option to select printf() inclusion on SPL
S3C24XX: Add core support for Samsung's S3C24XX SoCs
serial: Add support to 4 ports in serial_s3c24x0
serial: Use a more precise baud rate generation for serial_s3c24x0
serial: Remove unnecessary delay in serial_s3c24x0
rtc: Improve rtc_get() on s3c24x0_rtc
rtc: Fix rtc_reset() on s3c24x0_rtc
rtc: Don't allow setting unsuported years on s3c24x0_rtc
S3C24XX: Add NAND Flash driver
Add u-boot-pad.bin target to the Makefile
S3C24XX: Add support to MINI2416 board

 MAINTAINERS                                     |    4 +
 Makefile                                        |   11 +-
 README                                          |    3 +
 arch/arm/cpu/arm926ejs/s3c24xx/Makefile         |   56 +++
 arch/arm/cpu/arm926ejs/s3c24xx/cpu.c            |   57 +++
 arch/arm/cpu/arm926ejs/s3c24xx/cpu_info.c       |   57 +++
 arch/arm/cpu/arm926ejs/s3c24xx/s3c2412_speed.c  |  114 +++++
 arch/arm/cpu/arm926ejs/s3c24xx/s3c2416_speed.c  |  116 +++++
 arch/arm/cpu/arm926ejs/s3c24xx/timer.c          |  152 ++++++
 arch/arm/include/asm/arch-s3c24xx/s3c2412.h     |  130 +++++
 arch/arm/include/asm/arch-s3c24xx/s3c2416.h     |  183 +++++++
 arch/arm/include/asm/arch-s3c24xx/s3c24x0_cpu.h |   41 ++
 arch/arm/include/asm/arch-s3c24xx/s3c24xx.h     |  615 +++++++++++++++++++++++
 arch/arm/include/asm/arch-s3c24xx/s3c24xx_cpu.h |   30 ++
 arch/arm/include/asm/arch-s3c24xx/spl.h         |   29 ++
 board/boardcon/mini2416/Makefile                |   47 ++
 board/boardcon/mini2416/config.mk               |    4 +
 board/boardcon/mini2416/mini2416.c              |  104 ++++
 board/boardcon/mini2416/mini2416_spl.c          |  203 ++++++++
 board/boardcon/mini2416/u-boot-spl.lds          |   63 +++
 boards.cfg                                      |    1 +
 drivers/mtd/nand/Makefile                       |    1 +
 drivers/mtd/nand/s3c24xx_nand.c                 |  255 +++++++++
 drivers/rtc/s3c24x0_rtc.c                       |   30 +-
 drivers/serial/serial_s3c24x0.c                 |   52 +-
 include/common.h                                |   12 +
 include/configs/VCMA9.h                         |    2 +-
 include/configs/mini2416.h                      |  202 ++++++++
 include/configs/smdk2410.h                      |    2 +-
 29 files changed, 2549 insertions(+), 27 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/Makefile
 create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/cpu.c
 create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/cpu_info.c
 create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/s3c2412_speed.c
 create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/s3c2416_speed.c
 create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/timer.c
 create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c2412.h
 create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c2416.h
 create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c24x0_cpu.h
 create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c24xx.h
 create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c24xx_cpu.h
 create mode 100644 arch/arm/include/asm/arch-s3c24xx/spl.h
 create mode 100644 board/boardcon/mini2416/Makefile
 create mode 100644 board/boardcon/mini2416/config.mk
 create mode 100644 board/boardcon/mini2416/mini2416.c
 create mode 100644 board/boardcon/mini2416/mini2416_spl.c
 create mode 100644 board/boardcon/mini2416/u-boot-spl.lds
 create mode 100644 drivers/mtd/nand/s3c24xx_nand.c
 create mode 100644 include/configs/mini2416.h
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v4 1/11 Add configuration option to select printf() inclusion on SPL

The printf() implementation needs 4~5KB of storage space which may not be available when building an SPL for SoCs with scarce internal RAM (8KB or less). This patch adds a new option, CONFIG_SPL_PRINTF_SUPPORT, to deal with this.

---
Changes for v3:
- New patch

Changes for v4:
- None

---
 README           |    3 +++
 include/common.h |   11 +++++++++++
 2 files changed, 14 insertions(+)
README +3 -0
index 016d8bc..988812c 100644
@@ -2576,6 +2576,9 @@ FIT uImage format:
 		CONFIG_SPL_LIBCOMMON_SUPPORT
 		Support for common/libcommon.o in SPL binary
 
+		CONFIG_SPL_PRINTF_SUPPORT
+		Enable printf() support in common/libcommon.o
+
 		CONFIG_SPL_LIBDISK_SUPPORT
 		Support for disk/libdisk.o in SPL binary
 
include/common.h +11 -0
index 55025c0..c10d745 100644
@@ -805,9 +805,20 @@ int	tstc(void);
 /* stdout */
 void	putc(const char c);
 void	puts(const char *s);
+/*
+ * The printf() implementation needs 4~5KB of storage space which may not be
+ * available when building an SPL for SoCs with scarce internal RAM
+ * (8KB or less). To force printf() inclusion on an SPL we must define
+ * CONFIG_SPL_LIBCOMMON_SUPPORT and CONFIG_SPL_PRINTF_SUPPORT.
+ */
+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_PRINTF_SUPPORT)
 int	printf(const char *fmt, ...)
 		__attribute__ ((format (__printf__, 1, 2)));
 int	vprintf(const char *fmt, va_list args);
+#else
+#define printf(fmt...) do {} while (0)
+#define vprintf(fmt, args) do {} while (0)
+#endif
 
 /* stderr */
 #define eputc(c)		fputc(stderr, c)
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v4 2/11 S3C24XX: Add core support for Samsung's S3C24XX SoCs

In reply to José Miguel Gonçalves

This patch adds the support for Samsung's S3C24XX SoCs that have an ARM926EJS core. Currently it supports S3C2412, S3C2413, S3C2416 and S3C2450.
Tested on an S3C2416 platform.

---
Changes for v2:
- Added register bit macros to avoid magic numbers
- Removed volatile attribute from register structs
- Added s3c24x0_cpu.h to be able to use drivers from s3c24x0 family
- Fixed EPLL computation in get_PLLCLK for S3C2416
- Added display of UCLK in print_cpu_info
- Use of clrsetbits_le32()

Changes for v3:
- Add __noreturn attribute to reset_cpu()
- Removed magic numbers
- Add arch/arm/include/asm/arch-s3c24xx/spl.h for new SPL framework

Changes for v4:
- None

---
 arch/arm/cpu/arm926ejs/s3c24xx/Makefile         |   56 +++
 arch/arm/cpu/arm926ejs/s3c24xx/cpu.c            |   57 +++
 arch/arm/cpu/arm926ejs/s3c24xx/cpu_info.c       |   57 +++
 arch/arm/cpu/arm926ejs/s3c24xx/s3c2412_speed.c  |  114 +++++
 arch/arm/cpu/arm926ejs/s3c24xx/s3c2416_speed.c  |  116 +++++
 arch/arm/cpu/arm926ejs/s3c24xx/timer.c          |  152 ++++++
 arch/arm/include/asm/arch-s3c24xx/s3c2412.h     |  130 +++++
 arch/arm/include/asm/arch-s3c24xx/s3c2416.h     |  183 +++++++
 arch/arm/include/asm/arch-s3c24xx/s3c24x0_cpu.h |   41 ++
 arch/arm/include/asm/arch-s3c24xx/s3c24xx.h     |  615 +++++++++++++++++++++++
 arch/arm/include/asm/arch-s3c24xx/s3c24xx_cpu.h |   30 ++
 arch/arm/include/asm/arch-s3c24xx/spl.h         |   29 ++
 include/common.h                                |    1 +
 13 files changed, 1581 insertions(+)
 create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/Makefile
 create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/cpu.c
 create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/cpu_info.c
 create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/s3c2412_speed.c
 create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/s3c2416_speed.c
 create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/timer.c
 create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c2412.h
 create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c2416.h
 create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c24x0_cpu.h
 create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c24xx.h
 create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c24xx_cpu.h
 create mode 100644 arch/arm/include/asm/arch-s3c24xx/spl.h
arch/arm/cpu/arm926ejs/s3c24xx/Makefile new file +56 -0
new file mode 100644
index 0000000..d7f5e0d
@@ -0,0 +1,56 @@
+#
+# (C) Copyright 2012 INOV - INESC Inovacao
+# Jose Goncalves <[email protected]>
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(SOC).o
+
+ifndef CONFIG_SPL_BUILD
+COBJS-$(CONFIG_DISPLAY_CPUINFO)	+= cpu_info.o
+endif
+
+ifeq ($(filter y,$(CONFIG_S3C2412) $(CONFIG_S3C2413)),y)
+COBJS-y	+= s3c2412_speed.o
+else
+COBJS-y	+= s3c2416_speed.o
+endif
+
+COBJS-y	+= cpu.o
+COBJS-y	+= timer.o
+
+SRCS	:= $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS-y))
+
+all:	$(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
arch/arm/cpu/arm926ejs/s3c24xx/cpu.c new file +57 -0

57 lines not on this page · raw message

arch/arm/cpu/arm926ejs/s3c24xx/cpu_info.c new file +57 -0

57 lines not on this page · raw message

arch/arm/cpu/arm926ejs/s3c24xx/s3c2412_speed.c new file +114 -0

114 lines not on this page · raw message

arch/arm/cpu/arm926ejs/s3c24xx/s3c2416_speed.c new file +116 -0

116 lines not on this page · raw message

arch/arm/cpu/arm926ejs/s3c24xx/timer.c new file +152 -0

152 lines not on this page · raw message

arch/arm/include/asm/arch-s3c24xx/s3c2412.h new file +130 -0

130 lines not on this page · raw message

arch/arm/include/asm/arch-s3c24xx/s3c2416.h new file +183 -0

183 lines not on this page · raw message

arch/arm/include/asm/arch-s3c24xx/s3c24x0_cpu.h new file +41 -0

41 lines not on this page · raw message

arch/arm/include/asm/arch-s3c24xx/s3c24xx.h new file +615 -0

615 lines not on this page · raw message

arch/arm/include/asm/arch-s3c24xx/s3c24xx_cpu.h new file +30 -0
new file mode 100644
index 0000000..59ccfd4
@@ -0,0 +1,30 @@
+/*
+ * (C) Copyright 2012 INOV - INESC Inovacao
+ * Jose Goncalves <[email protected]>
+ *
+ * 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
+ */
+
+#if defined(CONFIG_S3C2412) || defined(CONFIG_S3C2413)
+#include <asm/arch/s3c2412.h>
+#elif defined(CONFIG_S3C2416) || defined(CONFIG_S3C2450)
+#include <asm/arch/s3c2416.h>
+#else
+#error Please define the S3C24XX SoC type
+#endif
arch/arm/include/asm/arch-s3c24xx/spl.h new file +29 -0
new file mode 100644
index 0000000..2741fe7
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2012 INOV - INESC Inovacao
+ * Jose Goncalves <[email protected]>
+ *
+ * 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
+ */
+#ifndef	_ASM_ARCH_SPL_H_
+#define	_ASM_SPL_H_
+
+#define BOOT_DEVICE_NAND	1
+#define BOOT_DEVICE_MMC1	2
+
+#endif
include/common.h +1 -0
index c10d745..b63e814 100644
@@ -628,6 +628,7 @@ ulong	get_OPB_freq (void);
 ulong	get_PCI_freq (void);
 #endif
 #if defined(CONFIG_S3C24X0) || \
+    defined(CONFIG_S3C24XX) || \
     defined(CONFIG_LH7A40X) || \
     defined(CONFIG_S3C6400) || \
     defined(CONFIG_EP93XX)
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v4 3/11 serial: Add support to 4 ports in serial_s3c24x0

In reply to José Miguel Gonçalves

S3C2416 and S3C2450 have 4 UARTs insted of 3 found on older chips. This patch adds support to the additional UART port and changes the mapping between CONFIG_SERIAL? and S3C24X0_UART? in order they have a direct correspondence.

---
Changes for v2:
- New patch

Changes for v3:
- None

Changes for v4:
- None

---
 drivers/serial/serial_s3c24x0.c |   25 ++++++++++++++++++-------
 include/configs/VCMA9.h         |    2 +-
 include/configs/smdk2410.h      |    2 +-
 3 files changed, 20 insertions(+), 9 deletions(-)
drivers/serial/serial_s3c24x0.c +18 -7
index 12bcdd3..280cd2d 100644
@@ -2,6 +2,9 @@
  * (C) Copyright 2002
  * Gary Jennejohn, DENX Software Engineering, <[email protected]>
  *
+ * (C) Copyright 2012 INOV - INESC Inovacao
+ * Jose Goncalves <[email protected]>
+ *
  * 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
@@ -24,17 +27,20 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_SERIAL1
+#if defined(CONFIG_SERIAL0)
 #define UART_NR	S3C24X0_UART0
 
-#elif defined(CONFIG_SERIAL2)
+#elif defined(CONFIG_SERIAL1)
 #define UART_NR	S3C24X0_UART1
 
-#elif defined(CONFIG_SERIAL3)
+#elif defined(CONFIG_SERIAL2)
 #define UART_NR	S3C24X0_UART2
 
+#elif defined(CONFIG_SERIAL3)
+#define UART_NR	S3C24X0_UART3
+
 #else
-#error "Bad: you didn't configure serial ..."
+#error "You didn't configure serial."
 #endif
 
 #include <asm/io.h>
@@ -310,15 +316,20 @@ INIT_S3C_SERIAL_STRUCTURE(1, "s3ser1");
 DECLARE_S3C_SERIAL_FUNCTIONS(2);
 struct serial_device s3c24xx_serial2_device =
 INIT_S3C_SERIAL_STRUCTURE(2, "s3ser2");
+DECLARE_S3C_SERIAL_FUNCTIONS(3);
+struct serial_device s3c24xx_serial3_device =
+INIT_S3C_SERIAL_STRUCTURE(3, "s3ser3");
 
 __weak struct serial_device *default_serial_console(void)
 {
-#if defined(CONFIG_SERIAL1)
+#if defined(CONFIG_SERIAL0)
 	return &s3c24xx_serial0_device;
-#elif defined(CONFIG_SERIAL2)
+#elif defined(CONFIG_SERIAL1)
 	return &s3c24xx_serial1_device;
-#elif defined(CONFIG_SERIAL3)
+#elif defined(CONFIG_SERIAL2)
 	return &s3c24xx_serial2_device;
+#elif defined(CONFIG_SERIAL3)
+	return &s3c24xx_serial3_device;
 #else
 #error "CONFIG_SERIAL? missing."
 #endif
include/configs/VCMA9.h +1 -1
index 6ad4a6b..82db58f 100644
@@ -122,7 +122,7 @@
  * select serial console configuration
  */
 #define CONFIG_S3C24X0_SERIAL
-#define CONFIG_SERIAL1		1	/* we use SERIAL 1 on VCMA9 */
+#define CONFIG_SERIAL0		1	/* we use SERIAL 0 on VCMA9 */
 
 /* USB support (currently only works with D-cache off) */
 #define CONFIG_USB_OHCI
include/configs/smdk2410.h +1 -1
index 8792c85..ea05f16 100644
@@ -62,7 +62,7 @@
  * select serial console configuration
  */
 #define CONFIG_S3C24X0_SERIAL
-#define CONFIG_SERIAL1		1	/* we use SERIAL 1 on SMDK2410 */
+#define CONFIG_SERIAL0		1	/* we use SERIAL 0 on SMDK2410 */
 
 /************************************************************
  * USB support (currently only works with D-cache off)
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH v4 4/11 serial: Use a more precise baud rate generation for serial_s3c24x0

In reply to José Miguel Gonçalves

The values stored in the baud rate divisor register (UBRDIVn) and dividing slot register (UDIVSLOTn), are used to determine the serial baudrate. Previously only UBRDIVn was set. This patch initializes also UDIVSLOTn which allows to obtain a more precise baudrate.

---
Changes for v2:
- New patch

Changes for v3:
- Verbose patch description

Changes for v4:
- None

---
 drivers/serial/serial_s3c24x0.c |   24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
drivers/serial/serial_s3c24x0.c +20 -4
index 280cd2d..c9bc121 100644
@@ -92,16 +92,32 @@ DECLARE_GLOBAL_DATA_PTR;
 static int hwflow;
 #endif
 
+/*
+ * The values stored in the baud rate divisor register (UBRDIVn) and dividing
+ * slot register (UDIVSLOTn), are used to determine the serial Tx/Rx clock rate
+ * (baud rate) as follows:
+ *     DIV_VAL = UBRDIVn + (num of 1?s in UDIVSLOTn) / 16
+ * Using UDIVSLOT, which is the factor of floating point divisor, you can make
+ * more accurate baud rate. Section 2.1.10 of the S3C2416 User's Manual suggests
+ * using the constants on the following table.
+ */
+static const int udivslot[] = {
+	0x0000, 0x0080, 0x0808, 0x0888, 0x2222, 0x4924, 0x4A52, 0x54AA,
+	0x5555, 0xD555, 0xD5D5, 0xDDD5, 0xDDDD, 0xDFDD, 0xDFDF, 0xFFDF,
+};
+
 void _serial_setbrg(const int dev_index)
 {
 	struct s3c24x0_uart *uart = s3c24x0_get_base_uart(dev_index);
-	unsigned int reg = 0;
+	u32 pclk;
+	u32 baudrate;
 	int i;
 
-	/* value is calculated so : (int)(PCLK/16./baudrate) -1 */
-	reg = get_PCLK() / (16 * gd->baudrate) - 1;
+	pclk = get_PCLK();
+	baudrate = gd->baudrate;
 
-	writel(reg, &uart->ubrdiv);
+	writel((pclk / baudrate / 16) - 1, &uart->ubrdiv);
+	writel(udivslot[(pclk / baudrate) % 16], &uart->udivslot);
 	for (i = 0; i < 100; i++)
 		/* Delay */ ;
 }
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v4 5/11 serial: Remove unnecessary delay in serial_s3c24x0

In reply to José Miguel Gonçalves

The loop used to make a delay after baudrate setting is not necessary. Moreover it is removed by the GCC optimizer (at least with GCC 4.6).

---
Changes for v2:
- New patch

Changes for v3:
- None

Changes for v4:
- None

---
 drivers/serial/serial_s3c24x0.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/serial/serial_s3c24x0.c +0 -3
index c9bc121..ec5d1cb 100644
@@ -111,15 +111,12 @@ void _serial_setbrg(const int dev_index)
 	struct s3c24x0_uart *uart = s3c24x0_get_base_uart(dev_index);
 	u32 pclk;
 	u32 baudrate;
-	int i;
 
 	pclk = get_PCLK();
 	baudrate = gd->baudrate;
 
 	writel((pclk / baudrate / 16) - 1, &uart->ubrdiv);
 	writel(udivslot[(pclk / baudrate) % 16], &uart->udivslot);
-	for (i = 0; i < 100; i++)
-		/* Delay */ ;
 }
 
 #if defined(CONFIG_SERIAL_MULTI)
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH v4 6/11 rtc: Improve rtc_get() on s3c24x0_rtc

In reply to José Miguel Gonçalves

A better approach to avoid reading the RTC during updates, as sugested in the S3C2416 User's Manual.

---
Changes for v2:
- New patch

Changes for v3:
- Removed unneeded parenthesis

Changes for v4:
- None

---
 drivers/rtc/s3c24x0_rtc.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/rtc/s3c24x0_rtc.c +8 -2
index c16ff2e..b31dc53 100644
@@ -65,20 +65,26 @@ int rtc_get(struct rtc_time *tmp)
 	uchar sec, min, hour, mday, wday, mon, year;
 	__maybe_unused uchar a_sec, a_min, a_hour, a_date,
 			     a_mon, a_year, a_armed;
+	int have_retried = 0;
 
 	/* enable access to RTC registers */
 	SetRTC_Access(RTC_ENABLE);
 
 	/* read RTC registers */
 	do {
-		sec  = readb(&rtc->bcdsec);
 		min  = readb(&rtc->bcdmin);
 		hour = readb(&rtc->bcdhour);
 		mday = readb(&rtc->bcddate);
 		wday = readb(&rtc->bcdday);
 		mon  = readb(&rtc->bcdmon);
 		year = readb(&rtc->bcdyear);
-	} while (sec != readb(&rtc->bcdsec));
+		sec  = readb(&rtc->bcdsec);
+		/*
+		 * The only way to work out whether the RTC was mid-update
+		 * when we read it is to check the seconds counter.
+		 * If it's zero, then we re-try the entire read.
+		 */
+	} while (sec == 0 && !have_retried++);
 
 	/* read ALARM registers */
 	a_sec   = readb(&rtc->almsec);
Signature · 1 line
1.7.9.5
#7 lore raw

PATCH v4 7/11 rtc: Fix rtc_reset() on s3c24x0_rtc

In reply to José Miguel Gonçalves

rtc_reset() must set the RTC date to the UNIX Epoch.

---
Changes for v2:
- New patch

Changes for v3:
- None

Changes for v4:
- None

---
 drivers/rtc/s3c24x0_rtc.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/rtc/s3c24x0_rtc.c +11 -4
index b31dc53..3fd5cec 100644
@@ -167,10 +167,17 @@ int rtc_set(struct rtc_time *tmp)
 
 void rtc_reset(void)
 {
-	struct s3c24x0_rtc *rtc = s3c24x0_get_base_rtc();
-
-	writeb((readb(&rtc->rtccon) & ~0x06) | 0x08, &rtc->rtccon);
-	writeb(readb(&rtc->rtccon) & ~(0x08 | 0x01), &rtc->rtccon);
+	static struct rtc_time tmp = {
+		.tm_year = 1970,
+		.tm_mon = 1,
+		.tm_mday = 1,
+		.tm_wday = 4,
+		.tm_hour = 0,
+		.tm_min = 0,
+		.tm_sec = 0,
+	};
+
+	rtc_set(&tmp);
 }
 
 #endif
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH v4 8/11 rtc: Don't allow setting unsuported years on s3c24x0_rtc

In reply to José Miguel Gonçalves

This RTC only supports a 100 years range so rtc_set() should not allow setting years bellow 1970 or above 2069.

---
Changes for v2:
- New patch

Changes for v3:
- None

Changes for v4:
- None

---
 drivers/rtc/s3c24x0_rtc.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/rtc/s3c24x0_rtc.c +5 -0
index 3fd5cec..bcd6d44 100644
@@ -139,6 +139,11 @@ int rtc_set(struct rtc_time *tmp)
 	       tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
 	       tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
 #endif
+	if (tmp->tm_year < 1970 || tmp->tm_year > 2069) {
+		puts("ERROR: year should be between 1970 and 2069!\n");
+		return -1;
+	}
+
 	year = bin2bcd(tmp->tm_year % 100);
 	mon  = bin2bcd(tmp->tm_mon);
 	wday = bin2bcd(tmp->tm_wday);
Signature · 1 line
1.7.9.5
#9 lore raw

PATCH v4 9/11 S3C24XX: Add NAND Flash driver

In reply to José Miguel Gonçalves

NAND Flash driver with HW ECC for the S3C24XX SoCs. Currently it only supports SLC NAND chips.

---
Changes for v2:
- Coding style cleanup
- Use of clrsetbits_le32()
- Use of register bit macros instead of magic numbers

Changes for v3:
- Removed magic numbers
- Removed a macro to declare a void printf()
- Replaced one printf() with a puts()

Changes for v4:
- Coding style cleanup
- Use of a struct to store chip private data
- Replaced u_long by u32
- Replaced u_char by uint8_t
- Added error message in s3c_nand_select_chip()
- Optimization of s3c_nand_hwcontrol()

---
 drivers/mtd/nand/Makefile       |    1 +
 drivers/mtd/nand/s3c24xx_nand.c |  255 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 256 insertions(+)
 create mode 100644 drivers/mtd/nand/s3c24xx_nand.c
drivers/mtd/nand/Makefile +1 -0
index 29dc20e..791ec44 100644
@@ -60,6 +60,7 @@ COBJS-$(CONFIG_NAND_MXS) += mxs_nand.o
 COBJS-$(CONFIG_NAND_NDFC) += ndfc.o
 COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o
 COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
+COBJS-$(CONFIG_NAND_S3C24XX) += s3c24xx_nand.o
 COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_NAND_SPEAR) += spr_nand.o
 COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
drivers/mtd/nand/s3c24xx_nand.c new file +255 -0

255 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#10 lore raw

PATCH v4 9/11 S3C24XX: Add NAND Flash driver

Quoted 22 lines · Jos? Miguel Gon?alves

NAND Flash driver with HW ECC for the S3C24XX SoCs. Currently it only supports SLC NAND chips.

---
Changes for v2:
- Coding style cleanup
- Use of clrsetbits_le32()
- Use of register bit macros instead of magic numbers

Changes for v3:
- Removed magic numbers
- Removed a macro to declare a void printf()
- Replaced one printf() with a puts()

Changes for v4:
- Coding style cleanup
- Use of a struct to store chip private data
- Replaced u_long by u32
- Replaced u_char by uint8_t
- Added error message in s3c_nand_select_chip()
- Optimization of s3c_nand_hwcontrol()

Quoted 6 lines
---
 drivers/mtd/nand/Makefile       |    1 +
 drivers/mtd/nand/s3c24xx_nand.c |  255  
+++++++++++++++++++++++++++++++++++++++
 2 files changed, 256 insertions(+)
 create mode 100644 drivers/mtd/nand/s3c24xx_nand.c

drivers/mtd/nand/s3c24xx_nand.c line 252

Quoted 1 line
drivers/mtd/nand/s3c24xx_nand.c new file +1 -0
+	nand->priv = (void *)&chip_info[chip_n++];

Hmm, I was going to say that the cast could be dropped, but I guess it's because of the const. It doesn't need to hold up acceptance of the patch, but it'd probably be better to drop the const instead (more flexible too if additional private data needs to be declared).

-Scott

#11 lore raw

PATCH v4 9/11 S3C24XX: Add NAND Flash driver

Quoted 29 lines · Scott Wood
Quoted 22 lines · Jos? Miguel Gon?alves

NAND Flash driver with HW ECC for the S3C24XX SoCs. Currently it only supports SLC NAND chips.

---
Changes for v2:
- Coding style cleanup
- Use of clrsetbits_le32()
- Use of register bit macros instead of magic numbers

Changes for v3:
- Removed magic numbers
- Removed a macro to declare a void printf()
- Replaced one printf() with a puts()

Changes for v4:
- Coding style cleanup
- Use of a struct to store chip private data
- Replaced u_long by u32
- Replaced u_char by uint8_t
- Added error message in s3c_nand_select_chip()
- Optimization of s3c_nand_hwcontrol()

Quoted 5 lines
---
 drivers/mtd/nand/Makefile       |    1 +
 drivers/mtd/nand/s3c24xx_nand.c |  255 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 256 insertions(+)
 create mode 100644 drivers/mtd/nand/s3c24xx_nand.c
Quoted 6 lines
Quoted 1 line

+ nand->priv = (void *)&chip_info[chip_n++];

Hmm, I was going to say that the cast could be dropped, but I guess it's because of the const.

Yes, it's needed because of the declaration of the private struct as const.

Quoted 3 lines

It doesn't need to hold up acceptance of the patch, but it'd probably be better to drop the const instead (more flexible too if additional private data needs to be declared).

I think a better option would be to drop the const in the struct and set only the 'cs' member to const.

Jos? Gon?alves

#12 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

In reply to José Miguel Gonçalves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

---
Changes for v2:
- None

Changes for v3:
- Changed new binary target name from u-boot-ubl.bin to u-boot-pad.bin

Changes for v4:
- None

---
 Makefile |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Makefile +6 -5
index 8738d55..86dedca 100644
@@ -433,14 +433,15 @@ $(obj)u-boot.sha1:	$(obj)u-boot.bin
 $(obj)u-boot.dis:	$(obj)u-boot
 		$(OBJDUMP) -d $< > $@
 
-$(obj)u-boot.ubl:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
+$(obj)u-boot-pad.bin:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
 		$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin
-		cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-ubl.bin
-		$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
-		-e $(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin $(obj)u-boot.ubl
-		rm $(obj)u-boot-ubl.bin
+		cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-pad.bin
 		rm $(obj)spl/u-boot-spl-pad.bin
 
+$(obj)u-boot.ubl:       $(obj)spl/u-boot-pad.bin
+		$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
+		-e $(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-pad.bin $(obj)u-boot.ubl
+
 $(obj)u-boot.ais:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
 		$(obj)tools/mkimage -s -n /dev/null -T aisimage \
 			-e $(CONFIG_SPL_TEXT_BASE) \
Signature · 1 line
1.7.9.5
#13 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 2 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

I still think "pad" is a lousy name for this. It refers to a minor implementation detail of how the image was put together.

If you don't like the suggestions in
http://lists.denx.de/pipermail/u-boot/2012-September/134191.html, how about
"u-boot-with-spl.bin"?

-Scott

#14 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 10 lines · Scott Wood
Quoted 2 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

I still think "pad" is a lousy name for this. It refers to a minor implementation detail of how the image was put together.

If you don't like the suggestions in
http://lists.denx.de/pipermail/u-boot/2012-September/134191.html, how about "u-boot-with-spl.bin"?

I used a suggestion made by Christian Riesch and accepted by Tom Rini.

I'm totally cool with any name that the U-Boot core maintainers would like to use, though I would prefer a shorter name than "u-boot-with-spl.bin" because I'm lazy and don't like to type too many keys when I upgrade by tftp :-) Because of that I think I would prefer "u-boot-all.bin". So, everybody agrees with that name?

Best regards,
Jos? Gon?alves

#15 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 13 lines · Jos? Miguel Gon?alves
Quoted 11 lines · Scott Wood
Quoted 2 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

I still think "pad" is a lousy name for this. It refers to a minor implementation detail of how the image was put together.

If you don't like the suggestions in
http://lists.denx.de/pipermail/u-boot/2012-September/134191.html,
how about
"u-boot-with-spl.bin"?

Quoted 7 lines

I used a suggestion made by Christian Riesch and accepted by Tom Rini.

I'm totally cool with any name that the U-Boot core maintainers would like to use, though I would prefer a shorter name than "u-boot-with-spl.bin" because I'm lazy and don't like to type too many keys when I upgrade by tftp :-) Because of that I think I would prefer "u-boot-all.bin". So, everybody agrees with that name?

setenv uboot pathname/u-boot-with-as-much-verbosity-as-you-want.bin setenv tftpnand 'tftp $loadaddr $uboot && nand erase 0 $filesize && nand write $loadaddr 0 $filesize'
saveenv
run tftpnand

:-)

-Scott

#16 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 21 lines · Scott Wood
Quoted 12 lines · Jos? Miguel Gon?alves
Quoted 10 lines · Scott Wood
Quoted 2 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

I still think "pad" is a lousy name for this. It refers to a minor implementation detail of how the image was put together.

If you don't like the suggestions in
http://lists.denx.de/pipermail/u-boot/2012-September/134191.html, how about "u-boot-with-spl.bin"?

Quoted 7 lines

I used a suggestion made by Christian Riesch and accepted by Tom Rini.

I'm totally cool with any name that the U-Boot core maintainers would like to use, though I would prefer a shorter name than "u-boot-with-spl.bin" because I'm lazy and don't like to type too many keys when I upgrade by tftp :-) Because of that I think I would prefer "u-boot-all.bin". So, everybody agrees with that name?

Quoted 5 lines

setenv uboot pathname/u-boot-with-as-much-verbosity-as-you-want.bin setenv tftpnand 'tftp $loadaddr $uboot && nand erase 0 $filesize && nand write $loadaddr 0 $filesize'
saveenv
run tftpnand

I already had a script but only for the nand programming part.
I suppose the '&&' on the command line is for conditional execution, right? In my u-boot that does not work, but looking at the README, I see that I need CONFIG_SYS_HUSH_PARSER for it.
I'll give it a try. Thanks!

#17 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

In reply to José Miguel Gonçalves
Quoted 13 lines · Jos? Miguel Gon?alves
Quoted 11 lines · Scott Wood
Quoted 2 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

I still think "pad" is a lousy name for this. It refers to a minor implementation detail of how the image was put together.

If you don't like the suggestions in
http://lists.denx.de/pipermail/u-boot/2012-September/134191.html, how about
"u-boot-with-spl.bin"?

Quoted 7 lines

I used a suggestion made by Christian Riesch and accepted by Tom Rini.

I'm totally cool with any name that the U-Boot core maintainers would like to use, though I would prefer a shorter name than "u-boot-with-spl.bin" because I'm lazy and don't like to type too many keys when I upgrade by tftp :-) Because of that I think I would prefer "u-boot-all.bin". So, everybody agrees with that name?

Hmmm. What does "all" mean? It's not that descriptive.

On Tegra we currently have:

u-boot-spl.bin - just SPL.
u-boot.bin - just main U-Boot, I think. u-boot-dtb.bin - main U-Boot plus an appended DTB, I think. u-boot-dtb-tegra.bin - SPL+U-Boot+DTB.

Also, some have argued that they want to append a DTB outside the U-Boot build process, so does "all" include SPL+U-Boot or SPL+U-Boot+DTB, or ...?

#18 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 9 lines · Stephen Warren
Quoted 8 lines · Jos? Miguel Gon?alves
Quoted 7 lines · Scott Wood
Quoted 2 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

I still think "pad" is a lousy name for this. It refers to a minor implementation detail of how the image was put together.

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

If you don't like the suggestions in
http://lists.denx.de/pipermail/u-boot/2012-September/134191.html, how about
"u-boot-with-spl.bin"?

I used a suggestion made by Christian Riesch and accepted by Tom Rini.

Sorry for the churn, really, but..

Quoted 6 lines
Quoted 5 lines

I'm totally cool with any name that the U-Boot core maintainers would like to use, though I would prefer a shorter name than "u-boot-with-spl.bin" because I'm lazy and don't like to type too many keys when I upgrade by tftp :-) Because of that I think I would prefer "u-boot-all.bin". So, everybody agrees with that name?

Quoted 8 lines

Hmmm. What does "all" mean? It's not that descriptive.

On Tegra we currently have:

u-boot-spl.bin - just SPL.
u-boot.bin - just main U-Boot, I think. u-boot-dtb.bin - main U-Boot plus an appended DTB, I think. u-boot-dtb-tegra.bin - SPL+U-Boot+DTB.

As this, and other examples show, there's not really good generic names. Go with u-boot.s3c24xx as the target and output, please. This is consistent with the other targets and outputs where we throw something that identifies the SoC/etc into the target/name.

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/20120919/8a687c3a/attachment.pgp>
#19 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 41 lines · Tom Rini
Quoted 4 lines · Stephen Warren
Quoted 3 lines · Jos? Miguel Gon?alves
Quoted 2 lines · Scott Wood
Quoted 1 line · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary

image

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

with a padded SPL concatenated with U-Boot.

I still think "pad" is a lousy name for this. It refers to a

minor

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

implementation detail of how the image was put together.

If you don't like the suggestions in

http://lists.denx.de/pipermail/u-boot/2012-September/134191.html, how

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

about
"u-boot-with-spl.bin"?

I used a suggestion made by Christian Riesch and accepted by Tom

Rini.

Sorry for the churn, really, but..

Quoted 1 line
Quoted 1 line

I'm totally cool with any name that the U-Boot core maintainers

would

Quoted 2 lines
Quoted 2 lines

like to use, though I would prefer a shorter name than "u-boot-with-spl.bin" because I'm lazy and don't like to type too

many

Quoted 1 line
Quoted 1 line

keys when I upgrade by tftp :-) Because of that I think I would

prefer

Quoted 10 lines
Quoted 1 line

"u-boot-all.bin". So, everybody agrees with that name?

Hmmm. What does "all" mean? It's not that descriptive.

On Tegra we currently have:

u-boot-spl.bin - just SPL.
u-boot.bin - just main U-Boot, I think. u-boot-dtb.bin - main U-Boot plus an appended DTB, I think. u-boot-dtb-tegra.bin - SPL+U-Boot+DTB.

Quoted 5 lines

As this, and other examples show, there's not really good generic names.
Go with u-boot.s3c24xx as the target and output, please. This is consistent with the other targets and outputs where we throw something that identifies the SoC/etc into the target/name.

So we're just going to duplicate this rule with a different name for every target that just needs a simple concatenation? Like the bad old days of having a rule for every target in the makefile? Come on.

Plus, I don't like using a semi-generic name in the output file because it then looks to the user as if this is a U-Boot that covers that entire family of devices, rather than just the target it was built for. At least with fully generic names like "u-boot.bin" it should be obvious to most people that it doesn't cover every single target. If we must have a non-generic output name, base it on the actual target name using a pattern rule -- but I do not see what's wrong with a generic name. Not necessarily something that works for every target -- that's a strawman -- just something that describes the output of this rule in a way that isn't overly specific.

-Scott

#20 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 54 lines · Scott Wood
Quoted 42 lines · Tom Rini
Quoted 4 lines · Stephen Warren
Quoted 3 lines · Jos? Miguel Gon?alves
Quoted 2 lines · Scott Wood
Quoted 1 line · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a

binary image

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

with a padded SPL concatenated with U-Boot.

I still think "pad" is a lousy name for this. It refers to a

minor

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

implementation detail of how the image was put together.

If you don't like the suggestions in

http://lists.denx.de/pipermail/u-boot/2012-September/134191.html,
how

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

about
"u-boot-with-spl.bin"?

I used a suggestion made by Christian Riesch and accepted by

Tom Rini.

Sorry for the churn, really, but..

Quoted 1 line
Quoted 1 line

I'm totally cool with any name that the U-Boot core

maintainers would

Quoted 2 lines
Quoted 2 lines

like to use, though I would prefer a shorter name than "u-boot-with-spl.bin" because I'm lazy and don't like to type

too many

Quoted 1 line
Quoted 1 line

keys when I upgrade by tftp :-) Because of that I think I

would prefer

Quoted 10 lines
Quoted 1 line

"u-boot-all.bin". So, everybody agrees with that name?

Hmmm. What does "all" mean? It's not that descriptive.

On Tegra we currently have:

u-boot-spl.bin - just SPL.
u-boot.bin - just main U-Boot, I think. u-boot-dtb.bin - main U-Boot plus an appended DTB, I think. u-boot-dtb-tegra.bin - SPL+U-Boot+DTB.

Quoted 5 lines

As this, and other examples show, there's not really good generic names.
Go with u-boot.s3c24xx as the target and output, please. This is consistent with the other targets and outputs where we throw something that identifies the SoC/etc into the target/name.

So we're just going to duplicate this rule with a different name for every target that just needs a simple concatenation? Like the bad old days of having a rule for every target in the makefile? Come on.

Quoted 10 lines

Plus, I don't like using a semi-generic name in the output file because it then looks to the user as if this is a U-Boot that covers that entire family of devices, rather than just the target it was built for. At least with fully generic names like "u-boot.bin" it should be obvious to most people that it doesn't cover every single target. If we must have a non-generic output name, base it on the actual target name using a pattern rule -- but I do not see what's wrong with a generic name. Not necessarily something that works for every target -- that's a strawman -- just something that describes the output of this rule in a way that isn't overly specific.

I suck at naming. I admit it. And I've written, read, rewritten a reply a few times now. So, lets go with this. u-boot.bin is the "I just need u-boot, in binary form, to boot". Lets try u-boot-with-spl.bin as "I just need spl, some padding and u-boot, as bins, to boot".

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/20120919/4773dd16/attachment.pgp>
#21 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

In reply to Tom Rini
Quoted 25 lines · Tom Rini
Quoted 5 lines · Stephen Warren
Quoted 4 lines · Jos? Miguel Gon?alves
Quoted 3 lines · Scott Wood
Quoted 2 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

I still think "pad" is a lousy name for this. It refers to a minor implementation detail of how the image was put together.

If you don't like the suggestions in
http://lists.denx.de/pipermail/u-boot/2012-September/134191.html, how about
"u-boot-with-spl.bin"?

I used a suggestion made by Christian Riesch and accepted by Tom Rini.

Sorry for the churn, really, but..

Quoted 9 lines
Quoted 5 lines

I'm totally cool with any name that the U-Boot core maintainers would like to use, though I would prefer a shorter name than "u-boot-with-spl.bin" because I'm lazy and don't like to type too many keys when I upgrade by tftp :-) Because of that I think I would prefer "u-boot-all.bin". So, everybody agrees with that name?

Hmmm. What does "all" mean? It's not that descriptive.

On Tegra we currently have:

Quoted 9 lines
Quoted 4 lines

u-boot-spl.bin - just SPL.
u-boot.bin - just main U-Boot, I think. u-boot-dtb.bin - main U-Boot plus an appended DTB, I think. u-boot-dtb-tegra.bin - SPL+U-Boot+DTB.

As this, and other examples show, there's not really good generic names. Go with u-boot.s3c24xx as the target and output, please. This is consistent with the other targets and outputs where we throw something that identifies the SoC/etc into the target/name.

I'm fine with throwing something that identifies the SoC into the u-boot image name. In that case I would suggest using instead "u-boot.s3c", because, AFAIK, all Samsung's S3C SoCs that support NAND/SD boot through an internal ROM use raw images to boot and would be fine with this format. Nevertheless, before I proceed with the change, a confirmation for this from someone with a better knowledge of Samsung SoCs would be nice...

#22 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

In reply to José Miguel Gonçalves
Quoted 37 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

---
Changes for v2:
- None

Changes for v3:
- Changed new binary target name from u-boot-ubl.bin to
u-boot-pad.bin

Changes for v4:
- None

---
 Makefile |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Makefile +1 -1
index 8738d55..86dedca 100644
@@ -433,14 +433,15 @@ $(obj)u-boot.sha1:	$(obj)u-boot.bin
 $(obj)u-boot.dis:	$(obj)u-boot
 		$(OBJDUMP) -d $< > $@
 
-$(obj)u-boot.ubl:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
+$(obj)u-boot-pad.bin:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
 		$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary  

$(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin

Makefile +0 -1
-		cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin >  

$(obj)u-boot-ubl.bin

Makefile +0 -2
-		$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
-		-e $(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin  

$(obj)u-boot.ubl

Makefile +1 -1
-		rm $(obj)u-boot-ubl.bin
+		cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin >  
Quoted 2 lines

$(obj)u-boot-pad.bin
rm $(obj)spl/u-boot-spl-pad.bin

This rule lists u-boot-spl.bin as a prerequisite, but it doesn't appear to use it -- it uses u-boot-spl instead.

It seems that either spl/Makefile should produce u-boot-spl rather than u-boot-spl.bin and let the toplevel Makefile deal with converting it to a binary, or spl/Makefile should take care of adding any needed padding for the target and the final rule should just be a concatenation.

-Scott

#23 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 34 lines · Scott Wood
Quoted 17 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

--- Changes for v2: - None

Changes for v3: - Changed new binary target name from u-boot-ubl.bin to u-boot-pad.bin

Changes for v4: - None --- Makefile | 11 ++++++----- 1 file
changed, 6 insertions(+), 5 deletions(-)

Makefile index 8738d55..86dedca 100644 renamed from Makefile +0 -1
--- a/Makefile +++ b/Makefile @@ -433,14 +433,15 @@

$(obj)u-boot.sha1: $(obj)u-boot.bin $(obj)u-boot.dis:
$(obj)u-boot $(OBJDUMP) -d $< > $@

Quoted 12 lines

-$(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin
$(obj)u-boot.bin +$(obj)u-boot-pad.bin:
$(obj)spl/u-boot-spl.bin $(obj)u-boot.bin $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl
$(obj)spl/u-boot-spl-pad.bin - cat
$(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin >
$(obj)u-boot-ubl.bin - $(obj)tools/mkimage -n
$(UBL_CONFIG) -T ublimage \ - -e $(CONFIG_SYS_TEXT_BASE)
-d $(obj)u-boot-ubl.bin $(obj)u-boot.ubl - rm
$(obj)u-boot-ubl.bin + cat $(obj)spl/u-boot-spl-pad.bin
$(obj)u-boot.bin > $(obj)u-boot-pad.bin rm $(obj)spl/u-boot-spl-pad.bin

This rule lists u-boot-spl.bin as a prerequisite, but it doesn't appear to use it -- it uses u-boot-spl instead.

Quoted 5 lines

It seems that either spl/Makefile should produce u-boot-spl rather than u-boot-spl.bin and let the toplevel Makefile deal with converting it to a binary, or spl/Makefile should take care of adding any needed padding for the target and the final rule should just be a concatenation.

So, if we use a weak PAD_TO value of say 0x1, we could always "pad" u-boot-spl.bin out and then do the concatenation here and in a few other targets as well.

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQWlXRAAoJENk4IS6UOR1W2jQP/2LNJnDDVVIuGHuUul5qfTen 6/BJJAp9BGJAtaLjOU/Yl9PxcKoqm7JgrONxBtOeLx3R3otn/drVjgQWgfizSBw6 niXLcisSa8RzTmC2fufyIQLq4Eq4aIJzJs8SV5jT8+cCKiGdwnl4MLv296JEWSOE rZUJwCEOsO7hPI7nYnbDkgz2UHSVF8ONhWAAghvOdBC0L9MYWMnbpwC8iFFDPFWf 8ilCFJ9bpMRo9PbLm2ukA4wBXf24L/+GWUn6jr7hOHbsfpvqiTV/59TayliqJHSq aa06KsRq/D8l9kYy7IBb1bJzWb50LW8FiaHcSrAyctf65fDc/wlL6eUnUCIeOfL1 Fs7rfYYfKSe2aGug9KysfPd6m+nEhVe4dL7DtA5Iq2M+vEZ1h4rEOHTNINn2OaW8 jqBjfi/gn/M6QD3EHCHC0Qr2pOUX1BLJEEj4fd/VkKCE3iHiAmt/9g6qiTUdXdWv 5YOXzG8wG/5LlQvPpfNemsapjo+VrppefPIDvtIjFb8bnfOPHB+EKnAJb+JPFoEq N5Qru35BP5DXggYDzfITDza0qF47CKSR2uGxNT56hS/vsWcirJEa1E0ZPNUg8CaH YwbhpsXgRn4J3req2rBrCtn9hwtfBfUd0cTeFdY28YAlgv0QKyUNvcL85iCtE9nK v6i+//5q/nN/Q22hrR9g
=ul+t
-----END PGP SIGNATURE-----

#24 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 44 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 34 lines · Scott Wood
Quoted 17 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

--- Changes for v2: - None

Changes for v3: - Changed new binary target name from u-boot-ubl.bin to u-boot-pad.bin

Changes for v4: - None --- Makefile | 11 ++++++----- 1 file
changed, 6 insertions(+), 5 deletions(-)

Makefile index 8738d55..86dedca 100644 renamed from Makefile +0 -1
--- a/Makefile +++ b/Makefile @@ -433,14 +433,15 @@

$(obj)u-boot.sha1: $(obj)u-boot.bin $(obj)u-boot.dis:
$(obj)u-boot $(OBJDUMP) -d $< > $@

Quoted 12 lines

-$(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin
$(obj)u-boot.bin +$(obj)u-boot-pad.bin:
$(obj)spl/u-boot-spl.bin $(obj)u-boot.bin $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl
$(obj)spl/u-boot-spl-pad.bin - cat
$(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin >
$(obj)u-boot-ubl.bin - $(obj)tools/mkimage -n
$(UBL_CONFIG) -T ublimage \ - -e $(CONFIG_SYS_TEXT_BASE)
-d $(obj)u-boot-ubl.bin $(obj)u-boot.ubl - rm
$(obj)u-boot-ubl.bin + cat $(obj)spl/u-boot-spl-pad.bin
$(obj)u-boot.bin > $(obj)u-boot-pad.bin rm $(obj)spl/u-boot-spl-pad.bin

This rule lists u-boot-spl.bin as a prerequisite, but it doesn't appear to use it -- it uses u-boot-spl instead.

Quoted 5 lines

It seems that either spl/Makefile should produce u-boot-spl rather than u-boot-spl.bin and let the toplevel Makefile deal with converting it to a binary, or spl/Makefile should take care of adding any needed padding for the target and the final rule should just be a concatenation.

Quoted 3 lines

So, if we use a weak PAD_TO value of say 0x1, we could always "pad" u-boot-spl.bin out and then do the concatenation here and in a few other targets as well.

Yes, or use a variable that includes the linker option, so that it expands to an empty string if padding isn't required.

-Scott

#25 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 44 lines · Scott Wood
Quoted 43 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 39 lines · Scott Wood
Quoted 17 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

--- Changes for v2: - None

Changes for v3: - Changed new binary target name from u-boot-ubl.bin to u-boot-pad.bin

Changes for v4: - None --- Makefile | 11 ++++++----- 1 file
changed, 6 insertions(+), 5 deletions(-)

Makefile index 8738d55..86dedca renamed from Makefile +0 -0

100644 --- a/Makefile +++ b/Makefile @@ -433,14 +433,15 @@
$(obj)u-boot.sha1: $(obj)u-boot.bin $(obj)u-boot.dis:
$(obj)u-boot $(OBJDUMP) -d $< > $@

Quoted 12 lines

-$(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin
$(obj)u-boot.bin +$(obj)u-boot-pad.bin:
$(obj)spl/u-boot-spl.bin $(obj)u-boot.bin $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin - cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin >
$(obj)u-boot-ubl.bin - $(obj)tools/mkimage -n
$(UBL_CONFIG) -T ublimage \ - -e
$(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin
$(obj)u-boot.ubl - rm $(obj)u-boot-ubl.bin + cat
$(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-pad.bin rm $(obj)spl/u-boot-spl-pad.bin

This rule lists u-boot-spl.bin as a prerequisite, but it doesn't appear to use it -- it uses u-boot-spl instead.

It seems that either spl/Makefile should produce u-boot-spl rather than u-boot-spl.bin and let the toplevel Makefile deal with converting it to a binary, or spl/Makefile should take care of adding any needed padding for the target and the final rule should just be a concatenation.

Quoted 6 lines
Quoted 3 lines

So, if we use a weak PAD_TO value of say 0x1, we could always "pad" u-boot-spl.bin out and then do the concatenation here and in a few other targets as well.

Yes, or use a variable that includes the linker option, so that it
expands to an empty string if padding isn't required.

Yes, I don't know if say IMAGE_PAD ?= "" and having boards set that to
- --pad-to=... or just saying --pad-to=$(PAD_SIZE) and PAD_SIZE ?= 0x1 ends up looking cleaner once all is said and done. First one to try both and patch... :)

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQWlfyAAoJENk4IS6UOR1W4X0P/04JTA9358iiOXrJKUxeZAR0 pVJCzmdiQrlD2Xo7SlApe0s2ZvZL4UvTivmYPlFDcLhpI+ZSkfxHdvXLKNmg//h6 L2ghpAsRtUwZTYgxY1WMvJUuVeh/Pzy8dmJhf5AHwnQ2jAw+SMo3X9jc4e7srCEw 6eSbk/UwG/5WMpLTbUDEp2t9vmSpTkREhv9QvFVeKAzBrSF0fv/OohFIKEx/uuws HxgXkkzWLox8sp1rCclrNMEFL/EInqa3OSlkF0e2N3514ETHdqBL52qhPWASEz5G gCHDruxcGTacr1a2ssxURLm5org6ZxlEzywDTluNTnt0VPTOAqCoSLiKL87RQeYB PrQRWli3r888P+ZG1aOr5OwTxBrgYiynzOGUTkw7FQkf7vF3ak1E2Hvm/7GQCouG Fm/9aZRDovSk09rbBP7k8M0efV7D5J7PDzRZ6oruIQR6EJu2x64ILyir9HATAUMd GSjgCDV0BmXYgUJ5I+bLAC/pY9i+aito4lc0Faa1R839tyvP3rvhpFwmAxgOY+97 iFSvpadj0qju/dOouzM250YzLC8a97rvpHQArW4mWw7XPnOh0wSNsfuP/KSrKUUi YA6gB3DBjUuvT9qTwfwrd/zcYYvZ77nSzlPMcfGOvkpphK+yamv/qogNp7p0Kw43 PtAX09fpq65iVat0ZXtX
=DPv4
-----END PGP SIGNATURE-----

#26 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Tom & Scott,

Quoted 49 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 45 lines · Scott Wood
Quoted 44 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 33 lines · Scott Wood
Quoted 17 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

--- Changes for v2: - None

Changes for v3: - Changed new binary target name from u-boot-ubl.bin to u-boot-pad.bin

Changes for v4: - None --- Makefile | 11 ++++++----- 1 file
changed, 6 insertions(+), 5 deletions(-)

Makefile index 8738d55..86dedca renamed from Makefile +0 -0

100644 --- a/Makefile +++ b/Makefile @@ -433,14 +433,15 @@
$(obj)u-boot.sha1: $(obj)u-boot.bin $(obj)u-boot.dis:
$(obj)u-boot $(OBJDUMP) -d $< > $@

Quoted 12 lines

-$(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin
$(obj)u-boot.bin +$(obj)u-boot-pad.bin:
$(obj)spl/u-boot-spl.bin $(obj)u-boot.bin $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin - cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin >
$(obj)u-boot-ubl.bin - $(obj)tools/mkimage -n
$(UBL_CONFIG) -T ublimage \ - -e
$(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin
$(obj)u-boot.ubl - rm $(obj)u-boot-ubl.bin + cat
$(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-pad.bin rm $(obj)spl/u-boot-spl-pad.bin

This rule lists u-boot-spl.bin as a prerequisite, but it doesn't appear to use it -- it uses u-boot-spl instead.

Quoted 5 lines

It seems that either spl/Makefile should produce u-boot-spl rather than u-boot-spl.bin and let the toplevel Makefile deal with converting it to a binary, or spl/Makefile should take care of adding any needed padding for the target and the final rule should just be a concatenation.

So, if we use a weak PAD_TO value of say 0x1, we could always "pad" u-boot-spl.bin out and then do the concatenation here and in a few other targets as well.

Quoted 7 lines
Quoted 2 lines

Yes, or use a variable that includes the linker option, so that it
expands to an empty string if padding isn't required.

Yes, I don't know if say IMAGE_PAD ?= "" and having boards set that to
- --pad-to=... or just saying --pad-to=$(PAD_SIZE) and PAD_SIZE ?= 0x1 ends up looking cleaner once all is said and done. First one to try both and patch... :)

Please check the following patch. It seems to work for me...

Makefile +0 -2
index 8738d55..fad8b33 100644
@@ -433,13 +433,12 @@ $(obj)u-boot.sha1: $(obj)u-boot.bin
  $(obj)u-boot.dis:    $(obj)u-boot
          $(OBJDUMP) -d $< > $@
 
-$(obj)u-boot.ubl:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
-        $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary 

$(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin
- cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin >
$(obj)u-boot-ubl.bin
+$(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
+ cat $^ > $@
+
+$(obj)u-boot.ubl: $(obj)u-boot-with-spl.bin

          $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
-        -e $(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin $(obj)u-boot.ubl
-        rm $(obj)u-boot-ubl.bin
-        rm $(obj)spl/u-boot-spl-pad.bin
+        -e $(CONFIG_SYS_TEXT_BASE) -d $< $@

$(obj)u-boot.ais: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img

          $(obj)tools/mkimage -s -n /dev/null -T aisimage \
spl/Makefile +2 -0
index f96c08e..6ea9f26 100644
@@ -23,6 +23,8 @@ include $(TOPDIR)/config.mk
  # We want the final binaries in this directory
  obj := $(OBJTREE)/spl/
 
+PAD_TO ?= 1
+
  HAVE_VENDOR_COMMON_LIB := $(shell [ -f 
$(SRCTREE)/board/$(VENDOR)/common/Makefile ] \
              && echo y || echo n)

@@ -124,7 +126,7 @@ $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin
endif

$(obj)u-boot-spl.bin: $(obj)u-boot-spl
- $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
+ $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@

  GEN_UBOOT = \
      UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \

Best regards,
Jos? Gon?alves

#27 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 93 lines · Jos? Miguel Gon?alves

Tom & Scott,

Quoted 49 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 46 lines · Scott Wood
Quoted 45 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 33 lines · Scott Wood
Quoted 17 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

Signed-off-by: Jos? Miguel Gon?alves <[email protected]> --- Changes for v2: - None

Changes for v3: - Changed new binary target name from u-boot-ubl.bin to u-boot-pad.bin

Changes for v4: - None --- Makefile | 11 ++++++----- 1
file changed, 6 insertions(+), 5 deletions(-)

Makefile index 8738d55..86dedca renamed from Makefile +0 -0

100644 --- a/Makefile +++ b/Makefile @@ -433,14 +433,15
@@ $(obj)u-boot.sha1: $(obj)u-boot.bin
$(obj)u-boot.dis: $(obj)u-boot $(OBJDUMP) -d $< > $@

Quoted 12 lines

-$(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin
$(obj)u-boot.bin +$(obj)u-boot-pad.bin:
$(obj)spl/u-boot-spl.bin $(obj)u-boot.bin $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin - cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin >
$(obj)u-boot-ubl.bin - $(obj)tools/mkimage -n
$(UBL_CONFIG) -T ublimage \ - -e
$(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin
$(obj)u-boot.ubl - rm $(obj)u-boot-ubl.bin + cat
$(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-pad.bin rm $(obj)spl/u-boot-spl-pad.bin

This rule lists u-boot-spl.bin as a prerequisite, but it doesn't appear to use it -- it uses u-boot-spl instead.

Quoted 6 lines

It seems that either spl/Makefile should produce u-boot-spl rather than u-boot-spl.bin and let the toplevel Makefile deal with converting it to a binary, or spl/Makefile should take care of adding any needed padding for the target and the final rule should just be a concatenation.

So, if we use a weak PAD_TO value of say 0x1, we could always "pad" u-boot-spl.bin out and then do the concatenation here and in a few other targets as well.

Quoted 7 lines
Quoted 2 lines

Yes, or use a variable that includes the linker option, so that it expands to an empty string if padding isn't required.

Yes, I don't know if say IMAGE_PAD ?= "" and having boards set that to - --pad-to=... or just saying --pad-to=$(PAD_SIZE) and PAD_SIZE ?= 0x1 ends up looking cleaner once all is said and done. First one to try both and patch... :)

Please check the following patch. It seems to work for me...

Makefile index 8738d55..fad8b33 100644 --- renamed from Makefile +0 -0

a/Makefile +++ b/Makefile @@ -433,13 +433,12 @@ $(obj)u-boot.sha1:
$(obj)u-boot.bin $(obj)u-boot.dis: $(obj)u-boot $(OBJDUMP) -d $<

Quoted 1 line

$@

-$(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary
$(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin - cat
$(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-ubl.bin +$(obj)u-boot-with-spl.bin:
$(obj)spl/u-boot-spl.bin $(obj)u-boot.bin + cat $^ > $@ +
+$(obj)u-boot.ubl: $(obj)u-boot-with-spl.bin
$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ - -e
$(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin $(obj)u-boot.ubl -
rm $(obj)u-boot-ubl.bin - rm $(obj)spl/u-boot-spl-pad.bin +
-e $(CONFIG_SYS_TEXT_BASE) -d $< $@

$(obj)u-boot.ais: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
$(obj)tools/mkimage -s -n /dev/null -T aisimage \ diff --git a/spl/Makefile b/spl/Makefile index f96c08e..6ea9f26 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -23,6 +23,8 @@ include $(TOPDIR)/config.mk # We want the final binaries in this directory obj := $(OBJTREE)/spl/

+PAD_TO ?= 1 + HAVE_VENDOR_COMMON_LIB := $(shell [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \ && echo y || echo
n)

Makefile index 8738d55..fad8b33 100644 --- renamed from Makefile +0 -0
@@ -124,7 +126,7 @@ $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin 

endif

Quoted 5 lines

$(obj)u-boot-spl.bin: $(obj)u-boot-spl - $(OBJCOPY)
$(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) ${OBJCFLAGS}
--pad-to=$(PAD_TO) -O binary $< $@

GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \

Tom W, since I'd like you to upgrade the tegra rules after this change goes in (since they do a u-boot-spl.bin + pad + u-boot.bin + stuff), does this look good to you as well? Thanks!

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQWnFxAAoJENk4IS6UOR1WybcQALKP61eZDe4AZCuhacsvFIiX EWpA4YLSDTA6Z419lkgN7qJoIKbm0lqOvlp8jyWGMgmkUjY/omGEbDjJdqRx3Fmy Hd937BU9VvUBB11S6qC/FcEpP6vC+yiSCHq9GgQ27q1qxFfnn2uzo5xODdV6XaiW mBZ4hzbLOJFxM3BVNlBAH2T/4OhVuRRucGYt68Su3EOgcbe3qd0YCHyTLuZl/k8Z HIDaKku5lgHa2BZT1JjDkRai/QuJhX53EBONc1n/S+fQr1IjXcvcppu8h4x65W8Q Rb8FKjDbUTuAvksCC/uqPJ59oMhctcmws2ywnRnGo5y097GKyl1zxyuqY5CZMSnu voJrzuIQpdPp48cXQuMHQx9z5kPmM+ohsDT9/s80AjXdS/2XqwQQjelWosn1krUi cgEq2IrtTqpiBqrYrEf1nidVJluf1VBKtCV4XRHYd6sSEteimrMu+qfLN/42U+CF tiFWqjMVpW2SCHUFogYUzARaQ/NXCYvDF1FFvnBmUWd/C9haiHqBUPba3HO/rlmb dsFM2RcMNX2CKeikA/Tdb4gwCB9wYsjJNQynE3h8BShaCbA04gYT6K1SRXSDiOuO LQuqrkLsNiL/DrqH3Trvxaxxsy0yGrs9jANfcyPlNbV+A4DKsJK6RX4MP8oYLKoV OzeS14a1CjZci5FyGgB/
=4cKu
-----END PGP SIGNATURE-----

#28 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 106 lines

-----Original Message-----
From: Tom Rini [mailto:trini at ti.com]
Sent: Wednesday, September 19, 2012 6:29 PM
To: Jos? Miguel Gon?alves
Cc: Scott Wood; u-boot at lists.denx.de; marex at denx.de; mk7.kang at samsung.com; Tom Warren
Subject: Re: [PATCH v4 10/11] Add u-boot-pad.bin target to the Makefile

* PGP Signed by an unknown key

Quoted 95 lines · Jos? Miguel Gon?alves

Tom & Scott,

Quoted 48 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 45 lines · Scott Wood
Quoted 44 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 33 lines · Scott Wood
Quoted 17 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

Changes for v2: - None

Changes for v3: - Changed new binary target name from u-boot-ubl.bin to u-boot-pad.bin

Changes for v4: - None --- Makefile | 11 ++++++----- 1
file changed, 6 insertions(+), 5 deletions(-)

Makefile index 8738d55..86dedca renamed from Makefile +0 -0

100644 --- a/Makefile +++ b/Makefile @@ -433,14 +433,15
@@ $(obj)u-boot.sha1: $(obj)u-boot.bin
$(obj)u-boot.dis: $(obj)u-boot $(OBJDUMP) -d $< > $@

Quoted 12 lines

-$(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin
$(obj)u-boot.bin +$(obj)u-boot-pad.bin:
$(obj)spl/u-boot-spl.bin $(obj)u-boot.bin $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin - cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin >
$(obj)u-boot-ubl.bin - $(obj)tools/mkimage -n
$(UBL_CONFIG) -T ublimage \ - -e
$(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin
$(obj)u-boot.ubl - rm $(obj)u-boot-ubl.bin + cat
$(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-pad.bin rm $(obj)spl/u-boot-spl-pad.bin

This rule lists u-boot-spl.bin as a prerequisite, but it doesn't appear to use it -- it uses u-boot-spl instead.

Quoted 5 lines

It seems that either spl/Makefile should produce u-boot-spl rather than u-boot-spl.bin and let the toplevel Makefile deal with converting it to a binary, or spl/Makefile should take care of adding any needed padding for the target and the final rule should just be a concatenation.

So, if we use a weak PAD_TO value of say 0x1, we could always "pad" u-boot-spl.bin out and then do the concatenation here and in a few other targets as well.

Quoted 7 lines
Quoted 2 lines

Yes, or use a variable that includes the linker option, so that it expands to an empty string if padding isn't required.

Yes, I don't know if say IMAGE_PAD ?= "" and having boards set that to - --pad-to=... or just saying --pad-to=$(PAD_SIZE) and PAD_SIZE ?= 0x1 ends up looking cleaner once all is said and done. First one to try both and patch... :)

Please check the following patch. It seems to work for me...

Makefile index 8738d55..fad8b33 100644 --- renamed from Makefile +0 -0

a/Makefile +++ b/Makefile @@ -433,13 +433,12 @@ $(obj)u-boot.sha1:
$(obj)u-boot.bin $(obj)u-boot.dis: $(obj)u-boot $(OBJDUMP) -d $<

Quoted 1 line

$@

-$(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary
$(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin - cat
$(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-ubl.bin +$(obj)u-boot-with-spl.bin:
$(obj)spl/u-boot-spl.bin $(obj)u-boot.bin + cat $^ > $@ +
+$(obj)u-boot.ubl: $(obj)u-boot-with-spl.bin
$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ - -e
$(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin $(obj)u-boot.ubl -
rm $(obj)u-boot-ubl.bin - rm $(obj)spl/u-boot-spl-pad.bin +
-e $(CONFIG_SYS_TEXT_BASE) -d $< $@

$(obj)u-boot.ais: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
$(obj)tools/mkimage -s -n /dev/null -T aisimage \ diff --git a/spl/Makefile b/spl/Makefile index f96c08e..6ea9f26 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -23,6 +23,8 @@ include $(TOPDIR)/config.mk # We want the final binaries in this directory obj := $(OBJTREE)/spl/

+PAD_TO ?= 1 + HAVE_VENDOR_COMMON_LIB := $(shell [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \ && echo y || echo
n)

Makefile index 8738d55..fad8b33 100644 --- renamed from Makefile +0 -1
@@ -124,7 +126,7 @@ $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin endif
 
 $(obj)u-boot-spl.bin:    $(obj)u-boot-spl -    $(OBJCOPY)
 $(OBJCFLAGS) -O binary $< $@ +    $(OBJCOPY) ${OBJCFLAGS}
--pad-to=$(PAD_TO) -O binary $< $@
 
Quoted 5 lines

Makefile index 8738d55..fad8b33 100644 --- $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin endif · line 130

Quoted 1 line
Makefile index 8738d55..fad8b33 100644 --- renamed from Makefile +0 -0
 GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \

Tom W, since I'd like you to upgrade the tegra rules after this change goes in (since they do a u-boot-spl.bin + pad + u-boot.bin + stuff), does this look good to you as well? Thanks!

I'm not clear what you want the final binary names to be. I seem to be missing segments of this discussion - maybe not CC'd on all threads?

With Tegra, if you flash u-boot.bin, you'll get a DT-less, non-functional binary that will print a 'DT missing!' message and reset ad infinitum. Most folks won't see or care about u-boot-spl.bin, since it's hidden in the spl/ subdir. I don't see the use of having a 'u-boot-with-spl.bin' - doesn't u-boot-spl.bin say the same thing?

If you flash u-boot-dtb-tegra.bin, you'll get a fully functioning U-Boot. There's an intermediate file (u-boot-dtb.bin) that I assume is u-boot.bin+dtb - I'm not sure why it's left around - Allen could comment here.

So in my eyes, all you really need is u-boot-dtb-tegra.bin - an unwieldy name, to be sure, but it seems to satisfy your request for a Soc identifier in the name. I voted for just having u-boot.bin be the final product, since that's what most devs look for after a build, but didn't win that battle. I will probably never use the intermediate binaries, as I'm not likely to paste different DTBs onto base u-boot binaries, etc., or if I did, I'd expect that'd be done in a Makefile, or the user that requires a different DTB appended outside of the normal one could hack the Makefile themselves.

Not to be too difficult, but could you take the Tegra binary section of Makefile and tell me exactly what it is you and/or Jose are proposing the change(s) be?

Thanks,

Tom

Quoted 6 lines

--
Tom

* Unknown Key
* 0x94391D56(L)

Signature · 1 line
nvpublic
#29 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 123 lines · Tom Warren
Quoted 116 lines

-----Original Message----- From: Tom Rini [mailto:trini at ti.com]
Sent: Wednesday, September 19, 2012 6:29 PM To: Jos? Miguel Gon?alves Cc: Scott Wood; u-boot at lists.denx.de; marex at denx.de; mk7.kang at samsung.com; Tom Warren Subject: Re: [PATCH v4 10/11] Add u-boot-pad.bin target to the Makefile

* PGP Signed by an unknown key

Quoted 107 lines · Jos? Miguel Gon?alves

Tom & Scott,

Quoted 54 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 51 lines · Scott Wood
Quoted 50 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 38 lines · Scott Wood
Quoted 20 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to
generate a binary image with a padded SPL
concatenated with U-Boot.

Signed-off-by: Jos? Miguel Gon?alves <[email protected]> --- Changes for v2: - None

Changes for v3: - Changed new binary target name from u-boot-ubl.bin to u-boot-pad.bin

Changes for v4: - None --- Makefile | 11
++++++----- 1 file changed, 6 insertions(+), 5
deletions(-)

Makefile index renamed from Makefile +0 -0

8738d55..86dedca 100644 --- a/Makefile +++ b/Makefile @@ -433,14 +433,15 @@ $(obj)u-boot.sha1:
$(obj)u-boot.bin $(obj)u-boot.dis: $(obj)u-boot $(OBJDUMP) -d $< > $@

Quoted 12 lines

-$(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin
$(obj)u-boot.bin +$(obj)u-boot-pad.bin:
$(obj)spl/u-boot-spl.bin $(obj)u-boot.bin $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin - cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin >
$(obj)u-boot-ubl.bin - $(obj)tools/mkimage -n
$(UBL_CONFIG) -T ublimage \ - -e
$(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin
$(obj)u-boot.ubl - rm $(obj)u-boot-ubl.bin +
cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-pad.bin rm $(obj)spl/u-boot-spl-pad.bin

This rule lists u-boot-spl.bin as a prerequisite, but it doesn't appear to use it -- it uses u-boot-spl instead.

Quoted 6 lines

It seems that either spl/Makefile should produce u-boot-spl rather than u-boot-spl.bin and let the toplevel Makefile deal with converting it to a binary, or spl/Makefile should take care of adding any needed padding for the target and the final rule should just be a concatenation.

So, if we use a weak PAD_TO value of say 0x1, we could always "pad" u-boot-spl.bin out and then do the concatenation here and in a few other targets as well.

Quoted 9 lines
Quoted 3 lines

Yes, or use a variable that includes the linker option, so that it expands to an empty string if padding isn't required.

Yes, I don't know if say IMAGE_PAD ?= "" and having boards set that to - --pad-to=... or just saying --pad-to=$(PAD_SIZE) and PAD_SIZE ?= 0x1 ends up looking cleaner once all is said and done. First one to try both and patch... :)

Please check the following patch. It seems to work for me...

Makefile index 8738d55..fad8b33 100644 renamed from Makefile +0 -1
--- a/Makefile +++ b/Makefile @@ -433,13 +433,12 @@ 

$(obj)u-boot.sha1: $(obj)u-boot.bin $(obj)u-boot.dis:
$(obj)u-boot $(OBJDUMP) -d $<

Quoted 1 line

$@

-$(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin
$(obj)u-boot.bin - $(OBJCOPY) ${OBJCFLAGS}
--pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl
$(obj)spl/u-boot-spl-pad.bin - cat
$(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-ubl.bin +$(obj)u-boot-with-spl.bin:
$(obj)spl/u-boot-spl.bin $(obj)u-boot.bin + cat $^ > $@
+ +$(obj)u-boot.ubl: $(obj)u-boot-with-spl.bin
$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ - -e
$(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin
$(obj)u-boot.ubl - rm $(obj)u-boot-ubl.bin - rm
$(obj)spl/u-boot-spl-pad.bin + -e $(CONFIG_SYS_TEXT_BASE) -d $< $@

$(obj)u-boot.ais: $(obj)spl/u-boot-spl.bin
$(obj)u-boot.img $(obj)tools/mkimage -s -n /dev/null -T aisimage \ diff --git a/spl/Makefile b/spl/Makefile index f96c08e..6ea9f26 100644 --- a/spl/Makefile +++ b/spl/Makefile

Makefile index 8738d55..fad8b33 100644 renamed from Makefile +0 -0
@@ -23,6 +23,8 @@ include $(TOPDIR)/config.mk # We want the 

final binaries in this directory obj := $(OBJTREE)/spl/

+PAD_TO ?= 1 + HAVE_VENDOR_COMMON_LIB := $(shell [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \ && echo y || echo n)

Makefile index 8738d55..fad8b33 100644 renamed from Makefile +0 -0
@@ -124,7 +126,7 @@ $(obj)$(BOARD)-spl.bin: 

$(obj)u-boot-spl.bin endif

$(obj)u-boot-spl.bin: $(obj)u-boot-spl - $(OBJCOPY)
$(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) ${OBJCFLAGS}
--pad-to=$(PAD_TO) -O binary $< $@

Quoted 6 lines
Quoted 1 line

GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \

Tom W, since I'd like you to upgrade the tegra rules after this change goes in (since they do a u-boot-spl.bin + pad + u-boot.bin + stuff), does this look good to you as well? Thanks!

Quoted 3 lines

I'm not clear what you want the final binary names to be. I seem to be missing segments of this discussion - maybe not CC'd on all threads?

Sorry, I'm just asking if this way of padding u-boot-spl.bin to the required size by default in spl/Makefile and then not doing any
- --pad-to in the toplevel Makefile rules for u-boot-spl will work for your needs as well (so update the existing rules to just concatenate spl/u-boot-spl.bin and u-boot.bin and whatever else you need and have PAD_TO be set to $(CONFIG_SYS_TEXT_BASE), I believe).

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQW0LyAAoJENk4IS6UOR1Wst8P/2IhNv0s3YKGp2r8ze4TWKaJ rMxHs9KQ+ZHcemZuD4jWkx+Ms1pZrZlKDbF2lG622n+FsgTvXP8xSyBZCB0sV0J9 wVUQR8QB6EHrdw5pOhMn7T4y3+sy61l/E50NQHU5Nu2sA7t5g/xQH95gslN9b1yv VNhX/sdISna8lEqJPF5Iuxuc9Cl7huEbSCpu/uETQZVqHfKDxkp7mZDcOHq0JJ4q 150WwOQhNKNgtX1AV9D2vcDHMRO6AOXE1cH/jMv9CBoPMkeJaW1EaGHTv8PrKeUG ONN8fCEcdTEPvv6XXk3DLXVDFruAG7jk7bQr7B59nr5NVwuxZkZKOGn4o07stTBK c2ixDbsS8K4BIlDrAMckd4pyjAWVE0bN8lDfOKvJtxMDSjMj+EagiDnPkAsnzJAB Usml6rpIuBNLC2l4MZsYEihNHk0I10/M328c0kKUwWmT4UI3GB8V/sti1OUOyAoy DBy9dH7U/aPVr72aXLcBf8vDdA3abHmHt6zLq4KDMw4+xBLmsqmALYvOOoGSdW9S X5C6d6xpQVt5ovvSV8IZkT3rKUFAhmjcLgjwxKam3eTuSEyapZAJPji9h1Bl2PMB UqR6MP8RceP9OqkSXhyCK6reFq6KCtsvGMdPnYs2uY2dZVjqMwtxPNWE1W39LqhU VCbg1HKz/kmpmS9gQqRt
=qd5a
-----END PGP SIGNATURE-----

#30 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Tom,

Quoted 130 lines

-----Original Message-----
From: Tom Rini [mailto:trini at ti.com]
Sent: Thursday, September 20, 2012 9:23 AM
To: Tom Warren
Cc: Jos? Miguel Gon?alves; Scott Wood; u-boot at lists.denx.de; marex at denx.de; mk7.kang at samsung.com
Subject: Re: [PATCH v4 10/11] Add u-boot-pad.bin target to the Makefile

* PGP Signed by an unknown key

Quoted 116 lines · Tom Warren
Quoted 109 lines

-----Original Message----- From: Tom Rini [mailto:trini at ti.com]
Sent: Wednesday, September 19, 2012 6:29 PM To: Jos? Miguel Gon?alves
Cc: Scott Wood; u-boot at lists.denx.de; marex at denx.de; mk7.kang at samsung.com; Tom Warren Subject: Re: [PATCH v4 10/11] Add u-boot-pad.bin target to the Makefile

Quoted 1 line

Old Signed by an unknown key

Quoted 100 lines · Jos? Miguel Gon?alves

Tom & Scott,

Quoted 51 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 48 lines · Scott Wood
Quoted 47 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 36 lines · Scott Wood
Quoted 19 lines · Jos? Miguel Gon?alves

Samsung's S3C24XX SoCs need this in order to generate a binary image with a padded SPL concatenated with U-Boot.

--- Changes for v2: - None

Changes for v3: - Changed new binary target name from u-boot-ubl.bin to u-boot-pad.bin

Changes for v4: - None --- Makefile | 11
++++++----- 1 file changed, 6 insertions(+), 5
deletions(-)

Makefile index 8738d55..86dedca 100644 renamed from Makefile +0 -1
--- a/Makefile +++ b/Makefile @@ -433,14 +433,15 @@

$(obj)u-boot.sha1:
$(obj)u-boot.bin $(obj)u-boot.dis: $(obj)u-boot
$(OBJDUMP) -d $< > $@

Quoted 12 lines

-$(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin
$(obj)u-boot.bin +$(obj)u-boot-pad.bin:
$(obj)spl/u-boot-spl.bin $(obj)u-boot.bin $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin - cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin >
$(obj)u-boot-ubl.bin - $(obj)tools/mkimage -n
$(UBL_CONFIG) -T ublimage \ - -e
$(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin
$(obj)u-boot.ubl - rm $(obj)u-boot-ubl.bin +
cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-pad.bin rm $(obj)spl/u-boot-spl-pad.bin

This rule lists u-boot-spl.bin as a prerequisite, but it doesn't appear to use it -- it uses u-boot-spl instead.

Quoted 5 lines

It seems that either spl/Makefile should produce u-boot-spl rather than u-boot-spl.bin and let the toplevel Makefile deal with converting it to a binary, or spl/Makefile should take care of adding any needed padding for the target and the final rule should just be a concatenation.

So, if we use a weak PAD_TO value of say 0x1, we could always "pad" u-boot-spl.bin out and then do the concatenation here and in a few other targets as well.

Quoted 7 lines
Quoted 2 lines

Yes, or use a variable that includes the linker option, so that it expands to an empty string if padding isn't required.

Yes, I don't know if say IMAGE_PAD ?= "" and having boards set that to - --pad-to=... or just saying
--pad-to=$(PAD_SIZE) and PAD_SIZE ?= 0x1 ends up looking cleaner once all is said and done. First one to try both and patch... :)

Please check the following patch. It seems to work for me...

Makefile index 8738d55..fad8b33 100644 renamed from Makefile +0 -1
--- a/Makefile +++ b/Makefile @@ -433,13 +433,12 @@

$(obj)u-boot.sha1: $(obj)u-boot.bin $(obj)u-boot.dis:
$(obj)u-boot $(OBJDUMP) -d $<

Quoted 1 line

$@

-$(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin
$(obj)u-boot.bin - $(OBJCOPY) ${OBJCFLAGS}
--pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl
$(obj)spl/u-boot-spl-pad.bin - cat
$(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $(obj)u-boot-ubl.bin +$(obj)u-boot-with-spl.bin:
$(obj)spl/u-boot-spl.bin $(obj)u-boot.bin + cat $^ > $@
+ +$(obj)u-boot.ubl: $(obj)u-boot-with-spl.bin
$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ - -e
$(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin
$(obj)u-boot.ubl - rm $(obj)u-boot-ubl.bin - rm
$(obj)spl/u-boot-spl-pad.bin + -e $(CONFIG_SYS_TEXT_BASE) -d $< $@

$(obj)u-boot.ais: $(obj)spl/u-boot-spl.bin
$(obj)u-boot.img $(obj)tools/mkimage -s -n /dev/null -T aisimage \

spl/Makefile index renamed from spl/Makefile +0 -0

f96c08e..6ea9f26 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -23,6 +23,8 @@ include $(TOPDIR)/config.mk # We want the final binaries in this directory obj := $(OBJTREE)/spl/

+PAD_TO ?= 1 + HAVE_VENDOR_COMMON_LIB := $(shell [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \ && echo y || echo n)

spl/Makefile index renamed from spl/Makefile +0 -0
@@ -124,7 +126,7 @@ $(obj)$(BOARD)-spl.bin:

$(obj)u-boot-spl.bin endif

$(obj)u-boot-spl.bin: $(obj)u-boot-spl - $(OBJCOPY)
$(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) ${OBJCFLAGS}
--pad-to=$(PAD_TO) -O binary $< $@

Quoted 6 lines
Quoted 1 line

GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \

Tom W, since I'd like you to upgrade the tegra rules after this change goes in (since they do a u-boot-spl.bin + pad + u-boot.bin + stuff), does this look good to you as well?
Thanks!

Quoted 2 lines

I'm not clear what you want the final binary names to be. I seem to be missing segments of this discussion - maybe not CC'd on all threads?

Quoted 6 lines

Sorry, I'm just asking if this way of padding u-boot-spl.bin to the required size by default in spl/Makefile and then not doing any --pad-to in the toplevel Makefile rules for u-boot-spl will work for your needs as well (so update the existing rules to just concatenate spl/u-boot-spl.bin and u- boot.bin and whatever else you need and have PAD_TO be set to $(CONFIG_SYS_TEXT_BASE), I believe).

That may work, but let's have Allen comment, since he did all the SPL work. If there's a proposed patch, I can take it and test it.

Tom

Quoted 6 lines

--
Tom

* Unknown Key
* 0x94391D56(L)

Signature · 1 line
nvpublic
#31 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

In reply to Tom Warren
Quoted 20 lines · Tom Warren
Quoted 5 lines

-----Original Message-----
From: Tom Rini [mailto:trini at ti.com]
Sent: Wednesday, September 19, 2012 6:29 PM
To: Jos? Miguel Gon?alves
Cc: Scott Wood; u-boot at lists.denx.de; marex at denx.de;

mk7.kang at samsung.com;

Quoted 2 lines

Tom Warren
Subject: Re: [PATCH v4 10/11] Add u-boot-pad.bin target to the

Makefile

Quoted 2 lines

Tom W, since I'd like you to upgrade the tegra rules after this

change goes

Quoted 1 line

in (since they do a u-boot-spl.bin + pad + u-boot.bin + stuff),

does this

Quoted 1 line

look good to you as well? Thanks!

I'm not clear what you want the final binary names to be. I seem to be missing segments of this discussion - maybe not CC'd on all threads?

Quoted 6 lines

With Tegra, if you flash u-boot.bin, you'll get a DT-less, non-functional binary that will print a 'DT missing!' message and reset ad infinitum. Most folks won't see or care about u-boot-spl.bin, since it's hidden in the spl/ subdir. I don't see the use of having a 'u-boot-with-spl.bin' - doesn't u-boot-spl.bin say the same thing?

u-boot-spl.bin is just the SPL. u-boot-with-spl.bin is SPL plus u-boot.

Or maybe the former could just become spl.bin, and then u-boot-spl.bin could mean the latter? There's really no reason to put "u-boot" in the name of every intermediate file that represents something more specific.

Quoted 4 lines

If you flash u-boot-dtb-tegra.bin, you'll get a fully functioning U-Boot. There's an intermediate file (u-boot-dtb.bin) that I assume is u-boot.bin+dtb - I'm not sure why it's left around - Allen could comment here.

It's useful to leave intermediate files around for debugging.

Quoted 3 lines

So in my eyes, all you really need is u-boot-dtb-tegra.bin - an unwieldy name, to be sure, but it seems to satisfy your request for a Soc identifier in the name.

If the only thing Tegra-specific about the output format is that it has a dtb bundled, I think it should have a more generic name, as other targets could end up using a dtb as well.

-Scott

#32 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 22 lines · Scott Wood
Quoted 12 lines · Tom Warren
Quoted 11 lines

-----Original Message-----
From: Tom Rini [mailto:trini at ti.com]
Sent: Wednesday, September 19, 2012 6:29 PM
To: Jos? Miguel Gon?alves
Cc: Scott Wood; u-boot at lists.denx.de; marex at denx.de; mk7.kang at samsung.com; Tom Warren
Subject: Re: [PATCH v4 10/11] Add u-boot-pad.bin target to the Makefile

Tom W, since I'd like you to upgrade the tegra rules after this change goes in (since they do a u-boot-spl.bin + pad + u-boot.bin + stuff), does this look good to you as well? Thanks!

Quoted 8 lines

I'm not clear what you want the final binary names to be. I seem to be missing segments of this discussion - maybe not CC'd on all threads?

With Tegra, if you flash u-boot.bin, you'll get a DT-less, non-functional binary that will print a 'DT missing!' message and reset ad infinitum. Most folks won't see or care about u-boot-spl.bin, since it's hidden in the spl/ subdir. I don't see the use of having a 'u-boot-with-spl.bin' - doesn't u-boot-spl.bin say the same thing?

Quoted 5 lines

u-boot-spl.bin is just the SPL. u-boot-with-spl.bin is SPL plus u-boot.

Or maybe the former could just become spl.bin, and then u-boot-spl.bin could mean the latter? There's really no reason to put "u-boot" in the name of every intermediate file that represents something more specific.

So, before I resubmit my patch, can you please tell me what should be the name for the file with SPL plus u-boot;

1) u-boot-with-spl.bin
2) u-boot-spl.bin (and rename the SPL only file to 'spl.bin')
3) ???

Quoted 5 lines
Quoted 4 lines

If you flash u-boot-dtb-tegra.bin, you'll get a fully functioning U-Boot. There's an intermediate file (u-boot-dtb.bin) that I assume is u-boot.bin+dtb - I'm not sure why it's left around - Allen could comment here.

Quoted 10 lines

It's useful to leave intermediate files around for debugging.

Quoted 2 lines

So in my eyes, all you really need is u-boot-dtb-tegra.bin - an unwieldy name, to be sure, but it seems to satisfy your request for a Soc identifier in the name.

If the only thing Tegra-specific about the output format is that it has a dtb bundled, I think it should have a more generic name, as other targets could end up using a dtb as well.

Best regards,
Jos? Gon?alves

#33 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

In reply to Tom Warren

Dear Tom,

Quoted 5 lines · In message <[email protected]>…

If you flash u-boot-dtb-tegra.bin, you'll get a fully functioning U-Boot. There's an intermediate file (u-boot-dtb.bin) that I assume is u-boot.bin+dtb - I'm not sure why it's left around - Allen could comment here.

I _dislike_ the idea of having image names which include architecture or even board parts. I would really like to have generic names, that can be used in a consistent way across platforms, architectures and boards.

Quoted 3 lines

So in my eyes, all you really need is u-boot-dtb-tegra.bin - an unwieldy name, to be sure, but it seems to satisfy your request for a Soc identifier in the name. I voted for just having u-boot.bin be the

Please reconsider. I definitely do NOT want to have SoC names or that in any such images!

IIRC, the original idea was to provide image names (common for all architectures, SoCs, boards) that only depend on where you install U-Boot to. in this way, we would have:

- u-boot.bin for the generic case (say, for installation into NOR
flash, no SPL or similar needed).
- u-boot-nand.bin
for installation in NAND (with all needed headers, padding etc. included)
- u-boot-onenand.bin
for installation in OneNAND
- u-boot.sd for installation on a SDCard
[actually we have an inconsistency in names here; this should have been "u-boot-sd.bin" or maybe even better "u-boot-sdcard.bin"]
etc.

It is very important to me that we do NOT include any architectures, SoCs, or board specifc parts in the names because this will cause major PITA for all kind of automatic test suites etc.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"He was so narrow minded he could see through  a  keyhole  with  both
eyes ..."
#34 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Hi Wolfgang,

Quoted 36 lines · Wolfgang Denk

Dear Tom,

Quoted 4 lines · In message <[email protected]>…

If you flash u-boot-dtb-tegra.bin, you'll get a fully functioning U-Boot. There's an intermediate file (u-boot-dtb.bin) that I assume is u-boot.bin+dtb - I'm not sure why it's left around - Allen could comment here.

I _dislike_ the idea of having image names which include architecture or even board parts. I would really like to have generic names, that can be used in a consistent way across platforms, architectures and boards.

Quoted 3 lines

So in my eyes, all you really need is u-boot-dtb-tegra.bin - an unwieldy name, to be sure, but it seems to satisfy your request for a Soc identifier in the name. I voted for just having u-boot.bin be the

Please reconsider. I definitely do NOT want to have SoC names or that in any such images!

IIRC, the original idea was to provide image names (common for all architectures, SoCs, boards) that only depend on where you install U-Boot to. in this way, we would have:

- u-boot.bin for the generic case (say, for installation into NOR
flash, no SPL or similar needed).
- u-boot-nand.bin
for installation in NAND (with all needed headers, padding etc. included)
- u-boot-onenand.bin
for installation in OneNAND
- u-boot.sd for installation on a SDCard
[actually we have an inconsistency in names here; this should have been "u-boot-sd.bin" or maybe even better "u-boot-sdcard.bin"]
etc.

Quoted 4 lines

It is very important to me that we do NOT include any architectures, SoCs, or board specifc parts in the names because this will cause major PITA for all kind of automatic test suites etc.

To me this seems also a cleaner solution, as any end user, that simply takes the u-boot sources and performs a make, would easily find the appropriate file to burn on his boot media.

But in that case, as the NAND image format (for instance) is architecture and/or SoC dependant, what do you suggest is to add conditionals in the Makefile that adequate the 'u-boot-nand.bin' file to the target SoC?

Best regards,
Jos? Gon?alves

#35 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Dear Jos? Miguel Gon?alves,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 4 lines

It is very important to me that we do NOT include any architectures, SoCs, or board specifc parts in the names because this will cause major PITA for all kind of automatic test suites etc.

Quoted 8 lines

To me this seems also a cleaner solution, as any end user, that simply takes the u-boot sources and performs a make, would easily find the appropriate file to burn on his boot media.

But in that case, as the NAND image format (for instance) is architecture and/or SoC dependant, what do you suggest is to add conditionals in the Makefile that adequate the 'u-boot-nand.bin' file to the target SoC?

SoC specific make rules can probably be added to the respective SoC specific makefiles, thus still avoiding to clutter the top level Makefile with lots of conditionals.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There comes to all races an ultimate crisis which  you  have  yet  to
face  ....  One  day  our  minds became so powerful we dared think of
ourselves as gods.
	-- Sargon, "Return to Tomorrow", stardate 4768.3
#36 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Dear Wolfgang Denk,

Quoted 11 lines

Dear Jos? Miguel Gon?alves,

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 3 lines

It is very important to me that we do NOT include any architectures, SoCs, or board specifc parts in the names because this will cause major PITA for all kind of automatic test suites etc.

To me this seems also a cleaner solution, as any end user, that simply takes the u-boot sources and performs a make, would easily find the appropriate file to burn on his boot media.

Quoted 8 lines
Quoted 4 lines

But in that case, as the NAND image format (for instance) is architecture and/or SoC dependant, what do you suggest is to add conditionals in the Makefile that adequate the 'u-boot-nand.bin' file to the target SoC?

SoC specific make rules can probably be added to the respective SoC specific makefiles, thus still avoiding to clutter the top level Makefile with lots of conditionals.

I've been pestering Tom about this a lot, but we got nowhere so far. That's the problem here :-(

Quoted 3 lines

Best regards,

Wolfgang Denk

Best regards,
Marek Vasut

#37 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

In reply to Wolfgang Denk

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 13 lines · Wolfgang Denk

Dear Jos? Miguel Gon?alves,

Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 5 lines

It is very important to me that we do NOT include any architectures, SoCs, or board specifc parts in the names because this will cause major PITA for all kind of automatic test suites etc.

To me this seems also a cleaner solution, as any end user, that simply takes the u-boot sources and performs a make, would easily find the appropriate file to burn on his boot media.

Quoted 8 lines
Quoted 4 lines

But in that case, as the NAND image format (for instance) is architecture and/or SoC dependant, what do you suggest is to add conditionals in the Makefile that adequate the 'u-boot-nand.bin' file to the target SoC?

SoC specific make rules can probably be added to the respective SoC specific makefiles, thus still avoiding to clutter the top level Makefile with lots of conditionals.

Ideally? Yes, Possible today? Not sure. I have a hazy recollection that it wasn't so easy when I tried adding some build rules to one of the config.mk files. When I post SPI SPL for am335x support I'll try again since for that I need to add a rule to generate a byte-swapped MLO file. If that can go somewhere other than spl/Makefile that would be nice (but needs to be visible to a number of TI SoCs is an issue).

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQXJIxAAoJENk4IS6UOR1WvRgP/1sA7S2GQUKx6v67zP/9aful 4YnamVKZkuutSuf/FKadLoK9NQbB4VOq6gXUcwbANlygiFVX9Ax9K6XC0JNYOSpm DeitwLu/ni9MduYM/11quwwfDWBKvIUO62cJcnRiDVSn3xyjJeEfr6lEHmgpcRx5 0wlVT183OurED18ZXZYRRKe1AxxEixVhk8XHMbBxrV01CbZckhjMgVfOCoVgIbtZ 8jo5NmW1b9TfT2FDPfEAVelpm8XTEKspVubgyE6C2uZosQOtgemMNNyTBhcAINX8 dTAed1aDJ/3ja7HEOCvnS5KtKrGnTIopWh5Q9JumrvpRYa72AXUkz2bBmWl/b4+E fZJMWoIaMh79gGcjBLU3rquCuY+zYxO9qXnKC8JaT5YnhGmIhHPFYDie1XU+9IQm EuJSzo8A3jM9TTURjmhIQ7svO6HcliuDU96HmjxKWdN/J7v+erKxy9XDwmn72R0Y oz8yQu+Sf85HAlmx5uoOZ+B8jinDxfZFseuQyrq4V8wUwTbxrFzHEelWvkSCfAn7 rr9ZjzCiCUymxpACp4YvLTultsiYIzbVevOliMbrO6ymsyByT6YmOO1eqSmsCkqq 2zXP0TZhdNgZVaGsYa+debvk7wjfTLlSqIUqKmOujPmwrtKXhGmxe9Cg4FpBbUuQ aG3hO/HSgMhBVpdS++60
=TSHS
-----END PGP SIGNATURE-----

#38 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 22 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 11 lines · Wolfgang Denk

Dear Jos? Miguel Gon?alves,

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 4 lines

It is very important to me that we do NOT include any architectures, SoCs, or board specifc parts in the names because this will cause major PITA for all kind of automatic test suites etc.

To me this seems also a cleaner solution, as any end user, that simply takes the u-boot sources and performs a make, would easily find the appropriate file to burn on his boot media.

Quoted 7 lines
Quoted 4 lines

But in that case, as the NAND image format (for instance) is architecture and/or SoC dependant, what do you suggest is to add conditionals in the Makefile that adequate the 'u-boot-nand.bin' file to the target SoC?

SoC specific make rules can probably be added to the respective SoC specific makefiles, thus still avoiding to clutter the top level Makefile with lots of conditionals.

Quoted 7 lines

Ideally? Yes, Possible today? Not sure. I have a hazy recollection that it wasn't so easy when I tried adding some build rules to one of the config.mk files. When I post SPI SPL for am335x support I'll try again since for that I need to add a rule to generate a byte-swapped MLO file. If that can go somewhere other than spl/Makefile that would be nice (but needs to be visible to a number of TI SoCs is an issue).

So what is your suggestion for my patch?
Can I push it with a new "u-boot-with-spl.bin" target and you'll handle the unification of all NAND targets later?

Best regards,
Jos? Gon?alves

#39 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 32 lines · Jos? Miguel Gon?alves
Quoted 22 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 12 lines · Wolfgang Denk

Dear Jos? Miguel Gon?alves,

Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 4 lines

It is very important to me that we do NOT include any architectures, SoCs, or board specifc parts in the names because this will cause major PITA for all kind of automatic test suites etc.

To me this seems also a cleaner solution, as any end user, that simply takes the u-boot sources and performs a make, would easily find the appropriate file to burn on his boot media.

Quoted 7 lines
Quoted 4 lines

But in that case, as the NAND image format (for instance) is
architecture and/or SoC dependant, what do you suggest is
to add conditionals in the Makefile that adequate the 'u-boot-nand.bin' file to the target SoC?

SoC specific make rules can probably be added to the respective SoC specific makefiles, thus still avoiding to clutter the top level Makefile with lots of conditionals.

Quoted 8 lines

Ideally? Yes, Possible today? Not sure. I have a hazy recollection that it wasn't so easy when I tried adding some build rules to one of the config.mk files. When I post SPI SPL for am335x support I'll try again since for that I need to add a rule to generate a byte-swapped MLO file. If that can go somewhere other than spl/Makefile that would be nice (but needs to be visible to a number of TI SoCs is an issue).

Quoted 3 lines

So what is your suggestion for my patch? Can I push it with a new "u-boot-with-spl.bin" target and you'll handle the unification of all NAND targets later?

Having said I'm terrible at names already, Scott suggested that one and Wolfgang didn't object, so yes, you add that target and the more general problem falls to me. I'll just outsource the naming parts of it :)

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQXJf5AAoJENk4IS6UOR1W8XwQAJ1KTaHrr2F0w1/qvFZdIIOM JJz9tWhYTiLRvrWhJfIgx3kwtflxzw6JQuLfwhOryf5/5W43ySRYPb+vHl1PBwq4 RlhwVdRUpPBZPWhuSrgajIi4P8z4OkaaW7v+YhkrNh1QQCbTQMO/RWYa66Xou6UJ hAsnCKJkTqOjpCxc2JeYL/hK/EUba7o4zYAU1H8sdVtch4hOvAJEMT9C/D6/Vxsq FyNB0+IMcomYavimjbTPLIVRUCpr2lt/8l5TTIPhjnqXUbSetrgysLn75ofKBU7Q db/cf+Ry2bFTGnQ8OdPU2FCwsqA905EU/WCjjX6/yUwRR3OpnJVkPi0DTqvEJ0YR gpADl5yy6VmCcZXRnPa1CGRyKv3vbRk333W4X2FgNCUES98BUM8L/qbbd29Tb5I7 KiaF6s5YoeDVCqMW7ER9a+BvvzD2YlHHcO4PwgOPu+xdkGbWxosxdKOgWRmTjR8X HQnuzwqT0X36unC5HpLxmzqHHxTomP02dil7eT+XHMNA6d/Jd61ByZvd2Lk/getw gALsACCcAZN/WtpA1s6DGYBX2/g/8pMul5Hf3tbAFseKumqeqd+ufcAEPgAQ/nKV 8sUz2DtFnmRsaukTkCl3aFexPr1upbQJh/EkopLq3uuHwKRxWymP2AQ/AAML7kYY 94pdwweLvRpb3AYvS5ZJ
=xeXW
-----END PGP SIGNATURE-----

#40 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

In reply to Tom Rini

Hello Tom,

Tom Rini wrote on?2012-09-21:

Quoted 10 lines
Quoted 3 lines

SoC specific make rules can probably be added to the respective SoC specific makefiles, thus still avoiding to clutter the top level Makefile with lots of conditionals.

Ideally? Yes, Possible today? Not sure. I have a hazy recollection that it wasn't so easy when I tried adding some build rules to one of the config.mk files. When I post SPI SPL for am335x support I'll try again since for that I need to add a rule to generate a byte-swapped MLO file. If that can go somewhere other than spl/Makefile that would be nice (but needs to be visible to a number of TI SoCs is an issue).

I have done something like this in a SoC config.mk:
<---

# only active in topdir
ifeq ($(subst $(SRCTREE),,$(CURDIR)),)

ALL-y += $(obj)u-boot-SoC-file

$(obj)u-boot-SoC-file: ...

	...

endif
--->

Without the check the rule(s) become active in all subdirs.

And of course this is a hack, as it is a Makefile fragment and not only a config anymore.

But maybe this gives you or someone else a hint for implementing a cleaner framework for SoC specific image rules?

Quoted 3 lines

- --
Tom

Best regards,
Thomas

#41 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

In reply to Wolfgang Denk
Quoted 43 lines · Wolfgang Denk

Dear Tom,

In message <[email protected]> you

Quoted 5 lines · wrote:

If you flash u-boot-dtb-tegra.bin, you'll get a fully functioning U-Boot. There's an intermediate file (u-boot-dtb.bin) that I assume is u-boot.bin+dtb - I'm not sure why it's left around - Allen could comment here.

I _dislike_ the idea of having image names which include architecture or even board parts. I would really like to have generic names, that can be used in a consistent way across platforms, architectures and boards.

Quoted 2 lines

So in my eyes, all you really need is u-boot-dtb-tegra.bin - an unwieldy name, to be sure, but it seems to satisfy your request for

a

Quoted 1 line

Soc identifier in the name. I voted for just having u-boot.bin be

the

Please reconsider. I definitely do NOT want to have SoC names or that in any such images!

IIRC, the original idea was to provide image names (common for all architectures, SoCs, boards) that only depend on where you install U-Boot to. in this way, we would have:

- u-boot.bin for the generic case (say, for installation into NOR
flash, no SPL or similar needed).
- u-boot-nand.bin
for installation in NAND (with all needed headers, padding etc. included)
- u-boot-onenand.bin
for installation in OneNAND
- u-boot.sd for installation on a SDCard
[actually we have an inconsistency in names here; this should have been "u-boot-sd.bin" or maybe even better "u-boot-sdcard.bin"]
etc.

Quoted 3 lines

It is very important to me that we do NOT include any architectures, SoCs, or board specifc parts in the names because this will cause major PITA for all kind of automatic test suites etc.

The awkwardness with naming based on nand/onenand/sd is that we no longer have build infrastructure that is specific to the type of boot device -- and IIRC with some of the newer SPL targets, the same image works on multiple types of boot device.

Having u-boot.bin be the final output regardless of internal implementation details such as spl would avoid that problem, and be even nicer to automated testing than the nand/onenand/sd names.

-Scott

#42 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Dear Scott Wood,

Quoted 59 lines · Wolfgang Denk
Quoted 52 lines

Dear Tom,

In message <[email protected]> you

Quoted 4 lines · wrote:

If you flash u-boot-dtb-tegra.bin, you'll get a fully functioning U-Boot. There's an intermediate file (u-boot-dtb.bin) that I assume is u-boot.bin+dtb - I'm not sure why it's left around - Allen could comment here.

I _dislike_ the idea of having image names which include architecture or even board parts. I would really like to have generic names, that can be used in a consistent way across platforms, architectures and boards.

Quoted 2 lines

So in my eyes, all you really need is u-boot-dtb-tegra.bin - an unwieldy name, to be sure, but it seems to satisfy your request for

a

Quoted 1 line

Soc identifier in the name. I voted for just having u-boot.bin be

the

Please reconsider. I definitely do NOT want to have SoC names or that in any such images!

IIRC, the original idea was to provide image names (common for all architectures, SoCs, boards) that only depend on where you install U-Boot to. in this way, we would have:

- u-boot.bin for the generic case (say, for installation into NOR

flash, no SPL or similar needed).

- u-boot-nand.bin

for installation in NAND (with all needed headers, padding etc. included)

- u-boot-onenand.bin

for installation in OneNAND

- u-boot.sd for installation on a SDCard

[actually we have an inconsistency in names here; this should have been "u-boot-sd.bin" or maybe even better "u-boot-sdcard.bin"]

Quoted 5 lines

etc.

It is very important to me that we do NOT include any architectures, SoCs, or board specifc parts in the names because this will cause major PITA for all kind of automatic test suites etc.

Quoted 8 lines

The awkwardness with naming based on nand/onenand/sd is that we no longer have build infrastructure that is specific to the type of boot device -- and IIRC with some of the newer SPL targets, the same image works on multiple types of boot device.

Having u-boot.bin be the final output regardless of internal implementation details such as spl would avoid that problem, and be even nicer to automated testing than the nand/onenand/sd names.

On the other hand, I use u-boot.bin and expect it to always be the raw linked binary of u-boot .

Quoted 1 line

-Scott

Best regards,
Marek Vasut

#43 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 8 lines · Marek Vasut

Dear Scott Wood,

Quoted 2 lines

The awkwardness with naming based on nand/onenand/sd is that we no longer have build infrastructure that is specific to the type of

boot

Quoted 1 line

device -- and IIRC with some of the newer SPL targets, the same

image

Quoted 2 lines

works on multiple types of boot device.

Quoted 7 lines
Quoted 3 lines

Having u-boot.bin be the final output regardless of internal implementation details such as spl would avoid that problem, and be even nicer to automated testing than the nand/onenand/sd names.

On the other hand, I use u-boot.bin and expect it to always be the raw linked
binary of u-boot .

What is U-Boot? Is it the thing that SPL loads, or is it the entire package that pops out when I tell the U-Boot makefiles to build something?

Of course the raw binary of the thing that SPL loads would still be available under some new name. Or come up with a new name for the final output, but I think the number of people that care about the final output is larger than the number of people that care about the raw binary of the thing that SPL loads.

As I said earlier, this is a situation where you can't please everyone, and I think it's better to have the current state of things be sane than to preserve one historical meaning of a particular target name rather than the other (originally there was no SPL and u-boot.bin was both the linker output and the final image to put into flash -- and this is still the case for many/most boards).

-Scott

#44 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Dear Scott Wood,

Quoted 32 lines · Marek Vasut
Quoted 13 lines

Dear Scott Wood,

Quoted 2 lines

The awkwardness with naming based on nand/onenand/sd is that we no longer have build infrastructure that is specific to the type of

boot

Quoted 1 line

device -- and IIRC with some of the newer SPL targets, the same

image

Quoted 2 lines

works on multiple types of boot device.

Quoted 7 lines
Quoted 3 lines

Having u-boot.bin be the final output regardless of internal implementation details such as spl would avoid that problem, and be even nicer to automated testing than the nand/onenand/sd names.

On the other hand, I use u-boot.bin and expect it to always be the raw linked
binary of u-boot .

What is U-Boot? Is it the thing that SPL loads, or is it the entire package that pops out when I tell the U-Boot makefiles to build something?

Of course the raw binary of the thing that SPL loads would still be available under some new name. Or come up with a new name for the final output, but I think the number of people that care about the final output is larger than the number of people that care about the raw binary of the thing that SPL loads.

Quoted 6 lines

As I said earlier, this is a situation where you can't please everyone, and I think it's better to have the current state of things be sane than to preserve one historical meaning of a particular target name rather than the other (originally there was no SPL and u-boot.bin was both the linker output and the final image to put into flash -- and this is still the case for many/most boards).

Leave u-boot.bin be, that's the u-boot binary ... the new name might be u- boot.img (as in flash image), what do you say ?

Quoted 1 line

-Scott

Best regards,
Marek Vasut

#45 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

Quoted 38 lines · Marek Vasut

Dear Scott Wood,

Quoted 4 lines · Marek Vasut
Quoted 3 lines

Dear Scott Wood,

Quoted 1 line

The awkwardness with naming based on nand/onenand/sd is that we

no

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

longer have build infrastructure that is specific to the type of

boot

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

device -- and IIRC with some of the newer SPL targets, the same

image

Quoted 4 lines

works on multiple types of boot device.

Having u-boot.bin be the final output regardless of internal implementation details such as spl would avoid that problem,

and be

Quoted 10 lines
Quoted 5 lines
Quoted 1 line

even nicer to automated testing than the nand/onenand/sd names.

On the other hand, I use u-boot.bin and expect it to always be the raw linked
binary of u-boot .

What is U-Boot? Is it the thing that SPL loads, or is it the entire package that pops out when I tell the U-Boot makefiles to build something?

Quoted 7 lines

Of course the raw binary of the thing that SPL loads would still be available under some new name. Or come up with a new name for the final output, but I think the number of people that care about the final output is larger than the number of people that care about the raw binary of the thing that SPL loads.

As I said earlier, this is a situation where you can't please

everyone,

Quoted 8 lines
Quoted 3 lines

and I think it's better to have the current state of things be sane than to preserve one historical meaning of a particular target name rather than the other (originally there was no SPL and u-boot.bin

was

Quoted 2 lines

both the linker output and the final image to put into flash -- and this is still the case for many/most boards).

Leave u-boot.bin be, that's the u-boot binary ...

So basically, argument by repetition. :-)

My point was that the introduction of SPL means there are two ways to interpret the phrase "the u-boot binary".

Quoted 2 lines

the new name might be u-boot.img (as in flash image), what do you say ?

Whatever, at least it doesn't have the SoC name in it. But again I think you're causing more problems/confusion changing the final output name than changing the result of a particular objcopy operation.

-Scott

#46 lore raw

PATCH v4 10/11 Add u-boot-pad.bin target to the Makefile

In reply to Marek Vasut

Dear Marek Vasut,

Quoted 3 lines · In message <[email protected]> you wrote:

Leave u-boot.bin be, that's the u-boot binary ... the new name might be u- boot.img (as in flash image), what do you say ?

Please re-read my earlier posting here:

http://article.gmane.org/gmane.comp.boot-loaders.u-boot/141749

Are there any strong arguments against my proposal?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If programming was easy, they wouldn't need something as  complicated
as a human being to do it, now would they?
                       - L. Wall & R. L. Schwartz, _Programming Perl_
#47 lore raw

PATCH v4 11/11 S3C24XX: Add support to MINI2416 board

In reply to José Miguel Gonçalves

The MINI2416 board is based on a Samsung's S3C2416 SoC and has 64MB DDR2 SDRAM, 256MB NAND Flash, a LAN9220 Ethernet Controller and a WM8731 Audio CODEC. This U-Boot port was implemented and tested on a unit bought to Boardcon
(http://www.armdesigner.com/) but there are some other chinese providers that can supply it with a selectable NAND chip from 128MB to 1GB.

---
Changes for v2:
- Coding style cleanup
- Use of Use of clrbits_le32(), setbits_le32() and clrsetbits_le32()
- Use of register bit macros instead of magic numbers
- Use of serial and rtc drivers implemented for s3c24x0

Changes for v3:
- Changed target name from u-boot-ubl.bin to u-boot-pad.bin
- Removed magic numbers
- Changes to support new SPL framework

Changes for v4:
- None

---
 MAINTAINERS                            |    4 +
 board/boardcon/mini2416/Makefile       |   47 ++++++++
 board/boardcon/mini2416/config.mk      |    4 +
 board/boardcon/mini2416/mini2416.c     |  104 ++++++++++++++++
 board/boardcon/mini2416/mini2416_spl.c |  202 ++++++++++++++++++++++++++++++++
 board/boardcon/mini2416/u-boot-spl.lds |   63 ++++++++++
 boards.cfg                             |    1 +
 include/configs/mini2416.h             |  202 +++++++++++++++++++++++++++++++
 8 files changed, 627 insertions(+)
 create mode 100644 board/boardcon/mini2416/Makefile
 create mode 100644 board/boardcon/mini2416/config.mk
 create mode 100644 board/boardcon/mini2416/mini2416.c
 create mode 100644 board/boardcon/mini2416/mini2416_spl.c
 create mode 100644 board/boardcon/mini2416/u-boot-spl.lds
 create mode 100644 include/configs/mini2416.h
MAINTAINERS +4 -0
index c5a6f2f..80ad29e 100644
@@ -653,6 +653,10 @@ Fabio Estevam <[email protected]>
 	mx53ard		i.MX53
 	mx53smd		i.MX53
 
+Jos? Gon?alves <[email protected]>
+
+	mini2416	ARM926EJS (S3C2416 SoC)
+
 Daniel Gorsulowski <[email protected]>
 
 	meesc		ARM926EJS (AT91SAM9263 SoC)
board/boardcon/mini2416/Makefile new file +47 -0

47 lines not on this page · raw message

board/boardcon/mini2416/config.mk new file +4 -0
new file mode 100644
index 0000000..ff08568
@@ -0,0 +1,4 @@
+PAD_TO	:= 0x2000
+ifndef CONFIG_SPL_BUILD
+ALL-y += $(obj)u-boot-pad.bin
+endif
board/boardcon/mini2416/mini2416.c new file +104 -0

104 lines not on this page · raw message

board/boardcon/mini2416/mini2416_spl.c new file +202 -0

202 lines not on this page · raw message

board/boardcon/mini2416/u-boot-spl.lds new file +63 -0

63 lines not on this page · raw message

boards.cfg +1 -0
index fdb84ad..823d5e6 100644
@@ -185,6 +185,7 @@ omap730p2_cs0boot	     arm         arm926ejs   omap730p2		 ti             omap
 omap730p2_cs3boot	     arm         arm926ejs   omap730p2		 ti             omap        omap730p2:CS3_BOOT
 edminiv2                     arm         arm926ejs   -                   LaCie          orion5x
 dkb			     arm         arm926ejs   -                   Marvell        pantheon
+mini2416                     arm         arm926ejs   mini2416            boardcon       s3c24xx
 spear300                     arm         arm926ejs   spear300            spear          spear       spear3xx_evb:spear300
 spear300_nand                arm         arm926ejs   spear300            spear          spear       spear3xx_evb:spear300,nand
 spear300_usbtty              arm         arm926ejs   spear300            spear          spear       spear3xx_evb:spear300,usbtty
include/configs/mini2416.h new file +202 -0

202 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#48 lore raw

PATCH v4 11/11 S3C24XX: Add support to MINI2416 board

Quoted 10 lines · Jos?? Miguel Gon??alves

The MINI2416 board is based on a Samsung's S3C2416 SoC and has 64MB DDR2 SDRAM, 256MB NAND Flash, a LAN9220 Ethernet Controller and a WM8731 Audio CODEC. This U-Boot port was implemented and tested on a unit bought to Boardcon
(http://www.armdesigner.com/) but there are some other chinese providers that can supply it with a selectable NAND chip from 128MB to 1GB.

---
Changes for v2:
- Coding style cleanup

There's still at least one #define[tab]NAME in the code, please checkpatch.pl the whole series.

Quoted 1 line

+#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }

This is in the defaults now, please remove.

Signature · 1 line
Tom
#49 lore raw

PATCH v4 11/11 S3C24XX: Add support to MINI2416 board

Quoted 7 lines · Tom Rini
Quoted 6 lines · Jos?? Miguel Gon??alves

The MINI2416 board is based on a Samsung's S3C2416 SoC and has 64MB DDR2 SDRAM, 256MB NAND Flash, a LAN9220 Ethernet Controller and a WM8731 Audio CODEC. This U-Boot port was implemented and tested on a unit bought to Boardcon
(http://www.armdesigner.com/) but there are some other chinese providers that can supply it with a selectable NAND chip from 128MB to 1GB.

Quoted 6 lines
Quoted 4 lines

---
Changes for v2:
- Coding style cleanup

There's still at least one #define[tab]NAME in the code, please checkpatch.pl the whole series.

I've done that!
I only get the warnings/errors that are justified on the cover letter (in the v3 changes), i.e., one were I followed a pre-existent coding style:

$ tools/checkpatch.pl 
../0002-S3C24XX-Add-core-support-for-Samsung-s-S3C24XX-SoCs.patch
WARNING: please, no spaces at the start of a line
#1719: FILE: include/common.h:631:
+    defined(CONFIG_S3C24XX) || \$

total: 0 errors, 1 warnings, 1587 lines checked

and another that is a false positive in the Ethernet address definitionin the config file;

$ tools/checkpatch.pl ../0011-S3C24XX-Add-support-to-MINI2416-board.patch
ERROR: spaces required around that ':' (ctx:VxV)
#694: FILE: include/configs/mini2416.h:165:
+#define CONFIG_ETHADDR            FE:11:22:33:44:55
                                         ^

ERROR: spaces required around that ':' (ctx:VxV)
#694: FILE: include/configs/mini2416.h:165:
+#define CONFIG_ETHADDR FE:11:22:33:44:55

                                            ^

ERROR: spaces required around that ':' (ctx:VxV)
#694: FILE: include/configs/mini2416.h:165:
+#define CONFIG_ETHADDR FE:11:22:33:44:55

                                               ^

ERROR: spaces required around that ':' (ctx:VxV)
#694: FILE: include/configs/mini2416.h:165:
+#define CONFIG_ETHADDR FE:11:22:33:44:55

                                                  ^

total: 4 errors, 0 warnings, 639 lines checked

Quoted 4 lines
Quoted 2 lines

+#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }

This is in the defaults now, please remove.

OK.

Best regards,
Jos? Gon?alves