Skip to contentSkip to conversation

rockchip: Support building ROM files automatically

PATCH Superseded Simon Glass 1 participant 16 messages Jun 8, 2020

Subsystems (6)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover rockchip: Support building ROM files automatically

Rockchip-based Chromebooks support booting from SPI flash. It is annoying to have to manually build the SPI image when the SD image is built automatically.

This feature is already available for x86 devices, so the existing mechanism is reused. Briefly, this allows a BUILD_ROM environment variable to be provided to indicate that any required binary blobs are present and it is safe to build the ROM.

A new 'mkimage' type is added to binman to support building binaries with mkimage with a binman definition. This avoids Makefile/shell/Python code to do the same thing.

This series uses binman to produce a ROM image on two selected Chromebooks, Bob (RK3399) and Jerry (RK3388).

Simon Glass (15):
dm: core Fix long line in device_bind_common() .gitignore: Ignore Python 3 cache directories
binman: cbfs: Fix IFWI typo
binman: Correct the search patch for pylibfdt
binman: Add support for calling mkimage
binman: Fix a few typos in the entry docs
binman: Adjust pylibfdt for incremental build
x86: rockchip: Change how selection of ROMs works
rockchip: Allow Bob to use SPI boot
Allow building .rom files for non-x86 boards
rockchip: jerry: Add serial support
rockchip: bob: Support SPI-flash booting
rockchip: Allow including rockchip dtsi on 32-bit machines
rockchip: Enable building a SPI ROM image on jerry
rockchip: Enable building a SPI ROM image on bob

 .gitignore                            |  3 ++
 Kconfig                               | 18 +++++++-
 Makefile                              | 30 ++++++++++---
 arch/Kconfig                          |  1 +
 arch/arm/dts/rk3288-u-boot.dtsi       | 24 +++++++++++
 arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 ++
 arch/arm/dts/rk3399-gru.dtsi          |  2 +-
 arch/arm/dts/rk3399-u-boot.dtsi       | 27 ++++++++++++
 arch/arm/dts/rockchip-u-boot.dtsi     | 10 ++++-
 arch/arm/mach-rockchip/rk3288/Kconfig |  1 +
 arch/arm/mach-rockchip/rk3399/Kconfig |  1 +
 arch/arm/mach-rockchip/spl.c          |  3 +-
 arch/x86/Kconfig                      |  4 ++
 configs/chromebook_bob_defconfig      |  4 +-
 configs/chromebook_jerry_defconfig    |  1 +
 drivers/core/device.c                 |  3 +-
 scripts/dtc/pylibfdt/Makefile         |  3 ++
 tools/binman/README.entries           | 27 +++++++++++-
 tools/binman/etype/_testing.py        |  5 +++
 tools/binman/etype/cbfs.py            |  2 +-
 tools/binman/etype/mkimage.py         | 62 +++++++++++++++++++++++++++
 tools/binman/ftest.py                 |  7 +++
 tools/binman/main.py                  |  2 +-
 tools/binman/test/156_mkimage.dts     | 23 ++++++++++
 24 files changed, 252 insertions(+), 15 deletions(-)
 create mode 100644 tools/binman/etype/mkimage.py
 create mode 100644 tools/binman/test/156_mkimage.dts
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#1 lore raw

PATCH 1/15 dm: core Fix long line in device_bind_common()

Fix an over-length line in this function.

---

 drivers/core/device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/core/device.c +2 -1
