]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mvebu: Enable bootstd and other modernization for Synology DS414 (Armada XP...
authorTony Dinh <mibodhi@gmail.com>
Mon, 8 Jul 2024 04:39:03 +0000 (21:39 -0700)
committerStefan Roese <sr@denx.de>
Mon, 15 Jul 2024 06:42:04 +0000 (08:42 +0200)
- Switch to standard boot (in include/configs/ds414.h and
configs/ds414_defconfig)
- Implement board_late_init() to ensure successful enumeration
of USB3 devices
- Remove unnecessary checkboard()
- Updated IDENT_STRING to indicate this u-boot supports both Synology
DS414 and DS214+ boards
- Add SYS_THUMB_BUILD to reduce binary size
- Add NET_RANDOM_ETHADDR
- Add CONFIG_LBA48 and CONFIG_SYS_64BIT_LBA to support >2TB HDD/SDD

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Acked-by: Phil Sutter <phil@nwl.cc>
board/Synology/ds414/ds414.c
configs/ds414_defconfig
include/configs/ds414.h

index 8db810ad3eba680ca5d8b8f8641123d1acce071d..1a4cea87e1a753912b6f036b43da3a66c816dfc1 100644 (file)
@@ -180,6 +180,13 @@ int board_init(void)
        return 0;
 }
 
+int board_late_init(void)
+{
+       /* Do late init to ensure successful enumeration of XHCI devices */
+       pci_init();
+       return 0;
+}
+
 int misc_init_r(void)
 {
        if (!env_get("ethaddr")) {
@@ -188,10 +195,3 @@ int misc_init_r(void)
        }
        return 0;
 }
-
-int checkboard(void)
-{
-       puts("Board: DS414\n");
-
-       return 0;
-}
index 18c741d4f28ddd920f3470f0bbe9cd3b94ce0508..6391c43474ef09dd02cd118e00b1ee2e3b4ab7cf 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_CPU_INIT=y
+CONFIG_SYS_THUMB_BUILD=y
 CONFIG_ARCH_MVEBU=y
 CONFIG_SUPPORT_PASSING_ATAGS=y
 CONFIG_CMDLINE_TAG=y
@@ -25,44 +26,41 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BASE=0xf1012000
 CONFIG_DEBUG_UART_CLOCK=250000000
+CONFIG_IDENT_STRING="\nSynology DS214+/DS414 2/4-Bay Diskstation"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_PCI=y
 CONFIG_DEBUG_UART=y
+CONFIG_BOOTSTD_FULL=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="console=ttyS0,115200 ip=off initrd=0x8000040,8M root=/dev/md0 rw syno_hw_version=DS414r1 ihd_num=4 netif_num=2 flash_size=8 SataLedSpecial=1 HddHotplug=1"
-CONFIG_USE_BOOTCOMMAND=y
-CONFIG_BOOTCOMMAND="sf probe; sf read ${loadaddr} 0xd0000 0x2d0000; sf read ${ramdisk_addr_r} 0x3a0000 0x430000; bootm ${loadaddr} ${ramdisk_addr_r}"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x1bfd0
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_I2C=y
+CONFIG_SYS_PROMPT="DS414> "
 CONFIG_SYS_MAXARGS=32
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
-# CONFIG_CMD_SETEXPR is not set
-CONFIG_CMD_DHCP=y
 CONFIG_CMD_TFTPPUT=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
 CONFIG_CMD_TIME=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_FAT=y
 CONFIG_CMD_JFFS2=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_CMD_UBI=y
-CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_SPI_MAX_HZ=50000000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ARP_TIMEOUT=200
 CONFIG_NET_RETRY_COUNT=50
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_OF_TRANSLATE=y
+CONFIG_LBA48=y
+CONFIG_SYS_64BIT_LBA=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MVTWSI=y
 # CONFIG_MMC is not set
@@ -84,4 +82,3 @@ CONFIG_USB_XHCI_HCD=y
 # CONFIG_USB_XHCI_MVEBU is not set
 CONFIG_USB_XHCI_PCI=y
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_STORAGE=y
index 6fbcec0898af826adb7d96ce703729f29c3f452e..95256575583ec44f72b823a3c852d9815a8640e9 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
+ * Copyright (C) 2024 Tony Dinh <mibodhi@gmail.com>
  * Copyright (C) 2014 Stefan Roese <sr@denx.de>
  */
 
  * U-Boot into it.
  */
 
