Skip to contentSkip to conversation

arm: am335x: Enable SPL_DM

PATCH New Lokesh Vutla 3 participants 21 messages Apr 26, 2017 – May 12, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover arm: am335x: Enable SPL_DM

Enable SPL_DM on all AM335x based TI platforms.

Using board-data way instead of using DT as suggested by Tom here[1], mainly due to space constraints. This series depends on Adam Ford's patch[2].

Link to travis-ci build tests: https://travis-ci.org/lokeshvutla/u-boot/builds/225872244

[1] https://www.mail-archive.com/u-boot at lists.denx.de/msg238483.html
[2] http://patchwork.ozlabs.org/patch/751300/

Lokesh Vutla (6):
dm: mmc: omap_hsmmc: Update to support of-platdata
dm: mmc: omap_hsmmc: Add pre-reloc flag to the driver
configs: am335x_evm: Use omap2 generic spl load script
am33xx: Provide platform data for mmc
configs: am335x_evm: Enable SPL_DM
arm: am335x: Enable tiny printf in SPL

 arch/arm/Kconfig                          |  1 +
 arch/arm/include/asm/omap_mmc.h           |  9 +++++
 arch/arm/mach-omap2/am33xx/Kconfig        |  5 +++
 arch/arm/mach-omap2/am33xx/u-boot-spl.lds | 56 -------------------------------
 board/ti/am335x/board.c                   | 32 ++++++++++++++++++
 drivers/mmc/omap_hsmmc.c                  | 25 ++++++++------
 include/configs/am335x_evm.h              |  3 +-
 include/configs/am335x_igep0033.h         |  2 +-
 include/configs/am335x_shc.h              |  2 +-
 include/configs/am335x_sl50.h             |  2 +-
 include/configs/baltos.h                  |  2 +-
 include/configs/bav335x.h                 |  2 +-
 include/configs/bur_am335x_common.h       |  2 +-
 include/configs/chiliboard.h              |  2 +-
 include/configs/cm_t335.h                 |  2 +-
 include/configs/pcm051.h                  |  2 +-
 include/configs/pengwyn.h                 |  2 +-
 include/configs/pepper.h                  |  2 +-
 include/configs/siemens-am33x-common.h    |  2 +-
 include/configs/ti_am335x_common.h        |  2 ++
 20 files changed, 77 insertions(+), 80 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/am33xx/u-boot-spl.lds
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 1/6 dm: mmc: omap_hsmmc: Update to support of-platdata

This is to aid platforms that uses OF_PLATDATA.

---
Changes since v1:
- Rebased on top of Adam's patch
http://patchwork.ozlabs.org/patch/751300/

 arch/arm/include/asm/omap_mmc.h |  9 +++++++++
 drivers/mmc/omap_hsmmc.c        | 24 ++++++++++++++----------
 2 files changed, 23 insertions(+), 10 deletions(-)
arch/arm/include/asm/omap_mmc.h +9 -0
index 93e003a368..f6eb51ee3c 100644
@@ -25,6 +25,8 @@
 #ifndef OMAP_MMC_H_
 #define OMAP_MMC_H_
 
