Skip to contentSkip to conversation

ARM: add initial support for Picochip picoXcell SoC

PATCH Superseded Jamie Iles 1 participant 15 messages Dec 10, 2010

Subsystems (2)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Jamie Iles

author
#0 lore raw

v3 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.

This patch series is based off of RMK's devel branch to get the CLKDEV_LOOKUP changes and also requires the following patches:

- 8250: add a UPIO_DWAPB32 for 32 bit accesses (v2):
http://marc.info/?l=linux-serial&m=129043658715199&w=2
- debug-8250: add a 32 bit mode:
http://marc.info/?l=linux-arm-kernel&m=129044061221371&w=2

This series is sent as v3 as I sent some individual follow up patches as v2. I'll repost as a whole series for subsequent reviews. I've taken on board Russell's comments and added support for the onchip SRAM (based on the DaVinci SRAM allocator). Individual changelogs are in the patches themselves.

Jamie Iles (14):
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 onchip SRAM
picoxcell: add support for the PC7302 development board

 arch/arm/Kconfig                                   |   17 +
 arch/arm/Makefile                                  |    1 +
 arch/arm/configs/picoxcell_defconfig               |  103 ++
 arch/arm/mach-picoxcell/Kconfig                    |   47 +
 arch/arm/mach-picoxcell/Makefile                   |   12 +
 arch/arm/mach-picoxcell/Makefile.boot              |    3 +
 arch/arm/mach-picoxcell/axi2cfg.c                  |  167 +++
 arch/arm/mach-picoxcell/board_pc7302.c             |  206 +++
 arch/arm/mach-picoxcell/clk.c                      |  134 ++
 arch/arm/mach-picoxcell/cpufreq.c                  |  145 +++
 arch/arm/mach-picoxcell/devices.c                  |  118 ++
 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        |  189 +++
 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/sram.h        |   28 +
 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                       |   57 +
 arch/arm/mach-picoxcell/mux.c                      |  402 ++++++
 arch/arm/mach-picoxcell/mux.h                      |  110 ++
 arch/arm/mach-picoxcell/pc3x2.c                    |  437 +++++++
 arch/arm/mach-picoxcell/pc3x3.c                    | 1336 ++++++++++++++++++++
 arch/arm/mach-picoxcell/picoxcell_core.c           |  343 +++++
 arch/arm/mach-picoxcell/picoxcell_core.h           |   42 +
 arch/arm/mach-picoxcell/pm.c                       |  146 +++
 arch/arm/mach-picoxcell/soc.h                      |   61 +
 arch/arm/mach-picoxcell/sram.c                     |   66 +
 arch/arm/mach-picoxcell/time.c                     |  255 ++++
 42 files changed, 5969 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/configs/picoxcell_defconfig
 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/sram.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/sram.c
 create mode 100644 arch/arm/mach-picoxcell/time.c
Signature · 1 line
1.7.2.3
author
#1 lore raw

PATCH v3 1/14 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.

1. http://www.picochip.com

---
 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                  |  167 +++++++++++++++++++
 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                       |   57 +++++++
 arch/arm/mach-picoxcell/picoxcell_core.c           |  174 ++++++++++++++++++++
 arch/arm/mach-picoxcell/picoxcell_core.h           |   21 +++
 arch/arm/mach-picoxcell/soc.h                      |   59 +++++++
 26 files changed, 1264 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
