From patchwork Thu Oct 4 01:47:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 189000 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id DA79B2C032E for ; Thu, 4 Oct 2012 11:50:51 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ADC47282BE; Thu, 4 Oct 2012 03:49:52 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IYcK61zWiqVk; Thu, 4 Oct 2012 03:49:52 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 46CBB282C0; Thu, 4 Oct 2012 03:48:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 25A3328203 for ; Thu, 4 Oct 2012 03:47:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 19YqBvnodiCO for ; Thu, 4 Oct 2012 03:47:43 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTPS id 48B112820F for ; Thu, 4 Oct 2012 03:47:38 +0200 (CEST) Received: by mail-pb0-f44.google.com with SMTP id ro8so70170pbb.3 for ; Wed, 03 Oct 2012 18:47:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=koLb6GCa38RuJhazSXjiWPzUvm9125HJLXcL0tG3Yww=; b=enEpWf8pZXEOch+a1mQrJHETJYnAAvYJ7zu5KaKZf6DhqRqc3pvlci750Z40+m+wzI KtA3kljLIOabCqSiiMAEnyhbF0a/WdrbhhiJJUzSd9Q0GC986OBhKG3vCKtqzTCvhHli zKacmnK5ZiUo1jOeCbcsHuvlRUWwOYSWk+CbSrE75vIaXuM5oJLrM6xEfPBpVlBWhIS3 Q0OK8HRW2PqWxZZdOSe/Rhigc4qN3KlzDN/PgH0zp7VYGz5irzriv0edLCi7s4gtQ22J bVjgDMSp0jahqHwTizhDgnK0TLjrtNIeo3xMO+NFWut1l/O65LWe0AtDEcZI2hE2aWk7 srhQ== Received: by 10.68.224.138 with SMTP id rc10mr17595839pbc.34.1349315256588; Wed, 03 Oct 2012 18:47:36 -0700 (PDT) Received: from officeserver-2 ([70.96.116.236]) by mx.google.com with ESMTPS id pv9sm3458022pbb.67.2012.10.03.18.47.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 03 Oct 2012 18:47:35 -0700 (PDT) Received: from tkisky by officeserver-2 with local (Exim 4.76) (envelope-from ) id 1TJaXc-0005Wg-Ue; Wed, 03 Oct 2012 18:47:56 -0700 From: Troy Kisky To: sbabic@denx.de Date: Wed, 3 Oct 2012 18:47:14 -0700 Message-Id: <1349315254-21151-13-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349315254-21151-1-git-send-email-troy.kisky@boundarydevices.com> References: <1348281558-19520-1-git-send-email-troy.kisky@boundarydevices.com> <1349315254-21151-1-git-send-email-troy.kisky@boundarydevices.com> X-Gm-Message-State: ALoCoQljjrAz9sZsAbKbmeYiIkWL6w8/BqvcgyphvHypM1foRSBmP6h1GcktGDkEtWzMiD1fdd5I Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH V3 12/32] imximage: move set_imx_hdr to struct data_src X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Troy Kisky --- v3: new patch --- tools/imximage.c | 13 ++++++------- tools/imximage.h | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/imximage.c b/tools/imximage.c index 85d3753..eb1ab62 100644 --- a/tools/imximage.c +++ b/tools/imximage.c @@ -67,7 +67,6 @@ static table_entry_t imximage_versions[] = { static set_dcd_val_t set_dcd_val; static set_dcd_rst_t set_dcd_rst; -static set_imx_hdr_t set_imx_hdr; static uint32_t max_dcd_entries; static uint32_t *header_size_ptr; static uint32_t g_flash_offset; @@ -253,19 +252,19 @@ static int set_imx_hdr_v2(struct data_src *ds, uint32_t dcd_len, return header_length; } -static void set_hdr_func(struct imx_header *imxhdr, uint32_t imximage_version) +static void set_hdr_func(struct data_src *ds, uint32_t imximage_version) { switch (imximage_version) { case IMXIMAGE_V1: set_dcd_val = set_dcd_val_v1; set_dcd_rst = set_dcd_rst_v1; - set_imx_hdr = set_imx_hdr_v1; + ds->set_imx_hdr = set_imx_hdr_v1; max_dcd_entries = MAX_HW_CFG_SIZE_V1; break; case IMXIMAGE_V2: set_dcd_val = set_dcd_val_v2; set_dcd_rst = set_dcd_rst_v2; - set_imx_hdr = set_imx_hdr_v2; + ds->set_imx_hdr = set_imx_hdr_v2; max_dcd_entries = MAX_HW_CFG_SIZE_V2; break; default: @@ -346,7 +345,7 @@ static void parse_cfg_cmd(struct data_src *ds, int32_t cmd, char *token, exit(EXIT_FAILURE); } cmd_ver_first = 1; - set_hdr_func(ds->imxhdr, imximage_version); + set_hdr_func(ds, imximage_version); break; case CMD_BOOT_FROM: g_flash_offset = get_table_entry_id(imximage_bootops, @@ -431,7 +430,7 @@ static int parse_cfg_file(struct imx_header *imxhdr, char *name, * by adding VERSION command into it, here need * set up function ptr group to V1 by default. */ - set_hdr_func(imxhdr, IMXIMAGE_V1); + set_hdr_func(&ds, IMXIMAGE_V1); fd = fopen(name, "r"); if (fd == 0) { fprintf(stderr, "Error: %s - Can't open DCD file\n", name); @@ -474,7 +473,7 @@ static int parse_cfg_file(struct imx_header *imxhdr, char *name, exit(EXIT_FAILURE); } /* Set the imx header */ - return (*set_imx_hdr)(&ds, dcd_len, entry_point, g_flash_offset); + return (*ds.set_imx_hdr)(&ds, dcd_len, entry_point, g_flash_offset); } static int imximage_check_image_types(uint8_t type) diff --git a/tools/imximage.h b/tools/imximage.h index 3054d55..f27a2ef 100644 --- a/tools/imximage.h +++ b/tools/imximage.h @@ -174,5 +174,6 @@ typedef int (*set_imx_hdr_t)(struct data_src *ds, uint32_t dcd_len, struct data_src { struct imx_header *imxhdr; + set_imx_hdr_t set_imx_hdr; }; #endif /* _IMXIMAGE_H_ */