initial suport for Alpscale ASM9260
Subsystems (10)
v2 cover initial suport for Alpscale ASM9260
This patchset provide initial support for Alpscale ASM9260, ARM based SoC.
Oleksij Rempel (8):
ARM: add mach-asm9260
add include/debug/asm9260.S
add alphascale,asm9260.h binding
ARM: dts: add DT for Alphascale ASM9260 SoC
clk: add clk-asm9260 driver
clocksource: add asm9260_timer driver
irqchip: add irq-asm9260 driver
tty/serial: add asm9260-serial driver
arch/arm/Kconfig | 14 + arch/arm/Kconfig.debug | 33 +- arch/arm/Makefile | 1 + arch/arm/boot/dts/Makefile | 2 + arch/arm/boot/dts/alphascale-asm9260-devkit.dts | 15 + arch/arm/boot/dts/alphascale-asm9260.dtsi | 166 +++ arch/arm/include/debug/asm9260.S | 31 + arch/arm/mach-asm9260/Makefile | 11 + arch/arm/mach-asm9260/Makefile.boot | 2 + arch/arm/mach-asm9260/core.c | 77 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-asm9260.c | 350 ++++++ drivers/clocksource/Makefile | 1 + drivers/clocksource/asm9260_timer.c | 244 ++++ drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-asm9260.c | 257 ++++ drivers/tty/serial/Kconfig | 17 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/asm9260_serial.c | 1485 +++++++++++++++++++++++ include/dt-bindings/clock/alphascale,asm9260.h | 97 ++ include/uapi/linux/serial_core.h | 2 + 21 files changed, 2805 insertions(+), 3 deletions(-) create mode 100644 arch/arm/boot/dts/alphascale-asm9260-devkit.dts create mode 100644 arch/arm/boot/dts/alphascale-asm9260.dtsi create mode 100644 arch/arm/include/debug/asm9260.S create mode 100644 arch/arm/mach-asm9260/Makefile create mode 100644 arch/arm/mach-asm9260/Makefile.boot create mode 100644 arch/arm/mach-asm9260/core.c create mode 100644 drivers/clk/clk-asm9260.c create mode 100644 drivers/clocksource/asm9260_timer.c create mode 100644 drivers/irqchip/irq-asm9260.c create mode 100644 drivers/tty/serial/asm9260_serial.c create mode 100644 include/dt-bindings/clock/alphascale,asm9260.h
Signature · 1 line
1.9.1
PATCH v2 1/8 ARM: add mach-asm9260
it is low cost (?) SoC targeted for market in China and India which trying to compete with AT91SAM9G25.
Here is some info:
http://www.alphascale.com/index.asp?ics/615.html
--- arch/arm/Kconfig | 14 +++++++ arch/arm/Makefile | 1 + arch/arm/mach-asm9260/Makefile | 11 ++++++ arch/arm/mach-asm9260/Makefile.boot | 2 + arch/arm/mach-asm9260/core.c | 77 +++++++++++++++++++++++++++++++++++++ 5 files changed, 105 insertions(+) create mode 100644 arch/arm/mach-asm9260/Makefile create mode 100644 arch/arm/mach-asm9260/Makefile.boot create mode 100644 arch/arm/mach-asm9260/core.c
arch/arm/Kconfig +14 -0
@@ -379,6 +379,20 @@ config ARCH_AT91 This enables support for systems based on Atmel AT91RM9200 and AT91SAM9* processors. +config MACH_ASM9260 + bool "Alphascale ASM9260" + select ARCH_REQUIRE_GPIOLIB + select COMMON_CLK + select IRQ_DOMAIN + select SPARSE_IRQ + select MULTI_IRQ_HANDLER + select GENERIC_IRQ_CHIP + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO + select CPU_ARM926T + help + Support for Alpascale ASM9260 based platform. + config ARCH_CLPS711X bool "Cirrus Logic CLPS711x/EP721x/EP731x-based" select ARCH_REQUIRE_GPIOLIB
arch/arm/Makefile +1 -0
@@ -146,6 +146,7 @@ textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000 # Machine directory name. This list is sorted alphanumerically # by CONFIG_* macro name. machine-$(CONFIG_ARCH_AT91) += at91 +machine-$(CONFIG_MACH_ASM9260) += asm9260 machine-$(CONFIG_ARCH_AXXIA) += axxia machine-$(CONFIG_ARCH_BCM) += bcm machine-$(CONFIG_ARCH_BERLIN) += berlin
arch/arm/mach-asm9260/Makefile new file +11 -0
@@ -0,0 +1,11 @@ +# +# Makefile for the linux kernel. +# + +# Object file lists. + +obj-y := core.o +obj-m := +obj-n := +obj- := +
arch/arm/mach-asm9260/Makefile.boot new file +2 -0
@@ -0,0 +1,2 @@ +zreladdr-y := 0x20008000 +
arch/arm/mach-asm9260/core.c new file +77 -0
77 lines not on this page · raw message
Signature · 1 line
1.9.1
Arnd Bergmann
maintainerPATCH v2 1/8 ARM: add mach-asm9260
Quoted 10 lines · On Sunday 21 September 2014 20:41:37 Oleksij Rempel wrote:
it is low cost (?) SoC targeted for market in China and India which trying to compete with AT91SAM9G25.
Here is some info:
http://www.alphascale.com/index.asp?ics/615.htmlSigned-off-by Oleksij Rempel <[email protected]>
Thanks for the submission! It looks pretty good, but has one main mistake in being incompatible with ARCH_MULTIPLATFORM. I think that should be easy to fix. There are also a few minor issues that can be improved.
Quoted 11 lines
arch/arm/Kconfig +3
-0@@ -379,6 +379,20 @@ config ARCH_AT91 This enables support for systems based on Atmel AT91RM9200 and AT91SAM9* processors. +config MACH_ASM9260 + bool "Alphascale ASM9260" + select ARCH_REQUIRE_GPIOLIB
arch/arm/Kconfig config ARCH_AT91 · line 394
Quoted 10 lines
arch/arm/Kconfig +10
-0+ select COMMON_CLK + select IRQ_DOMAIN + select SPARSE_IRQ + select MULTI_IRQ_HANDLER + select GENERIC_IRQ_CHIP + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO + select CPU_ARM926T + help + Support for Alpascale ASM9260 based platform.
To enable multiplatform support, please move this to its own arch/arm/mach-asm9260/Kconfig file and make it depend on ARCH_MULTI_V5, then remove all 'select' statements that are implicitly enabled there already (most of the above).
Quoted 6 lines
arch/arm/mach-asm9260/Makefile new file +0
-0
arch/arm/mach-asm9260/Makefile line 10
Quoted 10 lines
arch/arm/mach-asm9260/Makefile new file +10
-0@@ -0,0 +1,11 @@ +# +# Makefile for the linux kernel. +# + +# Object file lists. + +obj-y := core.o +obj-m := +obj-n := +obj- :=
You can remove most of these and just leave the one line.
arch/arm/mach-asm9260/Makefile.boot line 1
Quoted 7 lines
arch/arm/mach-asm9260/Makefile.boot new file +1
-0@@ -0,0 +1,2 @@ +zreladdr-y := 0x20008000
This file should be removed, nowadays we use AUTO_ZRELADDR, which is implied by multiplatform.
Quoted 20 lines
arch/arm/mach-asm9260/Makefile.boot new file +20
-0+static struct map_desc asm9260_io_desc[] __initdata = { + { /* IO space */ + .virtual = (unsigned long)0xf0000000, + .pfn = __phys_to_pfn(0x80000000), + .length = 0x00800000, + .type = MT_DEVICE + }, + { /* LCD IO space */ + .virtual = (unsigned long)0xf0a00000, + .pfn = __phys_to_pfn(0x80800000), + .length = 0x00009000, + .type = MT_DEVICE + }, + { /* GPIO IO space */ + .virtual = (unsigned long)0xf0800000, + .pfn = __phys_to_pfn(0x50000000), + .length = 0x00100000, + .type = MT_DEVICE + }, + { /* SRAM space Cacheable */
arch/arm/mach-asm9260/Makefile.boot
Quoted 10 lines
arch/arm/mach-asm9260/Makefile.boot new file +10
-0+ .virtual = (unsigned long)0xd0000000, + .pfn = __phys_to_pfn(0x40000000), + .length = 0x00100000, +#ifdef CONFIG_SRAM_MEM_CACHED + .type = MT_MEMORY +#else + .type = MT_DEVICE +#endif + }, +};
This should not be necessary, as all drivers are supposed to ioremap their own device registers. For large register ranges that are used a lot, you could use these as an optimization to get 1 MB sections mapped using a large TLB entry, but usually the benefit is very small.
arch/arm/mach-asm9260/Makefile.boot
Quoted 4 lines
arch/arm/mach-asm9260/Makefile.boot new file +4
-0+static void __init asm9260_init(void) +{ + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +}
When you don't do anything else in the init_machine callback, you can remove it entirely.
Arnd
PATCH v2 1/8 ARM: add mach-asm9260
Am 22.09.2014 um 17:08 schrieb Arnd Bergmann:
Quoted 34 lines · On Sunday 21 September 2014 20:41:37 Oleksij Rempel wrote:
Quoted 10 lines
it is low cost (?) SoC targeted for market in China and India which trying to compete with AT91SAM9G25.
Here is some info:
http://www.alphascale.com/index.asp?ics/615.htmlSigned-off-by Oleksij Rempel <[email protected]>Thanks for the submission! It looks pretty good, but has one main mistake in being incompatible with
ARCH_MULTIPLATFORM. I think that should be easy to fix. There are also a few minor issues that can be improved.Quoted 18 lines
arch/arm/Kconfig +10
-0@@ -379,6 +379,20 @@ config ARCH_AT91 This enables support for systems based on Atmel AT91RM9200 and AT91SAM9* processors. +config MACH_ASM9260 + bool "Alphascale ASM9260" + select ARCH_REQUIRE_GPIOLIB + select COMMON_CLK + select IRQ_DOMAIN + select SPARSE_IRQ + select MULTI_IRQ_HANDLER + select GENERIC_IRQ_CHIP + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO
Quoted 8 lines
arch/arm/Kconfig config ARCH_AT91 · line 394
Quoted 3 lines
arch/arm/Kconfig +3
-0+ select CPU_ARM926T + help + Support for Alpascale ASM9260 based platform.To enable multiplatform support, please move this to its own
arch/arm/mach-asm9260/Kconfigfile and make it depend onARCH_MULTI_V5, then remove all 'select' statements that are implicitly enabled there already (most of the above).
Should they be only in defconfig or selected by driver?
Quoted 58 lines
Quoted 6 lines
arch/arm/mach-asm9260/Makefile new file +0
-0arch/arm/mach-asm9260/Makefile line 10
Quoted 10 lines
arch/arm/mach-asm9260/Makefile new file +10
-0@@ -0,0 +1,11 @@ +# +# Makefile for the linux kernel. +# + +# Object file lists. + +obj-y := core.o +obj-m := +obj-n := +obj- :=You can remove most of these and just leave the one line.
arch/arm/mach-asm9260/Makefile.boot line 1
Quoted 7 lines
arch/arm/mach-asm9260/Makefile.boot new file +1
-0@@ -0,0 +1,2 @@ +zreladdr-y := 0x20008000This file should be removed, nowadays we use
AUTO_ZRELADDR, which is implied by multiplatform.Quoted 28 lines
arch/arm/mach-asm9260/Makefile.boot new file +28
-0+static struct map_desc asm9260_io_desc[] __initdata = { + { /* IO space */ + .virtual = (unsigned long)0xf0000000, + .pfn = __phys_to_pfn(0x80000000), + .length = 0x00800000, + .type = MT_DEVICE + }, + { /* LCD IO space */ + .virtual = (unsigned long)0xf0a00000, + .pfn = __phys_to_pfn(0x80800000), + .length = 0x00009000, + .type = MT_DEVICE + }, + { /* GPIO IO space */ + .virtual = (unsigned long)0xf0800000, + .pfn = __phys_to_pfn(0x50000000), + .length = 0x00100000, + .type = MT_DEVICE + }, + { /* SRAM space Cacheable */ + .virtual = (unsigned long)0xd0000000, + .pfn = __phys_to_pfn(0x40000000), + .length = 0x00100000, +#ifdef CONFIG_SRAM_MEM_CACHED + .type = MT_MEMORY +#else + .type = MT_DEVICE +#endif
Quoted 8 lines
arch/arm/mach-asm9260/Makefile.boot
Quoted 2 lines
arch/arm/mach-asm9260/Makefile.boot new file +2
-0+ }, +};This should not be necessary, as all drivers are supposed to ioremap their own device registers. For large register ranges that are used a lot, you could use these as an optimization to get 1 MB sections mapped using a large TLB entry, but usually the benefit is very small.
Do you mean only "SRAM space Cacheable" section?
Quoted 10 lines
arch/arm/mach-asm9260/Makefile.boot
Quoted 4 lines
arch/arm/mach-asm9260/Makefile.boot new file +4
-0+static void __init asm9260_init(void) +{ + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +}When you don't do anything else in the
init_machinecallback, you can remove it entirely.Arnd
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 213 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140923/206fb525/attachment-0001.sig>
Arnd Bergmann
maintainerPATCH v2 1/8 ARM: add mach-asm9260
Quoted 29 lines · On Tuesday 23 September 2014 11:00:32 Oleksij Rempel wrote:
Am 22.09.2014 um 17:08 schrieb Arnd Bergmann:
Quoted 19 lines · On Sunday 21 September 2014 20:41:37 Oleksij Rempel wrote:
Quoted 18 lines
arch/arm/Kconfig +10
-0@@ -379,6 +379,20 @@ config ARCH_AT91 This enables support for systems based on Atmel AT91RM9200 and AT91SAM9* processors. +config MACH_ASM9260 + bool "Alphascale ASM9260" + select ARCH_REQUIRE_GPIOLIB + select COMMON_CLK + select IRQ_DOMAIN + select SPARSE_IRQ + select MULTI_IRQ_HANDLER + select GENERIC_IRQ_CHIP + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIOQuoted 8 lines
arch/arm/Kconfig config ARCH_AT91 · line 394
Quoted 3 lines
arch/arm/Kconfig +3
-0+ select CPU_ARM926T + help + Support for Alpascale ASM9260 based platform.To enable multiplatform support, please move this to its own
arch/arm/mach-asm9260/Kconfigfile and make it depend onARCH_MULTI_V5, then remove all 'select' statements that are implicitly enabled there already (most of the above).
Quoted 1 line
Should they be only in defconfig or selected by driver?
The dependencies should match whatever the platform requires. Anything that is optional and user-selectable better goes into the defconfig.
Quoted 37 lines
Quoted 28 lines
Quoted 28 lines
arch/arm/Kconfig +28
-0+static struct map_desc asm9260_io_desc[] __initdata = { + { /* IO space */ + .virtual = (unsigned long)0xf0000000, + .pfn = __phys_to_pfn(0x80000000), + .length = 0x00800000, + .type = MT_DEVICE + }, + { /* LCD IO space */ + .virtual = (unsigned long)0xf0a00000, + .pfn = __phys_to_pfn(0x80800000), + .length = 0x00009000, + .type = MT_DEVICE + }, + { /* GPIO IO space */ + .virtual = (unsigned long)0xf0800000, + .pfn = __phys_to_pfn(0x50000000), + .length = 0x00100000, + .type = MT_DEVICE + }, + { /* SRAM space Cacheable */ + .virtual = (unsigned long)0xd0000000, + .pfn = __phys_to_pfn(0x40000000), + .length = 0x00100000, +#ifdef CONFIG_SRAM_MEM_CACHED + .type = MT_MEMORY +#else + .type = MT_DEVICE +#endifQuoted 8 lines
arch/arm/Kconfig
Quoted 2 lines
arch/arm/Kconfig +2
-0+ }, +};This should not be necessary, as all drivers are supposed to ioremap their own device registers. For large register ranges that are used a lot, you could use these as an optimization to get 1 MB sections mapped using a large TLB entry, but usually the benefit is very small.
Quoted 1 line
Do you mean only "SRAM space Cacheable" section?
No, all of them.
Arnd
PATCH v2 1/8 ARM: add mach-asm9260
Am 23.09.2014 um 12:19 schrieb Arnd Bergmann:
Quoted 72 lines · On Tuesday 23 September 2014 11:00:32 Oleksij Rempel wrote:
Quoted 29 lines
Am 22.09.2014 um 17:08 schrieb Arnd Bergmann:
Quoted 19 lines · On Sunday 21 September 2014 20:41:37 Oleksij Rempel wrote:
Quoted 18 lines
arch/arm/Kconfig +10
-0@@ -379,6 +379,20 @@ config ARCH_AT91 This enables support for systems based on Atmel AT91RM9200 and AT91SAM9* processors. +config MACH_ASM9260 + bool "Alphascale ASM9260" + select ARCH_REQUIRE_GPIOLIB + select COMMON_CLK + select IRQ_DOMAIN + select SPARSE_IRQ + select MULTI_IRQ_HANDLER + select GENERIC_IRQ_CHIP + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIOQuoted 8 lines
arch/arm/Kconfig config ARCH_AT91 · line 394
Quoted 3 lines
arch/arm/Kconfig +3
-0+ select CPU_ARM926T + help + Support for Alpascale ASM9260 based platform.To enable multiplatform support, please move this to its own
arch/arm/mach-asm9260/Kconfigfile and make it depend onARCH_MULTI_V5, then remove all 'select' statements that are implicitly enabled there already (most of the above).Quoted 1 line
Should they be only in defconfig or selected by driver?
The dependencies should match whatever the platform requires. Anything that is optional and user-selectable better goes into the defconfig.
Quoted 37 lines
Quoted 36 lines
Quoted 20 lines
arch/arm/Kconfig +20
-0+static struct map_desc asm9260_io_desc[] __initdata = { + { /* IO space */ + .virtual = (unsigned long)0xf0000000, + .pfn = __phys_to_pfn(0x80000000), + .length = 0x00800000, + .type = MT_DEVICE + }, + { /* LCD IO space */ + .virtual = (unsigned long)0xf0a00000, + .pfn = __phys_to_pfn(0x80800000), + .length = 0x00009000, + .type = MT_DEVICE + }, + { /* GPIO IO space */ + .virtual = (unsigned long)0xf0800000, + .pfn = __phys_to_pfn(0x50000000), + .length = 0x00100000, + .type = MT_DEVICE + }, + { /* SRAM space Cacheable */arch/arm/Kconfig config ARCH_AT91
Quoted 10 lines
arch/arm/Kconfig +10
-0+ .virtual = (unsigned long)0xd0000000, + .pfn = __phys_to_pfn(0x40000000), + .length = 0x00100000, +#ifdef CONFIG_SRAM_MEM_CACHED + .type = MT_MEMORY +#else + .type = MT_DEVICE +#endif + }, +};This should not be necessary, as all drivers are supposed to ioremap their own device registers. For large register ranges that are used a lot, you could use these as an optimization to get 1 MB sections mapped using a large TLB entry, but usually the benefit is very small.
Quoted 3 lines
Quoted 1 line
Do you mean only "SRAM space Cacheable" section?
No, all of them.
By removing it i triggered one error which i don't really understand. It will be great if you can help me.
By defaul kernel will do fallowing remapping, which will trigger:
"Unable to handle kernel paging request at virtual address c2802174"
phys addr ioremap range size
=======================================0x80054000 -> c2800000 size: 0x2000x80040000 -> c2802000 size: 0x2040x80088000 -> c2808000 size: 0x4000
But if change second range from 0x204 to 0x4000, then it works fine. 0x80054000 -> c2800000 size: 0x2000x80040000 -> c2808000 size: 0x40000x80088000 -> c2810000 size: 0x4000
Why?
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 213 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140924/94c5ab2e/attachment-0001.sig>
PATCH v2 1/8 ARM: add mach-asm9260
Quoted 16 lines · Oleksij Rempel
Am 23.09.2014 um 12:19 schrieb Arnd Bergmann:
Quoted 1 line
No, all of them.
By removing it i triggered one error which i don't really understand. It will be great if you can help me.
By defaul kernel will do fallowing remapping, which will trigger:
"Unable to handle kernel paging request at virtual addressc2802174"phys addr ioremap range size
=======================================0x80054000->c2800000size:0x2000x80040000->c2802000size:0x2040x80088000->c2808000size:0x4000
Quoted 6 lines
But if change second range from
0x204to0x4000, then it works fine.0x80054000->c2800000size:0x2000x80040000->c2808000size:0x40000x80088000->c2810000size:0x4000Why?
The "why" is in the text from your oops dump. That's precisely /why/ we print that text - so that we know /why/ the fault happened.
Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according to speedtest.net.
PATCH v2 1/8 ARM: add mach-asm9260
Am 24.09.2014 um 11:43 schrieb Russell King - ARM Linux:
Quoted 22 lines · Oleksij Rempel
Quoted 21 lines
Am 23.09.2014 um 12:19 schrieb Arnd Bergmann:
Quoted 1 line
No, all of them.
By removing it i triggered one error which i don't really understand. It will be great if you can help me.
By defaul kernel will do fallowing remapping, which will trigger:
"Unable to handle kernel paging request at virtual addressc2802174"phys addr ioremap range size
=======================================0x80054000->c2800000size:0x2000x80040000->c2802000size:0x2040x80088000->c2808000size:0x4000But if change second range from
0x204to0x4000, then it works fine.0x80054000->c2800000size:0x2000x80040000->c2808000size:0x40000x80088000->c2810000size:0x4000
Quoted 5 lines
Quoted 1 line
Why?
The "why" is in the text from your oops dump. That's precisely /why/ we print that text - so that we know /why/ the fault happened.
Here is oops message:
http://pastebin.com/qYWeAyfV
i can avoid this oops by setting size at least 0x2000 per register range. Do it mean my TLB supports only 8 KiB pages?
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 213 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140924/52b58f5f/attachment.sig>
PATCH v2 1/8 ARM: add mach-asm9260
Quoted 9 lines · Oleksij Rempel
Am 24.09.2014 um 11:43 schrieb Russell King - ARM Linux:
Quoted 2 lines
The "why" is in the text from your oops dump. That's precisely /why/ we print that text - so that we know /why/ the fault happened.
Here is oops message:
http://pastebin.com/qYWeAyfVi can avoid this oops by setting size at least
0x2000per register range. Do it mean my TLB supports only 8 KiB pages?
No, it has nothing to do with the TLB.
Unable to handle kernel paging request at virtual address c2802174 pgd = c0004000 [c2802174] *pgd=21805811, *pte=00000000, *ppte=00000000 Internal error: Oops: 7 [#1] PREEMPT ARM
The number after the Oops: is the FSR value, which means "page translation fault", and sure enough, the pgd/pte values show that there is no page table entry at the faulting address.
That's odd, because ioremap() aligns the size of the requested mapping up to a multiple of the page size, and inserts page table entries according to the rounded size.
Where are you calling ioremap(), iounmap() etc? IOW, please show your code for this.
I also notice that the unwinder failed to unwind the complete backtrace:
[<c02bcb38>] (clk_gate_is_enabled) from [<c02b9a0c>] (clk_disable_unused_subtree+) [<c02b9a0c>] (clk_disable_unused_subtree) from [<c02b99c8>] (clk_disable_unused_s)
which is really annoying. Maybe turning frame pointers on will get is a proper backtrace, though I don't think it's that important to this bug.
Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according to speedtest.net.
Arnd Bergmann
maintainerPATCH v2 1/8 ARM: add mach-asm9260
Quoted 22 lines · On Wednesday 24 September 2014 11:25:42 Russell King - ARM Linux wrote:
Quoted 9 lines · Oleksij Rempel
Am 24.09.2014 um 11:43 schrieb Russell King - ARM Linux:
Quoted 2 lines
The "why" is in the text from your oops dump. That's precisely /why/ we print that text - so that we know /why/ the fault happened.
Here is oops message:
http://pastebin.com/qYWeAyfVi can avoid this oops by setting size at least
0x2000per register range. Do it mean my TLB supports only 8 KiB pages?No, it has nothing to do with the TLB.
Unable to handle kernel paging request at virtual address c2802174 pgd = c0004000 [c2802174] *pgd=21805811, *pte=00000000, *ppte=00000000 Internal error: Oops: 7 [#1] PREEMPT ARMThe number after the Oops: is the FSR value, which means "page translation fault", and sure enough, the pgd/pte values show that there is no page table entry at the faulting address.
Quoted 6 lines
That's odd, because
ioremap()aligns the size of the requested mapping up to a multiple of the page size, and inserts page table entries according to the rounded size.Where are you calling
ioremap(),iounmap()etc? IOW, please show your code for this.
It's the clock driver from patch 5. It starts out with an ioremap of the clock controller node:
+ acc: clock-controller at 80040000 {
+ compatible = "alphascale,asm9260-clock-controller"; + #clock-cells = <1>; + clocks = <&osc24m>; + reg = <0x80040000 0x500>;
+ };
Oh, and there is the bug:
+ /* check for errors on leaf clocks */
+ for (n = 0; n < MAX_CLKS; n++) {
+ if (!IS_ERR(clks[n]))
+ continue;
+
+ pr_err("%s: Unable to register leaf clock %d\n",
+ np->full_name, n);
+ goto fail;
+ }
+
+ /* register clk-provider */ + clk_data.clks = clks; + clk_data.clk_num = MAX_CLKS; + of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+fail:
+ iounmap(base);
+}
There should be a 'return' in front of the 'fail:', otherwise it get unmapped unconditionally.
Arnd
PATCH v2 1/8 ARM: add mach-asm9260
Am 24.09.2014 um 12:33 schrieb Arnd Bergmann:
Quoted 60 lines · On Wednesday 24 September 2014 11:25:42 Russell King - ARM Linux wrote:
Quoted 22 lines · Oleksij Rempel
Quoted 9 lines
Am 24.09.2014 um 11:43 schrieb Russell King - ARM Linux:
Quoted 2 lines
The "why" is in the text from your oops dump. That's precisely /why/ we print that text - so that we know /why/ the fault happened.
Here is oops message:
http://pastebin.com/qYWeAyfVi can avoid this oops by setting size at least
0x2000per register range. Do it mean my TLB supports only 8 KiB pages?No, it has nothing to do with the TLB.
Unable to handle kernel paging request at virtual address c2802174 pgd = c0004000 [c2802174] *pgd=21805811, *pte=00000000, *ppte=00000000 Internal error: Oops: 7 [#1] PREEMPT ARMThe number after the Oops: is the FSR value, which means "page translation fault", and sure enough, the pgd/pte values show that there is no page table entry at the faulting address.
Quoted 6 lines
That's odd, because
ioremap()aligns the size of the requested mapping up to a multiple of the page size, and inserts page table entries according to the rounded size.Where are you calling
ioremap(),iounmap()etc? IOW, please show your code for this.It's the clock driver from patch 5. It starts out with an ioremap of the clock controller node:
(quoted diff) +6
-0+ acc: clock-controller at 80040000 { + compatible = "alphascale,asm9260-clock-controller"; + #clock-cells = <1>; + clocks = <&osc24m>; + reg = <0x80040000 0x500>; + };Oh, and there is the bug:
(quoted diff) +17
-0+ /* check for errors on leaf clocks */ + for (n = 0; n < MAX_CLKS; n++) { + if (!IS_ERR(clks[n])) + continue; + + pr_err("%s: Unable to register leaf clock %d\n", + np->full_name, n); + goto fail; + } + + /* register clk-provider */ + clk_data.clks = clks; + clk_data.clk_num = MAX_CLKS; + of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); +fail: + iounmap(base); +}
Quoted 2 lines
There should be a 'return' in front of the 'fail:', otherwise it get unmapped unconditionally.
Ouch... thank you!!!
Still weird why it was not always oopsing.
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 213 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140924/6ed577a2/attachment-0001.sig>
PATCH v2 2/8 add include/debug/asm9260.S
In reply to Oleksij Rempel--- arch/arm/Kconfig.debug | 33 ++++++++++++++++++++++++++++++--- arch/arm/include/debug/asm9260.S | 31 +++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 arch/arm/include/debug/asm9260.S
arch/arm/Kconfig.debug +30 -3
@@ -953,6 +953,27 @@ choice options; the platform specific options are deprecated and will be soon removed. + config DEBUG_ASM9260_UART + bool "Kernel low-level debugging via asm9260 UART" + depends on MACH_ASM9260 + help + Say Y here if you want the debug print routines to direct + their output to an UART or USART port on asm9260 based + machines. + + DEBUG_UART_PHYS | DEBUG_UART_VIRT + + 0x80000000 | 0xf0000000 | UART0 + 0x80004000 | 0xf0004000 | UART1 + 0x80008000 | 0xf0008000 | UART2 + 0x8000c000 | 0xf000c000 | UART3 + 0x80010000 | 0xf0010000 | UART4 + 0x80014000 | 0xf0014000 | UART5 + 0x80018000 | 0xf0018000 | UART6 + 0x8001c000 | 0xf001c000 | UART7 + 0x80020000 | 0xf0020000 | UART8 + 0x80024000 | 0xf0024000 | UART9 + endchoice config DEBUG_EXYNOS_UART
@@ -1038,6 +1059,7 @@ config DEBUG_LL_INCLUDE default "debug/vf.S" if DEBUG_VF_UART default "debug/vt8500.S" if DEBUG_VT8500_UART0 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 + default "debug/asm9260.S" if DEBUG_ASM9260_UART default "mach/debug-macro.S" # Compatibility options for PL01x
@@ -1094,6 +1116,7 @@ config DEBUG_UART_PHYS default 0x50008000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART2 || \ DEBUG_S3C2410_UART2) default 0x7c0003f8 if FOOTBRIDGE + default 0x80010000 if DEBUG_ASM9260_UART default 0x80070000 if DEBUG_IMX23_UART default 0x80074000 if DEBUG_IMX28_UART default 0x80230000 if DEBUG_PICOXCELL_UART
@@ -1126,7 +1149,8 @@ config DEBUG_UART_PHYS depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ DEBUG_LL_UART_EFM32 || \ DEBUG_UART_8250 || DEBUG_UART_PL01X || \ - DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART + DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || \ + DEBUG_S3C24XX_UART || DEBUG_ASM9260_UART config DEBUG_UART_VIRT hex "Virtual base address of debug UART"
@@ -1134,6 +1158,7 @@ config DEBUG_UART_VIRT default 0xe1000000 if DEBUG_MSM_UART default 0xf0000be0 if ARCH_EBSA110 default 0xf0009000 if DEBUG_CNS3XXX + default 0xf0010000 if DEBUG_ASM9260_UART default 0xf01fb000 if DEBUG_NOMADIK_UART default 0xf0201000 if DEBUG_BCM2835 default 0xf1000300 if DEBUG_BCM_5301X
@@ -1194,7 +1219,8 @@ config DEBUG_UART_VIRT default DEBUG_UART_PHYS if !MMU depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ DEBUG_UART_8250 || DEBUG_UART_PL01X || \ - DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART + DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || \ + DEBUG_S3C24XX_UART || DEBUG_ASM9260_UART config DEBUG_UART_8250_SHIFT int "Register offset shift for the 8250 debug UART"
@@ -1236,7 +1262,8 @@ config DEBUG_UNCOMPRESS config UNCOMPRESS_INCLUDE string default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM || \ - PLAT_SAMSUNG || ARCH_EFM32 + PLAT_SAMSUNG || ARCH_EFM32 || \ + MACH_ASM9260 default "mach/uncompress.h" config EARLY_PRINTK
arch/arm/include/debug/asm9260.S new file +31 -0
@@ -0,0 +1,31 @@ +/* arch/arm/mach-imx/include/mach/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * Modified for ASM9260 by Oleksij Remepl <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + + .macro addruart, rp, rv, tmp + ldr \rp, = CONFIG_DEBUG_UART_PHYS + ldr \rv, = CONFIG_DEBUG_UART_VIRT + .endm + + .macro waituart,rd,rx + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #0x50] @ TXDATA + .endm + + .macro busyuart,rd,rx +1002: ldr \rd, [\rx, #0x60] @ STAT + tst \rd, #1 << 27 @ TXEMPTY + beq 1002b @ wait until transmit done + .endm
Signature · 1 line
1.9.1
PATCH v2 2/8 add include/debug/asm9260.S
In reply to Oleksij Rempel--- arch/arm/Kconfig.debug | 33 ++++++++++++++++++++++++++++++--- arch/arm/include/debug/asm9260.S | 31 +++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 arch/arm/include/debug/asm9260.S
arch/arm/Kconfig.debug +30 -3
@@ -953,6 +953,27 @@ choice options; the platform specific options are deprecated and will be soon removed. + config DEBUG_ASM9260_UART + bool "Kernel low-level debugging via asm9260 UART" + depends on MACH_ASM9260 + help + Say Y here if you want the debug print routines to direct + their output to an UART or USART port on asm9260 based + machines. + + DEBUG_UART_PHYS | DEBUG_UART_VIRT + + 0x80000000 | 0xf0000000 | UART0 + 0x80004000 | 0xf0004000 | UART1 + 0x80008000 | 0xf0008000 | UART2 + 0x8000c000 | 0xf000c000 | UART3 + 0x80010000 | 0xf0010000 | UART4 + 0x80014000 | 0xf0014000 | UART5 + 0x80018000 | 0xf0018000 | UART6 + 0x8001c000 | 0xf001c000 | UART7 + 0x80020000 | 0xf0020000 | UART8 + 0x80024000 | 0xf0024000 | UART9 + endchoice config DEBUG_EXYNOS_UART
@@ -1038,6 +1059,7 @@ config DEBUG_LL_INCLUDE default "debug/vf.S" if DEBUG_VF_UART default "debug/vt8500.S" if DEBUG_VT8500_UART0 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 + default "debug/asm9260.S" if DEBUG_ASM9260_UART default "mach/debug-macro.S" # Compatibility options for PL01x
@@ -1094,6 +1116,7 @@ config DEBUG_UART_PHYS default 0x50008000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART2 || \ DEBUG_S3C2410_UART2) default 0x7c0003f8 if FOOTBRIDGE + default 0x80010000 if DEBUG_ASM9260_UART default 0x80070000 if DEBUG_IMX23_UART default 0x80074000 if DEBUG_IMX28_UART default 0x80230000 if DEBUG_PICOXCELL_UART
@@ -1126,7 +1149,8 @@ config DEBUG_UART_PHYS depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ DEBUG_LL_UART_EFM32 || \ DEBUG_UART_8250 || DEBUG_UART_PL01X || \ - DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART + DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || \ + DEBUG_S3C24XX_UART || DEBUG_ASM9260_UART config DEBUG_UART_VIRT hex "Virtual base address of debug UART"
@@ -1134,6 +1158,7 @@ config DEBUG_UART_VIRT default 0xe1000000 if DEBUG_MSM_UART default 0xf0000be0 if ARCH_EBSA110 default 0xf0009000 if DEBUG_CNS3XXX + default 0xf0010000 if DEBUG_ASM9260_UART default 0xf01fb000 if DEBUG_NOMADIK_UART default 0xf0201000 if DEBUG_BCM2835 default 0xf1000300 if DEBUG_BCM_5301X
@@ -1194,7 +1219,8 @@ config DEBUG_UART_VIRT default DEBUG_UART_PHYS if !MMU depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ DEBUG_UART_8250 || DEBUG_UART_PL01X || \ - DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART + DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || \ + DEBUG_S3C24XX_UART || DEBUG_ASM9260_UART config DEBUG_UART_8250_SHIFT int "Register offset shift for the 8250 debug UART"
@@ -1236,7 +1262,8 @@ config DEBUG_UNCOMPRESS config UNCOMPRESS_INCLUDE string default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM || \ - PLAT_SAMSUNG || ARCH_EFM32 + PLAT_SAMSUNG || ARCH_EFM32 || \ + MACH_ASM9260 default "mach/uncompress.h" config EARLY_PRINTK
arch/arm/include/debug/asm9260.S new file +31 -0
@@ -0,0 +1,31 @@ +/* arch/arm/mach-imx/include/mach/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * Modified for ASM9260 by Oleksij Remepl <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + + .macro addruart, rp, rv, tmp + ldr \rp, = CONFIG_DEBUG_UART_PHYS + ldr \rv, = CONFIG_DEBUG_UART_VIRT + .endm + + .macro waituart,rd,rx + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #0x50] @ TXDATA + .endm + + .macro busyuart,rd,rx +1002: ldr \rd, [\rx, #0x60] @ STAT + tst \rd, #1 << 27 @ TXEMPTY + beq 1002b @ wait until transmit done + .endm
Signature · 1 line
1.9.1
PATCH v2 3/8 add alphascale,asm9260.h binding
--- include/dt-bindings/clock/alphascale,asm9260.h | 97 ++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 include/dt-bindings/clock/alphascale,asm9260.h
include/dt-bindings/clock/alphascale,asm9260.h new file +97 -0
@@ -0,0 +1,97 @@ +/* +* Copyright 2014 Oleksij Rempel <[email protected]> +* +* This software is licensed under the terms of the GNU General Public +* License version 2, as published by the Free Software Foundation, and +* may be copied, distributed, and modified under those terms. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#ifndef _DT_BINDINGS_CLK_ASM9260_H +#define _DT_BINDINGS_CLK_ASM9260_H + +/* ahb gate */ +#define CLKID_AHB_ROM 0 +#define CLKID_AHB_RAM 1 +#define CLKID_AHB_GPIO 2 +#define CLKID_AHB_MAC 3 +#define CLKID_AHB_EMI 4 +#define CLKID_AHB_USB0 5 +#define CLKID_AHB_USB1 6 +#define CLKID_AHB_DMA0 7 +#define CLKID_AHB_DMA1 8 +#define CLKID_AHB_UART0 9 +#define CLKID_AHB_UART1 10 +#define CLKID_AHB_UART2 11 +#define CLKID_AHB_UART3 12 +#define CLKID_AHB_UART4 13 +#define CLKID_AHB_UART5 14 +#define CLKID_AHB_UART6 15 +#define CLKID_AHB_UART7 16 +#define CLKID_AHB_UART8 17 +#define CLKID_AHB_UART9 18 +#define CLKID_AHB_I2S0 19 +#define CLKID_AHB_I2C0 20 +#define CLKID_AHB_I2C1 21 +#define CLKID_AHB_SSP0 22 +#define CLKID_AHB_IOCONFIG 23 +#define CLKID_AHB_WDT 24 +#define CLKID_AHB_CAN0 25 +#define CLKID_AHB_CAN1 26 +#define CLKID_AHB_MPWM 27 +#define CLKID_AHB_SPI0 28 +#define CLKID_AHB_SPI1 29 +#define CLKID_AHB_QEI 30 +#define CLKID_AHB_QUADSPI0 31 +#define CLKID_AHB_CAMIF 32 +#define CLKID_AHB_LCDIF 33 +#define CLKID_AHB_TIMER0 34 +#define CLKID_AHB_TIMER1 35 +#define CLKID_AHB_TIMER2 36 +#define CLKID_AHB_TIMER3 37 +#define CLKID_AHB_IRQ 38 +#define CLKID_AHB_RTC 39 +#define CLKID_AHB_NAND 40 +#define CLKID_AHB_ADC0 41 +#define CLKID_AHB_LED 42 +#define CLKID_AHB_DAC0 43 +#define CLKID_AHB_LCD 44 +#define CLKID_AHB_I2S1 45 +#define CLKID_AHB_MAC1 46 + +/* devider */ +#define CLKID_SYS_CPU 47 +#define CLKID_SYS_AHB 48 +#define CLKID_SYS_I2S0M 49 +#define CLKID_SYS_I2S0S 50 +#define CLKID_SYS_I2S1M 51 +#define CLKID_SYS_I2S1S 52 +#define CLKID_SYS_UART0 53 +#define CLKID_SYS_UART1 54 +#define CLKID_SYS_UART2 55 +#define CLKID_SYS_UART3 56 +#define CLKID_SYS_UART4 56 +#define CLKID_SYS_UART5 57 +#define CLKID_SYS_UART6 58 +#define CLKID_SYS_UART7 59 +#define CLKID_SYS_UART8 60 +#define CLKID_SYS_UART9 61 +#define CLKID_SYS_SPI0 62 +#define CLKID_SYS_SPI1 63 +#define CLKID_SYS_QUADSPI 64 +#define CLKID_SYS_SSP0 65 +#define CLKID_SYS_NAND 66 +#define CLKID_SYS_TRACE 67 +#define CLKID_SYS_CAMM 68 +#define CLKID_SYS_WDT 69 +#define CLKID_SYS_CLKOUT 70 +#define CLKID_SYS_MAC 71 +#define CLKID_SYS_LCD 72 +#define CLKID_SYS_ADCANA 73 + +#define MAX_CLKS 74 +#endif
Signature · 1 line
1.9.1
PATCH v2 3/8 add alphascale,asm9260.h binding
Quoted 1 line · Oleksij Rempel
Signed-off-by Oleksij Rempel <[email protected]>
This is a set of constants, which alone does not consistute a binding. Please write a document desciribing the binding. There are plenty of example in Documentation/devicetree/bindings/clock/
Additionally, please have a more comprehensive commit message (e.g. what an "alphascale,asm9260" is).
Quoted 67 lines
--- include/dt-bindings/clock/alphascale,asm9260.h | 97 ++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 include/dt-bindings/clock/alphascale,asm9260.hinclude/dt-bindings/clock/alphascale,asm9260.h new file +56
-0@@ -0,0 +1,97 @@ +/* +* Copyright 2014 Oleksij Rempel <[email protected]> +* +* This software is licensed under the terms of the GNU General Public +* License version 2, as published by the Free Software Foundation, and +* may be copied, distributed, and modified under those terms. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#ifndef _DT_BINDINGS_CLK_ASM9260_H +#define _DT_BINDINGS_CLK_ASM9260_H + +/* ahb gate */ +#define CLKID_AHB_ROM 0 +#define CLKID_AHB_RAM 1 +#define CLKID_AHB_GPIO 2 +#define CLKID_AHB_MAC 3 +#define CLKID_AHB_EMI 4 +#define CLKID_AHB_USB0 5 +#define CLKID_AHB_USB1 6 +#define CLKID_AHB_DMA0 7 +#define CLKID_AHB_DMA1 8 +#define CLKID_AHB_UART0 9 +#define CLKID_AHB_UART1 10 +#define CLKID_AHB_UART2 11 +#define CLKID_AHB_UART3 12 +#define CLKID_AHB_UART4 13 +#define CLKID_AHB_UART5 14 +#define CLKID_AHB_UART6 15 +#define CLKID_AHB_UART7 16 +#define CLKID_AHB_UART8 17 +#define CLKID_AHB_UART9 18 +#define CLKID_AHB_I2S0 19 +#define CLKID_AHB_I2C0 20 +#define CLKID_AHB_I2C1 21 +#define CLKID_AHB_SSP0 22 +#define CLKID_AHB_IOCONFIG 23 +#define CLKID_AHB_WDT 24 +#define CLKID_AHB_CAN0 25 +#define CLKID_AHB_CAN1 26 +#define CLKID_AHB_MPWM 27 +#define CLKID_AHB_SPI0 28 +#define CLKID_AHB_SPI1 29 +#define CLKID_AHB_QEI 30 +#define CLKID_AHB_QUADSPI0 31 +#define CLKID_AHB_CAMIF 32 +#define CLKID_AHB_LCDIF 33 +#define CLKID_AHB_TIMER0 34 +#define CLKID_AHB_TIMER1 35 +#define CLKID_AHB_TIMER2 36 +#define CLKID_AHB_TIMER3 37 +#define CLKID_AHB_IRQ 38
include/dt-bindings/clock/alphascale,asm9260.h line 66
Quoted 10 lines
include/dt-bindings/clock/alphascale,asm9260.h new file +10
-0+#define CLKID_AHB_RTC 39 +#define CLKID_AHB_NAND 40 +#define CLKID_AHB_ADC0 41 +#define CLKID_AHB_LED 42 +#define CLKID_AHB_DAC0 43 +#define CLKID_AHB_LCD 44 +#define CLKID_AHB_I2S1 45 +#define CLKID_AHB_MAC1 46 + +/* devider */
s/devider/divider/ presumably?
Mark.
Quoted 40 lines
include/dt-bindings/clock/alphascale,asm9260.h new file +31
-0+#define CLKID_SYS_CPU 47 +#define CLKID_SYS_AHB 48 +#define CLKID_SYS_I2S0M 49 +#define CLKID_SYS_I2S0S 50 +#define CLKID_SYS_I2S1M 51 +#define CLKID_SYS_I2S1S 52 +#define CLKID_SYS_UART0 53 +#define CLKID_SYS_UART1 54 +#define CLKID_SYS_UART2 55 +#define CLKID_SYS_UART3 56 +#define CLKID_SYS_UART4 56 +#define CLKID_SYS_UART5 57 +#define CLKID_SYS_UART6 58 +#define CLKID_SYS_UART7 59 +#define CLKID_SYS_UART8 60 +#define CLKID_SYS_UART9 61 +#define CLKID_SYS_SPI0 62 +#define CLKID_SYS_SPI1 63 +#define CLKID_SYS_QUADSPI 64 +#define CLKID_SYS_SSP0 65 +#define CLKID_SYS_NAND 66 +#define CLKID_SYS_TRACE 67 +#define CLKID_SYS_CAMM 68 +#define CLKID_SYS_WDT 69 +#define CLKID_SYS_CLKOUT 70 +#define CLKID_SYS_MAC 71 +#define CLKID_SYS_LCD 72 +#define CLKID_SYS_ADCANA 73 + +#define MAX_CLKS 74 +#endif Signature · 7 lines
1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 4/8 ARM: dts: add DT for Alphascale ASM9260 SoC
In reply to Oleksij Rempel--- arch/arm/boot/dts/Makefile | 2 + arch/arm/boot/dts/alphascale-asm9260-devkit.dts | 15 +++ arch/arm/boot/dts/alphascale-asm9260.dtsi | 166 ++++++++++++++++++++++++ 3 files changed, 183 insertions(+) create mode 100644 arch/arm/boot/dts/alphascale-asm9260-devkit.dts create mode 100644 arch/arm/boot/dts/alphascale-asm9260.dtsi
arch/arm/boot/dts/Makefile +2 -0
@@ -492,6 +492,8 @@ dtb-$(CONFIG_MACH_DOVE) += dove-cm-a510.dtb \ dove-d3plug.dtb \ dove-dove-db.dtb +dtb-$(CONFIG_MACH_ASM9260) += alphascale-asm9260-devkit.dtb + targets += dtbs dtbs_install targets += $(dtb-y) endif
arch/arm/boot/dts/alphascale-asm9260-devkit.dts new file +15 -0
@@ -0,0 +1,15 @@ +/dts-v1/; +#include "alphascale-asm9260.dtsi" + +/ { + model = "Alphascale asm9260 Development Kit"; + compatible = "alphascale,asm9260devkit", "alphascale,asm9260"; + + chosen { + bootargs = "mem=32M earlyprintk=serial console=ttyS4,115200n8 root=/dev/mtdblock1 init=/linuxrc mtdparts=NAND:4M at 10M(logo)ro,60M at 14M(root)ro"; + }; + +}; +&uart4 { + status = "okay"; +};
arch/arm/boot/dts/alphascale-asm9260.dtsi new file +166 -0
166 lines not on this page · raw message
Signature · 1 line
1.9.1
Arnd Bergmann
maintainerPATCH v2 4/8 ARM: dts: add DT for Alphascale ASM9260 SoC
arch/arm/boot/dts/alphascale-asm9260-devkit.dts line 10
Quoted 4 lines · On Sunday 21 September 2014 20:45:47 Oleksij Rempel wrote:
arch/arm/boot/dts/alphascale-asm9260-devkit.dts new file +4
-0+ + chosen { + bootargs = "mem=32M earlyprintk=serial console=ttyS4,115200n8 root=/dev/mtdblock1 init=/linuxrc mtdparts=NAND:4M at 10M(logo)ro,60M at 14M(root)ro"; + };
The command line should normally be set by the boot loader, and the individual arguments don't make much sense here:
the memory size and the flash partitions should be listed in their own DT nodes, the init program is a user-selected option and the serial port settings can be derived from DT for the most part too.
Quoted 10 lines
arch/arm/boot/dts/alphascale-asm9260-devkit.dts new file +4
-0+}; +&uart4 { + status = "okay"; +};arch/arm/boot/dts/alphascale-asm9260.dtsi new file +0
-0
arch/arm/boot/dts/alphascale-asm9260.dtsi line 10
Quoted 10 lines
arch/arm/boot/dts/alphascale-asm9260.dtsi new file +10
-0@@ -0,0 +1,166 @@ +/* + * Copyright 2014 Oleksij Rempel <[email protected]> + * + * The code contained herein is licensed under the GNU General Public + * License. You may obtain a copy of the GNU General Public License + * Version 2 or later at the following locations: + * + * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */
We have started moving towards using dual GPL+X11 or GPL+BSD licenses for the dts files, it would be best if you do the same here.
Quoted 8 lines
arch/arm/boot/dts/alphascale-asm9260.dtsi new file +8
-0+#include "skeleton.dtsi" +#include <dt-bindings/clock/alphascale,asm9260.h> + +/ { + interrupt-parent = <&icoll>; + + aliases { + serial0 = &uart0;
arch/arm/boot/dts/alphascale-asm9260.dtsi line 29
Quoted 10 lines
arch/arm/boot/dts/alphascale-asm9260.dtsi new file +10
-0+ serial1 = &uart1; + serial2 = &uart2; + serial3 = &uart3; + serial4 = &uart4; + serial5 = &uart5; + serial6 = &uart6; + serial7 = &uart7; + serial8 = &uart8; + serial9 = &uart9; + };
The aliases for the serial ports are board specific, so you should probably move those into the first file. Only one of them is enabled there, so you probably want
aliases {
serial0 = &uart4;
};so it shows up as ttyX0.
Arnd
PATCH v2 4/8 ARM: dts: add DT for Alphascale ASM9260 SoC
In reply to Oleksij Rempel[...]
Quoted 15 lines
arch/arm/boot/dts/alphascale-asm9260.dtsi new file +15
-0+ clocks { + #address-cells = <1>; + #size-cells = <0>; + + osc24m: oscillator { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + clock-accuracy = <30000>; + }; + + i2s0_mclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>;
arch/arm/boot/dts/alphascale-asm9260.dtsi line 66
Quoted 10 lines
arch/arm/boot/dts/alphascale-asm9260.dtsi new file +10
-0+ clock-accuracy = <30000>; + }; + + i2s1_mclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + clock-accuracy = <30000>; + }; + };
Please just get rid of the clocks node and put these clocks either under the soc node (if they are part of the SoC) or directly under the root node.
There is nothing special about a clocks node and its arguably an abuse of Linux implementaiton details w.r.t. clock probing. The #address-cells and #size-cells are meaningless (as no children have reg entries, there's no ranges, and this isn't a simple-bus).
Mark.
PATCH v2 5/8 clk: add clk-asm9260 driver
In reply to Oleksij Rempel--- drivers/clk/Makefile | 1 + drivers/clk/clk-asm9260.c | 350 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 351 insertions(+) create mode 100644 drivers/clk/clk-asm9260.c
drivers/clk/Makefile +1 -0
@@ -43,6 +43,7 @@ obj-$(CONFIG_ARCH_HI3xxx) += hisilicon/ obj-$(CONFIG_ARCH_HIP04) += hisilicon/ obj-$(CONFIG_ARCH_HIX5HD2) += hisilicon/ obj-$(CONFIG_COMMON_CLK_KEYSTONE) += keystone/ +obj-$(CONFIG_MACH_ASM9260) += clk-asm9260.o ifeq ($(CONFIG_COMMON_CLK), y) obj-$(CONFIG_ARCH_MMP) += mmp/ endif
drivers/clk/clk-asm9260.c new file +350 -0
350 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 6/8 clocksource: add asm9260_timer driver
In reply to Oleksij Rempel--- drivers/clocksource/Makefile | 1 + drivers/clocksource/asm9260_timer.c | 244 ++++++++++++++++++++++++++++++++++++ 2 files changed, 245 insertions(+) create mode 100644 drivers/clocksource/asm9260_timer.c
drivers/clocksource/Makefile +1 -0
@@ -44,3 +44,4 @@ obj-$(CONFIG_CLKSRC_METAG_GENERIC) += metag_generic.o obj-$(CONFIG_ARCH_HAS_TICK_BROADCAST) += dummy_timer.o obj-$(CONFIG_ARCH_KEYSTONE) += timer-keystone.o obj-$(CONFIG_CLKSRC_VERSATILE) += versatile.o +obj-$(CONFIG_MACH_ASM9260) += asm9260_timer.o
drivers/clocksource/asm9260_timer.c new file +244 -0
244 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 7/8 irqchip: add irq-asm9260 driver
In reply to Oleksij Rempel--- drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-asm9260.c | 257 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 258 insertions(+) create mode 100644 drivers/irqchip/irq-asm9260.c
drivers/irqchip/Makefile +1 -0
@@ -34,3 +34,4 @@ obj-$(CONFIG_XTENSA) += irq-xtensa-pic.o obj-$(CONFIG_XTENSA_MX) += irq-xtensa-mx.o obj-$(CONFIG_IRQ_CROSSBAR) += irq-crossbar.o obj-$(CONFIG_BRCMSTB_L2_IRQ) += irq-brcmstb-l2.o +obj-$(CONFIG_MACH_ASM9260) += irq-asm9260.o
drivers/irqchip/irq-asm9260.c new file +257 -0
257 lines not on this page · raw message
Signature · 1 line
1.9.1
Arnd Bergmann
maintainerPATCH v2 7/8 irqchip: add irq-asm9260 driver
Quoted 4 lines · On Sunday 21 September 2014 20:45:50 Oleksij Rempel wrote:
Signed-off-by Oleksij Rempel <[email protected]>--- drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-asm9260.c | 257 ++++++++++++++++++++++++++++++++++++++++++
This driver seems to be closely related to drivers/irqchip/irq-mxs.c. Are you perhaps able to share some or all of the code?
Arnd
PATCH v2 8/8 tty/serial: add asm9260-serial driver
In reply to Oleksij Rempel--- drivers/tty/serial/Kconfig | 17 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/asm9260_serial.c | 1485 +++++++++++++++++++++++++++++++++++ include/uapi/linux/serial_core.h | 2 + 4 files changed, 1505 insertions(+) create mode 100644 drivers/tty/serial/asm9260_serial.c
drivers/tty/serial/Kconfig +17 -0
@@ -1552,6 +1552,23 @@ config SERIAL_MEN_Z135 This driver can also be build as a module. If so, the module will be called men_z135_uart.ko +config SERIAL_ASM9260 + tristate "ASM9260 controller serial support" + depends on MACH_ASM9260 + select SERIAL_CORE + help + If you have an asm9260 based Base IO card + and wish to use the serial ports on this card, say Y. + Otherwise, say N. + +config SERIAL_ASM9260_CONSOLE + bool "ASM9260 console support" + depends on SERIAL_ASM9260 + select SERIAL_CORE_CONSOLE + help + If you want to support serial console on borad asm9260 + say Y. Otherwise, say N. + endmenu config SERIAL_MCTRL_GPIO
drivers/tty/serial/Makefile +1 -0
@@ -95,3 +95,4 @@ obj-$(CONFIG_SERIAL_MEN_Z135) += men_z135_uart.o # GPIOLIB helpers for modem control lines obj-$(CONFIG_SERIAL_MCTRL_GPIO) += serial_mctrl_gpio.o +obj-$(CONFIG_SERIAL_ASM9260) += asm9260_serial.o
drivers/tty/serial/asm9260_serial.c new file +1485 -0
1,485 lines not on this page · raw message
include/uapi/linux/serial_core.h +2 -0
@@ -244,4 +244,6 @@/* SC16IS74xx */ #define PORT_SC16IS7XX 108 +/* Alpscale ASM9260 */ +#define PORT_ASM9260 109#endif /* _UAPILINUX_SERIAL_CORE_H */
Signature · 1 line
1.9.1
Arnd Bergmann
maintainerPATCH v2 8/8 tty/serial: add asm9260-serial driver
Quoted 9 lines · On Sunday 21 September 2014 20:45:51 Oleksij Rempel wrote:
Signed-off-by Oleksij Rempel <[email protected]>--- drivers/tty/serial/Kconfig | 17 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/asm9260_serial.c | 1485 +++++++++++++++++++++++++++++++++++ include/uapi/linux/serial_core.h | 2 + 4 files changed, 1505 insertions(+) create mode 100644 drivers/tty/serial/asm9260_serial.c
Similar to the irqchip driver, this one in turns seems to be a duplicate of drivers/tty/serial/mxs-auart.c. Please see if you can make that one work instead of adding a new copy.
Arnd
PATCH v2 8/8 tty/serial: add asm9260-serial driver
Am 22.09.2014 um 17:26 schrieb Arnd Bergmann:
Quoted 11 lines · On Sunday 21 September 2014 20:45:51 Oleksij Rempel wrote:
Quoted 9 lines
Signed-off-by Oleksij Rempel <[email protected]>--- drivers/tty/serial/Kconfig | 17 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/asm9260_serial.c | 1485 +++++++++++++++++++++++++++++++++++ include/uapi/linux/serial_core.h | 2 + 4 files changed, 1505 insertions(+) create mode 100644 drivers/tty/serial/asm9260_serial.c
Quoted 3 lines
Similar to the irqchip driver, this one in turns seems to be a duplicate of
drivers/tty/serial/mxs-auart.c. Please see if you can make that one work instead of adding a new copy.
Ok, thank you for reviewing :)
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 213 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140922/a732849b/attachment-0001.sig>
PATCH v2 8/8 tty/serial: add asm9260-serial driver
In reply to Arnd BergmannAm 22.09.2014 um 17:26 schrieb Arnd Bergmann:
Quoted 11 lines · On Sunday 21 September 2014 20:45:51 Oleksij Rempel wrote:
Quoted 9 lines
Signed-off-by Oleksij Rempel <[email protected]>--- drivers/tty/serial/Kconfig | 17 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/asm9260_serial.c | 1485 +++++++++++++++++++++++++++++++++++ include/uapi/linux/serial_core.h | 2 + 4 files changed, 1505 insertions(+) create mode 100644 drivers/tty/serial/asm9260_serial.c
Quoted 3 lines
Similar to the irqchip driver, this one in turns seems to be a duplicate of
drivers/tty/serial/mxs-auart.c. Please see if you can make that one work instead of adding a new copy.
Hmmm.... they are identical in some parts, but have some different offsets, and in some cases different bitmask. I think it will look messy. Asm9260 has some more extras: RS485, CTRL3, ISO7816. Should it be moved to one file? Or may be better to create some common-dma.c and common-pio.c libs?
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 213 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140924/f49b6a8c/attachment.sig>
Arnd Bergmann
maintainerPATCH v2 8/8 tty/serial: add asm9260-serial driver
Quoted 12 lines · On Wednesday 24 September 2014 11:24:37 Oleksij Rempel wrote:
m 22.09.2014 um 17:26 schrieb Arnd Bergmann:
Quoted 11 lines · On Sunday 21 September 2014 20:45:51 Oleksij Rempel wrote:
Quoted 9 lines
Signed-off-by Oleksij Rempel <[email protected]>--- drivers/tty/serial/Kconfig | 17 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/asm9260_serial.c | 1485 +++++++++++++++++++++++++++++++++++ include/uapi/linux/serial_core.h | 2 + 4 files changed, 1505 insertions(+) create mode 100644 drivers/tty/serial/asm9260_serial.c
Quoted 6 lines
Quoted 3 lines
Similar to the irqchip driver, this one in turns seems to be a duplicate of
drivers/tty/serial/mxs-auart.c. Please see if you can make that one work instead of adding a new copy.Hmmm.... they are identical in some parts, but have some different offsets, and in some cases different bitmask.
It really depends on how much is different.
Quoted 2 lines
I think it will look
messy. Asm9260 has some more extras: RS485, CTRL3, ISO7816.
None of these are used in your driver though. It's possible that mxs has the same registers but the driver author did not document them.
Quoted 2 lines
Should it be moved to one file? Or may be better to create some
common-dma.candcommon-pio.clibs?
I'd suggest trying to do it in one file first, only splitting things out if it gets too messy.
You will probably have to replace the .driver_data in mxs_auart_devtype with a structure that has all the differences, either using function pointers for accessing the registers that are not identical, or using some data that can be used to look up the the actual registers.
Arnd
Arnd Bergmann
maintainerv2 cover initial suport for Alpscale ASM9260
In reply to Oleksij RempelQuoted 13 lines · On Sunday 21 September 2014 20:41:36 Oleksij Rempel wrote:
This patchset provide initial support for Alpscale ASM9260, ARM based SoC.
Oleksij Rempel (8):
ARM: add mach-asm9260
addinclude/debug/asm9260.S
add alphascale,asm9260.h binding
ARM: dts: add DT for Alphascale ASM9260 SoC
clk: add clk-asm9260 driver
clocksource: addasm9260_timerdriver
irqchip: add irq-asm9260 driver
tty/serial: add asm9260-serial driver
One more general comment: given the similarities between ASM9260 and the Sigmatel/Freescale chips, I wonder if it makes sense to move the platform code into arch/arm/mach-mxs. I don't know the exact relationship between the designs, so it's possible that they are not actually that closely related, you'd have to find out for yourselves.
In any case, I think any new driver should probably use the reset interface and macros from include/linux/stmp_device.h
Arnd
v2 cover initial suport for Alpscale ASM9260
In reply to Oleksij RempelQuoted 12 lines · Oleksij Rempel
This patchset provide initial support for Alpscale ASM9260, ARM based SoC.
Oleksij Rempel (8):
ARM: add mach-asm9260
addinclude/debug/asm9260.S
add alphascale,asm9260.h binding
ARM: dts: add DT for Alphascale ASM9260 SoC
clk: add clk-asm9260 driver
clocksource: addasm9260_timerdriver
irqchip: add irq-asm9260 driver
tty/serial: add asm9260-serial driver
Several of these add new bindings, but no documentation (just a single header).
Please document your device tree bindings.
Mark.
Quoted 44 lines
arch/arm/Kconfig | 14 + arch/arm/Kconfig.debug | 33 +- arch/arm/Makefile | 1 + arch/arm/boot/dts/Makefile | 2 + arch/arm/boot/dts/alphascale-asm9260-devkit.dts | 15 + arch/arm/boot/dts/alphascale-asm9260.dtsi | 166 +++ arch/arm/include/debug/asm9260.S | 31 + arch/arm/mach-asm9260/Makefile | 11 + arch/arm/mach-asm9260/Makefile.boot | 2 + arch/arm/mach-asm9260/core.c | 77 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-asm9260.c | 350 ++++++ drivers/clocksource/Makefile | 1 + drivers/clocksource/asm9260_timer.c | 244 ++++ drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-asm9260.c | 257 ++++ drivers/tty/serial/Kconfig | 17 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/asm9260_serial.c | 1485 +++++++++++++++++++++++ include/dt-bindings/clock/alphascale,asm9260.h | 97 ++ include/uapi/linux/serial_core.h | 2 + 21 files changed, 2805 insertions(+), 3 deletions(-) create mode 100644 arch/arm/boot/dts/alphascale-asm9260-devkit.dts create mode 100644 arch/arm/boot/dts/alphascale-asm9260.dtsi create mode 100644 arch/arm/include/debug/asm9260.S create mode 100644 arch/arm/mach-asm9260/Makefile create mode 100644 arch/arm/mach-asm9260/Makefile.boot create mode 100644 arch/arm/mach-asm9260/core.c create mode 100644 drivers/clk/clk-asm9260.c create mode 100644 drivers/clocksource/asm9260_timer.c create mode 100644 drivers/irqchip/irq-asm9260.c create mode 100644 drivers/tty/serial/asm9260_serial.c create mode 100644 include/dt-bindings/clock/alphascale,asm9260.hSignature · 7 lines
1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
v3 cover initial suport for Alphascale ASM9260
In reply to Oleksij RempelThis patchset provide initial support for Alpascale ASM9260, ARM based SoC.
Oleksij Rempel (9):
ARM: add mach-asm9260
arm: add lolevel debug support for asm9260
ARM: dts: add DT for Alphascale ASM9260 SoC
ARM: add alphascale,acc.txt bindings documentation
ARM: clk: add clk-asm9260 driver
clocksource: add asm9260_timer driver irqchip/irq-mxs.c: add asm9260 support tty/serial/mxs-auart.c: add initial Alphascale ASM9260 support add Alphascale to vendor-prefixes.txt
.../devicetree/bindings/clock/alphascale,acc.txt | 113 +++++++ .../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm/Kconfig | 2 + arch/arm/Kconfig.debug | 33 +- arch/arm/Makefile | 1 + arch/arm/boot/dts/Makefile | 2 + arch/arm/boot/dts/alphascale-asm9260-devkit.dts | 21 ++ arch/arm/boot/dts/alphascale-asm9260.dtsi | 134 ++++++++ arch/arm/include/debug/asm9260.S | 31 ++ arch/arm/mach-asm9260/Kconfig | 8 + arch/arm/mach-asm9260/Makefile | 1 + arch/arm/mach-asm9260/core.c | 20 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-asm9260.c | 351 +++++++++++++++++++ drivers/clocksource/Kconfig | 4 + drivers/clocksource/Makefile | 1 + drivers/clocksource/asm9260_timer.c | 234 +++++++++++++ drivers/irqchip/Kconfig | 5 + drivers/irqchip/Makefile | 2 +- drivers/irqchip/alphascale,asm9260-icoll.h | 109 ++++++ drivers/irqchip/irq-mxs.c | 142 +++++++- drivers/tty/serial/Kconfig | 5 +- drivers/tty/serial/alphascale,asm9260_serial.h | 373 +++++++++++++++++++++ drivers/tty/serial/mxs-auart.c | 344 ++++++++++++------- include/dt-bindings/clock/alphascale,asm9260.h | 97 ++++++ 25 files changed, 1892 insertions(+), 143 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/alphascale,acc.txt create mode 100644 arch/arm/boot/dts/alphascale-asm9260-devkit.dts create mode 100644 arch/arm/boot/dts/alphascale-asm9260.dtsi create mode 100644 arch/arm/include/debug/asm9260.S create mode 100644 arch/arm/mach-asm9260/Kconfig create mode 100644 arch/arm/mach-asm9260/Makefile create mode 100644 arch/arm/mach-asm9260/core.c create mode 100644 drivers/clk/clk-asm9260.c create mode 100644 drivers/clocksource/asm9260_timer.c create mode 100644 drivers/irqchip/alphascale,asm9260-icoll.h create mode 100644 drivers/tty/serial/alphascale,asm9260_serial.h create mode 100644 include/dt-bindings/clock/alphascale,asm9260.h
Signature · 1 line
1.9.1
PATCH v3 1/9 ARM: add mach-asm9260
it is low cost (?) SoC targeted for market in China and India which trying to compete with AT91SAM9G25.
Here is some info:
http://www.alphascale.com/index.asp?ics/615.html
In some cases this SoC looks similar to iMX23/iMX28. But currently it makes no sense to merge mach code of this devices. Especially because most differences are already collected mach-mxs folder.
--- arch/arm/Kconfig | 2 ++ arch/arm/Makefile | 1 + arch/arm/mach-asm9260/Kconfig | 8 ++++++++ arch/arm/mach-asm9260/Makefile | 1 + arch/arm/mach-asm9260/core.c | 20 ++++++++++++++++++++ 5 files changed, 32 insertions(+) create mode 100644 arch/arm/mach-asm9260/Kconfig create mode 100644 arch/arm/mach-asm9260/Makefile create mode 100644 arch/arm/mach-asm9260/core.c
arch/arm/Kconfig +2 -0
@@ -968,6 +968,8 @@ source "arch/arm/mach-w90x900/Kconfig" source "arch/arm/mach-zynq/Kconfig" +source "arch/arm/mach-asm9260/Kconfig" + # Definitions to make life easier config ARCH_ACORN bool
arch/arm/Makefile +1 -0
@@ -146,6 +146,7 @@ textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000 # Machine directory name. This list is sorted alphanumerically # by CONFIG_* macro name. machine-$(CONFIG_ARCH_AT91) += at91 +machine-$(CONFIG_MACH_ASM9260) += asm9260 machine-$(CONFIG_ARCH_AXXIA) += axxia machine-$(CONFIG_ARCH_BCM) += bcm machine-$(CONFIG_ARCH_BERLIN) += berlin
arch/arm/mach-asm9260/Kconfig new file +8 -0
@@ -0,0 +1,8 @@ +config MACH_ASM9260 + bool "Alphascale ASM9260" + depends on ARCH_MULTI_V5 + select IRQ_MXS + select ASM9260_TIMER + select CPU_ARM926T + help + Support for Alpascale ASM9260 based platform.
arch/arm/mach-asm9260/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_MACH_ASM9260) += core.o
arch/arm/mach-asm9260/core.c new file +20 -0
@@ -0,0 +1,20 @@ +/* +* Copyright (C) 2014 Oleksij Rempel <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <linux/of_platform.h> +#include <asm/mach/arch.h> + +static const char *const asm9260_dt_board_compat[]__initconst = { +"alphascale,asm9260" , +NULL +}; + +DT_MACHINE_START (ASM9260 ,"Alphascale ASM9260 (Device Tree Support)" ) + .dt_compat = asm9260_dt_board_compat, +MACHINE_END
Signature · 1 line
1.9.1
PATCH v3 2/9 arm: add lolevel debug support for asm9260
In reply to Oleksij Rempel--- arch/arm/Kconfig.debug | 33 ++++++++++++++++++++++++++++++--- arch/arm/include/debug/asm9260.S | 31 +++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 arch/arm/include/debug/asm9260.S
arch/arm/Kconfig.debug +30 -3
@@ -953,6 +953,27 @@ choice options; the platform specific options are deprecated and will be soon removed. + config DEBUG_ASM9260_UART + bool "Kernel low-level debugging via asm9260 UART" + depends on MACH_ASM9260 + help + Say Y here if you want the debug print routines to direct + their output to an UART or USART port on asm9260 based + machines. + + DEBUG_UART_PHYS | DEBUG_UART_VIRT + + 0x80000000 | 0xf0000000 | UART0 + 0x80004000 | 0xf0004000 | UART1 + 0x80008000 | 0xf0008000 | UART2 + 0x8000c000 | 0xf000c000 | UART3 + 0x80010000 | 0xf0010000 | UART4 + 0x80014000 | 0xf0014000 | UART5 + 0x80018000 | 0xf0018000 | UART6 + 0x8001c000 | 0xf001c000 | UART7 + 0x80020000 | 0xf0020000 | UART8 + 0x80024000 | 0xf0024000 | UART9 + endchoice config DEBUG_EXYNOS_UART
@@ -1038,6 +1059,7 @@ config DEBUG_LL_INCLUDE default "debug/vf.S" if DEBUG_VF_UART default "debug/vt8500.S" if DEBUG_VT8500_UART0 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 + default "debug/asm9260.S" if DEBUG_ASM9260_UART default "mach/debug-macro.S" # Compatibility options for PL01x
@@ -1094,6 +1116,7 @@ config DEBUG_UART_PHYS default 0x50008000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART2 || \ DEBUG_S3C2410_UART2) default 0x7c0003f8 if FOOTBRIDGE + default 0x80010000 if DEBUG_ASM9260_UART default 0x80070000 if DEBUG_IMX23_UART default 0x80074000 if DEBUG_IMX28_UART default 0x80230000 if DEBUG_PICOXCELL_UART
@@ -1126,7 +1149,8 @@ config DEBUG_UART_PHYS depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ DEBUG_LL_UART_EFM32 || \ DEBUG_UART_8250 || DEBUG_UART_PL01X || \ - DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART + DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || \ + DEBUG_S3C24XX_UART || DEBUG_ASM9260_UART config DEBUG_UART_VIRT hex "Virtual base address of debug UART"
@@ -1134,6 +1158,7 @@ config DEBUG_UART_VIRT default 0xe1000000 if DEBUG_MSM_UART default 0xf0000be0 if ARCH_EBSA110 default 0xf0009000 if DEBUG_CNS3XXX + default 0xf0010000 if DEBUG_ASM9260_UART default 0xf01fb000 if DEBUG_NOMADIK_UART default 0xf0201000 if DEBUG_BCM2835 default 0xf1000300 if DEBUG_BCM_5301X
@@ -1194,7 +1219,8 @@ config DEBUG_UART_VIRT default DEBUG_UART_PHYS if !MMU depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ DEBUG_UART_8250 || DEBUG_UART_PL01X || \ - DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART + DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || \ + DEBUG_S3C24XX_UART || DEBUG_ASM9260_UART config DEBUG_UART_8250_SHIFT int "Register offset shift for the 8250 debug UART"
@@ -1236,7 +1262,8 @@ config DEBUG_UNCOMPRESS config UNCOMPRESS_INCLUDE string default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM || \ - PLAT_SAMSUNG || ARCH_EFM32 + PLAT_SAMSUNG || ARCH_EFM32 || \ + MACH_ASM9260 default "mach/uncompress.h" config EARLY_PRINTK
arch/arm/include/debug/asm9260.S new file +31 -0
@@ -0,0 +1,31 @@ +/* arch/arm/mach-imx/include/mach/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * Modified for ASM9260 by Oleksij Remepl <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + + .macro addruart, rp, rv, tmp + ldr \rp, = CONFIG_DEBUG_UART_PHYS + ldr \rv, = CONFIG_DEBUG_UART_VIRT + .endm + + .macro waituart,rd,rx + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #0x50] @ TXDATA + .endm + + .macro busyuart,rd,rx +1002: ldr \rd, [\rx, #0x60] @ STAT + tst \rd, #1 << 27 @ TXEMPTY + beq 1002b @ wait until transmit done + .endm
Signature · 1 line
1.9.1
PATCH v3 3/9 ARM: dts: add DT for Alphascale ASM9260 SoC
In reply to Oleksij Rempelfor now it is wary basic SoC description with most important IPs needed to make this device work
--- arch/arm/boot/dts/Makefile | 2 + arch/arm/boot/dts/alphascale-asm9260-devkit.dts | 21 ++++ arch/arm/boot/dts/alphascale-asm9260.dtsi | 134 ++++++++++++++++++++++++ include/dt-bindings/clock/alphascale,asm9260.h | 97 +++++++++++++++++ 4 files changed, 254 insertions(+) create mode 100644 arch/arm/boot/dts/alphascale-asm9260-devkit.dts create mode 100644 arch/arm/boot/dts/alphascale-asm9260.dtsi create mode 100644 include/dt-bindings/clock/alphascale,asm9260.h
arch/arm/boot/dts/Makefile +2 -0
@@ -492,6 +492,8 @@ dtb-$(CONFIG_MACH_DOVE) += dove-cm-a510.dtb \ dove-d3plug.dtb \ dove-dove-db.dtb +dtb-$(CONFIG_MACH_ASM9260) += alphascale-asm9260-devkit.dtb + targets += dtbs dtbs_install targets += $(dtb-y) endif
arch/arm/boot/dts/alphascale-asm9260-devkit.dts new file +21 -0
@@ -0,0 +1,21 @@ +/* + * Copyright 2014 Oleksij Rempel <[email protected]> + * + * Licensed under the X11 license or the GPL v2 (or later) + */ + +/dts-v1/; +#include "alphascale-asm9260.dtsi" + +/ { + model = "Alphascale asm9260 Development Kit"; + compatible = "alphascale,asm9260devkit", "alphascale,asm9260"; + + aliases { + serial0 = &uart4; + }; +}; + +&uart4 { + status = "okay"; +};
arch/arm/boot/dts/alphascale-asm9260.dtsi new file +134 -0
134 lines not on this page · raw message
include/dt-bindings/clock/alphascale,asm9260.h new file +97 -0
97 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v3 4/9 ARM: add alphascale,acc.txt bindings documentation
In reply to Oleksij RempelACC is for AlphaScale Clock Controller.
--- .../devicetree/bindings/clock/alphascale,acc.txt | 113 +++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/alphascale,acc.txt
Documentation/devicetree/bindings/clock/alphascale,acc.txt new file +113 -0
@@ -0,0 +1,113 @@ +Alphascale Clock Controller + +The ACC (Alphascale Clock Controller) is responsible of choising proper +clock source, setting deviders and clock gates. + +Required properties for the ACC node: +- compatible: must be "alphascale,asm9260-clock-controller" +- reg: must contain the ACC register base and size + +ACC allow peripheral clocks to be gated to save some power. The clock consumer +should specify the desired clock by having the clock ID in it +"clocks" phandle cell. It is encouraged to use dt-binding for clock ID +definitions. SoC specific dt-binding should be included to the device tree +descriptor. For example Alphascale ASM9260: +#include <dt-bindings/clock/alphascale,asm9260.h> + +This binding contains two types of clock sinks: _AHB_ sink - a peripheral +gate; _SYS_ sink - an adjustable clock source. Not all clock consumer +have _SYS_ sink. All sink details can be found in the SoC documentation. +CLKID_AHB_ROM 0 +CLKID_AHB_RAM 1 +CLKID_AHB_GPIO 2 +CLKID_AHB_MAC 3 +CLKID_AHB_EMI 4 +CLKID_AHB_USB0 5 +CLKID_AHB_USB1 6 +CLKID_AHB_DMA0 7 +CLKID_AHB_DMA1 8 +CLKID_AHB_UART0 9 +CLKID_AHB_UART1 10 +CLKID_AHB_UART2 11 +CLKID_AHB_UART3 12 +CLKID_AHB_UART4 13 +CLKID_AHB_UART5 14 +CLKID_AHB_UART6 15 +CLKID_AHB_UART7 16 +CLKID_AHB_UART8 17 +CLKID_AHB_UART9 18 +CLKID_AHB_I2S0 19 +CLKID_AHB_I2C0 20 +CLKID_AHB_I2C1 21 +CLKID_AHB_SSP0 22 +CLKID_AHB_IOCONFIG 23 +CLKID_AHB_WDT 24 +CLKID_AHB_CAN0 25 +CLKID_AHB_CAN1 26 +CLKID_AHB_MPWM 27 +CLKID_AHB_SPI0 28 +CLKID_AHB_SPI1 29 +CLKID_AHB_QEI 30 +CLKID_AHB_QUADSPI0 31 +CLKID_AHB_CAMIF 32 +CLKID_AHB_LCDIF 33 +CLKID_AHB_TIMER0 34 +CLKID_AHB_TIMER1 35 +CLKID_AHB_TIMER2 36 +CLKID_AHB_TIMER3 37 +CLKID_AHB_IRQ 38 +CLKID_AHB_RTC 39 +CLKID_AHB_NAND 40 +CLKID_AHB_ADC0 41 +CLKID_AHB_LED 42 +CLKID_AHB_DAC0 43 +CLKID_AHB_LCD 44 +CLKID_AHB_I2S1 45 +CLKID_AHB_MAC1 46 + +CLKID_SYS_CPU 47 +CLKID_SYS_AHB 48 +CLKID_SYS_I2S0M 49 +CLKID_SYS_I2S0S 50 +CLKID_SYS_I2S1M 51 +CLKID_SYS_I2S1S 52 +CLKID_SYS_UART0 53 +CLKID_SYS_UART1 54 +CLKID_SYS_UART2 55 +CLKID_SYS_UART3 56 +CLKID_SYS_UART4 56 +CLKID_SYS_UART5 57 +CLKID_SYS_UART6 58 +CLKID_SYS_UART7 59 +CLKID_SYS_UART8 60 +CLKID_SYS_UART9 61 +CLKID_SYS_SPI0 62 +CLKID_SYS_SPI1 63 +CLKID_SYS_QUADSPI 64 +CLKID_SYS_SSP0 65 +CLKID_SYS_NAND 66 +CLKID_SYS_TRACE 67 +CLKID_SYS_CAMM 68 +CLKID_SYS_WDT 69 +CLKID_SYS_CLKOUT 70 +CLKID_SYS_MAC 71 +CLKID_SYS_LCD 72 +CLKID_SYS_ADCANA 73 + +Example of clock consumer with _SYS_ and _AHB_ sinks. +uart4: serial at 80010000 { + compatible = "alphascale,asm9260-uart"; + reg = <0x80010000 0x4000>; + clocks = <&acc CLKID_SYS_UART4>, <&acc CLKID_AHB_UART4>; + interrupts = <19>; + status = "disabled"; +}; + +Clock consumer with only one, _AHB_ sink. +timer0: timer at 80088000 { + compatible = "alphascale,asm9260-timer"; + reg = <0x80088000 0x4000>; + clocks = <&acc CLKID_AHB_TIMER0>; + interrupts = <29>; +}; +
Signature · 1 line
1.9.1
PATCH v3 5/9 ARM: clk: add clk-asm9260 driver
In reply to Oleksij RempelProvide CLK support for Alphascale ASM9260 SoC.
--- drivers/clk/Makefile | 1 + drivers/clk/clk-asm9260.c | 351 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 352 insertions(+) create mode 100644 drivers/clk/clk-asm9260.c
drivers/clk/Makefile +1 -0
@@ -43,6 +43,7 @@ obj-$(CONFIG_ARCH_HI3xxx) += hisilicon/ obj-$(CONFIG_ARCH_HIP04) += hisilicon/ obj-$(CONFIG_ARCH_HIX5HD2) += hisilicon/ obj-$(CONFIG_COMMON_CLK_KEYSTONE) += keystone/ +obj-$(CONFIG_MACH_ASM9260) += clk-asm9260.o ifeq ($(CONFIG_COMMON_CLK), y) obj-$(CONFIG_ARCH_MMP) += mmp/ endif
drivers/clk/clk-asm9260.c new file +351 -0
351 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v3 6/9 clocksource: add asm9260_timer driver
In reply to Oleksij RempelIn some cases asm9260 looks similar to iMX2x. One of exceptions is timer controller. So this patch introduces new driver for this special case.
--- drivers/clocksource/Kconfig | 4 + drivers/clocksource/Makefile | 1 + drivers/clocksource/asm9260_timer.c | 234 ++++++++++++++++++++++++++++++++++++ 3 files changed, 239 insertions(+) create mode 100644 drivers/clocksource/asm9260_timer.c
drivers/clocksource/Kconfig +4 -0
@@ -216,4 +216,8 @@ config CLKSRC_VERSATILE ARM Versatile, RealView and Versatile Express reference platforms. +config ASM9260_TIMER + select CLKSRC_MMIO + bool + endmenu
drivers/clocksource/Makefile +1 -0
@@ -44,3 +44,4 @@ obj-$(CONFIG_CLKSRC_METAG_GENERIC) += metag_generic.o obj-$(CONFIG_ARCH_HAS_TICK_BROADCAST) += dummy_timer.o obj-$(CONFIG_ARCH_KEYSTONE) += timer-keystone.o obj-$(CONFIG_CLKSRC_VERSATILE) += versatile.o +obj-$(CONFIG_ASM9260_TIMER) += asm9260_timer.o
drivers/clocksource/asm9260_timer.c new file +234 -0
234 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v3 7/9 irqchip/irq-mxs.c: add asm9260 support
In reply to Oleksij RempeliMX23/iMX28 have similar but not identical interrupt collector with asm9260. This patch provide some changes to reuse same code for both controller types.
--- drivers/irqchip/Kconfig | 5 + drivers/irqchip/Makefile | 2 +- drivers/irqchip/alphascale,asm9260-icoll.h | 109 ++++++++++++++++++++++ drivers/irqchip/irq-mxs.c | 142 +++++++++++++++++++++++++---- 4 files changed, 241 insertions(+), 17 deletions(-) create mode 100644 drivers/irqchip/alphascale,asm9260-icoll.h
drivers/irqchip/Kconfig +5 -0
@@ -113,3 +113,8 @@ config IRQ_CROSSBAR The primary irqchip invokes the crossbar's callback which inturn allocates a free irq and configures the IP. Thus the peripheral interrupts are routed to one of the free irqchip interrupt lines. + +config IRQ_MXS + bool + select IRQ_DOMAIN + select STMP_DEVICE
drivers/irqchip/Makefile +1 -1
@@ -4,7 +4,7 @@ obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o obj-$(CONFIG_ARCH_MMP) += irq-mmp.o obj-$(CONFIG_ARCH_MVEBU) += irq-armada-370-xp.o -obj-$(CONFIG_ARCH_MXS) += irq-mxs.o +obj-$(CONFIG_IRQ_MXS) += irq-mxs.o obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o obj-$(CONFIG_DW_APB_ICTL) += irq-dw-apb-ictl.o obj-$(CONFIG_METAG) += irq-metag-ext.o
drivers/irqchip/alphascale,asm9260-icoll.h new file +109 -0
109 lines not on this page · raw message
drivers/irqchip/irq-mxs.c +126 -16
205 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v3 7/9 irqchip/irq-mxs.c: add asm9260 support
drivers/irqchip/alphascale,asm9260-icoll.h
Quoted 2 lines · Oleksij Rempel
drivers/irqchip/alphascale,asm9260-icoll.h new file +0
-0
Eew. We really can do without the comma in the filename.
drivers/irqchip/alphascale,asm9260-icoll.h
Quoted 8 lines
drivers/irqchip/alphascale,asm9260-icoll.h new file +8
-0+struct icoll_priv { +void __iomem *vector; +void __iomem *levelack; +void __iomem *ctrl; +void __iomem *stat; +void __iomem *intr; +/* number of interrupts per register */ +int intr_reg_num;
So why on earth can't you find a name for this variable which reflects its meaning? intr_per_reg would be pretty clear, but intr_reg_num is just confusing as hell.
drivers/irqchip/alphascale,asm9260-icoll.h
Quoted 4 lines
drivers/irqchip/alphascale,asm9260-icoll.h new file +4
-0+void __iomem *clear; +}; + +struct icoll_priv icoll_priv;
Why is this global?
drivers/irqchip/alphascale,asm9260-icoll.h
Quoted 5 lines
static struct
irq_domain*icoll_domain;drivers/irqchip/alphascale,asm9260-icoll.h new file +3
-0+static u32 icoll_intr_bitshift (struct irq_data *d,u32 bit) +{ +int n = icoll_priv.intr_reg_num -1 ;
Newline between declaration and code.
drivers/irqchip/alphascale,asm9260-icoll.h
Quoted 1 line
drivers/irqchip/alphascale,asm9260-icoll.h new file +1
-0+return bit << ((d->hwirq & n) << n);
I really had to twist my brain around this. A comment would be helpful for the casual reader/reviewer.
drivers/irqchip/alphascale,asm9260-icoll.h
Quoted 6 lines
drivers/irqchip/alphascale,asm9260-icoll.h new file +6
-0+} + +static void __iomem *icoll_intr_reg (struct irq_data *d) +{ +int n = icoll_priv.intr_reg_num; +return icoll_priv.intr + ((d->hwirq / n) *0x10 );
See above. And aside of that, this should be implemented with a shift to avoid a divide in the hot path.
drivers/irqchip/alphascale,asm9260-icoll.h static void icoll_ack_irq(struct irq_data *d) · line 91
Quoted 11 lines
drivers/irqchip/alphascale,asm9260-icoll.h new file +3
-1+} +static void icoll_ack_irq (struct irq_data *d) {/* @@ -51,19 +88,25 @@ static void icoll_ack_irq(struct irq_data *d)* BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 unconditionally. */ __raw_writel (BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 , - icoll_base +HW_ICOLL_LEVELACK ); + icoll_priv.levelack);
The icoll_priv conversion of that code wants to be a separate patch. First change existing code then add new functionality.
drivers/irqchip/alphascale,asm9260-icoll.h static void icoll_ack_irq(struct irq_data *d) · line 94
Quoted 5 lines
drivers/irqchip/alphascale,asm9260-icoll.h new file +1
-2static void icoll_unmask_irq (struct irq_data *d) { -__raw_writel (BM_ICOLL_INTERRUPTn_ENABLE, - icoll_base +HW_ICOLL_INTERRUPTn_SET (d->hwirq)); +if (!IS_ERR (icoll_priv.clear)) {
This is a horrible construct. Why isn't it sufficient to do
if (icoll_priv.clear)
and initialize it to NULL for the IMX case?
drivers/irqchip/alphascale,asm9260-icoll.h static void icoll_ack_irq(struct irq_data *d) · line 95
Quoted 1 line
drivers/irqchip/alphascale,asm9260-icoll.h new file +1
-0+ icoll_priv.clear =ERR_PTR (-ENODEV );
Thanks,
tglx
PATCH v4 1/2 irqchip: mxs: prepare driver for HW with different offsets
Some HW has similar functionality but different register offsets. Make sure we can change offsets dynamically.
--- drivers/irqchip/irq-mxs.c | 55 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 13 deletions(-)
drivers/irqchip/irq-mxs.c +42 -13
@@ -29,18 +29,39 @@#include "irqchip.h" +/* +* this device provide 4 offsets for each register: +* 0x0 - plain read write mode +* 0x4 - set mode, OR logic. +* 0x8 - clr mode, XOR logic. +* 0xc - togle mode. +*/ +#define SET_REG 4 +#define CLR_REG 8 +#define HW_ICOLL_VECTOR 0x0000#define HW_ICOLL_LEVELACK 0x0010#define HW_ICOLL_CTRL 0x0020#define HW_ICOLL_STAT_OFFSET 0x0070 -#define HW_ICOLL_INTERRUPTn_SET (n) (0x0124 + (n) * 0x10) -#define HW_ICOLL_INTERRUPTn_CLR (n) (0x0128 + (n) * 0x10) -#define BM_ICOLL_INTERRUPTn_ENABLE 0x00000004 +#define HW_ICOLL_INTERRUPT0 0x0120 +#define HW_ICOLL_INTERRUPTn (n) ((n) * 0x10) +#define BM_ICOLL_INTR_ENABLE BIT(2)#define BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 0x1#define ICOLL_NUM_IRQS 128 -static void __iomem *icoll_base; +struct icoll_priv { +void __iomem *vector; +void __iomem *levelack; +void __iomem *ctrl; +void __iomem *stat; +void __iomem *intr; +/* number of interrupts per register */ +int intr_per_reg; +void __iomem *clear; +}; + +static struct icoll_priv icoll_priv;static struct irq_domain *icoll_domain;static void icoll_ack_irq (struct irq_data *d)
@@ -51,19 +72,19 @@ static void icoll_ack_irq(struct irq_data *d)* BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 unconditionally. */ __raw_writel (BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 , - icoll_base +HW_ICOLL_LEVELACK ); + icoll_priv.levelack); }static void icoll_mask_irq (struct irq_data *d) { -__raw_writel (BM_ICOLL_INTERRUPTn_ENABLE, - icoll_base +HW_ICOLL_INTERRUPTn_CLR (d->hwirq)); +__raw_writel (BM_ICOLL_INTR_ENABLE , + icoll_priv.intr +CLR_REG +HW_ICOLL_INTERRUPTn (d->hwirq)); }static void icoll_unmask_irq (struct irq_data *d) { -__raw_writel (BM_ICOLL_INTERRUPTn_ENABLE, - icoll_base +HW_ICOLL_INTERRUPTn_SET (d->hwirq)); +__raw_writel (BM_ICOLL_INTR_ENABLE , + icoll_priv.intr +SET_REG +HW_ICOLL_INTERRUPTn (d->hwirq)); }static struct irq_chip mxs_icoll_chip = {
@@ -76,8 +97,8 @@ asmlinkage void __exception_irq_entry icoll_handle_irq(struct pt_regs *regs) {u32 irqnr; - irqnr =__raw_readl (icoll_base +HW_ICOLL_STAT_OFFSET ); -__raw_writel (irqnr, icoll_base +HW_ICOLL_VECTOR ); + irqnr =__raw_readl (icoll_priv.stat); +__raw_writel (irqnr, icoll_priv.vector);handle_domain_irq (icoll_domain, irqnr, regs); }
@@ -98,14 +119,22 @@ static struct irq_domain_ops icoll_irq_domain_ops = {static int __init icoll_of_init (struct device_node *np,struct device_node *interrupt_parent) { - icoll_base =of_iomap (np,0 ); +void __iomem *icoll_base =of_iomap (np,0 );WARN_ON (!icoll_base); + icoll_priv.vector = icoll_base +HW_ICOLL_VECTOR ; + icoll_priv.levelack = icoll_base +HW_ICOLL_LEVELACK ; + icoll_priv.ctrl = icoll_base +HW_ICOLL_CTRL ; + icoll_priv.stat = icoll_base +HW_ICOLL_STAT_OFFSET ; + icoll_priv.intr = icoll_base +HW_ICOLL_INTERRUPT0 ; + icoll_priv.intr_per_reg =1 ; + icoll_priv.clear =NULL ; +/* * Interrupt Collector reset, which initializes the priority * for each irq to level 0. */ -stmp_reset_block (icoll_base +HW_ICOLL_CTRL ); +stmp_reset_block (icoll_priv.ctrl); icoll_domain =irq_domain_add_linear (np,ICOLL_NUM_IRQS , &icoll_irq_domain_ops,NULL );
Signature · 1 line
1.9.1
PATCH v4 2/2 irqchip: mxs: add Alpascale ASM9260 support
Freescale iMX23/iMX28 and Alphascale ASM9260 have similar interrupt collectors. It makes easy to reuse irq-mxs code for ASM9260. Differences between this devices are fallowing:
- different register offsets
- different count of intterupt lines per register
- ASM9260 don't provide reset bit
- ASM9260 don't support FIQ.
--- drivers/irqchip/Kconfig | 5 ++ drivers/irqchip/Makefile | 2 +- drivers/irqchip/alphascale_asm9260-icoll.h | 109 ++++++++++++++++++++++++++++ drivers/irqchip/irq-mxs.c | 112 ++++++++++++++++++++++++++--- 4 files changed, 219 insertions(+), 9 deletions(-) create mode 100644 drivers/irqchip/alphascale_asm9260-icoll.h
drivers/irqchip/Kconfig +5 -0
@@ -113,3 +113,8 @@ config IRQ_CROSSBAR The primary irqchip invokes the crossbar's callback which inturn allocates a free irq and configures the IP. Thus the peripheral interrupts are routed to one of the free irqchip interrupt lines. + +config IRQ_MXS + bool + select IRQ_DOMAIN + select STMP_DEVICE
drivers/irqchip/Makefile +1 -1
@@ -4,7 +4,7 @@ obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o obj-$(CONFIG_ARCH_MMP) += irq-mmp.o obj-$(CONFIG_ARCH_MVEBU) += irq-armada-370-xp.o -obj-$(CONFIG_ARCH_MXS) += irq-mxs.o +obj-$(CONFIG_IRQ_MXS) += irq-mxs.o obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o obj-$(CONFIG_DW_APB_ICTL) += irq-dw-apb-ictl.o obj-$(CONFIG_METAG) += irq-metag-ext.o
drivers/irqchip/alphascale_asm9260-icoll.h new file +109 -0
109 lines not on this page · raw message
drivers/irqchip/irq-mxs.c +104 -8
155 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v3 8/9 tty/serial/mxs-auart.c: add initial Alphascale ASM9260 support
In reply to Oleksij RempelAlphascale ASM9260 uart IP has some common registers with Freescale STMP37XX. This patch provide initial changes which allow to reuse mxs-auart.c code for ASM9260.
--- drivers/tty/serial/Kconfig | 5 +- drivers/tty/serial/alphascale,asm9260_serial.h | 373 +++++++++++++++++++++++++ drivers/tty/serial/mxs-auart.c | 344 +++++++++++++++-------- 3 files changed, 599 insertions(+), 123 deletions(-) create mode 100644 drivers/tty/serial/alphascale,asm9260_serial.h
drivers/tty/serial/Kconfig +3 -2
@@ -1385,11 +1385,12 @@ config SERIAL_MSM_SMD ports via tty device interface for MSM chipset. config SERIAL_MXS_AUART - depends on ARCH_MXS + depends on ARCH_MXS || MACH_ASM9260 tristate "MXS AUART support" select SERIAL_CORE help - This driver supports the MXS Application UART (AUART) port. + This driver supports the MXS and Alphascale ASM9260 Application + UART (AUART) port. config SERIAL_MXS_AUART_CONSOLE bool "MXS AUART console support"
drivers/tty/serial/alphascale,asm9260_serial.h new file +373 -0
373 lines not on this page · raw message
drivers/tty/serial/mxs-auart.c +223 -121
764 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v3 9/9 add Alphascale to vendor-prefixes.txt
In reply to Oleksij Rempelthis company already provided some products, so it make sense to add them to vendor-prefixes.txt list
--- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -11,6 +11,7 @@ adi Analog Devices, Inc. aeroflexgaisler Aeroflex Gaisler AB ak Asahi Kasei Corp. allwinner Allwinner Technology Co., Ltd. +alphascale AlphaScale Integrated Circuits Systems, Inc. altr Altera Corp. amcc Applied Micro Circuits Corporation (APM, formally AMCC) amd Advanced Micro Devices (AMD), Inc.
Signature · 1 line
1.9.1
v3 cover initial suport for Alphascale ASM9260
In reply to Oleksij RempelHello all,
if there are no more comments, i will resend this patch set including updates for irq-mxs driver.
Am 07.10.2014 um 10:55 schrieb Oleksij Rempel:
Quoted 53 lines
This patchset provide initial support for Alpascale ASM9260, ARM based SoC.
Oleksij Rempel (9):
ARM: add mach-asm9260
arm: add lolevel debug support for asm9260
ARM: dts: add DT for Alphascale ASM9260 SoC
ARM: add alphascale,acc.txt bindings documentation
ARM: clk: add clk-asm9260 driver
clocksource: addasm9260_timerdriverirqchip/irq-mxs.c: add asm9260 supporttty/serial/mxs-auart.c: add initial Alphascale ASM9260 support add Alphascale to vendor-prefixes.txt.../devicetree/bindings/clock/alphascale,acc.txt | 113 +++++++ .../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm/Kconfig | 2 + arch/arm/Kconfig.debug | 33 +- arch/arm/Makefile | 1 + arch/arm/boot/dts/Makefile | 2 + arch/arm/boot/dts/alphascale-asm9260-devkit.dts | 21 ++ arch/arm/boot/dts/alphascale-asm9260.dtsi | 134 ++++++++ arch/arm/include/debug/asm9260.S | 31 ++ arch/arm/mach-asm9260/Kconfig | 8 + arch/arm/mach-asm9260/Makefile | 1 + arch/arm/mach-asm9260/core.c | 20 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-asm9260.c | 351 +++++++++++++++++++ drivers/clocksource/Kconfig | 4 + drivers/clocksource/Makefile | 1 + drivers/clocksource/asm9260_timer.c | 234 +++++++++++++ drivers/irqchip/Kconfig | 5 + drivers/irqchip/Makefile | 2 +- drivers/irqchip/alphascale,asm9260-icoll.h | 109 ++++++ drivers/irqchip/irq-mxs.c | 142 +++++++- drivers/tty/serial/Kconfig | 5 +- drivers/tty/serial/alphascale,asm9260_serial.h | 373 +++++++++++++++++++++ drivers/tty/serial/mxs-auart.c | 344 ++++++++++++------- include/dt-bindings/clock/alphascale,asm9260.h | 97 ++++++ 25 files changed, 1892 insertions(+), 143 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/alphascale,acc.txt create mode 100644 arch/arm/boot/dts/alphascale-asm9260-devkit.dts create mode 100644 arch/arm/boot/dts/alphascale-asm9260.dtsi create mode 100644 arch/arm/include/debug/asm9260.S create mode 100644 arch/arm/mach-asm9260/Kconfig create mode 100644 arch/arm/mach-asm9260/Makefile create mode 100644 arch/arm/mach-asm9260/core.c create mode 100644 drivers/clk/clk-asm9260.c create mode 100644 drivers/clocksource/asm9260_timer.c create mode 100644 drivers/irqchip/alphascale,asm9260-icoll.h create mode 100644 drivers/tty/serial/alphascale,asm9260_serial.h create mode 100644 include/dt-bindings/clock/alphascale,asm9260.h
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 213 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141010/50bb47b5/attachment-0001.sig>