net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
diff --git a/configs/apalis-imx8qm_defconfig b/configs/apalis-imx8qm_defconfig
index 7848b68..584e54d 100644
--- a/configs/apalis-imx8qm_defconfig
+++ b/configs/apalis-imx8qm_defconfig
@@ -26,6 +26,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qm-apalis"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=4096
 CONFIG_CLK_IMX8=y
 CONFIG_CPU=y
 CONFIG_DM_GPIO=y
diff --git a/configs/apalis-tk1_defconfig b/configs/apalis-tk1_defconfig
index 141260f..41f3aff 100644
--- a/configs/apalis-tk1_defconfig
+++ b/configs/apalis-tk1_defconfig
@@ -32,6 +32,7 @@
 CONFIG_OF_LIVE=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra124-apalis"
 CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
diff --git a/configs/apalis_imx6_defconfig b/configs/apalis_imx6_defconfig
index 0daf758..6f36f7b 100644
--- a/configs/apalis_imx6_defconfig
+++ b/configs/apalis_imx6_defconfig
@@ -55,6 +55,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=4096
 CONFIG_DWC_AHSATA=y
 CONFIG_DFU_MMC=y
 CONFIG_DM_GPIO=y
diff --git a/configs/apalis_t30_defconfig b/configs/apalis_t30_defconfig
index cd1a679..cf4d144 100644
--- a/configs/apalis_t30_defconfig
+++ b/configs/apalis_t30_defconfig
@@ -29,6 +29,7 @@
 CONFIG_OF_LIVE=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra30-apalis"
 CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
diff --git a/configs/colibri-imx6ull_defconfig b/configs/colibri-imx6ull_defconfig
index e2755ec..5c89439 100644
--- a/configs/colibri-imx6ull_defconfig
+++ b/configs/colibri-imx6ull_defconfig
@@ -47,6 +47,7 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_DFU_MMC=y
 CONFIG_DFU_NAND=y
 CONFIG_DM_GPIO=y
diff --git a/configs/colibri-imx8qxp_defconfig b/configs/colibri-imx8qxp_defconfig
index f73236c..d808bd7 100644
--- a/configs/colibri-imx8qxp_defconfig
+++ b/configs/colibri-imx8qxp_defconfig
@@ -25,6 +25,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qxp-colibri"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=4096
 CONFIG_CLK_IMX8=y
 CONFIG_CPU=y
 CONFIG_DM_GPIO=y
diff --git a/configs/colibri_imx6_defconfig b/configs/colibri_imx6_defconfig
index 712db45..a60d695 100644
--- a/configs/colibri_imx6_defconfig
+++ b/configs/colibri_imx6_defconfig
@@ -55,6 +55,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_DFU_MMC=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
diff --git a/configs/colibri_imx7_defconfig b/configs/colibri_imx7_defconfig
index 25191d1..efbf5f5 100644
--- a/configs/colibri_imx7_defconfig
+++ b/configs/colibri_imx7_defconfig
@@ -47,6 +47,7 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_FSL_CAAM=y
 CONFIG_DFU_NAND=y
 CONFIG_DM_GPIO=y
diff --git a/configs/colibri_imx7_emmc_defconfig b/configs/colibri_imx7_emmc_defconfig
index 2322824..89f43e5 100644
--- a/configs/colibri_imx7_emmc_defconfig
+++ b/configs/colibri_imx7_emmc_defconfig
@@ -42,6 +42,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_FSL_CAAM=y
 CONFIG_DFU_MMC=y
 CONFIG_DM_GPIO=y
diff --git a/configs/colibri_t20_defconfig b/configs/colibri_t20_defconfig
index 8247248..d6a20ca 100644
--- a/configs/colibri_t20_defconfig
+++ b/configs/colibri_t20_defconfig
@@ -37,6 +37,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-colibri"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=1536
 CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
diff --git a/configs/colibri_t30_defconfig b/configs/colibri_t30_defconfig
index 3d25f10..769f6f3 100644
--- a/configs/colibri_t30_defconfig
+++ b/configs/colibri_t30_defconfig
@@ -28,6 +28,7 @@
 CONFIG_OF_LIVE=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra30-colibri"
 CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
diff --git a/configs/xilinx_versal_virt_defconfig b/configs/xilinx_versal_virt_defconfig
index 9000573..3ce6c03 100644
--- a/configs/xilinx_versal_virt_defconfig
+++ b/configs/xilinx_versal_virt_defconfig
@@ -43,6 +43,7 @@
 CONFIG_OF_BOARD=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=4096
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h
index 8cdd7c7..780ae61 100644
--- a/include/configs/apalis-imx8.h
+++ b/include/configs/apalis-imx8.h
@@ -29,7 +29,6 @@
 /* Networking */
 #define FEC_QUIRK_ENET_MAC
 
-#define CONFIG_TFTP_BLOCKSIZE		SZ_4K
 #define CONFIG_TFTP_TSIZE
 
 #define CONFIG_IPADDR			192.168.10.2
diff --git a/include/configs/apalis-tk1.h b/include/configs/apalis-tk1.h
index 51d1261..b4ddd1b 100644
--- a/include/configs/apalis-tk1.h
+++ b/include/configs/apalis-tk1.h
@@ -31,7 +31,6 @@
 #define CONFIG_E1000_NO_NVM
 
 /* General networking support */
