]> git.sur5r.net Git - u-boot/commitdiff
Merge tag 'xilinx-for-v2018.07' of git://www.denx.de/git/u-boot-microblaze
authorTom Rini <trini@konsulko.com>
Fri, 11 May 2018 15:45:28 +0000 (11:45 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 11 May 2018 15:45:28 +0000 (11:45 -0400)
Xilinx changes for v2018.07

microblaze:
- Align defconfig

zynq:
- Rework fpga initialization and cpuinfo handling

zynqmp:
- Add ZynqMP R5 support
- Wire and enable watchdog on zcu100-revC
- Setup MMU map for DDR at run time
- Show board info based on DT and cleanup IDENT_STRING

zynqmp tools:
- Add read partition support
- Add initial support for Xilinx bif format for boot.bin generation

mmc:
- Fix get_timer usage on 64bit cpus
- Add support for SD3.0 UHS mode

nand-zynq:
- Add support for 16bit buswidth
- Use address cycles from onfi params

scsi:
- convert ceva sata to UCLASS_AHCI

timer:
- Add Cadence TTC for ZynqMP r5

watchdog:
- Minor cadence driver cleanup

119 files changed:
arch/arm/cpu/armv8/fsl-layerscape/Kconfig
arch/arm/cpu/armv8/fsl-layerscape/fdt.c
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
arch/arm/cpu/armv8/fsl-layerscape/soc.c
arch/arm/cpu/armv8/sec_firmware.c
arch/arm/lib/bootm.c
arch/arm/mach-rmobile/include/mach/ehci-rmobile.h
arch/arm/mach-socfpga/include/mach/boot0.h
arch/arm/mach-socfpga/qts-filter.sh
arch/arm/thumb1/include/asm/proc-armv/system.h
arch/powerpc/cpu/mpc85xx/release.S
board/freescale/ls1088a/ddr.h
board/freescale/ls1088a/eth_ls1088aqds.c
board/freescale/ls2080aqds/MAINTAINERS
board/freescale/ls2080ardb/MAINTAINERS
board/freescale/mpc8315erdb/MAINTAINERS
board/freescale/mpc8323erdb/MAINTAINERS
board/freescale/mpc832xemds/MAINTAINERS
board/freescale/mpc8349emds/MAINTAINERS
board/freescale/mpc837xemds/MAINTAINERS
board/freescale/p1022ds/MAINTAINERS
board/freescale/t102xqds/MAINTAINERS
board/freescale/t102xrdb/MAINTAINERS
board/freescale/t4qds/MAINTAINERS
board/freescale/t4rdb/MAINTAINERS
board/liebherr/display5/spl.c
board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c
board/xilinx/zynq/zynq-microzed/ps7_init_gpl.c
board/xilinx/zynq/zynq-zc702/ps7_init_gpl.c
board/xilinx/zynq/zynq-zc706/ps7_init_gpl.c
board/xilinx/zynq/zynq-zed/ps7_init_gpl.c
cmd/bootefi.c
common/autoboot.c
common/image.c
common/spl/Kconfig
common/spl/spl.c
common/xyzModem.c
configs/display5_defconfig
configs/ls1088aqds_defconfig
configs/ls1088aqds_qspi_SECURE_BOOT_defconfig
configs/ls1088aqds_qspi_defconfig
configs/ls1088aqds_sdcard_ifc_defconfig
configs/ls1088aqds_sdcard_qspi_defconfig
configs/ls1088ardb_qspi_SECURE_BOOT_defconfig
configs/ls1088ardb_qspi_defconfig
configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig
configs/ls1088ardb_sdcard_qspi_defconfig
doc/README.uefi
doc/uImage.FIT/sec_firmware_ppa.its [new file with mode: 0644]
drivers/Makefile
drivers/mtd/nand/fsl_ifc_nand.c
drivers/net/fsl-mc/dpbp.c
drivers/net/fsl-mc/dpio/dpio.c
drivers/net/fsl-mc/dpmac.c
drivers/net/fsl-mc/dpni.c
drivers/net/fsl-mc/dprc.c
drivers/net/fsl-mc/fsl_dpmng_cmd.h
drivers/net/fsl-mc/mc.c
drivers/net/ldpaa_eth/ldpaa_eth.c
drivers/net/ldpaa_eth/ldpaa_eth.h
drivers/net/vsc9953.c
drivers/spi/fsl_qspi.c
drivers/usb/host/ehci-rmobile.c
drivers/video/bridge/Makefile
include/asm-generic/pe.h
include/bootcount.h
include/charset.h
include/configs/ls1088a_common.h
include/efi_driver.h
include/efi_loader.h
include/efi_selftest.h
include/fsl-mc/fsl_dpbp.h
include/fsl-mc/fsl_dpio.h
include/fsl-mc/fsl_dpmac.h
include/fsl-mc/fsl_dpni.h
include/fsl-mc/fsl_dprc.h
include/fsl-mc/fsl_mc_cmd.h
include/fsl-mc/fsl_mc_private.h
include/fsl_ifc.h
include/image.h
include/linux/log2.h
include/net.h
include/pe.h
lib/charset.c
lib/efi_driver/Makefile
lib/efi_driver/efi_block_device.c
lib/efi_driver/efi_uclass.c
lib/efi_loader/Makefile
lib/efi_loader/efi_bootmgr.c
lib/efi_loader/efi_boottime.c
lib/efi_loader/efi_console.c
lib/efi_loader/efi_device_path_to_text.c
lib/efi_loader/efi_device_path_utilities.c
lib/efi_loader/efi_disk.c
lib/efi_loader/efi_file.c
lib/efi_loader/efi_gop.c
lib/efi_loader/efi_image_loader.c
lib/efi_loader/efi_memory.c
lib/efi_loader/efi_net.c
lib/efi_loader/efi_runtime.c
lib/efi_loader/efi_smbios.c
lib/efi_loader/efi_variable.c
lib/efi_loader/efi_watchdog.c
lib/efi_selftest/Makefile
lib/efi_selftest/efi_selftest_disk_image.h
lib/lz4.c
net/arp.c
net/arp.h
net/cdp.c
net/cdp.h
net/net.c
net/ping.c
net/ping.h
scripts/Makefile.spl
test/fs/fs-test.sh
tools/file2include.c
tools/ifdtool.c
tools/socfpgaimage.c

index 7edc06d20263a1970d78b7684e07a24f92a02e4e..546de33b72e6e35d33702fe4e989aa5ce61df6f5 100644 (file)
@@ -469,6 +469,14 @@ config SYS_FSL_SDHC_CLK_DIV
        help
          This is the divider that is used to derive SDHC clock from Platform
          clock, in another word SDHC_clk = Platform_clk / this_divider.
+
+config SYS_FSL_QMAN_CLK_DIV
+       int "QMAN clock divider"
+       default 1 if ARCH_LS1043A
+       default 2
+       help
+         This is the divider that is used to derive QMAN clock from Platform
+         clock, in another word QMAN_clk = Platform_clk / this_divider.
 endmenu
 
 config RESV_RAM
index 4afc046eeaf968660ad003626f1add7fe059b3cc..fc9de73bcef4ce3ee58bdb18ead0f2f3113c9c3d 100644 (file)
@@ -414,8 +414,8 @@ void ft_cpu_setup(void *blob, bd_t *bd)
                ccsr_sec_t __iomem *sec;
 
 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
-               if (fdt_fixup_kaslr(blob))
-                       fdt_fixup_remove_jr(blob);
+               fdt_fixup_remove_jr(blob);
+               fdt_fixup_kaslr(blob);
 #endif
 
                sec = (void __iomem *)CONFIG_SYS_FSL_SEC_ADDR;
index 8386678c468afdc9caa3561b6eddb2cc5e62d06a..723d7eac5dd2d9ec72a0cfffcce60679f22226a9 100644 (file)
@@ -155,7 +155,9 @@ void get_sys_info(struct sys_info *sys_info)
                                                CONFIG_SYS_FSL_IFC_CLK_DIV;
 #endif
 #ifdef CONFIG_SYS_DPAA_QBMAN
-       sys_info->freq_qman = sys_info->freq_systembus;
+       sys_info->freq_qman = (sys_info->freq_systembus /
+                               CONFIG_SYS_FSL_PCLK_DIV) /
+                               CONFIG_SYS_FSL_QMAN_CLK_DIV;
 #endif
 }
 
index e9d373e4641fa4863cd33cd5f5225a8521956c61..ef3987ea84818082acd4ec6c897834ca5ad0a127 100644 (file)
@@ -233,39 +233,45 @@ ENTRY(lowlevel_init)
         * NOTE: As per the CCSR map doc, TZASC 3 and TZASC 4 are just
         *       placeholders.
         */
-#ifdef CONFIG_FSL_TZASC_1
-       ldr     x1, =TZASC_GATE_KEEPER(0)
-       ldr     w0, [x1]                /* Filter 0 Gate Keeper Register */
-       orr     w0, w0, #1 << 0         /* Set open_request for Filter 0 */
-       str     w0, [x1]
 
-       ldr     x1, =TZASC_REGION_ATTRIBUTES_0(0)
-       ldr     w0, [x1]                /* Region-0 Attributes Register */
-       orr     w0, w0, #1 << 31        /* Set Sec global write en, Bit[31] */
-       orr     w0, w0, #1 << 30        /* Set Sec global read en, Bit[30] */
-       str     w0, [x1]
+.macro tzasc_prog, xreg
+
+       mov     x12, TZASC1_BASE
+       mov     x16, #0x10000
+       mul     x14, \xreg, x16
+       add     x14, x14,x12
+       mov     x1, #0x8
+       add     x1, x1, x14
+
+       ldr     w0, [x1]                /* Filter 0 Gate Keeper Register */
+       orr     w0, w0, #1 << 0         /* Set open_request for Filter 0 */
+       str     w0, [x1]
+
+       mov     x1, #0x110
+       add     x1, x1, x14
+
+       ldr     w0, [x1]                /* Region-0 Attributes Register */
+       orr     w0, w0, #1 << 31        /* Set Sec global write en, Bit[31] */
+       orr     w0, w0, #1 << 30        /* Set Sec global read en, Bit[30] */
+       str     w0, [x1]
+
+       mov     x1, #0x114
+       add     x1, x1, x14
+
+       ldr     w0, [x1]                /* Region-0 Access Register */
+       mov     w0, #0xFFFFFFFF         /* Set nsaid_wr_en and nsaid_rd_en */
+       str     w0, [x1]
+.endm
+
+#ifdef CONFIG_FSL_TZASC_1
+       mov     x13, #0
+       tzasc_prog      x13
 
-       ldr     x1, =TZASC_REGION_ID_ACCESS_0(0)
-       ldr     w0, [x1]                /* Region-0 Access Register */
-       mov     w0, #0xFFFFFFFF         /* Set nsaid_wr_en and nsaid_rd_en */
-       str     w0, [x1]
 #endif
 #ifdef CONFIG_FSL_TZASC_2
-       ldr     x1, =TZASC_GATE_KEEPER(1)
-       ldr     w0, [x1]                /* Filter 0 Gate Keeper Register */
-       orr     w0, w0, #1 << 0         /* Set open_request for Filter 0 */
-       str     w0, [x1]
-
-       ldr     x1, =TZASC_REGION_ATTRIBUTES_0(1)
-       ldr     w0, [x1]                /* Region-1 Attributes Register */
-       orr     w0, w0, #1 << 31        /* Set Sec global write en, Bit[31] */
-       orr     w0, w0, #1 << 30        /* Set Sec global read en, Bit[30] */
-       str     w0, [x1]
+       mov     x13, #1
+       tzasc_prog      x13
 
-       ldr     x1, =TZASC_REGION_ID_ACCESS_0(1)
-       ldr     w0, [x1]                /* Region-1 Attributes Register */
-       mov     w0, #0xFFFFFFFF         /* Set nsaid_wr_en and nsaid_rd_en */
-       str     w0, [x1]
 #endif
        isb
        dsb     sy
index 06fdd17604986151bee11b312da051af0c101ca2..bfd663942aa23140741ef8ceadc795bdd4045274 100644 (file)
@@ -517,6 +517,7 @@ static void erratum_a010539(void)
        porsr1 &= ~FSL_CHASSIS2_CCSR_PORSR1_RCW_MASK;
        out_be32((void *)(CONFIG_SYS_DCSR_DCFG_ADDR + DCFG_DCSR_PORCR1),
                 porsr1);
