From b8b88e6aff3ea7346a39bfbb27124b275ce56666 Mon Sep 17 00:00:00 2001 From: David Rivshin Date: Mon, 18 Feb 2019 18:04:29 -0500 Subject: [PATCH 1/9] spi: omap3: fix set_wordlen() reading from incorrect address for CHCONF _omap3_spi_set_wordlen() indexed the regs->channel[] array with the old wordlen (instead of the chipselect number) when reading the current CHCONF register value. This meant it read from the wrong memory location, modified that value, and then wrote it back to the correct CHCONF register. The end result is that most slave configuration settings would be lost, such as clock divisor, clock/chipselect polarities, etc. Fixes: 77b8d04854f4 ("spi: omap3: Convert to driver model") Signed-off-by: David Rivshin --- drivers/spi/omap3_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c index c7fcf050a5..ff4c700645 100644 --- a/drivers/spi/omap3_spi.c +++ b/drivers/spi/omap3_spi.c @@ -415,7 +415,7 @@ static void _omap3_spi_set_wordlen(struct omap3_spi_priv *priv) unsigned int confr; /* McSPI individual channel configuration */ - confr = readl(&priv->regs->channel[priv->wordlen].chconf); + confr = readl(&priv->regs->channel[priv->cs].chconf); /* wordlength */ confr &= ~OMAP3_MCSPI_CHCONF_WL_MASK; From 86dc480d73776e6628ea39a5429f160ffdc2ec85 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Tue, 19 Feb 2019 01:43:51 +0100 Subject: [PATCH 2/9] ARM: cache: Fix incorrect bitwise operation The loop implemented in the code is supposed to check whether the PL310 operation register has any bit from the mask set. Currently, the code checks whether the PL310 operation register has any bit set AND whether the mask is non-zero, which is incorrect. Fix the conditional. Signed-off-by: Marek Vasut Cc: Dalon Westergreen Cc: Dinh Nguyen Cc: Tom Rini Fixes: 93bc21930a1b ("armv7: add PL310 support to u-boot") Reviewed-by: Simon Goldschmidt Reviewed-by: Dinh Nguyen --- arch/arm/lib/cache-pl310.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/lib/cache-pl310.c b/arch/arm/lib/cache-pl310.c index 1296ba6efd..bbaaaa4157 100644 --- a/arch/arm/lib/cache-pl310.c +++ b/arch/arm/lib/cache-pl310.c @@ -33,7 +33,7 @@ static void pl310_background_op_all_ways(u32 *op_reg) /* Invalidate all ways */ writel(way_mask, op_reg); /* Wait for all ways to be invalidated */ - while (readl(op_reg) && way_mask) + while (readl(op_reg) & way_mask) ; pl310_cache_sync(); } From 0a8573052afcee0b026073ae8625679ed1765556 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 21 Feb 2019 07:48:54 +0100 Subject: [PATCH 3/9] .gitignore: Ignore regenerated *.dtbo files *.dtbo are dt overlays files which should be also ignored as *.dtb. Signed-off-by: Michal Simek --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8d18d6f49b..3df3139d23 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ *.bin *.cfgout *.dtb +*.dtbo *.dtb.S *.elf *.exe From a319229fdaced1aa74f8d7a0ffa1194f352a5a38 Mon Sep 17 00:00:00 2001 From: Felix Brack Date: Mon, 25 Feb 2019 16:38:23 +0100 Subject: [PATCH 4/9] arm: pdu001: Fix order of include files Fix the order of include files according to U-Boot coding style. Signed-off-by: Felix Brack --- board/eets/pdu001/mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/eets/pdu001/mux.c b/board/eets/pdu001/mux.c index f1d38e9b74..f0f9e262eb 100644 --- a/board/eets/pdu001/mux.c +++ b/board/eets/pdu001/mux.c @@ -8,11 +8,11 @@ */ #include +#include #include #include #include #include -#include #include "board.h" static struct module_pin_mux uart0_pin_mux[] = { From 7274b7638a3ed03f64faff185253b2bccf557877 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 25 Feb 2019 19:42:48 +0100 Subject: [PATCH 5/9] fs: fat: fix link error when building with DEBUG=1 When compiling with DEBUG=1 an error fs/fat/fat_write.c:831: undefined reference to `__aeabi_ldivmod' occurred. We should use do_div() instead of the modulus operator. filesize and cur_pos cannot be negative. So let's use u64 to avoid warnings. Fixes: cb8af8af5ba0 ("fs: fat: support write with non-zero offset") Signed-off-by: Heinrich Schuchardt --- fs/fat/fat_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c index 3272412ca9..852f874e58 100644 --- a/fs/fat/fat_write.c +++ b/fs/fat/fat_write.c @@ -696,11 +696,11 @@ static int set_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos, __u8 *buffer, loff_t maxsize, loff_t *gotsize) { - loff_t filesize; unsigned int bytesperclust = mydata->clust_size * mydata->sect_size; __u32 curclust = START(dentptr); __u32 endclust = 0, newclust = 0; - loff_t cur_pos, offset, actsize, wsize; + u64 cur_pos, filesize; + loff_t offset, actsize, wsize; *gotsize = 0; filesize = pos + maxsize; @@ -828,7 +828,7 @@ set_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos, __u8 *buffer, curclust = endclust; filesize -= cur_pos; - assert(!(cur_pos % bytesperclust)); + assert(!do_div(cur_pos, bytesperclust)); set_clusters: /* allocate and write */ From 3a29afcbbfd8eb6d58f06b1717807c036971ca58 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 26 Feb 2019 13:09:00 +0100 Subject: [PATCH 6/9] doc: binding: rename directory ram to memory-controller Alignment with kernel directory name as it have already bindings for DDR controllers in the directory: Documentation/devicetree/bindings/memory-controller PS: the drivers using RAM u-class should be associated with this binding directory Signed-off-by: Patrick Delaunay --- .../{ram => memory-controllers}/k3-am654-ddrss.txt | 0 .../{ram => memory-controllers}/st,stm32-fmc.txt | 0 .../{ram => memory-controllers}/st,stm32mp1-ddr.txt | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename doc/device-tree-bindings/{ram => memory-controllers}/k3-am654-ddrss.txt (100%) rename doc/device-tree-bindings/{ram => memory-controllers}/st,stm32-fmc.txt (100%) rename doc/device-tree-bindings/{ram => memory-controllers}/st,stm32mp1-ddr.txt (100%) diff --git a/doc/device-tree-bindings/ram/k3-am654-ddrss.txt b/doc/device-tree-bindings/memory-controllers/k3-am654-ddrss.txt similarity index 100% rename from doc/device-tree-bindings/ram/k3-am654-ddrss.txt rename to doc/device-tree-bindings/memory-controllers/k3-am654-ddrss.txt diff --git a/doc/device-tree-bindings/ram/st,stm32-fmc.txt b/doc/device-tree-bindings/memory-controllers/st,stm32-fmc.txt similarity index 100% rename from doc/device-tree-bindings/ram/st,stm32-fmc.txt rename to doc/device-tree-bindings/memory-controllers/st,stm32-fmc.txt diff --git a/doc/device-tree-bindings/ram/st,stm32mp1-ddr.txt b/doc/device-tree-bindings/memory-controllers/st,stm32mp1-ddr.txt similarity index 100% rename from doc/device-tree-bindings/ram/st,stm32mp1-ddr.txt rename to doc/device-tree-bindings/memory-controllers/st,stm32mp1-ddr.txt From 2737dfe096b6c34654734a5a4dc5f4b4962c5617 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 26 Feb 2019 12:20:25 -0700 Subject: [PATCH 7/9] kbuild: make arch-dtbs target PHONY Without this, the arch-dtbs target only gets evaluated when building U-Boot the first time, not when re-building (incrementally building) U-Boot. Thus incremental builds ignore changes to DTB files. Signed-off-by: Stephen Warren Reviewed-by: Masahiro Yamada --- dts/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/dts/Makefile b/dts/Makefile index a7a604303c..4970223b3d 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -40,6 +40,7 @@ endif echo >&2; \ /bin/false) +PHONY += arch-dtbs arch-dtbs: $(Q)$(MAKE) $(build)=$(ARCH_PATH) dtbs From 8422ad51652f8f33acd3f03f24ec2aea73083eb7 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 26 Feb 2019 12:20:26 -0700 Subject: [PATCH 8/9] kbuild: fix DTB .cmd source variable *.dts are processed using a custom command, then the C pre-processor is run on them, then they are compiled using dtc. Thus, the dependency files generated by both cpp and dtc reference a temporary file name rather than the actual source file. While this information isn't used for any purpose by the build system, and hence this causes no functional issue, it does cause the dependency files to contain invalid and confusing data, which is unhelpful while debugging build problems. Fix this using sed. Signed-off-by: Stephen Warren Reviewed-by: Masahiro Yamada --- scripts/Makefile.lib | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 704d644f6f..ec5c41ec56 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -301,7 +301,8 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ $(DTC) -O dtb -o $@ -b 0 \ -i $(dir $<) $(DTC_FLAGS) \ -d $(depfile).dtc.tmp $(dtc-tmp) ; \ - cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) + cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) ; \ + sed -i "s:$(pre-tmp):$(<):" $(depfile) $(obj)/%.dtb: $(src)/%.dts FORCE $(call if_changed_dep,dtc) From 438dcabb75d6b9b0e7f887befb753d1863f14deb Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Tue, 26 Feb 2019 22:27:52 +0100 Subject: [PATCH 9/9] spl: add debug print for early malloc usage To find out how big the early malloc heap must be in SPL, add a debug print statement that dumps its usage before switching to relocated heap in spl_relocate_stack_gd() via CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN. Signed-off-by: Simon Goldschmidt --- common/spl/spl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/spl/spl.c b/common/spl/spl.c index 2e2af1b28e..88d4b8a9bf 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -728,6 +728,8 @@ ulong spl_relocate_stack_gd(void) #if defined(CONFIG_SPL_SYS_MALLOC_SIMPLE) && CONFIG_VAL(SYS_MALLOC_F_LEN) if (CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN) { + debug("SPL malloc() before relocation used 0x%lx bytes (%ld KB)\n", + gd->malloc_ptr, gd->malloc_ptr / 1024); ptr -= CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN; gd->malloc_base = ptr; gd->malloc_limit = CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN;