Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7490EC43334 for ; Wed, 8 Jun 2022 12:25:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 826D08437A; Wed, 8 Jun 2022 14:24:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com 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=konsulko.com header.i=@konsulko.com header.b="SrFhpgaT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 951828431B; Wed, 8 Jun 2022 14:24:47 +0200 (CEST) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (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 7761A8431E for ; Wed, 8 Jun 2022 14:24:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x735.google.com with SMTP id n197so8270743qke.1 for ; Wed, 08 Jun 2022 05:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=EyW98MNw80Ssz+9BtB+l8I+f/5Bha1C+FHAFQHy5w24=; b=SrFhpgaTIgJdJahKYKc/jPpm56qAjPCUYpdUfCxTCcSGKwLtGWPfq5nf+0P2Y1BxEE hOv62aH1DuQ00s8j1txVm1z+YXU7yL8hNbWBHQhkS2LjzSBi1Ef6H77WB94NHf/mMpUw qLEnLwtSmKSmdfKepM4PcO1qwZN9kB1Y+B9n0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EyW98MNw80Ssz+9BtB+l8I+f/5Bha1C+FHAFQHy5w24=; b=rsujJ0jz06bm/cw0va8S+0pcJIUuHK0POYm51gKYXk4k/YYbWckY1Z3hjw6HfC7odL b1aQs370mFkrkNixGc84csFwC2knAw8CtYzFroY3eGOz8TyCoUwVezJV3m7oYbCs8FO+ NdvNcUMqSchogAraBk1NdCjo0O4S9Ya3zV9RVwe8jcAjwpyF2ljiF/SK50KDjuYnt1tx 3oCwFx7sO4LGJJz1MTkrERSDj6o+jMqg/S6Po/XE4ODdFRMhL+bg8CFM4DwxsuH7mr5p ETNQRVut4MUR8s5HNxY8hSEnDasnAPnhf6D26H0DJZbe8U1b9hN33uG0jRPsePuFNIkh V2QQ== X-Gm-Message-State: AOAM531wFQfm4ALD0OirO2PshvnUQ4TXRSr/YaXrUwCKw1UXSszeH5kd Y5/LyeykTRGmsfO8kgalfA5GOsCAjppWug== X-Google-Smtp-Source: ABdhPJyjwuHTYsB6lpEAciDDdHyfRgx+QHxLfdThcNk5UCKJ+LVeD401TJ6Ss3pfNtJwlTB1fyFOdw== X-Received: by 2002:a05:620a:458d:b0:6a7:61b:ab6a with SMTP id bp13-20020a05620a458d00b006a7061bab6amr1387392qkb.590.1654691082709; Wed, 08 Jun 2022 05:24:42 -0700 (PDT) Received: from bill-the-cat.lan (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id r14-20020ac87eee000000b00304ee3372dfsm5242572qtc.45.2022.06.08.05.24.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 05:24:42 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 02/18] Convert CONFIG_EFLASH_PROTSECTORS to Kconfig Date: Wed, 8 Jun 2022 08:24:24 -0400 Message-Id: <20220608122440.4114272-2-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220608122440.4114272-1-trini@konsulko.com> References: <20220608122440.4114272-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.5 at phobos.denx.de X-Virus-Status: Clean This converts the following to Kconfig: CONFIG_EFLASH_PROTSECTORS Signed-off-by: Tom Rini --- arch/arm/mach-at91/Kconfig | 7 +++++++ arch/arm/mach-at91/arm926ejs/eflash.c | 4 ++-- configs/ethernut5_defconfig | 1 + include/configs/ethernut5.h | 1 - 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index b87639f8c07b..4fee9772bf1c 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -327,6 +327,13 @@ config AT91_EFLASH Enable the driver for the embedded flash used in the Atmel AT91SAM9XE devices. +config EFLASH_PROTSECTORS + int "Number of flash sectors to protect from erasing" + depends on AT91_EFLASH + help + If non-zero, this will be the number of sectors of the flash to disallow + U-Boot to ease, starting from the beginning of flash. + config AT91_GPIO_PULLUP bool "Keep pullups on peripheral pins" depends on CPU_ARM926EJS diff --git a/arch/arm/mach-at91/arm926ejs/eflash.c b/arch/arm/mach-at91/arm926ejs/eflash.c index 23c24936edf0..043f06a82717 100644 --- a/arch/arm/mach-at91/arm926ejs/eflash.c +++ b/arch/arm/mach-at91/arm926ejs/eflash.c @@ -120,7 +120,7 @@ unsigned long flash_init(void) if (i%32 == 0) tmp = readl(&eefc->frr); flash_info[0].protect[i] = (tmp >> (i%32)) & 1; -#if defined(CONFIG_EFLASH_PROTSECTORS) +#if CONFIG_VAL(EFLASH_PROTSECTORS) if (i < CONFIG_EFLASH_PROTSECTORS) flash_info[0].protect[i] = 1; #endif @@ -158,7 +158,7 @@ int flash_real_protect (flash_info_t *info, long sector, int prot) debug("protect sector=%ld prot=%d\n", sector, prot); -#if defined(CONFIG_EFLASH_PROTSECTORS) +#if CONFIG_VAL(EFLASH_PROTSECTORS) if (sector < CONFIG_EFLASH_PROTSECTORS) { if (!prot) { printf("eflash: sector %lu cannot be unprotected\n", diff --git a/configs/ethernut5_defconfig b/configs/ethernut5_defconfig index da8c0bd9cbe9..256f6520a598 100644 --- a/configs/ethernut5_defconfig +++ b/configs/ethernut5_defconfig @@ -6,6 +6,7 @@ CONFIG_SYS_TEXT_BASE=0x27000000 CONFIG_SYS_MALLOC_LEN=0x121000 CONFIG_TARGET_ETHERNUT5=y CONFIG_AT91_EFLASH=y +CONFIG_EFLASH_PROTSECTORS=1 CONFIG_NR_DRAM_BANKS=1 CONFIG_ENV_SIZE=0x21000 CONFIG_ENV_OFFSET=0x3DE000 diff --git a/include/configs/ethernut5.h b/include/configs/ethernut5.h index 8e7bfadf64ed..8f9cfd50bc1e 100644 --- a/include/configs/ethernut5.h +++ b/include/configs/ethernut5.h @@ -32,7 +32,6 @@ /* 512kB on-chip NOR flash */ # define CONFIG_SYS_FLASH_BASE 0x00200000 /* AT91SAM9XE_FLASH_BASE */ # define CONFIG_SYS_MAX_FLASH_SECT 32 -# define CONFIG_EFLASH_PROTSECTORS 1 /* bootstrap + u-boot + env + linux in dataflash on CS0 */ -- 2.25.1