Merge tag 'u-boot-stm32-20220617' of https://source.denx.de/u-boot/custodians/u-boot-stm
authorTom Rini <trini@konsulko.com>
Fri, 17 Jun 2022 13:41:11 +0000 (09:41 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 17 Jun 2022 13:41:11 +0000 (09:41 -0400)
- Fix the stm32prog command for stm32mp platform
- Add stm32mp15x DHCOR based DRC Compact board

27 files changed:
.gitignore
arch/arm/cpu/armv8/cache_v8.c
arch/arm/cpu/armv8/fsl-layerscape/cpu.c
arch/arm/cpu/armv8/start.S
arch/arm/dts/imx8mq-kontron-pitx-imx8m-u-boot.dtsi
arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
arch/arm/dts/socfpga_stratix10_socdk-u-boot.dtsi
arch/arm/dts/socfpga_stratix10_socdk.dts
arch/arm/include/asm/armv8/mmu.h
arch/arm/mach-k3/am642_init.c
arch/arm/mach-socfpga/timer_s10.c
board/cssi/MAINTAINERS
board/ti/am335x/board.c
doc/git-mailrc
drivers/cache/cache-ncore.c
drivers/crypto/fsl/fsl_hash.c
drivers/ddr/altera/sdram_n5x.c
drivers/ddr/altera/sdram_s10.c
drivers/ddr/altera/sdram_soc64.c
drivers/ddr/altera/sdram_soc64.h
drivers/usb/host/ehci-generic.c
fs/squashfs/sqfs.c
include/configs/odroid_xu3.h
include/configs/socfpga_vining_fpga.h
include/fs.h
net/Kconfig
tools/binman/setup.py

index 28c439f..eb769f1 100644 (file)
@@ -10,6 +10,7 @@
 *.asn1.[ch]
 *.bin
 *.cfgout
+*.cover
 *.dtb
 *.dtbo
 *.dtb.S
@@ -22,6 +23,7 @@
 *.lex.c
 *.lst
 *.mod.c
+*.mbx
 *.o
 *.o.*
 *.order
index 3de18c7..e4736e5 100644 (file)
@@ -39,8 +39,28 @@ DECLARE_GLOBAL_DATA_PTR;
  *    off:          FFF
  */
 
-u64 get_tcr(int el, u64 *pips, u64 *pva_bits)
+static int get_effective_el(void)
 {
+       int el = current_el();
+
+       if (el == 2) {
+               u64 hcr_el2;
+
+               /*
+                * If we are using the EL2&0 translation regime, the TCR_EL2
+                * looks like the EL1 version, even though we are in EL2.
+                */
+               __asm__ ("mrs %0, HCR_EL2\n" : "=r" (hcr_el2));
+               if (hcr_el2 & BIT(HCR_EL2_E2H_BIT))
+                       return 1;
+       }
+
+       return el;
+}
+
+u64 get_tcr(u64 *pips, u64 *pva_bits)
+{
+       int el = get_effective_el();
        u64 max_addr = 0;
        u64 ips, va_bits;
        u64 tcr;
@@ -115,7 +135,7 @@ static u64 *find_pte(u64 addr, int level)
 
        debug("addr=%llx level=%d\n", addr, level);
 
-       get_tcr(0, NULL, &va_bits);
+       get_tcr(NULL, &va_bits);
        if (va_bits < 39)
                start_level = 1;
 
@@ -343,7 +363,7 @@ __weak u64 get_page_table_size(void)
        u64 va_bits;
        int start_level = 0;
 
-       get_tcr(0, NULL, &va_bits);
+       get_tcr(NULL, &va_bits);
        if (va_bits < 39)
                start_level = 1;
 
@@ -415,7 +435,7 @@ __weak void mmu_setup(void)
                setup_all_pgtables();
 
        el = current_el();
-       set_ttbr_tcr_mair(el, gd->arch.tlb_addr, get_tcr(el, NULL, NULL),
+       set_ttbr_tcr_mair(el, gd->arch.tlb_addr, get_tcr(NULL, NULL),
                          MEMORY_ATTRIBUTES);
 
        /* enable the mmu */
index 253008a..c989a43 100644 (file)
@@ -454,7 +454,7 @@ static inline void early_mmu_setup(void)
 
        /* point TTBR to the new table */
        set_ttbr_tcr_mair(el, gd->arch.tlb_addr,
-                         get_tcr(el, NULL, NULL) &
+                         get_tcr(NULL, NULL) &
                          ~(TCR_ORGN_MASK | TCR_IRGN_MASK),
                          MEMORY_ATTRIBUTES);
 
@@ -609,7 +609,7 @@ static inline void final_mmu_setup(void)
        invalidate_icache_all();
 
        /* point TTBR to the new table */
-       set_ttbr_tcr_mair(el, gd->arch.tlb_addr, get_tcr(el, NULL, NULL),
+       set_ttbr_tcr_mair(el, gd->arch.tlb_addr, get_tcr(NULL, NULL),
                          MEMORY_ATTRIBUTES);
 
        set_sctlr(get_sctlr() | CR_M);
index d328e8c..28f0df1 100644 (file)
@@ -125,7 +125,7 @@ pie_fixup_done:
        msr     cptr_el3, xzr                   /* Enable FP/SIMD */
        b       0f
 2:     mrs     x1, hcr_el2
-       tbnz    x1, #34, 1f                     /* HCR_EL2.E2H */
+       tbnz    x1, #HCR_EL2_E2H_BIT, 1f        /* HCR_EL2.E2H */
        orr     x1, x1, #HCR_EL2_AMO_EL2        /* Route SErrors to EL2 */
        msr     hcr_el2, x1
        set_vbar vbar_el2, x0
index 6f9c814..d361f3f 100644 (file)
        sd-uhs-sdr104;
        sd-uhs-ddr50;
 };
+
+&uart1 {
+       /delete-property/ assigned-clocks;
+       /delete-property/ assigned-clock-parents;
+};
+
+&uart2 {
+       /delete-property/ assigned-clocks;
+       /delete-property/ assigned-clock-parents;
+};
+
+&uart3 {
+       /delete-property/ assigned-clocks;
+       /delete-property/ assigned-clock-parents;
+};
index 6cac36a..2400fad 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * U-Boot additions
  *
- * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ * Copyright (C) 2019-2022 Intel Corporation <www.intel.com>
  */
 
 #include "socfpga_agilex-u-boot.dtsi"
        aliases {
                spi0 = &qspi;
                i2c0 = &i2c1;
+               freeze_br0 = &freeze_controller;
+       };
+
+       soc {
+               freeze_controller: freeze_controller@f9000450 {
+                       compatible = "altr,freeze-bridge-controller";
+                       reg = <0xf9000450 0x00000010>;
+                       status = "disabled";
+               };
        };
 
        memory {
index 61df425..75a2904 100755 (executable)
@@ -2,7 +2,7 @@
 /*
  * U-Boot additions
  *
- * Copyright (C) 2019-2020 Intel Corporation <www.intel.com>
+ * Copyright (C) 2019-2022 Intel Corporation <www.intel.com>
  */
 
 #include "socfpga_stratix10-u-boot.dtsi"
 /{
        aliases {
                spi0 = &qspi;
+               freeze_br0 = &freeze_controller;
+       };
+
+       soc {
+               freeze_controller: freeze_controller@f9000450 {
+                       compatible = "altr,freeze-bridge-controller";
+                       reg = <0xf9000450 0x00000010>;
+                       status = "disabled";
+               };
        };
 };
 
index b7b48a5..8aa55a6 100755 (executable)
@@ -92,7 +92,7 @@
        broken-cd;
        bus-width = <4>;
        drvsel = <3>;
-       smplsel = <0>;
+       smplsel = <2>;
 };
 
 &qspi {
index c36b2cf..9f58ced 100644 (file)
 #define TCR_EL2_RSVD           (1U << 31 | 1 << 23)
 #define TCR_EL3_RSVD           (1U << 31 | 1 << 23)
 
+#define HCR_EL2_E2H_BIT                34
+
 #ifndef __ASSEMBLY__
 static inline void set_ttbr_tcr_mair(int el, u64 table, u64 tcr, u64 attr)
 {
@@ -134,7 +136,7 @@ struct mm_region {
 
 extern struct mm_region *mem_map;
 void setup_pgtables(void);
-u64 get_tcr(int el, u64 *pips, u64 *pva_bits);
+u64 get_tcr(u64 *pips, u64 *pva_bits);
 #endif
 
 #endif /* _ASM_ARMV8_MMU_H_ */
index add7ea8..b16de9c 100644 (file)
@@ -47,6 +47,9 @@ static void ctrl_mmr_unlock(void)
        mmr_unlock(CTRL_MMR0_BASE, 3);
        mmr_unlock(CTRL_MMR0_BASE, 5);
        mmr_unlock(CTRL_MMR0_BASE, 6);
+
+       /* Unlock all MCU_PADCFG_MMR1 module registers */
+       mmr_unlock(MCU_PADCFG_MMR1_BASE, 1);
 }
 
 /*
index 7d5598e..84b13ce 100644 (file)
@@ -1,11 +1,12 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2017-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2017-2022 Intel Corporation <www.intel.com>
  *
  */
 
 #include <common.h>
 #include <init.h>
+#include <div64.h>
 #include <asm/io.h>
 #include <asm/arch/timer.h>
 
@@ -26,3 +27,34 @@ int timer_init(void)
 #endif
        return 0;
 }
+
+__always_inline u64 __get_time_stamp(void)
+{
+       u64 cntpct;
+
+       isb();
+       asm volatile("mrs %0, cntpct_el0" : "=r" (cntpct));
+
+       return cntpct;
+}
+
+__always_inline uint64_t __usec_to_tick(unsigned long usec)
+{
+       u64 tick = usec;
+       u64 cntfrq;
+
+       asm volatile("mrs %0, cntfrq_el0" : "=r" (cntfrq));
+       tick *= cntfrq;
+       do_div(tick, 1000000);
+
+       return tick;
+}
+
+__always_inline void __udelay(unsigned long usec)
+{
+       /* get current timestamp */
+       u64 tmp = __get_time_stamp() + __usec_to_tick(usec);
+
+       while (__get_time_stamp() < tmp + 1)    /* loop till event */
+               ;
+}
\ No newline at end of file
index cbf1406..7d237b0 100644 (file)
@@ -1,5 +1,5 @@
-BOARDS from CS Systemes d'Information
-M:     Christophe Leroy <christophe.leroy@c-s.fr>
+BOARDS from CS GROUP France
+M:     Christophe Leroy <christophe.leroy@csgroup.eu>
 S:     Maintained
 F:     board/cssi/
 F:     include/configs/MCR3000.h
index 7c05458..2cb5b1c 100644 (file)
@@ -902,7 +902,7 @@ int board_late_init(void)
 #endif
 
 /* CPSW plat */
-#if !CONFIG_IS_ENABLED(OF_CONTROL)
+#if CONFIG_IS_ENABLED(NET) && !CONFIG_IS_ENABLED(OF_CONTROL)
 struct cpsw_slave_data slave_data[] = {
        {
                .slave_reg_ofs  = CPSW_SLAVE0_OFFSET,
index 63c2f6e..b00c278 100644 (file)
@@ -95,7 +95,7 @@ alias nios2          nios
 
 alias powerpc        uboot, afleming, stroese, wd, priyankajain, mariosix
 alias ppc            powerpc
-alias mpc8xx         uboot, wd, Christophe Leroy <christophe.leroy@c-s.fr>
+alias mpc8xx         uboot, wd, Christophe Leroy <christophe.leroy@csgroup.eu>
 alias mpc83xx        uboot, mariosix
 alias mpc85xx        uboot, afleming, priyankajain
 
index 3beff78..117d2b9 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ * Copyright (C) 2019-2022 Intel Corporation <www.intel.com>
  *
  */
 #include <dm.h>
@@ -81,8 +81,8 @@ static void ncore_ccu_init_dirs(void __iomem *base)
                                hang();
                        }
 
-                       /* Enable snoop filter, a bit per snoop filter */
-                       setbits_le32((ulong)CCU_DIR_REG_ADDR(base, DIRUSFER, i),
+                       /* Disable snoop filter, a bit per snoop filter */
+                       clrbits_le32((ulong)CCU_DIR_REG_ADDR(base, DIRUSFER, i),
                                     BIT(f));
                }
        }
index 9e6829b..5751967 100644 (file)
@@ -176,12 +176,6 @@ int caam_hash(const unsigned char *pbuf, unsigned int buf_len,
        uint32_t *desc;
        unsigned int size;
 
-       if (!IS_ALIGNED((uintptr_t)pbuf, ARCH_DMA_MINALIGN) ||
-           !IS_ALIGNED((uintptr_t)pout, ARCH_DMA_MINALIGN)) {
-               puts("Error: Address arguments are not aligned\n");
-               return -EINVAL;
-       }
-
        desc = malloc_cache_aligned(sizeof(int) * MAX_CAAM_DESCSIZE);
        if (!desc) {
                debug("Not enough memory for descriptor allocation\n");
index ac13ac4..737a4e2 100644 (file)
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: GPL-2.0
+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2020-2021 Intel Corporation <www.intel.com>
+ * Copyright (C) 2020-2022 Intel Corporation <www.intel.com>
  *
  */
 
index d3a6d21..4d36fb4 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2022 Intel Corporation <www.intel.com>
  *
  */
 
@@ -277,7 +277,7 @@ int sdram_mmr_init_full(struct udevice *dev)
                        DDR_SCH_DEVTODEV);
 
        /* assigning the SDRAM size */
-       unsigned long long size = sdram_calculate_size(plat);
+       phys_size_t size = sdram_calculate_size(plat);
        /* If the size is invalid, use default Config size */
        if (size <= 0)
                hw_size = PHYS_SDRAM_1_SIZE;
index d6baac2..9b1710c 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2016-2021 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2022 Intel Corporation <www.intel.com>
  *
  */
 
@@ -239,7 +239,8 @@ phys_size_t sdram_calculate_size(struct altera_sdram_plat *plat)
 {
        u32 dramaddrw = hmc_readl(plat, DRAMADDRW);
 
-       phys_size_t size = 1 << (DRAMADDRW_CFG_CS_ADDR_WIDTH(dramaddrw) +
+       phys_size_t size = (phys_size_t)1 <<
+                       (DRAMADDRW_CFG_CS_ADDR_WIDTH(dramaddrw) +
                         DRAMADDRW_CFG_BANK_GRP_ADDR_WIDTH(dramaddrw) +
                         DRAMADDRW_CFG_BANK_ADDR_WIDTH(dramaddrw) +
                         DRAMADDRW_CFG_ROW_ADDR_WIDTH(dramaddrw) +
index 7460f8c..07a0f9f 100644 (file)
@@ -53,7 +53,7 @@ struct altera_sdram_plat {
 #define DDR_HMC_INTSTAT_DERRPENA_SET_MSK       BIT(1)
 #define DDR_HMC_INTSTAT_ADDRMTCFLG_SET_MSK     BIT(16)
 #define DDR_HMC_INTMODE_INTMODE_SET_MSK                BIT(0)
-#define DDR_HMC_RSTHANDSHAKE_MASK              0x000000ff
+#define DDR_HMC_RSTHANDSHAKE_MASK              0x0000000f
 #define DDR_HMC_CORE2SEQ_INT_REQ               0xF
 #define DDR_HMC_SEQ2CORE_INT_RESP_MASK         BIT(3)
 #define DDR_HMC_HPSINTFCSEL_ENABLE_MASK                0x001f1f1f
index 4734af0..15267e9 100644 (file)
@@ -69,7 +69,7 @@ static int ehci_usb_probe(struct udevice *dev)
 
        err = 0;
        ret = clk_get_bulk(dev, &priv->clocks);
-       if (ret) {
+       if (ret && ret != -ENOENT) {
                dev_err(dev, "Failed to get clocks (ret=%d)\n", ret);
                return ret;
        }
@@ -81,7 +81,7 @@ static int ehci_usb_probe(struct udevice *dev)
        }
 
        err = reset_get_bulk(dev, &priv->resets);
-       if (err) {
+       if (ret && ret != -ENOENT) {
                dev_err(dev, "Failed to get resets (err=%d)\n", err);
                goto clk_err;
        }
index 547d2fd..b9f05ef 100644 (file)
@@ -975,6 +975,7 @@ int sqfs_readdir(struct fs_dir_stream *fs_dirs, struct fs_dirent **dentp)
        int i_number, offset = 0, ret;
        struct fs_dirent *dent;
        unsigned char *ipos;
+       u16 name_size;
 
        dirs = (struct squashfs_dir_stream *)fs_dirs;
        if (!dirs->size) {
@@ -1057,9 +1058,10 @@ int sqfs_readdir(struct fs_dir_stream *fs_dirs, struct fs_dirent **dentp)
                return -SQFS_STOP_READDIR;
        }
 
-       /* Set entry name */
-       strncpy(dent->name, dirs->entry->name, dirs->entry->name_size + 1);
-       dent->name[dirs->entry->name_size + 1] = '\0';
+       /* Set entry name (capped at FS_DIRENT_NAME_LEN which is a U-Boot limitation) */
+       name_size = min_t(u16, dirs->entry->name_size + 1, FS_DIRENT_NAME_LEN - 1);
+       strncpy(dent->name, dirs->entry->name, name_size);
+       dent->name[name_size] = '\0';
 
        offset = dirs->entry->name_size + 1 + SQFS_ENTRY_BASE_LENGTH;
        dirs->entry_count--;
index eb35d7b..360815b 100644 (file)
@@ -86,6 +86,7 @@
        "rootfstype=ext4\0" \
        "console=console=ttySAC2,115200n8\0" \
        "fdtfile=exynos5422-odroidxu3.dtb\0" \
+       "board=odroid\0" \
        "board_name=odroidxu3\0" \
        "mmcbootdev=0\0" \
        "mmcrootdev=0\0" \
index 9455e4c..c333c93 100644 (file)
        "addargs=run addcons addmtd addmisc\0"                          \
        "ubiload="                                                      \
                "ubi part ${ubimtd} ; ubifsmount ${ubipart} ; "         \
-               "ubifsload ${kernel_addr_r} /boot/${bootfile}\0"        \
+               "ubifsload ${kernel_addr_r} /boot/${bootfile} ; "       \
+               "ubifsumount ; ubi detach\0"                            \
        "netload="                                                      \
                "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0"       \
        "miscargs=nohlt panic=1\0"                                      \
index b43f16a..2195dc1 100644 (file)
@@ -174,6 +174,8 @@ int fs_write(const char *filename, ulong addr, loff_t offset, loff_t len,
 #define FS_DT_REG  8         /* regular file */
 #define FS_DT_LNK  10        /* symbolic link */
 
+#define FS_DIRENT_NAME_LEN 256
+
 /**
  * struct fs_dirent - directory entry
  *
@@ -194,7 +196,7 @@ struct fs_dirent {
        /** change_time:        time of last modification */
        struct rtc_time change_time;
        /** name:               file name */
-       char name[256];
+       char name[FS_DIRENT_NAME_LEN];
 };
 
 /* Note: fs_dir_stream should be treated as opaque to the user of fs layer */
index 964a4fe..564ea8b 100644 (file)
@@ -158,7 +158,7 @@ config UDP_CHECKSUM
        default y if SANDBOX
        help
          Enable this to verify the checksum on UDP packets. If the checksum
-         is wrong then the packet is discussed and an error is shown, like
+         is wrong then the packet is discarded and an error is shown, like
          "UDP wrong checksum 29374a23 30ff3826"
 
 config BOOTP_SERVERIP
index 5ed94ab..9a9206e 100644 (file)
@@ -5,7 +5,7 @@ setup(name='binman',
       version='1.0',
       license='GPL-2.0+',
       scripts=['binman'],
-      packages=['binman', 'binman.etype'],
+      packages=['binman', 'binman.etype', 'binman.btool'],
       package_dir={'binman': ''},
       package_data={'binman': ['README.rst', 'entries.rst']},
       classifiers=['Environment :: Console',