Device Tree support for Picochip picoXcell
Subsystems (3)
cover Device Tree support for Picochip picoXcell
This series adds initial support for Picochip picoXcell devices. I've based this off of Grant's devicetree/test branch and also on top of Russell's GPIO includes cleanup.
I have a second set of patches that add clk support but I've left them out for now to keep the changes to a minimum.
Jamie Iles (3):
picoxcell: support for Picochip picoxcell devices
picoxcell: add the DTS for pc3x2 and pc3x3 devices
picoxcell: add the DTS for the PC7302 board
.../devicetree/bindings/arm/picoxcell.txt | 27 ++ arch/arm/Kconfig | 18 + arch/arm/Makefile | 1 + arch/arm/boot/dts/picoxcell-pc3x2.dtsi | 232 +++++++++++++ arch/arm/boot/dts/picoxcell-pc3x3.dtsi | 344 ++++++++++++++++++++ arch/arm/boot/dts/picoxcell-pc7302-pc3x2.dts | 87 +++++ arch/arm/boot/dts/picoxcell-pc7302-pc3x3.dts | 93 ++++++ arch/arm/mach-picoxcell/Makefile | 3 + arch/arm/mach-picoxcell/Makefile.boot | 1 + arch/arm/mach-picoxcell/common.c | 72 ++++ arch/arm/mach-picoxcell/common.h | 18 + arch/arm/mach-picoxcell/include/mach/debug-macro.S | 35 ++ arch/arm/mach-picoxcell/include/mach/entry-macro.S | 19 + arch/arm/mach-picoxcell/include/mach/gpio.h | 17 + arch/arm/mach-picoxcell/include/mach/hardware.h | 21 ++ arch/arm/mach-picoxcell/include/mach/io.h | 30 ++ arch/arm/mach-picoxcell/include/mach/irqs.h | 25 ++ arch/arm/mach-picoxcell/include/mach/map.h | 25 ++ arch/arm/mach-picoxcell/include/mach/memory.h | 17 + .../mach-picoxcell/include/mach/picoxcell_soc.h | 25 ++ arch/arm/mach-picoxcell/include/mach/system.h | 31 ++ arch/arm/mach-picoxcell/include/mach/timex.h | 25 ++ arch/arm/mach-picoxcell/include/mach/uncompress.h | 60 ++++ arch/arm/mach-picoxcell/include/mach/vmalloc.h | 18 + arch/arm/mach-picoxcell/io.c | 56 ++++ arch/arm/mach-picoxcell/time.c | 132 ++++++++ 26 files changed, 1432 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/picoxcell.txt create mode 100644 arch/arm/boot/dts/picoxcell-pc3x2.dtsi create mode 100644 arch/arm/boot/dts/picoxcell-pc3x3.dtsi create mode 100644 arch/arm/boot/dts/picoxcell-pc7302-pc3x2.dts create mode 100644 arch/arm/boot/dts/picoxcell-pc7302-pc3x3.dts create mode 100644 arch/arm/mach-picoxcell/Makefile create mode 100644 arch/arm/mach-picoxcell/Makefile.boot create mode 100644 arch/arm/mach-picoxcell/common.c create mode 100644 arch/arm/mach-picoxcell/common.h create mode 100644 arch/arm/mach-picoxcell/include/mach/debug-macro.S create mode 100644 arch/arm/mach-picoxcell/include/mach/entry-macro.S create mode 100644 arch/arm/mach-picoxcell/include/mach/gpio.h create mode 100644 arch/arm/mach-picoxcell/include/mach/hardware.h create mode 100644 arch/arm/mach-picoxcell/include/mach/io.h create mode 100644 arch/arm/mach-picoxcell/include/mach/irqs.h create mode 100644 arch/arm/mach-picoxcell/include/mach/map.h create mode 100644 arch/arm/mach-picoxcell/include/mach/memory.h create mode 100644 arch/arm/mach-picoxcell/include/mach/picoxcell_soc.h create mode 100644 arch/arm/mach-picoxcell/include/mach/system.h create mode 100644 arch/arm/mach-picoxcell/include/mach/timex.h create mode 100644 arch/arm/mach-picoxcell/include/mach/uncompress.h create mode 100644 arch/arm/mach-picoxcell/include/mach/vmalloc.h create mode 100644 arch/arm/mach-picoxcell/io.c create mode 100644 arch/arm/mach-picoxcell/time.c
Signature · 1 line
1.7.4.1
PATCH 1/3 picoxcell: support for Picochip picoxcell devices
picoXcell is a family of femtocell devices with an ARM application processor and picoArray DSP processor array.
This patch adds support for picoXcell boards to be booted using the device tree registering the VIC's, UART's and timers.
---
The thing I'm least certain about here is the VIC handling. As we have two VIC's that aren't cascaded (wire-OR'd instead) there needs to be a way for the entry macros to decode to the correct DT IRQ numbers. Originally I had two VIC nodes with each one having an irq-start property to denote the Linux IRQ number but that's a bit gross. Instead, in this patch I've group the two VIC node's into a single vic-pair node so that it looks like one controller that handles 64 sources.
.../devicetree/bindings/arm/picoxcell.txt | 27 ++++ arch/arm/Kconfig | 18 +++ arch/arm/Makefile | 1 + arch/arm/mach-picoxcell/Makefile | 3 + arch/arm/mach-picoxcell/Makefile.boot | 1 + arch/arm/mach-picoxcell/common.c | 72 +++++++++++ arch/arm/mach-picoxcell/common.h | 18 +++ arch/arm/mach-picoxcell/include/mach/debug-macro.S | 35 +++++ arch/arm/mach-picoxcell/include/mach/entry-macro.S | 19 +++ arch/arm/mach-picoxcell/include/mach/gpio.h | 17 +++ arch/arm/mach-picoxcell/include/mach/hardware.h | 21 +++ arch/arm/mach-picoxcell/include/mach/io.h | 30 +++++ arch/arm/mach-picoxcell/include/mach/irqs.h | 25 ++++ arch/arm/mach-picoxcell/include/mach/map.h | 25 ++++ arch/arm/mach-picoxcell/include/mach/memory.h | 17 +++ .../mach-picoxcell/include/mach/picoxcell_soc.h | 25 ++++ arch/arm/mach-picoxcell/include/mach/system.h | 31 +++++ arch/arm/mach-picoxcell/include/mach/timex.h | 25 ++++ arch/arm/mach-picoxcell/include/mach/uncompress.h | 60 +++++++++ arch/arm/mach-picoxcell/include/mach/vmalloc.h | 18 +++ arch/arm/mach-picoxcell/io.c | 56 ++++++++ arch/arm/mach-picoxcell/time.c | 132 ++++++++++++++++++++ 22 files changed, 676 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/picoxcell.txt create mode 100644 arch/arm/mach-picoxcell/Makefile create mode 100644 arch/arm/mach-picoxcell/Makefile.boot create mode 100644 arch/arm/mach-picoxcell/common.c create mode 100644 arch/arm/mach-picoxcell/common.h create mode 100644 arch/arm/mach-picoxcell/include/mach/debug-macro.S create mode 100644 arch/arm/mach-picoxcell/include/mach/entry-macro.S create mode 100644 arch/arm/mach-picoxcell/include/mach/gpio.h create mode 100644 arch/arm/mach-picoxcell/include/mach/hardware.h create mode 100644 arch/arm/mach-picoxcell/include/mach/io.h create mode 100644 arch/arm/mach-picoxcell/include/mach/irqs.h create mode 100644 arch/arm/mach-picoxcell/include/mach/map.h create mode 100644 arch/arm/mach-picoxcell/include/mach/memory.h create mode 100644 arch/arm/mach-picoxcell/include/mach/picoxcell_soc.h create mode 100644 arch/arm/mach-picoxcell/include/mach/system.h create mode 100644 arch/arm/mach-picoxcell/include/mach/timex.h create mode 100644 arch/arm/mach-picoxcell/include/mach/uncompress.h create mode 100644 arch/arm/mach-picoxcell/include/mach/vmalloc.h create mode 100644 arch/arm/mach-picoxcell/io.c create mode 100644 arch/arm/mach-picoxcell/time.c
Documentation/devicetree/bindings/arm/picoxcell.txt new file +27 -0
@@ -0,0 +1,27 @@ +Picochip picoXcell device tree bindings. +======================================== + +Required root node properties: + - compatible: + - "picochip,pc7302-pc3x3" : PC7302 development board with PC3X3 device. + - "picochip,3x3" : picoXcell PC3X3 device based board. + - "picochip,3x2" : picoXcell PC3X2 device based board. + +Timers required properties: + - compatible = "picochip,picoxcell-timer" + - interrupts : The single IRQ line for the timer. + - clock-freq : The frequency in HZ of the timer. + - reg : The register bank for the timer. + +Note: two timers are required - one for the scheduler clock and one for the +event tick/NOHZ. + +VIC required properties: + - compatible = "arm,pl192-vic-pair". + - interrupt-controller. + - reg : The register bank for the devices. Picoxcell has two VIC's and the + IRQ outputs are wire-OR'd together so we effectively have a combined + controller that handles 64 IRQ's. The first reg tuple is the register + bank of the VIC that generates IRQ's 0->31 and the second tuple handles + IRQ's 32->63. + - #interrupt-cells : Must be 1.
arch/arm/Kconfig +18 -0
@@ -609,6 +609,24 @@ config ARCH_TEGRA This enables support for NVIDIA Tegra based systems (Tegra APX, Tegra 6xx and Tegra 2 series). +config ARCH_PICOXCELL + bool "Picochip picoXcell" + select ARM_PATCH_PHYS_VIRT + select NO_IOPORT + select ARM_VIC + select CPU_V6K + select DW_APB_TIMER + select GENERIC_CLOCKEVENTS + select HAVE_SCHED_CLOCK + select HAVE_TCM + select USE_OF + select GENERIC_GPIO + select ARCH_REQUIRE_GPIOLIB + help + This enables support for systems based on the Picochip picoXcell + family of Femtocell devices. The picoxcell support requires device tree + for all boards. + config ARCH_PNX4008 bool "Philips Nexperia PNX4008 Mobile" select CPU_ARM926T
arch/arm/Makefile +1 -0
@@ -167,6 +167,7 @@ machine-$(CONFIG_ARCH_OMAP2) := omap2 machine-$(CONFIG_ARCH_OMAP3) := omap2 machine-$(CONFIG_ARCH_OMAP4) := omap2 machine-$(CONFIG_ARCH_ORION5X) := orion5x +machine-$(CONFIG_ARCH_PICOXCELL) := picoxcell machine-$(CONFIG_ARCH_PNX4008) := pnx4008 machine-$(CONFIG_ARCH_PRIMA2) := prima2 machine-$(CONFIG_ARCH_PXA) := pxa
arch/arm/mach-picoxcell/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +obj-y := common.o +obj-y += time.o +obj-y += io.o
arch/arm/mach-picoxcell/Makefile.boot new file +1 -0
@@ -0,0 +1 @@ +zreladdr-y := 0x00008000
arch/arm/mach-picoxcell/common.c new file +72 -0
72 lines not on this page · raw message
arch/arm/mach-picoxcell/common.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* 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 +*/ +#ifndef __PICOXCELL_COMMON_H__ +#define __PICOXCELL_COMMON_H__ + +#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/include/mach/debug-macro.S new file +35 -0
@@ -0,0 +1,35 @@ +/* + * 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. + * + * Derived from arch/arm/mach-davinci/include/mach/debug-macro.S to use 32-bit + * accesses to the 8250. + */ +#include <linux/serial_reg.h> +#include <mach/hardware.h> +#include <mach/map.h> + +#define UART_SHIFT 2 + + .macro addruart, rp, rv + ldr \rv, =PHYS_TO_IO(PICOXCELL_UART1_BASE) + ldr \rp, =PICOXCELL_UART1_BASE + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #UART_TX << UART_SHIFT] + .endm + + .macro busyuart,rd,rx +1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT] + and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE + teq \rd, #UART_LSR_TEMT | UART_LSR_THRE + bne 1002b + .endm + + /* The UART's don't have any flow control IO's wired up. */ + .macro waituart,rd,rx + .endm
arch/arm/mach-picoxcell/include/mach/entry-macro.S new file +19 -0
@@ -0,0 +1,19 @@ +/* + * entry-macro.S + * + * Copyright (c) 2011 Picochip Ltd., Jamie Iles + * + * Low-level IRQ helper macros for picoXcell platforms + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ +#include <mach/hardware.h> +#include <mach/irqs.h> +#include <mach/map.h> + +#define VA_VIC0 IO_ADDRESS(PICOXCELL_VIC0_BASE) +#define VA_VIC1 IO_ADDRESS(PICOXCELL_VIC1_BASE) + +#include <asm/entry-macro-vic2.S>
arch/arm/mach-picoxcell/include/mach/gpio.h new file +17 -0
@@ -0,0 +1,17 @@ +/* +* 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 as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* 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 __PICOXCELL_GPIO_H__ +#define __PICOXCELL_GPIO_H__ + +#endif
arch/arm/mach-picoxcell/include/mach/hardware.h new file +21 -0
@@ -0,0 +1,21 @@ +/* +* 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 +* (at your option) any later version. +* +* 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 __ASM_ARCH_HARDWARE_H +#define __ASM_ARCH_HARDWARE_H + +#include <mach/picoxcell_soc.h> + +#endif
arch/arm/mach-picoxcell/include/mach/io.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* 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 as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* 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 __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +/* No ioports, but needed for driver compatibility. */ +#define __io (a) __typesafe_io(a) +/* No PCI possible on picoxcell. */ +#define __mem_pci (a) (a) +#define IO_SPACE_LIMIT ((resource_size_t)0) + +#define __arch_ioremap picoxcell_ioremap +#define __arch_iounmap picoxcell_iounmap + +extern void __iomem *picoxcell_ioremap (unsigned long phys,size_t size, +unsigned int type); +extern void picoxcell_iounmap (volatile void __iomem *addr); + +#endif /* __ASM_ARM_ARCH_IO_H */
arch/arm/mach-picoxcell/include/mach/irqs.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* 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 +* (at your option) any later version. +* +* 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 __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 + +#endif /* __MACH_IRQS_H */
arch/arm/mach-picoxcell/include/mach/map.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* 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 as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* 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 __PICOXCELL_MAP_H__ +#define __PICOXCELL_MAP_H__ + +#define PHYS_TO_IO (x) (((x) & 0x00ffffff) | 0xfe000000) + +#ifdef __ASSEMBLY__ +#define IO_ADDRESS (x) PHYS_TO_IO((x)) +#else +#define IO_ADDRESS (x) (void __iomem __force *)(PHYS_TO_IO((x))) +#endif + +#endif /* __PICOXCELL_MAP_H__ */
arch/arm/mach-picoxcell/include/mach/memory.h new file +17 -0
@@ -0,0 +1,17 @@ +/* +* 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 as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* 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 __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H + +#endif
arch/arm/mach-picoxcell/include/mach/picoxcell_soc.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* 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 +* (at your option) any later version. +* +* 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 __PICOXCELL_SOC_H__ +#define __PICOXCELL_SOC_H__ + +#define PICOXCELL_UART1_BASE 0x80230000 +#define PICOXCELL_PERIPH_BASE 0x80000000 +#define PICOXCELL_PERIPH_LENGTH SZ_4M +#define PICOXCELL_VIC0_BASE 0x80060000 +#define PICOXCELL_VIC1_BASE 0x80064000 + +#endif /* __PICOXCELL_SOC_H__ */
arch/arm/mach-picoxcell/include/mach/system.h new file +31 -0
@@ -0,0 +1,31 @@ +/* +* 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 as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* 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 __ASM_ARCH_SYSTEM_H +#define __ASM_ARCH_SYSTEM_H + +static inline void arch_idle (void ) +{ +/* +* This should do all the clock switching and wait for interrupt +* tricks. +*/ +cpu_do_idle (); +} + +static inline void arch_reset (int mode,const char *cmd) +{ +/* Watchdog reset to go here. */ +} + +#endif /* __ASM_ARCH_SYSTEM_H */
arch/arm/mach-picoxcell/include/mach/timex.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* Copyright (c) 2010 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 as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* 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. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef __TIMEX_H__ +#define __TIMEX_H__ + +/* Bogus value to allow the kernel to compile. */ +#define CLOCK_TICK_RATE 1000000 + +#endif /* __TIMEX_H__ */ +
arch/arm/mach-picoxcell/include/mach/uncompress.h new file +60 -0
60 lines not on this page · raw message
arch/arm/mach-picoxcell/include/mach/vmalloc.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* Copyright (c) 2010 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 as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* 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. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#define VMALLOC_END 0xFE000000UL
arch/arm/mach-picoxcell/io.c new file +56 -0
56 lines not on this page · raw message
arch/arm/mach-picoxcell/time.c new file +132 -0
132 lines not on this page · raw message
Signature · 1 line
1.7.4.1
PATCH 1/3 picoxcell: support for Picochip picoxcell devices
Quoted 68 lines · Jamie Iles
picoXcell is a family of femtocell devices with an ARM application processor and picoArray DSP processor array.
This patch adds support for picoXcell boards to be booted using the device tree registering the VIC's, UART's and timers.
Signed-off-by Jamie Iles<[email protected]>---
The thing I'm least certain about here is the VIC handling. As we have two VIC's that aren't cascaded (wire-OR'd instead) there needs to be a way for the entry macros to decode to the correct DT IRQ numbers. Originally I had two VIC nodes with each one having an irq-start property to denote the Linux IRQ number but that's a bit gross. Instead, in this patch I've group the two VIC node's into a single vic-pair node so that it looks like one controller that handles 64 sources.
.../devicetree/bindings/arm/picoxcell.txt | 27 ++++ arch/arm/Kconfig | 18 +++ arch/arm/Makefile | 1 + arch/arm/mach-picoxcell/Makefile | 3 + arch/arm/mach-picoxcell/Makefile.boot | 1 + arch/arm/mach-picoxcell/common.c | 72 +++++++++++ arch/arm/mach-picoxcell/common.h | 18 +++ arch/arm/mach-picoxcell/include/mach/debug-macro.S | 35 +++++ arch/arm/mach-picoxcell/include/mach/entry-macro.S | 19 +++ arch/arm/mach-picoxcell/include/mach/gpio.h | 17 +++ arch/arm/mach-picoxcell/include/mach/hardware.h | 21 +++ arch/arm/mach-picoxcell/include/mach/io.h | 30 +++++ arch/arm/mach-picoxcell/include/mach/irqs.h | 25 ++++ arch/arm/mach-picoxcell/include/mach/map.h | 25 ++++ arch/arm/mach-picoxcell/include/mach/memory.h | 17 +++ .../mach-picoxcell/include/mach/picoxcell_soc.h | 25 ++++ arch/arm/mach-picoxcell/include/mach/system.h | 31 +++++ arch/arm/mach-picoxcell/include/mach/timex.h | 25 ++++ arch/arm/mach-picoxcell/include/mach/uncompress.h | 60 +++++++++ arch/arm/mach-picoxcell/include/mach/vmalloc.h | 18 +++ arch/arm/mach-picoxcell/io.c | 56 ++++++++ arch/arm/mach-picoxcell/time.c | 132 ++++++++++++++++++++ 22 files changed, 676 insertions(+), 0 deletions(-)create mode 100644
Documentation/devicetree/bindings/arm/picoxcell.txtcreate mode 100644arch/arm/mach-picoxcell/Makefile
create mode 100644arch/arm/mach-picoxcell/Makefile.bootcreate mode 100644arch/arm/mach-picoxcell/common.c
create mode 100644arch/arm/mach-picoxcell/common.h
create mode 100644arch/arm/mach-picoxcell/include/mach/debug-macro.Screate mode 100644arch/arm/mach-picoxcell/include/mach/entry-macro.Screate mode 100644arch/arm/mach-picoxcell/include/mach/gpio.hcreate mode 100644arch/arm/mach-picoxcell/include/mach/hardware.hcreate mode 100644arch/arm/mach-picoxcell/include/mach/io.hcreate mode 100644arch/arm/mach-picoxcell/include/mach/irqs.hcreate mode 100644arch/arm/mach-picoxcell/include/mach/map.hcreate mode 100644arch/arm/mach-picoxcell/include/mach/memory.hcreate mode 100644arch/arm/mach-picoxcell/include/mach/picoxcell_soc.hcreate mode 100644arch/arm/mach-picoxcell/include/mach/system.hcreate mode 100644arch/arm/mach-picoxcell/include/mach/timex.hcreate mode 100644arch/arm/mach-picoxcell/include/mach/uncompress.hcreate mode 100644arch/arm/mach-picoxcell/include/mach/vmalloc.hcreate mode 100644arch/arm/mach-picoxcell/io.c
create mode 100644arch/arm/mach-picoxcell/time.cDocumentation/devicetree/bindings/arm/picoxcell.txt new file +0
-0
Documentation/devicetree/bindings/arm/picoxcell.txt line 7
Quoted 7 lines
Documentation/devicetree/bindings/arm/picoxcell.txt new file +7
-0@@ -0,0 +1,27 @@ +Picochip picoXcell device tree bindings. +======================================== + +Required root node properties: + - compatible: + - "picochip,pc7302-pc3x3" : PC7302 development board with PC3X3 device. + - "picochip,3x3" : picoXcell PC3X3 device based board.
"picochip,pc3x3" perhaps?
Documentation/devicetree/bindings/arm/picoxcell.txt line 11
Quoted 4 lines
Documentation/devicetree/bindings/arm/picoxcell.txt new file +4
-0+ - "picochip,3x2" : picoXcell PC3X2 device based board. + +Timers required properties: + - compatible = "picochip,picoxcell-timer"
This looks overly generic. It should specify the exact implementation (soc): "picochip,pc3x3-timer" perhaps?
Quoted 5 lines
Documentation/devicetree/bindings/arm/picoxcell.txt new file +5
-0+ - interrupts : The single IRQ line for the timer. + - clock-freq : The frequency in HZ of the timer. + - reg : The register bank for the timer. + +Note: two timers are required - one for the scheduler clock and one for the
Documentation/devicetree/bindings/arm/picoxcell.txt line 26
Quoted 10 lines
Documentation/devicetree/bindings/arm/picoxcell.txt new file +10
-0+event tick/NOHZ. + +VIC required properties: + - compatible = "arm,pl192-vic-pair". + - interrupt-controller. + - reg : The register bank for the devices. Picoxcell has two VIC's and the + IRQ outputs are wire-OR'd together so we effectively have a combined + controller that handles 64 IRQ's. The first reg tuple is the register + bank of the VIC that generates IRQ's 0->31 and the second tuple handles + IRQ's 32->63.
If they are two separate devices, then it probably should still be represented as two separate device tree nodes. Linux can take care of assigning a range of linux irq numbers to each VIC.
Quoted 83 lines
Documentation/devicetree/bindings/arm/picoxcell.txt new file +1
-0+ - #interrupt-cells : Must be 1.arch/arm/Kconfig +18
-0@@ -609,6 +609,24 @@ config ARCH_TEGRA This enables support for NVIDIA Tegra based systems (Tegra APX, Tegra 6xx and Tegra 2 series). +config ARCH_PICOXCELL + bool "Picochip picoXcell" + select ARM_PATCH_PHYS_VIRT + select NO_IOPORT + select ARM_VIC + select CPU_V6K + select DW_APB_TIMER + select GENERIC_CLOCKEVENTS + select HAVE_SCHED_CLOCK + select HAVE_TCM + select USE_OF + select GENERIC_GPIO + select ARCH_REQUIRE_GPIOLIB + help + This enables support for systems based on the Picochip picoXcell + family of Femtocell devices. The picoxcell support requires device tree + for all boards. + config ARCH_PNX4008 bool "Philips Nexperia PNX4008 Mobile" select CPU_ARM926Tarch/arm/Makefile +1
-0@@ -167,6 +167,7 @@ machine-$(CONFIG_ARCH_OMAP2) := omap2 machine-$(CONFIG_ARCH_OMAP3) := omap2 machine-$(CONFIG_ARCH_OMAP4) := omap2 machine-$(CONFIG_ARCH_ORION5X) := orion5x +machine-$(CONFIG_ARCH_PICOXCELL) := picoxcell machine-$(CONFIG_ARCH_PNX4008) := pnx4008 machine-$(CONFIG_ARCH_PRIMA2) := prima2 machine-$(CONFIG_ARCH_PXA) := pxaarch/arm/mach-picoxcell/Makefile new file +3
-0@@ -0,0 +1,3 @@ +obj-y := common.o +obj-y += time.o +obj-y += io.oarch/arm/mach-picoxcell/Makefile.boot new file +1
-0@@ -0,0 +1 @@ +zreladdr-y := 0x00008000arch/arm/mach-picoxcell/common.c new file +19
-0@@ -0,0 +1,72 @@ +/* +* 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/irq.h> +#include <linux/irqdomain.h> +#include <linux/of.h> +#include <linux/of_address.h> +#include <linux/of_platform.h> + +#include <asm/mach/arch.h> +#include <asm/hardware/vic.h> + +#include <mach/map.h>
arch/arm/mach-picoxcell/common.c line 29
Quoted 10 lines
arch/arm/mach-picoxcell/common.c new file +10
-0+#include <mach/picoxcell_soc.h> + +#include "common.h" + +static void __init picoxcell_init_machine (void ) +{ +const struct of_device_id bus_ids[] = { + { .compatible ="simple-bus" }, + {/* Sentinel */ } + };
You don't need to device one here. There is now a default bus id table called of_default_bus_match_table.
arch/arm/mach-picoxcell/common.c line 31
Quoted 2 lines
arch/arm/mach-picoxcell/common.c new file +2
-0+ +of_platform_bus_probe (NULL , bus_ids,NULL );
Use of_platform_populate() (as you already mentioned that you're going to change).
Quoted 31 lines
arch/arm/mach-picoxcell/common.c new file +31
-0+} + +static const char *picoxcell_dt_match[] = { +"picochip,pc3x2" , +"picochip,pc3x3" , +NULL +}; + +static const struct of_device_id vic_of_match[] = { + { .compatible ="arm,pl192-vic-pair" }, + {/* Sentinel */ } +}; + +static void __init picoxcell_init_irq (void ) +{ +struct device_node *np =of_find_matching_node (NULL , vic_of_match); +void __iomem *regs; + +if (!np) +panic ("unable to find vic" ); + + regs =of_iomap (np,0 ); +if (!regs) +panic ("unable to map regs for vic0" ); +vic_init (regs,0 , ~0 ,0 ); + + regs =of_iomap (np,1 ); +if (!regs) +panic ("unable to map regs for vic1" ); +vic_init (regs,32 , ~0 ,0 ); +
arch/arm/mach-picoxcell/common.c line 72
Quoted 10 lines
arch/arm/mach-picoxcell/common.c new file +10
-0+irq_domain_add_simple (np,0 ); +} + +DT_MACHINE_START (PICOXCELL ,"Picochip picoXcell" ) + .map_io = picoxcell_map_io, + .init_irq = picoxcell_init_irq, + .timer =&picoxcell_timer, + .init_machine = picoxcell_init_machine, + .dt_compat = picoxcell_dt_match, +MACHINE_END
Otherwise looks okay to me.
g.
PATCH 1/3 picoxcell: support for Picochip picoxcell devices
Hi Grant,
Quoted 1 line · Grant Likely
On 11-08-09 03:10 AM, Jamie Iles wrote:
[...]
Quoted 9 lines
Documentation/devicetree/bindings/arm/picoxcell.txt line 26
Quoted 8 lines
Documentation/devicetree/bindings/arm/picoxcell.txt new file +8
-0+VIC required properties: + - compatible = "arm,pl192-vic-pair". + - interrupt-controller. + - reg : The register bank for the devices. Picoxcell has two VIC's and the + IRQ outputs are wire-OR'd together so we effectively have a combined + controller that handles 64 IRQ's. The first reg tuple is the register + bank of the VIC that generates IRQ's 0->31 and the second tuple handles + IRQ's 32->63.
Quoted 3 lines
If they are two separate devices, then it probably should still be represented as two separate device tree nodes. Linux can take care of assigning a range of linux irq numbers to each VIC.
The reason I did this is because of the entry macro get_irqnr_and_base macro decoding. If I used irq_domain_generate_simple() rather than irq_domain_add_simple() then I guess the ordering of the VIC's in the DT wont matter. I'll give this a test when I have access to hardware again and respin.
Many thanks for the review!
Jamie
PATCH 1/3 picoxcell: support for Picochip picoxcell devices
Quoted 18 lines · Jamie Iles
Hi Grant,
Quoted 1 line · Grant Likely
On 11-08-09 03:10 AM, Jamie Iles wrote:
[...]
Quoted 9 lines
Quoted 8 lines
+VIC required properties:
+ ? ?- compatible = "arm,pl192-vic-pair".
+ ? ?- interrupt-controller.
+ ? ?- reg : The register bank for the devices. ?Picoxcell has two VIC's and the
+ ? ? ?IRQ outputs are wire-OR'd together so we effectively have a combined
+ ? ? ?controller that handles 64 IRQ's. ?The first reg tuple is the register
+ ? ? ?bank of the VIC that generates IRQ's 0->31 and the second tuple handles
+ ? ? ?IRQ's 32->63.Quoted 3 lines
If they are two separate devices, then it probably should still be represented as two separate device tree nodes. ?Linux can take care of assigning a range of linux irq numbers to each VIC.
Quoted 5 lines
The reason I did this is because of the entry macro
get_irqnr_and_basemacro decoding. ?If I usedirq_domain_generate_simple()rather thanirq_domain_add_simple()then I guess the ordering of the VIC's in the DT wont matter. ?I'll give this a test when I have access to hardware again and respin.
Don't get too hung up on irq_domain_{generate,add}_simple(). Those functions are temporary helpers until the vic driver itself directly uses irq_domain.
g.
PATCH 2/3 picoxcell: add the DTS for pc3x2 and pc3x3 devices
In reply to Jamie IlesThis describes the basic hierarchy of picoxcell pc3x3 devices including clocks and bus interconnect. Some onchip devices are currently omitted as there haven't been bindings created for them.
--- arch/arm/boot/dts/picoxcell-pc3x2.dtsi | 232 +++++++++++++++++++++ arch/arm/boot/dts/picoxcell-pc3x3.dtsi | 344 ++++++++++++++++++++++++++++++++ 2 files changed, 576 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/picoxcell-pc3x2.dtsi create mode 100644 arch/arm/boot/dts/picoxcell-pc3x3.dtsi
arch/arm/boot/dts/picoxcell-pc3x2.dtsi new file +232 -0
@@ -0,0 +1,232 @@ +/* + * Copyright (C) 2011 Picochip, Jamie Iles + * + * 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. + */ +/include/ "skeleton.dtsi" +/ { + model = "Picochip picoXcell PC3X2"; + compatible = "picochip,pc3x2"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&vic>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu at 0 { + compatible = "arm,1176jz-s"; + clock-frequency = <400000000>; + reg = <0>; + d-cache-line-size = <32>; + d-cache-size = <32768>; + i-cache-line-size = <32>; + i-cache-size = <32768>; + }; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + pclk: clock at 0 { + compatible = "fixed-clock"; + clock-outputs = "bus", "pclk"; + clock-frequency = <200000000>; + ref-clock = <&ref_clk>, "ref"; + }; + }; + + paxi { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x80000000 0x400000>; + + emac: gem at 30000 { + compatible = "cadence,gem"; + reg = <0x30000 0x10000>; + interrupts = <31>; + }; + + dmac1: dmac at 40000 { + compatible = "snps,dw-dmac"; + reg = <0x40000 0x10000>; + interrupts = <25>; + }; + + dmac2: dmac at 50000 { + compatible = "snps,dw-dmac"; + reg = <0x50000 0x10000>; + interrupts = <26>; + }; + + vic: interrupt-controller at 60000 { + compatible = "arm,pl192-vic-pair"; + interrupt-controller; + reg = <0x60000 0x1000 + 0x64000 0x1000 >; + #interrupt-cells = <1>; + }; + + fuse: picoxcell-fuse at 80000 { + compatible = "picoxcell,fuse-pc3x2"; + reg = <0x80000 0x10000>; + }; + + ssi: picoxcell-spi at 90000 { + compatible = "picoxcell,spi"; + reg = <0x90000 0x10000>; + interrupts = <10>; + }; + + ipsec: spacc at 100000 { + compatible = "picochip,spacc-ipsec"; + reg = <0x100000 0x10000>; + interrupts = <24>; + ref-clock = <&pclk>, "ref"; + }; + + srtp: spacc at 140000 { + compatible = "picochip,spacc-srtp"; + reg = <0x140000 0x10000>; + interrupts = <23>; + }; + + l2_engine: spacc at 180000 { + compatible = "picochip,spacc-l2"; + reg = <0x180000 0x10000>; + interrupts = <22>; + ref-clock = <&pclk>, "ref"; + }; + + apb { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x200000 0x80000>; + + rtc0: rtc at 00000 { + compatible = "picochip,picoxcell-rtc"; + clock-freq = <200000000>; + reg = <0x00000 0xf>; + interrupts = <40>; + }; + + timer0: timer at 10000 { + compatible = "picochip,picoxcell-timer"; + interrupts = <4>; + clock-freq = <200000000>; + reg = <0x10000 0x14>; + }; + + timer1: timer at 10014 { + compatible = "picochip,picoxcell-timer"; + interrupts = <5>; + clock-freq = <200000000>; + reg = <0x10014 0x14>; + }; + + timer2: timer at 10028 { + compatible = "picochip,picoxcell-timer"; + interrupts = <6>; + clock-freq = <200000000>; + reg = <0x10028 0x14>; + }; + + timer3: timer at 1003c { + compatible = "picochip,picoxcell-timer"; + interrupts = <7>; + clock-freq = <200000000>; + reg = <0x1003c 0x14>; + }; + + gpio: gpio at 20000 { + compatible = "snps,dw-apb-gpio"; + reg = <0x20000 0x1000>; + #address-cells = <1>; + #size-cells = <0>; + reg-io-width = <4>; + + banka: gpio-controller at 0 { + compatible = "snps,dw-apb-gpio-bank"; + gpio-controller; + #gpio-cells = <2>; + gpio-generic,nr-gpio = <8>; + + regoffset-dat = <0x50>; + regoffset-set = <0x00>; + regoffset-dirout = <0x04>; + }; + + bankb: gpio-controller at 1 { + compatible = "snps,dw-apb-gpio-bank"; + gpio-controller; + #gpio-cells = <2>; + gpio-generic,nr-gpio = <8>; + + regoffset-dat = <0x54>; + regoffset-set = <0x0c>; + regoffset-dirout = <0x10>; + }; + }; + + uart0: uart at 30000 { + compatible = "ns8250"; + reg = <0x30000 0x1000>; + interrupts = <42>; + clock-frequency = <3686400>; + reg-shift = <2>; + reg-io-width = <4>; + }; + + uart1: uart at 40000 { + compatible = "ns8250"; + reg = <0x40000 0x1000>; + interrupts = <41>; + clock-frequency = <3686400>; + reg-shift = <2>; + reg-io-width = <4>; + }; + + wdog: watchdog at 50000 { + compatible = "snps,dw-apb-wdg"; + reg = <0x50000 0x10000>; + interrupts = <11>; + bus-clock = <&pclk>, "bus"; + }; + }; + }; + + rwid-axi { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + + ebi at 50000000 { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <1>; + ranges = <0 0 0x40000000 0x08000000 + 1 0 0x48000000 0x08000000 + 2 0 0x50000000 0x08000000 + 3 0 0x58000000 0x08000000>; + }; + + axi2pico at c0000000 { + compatible = "picochip,axi2pico-pc3x2"; + reg = <0xc0000000 0x10000>; + interrupts = <13 14 15 16 17 18 19 20 21>; + }; + }; +};
arch/arm/boot/dts/picoxcell-pc3x3.dtsi new file +344 -0
344 lines not on this page · raw message
Signature · 1 line
1.7.4.1
PATCH 3/3 picoxcell: add the DTS for the PC7302 board
In reply to Jamie IlesThe PC7302 board can be populated with either a PC3X2 or PC3X3 device. Add DTS files for both variants of the PC7302.
--- arch/arm/boot/dts/picoxcell-pc7302-pc3x2.dts | 87 ++++++++++++++++++++++++ arch/arm/boot/dts/picoxcell-pc7302-pc3x3.dts | 93 ++++++++++++++++++++++++++ 2 files changed, 180 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/picoxcell-pc7302-pc3x2.dts create mode 100644 arch/arm/boot/dts/picoxcell-pc7302-pc3x3.dts
arch/arm/boot/dts/picoxcell-pc7302-pc3x2.dts new file +87 -0
@@ -0,0 +1,87 @@ +/* + * Copyright (C) 2011 Picochip, Jamie Iles + * + * 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. + */ + +/dts-v1/; +/include/ "picoxcell-pc3x2.dtsi" +/ { + model = "Picochip PC7302 (PC3X2)"; + compatible = "picochip,pc7302-pc3x2", "picochip,pc3x2"; + + memory { + device_type = "memory"; + reg = <0x0 0x08000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200 earlyprintk loglevel=9 root=ubi0:rootfs rw rootfstype=ubifs ubi.mtd=5,2048"; + linux,stdout-path = &uart0; + }; + + clocks { + ref_clk: clock at 1 { + compatible = "fixed-clock"; + clock-outputs = "ref"; + clock-frequency = <20000000>; + }; + }; + + rwid-axi { + ebi at 50000000 { + nand: gpio-nand at 2,0 { + compatible = "gpio-control-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <2 0x0000 0x1000>; + bus-clock = <&pclk>, "bus"; + gpio-control-nand,io-sync-reg = + <0x00000000 0x80220000>; + + gpios = <&banka 1 0 /* rdy */ + &banka 2 0 /* nce */ + &banka 3 0 /* ale */ + &banka 4 0 /* cle */ + 0 /* nwp */>; + + boot at 100000 { + label = "Boot"; + reg = <0x100000 0x80000>; + }; + + redundant-boot at 200000 { + label = "Redundant Boot"; + reg = <0x200000 0x80000>; + }; + + boot-env at 300000 { + label = "Boot Evironment"; + reg = <0x300000 0x20000>; + }; + + redundant-boot-env at 320000 { + label = "Redundant Boot Environment"; + reg = <0x300000 0x20000>; + }; + + kernel at 380000 { + label = "Kernel"; + reg = <0x380000 0x800000>; + }; + + fs at b80000 { + label = "File System"; + reg = <0xb80000 0xf480000>; + }; + }; + }; + }; +};
arch/arm/boot/dts/picoxcell-pc7302-pc3x3.dts new file +93 -0
93 lines not on this page · raw message
Signature · 1 line
1.7.4.1
cover Device Tree support for Picochip picoXcell
In reply to Jamie IlesQuoted 11 lines · Jamie Iles
This series adds initial support for Picochip picoXcell devices. I've based this off of Grant's devicetree/test branch and also on top of Russell's GPIO includes cleanup.
I have a second set of patches that add clk support but I've left them out for now to keep the changes to a minimum.
Jamie Iles (3):
picoxcell: support for Picochip picoxcell devices
picoxcell: add the DTS for pc3x2 and pc3x3 devices
picoxcell: add the DTS for the PC7302 board
Does anyone have any feedback on these? I've identified a couple of changes for a v2, in particular using of_platform_populate rather than of_platform_probe() and cleaning up some empty headers. I could also take advantage of Russell's io.h cleanup and Marc's sched_clock() if they get merged first.
Jamie