mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset
@ 2019-09-12 10:28 Ahmad Fatoum
  2019-09-12 10:29 ` [PATCH 2/7] ARM: Layerscape: add bootm handler for images Ahmad Fatoum
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2019-09-12 10:28 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

barebox already has a copy_file for copying files. Extend the API by a
copy_file_2 that takes a source offset into account.

This is useful for handling SoC-specific image formats which have a
fixed-size header, as copy_file_2 can now skip that header and create a
file with the full barebox image in one go.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/libfile.h |  1 +
 lib/libfile.c     | 25 +++++++++++++++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/include/libfile.h b/include/libfile.h
index f1d695187790..02269f4877e6 100644
--- a/include/libfile.h
+++ b/include/libfile.h
@@ -16,6 +16,7 @@ int write_file(const char *filename, const void *buf, size_t size);
 int write_file_flash(const char *filename, const void *buf, size_t size);
 
 int copy_file(const char *src, const char *dst, int verbose);
+int copy_file_2(const char *src, const char *dst, loff_t pos, int verbose);
 
 int copy_recursive(const char *src, const char *dst);
 
diff --git a/lib/libfile.c b/lib/libfile.c
index b42753c2b5ea..4bc980816a67 100644
--- a/lib/libfile.c
+++ b/lib/libfile.c
@@ -318,14 +318,15 @@ out_close:
 EXPORT_SYMBOL(write_file_flash);
 
 /**
- * copy_file - Copy a file
+ * copy_file_2 - Copy a file
  * @src:	The source filename
  * @dst:	The destination filename
+ * @pos:	source file position to start reading at
  * @verbose:	if true, show a progression bar
  *
  * Return: 0 for success or negative error code
  */
-int copy_file(const char *src, const char *dst, int verbose)
+int copy_file_2(const char *src, const char *dst, loff_t pos, int verbose)
 {
 	char *rw_buf = NULL;
 	int srcfd = 0, dstfd = 0;
@@ -337,11 +338,9 @@ int copy_file(const char *src, const char *dst, int verbose)
 
 	rw_buf = xmalloc(RW_BUF_SIZE);
 
-	srcfd = open(src, O_RDONLY);
-	if (srcfd < 0) {
-		printf("could not open %s: %s\n", src, errno_str());
+	srcfd = open_and_lseek(src, O_RDONLY, pos);
+	if (srcfd < 0)
 		goto out;
-	}
 
 	mode = O_WRONLY | O_CREAT;
 
@@ -403,6 +402,20 @@ out:
 
 	return ret ?: err1;
 }
+EXPORT_SYMBOL(copy_file_2);
+
+/**
+ * copy_file - Copy a file
+ * @src:	The source filename
+ * @dst:	The destination filename
+ * @verbose:	if true, show a progression bar
+ *
+ * Return: 0 for success or negative error code
+ */
+int copy_file(const char *src, const char *dst, int verbose)
+{
+	return copy_file_2(src, dst, 0, verbose);
+}
 EXPORT_SYMBOL(copy_file);
 
 int copy_recursive(const char *src, const char *dst)
-- 
2.23.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 2/7] ARM: Layerscape: add bootm handler for images
  2019-09-12 10:28 [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset Ahmad Fatoum
@ 2019-09-12 10:29 ` Ahmad Fatoum
  2019-09-12 10:29 ` [PATCH 3/7] ARM: Layerscape: don't generate second-stage 2nd.image Ahmad Fatoum
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2019-09-12 10:29 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The layerscape images are preceeded by a RCW and PBI, which are interpreted
by the Layerscape Hardware Pre-Bootloader and aren't executable as ARM code.
To maintain the ability to network boot them, add a bootm handler that
skips the fixed-size header.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-layerscape/Makefile   |  1 +
 arch/arm/mach-layerscape/pblimage.c | 46 +++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 arch/arm/mach-layerscape/pblimage.c

diff --git a/arch/arm/mach-layerscape/Makefile b/arch/arm/mach-layerscape/Makefile
index 8a814f944161..854a327c9125 100644
--- a/arch/arm/mach-layerscape/Makefile
+++ b/arch/arm/mach-layerscape/Makefile
@@ -5,3 +5,4 @@ obj-y += icid.o
 obj-pbl-y += boot.o
 pbl-y += xload-qspi.o xload.o
 obj-$(CONFIG_ARCH_LAYERSCAPE_PPA) += ppa.o ppa-entry.o
+obj-$(CONFIG_BOOTM) += pblimage.o
diff --git a/arch/arm/mach-layerscape/pblimage.c b/arch/arm/mach-layerscape/pblimage.c
new file mode 100644
index 000000000000..74a4c805bc67
--- /dev/null
+++ b/arch/arm/mach-layerscape/pblimage.c
@@ -0,0 +1,46 @@
+#include <bootm.h>
+#include <common.h>
+#include <init.h>
+#include <libfile.h>
+#include <linux/sizes.h>
+
+#define BAREBOX_STAGE2_OFFSET	SZ_128K
+
+static int do_bootm_layerscape_pblimage(struct image_data *pbl_data)
+{
+	int ret;
+	char pblimage_filename[] = "/.layerscape-pbl.img";
+	struct bootm_data bb_data = {
+		.initrd_address = UIMAGE_INVALID_ADDRESS,
+		.os_address = UIMAGE_SOME_ADDRESS,
+		.os_file = pblimage_filename,
+	};
+
+	ret = copy_file_2(pbl_data->os_file, bb_data.os_file,
+			  BAREBOX_STAGE2_OFFSET, 0);
+	if (ret)
+		return ret;
+
+	return bootm_boot(&bb_data);
+}
+
+static struct image_handler image_handler_layerscape_pbl_image = {
+	.name = "Layerscape image",
+	.bootm = do_bootm_layerscape_pblimage,
+	.filetype = filetype_layerscape_image,
+};
+
+static struct image_handler image_handler_layerscape_qspi_pbl_image = {
+	.name = "Layerscape QSPI image",
+	.bootm = do_bootm_layerscape_pblimage,
+	.filetype = filetype_layerscape_qspi_image,
+};
+
+static int layerscape_register_pbl_image_handler(void)
+{
+	register_image_handler(&image_handler_layerscape_pbl_image);
+	register_image_handler(&image_handler_layerscape_qspi_pbl_image);
+
+	return 0;
+}
+late_initcall(layerscape_register_pbl_image_handler);
-- 
2.23.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/7] ARM: Layerscape: don't generate second-stage 2nd.image
  2019-09-12 10:28 [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset Ahmad Fatoum
  2019-09-12 10:29 ` [PATCH 2/7] ARM: Layerscape: add bootm handler for images Ahmad Fatoum
