From 1c162722d7c7f16b8a1bf3818a0991f373eda869 Mon Sep 17 00:00:00 2001 From: Luca Ceresoli Date: Thu, 21 May 2020 15:06:24 +0200 Subject: board: ti: am57xx: use GPIO_TO_PIN() to define GPIO number Using the macro makes code readable without the need for a comment. Signed-off-by: Luca Ceresoli --- board/ti/am57xx/board.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'board') diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 8720eb87a55..c41aa24f957 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -68,8 +68,7 @@ static int board_bootmode_has_emmc(void); DECLARE_GLOBAL_DATA_PTR; #define GPIO_ETH_LCD GPIO_TO_PIN(2, 22) -/* GPIO 7_11 */ -#define GPIO_DDR_VTT_EN 203 +#define GPIO_DDR_VTT_EN GPIO_TO_PIN(7, 11) /* Touch screen controller to identify the LCD */ #define OSD_TS_FT_BUS_ADDRESS 0 -- cgit v1.2.3 From fedfa374fff3d1c82464e7c0ca3f6c088e3197e0 Mon Sep 17 00:00:00 2001 From: Luca Ceresoli Date: Thu, 21 May 2020 15:06:25 +0200 Subject: board: ti: use positive logic to detect idk boards am57x_idk_lcd_detect() exits immediately if a known board not having an LCD is found, i.e. a non-IDK board. This is annoying as we have to remember to add an extra OR clause for every new non-IDK board. Add a board_is_ti_idk() macro so that the logic becomes positive (detect LCD on IDK boards instead of not-known-without-LCD boards). Even more important, add the macro just below the board_is_*_idk() macros, so it is easy to remember to update it when adding a new IDK. Signed-off-by: Luca Ceresoli --- board/ti/am57xx/board.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index c41aa24f957..511858a5e90 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -61,6 +61,10 @@ static int board_bootmode_has_emmc(void); #define board_is_am571x_idk() board_ti_is("AM571IDK") #define board_is_bbai() board_ti_is("BBONE-AI") +#define board_is_ti_idk() board_is_am574x_idk() || \ + board_is_am572x_idk() || \ + board_is_am571x_idk() + #ifdef CONFIG_DRIVER_TI_CPSW #include #endif @@ -666,7 +670,7 @@ void am57x_idk_lcd_detect(void) struct udevice *dev; /* Only valid for IDKs */ - if (board_is_x15() || board_is_am572x_evm() || board_is_bbai()) + if (!board_is_ti_idk()) return; /* Only AM571x IDK has gpio control detect.. so check that */ -- cgit v1.2.3 From c78ae11e07d84c10ad5ee91593e49fcf20b07359 Mon Sep 17 00:00:00 2001 From: Faiz Abbas Date: Fri, 22 May 2020 07:32:28 +0530 Subject: mmc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL Cleanup this driver to use dt in U-boot and static platdata in SPL. This requires the following steps: 1. Move all platdata assignment from probe() to ofdata_to_platdata(). This function is only called in U-boot. 2. Replicate all the platdata assignment being done in ofdata_to_platdata() in the omapl138 board file. This data is used in the SPL case where SPL_OF_CONTROL is not enabled. 3. Remove SPL_OF_CONTROL and related configs from omapl138_lcdk_defconfig This cleanup effectively reverts 3ef94715cc ('mmc: davinci: fix mmc boot in SPL') Signed-off-by: Faiz Abbas Tested-by: Bartosz Golaszewski --- arch/arm/mach-davinci/include/mach/sdmmc_defs.h | 7 +++ board/davinci/da8xxevm/omapl138_lcdk.c | 12 +++++ configs/omapl138_lcdk_defconfig | 4 -- drivers/mmc/davinci_mmc.c | 63 ++++++++++--------------- 4 files changed, 45 insertions(+), 41 deletions(-) (limited to 'board') diff --git a/arch/arm/mach-davinci/include/mach/sdmmc_defs.h b/arch/arm/mach-davinci/include/mach/sdmmc_defs.h index 46f6391aa21..f95a607e526 100644 --- a/arch/arm/mach-davinci/include/mach/sdmmc_defs.h +++ b/arch/arm/mach-davinci/include/mach/sdmmc_defs.h @@ -152,6 +152,13 @@ struct davinci_mmc { struct mmc_config cfg; }; +#define DAVINCI_MAX_BLOCKS (32) +struct davinci_mmc_plat { + struct davinci_mmc_regs *reg_base; /* Register base address */ + struct mmc_config cfg; + struct mmc mmc; +}; + int davinci_mmc_init(bd_t *bis, struct davinci_mmc *host); #endif /* _SDMMC_DEFS_H */ diff --git a/board/davinci/da8xxevm/omapl138_lcdk.c b/board/davinci/da8xxevm/omapl138_lcdk.c index adb56c6c871..84603cb1171 100644 --- a/board/davinci/da8xxevm/omapl138_lcdk.c +++ b/board/davinci/da8xxevm/omapl138_lcdk.c @@ -368,8 +368,20 @@ U_BOOT_DEVICE(omapl138_uart) = { .platdata = &serial_pdata, }; +static const struct davinci_mmc_plat mmc_platdata = { + .reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE, + .cfg = { + .f_min = 200000, + .f_max = 25000000, + .voltages = MMC_VDD_32_33 | MMC_VDD_33_34, + .host_caps = MMC_MODE_4BIT, + .b_max = DAVINCI_MAX_BLOCKS, + .name = "da830-mmc", + }, +}; U_BOOT_DEVICE(omapl138_mmc) = { .name = "davinci_mmc", + .platdata = &mmc_platdata, }; void spl_board_init(void) diff --git a/configs/omapl138_lcdk_defconfig b/configs/omapl138_lcdk_defconfig index 50cf09c7f18..b0a58de03d6 100644 --- a/configs/omapl138_lcdk_defconfig +++ b/configs/omapl138_lcdk_defconfig @@ -40,16 +40,13 @@ CONFIG_CMD_MTDPARTS=y CONFIG_CMD_DIAG=y CONFIG_CMD_UBI=y CONFIG_OF_CONTROL=y -CONFIG_SPL_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="da850-lcdk" -CONFIG_SPL_OF_PLATDATA=y CONFIG_ENV_IS_IN_NAND=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM=y CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y -CONFIG_SPL_OF_TRANSLATE=y CONFIG_DA8XX_GPIO=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_DAVINCI=y @@ -82,4 +79,3 @@ CONFIG_USB_MUSB_HOST=y CONFIG_USB_MUSB_DA8XX=y CONFIG_USB_MUSB_PIO_ONLY=y CONFIG_USB_STORAGE=y -# CONFIG_SPL_OF_LIBFDT is not set diff --git a/drivers/mmc/davinci_mmc.c b/drivers/mmc/davinci_mmc.c index 2408a687d23..4ef9f7cc8bc 100644 --- a/drivers/mmc/davinci_mmc.c +++ b/drivers/mmc/davinci_mmc.c @@ -18,7 +18,6 @@ #include #include -#define DAVINCI_MAX_BLOCKS (32) #define WATCHDOG_COUNT (100000) #define get_val(addr) REG(addr) @@ -34,12 +33,6 @@ struct davinci_mmc_priv { struct gpio_desc cd_gpio; /* Card Detect GPIO */ struct gpio_desc wp_gpio; /* Write Protect GPIO */ }; - -struct davinci_mmc_plat -{ - struct mmc_config cfg; - struct mmc mmc; -}; #endif /* Set davinci clock prescalar value based on the required clock in HZ */ @@ -487,43 +480,16 @@ static int davinci_mmc_probe(struct udevice *dev) struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); struct davinci_mmc_plat *plat = dev_get_platdata(dev); struct davinci_mmc_priv *priv = dev_get_priv(dev); - struct mmc_config *cfg = &plat->cfg; -#ifdef CONFIG_SPL_BUILD - int ret; -#endif - - cfg->f_min = 200000; - cfg->f_max = 25000000; - cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34, - cfg->host_caps = MMC_MODE_4BIT, /* DA850 supports only 4-bit SD/MMC */ - cfg->b_max = DAVINCI_MAX_BLOCKS; - cfg->name = "da830-mmc"; - priv->reg_base = (struct davinci_mmc_regs *)dev_read_addr(dev); + priv->reg_base = plat->reg_base; priv->input_clk = clk_get(DAVINCI_MMCSD_CLKID); - #if CONFIG_IS_ENABLED(DM_GPIO) /* These GPIOs are optional */ 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 - upriv->mmc = &plat->mmc; -#ifdef CONFIG_SPL_BUILD - /* - * FIXME This is a temporary workaround to enable the driver model in - * SPL on omapl138-lcdk. For some reason the bind() callback is not - * being called in SPL for MMC which breaks the mmc boot - the hack - * is to call mmc_bind() from probe(). We also don't have full DT - * support in SPL, hence the hard-coded base register address. - */ - priv->reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE; - ret = mmc_bind(dev, &plat->mmc, &plat->cfg); - if (ret) - return ret; -#endif - return davinci_dm_mmc_init(dev); } @@ -534,21 +500,44 @@ static int davinci_mmc_bind(struct udevice *dev) return mmc_bind(dev, &plat->mmc, &plat->cfg); } +#if CONFIG_IS_ENABLED(OF_CONTROL) +static int davinci_mmc_ofdata_to_platdata(struct udevice *dev) +{ + struct davinci_mmc_plat *plat = dev_get_platdata(dev); + struct mmc_config *cfg = &plat->cfg; + + plat->reg_base = (struct davinci_mmc_regs *)dev_read_addr(dev); + cfg->f_min = 200000; + cfg->f_max = 25000000; + cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34, + cfg->host_caps = MMC_MODE_4BIT, /* DA850 supports only 4-bit SD/MMC */ + cfg->b_max = DAVINCI_MAX_BLOCKS; + cfg->name = "da830-mmc"; + + return 0; +} + static const struct udevice_id davinci_mmc_ids[] = { { .compatible = "ti,da830-mmc" }, {}, }; - +#endif U_BOOT_DRIVER(davinci_mmc_drv) = { .name = "davinci_mmc", .id = UCLASS_MMC, +#if CONFIG_IS_ENABLED(OF_CONTROL) .of_match = davinci_mmc_ids, + .platdata_auto_alloc_size = sizeof(struct davinci_mmc_plat), + .ofdata_to_platdata = davinci_mmc_ofdata_to_platdata, +#endif #if CONFIG_BLK .bind = davinci_mmc_bind, #endif .probe = davinci_mmc_probe, .ops = &davinci_mmc_ops, - .platdata_auto_alloc_size = sizeof(struct davinci_mmc_plat), .priv_auto_alloc_size = sizeof(struct davinci_mmc_priv), +#if !CONFIG_IS_ENABLED(OF_CONTROL) + .flags = DM_FLAG_PRE_RELOC, +#endif }; #endif -- cgit v1.2.3 From 94e837b6fc4194c61ec12fd087c2ed26f94a50d3 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Mon, 1 Jun 2020 00:29:10 +0200 Subject: Nokia RX-51: Fix checking if serial console was enabled There was incorrect logic for parsing OMAP_TAG_UART atag. Signed-off-by: Pali Rohár --- board/nokia/rx51/rx51.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board') diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 60a2e3619c2..93d1b2febcc 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -146,7 +146,7 @@ static void reuse_omap_atags(struct tag_omap *t) } break; case OMAP_TAG_UART: - if (!t->u.uart.enabled_uarts) + if (t->u.uart.enabled_uarts) serial_was_console_enabled = 1; break; case OMAP_TAG_SERIAL_CONSOLE: -- cgit v1.2.3 From e76e85c9f4728e4765c90cef4422d7c9172161c7 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Thu, 4 Jun 2020 15:45:08 -0400 Subject: board: ti: common: Fix pointer-bool-conversion warnings When building this code with clang-10 a number of warnings will be generated along the lines of: warning: address of array 'ep->version' will always evaluate to 'true' Convert these checks to checking the strlen of the part of the array we care about. As this array will be null terminated previously by us, this is safe. Cc: Lokesh Vutla Signed-off-by: Tom Rini Reviewed-by: Lokesh Vutla --- board/ti/common/board_detect.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'board') diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c index 429668404a3..e09ecda4d7e 100644 --- a/board/ti/common/board_detect.c +++ b/board/ti/common/board_detect.c @@ -669,17 +669,17 @@ void __maybe_unused set_board_info_env(char *name) if (name) env_set("board_name", name); - else if (ep->name) + else if (strlen(ep->name) != 0) env_set("board_name", ep->name); else env_set("board_name", unknown); - if (ep->version) + if (strlen(ep->version) != 0) env_set("board_rev", ep->version); else env_set("board_rev", unknown); - if (ep->serial) + if (strlen(ep->serial) != 0) env_set("board_serial", ep->serial); else env_set("board_serial", unknown); @@ -692,22 +692,22 @@ void __maybe_unused set_board_info_env_am6(char *name) if (name) env_set("board_name", name); - else if (ep->name) + else if (strlen(ep->name) != 0) env_set("board_name", ep->name); else env_set("board_name", unknown); - if (ep->version) + if (strlen(ep->version) != 0) env_set("board_rev", ep->version); else env_set("board_rev", unknown); - if (ep->software_revision) + if (strlen(ep->software_revision) != 0) env_set("board_software_revision", ep->software_revision); else env_set("board_software_revision", unknown); - if (ep->serial) + if (strlen(ep->serial) != 0) env_set("board_serial", ep->serial); else env_set("board_serial", unknown); -- cgit v1.2.3 From f18f823c130cbfeb3124c1d62baad857fc0e8d77 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Thu, 4 Jun 2020 16:01:29 -0400 Subject: board: ti: am335x_evm: Remove duplicate setting of bd_ram_ofs member With clang we get a report that we are setting this member twice. Fortunately it is to the same value, so drop the hard-coded value line. Signed-off-by: Tom Rini Reviewed-by: Grygorii Strashko --- board/ti/am335x/board.c | 1 - 1 file changed, 1 deletion(-) (limited to 'board') diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 4199bee2e64..123ccaac44e 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -912,7 +912,6 @@ struct cpsw_platform_data am335_eth_data = { .slaves = 2, .slave_data = slave_data, .ale_entries = 1024, - .bd_ram_ofs = 0x2000, .mac_control = 0x20, .active_slave = 0, .mdio_base = 0x4a101000, -- cgit v1.2.3 From 83a0e9ddaa2cdefc307f11ceaa09a58ae6916764 Mon Sep 17 00:00:00 2001 From: Andrew F. Davis Date: Tue, 9 Jun 2020 15:14:22 -0400 Subject: board: ti: am654: Disable SA2UL node for HS devices On HS devices the access to SA2UL is restricted on the non-secure ARM side, disable the node in DT to prevent firewall violations. We used to only disable the TRNG but now that we have full SA2UL support in Linux, in which TRNG is a sub-module, disable both by disabling the parent SA2UL node. Signed-off-by: Andrew F. Davis --- board/ti/am65x/evm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'board') diff --git a/board/ti/am65x/evm.c b/board/ti/am65x/evm.c index a22900dcf97..20b75ba1332 100644 --- a/board/ti/am65x/evm.c +++ b/board/ti/am65x/evm.c @@ -108,10 +108,10 @@ int ft_board_setup(void *blob, bd_t *bd) } #if defined(CONFIG_TI_SECURE_DEVICE) - /* Make HW RNG reserved for secure world use */ - ret = fdt_disable_node(blob, "/interconnect@100000/trng@4e10000"); + /* Make Crypto HW reserved for secure world use */ + ret = fdt_disable_node(blob, "/interconnect@100000/crypto@4E00000"); if (ret) - printf("%s: disabling TRGN failed %d\n", __func__, ret); + printf("%s: disabling SA2UL failed %d\n", __func__, ret); #endif return 0; -- cgit v1.2.3 From 0a453751153cee25e5282fd6ab750dc53463d5d4 Mon Sep 17 00:00:00 2001 From: Tero Kristo Date: Tue, 16 Jun 2020 11:03:06 +0300 Subject: omap4: panda: convert to device model Convert omap4 panda to device model. Signed-off-by: Tero Kristo --- arch/arm/dts/Makefile | 4 ++++ arch/arm/dts/omap4-u-boot.dtsi | 39 ++++++++++++++++++++++++++++++++ board/ti/panda/panda.c | 50 ++++++++++-------------------------------- configs/omap4_panda_defconfig | 12 +++++++--- 4 files changed, 64 insertions(+), 41 deletions(-) create mode 100644 arch/arm/dts/omap4-u-boot.dtsi (limited to 'board') diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 9900b442741..fd2e7787ec0 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -848,6 +848,10 @@ dtb-$(CONFIG_TARGET_OMAP3_BEAGLE) += \ dtb-$(CONFIG_TARGET_OMAP3_IGEP00X0) += \ omap3-igep0020.dtb +dtb-$(CONFIG_TARGET_OMAP4_PANDA) += \ + omap4-panda.dtb \ + omap4-panda-es.dtb + dtb-$(CONFIG_TARGET_SAMA5D2_PTC_EK) += \ at91-sama5d2_ptc_ek.dtb diff --git a/arch/arm/dts/omap4-u-boot.dtsi b/arch/arm/dts/omap4-u-boot.dtsi new file mode 100644 index 00000000000..4a6bafd6edf --- /dev/null +++ b/arch/arm/dts/omap4-u-boot.dtsi @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * U-Boot additions + * + * (C) Copyright 2020 Tero Kristo + */ + +&l4_cfg { + segment@0 { + /* SCM Core */ + target-module@2000 { + compatible = "simple-bus"; + }; + + /* USB HS */ + target-module@64000 { + compatible = "simple-bus"; + }; + }; +}; + +&l4_per { + segment@0 { + /* UART3 */ + target-module@20000 { + compatible = "simple-bus"; + }; + + /* I2C1 */ + target-module@70000 { + compatible = "simple-bus"; + }; + + /* MMC1 */ + target-module@9c000 { + compatible = "simple-bus"; + }; + }; +}; diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index 9ebecfdbf58..232d999a29b 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -19,12 +20,6 @@ #include "panda_mux_data.h" -#ifdef CONFIG_USB_EHCI_HCD -#include -#include -#include -#endif - #define PANDA_ULPI_PHY_TYPE_GPIO 182 #define PANDA_BOARD_ID_1_GPIO 101 #define PANDA_ES_BOARD_ID_1_GPIO 48 @@ -55,6 +50,17 @@ int board_init(void) return 0; } +#if defined(CONFIG_SPL_OS_BOOT) +int spl_start_uboot(void) +{ + /* break into full u-boot on 'c' */ + if (serial_tstc() && serial_getc() == 'c') + return 1; + + return 0; +} +#endif /* CONFIG_SPL_OS_BOOT */ + int board_eth_init(bd_t *bis) { return 0; @@ -305,38 +311,6 @@ void board_mmc_power_init(void) #endif #endif -#ifdef CONFIG_USB_EHCI_HCD - -static struct omap_usbhs_board_data usbhs_bdata = { - .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, - .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, - .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, -}; - -int ehci_hcd_init(int index, enum usb_init_type init, - struct ehci_hccr **hccr, struct ehci_hcor **hcor) -{ - int ret; - unsigned int utmi_clk; - - /* Now we can enable our port clocks */ - utmi_clk = readl((void *)CM_L3INIT_HSUSBHOST_CLKCTRL); - utmi_clk |= HSUSBHOST_CLKCTRL_CLKSEL_UTMI_P1_MASK; - setbits_le32((void *)CM_L3INIT_HSUSBHOST_CLKCTRL, utmi_clk); - - ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor); - if (ret < 0) - return ret; - - return 0; -} - -int ehci_hcd_stop(int index) -{ - return omap_ehci_hcd_stop(); -} -#endif - /* * get_board_rev() - get board revision */ diff --git a/configs/omap4_panda_defconfig b/configs/omap4_panda_defconfig index 3ac6319d2d7..f8d37f47285 100644 --- a/configs/omap4_panda_defconfig +++ b/configs/omap4_panda_defconfig @@ -2,12 +2,14 @@ CONFIG_ARM=y CONFIG_ARCH_OMAP2PLUS=y CONFIG_OMAP44XX=y CONFIG_TARGET_OMAP4_PANDA=y +CONFIG_DEFAULT_DEVICE_TREE="omap4-panda" CONFIG_SPL=y CONFIG_SPL_TEXT_BASE=0x40300000 CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd" CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_INFO_QUIET=y +CONFIG_DEFAULT_FDT_FILE="omap4-panda.dtb" CONFIG_VERSION_VARIABLE=y # CONFIG_SPL_FS_EXT4 is not set # CONFIG_SPL_I2C_SUPPORT is not set @@ -18,21 +20,23 @@ CONFIG_CMD_ASKENV=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y -CONFIG_CMD_SPI=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set # CONFIG_CMD_NFS is not set CONFIG_CMD_EXT4_WRITE=y +CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_FAT=y CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_DM=y +CONFIG_DM_MMC=y CONFIG_MMC_OMAP_HS=y CONFIG_CONS_INDEX=3 CONFIG_SYS_NS16550=y -CONFIG_SPI=y -CONFIG_OMAP3_SPI=y +# CONFIG_SPI is not set CONFIG_USB=y +CONFIG_DM_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_UDC=y CONFIG_USB_OMAP3=y @@ -40,3 +44,5 @@ CONFIG_USB_GADGET=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_SMSC95XX=y CONFIG_OF_LIBFDT=y +CONFIG_SYS_MALLOC_F_LEN=0x4000 +CONFIG_DM_ETH=y -- cgit v1.2.3 From 8812ed97255a30a4f625e3d99a5108bf3e61ec95 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 16 Jun 2020 11:03:08 +0300 Subject: omap4: sdp: convert to device model Convert omap4 sdp to device model. Signed-off-by: Peter Ujfalusi Signed-off-by: Tero Kristo --- arch/arm/dts/Makefile | 4 ++++ board/ti/sdp4430/sdp.c | 12 ++++++++++++ configs/omap4_sdp4430_defconfig | 12 +++++++++--- 3 files changed, 25 insertions(+), 3 deletions(-) (limited to 'board') diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index fd2e7787ec0..f76c19f7944 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -852,6 +852,10 @@ dtb-$(CONFIG_TARGET_OMAP4_PANDA) += \ omap4-panda.dtb \ omap4-panda-es.dtb +dtb-$(CONFIG_TARGET_OMAP4_SDP4430) += \ + omap4-sdp.dtb \ + omap4-sdp-es23plus.dtb + dtb-$(CONFIG_TARGET_SAMA5D2_PTC_EK) += \ at91-sama5d2_ptc_ek.dtb diff --git a/board/ti/sdp4430/sdp.c b/board/ti/sdp4430/sdp.c index a5b35040453..5b294ea79b2 100644 --- a/board/ti/sdp4430/sdp.c +++ b/board/ti/sdp4430/sdp.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -91,6 +92,17 @@ void board_mmc_power_init(void) #endif #endif +#if defined(CONFIG_SPL_OS_BOOT) +int spl_start_uboot(void) +{ + /* break into full u-boot on 'c' */ + if (serial_tstc() && serial_getc() == 'c') + return 1; + + return 0; +} +#endif /* CONFIG_SPL_OS_BOOT */ + /* * get_board_rev() - get board revision */ diff --git a/configs/omap4_sdp4430_defconfig b/configs/omap4_sdp4430_defconfig index 219721388f1..e9a8a907868 100644 --- a/configs/omap4_sdp4430_defconfig +++ b/configs/omap4_sdp4430_defconfig @@ -5,6 +5,7 @@ CONFIG_ARCH_OMAP2PLUS=y CONFIG_ENV_OFFSET=0xE0000 CONFIG_OMAP44XX=y CONFIG_TARGET_OMAP4_SDP4430=y +CONFIG_DEFAULT_DEVICE_TREE="omap4-sdp" CONFIG_CMD_BAT=y CONFIG_SPL=y CONFIG_SPL_TEXT_BASE=0x40300000 @@ -12,6 +13,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd" CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_INFO_QUIET=y +CONFIG_DEFAULT_FDT_FILE="omap4-sdp.dtb" CONFIG_VERSION_VARIABLE=y # CONFIG_SPL_I2C_SUPPORT is not set # CONFIG_SPL_NAND_SUPPORT is not set @@ -19,20 +21,22 @@ CONFIG_CMD_ASKENV=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y -CONFIG_CMD_SPI=y # CONFIG_CMD_SETEXPR is not set # CONFIG_CMD_NFS is not set CONFIG_CMD_EXT4_WRITE=y +CONFIG_OF_CONTROL=y # CONFIG_EFI_PARTITION is not set CONFIG_SPL_PARTITION_UUIDS=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_DM=y +CONFIG_DM_MMC=y CONFIG_MMC_OMAP_HS=y CONFIG_CONS_INDEX=3 CONFIG_SYS_NS16550=y -CONFIG_SPI=y -CONFIG_OMAP3_SPI=y +# CONFIG_SPI is not set CONFIG_USB=y +CONFIG_DM_USB=y CONFIG_USB_MUSB_UDC=y CONFIG_USB_OMAP3=y CONFIG_USB_GADGET=y @@ -40,3 +44,5 @@ CONFIG_FAT_WRITE=y # CONFIG_REGEX is not set CONFIG_OF_LIBFDT=y # CONFIG_EFI_LOADER is not set +CONFIG_SYS_MALLOC_F_LEN=0x4000 +CONFIG_DM_ETH=y -- cgit v1.2.3 From 803e9a1f28b5a0888706eb4082297224873ce71c Mon Sep 17 00:00:00 2001 From: Tero Kristo Date: Tue, 16 Jun 2020 11:03:10 +0300 Subject: omap5: uevm: convert to device model Convert omap5 uevm board to device model. Signed-off-by: Tero Kristo --- arch/arm/dts/omap5-u-boot.dtsi | 42 +++++++++++++++++++++++ board/ti/omap5_uevm/evm.c | 78 ++++++------------------------------------ configs/omap5_uevm_defconfig | 13 +++++-- 3 files changed, 62 insertions(+), 71 deletions(-) (limited to 'board') diff --git a/arch/arm/dts/omap5-u-boot.dtsi b/arch/arm/dts/omap5-u-boot.dtsi index 39071e223d8..5a1c7bc9fe3 100644 --- a/arch/arm/dts/omap5-u-boot.dtsi +++ b/arch/arm/dts/omap5-u-boot.dtsi @@ -7,6 +7,7 @@ * Based on "dra7.dtsi" */ +#ifdef CONFIG_DRA7XX /{ chosen { tick-timer = &timer2; @@ -105,3 +106,44 @@ &i2c1 { u-boot,dm-spl; }; + +#else /* OMAP54XX */ +&l4_cfg { + segment@0 { + /* SCM Core */ + target-module@2000 { + compatible = "simple-bus"; + }; + + /* USB HS */ + target-module@64000 { + compatible = "simple-bus"; + }; + }; +}; + +&l4_per { + segment@0 { + /* UART3 */ + target-module@20000 { + compatible = "simple-bus"; + }; + + /* I2C1 */ + target-module@70000 { + compatible = "simple-bus"; + }; + + /* MMC1 */ + target-module@9c000 { + compatible = "simple-bus"; + }; + + /* MMC2 */ + target-module@b4000 { + compatible = "simple-bus"; + }; + }; +}; + +#endif diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c index e35f319b46f..319bb6aa644 100644 --- a/board/ti/omap5_uevm/evm.c +++ b/board/ti/omap5_uevm/evm.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -149,39 +150,21 @@ int board_init(void) return 0; } -int board_eth_init(bd_t *bis) +#if defined(CONFIG_SPL_OS_BOOT) +int spl_start_uboot(void) { + /* break into full u-boot on 'c' */ + if (serial_tstc() && serial_getc() == 'c') + return 1; + return 0; } +#endif /* CONFIG_SPL_OS_BOOT */ -#if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_XHCI_OMAP) -static void enable_host_clocks(void) +int board_eth_init(bd_t *bis) { - int auxclk; - int hs_clk_ctrl_val = (OPTFCLKEN_HSIC60M_P3_CLK | - OPTFCLKEN_HSIC480M_P3_CLK | - OPTFCLKEN_HSIC60M_P2_CLK | - OPTFCLKEN_HSIC480M_P2_CLK | - OPTFCLKEN_UTMI_P3_CLK | OPTFCLKEN_UTMI_P2_CLK); - - /* Enable port 2 and 3 clocks*/ - setbits_le32((*prcm)->cm_l3init_hsusbhost_clkctrl, hs_clk_ctrl_val); - - /* Enable port 2 and 3 usb host ports tll clocks*/ - setbits_le32((*prcm)->cm_l3init_hsusbtll_clkctrl, - (OPTFCLKEN_USB_CH1_CLK_ENABLE | OPTFCLKEN_USB_CH2_CLK_ENABLE)); -#ifdef CONFIG_USB_XHCI_OMAP - /* Enable the USB OTG Super speed clocks */ - setbits_le32((*prcm)->cm_l3init_usb_otg_ss_clkctrl, - (OPTFCLKEN_REFCLK960M | OTG_SS_CLKCTRL_MODULEMODE_HW)); -#endif - - auxclk = readl((*prcm)->scrm_auxclk1); - /* Request auxilary clock */ - auxclk |= AUXCLK_ENABLE_MASK; - writel(auxclk, (*prcm)->scrm_auxclk1); + return 0; } -#endif /** * @brief misc_init_r - Configure EVM board specific configurations @@ -223,45 +206,6 @@ int board_mmc_init(bd_t *bis) } #endif -#ifdef CONFIG_USB_EHCI_HCD -static struct omap_usbhs_board_data usbhs_bdata = { - .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, - .port_mode[1] = OMAP_EHCI_PORT_MODE_HSIC, - .port_mode[2] = OMAP_EHCI_PORT_MODE_HSIC, -}; - -int ehci_hcd_init(int index, enum usb_init_type init, - struct ehci_hccr **hccr, struct ehci_hcor **hcor) -{ - int ret; - - enable_host_clocks(); - - ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor); - if (ret < 0) { - puts("Failed to initialize ehci\n"); - return ret; - } - - return 0; -} - -int ehci_hcd_stop(void) -{ - return omap_ehci_hcd_stop(); -} - -void usb_hub_reset_devices(struct usb_hub_device *hub, int port) -{ - /* The LAN9730 needs to be reset after the port power has been set. */ - if (port == 3) { - gpio_direction_output(CONFIG_OMAP_EHCI_PHY3_RESET_GPIO, 0); - udelay(10); - gpio_direction_output(CONFIG_OMAP_EHCI_PHY3_RESET_GPIO, 1); - } -} -#endif - #ifdef CONFIG_USB_XHCI_OMAP /** * @brief board_usb_init - Configure EVM board specific configurations @@ -276,8 +220,6 @@ int board_usb_init(int index, enum usb_init_type init) ret = palmas_enable_ss_ldo(); #endif - enable_host_clocks(); - return 0; } #endif diff --git a/configs/omap5_uevm_defconfig b/configs/omap5_uevm_defconfig index 487f7f305cc..0029e704398 100644 --- a/configs/omap5_uevm_defconfig +++ b/configs/omap5_uevm_defconfig @@ -2,6 +2,7 @@ CONFIG_ARM=y CONFIG_ARCH_OMAP2PLUS=y CONFIG_OMAP54XX=y CONFIG_TARGET_OMAP5_UEVM=y +CONFIG_DEFAULT_DEVICE_TREE="omap5-uevm" CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC=16296 CONFIG_SPL=y CONFIG_ENV_OFFSET_REDUND=0x280000 @@ -10,6 +11,7 @@ CONFIG_SPL_TEXT_BASE=0x40300000 CONFIG_DISTRO_DEFAULTS=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_INFO_QUIET=y +CONFIG_DEFAULT_FDT_FILE="omap5-uevm.dtb" CONFIG_VERSION_VARIABLE=y # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_OS_BOOT=y @@ -20,14 +22,17 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y -CONFIG_CMD_SPI=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_EXT4_WRITE=y +CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_DM=y +CONFIG_DM_MMC=y +CONFIG_AHCI=y CONFIG_SCSI_AHCI=y CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y @@ -37,9 +42,9 @@ CONFIG_MMC_OMAP_HS=y CONFIG_SCSI=y CONFIG_CONS_INDEX=3 CONFIG_SYS_NS16550=y -CONFIG_SPI=y -CONFIG_OMAP3_SPI=y +# CONFIG_SPI is not set CONFIG_USB=y +CONFIG_DM_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_OMAP=y @@ -53,3 +58,5 @@ CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_SMSC95XX=y CONFIG_FAT_WRITE=y CONFIG_OF_LIBFDT=y +CONFIG_SYS_MALLOC_F_LEN=0x4000 +CONFIG_DM_ETH=y -- cgit v1.2.3