From patchwork Tue Jan 24 17:06:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 1731298 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=FTJp/hWc; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=bnoZbeB3; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P1YR66pDxz23h0 for ; Wed, 25 Jan 2023 04:11:30 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 873B8856E7; Tue, 24 Jan 2023 18:09:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1674580199; bh=mapitH2COeMSY3HJ6yBIyl+OFoXcBkey7tEJdMHcggc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FTJp/hWcAOT9UzPHi4FKy7SI/9t/jOqOqYxmx+KIwqZPF0XZVAZYgS4hk+LvxmTBi kF8mtiPPZDyl2Y65PoZuu2TzDJlQWvsON8YE9+zrWoSyCp0swCkgL1tAKj4G6azcmp Deos0JBMWtObZBnDgaal3FnUO49Kql2VElofX8GgpjeNiiwSN/YNVcge474QvuiQy7 BPYrPR4raxkf0QNfR3IWq8InOETOf1+hDtIKZEa8Vf6z0vNydVGo+pA4b5VaiG111X otcJX+LeT4VIwhP9Bryy01RIiZ0n1nAx4qpW0z5KIMFqcAGcOFPMMAGh4kMWmQxywn EIwNO7zO+xRwQ== Received: from mail-internal.denx.de (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: noc@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 8F284856FE; Tue, 24 Jan 2023 18:09:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1674580192; bh=mapitH2COeMSY3HJ6yBIyl+OFoXcBkey7tEJdMHcggc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bnoZbeB3Jgi84x7E8F5BzYqrPN65ZiVJsNnH7CjeMDtgM7/jWzeRXH6AZjDTW3rbT HQuNQ2ucIybMSR1jdi7d5lK/3JfM7jwzUmYXt5dSmhBZ1UHXcYoajBDHJBGuzvdokb MgaOfqUfSeRlTMOWHzP/qTFhWFYS9K1bICRmdhHYTnKQAZe/fznXLJB2yUNJcLEhIH yfWCmsyT7+9QNEdzTy+Yc/Qz6YlN/GuCaCol7jVAtvl6ozf7NdkwVB7ey0ELfBJL4t PlrjfSu79mZjs5q+QeYcuWwd+0WdcNHQKtn6XI7QvcCnr8eshqGMxiT595TPR61A9u miAHMnBEAnY7Q== Received: from pollux.denx.de (pollux [192.168.1.1]) by mail-internal.denx.de (Postfix) with ESMTPS id 789DA180398; Tue, 24 Jan 2023 18:07:15 +0100 (CET) Received: by pollux.denx.de (Postfix, from userid 515) id 719C31A009F; Tue, 24 Jan 2023 18:07:15 +0100 (CET) From: Heiko Schocher To: U-Boot Mailing List Cc: pali@kernel.org, Heiko Schocher Subject: [PATCH v1 11/12] powerpc/mpc85xx: socrates: enable protected Environment Date: Tue, 24 Jan 2023 18:06:59 +0100 Message-Id: <20230124170700.3889830-12-hs@denx.de> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230124170700.3889830-1-hs@denx.de> References: <20230124170700.3889830-1-hs@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean enable protected Environment on socrates board. Signed-off-by: Heiko Schocher --- board/socrates/socrates.c | 17 +++++++++++++++++ configs/socrates_defconfig | 4 ++++ include/configs/socrates.h | 2 ++ 3 files changed, 23 insertions(+) diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c index 1d63c81a9c..02e6afb099 100644 --- a/board/socrates/socrates.c +++ b/board/socrates/socrates.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -221,3 +222,19 @@ int get_serial_clock(void) { return 333333330; } + +enum env_location env_get_location(enum env_operation op, int prio) +{ + if (op == ENVOP_SAVE || op == ENVOP_ERASE) + return ENVL_FLASH; + + switch (prio) { + case 0: + return ENVL_NOWHERE; + case 1: + return ENVL_FLASH; + default: + return ENVL_UNKNOWN; + } + return ENVL_UNKNOWN; +} diff --git a/configs/socrates_defconfig b/configs/socrates_defconfig index 8640dc990a..d4c08f1941 100644 --- a/configs/socrates_defconfig +++ b/configs/socrates_defconfig @@ -68,9 +68,13 @@ CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" CONFIG_MTDPARTS_DEFAULT="mtdparts=fe000000.nor_flash:13312k(system1),13312k(system2),5120k(data),128k(env),128k(env-red),768k(u-boot);socrates_nand:256M(ubi-data1),-(ubi-data2)" # CONFIG_CMD_IRQ is not set CONFIG_OF_CONTROL=y +CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_ENV_ADDR_REDUND=0xFFF00000 +CONFIG_ENV_APPEND=y +CONFIG_ENV_WRITEABLE_LIST=y +CONFIG_ENV_ACCESS_IGNORE_FORCE=y CONFIG_USE_ETHPRIME=y CONFIG_ETHPRIME="eTSEC0" CONFIG_SPD_EEPROM=y diff --git a/include/configs/socrates.h b/include/configs/socrates.h index e2afba96cd..305914de85 100644 --- a/include/configs/socrates.h +++ b/include/configs/socrates.h @@ -171,6 +171,8 @@ SOCRATES_ENV_MTD \ "" +#define CFG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,eth1addr:mw,system1_addr:xw,serial#:sw,ethact:sw,ethprime:sw" + /* pass open firmware flat tree */ #endif /* __CONFIG_H */