Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) #ifndef _ASM_POWERPC_MACHDEP_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) #define _ASM_POWERPC_MACHDEP_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) #ifdef __KERNEL__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) #include <linux/seq_file.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/dma-mapping.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/export.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <asm/setup.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) /* We export this macro for external modules like Alsa to know if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  * ppc_md.feature_call is implemented or not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #define CONFIG_PPC_HAS_FEATURE_CALLS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) struct pt_regs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) struct pci_bus;	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) struct device_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) struct iommu_table;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) struct rtc_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) struct file;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) struct pci_controller;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) struct kimage;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) struct pci_host_bridge;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) struct machdep_calls {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	char		*name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #ifdef CONFIG_PPC64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #ifdef CONFIG_PM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	void		(*iommu_save)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	void		(*iommu_restore)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	unsigned long	(*memory_block_size)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #endif /* CONFIG_PPC64 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	void		(*dma_set_mask)(struct device *dev, u64 dma_mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	int		(*probe)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	void		(*setup_arch)(void); /* Optional, may be NULL */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	/* Optional, may be NULL. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	void		(*show_cpuinfo)(struct seq_file *m);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	void		(*show_percpuinfo)(struct seq_file *m, int i);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	/* Returns the current operating frequency of "cpu" in Hz */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	unsigned long  	(*get_proc_freq)(unsigned int cpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	void		(*init_IRQ)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	/* Return an irq, or 0 to indicate there are none pending. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	unsigned int	(*get_irq)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	/* PCI stuff */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	/* Called after allocating resources */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	void		(*pcibios_fixup)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	void		(*pci_irq_fixup)(struct pci_dev *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	int		(*pcibios_root_bridge_prepare)(struct pci_host_bridge
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 				*bridge);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	/* finds all the pci_controllers present at boot */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	void 		(*discover_phbs)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	/* To setup PHBs when using automatic OF platform driver for PCI */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	int		(*pci_setup_phb)(struct pci_controller *host);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	void __noreturn	(*restart)(char *cmd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	void __noreturn (*halt)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	void		(*panic)(char *str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	long		(*time_init)(void); /* Optional, may be NULL */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	int		(*set_rtc_time)(struct rtc_time *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	void		(*get_rtc_time)(struct rtc_time *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	time64_t	(*get_boot_time)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	unsigned char 	(*rtc_read_val)(int addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	void		(*rtc_write_val)(int addr, unsigned char val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	void		(*calibrate_decr)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	void		(*progress)(char *, unsigned short);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	/* Interface for platform error logging */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	void 		(*log_error)(char *buf, unsigned int err_type, int fatal);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	unsigned char 	(*nvram_read_val)(int addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	void		(*nvram_write_val)(int addr, unsigned char val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	ssize_t		(*nvram_write)(char *buf, size_t count, loff_t *index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	ssize_t		(*nvram_read)(char *buf, size_t count, loff_t *index);	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	ssize_t		(*nvram_size)(void);		
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	void		(*nvram_sync)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	/* Exception handlers */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	int		(*system_reset_exception)(struct pt_regs *regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	int 		(*machine_check_exception)(struct pt_regs *regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	int		(*handle_hmi_exception)(struct pt_regs *regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	/* Early exception handlers called in realmode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	int		(*hmi_exception_early)(struct pt_regs *regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	long		(*machine_check_early)(struct pt_regs *regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	/* Called during machine check exception to retrive fixup address. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	bool		(*mce_check_early_recovery)(struct pt_regs *regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	/* Motherboard/chipset features. This is a kind of general purpose
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	 * hook used to control some machine specific features (like reset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	 * lines, chip power control, etc...).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	long	 	(*feature_call)(unsigned int feature, ...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	/* Get legacy PCI/IDE interrupt mapping */ 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	int		(*pci_get_legacy_ide_irq)(struct pci_dev *dev, int channel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	/* Get access protection for /dev/mem */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	pgprot_t	(*phys_mem_access_prot)(struct file *file,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 						unsigned long pfn,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 						unsigned long size,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 						pgprot_t vma_prot);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	 * Function for waiting for work with reduced power in idle loop;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	 * called with interrupts disabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	void		(*power_save)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	/* Function to enable performance monitor counters for this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	   platform, called once per cpu. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	void		(*enable_pmcs)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	/* Set DABR for this platform, leave empty for default implementation */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	int		(*set_dabr)(unsigned long dabr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 				    unsigned long dabrx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	/* Set DAWR for this platform, leave empty for default implementation */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	int		(*set_dawr)(int nr, unsigned long dawr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 				    unsigned long dawrx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) #ifdef CONFIG_PPC32	/* XXX for now */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	/* A general init function, called by ppc_init in init/main.c.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	   May be NULL. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	void		(*init)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	void		(*kgdb_map_scc)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	 * optional PCI "hooks"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	/* Called at then very end of pcibios_init() */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	void (*pcibios_after_init)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) #endif /* CONFIG_PPC32 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	/* Called in indirect_* to avoid touching devices */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	/* Called after PPC generic resource fixup to perform
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	   machine specific fixups */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	void (*pcibios_fixup_resources)(struct pci_dev *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	/* Called for each PCI bus in the system when it's probed */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	void (*pcibios_fixup_bus)(struct pci_bus *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	/* Called after scan and before resource survey */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	void (*pcibios_fixup_phb)(struct pci_controller *hose);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	 * Called after device has been added to bus and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	 * before sysfs has been created.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	void (*pcibios_bus_add_device)(struct pci_dev *pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	resource_size_t (*pcibios_default_alignment)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) #ifdef CONFIG_PCI_IOV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	void (*pcibios_fixup_sriov)(struct pci_dev *pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	resource_size_t (*pcibios_iov_resource_alignment)(struct pci_dev *, int resno);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	int (*pcibios_sriov_enable)(struct pci_dev *pdev, u16 num_vfs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	int (*pcibios_sriov_disable)(struct pci_dev *pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) #endif /* CONFIG_PCI_IOV */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	/* Called to shutdown machine specific hardware not already controlled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	 * by other drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	void (*machine_shutdown)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) #ifdef CONFIG_KEXEC_CORE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	void (*kexec_cpu_down)(int crash_shutdown, int secondary);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	/* Called to do what every setup is needed on image and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	 * reboot code buffer. Returns 0 on success.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	 * Provide your own (maybe dummy) implementation if your platform
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	 * claims to support kexec.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	int (*machine_kexec_prepare)(struct kimage *image);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	/* Called to perform the _real_ kexec.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	 * Do NOT allocate memory or fail here. We are past the point of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	 * no return.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	void (*machine_kexec)(struct kimage *image);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) #endif /* CONFIG_KEXEC_CORE */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) #ifdef CONFIG_SUSPEND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	/* These are called to disable and enable, respectively, IRQs when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	 * entering a suspend state.  If NULL, then the generic versions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	 * will be called.  The generic versions disable/enable the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	 * decrementer along with interrupts.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	void (*suspend_disable_irqs)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	void (*suspend_enable_irqs)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	int (*suspend_disable_cpu)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	ssize_t (*cpu_probe)(const char *, size_t);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	ssize_t (*cpu_release)(const char *, size_t);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) #ifdef CONFIG_ARCH_RANDOM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	int (*get_random_seed)(unsigned long *v);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) extern void e500_idle(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) extern void power4_idle(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) extern void ppc6xx_idle(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) extern void book3e_idle(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)  * ppc_md contains a copy of the machine description structure for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)  * current platform. machine_id contains the initial address where the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)  * description was found during boot.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) extern struct machdep_calls ppc_md;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) extern struct machdep_calls *machine_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) #define __machine_desc __section(".machine.desc")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) #define define_machine(name)					\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	extern struct machdep_calls mach_##name;		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	EXPORT_SYMBOL(mach_##name);				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	struct machdep_calls mach_##name __machine_desc =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) #define machine_is(name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	({ \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 		extern struct machdep_calls mach_##name \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 			__attribute__((weak));		 \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 		machine_id == &mach_##name; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	})
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) extern void probe_machine(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) #ifdef CONFIG_PPC_PMAC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)  * Power macintoshes have either a CUDA, PMU or SMU controlling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257)  * system reset, power, NVRAM, RTC.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) typedef enum sys_ctrler_kind {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 	SYS_CTRLER_UNKNOWN = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	SYS_CTRLER_CUDA = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	SYS_CTRLER_PMU = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 	SYS_CTRLER_SMU = 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) } sys_ctrler_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) extern sys_ctrler_t sys_ctrler;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) #endif /* CONFIG_PPC_PMAC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) static inline void log_error(char *buf, unsigned int err_type, int fatal)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 	if (ppc_md.log_error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 		ppc_md.log_error(buf, err_type, fatal);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) #define __define_machine_initcall(mach, fn, id) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 	static int __init __machine_initcall_##mach##_##fn(void) { \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 		if (machine_is(mach)) return fn(); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 		return 0; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 	} \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 	__define_initcall(__machine_initcall_##mach##_##fn, id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) #define machine_early_initcall(mach, fn)	__define_machine_initcall(mach, fn, early)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) #define machine_core_initcall(mach, fn)		__define_machine_initcall(mach, fn, 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) #define machine_core_initcall_sync(mach, fn)	__define_machine_initcall(mach, fn, 1s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) #define machine_postcore_initcall(mach, fn)	__define_machine_initcall(mach, fn, 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) #define machine_postcore_initcall_sync(mach, fn)	__define_machine_initcall(mach, fn, 2s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) #define machine_arch_initcall(mach, fn)		__define_machine_initcall(mach, fn, 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) #define machine_arch_initcall_sync(mach, fn)	__define_machine_initcall(mach, fn, 3s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) #define machine_subsys_initcall(mach, fn)	__define_machine_initcall(mach, fn, 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) #define machine_subsys_initcall_sync(mach, fn)	__define_machine_initcall(mach, fn, 4s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) #define machine_fs_initcall(mach, fn)		__define_machine_initcall(mach, fn, 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) #define machine_fs_initcall_sync(mach, fn)	__define_machine_initcall(mach, fn, 5s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) #define machine_rootfs_initcall(mach, fn)	__define_machine_initcall(mach, fn, rootfs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) #define machine_device_initcall(mach, fn)	__define_machine_initcall(mach, fn, 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) #define machine_device_initcall_sync(mach, fn)	__define_machine_initcall(mach, fn, 6s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) #define machine_late_initcall(mach, fn)		__define_machine_initcall(mach, fn, 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) #define machine_late_initcall_sync(mach, fn)	__define_machine_initcall(mach, fn, 7s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) #endif /* __KERNEL__ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) #endif /* _ASM_POWERPC_MACHDEP_H */