mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Juergen Beisert <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 02/10] x86: Use the generic linker script initializing
Date: Tue,  8 Mar 2011 15:48:16 +0100	[thread overview]
Message-ID: <1299595704-11733-3-git-send-email-jbe@pengutronix.de> (raw)
In-Reply-To: <1299595704-11733-1-git-send-email-jbe@pengutronix.de>

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
---
 arch/x86/Makefile                             |    6 ++
 arch/x86/include/asm/barebox.lds.h            |  113 -------------------------
 arch/x86/lib/barebox.lds.S                    |    2 +-
 arch/x86/mach-i386/include/mach/barebox.lds.h |   99 ++++++++++++++++++++++
 include/asm-generic/barebox.lds.h             |    2 +-
 scripts/setupmbr/setupmbr.c                   |    2 +-
 6 files changed, 108 insertions(+), 116 deletions(-)
 delete mode 100644 arch/x86/include/asm/barebox.lds.h
 create mode 100644 arch/x86/mach-i386/include/mach/barebox.lds.h

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index e607b89..3b034c0 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -19,7 +19,13 @@ all: $(KBUILD_IMAGE)
 
 
 
+machdirs := $(patsubst %,arch/x86/mach-%/,$(machine-y))
 
+ifeq ($(KBUILD_SRC),)
+CPPFLAGS += $(patsubst %,-I%include,$(machdirs))
+else
+CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
+endif
 
 ifneq ($(board-y),)
 BOARD  := arch/x86/boards/$(board-y)/
diff --git a/arch/x86/include/asm/barebox.lds.h b/arch/x86/include/asm/barebox.lds.h
deleted file mode 100644
index 6cbf15f..0000000
--- a/arch/x86/include/asm/barebox.lds.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2009 Juergen Beisert, Pengutronix
- *
- * 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
- *
- */
-
-/**
- * @file
- * @brief Adapt linker script content in accordance to Kconfig settings
- */
-
-#define INITCALLS			\
-	KEEP(*(.initcall.0))			\
-	KEEP(*(.initcall.1))			\
-	KEEP(*(.initcall.2))			\
-	KEEP(*(.initcall.3))			\
-	KEEP(*(.initcall.4))			\
-	KEEP(*(.initcall.5))			\
-	KEEP(*(.initcall.6))			\
-	KEEP(*(.initcall.7))
-
-#define BAREBOX_CMDS	KEEP(*(SORT_BY_NAME(.barebox_cmd*)))
-
-#define BAREBOX_SYMS	KEEP(*(__usymtab))
-
-/**
- * Area in the MBR of the barebox basic boot code. This offset must be in
- * accordance to the 'indirect_sector_lba' label.
- */
-#define PATCH_AREA 400
-
-/**
- * Offset where to store the boot drive number (BIOS number, 1 byte)
- */
-#define PATCH_AREA_BOOT_DEV 16
-
-/**
- * Offset where to store information about the persistant environment storage
- * It points to an LBA number (8 bytes) and defines the first sector of this
- * storage on disk.
- */
-#define PATCH_AREA_PERS_START 20
-
-/**
- * Offset where to store information about the persistant environment storage
- * It points to a short number (2 bytes) and defines the sector count of this
- * storage on disk.
- */
-#define PATCH_AREA_PERS_SIZE 28
-
-/**
- * Offset where to store information about the persistant environment storage
- * drive number (BIOS number, 1 byte)
- */
-#define PATCH_AREA_PERS_DRIVE 30
-
-/**
- * Mark the persistant environment as not used
- */
-#define PATCH_AREA_PERS_SIZE_UNUSED 0x000
-
-/**
- * Mark a DAPS as unused/invalid
- */
-#define MARK_DAPS_INVALID 0x0000
-
-/**
- * Offset of the partition table in an MBR
- */
-#define OFFSET_OF_PARTITION_TABLE 446
-
-/**
- * Offset of the signature in an MBR
- */
-#define OFFSET_OF_SIGNATURE 510
-
-/**
- * Area where to store indirect sector to loop through. Keep this value
- * in accordance to the 'indirect_area' label. Note: .
- *
- * @attention These addresses are real mode ones (seg:offset)
- */
-#define INDIRECT_AREA 0x7A00
-#define INDIRECT_SEGMENT 0x0000
-
-/**
- * Area where to load sectors from disk to. They should start after the
- * MBR area and must be in accordance to the offset of the '.bootstrapping'
- * section in the linker file.
- *
- * @attention The address must be a multiple of 512.
- */
-#define LOAD_AREA 0x7e00
-#define LOAD_SEGMENT 0x0000
-
-/**
- * Size of one sector.
- */
-#define SECTOR_SIZE 512
diff --git a/arch/x86/lib/barebox.lds.S b/arch/x86/lib/barebox.lds.S
index e0919a6..fffc3a5 100644
--- a/arch/x86/lib/barebox.lds.S
+++ b/arch/x86/lib/barebox.lds.S
@@ -20,7 +20,7 @@
  */
 
 #undef i386
-#include <asm/barebox.lds.h>
+#include <asm-generic/barebox.lds.h>
 
 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
 OUTPUT_ARCH(i386)