-#define CONFIG_TFTP_BLOCKSIZE		16352
 #define CONFIG_TFTP_TSIZE
 
 #undef CONFIG_IPADDR
diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
index 0c01fdc..4b0a3fb 100644
--- a/include/configs/apalis_imx6.h
+++ b/include/configs/apalis_imx6.h
@@ -59,7 +59,6 @@
 #define CONFIG_FEC_XCV_TYPE		RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		6
-#define CONFIG_TFTP_BLOCKSIZE		4096
 #define CONFIG_TFTP_TSIZE
 
 /* USB Configs */
diff --git a/include/configs/apalis_t30.h b/include/configs/apalis_t30.h
index c085be8..f6adfeb 100644
--- a/include/configs/apalis_t30.h
+++ b/include/configs/apalis_t30.h
@@ -28,7 +28,6 @@
 #define CONFIG_E1000_NO_NVM
 
 /* General networking support */
-#define CONFIG_TFTP_BLOCKSIZE		16352
 #define CONFIG_TFTP_TSIZE
 
 /* Increase console I/O buffer size */
diff --git a/include/configs/colibri-imx6ull.h b/include/configs/colibri-imx6ull.h
index 20f5440..21d9a3d 100644
--- a/include/configs/colibri-imx6ull.h
+++ b/include/configs/colibri-imx6ull.h
@@ -19,7 +19,6 @@
 #define CONFIG_SYS_MALLOC_LEN		(32 * SZ_1M)
 
 /* Network */
-#define CONFIG_TFTP_BLOCKSIZE		16352
 #define CONFIG_TFTP_TSIZE
 
 /* ENET1 */
diff --git a/include/configs/colibri-imx8x.h b/include/configs/colibri-imx8x.h
index 8e74544..e15bab2 100644
--- a/include/configs/colibri-imx8x.h
+++ b/include/configs/colibri-imx8x.h
@@ -29,7 +29,6 @@
 /* Networking */
 #define FEC_QUIRK_ENET_MAC
 
-#define CONFIG_TFTP_BLOCKSIZE		SZ_4K
 #define CONFIG_TFTP_TSIZE
 
 #define CONFIG_IPADDR			192.168.10.2
diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h
index 2dfb7bd..86f3f0d 100644
--- a/include/configs/colibri_imx6.h
+++ b/include/configs/colibri_imx6.h
@@ -50,7 +50,6 @@
 #define CONFIG_FEC_XCV_TYPE		RMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		1
-#define CONFIG_TFTP_BLOCKSIZE		16352
 #define CONFIG_TFTP_TSIZE
 
 /* USB Configs */
diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h
index c19e27b..40173b1 100644
--- a/include/configs/colibri_imx7.h
+++ b/include/configs/colibri_imx7.h
@@ -22,7 +22,6 @@
 #define CONFIG_ETHPRIME                 "FEC"
 #define CONFIG_FEC_MXC_PHYADDR          0
 
-#define CONFIG_TFTP_BLOCKSIZE		16352
 #define CONFIG_TFTP_TSIZE
 
 /* ENET1 */
diff --git a/include/configs/colibri_t20.h b/include/configs/colibri_t20.h
index dd9f722..cd7e168 100644
--- a/include/configs/colibri_t20.h
+++ b/include/configs/colibri_t20.h
@@ -18,7 +18,6 @@
 #define CONFIG_MACH_TYPE		MACH_TYPE_COLIBRI_TEGRA2
 
 /* General networking support */
-#define CONFIG_TFTP_BLOCKSIZE		1536
 #define CONFIG_TFTP_TSIZE
 
 /* LCD support */
diff --git a/include/configs/colibri_t30.h b/include/configs/colibri_t30.h
index a816ade..8ff6433 100644
--- a/include/configs/colibri_t30.h
+++ b/include/configs/colibri_t30.h
@@ -27,7 +27,6 @@
 #define CONFIG_SYS_MMC_ENV_PART		1
 
 /* General networking support */
-#define CONFIG_TFTP_BLOCKSIZE		16352
 #define CONFIG_TFTP_TSIZE
 
 /* Increase console I/O buffer size */
diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h
index b2521df..296f450 100644
--- a/include/configs/xilinx_versal.h
+++ b/include/configs/xilinx_versal.h
@@ -41,8 +41,6 @@
 #define CONFIG_BOOTP_BOOTFILESIZE
 #define CONFIG_BOOTP_MAY_FAIL
 
-#define CONFIG_TFTP_BLOCKSIZE	4096
-
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LOAD_ADDR		0x8000000
 
diff --git a/net/Kconfig b/net/Kconfig
index 1a6fda9..68cecf7 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -29,4 +29,10 @@
 	  Selecting this will enable IP datagram reassembly according
 	  to the algorithm in RFC815.
 
+config TFTP_BLOCKSIZE
+	int "TFTP block size"
+	default 512
+	help
+	  Default TFTP block size.
+
 endif   # if NET
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 8ec700f..2a465d0 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -4250,7 +4250,6 @@
 CONFIG_TESTPIN_REG
 CONFIG_TEST_LIST_SORT
 CONFIG_TFP410_I2C_ADDR
-CONFIG_TFTP_BLOCKSIZE
 CONFIG_TFTP_FILE_NAME_MAX_LEN
 CONFIG_TFTP_PORT
 CONFIG_TFTP_TSIZE