···377377378378 If unsure, choose "PC-compatible" instead.379379380380+config X86_INTEL_CE381381+ bool "CE4100 TV platform"382382+ depends on PCI383383+ depends on PCI_GODIRECT384384+ depends on X86_32385385+ depends on X86_EXTENDED_PLATFORM386386+ select X86_REBOOTFIXUPS387387+ ---help---388388+ Select for the Intel CE media processor (CE4100) SOC.389389+ This option compiles in support for the CE4100 SOC for settop390390+ boxes and media devices.391391+380392config X86_MRST381393 bool "Moorestown MID platform"382394 depends on PCI···397385 depends on X86_EXTENDED_PLATFORM398386 depends on X86_IO_APIC399387 select APB_TIMER388388+ select I2C389389+ select SPI390390+ select INTEL_SCU_IPC391391+ select X86_PLATFORM_DEVICES400392 ---help---401393 Moorestown is Intel's Low Power Intel Architecture (LPIA) based Moblin402394 Internet Device(MID) platform. Moorestown consists of two chips:···481465 ---help---482466 Support for Unisys ES7000 systems. Say 'Y' here if this kernel is483467 supposed to run on an IA32-based Unisys ES7000 system.468468+469469+config X86_32_IRIS470470+ tristate "Eurobraille/Iris poweroff module"471471+ depends on X86_32472472+ ---help---473473+ The Iris machines from EuroBraille do not have APM or ACPI support474474+ to shut themselves down properly. A special I/O sequence is475475+ needed to do so, which is what this module does at476476+ kernel shutdown.477477+478478+ This is only for Iris machines from EuroBraille.479479+480480+ If unused, say N.484481485482config SCHED_OMIT_FRAME_POINTER486483 def_bool y
+2-1
arch/x86/include/asm/apic.h
···234234extern void setup_local_APIC(void);235235extern void end_local_APIC_setup(void);236236extern void init_apic_mappings(void);237237+void register_lapic_address(unsigned long address);237238extern void setup_boot_APIC_clock(void);238239extern void setup_secondary_APIC_clock(void);239240extern int APIC_init_uniprocessor(void);240241extern void enable_NMI_through_LVT0(void);242242+extern int apic_force_enable(void);241243242244/*243245 * On 32bit this is mach-xxx local244246 */245247#ifdef CONFIG_X86_64246246-extern void early_init_lapic_mapping(void);247248extern int apic_is_clustered_box(void);248249#else249250static inline int apic_is_clustered_box(void)
···117117 FIX_TEXT_POKE1, /* reserve 2 pages for text_poke() */118118 FIX_TEXT_POKE0, /* first page is last, because allocation is backward */119119 __end_of_permanent_fixed_addresses,120120+121121+#ifdef CONFIG_X86_MRST122122+ FIX_LNW_VRTC,123123+#endif120124 /*121125 * 256 temporary boot-time mappings, used by early_ioremap(),122126 * before ioremap() is functional.
···847847 * returns 0 on success, < 0 on error848848 */849849850850-static void __init acpi_register_lapic_address(unsigned long address)851851-{852852- mp_lapic_addr = address;853853-854854- set_fixmap_nocache(FIX_APIC_BASE, address);855855- if (boot_cpu_physical_apicid == -1U) {856856- boot_cpu_physical_apicid = read_apic_id();857857- apic_version[boot_cpu_physical_apicid] =858858- GET_APIC_VERSION(apic_read(APIC_LVR));859859- }860860-}861861-862850static int __init early_acpi_parse_madt_lapic_addr_ovr(void)863851{864852 int count;···868880 return count;869881 }870882871871- acpi_register_lapic_address(acpi_lapic_addr);883883+ register_lapic_address(acpi_lapic_addr);872884873885 return count;874886}···895907 return count;896908 }897909898898- acpi_register_lapic_address(acpi_lapic_addr);910910+ register_lapic_address(acpi_lapic_addr);899911900912 count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_SAPIC,901913 acpi_parse_sapic, MAX_APICS);···937949extern int es7000_plat;938950#endif939951940940-static void assign_to_mp_irq(struct mpc_intsrc *m,941941- struct mpc_intsrc *mp_irq)942942-{943943- memcpy(mp_irq, m, sizeof(struct mpc_intsrc));944944-}945945-946946-static int mp_irq_cmp(struct mpc_intsrc *mp_irq,947947- struct mpc_intsrc *m)948948-{949949- return memcmp(mp_irq, m, sizeof(struct mpc_intsrc));950950-}951951-952952-static void save_mp_irq(struct mpc_intsrc *m)953953-{954954- int i;955955-956956- for (i = 0; i < mp_irq_entries; i++) {957957- if (!mp_irq_cmp(&mp_irqs[i], m))958958- return;959959- }960960-961961- assign_to_mp_irq(m, &mp_irqs[mp_irq_entries]);962962- if (++mp_irq_entries == MAX_IRQ_SOURCES)963963- panic("Max # of irq sources exceeded!!\n");964964-}965965-966952void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi)967953{968954 int ioapic;···9671005 mp_irq.dstapic = mp_ioapics[ioapic].apicid; /* APIC ID */9681006 mp_irq.dstirq = pin; /* INTIN# */9691007970970- save_mp_irq(&mp_irq);10081008+ mp_save_irq(&mp_irq);97110099721010 isa_irq_to_gsi[bus_irq] = gsi;9731011}···10421080 mp_irq.srcbusirq = i; /* Identity mapped */10431081 mp_irq.dstirq = pin;1044108210451045- save_mp_irq(&mp_irq);10831083+ mp_save_irq(&mp_irq);10461084 }10471085}10481086···10791117 mp_irq.dstapic = mp_ioapics[ioapic].apicid;10801118 mp_irq.dstirq = mp_find_ioapic_pin(ioapic, gsi);1081111910821082- save_mp_irq(&mp_irq);11201120+ mp_save_irq(&mp_irq);10831121#endif10841122 return 0;10851123}
+1
arch/x86/kernel/apb_timer.c
···315315316316 if (system_state == SYSTEM_BOOTING) {317317 irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT);318318+ irq_set_affinity(adev->irq, cpumask_of(adev->cpu));318319 /* APB timer irqs are set up as mp_irqs, timer is edge type */319320 __set_irq_handler(adev->irq, handle_edge_irq, 0, "edge");320321 if (request_irq(adev->irq, apbt_interrupt_handler,
+80-71
arch/x86/kernel/apic/apic.c
···11951195 oldvalue, value);11961196}1197119711981198-11991198/**12001199 * setup_local_APIC - setup the local APIC12001200+ *12011201+ * Used to setup local APIC while initializing BSP or bringin up APs.12021202+ * Always called with preemption disabled.12011203 */12021204void __cpuinit setup_local_APIC(void)12031205{12061206+ int cpu = smp_processor_id();12041207 unsigned int value, queued;12051208 int i, j, acked = 0;12061209 unsigned long long tsc = 0, ntsc;···12271224 }12281225#endif12291226 perf_events_lapic_init();12301230-12311231- preempt_disable();1232122712331228 /*12341229 * Double-check whether this APIC is really registered.···13431342 * TODO: set up through-local-APIC from through-I/O-APIC? --macro13441343 */13451344 value = apic_read(APIC_LVT0) & APIC_LVT_MASKED;13461346- if (!smp_processor_id() && (pic_mode || !value)) {13451345+ if (!cpu && (pic_mode || !value)) {13471346 value = APIC_DM_EXTINT;13481348- apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n",13491349- smp_processor_id());13471347+ apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n", cpu);13501348 } else {13511349 value = APIC_DM_EXTINT | APIC_LVT_MASKED;13521352- apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n",13531353- smp_processor_id());13501350+ apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n", cpu);13541351 }13551352 apic_write(APIC_LVT0, value);1356135313571354 /*13581355 * only the BP should see the LINT1 NMI signal, obviously.13591356 */13601360- if (!smp_processor_id())13571357+ if (!cpu)13611358 value = APIC_DM_NMI;13621359 else13631360 value = APIC_DM_NMI | APIC_LVT_MASKED;···13631364 value |= APIC_LVT_LEVEL_TRIGGER;13641365 apic_write(APIC_LVT1, value);1365136613661366- preempt_enable();13671367-13681367#ifdef CONFIG_X86_MCE_INTEL13691368 /* Recheck CMCI information after local APIC is up on CPU #0 */13701370- if (smp_processor_id() == 0)13691369+ if (!cpu)13711370 cmci_recheck();13721371#endif13731372}···15271530 return 0;15281531}15291532#else15331533+15341534+static int apic_verify(void)15351535+{15361536+ u32 features, h, l;15371537+15381538+ /*15391539+ * The APIC feature bit should now be enabled15401540+ * in `cpuid'15411541+ */15421542+ features = cpuid_edx(1);15431543+ if (!(features & (1 << X86_FEATURE_APIC))) {15441544+ pr_warning("Could not enable APIC!\n");15451545+ return -1;15461546+ }15471547+ set_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC);15481548+ mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;15491549+15501550+ /* The BIOS may have set up the APIC at some other address */15511551+ rdmsr(MSR_IA32_APICBASE, l, h);15521552+ if (l & MSR_IA32_APICBASE_ENABLE)15531553+ mp_lapic_addr = l & MSR_IA32_APICBASE_BASE;15541554+15551555+ pr_info("Found and enabled local APIC!\n");15561556+ return 0;15571557+}15581558+15591559+int apic_force_enable(void)15601560+{15611561+ u32 h, l;15621562+15631563+ if (disable_apic)15641564+ return -1;15651565+15661566+ /*15671567+ * Some BIOSes disable the local APIC in the APIC_BASE15681568+ * MSR. This can only be done in software for Intel P6 or later15691569+ * and AMD K7 (Model > 1) or later.15701570+ */15711571+ rdmsr(MSR_IA32_APICBASE, l, h);15721572+ if (!(l & MSR_IA32_APICBASE_ENABLE)) {15731573+ pr_info("Local APIC disabled by BIOS -- reenabling.\n");15741574+ l &= ~MSR_IA32_APICBASE_BASE;15751575+ l |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE;15761576+ wrmsr(MSR_IA32_APICBASE, l, h);15771577+ enabled_via_apicbase = 1;15781578+ }15791579+ return apic_verify();15801580+}15811581+15301582/*15311583 * Detect and initialize APIC15321584 */15331585static int __init detect_init_APIC(void)15341586{15351535- u32 h, l, features;15361536-15371587 /* Disabled by kernel option? */15381588 if (disable_apic)15391589 return -1;···16101566 "you can enable it with \"lapic\"\n");16111567 return -1;16121568 }16131613- /*16141614- * Some BIOSes disable the local APIC in the APIC_BASE16151615- * MSR. This can only be done in software for Intel P6 or later16161616- * and AMD K7 (Model > 1) or later.16171617- */16181618- rdmsr(MSR_IA32_APICBASE, l, h);16191619- if (!(l & MSR_IA32_APICBASE_ENABLE)) {16201620- pr_info("Local APIC disabled by BIOS -- reenabling.\n");16211621- l &= ~MSR_IA32_APICBASE_BASE;16221622- l |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE;16231623- wrmsr(MSR_IA32_APICBASE, l, h);16241624- enabled_via_apicbase = 1;16251625- }15691569+ if (apic_force_enable())15701570+ return -1;15711571+ } else {15721572+ if (apic_verify())15731573+ return -1;16261574 }16271627- /*16281628- * The APIC feature bit should now be enabled16291629- * in `cpuid'16301630- */16311631- features = cpuid_edx(1);16321632- if (!(features & (1 << X86_FEATURE_APIC))) {16331633- pr_warning("Could not enable APIC!\n");16341634- return -1;16351635- }16361636- set_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC);16371637- mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;16381638-16391639- /* The BIOS may have set up the APIC at some other address */16401640- rdmsr(MSR_IA32_APICBASE, l, h);16411641- if (l & MSR_IA32_APICBASE_ENABLE)16421642- mp_lapic_addr = l & MSR_IA32_APICBASE_BASE;16431643-16441644- pr_info("Found and enabled local APIC!\n");1645157516461576 apic_pm_activate();16471577···16241606no_apic:16251607 pr_info("No local APIC present or hardware disabled\n");16261608 return -1;16271627-}16281628-#endif16291629-16301630-#ifdef CONFIG_X86_6416311631-void __init early_init_lapic_mapping(void)16321632-{16331633- /*16341634- * If no local APIC can be found then go out16351635- * : it means there is no mpatable and MADT16361636- */16371637- if (!smp_found_config)16381638- return;16391639-16401640- set_fixmap_nocache(FIX_APIC_BASE, mp_lapic_addr);16411641- apic_printk(APIC_VERBOSE, "mapped APIC to %16lx (%16lx)\n",16421642- APIC_BASE, mp_lapic_addr);16431643-16441644- /*16451645- * Fetch the APIC ID of the BSP in case we have a16461646- * default configuration (or the MP table is broken).16471647- */16481648- boot_cpu_physical_apicid = read_apic_id();16491609}16501610#endif16511611···16521656 * acpi_register_lapic_address()16531657 */16541658 if (!acpi_lapic && !smp_found_config)16551655- set_fixmap_nocache(FIX_APIC_BASE, apic_phys);16561656-16571657- apic_printk(APIC_VERBOSE, "mapped APIC to %08lx (%08lx)\n",16581658- APIC_BASE, apic_phys);16591659+ register_lapic_address(apic_phys);16591660 }1660166116611662 /*···16701677 * and disable smp mode16711678 */16721679 apic_version[new_apicid] =16801680+ GET_APIC_VERSION(apic_read(APIC_LVR));16811681+ }16821682+}16831683+16841684+void __init register_lapic_address(unsigned long address)16851685+{16861686+ mp_lapic_addr = address;16871687+16881688+ if (!x2apic_mode) {16891689+ set_fixmap_nocache(FIX_APIC_BASE, address);16901690+ apic_printk(APIC_VERBOSE, "mapped APIC to %16lx (%16lx)\n",16911691+ APIC_BASE, mp_lapic_addr);16921692+ }16931693+ if (boot_cpu_physical_apicid == -1U) {16941694+ boot_cpu_physical_apicid = read_apic_id();16951695+ apic_version[boot_cpu_physical_apicid] =16731696 GET_APIC_VERSION(apic_read(APIC_LVR));16741697 }16751698}
+46-16
arch/x86/kernel/apic/io_apic.c
···126126}127127early_param("noapic", parse_noapic);128128129129+/* Will be called in mpparse/acpi/sfi codes for saving IRQ info */130130+void mp_save_irq(struct mpc_intsrc *m)131131+{132132+ int i;133133+134134+ apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x,"135135+ " IRQ %02x, APIC ID %x, APIC INT %02x\n",136136+ m->irqtype, m->irqflag & 3, (m->irqflag >> 2) & 3, m->srcbus,137137+ m->srcbusirq, m->dstapic, m->dstirq);138138+139139+ for (i = 0; i < mp_irq_entries; i++) {140140+ if (!memcmp(&mp_irqs[i], m, sizeof(*m)))141141+ return;142142+ }143143+144144+ memcpy(&mp_irqs[mp_irq_entries], m, sizeof(*m));145145+ if (++mp_irq_entries == MAX_IRQ_SOURCES)146146+ panic("Max # of irq sources exceeded!!\n");147147+}148148+129149struct irq_pin_list {130150 int apic, pin;131151 struct irq_pin_list *next;···155135{156136 return kzalloc_node(sizeof(struct irq_pin_list), GFP_KERNEL, node);157137}138138+158139159140/* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */160141#ifdef CONFIG_SPARSE_IRQ···19551934 *19561935 * by Matt Domsch <Matt_Domsch@dell.com> Tue Dec 21 12:25:05 CST 199919571936 */19581958-19591959-void __init setup_ioapic_ids_from_mpc(void)19371937+void __init setup_ioapic_ids_from_mpc_nocheck(void)19601938{19611939 union IO_APIC_reg_00 reg_00;19621940 physid_mask_t phys_id_present_map;···19641944 unsigned char old_id;19651945 unsigned long flags;1966194619671967- if (acpi_ioapic)19681968- return;19691969- /*19701970- * Don't check I/O APIC IDs for xAPIC systems. They have19711971- * no meaning without the serial APIC bus.19721972- */19731973- if (!(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)19741974- || APIC_XAPIC(apic_version[boot_cpu_physical_apicid]))19751975- return;19761947 /*19771948 * This is broken; anything with a real cpu count has to19781949 * circumvent this idiocy regardless.···20172006 physids_or(phys_id_present_map, phys_id_present_map, tmp);20182007 }2019200820202020-20212009 /*20222010 * We need to adjust the IRQ routing table20232011 * if the ID changed.···20282018 = mp_ioapics[apic_id].apicid;2029201920302020 /*20312031- * Read the right value from the MPC table and20322032- * write it into the ID register.20212021+ * Update the ID register according to the right value20222022+ * from the MPC table if they are different.20332023 */20242024+ if (mp_ioapics[apic_id].apicid == reg_00.bits.ID)20252025+ continue;20262026+20342027 apic_printk(APIC_VERBOSE, KERN_INFO20352028 "...changing IO-APIC physical APIC ID to %d ...",20362029 mp_ioapics[apic_id].apicid);···20542041 else20552042 apic_printk(APIC_VERBOSE, " ok.\n");20562043 }20442044+}20452045+20462046+void __init setup_ioapic_ids_from_mpc(void)20472047+{20482048+20492049+ if (acpi_ioapic)20502050+ return;20512051+ /*20522052+ * Don't check I/O APIC IDs for xAPIC systems. They have20532053+ * no meaning without the serial APIC bus.20542054+ */20552055+ if (!(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)20562056+ || APIC_XAPIC(apic_version[boot_cpu_physical_apicid]))20572057+ return;20582058+ setup_ioapic_ids_from_mpc_nocheck();20572059}20582060#endif20592061···36673639 return reg_01.bits.entries + 1;36683640}3669364136703670-void __init probe_nr_irqs_gsi(void)36423642+static void __init probe_nr_irqs_gsi(void)36713643{36723644 int nr;36733645···39843956 return res;39853957}3986395839873987-void __init ioapic_init_mappings(void)39593959+void __init ioapic_and_gsi_init(void)39883960{39893961 unsigned long ioapic_phys, idx = FIX_IO_APIC_BASE_0;39903962 struct resource *ioapic_res;···40223994 ioapic_res->end = ioapic_phys + IO_APIC_SLOT_SIZE - 1;40233995 ioapic_res++;40243996 }39973997+39983998+ probe_nr_irqs_gsi();40253999}4026400040274001void __init ioapic_insert_resources(void)
···6767 if (smp_found_config)6868 early_get_smp_config();6969#endif7070- early_init_lapic_mapping();7170}72717372int __init amd_numa_init(unsigned long start_pfn, unsigned long end_pfn)
···11+/*22+ * Intel CE4100 platform specific setup code33+ *44+ * (C) Copyright 2010 Intel Corporation55+ *66+ * This program is free software; you can redistribute it and/or77+ * modify it under the terms of the GNU General Public License88+ * as published by the Free Software Foundation; version 299+ * of the License.1010+ */1111+#include <linux/init.h>1212+#include <linux/kernel.h>1313+#include <linux/irq.h>1414+#include <linux/module.h>1515+#include <linux/serial_reg.h>1616+#include <linux/serial_8250.h>1717+1818+#include <asm/setup.h>1919+#include <asm/io.h>2020+2121+static int ce4100_i8042_detect(void)2222+{2323+ return 0;2424+}2525+2626+static void __init sdv_find_smp_config(void)2727+{2828+}2929+3030+#ifdef CONFIG_SERIAL_82503131+3232+3333+static unsigned int mem_serial_in(struct uart_port *p, int offset)3434+{3535+ offset = offset << p->regshift;3636+ return readl(p->membase + offset);3737+}3838+3939+/*4040+ * The UART Tx interrupts are not set under some conditions and therefore serial4141+ * transmission hangs. This is a silicon issue and has not been root caused. The4242+ * workaround for this silicon issue checks UART_LSR_THRE bit and UART_LSR_TEMT4343+ * bit of LSR register in interrupt handler to see whether at least one of these4444+ * two bits is set, if so then process the transmit request. If this workaround4545+ * is not applied, then the serial transmission may hang. This workaround is for4646+ * errata number 9 in Errata - B step.4747+*/4848+4949+static unsigned int ce4100_mem_serial_in(struct uart_port *p, int offset)5050+{5151+ unsigned int ret, ier, lsr;5252+5353+ if (offset == UART_IIR) {5454+ offset = offset << p->regshift;5555+ ret = readl(p->membase + offset);5656+ if (ret & UART_IIR_NO_INT) {5757+ /* see if the TX interrupt should have really set */5858+ ier = mem_serial_in(p, UART_IER);5959+ /* see if the UART's XMIT interrupt is enabled */6060+ if (ier & UART_IER_THRI) {6161+ lsr = mem_serial_in(p, UART_LSR);6262+ /* now check to see if the UART should be6363+ generating an interrupt (but isn't) */6464+ if (lsr & (UART_LSR_THRE | UART_LSR_TEMT))6565+ ret &= ~UART_IIR_NO_INT;6666+ }6767+ }6868+ } else6969+ ret = mem_serial_in(p, offset);7070+ return ret;7171+}7272+7373+static void ce4100_mem_serial_out(struct uart_port *p, int offset, int value)7474+{7575+ offset = offset << p->regshift;7676+ writel(value, p->membase + offset);7777+}7878+7979+static void ce4100_serial_fixup(int port, struct uart_port *up,8080+ unsigned short *capabilites)8181+{8282+#ifdef CONFIG_EARLY_PRINTK8383+ /*8484+ * Over ride the legacy port configuration that comes from8585+ * asm/serial.h. Using the ioport driver then switching to the8686+ * PCI memmaped driver hangs the IOAPIC8787+ */8888+ if (up->iotype != UPIO_MEM32) {8989+ up->uartclk = 14745600;9090+ up->mapbase = 0xdffe0200;9191+ set_fixmap_nocache(FIX_EARLYCON_MEM_BASE,9292+ up->mapbase & PAGE_MASK);9393+ up->membase =9494+ (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);9595+ up->membase += up->mapbase & ~PAGE_MASK;9696+ up->iotype = UPIO_MEM32;9797+ up->regshift = 2;9898+ }9999+#endif100100+ up->iobase = 0;101101+ up->serial_in = ce4100_mem_serial_in;102102+ up->serial_out = ce4100_mem_serial_out;103103+104104+ *capabilites |= (1 << 12);105105+}106106+107107+static __init void sdv_serial_fixup(void)108108+{109109+ serial8250_set_isa_configurator(ce4100_serial_fixup);110110+}111111+112112+#else113113+static inline void sdv_serial_fixup(void);114114+#endif115115+116116+static void __init sdv_arch_setup(void)117117+{118118+ sdv_serial_fixup();119119+}120120+121121+/*122122+ * CE4100 specific x86_init function overrides and early setup123123+ * calls.124124+ */125125+void __init x86_ce4100_early_setup(void)126126+{127127+ x86_init.oem.arch_setup = sdv_arch_setup;128128+ x86_platform.i8042_detect = ce4100_i8042_detect;129129+ x86_init.resources.probe_roms = x86_init_noop;130130+ x86_init.mpparse.get_smp_config = x86_init_uint_noop;131131+ x86_init.mpparse.find_smp_config = sdv_find_smp_config;132132+}
···11+/*22+ * Eurobraille/Iris power off support.33+ *44+ * Eurobraille's Iris machine is a PC with no APM or ACPI support.55+ * It is shutdown by a special I/O sequence which this module provides.66+ *77+ * Copyright (C) Shérab <Sebastien.Hinderer@ens-lyon.org>88+ *99+ * This program is free software ; you can redistribute it and/or modify1010+ * it under the terms of the GNU General Public License as published by1111+ * the Free Software Foundation ; either version 2 of the License, or1212+ * (at your option) any later version.1313+ *1414+ * This program is distributed in the hope that it will be useful,1515+ * but WITHOUT ANY WARRANTY ; without even the implied warranty of1616+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1717+ * GNU General Public License for more details.1818+ *1919+ * You should have received a copy of the GNU General Public License2020+ * along with the program ; if not, write to the Free Software2121+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.2222+ */2323+2424+#include <linux/moduleparam.h>2525+#include <linux/module.h>2626+#include <linux/kernel.h>2727+#include <linux/errno.h>2828+#include <linux/delay.h>2929+#include <linux/init.h>3030+#include <linux/pm.h>3131+#include <asm/io.h>3232+3333+#define IRIS_GIO_BASE 0x3403434+#define IRIS_GIO_INPUT IRIS_GIO_BASE3535+#define IRIS_GIO_OUTPUT (IRIS_GIO_BASE + 1)3636+#define IRIS_GIO_PULSE 0x80 /* First byte to send */3737+#define IRIS_GIO_REST 0x00 /* Second byte to send */3838+#define IRIS_GIO_NODEV 0xff /* Likely not an Iris */3939+4040+MODULE_LICENSE("GPL");4141+MODULE_AUTHOR("Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>");4242+MODULE_DESCRIPTION("A power_off handler for Iris devices from EuroBraille");4343+MODULE_SUPPORTED_DEVICE("Eurobraille/Iris");4444+4545+static int force;4646+4747+module_param(force, bool, 0);4848+MODULE_PARM_DESC(force, "Set to one to force poweroff handler installation.");4949+5050+static void (*old_pm_power_off)(void);5151+5252+static void iris_power_off(void)5353+{5454+ outb(IRIS_GIO_PULSE, IRIS_GIO_OUTPUT);5555+ msleep(850);5656+ outb(IRIS_GIO_REST, IRIS_GIO_OUTPUT);5757+}5858+5959+/*6060+ * Before installing the power_off handler, try to make sure the OS is6161+ * running on an Iris. Since Iris does not support DMI, this is done6262+ * by reading its input port and seeing whether the read value is6363+ * meaningful.6464+ */6565+static int iris_init(void)6666+{6767+ unsigned char status;6868+ if (force != 1) {6969+ printk(KERN_ERR "The force parameter has not been set to 1 so the Iris poweroff handler will not be installed.\n");7070+ return -ENODEV;7171+ }7272+ status = inb(IRIS_GIO_INPUT);7373+ if (status == IRIS_GIO_NODEV) {7474+ printk(KERN_ERR "This machine does not seem to be an Iris. Power_off handler not installed.\n");7575+ return -ENODEV;7676+ }7777+ old_pm_power_off = pm_power_off;7878+ pm_power_off = &iris_power_off;7979+ printk(KERN_INFO "Iris power_off handler installed.\n");8080+8181+ return 0;8282+}8383+8484+static void iris_exit(void)8585+{8686+ pm_power_off = old_pm_power_off;8787+ printk(KERN_INFO "Iris power_off handler uninstalled.\n");8888+}8989+9090+module_init(iris_init);9191+module_exit(iris_exit);
···463463 This driver can also be built as a module. If so, the module464464 will be called rtc-cmos.465465466466+config RTC_DRV_VRTC467467+ tristate "Virtual RTC for Moorestown platforms"468468+ depends on X86_MRST469469+ default y if X86_MRST470470+471471+ help472472+ Say "yes" here to get direct support for the real time clock473473+ found on Moorestown platforms. The VRTC is a emulated RTC that474474+ derives its clock source from a real RTC in the PMIC. The MC146818475475+ style programming interface is mostly conserved, but any476476+ updates are done via IPC calls to the system controller FW.477477+466478config RTC_DRV_DS1216467479 tristate "Dallas DS1216"468480 depends on SNI_RM