@ 2019-09-12 10:29 ` Ahmad Fatoum
  2019-09-12 10:29 ` [PATCH 4/7] filetype: support fastboot barebox_update with layerscape image Ahmad Fatoum
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2019-09-12 10:29 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

For layerscape images, barebox currently generates a second stage
barebox that lacks the RCW and PBI and as such can be bootm'd as
any other barebox ARM image. A previous commit implemented bootm
handlers for the RCW and PBI prefixed images and thus the 2nd.image
no longer serves a real purpose. Drop it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 images/Makefile.layerscape | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/images/Makefile.layerscape b/images/Makefile.layerscape
index d20cc6a37e03..806c09d8fbce 100644
--- a/images/Makefile.layerscape
+++ b/images/Makefile.layerscape
@@ -21,8 +21,6 @@ quiet_cmd_lspbl_spi_image = LSPBL-SPI-IMG $@
 			    -m $($(patsubst $(obj)/%.pblb,PBL_CODE_SIZE_%,$<)) -p $(lspbl-pbi-tmp) -i $<
 
 pbl-$(CONFIG_MACH_LS1046ARDB) += start_ls1046ardb.pbl
-$(obj)/barebox-ls1046ardb-2nd.image: $(obj)/start_ls1046ardb.pblb
-	$(call if_changed,shipped)
 
 $(obj)/barebox-ls1046ardb-sd.image: $(obj)/start_ls1046ardb.pblb \
 		$(board)/ls1046ardb/ls1046ardb_rcw_sd.cfg \