diff --git a/arch/x86/mach-i386/include/mach/barebox.lds.h b/arch/x86/mach-i386/include/mach/barebox.lds.h
new file mode 100644
index 0000000..81c326e
--- /dev/null
+++ b/arch/x86/mach-i386/include/mach/barebox.lds.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2009 Juergen Beisert, Pengutronix
+ *
+ * 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
+ *
+ */
+
+/**
+ * @file
+ * @brief Adapt linker script content in accordance to Kconfig settings
+ */
+
+/**
+ * Area in the MBR of the barebox basic boot code. This offset must be in
+ * accordance to the 'indirect_sector_lba' label.
+ */
+#define PATCH_AREA 400
+
+/**
+ * Offset where to store the boot drive number (BIOS number, 1 byte)
+ */
+#define PATCH_AREA_BOOT_DEV 16
+
+/**
+ * Offset where to store information about the persistant environment storage
+ * It points to an LBA number (8 bytes) and defines the first sector of this
+ * storage on disk.
+ */
+#define PATCH_AREA_PERS_START 20
+
+/**
+ * Offset where to store information about the persistant environment storage
+ * It points to a short number (2 bytes) and defines the sector count of this
+ * storage on disk.
+ */
+#define PATCH_AREA_PERS_SIZE 28
+
+/**
+ * Offset where to store information about the persistant environment storage
+ * drive number (BIOS number, 1 byte)
+ */
+#define PATCH_AREA_PERS_DRIVE 30
+
+/**
+ * Mark the persistant environment as not used
+ */
+#define PATCH_AREA_PERS_SIZE_UNUSED 0x000
+
+/**
+ * Mark a DAPS as unused/invalid
+ */
+#define MARK_DAPS_INVALID 0x0000
+
+/**
+ * Offset of the partition table in an MBR
+ */
+#define OFFSET_OF_PARTITION_TABLE 446
+
+/**
+ * Offset of the signature in an MBR
+ */
+#define OFFSET_OF_SIGNATURE 510
+
+/**
+ * Area where to store indirect sector to loop through. Keep this value
+ * in accordance to the 'indirect_area' label. Note: .
+ *
+ * @attention These addresses are real mode ones (seg:offset)
+ */
+#define INDIRECT_AREA 0x7A00
+#define INDIRECT_SEGMENT 0x0000
+
+/**
+ * Area where to load sectors from disk to. They should start after the
+ * MBR area and must be in accordance to the offset of the '.bootstrapping'
+ * section in the linker file.
+ *
+ * @attention The address must be a multiple of 512.
+ */
+#define LOAD_AREA 0x7e00
+#define LOAD_SEGMENT 0x0000
+
+/**
+ * Size of one sector.
+ */
+#define SECTOR_SIZE 512
diff --git a/include/asm-generic/barebox.lds.h b/include/asm-generic/barebox.lds.h
index fc141a4..2d1dc41 100644
--- a/include/asm-generic/barebox.lds.h
+++ b/include/asm-generic/barebox.lds.h
@@ -1,5 +1,5 @@
 
-#if defined CONFIG_ARCH_IMX25 || defined CONFIG_ARCH_IMX35 || defined CONFIG_ARCH_IMX51
+#if defined CONFIG_ARCH_IMX25 || defined CONFIG_ARCH_IMX35 || defined CONFIG_ARCH_IMX51 || defined CONFIG_X86
 #include <mach/barebox.lds.h>
 #endif
 
diff --git a/scripts/setupmbr/setupmbr.c b/scripts/setupmbr/setupmbr.c
index dd7f38c..74ede94 100644
--- a/scripts/setupmbr/setupmbr.c
+++ b/scripts/setupmbr/setupmbr.c
@@ -43,7 +43,7 @@
 
 /* include the info from this barebox release */
 #include "../../include/generated/utsrelease.h"
-#include "../../arch/x86/include/asm/barebox.lds.h"
+#include "../../arch/x86/mach-i386/include/mach/barebox.lds.h"
 
 /** define to disable integrity tests and debug messages */
 #define NDEBUG
-- 
1.7.2.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2011-03-08 14:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08 14:48 [PATCH] Various fixes to make barebox's x86 support working again Juergen Beisert
2011-03-08 14:48 ` [PATCH 01/10] x86: Remove not used expressions from the makefile Juergen Beisert
2011-03-08 14:48 ` Juergen Beisert [this message]
2011-03-08 14:48 ` [PATCH 03/10] x86 ATA: Don't touch the size entry for the BIOS disk based device Juergen Beisert
2011-03-08 14:48 ` [PATCH 04/10] x86 Generic platform: Fix some typos Juergen Beisert
2011-03-08 14:48 ` [PATCH 05/10] x86 Generic platform: Fix disk drive name Juergen Beisert
2011-03-08 14:48 ` [PATCH 06/10] x86 Generic platform: Fix prompt name Juergen Beisert
2011-03-08 14:48 ` [PATCH 07/10] x86: Remove 'uboot' from file names Juergen Beisert
2011-03-08 14:48 ` [PATCH 08/10] Change 'linux16' command to use getopt() Juergen Beisert
2011-03-08 14:48 ` [PATCH 09/10] LINUX16: Add selection of the VESA video mode Juergen Beisert
2011-03-08 14:48 ` [PATCH 10/10] LINUX16: Fix warning Juergen Beisert
  -- strict thread matches above, loose matches on Subject: below --
2011-01-07  8:35 Various fixes to make barebox's x86 support working again Juergen Beisert
2011-01-07  8:35 ` [PATCH 02/10] x86: Use the generic linker script initializing Juergen Beisert

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=1299595704-11733-3-git-send-email-jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

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

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