ARM: add initial support for Picochip picoXcell SoC
Subsystems (2)
v4 cover ARM: add initial support for Picochip picoXcell SoC
Hi,
This patch series adds support for the Picochip picoXcell series of femtocell SoC's. There are currently two device families - PC3X2 and PC3X3. Both include an ARM1176JZ-S, 100Mb Ethernet controller, 2xDMA controllers, eFuses, crypto offload engines and Picochip's array processor the picoArray. This patch series adds support for the base chip support including timers, gpio, pin muxing, clocks and pm and also the PC7302 development board that can take either PC3X2 or PC3X3 devices.
- debug-8250: add a 32 bit mode:
http://marc.info/?l=linux-arm-kernel&m=129044061221371&w=2
Changes since v3 include:
- Move to fixed sched_clock() implementation.
- Remove excessive use of __init directives.
- Simplify pm to allow drivers to manage all clks.
This also picks up on the CPU_V6K and PLAT_PHYS_OFFSET changes. I've also removed the SRAM patch to try and just get the core support in and make it simpler for review.
Jamie Iles (13):
picoxcell: add support for picoXcell
picoxcell: add support for AXI bus snoopers
picoxcell: add support for the system timers
picoxcell: add a pin muxing infrastructure
picoxcell: add gpio infrastructure
picoxcell: add support for system clks
picoxcell: add common SoC devices
picoxcell: add cpufreq support
picoxcell: add support for pm
picoxcell: add chained GPIO IRQ handlers
picoxcell: add support for pc3x2 devices
picoxcell: add support for pc3x3 devices
picoxcell: add support for the PC7302 development board
arch/arm/Kconfig | 16 + arch/arm/Makefile | 1 + arch/arm/mach-picoxcell/Kconfig | 38 + arch/arm/mach-picoxcell/Makefile | 11 + arch/arm/mach-picoxcell/Makefile.boot | 3 + arch/arm/mach-picoxcell/axi2cfg.c | 162 +++ arch/arm/mach-picoxcell/board_pc7302.c | 206 +++ arch/arm/mach-picoxcell/clk.c | 134 ++ arch/arm/mach-picoxcell/cpufreq.c | 146 +++ arch/arm/mach-picoxcell/devices.c | 126 ++ arch/arm/mach-picoxcell/gpio.c | 712 +++++++++++ arch/arm/mach-picoxcell/include/mach/clkdev.h | 71 + arch/arm/mach-picoxcell/include/mach/debug-macro.S | 18 + arch/arm/mach-picoxcell/include/mach/entry-macro.S | 19 + arch/arm/mach-picoxcell/include/mach/gpio.h | 188 +++ arch/arm/mach-picoxcell/include/mach/hardware.h | 29 + arch/arm/mach-picoxcell/include/mach/io.h | 38 + arch/arm/mach-picoxcell/include/mach/irqs.h | 89 ++ arch/arm/mach-picoxcell/include/mach/memory.h | 27 + .../include/mach/picoxcell/axi2cfg.h | 169 +++ .../mach-picoxcell/include/mach/picoxcell/gpio.h | 48 + .../include/mach/picoxcell/picoxcell.h | 62 + .../mach-picoxcell/include/mach/picoxcell/timer.h | 37 + .../mach-picoxcell/include/mach/picoxcell/wdog.h | 43 + arch/arm/mach-picoxcell/include/mach/platform.h | 27 + arch/arm/mach-picoxcell/include/mach/system.h | 51 + arch/arm/mach-picoxcell/include/mach/timex.h | 26 + arch/arm/mach-picoxcell/include/mach/uncompress.h | 60 + arch/arm/mach-picoxcell/include/mach/vmalloc.h | 18 + arch/arm/mach-picoxcell/io.c | 49 + arch/arm/mach-picoxcell/mux.c | 402 ++++++ arch/arm/mach-picoxcell/mux.h | 110 ++ arch/arm/mach-picoxcell/pc3x2.c | 442 +++++++ arch/arm/mach-picoxcell/pc3x3.c | 1341 ++++++++++++++++++++ arch/arm/mach-picoxcell/picoxcell_core.c | 339 +++++ arch/arm/mach-picoxcell/picoxcell_core.h | 25 + arch/arm/mach-picoxcell/pm.c | 112 ++ arch/arm/mach-picoxcell/soc.h | 62 + arch/arm/mach-picoxcell/time.c | 222 ++++ 39 files changed, 5679 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-picoxcell/Kconfig create mode 100644 arch/arm/mach-picoxcell/Makefile create mode 100644 arch/arm/mach-picoxcell/Makefile.boot create mode 100644 arch/arm/mach-picoxcell/axi2cfg.c create mode 100644 arch/arm/mach-picoxcell/board_pc7302.c create mode 100644 arch/arm/mach-picoxcell/clk.c create mode 100644 arch/arm/mach-picoxcell/cpufreq.c create mode 100644 arch/arm/mach-picoxcell/devices.c create mode 100644 arch/arm/mach-picoxcell/gpio.c create mode 100644 arch/arm/mach-picoxcell/include/mach/clkdev.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/memory.h create mode 100644 arch/arm/mach-picoxcell/include/mach/picoxcell/axi2cfg.h create mode 100644 arch/arm/mach-picoxcell/include/mach/picoxcell/gpio.h create mode 100644 arch/arm/mach-picoxcell/include/mach/picoxcell/picoxcell.h create mode 100644 arch/arm/mach-picoxcell/include/mach/picoxcell/timer.h create mode 100644 arch/arm/mach-picoxcell/include/mach/picoxcell/wdog.h create mode 100644 arch/arm/mach-picoxcell/include/mach/platform.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/mux.c create mode 100644 arch/arm/mach-picoxcell/mux.h create mode 100644 arch/arm/mach-picoxcell/pc3x2.c create mode 100644 arch/arm/mach-picoxcell/pc3x3.c create mode 100644 arch/arm/mach-picoxcell/picoxcell_core.c create mode 100644 arch/arm/mach-picoxcell/picoxcell_core.h create mode 100644 arch/arm/mach-picoxcell/pm.c create mode 100644 arch/arm/mach-picoxcell/soc.h create mode 100644 arch/arm/mach-picoxcell/time.c
Signature · 1 line
1.7.3.4
PATCH v4 1/13 picoxcell: add support for picoXcell
picoXcell is a family of femtocell SoC devices from Picochip [1] with an ARM subsystem. The devices have an ARM1176JZ-S core and a DSP processor array. Currently there are two sub families - PC3X2 and PC3X3. The latter includes extra power and performance control along with extra peripherals.
This initial patch adds the hardware definitions and a framework for adding device variants.
v2:
- Define VMALLOC_END as a fixed address rather than relative to PAGE_OFFSET
- Reduce the number of static IO mappings
- Put the picoXcell entry in the correct place in arch/arm/Kconfig
v3:
- Incorporate feedback from RMK
- Refactor static IO mappings into io.c and include arch specific ioremap and iounmap to reuse static mappings.
- Tell Linux about the TCMs and the onchip SRAM.
- Switch to __raw_ io accessors where possible. Note the AXI2CFG requires a strongly ordered protocol so retains ordered accessors.
v4:
- Remove redundant __init declarations and add a cpu_relax() to the AXI2CFG read polling
- Allow soc variants to register variant specific devices
--- arch/arm/Kconfig | 16 ++ arch/arm/Makefile | 1 + arch/arm/mach-picoxcell/Kconfig | 4 + arch/arm/mach-picoxcell/Makefile | 1 + arch/arm/mach-picoxcell/Makefile.boot | 3 + arch/arm/mach-picoxcell/axi2cfg.c | 162 ++++++++++++++++++ arch/arm/mach-picoxcell/include/mach/debug-macro.S | 18 ++ arch/arm/mach-picoxcell/include/mach/entry-macro.S | 19 ++ arch/arm/mach-picoxcell/include/mach/hardware.h | 29 ++++ arch/arm/mach-picoxcell/include/mach/io.h | 38 +++++ arch/arm/mach-picoxcell/include/mach/irqs.h | 89 ++++++++++ arch/arm/mach-picoxcell/include/mach/memory.h | 27 +++ .../include/mach/picoxcell/axi2cfg.h | 169 +++++++++++++++++++ .../mach-picoxcell/include/mach/picoxcell/gpio.h | 48 ++++++ .../include/mach/picoxcell/picoxcell.h | 62 +++++++ .../mach-picoxcell/include/mach/picoxcell/timer.h | 37 ++++ .../mach-picoxcell/include/mach/picoxcell/wdog.h | 43 +++++ arch/arm/mach-picoxcell/include/mach/platform.h | 27 +++ arch/arm/mach-picoxcell/include/mach/system.h | 51 ++++++ arch/arm/mach-picoxcell/include/mach/timex.h | 26 +++ arch/arm/mach-picoxcell/include/mach/uncompress.h | 60 +++++++ arch/arm/mach-picoxcell/include/mach/vmalloc.h | 18 ++ arch/arm/mach-picoxcell/io.c | 49 ++++++ arch/arm/mach-picoxcell/picoxcell_core.c | 176 ++++++++++++++++++++ arch/arm/mach-picoxcell/picoxcell_core.h | 22 +++ arch/arm/mach-picoxcell/soc.h | 60 +++++++ 26 files changed, 1255 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-picoxcell/Kconfig create mode 100644 arch/arm/mach-picoxcell/Makefile create mode 100644 arch/arm/mach-picoxcell/Makefile.boot create mode 100644 arch/arm/mach-picoxcell/axi2cfg.c 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/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/memory.h create mode 100644 arch/arm/mach-picoxcell/include/mach/picoxcell/axi2cfg.h create mode 100644 arch/arm/mach-picoxcell/include/mach/picoxcell/gpio.h create mode 100644 arch/arm/mach-picoxcell/include/mach/picoxcell/picoxcell.h create mode 100644 arch/arm/mach-picoxcell/include/mach/picoxcell/timer.h create mode 100644 arch/arm/mach-picoxcell/include/mach/picoxcell/wdog.h create mode 100644 arch/arm/mach-picoxcell/include/mach/platform.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/picoxcell_core.c create mode 100644 arch/arm/mach-picoxcell/picoxcell_core.h create mode 100644 arch/arm/mach-picoxcell/soc.h
arch/arm/Kconfig +16 -0
@@ -610,6 +610,20 @@ config ARCH_PNX4008 help This enables support for Philips PNX4008 mobile platform. +config ARCH_PICOXCELL + bool "Picochip picoXcell" + select ARM_VIC + select GENERIC_CLOCKEVENTS + select HAVE_SCHED_CLOCK + select GENERIC_GPIO + select ARCH_REQUIRE_GPIOLIB + select CLKDEV_LOOKUP + select CPU_V6K + select HAVE_TCM + help + This enables support for systems based on the Picochip picoXcell + family of Femtocell devices. + config ARCH_PXA bool "PXA2xx/PXA3xx-based" depends on MMU
@@ -959,6 +973,8 @@ source "arch/arm/mach-omap2/Kconfig" source "arch/arm/mach-orion5x/Kconfig" +source "arch/arm/mach-picoxcell/Kconfig" + source "arch/arm/mach-pxa/Kconfig" source "arch/arm/plat-pxa/Kconfig"
arch/arm/Makefile +1 -0
@@ -166,6 +166,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_PXA) := pxa machine-$(CONFIG_ARCH_REALVIEW) := realview
arch/arm/mach-picoxcell/Kconfig new file +4 -0
@@ -0,0 +1,4 @@ +menu "PICOXCELL platform type" + depends on ARCH_PICOXCELL + +endmenu
arch/arm/mach-picoxcell/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y := picoxcell_core.o io.o axi2cfg.o
arch/arm/mach-picoxcell/Makefile.boot new file +3 -0
@@ -0,0 +1,3 @@ + zreladdr-y := 0x00008000 +params_phys-y := 0x00000100 +initrd_phys-y := 0x00800000
arch/arm/mach-picoxcell/axi2cfg.c new file +162 -0
162 lines not on this page · raw message
arch/arm/mach-picoxcell/include/mach/debug-macro.S 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 version 2 as + * published by the Free Software Foundation. + * +*/ + + .macro addruart, rp, rv + mov \rv, #0x00230000 + orr \rp, \rv, #0x80000000 + orr \rv, \rv, #0xFE000000 + .endm + +#define UART_SHIFT 2 +#define DEBUG_8250_ACCESS_32 +#include <asm/hardware/debug-8250.S>
arch/arm/mach-picoxcell/include/mach/entry-macro.S new file +19 -0
@@ -0,0 +1,19 @@ +/* + * entry-macro.S + * + * Copyright (c) 2010 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/io.h> +#include <mach/irqs.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/hardware.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* Copyright (c) 2010 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. +* +* 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 __ASM_ARCH_HARDWARE_H +#define __ASM_ARCH_HARDWARE_H + +#include <mach/picoxcell/axi2cfg.h> +#include <mach/picoxcell/gpio.h> +#include <mach/picoxcell/picoxcell.h> +#include <mach/picoxcell/timer.h> +#include <mach/picoxcell/wdog.h> + +#endif
arch/arm/mach-picoxcell/include/mach/io.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* 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 __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +#define PHYS_TO_IO (x) (((x) & 0x00ffffff) | 0xfe000000) +#ifdef __ASSEMBLY__ +# define IO_ADDRESS (x) PHYS_TO_IO((x)) +#else /* __ASSEMBLY__ */ +# define IO_ADDRESS (x) (void __iomem __force *)(PHYS_TO_IO((x))) +# define IO_SPACE_LIMIT 0xffffffff +# define __io (a) __typesafe_io(a) +# define __mem_pci (a) (a) + +#define __arch_ioremap (p, s, t) picoxcell_ioremap(p, s, t) +#define __arch_iounmap (v) picoxcell_iounmap(v) + +void __iomem *picoxcell_ioremap (unsigned long phys,size_t size, +unsigned int type); +void picoxcell_iounmap (volatile void __iomem *addr); +#endif /* __ASSEMBLY__ */ + +#endif /* __ASM_ARM_ARCH_IO_H */
arch/arm/mach-picoxcell/include/mach/irqs.h new file +89 -0
89 lines not on this page · raw message
arch/arm/mach-picoxcell/include/mach/memory.h new file +27 -0
@@ -0,0 +1,27 @@ +/* +* 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 __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H + +/* +* Physical DRAM offset. +*/ +#define PLAT_PHYS_OFFSET UL(0x00000000) + +#endif +
arch/arm/mach-picoxcell/include/mach/picoxcell/axi2cfg.h new file +169 -0
169 lines not on this page · raw message
arch/arm/mach-picoxcell/include/mach/picoxcell/gpio.h new file +48 -0
48 lines not on this page · raw message
arch/arm/mach-picoxcell/include/mach/picoxcell/picoxcell.h new file +62 -0
62 lines not on this page · raw message
arch/arm/mach-picoxcell/include/mach/picoxcell/timer.h new file +37 -0
@@ -0,0 +1,37 @@ +/* +* 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 PICOXCELL_TIMER_H +#define PICOXCELL_TIMER_H + +/* The spacing between individual timers. */ +#define TIMER_SPACING 0x14 + +#define TIMER_LOAD_COUNT_REG_OFFSET 0x00 +#define TIMER_CONTROL_REG_OFFSET 0x08 +#define TIMER_EOI_REG_OFFSET 0x0c + +#define TIMERS_EOI_REG_OFFSET 0xa4 + +#define TIMER_ENABLE 0x00000001 +#define TIMER_MODE 0x00000002 +#define TIMER_INTERRUPT_MASK 0x00000004 + +#define RTCLK_CCV_REG_OFFSET 0x00 +#define RTCLK_SET_REG_OFFSET 0x08 + +#endif /* PICOXCELL_TIMER_H */
arch/arm/mach-picoxcell/include/mach/picoxcell/wdog.h new file +43 -0
43 lines not on this page · raw message
arch/arm/mach-picoxcell/include/mach/platform.h new file +27 -0
@@ -0,0 +1,27 @@ +/* +* 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 __ARCH_PICOXCELL_PLATFORM_H +#define __ARCH_PICOXCELL_PLATFORM_H + +/* Physical address of the Flash in the ARM sub-system memory map */ +#define PICOXCELL_FLASH_BASE 0x40000000 + +/* The clock frequency for the UARTs */ +#define PICOXCELL_BASE_BAUD 3686400/* 3.6864 MHz */ + +#endif /* __ARCH_PICOXCELL_PLATFORM_H */
arch/arm/mach-picoxcell/include/mach/system.h new file +51 -0
51 lines not on this page · raw message
arch/arm/mach-picoxcell/include/mach/timex.h new file +26 -0
@@ -0,0 +1,26 @@ +/* +* 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__ + +#include <mach/platform.h> + +#define CLOCK_TICK_RATE 200000000/* 200MHz */ + +#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 +49 -0
49 lines not on this page · raw message
arch/arm/mach-picoxcell/picoxcell_core.c new file +176 -0
176 lines not on this page · raw message
arch/arm/mach-picoxcell/picoxcell_core.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* linux/arch/arm/mach-picoxcell/picoxcell_core.h +* +* 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 version 2 as +* published by the Free Software Foundation. +* +* All enquiries to support at picochip.com +*/ +#ifndef __ASM_ARCH_PICOXCELL_CORE_H__ +#define __ASM_ARCH_PICOXCELL_CORE_H__ + +struct picoxcell_soc ; + +extern void picoxcell_init_early (void ); +extern void picoxcell_core_init (void ); +extern void picoxcell_init_irq (void ); +extern void picoxcell_map_io (void ); + +#endif /* __ASM_ARCH_PICOXCELL_CORE_H__ */
arch/arm/mach-picoxcell/soc.h new file +60 -0
60 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v4 2/13 picoxcell: add support for AXI bus snoopers
In reply to Jamie IlesThe picoXcell devices have a number of peripherals that may perform master accesses to the AXI bus, but if incorrectly programmed can generate a bus error. The AXI2CFG block has bus snoopers that monitor the bus for errors from other masters and raises an interrupt if detected. These errors are typically irrecoverable so panic if we see them.
--- arch/arm/mach-picoxcell/picoxcell_core.c | 88 ++++++++++++++++++++++++++++++ 1 files changed, 88 insertions(+), 0 deletions(-)
arch/arm/mach-picoxcell/picoxcell_core.c +88 -0
@@ -153,6 +153,91 @@ static void picoxcell_debugfs_init(void) } } +/* +* AXI Bus Read / Write Error Handling +* +* Some of the peripherals on the AXI bus can generate aborts. For example, a +* DMAC trying to DMA from the EBI. This isn't supported and will generate an +* error response. This can't be recovered from so we report the error and +* panic. +* +* Given a bit number in the AXI2Cfg snoop AXI error IRQ post mask register, +* give the textual name of the operation that generated the error. +*/ +static const char *axi_bus_error_name (int bit) +{ +static const char *snoop_err_names[32 ] = { + [0 ] ="dmac1_channel0 (read)" , + [1 ] ="dmac1_channel1 (read)" , + [2 ] ="dmac1_channel2 (read)" , + [3 ] ="dmac1_channel3 (read)" , + [4 ] ="dmac2_channel0 (read)" , + [5 ] ="dmac2_channel1 (read)" , + [6 ] ="dmac2_channel2 (read)" , + [7 ] ="dmac2_channel3 (read)" , + [8 ] ="emac (read)" , + [9 ] ="cipher (read)" , + [10 ] ="srtp (read)" , + [11 ] ="ipsec (read)" , + [12 ] ="dmac1_channel0 (write)" , + [13 ] ="dmac1_channel1 (write)" , + [14 ] ="dmac1_channel2 (write)" , + [15 ] ="dmac1_channel3 (write)" , + [16 ] ="dmac2_channel0 (write)" , + [17 ] ="dmac2_channel1 (write)" , + [18 ] ="dmac2_channel2 (write)" , + [19 ] ="dmac2_channel3 (write)" , + [20 ] ="emac (write)" , + [21 ] ="cipher (write)" , + [22 ] ="srtp (write)" , + [23 ] ="ipsec (write)" , + }; + +return snoop_err_names[bit] ?:"<INVALID SNOOP ERROR>" ; +} + +/* AXI Bus write errors */ +static irqreturn_t picoxcell_axi_bus_error_interrupt (int irq,void *dev_id) +{ +/* +* If we ever get one of these interrupts then we are in big trouble, +* they should never happen. The error condition is non recoverable. +*/ +unsigned long axi_error = +axi2cfg_readl (AXI2CFG_AXI_ERR_STATE_REG_OFFSET ); +int bit; + +for_each_set_bit (bit, &axi_error,32 ) { +pr_emerg ("AXI bus error [%s] detected\n" , +axi_bus_error_name (bit)); + } +panic ("unable to handle AXI bus error" ); + +return IRQ_HANDLED ; +} + +static struct irqaction picoxcell_axi_error_irq = { + .name ="picoxcell axi bus error" , + .flags =IRQF_DISABLED , + .handler = picoxcell_axi_bus_error_interrupt, +}; + +/* Initialise AXI Bus error handling */ +static void picoxcell_axi_bus_error_init (void ) +{ +/* Setup the irq handler for AXI read and write errors. */ +setup_irq (IRQ_AXI_RD_ERR , &picoxcell_axi_error_irq); +setup_irq (IRQ_AXI_WR_ERR , &picoxcell_axi_error_irq); + +/* Make sure no AXI errors are masked */ +axi2cfg_writel (AXI2CFG_AXI_ERR_MASK_NONE , +AXI2CFG_AXI_ERR_MASK_REG_OFFSET ); + +/* Enable interrupts for all AXI Read & Write errors */ +axi2cfg_writel (AXI2CFG_AXI_ERR_ENABLE_ALL , +AXI2CFG_AXI_ERR_ENABLE_REG_OFFSET ); +} +void __init picoxcell_init_early (void ) {axi2cfg_init ();
@@ -173,4 +258,7 @@ void __init picoxcell_core_init(void)/* Add the arch debugfs entry. */ picoxcell_debugfs_init (); + +/* Add handlers for the AXI bus snooping. */ +picoxcell_axi_bus_error_init (); }
Signature · 1 line
1.7.3.4
PATCH v4 3/13 picoxcell: add support for the system timers
In reply to Jamie IlesThe picoXcell devices have 4 timers capable of generating interrupts when they reach a predefined value and restarting and a freerunning RTC. Use one of the interrupt capable timers as the clockevent_device and the RTC for the clocksource and sched_clock().
v2:
- use clocksource_register_hz() and clockevents_calc_mult_shift() rather than specifying .mult and .shift.
v3:
- Incorporate feedback from RMK.
- Don't emulate oneshot mode in the timers, let the generic clockevents layer do it.
- Provide a better sched_clock() based on plat-nomadik's.
- Convert to __raw_ io accessors.
v4:
- Use the fixed_sched_clock helpers for sched_clock() implementation as provided by RMK and remove redunant use of __init.
--- arch/arm/mach-picoxcell/Makefile | 3 +- arch/arm/mach-picoxcell/picoxcell_core.c | 1 + arch/arm/mach-picoxcell/picoxcell_core.h | 3 + arch/arm/mach-picoxcell/time.c | 222 ++++++++++++++++++++++++++++++ 4 files changed, 228 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-picoxcell/time.c
arch/arm/mach-picoxcell/Makefile +2 -1
@@ -1 +1,2 @@ -obj-y := picoxcell_core.o io.o axi2cfg.o +obj-y := picoxcell_core.o io.o axi2cfg.o \ + time.o
arch/arm/mach-picoxcell/picoxcell_core.c +1 -0
@@ -241,6 +241,7 @@ static void picoxcell_axi_bus_error_init(void)void __init picoxcell_init_early (void ) {axi2cfg_init (); +picoxcell_sched_clock_init (); }void __init picoxcell_core_init (void )
arch/arm/mach-picoxcell/picoxcell_core.h +3 -0
@@ -13,10 +13,13 @@#define __ASM_ARCH_PICOXCELL_CORE_H__struct picoxcell_soc ; +struct sys_timer ;extern void picoxcell_init_early (void );extern void picoxcell_core_init (void );extern void picoxcell_init_irq (void );extern void picoxcell_map_io (void ); +extern struct sys_timer picoxcell_sys_timer; +extern void picoxcell_sched_clock_init (void );#endif /* __ASM_ARCH_PICOXCELL_CORE_H__ */
arch/arm/mach-picoxcell/time.c new file +222 -0
222 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v4 4/13 picoxcell: add a pin muxing infrastructure
In reply to Jamie IlespicoXcell devices have two types of GPIO pins - ARM and SDGPIO (the latter are in the picoArray domain) and some of these pins are also shared with peripherals. Provide an API for configuring the multiplexing of each pin and a userspace sysfs interface so they can be reprogrammed at runtime. Some of the peripherals that use the pins are driven by the DSP array and so the kernel won't know how to configure these pins so this is left to the userspace application.
v2:
- Allow pins to have muxing set by name (to cope with multi output GPIO's) and allow the peripheral to be specified.
- Convert the debugfs entry to a seq_file to cope with larger numbers of pins.
--- arch/arm/mach-picoxcell/Makefile | 3 +- arch/arm/mach-picoxcell/mux.c | 402 ++++++++++++++++++++++++++++++ arch/arm/mach-picoxcell/mux.h | 110 ++++++++ arch/arm/mach-picoxcell/picoxcell_core.c | 3 + 4 files changed, 517 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-picoxcell/mux.c create mode 100644 arch/arm/mach-picoxcell/mux.h
arch/arm/mach-picoxcell/Makefile +2 -1
@@ -1,2 +1,3 @@ obj-y := picoxcell_core.o io.o axi2cfg.o \ - time.o + time.o \ + mux.o
arch/arm/mach-picoxcell/mux.c new file +402 -0
402 lines not on this page · raw message
arch/arm/mach-picoxcell/mux.h new file +110 -0
110 lines not on this page · raw message
arch/arm/mach-picoxcell/picoxcell_core.c +3 -0
@@ -260,6 +260,9 @@ void __init picoxcell_core_init(void)/* Add the arch debugfs entry. */ picoxcell_debugfs_init (); +/* Initialise the pin muxing and gpio infrastructure. */ +picoxcell_muxing_init (soc); +/* Add handlers for the AXI bus snooping. */ picoxcell_axi_bus_error_init (); }
Signature · 1 line
1.7.3.4
PATCH v4 5/13 picoxcell: add gpio infrastructure
In reply to Jamie IlesAdd a gpio infrastructure for picoXcell devices. This adds support for both the ARM GPIO peripheral and the SDGPIO pins that are in the picoArray domain and accessed through the AXI2CFG. This implements a set of gpiolib chips and also adds an extension to use the sigma-delta capabilities of the SDGPIO pins in kernelspace.
v2:
- Fixup the picoxcell gpio driver to use struct irq_data rather than irq numbers in the handlers and accessing irq_desc directly.
- Fixup a typo in the set_type function where we didn't check correctly for IRQ_TYPE_EDGE_FALLING.
v3: fixup muxing detection to work with the muxing changes.
--- arch/arm/mach-picoxcell/Makefile | 3 +- arch/arm/mach-picoxcell/gpio.c | 712 +++++++++++++++++++++++++++ arch/arm/mach-picoxcell/include/mach/gpio.h | 186 +++++++ arch/arm/mach-picoxcell/picoxcell_core.c | 5 + 4 files changed, 905 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-picoxcell/gpio.c create mode 100644 arch/arm/mach-picoxcell/include/mach/gpio.h
arch/arm/mach-picoxcell/Makefile +2 -1
@@ -1,3 +1,4 @@ obj-y := picoxcell_core.o io.o axi2cfg.o \ time.o \ - mux.o + mux.o \ + gpio.o
arch/arm/mach-picoxcell/gpio.c new file +712 -0
712 lines not on this page · raw message
arch/arm/mach-picoxcell/include/mach/gpio.h new file +186 -0
186 lines not on this page · raw message
arch/arm/mach-picoxcell/picoxcell_core.c +5 -0
@@ -8,6 +8,7 @@* All enquiries to support at picochip.com */ #include <linux/debugfs.h> +#include <linux/gpio.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/irq.h>
@@ -263,6 +264,10 @@ void __init picoxcell_core_init(void)/* Initialise the pin muxing and gpio infrastructure. */ picoxcell_muxing_init (soc); +picoxcell_gpio_init (soc->armgpio_pins, soc->nr_armgpio, + soc->armgpio_base, soc->sdgpio_pins, + soc->nr_sdgpio, soc->sdgpio_base); +/* Add handlers for the AXI bus snooping. */ picoxcell_axi_bus_error_init (); }
Signature · 1 line
1.7.3.4
PATCH v4 6/13 picoxcell: add support for system clks
In reply to Jamie IlesThe different picoXcell device variants have different numbers of clocks and different capabilities (PC3X2 doesn't have any gateable or controllable clocks). Add the infrastructure necessary for device variants to provide their own clock implementation.
v2: allow multiple clk lookups so we can have aliases
--- arch/arm/mach-picoxcell/Makefile | 3 +- arch/arm/mach-picoxcell/clk.c | 134 +++++++++++++++++++++++++ arch/arm/mach-picoxcell/include/mach/clkdev.h | 71 +++++++++++++ arch/arm/mach-picoxcell/picoxcell_core.c | 5 + 4 files changed, 212 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-picoxcell/clk.c create mode 100644 arch/arm/mach-picoxcell/include/mach/clkdev.h
arch/arm/mach-picoxcell/Makefile +2 -1
@@ -1,4 +1,5 @@ obj-y := picoxcell_core.o io.o axi2cfg.o \ time.o \ mux.o \ - gpio.o + gpio.o \ + clk.o
arch/arm/mach-picoxcell/clk.c new file +134 -0
134 lines not on this page · raw message
arch/arm/mach-picoxcell/include/mach/clkdev.h new file +71 -0
71 lines not on this page · raw message
arch/arm/mach-picoxcell/picoxcell_core.c +5 -0
@@ -17,6 +17,7 @@#include <asm/hardware/vic.h> #include <asm/mach-types.h> +#include <mach/clkdev.h> #include <mach/hardware.h> #include "mux.h"
@@ -152,6 +153,7 @@ static void picoxcell_debugfs_init(void) arch_debugfs_dir =NULL ;return ; } +picoxcell_clk_debugfs_init (); }/*
@@ -241,8 +243,11 @@ static void picoxcell_axi_bus_error_init(void)void __init picoxcell_init_early (void ) { +struct picoxcell_soc *soc =picoxcell_get_soc (); +axi2cfg_init ();picoxcell_sched_clock_init (); + soc->init_clocks (); }void __init picoxcell_core_init (void )
Signature · 1 line
1.7.3.4
PATCH v4 7/13 picoxcell: add common SoC devices
In reply to Jamie IlesAdd the devices common to all picoXcell variants (UART and PMU). Other peripherals such as DMA, SPI, fuses and EMAC will be added later with driver support.
v3:
- move device registration to an arch_initcall
- mark common_devices with __initdata
v2:
- split the UARTs into two separate platform devices and use PLAT8250_* as the IDs
--- arch/arm/mach-picoxcell/Makefile | 3 +- arch/arm/mach-picoxcell/devices.c | 126 +++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-picoxcell/devices.c
arch/arm/mach-picoxcell/Makefile +2 -1
@@ -2,4 +2,5 @@ obj-y := picoxcell_core.o io.o axi2cfg.o \ time.o \ mux.o \ gpio.o \ - clk.o + clk.o \ + devices.o
arch/arm/mach-picoxcell/devices.c new file +126 -0
126 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v4 8/13 picoxcell: add cpufreq support
In reply to Jamie IlesPC3X3 devices have a PLL to control the ARM core speed. Add a cpufreq driver so that we can run at optimum speed and power.
v2:
- move to a module initcall
--- arch/arm/mach-picoxcell/Makefile | 1 + arch/arm/mach-picoxcell/cpufreq.c | 146 +++++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-picoxcell/cpufreq.c
arch/arm/mach-picoxcell/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-y := picoxcell_core.o io.o axi2cfg.o \ gpio.o \ clk.o \ devices.o +obj-$(CONFIG_CPU_FREQ) += cpufreq.o
arch/arm/mach-picoxcell/cpufreq.c new file +146 -0
146 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v4 9/13 picoxcell: add support for pm
In reply to Jamie IlesPC3X3 devices support clock gating so provide support for PM on these devices. We only support standby modes as we can't gate the ARM clock or memory controllers.
v2:
- move to an initcall and cleanup to remove uses of ebi and tzpc clks.
--- arch/arm/mach-picoxcell/Makefile | 1 + arch/arm/mach-picoxcell/pm.c | 112 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-picoxcell/pm.c
arch/arm/mach-picoxcell/Makefile +1 -0
@@ -5,3 +5,4 @@ obj-y := picoxcell_core.o io.o axi2cfg.o \ clk.o \ devices.o obj-$(CONFIG_CPU_FREQ) += cpufreq.o +obj-$(CONFIG_PM) += pm.o
arch/arm/mach-picoxcell/pm.c new file +112 -0
112 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v4 10/13 picoxcell: add chained GPIO IRQ handlers
In reply to Jamie IlesThe 8 bits of port A on the ARM GPIO of all devices are capable of generating interrupts. Provide chained handlers so that these pins can be used as interrupts and the sensitivity and polarity can be set.
v2:
- Use the generic IRQ handlers rather than using the irq_desc.
--- arch/arm/mach-picoxcell/include/mach/gpio.h | 2 + arch/arm/mach-picoxcell/picoxcell_core.c | 39 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 0 deletions(-)
arch/arm/mach-picoxcell/include/mach/gpio.h +2 -0
@@ -151,6 +151,8 @@ enum {#ifdef __KERNEL__ +extern struct irq_chip armgpio_irqchip; +static inline int gpio_get_value (unsigned gpio) {return __gpio_get_value (gpio);
arch/arm/mach-picoxcell/picoxcell_core.c +39 -0
@@ -24,6 +24,18 @@#include "picoxcell_core.h" #include "soc.h" +static void gpio_irq_handler (unsigned int irq,struct irq_desc *desc) +{ +unsigned real_irq = (irq -IRQ_GPIO0 + __IRQ_GPIO0); +/* +* We have 8 GPIO pins that can generate interrupts and each one has +* it's own interrupt bit in the VIC. All we need to do is do a +* one-to-one translation from the virtual IRQ number to the real one +* and call the handler. +*/ +generic_handle_irq (real_irq); +} +struct picoxcell_soc *picoxcell_get_soc (void ) { unsigned long device_id =
@@ -37,6 +49,11 @@ struct picoxcell_soc *picoxcell_get_soc(void)void __init picoxcell_init_irq (void ) { +#define GPIO_INT_EN_REG IO_ADDRESS(PICOXCELL_GPIO_BASE + \ + GPIO_INT_EN_REG_OFFSET) +#define GPIO_EOI_REG IO_ADDRESS(PICOXCELL_GPIO_BASE + \ + GPIO_PORT_A_EOI_REG_OFFSET) +unsigned i;u32 vic0_resume_sources = (1 << (IRQ_AXI2PICO8 &31 )) | (1 << (IRQ_EMAC & 31)) |
@@ -45,6 +62,28 @@ void __init picoxcell_init_irq(void)vic_init (IO_ADDRESS (PICOXCELL_VIC0_BASE ),32 ,0xFFFFFFFE , vic0_resume_sources);vic_init (IO_ADDRESS (PICOXCELL_VIC1_BASE ),0 ,0x7FF ,0 ); + +/* +* We want to enable/disable interrupts for the GPIO pins through the +* GPIO block itself. To do this we install a chained handler. If a +* user requests one of the __IRQ_GPIOn interrupts then the GPIO block +* won't get configured. We provide these interrupts below as virtual +* ones that will configure the GPIO block and enable the source in +* the VIC. +* +* The chained handler simply converts from the virtual IRQ handler to +* the real interrupt source and calls the GPIO IRQ handler. +*/ +__raw_writel (0 ,GPIO_INT_EN_REG ); +__raw_writel (~0 ,GPIO_EOI_REG ); +for (i =IRQ_GPIO0 ; i <=IRQ_GPIO7 ; ++i) { +set_irq_chip (i, &armgpio_irqchip); +set_irq_handler (i, handle_level_irq); +set_irq_flags (i,IRQF_VALID ); + } + +for (i = __IRQ_GPIO0; i <= __IRQ_GPIO7; ++i) +set_irq_chained_handler (i, gpio_irq_handler); }static const char *picoxcell_get_partname (void )
Signature · 1 line
1.7.3.4
PATCH v4 11/13 picoxcell: add support for pc3x2 devices
In reply to Jamie IlesPC3X2 is the first supported device family of picoXcell and this patch defines the virtual clocks to allow drivers to work, the pin muxing options, timer locations and the GPIO definitions.
v2: remove redundant include of asm/mach/map.h
v3: update to use new clk lookups and muxing peripheral return types
--- arch/arm/mach-picoxcell/Kconfig | 7 + arch/arm/mach-picoxcell/Makefile | 1 + arch/arm/mach-picoxcell/pc3x2.c | 442 ++++++++++++++++++++++++++++++ arch/arm/mach-picoxcell/picoxcell_core.c | 13 +- arch/arm/mach-picoxcell/soc.h | 1 + 5 files changed, 463 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-picoxcell/pc3x2.c
arch/arm/mach-picoxcell/Kconfig +7 -0
@@ -1,4 +1,11 @@ menu "PICOXCELL platform type" depends on ARCH_PICOXCELL +config PICOXCELL_PC3X2 + bool "Support PC3x2 devices" + default y + help + Include support for picoChip PC3x2 family of devices. This + includes PC302 and PC312. + endmenu
arch/arm/mach-picoxcell/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-y := picoxcell_core.o io.o axi2cfg.o \ devices.o obj-$(CONFIG_CPU_FREQ) += cpufreq.o obj-$(CONFIG_PM) += pm.o +obj-$(CONFIG_PICOXCELL_PC3X2) += pc3x2.o
arch/arm/mach-picoxcell/pc3x2.c new file +442 -0
442 lines not on this page · raw message
arch/arm/mach-picoxcell/picoxcell_core.c +12 -1
@@ -42,6 +42,10 @@ struct picoxcell_soc *picoxcell_get_soc(void)__raw_readl (IO_ADDRESS (PICOXCELL_AXI2CFG_BASE +AXI2CFG_DEVICE_ID_REG_OFFSET ));switch (device_id) { +case 0x8003 : +case 0x8007 : +return &pc3x2_soc; +default :panic ("unsupported device type %lx" , device_id); }
@@ -89,7 +93,14 @@ void __init picoxcell_init_irq(void)static const char *picoxcell_get_partname (void ) {unsigned long dev_id =axi2cfg_readl (AXI2CFG_DEVICE_ID_REG_OFFSET ); -const char *part ="<unknown>" ; +const char *part; + +if (0x8003 == dev_id) + part ="pc302" ; +else if (0x8007 == dev_id) + part ="pc312" ; +else + part ="<unknown>" ;return part; }
arch/arm/mach-picoxcell/soc.h +1 -0
@@ -49,6 +49,7 @@ struct picoxcell_soc { };extern struct picoxcell_soc *picoxcell_get_soc (void ); +extern struct picoxcell_soc pc3x2_soc;static inline int picoxcell_has_feature (enum picoxcell_features feat) {
Signature · 1 line
1.7.3.4
PATCH v4 12/13 picoxcell: add support for pc3x3 devices
In reply to Jamie IlesPC3X3 is the second supported device family of picoXcell and this patch defines the virtual clocks to allow drivers to work, the pin muxing options, timer locations and the GPIO definitions. This also implements the PLL control for the ARM PLL.
v2: remove device specific IO mappings as the only peripherals not accessed through ioremap() share a common address space in all devices.
v3:
- Use the new muxing return types.
- Add muxing support for ebi_addr26.
- Convert to __raw_ io accessors.
--- arch/arm/mach-picoxcell/Kconfig | 18 + arch/arm/mach-picoxcell/Makefile | 1 + arch/arm/mach-picoxcell/pc3x3.c | 1341 ++++++++++++++++++++++++++++++ arch/arm/mach-picoxcell/picoxcell_core.c | 11 + arch/arm/mach-picoxcell/soc.h | 1 + 5 files changed, 1372 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-picoxcell/pc3x3.c
arch/arm/mach-picoxcell/Kconfig +18 -0
@@ -8,4 +8,22 @@ config PICOXCELL_PC3X2 Include support for picoChip PC3x2 family of devices. This includes PC302 and PC312. +config PICOXCELL_PC3X3 + bool "Support PC3x3 devices" + default y + select ARCH_HAS_CPUFREQ + help + Include support for picoChip PC3x3 family of devices. This includes + PC313, PC323 and PC333. + +config PC3X3_STOP_WDT_IN_SUSPEND + bool "Stop WDT in PM suspend" + depends on PICOCHIP_PC3X3 + default y + help + If you say yes here, then when the platform is put into suspend mode, + the watchdog timer will be paused. Saying no will cause the watchdog + to keep running. If you say no here, make sure that the watchdog uses + the pretimeout mode and mark the watchdog as a wakeup source. + endmenu
arch/arm/mach-picoxcell/Makefile +1 -0
@@ -7,3 +7,4 @@ obj-y := picoxcell_core.o io.o axi2cfg.o \ obj-$(CONFIG_CPU_FREQ) += cpufreq.o obj-$(CONFIG_PM) += pm.o obj-$(CONFIG_PICOXCELL_PC3X2) += pc3x2.o +obj-$(CONFIG_PICOXCELL_PC3X3) += pc3x3.o
arch/arm/mach-picoxcell/pc3x3.c new file +1341 -0
1,341 lines not on this page · raw message
arch/arm/mach-picoxcell/picoxcell_core.c +11 -0
@@ -46,6 +46,11 @@ struct picoxcell_soc *picoxcell_get_soc(void)case 0x8007 :return &pc3x2_soc; +case 0x20 : +case 0x21 : +case 0x22 : +return &pc3x3_soc; +default :panic ("unsupported device type %lx" , device_id); }
@@ -99,6 +104,12 @@ static const char *picoxcell_get_partname(void) part ="pc302" ; else if (0x8007 == dev_id) part ="pc312" ; + else if (0x20 == dev_id) + part ="pc313" ; + else if (0x21 == dev_id) + part ="pc323" ; + else if (0x22 == dev_id) + part ="pc333" ; else part ="<unknown>" ;
arch/arm/mach-picoxcell/soc.h +1 -0
@@ -50,6 +50,7 @@ struct picoxcell_soc {extern struct picoxcell_soc *picoxcell_get_soc (void );extern struct picoxcell_soc pc3x2_soc; +extern struct picoxcell_soc pc3x3_soc;static inline int picoxcell_has_feature (enum picoxcell_features feat) {
Signature · 1 line
1.7.3.4
PATCH v4 13/13 picoxcell: add support for the PC7302 development board
In reply to Jamie IlesThe PC7302 development board is capable of taking both PC3X2 and PC3X3 devices and features NOR flash, NAND flash, SPI NOR flash a serial console, 100Mb Ethernet and a number of picoArray peripherals.
This patch provides initial support for running on the PC7302 board.
v3:
- remove redundant __init declarations.
v2:
- multiplex the NAND CLE pin by pad name.
- convert to __raw_ io accessors.
--- arch/arm/mach-picoxcell/Kconfig | 9 ++ arch/arm/mach-picoxcell/Makefile | 1 + arch/arm/mach-picoxcell/board_pc7302.c | 206 ++++++++++++++++++++++++++++++++ 3 files changed, 216 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-picoxcell/board_pc7302.c
arch/arm/mach-picoxcell/Kconfig +9 -0
@@ -16,6 +16,15 @@ config PICOXCELL_PC3X3 Include support for picoChip PC3x3 family of devices. This includes PC313, PC323 and PC333. +config BOARD_PC7302 + bool "Support PC7302 Board" + depends on PICOXCELL_PC3X2 || PICOXCELL_PC3X3 + default y + help + Include support for the picoChip PC7302 platform. This platform is + can take any of the PC3X2 or PC3X3 devices and includes SPI NOR + flash, parallel NOR flash and NAND flash. + config PC3X3_STOP_WDT_IN_SUSPEND bool "Stop WDT in PM suspend" depends on PICOCHIP_PC3X3
arch/arm/mach-picoxcell/Makefile +1 -0
@@ -8,3 +8,4 @@ obj-$(CONFIG_CPU_FREQ) += cpufreq.o obj-$(CONFIG_PM) += pm.o obj-$(CONFIG_PICOXCELL_PC3X2) += pc3x2.o obj-$(CONFIG_PICOXCELL_PC3X3) += pc3x3.o +obj-$(CONFIG_BOARD_PC7302) += board_pc7302.o
arch/arm/mach-picoxcell/board_pc7302.c new file +206 -0
206 lines not on this page · raw message
Signature · 1 line
1.7.3.4
v4 cover ARM: add initial support for Picochip picoXcell SoC
In reply to Jamie IlesQuoted 15 lines · Jamie Iles
Hi,
This patch series adds support for the Picochip picoXcell series of femtocell SoC's. There are currently two device families - PC3X2 and PC3X3. Both include an ARM1176JZ-S, 100Mb Ethernet controller, 2xDMA controllers, eFuses, crypto offload engines and Picochip's array processor the picoArray. This patch series adds support for the base chip support including timers, gpio, pin muxing, clocks and pm and also the PC7302 development board that can take either PC3X2 or PC3X3 devices.
- debug-8250: add a 32 bit mode:
http://marc.info/?l=linux-arm-kernel&m=129044061221371&w=2Changes since v3 include:
Quoted 7 lines
- Move to fixed
sched_clock()implementation.
- Remove excessive use of__initdirectives.
- Simplify pm to allow drivers to manage all clks.This also picks up on the
CPU_V6KandPLAT_PHYS_OFFSETchanges. I've also removed the SRAM patch to try and just get the core support in and make it simpler for review.
ping. Anyone have any feedback on these patches or anything to make them easier to review?
Thanks,
Jamie