blob: a6a7af189b0ee9b88d26dd18620834572622f768 [file] [log] [blame]
Tzachi Perelstein585cf172007-10-23 15:14:41 -04001#ifndef __ARCH_ORION_COMMON_H__
2#define __ARCH_ORION_COMMON_H__
3
4/*
5 * Basic Orion init functions used early by machine-setup.
6 */
Tzachi Perelsteinc67de5b2007-10-23 15:14:42 -04007
Tzachi Perelstein585cf172007-10-23 15:14:41 -04008void __init orion_map_io(void);
Tzachi Perelsteinc67de5b2007-10-23 15:14:42 -04009void __init orion_init(void);
10
11/*
12 * Enumerations and functions for Orion windows mapping. Used by Orion core
13 * functions to map its interfaces and by the machine-setup to map its on-
14 * board devices. Details in /mach-orion/addr-map.c
15 */
16
17enum orion_target {
18 ORION_DEV_BOOT = 0,
19 ORION_DEV0,
20 ORION_DEV1,
21 ORION_DEV2,
22 ORION_PCIE_MEM,
23 ORION_PCIE_IO,
24 ORION_PCI_MEM,
25 ORION_PCI_IO,
26 ORION_DDR,
27 ORION_REGS,
28 ORION_MAX_TARGETS
29};
30
31void orion_setup_cpu_win(enum orion_target target, u32 base, u32 size, int remap);
32void orion_setup_cpu_wins(void);
33void orion_setup_eth_wins(void);
34void orion_setup_usb_wins(void);
35void orion_setup_pci_wins(void);
36void orion_setup_pcie_wins(void);
37void orion_setup_sata_wins(void);
Tzachi Perelstein585cf172007-10-23 15:14:41 -040038
Tzachi Perelstein038ee082007-10-23 15:14:42 -040039/*
40 * Shared code used internally by other Orion core functions.
41 * (/mach-orion/pci.c)
42 */
43
44struct pci_sys_data;
45struct pci_bus;
46
47void orion_pcie_id(u32 *dev, u32 *rev);
48u32 orion_pcie_local_bus_nr(void);
49u32 orion_pci_local_bus_nr(void);
50u32 orion_pci_local_dev_nr(void);
51int orion_pci_sys_setup(int nr, struct pci_sys_data *sys);
52struct pci_bus *orion_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
53int orion_pci_hw_rd_conf(u32 bus, u32 dev, u32 func, u32 where, u32 size, u32 *val);
54int orion_pci_hw_wr_conf(u32 bus, u32 dev, u32 func, u32 where, u32 size, u32 val);
55
Tzachi Perelstein01af72e2007-10-23 15:14:42 -040056/*
57 * Valid GPIO pins according to MPP setup, used by machine-setup.
58 * (/mach-orion/gpio.c).
59 */
60
61void __init orion_gpio_set_valid_pins(u32 pins);
62void gpio_display(void); /* debug */
63
Tzachi Perelstein585cf172007-10-23 15:14:41 -040064#endif /* __ARCH_ORION_COMMON_H__ */