diff options
author | Tom Rini <trini@konsulko.com> | 2016-07-22 09:22:26 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-07-22 09:22:26 -0400 |
commit | 9f03247edc7761b608db31104821b4518a70e691 (patch) | |
tree | 1f42f9d51050f960148adc49177f811b250588b9 /drivers | |
parent | 89ca873e2ddea859526f25f678fa53dda055e90f (diff) | |
parent | 766d2609dd7fbad0faa89c7dff26edc108afa890 (diff) |
Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/clk-uclass.c | 28 | ||||
-rw-r--r-- | drivers/mmc/sdhci.c | 2 | ||||
-rw-r--r-- | drivers/serial/serial_zynq.c | 28 | ||||
-rw-r--r-- | drivers/usb/host/Kconfig | 7 |
4 files changed, 36 insertions, 29 deletions
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index e0f85677e3..4d78e3fcac 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -21,7 +21,6 @@ static inline struct clk_ops *clk_dev_ops(struct udevice *dev) } #if CONFIG_IS_ENABLED(OF_CONTROL) -#ifdef CONFIG_SPL_BUILD # if CONFIG_IS_ENABLED(OF_PLATDATA) int clk_get_by_index_platdata(struct udevice *dev, int index, struct phandle_2_cell *cells, struct clk *clk) @@ -38,31 +37,6 @@ int clk_get_by_index_platdata(struct udevice *dev, int index, return 0; } # else -int clk_get_by_index(struct udevice *dev, int index, struct clk *clk) -{ - int ret; - u32 cell[2]; - - if (index != 0) - return -ENOSYS; - assert(clk); - ret = uclass_get_device(UCLASS_CLK, 0, &clk->dev); - if (ret) - return ret; - ret = fdtdec_get_int_array(gd->fdt_blob, dev->of_offset, "clocks", - cell, 2); - if (ret) - return ret; - clk->id = cell[1]; - return 0; -} -# endif /* OF_PLATDATA */ - -int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk) -{ - return -ENOSYS; -} -#else static int clk_of_xlate_default(struct clk *clk, struct fdtdec_phandle_args *args) { @@ -119,6 +93,7 @@ int clk_get_by_index(struct udevice *dev, int index, struct clk *clk) return clk_request(dev_clk, clk); } +# endif /* OF_PLATDATA */ int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk) { @@ -135,7 +110,6 @@ int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk) return clk_get_by_index(dev, index, clk); } -#endif /* CONFIG_SPL_BUILD */ #endif /* OF_CONTROL */ int clk_request(struct udevice *dev, struct clk *clk) diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index de8d8ea70c..9fdbed8aa9 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -313,7 +313,7 @@ static int sdhci_set_clock(struct mmc *mmc, unsigned int clock) } reg = sdhci_readw(host, SDHCI_CLOCK_CONTROL); - reg &= ~SDHCI_CLOCK_CARD_EN; + reg &= ~(SDHCI_CLOCK_CARD_EN | SDHCI_CLOCK_INT_EN); sdhci_writew(host, reg, SDHCI_CLOCK_CONTROL); if (clock == 0) diff --git a/drivers/serial/serial_zynq.c b/drivers/serial/serial_zynq.c index 66d54e32ab..4f6e7e442f 100644 --- a/drivers/serial/serial_zynq.c +++ b/drivers/serial/serial_zynq.c @@ -5,6 +5,7 @@ * SPDX-License-Identifier: GPL-2.0+ */ +#include <clk.h> #include <common.h> #include <debug_uart.h> #include <dm.h> @@ -108,8 +109,33 @@ static int _uart_zynq_serial_putc(struct uart_zynq *regs, const char c) int zynq_serial_setbrg(struct udevice *dev, int baudrate) { struct zynq_uart_priv *priv = dev_get_priv(dev); - unsigned long clock = get_uart_clk(0); + unsigned long clock; +#if defined(CONFIG_CLK) || defined(CONFIG_SPL_CLK) + int ret; + struct clk clk; + + ret = clk_get_by_index(dev, 0, &clk); + if (ret < 0) { + dev_err(dev, "failed to get clock\n"); + return ret; + } + + clock = clk_get_rate(&clk); + if (IS_ERR_VALUE(clock)) { + dev_err(dev, "failed to get rate\n"); + return clock; + } + debug("%s: CLK %ld\n", __func__, clock); + + ret = clk_enable(&clk); + if (ret && ret != -ENOSYS) { + dev_err(dev, "failed to enable clock\n"); + return ret; + } +#else + clock = get_uart_clk(0); +#endif _uart_zynq_serial_setbrg(priv->regs, clock, baudrate); return 0; diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 89580cc31f..5092251ee0 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -85,6 +85,13 @@ config USB_EHCI_MSM This driver supports combination of Chipidea USB controller and Synapsys USB PHY in host mode only. +config USB_EHCI_ZYNQ + bool "Support for Xilinx Zynq on-chip EHCI USB controller" + depends on ARCH_ZYNQ + default y + ---help--- + Enable support for Zynq on-chip EHCI USB controller + config USB_EHCI_GENERIC bool "Support for generic EHCI USB controller" depends on OF_CONTROL |