* PATCH: Make pci-bios function ids per machine type
@ 2003-03-21 20:30 Alan Cox
2003-03-21 21:00 ` Brian Gerst
0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2003-03-21 20:30 UTC (permalink / raw)
To: linux-kernel, torvalds
Yes NEC use *different* function numbers!!
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/arch/i386/pci/pcbios.c linux-2.5.65-ac2/arch/i386/pci/pcbios.c
--- linux-2.5.65/arch/i386/pci/pcbios.c 2003-02-10 18:37:58.000000000 +0000
+++ linux-2.5.65-ac2/arch/i386/pci/pcbios.c 2003-02-14 23:04:05.000000000 +0000
@@ -5,22 +5,9 @@
#include <linux/pci.h>
#include <linux/init.h>
#include "pci.h"
+#include "pci-functions.h"
-#define PCIBIOS_PCI_FUNCTION_ID 0xb1XX
-#define PCIBIOS_PCI_BIOS_PRESENT 0xb101
-#define PCIBIOS_FIND_PCI_DEVICE 0xb102
-#define PCIBIOS_FIND_PCI_CLASS_CODE 0xb103
-#define PCIBIOS_GENERATE_SPECIAL_CYCLE 0xb106
-#define PCIBIOS_READ_CONFIG_BYTE 0xb108
-#define PCIBIOS_READ_CONFIG_WORD 0xb109
-#define PCIBIOS_READ_CONFIG_DWORD 0xb10a
-#define PCIBIOS_WRITE_CONFIG_BYTE 0xb10b
-#define PCIBIOS_WRITE_CONFIG_WORD 0xb10c
-#define PCIBIOS_WRITE_CONFIG_DWORD 0xb10d
-#define PCIBIOS_GET_ROUTING_OPTIONS 0xb10e
-#define PCIBIOS_SET_PCI_HW_INT 0xb10f
-
/* BIOS32 signature: "_32_" */
#define BIOS32_SIGNATURE (('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24))
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/include/asm-i386/mach-default/pci-functions.h linux-2.5.65-ac2/include/asm-i386/mach-default/pci-functions.h
--- linux-2.5.65/include/asm-i386/mach-default/pci-functions.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.5.65-ac2/include/asm-i386/mach-default/pci-functions.h 2003-02-14 22:54:22.000000000 +0000
@@ -0,0 +1,19 @@
+/*
+ * PCI BIOS function numbering for conventional PCI BIOS
+ * systems
+ */
+
+#define PCIBIOS_PCI_FUNCTION_ID 0xb1XX
+#define PCIBIOS_PCI_BIOS_PRESENT 0xb101
+#define PCIBIOS_FIND_PCI_DEVICE 0xb102
+#define PCIBIOS_FIND_PCI_CLASS_CODE 0xb103
+#define PCIBIOS_GENERATE_SPECIAL_CYCLE 0xb106
+#define PCIBIOS_READ_CONFIG_BYTE 0xb108
+#define PCIBIOS_READ_CONFIG_WORD 0xb109
+#define PCIBIOS_READ_CONFIG_DWORD 0xb10a
+#define PCIBIOS_WRITE_CONFIG_BYTE 0xb10b
+#define PCIBIOS_WRITE_CONFIG_WORD 0xb10c
+#define PCIBIOS_WRITE_CONFIG_DWORD 0xb10d
+#define PCIBIOS_GET_ROUTING_OPTIONS 0xb10e
+#define PCIBIOS_SET_PCI_HW_INT 0xb10f
+
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/include/asm-i386/mach-pc9800/pci-functions.h linux-2.5.65-ac2/include/asm-i386/mach-pc9800/pci-functions.h
--- linux-2.5.65/include/asm-i386/mach-pc9800/pci-functions.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.5.65-ac2/include/asm-i386/mach-pc9800/pci-functions.h 2003-02-14 23:00:56.000000000 +0000
@@ -0,0 +1,20 @@
+/*
+ * PCI BIOS function codes for the PC9800. Different to
+ * standard PC systems
+ */
+
+/* Note: PC-9800 confirms PCI 2.1 on only few models */
+
+#define PCIBIOS_PCI_FUNCTION_ID 0xccXX
+#define PCIBIOS_PCI_BIOS_PRESENT 0xcc81
+#define PCIBIOS_FIND_PCI_DEVICE 0xcc82
+#define PCIBIOS_FIND_PCI_CLASS_CODE 0xcc83
+/* PCIBIOS_GENERATE_SPECIAL_CYCLE 0xcc86 (not supported by bios) */
+#define PCIBIOS_READ_CONFIG_BYTE 0xcc88
+#define PCIBIOS_READ_CONFIG_WORD 0xcc89
+#define PCIBIOS_READ_CONFIG_DWORD 0xcc8a
+#define PCIBIOS_WRITE_CONFIG_BYTE 0xcc8b
+#define PCIBIOS_WRITE_CONFIG_WORD 0xcc8c
+#define PCIBIOS_WRITE_CONFIG_DWORD 0xcc8d
+#define PCIBIOS_GET_ROUTING_OPTIONS 0xcc8e /* PCI 2.1 only */
+#define PCIBIOS_SET_PCI_HW_INT 0xcc8f /* PCI 2.1 only */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: Make pci-bios function ids per machine type
2003-03-21 20:30 PATCH: Make pci-bios function ids per machine type Alan Cox
@ 2003-03-21 21:00 ` Brian Gerst
2003-03-22 2:04 ` Alan Cox
0 siblings, 1 reply; 3+ messages in thread
From: Brian Gerst @ 2003-03-21 21:00 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-kernel, torvalds
Wouldn't this be better?
#ifdef CONFIG_PC9800
#define PCIBIOS_PCI_FUNCTION_ID 0xcc80
#else
#define PCIBIOS_PCI_FUNCTION_ID 0xb100
#endif
#define PCIBIOS_PCI_BIOS_PRESENT PCIBIOS_PCI_FUNCTION_ID+1
#define PCIBIOS_FIND_PCI_DEVICE PCIBIOS_PCI_FUNCTION_ID+2
...
Alan Cox wrote:
> Yes NEC use *different* function numbers!!
>
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/arch/i386/pci/pcbios.c linux-2.5.65-ac2/arch/i386/pci/pcbios.c
> --- linux-2.5.65/arch/i386/pci/pcbios.c 2003-02-10 18:37:58.000000000 +0000
> +++ linux-2.5.65-ac2/arch/i386/pci/pcbios.c 2003-02-14 23:04:05.000000000 +0000
> @@ -5,22 +5,9 @@
> #include <linux/pci.h>
> #include <linux/init.h>
> #include "pci.h"
> +#include "pci-functions.h"
>
>
> -#define PCIBIOS_PCI_FUNCTION_ID 0xb1XX
> -#define PCIBIOS_PCI_BIOS_PRESENT 0xb101
> -#define PCIBIOS_FIND_PCI_DEVICE 0xb102
> -#define PCIBIOS_FIND_PCI_CLASS_CODE 0xb103
> -#define PCIBIOS_GENERATE_SPECIAL_CYCLE 0xb106
> -#define PCIBIOS_READ_CONFIG_BYTE 0xb108
> -#define PCIBIOS_READ_CONFIG_WORD 0xb109
> -#define PCIBIOS_READ_CONFIG_DWORD 0xb10a
> -#define PCIBIOS_WRITE_CONFIG_BYTE 0xb10b
> -#define PCIBIOS_WRITE_CONFIG_WORD 0xb10c
> -#define PCIBIOS_WRITE_CONFIG_DWORD 0xb10d
> -#define PCIBIOS_GET_ROUTING_OPTIONS 0xb10e
> -#define PCIBIOS_SET_PCI_HW_INT 0xb10f
> -
> /* BIOS32 signature: "_32_" */
> #define BIOS32_SIGNATURE (('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24))
>
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/include/asm-i386/mach-default/pci-functions.h linux-2.5.65-ac2/include/asm-i386/mach-default/pci-functions.h
> --- linux-2.5.65/include/asm-i386/mach-default/pci-functions.h 1970-01-01 01:00:00.000000000 +0100
> +++ linux-2.5.65-ac2/include/asm-i386/mach-default/pci-functions.h 2003-02-14 22:54:22.000000000 +0000
> @@ -0,0 +1,19 @@
> +/*
> + * PCI BIOS function numbering for conventional PCI BIOS
> + * systems
> + */
> +
> +#define PCIBIOS_PCI_FUNCTION_ID 0xb1XX
> +#define PCIBIOS_PCI_BIOS_PRESENT 0xb101
> +#define PCIBIOS_FIND_PCI_DEVICE 0xb102
> +#define PCIBIOS_FIND_PCI_CLASS_CODE 0xb103
> +#define PCIBIOS_GENERATE_SPECIAL_CYCLE 0xb106
> +#define PCIBIOS_READ_CONFIG_BYTE 0xb108
> +#define PCIBIOS_READ_CONFIG_WORD 0xb109
> +#define PCIBIOS_READ_CONFIG_DWORD 0xb10a
> +#define PCIBIOS_WRITE_CONFIG_BYTE 0xb10b
> +#define PCIBIOS_WRITE_CONFIG_WORD 0xb10c
> +#define PCIBIOS_WRITE_CONFIG_DWORD 0xb10d
> +#define PCIBIOS_GET_ROUTING_OPTIONS 0xb10e
> +#define PCIBIOS_SET_PCI_HW_INT 0xb10f
> +
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/include/asm-i386/mach-pc9800/pci-functions.h linux-2.5.65-ac2/include/asm-i386/mach-pc9800/pci-functions.h
> --- linux-2.5.65/include/asm-i386/mach-pc9800/pci-functions.h 1970-01-01 01:00:00.000000000 +0100
> +++ linux-2.5.65-ac2/include/asm-i386/mach-pc9800/pci-functions.h 2003-02-14 23:00:56.000000000 +0000
> @@ -0,0 +1,20 @@
> +/*
> + * PCI BIOS function codes for the PC9800. Different to
> + * standard PC systems
> + */
> +
> +/* Note: PC-9800 confirms PCI 2.1 on only few models */
> +
> +#define PCIBIOS_PCI_FUNCTION_ID 0xccXX
> +#define PCIBIOS_PCI_BIOS_PRESENT 0xcc81
> +#define PCIBIOS_FIND_PCI_DEVICE 0xcc82
> +#define PCIBIOS_FIND_PCI_CLASS_CODE 0xcc83
> +/* PCIBIOS_GENERATE_SPECIAL_CYCLE 0xcc86 (not supported by bios) */
> +#define PCIBIOS_READ_CONFIG_BYTE 0xcc88
> +#define PCIBIOS_READ_CONFIG_WORD 0xcc89
> +#define PCIBIOS_READ_CONFIG_DWORD 0xcc8a
> +#define PCIBIOS_WRITE_CONFIG_BYTE 0xcc8b
> +#define PCIBIOS_WRITE_CONFIG_WORD 0xcc8c
> +#define PCIBIOS_WRITE_CONFIG_DWORD 0xcc8d
> +#define PCIBIOS_GET_ROUTING_OPTIONS 0xcc8e /* PCI 2.1 only */
> +#define PCIBIOS_SET_PCI_HW_INT 0xcc8f /* PCI 2.1 only */
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: Make pci-bios function ids per machine type
2003-03-21 21:00 ` Brian Gerst
@ 2003-03-22 2:04 ` Alan Cox
0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2003-03-22 2:04 UTC (permalink / raw)
To: Brian Gerst; +Cc: Linux Kernel Mailing List, Linus Torvalds
On Fri, 2003-03-21 at 21:00, Brian Gerst wrote:
> Wouldn't this be better?
>
> #ifdef CONFIG_PC9800
> #define PCIBIOS_PCI_FUNCTION_ID 0xcc80
> #else
> #define PCIBIOS_PCI_FUNCTION_ID 0xb100
> #endif
>
> #define PCIBIOS_PCI_BIOS_PRESENT PCIBIOS_PCI_FUNCTION_ID+1
> #define PCIBIOS_FIND_PCI_DEVICE PCIBIOS_PCI_FUNCTION_ID+2
We went for the less ifdef approach. We have mach-foo and it works very
well. If you look at the original you'll also see only some functions
exist on the 9800 so its also better because using an unsupported function
is a compile error not a crash.
We may also yet find other pci bios stuff is weird 8)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-03-22 0:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-21 20:30 PATCH: Make pci-bios function ids per machine type Alan Cox
2003-03-21 21:00 ` Brian Gerst
2003-03-22 2:04 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®