index e77fe0f..85f9c97 100644
@@ -586,6 +586,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 GENERIC_GPIO
+	select ARCH_REQUIRE_GPIOLIB
+	select CLKDEV_LOOKUP
+	select TICK_ONESHOT
+	select CPU_V6
+	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
@@ -926,6 +940,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
index b87aed0..b47baa8 100644
@@ -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
new file mode 100644
index 0000000..3daba53
@@ -0,0 +1,4 @@
+menu "PICOXCELL platform type"
+	depends on ARCH_PICOXCELL
+
+endmenu
arch/arm/mach-picoxcell/Makefile new file +1 -0
new file mode 100644
index 0000000..6afe388
@@ -0,0 +1 @@
+obj-y				:= picoxcell_core.o io.o axi2cfg.o
arch/arm/mach-picoxcell/Makefile.boot new file +3 -0
new file mode 100644
index 0000000..67039c3
@@ -0,0 +1,3 @@
+   zreladdr-y	:= 0x00008000
+params_phys-y	:= 0x00000100
+initrd_phys-y	:= 0x00800000
arch/arm/mach-picoxcell/axi2cfg.c new file +167 -0

167 lines not on this page · raw message

arch/arm/mach-picoxcell/include/mach/debug-macro.S new file +18 -0
new file mode 100644
index 0000000..5cbab63
@@ -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
new file mode 100644
index 0000000..4dcda96
@@ -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
new file mode 100644
index 0000000..7c203d3
@@ -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
new file mode 100644
index 0000000..cb11040
@@ -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
new file mode 100644
index 0000000..47b8ba1
@@ -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 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
new file mode 100644
index 0000000..8d67c42
@@ -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
new file mode 100644
index 0000000..97697c0
@@ -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
new file mode 100644
index 0000000..bf0fee6
@@ -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
new file mode 100644
index 0000000..09a7f75
@@ -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 +57 -0

57 lines not on this page · raw message

arch/arm/mach-picoxcell/picoxcell_core.c new file +174 -0

174 lines not on this page · raw message

arch/arm/mach-picoxcell/picoxcell_core.h new file +21 -0
new file mode 100644
index 0000000..5b27e52
@@ -0,0 +1,21 @@
+/*
+ * 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 __init picoxcell_core_init(void);
+extern void __init picoxcell_init_irq(void);
+extern void __init picoxcell_map_io(void);
+
+#endif /* __ASM_ARCH_PICOXCELL_CORE_H__ */
arch/arm/mach-picoxcell/soc.h new file +59 -0

59 lines not on this page · raw message

Signature · 1 line
1.7.2.3
author
#2 lore raw

PATCH v3 2/14 picoxcell: add support for AXI bus snoopers

In reply to Jamie Iles

The 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
index e2c996a..9ce3ebd 100644
@@ -153,6 +153,91 @@ static void __init 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 __init 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_core_init(void)
 {
 	struct picoxcell_soc *soc = picoxcell_get_soc();
@@ -171,4 +256,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.2.3
author
#3 lore raw

PATCH v3 3/14 picoxcell: add support for the system timers

In reply to Jamie Iles

The 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.

---
 arch/arm/mach-picoxcell/Makefile         |    3 +-
 arch/arm/mach-picoxcell/picoxcell_core.h |    2 +
 arch/arm/mach-picoxcell/time.c           |  255 ++++++++++++++++++++++++++++++
 3 files changed, 259 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-picoxcell/time.c
arch/arm/mach-picoxcell/Makefile +2 -1
index 6afe388..493ec0e 100644
@@ -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.h +2 -0
index 5b27e52..941d1a6 100644
@@ -13,9 +13,11 @@
 #define __ASM_ARCH_PICOXCELL_CORE_H__
 
 struct picoxcell_soc;
+struct sys_timer;
 
 extern void __init picoxcell_core_init(void);
 extern void __init picoxcell_init_irq(void);
 extern void __init picoxcell_map_io(void);
+extern struct sys_timer picoxcell_sys_timer;
 
 #endif /* __ASM_ARCH_PICOXCELL_CORE_H__ */
arch/arm/mach-picoxcell/time.c new file +255 -0

255 lines not on this page · raw message

Signature · 1 line
1.7.2.3
author
#4 lore raw

PATCH v3 4/14 picoxcell: add a pin muxing infrastructure

In reply to Jamie Iles

picoXcell 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
index 493ec0e..77801b2 100644
@@ -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
index 9ce3ebd..12107d5 100644
@@ -257,6 +257,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.2.3
author
#5 lore raw

PATCH v3 5/14 picoxcell: add gpio infrastructure

In reply to Jamie Iles

Add 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 |  187 +++++++
 arch/arm/mach-picoxcell/picoxcell_core.c    |    5 +
 4 files changed, 906 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
index 77801b2..29b52e8 100644
@@ -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 +187 -0

187 lines not on this page · raw message

arch/arm/mach-picoxcell/picoxcell_core.c +5 -0
index 12107d5..a8f6056 100644
@@ -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>
@@ -260,6 +261,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.2.3
author
#6 lore raw

PATCH v3 6/14 picoxcell: add support for system clks

In reply to Jamie Iles

The 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      |    4 +
 4 files changed, 211 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
index 29b52e8..71a6523 100644
@@ -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 +4 -0
index a8f6056..c261500 100644
@@ -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 __init picoxcell_debugfs_init(void)
 		arch_debugfs_dir = NULL;
 		return;
 	}
