[U-Boot] [PATCH 00/28] Blackfin updates for v2011.03

More processor header cleanups, board config.mk unification and removal, a few new board ports, and random bug fixes. Most clean up work is to address complaints from Wolfgang since he won't pull patches otherwise.
The processor header updates are too large for the list, but you can of course find them in my git tree: git://git.denx.de/u-boot-blackfin.git
Andreas Schallenberg (1): Blackfin: dnp5370: new board port
Chong Huang (1): Blackfin: bf525-ucr2: new board port
Mike Frysinger (26): MAINTAINERS: sort Blackfin entries Blackfin: bf518f-ezbrd: don't require SPI logic all the time Blackfin: skip RAM display for 0 mem systems Blackfin: drop CONFIG_SYS_TEXT_BASE from boards Blackfin: unify bootmode based LDR_FLAGS setup Blackfin: move CONFIG_BFIN_CPU back to board config.h Blackfin: bf527-sdp: update custom CFLAGS paths Blackfin: bf537-pnav/blackstamp/blackvme: drop empty config.mk files Blackfin: serial: clean up muxing a bit Blackfin: bf537-minotaur/bf537-srv1: undefine nfs when net is disabled Blackfin: bf537: fix L1 data defines Blackfin: bf561-ezkit/ibf-dsp561: invert env offset/addr logic Blackfin: fix bd_t handling Blackfin: BF50x: new processor port Blackfin: drop duplicate system mmr and L1 scratch defines Blackfin: BF52x: unify duplicated headers Blackfin: BF537: unify duplicated headers Blackfin: only check for os log when we have external memory Blackfin: turn off caches when self initializing Blackfin: default to L1 bank A when L1 bank B does not exist Blackfin: bf506f-ezkit: new board port Blackfin: adi boards: drop old ELF define Blackfin: bootrom.h: sync with toolchain Blackfin: bootldr: use common defines Blackfin: ldrinfo: new command Blackfin: adi boards: enable ldrinfo
MAINTAINERS | 54 +- arch/blackfin/config.mk | 15 +- arch/blackfin/cpu/gpio.c | 8 +- arch/blackfin/cpu/initcode.c | 25 +- arch/blackfin/cpu/serial.h | 72 +- arch/blackfin/cpu/start.S | 45 +- arch/blackfin/include/asm/blackfin_cdef.h | 6 + arch/blackfin/include/asm/blackfin_def.h | 10 + arch/blackfin/include/asm/config.h | 10 +- arch/blackfin/include/asm/mach-bf506/BF504_cdef.h | 1782 ++++++++++++++++++++ arch/blackfin/include/asm/mach-bf506/BF504_def.h | 944 +++++++++++ arch/blackfin/include/asm/mach-bf506/BF506_cdef.h | 11 + arch/blackfin/include/asm/mach-bf506/BF506_def.h | 11 + arch/blackfin/include/asm/mach-bf506/anomaly.h | 128 ++ arch/blackfin/include/asm/mach-bf506/def_local.h | 5 + arch/blackfin/include/asm/mach-bf506/gpio.h | 52 + arch/blackfin/include/asm/mach-bf506/portmux.h | 148 ++ arch/blackfin/include/asm/mach-bf506/ports.h | 59 + arch/blackfin/include/asm/mach-bf518/BF512_def.h | 6 - .../asm/mach-bf527/ADSP-EDN-BF52x-extended_cdef.h | 994 ----------- .../asm/mach-bf527/ADSP-EDN-BF52x-extended_def.h | 503 ------ arch/blackfin/include/asm/mach-bf527/BF522_cdef.h | 986 +++++++++++- arch/blackfin/include/asm/mach-bf527/BF522_def.h | 495 ++++++- arch/blackfin/include/asm/mach-bf527/BF524_cdef.h | 20 +- arch/blackfin/include/asm/mach-bf527/BF524_def.h | 12 +- arch/blackfin/include/asm/mach-bf527/BF526_cdef.h | 358 +---- arch/blackfin/include/asm/mach-bf527/BF526_def.h | 181 +-- arch/blackfin/include/asm/mach-bf533/BF531_def.h | 6 - arch/blackfin/include/asm/mach-bf533/BF532_def.h | 6 - arch/blackfin/include/asm/mach-bf533/BF533_def.h | 6 - .../asm/mach-bf537/ADSP-EDN-BF534-extended_cdef.h | 1624 ------------------ .../asm/mach-bf537/ADSP-EDN-BF534-extended_def.h | 819 --------- arch/blackfin/include/asm/mach-bf537/BF534_cdef.h | 1614 ++++++++++++++++++- arch/blackfin/include/asm/mach-bf537/BF534_def.h | 816 +++++++++- arch/blackfin/include/asm/mach-bf538/BF538_def.h | 6 - arch/blackfin/include/asm/mach-bf561/BF561_def.h | 7 +- .../include/asm/mach-common/bits/bootrom.h | 86 +- arch/blackfin/lib/board.c | 21 +- arch/blackfin/lib/u-boot.lds.S | 10 +- board/bct-brettl2/config.mk | 8 - board/bf506f-ezkit/Makefile | 54 + board/bf506f-ezkit/bf506f-ezkit.c | 27 + board/bf518f-ezbrd/bf518f-ezbrd.c | 30 +- board/bf518f-ezbrd/config.mk | 8 - board/bf525-ucr2/Makefile | 54 + board/bf525-ucr2/bf525-ucr2.c | 16 + board/bf526-ezbrd/config.mk | 8 - board/bf527-ad7160-eval/config.mk | 8 - board/bf527-ezkit/config.mk | 8 - board/bf527-sdp/config.mk | 10 +- board/bf533-ezkit/config.mk | 6 - board/bf533-stamp/config.mk | 6 - board/bf537-minotaur/config.mk | 8 +- board/bf537-pnav/config.mk | 32 - board/bf537-srv1/config.mk | 8 +- board/bf537-stamp/config.mk | 6 - board/bf538f-ezkit/config.mk | 6 - board/bf548-ezkit/config.mk | 6 - board/bf561-acvilon/config.mk | 6 - board/bf561-ezkit/config.mk | 6 - board/blackstamp/config.mk | 32 - board/blackvme/config.mk | 32 - board/cm-bf527/config.mk | 8 - board/cm-bf533/config.mk | 6 - board/cm-bf537e/config.mk | 6 - board/cm-bf537u/config.mk | 6 - board/cm-bf548/config.mk | 6 - board/cm-bf561/config.mk | 6 - board/dnp5370/Makefile | 54 + board/dnp5370/dnp5370.c | 104 ++ board/ibf-dsp561/config.mk | 6 - board/ip04/config.mk | 6 - board/tcm-bf518/config.mk | 8 - board/tcm-bf537/config.mk | 6 - boards.cfg | 3 + common/Makefile | 1 + common/cmd_bootldr.c | 21 +- common/cmd_ldrinfo.c | 192 +++ doc/README.dnp5370 | 67 + drivers/mmc/bfin_sdh.c | 2 +- drivers/spi/bfin_spi.c | 2 + include/configs/bct-brettl2.h | 3 +- include/configs/bf506f-ezkit.h | 106 ++ include/configs/bf518f-ezbrd.h | 1 + include/configs/bf525-ucr2.h | 102 ++ include/configs/bf526-ezbrd.h | 1 + include/configs/bf527-ad7160-eval.h | 1 + include/configs/bf527-ezkit.h | 1 + include/configs/bf527-sdp.h | 1 + include/configs/bf533-ezkit.h | 1 + include/configs/bf533-stamp.h | 1 + include/configs/bf537-minotaur.h | 2 + include/configs/bf537-pnav.h | 1 + include/configs/bf537-srv1.h | 2 + include/configs/bf537-stamp.h | 1 + include/configs/bf538f-ezkit.h | 1 + include/configs/bf548-ezkit.h | 1 + include/configs/bf561-acvilon.h | 3 +- include/configs/bf561-ezkit.h | 5 +- include/configs/bfin_adi_common.h | 2 +- include/configs/blackstamp.h | 1 + include/configs/blackvme.h | 3 +- include/configs/cm-bf527.h | 1 + include/configs/cm-bf533.h | 1 + include/configs/cm-bf537e.h | 1 + include/configs/cm-bf537u.h | 1 + include/configs/cm-bf548.h | 1 + include/configs/cm-bf561.h | 1 + include/configs/dnp5370.h | 128 ++ include/configs/ibf-dsp561.h | 5 +- include/configs/ip04.h | 1 + include/configs/tcm-bf518.h | 1 + include/configs/tcm-bf537.h | 1 + 113 files changed, 8257 insertions(+), 4981 deletions(-) create mode 100644 arch/blackfin/include/asm/mach-bf506/BF504_cdef.h create mode 100644 arch/blackfin/include/asm/mach-bf506/BF504_def.h create mode 100644 arch/blackfin/include/asm/mach-bf506/BF506_cdef.h create mode 100644 arch/blackfin/include/asm/mach-bf506/BF506_def.h create mode 100644 arch/blackfin/include/asm/mach-bf506/anomaly.h create mode 100644 arch/blackfin/include/asm/mach-bf506/def_local.h create mode 100644 arch/blackfin/include/asm/mach-bf506/gpio.h create mode 100644 arch/blackfin/include/asm/mach-bf506/portmux.h create mode 100644 arch/blackfin/include/asm/mach-bf506/ports.h delete mode 100644 arch/blackfin/include/asm/mach-bf527/ADSP-EDN-BF52x-extended_cdef.h delete mode 100644 arch/blackfin/include/asm/mach-bf527/ADSP-EDN-BF52x-extended_def.h delete mode 100644 arch/blackfin/include/asm/mach-bf537/ADSP-EDN-BF534-extended_cdef.h delete mode 100644 arch/blackfin/include/asm/mach-bf537/ADSP-EDN-BF534-extended_def.h create mode 100644 board/bf506f-ezkit/Makefile create mode 100644 board/bf506f-ezkit/bf506f-ezkit.c create mode 100644 board/bf525-ucr2/Makefile create mode 100644 board/bf525-ucr2/bf525-ucr2.c delete mode 100644 board/bf537-pnav/config.mk delete mode 100644 board/blackstamp/config.mk delete mode 100644 board/blackvme/config.mk create mode 100644 board/dnp5370/Makefile create mode 100644 board/dnp5370/dnp5370.c create mode 100644 common/cmd_ldrinfo.c create mode 100644 doc/README.dnp5370 create mode 100644 include/configs/bf506f-ezkit.h create mode 100644 include/configs/bf525-ucr2.h create mode 100644 include/configs/dnp5370.h

Signed-off-by: Mike Frysinger vapier@gentoo.org --- MAINTAINERS | 49 ++++++++++++++++++++++--------------------------- 1 files changed, 22 insertions(+), 27 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS index ba83f71..553930a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1033,6 +1033,7 @@ Blackfin Team u-boot-devel@blackfin.uclinux.org
BF518F-EZBRD BF518 BF526-EZBRD BF526 + BF527-AD7160-EVAL BF527 BF527-EZKIT BF527 BF527-EZKIT-V2 BF527 BF527-SDP BF527 @@ -1044,52 +1045,46 @@ Blackfin Team u-boot-devel@blackfin.uclinux.org BF548-EZKIT BF548 BF561-EZKIT BF561
- BF527-AD7160-EVAL BF527 +Brent Kandetzki brentk@teleco.com
-Bluetechnix Tinyboards bluetechnix@blackfin.uclinux.org -Blackfin Team u-boot-devel@blackfin.uclinux.org + IP04 BF532
- CM-BF527 BF527 - CM-BF533 BF533 - CM-BF537E BF537 - CM-BF537U BF537 - CM-BF548 BF548 - CM-BF561 BF561 - TCM-BF518 BF518 - TCM-BF537 BF537 +Peter Meerwald devel@bct-electronic.com
-Martin Strubel strubel@section5.ch -Blackfin Team u-boot-devel@blackfin.uclinux.org + bct-brettl2 BF536
- BF537-minotaur BF537 - BF537-srv1 BF537 +I-SYST Micromodule support@i-syst.com + + IBF-DSP561 BF561
Wojtek Skulski skulski@pas.rochester.edu Wojtek Skulski info@skutek.com -Blackfin Team u-boot-devel@blackfin.uclinux.org Benjamin Matthews mben12@gmail.com
BlackStamp BF533 BlackVME BF561
-I-SYST Micromodule support@i-syst.com -Blackfin Team u-boot-devel@blackfin.uclinux.org +Martin Strubel strubel@section5.ch
- IBF-DSP561 BF561 + BF537-minotaur BF537 + BF537-srv1 BF537 + +Bluetechnix Tinyboards bluetechnix@blackfin.uclinux.org + + CM-BF527 BF527 + CM-BF533 BF533 + CM-BF537E BF537 + CM-BF537U BF537 + CM-BF548 BF548 + CM-BF561 BF561 + TCM-BF518 BF518 + TCM-BF537 BF537
Valentin Yakovenkov yakovenkov@niistt.ru Anton Shurpin shurpin.aa@niistt.ru
BF561-ACVILON BF561
-Brent Kandetzki brentk@teleco.com - - IP04 BF532 - -Peter Meerwald devel@bct-electronic.com - - bct-brettl2 BF536 - ######################################################################### # End of MAINTAINERS list # #########################################################################

Dear Mike Frysinger,
In message 1293425300-27644-2-git-send-email-vapier@gentoo.org you wrote:
Signed-off-by: Mike Frysinger vapier@gentoo.org
MAINTAINERS | 49 ++++++++++++++++++++++--------------------------- 1 files changed, 22 insertions(+), 27 deletions(-)
Already applied.
Best regards,
Wolfgang Denk

Only the first run of boards had a ksz switch on it, so if building for a newer silicon rev or SPI is disabled, don't bother checking for the ksz.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- board/bf518f-ezbrd/bf518f-ezbrd.c | 30 +++++++++++++++++++++--------- 1 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/board/bf518f-ezbrd/bf518f-ezbrd.c b/board/bf518f-ezbrd/bf518f-ezbrd.c index ff1ac4c..6b455de 100644 --- a/board/bf518f-ezbrd/bf518f-ezbrd.c +++ b/board/bf518f-ezbrd/bf518f-ezbrd.c @@ -57,6 +57,13 @@ static void board_init_enetaddr(uchar *mac_addr) eth_setenv_enetaddr("ethaddr", mac_addr); }
+/* Only the first run of boards had a KSZ switch */ +#if defined(CONFIG_BFIN_SPI) && __SILICON_REVISION__ == 0 +# define KSZ_POSSIBLE 1 +#else +# define KSZ_POSSIBLE 0 +#endif + #define KSZ_MAX_HZ 5000000
#define KSZ_WRITE 0x02 @@ -109,17 +116,16 @@ static int ksz8893m_reset(struct spi_slave *slave) return ret; }
-int board_eth_init(bd_t *bis) +static bool board_ksz_init(void) { - static bool switch_is_alive = false, phy_is_ksz = true; - int ret; + static bool switch_is_alive = false;
if (!switch_is_alive) { struct spi_slave *slave = spi_setup_slave(0, 1, KSZ_MAX_HZ, SPI_MODE_3); if (slave) { if (!spi_claim_bus(slave)) { - phy_is_ksz = (ksz8893m_reg_read(slave, KSZ_REG_CHID) == 0x88); - ret = phy_is_ksz ? ksz8893m_reset(slave) : 0; + bool phy_is_ksz = (ksz8893m_reg_read(slave, KSZ_REG_CHID) == 0x88); + int ret = phy_is_ksz ? ksz8893m_reset(slave) : 0; switch_is_alive = (ret == 0); spi_release_bus(slave); } @@ -127,10 +133,16 @@ int board_eth_init(bd_t *bis) } }
- if (switch_is_alive) - return bfin_EMAC_initialize(bis); - else - return -1; + return switch_is_alive; +} + +int board_eth_init(bd_t *bis) +{ + if (KSZ_POSSIBLE) { + if (!board_ksz_init()) + return 0; + } + return bfin_EMAC_initialize(bis); } #endif

Signed-off-by: Mike Frysinger vapier@gentoo.org --- arch/blackfin/lib/board.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index 8eca7d6..59a0810 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c @@ -283,8 +283,11 @@ void board_init_f(ulong bootflag) printf("Core: %s MHz, ", strmhz(buf, get_cclk())); printf("System: %s MHz\n", strmhz(buf, get_sclk()));
- printf("RAM: "); - print_size(bd->bi_memsize, "\n"); + if (CONFIG_MEM_SIZE) { + printf("RAM: "); + print_size(bd->bi_memsize, "\n"); + } + #if defined(CONFIG_POST) post_init_f(); post_bootmode_init();

