X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=board%2Fcm5200%2Ffwupdate.c;h=4740c8394c5fa699088c2316df10e11f4ea06597;hb=2c62e313b14186d67f5bf26095f36a246cb0c3a4;hp=9d4eadcb66d4ca7ea4f08a5bd9a11be635b228aa;hpb=cdc51c294ad33879c4e57edf4c9d2155381b1d59;p=platform%2Fkernel%2Fu-boot.git diff --git a/board/cm5200/fwupdate.c b/board/cm5200/fwupdate.c index 9d4eadc..4740c83 100644 --- a/board/cm5200/fwupdate.c +++ b/board/cm5200/fwupdate.c @@ -7,27 +7,12 @@ * - code clean-up * - bugfix for overwriting bootargs by user * - * 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 + * SPDX-License-Identifier: GPL-2.0+ */ #include #include +#include #include #include #include @@ -35,9 +20,6 @@ #include "fwupdate.h" -extern long do_fat_read(const char *, void *, unsigned long, int); -extern int do_fat_fsload(cmd_tbl_t *, int, int, char * const []); - static int load_rescue_image(ulong); void cm5200_fwupdate(void) @@ -99,7 +81,7 @@ static int load_rescue_image(ulong addr) char dev[7]; char addr_str[16]; char * const argv[6] = { "fatload", "usb", dev, addr_str, nxri, NULL }; - block_dev_desc_t *stor_dev = NULL; + struct blk_desc *stor_dev = NULL; cmd_tbl_t *bcmd; /* Get name of firmware directory */ @@ -123,7 +105,7 @@ static int load_rescue_image(ulong addr) /* Detect storage device */ for (devno = 0; devno < USB_MAX_STOR_DEV; devno++) { - stor_dev = usb_stor_get_dev(devno); + stor_dev = blk_get_devnum_by_type(IF_TYPE_USB, devno); if (stor_dev->type != DEV_TYPE_UNKNOWN) break; } @@ -135,12 +117,12 @@ static int load_rescue_image(ulong addr) /* Detect partition */ for (partno = -1, i = 0; i < 6; i++) { - if (get_partition_info(stor_dev, i, &info) == 0) { + if (part_get_info(stor_dev, i, &info) == 0) { if (fat_register_device(stor_dev, i) == 0) { /* Check if rescue image is present */ FW_DEBUG("Looking for firmware directory '%s'" " on partition %d\n", fwdir, i); - if (do_fat_read(fwdir, NULL, 0, LS_NO) == -1) { + if (!fat_exists(fwdir)) { FW_DEBUG("No NX rescue image on " "partition %d.\n", i); partno = -2;