Skip to contentSkip to conversation

Blackfin updates for v2010.03-rc0

PATCH New Mike Frysinger 3 participants 43 messages Dec 17, 2009 – Dec 22, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Blackfin updates for v2010.03-rc0

Bunch o fixes here as well as support for a few more boards. Also quite a bit of code clean ups (punting dead/useless code).

Cliff Cai (4):
Blackfin: bfin_spi: let boards control idle value
Blackfin: convert bfin_sdh to generic mmc
Blackfin: bfin_spi: round up clock divider
Blackfin: bf527-ezkit/bf548-ezkit: add musb board specific
initialization

Harald Krapfenbauer (1):
Blackfin: update tiny board settings (voltage/default env)

Michael Hennerich (1):
Blackfin: add support for BF527-EZKIT v2.1

Mike Frysinger (18):
Blackfin: tweak embedded LDR env config option
Blackfin: bf537-stamp: rename SPI/MMC define
Blackfin: ADI settings: enable silent console support
Blackfin: move section length calculation to linker script
Blackfin: do not require CONFIG_BAUDRATE
Blackfin: kill off useless initdram() usage
Blackfin: global_data.h: make pull in needed headers
Blackfin: re-architecture initcode
Blackfin: support boards with no external memory
Blackfin: bf527-ezkit: auto-select NAND settings
Blackfin: fix L1 Instruction sizes on BF52x/BF54x
Blackfin: move watchdog config check to Makefile
Blackfin: use new bfin read/write mmr helper funcs
Blackfin: asm/string.h: drop useless includes
Blackfin: bf533-stamp: split and cleanup CF/IDE code
Blackfin: drop unused funcs from io.h
Blackfin: section off the CF/IDE io.h hacks
Blackfin: pull io funcs from linux

Valentin Yakovenkov (1):
Blackfin: bf561-acvilon: new board port

 MAINTAINERS                                     |    6 +
 MAKEALL                                         |    2 +
 Makefile                                        |    9 +-
 board/bf518f-ezbrd/bf518f-ezbrd.c               |   15 +-
 board/bf526-ezbrd/bf526-ezbrd.c                 |    7 -
 board/bf527-ezkit/bf527-ezkit.c                 |   20 +-
 board/bf527-ezkit/video.c                       |  144 +++-
 board/bf533-ezkit/bf533-ezkit.c                 |    7 -
 board/bf533-stamp/Makefile                      |    1 +
 board/bf533-stamp/bf533-stamp.c                 |  120 +---
 board/bf533-stamp/ide-cf.c                      |   90 ++
 board/bf537-minotaur/bf537-minotaur.c           |    7 -
 board/bf537-pnav/bf537-pnav.c                   |    7 -
 board/bf537-srv1/bf537-srv1.c                   |    7 -
 board/bf537-stamp/bf537-stamp.c                 |    7 -
 board/bf538f-ezkit/bf538f-ezkit.c               |    7 -
 board/bf548-ezkit/bf548-ezkit.c                 |   31 +-
 board/bf561-acvilon/Makefile                    |   56 +
 board/bf561-acvilon/bf561-acvilon.c             |   52 +
 board/bf561-acvilon/config.mk                   |   34 +
 board/bf561-ezkit/bf561-ezkit.c                 |    7 -
 board/blackstamp/blackstamp.c                   |    7 -
 board/cm-bf527/cm-bf527.c                       |    7 -
 board/cm-bf533/cm-bf533.c                       |    7 -
 board/cm-bf537e/cm-bf537e.c                     |    7 -
 board/cm-bf537u/cm-bf537u.c                     |    7 -
 board/cm-bf548/cm-bf548.c                       |    7 -
 board/cm-bf561/cm-bf561.c                       |    7 -
 board/ibf-dsp561/ibf-dsp561.c                   |    7 -
 board/tcm-bf537/tcm-bf537.c                     |    7 -
 cpu/blackfin/Makefile                           |    2 +-
 cpu/blackfin/cpu.c                              |   11 +-
 cpu/blackfin/initcode.c                         |  250 ++++--
 cpu/blackfin/interrupts.c                       |   12 +-
 cpu/blackfin/serial.c                           |   20 +-
 cpu/blackfin/serial.h                           |  119 ++-
 cpu/blackfin/start.S                            |   24 +-
 cpu/blackfin/watchdog.c                         |    4 +-
 drivers/mmc/bfin_sdh.c                          |  519 +++--------
 drivers/mmc/bfin_sdh.h                          |   59 --
 drivers/spi/bfin_spi.c                          |   13 +-
 include/asm-blackfin/bfin_logo_rgb565_230x230.h | 1242 +++++++++++++++++++++++
 include/asm-blackfin/blackfin_local.h           |    4 +-
 include/asm-blackfin/config-pre.h               |    3 +
 include/asm-blackfin/config.h                   |   14 +-
 include/asm-blackfin/global_data.h              |    2 +
 include/asm-blackfin/io.h                       |  194 +++--
 include/asm-blackfin/mach-bf527/BF522_def.h     |   15 -
 include/asm-blackfin/mach-bf527/BF523_def.h     |   15 -
 include/asm-blackfin/mach-bf527/BF524_def.h     |   15 -
 include/asm-blackfin/mach-bf527/BF525_def.h     |   15 -
 include/asm-blackfin/mach-bf527/BF526_def.h     |   15 -
 include/asm-blackfin/mach-bf527/BF527_def.h     |   15 -
 include/asm-blackfin/mach-bf527/def_local.h     |    1 +
 include/asm-blackfin/mach-bf527/mem_map.h       |   21 +
 include/asm-blackfin/mach-bf548/BF542_def.h     |   15 -
 include/asm-blackfin/mach-bf548/BF544_def.h     |   15 -
 include/asm-blackfin/mach-bf548/BF547_def.h     |    9 -
 include/asm-blackfin/mach-bf548/BF548_def.h     |   15 -
 include/asm-blackfin/mach-bf548/BF549_def.h     |   15 -
 include/asm-blackfin/mach-bf548/def_local.h     |    1 +
 include/asm-blackfin/mach-bf548/mem_map.h       |   21 +
 include/asm-blackfin/mem_map.h                  |   26 +
 include/asm-blackfin/mmc.h                      |    1 -
 include/asm-blackfin/sdh.h                      |   17 +
 include/asm-blackfin/string.h                   |    5 +-
 include/configs/bf518f-ezbrd.h                  |    3 +-
 include/configs/bf526-ezbrd.h                   |    2 +-
 include/configs/bf527-ezkit.h                   |   20 +-
 include/configs/bf533-stamp.h                   |    2 +-
 include/configs/bf537-minotaur.h                |    2 +-
 include/configs/bf537-pnav.h                    |    2 +-
 include/configs/bf537-srv1.h                    |    2 +-
 include/configs/bf537-stamp.h                   |    4 +-
 include/configs/bf538f-ezkit.h                  |    2 +-
 include/configs/bf548-ezkit.h                   |    6 +-
 include/configs/bf561-acvilon.h                 |  178 ++++
 include/configs/bf561-ezkit.h                   |    2 +-
 include/configs/bfin_adi_common.h               |    8 +-
 include/configs/cm-bf527.h                      |    9 +-
 include/configs/cm-bf533.h                      |    5 +
 include/configs/cm-bf537e.h                     |    7 +-
 include/configs/cm-bf537u.h                     |   13 +-
 include/configs/cm-bf548.h                      |    7 +-
 include/configs/cm-bf561.h                      |    7 +-
 include/configs/ibf-dsp561.h                    |    2 +-
 include/configs/tcm-bf537.h                     |    7 +-
 lib_blackfin/Makefile                           |    2 +
 lib_blackfin/board.c                            |   34 +-
 lib_blackfin/config.mk                          |   10 +-
 lib_blackfin/ins.S                              |  117 +++
 lib_blackfin/outs.S                             |   60 ++
 lib_blackfin/u-boot.lds.S                       |   45 +-
 93 files changed, 2809 insertions(+), 1192 deletions(-)
 create mode 100644 board/bf533-stamp/ide-cf.c
 create mode 100644 board/bf561-acvilon/Makefile
 create mode 100644 board/bf561-acvilon/bf561-acvilon.c
 create mode 100644 board/bf561-acvilon/config.mk
 delete mode 100644 drivers/mmc/bfin_sdh.h
 create mode 100644 include/asm-blackfin/bfin_logo_rgb565_230x230.h
 create mode 100644 include/asm-blackfin/mach-bf527/mem_map.h
 create mode 100644 include/asm-blackfin/mach-bf548/mem_map.h
 create mode 100644 include/asm-blackfin/mem_map.h
 delete mode 100644 include/asm-blackfin/mmc.h
 create mode 100644 include/asm-blackfin/sdh.h
 create mode 100644 include/configs/bf561-acvilon.h
 create mode 100644 lib_blackfin/ins.S
 create mode 100644 lib_blackfin/outs.S
#1 lore raw

PATCH 1/25 Blackfin: tweak embedded LDR env config option

Use the common config option for extracting the environment for embedding into LDR files and clarify the LDR-specific option.

---
 Makefile                         |    2 +-
 include/asm-blackfin/config.h    |    5 +++++
 include/configs/bf518f-ezbrd.h   |    2 +-
 include/configs/bf526-ezbrd.h    |    2 +-
 include/configs/bf527-ezkit.h    |    2 +-
 include/configs/bf533-stamp.h    |    2 +-
 include/configs/bf537-minotaur.h |    2 +-
 include/configs/bf537-pnav.h     |    2 +-
 include/configs/bf537-srv1.h     |    2 +-
 include/configs/bf537-stamp.h    |    2 +-
 include/configs/bf538f-ezkit.h   |    2 +-
 include/configs/bf548-ezkit.h    |    4 ++--
 include/configs/bf561-ezkit.h    |    2 +-
 include/configs/cm-bf527.h       |    2 +-
 include/configs/cm-bf537e.h      |    2 +-
 include/configs/cm-bf537u.h      |    2 +-
 include/configs/cm-bf548.h       |    2 +-
 include/configs/ibf-dsp561.h     |    2 +-
 include/configs/tcm-bf537.h      |    2 +-
 lib_blackfin/config.mk           |   10 +++++++---
 20 files changed, 31 insertions(+), 22 deletions(-)
Makefile +1 -1
index 536ccb3..56c6480 100644
@@ -309,7 +309,7 @@ $(obj)u-boot.bin:	$(obj)u-boot
 		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
 $(obj)u-boot.ldr:	$(obj)u-boot