index a7408d9c76..2e3d555ea4 100644
@@ -82,7 +82,8 @@ static int device_bind_common(struct udevice *parent, const struct driver *drv,
 		 * This is just a 'requested' sequence, and will be
 		 * resolved (and ->seq updated) when the device is probed.
 		 */
-		if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
+		if (CONFIG_IS_ENABLED(OF_CONTROL) &&
+		    !CONFIG_IS_ENABLED(OF_PLATDATA)) {
 			if (uc->uc_drv->name && ofnode_valid(node))
 				dev_read_alias_seq(dev, &dev->req_seq);
 #if CONFIG_IS_ENABLED(OF_PRIOR_STAGE)
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#2 lore raw

PATCH 2/15 .gitignore: Ignore Python 3 cache directories

In reply to Simon Glass

These can appear when moving between branches that have different tools in the tree. Ignore them.

---

 .gitignore | 3 +++
 1 file changed, 3 insertions(+)
.gitignore +3 -0
index 2e1c8bf2bf..e66aa864da 100644
@@ -92,3 +92,6 @@ GTAGS
 *.orig
 *~
 \#*#
+
+# Python cache
+__pycache__
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#3 lore raw

PATCH 3/15 binman: cbfs: Fix IFWI typo

In reply to Simon Glass

This comment references the wrong thing. Fix it.

---

 tools/binman/etype/cbfs.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/binman/etype/cbfs.py +1 -1
index e9aed8310c..744a32fa0c 100644
@@ -204,7 +204,7 @@ class Entry_cbfs(Entry):
         return True
 
     def _ReadSubnodes(self):
-        """Read the subnodes to find out what should go in this IFWI"""
+        """Read the subnodes to find out what should go in this CBFS"""
         for node in self._node.subnodes:
             entry = Entry.Create(self, node)
             entry.ReadNode()
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#4 lore raw

PATCH 4/15 binman: Correct the search patch for pylibfdt

In reply to Simon Glass

Now that binman uses tools/ as its base directory for importing modules, the path to the pylibfdt build by U-Boot is incorrect. Fix it.

---

 tools/binman/main.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/binman/main.py +1 -1
index efa7fa8386..4194761f9e 100755
@@ -25,7 +25,7 @@ sys.path.insert(2, os.path.join(our_path, '..'))
 from patman import test_util
 
 # Bring in the libfdt module
-sys.path.insert(2, 'scripts/dtc/pylibfdt')
+sys.path.insert(2, os.path.join(our_path, '../../scripts/dtc/pylibfdt'))
 sys.path.insert(2, os.path.join(our_path,
                 '../../build-sandbox_spl/scripts/dtc/pylibfdt'))
 
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#5 lore raw

PATCH 5/15 binman: Add support for calling mkimage

In reply to Simon Glass

As a first step to integrating mkimage into binman, add a new entry type that feeds data into mkimage for processing and incorporates that output into the image.

---

 tools/binman/README.entries       | 23 ++++++++++++
 tools/binman/etype/_testing.py    |  5 +++
 tools/binman/etype/mkimage.py     | 62 +++++++++++++++++++++++++++++++
 tools/binman/ftest.py             |  7 ++++
 tools/binman/test/156_mkimage.dts | 23 ++++++++++++
 5 files changed, 120 insertions(+)
 create mode 100644 tools/binman/etype/mkimage.py
 create mode 100644 tools/binman/test/156_mkimage.dts
tools/binman/README.entries +23 -0
index 6a816bba6b..4f2c48fdc2 100644
@@ -587,6 +587,29 @@ See README.x86 for information about Intel binary blobs.
 
 
 
+Entry: mkimage: Entry containing a binary produced by mkimage
+-------------------------------------------------------------
+
+Properties / Entry arguments:
+    - datafile: Filename for -d argument
+    - args: Other arguments to pass
+
+The data passed to mkimage is collected from subnodes of the mkimage node,
+e.g.:
+
+    mkimage {
+        args = "-n test -T imximage";
+
+        u-boot-spl {
+        };
+    };
+
+This calls mkimage to create an imximage with u-boot-spl.bin as the input
+file. The output from mkimage then becomes part of the image produced by
+binman.
+
+
+
 Entry: powerpc-mpc85xx-bootpg-resetvec: PowerPC mpc85xx bootpg + resetvec code for U-Boot
 -----------------------------------------------------------------------------------------
 
tools/binman/etype/_testing.py +5 -0
index ed718eed14..ea60561adb 100644
@@ -57,6 +57,8 @@ class Entry__testing(Entry):
                                                      'return-contents-once')
         self.bad_update_contents_twice = fdt_util.GetBool(self._node,
                                                     'bad-update-contents-twice')
+        self.return_contents_later = fdt_util.GetBool(self._node,
+                                                     'return-contents-later')
 
         # Set to True when the entry is ready to process the FDT.
         self.process_fdt_ready = False
@@ -83,6 +85,9 @@ class Entry__testing(Entry):
     def ObtainContents(self):
         if self.return_unknown_contents or not self.return_contents:
             return False
+        if self.return_contents_later:
+            self.return_contents_later = False
+            return False
         self.data = self.contents
         self.contents_size = len(self.data)
         if self.return_contents_once:
tools/binman/etype/mkimage.py new file +62 -0

62 lines not on this page · raw message

tools/binman/ftest.py +7 -0
index 5e24920088..39e67b9042 100644
@@ -3357,6 +3357,13 @@ class TestFunctional(unittest.TestCase):
         data = self._DoReadFile('154_intel_fsp_t.dts')
         self.assertEqual(FSP_T_DATA, data[:len(FSP_T_DATA)])
 
+    def testMkimage(self):
+        """Test using mkimage to build an image"""
+        data = self._DoReadFile('156_mkimage.dts')
+
+        # Just check that the data appears in the file somewhere
+        self.assertIn(U_BOOT_SPL_DATA, data)
+
 
 if __name__ == "__main__":
     unittest.main()
tools/binman/test/156_mkimage.dts new file +23 -0
new file mode 100644
index 0000000000..933b13143a
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		size = <0x80>;
+
+		mkimage {
+			args = "-n test -T script";
+
+			u-boot-spl {
+			};
+
+			_testing {
+				return-contents-later;
+			};
+		};
+	};
+};
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#6 lore raw

PATCH 6/15 binman: Fix a few typos in the entry docs

In reply to Simon Glass

Some typos have been fixed in the code but the entry docs were not regenerated. Fix this.

---

 tools/binman/README.entries | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/binman/README.entries +2 -2
index 4f2c48fdc2..d5b4b3af2b 100644
@@ -519,7 +519,7 @@ Properties / Entry arguments:
 
 This file contains code used by the SoC that is required to make it work.
 The Management Engine is like a background task that runs things that are
-not clearly documented, but may include keyboard, display and network
+not clearly documented, but may include keyboard, deplay and network
 access. For platform that use ME it is not possible to disable it. U-Boot
 does not directly execute code in the ME binary.
 
@@ -616,7 +616,7 @@ Entry: powerpc-mpc85xx-bootpg-resetvec: PowerPC mpc85xx bootpg + resetvec code f
 Properties / Entry arguments:
     - filename: Filename of u-boot-br.bin (default 'u-boot-br.bin')
 
-This entry is valid for PowerPC mpc85xx cpus. This entry holds
+This enrty is valid for PowerPC mpc85xx cpus. This entry holds
 'bootpg + resetvec' code for PowerPC mpc85xx CPUs which needs to be
 placed at offset 'RESET_VECTOR_ADDRESS - 0xffc'.
 
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#7 lore raw

PATCH 7/15 binman: Adjust pylibfdt for incremental build

In reply to Simon Glass

If the pylibfdt shared-object file is detected, then Python assumes that the libfdt.py file exists also.

Sometimes when an incremental build aborts, the shared-object file is built but the libfdt.py is not. The only way out at this point is to use 'make mkproper', or similar.

Fix this by removing the .so file before it is built. This seems to make Python rebuild everything.

---

 scripts/dtc/pylibfdt/Makefile | 3 +++
 1 file changed, 3 insertions(+)
scripts/dtc/pylibfdt/Makefile +3 -0
index 42342c75bb..84b68ae3da 100644
@@ -24,6 +24,9 @@ quiet_cmd_pymod = PYMOD   $@
 		$(PYTHON3) $< --quiet build_ext --inplace
 
 $(obj)/_libfdt.so: $(src)/setup.py $(PYLIBFDT_srcs) FORCE
+	# Remove the library since otherwise Python doesn't seem to regenerate
+	# the libfdt.py file if it is missing.
+	rm -f $(obj)/_libfdt*.so
 	$(call if_changed,pymod)
 
 always += _libfdt.so
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#8 lore raw

PATCH 8/15 x86: rockchip: Change how selection of ROMs works

In reply to Simon Glass

Most x86 boards build a u-boot.rom which is programmed into SPI flash. But this is not unique to x86. For example some rockchip boards can also boot from SPI flash.

Also, at least on x86, binary blobs are sadly quite common. It is not possible to build a functional image without them, and U-Boot needs to know this at build time.

Introduce a new CONFIG_HAS_ROM option which selects whether u-boot.rom is built and a new CONFIG_ROM_NEEDS_BLOBS option to indicate whether binary blobs are also needed. If they are not needed, it is safe to build the ROM always. Otherwise we still require the BUILD_ROM environment variable.

For now this affects only x86, but future patches will enable this for rockchip too.

---

 Kconfig          | 18 +++++++++++++++++-
 Makefile         | 17 ++++++++++++-----
 arch/Kconfig     |  1 +
 arch/x86/Kconfig |  4 ++++
 4 files changed, 34 insertions(+), 6 deletions(-)
Kconfig +17 -1
index 0e7ccc0b07..876c5db911 100644
@@ -240,9 +240,25 @@ config PHYS_64BIT
 	  This can be used not only for 64bit SoCs, but also for
 	  large physical address extension on 32bit SoCs.
 
+config HAS_ROM
+	bool
+	select BINMAN
+	help
+	  Enables building of a u-boot.rom target. This collects U-Boot and
+	  any necessary binary blobs.
+
+config ROM_NEEDS_BLOBS
+	bool
+	depends on HAS_ROM
+	help
+	  Enable this if building the u-boot.rom target needs binary blobs, and
+	  so cannot be done normally. In this case, pass BUILD_ROM=1 to make
+	  to tell U-Boot to build the ROM.
+
 config BUILD_ROM
 	bool "Build U-Boot as BIOS replacement"
-	depends on X86
+	depends on HAS_ROM
+	default y if !ROM_NEEDS_BLOBS
 	help
 	  This option allows to build a ROM version of U-Boot.
 	  The build process generally requires several binary blobs
Makefile +12 -5
index db3b6b9991..d46338a6a4 100644
@@ -916,9 +916,12 @@ ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf
 ALL-$(CONFIG_EFI_APP) += u-boot-app.efi
 ALL-$(CONFIG_EFI_STUB) += u-boot-payload.efi
 
+ifneq ($(CONFIG_HAS_ROM),)
 ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),)
-ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
+ALL-y += u-boot.rom
 endif
+endif
+
 ifeq ($(CONFIG_SYS_COREBOOT)$(CONFIG_SPL),yy)
 ALL-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin
 endif
@@ -1580,7 +1583,7 @@ endif
 # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in
 # the middle. This is handled by binman based on an image description in the
 # board's device tree.
-ifneq ($(CONFIG_X86_RESET_VECTOR),)
+ifneq ($(CONFIG_HAS_ROM),)
 rom: u-boot.rom FORCE
 
 refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE
@@ -1590,11 +1593,12 @@ quiet_cmd_ldr = LD      $@
 cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \
 	       $(filter-out FORCE,$^) -o $@
 
-u-boot.rom: u-boot-x86-start16.bin u-boot-x86-reset16.bin u-boot.bin \
+rom-deps := u-boot.bin
+ifdef CONFIG_X86
+rom-deps += u-boot-x86-start16.bin u-boot-x86-reset16.bin \
 		$(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
 		$(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) \
-		$(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE
-	$(call if_changed,binman)
+		$(if $(CONFIG_HAVE_REFCODE),refcode.bin)
 
 OBJCOPYFLAGS_u-boot-x86-start16.bin := -O binary -j .start16
 u-boot-x86-start16.bin: u-boot FORCE
@@ -1603,6 +1607,9 @@ u-boot-x86-start16.bin: u-boot FORCE
 OBJCOPYFLAGS_u-boot-x86-reset16.bin := -O binary -j .resetvec
 u-boot-x86-reset16.bin: u-boot FORCE
 	$(call if_changed,objcopy)
+
+u-boot.rom: $(rom-deps) FORCE
+	$(call if_changed,binman)
 endif
 
 ifneq ($(CONFIG_ARCH_SUNXI),)
arch/Kconfig +1 -0
index a11f872938..bc85e5b50b 100644
@@ -160,6 +160,7 @@ config X86
 	select TIMER
 	select USE_PRIVATE_LIBGCC
 	select X86_TSC_TIMER
+	select HAS_ROM if X86_RESET_VECTOR
 	imply BLK
 	imply CMD_DM
 	imply CMD_FPGA_LOADMK
arch/x86/Kconfig +4 -0
index c8eae24c07..c688c46475 100644
@@ -360,6 +360,8 @@ config HAVE_FSP
 	bool "Add an Firmware Support Package binary"
 	depends on !EFI
 	select USE_HOB
+	select HAS_ROM
+	select ROM_NEEDS_BLOBS
 	help
 	  Select this option to add an Firmware Support Package binary to
 	  the resulting U-Boot image. It is a binary blob which U-Boot uses
@@ -519,6 +521,8 @@ config ENABLE_MRC_CACHE
 
 config HAVE_MRC
 	bool "Add a System Agent binary"
+	select HAS_ROM
+	select ROM_NEEDS_BLOBS
 	depends on !HAVE_FSP
 	help
 	  Select this option to add a System Agent binary to
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#9 lore raw

PATCH 9/15 rockchip: Allow Bob to use SPI boot

In reply to Simon Glass

Bob is a Chromebook and can boot from SPI flash. Add it to the condition check for this.

---

 arch/arm/mach-rockchip/spl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-rockchip/spl.c +2 -1
index cddf4fd3d5..f148d48b6a 100644
@@ -54,7 +54,8 @@ u32 spl_boot_device(void)
 #if defined(CONFIG_TARGET_CHROMEBOOK_JERRY) || \
 		defined(CONFIG_TARGET_CHROMEBIT_MICKEY) || \
 		defined(CONFIG_TARGET_CHROMEBOOK_MINNIE) || \
-		defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY)
+		defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY) || \
+		defined(CONFIG_TARGET_CHROMEBOOK_BOB)
 	return BOOT_DEVICE_SPI;
 #endif
 	if (CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM))
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#10 lore raw

PATCH 10/15 Allow building .rom files for non-x86 boards

In reply to Simon Glass

Some non-x86 devices can use SPI flash to boot and need to produce images of a fixed size to program the flash.

Add a way to handle this for non-x86 boards.

---

 Makefile | 13 +++++++++++++
 1 file changed, 13 insertions(+)
Makefile +13 -0
index d46338a6a4..b2fde0b98d 100644
@@ -1608,6 +1608,19 @@ OBJCOPYFLAGS_u-boot-x86-reset16.bin := -O binary -j .resetvec
 u-boot-x86-reset16.bin: u-boot FORCE
 	$(call if_changed,objcopy)
 
+else # !CONFIG_X86
+
+ifdef CONFIG_SPL
+rom-deps += spl/u-boot-spl.bin
+rom-deps += u-boot.img
+endif
+
+ifdef CONFIG_TPL
+rom-deps += tpl/u-boot-tpl.bin
+endif
+
+endif
+
 u-boot.rom: $(rom-deps) FORCE
 	$(call if_changed,binman)
 endif
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#11 lore raw

PATCH 11/15 rockchip: jerry: Add serial support

In reply to Simon Glass

This option allows the serial console to work correctly. Add it.

---

 configs/chromebook_jerry_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/chromebook_jerry_defconfig +1 -0
index 443e3cdace..7f772b828f 100644
@@ -85,6 +85,7 @@ CONFIG_PWM_ROCKCHIP=y
 CONFIG_RAM=y
 CONFIG_SPL_RAM=y
 CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_ROCKCHIP_SERIAL=y
 CONFIG_SOUND=y
 CONFIG_I2S=y
 CONFIG_I2S_ROCKCHIP=y
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#12 lore raw

PATCH 12/15 rockchip: bob: Support SPI-flash booting

In reply to Simon Glass

Update the config for chromebook_bob to support booting from SPI flash. The existing SPL size is too small since ATF is needed, so double it.

---

 configs/chromebook_bob_defconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
configs/chromebook_bob_defconfig +3 -1
index 4f606e7ec9..8df4bbc197 100644
@@ -3,7 +3,7 @@ CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_ENV_OFFSET=0x3F8000
-CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x40000
 CONFIG_ROCKCHIP_RK3399=y
 CONFIG_ROCKCHIP_BOOT_MODE_REG=0
 CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x4000
@@ -40,6 +40,7 @@ CONFIG_DEFAULT_DEVICE_TREE="rk3399-gru-bob"
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_I2C_CROS_EC_TUNNEL=y
 CONFIG_SYS_I2C_ROCKCHIP=y
@@ -53,6 +54,7 @@ CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_DM_ETH=y
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#13 lore raw

PATCH 13/15 rockchip: Allow including rockchip dtsi on 32-bit machines

In reply to Simon Glass

At present this file supports only 64-bit machines. Add an #ifdef so that it can be included without problems on 32-bit machines also.

---

 arch/arm/dts/rockchip-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/rockchip-u-boot.dtsi +2 -0
index a2559e2db0..d2542f2230 100644
@@ -6,6 +6,7 @@
 #include <config.h>
 
 / {
+#ifdef CONFIG_ARM64
 	binman {
 		filename = "u-boot-rockchip.bin";
 		pad-byte = <0xff>;
@@ -18,4 +19,5 @@
 			offset = <CONFIG_SPL_PAD_TO>;
 		};
 	};
+#endif
 };
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#14 lore raw

PATCH 14/15 rockchip: Enable building a SPI ROM image on jerry

In reply to Simon Glass

Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot produces a ROM for jerry.

Change the binman image definition to support multiple images, since it may be used to build both u-boot-rockchip.bin and u-boot.rom

---

 arch/arm/dts/rk3288-u-boot.dtsi       | 24 ++++++++++++++++++++++++
 arch/arm/dts/rockchip-u-boot.dtsi     | 10 ++++++++--
 arch/arm/mach-rockchip/rk3288/Kconfig |  1 +
 3 files changed, 33 insertions(+), 2 deletions(-)
arch/arm/dts/rk3288-u-boot.dtsi +24 -0
index 6d31735362..104a5392bf 100644
@@ -12,6 +12,30 @@
 	};
 };
 
+#ifdef CONFIG_HAS_ROM
+&binman {
+	rom {
+		filename = "u-boot.rom";
+		size = <0x400000>;
+		pad-byte = <0xff>;
+
+		mkimage {
+			args = "-n rk3288 -T rkspi";
+			u-boot-spl {
+			};
+		};
+		u-boot-img {
+			offset = <0x20000>;
+		};
+		u-boot {
+			offset = <0x300000>;
+		};
+		fdtmap {
+		};
+	};
+};
+#endif
+
 &dmc {
 	u-boot,dm-pre-reloc;
 };
arch/arm/dts/rockchip-u-boot.dtsi +8 -2
index d2542f2230..c0d9a2ad55 100644
@@ -6,8 +6,14 @@
 #include <config.h>
 
 / {
+	binman: binman {
+		multiple-images;
+	};
+};
+
 #ifdef CONFIG_ARM64
-	binman {
+&binman {
+	simple-bin {
 		filename = "u-boot-rockchip.bin";
 		pad-byte = <0xff>;
 
@@ -19,5 +25,5 @@
 			offset = <CONFIG_SPL_PAD_TO>;
 		};
 	};
-#endif
 };
+#endif
arch/arm/mach-rockchip/rk3288/Kconfig +1 -0
index afb62fca78..dfc9da9238 100644
@@ -5,6 +5,7 @@ choice
 
 config TARGET_CHROMEBOOK_JERRY
 	bool "Google/Rockchip Veyron-Jerry Chromebook"
+	select HAS_ROM
 	select BOARD_LATE_INIT
 	help
 	  Jerry is a RK3288-based clamshell device with 2 USB 3.0 ports,
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
#15 lore raw

PATCH 15/15 rockchip: Enable building a SPI ROM image on bob

In reply to Simon Glass

Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot produces a ROM for bob.

---

 arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 ++++
 arch/arm/dts/rk3399-gru.dtsi          |  2 +-
 arch/arm/dts/rk3399-u-boot.dtsi       | 27 +++++++++++++++++++++++++++
 arch/arm/mach-rockchip/rk3399/Kconfig |  1 +
 4 files changed, 33 insertions(+), 1 deletion(-)
arch/arm/dts/rk3399-gru-u-boot.dtsi +4 -0
index 7bddc3acdb..390ac2bb5a 100644
@@ -4,3 +4,7 @@
  */
 
 #include "rk3399-u-boot.dtsi"
+
+&spi_flash {
+	u-boot,dm-pre-reloc;
+};
arch/arm/dts/rk3399-gru.dtsi +1 -1
index 7ac88392f2..f9c5bb607b 100644
@@ -537,7 +537,7 @@ ap_i2c_audio: &i2c8 {
 	pinctrl-names = "default", "sleep";
 	pinctrl-1 = <&spi1_sleep>;
 
-	spiflash at 0 {
+	spi_flash: spiflash at 0 {
 		compatible = "jedec,spi-nor";
 		reg = <0>;
 
arch/arm/dts/rk3399-u-boot.dtsi +27 -0
index 8237782408..a76bbea730 100644
@@ -4,11 +4,14 @@
  */
 #define USB_CLASS_HUB			9
 
+#include "rockchip-u-boot.dtsi"
+
 / {
 	aliases {
 		mmc0 = &sdhci;
 		mmc1 = &sdmmc;
 		pci0 = &pcie0;
+		spi1 = &spi1;
 	};
 
 	cic: syscon at ff620000 {
@@ -57,6 +60,30 @@
 
 };
 
+#ifdef CONFIG_HAS_ROM
+&binman {
+	rom {
+		filename = "u-boot.rom";
+		size = <0x400000>;
+		pad-byte = <0xff>;
+
+		mkimage {
+			args = "-n rk3399 -T rkspi";
+			u-boot-spl {
+			};
+		};
+		u-boot-img {
+			offset = <0x40000>;
+		};
+		u-boot {
+			offset = <0x300000>;
+		};
+		fdtmap {
+		};
+	};
+};
+#endif
+
 &cru {
 	u-boot,dm-pre-reloc;
 };
arch/arm/mach-rockchip/rk3399/Kconfig +1 -0
index 254b9c5b4d..8b91d4713d 100644
@@ -5,6 +5,7 @@ choice
 
 config TARGET_CHROMEBOOK_BOB
 	bool "Asus Flip C101PA Chromebook (RK3399)"
+	select HAS_ROM
 	help
 	  Bob is a small RK3299-based device similar in apperance to Minnie.
 	  It has two USB 3.0 type-C ports, 4GB of SDRAM, WiFi and a 10.1",
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog