[U-Boot,RFC] net: mii command: disable build for 64-bit Allwinner boards

Message ID 20180212012521.1383-1-andre.przywara@arm.com
State Changes Requested
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series
  • [U-Boot,RFC] net: mii command: disable build for 64-bit Allwinner boards
Related show

Commit Message

André Przywara Feb. 12, 2018, 1:25 a.m.
The current master fails to build some Allwinner H5 boards, due to
exceeding the U-Boot proper size limit we currently have still in place.
This affects:
- nanopi_neo2_defconfig
- nanopi_neo_plus2_defconfig
- orangepi_pc2_defconfig
- orangepi_prime_defconfig
- orangepi_zero_plus2_defconfig
To workaround this issue, a left-over low hanging fruit is to disable
the MII *command*, which is probably only useful for debugging and not
needed for a normal boot flow, even when booting via network (PXE/TFTP).

Allow to de-select CMD_MII, even when the distro default enables it.
Then disable it explicitly in the affected board's defconfigs.
This makes all Allwinner ARMv8 boards build again.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
Hi,

my sincere apologies for this ugly hack (and I welcome any nicer solution!),
but we are running out of silver bullets for this particular problem and this
command seems both easy to give up and worthwhile in terms of code size
savings (~11KB).
The "default n if ..." doesn't seem to work with "imply", so I needed to
disable it in each of the affected defconfigs. Please let me know if there
is a better solution.

Cheers,
Andre.

 Kconfig                               | 2 +-
 cmd/Kconfig                           | 1 +
 configs/nanopi_neo2_defconfig         | 1 +
 configs/nanopi_neo_plus2_defconfig    | 1 +
 configs/orangepi_pc2_defconfig        | 1 +
 configs/orangepi_prime_defconfig      | 1 +
 configs/orangepi_zero_plus2_defconfig | 1 +
 configs/pine64_plus_defconfig         | 1 +
 8 files changed, 8 insertions(+), 1 deletion(-)

Comments

Tom Rini Feb. 12, 2018, 3:47 p.m. | #1
On Mon, Feb 12, 2018 at 01:25:21AM +0000, Andre Przywara wrote:

> The current master fails to build some Allwinner H5 boards, due to
> exceeding the U-Boot proper size limit we currently have still in place.
> This affects:
> - nanopi_neo2_defconfig
> - nanopi_neo_plus2_defconfig
> - orangepi_pc2_defconfig
> - orangepi_prime_defconfig
> - orangepi_zero_plus2_defconfig
> To workaround this issue, a left-over low hanging fruit is to disable
> the MII *command*, which is probably only useful for debugging and not
> needed for a normal boot flow, even when booting via network (PXE/TFTP).
> 
> Allow to de-select CMD_MII, even when the distro default enables it.
> Then disable it explicitly in the affected board's defconfigs.
> This makes all Allwinner ARMv8 boards build again.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
> Hi,
> 
> my sincere apologies for this ugly hack (and I welcome any nicer solution!),
> but we are running out of silver bullets for this particular problem and this
> command seems both easy to give up and worthwhile in terms of code size
> savings (~11KB).
> The "default n if ..." doesn't seem to work with "imply", so I needed to
> disable it in each of the affected defconfigs. Please let me know if there
> is a better solution.

Can we not move the env location now?  Thanks!
André Przywara Feb. 12, 2018, 10:42 p.m. | #2
On 12/02/18 15:47, Tom Rini wrote:
> On Mon, Feb 12, 2018 at 01:25:21AM +0000, Andre Przywara wrote:
> 
>> The current master fails to build some Allwinner H5 boards, due to
>> exceeding the U-Boot proper size limit we currently have still in place.
>> This affects:
>> - nanopi_neo2_defconfig
>> - nanopi_neo_plus2_defconfig
>> - orangepi_pc2_defconfig
>> - orangepi_prime_defconfig
>> - orangepi_zero_plus2_defconfig
>> To workaround this issue, a left-over low hanging fruit is to disable
>> the MII *command*, which is probably only useful for debugging and not
>> needed for a normal boot flow, even when booting via network (PXE/TFTP).
>>
>> Allow to de-select CMD_MII, even when the distro default enables it.
>> Then disable it explicitly in the affected board's defconfigs.
>> This makes all Allwinner ARMv8 boards build again.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>> ---
>> Hi,
>>
>> my sincere apologies for this ugly hack (and I welcome any nicer solution!),
>> but we are running out of silver bullets for this particular problem and this
>> command seems both easy to give up and worthwhile in terms of code size
>> savings (~11KB).
>> The "default n if ..." doesn't seem to work with "imply", so I needed to
>> disable it in each of the affected defconfigs. Please let me know if there
>> is a better solution.
> 
> Can we not move the env location now?  Thanks!

Not yet, unfortunately. As of v2018.01 we store the environment in raw
MMC still and need to obey the limit. The just merged multi-env support
allows us to *transition* all users over to a FAT environment (because
it will pickup the env from MMC, but save it in FAT by default). But we
need at least one release to be nice to our users: v2018.03. In this
time we still need to obey the limit, to not destroy the existing legacy
env in MMC.
With v2018.05-rc1 we can then disable ENV_IS_IN_MMC and remove the limit.

So the end is nigh ;-), but not there yet.

Cheers,
Andre.

Patch

diff --git a/Kconfig b/Kconfig
index 166e7841b1..0e412709de 100644
--- a/Kconfig
+++ b/Kconfig
@@ -75,7 +75,7 @@  config DISTRO_DEFAULTS
 	select CMD_EXT4
 	select CMD_FAT
 	select CMD_FS_GENERIC
-	select CMD_MII if NET
+	imply CMD_MII if NET
 	select CMD_PING if NET
 	select CMD_PART
 	select HUSH_PARSER
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 7368b6df52..a5c3c09a4a 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1017,6 +1017,7 @@  config CMD_NFS
 
 config CMD_MII
 	bool "mii"
+	default n if ARCH_SUNXI && ARM64
 	help
 	  Enable MII utility commands.
 
diff --git a/configs/nanopi_neo2_defconfig b/configs/nanopi_neo2_defconfig
index f78ee504b7..d50a389f2a 100644
--- a/configs/nanopi_neo2_defconfig
+++ b/configs/nanopi_neo2_defconfig
@@ -7,6 +7,7 @@  CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-nanopi-neo2"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_MII is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
diff --git a/configs/nanopi_neo_plus2_defconfig b/configs/nanopi_neo_plus2_defconfig
index dc62385bcb..9ba9b6df89 100644
--- a/configs/nanopi_neo_plus2_defconfig
+++ b/configs/nanopi_neo_plus2_defconfig
@@ -9,6 +9,7 @@  CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-nanopi-neo-plus2"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_MII is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
diff --git a/configs/orangepi_pc2_defconfig b/configs/orangepi_pc2_defconfig
index e8bf285ab3..47bc513eb1 100644
--- a/configs/orangepi_pc2_defconfig
+++ b/configs/orangepi_pc2_defconfig
@@ -8,6 +8,7 @@  CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-pc2"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_MII is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
diff --git a/configs/orangepi_prime_defconfig b/configs/orangepi_prime_defconfig
index c1c82bb2dd..57e4db3e96 100644
--- a/configs/orangepi_prime_defconfig
+++ b/configs/orangepi_prime_defconfig
@@ -7,6 +7,7 @@  CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-prime"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_MII is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
diff --git a/configs/orangepi_zero_plus2_defconfig b/configs/orangepi_zero_plus2_defconfig
index 9f955304ca..6ebfb7940d 100644
--- a/configs/orangepi_zero_plus2_defconfig
+++ b/configs/orangepi_zero_plus2_defconfig
@@ -9,6 +9,7 @@  CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-zero-plus2"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_MII is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
diff --git a/configs/pine64_plus_defconfig b/configs/pine64_plus_defconfig
index a8d4e2b0aa..e5d4df3f50 100644
--- a/configs/pine64_plus_defconfig
+++ b/configs/pine64_plus_defconfig
@@ -6,6 +6,7 @@  CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_MII is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set