xref: /kvmtool/powerpc/include/kvm/kvm-arch.h (revision b0d56e3c994a0feb3ffb519cecda5c1f6da8b1ab)
163e158a0SMatt Evans /*
263e158a0SMatt Evans  * PPC64 architecture-specific definitions
363e158a0SMatt Evans  *
463e158a0SMatt Evans  * Copyright 2011 Matt Evans <matt@ozlabs.org>, IBM Corporation.
563e158a0SMatt Evans  *
663e158a0SMatt Evans  * This program is free software; you can redistribute it and/or modify it
763e158a0SMatt Evans  * under the terms of the GNU General Public License version 2 as published
863e158a0SMatt Evans  * by the Free Software Foundation.
963e158a0SMatt Evans  */
1063e158a0SMatt Evans 
1163e158a0SMatt Evans #ifndef KVM__KVM_ARCH_H
1263e158a0SMatt Evans #define KVM__KVM_ARCH_H
1363e158a0SMatt Evans 
1463e158a0SMatt Evans #include <stdbool.h>
1563e158a0SMatt Evans #include <linux/types.h>
16*39181fc6SAlexandru Elisei #include <linux/sizes.h>
1763e158a0SMatt Evans #include <time.h>
1863e158a0SMatt Evans 
1963e158a0SMatt Evans /*
2063e158a0SMatt Evans  * MMIO lives after RAM, but it'd be nice if it didn't constantly move.
2163e158a0SMatt Evans  * Choose a suitably high address, e.g. 63T...  This limits RAM size.
2263e158a0SMatt Evans  */
2363e158a0SMatt Evans #define PPC_MMIO_START			0x3F0000000000UL
2463e158a0SMatt Evans #define PPC_MMIO_SIZE			0x010000000000UL
2563e158a0SMatt Evans 
2663e158a0SMatt Evans #define KERNEL_LOAD_ADDR        	0x0000000000000000
2763e158a0SMatt Evans #define KERNEL_START_ADDR       	0x0000000000000000
2863e158a0SMatt Evans #define KERNEL_SECONDARY_START_ADDR     0x0000000000000060
2963e158a0SMatt Evans #define INITRD_LOAD_ADDR        	0x0000000002800000
3063e158a0SMatt Evans 
3163e158a0SMatt Evans #define RTAS_MAX_SIZE           	0x10000
3263e158a0SMatt Evans 
3363e158a0SMatt Evans #define TIMEBASE_FREQ           	512000000ULL
3463e158a0SMatt Evans 
3563e158a0SMatt Evans #define KVM_MMIO_START			PPC_MMIO_START
3663e158a0SMatt Evans 
3763e158a0SMatt Evans /*
38854aa2efSJulien Thierry  * This is the address that pci_get_io_port_block() starts allocating
3963e158a0SMatt Evans  * from.  Note that this is a PCI bus address.
4063e158a0SMatt Evans  */
41dbfef850SWill Deacon #define KVM_IOPORT_AREA			0x0
42b403f2f7SWill Deacon #define KVM_PCI_CFG_AREA		0x1000000
43b403f2f7SWill Deacon #define KVM_PCI_MMIO_AREA		0x2000000
44b403f2f7SWill Deacon #define KVM_VIRTIO_MMIO_AREA		0x3000000
4563e158a0SMatt Evans 
469dc5430cSWill Deacon #define KVM_IRQ_OFFSET			16
479dc5430cSWill Deacon 
48b5a5cd67SAndreas Herrmann #define KVM_VM_TYPE			0
49b5a5cd67SAndreas Herrmann 
50ed83730fSJean-Philippe Brucker #define KVM_IOEVENTFD_HAS_PIO		0
51ed83730fSJean-Philippe Brucker 
52*39181fc6SAlexandru Elisei #define MAX_PAGE_SIZE			SZ_256K
53*39181fc6SAlexandru Elisei 
54c481cfd5SMatt Evans struct spapr_phb;
55c481cfd5SMatt Evans 
5642ac24f9SSasha Levin struct kvm_arch {
57df129a0aSMatt Evans 	u64			sdr1;
58d391177aSMatt Evans 	u32			pvr;
5963e158a0SMatt Evans 	unsigned long		rtas_gra;
6063e158a0SMatt Evans 	unsigned long		rtas_size;
6163e158a0SMatt Evans 	unsigned long		fdt_gra;
6263e158a0SMatt Evans 	unsigned long		initrd_gra;
6363e158a0SMatt Evans 	unsigned long		initrd_size;
64f17e5a37SMatt Evans 	struct icp_state	*icp;
65c481cfd5SMatt Evans 	struct spapr_phb	*phb;
6663e158a0SMatt Evans };
6763e158a0SMatt Evans 
6863e158a0SMatt Evans #endif /* KVM__KVM_ARCH_H */
69