-
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] 4303/3: base kernel support for TI DaVinci
Add base kernel support for the TI DaVinci platform. This patch only includes interrupts, timers, CPU identification, serial support and basic power and sleep controller init. More drivers to come. Signed-off-by: Kevin Hilman <khilman@mvista.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
- Loading branch information
Kevin Hilman
authored and
Russell King
committed
May 11, 2007
1 parent
7fdc784
commit 7c6337e
Showing
27 changed files
with
1,674 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
if ARCH_DAVINCI | ||
|
||
menu "TI DaVinci Implementations" | ||
|
||
comment "DaVinci Core Type" | ||
|
||
config ARCH_DAVINCI644x | ||
default y | ||
bool "DaVinci 644x based system" | ||
|
||
comment "DaVinci Board Type" | ||
|
||
config MACH_DAVINCI_EVM | ||
bool "TI DaVinci EVM" | ||
default y | ||
depends on ARCH_DAVINCI644x | ||
help | ||
Configure this option to specify the whether the board used | ||
for development is a DaVinci EVM | ||
|
||
endmenu | ||
|
||
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,10 @@ | ||
# | ||
# Makefile for the linux kernel. | ||
# | ||
# | ||
|
||
# Common objects | ||
obj-y := time.o irq.o serial.o io.o id.o psc.o | ||
|
||
# Board specific | ||
obj-$(CONFIG_MACH_DAVINCI_EVM) += board-evm.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,3 @@ | ||
zreladdr-y := 0x80008000 | ||
params_phys-y := 0x80000100 | ||
initrd_phys-y := 0x80800000 |
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,131 @@ | ||
/* | ||
* TI DaVinci EVM board support | ||
* | ||
* Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com> | ||
* | ||
* 2007 (c) MontaVista Software, Inc. 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 <linux/kernel.h> | ||
#include <linux/module.h> | ||
#include <linux/init.h> | ||
#include <linux/dma-mapping.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/mtd/mtd.h> | ||
#include <linux/mtd/partitions.h> | ||
#include <linux/mtd/physmap.h> | ||
|
||
#include <asm/setup.h> | ||
#include <asm/io.h> | ||
#include <asm/mach-types.h> | ||
#include <asm/hardware.h> | ||
|
||
#include <asm/mach/arch.h> | ||
#include <asm/mach/map.h> | ||
#include <asm/mach/flash.h> | ||
|
||
#include <asm/arch/common.h> | ||
|
||
/* other misc. init functions */ | ||
void __init davinci_psc_init(void); | ||
void __init davinci_irq_init(void); | ||
void __init davinci_map_common_io(void); | ||
|
||
/* NOR Flash base address set to CS0 by default */ | ||
#define NOR_FLASH_PHYS 0x02000000 | ||
|
||
static struct mtd_partition davinci_evm_partitions[] = { | ||
/* bootloader (U-Boot, etc) in first 4 sectors */ | ||
{ | ||
.name = "bootloader", | ||
.offset = 0, | ||
.size = 4 * SZ_64K, | ||
.mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
}, | ||
/* bootloader params in the next 1 sectors */ | ||
{ | ||
.name = "params", | ||
.offset = MTDPART_OFS_APPEND, | ||
.size = SZ_64K, | ||
.mask_flags = 0, | ||
}, | ||
/* kernel */ | ||
{ | ||
.name = "kernel", | ||
.offset = MTDPART_OFS_APPEND, | ||
.size = SZ_2M, | ||
.mask_flags = 0 | ||
}, | ||
/* file system */ | ||
{ | ||
.name = "filesystem", | ||
.offset = MTDPART_OFS_APPEND, | ||
.size = MTDPART_SIZ_FULL, | ||
.mask_flags = 0 | ||
} | ||
}; | ||
|
||
static struct physmap_flash_data davinci_evm_flash_data = { | ||
.width = 2, | ||
.parts = davinci_evm_partitions, | ||
.nr_parts = ARRAY_SIZE(davinci_evm_partitions), | ||
}; | ||
|
||
/* NOTE: CFI probe will correctly detect flash part as 32M, but EMIF | ||
* limits addresses to 16M, so using addresses past 16M will wrap */ | ||
static struct resource davinci_evm_flash_resource = { | ||
.start = NOR_FLASH_PHYS, | ||
.end = NOR_FLASH_PHYS + SZ_16M - 1, | ||
.flags = IORESOURCE_MEM, | ||
}; | ||
|
||
static struct platform_device davinci_evm_flash_device = { | ||
.name = "physmap-flash", | ||
.id = 0, | ||
.dev = { | ||
.platform_data = &davinci_evm_flash_data, | ||
}, | ||
.num_resources = 1, | ||
.resource = &davinci_evm_flash_resource, | ||
}; | ||
|
||
static struct platform_device *davinci_evm_devices[] __initdata = { | ||
&davinci_evm_flash_device, | ||
}; | ||
|
||
static void __init | ||
davinci_evm_map_io(void) | ||
{ | ||
davinci_map_common_io(); | ||
} | ||
|
||
static __init void davinci_evm_init(void) | ||
{ | ||
davinci_psc_init(); | ||
|
||
#if defined(CONFIG_BLK_DEV_DAVINCI) || defined(CONFIG_BLK_DEV_DAVINCI_MODULE) | ||
printk(KERN_WARNING "WARNING: both IDE and NOR flash are enabled, " | ||
"but share pins.\n\t Disable IDE for NOR support.\n"); | ||
#endif | ||
|
||
platform_add_devices(davinci_evm_devices, | ||
ARRAY_SIZE(davinci_evm_devices)); | ||
} | ||
|
||
static __init void davinci_evm_irq_init(void) | ||
{ | ||
davinci_irq_init(); | ||
} | ||
|
||
MACHINE_START(DAVINCI_EVM, "DaVinci EVM") | ||
/* Maintainer: MontaVista Software <source@mvista.com> */ | ||
.phys_io = IO_PHYS, | ||
.io_pg_offst = (io_p2v(IO_PHYS) >> 18) & 0xfffc, | ||
.boot_params = (DAVINCI_DDR_BASE + 0x100), | ||
.map_io = davinci_evm_map_io, | ||
.init_irq = davinci_evm_irq_init, | ||
.timer = &davinci_timer, | ||
.init_machine = davinci_evm_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,94 @@ | ||
/* | ||
* Davinci CPU identification code | ||
* | ||
* Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com> | ||
* | ||
* Derived from OMAP1 CPU identification code. | ||
* | ||
* 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/init.h> | ||
|
||
#include <asm/io.h> | ||
|
||
#define JTAG_ID_BASE 0x01c40028 | ||
|
||
struct davinci_id { | ||
u8 variant; /* JTAG ID bits 31:28 */ | ||
u16 part_no; /* JTAG ID bits 27:12 */ | ||
u32 manufacturer; /* JTAG ID bits 11:1 */ | ||
u32 type; /* Cpu id bits [31:8], cpu class bits [7:0] */ | ||
}; | ||
|
||
/* Register values to detect the DaVinci version */ | ||
static struct davinci_id davinci_ids[] __initdata = { | ||
{ | ||
/* DM6446 */ | ||
.part_no = 0xb700, | ||
.variant = 0x0, | ||
.manufacturer = 0x017, | ||
.type = 0x64460000, | ||
}, | ||
}; | ||
|
||
/* | ||
* Get Device Part No. from JTAG ID register | ||
*/ | ||
static u16 __init davinci_get_part_no(void) | ||
{ | ||
u32 dev_id, part_no; | ||
|
||
dev_id = davinci_readl(JTAG_ID_BASE); | ||
|
||
part_no = ((dev_id >> 12) & 0xffff); | ||
|
||
return part_no; | ||
} | ||
|
||
/* | ||
* Get Device Revision from JTAG ID register | ||
*/ | ||
static u8 __init davinci_get_variant(void) | ||
{ | ||
u32 variant; | ||
|
||
variant = davinci_readl(JTAG_ID_BASE); | ||
|
||
variant = (variant >> 28) & 0xf; | ||
|
||
return variant; | ||
} | ||
|
||
void __init davinci_check_revision(void) | ||
{ | ||
int i; | ||
u16 part_no; | ||
u8 variant; | ||
|
||
part_no = davinci_get_part_no(); | ||
variant = davinci_get_variant(); | ||
|
||
/* First check only the major version in a safe way */ | ||
for (i = 0; i < ARRAY_SIZE(davinci_ids); i++) { | ||
if (part_no == (davinci_ids[i].part_no)) { | ||
system_rev = davinci_ids[i].type; | ||
break; | ||
} | ||
} | ||
|
||
/* Check if we can find the dev revision */ | ||
for (i = 0; i < ARRAY_SIZE(davinci_ids); i++) { | ||
if (part_no == davinci_ids[i].part_no && | ||
variant == davinci_ids[i].variant) { | ||
system_rev = davinci_ids[i].type; | ||
break; | ||
} | ||
} | ||
|
||
printk("DaVinci DM%04x variant 0x%x\n", system_rev >> 16, variant); | ||
} |
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,51 @@ | ||
/* | ||
* DaVinci I/O mapping code | ||
* | ||
* Copyright (C) 2005-2006 Texas Instruments | ||
* | ||
* 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/init.h> | ||
|
||
#include <asm/tlb.h> | ||
#include <asm/io.h> | ||
#include <asm/memory.h> | ||
|
||
#include <asm/mach/map.h> | ||
|
||
extern void davinci_check_revision(void); | ||
|
||
/* | ||
* The machine specific code may provide the extra mapping besides the | ||
* default mapping provided here. | ||
*/ | ||
static struct map_desc davinci_io_desc[] __initdata = { | ||
{ | ||
.virtual = IO_VIRT, | ||
.pfn = __phys_to_pfn(IO_PHYS), | ||
.length = IO_SIZE, | ||
.type = MT_DEVICE | ||
}, | ||
}; | ||
|
||
void __init davinci_map_common_io(void) | ||
{ | ||
iotable_init(davinci_io_desc, ARRAY_SIZE(davinci_io_desc)); | ||
|
||
/* Normally devicemaps_init() would flush caches and tlb after | ||
* mdesc->map_io(), but we must also do it here because of the CPU | ||
* revision check below. | ||
*/ | ||
local_flush_tlb_all(); | ||
flush_cache_all(); | ||
|
||
/* We want to check CPU revision early for cpu_is_xxxx() macros. | ||
* IO space mapping must be initialized before we can do that. | ||
*/ | ||
davinci_check_revision(); | ||
} |
Oops, something went wrong.