add rk29 io.c and board.h

This commit is contained in:
lhh
2010-10-20 20:09:28 +08:00
parent 4a2cc2fb90
commit 8daba86d80
5 changed files with 72 additions and 39 deletions

View File

@@ -1,2 +1,2 @@
obj-y += timer.o
obj-y += timer.o io.o
obj-$(CONFIG_MACH_RK29SDK) += board-rk29sdk.o

View File

@@ -1,4 +1,4 @@
/* linux/arch/arm/mach-rk29/board-rk29.c
/* arch/arm/mach-rk29/board-rk29.c
*
* Copyright (C) 2010 ROCKCHIP, Inc.
*
@@ -32,7 +32,7 @@
#include <mach/irqs.h>
#include <mach/rk29_iomap.h>
#include <mach/board.h>
#include <linux/mtd/nand.h>
@@ -40,40 +40,6 @@
extern struct sys_timer rk29_timer;
//IOӳ<4F>ʽ<E4B7BD><CABD><EFBFBD><EFBFBD> <20><>ÿ<EFBFBD><C3BF>Ϊһ<CEAA><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3>
static struct map_desc rk29_io_desc[] __initdata = {
{
.virtual = RK29_GICCPU_BASE,
.pfn = __phys_to_pfn(RK29_GICCPU_PHYS),
.length = RK29_GICCPU_SIZE,
.type = MT_DEVICE
},
{
.virtual = RK29_GICPERI_BASE,
.pfn = __phys_to_pfn(RK29_GICPERI_PHYS),
.length = RK29_GICPERI_SIZE,
.type = MT_DEVICE
},
{
.virtual = RK29_NANDC_BASE,
.pfn = __phys_to_pfn(RK29_NANDC_PHYS),
.length = RK29_NANDC_SIZE,
.type = MT_DEVICE
},
{
.virtual = RK29_DDRC_BASE,
.pfn = __phys_to_pfn(RK29_DDRC_PHYS),
.length = RK29_DDRC_SIZE,
.type = MT_DEVICE
},
};
static void __init rk29_gic_init_irq(void)
{
gic_dist_init(0, RK29_GICPERI_BASE, 32);
@@ -93,7 +59,7 @@ static void __init machine_rk29_board_init(void)
static void __init machine_rk29_mapio(void)
{
iotable_init(rk29_io_desc, ARRAY_SIZE(rk29_io_desc));
rk29_map_common_io();
//rk29_clock_init();
//rk29_iomux_init();
}

View File

@@ -0,0 +1,22 @@
/* arch/arm/mach-rk29/include/mach/board.h
*
* Copyright (C) 2010 ROCKCHIP, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_RK29_BOARD_H
#define __ASM_ARCH_RK29_BOARD_H
#include <linux/types.h>
void __init rk29_map_common_io(void);
#endif

View File

@@ -126,8 +126,9 @@
#define RK29_TIMER0_BASE (RK29_ADDR_BASE1+0x38000)
#define RK29_TIMER0_PHYS 0x20038000
#define RK29_TIMER0_SIZE SZ_8K
#define RK29_TIMER1_BASE (RK29_ADDR_BASE1+0x3A000)
#define RK29_TIMER1_PHYS 0x2003A000
#define RK29_TIMER0_SIZE SZ_8K
#define RK29_TIMER1_SIZE SZ_8K
#define RK29_GPIO4_PHYS 0x2003C000
#define RK29_GPIO4_SIZE SZ_8K
#define RK29_GPIO6_PHYS 0x2003E000

44
arch/arm/mach-rk29/io.c Normal file
View File

@@ -0,0 +1,44 @@
/* arch/arm/mach-rk29/io.c
*
* Copyright (C) 2010 ROCKCHIP, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
#include <asm/page.h>
#include <mach/rk29_iomap.h>
#include <asm/mach/map.h>
#include <mach/board.h>
#define RK29_DEVICE(name) { \
.virtual = (unsigned long) RK29_##name##_BASE, \
.pfn = __phys_to_pfn(RK29_##name##_PHYS), \
.length = RK29_##name##_SIZE, \
.type = MT_DEVICE_NONSHARED, \
}
static struct map_desc rk29_io_desc[] __initdata = {
RK29_DEVICE(GICCPU),
RK29_DEVICE(GICPERI),
RK29_DEVICE(TIMER0),
RK29_DEVICE(TIMER1),
RK29_DEVICE(DDRC),
RK29_DEVICE(UART1),
};
void __init rk29_map_common_io(void)
{
iotable_init(rk29_io_desc, ARRAY_SIZE(rk29_io_desc));
}