forked from torvalds/linux
-
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.
[ARM] pxa: add base support for Marvell's PXA168 processor line
"""The Marvell® PXA168 processor is the first in a family of application processors targeted at mass market opportunities in computing and consumer devices. It balances high computing and multimedia performance with low power consumption to support extended battery life, and includes a wealth of integrated peripherals to reduce overall BOM cost .... """ See http://www.marvell.com/featured/pxa168.jsp for more information. 1. Marvell Mohawk core is a hybrid of xscale3 and its own ARM core, there are many enhancements like instructions for flushing the whole D-cache, and so on 2. Clock reuses Russell's common clkdev, and added the basic support for UART1/2. 3. Devices are a bit different from the 'mach-pxa' way, the platform devices are now dynamically allocated only when necessary (i.e. when pxa_register_device() is called). Description for each device are stored in an array of 'struct pxa_device_desc'. Now that: a. this array of device description is marked with __initdata and can be freed up system is fully up b. which means board code has to add all needed devices early in his initializing function c. platform specific data can now be marked as __initdata since they are allocated and copied by platform_device_add_data() 4. only the basic UART1/2/3 are added, more devices will come later. Signed-off-by: Jason Chagas <[email protected]> Signed-off-by: Eric Miao <[email protected]>
- Loading branch information
Eric Miao
committed
Mar 23, 2009
1 parent
f8dec04
commit 49cbe78
Showing
40 changed files
with
1,669 additions
and
2 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
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
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,27 @@ | ||
if ARCH_MMP | ||
|
||
menu "Marvell PXA168 Implmentations" | ||
|
||
config MACH_ASPENITE | ||
bool "Marvell's PXA168 Aspenite Development Board" | ||
select CPU_PXA168 | ||
help | ||
Say 'Y' here if you want to support the Marvell PXA168-based | ||
Aspenite Development Board. | ||
|
||
config MACH_ZYLONITE2 | ||
bool "Marvell's PXA168 Zylonite2 Development Board" | ||
select CPU_PXA168 | ||
help | ||
Say 'Y' here if you want to support the Marvell PXA168-based | ||
Zylonite2 Development Board. | ||
|
||
endmenu | ||
|
||
config CPU_PXA168 | ||
bool | ||
select CPU_MOHAWK | ||
help | ||
Select code specific to PXA168 | ||
|
||
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,12 @@ | ||
# | ||
# Makefile for Marvell's PXA168 processors line | ||
# | ||
|
||
obj-y += common.o clock.o devices.o irq.o time.o | ||
|
||
# SoC support | ||
obj-$(CONFIG_CPU_PXA168) += pxa168.o | ||
|
||
# board support | ||
obj-$(CONFIG_MACH_ASPENITE) += aspenite.o | ||
obj-$(CONFIG_MACH_ZYLONITE2) += aspenite.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,42 @@ | ||
/* | ||
* linux/arch/arm/mach-mmp/aspenite.c | ||
* | ||
* Support for the Marvell PXA168-based Aspenite and Zylonite2 | ||
* Development Platform. | ||
* | ||
* 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 | ||
* publishhed by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/init.h> | ||
|
||
#include <asm/mach-types.h> | ||
#include <asm/mach/arch.h> | ||
#include <mach/addr-map.h> | ||
|
||
#include "common.h" | ||
|
||
static void __init common_init(void) | ||
{ | ||
} | ||
|
||
MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform") | ||
.phys_io = APB_PHYS_BASE, | ||
.boot_params = 0x00000100, | ||
.io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, | ||
.map_io = pxa_map_io, | ||
.init_irq = pxa168_init_irq, | ||
.timer = &pxa168_timer, | ||
.init_machine = common_init, | ||
MACHINE_END | ||
|
||
MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform") | ||
.phys_io = APB_PHYS_BASE, | ||
.boot_params = 0x00000100, | ||
.io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, | ||
.map_io = pxa_map_io, | ||
.init_irq = pxa168_init_irq, | ||
.timer = &pxa168_timer, | ||
.init_machine = common_init, | ||
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,83 @@ | ||
/* | ||
* linux/arch/arm/mach-mmp/clock.c | ||
* | ||
* 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. | ||
*/ | ||
|
||
#include <linux/module.h> | ||
#include <linux/kernel.h> | ||
#include <linux/list.h> | ||
#include <linux/spinlock.h> | ||
#include <linux/clk.h> | ||
#include <linux/io.h> | ||
|
||
#include <mach/regs-apbc.h> | ||
#include "clock.h" | ||
|
||
static void apbc_clk_enable(struct clk *clk) | ||
{ | ||
uint32_t clk_rst; | ||
|
||
clk_rst = APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(clk->fnclksel); | ||
__raw_writel(clk_rst, clk->clk_rst); | ||
} | ||
|
||
static void apbc_clk_disable(struct clk *clk) | ||
{ | ||
__raw_writel(0, clk->clk_rst); | ||
} | ||
|
||
struct clkops apbc_clk_ops = { | ||
.enable = apbc_clk_enable, | ||
.disable = apbc_clk_disable, | ||
}; | ||
|
||
static DEFINE_SPINLOCK(clocks_lock); | ||
|
||
int clk_enable(struct clk *clk) | ||
{ | ||
unsigned long flags; | ||
|
||
spin_lock_irqsave(&clocks_lock, flags); | ||
if (clk->enabled++ == 0) | ||
clk->ops->enable(clk); | ||
spin_unlock_irqrestore(&clocks_lock, flags); | ||
return 0; | ||
} | ||
EXPORT_SYMBOL(clk_enable); | ||
|
||
void clk_disable(struct clk *clk) | ||
{ | ||
unsigned long flags; | ||
|
||
WARN_ON(clk->enabled == 0); | ||
|
||
spin_lock_irqsave(&clocks_lock, flags); | ||
if (--clk->enabled == 0) | ||
clk->ops->disable(clk); | ||
spin_unlock_irqrestore(&clocks_lock, flags); | ||
} | ||
EXPORT_SYMBOL(clk_disable); | ||
|
||
unsigned long clk_get_rate(struct clk *clk) | ||
{ | ||
unsigned long rate; | ||
|
||
if (clk->ops->getrate) | ||
rate = clk->ops->getrate(clk); | ||
else | ||
rate = clk->rate; | ||
|
||
return rate; | ||
} | ||
EXPORT_SYMBOL(clk_get_rate); | ||
|
||
void clks_register(struct clk_lookup *clks, size_t num) | ||
{ | ||
int i; | ||
|
||
for (i = 0; i < num; i++) | ||
clkdev_add(&clks[i]); | ||
} |
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,71 @@ | ||
/* | ||
* linux/arch/arm/mach-mmp/clock.h | ||
* | ||
* 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. | ||
*/ | ||
|
||
#include <asm/clkdev.h> | ||
|
||
struct clkops { | ||
void (*enable)(struct clk *); | ||
void (*disable)(struct clk *); | ||
unsigned long (*getrate)(struct clk *); | ||
}; | ||
|
||
struct clk { | ||
const struct clkops *ops; | ||
|
||
void __iomem *clk_rst; /* clock reset control register */ | ||
int fnclksel; /* functional clock select (APBC) */ | ||
uint32_t enable_val; /* value for clock enable (APMU) */ | ||
unsigned long rate; | ||
int enabled; | ||
}; | ||
|
||
extern struct clkops apbc_clk_ops; | ||
|
||
#define APBC_CLK(_name, _reg, _fnclksel, _rate) \ | ||
struct clk clk_##_name = { \ | ||
.clk_rst = (void __iomem *)APBC_##_reg, \ | ||
.fnclksel = _fnclksel, \ | ||
.rate = _rate, \ | ||
.ops = &apbc_clk_ops, \ | ||
} | ||
|
||
#define APBC_CLK_OPS(_name, _reg, _fnclksel, _rate, _ops) \ | ||
struct clk clk_##_name = { \ | ||
.clk_rst = (void __iomem *)APBC_##_reg, \ | ||
.fnclksel = _fnclksel, \ | ||
.rate = _rate, \ | ||
.ops = _ops, \ | ||
} | ||
|
||
#define APMU_CLK(_name, _reg, _eval, _rate) \ | ||
struct clk clk_##_name = { \ | ||
.clk_rst = (void __iomem *)APMU_##_reg, \ | ||
.enable_val = _eval, \ | ||
.rate = _rate, \ | ||
.ops = &apmu_clk_ops, \ | ||
} | ||
|
||
#define APMU_CLK_OPS(_name, _reg, _eval, _rate, _ops) \ | ||
struct clk clk_##_name = { \ | ||
.clk_rst = (void __iomem *)APMU_##_reg, \ | ||
.enable_val = _eval, \ | ||
.rate = _rate, \ | ||
.ops = _ops, \ | ||
} | ||
|
||
#define INIT_CLKREG(_clk, _devname, _conname) \ | ||
{ \ | ||
.clk = _clk, \ | ||
.dev_id = _devname, \ | ||
.con_id = _conname, \ | ||
} | ||
|
||
extern struct clk clk_pxa168_gpio; | ||
extern struct clk clk_pxa168_timers; | ||
|
||
extern void clks_register(struct clk_lookup *, size_t); |
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,37 @@ | ||
/* | ||
* linux/arch/arm/mach-mmp/common.c | ||
* | ||
* Code common to PXA168 processor lines | ||
* | ||
* 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. | ||
*/ | ||
|
||
#include <linux/init.h> | ||
#include <linux/kernel.h> | ||
|
||
#include <asm/page.h> | ||
#include <asm/mach/map.h> | ||
#include <mach/addr-map.h> | ||
|
||
#include "common.h" | ||
|
||
static struct map_desc standard_io_desc[] __initdata = { | ||
{ | ||
.pfn = __phys_to_pfn(APB_PHYS_BASE), | ||
.virtual = APB_VIRT_BASE, | ||
.length = APB_PHYS_SIZE, | ||
.type = MT_DEVICE, | ||
}, { | ||
.pfn = __phys_to_pfn(AXI_PHYS_BASE), | ||
.virtual = AXI_VIRT_BASE, | ||
.length = AXI_PHYS_SIZE, | ||
.type = MT_DEVICE, | ||
}, | ||
}; | ||
|
||
void __init pxa_map_io(void) | ||
{ | ||
iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); | ||
} |
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,11 @@ | ||
#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) | ||
|
||
struct sys_timer; | ||
|
||
extern void timer_init(int irq); | ||
|
||
extern struct sys_timer pxa168_timer; | ||
extern void __init pxa168_init_irq(void); | ||
|
||
extern void __init icu_init_irq(void); | ||
extern void __init pxa_map_io(void); |
Oops, something went wrong.