From patchwork Fri Sep 4 01:28:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1357135 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ADVWRZJN; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjKq90Rnbz9sV8 for ; Fri, 4 Sep 2020 11:29:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 833D5822D5; Fri, 4 Sep 2020 03:29:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ADVWRZJN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B3372822A7; Fri, 4 Sep 2020 03:29:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CC07882294 for ; Fri, 4 Sep 2020 03:29:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd41.google.com with SMTP id b6so5552268iof.6 for ; Thu, 03 Sep 2020 18:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aZ+KnqWULfJ7EBz54xGy9vDC6m6FlauN/ZDDIyzwi9I=; b=ADVWRZJNRjRsBn5dgU1j1Ji1ZZywF5EQG03s1XI8TLJHB6qNxW7Ht2VhZ/WCuKUvsS ZFA8+sHQSFvv3arlnVZq732ZzF5fKb8XMBQLfsjAKTlbRQatkcwJZiygCJkJG54PYkmT 54fIwVXOJAo3nOgrbqWp1ZXlxTzWUtY15sjJY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aZ+KnqWULfJ7EBz54xGy9vDC6m6FlauN/ZDDIyzwi9I=; b=dPv2blIFW23h+TjwPS1F9BrX9OxXxvGi3JTAlKmijrxPaBC6hyuIyXAmeRewQPrTBV idfK0pnetMobpsjETAoReuMRn/7pRqP+C/NPJonEwzRBw2PJIIUdX14cEF4W7Yd+GdEZ crLDu4mRInAVL5ETjHbWqKrOemslENtkgatGibRiHUHjVZHqzvNbYg6qZEFms80peJ4R rzdEwd86TspLsy7wJ7Euc+U3ToFuXsDNcmVAWDHC3IWV4G1QmKBMKpUnvCvhk3fHVA7E zLk1G9uqPRKc5jNa61PKh3NpZ0tJHI5EAe2A3N3AjYnBB/5m7YVOYYG8qaykThLJrnJR 28Zg== X-Gm-Message-State: AOAM532sUGFhl65yKNWeIacO/BNRQKMyjOasaFh8WxYEg9bvJ/wAjf+a MtXolMvMyAslDc9PmlMhSruuyKjIDjud0iNS X-Google-Smtp-Source: ABdhPJzOarpT6IcCNdyTnABbrqjjrBV75JQ8prKYSTsR6Iu3yMGFFX4e68F0zilROEr6tBYJzKDhMw== X-Received: by 2002:a05:6638:22d0:: with SMTP id j16mr5998322jat.97.1599182942321; Thu, 03 Sep 2020 18:29:02 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id k16sm2273740ilc.38.2020.09.03.18.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 18:29:02 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Simon Glass Subject: [PATCH 4/5] x86: edison: Generate an image suitable for xFSTK Date: Thu, 3 Sep 2020 19:28:55 -0600 Message-Id: <20200904012856.1175506-5-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200904012856.1175506-1-sjg@chromium.org> References: <20200904012856.1175506-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean It is useful to be able to flash Edison directly without relying on the installed U-Boot being functional. Add a binman image for this. It includes a master-boot record, U-Boot binary and an environment. Signed-off-by: Simon Glass Reviewed-by: Andy Shevchenko --- arch/x86/cpu/tangier/Kconfig | 1 + arch/x86/dts/edison.dts | 34 +++++++++++++++ board/intel/edison/edison-environment.txt | 48 ++++++++++++++++++++++ board/intel/edison/edison-mbr.dat | Bin 0 -> 512 bytes 4 files changed, 83 insertions(+) create mode 100644 board/intel/edison/edison-environment.txt create mode 100644 board/intel/edison/edison-mbr.dat GIT binary patch literal 512 zcmY%K4_0AdU}R!sv|zvqI6yK2j0^%mY{0<459IwH1p^uah`4$OWHN%d4;C{cM2TaC Gt^xr56@#Pz literal 0 HcmV?d00001 diff --git a/arch/x86/cpu/tangier/Kconfig b/arch/x86/cpu/tangier/Kconfig index d2b7edecd60..571470c74b2 100644 --- a/arch/x86/cpu/tangier/Kconfig +++ b/arch/x86/cpu/tangier/Kconfig @@ -12,6 +12,7 @@ config INTEL_TANGIER imply MMC_SDHCI_TANGIER imply USB imply USB_DWC3 + imply BINMAN if INTEL_TANGIER diff --git a/arch/x86/dts/edison.dts b/arch/x86/dts/edison.dts index df24aa0d26a..b5aac6b7349 100644 --- a/arch/x86/dts/edison.dts +++ b/arch/x86/dts/edison.dts @@ -22,6 +22,10 @@ serial2 = &serial2; }; + binman: binman { + multiple-images; + }; + chosen { stdout-path = &serial2; }; @@ -130,3 +134,33 @@ }; }; }; + +&binman { + u-boot-edison { + filename = "u-boot-edison.img"; + + /* This is Master-Boot Record */ + blob { + filename = "edison-mbr.dat"; + }; + + u-boot { + offset = <0x200>; + }; + + u-boot-env { + offset = <0x200200>; + filename = "edison-environment.txt"; + size = <0x10000>; + fill-byte = [ff]; + }; + + u-boot-env2 { + type = "u-boot-env"; + offset = <0x500200>; + filename = "edison-environment.txt"; + size = <0x10000>; + fill-byte = [ff]; + }; + }; +}; diff --git a/board/intel/edison/edison-environment.txt b/board/intel/edison/edison-environment.txt new file mode 100644 index 00000000000..afe00920461 --- /dev/null +++ b/board/intel/edison/edison-environment.txt @@ -0,0 +1,48 @@ +partitions=uuid_disk=${uuid_disk};name=u-boot0,start=1MiB,size=2MiB,uuid=${uuid_uboot0};name=u-boot-env0,size=1MiB,uuid=${uuid_uboot_env0};name=u-boot1,size=2MiB,uuid=${uuid_uboot1};name=u-boot-env1,size=1MiB,uuid=${uuid_uboot_env1};name=factory,size=1MiB,uuid=${uuid_factory};name=panic,size=24MiB,uuid=${uuid_panic};name=boot,size=32MiB,uuid=${uuid_boot};name=rootfs,size=1536MiB,uuid=${uuid_rootfs};name=update,size=768MiB,uuid=${uuid_update};name=home,size=-,uuid=${uuid_home}; +do_dfu_alt_info_mmc=setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2;u-boot0 part 0 1;u-boot-env0 part 0 2;u-boot1 part 0 3;u-boot-env1 part 0 4;boot part 0 7;rootfs part 0 8;update part 0 9;home part 0 10;vmlinuz fat 0 7;initrd fat 0 7" +dfu_alt_info_ram=kernel ram ${loadaddr} 0x800000 +do_dfu_alt_info_ifwi=setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2" +dfu_alt_info_reset=reset ram 0x0 0x0 +bootargs_console=console=ttyMFD2 earlyprintk=ttyMFD2,keep +bootargs_debug=loglevel=4 +do_bootargs_rootfs=setenv bootargs_rootfs rootwait root=PARTUUID=${uuid_rootfs} rootfstype=ext4 +first_install_retry=0 +first_install_max_retries=3 +ota_update_retry=0 +ota_update_max_retries=3 +audio_codec_name=audio_codec="dummy" +do_audio_support=setenv audio_support platform_mrfld_audio.${audio_codec_name} +do_compute_target=if itest.b ${first_install_retry} -gt ${first_install_max_retries} || itest.b ${ota_update_retry} -gt ${ota_update_max_retries}; then echo "Switch to Rescue target"; setenv bootargs_target rescue; saveenv; fi +mmc-bootargs=run do_bootargs_rootfs; run do_audio_support; setenv bootargs ${bootargs_rootfs} ${bootargs_console} ${bootargs_debug} g_multi.ethernet_config=${bootargs_ethconfig} systemd.unit=${bootargs_target}.target hardware_id=${hardware_id} g_multi.iSerialNumber=${serial#} g_multi.dev_addr=${usb0addr} ${audio_support} +loadaddr=0x100000 +load_kernel=fatload mmc 0:7 ${loadaddr} vmlinuz +do_partition_done=0 +do_partition=if itest.b ${do_partition_done} -eq 1; then echo "Partitioning already done..."; else run do_force_partition ; fi +do_force_partition=echo "Partitioning using GPT"; gpt write mmc 0 ${partitions} ; mmc rescan; setenv do_partition_done 1 ; saveenv +do_flash_ifwi=run do_dfu_alt_info_ifwi ; dfu 0 mmc 0 $dfu_to_sec +do_flash_os=if itest.b ${do_flash_os_done} -eq 1 ; then echo "Flashing already done..." ; else run do_force_flash_os; fi +do_force_flash_os=run do_dfu_alt_info_mmc ; sleep 1 ; setenv do_flash_os_done 1 ; saveenv ; dfu 0 mmc 0 $dfu_to_sec +do_flashall=run do_partition;run do_flash_ifwi;run do_flash_os +do_dnx=setenv dfu_alt_info ${dfu_alt_info_ram};dfu 0 ram 0 ram;run bootcmd +init_dfu=run do_dfu_alt_info_mmc ; saveenv +bootcmd=echo "Target:${target_name}"; run do_partition; run do_handle_bootargs_mode; +do_handle_bootargs_mode=run do_preprocess_bootargs_mode; if itest.s $bootargs_mode == "ota" ; then run do_ota; fi; if itest.s $bootargs_mode == "boot" ; then run do_boot; fi; if itest.s $bootargs_mode == "flash"; then run do_flash; fi; run do_fallback; exit; +do_preprocess_bootargs_mode=if env exists bootargs_mode ; then ; else setenv bootargs_mode "boot" ;fi; +do_fallback=echo "Unknown boot mode: $bootargs_mode"; env delete -f bootargs_mode; saveenv; echo "Resetting to default boot mode and reboot..."; reset; +do_boot=run boot_target_cmd; +do_flash=run do_force_flash_os; +ota_done=0 +ota_script_addr=0x100000 +do_ota_init=setenv ota_status 1 ; env delete -f bootargs_mode +do_load_ota_scr=if fatload mmc 0:9 $ota_script_addr ota_update.scr ; then setenv ota_status 0 ; else setenv ota_status 1 ; fi +do_source_ota_scr=if test $ota_status -eq 0 ; then if source $ota_script_addr ; then setenv ota_status 0 ; else setenv ota_status 2 ; fi ; fi +do_ota_clean=saveenv ; reset +do_ota=run do_ota_init ; run do_load_ota_scr ; run do_source_ota_scr ; run do_ota_clean +target_name=blank +bootdelay=1 +do_flash_os_done=1 +bootargs_target=multi-user +bootargs_ethconfig=cdc +dfu_to_sec=3 +do_probe_dfu=run do_dfu_alt_info_mmc ; dfu 0 mmc 0 $dfu_to_sec +boot_target_cmd=run do_flash_os;run do_probe_dfu;run do_compute_target;run mmc-bootargs;run load_kernel;zboot ${loadaddr} diff --git a/board/intel/edison/edison-mbr.dat b/board/intel/edison/edison-mbr.dat new file mode 100644 index 0000000000000000000000000000000000000000..c984e99f247c54253f1d950ece602d44c10cb6eb