We don't want/use this value for Blackfin boards, so punt it and have the common code error out when people try to use it.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- arch/blackfin/config.mk | 4 ++++ board/bct-brettl2/config.mk | 3 --- board/bf518f-ezbrd/config.mk | 3 --- board/bf526-ezbrd/config.mk | 3 --- board/bf527-ad7160-eval/config.mk | 3 --- board/bf527-ezkit/config.mk | 3 --- board/bf527-sdp/config.mk | 3 --- board/bf533-ezkit/config.mk | 3 --- board/bf533-stamp/config.mk | 3 --- board/bf537-minotaur/config.mk | 3 --- board/bf537-pnav/config.mk | 3 --- board/bf537-srv1/config.mk | 3 --- board/bf537-stamp/config.mk | 3 --- board/bf538f-ezkit/config.mk | 3 --- board/bf548-ezkit/config.mk | 3 --- board/bf561-acvilon/config.mk | 3 --- board/bf561-ezkit/config.mk | 3 --- board/blackstamp/config.mk | 3 --- board/blackvme/config.mk | 3 --- board/cm-bf527/config.mk | 3 --- board/cm-bf533/config.mk | 3 --- board/cm-bf537e/config.mk | 3 --- board/cm-bf537u/config.mk | 3 --- board/cm-bf548/config.mk | 3 --- board/cm-bf561/config.mk | 3 --- board/ibf-dsp561/config.mk | 3 --- board/ip04/config.mk | 3 --- board/tcm-bf518/config.mk | 3 --- board/tcm-bf537/config.mk | 3 --- 29 files changed, 4 insertions(+), 84 deletions(-)
diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk index ab117ca..ae9d987 100644 --- a/arch/blackfin/config.mk +++ b/arch/blackfin/config.mk @@ -69,3 +69,7 @@ LDR_FLAGS += $(LDR_FLAGS-y) ifeq ($(wildcard $(TOPDIR)/board/$(BOARD)/u-boot.lds*),) LDSCRIPT = $(obj)arch/$(ARCH)/lib/u-boot.lds.S endif + +ifneq ($(CONFIG_SYS_TEXT_BASE),) +$(error do not set CONFIG_SYS_TEXT_BASE for Blackfin boards) +endif diff --git a/board/bct-brettl2/config.mk b/board/bct-brettl2/config.mk index 0c02d44..df11d61 100644 --- a/board/bct-brettl2/config.mk +++ b/board/bct-brettl2/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf536-0.3
CFLAGS_lib += -O2 diff --git a/board/bf518f-ezbrd/config.mk b/board/bf518f-ezbrd/config.mk index 9a54dbf..7664261 100644 --- a/board/bf518f-ezbrd/config.mk +++ b/board/bf518f-ezbrd/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf518-0.0
CFLAGS_lib += -O2 diff --git a/board/bf526-ezbrd/config.mk b/board/bf526-ezbrd/config.mk index 46c09ea..60f6f9c 100644 --- a/board/bf526-ezbrd/config.mk +++ b/board/bf526-ezbrd/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf526-0.0
CFLAGS_lib += -O2 diff --git a/board/bf527-ad7160-eval/config.mk b/board/bf527-ad7160-eval/config.mk index a6c272a..ecb31bf 100644 --- a/board/bf527-ad7160-eval/config.mk +++ b/board/bf527-ad7160-eval/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf527-0.2
CFLAGS_lib += -O2 diff --git a/board/bf527-ezkit/config.mk b/board/bf527-ezkit/config.mk index 790fe99..436a7b3 100644 --- a/board/bf527-ezkit/config.mk +++ b/board/bf527-ezkit/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf527-0.0
CFLAGS_lib += -O2 diff --git a/board/bf527-sdp/config.mk b/board/bf527-sdp/config.mk index 7cb935a..8eff4fd 100644 --- a/board/bf527-sdp/config.mk +++ b/board/bf527-sdp/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf527-0.2
CFLAGS_lib_generic += -O2 diff --git a/board/bf533-ezkit/config.mk b/board/bf533-ezkit/config.mk index a0d1749..c775398 100644 --- a/board/bf533-ezkit/config.mk +++ b/board/bf533-ezkit/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf533-0.3
CFLAGS_lib += -O2 diff --git a/board/bf533-stamp/config.mk b/board/bf533-stamp/config.mk index a0d1749..c775398 100644 --- a/board/bf533-stamp/config.mk +++ b/board/bf533-stamp/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf533-0.3
CFLAGS_lib += -O2 diff --git a/board/bf537-minotaur/config.mk b/board/bf537-minotaur/config.mk index de02635..0f0ed48 100644 --- a/board/bf537-minotaur/config.mk +++ b/board/bf537-minotaur/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf537-0.2
# Set some default LDR flags based on boot mode. diff --git a/board/bf537-pnav/config.mk b/board/bf537-pnav/config.mk index e29d87f..1e7afcc 100644 --- a/board/bf537-pnav/config.mk +++ b/board/bf537-pnav/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf537-0.2
# Set some default LDR flags based on boot mode. diff --git a/board/bf537-srv1/config.mk b/board/bf537-srv1/config.mk index de02635..0f0ed48 100644 --- a/board/bf537-srv1/config.mk +++ b/board/bf537-srv1/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf537-0.2
# Set some default LDR flags based on boot mode. diff --git a/board/bf537-stamp/config.mk b/board/bf537-stamp/config.mk index 6694f06..f913f9a 100644 --- a/board/bf537-stamp/config.mk +++ b/board/bf537-stamp/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf537-0.2
CFLAGS_lib += -O2 diff --git a/board/bf538f-ezkit/config.mk b/board/bf538f-ezkit/config.mk index 4ab1397..2644021 100644 --- a/board/bf538f-ezkit/config.mk +++ b/board/bf538f-ezkit/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf538-0.4
CFLAGS_lib += -O2 diff --git a/board/bf548-ezkit/config.mk b/board/bf548-ezkit/config.mk index 9aa1761..b7f91f2 100644 --- a/board/bf548-ezkit/config.mk +++ b/board/bf548-ezkit/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf548-0.0
CFLAGS_lib += -O2 diff --git a/board/bf561-acvilon/config.mk b/board/bf561-acvilon/config.mk index 5c88114..20c1ec2f 100644 --- a/board/bf561-acvilon/config.mk +++ b/board/bf561-acvilon/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf561-0.5
CFLAGS_lib += -O2 diff --git a/board/bf561-ezkit/config.mk b/board/bf561-ezkit/config.mk index 19cdefc..db92eec 100644 --- a/board/bf561-ezkit/config.mk +++ b/board/bf561-ezkit/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf561-0.3
CFLAGS_lib += -O2 diff --git a/board/blackstamp/config.mk b/board/blackstamp/config.mk index 0ca3c90..083aff1 100644 --- a/board/blackstamp/config.mk +++ b/board/blackstamp/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf532-0.5
# Set some default LDR flags based on boot mode. diff --git a/board/blackvme/config.mk b/board/blackvme/config.mk index 4d6e0ba..0400ace 100644 --- a/board/blackvme/config.mk +++ b/board/blackvme/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf561-0.5
# Set some default LDR flags based on boot mode. diff --git a/board/cm-bf527/config.mk b/board/cm-bf527/config.mk index 790fe99..436a7b3 100644 --- a/board/cm-bf527/config.mk +++ b/board/cm-bf527/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf527-0.0
CFLAGS_lib += -O2 diff --git a/board/cm-bf533/config.mk b/board/cm-bf533/config.mk index a0d1749..c775398 100644 --- a/board/cm-bf533/config.mk +++ b/board/cm-bf533/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf533-0.3
CFLAGS_lib += -O2 diff --git a/board/cm-bf537e/config.mk b/board/cm-bf537e/config.mk index c5d45c7..36d8778 100644 --- a/board/cm-bf537e/config.mk +++ b/board/cm-bf537e/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf537-0.2
CFLAGS_lib += -O2 diff --git a/board/cm-bf537u/config.mk b/board/cm-bf537u/config.mk index c5d45c7..36d8778 100644 --- a/board/cm-bf537u/config.mk +++ b/board/cm-bf537u/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf537-0.2
CFLAGS_lib += -O2 diff --git a/board/cm-bf548/config.mk b/board/cm-bf548/config.mk index da6aa52..e1620e0 100644 --- a/board/cm-bf548/config.mk +++ b/board/cm-bf548/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf548-0.0
CFLAGS_lib += -O2 diff --git a/board/cm-bf561/config.mk b/board/cm-bf561/config.mk index 19cdefc..db92eec 100644 --- a/board/cm-bf561/config.mk +++ b/board/cm-bf561/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf561-0.3
CFLAGS_lib += -O2 diff --git a/board/ibf-dsp561/config.mk b/board/ibf-dsp561/config.mk index 80b527c..e213714 100644 --- a/board/ibf-dsp561/config.mk +++ b/board/ibf-dsp561/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf561-0.5
# Set some default LDR flags based on boot mode. diff --git a/board/ip04/config.mk b/board/ip04/config.mk index fc818fb..0722a96 100644 --- a/board/ip04/config.mk +++ b/board/ip04/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf532-0.5
CFLAGS_lib += -O2 diff --git a/board/tcm-bf518/config.mk b/board/tcm-bf518/config.mk index 9a54dbf..7664261 100644 --- a/board/tcm-bf518/config.mk +++ b/board/tcm-bf518/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf518-0.0
CFLAGS_lib += -O2 diff --git a/board/tcm-bf537/config.mk b/board/tcm-bf537/config.mk index c5d45c7..36d8778 100644 --- a/board/tcm-bf537/config.mk +++ b/board/tcm-bf537/config.mk @@ -23,9 +23,6 @@ # MA 02111-1307 USA #
-# This is not actually used for Blackfin boards so do not change it -#CONFIG_SYS_TEXT_BASE = do-not-use-me - CONFIG_BFIN_CPU = bf537-0.2
CFLAGS_lib += -O2

Unify this convention for all Blackfin boards.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- arch/blackfin/config.mk | 3 +++ board/bct-brettl2/config.mk | 3 --- board/bf518f-ezbrd/config.mk | 3 --- board/bf526-ezbrd/config.mk | 3 --- board/bf527-ad7160-eval/config.mk | 3 --- board/bf527-ezkit/config.mk | 3 --- board/bf527-sdp/config.mk | 1 - board/bf533-ezkit/config.mk | 1 - board/bf533-stamp/config.mk | 1 - board/bf537-minotaur/config.mk | 3 +-- board/bf537-pnav/config.mk | 3 --- board/bf537-srv1/config.mk | 3 +-- board/bf537-stamp/config.mk | 1 - board/bf538f-ezkit/config.mk | 1 - board/bf548-ezkit/config.mk | 1 - board/bf561-acvilon/config.mk | 1 - board/bf561-ezkit/config.mk | 1 - board/blackstamp/config.mk | 3 --- board/blackvme/config.mk | 3 --- board/cm-bf527/config.mk | 3 --- board/cm-bf533/config.mk | 1 - board/cm-bf537e/config.mk | 1 - board/cm-bf537u/config.mk | 1 - board/cm-bf548/config.mk | 1 - board/cm-bf561/config.mk | 1 - board/ibf-dsp561/config.mk | 1 - board/ip04/config.mk | 1 - board/tcm-bf518/config.mk | 3 --- board/tcm-bf537/config.mk | 1 - 29 files changed, 5 insertions(+), 50 deletions(-)
diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk index ae9d987..fbacdda 100644 --- a/arch/blackfin/config.mk +++ b/arch/blackfin/config.mk @@ -66,6 +66,9 @@ endif
LDR_FLAGS += $(LDR_FLAGS-y)
+# Set some default LDR flags based on boot mode. +LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) + ifeq ($(wildcard $(TOPDIR)/board/$(BOARD)/u-boot.lds*),) LDSCRIPT = $(obj)arch/$(ARCH)/lib/u-boot.lds.S endif diff --git a/board/bct-brettl2/config.mk b/board/bct-brettl2/config.mk index df11d61..6e7e543 100644 --- a/board/bct-brettl2/config.mk +++ b/board/bct-brettl2/config.mk @@ -27,6 +27,3 @@ CONFIG_BFIN_CPU = bf536-0.3
CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 - -# Set some default LDR flags based on boot mode. -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/bf518f-ezbrd/config.mk b/board/bf518f-ezbrd/config.mk index 7664261..d941092 100644 --- a/board/bf518f-ezbrd/config.mk +++ b/board/bf518f-ezbrd/config.mk @@ -27,6 +27,3 @@ CONFIG_BFIN_CPU = bf518-0.0
CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 - -# Set some default LDR flags based on boot mode. -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/bf526-ezbrd/config.mk b/board/bf526-ezbrd/config.mk index 60f6f9c..83fd42e 100644 --- a/board/bf526-ezbrd/config.mk +++ b/board/bf526-ezbrd/config.mk @@ -27,6 +27,3 @@ CONFIG_BFIN_CPU = bf526-0.0
CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 - -# Set some default LDR flags based on boot mode. -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/bf527-ad7160-eval/config.mk b/board/bf527-ad7160-eval/config.mk index ecb31bf..05c7d3b 100644 --- a/board/bf527-ad7160-eval/config.mk +++ b/board/bf527-ad7160-eval/config.mk @@ -27,6 +27,3 @@ CONFIG_BFIN_CPU = bf527-0.2
CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 - -# Set some default LDR flags based on boot mode. -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/bf527-ezkit/config.mk b/board/bf527-ezkit/config.mk index 436a7b3..b10c3d2 100644 --- a/board/bf527-ezkit/config.mk +++ b/board/bf527-ezkit/config.mk @@ -27,6 +27,3 @@ CONFIG_BFIN_CPU = bf527-0.0
CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 - -# Set some default LDR flags based on boot mode. -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/bf527-sdp/config.mk b/board/bf527-sdp/config.mk index 8eff4fd..47c2989 100644 --- a/board/bf527-sdp/config.mk +++ b/board/bf527-sdp/config.mk @@ -30,4 +30,3 @@ CFLAGS_lzma += -O2
# Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 6 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/bf533-ezkit/config.mk b/board/bf533-ezkit/config.mk index c775398..c45a197 100644 --- a/board/bf533-ezkit/config.mk +++ b/board/bf533-ezkit/config.mk @@ -30,4 +30,3 @@ CFLAGS_lib/lzma += -O2
# Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/bf533-stamp/config.mk b/board/bf533-stamp/config.mk index c775398..c45a197 100644 --- a/board/bf533-stamp/config.mk +++ b/board/bf533-stamp/config.mk @@ -30,4 +30,3 @@ CFLAGS_lib/lzma += -O2
# Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/bf537-minotaur/config.mk b/board/bf537-minotaur/config.mk index 0f0ed48..f7aa8ef 100644 --- a/board/bf537-minotaur/config.mk +++ b/board/bf537-minotaur/config.mk @@ -26,5 +26,4 @@ CONFIG_BFIN_CPU = bf537-0.2
# Set some default LDR flags based on boot mode. -LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) +LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6 diff --git a/board/bf537-pnav/config.mk b/board/bf537-pnav/config.mk index 1e7afcc..b48bb00 100644 --- a/board/bf537-pnav/config.mk +++ b/board/bf537-pnav/config.mk @@ -24,6 +24,3 @@ #
CONFIG_BFIN_CPU = bf537-0.2 - -# Set some default LDR flags based on boot mode. -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/bf537-srv1/config.mk b/board/bf537-srv1/config.mk index 0f0ed48..f7aa8ef 100644 --- a/board/bf537-srv1/config.mk +++ b/board/bf537-srv1/config.mk @@ -26,5 +26,4 @@ CONFIG_BFIN_CPU = bf537-0.2
# Set some default LDR flags based on boot mode. -LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) +LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6 diff --git a/board/bf537-stamp/config.mk b/board/bf537-stamp/config.mk index f913f9a..2bb6b79 100644 --- a/board/bf537-stamp/config.mk +++ b/board/bf537-stamp/config.mk @@ -31,4 +31,3 @@ CFLAGS_lib/lzma += -O2 # Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8 LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/bf538f-ezkit/config.mk b/board/bf538f-ezkit/config.mk index 2644021..9bae4d1 100644 --- a/board/bf538f-ezkit/config.mk +++ b/board/bf538f-ezkit/config.mk @@ -30,4 +30,3 @@ CFLAGS_lib/lzma += -O2
# Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/bf548-ezkit/config.mk b/board/bf548-ezkit/config.mk index b7f91f2..97b64b9 100644 --- a/board/bf548-ezkit/config.mk +++ b/board/bf548-ezkit/config.mk @@ -34,4 +34,3 @@ LDR_FLAGS-BFIN_BOOT_FIFO := --dma 1 LDR_FLAGS-BFIN_BOOT_SPI_MASTER := --dma 1 LDR_FLAGS-BFIN_BOOT_UART := --dma 1 LDR_FLAGS-BFIN_BOOT_NAND := --dma 6 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/bf561-acvilon/config.mk b/board/bf561-acvilon/config.mk index 20c1ec2f..5633b3b 100644 --- a/board/bf561-acvilon/config.mk +++ b/board/bf561-acvilon/config.mk @@ -30,4 +30,3 @@ CFLAGS_lib/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)) diff --git a/board/bf561-ezkit/config.mk b/board/bf561-ezkit/config.mk index db92eec..8b22d0d 100644 --- a/board/bf561-ezkit/config.mk +++ b/board/bf561-ezkit/config.mk @@ -30,4 +30,3 @@ CFLAGS_lib/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)) diff --git a/board/blackstamp/config.mk b/board/blackstamp/config.mk index 083aff1..5bf4189 100644 --- a/board/blackstamp/config.mk +++ b/board/blackstamp/config.mk @@ -24,6 +24,3 @@ #
CONFIG_BFIN_CPU = bf532-0.5 - -# Set some default LDR flags based on boot mode. -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/blackvme/config.mk b/board/blackvme/config.mk index 0400ace..620104a 100644 --- a/board/blackvme/config.mk +++ b/board/blackvme/config.mk @@ -24,6 +24,3 @@ #
CONFIG_BFIN_CPU = bf561-0.5 - -# Set some default LDR flags based on boot mode. -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/cm-bf527/config.mk b/board/cm-bf527/config.mk index 436a7b3..b10c3d2 100644 --- a/board/cm-bf527/config.mk +++ b/board/cm-bf527/config.mk @@ -27,6 +27,3 @@ CONFIG_BFIN_CPU = bf527-0.0
CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 - -# Set some default LDR flags based on boot mode. -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/cm-bf533/config.mk b/board/cm-bf533/config.mk index c775398..c45a197 100644 --- a/board/cm-bf533/config.mk +++ b/board/cm-bf533/config.mk @@ -30,4 +30,3 @@ CFLAGS_lib/lzma += -O2
# Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/cm-bf537e/config.mk b/board/cm-bf537e/config.mk index 36d8778..d5d6dd9 100644 --- a/board/cm-bf537e/config.mk +++ b/board/cm-bf537e/config.mk @@ -30,4 +30,3 @@ CFLAGS_lib/lzma += -O2
# Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/cm-bf537u/config.mk b/board/cm-bf537u/config.mk index 36d8778..d5d6dd9 100644 --- a/board/cm-bf537u/config.mk +++ b/board/cm-bf537u/config.mk @@ -30,4 +30,3 @@ CFLAGS_lib/lzma += -O2
# Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/cm-bf548/config.mk b/board/cm-bf548/config.mk index e1620e0..a28a426 100644 --- a/board/cm-bf548/config.mk +++ b/board/cm-bf548/config.mk @@ -33,4 +33,3 @@ LDR_FLAGS-BFIN_BOOT_PARA := --dma 6 LDR_FLAGS-BFIN_BOOT_FIFO := --dma 1 LDR_FLAGS-BFIN_BOOT_SPI_MASTER := --dma 1 LDR_FLAGS-BFIN_BOOT_UART := --dma 1 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/cm-bf561/config.mk b/board/cm-bf561/config.mk index db92eec..8b22d0d 100644 --- a/board/cm-bf561/config.mk +++ b/board/cm-bf561/config.mk @@ -30,4 +30,3 @@ CFLAGS_lib/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)) diff --git a/board/ibf-dsp561/config.mk b/board/ibf-dsp561/config.mk index e213714..7d25d0b 100644 --- a/board/ibf-dsp561/config.mk +++ b/board/ibf-dsp561/config.mk @@ -27,4 +27,3 @@ CONFIG_BFIN_CPU = bf561-0.5
# Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/ip04/config.mk b/board/ip04/config.mk index 0722a96..2e9ee28 100644 --- a/board/ip04/config.mk +++ b/board/ip04/config.mk @@ -31,4 +31,3 @@ CFLAGS_lib/lzma += -O2 # Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8 LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/tcm-bf518/config.mk b/board/tcm-bf518/config.mk index 7664261..d941092 100644 --- a/board/tcm-bf518/config.mk +++ b/board/tcm-bf518/config.mk @@ -27,6 +27,3 @@ CONFIG_BFIN_CPU = bf518-0.0
CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 - -# Set some default LDR flags based on boot mode. -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) diff --git a/board/tcm-bf537/config.mk b/board/tcm-bf537/config.mk index 36d8778..d5d6dd9 100644 --- a/board/tcm-bf537/config.mk +++ b/board/tcm-bf537/config.mk @@ -30,4 +30,3 @@ CFLAGS_lib/lzma += -O2
# Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8 -LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))

This is a revert of 821ad16fa9900c as Wolfgang doesn't like the new code.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- arch/blackfin/config.mk | 8 +++++++- arch/blackfin/include/asm/config.h | 5 +++++ arch/blackfin/lib/board.c | 2 +- board/bct-brettl2/config.mk | 2 -- board/bf518f-ezbrd/config.mk | 2 -- board/bf526-ezbrd/config.mk | 2 -- board/bf527-ad7160-eval/config.mk | 2 -- board/bf527-ezkit/config.mk | 2 -- board/bf527-sdp/config.mk | 2 -- board/bf533-ezkit/config.mk | 2 -- board/bf533-stamp/config.mk | 2 -- board/bf537-minotaur/config.mk | 2 -- board/bf537-pnav/config.mk | 1 - board/bf537-srv1/config.mk | 2 -- board/bf537-stamp/config.mk | 2 -- board/bf538f-ezkit/config.mk | 2 -- board/bf548-ezkit/config.mk | 2 -- board/bf561-acvilon/config.mk | 2 -- board/bf561-ezkit/config.mk | 2 -- board/blackstamp/config.mk | 1 - board/blackvme/config.mk | 2 -- board/cm-bf527/config.mk | 2 -- board/cm-bf533/config.mk | 2 -- board/cm-bf537e/config.mk | 2 -- board/cm-bf537u/config.mk | 2 -- board/cm-bf548/config.mk | 2 -- board/cm-bf561/config.mk | 2 -- board/ibf-dsp561/config.mk | 2 -- board/ip04/config.mk | 2 -- board/tcm-bf518/config.mk | 2 -- board/tcm-bf537/config.mk | 2 -- include/configs/bct-brettl2.h | 3 ++- include/configs/bf518f-ezbrd.h | 1 + include/configs/bf526-ezbrd.h | 1 + include/configs/bf527-ad7160-eval.h | 1 + include/configs/bf527-ezkit.h | 1 + include/configs/bf527-sdp.h | 1 + include/configs/bf533-ezkit.h | 1 + include/configs/bf533-stamp.h | 1 + include/configs/bf537-minotaur.h | 1 + include/configs/bf537-pnav.h | 1 + include/configs/bf537-srv1.h | 1 + include/configs/bf537-stamp.h | 1 + include/configs/bf538f-ezkit.h | 1 + include/configs/bf548-ezkit.h | 1 + include/configs/bf561-acvilon.h | 3 ++- include/configs/bf561-ezkit.h | 1 + include/configs/blackstamp.h | 1 + include/configs/blackvme.h | 3 ++- include/configs/cm-bf527.h | 1 + include/configs/cm-bf533.h | 1 + include/configs/cm-bf537e.h | 1 + include/configs/cm-bf537u.h | 1 + include/configs/cm-bf548.h | 1 + include/configs/cm-bf561.h | 1 + include/configs/ibf-dsp561.h | 1 + include/configs/ip04.h | 1 + include/configs/tcm-bf518.h | 1 + include/configs/tcm-bf537.h | 1 + 59 files changed, 44 insertions(+), 59 deletions(-)
diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk index fbacdda..3a43bfc 100644 --- a/arch/blackfin/config.mk +++ b/arch/blackfin/config.mk @@ -25,6 +25,13 @@ CROSS_COMPILE ?= bfin-uclinux-
STANDALONE_LOAD_ADDR = 0x1000 -m elf32bfin
+ifeq ($(CONFIG_BFIN_CPU),) +CONFIG_BFIN_CPU := \ + $(shell awk '$$2 == "CONFIG_BFIN_CPU" { print $$3 }' \ + $(src)include/configs/$(BOARD).h) +else +CONFIG_BFIN_CPU := $(strip $(subst ",,$(CONFIG_BFIN_CPU))) +endif CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE)))
PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic @@ -33,7 +40,6 @@ PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN LDFLAGS += --gc-sections -m elf32bfin PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
-PLATFORM_CPPFLAGS += -DBFIN_CPU='"$(CONFIG_BFIN_CPU)"' PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU)
ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS) diff --git a/arch/blackfin/include/asm/config.h b/arch/blackfin/include/asm/config.h index 0437252..f0f3a39 100644 --- a/arch/blackfin/include/asm/config.h +++ b/arch/blackfin/include/asm/config.h @@ -12,6 +12,11 @@ /* Some of our defines use this (like CONFIG_SYS_GBL_DATA_ADDR) */ #include <asm-offsets.h>
+/* Sanity check CONFIG_BFIN_CPU */ +#ifndef CONFIG_BFIN_CPU +# error CONFIG_BFIN_CPU: your board config needs to define this +#endif + #ifndef CONFIG_BFIN_SCRATCH_REG # define CONFIG_BFIN_SCRATCH_REG retn #endif diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index 59a0810..2b1f78c 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c @@ -254,7 +254,7 @@ void board_init_f(ulong bootflag) memset((void *)bd, 0, sizeof(bd_t));
bd->bi_r_version = version_string; - bd->bi_cpu = BFIN_CPU; + bd->bi_cpu = MK_STR(CONFIG_BFIN_CPU); bd->bi_board_name = BFIN_BOARD_NAME; bd->bi_vco = get_vco(); bd->bi_cclk = get_cclk(); diff --git a/board/bct-brettl2/config.mk b/board/bct-brettl2/config.mk index 6e7e543..799a682 100644 --- a/board/bct-brettl2/config.mk +++ b/board/bct-brettl2/config.mk @@ -23,7 +23,5 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf536-0.3 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 diff --git a/board/bf518f-ezbrd/config.mk b/board/bf518f-ezbrd/config.mk index d941092..799a682 100644 --- a/board/bf518f-ezbrd/config.mk +++ b/board/bf518f-ezbrd/config.mk @@ -23,7 +23,5 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf518-0.0 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 diff --git a/board/bf526-ezbrd/config.mk b/board/bf526-ezbrd/config.mk index 83fd42e..799a682 100644 --- a/board/bf526-ezbrd/config.mk +++ b/board/bf526-ezbrd/config.mk @@ -23,7 +23,5 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf526-0.0 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 diff --git a/board/bf527-ad7160-eval/config.mk b/board/bf527-ad7160-eval/config.mk index 05c7d3b..799a682 100644 --- a/board/bf527-ad7160-eval/config.mk +++ b/board/bf527-ad7160-eval/config.mk @@ -23,7 +23,5 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf527-0.2 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 diff --git a/board/bf527-ezkit/config.mk b/board/bf527-ezkit/config.mk index b10c3d2..799a682 100644 --- a/board/bf527-ezkit/config.mk +++ b/board/bf527-ezkit/config.mk @@ -23,7 +23,5 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf527-0.0 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 diff --git a/board/bf527-sdp/config.mk b/board/bf527-sdp/config.mk index 47c2989..ce8f75c 100644 --- a/board/bf527-sdp/config.mk +++ b/board/bf527-sdp/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf527-0.2 - CFLAGS_lib_generic += -O2 CFLAGS_lzma += -O2
diff --git a/board/bf533-ezkit/config.mk b/board/bf533-ezkit/config.mk index c45a197..c0cb9ff 100644 --- a/board/bf533-ezkit/config.mk +++ b/board/bf533-ezkit/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf533-0.3 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/bf533-stamp/config.mk b/board/bf533-stamp/config.mk index c45a197..c0cb9ff 100644 --- a/board/bf533-stamp/config.mk +++ b/board/bf533-stamp/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf533-0.3 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/bf537-minotaur/config.mk b/board/bf537-minotaur/config.mk index f7aa8ef..4bb6506 100644 --- a/board/bf537-minotaur/config.mk +++ b/board/bf537-minotaur/config.mk @@ -23,7 +23,5 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf537-0.2 - # Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6 diff --git a/board/bf537-pnav/config.mk b/board/bf537-pnav/config.mk index b48bb00..25f4c15 100644 --- a/board/bf537-pnav/config.mk +++ b/board/bf537-pnav/config.mk @@ -23,4 +23,3 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf537-0.2 diff --git a/board/bf537-srv1/config.mk b/board/bf537-srv1/config.mk index f7aa8ef..4bb6506 100644 --- a/board/bf537-srv1/config.mk +++ b/board/bf537-srv1/config.mk @@ -23,7 +23,5 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf537-0.2 - # Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6 diff --git a/board/bf537-stamp/config.mk b/board/bf537-stamp/config.mk index 2bb6b79..7c023d1 100644 --- a/board/bf537-stamp/config.mk +++ b/board/bf537-stamp/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf537-0.2 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/bf538f-ezkit/config.mk b/board/bf538f-ezkit/config.mk index 9bae4d1..c0cb9ff 100644 --- a/board/bf538f-ezkit/config.mk +++ b/board/bf538f-ezkit/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf538-0.4 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/bf548-ezkit/config.mk b/board/bf548-ezkit/config.mk index 97b64b9..7f38b14 100644 --- a/board/bf548-ezkit/config.mk +++ b/board/bf548-ezkit/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf548-0.0 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/bf561-acvilon/config.mk b/board/bf561-acvilon/config.mk index 5633b3b..4c811ba 100644 --- a/board/bf561-acvilon/config.mk +++ b/board/bf561-acvilon/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf561-0.5 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/bf561-ezkit/config.mk b/board/bf561-ezkit/config.mk index 8b22d0d..4c811ba 100644 --- a/board/bf561-ezkit/config.mk +++ b/board/bf561-ezkit/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf561-0.3 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/blackstamp/config.mk b/board/blackstamp/config.mk index 5bf4189..25f4c15 100644 --- a/board/blackstamp/config.mk +++ b/board/blackstamp/config.mk @@ -23,4 +23,3 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf532-0.5 diff --git a/board/blackvme/config.mk b/board/blackvme/config.mk index 620104a..dfcba5c 100644 --- a/board/blackvme/config.mk +++ b/board/blackvme/config.mk @@ -22,5 +22,3 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # - -CONFIG_BFIN_CPU = bf561-0.5 diff --git a/board/cm-bf527/config.mk b/board/cm-bf527/config.mk index b10c3d2..799a682 100644 --- a/board/cm-bf527/config.mk +++ b/board/cm-bf527/config.mk @@ -23,7 +23,5 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf527-0.0 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 diff --git a/board/cm-bf533/config.mk b/board/cm-bf533/config.mk index c45a197..c0cb9ff 100644 --- a/board/cm-bf533/config.mk +++ b/board/cm-bf533/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf533-0.3 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/cm-bf537e/config.mk b/board/cm-bf537e/config.mk index d5d6dd9..c0cb9ff 100644 --- a/board/cm-bf537e/config.mk +++ b/board/cm-bf537e/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf537-0.2 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/cm-bf537u/config.mk b/board/cm-bf537u/config.mk index d5d6dd9..c0cb9ff 100644 --- a/board/cm-bf537u/config.mk +++ b/board/cm-bf537u/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf537-0.2 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/cm-bf548/config.mk b/board/cm-bf548/config.mk index a28a426..5adb6fc 100644 --- a/board/cm-bf548/config.mk +++ b/board/cm-bf548/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf548-0.0 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/cm-bf561/config.mk b/board/cm-bf561/config.mk index 8b22d0d..4c811ba 100644 --- a/board/cm-bf561/config.mk +++ b/board/cm-bf561/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf561-0.3 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/ibf-dsp561/config.mk b/board/ibf-dsp561/config.mk index 7d25d0b..afa7141 100644 --- a/board/ibf-dsp561/config.mk +++ b/board/ibf-dsp561/config.mk @@ -23,7 +23,5 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf561-0.5 - # Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 diff --git a/board/ip04/config.mk b/board/ip04/config.mk index 2e9ee28..7c023d1 100644 --- a/board/ip04/config.mk +++ b/board/ip04/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf532-0.5 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/board/tcm-bf518/config.mk b/board/tcm-bf518/config.mk index d941092..799a682 100644 --- a/board/tcm-bf518/config.mk +++ b/board/tcm-bf518/config.mk @@ -23,7 +23,5 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf518-0.0 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2 diff --git a/board/tcm-bf537/config.mk b/board/tcm-bf537/config.mk index d5d6dd9..c0cb9ff 100644 --- a/board/tcm-bf537/config.mk +++ b/board/tcm-bf537/config.mk @@ -23,8 +23,6 @@ # MA 02111-1307 USA #
-CONFIG_BFIN_CPU = bf537-0.2 - CFLAGS_lib += -O2 CFLAGS_lib/lzma += -O2
diff --git a/include/configs/bct-brettl2.h b/include/configs/bct-brettl2.h index fa72c7f..a55e178 100644 --- a/include/configs/bct-brettl2.h +++ b/include/configs/bct-brettl2.h @@ -11,7 +11,8 @@ /* * Processor Settings */ -#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS +#define CONFIG_BFIN_CPU bf536-0.3 +#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
/* diff --git a/include/configs/bf518f-ezbrd.h b/include/configs/bf518f-ezbrd.h index 64ca9ed..6eec1c9 100644 --- a/include/configs/bf518f-ezbrd.h +++ b/include/configs/bf518f-ezbrd.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf518-0.0 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_PARA
diff --git a/include/configs/bf526-ezbrd.h b/include/configs/bf526-ezbrd.h index 4c30c25..c28f867 100644 --- a/include/configs/bf526-ezbrd.h +++ b/include/configs/bf526-ezbrd.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf526-0.0 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_PARA
diff --git a/include/configs/bf527-ad7160-eval.h b/include/configs/bf527-ad7160-eval.h index 14ade1b..889bfde 100644 --- a/include/configs/bf527-ad7160-eval.h +++ b/include/configs/bf527-ad7160-eval.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf527-0.2 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER
diff --git a/include/configs/bf527-ezkit.h b/include/configs/bf527-ezkit.h index fa9053b..22a5639 100644 --- a/include/configs/bf527-ezkit.h +++ b/include/configs/bf527-ezkit.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf527-0.0 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_PARA
diff --git a/include/configs/bf527-sdp.h b/include/configs/bf527-sdp.h index 3582846..c0e8b5a 100644 --- a/include/configs/bf527-sdp.h +++ b/include/configs/bf527-sdp.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf527-0.2 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_PARA
diff --git a/include/configs/bf533-ezkit.h b/include/configs/bf533-ezkit.h index e1bb594..95d3afa 100644 --- a/include/configs/bf533-ezkit.h +++ b/include/configs/bf533-ezkit.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf533-0.3 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
diff --git a/include/configs/bf533-stamp.h b/include/configs/bf533-stamp.h index bf0f063..cb37ee7 100644 --- a/include/configs/bf533-stamp.h +++ b/include/configs/bf533-stamp.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf533-0.3 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
diff --git a/include/configs/bf537-minotaur.h b/include/configs/bf537-minotaur.h index 0ba29bc..86aa1f6 100644 --- a/include/configs/bf537-minotaur.h +++ b/include/configs/bf537-minotaur.h @@ -24,6 +24,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf537-0.2 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER
diff --git a/include/configs/bf537-pnav.h b/include/configs/bf537-pnav.h index da4f2f2..0913ce4 100644 --- a/include/configs/bf537-pnav.h +++ b/include/configs/bf537-pnav.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf537-0.2 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER
diff --git a/include/configs/bf537-srv1.h b/include/configs/bf537-srv1.h index 559428f..7e9dd36 100644 --- a/include/configs/bf537-srv1.h +++ b/include/configs/bf537-srv1.h @@ -24,6 +24,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf537-0.2 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER
diff --git a/include/configs/bf537-stamp.h b/include/configs/bf537-stamp.h index 2d1930c..3da2375 100644 --- a/include/configs/bf537-stamp.h +++ b/include/configs/bf537-stamp.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf537-0.2 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
diff --git a/include/configs/bf538f-ezkit.h b/include/configs/bf538f-ezkit.h index 2469c6a..717a35a 100644 --- a/include/configs/bf538f-ezkit.h +++ b/include/configs/bf538f-ezkit.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf538-0.4 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
diff --git a/include/configs/bf548-ezkit.h b/include/configs/bf548-ezkit.h index 1c035cf..e862a8a 100644 --- a/include/configs/bf548-ezkit.h +++ b/include/configs/bf548-ezkit.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf548-0.0 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_PARA
diff --git a/include/configs/bf561-acvilon.h b/include/configs/bf561-acvilon.h index 2b12c3f..1490b2f 100644 --- a/include/configs/bf561-acvilon.h +++ b/include/configs/bf561-acvilon.h @@ -12,7 +12,8 @@ /* * Processor Settings */ -#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS +#define CONFIG_BFIN_CPU bf561-0.5 +#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
/* diff --git a/include/configs/bf561-ezkit.h b/include/configs/bf561-ezkit.h index 7b020e6..7081d5f 100644 --- a/include/configs/bf561-ezkit.h +++ b/include/configs/bf561-ezkit.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf561-0.3 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
diff --git a/include/configs/blackstamp.h b/include/configs/blackstamp.h index 3f5c959..85f08ea 100644 --- a/include/configs/blackstamp.h +++ b/include/configs/blackstamp.h @@ -24,6 +24,7 @@ /* CPU Options * Be sure to set the Silicon Revision Correctly */ +#define CONFIG_BFIN_CPU bf532-0.5 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER
/* diff --git a/include/configs/blackvme.h b/include/configs/blackvme.h index e4688a2..9950e44 100644 --- a/include/configs/blackvme.h +++ b/include/configs/blackvme.h @@ -23,7 +23,8 @@ #define CONFIG_PANIC_HANG 0
/* CPU Options */ -#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER +#define CONFIG_BFIN_CPU bf561-0.5 +#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER
/* * CLOCK SETTINGS CAVEAT diff --git a/include/configs/cm-bf527.h b/include/configs/cm-bf527.h index 84c9309..e0c6d53 100644 --- a/include/configs/cm-bf527.h +++ b/include/configs/cm-bf527.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf527-0.0 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_PARA
diff --git a/include/configs/cm-bf533.h b/include/configs/cm-bf533.h index dbc4a5b..7515296 100644 --- a/include/configs/cm-bf533.h +++ b/include/configs/cm-bf533.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf533-0.3 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
diff --git a/include/configs/cm-bf537e.h b/include/configs/cm-bf537e.h index c3de96a..934b74b 100644 --- a/include/configs/cm-bf537e.h +++ b/include/configs/cm-bf537e.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf537-0.2 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
diff --git a/include/configs/cm-bf537u.h b/include/configs/cm-bf537u.h index e60ebf2..c274c20 100644 --- a/include/configs/cm-bf537u.h +++ b/include/configs/cm-bf537u.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf537-0.2 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
diff --git a/include/configs/cm-bf548.h b/include/configs/cm-bf548.h index 27b1cc5..fa62a8e 100644 --- a/include/configs/cm-bf548.h +++ b/include/configs/cm-bf548.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf548-0.0 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_PARA
diff --git a/include/configs/cm-bf561.h b/include/configs/cm-bf561.h index 8c350bc..c60401c 100644 --- a/include/configs/cm-bf561.h +++ b/include/configs/cm-bf561.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf561-0.3 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_PARA
diff --git a/include/configs/ibf-dsp561.h b/include/configs/ibf-dsp561.h index e2dbbb1..f3d6c8b 100644 --- a/include/configs/ibf-dsp561.h +++ b/include/configs/ibf-dsp561.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf561-0.5 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
diff --git a/include/configs/ip04.h b/include/configs/ip04.h index 528363c..c024d78 100644 --- a/include/configs/ip04.h +++ b/include/configs/ip04.h @@ -20,6 +20,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf532-0.5 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_NAND
diff --git a/include/configs/tcm-bf518.h b/include/configs/tcm-bf518.h index 042d789..52055e8 100644 --- a/include/configs/tcm-bf518.h +++ b/include/configs/tcm-bf518.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf518-0.0 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_PARA
diff --git a/include/configs/tcm-bf537.h b/include/configs/tcm-bf537.h index 9036ce3..8ded175 100644 --- a/include/configs/tcm-bf537.h +++ b/include/configs/tcm-bf537.h @@ -11,6 +11,7 @@ /* * Processor Settings */ +#define CONFIG_BFIN_CPU bf537-0.2 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS

Looks like the filesystem shuffling missed the SDP board.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- board/bf527-sdp/config.mk | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/board/bf527-sdp/config.mk b/board/bf527-sdp/config.mk index ce8f75c..7271774 100644 --- a/board/bf527-sdp/config.mk +++ b/board/bf527-sdp/config.mk @@ -23,8 +23,8 @@ # MA 02111-1307 USA #
-CFLAGS_lib_generic += -O2 -CFLAGS_lzma += -O2 +CFLAGS_lib += -O2 +CFLAGS_lib/lzma += -O2
# Set some default LDR flags based on boot mode. LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 6

Signed-off-by: Mike Frysinger vapier@gentoo.org --- board/bf537-pnav/config.mk | 25 ------------------------- board/blackstamp/config.mk | 25 ------------------------- board/blackvme/config.mk | 24 ------------------------ 3 files changed, 0 insertions(+), 74 deletions(-) delete mode 100644 board/bf537-pnav/config.mk delete mode 100644 board/blackstamp/config.mk delete mode 100644 board/blackvme/config.mk
diff --git a/board/bf537-pnav/config.mk b/board/bf537-pnav/config.mk deleted file mode 100644 index 25f4c15..0000000 --- a/board/bf537-pnav/config.mk +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright (c) 2005-2008 Analog Device Inc. -# -# (C) Copyright 2001 -# Wolfgang Denk, DENX Software Engineering, wd@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 -# - diff --git a/board/blackstamp/config.mk b/board/blackstamp/config.mk deleted file mode 100644 index 25f4c15..0000000 --- a/board/blackstamp/config.mk +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright (c) 2005-2008 Analog Device Inc. -# -# (C) Copyright 2001 -# Wolfgang Denk, DENX Software Engineering, wd@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 -# - diff --git a/board/blackvme/config.mk b/board/blackvme/config.mk deleted file mode 100644 index dfcba5c..0000000 --- a/board/blackvme/config.mk +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (c) 2005-2008 Analog Device Inc. -# -# (C) Copyright 2001 -# Wolfgang Denk, DENX Software Engineering, wd@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 -#

From: Andreas Schallenberg Andreas.Schallenberg@3alitydigital.de
Info about the hardware can be found here: http://www.dilnetpc.com/dnp0086.htm
Signed-off-by: Andreas Schallenberg Andreas.Schallenberg@3alitydigital.de Signed-off-by: Mike Frysinger vapier@gentoo.org --- MAINTAINERS | 4 ++ board/dnp5370/Makefile | 54 +++++++++++++++++++ board/dnp5370/dnp5370.c | 104 ++++++++++++++++++++++++++++++++++++ boards.cfg | 1 + doc/README.dnp5370 | 67 +++++++++++++++++++++++ include/configs/dnp5370.h | 128 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 358 insertions(+), 0 deletions(-) create mode 100644 board/dnp5370/Makefile create mode 100644 board/dnp5370/dnp5370.c create mode 100644 doc/README.dnp5370 create mode 100644 include/configs/dnp5370.h
diff --git a/MAINTAINERS b/MAINTAINERS index 553930a..04dea46 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1045,6 +1045,10 @@ Blackfin Team u-boot-devel@blackfin.uclinux.org BF548-EZKIT BF548 BF561-EZKIT BF561
+M.Hasewinkel (MHA) info@ssv-embedded.de + + dnp5370 BF537 + Brent Kandetzki brentk@teleco.com
IP04 BF532 diff --git a/board/dnp5370/Makefile b/board/dnp5370/Makefile new file mode 100644 index 0000000..0d17676 --- /dev/null +++ b/board/dnp5370/Makefile @@ -0,0 +1,54 @@ +# +# U-boot - Makefile +# +# Copyright (c) 2005-2007 Analog Device Inc. +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd@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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS-y := $(BOARD).o + +SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) +SOBJS := $(addprefix $(obj),$(SOBJS-y)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/dnp5370/dnp5370.c b/board/dnp5370/dnp5370.c new file mode 100644 index 0000000..da9eb5f --- /dev/null +++ b/board/dnp5370/dnp5370.c @@ -0,0 +1,104 @@ +/* + * U-boot - main board file + * + * (C) Copyright 2010 3ality Digital Systems + * + * Copyright (c) 2005-2008 Analog Devices Inc. + * + * (C) Copyright 2000-2004 + * Wolfgang Denk, DENX Software Engineering, wd@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 + */ + +#include <common.h> +#include <config.h> +#include <asm/blackfin.h> +#include <asm/net.h> +#include <net.h> +#include <netdev.h> +#include <asm/gpio.h> + +static void disable_external_watchdog(void) +{ +#ifdef CONFIG_DNP5370_EXT_WD_DISABLE + /* disable external HW watchdog with PH13 = WD1 = 1 */ + gpio_request(GPIO_PH13, "ext_wd"); + gpio_direction_output(GPIO_PH13, 1); +#endif +} + +int checkboard(void) +{ + printf("Board: SSV DilNet DNP5370\n"); + return 0; +} + +#ifdef CONFIG_BFIN_MAC +static void board_init_enetaddr(uchar *mac_addr) +{ +#ifdef CONFIG_SYS_NO_FLASH +# define USE_MAC_IN_FLASH 0 +#else +# define USE_MAC_IN_FLASH 1 +#endif + bool valid_mac = false; + + if (USE_MAC_IN_FLASH) { + /* we cram the MAC in the last flash sector */ + uchar *board_mac_addr = (uchar *)0x202F0000; + if (is_valid_ether_addr(board_mac_addr)) { + memcpy(mac_addr, board_mac_addr, 6); + valid_mac = true; + } + } + + if (!valid_mac) { + puts("Warning: Generating 'random' MAC address\n"); + bfin_gen_rand_mac(mac_addr); + } + + eth_setenv_enetaddr("ethaddr", mac_addr); +} + +int board_eth_init(bd_t *bis) +{ + return bfin_EMAC_initialize(bis); +} +#endif + +/* miscellaneous platform dependent initialisations */ +int misc_init_r(void) +{ + disable_external_watchdog(); + +#ifdef CONFIG_BFIN_MAC + uchar enetaddr[6]; + if (!eth_getenv_enetaddr("ethaddr", enetaddr)) + board_init_enetaddr(enetaddr); +#endif + +#ifndef CONFIG_SYS_NO_FLASH + /* we use the last sector for the MAC address / POST LDR */ + extern flash_info_t flash_info[]; + flash_protect(FLAG_PROTECT_SET, 0x202F0000, 0x202FFFFF, &flash_info[0]); +#endif + + return 0; +} diff --git a/boards.cfg b/boards.cfg index 94b8745..9a327d5 100644 --- a/boards.cfg +++ b/boards.cfg @@ -190,6 +190,7 @@ cm-bf537e blackfin blackfin cm-bf537u blackfin blackfin cm-bf548 blackfin blackfin cm-bf561 blackfin blackfin +dnp5370 blackfin blackfin ibf-dsp561 blackfin blackfin ip04 blackfin blackfin tcm-bf518 blackfin blackfin diff --git a/doc/README.dnp5370 b/doc/README.dnp5370 new file mode 100644 index 0000000..0172698 --- /dev/null +++ b/doc/README.dnp5370 @@ -0,0 +1,67 @@ +This document describes the board support for +Dil/NetPC DNP/5370 (http://www.dilnetpc.com/dnp0086.htm) module. +The distributor is SSV (http://www.ssv-embedded.de), + +The module used to develop the support files contains: + +* Processor: Blackfin BF537 Rev 0.3 (600 MHz core / 120MHz RAM) + +* RAM: 32 MB SDRAM + Hynix HY57V561620FTP-H 810EA + Connected to Blackfin via "Expansion Bus" + Address range 0x0000.0000 - 0x1fff.ffff + +* NOR flash: 32 MBit (4 MByte) + Exel Semiconductor ES29LVS320EB + Connected to Blackfin via "Expansion Bus", + Chip Selects 0, 1 and 2, each is connected + to a 1 MB memory bank at Blackfin, therefore + only 3 MB accessible. + Address range 0x2000.0000 - 0x202f.ffff + CFI compatible + + Exel Semiconductor was bought by Rohm Semiconductor (www.rohm.com). + +* NAND flash: 64 MBit (8 MByte) + Atmel 45DB642D-CNU + Connected to Blackfin via SPI + CFI compatible + +* Davicom DM9161EP Ethernet PHY + +* A SD card reader, connected via SPI + +* Hardware watchdog MAX823 or TPS3823 + +(other devices not listed here) + +To run it, the module must be inserted in a 64 pin DIL socket +on another board, e.g. DNP/EVA13 (together: SSV SK28). + +The Blackfin is booted from NOR flash. The NOR flash data begins +with the U-Boot code and is then followed by the Linux code. +Finally, the MAC is stored in the last sector. +You may need to adjust these settings to your needs. +The memory map used to develop the board support is: + +Memory map: +0x00000000 .. 0x01ffffff SDRAM +0x20000000 .. 0x202fffff NOR flash + +RAM use: +0x01f9bffc .. 0x01fbbffb U-Boot stack +0x01f9c000 .. 0x01f9ffff U-Boot global data +0x01fa0000 .. 0x01fbffff U-Boot malloc() RAM +0x01fc0000 .. 0x01ffffff U-Boot execution RAM + +NOR flash use: +0x20000000 .. 0x0002ffff U-Boot +0x20004000 .. 0x20005fff U-Boot environment +0x20030000 .. 0x202effff Linux kernel image +0x202f0000 .. 0x202fffff MAC address sector + +NOR flash is 0x00300000 (3145728) bytes large (3 MB). +Max space for compressed kernel in flash is 0x002c0000 (2883584) bytes (2.75 MB) +Max space for u-boot in flash is 0x00030000 (196608) bytes (192 KB) + +The module is hardwired to BYPASS boot mode. diff --git a/include/configs/dnp5370.h b/include/configs/dnp5370.h new file mode 100644 index 0000000..6b328a5 --- /dev/null +++ b/include/configs/dnp5370.h @@ -0,0 +1,128 @@ +/* + * U-boot - Configuration file for SSV DNP5370 board + */ + +#ifndef __CONFIG_DNP5370_H__ +#define __CONFIG_DNP5370_H__ + +/* this must come first */ +#include <asm/config-pre.h> + +/* + * Processor Settings + */ +#define CONFIG_BFIN_CPU bf537-0.3 +#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS + +/* + * Clock Settings + * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV + * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV + */ +#define CONFIG_CLKIN_HZ 25000000 +#define CONFIG_CLKIN_HALF 0 +#define CONFIG_PLL_BYPASS 0 +#define CONFIG_VCO_MULT 24 +#define CONFIG_CCLK_DIV 1 +#define CONFIG_SCLK_DIV 5 + +/* + * Memory Settings + */ +#define CONFIG_MEM_ADD_WDTH 9 +#define CONFIG_MEM_SIZE 32 + +#define CONFIG_EBIU_SDRRC_VAL 0x03a0 +#define CONFIG_EBIU_SDBCTL_VAL 0x0013 +#define CONFIG_EBIU_SDGCTL_VAL 0x8091998d + +#define CONFIG_EBIU_AMGCTL_VAL 0xF7 +#define CONFIG_EBIU_AMBCTL0_VAL 0x7BB07BB0 +#define CONFIG_EBIU_AMBCTL1_VAL 0xFFC27BB0 + +#define CONFIG_SYS_MONITOR_LEN (256 * 1024) +#define CONFIG_SYS_MALLOC_LEN (128 * 1024) + +/* + * Network Settings + */ +#ifndef __ADSPBF534__ +#define CONFIG_ROOTPATH /romfs + +#define CONFIG_NET_MULTI 1 +#define CONFIG_BFIN_MAC 1 +#define CONFIG_PHY_ADDR 0 +#define CONFIG_RMII 1 + +#define CONFIG_CMD_MII +#define CONFIG_CMD_PING +#endif + +/* + * Flash Settings + * + * Only 3 MB of the 4 MB NOR flash are addressable. + * But limiting the flash size does not seem to work. + * It seems the CFI detection has precedence. + */ +#define CONFIG_FLASH_CFI_DRIVER +#define CONFIG_SYS_FLASH_BASE 0x20000000 +#define CONFIG_SYS_FLASH_CFI +#define CONFIG_SYS_FLASH_PROTECTION +#define CONFIG_SYS_MAX_FLASH_BANKS 1 +#define CONFIG_SYS_MAX_FLASH_SECT 71 /* (M29W320EB) */ + +/* 512k reserved for u-boot */ +#define CONFIG_SYS_JFFS2_FIRST_SECTOR 15 + +/* + * Env Storage Settings + */ +#define CONFIG_ENV_IS_IN_FLASH 1 +#define CONFIG_ENV_ADDR 0x20004000 +#define CONFIG_ENV_SIZE 0x00002000 +#define CONFIG_ENV_SECT_SIZE 0x00002000 /* Total Size of Environment Sector */ +#define CONFIG_ENV_OFFSET 0x00004000 /* (CONFIG_ENV_ADDR - CONFIG_FLASH_BASE) */ + +#define ENV_IS_EMBEDDED +#define LDS_BOARD_TEXT \ + arch/blackfin/lib/libblackfin.o (.text*); \ + arch/blackfin/cpu/libblackfin.o (.text*); \ + . = DEFINED(env_offset) ? env_offset : .; \ + common/env_embedded.o (.text*); + +/* + * Misc Settings + */ +#define CONFIG_CMD_GPIO +#define CONFIG_CMD_STRINGS +#define CONFIG_MISC_INIT_R +#define CONFIG_RTC_BFIN +#define CONFIG_SYS_LONGHELP + +/* This disables the hardware watchdog (not inside the bfin) */ +#define CONFIG_DNP5370_EXT_WD_DISABLE 1 + +#define CONFIG_UART_CONSOLE 0 +#define CONFIG_BAUDRATE 115200 +#define CONFIG_BOOTCOMMAND "bootm 0x20030000" +#define CONFIG_BOOTARGS "console=ttyBF0,115200 root=/dev/mtdblock3 rootfstype=ext2" + +/* Convenience commands to update Linux in NOR flash */ +#define CONFIG_EXTRA_ENV_SETTINGS \ + "fetchme=tftpboot 0x01000000 uImage;" \ + "iminfo\0" \ + "flashme=protect off 0x20030000 0x2003ffff;" \ + "erase 0x20030000 0x202effff;" \ + "cp.b 0x01000000 0x20030000 0x2c0000\0" \ + "runme=bootm 0x01000000\0" + +/* this sets up the default list of enabled commands */ +#include <config_cmd_default.h> + +#ifndef CONFIG_BFIN_MAC +# undef CONFIG_CMD_NET +# undef CONFIG_CMD_NFS +#endif + +#endif

