diff options
-rw-r--r-- | arch/arm/mach-tegra/xusb-padctl-common.c | 12 | ||||
-rw-r--r-- | board/toradex/apalis-tk1/apalis-tk1.c | 19 | ||||
-rw-r--r-- | board/toradex/apalis_t30/apalis_t30.c | 20 | ||||
-rw-r--r-- | board/toradex/colibri_t20/colibri_t20.c | 20 | ||||
-rw-r--r-- | board/toradex/colibri_t30/colibri_t30.c | 20 | ||||
-rw-r--r-- | drivers/i2c/tegra_i2c.c | 1 | ||||
-rw-r--r-- | drivers/mmc/fsl_esdhc_imx.c | 50 | ||||
-rw-r--r-- | drivers/mmc/mmc.c | 3 | ||||
-rw-r--r-- | drivers/mmc/mmc_write.c | 2 | ||||
-rw-r--r-- | drivers/pci/pci_tegra.c | 4 | ||||
-rw-r--r-- | drivers/video/tegra124/dp.c | 1 | ||||
-rw-r--r-- | env/mmc.c | 10 | ||||
-rw-r--r-- | include/mmc.h | 1 | ||||
-rw-r--r-- | tools/dtoc/test_src_scan.py | 1 |
14 files changed, 135 insertions, 29 deletions
diff --git a/arch/arm/mach-tegra/xusb-padctl-common.c b/arch/arm/mach-tegra/xusb-padctl-common.c index e56e27c8b6..8bdd44ad7a 100644 --- a/arch/arm/mach-tegra/xusb-padctl-common.c +++ b/arch/arm/mach-tegra/xusb-padctl-common.c @@ -84,7 +84,7 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl, len = ofnode_read_string_count(node, "nvidia,lanes"); if (len < 0) { - pr_err("failed to parse \"nvidia,lanes\" property"); + pr_err("failed to parse \"nvidia,lanes\" property\n"); return -EINVAL; } @@ -94,7 +94,7 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl, ret = ofnode_read_string_index(node, "nvidia,lanes", i, &group->pins[i]); if (ret) { - pr_err("failed to read string from \"nvidia,lanes\" property"); + pr_err("failed to read string from \"nvidia,lanes\" property\n"); return -EINVAL; } } @@ -104,7 +104,7 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl, ret = ofnode_read_string_index(node, "nvidia,function", 0, &group->func); if (ret) { - pr_err("failed to parse \"nvidia,func\" property"); + pr_err("failed to parse \"nvidia,func\" property\n"); return -EINVAL; } @@ -232,7 +232,7 @@ tegra_xusb_padctl_config_parse_dt(struct tegra_xusb_padctl *padctl, err = tegra_xusb_padctl_group_parse_dt(padctl, group, subnode); if (err < 0) { - pr_err("failed to parse group %s", group->name); + pr_err("failed to parse group %s\n", group->name); return err; } @@ -261,7 +261,7 @@ static int tegra_xusb_padctl_parse_dt(struct tegra_xusb_padctl *padctl, err = tegra_xusb_padctl_config_parse_dt(padctl, config, subnode); if (err < 0) { - pr_err("failed to parse entry %s: %d", + pr_err("failed to parse entry %s: %d\n", config->name, err); continue; } @@ -289,7 +289,7 @@ int tegra_xusb_process_nodes(ofnode nodes[], unsigned int count, err = tegra_xusb_padctl_parse_dt(&padctl, nodes[i]); if (err < 0) { - pr_err("failed to parse DT: %d", err); + pr_err("failed to parse DT: %d\n", err); continue; } diff --git a/board/toradex/apalis-tk1/apalis-tk1.c b/board/toradex/apalis-tk1/apalis-tk1.c index ccf665b211..86b10400ff 100644 --- a/board/toradex/apalis-tk1/apalis-tk1.c +++ b/board/toradex/apalis-tk1/apalis-tk1.c @@ -14,6 +14,7 @@ #include <asm/arch/gpio.h> #include <asm/arch/pinmux.h> #include <env_internal.h> +#include <fdt_support.h> #include <pci_tegra.h> #include <linux/delay.h> #include <power/as3722.h> @@ -99,6 +100,24 @@ int checkboard(void) #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, struct bd_info *bd) { + u8 enetaddr[6]; + + /* MAC addr */ + if (eth_env_get_enetaddr("ethaddr", enetaddr)) { + int err = fdt_find_and_setprop(blob, + "/pcie@1003000/pci@2,0/ethernet@0,0", + "local-mac-address", enetaddr, 6, 0); + + /* Older device trees might have used a different node name */ + if (err < 0) + err = fdt_find_and_setprop(blob, + "/pcie@1003000/pci@2,0/pcie@0", + "local-mac-address", enetaddr, 6, 0); + + if (err >= 0) + puts(" MAC address updated...\n"); + } + return ft_common_board_setup(blob, bd); } #endif diff --git a/board/toradex/apalis_t30/apalis_t30.c b/board/toradex/apalis_t30/apalis_t30.c index 0396eea56b..ef71270d9f 100644 --- a/board/toradex/apalis_t30/apalis_t30.c +++ b/board/toradex/apalis_t30/apalis_t30.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <env.h> #include <init.h> #include <log.h> #include <asm/arch/gp_padctrl.h> @@ -16,6 +17,7 @@ #include <asm/io.h> #include <dm.h> #include <i2c.h> +#include <fdt_support.h> #include <pci_tegra.h> #include <linux/delay.h> #include "../common/tdx-common.h" @@ -54,6 +56,24 @@ int checkboard(void) #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, struct bd_info *bd) { + u8 enetaddr[6]; + + /* MAC addr */ + if (eth_env_get_enetaddr("ethaddr", enetaddr)) { + int err = fdt_find_and_setprop(blob, + "/pcie@3000/pci@3,0/ethernet@0,0", + "local-mac-address", enetaddr, 6, 0); + + /* Older device trees might have used a different node name */ + if (err < 0) + err = fdt_find_and_setprop(blob, + "/pcie@3000/pci@3,0/pcie@0", + "local-mac-address", enetaddr, 6, 0); + + if (err >= 0) + puts(" MAC address updated...\n"); + } + return ft_common_board_setup(blob, bd); } #endif diff --git a/board/toradex/colibri_t20/colibri_t20.c b/board/toradex/colibri_t20/colibri_t20.c index 73ef4d2db3..1df9697b97 100644 --- a/board/toradex/colibri_t20/colibri_t20.c +++ b/board/toradex/colibri_t20/colibri_t20.c @@ -4,6 +4,8 @@ */ #include <common.h> +#include <env.h> +#include <fdt_support.h> #include <init.h> #include <log.h> #include <asm/arch/clock.h> @@ -81,6 +83,24 @@ int checkboard(void) #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, struct bd_info *bd) { + u8 enetaddr[6]; + + /* MAC addr */ + if (eth_env_get_enetaddr("ethaddr", enetaddr)) { + int err = fdt_find_and_setprop(blob, + "/usb@7d004000/ethernet@1", + "local-mac-address", enetaddr, 6, 0); + + /* Older device trees might have used a different node name */ + if (err < 0) + err = fdt_find_and_setprop(blob, + "/usb@7d004000/asix@1", + "local-mac-address", enetaddr, 6, 0); + + if (err >= 0) + puts(" MAC address updated...\n"); + } + return ft_common_board_setup(blob, bd); } #endif diff --git a/board/toradex/colibri_t30/colibri_t30.c b/board/toradex/colibri_t30/colibri_t30.c index 20cbb75a36..b6b004669c 100644 --- a/board/toradex/colibri_t30/colibri_t30.c +++ b/board/toradex/colibri_t30/colibri_t30.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <env.h> #include <init.h> #include <asm/arch/gp_padctrl.h> #include <asm/arch/pinmux.h> @@ -12,6 +13,7 @@ #include <asm/arch-tegra/tegra.h> #include <asm/gpio.h> #include <asm/io.h> +#include <fdt_support.h> #include <i2c.h> #include <linux/delay.h> #include "pinmux-config-colibri_t30.h" @@ -36,6 +38,24 @@ int checkboard(void) #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, struct bd_info *bd) { + u8 enetaddr[6]; + + /* MAC addr */ + if (eth_env_get_enetaddr("ethaddr", enetaddr)) { + int err = fdt_find_and_setprop(blob, + "/usb@7d004000/ethernet@1", + "local-mac-address", enetaddr, 6, 0); + + /* Older device trees might have used a different node name */ + if (err < 0) + err = fdt_find_and_setprop(blob, + "/usb@7d004000/asix@1", + "local-mac-address", enetaddr, 6, 0); + + if (err >= 0) + puts(" MAC address updated...\n"); + } + return ft_common_board_setup(blob, bd); } #endif diff --git a/drivers/i2c/tegra_i2c.c b/drivers/i2c/tegra_i2c.c index 1e74484542..2394e9d0fb 100644 --- a/drivers/i2c/tegra_i2c.c +++ b/drivers/i2c/tegra_i2c.c @@ -514,6 +514,7 @@ static const struct dm_i2c_ops tegra_i2c_ops = { static const struct udevice_id tegra_i2c_ids[] = { { .compatible = "nvidia,tegra114-i2c", .data = TYPE_114 }, + { .compatible = "nvidia,tegra124-i2c", .data = TYPE_114 }, { .compatible = "nvidia,tegra20-i2c", .data = TYPE_STD }, { .compatible = "nvidia,tegra20-i2c-dvc", .data = TYPE_DVC }, { } diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c index 893d7e241f..9befb190bd 100644 --- a/drivers/mmc/fsl_esdhc_imx.c +++ b/drivers/mmc/fsl_esdhc_imx.c @@ -1060,6 +1060,30 @@ static int esdhc_getcd_common(struct fsl_esdhc_priv *priv) return timeout > 0; } +static int esdhc_wait_dat0_common(struct fsl_esdhc_priv *priv, int state, + int timeout_us) +{ + struct fsl_esdhc *regs = priv->esdhc_regs; + int ret, err; + u32 tmp; + + /* make sure the card clock keep on */ + esdhc_setbits32(®s->vendorspec, VENDORSPEC_FRC_SDCLK_ON); + + ret = readx_poll_timeout(esdhc_read32, ®s->prsstat, tmp, + !!(tmp & PRSSTAT_DAT0) == !!state, + timeout_us); + + /* change to default setting, let host control the card clock */ + esdhc_clrbits32(®s->vendorspec, VENDORSPEC_FRC_SDCLK_ON); + + err = readx_poll_timeout(esdhc_read32, ®s->prsstat, tmp, tmp & PRSSTAT_SDOFF, 100); + if (err) + pr_warn("card clock not gate off as expect.\n"); + + return ret; +} + static int esdhc_reset(struct fsl_esdhc *regs) { ulong start; @@ -1109,11 +1133,19 @@ static int esdhc_set_ios(struct mmc *mmc) return esdhc_set_ios_common(priv, mmc); } +static int esdhc_wait_dat0(struct mmc *mmc, int state, int timeout_us) +{ + struct fsl_esdhc_priv *priv = mmc->priv; + + return esdhc_wait_dat0_common(priv, state, timeout_us); +} + static const struct mmc_ops esdhc_ops = { .getcd = esdhc_getcd, .init = esdhc_init, .send_cmd = esdhc_send_cmd, .set_ios = esdhc_set_ios, + .wait_dat0 = esdhc_wait_dat0, }; #endif @@ -1576,25 +1608,9 @@ static int __maybe_unused fsl_esdhc_set_enhanced_strobe(struct udevice *dev) static int fsl_esdhc_wait_dat0(struct udevice *dev, int state, int timeout_us) { - int ret, err; - u32 tmp; struct fsl_esdhc_priv *priv = dev_get_priv(dev); - struct fsl_esdhc *regs = priv->esdhc_regs; - /* make sure the card clock keep on */ - esdhc_setbits32(®s->vendorspec, VENDORSPEC_FRC_SDCLK_ON); - - ret = readx_poll_timeout(esdhc_read32, ®s->prsstat, tmp, - !!(tmp & PRSSTAT_DAT0) == !!state, - timeout_us); - - /* change to default setting, let host control the card clock */ - esdhc_clrbits32(®s->vendorspec, VENDORSPEC_FRC_SDCLK_ON); - err = readx_poll_timeout(esdhc_read32, ®s->prsstat, tmp, tmp & PRSSTAT_SDOFF, 100); - if (err) - dev_warn(dev, "card clock not gate off as expect.\n"); - - return ret; + return esdhc_wait_dat0_common(priv, state, timeout_us); } static const struct dm_mmc_ops fsl_esdhc_ops = { diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 8a7d073900..12d29da528 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -34,6 +34,9 @@ static int mmc_set_signal_voltage(struct mmc *mmc, uint signal_voltage); static int mmc_wait_dat0(struct mmc *mmc, int state, int timeout_us) { + if (mmc->cfg->ops->wait_dat0) + return mmc->cfg->ops->wait_dat0(mmc, state, timeout_us); + return -ENOSYS; } diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c index d23b7d9729..eab94c7b60 100644 --- a/drivers/mmc/mmc_write.c +++ b/drivers/mmc/mmc_write.c @@ -102,7 +102,7 @@ ulong mmc_berase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt) "The erase range would be change to " "0x" LBAF "~0x" LBAF "\n\n", mmc->erase_grp_size, start & ~(mmc->erase_grp_size - 1), - ((start + blkcnt + mmc->erase_grp_size) + ((start + blkcnt + mmc->erase_grp_size - 1) & ~(mmc->erase_grp_size - 1)) - 1); while (blk < blkcnt) { diff --git a/drivers/pci/pci_tegra.c b/drivers/pci/pci_tegra.c index f8d66c0e1c..bc489d5ec8 100644 --- a/drivers/pci/pci_tegra.c +++ b/drivers/pci/pci_tegra.c @@ -455,7 +455,7 @@ static int tegra_pcie_parse_port_info(ofnode node, uint *index, uint *lanes) err = ofnode_read_u32_default(node, "nvidia,num-lanes", -1); if (err < 0) { - pr_err("failed to parse \"nvidia,num-lanes\" property"); + pr_err("failed to parse \"nvidia,num-lanes\" property\n"); return err; } @@ -463,7 +463,7 @@ static int tegra_pcie_parse_port_info(ofnode node, uint *index, uint *lanes) err = ofnode_read_pci_addr(node, 0, "reg", &addr); if (err < 0) { - pr_err("failed to parse \"reg\" property"); + pr_err("failed to parse \"reg\" property\n"); return err; } diff --git a/drivers/video/tegra124/dp.c b/drivers/video/tegra124/dp.c index 8f5116fe7c..ee4f09a0c4 100644 --- a/drivers/video/tegra124/dp.c +++ b/drivers/video/tegra124/dp.c @@ -1609,6 +1609,7 @@ static int dp_tegra_probe(struct udevice *dev) static const struct udevice_id tegra_dp_ids[] = { { .compatible = "nvidia,tegra124-dpaux" }, + { .compatible = "nvidia,tegra210-dpaux" }, { } }; @@ -257,12 +257,15 @@ static inline int erase_env(struct mmc *mmc, unsigned long size, { uint blk_start, blk_cnt, n; struct blk_desc *desc = mmc_get_blk_desc(mmc); + u32 erase_size; - blk_start = ALIGN(offset, mmc->write_bl_len) / mmc->write_bl_len; - blk_cnt = ALIGN(size, mmc->write_bl_len) / mmc->write_bl_len; + erase_size = mmc->erase_grp_size * desc->blksz; + blk_start = ALIGN_DOWN(offset, erase_size) / desc->blksz; + blk_cnt = ALIGN(size, erase_size) / desc->blksz; n = blk_derase(desc, blk_start, blk_cnt); - printf("%d blocks erased: %s\n", n, (n == blk_cnt) ? "OK" : "ERROR"); + printf("%d blocks erased at 0x%x: %s\n", n, blk_start, + (n == blk_cnt) ? "OK" : "ERROR"); return (n == blk_cnt) ? 0 : 1; } @@ -286,6 +289,7 @@ static int env_mmc_erase(void) goto fini; } + printf("\n"); ret = erase_env(mmc, CONFIG_ENV_SIZE, offset); #ifdef CONFIG_ENV_OFFSET_REDUND diff --git a/include/mmc.h b/include/mmc.h index 9b4dc68311..073b01f82b 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -561,6 +561,7 @@ struct mmc_ops { int (*getwp)(struct mmc *mmc); int (*host_power_cycle)(struct mmc *mmc); int (*get_b_max)(struct mmc *mmc, void *dst, lbaint_t blkcnt); + int (*wait_dat0)(struct mmc *mmc, int state, int timeout_us); }; static inline int mmc_hs400_prepare_ddr(struct mmc *mmc) diff --git a/tools/dtoc/test_src_scan.py b/tools/dtoc/test_src_scan.py index bdfa669d81..f93cd7f5a3 100644 --- a/tools/dtoc/test_src_scan.py +++ b/tools/dtoc/test_src_scan.py @@ -151,6 +151,7 @@ class TestSrcScan(unittest.TestCase): self.assertEqual('UCLASS_I2C', drv.uclass_id) self.assertEqual( {'nvidia,tegra114-i2c': 'TYPE_114', + 'nvidia,tegra124-i2c': 'TYPE_114', 'nvidia,tegra20-i2c': 'TYPE_STD', 'nvidia,tegra20-i2c-dvc': 'TYPE_DVC'}, drv.compat) self.assertEqual('i2c_bus', drv.priv) |