-		$(obj)tools/envcrc --binary > $(obj)env-ldr.o
+		$(CREATE_LDR_ENV)
 		$(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
 
 $(obj)u-boot.ldr.hex:	$(obj)u-boot.ldr
include/asm-blackfin/config.h +5 -0
index 327843d..fbfd598 100644
@@ -79,6 +79,11 @@
 # define CONFIG_ENV_SPI_CS BFIN_BOOT_SPI_SSEL
 #endif
 
+/* We need envcrc to embed the env into LDRs */
+#ifdef CONFIG_ENV_IS_EMBEDDED_IN_LDR
+# define CONFIG_BUILD_ENVCRC
+#endif
+
 /* Default/common Blackfin memory layout */
 #ifndef CONFIG_SYS_SDRAM_BASE
 # define CONFIG_SYS_SDRAM_BASE 0
include/configs/bf518f-ezbrd.h +1 -1
index 3db8171..4928403 100644
@@ -109,7 +109,7 @@
 #define CONFIG_ENV_SIZE		0x2000
 #define CONFIG_ENV_SECT_SIZE	0x2000
 #endif
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 
 
 /*
include/configs/bf526-ezbrd.h +1 -1
index 97853af..711fa27 100644
@@ -126,7 +126,7 @@
 #define CONFIG_ENV_SIZE		0x2000
 #define CONFIG_ENV_SECT_SIZE	0x2000
 #endif
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 
 
 /*
include/configs/bf527-ezkit.h +1 -1
index 0d02354..5f3cb83 100644
@@ -125,7 +125,7 @@
 #define CONFIG_ENV_SIZE		0x2000
 #define CONFIG_ENV_SECT_SIZE	0x2000
 #endif
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 
 
 /*
include/configs/bf533-stamp.h +1 -1
index 0006b02..083c030 100644
@@ -117,7 +117,7 @@
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
 #define ENV_IS_EMBEDDED
 #else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 #endif
 #ifdef ENV_IS_EMBEDDED
 /* WARNING - the following is hand-optimized to fit within
include/configs/bf537-minotaur.h +1 -1
index 463b7d0..86aa1f6 100644
@@ -115,7 +115,7 @@
 #define CONFIG_ENV_OFFSET	0x10000
 #define CONFIG_ENV_SIZE		0x10000
 #define CONFIG_ENV_SECT_SIZE	0x10000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 
 
 /*
include/configs/bf537-pnav.h +1 -1
index 0f908ef..6627a04 100644
@@ -94,7 +94,7 @@
  * Env Storage Settings
  */
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_ENV_OFFSET	0x4000
 #else
include/configs/bf537-srv1.h +1 -1
index 7368629..7e9dd36 100644
@@ -115,7 +115,7 @@
 #define CONFIG_ENV_OFFSET	0x10000
 #define CONFIG_ENV_SIZE		0x10000
 #define CONFIG_ENV_SECT_SIZE	0x10000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 
 
 /*
include/configs/bf537-stamp.h +1 -1
index 74b9ecd..017fb45 100644
@@ -113,7 +113,7 @@
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
 #define ENV_IS_EMBEDDED
 #else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 #endif
 #ifdef ENV_IS_EMBEDDED
 /* WARNING - the following is hand-optimized to fit within
include/configs/bf538f-ezkit.h +1 -1
index c4d899d..4ea2300 100644
@@ -110,7 +110,7 @@
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
 #define ENV_IS_EMBEDDED
 #else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 #endif
 #ifdef ENV_IS_EMBEDDED
 /* WARNING - the following is hand-optimized to fit within
include/configs/bf548-ezkit.h +2 -2
index 5b9de16..d0a9e49 100644
@@ -107,7 +107,7 @@
 #define CONFIG_ENV_OFFSET	0x10000
 #define CONFIG_ENV_SIZE		0x2000
 #define CONFIG_ENV_SECT_SIZE	0x10000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 #elif (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_NAND)
 #define CONFIG_ENV_IS_IN_NAND
 #define CONFIG_ENV_OFFSET	0x40000
@@ -118,7 +118,7 @@
 #define CONFIG_ENV_OFFSET	0x2000
 #define CONFIG_ENV_SIZE		0x2000
 #define CONFIG_ENV_SECT_SIZE	(128 * 1024)
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 #endif
 
 
include/configs/bf561-ezkit.h +1 -1
index a1fa80b..8ab38bb 100644
@@ -87,7 +87,7 @@
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
 #define ENV_IS_EMBEDDED
 #else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 #endif
 #ifdef ENV_IS_EMBEDDED
 /* WARNING - the following is hand-optimized to fit within
include/configs/cm-bf527.h +1 -1
index 1592719..3d41bd1 100644
@@ -106,7 +106,7 @@
 #define CONFIG_ENV_OFFSET	0x8000
 #define CONFIG_ENV_SIZE		0x8000
 #define CONFIG_ENV_SECT_SIZE	0x20000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 
 
 /*
include/configs/cm-bf537e.h +1 -1
index 34d4299..b243e1a 100644
@@ -92,7 +92,7 @@
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
 #define ENV_IS_EMBEDDED
 #else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 #endif
 #ifdef ENV_IS_EMBEDDED
 /* WARNING - the following is hand-optimized to fit within
include/configs/cm-bf537u.h +1 -1
index d1870a8..0ed5960 100644
@@ -96,7 +96,7 @@
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
 #define ENV_IS_EMBEDDED
 #else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 #endif
 #ifdef ENV_IS_EMBEDDED
 /* WARNING - the following is hand-optimized to fit within
include/configs/cm-bf548.h +1 -1
index b5cfc21..9630f7d 100644
@@ -96,7 +96,7 @@
 #define CONFIG_ENV_ADDR		0x20008000
 #define CONFIG_ENV_OFFSET	0x8000
 #define CONFIG_ENV_SIZE		0x8000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 
 
 /*
include/configs/ibf-dsp561.h +1 -1
index 066859f..7c9f71e 100644
@@ -75,7 +75,7 @@
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
 #define ENV_IS_EMBEDDED
 #else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 #endif
 #ifdef ENV_IS_EMBEDDED
 /* WARNING - the following is hand-optimized to fit within
include/configs/tcm-bf537.h +1 -1
index 9794e1b..9615ced 100644
@@ -93,7 +93,7 @@
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
 #define ENV_IS_EMBEDDED
 #else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 #endif
 #ifdef ENV_IS_EMBEDDED
 /* WARNING - the following is hand-optimized to fit within
lib_blackfin/config.mk +7 -3
index ce2fe67..323d28f 100644
@@ -43,6 +43,11 @@ endif
 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
 ALL += $(obj)u-boot.ldr
 endif
+ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y)
+CREATE_LDR_ENV = $(obj)tools/envcrc --binary > $(obj)env-ldr.o
+else
+CREATE_LDR_ENV =
+endif
 
 SYM_PREFIX = _
 
@@ -53,9 +58,8 @@ LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE))
 LDR_FLAGS += --use-vmas
 LDR_FLAGS += --initcode $(obj)cpu/$(CPU)/initcode.o
 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_UART)
-ifneq ($(ENV_IS_EMBEDDED_CUSTOM),ENV_IS_EMBEDDED_CUSTOM)
-LDR_FLAGS += --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o
-endif
+LDR_FLAGS-$(CONFIG_ENV_IS_EMBEDDED_IN_LDR) += \
+	--punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o
 endif
 ifneq (,$(findstring s,$(MAKEFLAGS)))
 LDR_FLAGS += --quiet
Signature · 1 line
1.6.5.5
#2 lore raw

PATCH 2/25 Blackfin: update tiny board settings (voltage/default env)

In reply to Mike Frysinger

From: Harald Krapfenbauer <[email protected]>

The tinyboards like to run at a little lower voltage than the default, and they prefer to boot over the network. For the latter, extend the common code a little to make this easier.

Also fix the cm-bf527 env sector size while we're in here to reflect the flash that is actually in use.

---
 include/configs/bfin_adi_common.h |    5 ++++-
 include/configs/cm-bf527.h        |    7 ++++++-
 include/configs/cm-bf533.h        |    5 +++++
 include/configs/cm-bf537e.h       |    5 +++++
 include/configs/cm-bf537u.h       |   11 ++---------
 include/configs/cm-bf548.h        |    5 +++++
 include/configs/cm-bf561.h        |    7 ++++++-
 include/configs/tcm-bf537.h       |    5 +++++
 8 files changed, 38 insertions(+), 12 deletions(-)
include/configs/bfin_adi_common.h +4 -1
index 0fbd8f4..3fc0fa0 100644
@@ -127,6 +127,9 @@
 #ifndef CONFIG_BOOTARGS_ROOT
 # define CONFIG_BOOTARGS_ROOT "/dev/mtdblock0 rw"
 #endif
+#ifndef FLASHBOOT_ENV_SETTINGS
+# define FLASHBOOT_ENV_SETTINGS "flashboot=bootm 0x20100000\0"
+#endif
 #define CONFIG_BOOTARGS	\
 	"root=" CONFIG_BOOTARGS_ROOT " " \
 	"clkin_hz=" MK_STR(CONFIG_CLKIN_HZ) " " \
@@ -211,7 +214,7 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	NAND_ENV_SETTINGS \
 	NETWORK_ENV_SETTINGS \
-	"flashboot=bootm 0x20100000\0"
+	FLASHBOOT_ENV_SETTINGS
 
 /*
  * Network Settings
include/configs/cm-bf527.h +6 -1
index 3d41bd1..eb0bc3f 100644
@@ -38,6 +38,9 @@
 /* Values can range from 1-15						*/
 #define CONFIG_SCLK_DIV			4
 
+/* Decrease core voltage */
+#define CONFIG_VR_CTL_VAL (VLEV_120 | CLKBUFOE | FREQ_1000)
+
 
 /*
  * Memory Settings
@@ -105,7 +108,7 @@
 #define CONFIG_ENV_ADDR		0x20008000
 #define CONFIG_ENV_OFFSET	0x8000
 #define CONFIG_ENV_SIZE		0x8000
-#define CONFIG_ENV_SECT_SIZE	0x20000
+#define CONFIG_ENV_SECT_SIZE	0x8000
 #define CONFIG_ENV_IS_EMBEDDED_IN_LDR
 
 
@@ -125,6 +128,8 @@
 #define CONFIG_MISC_INIT_R
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	0
+#define CONFIG_BOOTCOMMAND	"run flashboot"
+#define FLASHBOOT_ENV_SETTINGS	"flashboot=flread 20040000 1000000 300000; bootm 0x1000000\0"
 
 
 /*
include/configs/cm-bf533.h +5 -0
index 06eb288..7515296 100644
@@ -38,6 +38,9 @@
 /* Values can range from 1-15						*/
 #define CONFIG_SCLK_DIV			5
 
+/* Decrease core voltage */
+#define CONFIG_VR_CTL_VAL (VLEV_115 | GAIN_20 | FREQ_1000)
+
 
 /*
  * Memory Settings
@@ -93,6 +96,8 @@
  */
 #define CONFIG_BAUDRATE		115200
 #define CONFIG_UART_CONSOLE	0
+#define CONFIG_BOOTCOMMAND	"run flashboot"
+#define FLASHBOOT_ENV_SETTINGS	"flashboot=bootm 0x20040000\0"
 
 
 /*
include/configs/cm-bf537e.h +5 -0
index b243e1a..f51fa9c 100644
@@ -38,6 +38,9 @@
 /* Values can range from 1-15						*/
 #define CONFIG_SCLK_DIV			4
 
+/* Decrease core voltage */
+#define CONFIG_VR_CTL_VAL (VLEV_115 | CLKBUFOE | GAIN_20 | FREQ_1000)
+
 
 /*
  * Memory Settings
@@ -127,6 +130,8 @@
 #define CONFIG_MISC_INIT_R
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	0
+#define CONFIG_BOOTCOMMAND	"run flashboot"
+#define FLASHBOOT_ENV_SETTINGS	"flashboot=flread 20040000 1000000 300000; bootm 0x1000000\0"
 
 
 /*
include/configs/cm-bf537u.h +2 -9
index 0ed5960..6937225 100644
@@ -131,6 +131,8 @@
 #define CONFIG_MISC_INIT_R
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	0
+#define CONFIG_BOOTCOMMAND	"run flashboot"
+#define FLASHBOOT_ENV_SETTINGS	"flashboot=flread 20040000 1000000 280000; bootm 0x1000000\0"
 
 
 /*
@@ -138,13 +140,4 @@
  */
 #include <configs/bfin_adi_common.h>
 
-#undef CONFIG_BOOTCOMMAND
-#define CONFIG_BOOTCOMMAND	"run flashboot"
-
-#undef CONFIG_EXTRA_ENV_SETTINGS
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	NAND_ENV_SETTINGS \
-	NETWORK_ENV_SETTINGS \
-	"flashboot=flread 20040000 1000000 280000; bootm 0x1000000\0"
-
 #endif
include/configs/cm-bf548.h +5 -0
index 9630f7d..93c4c8d 100644
@@ -38,6 +38,9 @@
 /* Values can range from 1-15						*/
 #define CONFIG_SCLK_DIV			4
 
+/* Decrease core voltage */
+#define CONFIG_VR_CTL_VAL (VLEV_115 | GAIN_20 | FREQ_1000)
+
 
 /*
  * Memory Settings
@@ -115,6 +118,8 @@
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	1
+#define CONFIG_BOOTCOMMAND	"run flashboot"
+#define FLASHBOOT_ENV_SETTINGS	"flashboot=bootm 0x20040000\0"
 
 #ifndef __ADSPBF542__
 /* Don't waste time transferring a logo over the UART */
include/configs/cm-bf561.h +6 -1
index 4a77435..1741ed4 100644
@@ -30,7 +30,7 @@
 #define CONFIG_PLL_BYPASS		0
 /* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL		*/
 /* Values can range from 0-63 (where 0 means 64)			*/
-#define CONFIG_VCO_MULT			22
+#define CONFIG_VCO_MULT			20
 /* CCLK_DIV controls the core clock divider				*/
 /* Values can be 1, 2, 4, or 8 ONLY					*/
 #define CONFIG_CCLK_DIV			1
@@ -38,6 +38,9 @@
 /* Values can range from 1-15						*/
 #define CONFIG_SCLK_DIV			5
 
+/* Decrease core voltage */
+#define CONFIG_VR_CTL_VAL (VLEV_110 | GAIN_20 | FREQ_1000)
+
 
 /*
  * Memory Settings
@@ -98,6 +101,8 @@
  */
 #define CONFIG_BAUDRATE		115200
 #define CONFIG_UART_CONSOLE	0
+#define CONFIG_BOOTCOMMAND	"run flashboot"
+#define FLASHBOOT_ENV_SETTINGS	"flashboot=bootm 0x20040000\0"
 
 
 /*
include/configs/tcm-bf537.h +5 -0
index 9615ced..f2ac6cd 100644
@@ -38,6 +38,9 @@
 /* Values can range from 1-15						*/
 #define CONFIG_SCLK_DIV			4
 
+/* Decrease core voltage */
+#define CONFIG_VR_CTL_VAL (VLEV_115 | CLKBUFOE | GAIN_20 | FREQ_1000)
+
 
 /*
  * Memory Settings
@@ -128,6 +131,8 @@
 #define CONFIG_MISC_INIT_R
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE	0
+#define CONFIG_BOOTCOMMAND	"run flashboot"
+#define FLASHBOOT_ENV_SETTINGS	"flashboot=flread 20040000 1000000 280000; bootm 0x1000000\0"
 
 
 /*
Signature · 1 line
1.6.5.5
#3 lore raw

PATCH 3/25 Blackfin: bf537-stamp: rename SPI/MMC define

In reply to Mike Frysinger
---
 include/configs/bf537-stamp.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/configs/bf537-stamp.h +1 -1
index 017fb45..de2add7 100644
@@ -145,7 +145,7 @@
  * SPI_MMC Settings
  */
 #define CONFIG_MMC
-#define CONFIG_BFIN_SPI_MMC
+#define CONFIG_SPI_MMC
 
 
 /*
Signature · 1 line
1.6.5.5
#4 lore raw

PATCH 4/25 Blackfin: ADI settings: enable silent console support

In reply to Mike Frysinger

Very little additional code overhead, and only works when the user sets an env var ahead of time, so default to on makes sense.

---
 include/configs/bfin_adi_common.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
include/configs/bfin_adi_common.h +1 -0
index 3fc0fa0..42f4cbc 100644
@@ -96,6 +96,7 @@
 #define CONFIG_AUTO_COMPLETE	1
 #define CONFIG_LOADS_ECHO	1
 #define CONFIG_JTAG_CONSOLE
+#define CONFIG_SILENT_CONSOLE
 #ifndef CONFIG_BAUDRATE
 # define CONFIG_BAUDRATE	57600
 #endif
Signature · 1 line
1.6.5.5
#5 lore raw

PATCH 5/25 Blackfin: bf561-acvilon: new board port

In reply to Mike Frysinger

From: Valentin Yakovenkov <[email protected]>

---
 MAINTAINERS                         |    5 +
 MAKEALL                             |    1 +
 Makefile                            |    2 +-
 board/bf561-acvilon/Makefile        |   56 +++++++++++
 board/bf561-acvilon/bf561-acvilon.c |   59 ++++++++++++
 board/bf561-acvilon/config.mk       |   34 +++++++
 include/configs/bf561-acvilon.h     |  178 +++++++++++++++++++++++++++++++++++
 7 files changed, 334 insertions(+), 1 deletions(-)
 create mode 100644 board/bf561-acvilon/Makefile
 create mode 100644 board/bf561-acvilon/bf561-acvilon.c
 create mode 100644 board/bf561-acvilon/config.mk
 create mode 100644 include/configs/bf561-acvilon.h
MAINTAINERS +5 -0
index 9734b1d..2ef158d 100644
@@ -977,6 +977,11 @@ Blackfin Team <[email protected]>
 
 	IBF-DSP561	BF561
 
+Valentin Yakovenkov <[email protected]>
+Anton Shurpin <[email protected]>
+
+	BF561-ACVILON	BF561
+
 #########################################################################
 # End of MAINTAINERS list						#
 #########################################################################
MAKEALL +1 -0
index ab1bb6f..acb35d2 100755
@@ -877,6 +877,7 @@ LIST_blackfin="		\
 	bf537-stamp	\
 	bf538f-ezkit	\
 	bf548-ezkit	\
+	bf561-acvilon	\
 	bf561-ezkit	\
 	blackstamp	\
 	cm-bf527	\
Makefile +1 -1
index 56c6480..9ce0ecf 100644
@@ -3559,7 +3559,7 @@ BFIN_BOARDS = bf518f-ezbrd bf526-ezbrd bf527-ezkit bf533-ezkit bf533-stamp \
 BFIN_BOARDS += cm-bf527 cm-bf533 cm-bf537e cm-bf537u cm-bf548 cm-bf561 tcm-bf537
 
 # Misc third party boards
-BFIN_BOARDS += bf537-minotaur bf537-srv1 blackstamp
+BFIN_BOARDS += bf537-minotaur bf537-srv1 bf561-acvilon blackstamp
 
 # I-SYST Micromodule
 BFIN_BOARDS += ibf-dsp561
board/bf561-acvilon/Makefile new file +56 -0

56 lines not on this page · raw message

board/bf561-acvilon/bf561-acvilon.c new file +59 -0

59 lines not on this page · raw message

board/bf561-acvilon/config.mk new file +34 -0
new file mode 100644
index 0000000..cfad21a
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2005-2008 Analog Device Inc.
+#
+# (C) Copyright 2001
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+# This is not actually used for Blackfin boards so do not change it
+#TEXT_BASE = do-not-use-me
+
+CFLAGS_lib_generic += -O2
+CFLAGS_lzma += -O2
+
+# Set some default LDR flags based on boot mode.
+LDR_FLAGS-BFIN_BOOT_PARA := --bits 16
+LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
include/configs/bf561-acvilon.h new file +178 -0

178 lines not on this page · raw message

Signature · 1 line
1.6.5.5
#6 lore raw

PATCH 6/25 Blackfin: move section length calculation to linker script

In reply to Mike Frysinger

The length of the sections is fixed at link time, so let the linker do the calculation rather than doing it ourselves at runtime.

---
 cpu/blackfin/cpu.c        |   11 +++++------
 cpu/blackfin/start.S      |   18 ++++++++----------
 lib_blackfin/u-boot.lds.S |   24 +++++++++++++++++-------
 3 files changed, 30 insertions(+), 23 deletions(-)
cpu/blackfin/cpu.c +5 -6
index 9bb6407..2c8fd86 100644
@@ -25,13 +25,12 @@ ulong bfin_poweron_retx;
 __attribute__ ((__noreturn__))
 void cpu_init_f(ulong bootflag, ulong loaded_from_ldr)
 {
-	extern char _stext_l1;
 #ifndef CONFIG_BFIN_BOOTROM_USES_EVT1
 	/* Build a NOP slide over the LDR jump block.  Whee! */
 	char nops[0xC];
 	serial_early_puts("NOP Slide\n");
 	memset(nops, 0x00, sizeof(nops));
-	memcpy(&_stext_l1 - sizeof(nops), nops, sizeof(nops));
+	memcpy((void *)L1_INST_SRAM, nops, sizeof(nops));
 #endif
 
 	if (!loaded_from_ldr) {
@@ -40,10 +39,10 @@ void cpu_init_f(ulong bootflag, ulong loaded_from_ldr)
 		 * checking at build time.
 		 */
 		serial_early_puts("L1 Relocate\n");
-		extern char _stext_l1, _etext_l1, _stext_l1_lma;
-		memcpy(&_stext_l1, &_stext_l1_lma, (&_etext_l1 - &_stext_l1));
-		extern char _sdata_l1, _edata_l1, _sdata_l1_lma;
-		memcpy(&_sdata_l1, &_sdata_l1_lma, (&_edata_l1 - &_sdata_l1));
+		extern char _stext_l1[], _text_l1_lma[], _text_l1_len[];
+		memcpy(&_stext_l1, &_text_l1_lma, (unsigned long)_text_l1_len);
+		extern char _sdata_l1[], _data_l1_lma[], _data_l1_len[];
+		memcpy(&_sdata_l1, &_data_l1_lma, (unsigned long)_data_l1_len);
 	}
 #if defined(__ADSPBF537__) || defined(__ADSPBF536__) || defined(__ADSPBF534__)
 	/* The BF537 bootrom will reset the EBIU_AMGCTL register on us
cpu/blackfin/start.S +8 -10
index 7cbd632..44e2725 100644
@@ -139,11 +139,10 @@ ENTRY(_start)
 .Ldma_and_reprogram:
 	r0.l = LO(L1_INST_SRAM);
 	r0.h = HI(L1_INST_SRAM);
-	r1.l = __initcode_start;
-	r1.h = __initcode_start;
-	r2.l = __initcode_end;
-	r2.h = __initcode_end;
-	r2 = r2 - r1;	/* convert r2 into length of initcode */
+	r1.l = __initcode_lma;
+	r1.h = __initcode_lma;
+	r2.l = __initcode_len;
+	r2.h = __initcode_len;
 	r1 = r1 - r4;	/* convert r1 from load address of initcode ... */
 	r1 = r1 + r5;	/* ... to current (not load) address of initcode */
 	p3 = r0;
@@ -173,12 +172,11 @@ ENTRY(_start)
 	 * takes care of clearing things for us.
 	 */
 	serial_early_puts("Zero BSS");
-	r0.l = __bss_start;
-	r0.h = __bss_start;
+	r0.l = __bss_vma;
+	r0.h = __bss_vma;
 	r1 = 0 (x);
-	r2.l = __bss_end;
-	r2.h = __bss_end;
-	r2 = r2 - r0;
+	r2.l = __bss_len;
+	r2.h = __bss_len;
 	call _memset;
 
 .Lnorelocate:
lib_blackfin/u-boot.lds.S +17 -7
index 3604b78..8a9e8b1 100644
@@ -65,16 +65,22 @@ MEMORY
 ENTRY(_start)
 SECTIONS
 {
-	.text :
+	.text.pre :
 	{
 		cpu/blackfin/start.o (.text .text.*)
 
 		LDS_BOARD_TEXT
+	} >ram_code
 
-		__initcode_start = .;
+	.text.init :
+	{
 		cpu/blackfin/initcode.o (.text .text.*)
-		__initcode_end = .;
+	} >ram_code
+	__initcode_lma = LOADADDR(.text.init);
+	__initcode_len = SIZEOF(.text.init);
 
+	.text :
+	{
 		*(.text .text.*)
 	} >ram
 
@@ -113,7 +119,9 @@ SECTIONS
 		. = ALIGN(4);
 		__etext_l1 = .;
 	} >l1_code AT>ram
-	__stext_l1_lma = LOADADDR(.text_l1);
+	__text_l1_lma = LOADADDR(.text_l1);
+	__text_l1_len = SIZEOF(.text_l1);
+	ASSERT (__text_l1_len <= L1_INST_SRAM_SIZE, "L1 text overflow!")
 
 	.data_l1 :
 	{
@@ -124,16 +132,18 @@ SECTIONS
 		. = ALIGN(4);
 		__edata_l1 = .;
 	} >l1_data AT>ram
-	__sdata_l1_lma = LOADADDR(.data_l1);
+	__data_l1_lma = LOADADDR(.data_l1);
+	__data_l1_len = SIZEOF(.data_l1);
+	ASSERT (__data_l1_len <= L1_DATA_B_SRAM_SIZE, "L1 data B overflow!")
 
 	.bss :
 	{
 		. = ALIGN(4);
-		__bss_start = .;
 		*(.sbss) *(.scommon)
 		*(.dynbss)
 		*(.bss .bss.*)
 		*(COMMON)
-		__bss_end = .;
 	} >ram
+	__bss_vma = ADDR(.bss);
+	__bss_len = SIZEOF(.bss);
 }
Signature · 1 line
1.6.5.5
#7 lore raw

PATCH 7/25 Blackfin: do not require CONFIG_BAUDRATE

In reply to Mike Frysinger
---
 cpu/blackfin/initcode.c |    3 +++
 lib_blackfin/board.c    |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)
cpu/blackfin/initcode.c +3 -0
index a039cbb..90a5fc3 100644
@@ -66,6 +66,9 @@ static inline void serial_init(void)
 		int ucen = *pUART_GCTL & UCEN;
 		serial_early_init();
 
+#ifndef CONFIG_BAUDRATE
+# define CONFIG_BAUDRATE 57600
+#endif
 		/* If the UART is off, that means we need to program
 		 * the baud rate ourselves initially.
 		 */
