Re: [U-Boot] [PATCH v2 6/6] overo: add SPL support / CONFIG_SYS_TEXT_BASE changed to 0x80100000

2012-01-03 Thread Tom Rini
On Thu, Dec 22, 2011 at 3:49 AM, Andreas Müller schnitzelt...@gmx.de wrote:
 * implementation based on ti beagleboard/omap3evm
 * timing data and i2c workaround for revision 0 boards taken from x-loader
 * run-tested with overo revision 0 and 1 / boot from NAND and SDcard

 Signed-off-by: Andreas Müller schnitzelt...@gmx.de

Two big changes requested:
1) Please move the 'Texas Instruments' part of the
preloader_console_init print to the default weak omap_rev_parse and
then just provide an Overo version of the function.
2) Please see http://patchwork.ozlabs.org/patch/131431/ for how to
configure SPL (and CONFIG_SYS_TEXT_BASE) so that SPL or x-loader can
be used as the first stage.  Since we're punting on some of the early
revs of the boards (if I follow your emails right) this is important.

Thanks!

-- 
Tom
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 6/6] overo: add SPL support / CONFIG_SYS_TEXT_BASE changed to 0x80100000

2011-12-22 Thread Andreas Müller
* implementation based on ti beagleboard/omap3evm
* timing data and i2c workaround for revision 0 boards taken from x-loader
* run-tested with overo revision 0 and 1 / boot from NAND and SDcard

Signed-off-by: Andreas Müller schnitzelt...@gmx.de
---
 arch/arm/cpu/armv7/omap-common/spl.c  |4 ++
 arch/arm/include/asm/arch-omap3/mem.h |   26 +++
 board/overo/config.mk |   28 -
 board/overo/overo.c   |   55 -
 board/overo/overo.h   |5 +++
 include/configs/omap3_overo.h |   53 +++
 6 files changed, 142 insertions(+), 29 deletions(-)
 delete mode 100644 board/overo/config.mk

diff --git a/arch/arm/cpu/armv7/omap-common/spl.c 
b/arch/arm/cpu/armv7/omap-common/spl.c
index 74fea4f..1220eb5 100644
--- a/arch/arm/cpu/armv7/omap-common/spl.c
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
@@ -170,10 +170,13 @@ void preloader_console_init(void)
 
printf(\nU-Boot SPL %s (%s - %s)\n, u_boot_rev, U_BOOT_DATE,
U_BOOT_TIME);
+#if !defined(CONFIG_OMAP3_OVERO)
omap_rev_string(rev_string_buffer);
printf(Texas Instruments %s\n, rev_string_buffer);
+#endif
 }
 
+#if !defined(CONFIG_OMAP3_OVERO)
 void __omap_rev_string(char *str)
 {
sprintf(str, Revision detection unimplemented);
@@ -181,3 +184,4 @@ void __omap_rev_string(char *str)
 
 void omap_rev_string(char *str)
__attribute__((weak, alias(__omap_rev_string)));
+#endif
diff --git a/arch/arm/include/asm/arch-omap3/mem.h 
b/arch/arm/include/asm/arch-omap3/mem.h
index 5fd02d4..4ca929e 100644
--- a/arch/arm/include/asm/arch-omap3/mem.h
+++ b/arch/arm/include/asm/arch-omap3/mem.h
@@ -123,6 +123,32 @@ enum {
V_MCFG_BANKALLOCATION_RBC | \
V_MCFG_B32NOT16_32 | V_MCFG_DEEPPD_EN | V_MCFG_RAMTYPE_DDR
 
+/* Hynix part of Overo (165MHz optimized) 6.06ns */
+#define HYNIX_TDAL_165   6
+#define HYNIX_TDPL_165   3
+#define HYNIX_TRRD_165   2
+#define HYNIX_TRCD_165   3
+#define HYNIX_TRP_1653
+#define HYNIX_TRAS_165   7
+#define HYNIX_TRC_165   10
+#define HYNIX_TRFC_165  21
+#define HYNIX_V_ACTIMA_165 \
+   ACTIM_CTRLA(HYNIX_TRFC_165, HYNIX_TRC_165,  \
+   HYNIX_TRAS_165, HYNIX_TRP_165,  \
+   HYNIX_TRCD_165, HYNIX_TRRD_165, \
+   HYNIX_TDPL_165, HYNIX_TDAL_165)
+
+#define HYNIX_TWTR_165   1
+#define HYNIX_TCKE_165   1
+#define HYNIX_TXP_1652
+#define HYNIX_XSR_16524
+#define HYNIX_V_ACTIMB_165 \
+   ACTIM_CTRLB(HYNIX_TWTR_165, HYNIX_TCKE_165, \
+   HYNIX_TXP_165, HYNIX_XSR_165)
+
+#define HYNIX_RASWIDTH_165 0x2
+#define HYNIX_V_MCFG_165(size) MCFG((size), HYNIX_RASWIDTH_165)
+
 /* Hynix part of AM/DM37xEVM (200MHz optimized) */
 #define HYNIX_TDAL_200 6
 #define HYNIX_TDPL_200 3
diff --git a/board/overo/config.mk b/board/overo/config.mk
deleted file mode 100644
index e7c471c..000
--- a/board/overo/config.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Overo uses OMAP3 (ARM-CortexA8) cpu
-#
-# 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
-#
-# Physical Address:
-# 8000' (bank0)
-# A000/ (bank1)
-# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
-# (mem base + reserved)
-
-CONFIG_SYS_TEXT_BASE = 0x80008000
diff --git a/board/overo/overo.c b/board/overo/overo.c
index 4a20c7f..5583f98 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -31,6 +31,7 @@
 #include common.h
 #include netdev.h
 #include twl4030.h
+#include linux/mtd/nand.h
 #include asm/io.h
 #include asm/arch/mmc_host_def.h
 #include asm/arch/mux.h
@@ -107,6 +108,20 @@ int get_board_revision(void)
 {
int revision;
 
+#ifdef CONFIG_DRIVER_OMAP34XX_I2C
+   unsigned char data;
+
+   /* board revisions = R2410 connect 4030 irq_1 to gpio112 */
+   /* these boards should return a revision number of 0  */
+   /* the code below forces a 4030 RTC irq to ensure that gpio112 is low */
+   i2c_set_bus_num(TWL4030_I2C_BUS);
+   data = 0x01;
+   i2c_write(0x4B, 0x29, 1, data, 1);
+   data =