-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
picoxcell: support for Picochip picoxcell devices
picoXcell is a family of femtocell devices with an ARM application processor and picoArray DSP processor array. This patch adds support for picoXcell boards to be booted using the device tree registering the VIC's, UART's and timers. v3: - fixup vic compatible string in binding v2: - cleanup empty mach headers - convert to of_platform_populate() - simplify uncompress.h - split vic node into 2 devices - add missing __initconst attributes Signed-off-by: Jamie Iles <jamie@jamieiles.com>
- Loading branch information
Jamie Iles
committed
Sep 26, 2011
1 parent
c6a389f
commit af75655
Showing
22 changed files
with
584 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Picochip picoXcell device tree bindings. | ||
======================================== | ||
|
||
Required root node properties: | ||
- compatible: | ||
- "picochip,pc7302-pc3x3" : PC7302 development board with PC3X3 device. | ||
- "picochip,pc7302-pc3x2" : PC7302 development board with PC3X2 device. | ||
- "picochip,pc3x3" : picoXcell PC3X3 device based board. | ||
- "picochip,pc3x2" : picoXcell PC3X2 device based board. | ||
|
||
Timers required properties: | ||
- compatible = "picochip,pc3x2-timer" | ||
- interrupts : The single IRQ line for the timer. | ||
- clock-freq : The frequency in HZ of the timer. | ||
- reg : The register bank for the timer. | ||
|
||
Note: two timers are required - one for the scheduler clock and one for the | ||
event tick/NOHZ. | ||
|
||
VIC required properties: | ||
- compatible = "arm,pl192-vic". | ||
- interrupt-controller. | ||
- reg : The register bank for the device. | ||
- #interrupt-cells : Must be 1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
obj-y := common.o | ||
obj-y += time.o | ||
obj-y += io.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
zreladdr-y := 0x00008000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2011 Picochip Ltd., Jamie Iles | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* All enquiries to support@picochip.com | ||
*/ | ||
#include <linux/irq.h> | ||
#include <linux/irqdomain.h> | ||
#include <linux/of.h> | ||
#include <linux/of_address.h> | ||
#include <linux/of_platform.h> | ||
|
||
#include <asm/mach/arch.h> | ||
#include <asm/hardware/vic.h> | ||
|
||
#include <mach/map.h> | ||
#include <mach/picoxcell_soc.h> | ||
|
||
#include "common.h" | ||
|
||
static void __init picoxcell_init_machine(void) | ||
{ | ||
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
} | ||
|
||
static const char *picoxcell_dt_match[] = { | ||
"picochip,pc3x2", | ||
"picochip,pc3x3", | ||
NULL | ||
}; | ||
|
||
static const struct of_device_id vic_of_match[] __initconst = { | ||
{ .compatible = "arm,pl192-vic" }, | ||
{ /* Sentinel */ } | ||
}; | ||
|
||
static void __init picoxcell_init_irq(void) | ||
{ | ||
vic_init(IO_ADDRESS(PICOXCELL_VIC0_BASE), 0, ~0, 0); | ||
vic_init(IO_ADDRESS(PICOXCELL_VIC1_BASE), 32, ~0, 0); | ||
irq_domain_generate_simple(vic_of_match, PICOXCELL_VIC0_BASE, 0); | ||
irq_domain_generate_simple(vic_of_match, PICOXCELL_VIC1_BASE, 32); | ||
} | ||
|
||
DT_MACHINE_START(PICOXCELL, "Picochip picoXcell") | ||
.map_io = picoxcell_map_io, | ||
.nr_irqs = ARCH_NR_IRQS, | ||
.init_irq = picoxcell_init_irq, | ||
.timer = &picoxcell_timer, | ||
.init_machine = picoxcell_init_machine, | ||
.dt_compat = picoxcell_dt_match, | ||
MACHINE_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) 2011 Picochip Ltd., Jamie Iles | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* All enquiries to support@picochip.com | ||
*/ | ||
#ifndef __PICOXCELL_COMMON_H__ | ||
#define __PICOXCELL_COMMON_H__ | ||
|
||
#include <asm/mach/time.h> | ||
|
||
extern struct sys_timer picoxcell_timer; | ||
extern void picoxcell_map_io(void); | ||
|
||
#endif /* __PICOXCELL_COMMON_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2011 Picochip Ltd., Jamie Iles | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* Derived from arch/arm/mach-davinci/include/mach/debug-macro.S to use 32-bit | ||
* accesses to the 8250. | ||
*/ | ||
#include <linux/serial_reg.h> | ||
#include <mach/hardware.h> | ||
#include <mach/map.h> | ||
|
||
#define UART_SHIFT 2 | ||
|
||
.macro addruart, rp, rv | ||
ldr \rv, =PHYS_TO_IO(PICOXCELL_UART1_BASE) | ||
ldr \rp, =PICOXCELL_UART1_BASE | ||
.endm | ||
|
||
.macro senduart,rd,rx | ||
str \rd, [\rx, #UART_TX << UART_SHIFT] | ||
.endm | ||
|
||
.macro busyuart,rd,rx | ||
1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT] | ||
and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE | ||
teq \rd, #UART_LSR_TEMT | UART_LSR_THRE | ||
bne 1002b | ||
.endm | ||
|
||
/* The UART's don't have any flow control IO's wired up. */ | ||
.macro waituart,rd,rx | ||
.endm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* entry-macro.S | ||
* | ||
* Copyright (c) 2011 Picochip Ltd., Jamie Iles | ||
* | ||
* Low-level IRQ helper macros for picoXcell platforms | ||
* | ||
* This file is licensed under the terms of the GNU General Public | ||
* License version 2. This program is licensed "as is" without any | ||
* warranty of any kind, whether express or implied. | ||
*/ | ||
#include <mach/hardware.h> | ||
#include <mach/irqs.h> | ||
#include <mach/map.h> | ||
|
||
#define VA_VIC0 IO_ADDRESS(PICOXCELL_VIC0_BASE) | ||
#define VA_VIC1 IO_ADDRESS(PICOXCELL_VIC1_BASE) | ||
|
||
#include <asm/entry-macro-vic2.S> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* empty */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright (c) 2011 Picochip Ltd., Jamie Iles | ||
* | ||
* This file contains the hardware definitions of the picoXcell SoC devices. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
#ifndef __ASM_ARCH_HARDWARE_H | ||
#define __ASM_ARCH_HARDWARE_H | ||
|
||
#include <mach/picoxcell_soc.h> | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (c) 2011 Picochip Ltd., Jamie Iles | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
#ifndef __ASM_ARM_ARCH_IO_H | ||
#define __ASM_ARM_ARCH_IO_H | ||
|
||
/* No ioports, but needed for driver compatibility. */ | ||
#define __io(a) __typesafe_io(a) | ||
/* No PCI possible on picoxcell. */ | ||
#define __mem_pci(a) (a) | ||
|
||
#define __arch_ioremap picoxcell_ioremap | ||
#define __arch_iounmap picoxcell_iounmap | ||
|
||
extern void __iomem *picoxcell_ioremap(unsigned long phys, size_t size, | ||
unsigned int type); | ||
extern void picoxcell_iounmap(volatile void __iomem *addr); | ||
|
||
#endif /* __ASM_ARM_ARCH_IO_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2011 Picochip Ltd., Jamie Iles | ||
* | ||
* This file contains the hardware definitions of the picoXcell SoC devices. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
#ifndef __MACH_IRQS_H | ||
#define __MACH_IRQS_H | ||
|
||
#define ARCH_NR_IRQS 64 | ||
#define NR_IRQS (128 + ARCH_NR_IRQS) | ||
|
||
#define IRQ_VIC0_BASE 0 | ||
#define IRQ_VIC1_BASE 32 | ||
|
||
#endif /* __MACH_IRQS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2011 Picochip Ltd., Jamie Iles | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
#ifndef __PICOXCELL_MAP_H__ | ||
#define __PICOXCELL_MAP_H__ | ||
|
||
#define PHYS_TO_IO(x) (((x) & 0x00ffffff) | 0xfe000000) | ||
|
||
#ifdef __ASSEMBLY__ | ||
#define IO_ADDRESS(x) PHYS_TO_IO((x)) | ||
#else | ||
#define IO_ADDRESS(x) (void __iomem __force *)(PHYS_TO_IO((x))) | ||
#endif | ||
|
||
#endif /* __PICOXCELL_MAP_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* empty */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2011 Picochip Ltd., Jamie Iles | ||
* | ||
* This file contains the hardware definitions of the picoXcell SoC devices. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
#ifndef __PICOXCELL_SOC_H__ | ||
#define __PICOXCELL_SOC_H__ | ||
|
||
#define PICOXCELL_UART1_BASE 0x80230000 | ||
#define PICOXCELL_PERIPH_BASE 0x80000000 | ||
#define PICOXCELL_PERIPH_LENGTH SZ_4M | ||
#define PICOXCELL_VIC0_BASE 0x80060000 | ||
#define PICOXCELL_VIC1_BASE 0x80064000 | ||
|
||
#endif /* __PICOXCELL_SOC_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) 2011 Picochip Ltd., Jamie Iles | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
#ifndef __ASM_ARCH_SYSTEM_H | ||
#define __ASM_ARCH_SYSTEM_H | ||
|
||
static inline void arch_idle(void) | ||
{ | ||
/* | ||
* This should do all the clock switching and wait for interrupt | ||
* tricks. | ||
*/ | ||
cpu_do_idle(); | ||
} | ||
|
||
static inline void arch_reset(int mode, const char *cmd) | ||
{ | ||
/* Watchdog reset to go here. */ | ||
} | ||
|
||
#endif /* __ASM_ARCH_SYSTEM_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2011 Picochip Ltd., Jamie Iles | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
#ifndef __TIMEX_H__ | ||
#define __TIMEX_H__ | ||
|
||
/* Bogus value to allow the kernel to compile. */ | ||
#define CLOCK_TICK_RATE 1000000 | ||
|
||
#endif /* __TIMEX_H__ */ | ||
|
Oops, something went wrong.