lib_blackfin/board.c +2 -0
index 6cade7d..1c3b461 100644
@@ -61,11 +61,13 @@ static int display_banner(void)
 
 static int init_baudrate(void)
 {
+#ifdef CONFIG_BAUDRATE
 	char baudrate[15];
 	int i = getenv_r("baudrate", baudrate, sizeof(baudrate));
 	gd->bd->bi_baudrate = gd->baudrate = (i > 0)
 	    ? simple_strtoul(baudrate, NULL, 10)
 	    : CONFIG_BAUDRATE;
+#endif
 	return 0;
 }
 
Signature · 1 line
1.6.5.5
#8 lore raw

PATCH 7/25 Blackfin: do not require CONFIG_BAUDRATE

Dear Mike Frysinger,

Quoted 5 lines · In message <[email protected]> you wrote:
---
 cpu/blackfin/initcode.c |    3 +++
 lib_blackfin/board.c    |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

...

lib_blackfin/board.c static int display_banner(void) · line 72

Quoted 11 lines

static int init_baudrate(void)
{

lib_blackfin/board.c +2 -0
+#ifdef CONFIG_BAUDRATE
 	char baudrate[15];
 	int i = getenv_r("baudrate", baudrate, sizeof(baudrate));
 	gd->bd->bi_baudrate = gd->baudrate = (i > 0)
 	    ? simple_strtoul(baudrate, NULL, 10)
 	    : CONFIG_BAUDRATE;
+#endif
 	return 0;
 }

Out of curiosity: what do these boards do when CONFIG_BAUDRATE is not defined?

It seems yo me you add a new, additional meaning to the CONFIG_BAUDRATE option here. This should be documented (at least in the README).

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Time is fluid ... like a river with currents, eddies, backwash.
	-- Spock, "The City on the Edge of Forever", stardate 3134.0
#9 lore raw

PATCH 7/25 Blackfin: do not require CONFIG_BAUDRATE

Quoted 17 lines · On Thursday 17 December 2009 16:32:38 Wolfgang Denk wrote:
Quoted 5 lines · Mike Frysinger
---
 cpu/blackfin/initcode.c |    3 +++
 lib_blackfin/board.c    |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

...

Quoted 8 lines

static int init_baudrate(void)
{

lib_blackfin/board.c +1 -0
+#ifdef CONFIG_BAUDRATE
 	char baudrate[15];
 	int i = getenv_r("baudrate", baudrate, sizeof(baudrate));
 	gd->bd->bi_baudrate = gd->baudrate = (i > 0)
 	    ? simple_strtoul(baudrate, NULL, 10)
Quoted 8 lines

lib_blackfin/board.c static int display_banner(void) · line 72

Quoted 5 lines
lib_blackfin/board.c +1 -0
 	    : CONFIG_BAUDRATE;
 
+#endif
 	return 0;
 }

Out of curiosity: what do these boards do when CONFIG_BAUDRATE is not defined?

the boards lack serial and/or dont use it. they're controlled via JTAG.

Quoted 3 lines

It seems yo me you add a new, additional meaning to the CONFIG_BAUDRATE option here. This should be documented (at least in the README).

i could just fall back to a value of 0 ... there'd be a little more useless code added, but not much to be done here seeing as how the rest of u-boot assumes baudrate is usable.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091217/589d84bc/attachment.pgp

#10 lore raw

PATCH 8/25 Blackfin: kill off useless initdram() usage

In reply to Mike Frysinger

While the initdram() function makes sense on some arches, it doesn't for Blackfin systems as it's always implemented the same way.

---
 board/bf518f-ezbrd/bf518f-ezbrd.c     |    7 -------
 board/bf526-ezbrd/bf526-ezbrd.c       |    7 -------
 board/bf527-ezkit/bf527-ezkit.c       |    7 -------
 board/bf533-ezkit/bf533-ezkit.c       |    7 -------
 board/bf533-stamp/bf533-stamp.c       |    7 -------
 board/bf537-minotaur/bf537-minotaur.c |    7 -------
 board/bf537-pnav/bf537-pnav.c         |    7 -------
 board/bf537-srv1/bf537-srv1.c         |    7 -------
 board/bf537-stamp/bf537-stamp.c       |    7 -------
 board/bf538f-ezkit/bf538f-ezkit.c     |    7 -------
 board/bf548-ezkit/bf548-ezkit.c       |    7 -------
 board/bf561-acvilon/bf561-acvilon.c   |    7 -------
 board/bf561-ezkit/bf561-ezkit.c       |    7 -------
 board/blackstamp/blackstamp.c         |    7 -------
 board/cm-bf527/cm-bf527.c             |    7 -------
 board/cm-bf533/cm-bf533.c             |    7 -------
 board/cm-bf537e/cm-bf537e.c           |    7 -------
 board/cm-bf537u/cm-bf537u.c           |    7 -------
 board/cm-bf548/cm-bf548.c             |    7 -------
 board/cm-bf561/cm-bf561.c             |    7 -------
 board/ibf-dsp561/ibf-dsp561.c         |    7 -------
 board/tcm-bf537/tcm-bf537.c           |    7 -------
 lib_blackfin/board.c                  |    4 +++-
 23 files changed, 3 insertions(+), 155 deletions(-)
board/bf518f-ezbrd/bf518f-ezbrd.c +0 -7
index 63be7cf..279c55c 100644
@@ -25,13 +25,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #if defined(CONFIG_BFIN_MAC)
 static void board_init_enetaddr(uchar *mac_addr)
 {
board/bf526-ezbrd/bf526-ezbrd.c +0 -7
index 1666bf6..52d82cd 100644
@@ -24,13 +24,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_BFIN_MAC
 static void board_init_enetaddr(uchar *mac_addr)
 {
board/bf527-ezkit/bf527-ezkit.c +0 -7
index 2cbfa8d..a880066 100644
@@ -24,13 +24,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_BFIN_MAC
 static void board_init_enetaddr(uchar *mac_addr)
 {
board/bf533-ezkit/bf533-ezkit.c +0 -7
index 8727dee..b1aa7b7 100644
@@ -39,13 +39,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 /* miscellaneous platform dependent initialisations */
 int misc_init_r(void)
 {
board/bf533-stamp/bf533-stamp.c +0 -7
index a226910..7a63c52 100644
@@ -39,13 +39,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 /* PF0 and PF1 are used to switch between the ethernet and flash:
  *         PF0  PF1
  *  flash:  0    0
board/bf537-minotaur/bf537-minotaur.c +0 -7
index 71b452a..920429c 100644
@@ -23,13 +23,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_BFIN_MAC
 static void board_init_enetaddr(uchar *mac_addr)
 {
board/bf537-pnav/bf537-pnav.c +0 -7
index 12cfefa..c512528 100644
@@ -23,13 +23,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_BFIN_MAC
 static void board_init_enetaddr(uchar *mac_addr)
 {
board/bf537-srv1/bf537-srv1.c +0 -7
index 5ad39cc..04d3891 100644
@@ -23,13 +23,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_BFIN_MAC
 static void board_init_enetaddr(uchar *mac_addr)
 {
board/bf537-stamp/bf537-stamp.c +0 -7
index 28597c9..3911be6 100644
@@ -43,13 +43,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 void board_reset(void)
 {
 	/* workaround for weak pull ups on ssel */
board/bf538f-ezkit/bf538f-ezkit.c +0 -7
index 15916fa..49d30e7 100644
@@ -20,13 +20,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
board/bf548-ezkit/bf548-ezkit.c +0 -7
index 88a0cd4..29c2e92 100644
@@ -21,13 +21,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 int board_early_init_f(void)
 {
 	/* Port H: PH8 - PH13 == A4 - A9
board/bf561-acvilon/bf561-acvilon.c +0 -7
index 3129f05..2f6aa09 100644
@@ -44,13 +44,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_SMC911X
 int board_eth_init(bd_t *bis)
 {
board/bf561-ezkit/bf561-ezkit.c +0 -7
index e5d7eb3..b2411b6 100644
@@ -38,13 +38,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
board/blackstamp/blackstamp.c +0 -7
index f55ab97..6355c10 100644
@@ -24,13 +24,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef SHARED_RESOURCES
 void swap_to(int device_id)
 {
board/cm-bf527/cm-bf527.c +0 -7
index db1cf90..b6815b1 100644
@@ -24,13 +24,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_BFIN_MAC
 static void board_init_enetaddr(uchar *mac_addr)
 {
board/cm-bf533/cm-bf533.c +0 -7
index ab0bf3b..a863195 100644
@@ -18,13 +18,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
board/cm-bf537e/cm-bf537e.c +0 -7
index d1ca0a4..1e350dc 100644
@@ -24,13 +24,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_BFIN_MAC
 static void board_init_enetaddr(uchar *mac_addr)
 {
board/cm-bf537u/cm-bf537u.c +0 -7
index 9628e0f..92fa5a0 100644
@@ -24,13 +24,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_BFIN_MAC
 static void board_init_enetaddr(uchar *mac_addr)
 {
board/cm-bf548/cm-bf548.c +0 -7
index 796263d..3627586 100644
@@ -21,13 +21,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 int board_early_init_f(void)
 {
 	/* Port H: PH8 - PH13 == A4 - A9
board/cm-bf561/cm-bf561.c +0 -7
index f21a015..80cfff7 100644
@@ -18,13 +18,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
board/ibf-dsp561/ibf-dsp561.c +0 -7
index 551fc29..b5bebd4 100644
@@ -16,10 +16,3 @@ int checkboard(void)
 	printf("       Support: http://www.i-syst.com/\n");
 	return 0;
 }
-
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
board/tcm-bf537/tcm-bf537.c +0 -7
index 573387d..60742df 100644
@@ -24,13 +24,6 @@ int checkboard(void)
 	return 0;
 }
 
-phys_size_t initdram(int board_type)
-{
-	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	return gd->bd->bi_memsize;
-}
-
 #ifdef CONFIG_BFIN_MAC
 static void board_init_enetaddr(uchar *mac_addr)
 {
lib_blackfin/board.c +3 -1
index 1c3b461..f6ff89b 100644
@@ -241,6 +241,8 @@ void board_init_f(ulong bootflag)
 	bd->bi_vco = get_vco();
 	bd->bi_cclk = get_cclk();
 	bd->bi_sclk = get_sclk();
+	bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
+	bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
 
 	/* Initialize */
 	serial_early_puts("IRQ init\n");
@@ -264,7 +266,7 @@ void board_init_f(ulong bootflag)
 	printf("System: %s MHz\n", strmhz(buf, get_sclk()));
 
 	printf("RAM:   ");
-	print_size(initdram(0), "\n");
+	print_size(bd->bi_memsize, "\n");
 #if defined(CONFIG_POST)
 	post_init_f();
 	post_bootmode_init();
Signature · 1 line
1.6.5.5
#11 lore raw

PATCH 8/25 Blackfin: kill off useless initdram() usage

Dear Mike Frysinger,

Quoted 2 lines · In message <[email protected]> you wrote:

While the initdram() function makes sense on some arches, it doesn't for Blackfin systems as it's always implemented the same way.

Would it not make sense to start using get_ram_size(), too?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Unix is like a toll road on which you have to stop every 50  feet  to
pay another nickel. But hey! You only feel 5 cents poorer each time.
                 - Larry Wall in <[email protected]>
#12 lore raw

PATCH 8/25 Blackfin: kill off useless initdram() usage

Quoted 5 lines · On Thursday 17 December 2009 16:33:46 Wolfgang Denk wrote:
Quoted 2 lines · Mike Frysinger

While the initdram() function makes sense on some arches, it doesn't for Blackfin systems as it's always implemented the same way.

Would it not make sense to start using get_ram_size(), too?

i havent heard of this function before. looking through the tree, it seems like this is an optional board-specific function that probes external memory sizes by reading/writing to it.

on a Blackfin system, this is a pretty big waste. memory must always be mapped starting at address 0 which means once the highest address is validated, things can return. ignoring that, the Blackfin port has no relocation support, so the link time addresses are fixed.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091217/70efce92/attachment.pgp

#13 lore raw

PATCH 8/25 Blackfin: kill off useless initdram() usage

Dear Mike Frysinger,

Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 2 lines

Would it not make sense to start using get_ram_size(), too?

i havent heard of this function before. looking through the tree, it seems

Seems you have ignored a lot of messages on this list ;-)

Quoted 2 lines

like this is an optional board-specific function that probes external memory sizes by reading/writing to it.

Right, with at least two purposes: detecting memroy errors, and determining the available memory size.

Quoted 1 line

on a Blackfin system, this is a pretty big waste. memory must always be

Waste in terms of ... ?

Quoted 3 lines

mapped starting at address 0 which means once the highest address is validated, things can return. ignoring that, the Blackfin port has no relocation support, so the link time addresses are fixed.

The memory test alone is a pretty good reason to add this. And don;t you have boards with multiple configurations / different RAM sizes where auto-sizing would be useful?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Worlds are conquered, galaxies destroyed -- but a woman is  always  a
woman.
	-- Kirk, "Conscience of the King", stardate unknown
#14 lore raw

PATCH 8/25 Blackfin: kill off useless initdram() usage

Quoted 6 lines · On Thursday 17 December 2009 17:48:48 Wolfgang Denk wrote:
Quoted 2 lines · Mike Frysinger

like this is an optional board-specific function that probes external memory sizes by reading/writing to it.

Right, with at least two purposes: detecting memroy errors, and determining the available memory size.

the memory error checking is kind of lame. i cant imagine it catching anything useful which the board crashing doesnt already tell you -- things are screwed.

Quoted 3 lines
Quoted 1 line

on a Blackfin system, this is a pretty big waste. memory must always be

Waste in terms of ... ?

if it's only detecting memory, then probing all the way down to the base is a waste of time.

Quoted 7 lines
Quoted 3 lines

mapped starting at address 0 which means once the highest address is validated, things can return. ignoring that, the Blackfin port has no relocation support, so the link time addresses are fixed.

The memory test alone is a pretty good reason to add this. And don;t you have boards with multiple configurations / different RAM sizes where auto-sizing would be useful?

not really, and we havent had a customer ask for this kind of functionality. we do however get people always asking for faster loading times.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091217/916700c6/attachment.pgp

#15 lore raw

PATCH 9/25 Blackfin: global_data.h: make pull in needed headers

In reply to Mike Frysinger

We need the definition of bd_t in this header, so pull in asm/u-boot.h.

---
 include/asm-blackfin/global_data.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/asm-blackfin/global_data.h +2 -0
index b78b04c..c7099e6 100644
@@ -28,6 +28,8 @@
 #ifndef	__ASM_GBL_DATA_H
 #define __ASM_GBL_DATA_H
 
+#include <asm/u-boot.h>
+
 /*
  * The following data structure is placed in some memory wich is
  * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
Signature · 1 line
1.6.5.5
#16 lore raw

PATCH 10/25 Blackfin: re-architecture initcode

In reply to Mike Frysinger

The single initcode function was growing unwieldy, so split it up the distinct steps into their own function. This should making digesting the result much easier on people.

---
 cpu/blackfin/initcode.c |  221 ++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 169 insertions(+), 52 deletions(-)
cpu/blackfin/initcode.c +169 -52
index 90a5fc3..9b0cfbc 100644
@@ -9,6 +9,8 @@
  * Licensed under the GPL-2 or later.
  */
 
+#define BFIN_IN_INITCODE
+
 #include <config.h>
 #include <asm/blackfin.h>
 #include <asm/mach-common/bits/bootrom.h>
@@ -17,7 +19,6 @@
 #include <asm/mach-common/bits/pll.h>
 #include <asm/mach-common/bits/uart.h>
 
-#define BFIN_IN_INITCODE
 #include "serial.h"
 
 __attribute__((always_inline))
@@ -216,6 +217,7 @@ static inline void serial_putc(char c)
 # define CONFIG_HAS_VR 1
 #endif
 
+#if CONFIG_MEM_SIZE
 #ifndef EBIU_RSTCTL
 /* Blackfin with SDRAM */
 #ifndef CONFIG_EBIU_SDBCTL_VAL
@@ -248,6 +250,7 @@ static inline void serial_putc(char c)
 # define CONFIG_EBIU_SDBCTL_VAL (CONFIG_EBCAW_VAL | CONFIG_EBSZ_VAL | EBE)
 #endif
 #endif
+#endif
 
 /* Conflicting Column Address Widths Causes SDRAM Errors:
  * EB2CAW and EB3CAW must be the same
@@ -258,28 +261,21 @@ static inline void serial_putc(char c)
 # endif
 #endif
 
-BOOTROM_CALLED_FUNC_ATTR
-void initcode(ADI_BOOT_DATA *bootstruct)
+__attribute__((always_inline)) static inline void
+program_early_devices(ADI_BOOT_DATA *bootstruct, uint *sdivB, uint *divB, uint *vcoB)
 {
-	ADI_BOOT_DATA bootstruct_scratch;
+	serial_putc('a');
 
 	/* Save the clock pieces that are used in baud rate calculation */
-	unsigned int sdivB, divB, vcoB;
-	serial_init();
 	if (BFIN_DEBUG_EARLY_SERIAL || CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_UART) {
-		sdivB = bfin_read_PLL_DIV() & 0xf;
-		vcoB = (bfin_read_PLL_CTL() >> 9) & 0x3f;
-		divB = serial_early_get_div();
+		serial_putc('b');
+		*sdivB = bfin_read_PLL_DIV() & 0xf;
+		*vcoB = (bfin_read_PLL_CTL() >> 9) & 0x3f;
+		*divB = serial_early_get_div();
+		serial_putc('c');
 	}
 
-	serial_putc('A');
-
-	/* If the bootstruct is NULL, then it's because we're loading
-	 * dynamically and not via LDR (bootrom).  So set the struct to
-	 * some scratch space.
-	 */
-	if (!bootstruct)
-		bootstruct = &bootstruct_scratch;
+	serial_putc('d');
 
 #ifdef CONFIG_HW_WATCHDOG
 # ifndef CONFIG_HW_WATCHDOG_TIMEOUT_INITCODE
@@ -292,41 +288,69 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 	 * timeout, so don't clobber that.
 	 */
 	if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_BYPASS) {
+		serial_putc('e');
 		bfin_write_WDOG_CNT(MSEC_TO_SCLK(CONFIG_HW_WATCHDOG_TIMEOUT_INITCODE));
 		bfin_write_WDOG_CTL(0);
+		serial_putc('f');
 	}
 #endif
 
-	serial_putc('B');
+	serial_putc('g');
+
+	/* Blackfin bootroms use the SPI slow read opcode instead of the SPI
+	 * fast read, so we need to slow down the SPI clock a lot more during
+	 * boot.  Once we switch over to u-boot's SPI flash driver, we'll
+	 * increase the speed appropriately.
+	 */
+	if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER) {
+		serial_putc('h');
+		if (BOOTROM_SUPPORTS_SPI_FAST_READ && CONFIG_SPI_BAUD_INITBLOCK < 4)
+			bootstruct->dFlags |= BFLAG_FASTREAD;
+		bfin_write_SPI_BAUD(CONFIG_SPI_BAUD_INITBLOCK);
+		serial_putc('i');
+	}
+
+	serial_putc('j');
+}
+
+__attribute__((always_inline)) static inline bool
+maybe_self_refresh(ADI_BOOT_DATA *bootstruct)
+{
+	serial_putc('a');
+
+	if (!CONFIG_MEM_SIZE)
+		return false;
 
 	/* If external memory is enabled, put it into self refresh first. */
-	bool put_into_srfs = false;
 #ifdef EBIU_RSTCTL
 	if (bfin_read_EBIU_RSTCTL() & DDR_SRESET) {
+		serial_putc('b');
 		bfin_write_EBIU_RSTCTL(bfin_read_EBIU_RSTCTL() | SRREQ);
-		put_into_srfs = true;
+		return true;
 	}
 #else
 	if (bfin_read_EBIU_SDBCTL() & EBE) {
+		serial_putc('b');
 		bfin_write_EBIU_SDGCTL(bfin_read_EBIU_SDGCTL() | SRFS);
-		put_into_srfs = true;
+		return true;
 	}
 #endif
 
-	serial_putc('C');
+	serial_putc('c');
 
-	/* Blackfin bootroms use the SPI slow read opcode instead of the SPI
-	 * fast read, so we need to slow down the SPI clock a lot more during
-	 * boot.  Once we switch over to u-boot's SPI flash driver, we'll
-	 * increase the speed appropriately.
-	 */
-	if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER) {
-		if (BOOTROM_SUPPORTS_SPI_FAST_READ && CONFIG_SPI_BAUD_INITBLOCK < 4)
-			bootstruct->dFlags |= BFLAG_FASTREAD;
-		bfin_write_SPI_BAUD(CONFIG_SPI_BAUD_INITBLOCK);
-	}
+	return false;
+}
 
