Misc picoxcell features for 3.3
Subsystems (2)
cover Misc picoxcell features for 3.3
Here are a few minor picoxcell features for 3.3 to implement a restart method for the machine using Russell's new infrastructure and a couple of minor cleanups.
Jamie Iles (5):
ARM: picoxcell: remove mach/memory.h
ARM: picoxcell: don't reserve irq_descs
ARM: picoxcell: move io mappings to common.c
MAINTAINERS: add maintainer entry for Picochip picoxcell
ARM: picoxcell: implement watchdog restart
MAINTAINERS | 8 ++++ arch/arm/mach-picoxcell/Makefile | 1 - arch/arm/mach-picoxcell/common.c | 46 ++++++++++++++++++++++++- arch/arm/mach-picoxcell/common.h | 1 - arch/arm/mach-picoxcell/include/mach/irqs.h | 9 +---- arch/arm/mach-picoxcell/include/mach/memory.h | 1 - arch/arm/mach-picoxcell/io.c | 32 ----------------- 7 files changed, 55 insertions(+), 43 deletions(-) delete mode 100644 arch/arm/mach-picoxcell/include/mach/memory.h delete mode 100644 arch/arm/mach-picoxcell/io.c
Signature · 1 line
1.7.5.4
PATCH 1/5 ARM: picoxcell: remove mach/memory.h
mach/memory.h is no longer required for simple platforms so remove it for picoxcell.
--- arch/arm/mach-picoxcell/include/mach/memory.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) delete mode 100644 arch/arm/mach-picoxcell/include/mach/memory.h
arch/arm/mach-picoxcell/include/mach/memory.h deleted +0 -1
@@ -1 +0,0 @@ -/* empty */
Signature · 1 line
1.7.5.4
PATCH 2/5 ARM: picoxcell: don't reserve irq_descs
In reply to Jamie IlesAll irq_desc's are now dynamically allocated so we don't need to statically reserve them.
--- arch/arm/mach-picoxcell/common.c | 1 - arch/arm/mach-picoxcell/include/mach/irqs.h | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-)
arch/arm/mach-picoxcell/common.c +0 -1
@@ -45,7 +45,6 @@ static void __init picoxcell_init_irq(void)DT_MACHINE_START (PICOXCELL ,"Picochip picoXcell" ) .map_io = picoxcell_map_io, - .nr_irqs = ARCH_NR_IRQS, .init_irq = picoxcell_init_irq, .handle_irq = vic_handle_irq, .timer = &picoxcell_timer,
arch/arm/mach-picoxcell/include/mach/irqs.h +2 -7
@@ -1,8 +1,6 @@/* * Copyright (c) 2011 Picochip Ltd., Jamie Iles * -* This file contains the hardware definitions of the picoXcell SoC devices. -* * 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
@@ -16,10 +14,7 @@#ifndef __MACH_IRQS_H#define __MACH_IRQS_H -#define ARCH_NR_IRQS 64 -#define NR_IRQS (128 + ARCH_NR_IRQS) - -#define IRQ_VIC0_BASE 0 -#define IRQ_VIC1_BASE 32 +/* We dynamically allocate our irq_desc's. */ +#define NR_IRQS 0#endif /* __MACH_IRQS_H */
Signature · 1 line
1.7.5.4
PATCH 2/5 ARM: picoxcell: don't reserve irq_descs
Quoted 14 lines · Jamie Iles
All irq_desc's are now dynamically allocated so we don't need to statically reserve them.
Signed-off-by Jamie Iles <[email protected]>--- arch/arm/mach-picoxcell/common.c | 1 - arch/arm/mach-picoxcell/include/mach/irqs.h | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-)arch/arm/mach-picoxcell/common.c +0
-0
arch/arm/mach-picoxcell/common.c static void __init picoxcell_init_irq(void) · line 48
Quoted 4 lines
arch/arm/mach-picoxcell/common.c +0
-1@@ -45,7 +45,6 @@ static void __init picoxcell_init_irq(void)DT_MACHINE_START (PICOXCELL ,"Picochip picoXcell" ) .map_io = picoxcell_map_io, - .nr_irqs = ARCH_NR_IRQS,
You should probably should set this to NR_IRQS_LEGACY (16) to skip irq 0 and ISA irqs.
Quoted 17 lines
arch/arm/mach-picoxcell/common.c +0
-0.init_irq = picoxcell_init_irq, .handle_irq = vic_handle_irq, .timer = &picoxcell_timer,arch/arm/mach-picoxcell/include/mach/irqs.h +0
-2@@ -1,8 +1,6 @@/* * Copyright (c) 2011 Picochip Ltd., Jamie Iles * -* This file contains the hardware definitions of the picoXcell SoC devices. -* * 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
arch/arm/mach-picoxcell/include/mach/irqs.h line 18
Quoted 10 lines
arch/arm/mach-picoxcell/include/mach/irqs.h +2
-5@@ -16,10 +14,7 @@#ifndef __MACH_IRQS_H#define __MACH_IRQS_H -#define ARCH_NR_IRQS 64 -#define NR_IRQS (128 + ARCH_NR_IRQS) - -#define IRQ_VIC0_BASE 0 -#define IRQ_VIC1_BASE 32 +/* We dynamically allocate our irq_desc's. */ +#define NR_IRQS 0
Are you selecting SPARSE_IRQ?
Rob
PATCH 2/5 ARM: picoxcell: don't reserve irq_descs
Hi Rob,
Quoted 16 lines · Rob Herring
Quoted 15 lines · Jamie Iles
All irq_desc's are now dynamically allocated so we don't need to statically reserve them.
Signed-off-by Jamie Iles <[email protected]>--- arch/arm/mach-picoxcell/common.c | 1 - arch/arm/mach-picoxcell/include/mach/irqs.h | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-)arch/arm/mach-picoxcell/common.c +0
-0@@ -45,7 +45,6 @@ static void __init picoxcell_init_irq(void)
Quoted 6 lines
arch/arm/mach-picoxcell/common.c static void __init picoxcell_init_irq(void) · line 48
Quoted 3 lines
arch/arm/mach-picoxcell/common.c +0
-1DT_MACHINE_START (PICOXCELL ,"Picochip picoXcell" ) .map_io = picoxcell_map_io, - .nr_irqs = ARCH_NR_IRQS,You should probably should set this to
NR_IRQS_LEGACY(16) to skip irq 0 and ISA irqs.
OK, that seems reasonable. This platform won't ever have ISA support but I guess it's still worth it?
Quoted 20 lines
Quoted 20 lines
arch/arm/mach-picoxcell/common.c +0
-0.init_irq = picoxcell_init_irq, .handle_irq = vic_handle_irq, .timer = &picoxcell_timer,arch/arm/mach-picoxcell/include/mach/irqs.h +0
-2@@ -1,8 +1,6 @@/* * Copyright (c) 2011 Picochip Ltd., Jamie Iles * -* This file contains the hardware definitions of the picoXcell SoC devices. -* * 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 @@ -16,10 +14,7 @@#ifndef __MACH_IRQS_H#define __MACH_IRQS_H
Quoted 9 lines
arch/arm/mach-picoxcell/include/mach/irqs.h line 18
Quoted 7 lines
arch/arm/mach-picoxcell/include/mach/irqs.h +2
-5-#define ARCH_NR_IRQS 64 -#define NR_IRQS (128 + ARCH_NR_IRQS) - -#define IRQ_VIC0_BASE 0 -#define IRQ_VIC1_BASE 32 +/* We dynamically allocate our irq_desc's. */ +#define NR_IRQS 0Are you selecting
SPARSE_IRQ?
Not in the patch, but I did have it enabled locally. I'll respin this patch to select SPARSE_IRQ for picoxcell.
Thanks,
Jamie
PATCH 3/5 ARM: picoxcell: move io mappings to common.c
In reply to Jamie IlesNow that we have lost our machine specific ioremap() we just have one mapping that covers all peripherals. Move this to common.c to simplify things a little.
--- arch/arm/mach-picoxcell/Makefile | 1 - arch/arm/mach-picoxcell/common.c | 13 +++++++++++++ arch/arm/mach-picoxcell/common.h | 1 - arch/arm/mach-picoxcell/io.c | 32 -------------------------------- 4 files changed, 13 insertions(+), 34 deletions(-) delete mode 100644 arch/arm/mach-picoxcell/io.c
arch/arm/mach-picoxcell/Makefile +0 -1
@@ -1,3 +1,2 @@ obj-y := common.o obj-y += time.o -obj-y += io.o
arch/arm/mach-picoxcell/common.c +13 -0
@@ -16,12 +16,25 @@#include <asm/mach/arch.h> #include <asm/hardware/vic.h> +#include <asm/mach/map.h> #include <mach/map.h> #include <mach/picoxcell_soc.h> #include "common.h" +static struct map_desc io_map__initdata = { + .virtual =PHYS_TO_IO (PICOXCELL_PERIPH_BASE ), + .pfn =__phys_to_pfn (PICOXCELL_PERIPH_BASE ), + .length =PICOXCELL_PERIPH_LENGTH , + .type =MT_DEVICE , +}; + +static void __init picoxcell_map_io (void ) +{ +iotable_init (&io_map,1 ); +} +static void __init picoxcell_init_machine (void ) {of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL );
arch/arm/mach-picoxcell/common.h +0 -1
@@ -13,6 +13,5 @@#include <asm/mach/time.h> extern struct sys_timer picoxcell_timer; -extern void picoxcell_map_io (void );#endif /* __PICOXCELL_COMMON_H__ */
arch/arm/mach-picoxcell/io.c deleted +0 -32
@@ -1,32 +0,0 @@ -/* -* Copyright (c) 2011 Picochip Ltd., Jamie Iles -* -* 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. -* -* All enquiries to support at picochip.com -*/ -#include <linux/io.h> -#include <linux/mm.h> -#include <linux/module.h> -#include <linux/of.h> - -#include <asm/mach/map.h> - -#include <mach/map.h> -#include <mach/picoxcell_soc.h> - -#include "common.h" - -void __init picoxcell_map_io (void ) -{ -struct map_desc io_map = { - .virtual =PHYS_TO_IO (PICOXCELL_PERIPH_BASE ), - .pfn =__phys_to_pfn (PICOXCELL_PERIPH_BASE ), - .length =PICOXCELL_PERIPH_LENGTH , - .type =MT_DEVICE , - }; - -iotable_init (&io_map,1 ); -}
Signature · 1 line
1.7.5.4
PATCH 4/5 MAINTAINERS: add maintainer entry for Picochip picoxcell
In reply to Jamie IlesAdd maintainer entry for the picoxcell machine support and associated drivers.
--- MAINTAINERS | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
MAINTAINERS +8 -0
@@ -5114,6 +5114,14 @@ L: linux-mtd at lists.infradead.org S: Maintained F: drivers/mtd/devices/phram.c +PICOXCELL SUPPORT +M: Jamie Iles <[email protected]> +L: linux-arm-kernel at lists.infradead.org (moderated for non-subscribers) +T: git git://github.com/jamieiles/linux-2.6-ji.git +S: Supported +F: arch/arm/mach-picoxcell +F: drivers/*/picoxcell* + PIN CONTROL SUBSYSTEM M: Linus Walleij <[email protected]> S: Maintained
Signature · 1 line
1.7.5.4
PATCH 4/5 MAINTAINERS: add maintainer entry for Picochip picoxcell
Quoted 2 lines · Jamie Iles
Add maintainer entry for the picoxcell machine support and associated drivers.
[]
MAINTAINERS
Quoted 1 line
MAINTAINERS +0
-0
[]
MAINTAINERS L: linux-mtd at lists.infradead.org · line 5123
Quoted 11 lines
MAINTAINERS +7
-0@@ -5114,6 +5114,14 @@ L: linux-mtd at lists.infradead.org S: Maintained F: drivers/mtd/devices/phram.c +PICOXCELL SUPPORT +M: Jamie Iles <[email protected]> +L: linux-arm-kernel at lists.infradead.org (moderated for non-subscribers) +T: git git://github.com/jamieiles/linux-2.6-ji.git +S: Supported +F: arch/arm/mach-picoxcell +F: drivers/*/picoxcell*
This wildcard matches only 1 directory depth level.
To match "drivers/char/hw_random/picoxcell-rng.c"
you also need to have:
F: drivers/*/*/picoxcell*
PATCH 4/5 MAINTAINERS: add maintainer entry for Picochip picoxcell
Quoted 20 lines · Joe Perches
Quoted 2 lines · Jamie Iles
Add maintainer entry for the picoxcell machine support and associated drivers.
[]
MAINTAINERS
Quoted 1 line
MAINTAINERS +0
-0[]
MAINTAINERS L: linux-mtd at lists.infradead.org · line 5123
Quoted 11 lines
MAINTAINERS +7
-0@@ -5114,6 +5114,14 @@ L: linux-mtd at lists.infradead.org S: Maintained F: drivers/mtd/devices/phram.c +PICOXCELL SUPPORT +M: Jamie Iles <[email protected]> +L: linux-arm-kernel at lists.infradead.org (moderated for non-subscribers) +T: git git://github.com/jamieiles/linux-2.6-ji.git +S: Supported +F: arch/arm/mach-picoxcell +F: drivers/*/picoxcell*This wildcard matches only 1 directory depth level.
Quoted 4 lines
To match "
drivers/char/hw_random/picoxcell-rng.c"
you also need to have:F:
drivers/*/*/picoxcell*
Thanks Joe, I'll update accordingly.
Jamie
PATCH 5/5 ARM: picoxcell: implement watchdog restart
In reply to Jamie IlesAllow the platform to be restarted by triggering the watchdog to expire with the shortest possible expiry. This should reset the CPU core and all on-chip peripherals.
--- arch/arm/mach-picoxcell/common.c | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-)
arch/arm/mach-picoxcell/common.c +32 -0
@@ -7,6 +7,7 @@* * All enquiries to support at picochip.com */ +#include <linux/delay.h> #include <linux/irq.h> #include <linux/irqdomain.h> #include <linux/of.h>
@@ -23,6 +24,22 @@#include "common.h" +#define WDT_CTRL_REG_EN_MASK (1 << 0) +#define WDT_CTRL_REG_OFFS (0x00) +#define WDT_TIMEOUT_REG_OFFS (0x04) +static void __iomem *wdt_regs; + +static void picoxcell_setup_restart (void ) +{ +struct device_node *np =of_find_compatible_node (NULL ,NULL , +"snps,dw-apb-wdg" ); +if (WARN (!np,"unable to setup watchdog restart" )) +return ; + + wdt_regs =of_iomap (np,0 ); +WARN (!wdt_regs,"failed to remap watchdog regs" ); +} +static struct map_desc io_map__initdata = { .virtual =PHYS_TO_IO (PICOXCELL_PERIPH_BASE ), .pfn =__phys_to_pfn (PICOXCELL_PERIPH_BASE ),
@@ -38,6 +55,7 @@ static void __init picoxcell_map_io(void)static void __init picoxcell_init_machine (void ) {of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL ); +picoxcell_setup_restart (); }static const char *picoxcell_dt_match[] = {
@@ -56,6 +74,19 @@ static void __init picoxcell_init_irq(void)of_irq_init (vic_of_match); } +static void picoxcell_wdt_restart (char mode,const char *cmd) +{ +/* +* Configure the watchdog to reset with the shortest possible timeout +* and give it chance to do the reset. +*/ +if (wdt_regs) { +__raw_writel (WDT_CTRL_REG_EN_MASK , wdt_regs +WDT_CTRL_REG_OFFS ); +__raw_writel (0 , wdt_regs +WDT_TIMEOUT_REG_OFFS ); +mdelay (500 ); + } +} +DT_MACHINE_START (PICOXCELL ,"Picochip picoXcell" ) .map_io = picoxcell_map_io, .init_irq = picoxcell_init_irq,
@@ -63,4 +94,5 @@ DT_MACHINE_START(PICOXCELL, "Picochip picoXcell") .timer = &picoxcell_timer, .init_machine = picoxcell_init_machine, .dt_compat = picoxcell_dt_match, + .restart = picoxcell_wdt_restart,MACHINE_END
Signature · 1 line
1.7.5.4