+#include <mmc.h>
+
 struct hsmmc {
 	unsigned char res1[0x10];
 	unsigned int sysconfig;		/* 0x10 */
@@ -49,6 +51,13 @@ struct hsmmc {
 	unsigned int capa;		/* 0x140 */
 };
 
+struct omap_hsmmc_plat {
+	struct mmc_config cfg;
+	struct hsmmc *base_addr;
+	struct mmc mmc;
+	bool cd_inverted;
+};
+
 /*
  * OMAP HS MMC Bit definitions
  */
drivers/mmc/omap_hsmmc.c +14 -10
index d151fe7266..f422ed5532 100644
@@ -56,11 +56,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define SYSCTL_SRC	(1 << 25)
 #define SYSCTL_SRD	(1 << 26)
 
-struct omap_hsmmc_plat {
-	struct mmc_config cfg;
-	struct mmc mmc;
-};
-
 struct omap2_mmc_platform_config {
 	u32 reg_offset;
 };
@@ -777,9 +772,9 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio,
 	return 0;
 }
 #else
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
 static int omap_hsmmc_ofdata_to_platdata(struct udevice *dev)
 {
-	struct omap_hsmmc_data *priv = dev_get_priv(dev);
 	struct omap_hsmmc_plat *plat = dev_get_platdata(dev);
 	struct mmc_config *cfg = &plat->cfg;
 	struct omap2_mmc_platform_config *data =
@@ -788,7 +783,7 @@ static int omap_hsmmc_ofdata_to_platdata(struct udevice *dev)
 	int node = dev_of_offset(dev);
 	int val;
 
-	priv->base_addr = map_physmem(dev_get_addr(dev), sizeof(struct hsmmc *),
+	plat->base_addr = map_physmem(dev_get_addr(dev), sizeof(struct hsmmc *),
 				      MAP_NOCACHE) + data->reg_offset;
 
 	cfg->host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS;
@@ -815,11 +810,12 @@ static int omap_hsmmc_ofdata_to_platdata(struct udevice *dev)
 	cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
 
 #ifdef OMAP_HSMMC_USE_GPIO
-	priv->cd_inverted = fdtdec_get_bool(fdt, node, "cd-inverted");
+	plat->cd_inverted = fdtdec_get_bool(fdt, node, "cd-inverted");
 #endif
 
 	return 0;
 }
+#endif
 
 #ifdef CONFIG_BLK
 
@@ -840,6 +836,10 @@ static int omap_hsmmc_probe(struct udevice *dev)
 
 	cfg->name = "OMAP SD/MMC";
 	cfg->ops = &omap_hsmmc_ops;
+	priv->base_addr = plat->base_addr;
+#ifdef OMAP_HSMMC_USE_GPIO
+	priv->cd_inverted = plat->cd_inverted;
+#endif
 
 #ifdef CONFIG_BLK
 	mmc = &plat->mmc;
@@ -849,7 +849,7 @@ static int omap_hsmmc_probe(struct udevice *dev)
 		return -1;
 #endif
 
-#ifdef OMAP_HSMMC_USE_GPIO
+#if defined(OMAP_HSMMC_USE_GPIO) && CONFIG_IS_ENABLED(OF_CONTROL)
 	gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN);
 	gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio, GPIOD_IS_IN);
 #endif
@@ -860,6 +860,7 @@ static int omap_hsmmc_probe(struct udevice *dev)
 	return 0;
 }
 
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
 static const struct omap2_mmc_platform_config omap3_mmc_pdata = {
 	.reg_offset = 0,
 };
@@ -887,17 +888,20 @@ static const struct udevice_id omap_hsmmc_ids[] = {
 	},
 	{ }
 };
+#endif
 
 U_BOOT_DRIVER(omap_hsmmc) = {
 	.name	= "omap_hsmmc",
 	.id	= UCLASS_MMC,
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
 	.of_match = omap_hsmmc_ids,
 	.ofdata_to_platdata = omap_hsmmc_ofdata_to_platdata,
+	.platdata_auto_alloc_size = sizeof(struct omap_hsmmc_plat),
+#endif
 #ifdef CONFIG_BLK
 	.bind = omap_hsmmc_bind,
 #endif
 	.probe	= omap_hsmmc_probe,
 	.priv_auto_alloc_size = sizeof(struct omap_hsmmc_data),
-	.platdata_auto_alloc_size = sizeof(struct omap_hsmmc_plat),
 };
 #endif
Signature · 1 line
2.11.0
#2 lore raw

PATCH v2 1/6 dm: mmc: omap_hsmmc: Update to support of-platdata

Quoted 4 lines · Lokesh Vutla

This is to aid platforms that uses OF_PLATDATA.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170512/7adf107b/attachment.sig>
#3 lore raw

PATCH v2 2/6 dm: mmc: omap_hsmmc: Add pre-reloc flag to the driver

In reply to Lokesh Vutla

For platforms that don't use device tree in SPL the only way to mark this driver as 'required by relocation' is with the DM_FLAG_PRE_RELOC flag. Add this to ensure that the driver is bound.

---
Changes since v2:
- None

 drivers/mmc/omap_hsmmc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mmc/omap_hsmmc.c +1 -0
index f422ed5532..c136ab0ec8 100644
@@ -903,5 +903,6 @@ U_BOOT_DRIVER(omap_hsmmc) = {
 #endif
 	.probe	= omap_hsmmc_probe,
 	.priv_auto_alloc_size = sizeof(struct omap_hsmmc_data),
+	.flags	= DM_FLAG_PRE_RELOC,
 };
 #endif
Signature · 1 line
2.11.0
#4 lore raw

PATCH v2 2/6 dm: mmc: omap_hsmmc: Add pre-reloc flag to the driver

Quoted 7 lines · Lokesh Vutla

For platforms that don't use device tree in SPL the only way to mark this driver as 'required by relocation' is with the DM_FLAG_PRE_RELOC flag. Add this to ensure that the driver is bound.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170512/98a81cff/attachment.sig>
#5 lore raw

PATCH v2 3/6 configs: am335x_evm: Use omap2 generic spl load script

In reply to Lokesh Vutla

No reason to use a separate load script for am33xx than using omap-common load script.

---
Changes since v1:
- Removed am33xx specific u-boot-spl.lds

 arch/arm/mach-omap2/am33xx/u-boot-spl.lds | 56 -------------------------------
 include/configs/am335x_evm.h              |  2 +-
 include/configs/am335x_igep0033.h         |  2 +-
 include/configs/am335x_shc.h              |  2 +-
 include/configs/am335x_sl50.h             |  2 +-
 include/configs/baltos.h                  |  2 +-
 include/configs/bav335x.h                 |  2 +-
 include/configs/bur_am335x_common.h       |  2 +-
 include/configs/chiliboard.h              |  2 +-
 include/configs/cm_t335.h                 |  2 +-
 include/configs/pcm051.h                  |  2 +-
 include/configs/pengwyn.h                 |  2 +-
 include/configs/pepper.h                  |  2 +-
 include/configs/siemens-am33x-common.h    |  2 +-
 14 files changed, 13 insertions(+), 69 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/am33xx/u-boot-spl.lds
arch/arm/mach-omap2/am33xx/u-boot-spl.lds deleted +0 -56
deleted file mode 100644
index 07cf267878..0000000000
@@ -1,56 +0,0 @@
-/*
- * (C) Copyright 2002
- * Gary Jennejohn, DENX Software Engineering, <[email protected]>
- *
- * (C) Copyright 2010
- * Texas Instruments, <www.ti.com>
- *	Aneesh V <[email protected]>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
-		LENGTH = CONFIG_SPL_MAX_SIZE }
-MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
-		LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-ENTRY(_start)
-SECTIONS
-{
-	.text      :
-	{
-		__start = .;
-		*(.vectors)
-		arch/arm/cpu/armv7/start.o	(.text)
-		*(.text*)
-	} >.sram
-
-	. = ALIGN(4);
-	.rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
-
-	. = ALIGN(4);
-	.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
-
-	.u_boot_list : {
-		KEEP(*(SORT(.u_boot_list*)));
-	} >.sram
-
-	. = ALIGN(4);
-	__image_copy_end = .;
-
-	.end :
-	{
-		*(.__end)
-	} >.sram
-
-	.bss :
-	{
-		. = ALIGN(4);
-		__bss_start = .;
-		*(.bss*)
-		. = ALIGN(4);
-		__bss_end = .;
-	} >.sdram
-}
include/configs/am335x_evm.h +1 -1
index fc8a08f5b7..796d5c32e9 100644
@@ -194,7 +194,7 @@
 
 /* USB gadget RNDIS */
 
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/u-boot-spl.lds"
 #endif
 
 #ifdef CONFIG_NAND
include/configs/am335x_igep0033.h +1 -1
index 7ee8ea7975..fbedbf25ad 100644
@@ -118,7 +118,7 @@
 					"-(filesystem)"
 
 /* SPL */
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/u-boot-spl.lds"
 
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
include/configs/am335x_shc.h +1 -1
index c100fbc533..bc0943fdfd 100644
@@ -250,7 +250,7 @@
 
 /* SPL */
 
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/u-boot-spl.lds"
 
 #ifndef CONFIG_SPL_USBETH_SUPPORT
 #define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
include/configs/am335x_sl50.h +1 -1
index 710dac269c..6855f62865 100644
@@ -80,7 +80,7 @@
 #define CONFIG_BOOTCOUNT_AM33XX
 #define CONFIG_SYS_BOOTCOUNT_BE
 
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/u-boot-spl.lds"
 
 #ifndef CONFIG_SPL_USBETH_SUPPORT
 #define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
include/configs/baltos.h +1 -1
index 37c71bb433..c65eeedb53 100644
@@ -248,7 +248,7 @@
 /* General network SPL, both CPSW and USB gadget RNDIS */
 #define CONFIG_SPL_NET_VCI_STRING	"AM335x U-Boot SPL"*/
 
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/u-boot-spl.lds"
 
 #ifdef CONFIG_NAND
 #define CONFIG_NAND_OMAP_GPMC
include/configs/bav335x.h +1 -1
index d5347e626f..924a351c38 100644
@@ -348,7 +348,7 @@ DEFAULT_LINUX_BOOT_ENV \
 
 /* USB gadget RNDIS */
 
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/u-boot-spl.lds"
 #endif
 
 #ifdef CONFIG_NAND
include/configs/bur_am335x_common.h +1 -1
index e2da016f47..3742514a6e 100644
@@ -109,6 +109,6 @@
 
 /* General parts of the framework, required. */
 #define CONFIG_SPL_BOARD_INIT
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/u-boot-spl.lds"
 
 #endif	/* ! __BUR_AM335X_COMMON_H__ */
include/configs/chiliboard.h +1 -1
index c1669fa788..f515db038d 100644
@@ -130,7 +130,7 @@
 #define CONFIG_BOOTCOUNT_AM33XX
 #define CONFIG_SYS_BOOTCOUNT_BE
 
-#define CONFIG_SPL_LDSCRIPT	"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT	"arch/arm/mach-omap2/u-boot-spl.lds"
 
 /* NAND: device related configs */
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
include/configs/cm_t335.h +1 -1
index 69137bc6e8..9a8e1302c5 100644
@@ -99,7 +99,7 @@
 #define CONFIG_SYS_I2C_EEPROM_BUS	0
 
 /* SPL */
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/u-boot-spl.lds"
 
 /* Network. */
 #define CONFIG_PHY_GIGE
include/configs/pcm051.h +1 -1
index 9ce976ce43..ea3872f5c9 100644
@@ -119,7 +119,7 @@
 /* CPU */
 #define CONFIG_ENV_IS_NOWHERE
 
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/u-boot-spl.lds"
 
 #ifdef CONFIG_SPI_BOOT
 #define CONFIG_SPL_SPI_LOAD
include/configs/pengwyn.h +1 -1
index b8fb371827..9c99aa106d 100644
@@ -205,6 +205,6 @@
 
 /* CPSW support */
 
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/u-boot-spl.lds"
 
 #endif	/* ! __CONFIG_PENGWYN_H */
include/configs/pepper.h +1 -1
index 9552dd1bcb..5abeffbade 100644
@@ -86,6 +86,6 @@
 #define CONFIG_PHY_RESET_DELAY 1000
 
 /* SPL */
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/u-boot-spl.lds"
 
 #endif /* __CONFIG_PEPPER_H */
include/configs/siemens-am33x-common.h +1 -1
index d69f513c65..508b849472 100644
@@ -126,7 +126,7 @@
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SYS_SPI_U_BOOT_OFFS	0x20000
 
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/u-boot-spl.lds"
 
 #define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_NAND_AM33XX_BCH
Signature · 1 line
2.11.0
#6 lore raw

PATCH v2 3/6 configs: am335x_evm: Use omap2 generic spl load script

Quoted 4 lines · Lokesh Vutla

No reason to use a separate load script for am33xx than using omap-common load script.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170426/affd76d0/attachment.sig>
#7 lore raw

PATCH v2 3/6 configs: am335x_evm: Use omap2 generic spl load script

In reply to Lokesh Vutla
Quoted 5 lines · Lokesh Vutla

No reason to use a separate load script for am33xx than using omap-common load script.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170512/e34e62b6/attachment.sig>
#8 lore raw

PATCH v2 4/6 am33xx: Provide platform data for mmc

In reply to Lokesh Vutla

---
Changes since v1:
- Update base addresses for MMC0 and MMC1

 board/ti/am335x/board.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
board/ti/am335x/board.c +32 -0
index 3e842d3187..6786229680 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <errno.h>
 #include <spl.h>
 #include <serial.h>
@@ -26,6 +27,7 @@
 #include <asm/emif.h>
 #include <asm/gpio.h>
 #include <asm/omap_sec_common.h>
+#include <asm/omap_mmc.h>
 #include <i2c.h>
 #include <miiphy.h>
 #include <cpsw.h>
@@ -892,3 +894,33 @@ void board_fit_image_post_process(void **p_image, size_t *p_size)
 	secure_boot_verify_image(p_image, p_size);
 }
 #endif
+
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
+static const struct omap_hsmmc_plat am335x_mmc0_platdata = {
+	.base_addr = (struct hsmmc *)OMAP_HSMMC1_BASE,
+	.cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_4BIT,
+	.cfg.f_min = 400000,
+	.cfg.f_max = 52000000,
+	.cfg.voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195,
+	.cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT,
+};
+
+U_BOOT_DEVICE(am335x_mmc0) = {
+	.name = "omap_hsmmc",
+	.platdata = &am335x_mmc0_platdata,
+};
+
+static const struct omap_hsmmc_plat am335x_mmc1_platdata = {
+	.base_addr = (struct hsmmc *)OMAP_HSMMC2_BASE,
+	.cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_8BIT,
+	.cfg.f_min = 400000,
+	.cfg.f_max = 52000000,
+	.cfg.voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195,
+	.cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT,
+};
+
+U_BOOT_DEVICE(am335x_mmc1) = {
+	.name = "omap_hsmmc",
+	.platdata = &am335x_mmc1_platdata,
+};
+#endif
Signature · 1 line
2.11.0
#9 lore raw

PATCH v2 4/6 am33xx: Provide platform data for mmc

Quoted 31 lines · Lokesh Vutla

---
Changes since v1:
- Update base addresses for MMC0 and MMC1

 board/ti/am335x/board.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
board/ti/am335x/board.c +2 -0
index 3e842d3187..6786229680 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <errno.h>
 #include <spl.h>
 #include <serial.h>
@@ -26,6 +27,7 @@
 #include <asm/emif.h>
 #include <asm/gpio.h>
 #include <asm/omap_sec_common.h>
+#include <asm/omap_mmc.h>
 #include <i2c.h>
 #include <miiphy.h>
 #include <cpsw.h>
@@ -892,3 +894,33 @@ void board_fit_image_post_process(void **p_image, size_t *p_size)
        secure_boot_verify_image(p_image, p_size);
 }
 #endif