-	serial_putc('D');
+__attribute__((always_inline)) static inline u16
+program_clocks(ADI_BOOT_DATA *bootstruct, bool put_into_srfs)
+{
+	u16 vr_ctl;
+
+	serial_putc('a');
+
+	vr_ctl = bfin_read_VR_CTL();
+
+	serial_putc('b');
 
 	/* If we're entering self refresh, make sure it has happened. */
 	if (put_into_srfs)
@@ -337,15 +361,14 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 #endif
 			continue;
 
-	serial_putc('E');
+	serial_putc('c');
 
 	/* With newer bootroms, we use the helper function to set up
 	 * the memory controller.  Older bootroms lacks such helpers
 	 * so we do it ourselves.
 	 */
-	uint16_t vr_ctl = bfin_read_VR_CTL();
 	if (!ANOMALY_05000386) {
-		serial_putc('F');
+		serial_putc('d');
 
 		/* Always programming PLL_LOCKCNT avoids Anomaly 05000430 */
 		ADI_SYSCTRL_VALUES memory_settings;
@@ -365,7 +388,9 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 #if ANOMALY_05000432
 		bfin_write_SIC_IWR1(0);
 #endif
+		serial_putc('e');
 		bfrom_SysControl(actions, &memory_settings, NULL);
+		serial_putc('f');
 #if ANOMALY_05000432
 		bfin_write_SIC_IWR1(-1);
 #endif
@@ -373,8 +398,9 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 		bfin_write_SICA_IWR0(-1);
 		bfin_write_SICA_IWR1(-1);
 #endif
+		serial_putc('g');
 	} else {
-		serial_putc('G');
+		serial_putc('h');
 
 		/* Disable all peripheral wakeups except for the PLL event. */
 #ifdef SIC_IWR0
@@ -390,38 +416,40 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 		bfin_write_SIC_IWR(1);
 #endif
 
-		serial_putc('H');
+		serial_putc('i');
 
 		/* Always programming PLL_LOCKCNT avoids Anomaly 05000430 */
 		bfin_write_PLL_LOCKCNT(CONFIG_PLL_LOCKCNT_VAL);
 
-		serial_putc('I');
+		serial_putc('j');
 
 		/* Only reprogram when needed to avoid triggering unnecessary
 		 * PLL relock sequences.
 		 */
 		if (vr_ctl != CONFIG_VR_CTL_VAL) {
-			serial_putc('!');
+			serial_putc('?');
 			bfin_write_VR_CTL(CONFIG_VR_CTL_VAL);
 			asm("idle;");
+			serial_putc('!');
 		}
 
-		serial_putc('J');
+		serial_putc('k');
 
 		bfin_write_PLL_DIV(CONFIG_PLL_DIV_VAL);
 
-		serial_putc('K');
+		serial_putc('l');
 
 		/* Only reprogram when needed to avoid triggering unnecessary
 		 * PLL relock sequences.
 		 */
 		if (ANOMALY_05000242 || bfin_read_PLL_CTL() != CONFIG_PLL_CTL_VAL) {
-			serial_putc('!');
+			serial_putc('?');
 			bfin_write_PLL_CTL(CONFIG_PLL_CTL_VAL);
 			asm("idle;");
+			serial_putc('!');
 		}
 
-		serial_putc('L');
+		serial_putc('m');
 
 		/* Restore all peripheral wakeups. */
 #ifdef SIC_IWR0
@@ -436,9 +464,19 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 #else
 		bfin_write_SIC_IWR(-1);
 #endif
+
+		serial_putc('n');
 	}
 
-	serial_putc('M');
+	serial_putc('o');
+
+	return vr_ctl;
+}
+
+__attribute__((always_inline)) static inline void
+update_serial_clocks(ADI_BOOT_DATA *bootstruct, uint sdivB, uint divB, uint vcoB)
+{
+	serial_putc('a');
 
 	/* Since we've changed the SCLK above, we may need to update
 	 * the UART divisors (UART baud rates are based on SCLK).
@@ -446,6 +484,7 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 	 * for dividing which means we'd generate a libgcc reference.
 	 */
 	if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_UART) {
+		serial_putc('b');
 		unsigned int sdivR, vcoR;
 		sdivR = bfin_read_PLL_DIV() & 0xf;
 		vcoR = (bfin_read_PLL_CTL() >> 9) & 0x3f;
@@ -455,20 +494,38 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 		for (quotient = 0; dividend > 0; ++quotient)
 			dividend -= divisor;
 		serial_early_put_div(quotient - ANOMALY_05000230);
+		serial_putc('c');
 	}
 
-	serial_putc('N');
+	serial_putc('d');
+}
+
+__attribute__((always_inline)) static inline void
+program_memory_controller(ADI_BOOT_DATA *bootstruct, bool put_into_srfs)
+{
+	serial_putc('a');
+
+	if (!CONFIG_MEM_SIZE)
+		return;
+
+	serial_putc('b');
 
 	/* Program the external memory controller before we come out of
 	 * self-refresh.  This only works with our SDRAM controller.
 	 */
 #ifndef EBIU_RSTCTL
+# ifdef CONFIG_EBIU_SDRRC_VAL
 	bfin_write_EBIU_SDRRC(CONFIG_EBIU_SDRRC_VAL);
+# endif
+# ifdef CONFIG_EBIU_SDBCTL_VAL
 	bfin_write_EBIU_SDBCTL(CONFIG_EBIU_SDBCTL_VAL);
+# endif
+# ifdef CONFIG_EBIU_SDGCTL_VAL
 	bfin_write_EBIU_SDGCTL(CONFIG_EBIU_SDGCTL_VAL);
+# endif
 #endif
 
-	serial_putc('O');
+	serial_putc('c');
 
 	/* Now that we've reprogrammed, take things out of self refresh. */
 	if (put_into_srfs)
@@ -478,7 +535,7 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 		bfin_write_EBIU_SDGCTL(bfin_read_EBIU_SDGCTL() & ~(SRFS));
 #endif
 
-	serial_putc('P');
+	serial_putc('d');
 
 	/* Our DDR controller sucks and cannot be programmed while in
 	 * self-refresh.  So we have to pull it out before programming.
@@ -497,7 +554,18 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 # endif
 #endif
 
-	serial_putc('Q');
+	serial_putc('e');
+}
+
+__attribute__((always_inline)) static inline void
+check_hibernation(ADI_BOOT_DATA *bootstruct, u16 vr_ctl, bool put_into_srfs)
+{
+	serial_putc('a');
+
+	if (!CONFIG_MEM_SIZE)
+		return;
+
+	serial_putc('b');
 
 	/* Are we coming out of hibernate (suspend to memory) ?
 	 * The memory layout is:
@@ -511,7 +579,7 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 		uint32_t *hibernate_magic = 0;
 		__builtin_bfin_ssync(); /* make sure memory controller is done */
 		if (hibernate_magic[0] == 0xDEADBEEF) {
-			serial_putc('R');
+			serial_putc('c');
 			bfin_write_EVT15(hibernate_magic[1]);
 			bfin_write_IMASK(EVT_IVG15);
 			__asm__ __volatile__ (
@@ -528,15 +596,24 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 				: "p"(hibernate_magic), "d"(0x2000 /* jump.s 0 */)
 			);
 		}
+		serial_putc('d');
 	}
 
-	serial_putc('S');
+	serial_putc('e');
+}
+
+__attribute__((always_inline)) static inline void
+program_async_controller(ADI_BOOT_DATA *bootstruct)
+{
+	serial_putc('a');
 
 	/* Program the async banks controller. */
 	bfin_write_EBIU_AMBCTL0(CONFIG_EBIU_AMBCTL0_VAL);
 	bfin_write_EBIU_AMBCTL1(CONFIG_EBIU_AMBCTL1_VAL);
 	bfin_write_EBIU_AMGCTL(CONFIG_EBIU_AMGCTL_VAL);
 
+	serial_putc('b');
+
 #ifdef EBIU_MODE
 	/* Not all parts have these additional MMRs. */
 	bfin_write_EBIU_MBSCTL(CONFIG_EBIU_MBSCTL_VAL);
@@ -544,9 +621,49 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 	bfin_write_EBIU_FCTL(CONFIG_EBIU_FCTL_VAL);
 #endif
 
-	serial_putc('T');
+	serial_putc('c');
+}
+
+BOOTROM_CALLED_FUNC_ATTR
+void initcode(ADI_BOOT_DATA *bootstruct)
+{
+	ADI_BOOT_DATA bootstruct_scratch;
+
+	serial_init();
+
+	serial_putc('A');
+
+	/* If the bootstruct is NULL, then it's because we're loading
+	 * dynamically and not via LDR (bootrom).  So set the struct to
+	 * some scratch space.
+	 */
+	if (!bootstruct)
+		bootstruct = &bootstruct_scratch;
+
+	serial_putc('B');
+	bool put_into_srfs = maybe_self_refresh(bootstruct);
+
+	serial_putc('C');
+	uint sdivB, divB, vcoB;
+	program_early_devices(bootstruct, &sdivB, &divB, &vcoB);
+
+	serial_putc('D');
+	u16 vr_ctl = program_clocks(bootstruct, put_into_srfs);
+
+	serial_putc('E');
+	update_serial_clocks(bootstruct, sdivB, divB, vcoB);
+
+	serial_putc('F');
+	program_memory_controller(bootstruct, put_into_srfs);
+
+	serial_putc('G');
+	check_hibernation(bootstruct, vr_ctl, put_into_srfs);
+
+	serial_putc('H');
+	program_async_controller(bootstruct);
 
 #ifdef CONFIG_BFIN_BOOTROM_USES_EVT1
+	serial_putc('I');
 	/* tell the bootrom where our entry point is */
 	if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_BYPASS)
 		bfin_write_EVT1(CONFIG_SYS_MONITOR_BASE);
Signature · 1 line
1.6.5.5
#17 lore raw

PATCH 11/25 Blackfin: support boards with no external memory

In reply to Mike Frysinger
---
 cpu/blackfin/initcode.c       |   16 +++++++++++++++-
 cpu/blackfin/start.S          |    6 ++++++
 include/asm-blackfin/config.h |    9 +++++++--
 lib_blackfin/board.c          |   22 ++++++++++++----------
 lib_blackfin/u-boot.lds.S     |   21 ++++++++++++++-------
 5 files changed, 54 insertions(+), 20 deletions(-)
cpu/blackfin/initcode.c +15 -1
index 9b0cfbc..b99f70c 100644
@@ -541,10 +541,18 @@ program_memory_controller(ADI_BOOT_DATA *bootstruct, bool put_into_srfs)
 	 * self-refresh.  So we have to pull it out before programming.
 	 */
 #ifdef EBIU_RSTCTL
+# ifdef CONFIG_EBIU_RSTCTL_VAL
 	bfin_write_EBIU_RSTCTL(bfin_read_EBIU_RSTCTL() | 0x1 /*DDRSRESET*/ | CONFIG_EBIU_RSTCTL_VAL);
+# endif
+# ifdef CONFIG_EBIU_DDRCTL0_VAL
 	bfin_write_EBIU_DDRCTL0(CONFIG_EBIU_DDRCTL0_VAL);
+# endif
+# ifdef CONFIG_EBIU_DDRCTL1_VAL
 	bfin_write_EBIU_DDRCTL1(CONFIG_EBIU_DDRCTL1_VAL);
+# endif
+# ifdef CONFIG_EBIU_DDRCTL2_VAL
 	bfin_write_EBIU_DDRCTL2(CONFIG_EBIU_DDRCTL2_VAL);
+# endif
 # ifdef CONFIG_EBIU_DDRCTL3_VAL
 	/* default is disable, so don't need to force this */
 	bfin_write_EBIU_DDRCTL3(CONFIG_EBIU_DDRCTL3_VAL);
@@ -614,11 +622,17 @@ program_async_controller(ADI_BOOT_DATA *bootstruct)
 
 	serial_putc('b');
 
-#ifdef EBIU_MODE
 	/* Not all parts have these additional MMRs. */
+#ifdef EBIU_MODE
+# ifdef CONFIG_EBIU_MBSCTL_VAL
 	bfin_write_EBIU_MBSCTL(CONFIG_EBIU_MBSCTL_VAL);
+# endif
+# ifdef CONFIG_EBIU_MODE_VAL
 	bfin_write_EBIU_MODE(CONFIG_EBIU_MODE_VAL);
+# endif
+# ifdef CONFIG_EBIU_FCTL_VAL
 	bfin_write_EBIU_FCTL(CONFIG_EBIU_FCTL_VAL);
+# endif
 #endif
 
 	serial_putc('c');
cpu/blackfin/start.S +6 -0
index 44e2725..7a3abba 100644
@@ -95,6 +95,7 @@ ENTRY(_start)
 	/* Save RETX so we can pass it while booting Linux */
 	r7 = RETX;
 
+#if CONFIG_MEM_SIZE
 	/* Figure out where we are currently executing so that we can decide
 	 * how to best reprogram and relocate things.  We'll pass below:
 	 *  R4: load address of _start
@@ -131,6 +132,9 @@ ENTRY(_start)
 	r3.h = 0x2000;
 	cc = r5 < r3 (iu);
 	if cc jump .Ldma_and_reprogram;
+#else
+	r6 = 1 (x);	/* fake loaded_from_ldr = 1 */
+#endif
 	r0 = 0 (x);	/* set bootstruct to NULL */
 	call _initcode;
 	jump .Lprogrammed;
@@ -154,6 +158,7 @@ ENTRY(_start)
 .Lprogrammed:
 	serial_early_set_baud
 
+#if CONFIG_MEM_SIZE
 	/* Relocate from wherever we are (FLASH/RAM/etc...) to the hardcoded
 	 * monitor location in the end of RAM.  We know that memcpy() only
 	 * uses registers, so it is safe to call here.  Note that this only
@@ -166,6 +171,7 @@ ENTRY(_start)
 	r2.l = LO(CONFIG_SYS_MONITOR_LEN);
 	r2.h = HI(CONFIG_SYS_MONITOR_LEN);
 	call _memcpy_ASM;
+#endif
 
 	/* Initialize BSS section ... we know that memset() does not
 	 * use the BSS, so it is safe to call here.  The bootrom LDR
include/asm-blackfin/config.h +7 -2
index fbfd598..0ae838a 100644
@@ -92,7 +92,11 @@
 # define CONFIG_SYS_MAX_RAM_SIZE (CONFIG_MEM_SIZE * 1024 * 1024)
 #endif
 #ifndef CONFIG_SYS_MONITOR_BASE
-# define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_MAX_RAM_SIZE - CONFIG_SYS_MONITOR_LEN)
+# if CONFIG_SYS_MAX_RAM_SIZE
+#  define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_MAX_RAM_SIZE - CONFIG_SYS_MONITOR_LEN)
+# else
+#  define CONFIG_SYS_MONITOR_BASE 0
+# endif
 #endif
 #ifndef CONFIG_SYS_MALLOC_BASE
 # define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - CONFIG_SYS_MALLOC_LEN)
@@ -114,7 +118,8 @@
 #endif
 
 /* Check to make sure everything fits in external RAM */
-#if ((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) > CONFIG_SYS_MAX_RAM_SIZE)
+#if CONFIG_SYS_MAX_RAM_SIZE && \
+    ((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) > CONFIG_SYS_MAX_RAM_SIZE)
 # error Memory Map does not fit into configuration
 #endif
 
lib_blackfin/board.c +12 -10
index f6ff89b..b682beb 100644
@@ -132,17 +132,19 @@ void init_cplbtables(void)
 	dcplb_add(0xFF800000, L1_DMEMORY);
 	++i;
 
