generic and HP zx1 system types
Subsystems (3)
PATCH 1/1 generic and HP zx1 system types
This patch against 2.4.18+ia64-020226 makes the IA64 "generic" kernel work and adds an HP "zx1" system type. The generic kernel is intended to boot on any IA64 machine and selects an appropriate machine_vector based on acpi_get_sysname(). Kernels built for other system types select the machine_vector at compile-time.
We moved the hpsim files into a subdirectory, so to make the patch more readable, the first bit is shell commands to do the renames. Use something like "sh ../machvec; patch -p1 < ../machvec" to apply it.
One bit of ugliness that we hope is only temporary is that there is no good way to use ACPI functionality outside of drivers/acpi; we had to add a whole list of "#include "../drivers/acpi/include/..." in hpzx1_misc.c and kernel/acpi.c. I've been told this is fixed in recent ACPI patches, but haven't seen it myself.
This is mostly the work of Alex Williamson ([email protected]) and Matthew Wilcox ([email protected]); I'm just trying to shepherd the changes upstream.
Signature · 3 lines
Bjorn Helgaas - [email protected] Linux Systems Operation R&D Hewlett-Packard
Documentation/Configure.help | 8 arch/ia64/Makefile | 20 arch/ia64/config.in | 3 arch/ia64/dig/setup.c | 2 arch/ia64/hp/Makefile | 20 arch/ia64/hp/common/Makefile | 14 arch/ia64/hp/common/sba_iommu.c | 1850 +++++++++++++++++++++++++++++++++++++++ arch/ia64/hp/sim/Makefile | 13 arch/ia64/hp/zx1/Makefile | 13 arch/ia64/hp/zx1/hpzx1_machvec.c | 2 arch/ia64/hp/zx1/hpzx1_misc.c | 400 ++++++++ arch/ia64/kernel/Makefile | 1 arch/ia64/kernel/acpi.c | 104 ++ arch/ia64/kernel/ia64_ksyms.c | 7 arch/ia64/kernel/irq.c | 17 arch/ia64/kernel/setup.c | 2 arch/ia64/mm/tlb.c | 2 drivers/acpi/acpiconf.c | 2 drivers/pci/pci.ids | 3 include/asm-ia64/hw_irq.h | 2 include/asm-ia64/machvec.h | 4 include/asm-ia64/machvec_hpzx1.h | 37 include/asm-ia64/machvec_init.h | 5 include/linux/pci_ids.h | 3 24 files changed, 2506 insertions(+), 28 deletions(-)
set -x
mkdir arch/ia64/hp/common
mkdir arch/ia64/hp/sim
mkdir arch/ia64/hp/zx1
mv arch/ia64/hp/hpsim_console.c arch/ia64/hp/sim/
mv arch/ia64/hp/hpsim_irq.c arch/ia64/hp/sim/
mv arch/ia64/hp/hpsim_machvec.c arch/ia64/hp/sim/
mv arch/ia64/hp/hpsim_setup.c arch/ia64/hp/sim/
mv arch/ia64/hp/hpsim_ssc.h arch/ia64/hp/sim/
exit
Documentation/Configure.help +7 -1
@@ -23805,12 +23805,18 @@ HP-simulator For the HP simulator (<http://software.hp.com/ia64linux/>). + HP-zx1 For HP zx1 Platforms. SN1 For SGI SN1 Platforms. SN2 For SGI SN2 Platforms. DIG-compliant For DIG ("Developer's Interface Guide") compliant - system. + systems. If you don't know what to do, choose "generic". + +CONFIG_IA64_HP_ZX1 + Build a kernel that runs on HP zx1-based systems. This adds support + for the zx1 IOMMU and makes root bus bridges appear in PCI config space + (required for zx1 agpgart support). CONFIG_IA64_SGI_SN_SIM Build a kernel that runs on both the SGI simulator AND on hardware.
arch/ia64/Makefile +12 -8
@@ -33,16 +33,11 @@ endif ifdef CONFIG_IA64_GENERIC - CORE_FILES := arch/$(ARCH)/hp/hp.a \ - arch/$(ARCH)/sn/sn.o \ - arch/$(ARCH)/dig/dig.a \ - arch/$(ARCH)/sn/io/sgiio.o \ + CORE_FILES := arch/$(ARCH)/hp/hp.o \ + arch/$(ARCH)/dig/dig.a \ $(CORE_FILES) SUBDIRS := arch/$(ARCH)/hp \ - arch/$(ARCH)/sn/sn1 \ - arch/$(ARCH)/sn \ arch/$(ARCH)/dig \ - arch/$(ARCH)/sn/io \ $(SUBDIRS) else # !GENERIC
@@ -50,7 +45,16 @@ ifdef CONFIG_IA64_HP_SIM SUBDIRS := arch/$(ARCH)/hp \ $(SUBDIRS) - CORE_FILES := arch/$(ARCH)/hp/hp.a \ + CORE_FILES := arch/$(ARCH)/hp/hp.o \ + $(CORE_FILES) +endif + +ifdef CONFIG_IA64_HP_ZX1 + SUBDIRS := arch/$(ARCH)/hp \ + arch/$(ARCH)/dig \ + $(SUBDIRS) + CORE_FILES := arch/$(ARCH)/hp/hp.o \ + arch/$(ARCH)/dig/dig.a \ $(CORE_FILES) endif
arch/ia64/config.in +2 -1
@@ -41,6 +41,7 @@ "generic CONFIG_IA64_GENERIC \ DIG-compliant CONFIG_IA64_DIG \ HP-simulator CONFIG_IA64_HP_SIM \ + HP-zx1 CONFIG_IA64_HP_ZX1 \ SGI-SN1 CONFIG_IA64_SGI_SN1 \ SGI-SN2 CONFIG_IA64_SGI_SN2" generic
@@ -68,7 +69,7 @@ fi fi -if [ "$CONFIG_IA64_DIG" = "y" ]; then +if [ "$CONFIG_IA64_GENERIC" = "y" ] || [ "$CONFIG_IA64_DIG" = "y" ] || [ "$CONFIG_IA64_HP_ZX1" = "y" ]; then bool ' Enable IA-64 Machine Check Abort' CONFIG_IA64_MCA define_bool CONFIG_PM y fi
arch/ia64/dig/setup.c +0 -2
@@ -34,8 +34,6 @@*/ char drive_info[4 *16 ]; -unsigned char aux_device_present =0xaa ;/* XXX remove this when legacy I/O is gone */ -void __init dig_setup (char **cmdline_p) {
arch/ia64/hp/Makefile +9 -11
@@ -1,17 +1,15 @@ -# -# ia64/platform/hp/Makefile -# -# Copyright (C) 1999 Silicon Graphics, Inc. -# Copyright (C) Srinivasa Thirumalachar ([email protected]) -# +# arch/ia64/hp/Makefile +# Copyright (c) 2002 Matthew Wilcox for Hewlett Packard -all: hp.a +ALL_SUB_DIRS := sim zx1 common -O_TARGET := hp.a +O_TARGET := hp.o -obj-y := hpsim_console.o hpsim_irq.o hpsim_setup.o -obj-$(CONFIG_IA64_GENERIC) += hpsim_machvec.o +subdir-$(CONFIG_IA64_GENERIC) += $(ALL_SUB_DIRS) +subdir-$(CONFIG_IA64_HP_SIM) += sim +subdir-$(CONFIG_IA64_HP_ZX1) += zx1 common -clean:: +SUB_DIRS := $(subdir-y) +obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o)) include $(TOPDIR)/Rules.make
arch/ia64/hp/common/Makefile +14 -0
@@ -0,0 +1,14 @@ +# +# ia64/platform/hp/common/Makefile +# +# Copyright (C) 2002 Hewlett Packard +# Copyright (C) Alex Williamson ([email protected]) +# + +O_TARGET := common.o + +export-objs := sba_iommu.o + +obj-y := sba_iommu.o + +include $(TOPDIR)/Rules.make
arch/ia64/hp/common/sba_iommu.c +1850 -0
1,850 lines not on this page · raw message
arch/ia64/hp/sim/Makefile +13 -0
@@ -0,0 +1,13 @@ +# +# ia64/platform/hp/sim/Makefile +# +# Copyright (C) 1999 Silicon Graphics, Inc. +# Copyright (C) Srinivasa Thirumalachar ([email protected]) +# + +O_TARGET := sim.o + +obj-y := hpsim_console.o hpsim_irq.o hpsim_setup.o +obj-$(CONFIG_IA64_GENERIC) += hpsim_machvec.o + +include $(TOPDIR)/Rules.make
arch/ia64/hp/zx1/Makefile +13 -0
@@ -0,0 +1,13 @@ +# +# ia64/platform/hp/zx1/Makefile +# +# Copyright (C) 2002 Hewlett Packard +# Copyright (C) Alex Williamson ([email protected]) +# + +O_TARGET := zx1.o + +obj-y := hpzx1_misc.o +obj-$(CONFIG_IA64_GENERIC) += hpzx1_machvec.o + +include $(TOPDIR)/Rules.make
arch/ia64/hp/zx1/hpzx1_machvec.c +2 -0
@@ -0,0 +1,2 @@ +#define MACHVEC_PLATFORM_NAME hpzx1 +#include <asm/machvec_init.h>
arch/ia64/hp/zx1/hpzx1_misc.c +400 -0
400 lines not on this page · raw message
arch/ia64/kernel/Makefile +1 -0
@@ -17,6 +17,7 @@ machvec.o pal.o process.o perfmon.o ptrace.o sal.o salinfo.o semaphore.o setup.o \ signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o obj-$(CONFIG_IA64_GENERIC) += iosapic.o +obj-$(CONFIG_IA64_HP_ZX1) += iosapic.o obj-$(CONFIG_IA64_DIG) += iosapic.o obj-$(CONFIG_IA64_PALINFO) += palinfo.o obj-$(CONFIG_EFI_VARS) += efivars.o
arch/ia64/kernel/acpi.c +101 -3
132 lines not on this page · raw message
arch/ia64/kernel/ia64_ksyms.c +7 -0
@@ -148,3 +148,10 @@#include <linux/proc_fs.h> extern struct proc_dir_entry *efi_dir;EXPORT_SYMBOL (efi_dir); + +#include <asm/machvec.h> +#ifdef CONFIG_IA64_GENERIC +EXPORT_SYMBOL (ia64_mv); +#endif +EXPORT_SYMBOL (machvec_noop); +
arch/ia64/kernel/irq.c +17 -0
@@ -67,6 +67,23 @@ irq_desc_t _irq_desc[NR_IRQS] __cacheline_aligned = { [0 ...NR_IRQS -1 ] = {IRQ_DISABLED , &no_irq_type,NULL ,0 ,SPIN_LOCK_UNLOCKED }}; +#ifdef CONFIG_IA64_GENERIC +struct irq_desc *__ia64_irq_desc (unsigned int irq) +{ +return _irq_desc + irq; +} + +ia64_vector __ia64_irq_to_vector (unsigned int irq) +{ +return (ia64_vector ) irq; +} + +unsigned int __ia64_local_vector_to_irq (ia64_vector vec) +{ +return (unsigned int ) vec; +} +#endif +static void register_irq_proc (unsigned int irq);/*
arch/ia64/kernel/setup.c +2 -0
@@ -65,6 +65,8 @@unsigned long ia64_iobase;/* virtual address for I/O accesses */ +unsigned char aux_device_present =0xaa ;/* XXX remove this when legacy I/O is gone */ +#define COMMAND_LINE_SIZE 512char saved_command_line[COMMAND_LINE_SIZE ];/* used in proc filesystem */
arch/ia64/mm/tlb.c +1 -1
@@ -79,7 +79,7 @@flush_tlb_all (); } -static inline void +void ia64_global_tlb_purge (unsigned long start,unsigned long end,unsigned long nbits) {static spinlock_t ptcg_lock =SPIN_LOCK_UNLOCKED ;
drivers/acpi/acpiconf.c +1 -1
@@ -146,7 +146,7 @@ } acpi_rpb_t; -static acpi_status __init +acpi_status __init acpi_cf_evaluate_method ( acpi_handle handle, UINT8 *method_name,
drivers/pci/pci.ids +3 -0
@@ -917,6 +917,9 @@ 121a NetServer SMIC Controller 121b NetServer Legacy COM Port Decoder 121c NetServer PCI COM Port Decoder + 1229 zx1 System Bus Adapter + 122a zx1 I/O Controller + 122e zx1 Local Bus Adapter 2910 E2910A 2925 E2925A 103e Solliday Engineering
include/asm-ia64/hw_irq.h +2 -0
@@ -88,6 +88,7 @@extern struct irq_desc _irq_desc[NR_IRQS ]; +#ifndef CONFIG_IA64_GENERIC static inline struct irq_desc *__ia64_irq_desc (unsigned int irq) {
@@ -105,6 +106,7 @@ {return (unsigned int ) vec; } +#endif /* * Next follows the irq descriptor interface. On IA-64, each CPU supports 256 interrupt
include/asm-ia64/machvec.h +4 -0
@@ -67,6 +67,8 @@# include <asm/machvec_hpsim.h> # elif defined (CONFIG_IA64_DIG )# include <asm/machvec_dig.h> +# elif defined (CONFIG_IA64_HP_ZX1 ) +# include <asm/machvec_hpzx1.h> # elif defined (CONFIG_IA64_SGI_SN1 )# include <asm/machvec_sn1.h> # elif defined (CONFIG_IA64_SGI_SN2 )
@@ -121,6 +123,7 @@ia64_mv_cmci_handler_t *cmci_handler;ia64_mv_log_print_t *log_print;ia64_mv_send_ipi_t *send_ipi; +ia64_mv_global_tlb_purge_t *global_tlb_purge;ia64_mv_pci_dma_init *dma_init;ia64_mv_pci_alloc_consistent *alloc_consistent;ia64_mv_pci_free_consistent *free_consistent;
@@ -146,6 +149,7 @@ { \#name , \ platform_setup, \ + platform_cpu_init, \ platform_irq_init, \ platform_pci_fixup, \ platform_map_nr, \
include/asm-ia64/machvec_hpzx1.h +37 -0
@@ -0,0 +1,37 @@ +#ifndef _ASM_IA64_MACHVEC_HPZX1_h +#define _ASM_IA64_MACHVEC_HPZX1_h + +extern ia64_mv_setup_t dig_setup; +extern ia64_mv_pci_fixup_t hpzx1_pci_fixup; +extern ia64_mv_map_nr_t map_nr_dense; +extern ia64_mv_pci_alloc_consistent sba_alloc_consistent; +extern ia64_mv_pci_free_consistent sba_free_consistent; +extern ia64_mv_pci_map_single sba_map_single; +extern ia64_mv_pci_unmap_single sba_unmap_single; +extern ia64_mv_pci_map_sg sba_map_sg; +extern ia64_mv_pci_unmap_sg sba_unmap_sg; +extern ia64_mv_pci_dma_address sba_dma_address; + +/* +* This stuff has dual use! +* +* For a generic kernel, the macros are used to initialize the +* platform's machvec structure. When compiling a non-generic kernel, +* the macros are used directly. +*/ +#define platform_name "hpzx1" +#define platform_setup dig_setup +#define platform_pci_fixup hpzx1_pci_fixup +#define platform_map_nr map_nr_dense +#define platform_pci_dma_init ((ia64_mv_pci_dma_init *) machvec_noop) +#define platform_pci_alloc_consistent sba_alloc_consistent +#define platform_pci_free_consistent sba_free_consistent +#define platform_pci_map_single sba_map_single +#define platform_pci_unmap_single sba_unmap_single +#define platform_pci_map_sg sba_map_sg +#define platform_pci_unmap_sg sba_unmap_sg +#define platform_pci_dma_sync_single ((ia64_mv_pci_dma_sync_single *) machvec_noop) +#define platform_pci_dma_sync_sg ((ia64_mv_pci_dma_sync_sg *) machvec_noop) +#define platform_pci_dma_address sba_dma_address + +#endif /* _ASM_IA64_MACHVEC_HPZX1_h */
include/asm-ia64/machvec_init.h +5 -0
@@ -5,6 +5,11 @@#include <asm/machvec.h> extern ia64_mv_send_ipi_t ia64_send_ipi; +extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge; +extern ia64_mv_irq_desc __ia64_irq_desc; +extern ia64_mv_irq_to_vector __ia64_irq_to_vector; +extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq; +extern ia64_mv_inb_t __ia64_inb;extern ia64_mv_inw_t __ia64_inw;extern ia64_mv_inl_t __ia64_inl;
include/linux/pci_ids.h +3 -0
@@ -505,6 +505,9 @@#define PCI_DEVICE_ID_HP_DIVA1 0x1049#define PCI_DEVICE_ID_HP_DIVA2 0x104A#define PCI_DEVICE_ID_HP_SP2_0 0x104B +#define PCI_DEVICE_ID_HP_ZX1_SBA 0x1229 +#define PCI_DEVICE_ID_HP_ZX1_IOC 0x122a +#define PCI_DEVICE_ID_HP_ZX1_LBA 0x122e#define PCI_VENDOR_ID_PCTECH 0x1042#define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000