From: Chong Huang chuang@ucrobotics.com
Signed-off-by: Chong Huang chuang@ucrobotics.com Signed-off-by: Haitao Zhang minipanda@linuxrobot.org Signed-off-by: Mike Frysinger vapier@gentoo.org --- MAINTAINERS | 5 ++ board/bf525-ucr2/Makefile | 54 +++++++++++++++++++++ board/bf525-ucr2/bf525-ucr2.c | 16 ++++++ boards.cfg | 1 + include/configs/bf525-ucr2.h | 102 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 178 insertions(+), 0 deletions(-) create mode 100644 board/bf525-ucr2/Makefile create mode 100644 board/bf525-ucr2/bf525-ucr2.c create mode 100644 include/configs/bf525-ucr2.h
diff --git a/MAINTAINERS b/MAINTAINERS index 04dea46..3a68bed 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1089,6 +1089,11 @@ Anton Shurpin shurpin.aa@niistt.ru
BF561-ACVILON BF561
+Haitao Zhang hzhang@ucrobotics.com +Chong Huang chuang@ucrobotics.com + + bf525-ucr2 BF525 + ######################################################################### # End of MAINTAINERS list # ######################################################################### diff --git a/board/bf525-ucr2/Makefile b/board/bf525-ucr2/Makefile new file mode 100644 index 0000000..cde8168 --- /dev/null +++ b/board/bf525-ucr2/Makefile @@ -0,0 +1,54 @@ +# +# U-boot - Makefile +# +# Copyright (c) 2005-2008 Analog Device Inc. +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd@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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS-y := $(BOARD).o + +SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) +SOBJS := $(addprefix $(obj),$(SOBJS-y)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/bf525-ucr2/bf525-ucr2.c b/board/bf525-ucr2/bf525-ucr2.c new file mode 100644 index 0000000..3e6df1f --- /dev/null +++ b/board/bf525-ucr2/bf525-ucr2.c @@ -0,0 +1,16 @@ +/* U-boot - bf525-ucr2.c board specific routines + * + * (C) Copyright 2000-2004 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * Licensed under the GPL-2 or later. + */ + +#include <common.h> + +int checkboard(void) +{ + printf("Board: bf525-ucr2\n"); + printf("Support: http://www.ucrobotics.com/%5Cn"); + return 0; +} diff --git a/boards.cfg b/boards.cfg index 9a327d5..b8d077f 100644 --- a/boards.cfg +++ b/boards.cfg @@ -167,6 +167,7 @@ mimc200 avr32 at32ap - mimc hammerhead avr32 at32ap - miromico at32ap700x bct-brettl2 blackfin blackfin bf518f-ezbrd blackfin blackfin +bf525-ucr2 blackfin blackfin bf526-ezbrd blackfin blackfin bf527-ad7160-eval blackfin blackfin bf527-ezkit blackfin blackfin diff --git a/include/configs/bf525-ucr2.h b/include/configs/bf525-ucr2.h new file mode 100644 index 0000000..1f65130 --- /dev/null +++ b/include/configs/bf525-ucr2.h @@ -0,0 +1,102 @@ +/* + * U-boot - Configuration file for bf525-ucr2 board + * The board includes ADSP-BF525 rev. 0.2, + * 32-bit SDRAM (SAMSUNG K4S561632H-UC75), + * USB 2.0 High Speed OTG USB WIFI, + * SPI flash (cFeon EN25Q128 16 MB), + * Support PPI and ITU-R656, + * See http://www.ucrobotics.com/?q=cn/ucr2 + */ + +#ifndef __CONFIG_BF525_UCR2_H__ +#define __CONFIG_BF525_UCR2_H__ + +#include <asm/config-pre.h> + +/* + * Processor Settings + */ +#define CONFIG_BFIN_CPU bf525-0.2 +#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER + +/* + * Clock Settings + * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV + * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV + */ +/* CONFIG_CLKIN_HZ is any value in Hz */ +#define CONFIG_CLKIN_HZ 24000000 +/* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */ +/* 1 = CLKIN / 2 */ +#define CONFIG_CLKIN_HALF 0 +/* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */ +/* 1 = bypass PLL */ +#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 20 +/* CCLK_DIV controls the core clock divider */ +/* Values can be 1, 2, 4, or 8 ONLY */ +#define CONFIG_CCLK_DIV 1 +/* SCLK_DIV controls the system clock divider */ +/* Values can range from 1-15 */ +#define CONFIG_SCLK_DIV 4 + +/* + * Memory Settings + */ +#define CONFIG_MEM_ADD_WDTH 9 +#define CONFIG_MEM_SIZE 32 + +/* + * SDRAM reference page + * http://docs.blackfin.uclinux.org/doku.php?id=bfin:sdram + */ +#define CONFIG_EBIU_SDRRC_VAL 0x3f8 +#define CONFIG_EBIU_SDGCTL_VAL 0x9111cd + +#define CONFIG_EBIU_AMGCTL_VAL (AMBEN_ALL) +#define CONFIG_EBIU_AMBCTL0_VAL (B1WAT_7 | B1RAT_11 | B1HT_2 | B1ST_3 | B0WAT_7 | B0RAT_11 | B0HT_2 | B0ST_3) +#define CONFIG_EBIU_AMBCTL1_VAL (B3WAT_7 | B3RAT_11 | B3HT_2 | B3ST_3 | B2WAT_7 | B2RAT_11 | B2HT_2 | B2ST_3) + +#define CONFIG_SYS_MONITOR_LEN (320 * 1024) +#define CONFIG_SYS_MALLOC_LEN (320 * 1024) + +/* We don't have a parallel flash chip */ +#define CONFIG_SYS_NO_FLASH + +/* support for serial flash */ +#define CONFIG_BFIN_SPI +#define CONFIG_SPI_FLASH +#define CONFIG_CMD_SF +#define CONFIG_SF_DEFAULT_HZ 30000000 +#define CONFIG_SPI_FLASH_EON + +#define CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SPI_MAX_HZ 30000000 +#define CONFIG_ENV_OFFSET 0x10000 +#define CONFIG_ENV_SIZE 0x10000 +#define CONFIG_ENV_SECT_SIZE 0x10000 +#define CONFIG_ENV_OVERWRITE 1 + +/* + * Misc Settings + */ +#define CONFIG_UART_CONSOLE 0 + +#define CONFIG_BAUDRATE 115200 +#define CONFIG_BOOTARGS "root=/dev/mtdblock0 rw" +#define CONFIG_BOOTCOMMAND "run sfboot" +#define CONFIG_BOOTDELAY 5 +#define CONFIG_EXTRA_ENV_SETTINGS \ + "sfboot=sf probe 1;" \ + "sf read 0x1000000 0x20000 0x300000;" \ + "bootm 0x1000000\0" + +/* this sets up the default list of enabled commands */ +#include <config_cmd_default.h> +#undef CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */ +#undef CONFIG_CMD_NFS +#undef CONFIG_CMD_IMLS + +#endif

Signed-off-by: Mike Frysinger vapier@gentoo.org --- arch/blackfin/cpu/serial.h | 51 +++++++++++++++++-------------------------- 1 files changed, 20 insertions(+), 31 deletions(-)
diff --git a/arch/blackfin/cpu/serial.h b/arch/blackfin/cpu/serial.h index f9e311f..b0cf09a 100644 --- a/arch/blackfin/cpu/serial.h +++ b/arch/blackfin/cpu/serial.h @@ -74,23 +74,19 @@ struct bfin_mmr_serial { }; #undef __BFP
-#ifndef UART_LSR -# if (CONFIG_UART_CONSOLE == 3) -# define UART_BASE UART3_DLL -# elif (CONFIG_UART_CONSOLE == 2) -# define UART_BASE UART2_DLL -# elif (CONFIG_UART_CONSOLE == 1) -# define UART_BASE UART1_DLL -# elif (CONFIG_UART_CONSOLE == 0) -# define UART_BASE UART0_DLL -# endif +#define __PASTE_UART(num, pfx, sfx) pfx##num##_##sfx +#define _PASTE_UART(num, pfx, sfx) __PASTE_UART(num, pfx, sfx) +#define MMR_UART(mmr) _PASTE_UART(CONFIG_UART_CONSOLE, UART, DLL) +#define P_UART(pin) _PASTE_UART(CONFIG_UART_CONSOLE, P_UART, pin) + +#ifndef UART_DLL +# define UART_DLL MMR_UART(DLL) #else # if CONFIG_UART_CONSOLE != 0 # error CONFIG_UART_CONSOLE must be 0 on parts with only one UART # endif -# define UART_BASE UART_DLL #endif -#define pUART ((volatile struct bfin_mmr_serial *)UART_BASE) +#define pUART ((volatile struct bfin_mmr_serial *)UART_DLL)
#ifdef __ADSPBF54x__ # define ACCESS_LATCH() @@ -106,18 +102,7 @@ __attribute__((always_inline)) static inline void serial_do_portmux(void) { if (!BFIN_DEBUG_EARLY_SERIAL) { - const unsigned short pins[] = { -#if CONFIG_UART_CONSOLE == 0 - P_UART0_TX, P_UART0_RX, -#elif CONFIG_UART_CONSOLE == 1 - P_UART1_TX, P_UART1_RX, -#elif CONFIG_UART_CONSOLE == 2 - P_UART2_TX, P_UART2_RX, -#elif CONFIG_UART_CONSOLE == 3 - P_UART3_TX, P_UART3_RX, -#endif - 0, - }; + const unsigned short pins[] = { P_UART(RX), P_UART(TX), 0, }; peripheral_request_list(pins, "bfin-uart"); return; } @@ -141,13 +126,11 @@ static inline void serial_do_portmux(void) } SSYNC(); #elif defined(__ADSPBF537__) || defined(__ADSPBF536__) || defined(__ADSPBF534__) -# define DO_MUX(func, tx, rx) \ - bfin_write_PORT_MUX(bfin_read_PORT_MUX() & ~(func)); \ - bfin_write_PORTF_FER(bfin_read_PORTF_FER() | PF##tx | PF##rx); - switch (CONFIG_UART_CONSOLE) { - case 0: DO_MUX(PFDE, 0, 1); break; - case 1: DO_MUX(PFTE, 2, 3); break; - } + const uint16_t func[] = { PFDE, PFTE, }; + bfin_write_PORT_MUX(bfin_read_PORT_MUX() & ~func[CONFIG_UART_CONSOLE]); + bfin_write_PORTF_FER(bfin_read_PORTF_FER() | + (1 << P_IDENT(P_UART(RX))) | + (1 << P_IDENT(P_UART(TX)))); SSYNC(); #elif defined(__ADSPBF54x__) # define DO_MUX(port, tx, rx) \ @@ -160,6 +143,12 @@ static inline void serial_do_portmux(void) case 3: DO_MUX(B, 6, 7); break; /* Port B; PB6 and PB7 */ } SSYNC(); +#elif defined(__ADSPBF561__) + /* UART pins could be GPIO, but they aren't pin muxed. */ +#else +# if (P_UART(RX) & P_DEFINED) || (P_UART(TX) & P_DEFINED) +# error "missing portmux logic for UART" +# endif #endif }

Fixes a build error due to new partial linking logic.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- include/configs/bf537-minotaur.h | 1 + include/configs/bf537-srv1.h | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/configs/bf537-minotaur.h b/include/configs/bf537-minotaur.h index 86aa1f6..11929c7 100644 --- a/include/configs/bf537-minotaur.h +++ b/include/configs/bf537-minotaur.h @@ -156,6 +156,7 @@ # define CONFIG_CMD_PING #else # undef CONFIG_CMD_NET +# undef CONFIG_CMD_NFS #endif
#define CONFIG_CMD_BOOTLDR diff --git a/include/configs/bf537-srv1.h b/include/configs/bf537-srv1.h index 7e9dd36..e8024d7 100644 --- a/include/configs/bf537-srv1.h +++ b/include/configs/bf537-srv1.h @@ -156,6 +156,7 @@ # define CONFIG_CMD_PING #else # undef CONFIG_CMD_NET +# undef CONFIG_CMD_NFS #endif
#define CONFIG_CMD_BOOTLDR

The __BFIN_DEF_ADSP_BF537_proc__ define isn't setup anymore, so use the one coming from the compiler.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- arch/blackfin/include/asm/mach-bf537/BF534_def.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/blackfin/include/asm/mach-bf537/BF534_def.h b/arch/blackfin/include/asm/mach-bf537/BF534_def.h index e04676c..e854eed 100644 --- a/arch/blackfin/include/asm/mach-bf537/BF534_def.h +++ b/arch/blackfin/include/asm/mach-bf537/BF534_def.h @@ -10,7 +10,7 @@
#include "ADSP-EDN-BF534-extended_def.h"
-#if defined(__BFIN_DEF_ADSP_BF537_proc__) || !defined(__BFIN_DEF_ADSP_BF536_proc__) +#if !defined(__ADSPBF536__) #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)

Have CONFIG_ENV_ADDR be based on CONFIG_ENV_OFFSET rather than the other way around so that we can use CONFIG_ENV_OFFSET during build. It also avoids a little address duplication.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- include/configs/bf561-ezkit.h | 4 ++-- include/configs/ibf-dsp561.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/configs/bf561-ezkit.h b/include/configs/bf561-ezkit.h index 7081d5f..33c7e18 100644 --- a/include/configs/bf561-ezkit.h +++ b/include/configs/bf561-ezkit.h @@ -80,8 +80,8 @@ #define CONFIG_SYS_MAX_FLASH_SECT 135 /* The BF561-EZKIT uses a top boot flash */ #define CONFIG_ENV_IS_IN_FLASH 1 -#define CONFIG_ENV_ADDR 0x20004000 -#define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE) +#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 0x10000 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS) diff --git a/include/configs/ibf-dsp561.h b/include/configs/ibf-dsp561.h index f3d6c8b..055f8a0 100644 --- a/include/configs/ibf-dsp561.h +++ b/include/configs/ibf-dsp561.h @@ -80,8 +80,8 @@ #define CONFIG_SYS_MAX_FLASH_SECT 135 /* max number of sectors on one chip */ /* The BF561-EZKIT uses a top boot flash */ #define CONFIG_ENV_IS_IN_FLASH 1 -#define CONFIG_ENV_ADDR 0x20004000 -#define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE) +#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 0x10000 /* Total Size of Environment Sector */ #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)

The recent global data changes (making the size autogenerated) broke the board info handling on Blackfin ports as we were lying and lumping the bd_t size in with the gd_t size. So use the new dedicated bd_t size to setup its own address in memory.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- arch/blackfin/include/asm/config.h | 5 ++++- arch/blackfin/lib/board.c | 10 ++-------- 2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/arch/blackfin/include/asm/config.h b/arch/blackfin/include/asm/config.h index f0f3a39..89814cd 100644 --- a/arch/blackfin/include/asm/config.h +++ b/arch/blackfin/include/asm/config.h @@ -109,8 +109,11 @@ #ifndef CONFIG_SYS_GBL_DATA_ADDR # define CONFIG_SYS_GBL_DATA_ADDR (CONFIG_SYS_MALLOC_BASE - GENERATED_GBL_DATA_SIZE) #endif +#ifndef CONFIG_SYS_BD_INFO_ADDR +# define CONFIG_SYS_BD_INFO_ADDR (CONFIG_SYS_GBL_DATA_ADDR - GENERATED_BD_INFO_SIZE) +#endif #ifndef CONFIG_STACKBASE -# define CONFIG_STACKBASE (CONFIG_SYS_GBL_DATA_ADDR - 4) +# define CONFIG_STACKBASE (CONFIG_SYS_BD_INFO_ADDR - 4) #endif #ifndef CONFIG_SYS_MEMTEST_START # define CONFIG_SYS_MEMTEST_START 0 diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index 2b1f78c..47d487f 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c @@ -207,7 +207,6 @@ extern int timer_init(void);
void board_init_f(ulong bootflag) { - ulong addr; bd_t *bd; char buf[32];
@@ -244,14 +243,9 @@ void board_init_f(ulong bootflag) gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR); memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
- /* Board data initialization */ - addr = (CONFIG_SYS_GBL_DATA_ADDR + sizeof(gd_t)); - - /* Align to 4 byte boundary */ - addr &= ~(4 - 1); - bd = (bd_t *) addr; + bd = (bd_t *) (CONFIG_SYS_BD_INFO_ADDR); gd->bd = bd; - memset((void *)bd, 0, sizeof(bd_t)); + memset((void *)bd, 0, GENERATED_BD_INFO_SIZE);
bd->bi_r_version = version_string; bd->bi_cpu = MK_STR(CONFIG_BFIN_CPU);

Hello.
On 27-12-2010 7:48, Mike Frysinger wrote:
The recent global data changes (making the size autogenerated) broke the board info handling on Blackfin ports as we were lying and lumping the bd_t size in with the gd_t size. So use the new dedicated bd_t size to setup its own address in memory.
Signed-off-by: Mike Frysingervapier@gentoo.org
[...]
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index 2b1f78c..47d487f 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c
[...]
@@ -244,14 +243,9 @@ void board_init_f(ulong bootflag) gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR); memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
- /* Board data initialization */
- addr = (CONFIG_SYS_GBL_DATA_ADDR + sizeof(gd_t));
- /* Align to 4 byte boundary */
- addr&= ~(4 - 1);
- bd = (bd_t *) addr;
- bd = (bd_t *) (CONFIG_SYS_BD_INFO_ADDR);
Parens not needed around CONFIG_SYS_BD_INFO_ADDR.
WBR, Sergei

On Monday, December 27, 2010 06:41:47 Sergei Shtylyov wrote:
On 27-12-2010 7:48, Mike Frysinger wrote:
- bd = (bd_t *) (CONFIG_SYS_BD_INFO_ADDR);
Parens not needed around CONFIG_SYS_BD_INFO_ADDR.
it isnt a problem to have the parens, and it keeps things sane if someone does something like: #define CONFIG_SYS_BD_INFO_ADDR SOME_DEFINE + 0x1000 -mike

