/****************************************************************************** * crash.c * * Based heavily on arch/i386/kernel/crash.c from Linux 2.6.16 * * Xen port written by: * - Simon 'Horms' Horman * - Magnus Damm */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static atomic_t waiting_for_crash_ipi; static unsigned int crashing_cpu; static int crash_nmi_callback(struct cpu_user_regs *regs, int cpu) { /* Don't do anything if this handler is invoked on crashing cpu. * Otherwise, system will completely hang. Crashing cpu can get * an NMI if system was initially booted with nmi_watchdog parameter. */ if ( cpu == crashing_cpu ) return 1; local_irq_disable(); kexec_crash_save_cpu(); disable_local_APIC(); atomic_dec(&waiting_for_crash_ipi); hvm_cpu_down(); for ( ; ; ) halt(); return 1; } /* * By using the NMI code instead of a vector we just sneak thru the * word generator coming out with just what we want. AND it does * not matter if clustered_apic_mode is set or not. */ static void smp_send_nmi_allbutself(void) { cpumask_t allbutself = cpu_online_map; cpu_clear(smp_processor_id(), allbutself); if ( !cpus_empty(allbutself) ) send_IPI_mask(allbutself, APIC_DM_NMI); } static void nmi_shootdown_cpus(void) { unsigned long msecs; crashing_cpu = smp_processor_id(); atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1); /* Would it be better to replace the trap vector here? */ set_nmi_callback(crash_nmi_callback); /* Ensure the new callback function is set before sending out the NMI. */ wmb(); smp_send_nmi_allbutself(); msecs = 1000; /* Wait at most a second for the other cpus to stop */ while ( (atomic_read(&waiting_for_crash_ipi) > 0) && msecs ) { mdelay(1); msecs--; } /* Leave the nmi callback set */ disable_local_APIC(); } void machine_crash_shutdown(void) { crash_xen_info_t *info; local_irq_disable(); nmi_shootdown_cpus(); disable_IO_APIC(); hvm_cpu_down(); info = kexec_crash_save_info(); info->xen_phys_start = xen_phys_start; info->dom0_pfn_to_mfn_frame_list_list = arch_get_pfn_to_mfn_frame_list_list(dom0); } /* * Local variables: * mode: C * c-set-style: "BSD" * c-basic-offset: 4 * tab-width: 4 * indent-tabs-mode: nil * End: */ lect name='qt'>
blob: a9ff129816214bf1aad5dea167216b4d0cc3bc1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
include ./common-mikrotik.mk

define Device/mikrotik_routerboard-922uags-5hpacd
  $(Device/mikrotik)
  SOC := qca9558
  DEVICE_MODEL := RouterBOARD 922UAGS-5HPacD
  IMAGE/sysupgrade.bin = append-kernel | kernel2minor -s 2048 -e -c | \
	sysupgrade-tar kernel=$$$$@ | append-metadata
  DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct \
	kmod-usb2 nand-utils
  SUPPORTED_DEVICES += rb-922uags-5hpacd
endef
TARGET_DEVICES += mikrotik_routerboard-922uags-5hpacd

define Device/mikrotik_routerboard-wap-g-5hact2hnd
  $(Device/mikrotik)
  SOC := qca9556
  DEVICE_MODEL := RouterBOARD wAP G-5HacT2HnD (wAP AC)
  IMAGE_SIZE := 16256k
  IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 -e | \
	pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
	append-metadata | check-size
  DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
  SUPPORTED_DEVICES += rb-wapg-5hact2hnd
endef
TARGET_DEVICES += mikrotik_routerboard-wap-g-5hact2hnd