-	icplb_add(CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK, SDRAM_IKERNEL);
-	dcplb_add(CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK, SDRAM_DKERNEL);
-	++i;
-
-	/* If the monitor crosses a 4 meg boundary, we'll need
-	 * to lock two entries for it.
-	 */
-	if ((CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK) != ((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK)) {
-		icplb_add((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK, SDRAM_IKERNEL);
-		dcplb_add((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK, SDRAM_DKERNEL);
+	if (CONFIG_MEM_SIZE) {
+		icplb_add(CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK, SDRAM_IKERNEL);
+		dcplb_add(CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK, SDRAM_DKERNEL);
 		++i;
+
+		/* If the monitor crosses a 4 meg boundary, we'll need
+		 * to lock two entries for it.
+		 */
+		if ((CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK) != ((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK)) {
+			icplb_add((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK, SDRAM_IKERNEL);
+			dcplb_add((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK, SDRAM_DKERNEL);
+			++i;
+		}
 	}
 
 	icplb_add(0x20000000, SDRAM_INON_CHBL);
lib_blackfin/u-boot.lds.S +14 -7
index 8a9e8b1..deb94c9 100644
@@ -57,7 +57,14 @@ OUTPUT_ARCH(bfin)
 
 MEMORY
 {
+#if CONFIG_MEM_SIZE
 	ram     : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
+# define ram_code ram
+# define ram_data ram
+#else
+# define ram_code l1_code
+# define ram_data l1_data
+#endif
 	l1_code : ORIGIN = L1_CODE_ORIGIN,          LENGTH = L1_INST_SRAM_SIZE
 	l1_data : ORIGIN = L1_DATA_B_SRAM,          LENGTH = L1_DATA_B_SRAM_SIZE
 }
@@ -82,7 +89,7 @@ SECTIONS
 	.text :
 	{
 		*(.text .text.*)
-	} >ram
+	} >ram_code
 
 	.rodata :
 	{
@@ -91,7 +98,7 @@ SECTIONS
 		*(.rodata1)
 		*(.eh_frame)
 		. = ALIGN(4);
-	} >ram
+	} >ram_data
 
 	.data :
 	{
@@ -102,14 +109,14 @@ SECTIONS
 		*(.sdata2)
 		*(.dynamic)
 		CONSTRUCTORS
-	} >ram
+	} >ram_data
 
 	.u_boot_cmd :
 	{
 		___u_boot_cmd_start = .;
 		*(.u_boot_cmd)
 		___u_boot_cmd_end = .;
-	} >ram
+	} >ram_data
 
 	.text_l1 :
 	{
@@ -118,7 +125,7 @@ SECTIONS
 		*(.l1.text)
 		. = ALIGN(4);
 		__etext_l1 = .;
-	} >l1_code AT>ram
+	} >l1_code AT>ram_code
 	__text_l1_lma = LOADADDR(.text_l1);
 	__text_l1_len = SIZEOF(.text_l1);
 	ASSERT (__text_l1_len <= L1_INST_SRAM_SIZE, "L1 text overflow!")
@@ -131,7 +138,7 @@ SECTIONS
 		*(.l1.bss)
 		. = ALIGN(4);
 		__edata_l1 = .;
-	} >l1_data AT>ram
+	} >l1_data AT>ram_data
 	__data_l1_lma = LOADADDR(.data_l1);
 	__data_l1_len = SIZEOF(.data_l1);
 	ASSERT (__data_l1_len <= L1_DATA_B_SRAM_SIZE, "L1 data B overflow!")
@@ -143,7 +150,7 @@ SECTIONS
 		*(.dynbss)
 		*(.bss .bss.*)
 		*(COMMON)
-	} >ram
+	} >ram_data
 	__bss_vma = ADDR(.bss);
 	__bss_len = SIZEOF(.bss);
 }
Signature · 1 line
1.6.5.5
#18 lore raw

PATCH 11/25 Blackfin: support boards with no external memory

Dear Mike Frysinger,

Quoted 19 lines · In message <[email protected]> you wrote:
---
 cpu/blackfin/initcode.c       |   16 +++++++++++++++-
 cpu/blackfin/start.S          |    6 ++++++
 include/asm-blackfin/config.h |    9 +++++++--
 lib_blackfin/board.c          |   22 ++++++++++++----------
 lib_blackfin/u-boot.lds.S     |   21 ++++++++++++++-------
 5 files changed, 54 insertions(+), 20 deletions(-)
cpu/blackfin/initcode.c +1 -0
index 9b0cfbc..b99f70c 100644
@@ -541,10 +541,18 @@ program_memory_controller(ADI_BOOT_DATA *bootstruct, bool put_into_srfs)
 	 * self-refresh.  So we have to pull it out before programming.
 	 */
 #ifdef EBIU_RSTCTL
+# ifdef CONFIG_EBIU_RSTCTL_VAL
 	bfin_write_EBIU_RSTCTL(bfin_read_EBIU_RSTCTL() | 0x1 /*DDRSRESET*/ | CONFIG_EBIU_RSTCTL_VAL);

...

Quoted 1 line

+# define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_MAX_RAM_SIZE - CONFIG_SYS_MONITOR_LEN)

...

cpu/blackfin/initcode.c

Quoted 4 lines
cpu/blackfin/initcode.c +4 -0
+		if ((CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK) != ((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK)) {
+			icplb_add((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK, SDRAM_IKERNEL);
+			dcplb_add((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK, SDRAM_DKERNEL);
+			++i;

Lines too log, please fix globally.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The combination of a number of things to make existence worthwhile."
"Yes, the philosophy of 'none,' meaning 'all.'"
	-- Spock and Lincoln, "The Savage Curtain", stardate 5906.4
#19 lore raw

PATCH 12/25 Blackfin: bf527-ezkit: auto-select NAND settings

In reply to Mike Frysinger

While we're here, let the Blackfin NAND driver auto-select CMD_NAND.

---
 include/configs/bf527-ezkit.h     |   11 ++++++++---
 include/configs/bf548-ezkit.h     |    1 -
 include/configs/bfin_adi_common.h |    2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)
include/configs/bf527-ezkit.h +8 -3
index 5f3cb83..c7322b8 100644
@@ -61,7 +61,8 @@
  * (can't be used same time as ethernet)
  */
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_NAND)
-#define CONFIG_BFIN_NFC
+# define CONFIG_BFIN_NFC
+# define CONFIG_BFIN_NFC_BOOTROM_ECC
 #endif
 #ifdef CONFIG_BFIN_NFC
 #define CONFIG_BFIN_NFC_CTL_VAL	0x0033
@@ -69,7 +70,6 @@
 #define CONFIG_SYS_NAND_BASE		0 /* not actually used */
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 #define NAND_MAX_CHIPS		1
-#define CONFIG_CMD_NAND
 #endif
 
 
@@ -118,14 +118,19 @@
 #define CONFIG_ENV_OFFSET	0x10000
 #define CONFIG_ENV_SIZE		0x2000
 #define CONFIG_ENV_SECT_SIZE	0x10000
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
+#elif (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_NAND)
+#define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET	0x40000
+#define CONFIG_ENV_SIZE		0x20000
 #else
 #define CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_ENV_OFFSET	0x4000
 #define CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET)
 #define CONFIG_ENV_SIZE		0x2000
 #define CONFIG_ENV_SECT_SIZE	0x2000
-#endif
 #define CONFIG_ENV_IS_EMBEDDED_IN_LDR
+#endif
 
 
 /*
include/configs/bf548-ezkit.h +0 -1
index d0a9e49..297c3fd 100644
@@ -133,7 +133,6 @@
 #define CONFIG_SYS_NAND_BASE		0 /* not actually used */
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 #define NAND_MAX_CHIPS		1
-#define CONFIG_CMD_NAND
 
 
 /*
include/configs/bfin_adi_common.h +1 -1
index 42f4cbc..db10ccc 100644
@@ -45,7 +45,7 @@
 #  define CONFIG_CMD_USB_STORAGE
 #  define CONFIG_DOS_PARTITION
 # endif
-# ifdef CONFIG_NAND_PLAT
+# if defined(CONFIG_NAND_PLAT) || defined(CONFIG_DRIVER_NAND_BFIN)
 #  define CONFIG_CMD_NAND
 # endif
 # ifdef CONFIG_POST
Signature · 1 line
1.6.5.5
#20 lore raw

PATCH 13/25 Blackfin: fix L1 Instruction sizes on BF52x/BF54x

In reply to Mike Frysinger

Unify the duplicated macros at the same time.

---
 include/asm-blackfin/blackfin_local.h       |    2 ++
 include/asm-blackfin/mach-bf527/BF522_def.h |   15 ---------------
 include/asm-blackfin/mach-bf527/BF523_def.h |   15 ---------------
 include/asm-blackfin/mach-bf527/BF524_def.h |   15 ---------------
 include/asm-blackfin/mach-bf527/BF525_def.h |   15 ---------------
 include/asm-blackfin/mach-bf527/BF526_def.h |   15 ---------------
 include/asm-blackfin/mach-bf527/BF527_def.h |   15 ---------------
 include/asm-blackfin/mach-bf527/def_local.h |    1 +
 include/asm-blackfin/mach-bf527/mem_map.h   |   21 +++++++++++++++++++++
 include/asm-blackfin/mach-bf548/BF542_def.h |   15 ---------------
 include/asm-blackfin/mach-bf548/BF544_def.h |   15 ---------------
 include/asm-blackfin/mach-bf548/BF547_def.h |    9 ---------
 include/asm-blackfin/mach-bf548/BF548_def.h |   15 ---------------
 include/asm-blackfin/mach-bf548/BF549_def.h |   15 ---------------
 include/asm-blackfin/mach-bf548/def_local.h |    1 +
 include/asm-blackfin/mach-bf548/mem_map.h   |   21 +++++++++++++++++++++
 include/asm-blackfin/mem_map.h              |   26 ++++++++++++++++++++++++++
 17 files changed, 72 insertions(+), 159 deletions(-)
 create mode 100644 include/asm-blackfin/mach-bf527/mem_map.h
 create mode 100644 include/asm-blackfin/mach-bf548/mem_map.h
 create mode 100644 include/asm-blackfin/mem_map.h
include/asm-blackfin/blackfin_local.h +2 -0
index 8ec7928..308014a 100644
@@ -25,6 +25,8 @@
 #ifndef __BLACKFIN_LOCAL_H__
 #define __BLACKFIN_LOCAL_H__
 
+#include <asm/mem_map.h>
+
 #define LO(con32) ((con32) & 0xFFFF)
 #define lo(con32) ((con32) & 0xFFFF)
 #define HI(con32) (((con32) >> 16) & 0xFFFF)
include/asm-blackfin/mach-bf527/BF522_def.h +0 -15
index 44143ba..bc05029 100644
@@ -119,20 +119,5 @@
 #define TPERIOD                        0xFFE03004 /* Core Timer Period Register */
 #define TSCALE                         0xFFE03008 /* Core Timer Scale Register */
 #define TCOUNT                         0xFFE0300C /* Core Timer Count Register */
-#define L1_DATA_A_SRAM 0xFF800000 /* 0xFF800000 -> 0xFF803FFF Data Bank A SRAM */
-#define L1_DATA_A_SRAM_SIZE (0xFF803FFF - 0xFF800000 + 1)
-#define L1_DATA_A_SRAM_END (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
-#define L1_DATA_B_SRAM 0xFF900000 /* 0xFF900000 -> 0xFF903FFF Data Bank B SRAM */
-#define L1_DATA_B_SRAM_SIZE (0xFF903FFF - 0xFF900000 + 1)
-#define L1_DATA_B_SRAM_END (L1_DATA_B_SRAM + L1_DATA_B_SRAM_SIZE)
-#define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
-#define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
-#define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF522_proc__ */
include/asm-blackfin/mach-bf527/BF523_def.h +0 -15
index 02675a9..c27fd64 100644
@@ -119,20 +119,5 @@
 #define TPERIOD                        0xFFE03004 /* Core Timer Period Register */
 #define TSCALE                         0xFFE03008 /* Core Timer Scale Register */
 #define TCOUNT                         0xFFE0300C /* Core Timer Count Register */
-#define L1_DATA_A_SRAM 0xFF800000 /* 0xFF800000 -> 0xFF803FFF Data Bank A SRAM */
-#define L1_DATA_A_SRAM_SIZE (0xFF803FFF - 0xFF800000 + 1)
-#define L1_DATA_A_SRAM_END (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
-#define L1_DATA_B_SRAM 0xFF900000 /* 0xFF900000 -> 0xFF903FFF Data Bank B SRAM */
-#define L1_DATA_B_SRAM_SIZE (0xFF903FFF - 0xFF900000 + 1)
-#define L1_DATA_B_SRAM_END (L1_DATA_B_SRAM + L1_DATA_B_SRAM_SIZE)
-#define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
-#define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
-#define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF523_proc__ */
include/asm-blackfin/mach-bf527/BF524_def.h +0 -15
index 10793e8..bd6aa8f 100644
@@ -288,20 +288,5 @@
 #define USB_DMA7_ADDRHIGH              0xFFC03CEC /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
 #define USB_DMA7_COUNTLOW              0xFFC03CF0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
 #define USB_DMA7_COUNTHIGH             0xFFC03CF4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
-#define L1_DATA_A_SRAM 0xFF800000 /* 0xFF800000 -> 0xFF803FFF Data Bank A SRAM */
-#define L1_DATA_A_SRAM_SIZE (0xFF803FFF - 0xFF800000 + 1)
-#define L1_DATA_A_SRAM_END (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
-#define L1_DATA_B_SRAM 0xFF900000 /* 0xFF900000 -> 0xFF903FFF Data Bank B SRAM */
-#define L1_DATA_B_SRAM_SIZE (0xFF903FFF - 0xFF900000 + 1)
-#define L1_DATA_B_SRAM_END (L1_DATA_B_SRAM + L1_DATA_B_SRAM_SIZE)
-#define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
-#define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
-#define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF524_proc__ */
include/asm-blackfin/mach-bf527/BF525_def.h +0 -15
index c4c2f2f..5e88b3b 100644
@@ -288,20 +288,5 @@
 #define USB_DMA7_ADDRHIGH              0xFFC03CEC /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
 #define USB_DMA7_COUNTLOW              0xFFC03CF0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
 #define USB_DMA7_COUNTHIGH             0xFFC03CF4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
-#define L1_DATA_A_SRAM 0xFF800000 /* 0xFF800000 -> 0xFF803FFF Data Bank A SRAM */
-#define L1_DATA_A_SRAM_SIZE (0xFF803FFF - 0xFF800000 + 1)
-#define L1_DATA_A_SRAM_END (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
-#define L1_DATA_B_SRAM 0xFF900000 /* 0xFF900000 -> 0xFF903FFF Data Bank B SRAM */
-#define L1_DATA_B_SRAM_SIZE (0xFF903FFF - 0xFF900000 + 1)
-#define L1_DATA_B_SRAM_END (L1_DATA_B_SRAM + L1_DATA_B_SRAM_SIZE)
-#define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
-#define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
-#define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF525_proc__ */
include/asm-blackfin/mach-bf527/BF526_def.h +0 -15
index 04db6c7..2644abf 100644
@@ -367,20 +367,5 @@
 #define USB_DMA7_ADDRHIGH              0xFFC03CEC /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
 #define USB_DMA7_COUNTLOW              0xFFC03CF0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
 #define USB_DMA7_COUNTHIGH             0xFFC03CF4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
-#define L1_DATA_A_SRAM 0xFF800000 /* 0xFF800000 -> 0xFF803FFF Data Bank A SRAM */
-#define L1_DATA_A_SRAM_SIZE (0xFF803FFF - 0xFF800000 + 1)
-#define L1_DATA_A_SRAM_END (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
-#define L1_DATA_B_SRAM 0xFF900000 /* 0xFF900000 -> 0xFF903FFF Data Bank B SRAM */
-#define L1_DATA_B_SRAM_SIZE (0xFF903FFF - 0xFF900000 + 1)
-#define L1_DATA_B_SRAM_END (L1_DATA_B_SRAM + L1_DATA_B_SRAM_SIZE)
-#define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
-#define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
-#define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF526_proc__ */
include/asm-blackfin/mach-bf527/BF527_def.h +0 -15
index c1e1aab..c46c2b0 100644
@@ -367,20 +367,5 @@
 #define USB_DMA7_ADDRHIGH              0xFFC03CEC /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
 #define USB_DMA7_COUNTLOW              0xFFC03CF0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
 #define USB_DMA7_COUNTHIGH             0xFFC03CF4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
-#define L1_DATA_A_SRAM 0xFF800000 /* 0xFF800000 -> 0xFF803FFF Data Bank A SRAM */
-#define L1_DATA_A_SRAM_SIZE (0xFF803FFF - 0xFF800000 + 1)
-#define L1_DATA_A_SRAM_END (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
-#define L1_DATA_B_SRAM 0xFF900000 /* 0xFF900000 -> 0xFF903FFF Data Bank B SRAM */
-#define L1_DATA_B_SRAM_SIZE (0xFF903FFF - 0xFF900000 + 1)
-#define L1_DATA_B_SRAM_END (L1_DATA_B_SRAM + L1_DATA_B_SRAM_SIZE)
-#define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
-#define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
-#define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF527_proc__ */
include/asm-blackfin/mach-bf527/def_local.h +1 -0
index 14c111f..81eca83 100644
@@ -1 +1,2 @@
+#include "mem_map.h"
 #include "ports.h"
include/asm-blackfin/mach-bf527/mem_map.h new file +21 -0
new file mode 100644
index 0000000..8386b4b
@@ -0,0 +1,21 @@
+/*
+ * Common Blackfin memory map
+ *
+ * Copyright 2004-2009 Analog Devices Inc.
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef __BF52X_MEM_MAP_H__
+#define __BF52X_MEM_MAP_H__
+
+#define L1_DATA_A_SRAM      (0xFF800000)
+#define L1_DATA_A_SRAM_SIZE (0x4000)
+#define L1_DATA_A_SRAM_END  (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
+#define L1_DATA_B_SRAM      (0xFF900000)
+#define L1_DATA_B_SRAM_SIZE (0x4000)
+#define L1_DATA_B_SRAM_END  (L1_DATA_B_SRAM + L1_DATA_B_SRAM_SIZE)
+#define L1_INST_SRAM        (0xFFA00000)
+#define L1_INST_SRAM_SIZE   (0xC000)
+#define L1_INST_SRAM_END    (L1_INST_SRAM + L1_INST_SRAM_SIZE)
+
+#endif
include/asm-blackfin/mach-bf548/BF542_def.h +0 -15
index 40fe555..1324a13 100644
@@ -113,20 +113,5 @@
 #define TBUFCTL                        0xFFE06000 /* Trace Buffer Control Register */
 #define TBUFSTAT                       0xFFE06004 /* Trace Buffer Status Register */
 #define TBUF                           0xFFE06100 /* Trace Buffer */
-#define L1_DATA_A_SRAM 0xFF800000 /* 0xFF800000 -> 0xFF803FFF Data Bank A SRAM */
-#define L1_DATA_A_SRAM_SIZE (0xFF803FFF - 0xFF800000 + 1)
-#define L1_DATA_A_SRAM_END (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
-#define L1_DATA_B_SRAM 0xFF900000 /* 0xFF900000 -> 0xFF903FFF Data Bank B SRAM */
-#define L1_DATA_B_SRAM_SIZE (0xFF903FFF - 0xFF900000 + 1)
-#define L1_DATA_B_SRAM_END (L1_DATA_B_SRAM + L1_DATA_B_SRAM_SIZE)
-#define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
-#define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
-#define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF542_proc__ */
include/asm-blackfin/mach-bf548/BF544_def.h +0 -15
index 042e2ac..aef6e48 100644
@@ -113,20 +113,5 @@
 #define TBUFCTL                        0xFFE06000 /* Trace Buffer Control Register */
 #define TBUFSTAT                       0xFFE06004 /* Trace Buffer Status Register */
 #define TBUF                           0xFFE06100 /* Trace Buffer */
-#define L1_DATA_A_SRAM 0xFF800000 /* 0xFF800000 -> 0xFF803FFF Data Bank A SRAM */
-#define L1_DATA_A_SRAM_SIZE (0xFF803FFF - 0xFF800000 + 1)
-#define L1_DATA_A_SRAM_END (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
-#define L1_DATA_B_SRAM 0xFF900000 /* 0xFF900000 -> 0xFF903FFF Data Bank B SRAM */
-#define L1_DATA_B_SRAM_SIZE (0xFF903FFF - 0xFF900000 + 1)
-#define L1_DATA_B_SRAM_END (L1_DATA_B_SRAM + L1_DATA_B_SRAM_SIZE)
-#define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
-#define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
-#define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF544_proc__ */
include/asm-blackfin/mach-bf548/BF547_def.h +0 -9
index 1cb3381..ce7c880 100644
@@ -113,14 +113,5 @@
 #define TBUFCTL                        0xFFE06000 /* Trace Buffer Control Register */
 #define TBUFSTAT                       0xFFE06004 /* Trace Buffer Status Register */
 #define TBUF                           0xFFE06100 /* Trace Buffer */
-#define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
-#define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
-#define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF547_proc__ */
include/asm-blackfin/mach-bf548/BF548_def.h +0 -15
index 950ce43..e02e843 100644
@@ -113,20 +113,5 @@
 #define TBUFCTL                        0xFFE06000 /* Trace Buffer Control Register */
 #define TBUFSTAT                       0xFFE06004 /* Trace Buffer Status Register */
 #define TBUF                           0xFFE06100 /* Trace Buffer */
-#define L1_DATA_A_SRAM 0xFF800000 /* 0xFF800000 -> 0xFF803FFF Data Bank A SRAM */
-#define L1_DATA_A_SRAM_SIZE (0xFF803FFF - 0xFF800000 + 1)
-#define L1_DATA_A_SRAM_END (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
-#define L1_DATA_B_SRAM 0xFF900000 /* 0xFF900000 -> 0xFF903FFF Data Bank B SRAM */
-#define L1_DATA_B_SRAM_SIZE (0xFF903FFF - 0xFF900000 + 1)
-#define L1_DATA_B_SRAM_END (L1_DATA_B_SRAM + L1_DATA_B_SRAM_SIZE)
-#define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
-#define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
-#define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF548_proc__ */
include/asm-blackfin/mach-bf548/BF549_def.h +0 -15
index 55b0a29..a16ff5a 100644
@@ -113,20 +113,5 @@
 #define TBUFCTL                        0xFFE06000 /* Trace Buffer Control Register */
 #define TBUFSTAT                       0xFFE06004 /* Trace Buffer Status Register */
 #define TBUF                           0xFFE06100 /* Trace Buffer */
-#define L1_DATA_A_SRAM 0xFF800000 /* 0xFF800000 -> 0xFF803FFF Data Bank A SRAM */
-#define L1_DATA_A_SRAM_SIZE (0xFF803FFF - 0xFF800000 + 1)
-#define L1_DATA_A_SRAM_END (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
-#define L1_DATA_B_SRAM 0xFF900000 /* 0xFF900000 -> 0xFF903FFF Data Bank B SRAM */
-#define L1_DATA_B_SRAM_SIZE (0xFF903FFF - 0xFF900000 + 1)
-#define L1_DATA_B_SRAM_END (L1_DATA_B_SRAM + L1_DATA_B_SRAM_SIZE)
-#define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA07FFF Instruction Bank A SRAM */
-#define L1_INST_SRAM_SIZE (0xFFA07FFF - 0xFFA00000 + 1)
-#define L1_INST_SRAM_END (L1_INST_SRAM + L1_INST_SRAM_SIZE)
-#define L1_SRAM_SCRATCH 0xFFB00000 /* 0xFFB00000 -> 0xFFB00FFF Scratchpad SRAM */
-#define L1_SRAM_SCRATCH_SIZE (0xFFB00FFF - 0xFFB00000 + 1)
-#define L1_SRAM_SCRATCH_END (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
-#define SYSMMR_BASE 0xFFC00000 /* 0xFFC00000 -> 0xFFFFFFFF MMR registers */
-#define SYSMMR_BASE_SIZE (0xFFFFFFFF - 0xFFC00000 + 1)
-#define SYSMMR_BASE_END (SYSMMR_BASE + SYSMMR_BASE_SIZE)
 
 #endif /* __BFIN_DEF_ADSP_BF549_proc__ */
include/asm-blackfin/mach-bf548/def_local.h +1 -0
index 14c111f..81eca83 100644
@@ -1 +1,2 @@
+#include "mem_map.h"
 #include "ports.h"
include/asm-blackfin/mach-bf548/mem_map.h new file +21 -0
new file mode 100644
index 0000000..4f94397
@@ -0,0 +1,21 @@
+/*
+ * Common Blackfin memory map
+ *
+ * Copyright 2004-2009 Analog Devices Inc.
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef __BF54X_MEM_MAP_H__
+#define __BF54X_MEM_MAP_H__
+
+#define L1_DATA_A_SRAM      (0xFF800000)
+#define L1_DATA_A_SRAM_SIZE (0x4000)
+#define L1_DATA_A_SRAM_END  (L1_DATA_A_SRAM + L1_DATA_A_SRAM_SIZE)
+#define L1_DATA_B_SRAM      (0xFF900000)
+#define L1_DATA_B_SRAM_SIZE (0x4000)
+#define L1_DATA_B_SRAM_END  (L1_DATA_B_SRAM + L1_DATA_B_SRAM_SIZE)
+#define L1_INST_SRAM        (0xFFA00000)
+#define L1_INST_SRAM_SIZE   (0xC000)
+#define L1_INST_SRAM_END    (L1_INST_SRAM + L1_INST_SRAM_SIZE)
+
+#endif
include/asm-blackfin/mem_map.h new file +26 -0
new file mode 100644
index 0000000..3e361d6
@@ -0,0 +1,26 @@
+/*
+ * Common Blackfin memory map
+ *
+ * Copyright 2004-2009 Analog Devices Inc.
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef __BFIN_MEM_MAP_H__
+#define __BFIN_MEM_MAP_H__
+
+/* Every Blackfin so far has MMRs like this */
+#ifndef COREMMR_BASE
+# define COREMMR_BASE 0xFFE00000
+#endif
+#ifndef SYSMMR_BASE
+# define SYSMMR_BASE  0xFFC00000
+#endif
+
+/* Every Blackfin so far has on-chip Scratch Pad SRAM like this */
+#ifndef L1_SRAM_SCRATCH
+# define L1_SRAM_SCRATCH      0xFFB00000
+# define L1_SRAM_SCRATCH_SIZE 0x1000
+# define L1_SRAM_SCRATCH_END  (L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE)
+#endif
+
+#endif
Signature · 1 line
1.6.5.5
#21 lore raw

PATCH 14/25 Blackfin: move watchdog config check to Makefile

In reply to Mike Frysinger
---
 cpu/blackfin/Makefile   |    2 +-
 cpu/blackfin/watchdog.c |    4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)
cpu/blackfin/Makefile +1 -1
index 5eef6a3..211b8d5 100644
@@ -24,7 +24,7 @@ COBJS-y  += os_log.o
 COBJS-y  += reset.o
 COBJS-y  += serial.o
 COBJS-y  += traps.o
-COBJS-y  += watchdog.o
+COBJS-$(CONFIG_HW_WATCHDOG)  += watchdog.o
 
 ifeq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
 COBJS-y  += initcode.o
cpu/blackfin/watchdog.c +1 -3
index b47c6b6..1886bda 100644
@@ -1,7 +1,7 @@
 /*
  * watchdog.c - driver for Blackfin on-chip watchdog
  *
- * Copyright (c) 2007-2008 Analog Devices Inc.
+ * Copyright (c) 2007-2009 Analog Devices Inc.
  *
  * Licensed under the GPL-2 or later.
  */
@@ -10,7 +10,6 @@
 #include <watchdog.h>
 #include <asm/blackfin.h>
 
-#ifdef CONFIG_HW_WATCHDOG
 void hw_watchdog_reset(void)
 {
 	bfin_write_WDOG_STAT(0);
@@ -22,4 +21,3 @@ void hw_watchdog_init(void)
 	hw_watchdog_reset();
 	bfin_write_WDOG_CTL(0x0);
 }
-#endif
Signature · 1 line
1.6.5.5
#22 lore raw

PATCH 15/25 Blackfin: use new bfin read/write mmr helper funcs

In reply to Mike Frysinger
---
 cpu/blackfin/initcode.c               |   10 ++--
 cpu/blackfin/interrupts.c             |   12 ++--
 cpu/blackfin/serial.c                 |   20 ++---
 cpu/blackfin/serial.h                 |  119 +++++++++++++++++---------------
 include/asm-blackfin/blackfin_local.h |    2 +-
 5 files changed, 83 insertions(+), 80 deletions(-)
cpu/blackfin/initcode.c +5 -5
index b99f70c..a97664c 100644
@@ -34,7 +34,7 @@ static inline void serial_init(void)
 		size_t i;
 
 		/* force RTS rather than relying on auto RTS */
-		bfin_write_UART1_MCR(bfin_read_UART1_MCR() | FCPOL);
+		bfin_write16(&pUART->mcr, bfin_read16(&pUART->mcr) | FCPOL);
 
 		/* Wait for the line to clear up.  We cannot rely on UART
 		 * registers as none of them reflect the status of the RSR.
@@ -64,7 +64,7 @@ static inline void serial_init(void)
 #endif
 
 	if (BFIN_DEBUG_EARLY_SERIAL) {
-		int ucen = *pUART_GCTL & UCEN;
+		int ucen = bfin_read16(&pUART->gctl) & UCEN;
 		serial_early_init();
 
 #ifndef CONFIG_BAUDRATE
@@ -84,7 +84,7 @@ static inline void serial_deinit(void)
 #ifdef __ADSPBF54x__
 	if (BFIN_UART_USE_RTS && CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_UART) {
 		/* clear forced RTS rather than relying on auto RTS */
-		bfin_write_UART1_MCR(bfin_read_UART1_MCR() & ~FCPOL);
+		bfin_write16(&pUART->mcr, bfin_read16(&pUART->mcr) & ~FCPOL);
 	}
 #endif
 }
@@ -98,9 +98,9 @@ static inline void serial_putc(char c)
 	if (c == '\n')
 		serial_putc('\r');
 
-	*pUART_THR = c;
+	bfin_write16(&pUART->thr, c);
 
-	while (!(*pUART_LSR & TEMT))
+	while (!(bfin_read16(&pUART->lsr) & TEMT))
 		continue;
 }
 
cpu/blackfin/interrupts.c +6 -6
index 921bfe0..54a67b4 100644
@@ -97,12 +97,12 @@ void __udelay(unsigned long usec)
 #define MAX_TIM_LOAD	0xFFFFFFFF
 int timer_init(void)
 {
-	*pTCNTL = 0x1;
+	bfin_write_TCNTL(0x1);
 	CSYNC();
-	*pTSCALE = 0x0;
-	*pTCOUNT = MAX_TIM_LOAD;
-	*pTPERIOD = MAX_TIM_LOAD;
-	*pTCNTL = 0x7;
+	bfin_write_TSCALE(0x0);
+	bfin_write_TCOUNT(MAX_TIM_LOAD);
+	bfin_write_TPERIOD(MAX_TIM_LOAD);
+	bfin_write_TCNTL(0x7);
 	CSYNC();
 
 	timestamp = 0;
@@ -130,7 +130,7 @@ ulong get_timer(ulong base)
 	ulong milisec;
 
 	/* Number of clocks elapsed */
-	ulong clocks = (MAX_TIM_LOAD - (*pTCOUNT));
+	ulong clocks = (MAX_TIM_LOAD - bfin_read_TCOUNT());
 
 	/*
 	 * Find if the TCOUNT is reset
cpu/blackfin/serial.c +8 -12
index 2abda18..db12a5a 100644
@@ -44,10 +44,6 @@
 
 #ifdef CONFIG_UART_CONSOLE
 
-#if defined(UART_LSR) && (CONFIG_UART_CONSOLE != 0)
-# error CONFIG_UART_CONSOLE must be 0 on parts with only one UART
-#endif
-
 #include "serial.h"
 
 #ifdef CONFIG_DEBUG_SERIAL
@@ -63,7 +59,7 @@ size_t cache_count;
 static uint16_t uart_lsr_save;
 static uint16_t uart_lsr_read(void)
 {
-	uint16_t lsr = *pUART_LSR;
+	uint16_t lsr = bfin_read16(&pUART->lsr);
 	uart_lsr_save |= (lsr & (OE|PE|FE|BI));
 	return lsr | uart_lsr_save;
 }
@@ -71,15 +67,15 @@ static uint16_t uart_lsr_read(void)
 static void uart_lsr_clear(void)
 {
 	uart_lsr_save = 0;
-	*pUART_LSR |= -1;
+	bfin_write16(&pUART->lsr, bfin_read16(&pUART->lsr) | -1);
 }
 #else
 /* When debugging is disabled, we only care about the DR bit, so if other
  * bits get set/cleared, we don't really care since we don't read them
  * anyways (and thus anomaly 05000099 is irrelevant).
  */
-static inline uint16_t uart_lsr_read(void) { return *pUART_LSR; }
-static inline void uart_lsr_clear(void) { *pUART_LSR = -1; }
+static uint16_t uart_lsr_read(void) { return bfin_read16(&pUART->lsr); }
+static void uart_lsr_clear(void) { bfin_write16(&pUART->lsr, bfin_read16(&pUART->lsr) | -1); }
 #endif
 
 /* Symbol for our assembly to call. */
@@ -130,7 +126,7 @@ void serial_putc(const char c)
 		continue;
 
 	/* queue the character for transmission */
-	*pUART_THR = c;
+	bfin_write16(&pUART->thr, c);
 	SSYNC();
 
 	WATCHDOG_RESET();
@@ -151,7 +147,7 @@ int serial_getc(void)
 		continue;
 
 	/* grab the new byte */
-	uart_rbr_val = *pUART_RBR;
+	uart_rbr_val = bfin_read16(&pUART->rbr);
 
 #ifdef CONFIG_DEBUG_SERIAL
 	/* grab & clear the LSR */
@@ -165,8 +161,8 @@ int serial_getc(void)
 		uint16_t dll, dlh;
 		printf("\n[SERIAL ERROR]\n");
 		ACCESS_LATCH();
-		dll = *pUART_DLL;
-		dlh = *pUART_DLH;
+		dll = bfin_read16(&pUART->dll);
+		dlh = bfin_read16(&pUART->dlh);
 		ACCESS_PORT_IER();
 		printf("\tDLL=0x%x DLH=0x%x\n", dll, dlh);
 		do {
cpu/blackfin/serial.h +63 -56

160 lines not on this page · raw message

include/asm-blackfin/blackfin_local.h +1 -1
index 308014a..3fd34b3 100644
@@ -61,7 +61,7 @@ extern u_long get_vco(void);
 extern u_long get_cclk(void);
 extern u_long get_sclk(void);
 
-# define bfin_revid() (*pCHIPID >> 28)
+# define bfin_revid() (bfin_read_CHIPID() >> 28)
 
 extern bool bfin_os_log_check(void);
 extern void bfin_os_log_dump(void);
Signature · 1 line
1.6.5.5
#23 lore raw

PATCH 15/25 Blackfin: use new bfin read/write mmr helper funcs

Dear Mike Frysinger,

Quoted 8 lines · In message <[email protected]> you wrote:
---
 cpu/blackfin/initcode.c               |   10 ++--
 cpu/blackfin/interrupts.c             |   12 ++--
 cpu/blackfin/serial.c                 |   20 ++---
 cpu/blackfin/serial.h                 |  119 +++++++++++++++++---------------
 include/asm-blackfin/blackfin_local.h |    2 +-
 5 files changed, 83 insertions(+), 80 deletions(-)

...

cpu/blackfin/serial.c static uint16_t uart_lsr_read(void) · line 78

Quoted 8 lines

/* When debugging is disabled, we only care about the DR bit, so if other
* bits get set/cleared, we don't really care since we don't read them
* anyways (and thus anomaly 05000099 is irrelevant).
*/

cpu/blackfin/serial.c +2 -2
-static inline uint16_t uart_lsr_read(void) { return *pUART_LSR; }
-static inline void uart_lsr_clear(void) { *pUART_LSR = -1; }
+static uint16_t uart_lsr_read(void) { return bfin_read16(&pUART->lsr); }
+static void uart_lsr_clear(void) { bfin_write16(&pUART->lsr, bfin_read16(&pUART->lsr) | -1); }

Line too long.

...

cpu/blackfin/serial.h line 98

Quoted 2 lines
cpu/blackfin/serial.h +2 -0
+# define ACCESS_LATCH()    bfin_write16(&pUART->lcr, bfin_read16(&pUART->lcr) | DLAB)
+# define ACCESS_PORT_IER() bfin_write16(&pUART->lcr, bfin_read16(&pUART->lcr) & ~DLAB)

Ditto. Please fix globally.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The human race is faced with a cruel choice: work  or  daytime  tele-
vision.
#24 lore raw

PATCH 16/25 Blackfin: asm/string.h: drop useless includes

In reply to Mike Frysinger
---
 include/asm-blackfin/string.h |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
include/asm-blackfin/string.h +1 -4
index 18306dd..117f44c 100644
@@ -29,9 +29,6 @@
 
 #ifdef __KERNEL__		/* only set these up for kernel code */
 
-#include <config.h>
-#include <asm/blackfin.h>
-
 #define __HAVE_ARCH_STRCPY
 #define __HAVE_ARCH_STRNCPY
 #define __HAVE_ARCH_STRCMP
@@ -47,7 +44,7 @@ extern int strcmp(const char *cs, const char *ct);
 extern int strncmp(const char *cs, const char *ct, size_t count);
 extern void *memcpy(void *dest, const void *src, size_t count);
 extern void *memset(void *s, int c, size_t count);
-extern int memcmp(const void *, const void *, __kernel_size_t);
+extern int memcmp(const void *, const void *, size_t);
 extern void *memmove(void *dest, const void *src, size_t count);
 
 #else				/* KERNEL */
Signature · 1 line
1.6.5.5
#25 lore raw

PATCH 17/25 Blackfin: bfin_spi: let boards control idle value

In reply to Mike Frysinger

From: Cliff Cai <[email protected]>

Some SPI devices like to see high idle values rather than low.

---
 drivers/spi/bfin_spi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/spi/bfin_spi.c +5 -1
index 2a72f99..093166e 100644
@@ -314,6 +314,10 @@ void spi_release_bus(struct spi_slave *slave)
 	SSYNC();
 }
 
+#ifndef CONFIG_BFIN_SPI_IDLE_VAL
+# define CONFIG_BFIN_SPI_IDLE_VAL 0xff
+#endif
+
 int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
 		void *din, unsigned long flags)
 {
@@ -340,7 +344,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
 
 	/* todo: take advantage of hardware fifos and setup RX dma */
 	while (bytes--) {
-		u8 value = (tx ? *tx++ : 0);
+		u8 value = (tx ? *tx++ : CONFIG_BFIN_SPI_IDLE_VAL);
 		debug("%s: tx:%x ", __func__, value);
 		write_SPI_TDBR(bss, value);
 		SSYNC();
Signature · 1 line
1.6.5.5
#26 lore raw

PATCH 18/25 Blackfin: convert bfin_sdh to generic mmc

In reply to Mike Frysinger

From: Cliff Cai <[email protected]>

---
 board/bf518f-ezbrd/bf518f-ezbrd.c |    8 +
 board/bf548-ezkit/bf548-ezkit.c   |    8 +
 drivers/mmc/bfin_sdh.c            |  519 +++++++++----------------------------
 drivers/mmc/bfin_sdh.h            |   59 -----
 include/asm-blackfin/mmc.h        |    1 -
 include/asm-blackfin/sdh.h        |   17 ++
 include/configs/bf518f-ezbrd.h    |    1 +
 include/configs/bf548-ezkit.h     |    1 +
 lib_blackfin/board.c              |    6 +
 9 files changed, 161 insertions(+), 459 deletions(-)
 delete mode 100644 drivers/mmc/bfin_sdh.h
 delete mode 100644 include/asm-blackfin/mmc.h
 create mode 100644 include/asm-blackfin/sdh.h
board/bf518f-ezbrd/bf518f-ezbrd.c +8 -0
index 279c55c..85b350f 100644
@@ -15,6 +15,7 @@
 #include <asm/blackfin.h>
 #include <asm/net.h>
 #include <asm/mach-common/bits/otp.h>
+#include <asm/sdh.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -155,3 +156,10 @@ int board_early_init_f(void)
 #endif
 	return 0;
 }
+
+#ifdef CONFIG_BFIN_SDH
+int board_mmc_init(bd_t *bis)
+{
+	return bfin_mmc_init(bis);
+}
+#endif
board/bf548-ezkit/bf548-ezkit.c +8 -0
index 29c2e92..7659e34 100644
@@ -11,6 +11,7 @@
 #include <config.h>
 #include <command.h>
 #include <asm/blackfin.h>
+#include <asm/sdh.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -78,3 +79,10 @@ int board_eth_init(bd_t *bis)
 	return smc911x_initialize(0, CONFIG_SMC911X_BASE);
 }
 #endif