+	picoxcell_clk_debugfs_init();
 }
 
 /*
@@ -258,6 +260,8 @@ void __init picoxcell_core_init(void)
 	/* Add the arch debugfs entry. */
 	picoxcell_debugfs_init();
 
+	soc->init_clocks();
+
 	/* Initialise the pin muxing and gpio infrastructure. */
 	picoxcell_muxing_init(soc);
 
Signature · 1 line
1.7.2.3
author
#7 lore raw

PATCH v3 7/14 picoxcell: add common SoC devices

In reply to Jamie Iles

Add 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.

v2:

	- split the UARTs into two separate platform devices and use
	  PLAT8250_* as the IDs

v3:
- mark common_devices with __initdata

---
 arch/arm/mach-picoxcell/Makefile              |    3 +-
 arch/arm/mach-picoxcell/devices.c             |  118 +++++++++++++++++++++++++
 arch/arm/mach-picoxcell/include/mach/clkdev.h |    2 +-
 arch/arm/mach-picoxcell/picoxcell_core.c      |    3 +
 arch/arm/mach-picoxcell/picoxcell_core.h      |    1 +
 5 files changed, 125 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-picoxcell/devices.c
arch/arm/mach-picoxcell/Makefile +2 -1
index 71a6523..f71a33e 100644
@@ -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 +118 -0

118 lines not on this page · raw message

arch/arm/mach-picoxcell/include/mach/clkdev.h +1 -1
index 437f7e8..2001ff0 100644
@@ -10,7 +10,7 @@
 #ifndef __PICOXCELL_CLKDEV_H__
 #define __PICOXCELL_CLKDEV_H__
 
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 struct clk {
 	const char	    *name;
arch/arm/mach-picoxcell/picoxcell_core.c +3 -0
index c261500..a912cfe 100644
@@ -271,4 +271,7 @@ void __init picoxcell_core_init(void)
 
 	/* Add handlers for the AXI bus snooping. */
 	picoxcell_axi_bus_error_init();
+
+	/* Register the devices. */
+	picoxcell_add_devices();
 }
arch/arm/mach-picoxcell/picoxcell_core.h +1 -0
index 941d1a6..9647b7a 100644
@@ -19,5 +19,6 @@ extern void __init picoxcell_core_init(void);
 extern void __init picoxcell_init_irq(void);
 extern void __init picoxcell_map_io(void);
 extern struct sys_timer picoxcell_sys_timer;
+extern void __init picoxcell_add_devices(void);
 
 #endif /* __ASM_ARCH_PICOXCELL_CORE_H__ */
Signature · 1 line
1.7.2.3
author
#8 lore raw

PATCH v3 8/14 picoxcell: add cpufreq support

In reply to Jamie Iles

PC3X3 devices have a PLL to control the ARM core speed. Add a cpufreq driver so that we can run at optimum speed and power.

