Merge pull request #252 from lrusak/odroid-precursors

opengl-meson and u-boot changes
This commit is contained in:
Christian Hewitt 2016-05-02 11:13:59 +04:00
commit 15d32f0194
34 changed files with 94 additions and 8642 deletions

View File

@ -0,0 +1,83 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
#
# OpenELEC 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.
#
# OpenELEC 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 OpenELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="opengl-meson"
PKG_REV="1"
PKG_ARCH="arm"
PKG_LICENSE="nonfree"
PKG_SITE="http://openlinux.amlogic.com:8000/download/ARM/filesystem/"
case $MESON_FAMILY in
8)
PKG_VERSION="8-r5p1-01rel0-armhf"
;;
6)
PKG_VERSION="6-r5p1-01rel0-armhf"
;;
esac
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_TARGET="toolchain"
PKG_PRIORITY="optional"
PKG_SECTION="graphics"
PKG_SHORTDESC="opengl-meson: OpenGL ES pre-compiled libraries for Mali GPUs found in Amlogic Meson SoCs"
PKG_LONGDESC="opengl-meson: OpenGL ES pre-compiled libraries for Mali GPUs found in Amlogic Meson SoCs. The libraries could be found in a Linux buildroot released by Amlogic at http://openlinux.amlogic.com:8000/download/ARM/filesystem/. See the opengl package."
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
make_target() {
: # nothing todo
}
makeinstall_target() {
mkdir -p $SYSROOT_PREFIX/usr/include
cp -PR usr/include/* $SYSROOT_PREFIX/usr/include
mkdir -p $SYSROOT_PREFIX/usr/lib
cp -PR usr/lib/libMali.so $SYSROOT_PREFIX/usr/lib
ln -sf libMali.so $SYSROOT_PREFIX/usr/lib/libEGL.so.1.4
ln -sf libEGL.so.1.4 $SYSROOT_PREFIX/usr/lib/libEGL.so.1
ln -sf libEGL.so.1 $SYSROOT_PREFIX/usr/lib/libEGL.so
ln -sf libMali.so $SYSROOT_PREFIX/usr/lib/libGLESv1_CM.so.1.1
ln -sf libGLESv1_CM.so.1.1 $SYSROOT_PREFIX/usr/lib/libGLESv1_CM.so.1
ln -sf libGLESv1_CM.so.1 $SYSROOT_PREFIX/usr/lib/libGLESv1_CM.so
ln -sf libMali.so $SYSROOT_PREFIX/usr/lib/libGLESv2.so.2.0
ln -sf libGLESv2.so.2.0 $SYSROOT_PREFIX/usr/lib/libGLESv2.so.2
ln -sf libGLESv2.so.2 $SYSROOT_PREFIX/usr/lib/libGLESv2.so
mkdir -p $INSTALL/usr/lib
cp -PR usr/lib/libMali.so $INSTALL/usr/lib
ln -sf libMali.so $INSTALL/usr/lib/libEGL.so.1.4
ln -sf libEGL.so.1.4 $INSTALL/usr/lib/libEGL.so.1
ln -sf libEGL.so.1 $INSTALL/usr/lib/libEGL.so
ln -sf libMali.so $INSTALL/usr/lib/libGLESv1_CM.so.1.1
ln -sf libGLESv1_CM.so.1.1 $INSTALL/usr/lib/libGLESv1_CM.so.1
ln -sf libGLESv1_CM.so.1 $INSTALL/usr/lib/libGLESv1_CM.so
ln -sf libMali.so $INSTALL/usr/lib/libGLESv2.so.2.0
ln -sf libGLESv2.so.2.0 $INSTALL/usr/lib/libGLESv2.so.2
ln -sf libGLESv2.so.2 $INSTALL/usr/lib/libGLESv2.so
}
post_install() {
enable_service unbind-console.service
}

View File

@ -1,52 +0,0 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2014 Alex Deryskyba (alex@codesnake.com)
#
# OpenELEC 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.
#
# OpenELEC 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 OpenELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="opengl-meson6"
PKG_VERSION="r5p1-01rel0-armhf"
PKG_REV="1"
PKG_ARCH="arm"
PKG_LICENSE="nonfree"
PKG_SITE="http://openlinux.amlogic.com:8000/download/ARM/filesystem/"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_TARGET="toolchain"
PKG_PRIORITY="optional"
PKG_SECTION="graphics"
PKG_SHORTDESC="opengl-meson6: OpenGL ES pre-compiled libraries for Mali 400 GPUs found in Amlogic Meson6 SoCs"
PKG_LONGDESC="opengl-meson6: OpenGL ES pre-compiled libraries for Mali 400 GPUs found in Amlogic Meson6 SoCs. The libraries could be found in a Linux buildroot released by Amlogic at http://openlinux.amlogic.com:8000/download/ARM/filesystem/. See the opengl package."
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
make_target() {
: # nothing todo
}
makeinstall_target() {
mkdir -p $SYSROOT_PREFIX/usr/include
cp -PR usr/include/* $SYSROOT_PREFIX/usr/include
mkdir -p $SYSROOT_PREFIX/usr/lib
cp -PR usr/lib/*.so* $SYSROOT_PREFIX/usr/lib
mkdir -p $INSTALL/usr/lib
cp -PR usr/lib/*.so* $INSTALL/usr/lib
}
post_install() {
enable_service unbind-console.service
}

View File

@ -1,52 +0,0 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
#
# OpenELEC 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.
#
# OpenELEC 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 OpenELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="opengl-meson8"
PKG_VERSION="r5p1-01rel0-armhf"
PKG_REV="1"
PKG_ARCH="arm"
PKG_LICENSE="nonfree"
PKG_SITE="http://openlinux.amlogic.com:8000/download/ARM/filesystem/"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_TARGET="toolchain"
PKG_PRIORITY="optional"
PKG_SECTION="graphics"
PKG_SHORTDESC="opengl-meson8: OpenGL ES pre-compiled libraries for Mali 450 GPUs found in Amlogic Meson8 SoCs"
PKG_LONGDESC="opengl-meson8: OpenGL ES pre-compiled libraries for Mali 450 GPUs found in Amlogic Meson8 SoCs. The libraries could be found in a Linux buildroot released by Amlogic at http://openlinux.amlogic.com:8000/download/ARM/filesystem/. See the opengl package."
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
make_target() {
: # nothing todo
}
makeinstall_target() {
mkdir -p $SYSROOT_PREFIX/usr/include
cp -PR usr/include/* $SYSROOT_PREFIX/usr/include
mkdir -p $SYSROOT_PREFIX/usr/lib
cp -PR usr/lib/*.so* $SYSROOT_PREFIX/usr/lib
mkdir -p $INSTALL/usr/lib
cp -PR usr/lib/*.so* $INSTALL/usr/lib
}
post_install() {
enable_service unbind-console.service
}

View File

@ -1,11 +0,0 @@
[Unit]
Description=Unbind framebuffer console
ConditionPathExists=/sys/class/vtconsole/vtcon1/bind
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo 0 > /sys/class/vtconsole/vtcon1/bind'
[Install]
WantedBy=graphical.target

View File

@ -17,11 +17,7 @@
################################################################################
PKG_NAME="u-boot"
if [ "$UBOOT_VERSION" = "default" ]; then
PKG_VERSION="2011.03-rc1"
PKG_SITE="http://www.denx.de/wiki/U-Boot/WebHome"
PKG_URL="ftp://ftp.denx.de/pub/u-boot/$PKG_NAME-$PKG_VERSION.tar.bz2"
elif [ "$UBOOT_VERSION" = "imx6-cuboxi" ]; then
if [ "$UBOOT_VERSION" = "imx6-cuboxi" ]; then
PKG_VERSION="imx6-408544d"
PKG_SITE="http://imx.solid-run.com/wiki/index.php?title=Building_the_kernel_and_u-boot_for_the_CuBox-i_and_the_HummingBoard"
# https://github.com/SolidRun/u-boot-imx6.git

View File

@ -1,4 +0,0 @@
u-boot: add MMC SPL for OMAP4 patches by Aneesh V
http://groups.google.com/group/x-loader/browse_frm/thread/ffa060e158ae220e
http://dev.omapzoom.org/?p=bootloader/u-boot.git;a=shortlog;h=refs/heads/omap_upstream_next

View File

@ -1,380 +0,0 @@
From b295d8676ccb5b01d4ea7ba75ec6321a3c8837b7 Mon Sep 17 00:00:00 2001
From: John Rigby <john.rigby@linaro.org>
Date: Thu, 17 Feb 2011 19:43:43 +0530
Subject: [PATCH 01/22] mkimage: Add OMAP boot image support
Signed-off-by: John Rigby <john.rigby@linaro.org>
---
common/image.c | 1 +
include/image.h | 1 +
tools/Makefile | 2 +
tools/mkimage.c | 2 +
tools/mkimage.h | 1 +
tools/omapimage.c | 229 +++++++++++++++++++++++++++++++++++++++++++++++++++++
tools/omapimage.h | 50 ++++++++++++
7 files changed, 286 insertions(+), 0 deletions(-)
create mode 100644 tools/omapimage.c
create mode 100644 tools/omapimage.h
diff --git a/common/image.c b/common/image.c
index f63a2ff..4198d76 100644
--- a/common/image.c
+++ b/common/image.c
@@ -141,6 +141,7 @@ static const table_entry_t uimage_type[] = {
{ IH_TYPE_FLATDT, "flat_dt", "Flat Device Tree", },
{ IH_TYPE_KWBIMAGE, "kwbimage", "Kirkwood Boot Image",},
{ IH_TYPE_IMXIMAGE, "imximage", "Freescale i.MX Boot Image",},
+ { IH_TYPE_OMAPIMAGE, "omapimage", "TI OMAP CH/GP Boot Image",},
{ -1, "", "", },
};
diff --git a/include/image.h b/include/image.h
index 005e0d2..f74e2b9 100644
--- a/include/image.h
+++ b/include/image.h
@@ -157,6 +157,7 @@
#define IH_TYPE_FLATDT 8 /* Binary Flat Device Tree Blob */
#define IH_TYPE_KWBIMAGE 9 /* Kirkwood Boot Image */
#define IH_TYPE_IMXIMAGE 10 /* Freescale IMXBoot Image */
+#define IH_TYPE_OMAPIMAGE 11 /* TI OMAP Config Header Image */
/*
* Compression Types
diff --git a/tools/Makefile b/tools/Makefile
index 623f908..a1c4ed7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -84,6 +84,7 @@ OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o
OBJ_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes.o
NOPED_OBJ_FILES-y += kwbimage.o
NOPED_OBJ_FILES-y += imximage.o
+NOPED_OBJ_FILES-y += omapimage.o
NOPED_OBJ_FILES-y += mkimage.o
OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o
NOPED_OBJ_FILES-y += os_support.o
@@ -180,6 +181,7 @@ $(obj)mkimage$(SFX): $(obj)crc32.o \
$(obj)fit_image.o \
$(obj)image.o \
$(obj)imximage.o \
+ $(obj)omapimage.o \
$(obj)kwbimage.o \
$(obj)md5.o \
$(obj)mkimage.o \
diff --git a/tools/mkimage.c b/tools/mkimage.c
index f5859d7..ec6d75e 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -155,6 +155,8 @@ main (int argc, char **argv)
init_imx_image_type ();
/* Init FIT image generation/list support */
init_fit_image_type ();
+ /* Init TI OMAP Boot image generation/list support */
+ init_omap_image_type();
/* Init Default image generation/list support */
init_default_image_type ();
diff --git a/tools/mkimage.h b/tools/mkimage.h
index 9033a7d..3b49645 100644
--- a/tools/mkimage.h
+++ b/tools/mkimage.h
@@ -143,5 +143,6 @@ void init_kwb_image_type (void);
void init_imx_image_type (void);
void init_default_image_type (void);
void init_fit_image_type (void);
+void init_omap_image_type(void);
#endif /* _MKIIMAGE_H_ */
diff --git a/tools/omapimage.c b/tools/omapimage.c
new file mode 100644
index 0000000..67fa056
--- /dev/null
+++ b/tools/omapimage.c
@@ -0,0 +1,229 @@
+/*
+ * (C) Copyright 2010
+ * Linaro LTD, www.linaro.org
+ * Author: John Rigby <john.rigby@linaro.org>
+ * Based on TI's signGP.c
+ *
+ * (C) Copyright 2009
+ * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ *
+ * (C) Copyright 2008
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
+ *
+ * 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
+ */
+
+/* Required to obtain the getline prototype from stdio.h */
+#define _GNU_SOURCE
+
+#include "mkimage.h"
+#include <image.h>
+#include "omapimage.h"
+
+/* Header size is CH header rounded up to 512 bytes plus GP header */
+#define OMAP_CH_HDR_SIZE 512
+#define OMAP_GP_HDR_SIZE (sizeof(struct gp_header))
+#define OMAP_FILE_HDR_SIZE (OMAP_CH_HDR_SIZE+OMAP_GP_HDR_SIZE)
+
+static uint8_t omapimage_header[OMAP_FILE_HDR_SIZE];
+
+static int omapimage_check_image_types(uint8_t type)
+{
+ if (type == IH_TYPE_OMAPIMAGE)
+ return EXIT_SUCCESS;
+ else
+ return EXIT_FAILURE;
+}
+
+/*
+ * Only the simplest image type is currently supported:
+ * TOC pointing to CHSETTINGS
+ * TOC terminator
+ * CHSETTINGS
+ *
+ * padding to OMAP_CH_HDR_SIZE bytes
+ *
+ * gp header
+ * size
+ * load_addr
+ */
+static int valid_gph_size(uint32_t size)
+{
+ return size;
+}
+
+static int valid_gph_load_addr(uint32_t load_addr)
+{
+ return load_addr;
+}
+
+static int omapimage_verify_header(unsigned char *ptr, int image_size,
+ struct mkimage_params *params)
+{
+ struct ch_toc *toc = (struct ch_toc *)ptr;
+ struct gp_header *gph = (struct gp_header *)(ptr+OMAP_CH_HDR_SIZE);
+ uint32_t offset, size;
+
+ while (toc->section_offset != 0xffffffff
+ && toc->section_size != 0xffffffff) {
+ offset = toc->section_offset;
+ size = toc->section_size;
+ if (!offset || !size)
+ return -1;
+ if (offset >= OMAP_CH_HDR_SIZE ||
+ offset+size >= OMAP_CH_HDR_SIZE)
+ return -1;
+ toc++;
+ }
+ if (!valid_gph_size(gph->size))
+ return -1;
+ if (!valid_gph_load_addr(gph->load_addr))
+ return -1;
+
+ return 0;
+}
+
+static void omapimage_print_section(struct ch_settings *chs)
+{
+ switch (chs->section_key) {
+ case KEY_CHSETTINGS:
+ printf("CHSETTINGS (%x) "
+ "valid:%x "
+ "version:%x "
+ "reserved:%x "
+ "flags:%x\n",
+ chs->section_key,
+ chs->valid,
+ chs->version,
+ chs->reserved,
+ chs->flags);
+ break;
+ default:
+ printf("UNKNOWNKEY (%x) "
+ "valid:%x "
+ "version:%x "
+ "reserved:%x "
+ "flags:%x\n",
+ chs->section_key,
+ chs->valid,
+ chs->version,
+ chs->reserved,
+ chs->flags);
+ break;
+ }
+}
+
+static void omapimage_print_header(const void *ptr)
+{
+ struct ch_toc *toc = (struct ch_toc *)ptr;
+ struct gp_header *gph = (struct gp_header *)(ptr+OMAP_CH_HDR_SIZE);
+ uint32_t offset, size;
+
+ while (toc->section_offset != 0xffffffff
+ && toc->section_size != 0xffffffff) {
+ offset = toc->section_offset;
+ size = toc->section_size;
+
+ if (offset >= OMAP_CH_HDR_SIZE ||
+ offset+size >= OMAP_CH_HDR_SIZE)
+ exit(EXIT_FAILURE);
+
+ printf("Section %s offset %x length %x\n",
+ toc->section_name,
+ toc->section_offset,
+ toc->section_size);
+
+ omapimage_print_section((struct ch_settings *)(ptr+offset));
+ toc++;
+ }
+
+ if (!valid_gph_size(gph->size)) {
+ fprintf(stderr,
+ "Error: invalid image size %x\n",
+ gph->size);
+ exit(EXIT_FAILURE);
+ }
+
+ if (!valid_gph_load_addr(gph->load_addr)) {
+ fprintf(stderr,
+ "Error: invalid image load address %x\n",
+ gph->size);
+ exit(EXIT_FAILURE);
+ }
+
+ printf("GP Header: Size %x LoadAddr %x\n",
+ gph->size, gph->load_addr);
+}
+
+static int toc_offset(void *hdr, void *member)
+{
+ return member - hdr;
+}
+
+static void omapimage_set_header(void *ptr, struct stat *sbuf, int ifd,
+ struct mkimage_params *params)
+{
+ struct ch_toc *toc = (struct ch_toc *)ptr;
+ struct ch_settings *chs = (struct ch_settings *)
+ (ptr + 2 * sizeof(*toc));
+ struct gp_header *gph = (struct gp_header *)(ptr + OMAP_CH_HDR_SIZE);
+
+ toc->section_offset = toc_offset(ptr, chs);
+ toc->section_size = sizeof(struct ch_settings);
+ strcpy((char *)toc->section_name, "CHSETTINGS");
+
+ chs->section_key = KEY_CHSETTINGS;
+ chs->valid = 0;
+ chs->version = 1;
+ chs->reserved = 0;
+ chs->flags = 0;
+
+ toc++;
+ memset(toc, 0xff, sizeof(*toc));
+
+ gph->size = sbuf->st_size - OMAP_FILE_HDR_SIZE;
+ gph->load_addr = params->addr;
+}
+
+int omapimage_check_params(struct mkimage_params *params)
+{
+ return (params->dflag && (params->fflag || params->lflag)) ||
+ (params->fflag && (params->dflag || params->lflag)) ||
+ (params->lflag && (params->dflag || params->fflag));
+}
+
+/*
+ * omapimage parameters
+ */
+static struct image_type_params omapimage_params = {
+ .name = "TI OMAP CH/GP Boot Image support",
+ .header_size = OMAP_FILE_HDR_SIZE,
+ .hdr = (void *)&omapimage_header,
+ .check_image_type = omapimage_check_image_types,
+ .verify_header = omapimage_verify_header,
+ .print_header = omapimage_print_header,
+ .set_header = omapimage_set_header,
+ .check_params = omapimage_check_params,
+};
+
+void init_omap_image_type(void)
+{
+ mkimage_register(&omapimage_params);
+}
diff --git a/tools/omapimage.h b/tools/omapimage.h
new file mode 100644
index 0000000..7ff5404
--- /dev/null
+++ b/tools/omapimage.h
@@ -0,0 +1,50 @@
+/*
+ * (C) Copyright 2010
+ * Linaro LTD, www.linaro.org
+ * Author John Rigby <john.rigby@linaro.org>
+ * Based on TI's signGP.c
+ *
+ * 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
+ */
+
+#ifndef _OMAPIMAGE_H_
+#define _OMAPIMAGE_H_
+
+struct ch_toc {
+ uint32_t section_offset;
+ uint32_t section_size;
+ uint8_t unused[12];
+ uint8_t section_name[12];
+} __attribute__ ((__packed__));
+
+struct ch_settings {
+ uint32_t section_key;
+ uint8_t valid;
+ uint8_t version;
+ uint16_t reserved;
+ uint32_t flags;
+} __attribute__ ((__packed__));
+
+struct gp_header {
+ uint32_t size;
+ uint32_t load_addr;
+} __attribute__ ((__packed__));
+
+#define KEY_CHSETTINGS 0xC0C0C0C1
+#endif /* _OMAPIMAGE_H_ */
--
1.7.2.3

View File

@ -1,71 +0,0 @@
From d8a745be3a5d821ac9ab06a0899163681767941b Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Wed, 16 Feb 2011 23:45:35 +0530
Subject: [PATCH 02/22] omap: add miscellaneous utility macros for bit-field operations
Signed-off-by: Aneesh V <aneesh@ti.com>
---
arch/arm/include/asm/omap_common.h | 51 ++++++++++++++++++++++++++++++++++++
1 files changed, 51 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/include/asm/omap_common.h
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
new file mode 100644
index 0000000..03db2f5
--- /dev/null
+++ b/arch/arm/include/asm/omap_common.h
@@ -0,0 +1,51 @@
+/*
+ * (C) Copyright 2010
+ * Texas Instruments, <www.ti.com>
+ *
+ * Aneesh V <aneesh@ti.com>
+ *
+ * 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
+ */
+#ifndef _OMAP_COMMON_H_
+#define _OMAP_COMMON_H_
+
+/* extract a bit field from a bit vector */
+#define get_bit_field(nr, start, mask)\
+ (((nr) & (mask)) >> (start))
+
+/* Set a field in a bit vector */
+#define set_bit_field(nr, start, mask, val)\
+ do { \
+ (nr) = ((nr) & ~(mask)) | (((val) << (start)) & (mask));\
+ } while (0);
+
+/*
+ * Utility macro for read-modify-write of a hardware register
+ * addr - address of the register
+ * shift - starting bit position of the field to be modified
+ * msk - mask for the field
+ * val - value to be shifted masked and written to the field
+ */
+#define modify_reg_32(addr, shift, msk, val) \
+ do {\
+ writel(((readl(addr) & ~(msk))|(((val) << (shift)) & (msk))),\
+ (addr));\
+ } while (0);
+
+#endif /* _OMAP_COMMON_H_ */
--
1.7.2.3

View File

@ -1,137 +0,0 @@
From 3130b153ed6d6d1e486973a5d782e0480db748d6 Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Wed, 16 Feb 2011 23:51:21 +0530
Subject: [PATCH 03/22] omap4: add OMAP4430 revision check
Signed-off-by: Aneesh V <aneesh@ti.com>
---
arch/arm/cpu/armv7/omap4/board.c | 35 +++++++++++++++++++++++++++++++
arch/arm/include/asm/arch-omap4/omap4.h | 17 +++++++++-----
arch/arm/include/asm/armv7.h | 31 +++++++++++++++++++++++++++
3 files changed, 77 insertions(+), 6 deletions(-)
create mode 100644 arch/arm/include/asm/armv7.h
diff --git a/arch/arm/cpu/armv7/omap4/board.c b/arch/arm/cpu/armv7/omap4/board.c
index fcd29a7..7583a0d 100644
--- a/arch/arm/cpu/armv7/omap4/board.c
+++ b/arch/arm/cpu/armv7/omap4/board.c
@@ -28,6 +28,7 @@
* MA 02111-1307 USA
*/
#include <common.h>
+#include <asm/armv7.h>
#include <asm/arch/cpu.h>
#include <asm/arch/sys_proto.h>
#include <asm/sizes.h>
@@ -127,3 +128,37 @@ int arch_cpu_init(void)
set_muxconf_regs();
return 0;
}
+
+static u32 cortex_a9_rev(void)
+{
+
+ unsigned int rev;
+
+ /* Read Main ID Register (MIDR) */
+ asm ("mrc p15, 0, %0, c0, c0, 0" : "=r" (rev));
+
+ return rev;
+}
+
+u32 omap4_revision(void)
+{
+ if (readl(CONTROL_ID_CODE) == OMAP4_CONTROL_ID_CODE_ES2_1)
+ return OMAP4430_ES2_1;
+ else if (readl(CONTROL_ID_CODE) == OMAP4_CONTROL_ID_CODE_ES2_2)
+ return OMAP4430_ES2_2;
+ /*
+ * For some of the ES2/ES1 boards ID_CODE is not reliable:
+ * Also, ES1 and ES2 have different ARM revisions
+ * So use ARM revision for identification
+ */
+ unsigned int rev = cortex_a9_rev();
+
+ switch (rev) {
+ case MIDR_CORTEX_A9_R0P1:
+ return OMAP4430_ES1_0;
+ case MIDR_CORTEX_A9_R1P2:
+ return OMAP4430_ES2_0;
+ default:
+ return OMAP4430_SILICON_ID_INVALID;
+ }
+}
diff --git a/arch/arm/include/asm/arch-omap4/omap4.h b/arch/arm/include/asm/arch-omap4/omap4.h
index a30bb33..1f88732 100644
--- a/arch/arm/include/asm/arch-omap4/omap4.h
+++ b/arch/arm/include/asm/arch-omap4/omap4.h
@@ -51,6 +51,11 @@
#define CONTROL_PADCONF_CORE (OMAP44XX_L4_CORE_BASE + 0x100000)
#define CONTROL_PADCONF_WKUP (OMAP44XX_L4_CORE_BASE + 0x31E000)
+/* CONTROL_ID_CODE */
+#define CONTROL_ID_CODE (CTRL_BASE + 0x204)
+
+#define OMAP4_CONTROL_ID_CODE_ES2_1 0x3B95C02F
+#define OMAP4_CONTROL_ID_CODE_ES2_2 0x4B95C02F
/* UART */
#define UART1_BASE (OMAP44XX_L4_PER_BASE + 0x6a000)
#define UART2_BASE (OMAP44XX_L4_PER_BASE + 0x6c000)
@@ -121,11 +126,11 @@ struct s32ktimer {
/* Temporary SRAM stack used while low level init is done */
#define LOW_LEVEL_SRAM_STACK NON_SECURE_SRAM_END
-/*
- * OMAP4 real hardware:
- * TODO: Change this to the IDCODE in the hw regsiter
- */
-#define CPU_OMAP4430_ES10 1
-#define CPU_OMAP4430_ES20 2
+/* Silicon revisions */
+#define OMAP4430_SILICON_ID_INVALID 0
+#define OMAP4430_ES1_0 1
+#define OMAP4430_ES2_0 2
+#define OMAP4430_ES2_1 3
+#define OMAP4430_ES2_2 4
#endif
diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h
new file mode 100644
index 0000000..6c24a80
--- /dev/null
+++ b/arch/arm/include/asm/armv7.h
@@ -0,0 +1,31 @@
+/*
+ * (C) Copyright 2010
+ * Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Aneesh V <aneesh@ti.com>
+ *
+ * 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
+ */
+#ifndef ARMV7_H
+#define ARMV7_H
+
+#define MIDR_CORTEX_A9_R0P1 0x410FC091
+#define MIDR_CORTEX_A9_R1P2 0x411FC092
+
+#endif /* ARMV7_H */
--
1.7.2.3

View File

@ -1,51 +0,0 @@
From 19eb02e3bb2e569b7269019eb0e116220daac23f Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Thu, 17 Feb 2011 16:49:05 +0530
Subject: [PATCH 04/22] armv7: start.S: provide a hook for saving boot params
Provide a means by which u-boot/SPL can save parameters passed
to it by ROM code or the pre-loader.
A new function 'save_boot_params' has been defined and a default
implentation provided. Please note that we do not have a stack yet.
So, any implementation of this function should not use stack.
Signed-off-by: Aneesh V <aneesh@ti.com>
---
arch/arm/cpu/armv7/cpu.c | 7 +++++++
arch/arm/cpu/armv7/start.S | 1 +
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c
index a01e0d6..54533fc 100644
--- a/arch/arm/cpu/armv7/cpu.c
+++ b/arch/arm/cpu/armv7/cpu.c
@@ -41,6 +41,13 @@
static void cache_flush(void);
+void save_boot_params_default(u32 r0, u32 r1, u32 r2, u32 r3)
+{
+}
+
+void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3)
+ __attribute__((weak, alias("save_boot_params_default")));
+
int cleanup_before_linux(void)
{
unsigned int i;
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index cb4f92f..3618190 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -103,6 +103,7 @@ IRQ_STACK_START_IN:
*/
reset:
+ bl save_boot_params
/*
* set the cpu to SVC32 mode
*/
--
1.7.2.3

View File

@ -1,151 +0,0 @@
From de5b300f43e95b8b73252147a3ea492a8647d27d Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Sun, 27 Feb 2011 19:25:16 +0530
Subject: [PATCH 05/22] omap4: save parameters passed by ROM code to SPL
Save boot device information passed by OMAP4 rom code
ROM code in OMAP4 passes information such as the media from
which it picked up the first boot image(SPL in our case),
the mode(raw mode/FAT mode) etc.
Save this information in SPL so that we can use the same media
and mode to bootload u-boot.
Signed-off-by: Aneesh V <aneesh@ti.com>
---
arch/arm/cpu/armv7/omap4/board.c | 14 ++++++++++++
arch/arm/cpu/armv7/omap4/lowlevel_init.S | 31 +++++++++++++++++++++++++++
arch/arm/include/asm/arch-omap4/omap4.h | 8 +++++++
arch/arm/include/asm/arch-omap4/sys_proto.h | 1 +
arch/arm/include/asm/omap_common.h | 20 +++++++++++++++++
5 files changed, 74 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap4/board.c b/arch/arm/cpu/armv7/omap4/board.c
index 7583a0d..a5d585b 100644
--- a/arch/arm/cpu/armv7/omap4/board.c
+++ b/arch/arm/cpu/armv7/omap4/board.c
@@ -35,6 +35,20 @@
DECLARE_GLOBAL_DATA_PTR;
+#ifdef CONFIG_PRELOADER
+u32 omap4_boot_device = BOOT_DEVICE_MMC1;
+u32 omap4_boot_mode = MMCSD_MODE_FAT;
+u32 omap_boot_device(void)
+{
+ return omap4_boot_device;
+}
+
+u32 omap_boot_mode(void)
+{
+ return omap4_boot_mode;
+}
+#endif
+
/*
* Routine: s_init
* Description: Does early system init of muxing and clocks.
diff --git a/arch/arm/cpu/armv7/omap4/lowlevel_init.S b/arch/arm/cpu/armv7/omap4/lowlevel_init.S
index 026dfa4..250c73d 100644
--- a/arch/arm/cpu/armv7/omap4/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap4/lowlevel_init.S
@@ -27,6 +27,37 @@
*/
#include <asm/arch/omap4.h>
+#ifdef CONFIG_PRELOADER
+.global save_boot_params
+save_boot_params:
+ /*
+ * See if the rom code passed pointer is valid:
+ * It is not valid if it is not in non-secure SRAM
+ * This may happen if you are booting with the help of
+ * debugger
+ */
+ ldr r2, =NON_SECURE_SRAM_START
+ cmp r2, r0
+ bgt 1f
+ ldr r2, =NON_SECURE_SRAM_END
+ cmp r2, r0
+ blt 1f
+
+ /* Store the boot device in omap4_boot_device */
+ ldr r2, [r0, #BOOT_DEVICE_OFFSET] @ r1 <- value of boot device
+ and r2, #BOOT_DEVICE_MASK
+ ldr r3, =omap4_boot_device
+ str r2, [r3] @ omap4_boot_device <- r1
+
+ /* Store the boot mode (raw/FAT) in omap4_boot_mode */
+ ldr r2, [r0, #DEV_DESC_PTR_OFFSET] @ get the device descriptor ptr
+ ldr r2, [r2, #DEV_DATA_PTR_OFFSET] @ get the pDeviceData ptr
+ ldr r2, [r2, #BOOT_MODE_OFFSET] @ get the boot mode
+ ldr r3, =omap4_boot_mode
+ str r2, [r3]
+1:
+ bx lr
+#endif
.globl lowlevel_init
lowlevel_init:
diff --git a/arch/arm/include/asm/arch-omap4/omap4.h b/arch/arm/include/asm/arch-omap4/omap4.h
index 1f88732..740ca9d 100644
--- a/arch/arm/include/asm/arch-omap4/omap4.h
+++ b/arch/arm/include/asm/arch-omap4/omap4.h
@@ -133,4 +133,12 @@ struct s32ktimer {
#define OMAP4430_ES2_1 3
#define OMAP4430_ES2_2 4
+/* ROM code defines */
+/* Boot device */
+#define BOOT_DEVICE_MASK 0xFF
+#define BOOT_DEVICE_OFFSET 0x8
+#define DEV_DESC_PTR_OFFSET 0x4
+#define DEV_DATA_PTR_OFFSET 0x18
+#define BOOT_MODE_OFFSET 0x8
+
#endif
diff --git a/arch/arm/include/asm/arch-omap4/sys_proto.h b/arch/arm/include/asm/arch-omap4/sys_proto.h
index 4813e9e..ce86b36 100644
--- a/arch/arm/include/asm/arch-omap4/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap4/sys_proto.h
@@ -23,6 +23,7 @@
#include <asm/arch/omap4.h>
#include <asm/io.h>
+#include <asm/omap_common.h>
struct omap_sysinfo {
char *board_string;
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 03db2f5..06c511c 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -48,4 +48,24 @@
(addr));\
} while (0);
+/* Boot device */
+#define BOOT_DEVICE_NONE 0
+#define BOOT_DEVICE_XIP 1
+#define BOOT_DEVICE_XIPWAIT 2
+#define BOOT_DEVICE_NAND 3
+#define BOOT_DEVICE_ONE_NAND 4
+#define BOOT_DEVICE_MMC1 5
+#define BOOT_DEVICE_MMC2 6
+
+/* Boot type */
+#define MMCSD_MODE_UNDEFINED 0
+#define MMCSD_MODE_RAW 1
+#define MMCSD_MODE_FAT 2
+
+/* Magic number passed from SPL to U-Boot */
+#define OMAP_SPL_TO_UBOOT_MAGIC_NUMBER 0xDEADBEEF
+
+u32 omap_boot_device(void);
+u32 omap_boot_mode(void);
+
#endif /* _OMAP_COMMON_H_ */
--
1.7.2.3

View File

@ -1,72 +0,0 @@
From 230ff2d889e392b64ce3bc86541bb4591aeabad2 Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Thu, 17 Feb 2011 03:16:38 +0530
Subject: [PATCH 06/22] arm: new labels in the linker script file
_bss_start_ofs is used in start.S to indicate end of copied
image. This may not be correct when we have a discontiguous
memory map. For instance, .bss may be placed in SDRAM for
some SPLS while rest of the image is placed in SRAM.
Define a new label in linker script to indicate the end of the
image copied during relocation and use it appropriately in
start.S.
Also, add a new label to indicate the end of flash image.
This will be useful in identifying the size of flash image
Signed-off-by: Aneesh V <aneesh@ti.com>
---
arch/arm/cpu/armv7/start.S | 6 +++++-
arch/arm/cpu/armv7/u-boot.lds | 4 ++++
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 3618190..8215d26 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -77,6 +77,10 @@ _TEXT_BASE:
_bss_start_ofs:
.word __bss_start - _start
+.global _image_copy_end_ofs
+_image_copy_end_ofs:
+ .word __image_copy_end - _start
+
.globl _bss_end_ofs
_bss_end_ofs:
.word _end - _start
@@ -172,7 +176,7 @@ stack_setup:
beq clear_bss /* skip relocation */
#endif
mov r1, r6 /* r1 <- scratch for copy_loop */
- ldr r3, _bss_start_ofs
+ ldr r3, _image_copy_end_ofs
add r2, r0, r3 /* r2 <- source end address */
copy_loop:
diff --git a/arch/arm/cpu/armv7/u-boot.lds b/arch/arm/cpu/armv7/u-boot.lds
index 5725c30..c3ad587 100644
--- a/arch/arm/cpu/armv7/u-boot.lds
+++ b/arch/arm/cpu/armv7/u-boot.lds
@@ -55,6 +55,8 @@ SECTIONS
. = ALIGN(4);
+ __image_copy_end = .;
+
.rel.dyn : {
__rel_dyn_start = .;
*(.rel*)
@@ -66,6 +68,8 @@ SECTIONS
*(.dynsym)
}
+ __flash_image_end = .;
+
.bss __rel_dyn_start (OVERLAY) : {
__bss_start = .;
*(.bss)
--
1.7.2.3

View File

@ -1,91 +0,0 @@
From 9b4dfdc49a0e88f6a5292dbcb6c4260888258380 Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Thu, 17 Feb 2011 01:23:29 +0530
Subject: [PATCH 07/22] Add generic spl infrastructure
Define a new type of SPL that is not tied to any particular media.
- Create a top level directory 'spl' that has a structure similar
to the existing 'nand_spl'
- Make necessary changes to top-level Makefile to build such an spl
Rationale for this approach:
- There may be SPLs(like the OMAP x-loader) that support booting from
multiple media.
- Also, there is no harm in keeping SPLs specific to a particular media
also under this directory. In fact it makes sense to merge all the
different spl directories into this one.
Signed-off-by: Aneesh V <aneesh@ti.com>
---
Makefile | 11 +++++++++++
arch/arm/include/asm/global_data.h | 5 +++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index dc2e3d8..21e51c8 100644
--- a/Makefile
+++ b/Makefile
@@ -293,6 +293,11 @@ NAND_SPL = nand_spl
U_BOOT_NAND = $(obj)u-boot-nand.bin
endif
+ifeq ($(CONFIG_SPL),y)
+.PHONEY : SPL
+ALL += SPL
+endif
+
ifeq ($(CONFIG_ONENAND_U_BOOT),y)
ONENAND_IPL = onenand_ipl
U_BOOT_ONENAND = $(obj)u-boot-onenand.bin
@@ -402,6 +407,9 @@ $(LDSCRIPT): depend
$(obj)u-boot.lds: $(LDSCRIPT)
$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+SPL :$(TIMESTAMP_FILE) $(VERSION_FILE) depend tools
+ $(MAKE) -C spl/board/$(BOARDDIR) all
+
$(NAND_SPL): $(TIMESTAMP_FILE) $(VERSION_FILE) depend
$(MAKE) -C nand_spl/board/$(BOARDDIR) all
@@ -1138,6 +1146,7 @@ clean:
@rm -f $(obj)include/bmp_logo.h
@rm -f $(obj)lib/asm-offsets.s
@rm -f $(obj)nand_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,System.map}
+ @rm -f $(obj)spl/{u-boot-spl-generated.lds,u-boot-spl,u-boot-spl.map}
@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
@rm -f $(ONENAND_BIN)
@rm -f $(obj)onenand_ipl/u-boot.lds
@@ -1157,12 +1166,14 @@ clobber: clean
@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
@rm -f $(obj)u-boot.kwb
@rm -f $(obj)u-boot.imx
+ @rm -f $(obj)MLO
@rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
@rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
@rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
@rm -fr $(obj)include/generated
@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
@[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type l -print | xargs rm -f
+ @[ ! -d $(obj)spl ] || find $(obj)spl -name "*" -type l -print | xargs rm -f
ifeq ($(OBJTREE),$(SRCTREE))
mrproper \
diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h
index 2a84d27..2ce020e 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -89,6 +89,11 @@ typedef struct global_data {
#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define GD_FLG_ENV_READY 0x00080 /* Environment imported into hash table */
+#ifdef CONFIG_PRELOADER
+/* SPL works from internal RAM. gd pointer can be in .data section */
+#define DECLARE_GLOBAL_DATA_PTR extern gd_t *gd
+#else
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
+#endif
#endif /* __ASM_GBL_DATA_H */
--
1.7.2.3

View File

@ -1,110 +0,0 @@
From cd0fbadb46f30c0630519d7b3e4388dc5a5c7baf Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Thu, 17 Feb 2011 15:47:21 +0530
Subject: [PATCH 08/22] armv7: start.S: add SPL support
Changes for supporting SPL
Signed-off-by: Aneesh V <aneesh@ti.com>
---
arch/arm/cpu/armv7/start.S | 36 +++++++++++++++++++++++++-----------
1 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 8215d26..f5f08d9 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -42,7 +42,16 @@ _start: b reset
ldr pc, _not_used
ldr pc, _irq
ldr pc, _fiq
-
+#ifdef CONFIG_PRELOADER
+_undefined_instruction: .word _undefined_instruction
+_software_interrupt: .word _software_interrupt
+_prefetch_abort: .word _prefetch_abort
+_data_abort: .word _data_abort
+_not_used: .word _not_used
+_irq: .word _irq
+_fiq: .word _fiq
+_pad: .word 0x12345678 /* now 16*4=64 */
+#else
_undefined_instruction: .word undefined_instruction
_software_interrupt: .word software_interrupt
_prefetch_abort: .word prefetch_abort
@@ -51,6 +60,8 @@ _not_used: .word not_used
_irq: .word irq
_fiq: .word fiq
_pad: .word 0x12345678 /* now 16*4=64 */
+#endif /* CONFIG_PRELOADER */
+
.global _end_vect
_end_vect:
@@ -171,10 +182,9 @@ stack_setup:
mov sp, r4
adr r0, _start
-#ifndef CONFIG_PRELOADER
cmp r0, r6
+ moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
beq clear_bss /* skip relocation */
-#endif
mov r1, r6 /* r1 <- scratch for copy_loop */
ldr r3, _image_copy_end_ofs
add r2, r0, r3 /* r2 <- source end address */
@@ -224,6 +234,15 @@ fixnext:
add r2, r2, #8 /* each rel.dyn entry is 8 bytes */
cmp r2, r3
blo fixloop
+ b clear_bss
+_rel_dyn_start_ofs:
+ .word __rel_dyn_start - _start
+_rel_dyn_end_ofs:
+ .word __rel_dyn_end - _start
+_dynsym_start_ofs:
+ .word __dynsym_start - _start
+
+#endif /* #ifndef CONFIG_PRELOADER */
clear_bss:
ldr r0, _bss_start_ofs
@@ -237,7 +256,6 @@ clbss_l:str r2, [r0] /* clear loop... */
add r0, r0, #4
cmp r0, r1
bne clbss_l
-#endif /* #ifndef CONFIG_PRELOADER */
/*
* We are done. Do not return, instead branch to second part of board
@@ -257,13 +275,6 @@ jump_2_ram:
_board_init_r_ofs:
.word board_init_r - _start
-_rel_dyn_start_ofs:
- .word __rel_dyn_start - _start
-_rel_dyn_end_ofs:
- .word __rel_dyn_end - _start
-_dynsym_start_ofs:
- .word __dynsym_start - _start
-
/*************************************************************************
*
* CPU_init_critical registers
@@ -300,6 +311,8 @@ cpu_init_crit:
bl lowlevel_init @ go setup pll,mux,memory
mov lr, ip @ restore link
mov pc, lr @ back to my caller
+
+#ifndef CONFIG_PRELOADER
/*
*************************************************************************
*
@@ -488,3 +501,4 @@ fiq:
bl do_fiq
#endif
+#endif /* CONFIG_PRELOADER */
--
1.7.2.3

View File

@ -1,140 +0,0 @@
From 973a64f88d69d1c50409beaf83987f258b19cf8d Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Thu, 17 Feb 2011 17:50:06 +0530
Subject: [PATCH 09/22] omap: add spl support
Add the basic spl framework and linker script common for OMAP3/4
platforms.
Signed-off-by: Aneesh V <aneesh@ti.com>
---
spl/board/ti/spl-omap.c | 47 ++++++++++++++++++++++++++++++++++
spl/board/ti/spl-omap.lds | 62 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 109 insertions(+), 0 deletions(-)
create mode 100644 spl/board/ti/spl-omap.c
create mode 100644 spl/board/ti/spl-omap.lds
diff --git a/spl/board/ti/spl-omap.c b/spl/board/ti/spl-omap.c
new file mode 100644
index 0000000..0e08f4f
--- /dev/null
+++ b/spl/board/ti/spl-omap.c
@@ -0,0 +1,47 @@
+/*
+ *
+ * Clock initialization for OMAP4
+ *
+ * (C) Copyright 2010
+ * Texas Instruments, <www.ti.com>
+ *
+ * Aneesh V <aneesh@ti.com>
+ *
+ * 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 <asm/u-boot.h>
+#include <asm/arch/sys_proto.h>
+#include <timestamp_autogenerated.h>
+
+/* Define global data structure pointer to it*/
+gd_t gdata __attribute__ ((section(".data")));
+bd_t bdata __attribute__ ((section(".data")));
+gd_t *gd = &gdata;
+
+void board_init_f(ulong dummy)
+{
+ relocate_code(CONFIG_SYS_SPL_STACK, &gdata, CONFIG_SYS_SPL_TEXT_BASE);
+}
+
+void board_init_r(gd_t *id, ulong dummy)
+{
+ for (;;)
+ ;
+}
diff --git a/spl/board/ti/spl-omap.lds b/spl/board/ti/spl-omap.lds
new file mode 100644
index 0000000..27b5295
--- /dev/null
+++ b/spl/board/ti/spl-omap.lds
@@ -0,0 +1,62 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
+ *
+ * (C) Copyright 2010
+ * Texas Instruments, <www.ti.com>
+ * Aneesh V <aneesh@ti.com>
+ *
+ * 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
+ */
+
+MEMORY { .sram : ORIGIN = CONFIG_SYS_SPL_TEXT_BASE,\
+ LENGTH = CONFIG_SYS_SPL_MAX_SIZE }
+MEMORY { .sdram : ORIGIN = CONFIG_SYS_SPL_BSS_START_ADDR, \
+ LENGTH = CONFIG_SYS_SPL_BSS_MAX_SIZE }
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+ .text :
+ {
+ . = ALIGN(32);
+ __start = .;
+ start.o (.text)
+ *(.text*)
+ } >.sram
+
+ . = ALIGN(4);
+ .rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
+
+ . = ALIGN(4);
+ .data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
+ . = ALIGN(4);
+ __image_copy_end = .;
+
+ .bss :
+ {
+ . = ALIGN(4);
+ __bss_start = .;
+ *(.bss*)
+ . = ALIGN(4);
+ _end = .;
+ } >.sdram
+}
--
1.7.2.3

View File

@ -1,194 +0,0 @@
From ec08ceb0d0ed2e6c2deb5c6d81ebf0087e6fc5f8 Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Thu, 17 Feb 2011 18:23:31 +0530
Subject: [PATCH 10/22] omap4: add spl support for OMAP4 SDP
Adapted from: nand_spl/board/samsung/smdk6400/Makefile
- Add the SPL makefile for OMAP4430 SDP
- Add the necessary CONFIG flags in the board config file
Signed-off-by: Aneesh V <aneesh@ti.com>
---
board/ti/sdp4430/config.mk | 3 +-
include/configs/omap4_sdp4430.h | 19 ++++++
spl/board/ti/sdp4430/Makefile | 120 +++++++++++++++++++++++++++++++++++++++
3 files changed, 141 insertions(+), 1 deletions(-)
create mode 100644 spl/board/ti/sdp4430/Makefile
diff --git a/board/ti/sdp4430/config.mk b/board/ti/sdp4430/config.mk
index 33901a7..c62965d 100644
--- a/board/ti/sdp4430/config.mk
+++ b/board/ti/sdp4430/config.mk
@@ -28,4 +28,5 @@
# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
# (mem base + reserved)
-CONFIG_SYS_TEXT_BASE = 0x80e80000
+# 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
+CONFIG_SYS_TEXT_BASE = 0x80100000
diff --git a/include/configs/omap4_sdp4430.h b/include/configs/omap4_sdp4430.h
index 9a8bb73..5b20841 100644
--- a/include/configs/omap4_sdp4430.h
+++ b/include/configs/omap4_sdp4430.h
@@ -122,7 +122,9 @@
/* USB device configuration */
#define CONFIG_USB_DEVICE 1
+#ifndef CONFIG_PRELOADER
#define CONFIG_USB_TTY 1
+#endif
#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1
/* Flash */
@@ -240,4 +242,21 @@
CONFIG_SYS_INIT_RAM_SIZE - \
GENERATED_GBL_DATA_SIZE)
+/* Defines for Clock init */
+#define CONFIG_SYS_OMAP4_ABE_SYSCK
+
+/* Defines for SDRAM init */
+#define CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION 1
+#define CONFIG_SYS_EMIF_UPDATE_TIMINGS 1
+#define CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS 1
+
+/* Defines for SPL */
+#define CONFIG_SPL
+#define CONFIG_SYS_SPL_TEXT_BASE 0x40304360
+#define CONFIG_SYS_SPL_MAX_SIZE 0x7800 /* 30 K */
+#define CONFIG_SYS_SPL_STACK LOW_LEVEL_SRAM_STACK
+
+#define CONFIG_SYS_SPL_BSS_START_ADDR 0x80000000
+#define CONFIG_SYS_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
+
#endif /* __CONFIG_H */
diff --git a/spl/board/ti/sdp4430/Makefile b/spl/board/ti/sdp4430/Makefile
new file mode 100644
index 0000000..dd56a40
--- /dev/null
+++ b/spl/board/ti/sdp4430/Makefile
@@ -0,0 +1,120 @@
+#
+# (C) Copyright 2006-2007
+# Stefan Roese, DENX Software Engineering, sr@denx.de.
+#
+# (C) Copyright 2008
+# Guennadi Liakhovetki, DENX Software Engineering, <lg@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
+#
+splobj := $(OBJTREE)/spl/
+include $(TOPDIR)/config.mk
+SOBJS =
+COBJS =
+
+# armv7
+$(obj)start.S:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/start.S $@
+
+$(obj)syslib.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/syslib.c $@
+
+SOBJS += start.o
+COBJS += syslib.o
+
+# omap-common
+$(obj)timer.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap-common/timer.c $@
+
+$(obj)reset.S:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap-common/reset.S $@
+
+$(obj)spl-omap.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/spl/board/ti/spl-omap.c $@
+
+SOBJS += reset.o
+COBJS += timer.o spl-omap.o
+
+$(OBJTREE)/MLO: $(splobj)u-boot-spl.bin
+ $(OBJTREE)/tools/mkimage -T omapimage \
+ -a $(CONFIG_SYS_SPL_TEXT_BASE) -d $< $@
+
+LDSCRIPT_SOURCE = $(TOPDIR)/spl/board/ti/spl-omap.lds
+
+# omap4
+$(obj)lowlevel_init.S:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/lowlevel_init.S $@
+
+$(obj)omap4_mux_data.h:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/omap4_mux_data.h $@
+
+$(obj)board.c:$(obj)omap4_mux_data.h
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/board.c $@
+
+SOBJS += lowlevel_init.o
+COBJS += board.o
+
+# rules
+LDPPFLAGS += -include $(TOPDIR)/include/config.h
+LDSCRIPT = $(splobj)u-boot-spl-generated.lds
+$(LDSCRIPT): $(LDSCRIPT_SOURCE)
+ $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+LDFLAGS = -Bstatic -T $(LDSCRIPT) \
+ $(PLATFORM_LDFLAGS) --gc-sections
+AFLAGS += -DCONFIG_PRELOADER -Os -ffixed-r8
+CFLAGS += -DCONFIG_PRELOADER -Os -ffixed-r8 -ffunction-sections \
+ -fdata-sections -march=armv7-a -mthumb
+PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) \
+ -print-libgcc-file-name`) -lgcc
+
+$(obj)%.o: $(obj)%.S
+ $(CC) $(AFLAGS) -c -o $@ $<
+
+$(obj)%.o: $(obj)%.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
+OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+__OBJS := $(SOBJS) $(COBJS)
+LNDIR := $(OBJTREE)/spl/board/$(BOARDDIR)
+
+$(splobj)u-boot-spl.bin: $(splobj)u-boot-spl
+ $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+
+$(splobj)u-boot-spl: $(OBJS) $(LDSCRIPT)
+ cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
+ $(PLATFORM_LIBGCC) \
+ -Map $(splobj)u-boot-spl.map \
+ -o $(splobj)u-boot-spl
+
+ALL = $(OBJTREE)/MLO
+all: $(obj).depend $(ALL)
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
--
1.7.2.3

View File

@ -1,110 +0,0 @@
From eb26c57b60b026cd827be2470697111418b5ca61 Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Sun, 27 Feb 2011 19:45:01 +0530
Subject: [PATCH 11/22] omap4: add serial console support to SPL
Signed-off-by: Aneesh V <aneesh@ti.com>
---
arch/arm/cpu/armv7/omap4/board.c | 3 ++
arch/arm/include/asm/omap_common.h | 1 +
spl/board/ti/sdp4430/Makefile | 40 ++++++++++++++++++++++++++++++++++++
spl/board/ti/spl-omap.c | 10 +++++++++
4 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap4/board.c b/arch/arm/cpu/armv7/omap4/board.c
index a5d585b..da79669 100644
--- a/arch/arm/cpu/armv7/omap4/board.c
+++ b/arch/arm/cpu/armv7/omap4/board.c
@@ -57,6 +57,9 @@ u32 omap_boot_mode(void)
void s_init(void)
{
watchdog_init();
+#ifdef CONFIG_PRELOADER
+ preloader_console_init();
+#endif
}
/*
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 06c511c..95116f4 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -67,5 +67,6 @@
u32 omap_boot_device(void);
u32 omap_boot_mode(void);
+void preloader_console_init(void);
#endif /* _OMAP_COMMON_H_ */
diff --git a/spl/board/ti/sdp4430/Makefile b/spl/board/ti/sdp4430/Makefile
index dd56a40..6a6aa42 100644
--- a/spl/board/ti/sdp4430/Makefile
+++ b/spl/board/ti/sdp4430/Makefile
@@ -28,6 +28,46 @@ include $(TOPDIR)/config.mk
SOBJS =
COBJS =
+# serial console
+$(obj)eabi_compat.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/lib/eabi_compat.c $@
+
+$(obj)string.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/lib/string.c $@
+
+$(obj)vsprintf.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/lib/vsprintf.c $@
+
+$(obj)console.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/common/console.c $@
+
+$(obj)stdio.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/common/stdio.c $@
+
+$(obj)serial.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/serial/serial.c $@
+
+$(obj)ns16550.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/serial/ns16550.c $@
+
+$(obj)div64.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/lib/div64.c $@
+
+$(obj)ctype.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/lib/ctype.c $@
+
+COBJS += serial.o ns16550.o string.o vsprintf.o console.o stdio.o
+COBJS += ctype.o eabi_compat.o div64.o
+
# armv7
$(obj)start.S:
@rm -f $@
diff --git a/spl/board/ti/spl-omap.c b/spl/board/ti/spl-omap.c
index 0e08f4f..57ddb7d 100644
--- a/spl/board/ti/spl-omap.c
+++ b/spl/board/ti/spl-omap.c
@@ -45,3 +45,13 @@ void board_init_r(gd_t *id, ulong dummy)
for (;;)
;
}
+
+void preloader_console_init(void)
+{
+ gd->bd = &bdata;
+ gd->flags |= GD_FLG_RELOC;
+ gd->baudrate = CONFIG_BAUDRATE;
+ serial_init(); /* serial communications setup */
+ printf("\nU-Boot SPL for Texas Instruments OMAP4 (%s - %s)\n",
+ U_BOOT_DATE, U_BOOT_TIME);
+}
--
1.7.2.3

View File

@ -1,100 +0,0 @@
From 4ddea7506c79c6309e65baf0484650b816f6e3c9 Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Sun, 20 Feb 2011 16:15:42 +0530
Subject: [PATCH 12/22] omap4: utility function to identify the context of hw init
The basic hardware init of OMAP4(s_init()) can happen in 4
different contexts:
1. SPL running from SRAM
2. U-Boot running from FLASH
3. Non-XIP U-Boot loaded to SDRAM by SPL
4. Non-XIP U-Boot loaded to SDRAM by ROM code using the
Configuration Header feature
What level of hw initialization gets done depends on this
context. Add a utility function to find this context.
Signed-off-by: Aneesh V <aneesh@ti.com>
---
arch/arm/include/asm/arch-omap4/sys_proto.h | 47 +++++++++++++++++++++++++++
arch/arm/include/asm/omap_common.h | 6 +++
2 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/arch-omap4/sys_proto.h b/arch/arm/include/asm/arch-omap4/sys_proto.h
index ce86b36..19da2e1 100644
--- a/arch/arm/include/asm/arch-omap4/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap4/sys_proto.h
@@ -38,6 +38,53 @@ void sr32(void *, u32, u32, u32);
u32 wait_on_value(u32, u32, void *, u32);
void sdelay(unsigned long);
+static inline u32 running_from_sdram(void)
+{
+ u32 pc;
+ asm volatile ("mov %0, pc" : "=r" (pc));
+ return ((pc >= OMAP44XX_DRAM_ADDR_SPACE_START) &&
+ (pc < OMAP44XX_DRAM_ADDR_SPACE_END));
+}
+
+static inline u8 uboot_loaded_by_spl(void)
+{
+ /*
+ * Configuration Header is not supported yet, so u-boot init running
+ * from SDRAM implies that it was loaded by SPL. When this situation
+ * changes one of these approaches could be taken:
+ * i. Pass a magic from SPL to U-Boot and U-Boot save it at a known
+ * location.
+ * ii. Check the OPP. CH can support only 50% OPP while SPL initializes
+ * the DPLLs at 100% OPP.
+ */
+ return running_from_sdram();
+}
+/*
+ * The basic hardware init of OMAP(s_init()) can happen in 4
+ * different contexts:
+ * 1. SPL running from SRAM
+ * 2. U-Boot running from FLASH
+ * 3. Non-XIP U-Boot loaded to SDRAM by SPL
+ * 4. Non-XIP U-Boot loaded to SDRAM by ROM code using the
+ * Configuration Header feature
+ *
+ * This function finds this context.
+ * Defining as inline may help in compiling out unused functions in SPL
+ */
+static inline u32 omap4_hw_init_context(void)
+{
+#ifdef CONFIG_PRELOADER
+ return OMAP_INIT_CONTEXT_SPL;
+#else
+ if (uboot_loaded_by_spl())
+ return OMAP_INIT_CONTEXT_UBOOT_LOADED_BY_SPL;
+ else if (running_from_sdram())
+ return OMAP_INIT_CONTEXT_UBOOT_LOADED_BY_CH;
+ else
+ return OMAP_INIT_CONTEXT_XIP_UBOOT;
+#endif
+}
+
extern const struct omap_sysinfo sysinfo;
#endif
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 95116f4..50247af 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -65,6 +65,12 @@
/* Magic number passed from SPL to U-Boot */
#define OMAP_SPL_TO_UBOOT_MAGIC_NUMBER 0xDEADBEEF
+/* HW Init Context */
+#define OMAP_INIT_CONTEXT_SPL 0
+#define OMAP_INIT_CONTEXT_XIP_UBOOT 1
+#define OMAP_INIT_CONTEXT_UBOOT_LOADED_BY_SPL 2
+#define OMAP_INIT_CONTEXT_UBOOT_LOADED_BY_CH 3
+
u32 omap_boot_device(void);
u32 omap_boot_mode(void);
void preloader_console_init(void);
--
1.7.2.3

View File

@ -1,251 +0,0 @@
From 984aa865e9cc09a61c3238c6493ae3f845c38da6 Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Sat, 19 Feb 2011 18:31:42 +0530
Subject: [PATCH 14/22] omap4: correct mux data for sdp4430
sync up mux settings with the latest in x-loader
Signed-off-by: Aneesh V <aneesh@ti.com>
---
board/ti/panda/panda_mux_data.h | 89 ++++++++++++++++++-----------------
board/ti/sdp4430/sdp4430_mux_data.h | 29 ++++++-----
2 files changed, 61 insertions(+), 57 deletions(-)
diff --git a/board/ti/panda/panda_mux_data.h b/board/ti/panda/panda_mux_data.h
index 8bb7fe5..16cc0ad 100644
--- a/board/ti/panda/panda_mux_data.h
+++ b/board/ti/panda/panda_mux_data.h
@@ -23,11 +23,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
+#ifndef _SDP4430_MUX_DATA_H
+#define _SDP4430_MUX_DATA_H
-#ifndef _PANDA_MUX_DATA_H_
-#define _PANDA_MUX_DATA_H_
-
-#include <asm/io.h>
#include <asm/arch/mux_omap4.h>
const struct pad_conf_entry core_padconf_array_non_essential[] = {
@@ -45,7 +43,7 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
{GPMC_A19, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* kpd_row7 */
{GPMC_A20, (IEN | M3)}, /* gpio_44 */
{GPMC_A21, (M3)}, /* gpio_45 */
- {GPMC_A22, (M3)}, /* gpio_46 */
+ {GPMC_A22, (OFF_EN | OFF_PD | OFF_IN | M1)}, /* kpd_col6 */
{GPMC_A23, (OFF_EN | OFF_PD | OFF_IN | M1)}, /* kpd_col7 */
{GPMC_A24, (PTD | M3)}, /* gpio_48 */
{GPMC_A25, (PTD | M3)}, /* gpio_49 */
@@ -59,9 +57,9 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
{GPMC_NBE0_CLE, (M3)}, /* gpio_59 */
{GPMC_NBE1, (PTD | M3)}, /* gpio_60 */
{GPMC_WAIT0, (PTU | IEN | M3)}, /* gpio_61 */
- {GPMC_WAIT1, (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)}, /* gpio_62 */
+ {GPMC_WAIT1, (IEN | M3)}, /* gpio_62 */
{C2C_DATA11, (PTD | M3)}, /* gpio_100 */
- {C2C_DATA12, (PTU | IEN | M3)}, /* gpio_101 */
+ {C2C_DATA12, (M1)}, /* dsi1_te0 */
{C2C_DATA13, (PTD | M3)}, /* gpio_102 */
{C2C_DATA14, (M1)}, /* dsi2_te0 */
{C2C_DATA15, (PTD | M3)}, /* gpio_104 */
@@ -86,14 +84,14 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
{CAM_SHUTTER, (OFF_EN | OFF_PD | OFF_OUT_PTD | M0)}, /* cam_shutter */
{CAM_STROBE, (OFF_EN | OFF_PD | OFF_OUT_PTD | M0)}, /* cam_strobe */
{CAM_GLOBALRESET, (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)}, /* gpio_83 */
- {USBB1_ULPITLL_CLK, (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)},/* usbb1_ulpiphy_clk */
- {USBB1_ULPITLL_STP, (OFF_EN | OFF_OUT_PTD | M4)}, /* usbb1_ulpiphy_stp */
- {USBB1_ULPITLL_DIR, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dir */
- {USBB1_ULPITLL_NXT, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_nxt */
- {USBB1_ULPITLL_DAT0, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat0 */
- {USBB1_ULPITLL_DAT1, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat1 */
- {USBB1_ULPITLL_DAT2, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat2 */
- {USBB1_ULPITLL_DAT3, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat3 */
+ {USBB1_ULPITLL_CLK, (IEN | OFF_EN | OFF_IN | M1)}, /* hsi1_cawake */
+ {USBB1_ULPITLL_STP, (IEN | OFF_EN | OFF_IN | M1)}, /* hsi1_cadata */
+ {USBB1_ULPITLL_DIR, (IEN | OFF_EN | OFF_IN | M1)}, /* hsi1_caflag */
+ {USBB1_ULPITLL_NXT, (OFF_EN | M1)}, /* hsi1_acready */
+ {USBB1_ULPITLL_DAT0, (OFF_EN | M1)}, /* hsi1_acwake */
+ {USBB1_ULPITLL_DAT1, (OFF_EN | M1)}, /* hsi1_acdata */
+ {USBB1_ULPITLL_DAT2, (OFF_EN | M1)}, /* hsi1_acflag */
+ {USBB1_ULPITLL_DAT3, (IEN | OFF_EN | OFF_IN | M1)}, /* hsi1_caready */
{USBB1_ULPITLL_DAT4, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat4 */
{USBB1_ULPITLL_DAT5, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat5 */
{USBB1_ULPITLL_DAT6, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat6 */
@@ -106,8 +104,8 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
{ABE_MCBSP2_DR, (IEN | OFF_EN | OFF_OUT_PTD | M0)}, /* abe_mcbsp2_dr */
{ABE_MCBSP2_DX, (OFF_EN | OFF_OUT_PTD | M0)}, /* abe_mcbsp2_dx */
{ABE_MCBSP2_FSX, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* abe_mcbsp2_fsx */
- {ABE_MCBSP1_CLKX, (IEN | M1)}, /* abe_slimbus1_clock */
- {ABE_MCBSP1_DR, (IEN | M1)}, /* abe_slimbus1_data */
+ {ABE_MCBSP1_CLKX, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* abe_mcbsp1_clkx */
+ {ABE_MCBSP1_DR, (IEN | OFF_EN | OFF_OUT_PTD | M0)}, /* abe_mcbsp1_dr */
{ABE_MCBSP1_DX, (OFF_EN | OFF_OUT_PTD | M0)}, /* abe_mcbsp1_dx */
{ABE_MCBSP1_FSX, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* abe_mcbsp1_fsx */
{ABE_PDM_UL_DATA, (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* abe_pdm_ul_data */
@@ -143,7 +141,7 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
{MCSPI4_CS0, (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* mcspi4_cs0 */
{UART4_RX, (IEN | M0)}, /* uart4_rx */
{UART4_TX, (M0)}, /* uart4_tx */
- {USBB2_ULPITLL_CLK, (IEN | M3)}, /* gpio_157 */
+ {USBB2_ULPITLL_CLK, (PTD | IEN | M3)}, /* gpio_157 */
{USBB2_ULPITLL_STP, (IEN | M5)}, /* dispc2_data23 */
{USBB2_ULPITLL_DIR, (IEN | M5)}, /* dispc2_data22 */
{USBB2_ULPITLL_NXT, (IEN | M5)}, /* dispc2_data21 */
@@ -157,12 +155,12 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
{USBB2_ULPITLL_DAT7, (IEN | M5)}, /* dispc2_data11 */
{USBB2_HSIC_DATA, (PTD | OFF_EN | OFF_OUT_PTU | M3)}, /* gpio_169 */
{USBB2_HSIC_STROBE, (PTD | OFF_EN | OFF_OUT_PTU | M3)}, /* gpio_170 */
- {UNIPRO_TX0, (PTD | IEN | M3)}, /* gpio_171 */
+ {UNIPRO_TX0, (OFF_EN | OFF_PD | OFF_IN | M1)}, /* kpd_col0 */
{UNIPRO_TY0, (OFF_EN | OFF_PD | OFF_IN | M1)}, /* kpd_col1 */
{UNIPRO_TX1, (OFF_EN | OFF_PD | OFF_IN | M1)}, /* kpd_col2 */
{UNIPRO_TY1, (OFF_EN | OFF_PD | OFF_IN | M1)}, /* kpd_col3 */
- {UNIPRO_TX2, (PTU | IEN | M3)}, /* gpio_0 */
- {UNIPRO_TY2, (PTU | IEN | M3)}, /* gpio_1 */
+ {UNIPRO_TX2, (OFF_EN | OFF_PD | OFF_IN | M1)}, /* kpd_col4 */
+ {UNIPRO_TY2, (OFF_EN | OFF_PD | OFF_IN | M1)}, /* kpd_col5 */
{UNIPRO_RX0, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* kpd_row0 */
{UNIPRO_RY0, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* kpd_row1 */
{UNIPRO_RX1, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* kpd_row2 */
@@ -173,13 +171,13 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
{USBA0_OTG_DP, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* usba0_otg_dp */
{USBA0_OTG_DM, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* usba0_otg_dm */
{FREF_CLK1_OUT, (M0)}, /* fref_clk1_out */
- {FREF_CLK2_OUT, (PTU | IEN | M3)}, /* gpio_182 */
+ {FREF_CLK2_OUT, (M0)}, /* fref_clk2_out */
{SYS_NIRQ1, (PTU | IEN | M0)}, /* sys_nirq1 */
- {SYS_NIRQ2, (PTU | IEN | M0)}, /* sys_nirq2 */
+ {SYS_NIRQ2, (M7)}, /* sys_nirq2 */
{SYS_BOOT0, (PTU | IEN | M3)}, /* gpio_184 */
{SYS_BOOT1, (M3)}, /* gpio_185 */
{SYS_BOOT2, (PTD | IEN | M3)}, /* gpio_186 */
- {SYS_BOOT3, (M3)}, /* gpio_187 */
+ {SYS_BOOT3, (PTD | IEN | M3)}, /* gpio_187 */
{SYS_BOOT4, (M3)}, /* gpio_188 */
{SYS_BOOT5, (PTD | IEN | M3)}, /* gpio_189 */
{DPM_EMU0, (IEN | M0)}, /* dpm_emu0 */
@@ -205,25 +203,28 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
};
const struct pad_conf_entry wkup_padconf_array_non_essential[] = {
- {PAD0_SIM_IO, (IEN | M0)}, /* sim_io */
- {PAD1_SIM_CLK, (M0)}, /* sim_clk */
- {PAD0_SIM_RESET, (M0)}, /* sim_reset */
- {PAD1_SIM_CD, (PTU | IEN | M0)}, /* sim_cd */
- {PAD0_SIM_PWRCTRL, (M0)}, /* sim_pwrctrl */
- {PAD1_FREF_XTAL_IN, (M0)}, /* # */
- {PAD0_FREF_SLICER_IN, (M0)}, /* fref_slicer_in */
- {PAD1_FREF_CLK_IOREQ, (M0)}, /* fref_clk_ioreq */
- {PAD0_FREF_CLK0_OUT, (M2)}, /* sys_drm_msecure */
- {PAD1_FREF_CLK3_REQ, (M3)}, /* gpio_wk30 */
- {PAD0_FREF_CLK3_OUT, (M0)}, /* fref_clk3_out */
- {PAD1_FREF_CLK4_REQ, (PTU | OFF_EN | OFF_OUT_PTU | M3)}, /* led status_1 */
- {PAD0_FREF_CLK4_OUT, (PTU | OFF_EN | OFF_OUT_PTU | M3)}, /* led status_2 */
- {PAD0_SYS_NRESPWRON, (M0)}, /* sys_nrespwron */
- {PAD1_SYS_NRESWARM, (M0)}, /* sys_nreswarm */
- {PAD0_SYS_PWR_REQ, (PTU | M0)}, /* sys_pwr_req */
- {PAD1_SYS_PWRON_RESET, (M3)}, /* gpio_wk29 */
- {PAD0_SYS_BOOT6, (IEN | M3)}, /* gpio_wk9 */
- {PAD1_SYS_BOOT7, (IEN | M3)}, /* gpio_wk10 */
+ {PAD0_SIM_IO, (IEN | M0)}, /* sim_io */
+ {PAD1_SIM_CLK, (M0)}, /* sim_clk */
+ {PAD0_SIM_RESET, (M0)}, /* sim_reset */
+ {PAD1_SIM_CD, (PTU | IEN | M0)}, /* sim_cd */
+ {PAD0_SIM_PWRCTRL, (M0)}, /* sim_pwrctrl */
+ {PAD1_FREF_XTAL_IN, (M0)}, /* # */
+ {PAD0_FREF_SLICER_IN, (M0)}, /* fref_slicer_in */
+ {PAD1_FREF_CLK_IOREQ, (M0)}, /* fref_clk_ioreq */
+ {PAD0_FREF_CLK0_OUT, (M2)}, /* sys_drm_msecure */
+ {PAD1_FREF_CLK3_REQ, (PTU | IEN | M0)}, /* # */
+ {PAD0_FREF_CLK3_OUT, (M0)}, /* fref_clk3_out */
+ {PAD1_FREF_CLK4_REQ, (PTU | IEN | M0)}, /* # */
+ {PAD0_FREF_CLK4_OUT, (M0)}, /* # */
+ {PAD0_SYS_NRESPWRON, (M0)}, /* sys_nrespwron */
+ {PAD1_SYS_NRESWARM, (M0)}, /* sys_nreswarm */
+ {PAD0_SYS_PWR_REQ, (PTU | M0)}, /* sys_pwr_req */
+ {PAD1_SYS_PWRON_RESET, (M3)}, /* gpio_wk29 */
+ {PAD0_SYS_BOOT6, (IEN | M3)}, /* gpio_wk9 */
+ {PAD1_SYS_BOOT7, (IEN | M3)}, /* gpio_wk10 */
+ {PAD1_FREF_CLK3_REQ, (M3)}, /* gpio_wk30 */
+ {PAD1_FREF_CLK4_REQ, (M3)}, /* gpio_wk7 */
+ {PAD0_FREF_CLK4_OUT, (M3)}, /* gpio_wk8 */
};
-#endif /* _PANDA_MUX_DATA_H_ */
+#endif /* _SDP4430_MUX_DATA_H */
diff --git a/board/ti/sdp4430/sdp4430_mux_data.h b/board/ti/sdp4430/sdp4430_mux_data.h
index e6081dc..16cc0ad 100644
--- a/board/ti/sdp4430/sdp4430_mux_data.h
+++ b/board/ti/sdp4430/sdp4430_mux_data.h
@@ -84,14 +84,14 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
{CAM_SHUTTER, (OFF_EN | OFF_PD | OFF_OUT_PTD | M0)}, /* cam_shutter */
{CAM_STROBE, (OFF_EN | OFF_PD | OFF_OUT_PTD | M0)}, /* cam_strobe */
{CAM_GLOBALRESET, (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)}, /* gpio_83 */
- {USBB1_ULPITLL_CLK, (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)},/* usbb1_ulpiphy_clk */
- {USBB1_ULPITLL_STP, (OFF_EN | OFF_OUT_PTD | M4)}, /* usbb1_ulpiphy_stp */
- {USBB1_ULPITLL_DIR, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dir */
- {USBB1_ULPITLL_NXT, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_nxt */
- {USBB1_ULPITLL_DAT0, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat0 */
- {USBB1_ULPITLL_DAT1, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat1 */
- {USBB1_ULPITLL_DAT2, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat2 */
- {USBB1_ULPITLL_DAT3, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat3 */
+ {USBB1_ULPITLL_CLK, (IEN | OFF_EN | OFF_IN | M1)}, /* hsi1_cawake */
+ {USBB1_ULPITLL_STP, (IEN | OFF_EN | OFF_IN | M1)}, /* hsi1_cadata */
+ {USBB1_ULPITLL_DIR, (IEN | OFF_EN | OFF_IN | M1)}, /* hsi1_caflag */
+ {USBB1_ULPITLL_NXT, (OFF_EN | M1)}, /* hsi1_acready */
+ {USBB1_ULPITLL_DAT0, (OFF_EN | M1)}, /* hsi1_acwake */
+ {USBB1_ULPITLL_DAT1, (OFF_EN | M1)}, /* hsi1_acdata */
+ {USBB1_ULPITLL_DAT2, (OFF_EN | M1)}, /* hsi1_acflag */
+ {USBB1_ULPITLL_DAT3, (IEN | OFF_EN | OFF_IN | M1)}, /* hsi1_caready */
{USBB1_ULPITLL_DAT4, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat4 */
{USBB1_ULPITLL_DAT5, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat5 */
{USBB1_ULPITLL_DAT6, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat6 */
@@ -104,8 +104,8 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
{ABE_MCBSP2_DR, (IEN | OFF_EN | OFF_OUT_PTD | M0)}, /* abe_mcbsp2_dr */
{ABE_MCBSP2_DX, (OFF_EN | OFF_OUT_PTD | M0)}, /* abe_mcbsp2_dx */
{ABE_MCBSP2_FSX, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* abe_mcbsp2_fsx */
- {ABE_MCBSP1_CLKX, (IEN | M1)}, /* abe_slimbus1_clock */
- {ABE_MCBSP1_DR, (IEN | M1)}, /* abe_slimbus1_data */
+ {ABE_MCBSP1_CLKX, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* abe_mcbsp1_clkx */
+ {ABE_MCBSP1_DR, (IEN | OFF_EN | OFF_OUT_PTD | M0)}, /* abe_mcbsp1_dr */
{ABE_MCBSP1_DX, (OFF_EN | OFF_OUT_PTD | M0)}, /* abe_mcbsp1_dx */
{ABE_MCBSP1_FSX, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* abe_mcbsp1_fsx */
{ABE_PDM_UL_DATA, (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* abe_pdm_ul_data */
@@ -141,7 +141,7 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
{MCSPI4_CS0, (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* mcspi4_cs0 */
{UART4_RX, (IEN | M0)}, /* uart4_rx */
{UART4_TX, (M0)}, /* uart4_tx */
- {USBB2_ULPITLL_CLK, (IEN | M3)}, /* gpio_157 */
+ {USBB2_ULPITLL_CLK, (PTD | IEN | M3)}, /* gpio_157 */
{USBB2_ULPITLL_STP, (IEN | M5)}, /* dispc2_data23 */
{USBB2_ULPITLL_DIR, (IEN | M5)}, /* dispc2_data22 */
{USBB2_ULPITLL_NXT, (IEN | M5)}, /* dispc2_data21 */
@@ -173,11 +173,11 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
{FREF_CLK1_OUT, (M0)}, /* fref_clk1_out */
{FREF_CLK2_OUT, (M0)}, /* fref_clk2_out */
{SYS_NIRQ1, (PTU | IEN | M0)}, /* sys_nirq1 */
- {SYS_NIRQ2, (PTU | IEN | M0)}, /* sys_nirq2 */
+ {SYS_NIRQ2, (M7)}, /* sys_nirq2 */
{SYS_BOOT0, (PTU | IEN | M3)}, /* gpio_184 */
{SYS_BOOT1, (M3)}, /* gpio_185 */
{SYS_BOOT2, (PTD | IEN | M3)}, /* gpio_186 */
- {SYS_BOOT3, (M3)}, /* gpio_187 */
+ {SYS_BOOT3, (PTD | IEN | M3)}, /* gpio_187 */
{SYS_BOOT4, (M3)}, /* gpio_188 */
{SYS_BOOT5, (PTD | IEN | M3)}, /* gpio_189 */
{DPM_EMU0, (IEN | M0)}, /* dpm_emu0 */
@@ -222,6 +222,9 @@ const struct pad_conf_entry wkup_padconf_array_non_essential[] = {
{PAD1_SYS_PWRON_RESET, (M3)}, /* gpio_wk29 */
{PAD0_SYS_BOOT6, (IEN | M3)}, /* gpio_wk9 */
{PAD1_SYS_BOOT7, (IEN | M3)}, /* gpio_wk10 */
+ {PAD1_FREF_CLK3_REQ, (M3)}, /* gpio_wk30 */
+ {PAD1_FREF_CLK4_REQ, (M3)}, /* gpio_wk7 */
+ {PAD0_FREF_CLK4_OUT, (M3)}, /* gpio_wk8 */
};
#endif /* _SDP4430_MUX_DATA_H */
--
1.7.2.3

View File

@ -1,304 +0,0 @@
From e7c2c0d5c3834c6ddfc826f1ae9f07406265afcf Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Fri, 25 Feb 2011 18:07:13 +0530
Subject: [PATCH 18/22] omap4: automatic sdram detection
Identify SDRAM devices connected to EMIF automatically:
LPDDR2 devices have some Mode Registers that provide details
about the device such as the type, density, bus width
etc. EMIF has the capability to read these registers. If there
are not devices connected to a given chip-select reading mode
registers will return junk values. After reading as many such
registers as possible and matching with expected ranges of
values the driver can identify if there is a device connected
to the respective CS. If we identify that a device is connected
the values read give us complete details about the device.
This along with the base AC timings specified by JESD209-2
allows us to do a complete automatic initialization of
SDRAM that works on all boards.
Please note that the default AC timings specified by JESD209-2
will be safe for all devices but not necessarily optimal. However,
for the Elpida devices used on Panda and SDP the default timings
are both safe and optimal.
Signed-off-by: Aneesh V <aneesh@ti.com>
---
arch/arm/cpu/armv7/omap4/emif.c | 177 +++++++++++++++++++++++++++++-
arch/arm/cpu/armv7/omap4/sdram_elpida.c | 9 +-
include/configs/omap4_sdp4430.h | 1 +
3 files changed, 176 insertions(+), 11 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap4/emif.c b/arch/arm/cpu/armv7/omap4/emif.c
index 1bdb1d2..006d065 100644
--- a/arch/arm/cpu/armv7/omap4/emif.c
+++ b/arch/arm/cpu/armv7/omap4/emif.c
@@ -165,7 +165,8 @@ static const struct lpddr2_min_tck min_tck_jedec = {
.tFAW = 8
};
-static const struct lpddr2_ac_timings *jedec_ac_timings[MAX_NUM_SPEEDBINS] = {
+static const struct lpddr2_ac_timings const*
+ jedec_ac_timings[MAX_NUM_SPEEDBINS] = {
&timings_jedec_200_mhz,
&timings_jedec_333_mhz,
&timings_jedec_400_mhz
@@ -779,6 +780,146 @@ void emif_reset_phy(u32 base)
writel(iodft, &emif->emif_iodft_tlgc);
}
+#ifdef CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION
+static void display_sdram_details(u32 emif_nr, u32 cs,
+ struct lpddr2_device_details *device)
+{
+ const char *mfg_str;
+ const char *type_str;
+ char density_str[10];
+ u32 density;
+
+ debug("EMIF%d CS%d\t", emif_nr, cs);
+
+ if (!device) {
+ debug("None\n");
+ return;
+ }
+
+ mfg_str = get_lpddr2_manufacturer(device->manufacturer);
+ type_str = get_lpddr2_type(device->type);
+
+ density = lpddr2_density_2_size_in_mbytes[device->density];
+ if ((density / 1024 * 1024) == density) {
+ density /= 1024;
+ sprintf(density_str, "%d GB", density);
+ } else
+ sprintf(density_str, "%d MB", density);
+ if (mfg_str && type_str)
+ debug("%s\t\t%s\t%s\n", mfg_str, type_str, density_str);
+}
+
+static u8 is_lpddr2_sdram_present(u32 base, u32 cs,
+ struct lpddr2_device_details *lpddr2_device)
+{
+ u32 mr = 0, temp;
+
+ mr = get_mr(base, cs, LPDDR2_MR0);
+ if (mr > 0xFF) {
+ /* Mode register value bigger than 8 bit */
+ return 0;
+ }
+
+ temp = get_bit_field(mr, LPDDR2_MR0_DI_SHIFT, LPDDR2_MR0_DI_MASK);
+ if (temp) {
+ /* Not SDRAM */
+ return 0;
+ }
+ temp = get_bit_field(mr, LPDDR2_MR0_DNVI_SHIFT, LPDDR2_MR0_DNVI_MASK);
+
+ if (temp) {
+ /* DNV supported - But DNV is only supported for NVM */
+ return 0;
+ }
+
+ mr = get_mr(base, cs, LPDDR2_MR4);
+ if (mr > 0xFF) {
+ /* Mode register value bigger than 8 bit */
+ return 0;
+ }
+
+ mr = get_mr(base, cs, LPDDR2_MR5);
+ if (mr >= 0xFF) {
+ /* Mode register value bigger than 8 bit */
+ return 0;
+ }
+
+ if (!get_lpddr2_manufacturer(mr)) {
+ /* Manufacturer not identified */
+ return 0;
+ }
+ lpddr2_device->manufacturer = mr;
+
+ mr = get_mr(base, cs, LPDDR2_MR6);
+ if (mr >= 0xFF) {
+ /* Mode register value bigger than 8 bit */
+ return 0;
+ }
+
+ mr = get_mr(base, cs, LPDDR2_MR7);
+ if (mr >= 0xFF) {
+ /* Mode register value bigger than 8 bit */
+ return 0;
+ }
+
+ mr = get_mr(base, cs, LPDDR2_MR8);
+ if (mr >= 0xFF) {
+ /* Mode register value bigger than 8 bit */
+ return 0;
+ }
+
+ temp = get_bit_field(mr, MR8_TYPE_SHIFT, MR8_TYPE_MASK);
+ if (!get_lpddr2_type(temp)) {
+ /* Not SDRAM */
+ return 0;
+ }
+ lpddr2_device->type = temp;
+
+ temp = get_bit_field(mr, MR8_DENSITY_SHIFT, MR8_DENSITY_MASK);
+ if (temp > LPDDR2_DENSITY_32Gb) {
+ /* Density not supported */
+ return 0;
+ }
+ lpddr2_device->density = temp;
+
+ temp = get_bit_field(mr, MR8_IO_WIDTH_SHIFT, MR8_IO_WIDTH_MASK);
+ if (!get_lpddr2_io_width(temp)) {
+ /* IO width unsupported value */
+ return 0;
+ }
+ lpddr2_device->io_width = temp;
+
+ /*
+ * If all the above tests pass we should
+ * have a device on this chip-select
+ */
+ return 1;
+}
+
+static struct lpddr2_device_details *get_lpddr2_details(u32 base, u8 cs,
+ struct lpddr2_device_details *lpddr2_dev_details)
+{
+ u32 phy;
+ struct emif_reg_struct *emif = (struct emif_reg_struct *)base;
+
+ if (!lpddr2_dev_details)
+ return NULL;
+
+ /* Do the minimum init for mode register accesses */
+ if (!running_from_sdram()) {
+ phy = get_ddr_phy_ctrl_1(get_syc_clk_freq() / 2, RL_BOOT);
+ writel(phy, &emif->emif_ddr_phy_ctrl_1);
+ }
+
+ if (!(is_lpddr2_sdram_present(base, cs, lpddr2_dev_details)))
+ return NULL;
+
+ display_sdram_details(emif_num(base), cs, lpddr2_dev_details);
+
+ return lpddr2_dev_details;
+}
+#endif /* CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION */
+
static void do_lpddr2_init(u32 base, u32 cs)
{
u32 mr_addr;
@@ -862,9 +1003,7 @@ static void emif_update_timings(u32 base, const struct emif_regs *regs)
static void do_sdram_init(u32 base)
{
- struct emif_device_details dev_details;
const struct emif_regs *regs;
-
u32 in_sdram, emif_nr;
in_sdram = running_from_sdram();
@@ -872,6 +1011,7 @@ static void do_sdram_init(u32 base)
#ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
const struct emif_regs *tmp_regs;
+
emif_get_reg_dump(&regs, &tmp_regs);
regs = (emif_nr == 1) ? regs : tmp_regs;
#else
@@ -879,23 +1019,48 @@ static void do_sdram_init(u32 base)
* The user has not provided the register values. We need to
* calculate it based on the timings and the DDR frequency
*/
+ struct emif_device_details dev_details = { NULL, NULL };
+ struct emif_regs calculated_regs;
+#if !defined(CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION) || \
+ !defined(CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS)
+
+ /* We need some input about the devices from the user */
const struct emif_device_details *dev_details_user_provided;
const struct emif_device_details *tmp_details;
- struct emif_regs calculated_regs;
- /* We need some input about the devices from the user */
emif_get_device_details(&dev_details_user_provided, &tmp_details);
dev_details_user_provided = (emif_nr == 1) ? dev_details_user_provided
: tmp_details;
if (!dev_details_user_provided)
return;
+#endif
+#ifdef CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION
+ struct lpddr2_device_details cs0_dev_details, cs1_dev_details;
+
+ /* Automatically find the device details */
+ if (!in_sdram) {
+ dev_details.cs0_device_details =
+ get_lpddr2_details(base, CS0, &cs0_dev_details);
+ dev_details.cs1_device_details =
+ get_lpddr2_details(base, CS1, &cs1_dev_details);
+ /*
+ * Reset the PHY - if there is nothing connected on any
+ * of the chip selects(typically CS1) mode register reads
+ * will mess up with the PHY state and subsequent
+ * initialization won't work. PHY reset brings back PHY to
+ * a good state.
+ */
+ emif_reset_phy(base);
+ }
+#else
dev_details.cs0_device_details =
dev_details_user_provided->cs0_device_details;
dev_details.cs1_device_details =
dev_details_user_provided->cs1_device_details;
+#endif
/* Return if no devices on this EMIF */
if (!dev_details.cs0_device_details &&
!dev_details.cs1_device_details) {
diff --git a/arch/arm/cpu/armv7/omap4/sdram_elpida.c b/arch/arm/cpu/armv7/omap4/sdram_elpida.c
index e7d2bd5..8dfe6f9 100644
--- a/arch/arm/cpu/armv7/omap4/sdram_elpida.c
+++ b/arch/arm/cpu/armv7/omap4/sdram_elpida.c
@@ -86,10 +86,8 @@ const struct dmm_lisa_map_regs lisa_map_2G_x_2_x_2 = {
.dmm_lisa_map_3 = 0x80640300
};
-void emif_get_reg_dump_sdp(const struct emif_regs **emif1_regs,
- const struct emif_regs **emif2_regs)
-
-#else
+#elif !defined(CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION) || \
+ !defined(CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS)
static const struct lpddr2_ac_timings timings_elpida_400_mhz = {
.max_freq = 400000000,
@@ -245,7 +243,8 @@ static void emif_get_dmm_regs_sdp(const struct dmm_lisa_map_regs
void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs)
__attribute__((weak, alias("emif_get_dmm_regs_sdp")));
-#else
+#elif !defined(CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION) || \
+ !defined(CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS)
static void emif_get_device_details_sdp(
const struct emif_device_details **emif1_details,
diff --git a/include/configs/omap4_sdp4430.h b/include/configs/omap4_sdp4430.h
index c29b184..a4332b7 100644
--- a/include/configs/omap4_sdp4430.h
+++ b/include/configs/omap4_sdp4430.h
@@ -247,6 +247,7 @@
/* Defines for SDRAM init */
#ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
+#define CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION 1
#define CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS 1
#endif
--
1.7.2.3

View File

@ -1,48 +0,0 @@
From fe036a666363c51905cdf9a88d3c21f5e702b35c Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Sat, 26 Feb 2011 17:15:11 +0530
Subject: [PATCH 19/22] armv7: embed u-boot size within u-boot for use from SPL
Embed the u-boot flash image size at a known offset from the
start of u-boot so that SPL can use it while loading u-boot
from a non-XIP media.
Signed-off-by: Aneesh V <aneesh@ti.com>
---
arch/arm/cpu/armv7/start.S | 6 +++++-
spl/board/ti/spl-omap.lds | 1 +
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index f5f08d9..1cbd128 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -64,8 +64,12 @@ _pad: .word 0x12345678 /* now 16*4=64 */
.global _end_vect
_end_vect:
+.global _u_boot_size
+_u_boot_size:
+ .word 0xDEADBEEF
+ .word __flash_image_end - _start
- .balignl 16,0xdeadbeef
+.balignl 16,0xdeadbeef
/*************************************************************************
*
* Startup Code (reset vector)
diff --git a/spl/board/ti/spl-omap.lds b/spl/board/ti/spl-omap.lds
index 27b5295..64eb4c9 100644
--- a/spl/board/ti/spl-omap.lds
+++ b/spl/board/ti/spl-omap.lds
@@ -50,6 +50,7 @@ SECTIONS
.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
. = ALIGN(4);
__image_copy_end = .;
+ __flash_image_end = .;
.bss :
{
--
1.7.2.3

View File

@ -1,245 +0,0 @@
From 8ead31f9eee7c63b1679c387af98b834f2123b6d Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Thu, 17 Feb 2011 18:02:44 +0530
Subject: [PATCH 20/22] omap: add MMC support to SPL
Signed-off-by: Aneesh V <aneesh@ti.com>
---
arch/arm/cpu/armv7/start.S | 1 +
arch/arm/include/asm/omap_common.h | 4 +
include/configs/omap4_sdp4430.h | 7 ++-
spl/board/ti/sdp4430/Makefile | 35 +++++++++++
spl/board/ti/spl-omap.c | 112 +++++++++++++++++++++++++++++++++++-
5 files changed, 156 insertions(+), 3 deletions(-)
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 1cbd128..927476c 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -64,6 +64,7 @@ _pad: .word 0x12345678 /* now 16*4=64 */
.global _end_vect
_end_vect:
+/* This label should be at the same location for SPL and U-Boot */
.global _u_boot_size
_u_boot_size:
.word 0xDEADBEEF
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 9f2616c..c2efa7c 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -99,4 +99,8 @@ u32 omap_boot_device(void);
u32 omap_boot_mode(void);
void preloader_console_init(void);
+/* symbols from start.S */
+extern u32 _u_boot_size;
+extern u32 _start;
+
#endif /* _OMAP_COMMON_H_ */
diff --git a/include/configs/omap4_sdp4430.h b/include/configs/omap4_sdp4430.h
index a4332b7..0ed474d 100644
--- a/include/configs/omap4_sdp4430.h
+++ b/include/configs/omap4_sdp4430.h
@@ -257,7 +257,10 @@
#define CONFIG_SYS_SPL_MAX_SIZE 0x7800 /* 30 K */
#define CONFIG_SYS_SPL_STACK LOW_LEVEL_SRAM_STACK
-#define CONFIG_SYS_SPL_BSS_START_ADDR 0x80000000
-#define CONFIG_SYS_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
+#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
+
+#define CONFIG_SYS_SPL_BSS_START_ADDR 0x80000000
+#define CONFIG_SYS_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
#endif /* __CONFIG_H */
diff --git a/spl/board/ti/sdp4430/Makefile b/spl/board/ti/sdp4430/Makefile
index d89dea0..18c5b8e 100644
--- a/spl/board/ti/sdp4430/Makefile
+++ b/spl/board/ti/sdp4430/Makefile
@@ -68,6 +68,41 @@ $(obj)ctype.c:
COBJS += serial.o ns16550.o string.o vsprintf.o console.o stdio.o
COBJS += ctype.o eabi_compat.o div64.o
+
+# mmc
+$(obj)mmc.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/mmc/mmc.c $@
+
+$(obj)omap_hsmmc.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/mmc/omap_hsmmc.c $@
+
+$(obj)omap24xx_i2c.c: $(obj)omap24xx_i2c.h
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/i2c/omap24xx_i2c.c $@
+
+$(obj)omap24xx_i2c.h:
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/i2c/omap24xx_i2c.h $@
+
+$(obj)time.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/lib/time.c $@
+
+$(obj)part.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/disk/part.c $@
+
+$(obj)part_dos.c: $(obj)part_dos.h
+ @rm -f $@
+ @ln -s $(TOPDIR)/disk/part_dos.c $@
+
+$(obj)part_dos.h:
+ @rm -f $@
+ @ln -s $(TOPDIR)/disk/part_dos.h $@
+
+COBJS += omap_hsmmc.o omap24xx_i2c.o mmc.o time.o part.o part_dos.o
# armv7
$(obj)start.S:
@rm -f $@
diff --git a/spl/board/ti/spl-omap.c b/spl/board/ti/spl-omap.c
index 57ddb7d..b64eac9 100644
--- a/spl/board/ti/spl-omap.c
+++ b/spl/board/ti/spl-omap.c
@@ -28,24 +28,134 @@
#include <common.h>
#include <asm/u-boot.h>
#include <asm/arch/sys_proto.h>
+#include <mmc.h>
#include <timestamp_autogenerated.h>
+#include <asm/omap_common.h>
+#include <asm/arch/mmc_host_def.h>
+#include <i2c.h>
/* Define global data structure pointer to it*/
gd_t gdata __attribute__ ((section(".data")));
bd_t bdata __attribute__ ((section(".data")));
gd_t *gd = &gdata;
+typedef void (*u_boot_entry_t)(void)__attribute__ ((noreturn));
+
void board_init_f(ulong dummy)
{
relocate_code(CONFIG_SYS_SPL_STACK, &gdata, CONFIG_SYS_SPL_TEXT_BASE);
}
-void board_init_r(gd_t *id, ulong dummy)
+inline void hang(void)
{
+ puts("### ERROR ### Please RESET the board ###\n");
for (;;)
;
}
+#ifdef CONFIG_GENERIC_MMC
+int board_mmc_init(bd_t *bis)
+{
+ omap_mmc_init(0);
+ omap_mmc_init(1);
+ return 0;
+}
+#endif
+
+static void mmc_load_uboot_raw(struct mmc *mmc, u32 mmc_dev)
+{
+ u32 u_boot_size_sectors, err;
+ u32 *u_boot_size = (u32 *)(CONFIG_SYS_TEXT_BASE +
+ (u32) &_u_boot_size - (u32) &_start);
+
+ /* read one sector first to find u-boot size */
+ err = mmc->block_dev.block_read(mmc_dev,
+ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, 1,
+ (void *)CONFIG_SYS_TEXT_BASE);
+ if (err <= 0)
+ goto end;
+
+ if (*u_boot_size != 0xDEADBEEF) {
+ err = 0xDEADBEEF;
+ goto end;
+ }
+
+ /* move to the next word that has size */
+ u_boot_size++;
+
+ /*
+ * convert size to sectors - round down is fine because we have
+ * already read 1 sector
+ */
+ u_boot_size_sectors = *u_boot_size/MMCSD_SECTOR_SIZE;
+ debug("spl: u-boot raw sectors - %d\n", u_boot_size_sectors + 1);
+ /* read one sector first to find u-boot size */
+ err = mmc->block_dev.block_read(mmc_dev,
+ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR + 1,
+ u_boot_size_sectors,
+ (void *)(CONFIG_SYS_TEXT_BASE + MMCSD_SECTOR_SIZE));
+end:
+ if (err <= 0) {
+ printf("spl: mmc blk read err - %d\n", err);
+ hang();
+ }
+}
+
+static void mmc_load_uboot(u32 mmc_dev)
+{
+ struct mmc *mmc;
+ int err;
+ u32 boot_mode;
+
+ mmc_initialize(gd->bd);
+ mmc = find_mmc_device(mmc_dev);
+ if (!mmc) {
+ puts("spl: mmc device not found!!\n");
+ hang();
+ }
+
+ err = mmc_init(mmc);
+ if (err) {
+ printf("spl: mmc init failed: mmc_dev - %d err - %d\n",
+ mmc_dev, err);
+ hang();
+ }
+
+ boot_mode = omap_boot_mode();
+ if (boot_mode == MMCSD_MODE_RAW)
+ mmc_load_uboot_raw(mmc, mmc_dev);
+ else {
+ puts("spl: wrong MMC boot mode\n");
+ hang();
+ }
+}
+
+void board_init_r(gd_t *id, ulong dummy)
+{
+ u32 boot_device;
+ u_boot_entry_t u_boot_entry = (u_boot_entry_t) CONFIG_SYS_TEXT_BASE;
+
+ timer_init();
+ i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ boot_device = omap_boot_device();
+ switch (boot_device) {
+ case BOOT_DEVICE_MMC1:
+ case BOOT_DEVICE_MMC2:
+ mmc_load_uboot(boot_device - BOOT_DEVICE_MMC1);
+ break;
+ default:
+ printf("SPL: Un-supported Boot Device - %d!!!\n", boot_device);
+ hang();
+ break;
+ }
+
+ /*
+ * Jump to u-boot with magic number as input to indicate that it
+ * was loaded by SPL
+ */
+ u_boot_entry();
+}
+
void preloader_console_init(void)
{
gd->bd = &bdata;
--
1.7.2.3

View File

@ -1,93 +0,0 @@
From 2b9e1ea9f94b94388345a1b74d2ecf6b4f9be1c1 Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Thu, 17 Feb 2011 18:07:08 +0530
Subject: [PATCH 21/22] omap: spl: add FAT support over MMC
Signed-off-by: Aneesh V <aneesh@ti.com>
---
include/configs/omap4_sdp4430.h | 1 +
spl/board/ti/sdp4430/Makefile | 8 ++++++++
spl/board/ti/spl-omap.c | 22 ++++++++++++++++++++++
3 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/include/configs/omap4_sdp4430.h b/include/configs/omap4_sdp4430.h
index 0ed474d..dcc9e39 100644
--- a/include/configs/omap4_sdp4430.h
+++ b/include/configs/omap4_sdp4430.h
@@ -259,6 +259,7 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
+#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
#define CONFIG_SYS_SPL_BSS_START_ADDR 0x80000000
#define CONFIG_SYS_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
diff --git a/spl/board/ti/sdp4430/Makefile b/spl/board/ti/sdp4430/Makefile
index 18c5b8e..8310db9 100644
--- a/spl/board/ti/sdp4430/Makefile
+++ b/spl/board/ti/sdp4430/Makefile
@@ -103,6 +103,14 @@ $(obj)part_dos.h:
@ln -s $(TOPDIR)/disk/part_dos.h $@
COBJS += omap_hsmmc.o omap24xx_i2c.o mmc.o time.o part.o part_dos.o
+
+# fat
+$(obj)fat.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/fs/fat/fat.c $@
+
+COBJS += fat.o
+
# armv7
$(obj)start.S:
@rm -f $@
diff --git a/spl/board/ti/spl-omap.c b/spl/board/ti/spl-omap.c
index b64eac9..3612434 100644
--- a/spl/board/ti/spl-omap.c
+++ b/spl/board/ti/spl-omap.c
@@ -29,6 +29,7 @@
#include <asm/u-boot.h>
#include <asm/arch/sys_proto.h>
#include <mmc.h>
+#include <fat.h>
#include <timestamp_autogenerated.h>
#include <asm/omap_common.h>
#include <asm/arch/mmc_host_def.h>
@@ -101,6 +102,25 @@ end:
}
}
+static void mmc_load_uboot_fat(struct mmc *mmc)
+{
+ s32 err;
+
+ err = fat_register_device(&mmc->block_dev,
+ CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION);
+ if (err) {
+ printf("spl: fat register err - %d\n", err);
+ hang();
+ }
+
+ err = file_fat_read("u-boot.bin", (u8 *)CONFIG_SYS_TEXT_BASE, 0);
+
+ if (err <= 0) {
+ printf("spl: error reading u-boot.bin - %d\n", err);
+ hang();
+ }
+}
+
static void mmc_load_uboot(u32 mmc_dev)
{
struct mmc *mmc;
@@ -124,6 +144,8 @@ static void mmc_load_uboot(u32 mmc_dev)
boot_mode = omap_boot_mode();
if (boot_mode == MMCSD_MODE_RAW)
mmc_load_uboot_raw(mmc, mmc_dev);
+ else if (boot_mode == MMCSD_MODE_FAT)
+ mmc_load_uboot_fat(mmc);
else {
puts("spl: wrong MMC boot mode\n");
hang();
--
1.7.2.3

View File

@ -1,303 +0,0 @@
From 1f516cf960c96e77f722706726f273cf3f117d9c Mon Sep 17 00:00:00 2001
From: Aneesh V <aneesh@ti.com>
Date: Fri, 18 Feb 2011 03:24:01 +0530
Subject: [PATCH 22/22] omap4: add spl support for OMAP4 Panda
Signed-off-by: Aneesh V <aneesh@ti.com>
---
arch/arm/include/asm/arch-omap4/emif.h | 10 +-
include/configs/omap4_panda.h | 24 ++++
spl/board/ti/panda/Makefile | 219 ++++++++++++++++++++++++++++++++
3 files changed, 248 insertions(+), 5 deletions(-)
create mode 100644 spl/board/ti/panda/Makefile
diff --git a/arch/arm/include/asm/arch-omap4/emif.h b/arch/arm/include/asm/arch-omap4/emif.h
index 8cc3230..b95e545 100644
--- a/arch/arm/include/asm/arch-omap4/emif.h
+++ b/arch/arm/include/asm/arch-omap4/emif.h
@@ -520,11 +520,11 @@
/* Trap for invalid TILER PAT entries */
#define DMM_LISA_MAP_0_INVAL_ADDR_TRAP (\
- (0 << OMAP44XX_SDRC_ADDR_SHIFT) |\
- (DMM_SDRC_MAP_EMIF1_ONLY << OMAP44XX_SDRC_MAP_SHIFT)|\
- (DMM_SDRC_ADDR_SPC_INVALID << OMAP44XX_SDRC_ADDRSPC_SHIFT)|\
- (DMM_SDRC_INTL_NONE << OMAP44XX_SDRC_INTL_SHIFT)|\
- (0xFF << OMAP44XX_SYS_ADDR_SHIFT))
+ (0 << OMAP44XX_SDRC_ADDR_SHIFT) |\
+ (DMM_SDRC_MAP_EMIF1_ONLY << OMAP44XX_SDRC_MAP_SHIFT)|\
+ (DMM_SDRC_ADDR_SPC_INVALID << OMAP44XX_SDRC_ADDRSPC_SHIFT)|\
+ (DMM_SDRC_INTL_NONE << OMAP44XX_SDRC_INTL_SHIFT)|\
+ (0xFF << OMAP44XX_SYS_ADDR_SHIFT))
/* Reg mapping structure */
diff --git a/include/configs/omap4_panda.h b/include/configs/omap4_panda.h
index 2b03b0f..b389035 100644
--- a/include/configs/omap4_panda.h
+++ b/include/configs/omap4_panda.h
@@ -117,7 +117,9 @@
/* USB device configuration */
#define CONFIG_USB_DEVICE 1
+#ifndef CONFIG_PRELOADER
#define CONFIG_USB_TTY 1
+#endif
#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1
/* Flash */
@@ -234,4 +236,26 @@
CONFIG_SYS_INIT_RAM_SIZE - \
GENERATED_GBL_DATA_SIZE)
+/* Defines for Clock init */
+#define CONFIG_SYS_OMAP4_ABE_SYSCK
+
+/* Defines for SDRAM init */
+#ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
+#define CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION 1
+#define CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS 1
+#endif
+
+/* Defines for SPL */
+#define CONFIG_SPL
+#define CONFIG_SYS_SPL_TEXT_BASE 0x40304360
+#define CONFIG_SYS_SPL_MAX_SIZE 0x7800 /* 30 K */
+#define CONFIG_SYS_SPL_STACK LOW_LEVEL_SRAM_STACK
+
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
+#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
+#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
+
+#define CONFIG_SYS_SPL_BSS_START_ADDR 0x80000000
+#define CONFIG_SYS_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
+
#endif /* __CONFIG_H */
diff --git a/spl/board/ti/panda/Makefile b/spl/board/ti/panda/Makefile
new file mode 100644
index 0000000..8310db9
--- /dev/null
+++ b/spl/board/ti/panda/Makefile
@@ -0,0 +1,219 @@
+#
+# (C) Copyright 2006-2007
+# Stefan Roese, DENX Software Engineering, sr@denx.de.
+#
+# (C) Copyright 2008
+# Guennadi Liakhovetki, DENX Software Engineering, <lg@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
+#
+splobj := $(OBJTREE)/spl/
+include $(TOPDIR)/config.mk
+SOBJS =
+COBJS =
+
+# serial console
+$(obj)eabi_compat.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/lib/eabi_compat.c $@
+
+$(obj)string.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/lib/string.c $@
+
+$(obj)vsprintf.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/lib/vsprintf.c $@
+
+$(obj)console.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/common/console.c $@
+
+$(obj)stdio.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/common/stdio.c $@
+
+$(obj)serial.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/serial/serial.c $@
+
+$(obj)ns16550.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/serial/ns16550.c $@
+
+$(obj)div64.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/lib/div64.c $@
+
+$(obj)ctype.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/lib/ctype.c $@
+
+COBJS += serial.o ns16550.o string.o vsprintf.o console.o stdio.o
+COBJS += ctype.o eabi_compat.o div64.o
+
+
+# mmc
+$(obj)mmc.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/mmc/mmc.c $@
+
+$(obj)omap_hsmmc.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/mmc/omap_hsmmc.c $@
+
+$(obj)omap24xx_i2c.c: $(obj)omap24xx_i2c.h
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/i2c/omap24xx_i2c.c $@
+
+$(obj)omap24xx_i2c.h:
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/i2c/omap24xx_i2c.h $@
+
+$(obj)time.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/lib/time.c $@
+
+$(obj)part.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/disk/part.c $@
+
+$(obj)part_dos.c: $(obj)part_dos.h
+ @rm -f $@
+ @ln -s $(TOPDIR)/disk/part_dos.c $@
+
+$(obj)part_dos.h:
+ @rm -f $@
+ @ln -s $(TOPDIR)/disk/part_dos.h $@
+
+COBJS += omap_hsmmc.o omap24xx_i2c.o mmc.o time.o part.o part_dos.o
+
+# fat
+$(obj)fat.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/fs/fat/fat.c $@
+
+COBJS += fat.o
+
+# armv7
+$(obj)start.S:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/start.S $@
+
+$(obj)syslib.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/syslib.c $@
+
+SOBJS += start.o
+COBJS += syslib.o
+
+# omap-common
+$(obj)utils.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap-common/utils.c $@
+
+$(obj)timer.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap-common/timer.c $@
+
+$(obj)reset.S:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap-common/reset.S $@
+
+$(obj)spl-omap.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/spl/board/ti/spl-omap.c $@
+
+SOBJS += reset.o
+COBJS += utils.o timer.o spl-omap.o
+
+$(OBJTREE)/MLO: $(splobj)u-boot-spl.bin
+ $(OBJTREE)/tools/mkimage -T omapimage \
+ -a $(CONFIG_SYS_SPL_TEXT_BASE) -d $< $@
+
+LDSCRIPT_SOURCE = $(TOPDIR)/spl/board/ti/spl-omap.lds
+
+# omap4
+$(obj)lowlevel_init.S:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/lowlevel_init.S $@
+
+$(obj)omap4_mux_data.h:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/omap4_mux_data.h $@
+
+$(obj)board.c:$(obj)omap4_mux_data.h
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/board.c $@
+
+$(obj)emif.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/emif.c $@
+
+$(obj)sdram_elpida.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/sdram_elpida.c $@
+
+$(obj)clocks.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/clocks.c $@
+
+SOBJS += lowlevel_init.o
+COBJS += board.o clocks.o emif.o sdram_elpida.o
+
+# rules
+LDPPFLAGS += -include $(TOPDIR)/include/config.h
+LDSCRIPT = $(splobj)u-boot-spl-generated.lds
+$(LDSCRIPT): $(LDSCRIPT_SOURCE)
+ $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+LDFLAGS = -Bstatic -T $(LDSCRIPT) \
+ $(PLATFORM_LDFLAGS) --gc-sections
+AFLAGS += -DCONFIG_PRELOADER -Os -ffixed-r8
+CFLAGS += -DCONFIG_PRELOADER -Os -ffixed-r8 -ffunction-sections \
+ -fdata-sections -march=armv7-a -mthumb
+PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) \
+ -print-libgcc-file-name`) -lgcc
+
+$(obj)%.o: $(obj)%.S
+ $(CC) $(AFLAGS) -c -o $@ $<
+
+$(obj)%.o: $(obj)%.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
+OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+__OBJS := $(SOBJS) $(COBJS)
+LNDIR := $(OBJTREE)/spl/board/$(BOARDDIR)
+
+$(splobj)u-boot-spl.bin: $(splobj)u-boot-spl
+ $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+
+$(splobj)u-boot-spl: $(OBJS) $(LDSCRIPT)
+ cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
+ $(PLATFORM_LIBGCC) \
+ -Map $(splobj)u-boot-spl.map \
+ -o $(splobj)u-boot-spl
+
+ALL = $(OBJTREE)/MLO
+all: $(obj).depend $(ALL)
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
--
1.7.2.3

View File

@ -96,8 +96,11 @@
# OpenGL(X) implementation to use (no / Mesa)
OPENGL="no"
# OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q / opengl-meson6)
OPENGLES="opengl-meson8"
# OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q / opengl-meson)
OPENGLES="opengl-meson"
# Amlogic Meson SOC family (8 / 6)
MESON_FAMILY="8"
# include uvesafb support (yes / no)
UVESAFB_SUPPORT="no"

View File

@ -90,8 +90,11 @@
# OpenGL(X) implementation to use (no / mesa)
OPENGL="no"
# OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q / opengl-meson6)
OPENGLES="opengl-meson6"
# OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q / opengl-meson)
OPENGLES="opengl-meson"
# Amlogic Meson SOC family (8 / 6)
MESON_FAMILY="6"
# include uvesafb support (yes / no)
UVESAFB_SUPPORT="no"