+
+#ifdef CONFIG_BFIN_SDH
+int board_mmc_init(bd_t *bis)
+{
+	return bfin_mmc_init(bis);
+}
+#endif
drivers/mmc/bfin_sdh.c +120 -399

600 lines not on this page · raw message

drivers/mmc/bfin_sdh.h deleted +0 -59

59 lines not on this page · raw message

include/asm-blackfin/mmc.h deleted +0 -1
deleted file mode 100644
index aa2ac95..0000000
@@ -1 +0,0 @@
-#include <asm-avr32/arch-at32ap700x/mmc.h>
include/asm-blackfin/sdh.h new file +17 -0
new file mode 100644
index 0000000..2c2f63e
@@ -0,0 +1,17 @@
+/*
+ * sdh.h, export bfin_mmc_init
+ *
+ * Copyright (c) 2009 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef __ASM_SDH_H__
+#define __ASM_SDH_H__
+
+#include <mmc.h>
+#include <asm/u-boot.h>
+
+int bfin_mmc_init(bd_t *bis);
+
+#endif
include/configs/bf518f-ezbrd.h +1 -0
index 4928403..234e5a4 100644
@@ -125,6 +125,7 @@
  * SDH Settings
  */
 #if !defined(__ADSPBF512__)
+#define CONFIG_GENERIC_MMC
 #define CONFIG_MMC
 #define CONFIG_BFIN_SDH
 #endif
include/configs/bf548-ezkit.h +1 -0
index 297c3fd..f9c9711 100644
@@ -161,6 +161,7 @@
  * SDH Settings
  */
 #if !defined(__ADSPBF544__)
+#define CONFIG_GENERIC_MMC
 #define CONFIG_MMC
 #define CONFIG_BFIN_SDH
 #endif
lib_blackfin/board.c +6 -0
index b682beb..4c66cf0 100644
@@ -14,6 +14,7 @@
 #include <stdio_dev.h>
 #include <environment.h>
 #include <malloc.h>
+#include <mmc.h>
 #include <net.h>
 #include <timestamp.h>
 #include <status_led.h>
@@ -335,6 +336,11 @@ void board_init_r(gd_t * id, ulong dest_addr)
 	nand_init();		/* go init the NAND */
 #endif
 
+#ifdef CONFIG_GENERIC_MMC
+	puts("MMC:  ");
+	mmc_initialize(bd);
+#endif
+
 	/* relocate environment function pointers etc. */
 	env_relocate();
 
Signature · 1 line
1.6.5.5
#27 lore raw

PATCH 19/25 Blackfin: bf533-stamp: split and cleanup CF/IDE code

In reply to Mike Frysinger

Give the CF/IDE code its own file to keep things cleanly separated. While we're here, clean up the code to use common functions.

---
 board/bf533-stamp/Makefile      |    1 +
 board/bf533-stamp/bf533-stamp.c |  113 +-------------------------------------
 board/bf533-stamp/ide-cf.c      |   90 +++++++++++++++++++++++++++++++
 3 files changed, 94 insertions(+), 110 deletions(-)
 create mode 100644 board/bf533-stamp/ide-cf.c
board/bf533-stamp/Makefile +1 -0
index dbba12b..832037b 100644
@@ -30,6 +30,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(BOARD).a
 
 COBJS-y	:= $(BOARD).o
+COBJS-$(CONFIG_STAMP_CF) += ide-cf.o
 COBJS-$(CONFIG_VIDEO) += video.o
 
 SRCS	:= $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
board/bf533-stamp/bf533-stamp.c +3 -110

121 lines not on this page · raw message

board/bf533-stamp/ide-cf.c new file +90 -0

90 lines not on this page · raw message

Signature · 1 line
1.6.5.5
#28 lore raw

PATCH 20/25 Blackfin: drop unused funcs from io.h

In reply to Mike Frysinger
---
 include/asm-blackfin/io.h |   38 --------------------------------------
 1 files changed, 0 insertions(+), 38 deletions(-)
include/asm-blackfin/io.h +0 -38
index 6806494..354fb7d 100644
@@ -147,43 +147,5 @@ static inline unsigned int readl(const volatile void *addr)
 
 #define outsw(port, addr, count)	cf_outsw((unsigned short *)(port), (unsigned short *)addr, (count))
 
-#define IO_SPACE_LIMIT		0xffff
-
-/* Values for nocacheflag and cmode */
-#define IOMAP_FULL_CACHING	0
-#define IOMAP_NOCACHE_SER	1
-#define IOMAP_NOCACHE_NONSER	2
-#define IOMAP_WRITETHROUGH	3
-
-extern void *__ioremap(unsigned long physaddr, unsigned long size,
-		       int cacheflag);
-extern void __iounmap(void *addr, unsigned long size);
-
-extern inline void *ioremap(unsigned long physaddr, unsigned long size)
-{
-	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
-}
-extern inline void *ioremap_nocache(unsigned long physaddr, unsigned long size)
-{
-	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
-}
-extern inline void *ioremap_writethrough(unsigned long physaddr,
-					 unsigned long size)
-{
-	return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
-}
-extern inline void *ioremap_fullcache(unsigned long physaddr,
-				      unsigned long size)
-{
-	return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
-}
-
-extern void iounmap(void *addr);
-
-extern void blkfin_inv_cache_all(void);
-#define dma_cache_inv(_start, _size)		do { blkfin_inv_cache_all(); } while (0)
-#define dma_cache_wback(_start, _size)		do { } while (0)
-#define dma_cache_wback_inv(_start, _size)	do { blkfin_inv_cache_all(); } while (0)
-
 #endif
 #endif
Signature · 1 line
1.6.5.5
#29 lore raw

PATCH 21/25 Blackfin: section off the CF/IDE io.h hacks

In reply to Mike Frysinger

These need to be rethought, but until that happens, isolate the hack so that we can extend the common code without breaking things.

---
 include/asm-blackfin/io.h |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)
include/asm-blackfin/io.h +15 -12
index 354fb7d..898d674 100644
@@ -34,12 +34,6 @@ static inline void sync(void)
 	SSYNC();
 }
 
-/* function prototypes for CF support */
-extern void cf_outsw(unsigned short *addr, unsigned short *sect_buf, int words);
-extern void cf_insw(unsigned short *sect_buf, unsigned short *addr, int words);
-extern unsigned char cf_inb(volatile unsigned char *addr);
-extern void cf_outb(unsigned char val, volatile unsigned char *addr);
-
 /*
  * Given a physical address and a length, return a virtual address
  * that can be used to access the memory range with the caching
@@ -140,12 +134,21 @@ static inline unsigned int readl(const volatile void *addr)
 #define memcpy_fromio(a, b, c)	memcpy((a), (void *)(b), (c))
 #define memcpy_toio(a, b, c)	memcpy((void *)(a), (b), (c))
 
-#define inb(addr)		cf_inb((volatile unsigned char *)(addr))
-#define outb(x, addr)		cf_outb((unsigned char)(x), (volatile unsigned char *)(addr))
-
-#define insw(port, addr, count)	cf_insw((unsigned short *)addr, (unsigned short *)(port), (count))
-
-#define outsw(port, addr, count)	cf_outsw((unsigned short *)(port), (unsigned short *)addr, (count))
+#if defined(CONFIG_STAMP_CF) || defined(CONFIG_BFIN_IDE)
+/* This hack for CF/IDE needs to be addressed at some point */
+extern void cf_outsw(unsigned short *addr, unsigned short *sect_buf, int words);
+extern void cf_insw(unsigned short *sect_buf, unsigned short *addr, int words);
+extern unsigned char cf_inb(volatile unsigned char *addr);
+extern void cf_outb(unsigned char val, volatile unsigned char *addr);
+#undef inb
+#undef outb
+#undef insw
+#undef outsw
+#define inb(addr) cf_inb((volatile unsigned char *)(addr))
+#define outb(x, addr) cf_outb((unsigned char)(x), (volatile unsigned char *)(addr))
+#define insw(port, addr, count) cf_insw((unsigned short *)(addr), (unsigned short *)(port), (count))
+#define outsw(port, addr, count) cf_outsw((unsigned short *)(port), (unsigned short *)(addr), (count))
+#endif
 
 #endif
 #endif
Signature · 1 line
1.6.5.5
#30 lore raw

PATCH 21/25 Blackfin: section off the CF/IDE io.h hacks

Dear Mike Frysinger,

Quoted 4 lines · In message <[email protected]> you wrote:

These need to be rethought, but until that happens, isolate the hack so that we can extend the common code without breaking things.

...

include/asm-blackfin/io.h static inline unsigned int readl(const volatile void *addr) · line 150

Quoted 4 lines
include/asm-blackfin/io.h +4 -0
+#define inb(addr) cf_inb((volatile unsigned char *)(addr))
+#define outb(x, addr) cf_outb((unsigned char)(x), (volatile unsigned char *)(addr))
+#define insw(port, addr, count) cf_insw((unsigned short *)(addr), (unsigned short *)(port), (count))
+#define outsw(port, addr, count) cf_outsw((unsigned short *)(port), (unsigned short *)(addr), (count))

Lines too long.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Philosophy is a game with objectives and no rules.
Mathematics is a game with rules and no objectives.
#31 lore raw

PATCH 22/25 Blackfin: pull io funcs from linux

In reply to Mike Frysinger

Some common code uses more of the io.h funcs than we currently provide, so pull in all of the ones from the linux kernel.

---
 include/asm-blackfin/config-pre.h |    3 +
 include/asm-blackfin/io.h         |  159 +++++++++++++++++++++++++++----------
 lib_blackfin/Makefile             |    2 +
 lib_blackfin/ins.S                |  117 +++++++++++++++++++++++++++
 lib_blackfin/outs.S               |   60 ++++++++++++++
 5 files changed, 298 insertions(+), 43 deletions(-)
 create mode 100644 lib_blackfin/ins.S
 create mode 100644 lib_blackfin/outs.S
include/asm-blackfin/config-pre.h +3 -0
index b1d3a94..eee3aa6 100644
@@ -71,4 +71,7 @@ static inline const char *get_bfin_boot_mode(int bfin_boot)
 # define BFIN_BOOT_SPI_SSEL 1
 #endif
 
+/* We are single threaded most of the time */
+#define CONFIG_BFIN_INS_LOWOVERHEAD
+
 #endif
include/asm-blackfin/io.h +116 -43

221 lines not on this page · raw message

lib_blackfin/Makefile +2 -0
index cbf47f0..eebb131 100644
@@ -31,10 +31,12 @@ CFLAGS += -DBFIN_BOARD_NAME='"$(BOARD)"'
 
 LIB	= $(obj)lib$(ARCH).a
 
+SOBJS-y	+= ins.o
 SOBJS-y	+= memcmp.o
 SOBJS-y	+= memcpy.o
 SOBJS-y	+= memmove.o
 SOBJS-y	+= memset.o
+SOBJS-y	+= outs.o
 
 COBJS-y	+= board.o
 COBJS-y	+= boot.o
lib_blackfin/ins.S new file +117 -0

117 lines not on this page · raw message

lib_blackfin/outs.S new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
1.6.5.5
#32 lore raw

PATCH 22/25 Blackfin: pull io funcs from linux

Dear Mike Frysinger,

Quoted 4 lines · In message <[email protected]> you wrote:

Some common code uses more of the io.h funcs than we currently provide, so pull in all of the ones from the linux kernel.

...

include/asm-blackfin/config-pre.h static inline const char *get_bfin_boot_mode(int bfin_boot) · line 75

Quoted 2 lines
include/asm-blackfin/config-pre.h +2 -0
+/* We are single threaded most of the time */
+#define CONFIG_BFIN_INS_LOWOVERHEAD

Most of the time? I'd say U-Boot is always single-threaded?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is undignified for a woman to play servant to a man who is not
hers.
	-- Spock, "Amok Time", stardate 3372.7
#33 lore raw

PATCH 22/25 Blackfin: pull io funcs from linux

Quoted 10 lines · On Thursday 17 December 2009 16:43:11 Wolfgang Denk wrote:
Quoted 2 lines · Mike Frysinger

Some common code uses more of the io.h funcs than we currently provide, so pull in all of the ones from the linux kernel.

...

include/asm-blackfin/config-pre.h static inline const char *get_bfin_boot_mode(int bfin_boot) · line 75

Quoted 2 lines
include/asm-blackfin/config-pre.h +2 -0
+/* We are single threaded most of the time */
+#define CONFIG_BFIN_INS_LOWOVERHEAD

Most of the time? I'd say U-Boot is always single-threaded?

it's referring to no interrupts being used most of the time, not there being multiple threads.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091217/f012a4c8/attachment.pgp

#34 lore raw

[U-Boot] MPC8313 with 512MB SDRAM, u-boot version 1.3.0

In reply to Wolfgang Denk

Hi,

Did anybody get 512MB DDR SDRAM working on MPC8313?

My board here didn't work. In u-boot source, I changed CFG_DDRCONFIG to handle the 512MB ICs, changed CFG_IBAT_0U and CFG_DBAT_0U to handle 512MB, defined CONFIG_VERY_LAGE_RAM and CONFIG_MAX_MEM_MAPPED. When I set the CFG_DDR_SIZE to 256 to use only half memory, u-boot and Linux kernel (2.6.23) worked fine on this board. When I change CFG_DDR_SIZE to 512 to use all the memory, u-boot seems happy without error reporting, but crashed when booting the kernel.

Any help is highly appreciated.

Following is the boot log:

U-Boot 1.3.0 (Dec 17 2009 - 15:04:24) MPC83XX

Reset Status: External/Internal Soft, External/Internal Hard

CPU:   e300c3, MPC8313E, Rev: 21 at 333.333 MHz, CSB:  166 MHz
Board: ePM8313
I2C:   ready
DRAM:  512 MB
FLASH: 32 MB
NAND:  64 MiB
In:    serial
Out:   serial
Err:   serial
Net:   TSEC0 [PRIME], TSEC1
Hit any key to stop autoboot:  0 
## Booting image at f8080000 ...
   Image Name:   Linux-2.6.23
   Created:      2009-12-02  18:38:53 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1685120 Bytes =  1.6 MB

Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at f8320000 ...

   Image Name:   Ramdisk Image
   Created:      2009-10-29   0:30:48 UTC
   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
   Data Size:    5136056 Bytes =  4.9 MB

Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Booting using the fdt at 0xf8300000
Loading Ramdisk to 0fa52000, end 0ff37eb8 ... OK
Loading Device Tree to 007fc000, end 007fefff ... OK
Using ePM8313 machine description
Linux version 2.6.23 (root at DavidLaptopDuo) (gcc version 4.2.2) #49 Wed Dec 2 10:38:51 PST 2009 Found initrd at 0xcfa52000:0xcff37eb8
console [udbg0] enabled
setup_arch: bootmem
epm8313e_setup_arch()
arch: exit
Zone PFN ranges:
DMA 0 -> 131072
Normal 131072 -> 131072
Movable zone start PFN for each node
early_node_map[1] active PFN ranges

    0:        0 ->   131072