---
 arch/arm/mach-picoxcell/Makefile         |    1 +
 arch/arm/mach-picoxcell/cpufreq.c        |  145 ++++++++++++++++++++++++++++++
 arch/arm/mach-picoxcell/picoxcell_core.c |    3 +
 arch/arm/mach-picoxcell/picoxcell_core.h |    9 ++
 4 files changed, 158 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-picoxcell/cpufreq.c
arch/arm/mach-picoxcell/Makefile +1 -0
index f71a33e..c0bbb25 100644
@@ -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 +145 -0

145 lines not on this page · raw message

arch/arm/mach-picoxcell/picoxcell_core.c +3 -0
index a912cfe..60bc878 100644
@@ -274,4 +274,7 @@ void __init picoxcell_core_init(void)
 
 	/* Register the devices. */
 	picoxcell_add_devices();
+
+	if (picoxcell_has_feature(PICOXCELL_FEATURE_CPUFREQ))
+		WARN_ON(picoxcell_cpufreq_init());
 }
arch/arm/mach-picoxcell/picoxcell_core.h +9 -0
index 9647b7a..f6d90bf 100644
@@ -21,4 +21,13 @@ extern void __init picoxcell_map_io(void);
 extern struct sys_timer picoxcell_sys_timer;
 extern void __init picoxcell_add_devices(void);
 
+# ifdef CONFIG_CPU_FREQ
+extern int __init picoxcell_cpufreq_init(void);
+# else /* CONFIG_CPU_FREQ */
+static inline int picoxcell_cpufreq_init(void)
+{
+	return 0;
+}
+# endif /* CONFIG_CPU_FREQ */
+
 #endif /* __ASM_ARCH_PICOXCELL_CORE_H__ */
Signature · 1 line
1.7.2.3
author
#9 lore raw

PATCH v3 9/14 picoxcell: add support for pm

In reply to Jamie Iles

PC3X3 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.

---
 arch/arm/mach-picoxcell/Makefile         |    1 +
 arch/arm/mach-picoxcell/picoxcell_core.c |    2 +
 arch/arm/mach-picoxcell/picoxcell_core.h |    9 ++
 arch/arm/mach-picoxcell/pm.c             |  146 ++++++++++++++++++++++++++++++
 4 files changed, 158 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-picoxcell/pm.c
arch/arm/mach-picoxcell/Makefile +1 -0
index c0bbb25..f122a84 100644
@@ -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/picoxcell_core.c +2 -0
index 60bc878..7f6f3fd 100644
@@ -277,4 +277,6 @@ void __init picoxcell_core_init(void)
 
 	if (picoxcell_has_feature(PICOXCELL_FEATURE_CPUFREQ))
 		WARN_ON(picoxcell_cpufreq_init());
+	if (picoxcell_has_feature(PICOXCELL_FEATURE_PM))
+		WARN_ON(picoxcell_pm_init());
 }
arch/arm/mach-picoxcell/picoxcell_core.h +9 -0
index f6d90bf..3a673cf 100644
@@ -30,4 +30,13 @@ static inline int picoxcell_cpufreq_init(void)
 }
 # endif /* CONFIG_CPU_FREQ */
 
+# ifdef CONFIG_PM
+extern int __init picoxcell_pm_init(void);
+# else /* CONFIG_PM */
+static inline int picoxcell_pm_init(void)
+{
+	return 0;
+}
+# endif /* CONFIG_PM */
+
 #endif /* __ASM_ARCH_PICOXCELL_CORE_H__ */
arch/arm/mach-picoxcell/pm.c new file +146 -0

146 lines not on this page · raw message

Signature · 1 line
1.7.2.3
author
#10 lore raw

PATCH v3 10/14 picoxcell: add chained GPIO IRQ handlers

In reply to Jamie Iles

The 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
index ce55c3d..8955e20 100644
@@ -152,6 +152,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
index 7f6f3fd..26e62c1 100644
@@ -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.2.3
author
#11 lore raw

PATCH v3 11/14 picoxcell: add support for pc3x2 devices

In reply to Jamie Iles

PC3X2 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          |  437 ++++++++++++++++++++++++++++++
 arch/arm/mach-picoxcell/picoxcell_core.c |   13 +-
 arch/arm/mach-picoxcell/soc.h            |    1 +
 5 files changed, 458 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-picoxcell/pc3x2.c
arch/arm/mach-picoxcell/Kconfig +7 -0
index 3daba53..5141202 100644
@@ -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
index f122a84..bc2dc75 100644
@@ -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 +437 -0

437 lines not on this page · raw message

arch/arm/mach-picoxcell/picoxcell_core.c +12 -1
index 26e62c1..fd4cc26 100644
@@ -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
index d24a0ce..fccd278 100644
@@ -48,6 +48,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.2.3
author
#12 lore raw

PATCH v3 12/14 picoxcell: add support for pc3x3 devices

In reply to Jamie Iles

PC3X3 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          | 1336 ++++++++++++++++++++++++++++++
 arch/arm/mach-picoxcell/picoxcell_core.c |   11 +
 arch/arm/mach-picoxcell/soc.h            |    1 +
 5 files changed, 1367 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-picoxcell/pc3x3.c
arch/arm/mach-picoxcell/Kconfig +18 -0
index 5141202..671cadc 100644
@@ -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
index bc2dc75..7ed0d7c 100644
@@ -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 +1336 -0

1,336 lines not on this page · raw message

arch/arm/mach-picoxcell/picoxcell_core.c +11 -0
index fd4cc26..2cfefd4 100644
@@ -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
index fccd278..4b4d92f 100644
@@ -49,6 +49,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.2.3
author
#13 lore raw

PATCH v3 13/14 picoxcell: add support for the onchip SRAM

In reply to Jamie Iles

The onchip SRAM is a 128KB SRAM that is shared with the picoArray DSP array. Use a generic allocator based on the mach-davinci SRAM allocator to provide allocations from this SRAM.

---
 arch/arm/Kconfig                            |    1 +
 arch/arm/mach-picoxcell/Kconfig             |    9 ++++
 arch/arm/mach-picoxcell/Makefile            |    1 +
 arch/arm/mach-picoxcell/include/mach/sram.h |   28 +++++++++++
 arch/arm/mach-picoxcell/sram.c              |   66 +++++++++++++++++++++++++++
 5 files changed, 105 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-picoxcell/include/mach/sram.h
 create mode 100644 arch/arm/mach-picoxcell/sram.c
arch/arm/Kconfig +1 -0
index 85f9c97..c803b28 100644
@@ -596,6 +596,7 @@ config ARCH_PICOXCELL
 	select TICK_ONESHOT
 	select CPU_V6
 	select HAVE_TCM
+	select GENERIC_ALLOCATOR
 	help
 	  This enables support for systems based on the Picochip picoXcell
 	  family of Femtocell devices.
arch/arm/mach-picoxcell/Kconfig +9 -0
index 671cadc..a0b197c 100644
@@ -26,4 +26,13 @@ config PC3X3_STOP_WDT_IN_SUSPEND
 	  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.
 
+config PICOXCELL_SRAM
+	bool "Support SRAM in Linux"
+	default y
+	help
+	  Say yes here to add support for allocations from the onchip SRAM.
+	  This SRAM is low latency and is 128KB in size. The SRAM is also
+	  accessible by the picoArray so care needs to be taken when using this
+	  in combination with picoArray firmware that utilizes the SRAM.
+
 endmenu
arch/arm/mach-picoxcell/Makefile +1 -0
index 7ed0d7c..6f2a5b8 100644
@@ -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_PICOXCELL_SRAM)	+= sram.o
arch/arm/mach-picoxcell/include/mach/sram.h new file +28 -0
new file mode 100644
index 0000000..4cd1a71
@@ -0,0 +1,28 @@
+/*
+ * mach/sram.h - picoxcell simple SRAM allocator
+ *
+ * Adapted from the DaVinci SRAM allocator by David Brownell. picoXcell always
+ * has 128KB of SRAM at the same address so the allocator is a bit simpler
+ * than for DaVinci.
+ *
+ * Copyright (C) 2010 Jamie Iles
+ * Copyright (C) 2009 David Brownell
+ *
+ * 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.
+ */
+#ifndef __PICOXCELL_SRAM_H__
+#define __PICOXCELL_SRAM_H__
+
+/*
+ * Granularity of SRAM allocations. With 128KB, 512 bytes seems like a
+ * reasonable granularity.
+ */
+#define SRAM_GRANULARITY		512
+
+void *sram_alloc(size_t len, dma_addr_t *dma);
+void sram_free(void *addr, size_t len);
+
+#endif /* __PICOXCELL_SRAM_H__ */
arch/arm/mach-picoxcell/sram.c new file +66 -0

66 lines not on this page · raw message

Signature · 1 line
1.7.2.3
author
#14 lore raw

PATCH v3 14/14 picoxcell: add support for the PC7302 development board

In reply to Jamie Iles

The 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.

v2:
- multiplex the NAND CLE pin by pad name.
- convert to __raw_ io accessors.

---
 arch/arm/configs/picoxcell_defconfig   |  103 ++++++++++++++++
 arch/arm/mach-picoxcell/Kconfig        |    9 ++
 arch/arm/mach-picoxcell/Makefile       |    1 +
 arch/arm/mach-picoxcell/board_pc7302.c |  206 ++++++++++++++++++++++++++++++++
 4 files changed, 319 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/configs/picoxcell_defconfig
 create mode 100644 arch/arm/mach-picoxcell/board_pc7302.c
arch/arm/configs/picoxcell_defconfig new file +103 -0
new file mode 100644
index 0000000..b10c669
@@ -0,0 +1,103 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_RELAY=y
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=y
+CONFIG_KPROBES=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_PICOXCELL=y
+CONFIG_CPU_32v6K=y
+CONFIG_ARM_ERRATA_411920=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+CONFIG_UACCESS_WITH_MEMCPY=y
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_FPE_NWFPE=y
+CONFIG_PM=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_IPV6 is not set
+# CONFIG_WIRELESS is not set
+CONFIG_UEVENT_HELPER_PATH="/sbin/mdev"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_GPIO=y
+CONFIG_MTD_UBI=y
+# CONFIG_BLK_DEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_HW_RANDOM is not set
+CONFIG_GPIO_SYSFS=y
+# CONFIG_HWMON is not set
+# CONFIG_MFD_SUPPORT is not set
+# CONFIG_HID_SUPPORT is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_DNOTIFY is not set
+CONFIG_TMPFS=y
+CONFIG_CONFIGFS_FS=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_UBIFS_FS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_ROOT_NFS=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_STRIP_ASM_SYMS=y
+CONFIG_DEBUG_FS=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_BKL is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_FTRACE is not set
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_ERRORS=y
+CONFIG_DEBUG_LL=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_CRYPTO_MANAGER=y
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+CONFIG_CRC_CCITT=y
+CONFIG_LIBCRC32C=y
arch/arm/mach-picoxcell/Kconfig +9 -0
index a0b197c..8b38410 100644
@@ -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
index 6f2a5b8..06f5f78 100644
@@ -9,3 +9,4 @@ obj-$(CONFIG_PM)		+= pm.o
 obj-$(CONFIG_PICOXCELL_PC3X2)	+= pc3x2.o
 obj-$(CONFIG_PICOXCELL_PC3X3)	+= pc3x3.o
 obj-$(CONFIG_PICOXCELL_SRAM)	+= sram.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.2.3