From patchwork Fri Jun 8 20:48:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 927048 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gyoJ6LVu"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 412ZJ71b6nz9s1B for ; Sat, 9 Jun 2018 06:48:39 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5BD84C21C38; Fri, 8 Jun 2018 20:48:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C70B1C21C27; Fri, 8 Jun 2018 20:48:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 566DFC21C27; Fri, 8 Jun 2018 20:48:27 +0000 (UTC) Received: from mail-io0-f193.google.com (mail-io0-f193.google.com [209.85.223.193]) by lists.denx.de (Postfix) with ESMTPS id B9F56C21BE5 for ; Fri, 8 Jun 2018 20:48:26 +0000 (UTC) Received: by mail-io0-f193.google.com with SMTP id d185-v6so17383739ioe.0 for ; Fri, 08 Jun 2018 13:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=94DlqMh+X+535BkONCOUl89uPPeBjw+JKi+1lEIuf6A=; b=gyoJ6LVuUye/zxZcQSRi33mXLCUPpnTX/yMpk+DfIoh5VqtYyATyCog5sc8gUzrQ4b R6rdDUUtGiGASsnevCSpsktqLU/IDL+5TrdYhzAY8il3N9jl8cKbHCPhEnszD/eFmZch eklZDjseo78Mo/vmndQduElg++J/6e8OeACa3h0ohrCRkLuVIYzNbfTGvH1T76OV7BbV lKRrZG/+A/x4PFQ8fimu+n/6kUlPm+TWzBABbIpu22AjmkGC1K6a7XKNsZjhfXtLbItV ZxhNxdZ4K2tbD9BOcm2okV/djjJBwyCKhZkTPKgEuvYZRN7i48stw/9571EOoQ9XU9yG XKlQ== 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; bh=94DlqMh+X+535BkONCOUl89uPPeBjw+JKi+1lEIuf6A=; b=I7Hi76jShDF48xZH5K5aDQcO0d0k5jpT6e/TSqXujWFHwJx1GzJAbqj3C3jjTRHDab DbN1Sf5nU9XddaVTu+xeJHUFAKFhacvFj4p/oJzrU9zFjq1vQqTVYPAuO0eUIwAtRJHq zlhxX/VFxRb31lXhf7SI40PcCX5DWSwFd8+Vak5hAKD7TejQB+zCSs8IooNpbxiSuhaa tVkKUZ/lc1OutdhZUNk8rT+tSrbheyGVmrfY3PHsYJX06X1b+pSqdY0VvOiFfTafBrv5 RTVLLVQQUTYH9OxCtdqdMely+d9/H9REGfkkS19kAaxi1tvFFtVkT9gHb1i9FNolPUTo O8sw== X-Gm-Message-State: APt69E2pFZUC4WhBgTPjKH6txHG97yqEMqei8NUQOKtvRmjxMSMD7Wbd /sk7jhKNu8fobsr0d9qr/f86+w== X-Google-Smtp-Source: ADUXVKIjXpvcfIDHARQ+SgKHSIEIZucIJc0oHDR55UA3SALmnykTGW0X6RRGVhl7QLAnSB2pe6EkUQ== X-Received: by 2002:a6b:c309:: with SMTP id t9-v6mr6978761iof.157.1528490905039; Fri, 08 Jun 2018 13:48:25 -0700 (PDT) Received: from localhost.localdomain (c-73-65-120-235.hsd1.mn.comcast.net. [73.65.120.235]) by smtp.gmail.com with ESMTPSA id n190-v6sm1245180ith.27.2018.06.08.13.48.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jun 2018 13:48:24 -0700 (PDT) From: Adam Ford To: u-boot@lists.denx.de Date: Fri, 8 Jun 2018 15:48:16 -0500 Message-Id: <20180608204816.15226-1-aford173@gmail.com> X-Mailer: git-send-email 2.17.1 Cc: trini@konsulko.com Subject: [U-Boot] [PATCH] block: Add SPL_BLOCK_CACHE and default n X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When enabling BLOCK_CACHE on devices with limited RAM during SPL, some devices may not boot. This creates an option to enable block caching in SPL by defaults off. It is dependant on BLOCK_CACHE and SPL_BLK Fixes: 46960ad6d09b ("block: Have BLOCK_CACHE default to y in some cases") Signed-off-by: Adam Ford diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index 0792373cfc..8ef363b3d4 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig @@ -37,6 +37,13 @@ config BLOCK_CACHE it will prevent repeated reads from directory structures and other filesystem data structures. +config SPL_BLOCK_CACHE + bool "Use block device cache in SPL" + depends on BLOCK_CACHE && SPL_BLK + default n + help + This option enables the disk-block cache in SPL + config IDE bool "Support IDE controllers" select HAVE_BLOCK_DEVICE diff --git a/drivers/block/Makefile b/drivers/block/Makefile index 5fcafb193e..a9af28a552 100644 --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -11,4 +11,9 @@ endif obj-$(CONFIG_IDE) += ide.o obj-$(CONFIG_SANDBOX) += sandbox.o +ifdef CONFIG_SPL_BUILD +obj-$(SPL_BLOCK_CACHE) += blkcache.o +endif +ifndef CONFIG_SPL_BUILD obj-$(CONFIG_BLOCK_CACHE) += blkcache.o +endif diff --git a/include/blk.h b/include/blk.h index fc0c239e46..c17c5eb047 100644 --- a/include/blk.h +++ b/include/blk.h @@ -111,7 +111,8 @@ struct blk_desc { #define PAD_TO_BLOCKSIZE(size, blk_desc) \ (PAD_SIZE(size, blk_desc->blksz)) -#ifdef CONFIG_BLOCK_CACHE +#if (defined(CONFIG_BLOCK_CACHE) && !defined(CONFIG_SPL_BUILD)) || \ + (defined(CONFIG_SPL_BLOCK_CACHE) && defined(CONFIG_SPL_BUILD)) /** * blkcache_read() - attempt to read a set of blocks from cache *