@@ -40,11 +38,9 @@ $(obj)/barebox-ls1046ardb-qspi.image: $(obj)/start_ls1046ardb.pblb \
 	$(call if_changed,lspbl_spi_image)
 
 image-$(CONFIG_MACH_LS1046ARDB) += barebox-ls1046ardb-sd.image barebox-ls1046ardb-qspi.image \
-	barebox-ls1046ardb-emmc.image barebox-ls1046ardb-2nd.image
+	barebox-ls1046ardb-emmc.image
 
 pbl-$(CONFIG_MACH_TQMLS1046A) += start_tqmls1046a.pbl
-$(obj)/barebox-tqmls1046a-2nd.image: $(obj)/start_tqmls1046a.pblb
-	$(call if_changed,shipped)
 
 $(obj)/barebox-tqmls1046a-sd.image: $(obj)/start_tqmls1046a.pblb \
 		$(board)/tqmls1046a/tqmls1046a_rcw_sd_3333_5559.cfg \
@@ -57,4 +53,4 @@ $(obj)/barebox-tqmls1046a-qspi.image: $(obj)/start_tqmls1046a.pblb \
 	$(call if_changed,lspbl_spi_image)
 
 image-$(CONFIG_MACH_TQMLS1046A) += barebox-tqmls1046a-sd.image \
