[U-Boot] policy regarding unused code
Tom Rini
trini at konsulko.com
Tue Dec 11 18:17:28 UTC 2018
On Tue, Dec 11, 2018 at 06:01:23PM +0100, Jean-Jacques Hiblot wrote:
>
> On 11/12/2018 17:35, Tom Rini wrote:
> >On Tue, Dec 11, 2018 at 04:46:01PM +0100, Jean-Jacques Hiblot wrote:
> >>On 11/12/2018 16:25, Jean-Jacques Hiblot wrote:
> >>>Hi Tom,
> >>>
> >>>Is there such a policy described somewhere ?
> >>>
> >>>There are quite a pieces of code that are not used/compiled because no
> >>>config enables it.
> >>>
> >>>A random pick among many others:
> >>>
> >>>- CONFIG_FPGA_LATTICE
> >>>
> >>>- CONFIG_MESON_SPIFC
> >>>
> >>>- CONFIG_POWER_BATTERY_TRATS2
> >>>
> >>>- CONFIG_UPDATE_TFTP
> >>>
> >>>
> >>Here a more complete list of suspects (there may be options that do not even
> >>exist)
> >>
> >>Suspect means that the variable is probably referenced in a Makefile but not
> >>in configs/ nor in include/configs
> >>
> >>This is not a small list and a lot of them we probably want to keep.
> >>
> >>['CONFIG_MX8M', 'CONFIG_POWER_PMIC_MAX77693', 'CONFIG_TPM2_TIS_SANDBOX',
> >>'CONFIG_TPM_ST33ZP24_SPI', 'CONFIG_USB_SL811HS', 'CONFIG_RAM_SUPPORT',
> >>'CONFIG_BCM2835_WDT', 'CONFIG_ENV_IS_IN_SATA', 'CONFIG_IO64',
> >>'CONFIG_NAND_SUPPORT', 'CONFIG_NOR_SUPPORT', 'CONFIG_RISCV_ISA_A',
> >>'CONFIG_I2C_MUX_GPIO', 'CONFIG_POWER_FG_MAX17042', 'CONFIG_DNET',
> >>'CONFIG_CMD_SH_ZIMAGEBOOT', 'CONFIG_USE_DEFAULT_ENV_FILE',
> >>'CONFIG_CMD_IOTRACE', 'CONFIG_ALI152X', 'CONFIG_M5271',
> >>'CONFIG_CPU_MPC83XX', 'CONFIG_NXP_TDA19988', 'CONFIG_IMX',
> >>'CONFIG_ADI_GPIO2', 'CONFIG_BUILD_ENVCRC', 'CONFIG_FTMAC110',
> >>'CONFIG_CMD_CONITRACE', 'CONFIG_USB_DAVINCI', 'CONFIG_TARGET_XTFPGA',
> >>'CONFIG_DLVISION_10G', 'CONFIG_CMD_KGDB', 'CONFIG_USB_SDP_SUPPORT',
> >>'CONFIG_MESON_GX_VPU_POWER_DOMAIN', 'CONFIG_FSL_DMA',
> >>'CONFIG_IHS_VIDEO_OUT', 'CONFIG_CMD_ZFS', 'CONFIG_P2020DS',
> >>'CONFIG_RTC_DS1388', 'CONFIG_POWER_MUIC_MAX8997', 'CONFIG_TPM2_TIS_SPI',
> >>'CONFIG_TEST_FDTDEC', 'CONFIG_AIS_CONFIG_FILE', 'CONFIG_GDSYS_SOC',
> >>'CONFIG_CMD_DTIMG', 'CONFIG_DFU_SUPPORT', 'CONFIG_SYS_JFFS2_SORT_FRAGMENTS',
> >>'CONFIG_ATF', 'CONFIG_BLOBLIST', 'CONFIG_NAND_SPEAR', 'CONFIG_MPC8XXX_GPIO',
> >>'CONFIG_ULP_WATCHDOG', 'CONFIG_RTC_MK48T59', 'CONFIG_CMD_FITUPD',
> >>'CONFIG_MODVERSIONS', 'CONFIG_CPU_SH3', 'CONFIG_CMD_BEDBUG',
> >>'CONFIG_AT91_USB_CLK', 'CONFIG_CMD_UNIVERSE', 'CONFIG_DEBUG_UART_UNIPHIER',
> >>'CONFIG_CMD_DISPLAY', 'CONFIG_ETH_SANDBOX_RAW', 'CONFIG_SANDBOX',
> >>'CONFIG_CPU_SH2', 'CONFIG_SATA_SUPPORT', 'CONFIG_IOCON',
> >>'CONFIG_MESON_SPIFC', 'CONFIG_NS8382X', 'CONFIG_SOC_DM355',
> >>'CONFIG_BOARD_GAZERBEAM', 'CONFIG_CMD_AVB', 'CONFIG_MW_EEPROM',
> >>'CONFIG_SHA1_CHECK_UB_IMG', 'CONFIG_IHS_FPGA', 'CONFIG_USE_PLUGIN',
> >>'CONFIG_VIDEO_SIMPLE', 'CONFIG_CLK_VEXPRESS_OSC', 'CONFIG_MIPS_TUNE_14KC',
> >>'CONFIG_MPC83XX_SDRAM', 'CONFIG_XIP_SUPPORT', 'CONFIG_MIPS_TUNE_34KC',
> >>'CONFIG_ALTERA_UART', 'CONFIG_LOAD_FIT', 'CONFIG_RTC_DS1339',
> >>'CONFIG_ENV_SUPPORT', 'CONFIG_DEFAULT_ENV_FILE', 'CONFIG_TPM_ST33ZP24_I2C',
> >>'CONFIG_PCH_SUPPORT', 'CONFIG_UBOOT_PAD_TO', 'CONFIG_LYNXKDI',
> >>'CONFIG_CMD_SMC', 'CONFIG_BOOTCOUNT_AT91', 'CONFIG_OF_PLATDATA',
> >>'CONFIG_CONSOLE_TRUETYPE_NIMBUS', 'CONFIG_S6E8AX0', 'CONFIG_FPGA_ACEX1K',
> >>'CONFIG_MVEBU_EFUSE', 'CONFIG_CONSOLE_TRUETYPE_RUFSCRIPT',
> >>'CONFIG_XILINX_MICROBLAZE0_HW_VER', 'CONFIG_CONSOLE_TRUETYPE_ANKACODER',
> >>'CONFIG_RTC_M41T60', 'CONFIG_CMD_ZIP', 'CONFIG_USB_SUPPORT',
> >>'CONFIG_SPI_FLASH_SUPPORT', 'CONFIG_FLASH_PIC32', 'CONFIG_SAVEENV',
> >>'CONFIG_FPGA_STRATIX_II', 'CONFIG_TEE', 'CONFIG_PIC32_SPI',
> >>'CONFIG_FAT_SUPPORT', 'CONFIG_SERIAL_SUPPORT', 'CONFIG_RTC_DS174x',
> >>'CONFIG_RTC_RS5C372A', 'CONFIG_DM_DEBUG', 'CONFIG_DISPLAY_ROCKCHIP_LVDS',
> >>'CONFIG_CMD_ZYNQ_RSA', 'CONFIG_VEXPRESS_CONFIG', 'CONFIG_SPI_SUPPORT',
> >>'CONFIG_POWER_BATTERY_TRATS2', 'CONFIG_CS8900',
> >>'CONFIG_DRIVERS_MISC_SUPPORT', 'CONFIG_YMODEM_SUPPORT',
> >>'CONFIG_MPC83XX_SERDES', 'CONFIG_NAND_KB9202', 'CONFIG_PL022_SPI',
> >>'CONFIG_RTC_PCF2127', 'CONFIG_ARMV8_PSCI', 'CONFIG_KALLSYMS',
> >>'CONFIG_LAN91C96', 'CONFIG_SHELL', 'CONFIG_SOC_DM646X',
> >>'CONFIG_HASH_SUPPORT', 'CONFIG_ARMADA_39X', 'CONFIG_CMD_STRINGS',
> >>'CONFIG_ARCH_RV32I', 'CONFIG_RTC_M48T35A', 'CONFIG_DATAFLASH_MMC_SELECT',
> >>'CONFIG_UPDATE_TFTP', 'CONFIG_CPU_SA1100', 'CONFIG_NAND_PLAT',
> >>'CONFIG_GPIO_SUPPORT', 'CONFIG_RTC_DS1306', 'CONFIG_LOG_TEST',
> >>'CONFIG_IHS_AXI', 'CONFIG_XWAY_SWAP_BYTES', 'CONFIG_CPU_SH4',
> >>'CONFIG_RTC_MAX6900', 'CONFIG_TEGRA210_QSPI', 'CONFIG_SYS_I2C_VERSATILE',
> >>'CONFIG_PCI_SUPPORT', 'CONFIG_SPI_LOAD', 'CONFIG_NAND_FSL_UPM',
> >>'CONFIG_RTC_DS1556', 'CONFIG_DRIVER_AX88180', 'CONFIG_E1000_SPI',
> >>'CONFIG_ONENAND_U_BOOT', 'CONFIG_CMD_TERMINAL', 'CONFIG_MODULES',
> >>'CONFIG_ONENAND_SUPPORT', 'CONFIG_SH_SDHI',
> >>'CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED', 'CONFIG_BUILD',
> >>'CONFIG_VIDEO_ARM_MALIDP', 'CONFIG_POWER_BATTERY_TRATS',
> >>'CONFIG_DRIVER_SMC911X', 'CONFIG_UBI', 'CONFIG_MMC_SDHCI_SPEAR',
> >>'CONFIG_USB_OHCI_DA8XX', 'CONFIG_UDP_FUNCTION_FASTBOOT',
> >>'CONFIG_EXT_SUPPORT', 'CONFIG_USB_EHCI_FARADAY', 'CONFIG_TARGET_AXS103',
> >>'CONFIG_PHY_MSCC', 'CONFIG_FTPCI100', 'CONFIG_PCIE_INTEL_FPGA', 'CONFIG_IO',
> >>'CONFIG_SECURED_MODE_CSK_INDEX', 'CONFIG_SYSRESET_MCP83XX',
> >>'CONFIG_BOOTROM_SUPPORT', 'CONFIG_POWER_MUIC_MAX77693',
> >>'CONFIG_MMC_SUPPORT', 'CONFIG_LOGICORE_DP_TX', 'CONFIG_GDSYS_IOEP',
> >>'CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR', 'CONFIG_RMOBILE',
> >>'CONFIG_CMD_AES', 'CONFIG_RTC_S3C24X0', 'CONFIG_NATSEMI', 'CONFIG_NS87308',
> >>'CONFIG_CBMEM_CONSOLE', 'CONFIG_MARUBUN_PCCARD', 'CONFIG_XILINX_SPI',
> >>'CONFIG_FS_LOADER', 'CONFIG_YAFFS2', 'CONFIG_DM644X_GPIO',
> >>'CONFIG_SOC_DM365', 'CONFIG_ARC_TIMER', 'CONFIG_POWER_MAX8998',
> >>'CONFIG_CMD_FDC', 'CONFIG_RTC_RV3029', 'CONFIG_RTC_AT91SAM9_RTT',
> >>'CONFIG_EXYNOS_PWM_BL', 'CONFIG_CLK_MPC83XX', 'CONFIG_RTC_DS1302',
> >>'CONFIG_TPM_TIS_SANDBOX', 'CONFIG_MPC83XX_TIMER', 'CONFIG_ICS8N3QV01',
> >>'CONFIG_ARCH_P1011', 'CONFIG_I2C_SUPPORT', 'CONFIG_GDSYS_RXAUI_CTRL',
> >>'CONFIG_POWER_FG_MAX77693', 'CONFIG_PINCTRL_QCA953x', 'CONFIG_CMD_SHA1SUM',
> >>'CONFIG_RTC_DAVINCI', 'CONFIG_NET_SUPPORT', 'CONFIG_FPGA_LATTICE',
> >>'CONFIG_RTC_M41T94', 'CONFIG_MPC8XX_SPI', 'CONFIG_LPC32XX_HSUART',
> >>'CONFIG_CMD_YAFFS2', 'CONFIG_W1_EEPROM_DS2502', 'CONFIG_VIDEO_MX3',
> >>'CONFIG_UT_UNICODE', 'CONFIG_RTC_MX27', 'CONFIG_LIBAVB',
> >>'CONFIG_RTC_DS164x', 'CONFIG_CMD_HVC', 'CONFIG_CPU_V7',
> >>'CONFIG_FPGA_VIRTEX2', 'CONFIG_POWER_MAX8997',
> >>'CONFIG_MVEBU_SPL_BOOT_DEVICE_UART', 'CONFIG_ETH_SANDBOX',
> >>'CONFIG_DEBUG_LL', 'CONFIG_MCR3000', 'CONFIG_USB_EHCI_RMOBILE',
> >>'CONFIG_DB8500_GPIO', 'CONFIG_SECURED_MODE_IMAGE', 'CONFIG_CMD_TRACE',
> >>'CONFIG_AVB_VERIFY', 'CONFIG_NULLDEV_SERIAL', 'CONFIG_CMD_INI',
> >>'CONFIG_VIRTIO_SANDBOX', 'CONFIG_MACH_DAVINCI_DA830_EVM',
> >>'CONFIG_USB_ETHER_LAN75XX', 'CONFIG_SUN4I_SPI', 'CONFIG_CMD_BINOP',
> >>'CONFIG_RTC_SUPPORT', 'CONFIG_USB_DA8XX', 'CONFIG_SOC_DM644X',
> >>'CONFIG_ALTERA_SPI', 'CONFIG_SYS_FPGA_COMMON', 'CONFIG_TOOLS_DEBUG',
> >>'CONFIG_USB_GADGET_FOTG210', 'CONFIG_RTC_X1205', 'CONFIG_FPGA_SPARTAN2',
> >>'CONFIG_CMD_MFSL', 'CONFIG_RISCV_ISA_C']
> >I suspect this splits into three categories:
> >- Dead symbols and code to drop.
> >- Typos/thinkos
> >- Mistake in your grep? I see CONFIG_VIRTIO_SANDBOX is used today for
> > example.
>
> Oh yes. the code is far from perfect. this is a list of 'suspects'. It could
> be made more accurate but I would have to download a ton of toolchains to
> produce the exact configuration file for every board. So the script is
> taking shortcuts and only give suspects.
>
> It also indicates non existing variable like CONFIG_SERIAL_SUPPORT because
> CONFIG_SPL_SERIAL_SUPPORT does exist.
>
> So this list must be taken with (big) grain of salt.
I suspect there's enough false positives in there to make it problematic
to find the really bad symbols. To get all of the toolchains:
$ for A in aarch64 arm m68k microblaze mips powerpc riscv64 sh2 i386; do \
./tools/buildman/buildman --fetch-arch $A;done
and then add this to ~/.buildman:
[toolchain-alias]
sh = sh2
x86 = i386
riscv = riscv64
Thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181211/39db392e/attachment.sig>
More information about the U-Boot
mailing list