env: common: Remove environment definitions from common.h
Subsystems (46)
cover env: common: Remove environment definitions from common.h
At present common.h has a lot of uncommon declarations in it. Many of these would be better placed elsewhere, in header files more related to their purpose. In particular the environnment functions should move to the environment headers. This should reduce the overall amount of code compiled and the length of time taken to build U-Boot.
This series splits the current environment.h file into:
env.h common definitions widely used in U-Boot; and
env_internal.h features internal to the environment drivers, etc.
Most files can then include just env.h which is fairly small and does not have any CONFIG magic.
At the same time some dead code was noticed in common.h so this series removes some of this.
After this series common.h is down to about 400 lines. For reference it was about 1000 lines up until 3 years ago.
Simon Glass (39):
common: Move gzip functions into a new gzip header
common: Drop the dpram_... functions
common: Move lcd_setmem() to lcd.h
common: Remove video_setmem()
env: Create a new file for environment functions
env: Move get_env_id() to env.h
env: Move env_get_f() to env.h
env: Move env_init() to env.h
env: Move env_relocate() to env.h
env: Move envmatch() to env.h
env: Move env_set_hex() to env.h
env: Move env_set_ulong() to env.h
env: Move env_get_ulong() to env.h
env: Move env_get_yesno() to env.h
env: Move env_get_hex() to env.h
env: Move env_set() to env.h
env: Move env_get() to env.h
env: Move eth_env_get/set_enetaddr() to env.h
env: Move uncommon functions to env.h
env: Move set_default_vars to env.h
env: Move env_load/save functions to env.h
env: Move env import/export functions to env.h
env: Drop env_crc_update()
env: Move get/set_default_env() to env.h
env: Move env_get_char() to env.h
env: Move env_reloc() to env.h
env: Rename environment to embedded_environment
env: Move env_valid to env.h
env: Move callback definitions to env.h
env: Drop the ENTRY typdef
env: Drop _ENTRY
env: Rename the redundancy flags
env: Drop the ACTION typedef
env: Drop the double underscores in search.h
env: Move TOTAL_MALLOC_LEN to environment.h
env: Drop environment.h header file where not needed
env: Rename environment.h to env_internal.h Drop PCMCIA
common: Add a note about the effort to reduce common.h
README | 2 +-
api/api.c | 7 +-
arch/arm/cpu/arm926ejs/spear/spr_misc.c | 2 +-
arch/arm/cpu/armv7/vf610/generic.c | 1 +
arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 3 +-
arch/arm/cpu/armv8/fsl-layerscape/soc.c | 3 +-
arch/arm/cpu/armv8/fsl-layerscape/spl.c | 1 +
arch/arm/lib/bootm.c | 1 +
arch/arm/mach-davinci/misc.c | 2 +-
arch/arm/mach-imx/cmd_dek.c | 1 -
arch/arm/mach-imx/mx6/opos6ul.c | 4 +-
arch/arm/mach-imx/mx7/soc.c | 1 +
arch/arm/mach-imx/video.c | 1 +
arch/arm/mach-kirkwood/cpu.c | 1 +
arch/arm/mach-meson/board-common.c | 2 +-
arch/arm/mach-omap2/boot-common.c | 1 -
arch/arm/mach-omap2/omap3/clock.c | 1 -
arch/arm/mach-omap2/utils.c | 2 +-
arch/arm/mach-rmobile/cpu_info.c | 1 +
arch/arm/mach-rockchip/rk3288-board.c | 1 +
arch/arm/mach-socfpga/misc_gen5.c | 1 +
arch/arm/mach-socfpga/misc_s10.c | 1 +
arch/arm/mach-stm32mp/cpu.c | 2 +-
arch/arm/mach-tegra/board2.c | 1 +
arch/arm/mach-tegra/cboot.c | 2 +-
arch/arm/mach-uniphier/board_late_init.c | 1 +
arch/arm/mach-uniphier/mmc-first-dev.c | 1 +
arch/m68k/lib/bootm.c | 2 +-
arch/microblaze/lib/bootm.c | 1 +
arch/mips/lib/bootm.c | 1 +
arch/nds32/include/asm/u-boot.h | 1 -
arch/nds32/lib/bootm.c | 1 +
arch/powerpc/cpu/mpc85xx/cpu_init.c | 1 +
arch/powerpc/cpu/mpc85xx/fdt.c | 2 +-
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c | 1 +
arch/powerpc/cpu/mpc85xx/mp.c | 2 +
arch/powerpc/lib/bootm.c | 2 +-
arch/riscv/include/asm/u-boot.h | 1 -
arch/x86/cpu/qemu/e820.c | 1 +
arch/x86/lib/zimage.c | 1 +
arch/xtensa/lib/bootm.c | 1 +
board/Arcturus/ucp1020/cmd_arc.c | 2 +-
board/Arcturus/ucp1020/spl.c | 3 +-
board/Arcturus/ucp1020/ucp1020.c | 1 +
board/BuR/brppt1/board.c | 1 +
board/BuR/brxre1/board.c | 1 +
board/BuR/common/br_resetc.c | 1 +
board/BuR/common/common.c | 1 +
board/BuS/eb_cpu5282/eb_cpu5282.c | 1 +
board/CZ.NIC/turris_mox/turris_mox.c | 2 +-
board/CZ.NIC/turris_omnia/turris_omnia.c | 2 +-
board/CarMediaLab/flea3/flea3.c | 1 +
board/LaCie/net2big_v2/net2big_v2.c | 2 +-
board/LaCie/netspace_v2/netspace_v2.c | 2 +-
board/Synology/ds414/cmd_syno.c | 1 +
board/alliedtelesis/x530/x530.c | 1 +
board/amazon/kc1/kc1.c | 1 +
board/amlogic/p200/p200.c | 2 +-
board/amlogic/p201/p201.c | 2 +-
board/amlogic/p212/p212.c | 2 +-
board/amlogic/q200/q200.c | 2 +-
board/amlogic/s400/s400.c | 1 -
board/amlogic/u200/u200.c | 1 -
board/aristainetos/aristainetos-v2.c | 1 +
board/armadeus/apf27/apf27.c | 1 -
board/armltd/integrator/integrator.c | 1 +
board/atmel/common/board.c | 1 +
board/atmel/common/mac_eeprom.c | 2 +-
board/atmel/sama5d3xek/sama5d3xek.c | 1 +
board/bachmann/ot1200/ot1200.c | 1 +
board/birdland/bav335x/board.c | 4 +-
board/bluegiga/apx4devkit/apx4devkit.c | 1 +
board/bluewater/gurnard/gurnard.c | 1 +
board/bosch/guardian/board.c | 3 +-
board/bosch/shc/board.c | 4 +-
board/boundary/nitrogen6x/nitrogen6x.c | 1 +
board/broadcom/bcm23550_w1d/bcm23550_w1d.c | 1 +
board/broadcom/bcm28155_ap/bcm28155_ap.c | 1 +
board/broadcom/bcmstb/bcmstb.c | 1 +
board/buffalo/lsxl/lsxl.c | 3 +-
board/cadence/xtfpga/xtfpga.c | 1 +
board/ccv/xpress/xpress.c | 1 +
board/compulab/cl-som-imx7/cl-som-imx7.c | 2 +-
board/compulab/cm_fx6/cm_fx6.c | 2 +-
board/compulab/cm_t335/cm_t335.c | 2 +-
board/compulab/cm_t35/cm_t35.c | 2 +-
board/compulab/cm_t54/cm_t54.c | 2 +-
board/compulab/common/omap3_display.c | 1 +
board/congatec/cgtqmx6eval/cgtqmx6eval.c | 1 +
board/cssi/MCR3000/MCR3000.c | 1 +
board/davinci/da8xxevm/da850evm.c | 2 +-
board/davinci/da8xxevm/omapl138_lcdk.c | 1 +
board/dhelectronics/dh_imx6/dh_imx6.c | 2 +-
board/eets/pdu001/board.c | 2 +-
board/el/el6x/el6x.c | 1 +
board/emulation/qemu-riscv/qemu-riscv.c | 1 +
board/engicam/common/board.c | 1 +
board/esd/meesc/meesc.c | 1 +
board/freescale/b4860qds/b4860qds.c | 1 +
board/freescale/b4860qds/spl.c | 3 +-
board/freescale/bsc9131rdb/bsc9131rdb.c | 1 +
board/freescale/bsc9132qds/bsc9132qds.c | 1 +
board/freescale/c29xpcie/c29xpcie.c | 1 +
board/freescale/c29xpcie/spl.c | 2 +-
board/freescale/common/cmd_esbc_validate.c | 1 +
board/freescale/common/fsl_chain_of_trust.c | 1 +
board/freescale/common/sys_eeprom.c | 1 +
board/freescale/common/vid.c | 1 +
board/freescale/corenet_ds/corenet_ds.c | 1 +
board/freescale/imx8mq_evk/imx8mq_evk.c | 1 +
board/freescale/imx8qm_mek/imx8qm_mek.c | 2 +-
board/freescale/imx8qxp_mek/imx8qxp_mek.c | 2 +-
board/freescale/ls1012afrdm/ls1012afrdm.c | 2 +-
board/freescale/ls1012aqds/ls1012aqds.c | 2 +-
board/freescale/ls1012ardb/ls1012ardb.c | 2 +-
board/freescale/ls1028a/ls1028a.c | 2 +-
board/freescale/ls1088a/eth_ls1088aqds.c | 1 +
board/freescale/ls1088a/ls1088a.c | 3 +-
board/freescale/ls2080a/ls2080a.c | 2 +-
board/freescale/ls2080aqds/eth.c | 1 +
board/freescale/ls2080aqds/ls2080aqds.c | 3 +-
board/freescale/ls2080ardb/ls2080ardb.c | 3 +-
board/freescale/lx2160a/eth_lx2160aqds.c | 1 +
board/freescale/lx2160a/lx2160a.c | 2 +-
board/freescale/mpc8323erdb/mpc8323erdb.c | 1 +
board/freescale/mpc837xemds/pci.c | 1 +
board/freescale/mpc837xerdb/mpc837xerdb.c | 1 +
board/freescale/mpc8572ds/mpc8572ds.c | 1 +
board/freescale/mx51evk/mx51evk_video.c | 1 +
board/freescale/mx53loco/mx53loco.c | 1 +
board/freescale/mx53loco/mx53loco_video.c | 1 +
board/freescale/mx6sabreauto/mx6sabreauto.c | 1 +
board/freescale/mx6sabresd/mx6sabresd.c | 1 +
board/freescale/mx6sxsabresd/mx6sxsabresd.c | 1 +
.../mx6ul_14x14_evk/mx6ul_14x14_evk.c | 1 +
board/freescale/mx6ullevk/mx6ullevk.c | 1 +
board/freescale/p1010rdb/p1010rdb.c | 1 +
board/freescale/p1010rdb/spl.c | 3 +-
board/freescale/p1022ds/p1022ds.c | 1 +
board/freescale/p1022ds/spl.c | 3 +-
board/freescale/p1023rdb/p1023rdb.c | 1 +
board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 1 +
board/freescale/p1_p2_rdb_pc/spl.c | 3 +-
board/freescale/p1_twr/p1_twr.c | 1 +
board/freescale/p2041rdb/p2041rdb.c | 1 +
board/freescale/qemu-ppce500/qemu-ppce500.c | 1 +
board/freescale/t102xqds/spl.c | 2 +-
board/freescale/t102xqds/t102xqds.c | 1 +
board/freescale/t102xrdb/spl.c | 2 +-
board/freescale/t102xrdb/t102xrdb.c | 1 +
board/freescale/t1040qds/t1040qds.c | 1 +
board/freescale/t104xrdb/spl.c | 2 +-
board/freescale/t104xrdb/t104xrdb.c | 1 +
board/freescale/t208xqds/spl.c | 2 +-
board/freescale/t208xqds/t208xqds.c | 1 +
board/freescale/t208xrdb/spl.c | 2 +-
board/freescale/t208xrdb/t208xrdb.c | 1 +
board/freescale/t4qds/spl.c | 2 +-
board/freescale/t4qds/t4240emu.c | 1 +
board/freescale/t4qds/t4240qds.c | 1 +
board/freescale/t4rdb/spl.c | 2 +-
board/freescale/t4rdb/t4240rdb.c | 1 +
board/gardena/smart-gateway-at91sam/board.c | 1 +
board/gardena/smart-gateway-mt7688/board.c | 3 +-
board/gateworks/gw_ventana/common.c | 1 +
board/gateworks/gw_ventana/gw_ventana.c | 2 +-
board/gateworks/gw_ventana/gw_ventana_spl.c | 3 +-
board/gdsys/a38x/keyprogram.c | 1 +
board/gdsys/mpc8308/gazerbeam.c | 1 +
board/gdsys/mpc8308/hrcon.c | 1 +
board/gdsys/mpc8308/strider.c | 1 +
board/gdsys/p1022/controlcenterd-id.c | 1 +
board/gdsys/p1022/controlcenterd.c | 1 +
board/ge/bx50v3/bx50v3.c | 1 +
board/ge/common/ge_common.c | 1 +
board/ge/mx53ppd/mx53ppd.c | 2 +-
board/grinn/chiliboard/board.c | 2 +-
board/grinn/liteboard/board.c | 1 +
board/gumstix/pepper/board.c | 2 +-
board/highbank/highbank.c | 1 +
board/hisilicon/poplar/poplar.c | 1 +
board/imgtec/ci20/ci20.c | 2 +-
board/intel/edison/edison.c | 2 +-
board/isee/igep003x/board.c | 2 +-
board/isee/igep00x0/igep00x0.c | 1 +
board/k+p/kp_imx53/kp_id_rev.c | 2 +-
board/k+p/kp_imx53/kp_imx53.c | 1 +
board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 1 +
board/keymile/common/common.c | 1 +
board/keymile/common/ivm.c | 1 +
board/keymile/km83xx/km83xx.c | 1 +
board/keymile/km_arm/km_arm.c | 1 +
board/keymile/kmp204x/kmp204x.c | 1 +
board/kosagi/novena/novena.c | 2 +-
board/laird/wb50n/wb50n.c | 1 +
board/lg/sniper/sniper.c | 1 +
board/liebherr/display5/display5.c | 2 +-
board/liebherr/display5/spl.c | 2 +-
board/liebherr/mccmon6/mccmon6.c | 1 +
board/logicpd/imx6/imx6logic.c | 1 +
board/logicpd/zoom1/zoom1.c | 2 +-
board/menlo/m53menlo/m53menlo.c | 2 +
board/micronas/vct/vct.c | 1 +
board/mscc/ocelot/ocelot.c | 1 -
board/nokia/rx51/rx51.c | 1 +
board/nvidia/p2371-2180/p2371-2180.c | 2 +-
board/nvidia/p2771-0000/p2771-0000.c | 2 +-
board/overo/overo.c | 1 +
board/phytec/pcm051/board.c | 2 +-
board/phytec/pcm052/pcm052.c | 4 +-
board/phytec/pfla02/pfla02.c | 1 +
board/phytec/phycore_rk3288/phycore-rk3288.c | 2 +-
.../dragonboard410c/dragonboard410c.c | 2 +-
.../dragonboard820c/dragonboard820c.c | 1 +
board/raspberrypi/rpi/rpi.c | 2 +-
board/renesas/alt/alt.c | 3 +-
board/renesas/blanche/blanche.c | 2 +-
board/renesas/gose/gose.c | 3 +-
board/renesas/koelsch/koelsch.c | 3 +-
board/renesas/lager/lager.c | 3 +-
board/renesas/porter/porter.c | 3 +-
board/renesas/sh7752evb/sh7752evb.c | 2 +-
board/renesas/sh7753evb/sh7753evb.c | 2 +-
board/renesas/sh7757lcr/sh7757lcr.c | 2 +-
board/renesas/silk/silk.c | 3 +-
board/renesas/stout/stout.c | 3 +-
board/rockchip/tinker_rk3288/tinker-rk3288.c | 2 +-
board/samsung/common/exynos5-dt.c | 1 +
board/samsung/common/misc.c | 1 +
board/samsung/odroid/odroid.c | 1 +
board/samsung/trats/trats.c | 1 +
board/samsung/universal_c210/universal.c | 1 +
board/samtec/vining_fpga/socfpga.c | 2 +-
board/siemens/common/board.c | 1 +
board/siemens/common/factoryset.c | 2 +-
board/siemens/draco/board.c | 1 +
board/siemens/pxm2/board.c | 2 +-
board/siemens/rut/board.c | 1 +
board/siemens/taurus/taurus.c | 2 +-
board/silica/pengwyn/board.c | 2 +-
board/socrates/socrates.c | 1 +
board/softing/vining_2000/vining_2000.c | 2 +-
board/solidrun/mx6cuboxi/mx6cuboxi.c | 1 +
board/st/stm32mp1/stm32mp1.c | 3 +-
board/sunxi/board.c | 3 +-
board/synopsys/hsdk/env-lib.c | 1 +
board/synopsys/hsdk/hsdk.c | 1 +
board/tcl/sl50/board.c | 4 +-
board/technologic/ts4800/ts4800.c | 2 +-
.../puma_rk3399/puma-rk3399.c | 2 +-
board/ti/am335x/board.c | 4 +-
board/ti/am43xx/board.c | 2 +-
board/ti/am57xx/board.c | 2 +-
board/ti/am65x/evm.c | 1 +
board/ti/beagle/beagle.c | 1 +
board/ti/common/board_detect.c | 1 +
board/ti/dra7xx/evm.c | 2 +-
board/ti/evm/evm.c | 1 +
board/ti/ks2_evm/board.c | 1 +
board/ti/ks2_evm/board_k2g.c | 1 +
board/ti/panda/panda.c | 1 +
board/ti/ti814x/evm.c | 2 +-
board/ti/ti816x/evm.c | 2 +-
board/timll/devkit8000/devkit8000.c | 2 +-
board/toradex/apalis-imx8/apalis-imx8.c | 2 +-
board/toradex/apalis_imx6/apalis_imx6.c | 2 +-
.../toradex/colibri-imx6ull/colibri-imx6ull.c | 1 +
board/toradex/colibri-imx8x/colibri-imx8x.c | 2 +-
board/toradex/colibri_imx6/colibri_imx6.c | 2 +-
board/toradex/colibri_vf/colibri_vf.c | 1 +
board/toradex/common/tdx-cfg-block.c | 1 +
board/toradex/common/tdx-common.c | 2 +-
board/tqc/tqma6/tqma6.c | 1 +
board/udoo/neo/neo.c | 1 +
board/udoo/udoo.c | 1 +
board/varisys/common/sys_eeprom.c | 1 +
board/varisys/cyrus/cyrus.c | 1 +
board/vscom/baltos/board.c | 2 +-
board/wandboard/wandboard.c | 1 +
board/warp7/warp7.c | 1 +
.../work_92105/work_92105_display.c | 1 +
board/xes/common/board.c | 1 +
board/xilinx/zynq/board.c | 1 +
board/xilinx/zynqmp/cmds.c | 1 +
board/xilinx/zynqmp/zynqmp.c | 1 +
cmd/Kconfig | 8 -
cmd/Makefile | 1 -
cmd/aes.c | 1 -
cmd/avb.c | 1 +
cmd/bdinfo.c | 1 +
cmd/binop.c | 1 +
cmd/blob.c | 1 -
cmd/bmp.c | 8 +-
cmd/bootefi.c | 1 +
cmd/bootm.c | 2 +-
cmd/bootmenu.c | 1 +
cmd/cbfs.c | 1 +
cmd/config.c | 1 +
cmd/cramfs.c | 1 +
cmd/dtimg.c | 1 +
cmd/efidebug.c | 1 -
cmd/elf.c | 2 +-
cmd/ethsw.c | 2 +-
cmd/fdt.c | 1 +
cmd/fpga.c | 2 +
cmd/gpt.c | 1 +
cmd/i2c.c | 1 -
cmd/ide.c | 4 -
cmd/ini.c | 2 +-
cmd/itest.c | 1 +
cmd/jffs2.c | 1 +
cmd/license.c | 1 +
cmd/load.c | 1 +
cmd/lzmadec.c | 1 +
cmd/md5sum.c | 1 +
cmd/mtdparts.c | 1 +
cmd/mvebu/bubt.c | 1 +
cmd/nand.c | 1 +
cmd/net.c | 1 +
cmd/nvedit.c | 45 +--
cmd/nvedit_efi.c | 1 +
cmd/part.c | 1 +
cmd/pcmcia.c | 341 -----------------
cmd/pxe.c | 1 +
cmd/qfw.c | 1 +
cmd/reiser.c | 1 +
cmd/setexpr.c | 1 +
cmd/source.c | 1 +
cmd/spl.c | 1 +
cmd/tpm-common.c | 1 +
cmd/tpm-v1.c | 1 +
cmd/tpm_test.c | 1 -
cmd/trace.c | 1 +
cmd/ubi.c | 1 +
cmd/unzip.c | 2 +
cmd/ximg.c | 2 +
cmd/zfs.c | 1 +
cmd/zip.c | 1 +
common/autoboot.c | 1 +
common/board_f.c | 11 +-
common/board_r.c | 17 +-
common/bootm.c | 2 +
common/bootm_os.c | 1 +
common/bootretry.c | 1 +
common/cli.c | 1 +
common/cli_hush.c | 1 +
common/cli_simple.c | 1 +
common/command.c | 1 +
common/console.c | 3 +-
common/fdt_support.c | 1 +
common/hash.c | 1 +
common/hwconfig.c | 1 +
common/image-android.c | 1 +
common/image-fdt.c | 1 +
common/image.c | 2 +-
common/main.c | 1 +
common/spl/spl_dfu.c | 4 +-
common/spl/spl_ext.c | 1 +
common/spl/spl_fat.c | 1 +
common/spl/spl_fit.c | 1 +
common/spl/spl_net.c | 1 +
common/spl/spl_ymodem.c | 1 +
common/splash.c | 1 +
common/splash_source.c | 1 +
common/update.c | 1 +
common/usb_hub.c | 1 +
common/usb_kbd.c | 1 +
disk/part.c | 1 +
disk/part_amiga.c | 1 +
doc/README.marubun-pcmcia | 65 ----
doc/README.ne2000 | 11 -
drivers/Kconfig | 2 -
drivers/Makefile | 1 -
drivers/bootcount/bootcount_env.c | 2 +-
drivers/ddr/fsl/fsl_ddr_gen4.c | 1 +
drivers/ddr/fsl/interactive.c | 1 +
drivers/ddr/fsl/options.c | 1 +
drivers/dfu/dfu.c | 1 +
drivers/fastboot/fb_command.c | 1 +
drivers/fastboot/fb_common.c | 1 +
drivers/fastboot/fb_getvar.c | 1 +
drivers/fastboot/fb_mmc.c | 1 +
drivers/input/i8042.c | 1 +
drivers/input/input.c | 1 +
drivers/misc/fs_loader.c | 1 +
drivers/mtd/cfi_flash.c | 3 +-
drivers/mtd/jedec_flash.c | 1 -
drivers/mtd/mtd_uboot.c | 1 +
drivers/net/dc2114x.c | 1 +
drivers/net/fec_mxc.c | 2 +-
drivers/net/fm/b4860.c | 1 +
drivers/net/fm/fdt.c | 1 +
drivers/net/fm/fm.c | 2 +-
drivers/net/fsl-mc/mc.c | 1 +
drivers/net/fsl_mcdmafec.c | 2 +-
drivers/net/ftmac100.c | 1 +
drivers/net/lan91c96.c | 1 +
drivers/net/mcffec.c | 2 +-
drivers/net/ne2000_base.c | 12 +-
drivers/net/netconsole.c | 5 +-
drivers/net/phy/micrel_ksz90x1.c | 1 +
drivers/net/sandbox-raw.c | 1 +
drivers/net/sh_eth.c | 2 +-
drivers/net/ti/cpsw-common.c | 1 -
drivers/pci/fsl_pci_init.c | 1 +
drivers/pci/pci.c | 1 +
drivers/pci/pci_common.c | 1 +
drivers/pcmcia/Kconfig | 0
drivers/pcmcia/Makefile | 6 -
drivers/pcmcia/marubun_pcmcia.c | 99 -----
drivers/qe/qe.c | 1 -
drivers/reset/reset-socfpga.c | 1 +
drivers/rtc/m41t60.c | 1 +
drivers/scsi/scsi.c | 1 +
drivers/serial/serial-uclass.c | 2 +-
drivers/serial/serial.c | 2 +-
drivers/serial/usbtty.c | 1 +
drivers/tee/sandbox.c | 8 +-
drivers/usb/gadget/designware_udc.c | 1 +
drivers/usb/gadget/ether.c | 2 +-
drivers/usb/gadget/f_dfu.c | 1 +
drivers/usb/gadget/f_fastboot.c | 1 +
drivers/usb/gadget/f_rockusb.c | 1 +
drivers/usb/gadget/f_sdp.c | 1 +
drivers/usb/host/ehci-fsl.c | 1 +
drivers/video/ati_radeon_fb.c | 1 +
drivers/video/cfb_console.c | 2 +
drivers/video/mb862xx.c | 1 +
drivers/video/mx3fb.c | 1 +
drivers/video/mxsfb.c | 1 +
drivers/video/videomodes.c | 1 +
env/callback.c | 11 +-
env/common.c | 21 +-
env/eeprom.c | 13 +-
env/embedded.c | 2 +-
env/env.c | 3 +-
env/ext4.c | 5 +-
env/fat.c | 5 +-
env/flags.c | 15 +-
env/flash.c | 23 +-
env/mmc.c | 7 +-
env/nand.c | 9 +-
env/nowhere.c | 3 +-
env/nvram.c | 3 +-
env/onenand.c | 2 +-
env/remote.c | 2 +-
env/sata.c | 5 +-
env/sf.c | 19 +-
env/ubi.c | 9 +-
examples/api/demo.c | 1 +
examples/api/glue.c | 3 +-
fs/fs.c | 1 +
fs/ubifs/ubifs.c | 2 +
include/bootcount.h | 1 +
include/command.h | 1 +
include/common.h | 191 +---------
include/env.h | 346 ++++++++++++++++++
include/env_callback.h | 25 +-
include/env_default.h | 2 +-
include/env_flags.h | 7 +-
include/{environment.h => env_internal.h} | 110 ++----
include/exports.h | 1 +
include/gzip.h | 103 ++++++
include/lcd.h | 1 +
include/net.h | 1 +
include/pcmcia.h | 137 -------
include/pcmcia/yenta.h | 156 --------
include/search.h | 77 ++--
lib/efi_loader/efi_boottime.c | 1 -
lib/efi_loader/efi_console.c | 1 +
lib/efi_loader/efi_variable.c | 3 +-
lib/fdtdec.c | 2 +
lib/gunzip.c | 5 +-
lib/gzip.c | 1 +
lib/hashtable.c | 66 ++--
lib/smbios.c | 1 +
lib/uuid.c | 1 +
net/bootp.c | 1 +
net/dns.c | 1 +
net/eth-uclass.c | 2 +-
net/eth_common.c | 4 +-
net/eth_legacy.c | 2 +-
net/link_local.c | 1 +
net/net.c | 3 +-
net/tftp.c | 1 +
net/wol.c | 2 +-
post/post.c | 1 +
scripts/config_whitelist.txt | 6 -
test/compression.c | 1 +
test/dm/eth.c | 1 +
test/env/hashtable.c | 20 +-
tools/env/fw_env.c | 24 +-
tools/env/fw_env.h | 1 +
tools/env/fw_env_main.c | 1 +
tools/envcrc.c | 6 +-
495 files changed, 1183 insertions(+), 1541 deletions(-)
delete mode 100644 cmd/pcmcia.c
delete mode 100644 doc/README.marubun-pcmcia
delete mode 100644 drivers/pcmcia/Kconfig
delete mode 100644 drivers/pcmcia/Makefile
delete mode 100644 drivers/pcmcia/marubun_pcmcia.c
create mode 100644 include/env.h
rename include/{environment.h => env_internal.h} (75%)
create mode 100644 include/gzip.h
delete mode 100644 include/pcmcia.h
delete mode 100644 include/pcmcia/yenta.hSignature · 1 line
2.22.0.709.g102302147b-goog
PATCH 1/39 common: Move gzip functions into a new gzip header
As part of the effort to remove things from common.h, create a new header for the gzip functions. Move the function declarations to it and add missing documentation.
---
board/menlo/m53menlo/m53menlo.c | 1 + cmd/bmp.c | 8 +-- cmd/config.c | 1 + cmd/fpga.c | 1 + cmd/license.c | 1 + cmd/unzip.c | 1 + cmd/ximg.c | 1 + common/bootm.c | 1 + common/spl/spl_fit.c | 1 + common/spl/spl_ymodem.c | 1 + drivers/video/cfb_console.c | 1 + fs/ubifs/ubifs.c | 1 + include/common.h | 52 ---------------- include/gzip.h | 103 ++++++++++++++++++++++++++++++++ lib/fdtdec.c | 1 + lib/gunzip.c | 5 +- lib/gzip.c | 1 + test/compression.c | 1 + 18 files changed, 124 insertions(+), 58 deletions(-) create mode 100644 include/gzip.h
board/menlo/m53menlo/m53menlo.c +1 -0
@@ -20,6 +20,7 @@#include <asm/spl.h> #include <fdt_support.h> #include <fsl_esdhc_imx.h> +#include <gzip.h> #include <i2c.h> #include <ipu_pixfmt.h> #include <linux/errno.h>
cmd/bmp.c +4 -4
@@ -9,16 +9,16 @@*/ #include <common.h> -#include <dm.h> -#include <lcd.h> -#include <mapmem.h> #include <bmp_layout.h> #include <command.h> -#include <asm/byteorder.h> +#include <dm.h> +#include <gzip.h> +#include <lcd.h> #include <malloc.h> #include <mapmem.h> #include <splash.h> #include <video.h> +#include <asm/byteorder.h> static int bmp_info (ulong addr);
cmd/config.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <gzip.h> #include <malloc.h> #include "config_data_gz.h"
cmd/fpga.c +1 -0
@@ -11,6 +11,7 @@#include <command.h> #include <fpga.h> #include <fs.h> +#include <gzip.h> #include <malloc.h> static long do_fpga_get_device (char *arg)
cmd/license.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> +#include <gzip.h> #include <malloc.h> #include "license_data_gz.h"
cmd/unzip.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> +#include <gzip.h> static int do_unzip (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {
cmd/ximg.c +1 -0
@@ -13,6 +13,7 @@*/ #include <common.h> #include <command.h> +#include <gzip.h> #include <image.h> #include <mapmem.h> #include <watchdog.h>
common/bootm.c +1 -0
@@ -10,6 +10,7 @@#include <bzlib.h> #include <errno.h> #include <fdt_support.h> +#include <gzip.h> #include <lmb.h> #include <malloc.h> #include <mapmem.h>
common/spl/spl_fit.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <errno.h> #include <fpga.h> +#include <gzip.h> #include <image.h> #include <linux/libfdt.h> #include <spl.h>
common/spl/spl_ymodem.c +1 -0
@@ -9,6 +9,7 @@* Matt Porter <[email protected]> */ #include <common.h> +#include <gzip.h> #include <spl.h> #include <xyzModem.h> #include <asm/u-boot.h>
drivers/video/cfb_console.c +1 -0
@@ -66,6 +66,7 @@#include <common.h> #include <fdtdec.h> +#include <gzip.h> #include <version.h> #include <malloc.h> #include <video.h>
fs/ubifs/ubifs.c +1 -0
@@ -12,6 +12,7 @@*/ #include <common.h> +#include <gzip.h> #include <memalign.h> #include "ubifs.h" #include <u-boot/zlib.h>
include/common.h +0 -52
64 lines not on this page · raw message
include/gzip.h new file +103 -0
103 lines not on this page · raw message
lib/fdtdec.c +1 -0
@@ -11,6 +11,7 @@#include <errno.h> #include <fdtdec.h> #include <fdt_support.h> +#include <gzip.h> #include <mapmem.h> #include <linux/libfdt.h> #include <serial.h>
lib/gunzip.c +3 -2
@@ -5,14 +5,15 @@*/ #include <common.h> -#include <watchdog.h> #include <command.h> #include <console.h> +#include <div64.h> +#include <gzip.h> #include <image.h> #include <malloc.h> #include <memalign.h> +#include <watchdog.h> #include <u-boot/zlib.h> -#include <div64.h> #define HEADER0 '\x1f'#define HEADER1 '\x8b'
lib/gzip.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <watchdog.h> #include <command.h> +#include <gzip.h> #include <image.h> #include <malloc.h> #include <memalign.h>
test/compression.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <bootm.h> #include <command.h> +#include <gzip.h> #include <malloc.h> #include <mapmem.h> #include <asm/io.h>
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 2/39 common: Drop the dpram_... functions
In reply to Simon GlassThese declarations are not used anymore, so drop them.
---
include/common.h | 5 ----- 1 file changed, 5 deletions(-)
include/common.h +0 -5
@@ -379,11 +379,6 @@ void enable_interrupts (void);int disable_interrupts (void );/* $(CPU)/.../commproc.c */ -int dpram_init (void ); -uint dpram_base (void ); -uint dpram_base_align (uint align); -uint dpram_alloc (uint size); -uint dpram_alloc_align (uint size,uint align);void bootcount_store (ulong );ulong bootcount_load (void );
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 3/39 common: Move lcd_setmem() to lcd.h
In reply to Simon GlassThis function relates to lcd.h and is about to become obsolete with the driver-model conversion. Move it out of common.h
---
common/board_f.c | 1 + include/common.h | 3 --- include/lcd.h | 1 + 3 files changed, 2 insertions(+), 3 deletions(-)
common/board_f.c +1 -0
@@ -19,6 +19,7 @@#include <fs.h> #include <i2c.h> #include <initcall.h> +#include <lcd.h> #include <malloc.h> #include <mapmem.h> #include <os.h>
include/common.h +0 -3
@@ -385,9 +385,6 @@ ulong bootcount_load (void);/* $(CPU)/.../<eth> */ void mii_init (void ); -/* $(CPU)/.../lcd.c */ -ulong lcd_setmem (ulong ); -/* $(CPU)/.../video.c */ ulong video_setmem (ulong );
include/lcd.h +1 -0
@@ -30,6 +30,7 @@ extern struct vidinfo panel_info;void lcd_ctrl_init (void *lcdbase);void lcd_enable (void );void lcd_setcolreg (ushort regno,ushort red,ushort green,ushort blue); +ulong lcd_setmem (ulong addr);/** * Set whether we need to flush the dcache when changing the LCD image. This
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 4/39 common: Remove video_setmem()
In reply to Simon GlassThis function is no-longer defined in U-Boot. Drop the declaration from common.h
---
common/board_f.c | 7 ------- include/common.h | 3 --- 2 files changed, 10 deletions(-)
common/board_f.c +0 -7
@@ -426,13 +426,6 @@ static int reserve_video(void) gd->relocaddr =lcd_setmem (gd->relocaddr); gd->fb_base = gd->relocaddr;# endif /* CONFIG_FB_ADDR */ -#elif defined(CONFIG_VIDEO ) && \ - (!defined(CONFIG_PPC )) && \ - !defined(CONFIG_ARM ) && !defined(CONFIG_X86 ) && \ - !defined(CONFIG_M68K ) -/* reserve memory for video display (always full pages) */ - gd->relocaddr =video_setmem (gd->relocaddr); - gd->fb_base = gd->relocaddr;#endif return 0 ;
include/common.h +0 -3
@@ -385,9 +385,6 @@ ulong bootcount_load (void);/* $(CPU)/.../<eth> */ void mii_init (void ); -/* $(CPU)/.../video.c */ -ulong video_setmem (ulong ); -/* arch/$(ARCH)/lib/cache.c */ void enable_caches (void );void flush_cache (unsigned long ,unsigned long );
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 5/39 env: Create a new file for environment functions
In reply to Simon GlassAt present we have environment.h but this file includes all the environment-related header files as well as internals such as default_environment.
It seems desirable to have a new header to hold the commonly used environment functions, so that most files can avoid including all of this unnecessary stuff.
Create a new env.h header and move one function over to it.
---
common/command.c | 1 + include/common.h | 4 ---- include/env.h | 28 ++++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 include/env.h
common/command.c +1 -0
@@ -11,6 +11,7 @@#include <common.h> #include <command.h> #include <console.h> +#include <env.h> #include <linux/ctype.h> /*
include/common.h +0 -4
@@ -247,10 +247,6 @@ static inline int env_set_addr(const char *varname, const void *addr)return env_set_hex (varname, (ulong )addr); } -#ifdef CONFIG_AUTO_COMPLETE -int env_complete (char *var,int maxv,char *cmdv[],int maxsz,char *buf, -bool dollar_comp); -#endif int get_env_id (void );void pci_init_board (void );
include/env.h new file +28 -0
@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Common environment functions +* +* (C) Copyright 2000-2009 +* Wolfgang Denk, DENX Software Engineering, wd at denx.de. +*/ + +#ifndef __ENV_H +#define __ENV_H + +#include <stdbool.h> + +/** +* env_complete() - return an auto-complete for environment variables +* +* @var: partial name to auto-complete +* @maxv: Maximum number of matches to return +* @cmdv: Returns a list of possible matches +* @maxsz: Size of buffer to use for matches +* @buf: Buffer to use for matches +* @dollar_comp: non-zero to wrap each match in ${...} +* @return number of matches found (in @cmdv) +*/ +int env_complete (char *var,int maxv,char *cmdv[],int maxsz,char *buf, +bool dollar_comp); + +#endif
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 5/39 env: Create a new file for environment functions
Quoted 5 lines · Simon Glass
At present we have
environment.hbut this file includes all the environment-related header files as well as internals such asdefault_environment.
Quoted 7 lines
It seems desirable to have a new header to hold the commonly used environment functions, so that most files can avoid including all of this unnecessary stuff.
Create a new
env.hheader and move one function over to it.Signed-off-by Simon Glass <[email protected]>
PATCH 6/39 env: Move get_env_id() to env.h
In reply to Simon GlassMove this function over to the new header file. Also rename it to have an env_ prefix like the other functions.
---
cmd/nvedit.c | 5 +++-- drivers/net/netconsole.c | 5 +++-- include/common.h | 2 -- include/env.h | 10 ++++++++++ net/eth_common.c | 3 ++- 5 files changed, 18 insertions(+), 7 deletions(-)
cmd/nvedit.c +3 -2
@@ -27,6 +27,7 @@#include <cli.h> #include <command.h> #include <console.h> +#include <env.h> #include <environment.h> #include <search.h> #include <errno.h>
@@ -69,14 +70,14 @@ NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE/* * This variable is incremented on each do_env_set(), so it can -* be used via get_env_id() as an indication, if the environment +* be used via env_get_id() as an indication, if the environment * has changed or not. So it is possible to reread an environment * variable only if the environment was changed ... done so for * example in NetInitLoop() */ static int env_id =1 ; -int get_env_id (void ) +int env_get_id (void ) {return env_id; }
drivers/net/netconsole.c +3 -2
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <stdio_dev.h> #include <net.h>
@@ -55,7 +56,7 @@ static int is_broadcast(struct in_addr ip)static struct in_addr netmask;static struct in_addr our_ip;static int env_changed_id; -int env_id =get_env_id (); +int env_id =env_get_id ();/* update only when the environment has changed */ if (env_changed_id != env_id) {
@@ -75,7 +76,7 @@ static int refresh_settings_from_env(void) {const char *p;static int env_changed_id; -int env_id =get_env_id (); +int env_id =env_get_id ();/* update only when the environment has changed */ if (env_changed_id != env_id) {
include/common.h +0 -2
@@ -247,8 +247,6 @@ static inline int env_set_addr(const char *varname, const void *addr)return env_set_hex (varname, (ulong )addr); } -int get_env_id (void ); -void pci_init_board (void );/* common/exports.c */
include/env.h +10 -0
@@ -11,6 +11,16 @@#include <stdbool.h> +/** +* env_get_id() - Gets a sequence number for the environment +* +* This value increments every time the environment changes, so can be used an +* an indication of this +* +* @return environment ID +*/ +int env_get_id (void ); +/** * env_complete() - return an auto-complete for environment variables *
net/eth_common.c +2 -1
@@ -7,6 +7,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <miiphy.h> #include <net.h>
@@ -110,7 +111,7 @@ void eth_set_current(void)static int env_changed_id;int env_id; - env_id =get_env_id (); + env_id =env_get_id ();if ((act ==NULL ) || (env_changed_id != env_id)) { act =env_get ("ethact" ); env_changed_id = env_id;
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 6/39 env: Move get_env_id() to env.h
Quoted 5 lines · Simon Glass
Move this function over to the new header file. Also rename it to have an
env_prefix like the other functions.Signed-off-by Simon Glass <[email protected]>
PATCH 7/39 env: Move env_get_f() to env.h
In reply to Simon GlassMove this function over to the new header file.
---
arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 1 + arch/powerpc/cpu/mpc85xx/cpu_init.c | 1 + arch/powerpc/cpu/mpc85xx/fdt.c | 1 + arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c | 1 + board/esd/meesc/meesc.c | 1 + board/freescale/b4860qds/b4860qds.c | 1 + board/freescale/mpc837xerdb/mpc837xerdb.c | 1 + board/liebherr/mccmon6/mccmon6.c | 1 + board/micronas/vct/vct.c | 1 + board/socrates/socrates.c | 1 + board/st/stm32mp1/stm32mp1.c | 1 + board/xes/common/board.c | 1 + cmd/mtdparts.c | 1 + drivers/ddr/fsl/fsl_ddr_gen4.c | 1 + drivers/ddr/fsl/interactive.c | 1 + drivers/ddr/fsl/options.c | 1 + drivers/mtd/cfi_flash.c | 1 + drivers/mtd/mtd_uboot.c | 1 + drivers/net/fm/b4860.c | 1 + include/common.h | 12 ------------ include/env.h | 12 ++++++++++++ post/post.c | 1 + 22 files changed, 32 insertions(+), 12 deletions(-)
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <fsl_ddr_sdram.h> #include <asm/io.h> #include <linux/errno.h>
arch/powerpc/cpu/mpc85xx/cpu_init.c +1 -0
@@ -10,6 +10,7 @@*/ #include <common.h> +#include <env.h> #include <watchdog.h> #include <asm/processor.h> #include <ioports.h>
arch/powerpc/cpu/mpc85xx/fdt.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <linux/libfdt.h> #include <fdt_support.h>
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8 #include <hwconfig.h> #endif
board/esd/meesc/meesc.c +1 -0
@@ -10,6 +10,7 @@*/ #include <common.h> +#include <env.h> #include <asm/io.h> #include <asm/gpio.h> #include <asm/mach-types.h>
board/freescale/b4860qds/b4860qds.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <i2c.h> #include <netdev.h> #include <linux/compiler.h>
board/freescale/mpc837xerdb/mpc837xerdb.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <env.h> #include <hwconfig.h> #include <i2c.h> #include <asm/io.h>
board/liebherr/mccmon6/mccmon6.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <asm/arch/clock.h> #include <asm/arch/iomux.h> #include <asm/arch/imx-regs.h>
board/micronas/vct/vct.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <netdev.h> #include <asm/mipsregs.h> #include "vct.h"
board/socrates/socrates.c +1 -0
@@ -11,6 +11,7 @@*/ #include <common.h> +#include <env.h> #include <pci.h> #include <asm/processor.h> #include <asm/immap_85xx.h>
board/st/stm32mp1/stm32mp1.c +1 -0
@@ -8,6 +8,7 @@#include <config.h> #include <clk.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <g_dnl.h> #include <generic-phy.h>
board/xes/common/board.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include "fsl_8xxx_misc.h" int checkboard (void )
cmd/mtdparts.c +1 -0
@@ -72,6 +72,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <malloc.h> #include <jffs2/load_kernel.h> #include <linux/list.h>
drivers/ddr/fsl/fsl_ddr_gen4.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <asm/io.h> #include <fsl_ddr_sdram.h> #include <asm/processor.h>
drivers/ddr/fsl/interactive.c +1 -0
@@ -13,6 +13,7 @@#include <common.h> #include <cli.h> +#include <env.h> #include <linux/ctype.h> #include <asm/types.h> #include <asm/io.h>
drivers/ddr/fsl/options.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <hwconfig.h> #include <fsl_ddr_sdram.h>
drivers/mtd/cfi_flash.c +1 -0
@@ -19,6 +19,7 @@#include <common.h> #include <console.h> #include <dm.h> +#include <env.h> #include <errno.h> #include <fdt_support.h> #include <asm/processor.h>
drivers/mtd/mtd_uboot.c +1 -0
@@ -4,6 +4,7 @@* Heiko Schocher, DENX Software Engineering, hs at denx.de. */ #include <common.h> +#include <env.h> #include <dm/device.h> #include <dm/uclass-internal.h> #include <jffs2/jffs2.h> /* LEGACY */
drivers/net/fm/b4860.c +1 -0
@@ -4,6 +4,7 @@* Roy Zang <[email protected]> */ #include <common.h> +#include <env.h> #include <phy.h> #include <fm_eth.h> #include <asm/io.h>
include/common.h +0 -12
@@ -162,18 +162,6 @@ int envmatch (uchar *, int);*/ char *env_get (const char *varname); -/** -* env_get_f() - Look up the value of an environment variable (early) -* -* This function is called from env_get() if the environment has not been -* loaded yet (GD_FLG_ENV_READY flag is 0). Some environment locations will -* support reading the value (slowly) and some will not. -* -* @varname: Variable to look up -* @return value of variable, or NULL if not found -*/ -int env_get_f (const char *name,char *buf,unsigned len); -/** * env_get_ulong() - Return an environment variable as an integer value *
include/env.h +12 -0
@@ -21,6 +21,18 @@*/ int env_get_id (void ); +/** +* env_get_f() - Look up the value of an environment variable (early) +* +* This function is called from env_get() if the environment has not been +* loaded yet (GD_FLG_ENV_READY flag is 0). Some environment locations will +* support reading the value (slowly) and some will not. +* +* @varname: Variable to look up +* @return value of variable, or NULL if not found +*/ +int env_get_f (const char *name,char *buf,unsigned int len); +/** * env_complete() - return an auto-complete for environment variables *
post/post.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <stdio_dev.h> #include <watchdog.h> #include <div64.h>
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 7/39 env: Move env_get_f() to env.h
Quoted 4 lines · Simon Glass
Move this function over to the new header file.
Signed-off-by Simon Glass <[email protected]>
PATCH 8/39 env: Move env_init() to env.h
In reply to Simon GlassMove env_init() over to the new header file.
---
arch/arm/cpu/armv8/fsl-layerscape/spl.c | 1 + arch/mips/lib/bootm.c | 1 + board/Arcturus/ucp1020/spl.c | 1 + board/birdland/bav335x/board.c | 1 + board/freescale/b4860qds/spl.c | 1 + board/freescale/p1010rdb/spl.c | 1 + board/freescale/p1022ds/spl.c | 1 + board/freescale/p1_p2_rdb_pc/spl.c | 1 + board/gateworks/gw_ventana/gw_ventana_spl.c | 1 + board/liebherr/display5/spl.c | 1 + board/tcl/sl50/board.c | 1 + board/ti/am335x/board.c | 1 + board/ti/am57xx/board.c | 1 + board/ti/dra7xx/evm.c | 1 + common/board_f.c | 1 + common/spl/spl_net.c | 1 + env/env.c | 1 + include/common.h | 1 - include/env.h | 10 ++++++++++ 19 files changed, 27 insertions(+), 1 deletion(-)
arch/arm/cpu/armv8/fsl-layerscape/spl.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <spl.h> #include <asm/io.h> #include <fsl_ifc.h>
arch/mips/lib/bootm.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <image.h> #include <fdt_support.h> #include <asm/addrspace.h>
board/Arcturus/ucp1020/spl.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <console.h> +#include <env.h> #include <environment.h> #include <ns16550.h> #include <malloc.h>
board/birdland/bav335x/board.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <spl.h> #include <asm/arch/cpu.h>
board/freescale/b4860qds/spl.c +1 -0
@@ -4,6 +4,7 @@#include <common.h> #include <console.h> +#include <env.h> #include <environment.h> #include <asm/spl.h> #include <malloc.h>
board/freescale/p1010rdb/spl.c +1 -0
@@ -4,6 +4,7 @@#include <common.h> #include <console.h> +#include <env.h> #include <environment.h> #include <ns16550.h> #include <malloc.h>
board/freescale/p1022ds/spl.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <console.h> +#include <env.h> #include <environment.h> #include <ns16550.h> #include <malloc.h>
board/freescale/p1_p2_rdb_pc/spl.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <console.h> +#include <env.h> #include <environment.h> #include <ns16550.h> #include <malloc.h>
board/gateworks/gw_ventana/gw_ventana_spl.c +1 -0
@@ -13,6 +13,7 @@#include <asm/mach-imx/boot_mode.h> #include <asm/mach-imx/iomux-v3.h> #include <asm/mach-imx/mxc_i2c.h> +#include <env.h> #include <environment.h> #include <i2c.h> #include <spl.h>
board/liebherr/display5/spl.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <spl.h> #include <linux/libfdt.h> #include <asm/io.h>
board/tcl/sl50/board.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <spl.h> #include <asm/arch/cpu.h>
board/ti/am335x/board.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <errno.h> #include <spl.h> #include <serial.h>
board/ti/am57xx/board.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <palmas.h> #include <sata.h> #include <usb.h>
board/ti/dra7xx/evm.c +1 -0
@@ -10,6 +10,7 @@* Steve Sakoman <[email protected]> */ #include <common.h> +#include <env.h> #include <palmas.h> #include <sata.h> #include <linux/string.h>
common/board_f.c +1 -0
@@ -14,6 +14,7 @@#include <console.h> #include <cpu.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <fdtdec.h> #include <fs.h>
common/spl/spl_net.c +1 -0
@@ -7,6 +7,7 @@* Ilya Yanok <[email protected]> */ #include <common.h> +#include <env.h> #include <errno.h> #include <spl.h> #include <net.h>
env/env.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> DECLARE_GLOBAL_DATA_PTR ;
include/common.h +0 -1
@@ -146,7 +146,6 @@ int do_fat_fsload(cmd_tbl_t *, int, int, char * const []);int do_ext2load (cmd_tbl_t *,int ,int ,char *const []);/* common/cmd_nvedit.c */ -int env_init (void );void env_relocate (void );int envmatch (uchar *,int );
include/env.h +10 -0
@@ -21,6 +21,16 @@*/ int env_get_id (void ); +/** +* env_init() - Set up the pre-relocation environment +* +* This locates the environment or uses the default if nothing is available. +* This must be called before env_get() will work. +* +* @return 0 if OK, -ENODEV if no environment drivers are enabled +*/ +int env_init (void ); +/** * env_get_f() - Look up the value of an environment variable (early) *
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 8/39 env: Move env_init() to env.h
Quoted 4 lines · Simon Glass
Move
env_init()over to the new header file.Signed-off-by Simon Glass <[email protected]>
PATCH 9/39 env: Move env_relocate() to env.h
In reply to Simon GlassMove env_relocate() over to the new header file.
---
common/board_r.c | 1 + env/common.c | 1 + include/common.h | 1 - include/env.h | 8 ++++++++ 4 files changed, 10 insertions(+), 1 deletion(-)
common/board_r.c +1 -0
@@ -18,6 +18,7 @@#include <command.h> #include <console.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <fdtdec.h> #include <ide.h>
env/common.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <linux/stddef.h> #include <search.h>
include/common.h +0 -1
@@ -146,7 +146,6 @@ int do_fat_fsload(cmd_tbl_t *, int, int, char * const []);int do_ext2load (cmd_tbl_t *,int ,int ,char *const []);/* common/cmd_nvedit.c */ -void env_relocate (void );int envmatch (uchar *,int );/**
include/env.h +8 -0
@@ -31,6 +31,14 @@ int env_get_id(void);*/ int env_init (void ); +/** +* env_relocate() - Set up the post-relocation environment +* +* This loads the environment into RAM so that it can be modified. This is +* called after relocation, before the environment is used +*/ +void env_relocate (void ); +/** * env_get_f() - Look up the value of an environment variable (early) *
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 9/39 env: Move env_relocate() to env.h
Quoted 4 lines · Simon Glass
Move
env_relocate()over to the new header file.Signed-off-by Simon Glass <[email protected]>
PATCH 10/39 env: Move envmatch() to env.h
In reply to Simon GlassMove envmatch() over to the new header file. Also rename it to env_match() to better line up with other functions.
---
cmd/nvedit.c | 12 ++---------- examples/api/glue.c | 3 ++- include/common.h | 3 --- include/env.h | 11 +++++++++++ 4 files changed, 15 insertions(+), 14 deletions(-)
cmd/nvedit.c +2 -10
@@ -709,7 +709,7 @@ int env_get_f(const char *name, char *buf, unsigned len)return -1 ; } - val =envmatch ((uchar *)name, i); + val =env_match ((uchar *)name, i);if (val <0 )continue ;
@@ -785,15 +785,7 @@ U_BOOT_CMD(#endif #endif /* CONFIG_SPL_BUILD */ - -/* -* Match a name / name=value pair -* -* s1 is either a simple 'name', or a 'name=value' pair. -* i2 is the environment index for a 'name2=value2' pair. -* If the names match, return the index for the value2, else -1. -*/ -int envmatch (uchar *s1,int i2) +int env_match (uchar *s1,int i2) {if (s1 ==NULL )return -1 ;
examples/api/glue.c +2 -1
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <linux/types.h> #include <api_public.h>
@@ -365,7 +366,7 @@ const char * ub_env_enum(const char *last)/* * It's OK to pass only the name piece as last (and not the whole -* 'name=val' string), since the API_ENUM_ENV call uses envmatch() +* 'name=val' string), since the API_ENUM_ENV call uses env_match() * internally, which handles such case */ if (!syscall (API_ENV_ENUM ,NULL , last, &env))
include/common.h +0 -3
@@ -145,9 +145,6 @@ int do_fat_fsload(cmd_tbl_t *, int, int, char * const []);/* common/cmd_ext2.c */ int do_ext2load (cmd_tbl_t *,int ,int ,char *const []); -/* common/cmd_nvedit.c */ -int envmatch (uchar *,int ); -/** * env_get() - Look up the value of an environment variable *
include/env.h +11 -0
@@ -39,6 +39,17 @@ int env_init(void);*/ void env_relocate (void ); +/** +* env_match() - Match a name / name=value pair +* +* This is used prior to relocation for finding envrionment variables +* +* @name: A simple 'name', or a 'name=value' pair. +* @index: The environment index for a 'name2=value2' pair. +* @return index for the value if the names match, else -1. +*/ +int env_match (unsigned char *name,int index); +/** * env_get_f() - Look up the value of an environment variable (early) *
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 10/39 env: Move envmatch() to env.h
Quoted 5 lines · Simon Glass
Move
envmatch()over to the new header file. Also rename it toenv_match()to better line up with other functions.Signed-off-by Simon Glass <[email protected]>
PATCH 11/39 env: Move env_set_hex() to env.h
In reply to Simon GlassMove env_set_hex() over to the new header file along with env_set_addr() which uses it.
---
api/api.c | 1 + arch/arm/mach-tegra/cboot.c | 1 + arch/arm/mach-uniphier/board_late_init.c | 1 + board/BuR/common/common.c | 1 + board/boundary/nitrogen6x/nitrogen6x.c | 1 + board/broadcom/bcmstb/bcmstb.c | 1 + board/emulation/qemu-riscv/qemu-riscv.c | 1 + board/freescale/qemu-ppce500/qemu-ppce500.c | 1 + board/raspberrypi/rpi/rpi.c | 1 + board/sunxi/board.c | 1 + board/xilinx/zynqmp/cmds.c | 1 + cmd/cbfs.c | 1 + cmd/cramfs.c | 1 + cmd/fdt.c | 1 + cmd/jffs2.c | 1 + cmd/load.c | 1 + cmd/lzmadec.c | 1 + cmd/nand.c | 1 + cmd/reiser.c | 1 + cmd/setexpr.c | 1 + cmd/spl.c | 1 + cmd/tpm-v1.c | 1 + cmd/trace.c | 1 + cmd/ubi.c | 1 + cmd/unzip.c | 1 + cmd/ximg.c | 1 + cmd/zfs.c | 1 + cmd/zip.c | 1 + common/autoboot.c | 1 + common/bootm.c | 1 + common/bootm_os.c | 1 + drivers/fastboot/fb_command.c | 1 + drivers/net/fm/fm.c | 1 + drivers/usb/gadget/f_sdp.c | 1 + fs/fs.c | 1 + fs/ubifs/ubifs.c | 1 + include/common.h | 21 -------------------- include/env.h | 22 +++++++++++++++++++++ net/net.c | 1 + 39 files changed, 59 insertions(+), 21 deletions(-)
api/api.c +1 -0
@@ -8,6 +8,7 @@#include <config.h> #include <command.h> #include <common.h> +#include <env.h> #include <malloc.h> #include <environment.h> #include <linux/types.h>
arch/arm/mach-tegra/cboot.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <fdt_support.h> #include <fdtdec.h>
arch/arm/mach-uniphier/board_late_init.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <env.h> #include <spl.h> #include <linux/libfdt.h> #include <nand.h>
board/BuR/common/common.c +1 -0
@@ -10,6 +10,7 @@*/ #include <version.h> #include <common.h> +#include <env.h> #include <fdtdec.h> #include <i2c.h> #include <lcd.h>
board/boundary/nitrogen6x/nitrogen6x.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <asm/io.h> #include <asm/arch/clock.h> #include <asm/arch/imx-regs.h>
board/broadcom/bcmstb/bcmstb.c +1 -0
@@ -8,6 +8,7 @@#include <linux/types.h> #include <common.h> +#include <env.h> #include <asm/io.h> #include <asm/bootm.h> #include <mach/timer.h>
board/emulation/qemu-riscv/qemu-riscv.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <fdtdec.h> #include <virtio_types.h> #include <virtio.h>
board/freescale/qemu-ppce500/qemu-ppce500.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <pci.h> #include <asm/processor.h> #include <asm/mmu.h>
board/raspberrypi/rpi/rpi.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <config.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <efi_loader.h> #include <fdt_support.h>
board/sunxi/board.c +1 -0
@@ -12,6 +12,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <mmc.h> #include <axp_pmic.h> #include <generic-phy.h>
board/xilinx/zynqmp/cmds.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <malloc.h> #include <asm/arch/hardware.h> #include <asm/arch/sys_proto.h>
cmd/cbfs.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> #include <command.h> +#include <env.h> #include <cbfs.h> static int do_cbfs_init(cmd_tbl_t *cmdtp, int flag, int argc,
cmd/cramfs.c +1 -0
@@ -12,6 +12,7 @@*/ #include <common.h> #include <command.h> +#include <env.h> #include <malloc.h> #include <mapmem.h> #include <linux/list.h>
cmd/fdt.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <linux/ctype.h> #include <linux/types.h> #include <asm/global_data.h>
cmd/jffs2.c +1 -0
@@ -72,6 +72,7 @@*/ #include <common.h> #include <command.h> +#include <env.h> #include <malloc.h> #include <jffs2/jffs2.h> #include <linux/list.h>
cmd/load.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <command.h> #include <console.h> +#include <env.h> #include <s_record.h> #include <net.h> #include <exports.h>
cmd/lzmadec.c +1 -0
@@ -11,6 +11,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <mapmem.h> #include <asm/io.h>
cmd/nand.c +1 -0
@@ -23,6 +23,7 @@#include <linux/mtd/mtd.h> #include <command.h> #include <console.h> +#include <env.h> #include <watchdog.h> #include <malloc.h> #include <asm/byteorder.h>
cmd/reiser.c +1 -0
@@ -11,6 +11,7 @@#include <common.h> #include <config.h> #include <command.h> +#include <env.h> #include <image.h> #include <linux/ctype.h> #include <asm/byteorder.h>
cmd/setexpr.c +1 -0
@@ -11,6 +11,7 @@#include <common.h> #include <config.h> #include <command.h> +#include <env.h> #include <mapmem.h> static ulong get_arg (char *s,int w)
cmd/spl.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <command.h> #include <cmd_spl.h> +#include <env.h> #include <linux/libfdt.h> DECLARE_GLOBAL_DATA_PTR ;
cmd/tpm-v1.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <malloc.h> #include <asm/unaligned.h> #include <tpm-common.h>
cmd/trace.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <mapmem.h> #include <trace.h> #include <asm/io.h>
cmd/ubi.c +1 -0
@@ -13,6 +13,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <exports.h> #include <memalign.h> #include <mtd.h>
cmd/unzip.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <gzip.h> static int do_unzip (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[])
cmd/ximg.c +1 -0
@@ -13,6 +13,7 @@*/ #include <common.h> #include <command.h> +#include <env.h> #include <gzip.h> #include <image.h> #include <mapmem.h>
cmd/zfs.c +1 -0
@@ -12,6 +12,7 @@#include <part.h> #include <config.h> #include <command.h> +#include <env.h> #include <image.h> #include <linux/ctype.h> #include <asm/byteorder.h>
cmd/zip.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> +#include <env.h> static int do_zip (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {
common/autoboot.c +1 -0
@@ -9,6 +9,7 @@#include <bootretry.h> #include <cli.h> #include <console.h> +#include <env.h> #include <fdtdec.h> #include <menu.h> #include <post.h>
common/bootm.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <bootstage.h> #include <bzlib.h> +#include <env.h> #include <errno.h> #include <fdt_support.h> #include <gzip.h>
common/bootm_os.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <bootm.h> +#include <env.h> #include <fdt_support.h> #include <linux/libfdt.h> #include <malloc.h>
drivers/fastboot/fb_command.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <fastboot.h> #include <fastboot-internal.h> #include <fb_mmc.h>
drivers/net/fm/fm.c +1 -0
@@ -4,6 +4,7 @@* Dave Liu <[email protected]> */ #include <common.h> +#include <env.h> #include <malloc.h> #include <asm/io.h> #include <linux/errno.h>
drivers/usb/gadget/f_sdp.c +1 -0
@@ -19,6 +19,7 @@#include <errno.h> #include <common.h> #include <console.h> +#include <env.h> #include <malloc.h> #include <linux/usb/ch9.h>
fs/fs.c +1 -0
@@ -6,6 +6,7 @@#include <config.h> #include <errno.h> #include <common.h> +#include <env.h> #include <mapmem.h> #include <part.h> #include <ext4fs.h>
fs/ubifs/ubifs.c +1 -0
@@ -12,6 +12,7 @@*/ #include <common.h> +#include <env.h> #include <gzip.h> #include <memalign.h> #include "ubifs.h"
include/common.h +0 -21
@@ -209,27 +209,6 @@ int env_set(const char *varname, const char *value);*/ int env_set_ulong (const char *varname,ulong value); -/** -* env_set_hex() - set an environment variable to a hex value -* -* @varname: Variable to adjust -* @value: Value to set for the variable (will be converted to a hex string) -* @return 0 if OK, 1 on error -*/ -int env_set_hex (const char *varname,ulong value); - -/** -* env_set_addr - Set an environment variable to an address in hex -* -* @varname: Environment variable to set -* @addr: Value to set it to -* @return 0 if ok, 1 on error -*/ -static inline int env_set_addr (const char *varname,const void *addr) -{ -return env_set_hex (varname, (ulong )addr); -} -void pci_init_board (void );/* common/exports.c */
include/env.h +22 -0
@@ -10,6 +10,7 @@#define __ENV_H#include <stdbool.h> +#include <linux/types.h> /** * env_get_id() - Gets a sequence number for the environment
@@ -62,6 +63,27 @@ int env_match(unsigned char *name, int index);*/ int env_get_f (const char *name,char *buf,unsigned int len); +/** +* env_set_hex() - set an environment variable to a hex value +* +* @varname: Variable to adjust +* @value: Value to set for the variable (will be converted to a hex string) +* @return 0 if OK, 1 on error +*/ +int env_set_hex (const char *varname,ulong value); + +/** +* env_set_addr - Set an environment variable to an address in hex +* +* @varname: Environment variable to set +* @addr: Value to set it to +* @return 0 if ok, 1 on error +*/ +static inline int env_set_addr (const char *varname,const void *addr) +{ +return env_set_hex (varname, (ulong )addr); +} +/** * env_complete() - return an auto-complete for environment variables *
net/net.c +1 -0
@@ -90,6 +90,7 @@#include <common.h> #include <command.h> #include <console.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <net.h>
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 11/39 env: Move env_set_hex() to env.h
Quoted 5 lines · Simon Glass
Move
env_set_hex()over to the new header file along withenv_set_addr()which uses it.Signed-off-by Simon Glass <[email protected]>
PATCH 12/39 env: Move env_set_ulong() to env.h
In reply to Simon GlassMove env_set_ulong() over to the new header file.
---
arch/arm/mach-uniphier/mmc-first-dev.c | 1 + board/BuR/brppt1/board.c | 1 + board/BuR/common/br_resetc.c | 1 + board/CZ.NIC/turris_omnia/turris_omnia.c | 1 + board/engicam/common/board.c | 1 + board/gdsys/mpc8308/gazerbeam.c | 1 + board/grinn/liteboard/board.c | 1 + board/imgtec/ci20/ci20.c | 1 + board/synopsys/hsdk/hsdk.c | 1 + board/warp7/warp7.c | 1 + cmd/tpm-common.c | 1 + drivers/bootcount/bootcount_env.c | 1 + drivers/scsi/scsi.c | 1 + include/bootcount.h | 1 + include/common.h | 9 --------- include/env.h | 9 +++++++++ 16 files changed, 23 insertions(+), 9 deletions(-)
arch/arm/mach-uniphier/mmc-first-dev.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <mmc.h> #include <linux/errno.h>
board/BuR/brppt1/board.c +1 -0
@@ -10,6 +10,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <spl.h> #include <asm/arch/cpu.h>
board/BuR/common/br_resetc.c +1 -0
@@ -6,6 +6,7 @@* B&R Industrial Automation GmbH - http://www.br-automation.com/ * */ #include <common.h> +#include <env.h> #include <errno.h> #include <i2c.h> #include <dm/uclass.h>
board/CZ.NIC/turris_omnia/turris_omnia.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <i2c.h> #include <miiphy.h>
board/engicam/common/board.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <env.h> #include <mmc.h> #include <asm/arch/sys_proto.h> #include <watchdog.h>
board/gdsys/mpc8308/gazerbeam.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <board.h> #include <dm.h> +#include <env.h> #include <fdt_support.h> #include <fsl_esdhc.h> #include <miiphy.h>
board/grinn/liteboard/board.c +1 -0
@@ -17,6 +17,7 @@#include <asm/mach-imx/boot_mode.h> #include <asm/io.h> #include <common.h> +#include <env.h> #include <fsl_esdhc_imx.h> #include <linux/sizes.h> #include <linux/fb.h>
board/imgtec/ci20/ci20.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <net.h> #include <netdev.h>
board/synopsys/hsdk/hsdk.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <config.h> +#include <env.h> #include <linux/printk.h> #include <linux/kernel.h> #include <linux/io.h>
board/warp7/warp7.c +1 -0
@@ -13,6 +13,7 @@#include <asm/mach-imx/iomux-v3.h> #include <asm/io.h> #include <common.h> +#include <env.h> #include <asm/arch/crm_regs.h> #include <netdev.h> #include <power/pmic.h>
cmd/tpm-common.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> #include <dm.h> +#include <env.h> #include <asm/unaligned.h> #include <linux/string.h> #include <tpm-common.h>
drivers/bootcount/bootcount_env.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> void bootcount_store (ulong a)
drivers/scsi/scsi.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <pci.h> #include <scsi.h> #include <dm/device-internal.h>
include/bootcount.h +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <asm/io.h> #include <asm/byteorder.h> +#include <env.h> #ifdef CONFIG_DM_BOOTCOUNT
include/common.h +0 -9
@@ -200,15 +200,6 @@ int env_get_yesno(const char *var);*/ int env_set (const char *varname,const char *value); -/** -* env_set_ulong() - set an environment variable to an integer -* -* @varname: Variable to adjust -* @value: Value to set for the variable (will be converted to a string) -* @return 0 if OK, 1 on error -*/ -int env_set_ulong (const char *varname,ulong value); -void pci_init_board (void );/* common/exports.c */
include/env.h +9 -0
@@ -63,6 +63,15 @@ int env_match(unsigned char *name, int index);*/ int env_get_f (const char *name,char *buf,unsigned int len); +/** +* env_set_ulong() - set an environment variable to an integer +* +* @varname: Variable to adjust +* @value: Value to set for the variable (will be converted to a string) +* @return 0 if OK, 1 on error +*/ +int env_set_ulong (const char *varname,ulong value); +/** * env_set_hex() - set an environment variable to a hex value *
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 12/39 env: Move env_set_ulong() to env.h
Quoted 4 lines · Simon Glass
Move
env_set_ulong()over to the new header file.Signed-off-by Simon Glass <[email protected]>
PATCH 13/39 env: Move env_get_ulong() to env.h
In reply to Simon GlassMove env_get_ulong() over to the new header file.
---
board/BuR/brxre1/board.c | 1 + board/gdsys/p1022/controlcenterd-id.c | 1 + board/synopsys/hsdk/env-lib.c | 1 + board/ti/ks2_evm/board_k2g.c | 1 + board/toradex/colibri_imx6/colibri_imx6.c | 1 + include/common.h | 13 ------------- include/env.h | 13 +++++++++++++ lib/fdtdec.c | 1 + net/bootp.c | 1 + 9 files changed, 20 insertions(+), 13 deletions(-)
board/BuR/brxre1/board.c +1 -0
@@ -9,6 +9,7 @@* */ #include <common.h> +#include <env.h> #include <errno.h> #include <spl.h> #include <asm/arch/cpu.h>
board/gdsys/p1022/controlcenterd-id.c +1 -0
@@ -12,6 +12,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <malloc.h> #include <fs.h> #include <i2c.h>
board/synopsys/hsdk/env-lib.c +1 -0
@@ -5,6 +5,7 @@*/ #include "env-lib.h" +#include <env.h> #define MAX_CMD_LEN 25
board/ti/ks2_evm/board_k2g.c +1 -0
@@ -6,6 +6,7 @@* Texas Instruments Incorporated, <www.ti.com> */ #include <common.h> +#include <env.h> #include <asm/arch/clock.h> #include <asm/ti-common/keystone_net.h> #include <asm/arch/psc_defs.h>
board/toradex/colibri_imx6/colibri_imx6.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <asm/arch/clock.h> #include <asm/arch/crm_regs.h>
include/common.h +0 -13
@@ -157,19 +157,6 @@ int do_ext2load(cmd_tbl_t *, int, int, char * const []);*/ char *env_get (const char *varname); -/** -* env_get_ulong() - Return an environment variable as an integer value -* -* Most U-Boot environment variables store hex values. For those which store -* (e.g.) base-10 integers, this function can be used to read the value. -* -* @name: Variable to look up -* @base: Base to use (e.g. 10 for base 10, 2 for binary) -* @default_val: Default value to return if no value is found -* @return the value found, or @default_val if none -*/ -ulong env_get_ulong (const char *name,int base,ulong default_val); -/** * env_get_hex() - Return an environment variable as a hex value *
include/env.h +13 -0
@@ -63,6 +63,19 @@ int env_match(unsigned char *name, int index);*/ int env_get_f (const char *name,char *buf,unsigned int len); +/** +* env_get_ulong() - Return an environment variable as an integer value +* +* Most U-Boot environment variables store hex values. For those which store +* (e.g.) base-10 integers, this function can be used to read the value. +* +* @name: Variable to look up +* @base: Base to use (e.g. 10 for base 10, 2 for binary) +* @default_val: Default value to return if no value is found +* @return the value found, or @default_val if none +*/ +ulong env_get_ulong (const char *name,int base,ulong default_val); +/** * env_set_ulong() - set an environment variable to an integer *
lib/fdtdec.c +1 -0
@@ -8,6 +8,7 @@#include <boot_fit.h> #include <dm.h> #include <dm/of_extra.h> +#include <env.h> #include <errno.h> #include <fdtdec.h> #include <fdt_support.h>
net/bootp.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <efi_loader.h> #include <net.h> #include <net/tftp.h>
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 13/39 env: Move env_get_ulong() to env.h
Quoted 4 lines · Simon Glass
Move
env_get_ulong()over to the new header file.Signed-off-by Simon Glass <[email protected]>
PATCH 14/39 env: Move env_get_yesno() to env.h
In reply to Simon GlassMove env_get_yesno() over to the new header file.
---
arch/powerpc/cpu/mpc85xx/mp.c | 1 + board/gateworks/gw_ventana/gw_ventana_spl.c | 1 + cmd/source.c | 1 + include/common.h | 6 ------ include/env.h | 8 ++++++++ 5 files changed, 11 insertions(+), 6 deletions(-)
arch/powerpc/cpu/mpc85xx/mp.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <asm/processor.h> #include <ioports.h> #include <lmb.h>
board/gateworks/gw_ventana/gw_ventana_spl.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <asm/io.h> #include <asm/arch/crm_regs.h> #include <asm/arch/mx6-ddr.h>
cmd/source.c +1 -0
@@ -16,6 +16,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <image.h> #include <malloc.h> #include <mapmem.h>
include/common.h +0 -6
@@ -169,12 +169,6 @@ char *env_get(const char *varname);*/ ulong env_get_hex (const char *varname,ulong default_val); -/* -* Read an environment variable as a boolean -* Return -1 if variable does not exist (default to true) -*/ -int env_get_yesno (const char *var); -/** * env_set() - set an environment variable *
include/env.h +8 -0
@@ -63,6 +63,14 @@ int env_match(unsigned char *name, int index);*/ int env_get_f (const char *name,char *buf,unsigned int len); +/** +* env_get_yesno() - Read an environment variable as a boolean +* +* @return 1 if yes/true (Y/y/T/t), -1 if variable does not exist (i.e. default +* to true), 0 if otherwise +*/ +int env_get_yesno (const char *var); +/** * env_get_ulong() - Return an environment variable as an integer value *
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 14/39 env: Move env_get_yesno() to env.h
Quoted 4 lines · Simon Glass
Move
env_get_yesno()over to the new header file.Signed-off-by Simon Glass <[email protected]>
PATCH 15/39 env: Move env_get_hex() to env.h
In reply to Simon GlassMove env_get_hex() over to the new header file.
---
arch/x86/lib/zimage.c | 1 + cmd/elf.c | 1 + common/image-fdt.c | 1 + include/common.h | 12 ------------ include/env.h | 12 ++++++++++++ 5 files changed, 15 insertions(+), 12 deletions(-)
arch/x86/lib/zimage.c +1 -0
@@ -13,6 +13,7 @@*/ #include <common.h> +#include <env.h> #include <malloc.h> #include <asm/acpi_table.h> #include <asm/io.h>
cmd/elf.c +1 -0
@@ -16,6 +16,7 @@#include <common.h> #include <command.h> #include <elf.h> +#include <env.h> #include <environment.h> #include <net.h> #include <vxworks.h>
common/image-fdt.c +1 -0
@@ -11,6 +11,7 @@#include <common.h> #include <fdt_support.h> #include <fdtdec.h> +#include <env.h> #include <errno.h> #include <image.h> #include <linux/libfdt.h>
include/common.h +0 -12
@@ -157,18 +157,6 @@ int do_ext2load(cmd_tbl_t *, int, int, char * const []);*/ char *env_get (const char *varname); -/** -* env_get_hex() - Return an environment variable as a hex value -* -* Decode an environment as a hex number (it may or may not have a 0x -* prefix). If the environment variable cannot be found, or does not start -* with hex digits, the default value is returned. -* -* @varname: Variable to decode -* @default_val: Value to return on error -*/ -ulong env_get_hex (const char *varname,ulong default_val); -/** * env_set() - set an environment variable *
include/env.h +12 -0
@@ -93,6 +93,18 @@ ulong env_get_ulong(const char *name, int base, ulong default_val);*/ int env_set_ulong (const char *varname,ulong value); +/** +* env_get_hex() - Return an environment variable as a hex value +* +* Decode an environment as a hex number (it may or may not have a 0x +* prefix). If the environment variable cannot be found, or does not start +* with hex digits, the default value is returned. +* +* @varname: Variable to decode +* @default_val: Value to return on error +*/ +ulong env_get_hex (const char *varname,ulong default_val); +/** * env_set_hex() - set an environment variable to a hex value *
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 15/39 env: Move env_get_hex() to env.h
Quoted 4 lines · Simon Glass
Move
env_get_hex()over to the new header file.Signed-off-by Simon Glass <[email protected]>
PATCH 16/39 env: Move env_set() to env.h
In reply to Simon GlassMove env_set() over to the new header file.
---
arch/arm/cpu/arm926ejs/spear/spr_misc.c | 1 + arch/arm/cpu/armv7/vf610/generic.c | 1 + arch/arm/cpu/armv8/fsl-layerscape/soc.c | 1 + arch/arm/mach-davinci/misc.c | 1 + arch/arm/mach-imx/mx6/opos6ul.c | 1 + arch/arm/mach-imx/mx7/soc.c | 1 + arch/arm/mach-meson/board-common.c | 1 + arch/arm/mach-omap2/utils.c | 1 + arch/arm/mach-rmobile/cpu_info.c | 1 + arch/arm/mach-rockchip/rk3288-board.c | 1 + arch/arm/mach-socfpga/misc_gen5.c | 1 + arch/arm/mach-socfpga/misc_s10.c | 1 + arch/arm/mach-stm32mp/cpu.c | 1 + arch/arm/mach-tegra/board2.c | 1 + board/Arcturus/ucp1020/cmd_arc.c | 1 + board/Arcturus/ucp1020/ucp1020.c | 1 + board/CZ.NIC/turris_mox/turris_mox.c | 1 + board/LaCie/net2big_v2/net2big_v2.c | 1 + board/LaCie/netspace_v2/netspace_v2.c | 1 + board/Synology/ds414/cmd_syno.c | 1 + board/alliedtelesis/x530/x530.c | 1 + board/amazon/kc1/kc1.c | 1 + board/amlogic/p200/p200.c | 1 + board/amlogic/p201/p201.c | 1 + board/amlogic/p212/p212.c | 1 + board/amlogic/q200/q200.c | 1 + board/aristainetos/aristainetos-v2.c | 1 + board/armltd/integrator/integrator.c | 1 + board/atmel/common/board.c | 1 + board/atmel/common/mac_eeprom.c | 1 + board/atmel/sama5d3xek/sama5d3xek.c | 1 + board/bachmann/ot1200/ot1200.c | 1 + board/bosch/shc/board.c | 1 + board/buffalo/lsxl/lsxl.c | 1 + board/cadence/xtfpga/xtfpga.c | 1 + board/ccv/xpress/xpress.c | 1 + board/compulab/cl-som-imx7/cl-som-imx7.c | 1 + board/compulab/cm_fx6/cm_fx6.c | 1 + board/compulab/cm_t335/cm_t335.c | 1 + board/compulab/cm_t35/cm_t35.c | 1 + board/compulab/cm_t54/cm_t54.c | 1 + board/congatec/cgtqmx6eval/cgtqmx6eval.c | 1 + board/cssi/MCR3000/MCR3000.c | 1 + board/davinci/da8xxevm/da850evm.c | 1 + board/davinci/da8xxevm/omapl138_lcdk.c | 1 + board/dhelectronics/dh_imx6/dh_imx6.c | 1 + board/eets/pdu001/board.c | 1 + board/el/el6x/el6x.c | 1 + board/freescale/common/cmd_esbc_validate.c | 1 + board/freescale/common/fsl_chain_of_trust.c | 1 + board/freescale/common/sys_eeprom.c | 1 + board/freescale/imx8mq_evk/imx8mq_evk.c | 1 + board/freescale/imx8qm_mek/imx8qm_mek.c | 1 + board/freescale/imx8qxp_mek/imx8qxp_mek.c | 1 + board/freescale/ls2080ardb/ls2080ardb.c | 1 + board/freescale/mpc8323erdb/mpc8323erdb.c | 1 + board/freescale/mx53loco/mx53loco.c | 1 + board/freescale/mx6sabreauto/mx6sabreauto.c | 1 + board/freescale/mx6sabresd/mx6sabresd.c | 1 + board/freescale/mx6sxsabresd/mx6sxsabresd.c | 1 + board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c | 1 + board/freescale/mx6ullevk/mx6ullevk.c | 1 + board/gardena/smart-gateway-at91sam/board.c | 1 + board/gardena/smart-gateway-mt7688/board.c | 1 + board/gateworks/gw_ventana/gw_ventana.c | 1 + board/ge/bx50v3/bx50v3.c | 1 + board/ge/common/ge_common.c | 1 + board/ge/mx53ppd/mx53ppd.c | 1 + board/grinn/chiliboard/board.c | 1 + board/gumstix/pepper/board.c | 1 + board/highbank/highbank.c | 1 + board/intel/edison/edison.c | 1 + board/isee/igep003x/board.c | 1 + board/isee/igep00x0/igep00x0.c | 1 + board/k+p/kp_imx53/kp_id_rev.c | 1 + board/k+p/kp_imx53/kp_imx53.c | 1 + board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 1 + board/keymile/common/common.c | 1 + board/keymile/common/ivm.c | 1 + board/keymile/km83xx/km83xx.c | 1 + board/keymile/km_arm/km_arm.c | 1 + board/keymile/kmp204x/kmp204x.c | 1 + board/kosagi/novena/novena.c | 1 + board/laird/wb50n/wb50n.c | 1 + board/lg/sniper/sniper.c | 1 + board/liebherr/display5/display5.c | 1 + board/logicpd/imx6/imx6logic.c | 1 + board/logicpd/zoom1/zoom1.c | 1 + board/nokia/rx51/rx51.c | 1 + board/overo/overo.c | 1 + board/phytec/pcm051/board.c | 1 + board/phytec/pcm052/pcm052.c | 1 + board/phytec/pfla02/pfla02.c | 1 + board/phytec/phycore_rk3288/phycore-rk3288.c | 1 + board/qualcomm/dragonboard410c/dragonboard410c.c | 1 + board/qualcomm/dragonboard820c/dragonboard820c.c | 1 + board/renesas/blanche/blanche.c | 1 + board/renesas/sh7752evb/sh7752evb.c | 1 + board/renesas/sh7753evb/sh7753evb.c | 1 + board/renesas/sh7757lcr/sh7757lcr.c | 1 + board/rockchip/tinker_rk3288/tinker-rk3288.c | 1 + board/samsung/common/misc.c | 1 + board/samsung/trats/trats.c | 1 + board/samsung/universal_c210/universal.c | 1 + board/samtec/vining_fpga/socfpga.c | 1 + board/siemens/common/factoryset.c | 1 + board/siemens/draco/board.c | 1 + board/siemens/pxm2/board.c | 1 + board/siemens/rut/board.c | 1 + board/siemens/taurus/taurus.c | 1 + board/silica/pengwyn/board.c | 1 + board/softing/vining_2000/vining_2000.c | 1 + board/solidrun/mx6cuboxi/mx6cuboxi.c | 1 + board/technologic/ts4800/ts4800.c | 1 + board/theobroma-systems/puma_rk3399/puma-rk3399.c | 1 + board/ti/am43xx/board.c | 1 + board/ti/am65x/evm.c | 1 + board/ti/beagle/beagle.c | 1 + board/ti/common/board_detect.c | 1 + board/ti/evm/evm.c | 1 + board/ti/panda/panda.c | 1 + board/ti/ti814x/evm.c | 1 + board/ti/ti816x/evm.c | 1 + board/timll/devkit8000/devkit8000.c | 1 + board/toradex/apalis-imx8/apalis-imx8.c | 1 + board/toradex/apalis_imx6/apalis_imx6.c | 1 + board/toradex/colibri-imx6ull/colibri-imx6ull.c | 1 + board/toradex/colibri-imx8x/colibri-imx8x.c | 1 + board/toradex/colibri_vf/colibri_vf.c | 1 + board/toradex/common/tdx-common.c | 1 + board/tqc/tqma6/tqma6.c | 1 + board/udoo/neo/neo.c | 1 + board/udoo/udoo.c | 1 + board/varisys/common/sys_eeprom.c | 1 + board/vscom/baltos/board.c | 1 + board/wandboard/wandboard.c | 1 + board/xilinx/zynq/board.c | 1 + board/xilinx/zynqmp/zynqmp.c | 1 + cmd/avb.c | 1 + cmd/binop.c | 1 + cmd/dtimg.c | 1 + cmd/gpt.c | 1 + cmd/ini.c | 1 + cmd/md5sum.c | 1 + cmd/net.c | 1 + cmd/nvedit_efi.c | 1 + cmd/part.c | 1 + cmd/pxe.c | 1 + cmd/qfw.c | 1 + common/cli_hush.c | 1 + common/console.c | 1 + common/hash.c | 1 + common/hwconfig.c | 1 + common/image-android.c | 1 + common/main.c | 1 + common/spl/spl_dfu.c | 1 + common/update.c | 1 + drivers/net/fec_mxc.c | 1 + drivers/net/lan91c96.c | 1 + drivers/net/ne2000_base.c | 1 + drivers/net/sandbox-raw.c | 1 + drivers/usb/gadget/ether.c | 1 + env/flags.c | 1 + examples/api/demo.c | 1 + include/command.h | 1 + include/common.h | 12 ------------ include/env.h | 12 ++++++++++++ include/env_flags.h | 1 + include/exports.h | 1 + include/net.h | 1 + include/search.h | 1 + lib/efi_loader/efi_variable.c | 1 + lib/uuid.c | 1 + net/dns.c | 1 + net/eth-uclass.c | 1 + net/eth_legacy.c | 1 + net/wol.c | 1 + test/dm/eth.c | 1 + tools/env/fw_env.c | 1 + tools/env/fw_env.h | 1 + tools/env/fw_env_main.c | 1 + 181 files changed, 191 insertions(+), 12 deletions(-)
arch/arm/cpu/arm926ejs/spear/spr_misc.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <i2c.h> #include <net.h>
arch/arm/cpu/armv7/vf610/generic.c +1 -0
@@ -9,6 +9,7 @@#include <asm/arch/clock.h> #include <asm/arch/crm_regs.h> #include <asm/mach-imx/sys_proto.h> +#include <env.h> #include <netdev.h> #ifdef CONFIG_FSL_ESDHC_IMX #include <fsl_esdhc_imx.h>
arch/arm/cpu/armv8/fsl-layerscape/soc.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <fsl_immap.h> #include <fsl_ifc.h> #include <asm/arch/fsl_serdes.h>
arch/arm/mach-davinci/misc.c +1 -0
@@ -9,6 +9,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <i2c.h> #include <net.h>
arch/arm/mach-imx/mx6/opos6ul.c +1 -0
@@ -13,6 +13,7 @@#include <asm/mach-imx/iomux-v3.h> #include <asm/io.h> #include <common.h> +#include <env.h> #include <environment.h> DECLARE_GLOBAL_DATA_PTR ;
arch/arm/mach-imx/mx7/soc.c +1 -0
@@ -14,6 +14,7 @@#include <asm/arch/imx-rdc.h> #include <asm/arch/crm_regs.h> #include <dm.h> +#include <env.h> #include <imx_thermal.h> #include <fsl_sec.h> #include <asm/setup.h>
arch/arm/mach-meson/board-common.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <asm/arch/boot.h> +#include <env.h> #include <linux/libfdt.h> #include <linux/err.h> #include <environment.h>
arch/arm/mach-omap2/utils.c +1 -0
@@ -4,6 +4,7 @@* Aneesh V <[email protected]> */ #include <common.h> +#include <env.h> #include <environment.h> #include <asm/setup.h> #include <asm/arch/sys_proto.h>
arch/arm/mach-rmobile/cpu_info.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> #include <asm/io.h> +#include <env.h> #include <linux/ctype.h> #ifdef CONFIG_ARCH_CPU_INIT
arch/arm/mach-rockchip/rk3288-board.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <clk.h> #include <dm.h> +#include <env.h> #include <ram.h> #include <syscon.h> #include <asm/io.h>
arch/arm/mach-socfpga/misc_gen5.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <asm/io.h> +#include <env.h> #include <errno.h> #include <fdtdec.h> #include <linux/libfdt.h>
arch/arm/mach-socfpga/misc_s10.c +1 -0
@@ -6,6 +6,7 @@#include <altera.h> #include <common.h> +#include <env.h> #include <errno.h> #include <fdtdec.h> #include <miiphy.h>
arch/arm/mach-stm32mp/cpu.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <clk.h> #include <debug_uart.h> +#include <env.h> #include <environment.h> #include <misc.h> #include <asm/io.h>
arch/arm/mach-tegra/board2.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <dm.h> #include <efi_loader.h> +#include <env.h> #include <errno.h> #include <ns16550.h> #include <usb.h>
board/Arcturus/ucp1020/cmd_arc.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <div64.h> +#include <env.h> #include <malloc.h> #include <spi_flash.h> #include <mmc.h>
board/Arcturus/ucp1020/ucp1020.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <hwconfig.h> #include <pci.h> #include <i2c.h>
board/CZ.NIC/turris_mox/turris_mox.c +1 -0
@@ -8,6 +8,7 @@#include <asm/io.h> #include <dm.h> #include <clk.h> +#include <env.h> #include <spi.h> #include <mvebu/comphy.h> #include <miiphy.h>
board/LaCie/net2big_v2/net2big_v2.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <i2c.h> #include <asm/mach-types.h>
board/LaCie/netspace_v2/netspace_v2.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <asm/mach-types.h> #include <asm/arch/cpu.h>
board/Synology/ds414/cmd_syno.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <div64.h> +#include <env.h> #include <spi.h> #include <spi_flash.h> #include <linux/mtd/mtd.h>
board/alliedtelesis/x530/x530.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> #include <dm.h> +#include <env.h> #include <i2c.h> #include <wdt.h> #include <asm/gpio.h>
board/amazon/kc1/kc1.c +1 -0
@@ -7,6 +7,7 @@#include <config.h> #include <common.h> +#include <env.h> #include <linux/ctype.h> #include <linux/usb/musb.h> #include <asm/omap_musb.h>
board/amlogic/p200/p200.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <asm/io.h> #include <asm/arch/gx.h>
board/amlogic/p201/p201.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <asm/io.h> #include <asm/arch/gx.h>
board/amlogic/p212/p212.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <asm/io.h> #include <asm/arch/gx.h>
board/amlogic/q200/q200.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <asm/io.h> #include <asm/arch/gx.h>
board/aristainetos/aristainetos-v2.c +1 -0
@@ -13,6 +13,7 @@#include <asm/arch/imx-regs.h> #include <asm/arch/iomux.h> #include <asm/arch/mx6-pins.h> +#include <env.h> #include <linux/errno.h> #include <asm/gpio.h> #include <asm/mach-imx/iomux-v3.h>
board/armltd/integrator/integrator.c +1 -0
@@ -18,6 +18,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <netdev.h> #include <asm/io.h> #include <dm/platform_data/serial_pl01x.h>
board/atmel/common/board.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <w1.h> #include <w1-eeprom.h> #include <dm/device-internal.h>
board/atmel/common/mac_eeprom.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <i2c_eeprom.h> #include <netdev.h>
board/atmel/sama5d3xek/sama5d3xek.c +1 -0
@@ -12,6 +12,7 @@#include <asm/arch/gpio.h> #include <asm/arch/clk.h> #include <debug_uart.h> +#include <env.h> #include <linux/ctype.h> #include <phy.h> #include <micrel.h>
board/bachmann/ot1200/ot1200.c +1 -0
@@ -9,6 +9,7 @@#include <asm/arch/clock.h> #include <asm/arch/imx-regs.h> #include <asm/arch/iomux.h> +#include <env.h> #include <malloc.h> #include <asm/arch/mx6-pins.h> #include <asm/mach-imx/iomux-v3.h>
board/bosch/shc/board.c +1 -0
@@ -12,6 +12,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <spl.h> #include <asm/arch/cpu.h>
board/buffalo/lsxl/lsxl.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <net.h> #include <malloc.h>
board/cadence/xtfpga/xtfpga.c +1 -0
@@ -8,6 +8,7 @@#include <command.h> #include <dm.h> #include <dm/platform_data/net_ethoc.h> +#include <env.h> #include <linux/ctype.h> #include <linux/string.h> #include <linux/stringify.h>
board/ccv/xpress/xpress.c +1 -0
@@ -16,6 +16,7 @@#include <asm/mach-imx/mxc_i2c.h> #include <asm/io.h> #include <common.h> +#include <env.h> #include <fsl_esdhc_imx.h> #include <i2c.h> #include <miiphy.h>
board/compulab/cl-som-imx7/cl-som-imx7.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <mmc.h> #include <phy.h>
board/compulab/cm_fx6/cm_fx6.c +1 -0
@@ -11,6 +11,7 @@#include <ahci.h> #include <dm.h> #include <dwc_ahsata.h> +#include <env.h> #include <environment.h> #include <fsl_esdhc_imx.h> #include <miiphy.h>
board/compulab/cm_t335/cm_t335.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <miiphy.h>
board/compulab/cm_t35/cm_t35.c +1 -0
@@ -12,6 +12,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <status_led.h> #include <netdev.h>
board/compulab/cm_t54/cm_t54.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <fdt_support.h> #include <usb.h>
board/congatec/cgtqmx6eval/cgtqmx6eval.c +1 -0
@@ -20,6 +20,7 @@#include <asm/arch/sys_proto.h> #include <asm/arch/mxc_hdmi.h> #include <asm/arch/crm_regs.h> +#include <env.h> #include <mmc.h> #include <fsl_esdhc_imx.h> #include <i2c.h>
board/cssi/MCR3000/MCR3000.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <hwconfig.h> #include <mpc8xx.h> #include <fdt_support.h>
board/davinci/da8xxevm/da850evm.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <i2c.h> #include <net.h>
board/davinci/da8xxevm/omapl138_lcdk.c +1 -0
@@ -9,6 +9,7 @@*/ #include <common.h> +#include <env.h> #include <i2c.h> #include <net.h> #include <spi.h>
board/dhelectronics/dh_imx6/dh_imx6.c +1 -0
@@ -22,6 +22,7 @@#include <asm/mach-imx/sata.h> #include <ahci.h> #include <dwc_ahsata.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <fsl_esdhc_imx.h>
board/eets/pdu001/board.c +1 -0
@@ -10,6 +10,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <spl.h> #include <i2c.h>
board/el/el6x/el6x.c +1 -0
@@ -9,6 +9,7 @@#include <asm/arch/imx-regs.h> #include <asm/arch/iomux.h> #include <asm/arch/mx6-pins.h> +#include <env.h> #include <linux/errno.h> #include <asm/gpio.h> #include <asm/mach-imx/mxc_i2c.h>
board/freescale/common/cmd_esbc_validate.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <fsl_validate.h> int do_esbc_halt(cmd_tbl_t *cmdtp, int flag, int argc,
board/freescale/common/fsl_chain_of_trust.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <fsl_validate.h> #include <fsl_secboot_err.h> #include <fsl_sfp.h>
board/freescale/common/sys_eeprom.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <i2c.h> #include <linux/ctype.h>
board/freescale/imx8mq_evk/imx8mq_evk.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <malloc.h> #include <errno.h> #include <asm/io.h>
board/freescale/imx8qm_mek/imx8qm_mek.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <linux/libfdt.h> #include <environment.h>
board/freescale/imx8qxp_mek/imx8qxp_mek.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <linux/libfdt.h> #include <environment.h>
board/freescale/ls2080ardb/ls2080ardb.c +1 -0
@@ -4,6 +4,7 @@* Copyright 2017 NXP */ #include <common.h> +#include <env.h> #include <malloc.h> #include <errno.h> #include <netdev.h>
board/freescale/mpc8323erdb/mpc8323erdb.c +1 -0
@@ -10,6 +10,7 @@*/ #include <common.h> +#include <env.h> #include <ioports.h> #include <mpc83xx.h> #include <i2c.h>
board/freescale/mx53loco/mx53loco.c +1 -0
@@ -12,6 +12,7 @@#include <asm/arch/clock.h> #include <asm/arch/iomux-mx53.h> #include <asm/arch/clock.h> +#include <env.h> #include <linux/errno.h> #include <asm/mach-imx/mx5_video.h> #include <netdev.h>
board/freescale/mx6sabreauto/mx6sabreauto.c +1 -0
@@ -11,6 +11,7 @@#include <asm/arch/imx-regs.h> #include <asm/arch/iomux.h> #include <asm/arch/mx6-pins.h> +#include <env.h> #include <linux/errno.h> #include <asm/gpio.h> #include <asm/mach-imx/iomux-v3.h>
board/freescale/mx6sabresd/mx6sabresd.c +1 -0
@@ -10,6 +10,7 @@#include <asm/arch/iomux.h> #include <asm/arch/mx6-pins.h> #include <asm/mach-imx/spi.h> +#include <env.h> #include <linux/errno.h> #include <asm/gpio.h> #include <asm/mach-imx/mxc_i2c.h>
board/freescale/mx6sxsabresd/mx6sxsabresd.c +1 -0
@@ -15,6 +15,7 @@#include <asm/mach-imx/iomux-v3.h> #include <asm/io.h> #include <asm/mach-imx/mxc_i2c.h> +#include <env.h> #include <linux/sizes.h> #include <common.h> #include <fsl_esdhc_imx.h>
board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c +1 -0
@@ -16,6 +16,7 @@#include <asm/mach-imx/mxc_i2c.h> #include <asm/io.h> #include <common.h> +#include <env.h> #include <fsl_esdhc_imx.h> #include <i2c.h> #include <miiphy.h>
board/freescale/mx6ullevk/mx6ullevk.c +1 -0
@@ -14,6 +14,7 @@#include <asm/mach-imx/boot_mode.h> #include <asm/io.h> #include <common.h> +#include <env.h> #include <fsl_esdhc_imx.h> #include <linux/sizes.h> #include <mmc.h>
board/gardena/smart-gateway-at91sam/board.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <debug_uart.h> +#include <env.h> #include <led.h> #include <asm/arch/at91_common.h> #include <asm/arch/clk.h>
board/gardena/smart-gateway-mt7688/board.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <led.h> #include <net.h>
board/gateworks/gw_ventana/gw_ventana.c +1 -0
@@ -21,6 +21,7 @@#include <asm/setup.h> #include <dm.h> #include <dm/platform_data/serial_mxc.h> +#include <env.h> #include <environment.h> #include <hwconfig.h> #include <i2c.h>
board/ge/bx50v3/bx50v3.c +1 -0
@@ -9,6 +9,7 @@#include <asm/arch/imx-regs.h> #include <asm/arch/iomux.h> #include <asm/arch/mx6-pins.h> +#include <env.h> #include <linux/errno.h> #include <linux/libfdt.h> #include <asm/gpio.h>
board/ge/common/ge_common.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <i2c.h> #include <rtc.h>
board/ge/mx53ppd/mx53ppd.c +1 -0
@@ -16,6 +16,7 @@#include <asm/arch/clock.h> #include <asm/arch/iomux-mx53.h> #include <asm/arch/clock.h> +#include <env.h> #include <linux/errno.h> #include <linux/libfdt.h> #include <asm/mach-imx/mxc_i2c.h>
board/grinn/chiliboard/board.c +1 -0
@@ -16,6 +16,7 @@#include <asm/emif.h> #include <asm/io.h> #include <cpsw.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <miiphy.h>
board/gumstix/pepper/board.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <spl.h> #include <asm/arch/cpu.h>
board/highbank/highbank.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <ahci.h> +#include <env.h> #include <netdev.h> #include <scsi.h>
board/intel/edison/edison.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> #include <dwc3-uboot.h> +#include <env.h> #include <environment.h> #include <mmc.h> #include <u-boot/md5.h>
board/isee/igep003x/board.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <spl.h> #include <asm/arch/cpu.h>
board/isee/igep00x0/igep00x0.c +1 -0
@@ -4,6 +4,7 @@* ISEE 2007 SL, <www.iseebcn.com> */ #include <common.h> +#include <env.h> #include <status_led.h> #include <dm.h> #include <ns16550.h>
board/k+p/kp_imx53/kp_id_rev.c +1 -0
@@ -10,6 +10,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <i2c.h> #include "kp_id_rev.h"
board/k+p/kp_imx53/kp_imx53.c +1 -0
@@ -13,6 +13,7 @@#include <asm/arch/iomux-mx53.h> #include <asm/arch/clock.h> #include <asm/gpio.h> +#include <env.h> #include <power/pmic.h> #include <fsl_pmic.h> #include "kp_id_rev.h"
board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c +1 -0
@@ -17,6 +17,7 @@#include <asm/mach-imx/boot_mode.h> #include <asm/mach-imx/iomux-v3.h> #include <asm/mach-imx/mxc_i2c.h> +#include <env.h> #include <errno.h> #include <fsl_esdhc_imx.h> #include <fuse.h>
board/keymile/common/common.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <ioports.h> #include <command.h> #include <malloc.h>
board/keymile/common/ivm.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <cli_hush.h> +#include <env.h> #include <i2c.h> #include "common.h"
board/keymile/km83xx/km83xx.c +1 -0
@@ -14,6 +14,7 @@*/ #include <common.h> +#include <env.h> #include <ioports.h> #include <mpc83xx.h> #include <i2c.h>
board/keymile/km_arm/km_arm.c +1 -0
@@ -12,6 +12,7 @@*/ #include <common.h> +#include <env.h> #include <i2c.h> #include <nand.h> #include <netdev.h>
board/keymile/kmp204x/kmp204x.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <netdev.h> #include <linux/compiler.h> #include <asm/mmu.h>
board/kosagi/novena/novena.c +1 -0
@@ -9,6 +9,7 @@#include <dm.h> #include <dm/device-internal.h> #include <ahci.h> +#include <env.h> #include <linux/errno.h> #include <asm/gpio.h> #include <asm/io.h>
board/laird/wb50n/wb50n.c +1 -0
@@ -11,6 +11,7 @@#include <asm/arch/at91_rstc.h> #include <asm/arch/gpio.h> #include <asm/arch/clk.h> +#include <env.h> #include <micrel.h> #include <net.h> #include <netdev.h>
board/lg/sniper/sniper.c +1 -0
@@ -8,6 +8,7 @@#include <config.h> #include <common.h> #include <dm.h> +#include <env.h> #include <linux/ctype.h> #include <linux/usb/musb.h> #include <asm/omap_musb.h>
board/liebherr/display5/display5.c +1 -0
@@ -13,6 +13,7 @@#include <asm/arch/mx6-pins.h> #include <asm/arch/mx6-ddr.h> #include <asm/arch/sys_proto.h> +#include <env.h> #include <errno.h> #include <asm/gpio.h> #include <malloc.h>
board/logicpd/imx6/imx6logic.c +1 -0
@@ -9,6 +9,7 @@*/ #include <common.h> +#include <env.h> #include <miiphy.h> #include <input.h> #include <mmc.h>
board/logicpd/zoom1/zoom1.c +1 -0
@@ -15,6 +15,7 @@*/ #include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <ns16550.h> #include <netdev.h>
board/nokia/rx51/rx51.c +1 -0
@@ -22,6 +22,7 @@*/ #include <common.h> +#include <env.h> #include <watchdog.h> #include <malloc.h> #include <twl4030.h>
board/overo/overo.c +1 -0
@@ -13,6 +13,7 @@*/ #include <common.h> #include <dm.h> +#include <env.h> #include <ns16550.h> #include <netdev.h> #include <twl4030.h>
board/phytec/pcm051/board.c +1 -0
@@ -9,6 +9,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <spl.h>
board/phytec/pcm052/pcm052.c +1 -0
@@ -13,6 +13,7 @@#include <asm/arch/ddrmc-vf610.h> #include <asm/arch/crm_regs.h> #include <asm/arch/clock.h> +#include <env.h> #include <led.h> #include <environment.h> #include <miiphy.h>
board/phytec/pfla02/pfla02.c +1 -0
@@ -15,6 +15,7 @@#include <asm/mach-imx/boot_mode.h> #include <asm/mach-imx/mxc_i2c.h> #include <asm/mach-imx/spi.h> +#include <env.h> #include <linux/errno.h> #include <asm/gpio.h> #include <mmc.h>
board/phytec/phycore_rk3288/phycore-rk3288.c +1 -0
@@ -7,6 +7,7 @@#include <asm/io.h> #include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <i2c.h> #include <i2c_eeprom.h>
board/qualcomm/dragonboard410c/dragonboard410c.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <usb.h> #include <asm/gpio.h> #include <fdt_support.h>
board/qualcomm/dragonboard820c/dragonboard820c.c +1 -0
@@ -6,6 +6,7 @@*/ #include <asm/arch/sysmap-apq8096.h> +#include <env.h> #include <linux/arm-smccc.h> #include <linux/psci.h> #include <common.h>
board/renesas/blanche/blanche.c +1 -0
@@ -18,6 +18,7 @@#include <asm/processor.h> #include <dm.h> #include <dm/platform_data/serial_sh.h> +#include <env.h> #include <environment.h> #include <i2c.h> #include <linux/errno.h>
board/renesas/sh7752evb/sh7752evb.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <malloc.h> #include <asm/processor.h>
board/renesas/sh7753evb/sh7753evb.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <malloc.h> #include <asm/processor.h>
board/renesas/sh7757lcr/sh7757lcr.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <malloc.h> #include <asm/processor.h>
board/rockchip/tinker_rk3288/tinker-rk3288.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <i2c_eeprom.h> #include <netdev.h>
board/samsung/common/misc.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <lcd.h> #include <libtizen.h> #include <samsung/misc.h>
board/samsung/trats/trats.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <env.h> #include <lcd.h> #include <asm/io.h> #include <asm/gpio.h>
board/samsung/universal_c210/universal.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <env.h> #include <spi.h> #include <lcd.h> #include <asm/io.h>
board/samtec/vining_fpga/socfpga.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <asm/arch/reset_manager.h> #include <asm/io.h>
board/siemens/common/factoryset.c +1 -0
@@ -8,6 +8,7 @@#if !defined(CONFIG_SPL_BUILD )#include <common.h> +#include <env.h> #include <environment.h> #include <i2c.h> #include <asm/io.h>
board/siemens/draco/board.c +1 -0
@@ -13,6 +13,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <spl.h> #include <asm/arch/cpu.h>
board/siemens/pxm2/board.c +1 -0
@@ -13,6 +13,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <spl.h>
board/siemens/rut/board.c +1 -0
@@ -11,6 +11,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <spi.h> #include <spl.h>
board/siemens/taurus/taurus.c +1 -0
@@ -14,6 +14,7 @@#include <command.h> #include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <asm/io.h> #include <asm/arch/at91sam9260_matrix.h>
board/silica/pengwyn/board.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <asm/arch/cpu.h> #include <asm/arch/hardware.h>
board/softing/vining_2000/vining_2000.c +1 -0
@@ -16,6 +16,7 @@#include <asm/mach-imx/iomux-v3.h> #include <asm/io.h> #include <asm/mach-imx/mxc_i2c.h> +#include <env.h> #include <linux/sizes.h> #include <common.h> #include <environment.h>
board/solidrun/mx6cuboxi/mx6cuboxi.c +1 -0
@@ -18,6 +18,7 @@#include <asm/arch/iomux.h> #include <asm/arch/mx6-pins.h> #include <asm/arch/mxc_hdmi.h> +#include <env.h> #include <linux/errno.h> #include <asm/gpio.h> #include <asm/mach-imx/iomux-v3.h>
board/technologic/ts4800/ts4800.c +1 -0
@@ -11,6 +11,7 @@#include <asm/gpio.h> #include <asm/arch/imx-regs.h> #include <asm/arch/iomux-mx51.h> +#include <env.h> #include <linux/errno.h> #include <asm/arch/sys_proto.h> #include <asm/arch/crm_regs.h>
board/theobroma-systems/puma_rk3399/puma-rk3399.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <misc.h> #include <spl.h>
board/ti/am43xx/board.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <i2c.h> #include <linux/errno.h>
board/ti/am65x/evm.c +1 -0
@@ -14,6 +14,7 @@#include <asm/gpio.h> #include <asm/io.h> #include <asm/omap_common.h> +#include <env.h> #include <spl.h> #include <asm/arch/sys_proto.h>
board/ti/beagle/beagle.c +1 -0
@@ -14,6 +14,7 @@*/ #include <common.h> #include <dm.h> +#include <env.h> #include <ns16550.h> #ifdef CONFIG_LED_STATUS #include <status_led.h>
board/ti/common/board_detect.c +1 -0
@@ -11,6 +11,7 @@#include <asm/arch/hardware.h> #include <asm/omap_common.h> #include <dm/uclass.h> +#include <env.h> #include <i2c.h> #include "board_detect.h"
board/ti/evm/evm.c +1 -0
@@ -12,6 +12,7 @@*/ #include <common.h> #include <dm.h> +#include <env.h> #include <ns16550.h> #include <netdev.h> #include <asm/io.h>
board/ti/panda/panda.c +1 -0
@@ -11,6 +11,7 @@#include <asm/arch/clock.h> #include <asm/arch/gpio.h> #include <asm/gpio.h> +#include <env.h> #include <twl6030.h> #include "panda_mux_data.h"
board/ti/ti814x/evm.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <cpsw.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <spl.h>
board/ti/ti816x/evm.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <spl.h> #include <asm/cache.h>
board/timll/devkit8000/devkit8000.c +1 -0
@@ -17,6 +17,7 @@*/ #include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <ns16550.h> #include <twl4030.h>
board/toradex/apalis-imx8/apalis-imx8.c +1 -0
@@ -12,6 +12,7 @@#include <asm/arch/sys_proto.h> #include <asm/gpio.h> #include <asm/io.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <linux/libfdt.h>
board/toradex/apalis_imx6/apalis_imx6.c +1 -0
@@ -26,6 +26,7 @@#include <dm/device-internal.h> #include <dm/platform_data/serial_mxc.h> #include <dwc_ahsata.h> +#include <env.h> #include <environment.h> #include <fsl_esdhc_imx.h> #include <imx_thermal.h>
board/toradex/colibri-imx6ull/colibri-imx6ull.c +1 -0
@@ -17,6 +17,7 @@#include <asm/io.h> #include <dm.h> #include <dm/platform_data/serial_mxc.h> +#include <env.h> #include <fdt_support.h> #include <imx_thermal.h> #include <jffs2/load_kernel.h>
board/toradex/colibri-imx8x/colibri-imx8x.c +1 -0
@@ -12,6 +12,7 @@#include <asm/arch/sys_proto.h> #include <asm/gpio.h> #include <asm/io.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <linux/libfdt.h>
board/toradex/colibri_vf/colibri_vf.c +1 -0
@@ -15,6 +15,7 @@#include <asm/arch/iomux-vf610.h> #include <asm/gpio.h> #include <asm/io.h> +#include <env.h> #include <fdt_support.h> #include <fsl_dcu_fb.h> #include <g_dnl.h>
board/toradex/common/tdx-common.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <g_dnl.h> #include <linux/libfdt.h>
board/tqc/tqma6/tqma6.c +1 -0
@@ -12,6 +12,7 @@#include <asm/arch/imx-regs.h> #include <asm/arch/iomux.h> #include <asm/arch/sys_proto.h> +#include <env.h> #include <linux/errno.h> #include <asm/gpio.h> #include <asm/io.h>
board/udoo/neo/neo.c +1 -0
@@ -15,6 +15,7 @@#include <asm/arch/mx6-pins.h> #include <asm/gpio.h> #include <asm/mach-imx/iomux-v3.h> +#include <env.h> #include <mmc.h> #include <fsl_esdhc_imx.h> #include <asm/arch/crm_regs.h>
board/udoo/udoo.c +1 -0
@@ -8,6 +8,7 @@#include <asm/arch/clock.h> #include <asm/arch/imx-regs.h> #include <asm/arch/iomux.h> +#include <env.h> #include <malloc.h> #include <asm/arch/mx6-pins.h> #include <linux/errno.h>
board/varisys/common/sys_eeprom.c +1 -0
@@ -12,6 +12,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <i2c.h> #include <linux/ctype.h>
board/vscom/baltos/board.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <linux/libfdt.h> #include <spl.h>
board/wandboard/wandboard.c +1 -0
@@ -20,6 +20,7 @@#include <asm/mach-imx/video.h> #include <asm/mach-imx/sata.h> #include <asm/io.h> +#include <env.h> #include <linux/sizes.h> #include <common.h> #include <miiphy.h>
board/xilinx/zynq/board.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <dm/uclass.h> +#include <env.h> #include <fdtdec.h> #include <fpga.h> #include <malloc.h>
board/xilinx/zynqmp/zynqmp.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <sata.h> #include <ahci.h> #include <scsi.h>
cmd/avb.c +1 -0
@@ -7,6 +7,7 @@#include <avb_verify.h> #include <command.h> +#include <env.h> #include <image.h> #include <malloc.h> #include <mmc.h>
cmd/binop.c +1 -0
@@ -2,6 +2,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <hexdump.h> #include <malloc.h> #include <mapmem.h>
cmd/dtimg.c +1 -0
@@ -4,6 +4,7 @@* Sam Protsenko <[email protected]> */ +#include <env.h> #include <image-android-dt.h> #include <common.h>
cmd/gpt.c +1 -0
@@ -11,6 +11,7 @@*/ #include <common.h> +#include <env.h> #include <malloc.h> #include <command.h> #include <part_efi.h>
cmd/ini.c +1 -0
@@ -13,6 +13,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <linux/ctype.h> #include <linux/string.h>
cmd/md5sum.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <mapmem.h> #include <u-boot/md5.h> #include <asm/io.h>
cmd/net.c +1 -0
@@ -9,6 +9,7 @@*/ #include <common.h> #include <command.h> +#include <env.h> #include <net.h> static int netboot_common (enum proto_t ,cmd_tbl_t *,int ,char *const []);
cmd/nvedit_efi.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <command.h> #include <efi_loader.h> +#include <env.h> #include <exports.h> #include <hexdump.h> #include <malloc.h>
cmd/part.c +1 -0
@@ -18,6 +18,7 @@#include <common.h> #include <config.h> #include <command.h> +#include <env.h> #include <part.h> #include <vsprintf.h>
cmd/pxe.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <malloc.h> #include <mapmem.h> #include <lcd.h>
cmd/qfw.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <errno.h> #include <qfw.h>
common/cli_hush.c +1 -0
@@ -75,6 +75,7 @@#define __U_BOOT__#ifdef __U_BOOT__ +#include <env.h> #include <malloc.h> /* malloc, free, realloc*/ #include <linux/ctype.h> /* isalpha, isdigit */ #include <common.h> /* readline */
common/console.c +1 -0
@@ -8,6 +8,7 @@#include <console.h> #include <debug_uart.h> #include <dm.h> +#include <env.h> #include <stdarg.h> #include <iomux.h> #include <malloc.h>
common/hash.c +1 -0
@@ -12,6 +12,7 @@#ifndef USE_HOSTCC #include <common.h> #include <command.h> +#include <env.h> #include <malloc.h> #include <mapmem.h> #include <hw_sha.h>
common/hwconfig.c +1 -0
@@ -11,6 +11,7 @@#ifndef HWCONFIG_TEST #include <config.h> #include <common.h> +#include <env.h> #include <exports.h> #include <hwconfig.h> #include <linux/types.h>
common/image-android.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <image.h> #include <android_image.h> #include <malloc.h>
common/main.c +1 -0
@@ -10,6 +10,7 @@#include <autoboot.h> #include <cli.h> #include <console.h> +#include <env.h> #include <version.h> /*
common/spl/spl_dfu.c +1 -0
@@ -6,6 +6,7 @@* Ravi B <[email protected]> */ #include <common.h> +#include <env.h> #include <spl.h> #include <linux/compiler.h> #include <errno.h>
common/update.c +1 -0
@@ -17,6 +17,7 @@#endif #include <command.h> +#include <env.h> #include <flash.h> #include <net.h> #include <net/tftp.h>
drivers/net/fec_mxc.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <malloc.h> #include <memalign.h>
drivers/net/lan91c96.c +1 -0
@@ -46,6 +46,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <malloc.h> #include "lan91c96.h" #include <net.h>
drivers/net/ne2000_base.c +1 -0
@@ -74,6 +74,7 @@ Add SNMP#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <net.h> #include <malloc.h>
drivers/net/sandbox-raw.c +1 -0
@@ -9,6 +9,7 @@#include <asm/eth-raw-os.h> #include <common.h> #include <dm.h> +#include <env.h> #include <malloc.h> #include <net.h>
drivers/usb/gadget/ether.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <console.h> +#include <env.h> #include <environment.h> #include <linux/errno.h> #include <linux/netdevice.h>
env/flags.c +1 -0
@@ -4,6 +4,7 @@* Joe Hershberger, National Instruments, joe.hershberger at ni.com */ +#include <env.h> #include <linux/string.h> #include <linux/ctype.h>
examples/api/demo.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <env.h> #include <linux/types.h> #include <api_public.h>
include/command.h +1 -0
@@ -10,6 +10,7 @@#ifndef __COMMAND_H#define __COMMAND_H +#include <env.h> #include <linker_lists.h> #ifndef NULL
include/common.h +0 -12
@@ -157,18 +157,6 @@ int do_ext2load(cmd_tbl_t *, int, int, char * const []);*/ char *env_get (const char *varname); -/** -* env_set() - set an environment variable -* -* This sets or deletes the value of an environment variable. For setting the -* value the variable is created if it does not already exist. -* -* @varname: Variable to adjust -* @value: Value to set for the variable, or NULL or "" to delete the variable -* @return 0 if OK, 1 on error -*/ -int env_set (const char *varname,const char *value); -void pci_init_board (void );/* common/exports.c */
include/env.h +12 -0
@@ -71,6 +71,18 @@ int env_get_f(const char *name, char *buf, unsigned int len);*/ int env_get_yesno (const char *var); +/** +* env_set() - set an environment variable +* +* This sets or deletes the value of an environment variable. For setting the +* value the variable is created if it does not already exist. +* +* @varname: Variable to adjust +* @value: Value to set for the variable, or NULL or "" to delete the variable +* @return 0 if OK, 1 on error +*/ +int env_set (const char *varname,const char *value); +/** * env_get_ulong() - Return an environment variable as an integer value *
include/env_flags.h +1 -0
@@ -146,6 +146,7 @@ int env_flags_validate_env_set_params(char *name, char *const val[], int count);#else /* !USE_HOSTCC */ +#include <env.h> #include <search.h> /*
include/exports.h +1 -0
@@ -3,6 +3,7 @@#ifndef __ASSEMBLY__#ifdef CONFIG_PHY_AQUANTIA +#include <env.h> #include <phy_interface.h> #endif
include/net.h +1 -0
@@ -14,6 +14,7 @@#include <asm/cache.h> #include <asm/byteorder.h> /* for nton* / ntoh* stuff */ +#include <env.h> #include <linux/if_ether.h> #define DEBUG_LL_STATE 0/* Link local state machine changes */
include/search.h +1 -0
@@ -14,6 +14,7 @@#ifndef _SEARCH_H_#define _SEARCH_H_ +#include <env.h> #include <stddef.h> #define __set_errno (val) do { errno = val; } while (0)
lib/efi_loader/efi_variable.c +1 -0
@@ -5,6 +5,7 @@* Copyright (c) 2017 Rob Clark */ +#include <env.h> #include <malloc.h> #include <charset.h> #include <efi_loader.h>
lib/uuid.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <linux/ctype.h> #include <errno.h> #include <common.h>
net/dns.c +1 -0
@@ -24,6 +24,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <net.h> #include <asm/unaligned.h>
net/eth-uclass.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <net.h> #include <dm/device-internal.h>
net/eth_legacy.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <net.h> #include <phy.h>
net/wol.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <net.h> #include <environment.h> #include "wol.h"
test/dm/eth.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <fdtdec.h> #include <malloc.h> #include <net.h>
tools/env/fw_env.c +1 -0
@@ -10,6 +10,7 @@#define _GNU_SOURCE#include <compiler.h> +#include <env.h> #include <errno.h> #include <env_flags.h> #include <fcntl.h>
tools/env/fw_env.h +1 -0
@@ -4,6 +4,7 @@* Wolfgang Denk, DENX Software Engineering, wd at denx.de. */ +#include <env.h> #include <stdint.h> /*
tools/env/fw_env_main.c +1 -0
@@ -26,6 +26,7 @@* of AES key), eg. '-a aabbccddeeff00112233445566778899'. */ +#include <env.h> #include <fcntl.h> #include <getopt.h> #include <stdio.h>
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 16/39 env: Move env_set() to env.h
Quoted 4 lines · Simon Glass
Move
env_set()over to the new header file.Signed-off-by Simon Glass <[email protected]>
PATCH 17/39 env: Move env_get() to env.h
In reply to Simon GlassMove env_get() over to the new header file.
---
arch/arm/lib/bootm.c | 1 + arch/arm/mach-imx/video.c | 1 + arch/arm/mach-kirkwood/cpu.c | 1 + arch/m68k/lib/bootm.c | 1 + arch/microblaze/lib/bootm.c | 1 + arch/nds32/lib/bootm.c | 1 + arch/powerpc/cpu/mpc85xx/mp.c | 1 + arch/powerpc/lib/bootm.c | 1 + arch/xtensa/lib/bootm.c | 1 + board/BuS/eb_cpu5282/eb_cpu5282.c | 1 + board/CarMediaLab/flea3/flea3.c | 1 + board/bluegiga/apx4devkit/apx4devkit.c | 1 + board/bluewater/gurnard/gurnard.c | 1 + board/broadcom/bcm23550_w1d/bcm23550_w1d.c | 1 + board/broadcom/bcm28155_ap/bcm28155_ap.c | 1 + board/compulab/common/omap3_display.c | 1 + board/freescale/bsc9131rdb/bsc9131rdb.c | 1 + board/freescale/bsc9132qds/bsc9132qds.c | 1 + board/freescale/c29xpcie/c29xpcie.c | 1 + board/freescale/common/vid.c | 1 + board/freescale/corenet_ds/corenet_ds.c | 1 + board/freescale/ls1088a/eth_ls1088aqds.c | 1 + board/freescale/ls1088a/ls1088a.c | 1 + board/freescale/ls2080aqds/eth.c | 1 + board/freescale/ls2080aqds/ls2080aqds.c | 1 + board/freescale/lx2160a/eth_lx2160aqds.c | 1 + board/freescale/mpc837xemds/pci.c | 1 + board/freescale/mpc8572ds/mpc8572ds.c | 1 + board/freescale/mx51evk/mx51evk_video.c | 1 + board/freescale/mx53loco/mx53loco_video.c | 1 + board/freescale/p1010rdb/p1010rdb.c | 1 + board/freescale/p1022ds/p1022ds.c | 1 + board/freescale/p1023rdb/p1023rdb.c | 1 + board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 1 + board/freescale/p1_twr/p1_twr.c | 1 + board/freescale/p2041rdb/p2041rdb.c | 1 + board/freescale/t102xqds/t102xqds.c | 1 + board/freescale/t102xrdb/t102xrdb.c | 1 + board/freescale/t1040qds/t1040qds.c | 1 + board/freescale/t104xrdb/t104xrdb.c | 1 + board/freescale/t208xqds/t208xqds.c | 1 + board/freescale/t208xrdb/t208xrdb.c | 1 + board/freescale/t4qds/t4240emu.c | 1 + board/freescale/t4qds/t4240qds.c | 1 + board/freescale/t4rdb/t4240rdb.c | 1 + board/gateworks/gw_ventana/common.c | 1 + board/gdsys/a38x/keyprogram.c | 1 + board/gdsys/mpc8308/hrcon.c | 1 + board/gdsys/mpc8308/strider.c | 1 + board/gdsys/p1022/controlcenterd.c | 1 + board/hisilicon/poplar/poplar.c | 1 + board/menlo/m53menlo/m53menlo.c | 1 + board/nvidia/p2371-2180/p2371-2180.c | 1 + board/nvidia/p2771-0000/p2771-0000.c | 1 + board/renesas/alt/alt.c | 1 + board/renesas/gose/gose.c | 1 + board/renesas/koelsch/koelsch.c | 1 + board/renesas/lager/lager.c | 1 + board/renesas/porter/porter.c | 1 + board/renesas/silk/silk.c | 1 + board/renesas/stout/stout.c | 1 + board/samsung/common/exynos5-dt.c | 1 + board/samsung/odroid/odroid.c | 1 + board/siemens/common/board.c | 1 + board/ti/ks2_evm/board.c | 1 + board/toradex/common/tdx-cfg-block.c | 1 + board/varisys/cyrus/cyrus.c | 1 + board/work-microwave/work_92105/work_92105_display.c | 1 + cmd/bdinfo.c | 1 + cmd/bootefi.c | 1 + cmd/bootm.c | 1 + cmd/bootmenu.c | 1 + cmd/fpga.c | 1 + cmd/itest.c | 1 + cmd/mvebu/bubt.c | 1 + common/bootretry.c | 1 + common/cli.c | 1 + common/cli_simple.c | 1 + common/fdt_support.c | 1 + common/image.c | 1 + common/spl/spl_ext.c | 1 + common/spl/spl_fat.c | 1 + common/splash.c | 1 + common/splash_source.c | 1 + common/usb_hub.c | 1 + common/usb_kbd.c | 1 + disk/part.c | 1 + disk/part_amiga.c | 1 + drivers/dfu/dfu.c | 1 + drivers/fastboot/fb_common.c | 1 + drivers/fastboot/fb_getvar.c | 1 + drivers/fastboot/fb_mmc.c | 1 + drivers/input/i8042.c | 1 + drivers/input/input.c | 1 + drivers/misc/fs_loader.c | 1 + drivers/net/dc2114x.c | 1 + drivers/net/fm/fdt.c | 1 + drivers/net/fsl-mc/mc.c | 1 + drivers/net/fsl_mcdmafec.c | 1 + drivers/net/ftmac100.c | 1 + drivers/net/mcffec.c | 1 + drivers/net/phy/micrel_ksz90x1.c | 1 + drivers/net/sh_eth.c | 1 + drivers/pci/fsl_pci_init.c | 1 + drivers/pci/pci.c | 1 + drivers/pci/pci_common.c | 1 + drivers/reset/reset-socfpga.c | 1 + drivers/rtc/m41t60.c | 1 + drivers/serial/usbtty.c | 1 + drivers/usb/gadget/designware_udc.c | 1 + drivers/usb/gadget/f_dfu.c | 1 + drivers/usb/gadget/f_fastboot.c | 1 + drivers/usb/gadget/f_rockusb.c | 1 + drivers/usb/host/ehci-fsl.c | 1 + drivers/video/ati_radeon_fb.c | 1 + drivers/video/cfb_console.c | 1 + drivers/video/mb862xx.c | 1 + drivers/video/mx3fb.c | 1 + drivers/video/mxsfb.c | 1 + drivers/video/videomodes.c | 1 + env/callback.c | 1 + env/eeprom.c | 1 + env/nvram.c | 1 + include/common.h | 12 ------------ include/env.h | 12 ++++++++++++ lib/efi_loader/efi_console.c | 1 + lib/smbios.c | 1 + net/link_local.c | 1 + net/tftp.c | 1 + 129 files changed, 139 insertions(+), 12 deletions(-)
arch/arm/lib/bootm.c +1 -0
@@ -15,6 +15,7 @@#include <command.h> #include <dm.h> #include <dm/root.h> +#include <env.h> #include <image.h> #include <u-boot/zlib.h> #include <asm/byteorder.h>
arch/arm/mach-imx/video.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ #include <common.h> +#include <env.h> #include <linux/errno.h> #include <asm/mach-imx/video.h>
arch/arm/mach-kirkwood/cpu.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <env.h> #include <netdev.h> #include <asm/cache.h> #include <asm/io.h>
arch/m68k/lib/bootm.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <image.h> #include <u-boot/zlib.h> #include <bzlib.h>
arch/microblaze/lib/bootm.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <fdt_support.h> #include <image.h> #include <u-boot/zlib.h>
arch/nds32/lib/bootm.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <image.h> #include <u-boot/zlib.h> #include <asm/byteorder.h>
arch/powerpc/cpu/mpc85xx/mp.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <env.h> #include <asm/processor.h> +#include <env.h> #include <ioports.h> #include <lmb.h> #include <asm/io.h>
arch/powerpc/lib/bootm.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> +#include <env.h> #include <watchdog.h> #include <command.h> #include <image.h>
arch/xtensa/lib/bootm.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <u-boot/zlib.h> #include <asm/byteorder.h> #include <asm/addrspace.h>
board/BuS/eb_cpu5282/eb_cpu5282.c +1 -0
@@ -11,6 +11,7 @@#include <command.h> #include "asm/m5282.h" #include <bmp_layout.h> +#include <env.h> #include <status_led.h> #include <bus_vcxk.h>
board/CarMediaLab/flea3/flea3.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <asm/io.h> +#include <env.h> #include <linux/errno.h> #include <asm/arch/imx-regs.h> #include <asm/arch/crm_regs.h>
board/bluegiga/apx4devkit/apx4devkit.c +1 -0
@@ -21,6 +21,7 @@#include <asm/arch/iomux-mx28.h> #include <asm/arch/clock.h> #include <asm/arch/sys_proto.h> +#include <env.h> #include <linux/mii.h> #include <miiphy.h> #include <netdev.h>
board/bluewater/gurnard/gurnard.c +1 -0
@@ -12,6 +12,7 @@#include <atmel_lcdc.h> #include <atmel_mci.h> #include <dm.h> +#include <env.h> #include <lcd.h> #include <net.h> #ifndef CONFIG_DM_ETH
board/broadcom/bcm23550_w1d/bcm23550_w1d.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <asm/io.h> #include <asm/mach-types.h> +#include <env.h> #include <mmc.h> #include <asm/kona-common/kona_sdhci.h> #include <asm/kona-common/clk.h>
board/broadcom/bcm28155_ap/bcm28155_ap.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <asm/io.h> #include <asm/mach-types.h> +#include <env.h> #include <mmc.h> #include <asm/kona-common/kona_sdhci.h> #include <asm/kona-common/clk.h>
board/compulab/common/omap3_display.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <asm/gpio.h> #include <asm/io.h> +#include <env.h> #include <stdio_dev.h> #include <asm/arch/dss.h> #include <lcd.h>
board/freescale/bsc9131rdb/bsc9131rdb.c +1 -0
@@ -9,6 +9,7 @@#include <asm/cache.h> #include <asm/immap_85xx.h> #include <asm/io.h> +#include <env.h> #include <miiphy.h> #include <linux/libfdt.h> #include <fdt_support.h>
board/freescale/bsc9132qds/bsc9132qds.c +1 -0
@@ -9,6 +9,7 @@#include <asm/cache.h> #include <asm/immap_85xx.h> #include <asm/io.h> +#include <env.h> #include <miiphy.h> #include <linux/libfdt.h> #include <fdt_support.h>
board/freescale/c29xpcie/c29xpcie.c +1 -0
@@ -9,6 +9,7 @@#include <asm/cache.h> #include <asm/immap_85xx.h> #include <asm/io.h> +#include <env.h> #include <miiphy.h> #include <linux/libfdt.h> #include <fdt_support.h>
board/freescale/common/vid.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <i2c.h> #include <asm/io.h> #ifdef CONFIG_FSL_LSCH2
board/freescale/corenet_ds/corenet_ds.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <netdev.h> #include <linux/compiler.h> #include <asm/mmu.h>
board/freescale/ls1088a/eth_ls1088aqds.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <netdev.h> #include <asm/io.h> #include <asm/arch/fsl_serdes.h>
board/freescale/ls1088a/ls1088a.c +1 -0
@@ -3,6 +3,7 @@* Copyright 2017-2018 NXP */ #include <common.h> +#include <env.h> #include <i2c.h> #include <malloc.h> #include <errno.h>
board/freescale/ls2080aqds/eth.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <netdev.h> #include <asm/io.h> #include <asm/arch/fsl_serdes.h>
board/freescale/ls2080aqds/ls2080aqds.c +1 -0
@@ -3,6 +3,7 @@* Copyright 2015 Freescale Semiconductor */ #include <common.h> +#include <env.h> #include <malloc.h> #include <errno.h> #include <netdev.h>
board/freescale/lx2160a/eth_lx2160aqds.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <hwconfig.h> #include <command.h> #include <netdev.h>
board/freescale/mpc837xemds/pci.c +1 -0
@@ -6,6 +6,7 @@#include <asm/mmu.h> #include <asm/io.h> #include <common.h> +#include <env.h> #include <mpc83xx.h> #include <pci.h> #include <i2c.h>
board/freescale/mpc8572ds/mpc8572ds.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <pci.h> #include <asm/processor.h> #include <asm/mmu.h>
board/freescale/mx51evk/mx51evk_video.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <linux/list.h> #include <asm/gpio.h> #include <asm/arch/iomux-mx51.h>
board/freescale/mx53loco/mx53loco_video.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <linux/list.h> #include <asm/gpio.h> #include <asm/arch/iomux-mx53.h>
board/freescale/p1010rdb/p1010rdb.c +1 -0
@@ -9,6 +9,7 @@#include <asm/cache.h> #include <asm/immap_85xx.h> #include <asm/io.h> +#include <env.h> #include <miiphy.h> #include <linux/libfdt.h> #include <fdt_support.h>
board/freescale/p1022ds/p1022ds.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <pci.h> #include <asm/processor.h> #include <asm/mmu.h>
board/freescale/p1023rdb/p1023rdb.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <pci.h> #include <asm/io.h> #include <asm/cache.h>
board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <hwconfig.h> #include <pci.h> #include <i2c.h>
board/freescale/p1_twr/p1_twr.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <hwconfig.h> #include <pci.h> #include <i2c.h>
board/freescale/p2041rdb/p2041rdb.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <netdev.h> #include <linux/compiler.h> #include <asm/mmu.h>
board/freescale/t102xqds/t102xqds.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <i2c.h> #include <netdev.h> #include <linux/compiler.h>
board/freescale/t102xrdb/t102xrdb.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <i2c.h> #include <netdev.h> #include <linux/compiler.h>
board/freescale/t1040qds/t1040qds.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <i2c.h> #include <netdev.h> #include <linux/compiler.h>
board/freescale/t104xrdb/t104xrdb.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <hwconfig.h> #include <netdev.h> #include <linux/compiler.h>
board/freescale/t208xqds/t208xqds.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <i2c.h> #include <netdev.h> #include <linux/compiler.h>
board/freescale/t208xrdb/t208xrdb.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <i2c.h> #include <netdev.h> #include <linux/compiler.h>
board/freescale/t4qds/t4240emu.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <i2c.h> #include <netdev.h> #include <linux/compiler.h>
board/freescale/t4qds/t4240qds.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <i2c.h> #include <netdev.h> #include <linux/compiler.h>
board/freescale/t4rdb/t4240rdb.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <i2c.h> #include <netdev.h> #include <linux/compiler.h>
board/gateworks/gw_ventana/common.c +1 -0
@@ -10,6 +10,7 @@#include <asm/arch/sys_proto.h> #include <asm/gpio.h> #include <asm/mach-imx/mxc_i2c.h> +#include <env.h> #include <fsl_esdhc_imx.h> #include <hwconfig.h> #include <power/pmic.h>
board/gdsys/a38x/keyprogram.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <tpm-v1.h> #include <malloc.h> #include <linux/ctype.h>
board/gdsys/mpc8308/hrcon.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <hwconfig.h> #include <i2c.h> #include <spi.h>
board/gdsys/mpc8308/strider.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <hwconfig.h> #include <i2c.h> #include <spi.h>
board/gdsys/p1022/controlcenterd.c +1 -0
@@ -23,6 +23,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <pci.h> #include <asm/processor.h> #include <asm/mmu.h>
board/hisilicon/poplar/poplar.c +1 -0
@@ -155,6 +155,7 @@ static void usb2_phy_init(void) }#if defined(CONFIG_USB_GADGET ) && defined(CONFIG_USB_GADGET_DWC2_OTG ) +#include <env.h> #include <usb.h> #include <usb/dwc2_udc.h> #include <g_dnl.h>
board/menlo/m53menlo/m53menlo.c +1 -0
@@ -18,6 +18,7 @@#include <asm/mach-imx/video.h> #include <asm/gpio.h> #include <asm/spl.h> +#include <env.h> #include <fdt_support.h> #include <fsl_esdhc_imx.h> #include <gzip.h>
board/nvidia/p2371-2180/p2371-2180.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <fdtdec.h> #include <i2c.h>
board/nvidia/p2771-0000/p2771-0000.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <fdtdec.h> #include <i2c.h>
board/renesas/alt/alt.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <env.h> #include <malloc.h> #include <dm.h> #include <dm/platform_data/serial_sh.h>
board/renesas/gose/gose.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <env.h> #include <malloc.h> #include <dm.h> #include <dm/platform_data/serial_sh.h>
board/renesas/koelsch/koelsch.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <env.h> #include <malloc.h> #include <dm.h> #include <dm/platform_data/serial_sh.h>
board/renesas/lager/lager.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <malloc.h> #include <netdev.h>
board/renesas/porter/porter.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <env.h> #include <malloc.h> #include <dm.h> #include <dm/platform_data/serial_sh.h>
board/renesas/silk/silk.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <env.h> #include <malloc.h> #include <dm.h> #include <dm/platform_data/serial_sh.h>
board/renesas/stout/stout.c +1 -0
@@ -9,6 +9,7 @@*/ #include <common.h> +#include <env.h> #include <malloc.h> #include <netdev.h> #include <dm.h>
board/samsung/common/exynos5-dt.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <dm.h> #include <dwc3-uboot.h> +#include <env.h> #include <fdtdec.h> #include <asm/io.h> #include <errno.h>
board/samsung/odroid/odroid.c +1 -0
@@ -12,6 +12,7 @@#include <asm/gpio.h> #include <asm/arch/cpu.h> #include <dm.h> +#include <env.h> #include <power/pmic.h> #include <power/regulator.h> #include <power/max77686_pmic.h>
board/siemens/common/board.c +1 -0
@@ -10,6 +10,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <spl.h> #include <asm/arch/cpu.h>
board/ti/ks2_evm/board.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include "board.h" +#include <env.h> #include <spl.h> #include <exports.h> #include <fdt_support.h>
board/toradex/common/tdx-cfg-block.c +1 -0
@@ -20,6 +20,7 @@#endif #include <cli.h> #include <console.h> +#include <env.h> #include <flash.h> #include <malloc.h> #include <mmc.h>
board/varisys/cyrus/cyrus.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <netdev.h> #include <linux/compiler.h> #include <asm/mmu.h>
board/work-microwave/work_92105/work_92105_display.c +1 -0
@@ -15,6 +15,7 @@#include <asm/arch/cpu.h> #include <asm/arch/emc.h> #include <asm/gpio.h> +#include <env.h> #include <spi.h> #include <i2c.h> #include <version.h>
cmd/bdinfo.c +1 -0
@@ -9,6 +9,7 @@*/ #include <common.h> #include <command.h> +#include <env.h> #include <linux/compiler.h> DECLARE_GLOBAL_DATA_PTR ;
cmd/bootefi.c +1 -0
@@ -11,6 +11,7 @@#include <dm.h> #include <efi_loader.h> #include <efi_selftest.h> +#include <env.h> #include <errno.h> #include <linux/libfdt.h> #include <linux/libfdt_env.h>
cmd/bootm.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <bootm.h> #include <command.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <image.h>
cmd/bootmenu.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> #include <ansi.h> +#include <env.h> #include <menu.h> #include <watchdog.h> #include <malloc.h>
cmd/fpga.c +1 -0
@@ -9,6 +9,7 @@*/ #include <common.h> #include <command.h> +#include <env.h> #include <fpga.h> #include <fs.h> #include <gzip.h>
cmd/itest.c +1 -0
@@ -14,6 +14,7 @@#include <common.h> #include <config.h> #include <command.h> +#include <env.h> #include <mapmem.h> #include <asm/io.h>
cmd/mvebu/bubt.c +1 -0
@@ -7,6 +7,7 @@#include <config.h> #include <common.h> #include <command.h> +#include <env.h> #include <vsprintf.h> #include <errno.h> #include <dm.h>
common/bootretry.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <bootretry.h> #include <cli.h> +#include <env.h> #include <errno.h> #include <watchdog.h>
common/cli.c +1 -0
@@ -12,6 +12,7 @@#include <cli.h> #include <cli_hush.h> #include <console.h> +#include <env.h> #include <fdtdec.h> #include <malloc.h>
common/cli_simple.c +1 -0
@@ -12,6 +12,7 @@#include <bootretry.h> #include <cli.h> #include <console.h> +#include <env.h> #include <linux/ctype.h> #define DEBUG_PARSER 0/* set to 1 to debug */
common/fdt_support.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <env.h> #include <mapmem.h> #include <stdio_dev.h> #include <linux/ctype.h>
common/image.c +1 -0
@@ -8,6 +8,7 @@#ifndef USE_HOSTCC #include <common.h> +#include <env.h> #include <watchdog.h> #ifdef CONFIG_SHOW_BOOT_PROGRESS
common/spl/spl_ext.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ #include <common.h> +#include <env.h> #include <spl.h> #include <asm/u-boot.h> #include <ext4fs.h>
common/spl/spl_fat.c +1 -0
@@ -9,6 +9,7 @@*/ #include <common.h> +#include <env.h> #include <spl.h> #include <asm/u-boot.h> #include <fat.h>
common/splash.c +1 -0
@@ -21,6 +21,7 @@*/ #include <common.h> +#include <env.h> #include <splash.h> #include <lcd.h>
common/splash_source.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <bmp_layout.h> +#include <env.h> #include <errno.h> #include <fs.h> #include <fdt_support.h>
common/usb_hub.c +1 -0
@@ -24,6 +24,7 @@#include <common.h> #include <command.h> #include <dm.h> +#include <env.h> #include <errno.h> #include <memalign.h> #include <asm/processor.h>
common/usb_kbd.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <console.h> #include <dm.h> +#include <env.h> #include <errno.h> #include <malloc.h> #include <memalign.h>
disk/part.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <errno.h> #include <ide.h> #include <malloc.h>
disk/part_amiga.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> #include <command.h> +#include <env.h> #include <ide.h> #include "part_amiga.h"
drivers/dfu/dfu.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <env.h> #include <errno.h> #include <malloc.h> #include <mmc.h>
drivers/fastboot/fb_common.c +1 -0
@@ -11,6 +11,7 @@*/ #include <common.h> +#include <env.h> #include <fastboot.h> #include <net/fastboot.h>
drivers/fastboot/fb_getvar.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <fastboot.h> #include <fastboot-internal.h> #include <fb_mmc.h>
drivers/fastboot/fb_mmc.c +1 -0
@@ -6,6 +6,7 @@#include <config.h> #include <common.h> #include <blk.h> +#include <env.h> #include <fastboot.h> #include <fastboot-internal.h> #include <fb_mmc.h>
drivers/input/i8042.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <errno.h> #include <i8042.h> #include <input.h>
drivers/input/input.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <console.h> #include <dm.h> +#include <env.h> #include <errno.h> #include <stdio_dev.h> #include <input.h>
drivers/misc/fs_loader.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> #include <dm.h> +#include <env.h> #include <errno.h> #include <blk.h> #include <fs.h>
drivers/net/dc2114x.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ #include <common.h> +#include <env.h> #include <malloc.h> #include <net.h> #include <netdev.h>
drivers/net/fm/fdt.c +1 -0
@@ -3,6 +3,7 @@* Copyright 2016 Freescale Semiconductor, Inc. */ #include <asm/io.h> +#include <env.h> #include <fsl_qe.h> /* For struct qe_firmware */ #ifdef CONFIG_SYS_DPAA_FMAN
drivers/net/fsl-mc/mc.c +1 -0
@@ -5,6 +5,7 @@* Copyright 2017-2018 NXP */ #include <common.h> +#include <env.h> #include <errno.h> #include <linux/bug.h> #include <asm/io.h>
drivers/net/fsl_mcdmafec.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <malloc.h> #include <command.h>
drivers/net/ftmac100.c +1 -0
@@ -8,6 +8,7 @@#include <config.h> #include <common.h> +#include <env.h> #include <malloc.h> #include <net.h> #include <linux/io.h>
drivers/net/mcffec.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #include <malloc.h>
drivers/net/phy/micrel_ksz90x1.c +1 -0
@@ -10,6 +10,7 @@*/ #include <common.h> #include <dm.h> +#include <env.h> #include <errno.h> #include <micrel.h> #include <phy.h>
drivers/net/sh_eth.c +1 -0
@@ -10,6 +10,7 @@#include <config.h> #include <common.h> +#include <env.h> #include <environment.h> #include <malloc.h> #include <net.h>
drivers/pci/fsl_pci_init.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <env.h> #include <malloc.h> #include <asm/fsl_serdes.h>
drivers/pci/pci.c +1 -0
@@ -17,6 +17,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <errno.h> #include <asm/processor.h> #include <asm/io.h>
drivers/pci/pci_common.c +1 -0
@@ -11,6 +11,7 @@#include <common.h> #include <dm.h> +#include <env.h> #include <errno.h> #include <pci.h> #include <asm/io.h>
drivers/reset/reset-socfpga.c +1 -0
@@ -15,6 +15,7 @@#include <common.h> #include <dm.h> #include <dm/of_access.h> +#include <env.h> #include <reset-uclass.h> #include <linux/bitops.h> #include <linux/io.h>
drivers/rtc/m41t60.c +1 -0
@@ -17,6 +17,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <rtc.h> #include <i2c.h>
drivers/serial/usbtty.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <config.h> #include <circbuf.h> +#include <env.h> #include <stdio_dev.h> #include <asm/unaligned.h> #include "usbtty.h"
drivers/usb/gadget/designware_udc.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <asm/io.h> +#include <env.h> #include <usbdevice.h> #include "ep0.h" #include <usb/designware_udc.h>
drivers/usb/gadget/f_dfu.c +1 -0
@@ -14,6 +14,7 @@* (C) Copyright 2006 by Harald Welte <[email protected]> */ +#include <env.h> #include <errno.h> #include <common.h> #include <malloc.h>
drivers/usb/gadget/f_fastboot.c +1 -0
@@ -11,6 +11,7 @@*/ #include <config.h> #include <common.h> +#include <env.h> #include <errno.h> #include <fastboot.h> #include <malloc.h>
drivers/usb/gadget/f_rockusb.c +1 -0
@@ -6,6 +6,7 @@*/ #include <config.h> #include <common.h> +#include <env.h> #include <errno.h> #include <malloc.h> #include <memalign.h>
drivers/usb/host/ehci-fsl.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <env.h> #include <pci.h> #include <usb.h> #include <asm/io.h>
drivers/video/ati_radeon_fb.c +1 -0
@@ -19,6 +19,7 @@#include <command.h> #include <bios_emul.h> +#include <env.h> #include <pci.h> #include <asm/processor.h> #include <linux/errno.h>
drivers/video/cfb_console.c +1 -0
@@ -65,6 +65,7 @@*/ #include <common.h> +#include <env.h> #include <fdtdec.h> #include <gzip.h> #include <version.h>
drivers/video/mb862xx.c +1 -0
@@ -12,6 +12,7 @@#include <common.h> #include <asm/io.h> +#include <env.h> #include <pci.h> #include <video_fb.h> #include "videomodes.h"
drivers/video/mx3fb.c +1 -0
@@ -6,6 +6,7 @@* HALE electronic GmbH, <[email protected]> */ #include <common.h> +#include <env.h> #include <malloc.h> #include <video_fb.h>
drivers/video/mxsfb.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> #include <dm.h> +#include <env.h> #include <linux/errno.h> #include <malloc.h> #include <video.h>
drivers/video/videomodes.c +1 -0
@@ -58,6 +58,7 @@#include <common.h> #include <edid.h> +#include <env.h> #include <errno.h> #include <linux/ctype.h>
env/callback.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <env.h> #include <environment.h> #if defined(CONFIG_NEEDS_MANUAL_RELOC )
env/eeprom.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <linux/stddef.h> #if defined(CONFIG_I2C_ENV_EEPROM_BUS )
env/nvram.c +1 -0
@@ -25,6 +25,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <linux/stddef.h> #include <search.h>
include/common.h +0 -12
@@ -145,18 +145,6 @@ int do_fat_fsload(cmd_tbl_t *, int, int, char * const []);/* common/cmd_ext2.c */ int do_ext2load (cmd_tbl_t *,int ,int ,char *const []); -/** -* env_get() - Look up the value of an environment variable -* -* In U-Boot proper this can be called before relocation (which is when the -* environment is loaded from storage, i.e. GD_FLG_ENV_READY is 0). In that -* case this function calls env_get_f(). -* -* @varname: Variable to look up -* @return value of variable, or NULL if not found -*/ -char *env_get (const char *varname); -void pci_init_board (void );/* common/exports.c */
include/env.h +12 -0
@@ -51,6 +51,18 @@ void env_relocate(void);*/ int env_match (unsigned char *name,int index); +/** +* env_get() - Look up the value of an environment variable +* +* In U-Boot proper this can be called before relocation (which is when the +* environment is loaded from storage, i.e. GD_FLG_ENV_READY is 0). In that +* case this function calls env_get_f(). +* +* @varname: Variable to look up +* @return value of variable, or NULL if not found +*/ +char *env_get (const char *varname); +/** * env_get_f() - Look up the value of an environment variable (early) *
lib/efi_loader/efi_console.c +1 -0
@@ -9,6 +9,7 @@#include <charset.h> #include <dm/device.h> #include <efi_loader.h> +#include <env.h> #include <stdio_dev.h> #include <video_console.h>
lib/smbios.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <env.h> #include <mapmem.h> #include <smbios.h> #include <tables_csum.h>
net/link_local.c +1 -0
@@ -12,6 +12,7 @@*/ #include <common.h> +#include <env.h> #include <net.h> #include "arp.h" #include "net_rand.h"
net/tftp.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <command.h> #include <efi_loader.h> +#include <env.h> #include <mapmem.h> #include <net.h> #include <net/tftp.h>
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 17/39 env: Move env_get() to env.h
Quoted 4 lines · Simon Glass
Move
env_get()over to the new header file.Signed-off-by Simon Glass <[email protected]>
PATCH 18/39 env: Move eth_env_get/set_enetaddr() to env.h
In reply to Simon GlassMove these two functions over to the new header file.
---
include/env.h | 18 ++++++++++++++++++ include/environment.h | 2 -- 2 files changed, 18 insertions(+), 2 deletions(-)
include/env.h +18 -0
@@ -164,4 +164,22 @@ static inline int env_set_addr(const char *varname, const void *addr)int env_complete (char *var,int maxv,char *cmdv[],int maxsz,char *buf,bool dollar_comp); +/** +* eth_env_get_enetaddr() - Get an ethernet address from the environmnet +* +* @name: Environment variable to get (e.g. "ethaddr") +* @enetaddr: Place to put MAC address (6 bytes) +* @return 0 if OK, 1 on error +*/ +int eth_env_get_enetaddr (const char *name,uint8_t *enetaddr); + +/** +* eth_env_set_enetaddr() - Set an ethernet address in the environmnet +* +* @name: Environment variable to set (e.g. "ethaddr") +* @enetaddr: Pointer to MAC address to put into the variable (6 bytes) +* @return 0 if OK, 1 on error +*/ +int eth_env_set_enetaddr (const char *name,const uint8_t *enetaddr); +#endif
include/environment.h +0 -2
@@ -326,8 +326,6 @@ int env_erase(void);void env_fix_drivers (void );void eth_parse_enetaddr (const char *addr,uint8_t *enetaddr); -int eth_env_get_enetaddr (const char *name,uint8_t *enetaddr); -int eth_env_set_enetaddr (const char *name,const uint8_t *enetaddr);#endif /* DO_DEPS_ONLY */
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 18/39 env: Move eth_env_get/set_enetaddr() to env.h
Quoted 4 lines · Simon Glass
Move these two functions over to the new header file.
Signed-off-by Simon Glass <[email protected]>
PATCH 19/39 env: Move uncommon functions to env.h
In reply to Simon GlassMove eth_parse_enetaddr() and env_fix_drivers() over to the new header file.
---
cmd/ethsw.c | 1 + include/env.h | 16 ++++++++++++++++ include/environment.h | 7 ------- 3 files changed, 17 insertions(+), 7 deletions(-)
cmd/ethsw.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <env_flags.h>
include/env.h +16 -0
@@ -182,4 +182,20 @@ int eth_env_get_enetaddr(const char *name, uint8_t *enetaddr);*/ int eth_env_set_enetaddr (const char *name,const uint8_t *enetaddr); +/** +* eth_parse_enetaddr() - Parse a MAC address +* +* Convert a string MAC address +* +* @addr: MAC address in aa:bb:cc:dd:ee:ff format, where each part is a 2-digit +* hex value +* @enetaddr: Place to put MAC address (6 bytes) +*/ +void eth_parse_enetaddr (const char *addr,uint8_t *enetaddr); + +/** +* env_fix_drivers() - Updates envdriver as per relocation +*/ +void env_fix_drivers (void ); +#endif
include/environment.h +0 -7
@@ -320,13 +320,6 @@ int env_save(void);*/ int env_erase (void ); -/** -* env_fix_drivers() - Updates envdriver as per relocation -*/ -void env_fix_drivers (void ); - -void eth_parse_enetaddr (const char *addr,uint8_t *enetaddr); -#endif /* DO_DEPS_ONLY */ #endif /* _ENVIRONMENT_H_ */
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 19/39 env: Move uncommon functions to env.h
Quoted 32 lines · Simon Glass
Move
eth_parse_enetaddr()andenv_fix_drivers()over to the new header file.Signed-off-by Simon Glass <[email protected]>---
cmd/ethsw.c | 1 + include/env.h | 16 ++++++++++++++++ include/environment.h | 7 ------- 3 files changed, 17 insertions(+), 7 deletions(-)cmd/ethsw.c +1
-0@@ -7,6 +7,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <env_flags.h> include/env.h +0
-0@@ -182,4 +182,20 @@ int eth_env_get_enetaddr(const char *name, uint8_t *enetaddr);*/ int eth_env_set_enetaddr (const char *name,const uint8_t *enetaddr);
include/env.h int eth_env_get_enetaddr(const char *name, uint8_t *enetaddr); · line 194
Quoted 10 lines
include/env.h +10
-0+/** +* eth_parse_enetaddr() - Parse a MAC address +* +* Convert a string MAC address +* +* @addr: MAC address in aa:bb:cc:dd:ee:ff format, where each part is a 2-digit +* hex value +* @enetaddr: Place to put MAC address (6 bytes) +*/ +void eth_parse_enetaddr (const char *addr,uint8_t *enetaddr);
It seems like this should move to include/net.h
Quoted 32 lines
include/env.h +6
-0+ +/** +* env_fix_drivers() - Updates envdriver as per relocation +*/ +void env_fix_drivers (void ); +#endif include/environment.h +0
-8@@ -320,13 +320,6 @@ int env_save(void);*/ int env_erase (void ); -/** -* env_fix_drivers() - Updates envdriver as per relocation -*/ -void env_fix_drivers (void ); - -void eth_parse_enetaddr (const char *addr,uint8_t *enetaddr); -#endif /* DO_DEPS_ONLY */ #endif /* _ENVIRONMENT_H_ */ --2.22.0.709.g102302147b-goog
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 20/39 env: Move set_default_vars to env.h
In reply to Simon GlassMove this function to the new header file and rename it so it has an env_ prefix.
---
cmd/nvedit.c | 2 +- env/common.c | 2 +- include/env.h | 11 +++++++++++ include/environment.h | 3 --- 4 files changed, 13 insertions(+), 5 deletions(-)
cmd/nvedit.c +1 -1
@@ -832,7 +832,7 @@ static int do_env_default(cmd_tbl_t *cmdtp, int flag, }if (!all && (argc >0 )) {/* Reset individual variables */ -set_default_vars (argc, argv, env_flag); +env_set_default_vars (argc, argv, env_flag);return 0 ; }
env/common.c +1 -1
@@ -92,7 +92,7 @@ void set_default_env(const char *s, int flags)/* [re]set individual variables to their value in the default environment */ -int set_default_vars (int nvars,char *const vars[],int flags) +int env_set_default_vars (int nvars,char *const vars[],int flags) {/* * Special use-case: import from default environment
include/env.h +11 -0
@@ -198,4 +198,15 @@ void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr);*/ void env_fix_drivers (void ); +/** +* env_set_default_vars() - reset variables to their default value +* +* This resets individual variables to their value in the default environment +* +* @nvars: Number of variables to set/reset +* @vars: List of variables to set/reset +* @flags: Flags controlling matching (H_... - see search.h) +*/ +int env_set_default_vars (int nvars,char *const vars[],int flags); +#endif
include/environment.h +0 -3
@@ -274,9 +274,6 @@ char *env_get_default(const char *name);/* [re]set to the default environment */ void set_default_env (const char *s,int flags); -/* [re]set individual variables to their value in the default environment */ -int set_default_vars (int nvars,char *const vars[],int flags); -/* Import from binary representation into hash table */ int env_import (const char *buf,int check);
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 20/39 env: Move set_default_vars to env.h
Quoted 5 lines · Simon Glass
Move this function to the new header file and rename it so it has an
env_prefix.Signed-off-by Simon Glass <[email protected]>
PATCH 21/39 env: Move env_load/save functions to env.h
In reply to Simon GlassMove these function to the new header file.
---
include/env.h | 21 +++++++++++++++++++++ include/environment.h | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-)
include/env.h +21 -0
@@ -209,4 +209,25 @@ void env_fix_drivers(void);*/ int env_set_default_vars (int nvars,char *const vars[],int flags); +/** +* env_load() - Load the environment from storage +* +* @return 0 if OK, -ve on error +*/ +int env_load (void ); + +/** +* env_save() - Save the environment to storage +* +* @return 0 if OK, -ve on error +*/ +int env_save (void ); + +/** +* env_erase() - Erase the environment on storage +* +* @return 0 if OK, -ve on error +*/ +int env_erase (void ); +#endif
include/environment.h +0 -21
@@ -296,27 +296,6 @@ int env_import_redund(const char *buf1, int buf1_status,*/ int env_get_char (int index); -/** -* env_load() - Load the environment from storage -* -* @return 0 if OK, -ve on error -*/ -int env_load (void ); - -/** -* env_save() - Save the environment to storage -* -* @return 0 if OK, -ve on error -*/ -int env_save (void ); - -/** -* env_erase() - Erase the environment on storage -* -* @return 0 if OK, -ve on error -*/ -int env_erase (void ); -#endif /* DO_DEPS_ONLY */ #endif /* _ENVIRONMENT_H_ */
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 21/39 env: Move env_load/save functions to env.h
Quoted 4 lines · Simon Glass
Move these function to the new header file.
Signed-off-by Simon Glass <[email protected]>
PATCH 22/39 env: Move env import/export functions to env.h
In reply to Simon GlassMove these functions to the new header file.
---
include/env.h | 38 ++++++++++++++++++++++++++++++++++++++ include/environment.h | 12 ------------ 2 files changed, 38 insertions(+), 12 deletions(-)
include/env.h +38 -0
@@ -12,6 +12,8 @@#include <stdbool.h> #include <linux/types.h> +struct environment_s ; +/** * env_get_id() - Gets a sequence number for the environment *
@@ -230,4 +232,40 @@ int env_save(void);*/ int env_erase (void ); +/** +* env_import() - Import from a binary representation into hash table +* +* This imports the environment from a buffer. THe format for each variable is +* var=value\0 with a double \0 at the end of the buffer. +* +* @buf: Buffer containing the environment (struct environemnt_s *) +* @check: non-zero to check the CRC at the start of the environment, 0 to +* ignore it +* @return 0 if imported successfully, -ENOMSG if the CRC was bad, -EIO if +* something else went wrong +*/ +int env_import (const char *buf,int check); + +/** +* env_export() - Export the environment to a buffer +* +* Export from hash table into binary representation +* +* @env_out: Buffer to contain the environment (must be large enough!) +* @return 0 if OK, 1 on error +*/ +int env_export (struct environment_s *env_out); + +/** +* env_import_redund() - Select and import one of two redundant environments +* +* @buf1: First environment (struct environemnt_s *) +* @buf1_read_fail: 0 if buf1 is valid, non-zero if invalid +* @buf2: Second environment (struct environemnt_s *) +* @buf2_read_fail: 0 if buf2 is valid, non-zero if invalid +* @return 0 if OK, -EIO if no environment is valid, -ENOMSG if the CRC was bad +*/ +int env_import_redund (const char *buf1,int buf1_read_fail, +const char *buf2,int buf2_read_fail); +#endif
include/environment.h +0 -12
@@ -274,18 +274,6 @@ char *env_get_default(const char *name);/* [re]set to the default environment */ void set_default_env (const char *s,int flags); -/* Import from binary representation into hash table */ -int env_import (const char *buf,int check); - -/* Export from hash table into binary representation */ -int env_export (env_t *env_out); - -#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT -/* Select and import one of two redundant environments */ -int env_import_redund (const char *buf1,int buf1_status, -const char *buf2,int buf2_status); -#endif -/** * env_get_char() - Get a character from the early environment *
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 22/39 env: Move env import/export functions to env.h
Quoted 4 lines · Simon Glass
Move these functions to the new header file.
Signed-off-by Simon Glass <[email protected]>
Nit below.
Quoted 19 lines
include/env.h | 38 ++++++++++++++++++++++++++++++++++++++ include/environment.h | 12 ------------ 2 files changed, 38 insertions(+), 12 deletions(-)include/env.h +2
-0@@ -12,6 +12,8 @@#include <stdbool.h> #include <linux/types.h> +struct environment_s ; +/** * env_get_id() - Gets a sequence number for the environment *
include/env.h int env_save(void); · line 238
Quoted 7 lines
include/env.h +4
-0@@ -230,4 +232,40 @@ int env_save(void);*/ int env_erase (void ); +/** +* env_import() - Import from a binary representation into hash table +* +* This imports the environment from a buffer. THe format for each variable is
The
Quoted 63 lines
include/env.h +32
-0+* var=value\0 with a double \0 at the end of the buffer. +* +* @buf: Buffer containing the environment (struct environemnt_s *) +* @check: non-zero to check the CRC at the start of the environment, 0 to +* ignore it +* @return 0 if imported successfully, -ENOMSG if the CRC was bad, -EIO if +* something else went wrong +*/ +int env_import (const char *buf,int check); + +/** +* env_export() - Export the environment to a buffer +* +* Export from hash table into binary representation +* +* @env_out: Buffer to contain the environment (must be large enough!) +* @return 0 if OK, 1 on error +*/ +int env_export (struct environment_s *env_out); + +/** +* env_import_redund() - Select and import one of two redundant environments +* +* @buf1: First environment (struct environemnt_s *) +* @buf1_read_fail: 0 if buf1 is valid, non-zero if invalid +* @buf2: Second environment (struct environemnt_s *) +* @buf2_read_fail: 0 if buf2 is valid, non-zero if invalid +* @return 0 if OK, -EIO if no environment is valid, -ENOMSG if the CRC was bad +*/ +int env_import_redund (const char *buf1,int buf1_read_fail, +const char *buf2,int buf2_read_fail); +#endif include/environment.h +0
-13@@ -274,18 +274,6 @@ char *env_get_default(const char *name);/* [re]set to the default environment */ void set_default_env (const char *s,int flags); -/* Import from binary representation into hash table */ -int env_import (const char *buf,int check); - -/* Export from hash table into binary representation */ -int env_export (env_t *env_out); - -#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT -/* Select and import one of two redundant environments */ -int env_import_redund (const char *buf1,int buf1_status, -const char *buf2,int buf2_status); -#endif -/** * env_get_char() - Get a character from the early environment * -- 2.22.0.709.g102302147b-goog
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 23/39 env: Drop env_crc_update()
In reply to Simon GlassThis function is not defined or used in U-Boot. Drop it.
---
include/environment.h | 3 --- 1 file changed, 3 deletions(-)
include/environment.h +0 -3
@@ -265,9 +265,6 @@ struct env_driver {extern struct hsearch_data env_htab; -/* Function that updates CRC of the enironment */ -void env_crc_update (void ); -/* Look up the variable from the default environment */ char *env_get_default (const char *name);
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 23/39 env: Drop env_crc_update()
Quoted 4 lines · Simon Glass
This function is not defined or used in U-Boot. Drop it.
Signed-off-by Simon Glass <[email protected]>
PATCH 24/39 env: Move get/set_default_env() to env.h
In reply to Simon GlassMove these functions to the new header file and rename set_default_env() to env_set_default() so that it has a consistent env_ prefix.
---
arch/arm/mach-imx/mx6/opos6ul.c | 2 +- board/phytec/pcm052/pcm052.c | 2 +- cmd/nvedit.c | 2 +- common/board_r.c | 2 +- common/spl/spl_dfu.c | 2 +- env/common.c | 14 +++++++------- env/ext4.c | 3 ++- env/fat.c | 3 ++- env/mmc.c | 5 +++-- env/nand.c | 7 ++++--- env/sata.c | 3 ++- env/sf.c | 11 ++++++----- env/ubi.c | 7 ++++--- include/env.h | 11 +++++++++++ include/environment.h | 6 ------ 15 files changed, 46 insertions(+), 34 deletions(-)
arch/arm/mach-imx/mx6/opos6ul.c +1 -1
@@ -128,7 +128,7 @@ int board_late_init(void)/* In bootstrap don't use the env vars */ if (((reg &0x3000000 ) >>24 ) ==0x1 ) { -set_default_env (NULL ,0 ); +env_set_default (NULL ,0 );env_set ("preboot" ,"" ); }
board/phytec/pcm052/pcm052.c +1 -1
@@ -377,7 +377,7 @@ int board_late_init(void)if ((reg &SRC_SBMR1_BOOTCFG1_SDMMC ) && !(reg &SRC_SBMR1_BOOTCFG1_MMC )) {printf ("------ SD card boot -------\n" ); -set_default_env ("!LVFBootloader" ,0 ); +env_set_default ("!LVFBootloader" ,0 );env_set ("bootcmd" ,"run prepare_install_bk4r1_envs; run install_bk4r1rs" ); }
cmd/nvedit.c +1 -1
@@ -826,7 +826,7 @@ static int do_env_default(cmd_tbl_t *cmdtp, int flag,debug ("Final value for argc=%d\n" , argc);if (all && (argc ==0 )) {/* Reset the whole environment */ -set_default_env ("## Resetting to default environment\n" , +env_set_default ("## Resetting to default environment\n" , env_flag);return 0 ; }
common/board_r.c +1 -1
@@ -448,7 +448,7 @@ static int initr_env(void)if (should_load_env ())env_relocate ();else -set_default_env (NULL ,0 ); +env_set_default (NULL ,0 );#ifdef CONFIG_OF_CONTROL env_set_hex ("fdtcontroladdr" , (unsigned long )map_to_sysmem (gd->fdt_blob));
common/spl/spl_dfu.c +1 -1
@@ -39,7 +39,7 @@ int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr)int ret;/* set default environment */ -set_default_env (NULL ,0 ); +env_set_default (NULL ,0 ); str_env =env_get (dfu_alt_info);if (!str_env) {pr_err ("\"%s\" env variable not defined!\n" , dfu_alt_info);
env/common.c +7 -7
@@ -62,7 +62,7 @@ char *env_get_default(const char *name)return ret_val; } -void set_default_env (const char *s,int flags) +void env_set_default (const char *s,int flags) {if (sizeof (default_environment) >ENV_SIZE ) {puts ("*** Error - default environment is too large\n\n" );
@@ -118,7 +118,7 @@ int env_import(const char *buf, int check)memcpy (&crc, &ep->crc,sizeof (crc));if (crc32 (0 , ep->data,ENV_SIZE ) != crc) { -set_default_env ("bad CRC" ,0 ); +env_set_default ("bad CRC" ,0 );return -ENOMSG ;/* needed for env_load() */ } }
@@ -131,7 +131,7 @@ int env_import(const char *buf, int check)pr_err ("Cannot import environment: errno = %d\n" , errno); -set_default_env ("import failed" ,0 ); +env_set_default ("import failed" ,0 );return -EIO ; }
@@ -156,7 +156,7 @@ int env_import_redund(const char *buf1, int buf1_read_fail, }if (buf1_read_fail && buf2_read_fail) { -set_default_env ("bad env area" ,0 ); +env_set_default ("bad env area" ,0 );return -EIO ; }else if (!buf1_read_fail && buf2_read_fail) { gd->env_valid =ENV_VALID ;
@@ -172,7 +172,7 @@ int env_import_redund(const char *buf1, int buf1_read_fail, tmp_env2->crc;if (!crc1_ok && !crc2_ok) { -set_default_env ("bad CRC" ,0 ); +env_set_default ("bad CRC" ,0 );return -ENOMSG ;/* needed for env_load() */ }else if (crc1_ok && !crc2_ok) { gd->env_valid =ENV_VALID ;
@@ -236,10 +236,10 @@ void env_relocate(void)if (gd->env_valid ==ENV_INVALID ) {#if defined(CONFIG_ENV_IS_NOWHERE ) || defined(CONFIG_SPL_BUILD )/* Environment not changable */ -set_default_env (NULL ,0 ); +env_set_default (NULL ,0 );#else bootstage_error (BOOTSTAGE_ID_NET_CHECKSUM ); -set_default_env ("bad CRC" ,0 ); +env_set_default ("bad CRC" ,0 );#endif }else {env_load ();
env/ext4.c +2 -1
@@ -21,6 +21,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <linux/stddef.h> #include <malloc.h>
@@ -127,7 +128,7 @@ static int env_ext4_load(void)return env_import (buf,1 ); err_env_relocate: -set_default_env (NULL ,0 ); +env_set_default (NULL ,0 );return -EIO ; }
env/fat.c +2 -1
@@ -9,6 +9,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <linux/stddef.h> #include <malloc.h>
@@ -122,7 +123,7 @@ static int env_fat_load(void)return env_import (buf,1 ); err_env_relocate: -set_default_env (NULL ,0 ); +env_set_default (NULL ,0 );return -EIO ; }
env/mmc.c +3 -2
@@ -8,6 +8,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <fdtdec.h> #include <linux/stddef.h>
@@ -346,7 +347,7 @@ fini:fini_mmc_for_env (mmc); err:if (ret) -set_default_env (errmsg,0 ); +env_set_default (errmsg,0 );#endif return ret;
@@ -387,7 +388,7 @@ fini:fini_mmc_for_env (mmc); err:if (ret) -set_default_env (errmsg,0 ); +env_set_default (errmsg,0 );#endif return ret; }
env/nand.c +4 -3
@@ -15,6 +15,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <linux/stddef.h> #include <malloc.h>
@@ -325,7 +326,7 @@ static int env_nand_load(void) tmp_env2 = (env_t *)malloc (CONFIG_ENV_SIZE );if (tmp_env1 ==NULL || tmp_env2 ==NULL ) {puts ("Can't allocate buffers for environment\n" ); -set_default_env ("malloc() failed" ,0 ); +env_set_default ("malloc() failed" ,0 ); ret = -EIO ; goto done; }
@@ -364,14 +365,14 @@ static int env_nand_load(void)if (mtd && !get_nand_env_oob (mtd, &nand_env_oob_offset)) {printf ("Found Environment offset in OOB..\n" ); }else { -set_default_env ("no env offset in OOB" ,0 ); +env_set_default ("no env offset in OOB" ,0 );return ; }#endif ret =readenv (CONFIG_ENV_OFFSET , (u_char *)buf);if (ret) { -set_default_env ("readenv() failed" ,0 ); +env_set_default ("readenv() failed" ,0 );return -EIO ; }
env/sata.c +2 -1
@@ -8,6 +8,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <linux/stddef.h> #include <errno.h>
@@ -106,7 +107,7 @@ static void env_sata_load(void) }if (read_env (sata,CONFIG_ENV_SIZE ,CONFIG_ENV_OFFSET , buf)) { -set_default_env (NULL ,0 ); +env_set_default (NULL ,0 );return -EIO ; }
env/sf.c +6 -5
@@ -10,6 +10,7 @@*/ #include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <malloc.h> #include <spi.h>
@@ -48,7 +49,7 @@ static int setup_flash_device(void)CONFIG_ENV_SPI_MAX_HZ ,CONFIG_ENV_SPI_MODE , &new);if (ret) { -set_default_env ("spi_flash_probe_bus_cs() failed" ,0 ); +env_set_default ("spi_flash_probe_bus_cs() failed" ,0 );return ret; }
@@ -60,7 +61,7 @@ static int setup_flash_device(void)CONFIG_ENV_SPI_CS , CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE);if (!env_flash) { -set_default_env ("spi_flash_probe() failed" ,0 ); +env_set_default ("spi_flash_probe() failed" ,0 );return -EIO ; } }
@@ -161,7 +162,7 @@ static int env_sf_load(void) tmp_env2 = (env_t *)memalign (ARCH_DMA_MINALIGN ,CONFIG_ENV_SIZE );if (!tmp_env1 || !tmp_env2) { -set_default_env ("malloc() failed" ,0 ); +env_set_default ("malloc() failed" ,0 ); ret = -EIO ; goto out; }
@@ -256,7 +257,7 @@ static int env_sf_load(void) buf = (char *)memalign (ARCH_DMA_MINALIGN ,CONFIG_ENV_SIZE );if (!buf) { -set_default_env ("malloc() failed" ,0 ); +env_set_default ("malloc() failed" ,0 );return -EIO ; }
@@ -267,7 +268,7 @@ static int env_sf_load(void) ret =spi_flash_read (env_flash,CONFIG_ENV_OFFSET ,CONFIG_ENV_SIZE , buf);if (ret) { -set_default_env ("spi_flash_read() failed" ,0 ); +env_set_default ("spi_flash_read() failed" ,0 ); goto err_read; }
env/ubi.c +4 -3
@@ -7,6 +7,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <malloc.h>
@@ -123,7 +124,7 @@ static int env_ubi_load(void)if (ubi_part (CONFIG_ENV_UBI_PART ,UBI_VID_OFFSET )) {printf ("\n** Cannot find mtd partition \"%s\"\n" ,CONFIG_ENV_UBI_PART ); -set_default_env (NULL ,0 ); +env_set_default (NULL ,0 );return -EIO ; }
@@ -160,14 +161,14 @@ static int env_ubi_load(void)if (ubi_part (CONFIG_ENV_UBI_PART ,UBI_VID_OFFSET )) {printf ("\n** Cannot find mtd partition \"%s\"\n" ,CONFIG_ENV_UBI_PART ); -set_default_env (NULL ,0 ); +env_set_default (NULL ,0 );return -EIO ; }if (ubi_volume_read (CONFIG_ENV_UBI_VOLUME , buf,CONFIG_ENV_SIZE )) {printf ("\n** Unable to read env from %s:%s **\n" ,CONFIG_ENV_UBI_PART ,CONFIG_ENV_UBI_VOLUME ); -set_default_env (NULL ,0 ); +env_set_default (NULL ,0 );return -EIO ; }
include/env.h +11 -0
@@ -268,4 +268,15 @@ int env_export(struct environment_s *env_out);int env_import_redund (const char *buf1,int buf1_read_fail,const char *buf2,int buf2_read_fail); +/** +* env_get_default() - Look up a variable from the default environment +* +* @name: Variable to look up +* @return value if found, NULL if not found in default environment +*/ +char *env_get_default (const char *name); + +/* [re]set to the default environment */ +void env_set_default (const char *s,int flags); +#endif
include/environment.h +0 -6
@@ -265,12 +265,6 @@ struct env_driver {extern struct hsearch_data env_htab; -/* Look up the variable from the default environment */ -char *env_get_default (const char *name); - -/* [re]set to the default environment */ -void set_default_env (const char *s,int flags); -/** * env_get_char() - Get a character from the early environment *
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 24/39 env: Move get/set_default_env() to env.h
Quoted 5 lines · Simon Glass
Move these functions to the new header file and rename
set_default_env()toenv_set_default()so that it has a consistentenv_prefix.Signed-off-by Simon Glass <[email protected]>
PATCH 25/39 env: Move env_get_char() to env.h
In reply to Simon GlassMove env_get_char() over to the new header file.
---
include/env.h | 10 ++++++++++ include/environment.h | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-)
include/env.h +10 -0
@@ -279,4 +279,14 @@ char *env_get_default(const char *name);/* [re]set to the default environment */ void env_set_default (const char *s,int flags); +/** +* env_get_char() - Get a character from the early environment +* +* This reads from the pre-relocation environment +* +* @index: Index of character to read (0 = first) +* @return character read, or -ve on error +*/ +int env_get_char (int index); +#endif
include/environment.h +0 -10
@@ -265,16 +265,6 @@ struct env_driver {extern struct hsearch_data env_htab; -/** -* env_get_char() - Get a character from the early environment -* -* This reads from the pre-relocation environment -* -* @index: Index of character to read (0 = first) -* @return character read, or -ve on error -*/ -int env_get_char (int index); -#endif /* DO_DEPS_ONLY */ #endif /* _ENVIRONMENT_H_ */
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 25/39 env: Move env_get_char() to env.h
Quoted 4 lines · Simon Glass
Move
env_get_char()over to the new header file.Signed-off-by Simon Glass <[email protected]>
PATCH 26/39 env: Move env_reloc() to env.h
In reply to Simon GlassMove env_reloc() over to the new header file.
---
include/env.h | 7 +++++++ include/environment.h | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-)
include/env.h +7 -0
@@ -289,4 +289,11 @@ void env_set_default(const char *s, int flags);*/ int env_get_char (int index); +/** +* env_reloc() - Relocate the 'env' sub-commands +* +* This is used for those unfortunate archs with crappy toolchains +*/ +void env_reloc (void ); +#endif
include/environment.h +0 -4
@@ -158,10 +158,6 @@ extern env_t environment;extern const unsigned char default_environment[]; -#if defined(CONFIG_NEEDS_MANUAL_RELOC ) -extern void env_reloc (void ); -#endif -#ifndef DO_DEPS_ONLY #include <env_attr.h>
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 26/39 env: Move env_reloc() to env.h
Quoted 4 lines · Simon Glass
Move
env_reloc()over to the new header file.Signed-off-by Simon Glass <[email protected]>
PATCH 27/39 env: Rename environment to embedded_environment
In reply to Simon GlassThe name 'environment' is widely used in U-Boot so is not a very useful name of a variable. Rename it to better indicate its purpose.
---
env/flash.c | 2 +- include/env_default.h | 2 +- include/environment.h | 2 +- tools/envcrc.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-)
env/flash.c +1 -1
@@ -47,7 +47,7 @@ DECLARE_GLOBAL_DATA_PTR;#if defined(CONFIG_ENV_ADDR_REDUND ) && defined(CMD_SAVEENV ) || \ !defined(CONFIG_ENV_ADDR_REDUND ) && defined(INITENV )#ifdef ENV_IS_EMBEDDED -static env_t *env_ptr = &environment; +static env_t *env_ptr = &embedded_environment;#else /* ! ENV_IS_EMBEDDED */ static env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR ;
include/env_default.h +1 -1
@@ -10,7 +10,7 @@#include <env_callback.h> #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED -env_t environment __UBOOT_ENV_SECTION__(environment) = { +env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = {ENV_CRC ,/* CRC Sum */ #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT 1, /* Flags: valid */
include/environment.h +1 -1
@@ -153,7 +153,7 @@ typedef struct environment_s { } env_t;#ifdef ENV_IS_EMBEDDED -extern env_t environment; +extern env_t embedded_environment;#endif /* ENV_IS_EMBEDDED */ extern const unsigned char default_environment[];
tools/envcrc.c +2 -2
@@ -61,7 +61,7 @@#ifdef CONFIG_BUILD_ENVCRC # include <environment.h> extern unsigned int env_size; -extern env_t environment; +extern env_t embedded_environment;#endif /* CONFIG_BUILD_ENVCRC */ extern uint32_t crc32 (uint32_t ,const unsigned char *,unsigned int );
@@ -71,7 +71,7 @@ int main (int argc, char **argv)#ifdef CONFIG_BUILD_ENVCRC unsigned char pad =0x00 ;uint32_t crc; -unsigned char *envptr = (unsigned char *)&environment, +unsigned char *envptr = (unsigned char *)&embedded_environment, *dataptr = envptr +ENV_HEADER_SIZE ;unsigned int datasize =ENV_SIZE ;unsigned int eoe;
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 27/39 env: Rename environment to embedded_environment
Quoted 5 lines · Simon Glass
The name 'environment' is widely used in U-Boot so is not a very useful name of a variable. Rename it to better indicate its purpose.
Signed-off-by Simon Glass <[email protected]>
PATCH 28/39 env: Move env_valid to env.h
In reply to Simon GlassThis enum is somewhat widely used to determine if the environment is valid or not. Move it to the common environment header file.
---
env/flash.c | 1 + env/nowhere.c | 1 + include/env.h | 9 ++++++++- include/environment.h | 7 ------- 4 files changed, 10 insertions(+), 8 deletions(-)
env/flash.c +1 -0
@@ -11,6 +11,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <linux/stddef.h> #include <malloc.h>
env/nowhere.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <command.h> +#include <env.h> #include <environment.h> #include <linux/stddef.h>
include/env.h +8 -1
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0+ */ /* -* Common environment functions +* Common environment functions and definitions * * (C) Copyright 2000-2009 * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
@@ -14,6 +14,13 @@struct environment_s ; +/* Value for environment validity */ +enum env_valid { +ENV_INVALID ,/* No valid environment */ +ENV_VALID ,/* First or only environment is valid */ +ENV_REDUND ,/* Redundant environment is valid */ +}; +/** * env_get_id() - Gets a sequence number for the environment *
include/environment.h +0 -7
@@ -165,13 +165,6 @@ extern const unsigned char default_environment[];#include <env_flags.h> #include <search.h> -/* Value for environment validity */ -enum env_valid { -ENV_INVALID ,/* No valid environment */ -ENV_VALID ,/* First or only environment is valid */ -ENV_REDUND ,/* Redundant environment is valid */ -}; -enum env_location {ENVL_UNKNOWN ,ENVL_EEPROM ,
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 28/39 env: Move env_valid to env.h
Quoted 5 lines · Simon Glass
This enum is somewhat widely used to determine if the environment is valid or not. Move it to the common environment header file.
Signed-off-by Simon Glass <[email protected]>
PATCH 29/39 env: Move callback definitions to env.h
In reply to Simon GlassThese definitions are effectively part of the 'public' API of the environment implementation since they do not require access to any internal variables. Move them to the env.h header.
---
include/env.h | 34 ++++++++++++++++++++++++++++++++++ include/env_callback.h | 23 ----------------------- include/search.h | 6 ------ 3 files changed, 34 insertions(+), 29 deletions(-)
include/env.h +34 -0
@@ -21,6 +21,40 @@ enum env_valid { ENV_REDUND, /* Redundant environment is valid */ }; +/** enum env_op - environment callback operation */ +enum env_op { + env_op_create, + env_op_delete, + env_op_overwrite, +}; + +/** struct env_clbk_tbl - declares a new callback */ +struct env_clbk_tbl { +const char *name;/* Callback name */ +int (*callback)(const char *name,const char *value,enum env_op op, +int flags); +}; + +/* +* Define a callback that can be associated with variables. +* when associated through the ".callbacks" environment variable, the callback +* will be executed any time the variable is inserted, overwritten, or deleted. +* +* For SPL these are silently dropped to reduce code size, since environment +* callbacks are not supported with SPL. +*/ +#ifdef CONFIG_SPL_BUILD +#define U_BOOT_ENV_CALLBACK (name, callback) \ + static inline __maybe_unused void _u_boot_env_noop_##name(void) \ + { \ + (void)callback; \ + } +#else +#define U_BOOT_ENV_CALLBACK (name, callback) \ + ll_entry_declare(struct env_clbk_tbl, name, env_clbk) = \ + {#name, callback} +#endif +/** * env_get_id() - Gets a sequence number for the environment *
include/env_callback.h +0 -23
@@ -72,29 +72,6 @@"serial#:serialno," \CONFIG_ENV_CALLBACK_LIST_STATIC -struct env_clbk_tbl { -const char *name;/* Callback name */ -int (*callback)(const char *name,const char *value,enum env_op op, -int flags); -}; - void env_callback_init(ENTRY *var_entry); -/* -* Define a callback that can be associated with variables. -* when associated through the ".callbacks" environment variable, the callback -* will be executed any time the variable is inserted, overwritten, or deleted. -*/ -#ifdef CONFIG_SPL_BUILD -#define U_BOOT_ENV_CALLBACK (name, callback) \ - static inline __maybe_unused void _u_boot_env_noop_##name(void) \ - { \ - (void)callback; \ - } -#else -#define U_BOOT_ENV_CALLBACK (name, callback) \ - ll_entry_declare(struct env_clbk_tbl, name, env_clbk) = \ - {#name, callback} -#endif -#endif /* __ENV_CALLBACK_H__ */
include/search.h +0 -6
@@ -19,12 +19,6 @@#define __set_errno (val) do { errno = val; } while (0) -enum env_op { - env_op_create, - env_op_delete, - env_op_overwrite, -}; -/* Action which shall be performed in the call to hsearch. */ typedef enum { FIND,
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 29/39 env: Move callback definitions to env.h
Quoted 6 lines · Simon Glass
These definitions are effectively part of the 'public' API of the environment implementation since they do not require access to any internal variables. Move them to the
env.hheader.Signed-off-by Simon Glass <[email protected]>
PATCH 30/39 env: Drop the ENTRY typdef
In reply to Simon GlassU-Boot is not supposed to use typedef for structs anymore. Also this name is the same as the ENTRY() macro used in assembler files, and 'entry' itself is widely used in U-Boot (>8k matches).
Drop the typedef and rename the struct to env_entry to reduce confusion.
---
api/api.c | 2 +- cmd/nvedit.c | 12 +++++------ drivers/tee/sandbox.c | 2 +- env/callback.c | 6 +++--- env/common.c | 2 +- env/flags.c | 10 +++++----- include/env_callback.h | 2 +- include/env_flags.h | 6 +++--- include/search.h | 24 +++++++++++----------- lib/hashtable.c | 45 +++++++++++++++++++++--------------------- test/env/hashtable.c | 12 +++++------ 11 files changed, 62 insertions(+), 61 deletions(-)
api/api.c +1 -1
@@ -497,7 +497,7 @@ static int API_env_enum(va_list ap) {int i, buflen;char *last, **next, *s; -ENTRY *match, search; +struct env_entry *match, search;static char *var; last = (char *)va_arg(ap, unsigned long);
cmd/nvedit.c +6 -6
@@ -94,7 +94,7 @@ static int env_print(char *name, int flag)ssize_t len;if (name) {/* print a single name */ -ENTRY e, *ep; +struct env_entry e, *ep; e.key = name; e.data =NULL ;
@@ -225,7 +225,7 @@ static int _do_env_set(int flag, int argc, char * const argv[], int env_flag) {int i, len;char *name, *value, *s; -ENTRY e, *ep; +struct env_entry e, *ep;debug ("Initial value for argc=%d\n" , argc);
@@ -485,7 +485,7 @@ static int print_static_binding(const char *var_name, const char *callback_name,return 0 ; } -static int print_active_callback (ENTRY *entry) +static int print_active_callback (struct env_entry *entry) {struct env_clbk_tbl *clbkp;int i;
@@ -566,7 +566,7 @@ static int print_static_flags(const char *var_name, const char *flags,return 0 ; } -static int print_active_flags (ENTRY *entry) +static int print_active_flags (struct env_entry *entry) {enum env_flags_vartype type;enum env_flags_varaccess access;
@@ -674,7 +674,7 @@ static int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc,char *env_get (const char *name) {if (gd->flags &GD_FLG_ENV_READY ) {/* after import into hashtable */ -ENTRY e, *ep; +struct env_entry e, *ep;WATCHDOG_RESET ();
@@ -1274,7 +1274,7 @@ static int do_env_info(cmd_tbl_t *cmdtp, int flag,static int do_env_exists (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -ENTRY e, *ep; +struct env_entry e, *ep;if (argc <2 )return CMD_RET_USAGE ;
drivers/tee/sandbox.c +1 -1
@@ -79,7 +79,7 @@ static u32 ta_avb_invoke_func(struct udevice *dev, u32 func, uint num_params, struct tee_param *params) {struct sandbox_tee_state *state =dev_get_priv (dev); -ENTRY e, *ep; +struct env_entry e, *ep;char *name;u32 res;uint slot;
env/callback.c +3 -3
@@ -43,7 +43,7 @@ static const char *callback_list;* This is called specifically when the variable did not exist in the hash * previously, so the blanket update did not find this variable. */ -void env_callback_init (ENTRY *var_entry) +void env_callback_init (struct env_entry *var_entry) {const char *var_name = var_entry->key;char callback_name[256 ] ="" ;
@@ -80,7 +80,7 @@ void env_callback_init(ENTRY *var_entry)* Called on each existing env var prior to the blanket update since removing * a callback association should remove its callback. */ -static int clear_callback (ENTRY *entry) +static int clear_callback (struct env_entry *entry) { entry->callback =NULL ;
@@ -92,7 +92,7 @@ static int clear_callback(ENTRY *entry)*/ static int set_callback (const char *name,const char *value,void *priv) { -ENTRY e, *ep; +struct env_entry e, *ep;struct env_clbk_tbl *clbkp; e.key = name;
env/common.c +1 -1
@@ -250,7 +250,7 @@ void env_relocate(void)int env_complete (char *var,int maxv,char *cmdv[],int bufsz,char *buf,bool dollar_comp) { -ENTRY *match; +struct env_entry *match;int found, idx;if (dollar_comp) {
env/flags.c +5 -5
@@ -419,7 +419,7 @@ static const char *flags_list;* This is called specifically when the variable did not exist in the hash * previously, so the blanket update did not find this variable. */ -void env_flags_init (ENTRY *var_entry) +void env_flags_init (struct env_entry *var_entry) {const char *var_name = var_entry->key;char flags[ENV_FLAGS_ATTR_MAX_LEN +1 ] ="" ;
@@ -441,7 +441,7 @@ void env_flags_init(ENTRY *var_entry)* Called on each existing env var prior to the blanket update since removing * a flag in the flag list should remove its flags. */ -static int clear_flags (ENTRY *entry) +static int clear_flags (struct env_entry *entry) { entry->flags =0 ;
@@ -453,7 +453,7 @@ static int clear_flags(ENTRY *entry)*/ static int set_flags (const char *name,const char *value,void *priv) { -ENTRY e, *ep; +struct env_entry e, *ep; e.key = name; e.data =NULL ;
@@ -496,8 +496,8 @@ U_BOOT_ENV_CALLBACK(flags, on_flags);* overwriting of write-once variables. */ -int env_flags_validate (const ENTRY *item,const char *newval,enum env_op op, -int flag) +int env_flags_validate (const struct env_entry *item,const char *newval, +enum env_op op,int flag) {const char *name;const char *oldval =NULL ;
include/env_callback.h +1 -1
@@ -72,6 +72,6 @@"serial#:serialno," \CONFIG_ENV_CALLBACK_LIST_STATIC -void env_callback_init(ENTRY *var_entry); +void env_callback_init(struct env_entry *var_entry);#endif /* __ENV_CALLBACK_H__ */
include/env_flags.h +3 -3
@@ -153,13 +153,13 @@ int env_flags_validate_env_set_params(char *name, char *const val[], int count);* When adding a variable to the environment, initialize the flags for that * variable. */ -void env_flags_init (ENTRY *var_entry); +void env_flags_init (struct env_entry *var_entry);/* * Validate the newval for to conform with the requirements defined by its flags */ -int env_flags_validate (const ENTRY *item,const char *newval,enum env_op op, -int flag); +int env_flags_validate (const struct env_entry *item,const char *newval, +enum env_op op,int flag);#endif /* USE_HOSTCC */
include/search.h +12 -12
@@ -25,16 +25,14 @@ typedef enum { ENTER }ACTION ; -typedef struct entry { +/** struct env_entry - An entry in the environment hashtable */ +struct env_entry {const char *key;char *data;int (*callback)(const char *name,const char *value,enum env_op op,int flags);int flags; -}ENTRY ; - -/* Opaque type for internal use. */ -struct _ENTRY ; +};/* * Family of hash table handling functions. The functions also
@@ -54,8 +52,8 @@ struct hsearch_data {* shall force overwriting of write-once variables. * Must return 0 for approval, 1 for denial. */ -int (*change_ok)(const ENTRY *__item,const char *newval,enum env_op , -int flag); +int (*change_ok)(const struct env_entry *__item,const char *newval, +enum env_op ,int flag); };/* Create a new hash table which will contain at most "__nel" elements. */
@@ -70,15 +68,16 @@ extern void hdestroy_r(struct hsearch_data *__htab);* NULL. If ACTION is `ENTER' replace existing data (if any) with * __item.data. * */ -extern int hsearch_r (ENTRY __item,ACTION __action,ENTRY ** __retval, -struct hsearch_data *__htab,int __flag); +extern int hsearch_r (struct env_entry __item,ACTION __action, +struct env_entry **__retval,struct hsearch_data *__htab, +int __flag);/* * Search for an entry matching "__match". Otherwise, Same semantics * as hsearch_r(). */ -extern int hmatch_r (const char *__match,int __last_idx,ENTRY ** __retval, -struct hsearch_data *__htab); +extern int hmatch_r (const char *__match,int __last_idx, +struct env_entry **__retval,struct hsearch_data *__htab);/* Search and delete entry matching "__key" in internal hash table. */ extern int hdelete_r(const char *__key, struct hsearch_data *__htab,
@@ -98,7 +97,8 @@ extern int himport_r(struct hsearch_data *__htab, char * const vars[]);/* Walk the whole table calling the callback on each element */ -extern int hwalk_r (struct hsearch_data *__htab,int (*callback)(ENTRY *)); +extern int hwalk_r (struct hsearch_data *__htab, +int (*callback)(struct env_entry *entry));/* Flags for himport_r(), hexport_r(), hdelete_r(), and hsearch_r() */ #define H_NOCLEAR (1 << 0)/* do not clear hash table before importing */
lib/hashtable.c +23 -22
133 lines not on this page · raw message
test/env/hashtable.c +6 -6
@@ -18,8 +18,8 @@ static int htab_fill(struct unit_test_state *uts, struct hsearch_data *htab, size_t size) { size_t i; -ENTRY item; -ENTRY *ritem; +struct env_entry item; +struct env_entry *ritem;char key[20 ];for (i =0 ; i < size; i++) {
@@ -38,8 +38,8 @@ static int htab_check_fill(struct unit_test_state *uts, struct hsearch_data *htab, size_t size) { size_t i; -ENTRY item; -ENTRY *ritem; +struct env_entry item; +struct env_entry *ritem;char key[20 ];for (i =0 ; i < size; i++) {
@@ -61,8 +61,8 @@ static int htab_create_delete(struct unit_test_state *uts, struct hsearch_data *htab, size_t iterations) { size_t i; -ENTRY item; -ENTRY *ritem; +struct env_entry item; +struct env_entry *ritem;char key[20 ];for (i =0 ; i < iterations; i++) {
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 30/39 env: Drop the ENTRY typdef
Quoted 8 lines · Simon Glass
U-Boot is not supposed to use typedef for structs anymore. Also this name is the same as the
ENTRY()macro used in assembler files, and 'entry' itself is widely used in U-Boot (>8k matches).Drop the typedef and rename the struct to
env_entryto reduce confusion.Signed-off-by Simon Glass <[email protected]>
PATCH 31/39 env: Drop _ENTRY
In reply to Simon GlassThis typedef does not need to be defined in the search.h header since it is only used in one file (hashtable.c). Remove it from the header and change it to a struct.
---
include/search.h | 2 +- lib/hashtable.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-)
include/search.h +1 -1
@@ -42,7 +42,7 @@ struct env_entry {/* Data type for reentrant functions. */ struct hsearch_data { -struct _ENTRY *table; +struct env_entry_node *table;unsigned int size;unsigned int filled;/*
lib/hashtable.c +4 -3
@@ -59,10 +59,10 @@* which describes the current status. */ -typedef struct _ENTRY { +struct env_entry_node {int used;struct env_entry entry; -}_ENTRY ; +}; static void _hdelete(const char *key, struct hsearch_data *htab,
@@ -120,7 +120,8 @@ int hcreate_r(size_t nel, struct hsearch_data *htab) htab->filled =0 ;/* allocate memory and zero out */ - htab->table = (_ENTRY *)calloc (htab->size +1 ,sizeof (_ENTRY)); + htab->table = (struct env_entry_node *)calloc (htab->size +1 , +sizeof (struct env_entry_node ));if (htab->table ==NULL )return 0 ;
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 31/39 env: Drop _ENTRY
Quoted 17 lines · Simon Glass
This typedef does not need to be defined in the
search.hheader since it is only used in one file (hashtable.c). Remove it from the header and change it to a struct.Signed-off-by Simon Glass <[email protected]>---
include/search.h | 2 +- lib/hashtable.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-)include/search.h +0
-0
include/search.h struct env_entry { · line 45
Quoted 5 lines
include/search.h +1
-1@@ -42,7 +42,7 @@ struct env_entry {/* Data type for reentrant functions. */ struct hsearch_data { -struct _ENTRY *table; +struct env_entry_node *table;
Don't you need an opaque definition of this?
Also, there is an opaque definition of _ENTRY in this file that needs to go away.
Quoted 37 lines
include/search.h +0
-0unsigned int size;unsigned int filled;/* lib/hashtable.c +4
-4@@ -59,10 +59,10 @@* which describes the current status. */ -typedef struct _ENTRY { +struct env_entry_node {int used;struct env_entry entry; -}_ENTRY ; +}; static void _hdelete(const char *key, struct hsearch_data *htab,@@ -120,7 +120,8 @@ int hcreate_r(size_t nel, struct hsearch_data *htab) htab->filled =0 ;/* allocate memory and zero out */ - htab->table = (_ENTRY *)calloc (htab->size +1 ,sizeof (_ENTRY)); + htab->table = (struct env_entry_node *)calloc (htab->size +1 , +sizeof (struct env_entry_node ));if (htab->table ==NULL )return 0 ; --2.22.0.709.g102302147b-goog
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 31/39 env: Drop _ENTRY
Hi Joe,
Quoted 20 lines · Joe Hershberger
Quoted 18 lines · Simon Glass
This typedef does not need to be defined in the
search.hheader since it is only used in one file (hashtable.c). Remove it from the header and change it to a struct.Signed-off-by Simon Glass <[email protected]>---
include/search.h | 2 +- lib/hashtable.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-)include/search.h +0
-0@@ -42,7 +42,7 @@ struct env_entry {
Quoted 6 lines
include/search.h struct env_entry { · line 45
Quoted 4 lines
include/search.h +1
-1/* Data type for reentrant functions. */ struct hsearch_data { -struct _ENTRY *table; +struct env_entry_node *table;Don't you need an opaque definition of this?
I don't see why. We can just use struct env_entry_node which is opaque if the definition is not available.
Quoted 3 lines
Also, there is an opaque definition of
_ENTRYin this file that needs to go away.
Where is that? I can't see it.
Quoted 31 lines
Quoted 31 lines
include/search.h +0
-0unsigned int size;unsigned int filled;/* lib/hashtable.c +4
-3@@ -59,10 +59,10 @@* which describes the current status. */ -typedef struct _ENTRY { +struct env_entry_node {int used;struct env_entry entry; -}_ENTRY ; +}; static void _hdelete(const char *key, struct hsearch_data *htab,@@ -120,7 +120,8 @@ int hcreate_r(size_t nel, struct hsearch_data *htab) htab->filled =0 ;/* allocate memory and zero out */ - htab->table = (_ENTRY *)calloc (htab->size +1 ,sizeof (_ENTRY)); + htab->table = (struct env_entry_node *)calloc (htab->size +1 , +sizeof (struct env_entry_node ));if (htab->table ==NULL )return 0 ;
Quoted 3 lines
Quoted 3 lines
--
2.22.0.709.g102302147b-goog
Regards,
Simon
PATCH 31/39 env: Drop _ENTRY
Quoted 31 lines · Simon Glass
Hi Joe,
Quoted 20 lines · Joe Hershberger
Quoted 18 lines · Simon Glass
This typedef does not need to be defined in the
search.hheader since it is only used in one file (hashtable.c). Remove it from the header and change it to a struct.Signed-off-by Simon Glass <[email protected]>---
include/search.h | 2 +- lib/hashtable.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-)include/search.h +0
-0@@ -42,7 +42,7 @@ struct env_entry {Quoted 6 lines
include/search.h struct env_entry { · line 45
Quoted 4 lines
include/search.h +1
-1/* Data type for reentrant functions. */ struct hsearch_data { -struct _ENTRY *table; +struct env_entry_node *table;Don't you need an opaque definition of this?
Quoted 2 lines
I don't see why. We can just use struct
env_entry_nodewhich is opaque if the definition is not available.
I agree, but doesn't it need to be defined? Maybe the misunderstanding is happening because of the intermediate state of things through out this series.
Quoted 6 lines
Quoted 4 lines
Also, there is an opaque definition of
_ENTRYin this file that needs to go away.Where is that? I can't see it.
I'm looking at master... "include/search.h" line 42 of 123
Quoted 42 lines
Quoted 32 lines
Quoted 32 lines
include/search.h +0
-0unsigned int size;unsigned int filled;/* lib/hashtable.c +4
-3@@ -59,10 +59,10 @@* which describes the current status. */ -typedef struct _ENTRY { +struct env_entry_node {int used;struct env_entry entry; -}_ENTRY ; +}; static void _hdelete(const char *key, struct hsearch_data *htab,@@ -120,7 +120,8 @@ int hcreate_r(size_t nel, struct hsearch_data *htab) htab->filled =0 ;/* allocate memory and zero out */ - htab->table = (_ENTRY *)calloc (htab->size +1 ,sizeof (_ENTRY)); + htab->table = (struct env_entry_node *)calloc (htab->size +1 , +sizeof (struct env_entry_node ));if (htab->table ==NULL )return 0 ;Quoted 3 lines
Quoted 3 lines
--
2.22.0.709.g102302147b-googRegards,
Simon
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 31/39 env: Drop _ENTRY
Hi,
Quoted 33 lines · Joe Hershberger
Quoted 31 lines · Simon Glass
Hi Joe,
Quoted 26 lines · Joe Hershberger
Quoted 17 lines · Simon Glass
This typedef does not need to be defined in the
search.hheader since it is only used in one file (hashtable.c). Remove it from the header and change it to a struct.Signed-off-by Simon Glass <[email protected]>---
include/search.h | 2 +- lib/hashtable.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-)include/search.h +0
-0include/search.h struct env_entry { · line 45
Quoted 5 lines
include/search.h +1
-1@@ -42,7 +42,7 @@ struct env_entry {/* Data type for reentrant functions. */ struct hsearch_data { -struct _ENTRY *table; +struct env_entry_node *table;Don't you need an opaque definition of this?
Quoted 6 lines
Quoted 2 lines
I don't see why. We can just use struct
env_entry_nodewhich is opaque if the definition is not available.I agree, but doesn't it need to be defined? Maybe the misunderstanding is happening because of the intermediate state of things through out this series.
(yes, I had trouble figuring out how to split this series up so people could actually review it!)
I don't think it needs to be defined separate here, since it is not in a function scope, so mentioning it inside a struct seems to work OK.
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
Also, there is an opaque definition of
_ENTRYin this file that needs to go away.Where is that? I can't see it.
I'm looking at master... "
include/search.h" line 42 of 123
OK, I see. That is removed in the previous patch "env: Drop the ENTRY typdef"
Regards,
Simon
PATCH 31/39 env: Drop _ENTRY
Quoted 40 lines · Simon Glass
Hi,
Quoted 36 lines · Joe Hershberger
Quoted 33 lines · Simon Glass
Hi Joe,
Quoted 20 lines · Joe Hershberger
Quoted 18 lines · Simon Glass
This typedef does not need to be defined in the
search.hheader since it is only used in one file (hashtable.c). Remove it from the header and change it to a struct.Signed-off-by Simon Glass <[email protected]>---
include/search.h | 2 +- lib/hashtable.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-)include/search.h +0
-0@@ -42,7 +42,7 @@ struct env_entry {Quoted 6 lines
include/search.h struct env_entry { · line 45
Quoted 4 lines
include/search.h +1
-1/* Data type for reentrant functions. */ struct hsearch_data { -struct _ENTRY *table; +struct env_entry_node *table;Don't you need an opaque definition of this?
I don't see why. We can just use struct
env_entry_nodewhich is opaque if the definition is not available.
Quoted 6 lines
Quoted 3 lines
I agree, but doesn't it need to be defined? Maybe the misunderstanding is happening because of the intermediate state of things through out this series.
(yes, I had trouble figuring out how to split this series up so people could actually review it!)
Well, I think you did a fantastic job at it.
Quoted 3 lines
I don't think it needs to be defined separate here, since it is not in a function scope, so mentioning it inside a struct seems to work OK.
Sounds good to me, if it works!
Quoted 11 lines
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
Also, there is an opaque definition of
_ENTRYin this file that needs to go away.Where is that? I can't see it.
I'm looking at master... "
include/search.h" line 42 of 123OK, I see. That is removed in the previous patch "env: Drop the ENTRY typdef"
Ah, ok... It would be better to group it with this patch since _ENTRY shouldn't be related to ENTRY.
Quoted 7 lines
Regards,
Simon
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 31/39 env: Drop _ENTRY
Hi Joe,
Quoted 63 lines · Joe Hershberger
Quoted 40 lines · Simon Glass
Hi,
Quoted 36 lines · Joe Hershberger
Quoted 33 lines · Simon Glass
Hi Joe,
Quoted 20 lines · Joe Hershberger
Quoted 18 lines · Simon Glass
This typedef does not need to be defined in the
search.hheader since it is only used in one file (hashtable.c). Remove it from the header and change it to a struct.Signed-off-by Simon Glass <[email protected]>---
include/search.h | 2 +- lib/hashtable.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-)include/search.h +0
-0@@ -42,7 +42,7 @@ struct env_entry {Quoted 6 lines
include/search.h struct env_entry { · line 45
Quoted 4 lines
include/search.h +1
-1/* Data type for reentrant functions. */ struct hsearch_data { -struct _ENTRY *table; +struct env_entry_node *table;Don't you need an opaque definition of this?
I don't see why. We can just use struct
env_entry_nodewhich is opaque if the definition is not available.Quoted 6 lines
Quoted 3 lines
I agree, but doesn't it need to be defined? Maybe the misunderstanding is happening because of the intermediate state of things through out this series.
(yes, I had trouble figuring out how to split this series up so people could actually review it!)
Well, I think you did a fantastic job at it.
Quoted 3 lines
I don't think it needs to be defined separate here, since it is not in a function scope, so mentioning it inside a struct seems to work OK.
Sounds good to me, if it works!
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Also, there is an opaque definition of
_ENTRYin this file that needs to go away.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Where is that? I can't see it.
I'm looking at master... "
include/search.h" line 42 of 123OK, I see. That is removed in the previous patch "env: Drop the ENTRY typdef"
Ah, ok... It would be better to group it with this patch since
_ENTRYshouldn't be related to ENTRY.
Ah yes of course. Fixed. I'll just send a few updated v3 patches.
Regards,
Simon
PATCH 32/39 env: Rename the redundancy flags
In reply to Simon GlassAdd an ENV prefix to these two flags so that it is clear what they relate to. Also move them to env.h since they are part of the public API. Use an enum rather than a #define to tie them together.
---
cmd/nvedit.c | 2 +- env/eeprom.c | 10 ++++++---- env/flash.c | 18 ++++++++++-------- env/sf.c | 6 ++---- include/env.h | 6 ++++++ include/environment.h | 5 +---- tools/env/fw_env.c | 23 +++++++++++++---------- 7 files changed, 39 insertions(+), 31 deletions(-)
cmd/nvedit.c +1 -1
@@ -1014,7 +1014,7 @@ NXTARG: ; envp->crc =crc32 (0 , envp->data, size ? size - offsetof(env_t , data) :ENV_SIZE );#ifdef CONFIG_ENV_ADDR_REDUND - envp->flags =ACTIVE_FLAG ; + envp->flags =ENVF_REDUND_ACTIVE ;#endif }env_set_hex ("filesize" , len + offsetof(env_t , data));
env/eeprom.c +6 -4
@@ -132,9 +132,11 @@ static int env_eeprom_load(void) gd->env_valid =ENV_REDUND ; }else {/* both ok - check serial */ -if (flags[0 ] ==ACTIVE_FLAG && flags[1 ] ==OBSOLETE_FLAG ) +if (flags[0 ] ==ENVF_REDUND_ACTIVE && + flags[1 ] ==ENVF_REDUND_OBSOLETE ) gd->env_valid =ENV_VALID ; -else if (flags[0 ] ==OBSOLETE_FLAG && flags[1 ] ==ACTIVE_FLAG ) +else if (flags[0 ] ==ENVF_REDUND_OBSOLETE && + flags[1 ] ==ENVF_REDUND_ACTIVE ) gd->env_valid =ENV_REDUND ;else if (flags[0 ] ==0xFF && flags[1 ] ==0 ) gd->env_valid =ENV_REDUND ;
@@ -194,7 +196,7 @@ static int env_eeprom_save(void)unsigned int off =CONFIG_ENV_OFFSET ;#ifdef CONFIG_ENV_OFFSET_REDUND unsigned int off_red =CONFIG_ENV_OFFSET_REDUND ; -char flag_obsolete =OBSOLETE_FLAG ; +char flag_obsolete =ENVF_REDUND_OBSOLETE ;#endif rc =env_export (&env_new);
@@ -207,7 +209,7 @@ static int env_eeprom_save(void) off_red =CONFIG_ENV_OFFSET ; } - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;#endif rc = eeprom_bus_write(CONFIG_SYS_DEF_EEPROM_ADDR,
env/flash.c +10 -8
@@ -95,10 +95,12 @@ static int env_flash_init(void) }else if (!crc1_ok && !crc2_ok) { gd->env_addr = addr_default; gd->env_valid =ENV_INVALID ; - }else if (flag1 ==ACTIVE_FLAG && flag2 ==OBSOLETE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_ACTIVE && + flag2 ==ENVF_REDUND_OBSOLETE ) { gd->env_addr = addr1; gd->env_valid =ENV_VALID ; - }else if (flag1 ==OBSOLETE_FLAG && flag2 ==ACTIVE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_OBSOLETE && + flag2 ==ENVF_REDUND_ACTIVE ) { gd->env_addr = addr2; gd->env_valid =ENV_VALID ; }else if (flag1 == flag2) {
@@ -121,7 +123,7 @@ static int env_flash_save(void) {env_t env_new;char *saved_data =NULL ; -char flag =OBSOLETE_FLAG , new_flag =ACTIVE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE , new_flag =ENVF_REDUND_ACTIVE ;int rc =1 ;#if CONFIG_ENV_SECT_SIZE >CONFIG_ENV_SIZE ulong up_data =0 ;
@@ -322,9 +324,9 @@ static int env_flash_load(void) end_addr_new = ltmp; } -if (flash_addr_new->flags !=OBSOLETE_FLAG && +if (flash_addr_new->flags !=ENVF_REDUND_OBSOLETE &&crc32 (0 , flash_addr_new->data,ENV_SIZE ) == flash_addr_new->crc) { -char flag =OBSOLETE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr_new, end_addr_new);
@@ -334,9 +336,9 @@ static int env_flash_load(void)flash_sect_protect (1 , (ulong )flash_addr_new, end_addr_new); } -if (flash_addr->flags !=ACTIVE_FLAG && - (flash_addr->flags &ACTIVE_FLAG ) ==ACTIVE_FLAG ) { -char flag =ACTIVE_FLAG ; +if (flash_addr->flags !=ENVF_REDUND_ACTIVE && + (flash_addr->flags &ENVF_REDUND_ACTIVE ) ==ENVF_REDUND_ACTIVE ) { +char flag =ENVF_REDUND_ACTIVE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr, end_addr);
env/sf.c +2 -4
@@ -30,8 +30,6 @@ static ulong env_offset = CONFIG_ENV_OFFSET;static ulong env_new_offset =CONFIG_ENV_OFFSET_REDUND ;#endif -#define ACTIVE_FLAG 1 -#define OBSOLETE_FLAG 0#endif /* CONFIG_ENV_OFFSET_REDUND */ DECLARE_GLOBAL_DATA_PTR ;
@@ -74,7 +72,7 @@ static int setup_flash_device(void)static int env_sf_save (void ) {env_t env_new; -char *saved_buffer =NULL , flag =OBSOLETE_FLAG ; +char *saved_buffer =NULL , flag =ENVF_REDUND_OBSOLETE ;u32 saved_size, saved_offset, sector;int ret;
@@ -85,7 +83,7 @@ static int env_sf_save(void) ret =env_export (&env_new);if (ret)return -EIO ; - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;if (gd->env_valid ==ENV_VALID ) { env_new_offset =CONFIG_ENV_OFFSET_REDUND ;
include/env.h +6 -0
@@ -55,6 +55,12 @@ struct env_clbk_tbl { {#name, callback} #endif +/** enum env_redund_flags - Flags for the redundand_environment */ +enum env_redund_flags { + ENVF_REDUND_OBSOLETE = 0, + ENVF_REDUND_ACTIVE = 1, +}; + /** * env_get_id() - Gets a sequence number for the environment *
include/environment.h +1 -4
@@ -135,9 +135,6 @@ extern unsigned long nand_env_oob_offset;#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT # define ENV_HEADER_SIZE (sizeof(uint32_t) + 1) - -# define ACTIVE_FLAG 1 -# define OBSOLETE_FLAG 0#else # define ENV_HEADER_SIZE (sizeof(uint32_t))#endif
@@ -147,7 +144,7 @@ extern unsigned long nand_env_oob_offset;typedef struct environment_s {uint32_t crc;/* CRC32 over data bytes */ #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT -unsigned char flags;/* active/obsolete flags */ +unsigned char flags;/* active/obsolete flags ENVF_REDUND_ */ #endif unsigned char data[ENV_SIZE ];/* Environment data */ }env_t ;
tools/env/fw_env.c +13 -10
@@ -119,9 +119,12 @@ static struct environment environment = {static int have_redund_env; -static unsigned char active_flag =1 ; -/* obsolete_flag must be 0 to efficiently set it on NOR flash without erasing */ -static unsigned char obsolete_flag =0 ; +static unsigned char ENVF_REDUND_ACTIVE =1 ; +/* +* ENVF_REDUND_OBSOLETE must be 0 to efficiently set it on NOR flash without +* erasing +*/ +static unsigned char ENVF_REDUND_OBSOLETE ;#define DEFAULT_ENV_INSTANCE_STATIC #include <env_default.h>
@@ -1142,7 +1145,7 @@ static int flash_flag_obsolete(int dev, int fd, off_t offset) erase.start =DEVOFFSET (dev); erase.length =DEVESIZE (dev); -/* This relies on the fact, that obsolete_flag == 0 */ +/* This relies on the fact, that ENVF_REDUND_OBSOLETE == 0 */ rc =lseek (fd, offset,SEEK_SET );if (rc <0 ) { fprintf(stderr, "Cannot seek to set the flag on %s\n",
@@ -1150,7 +1153,7 @@ static int flash_flag_obsolete(int dev, int fd, off_t offset)return rc; }ioctl (fd,MEMUNLOCK , &erase); - rc =write (fd, &obsolete_flag,sizeof (obsolete_flag)); + rc =write (fd, &ENVF_REDUND_OBSOLETE ,sizeof (ENVF_REDUND_OBSOLETE ));ioctl (fd,MEMLOCK , &erase);if (rc <0 )perror ("Could not set obsolete flag" );
@@ -1169,7 +1172,7 @@ static int flash_write(int fd_current, int fd_target, int dev_target) (*environment.flags)++;break ;case FLAG_BOOLEAN : - *environment.flags = active_flag; + *environment.flags =ENVF_REDUND_ACTIVE ;break ;default : fprintf(stderr, "Unimplemented flash scheme %u\n",
@@ -1508,11 +1511,11 @@ int fw_env_open(struct env_opts *opts) }else {switch (environment.flag_scheme) {case FLAG_BOOLEAN : -if (flag0 == active_flag && - flag1 == obsolete_flag) { +if (flag0 ==ENVF_REDUND_ACTIVE && + flag1 ==ENVF_REDUND_OBSOLETE ) { dev_current =0 ; - }else if (flag0 == obsolete_flag && - flag1 == active_flag) { + }else if (flag0 ==ENVF_REDUND_OBSOLETE && + flag1 ==ENVF_REDUND_ACTIVE ) { dev_current =1 ; }else if (flag0 == flag1) { dev_current =0 ;
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 32/39 env: Rename the redundancy flags
Quoted 155 lines · Simon Glass
Add an ENV prefix to these two flags so that it is clear what they relate to. Also move them to
env.hsince they are part of the public API. Use an enum rather than a #define to tie them together.Signed-off-by Simon Glass <[email protected]>---
cmd/nvedit.c | 2 +- env/eeprom.c | 10 ++++++---- env/flash.c | 18 ++++++++++-------- env/sf.c | 6 ++---- include/env.h | 6 ++++++ include/environment.h | 5 +---- tools/env/fw_env.c | 23 +++++++++++++---------- 7 files changed, 39 insertions(+), 31 deletions(-)cmd/nvedit.c +1
-1@@ -1014,7 +1014,7 @@ NXTARG: ; envp->crc =crc32 (0 , envp->data, size ? size - offsetof(env_t , data) :ENV_SIZE );#ifdef CONFIG_ENV_ADDR_REDUND - envp->flags =ACTIVE_FLAG ; + envp->flags =ENVF_REDUND_ACTIVE ;#endif }env_set_hex ("filesize" , len + offsetof(env_t , data));env/eeprom.c +6
-4@@ -132,9 +132,11 @@ static int env_eeprom_load(void) gd->env_valid =ENV_REDUND ; }else {/* both ok - check serial */ -if (flags[0 ] ==ACTIVE_FLAG && flags[1 ] ==OBSOLETE_FLAG ) +if (flags[0 ] ==ENVF_REDUND_ACTIVE && + flags[1 ] ==ENVF_REDUND_OBSOLETE ) gd->env_valid =ENV_VALID ; -else if (flags[0 ] ==OBSOLETE_FLAG && flags[1 ] ==ACTIVE_FLAG ) +else if (flags[0 ] ==ENVF_REDUND_OBSOLETE && + flags[1 ] ==ENVF_REDUND_ACTIVE ) gd->env_valid =ENV_REDUND ;else if (flags[0 ] ==0xFF && flags[1 ] ==0 ) gd->env_valid =ENV_REDUND ;@@ -194,7 +196,7 @@ static int env_eeprom_save(void)unsigned int off =CONFIG_ENV_OFFSET ;#ifdef CONFIG_ENV_OFFSET_REDUND unsigned int off_red =CONFIG_ENV_OFFSET_REDUND ; -char flag_obsolete =OBSOLETE_FLAG ; +char flag_obsolete =ENVF_REDUND_OBSOLETE ;#endif rc =env_export (&env_new);@@ -207,7 +209,7 @@ static int env_eeprom_save(void) off_red =CONFIG_ENV_OFFSET ; } - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;#endif rc = eeprom_bus_write(CONFIG_SYS_DEF_EEPROM_ADDR,env/flash.c +10
-8@@ -95,10 +95,12 @@ static int env_flash_init(void) }else if (!crc1_ok && !crc2_ok) { gd->env_addr = addr_default; gd->env_valid =ENV_INVALID ; - }else if (flag1 ==ACTIVE_FLAG && flag2 ==OBSOLETE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_ACTIVE && + flag2 ==ENVF_REDUND_OBSOLETE ) { gd->env_addr = addr1; gd->env_valid =ENV_VALID ; - }else if (flag1 ==OBSOLETE_FLAG && flag2 ==ACTIVE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_OBSOLETE && + flag2 ==ENVF_REDUND_ACTIVE ) { gd->env_addr = addr2; gd->env_valid =ENV_VALID ; }else if (flag1 == flag2) {@@ -121,7 +123,7 @@ static int env_flash_save(void) {env_t env_new;char *saved_data =NULL ; -char flag =OBSOLETE_FLAG , new_flag =ACTIVE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE , new_flag =ENVF_REDUND_ACTIVE ;int rc =1 ;#if CONFIG_ENV_SECT_SIZE >CONFIG_ENV_SIZE ulong up_data =0 ;@@ -322,9 +324,9 @@ static int env_flash_load(void) end_addr_new = ltmp; } -if (flash_addr_new->flags !=OBSOLETE_FLAG && +if (flash_addr_new->flags !=ENVF_REDUND_OBSOLETE &&crc32 (0 , flash_addr_new->data,ENV_SIZE ) == flash_addr_new->crc) { -char flag =OBSOLETE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr_new, end_addr_new);@@ -334,9 +336,9 @@ static int env_flash_load(void)flash_sect_protect (1 , (ulong )flash_addr_new, end_addr_new); } -if (flash_addr->flags !=ACTIVE_FLAG && - (flash_addr->flags &ACTIVE_FLAG ) ==ACTIVE_FLAG ) { -char flag =ACTIVE_FLAG ; +if (flash_addr->flags !=ENVF_REDUND_ACTIVE && + (flash_addr->flags &ENVF_REDUND_ACTIVE ) ==ENVF_REDUND_ACTIVE ) { +char flag =ENVF_REDUND_ACTIVE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr, end_addr);env/sf.c +2
-4@@ -30,8 +30,6 @@ static ulong env_offset = CONFIG_ENV_OFFSET;static ulong env_new_offset =CONFIG_ENV_OFFSET_REDUND ;#endif -#define ACTIVE_FLAG 1 -#define OBSOLETE_FLAG 0#endif /* CONFIG_ENV_OFFSET_REDUND */ DECLARE_GLOBAL_DATA_PTR ;@@ -74,7 +72,7 @@ static int setup_flash_device(void)static int env_sf_save (void ) {env_t env_new; -char *saved_buffer =NULL , flag =OBSOLETE_FLAG ; +char *saved_buffer =NULL , flag =ENVF_REDUND_OBSOLETE ;u32 saved_size, saved_offset, sector;int ret;@@ -85,7 +83,7 @@ static int env_sf_save(void) ret =env_export (&env_new);if (ret)return -EIO ; - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;if (gd->env_valid ==ENV_VALID ) { env_new_offset =CONFIG_ENV_OFFSET_REDUND ;include/env.h +0
-0
include/env.h struct env_clbk_tbl { · line 58
Quoted 4 lines
include/env.h +1
-0@@ -55,6 +55,12 @@ struct env_clbk_tbl { {#name, callback} #endif +/** enum env_redund_flags - Flags for the redundand_environment */
redundand_environment -> redundant_environment
Argh... that's actually the name of the function!?
Now I see that there was a patch for this [1] , but is assigned to Tom and is deferred. What happened!?
include/env.h struct env_clbk_tbl { · line 61
Quoted 3 lines
include/env.h +3
-0+enum env_redund_flags { +ENVF_REDUND_OBSOLETE =0 , +ENVF_REDUND_ACTIVE =1 ,
Again, I think just ENV here would be nicer.
Quoted 98 lines
include/env.h +2
-0+}; +/** * env_get_id() - Gets a sequence number for the environment * include/environment.h +1
-4@@ -135,9 +135,6 @@ extern unsigned long nand_env_oob_offset;#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT # define ENV_HEADER_SIZE (sizeof(uint32_t) + 1) - -# define ACTIVE_FLAG 1 -# define OBSOLETE_FLAG 0#else # define ENV_HEADER_SIZE (sizeof(uint32_t))#endif @@ -147,7 +144,7 @@ extern unsigned long nand_env_oob_offset;typedef struct environment_s {uint32_t crc;/* CRC32 over data bytes */ #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT -unsigned char flags;/* active/obsolete flags */ +unsigned char flags;/* active/obsolete flags ENVF_REDUND_ */ #endif unsigned char data[ENV_SIZE ];/* Environment data */ }env_t ;tools/env/fw_env.c +13
-11@@ -119,9 +119,12 @@ static struct environment environment = {static int have_redund_env; -static unsigned char active_flag =1 ; -/* obsolete_flag must be 0 to efficiently set it on NOR flash without erasing */ -static unsigned char obsolete_flag =0 ; +static unsigned char ENVF_REDUND_ACTIVE =1 ; +/* +* ENVF_REDUND_OBSOLETE must be 0 to efficiently set it on NOR flash without +* erasing +*/ +static unsigned char ENVF_REDUND_OBSOLETE ;#define DEFAULT_ENV_INSTANCE_STATIC #include <env_default.h> @@ -1142,7 +1145,7 @@ static int flash_flag_obsolete(int dev, int fd, off_t offset) erase.start =DEVOFFSET (dev); erase.length =DEVESIZE (dev); -/* This relies on the fact, that obsolete_flag == 0 */ +/* This relies on the fact, that ENVF_REDUND_OBSOLETE == 0 */ rc =lseek (fd, offset,SEEK_SET );if (rc <0 ) { fprintf(stderr, "Cannot seek to set the flag on %s\n",@@ -1150,7 +1153,7 @@ static int flash_flag_obsolete(int dev, int fd, off_t offset)return rc; }ioctl (fd,MEMUNLOCK , &erase); - rc =write (fd, &obsolete_flag,sizeof (obsolete_flag)); + rc =write (fd, &ENVF_REDUND_OBSOLETE ,sizeof (ENVF_REDUND_OBSOLETE ));ioctl (fd,MEMLOCK , &erase);if (rc <0 )perror ("Could not set obsolete flag" );@@ -1169,7 +1172,7 @@ static int flash_write(int fd_current, int fd_target, int dev_target) (*environment.flags)++;break ;case FLAG_BOOLEAN : - *environment.flags = active_flag; + *environment.flags =ENVF_REDUND_ACTIVE ;break ;default : fprintf(stderr, "Unimplemented flash scheme %u\n",@@ -1508,11 +1511,11 @@ int fw_env_open(struct env_opts *opts) }else {switch (environment.flag_scheme) {case FLAG_BOOLEAN : -if (flag0 == active_flag && - flag1 == obsolete_flag) { +if (flag0 ==ENVF_REDUND_ACTIVE && + flag1 ==ENVF_REDUND_OBSOLETE ) { dev_current =0 ; - }else if (flag0 == obsolete_flag && - flag1 == active_flag) { + }else if (flag0 ==ENVF_REDUND_OBSOLETE && + flag1 ==ENVF_REDUND_ACTIVE ) { dev_current =1 ; }else if (flag0 == flag1) { dev_current =0 ; --2.22.0.709.g102302147b-goog
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 32/39 env: Rename the redundancy flags
Hi Joe,
Quoted 160 lines · Joe Hershberger
Quoted 158 lines · Simon Glass
Add an ENV prefix to these two flags so that it is clear what they relate to. Also move them to
env.hsince they are part of the public API. Use an enum rather than a #define to tie them together.Signed-off-by Simon Glass <[email protected]>---
cmd/nvedit.c | 2 +- env/eeprom.c | 10 ++++++---- env/flash.c | 18 ++++++++++-------- env/sf.c | 6 ++---- include/env.h | 6 ++++++ include/environment.h | 5 +---- tools/env/fw_env.c | 23 +++++++++++++---------- 7 files changed, 39 insertions(+), 31 deletions(-)cmd/nvedit.c +1
-1@@ -1014,7 +1014,7 @@ NXTARG: ; envp->crc =crc32 (0 , envp->data, size ? size - offsetof(env_t , data) :ENV_SIZE );#ifdef CONFIG_ENV_ADDR_REDUND - envp->flags =ACTIVE_FLAG ; + envp->flags =ENVF_REDUND_ACTIVE ;#endif }env_set_hex ("filesize" , len + offsetof(env_t , data));env/eeprom.c +6
-4@@ -132,9 +132,11 @@ static int env_eeprom_load(void) gd->env_valid =ENV_REDUND ; }else {/* both ok - check serial */ -if (flags[0 ] ==ACTIVE_FLAG && flags[1 ] ==OBSOLETE_FLAG ) +if (flags[0 ] ==ENVF_REDUND_ACTIVE && + flags[1 ] ==ENVF_REDUND_OBSOLETE ) gd->env_valid =ENV_VALID ; -else if (flags[0 ] ==OBSOLETE_FLAG && flags[1 ] ==ACTIVE_FLAG ) +else if (flags[0 ] ==ENVF_REDUND_OBSOLETE && + flags[1 ] ==ENVF_REDUND_ACTIVE ) gd->env_valid =ENV_REDUND ;else if (flags[0 ] ==0xFF && flags[1 ] ==0 ) gd->env_valid =ENV_REDUND ;@@ -194,7 +196,7 @@ static int env_eeprom_save(void)unsigned int off =CONFIG_ENV_OFFSET ;#ifdef CONFIG_ENV_OFFSET_REDUND unsigned int off_red =CONFIG_ENV_OFFSET_REDUND ; -char flag_obsolete =OBSOLETE_FLAG ; +char flag_obsolete =ENVF_REDUND_OBSOLETE ;#endif rc =env_export (&env_new);@@ -207,7 +209,7 @@ static int env_eeprom_save(void) off_red =CONFIG_ENV_OFFSET ; } - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;#endif rc = eeprom_bus_write(CONFIG_SYS_DEF_EEPROM_ADDR,env/flash.c +10
-8@@ -95,10 +95,12 @@ static int env_flash_init(void) }else if (!crc1_ok && !crc2_ok) { gd->env_addr = addr_default; gd->env_valid =ENV_INVALID ; - }else if (flag1 ==ACTIVE_FLAG && flag2 ==OBSOLETE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_ACTIVE && + flag2 ==ENVF_REDUND_OBSOLETE ) { gd->env_addr = addr1; gd->env_valid =ENV_VALID ; - }else if (flag1 ==OBSOLETE_FLAG && flag2 ==ACTIVE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_OBSOLETE && + flag2 ==ENVF_REDUND_ACTIVE ) { gd->env_addr = addr2; gd->env_valid =ENV_VALID ; }else if (flag1 == flag2) {@@ -121,7 +123,7 @@ static int env_flash_save(void) {env_t env_new;char *saved_data =NULL ; -char flag =OBSOLETE_FLAG , new_flag =ACTIVE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE , new_flag =ENVF_REDUND_ACTIVE ;int rc =1 ;#if CONFIG_ENV_SECT_SIZE >CONFIG_ENV_SIZE ulong up_data =0 ;@@ -322,9 +324,9 @@ static int env_flash_load(void) end_addr_new = ltmp; } -if (flash_addr_new->flags !=OBSOLETE_FLAG && +if (flash_addr_new->flags !=ENVF_REDUND_OBSOLETE &&crc32 (0 , flash_addr_new->data,ENV_SIZE ) == flash_addr_new->crc) { -char flag =OBSOLETE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr_new, end_addr_new);@@ -334,9 +336,9 @@ static int env_flash_load(void)flash_sect_protect (1 , (ulong )flash_addr_new, end_addr_new); } -if (flash_addr->flags !=ACTIVE_FLAG && - (flash_addr->flags &ACTIVE_FLAG ) ==ACTIVE_FLAG ) { -char flag =ACTIVE_FLAG ; +if (flash_addr->flags !=ENVF_REDUND_ACTIVE && + (flash_addr->flags &ENVF_REDUND_ACTIVE ) ==ENVF_REDUND_ACTIVE ) { +char flag =ENVF_REDUND_ACTIVE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr, end_addr);env/sf.c +2
-4@@ -30,8 +30,6 @@ static ulong env_offset = CONFIG_ENV_OFFSET;static ulong env_new_offset =CONFIG_ENV_OFFSET_REDUND ;#endif -#define ACTIVE_FLAG 1 -#define OBSOLETE_FLAG 0#endif /* CONFIG_ENV_OFFSET_REDUND */ DECLARE_GLOBAL_DATA_PTR ;@@ -74,7 +72,7 @@ static int setup_flash_device(void)static int env_sf_save (void ) {env_t env_new; -char *saved_buffer =NULL , flag =OBSOLETE_FLAG ; +char *saved_buffer =NULL , flag =ENVF_REDUND_OBSOLETE ;u32 saved_size, saved_offset, sector;int ret;@@ -85,7 +83,7 @@ static int env_sf_save(void) ret =env_export (&env_new);if (ret)return -EIO ; - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;if (gd->env_valid ==ENV_VALID ) { env_new_offset =CONFIG_ENV_OFFSET_REDUND ;include/env.h +0
-0@@ -55,6 +55,12 @@ struct env_clbk_tbl { {#name, callback} #endif
Quoted 5 lines
include/env.h struct env_clbk_tbl { · line 58
Quoted 1 line
include/env.h +1
-0+/** enum env_redund_flags - Flags for the redundand_environment */
redundand_environment->redundant_environmentArgh... that's actually the name of the function!?
Yes
Quoted 5 lines
Now I see that there was a patch for this [1] , but is assigned to Tom and is deferred. What happened!?
Not a lot :-)
Quoted 6 lines
include/env.h struct env_clbk_tbl { · line 61
Quoted 4 lines
include/env.h +3
-0+enum env_redund_flags { +ENVF_REDUND_OBSOLETE =0 , +ENVF_REDUND_ACTIVE =1 ,Again, I think just ENV here would be nicer.
OK.
- Simon
PATCH 32/39 env: Rename the redundancy flags
Quoted 173 lines · Simon Glass
Hi Joe,
Quoted 160 lines · Joe Hershberger
Quoted 158 lines · Simon Glass
Add an ENV prefix to these two flags so that it is clear what they relate to. Also move them to
env.hsince they are part of the public API. Use an enum rather than a #define to tie them together.Signed-off-by Simon Glass <[email protected]>---
cmd/nvedit.c | 2 +- env/eeprom.c | 10 ++++++---- env/flash.c | 18 ++++++++++-------- env/sf.c | 6 ++---- include/env.h | 6 ++++++ include/environment.h | 5 +---- tools/env/fw_env.c | 23 +++++++++++++---------- 7 files changed, 39 insertions(+), 31 deletions(-)cmd/nvedit.c +1
-1@@ -1014,7 +1014,7 @@ NXTARG: ; envp->crc =crc32 (0 , envp->data, size ? size - offsetof(env_t , data) :ENV_SIZE );#ifdef CONFIG_ENV_ADDR_REDUND - envp->flags =ACTIVE_FLAG ; + envp->flags =ENVF_REDUND_ACTIVE ;#endif }env_set_hex ("filesize" , len + offsetof(env_t , data));env/eeprom.c +6
-4@@ -132,9 +132,11 @@ static int env_eeprom_load(void) gd->env_valid =ENV_REDUND ; }else {/* both ok - check serial */ -if (flags[0 ] ==ACTIVE_FLAG && flags[1 ] ==OBSOLETE_FLAG ) +if (flags[0 ] ==ENVF_REDUND_ACTIVE && + flags[1 ] ==ENVF_REDUND_OBSOLETE ) gd->env_valid =ENV_VALID ; -else if (flags[0 ] ==OBSOLETE_FLAG && flags[1 ] ==ACTIVE_FLAG ) +else if (flags[0 ] ==ENVF_REDUND_OBSOLETE && + flags[1 ] ==ENVF_REDUND_ACTIVE ) gd->env_valid =ENV_REDUND ;else if (flags[0 ] ==0xFF && flags[1 ] ==0 ) gd->env_valid =ENV_REDUND ;@@ -194,7 +196,7 @@ static int env_eeprom_save(void)unsigned int off =CONFIG_ENV_OFFSET ;#ifdef CONFIG_ENV_OFFSET_REDUND unsigned int off_red =CONFIG_ENV_OFFSET_REDUND ; -char flag_obsolete =OBSOLETE_FLAG ; +char flag_obsolete =ENVF_REDUND_OBSOLETE ;#endif rc =env_export (&env_new);@@ -207,7 +209,7 @@ static int env_eeprom_save(void) off_red =CONFIG_ENV_OFFSET ; } - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;#endif rc = eeprom_bus_write(CONFIG_SYS_DEF_EEPROM_ADDR,env/flash.c +10
-8@@ -95,10 +95,12 @@ static int env_flash_init(void) }else if (!crc1_ok && !crc2_ok) { gd->env_addr = addr_default; gd->env_valid =ENV_INVALID ; - }else if (flag1 ==ACTIVE_FLAG && flag2 ==OBSOLETE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_ACTIVE && + flag2 ==ENVF_REDUND_OBSOLETE ) { gd->env_addr = addr1; gd->env_valid =ENV_VALID ; - }else if (flag1 ==OBSOLETE_FLAG && flag2 ==ACTIVE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_OBSOLETE && + flag2 ==ENVF_REDUND_ACTIVE ) { gd->env_addr = addr2; gd->env_valid =ENV_VALID ; }else if (flag1 == flag2) {@@ -121,7 +123,7 @@ static int env_flash_save(void) {env_t env_new;char *saved_data =NULL ; -char flag =OBSOLETE_FLAG , new_flag =ACTIVE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE , new_flag =ENVF_REDUND_ACTIVE ;int rc =1 ;#if CONFIG_ENV_SECT_SIZE >CONFIG_ENV_SIZE ulong up_data =0 ;@@ -322,9 +324,9 @@ static int env_flash_load(void) end_addr_new = ltmp; } -if (flash_addr_new->flags !=OBSOLETE_FLAG && +if (flash_addr_new->flags !=ENVF_REDUND_OBSOLETE &&crc32 (0 , flash_addr_new->data,ENV_SIZE ) == flash_addr_new->crc) { -char flag =OBSOLETE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr_new, end_addr_new);@@ -334,9 +336,9 @@ static int env_flash_load(void)flash_sect_protect (1 , (ulong )flash_addr_new, end_addr_new); } -if (flash_addr->flags !=ACTIVE_FLAG && - (flash_addr->flags &ACTIVE_FLAG ) ==ACTIVE_FLAG ) { -char flag =ACTIVE_FLAG ; +if (flash_addr->flags !=ENVF_REDUND_ACTIVE && + (flash_addr->flags &ENVF_REDUND_ACTIVE ) ==ENVF_REDUND_ACTIVE ) { +char flag =ENVF_REDUND_ACTIVE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr, end_addr);env/sf.c +2
-4@@ -30,8 +30,6 @@ static ulong env_offset = CONFIG_ENV_OFFSET;static ulong env_new_offset =CONFIG_ENV_OFFSET_REDUND ;#endif -#define ACTIVE_FLAG 1 -#define OBSOLETE_FLAG 0#endif /* CONFIG_ENV_OFFSET_REDUND */ DECLARE_GLOBAL_DATA_PTR ;@@ -74,7 +72,7 @@ static int setup_flash_device(void)static int env_sf_save (void ) {env_t env_new; -char *saved_buffer =NULL , flag =OBSOLETE_FLAG ; +char *saved_buffer =NULL , flag =ENVF_REDUND_OBSOLETE ;u32 saved_size, saved_offset, sector;int ret;@@ -85,7 +83,7 @@ static int env_sf_save(void) ret =env_export (&env_new);if (ret)return -EIO ; - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;if (gd->env_valid ==ENV_VALID ) { env_new_offset =CONFIG_ENV_OFFSET_REDUND ;include/env.h +0
-0@@ -55,6 +55,12 @@ struct env_clbk_tbl { {#name, callback} #endifQuoted 5 lines
include/env.h struct env_clbk_tbl { · line 58
Quoted 1 line
include/env.h +1
-0+/** enum env_redund_flags - Flags for the redundand_environment */
redundand_environment->redundant_environmentArgh... that's actually the name of the function!?
Yes
Quoted 1 line
Quoted 6 lines
Quoted 4 lines
Now I see that there was a patch for this [1] , but is assigned to Tom and is deferred. What happened!?
Not a lot :-)
Was there a problem with it or just forgotten about. Tom?
It would be nice to recreate it in the modern codebase.
Quoted 15 lines
Quoted 7 lines
include/env.h struct env_clbk_tbl { · line 61
Quoted 5 lines
include/env.h +3
-0+enum env_redund_flags { +ENVF_REDUND_OBSOLETE =0 , +ENVF_REDUND_ACTIVE =1 ,Again, I think just ENV here would be nicer.
OK.
- Simon
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 32/39 env: Rename the redundancy flags
Quoted 177 lines · Joe Hershberger
Quoted 176 lines · Simon Glass
Hi Joe,
Quoted 160 lines · Joe Hershberger
Quoted 158 lines · Simon Glass
Add an ENV prefix to these two flags so that it is clear what they relate to. Also move them to
env.hsince they are part of the public API. Use an enum rather than a #define to tie them together.Signed-off-by Simon Glass <[email protected]>---
cmd/nvedit.c | 2 +- env/eeprom.c | 10 ++++++---- env/flash.c | 18 ++++++++++-------- env/sf.c | 6 ++---- include/env.h | 6 ++++++ include/environment.h | 5 +---- tools/env/fw_env.c | 23 +++++++++++++---------- 7 files changed, 39 insertions(+), 31 deletions(-)cmd/nvedit.c +1
-1@@ -1014,7 +1014,7 @@ NXTARG: ; envp->crc =crc32 (0 , envp->data, size ? size - offsetof(env_t , data) :ENV_SIZE );#ifdef CONFIG_ENV_ADDR_REDUND - envp->flags =ACTIVE_FLAG ; + envp->flags =ENVF_REDUND_ACTIVE ;#endif }env_set_hex ("filesize" , len + offsetof(env_t , data));env/eeprom.c +6
-4@@ -132,9 +132,11 @@ static int env_eeprom_load(void) gd->env_valid =ENV_REDUND ; }else {/* both ok - check serial */ -if (flags[0 ] ==ACTIVE_FLAG && flags[1 ] ==OBSOLETE_FLAG ) +if (flags[0 ] ==ENVF_REDUND_ACTIVE && + flags[1 ] ==ENVF_REDUND_OBSOLETE ) gd->env_valid =ENV_VALID ; -else if (flags[0 ] ==OBSOLETE_FLAG && flags[1 ] ==ACTIVE_FLAG ) +else if (flags[0 ] ==ENVF_REDUND_OBSOLETE && + flags[1 ] ==ENVF_REDUND_ACTIVE ) gd->env_valid =ENV_REDUND ;else if (flags[0 ] ==0xFF && flags[1 ] ==0 ) gd->env_valid =ENV_REDUND ;@@ -194,7 +196,7 @@ static int env_eeprom_save(void)unsigned int off =CONFIG_ENV_OFFSET ;#ifdef CONFIG_ENV_OFFSET_REDUND unsigned int off_red =CONFIG_ENV_OFFSET_REDUND ; -char flag_obsolete =OBSOLETE_FLAG ; +char flag_obsolete =ENVF_REDUND_OBSOLETE ;#endif rc =env_export (&env_new);@@ -207,7 +209,7 @@ static int env_eeprom_save(void) off_red =CONFIG_ENV_OFFSET ; } - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;#endif rc = eeprom_bus_write(CONFIG_SYS_DEF_EEPROM_ADDR,env/flash.c +10
-8@@ -95,10 +95,12 @@ static int env_flash_init(void) }else if (!crc1_ok && !crc2_ok) { gd->env_addr = addr_default; gd->env_valid =ENV_INVALID ; - }else if (flag1 ==ACTIVE_FLAG && flag2 ==OBSOLETE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_ACTIVE && + flag2 ==ENVF_REDUND_OBSOLETE ) { gd->env_addr = addr1; gd->env_valid =ENV_VALID ; - }else if (flag1 ==OBSOLETE_FLAG && flag2 ==ACTIVE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_OBSOLETE && + flag2 ==ENVF_REDUND_ACTIVE ) { gd->env_addr = addr2; gd->env_valid =ENV_VALID ; }else if (flag1 == flag2) {@@ -121,7 +123,7 @@ static int env_flash_save(void) {env_t env_new;char *saved_data =NULL ; -char flag =OBSOLETE_FLAG , new_flag =ACTIVE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE , new_flag =ENVF_REDUND_ACTIVE ;int rc =1 ;#if CONFIG_ENV_SECT_SIZE >CONFIG_ENV_SIZE ulong up_data =0 ;@@ -322,9 +324,9 @@ static int env_flash_load(void) end_addr_new = ltmp; } -if (flash_addr_new->flags !=OBSOLETE_FLAG && +if (flash_addr_new->flags !=ENVF_REDUND_OBSOLETE &&crc32 (0 , flash_addr_new->data,ENV_SIZE ) == flash_addr_new->crc) { -char flag =OBSOLETE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr_new, end_addr_new);@@ -334,9 +336,9 @@ static int env_flash_load(void)flash_sect_protect (1 , (ulong )flash_addr_new, end_addr_new); } -if (flash_addr->flags !=ACTIVE_FLAG && - (flash_addr->flags &ACTIVE_FLAG ) ==ACTIVE_FLAG ) { -char flag =ACTIVE_FLAG ; +if (flash_addr->flags !=ENVF_REDUND_ACTIVE && + (flash_addr->flags &ENVF_REDUND_ACTIVE ) ==ENVF_REDUND_ACTIVE ) { +char flag =ENVF_REDUND_ACTIVE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr, end_addr);env/sf.c +2
-4@@ -30,8 +30,6 @@ static ulong env_offset = CONFIG_ENV_OFFSET;static ulong env_new_offset =CONFIG_ENV_OFFSET_REDUND ;#endif -#define ACTIVE_FLAG 1 -#define OBSOLETE_FLAG 0#endif /* CONFIG_ENV_OFFSET_REDUND */ DECLARE_GLOBAL_DATA_PTR ;@@ -74,7 +72,7 @@ static int setup_flash_device(void)static int env_sf_save (void ) {env_t env_new; -char *saved_buffer =NULL , flag =OBSOLETE_FLAG ; +char *saved_buffer =NULL , flag =ENVF_REDUND_OBSOLETE ;u32 saved_size, saved_offset, sector;int ret;@@ -85,7 +83,7 @@ static int env_sf_save(void) ret =env_export (&env_new);if (ret)return -EIO ; - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;if (gd->env_valid ==ENV_VALID ) { env_new_offset =CONFIG_ENV_OFFSET_REDUND ;include/env.h +0
-0@@ -55,6 +55,12 @@ struct env_clbk_tbl { {#name, callback} #endifQuoted 5 lines
include/env.h struct env_clbk_tbl { · line 58
Quoted 1 line
include/env.h +1
-0+/** enum env_redund_flags - Flags for the redundand_environment */
redundand_environment->redundant_environmentArgh... that's actually the name of the function!?
Yes
Quoted 4 lines
Now I see that there was a patch for this [1] , but is assigned to Tom and is deferred. What happened!?
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Not a lot :-)
Was there a problem with it or just forgotten about. Tom?
It would be nice to recreate it in the modern codebase.
Wasn't entirely sure I wanted to do the correction at the time and as part of deferring patches that've been out for more than a year (honestly, if something hasn't been picked up after a year, it probably won't be) I marked it as deferred.
Signature · 8 lines
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/20190731/31ce27e0/attachment.sig>
PATCH 32/39 env: Rename the redundancy flags
Hi Tom,
Quoted 183 lines · Tom Rini
Quoted 181 lines · Joe Hershberger
Quoted 179 lines · Simon Glass
Hi Joe,
Quoted 160 lines · Joe Hershberger
Quoted 158 lines · Simon Glass
Add an ENV prefix to these two flags so that it is clear what they relate to. Also move them to
env.hsince they are part of the public API. Use an enum rather than a #define to tie them together.Signed-off-by Simon Glass <[email protected]>---
cmd/nvedit.c | 2 +- env/eeprom.c | 10 ++++++---- env/flash.c | 18 ++++++++++-------- env/sf.c | 6 ++---- include/env.h | 6 ++++++ include/environment.h | 5 +---- tools/env/fw_env.c | 23 +++++++++++++---------- 7 files changed, 39 insertions(+), 31 deletions(-)cmd/nvedit.c +1
-1@@ -1014,7 +1014,7 @@ NXTARG: ; envp->crc =crc32 (0 , envp->data, size ? size - offsetof(env_t , data) :ENV_SIZE );#ifdef CONFIG_ENV_ADDR_REDUND - envp->flags =ACTIVE_FLAG ; + envp->flags =ENVF_REDUND_ACTIVE ;#endif }env_set_hex ("filesize" , len + offsetof(env_t , data));env/eeprom.c +6
-4@@ -132,9 +132,11 @@ static int env_eeprom_load(void) gd->env_valid =ENV_REDUND ; }else {/* both ok - check serial */ -if (flags[0 ] ==ACTIVE_FLAG && flags[1 ] ==OBSOLETE_FLAG ) +if (flags[0 ] ==ENVF_REDUND_ACTIVE && + flags[1 ] ==ENVF_REDUND_OBSOLETE ) gd->env_valid =ENV_VALID ; -else if (flags[0 ] ==OBSOLETE_FLAG && flags[1 ] ==ACTIVE_FLAG ) +else if (flags[0 ] ==ENVF_REDUND_OBSOLETE && + flags[1 ] ==ENVF_REDUND_ACTIVE ) gd->env_valid =ENV_REDUND ;else if (flags[0 ] ==0xFF && flags[1 ] ==0 ) gd->env_valid =ENV_REDUND ;@@ -194,7 +196,7 @@ static int env_eeprom_save(void)unsigned int off =CONFIG_ENV_OFFSET ;#ifdef CONFIG_ENV_OFFSET_REDUND unsigned int off_red =CONFIG_ENV_OFFSET_REDUND ; -char flag_obsolete =OBSOLETE_FLAG ; +char flag_obsolete =ENVF_REDUND_OBSOLETE ;#endif rc =env_export (&env_new);@@ -207,7 +209,7 @@ static int env_eeprom_save(void) off_red =CONFIG_ENV_OFFSET ; } - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;#endif rc = eeprom_bus_write(CONFIG_SYS_DEF_EEPROM_ADDR,env/flash.c +10
-8@@ -95,10 +95,12 @@ static int env_flash_init(void) }else if (!crc1_ok && !crc2_ok) { gd->env_addr = addr_default; gd->env_valid =ENV_INVALID ; - }else if (flag1 ==ACTIVE_FLAG && flag2 ==OBSOLETE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_ACTIVE && + flag2 ==ENVF_REDUND_OBSOLETE ) { gd->env_addr = addr1; gd->env_valid =ENV_VALID ; - }else if (flag1 ==OBSOLETE_FLAG && flag2 ==ACTIVE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_OBSOLETE && + flag2 ==ENVF_REDUND_ACTIVE ) { gd->env_addr = addr2; gd->env_valid =ENV_VALID ; }else if (flag1 == flag2) {@@ -121,7 +123,7 @@ static int env_flash_save(void) {env_t env_new;char *saved_data =NULL ; -char flag =OBSOLETE_FLAG , new_flag =ACTIVE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE , new_flag =ENVF_REDUND_ACTIVE ;int rc =1 ;#if CONFIG_ENV_SECT_SIZE >CONFIG_ENV_SIZE ulong up_data =0 ;@@ -322,9 +324,9 @@ static int env_flash_load(void) end_addr_new = ltmp; } -if (flash_addr_new->flags !=OBSOLETE_FLAG && +if (flash_addr_new->flags !=ENVF_REDUND_OBSOLETE &&crc32 (0 , flash_addr_new->data,ENV_SIZE ) == flash_addr_new->crc) { -char flag =OBSOLETE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr_new, end_addr_new);@@ -334,9 +336,9 @@ static int env_flash_load(void)flash_sect_protect (1 , (ulong )flash_addr_new, end_addr_new); } -if (flash_addr->flags !=ACTIVE_FLAG && - (flash_addr->flags &ACTIVE_FLAG ) ==ACTIVE_FLAG ) { -char flag =ACTIVE_FLAG ; +if (flash_addr->flags !=ENVF_REDUND_ACTIVE && + (flash_addr->flags &ENVF_REDUND_ACTIVE ) ==ENVF_REDUND_ACTIVE ) { +char flag =ENVF_REDUND_ACTIVE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr, end_addr);env/sf.c +2
-4@@ -30,8 +30,6 @@ static ulong env_offset = CONFIG_ENV_OFFSET;static ulong env_new_offset =CONFIG_ENV_OFFSET_REDUND ;#endif -#define ACTIVE_FLAG 1 -#define OBSOLETE_FLAG 0#endif /* CONFIG_ENV_OFFSET_REDUND */ DECLARE_GLOBAL_DATA_PTR ;@@ -74,7 +72,7 @@ static int setup_flash_device(void)static int env_sf_save (void ) {env_t env_new; -char *saved_buffer =NULL , flag =OBSOLETE_FLAG ; +char *saved_buffer =NULL , flag =ENVF_REDUND_OBSOLETE ;u32 saved_size, saved_offset, sector;int ret;@@ -85,7 +83,7 @@ static int env_sf_save(void) ret =env_export (&env_new);if (ret)return -EIO ; - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;if (gd->env_valid ==ENV_VALID ) { env_new_offset =CONFIG_ENV_OFFSET_REDUND ;include/env.h +0
-0@@ -55,6 +55,12 @@ struct env_clbk_tbl { {#name, callback} #endifQuoted 5 lines
include/env.h struct env_clbk_tbl { · line 58
Quoted 1 line
include/env.h +1
-0+/** enum env_redund_flags - Flags for the redundand_environment */
redundand_environment->redundant_environmentArgh... that's actually the name of the function!?
Yes
Quoted 5 lines
Now I see that there was a patch for this [1] , but is assigned to Tom and is deferred. What happened!?
Not a lot :-)
Quoted 8 lines
Quoted 3 lines
Was there a problem with it or just forgotten about. Tom?
It would be nice to recreate it in the modern codebase.
Wasn't entirely sure I wanted to do the correction at the time and as part of deferring patches that've been out for more than a year (honestly, if something hasn't been picked up after a year, it probably won't be) I marked it as deferred.
If it was recreated now are you open to taking it?
PATCH 32/39 env: Rename the redundancy flags
Quoted 188 lines · Joe Hershberger
Hi Tom,
Quoted 185 lines · Tom Rini
Quoted 183 lines · Joe Hershberger
Quoted 173 lines · Simon Glass
Hi Joe,
Quoted 160 lines · Joe Hershberger
Quoted 158 lines · Simon Glass
Add an ENV prefix to these two flags so that it is clear what they relate to. Also move them to
env.hsince they are part of the public API. Use an enum rather than a #define to tie them together.Signed-off-by Simon Glass <[email protected]>---
cmd/nvedit.c | 2 +- env/eeprom.c | 10 ++++++---- env/flash.c | 18 ++++++++++-------- env/sf.c | 6 ++---- include/env.h | 6 ++++++ include/environment.h | 5 +---- tools/env/fw_env.c | 23 +++++++++++++---------- 7 files changed, 39 insertions(+), 31 deletions(-)cmd/nvedit.c +1
-1@@ -1014,7 +1014,7 @@ NXTARG: ; envp->crc =crc32 (0 , envp->data, size ? size - offsetof(env_t , data) :ENV_SIZE );#ifdef CONFIG_ENV_ADDR_REDUND - envp->flags =ACTIVE_FLAG ; + envp->flags =ENVF_REDUND_ACTIVE ;#endif }env_set_hex ("filesize" , len + offsetof(env_t , data));env/eeprom.c +6
-4@@ -132,9 +132,11 @@ static int env_eeprom_load(void) gd->env_valid =ENV_REDUND ; }else {/* both ok - check serial */ -if (flags[0 ] ==ACTIVE_FLAG && flags[1 ] ==OBSOLETE_FLAG ) +if (flags[0 ] ==ENVF_REDUND_ACTIVE && + flags[1 ] ==ENVF_REDUND_OBSOLETE ) gd->env_valid =ENV_VALID ; -else if (flags[0 ] ==OBSOLETE_FLAG && flags[1 ] ==ACTIVE_FLAG ) +else if (flags[0 ] ==ENVF_REDUND_OBSOLETE && + flags[1 ] ==ENVF_REDUND_ACTIVE ) gd->env_valid =ENV_REDUND ;else if (flags[0 ] ==0xFF && flags[1 ] ==0 ) gd->env_valid =ENV_REDUND ;@@ -194,7 +196,7 @@ static int env_eeprom_save(void)unsigned int off =CONFIG_ENV_OFFSET ;#ifdef CONFIG_ENV_OFFSET_REDUND unsigned int off_red =CONFIG_ENV_OFFSET_REDUND ; -char flag_obsolete =OBSOLETE_FLAG ; +char flag_obsolete =ENVF_REDUND_OBSOLETE ;#endif rc =env_export (&env_new);@@ -207,7 +209,7 @@ static int env_eeprom_save(void) off_red =CONFIG_ENV_OFFSET ; } - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;#endif rc = eeprom_bus_write(CONFIG_SYS_DEF_EEPROM_ADDR,env/flash.c +10
-8@@ -95,10 +95,12 @@ static int env_flash_init(void) }else if (!crc1_ok && !crc2_ok) { gd->env_addr = addr_default; gd->env_valid =ENV_INVALID ; - }else if (flag1 ==ACTIVE_FLAG && flag2 ==OBSOLETE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_ACTIVE && + flag2 ==ENVF_REDUND_OBSOLETE ) { gd->env_addr = addr1; gd->env_valid =ENV_VALID ; - }else if (flag1 ==OBSOLETE_FLAG && flag2 ==ACTIVE_FLAG ) { + }else if (flag1 ==ENVF_REDUND_OBSOLETE && + flag2 ==ENVF_REDUND_ACTIVE ) { gd->env_addr = addr2; gd->env_valid =ENV_VALID ; }else if (flag1 == flag2) {@@ -121,7 +123,7 @@ static int env_flash_save(void) {env_t env_new;char *saved_data =NULL ; -char flag =OBSOLETE_FLAG , new_flag =ACTIVE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE , new_flag =ENVF_REDUND_ACTIVE ;int rc =1 ;#if CONFIG_ENV_SECT_SIZE >CONFIG_ENV_SIZE ulong up_data =0 ;@@ -322,9 +324,9 @@ static int env_flash_load(void) end_addr_new = ltmp; } -if (flash_addr_new->flags !=OBSOLETE_FLAG && +if (flash_addr_new->flags !=ENVF_REDUND_OBSOLETE &&crc32 (0 , flash_addr_new->data,ENV_SIZE ) == flash_addr_new->crc) { -char flag =OBSOLETE_FLAG ; +char flag =ENVF_REDUND_OBSOLETE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr_new, end_addr_new);@@ -334,9 +336,9 @@ static int env_flash_load(void)flash_sect_protect (1 , (ulong )flash_addr_new, end_addr_new); } -if (flash_addr->flags !=ACTIVE_FLAG && - (flash_addr->flags &ACTIVE_FLAG ) ==ACTIVE_FLAG ) { -char flag =ACTIVE_FLAG ; +if (flash_addr->flags !=ENVF_REDUND_ACTIVE && + (flash_addr->flags &ENVF_REDUND_ACTIVE ) ==ENVF_REDUND_ACTIVE ) { +char flag =ENVF_REDUND_ACTIVE ; gd->env_valid =ENV_REDUND ;flash_sect_protect (0 , (ulong )flash_addr, end_addr);env/sf.c +2
-4@@ -30,8 +30,6 @@ static ulong env_offset = CONFIG_ENV_OFFSET;static ulong env_new_offset =CONFIG_ENV_OFFSET_REDUND ;#endif -#define ACTIVE_FLAG 1 -#define OBSOLETE_FLAG 0#endif /* CONFIG_ENV_OFFSET_REDUND */ DECLARE_GLOBAL_DATA_PTR ;@@ -74,7 +72,7 @@ static int setup_flash_device(void)static int env_sf_save (void ) {env_t env_new; -char *saved_buffer =NULL , flag =OBSOLETE_FLAG ; +char *saved_buffer =NULL , flag =ENVF_REDUND_OBSOLETE ;u32 saved_size, saved_offset, sector;int ret;@@ -85,7 +83,7 @@ static int env_sf_save(void) ret =env_export (&env_new);if (ret)return -EIO ; - env_new.flags =ACTIVE_FLAG ; + env_new.flags =ENVF_REDUND_ACTIVE ;if (gd->env_valid ==ENV_VALID ) { env_new_offset =CONFIG_ENV_OFFSET_REDUND ;include/env.h +0
-0@@ -55,6 +55,12 @@ struct env_clbk_tbl { {#name, callback} #endifQuoted 5 lines
include/env.h struct env_clbk_tbl { · line 58
Quoted 1 line
include/env.h +1
-0+/** enum env_redund_flags - Flags for the redundand_environment */
redundand_environment->redundant_environmentArgh... that's actually the name of the function!?
Yes
Quoted 1 line
Quoted 6 lines
Quoted 4 lines
Now I see that there was a patch for this [1] , but is assigned to Tom and is deferred. What happened!?
Not a lot :-)
Was there a problem with it or just forgotten about. Tom?
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
It would be nice to recreate it in the modern codebase.
Wasn't entirely sure I wanted to do the correction at the time and as part of deferring patches that've been out for more than a year (honestly, if something hasn't been picked up after a year, it probably won't be) I marked it as deferred.
If it was recreated now are you open to taking it?
I suppose so, yeah.
Signature · 8 lines
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/20190801/a50eb22f/attachment.sig>
PATCH 33/39 env: Drop the ACTION typedef
In reply to Simon GlassAvoid using a typedef here which is unnecessary. Add an 'env_' prefix to both the enum and its members to make it clear that these are related to the environment.
Add an ENV prefix to these two flags so that it is clear what they relate too. Also move them to env.h since they are part of the public API. Use an enum rather than a #define to tie them together.
---
api/api.c | 2 +- cmd/nvedit.c | 8 ++++---- drivers/tee/sandbox.c | 6 +++--- env/callback.c | 2 +- env/flags.c | 2 +- include/search.h | 16 ++++++++-------- lib/hashtable.c | 18 +++++++++--------- test/env/hashtable.c | 8 ++++---- 8 files changed, 31 insertions(+), 31 deletions(-)
api/api.c +1 -1
@@ -514,7 +514,7 @@ static int API_env_enum(va_list ap)if (s !=NULL ) *s =0 ; search.key = var; - i =hsearch_r (search,FIND , &match, &env_htab,0 ); + i =hsearch_r (search,ENVA_FIND , &match, &env_htab,0 );if (i ==0 ) { i =API_EINVAL ; goto done;
cmd/nvedit.c +4 -4
@@ -98,7 +98,7 @@ static int env_print(char *name, int flag) e.key = name; e.data =NULL ; -hsearch_r (e,FIND , &ep, &env_htab, flag); +hsearch_r (e,ENVA_FIND , &ep, &env_htab, flag);if (ep ==NULL )return 0 ; len =printf ("%s=%s\n" , ep->key, ep->data);
@@ -288,7 +288,7 @@ static int _do_env_set(int flag, int argc, char * const argv[], int env_flag) e.key = name; e.data = value; -hsearch_r (e,ENTER , &ep, &env_htab, env_flag); +hsearch_r (e,ENVA_ENTER , &ep, &env_htab, env_flag);free (value);if (!ep) { printf("## Error inserting \"%s\" variable, errno=%d\n",
@@ -680,7 +680,7 @@ char *env_get(const char *name) e.key = name; e.data =NULL ; -hsearch_r (e,FIND , &ep, &env_htab,0 ); +hsearch_r (e,ENVA_FIND , &ep, &env_htab,0 );return ep ? ep->data :NULL ; }
@@ -1281,7 +1281,7 @@ static int do_env_exists(cmd_tbl_t *cmdtp, int flag, int argc, e.key = argv[1 ]; e.data =NULL ; -hsearch_r (e,FIND , &ep, &env_htab,0 ); +hsearch_r (e,ENVA_FIND , &ep, &env_htab,0 );return (ep ==NULL ) ?1 :0 ; }
drivers/tee/sandbox.c +3 -3
@@ -174,7 +174,7 @@ static u32 ta_avb_invoke_func(struct udevice *dev, u32 func, uint num_params, e.key = name; e.data =NULL ; -hsearch_r (e,FIND , &ep, &state->pstorage_htab,0 ); +hsearch_r (e,ENVA_FIND , &ep, &state->pstorage_htab,0 );if (!ep)return TEE_ERROR_ITEM_NOT_FOUND ;
@@ -198,13 +198,13 @@ static u32 ta_avb_invoke_func(struct udevice *dev, u32 func, uint num_params, e.key = name; e.data =NULL ; -hsearch_r (e,FIND , &ep, &state->pstorage_htab,0 ); +hsearch_r (e,ENVA_FIND , &ep, &state->pstorage_htab,0 );if (ep)hdelete_r (e.key, &state->pstorage_htab,0 ); e.key = name; e.data = value; -hsearch_r (e,ENTER , &ep, &state->pstorage_htab,0 ); +hsearch_r (e,ENVA_ENTER , &ep, &state->pstorage_htab,0 );if (!ep)return TEE_ERROR_OUT_OF_MEMORY ;
env/callback.c +1 -1
@@ -98,7 +98,7 @@ static int set_callback(const char *name, const char *value, void *priv) e.key = name; e.data =NULL ; e.callback =NULL ; -hsearch_r (e,FIND , &ep, &env_htab,0 ); +hsearch_r (e,ENVA_FIND , &ep, &env_htab,0 );/* does the env variable actually exist? */ if (ep !=NULL ) {
env/flags.c +1 -1
@@ -458,7 +458,7 @@ static int set_flags(const char *name, const char *value, void *priv) e.key = name; e.data =NULL ; e.callback =NULL ; -hsearch_r (e,FIND , &ep, &env_htab,0 ); +hsearch_r (e,ENVA_FIND , &ep, &env_htab,0 );/* does the env variable actually exist? */ if (ep !=NULL ) {
include/search.h +8 -8
@@ -19,11 +19,11 @@#define __set_errno (val) do { errno = val; } while (0) -/* Action which shall be performed in the call to hsearch. */ -typedef enum { -FIND , -ENTER -}ACTION ; +/* enum env_action: action which shall be performed in the call to hsearch */ +enum env_action { +ENVA_FIND , +ENVA_ENTER , +};/** struct env_entry - An entry in the environment hashtable */ struct env_entry {
@@ -64,11 +64,11 @@ extern void hdestroy_r(struct hsearch_data *__htab);/* * Search for entry matching __item.key in internal hash table. If -* ACTION is `FIND' return found entry or signal error by returning -* NULL. If ACTION is `ENTER' replace existing data (if any) with +* __action is `ENVA_FIND' return found entry or signal error by returning +* NULL. If __action is `ENVA_ENTER' replace existing data (if any) with * __item.data. * */ -extern int hsearch_r (struct env_entry __item,ACTION __action, +extern int hsearch_r (struct env_entry __item,enum env_action __action,struct env_entry **__retval,struct hsearch_data *__htab,int __flag);
lib/hashtable.c +9 -9
@@ -194,7 +194,7 @@ void hdestroy_r(struct hsearch_data *htab)* data any more. * - The standard implementation does not provide a way to update an * existing entry. This version will create a new entry or update an -* existing one when both "action == ENTER" and "item.data != NULL". +* existing one when both "action == ENVA_ENTER" and "item.data != NULL". * - Instead of returning 1 on success, we return the index into the * internal hash table, which is also guaranteed to be positive. * This allows us direct access to the found hash table slot for
@@ -223,17 +223,17 @@ int hmatch_r(const char *match, int last_idx, struct env_entry **retval, /* * Compare an existing entry with the desired key, and overwrite if the action - * is ENTER. This is simply a helper function for hsearch_r(). + * is ENVA_ENTER. This is simply a helper function for hsearch_r(). */ static inline int _compare_and_overwrite_entry(struct env_entry item, - ACTION action, struct env_entry **retval, + enum env_action action, struct env_entry **retval, struct hsearch_data *htab, int flag, unsigned int hval, unsigned int idx) { if (htab->table[idx].used == hval && strcmp(item.key, htab->table[idx].entry.key) == 0) { /* Overwrite existing value? */ - if ((action == ENTER) && (item.data != NULL)) { + if (action == ENVA_ENTER && item.data) { /* check for permission */ if (htab->change_ok != NULL && htab->change_ok( &htab->table[idx].entry, item.data,
@@ -272,8 +272,8 @@ static inline int _compare_and_overwrite_entry(struct env_entry item,return -1 ; } -int hsearch_r (struct env_entry item,ACTION action,struct env_entry **retval, -struct hsearch_data *htab,int flag) +int hsearch_r (struct env_entry item,enum env_action action, +struct env_entry **retval,struct hsearch_data *htab,int flag) {unsigned int hval;unsigned int count;
@@ -354,7 +354,7 @@ int hsearch_r(struct env_entry item, ACTION action, struct env_entry **retval, }/* An empty bucket has been found. */ -if (action ==ENTER ) { +if (action ==ENVA_ENTER ) {/* * If table is full and another entry should be * entered return with error.
@@ -456,7 +456,7 @@ int hdelete_r(const char *key, struct hsearch_data *htab, int flag) e.key = (char *)key; - idx =hsearch_r (e,FIND , &ep, htab,0 ); + idx =hsearch_r (e,ENVA_FIND , &ep, htab,0 );if (idx ==0 ) {__set_errno (ESRCH );return 0 ;/* not found */
@@ -931,7 +931,7 @@ int himport_r(struct hsearch_data *htab, e.key = name; e.data = value; -hsearch_r (e,ENTER , &rv, htab, flag); +hsearch_r (e,ENVA_ENTER , &rv, htab, flag);if (rv ==NULL )printf ("himport_r: can't insert \"%s=%s\" into hash table\n" , name, value);
test/env/hashtable.c +4 -4
@@ -28,7 +28,7 @@ static int htab_fill(struct unit_test_state *uts, item.data = key; item.flags =0 ; item.key = key; -ut_asserteq (1 ,hsearch_r (item,ENTER , &ritem, htab,0 )); +ut_asserteq (1 ,hsearch_r (item,ENVA_ENTER , &ritem, htab,0 )); }return 0 ;
@@ -48,7 +48,7 @@ static int htab_check_fill(struct unit_test_state *uts, item.flags =0 ; item.data = key; item.key = key; -hsearch_r (item,FIND , &ritem, htab,0 ); +hsearch_r (item,ENVA_FIND , &ritem, htab,0 );ut_assert (ritem);ut_asserteq_str (key, ritem->key);ut_asserteq_str (key, ritem->data);
@@ -71,10 +71,10 @@ static int htab_create_delete(struct unit_test_state *uts, item.flags =0 ; item.data = key; item.key = key; -hsearch_r (item,ENTER , &ritem, htab,0 ); +hsearch_r (item,ENVA_ENTER , &ritem, htab,0 ); ritem =NULL ; -hsearch_r (item,FIND , &ritem, htab,0 ); +hsearch_r (item,ENVA_FIND , &ritem, htab,0 );ut_assert (ritem);ut_asserteq_str (key, ritem->key);ut_asserteq_str (key, ritem->data);
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 33/39 env: Drop the ACTION typedef
Quoted 7 lines · Simon Glass
Avoid using a typedef here which is unnecessary. Add an '
env_' prefix to both the enum and its members to make it clear that these are related to the environment.Add an ENV prefix to these two flags so that it is clear what they relate too. Also move them to
env.hsince they are part of the public API. Use an
too -> to
Quoted 130 lines
enum rather than a #define to tie them together.
Signed-off-by Simon Glass <[email protected]>---
api/api.c | 2 +- cmd/nvedit.c | 8 ++++---- drivers/tee/sandbox.c | 6 +++--- env/callback.c | 2 +- env/flags.c | 2 +- include/search.h | 16 ++++++++-------- lib/hashtable.c | 18 +++++++++--------- test/env/hashtable.c | 8 ++++---- 8 files changed, 31 insertions(+), 31 deletions(-)api/api.c +1
-1@@ -514,7 +514,7 @@ static int API_env_enum(va_list ap)if (s !=NULL ) *s =0 ; search.key = var; - i =hsearch_r (search,FIND , &match, &env_htab,0 ); + i =hsearch_r (search,ENVA_FIND , &match, &env_htab,0 );if (i ==0 ) { i =API_EINVAL ; goto done;cmd/nvedit.c +4
-4@@ -98,7 +98,7 @@ static int env_print(char *name, int flag) e.key = name; e.data =NULL ; -hsearch_r (e,FIND , &ep, &env_htab, flag); +hsearch_r (e,ENVA_FIND , &ep, &env_htab, flag);if (ep ==NULL )return 0 ; len =printf ("%s=%s\n" , ep->key, ep->data);@@ -288,7 +288,7 @@ static int _do_env_set(int flag, int argc, char * const argv[], int env_flag) e.key = name; e.data = value; -hsearch_r (e,ENTER , &ep, &env_htab, env_flag); +hsearch_r (e,ENVA_ENTER , &ep, &env_htab, env_flag);free (value);if (!ep) { printf("## Error inserting \"%s\" variable, errno=%d\n",@@ -680,7 +680,7 @@ char *env_get(const char *name) e.key = name; e.data =NULL ; -hsearch_r (e,FIND , &ep, &env_htab,0 ); +hsearch_r (e,ENVA_FIND , &ep, &env_htab,0 );return ep ? ep->data :NULL ; }@@ -1281,7 +1281,7 @@ static int do_env_exists(cmd_tbl_t *cmdtp, int flag, int argc, e.key = argv[1 ]; e.data =NULL ; -hsearch_r (e,FIND , &ep, &env_htab,0 ); +hsearch_r (e,ENVA_FIND , &ep, &env_htab,0 );return (ep ==NULL ) ?1 :0 ; }drivers/tee/sandbox.c +3
-3@@ -174,7 +174,7 @@ static u32 ta_avb_invoke_func(struct udevice *dev, u32 func, uint num_params, e.key = name; e.data =NULL ; -hsearch_r (e,FIND , &ep, &state->pstorage_htab,0 ); +hsearch_r (e,ENVA_FIND , &ep, &state->pstorage_htab,0 );if (!ep)return TEE_ERROR_ITEM_NOT_FOUND ;@@ -198,13 +198,13 @@ static u32 ta_avb_invoke_func(struct udevice *dev, u32 func, uint num_params, e.key = name; e.data =NULL ; -hsearch_r (e,FIND , &ep, &state->pstorage_htab,0 ); +hsearch_r (e,ENVA_FIND , &ep, &state->pstorage_htab,0 );if (ep)hdelete_r (e.key, &state->pstorage_htab,0 ); e.key = name; e.data = value; -hsearch_r (e,ENTER , &ep, &state->pstorage_htab,0 ); +hsearch_r (e,ENVA_ENTER , &ep, &state->pstorage_htab,0 );if (!ep)return TEE_ERROR_OUT_OF_MEMORY ;env/callback.c +1
-1@@ -98,7 +98,7 @@ static int set_callback(const char *name, const char *value, void *priv) e.key = name; e.data =NULL ; e.callback =NULL ; -hsearch_r (e,FIND , &ep, &env_htab,0 ); +hsearch_r (e,ENVA_FIND , &ep, &env_htab,0 );/* does the env variable actually exist? */ if (ep !=NULL ) {env/flags.c +1
-1@@ -458,7 +458,7 @@ static int set_flags(const char *name, const char *value, void *priv) e.key = name; e.data =NULL ; e.callback =NULL ; -hsearch_r (e,FIND , &ep, &env_htab,0 ); +hsearch_r (e,ENVA_FIND , &ep, &env_htab,0 );/* does the env variable actually exist? */ if (ep !=NULL ) {include/search.h +0
-0@@ -19,11 +19,11 @@#define __set_errno (val) do { errno = val; } while (0)
include/search.h line 25
Quoted 10 lines
include/search.h +4
-5-/* Action which shall be performed in the call to hsearch. */ -typedef enum { -FIND , -ENTER -}ACTION ; +/* enum env_action: action which shall be performed in the call to hsearch */ +enum env_action { +ENVA_FIND , +ENVA_ENTER ,
It seems like dropping the A here would be more concise and clear. ENV_FIND and ENV_ENTER shouldn't conflict with anything.
Quoted 133 lines
include/search.h +4
-3+};/** struct env_entry - An entry in the environment hashtable */ struct env_entry {@@ -64,11 +64,11 @@ extern void hdestroy_r(struct hsearch_data *__htab);/* * Search for entry matching __item.key in internal hash table. If -* ACTION is `FIND' return found entry or signal error by returning -* NULL. If ACTION is `ENTER' replace existing data (if any) with +* __action is `ENVA_FIND' return found entry or signal error by returning +* NULL. If __action is `ENVA_ENTER' replace existing data (if any) with * __item.data. * */ -extern int hsearch_r (struct env_entry __item,ACTION __action, +extern int hsearch_r (struct env_entry __item,enum env_action __action,struct env_entry **__retval,struct hsearch_data *__htab,int __flag);lib/hashtable.c +9
-9@@ -194,7 +194,7 @@ void hdestroy_r(struct hsearch_data *htab)* data any more. * - The standard implementation does not provide a way to update an * existing entry. This version will create a new entry or update an -* existing one when both "action == ENTER" and "item.data != NULL". +* existing one when both "action == ENVA_ENTER" and "item.data != NULL". * - Instead of returning 1 on success, we return the index into the * internal hash table, which is also guaranteed to be positive. * This allows us direct access to the found hash table slot for @@ -223,17 +223,17 @@ int hmatch_r(const char *match, int last_idx, struct env_entry **retval, /* * Compare an existing entry with the desired key, and overwrite if the action - * is ENTER. This is simply a helper function for hsearch_r(). + * is ENVA_ENTER. This is simply a helper function for hsearch_r(). */ static inline int _compare_and_overwrite_entry(struct env_entry item, - ACTION action, struct env_entry **retval, + enum env_action action, struct env_entry **retval, struct hsearch_data *htab, int flag, unsigned int hval, unsigned int idx) { if (htab->table[idx].used == hval && strcmp(item.key, htab->table[idx].entry.key) == 0) { /* Overwrite existing value? */ - if ((action == ENTER) && (item.data != NULL)) { + if (action == ENVA_ENTER && item.data) { /* check for permission */ if (htab->change_ok != NULL && htab->change_ok( &htab->table[idx].entry, item.data,@@ -272,8 +272,8 @@ static inline int _compare_and_overwrite_entry(struct env_entry item,return -1 ; } -int hsearch_r (struct env_entry item,ACTION action,struct env_entry **retval, -struct hsearch_data *htab,int flag) +int hsearch_r (struct env_entry item,enum env_action action, +struct env_entry **retval,struct hsearch_data *htab,int flag) {unsigned int hval;unsigned int count;@@ -354,7 +354,7 @@ int hsearch_r(struct env_entry item, ACTION action, struct env_entry **retval, }/* An empty bucket has been found. */ -if (action ==ENTER ) { +if (action ==ENVA_ENTER ) {/* * If table is full and another entry should be * entered return with error. @@ -456,7 +456,7 @@ int hdelete_r(const char *key, struct hsearch_data *htab, int flag) e.key = (char *)key; - idx =hsearch_r (e,FIND , &ep, htab,0 ); + idx =hsearch_r (e,ENVA_FIND , &ep, htab,0 );if (idx ==0 ) {__set_errno (ESRCH );return 0 ;/* not found */ @@ -931,7 +931,7 @@ int himport_r(struct hsearch_data *htab, e.key = name; e.data = value; -hsearch_r (e,ENTER , &rv, htab, flag); +hsearch_r (e,ENVA_ENTER , &rv, htab, flag);if (rv ==NULL )printf ("himport_r: can't insert \"%s=%s\" into hash table\n" , name, value);test/env/hashtable.c +4
-5@@ -28,7 +28,7 @@ static int htab_fill(struct unit_test_state *uts, item.data = key; item.flags =0 ; item.key = key; -ut_asserteq (1 ,hsearch_r (item,ENTER , &ritem, htab,0 )); +ut_asserteq (1 ,hsearch_r (item,ENVA_ENTER , &ritem, htab,0 )); }return 0 ;@@ -48,7 +48,7 @@ static int htab_check_fill(struct unit_test_state *uts, item.flags =0 ; item.data = key; item.key = key; -hsearch_r (item,FIND , &ritem, htab,0 ); +hsearch_r (item,ENVA_FIND , &ritem, htab,0 );ut_assert (ritem);ut_asserteq_str (key, ritem->key);ut_asserteq_str (key, ritem->data);@@ -71,10 +71,10 @@ static int htab_create_delete(struct unit_test_state *uts, item.flags =0 ; item.data = key; item.key = key; -hsearch_r (item,ENTER , &ritem, htab,0 ); +hsearch_r (item,ENVA_ENTER , &ritem, htab,0 ); ritem =NULL ; -hsearch_r (item,FIND , &ritem, htab,0 ); +hsearch_r (item,ENVA_FIND , &ritem, htab,0 );ut_assert (ritem);ut_asserteq_str (key, ritem->key);ut_asserteq_str (key, ritem->data); --2.22.0.709.g102302147b-goog
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 34/39 env: Drop the double underscores in search.h
In reply to Simon GlassThere doesn't seem to be any good reason for using __ in the arguments in this header file. A double underscore is usually reserved for compiler features.
Drop these and remove the unnecessary 'extern' as well.
---
include/search.h | 52 ++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 28 deletions(-)
include/search.h +24 -28
@@ -17,7 +17,7 @@#include <env.h> #include <stddef.h> -#define __set_errno (val) do { errno = val; } while (0) +#define set_errno (val) do { errno = val; } while (0)/* enum env_action: action which shall be performed in the call to hsearch */ enum env_action {
@@ -47,58 +47,54 @@ struct hsearch_data {unsigned int filled;/* * Callback function which will check whether the given change for variable -* "__item" to "newval" may be applied or not, and possibly apply such change. +* "item" to "newval" may be applied or not, and possibly apply such change. * When (flag & H_FORCE) is set, it shall not print out any error message and * shall force overwriting of write-once variables. * Must return 0 for approval, 1 for denial. */ -int (*change_ok)(const struct env_entry *__item,const char *newval, +int (*change_ok)(const struct env_entry *item,const char *newval,enum env_op ,int flag); }; -/* Create a new hash table which will contain at most "__nel" elements. */ -extern int hcreate_r (size_t __nel,struct hsearch_data *__htab); +/* Create a new hash table which will contain at most "nel" elements. */ +int hcreate_r (size_t nel,struct hsearch_data *htab);/* Destroy current internal hash table. */ -extern void hdestroy_r (struct hsearch_data *__htab); +void hdestroy_r (struct hsearch_data *htab);/* -* Search for entry matching __item.key in internal hash table. If -* __action is `ENVA_FIND' return found entry or signal error by returning -* NULL. If __action is `ENVA_ENTER' replace existing data (if any) with -* __item.data. +* Search for entry matching item.key in internal hash table. If +* action is `ENVA_FIND' return found entry or signal error by returning +* NULL. If action is `ENVA_ENTER' replace existing data (if any) with +* item.data. * */ -extern int hsearch_r (struct env_entry __item,enum env_action __action, -struct env_entry **__retval,struct hsearch_data *__htab, -int __flag); +int hsearch_r (struct env_entry item,enum env_action action, +struct env_entry **retval,struct hsearch_data *htab,int flag);/* -* Search for an entry matching "__match". Otherwise, Same semantics +* Search for an entry matching "match". Otherwise, Same semantics * as hsearch_r(). */ -extern int hmatch_r (const char *__match,int __last_idx, -struct env_entry **__retval,struct hsearch_data *__htab); +int hmatch_r (const char *match,int last_idx,struct env_entry **retval, +struct hsearch_data *htab); -/* Search and delete entry matching "__key" in internal hash table. */ -extern int hdelete_r (const char *__key,struct hsearch_data *__htab, -int __flag); +/* Search and delete entry matching "key" in internal hash table. */ +int hdelete_r (const char *key,struct hsearch_data *htab,int flag); -extern ssize_t hexport_r (struct hsearch_data *__htab, -const char __sep,int __flag,char **__resp,size_t __size, -int argc,char *const argv[]); +ssize_t hexport_r (struct hsearch_data *htab,const char sep,int flag, +char **resp,size_t size,int argc,char *const argv[]);/* * nvars: length of vars array * vars: array of strings (variable names) to import (nvars == 0 means all) */ -extern int himport_r (struct hsearch_data *__htab, -const char *__env,size_t __size,const char __sep, -int __flag,int __crlf_is_lf,int nvars, -char *const vars[]); +int himport_r (struct hsearch_data *htab,const char *env,size_t size, +const char sep,int flag,int crlf_is_lf,int nvars, +char *const vars[]);/* Walk the whole table calling the callback on each element */ -extern int hwalk_r (struct hsearch_data *__htab, -int (*callback)(struct env_entry *entry)); +int hwalk_r (struct hsearch_data *htab, +int (*callback)(struct env_entry *entry));/* Flags for himport_r(), hexport_r(), hdelete_r(), and hsearch_r() */ #define H_NOCLEAR (1 << 0)/* do not clear hash table before importing */
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 34/39 env: Drop the double underscores in search.h
Quoted 8 lines · Simon Glass
There doesn't seem to be any good reason for using __ in the arguments in this header file. A double underscore is usually reserved for compiler features.
Drop these and remove the unnecessary 'extern' as well.
Signed-off-by Simon Glass <[email protected]>
PATCH 35/39 env: Move TOTAL_MALLOC_LEN to environment.h
In reply to Simon GlassThis declaration is only used in three files. Although it relates to malloc() it is actually only used during malloc() init. It uses CONFIG options including CONFIG_ENV_ADDR which are defined only in environment.h so this header must be included anyway, for TOTAL_MALLOC_LEN to be correct.
Nove it to environment.h to simplify the common file.
---
arch/x86/cpu/qemu/e820.c | 1 + include/common.h | 10 ---------- include/environment.h | 14 ++++++++++++++ 3 files changed, 15 insertions(+), 10 deletions(-)
arch/x86/cpu/qemu/e820.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> +#include <environment.h> #include <asm/e820.h> DECLARE_GLOBAL_DATA_PTR ;
include/common.h +0 -10
@@ -45,16 +45,6 @@ typedef void (interrupt_handler_t)(void *);#include <asm/u-boot.h> /* boot information for Linux kernel */ #include <asm/global_data.h> /* global data used for startup functions */ -#if defined(CONFIG_ENV_IS_EMBEDDED ) -#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN -#elif ( ((CONFIG_ENV_ADDR +CONFIG_ENV_SIZE ) <CONFIG_SYS_MONITOR_BASE ) || \ - (CONFIG_ENV_ADDR >= (CONFIG_SYS_MONITOR_BASE +CONFIG_SYS_MONITOR_LEN )) ) || \ - defined(CONFIG_ENV_IS_IN_NVRAM ) -#define TOTAL_MALLOC_LEN (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE) -#else -#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN -#endif -/* startup functions, used in: * common/board_f.c * common/init/board_init.c
include/environment.h +14 -0
@@ -141,6 +141,20 @@ extern unsigned long nand_env_oob_offset;#define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE) +/* +* If the environment is in RAM, allocate extra space for it in the malloc +* region. +*/ +#if defined(CONFIG_ENV_IS_EMBEDDED ) +#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN +#elif (CONFIG_ENV_ADDR +CONFIG_ENV_SIZE <CONFIG_SYS_MONITOR_BASE ) || \ + (CONFIG_ENV_ADDR >=CONFIG_SYS_MONITOR_BASE +CONFIG_SYS_MONITOR_LEN ) || \ + defined(CONFIG_ENV_IS_IN_NVRAM ) +#define TOTAL_MALLOC_LEN (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE) +#else +#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN +#endif + typedef struct environment_s { uint32_t crc; /* CRC32 over data bytes */ #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
Signature · 1 line
2.22.0.709.g102302147b-goog
PATCH 35/39 env: Move TOTAL_MALLOC_LEN to environment.h
Quoted 8 lines · Simon Glass
This declaration is only used in three files. Although it relates to
malloc()it is actually only used duringmalloc()init. It uses CONFIG options includingCONFIG_ENV_ADDRwhich are defined only inenvironment.hso this header must be included anyway, forTOTAL_MALLOC_LENto be correct.Nove it to
environment.hto simplify the common file.
Nove -> Move
Quoted 2 lines
Signed-off-by Simon Glass <[email protected]>