-	barebox-tqmls1046a-qspi.image barebox-tqmls1046a-2nd.image
+	barebox-tqmls1046a-qspi.image
-- 
2.23.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 4/7] filetype: support fastboot barebox_update with layerscape image
  2019-09-12 10:28 [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset Ahmad Fatoum
  2019-09-12 10:29 ` [PATCH 2/7] ARM: Layerscape: add bootm handler for images Ahmad Fatoum
  2019-09-12 10:29 ` [PATCH 3/7] ARM: Layerscape: don't generate second-stage 2nd.image Ahmad Fatoum
@ 2019-09-12 10:29 ` Ahmad Fatoum
  2019-09-12 10:29 ` [PATCH 5/7] scripts: pblimage: explicitly set architecture to ARM Ahmad Fatoum
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2019-09-12 10:29 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We do not yet support USB on the Layerscape platforms, but when we do,
it's imaginable that we would want to export barebox_update targets over
Fastboot. Prepare for this by adding the layerscape images to those that
filetype_is_barebox_image returns true for.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/filetype.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/filetype.c b/common/filetype.c
index 825bf25ad107..4966c5e068bd 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -460,6 +460,8 @@ bool filetype_is_barebox_image(enum filetype ft)
 	case filetype_mips_barebox:
 	case filetype_ch_image:
 	case filetype_ch_image_be:
+	case filetype_layerscape_image:
+	case filetype_layerscape_qspi_image:
 		return true;
 	default:
 		return false;
-- 
2.23.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 5/7] scripts: pblimage: explicitly set architecture to ARM
  2019-09-12 10:28 [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset Ahmad Fatoum
                   ` (2 preceding siblings ...)
  2019-09-12 10:29 ` [PATCH 4/7] filetype: support fastboot barebox_update with layerscape image Ahmad Fatoum
@ 2019-09-12 10:29 ` Ahmad Fatoum
  2019-09-13 14:38   ` Roland Hieber
  2019-09-12 10:29 ` [PATCH 6/7] ARM: layerscape: tqmls1046a: disable all SGMII PHYs Ahmad Fatoum
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Ahmad Fatoum @ 2019-09-12 10:29 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

architecture is statically initialized to zero, which happens to be
ARCH_ARM as it's the first enum element.
Make this a bit clearer by explicitly assigning ARM_ARM to architecture.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 scripts/pblimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/pblimage.c b/scripts/pblimage.c
index 73c0169ac1c1..235af8aa11b1 100644
--- a/scripts/pblimage.c
+++ b/scripts/pblimage.c
@@ -61,7 +61,7 @@ enum arch {
 	ARCH_POWERPC,
 };
 
-enum arch architecture;
+enum arch architecture = ARCH_ARM;
 static char *rcwfile;
 static char *pbifile;
 static char *outfile;
-- 
2.23.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 6/7] ARM: layerscape: tqmls1046a: disable all SGMII PHYs
  2019-09-12 10:28 [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset Ahmad Fatoum
                   ` (3 preceding siblings ...)
  2019-09-12 10:29 ` [PATCH 5/7] scripts: pblimage: explicitly set architecture to ARM Ahmad Fatoum
@ 2019-09-12 10:29 ` Ahmad Fatoum
  2019-09-12 10:29 ` [PATCH 7/7] Documentation: boards: document layerscape support Ahmad Fatoum
  2019-09-12 13:06 ` [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset Uwe Kleine-König
  6 siblings, 0 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2019-09-12 10:29 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We already disable PHYs 4-7, which are currently unusable as they hang
off SGMII, which barebox' FMan driver does not yet support.

Follow suit for the SGMII eth0 and eth1 as well, so they don't
unnecessarily clutter the barebox output with

	Unable to find a PHY (unknown ID?)

messages.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .../arm/boards/tqmls1046a/defaultenv-tqmls1046a/nv/dev.eth0.mode | 1 +
 .../arm/boards/tqmls1046a/defaultenv-tqmls1046a/nv/dev.eth1.mode | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 arch/arm/boards/tqmls1046a/defaultenv-tqmls1046a/nv/dev.eth0.mode
 create mode 100644 arch/arm/boards/tqmls1046a/defaultenv-tqmls1046a/nv/dev.eth1.mode

diff --git a/arch/arm/boards/tqmls1046a/defaultenv-tqmls1046a/nv/dev.eth0.mode b/arch/arm/boards/tqmls1046a/defaultenv-tqmls1046a/nv/dev.eth0.mode
new file mode 100644
index 000000000000..7a68b11da8b1
--- /dev/null
+++ b/arch/arm/boards/tqmls1046a/defaultenv-tqmls1046a/nv/dev.eth0.mode
@@ -0,0 +1 @@
+disabled
diff --git a/arch/arm/boards/tqmls1046a/defaultenv-tqmls1046a/nv/dev.eth1.mode b/arch/arm/boards/tqmls1046a/defaultenv-tqmls1046a/nv/dev.eth1.mode
new file mode 100644
index 000000000000..7a68b11da8b1
--- /dev/null
+++ b/arch/arm/boards/tqmls1046a/defaultenv-tqmls1046a/nv/dev.eth1.mode
@@ -0,0 +1 @@
+disabled
-- 
2.23.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 7/7] Documentation: boards: document layerscape support
  2019-09-12 10:28 [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset Ahmad Fatoum
                   ` (4 preceding siblings ...)
  2019-09-12 10:29 ` [PATCH 6/7] ARM: layerscape: tqmls1046a: disable all SGMII PHYs Ahmad Fatoum
@ 2019-09-12 10:29 ` Ahmad Fatoum
  2019-09-12 13:06 ` [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset Uwe Kleine-König
  6 siblings, 0 replies; 11+ messages in thread
From: Ahmad Fatoum @ 2019-09-12 10:29 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Some peripherals are still missing, but the main functionality to boot
an OS is already in place. Document how to use it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 Documentation/boards/layerscape.rst           | 61 +++++++++++++++++++
 .../boards/layerscape/ls1046ardb.rst          | 36 +++++++++++
 .../boards/layerscape/tqmls1046a.rst          | 49 +++++++++++++++
 3 files changed, 146 insertions(+)
 create mode 100644 Documentation/boards/layerscape.rst
 create mode 100644 Documentation/boards/layerscape/ls1046ardb.rst
 create mode 100644 Documentation/boards/layerscape/tqmls1046a.rst

diff --git a/Documentation/boards/layerscape.rst b/Documentation/boards/layerscape.rst
new file mode 100644
index 000000000000..ae089539e564
--- /dev/null
+++ b/Documentation/boards/layerscape.rst
@@ -0,0 +1,61 @@
+NXP Layerscape
+==============
+
+barebox has support for some of the ARM64 based Layerscape SoCs from NXP.
+
+Booting barebox
+---------------
+
+The Layerscape SoCs contain logic dubbed the Pre-Bootloader (PBL). This unit
+reads the boot medium and conducts basic IO multiplexing according to the RCW
+(Reset Configuration Word). The RCW then refers the PBL to the location of the
+Pre-Bootloader Instructions (PBI). These do basic device configuration and
+afterwards poke the barebox PBL into On-Chip SRAM.
+The barebox PBL then loads the complete barebox image and runs the PBL again,
+this time from SDRAM after it has been set up.
+
+For each board, a barebox image per supported boot medium is generated.
+They may differ in the RCW, PBI and endianess depending on the boot medium.
+
+Flashing barebox
+----------------
+
+The barebox binary is expected to be located 4K bytes into the SD-Card::
+
+  dd if=images/barebox-${boardname}-sd.image of=/dev/sdX bs=512 seek=8
+
+From there on, ``barebox_update`` can be used to flash
+barebox to the QSPI NOR-Flash if required::
+
+  barebox_update -t qspi /mnt/tftp/barebox-${global.hostname}-qspi.imaag
+
+Flashing to the eMMC is possible likewise::
+
+  barebox_update -t sd /mnt/tftp/barebox-${global.hostname}-sd.imaag
+
+.. note:: Some SoCs like the LS1046A feature only a single eSDHC.
+  In such a case, using eMMC and SD-Card at the same time is not possible.
+  Boot from QSPI to flash the eMMC.
+
+Firmware Blobs
+--------------
+
+Network: `fsl_fman_ucode_ls1046_r1.0_106_4_18.bin <https://github.com/NXP/qoriq-fm-ucode/raw/integration/fsl_fman_ucode_ls1046_r1.0_106_4_18.bin>`_.
+
+PSCI Firmware: `ppa-ls1046a.bin <https://github.com/NXP/qoriq-ppa-binary/raw/integration/soc-ls1046/ppa.itb>`_.
+
+Layerscape boards
+-----------------
+
+With multi-image and device trees, it's expected to have ``layerscape_defconfig``
+as sole defconfig for all Layerscape boards::
+
+  make ARCH=arm layerscape_defconfig
+
+Generated images will be placed under ``images/``.
+
+.. toctree::
+  :glob:
+  :maxdepth: 1
+
+  layerscape/*
diff --git a/Documentation/boards/layerscape/ls1046ardb.rst b/Documentation/boards/layerscape/ls1046ardb.rst
new file mode 100644
index 000000000000..323f2ca990c9
--- /dev/null
+++ b/Documentation/boards/layerscape/ls1046ardb.rst
@@ -0,0 +1,36 @@
+NXP LS1046A Reference Design Board
+==================================
+
+Boot DIP Switches
+-----------------
+
+Boot source selection happens via the the bottom most DIP switch (near the micro-usb port)::
+
+     OFF -> ON
+    +---------+
+  1 |  O----  |
+  2 |  O----  |
+  3 |  ----O  |
+  4 |  O----  |
+  5 |  O----  |
+  6 |  O----  |
+  7 |  ----O  |  <---- Boot from QSPI (default)
+  8 |  O----  |
+    +---------+
+
+     OFF -> ON
+    +---------+
+  1 |  O----  |
+  2 |  O----  |
+  3 |  ----O  |
+  4 |  O----  |
+  5 |  O----  |
+  6 |  O----  |
+  7 |  O----  |  <---- Boot from SDHC
+  8 |  O----  |
+    +---------+
+
+Known Issues
+------------
+
+System reset may not complete if the CMSIS-DAP micro-usb is connected.
diff --git a/Documentation/boards/layerscape/tqmls1046a.rst b/Documentation/boards/layerscape/tqmls1046a.rst
new file mode 100644
index 000000000000..55a5dff4a396
--- /dev/null
+++ b/Documentation/boards/layerscape/tqmls1046a.rst
@@ -0,0 +1,49 @@
+TQ-Group TQMLS1046A Module
+==========================
+
+Ethernet Ports
+--------------
+
+There two RGMII ports are the two closest to the RS-232 socket.
+They are ``eth2`` for the lower port and ``eth3`` for the upper port.
+
+MBLS10xxA (Base Board) Boot DIP Switches
+----------------------------------------
+
+Boot source selection happens via the ``S5`` DIP-Switch::
+
+  +---------+
+  |         |
+  | | | O x |
+  | | | | x |  <---- SDHC (X31)
+  | O O | x |
+  |         |
+  | 1 2 3 4 |
+  +---------+
+
+  +---------+
+  |         |
+  | O | O x |
+  | | | | x |  <---- eMMC
+  | | O | x |
+  |         |
+  | 1 2 3 4 |
+  +---------+
+
+  +---------+
+  |         |
+  | | O O x |
+  | | | | x |  <---- QSPI (eSDHC controls SDHC)
+  | O | | x |
+  |         |
+  | 1 2 3 4 |
+  +---------+
+
+  +---------+
+  |         |
+  | O O O x |
+  | | | | x |  <---- QSPI (eSDHC controls eMMC)
+  | | | | x |
+  |         |
+  | 1 2 3 4 |
+  +---------+
-- 
2.23.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset
  2019-09-12 10:28 [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset Ahmad Fatoum
                   ` (5 preceding siblings ...)
  2019-09-12 10:29 ` [PATCH 7/7] Documentation: boards: document layerscape support Ahmad Fatoum
@ 2019-09-12 13:06 ` Uwe Kleine-König
  2019-09-12 13:37   ` Ahmad Fatoum
  6 siblings, 1 reply; 11+ messages in thread
From: Uwe Kleine-König @ 2019-09-12 13:06 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Hello Ahmad,

On Thu, Sep 12, 2019 at 12:28:59PM +0200, Ahmad Fatoum wrote:
> barebox already has a copy_file for copying files. Extend the API by a
> copy_file_2 that takes a source offset into account.

Can you give that function a more descriptive name? Something like
copy_file_from_offset()?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset
  2019-09-12 13:06 ` [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset Uwe Kleine-König
@ 2019-09-12 13:37   ` Ahmad Fatoum
  2019-09-12 14:30     ` Sascha Hauer
  0 siblings, 1 reply; 11+ messages in thread
From: Ahmad Fatoum @ 2019-09-12 13:37 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: barebox

Hello Uwe,

On 9/12/19 3:06 PM, Uwe Kleine-König wrote:
> Hello Ahmad,
> 
> On Thu, Sep 12, 2019 at 12:28:59PM +0200, Ahmad Fatoum wrote:
>> barebox already has a copy_file for copying files. Extend the API by a
>> copy_file_2 that takes a source offset into account.
> 
> Can you give that function a more descriptive name? Something like
> copy_file_from_offset()?

I chose copy_file_2 for consistency with the read_file function, which
had a copy renamed to read_file_2 when it gained a (max) offset parameter.

Should read_file_2 be renamed as well? 

> 
> Best regards
> Uwe
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset
  2019-09-12 13:37   ` Ahmad Fatoum
@ 2019-09-12 14:30     ` Sascha Hauer
  0 siblings, 0 replies; 11+ messages in thread
From: Sascha Hauer @ 2019-09-12 14:30 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox, Uwe Kleine-König

On Thu, Sep 12, 2019 at 03:37:49PM +0200, Ahmad Fatoum wrote:
> Hello Uwe,
> 
> On 9/12/19 3:06 PM, Uwe Kleine-König wrote:
> > Hello Ahmad,
> > 
> > On Thu, Sep 12, 2019 at 12:28:59PM +0200, Ahmad Fatoum wrote:
> >> barebox already has a copy_file for copying files. Extend the API by a
> >> copy_file_2 that takes a source offset into account.
> > 
> > Can you give that function a more descriptive name? Something like
> > copy_file_from_offset()?
> 
> I chose copy_file_2 for consistency with the read_file function, which
> had a copy renamed to read_file_2 when it gained a (max) offset parameter.
> 
> Should read_file_2 be renamed as well? 

read_file_2 is named like that because it is a better read_file.
copy_file_2 more looks like another type of copy_file, so I too would
prefer copy_file_from_offset, or even better with an additional size
or end argument and named copy_file_window ;)

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 5/7] scripts: pblimage: explicitly set architecture to ARM
  2019-09-12 10:29 ` [PATCH 5/7] scripts: pblimage: explicitly set architecture to ARM Ahmad Fatoum
@ 2019-09-13 14:38   ` Roland Hieber
  0 siblings, 0 replies; 11+ messages in thread
From: Roland Hieber @ 2019-09-13 14:38 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Thu, Sep 12, 2019 at 12:29:03PM +0200, Ahmad Fatoum wrote:
> architecture is statically initialized to zero, which happens to be
> ARCH_ARM as it's the first enum element.
> Make this a bit clearer by explicitly assigning ARM_ARM to architecture.

Nit: s/ARM_ARM/ARCH_ARM/

> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  scripts/pblimage.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/pblimage.c b/scripts/pblimage.c
> index 73c0169ac1c1..235af8aa11b1 100644
> --- a/scripts/pblimage.c
> +++ b/scripts/pblimage.c
> @@ -61,7 +61,7 @@ enum arch {
>  	ARCH_POWERPC,
>  };
>  
> -enum arch architecture;
> +enum arch architecture = ARCH_ARM;
>  static char *rcwfile;
>  static char *pbifile;
>  static char *outfile;
> -- 
> 2.23.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber                     | r.hieber@pengutronix.de     |
Pengutronix e.K.                  | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-09-13 14:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-12 10:28 [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset Ahmad Fatoum
2019-09-12 10:29 ` [PATCH 2/7] ARM: Layerscape: add bootm handler for images Ahmad Fatoum
2019-09-12 10:29 ` [PATCH 3/7] ARM: Layerscape: don't generate second-stage 2nd.image Ahmad Fatoum
2019-09-12 10:29 ` [PATCH 4/7] filetype: support fastboot barebox_update with layerscape image Ahmad Fatoum
2019-09-12 10:29 ` [PATCH 5/7] scripts: pblimage: explicitly set architecture to ARM Ahmad Fatoum
2019-09-13 14:38   ` Roland Hieber
2019-09-12 10:29 ` [PATCH 6/7] ARM: layerscape: tqmls1046a: disable all SGMII PHYs Ahmad Fatoum
2019-09-12 10:29 ` [PATCH 7/7] Documentation: boards: document layerscape support Ahmad Fatoum
2019-09-12 13:06 ` [PATCH 1/7] libfile: introduce copy_file_2 for copying starting with offset Uwe Kleine-König
2019-09-12 13:37   ` Ahmad Fatoum
2019-09-12 14:30     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox