Skip to content

Commit 915db32

Browse files
committed
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (21 commits) MIPS: Alchemy: PB1200: use SMC91X platform data. MIPS: Alchemy: MIPS hazard workarounds are not required. MIPS: Alchemy: provide cpu feature overrides. MIPS: Alchemy: unify CPU model constants. MIPS: Make a needlessly global symbol static in arch/mips/kernel/smp.c MIPS: Fix global namespace pollution in arch/mips/kernel/smp-up.c MIPS: Malta: make a needlessly global integer variable static MIPS: Use BUG_ON() where possible. MIPS: Convert obsolete irq_desc_t to struct irq_desc MIPS: Enable GENERIC_HARDIRQS_NO__DO_IRQ for all platforms MIPS: EMMA2RH: Set UART mapbase MIPS: EMMA2RH: Use set_irq_chip_and_handler_name MIPS: EMMA2RH: Use handle_edge_irq() handler for GPIO interrupts MIPS: Mark Eins: Fix cascading interrupt dispatcher MIPS: Au1000: convert to using gpiolib MIPS: Stop using <asm-generic/int-l64.h>. MIPS: Cavium: Add -Werror MIPS: Makefile: Add simple make install target. MIPS: Compat: Zero upper 32-bit of offset_high and offset_low. MIPS: __raw_spin_lock() may spin forever on ticket wrap. ...
2 parents ebc8eca + 91e8a30 commit 915db32

File tree

46 files changed

+353
-314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+353
-314
lines changed

arch/mips/Kconfig

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ config MIPS_COBALT
7777
select SYS_SUPPORTS_32BIT_KERNEL
7878
select SYS_SUPPORTS_64BIT_KERNEL
7979
select SYS_SUPPORTS_LITTLE_ENDIAN
80-
select GENERIC_HARDIRQS_NO__DO_IRQ
8180

8281
config MACH_DECSTATION
8382
bool "DECstations"
@@ -132,7 +131,6 @@ config MACH_JAZZ
132131
select SYS_SUPPORTS_32BIT_KERNEL
133132
select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
134133
select SYS_SUPPORTS_100HZ
135-
select GENERIC_HARDIRQS_NO__DO_IRQ
136134
help
137135
This a family of machines based on the MIPS R4030 chipset which was
138136
used by several vendors to build RISC/os and Windows NT workstations.
@@ -154,7 +152,6 @@ config LASAT
154152
select SYS_SUPPORTS_32BIT_KERNEL
155153
select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
156154
select SYS_SUPPORTS_LITTLE_ENDIAN
157-
select GENERIC_HARDIRQS_NO__DO_IRQ
158155

159156
config LEMOTE_FULONG
160157
bool "Lemote Fulong mini-PC"
@@ -175,7 +172,6 @@ config LEMOTE_FULONG
175172
select SYS_SUPPORTS_LITTLE_ENDIAN
176173
select SYS_SUPPORTS_HIGHMEM
177174
select SYS_HAS_EARLY_PRINTK
178-
select GENERIC_HARDIRQS_NO__DO_IRQ
179175
select GENERIC_ISA_DMA_SUPPORT_BROKEN
180176
select CPU_HAS_WB
181177
help
@@ -250,7 +246,6 @@ config MACH_VR41XX
250246
select CEVT_R4K
251247
select CSRC_R4K
252248
select SYS_HAS_CPU_VR41XX
253-
select GENERIC_HARDIRQS_NO__DO_IRQ
254249

255250
config NXP_STB220
256251
bool "NXP STB220 board"
@@ -364,7 +359,6 @@ config SGI_IP27
364359
select SYS_SUPPORTS_BIG_ENDIAN
365360
select SYS_SUPPORTS_NUMA
366361
select SYS_SUPPORTS_SMP
367-
select GENERIC_HARDIRQS_NO__DO_IRQ
368362
help
369363
This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
370364
workstations. To compile a Linux kernel that runs on these, say Y
@@ -563,7 +557,6 @@ config MIKROTIK_RB532
563557
select CEVT_R4K
564558
select CSRC_R4K
565559
select DMA_NONCOHERENT
566-
select GENERIC_HARDIRQS_NO__DO_IRQ
567560
select HW_HAS_PCI
568561
select IRQ_CPU
569562
select SYS_HAS_CPU_MIPS32_R1
@@ -700,8 +693,7 @@ config SCHED_OMIT_FRAME_POINTER
700693
default y
701694

702695
config GENERIC_HARDIRQS_NO__DO_IRQ
703-
bool
704-
default n
696+
def_bool y
705697

706698
#
707699
# Select some configuration options automatically based on user selections.
@@ -920,7 +912,6 @@ config SOC_PNX833X
920912
select SYS_SUPPORTS_32BIT_KERNEL
921913
select SYS_SUPPORTS_LITTLE_ENDIAN
922914
select SYS_SUPPORTS_BIG_ENDIAN
923-
select GENERIC_HARDIRQS_NO__DO_IRQ
924915
select GENERIC_GPIO
925916
select CPU_MIPSR2_IRQ_VI
926917

@@ -939,7 +930,6 @@ config SOC_PNX8550
939930
select SYS_HAS_CPU_MIPS32_R1
940931
select SYS_HAS_EARLY_PRINTK
941932
select SYS_SUPPORTS_32BIT_KERNEL
942-
select GENERIC_HARDIRQS_NO__DO_IRQ
943933
select GENERIC_GPIO
944934

945935
config SWAP_IO_SPACE

arch/mips/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,11 +720,17 @@ ifdef CONFIG_MIPS32_O32
720720
$(Q)$(MAKE) $(build)=. missing-syscalls EXTRA_CFLAGS="-mabi=32"
721721
endif
722722

723+
install:
724+
$(Q)install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE)
725+
$(Q)install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE)
726+
$(Q)install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE)
727+
723728
archclean:
724729
@$(MAKE) $(clean)=arch/mips/boot
725730
@$(MAKE) $(clean)=arch/mips/lasat
726731

727732
define archhelp
733+
echo ' install - install kernel into $(INSTALL_PATH)'
728734
echo ' vmlinux.ecoff - ECOFF boot image'
729735
echo ' vmlinux.bin - Raw binary boot image'
730736
echo ' vmlinux.srec - SREC boot image'

arch/mips/alchemy/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@ config SOC_AU1X00
134134
select SYS_HAS_CPU_MIPS32_R1
135135
select SYS_SUPPORTS_32BIT_KERNEL
136136
select SYS_SUPPORTS_APM_EMULATION
137-
select GENERIC_HARDIRQS_NO__DO_IRQ
137+
select ARCH_REQUIRE_GPIOLIB

arch/mips/alchemy/common/gpio.c

Lines changed: 128 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2007, OpenWrt.org, Florian Fainelli <[email protected]>
2+
* Copyright (C) 2007-2009, OpenWrt.org, Florian Fainelli <[email protected]>
33
* Architecture specific GPIO support
44
*
55
* This program is free software; you can redistribute it and/or modify it
@@ -27,122 +27,175 @@
2727
* others have a second one : GPIO2
2828
*/
2929

30+
#include <linux/kernel.h>
3031
#include <linux/module.h>
32+
#include <linux/types.h>
33+
#include <linux/platform_device.h>
34+
#include <linux/gpio.h>
3135

3236
#include <asm/mach-au1x00/au1000.h>
3337
#include <asm/gpio.h>
3438

35-
#define gpio1 sys
36-
#if !defined(CONFIG_SOC_AU1000)
37-
38-
static struct au1x00_gpio2 *const gpio2 = (struct au1x00_gpio2 *) GPIO2_BASE;
39-
#define GPIO2_OUTPUT_ENABLE_MASK 0x00010000
39+
struct au1000_gpio_chip {
40+
struct gpio_chip chip;
41+
void __iomem *regbase;
42+
};
4043

41-
static int au1xxx_gpio2_read(unsigned gpio)
44+
#if !defined(CONFIG_SOC_AU1000)
45+
static int au1000_gpio2_get(struct gpio_chip *chip, unsigned offset)
4246
{
43-
gpio -= AU1XXX_GPIO_BASE;
44-
return ((gpio2->pinstate >> gpio) & 0x01);
47+
u32 mask = 1 << offset;
48+
struct au1000_gpio_chip *gpch;
49+
50+
gpch = container_of(chip, struct au1000_gpio_chip, chip);
51+
return readl(gpch->regbase + AU1000_GPIO2_ST) & mask;
4552
}
4653

47-
static void au1xxx_gpio2_write(unsigned gpio, int value)
54+
static void au1000_gpio2_set(struct gpio_chip *chip,
55+
unsigned offset, int value)
4856
{
49-
gpio -= AU1XXX_GPIO_BASE;
57+
u32 mask = ((GPIO2_OUT_EN_MASK << offset) | (!!value << offset));
58+
struct au1000_gpio_chip *gpch;
59+
unsigned long flags;
60+
61+
gpch = container_of(chip, struct au1000_gpio_chip, chip);
5062

51-
gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | ((!!value) << gpio);
63+
local_irq_save(flags);
64+
writel(mask, gpch->regbase + AU1000_GPIO2_OUT);
65+
local_irq_restore(flags);
5266
}
5367

54-
static int au1xxx_gpio2_direction_input(unsigned gpio)
68+
static int au1000_gpio2_direction_input(struct gpio_chip *chip, unsigned offset)
5569
{
56-
gpio -= AU1XXX_GPIO_BASE;
57-
gpio2->dir &= ~(0x01 << gpio);
70+
u32 mask = 1 << offset;
71+
u32 tmp;
72+
struct au1000_gpio_chip *gpch;
73+
unsigned long flags;
74+
75+
gpch = container_of(chip, struct au1000_gpio_chip, chip);
76+
77+
local_irq_save(flags);
78+
tmp = readl(gpch->regbase + AU1000_GPIO2_DIR);
79+
tmp &= ~mask;
80+
writel(tmp, gpch->regbase + AU1000_GPIO2_DIR);
81+
local_irq_restore(flags);
82+
5883
return 0;
5984
}
6085

61-
static int au1xxx_gpio2_direction_output(unsigned gpio, int value)
86+
static int au1000_gpio2_direction_output(struct gpio_chip *chip,
87+
unsigned offset, int value)
6288
{
63-
gpio -= AU1XXX_GPIO_BASE;
64-
gpio2->dir |= 0x01 << gpio;
65-
gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | ((!!value) << gpio);
89+
u32 mask = 1 << offset;
90+
u32 out_mask = ((GPIO2_OUT_EN_MASK << offset) | (!!value << offset));
91+
u32 tmp;
92+
struct au1000_gpio_chip *gpch;
93+
unsigned long flags;
94+
95+
gpch = container_of(chip, struct au1000_gpio_chip, chip);
96+
97+
local_irq_save(flags);
98+
tmp = readl(gpch->regbase + AU1000_GPIO2_DIR);
99+
tmp |= mask;
100+
writel(tmp, gpch->regbase + AU1000_GPIO2_DIR);
101+
writel(out_mask, gpch->regbase + AU1000_GPIO2_OUT);
102+
local_irq_restore(flags);
103+
66104
return 0;
67105
}
68-
69106
#endif /* !defined(CONFIG_SOC_AU1000) */
70107

71-
static int au1xxx_gpio1_read(unsigned gpio)
108+
static int au1000_gpio1_get(struct gpio_chip *chip, unsigned offset)
72109
{
73-
return (gpio1->pinstaterd >> gpio) & 0x01;
110+
u32 mask = 1 << offset;
111+
struct au1000_gpio_chip *gpch;
112+
113+
gpch = container_of(chip, struct au1000_gpio_chip, chip);
114+
return readl(gpch->regbase + AU1000_GPIO1_ST) & mask;
74115
}
75116

76-
static void au1xxx_gpio1_write(unsigned gpio, int value)
117+
static void au1000_gpio1_set(struct gpio_chip *chip,
118+
unsigned offset, int value)
77119
{
120+
u32 mask = 1 << offset;
121+
u32 reg_offset;
122+
struct au1000_gpio_chip *gpch;
123+
unsigned long flags;
124+
125+
gpch = container_of(chip, struct au1000_gpio_chip, chip);
126+
78127
if (value)
79-
gpio1->outputset = (0x01 << gpio);
128+
reg_offset = AU1000_GPIO1_OUT;
80129
else
81-
/* Output a zero */
82-
gpio1->outputclr = (0x01 << gpio);
83-
}
130+
reg_offset = AU1000_GPIO1_CLR;
84131

85-
static int au1xxx_gpio1_direction_input(unsigned gpio)
86-
{
87-
gpio1->pininputen = (0x01 << gpio);
88-
return 0;
132+
local_irq_save(flags);
133+
writel(mask, gpch->regbase + reg_offset);
134+
local_irq_restore(flags);
89135
}
90136

91-
static int au1xxx_gpio1_direction_output(unsigned gpio, int value)
137+
static int au1000_gpio1_direction_input(struct gpio_chip *chip, unsigned offset)
92138
{
93-
gpio1->trioutclr = (0x01 & gpio);
94-
au1xxx_gpio1_write(gpio, value);
139+
u32 mask = 1 << offset;
140+
struct au1000_gpio_chip *gpch;
141+
142+
gpch = container_of(chip, struct au1000_gpio_chip, chip);
143+
writel(mask, gpch->regbase + AU1000_GPIO1_ST);
144+
95145
return 0;
96146
}
97147

98-
int au1xxx_gpio_get_value(unsigned gpio)
148+
static int au1000_gpio1_direction_output(struct gpio_chip *chip,
149+
unsigned offset, int value)
99150
{
100-
if (gpio >= AU1XXX_GPIO_BASE)
101-
#if defined(CONFIG_SOC_AU1000)
102-
return 0;
103-
#else
104-
return au1xxx_gpio2_read(gpio);
105-
#endif
106-
else
107-
return au1xxx_gpio1_read(gpio);
108-
}
109-
EXPORT_SYMBOL(au1xxx_gpio_get_value);
151+
u32 mask = 1 << offset;
152+
struct au1000_gpio_chip *gpch;
110153

111-
void au1xxx_gpio_set_value(unsigned gpio, int value)
112-
{
113-
if (gpio >= AU1XXX_GPIO_BASE)
114-
#if defined(CONFIG_SOC_AU1000)
115-
;
116-
#else
117-
au1xxx_gpio2_write(gpio, value);
118-
#endif
119-
else
120-
au1xxx_gpio1_write(gpio, value);
121-
}
122-
EXPORT_SYMBOL(au1xxx_gpio_set_value);
154+
gpch = container_of(chip, struct au1000_gpio_chip, chip);
123155

124-
int au1xxx_gpio_direction_input(unsigned gpio)
125-
{
126-
if (gpio >= AU1XXX_GPIO_BASE)
127-
#if defined(CONFIG_SOC_AU1000)
128-
return -ENODEV;
129-
#else
130-
return au1xxx_gpio2_direction_input(gpio);
131-
#endif
156+
writel(mask, gpch->regbase + AU1000_GPIO1_TRI_OUT);
157+
au1000_gpio1_set(chip, offset, value);
132158

133-
return au1xxx_gpio1_direction_input(gpio);
159+
return 0;
134160
}
135-
EXPORT_SYMBOL(au1xxx_gpio_direction_input);
136161

137-
int au1xxx_gpio_direction_output(unsigned gpio, int value)
162+
struct au1000_gpio_chip au1000_gpio_chip[] = {
163+
[0] = {
164+
.regbase = (void __iomem *)SYS_BASE,
165+
.chip = {
166+
.label = "au1000-gpio1",
167+
.direction_input = au1000_gpio1_direction_input,
168+
.direction_output = au1000_gpio1_direction_output,
169+
.get = au1000_gpio1_get,
170+
.set = au1000_gpio1_set,
171+
.base = 0,
172+
.ngpio = 32,
173+
},
174+
},
175+
#if !defined(CONFIG_SOC_AU1000)
176+
[1] = {
177+
.regbase = (void __iomem *)GPIO2_BASE,
178+
.chip = {
179+
.label = "au1000-gpio2",
180+
.direction_input = au1000_gpio2_direction_input,
181+
.direction_output = au1000_gpio2_direction_output,
182+
.get = au1000_gpio2_get,
183+
.set = au1000_gpio2_set,
184+
.base = AU1XXX_GPIO_BASE,
185+
.ngpio = 32,
186+
},
187+
},
188+
#endif
189+
};
190+
191+
static int __init au1000_gpio_init(void)
138192
{
139-
if (gpio >= AU1XXX_GPIO_BASE)
140-
#if defined(CONFIG_SOC_AU1000)
141-
return -ENODEV;
142-
#else
143-
return au1xxx_gpio2_direction_output(gpio, value);
193+
gpiochip_add(&au1000_gpio_chip[0].chip);
194+
#if !defined(CONFIG_SOC_AU1000)
195+
gpiochip_add(&au1000_gpio_chip[1].chip);
144196
#endif
145197

146-
return au1xxx_gpio1_direction_output(gpio, value);
198+
return 0;
147199
}
148-
EXPORT_SYMBOL(au1xxx_gpio_direction_output);
200+
arch_initcall(au1000_gpio_init);
201+

arch/mips/alchemy/devboards/pb1200/platform.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/init.h>
2323
#include <linux/leds.h>
2424
#include <linux/platform_device.h>
25+
#include <linux/smc91x.h>
2526

2627
#include <asm/mach-au1x00/au1xxx.h>
2728
#include <asm/mach-au1x00/au1100_mmc.h>
@@ -131,6 +132,12 @@ static struct platform_device ide_device = {
131132
.resource = ide_resources
132133
};
133134

135+
static struct smc91x_platdata smc_data = {
136+
.flags = SMC91X_NOWAIT | SMC91X_USE_16BIT,
137+
.leda = RPC_LED_100_10,
138+
.ledb = RPC_LED_TX_RX,
139+
};
140+
134141
static struct resource smc91c111_resources[] = {
135142
[0] = {
136143
.name = "smc91x-regs",
@@ -146,6 +153,9 @@ static struct resource smc91c111_resources[] = {
146153
};
147154

148155
static struct platform_device smc91c111_device = {
156+
.dev = {
157+
.platform_data = &smc_data,
158+
},
149159
.name = "smc91x",
150160
.id = -1,
151161
.num_resources = ARRAY_SIZE(smc91c111_resources),

arch/mips/cavium-octeon/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ obj-y += dma-octeon.o flash_setup.o
1414
obj-y += octeon-memcpy.o
1515

1616
obj-$(CONFIG_SMP) += smp.o
17+
18+
EXTRA_CFLAGS += -Werror

0 commit comments

Comments
 (0)