From: Bob Liu <lliubbo@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 03/16] Blackfin: Bf60x: support big cplb page
Date: Tue, 7 Aug 2012 16:07:42 +0800 [thread overview]
Message-ID: <1344326875-348-3-git-send-email-lliubbo@gmail.com> (raw)
In-Reply-To: <1344326875-348-1-git-send-email-lliubbo@gmail.com>
Bf60x support 16K, 64K, 16M and 64M cplb pages, this patch add support for them.
So that bf609-ezkit can use it's 128M memory.
Signed-off-by: Bob Liu <lliubbo@gmail.com>
---
arch/blackfin/include/asm/cplb.h | 13 +++++++++-
arch/blackfin/include/asm/mach-common/bits/mpu.h | 6 ++++-
arch/blackfin/lib/board.c | 28 ++++++++++++++++------
include/configs/bf609-ezkit.h | 6 +----
4 files changed, 39 insertions(+), 14 deletions(-)
diff --git a/arch/blackfin/include/asm/cplb.h b/arch/blackfin/include/asm/cplb.h
index cc21e93..5a0588b 100644
--- a/arch/blackfin/include/asm/cplb.h
+++ b/arch/blackfin/include/asm/cplb.h
@@ -46,8 +46,11 @@
#define CPLB_IDOCACHE CPLB_INOCACHE | CPLB_L1_CHBL
/* Data Attibutes*/
-
+#if defined(__ADSPBF60x__)
+#define SDRAM_IGENERIC (PAGE_SIZE_16MB | CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID)
+#else
#define SDRAM_IGENERIC (PAGE_SIZE_4MB | CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID)
+#endif
#define SDRAM_IKERNEL (PAGE_SIZE_4MB | CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID | CPLB_LOCK)
#define L1_IMEMORY (PAGE_SIZE_1MB | CPLB_USER_RD | CPLB_VALID | CPLB_LOCK)
#define SDRAM_INON_CHBL (PAGE_SIZE_4MB | CPLB_USER_RD | CPLB_VALID)
@@ -59,14 +62,22 @@
#endif
#ifdef CONFIG_DCACHE_WB /*Write Back Policy */
+#if defined(__ADSPBF60x__)
+#define SDRAM_DGENERIC (PAGE_SIZE_16MB | CPLB_L1_CHBL | CPLB_DIRTY | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
+#else
#define SDRAM_DGENERIC (PAGE_SIZE_4MB | CPLB_L1_CHBL | CPLB_DIRTY | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
+#endif
#define SDRAM_DNON_CHBL (PAGE_SIZE_4MB | CPLB_DIRTY | CPLB_SUPV_WR | CPLB_USER_RD | CPLB_USER_WR | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
#define SDRAM_DKERNEL (PAGE_SIZE_4MB | CPLB_L1_CHBL | CPLB_USER_RD | CPLB_USER_WR | CPLB_DIRTY | CPLB_SUPV_WR | CPLB_VALID | CPLB_LOCK | ANOMALY_05000158_WORKAROUND)
#define L1_DMEMORY (PAGE_SIZE_4MB | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
#define SDRAM_EBIU (PAGE_SIZE_4MB | CPLB_DIRTY | CPLB_USER_RD | CPLB_USER_WR | CPLB_SUPV_WR | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
#else /*Write Through */
+#if defined(__ADSPBF60x__)
+#define SDRAM_DGENERIC (PAGE_SIZE_16MB | CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_SUPV_WR | CPLB_USER_RD | CPLB_USER_WR | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
+#else
#define SDRAM_DGENERIC (PAGE_SIZE_4MB | CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_SUPV_WR | CPLB_USER_RD | CPLB_USER_WR | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
+#endif
#define SDRAM_DNON_CHBL (PAGE_SIZE_4MB | CPLB_WT | CPLB_L1_AOW | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
#define SDRAM_DKERNEL (PAGE_SIZE_4MB | CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_USER_RD | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_VALID | CPLB_LOCK | ANOMALY_05000158_WORKAROUND)
#define L1_DMEMORY (PAGE_SIZE_4MB | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
diff --git a/arch/blackfin/include/asm/mach-common/bits/mpu.h b/arch/blackfin/include/asm/mach-common/bits/mpu.h
index 39998f8..d067ef9 100644
--- a/arch/blackfin/include/asm/mach-common/bits/mpu.h
+++ b/arch/blackfin/include/asm/mach-common/bits/mpu.h
@@ -70,7 +70,11 @@
#define PAGE_SIZE_4KB 0x00010000 /* 4 KB page size */
#define PAGE_SIZE_1MB 0x00020000 /* 1 MB page size */
#define PAGE_SIZE_4MB 0x00030000 /* 4 MB page size */
-#define PAGE_SIZE_MASK 0x00030000 /* the bits for the page_size field */
+#define PAGE_SIZE_16KB 0x00040000 /* 16 KB page size */
+#define PAGE_SIZE_64KB 0x00050000 /* 64 KB page size */
+#define PAGE_SIZE_16MB 0x00060000 /* 16 MB page size */
+#define PAGE_SIZE_64MB 0x00070000 /* 64 MB page size */
+#define PAGE_SIZE_MASK 0x00070000 /* the bits for the page_size field */
#define PAGE_SIZE_SHIFT 16
#define CPLB_L1SRAM 0x00000020 /* 0=SRAM mapped in L1, 0=SRAM not mapped to L1 */
#define CPLB_PORTPRIO 0x00000200 /* 0=low priority port, 1= high priority port */
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index cfb38e8..4e44bf0 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -94,12 +94,12 @@ static void display_global_data(void)
printf(" \\-bi_flashoffset: %lx\n", bd->bi_flashoffset);
}
-#define CPLB_PAGE_SIZE (4 * 1024 * 1024)
-#define CPLB_PAGE_MASK (~(CPLB_PAGE_SIZE - 1))
void init_cplbtables(void)
{
volatile uint32_t *ICPLB_ADDR, *ICPLB_DATA;
volatile uint32_t *DCPLB_ADDR, *DCPLB_DATA;
+ uint32_t cplb_page_size;
+ uint32_t cplb_page_mask;
uint32_t extern_memory;
size_t i;
@@ -127,12 +127,20 @@ void init_cplbtables(void)
icplb_add(0xFFA00000, L1_IMEMORY);
dcplb_add(0xFF800000, L1_DMEMORY);
++i;
+#if defined(__ADSPBF60x__)
+ icplb_add(0x0, 0x0);
+ dcplb_add(CONFIG_SYS_FLASH_BASE, PAGE_SIZE_16MB | CPLB_DIRTY | CPLB_SUPV_WR |
+ CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID);
+ ++i;
+#endif
+ cplb_page_size = (4 * 1024 * 1024);
+ cplb_page_mask = (~(cplb_page_size - 1));
if (CONFIG_MEM_SIZE) {
uint32_t mbase = CONFIG_SYS_MONITOR_BASE;
uint32_t mend = mbase + CONFIG_SYS_MONITOR_LEN;
- mbase &= CPLB_PAGE_MASK;
- mend &= CPLB_PAGE_MASK;
+ mbase &= cplb_page_mask;
+ mend &= cplb_page_mask;
icplb_add(mbase, SDRAM_IKERNEL);
dcplb_add(mbase, SDRAM_DKERNEL);
@@ -150,9 +158,11 @@ void init_cplbtables(void)
}
}
+#ifndef __ADSPBF60x__
icplb_add(0x20000000, SDRAM_INON_CHBL);
dcplb_add(0x20000000, SDRAM_EBIU);
++i;
+#endif
/* Add entries for the rest of external RAM up to the bootrom */
extern_memory = 0;
@@ -163,14 +173,18 @@ void init_cplbtables(void)
++i;
icplb_add(extern_memory, SDRAM_IKERNEL);
dcplb_add(extern_memory, SDRAM_DKERNEL);
- extern_memory += CPLB_PAGE_SIZE;
+ extern_memory += cplb_page_size;
++i;
#endif
- while (i < 16 && extern_memory < (CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK)) {
+#if defined(__ADSPBF60x__)
+ cplb_page_size = (16 * 1024 * 1024);
+ cplb_page_mask = (~(cplb_page_size - 1));
+#endif
+ while (i < 16 && extern_memory < (CONFIG_SYS_MONITOR_BASE & cplb_page_mask)) {
icplb_add(extern_memory, SDRAM_IGENERIC);
dcplb_add(extern_memory, SDRAM_DGENERIC);
- extern_memory += CPLB_PAGE_SIZE;
+ extern_memory += cplb_page_size;
++i;
}
while (i < 16) {
diff --git a/include/configs/bf609-ezkit.h b/include/configs/bf609-ezkit.h
index 9b1f6c2..1fc2a18 100644
--- a/include/configs/bf609-ezkit.h
+++ b/include/configs/bf609-ezkit.h
@@ -62,11 +62,10 @@
#define CONFIG_BFIN_GET_SCLK0 (get_sclk()/CONFIG_SCLK0_DIV)
#define CONFIG_BFIN_GET_SCLK1 (get_sclk()/CONFIG_SCLK1_DIV)
-
/*
* Memory Settings
*/
-#define CONFIG_MEM_SIZE 32
+#define CONFIG_MEM_SIZE 128
#define CONFIG_SMC_GCTL_VAL 0x00000010
#define CONFIG_SMC_B1CTL_VAL 0x01002001
@@ -76,9 +75,6 @@
#define CONFIG_SYS_MONITOR_LEN (256 * 1024)
#define CONFIG_SYS_MALLOC_LEN (256 * 1024)
-#define CONFIG_ICACHE_OFF
-#define CONFIG_DCACHE_OFF
-
/*
* Network Settings
*/
--
1.7.9.5
next prev parent reply other threads:[~2012-08-07 8:07 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-07 8:07 [U-Boot] [PATCH 01/16] Blackfin: BF60x: new processor port Bob Liu
2012-08-07 8:07 ` [U-Boot] [PATCH 02/16] Blackfin: bf609-ezkit: new board port Bob Liu
2012-08-08 4:41 ` Mike Frysinger
2012-08-20 7:55 ` Bob Liu
2012-08-07 8:07 ` Bob Liu [this message]
2012-08-08 4:48 ` [U-Boot] [PATCH 03/16] Blackfin: Bf60x: support big cplb page Mike Frysinger
2012-08-20 8:00 ` Bob Liu
2012-08-23 3:49 ` Mike Frysinger
2012-08-07 8:07 ` [U-Boot] [PATCH 04/16] Blackfin: Rsi: add support for bf609-ezkit Bob Liu
2012-08-08 4:52 ` Mike Frysinger
2012-08-20 8:01 ` Bob Liu
2012-08-07 8:07 ` [U-Boot] [PATCH 05/16] Blackfin: Paraflash: " Bob Liu
2012-08-08 4:55 ` Mike Frysinger
2012-08-20 8:01 ` Bob Liu
2012-08-07 8:07 ` [U-Boot] [PATCH 06/16] Blackfin: Bf609-ezkit: implement soft switch Bob Liu
2012-08-08 4:59 ` Mike Frysinger
2012-08-20 8:11 ` Bob Liu
2012-08-23 3:53 ` Mike Frysinger
2012-08-07 8:07 ` [U-Boot] [PATCH 07/16] Blackfin: Spi: add bf6xx spi driver Bob Liu
2012-08-08 5:02 ` Mike Frysinger
2012-08-20 8:11 ` Bob Liu
2012-08-07 8:07 ` [U-Boot] [PATCH 08/16] Blackfin: add more print info for Bf60x Bob Liu
2012-08-08 5:04 ` Mike Frysinger
2012-08-20 8:12 ` Bob Liu
2012-08-07 8:07 ` [U-Boot] [PATCH 09/16] Blackfin: Bf60x: add reset support Bob Liu
2012-08-08 5:05 ` Mike Frysinger
2012-08-20 8:13 ` Bob Liu
2012-08-07 8:07 ` [U-Boot] [PATCH 10/16] Blackfin: Bf60x: Check card ready for each RSI command Bob Liu
2012-08-08 5:05 ` Mike Frysinger
2012-08-20 8:13 ` Bob Liu
2012-08-07 8:07 ` [U-Boot] [PATCH 11/16] Blackfin: Bf60x: support clock init Bob Liu
2012-08-08 5:06 ` Mike Frysinger
2012-08-07 8:07 ` [U-Boot] [PATCH 12/16] Blackfin: Bf60x: initcode: set up uart baud properly Bob Liu
2012-08-08 5:06 ` Mike Frysinger
2012-08-07 8:07 ` [U-Boot] [PATCH 13/16] Blackfin: Bf60x: add hw watchdog support Bob Liu
2012-08-08 5:11 ` Mike Frysinger
2012-08-20 8:25 ` Bob Liu
2012-08-07 8:07 ` [U-Boot] [PATCH 14/16] Blackfin: setup SMC if user desires it Bob Liu
2012-08-07 8:07 ` [U-Boot] [PATCH 15/16] Blackfin: Bf60x: add resume from hibernate Bob Liu
2012-08-07 8:07 ` [U-Boot] [PATCH 16/16] Blackfin: update license to Clear BSD license Bob Liu
2012-08-08 5:12 ` Mike Frysinger
2012-08-20 8:25 ` Bob Liu
2012-08-08 4:39 ` [U-Boot] [PATCH 01/16] Blackfin: BF60x: new processor port Mike Frysinger
2012-08-20 7:54 ` Bob Liu
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=1344326875-348-3-git-send-email-lliubbo@gmail.com \
--to=lliubbo@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.