board/ti/am335x/board.c void board_fit_image_post_process(void **p_image, size_t *p_size) · line 906

Quoted 10 lines
board/ti/am335x/board.c +10 -0
+
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
+static const struct omap_hsmmc_plat am335x_mmc0_platdata = {
+       .base_addr = (struct hsmmc *)OMAP_HSMMC1_BASE,
+       .cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_4BIT,
+       .cfg.f_min = 400000,
+       .cfg.f_max = 52000000,
+       .cfg.voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195,
+       .cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT,
+};

Do you need to address the offset factor here if you're going to rebase from my series? My series removed the offset from struct hsmmc because I assummed (maybe wrongly) that everyone who was using DM_MMC was using OF_CONFIG. Since I assumed that people where using OF_CONFIG, I removed the offset from the structure and moved it elsewhere.

struct hsmmc {
-#ifdef CONFIG_DM_MMC
- unsigned char res0[0x100];
-#endif

If you're going under the assumption that people might use DM_MMC and without OF_CONTROL, I am concerned this may break because the offset was removed. I think that may be what Tony was trying to say.

If we update my patch to put the offset back, when OF_CONTROL is not present, then it may break the functionality of OMAP3 users want to use DM_MMC without OF_CONTROL which means, then the ifdef would grow.

struct hsmmc {
#if (defined(CONFIG_DM_MMC) && !defined(CONFIG_OF_CONTROL) && !defined(CONFIG_OMAP34XX))
unsigned char res0[0x100];
#endif

And that gets really ugly and part of what I was trying to avoid.

I wonder if we can somehow add the appropriate offset here like

.base_addr = (struct hsmmc *) (OMAP_HSMMC1_BASE + 0x100)

I am just thinking out loud, so forgive the excessive chatter, but since I don't have am33xx hardware, I can only give my ideas without testing.

board/ti/am335x/board.c void board_fit_image_post_process(void **p_image, size_t *p_size) · line 914

Quoted 8 lines
board/ti/am335x/board.c +8 -0
+
+U_BOOT_DEVICE(am335x_mmc0) = {
+       .name = "omap_hsmmc",
+       .platdata = &am335x_mmc0_platdata,
+};
+
+static const struct omap_hsmmc_plat am335x_mmc1_platdata = {
+       .base_addr = (struct hsmmc *)OMAP_HSMMC2_BASE,

See above on base_addr.

Quoted 19 lines
board/ti/am335x/board.c +12 -1
+       .cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_8BIT,
+       .cfg.f_min = 400000,
+       .cfg.f_max = 52000000,
+       .cfg.voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195,
+       .cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT,
+};
+
+U_BOOT_DEVICE(am335x_mmc1) = {
+       .name = "omap_hsmmc",
+       .platdata = &am335x_mmc1_platdata,
+};
+#endif
--

2.11.0

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#10 lore raw

PATCH v2 4/6 am33xx: Provide platform data for mmc

Quoted 37 lines · Adam Ford
Quoted 36 lines · Lokesh Vutla

---
Changes since v1:
- Update base addresses for MMC0 and MMC1

 board/ti/am335x/board.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
board/ti/am335x/board.c +7 -0
index 3e842d3187..6786229680 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <errno.h>
 #include <spl.h>
 #include <serial.h>
@@ -26,6 +27,7 @@
 #include <asm/emif.h>
 #include <asm/gpio.h>
 #include <asm/omap_sec_common.h>
+#include <asm/omap_mmc.h>
 #include <i2c.h>
 #include <miiphy.h>
 #include <cpsw.h>
@@ -892,3 +894,33 @@ void board_fit_image_post_process(void **p_image, size_t *p_size)
        secure_boot_verify_image(p_image, p_size);
 }
 #endif
+
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
+static const struct omap_hsmmc_plat am335x_mmc0_platdata = {
+       .base_addr = (struct hsmmc *)OMAP_HSMMC1_BASE,
+       .cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_4BIT,
Quoted 8 lines

board/ti/am335x/board.c void board_fit_image_post_process(void **p_image, size_t *p_size) · line 906

Quoted 5 lines
board/ti/am335x/board.c +5 -0
+       .cfg.f_min = 400000,
+       .cfg.f_max = 52000000,
+       .cfg.voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195,
+       .cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT,
+};

Do you need to address the offset factor here if you're going to rebase from my series? My series removed the offset from struct hsmmc

OMAP_HSMMC1_BASE includes the offset. This is currently being used in driver as well for non-DM cases.

Thanks and regards,
Lokesh

#11 lore raw

PATCH v2 4/6 am33xx: Provide platform data for mmc

Quoted 49 lines · Lokesh Vutla
Quoted 37 lines · Adam Ford
Quoted 36 lines · Lokesh Vutla

---
Changes since v1:
- Update base addresses for MMC0 and MMC1

 board/ti/am335x/board.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
board/ti/am335x/board.c +7 -0
index 3e842d3187..6786229680 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <errno.h>
 #include <spl.h>
 #include <serial.h>
@@ -26,6 +27,7 @@
 #include <asm/emif.h>
 #include <asm/gpio.h>
 #include <asm/omap_sec_common.h>
+#include <asm/omap_mmc.h>
 #include <i2c.h>
 #include <miiphy.h>
 #include <cpsw.h>
@@ -892,3 +894,33 @@ void board_fit_image_post_process(void **p_image, size_t *p_size)
        secure_boot_verify_image(p_image, p_size);
 }
 #endif
+
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
+static const struct omap_hsmmc_plat am335x_mmc0_platdata = {
+       .base_addr = (struct hsmmc *)OMAP_HSMMC1_BASE,
+       .cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_4BIT,
Quoted 8 lines

board/ti/am335x/board.c void board_fit_image_post_process(void **p_image, size_t *p_size) · line 906

Quoted 5 lines
board/ti/am335x/board.c +5 -0
+       .cfg.f_min = 400000,
+       .cfg.f_max = 52000000,
+       .cfg.voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195,
+       .cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT,
+};

Do you need to address the offset factor here if you're going to rebase from my series? My series removed the offset from struct hsmmc

Quoted 2 lines

OMAP_HSMMC1_BASE includes the offset. This is currently being used in driver as well for non-DM cases.

Great!

thanks

Quoted 4 lines

Thanks and regards,
Lokesh

#12 lore raw

PATCH v2 4/6 am33xx: Provide platform data for mmc

In reply to Lokesh Vutla
Quoted 1 line · Lokesh Vutla
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170426/665e467c/attachment.sig>
#13 lore raw

PATCH v2 4/6 am33xx: Provide platform data for mmc

Quoted 9 lines · Tom Rini
Quoted 1 line · Lokesh Vutla

--
Tom

Tom - Do you know if his series and/or my OMAP3 device tree series with MMC changes will be accepted? I haven't heard or seen any feedback on either other than that's already been in here.

adam

Quoted 5 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#14 lore raw

PATCH v2 4/6 am33xx: Provide platform data for mmc

Quoted 10 lines · Adam Ford
Quoted 5 lines · Tom Rini
Quoted 1 line · Lokesh Vutla

Tom - Do you know if his series and/or my OMAP3 device tree series with MMC changes will be accepted? I haven't heard or seen any feedback on either other than that's already been in here.

I think we'll take these in with the next release (v2017.07).

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170428/659816eb/attachment.sig>
#15 lore raw

PATCH v2 4/6 am33xx: Provide platform data for mmc

Quoted 6 lines · Tom Rini
Quoted 5 lines · Adam Ford
Quoted 4 lines · Tom Rini
Quoted 1 line · Lokesh Vutla
Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Tom - Do you know if his series and/or my OMAP3 device tree series with MMC changes will be accepted? I haven't heard or seen any feedback on either other than that's already been in here.

I think we'll take these in with the next release (v2017.07).

OK. Cool. Thanks

Quoted 2 lines

--
Tom

#16 lore raw

PATCH v2 4/6 am33xx: Provide platform data for mmc

In reply to Lokesh Vutla
Quoted 2 lines · Lokesh Vutla

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170512/1deac5d4/attachment.sig>
#17 lore raw

PATCH v2 5/6 configs: am335x_evm: Enable SPL_DM

In reply to Lokesh Vutla

Enable SPL_DM on all AM335x based TI platforms.

http://patchwork.ozlabs.org/patch/751300/

---
Changes since v1:
- None

 arch/arm/mach-omap2/am33xx/Kconfig | 5 +++++
 include/configs/am335x_evm.h       | 1 -
 include/configs/ti_am335x_common.h | 2 ++
 3 files changed, 7 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/am33xx/Kconfig +5 -0
index cf5d95a26d..acdb88a702 100644
@@ -29,6 +29,11 @@ config TARGET_AM335X_EVM
 	imply SPL_SERIAL_SUPPORT
 	imply SPL_WATCHDOG_SUPPORT
 	imply SPL_YMODEM_SUPPORT
+	imply SPL_SYS_MALLOC_SIMPLE
+	imply SPL_SEPARATE_BSS
+	imply SPL_DM
+	imply SPL_DM_SEQ_ALIAS
+	imply SPL_OF_LIBFDT
 	help
 	  This option specifies support for the AM335x
 	  GP and HS EVM development platforms. The AM335x
include/configs/am335x_evm.h +0 -1
index 796d5c32e9..51c3d493c8 100644
@@ -291,7 +291,6 @@
  * DM support in SPL
  */
 #ifdef CONFIG_SPL_BUILD
-#undef CONFIG_DM_MMC
 #undef CONFIG_TIMER
 #undef CONFIG_DM_USB
 #endif
include/configs/ti_am335x_common.h +2 -0
index c0e4336eb0..e4c3c807f2 100644
@@ -22,8 +22,10 @@
 /* NS16550 Configuration */
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_SYS_NS16550_SERIAL
+#ifndef CONFIG_DM_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE	(-4)
 #endif
+#endif
 #define CONFIG_SYS_NS16550_CLK		48000000
 
 #ifndef CONFIG_SPL_BUILD
Signature · 1 line
2.11.0
#18 lore raw

PATCH v2 5/6 configs: am335x_evm: Enable SPL_DM

Quoted 4 lines · Lokesh Vutla

Enable SPL_DM on all AM335x based TI platforms.

http://patchwork.ozlabs.org/patch/751300/

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170512/2fcaadd4/attachment-0001.sig>
#19 lore raw

PATCH v2 6/6 arm: am335x: Enable tiny printf in SPL

In reply to Lokesh Vutla

am335x_evm SPL is very close to its limit in SRAM space. Switch to use tiny printf to reclaim some size.

---
Changes since v1:
- None

 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig +1 -0
index 7812f21f36..7368f6b95c 100644
@@ -761,6 +761,7 @@ config AM33XX
 	bool "AM33XX SoC"
 	select ARCH_OMAP2
 	imply SYS_THUMB_BUILD
+	imply USE_TINY_PRINTF
 	help
 	  Support for AM335x SOC from Texas Instruments.
 	  The AM335x high performance SOC features a Cortex-A8
Signature · 1 line
2.11.0
#20 lore raw

PATCH v2 6/6 arm: am335x: Enable tiny printf in SPL

Quoted 5 lines · Lokesh Vutla

am335x_evm SPL is very close to its limit in SRAM space. Switch to use tiny printf to reclaim some size.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170512/e45a4aa3/attachment.sig>