Dear Mike Frysinger,
In message 201012271142.17334.vapier@gentoo.org you wrote:
it isnt a problem to have the parens, and it keeps things sane if someone does something like: #define CONFIG_SYS_BD_INFO_ADDR SOME_DEFINE + 0x1000
This would be a violation of basic rules of defensive coding.
Please drop these parens.
Best regards,
Wolfgang Denk

On Monday, January 10, 2011 17:28:23 Wolfgang Denk wrote:
Mike Frysinger wrote:
it isnt a problem to have the parens, and it keeps things sane if someone does something like: #define CONFIG_SYS_BD_INFO_ADDR SOME_DEFINE + 0x1000
This would be a violation of basic rules of defensive coding.
Please drop these parens.
i dont see how these two statements are compatible. defensive coding would mean i keep the parens. -mike

On 11.01.2011 3:31, Mike Frysinger wrote:
it isnt a problem to have the parens, and it keeps things sane if someone does something like: #define CONFIG_SYS_BD_INFO_ADDR SOME_DEFINE + 0x1000
This would be a violation of basic rules of defensive coding.
Please drop these parens.
i dont see how these two statements are compatible. defensive coding would mean i keep the parens.
I think Wolfgang meant that defining a macro without parens would be a violation -- which should be fixed, not worked around.
-mike
WBR, Sergei

Common code already takes care of setting up these defines when a port hasn't specified them, so punt the duplicate values.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- arch/blackfin/include/asm/mach-bf518/BF512_def.h | 6 ------ arch/blackfin/include/asm/mach-bf533/BF531_def.h | 6 ------ arch/blackfin/include/asm/mach-bf533/BF532_def.h | 6 ------ arch/blackfin/include/asm/mach-bf533/BF533_def.h | 6 ------ arch/blackfin/include/asm/mach-bf537/BF534_def.h | 6 ------ arch/blackfin/include/asm/mach-bf538/BF538_def.h | 6 ------ arch/blackfin/include/asm/mach-bf561/BF561_def.h | 7 +------ 7 files changed, 1 insertions(+), 42 deletions(-)
diff --git a/arch/blackfin/include/asm/mach-bf518/BF512_def.h b/arch/blackfin/include/asm/mach-bf518/BF512_def.h index abc88ca..bbaf22f 100644 --- a/arch/blackfin/include/asm/mach-bf518/BF512_def.h +++ b/arch/blackfin/include/asm/mach-bf518/BF512_def.h @@ -513,11 +513,5 @@ #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_BF512_proc__ */ diff --git a/arch/blackfin/include/asm/mach-bf533/BF531_def.h b/arch/blackfin/include/asm/mach-bf533/BF531_def.h index 5d61972..3b61aaf 100644 --- a/arch/blackfin/include/asm/mach-bf533/BF531_def.h +++ b/arch/blackfin/include/asm/mach-bf533/BF531_def.h @@ -438,12 +438,6 @@ #define L1_INST_SRAM 0xFFA08000 /* 0xFFA08000 -> 0xFFA0BFFF Instruction Bank A SRAM */ #define L1_INST_SRAM_SIZE (0xFFA0BFFF - 0xFFA08000 + 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
#endif /* __BFIN_DEF_ADSP_BF531_proc__ */ diff --git a/arch/blackfin/include/asm/mach-bf533/BF532_def.h b/arch/blackfin/include/asm/mach-bf533/BF532_def.h index f7378b7..64f55f5 100644 --- a/arch/blackfin/include/asm/mach-bf533/BF532_def.h +++ b/arch/blackfin/include/asm/mach-bf533/BF532_def.h @@ -12,12 +12,6 @@ #define L1_INST_SRAM 0xFFA08000 /* 0xFFA08000 -> 0xFFA0BFFF Instruction Bank A SRAM */ #define L1_INST_SRAM_SIZE (0xFFA0BFFF - 0xFFA08000 + 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
#endif /* __BFIN_DEF_ADSP_BF532_proc__ */ diff --git a/arch/blackfin/include/asm/mach-bf533/BF533_def.h b/arch/blackfin/include/asm/mach-bf533/BF533_def.h index b77efe0..3c0595f 100644 --- a/arch/blackfin/include/asm/mach-bf533/BF533_def.h +++ b/arch/blackfin/include/asm/mach-bf533/BF533_def.h @@ -17,11 +17,5 @@ #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_BF533_proc__ */ diff --git a/arch/blackfin/include/asm/mach-bf537/BF534_def.h b/arch/blackfin/include/asm/mach-bf537/BF534_def.h index e854eed..c388eef 100644 --- a/arch/blackfin/include/asm/mach-bf537/BF534_def.h +++ b/arch/blackfin/include/asm/mach-bf537/BF534_def.h @@ -21,11 +21,5 @@ #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_BF534_proc__ */ diff --git a/arch/blackfin/include/asm/mach-bf538/BF538_def.h b/arch/blackfin/include/asm/mach-bf538/BF538_def.h index eae8e81..1736dab 100644 --- a/arch/blackfin/include/asm/mach-bf538/BF538_def.h +++ b/arch/blackfin/include/asm/mach-bf538/BF538_def.h @@ -1021,11 +1021,5 @@ #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_BF538_proc__ */ diff --git a/arch/blackfin/include/asm/mach-bf561/BF561_def.h b/arch/blackfin/include/asm/mach-bf561/BF561_def.h index 1aae565..46925f8 100644 --- a/arch/blackfin/include/asm/mach-bf561/BF561_def.h +++ b/arch/blackfin/include/asm/mach-bf561/BF561_def.h @@ -708,14 +708,9 @@ #define EBIU_SDBCTL 0xFFC00A14 #define EBIU_SDRRC 0xFFC00A18 #define EBIU_SDSTAT 0xFFC00A1C + #define L1_INST_SRAM 0xFFA00000 /* 0xFFA00000 -> 0xFFA03FFF Instruction Bank A SRAM */ #define L1_INST_SRAM_SIZE (0xFFA03FFF - 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_BF561_proc__ */

If the part has no external memory configured, then there will be no os log for us to check, and any attempt to access that memory will trigger hardware errors.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- arch/blackfin/lib/board.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index 47d487f..362b8c4 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c @@ -390,7 +390,7 @@ void board_init_r(gd_t * id, ulong dest_addr) post_run(NULL, POST_RAM | post_bootmode_get(0)); #endif
- if (bfin_os_log_check()) { + if (CONFIG_MEM_SIZE && bfin_os_log_check()) { puts("\nLog buffer from operating system:\n"); bfin_os_log_dump(); puts("\n");

When bootstrapping ourselves on the fly at runtime (via "go"), we need to turn off the caches to avoid taking software exceptions. Since caches need CPLBs and CPLBs need exception handlers, but we're about to rewrite the code in memory where those exception handlers live, we need to turn off caches first.
This new code also encourages a slight code optimization by storing the MMR bases in dedicated registers so we don't have to fully load up the pointer regs multiple times.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- arch/blackfin/cpu/start.S | 45 +++++++++++++++++++++++++++++++++------------ 1 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/arch/blackfin/cpu/start.S b/arch/blackfin/cpu/start.S index 7a3abba..15ecb1e 100644 --- a/arch/blackfin/cpu/start.S +++ b/arch/blackfin/cpu/start.S @@ -52,6 +52,19 @@ ENTRY(_start) sp.l = LO(L1_SRAM_SCRATCH_END - 20); sp.h = HI(L1_SRAM_SCRATCH_END - 20);
+ /* Optimization register tricks: keep a base value in the + * reserved P registers so we use the load/store with an + * offset syntax. R0 = [P5 + <constant>]; + * P4 - system MMR base + * P5 - core MMR base + */ +#ifdef CONFIG_HW_WATCHDOG + p4.l = 0; + p4.h = HI(SYSMMR_BASE); +#endif + p5.l = 0; + p5.h = HI(COREMMR_BASE); + #ifdef CONFIG_HW_WATCHDOG # ifndef CONFIG_HW_WATCHDOG_TIMEOUT_START # define CONFIG_HW_WATCHDOG_TIMEOUT_START 5000 @@ -60,13 +73,11 @@ ENTRY(_start) * That should be long enough to bootstrap ourselves up and * then the common u-boot code can take over. */ - P0.L = LO(WDOG_CNT); - P0.H = HI(WDOG_CNT); - R0.L = 0; - R0.H = HI(MSEC_TO_SCLK(CONFIG_HW_WATCHDOG_TIMEOUT_START)); - [P0] = R0; + r0 = 0; + r0.h = HI(MSEC_TO_SCLK(CONFIG_HW_WATCHDOG_TIMEOUT_START)); + [p4 + (WDOG_CNT - SYSMMR_BASE)] = r0; /* fire up the watchdog - R0.L above needs to be 0x0000 */ - W[P0 + (WDOG_CTL - WDOG_CNT)] = R0; + W[p4 + (WDOG_CTL - SYSMMR_BASE)] = r0; #endif
/* Turn on the serial for debugging the init process */ @@ -121,6 +132,18 @@ ENTRY(_start) if cc jump .Lnorelocate; r6 = 0 (x);
+ /* Turn off caches as they require CPLBs and a CPLB miss requires + * a software exception handler to process it. But we're about to + * clobber any previous executing software (like U-Boot that just + * launched a new U-Boot via 'go'), so any handler state will be + * unreliable after the memcpy below. + */ + serial_early_puts("Kill Caches"); + r0 = 0; + [p5 + (IMEM_CONTROL - COREMMR_BASE)] = r0; + [p5 + (DMEM_CONTROL - COREMMR_BASE)] = r0; + ssync; + /* In bypass mode, we don't have an LDR with an init block * so we need to explicitly call it ourselves. This will * reprogram our clocks, memory, and setup our async banks. @@ -204,17 +227,15 @@ ENTRY(_start) serial_early_puts("Lower to 15"); r0 = r7; r1 = r6; - p0.l = LO(EVT15); - p0.h = HI(EVT15); p1.l = .Lenable_nested; p1.h = .Lenable_nested; - [p0] = p1; + [p5 + (EVT15 - COREMMR_BASE)] = p1; r7 = EVT_IVG15 (z); sti r7; raise 15; - p4.l = .LWAIT_HERE; - p4.h = .LWAIT_HERE; - reti = p4; + p3.l = .LWAIT_HERE; + p3.h = .LWAIT_HERE; + reti = p3; rti;
/* Enable nested interrupts before continuing with cpu init */

Some parts lack Bank B in L1 data, so have the linker script fall back to Bank A when that happens. This way we can still leverage L1 data.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- arch/blackfin/lib/u-boot.lds.S | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/blackfin/lib/u-boot.lds.S b/arch/blackfin/lib/u-boot.lds.S index f15c97e..2b8d285 100644 --- a/arch/blackfin/lib/u-boot.lds.S +++ b/arch/blackfin/lib/u-boot.lds.S @@ -40,9 +40,13 @@ * This is here in the first place so we can quickly test building * for different CPU's which may lack non-cache L1 data. */ +#ifndef L1_DATA_A_SRAM +# define L1_DATA_A_SRAM 0 +# define L1_DATA_A_SRAM_SIZE 0 +#endif #ifndef L1_DATA_B_SRAM -# define L1_DATA_B_SRAM CONFIG_SYS_MONITOR_BASE -# define L1_DATA_B_SRAM_SIZE 0 +# define L1_DATA_B_SRAM L1_DATA_A_SRAM +# define L1_DATA_B_SRAM_SIZE L1_DATA_A_SRAM_SIZE #endif
/* The 0xC offset is so we don't clobber the tiny LDR jump block. */ @@ -138,7 +142,7 @@ SECTIONS } >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!") + ASSERT (__data_l1_len <= L1_DATA_B_SRAM_SIZE, "L1 data overflow!")
.bss : {

Signed-off-by: Mike Frysinger vapier@gentoo.org --- board/bf506f-ezkit/Makefile | 54 +++++++++++++++++++ board/bf506f-ezkit/bf506f-ezkit.c | 27 +++++++++ boards.cfg | 1 + include/configs/bf506f-ezkit.h | 106 +++++++++++++++++++++++++++++++++++++ 4 files changed, 188 insertions(+), 0 deletions(-) create mode 100644 board/bf506f-ezkit/Makefile create mode 100644 board/bf506f-ezkit/bf506f-ezkit.c create mode 100644 include/configs/bf506f-ezkit.h
diff --git a/board/bf506f-ezkit/Makefile b/board/bf506f-ezkit/Makefile new file mode 100644 index 0000000..cde8168 --- /dev/null +++ b/board/bf506f-ezkit/Makefile @@ -0,0 +1,54 @@ +# +# U-boot - Makefile +# +# Copyright (c) 2005-2008 Analog Device Inc. +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd@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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS-y := $(BOARD).o + +SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) +SOBJS := $(addprefix $(obj),$(SOBJS-y)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/bf506f-ezkit/bf506f-ezkit.c b/board/bf506f-ezkit/bf506f-ezkit.c new file mode 100644 index 0000000..638500d --- /dev/null +++ b/board/bf506f-ezkit/bf506f-ezkit.c @@ -0,0 +1,27 @@ +/* + * U-boot - main board file + * + * Copyright (c) 2008-2010 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#include <common.h> +#include <asm/blackfin.h> + +int checkboard(void) +{ + printf("Board: ADI BF506F EZ-Kit board\n"); + printf(" Support: http://blackfin.uclinux.org/%5Cn"); + return 0; +} + +int board_early_init_f(void) +{ + bfin_write_EBIU_MODE(1); + SSYNC(); + bfin_write_FLASH_CONTROL_CLEAR(1); + udelay(1); + bfin_write_FLASH_CONTROL_SET(1); + return 0; +} diff --git a/boards.cfg b/boards.cfg index b8d077f..ded9880 100644 --- a/boards.cfg +++ b/boards.cfg @@ -166,6 +166,7 @@ favr-32-ezkit avr32 at32ap - earthlc mimc200 avr32 at32ap - mimc at32ap700x hammerhead avr32 at32ap - miromico at32ap700x bct-brettl2 blackfin blackfin +bf506f-ezkit blackfin blackfin bf518f-ezbrd blackfin blackfin bf525-ucr2 blackfin blackfin bf526-ezbrd blackfin blackfin diff --git a/include/configs/bf506f-ezkit.h b/include/configs/bf506f-ezkit.h new file mode 100644 index 0000000..9464029 --- /dev/null +++ b/include/configs/bf506f-ezkit.h @@ -0,0 +1,106 @@ +/* + * U-boot - Configuration file for BF506F EZ-Kit board + */ + +#ifndef __CONFIG_BF506F_EZKIT_H__ +#define __CONFIG_BF506F_EZKIT_H__ + +#include <asm/config-pre.h> + + +/* + * Processor Settings + */ +#define CONFIG_BFIN_CPU bf506-0.0 +#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_PARA + + +/* + * Clock Settings + * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV + * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV + */ +/* CONFIG_CLKIN_HZ is any value in Hz */ +#define CONFIG_CLKIN_HZ 25000000 +/* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */ +/* 1 = CLKIN / 2 */ +#define CONFIG_CLKIN_HALF 0 +/* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */ +/* 1 = bypass PLL */ +#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 16 +/* CCLK_DIV controls the core clock divider */ +/* Values can be 1, 2, 4, or 8 ONLY */ +#define CONFIG_CCLK_DIV 1 +/* SCLK_DIV controls the system clock divider */ +/* Values can range from 1-15 */ +#define CONFIG_SCLK_DIV 5 + + +/* + * Memory Settings + */ +#define CONFIG_MEM_SIZE 0 + +#define CONFIG_EBIU_SDRRC_VAL 0x0096 +#define CONFIG_EBIU_SDGCTL_VAL (SCTLE | CL_3 | PASR_ALL | TRAS_6 | TRP_3 | TRCD_3 | TWR_2 | PSS) + +#define CONFIG_EBIU_AMGCTL_VAL (AMCKEN | AMBEN_ALL) +#define CONFIG_EBIU_AMBCTL0_VAL (B1WAT_15 | B1RAT_15 | B1HT_3 | B1RDYPOL | B0WAT_15 | B0RAT_15 | B0HT_3 | B0RDYPOL) +#define CONFIG_EBIU_AMBCTL1_VAL (B3WAT_15 | B3RAT_15 | B3HT_3 | B3RDYPOL | B2WAT_15 | B2RAT_15 | B2HT_3 | B2RDYPOL) + +#define CONFIG_SYS_MONITOR_BASE (L1_DATA_A_SRAM_END) +#define CONFIG_SYS_MONITOR_LEN (4 * 1024) +#define CONFIG_SYS_MALLOC_LEN (4 * 1024) + + +/* + * Flash Settings + */ +#define CONFIG_FLASH_CFI_DRIVER +#define CONFIG_SYS_FLASH_BASE 0x20000000 +#define CONFIG_SYS_FLASH_CFI +#define CONFIG_SYS_MAX_FLASH_BANKS 1 +#define CONFIG_SYS_MAX_FLASH_SECT 71 +#define CONFIG_CMD_FLASH + + +/* + * SPI Settings + */ +#define CONFIG_BFIN_SPI +#define CONFIG_ENV_SPI_MAX_HZ 30000000 +#define CONFIG_SF_DEFAULT_SPEED 30000000 +#define CONFIG_SPI_FLASH +#define CONFIG_SPI_FLASH_STMICRO +#define CONFIG_CMD_SF +#define CONFIG_CMD_SPI + + +/* + * Env Storage Settings + */ +#define CONFIG_ENV_IS_NOWHERE +#define CONFIG_ENV_SIZE 0x400 + + +/* + * Misc Settings + */ +#define CONFIG_BOARD_EARLY_INIT_F +#define CONFIG_ICACHE_OFF +#define CONFIG_DCACHE_OFF +#define CONFIG_UART_CONSOLE 0 +#define CONFIG_BAUDRATE 115200 + +#define CONFIG_CMD_MEMORY +#undef CONFIG_GZIP +#undef CONFIG_ZLIB +#undef CONFIG_CMD_BOOTM +#undef CONFIG_BOOTM_RTEMS +#undef CONFIG_BOOTM_LINUX + + +#endif

Dear Mike Frysinger,
In message 1293425300-27644-24-git-send-email-vapier@gentoo.org you wrote:
Signed-off-by: Mike Frysinger vapier@gentoo.org
board/bf506f-ezkit/Makefile | 54 +++++++++++++++++++ board/bf506f-ezkit/bf506f-ezkit.c | 27 +++++++++ boards.cfg | 1 + include/configs/bf506f-ezkit.h | 106 +++++++++++++++++++++++++++++++++++++ 4 files changed, 188 insertions(+), 0 deletions(-) create mode 100644 board/bf506f-ezkit/Makefile create mode 100644 board/bf506f-ezkit/bf506f-ezkit.c create mode 100644 include/configs/bf506f-ezkit.h
Entry to MAINTAINERS missing.
...
+#define CONFIG_EBIU_SDGCTL_VAL (SCTLE | CL_3 | PASR_ALL | TRAS_6 | TRP_3 | TRCD_3 | TWR_2 | PSS)
+#define CONFIG_EBIU_AMGCTL_VAL (AMCKEN | AMBEN_ALL) +#define CONFIG_EBIU_AMBCTL0_VAL (B1WAT_15 | B1RAT_15 | B1HT_3 | B1RDYPOL | B0WAT_15 | B0RAT_15 | B0HT_3 | B0RDYPOL) +#define CONFIG_EBIU_AMBCTL1_VAL (B3WAT_15 | B3RAT_15 | B3HT_3 | B3RDYPOL | B2WAT_15 | B2RAT_15 | B2HT_3 | B2RDYPOL)
Lines too long.
+#define CONFIG_SYS_MONITOR_BASE (L1_DATA_A_SRAM_END)
+#define CONFIG_SYS_MONITOR_LEN (4 * 1024) +#define CONFIG_SYS_MALLOC_LEN (4 * 1024)
Sure that 4 KiB is sufficient for these two?
....
+#undef CONFIG_BOOTM_LINUX
+#endif
Only one blank line, please.
Best regards,
Wolfgang Denk

On Monday, January 10, 2011 17:33:42 Wolfgang Denk wrote:
Mike Frysinger you wrote:
board/bf506f-ezkit/Makefile | 54 +++++++++++++++++++ board/bf506f-ezkit/bf506f-ezkit.c | 27 +++++++++ boards.cfg | 1 + include/configs/bf506f-ezkit.h | 106 +++++++++++++++++++++++++++++++++++++ 4 files changed, 188 insertions(+), 0 deletions(-) create mode 100644 board/bf506f-ezkit/Makefile create mode 100644 board/bf506f-ezkit/bf506f-ezkit.c create mode 100644 include/configs/bf506f-ezkit.h
Entry to MAINTAINERS missing.
must of lost when rebasing
+#define CONFIG_SYS_MONITOR_BASE (L1_DATA_A_SRAM_END)
+#define CONFIG_SYS_MONITOR_LEN (4 * 1024) +#define CONFIG_SYS_MALLOC_LEN (4 * 1024)
Sure that 4 KiB is sufficient for these two?
yes ... the port is pretty thin -mike

Signed-off-by: Mike Frysinger vapier@gentoo.org --- MAINTAINERS | 1 + board/bf506f-ezkit/Makefile | 54 +++++++++++++++++++ board/bf506f-ezkit/bf506f-ezkit.c | 27 ++++++++++ boards.cfg | 1 + include/configs/bf506f-ezkit.h | 102 +++++++++++++++++++++++++++++++++++++ 5 files changed, 185 insertions(+), 0 deletions(-) create mode 100644 board/bf506f-ezkit/Makefile create mode 100644 board/bf506f-ezkit/bf506f-ezkit.c create mode 100644 include/configs/bf506f-ezkit.h
diff --git a/MAINTAINERS b/MAINTAINERS index 3a68bed..88431a4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1031,6 +1031,7 @@ Yoshihiro Shimoda shimoda.yoshihiro@renesas.com Mike Frysinger vapier@gentoo.org Blackfin Team u-boot-devel@blackfin.uclinux.org
+ BF506F-EZKIT BF506 BF518F-EZBRD BF518 BF526-EZBRD BF526 BF527-AD7160-EVAL BF527 diff --git a/board/bf506f-ezkit/Makefile b/board/bf506f-ezkit/Makefile new file mode 100644 index 0000000..cde8168 --- /dev/null +++ b/board/bf506f-ezkit/Makefile @@ -0,0 +1,54 @@ +# +# U-boot - Makefile +# +# Copyright (c) 2005-2008 Analog Device Inc. +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd@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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS-y := $(BOARD).o + +SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) +SOBJS := $(addprefix $(obj),$(SOBJS-y)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/bf506f-ezkit/bf506f-ezkit.c b/board/bf506f-ezkit/bf506f-ezkit.c new file mode 100644 index 0000000..638500d --- /dev/null +++ b/board/bf506f-ezkit/bf506f-ezkit.c @@ -0,0 +1,27 @@ +/* + * U-boot - main board file + * + * Copyright (c) 2008-2010 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#include <common.h> +#include <asm/blackfin.h> + +int checkboard(void) +{ + printf("Board: ADI BF506F EZ-Kit board\n"); + printf(" Support: http://blackfin.uclinux.org/%5Cn"); + return 0; +} + +int board_early_init_f(void) +{ + bfin_write_EBIU_MODE(1); + SSYNC(); + bfin_write_FLASH_CONTROL_CLEAR(1); + udelay(1); + bfin_write_FLASH_CONTROL_SET(1); + return 0; +} diff --git a/boards.cfg b/boards.cfg index b8d077f..ded9880 100644 --- a/boards.cfg +++ b/boards.cfg @@ -166,6 +166,7 @@ favr-32-ezkit avr32 at32ap - earthlc mimc200 avr32 at32ap - mimc at32ap700x hammerhead avr32 at32ap - miromico at32ap700x bct-brettl2 blackfin blackfin +bf506f-ezkit blackfin blackfin bf518f-ezbrd blackfin blackfin bf525-ucr2 blackfin blackfin bf526-ezbrd blackfin blackfin diff --git a/include/configs/bf506f-ezkit.h b/include/configs/bf506f-ezkit.h new file mode 100644 index 0000000..c7f4af7 --- /dev/null +++ b/include/configs/bf506f-ezkit.h @@ -0,0 +1,102 @@ +/* + * U-boot - Configuration file for BF506F EZ-Kit board + */ + +#ifndef __CONFIG_BF506F_EZKIT_H__ +#define __CONFIG_BF506F_EZKIT_H__ + +#include <asm/config-pre.h> + + +/* + * Processor Settings + */ +#define CONFIG_BFIN_CPU bf506-0.0 +#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_PARA + + +/* + * Clock Settings + * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV + * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV + */ +/* CONFIG_CLKIN_HZ is any value in Hz */ +#define CONFIG_CLKIN_HZ 25000000 +/* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */ +/* 1 = CLKIN / 2 */ +#define CONFIG_CLKIN_HALF 0 +/* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */ +/* 1 = bypass PLL */ +#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 16 +/* CCLK_DIV controls the core clock divider */ +/* Values can be 1, 2, 4, or 8 ONLY */ +#define CONFIG_CCLK_DIV 1 +/* SCLK_DIV controls the system clock divider */ +/* Values can range from 1-15 */ +#define CONFIG_SCLK_DIV 5 + + +/* + * Memory Settings + */ +#define CONFIG_MEM_SIZE 0 + +#define CONFIG_EBIU_AMGCTL_VAL (AMCKEN | AMBEN_ALL) +#define CONFIG_EBIU_AMBCTL0_VAL 0xffc2ffc2 +#define CONFIG_EBIU_AMBCTL1_VAL 0xffc2ffc2 + +#define CONFIG_SYS_MONITOR_BASE (L1_DATA_A_SRAM_END) +#define CONFIG_SYS_MONITOR_LEN (4 * 1024) +#define CONFIG_SYS_MALLOC_LEN (4 * 1024) + + +/* + * Flash Settings + */ +#define CONFIG_FLASH_CFI_DRIVER +#define CONFIG_SYS_FLASH_BASE 0x20000000 +#define CONFIG_SYS_FLASH_CFI +#define CONFIG_SYS_MAX_FLASH_BANKS 1 +#define CONFIG_SYS_MAX_FLASH_SECT 71 +#define CONFIG_CMD_FLASH + + +/* + * SPI Settings + */ +#define CONFIG_BFIN_SPI +#define CONFIG_ENV_SPI_MAX_HZ 30000000 +#define CONFIG_SF_DEFAULT_SPEED 30000000 +#define CONFIG_SPI_FLASH +#define CONFIG_SPI_FLASH_STMICRO +#define CONFIG_CMD_SF +#define CONFIG_CMD_SPI + + +/* + * Env Storage Settings + */ +#define CONFIG_ENV_IS_NOWHERE +#define CONFIG_ENV_SIZE 0x400 + + +/* + * Misc Settings + */ +#define CONFIG_BOARD_EARLY_INIT_F +#define CONFIG_ICACHE_OFF +#define CONFIG_DCACHE_OFF +#define CONFIG_UART_CONSOLE 0 +#define CONFIG_BAUDRATE 115200 + +#define CONFIG_CMD_MEMORY +#undef CONFIG_GZIP +#undef CONFIG_ZLIB +#undef CONFIG_CMD_BOOTM +#undef CONFIG_BOOTM_RTEMS +#undef CONFIG_BOOTM_LINUX + +#endif

Dear Mike Frysinger,
In message 1294874051-19958-1-git-send-email-vapier@gentoo.org you wrote:
Signed-off-by: Mike Frysinger vapier@gentoo.org
MAINTAINERS | 1 + board/bf506f-ezkit/Makefile | 54 +++++++++++++++++++ board/bf506f-ezkit/bf506f-ezkit.c | 27 ++++++++++ boards.cfg | 1 + include/configs/bf506f-ezkit.h | 102 +++++++++++++++++++++++++++++++++++++ 5 files changed, 185 insertions(+), 0 deletions(-) create mode 100644 board/bf506f-ezkit/Makefile create mode 100644 board/bf506f-ezkit/bf506f-ezkit.c create mode 100644 include/configs/bf506f-ezkit.h
NAK. Please stick to the rulse and describe what you changed in this v2 patch.
Best regards,
Wolfgang Denk

On Wednesday, January 12, 2011 18:10:24 Wolfgang Denk wrote:
Mike Frysinger wrote:
Signed-off-by: Mike Frysinger vapier@gentoo.org
MAINTAINERS | 1 + board/bf506f-ezkit/Makefile | 54 +++++++++++++++++++ board/bf506f-ezkit/bf506f-ezkit.c | 27 ++++++++++ boards.cfg | 1 + include/configs/bf506f-ezkit.h | 102 +++++++++++++++++++++++++++++++++++++ 5 files changed, 185 insertions(+), 0 deletions(-) create mode 100644 board/bf506f-ezkit/Makefile create mode 100644 board/bf506f-ezkit/bf506f-ezkit.c create mode 100644 include/configs/bf506f-ezkit.h
NAK. Please stick to the rulse and describe what you changed in this v2 patch.
you already wrote the changelog: http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/91455/focus=92190 -mike

This define isn't used anywhere anymore, so punt it.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- include/configs/bfin_adi_common.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/include/configs/bfin_adi_common.h b/include/configs/bfin_adi_common.h index 03c6433..b86ca68 100644 --- a/include/configs/bfin_adi_common.h +++ b/include/configs/bfin_adi_common.h @@ -85,7 +85,6 @@ # define CONFIG_CMD_CACHE # define CONFIG_CMD_CPLBINFO # define CONFIG_CMD_ELF -# define CONFIG_ELF_SIMPLE_LOAD # define CONFIG_CMD_GPIO # define CONFIG_CMD_KGDB # define CONFIG_CMD_REGINFO

We need the updated LDR bit defines for our LDR utils.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- .../include/asm/mach-common/bits/bootrom.h | 86 +++++++++++++------ 1 files changed, 59 insertions(+), 27 deletions(-)
diff --git a/arch/blackfin/include/asm/mach-common/bits/bootrom.h b/arch/blackfin/include/asm/mach-common/bits/bootrom.h index f537e93..0e2cacb 100644 --- a/arch/blackfin/include/asm/mach-common/bits/bootrom.h +++ b/arch/blackfin/include/asm/mach-common/bits/bootrom.h @@ -229,33 +229,65 @@ static uint32_t (* const bfrom_NandBoot)(int32_t dNandAddress, int32_t dFlags, i
#endif /* __ASSEMBLY__ */
+/* Bit defines for BF53x block flags */ +#define BFLAG_53X_ZEROFILL 0x0001 +#define BFLAG_53X_RESVECT 0x0002 +#define BFLAG_53X_INIT 0x0008 +#define BFLAG_53X_IGNORE 0x0010 +#define BFLAG_53X_PFLAG_MASK 0x01E0 +#define BFLAG_53X_PFLAG_SHIFT 5 +#define BFLAG_53X_PPORT_MASK 0x0600 +#define BFLAG_53X_PPORT_SHIFT 9 +#define BFLAG_53X_COMPRESSED 0x2000 +#define BFLAG_53X_FINAL 0x8000 + +/* Bit defines for BF56x global header */ +#define GFLAG_56X_16BIT_FLASH 0x00000001 +#define GFLAG_56X_WAIT_MASK 0x0000001E +#define GFLAG_56X_WAIT_SHIFT 1 +#define GFLAG_56X_HOLD_MASK 0x000000C0 +#define GFLAG_56X_HOLD_SHIFT 6 +#define GFLAG_56X_SPI_MASK 0x00000700 +#define GFLAG_56X_SPI_SHIFT 8 +#define GFLAG_56X_SPI_500K 0x0 +#define GFLAG_56X_SPI_1M 0x1 +#define GFLAG_56X_SPI_2M 0x2 +#define GFLAG_56X_SIGN_MASK 0xFF000000 +#define GFLAG_56X_SIGN_SHIFT 28 +#define GFLAG_56X_SIGN_MAGIC 0xA + /* Bit defines for ADI_BOOT_DATA->dFlags */ -#define BFLAG_DMACODE_MASK 0x0000000F -#define BFLAG_SAFE 0x00000010 -#define BFLAG_AUX 0x00000020 -#define BFLAG_FILL 0x00000100 -#define BFLAG_QUICKBOOT 0x00000200 -#define BFLAG_CALLBACK 0x00000400 -#define BFLAG_INIT 0x00000800 -#define BFLAG_IGNORE 0x00001000 -#define BFLAG_INDIRECT 0x00002000 -#define BFLAG_FIRST 0x00004000 -#define BFLAG_FINAL 0x00008000 -#define BFLAG_HOOK 0x00400000 -#define BFLAG_HDRINDIRECT 0x00800000 -#define BFLAG_TYPE_MASK 0x00300000 -#define BFLAG_TYPE_1 0x00000000 -#define BFLAG_TYPE_2 0x00100000 -#define BFLAG_TYPE_3 0x00200000 -#define BFLAG_TYPE_4 0x00300000 -#define BFLAG_FASTREAD 0x00400000 -#define BFLAG_NOAUTO 0x01000000 -#define BFLAG_PERIPHERAL 0x02000000 -#define BFLAG_SLAVE 0x04000000 -#define BFLAG_WAKEUP 0x08000000 -#define BFLAG_NEXTDXE 0x10000000 -#define BFLAG_RETURN 0x20000000 -#define BFLAG_RESET 0x40000000 -#define BFLAG_NONRESTORE 0x80000000 +#define BFLAG_DMACODE_MASK 0x0000000F +#define BFLAG_SAFE 0x00000010 +#define BFLAG_AUX 0x00000020 +#define BFLAG_FILL 0x00000100 +#define BFLAG_QUICKBOOT 0x00000200 +#define BFLAG_CALLBACK 0x00000400 +#define BFLAG_INIT 0x00000800 +#define BFLAG_IGNORE 0x00001000 +#define BFLAG_INDIRECT 0x00002000 +#define BFLAG_FIRST 0x00004000 +#define BFLAG_FINAL 0x00008000 +#define BFLAG_HDRSIGN_MASK 0xFF000000 +#define BFLAG_HDRSIGN_SHIFT 24 +#define BFLAG_HDRSIGN_MAGIC 0xAD +#define BFLAG_HDRCHK_MASK 0x00FF0000 +#define BFLAG_HDRCHK_SHIFT 16 +#define BFLAG_HOOK 0x00400000 +#define BFLAG_HDRINDIRECT 0x00800000 +#define BFLAG_TYPE_MASK 0x00300000 +#define BFLAG_TYPE_1 0x00000000 +#define BFLAG_TYPE_2 0x00100000 +#define BFLAG_TYPE_3 0x00200000 +#define BFLAG_TYPE_4 0x00300000 +#define BFLAG_FASTREAD 0x00400000 +#define BFLAG_NOAUTO 0x01000000 +#define BFLAG_PERIPHERAL 0x02000000 +#define BFLAG_SLAVE 0x04000000 +#define BFLAG_WAKEUP 0x08000000 +#define BFLAG_NEXTDXE 0x10000000 +#define BFLAG_RETURN 0x20000000 +#define BFLAG_RESET 0x40000000 +#define BFLAG_NONRESTORE 0x80000000
#endif

Now that the common bootrom.h sets up defines for us, switch to them rather than our own local set.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- common/cmd_bootldr.c | 21 ++++++++------------- 1 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/common/cmd_bootldr.c b/common/cmd_bootldr.c index 535b931..bc5c1f9 100644 --- a/common/cmd_bootldr.c +++ b/common/cmd_bootldr.c @@ -24,7 +24,7 @@ static bool ldr_valid_signature(uint8_t *data) #if defined(__ADSPBF561__)
/* BF56x has a 4 byte global header */ - if (data[3] == 0xA0) + if (data[3] == (GFLAG_56X_SIGN_MAGIC << (GFLAG_56X_SIGN_SHIFT - 24))) return true;
#elif defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \ @@ -53,11 +53,6 @@ static bool ldr_valid_signature(uint8_t *data) * LDRs from random memory addresses. So whenever possible, use that. In * the older cases (BF53x/BF561), parse the LDR format ourselves. */ -#define ZEROFILL 0x0001 -#define RESVECT 0x0002 -#define INIT 0x0008 -#define IGNORE 0x0010 -#define FINAL 0x8000 static void ldr_load(uint8_t *base_addr) { #if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \ @@ -76,7 +71,7 @@ static void ldr_load(uint8_t *base_addr) # endif
memmove(&flags, base_addr + 8, sizeof(flags)); - bfin_write_EVT1(flags & RESVECT ? 0xFFA00000 : 0xFFA08000); + bfin_write_EVT1(flags & BFLAG_53X_RESVECT ? 0xFFA00000 : 0xFFA08000);
do { /* block header may not be aligned */ @@ -85,24 +80,24 @@ static void ldr_load(uint8_t *base_addr) memmove(&flags, base_addr+8, sizeof(flags)); base_addr += sizeof(addr) + sizeof(count) + sizeof(flags);
- printf("loading to 0x%08x (0x%x bytes) flags: 0x%04x\n", + printf("loading to 0x%08x (%#x bytes) flags: 0x%04x\n", addr, count, flags);
- if (!(flags & IGNORE)) { - if (flags & ZEROFILL) + if (!(flags & BFLAG_53X_IGNORE)) { + if (flags & BFLAG_53X_ZEROFILL) memset((void *)addr, 0x00, count); else memcpy((void *)addr, base_addr, count);
- if (flags & INIT) { + if (flags & BFLAG_53X_INIT) { void (*init)(void) = (void *)addr; init(); } }
- if (!(flags & ZEROFILL)) + if (!(flags & BFLAG_53X_ZEROFILL)) base_addr += count; - } while (!(flags & FINAL)); + } while (!(flags & BFLAG_53X_FINAL));
#endif }

Simple command to decode/check an LDR image before we try to boot it.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- common/Makefile | 1 + common/cmd_ldrinfo.c | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 193 insertions(+), 0 deletions(-) create mode 100644 common/cmd_ldrinfo.c
diff --git a/common/Makefile b/common/Makefile index abea91c..9cc8dd1 100644 --- a/common/Makefile +++ b/common/Makefile @@ -105,6 +105,7 @@ COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o COBJS-$(CONFIG_CMD_CRAMFS) += cmd_cramfs.o +COBJS-$(CONFIG_CMD_LDRINFO) += cmd_ldrinfo.o COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o COBJS-y += cmd_load.o COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o diff --git a/common/cmd_ldrinfo.c b/common/cmd_ldrinfo.c new file mode 100644 index 0000000..2aa56bd --- /dev/null +++ b/common/cmd_ldrinfo.c @@ -0,0 +1,192 @@ +/* + * U-boot - ldrinfo + * + * Copyright (c) 2010 Analog Devices Inc. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * Licensed under the GPL-2 or later. + */ + +#include <config.h> +#include <common.h> +#include <command.h> + +#include <asm/blackfin.h> +#include <asm/mach-common/bits/bootrom.h> + +static uint32_t ldrinfo_header(const void *addr) +{ + uint32_t skip = 0; + +#if defined(__ADSPBF561__) + /* BF56x has a 4 byte global header */ + uint32_t header, sign; + static const char * const spi_speed[] = { + "500K", "1M", "2M", "??", + }; + + memcpy(&header, addr, sizeof(header)); + + sign = (header & GFLAG_56X_SIGN_MASK) >> GFLAG_56X_SIGN_SHIFT; + printf("Header: %08X ( %s-bit-flash wait:%i hold:%i spi:%s %s)\n", + header, + (header & GFLAG_56X_16BIT_FLASH) ? "16" : "8", + (header & GFLAG_56X_WAIT_MASK) >> GFLAG_56X_WAIT_SHIFT, + (header & GFLAG_56X_HOLD_MASK) >> GFLAG_56X_HOLD_SHIFT, + spi_speed[(header & GFLAG_56X_SPI_MASK) >> GFLAG_56X_SPI_SHIFT], + sign == GFLAG_56X_SIGN_MAGIC ? "" : "!!hdrsign!! "); + + skip = 4; +#endif + + /* |Block @ 12345678: 12345678 12345678 12345678 12345678 | */ +#if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \ + defined(__ADSPBF534__) || defined(__ADSPBF536__) || defined(__ADSPBF537__) || \ + defined(__ADSPBF538__) || defined(__ADSPBF539__) || defined(__ADSPBF561__) + printf(" Address Count Flags\n"); +#else + printf(" BCode Address Count Argument\n"); +#endif + + return skip; +} + +struct ldr_flag { + uint16_t flag; + const char *desc; +}; + +static uint32_t ldrinfo_block(const void *base_addr) +{ + uint32_t count; + + printf("Block @ %08X: ", (uint32_t)base_addr); + +#if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \ + defined(__ADSPBF534__) || defined(__ADSPBF536__) || defined(__ADSPBF537__) || \ + defined(__ADSPBF538__) || defined(__ADSPBF539__) || defined(__ADSPBF561__) + + uint32_t addr, pval; + uint16_t flags; + int i; + static const struct ldr_flag ldr_flags[] = { + { BFLAG_53X_ZEROFILL, "zerofill" }, + { BFLAG_53X_RESVECT, "resvect" }, + { BFLAG_53X_INIT, "init" }, + { BFLAG_53X_IGNORE, "ignore" }, + { BFLAG_53X_COMPRESSED, "compressed"}, + { BFLAG_53X_FINAL, "final" }, + }; + + memcpy(&addr, base_addr, sizeof(addr)); + memcpy(&count, base_addr+4, sizeof(count)); + memcpy(&flags, base_addr+8, sizeof(flags)); + + printf("%08X %08X %04X ( ", addr, count, flags); + + for (i = 0; i < ARRAY_SIZE(ldr_flags); ++i) + if (flags & ldr_flags[i].flag) + printf("%s ", ldr_flags[i].desc); + + pval = (flags & BFLAG_53X_PFLAG_MASK) >> BFLAG_53X_PFLAG_SHIFT; + if (pval) + printf("gpio%i ", pval); + pval = (flags & BFLAG_53X_PPORT_MASK) >> BFLAG_53X_PPORT_SHIFT; + if (pval) + printf("port%c ", 'e' + pval); + + if (flags & BFLAG_53X_ZEROFILL) + count = 0; + if (flags & BFLAG_53X_FINAL) + count = 0; + else + count += sizeof(addr) + sizeof(count) + sizeof(flags); + +#else + + const uint8_t *raw8 = base_addr; + uint32_t bcode, addr, arg, sign, chk; + int i; + static const struct ldr_flag ldr_flags[] = { + { BFLAG_SAFE, "safe" }, + { BFLAG_AUX, "aux" }, + { BFLAG_FILL, "fill" }, + { BFLAG_QUICKBOOT, "quickboot" }, + { BFLAG_CALLBACK, "callback" }, + { BFLAG_INIT, "init" }, + { BFLAG_IGNORE, "ignore" }, + { BFLAG_INDIRECT, "indirect" }, + { BFLAG_FIRST, "first" }, + { BFLAG_FINAL, "final" }, + }; + + memcpy(&bcode, base_addr, sizeof(bcode)); + memcpy(&addr, base_addr+4, sizeof(addr)); + memcpy(&count, base_addr+8, sizeof(count)); + memcpy(&arg, base_addr+12, sizeof(arg)); + + printf("%08X %08X %08X %08X ( ", bcode, addr, count, arg); + + if (addr % 4) + printf("!!addralgn!! "); + if (count % 4) + printf("!!cntalgn!! "); + + sign = (bcode & BFLAG_HDRSIGN_MASK) >> BFLAG_HDRSIGN_SHIFT; + if (sign != BFLAG_HDRSIGN_MAGIC) + printf("!!hdrsign!! "); + + chk = 0; + for (i = 0; i < 16; ++i) + chk ^= raw8[i]; + if (chk) + printf("!!hdrchk!! "); + + printf("dma:%i ", bcode & BFLAG_DMACODE_MASK); + + for (i = 0; i < ARRAY_SIZE(ldr_flags); ++i) + if (bcode & ldr_flags[i].flag) + printf("%s ", ldr_flags[i].desc); + + if (bcode & BFLAG_FILL) + count = 0; + if (bcode & BFLAG_FINAL) + count = 0; + else + count += sizeof(bcode) + sizeof(addr) + sizeof(count) + sizeof(arg); + +#endif + + printf(")\n"); + + return count; +} + +static int do_ldrinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + const void *addr; + uint32_t skip; + + /* Get the address */ + if (argc < 2) + addr = (void *)load_addr; + else + addr = (void *)simple_strtoul(argv[1], NULL, 16); + + /* Walk the LDR */ + addr += ldrinfo_header(addr); + do { + skip = ldrinfo_block(addr); + addr += skip; + } while (skip); + + return 0; +} + +U_BOOT_CMD( + ldrinfo, 2, 0, do_ldrinfo, + "validate ldr image in memory", + "[addr]\n" +);

Dear Mike Frysinger,
In message 1293425300-27644-28-git-send-email-vapier@gentoo.org you wrote:
Simple command to decode/check an LDR image before we try to boot it.
Signed-off-by: Mike Frysinger vapier@gentoo.org
common/Makefile | 1 + common/cmd_ldrinfo.c | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 193 insertions(+), 0 deletions(-) create mode 100644 common/cmd_ldrinfo.c
diff --git a/common/Makefile b/common/Makefile index abea91c..9cc8dd1 100644 --- a/common/Makefile +++ b/common/Makefile @@ -105,6 +105,7 @@ COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o COBJS-$(CONFIG_CMD_CRAMFS) += cmd_cramfs.o +COBJS-$(CONFIG_CMD_LDRINFO) += cmd_ldrinfo.o COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o COBJS-y += cmd_load.o COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
Please add documentation for the new CONFIG_CMD_LDRINFO option.
Best regards,
Wolfgang Denk

Simple command to decode/check an LDR image before we try to boot it.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- v2 - add README note
README | 1 + common/Makefile | 1 + common/cmd_ldrinfo.c | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 194 insertions(+), 0 deletions(-) create mode 100644 common/cmd_ldrinfo.c
diff --git a/README b/README index d7a23cd..0b69539 100644 --- a/README +++ b/README @@ -648,6 +648,7 @@ The following options need to be configured: CONFIG_CMD_ITEST Integer/string test of 2 values CONFIG_CMD_JFFS2 * JFFS2 Support CONFIG_CMD_KGDB * kgdb + CONFIG_CMD_LDRINFO ldrinfo (display Blackfin loader) CONFIG_CMD_LOADB loadb CONFIG_CMD_LOADS loads CONFIG_CMD_MD5SUM print md5 message digest diff --git a/common/Makefile b/common/Makefile index 048df0c..4555716 100644 --- a/common/Makefile +++ b/common/Makefile @@ -105,6 +105,7 @@ COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o COBJS-$(CONFIG_CMD_CRAMFS) += cmd_cramfs.o +COBJS-$(CONFIG_CMD_LDRINFO) += cmd_ldrinfo.o COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o COBJS-y += cmd_load.o COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o diff --git a/common/cmd_ldrinfo.c b/common/cmd_ldrinfo.c new file mode 100644 index 0000000..2aa56bd --- /dev/null +++ b/common/cmd_ldrinfo.c @@ -0,0 +1,192 @@ +/* + * U-boot - ldrinfo + * + * Copyright (c) 2010 Analog Devices Inc. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * Licensed under the GPL-2 or later. + */ + +#include <config.h> +#include <common.h> +#include <command.h> + +#include <asm/blackfin.h> +#include <asm/mach-common/bits/bootrom.h> + +static uint32_t ldrinfo_header(const void *addr) +{ + uint32_t skip = 0; + +#if defined(__ADSPBF561__) + /* BF56x has a 4 byte global header */ + uint32_t header, sign; + static const char * const spi_speed[] = { + "500K", "1M", "2M", "??", + }; + + memcpy(&header, addr, sizeof(header)); + + sign = (header & GFLAG_56X_SIGN_MASK) >> GFLAG_56X_SIGN_SHIFT; + printf("Header: %08X ( %s-bit-flash wait:%i hold:%i spi:%s %s)\n", + header, + (header & GFLAG_56X_16BIT_FLASH) ? "16" : "8", + (header & GFLAG_56X_WAIT_MASK) >> GFLAG_56X_WAIT_SHIFT, + (header & GFLAG_56X_HOLD_MASK) >> GFLAG_56X_HOLD_SHIFT, + spi_speed[(header & GFLAG_56X_SPI_MASK) >> GFLAG_56X_SPI_SHIFT], + sign == GFLAG_56X_SIGN_MAGIC ? "" : "!!hdrsign!! "); + + skip = 4; +#endif + + /* |Block @ 12345678: 12345678 12345678 12345678 12345678 | */ +#if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \ + defined(__ADSPBF534__) || defined(__ADSPBF536__) || defined(__ADSPBF537__) || \ + defined(__ADSPBF538__) || defined(__ADSPBF539__) || defined(__ADSPBF561__) + printf(" Address Count Flags\n"); +#else + printf(" BCode Address Count Argument\n"); +#endif + + return skip; +} + +struct ldr_flag { + uint16_t flag; + const char *desc; +}; + +static uint32_t ldrinfo_block(const void *base_addr) +{ + uint32_t count; + + printf("Block @ %08X: ", (uint32_t)base_addr); + +#if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \ + defined(__ADSPBF534__) || defined(__ADSPBF536__) || defined(__ADSPBF537__) || \ + defined(__ADSPBF538__) || defined(__ADSPBF539__) || defined(__ADSPBF561__) + + uint32_t addr, pval; + uint16_t flags; + int i; + static const struct ldr_flag ldr_flags[] = { + { BFLAG_53X_ZEROFILL, "zerofill" }, + { BFLAG_53X_RESVECT, "resvect" }, + { BFLAG_53X_INIT, "init" }, + { BFLAG_53X_IGNORE, "ignore" }, + { BFLAG_53X_COMPRESSED, "compressed"}, + { BFLAG_53X_FINAL, "final" }, + }; + + memcpy(&addr, base_addr, sizeof(addr)); + memcpy(&count, base_addr+4, sizeof(count)); + memcpy(&flags, base_addr+8, sizeof(flags)); + + printf("%08X %08X %04X ( ", addr, count, flags); + + for (i = 0; i < ARRAY_SIZE(ldr_flags); ++i) + if (flags & ldr_flags[i].flag) + printf("%s ", ldr_flags[i].desc); + + pval = (flags & BFLAG_53X_PFLAG_MASK) >> BFLAG_53X_PFLAG_SHIFT; + if (pval) + printf("gpio%i ", pval); + pval = (flags & BFLAG_53X_PPORT_MASK) >> BFLAG_53X_PPORT_SHIFT; + if (pval) + printf("port%c ", 'e' + pval); + + if (flags & BFLAG_53X_ZEROFILL) + count = 0; + if (flags & BFLAG_53X_FINAL) + count = 0; + else + count += sizeof(addr) + sizeof(count) + sizeof(flags); + +#else + + const uint8_t *raw8 = base_addr; + uint32_t bcode, addr, arg, sign, chk; + int i; + static const struct ldr_flag ldr_flags[] = { + { BFLAG_SAFE, "safe" }, + { BFLAG_AUX, "aux" }, + { BFLAG_FILL, "fill" }, + { BFLAG_QUICKBOOT, "quickboot" }, + { BFLAG_CALLBACK, "callback" }, + { BFLAG_INIT, "init" }, + { BFLAG_IGNORE, "ignore" }, + { BFLAG_INDIRECT, "indirect" }, + { BFLAG_FIRST, "first" }, + { BFLAG_FINAL, "final" }, + }; + + memcpy(&bcode, base_addr, sizeof(bcode)); + memcpy(&addr, base_addr+4, sizeof(addr)); + memcpy(&count, base_addr+8, sizeof(count)); + memcpy(&arg, base_addr+12, sizeof(arg)); + + printf("%08X %08X %08X %08X ( ", bcode, addr, count, arg); + + if (addr % 4) + printf("!!addralgn!! "); + if (count % 4) + printf("!!cntalgn!! "); + + sign = (bcode & BFLAG_HDRSIGN_MASK) >> BFLAG_HDRSIGN_SHIFT; + if (sign != BFLAG_HDRSIGN_MAGIC) + printf("!!hdrsign!! "); + + chk = 0; + for (i = 0; i < 16; ++i) + chk ^= raw8[i]; + if (chk) + printf("!!hdrchk!! "); + + printf("dma:%i ", bcode & BFLAG_DMACODE_MASK); + + for (i = 0; i < ARRAY_SIZE(ldr_flags); ++i) + if (bcode & ldr_flags[i].flag) + printf("%s ", ldr_flags[i].desc); + + if (bcode & BFLAG_FILL) + count = 0; + if (bcode & BFLAG_FINAL) + count = 0; + else + count += sizeof(bcode) + sizeof(addr) + sizeof(count) + sizeof(arg); + +#endif + + printf(")\n"); + + return count; +} + +static int do_ldrinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + const void *addr; + uint32_t skip; + + /* Get the address */ + if (argc < 2) + addr = (void *)load_addr; + else + addr = (void *)simple_strtoul(argv[1], NULL, 16); + + /* Walk the LDR */ + addr += ldrinfo_header(addr); + do { + skip = ldrinfo_block(addr); + addr += skip; + } while (skip); + + return 0; +} + +U_BOOT_CMD( + ldrinfo, 2, 0, do_ldrinfo, + "validate ldr image in memory", + "[addr]\n" +);

Signed-off-by: Mike Frysinger vapier@gentoo.org --- include/configs/bfin_adi_common.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/configs/bfin_adi_common.h b/include/configs/bfin_adi_common.h index b86ca68..9016a26 100644 --- a/include/configs/bfin_adi_common.h +++ b/include/configs/bfin_adi_common.h @@ -87,6 +87,7 @@ # define CONFIG_CMD_ELF # define CONFIG_CMD_GPIO # define CONFIG_CMD_KGDB +# define CONFIG_CMD_LDRINFO # define CONFIG_CMD_REGINFO # define CONFIG_CMD_STRINGS # if defined(__ADSPBF51x__) || defined(__ADSPBF52x__) || defined(__ADSPBF54x__)
participants (3)
-
Mike Frysinger
-
Sergei Shtylyov
-
Wolfgang Denk