* [PATCH v3 0/4] MIPS: ath79: various fixes
@ 2012-08-04 16:01 Gabor Juhos
2012-08-04 16:01 ` [PATCH v3 1/4] MIPS: ath79: fix number of GPIO lines for AR724[12] Gabor Juhos
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Gabor Juhos @ 2012-08-04 16:01 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, Gabor Juhos
This set contains four fixes for the ath79 platform, and it is
based on v3.6-rc1.
v3:
- rebase against v3.6-rc1
- add two more patches
Gabor Juhos (4):
MIPS: ath79: fix number of GPIO lines for AR724[12]
MIPS: ath79: use correct IRQ number for the OHCI controller on AR7240
MIPS: ath79: select HAVE_CLK
MIPS: ath79: don't override CPU ASE features
arch/mips/Kconfig | 1 +
arch/mips/ath79/dev-usb.c | 2 ++
arch/mips/ath79/gpio.c | 6 ++++--
arch/mips/include/asm/mach-ath79/ar71xx_regs.h | 3 ++-
arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h | 8 --------
5 files changed, 9 insertions(+), 11 deletions(-)
--
1.7.10
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v3 1/4] MIPS: ath79: fix number of GPIO lines for AR724[12]
2012-08-04 16:01 [PATCH v3 0/4] MIPS: ath79: various fixes Gabor Juhos
@ 2012-08-04 16:01 ` Gabor Juhos
2012-08-14 9:25 ` Ralf Baechle
2012-08-04 16:01 ` [PATCH v3 2/4] MIPS: ath79: use correct IRQ number for the OHCI controller on AR7240 Gabor Juhos
` (2 subsequent siblings)
3 siblings, 1 reply; 13+ messages in thread
From: Gabor Juhos @ 2012-08-04 16:01 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, Gabor Juhos
The AR724[12] SoCs have more GPIO lines than the AR7240.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
arch/mips/ath79/gpio.c | 6 ++++--
arch/mips/include/asm/mach-ath79/ar71xx_regs.h | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/mips/ath79/gpio.c b/arch/mips/ath79/gpio.c
index 29054f2..48fe762 100644
--- a/arch/mips/ath79/gpio.c
+++ b/arch/mips/ath79/gpio.c
@@ -188,8 +188,10 @@ void __init ath79_gpio_init(void)
if (soc_is_ar71xx())
ath79_gpio_count = AR71XX_GPIO_COUNT;
- else if (soc_is_ar724x())
- ath79_gpio_count = AR724X_GPIO_COUNT;
+ else if (soc_is_ar7240())
+ ath79_gpio_count = AR7240_GPIO_COUNT;
+ else if (soc_is_ar7241() || soc_is_ar7242())
+ ath79_gpio_count = AR7241_GPIO_COUNT;
else if (soc_is_ar913x())
ath79_gpio_count = AR913X_GPIO_COUNT;
else if (soc_is_ar933x())
diff --git a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
index 1caa78a..dde5044 100644
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
@@ -393,7 +393,8 @@
#define AR71XX_GPIO_REG_FUNC 0x28
#define AR71XX_GPIO_COUNT 16
-#define AR724X_GPIO_COUNT 18
+#define AR7240_GPIO_COUNT 18
+#define AR7241_GPIO_COUNT 20
#define AR913X_GPIO_COUNT 22
#define AR933X_GPIO_COUNT 30
#define AR934X_GPIO_COUNT 23
--
1.7.10
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 2/4] MIPS: ath79: use correct IRQ number for the OHCI controller on AR7240
2012-08-04 16:01 [PATCH v3 0/4] MIPS: ath79: various fixes Gabor Juhos
2012-08-04 16:01 ` [PATCH v3 1/4] MIPS: ath79: fix number of GPIO lines for AR724[12] Gabor Juhos
@ 2012-08-04 16:01 ` Gabor Juhos
2012-08-14 9:25 ` Ralf Baechle
2012-08-04 16:01 ` [PATCH v3 3/4] MIPS: ath79: select HAVE_CLK Gabor Juhos
2012-08-04 16:01 ` [PATCH v3 4/4] MIPS: ath79: don't override CPU ASE features Gabor Juhos
3 siblings, 1 reply; 13+ messages in thread
From: Gabor Juhos @ 2012-08-04 16:01 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, Gabor Juhos
The currently assigned IRQ number to the OHCI
controller is incorrect for the AR7240 SoC, and
that leads to the following error message from
the OHCI driver:
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ath79-ohci ath79-ohci: Atheros built-in OHCI controller
ath79-ohci ath79-ohci: new USB bus registered, assigned bus number 1
ath79-ohci ath79-ohci: irq 14, io mem 0x1b000000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usb 1-1: new full-speed USB device number 2 using ath79-ohci
ath79-ohci ath79-ohci: Unlink after no-IRQ? Controller is probably using the wrong IRQ.
Fix this by using the correct IRQ number.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
arch/mips/ath79/dev-usb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/mips/ath79/dev-usb.c b/arch/mips/ath79/dev-usb.c
index 36e9570..b2a2311 100644
--- a/arch/mips/ath79/dev-usb.c
+++ b/arch/mips/ath79/dev-usb.c
@@ -145,6 +145,8 @@ static void __init ar7240_usb_setup(void)
ath79_ohci_resources[0].start = AR7240_OHCI_BASE;
ath79_ohci_resources[0].end = AR7240_OHCI_BASE + AR7240_OHCI_SIZE - 1;
+ ath79_ohci_resources[1].start = ATH79_CPU_IRQ_USB;
+ ath79_ohci_resources[1].end = ATH79_CPU_IRQ_USB;
platform_device_register(&ath79_ohci_device);
}
--
1.7.10
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 3/4] MIPS: ath79: select HAVE_CLK
2012-08-04 16:01 [PATCH v3 0/4] MIPS: ath79: various fixes Gabor Juhos
2012-08-04 16:01 ` [PATCH v3 1/4] MIPS: ath79: fix number of GPIO lines for AR724[12] Gabor Juhos
2012-08-04 16:01 ` [PATCH v3 2/4] MIPS: ath79: use correct IRQ number for the OHCI controller on AR7240 Gabor Juhos
@ 2012-08-04 16:01 ` Gabor Juhos
2012-08-14 9:26 ` Ralf Baechle
2012-08-04 16:01 ` [PATCH v3 4/4] MIPS: ath79: don't override CPU ASE features Gabor Juhos
3 siblings, 1 reply; 13+ messages in thread
From: Gabor Juhos @ 2012-08-04 16:01 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, Gabor Juhos
It is needed in order to get rid of the following errors:
arch/mips/ath79/clock.c:353:13: error: redefinition of 'clk_get'
include/linux/clk.h:281:27: note: previous definition of 'clk_get' was here
arch/mips/ath79/clock.c:377:5: error: redefinition of 'clk_enable'
include/linux/clk.h:295:19: note: previous definition of 'clk_enable' was here
arch/mips/ath79/clock.c:383:6: error: redefinition of 'clk_disable'
include/linux/clk.h:300:20: note: previous definition of 'clk_disable' was here
arch/mips/ath79/clock.c:388:15: error: redefinition of 'clk_get_rate'
include/linux/clk.h:302:29: note: previous definition of 'clk_get_rate' was here
arch/mips/ath79/clock.c:394:6: error: redefinition of 'clk_put'
include/linux/clk.h:291:20: note: previous definition of 'clk_put' was here
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
arch/mips/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 566ce2d..88a8c73 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -89,6 +89,7 @@ config ATH79
select CEVT_R4K
select CSRC_R4K
select DMA_NONCOHERENT
+ select HAVE_CLK
select IRQ_CPU
select MIPS_MACHINE
select SYS_HAS_CPU_MIPS32_R2
--
1.7.10
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 4/4] MIPS: ath79: don't override CPU ASE features
2012-08-04 16:01 [PATCH v3 0/4] MIPS: ath79: various fixes Gabor Juhos
` (2 preceding siblings ...)
2012-08-04 16:01 ` [PATCH v3 3/4] MIPS: ath79: select HAVE_CLK Gabor Juhos
@ 2012-08-04 16:01 ` Gabor Juhos
2012-08-14 9:59 ` Ralf Baechle
3 siblings, 1 reply; 13+ messages in thread
From: Gabor Juhos @ 2012-08-04 16:01 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, Gabor Juhos
The ath79 platform covers various SoCs which are based on
the 24Kc and 74Kc cores. Currently various ASEs are disabled
explicitely by the cpu-feature-overrides header, even those
which are present in the 74Kc core.
The kernel is able to detect the available ASEs, so remove
the overrides.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h | 8 --------
1 file changed, 8 deletions(-)
diff --git a/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
index 4476fa0..edbf23e 100644
--- a/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
@@ -32,19 +32,11 @@
#define cpu_has_ejtag 1
#define cpu_has_llsc 1
-#define cpu_has_mips16 1
-#define cpu_has_mdmx 0
-#define cpu_has_mips3d 0
-#define cpu_has_smartmips 0
-
#define cpu_has_mips32r1 1
#define cpu_has_mips32r2 1
#define cpu_has_mips64r1 0
#define cpu_has_mips64r2 0
-#define cpu_has_dsp 0
-#define cpu_has_mipsmt 0
-
#define cpu_has_64bits 0
#define cpu_has_64bit_zero_reg 0
#define cpu_has_64bit_gp_regs 0
--
1.7.10
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/4] MIPS: ath79: fix number of GPIO lines for AR724[12]
2012-08-04 16:01 ` [PATCH v3 1/4] MIPS: ath79: fix number of GPIO lines for AR724[12] Gabor Juhos
@ 2012-08-14 9:25 ` Ralf Baechle
2012-08-14 11:58 ` Gabor Juhos
0 siblings, 1 reply; 13+ messages in thread
From: Ralf Baechle @ 2012-08-14 9:25 UTC (permalink / raw)
To: Gabor Juhos; +Cc: linux-mips
Applied. Lemme know if this one also is required for any of the -stable
branches.
Ralf
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/4] MIPS: ath79: use correct IRQ number for the OHCI controller on AR7240
2012-08-04 16:01 ` [PATCH v3 2/4] MIPS: ath79: use correct IRQ number for the OHCI controller on AR7240 Gabor Juhos
@ 2012-08-14 9:25 ` Ralf Baechle
2012-08-14 12:01 ` Gabor Juhos
0 siblings, 1 reply; 13+ messages in thread
From: Ralf Baechle @ 2012-08-14 9:25 UTC (permalink / raw)
To: Gabor Juhos; +Cc: linux-mips
Applied. Lemme know if this one also is required for any of the -stable
branches.
Ralf
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 3/4] MIPS: ath79: select HAVE_CLK
2012-08-04 16:01 ` [PATCH v3 3/4] MIPS: ath79: select HAVE_CLK Gabor Juhos
@ 2012-08-14 9:26 ` Ralf Baechle
2012-08-14 12:28 ` Gabor Juhos
0 siblings, 1 reply; 13+ messages in thread
From: Ralf Baechle @ 2012-08-14 9:26 UTC (permalink / raw)
To: Gabor Juhos; +Cc: linux-mips
Applied. Lemme know if this one also is required for any of the -stable
branches.
Ralf
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 4/4] MIPS: ath79: don't override CPU ASE features
2012-08-04 16:01 ` [PATCH v3 4/4] MIPS: ath79: don't override CPU ASE features Gabor Juhos
@ 2012-08-14 9:59 ` Ralf Baechle
2012-08-14 12:29 ` Gabor Juhos
0 siblings, 1 reply; 13+ messages in thread
From: Ralf Baechle @ 2012-08-14 9:59 UTC (permalink / raw)
To: Gabor Juhos; +Cc: linux-mips
On Sat, Aug 04, 2012 at 06:01:27PM +0200, Gabor Juhos wrote:
> The ath79 platform covers various SoCs which are based on
> the 24Kc and 74Kc cores. Currently various ASEs are disabled
> explicitely by the cpu-feature-overrides header, even those
> which are present in the 74Kc core.
>
> The kernel is able to detect the available ASEs, so remove
> the overrides.
>
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> ---
> arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
> index 4476fa0..edbf23e 100644
> --- a/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
> +++ b/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
> @@ -32,19 +32,11 @@
> #define cpu_has_ejtag 1
> #define cpu_has_llsc 1
>
> -#define cpu_has_mips16 1
Both 24K and 74K always implement MIPS16, so leave this defined to 1.
> -#define cpu_has_mdmx 0
> -#define cpu_has_mips3d 0
Neither the 24K nor he 74K implement MIPS-3D or MDMX, so best leave these
defined to 0.
> -#define cpu_has_smartmips 0
Neither the 24K nor he 74K implement SmartMIPS, so best leave this defined
to 0.
> #define cpu_has_mips32r1 1
> #define cpu_has_mips32r2 1
> #define cpu_has_mips64r1 0
> #define cpu_has_mips64r2 0
>
> -#define cpu_has_dsp 0
24K has no DSP extension, 24KE has DSP extensions (version 1 afair). 74K
implements DSP ASE version 2. So if you have a plain 24K (or 24Kc or
24Kf or other non-24KE based 24K variant), wire this to 0. If you have
a 24KE family core then removing the definition is the right thing.
> -#define cpu_has_mipsmt 0
Neither implements the MT ASE, so best leave these defined to 0.
Generally, hardwire whatever you can. This will make gcc eleminate lots
of dead code and result in a significantly smaller and also faster kernel.
Ralf
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/4] MIPS: ath79: fix number of GPIO lines for AR724[12]
2012-08-14 9:25 ` Ralf Baechle
@ 2012-08-14 11:58 ` Gabor Juhos
0 siblings, 0 replies; 13+ messages in thread
From: Gabor Juhos @ 2012-08-14 11:58 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips
2012.08.14. 11:25 keltezéssel, Ralf Baechle írta:
> Applied.
Thanks!
> Lemme know if this one also is required for any of the -stable
> branches.
The patch should go into the 3.0+ stable branches.
It has been introduced by the following commit:
6eae43c57ee92de91f6cc7c391cea97c43295da0 (MIPS: ath79: add GPIOLIB support)
git describe --contains 6eae43c57ee92de91f6cc7c391cea97c43295da0 --match 'v*'
v2.6.38-rc1~4^2~12
Although the issues is present since 2.6.38, but 2.6.38 and 2.6.39 is EOL already.
-Gabor
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/4] MIPS: ath79: use correct IRQ number for the OHCI controller on AR7240
2012-08-14 9:25 ` Ralf Baechle
@ 2012-08-14 12:01 ` Gabor Juhos
0 siblings, 0 replies; 13+ messages in thread
From: Gabor Juhos @ 2012-08-14 12:01 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips
2012.08.14. 11:25 keltezéssel, Ralf Baechle írta:
> Applied. Lemme know if this one also is required for any of the -stable
> branches.
It is broken since:
7e98aa4639cba9ef5c99b1484bc86ddb04f67b80 (MIPS: ath79: add common USB Host
Controller device)
git describe --contains 7e98aa4639cba9ef5c99b1484bc86ddb04f67b80 --match 'v*'
v3.3-rc1~65^2^3~23
3.3 is EOL already, so this should go only into 3.4+ stable branches.
Thanks,
Gabor
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 3/4] MIPS: ath79: select HAVE_CLK
2012-08-14 9:26 ` Ralf Baechle
@ 2012-08-14 12:28 ` Gabor Juhos
0 siblings, 0 replies; 13+ messages in thread
From: Gabor Juhos @ 2012-08-14 12:28 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips
2012.08.14. 11:26 keltezéssel, Ralf Baechle írta:
> Applied. Lemme know if this one also is required for any of the -stable
> branches.
This is only required for 3.6.
Thanks,
Gabor
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 4/4] MIPS: ath79: don't override CPU ASE features
2012-08-14 9:59 ` Ralf Baechle
@ 2012-08-14 12:29 ` Gabor Juhos
0 siblings, 0 replies; 13+ messages in thread
From: Gabor Juhos @ 2012-08-14 12:29 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips
2012.08.14. 11:59 keltezéssel, Ralf Baechle írta:
> On Sat, Aug 04, 2012 at 06:01:27PM +0200, Gabor Juhos wrote:
>
>> The ath79 platform covers various SoCs which are based on
>> the 24Kc and 74Kc cores. Currently various ASEs are disabled
>> explicitely by the cpu-feature-overrides header, even those
>> which are present in the 74Kc core.
>>
>> The kernel is able to detect the available ASEs, so remove
>> the overrides.
>>
>> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
>> ---
>> arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h | 8 --------
>> 1 file changed, 8 deletions(-)
>>
>> diff --git a/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
>> index 4476fa0..edbf23e 100644
>> --- a/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
>> +++ b/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
>> @@ -32,19 +32,11 @@
>> #define cpu_has_ejtag 1
>> #define cpu_has_llsc 1
>>
>> -#define cpu_has_mips16 1
>
> Both 24K and 74K always implement MIPS16, so leave this defined to 1.
>
>> -#define cpu_has_mdmx 0
>> -#define cpu_has_mips3d 0
>
> Neither the 24K nor he 74K implement MIPS-3D or MDMX, so best leave these
> defined to 0.
>
>> -#define cpu_has_smartmips 0
>
> Neither the 24K nor he 74K implement SmartMIPS, so best leave this defined
> to 0.
Ok, I will keep these lines.
>
>> #define cpu_has_mips32r1 1
>> #define cpu_has_mips32r2 1
>> #define cpu_has_mips64r1 0
>> #define cpu_has_mips64r2 0
>>
>> -#define cpu_has_dsp 0
>
> 24K has no DSP extension, 24KE has DSP extensions (version 1 afair). 74K
> implements DSP ASE version 2. So if you have a plain 24K (or 24Kc or
> 24Kf or other non-24KE based 24K variant), wire this to 0. If you have
> a 24KE family core then removing the definition is the right thing.
The AR71xx/AR724x/AR913x/AR933x SoCs are using the 24Kc core, but the AR934x
SoCs are using 74K. The ath79 platform code can support all of these SoCs within
a single kernel, so removing the definition seems to be the right thing.
Although it would be possible to optimize things if only the 24K or the 74K
based SoCs are selected, but that would require ugly ifdef statements.
>
>> -#define cpu_has_mipsmt 0
>
> Neither implements the MT ASE, so best leave these defined to 0.
Ok.
> Generally, hardwire whatever you can. This will make gcc eleminate lots
> of dead code and result in a significantly smaller and also faster kernel.
I will send an updated patch. Thank you for the review!
-Gabor
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2012-08-14 12:29 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-04 16:01 [PATCH v3 0/4] MIPS: ath79: various fixes Gabor Juhos
2012-08-04 16:01 ` [PATCH v3 1/4] MIPS: ath79: fix number of GPIO lines for AR724[12] Gabor Juhos
2012-08-14 9:25 ` Ralf Baechle
2012-08-14 11:58 ` Gabor Juhos
2012-08-04 16:01 ` [PATCH v3 2/4] MIPS: ath79: use correct IRQ number for the OHCI controller on AR7240 Gabor Juhos
2012-08-14 9:25 ` Ralf Baechle
2012-08-14 12:01 ` Gabor Juhos
2012-08-04 16:01 ` [PATCH v3 3/4] MIPS: ath79: select HAVE_CLK Gabor Juhos
2012-08-14 9:26 ` Ralf Baechle
2012-08-14 12:28 ` Gabor Juhos
2012-08-04 16:01 ` [PATCH v3 4/4] MIPS: ath79: don't override CPU ASE features Gabor Juhos
2012-08-14 9:59 ` Ralf Baechle
2012-08-14 12:29 ` Gabor Juhos
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.