From: Matt Domsch <Matt_Domsch@dell.com>
To: Andi Kleen <ak@suse.de>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] let EDD work on x86-64 too
Date: Tue, 23 Mar 2004 09:31:42 -0600 [thread overview]
Message-ID: <20040323153142.GA20267@lists.us.dell.com> (raw)
In-Reply-To: <20040316165127.GB6145@wotan.suse.de>
[-- Attachment #1: Type: text/plain, Size: 4450 bytes --]
On Tue, Mar 16, 2004 at 05:51:27PM +0100, Andi Kleen wrote:
> On Tue, Mar 16, 2004 at 10:23:44AM -0600, Matt Domsch wrote:
> > Andi, I'm proposing allowing my BIOS Enhanced Disk Drive (EDD) code to
> > work on x86-64 as it does on x86 today. The patch below moves some
> > files around out of arch/i386/kernel and include/asm-i386 into more
> > generic locations, and allows EDD to work.
>
> I have no problems with the x86-64 changes (assuming they work).
>
> But I won't push the i386 changes. I would suggest you get that into
> mainline first and when it's there send me a patch with just the x86-64
> bits.
The i386 changes have hit 2.6.5-rc2. x86-64 patch below for your
consideration. I'm intentionally not copying the
Documentation/i386/zero_page.txt file as it's the same as x86 in this
regard. This boots and works for me.
Thanks,
Matt
--
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
EDD: Enable x86_64
reserve boot_params space
include arch/i386/boot/edd.S
include EDD in Kconfig and defconfig
reserve global vars in setup.c, copy data
arch/x86_64/Kconfig | 2 ++
arch/x86_64/boot/setup.S | 2 ++
arch/x86_64/defconfig | 1 +
arch/x86_64/kernel/setup.c | 26 ++++++++++++++++++++++++++
include/asm-x86_64/bootsetup.h | 3 +++
5 files changed, 34 insertions(+)
diff -Nru a/include/asm-x86_64/bootsetup.h b/include/asm-x86_64/bootsetup.h
--- a/include/asm-x86_64/bootsetup.h Tue Mar 16 10:03:36 2004
+++ b/include/asm-x86_64/bootsetup.h Tue Mar 16 10:03:36 2004
@@ -26,6 +26,9 @@
#define INITRD_START (*(unsigned int *) (PARAM+0x218))
#define INITRD_SIZE (*(unsigned int *) (PARAM+0x21c))
#define EDID_INFO (*(struct edid_info *) (PARAM+0x440))
+#define DISK80_SIGNATURE (*(unsigned int*) (PARAM+DISK80_SIG_BUFFER))
+#define EDD_NR (*(unsigned char *) (PARAM+EDDNR))
+#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF))
#define COMMAND_LINE saved_command_line
#define COMMAND_LINE_SIZE 256
diff -Nru a/arch/x86_64/boot/setup.S b/arch/x86_64/boot/setup.S
--- a/arch/x86_64/boot/setup.S Tue Mar 16 10:03:36 2004
+++ b/arch/x86_64/boot/setup.S Tue Mar 16 10:03:36 2004
@@ -533,6 +533,8 @@
movw $0xAA, (0x1ff) # device present
no_psmouse:
+#include "../../i386/boot/edd.S"
+
# Now we want to move to protected mode ...
cmpw $0, %cs:realmode_swtch
jz rmodeswtch_normal
diff -Nru a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
--- a/arch/x86_64/Kconfig Tue Mar 16 10:03:36 2004
+++ b/arch/x86_64/Kconfig Tue Mar 16 10:03:36 2004
@@ -397,6 +397,8 @@
source drivers/Kconfig
+source "drivers/firmware/Kconfig"
+
source fs/Kconfig
source "arch/x86_64/oprofile/Kconfig"
diff -Nru a/arch/x86_64/defconfig b/arch/x86_64/defconfig
--- a/arch/x86_64/defconfig Tue Mar 16 10:03:36 2004
+++ b/arch/x86_64/defconfig Tue Mar 16 10:03:36 2004
@@ -136,6 +136,7 @@
#
# Device Drivers
#
+CONFIG_EDD=m
#
# Generic Driver Options
diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
--- a/arch/x86_64/kernel/setup.c Tue Mar 16 10:03:36 2004
+++ b/arch/x86_64/kernel/setup.c Tue Mar 16 10:03:36 2004
@@ -39,6 +39,7 @@
#include <linux/pci.h>
#include <linux/acpi.h>
#include <linux/kallsyms.h>
+#include <linux/edd.h>
#include <asm/mtrr.h>
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -346,6 +347,30 @@
__setup("noreplacement", noreplacement_setup);
+#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
+unsigned char eddnr;
+struct edd_info edd[EDDMAXNR];
+unsigned int edd_disk80_sig;
+#ifdef CONFIG_EDD_MODULE
+EXPORT_SYMBOL(eddnr);
+EXPORT_SYMBOL(edd);
+EXPORT_SYMBOL(edd_disk80_sig);
+#endif
+/**
+ * copy_edd() - Copy the BIOS EDD information
+ * from empty_zero_page into a safe place.
+ *
+ */
+static inline void copy_edd(void)
+{
+ eddnr = EDD_NR;
+ memcpy(edd, EDD_BUF, sizeof(edd));
+ edd_disk80_sig = DISK80_SIGNATURE;
+}
+#else
+#define copy_edd() do {} while (0)
+#endif
+
void __init setup_arch(char **cmdline_p)
{
unsigned long low_mem_size;
@@ -364,6 +389,7 @@
rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0);
#endif
setup_memory_region();
+ copy_edd();
if (!MOUNT_ROOT_RDONLY)
root_mountflags &= ~MS_RDONLY;
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2004-03-23 15:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-16 16:23 [RFC][PATCH] let EDD work on x86-64 too Matt Domsch
2004-03-16 16:51 ` Andi Kleen
2004-03-23 15:31 ` Matt Domsch [this message]
2004-03-23 15:36 ` Andi Kleen
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=20040323153142.GA20267@lists.us.dell.com \
--to=matt_domsch@dell.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.