Built 1 zonelists in Zone order. Total pages: 130048
Kernel command line: root=/dev/ram rw ramdisk_size=81976
PID hash table entries: 2048 (order: 11, 8192 bytes)
I-pipe 2.0-02: pipeline enabled.
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 510592k/524288k available (3376k kernel code, 13300k reserved, 152k data, 212k bss, 160k init) Mount-cache hash table entries: 512

------------[ cut here ]------------
Badness at c017e7b8 [verbose debug info unavailable]
NIP: c017e7b8 LR: c000d6a8 CTR: 00000000
REGS: c0373e70 TRAP: 0700   Not tainted  (2.6.23)
MSR: 00029032 <EE,ME,IR,DR>  CR: 84042048  XER: 00000000

TASK = c034f208[0] 'swapper' THREAD: c0372000
GPR00: 00000001 c0373f20 c034f208 dffff00c 00000000 00000000 dffe5e08 00000000
GPR08: 00000000 00000005 dffe8778 003fffff 24042022 100aec40 0fffb000 ffffffff
GPR16: 00000000 007ffc00 004e5eb8 007ffbb0 f8320040 0ff37eb8 0fff7298 00000000
GPR24: 00000000 0fa52000 c037741c c034e000 dfffeee8 dfffef3a 00000000 dfffefd8

Call Trace:

[c0373f20] [c00df258] (unreliable)
[c0373f30] [c022f4dc]
[c0373f40] [c00df324]
[c0373f60] [c00df318]
[c0373f80] [c00df318]
[c0373fa0] [c00df48c]
[c0373fb0] [c03385f8]
[c0373fc0] [c03249c8]
[c0373ff0] [00003438]
Instruction dump:
409e0010 7c8903a6 4e800421 38000001 7c030378 80010014 38210010 7c0803a6 4e800020 80030000 7c000034 5400d97e <0f000000> 7d201828 31290001 7d20192d
WARNING: Bad of_node_put() on

Call Trace:

[c0373ec0] [c0007b5c] (unreliable)
[c0373f00] [c000db50]
[c0373f20] [c017e794]
[c0373f30] [c000d678]
[c0373f40] [c00df390]
[c0373f60] [c00df318]
[c0373f80] [c00df318]
[c0373fa0] [c00df48c]
[c0373fb0] [c03385f8]
[c0373fc0] [c03249c8]
[c0373ff0] [00003438]

------------[ cut here ]------------
Badness at c017e7b8 [verbose debug info unavailable]
NIP: c017e7b8 LR: c000d6a8 CTR: 00000009
REGS: c0373e90 TRAP: 0700   Not tainted  (2.6.23)
MSR: 00029032 <EE,ME,IR,DR>  CR: 84042048  XER: 00000000

TASK = c034f208[0] 'swapper' THREAD: c0372000
GPR00: 00000001 c0373f40 c034f208 dffff0b4 dfffeee8 00000009 dffe5984 00000000
GPR08: dffe8888 00000004 dffe8778 0000006e 22042042 100aec40 0fffb000 ffffffff
GPR16: 00000000 007ffc00 004e5eb8 007ffbb0 f8320040 0ff37eb8 0fff7298 00000000
GPR24: 00000000 0fa52000 c037741c c034e000 dfffecd8 dfffef3a dfffeee8 dffff080

Call Trace:

[c0373f40] [c00df3b0] (unreliable)
[c0373f50] [c022f4dc]
[c0373f60] [c00df324]
[c0373f80] [c00df318]
[c0373fa0] [c00df48c]
[c0373fb0] [c03385f8]
[c0373fc0] [c03249c8]
[c0373ff0] [00003438]
Instruction dump:
409e0010 7c8903a6 4e800421 38000001 7c030378 80010014 38210010 7c0803a6 4e800020 80030000 7c000034 5400d97e <0f000000> 7d201828 31290001 7d20192d

Unable to handle kernel paging request for data at address 0x00000000
Faulting instruction address: 0xc0014a08
Oops: Kernel access of bad area, sig: 11 [#1]
ePM8313e
Modules linked in:
NIP: c0014a08 LR: c01810e8 CTR: 00000009
REGS: c0373e90 TRAP: 0300   Not tainted  (2.6.23)
MSR: 00009032 <EE,ME,IR,DR>  CR: 84042044  XER: 20000000
DAR: 00000000, DSISR: 20000000

TASK = c034f208[0] 'swapper' THREAD: c0372000
GPR00: c00df33c c0373f40 c034f208 00000000 ffffffff 00000009 dffe5984 00000000
GPR08: dffe8888 00000000 dffe8778 0000006e 22042042 100aec40 0fffb000 ffffffff
GPR16: 00000000 007ffc00 004e5eb8 007ffbb0 f8320040 0ff37eb8 0fff7298 00000000
GPR24: 00000000 0fa52000 c037741c c034e000 dfffecd8 0000002f dffe63e0 00000000

Call Trace:

[c0373f40] [c000d678] (unreliable)
[c0373f60] [c00df33c]
[c0373f80] [c00df318]
[c0373fa0] [c00df48c]
[c0373fb0] [c03385f8]
[c0373fc0] [c03249c8]
[c0373ff0] [00003438]
Instruction dump:
4082fff4 4e800020 38a3ffff 3884ffff 8c650001 2c830000 8c040001 7c601851 4d860020 4182ffec 4e800020 3883ffff <8c040001> 2c000000 4082fff8 7c632050

Kernel panic - not syncing: Attempted to kill the idle task!

Rebooting in 180 seconds..

      __________________________________________________________________

Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now
http://ca.toolbar.yahoo.com.

#35 lore raw

PATCH 23/25 Blackfin: bfin_spi: round up clock divider

In reply to Mike Frysinger

From: Cliff Cai <[email protected]>

If the requested clock cannot be exactly obtained, round it up so that we err on the side of slightly slower rather than slightly faster.

---
 drivers/spi/bfin_spi.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/spi/bfin_spi.c +6 -1
index 093166e..f28d42b 100644
@@ -85,6 +85,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
 		unsigned int max_hz, unsigned int mode)
 {
 	struct bfin_spi_slave *bss;
+	ulong sclk;
 	u32 mmr_base;
 	u32 baud;
 
@@ -105,7 +106,11 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
 		default: return NULL;
 	}
 
-	baud = get_sclk() / (2 * max_hz);
+	sclk = get_sclk();
+	baud = sclk / (2 * max_hz);
+	/* baud should be rounded up */
+	if (sclk % (2 * max_hz))
+		baud += 1;
 	if (baud < 2)
 		baud = 2;
 	else if (baud > (u16)-1)
Signature · 1 line
1.6.5.5
#36 lore raw

PATCH 24/25 Blackfin: bf527-ezkit/bf548-ezkit: add musb board specific initialization

In reply to Mike Frysinger

From: Cliff Cai <[email protected]>

---
 board/bf527-ezkit/bf527-ezkit.c |   13 +++++++++++++
 board/bf548-ezkit/bf548-ezkit.c |   16 ++++++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)
board/bf527-ezkit/bf527-ezkit.c +13 -0
index a880066..a911880 100644
@@ -68,3 +68,16 @@ int misc_init_r(void)
 
 	return 0;
 }
+
+#ifdef CONFIG_USB_BLACKFIN
+void board_musb_init(void)
+{
+	/*
+	 * BF527 EZ-KITs require PG13 to be high for HOST mode
+	 */
+	bfin_write_PORTG_FER(bfin_read_PORTG_FER() & ~PG13);
+	bfin_write_PORTGIO_DIR(bfin_read_PORTGIO_DIR() | PG13);
+	bfin_write_PORTGIO_SET(PG13);
+	SSYNC();
+}
+#endif
board/bf548-ezkit/bf548-ezkit.c +16 -0
index 7659e34..65fb81a 100644
@@ -86,3 +86,19 @@ int board_mmc_init(bd_t *bis)
 	return bfin_mmc_init(bis);
 }
 #endif
+
+#ifdef CONFIG_USB_BLACKFIN
+void board_musb_init(void)
+{
+	/*
+	 * Rev 1.0 BF549 EZ-KITs require PE7 to be high for both device
+	 * and OTG host modes, while rev 1.1 and greater require PE7 to
+	 * be low for device mode and high for host mode.  We set it high
+	 * here because we are in host mode.
+	 */
+	bfin_write_PORTE_FER(bfin_read_PORTE_FER() & ~PE7);
+	bfin_write_PORTE_DIR_SET(PE7);
+	bfin_write_PORTE_SET(PE7);
+	SSYNC();
+}
+#endif
Signature · 1 line
1.6.5.5
#37 lore raw

PATCH 25/25 Blackfin: add support for BF527-EZKIT v2.1

In reply to Mike Frysinger

From: Michael Hennerich <[email protected]>

The new board revision has a different LCD.

---
i've removed include/asm-blackfin/bfin_logo_rgb565_230x230.h from the diffstat since it's so big (120kb) and it's generated output from easylogo and the Blackfin .tga.

 MAINTAINERS                                     |    1 +
 MAKEALL                                         |    1 +
 Makefile                                        |    5 +-
 board/bf527-ezkit/video.c                       |  144 +++-
 include/asm-blackfin/bfin_logo_rgb565_230x230.h | 1242 +++++++++++++++++++++++
 include/configs/bf527-ezkit.h                   |    9 +
 6 files changed, 1389 insertions(+), 13 deletions(-)
 create mode 100644 include/asm-blackfin/bfin_logo_rgb565_230x230.h
MAINTAINERS +1 -0
index 2ef158d..ce1845c 100644
@@ -942,6 +942,7 @@ Blackfin Team <[email protected]>
 	BF518F-EZBRD	BF518
 	BF526-EZBRD	BF526
 	BF527-EZKIT	BF527
+	BF527-EZKIT-V2	BF527
 	BF533-EZKIT	BF533
 	BF533-STAMP	BF533
 	BF537-PNAV	BF537
MAKEALL +1 -0
index acb35d2..c4577ff 100755
@@ -869,6 +869,7 @@ LIST_blackfin="		\
 	bf518f-ezbrd	\
 	bf526-ezbrd	\
 	bf527-ezkit	\
+	bf527-ezkit-v2	\
 	bf533-ezkit	\
 	bf533-stamp	\
 	bf537-minotaur	\
Makefile +4 -1
index 9ce0ecf..4e56efd 100644
@@ -3565,7 +3565,10 @@ BFIN_BOARDS += bf537-minotaur bf537-srv1 bf561-acvilon blackstamp
 BFIN_BOARDS += ibf-dsp561
 
 $(BFIN_BOARDS:%=%_config)	: unconfig
-	@$(MKCONFIG) $(@:_config=) blackfin blackfin $(@:_config=)
+	@$(MKCONFIG) $(MKCONFIG_$(@:_config=)) $(@:_config=) blackfin blackfin $(@:_config=)
+
+bf527-ezkit-v2_config	: unconfig
+	@$(MKCONFIG) -t BF527_EZKIT_REV_2_1 bf527-ezkit blackfin blackfin bf527-ezkit
 
 #========================================================================
 # AVR32
board/bf527-ezkit/video.c +132 -12

223 lines not on this page · raw message

include/configs/bf527-ezkit.h +9 -0
index c7322b8..7800c32 100644
@@ -155,6 +155,15 @@
 
 
 /*
+ * Video Settings
+ */
+#ifdef CONFIG_MK_BF527_EZKIT_REV_2_1
+# define CONFIG_LQ035Q1_SPI_BUS	0
+# define CONFIG_LQ035Q1_SPI_CS	7
+#endif
+
+
+/*
  * Misc Settings
  */
 #define CONFIG_MISC_INIT_R
Signature · 1 line
1.6.5.5
#38 lore raw

PATCH 25/25 Blackfin: add support for BF527-EZKIT v2.1

Dear Mike Frysinger,

Quoted 10 lines · In message <[email protected]> you wrote:

From: Michael Hennerich <[email protected]>

The new board revision has a different LCD.

---
i've removed include/asm-blackfin/bfin_logo_rgb565_230x230.h from the diffstat since it's so big (120kb) and it's generated output from easylogo and the Blackfin .tga.

Seems you removed it not fromthe diffstat, but from the patch itself?

Makefile BFIN_BOARDS += bf537-minotaur bf537-srv1 bf561-acvilon blackstamp · line 3568

Quoted 3 lines

$(BFIN_BOARDS:%=%_config) : unconfig

Makefile +1 -1
-	@$(MKCONFIG) $(@:_config=) blackfin blackfin $(@:_config=)
+	@$(MKCONFIG) $(MKCONFIG_$(@:_config=)) $(@:_config=) blackfin blackfin $(@:_config=)

Line too long.

board/bf527-ezkit/video.c line 36

Quoted 7 lines
board/bf527-ezkit/video.c +7 -0
+#if !(defined(CONFIG_LQ035Q1_USE_RGB888_8_BIT_PPI) || defined(CONFIG_LQ035Q1_USE_RGB565_8_BIT_PPI))
+#define CONFIG_LQ035Q1_USE_RGB565_8_BIT_PPI
+#endif
+
+/* Interface 16/18-bit TFT over an 8-bit wide PPI using a small Programmable Logic Device (CPLD)
+ * http://blackfin.uclinux.org/gf/project/stamp/frs/?action=FrsReleaseBrowse&frs_package_id=165
+ */

Lines too long. Please fix globally.

Quoted 4 lines
include/configs/bf527-ezkit.h +0 -0
@@ -155,6 +155,15 @@
 

include/configs/bf527-ezkit.h line 165

Quoted 10 lines
include/configs/bf527-ezkit.h +8 -0
 
 /*
+ * Video Settings
+ */
+#ifdef CONFIG_MK_BF527_EZKIT_REV_2_1
+# define CONFIG_LQ035Q1_SPI_BUS	0
+# define CONFIG_LQ035Q1_SPI_CS	7
+#endif
+
+

Please don't add that many empty lines.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Successful and fortunate crime is called virtue.             - Seneca
#39 lore raw

PATCH 25/25 Blackfin: add support for BF527-EZKIT v2.1

Quoted 5 lines · On Thursday 17 December 2009 16:47:20 Wolfgang Denk wrote:
Quoted 4 lines · Mike Frysinger

From: Michael Hennerich <[email protected]>

The new board revision has a different LCD.

Quoted 8 lines
Quoted 6 lines

---
i've removed include/asm-blackfin/bfin_logo_rgb565_230x230.h from the diffstat since it's so big (120kb) and it's generated output from easylogo and the Blackfin .tga.

Seems you removed it not fromthe diffstat, but from the patch itself?

that's what i meant
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091217/01d23e9f/attachment.pgp

#40 lore raw

PATCH 1/3 Blackfin: add a netconsole helper

In reply to Mike Frysinger

From: Robin Getz <[email protected]>

---
 include/configs/bfin_adi_common.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
include/configs/bfin_adi_common.h +12 -0
index db10ccc..f7a2d5c 100644
@@ -178,7 +178,19 @@
 		"erase 0x20000000 +$(filesize);" \
 		"cp.b $(loadaddr) 0x20000000 $(filesize)"
 # endif
+# ifdef CONFIG_NETCONSOLE
+#  define NETCONSOLE_ENV \
+	"nc=" \
+		"set ncip ${serverip};" \
+		"set stdin nc;" \
+		"set stdout nc" \
+		"\0"
+# else
+#  define NETCONSOLE_ENV
+# endif
 # define NETWORK_ENV_SETTINGS \
+	NETCONSOLE_ENV \
+	\
 	"ubootfile=" UBOOT_ENV_FILE "\0" \
 	"update=" \
 		"tftp $(loadaddr) $(ubootfile);" \
Signature · 1 line
1.6.5.4
#41 lore raw

PATCH 2/3 Blackfin: keep hwtrace on CPLB miss

In reply to Mike Frysinger

From: Robin Getz <[email protected]>

Crashes rarely happen in the CPLB miss handler compared to the rest of U-Boot code, so disable hardware tracing when processing misses. This way a crash due to other functions will be shown properly.

---
 cpu/blackfin/traps.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
cpu/blackfin/traps.c +9 -0
index 7e7c74c..becc36e 100644
@@ -100,6 +100,14 @@ void trap_c(struct pt_regs *regs)
 		uint32_t new_cplb_addr = 0, new_cplb_data = 0;
 		static size_t last_evicted;
 		size_t i;
+		unsigned long tflags;
+
+		/*
+		 * Keep the trace buffer so that a miss here points people
+		 * to the right place (their code).  Crashes here rarely
+		 * happen.  If they do, only the Blackfin maintainer cares.
+		 */
+		trace_buffer_save(tflags);
 
 		new_cplb_addr = (data ? bfin_read_DCPLB_FAULT_ADDR() : bfin_read_ICPLB_FAULT_ADDR()) & ~(4 * 1024 * 1024 - 1);
 
@@ -156,6 +164,7 @@ void trap_c(struct pt_regs *regs)
 		for (i = 0; i < 16; ++i)
 			debug("%2i 0x%p 0x%08X\n", i, *CPLB_ADDR++, *CPLB_DATA++);
 
+		trace_buffer_restore(tflags);
 		break;
 	}
 
Signature · 1 line
1.6.5.4
#42 lore raw

PATCH 3/3 Blackfin: handle anomaly 05000257

In reply to Mike Frysinger

From: Robin Getz <[email protected]>

Need to reload the loop counters to keep from corrupting hardware loops.

---
 cpu/blackfin/interrupt.S |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
cpu/blackfin/interrupt.S +10 -1
index 71e0fc6..8c7a262 100644
@@ -1,7 +1,7 @@
 /*
  * interrupt.S - trampoline default exceptions/interrupts to C handlers
  *
- * Copyright (c) 2005-2007 Analog Devices Inc.
+ * Copyright (c) 2005-2009 Analog Devices Inc.
  * Licensed under the GPL-2 or later.
  */
 
@@ -17,10 +17,19 @@ ENTRY(_trap)
 	sp.l = LO(L1_SRAM_SCRATCH_END - 20);
 	sp.h = HI(L1_SRAM_SCRATCH_END - 20);
 	SAVE_ALL_SYS
+
 	r0 = sp;	/* stack frame pt_regs pointer argument ==> r0 */
 	sp += -12;
 	call _trap_c;
 	sp += 12;
+
+#if ANOMALY_05000257
+	R7  = LC0;
+	LC0 = R7;
+	R7  = LC1;
+	LC1 = R7;
+#endif
+
 	RESTORE_ALL_SYS
 	sp = CONFIG_BFIN_SCRATCH_REG;
 	rtx;
Signature · 1 line
1.6.5.4