X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fspi%2Ftegra114_spi.c;h=04b4fce0612bbd14221f595ae3e65d73beb22e0f;hb=fdb6c3232f66bc9c07c30de87928506477ac4e63;hp=98a062c63d4a8c6479eec6a8674a56b3d259d5fe;hpb=76538ec64804155c5361aeac9d38291feef01c50;p=oweals%2Fu-boot.git diff --git a/drivers/spi/tegra114_spi.c b/drivers/spi/tegra114_spi.c index 98a062c63d..04b4fce061 100644 --- a/drivers/spi/tegra114_spi.c +++ b/drivers/spi/tegra114_spi.c @@ -3,22 +3,7 @@ * * Copyright (c) 2010-2013 NVIDIA Corporation * - * See file CREDITS for list of people who contributed to this - * project. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0 */ #include @@ -27,7 +12,6 @@ #include #include #include -#include #include "tegra_spi.h" DECLARE_GLOBAL_DATA_PTR; @@ -115,11 +99,9 @@ struct tegra114_spi_priv { static int tegra114_spi_ofdata_to_platdata(struct udevice *bus) { struct tegra_spi_platdata *plat = bus->platdata; - const void *blob = gd->fdt_blob; - int node = bus->of_offset; - plat->base = dev_get_addr(bus); - plat->periph_id = clock_decode_periph_id(blob, node); + plat->base = dev_read_addr(bus); + plat->periph_id = clock_decode_periph_id(bus); if (plat->periph_id == PERIPH_ID_NONE) { debug("%s: could not decode periph id %d\n", __func__, @@ -128,10 +110,10 @@ static int tegra114_spi_ofdata_to_platdata(struct udevice *bus) } /* Use 500KHz as a suitable default */ - plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency", - 500000); - plat->deactivate_delay_us = fdtdec_get_int(blob, node, - "spi-deactivate-delay", 0); + plat->frequency = dev_read_u32_default(bus, "spi-max-frequency", + 500000); + plat->deactivate_delay_us = dev_read_u32_default(bus, + "spi-deactivate-delay", 0); debug("%s: base=%#08lx, periph_id=%d, max-frequency=%d, deactivate_delay=%d\n", __func__, plat->base, plat->periph_id, plat->frequency, plat->deactivate_delay_us); @@ -167,6 +149,7 @@ static int tegra114_spi_probe(struct udevice *bus) bus->name, priv->freq, rate); } } + udelay(plat->deactivate_delay_us); /* Clear stale status here */ setbits_le32(®s->fifo_status,