X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fmisc%2Ffsl_iim.c;h=f8075db8d5ec33973659eef9c9aa05aef1c74913;hb=50d16bcf331081dbb7f2d76a7acd33ac4580e1a8;hp=9179fbb0db923bacf57d0b3b61b0423b296a879f;hpb=f0df254663d44f7fd4b714542bb4602626837465;p=u-boot diff --git a/drivers/misc/fsl_iim.c b/drivers/misc/fsl_iim.c index 9179fbb0db..f8075db8d5 100644 --- a/drivers/misc/fsl_iim.c +++ b/drivers/misc/fsl_iim.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2009-2013 ADVANSEE * Benoît Thébaudeau @@ -5,32 +6,15 @@ * Based on the mpc512x iim code: * Copyright 2008 Silicon Turnkey Express, Inc. * Martha Marx - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * 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 */ #include #include -#include +#include #include -#ifndef CONFIG_MPC512X #include +#if defined(CONFIG_MX51) || defined(CONFIG_MX53) +#include #endif /* FSL IIM-specific constants */ @@ -109,6 +93,10 @@ struct fsl_iim { } bank[8]; }; +#if !defined(CONFIG_MX51) && !defined(CONFIG_MX53) +#define enable_efuse_prog_supply(enable) +#endif + static int prepare_access(struct fsl_iim **regs, u32 bank, u32 word, int assert, const char *caller) { @@ -253,12 +241,16 @@ int fuse_prog(u32 bank, u32 word, u32 val) if (ret) return ret; + enable_efuse_prog_supply(1); for (bit = 0; val; bit++, val >>= 1) if (val & 0x01) { ret = prog_bit(regs, bank, word, bit); - if (ret) + if (ret) { + enable_efuse_prog_supply(0); return ret; + } } + enable_efuse_prog_supply(0); return 0; }