From: "Pali Rohár" <pali@kernel.org>
To: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de
Subject: [PATCH 5/6] board: freescale: p1_p2_rdb_pc: Fix size of FLASH NOR mapping
Date: Sun, 1 May 2022 16:23:56 +0200 [thread overview]
Message-ID: <20220501142357.16778-6-pali@kernel.org> (raw)
In-Reply-To: <20220501142357.16778-1-pali@kernel.org>
FLASH NOR on P1020RDB-PD has size of 64 MB. On all other P1/P2 RDB boards
it has only size of 16 MB. So fix this size in TLB, LAW and LBC OR
registers.
Signed-off-by: Pali Rohár <pali@kernel.org>
---
board/freescale/p1_p2_rdb_pc/law.c | 4 ++++
board/freescale/p1_p2_rdb_pc/tlb.c | 6 ++++++
include/configs/p1_p2_rdb_pc.h | 7 +++++++
3 files changed, 17 insertions(+)
diff --git a/board/freescale/p1_p2_rdb_pc/law.c b/board/freescale/p1_p2_rdb_pc/law.c
index 901145ded3b0..80adf21a1183 100644
--- a/board/freescale/p1_p2_rdb_pc/law.c
+++ b/board/freescale/p1_p2_rdb_pc/law.c
@@ -13,7 +13,11 @@ struct law_entry law_table[] = {
#ifdef CONFIG_VSC7385_ENET
SET_LAW(CONFIG_SYS_VSC7385_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_LBC),
#endif
+#ifdef CONFIG_TARGET_P1020RDB_PD
SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_64M, LAW_TRGT_IF_LBC),
+#else
+ SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_16M, LAW_TRGT_IF_LBC),
+#endif
#ifdef CONFIG_SYS_NAND_BASE_PHYS
SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_32K, LAW_TRGT_IF_LBC),
#endif
diff --git a/board/freescale/p1_p2_rdb_pc/tlb.c b/board/freescale/p1_p2_rdb_pc/tlb.c
index ca47e15067a4..5bbeae302ad0 100644
--- a/board/freescale/p1_p2_rdb_pc/tlb.c
+++ b/board/freescale/p1_p2_rdb_pc/tlb.c
@@ -39,9 +39,15 @@ struct fsl_e_tlb_entry tlb_table[] = {
#ifndef CONFIG_SPL_BUILD
/* W**G* - Flash/promjet, localbus */
/* This will be changed to *I*G* after relocation to RAM. */
+#ifdef CONFIG_TARGET_P1020RDB_PD
SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
0, 2, BOOKE_PAGESZ_64M, 1),
+#else
+ SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
+ MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
+ 0, 2, BOOKE_PAGESZ_16M, 1),
+#endif
#ifdef CONFIG_PCI
/* *I*G* - PCI memory 1.5G */
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index 69fbb4ad8fe4..cf84f4045538 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -243,10 +243,17 @@
#define CONFIG_FLASH_BR_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) \
| BR_PS_16 | BR_V)
+#if defined(CONFIG_TARGET_P1020RDB_PD)
#define CONFIG_FLASH_OR_PRELIM (OR_AM_64MB | OR_GPCM_CSNT | \
OR_GPCM_ACS_DIV2 | OR_GPCM_XACS | \
OR_GPCM_SCY_15 | OR_GPCM_TRLX | \
OR_GPCM_EHTR | OR_GPCM_EAD)
+#else
+#define CONFIG_FLASH_OR_PRELIM (OR_AM_16MB | OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV2 | OR_GPCM_XACS | \
+ OR_GPCM_SCY_15 | OR_GPCM_TRLX | \
+ OR_GPCM_EHTR | OR_GPCM_EAD)
+#endif
#define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE_PHYS}
#define CONFIG_SYS_FLASH_QUIET_TEST
--
2.20.1
next prev parent reply other threads:[~2022-05-01 14:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-01 14:23 [PATCH 0/6] board: freescale: p1_p2_rdb_pc: Fix sizes of LBC peripherals Pali Rohár
2022-05-01 14:23 ` [PATCH 1/6] Revert "Convert CONFIG_SYS_BR0_PRELIM et al to Kconfig" Pali Rohár
2022-05-01 14:39 ` Tom Rini
2022-05-01 14:44 ` Pali Rohár
2022-05-01 15:14 ` Tom Rini
2022-05-01 15:33 ` Pali Rohár
2022-05-01 16:17 ` Tom Rini
2022-05-12 16:01 ` Tom Rini
2022-05-12 16:05 ` Pali Rohár
2022-05-01 14:23 ` [PATCH 2/6] Revert "p1_p2_rdb: Remove CONFIG_CPLD_[BO]R_PRELIM" Pali Rohár
2022-05-01 14:38 ` Tom Rini
2022-05-01 14:40 ` Pali Rohár
2022-05-01 14:23 ` [PATCH 3/6] mpc85xx: Replace magic values in BR/OR PRELIM config options by proper C macros Pali Rohár
2022-05-01 14:23 ` [PATCH 4/6] board: freescale: p1_p2_rdb_pc: Fix size of CPLD mapping Pali Rohár
2022-05-01 14:23 ` Pali Rohár [this message]
2022-05-01 14:23 ` [PATCH 6/6] board: freescale: p1_p2_rdb_pc: Fix size of NAND mapping Pali Rohár
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=20220501142357.16778-6-pali@kernel.org \
--to=pali@kernel.org \
--cc=trini@konsulko.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox