From: Derald D. Woods <woods.technical@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] nand: atmel: Replace SYS_NAND_ECC_BASE with ATMEL_BASE_ECC
Date: Sat, 19 Jan 2019 14:02:30 -0600 [thread overview]
Message-ID: <20190119200231.4504-2-woods.technical@gmail.com> (raw)
In-Reply-To: <20190119200231.4504-1-woods.technical@gmail.com>
This commit removes remaining uses of SYS_NAND_ECC_BASE. Including
"<asm/arch/hardware.h>" in "drivers/mtd/nand/raw/atmel_nand.c" provides
access to ATMEL_BASE_ECC.
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
---
drivers/mtd/nand/raw/atmel_nand.c | 19 ++++++++++---------
include/configs/snapper9g45.h | 1 -
scripts/config_whitelist.txt | 1 -
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/drivers/mtd/nand/raw/atmel_nand.c b/drivers/mtd/nand/raw/atmel_nand.c
index 31ad2cfa88..0563472b9d 100644
--- a/drivers/mtd/nand/raw/atmel_nand.c
+++ b/drivers/mtd/nand/raw/atmel_nand.c
@@ -13,6 +13,7 @@
#include <common.h>
#include <asm/gpio.h>
#include <asm/arch/gpio.h>
+#include <asm/arch/hardware.h>
#include <malloc.h>
#include <nand.h>
@@ -995,13 +996,13 @@ static int atmel_nand_calculate(struct mtd_info *mtd,
unsigned int ecc_value;
/* get the first 2 ECC bytes */
- ecc_value = ecc_readl(CONFIG_SYS_NAND_ECC_BASE, PR);
+ ecc_value = ecc_readl(ATMEL_BASE_ECC, PR);
ecc_code[0] = ecc_value & 0xFF;
ecc_code[1] = (ecc_value >> 8) & 0xFF;
/* get the last 2 ECC bytes */
- ecc_value = ecc_readl(CONFIG_SYS_NAND_ECC_BASE, NPR) & ATMEL_ECC_NPARITY;
+ ecc_value = ecc_readl(ATMEL_BASE_ECC, NPR) & ATMEL_ECC_NPARITY;
ecc_code[2] = ecc_value & 0xFF;
ecc_code[3] = (ecc_value >> 8) & 0xFF;
@@ -1084,16 +1085,16 @@ static int atmel_nand_correct(struct mtd_info *mtd, u_char *dat,
unsigned int ecc_word, ecc_bit;
/* get the status from the Status Register */
- ecc_status = ecc_readl(CONFIG_SYS_NAND_ECC_BASE, SR);
+ ecc_status = ecc_readl(ATMEL_BASE_ECC, SR);
/* if there's no error */
if (likely(!(ecc_status & ATMEL_ECC_RECERR)))
return 0;
/* get error bit offset (4 bits) */
- ecc_bit = ecc_readl(CONFIG_SYS_NAND_ECC_BASE, PR) & ATMEL_ECC_BITADDR;
+ ecc_bit = ecc_readl(ATMEL_BASE_ECC, PR) & ATMEL_ECC_BITADDR;
/* get word address (12 bits) */
- ecc_word = ecc_readl(CONFIG_SYS_NAND_ECC_BASE, PR) & ATMEL_ECC_WORDADDR;
+ ecc_word = ecc_readl(ATMEL_BASE_ECC, PR) & ATMEL_ECC_WORDADDR;
ecc_word >>= 4;
/* if there are multiple errors */
@@ -1164,22 +1165,22 @@ int atmel_hwecc_nand_init_param(struct nand_chip *nand, struct mtd_info *mtd)
switch (mtd->writesize) {
case 512:
nand->ecc.layout = &atmel_oobinfo_small;
- ecc_writel(CONFIG_SYS_NAND_ECC_BASE, MR,
+ ecc_writel(ATMEL_BASE_ECC, MR,
ATMEL_ECC_PAGESIZE_528);
break;
case 1024:
nand->ecc.layout = &atmel_oobinfo_large;
- ecc_writel(CONFIG_SYS_NAND_ECC_BASE, MR,
+ ecc_writel(ATMEL_BASE_ECC, MR,
ATMEL_ECC_PAGESIZE_1056);
break;
case 2048:
nand->ecc.layout = &atmel_oobinfo_large;
- ecc_writel(CONFIG_SYS_NAND_ECC_BASE, MR,
+ ecc_writel(ATMEL_BASE_ECC, MR,
ATMEL_ECC_PAGESIZE_2112);
break;
case 4096:
nand->ecc.layout = &atmel_oobinfo_large;
- ecc_writel(CONFIG_SYS_NAND_ECC_BASE, MR,
+ ecc_writel(ATMEL_BASE_ECC, MR,
ATMEL_ECC_PAGESIZE_4224);
break;
default:
diff --git a/include/configs/snapper9g45.h b/include/configs/snapper9g45.h
index f2c47dabc5..4b384641d1 100644
--- a/include/configs/snapper9g45.h
+++ b/include/configs/snapper9g45.h
@@ -36,7 +36,6 @@
/* NAND Flash */
#define CONFIG_ATMEL_NAND_HWECC
-#define CONFIG_SYS_NAND_ECC_BASE ATMEL_BASE_ECC
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3
#define CONFIG_SYS_NAND_DBW_8
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index e2c2889acf..6fee575a43 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -3543,7 +3543,6 @@ CONFIG_SYS_NAND_ECCPOS
CONFIG_SYS_NAND_ECCSIZE
CONFIG_SYS_NAND_ECCSTEPS
CONFIG_SYS_NAND_ECCTOTAL
-CONFIG_SYS_NAND_ECC_BASE
CONFIG_SYS_NAND_ENABLE_PIN
CONFIG_SYS_NAND_ENABLE_PIN_SPL
CONFIG_SYS_NAND_FTIM0
--
2.20.1
next prev parent reply other threads:[~2019-01-19 20:02 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 0:15 [U-Boot] boot.bin on SD Card for SAMA5D3 Xplained Daniel Evans
2018-12-05 14:36 ` Eugen.Hristev at microchip.com
2018-12-05 18:08 ` Daniel Evans
2018-12-05 20:38 ` Robert Nelson
2018-12-06 8:02 ` Eugen.Hristev at microchip.com
2018-12-08 2:37 ` Derald D. Woods
2018-12-08 19:49 ` [U-Boot] [PATCH] ARM: at91: Fix 'boot.bin' generation when CONFIG_SD_BOOT is enabled Derald D. Woods
2018-12-10 8:32 ` Eugen.Hristev at microchip.com
2018-12-10 13:01 ` Derald D. Woods
2018-12-10 14:03 ` Eugen.Hristev at microchip.com
2018-12-10 14:54 ` Derald Woods
2018-12-10 15:14 ` Eugen.Hristev at microchip.com
2018-12-11 5:48 ` Derald D. Woods
2018-12-15 7:36 ` [U-Boot] [PATCH] ARM: at91: Convert SPL_GENERATE_ATMEL_PMECC_HEADER to Kconfig Derald D. Woods
2018-12-28 0:04 ` Derald Woods
2019-01-07 9:40 ` Eugen.Hristev at microchip.com
2019-01-10 1:00 ` Derald Woods
2019-01-11 11:27 ` Eugen.Hristev at microchip.com
2019-01-11 16:51 ` Derald Woods
2019-01-11 16:53 ` Derald Woods
2019-01-18 8:37 ` Eugen.Hristev at microchip.com
2019-01-19 3:26 ` Derald D. Woods
2019-01-19 20:02 ` [U-Boot] [PATCH 0/2] ARM: at91: NAND PMECC Kconfig conversion Derald D. Woods
2019-01-19 20:02 ` Derald D. Woods [this message]
2019-01-19 20:02 ` [U-Boot] [PATCH 2/2] ARM: at91: Convert SPL_GENERATE_ATMEL_PMECC_HEADER to Kconfig Derald D. Woods
2019-01-19 23:29 ` [U-Boot] [PATCH 0/2] ARM: at91: NAND PMECC Kconfig conversion Tom Rini
2019-01-20 0:50 ` Derald Woods
2019-01-20 3:37 ` [U-Boot] [PATCH v2 0/1] " Derald D. Woods
2019-01-20 3:37 ` [U-Boot] [PATCH v3 1/1] ARM: at91: Convert SPL_GENERATE_ATMEL_PMECC_HEADER to Kconfig Derald D. Woods
2019-01-20 12:57 ` Tom Rini
2019-01-20 14:25 ` Derald Woods
2019-01-21 16:58 ` [U-Boot] " Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190119200231.4504-2-woods.technical@gmail.com \
--to=woods.technical@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.