blob: 10154ec885dfb1c08339732710e59d2c3d9f333a [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 Perelstein3085de62007-10-23 15:14:42 -04009void __init orion_init_irq(void);
Tzachi Perelsteinc67de5b2007-10-23 15:14:42 -040010void __init orion_init(void);
11
12/*
13 * Enumerations and functions for Orion windows mapping. Used by Orion core
14 * functions to map its interfaces and by the machine-setup to map its on-
15 * board devices. Details in /mach-orion/addr-map.c
16 */
17
18enum orion_target {
19 ORION_DEV_BOOT = 0,
20 ORION_DEV0,
21 ORION_DEV1,
22 ORION_DEV2,
23 ORION_PCIE_MEM,
24 ORION_PCIE_IO,
25 ORION_PCI_MEM,
26 ORION_PCI_IO,
27 ORION_DDR,
28 ORION_REGS,
29 ORION_MAX_TARGETS
30};
31
32void orion_setup_cpu_win(enum orion_target target, u32 base, u32 size, int remap);
33void orion_setup_cpu_wins(void);
34void orion_setup_eth_wins(void);
35void orion_setup_usb_wins(void);
36void orion_setup_pci_wins(void);
37void orion_setup_pcie_wins(void);
38void orion_setup_sata_wins(void);
Tzachi Perelstein585cf172007-10-23 15:14:41 -040039
Tzachi Perelstein038ee082007-10-23 15:14:42 -040040/*
41 * Shared code used internally by other Orion core functions.
42 * (/mach-orion/pci.c)
43 */
44
45struct pci_sys_data;
46struct pci_bus;
47
48void orion_pcie_id(u32 *dev, u32 *rev);
49u32 orion_pcie_local_bus_nr(void);
50u32 orion_pci_local_bus_nr(void);
51u32 orion_pci_local_dev_nr(void);
52int orion_pci_sys_setup(int nr, struct pci_sys_data *sys);
53struct pci_bus *orion_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
54int orion_pci_hw_rd_conf(u32 bus, u32 dev, u32 func, u32 where, u32 size, u32 *val);
55int orion_pci_hw_wr_conf(u32 bus, u32 dev, u32 func, u32 where, u32 size, u32 val);
56
Tzachi Perelstein01af72e2007-10-23 15:14:42 -040057/*
58 * Valid GPIO pins according to MPP setup, used by machine-setup.
59 * (/mach-orion/gpio.c).
60 */
61
62void __init orion_gpio_set_valid_pins(u32 pins);
63void gpio_display(void); /* debug */
64
Tzachi Perelstein51cbff12007-10-23 15:14:42 -040065/*
66 * Orion system timer (clocksource + clockevnt, /mach-orion/time.c)
67 */
68extern struct sys_timer orion_timer;
69
Tzachi Perelsteine07c9d82007-10-31 12:42:41 +020070/*
71 * Pull in Orion Ethernet platform_data, used by machine-setup
72 */
73
74struct mv643xx_eth_platform_data;
75
76void __init orion_eth_init(struct mv643xx_eth_platform_data *eth_data);
77
Saeed Bisharaf244baa2008-01-29 11:33:32 -110078/*
79 * Orion Sata platform_data, used by machine-setup
80 */
81
82struct mv_sata_platform_data;
83
84void __init orion_sata_init(struct mv_sata_platform_data *sata_data);
85
Tzachi Perelstein585cf172007-10-23 15:14:41 -040086#endif /* __ARCH_ORION_COMMON_H__ */