aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/ti/am335x/header.h
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2013-05-29 16:42:35 +0200
committerRonald G. Minnich <rminnich@gmail.com>2013-06-10 17:53:50 +0200
commitddbfc645c2fb9c2aab55c9d5f7c55fa80fd8da64 (patch)
treeadcd057f8641feacc529ac48fc268e258fa76353 /src/cpu/ti/am335x/header.h
parentb7d81e05bb3e4058cbb28adcc5af0bdccfe88337 (diff)
am335x: Build an omap style header and an image with it at the front.
Loading on an OMAP SOC requires that the first sector of the image have a configuration header, and, when not an execute in place image, an additional header which describes how big the image is and where it should be loaded. This change adds some infrastructure to statically build that header using C code, and to paste the header onto the front of coreboot.rom in a new top level target file called MLO. The configuration header we're using is as inert as possible, in line with what U-Boot is doing. I think it could be used to give additional configuration parameters to the built-in ROM on the SOC, but we don't need to do that, and there didn't seem to be any actual documentation how to do that. Because the header is built from C and is defined per CPU, it would be possible to include extra settings in other CPUs if desired. Adding a new top level build target is a bit disruptive, but should be contained to the am335x directory and not interfere with other mainboards. Change-Id: I06d346a4050c20963b3c7c6e8a152070bf2d145a Signed-off-by: Gabe Black <gabeblack@chromium.org> Reviewed-on: http://review.coreboot.org/3332 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/cpu/ti/am335x/header.h')
-rw-r--r--src/cpu/ti/am335x/header.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/cpu/ti/am335x/header.h b/src/cpu/ti/am335x/header.h
new file mode 100644
index 0000000000..84afd3561b
--- /dev/null
+++ b/src/cpu/ti/am335x/header.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2013 Google Inc.
+ *
+ * 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 __CPU_TI_AM335X_HEADER_H
+#define __CPU_TI_AM335X_HEADER_H
+
+#include <stdint.h>
+
+struct configuration_header_toc_item {
+ // Offset from the start address of the TOC to the actual address of
+ // a section.
+ uint32_t start;
+
+ // Size of a section.
+ uint32_t size;
+
+ // Reserved.
+ uint32_t reserved[3];
+
+ // 12-character name of a section, including the zero (\0) terminator.
+ char filename[12];
+} __attribute__((packed));
+
+struct configuration_header_settings {
+ // Key used for section verification.
+ uint32_t key;
+
+ // Enables or disables the section.
+ // 00h: Disable.
+ // Other: Enable.
+ uint8_t valid;
+
+ // Configuration header version.
+ uint8_t version;
+
+ // Reserved.
+ uint16_t reserved;
+
+ // Flags. It's not clear what this is used for.
+ uint32_t flags;
+} __attribute__((packed));
+
+struct gp_device_header {
+ // Size of the image.
+ uint32_t size;
+
+ // Address to store the image/code entry point.
+ uint32_t destination;
+} __attribute__((packed));
+
+#endif