+       out_be32((void *)(CONFIG_SYS_FSL_SCFG_ADDR + 0x1a8), 0xffffffff);
 #endif
 }
 
index 6a04eaca3eb977fa01449d6796842ed41a8411d9..a13c92e246a8a22c0ea6a12e91ee92756acd93b8 100644 (file)
@@ -115,25 +115,48 @@ static int sec_firmware_check_copy_loadable(const void *sec_firmware_img,
                                            u32 *loadable_l, u32 *loadable_h)
 {
        phys_addr_t sec_firmware_loadable_addr = 0;
-       int conf_node_off, ld_node_off;
+       int conf_node_off, ld_node_off, images;
        char *conf_node_name = NULL;
        const void *data;
        size_t size;
        ulong load;
+       const char *name, *str, *type;
+       int len;
 
        conf_node_name = SEC_FIRMEWARE_FIT_CNF_NAME;
 
        conf_node_off = fit_conf_get_node(sec_firmware_img, conf_node_name);
        if (conf_node_off < 0) {
                printf("SEC Firmware: %s: no such config\n", conf_node_name);
-       return -ENOENT;
+               return -ENOENT;
+       }
+
+       /* find the node holding the images information */
+       images = fdt_path_offset(sec_firmware_img, FIT_IMAGES_PATH);
+       if (images < 0) {
+               printf("%s: Cannot find /images node: %d\n", __func__, images);
+               return -1;
+       }
+
+       type = FIT_LOADABLE_PROP;
+
+       name = fdt_getprop(sec_firmware_img, conf_node_off, type, &len);
+       if (!name) {
+               /* Loadables not present */
+               return 0;
        }
 
-       ld_node_off = fit_conf_get_prop_node(sec_firmware_img, conf_node_off,
-                                            FIT_LOADABLE_PROP);
-       if (ld_node_off >= 0) {
-               printf("SEC Firmware: '%s' present in config\n",
-                      FIT_LOADABLE_PROP);
+       printf("SEC Firmware: '%s' present in config\n", type);
+
+       for (str = name; str && ((str - name) < len);
+            str = strchr(str, '\0') + 1) {
+               printf("%s: '%s'\n", type, str);
+               ld_node_off = fdt_subnode_offset(sec_firmware_img, images, str);
+               if (ld_node_off < 0) {
+                       printf("cannot find image node '%s': %d\n", str,
+                              ld_node_off);
+                       return -EINVAL;
+               }
 
                /* Verify secure firmware image */
                if (!(fit_image_verify(sec_firmware_img, ld_node_off))) {
@@ -163,11 +186,19 @@ static int sec_firmware_check_copy_loadable(const void *sec_firmware_img,
                memcpy((void *)sec_firmware_loadable_addr, data, size);
                flush_dcache_range(sec_firmware_loadable_addr,
                                   sec_firmware_loadable_addr + size);
-       }
 
-       /* Populate address ptrs for loadable image with loadbale addr */
-       out_le32(loadable_l, (sec_firmware_loadable_addr & WORD_MASK));
-       out_le32(loadable_h, (sec_firmware_loadable_addr >> WORD_SHIFT));
+               /* Populate loadable address only for Trusted OS */
+               if (!strcmp(str, "trustedOS@1")) {
+                       /*
+                        * Populate address ptrs for loadable image with
+                        * loadbale addr
+                        */
+                       out_le32(loadable_l, (sec_firmware_loadable_addr &
+                                             WORD_MASK));
+                       out_le32(loadable_h, (sec_firmware_loadable_addr >>
+                                             WORD_SHIFT));
+               }
+       }
 
        return 0;
 }
@@ -317,9 +348,7 @@ unsigned int sec_firmware_support_psci_version(void)
  */
 bool sec_firmware_support_hwrng(void)
 {
-       uint8_t rand[8];
        if (sec_firmware_addr & SEC_FIRMWARE_RUNNING) {
-               if (!sec_firmware_get_random(rand, 8))
                        return true;
        }
 
@@ -428,8 +457,10 @@ int fdt_fixup_kaslr(void *fdt)
 
 #if defined(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT)
        /* Check if random seed generation is  supported */
-       if (sec_firmware_support_hwrng() == false)
+       if (sec_firmware_support_hwrng() == false) {
+               printf("WARNING: SEC firmware not running, no kaslr-seed\n");
                return 0;
+       }
 
        ret = sec_firmware_get_random(rand, 8);
        if (ret < 0) {
index b27266c7a1933c625031e8b67ddbb479d1cb74bc..c3c1d2fdfa2d8ab9d4eacd4a8218f3455fe3a8fc 100644 (file)
@@ -437,7 +437,7 @@ void boot_prep_vxworks(bootm_headers_t *images)
 
        if (images->ft_addr) {
                off = fdt_path_offset(images->ft_addr, "/memory");
-               if (off < 0) {
+               if (off > 0) {
                        if (arch_fixup_fdt(images->ft_addr))
                                puts("## WARNING: fixup memory failed!\n");
                }
index 463654efd33ef34057556fc745d446500c7d0001..ca8c5f370637cbb8b95434a5116abca3975341fb 100644 (file)
@@ -1,8 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  *  Copyright (C) 2013,2014 Renesas Electronics Corporation
  *  Copyright (C) 2014 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
- *
- *  SPDX-License-Identifier:     GPL-2.0
  */
 
 #ifndef __EHCI_RMOBILE_H__
index 60194231c74496fe92ba63c5fb401c657d14eb73..c78def5066ed34a2c28c83e49c91f8620626914f 100644 (file)
@@ -17,8 +17,8 @@ _start:
        .word   0xcafec0d3;     /* Checksum, zero-pad */
        nop;
 
-       b reset;                /* SoCFPGA jumps here */
-       nop;
+       b reset;                /* SoCFPGA Gen5 jumps here */
+       b reset;                /* SoCFPGA Gen10 trampoline */
        nop;
        nop;
 #endif
index 02c28be2b7729673eae2d547276b0908ddd711a5..3a442bc5d8270c863ae2d0d2f8bb84537ed6e7a5 100755 (executable)
@@ -145,10 +145,10 @@ process_sdram_config() {
 
        (
        cat << EOF
+/* SPDX-License-Identifier: BSD-3-Clause */
 /*
  * Altera SoCFPGA SDRAM configuration
  *
- * SPDX-License-Identifier:    BSD-3-Clause
  */
 
 #ifndef __SOCFPGA_SDRAM_CONFIG_H__
index 7dfbf3d33db00a9e682aa18b89638999029fb78c..1324f7efb137caaca40befd2a34e826d848ca248 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  *  Thumb-1 drop-in for the linux/include/asm-arm/proc-armv/system.h
  *
@@ -7,8 +8,6 @@
  * The original file does not build in Thumb mode. However, in U-Boot
  * we don't use interrupt context, so we can redefine these as empty
  * memory barriers, which makes Thumb-1 compiler happy.
- *
- *  SPDX-License-Identifier:   GPL-2.0+
  */
 
 /*
index 5d212f35b56c97506e37c3e2ee36c88aa173c554..d37e1ccf1e7fdfae016fb92e9c55be046a2655d0 100644 (file)
        .globl  __secondary_start_page
        .align  12
 __secondary_start_page:
+#ifdef CONFIG_SYS_FSL_ERRATUM_A005125
+       msync
+       isync
+       mfspr   r3, SPRN_HDBCR0
+       oris    r3, r3, 0x0080
+       mtspr   SPRN_HDBCR0, r3
+#endif
 /* First do some preliminary setup */
        lis     r3, HID0_EMCP@h         /* enable machine check */
 #ifndef CONFIG_E500MC
index 764ed7945b31ded3a77a1aa37afc9a82f4250c32..b35c4ae2dad47ba114a021a7663269f8cb02eaac 100644 (file)
@@ -30,12 +30,12 @@ static const struct board_specific_parameters udimm0[] = {
 #if defined(CONFIG_TARGET_LS1088ARDB)
 
        {2,  1666, 0, 8,     8, 0x090A0B0E, 0x0F10110D,},
-       {2,  1900, 0, 4,     7, 0x09090B0D, 0x0E10120B,},
+       {2,  1900, 0, 8,     9, 0x0A0B0C10, 0x1112140E,},
        {2,  2300, 0, 8,     9, 0x0A0C0E11, 0x1214160F,},
        {}
 #elif defined(CONFIG_TARGET_LS1088AQDS)
        {2,  1666, 0, 8,     8, 0x0A0A0C0E, 0x0F10110C,},
-       {2,  1900, 0, 4,     7, 0x09090B0D, 0x0E10120B,},
+       {2,  1900, 0, 8,     9, 0x0A0B0C10, 0x1112140E,},
        {2,  2300, 0, 4,     9, 0x0A0C0D11, 0x1214150E,},
        {}
 
index 9907fd2a33fe10e67aae0447dde5d5990920fc6c..40b1a0e63109237f536b3eac4c0a18df12d26698 100644 (file)
@@ -4,12 +4,14 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <netdev.h>
 #include <asm/io.h>
 #include <asm/arch/fsl_serdes.h>
 #include <hwconfig.h>
 #include <fsl_mdio.h>
 #include <malloc.h>
+#include <phy.h>
 #include <fm_eth.h>
 #include <i2c.h>
 #include <miiphy.h>
index 62c8fac09c694f40e9fb066716680f5fd6d41495..f7f1f095136274a399c461e95d1b71c2c2f30bee 100644 (file)
@@ -10,6 +10,6 @@ F:    configs/ls2080aqds_qspi_defconfig
 F:     configs/ls2080aqds_sdcard_defconfig
 
 LS2080A_SECURE_BOOT BOARD
-M:     Saksham Jain <saksham.jain@nxp.freescale.com>
-S:     Maintained
+#M:    Saksham Jain <saksham.jain@nxp.freescale.com>
+S:     Orphan (since 2018-05)
 F:     configs/ls2080aqds_SECURE_BOOT_defconfig
index 8da1c6d0ae7c70ff20e519d669605bdfeec99756..bbe56e2052c6c16c00dbbf2444f15441b889150c 100644 (file)
@@ -18,8 +18,8 @@ S:    Maintained
 F:     configs/ls2081ardb_defconfig
 
 LS2080A_SECURE_BOOT BOARD
-M:     Saksham Jain <saksham.jain@nxp.freescale.com>
-S:     Maintained
+#M:    Saksham Jain <saksham.jain@nxp.freescale.com>
+S:     Orphan (since 2018-05)
 F:     configs/ls2080ardb_SECURE_BOOT_defconfig
 
 LS2088A_QSPI_SECURE_BOOT BOARD
index 938c1527e0527abdc02642d6057049c33bd257e3..5a67b409934c1feded17cd45be6f2f57b306084f 100644 (file)
@@ -1,6 +1,6 @@
 MPC8315ERDB BOARD
-M:     Dave Liu <daveliu@freescale.com>
-S:     Maintained
+#M:    Dave Liu <daveliu@freescale.com>
+S:     Orphan (since 2018-05)
 F:     board/freescale/mpc8315erdb/
 F:     include/configs/MPC8315ERDB.h
 F:     configs/MPC8315ERDB_defconfig
index 05057c0c2dccc9bc7d474d19cb7e692bfb1e7015..496ab2af271fa1fb748adaadf23d7828042c9bd7 100644 (file)
@@ -1,6 +1,6 @@
 MPC8323ERDB BOARD
-M:     Michael Barkowski <michael.barkowski@freescale.com>
-S:     Maintained
+#M:    Michael Barkowski <michael.barkowski@freescale.com>
+S:     Orphan (since 2018-05)
 F:     board/freescale/mpc8323erdb/
 F:     include/configs/MPC8323ERDB.h
 F:     configs/MPC8323ERDB_defconfig
index 56d70733b4fde97aa469f0be0129bdc1b568d15d..232658a203c28f65602f001b2d6ca31200b229a9 100644 (file)
@@ -1,6 +1,6 @@
 MPC832XEMDS BOARD
-M:     Dave Liu <daveliu@freescale.com>
-S:     Maintained
+#M:    Dave Liu <daveliu@freescale.com>
+S:     Orphan (since 2018-05)
 F:     board/freescale/mpc832xemds/
 F:     include/configs/MPC832XEMDS.h
 F:     configs/MPC832XEMDS_defconfig
index 141e77a94e730c897749d933eda7b197943bfee4..e6648d66a0585389496ad06e88ed420f1d1607a9 100644 (file)
@@ -1,6 +1,6 @@
 MPC8349EMDS BOARD
-M:     Kim Phillips <kim.phillips@freescale.com>
-S:     Maintained
+#M:    Kim Phillips <kim.phillips@freescale.com>
+S:     Orphan (since 2018-05)
 F:     board/freescale/mpc8349emds/
 F:     include/configs/MPC8349EMDS.h
 F:     configs/MPC8349EMDS_defconfig
index 6ff134620626f6c51746e6b7d0f940dd497e63e4..8386aa729770885829e64605b5afe54ff53e58d5 100644 (file)
@@ -1,6 +1,6 @@
 MPC837XEMDS BOARD
-M:     Dave Liu <daveliu@freescale.com>
-S:     Maintained
+#M:    Dave Liu <daveliu@freescale.com>
+S:     Orphan (since 2018-05)
 F:     board/freescale/mpc837xemds/
 F:     include/configs/MPC837XEMDS.h
 F:     configs/MPC837XEMDS_defconfig
index 86aac365d31f90cf8d4d5cee2317dbcf9eddf174..62256c3703827e2fd49093b9be5f6c2042389654 100644 (file)
@@ -1,5 +1,5 @@
 P1022DS BOARD
-M:     Timur Tabi <timur@freescale.com>
+M:     Timur Tabi <timur@tabi.org>
 S:     Maintained
 F:     board/freescale/p1022ds/
 F:     include/configs/P1022DS.h
index 23480e2d71a90948e7fb83a87ad98e637e16d3ea..7e30e5f84b75fd90abd5773b4a88f7344b023cbd 100644 (file)
@@ -1,6 +1,6 @@
 T102XQDS BOARD
-M:     Shengzhou Liu  <Shengzhou.Liu@freescale.com>
-S:     Maintained
+#M:    Shengzhou Liu  <Shengzhou.Liu@freescale.com>
+S:     Orphan (since 2018-05)
 F:     board/freescale/t102xqds/
 F:     include/configs/T102xQDS.h
 F:     configs/T1024QDS_defconfig
index 297e63a6eea0cef61bb98b4761067b6c6099f79b..6c24f7785ce46cf2c4c72b62d3e8de0648104927 100644 (file)
@@ -1,6 +1,6 @@
 T102XRDB BOARD
-M:     Shengzhou Liu  <Shengzhou.Liu@freescale.com>
-S:     Maintained
+#M:    Shengzhou Liu  <Shengzhou.Liu@freescale.com>
+S:     Orphan (since 2018-05)
 F:     board/freescale/t102xrdb/
 F:     include/configs/T102xRDB.h
 F:     configs/T1024RDB_defconfig
index b288571c7a74ba7fb20c50e470b9e52d0e8bf53d..44bb2f5c6d83cc19c61f6a683c6a734b539f755a 100644 (file)
@@ -1,6 +1,6 @@
 T4QDS BOARD
-M:     Shaohui Xie <Shaohui.Xie@freescale.com>
-S:     Maintained
+#M:    Shaohui Xie <Shaohui.Xie@freescale.com>
+S:     Orphan (since 2018-05)
 F:     board/freescale/t4qds/
 F:     include/configs/T4240QDS.h
 F:     configs/T4160QDS_defconfig
index 53ccabc0fb4e1341a0c352abeaff52463ce28849..4ba5c3a546a30bfbe35a0ea049e535db56027823 100644 (file)
@@ -1,6 +1,6 @@
 T4RDB BOARD
-M:     Chunhe Lan <Chunhe.Lan@freescale.com>
-S:     Maintained
+#M:    Chunhe Lan <Chunhe.Lan@freescale.com>
+S:     Orphan (since 2018-05)
 F:     board/freescale/t4rdb/
 F:     include/configs/T4240RDB.h
 F:     configs/T4160RDB_defconfig
index 49bcafef7473afe4993344e3b359b66e724de47e..6508e0ffa7dfa3c0e1e75145769175dfc9cf6631 100644 (file)
@@ -19,6 +19,7 @@
 #include <environment.h>
 #include <fsl_esdhc.h>
 #include <netdev.h>
+#include <bootcount.h>
 #include "common.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -213,7 +214,7 @@ void board_boot_order(u32 *spl_boot_list)
        env_load();
 
        s = env_get("BOOT_FROM");
-       if (s && strcmp(s, "ACTIVE") == 0) {
+       if (s && !bootcount_error() && strcmp(s, "ACTIVE") == 0) {
                spl_boot_list[0] = BOOT_DEVICE_MMC1;
                spl_boot_list[1] = spl_boot_device();
        }
index 3bd02f3c83ec3fa21d2b916135c28bce69c8e68c..500dcce4da5c1db890f662eca4e8d949de349d7e 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /******************************************************************************
 * (c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
 * (c) Copyright 2017 Opal Kelly Inc.
-*
-* SPDX-License-Identifier: GPL-2.0+
  *****************************************************************************/
 
 #include <asm/arch/ps7_init_gpl.h>
index 5cf627d2233dd0b476dc7cbdc7a79a7a87c2dde6..39afd82195c2d4c1ca75019829054ee6ab4aebce 100644 (file)
@@ -1,9 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /******************************************************************************
 * (c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
-*
-* SPDX-License-Identifier:     GPL-2.0+
-*
-*
 ******************************************************************************/
 /****************************************************************************/
 /**
index fc325a6b028a53db37fbe6dae67deda258ebfdc3..88ff7947f20e211e3632ee689f7de055169a8c6c 100644 (file)
@@ -1,9 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /******************************************************************************
 * (c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
-*
-* SPDX-License-Identifier:     GPL-2.0+
-*
-*
 ******************************************************************************/
 /****************************************************************************/
 /**
index ca5490f0b0e37c706b57e7a4715e37a2318bcf16..e9e4e4d077b70889dd8d40f84e4e44a6d6081f6c 100644 (file)
@@ -1,9 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /******************************************************************************
 * (c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
-*
-* SPDX-License-Identifier:     GPL-2.0+
-*
-*
 ******************************************************************************/
 /****************************************************************************/
 /**
index 54c803cfa6593f7fff3921c92ba7d84f6cff34ee..df7d3535ddb73cd110c9a7e6c7bda9388843572a 100644 (file)
@@ -1,9 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /******************************************************************************
 * (c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
-*
-* SPDX-License-Identifier:     GPL-2.0+
-*
-*
 ******************************************************************************/
 /****************************************************************************/
 /**
index 5498a5fccf78a991c19e5ced865fc4f3065311d8..11b84c55289716517669ae8182430355057e5800 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI application loader
  *
  *  Copyright (c) 2016 Alexander Graf
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <charset.h>
index 9b9fb534f0877530010a91e171f16407af7cc935..94133eaeda782eeccbc0ac63a8581552dc7893c3 100644 (file)
@@ -13,6 +13,7 @@
 #include <menu.h>
 #include <post.h>
 #include <u-boot/sha256.h>
+#include <bootcount.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -290,18 +291,8 @@ const char *bootdelay_process(void)
 {
        char *s;
        int bootdelay;
-#ifdef CONFIG_BOOTCOUNT_LIMIT
-       unsigned long bootcount = 0;
-       unsigned long bootlimit = 0;
-#endif /* CONFIG_BOOTCOUNT_LIMIT */
-
-#ifdef CONFIG_BOOTCOUNT_LIMIT
-       bootcount = bootcount_load();
-       bootcount++;
-       bootcount_store(bootcount);
-       env_set_ulong("bootcount", bootcount);
-       bootlimit = env_get_ulong("bootlimit", 10, 0);
-#endif /* CONFIG_BOOTCOUNT_LIMIT */
+
+       bootcount_inc();
 
        s = env_get("bootdelay");
        bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
@@ -323,13 +314,9 @@ const char *bootdelay_process(void)
                s = env_get("failbootcmd");
        } else
 #endif /* CONFIG_POST */
-#ifdef CONFIG_BOOTCOUNT_LIMIT
-       if (bootlimit && (bootcount > bootlimit)) {
-               printf("Warning: Bootlimit (%u) exceeded. Using altbootcmd.\n",
-                      (unsigned)bootlimit);
+       if (bootcount_error())
                s = env_get("altbootcmd");
-       } else
-#endif /* CONFIG_BOOTCOUNT_LIMIT */
+       else
                s = env_get("bootcmd");
 
        process_fdt_options(gd->fdt_blob);
index 87d15010c0c2917dca91a50bf1ca3b6e805ea43f..214ac3372062b94ca78e8828c3ee9ad8f2301419 100644 (file)
@@ -145,7 +145,8 @@ static const table_entry_t uimage_type[] = {
        {       IH_TYPE_PBLIMAGE,   "pblimage",   "Freescale PBL Boot Image",},
        {       IH_TYPE_RAMDISK,    "ramdisk",    "RAMDisk Image",      },
        {       IH_TYPE_SCRIPT,     "script",     "Script",             },
-       {       IH_TYPE_SOCFPGAIMAGE, "socfpgaimage", "Altera SOCFPGA preloader",},
+       {       IH_TYPE_SOCFPGAIMAGE, "socfpgaimage", "Altera SoCFPGA CV/AV preloader",},
+       {       IH_TYPE_SOCFPGAIMAGE_V1, "socfpgaimage_v1", "Altera SoCFPGA A10 preloader",},
        {       IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
        {       IH_TYPE_UBLIMAGE,   "ublimage",   "Davinci UBL image",},
        {       IH_TYPE_MXSIMAGE,   "mxsimage",   "Freescale MXS Boot Image",},
index 259f96607eab1920cf8dff6aa906ad78e5ec9bdf..431710a93bd98a2af525c70bb2651950a7318f56 100644 (file)
@@ -54,6 +54,15 @@ config SPL_BOOTROM_SUPPORT
          BOOT_DEVICE_BOOTROM (or fall-through to the next boot device in the
          boot device list, if not implemented for a given board)
 
+config SPL_BOOTCOUNT_LIMIT
+       bool "Support bootcount in SPL"
+       depends on SPL_ENV_SUPPORT
+       help
+         On some boards, which use 'falcon' mode, it is necessary to check
+         and increment the number of boot attempts. Such boards do not
+         use proper U-Boot for normal boot flow and hence needs those
+         adjustments to be done in the SPL.
+
 config SPL_RAW_IMAGE_SUPPORT
        bool "Support SPL loading and booting of RAW images"
        default n if (ARCH_MX6 && (SPL_MMC_SUPPORT || SPL_SATA_SUPPORT))
index 3dafeaed3a18955331a75b6eda7bc886f6bc9769..6606417ff74d0c41e9ee29f8d861fb4f53714824 100644 (file)
@@ -19,6 +19,7 @@
 #include <dm/root.h>
 #include <linux/compiler.h>
 #include <fdt_support.h>
+#include <bootcount.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -416,6 +417,8 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
        spl_board_init();
 #endif
 
+       bootcount_inc();
+
        memset(&spl_image, '\0', sizeof(spl_image));
 #ifdef CONFIG_SYS_SPL_ARGS_ADDR
        spl_image.arg = (void *)CONFIG_SYS_SPL_ARGS_ADDR;
index a126e32ed35e61b50a350074cc6ffe1f3276000e..830fca8387536f372f9988fe7f9ee2b6f0c6acc3 100644 (file)
@@ -171,7 +171,7 @@ parse_num (char *s, unsigned long *val, char **es, char *delim)
 }
 
 
-#ifdef DEBUG
+#if defined(DEBUG) && !defined(CONFIG_USE_TINY_PRINTF)
 /*
  * Note: this debug setup works by storing the strings in a fixed buffer
  */
@@ -180,15 +180,16 @@ static char *zm_out = zm_debug_buf;
 static char *zm_out_start = zm_debug_buf;
 
 static int
-zm_dprintf (char *fmt, ...)
+zm_dprintf(char *fmt, ...)
 {
-  int len;
-  va_list args;
-
-  va_start (args, fmt);
-  len = diag_vsprintf (zm_out, fmt, args);
-  zm_out += len;
-  return len;
+       int len;
+       va_list args;
+
+       va_start(args, fmt);
+       len = diag_vsprintf(zm_out, fmt, args);
+       va_end(args);
+       zm_out += len;
+       return len;
 }
 
 static void
index e52f4e00af8ed5564ac38e47e00ad02df1b469be..db8212ca7cf953636aa9bb1ab6cafc5a0a8c2efe 100644 (file)
@@ -16,6 +16,7 @@ CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg,MX6Q"
 CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_SPL_BOOTCOUNT_LIMIT=y
 # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
@@ -53,6 +54,9 @@ CONFIG_EFI_PARTITION=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_FSL_ESDHC=y
+CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0x020CC068
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_SPANSION=y
index f20dc3e0e516194af4fb79a9201135ccc00ea707..05dc2ac44683fbc37ea53e0280aa086f5821ba07 100644 (file)
@@ -8,9 +8,12 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4"
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x3000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index be3e0981d8b57e3eb480281ff03b68ebdd230eb2..20376be2d1f7b5d62ffba237168af8a376900056 100644 (file)
@@ -11,9 +11,12 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4, QSPI_BOOT"
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x3000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
 # CONFIG_USE_BOOTCOMMAND is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index cea6ca987b94cabca6734000f8be7618ced754d2..cf2b4e3aba8151f75ae4a0a9f8b91d521f36f0ff 100644 (file)
@@ -10,9 +10,12 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4, QSPI_BOOT"
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x3000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
 # CONFIG_USE_BOOTCOMMAND is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 76ee1204bc41510ca8762378a24106ebb27fb492..39fa3d716f5399e2a8f9429427d8fd69659f3ac1 100644 (file)
@@ -13,6 +13,8 @@ CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1088a-qds"
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4"
 CONFIG_SD_BOOT=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x3000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
@@ -21,6 +23,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index ddb1e04556bffade634cf88b6039ce14a325f0cc..8d854da3dd623db0b28a87cdc4971afdc4445e11 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="SD_BOOT_QSPI"
 CONFIG_SD_BOOT=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x3000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
 # CONFIG_USE_BOOTCOMMAND is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
@@ -23,6 +25,7 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x8b0
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
+CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 23e064b9e4622fe1ec6d44ad2efd321da67ea90f..db952897334ce1cfa2af2afae0ea9732b1f77a24 100644 (file)
@@ -11,9 +11,12 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4, QSPI_BOOT"
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x3000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
 # CONFIG_USE_BOOTCOMMAND is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index b05d50ade6f55c5694ba77ecfc3e0ffcaeb35de5..fbb75df7a31997a5ca5c872d7cf0a1de63badadf 100644 (file)
@@ -10,9 +10,12 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4, QSPI_BOOT"
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x3000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
 # CONFIG_USE_BOOTCOMMAND is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 43472ac2a13aea4525320f1b79b5a96099900a8c..17791b07ebbe4c5d1be07db86adc66e36c5169d5 100644 (file)
@@ -16,6 +16,8 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="SD_BOOT_QSPI"
 CONFIG_SD_BOOT=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x3000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
 # CONFIG_USE_BOOTCOMMAND is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
@@ -26,6 +28,7 @@ CONFIG_SPL_HASH_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
+CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 91fae2cd6ad120d873d46ea965d6118f0c63593c..26966aa7a933088a17346dd0fcdb9a0c35e63164 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="SD_BOOT_QSPI"
 CONFIG_SD_BOOT=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x3000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
 # CONFIG_USE_BOOTCOMMAND is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
@@ -23,6 +25,7 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x8b0
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
+CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index bb89b7ac2f70c77bda9064ff174c67bffb8c254c..196e99994a332d086b0428fe8aae5d9b63af5c93 100644 (file)
@@ -1,7 +1,7 @@
 <!--
-    Copyright (c) 2018 Heinrich Schuchardt
+SPDX-License-Identifier: GPL-2.0+
 
-    SPDX-License-Identifier:     GPL-2.0+
+Copyright (c) 2018 Heinrich Schuchardt
 -->
 
 # UEFI on U-Boot
diff --git a/doc/uImage.FIT/sec_firmware_ppa.its b/doc/uImage.FIT/sec_firmware_ppa.its
new file mode 100644 (file)
index 0000000..a7acde1
--- /dev/null
@@ -0,0 +1,49 @@
+/dts-v1/;
+
+/*
+ * Example FIT image description file demonstrating the usage
+ * of SEC Firmware and multiple loadable images loaded by the u-boot.
+ * For booting PPA (SEC Firmware), "firmware" is searched and loaded.
+ *
+ * Multiple binaries will be loaded as "loadables" (if present) at their
+ * respective load offsets from firmware image address.
+ */
+
+/{
+       description = "PPA Firmware";
+       #address-cells = <1>;
+       images {
+               firmware@1 {
+                       description = "PPA Firmware: <version>";
+                       data = /incbin/("../obj/monitor.bin");
+                       type = "firmware";
+                       arch = "arm64";
+                       compression = "none";
+               };
+               trustedOS@1 {
+                       description = "Trusted OS";
+                       data = /incbin/("../../tee.bin");
+                       type = "OS";
+                       arch = "arm64";
+                       compression = "none";
+                       load = <0x00200000>;
+               };
+               fuse_scr {
+                       description = "Fuse Script";
+                       data = /incbin/("../../fuse_scr.bin");
+                       type = "firmware";
+                       arch = "arm64";
+                       compression = "none";
+                       load = <0x00180000>;
+               };
+       };
+
+       configurations {
+               default = "config-1";
+               config-1 {
+                       description = "PPA Secure firmware";
+                       firmware = "firmware@1";
+                       loadables = "trustedOS@1", "fuse_scr";
+               };
+       };
+};
index edbcadf99ba0068cf7c3571d7c82a220771a170e..b3f1b600a558cef08d1f750c1b42b27a6bb9ad51 100644 (file)
@@ -18,6 +18,7 @@ obj-$(CONFIG_$(SPL_TPL_)TIMER) += timer/
 ifndef CONFIG_TPL_BUILD
 ifdef CONFIG_SPL_BUILD
 
+obj-$(CONFIG_SPL_BOOTCOUNT_LIMIT) += bootcount/
 obj-$(CONFIG_SPL_CPU_SUPPORT) += cpu/
 obj-$(CONFIG_SPL_CRYPTO_SUPPORT) += crypto/
 obj-$(CONFIG_SPL_GPIO_SUPPORT) += gpio/
index a82913cac13cd6e2e9e720dcc4106a4d0c5d1b25..a47226bd2158106bb4efaa2eac556faad82c60af 100644 (file)
@@ -269,14 +269,9 @@ static int is_blank(struct mtd_info *mtd, struct fsl_ifc_ctrl *ctrl,
 
 /* returns nonzero if entire page is blank */
 static int check_read_ecc(struct mtd_info *mtd, struct fsl_ifc_ctrl *ctrl,
-                         u32 *eccstat, unsigned int bufnum)
+                         u32 eccstat, unsigned int bufnum)
 {
-       u32 reg = eccstat[bufnum / 4];
-       int errors;
-
-       errors = (reg >> ((3 - bufnum % 4) * 8)) & 15;
-
-       return errors;
+       return (eccstat >> ((3 - bufnum % 4) * 8)) & 15;
 }
 
 /*
@@ -290,7 +285,7 @@ static int fsl_ifc_run_command(struct mtd_info *mtd)
        struct fsl_ifc_runtime *ifc = ctrl->regs.rregs;
        u32 timeo = (CONFIG_SYS_HZ * 10) / 1000;
        u32 time_start;
-       u32 eccstat[8] = {0};
+       u32 eccstat;
        int i;
 
        /* set the chip select for NAND Transaction */
@@ -320,20 +315,17 @@ static int fsl_ifc_run_command(struct mtd_info *mtd)
        if (ctrl->eccread) {
                int errors;
                int bufnum = ctrl->page & priv->bufnum_mask;
-               int sector = bufnum * chip->ecc.steps;
-               int sector_end = sector + chip->ecc.steps - 1;
-
-               for (i = sector / 4; i <= sector_end / 4; i++) {
-                       if (i >= ARRAY_SIZE(eccstat)) {
-                               printf("%s: eccstat too small for %d\n",
-                                      __func__, i);
-                               return -EIO;
-                       }
+               int sector_start = bufnum * chip->ecc.steps;
+               int sector_end = sector_start + chip->ecc.steps - 1;
+               u32 *eccstat_regs;
 
-                       eccstat[i] = ifc_in32(&ifc->ifc_nand.nand_eccstat[i]);
-               }
+               eccstat_regs = ifc->ifc_nand.nand_eccstat;
+               eccstat = ifc_in32(&eccstat_regs[sector_start / 4]);
+
+               for (i = sector_start; i <= sector_end; i++) {
+                       if ((i != sector_start) && !(i % 4))
+                               eccstat = ifc_in32(&eccstat_regs[i / 4]);
 
-               for (i = sector; i <= sector_end; i++) {
                        errors = check_read_ecc(mtd, ctrl, eccstat, i);
 
                        if (errors == 15) {
@@ -708,6 +700,7 @@ static int fsl_ifc_wait(struct mtd_info *mtd, struct nand_chip *chip)
        struct fsl_ifc_ctrl *ctrl = priv->ctrl;
        struct fsl_ifc_runtime *ifc = ctrl->regs.rregs;
        u32 nand_fsr;
+       int status;
 
        if (ctrl->status != IFC_NAND_EVTER_STAT_OPC)
                return NAND_STATUS_FAIL;
@@ -728,10 +721,10 @@ static int fsl_ifc_wait(struct mtd_info *mtd, struct nand_chip *chip)
                return NAND_STATUS_FAIL;
 
        nand_fsr = ifc_in32(&ifc->ifc_nand.nand_fsr);
+       status = nand_fsr >> 24;
 
        /* Chip sometimes reporting write protect even when it's not */
-       nand_fsr = nand_fsr | NAND_STATUS_WP;
-       return nand_fsr;
+       return status | NAND_STATUS_WP;
 }
 
 static int fsl_ifc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
index 327bee935a1f8d59be5ffc69d94b28b26f0ae14e..c609efb9abcc3ade14d4d74d602b034771ae43bc 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Freescale Layerscape MC I/O wrapper
  *
- * Copyright (C) 2013-2016 Freescale Semiconductor, Inc.
+ * Copyright 2013-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 #include <fsl-mc/fsl_mc_sys.h>
index 0bbb76072818c673c3b5837ab39662b4b34d1841..8884455963de63109cc08acee3a217f50b0d2c86 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright (C) 2013-2016 Freescale Semiconductor
+ * Copyright 2013-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 
index 2aadd4ada2bf6c6dbdcfa0eb533e2009c909e006..43a2ff43f8883baec29bfda6c7601b2c29a60de1 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Freescale Layerscape MC I/O wrapper
  *
- * Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  * Author: Prabhakar Kushwaha <prabhakar@freescale.com>
  */
index 5cf5eebea6e3bbc5b77a138835829dbb373a6abd..443e430695ec579589b37ecdde275f72a9b03716 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright (C) 2013-2016 Freescale Semiconductor
+ * Copyright 2013-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 
index 38d19a4063e6d6cbdb812e092644aa31cf6b8a9e..e0a2865ab8f55b2d51125b50674bb517a223707b 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Freescale Layerscape MC I/O wrapper
  *
- * Copyright (C) 2013-2016 Freescale Semiconductor, Inc.
+ * Copyright 2013-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 
index 9e6f27afdc7af9ef5b7b77d407167711bbdfdf33..e18c88da09729daee7acc0b277c39bd49032dfe4 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
-/* Copyright 2013-2016 Freescale Semiconductor Inc.
+/* Copyright 2013-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 #ifndef __FSL_DPMNG_CMD_H
index 58612cfca3d30250dc79fb8be20e82ccec278ac2..982024e31ea1f4cf782d65a6a972f0bf88c9b90b 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright (C) 2017 NXP Semiconductors
- * Copyright (C) 2014 Freescale Semiconductor
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
  */
 #include <common.h>
 #include <errno.h>
index 8688dd44199f3f47a6737b3f42f4e9a41d498200..79facb4a445a9b4c7f04072cbdcf5e3d494db597 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright (C) 2014-2016 Freescale Semiconductor
+ * Copyright 2014-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 
index 54cb633e0141ed004561e0d5c5e5fd770baeb9df..ee784a55ee1e6f703e0630d782a891bf529ba9d0 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright (C) 2014-2016 Freescale Semiconductor
+ * Copyright 2014-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 
index 2388438d10160fc84aca9d9dcbd2e2ec15ae2709..5d196cfb3f382893f4691c3f9782128a15fe9157 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  Copyright 2014 - 2015 Freescale Semiconductor, Inc.
  *
- *  SPDX-License-Identifier:      GPL-2.0+
- *
  *  Driver for the Vitesse VSC9953 L2 Switch
  */
 
index 79781b5d4a8e6352b7b0ae3f5ea96a67889f4c8f..368424948478e0691dafbe3e5faa123c7b411537 100644 (file)
@@ -155,6 +155,25 @@ static void qspi_write32(u32 flags, u32 *addr, u32 val)
                out_be32(addr, val) : out_le32(addr, val);
 }
 
+static inline int is_controller_busy(const struct fsl_qspi_priv *priv)
+{
+       u32 val;
+       const u32 mask = QSPI_SR_BUSY_MASK | QSPI_SR_AHB_ACC_MASK |
+                        QSPI_SR_IP_ACC_MASK;
+       unsigned int retry = 5;
+
+       do {
+               val = qspi_read32(priv->flags, &priv->regs->sr);
+
+               if ((~val & mask) == mask)
+                       return 0;
+
+               udelay(1);
+       } while (--retry);
+
+       return -ETIMEDOUT;
+}
+
 /* QSPI support swapping the flash read/write data
  * in hardware for LS102xA, but not for VF610 */
 static inline u32 qspi_endian_xchg(u32 data)
@@ -1017,11 +1036,7 @@ static int fsl_qspi_probe(struct udevice *bus)
        priv->num_chipselect = plat->num_chipselect;
 
        /* make sure controller is not busy anywhere */
-       ret = wait_for_bit_le32(&priv->regs->sr,
-                               QSPI_SR_BUSY_MASK |
-                               QSPI_SR_AHB_ACC_MASK |
-                               QSPI_SR_IP_ACC_MASK,
-                               false, 100, false);
+       ret = is_controller_busy(priv);
 
        if (ret) {
                debug("ERROR : The controller is busy\n");
@@ -1184,11 +1199,7 @@ static int fsl_qspi_claim_bus(struct udevice *dev)
        priv = dev_get_priv(bus);
 
        /* make sure controller is not busy anywhere */
-       ret = wait_for_bit_le32(&priv->regs->sr,
-                               QSPI_SR_BUSY_MASK |
-                               QSPI_SR_AHB_ACC_MASK |
-                               QSPI_SR_IP_ACC_MASK,
-                               false, 100, false);
+       ret = is_controller_busy(priv);
 
        if (ret) {
                debug("ERROR : The controller is busy\n");
index 7fe79efc1776574dba202ec5fc4e737b6d2d9d6b..4868581066f421b4d43222a20cd8227900827adb 100644 (file)
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  *  EHCI HCD (Host Controller Driver) for USB.
  *
  *  Copyright (C) 2013,2014 Renesas Electronics Corporation
  *  Copyright (C) 2014 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
- *
- *  SPDX-License-Identifier:     GPL-2.0
  */
 
 #include <common.h>
index 2a746c6f8b0f8e0f87b874121705c46cbb33278b..45e54ac176827566cf47b77bdcce5a6034f5b1a4 100644 (file)
@@ -1,8 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
 #
 #  Copyright (C) 2015 Google, Inc
 #  Written by Simon Glass <sjg@chromium.org>
-#
-#  SPDX-License-Identifier:    GPL-2.0+
 
 obj-$(CONFIG_VIDEO_BRIDGE) += video-bridge-uclass.o
 obj-$(CONFIG_VIDEO_BRIDGE_PARADE_PS862X) += ps862x.o
index d1683f238afe0f2f794650d1980edf485bcb4cc1..9a8b5e82e389366aa851837feddeab5005719566 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  *  Portable Executable and Common Object Constants
  *
@@ -5,8 +6,6 @@
  *
  *  based on the "Microsoft Portable Executable and Common Object File Format
  *  Specification", revision 11, 2017-01-23
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #ifndef _ASM_PE_H
index 3eb802470a2b8bae55802b319c684c387981756a..671adcc4101adb7c192fb0cb2ab7898f60e25b31 100644 (file)
@@ -3,11 +3,15 @@
  * (C) Copyright 2012
  * Stefan Roese, DENX Software Engineering, sr@denx.de.
  */
+#ifndef _BOOTCOUNT_H__
+#define _BOOTCOUNT_H__
 
 #include <common.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
 
+#if defined(CONFIG_SPL_BOOTCOUNT_LIMIT) || defined(CONFIG_BOOTCOUNT_LIMIT)
+
 #if !defined(CONFIG_SYS_BOOTCOUNT_LE) && !defined(CONFIG_SYS_BOOTCOUNT_BE)
 # if __BYTE_ORDER == __LITTLE_ENDIAN
 #  define CONFIG_SYS_BOOTCOUNT_LE
@@ -37,3 +41,49 @@ static inline u32 raw_bootcount_load(volatile u32 *addr)
        return in_be32(addr);
 }
 #endif
+
+DECLARE_GLOBAL_DATA_PTR;
+static inline int bootcount_error(void)
+{
+       unsigned long bootcount = bootcount_load();
+       unsigned long bootlimit = env_get_ulong("bootlimit", 10, 0);
+
+       if (bootlimit && bootcount > bootlimit) {
+               printf("Warning: Bootlimit (%lu) exceeded.", bootlimit);
+               if (!(gd->flags & GD_FLG_SPL_INIT))
+                       printf(" Using altbootcmd.");
+               printf("\n");
+
+               return 1;
+       }
+
+       return 0;
+}
+
+static inline void bootcount_inc(void)
+{
+       unsigned long bootcount = bootcount_load();
+
+       if (gd->flags & GD_FLG_SPL_INIT) {
+               bootcount_store(++bootcount);
+               return;
+       }
+
+#ifndef CONFIG_SPL_BUILD
+       /* Only increment bootcount when no bootcount support in SPL */
+#ifndef CONFIG_SPL_BOOTCOUNT_LIMIT
+       bootcount_store(++bootcount);
+#endif
+       env_set_ulong("bootcount", bootcount);
+#endif /* !CONFIG_SPL_BUILD */
+}
+
+#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_BOOTCOUNT_LIMIT)
+void bootcount_store(ulong a) {};
+ulong bootcount_load(void) { return 0; }
+#endif /* CONFIG_SPL_BUILD && !CONFIG_SPL_BOOTCOUNT_LIMIT */
+#else
+static inline int bootcount_error(void) { return 0; }
+static inline void bootcount_inc(void) {}
+#endif /* CONFIG_SPL_BOOTCOUNT_LIMIT || CONFIG_BOOTCOUNT_LIMIT */
+#endif /* _BOOTCOUNT_H__ */
index 2662c2f7c9a68cf6647f6799a63ca9ba17fb28b7..11832cbd122eb4b8c3be417d467babad1174c647 100644 (file)
@@ -1,9 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  *  charset conversion utils
  *
  *  Copyright (c) 2017 Rob Clark
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #ifndef __CHARSET_H_
index 0df90161d7552b14095452983b9a70bdc1fb6a60..ea48421bbebc1c7d897fe340e16756a160a45409 100644 (file)
@@ -148,7 +148,6 @@ unsigned long long get_qixis_addr(void);
 #define CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE           (512UL * 1024 * 1024)
 #endif
 /* Command line configuration */
-#define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_CACHE
 
 /* Miscellaneous configurable options */
@@ -195,10 +194,6 @@ unsigned long long get_qixis_addr(void);
        "mcinitcmd=fsl_mc start mc 0x580a00000" \
        " 0x580e00000 \0"
 
-#define CONFIG_BOOTARGS                "console=ttyS0,115200 root=/dev/ram0 " \
-                               "earlycon=uart8250,mmio,0x21c0500 " \
-                               "ramdisk_size=0x3000000 default_hugepagesz=2m" \
-                               " hugepagesz=2m hugepages=256"
 #if defined(CONFIG_QSPI_BOOT)
 #define CONFIG_BOOTCOMMAND     "sf probe 0:0;" \
                                "sf read 0x80200000 0xd00000 0x100000;"\
index 010e55a47397ebfc4d5e219fd4239aa1a387adb1..840483a416a454155aad70b9515459e7d2cc3953 100644 (file)
@@ -1,9 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  *  EFI application loader
  *
  *  Copyright (c) 2017 Heinrich Schuchardt
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #ifndef _EFI_DRIVER_H
index 8d21ba74b1d245f42547fee7ba015cacc5a086c2..2868ca25abb493d3ec5e867591eb65e9811c0ad4 100644 (file)
@@ -1,9 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  *  EFI application loader
  *
  *  Copyright (c) 2016 Alexander Graf
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #ifndef _EFI_LOADER_H
index c23bc24bed0f5d0935c84bc26c199598606e52d8..d0a76d70cae44996a13e60580a15c8bce4dccc72 100644 (file)
@@ -1,9 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  *  EFI application loader
  *
  *  Copyright (c) 2017 Heinrich Schuchardt <xypron.glpk@gmx.de>
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #ifndef _EFI_SELFTEST_H
index 8d7c14d97dbfa046255ed750fc77000368481476..2278ac952ea94d50962e72f3f59cb903badb6e62 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Freescale Layerscape MC I/O wrapper
  *
- * Copyright (C) 2013-2016 Freescale Semiconductor, Inc.
+ * Copyright 2013-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 /*!
index c300c94e202b4921cc8a40e7108f4936b2d9584d..7788e1962e6448fb77f17005791712cb6a4dcb70 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright (C) 2013-2016 Freescale Semiconductor
+ * Copyright 2013-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 
index 66cf3bf6a2158fb0d2f5d641baead1cd154f9522..1cea123a316498b860b24494ca7d04194e9a92e4 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Freescale Layerscape MC I/O wrapper
  *
- * Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  * Author: Prabhakar Kushwaha <prabhakar@freescale.com>
  */
index 309d323acf7185841239e9bd4fc377dfec900bec..96d81d9934917254e021b33bc58d888fb1d03ee3 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright (C) 2013-2016 Freescale Semiconductor
+ * Copyright 2013-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 #ifndef _FSL_DPNI_H
index 779d6f95672d7cf2b884d4e37de8677849cad297..950ecb0756980f3281c4a073fc89f7f410c2df49 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Freescale Layerscape MC I/O wrapper
  *
- * Copyright (C) 2013-2016 Freescale Semiconductor, Inc.
+ * Copyright 2013-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 #ifndef _FSL_DPRC_H
index 179f6698283154d2c12b65db73e6ac5d7e20afc5..591cda9685155094d60604fc11c3f3d7c1a5f3d9 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
-/* Copyright 2013-2016 Freescale Semiconductor Inc.
+/* Copyright 2013-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 #ifndef __FSL_MC_CMD_H
index f4b5a99e15de26be930c290c9d0198bbaa374557..ba0bc379d5b8b3690888868a47a815bb3ab8a75d 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright (C) 2014-2016 Freescale Semiconductor
+ * Copyright 2014-2016 Freescale Semiconductor, Inc.
  * Copyright 2017 NXP
  */
 
index d051e92ce4c0085ac17443f596ecf8080ffe1144..8120ca0de8652bdd8aad0140811bc0c733985ed3 100644 (file)
@@ -891,8 +891,8 @@ struct fsl_ifc_nand {
        u32 nand_erattr1;
        u32 res19[0x10];
        u32 nand_fsr;
-       u32 res20[0x3];
-       u32 nand_eccstat[6];
+       u32 res20[0x1];
+       u32 nand_eccstat[8];
        u32 res21[0x1c];
        u32 nanndcr;
        u32 res22[0x2];
index 8fa75a5a5a322faa9240bb2ce8b80679f0b0db4b..df701e34705a3aa3e881e267192da05f3c3d87e7 100644 (file)
@@ -259,7 +259,7 @@ enum {
        IH_TYPE_MXSIMAGE,               /* Freescale MXSBoot Image      */
        IH_TYPE_GPIMAGE,                /* TI Keystone GPHeader Image   */
        IH_TYPE_ATMELIMAGE,             /* ATMEL ROM bootable Image     */
-       IH_TYPE_SOCFPGAIMAGE,           /* Altera SOCFPGA Preloader     */
+       IH_TYPE_SOCFPGAIMAGE,           /* Altera SOCFPGA CV/AV Preloader */
        IH_TYPE_X86_SETUP,              /* x86 setup.bin Image          */
        IH_TYPE_LPC32XXIMAGE,           /* x86 setup.bin Image          */
        IH_TYPE_LOADABLE,               /* A list of typeless images    */
@@ -275,6 +275,7 @@ enum {
        IH_TYPE_FIRMWARE_IVT,           /* Firmware Image with HABv4 IVT */
        IH_TYPE_PMMC,            /* TI Power Management Micro-Controller Firmware */
        IH_TYPE_STM32IMAGE,             /* STMicroelectronics STM32 Image */
+       IH_TYPE_SOCFPGAIMAGE_V1,        /* Altera SOCFPGA A10 Preloader */
 
        IH_TYPE_COUNT,                  /* Number of image types */
 };
index 4ded5ee68a91bd44bb6fb08234b3469ee4fb6c09..d4e32ecfc644b9a578910788de883449136844b0 100644 (file)
@@ -3,6 +3,11 @@
  *
  * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
  * Written by David Howells (dhowells@redhat.com)
+ *
+ * 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.
  */
 
 #ifndef _LINUX_LOG2_H
 #include <linux/types.h>
 #include <linux/bitops.h>
 
-/*
- * deal with unrepresentable constant logarithms
- */
-extern __attribute__((const, noreturn))
-int ____ilog2_NaN(void);
-
 /*
  * non-constant log of base 2 calculators
  * - the arch may override these in asm/bitops.h if they can be implemented
@@ -39,19 +38,23 @@ int __ilog2_u64(u64 n)
 }
 #endif
 
-/*
- *  Determine whether some value is a power of two, where zero is
+/**
+ * is_power_of_2() - check if a value is a power of two
+ * @n: the value to check
+ *
+ * Determine whether some value is a power of two, where zero is
  * *not* considered a power of two.
+ * Return: true if @n is a power of 2, otherwise false.
  */
-
 static inline __attribute__((const))
 bool is_power_of_2(unsigned long n)
 {
        return (n != 0 && ((n & (n - 1)) == 0));
 }
 
-/*
- * round up to nearest power of two
+/**
+ * __roundup_pow_of_two() - round up to nearest power of two
+ * @n: value to round up
  */
 static inline __attribute__((const))
 unsigned long __roundup_pow_of_two(unsigned long n)
@@ -59,8 +62,9 @@ unsigned long __roundup_pow_of_two(unsigned long n)
        return 1UL << fls_long(n - 1);
 }
 
-/*
- * round down to nearest power of two
+/**
+ * __rounddown_pow_of_two() - round down to nearest power of two
+ * @n: value to round down
  */
 static inline __attribute__((const))
 unsigned long __rounddown_pow_of_two(unsigned long n)
@@ -69,19 +73,19 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
 }
 
 /**
- * ilog2 - log of base 2 of 32-bit or a 64-bit unsigned value
- * @n - parameter
+ * ilog2 - log base 2 of 32-bit or a 64-bit unsigned value
+ * @n: parameter
  *
  * constant-capable log of base 2 calculation
  * - this can be used to initialise global variables from constant data, hence
- *   the massive ternary operator construction
+ * the massive ternary operator construction
  *
  * selects the appropriately-sized optimised version depending on sizeof(n)
  */
 #define ilog2(n)                               \
 (                                              \
        __builtin_constant_p(n) ? (             \
-               (n) < 1 ? ____ilog2_NaN() :     \
+               (n) < 2 ? 0 :                   \
                (n) & (1ULL << 63) ? 63 :       \
                (n) & (1ULL << 62) ? 62 :       \
                (n) & (1ULL << 61) ? 61 :       \
@@ -144,10 +148,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
                (n) & (1ULL <<  4) ?  4 :       \
                (n) & (1ULL <<  3) ?  3 :       \
                (n) & (1ULL <<  2) ?  2 :       \
-               (n) & (1ULL <<  1) ?  1 :       \
-               (n) & (1ULL <<  0) ?  0 :       \
-               ____ilog2_NaN()                 \
-                                  ) :          \
+               1) :                            \
        (sizeof(n) <= 4) ?                      \
        __ilog2_u32(n) :                        \
        __ilog2_u64(n)                          \
@@ -155,7 +156,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
 
 /**
  * roundup_pow_of_two - round the given value up to nearest power of two
- * @n - parameter
+ * @n: parameter
  *
  * round the given value up to the nearest power of two
  * - the result is undefined when n == 0
@@ -172,7 +173,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
 
 /**
  * rounddown_pow_of_two - round the given value down to nearest power of two
- * @n - parameter
+ * @n: parameter
  *
  * round the given value down to the nearest power of two
  * - the result is undefined when n == 0
@@ -185,6 +186,12 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
        __rounddown_pow_of_two(n)               \
  )
 
+static inline __attribute_const__
+int __order_base_2(unsigned long n)
+{
+       return n > 1 ? ilog2(n - 1) + 1 : 0;
+}
+
 /**
  * order_base_2 - calculate the (rounded up) base 2 order of the argument
  * @n: parameter
@@ -198,7 +205,11 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
  *  ob2(5) = 3
  *  ... and so on.
  */
-
-#define order_base_2(n) ilog2(roundup_pow_of_two(n))
-
+#define order_base_2(n)                                \
+(                                              \
+       __builtin_constant_p(n) ? (             \
+               ((n) == 0 || (n) == 1) ? 0 :    \
+               ilog2((n) - 1) + 1) :           \
+       __order_base_2(n)                       \
+)
 #endif /* _LINUX_LOG2_H */
index 3469811aa0ea3a7f3910f45db52b882708f76c68..65f51d77a555d3e7dce91ef769bf4ba7bbe564c2 100644 (file)
@@ -1,9 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  *     LiMon Monitor (LiMon) - Network.
  *
  *     Copyright 1994 - 2000 Neil Russell.
  *     (See License)
- *     SPDX-License-Identifier:        GPL-2.0
  *
  * History
  *     9/16/00   bor  adapted to TQM823L/STK8xxL board, RARP/TFTP boot added
index e7845bb7d2cfa5ff00144b768d12492e7af849e3..d73eb142cb3a85a8de3584876e586cb9bd768b39 100644 (file)
@@ -1,11 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  *  Portable Executable binary format structures
  *
  *  Copyright (c) 2016 Alexander Graf
  *
  *  Based on wine code
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #ifndef _PE_H
index 8cd17ea1cb78363b17f049d05e4fb0f5153da37c..cd186a5a5ae6735a75ae88a1188f6d6e4e5851d5 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  charset conversion utils
  *
  *  Copyright (c) 2017 Rob Clark
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <charset.h>
index e35529a952285c432a3ac6b5ce03e6d636618020..83baa1c9a498c33e9313779e1e5860bad1285cfc 100644 (file)
@@ -1,8 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
 #
 # (C) Copyright 2017 Heinrich Schuchardt
-#
-#  SPDX-License-Identifier:     GPL-2.0+
-#
 
 # This file only gets included with CONFIG_EFI_LOADER set, so all
 # object inclusion implicitly depends on it
index d9d2b14f61244dcf8575e833b1e0c7318e256fde..9c807ff71dffcc6b825d2481a1ae760bbd384fa5 100644 (file)
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI block driver
  *
  *  Copyright (c) 2017 Heinrich Schuchardt
  *
- *  SPDX-License-Identifier:     GPL-2.0+
- *
  * The EFI uclass creates a handle for this driver and installs the
  * driver binding protocol on it.
  *
index 46b69b479cb6beb4e6bf5ebe8888cfa933f594e9..b484aba072fae125fc0bcf435762cd3109294b61 100644 (file)
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  Uclass for EFI drivers
  *
  *  Copyright (c) 2017 Heinrich Schuchardt
  *
- *  SPDX-License-Identifier:     GPL-2.0+
- *
  * For each EFI driver the uclass
  * - creates a handle
  * - installs the driver binding protocol
index 55c97c047666e9d961879475c1c655e44e228d73..c6046e36d2647409151cfc114fa90857ca32a96e 100644 (file)
@@ -1,8 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
 #
 # (C) Copyright 2016 Alexander Graf
 #
-#  SPDX-License-Identifier:     GPL-2.0+
-#
 
 # This file only gets included with CONFIG_EFI_LOADER set, so all
 # object inclusion implicitly depends on it
index c96b9d48c5929fd029a4a2253cb186ed92251d71..153e17375737bc7fbffeb008b5f1cf5f5f48e396 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI utils
  *
  *  Copyright (c) 2017 Rob Clark
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index 1cfdabf6ebb1e99a86e01ce08928ca482c374dcb..5715a8b810e72959a76cc29f49e35ea05fa89e25 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI application boot time services
  *
  *  Copyright (c) 2016 Alexander Graf
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index 5d1a9a8081eeab0681caf546977c15e76e80e3a8..d777db8a3ed13cb888eccae5fb2182ae42bd6e65 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI application console interface
  *
  *  Copyright (c) 2016 Alexander Graf
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index a79e60a4eeae89f4a768f526d3d4c7267f440601..ca8037def2394714d9c13724ff1e61f44dc85a80 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI device path interface
  *
  *  Copyright (c) 2017 Heinrich Schuchardt
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index 0ada2111db980a95db2a4c1d15c75721d717b5dd..94015329c8cb45cc5220dbff0145bf8d76fe71b2 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI device path interface
  *
  *  Copyright (c) 2017 Leif Lindholm
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index 825a6d86de8effaa1252ffa29e034db0a0bd043f..5c6ec5258cdad97e7b855d1f99ec9ad630f046bc 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI application disk support
  *
  *  Copyright (c) 2016 Alexander Graf
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index cec8347f558722c32ed45ea584f45d3a3497668b..e6a15bcb523e7f42beff044fbca3ceb94f9cbd8a 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI utils
  *
  *  Copyright (c) 2017 Rob Clark
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index 363ccbb78904a2c32bde7148dff5a3cfdc5632fc..1afe8418e127342771b9989ef115d5c69bff5d73 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI application disk support
  *
  *  Copyright (c) 2016 Alexander Graf
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index 2ccd476e57a2b3e00a7e83049e75f2efe836b97c..e832cde9016dae0c2cff1514a558d82603c81bc3 100644 (file)
@@ -1,11 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI image loader
  *
  *  based partly on wine code
  *
  *  Copyright (c) 2016 Alexander Graf
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index 95f9ff0a14017ee9fb0f04045061837c6a41d5b8..664c651db56292a63fce538b98f30c2976f5b026 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI application memory management
  *
  *  Copyright (c) 2016 Alexander Graf
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index e3132e6c172e526de5a5ebe46f5278e2f764294e..e1139501d1fbd59833384c3ca98d821a97d478aa 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI application network access support
  *
  *  Copyright (c) 2016 Alexander Graf
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index 8558124c0a12d8dcb4d80c27d824747ab88b8e7e..52f1301d75b67ceb71dbccfd5e0e7cf449bcd5fb 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI application runtime services
  *
  *  Copyright (c) 2016 Alexander Graf
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index 62e96979021d51c5b8e9488a107411a40f3ab662..482436e2adb7c6469625238767eeb68176c0d178 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI application tables support
  *
  *  Copyright (c) 2016 Alexander Graf
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index 6c177da3a6054339ae77296a4d6dab2fd0fc523d..7e0e7f020ee12d428669d4027341703640a64c3a 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI utils
  *
  *  Copyright (c) 2017 Rob Clark
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <malloc.h>
index d12e51da0a21e89e7687119f050867f52975f654..6f69b76e4d94f3644b2d579686b7504afc18260e 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI watchdog
  *
  *  Copyright (c) 2017 Heinrich Schuchardt
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
index 0e4980c8a0bfc2073948ee6beb69f03eee2d4d95..80c43026458e33bc4969a7baf3b3eda72397ed42 100644 (file)
@@ -1,8 +1,6 @@
-:
-# (C) Copyright 2017, Heinrich Schuchardt <xypron.glpk@gmx.de>
-#
-#  SPDX-License-Identifier:     GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0+
 #
+# (C) Copyright 2017, Heinrich Schuchardt <xypron.glpk@gmx.de>
 
 # This file only gets included with CONFIG_EFI_LOADER set, so all
 # object inclusion implicitly depends on it
index 9c741ce136c4cc0d47cb77c3f0ffc4bef0349494..a0e0586608920402a45955e954ee0f4860d43a77 100644 (file)
@@ -1,9 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  *  Non-zero 8 byte strings of a disk image
  *
  *  Generated with tools/file2include
- *
- *  SPDX-License-Identifier:   GPL-2.0+
  */
 
 #define EFI_ST_DISK_IMG { 0x00010000, { \
index f518341af5c2b608d3c1aa45d1acb0e1f66f577d..046c34e39063e9c237249ef1e5a056a8d6d7c99d 100644 (file)
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: BSD-2-Clause
 /*
    LZ4 - Fast LZ compression algorithm
    Copyright (C) 2011-2015, Yann Collet.
 
-   SPDX-License-Identifier: BSD-2-Clause
-
    You can contact the author at :
    - LZ4 source repository : https://github.com/Cyan4973/lz4
    - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
index 4c79e09ccbf6d8cb3ba49a31f98bf26aedaa0ae2..990b771c92118c330fc3f544464bfef96aa482e9 100644 (file)
--- a/net/arp.c
+++ b/net/arp.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  *     Copied from Linux Monitor (LiMon) - Networking.
  *
@@ -6,7 +7,6 @@
  *     Copyright 2000 Roland Borde
  *     Copyright 2000 Paolo Scaffardi
  *     Copyright 2000-2002 Wolfgang Denk, wd@denx.de
- *     SPDX-License-Identifier:        GPL-2.0
  */
 
 #include <common.h>
index a288d618b6849a329a919d0d768f0ab142a46ace..afb86958f3adce32c4955fd25831b5dfda8ed63a 100644 (file)
--- a/net/arp.h
+++ b/net/arp.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  *     Copied from Linux Monitor (LiMon) - Networking.
  *
@@ -6,7 +7,6 @@
  *     Copyright 2000 Roland Borde
  *     Copyright 2000 Paolo Scaffardi
  *     Copyright 2000-2002 Wolfgang Denk, wd@denx.de
- *     SPDX-License-Identifier:        GPL-2.0
  */
 
 #ifndef __ARP_H__
index f9ccf5323183d98cf10435192d17502c7a8cd069..fac02046819492673f5b669cc49230e5fbdddb09 100644 (file)
--- a/net/cdp.c
+++ b/net/cdp.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  *     Copied from Linux Monitor (LiMon) - Networking.
  *
@@ -6,7 +7,6 @@
  *     Copyright 2000 Roland Borde
  *     Copyright 2000 Paolo Scaffardi
  *     Copyright 2000-2002 Wolfgang Denk, wd@denx.de
- *     SPDX-License-Identifier:        GPL-2.0
  */
 
 #include <common.h>
index 83475c992d237885e18a581c1a1b828aa5d4888f..16ccbf4b59edab1216683d906c8710fc8bbba16c 100644 (file)
--- a/net/cdp.h
+++ b/net/cdp.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  *     Copied from Linux Monitor (LiMon) - Networking.
  *
@@ -6,7 +7,6 @@
  *     Copyright 2000 Roland Borde
  *     Copyright 2000 Paolo Scaffardi
  *     Copyright 2000-2002 Wolfgang Denk, wd@denx.de
- *     SPDX-License-Identifier:        GPL-2.0
  */
 
 #if defined(CONFIG_CMD_CDP)
index d222c1f2bd42391b0a2f3eed3d7ae106fad1c527..7f852114427e56cfea1d5a0da150684e3a27bbe1 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  *     Copied from Linux Monitor (LiMon) - Networking.
  *
@@ -6,7 +7,6 @@
  *     Copyright 2000 Roland Borde
  *     Copyright 2000 Paolo Scaffardi
  *     Copyright 2000-2002 Wolfgang Denk, wd@denx.de
- *     SPDX-License-Identifier:        GPL-2.0
  */
 
 /*
index 9508cf1160ea048b03bc715c8b7599f5f71ceff7..5464f2f785fed0c195f81c11a320cd7abad38d77 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  *     Copied from Linux Monitor (LiMon) - Networking.
  *
@@ -6,7 +7,6 @@
  *     Copyright 2000 Roland Borde
  *     Copyright 2000 Paolo Scaffardi
  *     Copyright 2000-2002 Wolfgang Denk, wd@denx.de
- *     SPDX-License-Identifier:        GPL-2.0
  */
 
 #include "ping.h"
index b672b9573934b3ba4c5d86b0ff4de28d636b5f4b..7b6f4e566dbdf48fc49cb853ba7697760b89360a 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  *     Copied from Linux Monitor (LiMon) - Networking.
  *
@@ -6,7 +7,6 @@
  *     Copyright 2000 Roland Borde
  *     Copyright 2000 Paolo Scaffardi
  *     Copyright 2000-2002 Wolfgang Denk, wd@denx.de
- *     SPDX-License-Identifier:        GPL-2.0
  */
 
 #ifndef __PING_H__
index 09e7cef96ed0c38361f3ce0c1a0701891a168d43..057389997de6948d59657eef1f834af52aeeacf7 100644 (file)
@@ -307,7 +307,11 @@ LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
 endif
 endif
 
+ifdef CONFIG_TARGET_SOCFPGA_ARRIA10
+MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage_v1
+else
 MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage
+endif
 $(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE
        $(call if_changed,mkimage)
 
index 20d5dd8a47d90a2f5ff85598a4f9e2914fd24589..b6b9461a107391df712e951a49df8a414f03f9ae 100755 (executable)
@@ -1,9 +1,7 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
 #
 # (C) Copyright 2014 Suriyan Ramasami
-#
-#  SPDX-License-Identifier:    GPL-2.0+
-#
 
 # Invoke this test script from U-Boot base directory as ./test/fs/fs-test.sh
 # It currently tests the fs/sb and native commands for ext4 and fat partitions
index 7ca45c8339a252129aa538dabc65446ee4948708..b98af30a7281d675a58ba3ebb40f1ddf52f1ee54 100644 (file)
@@ -62,12 +62,11 @@ int main(int argc, char *argv[])
        count = fread(buf, 1, count, file);
 
        /* Generate output */
+       printf("/* SPDX-License-Identifier: GPL-2.0+ */\n");
        printf("/*\n");
        printf(" *  Non-zero %u byte strings of a disk image\n", BLOCK_SIZE);
        printf(" *\n");
        printf(" *  Generated with tools/file2include\n");
-       printf(" *\n");
-       printf(" *  SPDX-License-Identifier:    GPL-2.0+\n");
        printf(" */\n\n");
        printf("#define EFI_ST_DISK_IMG { 0x%08zx, { \\\n", count);
 
@@ -85,7 +84,7 @@ int main(int argc, char *argv[])
                        printf("\\x%02x", buf[j]);
                printf("\"}, /* ");
                for (j = i; j < i + BLOCK_SIZE && j < count; ++j) {
-                       if (buf[j] >= 0x20 && buf[j] <= 0x7e)
+                       if (buf[j] != '*' && buf[j] >= 0x20 && buf[j] <= 0x7e)
                                printf("%c", buf[j]);
                        else
                                printf(".");
index a576e2fce19a7a40e4ea30f44164b9b03c63c315..3a39b7bc701194e6bf1e9b0cb767c2feb7abca39 100644 (file)
@@ -757,7 +757,7 @@ static void print_version(void)
 {
        printf("ifdtool v%s -- ", IFDTOOL_VERSION);
        printf("Copyright (C) 2014 Google Inc.\n\n");
-       printf("SPDX-License-Identifier:        GPL-2.0+\n");
+       printf("SPDX-License-Identifier: GPL-2.0+\n");
 }
 
 static void print_usage(const char *name)
index 7f83b50761f08c1771c431a60791060a41fe993b..390c9bb4025798875f189fedeccaba10d4a254e5 100644 (file)
@@ -2,30 +2,52 @@
 /*
  * Copyright (C) 2014 Charles Manning <cdhmanning@gmail.com>
  *
- * Reference doc http://www.altera.com.cn/literature/hb/cyclone-v/cv_5400A.pdf
- * Note this doc is not entirely accurate. Of particular interest to us is the
- * "header" length field being in U32s and not bytes.
+ * Reference documents:
+ *   Cyclone V SoC: https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/cyclone-v/cv_5400a.pdf
+ *   Arria V SoC:   https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/arria-v/av_5400a.pdf
+ *   Arria 10 SoC:  https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/arria-10/a10_5400a.pdf
  *
- * "Header" is a structure of the following format.
- * this is positioned at 0x40.
+ * Bootable SoCFPGA image requires a structure of the following format
+ * positioned at offset 0x40 of the bootable image. Endian is LSB.
  *
- * Endian is LSB.
+ * There are two versions of the SoCFPGA header format, v0 and v1.
+ * The version 0 is used by Cyclone V SoC and Arria V SoC, while
+ * the version 1 is used by the Arria 10 SoC.
  *
+ * Version 0:
  * Offset   Length   Usage
  * -----------------------
- *   0x40        4   Validation word 0x31305341
- *   0x44        1   Version (whatever, zero is fine)
- *   0x45        1   Flags   (unused, zero is fine)
- *   0x46        2   Length  (in units of u32, including the end checksum).
- *   0x48        2   Zero
+ *   0x40        4   Validation word (0x31305341)
+ *   0x44        1   Version (0x0)
+ *   0x45        1   Flags (unused, zero is fine)
+ *   0x46        2   Length (in units of u32, including the end checksum).
+ *   0x48        2   Zero (0x0)
  *   0x4A        2   Checksum over the header. NB Not CRC32
  *
+ * Version 1:
+ * Offset   Length   Usage
+ * -----------------------
+ *   0x40        4   Validation word (0x31305341)
+ *   0x44        1   Version (0x1)
+ *   0x45        1   Flags (unused, zero is fine)
+ *   0x46        2   Header length (in units of u8).
+ *   0x48        4   Length (in units of u8).
+ *   0x4C        4   Image entry offset from standard of header
+ *   0x50        2   Zero (0x0)
+ *   0x52        2   Checksum over the header. NB Not CRC32
+ *
  * At the end of the code we have a 32-bit CRC checksum over whole binary
  * excluding the CRC.
  *
  * Note that the CRC used here is **not** the zlib/Adler crc32. It is the
  * CRC-32 used in bzip2, ethernet and elsewhere.
  *
+ * The Image entry offset in version 1 image is relative the the start of
+ * the header, 0x40, and must not be a negative number. Therefore, it is
+ * only possible to make the SoCFPGA jump forward. The U-Boot bootloader
+ * places a trampoline instruction at offset 0x5c, 0x14 bytes from the
+ * start of the SoCFPGA header, which jumps to the reset vector.
+ *
  * The image is padded out to 64k, because that is what is
  * typically used to write the image to the boot medium.
  */
 
 #define HEADER_OFFSET  0x40
 #define VALIDATION_WORD        0x31305341
-#define PADDED_SIZE    0x10000
 
-/* To allow for adding CRC, the max input size is a bit smaller. */
-#define MAX_INPUT_SIZE (PADDED_SIZE - sizeof(uint32_t))
-
-static uint8_t buffer[PADDED_SIZE];
+static uint8_t buffer_v0[0x10000];
+static uint8_t buffer_v1[0x40000];
+
+struct socfpga_header_v0 {
+       uint32_t        validation;
+       uint8_t         version;
+       uint8_t         flags;
+       uint16_t        length_u32;
+       uint16_t        zero;
+       uint16_t        checksum;
+};
+
+struct socfpga_header_v1 {
+       uint32_t        validation;
+       uint8_t         version;
+       uint8_t         flags;
+       uint16_t        header_u8;
+       uint32_t        length_u8;
+       uint32_t        entry_offset;
+       uint16_t        zero;
+       uint16_t        checksum;
+};
+
+static unsigned int sfp_hdr_size(uint8_t ver)
+{
+       if (ver == 0)
+               return sizeof(struct socfpga_header_v0);
+       if (ver == 1)
+               return sizeof(struct socfpga_header_v1);
+       return 0;
+}
 
-static struct socfpga_header {
-       uint32_t validation;
-       uint8_t  version;
-       uint8_t  flags;
-       uint16_t length_u32;
-       uint16_t zero;
-       uint16_t checksum;
-} header;
+static unsigned int sfp_pad_size(uint8_t ver)
+{
+       if (ver == 0)
+               return sizeof(buffer_v0);
+       if (ver == 1)
+               return sizeof(buffer_v1);
+       return 0;
+}
 
 /*
  * The header checksum is just a very simple checksum over
  * the header area.
  * There is still a crc32 over the whole lot.
  */
-static uint16_t hdr_checksum(struct socfpga_header *header)
+static uint16_t sfp_hdr_checksum(uint8_t *buf, unsigned char ver)
 {
-       int len = sizeof(*header) - sizeof(header->checksum);
-       uint8_t *buf = (uint8_t *)header;
        uint16_t ret = 0;
+       int len = sfp_hdr_size(ver) - sizeof(ret);
 
        while (--len)
                ret += *buf++;
@@ -71,48 +118,93 @@ static uint16_t hdr_checksum(struct socfpga_header *header)
        return ret;
 }
 
-
-static void build_header(uint8_t *buf, uint8_t version, uint8_t flags,
-                        uint16_t length_bytes)
+static void sfp_build_header(uint8_t *buf, uint8_t ver, uint8_t flags,
+                            uint32_t length_bytes)
 {
-       header.validation = cpu_to_le32(VALIDATION_WORD);
-       header.version = version;
-       header.flags = flags;
-       header.length_u32 = cpu_to_le16(length_bytes/4);
-       header.zero = 0;
-       header.checksum = cpu_to_le16(hdr_checksum(&header));
-
-       memcpy(buf, &header, sizeof(header));
+       struct socfpga_header_v0 header_v0 = {
+               .validation     = cpu_to_le32(VALIDATION_WORD),
+               .version        = 0,
+               .flags          = flags,
+               .length_u32     = cpu_to_le16(length_bytes / 4),
+               .zero           = 0,
+       };
+
+       struct socfpga_header_v1 header_v1 = {
+               .validation     = cpu_to_le32(VALIDATION_WORD),
+               .version        = 1,
+               .flags          = flags,
+               .header_u8      = cpu_to_le16(sizeof(header_v1)),
+               .length_u8      = cpu_to_le32(length_bytes),
+               .entry_offset   = cpu_to_le32(0x14),    /* Trampoline offset */
+               .zero           = 0,
+       };
+
+       uint16_t csum;
+
+       if (ver == 0) {
+               csum = sfp_hdr_checksum((uint8_t *)&header_v0, 0);
+               header_v0.checksum = cpu_to_le16(csum);
+               memcpy(buf, &header_v0, sizeof(header_v0));
+       } else {
+               csum = sfp_hdr_checksum((uint8_t *)&header_v1, 1);
+               header_v1.checksum = cpu_to_le16(csum);
+               memcpy(buf, &header_v1, sizeof(header_v1));
+       }
 }
 
 /*
  * Perform a rudimentary verification of header and return
  * size of image.
  */
-static int verify_header(const uint8_t *buf)
+static int sfp_verify_header(const uint8_t *buf, uint8_t *ver)
 {
-       memcpy(&header, buf, sizeof(header));
+       struct socfpga_header_v0 header_v0;
+       struct socfpga_header_v1 header_v1;
+       uint16_t hdr_csum, sfp_csum;
+       uint32_t img_len;
 
-       if (le32_to_cpu(header.validation) != VALIDATION_WORD)
-               return -1;
-       if (le16_to_cpu(header.checksum) != hdr_checksum(&header))
+       /*
+        * Header v0 is always smaller than Header v1 and the validation
+        * word and version field is at the same place, so use Header v0
+        * to check for version during verifiction and upgrade to Header
+        * v1 if needed.
+        */
+       memcpy(&header_v0, buf, sizeof(header_v0));
+
+       if (le32_to_cpu(header_v0.validation) != VALIDATION_WORD)
                return -1;
 
-       return le16_to_cpu(header.length_u32) * 4;
+       if (header_v0.version == 0) {
+               hdr_csum = le16_to_cpu(header_v0.checksum);
+               sfp_csum = sfp_hdr_checksum((uint8_t *)&header_v0, 0);
+               img_len = le16_to_cpu(header_v0.length_u32) * 4;
+       } else if (header_v0.version == 1) {
+               memcpy(&header_v1, buf, sizeof(header_v1));
+               hdr_csum = le16_to_cpu(header_v1.checksum);
+               sfp_csum = sfp_hdr_checksum((uint8_t *)&header_v1, 1);
+               img_len = le32_to_cpu(header_v1.length_u8);
+       } else {        /* Invalid version */
+               return -EINVAL;
+       }
+
+       /* Verify checksum */
+       if (hdr_csum != sfp_csum)
+               return -EINVAL;
+
+       return img_len;
 }
 
 /* Sign the buffer and return the signed buffer size */
-static int sign_buffer(uint8_t *buf,
-                       uint8_t version, uint8_t flags,
-                       int len, int pad_64k)
+static int sfp_sign_buffer(uint8_t *buf, uint8_t ver, uint8_t flags,
+                          int len, int pad_64k)
 {
        uint32_t calc_crc;
 
        /* Align the length up */
-       len = (len + 3) & (~3);
+       len = (len + 3) & ~3;
 
        /* Build header, adding 4 bytes to length to hold the CRC32. */
-       build_header(buf + HEADER_OFFSET,  version, flags, len + 4);
+       sfp_build_header(buf + HEADER_OFFSET, ver, flags, len + 4);
 
        /* Calculate and apply the CRC */
        calc_crc = ~pbl_crc32(0, (char *)buf, len);
@@ -122,23 +214,24 @@ static int sign_buffer(uint8_t *buf,
        if (!pad_64k)
                return len + 4;
 
-       return PADDED_SIZE;
+       return sfp_pad_size(ver);
 }
 
 /* Verify that the buffer looks sane */
-static int verify_buffer(const uint8_t *buf)
+static int sfp_verify_buffer(const uint8_t *buf)
 {
        int len; /* Including 32bit CRC */
        uint32_t calc_crc;
        uint32_t buf_crc;
+       uint8_t ver = 0;
 
-       len = verify_header(buf + HEADER_OFFSET);
+       len = sfp_verify_header(buf + HEADER_OFFSET, &ver);
        if (len < 0) {
                debug("Invalid header\n");
                return -1;
        }
 
-       if (len < HEADER_OFFSET || len > PADDED_SIZE) {
+       if (len < HEADER_OFFSET || len > sfp_pad_size(ver)) {
                debug("Invalid header length (%i)\n", len);
                return -1;
        }
@@ -164,17 +257,17 @@ static int verify_buffer(const uint8_t *buf)
 
 /* mkimage glue functions */
 static int socfpgaimage_verify_header(unsigned char *ptr, int image_size,
-                       struct image_tool_params *params)
+                                     struct image_tool_params *params)
 {
-       if (image_size != PADDED_SIZE)
+       if (image_size < 0x80)
                return -1;
 
-       return verify_buffer(ptr);
+       return sfp_verify_buffer(ptr);
 }
 
 static void socfpgaimage_print_header(const void *ptr)
 {
-       if (verify_buffer(ptr) == 0)
+       if (sfp_verify_buffer(ptr) == 0)
                printf("Looks like a sane SOCFPGA preloader\n");
        else
                printf("Not a sane SOCFPGA preloader\n");
@@ -188,18 +281,25 @@ static int socfpgaimage_check_params(struct image_tool_params *params)
                (params->lflag && (params->dflag || params->fflag));
 }
 
-static int socfpgaimage_check_image_types(uint8_t type)
+static int socfpgaimage_check_image_types_v0(uint8_t type)
 {
        if (type == IH_TYPE_SOCFPGAIMAGE)
                return EXIT_SUCCESS;
        return EXIT_FAILURE;
 }
 
+static int socfpgaimage_check_image_types_v1(uint8_t type)
+{
+       if (type == IH_TYPE_SOCFPGAIMAGE_V1)
+               return EXIT_SUCCESS;
+       return EXIT_FAILURE;
+}
+
 /*
  * To work in with the mkimage framework, we do some ugly stuff...
  *
  * First, socfpgaimage_vrec_header() is called.
- * We prepend a fake header big enough to make the file PADDED_SIZE.
+ * We prepend a fake header big enough to make the file sfp_pad_size().
  * This gives us enough space to do what we want later.
  *
  * Next, socfpgaimage_set_header() is called.
@@ -208,51 +308,94 @@ static int socfpgaimage_check_image_types(uint8_t type)
  */
 
 static int data_size;
-#define FAKE_HEADER_SIZE (PADDED_SIZE - data_size)
 
-static int socfpgaimage_vrec_header(struct image_tool_params *params,
-                               struct image_type_params *tparams)
+static int sfp_fake_header_size(unsigned int size, uint8_t ver)
+{
+       return sfp_pad_size(ver) - size;
+}
+
+static int sfp_vrec_header(struct image_tool_params *params,
+                          struct image_type_params *tparams, uint8_t ver)
 {
        struct stat sbuf;
 
        if (params->datafile &&
            stat(params->datafile, &sbuf) == 0 &&
-           sbuf.st_size <= MAX_INPUT_SIZE) {
+           sbuf.st_size <= (sfp_pad_size(ver) - sizeof(uint32_t))) {
                data_size = sbuf.st_size;
-               tparams->header_size = FAKE_HEADER_SIZE;
+               tparams->header_size = sfp_fake_header_size(data_size, ver);
        }
        return 0;
+
+}
+
+static int socfpgaimage_vrec_header_v0(struct image_tool_params *params,
+                                      struct image_type_params *tparams)
+{
+       return sfp_vrec_header(params, tparams, 0);
 }
 
-static void socfpgaimage_set_header(void *ptr, struct stat *sbuf, int ifd,
-                               struct image_tool_params *params)
+static int socfpgaimage_vrec_header_v1(struct image_tool_params *params,
+                                      struct image_type_params *tparams)
+{
+       return sfp_vrec_header(params, tparams, 1);
+}
+
+static void sfp_set_header(void *ptr, unsigned char ver)
 {
        uint8_t *buf = (uint8_t *)ptr;
 
        /*
         * This function is called after vrec_header() has been called.
-        * At this stage we have the FAKE_HEADER_SIZE dummy bytes followed by
-        * data_size image bytes. Total = PADDED_SIZE.
+        * At this stage we have the sfp_fake_header_size() dummy bytes
+        * followed by data_size image bytes. Total = sfp_pad_size().
         * We need to fix the buffer by moving the image bytes back to
         * the beginning of the buffer, then actually do the signing stuff...
         */
-       memmove(buf, buf + FAKE_HEADER_SIZE, data_size);
-       memset(buf + data_size, 0, FAKE_HEADER_SIZE);
+       memmove(buf, buf + sfp_fake_header_size(data_size, ver), data_size);
+       memset(buf + data_size, 0, sfp_fake_header_size(data_size, ver));
 
-       sign_buffer(buf, 0, 0, data_size, 0);
+       sfp_sign_buffer(buf, ver, 0, data_size, 0);
+}
+
+static void socfpgaimage_set_header_v0(void *ptr, struct stat *sbuf, int ifd,
+                                      struct image_tool_params *params)
+{
+       sfp_set_header(ptr, 0);
+}
+
+static void socfpgaimage_set_header_v1(void *ptr, struct stat *sbuf, int ifd,
+                                      struct image_tool_params *params)
+{
+       sfp_set_header(ptr, 1);
 }
 
 U_BOOT_IMAGE_TYPE(
        socfpgaimage,
-       "Altera SOCFPGA preloader support",
+       "Altera SoCFPGA Cyclone V / Arria V image support",
+       0, /* This will be modified by vrec_header() */
+       (void *)buffer_v0,
+       socfpgaimage_check_params,
+       socfpgaimage_verify_header,
+       socfpgaimage_print_header,
+       socfpgaimage_set_header_v0,
+       NULL,
+       socfpgaimage_check_image_types_v0,
+       NULL,
+       socfpgaimage_vrec_header_v0
+);
+
+U_BOOT_IMAGE_TYPE(
+       socfpgaimage_v1,
+       "Altera SoCFPGA Arria10 image support",
        0, /* This will be modified by vrec_header() */
-       (void *)buffer,
+       (void *)buffer_v1,
        socfpgaimage_check_params,
        socfpgaimage_verify_header,
        socfpgaimage_print_header,
-       socfpgaimage_set_header,
+       socfpgaimage_set_header_v1,
        NULL,
-       socfpgaimage_check_image_types,
+       socfpgaimage_check_image_types_v1,
        NULL,
-       socfpgaimage_vrec_header
+       socfpgaimage_vrec_header_v1
 );