Path: blob/master/arch/x86/platform/intel-mid/intel-mid.c
26481 views
// SPDX-License-Identifier: GPL-2.0-only1/*2* Intel MID platform setup code3*4* (C) Copyright 2008, 2012, 2021 Intel Corporation5* Author: Jacob Pan ([email protected])6* Author: Sathyanarayanan Kuppuswamy <[email protected]>7*/89#define pr_fmt(fmt) "intel_mid: " fmt1011#include <linux/init.h>12#include <linux/kernel.h>13#include <linux/interrupt.h>14#include <linux/regulator/machine.h>15#include <linux/scatterlist.h>16#include <linux/irq.h>17#include <linux/export.h>18#include <linux/notifier.h>1920#include <asm/setup.h>21#include <asm/mpspec_def.h>22#include <asm/hw_irq.h>23#include <asm/apic.h>24#include <asm/cpu_device_id.h>25#include <asm/io_apic.h>26#include <asm/intel-mid.h>27#include <asm/io.h>28#include <asm/i8259.h>29#include <asm/reboot.h>3031#include <linux/platform_data/x86/intel_scu_ipc.h>3233#define IPCMSG_COLD_OFF 0x80 /* Only for Tangier */34#define IPCMSG_COLD_RESET 0xF13536static void intel_mid_power_off(void)37{38/* Shut down South Complex via PWRMU */39intel_mid_pwr_power_off();4041/* Only for Tangier, the rest will ignore this command */42intel_scu_ipc_dev_simple_command(NULL, IPCMSG_COLD_OFF, 1);43};4445static void intel_mid_reboot(void)46{47intel_scu_ipc_dev_simple_command(NULL, IPCMSG_COLD_RESET, 0);48}4950static void __init intel_mid_time_init(void)51{52/* Lapic only, no apbt */53x86_init.timers.setup_percpu_clockev = setup_boot_APIC_clock;54x86_cpuinit.setup_percpu_clockev = setup_secondary_APIC_clock;55}5657static void intel_mid_arch_setup(void)58{59switch (boot_cpu_data.x86_vfm) {60case INTEL_ATOM_SILVERMONT_MID:61x86_platform.legacy.rtc = 1;62break;63default:64break;65}6667/*68* Intel MID platforms are using explicitly defined regulators.69*70* Let the regulator core know that we do not have any additional71* regulators left. This lets it substitute unprovided regulators with72* dummy ones:73*/74regulator_has_full_constraints();75}7677/*78* Moorestown does not have external NMI source nor port 0x61 to report79* NMI status. The possible NMI sources are from pmu as a result of NMI80* watchdog or lock debug. Reading io port 0x61 results in 0xff which81* misled NMI handler.82*/83static unsigned char intel_mid_get_nmi_reason(void)84{85return 0;86}8788/*89* Moorestown specific x86_init function overrides and early setup90* calls.91*/92void __init x86_intel_mid_early_setup(void)93{94x86_init.resources.probe_roms = x86_init_noop;95x86_init.resources.reserve_resources = x86_init_noop;9697x86_init.timers.timer_init = intel_mid_time_init;98x86_init.timers.setup_percpu_clockev = x86_init_noop;99100x86_init.irqs.pre_vector_init = x86_init_noop;101102x86_init.oem.arch_setup = intel_mid_arch_setup;103104x86_platform.get_nmi_reason = intel_mid_get_nmi_reason;105106x86_init.pci.arch_init = intel_mid_pci_init;107x86_init.pci.fixup_irqs = x86_init_noop;108109legacy_pic = &null_legacy_pic;110111/*112* Do nothing for now as everything needed done in113* x86_intel_mid_early_setup() below.114*/115x86_init.acpi.reduced_hw_early_init = x86_init_noop;116117pm_power_off = intel_mid_power_off;118machine_ops.emergency_restart = intel_mid_reboot;119120/* Avoid searching for BIOS MP tables */121x86_init.mpparse.find_mptable = x86_init_noop;122x86_init.mpparse.early_parse_smp_cfg = x86_init_noop;123x86_init.mpparse.parse_smp_cfg = x86_init_noop;124set_bit(MP_BUS_ISA, mp_bus_not_pci);125}126127128