From e471ddf0f3472423e8cdf8cc7d06a0b8e2abfebc Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Sun, 7 Mar 2021 22:22:27 +0100 Subject: arm: mvebu: board/Synology: Unify legacy kernel support Move the relevant bits from ds109.{c,h} into common/ and adjust the code to fit both DS109 and DS414. Moreover: * Introduce syno_board_id() which translates CONFIG_MACH_TYPE into the expected board ID tag value. * Properly initialize isusbhost, mac and mtu fields from env variables. * Set the right bootargs/bootcmd to correctly boot legacy kernel out of the (DS414) box. Getting the ramdisk location right is a bit tedious. Cc: Walter Schweizer Signed-off-by: Phil Sutter Reviewed-by: Stefan Roese --- include/configs/ds109.h | 3 ++- include/configs/ds414.h | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/configs/ds109.h b/include/configs/ds109.h index 1f033ababf..35d85361b4 100644 --- a/include/configs/ds109.h +++ b/include/configs/ds109.h @@ -44,7 +44,8 @@ "x_bootcmd_kernel=fatload usb 0 0x6400000 uImage\0" \ "x_bootargs=console=ttyS0,115200\0" \ "x_bootargs_root=root=/dev/sda2 rootdelay=10\0" \ - "ipaddr=192.168.1.5\0" + "ipaddr=192.168.1.5\0" \ + "usb0Mode=host\0" /* * Ethernet Driver configuration diff --git a/include/configs/ds414.h b/include/configs/ds414.h index 8aa2d47bec..a2248cf75a 100644 --- a/include/configs/ds414.h +++ b/include/configs/ds414.h @@ -6,6 +6,9 @@ #ifndef _CONFIG_SYNOLOGY_DS414_H #define _CONFIG_SYNOLOGY_DS414_H +/* Vendor kernel expects this MACH_TYPE */ +#define CONFIG_MACH_TYPE 3036 + /* * High Level Configuration Options (easy to change) */ @@ -74,8 +77,18 @@ #define CONFIG_DDR_32BIT /* Default Environment */ -#define CONFIG_BOOTCOMMAND "sf read ${loadaddr} 0xd0000 0x700000; bootm" #define CONFIG_LOADADDR 0x80000 +#define CONFIG_BOOTCOMMAND \ + "sf probe; " \ + "sf read ${loadaddr} 0xd0000 0x2d0000; " \ + "sf read ${ramdisk_addr_r} 0x3a0000 0x430000; " \ + "bootm ${loadaddr} ${ramdisk_addr_r}" + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "initrd_high=0xffffffff\0" \ + "ramdisk_addr_r=0x8000000\0" \ + "usb0Mode=host\0usb1Mode=host\0usb2Mode=device\0" \ + "ethmtu=1500\0eth1mtu=1500\0" /* increase autoneg timeout, my NIC sucks */ #define PHY_ANEG_TIMEOUT 16000 -- cgit From a751f83bb2fd17ed200073c2dd99d6fc579aab98 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 5 Mar 2021 21:05:45 +0100 Subject: arm: mvebu: ds414: Add sample u-boot update command Call 'run update_uboot' to fetch u-boot-spl.kwb via TFTP and write it into the correct SPI flash location. The latter's size is defined in DS414's DTB file, so hard-coding it should be acceptable here. Take care to not append garbage from RAM to the written image and to stay within assigned flash boundaries even if an oversized image was fetched. Signed-off-by: Phil Sutter --- include/configs/ds414.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/ds414.h b/include/configs/ds414.h index a2248cf75a..c8b45066cc 100644 --- a/include/configs/ds414.h +++ b/include/configs/ds414.h @@ -88,7 +88,12 @@ "initrd_high=0xffffffff\0" \ "ramdisk_addr_r=0x8000000\0" \ "usb0Mode=host\0usb1Mode=host\0usb2Mode=device\0" \ - "ethmtu=1500\0eth1mtu=1500\0" + "ethmtu=1500\0eth1mtu=1500\0" \ + "update_uboot=sf probe; dhcp; " \ + "mw.b ${loadaddr} 0x0 0xd0000; " \ + "tftpboot ${loadaddr} u-boot-spl.kwb; " \ + "sf update ${loadaddr} 0x0 0xd0000\0" + /* increase autoneg timeout, my NIC sucks */ #define PHY_ANEG_TIMEOUT 16000 -- cgit From 16acff8cfcff51edc987572bfe937d1ae36be444 Mon Sep 17 00:00:00 2001 From: Harm Berntsen Date: Tue, 30 Mar 2021 10:19:35 +0200 Subject: configs: remove unused CONFIG_SYS_MMC_BASE defs These boards use an MMC driver that does not use this definition Signed-off-by: Harm Berntsen Reviewed-by: Stefan Roese CC: Stefan Roese CC: Mario Six CC: Dennis Gilmore --- include/configs/clearfog.h | 5 ----- include/configs/controlcenterdc.h | 5 ----- include/configs/db-88f6820-gp.h | 5 ----- include/configs/helios4.h | 5 ----- 4 files changed, 20 deletions(-) (limited to 'include') diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h index 5441da8c9c..c9852a72b9 100644 --- a/include/configs/clearfog.h +++ b/include/configs/clearfog.h @@ -19,11 +19,6 @@ */ #define CONFIG_SYS_TCLK 250000000 /* 250MHz */ -/* - * SDIO/MMC Card Configuration - */ -#define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE - /* USB/EHCI configuration */ #define CONFIG_EHCI_IS_TDI diff --git a/include/configs/controlcenterdc.h b/include/configs/controlcenterdc.h index f53d48d427..869b94bc9b 100644 --- a/include/configs/controlcenterdc.h +++ b/include/configs/controlcenterdc.h @@ -24,11 +24,6 @@ #define CONFIG_LOADADDR 1000000 -/* - * SDIO/MMC Card Configuration - */ -#define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE - /* * SATA/SCSI/AHCI configuration */ diff --git a/include/configs/db-88f6820-gp.h b/include/configs/db-88f6820-gp.h index d4207be1d3..ed851bc670 100644 --- a/include/configs/db-88f6820-gp.h +++ b/include/configs/db-88f6820-gp.h @@ -19,11 +19,6 @@ #define CONFIG_SYS_I2C_SLAVE 0x0 #define CONFIG_SYS_I2C_SPEED 100000 -/* - * SDIO/MMC Card Configuration - */ -#define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE - /* * SATA/SCSI/AHCI configuration */ diff --git a/include/configs/helios4.h b/include/configs/helios4.h index 396870a67f..2cda05c85a 100644 --- a/include/configs/helios4.h +++ b/include/configs/helios4.h @@ -19,11 +19,6 @@ */ #define CONFIG_SYS_TCLK 250000000 /* 250MHz */ -/* - * SDIO/MMC Card Configuration - */ -#define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE - /* USB/EHCI configuration */ #define CONFIG_EHCI_IS_TDI -- cgit From 90534ea56e059e89e40d5030c07a3089dede156e Mon Sep 17 00:00:00 2001 From: Harm Berntsen Date: Tue, 30 Mar 2021 10:19:36 +0200 Subject: configs: openrd: remove non-dm MMC driver Unfortunately this board has no DM support at all. We are also way past the deadline for driver model support for various devices on this board. Signed-off-by: Harm Berntsen Reviewed-by: Stefan Roese CC: Stefan Roese --- include/configs/openrd.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/configs/openrd.h b/include/configs/openrd.h index e9fd0fc749..03b9393c9b 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -74,9 +74,4 @@ #define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET #endif /*CONFIG_MVSATA_IDE*/ -#ifdef CONFIG_CMD_MMC -#define CONFIG_MVEBU_MMC -#define CONFIG_SYS_MMC_BASE KW_SDIO_BASE -#endif /* CONFIG_CMD_MMC */ - #endif /* _CONFIG_OPENRD_BASE_H */ -- cgit From 426948df2a23a1b4d5c2df2bf2c13ddc3989f823 Mon Sep 17 00:00:00 2001 From: Harm Berntsen Date: Tue, 30 Mar 2021 10:19:37 +0200 Subject: configs: sheevaplug: remove non-dm MMC driver This will be replaced with the driver model version Signed-off-by: Harm Berntsen Reviewed-by: Stefan Roese CC: Prafulla Wadaskar CC: Stefan Roese CC: Tom Rini --- include/configs/sheevaplug.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'include') diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h index e1f8fb8ac8..abe8418984 100644 --- a/include/configs/sheevaplug.h +++ b/include/configs/sheevaplug.h @@ -50,14 +50,6 @@ #define CONFIG_PHY_BASE_ADR 0 #endif /* CONFIG_CMD_NET */ -/* - * SDIO/MMC Card Configuration - */ -#ifdef CONFIG_CMD_MMC -#define CONFIG_MVEBU_MMC -#define CONFIG_SYS_MMC_BASE KW_SDIO_BASE -#endif /* CONFIG_CMD_MMC */ - /* * SATA driver configuration */ -- cgit From c689ae044bf7dc22811a37818988a4533699a541 Mon Sep 17 00:00:00 2001 From: Harm Berntsen Date: Tue, 30 Mar 2021 10:19:41 +0200 Subject: mmc: mvebu: convert to driver model This is a straightforward conversion of the old, non-dm driver. It was done in-place as the deadline for non-dm MMC has passed. Previous commits ensured that no board depends on the old, non-dm variant. Tested on a Kirkwood based board with eMMC. Signed-off-by: Harm Berntsen Tested-by: Harm Berntsen Reviewed-by: Simon Glass Reviewed-by: Stefan Roese CC: Pantelis Antoniou CC: Stefan Roese CC: Gerald Kerma CC: Simon Glass Reviewed-by: Jaehoon Chung --- include/mvebu_mmc.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/mvebu_mmc.h b/include/mvebu_mmc.h index a35e5a12ce..e75c3fa328 100644 --- a/include/mvebu_mmc.h +++ b/include/mvebu_mmc.h @@ -258,17 +258,10 @@ /* Hardware reset */ #define MMC_CAP_HW_RESET (1 << 31) -struct mvebu_mmc_cfg { - u32 mvebu_mmc_base; - u32 mvebu_mmc_clk; - u8 max_bus_width; +struct mvebu_mmc_plat { + void *iobase; struct mmc_config cfg; + struct mmc mmc; }; -/* - * Functions prototypes - */ - -int mvebu_mmc_init(struct bd_info *bis); - #endif /* __MVEBU_MMC_H__ */ -- cgit