-/* I2C */
 #define CFG_I2C_MVTWSI_BASE0           MVEBU_TWSI_BASE
 
-/*
- * mv-common.h should be defined after CMD configs since it used them
- * to enable certain macros
- */
-#include "mv-common.h"
-
 /*
  * Memory layout while starting into the bin_hdr via the
  * BootROM:
  * L2 cache thus cannot be used.
  */
 
-/* SPL */
-/* Defines for SPL */
+/* Keep device tree and initrd in lower memory so the kernel can access them */
+#define RELOCATION_LIMITS_ENV_SETTINGS  \
+       "fdt_high=0x10000000\0"         \
+       "initrd_high=0x10000000\0"
 
-/* Default Environment */
+/*
+ * mv-common.h should be defined after CMD configs since it used them
+ * to enable certain macros
+ */
+#include "mv-common.h"
+
+#ifndef CONFIG_SPL_BUILD
 
-#define CFG_EXTRA_ENV_SETTINGS                         \
-       "initrd_high=0xffffffff\0"                              \
-       "ramdisk_addr_r=0x8000000\0"                            \
-       "usb0Mode=host\0usb1Mode=host\0usb2Mode=device\0"       \
-       "ethmtu=1500\0eth1mtu=1500\0"                           \
-       "update_uboot=sf probe; dhcp; "                         \
-               "mw.b ${loadaddr} 0x0 0xd0000; "                \
-               "tftpboot ${loadaddr} u-boot-with-spl.kwb; "    \
+#define KERNEL_ADDR_R  __stringify(0x1000000)
+#define FDT_ADDR_R     __stringify(0x2000000)
+#define RAMDISK_ADDR_R __stringify(0x2200000)
+#define SCRIPT_ADDR_R  __stringify(0x1800000)
+#define PXEFILE_ADDR_R __stringify(0x1900000)
+
+#define EXTRA_ENV_SETTINGS_LEGACY \
+       "bootargs_legacy=console=ttyS0,115200 ip=off initrd=0x8000040,8M " \
+               "root=/dev/md0 rw syno_hw_version=DS414r1 ihd_num=4 netif_num=2 " \
+               "flash_size=8 SataLedSpecial=1 HddHotplug=1\0" \
+       "bootcmd_legacy=sf probe; sf read ${loadaddr} 0xd0000 0x2d0000; " \
+               "sf read ${ramdisk_addr_r} 0x3a0000 0x430000; " \
+               "setenv bootargs $bootargs_legacy; " \
+               "bootm ${loadaddr} ${ramdisk_addr_r}\0" \
+       "usb0Mode=host\0usb1Mode=host\0usb2Mode=device\0" \
+       "ethmtu=1500\0eth1mtu=1500\0" \
+       "update_uboot=sf probe; dhcp; " \
+               "mw.b ${loadaddr} 0x0 0xd0000; " \
+               "tftpboot ${loadaddr} u-boot-with-spl.kwb; " \
                "sf update ${loadaddr} 0x0 0xd0000\0"
 
-/* increase autoneg timeout, my NIC sucks */
+#define LOAD_ADDRESS_ENV_SETTINGS \
+       "kernel_addr_r=" KERNEL_ADDR_R "\0" \
+       "fdt_addr_r=" FDT_ADDR_R "\0" \
+       "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
+       "scriptaddr=" SCRIPT_ADDR_R "\0" \
+       "pxefile_addr_r=" PXEFILE_ADDR_R "\0"
+
+#define CFG_EXTRA_ENV_SETTINGS \
+       RELOCATION_LIMITS_ENV_SETTINGS \
+       LOAD_ADDRESS_ENV_SETTINGS \
+       EXTRA_ENV_SETTINGS_LEGACY \
+       "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
+       "console=ttyS0,115200\0"
+
+#endif /* CONFIG_SPL_BUILD */
 
 #endif /* _CONFIG_SYNOLOGY_DS414_H */