All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 08/34] Blackfin: dnp5370: new board port
Date: Sun,  3 Apr 2011 04:58:15 -0400	[thread overview]
Message-ID: <1301821121-26743-9-git-send-email-vapier@gentoo.org> (raw)
In-Reply-To: <1301821121-26743-1-git-send-email-vapier@gentoo.org>

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 4756f14..17327de 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1073,6 +1073,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 at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+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 at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#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 45c3102..57b4142 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -198,6 +198,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
-- 
1.7.4.1

  parent reply	other threads:[~2011-04-03  8:58 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-03  8:58 [U-Boot] [PATCH 00/34] Blackfin updates for 2011.06 Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 01/34] Blackfin: bf518f-ezbrd: don't require SPI logic all the time Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 02/34] Blackfin: skip RAM display for 0 mem systems Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 03/34] Blackfin: drop CONFIG_SYS_TEXT_BASE from boards Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 04/34] Blackfin: unify bootmode based LDR_FLAGS setup Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 05/34] Blackfin: move CONFIG_BFIN_CPU back to board config.h Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 06/34] Blackfin: bf527-sdp: update custom CFLAGS paths Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 07/34] Blackfin: bf537-pnav/blackstamp/blackvme: drop empty config.mk files Mike Frysinger
2011-04-03  8:58 ` Mike Frysinger [this message]
2011-04-03  8:58 ` [U-Boot] [PATCH 09/34] Blackfin: bf525-ucr2: new board port Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 10/34] Blackfin: serial: clean up muxing a bit Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 11/34] Blackfin: bf537-minotaur/bf537-srv1: undefine nfs when net is disabled Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 12/34] Blackfin: bf537: fix L1 data defines Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 13/34] Blackfin: bf561-ezkit/ibf-dsp561: invert env offset/addr logic Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 14/34] Blackfin: fix bd_t handling Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 15/34] Blackfin: BF50x: new processor port Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 16/34] Blackfin: drop duplicate system mmr and L1 scratch defines Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 17/34] Blackfin: BF52x: unify duplicated headers Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 18/34] Blackfin: BF537: " Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 19/34] Blackfin: only check for os log when we have external memory Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 20/34] Blackfin: turn off caches when self initializing Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 21/34] Blackfin: default to L1 bank A when L1 bank B does not exist Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 22/34] Blackfin: bf506f-ezkit: new board port Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 23/34] Blackfin: adi boards: drop old ELF define Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 24/34] Blackfin: bootrom.h: sync with toolchain Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 25/34] Blackfin: bootldr: use common defines Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 26/34] Blackfin: ldrinfo: new command Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 27/34] Blackfin: adi boards: enable ldrinfo Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 28/34] Blackfin: bfin_sdh: set all timer bits before transfer Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 29/34] Blackfin: bfin_sdh: add support for multiblock operations Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 30/34] Blackfin: adi boards: enable CONFIG_MONITOR_IS_IN_RAM Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 31/34] Blackfin: replace "bfin_reset_or_hang()" with "panic()" Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 32/34] Blackfin: bf548-ezkit: move env sector Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 33/34] Blackfin: bf518f-ezbrd: get MAC from flash Mike Frysinger
2011-04-03  8:58 ` [U-Boot] [PATCH 34/34] Blackfin: bf526-ezbrd: " Mike Frysinger
2011-04-08  4:47 ` [U-Boot] Pull request u-boot-blackfin.git Mike Frysinger
2011-04-10 19:19   ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301821121-26743-9-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.