gemini: add Linux 4.4 support
[openwrt/staging/yousong.git] / target / linux / gemini / patches-4.4 / 140-arm-gemini-add-pci-support.patch
1 --- a/arch/arm/Kconfig
2 +++ b/arch/arm/Kconfig
3 @@ -399,6 +399,7 @@ config ARCH_GEMINI
4 select CLKSRC_MMIO
5 select CPU_FA526
6 select GENERIC_CLOCKEVENTS
7 + select MIGHT_HAVE_PCI
8 help
9 Support for the Cortina Systems Gemini family SoCs
10
11 --- a/arch/arm/mach-gemini/include/mach/hardware.h
12 +++ b/arch/arm/mach-gemini/include/mach/hardware.h
13 @@ -68,4 +68,9 @@
14 */
15 #define IO_ADDRESS(x) IOMEM((((x) & 0xFFF00000) >> 4) | ((x) & 0x000FFFFF) | 0xF0000000)
16
17 +/*
18 + * PCI subsystem macros
19 + */
20 +#define pcibios_assign_all_busses() 1
21 +
22 #endif
23 --- a/arch/arm/mach-gemini/include/mach/irqs.h
24 +++ b/arch/arm/mach-gemini/include/mach/irqs.h
25 @@ -43,11 +43,14 @@
26
27 #define NORMAL_IRQ_NUM 32
28
29 -#define GPIO_IRQ_BASE NORMAL_IRQ_NUM
30 +#define PCI_IRQ_BASE NORMAL_IRQ_NUM
31 +#define PCI_IRQ_NUM 4
32 +
33 +#define GPIO_IRQ_BASE (NORMAL_IRQ_NUM + PCI_IRQ_NUM)
34 #define GPIO_IRQ_NUM (3 * 32)
35
36 #define ARCH_TIMER_IRQ IRQ_TIMER2
37
38 -#define NR_IRQS (NORMAL_IRQ_NUM + GPIO_IRQ_NUM)
39 +#define NR_IRQS (NORMAL_IRQ_NUM + PCI_IRQ_NUM + GPIO_IRQ_NUM)
40
41 #endif /* __MACH_IRQS_H__ */
42 --- a/arch/arm/mach-gemini/Makefile
43 +++ b/arch/arm/mach-gemini/Makefile
44 @@ -6,6 +6,8 @@
45
46 obj-y := irq.o mm.o time.o devices.o gpio.o idle.o reset.o
47
48 +obj-$(CONFIG_PCI) += pci.o
49 +
50 # Board-specific support
51 obj-$(CONFIG_MACH_NAS4220B) += board-nas4220b.o
52 obj-$(CONFIG_MACH_RUT100) += board-rut1xx.o
53 --- a/arch/arm/mach-gemini/mm.c
54 +++ b/arch/arm/mach-gemini/mm.c
55 @@ -59,6 +59,11 @@ static struct map_desc gemini_io_desc[]
56 .length = SZ_512K,
57 .type = MT_DEVICE,
58 }, {
59 + .virtual = (unsigned long)IO_ADDRESS(GEMINI_PCI_IO_BASE),
60 + .pfn = __phys_to_pfn(GEMINI_PCI_IO_BASE),
61 + .length = SZ_512K,
62 + .type = MT_DEVICE,
63 + }, {
64 .virtual = (unsigned long)IO_ADDRESS(GEMINI_FLASH_CTRL_BASE),
65 .pfn = __phys_to_pfn(GEMINI_FLASH_CTRL_BASE),
66 .length = SZ_512K,