From 747ae744561bf5a9ee069d48c1bfc94a18e1c015 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 16 Jun 2024 17:19:11 +0200 Subject: [PATCH 01/10] configs: Remove duplicate newlines Drop all duplicate newlines from config headers. No functional change. Signed-off-by: Marek Vasut --- include/configs/M5208EVBE.h | 1 - include/configs/M5235EVB.h | 1 - include/configs/M5249EVB.h | 1 - include/configs/M5253DEMO.h | 2 -- include/configs/M5272C3.h | 1 - include/configs/M5275EVB.h | 1 - include/configs/M5282EVB.h | 1 - include/configs/M53017EVB.h | 1 - include/configs/M5329EVB.h | 1 - include/configs/M5373EVB.h | 1 - include/configs/MPC837XERDB.h | 1 - include/configs/P2041RDB.h | 1 - include/configs/T4240RDB.h | 1 - include/configs/arbel.h | 1 - include/configs/aristainetos2.h | 1 - include/configs/astro_mcf5373l.h | 1 - include/configs/cobra5272.h | 1 - include/configs/display5.h | 1 - include/configs/ds414.h | 1 - include/configs/eb_cpu5282.h | 1 - include/configs/ethernut5.h | 1 - include/configs/ge_bx50v3.h | 1 - include/configs/imx6_logic.h | 1 - include/configs/imx7-cm.h | 1 - include/configs/imx8mm-cl-iot-gate.h | 1 - include/configs/imx8mm_evk.h | 1 - include/configs/imx8mn_evk.h | 1 - include/configs/imx8mp_evk.h | 1 - include/configs/imx8mp_rsb3720.h | 1 - include/configs/imx8mq_cm.h | 1 - include/configs/imx8mq_evk.h | 1 - include/configs/imx8mq_phanbell.h | 1 - include/configs/imx8mq_reform2.h | 1 - include/configs/imx8ulp_evk.h | 2 -- include/configs/j721e_evm.h | 1 - include/configs/kontron_pitx_imx8m.h | 2 -- include/configs/ls1012aqds.h | 1 - include/configs/ls1043a_common.h | 1 - include/configs/ls1088a_common.h | 3 --- include/configs/ls1088aqds.h | 1 - include/configs/ls1088ardb.h | 1 - include/configs/lx2160a_common.h | 1 - include/configs/meson64.h | 1 - include/configs/mt8183.h | 1 - include/configs/mt8516.h | 1 - include/configs/mx53cx9020.h | 1 - include/configs/mx6ullevk.h | 1 - include/configs/mx7ulp_evk.h | 1 - include/configs/phycore_imx8mm.h | 1 - include/configs/phycore_imx8mp.h | 1 - include/configs/pico-imx6ul.h | 1 - include/configs/pico-imx8mq.h | 1 - include/configs/sei510.h | 1 - include/configs/siemens-am33x-common.h | 1 - include/configs/socrates.h | 1 - include/configs/stm32mp15_dh_dhsom.h | 1 - include/configs/stmark2.h | 1 - include/configs/ten64.h | 1 - include/configs/topic_miami.h | 1 - include/configs/warp7.h | 1 - include/configs/x86-common.h | 1 - include/configs/xtfpga.h | 1 - include/configs/zynq-common.h | 1 - 63 files changed, 68 deletions(-) diff --git a/include/configs/M5208EVBE.h b/include/configs/M5208EVBE.h index d4c1e06688..a4fda551f1 100644 --- a/include/configs/M5208EVBE.h +++ b/include/configs/M5208EVBE.h @@ -111,5 +111,4 @@ #define CFG_SYS_CS0_MASK 0x007F0001 #define CFG_SYS_CS0_CTRL 0x00001FA0 - #endif /* _M5208EVBE_H */ diff --git a/include/configs/M5235EVB.h b/include/configs/M5235EVB.h index e542818340..8939c8e7ab 100644 --- a/include/configs/M5235EVB.h +++ b/include/configs/M5235EVB.h @@ -130,5 +130,4 @@ # define CFG_SYS_CS0_CTRL 0x00001D80 #endif - #endif /* _M5329EVB_H */ diff --git a/include/configs/M5249EVB.h b/include/configs/M5249EVB.h index 2f4743ce50..4fd539c017 100644 --- a/include/configs/M5249EVB.h +++ b/include/configs/M5249EVB.h @@ -120,5 +120,4 @@ #define CFG_SYS_GPIO1_OUT 0x00c70000 /* Set outputs to default state */ #define CFG_SYS_GPIO1_LED 0x00400000 /* user led */ - #endif /* M5249 */ diff --git a/include/configs/M5253DEMO.h b/include/configs/M5253DEMO.h index 0ff0bfce90..75c70be7ac 100644 --- a/include/configs/M5253DEMO.h +++ b/include/configs/M5253DEMO.h @@ -10,7 +10,6 @@ #define CFG_SYS_UART_PORT (0) - /* Configuration for environment * Environment is embedded in u-boot in the second sector of the flash */ @@ -132,5 +131,4 @@ #define CFG_SYS_GPIO1_OUT 0x00c70000 /* Set outputs to default state */ #define CFG_SYS_GPIO1_LED 0x00400000 /* user led */ - #endif /* _M5253DEMO_H */ diff --git a/include/configs/M5272C3.h b/include/configs/M5272C3.h index 98a17181a4..0d332cba61 100644 --- a/include/configs/M5272C3.h +++ b/include/configs/M5272C3.h @@ -107,5 +107,4 @@ #define CFG_SYS_PBDAT 0x0000 #define CFG_SYS_PDCNT 0x00000000 - #endif /* _M5272C3_H */ diff --git a/include/configs/M5275EVB.h b/include/configs/M5275EVB.h index 77ddf71764..607c5dee2f 100644 --- a/include/configs/M5275EVB.h +++ b/include/configs/M5275EVB.h @@ -116,5 +116,4 @@ #define CFG_SYS_CS1_CTRL 0x00001900 #define CFG_SYS_CS1_MASK 0x00070001 - #endif /* _M5275EVB_H */ diff --git a/include/configs/M5282EVB.h b/include/configs/M5282EVB.h index e289a23b80..31699a40b6 100644 --- a/include/configs/M5282EVB.h +++ b/include/configs/M5282EVB.h @@ -127,5 +127,4 @@ #define CFG_SYS_DDRUA 0x05 #define CFG_SYS_PJPAR 0xFF - #endif /* _CONFIG_M5282EVB_H */ diff --git a/include/configs/M53017EVB.h b/include/configs/M53017EVB.h index dcc5701ee0..6359915e09 100644 --- a/include/configs/M53017EVB.h +++ b/include/configs/M53017EVB.h @@ -132,5 +132,4 @@ #define CFG_SYS_CS1_MASK 0x00070001 #define CFG_SYS_CS1_CTRL 0x00001FA0 - #endif /* _M53017EVB_H */ diff --git a/include/configs/M5329EVB.h b/include/configs/M5329EVB.h index dd5d4c9802..456135bdc6 100644 --- a/include/configs/M5329EVB.h +++ b/include/configs/M5329EVB.h @@ -138,5 +138,4 @@ #define CFG_SYS_CS2_CTRL 0x00001f60 #endif - #endif /* _M5329EVB_H */ diff --git a/include/configs/M5373EVB.h b/include/configs/M5373EVB.h index 4bb9948750..4e8dcb5ef7 100644 --- a/include/configs/M5373EVB.h +++ b/include/configs/M5373EVB.h @@ -136,5 +136,4 @@ #define CFG_SYS_CS2_MASK (16 << 20) #define CFG_SYS_CS2_CTRL 0x00001f60 - #endif /* _M5373EVB_H */ diff --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h index 3967cc2836..a5176d176d 100644 --- a/include/configs/MPC837XERDB.h +++ b/include/configs/MPC837XERDB.h @@ -132,7 +132,6 @@ */ #define CFG_SYS_NAND_BASE 0xE0600000 - /* Vitesse 7385 */ #define CFG_SYS_VSC7385_BASE 0xF0000000 diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h index 28f53ae78a..7cf6514f14 100644 --- a/include/configs/P2041RDB.h +++ b/include/configs/P2041RDB.h @@ -160,7 +160,6 @@ /* I2C */ - /* * RapidIO */ diff --git a/include/configs/T4240RDB.h b/include/configs/T4240RDB.h index 78e136224e..c95325e162 100644 --- a/include/configs/T4240RDB.h +++ b/include/configs/T4240RDB.h @@ -355,7 +355,6 @@ #define CFG_SYS_FSL_ESDHC_ADDR CFG_SYS_MPC85xx_ESDHC_ADDR #endif - #define __USB_PHY_TYPE utmi /* diff --git a/include/configs/arbel.h b/include/configs/arbel.h index d8ccc45968..61f6a5e243 100644 --- a/include/configs/arbel.h +++ b/include/configs/arbel.h @@ -15,7 +15,6 @@ #define CFG_SYS_BAUDRATE_TABLE \ { 9600, 14400, 19200, 38400, 57600, 115200, 230400, 380400, 460800, 921600 } - /* Default environemnt variables */ #define CFG_EXTRA_ENV_SETTINGS "uimage_flash_addr=80400000\0" \ "stdin=serial\0" \ diff --git a/include/configs/aristainetos2.h b/include/configs/aristainetos2.h index 286435d6f8..9d4a4bbdf4 100644 --- a/include/configs/aristainetos2.h +++ b/include/configs/aristainetos2.h @@ -22,7 +22,6 @@ #include "mx6_common.h" - /* MMC Configs */ #define CFG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR diff --git a/include/configs/astro_mcf5373l.h b/include/configs/astro_mcf5373l.h index f3bfefa835..65224324fb 100644 --- a/include/configs/astro_mcf5373l.h +++ b/include/configs/astro_mcf5373l.h @@ -184,5 +184,4 @@ #define CFG_SYS_CACHE_ICACR (CF_CACR_EC | CF_CACR_CINVA | \ CF_CACR_DCM_P) - #endif /* _CONFIG_ASTRO_MCF5373L_H */ diff --git a/include/configs/cobra5272.h b/include/configs/cobra5272.h index 556705fb09..cd50ffe98d 100644 --- a/include/configs/cobra5272.h +++ b/include/configs/cobra5272.h @@ -184,5 +184,4 @@ configuration */ #define CFG_SYS_PBDAT 0x0000 /* PortB value reg. */ #define CFG_SYS_PDCNT 0x00000000 /* PortD control reg. */ - #endif /* _CONFIG_COBRA5272_H */ diff --git a/include/configs/display5.h b/include/configs/display5.h index 3b96fff7d6..2005a256d6 100644 --- a/include/configs/display5.h +++ b/include/configs/display5.h @@ -119,7 +119,6 @@ "run tftp_mmc_rootfs;" \ "run tftp_mmc_rootfs_bkp;" \ - #define TFTP_UPDATE_RECOVERY_SWU_KERNEL \ "tftp_sf_fitImg_SWU=" \ "if tftp ${loadaddr} ${kernel_file}; then " \ diff --git a/include/configs/ds414.h b/include/configs/ds414.h index f1921dac5e..6fbcec0898 100644 --- a/include/configs/ds414.h +++ b/include/configs/ds414.h @@ -53,7 +53,6 @@ "tftpboot ${loadaddr} u-boot-with-spl.kwb; " \ "sf update ${loadaddr} 0x0 0xd0000\0" - /* increase autoneg timeout, my NIC sucks */ #endif /* _CONFIG_SYNOLOGY_DS414_H */ diff --git a/include/configs/eb_cpu5282.h b/include/configs/eb_cpu5282.h index e2c9d9c43c..26e4ade34e 100644 --- a/include/configs/eb_cpu5282.h +++ b/include/configs/eb_cpu5282.h @@ -138,6 +138,5 @@ #define CFG_SYS_DDRUA 0x05 #define CFG_SYS_PJPAR 0xFF - #endif /* _CONFIG_M5282EVB_H */ /*---------------------------------------------------------------------*/ diff --git a/include/configs/ethernut5.h b/include/configs/ethernut5.h index 182369def9..807c696319 100644 --- a/include/configs/ethernut5.h +++ b/include/configs/ethernut5.h @@ -32,7 +32,6 @@ /* 512kB on-chip NOR flash */ # define CFG_SYS_FLASH_BASE 0x00200000 /* AT91SAM9XE_FLASH_BASE */ - /* bootstrap + u-boot + env + linux in dataflash on CS0 */ /* NAND flash */ diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h index 32960fb932..07b36706e5 100644 --- a/include/configs/ge_bx50v3.h +++ b/include/configs/ge_bx50v3.h @@ -88,7 +88,6 @@ "run doboot; " \ "run failbootcmd\0" \ - /* Physical Memory Map */ #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR diff --git a/include/configs/imx6_logic.h b/include/configs/imx6_logic.h index 85c054451f..66004a6eb2 100644 --- a/include/configs/imx6_logic.h +++ b/include/configs/imx6_logic.h @@ -17,7 +17,6 @@ #define CFG_SYS_FSL_ESDHC_ADDR 0 #define CFG_SYS_FSL_USDHC_NUM 2 - /* Ethernet Configs */ #define CFG_FEC_MXC_PHYADDR 0 diff --git a/include/configs/imx7-cm.h b/include/configs/imx7-cm.h index 106fbdb905..131f18290b 100644 --- a/include/configs/imx7-cm.h +++ b/include/configs/imx7-cm.h @@ -77,7 +77,6 @@ #define CFG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR #define CFG_SYS_FSL_USDHC_NUM 2 - /* USB Configs */ #define CFG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) diff --git a/include/configs/imx8mm-cl-iot-gate.h b/include/configs/imx8mm-cl-iot-gate.h index 0c547027ba..6442e3d570 100644 --- a/include/configs/imx8mm-cl-iot-gate.h +++ b/include/configs/imx8mm-cl-iot-gate.h @@ -126,7 +126,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE 0x80000 - #define CFG_SYS_SDRAM_BASE 0x40000000 #define PHYS_SDRAM 0x40000000 #define PHYS_SDRAM_SIZE 0x80000000 /* 2GB DDR */ diff --git a/include/configs/imx8mm_evk.h b/include/configs/imx8mm_evk.h index d5642b9649..9dd63fc119 100644 --- a/include/configs/imx8mm_evk.h +++ b/include/configs/imx8mm_evk.h @@ -56,7 +56,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE 0x200000 - #define CFG_SYS_SDRAM_BASE 0x40000000 #define PHYS_SDRAM 0x40000000 #define PHYS_SDRAM_SIZE 0x80000000 /* 2GB DDR */ diff --git a/include/configs/imx8mn_evk.h b/include/configs/imx8mn_evk.h index b759b834b8..ca02e26c26 100644 --- a/include/configs/imx8mn_evk.h +++ b/include/configs/imx8mn_evk.h @@ -48,7 +48,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE 0x200000 - #define CFG_SYS_SDRAM_BASE 0x40000000 #define PHYS_SDRAM 0x40000000 #define PHYS_SDRAM_SIZE 0x80000000 /* 2GB DDR */ diff --git a/include/configs/imx8mp_evk.h b/include/configs/imx8mp_evk.h index 71452aa283..741ee39db1 100644 --- a/include/configs/imx8mp_evk.h +++ b/include/configs/imx8mp_evk.h @@ -43,7 +43,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE 0x80000 - /* Totally 6GB DDR */ #define CFG_SYS_SDRAM_BASE 0x40000000 #define PHYS_SDRAM 0x40000000 diff --git a/include/configs/imx8mp_rsb3720.h b/include/configs/imx8mp_rsb3720.h index 10a166d781..b82e35f496 100644 --- a/include/configs/imx8mp_rsb3720.h +++ b/include/configs/imx8mp_rsb3720.h @@ -126,7 +126,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE 0x80000 - /* Totally 6GB or 4G DDR */ #define CFG_SYS_SDRAM_BASE 0x40000000 #define PHYS_SDRAM 0x40000000 diff --git a/include/configs/imx8mq_cm.h b/include/configs/imx8mq_cm.h index 7cf482d6de..2bbd6b1680 100644 --- a/include/configs/imx8mq_cm.h +++ b/include/configs/imx8mq_cm.h @@ -48,7 +48,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE 0x80000 - #define CFG_SYS_SDRAM_BASE 0x40000000 #define PHYS_SDRAM 0x40000000 #define PHYS_SDRAM_SIZE 0x40000000 /* 1 GB DDR */ diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h index d2e1649400..9eefc31dc6 100644 --- a/include/configs/imx8mq_evk.h +++ b/include/configs/imx8mq_evk.h @@ -53,7 +53,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE 0x80000 - #define CFG_SYS_SDRAM_BASE 0x40000000 #define PHYS_SDRAM 0x40000000 #define PHYS_SDRAM_SIZE 0xC0000000 /* 3GB DDR */ diff --git a/include/configs/imx8mq_phanbell.h b/include/configs/imx8mq_phanbell.h index b66fc18fa5..cd73a72d2b 100644 --- a/include/configs/imx8mq_phanbell.h +++ b/include/configs/imx8mq_phanbell.h @@ -86,7 +86,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE 0x80000 - #define CFG_SYS_SDRAM_BASE 0x40000000 #define PHYS_SDRAM 0x40000000 #define PHYS_SDRAM_SIZE 0x40000000 /* 1GB DDR */ diff --git a/include/configs/imx8mq_reform2.h b/include/configs/imx8mq_reform2.h index 3148e8622e..7fa441a8a8 100644 --- a/include/configs/imx8mq_reform2.h +++ b/include/configs/imx8mq_reform2.h @@ -54,7 +54,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE 0x80000 - #define CFG_SYS_SDRAM_BASE 0x40000000 #define PHYS_SDRAM 0x40000000 #define PHYS_SDRAM_SIZE 0x100000000 /* 4 GiB DDR */ diff --git a/include/configs/imx8ulp_evk.h b/include/configs/imx8ulp_evk.h index 750aef1b59..aa9da19a11 100644 --- a/include/configs/imx8ulp_evk.h +++ b/include/configs/imx8ulp_evk.h @@ -14,7 +14,6 @@ #ifdef CONFIG_SPL_BUILD #define CFG_MALLOC_F_ADDR 0x22040000 - #endif /* ENET Config */ @@ -51,7 +50,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x80000000 #define CFG_SYS_INIT_RAM_SIZE 0x80000 - #define CFG_SYS_SDRAM_BASE 0x80000000 #define PHYS_SDRAM 0x80000000 #define PHYS_SDRAM_SIZE 0x80000000 /* 2GB DDR */ diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h index a5140ea6a1..bdf12ee8f7 100644 --- a/include/configs/j721e_evm.h +++ b/include/configs/j721e_evm.h @@ -54,5 +54,4 @@ /* Now for the remaining common defines */ #include - #endif /* __CONFIG_J721E_EVM_H */ diff --git a/include/configs/kontron_pitx_imx8m.h b/include/configs/kontron_pitx_imx8m.h index 101c59141f..3dda7b6680 100644 --- a/include/configs/kontron_pitx_imx8m.h +++ b/include/configs/kontron_pitx_imx8m.h @@ -18,7 +18,6 @@ #define CFG_MALLOC_F_ADDR 0x182000 /* For RAW image gives a error info not panic */ - #define CFG_POWER_PFUZE100_I2C_ADDR 0x08 #endif @@ -56,7 +55,6 @@ ENV_MEM_LAYOUT_SETTINGS \ BOOTENV - #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE 0x80000 diff --git a/include/configs/ls1012aqds.h b/include/configs/ls1012aqds.h index 35e8ff0579..3c4f8b75b1 100644 --- a/include/configs/ls1012aqds.h +++ b/include/configs/ls1012aqds.h @@ -48,7 +48,6 @@ */ #define CFG_SYS_I2C_RTC_ADDR 0x51 /* Channel 3*/ - /* Voltage monitor on channel 2*/ #define I2C_VOL_MONITOR_ADDR 0x40 #define I2C_VOL_MONITOR_BUS_V_OFFSET 0x2 diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h index ac2319c1b4..e500a7d80f 100644 --- a/include/configs/ls1043a_common.h +++ b/include/configs/ls1043a_common.h @@ -159,7 +159,6 @@ " && esbc_validate ${kernelheader_addr_r};" \ "bootm $load_addr#$board\0" - #ifdef CONFIG_TFABOOT #define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \ "env exists secureboot && esbc_halt;" diff --git a/include/configs/ls1088a_common.h b/include/configs/ls1088a_common.h index 720a95d2f5..34085eeecc 100644 --- a/include/configs/ls1088a_common.h +++ b/include/configs/ls1088a_common.h @@ -42,7 +42,6 @@ /* I2C */ - /* Serial Port */ #define CFG_SYS_NS16550_CLK (get_bus_freq(0) / 2) @@ -84,11 +83,9 @@ unsigned long long get_qixis_addr(void); #define QIXIS_BASE_PHYS 0x20000000 #define QIXIS_BASE_PHYS_EARLY 0xC000000 - #define CFG_SYS_NAND_BASE 0x530000000ULL #define CFG_SYS_NAND_BASE_PHYS 0x30000000 - /* MC firmware */ /* TODO Actual DPL max length needs to be confirmed with the MC FW team */ #define CFG_SYS_LS_MC_DPC_MAX_LENGTH 0x20000 diff --git a/include/configs/ls1088aqds.h b/include/configs/ls1088aqds.h index 084ee064ae..36e8422c34 100644 --- a/include/configs/ls1088aqds.h +++ b/include/configs/ls1088aqds.h @@ -16,7 +16,6 @@ #define SPD_EEPROM_ADDRESS 0x51 - /* * IFC Definitions */ diff --git a/include/configs/ls1088ardb.h b/include/configs/ls1088ardb.h index a1749149e5..8be5febe57 100644 --- a/include/configs/ls1088ardb.h +++ b/include/configs/ls1088ardb.h @@ -17,7 +17,6 @@ #define SPD_EEPROM_ADDRESS 0x51 - #if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI) #define CFG_SYS_NOR0_CSPR_EXT (0x0) #define CFG_SYS_NOR_AMASK IFC_AMASK(128 * 1024 * 1024) diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h index 6f46ca78d4..4c1b4bf2b2 100644 --- a/include/configs/lx2160a_common.h +++ b/include/configs/lx2160a_common.h @@ -37,7 +37,6 @@ * will be udpated later when get_bus_freq(0) is available. */ - /* Serial Port */ #define CFG_PL011_CLOCK (get_bus_freq(0) / 4) #define CFG_SYS_SERIAL0 0x21c0000 diff --git a/include/configs/meson64.h b/include/configs/meson64.h index 65fa5f3d6d..ccb8ea2e71 100644 --- a/include/configs/meson64.h +++ b/include/configs/meson64.h @@ -144,5 +144,4 @@ BOOTENV #endif - #endif /* __MESON64_CONFIG_H */ diff --git a/include/configs/mt8183.h b/include/configs/mt8183.h index 1f973829bb..7c31e219af 100644 --- a/include/configs/mt8183.h +++ b/include/configs/mt8183.h @@ -11,7 +11,6 @@ #include - #define CFG_SYS_NS16550_COM1 0x11005200 #define CFG_SYS_NS16550_CLK 26000000 diff --git a/include/configs/mt8516.h b/include/configs/mt8516.h index 73776e3705..27c3718352 100644 --- a/include/configs/mt8516.h +++ b/include/configs/mt8516.h @@ -11,7 +11,6 @@ #include - #define CFG_SYS_NS16550_COM1 0x11005000 #define CFG_SYS_NS16550_CLK 26000000 diff --git a/include/configs/mx53cx9020.h b/include/configs/mx53cx9020.h index e995776d30..dccfdc3a15 100644 --- a/include/configs/mx53cx9020.h +++ b/include/configs/mx53cx9020.h @@ -21,7 +21,6 @@ /* bootz: zImage/initrd.img support */ - /* USB Configs */ #define CFG_MXC_USB_PORT 1 #define CFG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) diff --git a/include/configs/mx6ullevk.h b/include/configs/mx6ullevk.h index 2c3cd32cef..910140ab4b 100644 --- a/include/configs/mx6ullevk.h +++ b/include/configs/mx6ullevk.h @@ -7,7 +7,6 @@ #ifndef __MX6ULLEVK_CONFIG_H #define __MX6ULLEVK_CONFIG_H - #include #include #include diff --git a/include/configs/mx7ulp_evk.h b/include/configs/mx7ulp_evk.h index 5f4cd93062..d1c1202d06 100644 --- a/include/configs/mx7ulp_evk.h +++ b/include/configs/mx7ulp_evk.h @@ -11,7 +11,6 @@ #include #include - /* Using ULP WDOG for reset */ #define WDOG_BASE_ADDR WDG1_RBASE diff --git a/include/configs/phycore_imx8mm.h b/include/configs/phycore_imx8mm.h index ce6dc87c69..dd7cfdba52 100644 --- a/include/configs/phycore_imx8mm.h +++ b/include/configs/phycore_imx8mm.h @@ -63,7 +63,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE SZ_512K - #define CFG_SYS_SDRAM_BASE 0x40000000 #define PHYS_SDRAM 0x40000000 diff --git a/include/configs/phycore_imx8mp.h b/include/configs/phycore_imx8mp.h index 299fabc6a9..47c56b50b1 100644 --- a/include/configs/phycore_imx8mp.h +++ b/include/configs/phycore_imx8mp.h @@ -18,7 +18,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE SZ_512K - #define CFG_SYS_SDRAM_BASE 0x40000000 #define PHYS_SDRAM 0x40000000 diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h index 4caa823375..8a22f0134b 100644 --- a/include/configs/pico-imx6ul.h +++ b/include/configs/pico-imx6ul.h @@ -7,7 +7,6 @@ #ifndef __PICO_IMX6UL_CONFIG_H #define __PICO_IMX6UL_CONFIG_H - #include #include #include "mx6_common.h" diff --git a/include/configs/pico-imx8mq.h b/include/configs/pico-imx8mq.h index be31f8a23c..422b89a3dd 100644 --- a/include/configs/pico-imx8mq.h +++ b/include/configs/pico-imx8mq.h @@ -65,7 +65,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0x40000000 #define CFG_SYS_INIT_RAM_SIZE 0x80000 - #define CFG_SYS_SDRAM_BASE 0x40000000 #define PHYS_SDRAM 0x40000000 #define PHYS_SDRAM_SIZE 0x80000000 /* 2 GiB DDR */ diff --git a/include/configs/sei510.h b/include/configs/sei510.h index ea91a06157..0f8070b8d3 100644 --- a/include/configs/sei510.h +++ b/include/configs/sei510.h @@ -25,7 +25,6 @@ "name=userdata,size=4820M,uuid=${uuid_gpt_userdata};" \ "name=rootfs,size=-,uuid=" ROOT_UUID - #include #endif /* __CONFIG_H */ diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h index 6b1d5caafb..74b7fe8580 100644 --- a/include/configs/siemens-am33x-common.h +++ b/include/configs/siemens-am33x-common.h @@ -40,7 +40,6 @@ #define CFG_SYS_NS16550_COM1 0x44e09000 #define CFG_SYS_NS16550_COM4 0x481a6000 - /* I2C Configuration */ /* Defines for SPL */ diff --git a/include/configs/socrates.h b/include/configs/socrates.h index 64cc17ca7c..006d649f6e 100644 --- a/include/configs/socrates.h +++ b/include/configs/socrates.h @@ -48,7 +48,6 @@ /* I2C addresses of SPD EEPROMs */ #define SPD_EEPROM_ADDRESS 0x50 /* CTLR 0 DIMM 0 */ - /* Hardcoded values, to use instead of SPD */ #define CFG_SYS_DDR_CS0_BNDS 0x0000000f #define CFG_SYS_DDR_CS0_CONFIG 0x80010102 diff --git a/include/configs/stm32mp15_dh_dhsom.h b/include/configs/stm32mp15_dh_dhsom.h index c1fca8359d..6fe6e7b9b8 100644 --- a/include/configs/stm32mp15_dh_dhsom.h +++ b/include/configs/stm32mp15_dh_dhsom.h @@ -53,7 +53,6 @@ "update_sf=run dh_update_sd_to_sf\0" \ "usb_pgood_delay=1000\0" - #include #endif diff --git a/include/configs/stmark2.h b/include/configs/stmark2.h index af5da096b7..c8a39e191a 100644 --- a/include/configs/stmark2.h +++ b/include/configs/stmark2.h @@ -95,7 +95,6 @@ #define CACR_STATUS (CFG_SYS_INIT_RAM_ADDR + \ CFG_SYS_INIT_RAM_SIZE - 12) - #define CFG_SYS_I2C_0 #endif /* __STMARK2_CONFIG_H */ diff --git a/include/configs/ten64.h b/include/configs/ten64.h index d2bef9b6e5..d5bb2e96c5 100644 --- a/include/configs/ten64.h +++ b/include/configs/ten64.h @@ -9,7 +9,6 @@ #include "ls1088a_common.h" - #define CFG_SYS_LS_MC_BOOT_TIMEOUT_MS 5000 #define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd" diff --git a/include/configs/topic_miami.h b/include/configs/topic_miami.h index 3795e6152f..0627617545 100644 --- a/include/configs/topic_miami.h +++ b/include/configs/topic_miami.h @@ -9,7 +9,6 @@ #ifndef __CONFIG_TOPIC_MIAMI_H #define __CONFIG_TOPIC_MIAMI_H - /* Speed up boot time by ignoring the environment which we never used */ #include "zynq-common.h" diff --git a/include/configs/warp7.h b/include/configs/warp7.h index 5d2956a596..0da9250c3b 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -92,7 +92,6 @@ #define CFG_SYS_FSL_USDHC_NUM 1 - #define CFG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) /* USB Device Firmware Update support */ diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h index 8bd0716c08..d93a45d5aa 100644 --- a/include/configs/x86-common.h +++ b/include/configs/x86-common.h @@ -36,5 +36,4 @@ "ramdisk_addr_r=0x4000000\0" \ "ramdiskfile=initramfs.gz\0" - #endif /* __CONFIG_H */ diff --git a/include/configs/xtfpga.h b/include/configs/xtfpga.h index 9655b666ed..468c5b85ab 100644 --- a/include/configs/xtfpga.h +++ b/include/configs/xtfpga.h @@ -71,7 +71,6 @@ /* U-Boot autoboot configuration */ /*==============================*/ - /*=========================================*/ /* FPGA Registers (board info and control) */ /*=========================================*/ diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index 553bb1b45b..03af859c95 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -185,7 +185,6 @@ #define CFG_SYS_INIT_RAM_ADDR 0xFFFF0000 #define CFG_SYS_INIT_RAM_SIZE 0x2000 - /* Extend size of kernel image for uncompression */ /* Address in RAM where the parameters must be copied by SPL. */ From d36394cff8cee764aea75860ceac4655f7f3e944 Mon Sep 17 00:00:00 2001 From: Wadim Egorov Date: Thu, 20 Jun 2024 14:05:54 +0200 Subject: [PATCH 02/10] doc: board: phytec: phycore-am6: Describe UART based boot Describe how to boot via UART. Signed-off-by: Wadim Egorov --- doc/board/phytec/phycore-am62x.rst | 17 +++++++++++++++++ doc/board/phytec/phycore-am64x.rst | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/doc/board/phytec/phycore-am62x.rst b/doc/board/phytec/phycore-am62x.rst index ce7ec5545a..a7ce2c5882 100644 --- a/doc/board/phytec/phycore-am62x.rst +++ b/doc/board/phytec/phycore-am62x.rst @@ -118,6 +118,23 @@ tiboot3.bin, tispl.bin and u-boot.img are stored on the uSD card. fatload mmc 1 ${loadaddr} u-boot.img mtd write ospi.u-boot ${loadaddr} 0 ${filesize} +UART based boot +--------------- + +To boot the board via UART, set the switches to UART mode and connect to the +micro USB port labeled as "Debug UART". After power-on the build artifacts +needs to be uploaded one by one with a tool like sz. + +Example bash script sequence for running on a Linux host PC feeding all boot +artifacts needed to the device. Assuming the host uses /dev/ttyUSB0 as +the main domain serial port: + +.. prompt:: bash $ + + stty -F /dev/ttyUSB0 115200 + sb --xmodem tiboot3.bin > /dev/ttyUSB0 < /dev/ttyUSB0 + sb --ymodem tispl.bin > /dev/ttyUSB0 < /dev/ttyUSB0 + sb --ymodem u-boot.img > /dev/ttyUSB0 < /dev/ttyUSB0 Boot Modes ---------- diff --git a/doc/board/phytec/phycore-am64x.rst b/doc/board/phytec/phycore-am64x.rst index 2b9cd32c50..68d78ad7c2 100644 --- a/doc/board/phytec/phycore-am64x.rst +++ b/doc/board/phytec/phycore-am64x.rst @@ -119,6 +119,25 @@ tiboot3.bin, tispl.bin and u-boot.img are stored on the uSD card. fatload mmc 1 ${loadaddr} u-boot.img mtd write ospi.u-boot ${loadaddr} 0 ${filesize} +UART based boot +--------------- + +To boot the board via UART, set the switches to UART mode and connect to the +micro USB port labeled as "Debug UART". After power-on the build artifacts +needs to be uploaded one by one with a tool like sz. + +Example bash script sequence for running on a Linux host PC feeding all boot +artifacts needed to the device. Assuming the host uses /dev/ttyUSB0 as +the main domain serial port: + +.. prompt:: bash $ + + stty -F /dev/ttyUSB0 115200 + sb --xmodem tiboot3.bin > /dev/ttyUSB0 < /dev/ttyUSB0 + # Resend tiboot3.bin a 2nd time due to ErrataID:i2331 + sb --xmodem tiboot3.bin > /dev/ttyUSB0 < /dev/ttyUSB0 + sb --ymodem tispl.bin > /dev/ttyUSB0 < /dev/ttyUSB0 + sb --ymodem u-boot.img > /dev/ttyUSB0 < /dev/ttyUSB0 Boot Modes ---------- From 6074f6e85783f582e8524778fff170ff05b35a91 Mon Sep 17 00:00:00 2001 From: Alexander Dahl Date: Thu, 20 Jun 2024 16:20:59 +0200 Subject: [PATCH 03/10] mkimage: Allow 'auto-conf' signing of scripts U-Boot configured for verified boot with the "required" option set to "conf" also checks scripts put in FIT images for a valid signature, and refuses to source and run such a script if the signature for the configuration is bad or missing. Such a script could not be packaged before, because mkimage failed like this: % tools/mkimage -T script -C none -d tmp/my.scr -f auto-conf -k tmp -g dev -o sha256,rsa4096 my.uimg Failed to find any images for configuration 'conf-1/signature' tools/mkimage Can't add hashes to FIT blob: -1 Error: Bad parameters for FIT image type This is especially unfortunate if LEGACY_IMAGE_FORMAT is disabled as recommended. Listing the script configuration in a "sign-images" subnode instead, would have added even more complexity to the already complex auto fit generation code. Signed-off-by: Alexander Dahl --- tools/image-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/image-host.c b/tools/image-host.c index 7bfc0cb6b1..49ce7436bb 100644 --- a/tools/image-host.c +++ b/tools/image-host.c @@ -730,7 +730,7 @@ static const char *fit_config_get_image_list(const void *fit, int noffset, int *lenp, int *allow_missingp) { static const char default_list[] = FIT_KERNEL_PROP "\0" - FIT_FDT_PROP; + FIT_FDT_PROP "\0" FIT_SCRIPT_PROP; const char *prop; /* If there is an "sign-image" property, use that */ From 2abf14df5dd3944ab22352b397c63516bcf312c3 Mon Sep 17 00:00:00 2001 From: Maxim Moskalets Date: Fri, 21 Jun 2024 14:42:10 +0300 Subject: [PATCH 04/10] cmd: bootm: add ELF file support Some operating systems (e.g. seL4) and embedded applications are ELF images. It is convenient to use FIT-images to implement trusted boot. Added "elf" image type for booting using bootm command. Signed-off-by: Maxim Moskalets --- boot/bootm_os.c | 18 ++++++++++++++++++ boot/image-fit.c | 3 ++- boot/image.c | 5 ++++- cmd/Kconfig | 7 +++++++ include/image.h | 1 + 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/boot/bootm_os.c b/boot/bootm_os.c index 15297ddb53..6a6621706f 100644 --- a/boot/bootm_os.c +++ b/boot/bootm_os.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -394,6 +395,20 @@ static int do_bootm_qnxelf(int flag, struct bootm_info *bmi) } #endif +#if defined(CONFIG_BOOTM_ELF) +static int do_bootm_elf(int flag, struct bootm_info *bmi) +{ + Bootelf_flags flags = { .autostart = 1 }; + + if (flag != BOOTM_STATE_OS_GO) + return 0; + + bootelf(bmi->images->ep, flags, 0, NULL); + + return 1; +} +#endif + #ifdef CONFIG_INTEGRITY static int do_bootm_integrity(int flag, struct bootm_info *bmi) { @@ -535,6 +550,9 @@ static boot_os_fn *boot_os[] = { #ifdef CONFIG_BOOTM_EFI [IH_OS_EFI] = do_bootm_efi, #endif +#if defined(CONFIG_BOOTM_ELF) + [IH_OS_ELF] = do_bootm_elf, +#endif }; /* Allow for arch specific config before we boot */ diff --git a/boot/image-fit.c b/boot/image-fit.c index f6464bcf62..9253f81fff 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -2175,7 +2175,8 @@ int fit_image_load(struct bootm_headers *images, ulong addr, fit_image_check_os(fit, noffset, IH_OS_TEE) || fit_image_check_os(fit, noffset, IH_OS_OPENRTOS) || fit_image_check_os(fit, noffset, IH_OS_EFI) || - fit_image_check_os(fit, noffset, IH_OS_VXWORKS); + fit_image_check_os(fit, noffset, IH_OS_VXWORKS) || + fit_image_check_os(fit, noffset, IH_OS_ELF); /* * If either of the checks fail, we should report an error, but diff --git a/boot/image.c b/boot/image.c index fc774d605d..abac254e02 100644 --- a/boot/image.c +++ b/boot/image.c @@ -130,7 +130,10 @@ static const table_entry_t uimage_os[] = { { IH_OS_OPENRTOS, "openrtos", "OpenRTOS", }, #endif { IH_OS_OPENSBI, "opensbi", "RISC-V OpenSBI", }, - { IH_OS_EFI, "efi", "EFI Firmware" }, + { IH_OS_EFI, "efi", "EFI Firmware" }, +#ifdef CONFIG_BOOTM_ELF + { IH_OS_ELF, "elf", "ELF Image" }, +#endif { -1, "", "", }, }; diff --git a/cmd/Kconfig b/cmd/Kconfig index 40ac5a8dba..68947bfc82 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -321,6 +321,13 @@ config BOOTM_EFI help Support booting UEFI FIT images via the bootm command. +config BOOTM_ELF + bool "Support booting ELF images" + depends on CMD_BOOTM && LIB_ELF + default n + help + Support booting ELF images via the bootm command. + config CMD_BOOTZ bool "bootz" help diff --git a/include/image.h b/include/image.h index c5b288f62b..9daaee15cd 100644 --- a/include/image.h +++ b/include/image.h @@ -100,6 +100,7 @@ enum { IH_OS_TEE, /* Trusted Execution Environment */ IH_OS_OPENSBI, /* RISC-V OpenSBI */ IH_OS_EFI, /* EFI Firmware (e.g. GRUB2) */ + IH_OS_ELF, /* ELF Image (e.g. seL4) */ IH_OS_COUNT, }; From 17c39e700c634516887079ad961df99fe63b080d Mon Sep 17 00:00:00 2001 From: Roger Quadros Date: Sun, 23 Jun 2024 10:41:19 +0300 Subject: [PATCH 05/10] configs: am64x_evm_a53_defconfig: Enable I2C GPIO drivers The board has the TCA9554 I2C GPIO expander chip for expansion board presence detection logic. Enable the relevant I2C GPIO drivers. Signed-off-by: Roger Quadros --- configs/am64x_evm_a53_defconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig index 94c7ce9b8e..5b01002dfc 100644 --- a/configs/am64x_evm_a53_defconfig +++ b/configs/am64x_evm_a53_defconfig @@ -103,7 +103,11 @@ CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000 CONFIG_DMA_CHANNELS=y CONFIG_TI_K3_NAVSS_UDMA=y CONFIG_TI_SCI_PROTOCOL=y +CONFIG_DM_PCA953X=y +CONFIG_SPL_DM_PCA953X=y CONFIG_DM_I2C=y +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y +CONFIG_DM_I2C_GPIO=y CONFIG_SYS_I2C_OMAP24XX=y CONFIG_DM_MAILBOX=y CONFIG_K3_SEC_PROXY=y From 608a88c2709cc46c3de0f0ecd9206866b58c256f Mon Sep 17 00:00:00 2001 From: Anand Moon Date: Sun, 23 Jun 2024 23:10:21 +0530 Subject: [PATCH 06/10] Fix Kconfig coding style from spaces to tab Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: Anand Moon --- boot/Kconfig | 8 ++++---- cmd/Kconfig | 20 ++++++++++---------- disk/Kconfig | 2 +- lib/Kconfig | 2 +- net/Kconfig | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/boot/Kconfig b/boot/Kconfig index 11175fb7bb..ffcae840a5 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -150,10 +150,10 @@ config FIT_IMAGE_POST_PROCESS processed before being added to the FIT image). config FIT_PRINT - bool "Support FIT printing" - default y - help - Support printing the content of the fitImage in a verbose manner. + bool "Support FIT printing" + default y + help + Support printing the content of the fitImage in a verbose manner. config SPL_FIT bool "Support Flattened Image Tree within SPL" diff --git a/cmd/Kconfig b/cmd/Kconfig index 68947bfc82..0cf0d8ad8a 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -271,7 +271,7 @@ config CMD_BOOTM_PRE_LOAD depends on CMD_BOOTM depends on IMAGE_PRE_LOAD help - Enable support of stage pre-load for the bootm command. + Enable support of stage pre-load for the bootm command. This stage allow to check or modify the image provided to the bootm command. @@ -912,9 +912,9 @@ config CMD_MX_CYCLIC bool "Enable cyclic md/mw commands" depends on CMD_MEMORY help - Add the "mdc" and "mwc" memory commands. These are cyclic - "md/mw" commands. - Examples: + Add the "mdc" and "mwc" memory commands. These are cyclic + "md/mw" commands. + Examples: => mdc.b 10 4 500 This command will print 4 bytes (10,11,12,13) each 500 ms. @@ -2168,12 +2168,12 @@ config CMD_BLKMAP Example use-cases: - Treat a region of RAM as a block device, i.e. a RAM disk. This let's - you extract files from filesystem images stored in RAM (perhaps as a - result of a TFTP transfer). + you extract files from filesystem images stored in RAM (perhaps as a + result of a TFTP transfer). - Create a virtual partition on an existing device. This let's you - access filesystems that aren't stored at an exact partition - boundary. A common example is a filesystem image embedded in an FIT - image. + access filesystems that aren't stored at an exact partition + boundary. A common example is a filesystem image embedded in an FIT + image. config CMD_BUTTON bool "button" @@ -2952,7 +2952,7 @@ config CMD_UBI_RENAME bool "Enable rename" depends on CMD_UBI help - Enable a "ubi" command to rename ubi volume: + Enable a "ubi" command to rename ubi volume: ubi rename config CMD_UBIFS diff --git a/disk/Kconfig b/disk/Kconfig index 8549695807..ffa835eb35 100644 --- a/disk/Kconfig +++ b/disk/Kconfig @@ -116,7 +116,7 @@ config EFI_PARTITION_ENTRIES_NUMBERS number. config EFI_PARTITION_ENTRIES_OFF - int "Offset (in bytes) of the EFI partition entries" + int "Offset (in bytes) of the EFI partition entries" depends on EFI_PARTITION default 0 help diff --git a/lib/Kconfig b/lib/Kconfig index b3baa4b85b..2059219a12 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -1143,7 +1143,7 @@ config PHANDLE_CHECK_SEQ bool "Enable phandle check while getting sequence number" help When there are multiple device tree nodes with same name, - enable this config option to distinguish them using + enable this config option to distinguish them using phandles in fdtdec_get_alias_seq() function. endmenu diff --git a/net/Kconfig b/net/Kconfig index 5dff633629..7cb80b880a 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -42,8 +42,8 @@ config BOOTP_SEND_HOSTNAME DNS server. To do this, they need the hostname of the DHCP requester. If CONFIG_BOOTP_SEND_HOSTNAME is defined, the content - of the "hostname" environment variable is passed as - option 12 to the DHCP server. + of the "hostname" environment variable is passed as + option 12 to the DHCP server. config NET_RANDOM_ETHADDR bool "Random ethaddr if unset" From aaebe0d41c1fdd9ed5c2fc5420f88bb0eb06024f Mon Sep 17 00:00:00 2001 From: Marjolaine Amate Date: Mon, 24 Jun 2024 19:15:32 +0000 Subject: [PATCH 07/10] e1000: add support for i226 This patch adds support for Intel Foxville I226 devices LM,V,I,K in e1000 driver. Signed-off-by: Marjolaine Amate --- drivers/net/e1000.c | 18 ++++++++++++++++++ drivers/net/e1000.h | 2 ++ include/pci_ids.h | 7 +++++++ 3 files changed, 27 insertions(+) diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index 663d900eb0..fcb205322c 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -107,6 +107,12 @@ static struct pci_device_id e1000_supported[] = { { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80003ES2LAN_SERDES_DPT) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80003ES2LAN_COPPER_SPT) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80003ES2LAN_SERDES_SPT) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I226_K) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I226_LMVP) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I226_LM) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I226_V) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I226_IT) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I226_UNPROGRAMMED) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I210_UNPROGRAMMED) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I211_UNPROGRAMMED) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I210_COPPER) }, @@ -1568,6 +1574,12 @@ e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_ICH8_IGP_M: hw->mac_type = e1000_ich8lan; break; + case PCI_DEVICE_ID_INTEL_I226_K: + case PCI_DEVICE_ID_INTEL_I226_LMVP: + case PCI_DEVICE_ID_INTEL_I226_LM: + case PCI_DEVICE_ID_INTEL_I226_V: + case PCI_DEVICE_ID_INTEL_I226_IT: + case PCI_DEVICE_ID_INTEL_I226_UNPROGRAMMED: case PCI_DEVICE_ID_INTEL_I210_UNPROGRAMMED: case PCI_DEVICE_ID_INTEL_I211_UNPROGRAMMED: case PCI_DEVICE_ID_INTEL_I210_COPPER: @@ -4842,6 +4854,8 @@ static int e1000_set_phy_type (struct e1000_hw *hw) hw->phy_type = e1000_phy_igb; break; case I225_I_PHY_ID: + case I226_LM_PHY_ID: + case I226_I_PHY_ID: hw->phy_type = e1000_phy_igc; break; /* Fall Through */ @@ -4953,6 +4967,10 @@ e1000_detect_gig_phy(struct e1000_hw *hw) match = true; if (hw->phy_id == I225_I_PHY_ID) match = true; + if (hw->phy_id == I226_LM_PHY_ID) + match = true; + if (hw->phy_id == I226_I_PHY_ID) + match = true; break; default: DEBUGOUT("Invalid MAC type %d\n", hw->mac_type); diff --git a/drivers/net/e1000.h b/drivers/net/e1000.h index e1311126a3..aa649328f5 100644 --- a/drivers/net/e1000.h +++ b/drivers/net/e1000.h @@ -2421,7 +2421,9 @@ struct e1000_hw { #define BME1000_E_PHY_ID 0x01410CB0 #define I210_I_PHY_ID 0x01410C00 +#define I226_LM_PHY_ID 0x67C9DC10 #define I225_I_PHY_ID 0x67C9DCC0 +#define I226_I_PHY_ID 0x67C9DCD0 /* Miscellaneous PHY bit definitions. */ #define PHY_PREAMBLE 0xFFFFFFFF diff --git a/include/pci_ids.h b/include/pci_ids.h index f1886c3a75..834ec926b5 100644 --- a/include/pci_ids.h +++ b/include/pci_ids.h @@ -2701,6 +2701,11 @@ #define PCI_DEVICE_ID_INTEL_82441 0x1237 #define PCI_DEVICE_ID_INTEL_82380FB 0x124b #define PCI_DEVICE_ID_INTEL_82439 0x1250 +#define PCI_DEVICE_ID_INTEL_I226_LM 0x125b +#define PCI_DEVICE_ID_INTEL_I226_V 0x125c +#define PCI_DEVICE_ID_INTEL_I226_IT 0x125d +#define PCI_DEVICE_ID_INTEL_I221_V 0x125e +#define PCI_DEVICE_ID_INTEL_I226_UNPROGRAMMED 0x125f #define PCI_DEVICE_ID_INTEL_I210_UNPROGRAMMED 0x1531 #define PCI_DEVICE_ID_INTEL_I211_UNPROGRAMMED 0x1532 #define PCI_DEVICE_ID_INTEL_I210_COPPER 0x1533 @@ -2930,6 +2935,7 @@ #define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_ADDR_REV2 0x2db1 #define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_RANK_REV2 0x2db2 #define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_TC_REV2 0x2db3 +#define PCI_DEVICE_ID_INTEL_I226_K 0x3102 #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 #define PCI_DEVICE_ID_INTEL_IOAT_TBG4 0x3429 #define PCI_DEVICE_ID_INTEL_IOAT_TBG5 0x342a @@ -3001,6 +3007,7 @@ #define PCI_DEVICE_ID_INTEL_UNC_R3QPI1 0x3c45 #define PCI_DEVICE_ID_INTEL_JAKETOWN_UBOX 0x3ce0 #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f +#define PCI_DEVICE_ID_INTEL_I226_LMVP 0x5503 #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 #define PCI_DEVICE_ID_INTEL_5100_19 0x65f3 #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 From 905dc347dade9cc956f064cc885f38f83e68376a Mon Sep 17 00:00:00 2001 From: Marjolaine Amate Date: Mon, 24 Jun 2024 19:49:07 +0000 Subject: [PATCH 08/10] pci_ids: fix i225 unprogrammed value This patch fixes the I225 hardware default value at 0x15FD meaning empty flash image or the NVM configuration loading failed Signed-off-by: Marjolaine Amate --- include/pci_ids.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pci_ids.h b/include/pci_ids.h index 834ec926b5..6f095442ca 100644 --- a/include/pci_ids.h +++ b/include/pci_ids.h @@ -2715,7 +2715,7 @@ #define PCI_DEVICE_ID_INTEL_I211_COPPER 0x1539 #define PCI_DEVICE_ID_INTEL_I210_COPPER_FLASHLESS 0x157b #define PCI_DEVICE_ID_INTEL_I210_SERDES_FLASHLESS 0x157c -#define PCI_DEVICE_ID_INTEL_I225_UNPROGRAMMED 0x15dF +#define PCI_DEVICE_ID_INTEL_I225_UNPROGRAMMED 0x15fd #define PCI_DEVICE_ID_INTEL_I225_IT 0x0d9f #define PCI_DEVICE_ID_INTEL_80960_RP 0x1960 #define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 From 7a74e31938ad7534452efcf9ce6c82fc75402f59 Mon Sep 17 00:00:00 2001 From: Christophe Leroy Date: Thu, 27 Jun 2024 10:26:08 +0200 Subject: [PATCH 09/10] watchdog: mpc8xxx: Fix timer value Timer value is a 16 bits calculated from the wanted timeout and the system clock. On powerpc/8xx, a timeout of 2s gives a value which is over U16_MAX so U16_MAX shall be used. But the calculation is casted to u16 so at the end the result is 63770 instead of 128906. So the timer gets loaded with 63770 instead of 65535. It is not a big difference in that case, but lets make the code correct and cast to u32 instead of u16. Fixes: 26e8ebcd7cb7 ("watchdog: mpc8xxx: Make it generic") Signed-off-by: Christophe Leroy --- drivers/watchdog/mpc8xxx_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c index 036ff690d3..7fcb866f57 100644 --- a/drivers/watchdog/mpc8xxx_wdt.c +++ b/drivers/watchdog/mpc8xxx_wdt.c @@ -43,7 +43,7 @@ static int mpc8xxx_wdt_start(struct udevice *dev, u64 timeout, ulong flags) struct mpc8xxx_wdt_priv *priv = dev_get_priv(dev); const char *mode = env_get("watchdog_mode"); ulong prescaler = dev_get_driver_data(dev); - u16 swtc = min_t(u16, timeout * get_board_sys_clk() / 1000 / prescaler, U16_MAX); + u16 swtc = min_t(u32, timeout * get_board_sys_clk() / 1000 / prescaler, U16_MAX); u32 val; mpc8xxx_wdt_reset(dev); From 7d22317a18e3ace2311c741bea74efa72299e57a Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Fri, 5 Jul 2024 09:44:54 -0600 Subject: [PATCH 10/10] Revert "Revert "Merge patch series "zlib: Address CVE-2016-9841""" Now that the release has happened, bring back the update to zlib. This reverts commit bbacdd3ef7762fbdeab43ceea5205d1fd0f25bbd. Signed-off-by: Tom Rini --- include/u-boot/zlib.h | 16 ++-- lib/gzip.c | 2 +- lib/zlib/deflate.c | 13 +--- lib/zlib/inffast.c | 176 ++++++++++++++++-------------------------- lib/zlib/inflate.c | 31 ++++---- lib/zlib/inflate.h | 2 +- lib/zlib/zutil.c | 1 - 7 files changed, 90 insertions(+), 151 deletions(-) diff --git a/include/u-boot/zlib.h b/include/u-boot/zlib.h index a33cc8780d..ee19f46095 100644 --- a/include/u-boot/zlib.h +++ b/include/u-boot/zlib.h @@ -49,9 +49,6 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.3" -#define ZLIB_VERNUM 0x1230 - /* #include "zconf.h" */ /* included directly here */ /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-2005 Jean-loup Gailly. @@ -484,7 +481,6 @@ typedef gz_header FAR *gz_headerp; #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) /* Return codes for the compression/decompression functions. Negative * values are errors, positive values are used for special but normal events. */ @@ -523,11 +519,11 @@ typedef gz_header FAR *gz_headerp; ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); + int stream_size)); ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, int windowBits, int memLevel, - int strategy, const char *version, + int strategy, int stream_size)); ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, @@ -553,7 +549,7 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); + int stream_size)); ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); /* inflate decompresses as much data as possible, and stops when the input @@ -743,11 +739,11 @@ ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, */ ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); + int stream_size)); #define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) + inflateInit_((strm), sizeof(z_stream)) #define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + inflateInit2_((strm), (windowBits), sizeof(z_stream)) #if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) struct internal_state {int dummy;}; /* hack for buggy compilers */ diff --git a/lib/gzip.c b/lib/gzip.c index 5d9c19598d..a9a3df524d 100644 --- a/lib/gzip.c +++ b/lib/gzip.c @@ -67,7 +67,7 @@ int zzip(void *dst, unsigned long *lenp, unsigned char *src, r = deflateInit2_(&s, Z_BEST_SPEED, Z_DEFLATED, window, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, - ZLIB_VERSION, sizeof(z_stream)); + sizeof(z_stream)); if (r != Z_OK) { printf ("Error: deflateInit2_() returned %d\n", r); return -1; diff --git a/lib/zlib/deflate.c b/lib/zlib/deflate.c index 4549f4dc12..7e1ed4f9b2 100644 --- a/lib/zlib/deflate.c +++ b/lib/zlib/deflate.c @@ -196,37 +196,30 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); /* ========================================================================= */ -int ZEXPORT deflateInit_(strm, level, version, stream_size) +int ZEXPORT deflateInit_(strm, level, stream_size) z_streamp strm; int level; - const char *version; int stream_size; { return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, - Z_DEFAULT_STRATEGY, version, stream_size); + Z_DEFAULT_STRATEGY, stream_size); /* To do: ignore strm->next_in if we use it as window */ } /* ========================================================================= */ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, - version, stream_size) + stream_size) z_streamp strm; int level; int method; int windowBits; int memLevel; int strategy; - const char *version; int stream_size; { deflate_state *s; int wrap = 1; - static const char my_version[] = ZLIB_VERSION; - if (version == Z_NULL || version[0] != my_version[0] || - stream_size != sizeof(z_stream)) { - return Z_VERSION_ERROR; - } if (strm == Z_NULL) return Z_STREAM_ERROR; strm->msg = Z_NULL; diff --git a/lib/zlib/inffast.c b/lib/zlib/inffast.c index e3c7f3b892..5e2a65ad4d 100644 --- a/lib/zlib/inffast.c +++ b/lib/zlib/inffast.c @@ -1,5 +1,5 @@ /* inffast.c -- fast decoding - * Copyright (C) 1995-2004 Mark Adler + * Copyright (C) 1995-2008, 2010, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -12,25 +12,6 @@ #ifndef ASMINF -/* Allow machine dependent optimization for post-increment or pre-increment. - Based on testing to date, - Pre-increment preferred for: - - PowerPC G3 (Adler) - - MIPS R5000 (Randers-Pehrson) - Post-increment preferred for: - - none - No measurable difference: - - Pentium III (Anderson) - - M68060 (Nikl) - */ -#ifdef POSTINC -# define OFF 0 -# define PUP(a) *(a)++ -#else -# define OFF 1 -# define PUP(a) *++(a) -#endif - /* Decode literal, length, and distance codes and write out the resulting literal and match bytes until either not enough input or output is @@ -66,12 +47,13 @@ requires strm->avail_out >= 258 for each loop to avoid checking for output space. */ -void inflate_fast(z_streamp strm, unsigned start) -/* start: inflate()'s starting value for strm->avail_out */ +void ZLIB_INTERNAL inflate_fast(strm, start) +z_streamp strm; +unsigned start; /* inflate()'s starting value for strm->avail_out */ { struct inflate_state FAR *state; - unsigned char FAR *in; /* local strm->next_in */ - unsigned char FAR *last; /* while in < last, enough input available */ + z_const unsigned char FAR *in; /* local strm->next_in */ + z_const unsigned char FAR *last; /* have enough input while in < last */ unsigned char FAR *out; /* local strm->next_out */ unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ unsigned char FAR *end; /* while out < end, enough space available */ @@ -80,7 +62,7 @@ void inflate_fast(z_streamp strm, unsigned start) #endif unsigned wsize; /* window size or zero if not using window */ unsigned whave; /* valid bytes in the window */ - unsigned write; /* window write index */ + unsigned wnext; /* window write index */ unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ unsigned long hold; /* local strm->hold */ unsigned bits; /* local strm->bits */ @@ -88,7 +70,7 @@ void inflate_fast(z_streamp strm, unsigned start) code const FAR *dcode; /* local strm->distcode */ unsigned lmask; /* mask for first level of length codes */ unsigned dmask; /* mask for first level of distance codes */ - code this; /* retrieved table entry */ + code here; /* retrieved table entry */ unsigned op; /* code bits, operation, extra bits, or */ /* window position, window bytes to copy */ unsigned len; /* match length, unused bytes */ @@ -97,7 +79,7 @@ void inflate_fast(z_streamp strm, unsigned start) /* copy state to local variables */ state = (struct inflate_state FAR *)strm->state; - in = strm->next_in - OFF; + in = strm->next_in; last = in + (strm->avail_in - 5); if (in > last && strm->avail_in > 5) { /* @@ -107,7 +89,7 @@ void inflate_fast(z_streamp strm, unsigned start) strm->avail_in = 0xffffffff - (uintptr_t)in; last = in + (strm->avail_in - 5); } - out = strm->next_out - OFF; + out = strm->next_out; beg = out - (start - strm->avail_out); end = out + (strm->avail_out - 257); #ifdef INFLATE_STRICT @@ -115,7 +97,7 @@ void inflate_fast(z_streamp strm, unsigned start) #endif wsize = state->wsize; whave = state->whave; - write = state->write; + wnext = state->wnext; window = state->window; hold = state->hold; bits = state->bits; @@ -128,29 +110,29 @@ void inflate_fast(z_streamp strm, unsigned start) input data or output space */ do { if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; } - this = lcode[hold & lmask]; + here = lcode[hold & lmask]; dolen: - op = (unsigned)(this.bits); + op = (unsigned)(here.bits); hold >>= op; bits -= op; - op = (unsigned)(this.op); + op = (unsigned)(here.op); if (op == 0) { /* literal */ - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? + Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - PUP(out) = (unsigned char)(this.val); + "inflate: literal 0x%02x\n", here.val)); + *out++ = (unsigned char)(here.val); } else if (op & 16) { /* length base */ - len = (unsigned)(this.val); + len = (unsigned)(here.val); op &= 15; /* number of extra bits */ if (op) { if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; } len += (unsigned)hold & ((1U << op) - 1); @@ -159,25 +141,25 @@ void inflate_fast(z_streamp strm, unsigned start) } Tracevv((stderr, "inflate: length %u\n", len)); if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; } - this = dcode[hold & dmask]; + here = dcode[hold & dmask]; dodist: - op = (unsigned)(this.bits); + op = (unsigned)(here.bits); hold >>= op; bits -= op; - op = (unsigned)(this.op); + op = (unsigned)(here.op); if (op & 16) { /* distance base */ - dist = (unsigned)(this.val); + dist = (unsigned)(here.val); op &= 15; /* number of extra bits */ if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; } } @@ -196,108 +178,80 @@ void inflate_fast(z_streamp strm, unsigned start) if (dist > op) { /* see if copy from window */ op = dist - op; /* distance back in window */ if (op > whave) { - strm->msg = (char *)"invalid distance too far back"; + strm->msg = + (char *)"invalid distance too far back"; state->mode = BAD; break; } - from = window - OFF; - if (write == 0) { /* very common case */ + from = window; + if (wnext == 0) { /* very common case */ from += wsize - op; if (op < len) { /* some from window */ len -= op; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--op); from = out - dist; /* rest from output */ } } - else if (write < op) { /* wrap around window */ - from += wsize + write - op; - op -= write; + else if (wnext < op) { /* wrap around window */ + from += wsize + wnext - op; + op -= wnext; if (op < len) { /* some from end of window */ len -= op; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--op); - from = window - OFF; - if (write < len) { /* some from start of window */ - op = write; + from = window; + if (wnext < len) { /* some from start of window */ + op = wnext; len -= op; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--op); from = out - dist; /* rest from output */ } } } else { /* contiguous in window */ - from += write - op; + from += wnext - op; if (op < len) { /* some from window */ len -= op; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--op); from = out - dist; /* rest from output */ } } while (len > 2) { - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); + *out++ = *from++; + *out++ = *from++; + *out++ = *from++; len -= 3; } if (len) { - PUP(out) = PUP(from); + *out++ = *from++; if (len > 1) - PUP(out) = PUP(from); + *out++ = *from++; } } else { - unsigned short *sout; - unsigned long loops; - from = out - dist; /* copy direct from output */ - /* minimum length is three */ - /* Align out addr */ - if (!((long)(out - 1 + OFF) & 1)) { - PUP(out) = PUP(from); - len--; - } - sout = (unsigned short *)(out - OFF); - if (dist > 2 ) { - unsigned short *sfrom; - - sfrom = (unsigned short *)(from - OFF); - loops = len >> 1; - do - PUP(sout) = get_unaligned(++sfrom); - while (--loops); - out = (unsigned char *)sout + OFF; - from = (unsigned char *)sfrom + OFF; - } else { /* dist == 1 or dist == 2 */ - unsigned short pat16; - - pat16 = *(sout-2+2*OFF); - if (dist == 1) -#if defined(__BIG_ENDIAN) - pat16 = (pat16 & 0xff) | ((pat16 & 0xff ) << 8); -#elif defined(__LITTLE_ENDIAN) - pat16 = (pat16 & 0xff00) | ((pat16 & 0xff00 ) >> 8); -#else -#error __BIG_ENDIAN nor __LITTLE_ENDIAN is defined -#endif - loops = len >> 1; - do - PUP(sout) = pat16; - while (--loops); - out = (unsigned char *)sout + OFF; - } - if (len & 1) - PUP(out) = PUP(from); + do { /* minimum length is three */ + *out++ = *from++; + *out++ = *from++; + *out++ = *from++; + len -= 3; + } while (len > 2); + if (len) { + *out++ = *from++; + if (len > 1) + *out++ = *from++; + } } } else if ((op & 64) == 0) { /* 2nd level distance code */ - this = dcode[this.val + (hold & ((1U << op) - 1))]; + here = dcode[here.val + (hold & ((1U << op) - 1))]; goto dodist; } else { @@ -307,7 +261,7 @@ void inflate_fast(z_streamp strm, unsigned start) } } else if ((op & 64) == 0) { /* 2nd level length code */ - this = lcode[this.val + (hold & ((1U << op) - 1))]; + here = lcode[here.val + (hold & ((1U << op) - 1))]; goto dolen; } else if (op & 32) { /* end-of-block */ @@ -329,8 +283,8 @@ void inflate_fast(z_streamp strm, unsigned start) hold &= (1U << bits) - 1; /* update state and return */ - strm->next_in = in + OFF; - strm->next_out = out + OFF; + strm->next_in = in; + strm->next_out = out; strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); strm->avail_out = (unsigned)(out < end ? 257 + (end - out) : 257 - (out - end)); @@ -343,7 +297,7 @@ void inflate_fast(z_streamp strm, unsigned start) inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): - Using bit fields for code structure - Different op definition to avoid & for extra bits (do & for table bits) - - Three separate decoding do-loops for direct, window, and write == 0 + - Three separate decoding do-loops for direct, window, and wnext == 0 - Special case for distance > 1 copies to do overlapped load and store copy - Explicit branch predictions (based on measured branch probabilities) - Deferring match copy and interspersed it with decoding subsequent codes diff --git a/lib/zlib/inflate.c b/lib/zlib/inflate.c index 8f767b7b9d..f7e81fc8b2 100644 --- a/lib/zlib/inflate.c +++ b/lib/zlib/inflate.c @@ -21,7 +21,7 @@ int ZEXPORT inflateReset(z_streamp strm) state->head = Z_NULL; state->wsize = 0; state->whave = 0; - state->write = 0; + state->wnext = 0; state->hold = 0; state->bits = 0; state->lencode = state->distcode = state->next = state->codes; @@ -30,14 +30,11 @@ int ZEXPORT inflateReset(z_streamp strm) return Z_OK; } -int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, const char *version, +int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, int stream_size) { struct inflate_state FAR *state; - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != (int)(sizeof(z_stream))) - return Z_VERSION_ERROR; if (strm == Z_NULL) return Z_STREAM_ERROR; strm->msg = Z_NULL; /* in case we return an error */ if (strm->zalloc == (alloc_func)0) { @@ -70,9 +67,9 @@ int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, const char *version, return inflateReset(strm); } -int ZEXPORT inflateInit_(z_streamp strm, const char *version, int stream_size) +int ZEXPORT inflateInit_(z_streamp strm, int stream_size) { - return inflateInit2_(strm, DEF_WBITS, version, stream_size); + return inflateInit2_(strm, DEF_WBITS, stream_size); } local void fixedtables(struct inflate_state FAR *state) @@ -115,7 +112,7 @@ local int updatewindow(z_streamp strm, unsigned out) /* if window not in use yet, initialize */ if (state->wsize == 0) { state->wsize = 1U << state->wbits; - state->write = 0; + state->wnext = 0; state->whave = 0; } @@ -123,22 +120,22 @@ local int updatewindow(z_streamp strm, unsigned out) copy = out - strm->avail_out; if (copy >= state->wsize) { zmemcpy(state->window, strm->next_out - state->wsize, state->wsize); - state->write = 0; + state->wnext = 0; state->whave = state->wsize; } else { - dist = state->wsize - state->write; + dist = state->wsize - state->wnext; if (dist > copy) dist = copy; - zmemcpy(state->window + state->write, strm->next_out - copy, dist); + zmemcpy(state->window + state->wnext, strm->next_out - copy, dist); copy -= dist; if (copy) { zmemcpy(state->window, strm->next_out - copy, copy); - state->write = copy; + state->wnext = copy; state->whave = state->wsize; } else { - state->write += dist; - if (state->write == state->wsize) state->write = 0; + state->wnext += dist; + if (state->wnext == state->wsize) state->wnext = 0; if (state->whave < state->wsize) state->whave += dist; } } @@ -823,12 +820,12 @@ int ZEXPORT inflate(z_streamp strm, int flush) copy = out - left; if (state->offset > copy) { /* copy from window */ copy = state->offset - copy; - if (copy > state->write) { - copy -= state->write; + if (copy > state->wnext) { + copy -= state->wnext; from = state->window + (state->wsize - copy); } else - from = state->window + (state->write - copy); + from = state->window + (state->wnext - copy); if (copy > state->length) copy = state->length; } else { /* copy from output */ diff --git a/lib/zlib/inflate.h b/lib/zlib/inflate.h index 07bd3e78a7..2657d611cd 100644 --- a/lib/zlib/inflate.h +++ b/lib/zlib/inflate.h @@ -88,7 +88,7 @@ struct inflate_state { unsigned wbits; /* log base 2 of requested window size */ unsigned wsize; /* window size or zero if not using window */ unsigned whave; /* valid bytes in the window */ - unsigned write; /* window write index */ + unsigned wnext; /* window write index */ unsigned char FAR *window; /* allocated sliding window, if needed */ /* bit accumulator */ unsigned long hold; /* input bit accumulator */ diff --git a/lib/zlib/zutil.c b/lib/zlib/zutil.c index 609aac55ce..ec21b458fc 100644 --- a/lib/zlib/zutil.c +++ b/lib/zlib/zutil.c @@ -21,7 +21,6 @@ const char * const z_errmsg[10] = { "data error", /* Z_DATA_ERROR (-3) */ "insufficient memory", /* Z_MEM_ERROR (-4) */ "buffer error", /* Z_BUF_ERROR (-5) */ -"incompatible version",/* Z_VERSION_ERROR (-6) */ ""}; #ifdef DEBUG