From patchwork Wed Sep 5 09:26:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 181811 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 CE0D32C0CD5 for ; Wed, 5 Sep 2012 19:26:47 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7685D281A2; Wed, 5 Sep 2012 11:26:45 +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 cBCqXqjDSd9v; Wed, 5 Sep 2012 11:26:45 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1FD4528199; Wed, 5 Sep 2012 11:26:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 833DE28190 for ; Wed, 5 Sep 2012 11:26:38 +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 IiMZCQ0tyvAS for ; Wed, 5 Sep 2012 11:26:37 +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-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by theia.denx.de (Postfix) with ESMTPS id B3C0928199 for ; Wed, 5 Sep 2012 11:26:34 +0200 (CEST) Received: by dadf8 with SMTP id f8so230223dad.3 for ; Wed, 05 Sep 2012 02:26:33 -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:x-gm-message-state; bh=suUSs/iyQoW0a4igw83yrPyA6Rqrw7EmatA3yOpiZsc=; b=Dc3Gbxv6fTlM4BNle/kH8SRG7gExu0jyJsfNoUR36Aun0bATNQtd0RL2zS8HX0xIWF fYTqatj0/q12WSTwbrHB9+wX3/k+a8M2P+1FjNsprcN/ihvfnWDlEzQFKDEkPdOr3fH7 6d4mbXwcx9Owu1C9TMORQeZoL8WTLlKixCx59+/tvNSyxCOSOi1tUrkhlIEfHBCGEcZY Lsxo+o2B5VuE4y4F6VbnlS7NP6pzKtVFQZmWKCElLL8tlPWdT9lQ1S/Oc9dSSCicAWzE 2C/yMjiWCZNhnVT8FqLfCoNODjMdRvLko5TKsvXolWBGMl6Z6ArMqq0beLYTH/uZXmJz VuCw== Received: by 10.68.134.99 with SMTP id pj3mr30026144pbb.13.1346837193179; Wed, 05 Sep 2012 02:26:33 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id rm9sm1016035pbc.72.2012.09.05.02.26.30 (version=SSLv3 cipher=OTHER); Wed, 05 Sep 2012 02:26:32 -0700 (PDT) From: Chander Kashyap To: u-boot@lists.denx.de Date: Wed, 5 Sep 2012 14:56:17 +0530 Message-Id: <1346837177-17547-1-git-send-email-chander.kashyap@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQlAi7n/SZ0xGtg2E8BjxRHFXqDLy1zCAGnXLs9dCMzaiyGauIblVeS/DFDzBhbosuhgWjKJ Cc: patches@linaro.org Subject: [U-Boot] [PATCH v2] PXE: FDT: Add support for fdt in PXE 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 Now DT support is becomming common for all new SoC's. Hence it is better to have option for getting specific FDT from the remote server. This patch adds support for new lable i.e. fdt. If fdt_addr is specified then load fdt blob from the remote server to fdt_address. Signed-off-by: Chander Kashyap --- Changes in v2: Removed the duplicate code. common/cmd_pxe.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 6b31dea..0c81e08 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -450,6 +450,7 @@ struct pxe_label { char *kernel; char *append; char *initrd; + char *fdt; int attempted; int localboot; struct list_head list; @@ -517,6 +518,9 @@ static void label_destroy(struct pxe_label *label) if (label->initrd) free(label->initrd); + if (label->fdt) + free(label->fdt); + free(label); } @@ -541,6 +545,9 @@ static void label_print(void *data) if (label->initrd) printf("\t\tinitrd: %s\n", label->initrd); + + if (label->fdt) + printf("\tfdt: %s\n", label->fdt); } /* @@ -633,6 +640,15 @@ static void label_boot(struct pxe_label *label) */ bootm_argv[3] = getenv("fdt_addr"); + /* if fdt label is defined then get fdt from server */ + if (bootm_argv[3] && label->fdt) { + if (get_relfile_envaddr(label->fdt, "fdt_addr") < 0) { + printf("Skipping %s for failure retrieving fdt\n", + label->name); + return; + } + } + if (bootm_argv[3]) bootm_argc = 4; @@ -658,6 +674,7 @@ enum token_type { T_DEFAULT, T_PROMPT, T_INCLUDE, + T_FDT, T_INVALID }; @@ -685,6 +702,7 @@ static const struct token keywords[] = { {"append", T_APPEND}, {"initrd", T_INITRD}, {"include", T_INCLUDE}, + {"fdt", T_FDT}, {NULL, T_INVALID} }; @@ -1074,6 +1092,11 @@ static int parse_label(char **c, struct pxe_menu *cfg) err = parse_sliteral(c, &label->initrd); break; + case T_FDT: + if (!label->fdt) + err = parse_sliteral(c, &label->fdt); + break; + case T_LOCALBOOT: err = parse_integer(c, &label->localboot); break;