Skip to contentSkip to conversation

Add support for EDB93xx boards

PATCH Applied Matthias Kaehlcke 1 participant 1 message Jan 12, 2010

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

PATCH 5/5 Add support for EDB93xx boards

Added support for the following Cirrus Logic EDB93xx boards:

EDB9301
EDB9302
EDB9302A
EDB9307
EDB9307A
EDB93012
EDB9315
EDB9315A

---
 Documentation/boards.dox              |    8 +
 arch/arm/configs/edb93xx_defconfig    |  236 +++++++++++++++++++++++++++++++++
 board/edb93xx/Makefile                |    2 +
 board/edb93xx/config.h                |    4 +
 board/edb93xx/early_udelay.h          |   34 +++++
 board/edb93xx/edb93xx.c               |  172 ++++++++++++++++++++++++
 board/edb93xx/edb93xx.dox             |  108 +++++++++++++++
 board/edb93xx/edb93xx.h               |   48 +++++++
 board/edb93xx/env/bin/boot            |   48 +++++++
 board/edb93xx/env/bin/flash_partition |   22 +++
 board/edb93xx/env/bin/init            |   19 +++
 board/edb93xx/env/bin/set_nor_parts   |    3 +
 board/edb93xx/env/bin/update_kernel   |   16 +++
 board/edb93xx/env/bin/update_rootfs   |   16 +++
 board/edb93xx/env/config              |   16 +++
 board/edb93xx/flash_cfg.c             |   38 ++++++
 board/edb93xx/pll_cfg.c               |   58 ++++++++
 board/edb93xx/pll_cfg.h               |   72 ++++++++++
 board/edb93xx/sdram_cfg.c             |  127 ++++++++++++++++++
 board/edb93xx/sdram_cfg.h             |  144 ++++++++++++++++++++
 20 files changed, 1191 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/configs/edb93xx_defconfig
 create mode 100644 board/edb93xx/Makefile
 create mode 100644 board/edb93xx/config.h
 create mode 100644 board/edb93xx/early_udelay.h
 create mode 100644 board/edb93xx/edb93xx.c
 create mode 100644 board/edb93xx/edb93xx.dox
 create mode 100644 board/edb93xx/edb93xx.h
 create mode 100644 board/edb93xx/env/bin/boot
 create mode 100644 board/edb93xx/env/bin/flash_partition
 create mode 100644 board/edb93xx/env/bin/init
 create mode 100644 board/edb93xx/env/bin/set_nor_parts
 create mode 100644 board/edb93xx/env/bin/update_kernel
 create mode 100644 board/edb93xx/env/bin/update_rootfs
 create mode 100644 board/edb93xx/env/config
 create mode 100644 board/edb93xx/flash_cfg.c
 create mode 100644 board/edb93xx/pll_cfg.c
 create mode 100644 board/edb93xx/pll_cfg.h
 create mode 100644 board/edb93xx/sdram_cfg.c
 create mode 100644 board/edb93xx/sdram_cfg.h
Documentation/boards.dox +8 -0
index dba547f..7c7f4d1 100644
@@ -20,6 +20,14 @@ ARM type:
 @li @subpage a9m2440
 @li @subpage a9m2410
 @li @subpage eukrea_cpuimx27
+@li @subpage edb9301
+@li @subpage edb9302
+@li @subpage edb9302a
+@li @subpage edb9307
+@li @subpage edb9307a
+@li @subpage edb9312
+@li @subpage edb9315
+@li @subpage edb9315a
 
 Blackfin type:
 
arch/arm/configs/edb93xx_defconfig new file +236 -0

236 lines not on this page · raw message

board/edb93xx/Makefile new file +2 -0
new file mode 100644
index 0000000..e19cd7b
@@ -0,0 +1,2 @@
+
+obj-y += edb93xx.o flash_cfg.o pll_cfg.o sdram_cfg.o
board/edb93xx/config.h new file +4 -0
new file mode 100644
index 0000000..6ae9a40
@@ -0,0 +1,4 @@
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#endif  /* __CONFIG_H */
board/edb93xx/early_udelay.h new file +34 -0
new file mode 100644
index 0000000..3b26b3f
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2009 Matthias Kaehlcke <[email protected]>
+ *
+ * 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 <common.h>
+
+/* delay execution before timers are initialized */
+static inline void early_udelay(uint32_t usecs)
+{
+	/* loop takes 4 cycles at 5.0ns (fastest case, running at 200MHz) */
+	register uint32_t loops = (usecs * 1000) / 20;
+
+	__asm__ volatile ("1:\n"
+			"subs %0, %1, #1\n"
+			"bne 1b":"=r" (loops):"0" (loops));
+}
board/edb93xx/edb93xx.c new file +172 -0

172 lines not on this page · raw message

board/edb93xx/edb93xx.dox new file +108 -0

109 lines not on this page · raw message

board/edb93xx/edb93xx.h new file +48 -0

48 lines not on this page · raw message

board/edb93xx/env/bin/boot new file +48 -0

49 lines not on this page · raw message

board/edb93xx/env/bin/flash_partition new file +22 -0
new file mode 100644
index 0000000..ded40aa
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+if [ $# != 2 ];
+then
+				echo "Usage: $0 <image> <partition>"
+				exit 1
+fi
+
+image=$1
+partition=$2
+
+echo "Unlocking ${partition}"
+unprotect ${partition}
+
+echo "Erasing ${partition}"
+erase ${partition}
+
+echo "Flashing ${image} to ${partition}"
+cp ${image} ${partition}
+
+echo "Locking ${partition}"
+protect ${partition}
board/edb93xx/env/bin/init new file +19 -0
new file mode 100644
index 0000000..c6b5aed
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+PATH=/env/bin
+export PATH
+
+. /env/config
+
+# add partitions to barebox
+. /env/bin/set_nor_parts
+addpart /dev/nor0 ${nor_parts}
+
+echo
+echo -n "Hit any key to stop autoboot: "
+timeout -a $autoboot_timeout
+if [ $? != 0 ]; then
+	exit
+fi
+
+boot
\ No newline at end of file
board/edb93xx/env/bin/set_nor_parts new file +3 -0
new file mode 100644
index 0000000..38321fa
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+nor_parts="256k(barebox)ro,128k(env_boot),128k(env_boot.bak),1664k(kernel_1)${cfg_1_ro},6144k(rootfs_1)${cfg_1_ro},1664k(kernel_2)${cfg_2_ro},6144k(rootfs_2)${cfg_2_ro},128k(cfg_app),128k(cfg_app.bak)"
\ No newline at end of file
board/edb93xx/env/bin/update_kernel new file +16 -0
new file mode 100644
index 0000000..3e4b9b0
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+. /env/config
+
+if [ $# != 1 ];
+then
+				echo "Usage: $0 <1/2>"
+				exit 1
+fi
+
+partition=/dev/nor0.kernel_$1
+
+cd /
+tftp ${board}/kernel.img || exit 1
+
+flash_partition kernel.img ${partition}
board/edb93xx/env/bin/update_rootfs new file +16 -0
new file mode 100644
index 0000000..52a3699
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+. /env/config
+
+if [ $# != 1 ];
+then
+				echo "Usage: $0 <1/2>"
+				exit 1
+fi
+
+partition=/dev/nor0.rootfs_$1
+
+cd /
+tftp ${board}/rootfs.img || exit 1
+
+flash_partition rootfs.img ${partition}
board/edb93xx/env/config new file +16 -0
new file mode 100644
index 0000000..47ab209
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+eth0.ipaddr=192.168.0.50
+eth0.netmask=255.255.0.0
+eth0.serverip=192.168.0.8
+eth0.ethaddr=80:81:82:83:84:85
+
+board=edb9301
+autoboot_timeout=3
+active_cfg=1
+bootargs_common="console=ttyAM0,115200"
+
+# valid media: flash/net
+kernel_boot_media=flash
+rootfs_boot_media=flash
+
board/edb93xx/flash_cfg.c new file +38 -0
new file mode 100644
index 0000000..91a6a4e
@@ -0,0 +1,38 @@
+/*
+ * Flash setup for Cirrus edb93xx boards
+ *
+ * Copyright (C) 2009 Matthias Kaehlcke <[email protected]>
+ *
+ * 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 <common.h>
+#include <mach/ep93xx-regs.h>
+#include <asm/io.h>
+
+#define SMC_BCR6_VALUE	(2 << SMC_BCR_IDCY_SHIFT | 5 << SMC_BCR_WST1_SHIFT | \
+				SMC_BCR_BLE | 2 << SMC_BCR_WST2_SHIFT | \
+				1 << SMC_BCR_MW_SHIFT)
+
+void flash_cfg(void)
+{
+	struct smc_regs *smc = (struct smc_regs *)SMC_BASE;
+
+	writel(SMC_BCR6_VALUE, &smc->bcr6);
+}
board/edb93xx/pll_cfg.c new file +58 -0

58 lines not on this page · raw message

board/edb93xx/pll_cfg.h new file +72 -0

72 lines not on this page · raw message

board/edb93xx/sdram_cfg.c new file +127 -0

127 lines not on this page · raw message

board/edb93xx/sdram_cfg.h new file +144 -0

144 lines not on this page · raw message

Signature · 7 lines
1.6.3.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox