Blackfin: move bootldr command to common code
This moves the Blackfin-common bootldr command out of the BF537-STAMP specific board directory and into the common directory so that all Blackfin boards may utilize it.
--- board/bf537-stamp/bf537-stamp.c | 45 --------------------------- common/Makefile | 1 + common/cmd_bootldr.c | 64 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 45 deletions(-) create mode 100644 common/cmd_bootldr.c
board/bf537-stamp/bf537-stamp.c +0 -45
@@ -54,51 +54,6 @@ DECLARE_GLOBAL_DATA_PTR;#define POST_WORD_ADDR 0xFF903FFC -/* -* the bootldr command loads an address, checks to see if there -* is a Boot stream that the on-chip BOOTROM can understand, -* and loads it via the BOOTROM Callback. It is possible -* to also add booting from SPI, or TWI, but this function does -* not currently support that. -*/ -int do_bootldr (cmd_tbl_t * cmdtp,int flag,int argc,char *argv[]) -{ -ulong addr, entry; -ulong *data; - -/* Get the address */ -if (argc <2 ) { - addr = load_addr; - }else { - addr =simple_strtoul (argv[1 ],NULL ,16 ); - } - -/* Check if it is a LDR file */ - data = (ulong *) addr; -if (*data ==0xFF800060 || *data ==0xFF800040 || *data ==0xFF800020 ) { -/* We want to boot from FLASH or SDRAM */ - entry = _BOOTROM_BOOT_DXE_FLASH; -printf ("## Booting ldr image at 0x%08lx ...\n" , addr); -if (icache_status ()) -icache_disable (); -if (dcache_status ()) -dcache_disable (); - - __asm__("R7=%[a];\n" "P0=%[b];\n" "JUMP (P0);\n" : - :[a]"d" (addr),[b]"a" (entry) - :"R7" ,"P0" ); - - }else { -printf ("## No ldr image@address 0x%08lx\n" , addr); - } - -return 0 ; -} - -U_BOOT_CMD (bootldr,2 ,0 , do_bootldr, -"bootldr - boot ldr image from memory\n" , -"[addr]\n - boot ldr image stored in memory\n" ); -int checkboard (void ) {#if (BFIN_CPU ==ADSP_BF534 )
common/Makefile +1 -0
@@ -37,6 +37,7 @@ COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o COBJS-y += cmd_boot.o +COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-y += cmd_bootm.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
common/cmd_bootldr.c new file +64 -0
64 lines not on this page · raw message
Signature · 1 line
1.5.4.2
[U-Boot-Users] [PATCH/review] Blackfin: convert BFIN_CPU to CONFIG_BFIN_CPU
Stop tying things to the processor that should be tied to other defines and change BFIN_CPU to CONFIG_BFIN_CPU so that it can be used in the build system to select the -mcpu option.
--- blackfin_config.mk | 6 +++++- board/bf533-ezkit/bf533-ezkit.c | 7 ------- board/bf533-stamp/bf533-stamp.c | 7 ------- board/bf537-stamp/bf537-stamp.c | 11 ----------- include/configs/bf533-ezkit.h | 9 ++++----- include/configs/bf533-stamp.h | 25 ++++--------------------- include/configs/bf537-stamp.h | 34 +++++++++------------------------- include/configs/bf561-ezkit.h | 6 +++++- lib_blackfin/board.c | 3 ++- 9 files changed, 29 insertions(+), 79 deletions(-)
blackfin_config.mk +5 -1
@@ -24,9 +24,13 @@ PLATFORM_RELFLAGS += -ffixed-P5 PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN +ifneq (,$(CONFIG_BFIN_CPU)) +PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU) +endif + SYM_PREFIX = _ LDR_FLAGS += --use-vmas -ifeq (,$(findstring s,$(MAKEFLAGS))) +ifneq (,$(findstring s,$(MAKEFLAGS))) LDR_FLAGS += --quiet endif
board/bf533-ezkit/bf533-ezkit.c +0 -7
@@ -34,13 +34,6 @@ DECLARE_GLOBAL_DATA_PTR;int checkboard (void ) { -#if (BFIN_CPU ==ADSP_BF531 ) -printf ("CPU: ADSP BF531 Rev.: 0.%d\n" , *pCHIPID >>28 ); -#elif (BFIN_CPU ==ADSP_BF532 ) -printf ("CPU: ADSP BF532 Rev.: 0.%d\n" , *pCHIPID >>28 ); -#else -printf ("CPU: ADSP BF533 Rev.: 0.%d\n" , *pCHIPID >>28 ); -#endif printf ("Board: ADI BF533 EZ-Kit Lite board\n" );printf (" Support: http://blackfin.uclinux.org/\n" );return 0 ;
board/bf533-stamp/bf533-stamp.c +0 -7
@@ -43,13 +43,6 @@ DECLARE_GLOBAL_DATA_PTR;int checkboard (void ) { -#if (BFIN_CPU ==ADSP_BF531 ) -printf ("CPU: ADSP BF531 Rev.: 0.%d\n" , *pCHIPID >>28 ); -#elif (BFIN_CPU ==ADSP_BF532 ) -printf ("CPU: ADSP BF532 Rev.: 0.%d\n" , *pCHIPID >>28 ); -#else -printf ("CPU: ADSP BF533 Rev.: 0.%d\n" , *pCHIPID >>28 ); -#endif printf ("Board: ADI BF533 Stamp board\n" );printf (" Support: http://blackfin.uclinux.org/\n" );return 0 ;
board/bf537-stamp/bf537-stamp.c +0 -11
@@ -31,7 +31,6 @@#include <asm/blackfin.h> #include <asm/io.h> #include <net.h> -#include "ether_bf537.h" #include <asm/mach-common/bits/bootrom.h> /**
@@ -56,13 +55,6 @@ DECLARE_GLOBAL_DATA_PTR;int checkboard (void ) { -#if (BFIN_CPU ==ADSP_BF534 ) -printf ("CPU: ADSP BF534 Rev.: 0.%d\n" , *pCHIPID >>28 ); -#elif (BFIN_CPU ==ADSP_BF536 ) -printf ("CPU: ADSP BF536 Rev.: 0.%d\n" , *pCHIPID >>28 ); -#else -printf ("CPU: ADSP BF537 Rev.: 0.%d\n" , *pCHIPID >>28 ); -#endif printf ("Board: ADI BF537 stamp board\n" );printf (" Support: http://blackfin.uclinux.org/\n" );return 0 ;
@@ -142,9 +134,6 @@ int misc_init_r(void) pMACaddr[2], pMACaddr[3], pMACaddr[4], pMACaddr[5]);setenv ("ethaddr" , nid); } -if (getenv ("ethaddr" )) { -SetupMacAddr (SrcAddr); - }#endif #endif /* BFIN_BOOT_MODE == BF537_BYPASS_BOOT */
include/configs/bf533-ezkit.h +4 -5
@@ -5,6 +5,8 @@#ifndef __CONFIG_EZKIT533_H__#define __CONFIG_EZKIT533_H__ +#include <asm/blackfin-config-pre.h> +#define CONFIG_BAUDRATE 57600#define CONFIG_STAMP 1
@@ -41,10 +43,7 @@#define CONFIG_PANIC_HANG 1 -#define ADSP_BF531 0x31 -#define ADSP_BF532 0x32 -#define ADSP_BF533 0x33 -#define BFIN_CPU ADSP_BF533 +#define CONFIG_BFIN_CPU bf533-0.3/* This sets the default state of the cache on U-Boot's boot */ #define CONFIG_ICACHE_ON
@@ -120,7 +119,7 @@#define CONFIG_BOOTARGS "root=/dev/mtdblock0 ip=192.168.0.15:192.168.0.2:192.168.0.1:255.255.255.0:ezkit:eth0:off console=ttyBF0,57600" -#define CFG_PROMPT "ezkit> "/* Monitor Command Prompt */ +#define CFG_PROMPT "bfin> "/* Monitor Command Prompt */ #if defined(CONFIG_CMD_KGDB )#define CFG_CBSIZE 1024/* Console I/O Buffer Size */ #else
include/configs/bf533-stamp.h +4 -21
@@ -5,6 +5,8 @@#ifndef __CONFIG_STAMP_H__#define __CONFIG_STAMP_H__ +#include <asm/blackfin-config-pre.h> +#define CONFIG_STAMP 1#define CONFIG_RTC_BFIN 1#define CONFIG_BF533 1
@@ -21,10 +23,7 @@#define CONFIG_PANIC_HANG 1 -#define ADSP_BF531 0x31 -#define ADSP_BF532 0x32 -#define ADSP_BF533 0x33 -#define BFIN_CPU ADSP_BF533 +#define CONFIG_BFIN_CPU bf533-0.3/* This sets the default state of the cache on U-Boot's boot */ #define CONFIG_ICACHE_ON
@@ -329,23 +328,7 @@#define CONFIG_BAUDRATE 57600#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } -#if (BFIN_BOOT_MODE ==BF533_SPI_BOOT ) -#if (BFIN_CPU ==ADSP_BF531 ) -#define CFG_PROMPT "serial_bf531> "/* Monitor Command Prompt */ -#elif (BFIN_CPU ==ADSP_BF532 ) -#define CFG_PROMPT "serial_bf532> "/* Monitor Command Prompt */ -#else -#define CFG_PROMPT "serial_bf533> "/* Monitor Command Prompt */ -#endif -#else -#if (BFIN_CPU ==ADSP_BF531 ) -#define CFG_PROMPT "bf531> "/* Monitor Command Prompt */ -#elif (BFIN_CPU ==ADSP_BF532 ) -#define CFG_PROMPT "bf532> "/* Monitor Command Prompt */ -#else -#define CFG_PROMPT "bf533> "/* Monitor Command Prompt */ -#endif -#endif +#define CFG_PROMPT "bfin> "/* Monitor Command Prompt */ #if defined(CONFIG_CMD_KGDB )#define CFG_CBSIZE 1024/* Console I/O Buffer Size */
include/configs/bf537-stamp.h +9 -25
@@ -5,6 +5,8 @@#ifndef __CONFIG_BF537_H__#define __CONFIG_BF537_H__ +#include <asm/blackfin-config-pre.h> +#define CFG_LONGHELP 1#define CONFIG_CMDLINE_EDITING 1#define CONFIG_BAUDRATE 57600
@@ -31,10 +33,8 @@#define CONFIG_PANIC_HANG 1 -#define ADSP_BF534 0x34 -#define ADSP_BF536 0x36 -#define ADSP_BF537 0x37 -#define BFIN_CPU ADSP_BF537 +#define CONFIG_BFIN_CPU bf537-0.2 +#define CONFIG_BFIN_MAC /* This sets the default state of the cache on U-Boot's boot */ #define CONFIG_ICACHE_ON
@@ -113,7 +113,7 @@* Network Settings */ /* network support */ -#if (BFIN_CPU !=ADSP_BF534 ) +#ifdef CONFIG_BFIN_MAC #define CONFIG_IPADDR 192.168.0.15#define CONFIG_NETMASK 255.255.255.0#define CONFIG_GATEWAYIP 192.168.0.1
@@ -186,7 +186,7 @@#define CONFIG_CMD_EEPROM #define CONFIG_CMD_DATE -#if (BFIN_CPU ==ADSP_BF534 ) +#ifndef CONFIG_BFIN_MAC #undef CONFIG_CMD_NET#else #define CONFIG_CMD_PING
@@ -219,7 +219,7 @@#define CONFIG_LOADADDR 0x1000000#if (BFIN_BOOT_MODE ==BF537_BYPASS_BOOT ) -#if (BFIN_CPU !=ADSP_BF534 ) +#ifdef CONFIG_BFIN_MAC #define CONFIG_EXTRA_ENV_SETTINGS \ "ramargs=setenv bootargs root=/dev/mtdblock0 rw console=ttyBF0,57600\0" \ "nfsargs=setenv bootargs root=/dev/nfs rw " \
@@ -243,7 +243,7 @@ ""#endif #elif (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT) -#if (BFIN_CPU !=ADSP_BF534 ) +#ifdef CONFIG_BFIN_MAC #define CONFIG_EXTRA_ENV_SETTINGS \ "ramargs=setenv bootargs root=/dev/mtdblock0 rw console=ttyBF0,57600\0" \ "nfsargs=setenv bootargs root=/dev/nfs rw " \
@@ -267,23 +267,7 @@#endif #endif -#if (BFIN_BOOT_MODE ==BF537_SPI_MASTER_BOOT ) -#if (BFIN_CPU ==ADSP_BF534 ) -#define CFG_PROMPT "serial_bf534> "/* Monitor Command Prompt */ -#elif (BFIN_CPU ==ADSP_BF536 ) -#define CFG_PROMPT "serial_bf536> "/* Monitor Command Prompt */ -#else -#define CFG_PROMPT "serial_bf537> "/* Monitor Command Prompt */ -#endif -#else -#if (BFIN_CPU ==ADSP_BF534 ) -#define CFG_PROMPT "bf534> "/* Monitor Command Prompt */ -#elif (BFIN_CPU ==ADSP_BF536 ) -#define CFG_PROMPT "bf536> "/* Monitor Command Prompt */ -#else -#define CFG_PROMPT "bf537> "/* Monitor Command Prompt */ -#endif -#endif +#define CFG_PROMPT "bfin> "/* Monitor Command Prompt */ #if defined(CONFIG_CMD_KGDB )#define CFG_CBSIZE 1024/* Console I/O Buffer Size */
include/configs/bf561-ezkit.h +5 -1
@@ -5,6 +5,8 @@#ifndef __CONFIG_EZKIT561_H__#define __CONFIG_EZKIT561_H__ +#include <asm/blackfin-config-pre.h> +#define CONFIG_VDSP 1#define CONFIG_BF561 1
@@ -18,6 +20,8 @@#define CONFIG_PANIC_HANG 1 +#define CONFIG_BFIN_CPU bf561-0.3 +/* * Boot Mode Set * Blackfin can support several boot modes
@@ -216,7 +220,7 @@*/ #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } -#define CFG_PROMPT "ezkit> "/* Monitor Command Prompt */ +#define CFG_PROMPT "bfin> "/* Monitor Command Prompt */ #if defined(CONFIG_CMD_KGDB )#define CFG_CBSIZE 1024/* Console I/O Buffer Size */
lib_blackfin/board.c +2 -1
@@ -116,6 +116,7 @@ static int display_banner(void) {sprintf (version_string,VERSION_STRING_FORMAT ,VERSION_STRING );printf ("%s\n" , version_string); + printf("CPU: ADSP " MK_STR(CONFIG_BFIN_CPU) " (Detected Rev: 0.%d)\n", bfin_revid());return (0 ); }
@@ -404,7 +405,7 @@ void board_init_r(gd_t * id, ulong dest_addr)misc_init_r ();#endif -#if ((BFIN_CPU ==ADSP_BF537 ) || (BFIN_CPU ==ADSP_BF536 )) +#ifdef CONFIG_CMD_NET printf ("Net: " );eth_initialize (bd);#endif
Signature · 1 line
1.5.4.2
[U-Boot-Users] [PATCH/review] Blackfin: BF537-stamp: drop board-specific flash driver for CFI
The parallel flash on the BF537-STAMP is CFI compliant, so there is no need for the board specific driver at all. Just use the common CFI driver.
--- board/bf537-stamp/Makefile | 2 +- board/bf537-stamp/flash-defines.h | 123 ----------- board/bf537-stamp/flash.c | 403 ------------------------------------- include/configs/bf537-stamp.h | 9 +- 4 files changed, 6 insertions(+), 531 deletions(-) delete mode 100644 board/bf537-stamp/flash-defines.h delete mode 100644 board/bf537-stamp/flash.c
board/bf537-stamp/Makefile +1 -1
@@ -29,7 +29,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).a -COBJS := $(BOARD).o flash.o post-memory.o stm_m25p64.o cmd_bf537led.o nand.o +COBJS := $(BOARD).o post-memory.o stm_m25p64.o cmd_bf537led.o nand.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
include/configs/bf537-stamp.h +5 -4
@@ -286,6 +286,11 @@#define CFG_SDRAM_BASE 0x00000000#define CFG_FLASH_BASE 0x20000000 +#define CFG_FLASH_CFI /* The flash is CFI compatible */ +#define CFG_FLASH_CFI_DRIVER /* Use common CFI driver */ +#define CFG_FLASH_PROTECTION +#define CFG_MAX_FLASH_BANKS 1 +#define CFG_MAX_FLASH_SECT 71/* some have 67 sectors (M29W320DB), but newer have 71 (M29W320EB) */ #define CFG_MONITOR_LEN (256 << 10)/* Reserve 256 kB for Monitor */ #define CFG_MONITOR_BASE (CFG_MAX_RAM_SIZE - CFG_MONITOR_LEN)
@@ -295,10 +300,6 @@#define CFG_GBL_DATA_ADDR (CFG_MALLOC_BASE - CFG_GBL_DATA_SIZE)#define CONFIG_STACKBASE (CFG_GBL_DATA_ADDR - 4) -#define CFG_BOOTMAPSZ (8 << 20)/* Initial Memory map for Linux */ -#define CFG_MAX_FLASH_BANKS 1/* max number of memory banks */ -#define CFG_MAX_FLASH_SECT 71/* max number of sectors on one chip */ -#if (BFIN_BOOT_MODE ==BF537_BYPASS_BOOT ) || (BFIN_BOOT_MODE ==BF537_UART_BOOT )/* for bf537-stamp, usrt boot mode still store env in flash */ #define CFG_ENV_IS_IN_FLASH 1
Signature · 1 line
1.5.4.2
[U-Boot-Users] [PATCH/review] Blackfin: BF537-stamp: cleanup spi flash driver
This punts the old spi flash driver for a new/generalized one.
--- board/bf533-stamp/Makefile | 2 +- board/bf533-stamp/spi.c | 474 ----------------------- board/bf533-stamp/spi_flash.c | 2 + board/bf537-stamp/Makefile | 2 +- board/bf537-stamp/spi_flash.c | 815 ++++++++++++++++++++++++++++++++++++++++ board/bf537-stamp/stm_m25p64.c | 516 ------------------------- 6 files changed, 819 insertions(+), 992 deletions(-) delete mode 100644 board/bf533-stamp/spi.c create mode 100644 board/bf533-stamp/spi_flash.c create mode 100644 board/bf537-stamp/spi_flash.c delete mode 100644 board/bf537-stamp/stm_m25p64.c
board/bf533-stamp/Makefile +1 -1
@@ -29,7 +29,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).a -COBJS := $(BOARD).o spi.o +COBJS := $(BOARD).o spi_flash.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
board/bf533-stamp/spi_flash.c new file +2 -0
@@ -0,0 +1,2 @@ +/* Share the spi flash code */ +#include "../bf537-stamp/spi_flash.c"
board/bf537-stamp/Makefile +1 -1
@@ -29,7 +29,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).a -COBJS := $(BOARD).o post-memory.o stm_m25p64.o cmd_bf537led.o nand.o +COBJS := $(BOARD).o post-memory.o spi_flash.o cmd_bf537led.o nand.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
board/bf537-stamp/spi_flash.c new file +815 -0
815 lines not on this page · raw message
Signature · 1 line
1.5.4.2
[U-Boot-Users] [PATCH/review] Blackfin: unify cpu and boot modes
All of the duplicated code for Blackfin processors and boot modes have been unified. After all, the core is the same for all processors, just the peripheral set differs (which gets handled in the drivers).
--- Makefile | 4 +- blackfin_config.mk | 3 + cpu/bf533/Makefile | 52 --- cpu/bf533/bf533_serial.h | 77 ---- cpu/bf533/cache.S | 129 ------ cpu/bf533/config.mk | 27 -- cpu/bf533/cpu.c | 213 ---------- cpu/bf533/cpu.h | 66 --- cpu/bf533/flush.S | 405 ------------------- cpu/bf533/init_sdram.S | 183 --------- cpu/bf533/init_sdram_bootrom_initblock.S | 183 --------- cpu/bf533/interrupt.S | 244 ----------- cpu/bf533/interrupts.c | 165 -------- cpu/bf533/ints.c | 112 ------ cpu/bf533/serial.c | 186 --------- cpu/bf533/start.S | 313 --------------- cpu/bf533/start1.S | 38 -- cpu/bf533/traps.c | 238 ----------- cpu/bf533/video.c | 194 --------- cpu/bf533/video.h | 25 -- cpu/bf537/Makefile | 52 --- cpu/bf537/cache.S | 129 ------ cpu/bf537/config.mk | 27 -- cpu/bf537/cpu.c | 219 ---------- cpu/bf537/cpu.h | 66 --- cpu/bf537/flush.S | 403 ------------------- cpu/bf537/i2c.c | 418 ------------------- cpu/bf537/init_sdram.S | 178 --------- cpu/bf537/init_sdram_bootrom_initblock.S | 203 ---------- cpu/bf537/interrupt.S | 244 ----------- cpu/bf537/interrupts.c | 170 -------- cpu/bf537/ints.c | 112 ------ cpu/bf537/serial.c | 186 --------- cpu/bf537/serial.h | 77 ---- cpu/bf537/start.S | 576 --------------------------- cpu/bf537/start1.S | 38 -- cpu/bf537/traps.c | 239 ----------- cpu/bf537/video.c | 194 --------- cpu/bf537/video.h | 25 -- cpu/bf561/Makefile | 52 --- cpu/bf561/cache.S | 129 ------ cpu/bf561/config.mk | 27 -- cpu/bf561/cpu.c | 212 ---------- cpu/bf561/cpu.h | 66 --- cpu/bf561/flush.S | 402 ------------------- cpu/bf561/init_sdram.S | 175 -------- cpu/bf561/init_sdram_bootrom_initblock.S | 189 --------- cpu/bf561/interrupt.S | 244 ----------- cpu/bf561/interrupts.c | 167 -------- cpu/bf561/ints.c | 112 ------ cpu/bf561/serial.c | 188 --------- cpu/bf561/serial.h | 77 ---- cpu/bf561/start.S | 303 -------------- cpu/bf561/start1.S | 38 -- cpu/bf561/traps.c | 238 ----------- cpu/bf561/video.c | 194 --------- cpu/bf561/video.h | 25 -- cpu/blackfin/.gitignore | 1 + cpu/blackfin/Makefile | 65 +++ cpu/blackfin/bootrom-asm-offsets.awk | 41 ++ cpu/blackfin/bootrom-asm-offsets.c.in | 12 + cpu/blackfin/cache.S | 61 +++ cpu/blackfin/cpu.c | 141 +++++++ cpu/blackfin/cpu.h | 38 ++ cpu/blackfin/flush.S | 230 +++++++++++ cpu/blackfin/initcode.c | 353 ++++++++++++++++ cpu/blackfin/interrupt.S | 33 ++ cpu/blackfin/interrupts.c | 155 +++++++ cpu/blackfin/reset.c | 96 +++++ cpu/blackfin/serial.c | 124 ++++++ cpu/blackfin/serial.h | 275 +++++++++++++ cpu/blackfin/start.S | 219 ++++++++++ cpu/blackfin/system_map.S | 18 + cpu/blackfin/traps.c | 353 ++++++++++++++++ cpu/blackfin/watchdog.c | 25 ++ include/asm-blackfin/blackfin-config-post.h | 6 +- include/configs/bf533-ezkit.h | 44 +-- include/configs/bf533-stamp.h | 113 +----- include/configs/bf537-stamp.h | 104 +---- include/configs/bf561-ezkit.h | 40 +-- lib_blackfin/board.c | 39 +-- 100 files changed, 3422 insertions(+), 10330 deletions(-) delete mode 100644 cpu/bf533/Makefile delete mode 100644 cpu/bf533/bf533_serial.h delete mode 100644 cpu/bf533/cache.S delete mode 100644 cpu/bf533/config.mk delete mode 100644 cpu/bf533/cpu.c delete mode 100644 cpu/bf533/cpu.h delete mode 100644 cpu/bf533/flush.S delete mode 100644 cpu/bf533/init_sdram.S delete mode 100644 cpu/bf533/init_sdram_bootrom_initblock.S delete mode 100644 cpu/bf533/interrupt.S delete mode 100644 cpu/bf533/interrupts.c delete mode 100644 cpu/bf533/ints.c delete mode 100644 cpu/bf533/serial.c delete mode 100644 cpu/bf533/start.S delete mode 100644 cpu/bf533/start1.S delete mode 100644 cpu/bf533/traps.c delete mode 100644 cpu/bf533/video.c delete mode 100644 cpu/bf533/video.h delete mode 100644 cpu/bf537/Makefile delete mode 100644 cpu/bf537/cache.S delete mode 100644 cpu/bf537/config.mk delete mode 100644 cpu/bf537/cpu.c delete mode 100644 cpu/bf537/cpu.h delete mode 100644 cpu/bf537/flush.S delete mode 100644 cpu/bf537/i2c.c delete mode 100644 cpu/bf537/init_sdram.S delete mode 100644 cpu/bf537/init_sdram_bootrom_initblock.S delete mode 100644 cpu/bf537/interrupt.S delete mode 100644 cpu/bf537/interrupts.c delete mode 100644 cpu/bf537/ints.c delete mode 100644 cpu/bf537/serial.c delete mode 100644 cpu/bf537/serial.h delete mode 100644 cpu/bf537/start.S delete mode 100644 cpu/bf537/start1.S delete mode 100644 cpu/bf537/traps.c delete mode 100644 cpu/bf537/video.c delete mode 100644 cpu/bf537/video.h delete mode 100644 cpu/bf561/Makefile delete mode 100644 cpu/bf561/cache.S delete mode 100644 cpu/bf561/config.mk delete mode 100644 cpu/bf561/cpu.c delete mode 100644 cpu/bf561/cpu.h delete mode 100644 cpu/bf561/flush.S delete mode 100644 cpu/bf561/init_sdram.S delete mode 100644 cpu/bf561/init_sdram_bootrom_initblock.S delete mode 100644 cpu/bf561/interrupt.S delete mode 100644 cpu/bf561/interrupts.c delete mode 100644 cpu/bf561/ints.c delete mode 100644 cpu/bf561/serial.c delete mode 100644 cpu/bf561/serial.h delete mode 100644 cpu/bf561/start.S delete mode 100644 cpu/bf561/start1.S delete mode 100644 cpu/bf561/traps.c delete mode 100644 cpu/bf561/video.c delete mode 100644 cpu/bf561/video.h create mode 100644 cpu/blackfin/.gitignore create mode 100644 cpu/blackfin/Makefile create mode 100755 cpu/blackfin/bootrom-asm-offsets.awk create mode 100644 cpu/blackfin/bootrom-asm-offsets.c.in create mode 100644 cpu/blackfin/cache.S create mode 100644 cpu/blackfin/cpu.c create mode 100644 cpu/blackfin/cpu.h create mode 100644 cpu/blackfin/flush.S create mode 100644 cpu/blackfin/i2c.c create mode 100644 cpu/blackfin/initcode.c create mode 100644 cpu/blackfin/interrupt.S create mode 100644 cpu/blackfin/interrupts.c create mode 100644 cpu/blackfin/reset.c create mode 100644 cpu/blackfin/serial.c create mode 100644 cpu/blackfin/serial.h create mode 100644 cpu/blackfin/start.S create mode 100644 cpu/blackfin/system_map.S create mode 100644 cpu/blackfin/traps.c create mode 100644 cpu/blackfin/watchdog.c
Makefile +3 -1
@@ -2834,7 +2834,8 @@ xupv2p_config: unconfig BFIN_BOARDS = bf533-ezkit bf533-stamp bf537-stamp bf561-ezkit $(BFIN_BOARDS:%=%_config) : unconfig - @$(MKCONFIG) $(@:_config=) blackfin $(firstword $(subst -, ,$@)) $(@:_config=) + @$(MKCONFIG) $(@:_config=) blackfin blackfin $(@:_config=) +# @$(MKCONFIG) $(@:_config=) blackfin $(firstword $(subst -, ,$@)) $(@:_config=) $(BFIN_BOARDS): $(MAKE) $@_config
@@ -2911,6 +2912,7 @@ clean: @rm -f $(obj)board/integratorap/u-boot.lds $(obj)board/integratorcp/u-boot.lds @rm -f $(obj)board/bf533-ezkit/u-boot.lds $(obj)board/bf533-stamp/u-boot.lds @rm -f $(obj)board/bf537-stamp/u-boot.lds $(obj)board/bf561-ezkit/u-boot.lds + @rm -f $(obj)cpu/blackfin/bootrom-asm-offsets.[chs] @rm -f $(obj)include/bmp_logo.h @rm -f $(obj)nand_spl/u-boot-spl $(obj)nand_spl/u-boot-spl.map @rm -f $(obj)onenand_ipl/onenand-ipl $(obj)onenand_ipl/onenand-ipl.bin \
blackfin_config.mk +3 -0
@@ -21,6 +21,9 @@ # MA 02111-1307 USA # +CONFIG_BFIN_CPU := $(strip $(subst ",,$(CONFIG_BFIN_CPU))) +CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE))) + PLATFORM_RELFLAGS += -ffixed-P5 PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN
board/bf537-stamp/bf537-stamp.c +1 -11
@@ -120,12 +120,11 @@ long int initdram(int board_type)/* miscellaneous platform dependent initialisations */ int misc_init_r (void ) { -#if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT) +#if defined(CONFIG_CMD_NET )char nid[32 ];unsigned char *pMACaddr = (unsigned char *)0x203F0000 ;u8 SrcAddr[6 ] = {0x02 ,0x80 ,0xAD ,0x20 ,0x31 ,0xB8 }; -#if defined(CONFIG_CMD_NET)/* The 0xFF check here is to make sure we don't use the address * in flash if it's simply been erased (aka all 0xFF values) */ if (getenv ("ethaddr" ) ==NULL &&is_valid_ether_addr (pMACaddr)) {
@@ -135,7 +134,6 @@ int misc_init_r(void) setenv("ethaddr", nid); }#endif -#endif /* BFIN_BOOT_MODE == BF537_BYPASS_BOOT */ #if defined(CONFIG_BFIN_IDE )#if defined(CONFIG_BFIN_TRUE_IDE )
@@ -158,13 +156,6 @@ int misc_init_r(void)#endif /* CONFIG_MISC_INIT_R */ #ifdef CONFIG_POST -#if (BFIN_BOOT_MODE != BF537_BYPASS_BOOT) -/* Using sw10-PF5 as the hotkey */ -int post_hotkeys_pressed(void) -{ - return 0; -} -#else/* Using sw10-PF5 as the hotkey */ int post_hotkeys_pressed (void ) {
@@ -197,7 +188,6 @@ int post_hotkeys_pressed(void) } }#endif -#endif #if defined(CONFIG_POST ) || defined(CONFIG_LOGBUFFER )void post_word_store (ulong a)
cpu/blackfin/.gitignore new file +1 -0
@@ -0,0 +1 @@ +bootrom-asm-offsets.[chs]
cpu/blackfin/Makefile new file +65 -0
65 lines not on this page · raw message
cpu/blackfin/bootrom-asm-offsets.awk new file +41 -0
41 lines not on this page · raw message
cpu/blackfin/bootrom-asm-offsets.c.in new file +12 -0
@@ -0,0 +1,12 @@ +/* A little trick taken from the kernel asm-offsets.h where we convert + * the C structures automatically into a bunch of defines for use in + * the assembly files. + */ + +#include <linux/stddef.h> +#include <asm/mach-common/bits/bootrom.h> + +#define _DEFINE(sym, val) asm volatile("\n->" #sym " %0 " #val : : "i" (val)) +#define DEFINE(s, m) _DEFINE(offset_##s##_##m, offsetof(s, m)) + +int main(int argc, char *argv[])
cpu/blackfin/cache.S new file +61 -0
61 lines not on this page · raw message
cpu/blackfin/cpu.c new file +141 -0
141 lines not on this page · raw message
cpu/blackfin/cpu.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* U-boot - cpu.h +* +* Copyright (c) 2005-2007 Analog Devices Inc. +* +* 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., 51 Franklin St, Fifth Floor, Boston, +* MA 02110-1301 USA +*/ + +#ifndef _CPU_H_ +#define _CPU_H_ + +#include <command.h> + +void board_reset (void ) __attribute__((__weak__)); +void bfin_reset_or_hang (void ) __attribute__((__noreturn__)); +void bfin_panic (struct pt_regs *reg); +void dump (struct pt_regs *regs); + +asmlinkage void trap(void); +asmlinkage void evt_default(void); + +#endif
cpu/blackfin/flush.S new file +230 -0
230 lines not on this page · raw message
cpu/blackfin/initcode.c new file +353 -0
353 lines not on this page · raw message
cpu/blackfin/interrupt.S new file +33 -0
@@ -0,0 +1,33 @@ +/* + * interrupt.S - trampoline default exceptions/interrupts to C handlers + * + * Copyright (c) 2005-2007 Analog Devices Inc. + * Licensed under the GPL-2 or later. + */ + +#include <asm/blackfin.h> +#include <asm/entry.h> + +.text + +/* default entry point for exceptions */ +ENTRY(_trap) + SAVE_ALL_SYS + r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */ + sp += -12; + call _trap_c; + sp += 12; + RESTORE_ALL_SYS + rtx; +ENDPROC(_trap) + +/* default entry point for interrupts */ +ENTRY(_evt_default) + SAVE_ALL_SYS + r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */ + sp += -12; + call _bfin_panic; + sp += 12; + RESTORE_ALL_SYS + rti; +ENDPROC(_evt_default)
cpu/blackfin/interrupts.c new file +155 -0
155 lines not on this page · raw message
cpu/blackfin/reset.c new file +96 -0
96 lines not on this page · raw message
cpu/blackfin/serial.c new file +124 -0
124 lines not on this page · raw message
cpu/blackfin/serial.h new file +275 -0
275 lines not on this page · raw message
cpu/blackfin/start.S new file +219 -0
219 lines not on this page · raw message
cpu/blackfin/system_map.S new file +18 -0
@@ -0,0 +1,18 @@ +/* + * system_map.S - optional symbol lookup for debugging + * + * Copyright (c) 2007 Analog Devices Inc. + * Licensed under the GPL-2 or later. + */ + +#include <config.h> + +#ifdef CONFIG_DEBUG_DUMP_SYMS +.data +.global _system_map +.type _system_map, at object +_system_map: +#include SYM_FILE +.asciz "" +.size _system_map,.-_system_map +#endif
cpu/blackfin/traps.c new file +353 -0
353 lines not on this page · raw message
cpu/blackfin/watchdog.c new file +25 -0
@@ -0,0 +1,25 @@ +/* +* watchdog.c - driver for Blackfin on-chip watchdog +* +* Copyright (c) 2007-2008 Analog Devices Inc. +* +* Licensed under the GPL-2 or later. +*/ + +#include <common.h> +#include <watchdog.h> +#include <asm/blackfin.h> + +#ifdef CONFIG_HW_WATCHDOG +void hw_watchdog_reset (void ) +{ +bfin_write_WDOG_STAT (0 ); +} + +void hw_watchdog_init (void ) +{ +bfin_write_WDOG_CNT (5 *get_sclk ());/* 5 second timeout */ +hw_watchdog_reset (); +bfin_write_WDOG_CTL (0x0 ); +} +#endif
include/asm-blackfin/blackfin-config-post.h +3 -3
@@ -14,9 +14,9 @@# error Memory Map does not fit into configuration#endif -/* Sanity check BFIN_CPU */ -#ifndef BFIN_CPU -# error BFIN_CPU: your board config needs to define this +/* Sanity check CONFIG_BFIN_CPU */ +#ifndef CONFIG_BFIN_CPU +# error CONFIG_BFIN_CPU: your board config needs to define this#endif /* Make sure the structure is properly aligned */
include/configs/bf533-ezkit.h +10 -34
69 lines not on this page · raw message
include/configs/bf533-stamp.h +17 -96
200 lines not on this page · raw message
include/configs/bf537-stamp.h +18 -86
199 lines not on this page · raw message
include/configs/bf561-ezkit.h +8 -32
@@ -7,9 +7,6 @@#include <asm/blackfin-config-pre.h> -#define CONFIG_VDSP 1 -#define CONFIG_BF561 1 -#define CFG_LONGHELP 1#define CONFIG_CMDLINE_EDITING 1#define CONFIG_BAUDRATE 57600
@@ -21,30 +18,12 @@#define CONFIG_PANIC_HANG 1#define CONFIG_BFIN_CPU bf561-0.3 - -/* -* Boot Mode Set -* Blackfin can support several boot modes -*/ -#define BF561_BYPASS_BOOT 0x21 -#define BF561_PARA_BOOT 0x22 -#define BF561_SPI_BOOT 0x24 -/* Define the boot mode */ -#define BFIN_BOOT_MODE BF561_BYPASS_BOOT +#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS/* This sets the default state of the cache on U-Boot's boot */ #define CONFIG_ICACHE_ON #define CONFIG_DCACHE_ON -/* Define where the uboot will be loaded by on-chip boot rom */ -#define APP_ENTRY 0x00001000 - -/* -* Stringize definitions - needed for environmental settings -*/ -#define STRINGIZE2 (x) #x -#define STRINGIZE (x) STRINGIZE2(x) -/* * Board settings */
@@ -242,17 +221,14 @@/* * FLASH organization and environment definitions */ -#define CFG_BOOTMAPSZ (8 << 20)/* Initial Memory map for Linux */ +#define CONFIG_EBIU_SDRRC_VAL 0x306 +#define CONFIG_EBIU_SDGCTL_VAL 0x91114d +#define CONFIG_EBIU_SDBCTL_VAL 0x15 -#define AMGCTLVAL 0x3F -#define AMBCTL0VAL 0x7BB07BB0 -#define AMBCTL1VAL 0xFFC27BB0 +#define CONFIG_EBIU_AMGCTL_VAL 0x3F +#define CONFIG_EBIU_AMBCTL0_VAL 0x7BB07BB0 +#define CONFIG_EBIU_AMBCTL1_VAL 0xFFC27BB0 -#ifdef CONFIG_VDSP -#define ET_EXEC_VDSP 0x8 -#define SHT_STRTAB_VDSP 0x1 -#define ELFSHDRSIZE_VDSP 0x2C -#define VDSP_ENTRY_ADDR 0xFFA00000 -#endif +#include <asm/blackfin-config-post.h> #endif /* __CONFIG_EZKIT561_H__ */
lib_blackfin/board.c +6 -33
@@ -37,7 +37,7 @@#include <asm/cplb.h> #include "../drivers/net/smc91111.h" -#if defined(CONFIG_BF537 )&&defined(CONFIG_POST ) +#if defined(CONFIG_POST )#include <post.h> int post_flag;#endif
@@ -192,21 +192,8 @@ void init_cplbtables(void) } j++; } -#if defined(CONFIG_BF561 ) -/* MAC space */ - icplb_table[j][0 ] =0x2C000000 ; - icplb_table[j][1 ] =SDRAM_INON_CHBL ; - j++; -/* Async Memory space */ -for (i =0 ; i <3 ; i++) { - icplb_table[j][0 ] =0x20000000 + i *4 *1024 *1024 ; - icplb_table[j][1 ] =SDRAM_INON_CHBL ; - j++; - } -#else icplb_table[j][0 ] =0x20000000 ; icplb_table[j][1 ] =SDRAM_INON_CHBL ; -#endif j =0 ; dcplb_table[j][0 ] =0xFF800000 ; dcplb_table[j][1 ] =L1_DMEMORY ;
@@ -223,22 +210,8 @@ void init_cplbtables(void) j++; } -#if defined(CONFIG_BF561 ) -/* MAC space */ - dcplb_table[j][0 ] =0x2C000000 ; - dcplb_table[j][1 ] =SDRAM_EBIU ; - j++; - -/* Flash space */ -for (i =0 ; i <3 ; i++) { - dcplb_table[j][0 ] =0x20000000 + i *4 *1024 *1024 ; - dcplb_table[j][1 ] =SDRAM_EBIU ; - j++; - } -#else dcplb_table[j][0 ] =0x20000000 ; dcplb_table[j][1 ] =SDRAM_EBIU ; -#endif }/*
@@ -275,7 +248,7 @@ void board_init_f(ulong bootflag)memset ((void *)bd,0 ,sizeof (bd_t));/* Initialize */ -init_IRQ (); +irq_init ();env_init ();/* initialize environment */ init_baudrate ();/* initialze baudrate settings */ serial_init ();/* serial communications setup */
@@ -304,7 +277,7 @@ void board_init_f(ulong bootflag) get_vco() / 1000000, get_cclk() / 1000000, get_sclk() / 1000000);printf ("SDRAM: " );print_size (initdram (0 ),"\n" ); -#if defined(CONFIG_BF537 )&&defined(CONFIG_POST ) +#if defined(CONFIG_POST )post_init_f ();post_bootmode_init ();post_run (NULL ,POST_ROM |post_bootmode_get (0 ));
@@ -333,12 +306,12 @@ void board_init_r(gd_t * id, ulong dest_addr) gd->flags |=GD_FLG_RELOC ;/* tell others: relocation done */ bd = gd->bd; -#if defined(CONFIG_BF537 ) && defined(CONFIG_POST ) +#if defined(CONFIG_POST )post_output_backlog ();post_reloc ();#endif -#if (CONFIG_STAMP ||CONFIG_BF537 ||CONFIG_EZKIT561 ) && !defined(CFG_NO_FLASH ) +#if !defined(CFG_NO_FLASH )/* There are some other pointer constants we must deal with */ /* configure available FLASH banks */ size =flash_init ();
@@ -434,7 +407,7 @@ void board_init_r(gd_t * id, ulong dest_addr)display_global_data ();#endif -#if defined(CONFIG_BF537 ) && defined(CONFIG_POST ) +#if defined(CONFIG_POST )if (post_flag)post_run (NULL ,POST_RAM |post_bootmode_get (0 ));#endif
Signature · 1 line
1.5.4.2
[U-Boot-Users] [PATCH/review] Blackfin: new cplbinfo command for viewing cplb tables
--- common/Makefile | 1 + common/cmd_cplbinfo.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 0 deletions(-) create mode 100644 common/cmd_cplbinfo.c
common/Makefile +1 -0
@@ -41,6 +41,7 @@ COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-y += cmd_bootm.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o +COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o COBJS-$(CONFIG_CMD_DATE) += cmd_date.o ifdef CONFIG_4xx COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
common/cmd_cplbinfo.c new file +59 -0
59 lines not on this page · raw message
Signature · 1 line
1.5.4.2
[U-Boot-Users] [PATCH/review] Blackfin: add proper ELF markings to some assembly functions
--- lib_blackfin/memcmp.S | 3 +++ lib_blackfin/memcpy.S | 3 +++ lib_blackfin/memmove.S | 3 +++ lib_blackfin/memset.S | 3 +++ 4 files changed, 12 insertions(+), 0 deletions(-)
lib_blackfin/memcmp.S +3 -0
@@ -31,6 +31,7 @@ */ .globl _memcmp; +.type _memcmp, STT_FUNC; _memcmp: I1 = P3; P0 = R0; /* P0 = s1 address */
@@ -98,3 +99,5 @@ _memcmp: R0 = 0; P3 = I1; RTS; + +.size _memcmp, .-_memcmp
lib_blackfin/memcpy.S +3 -0
@@ -23,6 +23,7 @@ .align 2 .globl _memcpy_ASM; +.type _memcpy_ASM, STT_FUNC; _memcpy_ASM: CC = R2 <= 0; /* length not positive?*/ IF CC JUMP .L_P1L2147483647; /* Nothing to do */
@@ -112,3 +113,5 @@ _memcpy_ASM: B[P0--] = R1; RTS; + +.size _memcpy_ASM, .-_memcpy_ASM
lib_blackfin/memmove.S +3 -0
@@ -31,6 +31,7 @@ */ .globl _memmove; +.type _memmove, STT_FUNC; _memmove: I1 = P3; P0 = R0; /* P0 = To address */
@@ -91,3 +92,5 @@ _memmove: .Lno_loop: B[P0] = R1; P3 = I1; RTS; + +.size _memmove, .-_memmove
lib_blackfin/memset.S +3 -0
@@ -31,6 +31,7 @@ */ .globl _memset; +.type _memset, STT_FUNC; _memset: P0 = R0 ; /* P0 = address */ P2 = R2 ; /* P2 = count */
@@ -91,3 +92,5 @@ _memset: B[P0++] = R1; B[P0++] = R1; JUMP .Laligned; + +.size _memset, .-_memset
Signature · 1 line
1.5.4.2
[U-Boot-Users] [PATCH/review] Blackfin: cleanup lib_blackfin/cache.c
--- lib_blackfin/cache.c | 35 ++++++++--------------------------- lib_blackfin/cache.h | 35 ----------------------------------- 2 files changed, 8 insertions(+), 62 deletions(-) delete mode 100644 lib_blackfin/cache.h
lib_blackfin/cache.c +8 -27
@@ -1,45 +1,26 @@/* * U-boot - cache.c * -* Copyright (c) 2005-2007 Analog Devices Inc. +* Copyright (c) 2005-2008 Analog Devices Inc. * * (C) Copyright 2000-2004 * 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., 51 Franklin St, Fifth Floor, Boston, -* MA 02110-1301 USA +* Licensed under the GPL-2 or later. */ -/* for now: just dummy functions to satisfy the linker */ -#include <config.h> #include <common.h> #include <asm/blackfin.h> -#include "cache.h" -void flush_cache (unsigned long dummy1,unsigned long dummy2) +void flush_cache (unsigned long addr,unsigned long size) { -if (dummy1 >=0xE0000000 ) +/* no need to flush stuff in on chip memory (L1/L2/etc...) */ +if (addr >=0xE0000000 )return ;if (icache_status ()) -blackfin_icache_flush_range ((void *)dummy1, (void *)(dummy1 + dummy2)); -if (dcache_status ()) -blackfin_dcache_flush_range ((void *)dummy1, (void *)(dummy1 + dummy2)); +blackfin_icache_flush_range ((void *)addr, (void *)(addr + size)); -return ; +if (dcache_status ()) +blackfin_dcache_flush_range ((void *)addr, (void *)(addr + size)); }
lib_blackfin/cache.h deleted +0 -35
@@ -1,35 +0,0 @@ -/* -* U-boot - prototypes for cache handling functions. -* -* Copyright (c) 2005-2007 Analog Devices Inc. -* -* (C) Copyright 2000-2004 -* 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, see the file COPYING, or write -* to the Free Software Foundation, Inc., -* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _LIB_BLACKFIN_CACHE_H_ -#define _LIB_BLACKFIN_CACHE_H_ - -extern void blackfin_icache_flush_range (const void *,const void *); -extern void blackfin_dcache_flush_range (const void *,const void *); -extern void blackfin_dcache_invalidate_range (const void *,const void *); - -#endif
Signature · 1 line
1.5.4.2
[U-Boot-Users] [PATCH/review] Blackfin: cleanup and overhaul common board init functions
--- lib_blackfin/Makefile | 4 +- lib_blackfin/blackfin_board.h | 64 ------- lib_blackfin/board.c | 394 +++++++++++++++++++++++------------------ 3 files changed, 226 insertions(+), 236 deletions(-) delete mode 100644 lib_blackfin/blackfin_board.h
lib_blackfin/Makefile +3 -1
@@ -1,7 +1,7 @@ # # U-boot Makefile # -# Copyright (c) 2005-2007 Analog Devices Inc. +# Copyright (c) 2005-2008 Analog Devices Inc. # # (C) Copyright 2000-2006 # Wolfgang Denk, DENX Software Engineering, wd at denx.de.
@@ -27,6 +27,8 @@ include $(TOPDIR)/config.mk +CFLAGS += -DBFIN_BOARD_NAME='"$(BOARD)"' + LIB = $(obj)lib$(ARCH).a SOBJS = memcpy.o memcmp.o memset.o memmove.o
lib_blackfin/blackfin_board.h deleted +0 -64
64 lines not on this page · raw message
lib_blackfin/board.c +223 -171
561 lines not on this page · raw message
Signature · 1 line
1.5.4.2
[U-Boot-Users] [PATCH/review] Blackfin: add error debug to serial driver
This adds a new CONFIG_DEBUG_SERIAL define so that people can figure out if/when their serial port is hitting errors.
--- cpu/blackfin/serial.c | 57 +++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 48 insertions(+), 9 deletions(-)
cpu/blackfin/serial.c +48 -9
@@ -35,6 +35,29 @@#include "serial.h" +#ifdef CONFIG_DEBUG_SERIAL +uint16_t cached_lsr[256 ]; +uint16_t cached_rbr[256 ]; +size_t cache_count; +#endif + +/* The LSR is read-to-clear on some parts, so we have to make sure status +* bits aren't inadvertently lost when doing various tests. +*/ +static uint16_t uart_lsr_save; +static uint16_t uart_lsr_read (void ) +{ +uint16_t lsr = *pUART_LSR; + uart_lsr_save |= (lsr & (OE |PE |FE |BI )); +return lsr | uart_lsr_save; +} +/* Just do the clear for everyone since it can't hurt. */ +static void uart_lsr_clear (void ) +{ + uart_lsr_save =0 ; + *pUART_LSR |=-1 ; +} +/* Symbol for our assembly to call. */ void serial_set_baud (uint32_t baud) {
@@ -61,6 +84,12 @@ int serial_init(void) {serial_initialize ();serial_setbrg (); +uart_lsr_clear (); +#ifdef CONFIG_DEBUG_SERIAL + cache_count =0 ; +memset (cached_lsr,0x00 ,sizeof (cached_lsr)); +memset (cached_rbr,0x00 ,sizeof (cached_rbr)); +#endif return 0 ; }
@@ -73,7 +102,7 @@ void serial_putc(const char c)WATCHDOG_RESET ();/* wait for the hardware fifo to clear up */ -while (!(*pUART_LSR &THRE )) +while (!(uart_lsr_read () &THRE ))continue ;/* queue the character for transmission */
@@ -83,14 +112,14 @@ void serial_putc(const char c)WATCHDOG_RESET ();/* wait for the byte to be shifted over the line */ -while (!(*pUART_LSR &TEMT )) +while (!(uart_lsr_read () &TEMT ))continue ; }int serial_tstc (void ) {WATCHDOG_RESET (); -return (*pUART_LSR &DR ) ?1 :0 ; +return (uart_lsr_read () &DR ) ?1 :0 ; }int serial_getc (void )
@@ -102,15 +131,25 @@ int serial_getc(void)continue ;/* clear the status and grab the new byte */ - uart_lsr_val = *pUART_LSR; + uart_lsr_val =uart_lsr_read (); uart_rbr_val = *pUART_RBR; +#ifdef CONFIG_DEBUG_SERIAL + cached_lsr[cache_count] = uart_lsr_val; + cached_rbr[cache_count] = uart_rbr_val; + cache_count = (cache_count +1 ) %ARRAY_SIZE (cached_lsr); +#endif +if (uart_lsr_val & (OE |PE |FE |BI )) { -/* Some parts are read-to-clear while others are -* write-to-clear. Just do the write for everyone -* since it cant hurt (other than code size). -*/ - *pUART_LSR = (OE |PE |FE |BI ); +#ifdef CONFIG_DEBUG_SERIAL +printf ("\n[SERIAL ERROR]\n" ); +do { + --cache_count; +printf ("\t%3i: RBR=0x%02x LSR=0x%02x\n" , cache_count, + cached_rbr[cache_count], cached_lsr[cache_count]); + }while (cache_count >0 ); +#endif +uart_lsr_clear ();return -1 ; }
Signature · 1 line
1.5.4.2
[U-Boot-Users] [PATCH/review] Blackfin: BF537-stamp: cleanup spi flash driver
In reply to Mike FrysingerQuoted 3 lines · Mike Frysinger
This punts the old spi flash driver for a new/generalized one.
Signed-off-by Mike Frysinger <[email protected]>
As I said before, it will be good to merge the SPI flash to the common drivers/mtd and allow it to be usable on other architectures.
Best Regards,
J.
[U-Boot-Users] [PATCH/review] Blackfin: BF537-stamp: cleanup spi flash driver
Quoted 8 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 3 lines · Mike Frysinger
This punts the old spi flash driver for a new/generalized one.
Signed-off-by Mike Frysinger <[email protected]>As I said before, it will be good to merge the SPI flash to the common
drivers/mtdand allow it to be usable on other architectures.
and as i said before, that's already being done and is not a reason to hold up working code.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080226/f5fbaa77/attachment.pgp
[U-Boot-Users] [PATCH/review] Blackfin: BF537-stamp: cleanup spi flash driver
Quoted 3 lines · In message <[email protected]> you wrote:
and as i said before, that's already being done and is not a reason to hold up working code.
Well, you gotta wait for the next merge window anyway, so maybe we could skip this temporay version and use the new one right from the beginning?
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
When it is incorrect, it is, at least *authoritatively* incorrect.
- Hitchiker's Guide To The Galaxy[U-Boot-Users] [PATCH/review] Blackfin: BF537-stamp: cleanup spi flash driver
Quoted 7 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> you wrote:
and as i said before, that's already being done and is not a reason to hold up working code.
Well, you gotta wait for the next merge window anyway, so maybe we could skip this temporay version and use the new one right from the beginning?
no, because it isnt done, and it's going to be a while in the making. it relies on the SPI pieces that arent in and it needs sector protection added. -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080228/159f4765/attachment.pgp